From: Rob Herring <robh@kernel.org>
To: Michael Walle <michael@walle.cc>
Cc: "Rafał Miłecki" <zajec5@gmail.com>,
devicetree@vger.kernel.org, hayashi.kunihiko@socionext.com,
krzysztof.kozlowski+dt@linaro.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org,
matthias.bgg@gmail.com, mhiramat@kernel.org, rafal@milecki.pl,
srinivas.kandagatla@linaro.org
Subject: Re: [PATCH 3/4] nvmem: mtk-efuse: replace driver with a generic MMIO one
Date: Wed, 1 Feb 2023 12:54:02 -0600 [thread overview]
Message-ID: <20230201185402.GA4084724-robh@kernel.org> (raw)
In-Reply-To: <017a17eb99ac2b2c858d27b65c5dd372@walle.cc>
On Wed, Feb 01, 2023 at 11:46:01AM +0100, Michael Walle wrote:
> > Before I convert brcm,nvram to NVMEM layout I need some binding & driver
> > providing MMIO device access. How to handle that?
>
> I'm not arguing against having the mmio nvmem driver. But I don't
> think we should sacrifice possible write access with other drivers. And
> I presume write access won't be possible with your generic driver as it
> probably isn't just a memcpy_toio().
>
> It is a great fallback for some nvmem peripherals which just maps a
> memory region, but doesn't replace a proper driver for an nvmem device.
>
> What bothers me the most isn't the driver change. The driver can be
> resurrected once someone will do proper write access, but the generic
> "mediatek,efuse" compatible together with the comment above the older
> compatible string. These imply that you should use "mediatek,efuse",
> but we don't know if all mediatek efuse peripherals will be the
> same - esp. for writing which is usually more complex than the reading.
Because the kernel can't pick the "best" driver when there are multiple
matches, it's all Mediatek platforms use the generic driver or all use
the Mediatek driver.
Personally, I think it is easy enough to revive the driver if needed
unless writing is a soon and likely feature.
The other way to share is providing library functions for drivers to
use. Then the Mediatek driver can use the generic read functions and
custom write functions.
> nitpick btw: why not "nvmem-mmio"?
>
> So it's either:
> (1) compatible = "mediatek,mt8173-efuse"
> (2) compatible = "mediatek,mt8173-efuse", "mmio-nvmem"
>
> (1) will be supported any anyway for older dts and you need to add
> the specific compatibles to the nvmem-mmio driver - or keep the
> driver as is.
>
> With (2) you wouldn't need to do that and the kernel can load the
> proper driver if available or fall back to the nvmem-mmio one. I'd
> even make that one "default y" so it will be available on future
> kernels and boards can already make use of the nvmem device even
> if there is no proper driver for them.
>
> I'd prefer (2). Dunno what the dt maintainers agree.
No because you are changing the DT. The DT can't change when you want to
change drivers. This thinking is one reason why 'generic' bindings are
rejected.
Rob
next prev parent reply other threads:[~2023-02-01 18:54 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-01 6:47 [PATCH 0/4] nvmem: add and use generic MMIO NVMEM Rafał Miłecki
2023-02-01 6:47 ` [PATCH 1/4] dt-bindings: nvmem: mmio: new binding for MMIO accessible NVMEM devices Rafał Miłecki
2023-02-03 21:06 ` Rob Herring
2023-02-01 6:47 ` [PATCH 2/4] nvmem: add generic driver for devices with MMIO access Rafał Miłecki
2023-02-01 9:41 ` Kunihiko Hayashi
2023-02-01 11:52 ` Srinivas Kandagatla
2023-02-02 9:24 ` AngeloGioacchino Del Regno
2023-02-01 6:47 ` [PATCH 3/4] nvmem: mtk-efuse: replace driver with a generic MMIO one Rafał Miłecki
2023-02-01 8:48 ` Michael Walle
2023-02-01 9:30 ` Rafał Miłecki
2023-02-01 10:46 ` Michael Walle
2023-02-01 11:01 ` Rafał Miłecki
2023-02-01 11:11 ` Michael Walle
2023-02-01 18:54 ` Rob Herring [this message]
2023-02-01 20:15 ` Michael Walle
2023-02-02 23:44 ` Rob Herring
2023-02-01 6:47 ` [PATCH 4/4] nvmem: uniphier-efuse: " Rafał Miłecki
2023-02-01 7:50 ` [PATCH 0/4] nvmem: add and use generic MMIO NVMEM Rafał Miłecki
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=20230201185402.GA4084724-robh@kernel.org \
--to=robh@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=hayashi.kunihiko@socionext.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=mhiramat@kernel.org \
--cc=michael@walle.cc \
--cc=rafal@milecki.pl \
--cc=srinivas.kandagatla@linaro.org \
--cc=zajec5@gmail.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;
as well as URLs for NNTP newsgroup(s).