Linux CXL
 help / color / mirror / Atom feed
From: "Bowman, Terry" <terry.bowman@amd.com>
To: Dave Jiang <dave.jiang@intel.com>, linux-cxl@vger.kernel.org
Cc: dave@stgolabs.net, jic23@kernel.org, alison.schofield@intel.com,
	ming.li@zohomail.com
Subject: Re: [PATCH] cxl/ras: Pass the PCI device's struct device to match_memdev_by_parent()
Date: Fri, 28 Aug 2026 17:11:55 -0500	[thread overview]
Message-ID: <761baeba-2394-4b1b-932e-826d99cf289d@amd.com> (raw)
In-Reply-To: <20260828215726.1077498-1-dave.jiang@intel.com>

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


  reply	other threads:[~2026-08-28 22:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2026-09-01 18:24 ` Alison Schofield
2026-09-02 15:38 ` Dave Jiang

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=761baeba-2394-4b1b-932e-826d99cf289d@amd.com \
    --to=terry.bowman@amd.com \
    --cc=alison.schofield@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=dave@stgolabs.net \
    --cc=jic23@kernel.org \
    --cc=linux-cxl@vger.kernel.org \
    --cc=ming.li@zohomail.com \
    /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