Re: [PATCH v3 11/11] cxl: Enable AMD Zen5 address translation using ACPI PRMT
From: Gregory Price
Date: Wed Sep 24 2025 - 13:10:03 EST
On Fri, Sep 12, 2025 at 04:45:13PM +0200, Robert Richter wrote:
> +static void cxl_prm_init(struct cxl_port *port)
> +{
> + u64 spa;
> + struct prm_cxl_dpa_spa_data data = { .out = &spa, };
> + int rc;
> +
> + if (!check_prm_address_translation(port))
> + return;
> +
> + /* Check kernel (-EOPNOTSUPP) and firmware support (-ENODEV) */
> + rc = acpi_call_prm_handler(prm_cxl_dpa_spa_guid, &data);
> + if (rc == -EOPNOTSUPP || rc == -ENODEV)
> + return;
> +
> + port->to_hpa = cxl_prm_to_hpa;
> +
> + dev_dbg(port->host_bridge, "PRM address translation enabled for %s.\n",
> + dev_name(&port->dev));
> +}
Is it possible that the PRMT function is present but uninitialize?
For example if expanders are not in a normalized address mode.
This code would likely still add the to_hpa() function reference even
if the underlying PRMT function hasn't been set up for translation.
~Gregory