From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J . Wysocki" <rafael@kernel.org>,
linux-kernel@vger.kernel.org,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
Luka Perkov <luka.perkov@sartura.hr>,
Robert Marko <robert.marko@sartura.hr>
Subject: Re: [PATCH v4 4/4] nvmem: core: Expose cells through sysfs
Date: Thu, 13 Jul 2023 09:42:57 +0200 [thread overview]
Message-ID: <20230713094257.44c2d5cd@xps-13> (raw)
In-Reply-To: <838e1e9a-a679-5b2f-d190-cdd10016a7bf@linaro.org>
Hi Srinivas,
srinivas.kandagatla@linaro.org wrote on Wed, 12 Jul 2023 18:20:01 +0100:
> Hi Miquel,
>
> On 14/06/2023 07:30, Miquel Raynal wrote:
> > The binary content of nvmem devices is available to the user so in the
> > easiest cases, finding the content of a cell is rather easy as it is
> > just a matter of looking at a known and fixed offset. However, nvmem
> > layouts have been recently introduced to cope with more advanced
> > situations, where the offset and size of the cells is not known in
> > advance or is dynamic. When using layouts, more advanced parsers are
> > used by the kernel in order to give direct access to the content of each
> > cell, regardless of its position/size in the underlying
> > device. Unfortunately, these information are not accessible by users,
> > unless by fully re-implementing the parser logic in userland.
> >
> > Let's expose the cells and their content through sysfs to avoid these
> > situations. Of course the relevant NVMEM sysfs Kconfig option must be
> > enabled for this support to be available.
> >
> > Not all nvmem devices expose cells. Indeed, the .bin_attrs attribute
> > group member will be filled at runtime only when relevant and will
> > remain empty otherwise. In this case, as the cells attribute group will
> > be empty, it will not lead to any additional folder/file creation.
> >
> > Exposed cells are read-only. There is, in practice, everything in the
> > core to support a write path, but as I don't see any need for that, I
> > prefer to keep the interface simple (and probably safer). The interface
> > is documented as being in the "testing" state which means we can later
> > add a write attribute if though relevant.
> >
> > There is one limitation though: if a layout is built as a module but is
> > not properly installed in the system and loaded manually with insmod
> > while the nvmem device driver was built-in, the cells won't appear in
> > sysfs. But if done like that, the cells won't be usable by the built-in
> > kernel drivers anyway.
> >
> > Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
>
> Unable to apply this, Can you re-base this on rc1?
Yes of course, here it is. I figured out yesterday evening that this
would no longer apply, I did the rebase locally but did not finish
testing. v5 is now in your inbox.
I also split this patch so I now:
- gather all the cells creation together before adding the nvmem device
- then we create the sysfs cells
Cheers,
Miquèl
next prev parent reply other threads:[~2023-07-13 7:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-14 6:30 [PATCH v4 0/4] NVMEM cells in sysfs Miquel Raynal
2023-06-14 6:30 ` [PATCH v4 1/4] sysfs: Improve readability by following the kernel coding style Miquel Raynal
2023-06-14 6:30 ` [PATCH v4 2/4] sysfs: Skip empty folders creation Miquel Raynal
2023-06-14 6:30 ` [PATCH v4 3/4] ABI: sysfs-nvmem-cells: Expose cells through sysfs Miquel Raynal
2023-06-14 6:30 ` [PATCH v4 4/4] nvmem: core: " Miquel Raynal
2023-07-12 17:20 ` Srinivas Kandagatla
2023-07-13 7:42 ` Miquel Raynal [this message]
2023-06-15 11:26 ` [PATCH v4 0/4] NVMEM cells in sysfs Greg Kroah-Hartman
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=20230713094257.44c2d5cd@xps-13 \
--to=miquel.raynal@bootlin.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luka.perkov@sartura.hr \
--cc=rafael@kernel.org \
--cc=robert.marko@sartura.hr \
--cc=srinivas.kandagatla@linaro.org \
--cc=thomas.petazzoni@bootlin.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