]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/eeh: Fix deadlock handling dead PHB
authorSam Bobroff <sbobroff@linux.ibm.com>
Fri, 7 Feb 2020 04:57:31 +0000 (15:57 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 17 Feb 2020 01:47:05 +0000 (12:47 +1100)
commit17c2356e786f2bfe0f32ef424853dc0aa995c38a
tree17554b3f5f1e84066407cc68e3c4605bc8e47be6
parenta0dcdc4ca64230a6d4a2738a96d502ae7293732c
powerpc/eeh: Fix deadlock handling dead PHB

Recovering a dead PHB can currently cause a deadlock as the PCI
rescan/remove lock is taken twice.

This is caused as part of an existing bug in
eeh_handle_special_event(). The pe is processed while traversing the
PHBs even though the pe is unrelated to the loop. This causes the pe
to be, incorrectly, processed more than once.

Untangling this section can move the pe processing out of the loop and
also outside the locked section, correcting both problems.

Fixes: 468fa6e07567 ("powerpc/eeh: Fix crash when edev->pdev changes")
Cc: stable@vger.kernel.org # 5.4+
Signed-off-by: Sam Bobroff <sbobroff@linux.ibm.com>
Reviewed-by: Frederic Barrat <fbarrat@linux.ibm.com>
Tested-by: Frederic Barrat <fbarrat@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/0547e82dbf90ee0729a2979a8cac5c91665c621f.1581051445.git.sbobroff@linux.ibm.com
arch/powerpc/kernel/eeh_driver.c