* [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
* Re: [PATCH] cxl/ras: Pass the PCI device's struct device to match_memdev_by_parent()
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
2 siblings, 0 replies; 4+ messages in thread
From: Bowman, Terry @ 2026-08-28 22:11 UTC (permalink / raw)
To: Dave Jiang, linux-cxl; +Cc: dave, jic23, alison.schofield, ming.li
On 8/28/2026 4:57 PM, Dave Jiang wrote:
> 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;
>
>
Looks good. Feel free to add my RB:
Reviewed-by: Terry Bowman <terry.bowman@amd.com>
-Terry
> base-commit: 751627a8c5cde68e0b396126449749e8bfbe592d
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] cxl/ras: Pass the PCI device's struct device to match_memdev_by_parent()
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
2 siblings, 0 replies; 4+ messages in thread
From: Alison Schofield @ 2026-09-01 18:24 UTC (permalink / raw)
To: Dave Jiang; +Cc: linux-cxl, dave, jic23, ming.li, terry.bowman
On Fri, Aug 28, 2026 at 02:57:26PM -0700, Dave Jiang wrote:
> 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>
Reviewed-by: Alison Schofield <alison.schofield@intel.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] cxl/ras: Pass the PCI device's struct device to match_memdev_by_parent()
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
2 siblings, 0 replies; 4+ messages in thread
From: Dave Jiang @ 2026-09-02 15:38 UTC (permalink / raw)
To: linux-cxl; +Cc: dave, jic23, alison.schofield, ming.li, terry.bowman
On 8/28/26 2:57 PM, Dave Jiang wrote:
> 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>
Applied to cxl/next
977eaad352ba
> ---
> 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
^ permalink raw reply [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