09 Feb, 2012

1 commit

  • Due to the sysdev conversion to struct device, the cpu objects get
    reused when adding a cpu after offlining it, which causes a big warning
    that the kobject portion is not properly initialized.

    So clear out the object before we register it again, so all is quiet.

    Reported-by: Konrad Rzeszutek Wilk
    Tested-by: Konrad Rzeszutek Wilk
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

03 Feb, 2012

2 commits

  • One system with 2048g ram, reported soft lockup on recent kernel.

    [ 34.426749] cpu_dev_init done
    [ 61.166399] BUG: soft lockup - CPU#0 stuck for 22s! [swapper/0:1]
    [ 61.166733] Modules linked in:
    [ 61.166904] irq event stamp: 1935610
    [ 61.178431] hardirqs last enabled at (1935609): [] mutex_lock_nested+0x299/0x2b4
    [ 61.178923] hardirqs last disabled at (1935610): [] apic_timer_interrupt+0x6b/0x80
    [ 61.198767] softirqs last enabled at (1935476): [] __do_softirq+0x195/0x1ab
    [ 61.218604] softirqs last disabled at (1935471): [] call_softirq+0x1c/0x30
    [ 61.238408] CPU 0
    [ 61.238549] Modules linked in:
    [ 61.238744]
    [ 61.238825] Pid: 1, comm: swapper/0 Not tainted 3.3.0-rc1-tip-yh-02076-g962f689-dirty #171
    [ 61.278212] RIP: 0010:[] [] lock_release+0x90/0x9c
    [ 61.278627] RSP: 0018:ffff883f64dbfd70 EFLAGS: 00000246
    [ 61.298287] RAX: ffff883f64dc0000 RBX: 0000000000000000 RCX: 000000000000008b
    [ 61.298690] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
    [ 61.318383] RBP: ffff883f64dbfda0 R08: 0000000000000001 R09: 000000000000008b
    [ 61.338215] R10: 0000000000000000 R11: 0000000000000000 R12: ffff883f64dbfd10
    [ 61.338610] R13: ffff883f64dc0708 R14: ffff883f64dc0708 R15: ffffffff81095657
    [ 61.358299] FS: 0000000000000000(0000) GS:ffff883f7d600000(0000) knlGS:0000000000000000
    [ 61.378118] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
    [ 61.378450] CR2: 0000000000000000 CR3: 00000000024af000 CR4: 00000000000007f0
    [ 61.398144] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    [ 61.417918] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
    [ 61.418260] Process swapper/0 (pid: 1, threadinfo ffff883f64dbe000, task ffff883f64dc0000)
    [ 61.445358] Stack:
    [ 61.445511] 0000000000000002 ffff897f649ba168 ffff883f64dbfe10 ffff88ff64bb57a8
    [ 61.458040] 0000000000000000 0000000000000000 ffff883f64dbfdc0 ffffffff81ceb1b4
    [ 61.458491] 000000000011608c ffff88ff64bb58a8 ffff883f64dbfdf0 ffffffff81c57638
    [ 61.478215] Call Trace:
    [ 61.478367] [] _raw_spin_unlock+0x21/0x2e
    [ 61.497994] [] klist_next+0x9e/0xbc
    [ 61.498264] [] next_device+0xe/0x1e
    [ 61.517867] [] subsys_find_device_by_id+0xb7/0xd6
    [ 61.518197] [] find_memory_block_hinted+0x3d/0x66
    [ 61.537927] [] find_memory_block+0x10/0x12
    [ 61.538193] [] add_memory_section+0x35/0x9e
    [ 61.557932] [] memory_dev_init+0x68/0xda
    [ 61.558227] [] driver_init+0x97/0xa7
    [ 61.577853] [] kernel_init+0xf6/0x1c0
    [ 61.578140] [] kernel_thread_helper+0x4/0x10
    [ 61.597850] [] ? retint_restore_args+0xe/0xe
    [ 61.598144] [] ? start_kernel+0x3ab/0x3ab
    [ 61.617826] [] ? gs_change+0xb/0xb
    [ 61.618060] Code: 10 48 83 3b 00 eb e8 4c 89 f2 44 89 fe 4c 89 ef e8 e1 fe ff ff 65 48 8b 04 25 40 bc 00 00 c7 80 cc 06 00 00 00 00 00 00 41 54 9d 5b 41 5c 41 5d 41 5e 41 5f 5d c3 55 48 89 e5 41 57 41 89 cf
    [ 89.285380] memory_dev_init done

    Finally it takes about 55s to create 16400 memory entries.

    Root cause: for x86_64, 2048g (with 2g hole at [2g,4g), and TOP2 will be 2050g), will have 16400 memory block.

    find_memory_block/subsys_find_device_by_id will be expensive with that many entries.

    Actually, we don't need to find that memory block for BOOT path.

    Skip that finding make it get back to normal.

    [ 34.466696] cpu_dev_init done
    [ 35.290080] memory_dev_init done

    Also solved the delay with topology_init when sections_per_block is not 1.

    Signed-off-by: Yinghai Lu
    Cc: Kay Sievers
    Cc: Nathan Fontenot
    Cc: Robin Holt
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Yinghai Lu
     
  • With the movement of the cpu sysdev code to be real stuct devices, now
    when we remove a cpu from the system, the driver core rightfully
    complains that there is not a release method for this device.

    For now, paper over this issue by quieting the driver core, but comment
    this in detail. This will be resolved in future kernels to be solved
    properly.

    Reported-by: Konrad Rzeszutek Wilk
    Tested-by: Konrad Rzeszutek Wilk
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

