Linux CXL
 help / color / mirror / Atom feed
* [PATCH] cxl/ras: Pass the PCI device's struct device to match_memdev_by_parent()
@ 2026-08-28 21:57 Dave Jiang
  2026-08-28 22:11 ` Bowman, Terry
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Dave Jiang @ 2026-08-28 21:57 UTC (permalink / raw)
  To: linux-cxl; +Cc: dave, jic23, alison.schofield, ming.li, terry.bowman

cxl_cper_handle_prot_err() hands bus_find_device() the 'struct pci_dev'
where match_memdev_by_parent() expects the embedded 'struct device'. The
comparison never matches. The lookup always fails and CXL endpoint
protocol errors reported via CPER are dropped without a trace event,
leaving only the root port, downstream and upstream cases reporting.

Pass &pdev->dev, and rename the callback parameter to match what it is.

Fixes: 3c70ec71abda ("cxl/ras: Fix CPER handler device confusion")
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
---
 drivers/cxl/core/ras.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/cxl/core/ras.c b/drivers/cxl/core/ras.c
index c91db125a971..a2c7c9479f2b 100644
--- a/drivers/cxl/core/ras.c
+++ b/drivers/cxl/core/ras.c
@@ -70,9 +70,9 @@ cxl_cper_trace_uncorr_prot_err(struct cxl_memdev *cxlmd,
 	trace_cxl_aer_uncorrectable_error(cxlmd, status, fe, hl);
 }
 
-static int match_memdev_by_parent(struct device *dev, const void *uport)
+static int match_memdev_by_parent(struct device *dev, const void *parent)
 {
-	if (is_cxl_memdev(dev) && dev->parent == uport)
+	if (is_cxl_memdev(dev) && dev->parent == parent)
 		return 1;
 	return 0;
 }
@@ -108,7 +108,7 @@ static void cxl_cper_handle_prot_err(struct cxl_cper_prot_err_work_data *data)
 		return;
 
 	struct device *mem_dev __free(put_device) = bus_find_device(
-		&cxl_bus_type, NULL, pdev, match_memdev_by_parent);
+		&cxl_bus_type, NULL, &pdev->dev, match_memdev_by_parent);
 	if (!mem_dev)
 		return;
 

base-commit: 751627a8c5cde68e0b396126449749e8bfbe592d
-- 
2.54.0


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

end of thread, other threads:[~2026-09-02 15:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-28 21:57 [PATCH] cxl/ras: Pass the PCI device's struct device to match_memdev_by_parent() Dave Jiang
2026-08-28 22:11 ` Bowman, Terry
2026-09-01 18:24 ` Alison Schofield
2026-09-02 15:38 ` Dave Jiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox