pciehp - add missing locking
authorKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Fri, 22 Sep 2006 17:17:29 +0000 (10:17 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 18 Oct 2006 18:36:10 +0000 (11:36 -0700)
commitdd5619cb4407e830a8921a93c949be37c81105b5
treef726db26b6019e6f741dfb146e3d37eca9198cf4
parent49ed2b4963cd00993eab518b820a6700f94f222d
pciehp - add missing locking

This patch fixes the problem that system will panic if multiple power
on/off operations are issued to the same slot in parallel. This
problem can be easily reproduced by commands below.

    # while true; do echo 1 > power; echo 0 > power; done &
    # while true; do echo 1 > power; echo 0 > power; done &

The cause is lack of locking for enable/disable operations. This patch
fixes this problem.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/pci/hotplug/pciehp.h
drivers/pci/hotplug/pciehp_core.c
drivers/pci/hotplug/pciehp_ctrl.c
drivers/pci/hotplug/pciehp_hpc.c