[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <dd172105-e152-4973-ad7f-0ed37ed0b18e@zohomail.com>
Date: Sun, 8 Feb 2026 20:20:55 +0800
From: Li Ming <ming.li@...omail.com>
To: dan.j.williams@...el.com
Cc: linux-cxl@...r.kernel.org, linux-kernel@...r.kernel.org,
dave@...olabs.net, jonathan.cameron@...wei.com, dave.jiang@...el.com,
alison.schofield@...el.com, vishal.l.verma@...el.com, ira.weiny@...el.com
Subject: Re: [PATCH v2 1/2] cxl/port: Hold port host lock while dport adding.
在 2026/2/8 01:28, dan.j.williams@...el.com 写道:
> Li Ming wrote:
[...]
> +static struct device *to_port_host(struct cxl_port *port)
> +{
> + struct cxl_port *parent = parent_port_of(port);
> +
> + /*
> + * The host of CXL root port and the first level of ports is
> + * the platform firmware device, the host of all other ports
> + * is their parent port.
> + */
> + if (!parent)
> + return port->uport_dev;
> This helper looks good and this case is theoretically correct, but I
> assume that find_or_add_dport() never hits this case, right?
>
> How about move the introduction of this helper to its own lead-in patch
> and use it to replace the open coded version of this pattern in
> unregister_port(), __devm_cxl_add_dport(), and endpoint_host().
BTW, after taking a look into __devm_cxl_add_dport(), this helper is not
suitable for this case,
the host in __devm_cxl_add_dport() means the new dport's host, it is the
device of the cxl port which
the cxl port belongs(or the uport_dev of the cxl port if the port is cxl
root).
So I will update unregister_port() and endpoint_host(), and check if
there are other
places needed to be cleanup.
Ming
Powered by blists - more mailing lists