01 Aug, 2007

1 commit

  • Is there a reason why the "online" file in the subdirectories for the CPUs
    in /sys/devices/system isn't world-readable? I cannot imagine it to be
    security relevant especially now that a getcpu() syscall can be used to
    determine what CPUa thread runs on.

    The file is useful to correctly implement the sysconf() function to return
    the number of online CPUs. In the presence of hotplug we currently cannot
    provide this information. The patch below should to it.

    Signed-off-by: Ulrich Drepper
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ulrich Drepper
     

31 Jul, 2007

3 commits


30 Jul, 2007

1 commit

  • Introduce CONFIG_SUSPEND representing the ability to enter system sleep
    states, such as the ACPI S3 state, and allow the user to choose SUSPEND
    and HIBERNATION independently of each other.

    Make HOTPLUG_CPU be selected automatically if SUSPEND or HIBERNATION has
    been chosen and the kernel is intended for SMP systems.

    Also, introduce CONFIG_PM_SLEEP which is automatically selected if
    CONFIG_SUSPEND or CONFIG_HIBERNATION is set and use it to select the
    code needed for both suspend and hibernation.

    The top-level power management headers and the ACPI code related to
    suspend and hibernation are modified to use the new definitions (the
    changes in drivers/acpi/sleep/main.c are, mostly, moving code to reduce
    the number of ifdefs).

    There are many other files in which CONFIG_PM can be replaced with
    CONFIG_PM_SLEEP or even with CONFIG_SUSPEND, but they can be updated in
    the future.

    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Linus Torvalds

    Rafael J. Wysocki
     

27 Jul, 2007

