From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Zhuohao Lee <zhuohao@chromium.org>
Cc: "Nicolas Boichat" <drinkcat@chromium.org>,
"Vignesh Raghavendra" <vigneshr@ti.com>,
bbrezillon@kernel.org, richard@nod.at,
"Brian Norris" <briannorris@chromium.org>,
"Marek Vašut" <marek.vasut@gmail.com>,
"Boris Brezillon" <boris.brezillon@collabora.com>,
linux-mtd@lists.infradead.org,
"Brian Norris" <computersforpeace@gmail.com>,
"David Woodhouse" <dwmw2@infradead.org>
Subject: Re: [PATCH v1] mtd: core: add sysfs nodes for querying the flash name and id
Date: Wed, 3 Apr 2019 10:31:01 +0200 [thread overview]
Message-ID: <20190403103101.5c7b7641@xps13> (raw)
In-Reply-To: <CABD5ybnB1JK2_zg0Lsi_1Ny5wGBP9dE4FbP6NCHAPbXpgJqkTg@mail.gmail.com>
Hi Zhuohao,
Zhuohao Lee <zhuohao@chromium.org> wrote on Tue, 2 Apr 2019 21:03:28
+0800:
> Boris, Thanks for your comment.
> But I can't find the related stuff (or i got the wrong way). Is that
> feature merged?
> Could you please point out the commit? I can make the change base on it.
I think Boris just told you that the debugfs MTD directory is suitable
to receive an information coming from different type of devices like
spi-nor, nor, nand, etc.
The feature of having the device name there does not exist yet, you
have to do it. For NAND I already wrote something like that which has
not been merged but could be adapted to export the data in debugfs
instead of sysfs, see:
Raw NAND infrastructure to retrieve the ID:
http://patchwork.ozlabs.org/patch/837901/
Adding a sysfs entry (which was already rejected at this time):
http://patchwork.ozlabs.org/patch/837903/
Thanks,
Miquèl
>
> On Tue, Apr 2, 2019 at 8:01 PM Boris Brezillon
> <boris.brezillon@collabora.com> wrote:
> >
> > On Tue, 2 Apr 2019 19:06:37 +0800
> > Zhuohao Lee <zhuohao@chromium.org> wrote:
> >
> > > On Tue, Apr 2, 2019 at 4:26 PM Vignesh Raghavendra <vigneshr@ti.com> wrote:
> > > >
> > > >
> > > >
> > > > On 02/04/19 1:26 PM, Boris Brezillon wrote:
> > > > > On Tue, 2 Apr 2019 15:39:54 +0800
> > > > > Zhuohao Lee <zhuohao@chromium.org> wrote:
> > > > >
> > > > >> Thanks Boris for the comment. Please take a look the reply at below.
> > > > >>
> > > > >> On Mon, Apr 1, 2019 at 5:27 PM Boris Brezillon
> > > > >> <boris.brezillon@collabora.com> wrote:
> > > > >>>
> > > > >>> On Thu, 28 Mar 2019 12:59:10 +0800
> > > > >>> Zhuohao Lee <zhuohao@chromium.org> wrote:
> > > > >>>
> > > > >>>> Currently, we don't have sysfs nodes for querying the underlying flash
> > > > >>>> name and flash id. This information is important especially when we
> > > > >>>> want to know the flash detail of the defective system. In order to
> > > > >>>> support the query, we add two pointers (*flashname, *id) into the
> > > > >>>> mtd_info structure and create two sysfs nodes (flashname, id). This
> > > > >>>> patch is modified based on the SPI-NOR flash system as we only have
> > > > >>>> that system now. But the idea should be applied to the other flash
> > > > >>>> driver like NAND flash.
> > > > >>>>
> > > > >>>> The output of new sysfs nodes on my device are:
> > > > >>>> cat /sys/devices/platform/soc/11010000.spi/spi_master/spi1/spi1.0/mtd/mtd0/flashname
> > > > >>>> w25q64dw
> > > > >>>> cat /sys/devices/platform/soc/11010000.spi/spi_master/spi1/spi1.0/mtd/mtd0/id
> > > > >>>> ef6017
> > > > >>>
> > > > >>> I'm not sure I like the idea of exposing this kind of info through
> > > > >>> sysfs as it then makes part of the ABI. Did you consider exposing that
> > > > >>> through debugfs?
> > > > >>
> > > > >> Yes, i did consider the debugfs. I think the debugfs is depended on
> > > > >> CONFIG_DEBUG_FS.
> > > > >> If removing that config, the partname and partid will be lost. So, i
> > > > >> proposed to use
> > > > >> sysfs.
> > > > >
> > > > > Then just enable debugfs if you need this information :P.
> > > My original intention is adding the new sysfs nodes (i.e partname and
> > > partid) into the common place like mtdcore.c
> > > so that the userspace program can just read the common sysfs nodes.
> > > So far, what i can contribute is for the spi-nor but if the other
> > > flash drivers, like nand-flash, can also support
> > > the partname and partid query, then, we can have common sysfs nodes to
> > > query the underlying device info.
> > > Compare to the debugfs, i think different drivers may have different
> > > name for the partname and partid.
> >
> > We've recently unified how MTD related stuff are exposed through
> > debugfs and you can now have generic MTD fields exposed there.
>
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
prev parent reply other threads:[~2019-04-03 8:31 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-28 4:59 [PATCH v1] mtd: core: add sysfs nodes for querying the flash name and id Zhuohao Lee
2019-04-01 8:43 ` Zhuohao Lee
2019-04-01 9:27 ` Boris Brezillon
2019-04-02 7:39 ` Zhuohao Lee
2019-04-02 7:56 ` Boris Brezillon
2019-04-02 8:27 ` Vignesh Raghavendra
2019-04-02 11:06 ` Zhuohao Lee
2019-04-02 12:01 ` Boris Brezillon
2019-04-02 13:03 ` Zhuohao Lee
2019-04-03 8:31 ` Miquel Raynal [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=20190403103101.5c7b7641@xps13 \
--to=miquel.raynal@bootlin.com \
--cc=bbrezillon@kernel.org \
--cc=boris.brezillon@collabora.com \
--cc=briannorris@chromium.org \
--cc=computersforpeace@gmail.com \
--cc=drinkcat@chromium.org \
--cc=dwmw2@infradead.org \
--cc=linux-mtd@lists.infradead.org \
--cc=marek.vasut@gmail.com \
--cc=richard@nod.at \
--cc=vigneshr@ti.com \
--cc=zhuohao@chromium.org \
/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