29 Jan, 2012

1 commit

  • …ernel/git/gregkh/driver-core

    Here are some patches for the 3.3-rc1 tree.

    It contains the removal of the sysdev code, now that all users of it are
    gone, as well as some sysfs bugfixes that have been reported by users.
    There are also some documentation updates here as well.

    * tag 'driver-core-3.3-rc1-bugfixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
    sysfs: Complain bitterly about attempts to remove files from nonexistent directories.
    stable: update documentation to ask for kernel version
    base/core.c:fix typo in comment in function device_add
    Documentation: devres: add allocation functions to list of supported calls
    Documentation update for the driver model core
    kernel-doc: fix new warnings in driver-core
    kernel-doc: fix new warnings in debugfs
    kernel-doc: fix new warnings in device.h
    driver core: remove drivers/base/sys.c and include/linux/sysdev.h

    Linus Torvalds
     

26 Jan, 2012

1 commit


25 Jan, 2012

3 commits

  • Signed-off-by: majianpeng
    Signed-off-by: Greg Kroah-Hartman

    majianpeng
     
  • This patch (as1509) documents two important points regarding the use
    of device structures in the driver model:

    Structures must be initialized to all 0's before they are
    passed to device_initialize().

    Structures must not be passed to device_add() or
    device_register() more than once.

    Although these restrictions have applied ever since the driver model
    was first created, they have not been mentioned anywhere.

    Signed-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • Fix new kernel-doc warnings:

    Warning(drivers/base/bus.c:925): No description found for parameter 'key'
    Warning(drivers/base/bus.c:1241): No description found for parameter 'subsys'
    Warning(drivers/base/bus.c:1241): No description found for parameter 'groups'

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

    Randy Dunlap
     

24 Jan, 2012

3 commits

  • Power management fixes for 3.3

    Two fixes for regressions introduced during the merge window, one fix for
    a long-standing obscure issue in the computation of hibernate image size
    and two small PM documentation fixes.

    * tag 'pm-fixes-for-3.3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
    PM / Sleep: Fix read_unlock_usermodehelper() call.
    PM / Hibernate: Rewrite unlock_system_sleep() to fix s2disk regression
    PM / Hibernate: Correct additional pages number calculation
    PM / Documentation: Fix minor issue in freezing_of_tasks.txt
    PM / Documentation: Fix spelling mistake in basic-pm-debugging.txt

    Linus Torvalds
     
  • Commit b298d289
    "PM / Sleep: Fix freezer failures due to racy usermodehelper_is_disabled()"
    added read_unlock_usermodehelper() but read_unlock_usermodehelper() is called
    without read_lock_usermodehelper() when kmalloc() failed.

    Signed-off-by: Tetsuo Handa
    Acked-by: Srivatsa S. Bhat
    Signed-off-by: Rafael J. Wysocki

    Tetsuo Handa
     
  • Fix new kernel-doc warnings:

    Warning(drivers/base/bus.c:925): No description found for parameter 'key'
    Warning(drivers/base/bus.c:1241): No description found for parameter 'subsys'
    Warning(drivers/base/bus.c:1241): No description found for parameter 'groups'

    Signed-off-by: Randy Dunlap
    Cc: Greg Kroah-Hartman
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     