1 commit

  • Commit bd804eba1c8597cbb7cd5a5f9fe886aae16a079a ("PM: Introduce
    pm_power_off_prepare") caused problems in the poweroff path, as reported by
    YOSHIFUJI Hideaki / 吉藤英明.

    Generally, sysdev_shutdown() should be called after the ACPI preparation for
    powering the system off. To make it happen, we can separate sysdev_shutdown()
    from device_shutdown() and call it directly wherever necessary.

    Signed-off-by: Rafael J. Wysocki
    Tested-by: YOSHIFUJI Hideaki / 吉藤英明
    Signed-off-by: Linus Torvalds

    Rafael J. Wysocki
     

22 Jul, 2007

1 commit

  • Signed-off-by: Nigel Cunningham
    Cc: Randy Dunlap
    Cc: "Rafael J. Wysocki"
    Cc: Pavel Machek
    Acked-by: Linus Torvalds
    Signed-off-by: Andrew Morton
    Signed-off-by: Andi Kleen
    Signed-off-by: Linus Torvalds

    Nigel Cunningham
     

20 Jul, 2007

1 commit

  • In order to enable things like PM_TRACE, you're required to enable
    PM_DEBUG, which sends a large spew of messages on boot, and often times can
    overflow dmesg buffer.

    Create new PM_VERBOSE and shift that to be the option that enables
    drivers/base/power's messages.

    Signed-off-by: Ben Collins
    Cc: "Rafael J. Wysocki"
    Cc: Pavel Machek
    Cc: Greg KH
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ben Collins
     

19 Jul, 2007

4 commits


17 Jul, 2007

1 commit

  • Using dev_to_node(&dev->dev) to get node, and kmalloc_node to dma buffer on
    corresponding node dma pool

    Signed-off-by: Yinghai Lu
    Cc: Andi Kleen
    Cc: Christoph Lameter
    Cc: David Rientjes
    Cc: Greg KH
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Yinghai Lu
     

12 Jul, 2007

16 commits

  • Well, first of all, I don't want to change so many files either.

    What I do:
    Adding a new parameter "struct bin_attribute *" in the
    .read/.write methods for the sysfs binary attributes.

    In fact, only the four lines change in fs/sysfs/bin.c and
    include/linux/sysfs.h do the real work.
    But I have to update all the files that use binary attributes
    to make them compatible with the new .read and .write methods.
    I'm not sure if I missed any. :(

    Why I do this:
    For a sysfs attribute, we can get a pointer pointing to the
    struct attribute in the .show/.store method,
    while we can't do this for the binary attributes.
    I don't know why this is different, but this does make it not
    so handy to use the binary attributes as the regular ones.
    So I think this patch is reasonable. :)

    Who benefits from it:
    The patch that exposes ACPI tables in sysfs
    requires such an improvement.
    All the table binary attributes share the same .read method.
    Parameter "struct bin_attribute *" is used to get
    the table signature and instance number which are used to
    distinguish different ACPI table binary attributes.

    Without this parameter, we need to offer different .read methods
    for different ACPI table binary attributes.
    This is impossible as there are various ACPI tables on different
    platforms, and we don't know what they are until they are loaded.

    Signed-off-by: Zhang Rui
    Signed-off-by: Greg Kroah-Hartman

    Zhang Rui
     
  • devt_attr and uevent_attr are either allocated dynamically with or
    embedded in device and class_device as they needed their owner field
    set to the module implementing the driver. Now that sysfs implements
    immediate disconnect and owner field removed from struct attribute,
    there is no reason to do this. Remove these attributes from
    [class_]device and use static attribute structures instead.

    Signed-off-by: Tejun Heo
    Signed-off-by: Greg Kroah-Hartman

    Tejun Heo
     
  • sysfs is now completely out of driver/module lifetime game. After
    deletion, a sysfs node doesn't access anything outside sysfs proper,
    so there's no reason to hold onto the attribute owners. Note that
    often the wrong modules were accounted for as owners leading to
    accessing removed modules.

    This patch kills now unnecessary attribute->owner. Note that with
    this change, userland holding a sysfs node does not prevent the
    backing module from being unloaded.

    For more info regarding lifetime rule cleanup, please read the
    following message.

    http://article.gmane.org/gmane.linux.kernel/510293

    (tweaked by Greg to not delete the field just yet, to make it easier to
    merge things properly.)

    Signed-off-by: Tejun Heo
    Cc: Cornelia Huck
    Cc: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Tejun Heo
     
  • This converts code of the form

    if ((error = some_func()))
    goto fixup;
    to
    error = some_func();
    if (error)
    goto fixup;

    Signed-off-by: Cornelia Huck
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Cornelia Huck
     
  • The checks if the device's parent is in the right state done in
    drivers/base/power/suspend.c and drivers/base/power/resume.c serve no particular
    purpose, since if the parent is in a wrong power state, the device's suspend or
    resume callbacks are supposed to return an error anyway. Moreover, they are
    also useless from the sanity checking point of view, because they rely on the
    code being checked to set dev->parent->power.power_state.event appropriately,
    which need not happen if that code is buggy. For these reasons they can be
    removed.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: David Brownell
    Signed-off-by: Greg Kroah-Hartman

    Rafael J. Wysocki
     
  • The suspend routines should be called for every device during a system sleep
    transition, regardless of the device's state, so that drivers can regard these
    method calls as notifications that the system is about to go to sleep, rather
    than as directives to put their devices into the 'off' state.

    This is documented in Documentation/power/devices.txt and is already done in
    the core resume code, so it seems reasonable to make the core suspend code
    behave accordingly.

    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Greg Kroah-Hartman

    Rafael J. Wysocki
     
  • The prev_state member of struct dev_pm_info (defined in include/linux/pm.h) is
    only used during a resume to check if the device's state before the suspend was
    'off', in which case the device is not resumed. However, in such cases the
    decision whether or not to resume the device should be made on the driver level
    and the resume callbacks from the device's bus and class should be executed
    anyway (the may be needed for some things other than just powering on the
    device).

    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Greg Kroah-Hartman

    Rafael J. Wysocki
     
  • Every file should include the headers containing the prototypes for
    it's global functions.

    Since the GNU C compiler is now able to detect that the function
    prototype of devres_release_all() in the header and the actual function
    disagree regarding the return value, this patch also fixes this bug.

    Signed-off-by: Adrian Bunk
    Acked-by: Tejun Heo
    Signed-off-by: Greg Kroah-Hartman

    Adrian Bunk
     
  • Signed-off-by: Stefan Richter
    Signed-off-by: Greg Kroah-Hartman

    Stefan Richter
     
  • Signed-off-by: Stefan Richter
    Signed-off-by: Greg Kroah-Hartman

    Stefan Richter
     
  • attribute_container.c uses DEFINE_MUTEX, so while
    linux/mutex.h seems to be pulled in indirectly
    by one of the headers it includes, the right thing
    is to include linux/mutex.h directly.

    Signed-off-by: Michael S. Tsirkin

    Michael S. Tsirkin
     
  • Reduce code duplication in drivers/base/suspend.c by introducing a separate
    function for printing diagnostic messages.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Pavel Machek
    Signed-off-by: Greg Kroah-Hartman

    Rafael J. Wysocki
     
  • The pm_parent member of struct dev_pm_info (defined in include/linux/pm.h) is
    only used to check if the device's parent is in the right state while the
    device is being suspended or resumed. However, this can be done just as well
    with the help of the parent pointer in struct device, so pm_parent can be
    removed along with some code that handles it.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: David Brownell
    Signed-off-by: Greg Kroah-Hartman

    Rafael J. Wysocki
     
  • The Power Management code uses semaphores as mutexes. Use the mutex API
    instead of the (binary) semaphores.

    Signed-off-by: Matthias Kaehlcke
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Matthias Kaehlcke
     
  • The sysdev code use a semaphore as mutex. Use the mutex API instead of the
    (binary) semaphore.

    Signed-off-by: Matthias Kaehlcke
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Matthias Kaehlcke
     
  • We get uevents for a bus/class going away, but not one registering.
    Add the missing uevent in kset_register(), which will send an
    event for a new bus/class. Suppress all unwanted uevents for bus
    subdirectories like /bus/*/devices/, /bus/*/drivers/.

    Now we get for module usbcore:
    add /module/usbcore (module)
    add /bus/usb (bus)
    add /class/usb_host (class)
    add /bus/usb/drivers/hub (drivers)
    add /bus/usb/drivers/usb (drivers)
    remove /bus/usb/drivers/usb (drivers)
    remove /bus/usb/drivers/hub (drivers)
    remove /class/usb_host (class)
    remove /bus/usb (bus)
    remove /module/usbcore (module)

    instead of:
    add /module/usbcore (module)
    add /bus/usb/drivers/hub (drivers)
    add /bus/usb/drivers/usb (drivers)
    remove /bus/usb/drivers/usb (drivers)
    remove /bus/usb/drivers/hub (drivers)
    remove /class/usb_host (class)
    remove /bus/usb/drivers (bus)
    remove /bus/usb/devices (bus)
    remove /bus/usb (bus)
    remove /module/usbcore (module)

    Signed-off-by: Kay Sievers
    Signed-off-by: Greg Kroah-Hartman

    Kay Sievers
     

