27 Oct, 2010

1 commit

  • For NUMA node systems it is important to have visibility in memory
    characteristics. Two of the /proc/vmstat values "nr_written" and
    "nr_dirtied" are added here.

    # cat /sys/devices/system/node/node20/vmstat
    nr_written 0
    nr_dirtied 0

    Signed-off-by: Michael Rubin
    Reviewed-by: Wu Fengguang
    Cc: Dave Chinner
    Cc: Jens Axboe
    Cc: KOSAKI Motohiro
    Cc: Nick Piggin
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michael Rubin
     

25 Oct, 2010

2 commits

  • * 'next-devicetree' of git://git.secretlab.ca/git/linux-2.6:
    mtd/m25p80: add support to parse the partitions by OF node
    of/irq: of_irq.c needs to include linux/irq.h
    of/mips: Cleanup some include directives/files.
    of/mips: Add device tree support to MIPS
    of/flattree: Eliminate need to provide early_init_dt_scan_chosen_arch
    of/device: Rework to use common platform_device_alloc() for allocating devices
    of/xsysace: Fix OF probing on little-endian systems
    of: use __be32 types for big-endian device tree data
    of/irq: remove references to NO_IRQ in drivers/of/platform.c
    of/promtree: add package-to-path support to pdt
    of/promtree: add of_pdt namespace to pdt code
    of/promtree: no longer call prom_ functions directly; use an ops structure
    of/promtree: make drivers/of/pdt.c no longer sparc-only
    sparc: break out some PROM device-tree building code out into drivers/of
    of/sparc: convert various prom_* functions to use phandle
    sparc: stop exporting openprom.h header
    powerpc, of_serial: Endianness issues setting up the serial ports
    of: MTD: Fix OF probing on little-endian systems
    of: GPIO: Fix OF probing on little-endian systems

    Linus Torvalds
     
  • * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (39 commits)
    Update broken web addresses in arch directory.
    Update broken web addresses in the kernel.
    Revert "drivers/usb: Remove unnecessary return's from void functions" for musb gadget
    Revert "Fix typo: configuation => configuration" partially
    ida: document IDA_BITMAP_LONGS calculation
    ext2: fix a typo on comment in ext2/inode.c
    drivers/scsi: Remove unnecessary casts of private_data
    drivers/s390: Remove unnecessary casts of private_data
    net/sunrpc/rpc_pipe.c: Remove unnecessary casts of private_data
    drivers/infiniband: Remove unnecessary casts of private_data
    drivers/gpu/drm: Remove unnecessary casts of private_data
    kernel/pm_qos_params.c: Remove unnecessary casts of private_data
    fs/ecryptfs: Remove unnecessary casts of private_data
    fs/seq_file.c: Remove unnecessary casts of private_data
    arm: uengine.c: remove C99 comments
    arm: scoop.c: remove C99 comments
    Fix typo configue => configure in comments
    Fix typo: configuation => configuration
    Fix typo interrest[ing|ed] => interest[ing|ed]
    Fix various typos of valid in comments
    ...

    Fix up trivial conflicts in:
    drivers/char/ipmi/ipmi_si_intf.c
    drivers/usb/gadget/rndis.c
    net/irda/irnet/irnet_ppp.c

    Linus Torvalds
     

23 Oct, 2010

