From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Rob Herring <robh@kernel.org>
Cc: Krzysztof Kozlowski <krzk@kernel.org>,
Bryan O'Donoghue <bryan.odonoghue@linaro.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Dave Stevenson <dave.stevenson@raspberrypi.com>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Shawn Guo <shawnguo@kernel.org>,
Sascha Hauer <s.hauer@pengutronix.de>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Fabio Estevam <festevam@gmail.com>,
Martin Kepplinger <martink@posteo.de>,
Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
"Paul J. Murphy" <paul.j.murphy@intel.com>,
Daniele Alessandrelli <daniele.alessandrelli@intel.com>,
Tommaso Merciai <tomm.merciai@gmail.com>,
Martin Hecht <martin.hecht@avnet.eu>,
Zhi Mao <zhi.mao@mediatek.com>,
Alain Volmat <alain.volmat@foss.st.com>,
Mikhail Rudenko <mike.rudenko@gmail.com>,
Ricardo Ribalda <ribalda@kernel.org>,
Kieran Bingham <kieran.bingham@ideasonboard.com>,
Umang Jain <umang.jain@ideasonboard.com>,
Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>,
Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>,
Dongchun Zhu <dongchun.zhu@mediatek.com>,
Quentin Schulz <quentin.schulz@theobroma-systems.com>,
Todor Tomov <todor.too@gmail.com>,
linux-media@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, imx@lists.linux.dev,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 2/2] media: dt-bindings: Use additionalProperties: false for endpoint: properties:
Date: Wed, 16 Oct 2024 12:31:20 +0300 [thread overview]
Message-ID: <20241016093120.GF2712@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20241015194418.GA1244454-robh@kernel.org>
Hi Rob,
On Tue, Oct 15, 2024 at 02:44:18PM -0500, Rob Herring wrote:
> On Tue, Oct 15, 2024 at 02:28:06PM +0300, Laurent Pinchart wrote:
> > On Tue, Oct 15, 2024 at 08:11:18AM +0200, Krzysztof Kozlowski wrote:
> > > On 14/10/2024 22:29, Laurent Pinchart wrote:
> > > > On Mon, Oct 14, 2024 at 10:47:31AM +0200, Krzysztof Kozlowski wrote:
> > > >> On 14/10/2024 10:31, Bryan O'Donoghue wrote:
> > > >>> On 14/10/2024 08:45, Krzysztof Kozlowski wrote:
> > > >>>> I do not understand the reasoning behind this change at all. I don't
> > > >>>> think DT maintainers ever suggested it (in fact, rather opposite:
> > > >>>> suggested using unevaluatedProps) and I think is not a consensus of any
> > > >>>> talks.
> > > >>>
> > > >>> No there is not but then, how do you give consistent feedback except
> > > >>> proposing something to be a baseline.
> > > >>>
> > > >>> On the one hand you have upstream additionalProperties: false and
> > > >>> unevaluatedProperites: false - it'd be better to have a consistent
> > > >>> message on which is to be used.
>
> There are 3 options:
>
> - no $ref => additionalProperties
> - has a $ref:
> - additionalProperties and list ref-ed properties
> - unevaluatedProperties and don't list ref-ed properties
>
> I do debate (with myself)
Those are the best and worst debates at the same time :-)
> that that is too complicated as many don't
> understand the difference. We could go back to always using
> additionalProperties which is what we had before unevaluatedProperties
> was added. The other option is always use unevaluatedProperties. 2
> things have stopped me from going that route. I don't care to fix
> 'additionalProperties' treewide which would be necessary to implement a
> meta-schema or check that unevaluatedProperties is used. It's not
> something I want to manually check in reviews. The other reason is just
> to not change what the rules are again.
>
> > > >>
> > > >> Well, I am afraid that push towards additionalProps will lead to grow
> > > >> common schema (video-interface-devices or video-interfaces) into huge
> > > >> one-fit-all binding. And that's not good.
> > > >>
> > > >> If a common binding for a group of devices encourages you to list its
> > > >> subset, then it is not that common.
> > > >>
> > > >> Solution is to fix that, e.g. split it per classes of devices.
> > > >
> > > > I think splitting large schemas per class is a good idea, but the
> > > > problem will still exist. For instance, if we were to move the
> > > > CSI-2-specific properties to a separate schema, that schema would define
> > > > clock-lanes, data-lanes and clock-noncontinuous. The clock-lanes and
> > > > clock-noncontinuous properties do not apply to every device, how would
> > > > we then handle that ? I see three options:
> > >
> > > Why is this a problem? Why is this a problem here, but not in other
> > > subsystems having exactly the same case?
> >
> > I won't talk for other subsystems, but I can say I see value in
> > explicitly expressing what properties are valid for a device in DT
> > bindings both to inform DT authors and to perform validation on DT
> > sources. That's the whole point of YAML schemas, and I can't see a good
> > reason not to use the tooling we have developed when it has an easy way
> > to do the job.
>
> This topic is just one piece of validation. A property being used that's
> defined, but meaningless for a device is low on the list of what I care
> about validating. I can't see how it would cause an actual problem? A
> driver is going to read the property and do what with it? Could it be an
> ABI issue ever? I can't see how other than a driver failing for some
> reason if it finds the property, but that seems a bit far fetched.
I agree the risk of issues at runtime is quite low. My personal take on
this is that the additional complexity of specifying "$prop: true" in
the bindings is low (for me at least), and the increased correctness in
DT sources to avoid confusion for DT readers is worth it. I also like
how more explicit bindings cleary show in a single place what properties
are expected, making it easier for DT authors. That's a personal opinion
though.
--
Regards,
Laurent Pinchart
prev parent reply other threads:[~2024-10-16 9:31 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-12 15:02 [PATCH 0/2] media: i2c: Cleanup assigned-clocks and endpoint: properties: unevaluatedProperties: false Bryan O'Donoghue
2024-10-12 15:02 ` [PATCH 1/2] media: dt-bindings: Remove assigned-clock-* from various schema Bryan O'Donoghue
2024-10-12 17:24 ` Laurent Pinchart
2024-10-14 7:43 ` Krzysztof Kozlowski
2024-10-14 8:29 ` Bryan O'Donoghue
2024-10-14 8:44 ` Krzysztof Kozlowski
2024-10-14 10:08 ` Bryan O'Donoghue
2024-10-14 10:20 ` Sakari Ailus
2024-10-14 10:34 ` Krzysztof Kozlowski
2024-10-14 10:46 ` Sakari Ailus
2024-10-14 20:34 ` Laurent Pinchart
2024-10-15 6:13 ` Krzysztof Kozlowski
2024-10-15 11:29 ` Laurent Pinchart
2024-10-15 16:46 ` Rob Herring
2024-10-16 7:47 ` Krzysztof Kozlowski
2024-10-12 15:02 ` [PATCH 2/2] media: dt-bindings: Use additionalProperties: false for endpoint: properties: Bryan O'Donoghue
2024-10-12 18:09 ` Laurent Pinchart
2024-10-13 10:44 ` Bryan O'Donoghue
2024-10-14 7:45 ` Krzysztof Kozlowski
2024-10-14 8:31 ` Bryan O'Donoghue
2024-10-14 8:47 ` Krzysztof Kozlowski
2024-10-14 9:03 ` Bryan O'Donoghue
2024-10-14 10:37 ` Krzysztof Kozlowski
2024-10-14 20:29 ` Laurent Pinchart
2024-10-15 6:11 ` Krzysztof Kozlowski
2024-10-15 11:28 ` Laurent Pinchart
2024-10-15 11:51 ` Krzysztof Kozlowski
2024-10-16 9:27 ` Laurent Pinchart
2024-10-15 19:44 ` Rob Herring
2024-10-15 22:45 ` Bryan O'Donoghue
2024-10-16 9:31 ` Laurent Pinchart [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=20241016093120.GF2712@pendragon.ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=alain.volmat@foss.st.com \
--cc=bryan.odonoghue@linaro.org \
--cc=conor+dt@kernel.org \
--cc=daniele.alessandrelli@intel.com \
--cc=dave.stevenson@raspberrypi.com \
--cc=devicetree@vger.kernel.org \
--cc=dongchun.zhu@mediatek.com \
--cc=festevam@gmail.com \
--cc=imx@lists.linux.dev \
--cc=kernel@pengutronix.de \
--cc=kieran.bingham@ideasonboard.com \
--cc=krzk+dt@kernel.org \
--cc=krzk@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=manivannan.sadhasivam@linaro.org \
--cc=martin.hecht@avnet.eu \
--cc=martink@posteo.de \
--cc=mchehab@kernel.org \
--cc=mike.rudenko@gmail.com \
--cc=paul.j.murphy@intel.com \
--cc=paul.kocialkowski@bootlin.com \
--cc=quentin.schulz@theobroma-systems.com \
--cc=ribalda@kernel.org \
--cc=robh@kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=sakari.ailus@linux.intel.com \
--cc=shawnguo@kernel.org \
--cc=todor.too@gmail.com \
--cc=tomm.merciai@gmail.com \
--cc=umang.jain@ideasonboard.com \
--cc=vladimir.zapolskiy@linaro.org \
--cc=zhi.mao@mediatek.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