09 Jun, 2007

3 commits


22 May, 2007

1 commit

  • First thing mm.h does is including sched.h solely for can_do_mlock() inline
    function which has "current" dereference inside. By dealing with can_do_mlock()
    mm.h can be detached from sched.h which is good. See below, why.

    This patch
    a) removes unconditional inclusion of sched.h from mm.h
    b) makes can_do_mlock() normal function in mm/mlock.c
    c) exports can_do_mlock() to not break compilation
    d) adds sched.h inclusions back to files that were getting it indirectly.
    e) adds less bloated headers to some files (asm/signal.h, jiffies.h) that were
    getting them indirectly

    Net result is:
    a) mm.h users would get less code to open, read, preprocess, parse, ... if
    they don't need sched.h
    b) sched.h stops being dependency for significant number of files:
    on x86_64 allmodconfig touching sched.h results in recompile of 4083 files,
    after patch it's only 3744 (-8.3%).

    Cross-compile tested on

    all arm defconfigs, all mips defconfigs, all powerpc defconfigs,
    alpha alpha-up
    arm
    i386 i386-up i386-defconfig i386-allnoconfig
    ia64 ia64-up
    m68k
    mips
    parisc parisc-up
    powerpc powerpc-up
    s390 s390-up
    sparc sparc-up
    sparc64 sparc64-up
    um-x86_64
    x86_64 x86_64-up x86_64-defconfig x86_64-allnoconfig

    as well as my two usual configs.

    Signed-off-by: Alexey Dobriyan
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     

10 May, 2007

