PCI: fix nested spinlock hang in aer_inject
authorAndrew Patterson <andrew.patterson@hp.com>
Fri, 22 Jan 2010 21:06:53 +0000 (14:06 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 26 Apr 2010 14:41:31 +0000 (07:41 -0700)
commit90022a26dd2e166ae1ac3953d266ea42f083d65e
tree61f7b2257657b14e32b667d2b40950e4130298c8
parent892cb6dc64b73037b756fd1b0014e8c2280ae28d
PCI: fix nested spinlock hang in aer_inject

commit bd1f46deba615971a58193afd0202878cadf19a7 upstream.

The aer_inject module hangs in aer_inject() when checking the device's
error masks.  The hang is due to a recursive use of the aer_inject lock.
The aer_inject() routine grabs the lock while processing the error and then
calls pci_read_config_dword to read the masks. The pci_read_config_dword
routine is earlier overridden by pci_read_aer, which among other things,
grabs the aer_inject lock.

Fixed by moving the pci_read_config_dword calls to read the masks to before
the lock is taken.

Acked-by: Huang Ying <ying.huang@intel.com>
Signed-off-by: Andrew Patterson <andrew.patterson@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: maximilian attems <max@stro.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/pci/pcie/aer/aer_inject.c