Linux CXL
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: Dave Jiang <dave.jiang@intel.com>, <linux-cxl@vger.kernel.org>
Cc: <dan.j.williams@intel.com>, <vishal.l.verma@intel.com>,
	<ira.weiny@intel.com>, <alison.schofield@intel.com>
Subject: RE: [PATCH 2/2] cxl: export intereleave capability as port sysfs attribute
Date: Tue, 16 Aug 2022 13:51:48 -0700	[thread overview]
Message-ID: <62fc03645e896_f2f512947d@dwillia2-xfh.jf.intel.com.notmuch> (raw)
In-Reply-To: <166067375610.1614719.3464893539111383781.stgit@djiang5-desk4.jf.intel.com>

Dave Jiang wrote:
> Export the interleave capability as a sysfs attribute for a port. The
> exported mask is interpreted from the CXL HDM Decoder Capability Register
> (CXL spec v 8.2.4.19.1). Each bit in the mask represents the number of
> interleave ways the decoder supports. For example, CXL devices designed
> from CXL spec v2.0 supports 1, 2, 4, and 8 interleave ways. The exported
> mask would show 0x116. The exported sysfs attribute will help user region
> creation to do more valid configuration checking.
> 
> Suggested-by: Dan Williams <dan.j.williams@intel.com>
> Signed-off-by: Dave Jiang <dave.jiang@intel.com>
> ---
>  drivers/cxl/port.c |   13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/drivers/cxl/port.c b/drivers/cxl/port.c
> index e3e93e1b663e..231cfe888918 100644
> --- a/drivers/cxl/port.c
> +++ b/drivers/cxl/port.c
> @@ -135,8 +135,21 @@ static ssize_t interleave_mask_show(struct device *dev, struct device_attribute
>  }
>  static DEVICE_ATTR_RO(interleave_mask);
>  
> +static ssize_t interleave_cap_show(struct device *dev, struct device_attribute *attr,
> +				   char *buf)
> +{
> +	struct cxl_hdm *cxlhdm = dev_get_drvdata(dev);
> +
> +	if (!cxlhdm)
> +		return 0;

Similar Documentation + "delete this check" comments as patch1.

      reply	other threads:[~2022-08-16 20:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-11 23:56 [PATCH v2 0/3] Add sanity check for interleave setup Dave Jiang
2022-08-11 23:56 ` [PATCH v2 1/3] cxl: Add check for result of interleave ways plus granularity combo Dave Jiang
2022-08-12  0:59   ` Dan Williams
2022-08-11 23:57 ` [PATCH v2 2/3] cxl: Add CXL spec v3.0 interleave support Dave Jiang
2022-08-12  1:01   ` Dan Williams
2022-08-11 23:57 ` [PATCH v2 3/3] tools/testing/cxl: Add interleave check support to mock cxl port device Dave Jiang
2022-08-12  1:02   ` Dan Williams
2022-08-12  3:22 ` [PATCH v2 0/3] Add sanity check for interleave setup Dan Williams
2022-08-16 18:15   ` [PATCH 1/2] cxl: export interleave address mask as port sysfs attribute Dave Jiang
2022-08-16 20:50     ` Dan Williams
2022-08-16 18:15   ` [PATCH 2/2] cxl: export intereleave capability " Dave Jiang
2022-08-16 20:51     ` Dan Williams [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=62fc03645e896_f2f512947d@dwillia2-xfh.jf.intel.com.notmuch \
    --to=dan.j.williams@intel.com \
    --cc=alison.schofield@intel.com \
    --cc=dave.jiang@intel.com \
    --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