2 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial: (25 commits)
    sound: convert "sound" subdirectory to UTF-8
    MAINTAINERS: Add cxacru website/mailing list
    include files: convert "include" subdirectory to UTF-8
    general: convert "kernel" subdirectory to UTF-8
    documentation: convert the Documentation directory to UTF-8
    Convert the toplevel files CREDITS and MAINTAINERS to UTF-8.
    remove broken URLs from net drivers' output
    Magic number prefix consistency change to Documentation/magic-number.txt
    trivial: s/i_sem /i_mutex/
    fix file specification in comments
    drivers/base/platform.c: fix small typo in doc
    misc doc and kconfig typos
    Remove obsolete fat_cvf help text
    Fix occurrences of "the the "
    Fix minor typoes in kernel/module.c
    Kconfig: Remove reference to external mqueue library
    Kconfig: A couple of grammatical fixes in arch/i386/Kconfig
    Correct comments in genrtc.c to refer to correct /proc file.
    Fix more "deprecated" spellos.
    Fix "deprecated" typoes.
    ...

    Fix trivial comment conflict in kernel/relay.c.

    Linus Torvalds
     
  • Since nonboot CPUs are now disabled after tasks and devices have been
    frozen and the CPU hotplug infrastructure is used for this purpose, we need
    special CPU hotplug notifications that will help the CPU-hotplug-aware
    subsystems distinguish normal CPU hotplug events from CPU hotplug events
    related to a system-wide suspend or resume operation in progress. This
    patch introduces such notifications and causes them to be used during
    suspend and resume transitions. It also changes all of the
    CPU-hotplug-aware subsystems to take these notifications into consideration
    (for now they are handled in the same way as the corresponding "normal"
    ones).

    [oleg@tv-sign.ru: cleanups]
    Signed-off-by: Rafael J. Wysocki
    Cc: Gautham R Shenoy
    Cc: Pavel Machek
    Signed-off-by: Oleg Nesterov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rafael J. Wysocki
     

09 May, 2007

3 commits

  • Typo: iwithout -> without.

    Signed-off-by: Márton Németh
    Signed-off-by: Adrian Bunk

    Márton Németh
     
  • Make devres.c ready for adding to DocBook.
    Add devres.c to DocBook.

    Signed-off-by: Randy Dunlap
    Signed-off-by: Adrian Bunk

    Randy Dunlap
     
  • We've had various reports of some legacy "probe the hardware" style
    platform drivers having nasty problems with hotplug support.

    The core issue is that those legacy drivers don't fully conform to the
    driver model. They assume a role that should be the responsibility of
    infrastructure code: creating device nodes.

    The "modprobe" step in hotplugging relies on drivers to have split those
    roles into different modules. The lack of this split causes the problems.
    When a driver creates nodes for devices that don't exist (sending a hotplug
    event), then exits (aborting one modprobe) before the "modprobe $MODALIAS"
    step completes (by failing, since it's in the middle of a modprobe), the
    result can be an endless loop of modprobe invocations ... badness.

    This fix uses the newish per-device flag controlling issuance of "add"
    events. (A previous version of this patch used a per-device "driver can
    hotplug" flag, which only scrubbed $MODALIAS from the environment rather
    than suppressing the entire hotplug event.) It also shrinks that flag to
    one bit, saving a word in "struct device".

    So the net of this patch is removing some nasty failures with legacy
    drivers, while retaining hotplug capability for the majority of platform
    drivers.

    Signed-off-by: David Brownell
    Cc: Greg KH
    Cc: Andres Salomon
    Cc: Dominik Brodowski
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Brownell
     

08 May, 2007

1 commit

  • Architectures that don't support DMA can say so by adding a config NO_DMA
    to their Kconfig file. This will prevent compilation of some dma specific
    driver code. Also dma-mapping-broken.h isn't needed anymore on at least
    s390. This avoids compilation and linking of otherwise dead/broken code.

    Other architectures that include dma-mapping-broken.h are arm26, h8300,
    m68k, m68knommu and v850. If these could be converted as well we could get
    rid of the header file.

    Signed-off-by: Heiko Carstens
    "John W. Linville"
    Cc: Kyle McMartin
    Cc:
    Cc: Tejun Heo
    Cc: Jeff Garzik
    Cc: Martin Schwidefsky
    Cc:
    Cc:
    Cc:
    Cc:
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Heiko Carstens
     

05 May, 2007

1 commit