* [PATCH] cxl/pci: Honor -EPROBE_DEFER from component register setup
@ 2026-07-06 22:30 Dave Jiang
2026-07-06 22:35 ` Dave Jiang
0 siblings, 1 reply; 2+ messages in thread
From: Dave Jiang @ 2026-07-06 22:30 UTC (permalink / raw)
To: linux-cxl
Cc: djbw, dave, jic23, alison.schofield, vishal.l.verma, sashiko-bot
cxl_pci_setup_regs() for CXL_REGLOC_RBI_COMPONENT can return
-EPROBE_DEFER on a Restricted CXL Host (RCD) when the upstream port
has not yet been enumerated and the Component Registers must be
extracted from the RCRB. cxl_pci_probe() treats every non-zero return
from that call as the benign "component registers not found" case,
logs a warning, and continues. The rc is then immediately overwritten
by the subsequent cxl_pci_type3_init_mailbox() call, so the deferral
is silently swallowed.
Return -EPROBE_DEFER instead of continuing so the probe is retried
once the upstream port is available.
Reported-by: sashiko-bot@kernel.org
Closes: https://lore.kernel.org/linux-cxl/ajzhsubot_PSYtHQ@MWDK4CY14F/T/#m063bbf76b1c9c293ade52ab311018ae6bba11a44
Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
---
drivers/cxl/pci.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/cxl/pci.c b/drivers/cxl/pci.c
index 267c679b0b3c..c85aa790ff6e 100644
--- a/drivers/cxl/pci.c
+++ b/drivers/cxl/pci.c
@@ -826,9 +826,13 @@ static int cxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
/*
* If the component registers can't be found, the cxl_pci driver may
* still be useful for management functions so don't return an error.
+ * A deferral request must still be honored, otherwise the component
+ * and RAS registers are never mapped for the life of the binding.
*/
rc = cxl_pci_setup_regs(pdev, CXL_REGLOC_RBI_COMPONENT,
&cxlds->reg_map);
+ if (rc == -EPROBE_DEFER)
+ return rc;
if (rc)
dev_warn(&pdev->dev, "No component registers (%d)\n", rc);
else if (!cxlds->reg_map.component_map.ras.valid)
base-commit: 8cdeaa50eae8dad34885515f62559ee83e7e8dda
--
2.54.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] cxl/pci: Honor -EPROBE_DEFER from component register setup
2026-07-06 22:30 [PATCH] cxl/pci: Honor -EPROBE_DEFER from component register setup Dave Jiang
@ 2026-07-06 22:35 ` Dave Jiang
0 siblings, 0 replies; 2+ messages in thread
From: Dave Jiang @ 2026-07-06 22:35 UTC (permalink / raw)
To: linux-cxl
Cc: djbw, dave, jic23, alison.schofield, vishal.l.verma, sashiko-bot
Please ignore. Sent wrong version.
On 7/6/26 3:30 PM, Dave Jiang wrote:
> cxl_pci_setup_regs() for CXL_REGLOC_RBI_COMPONENT can return
> -EPROBE_DEFER on a Restricted CXL Host (RCD) when the upstream port
> has not yet been enumerated and the Component Registers must be
> extracted from the RCRB. cxl_pci_probe() treats every non-zero return
> from that call as the benign "component registers not found" case,
> logs a warning, and continues. The rc is then immediately overwritten
> by the subsequent cxl_pci_type3_init_mailbox() call, so the deferral
> is silently swallowed.
>
> Return -EPROBE_DEFER instead of continuing so the probe is retried
> once the upstream port is available.
>
> Reported-by: sashiko-bot@kernel.org
> Closes: https://lore.kernel.org/linux-cxl/ajzhsubot_PSYtHQ@MWDK4CY14F/T/#m063bbf76b1c9c293ade52ab311018ae6bba11a44
> Assisted-by: Claude:claude-opus-4-8
> Signed-off-by: Dave Jiang <dave.jiang@intel.com>
> ---
> drivers/cxl/pci.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/cxl/pci.c b/drivers/cxl/pci.c
> index 267c679b0b3c..c85aa790ff6e 100644
> --- a/drivers/cxl/pci.c
> +++ b/drivers/cxl/pci.c
> @@ -826,9 +826,13 @@ static int cxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
> /*
> * If the component registers can't be found, the cxl_pci driver may
> * still be useful for management functions so don't return an error.
> + * A deferral request must still be honored, otherwise the component
> + * and RAS registers are never mapped for the life of the binding.
> */
> rc = cxl_pci_setup_regs(pdev, CXL_REGLOC_RBI_COMPONENT,
> &cxlds->reg_map);
> + if (rc == -EPROBE_DEFER)
> + return rc;
> if (rc)
> dev_warn(&pdev->dev, "No component registers (%d)\n", rc);
> else if (!cxlds->reg_map.component_map.ras.valid)
>
> base-commit: 8cdeaa50eae8dad34885515f62559ee83e7e8dda
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-07-06 22:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-06 22:30 [PATCH] cxl/pci: Honor -EPROBE_DEFER from component register setup Dave Jiang
2026-07-06 22:35 ` Dave Jiang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox