From: Sinan Kaya <okaya@codeaurora.org>
To: linux-pci@vger.kernel.org, timur@codeaurora.org,
alex.williamson@redhat.com
Cc: linux-arm-msm@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
Sinan Kaya <okaya@codeaurora.org>,
Bjorn Helgaas <bhelgaas@google.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH 5/5] PCI: add device wait after slot and bus reset
Date: Sat, 23 Sep 2017 20:16:58 -0400 [thread overview]
Message-ID: <1506212218-29103-5-git-send-email-okaya@codeaurora.org> (raw)
In-Reply-To: <1506212218-29103-1-git-send-email-okaya@codeaurora.org>
Rev 3.1 Sec 2.3.1 Request Handling Rules indicates that a device can issue
CRS following secondary bus reset. Handle device presence gracefully.
Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
drivers/pci/pci.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 074adf9..7131aab 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -4056,7 +4056,7 @@ static int pci_parent_bus_reset(struct pci_dev *dev, int probe)
pci_reset_bridge_secondary_bus(dev->bus->self);
- return 0;
+ return pci_dev_wait(dev, "bus reset", 1000, 60000);
}
static int pci_reset_hotplug_slot(struct hotplug_slot *hotplug, int probe)
@@ -4077,6 +4077,7 @@ static int pci_reset_hotplug_slot(struct hotplug_slot *hotplug, int probe)
static int pci_dev_reset_slot_function(struct pci_dev *dev, int probe)
{
struct pci_dev *pdev;
+ int rc;
if (dev->subordinate || !dev->slot ||
dev->dev_flags & PCI_DEV_FLAGS_NO_BUS_RESET)
@@ -4086,7 +4087,11 @@ static int pci_dev_reset_slot_function(struct pci_dev *dev, int probe)
if (pdev != dev && pdev->slot == dev->slot)
return -ENOTTY;
- return pci_reset_hotplug_slot(dev->slot->hotplug, probe);
+ rc = pci_reset_hotplug_slot(dev->slot->hotplug, probe);
+ if (!rc && !probe)
+ rc = pci_dev_wait(dev, "slot reset", 1000, 60000);
+
+ return rc;
}
static void pci_dev_lock(struct pci_dev *dev)
--
1.9.1
next prev parent reply other threads:[~2017-09-24 0:16 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-24 0:16 [PATCH 1/5] PCI: protect restore with device lock to be consistent Sinan Kaya
2017-09-24 0:16 ` [PATCH 2/5] PCI: handle FLR failure and allow other reset types Sinan Kaya
2017-10-11 21:00 ` Bjorn Helgaas
2017-10-12 16:42 ` Sinan Kaya
2017-09-24 0:16 ` [PATCH 3/5] PCI: make pci_flr_wait() generic and rename to pci_dev_wait() Sinan Kaya
2017-09-24 13:08 ` Christoph Hellwig
2017-09-25 0:30 ` Sinan Kaya
2017-09-24 0:16 ` [PATCH 4/5] PCI: wait device ready after pci_pm_reset() Sinan Kaya
2017-10-11 22:06 ` Bjorn Helgaas
2017-10-12 16:48 ` Sinan Kaya
2017-10-16 12:51 ` Sinan Kaya
2017-09-24 0:16 ` Sinan Kaya [this message]
2017-09-24 0:20 ` [PATCH 5/5] PCI: add device wait after slot and bus reset Sinan Kaya
2017-10-11 22:08 ` [PATCH 1/5] PCI: protect restore with device lock to be consistent Bjorn Helgaas
2017-10-12 16:39 ` Sinan Kaya
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1506212218-29103-5-git-send-email-okaya@codeaurora.org \
--to=okaya@codeaurora.org \
--cc=alex.williamson@redhat.com \
--cc=bhelgaas@google.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=timur@codeaurora.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).