16 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6: (31 commits)
    driver core: Display error codes when class suspend fails
    Driver core: Add section count to memory_block struct
    Driver core: Add mutex for adding/removing memory blocks
    Driver core: Move find_memory_block routine
    hpilo: Despecificate driver from iLO generation
    driver core: Convert link_mem_sections to use find_memory_block_hinted.
    driver core: Introduce find_memory_block_hinted which utilizes kset_find_obj_hinted.
    kobject: Introduce kset_find_obj_hinted.
    driver core: fix build for CONFIG_BLOCK not enabled
    driver-core: base: change to new flag variable
    sysfs: only access bin file vm_ops with the active lock
    sysfs: Fail bin file mmap if vma close is implemented.
    FW_LOADER: fix kconfig dependency warning on HOTPLUG
    uio: Statically allocate uio_class and use class .dev_attrs.
    uio: Support 2^MINOR_BITS minors
    uio: Cleanup irq handling.
    uio: Don't clear driver data
    uio: Fix lack of locking in init_uio_class
    SYSFS: Allow boot time switching between deprecated and modern sysfs layout
    driver core: remove CONFIG_SYSFS_DEPRECATED_V2 but keep it for block devices
    ...

    Linus Torvalds
     
  • Aid diagnostics by printing the error code from failed suspends, which
    doesn't otherwise seem to get displayed.

    Signed-off-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Mark Brown
     
  • Add a section count property to the memory_block struct to track the number
    of memory sections that have been added/removed from a memory block. This
    allows us to know when the last memory section of a memory block has been
    removed so we can remove the memory block.

    Signed-off-by: Nathan Fontenot
    Reviewed-by: Robin Holt
    Reviewed-by: KAMEZAWA Hiroyuki
    Signed-off-by: Greg Kroah-Hartman

    Nathan Fontenot
     
  • Add a new mutex for use in adding and removing of memory blocks. This
    is needed to avoid any race conditions in which the same memory block could
    be added and removed at the same time.

    Signed-off-by: Nathan Fontenot
    Reviewed-by: Robin Holt
    Reviewed-By: KAMEZAWA Hiroyuki
    Signed-off-by: Greg Kroah-Hartman

    Nathan Fontenot
     
  • Move the find_memory_block() routine up to avoid needing a forward
    declaration in subsequent patches.

    Signed-off-by: Nathan Fontenot
    Reviewed-by: Robin Holt
    Reviewed-By: KAMEZAWA Hiroyuki
    Signed-off-by: Greg Kroah-Hartman

    Nathan Fontenot
     
  • Modify link_mem_sections() to pass in the previous mem_block as a hint to
    locating the next mem_block. Since they are typically added in order this
    results in a massive saving in time during boot of a very large system.
    For example, on a 16TB x86_64 machine, it reduced the total time spent
    linking all node's memory sections from 1 hour, 27 minutes to 46 seconds.

    Signed-off-by: Robin Holt
    To: Gary Hade
    To: Badari Pulavarty
    To: Ingo Molnar
    Reviewed-by: KAMEZAWA Hiroyuki
    Signed-off-by: Greg Kroah-Hartman

    Robin Holt
     
  • Introduce a find_memory_block_hinted() which utilizes the
    recently added kset_find_obj_hinted().

    Signed-off-by: Robin Holt
    To: Dave Hansen
    To: Matt Tolentino
    Reviewed-by: KAMEZAWA Hiroyuki
    Signed-off-by: Greg Kroah-Hartman

    Robin Holt
     
  • Fix build errors when CONFIG_BLOCK is not enabled:

    drivers/base/core.c: In function 'get_device_parent':
    drivers/base/core.c:634: error: 'block_class' undeclared (first use in this function)
    drivers/base/core.c: In function 'device_add_class_symlinks':
    drivers/base/core.c:723: error: 'block_class' undeclared (first use in this function)
    drivers/base/core.c: In function 'device_remove_class_symlinks':
    drivers/base/core.c:751: error: 'block_class' undeclared (first use in this function)

    Signed-off-by: Randy Dunlap
    Signed-off-by: Greg Kroah-Hartman

    Randy Dunlap
     
  • Replace EXTRA_CFLAGS with ccflags-y.

    Signed-off-by: matt mooney
    Acked-by: WANG Cong
    Signed-off-by: Greg Kroah-Hartman

    matt mooney
     
  • Fix kconfig dependency warning for FW_LOADER.

    Lots of drivers select FW_LOADER without bothering to depend on
    HOTPLUG and/or without selecting HOTPLUG. A kernel builds fine
    when FW_LOADER is enabled, whether HOTPLUG is enabled or not, and
    a kernel config file (make oldconfig) is not changed by this patch.
    (Yes, drivers/base/firmware_class.c uses interfaces from linux/kobject.h,
    which does have some CONFIG_HOTPLUG dependencies, but this patch does
    not change that.)

    warning: (MICROCODE || MICROCODE_INTEL && MICROCODE || MICROCODE_AMD && MICROCODE || PCMCIA_LOAD_CIS && PCCARD && PCMCIA && EXPERIMENTAL || USB_IRDA && NET && IRDA && USB || BT_HCIBCM203X && NET && BT && USB || BT_HCIBFUSB && NET && BT && USB || BT_HCIBT3C && NET && BT && PCMCIA || BT_MRVL_SDIO && NET
    ...
    !STAGING_EXCLUDE_BUILD && USB && (X86 || ARM) && WLAN || DRM_NOUVEAU && STAGING && !STAGING_EXCLUDE_BUILD && DRM && PCI || TI_ST && STAGING && !STAGING_EXCLUDE_BUILD && RFKILL || DELL_RBU && X86) selects FW_LOADER which has unmet direct dependencies (HOTPLUG)
    (5200 byte line reduced a lot)

    Signed-off-by: Randy Dunlap
    Signed-off-by: Greg Kroah-Hartman

    Randy Dunlap
     
  • I have some systems which need legacy sysfs due to old tools that are
    making assumptions that a directory can never be a symlink to another
    directory, and it's a big hazzle to compile separate kernels for them.

    This patch turns CONFIG_SYSFS_DEPRECATED into a run time option
    that can be switched on/off the kernel command line. This way
    the same binary can be used in both cases with just a option
    on the command line.

    The old CONFIG_SYSFS_DEPRECATED_V2 option is still there to set
    the default. I kept the weird name to not break existing
    config files.

    Also the compat code can be still completely disabled by undefining
    CONFIG_SYSFS_DEPRECATED_SWITCH -- just the optimizer takes
    care of this now instead of lots of ifdefs. This makes the code
    look nicer.

    v2: This is an updated version on top of Kay's patch to only
    handle the block devices. I tested it on my old systems
    and that seems to work.

    Cc: axboe@kernel.dk
    Signed-off-by: Andi Kleen
    Cc: Kay Sievers
    Signed-off-by: Greg Kroah-Hartman

    Andi Kleen
     
  • This patch removes the old CONFIG_SYSFS_DEPRECATED_V2 config option,
    but it keeps the logic around to handle block devices in the old manner
    as some people like to run new kernel versions on old (pre 2007/2008)
    distros.

    Signed-off-by: Kay Sievers
    Cc: Jens Axboe
    Cc: Stephen Hemminger
    Cc: "Eric W. Biederman"
    Cc: Alan Stern
    Cc: "James E.J. Bottomley"
    Cc: Andrew Morton
    Cc: Alexey Kuznetsov
    Cc: Randy Dunlap
    Cc: Tejun Heo
    Cc: "David S. Miller"
    Cc: Jaroslav Kysela
    Cc: Takashi Iwai
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Cc: David Howells
    Signed-off-by: Greg Kroah-Hartman

    Kay Sievers
     
  • There's no need to explicitly check for data and resources being NULL,
    as platform_device_add_{data,resources}() do this internally nowadays.

    This makes the code more linear and less indented.

    Signed-off-by: Anton Vorontsov
    Signed-off-by: Greg Kroah-Hartman

    Anton Vorontsov
     
  • Some users of platform_device_add_{data,resources}() assume that
    NULL data and resources will be handled specially, i.e. just ignored.

    But the platform core ends up calling kmemdup(NULL, 0, ...), which
    returns a non-NULL result (i.e. ZERO_SIZE_PTR), which causes drivers
    to oops on a valid code, something like:

    if (platform_data)
    stuff = platform_data->stuff;

    This patch makes the platform core a bit more safe for such cases.

    Signed-off-by: Anton Vorontsov
    Signed-off-by: Greg Kroah-Hartman

    Anton Vorontsov
     
  • Currently, the platform_bus allows customization of several of the
    busses dev_pm_ops methods by using weak symbols so that platform code
    can override them. The weak-symbol approach is not scalable when
    wanting to support multiple platforms in a single kernel binary.

    Instead, provide __init methods for platform code to customize the
    dev_pm_ops methods at runtime.

    NOTE: after these dynamic methods are merged, the weak symbols should
    be removed from drivers/base/platform.c. AFAIK, this will only
    affect SH and sh-mobile which should be converted to use this
    runtime approach instead of the weak symbols. After SH &
    sh-mobile are converted, the weak symobols could be removed.

    Tested on OMAP3.

    Cc: Magnus Damm
    Acked-by: Grant Likely
    Signed-off-by: Kevin Hilman
    Signed-off-by: Greg Kroah-Hartman

    Kevin Hilman
     
  • In theory (although not *yet* in practice), a driver being passed
    to platform_driver_probe might have driver.bus set to something
    other than platform_bus_type. Locking drv->driver.bus is always
    correct.

    Signed-off-by: Patrick Pannuto
    Signed-off-by: Greg Kroah-Hartman

    Patrick Pannuto
     

