From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: Dave Jiang <dave.jiang@intel.com>
Cc: <linux-cxl@vger.kernel.org>, <dave@stgolabs.net>,
<alison.schofield@intel.com>, <vishal.l.verma@intel.com>,
<ira.weiny@intel.com>, <dan.j.williams@intel.com>
Subject: Re: [PATCH] cxl: Add committed sysfs attribute to CXL decoder
Date: Tue, 26 Sep 2023 12:07:47 +0100 [thread overview]
Message-ID: <20230926120747.0000462f@Huawei.com> (raw)
In-Reply-To: <169566515694.3697523.714600762835841180.stgit@djiang5-mobl3>
On Mon, 25 Sep 2023 11:05:56 -0700
Dave Jiang <dave.jiang@intel.com> 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
Spell check.
> still best effort as it's a snapshot of the state and not atomic for the
> user region disable operation.
>
> Signed-off-by: Dave Jiang <dave.jiang@intel.com>
One passing comment inline.
Seems reasonable to me.
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> ---
> Documentation/ABI/testing/sysfs-bus-cxl | 7 +++++++
> drivers/cxl/core/port.c | 11 +++++++++++
> 2 files changed, 18 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..ab5b9bc26d56 100644
> --- a/drivers/cxl/core/port.c
> +++ b/drivers/cxl/core/port.c
> @@ -277,12 +277,23 @@ 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", !!(cxld->flags & CXL_DECODER_F_ENABLE));
Could use FIELD_GET() though as it's not been used for these
before that I could quickly find, fair enough to maintain
consistent style
> +}
> +
> +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,
> };
>
>
>
prev parent reply other threads:[~2023-09-26 11:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-25 18:05 [PATCH] cxl: Add committed sysfs attribute to CXL decoder Dave Jiang
2023-09-26 11:07 ` Jonathan Cameron [this message]
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=20230926120747.0000462f@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=ira.weiny@intel.com \
--cc=linux-cxl@vger.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