From: <dan.j.williams@intel.com>
To: Li Ming <ming.li@zohomail.com>,
Jonathan Cameron <jonathan.cameron@huawei.com>
Cc: dave <dave@stgolabs.net>, dave.jiang <dave.jiang@intel.com>,
alison.schofield <alison.schofield@intel.com>,
vishal.l.verma <vishal.l.verma@intel.com>,
ira.weiny <ira.weiny@intel.com>,
dan.j.williams <dan.j.williams@intel.com>,
linux-cxl <linux-cxl@vger.kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] cxl/core: Hold grandparent port lock while dport adding
Date: Tue, 3 Feb 2026 13:14:35 -0800 [thread overview]
Message-ID: <6982653bdfcbc_68d310065@dwillia2-mobl4.notmuch> (raw)
In-Reply-To: <19c23e33320.c78951ef7300.3027465952765956716@zohomail.com>
Li Ming wrote:
[..]
> > > - scoped_guard(device, &port->dev) {
> > > + scoped_guard(device, &parent_port_of(port)->dev) {
> > I'm nervous about whether this is the right lock. For unregister_port()
> > (which is easier to track down that the add path locking) the lock
> > taken depends on where the port is that is being unregistered.
> > Specifically root ports are unregistered under parent->uport_dev, not
> > parent->dev.
> You are right.
> When cxl acpi driver attempts to add a cxl host bridge port, it will hold cxl_root->uport_dev.
> Otherwide, hold parent_port->dev lock for the new port addition.
> So I think it is possible that memdev can observe a cxl host bridge port but it has not been attach yet.
> Maybe I should hold the lock of the new port's host.
> Let's see if other reviewers have more comments on that.
So, I think current code is ok, if cxl_mem_probe() races
cxl_acpi_probe() in the same way that case is already caught by the
cxl_bus_rescan() at the end of cxl_acpi_probe().
next prev parent reply other threads:[~2026-02-03 21:14 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-01 9:30 [PATCH 0/2] Fix port enumeration failure and NULL endpoint issue Li Ming
2026-02-01 9:30 ` [PATCH 1/2] cxl/core: Set cxlmd->endpoint to NULL by default Li Ming
2026-02-02 14:41 ` Jonathan Cameron
2026-02-02 15:48 ` Gregory Price
2026-02-03 14:15 ` Li Ming
2026-02-02 21:04 ` Dave Jiang
2026-02-03 15:04 ` Li Ming
2026-02-03 0:01 ` dan.j.williams
2026-02-03 15:15 ` Li Ming
2026-02-03 22:37 ` dan.j.williams
2026-02-01 9:30 ` [PATCH 2/2] cxl/core: Hold grandparent port lock while dport adding Li Ming
2026-02-02 15:39 ` Jonathan Cameron
2026-02-03 14:23 ` Li Ming
2026-02-03 21:14 ` dan.j.williams [this message]
2026-02-02 16:31 ` Gregory Price
2026-02-03 14:33 ` Li Ming
2026-02-03 0:07 ` dan.j.williams
2026-02-03 15:21 ` Li Ming
2026-02-03 22:25 ` dan.j.williams
2026-02-04 13:51 ` Li Ming
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=6982653bdfcbc_68d310065@dwillia2-mobl4.notmuch \
--to=dan.j.williams@intel.com \
--cc=alison.schofield@intel.com \
--cc=dave.jiang@intel.com \
--cc=dave@stgolabs.net \
--cc=ira.weiny@intel.com \
--cc=jonathan.cameron@huawei.com \
--cc=linux-cxl@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ming.li@zohomail.com \
--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