22 Oct, 2010

2 commits

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6: (26 commits)
    PM / Wakeup: Show wakeup sources statistics in debugfs
    PM: Introduce library for device-specific OPPs (v7)
    PM: Add sysfs attr for rechecking dev hash from PM trace
    PM: Lock PM device list mutex in show_dev_hash()
    PM / Runtime: Remove idle notification after failing suspend
    PM / Hibernate: Modify signature used to mark swap
    PM / Runtime: Reduce code duplication in core helper functions
    PM: Allow wakeup events to abort freezing of tasks
    PM: runtime: add missed pm_request_autosuspend
    PM / Hibernate: Make some boot messages look less scary
    PM / Runtime: Implement autosuspend support
    PM / Runtime: Add no_callbacks flag
    PM / Runtime: Combine runtime PM entry points
    PM / Runtime: Merge synchronous and async runtime routines
    PM / Runtime: Replace boolean arguments with bitflags
    PM / Runtime: Move code in drivers/base/power/runtime.c
    sysfs: Add sysfs_merge_group() and sysfs_unmerge_group()
    PM: Fix potential issue with failing asynchronous suspend
    PM / Wakeup: Introduce wakeup source objects and event statistics (v3)
    PM: Fix signed/unsigned warning in dpm_show_time()
    ...

    Linus Torvalds
     
  • The current code allocates and manages platform_devices created from
    the device tree manually. It also uses an unsafe shortcut for
    allocating the platform_device and the resource table at the same
    time. (which I added in the last rework; sorry).

    This patch refactors the code to use platform_device_alloc() for
    allocating new devices. This reduces the amount of custom code
    implemented by of_platform, eliminates the unsafe alloc trick, and has
    the side benefit of letting the platform_bus code manage freeing the
    device data and resources when the device is freed.

    Signed-off-by: Grant Likely
    Cc: Benjamin Herrenschmidt
    Cc: Greg Kroah-Hartman
    Cc: "David S. Miller"
    Cc: Michal Simek

    Grant Likely
     

