From: Dan Williams <dan.j.williams@intel.com>
To: Davidlohr Bueso <dave@stgolabs.net>, Dave Jiang <dave.jiang@intel.com>
Cc: <linux-cxl@vger.kernel.org>, <dan.j.williams@intel.com>,
<ira.weiny@intel.com>, <vishal.l.verma@intel.com>,
<alison.schofield@intel.com>, <Jonathan.Cameron@huawei.com>,
<peterz@infradead.org>
Subject: Re: [PATCH v3] cxl: Add cxl_region_rwsem around commit_end write during decoder enumeration
Date: Wed, 22 Nov 2023 13:43:05 -0800 [thread overview]
Message-ID: <655e75e929fc0_b2e829478@dwillia2-xfh.jf.intel.com.notmuch> (raw)
In-Reply-To: <jhsumngltwjkwpa2o2ktxwjujmuzdzrza2m4fyd44ieva3l2ca@trrhklq6evtg>
Davidlohr Bueso wrote:
> On Fri, 17 Nov 2023, Dave Jiang wrote:
>
> >init_hdm_decoder() modifies port->commit_end without taking the
> >cxl_region_rwsem. An assert splat emitted by cxl_num_decoders_committed().
> >However looking at the code, it looks like the write version of the rwsem
> >needs to be taken due to the modification of commit_end. Wrap the write
> >version of the rwsem around reading and writing of commit_end.
> >
> >Fixes: 176baefb2eb5 ("cxl/hdm: Commit decoder state to hardware")
> >Signed-off-by: Dave Jiang <dave.jiang@intel.com>
>
> Uhmm but do we expect concurrency during the switch/port probing phase?
I answered that that detail here in response to Fan:
http://lore.kernel.org/r/654eb8ed72ced_46f0294c@dwillia2-mobl3.amr.corp.intel.com.notmuch
The takeaway is:
"I am in favor of adding the locking rather than depend on a subtle
side-effect of how CXL operates, and to avoid adding an unlocked version
of cxl_num_decoders_committed()"
I will add a note to the changelog to that effect, and drop Fixes: since
the lock is not strictly required for correctness in this path.
next prev parent reply other threads:[~2023-11-22 21:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-17 20:18 [PATCH v3] cxl: Add cxl_region_rwsem around commit_end write during decoder enumeration Dave Jiang
2023-11-20 16:04 ` Davidlohr Bueso
2023-11-20 17:04 ` Dave Jiang
2023-11-22 21:43 ` Dan Williams [this message]
2023-11-23 1:02 ` Dan Williams
2023-11-27 17:09 ` Dave Jiang
2023-11-27 17:39 ` Davidlohr Bueso
2023-11-30 1:01 ` Dan Williams
2023-11-30 16:15 ` Davidlohr Bueso
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=655e75e929fc0_b2e829478@dwillia2-xfh.jf.intel.com.notmuch \
--to=dan.j.williams@intel.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=alison.schofield@intel.com \
--cc=dave.jiang@intel.com \
--cc=dave@stgolabs.net \
--cc=ira.weiny@intel.com \
--cc=linux-cxl@vger.kernel.org \
--cc=peterz@infradead.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