From: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
To: Robin Murphy <robin.murphy@arm.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
devicetree@vger.kernel.org,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@linux.ie>,
Bartosz Golaszewski <brgl@bgdev.pl>,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
linux-gpio@vger.kernel.org, Rob Herring <robh+dt@kernel.org>,
Lee Jones <lee.jones@linaro.org>
Subject: Re: [PATCH v10 2/6] dt-bindings: gpio: logicvc: Add a compatible with major version only
Date: Fri, 11 Feb 2022 15:54:42 +0100 [thread overview]
Message-ID: <YgZ4sj1o4WzMPd0P@aptenodytes> (raw)
In-Reply-To: <6f0e58dc-4b81-d819-13e3-9e0f79ba279c@arm.com>
[-- Attachment #1: Type: text/plain, Size: 3315 bytes --]
Hi,
On Wed 02 Feb 22, 14:26, Robin Murphy wrote:
> On 2022-01-30 00:46, Linus Walleij wrote:
> > On Thu, Jan 20, 2022 at 4:00 PM Paul Kocialkowski
> > <paul.kocialkowski@bootlin.com> wrote:
> >
> > > There are lots of different versions of the logicvc block and it
> > > makes little sense to list them all in compatibles since all versions
> > > with the same major are found to be register-compatible.
> >
> > The reason we try to be precise is because sometime, long after the driver
> > has been merged and maintained for a few years, a bug is discovered
> > in a specific version of the silicon.
> >
> > What happens is that a fix is applied on all silicon whether it is needed
> > or not.
> >
> > If you have the precise silicon compatible, you can avoid this and target
> > only a specific version.
>
> Indeed, the better approach would be something like:
>
> compatible:
> oneOf:
> - items:
> - enum:
> - foo,bar-v1.0
> - foo,bar,v1.1
> - const: foo,bar-v1
> - items:
> - enum:
> - foo,bar-v2.0
> - const: foo,bar-v2
>
> That way the DTs are future-proof, while drivers can still match on only the
> less-specific strings until a need arises. Plus it avoids the problem that
> if an existing OS that only understands "foo,bar-v1.0" is given a new DT
> with only "foo,bar-v1" for v1.0 hardware it won't be able to use the device,
> even though it's *functionally* capable of doing so.
Yes I understand that we need to keep compatibility with the already-defined
compatible.
> However, from skimming patch #5, it looks possible that none of these
> changes are needed at all. If LOGICVC_IP_VERSION_REG tells you the exact
> revision, and is always present (as the unconditional reading of it
> implies), then the only reason for adding new compatibles would be if, say,
> v5 has more clocks from v4 and you want the binding to enforce that;
> otherwise, newer versions are literally compatible with the
> currently-defined binding and therefore should continue to bind against the
> existing string(s) to maximise forward- and backward-compatibility. Sure,
> it's not the prettiest thing for a "generic" compatible to be based on an
> oddly-specific version number that doesn't necessarily match the actual
> software-discoverable version, but what's done is done and that's the cost
> of ABI.
Indeed it's true that hardware quirks can be applied based on the precise
version read from the register, so I don't think there is a need for overly
precise compatibles.
Since the device-tree binding is currently the same for all versions,
I understand that it makes sense to keep a single compatible (the already
defined one), so I guess I will make another iteration without introducing
new compatibles. But I will probably update the binding document to reflect
which versions are currently known to work with its current state.
> (also, nitpick for that part of patch #5 since I'm here: please include
> linux/bitfield.h rather than reinventing FIELD_GET() locally)
Ah good to know thanks, first time hearing about those.
Paul
--
Paul Kocialkowski, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2022-02-11 15:02 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-20 15:00 [PATCH v10 0/6] drm: LogiCVC display controller support Paul Kocialkowski
2022-01-20 15:00 ` [PATCH v10 1/6] dt-bindings: mfd: logicvc: Add a compatible with the major version only Paul Kocialkowski
2022-02-02 0:54 ` Rob Herring
2022-01-20 15:00 ` [PATCH v10 2/6] dt-bindings: gpio: logicvc: Add a compatible with " Paul Kocialkowski
2022-01-30 0:46 ` Linus Walleij
2022-02-02 14:26 ` Robin Murphy
2022-02-11 14:54 ` Paul Kocialkowski [this message]
2022-01-20 15:00 ` [PATCH v10 3/6] gpio: logicvc: Support " Paul Kocialkowski
2022-01-30 0:43 ` Linus Walleij
2022-02-03 9:10 ` Paul Kocialkowski
2022-02-08 9:54 ` Bartosz Golaszewski
2022-02-10 23:55 ` Linus Walleij
2022-01-20 15:00 ` [PATCH v10 4/6] dt-bindings: display: Add compatibles with major versions only Paul Kocialkowski
2022-01-30 0:46 ` Linus Walleij
2022-01-20 15:00 ` [PATCH v10 5/6] drm: Add support for the LogiCVC display controller Paul Kocialkowski
2022-01-20 15:00 ` [PATCH v10 6/6] NOTFORMERGE: drm/logicvc: Add plane colorkey support Paul Kocialkowski
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=YgZ4sj1o4WzMPd0P@aptenodytes \
--to=paul.kocialkowski@bootlin.com \
--cc=airlied@linux.ie \
--cc=brgl@bgdev.pl \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=lee.jones@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=robin.murphy@arm.com \
--cc=thomas.petazzoni@bootlin.com \
--cc=tzimmermann@suse.de \
/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).