20 Oct, 2010

1 commit

  • There may be wakeup sources that aren't associated with any devices
    and their statistics information won't be available from sysfs. Also,
    for debugging purposes it is convenient to have all of the wakeup
    sources statistics available from one place. For these reasons,
    introduce new file "wakeup_sources" in debugfs containing those
    statistics.

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

    Rafael J. Wysocki
     

17 Oct, 2010

15 commits

  • SoCs have a standard set of tuples consisting of frequency and
    voltage pairs that the device will support per voltage domain. These
    are called Operating Performance Points or OPPs. The actual
    definitions of OPP varies over silicon versions. For a specific domain,
    we can have a set of {frequency, voltage} pairs. As the kernel boots
    and more information is available, a default set of these are activated
    based on the precise nature of device. Further on operation, based on
    conditions prevailing in the system (such as temperature), some OPP
    availability may be temporarily controlled by the SoC frameworks.

    To implement an OPP, some sort of power management support is necessary
    hence this library depends on CONFIG_PM.

    Contributions include:
    Sanjeev Premi for the initial concept:
    http://patchwork.kernel.org/patch/50998/
    Kevin Hilman for converting original design to device-based.
    Kevin Hilman and Paul Walmsey for cleaning up many of the function
    abstractions, improvements and data structure handling.
    Romit Dasgupta for using enums instead of opp pointers.
    Thara Gopinath, Eduardo Valentin and Vishwanath BS for fixes and
    cleanups.
    Linus Walleij for recommending this layer be made generic for usage
    in other architectures beyond OMAP and ARM.
    Mark Brown, Andrew Morton, Rafael J. Wysocki, Paul E. McKenney for
    valuable improvements.

    Discussions and comments from:
    http://marc.info/?l=linux-omap&m=126033945313269&w=2
    http://marc.info/?l=linux-omap&m=125482970102327&w=2
    http://marc.info/?t=125809247500002&r=1&w=2
    http://marc.info/?l=linux-omap&m=126025973426007&w=2
    http://marc.info/?t=128152609200064&r=1&w=2
    http://marc.info/?t=128468723000002&r=1&w=2
    incorporated.

    v1: http://marc.info/?t=128468723000002&r=1&w=2

    Signed-off-by: Nishanth Menon
    Signed-off-by: Kevin Hilman
    Signed-off-by: Rafael J. Wysocki

    Nishanth Menon
     
  • If the device which fails to resume is part of a loadable kernel module
    it won't be checked at startup against the magic number stored in the
    RTC.

    Add a read-only sysfs attribute /sys/power/pm_trace_dev_match which
    contains a list of newline separated devices (usually just the one)
    which currently match the last magic number. This allows the device
    which is failing to resume to be found after the modules are loaded
    again.

    Signed-off-by: James Hogan
    Signed-off-by: Rafael J. Wysocki

    James Hogan
     
  • Lock the PM device list mutex using device_pm_lock() and
    device_pm_unlock() around the list iteration in show_dev_hash().

    show_dev_hash() was reverse iterating dpm_list without first locking the
    mutex that the functions in drivers/base/power/main.c lock. I assume
    this was unintentional since there is no comment suggesting why the lock
    might not be necessary.

    Signed-off-by: James Hogan
    Signed-off-by: Rafael J. Wysocki

    James Hogan
     
  • If runtime suspend of a device fails returning -EAGAIN or -EBUSY,
    which means that it's safe to try to suspend it again, the PM core
    runs the runtime idle helper function for it. Unfortunately this may
    lead to problems, for example for PCI devices whose drivers don't
    implement the ->runtime_idle() callback, because in that case the
    PCI bus type's ->runtime_idle() always calls pm_runtime_suspend()
    for the given device. Then, if there's an automatic idle
    notification after the driver's ->runtime_suspend() returning -EAGAIN
    or -EBUSY, it will make the suspend happen again possibly causing a
    busy loop to appear. To avoid that, remove the idle notification
    after failing runtime suspend of a device altogether and let the
    callers of pm_runtime_suspend() repeat the operation if need be.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Alan Stern

    Rafael J. Wysocki
     
  • Reduce code duplication in rpm_idle(), rpm_suspend() and rpm_resume()
    by using local pointers to store callback addresses and moving some
    duplicated code into a separate function.

    Signed-off-by: Rafael J. Wysocki
    Reviewed-by: Alan Stern

    Rafael J. Wysocki
     
  • This patch (as1427) implements the "autosuspend" facility for runtime
    PM. A few new fields are added to the dev_pm_info structure and
    several new PM helper functions are defined, for telling the PM core
    whether or not a device uses autosuspend, for setting the autosuspend
    delay, and for marking periods of device activity.

    Drivers that do not want to use autosuspend can continue using the
    same helper functions as before; their behavior will not change. In
    addition, drivers supporting autosuspend can also call the old helper
    functions to get the old behavior.

    The details are all explained in Documentation/power/runtime_pm.txt
    and Documentation/ABI/testing/sysfs-devices-power.

    Signed-off-by: Alan Stern
    Signed-off-by: Rafael J. Wysocki

    Alan Stern
     
  • Some devices, such as USB interfaces, cannot be power-managed
    independently of their parents, i.e., they cannot be put in low power
    while the parent remains at full power. This patch (as1425) creates a
    new "no_callbacks" flag, which tells the PM core not to invoke the
    runtime-PM callback routines for the such devices but instead to
    assume that the callbacks always succeed. In addition, the
    non-debugging runtime-PM sysfs attributes for the devices are removed,
    since they are pretty much meaningless.

    The advantage of this scheme comes not so much from avoiding the
    callbacks themselves, but rather from the fact that without the need
    for a process context in which to run the callbacks, more work can be
    done in interrupt context.

    Signed-off-by: Alan Stern
    Signed-off-by: Rafael J. Wysocki

    Alan Stern
     
  • This patch (as1424) combines the various public entry points for the
    runtime PM routines into three simple functions: one for idle, one for
    suspend, and one for resume. A new bitflag specifies whether or not
    to increment or decrement the usage_count field.

    The new entry points are named __pm_runtime_idle,
    __pm_runtime_suspend, and __pm_runtime_resume, to reflect that they
    are trampolines. Simultaneously, the corresponding internal routines
    are renamed to rpm_idle, rpm_suspend, and rpm_resume.

    Signed-off-by: Alan Stern
    Signed-off-by: Rafael J. Wysocki

    Alan Stern
     
  • This patch (as1423) merges the asynchronous routines
    __pm_request_idle(), __pm_request_suspend(), and __pm_request_resume()
    with their synchronous counterparts. The RPM_ASYNC bitflag argument
    serves to indicate what sort of operation to perform.

    In the course of performing this merger, it became apparent that the
    various functions don't all behave consistenly with regard to error
    reporting and cancellation of outstanding requests. A new routine,
    rpm_check_suspend_allowed(), was written to centralize much of the
    testing, and the other functions were revised to follow a simple
    algorithm:

    If the operation is disallowed because of the device's
    settings or current state, return an error.

    Cancel pending or scheduled requests of lower priority.

    Schedule, queue, or perform the desired operation.

    A few special cases and exceptions are noted in comments.

    Signed-off-by: Alan Stern
    Signed-off-by: Rafael J. Wysocki

    Alan Stern
     
  • The "from_wq" argument in __pm_runtime_suspend() and
    __pm_runtime_resume() supposedly indicates whether or not the function
    was called by the PM workqueue thread, but in fact it isn't always
    used this way. It really indicates whether or not the function should
    return early if the requested operation is already in progress.

    Along with this badly-named boolean argument, later patches in this
    series will add several other boolean arguments to these functions and
    others. Therefore this patch (as1422) begins the conversion process
    by replacing from_wq with a bitflag argument. The same bitflags are
    also used in __pm_runtime_get() and __pm_runtime_put(), where they
    indicate whether or not the operation should be asynchronous.

    Signed-off-by: Alan Stern
    Signed-off-by: Rafael J. Wysocki

    Alan Stern
     
  • This patch (as1421) moves the PM runtime accounting subroutines up to
    the beginning of runtime.c, taking them out of the middle of the
    functions that do the actual work. No operational changes.

    Signed-off-by: Alan Stern
    Signed-off-by: Rafael J. Wysocki

    Alan Stern
     
  • There is a potential issue with the asynchronous suspend code that
    a device driver suspending asynchronously may not notice that it
    should back off. There are two failing scenarions, (1) when the
    driver is waiting for a driver suspending synchronously to complete
    and that second driver returns error code, in which case async_error
    won't be set and the waiting driver will continue suspending and (2)
    after the driver has called device_pm_wait_for_dev() and the waited
    for driver returns error code, in which case the caller of
    device_pm_wait_for_dev() will not know that there was an error and
    will continue suspending.

    To fix this issue make __device_suspend() set async_error, so
    async_suspend() doesn't need to set it any more, and make
    device_pm_wait_for_dev() return async_error, so that its callers
    can check whether or not they should continue suspending.

    No more changes are necessary, since device_pm_wait_for_dev() is
    not used by any drivers' suspend routines.

    Reported-by: Colin Cross
    Signed-off-by: Rafael J. Wysocki
    Acked-by: Greg Kroah-Hartman

    Rafael J. Wysocki
     
  • Introduce struct wakeup_source for representing system wakeup sources
    within the kernel and for collecting statistics related to them.
    Make the recently introduced helper functions pm_wakeup_event(),
    pm_stay_awake() and pm_relax() use struct wakeup_source objects
    internally, so that wakeup statistics associated with wakeup devices
    can be collected and reported in a consistent way (the definition of
    pm_relax() is changed, which is harmless, because this function is
    not called directly by anyone yet). Introduce new wakeup-related
    sysfs device attributes in /sys/devices/.../power for reporting the
    device wakeup statistics.

    Change the global wakeup events counters event_count and
    events_in_progress into atomic variables, so that it is not necessary
    to acquire a global spinlock in pm_wakeup_event(), pm_stay_awake()
    and pm_relax(), which should allow us to avoid lock contention in
    these functions on SMP systems with many wakeup devices.

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

    Rafael J. Wysocki
     
  • Seen on MIPS32, gcc 4.4.3, 2.6.36-rc4:

    drivers/base/power/main.c: In function 'dpm_show_time':
    drivers/base/power/main.c:415: warning: comparison of distinct pointer types lacks a cast

    do_div() takes unsigned parameters:

    uint32_t do_div(uint64_t *n, uint32_t base);

    Using an unsigned variable for usecs64 should not cause any problems,
    because calltime >= starttime .

    Signed-off-by: Kevin Cernekee
    Signed-off-by: Rafael J. Wysocki

    Kevin Cernekee
     
  • Allow drivers, that belong to subsystems which use the generic
    runtime pm callbacks, not to define runtime pm suspend/resume handlers,
    by implicitly assuming success in such cases.

    This is needed to eliminate nop handlers that would otherwise be
    necessary by drivers which enable runtime pm, but don't need
    to do anything when their devices are runtime-suspended/resumed.

    Signed-off-by: Ohad Ben-Cohen
    Acked-by: Kevin Hilman
    Acked-by: Mark Brown
    Signed-off-by: Rafael J. Wysocki

    Ohad Ben-Cohen
     