23 Jan, 2012

1 commit


20 Jan, 2012

1 commit

  • When we reinitialise the cache make sure that we reset the cache access
    flags, ensuring that the reinitialised cache is in the default state
    which is what callers would and do expect given the function name.

    This is particularly likely to cause issues in systems where there was no
    cache previously as those systems have cache bypass enabled, as for the
    wm8994 driver where this was noticed.

    Signed-off-by: Mark Brown

    Mark Brown
     

17 Jan, 2012

1 commit


14 Jan, 2012

2 commits


13 Jan, 2012

2 commits

  • This is going to be used by other subsystems so they should select it.

    Signed-off-by: Dave Airlie

    Dave Airlie
     
  • Currently no udev events for memory hotplug "online" and "offline" are
    generated:

    # udevadm monitor
    # echo offline > /sys/devices/system/memory/memory4/state
    ==> No event

    When kdump is loaded, kexec detects the current memory configuration and
    stores it in the pre-allocated ELF core header. Therefore, for kdump it
    is necessary to reload the kdump kernel with kexec when the memory
    configuration changes (e.g. for online/offline hotplug memory).

    In order to do this automatically, udev rules should be used. This kernel
    patch adds udev events for "online" and "offline". Together with this
    kernel patch, the following udev rules for online/offline have to be added
    to "/etc/udev/rules.d/98-kexec.rules":

    SUBSYSTEM=="memory", ACTION=="online", PROGRAM="/etc/init.d/kdump restart"
    SUBSYSTEM=="memory", ACTION=="offline", PROGRAM="/etc/init.d/kdump restart"

    [sfr@canb.auug.org.au: fixups for class to subsystem conversion]
    Signed-off-by: Michael Holzheu
    Cc: Heiko Carstens
    Cc: Vivek Goyal
    Cc: "Eric W. Biederman"
    Cc: Kay Sievers
    Cc: Dave Hansen
    Cc: Martin Schwidefsky
    Cc: Greg KH
    Signed-off-by: Stephen Rothwell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michael Holzheu
     

12 Jan, 2012

2 commits


09 Jan, 2012

