lkml.org 
[lkml]   [2022]   [Sep]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRE: [PATCH 09/15] cxl/acpi: Determine PCI host bridge's ACPI UID
Robert Richter wrote:
> The UID is needed to read the RCH's CEDT entry with the RCRB base
> address. Determine the host's UID from its ACPI fw node.
>
> Signed-off-by: Robert Richter <rrichter@amd.com>
> ---
> drivers/cxl/acpi.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/drivers/cxl/acpi.c b/drivers/cxl/acpi.c
> index f9cdf23a91a8..b3146b7ae922 100644
> --- a/drivers/cxl/acpi.c
> +++ b/drivers/cxl/acpi.c
> @@ -368,8 +368,20 @@ struct pci_host_bridge *cxl_find_next_rch(struct pci_host_bridge *host)
> static int __init cxl_restricted_host_probe(struct platform_device *pdev)
> {
> struct pci_host_bridge *host = NULL;
> + struct acpi_device *adev;
> + unsigned long long uid = ~0;
>
> while ((host = cxl_find_next_rch(host)) != NULL) {
> + adev = ACPI_COMPANION(&host->dev);
> + if (!adev || !adev->pnp.unique_id ||
> + (kstrtoull(adev->pnp.unique_id, 10, &uid) < 0))
> + continue;
> +
> + dev_dbg(&adev->dev, "host uid: %llu\n", uid);
> +
> + if (uid > U32_MAX)
> + continue;

Looks redundant with existing _UID matching.

\
 
 \ /
  Last update: 2022-09-08 08:19    [W:1.897 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site