21 Sep, 2010

1 commit


10 Sep, 2010

1 commit

  • Create attributes:

    /sys/devices/system/cpu/cpuX/topology/book_id
    /sys/devices/system/cpu/cpuX/topology/book_siblings

    which show the book id and the book siblings of a cpu.

    Unlike the attributes for SMT and MC these attributes are only present if
    CONFIG_SCHED_BOOK is set. There is no reason to pollute sysfs for every
    architecture with unused attributes.

    Signed-off-by: Heiko Carstens
    Signed-off-by: Peter Zijlstra
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Heiko Carstens
     

09 Sep, 2010

1 commit

  • During suspend, the power.completion is expected to be set when a
    device has not yet started suspending. Set it on init to fix a
    corner case where a device is resumed when its parent has never
    suspended.

    Consider three drivers, A, B, and C. The parent of A is C, and C
    has async_suspend set. On boot, C->power.completion is initialized
    to 0.

    During the first suspend:
    suspend_devices_and_enter(...)
    dpm_resume(...)
    device_suspend(A)
    device_suspend(B) returns error, aborts suspend
    dpm_resume_end(...)
    dpm_resume(...)
    device_resume(A)
    dpm_wait(A->parent == C)
    wait_for_completion(C->power.completion)

    The wait_for_completion will never complete, because
    complete_all(C->power.completion) will only be called from
    device_suspend(C) or device_resume(C), neither of which is called
    if suspend is aborted before C.

    After a successful suspend->resume cycle, where B doesn't abort
    suspend, C->power.completion is left in the completed state by the
    call to device_resume(C), and the same call path will work if B
    aborts suspend.

    Signed-off-by: Colin Cross
    Signed-off-by: Rafael J. Wysocki

    Colin Cross