]> git.baikalelectronics.ru Git - kernel.git/commit
pci/hotplug/pnv-php: Disable MSI and PCI device properly
authorGavin Shan <gwshan@linux.vnet.ibm.com>
Wed, 15 Feb 2017 23:22:34 +0000 (10:22 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 17 Feb 2017 11:13:29 +0000 (22:13 +1100)
commit9707edb553b1af52b82bdc694735972cd35a62d1
treeaccdce0ba7fd9e780e8fe50d0549a1911ef517a3
parent3598c3a641a09c5f61438d09497d8c2e43dd5bd2
pci/hotplug/pnv-php: Disable MSI and PCI device properly

pnv_php_disable_irq() can be called in two paths: Bailing path in
pnv_php_enable_irq() or releasing slot. The MSI (or MSIx) interrupts
is disabled unconditionally in pnv_php_disable_irq(). It's wrong
because that might be enabled by drivers other than pnv-php.

This disables MSI (or MSIx) interrupts and the PCI device only if
it was enabled by pnv-php. In the error path of pnv_php_enable_irq(),
we rely on the newly added parameter @disable_device. In the path
of releasing slot, @pnv_php->irq is checked.

Cc: <stable@vger.kernel.org> # v4.9+
Fixes: 82f2be2edc3f ("drivers/pci/hotplug: Support surprise hotplug in powernv driver")
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
drivers/pci/hotplug/pnv_php.c