diff mbox series

[02/16] PCI: Fix pci_reset_bus

Message ID 20180831212639.10196-3-keith.busch@intel.com (mailing list archive)
State New, archived
Delegated to: Bjorn Helgaas
Headers show
Series PCI, error handling and hot plug | expand

Commit Message

Keith Busch Aug. 31, 2018, 9:26 p.m. UTC
The check for slot reset capable, pci_probe_reset_slot, returns 0 when
slot reset is possible, but pci_reset_bus was proceeding to reset the
slot when the probe returned an error. This patch reverses the check to
fix that logic.

Signed-off-by: Keith Busch <keith.busch@intel.com>
---
 drivers/pci/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Sinan Kaya Aug. 31, 2018, 9:52 p.m. UTC | #1
On 8/31/2018 2:26 PM, Keith Busch wrote:
> The check for slot reset capable, pci_probe_reset_slot, returns 0 when
> slot reset is possible, but pci_reset_bus was proceeding to reset the
> slot when the probe returned an error. This patch reverses the check to
> fix that logic.
> 
> Signed-off-by: Keith Busch<keith.busch@intel.com>

Thanks, dennis.dalessandro@intel.com just posted the same patch.

Reviewed-by: Sinan Kaya <okaya@kernel.org>
Keith Busch Aug. 31, 2018, 10:08 p.m. UTC | #2
On Fri, Aug 31, 2018 at 02:52:25PM -0700, Sinan Kaya wrote:
> On 8/31/2018 2:26 PM, Keith Busch wrote:
> > The check for slot reset capable, pci_probe_reset_slot, returns 0 when
> > slot reset is possible, but pci_reset_bus was proceeding to reset the
> > slot when the probe returned an error. This patch reverses the check to
> > fix that logic.
> > 
> > Signed-off-by: Keith Busch<keith.busch@intel.com>
> 
> Thanks, dennis.dalessandro@intel.com just posted the same patch.

Oh, he sure did! Nothing in my series depends on this duplicate patch,
so no problem to use either one.
diff mbox series

Patch

diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 29ff9619b5fa..bc8419e0065a 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -5200,7 +5200,7 @@  static int __pci_reset_bus(struct pci_bus *bus)
  */
 int pci_reset_bus(struct pci_dev *pdev)
 {
-	return pci_probe_reset_slot(pdev->slot) ?
+	return !pci_probe_reset_slot(pdev->slot) ?
 	    __pci_reset_slot(pdev->slot) : __pci_reset_bus(pdev->bus);
 }
 EXPORT_SYMBOL_GPL(pci_reset_bus);