[PATCH 2/2] mtd: spi-nor: add initial sysfs support

Michael Walle michael at walle.cc
Tue Apr 6 09:47:29 BST 2021


Hi,

Am 2021-04-06 09:56, schrieb Vignesh Raghavendra:
> Hi,
> 
> On 3/18/21 2:54 PM, Michael Walle wrote:
>> Add support to show the name and JEDEC identifier as well as to dump 
>> the
>> SFDP table. Not all flashes list their SFDP table contents in their
>> datasheet. So having that is useful. It might also be helpful in bug
>> reports from users.
>> 
> 
> Sorry for the delay..
> 
> There is already debugfs support for dumping JEDEC ID [1]. Any reason 
> to
> add sysfs entry as well?

This is per mtd while the sfdp is per flash device. IMHO both should
be at the same place.

> That brings up another question. Since SFDP dumps are more of a debug
> aid, should this be a debugfs entry rather than sysfs entry?

And you're not the first one asking that. My argument was that the
debugfs might not be available just when you need it. A developer
could easily rebuild a kernel, but imagine some user with a COTS
distro and some problems, then it is not that easy anymore. But
thats your call to make.

> Note that sysfs entries are userspace ABIs just like syscalls and thus
> need to be documented in Documentation/ABI/testing/ or
> Documentation/ABI/stable. Thus need to be carefully designed compared 
> to
> debugfs which are much more flexible.

Ok. But I don't see a problem adding these read-only files
  /sfdp
  /name
  /jedec-id

Do you?

-michael



More information about the linux-mtd mailing list