powerpc/eeh: Fix race condition in pcibios_set_pcie_reset_state()
authorGavin Shan <gwshan@linux.vnet.ibm.com>
Thu, 30 Apr 2015 23:14:11 +0000 (09:14 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 1 May 2015 03:52:09 +0000 (13:52 +1000)
commit1ae79b78bc52b910a224f3795122538516e07b5f
treed934d597c7c63219901eec7ab644d960ed48b7a7
parentf32393c943e297b8ae180c8f83d81a156c7d0412
powerpc/eeh: Fix race condition in pcibios_set_pcie_reset_state()

When asserting reset in pcibios_set_pcie_reset_state(), the PE
is enforced to (hardware) frozen state in order to drop unexpected
PCI transactions (except PCI config read/write) automatically by
hardware during reset, which would cause recursive EEH error.
However, the (software) frozen state EEH_PE_ISOLATED is missed.
When users get 0xFF from PCI config or MMIO read, EEH_PE_ISOLATED
is set in PE state retrival backend. Unfortunately, nobody (the
reset handler or the EEH recovery functinality in host) will clear
EEH_PE_ISOLATED when the PE has been passed through to guest.

The patch sets and clears EEH_PE_ISOLATED properly during reset
in function pcibios_set_pcie_reset_state() to fix the issue.

Fixes: 28158cd ("Enhance pcibios_set_pcie_reset_state()")
Reported-by: Carol L. Soto <clsoto@us.ibm.com>
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Tested-by: Carol L. Soto <clsoto@us.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kernel/eeh.c