dect
/
linux-2.6
Archived
13
0
Fork 0
This repository has been archived on 2022-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
linux-2.6/drivers/base
Rafael J. Wysocki 32bdfac546 PM: Do not hold dpm_list_mtx while disabling/enabling nonboot CPUs
We shouldn't hold dpm_list_mtx while executing
[disable|enable]_nonboot_cpus(), because theoretically this may lead
to a deadlock as shown by the following example (provided by Johannes
Berg):

CPU 3       CPU 2                     CPU 1
                                      suspend/hibernate
            something:
            rtnl_lock()               device_pm_lock()
                                       -> mutex_lock(&dpm_list_mtx)

            mutex_lock(&dpm_list_mtx)

linkwatch_work
 -> rtnl_lock()
                                      disable_nonboot_cpus()
                                       -> flush CPU 3 workqueue

Fortunately, device drivers are supposed to stop any activities that
might lead to the registration of new device objects way before
disable_nonboot_cpus() is called, so it shouldn't be necessary to
hold dpm_list_mtx over the entire late part of device suspend and
early part of device resume.

Thus, during the late suspend and the early resume of devices acquire
dpm_list_mtx only when dpm_list is going to be traversed and release
it right after that.

This patch is reported to fix the regressions tracked as
http://bugzilla.kernel.org/show_bug.cgi?id=13245.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Reported-by: Miles Lane <miles.lane@gmail.com>
Tested-by: Ming Lei <tom.leiming@gmail.com>
2009-05-24 21:15:07 +02:00
..
power PM: Do not hold dpm_list_mtx while disabling/enabling nonboot CPUs 2009-05-24 21:15:07 +02:00
Kconfig trivial: Fix misspelled firmware in Kconfig 2009-01-06 11:28:07 +01:00
Makefile select IOMMU_API when DMAR and/or AMD_IOMMU is selected 2009-01-03 14:10:09 +01:00
attribute_container.c driver core: struct device - replace bus_id with dev_name(), dev_set_name() 2009-01-06 10:44:31 -08:00
base.h driver core: fix driver_match_device 2009-04-16 16:17:09 -07:00
bus.c driver core: move knode_bus into private structure 2009-03-24 16:38:25 -07:00
class.c
core.c driver: dont update dev_name via device_add path 2009-04-20 08:12:58 -07:00
cpu.c cpumask: use new cpumask_ functions in core code. 2009-03-30 22:05:16 +10:30
dd.c driver synchronization: make scsi_wait_scan more advanced 2009-04-21 19:40:00 -07:00
devres.c
dma-mapping.c
driver.c driver core: move knode_driver into private structure 2009-03-24 16:38:25 -07:00
firmware.c
firmware_class.c Driver core: implement uevent suppress in kobject 2009-03-24 16:38:26 -07:00
hypervisor.c
init.c
iommu.c drivers/base/iommu.c: add missing includes 2009-05-06 16:36:10 -07:00
isa.c dma-mapping: replace all DMA_24BIT_MASK macro with DMA_BIT_MASK(24) 2009-04-07 08:31:12 -07:00
map.c
memory.c mm: show node to memory section relationship with symlinks in sysfs 2009-01-06 15:59:00 -08:00
module.c
node.c cpumask: replace node_to_cpumask with cpumask_of_node. 2009-03-13 14:49:46 +10:30
platform.c Revert driver core: move platform_data into platform_device 2009-05-08 19:22:21 -07:00
sys.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2009-04-03 15:24:35 -07:00
topology.c cpumask: Use topology_core_cpumask()/topology_thread_cpumask() 2009-01-11 19:12:49 +01:00
transport_class.c