Linux CXL
 help / color / mirror / Atom feed
From: Ira Weiny <ira.weiny@intel.com>
To: Davidlohr Bueso <dave@stgolabs.net>, <dave.jiang@intel.com>,
	<dan.j.williams@intel.com>
Cc: <jonathan.cameron@huawei.com>, <alison.schofield@intel.com>,
	<ira.weiny@intel.com>, <vishal.l.verma@intel.com>,
	<seven.yi.lee@gmail.com>, <a.manzanares@samsung.com>,
	<fan.ni@samsung.com>, <anisa.su@samsung.com>, <dave@stgolabs.net>,
	<linux-cxl@vger.kernel.org>
Subject: Re: [PATCH 3/4] cxl/pmem: Export dirty shutdown count via sysfs
Date: Wed, 19 Feb 2025 15:15:09 -0600	[thread overview]
Message-ID: <67b649dd702c4_2cf2f829436@iweiny-mobl.notmuch> (raw)
In-Reply-To: <20250219062832.237881-4-dave@stgolabs.net>

Davidlohr Bueso wrote:

[snip]

> +static ssize_t dirty_shutdown_show(struct device *dev,
> +				   struct device_attribute *attr, char *buf)
> +{
> +	struct nvdimm *nvdimm = to_nvdimm(dev);
> +	struct cxl_nvdimm *cxl_nvd = nvdimm_provider_data(nvdimm);
> +
> +	return sysfs_emit(buf, "%lld\n", cxl_nvd->dirty_shutdowns);
> +}
> +static DEVICE_ATTR_RO(dirty_shutdown);
> +
>  static struct attribute *cxl_dimm_attributes[] = {
>  	&dev_attr_id.attr,
>  	&dev_attr_provider.attr,
> +	&dev_attr_dirty_shutdown.attr,
>  	NULL
>  };
>  
> +#define CXL_INVALID_DIRTY_SHUTDOWN_COUNT -1

I think this should be defined as ULLONG_MAX.  Just for clarity since
dirty_shutdown is u64.

Ira

> +static umode_t cxl_dimm_visible(struct kobject *kobj,
> +				struct attribute *a, int n)
> +{
> +	if (a == &dev_attr_dirty_shutdown.attr) {
> +		struct device *dev = kobj_to_dev(kobj);
> +		struct nvdimm *nvdimm = to_nvdimm(dev);
> +		struct cxl_nvdimm *cxl_nvd = nvdimm_provider_data(nvdimm);
> +
> +		if (cxl_nvd->dirty_shutdowns ==
> +		    CXL_INVALID_DIRTY_SHUTDOWN_COUNT)
> +			return 0;
> +	}
> +
> +	return a->mode;
> +}
> +

[snip]

  parent reply	other threads:[~2025-02-19 21:32 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-19  6:28 [PATCH v3 0/4] cxl: Dirty shutdown followups Davidlohr Bueso
2025-02-19  6:28 ` [PATCH 1/4] cxl/pci: Introduce cxl_gpf_get_dvsec() Davidlohr Bueso
2025-02-19 16:27   ` Dave Jiang
2025-02-19 22:54     ` Davidlohr Bueso
2025-02-20  0:55   ` Li Ming
2025-02-19  6:28 ` [PATCH 2/4] cxl/pmem: Rename cxl_dirty_shutdown_state() Davidlohr Bueso
2025-02-19 16:34   ` Dave Jiang
2025-02-20  0:56   ` Li Ming
2025-02-19  6:28 ` [PATCH 3/4] cxl/pmem: Export dirty shutdown count via sysfs Davidlohr Bueso
2025-02-19 16:44   ` Dave Jiang
2025-02-19 21:15   ` Ira Weiny [this message]
2025-02-19  6:28 ` [PATCH 4/4] tools/testing/cxl: Set Shutdown State support Davidlohr Bueso
2025-02-19 16:48   ` Dave Jiang
2025-02-20  1:01   ` Li Ming
  -- strict thread matches above, loose matches on Subject: below --
2025-02-20 22:02 [PATCH v5 0/4] cxl: Dirty shutdown followups Davidlohr Bueso
2025-02-20 22:02 ` [PATCH 3/4] cxl/pmem: Export dirty shutdown count via sysfs Davidlohr Bueso
2025-02-20  1:36 [PATCH v4 0/4] cxl: Dirty shutdown followups Davidlohr Bueso
2025-02-20  1:36 ` [PATCH 3/4] cxl/pmem: Export dirty shutdown count via sysfs Davidlohr Bueso
2025-02-20 16:11   ` Ira Weiny
2025-02-20 17:29   ` Jonathan Cameron
2025-02-20 19:28     ` Davidlohr Bueso
2025-02-19  2:14 [PATCH v2 0/4] cxl: Dirty shutdown followups Davidlohr Bueso
2025-02-19  2:14 ` [PATCH 3/4] cxl/pmem: Export dirty shutdown count via sysfs Davidlohr Bueso
2025-02-19  2:34   ` 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=67b649dd702c4_2cf2f829436@iweiny-mobl.notmuch \
    --to=ira.weiny@intel.com \
    --cc=a.manzanares@samsung.com \
    --cc=alison.schofield@intel.com \
    --cc=anisa.su@samsung.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=dave@stgolabs.net \
    --cc=fan.ni@samsung.com \
    --cc=jonathan.cameron@huawei.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=seven.yi.lee@gmail.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