Re: [PATCH v14 21/34] cxl/port: Move dport RAS reporting to a port resource
From: Jonathan Cameron
Date: Thu Jan 15 2026 - 10:02:35 EST
On Wed, 14 Jan 2026 12:20:42 -0600
Terry Bowman <terry.bowman@xxxxxxx> wrote:
> From: Dan Williams <dan.j.williams@xxxxxxxxx>
>
> Towards the end goal of making all CXL RAS capability handling uniform
> across upstream host bridges, upstream switch ports, and upstream endpoint
> ports, move dport RAS setup to cxl_endpoint_port_probe(). Rename the RAS
> setup helper to devm_cxl_dport_ras_setup() for symmetry with
> devm_cxl_switch_port_decoders_setup().
>
> Signed-off-by: Dan Williams <dan.j.williams@xxxxxxxxx>
> Reviewed-by: Terry Bowman <terry.bowman@xxxxxxx>
One trivial thing inline.
Reviewed-by: Jonathan Cameron <jonathan.cameron@xxxxxxxxxx>
>
> ---
>
> Changes in v13 -> v14:
> - New patch
> ---
> drivers/cxl/core/ras.c | 12 ++++++------
> drivers/cxl/cxlpci.h | 8 ++++----
> drivers/cxl/mem.c | 2 --
> drivers/cxl/port.c | 12 ++++++++++++
> tools/testing/cxl/Kbuild | 2 +-
> tools/testing/cxl/test/mock.c | 6 +++---
> 6 files changed, 26 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/cxl/core/ras.c b/drivers/cxl/core/ras.c
> index 72908f3ced77..d71fcac31cf2 100644
> --- a/drivers/cxl/core/ras.c
> +++ b/drivers/cxl/core/ras.c
> @@ -139,17 +139,17 @@ static void cxl_dport_map_ras(struct cxl_dport *dport)
> }
>
> /**
> - * cxl_dport_init_ras_reporting - Setup CXL RAS report on this dport
> + * devm_cxl_dport_ras_setup - Setup CXL RAS report on this dport
> * @dport: the cxl_dport that needs to be initialized
> - * @host: host device for devm operations
> */
> -void cxl_dport_init_ras_reporting(struct cxl_dport *dport, struct device *host)
> +void devm_cxl_dport_ras_setup(struct cxl_dport *dport)
Not a thing for this patch set, but might be nice to at somepoint
prefix all the functions that have devm_ registrations in them so
it is obvious where those are hiding. I had to dig down a few
levels to find the call.
> {
> - dport->reg_map.host = host;
> + dport->reg_map.host = &dport->port->dev;
> cxl_dport_map_ras(dport);
>
> if (dport->rch) {
> - struct pci_host_bridge *host_bridge = to_pci_host_bridge(dport->dport_dev);
> + struct pci_host_bridge *host_bridge =
> + to_pci_host_bridge(dport->dport_dev);
Unrelated change. This series is complex, so this sort of noise is not helpful
to reviewability!
>
> if (!host_bridge->native_aer)
> return;
> @@ -158,7 +158,7 @@ void cxl_dport_init_ras_reporting(struct cxl_dport *dport, struct device *host)
> cxl_disable_rch_root_ints(dport);
> }
> }
> -EXPORT_SYMBOL_NS_GPL(cxl_dport_init_ras_reporting, "CXL");
> +EXPORT_SYMBOL_NS_GPL(devm_cxl_dport_ras_setup, "CXL");
>
> void cxl_handle_cor_ras(struct device *dev, void __iomem *ras_base)
> {