NVDIMM Device and Persistent Memory development
 help / color / mirror / Atom feed
From: Dave Jiang <dave.jiang@intel.com>
To: Alison Schofield <alison.schofield@intel.com>
Cc: <vishal.l.verma@intel.com>, <linux-cxl@vger.kernel.org>,
	<nvdimm@lists.linux.dev>
Subject: Re: [NDCTL PATCH 2/2] cxl: Add check for regions before disabling memdev
Date: Tue, 28 Nov 2023 13:23:29 -0700	[thread overview]
Message-ID: <4d3e52cf-11d4-4764-8b1f-9c0937423410@intel.com> (raw)
In-Reply-To: <ZWYyDDOYyqxTf7k+@aschofie-mobl2>



On 11/28/23 11:31, Alison Schofield wrote:
> On Wed, Oct 04, 2023 at 03:08:30PM -0700, Dave Jiang wrote:
>> Add a check for memdev disable to see if there are active regions present
>> before disabling the device. This is necessary now regions are present to
>> fulfill the TODO that was left there. The best way to determine if a
>> region is active is to see if there are decoders enabled for the mem
>> device. This is also best effort as the state is only a snapshot the
>> kernel provides and is not atomic WRT the memdev disable operation. The
>> expectation is the admin issuing the command has full control of the mem
>> device and there are no other agents also attempt to control the device.
>>
> 
> snip
> 
>> +
>> +	if (cxl_port_decoders_committed(port) && !param.force) {
>>  		log_err(&ml, "%s is part of an active region\n",
>>  			cxl_memdev_get_devname(memdev));
>>  		return -EBUSY;
> 
> Can you emit the message either way, that is, even if it is forced,
> let the user know what they just trampled on.

Ok I'll change that.

> 
> How easy is it to add the region names in the message?

I don't think we can get to a region easily. The way we currently check is to see if there are active decoders and not region existence.  

> 
>>
>>
>>

      reply	other threads:[~2023-11-28 20:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-04 22:08 [NDCTL PATCH 1/2] cxl: Save the number of decoders committed to a port Dave Jiang
2023-10-04 22:08 ` [NDCTL PATCH 2/2] cxl: Add check for regions before disabling memdev Dave Jiang
2023-11-28  6:35   ` Cao, Quanquan/曹 全全
2023-11-28 18:13     ` Verma, Vishal L
2023-11-28 18:31   ` Alison Schofield
2023-11-28 20:23     ` Dave Jiang [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=4d3e52cf-11d4-4764-8b1f-9c0937423410@intel.com \
    --to=dave.jiang@intel.com \
    --cc=alison.schofield@intel.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=nvdimm@lists.linux.dev \
    --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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).