]> git.ipfire.org Git - thirdparty/linux.git/commit
cxl: Move port register setup to when first dport appear
authorDave Jiang <dave.jiang@intel.com>
Thu, 14 Aug 2025 22:21:44 +0000 (15:21 -0700)
committerDave Jiang <dave.jiang@intel.com>
Thu, 18 Sep 2025 21:31:10 +0000 (14:31 -0700)
commitf6ee24913de24dbda8d49213e1a27f5e1a5204cc
treeda01d6110fad7d90c6b77cc6a6041759025a072c
parentd64035a5a37741b25712fb9c2f6aca535c2967ea
cxl: Move port register setup to when first dport appear

This patch moves the port register setup to when the first dport appears
via the memdev probe path. At this point, the CXL link should be
established and the register access is expected to succeed. This change
addresses an error message observed when PCIe hotplug is enabled on
an Intel platform. The error messages "cxl portN: Couldn't locate the
CXL.cache and CXL.mem capability array header" is observed for the
host bridge (CHBCR) during cxl_acpi driver probe. If the cxl_acpi module
probe is running before the CXL link between the endpoint device and the
RP is established, then the platform may not have exposed DVSEC ID 3
and/or DVSEC ID 7 blocks which will trigger the error message. This
behavior is defined by the CXL spec r3.2 9.12.3 for RPs and DSPs, however
the Intel platform also added this behavior to the host bridge.

This change also needs the dport enumeration to be moved to the memdev
probe path in order to address the issue. This change is not a wholly
contained solution by itself.

[dj: Add missing var init during port alloc]

Suggested-by: Dan Williams <dan.j.williams@intel.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Tested-by: Robert Richter <rrichter@amd.com>
Reviewed-by: Alison Schofield <alison.schofield@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
drivers/cxl/core/port.c
drivers/cxl/cxl.h