From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: Dave Jiang <dave.jiang@intel.com>
Cc: <linux-cxl@vger.kernel.org>, <linux-acpi@vger.kernel.org>,
<dan.j.williams@intel.com>, <ira.weiny@intel.com>,
<vishal.l.verma@intel.com>, <alison.schofield@intel.com>,
<dave@stgolabs.net>, <rafael@kernel.org>,
<gregkh@linuxfoundation.org>
Subject: Re: [PATCH v5 08/12] cxl: Set cxlmd->endpoint before adding port device
Date: Thu, 15 Feb 2024 17:01:12 +0000 [thread overview]
Message-ID: <20240215170112.000056a6@Huawei.com> (raw)
In-Reply-To: <20240206222951.1833098-9-dave.jiang@intel.com>
On Tue, 6 Feb 2024 15:28:36 -0700
Dave Jiang <dave.jiang@intel.com> wrote:
> Move setting of cxlmd->endpoint to before calling add_device() on the port
> device. Otherwise when referencing cxlmd->endpoint in region discovery code
> that is triggered by the port driver probe function, the endpoint port
> pointer is not valid.
Maybe make it clear this only matters (I assume) when we start doing
such a look up? Otherwise description sounds like a fix.
>
> Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Change looks fine
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huwei.com>
> ---
> drivers/cxl/core/port.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/cxl/core/port.c b/drivers/cxl/core/port.c
> index e8029170b8c6..2f2b7af9275e 100644
> --- a/drivers/cxl/core/port.c
> +++ b/drivers/cxl/core/port.c
> @@ -822,6 +822,7 @@ static struct cxl_port *__devm_cxl_add_port(struct device *host,
> */
> port->reg_map = cxlds->reg_map;
> port->reg_map.host = &port->dev;
> + cxlmd->endpoint = port;
> } else if (parent_dport) {
> rc = dev_set_name(dev, "port%d", port->id);
> if (rc)
> @@ -1374,7 +1375,6 @@ int cxl_endpoint_autoremove(struct cxl_memdev *cxlmd, struct cxl_port *endpoint)
>
> get_device(host);
> get_device(&endpoint->dev);
> - cxlmd->endpoint = endpoint;
> cxlmd->depth = endpoint->depth;
> return devm_add_action_or_reset(dev, delete_endpoint, cxlmd);
> }
next prev parent reply other threads:[~2024-02-15 17:01 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-06 22:28 [PATCH v5 0/12] cxl: Add support to report region access coordinates to numa nodes Dave Jiang
2024-02-06 22:28 ` [PATCH v5 01/12] ACPI: HMAT: Remove register of memory node for generic target Dave Jiang
2024-02-15 16:20 ` Jonathan Cameron
2024-02-06 22:28 ` [PATCH v5 02/12] base/node / ACPI: Enumerate node access class for 'struct access_coordinate' Dave Jiang
2024-02-15 16:24 ` Jonathan Cameron
2024-02-06 22:28 ` [PATCH v5 03/12] ACPI: HMAT: Introduce 2 levels of generic port access class Dave Jiang
2024-02-15 16:44 ` Jonathan Cameron
2024-02-06 22:28 ` [PATCH v5 04/12] ACPI: HMAT / cxl: Add retrieval of generic port coordinates for both access classes Dave Jiang
2024-02-15 16:46 ` Jonathan Cameron
2024-02-06 22:28 ` [PATCH v5 05/12] cxl: Split out combine_coordinates() for common shared usage Dave Jiang
2024-02-15 16:51 ` Jonathan Cameron
2024-02-16 21:28 ` Dave Jiang
2024-02-06 22:28 ` [PATCH v5 06/12] cxl: Split out host bridge access coordinates Dave Jiang
2024-02-15 16:56 ` Jonathan Cameron
2024-02-06 22:28 ` [PATCH v5 07/12] cxl: Move QoS class to be calculated from the nearest CPU Dave Jiang
2024-02-15 16:57 ` Jonathan Cameron
2024-02-06 22:28 ` [PATCH v5 08/12] cxl: Set cxlmd->endpoint before adding port device Dave Jiang
2024-02-15 17:01 ` Jonathan Cameron [this message]
2024-02-06 22:28 ` [PATCH v5 09/12] cxl/region: Calculate performance data for a region Dave Jiang
2024-02-06 22:28 ` [PATCH v5 10/12] cxl/region: Add sysfs attribute for locality attributes of CXL regions Dave Jiang
2024-02-15 17:08 ` Jonathan Cameron
2024-02-06 22:28 ` [PATCH v5 11/12] cxl/region: Add memory hotplug notifier for cxl region Dave Jiang
2024-02-15 17:16 ` Jonathan Cameron
2024-02-06 22:28 ` [PATCH v5 12/12] cxl/region: Deal with numa nodes not enumarated by SRAT Dave Jiang
2024-02-15 17:24 ` Jonathan Cameron
2024-02-20 20:47 ` Dave Jiang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240215170112.000056a6@Huawei.com \
--to=jonathan.cameron@huawei.com \
--cc=alison.schofield@intel.com \
--cc=dan.j.williams@intel.com \
--cc=dave.jiang@intel.com \
--cc=dave@stgolabs.net \
--cc=gregkh@linuxfoundation.org \
--cc=ira.weiny@intel.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-cxl@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=vishal.l.verma@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox