The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Chen Pei <cp0613@linux.alibaba.com>
To: alison.schofield@intel.com
Cc: cp0613@linux.alibaba.com, dave.jiang@intel.com,
	dave@stgolabs.net, djbw@kernel.org, guoren@kernel.org,
	ira.weiny@intel.com, jic23@kernel.org, linux-cxl@vger.kernel.org,
	linux-kernel@vger.kernel.org, vishal.l.verma@intel.com
Subject: Re: [PATCH] cxl/acpi: Defer probe when ACPI0016 PCI root bridge is not ready
Date: Fri, 15 May 2026 21:56:20 +0800	[thread overview]
Message-ID: <20260515135620.19429-1-cp0613@linux.alibaba.com> (raw)
In-Reply-To: <agYEL3qFef-wqHB_@aschofie-mobl2.lan>

On Thu, 14 May 2026 10:19:43 -0700, Alison Schofield wrote:

> > On some platforms (e.g., RISC-V and ARM64) that use the generic
> > pci_acpi_scan_root() implementation, cxl_acpi_probe may run before
> > acpi_pci_root driver has bound to ACPI0016 (CXL host bridge) devices.
> > In this case, acpi_pci_find_root() returns NULL, causing
> > to_cxl_host_bridge() to skip the device silently. This results in
> > incomplete CXL port enumeration on first boot.
> > 
> > Fix this by detecting the case where an ACPI0016 device exists but its
> > PCI root bridge is not yet ready, and returning -EPROBE_DEFER to trigger
> > a deferred probe retry.
> > 
> > Signed-off-by: Chen Pei <cp0613@linux.alibaba.com>
> 
> Hi Chen Pei,
> 
> As Richard suggested, this fails for the mock platform in cxl-test.
> (stack trace appended at end)
> 
> With this diff applied on top of your patch, it works for cxl-test
> AND I think it works for your case too. With real hardware,
> ACPI_COMPANION returns the device, and with the mock platform,
> ACPI_COMPANION returns NULL and the defer check is skipped.
> 
> Try it out, and note that I didn't consider if any of the comments
> need updating.

Hi Alison,

Thanks for the fix! 

I'll test it on my RISC-V QEMU setup and fold it into v2 along with
the other review feedback (switching to acpi_dev_hid_match(),
dropping the redundant check in add_host_bridge_uport(), etc.).

Will also run the CXL kselftests to make sure the mock platform path
works correctly.

Thanks,
Pei

  reply	other threads:[~2026-05-15 13:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-14  2:32 [PATCH] cxl/acpi: Defer probe when ACPI0016 PCI root bridge is not ready Chen Pei
2026-05-14  7:31 ` Richard Cheng
2026-05-15 13:46   ` Chen Pei
2026-05-15 19:24     ` Dan Williams (nvidia)
2026-05-14 17:10 ` Dave Jiang
2026-05-15 13:53   ` Chen Pei
2026-05-14 17:19 ` Alison Schofield
2026-05-15 13:56   ` Chen Pei [this message]
2026-05-15 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=20260515135620.19429-1-cp0613@linux.alibaba.com \
    --to=cp0613@linux.alibaba.com \
    --cc=alison.schofield@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=dave@stgolabs.net \
    --cc=djbw@kernel.org \
    --cc=guoren@kernel.org \
    --cc=ira.weiny@intel.com \
    --cc=jic23@kernel.org \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vishal.l.verma@intel.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