All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH for-rc v2 1/3] PCI: Fix faulty logic in pci_reset_bus()
@ 2018-09-05 16:08 Sinan Kaya
  2018-09-05 16:08 ` [PATCH for-rc v2 2/3] PCI: Request reset type as part of function reset Sinan Kaya
  2018-09-05 16:08 ` [PATCH for-rc v2 3/3] IB/hfi1: Prefer new __pci_reset_function_locked() API with reset type Sinan Kaya
  0 siblings, 2 replies; 13+ messages in thread
From: Sinan Kaya @ 2018-09-05 16:08 UTC (permalink / raw)
  To: linux-pci; +Cc: Dennis Dalessandro, Sinan Kaya, Bjorn Helgaas

From: Dennis Dalessandro <dennis.dalessandro@intel.com>

The pci_rest_bus() function calls into pci_probe_reset_slot() to determine
whether to call the slot or bus reset. The check has faulty logic in that
it does not account for pci_probe_reset_slot() being able to return an
errno. Fix by only calling the slot reset when the function returns 0.
Treat < 1 and > 1 the same.

Cc: Sinan Kaya <okaya@codeaurora.org>
Fixes: 811c5cb37df4 ("PCI: Unify try slot and bus reset API")
Reviewed-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
---
 drivers/pci/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 29ff9619b5fa..30b260332a10 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);
-- 
2.18.0

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2018-09-12  7:01 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-05 16:08 [PATCH for-rc v2 1/3] PCI: Fix faulty logic in pci_reset_bus() Sinan Kaya
2018-09-05 16:08 ` [PATCH for-rc v2 2/3] PCI: Request reset type as part of function reset Sinan Kaya
2018-09-05 23:07   ` Boris Ostrovsky
2018-09-05 16:08 ` [PATCH for-rc v2 3/3] IB/hfi1: Prefer new __pci_reset_function_locked() API with reset type Sinan Kaya
2018-09-05 16:17   ` Doug Ledford
2018-09-05 17:21   ` Dennis Dalessandro
2018-09-12  1:09   ` Bjorn Helgaas
2018-09-12  1:23     ` Sinan Kaya
2018-09-12  1:59       ` Bjorn Helgaas
2018-09-12  2:05         ` Sinan Kaya
2018-09-12  2:23         ` Dennis Dalessandro
2018-09-12  2:34         ` Alex Williamson
2018-09-12  2:47           ` Sinan Kaya

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.