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.
>
>>
>>
>>