linux/drivers/base
Rafael J. Wysocki 22110faf8c PM / Wakeup: Fix initialization of wakeup-related device sysfs files
It turns out that some PCI devices are only found to be
wakeup-capable during registration, in which case, when
device_set_wakeup_capable() is called, device_is_registered() already
returns 'true' for the given device, but dpm_sysfs_add() hasn't been
called for it yet.  This leads to situations in which the device's
power.can_wakeup flag is not set as requested because of failing
wakeup_sysfs_add() and its wakeup-related sysfs files are not
created, although they should be present.  This is a post-2.6.38
regression introduced by commit cb8f51bdad
(PM: Do not create wakeup sysfs files for devices that cannot wake
up).

To work around this problem initialize the device's power.entry
field to an empty list head and make device_set_wakeup_capable()
check if it is still empty before attempting to add the devices
wakeup-related sysfs files with wakeup_sysfs_add().  Namely, if
power.entry is still empty at this point, device_pm_add() hasn't been
called yet for the device and its wakeup-related files will be
created later, so device_set_wakeup_capable() doesn't have to create
them.

Reported-and-tested-by: Tino Keitel <tino.keitel@tikei.de>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-26 11:33:09 +02:00
..
power PM / Wakeup: Fix initialization of wakeup-related device sysfs files 2011-04-26 11:33:09 +02:00
attribute_container.c
base.h driver-core: merge private parts of class and bus 2010-11-17 14:21:08 -08:00
bus.c Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2011-01-13 10:05:56 -08:00
class.c driver-core: merge private parts of class and bus 2010-11-17 14:21:08 -08:00
core.c driver core: Replace the dangerous to_root_device macro with an inline function 2011-02-03 16:36:40 -08:00
cpu.c
dd.c
devres.c
devtmpfs.c convert get_sb_single() users 2010-10-29 04:16:28 -04:00
dma-coherent.c
dma-mapping.c
driver.c
firmware_class.c firmware_classs: change val uevent's type to bool 2011-02-03 15:39:17 -08:00
firmware.c
hypervisor.c
init.c
iommu.c
isa.c
Kconfig Introduce ARCH_NO_SYSDEV_OPS config option (v2) 2011-03-23 22:16:41 +01:00
Makefile PM / Core: Introduce struct syscore_ops for core subsystems PM 2011-03-15 00:43:46 +01:00
map.c
memory.c memory hotplug: sysfs probe routine should add all memory sections 2011-02-03 16:08:58 -08:00
module.c
node.c memory hotplug: Update phys_index to [start|end]_section_nr 2011-02-03 16:08:57 -08:00
platform.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6 2011-04-12 17:18:05 -07:00
sys.c Fix common misspellings 2011-03-31 11:26:23 -03:00
syscore.c PM: Add missing syscore_suspend() and syscore_resume() calls 2011-04-20 00:36:11 +02:00
topology.c topology/sysfs: Provide book id and siblings attributes 2010-09-09 20:41:25 +02:00
transport_class.c