Linux CXL
 help / color / mirror / Atom feed
From: Alison Schofield <alison.schofield@intel.com>
To: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Dan Williams <dan.j.williams@intel.com>,
	Ira Weiny <ira.weiny@intel.com>,
	Vishal Verma <vishal.l.verma@intel.com>,
	Dave Jiang <dave.jiang@intel.com>,
	Ben Widawsky <bwidawsk@kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ingo Molnar <mingo@redhat.com>,
	linux-cxl@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 4/4] cxl/region: Add trigger_poison_list sysfs attribute
Date: Mon, 17 Oct 2022 11:01:53 -0700	[thread overview]
Message-ID: <Y02YkXawtM4IK7wL@aschofie-mobl2> (raw)
In-Reply-To: <20221017144302.0000521c@huawei.com>

On Mon, Oct 17, 2022 at 02:43:02PM +0100, Jonathan Cameron wrote:
> On Wed, 12 Oct 2022 14:28:20 -0700
> alison.schofield@intel.com wrote:
> 
> > From: Alison Schofield <alison.schofield@intel.com>
> > 
> > When a boolean 'true' is written to this attribute the region driver
> > retrieves the poison list for the capacity each device contributes
> > to this region. The list includes addresses that are poisoned, or
> > would result in poison if accessed, and the source of the poison.
> > The retrieved errors are logged as kernel trace events with the
> > label 'cxl_poison'.
> > 
> > Devices not supporting the poison list capability are ignored.
> > 
> > Signed-off-by: Alison Schofield <alison.schofield@intel.com>
> 
> Hi Alison,
> 
> For some reason I don't have cxl_dpa_resource().
> Should that be cxl_dpa_resource_start()?

Yes.
> 
> Looks like it got renamed in
> cxl/hdm: Add support for allocating DPA to an endpoint decoder
> cf880423b6a0599499c1f83542cab0b75daa29ba

Looks like it got renamed during the patches review. Not worth
unravelling now. I will rebase in next version.

Sorry about that and thanks!
Alison

> 
> Jonathan
> 
> > +static ssize_t trigger_poison_list_store(struct device *dev,
> > +					 struct device_attribute *attr,
> > +					 const char *buf, size_t len)
> > +{
> > +	struct cxl_region *cxlr = to_cxl_region(dev);
> > +	struct cxl_region_params *p = &cxlr->params;
> > +	struct cxl_endpoint_decoder *cxled;
> > +	struct cxl_memdev *cxlmd;
> > +	u64 offset, length;
> > +	int rc, i;
> > +	bool tmp;
> > +
> > +	if (kstrtobool(buf, &tmp))
> > +		return -EINVAL;
> > +
> > +	for (i = 0; i <  p->nr_targets; i++) {
> > +		cxled = p->targets[i];
> > +		cxlmd = cxled_to_memdev(cxled);
> > +		if (!test_bit(CXL_MEM_COMMAND_ID_GET_POISON,
> > +			      cxlmd->cxlds->enabled_cmds))
> > +			continue;
> > +		offset = cxl_dpa_resource(cxled);
> > +		length = cxl_dpa_size(cxled);
> > +		rc = cxl_mem_get_poison(cxlmd, offset, length,
> > +					dev_name(&cxlr->dev));
> > +		if (rc)
> > +			return rc;
> > +	}
> > +	return len;
> > +}
> > +static DEVICE_ATTR_WO(trigger_poison_list);

      reply	other threads:[~2022-10-17 18:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-12 21:28 [PATCH v2 0/4] CXL Poison List Retrieval & Tracing alison.schofield
2022-10-12 21:28 ` [PATCH v2 1/4] trace, cxl: Introduce a TRACE_EVENT for CXL poison records alison.schofield
2022-10-12 21:46   ` Steven Rostedt
2022-10-14  4:39     ` Alison Schofield
2022-10-12 21:28 ` [PATCH v2 2/4] cxl/mbox: Add GET_POISON_LIST mailbox command alison.schofield
2022-10-12 21:28 ` [PATCH v2 3/4] cxl/memdev: Add trigger_poison_list sysfs attribute alison.schofield
2022-10-12 21:28 ` [PATCH v2 4/4] cxl/region: " alison.schofield
2022-10-17 13:43   ` Jonathan Cameron
2022-10-17 18:01     ` Alison Schofield [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=Y02YkXawtM4IK7wL@aschofie-mobl2 \
    --to=alison.schofield@intel.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=bwidawsk@kernel.org \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=ira.weiny@intel.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.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