From: "Verma, Vishal L" <vishal.l.verma@intel.com>
To: "Jiang, Dave" <dave.jiang@intel.com>,
"linux-cxl@vger.kernel.org" <linux-cxl@vger.kernel.org>
Cc: "Williams, Dan J" <dan.j.williams@intel.com>,
"Schofield, Alison" <alison.schofield@intel.com>,
"jonathan.cameron@huawei.com" <jonathan.cameron@huawei.com>,
"dave@stgolabs.net" <dave@stgolabs.net>,
"Weiny, Ira" <ira.weiny@intel.com>
Subject: Re: [PATCH v2] cxl: Add committed sysfs attribute to CXL decoder
Date: Tue, 26 Sep 2023 17:01:20 +0000 [thread overview]
Message-ID: <74d1280689e2860b08ff21f4ebfa92e8f072a687.camel@intel.com> (raw)
In-Reply-To: <169574219129.3884437.11954592650115343944.stgit@djiang5-mobl3>
On Tue, 2023-09-26 at 08:29 -0700, Dave Jiang wrote:
> Expose the committed status of a CXL decoder. The status assists CXL CLI in
> determining as a sure way whether a region is active. Of coruse this is
> still best effort as it's a snapshot of the state and not atomic for the
> user region disable operation.
A minor nit here -
"Sure way to.." immediately followed by " still best effort" feels a
bit contradictory. What about something like:
This attribute allows cxl-cli to determine whether a decoder is
actively participating in a region. This is only a snapshot of the
state, and doesn't offer any protection or serialization against a
concurrent disable-region operation.
>
> Suggested-by: Dan Williams <dan.j.williams@intel.com>
> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Everything else looks good -
Reviewed-by: Vishal Verma <vishal.l.verma@intel.com>
>
> ---
> v2:
> - Use FIELD_GET() (Jonathan)
> ---
> Documentation/ABI/testing/sysfs-bus-cxl | 7 +++++++
> drivers/cxl/core/port.c | 12 ++++++++++++
> 2 files changed, 19 insertions(+)
>
> diff --git a/Documentation/ABI/testing/sysfs-bus-cxl b/Documentation/ABI/testing/sysfs-bus-cxl
> index 087f762ebfd5..ef3fc9fe9d0d 100644
> --- a/Documentation/ABI/testing/sysfs-bus-cxl
> +++ b/Documentation/ABI/testing/sysfs-bus-cxl
> @@ -369,6 +369,13 @@ Description:
> provided it is currently idle / not bound to a driver.
>
>
> +What: /sys/bus/cxl/devices/decoderX.Y/committed
> +Date: Sep, 2023
> +KernelVersion: v6.7
> +Contact: linux-cxl@vger.kernel.org
> +Description:
> + (RO) Indicates whether the decoder is committed.
> +
> What: /sys/bus/cxl/devices/regionZ/uuid
> Date: May, 2022
> KernelVersion: v6.0
> diff --git a/drivers/cxl/core/port.c b/drivers/cxl/core/port.c
> index 724be8448eb4..fc65ef55db0f 100644
> --- a/drivers/cxl/core/port.c
> +++ b/drivers/cxl/core/port.c
> @@ -277,12 +277,24 @@ static ssize_t interleave_ways_show(struct device *dev,
>
> static DEVICE_ATTR_RO(interleave_ways);
>
> +static ssize_t committed_show(struct device *dev,
> + struct device_attribute *attr, char *buf)
> +{
> + struct cxl_decoder *cxld = to_cxl_decoder(dev);
> +
> + return sysfs_emit(buf, "%d\n",
> + FIELD_GET(CXL_DECODER_F_ENABLE, cxld->flags));
> +}
> +
> +static DEVICE_ATTR_RO(committed);
> +
> static struct attribute *cxl_decoder_base_attrs[] = {
> &dev_attr_start.attr,
> &dev_attr_size.attr,
> &dev_attr_locked.attr,
> &dev_attr_interleave_granularity.attr,
> &dev_attr_interleave_ways.attr,
> + &dev_attr_committed.attr,
> NULL,
> };
>
>
>
next prev parent reply other threads:[~2023-09-26 17:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-26 15:29 [PATCH v2] cxl: Add committed sysfs attribute to CXL decoder Dave Jiang
2023-09-26 17:01 ` Verma, Vishal L [this message]
2023-09-26 18:16 ` kernel test robot
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=74d1280689e2860b08ff21f4ebfa92e8f072a687.camel@intel.com \
--to=vishal.l.verma@intel.com \
--cc=alison.schofield@intel.com \
--cc=dan.j.williams@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 \
/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