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)
committerJesse Barnes <jbarnes@virtuousgeek.org>
Mon, 25 Jan 2010 18:42:52 +0000 (10:42 -0800)
commitbd1f46deba615971a58193afd0202878cadf19a7
tree1a197e82ad0f6314f0ff0507c04030aaad933c7c
parent61c39bb354a1f791ba6f562b766a72e508a036ee
PCI: fix nested spinlock hang in aer_inject

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>
drivers/pci/pcie/aer/aer_inject.c