[PATCH 1/1] nvme: fix CMB sysfs file removal in reset path

Max Gurtovoy maxg at mellanox.com
Tue Jul 25 10:13:28 PDT 2017



On 7/25/2017 6:56 PM, Christoph Hellwig wrote:
> On Tue, Jul 25, 2017 at 04:58:36PM +0300, Max Gurtovoy wrote:
>> Currently we create the sysfs entry even if we fail mapping
>> it. In that case, the unmapping will not remove the sysfs created
>> file.
>>
>> Fixes: f63572dff ("nvme: unmap CMB and remove sysfs file in reset path")
>
> This looks correct, but I wonder if the better plan would be to only
> add the sysfs file if we have a working CMB?

Yes I thought about it too, but in case we don't want to "use_cmb_sqes"
and still want to see the device CMB capabilities, using this sysfs we 
could.
Why to do it ? for using this iomem for p2pmem for example.
Since, p2pmem is not yet upstream we can go with working CMB approach.

>
> Also the comment about the auto-removal above the call to
> sysfs_add_file_to_group for dev_attr_cmb looks wrong to me, that
> might be worth fixing up as well.

Sure, I'll update it in V2.




More information about the Linux-nvme mailing list