5 commits

  • * 'dma-buf-merge' of git://people.freedesktop.org/~airlied/linux:
    dma-buf: mark EXPERIMENTAL for 1st release.
    dma-buf: Documentation for buffer sharing framework
    dma-buf: Introduce dma buffer sharing mechanism

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap: (36 commits)
    mfd: Clearing events requires event registers to be writable for da9052-core
    mfd: Fix annotations in da9052-core
    gpiolib: Mark da9052 driver broken
    mfd: Declare da9052_regmap_config for the bus drivers
    MFD: DA9052/53 MFD core module add SPI support v2
    MFD: DA9052/53 MFD core module
    regmap: Add irq_base accessor to regmap_irq
    regmap: Allow drivers to reinitialise the register cache at runtime
    regmap: Add trace event for successful cache reads
    regmap: Allow regmap_update_bits() users to detect changes
    regmap: Report if we actually handled an interrupt in regmap-irq
    regmap: Fix rbtreee build when not using debugfs
    regmap: Provide debugfs dump of the rbtree cache data
    regmap: Do debugfs init before cache init
    regmap: Suppress noop writes in regmap_update_bits()
    regmap: Remove indexed cache type
    regmap: Drop check whether a register is readable in regcache_read
    regmap: Properly round cache_word_size
    regmap: Add support for 10/14 register formating
    regmap: Try cached read before checking if a hardware read is possible
    ...

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (53 commits)
    Kconfig: acpi: Fix typo in comment.
    misc latin1 to utf8 conversions
    devres: Fix a typo in devm_kfree comment
    btrfs: free-space-cache.c: remove extra semicolon.
    fat: Spelling s/obsolate/obsolete/g
    SCSI, pmcraid: Fix spelling error in a pmcraid_err() call
    tools/power turbostat: update fields in manpage
    mac80211: drop spelling fix
    types.h: fix comment spelling for 'architectures'
    typo fixes: aera -> area, exntension -> extension
    devices.txt: Fix typo of 'VMware'.
    sis900: Fix enum typo 'sis900_rx_bufer_status'
    decompress_bunzip2: remove invalid vi modeline
    treewide: Fix comment and string typo 'bufer'
    hyper-v: Update MAINTAINERS
    treewide: Fix typos in various parts of the kernel, and fix some comments.
    clockevents: drop unknown Kconfig symbol GENERIC_CLOCKEVENTS_MIGR
    gpio: Kconfig: drop unknown symbol 'CS5535_GPIO'
    leds: Kconfig: Fix typo 'D2NET_V2'
    sound: Kconfig: drop unknown symbol ARCH_CLPS7500
    ...

    Fix up trivial conflicts in arch/powerpc/platforms/40x/Kconfig (some new
    kconfig additions, close to removed commented-out old ones)

    Linus Torvalds
     
  • * 'pm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (76 commits)
    PM / Hibernate: Implement compat_ioctl for /dev/snapshot
    PM / Freezer: fix return value of freezable_schedule_timeout_killable()
    PM / shmobile: Allow the A4R domain to be turned off at run time
    PM / input / touchscreen: Make st1232 use device PM QoS constraints
    PM / QoS: Introduce dev_pm_qos_add_ancestor_request()
    PM / shmobile: Remove the stay_on flag from SH7372's PM domains
    PM / shmobile: Don't include SH7372's INTCS in syscore suspend/resume
    PM / shmobile: Add support for the sh7372 A4S power domain / sleep mode
    PM: Drop generic_subsys_pm_ops
    PM / Sleep: Remove forward-only callbacks from AMBA bus type
    PM / Sleep: Remove forward-only callbacks from platform bus type
    PM: Run the driver callback directly if the subsystem one is not there
    PM / Sleep: Make pm_op() and pm_noirq_op() return callback pointers
    PM/Devfreq: Add Exynos4-bus device DVFS driver for Exynos4210/4212/4412.
    PM / Sleep: Merge internal functions in generic_ops.c
    PM / Sleep: Simplify generic system suspend callbacks
    PM / Hibernate: Remove deprecated hibernation snapshot ioctls
    PM / Sleep: Fix freezer failures due to racy usermodehelper_is_disabled()
    ARM: S3C64XX: Implement basic power domain support
    PM / shmobile: Use common always on power domain governor
    ...

    Fix up trivial conflict in fs/xfs/xfs_buf.c due to removal of unused
    XBT_FORCE_SLEEP bit

    Linus Torvalds
     
  • * 'for-linus2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (165 commits)
    reiserfs: Properly display mount options in /proc/mounts
    vfs: prevent remount read-only if pending removes
    vfs: count unlinked inodes
    vfs: protect remounting superblock read-only
    vfs: keep list of mounts for each superblock
    vfs: switch ->show_options() to struct dentry *
    vfs: switch ->show_path() to struct dentry *
    vfs: switch ->show_devname() to struct dentry *
    vfs: switch ->show_stats to struct dentry *
    switch security_path_chmod() to struct path *
    vfs: prefer ->dentry->d_sb to ->mnt->mnt_sb
    vfs: trim includes a bit
    switch mnt_namespace ->root to struct mount
    vfs: take /proc/*/mounts and friends to fs/proc_namespace.c
    vfs: opencode mntget() mnt_set_mountpoint()
    vfs: spread struct mount - remaining argument of next_mnt()
    vfs: move fsnotify junk to struct mount
    vfs: move mnt_devname
    vfs: move mnt_list to struct mount
    vfs: switch pnode.h macros to struct mount *
    ...

    Linus Torvalds
     

08 Jan, 2012

1 commit

  • * 'driver-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (73 commits)
    arm: fix up some samsung merge sysdev conversion problems
    firmware: Fix an oops on reading fw_priv->fw in sysfs loading file
    Drivers:hv: Fix a bug in vmbus_driver_unregister()
    driver core: remove __must_check from device_create_file
    debugfs: add missing #ifdef HAS_IOMEM
    arm: time.h: remove device.h #include
    driver-core: remove sysdev.h usage.
    clockevents: remove sysdev.h
    arm: convert sysdev_class to a regular subsystem
    arm: leds: convert sysdev_class to a regular subsystem
    kobject: remove kset_find_obj_hinted()
    m86k: gpio - convert sysdev_class to a regular subsystem
    mips: txx9_sram - convert sysdev_class to a regular subsystem
    mips: 7segled - convert sysdev_class to a regular subsystem
    sh: dma - convert sysdev_class to a regular subsystem
    sh: intc - convert sysdev_class to a regular subsystem
    power: suspend - convert sysdev_class to a regular subsystem
    power: qe_ic - convert sysdev_class to a regular subsystem
    power: cmm - convert sysdev_class to a regular subsystem
    s390: time - convert sysdev_class to a regular subsystem
    ...

    Fix up conflicts with 'struct sysdev' removal from various platform
    drivers that got changed:
    - arch/arm/mach-exynos/cpu.c
    - arch/arm/mach-exynos/irq-eint.c
    - arch/arm/mach-s3c64xx/common.c
    - arch/arm/mach-s3c64xx/cpu.c
    - arch/arm/mach-s5p64x0/cpu.c
    - arch/arm/mach-s5pv210/common.c
    - arch/arm/plat-samsung/include/plat/cpu.h
    - arch/powerpc/kernel/sysfs.c
    and fix up cpu_is_hotpluggable() as per Greg in include/linux/cpu.h

    Linus Torvalds
     

07 Jan, 2012

1 commit

  • This resolves the conflict in the arch/arm/mach-s3c64xx/s3c6400.c file,
    and it fixes the build error in the arch/x86/kernel/microcode_core.c
    file, that the merge did not catch.

    The microcode_core.c patch was provided by Stephen Rothwell
    who was invaluable in the merge issues involved
    with the large sysdev removal process in the driver-core tree.

    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

06 Jan, 2012

2 commits

  • Mark dma-buf buffer sharing API as EXPERIMENTAL for first release.
    We will remove this in later versions, once it gets smoothed out
    and has more users.

    Signed-off-by: Sumit Semwal
    Signed-off-by: Sumit Semwal
    Signed-off-by: Dave Airlie

    Sumit Semwal
     
  • This is the first step in defining a dma buffer sharing mechanism.

    A new buffer object dma_buf is added, with operations and API to allow easy
    sharing of this buffer object across devices.

    The framework allows:
    - creation of a buffer object, its association with a file pointer, and
    associated allocator-defined operations on that buffer. This operation is
    called the 'export' operation.
    - different devices to 'attach' themselves to this exported buffer object, to
    facilitate backing storage negotiation, using dma_buf_attach() API.
    - the exported buffer object to be shared with the other entity by asking for
    its 'file-descriptor (fd)', and sharing the fd across.
    - a received fd to get the buffer object back, where it can be accessed using
    the associated exporter-defined operations.
    - the exporter and user to share the scatterlist associated with this buffer
    object using map_dma_buf and unmap_dma_buf operations.

    Atleast one 'attach()' call is required to be made prior to calling the
    map_dma_buf() operation.

    Couple of building blocks in map_dma_buf() are added to ease introduction
    of sync'ing across exporter and users, and late allocation by the exporter.

    For this first version, this framework will work with certain conditions:
    - *ONLY* exporter will be allowed to mmap to userspace (outside of this
    framework - mmap is not a buffer object operation),
    - currently, *ONLY* users that do not need CPU access to the buffer are
    allowed.

    More details are there in the documentation patch.

    This is based on design suggestions from many people at the mini-summits[1],
    most notably from Arnd Bergmann , Rob Clark and
    Daniel Vetter .

    The implementation is inspired from proof-of-concept patch-set from
    Tomasz Stanislawski , who demonstrated buffer sharing
    between two v4l2 devices. [2]

    [1]: https://wiki.linaro.org/OfficeofCTO/MemoryManagement
    [2]: http://lwn.net/Articles/454389

    Signed-off-by: Sumit Semwal
    Signed-off-by: Sumit Semwal
    Reviewed-by: Daniel Vetter
    Reviewed-by: Dave Airlie
    Reviewed-and-Tested-by: Rob Clark
    Signed-off-by: Dave Airlie

    Sumit Semwal
     

05 Jan, 2012

1 commit

  • This oops was reported recently:
    firmware_loading_store+0xf9/0x17b
    dev_attr_store+0x20/0x22
    sysfs_write_file+0x101/0x134
    vfs_write+0xac/0xf3
    sys_write+0x4a/0x6e
    system_call_fastpath+0x16/0x1b

    The complete backtrace was unfortunately not captured, but details can be found
    here:
    https://bugzilla.redhat.com/show_bug.cgi?id=769920

    The cause is fairly clear.

    Its caused by the fact that firmware_loading_store has a case 0 in its
    switch statement that reads and writes the fw_priv->fw poniter without the
    protection of the fw_lock mutex. since there is a window between the time that
    _request_firmware sets fw_priv->fw to NULL and the time the corresponding sysfs
    file is unregistered, its possible for a user space application to race in, and
    write a zero to the loading file, causing a NULL dereference in
    firmware_loading_store. Fix it by extending the protection of the fw_lock mutex
    to cover all of the firware_loading_store function.

    Signed-off-by: Neil Horman
    Cc: stable
    Signed-off-by: Greg Kroah-Hartman

    Neil Horman
     

04 Jan, 2012

2 commits


26 Dec, 2011

3 commits

  • * pm-domains:
    PM / shmobile: Allow the A4R domain to be turned off at run time
    PM / input / touchscreen: Make st1232 use device PM QoS constraints
    PM / QoS: Introduce dev_pm_qos_add_ancestor_request()
    PM / shmobile: Remove the stay_on flag from SH7372's PM domains
    PM / shmobile: Don't include SH7372's INTCS in syscore suspend/resume
    PM / shmobile: Add support for the sh7372 A4S power domain / sleep mode
    ARM: S3C64XX: Implement basic power domain support
    PM / shmobile: Use common always on power domain governor
    PM / Domains: Provide an always on power domain governor
    PM / Domains: Fix default system suspend/resume operations
    PM / Domains: Make it possible to assign names to generic PM domains
    PM / Domains: fix compilation failure for CONFIG_PM_GENERIC_DOMAINS unset
    PM / Domains: Automatically update overoptimistic latency information
    PM / Domains: Add default power off governor function (v4)
    PM / Domains: Add device stop governor function (v4)
    PM / Domains: Rework system suspend callback routines (v2)
    PM / Domains: Introduce "save/restore state" device callbacks
    PM / Domains: Make it possible to use per-device domain callbacks

    Rafael J. Wysocki
     
  • * pm-runtime:
    PM / Runtime: Use device PM QoS constraints (v2)

    Rafael J. Wysocki
     
  • Some devices, like the I2C controller on SH7372, are not
    necessary for providing power to their children or forwarding
    wakeup signals (and generally interrupts) from them. They are
    only needed by their children when there's some data to transfer,
    so they may be suspended for the majority of time and resumed
    on demand, when the children have data to send or receive. For this
    purpose, however, their power.ignore_children flags have to be set,
    or the PM core wouldn't allow them to be suspended while their
    children were active.

    Unfortunately, in some situations it may take too much time to
    resume such devices so that they can assist their children in
    transferring data. For example, if such a device belongs to a PM
    domain which goes to the "power off" state when that device is
    suspended, it may take too much time to restore power to the
    domain in response to the request from one of the device's
    children. In that case, if the parent's resume time is critical,
    the domain should stay in the "power on" state, although it still may
    be desirable to power manage the parent itself (e.g. by manipulating
    its clock).

    In general, device PM QoS may be used to address this problem.
    Namely, if the device's children added PM QoS latency constraints
    for it, they would be able to prevent it from being put into an
    overly deep low-power state. However, in some cases the devices
    needing to be serviced are not the immediate children of a
    "children-ignoring" device, but its grandchildren or even less
    direct descendants. In those cases, the entity wanting to add a
    PM QoS request for a given device's ancestor that ignores its
    children will have to find it in the first place, so introduce a new
    helper function that may be used to achieve that. This function,
    dev_pm_qos_add_ancestor_request(), will search for the first
    ancestor of the given device whose power.ignore_children flag is
    set and will add a device PM QoS latency request for that ancestor
    on behalf of the caller. The request added this way may be removed
    with the help of dev_pm_qos_remove_request() in the future, like
    any other device PM QoS latency request.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     

22 Dec, 2011

5 commits

  • This moves the 'memory sysdev_class' over to a regular 'memory' subsystem
    and converts the devices to regular devices. The sysdev drivers are
    implemented as subsystem interfaces now.

    After all sysdev classes are ported to regular driver core entities, the
    sysdev implementation will be entirely removed from the kernel.

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

    Kay Sievers
     
  • This moves the 'cpu sysdev_class' over to a regular 'cpu' subsystem
    and converts the devices to regular devices. The sysdev drivers are
    implemented as subsystem interfaces now.

    After all sysdev classes are ported to regular driver core entities, the
    sysdev implementation will be entirely removed from the kernel.

    Userspace relies on events and generic sysfs subsystem infrastructure
    from sysdev devices, which are made available with this conversion.

    Cc: Haavard Skinnemoen
    Cc: Hans-Christian Egtvedt
    Cc: Tony Luck
    Cc: Fenghua Yu
    Cc: Arnd Bergmann
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    Cc: Paul Mundt
    Cc: "David S. Miller"
    Cc: Chris Metcalf
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: "H. Peter Anvin"
    Cc: Borislav Petkov
    Cc: Tigran Aivazian
    Cc: Len Brown
    Cc: Zhang Rui
    Cc: Dave Jones
    Cc: Peter Zijlstra
    Cc: Russell King
    Cc: Andrew Morton
    Cc: Arjan van de Ven
    Cc: "Rafael J. Wysocki"
    Cc: "Srivatsa S. Bhat"
    Signed-off-by: Kay Sievers
    Signed-off-by: Greg Kroah-Hartman

    Kay Sievers
     
  • Since the PM core is now going to execute driver callbacks directly
    if the corresponding subsystem callbacks are not present,
    forward-only subsystem callbacks (i.e. such that only execute the
    corresponding driver callbacks) are not necessary any more. Thus
    it is possible to remove generic_subsys_pm_ops, because the only
    callback in there that is not forward-only, .runtime_idle, is not
    really used by the only user of generic_subsys_pm_ops, which is
    vio_bus_type.

    However, the generic callback routines themselves cannot be removed
    from generic_ops.c, because they are used individually by a number
    of subsystems.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • The forward-only PM callbacks provided by the platform bus type are
    not necessary any more, because the PM core executes driver callbacks
    when the corresponding subsystem callbacks are not present, so drop
    them.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • Make the PM core execute driver PM callbacks directly if the
    corresponding subsystem callbacks are not present.

    There are three reasons for doing that. First, it reflects the
    behavior of drivers/base/dd.c:really_probe() that runs the driver's
    .probe() callback directly if the bus type's one is not defined, so
    this change will remove one arbitrary difference between the PM core
    and the remaining parts of the driver core. Second, it will allow
    some subsystems, whose PM callbacks don't do anything except for
    executing driver callbacks, to be simplified quite a bit by removing
    those "forward-only" callbacks. Finally, it will allow us to remove
    one level of indirection in the system suspend and resume code paths
    where it is not necessary, which is going to lead to less debug noise
    with initcall_debug passed in the kernel command line (messages won't
    be printed for driverless devices whose subsystems don't provide
    PM callbacks among other things).

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki