drivers/pci/hotplug: Handle presence detection change properly
authorGavin Shan <gwshan@linux.vnet.ibm.com>
Wed, 11 Jan 2017 00:50:06 +0000 (11:50 +1100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Mar 2017 02:02:46 +0000 (10:02 +0800)
commit1afe7b4ac3df20d2b9afd90d475fa466027a6595
tree8812b2d5a59a0d02a431944433078f5a1b758654
parent17ea11d553220281ab037799642ecd45246c3a65
drivers/pci/hotplug: Handle presence detection change properly

commit d7d55536c6cd1f80295b6d7483ad0587b148bde4 upstream.

The surprise hotplug is driven by interrupt in PowerNV PCI hotplug
driver. In the interrupt handler, pnv_php_interrupt(), we bail when
pnv_pci_get_presence_state() returns zero wrongly. It causes the
presence change event is always ignored incorrectly.

This fixes the issue by bailing on error (non-zero value) returned
from pnv_pci_get_presence_state().

Fixes: 360aebd85a4 ("drivers/pci/hotplug: Support surprise hotplug in powernv driver")
Reported-by: Hank Chang <hankmax0000@gmail.com>
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Tested-by: Willie Liauw <williel@supermicro.com.tw>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/pci/hotplug/pnv_php.c