linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] PCI/RCEC: Fix failure to inject errors to some RCiEP devices
@ 2021-02-10  2:05 Qiuxu Zhuo
  2021-02-10  4:33 ` Kelley, Sean V
  2021-02-10 17:12 ` Krzysztof Wilczyński
  0 siblings, 2 replies; 15+ messages in thread
From: Qiuxu Zhuo @ 2021-02-10  2:05 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Qiuxu Zhuo, Sean V Kelley, Luck, Tony, Jin, Wen, linux-pci, linux-kernel

On a Sapphire Rapids server, it failed to inject correctable errors
to the RCiEP device e8:02.0 which was associated with the RCEC device
e8:00.4. See the following error log before applying the patch:

aer-inject -s e8:02.0 examples/correctable
Error: Failed to write, No such device

This was because rcec_assoc_rciep() mistakenly used "rciep->devfn" as
device number to check whether the corresponding bit was set in
the RCiEPBitmap of the RCEC. So that the RCiEP device e8:02.0 wasn't
linked to the RCEC and resulted in the above error.

Fix it by using PCI_SLOT() to convert rciep->devfn to device number.
Ensure that the RCiEP devices associated with the RCEC are linked to
the RCEC as the RCEC is enumerated. After applying the patch, correctable
errors can be injected to the RCiEP successfully.

Reported-and-tested-by: Wen Jin <wen.jin@intel.com>
Signed-off-by: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
---
 drivers/pci/pcie/rcec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/pcie/rcec.c b/drivers/pci/pcie/rcec.c
index 2c5c552994e4..d0bcd141ac9c 100644
--- a/drivers/pci/pcie/rcec.c
+++ b/drivers/pci/pcie/rcec.c
@@ -32,7 +32,7 @@ static bool rcec_assoc_rciep(struct pci_dev *rcec, struct pci_dev *rciep)
 
 	/* Same bus, so check bitmap */
 	for_each_set_bit(devn, &bitmap, 32)
-		if (devn == rciep->devfn)
+		if (devn == PCI_SLOT(rciep->devfn))
 			return true;
 
 	return false;
-- 
2.17.1


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

end of thread, other threads:[~2021-03-11  3:14 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-10  2:05 [PATCH 1/1] PCI/RCEC: Fix failure to inject errors to some RCiEP devices Qiuxu Zhuo
2021-02-10  4:33 ` Kelley, Sean V
2021-02-10 17:12 ` Krzysztof Wilczyński
2021-02-18  3:00   ` Zhuo, Qiuxu
2021-02-18 22:07     ` 'Krzysztof Wilczyński'
2021-02-18 22:11       ` 'Krzysztof Wilczyński'
2021-02-19  1:52         ` Zhuo, Qiuxu
2021-02-19  2:23           ` [PATCH v2 1/1] PCI/RCEC: Fix RCiEP capable devices RCEC association Qiuxu Zhuo
2021-02-22  0:56             ` Krzysztof Wilczyński
2021-02-22  1:04               ` Zhuo, Qiuxu
2021-02-22  1:17                 ` [PATCH v3 " Qiuxu Zhuo
2021-03-05  6:12                   ` Zhuo, Qiuxu
2021-03-10 22:00                   ` Bjorn Helgaas
2021-03-11  3:13                     ` Zhuo, Qiuxu
2021-02-19  1:51       ` [PATCH 1/1] PCI/RCEC: Fix failure to inject errors to some RCiEP devices Zhuo, Qiuxu

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).