From: Keith Busch <kbusch@kernel.org>
To: linux-pci@vger.kernel.org, Bjorn Helgaas <bhelgaas@google.com>
Cc: Keith Busch <kbusch@kernel.org>
Subject: [PATCH 2/3] PCI/AER: Actually get the root port
Date: Thu, 17 Dec 2020 09:14:30 -0800 [thread overview]
Message-ID: <20201217171431.502030-2-kbusch@kernel.org> (raw)
In-Reply-To: <20201217171431.502030-1-kbusch@kernel.org>
The pci_dev parameter given to aer_root_reset() may be a downstream port
rather than the root port. Get the root port from the provided device in
order to clear the root's aer status, and update the message to indicate
which type of port was actually reset.
Signed-off-by: Keith Busch <kbusch@kernel.org>
---
drivers/pci/pcie/aer.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c
index 77b0f2c45bc0..b2b0e9eb5cfb 100644
--- a/drivers/pci/pcie/aer.c
+++ b/drivers/pci/pcie/aer.c
@@ -1388,7 +1388,7 @@ static pci_ers_result_t aer_root_reset(struct pci_dev *dev)
if (type == PCI_EXP_TYPE_RC_END)
root = dev->rcec;
else
- root = dev;
+ root = pcie_find_root_port(dev);
/*
* If the platform retained control of AER, an RCiEP may not have
@@ -1414,7 +1414,8 @@ static pci_ers_result_t aer_root_reset(struct pci_dev *dev)
}
} else {
rc = pci_bus_error_reset(dev);
- pci_info(dev, "Root Port link has been reset (%d)\n", rc);
+ pci_info(dev, "%s Port link has been reset (%d)\n", rc,
+ pci_is_root_bus(dev->bus) ? "Root" : "Downstream");
}
if ((host->native_aer || pcie_ports_native) && aer) {
--
2.24.1
next prev parent reply other threads:[~2020-12-17 17:15 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-17 17:14 [PATCH 1/3] PCI/ERR: Clear status of the reporting device Keith Busch
2020-12-17 17:14 ` Keith Busch [this message]
2020-12-17 23:15 ` [PATCH 2/3] PCI/AER: Actually get the root port kernel test robot
2020-12-17 23:34 ` kernel test robot
2021-01-04 18:42 ` Kelley, Sean V
2021-01-04 22:05 ` Keith Busch
2021-01-04 22:10 ` Kelley, Sean V
2020-12-17 17:14 ` [PATCH 3/3] PCI/ERR: Retain status from error notification Keith Busch
2021-01-04 18:43 ` Kelley, Sean V
2021-01-05 14:12 ` Hinko Kocevar
2021-01-04 18:42 ` [PATCH 1/3] PCI/ERR: Clear status of the reporting device Kelley, Sean V
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=20201217171431.502030-2-kbusch@kernel.org \
--to=kbusch@kernel.org \
--cc=bhelgaas@google.com \
--cc=linux-pci@vger.kernel.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).