From: David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
To: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Devicetree Compiler
<devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH v3 4/5] dtc: Drop dts source restriction for yaml output
Date: Wed, 13 Oct 2021 14:12:12 +1100 [thread overview]
Message-ID: <YWZOjOzqhtakSw56@yekko> (raw)
In-Reply-To: <CAL_Jsq+sMrRWqqPgcvoaiY0rLSp_s+gXOqJ9OuFLQ-3piUHSVA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 2964 bytes --]
On Mon, Oct 11, 2021 at 08:22:54AM -0500, Rob Herring wrote:
> On Mon, Oct 11, 2021 at 2:19 AM David Gibson
> <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org> wrote:
> >
> > On Tue, Jul 27, 2021 at 12:30:22PM -0600, Rob Herring wrote:
> > > YAML output was restricted to dts input as there are some dependencies
> > > on source annotations which get lost with other input formats. With the
> > > addition of markers by the checks, YAML output from dtb format becomes
> > > more useful.
> > >
> > > Signed-off-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> >
> > Urgh. There's not really anything wrong with this patch of itself,
> > but it really underlines my feeling that the whole yaml output thing
> > is a bunch of hacks in pursuit of a bogus goal.
>
> Validating DTs is a bogus goal?
Goal probably wasn't the right word. Validating DTs is fine. The
bogosity comes from doing the conversion to YAML essentially without
reference to the bindings / schemas. Bindings describe how to
interpret the DT's bytestrings into meaninful numbers or whatever, so
using the bindings is the only reliable way of converting those
bytestrings into some more semantically useful representation.
> > Yaml output wants to include information that simply isn't present in
> > the flattened tree format (without considering bindings), so it relies
> > on formatting conventions in the dts, hence this test in the first
> > place. This alleges it removes a restriction, but it only works if a
> > bunch of extra heuristics are able to guess the types correctly.
>
> The goal here is to validate dtb files which I'd think you'd be in
> favor of given your above opinions. For that to work, we have to
> transform the data into the right types somewhere.
Yes - and that should be done with reference to specific bindings, not
using fragile heuristics.
> We don't need any
> heuristics for that. For the most part, it is done using the
> definitive type information from the schemas themselves to format the
> data.
Exactly. That type information should come *from the schemas*. Not
from separately maintained and fragile approximations to parts of the
schemas embedded into dtc.
> The exception is #*-cells patterns which need to parse the tree
> to construct the type information. Given dtc already has all that
> knowledge in checks, it's easier to do it there rather than
> reimplement the same parsing in python.
dtc only has parts of that knowledge in checks. The checks have been
written with the assumption that in ambiguous cases we can just punt
and not run the check. For the goal of truly parsing everything, the
current design of the checks subsystem really isn't adequate.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2021-10-13 3:12 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-27 18:30 [PATCH v3 0/5] Improve output type formatting Rob Herring
[not found] ` <20210727183023.3212077-1-robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2021-07-27 18:30 ` [PATCH v3 1/5] Move marker functions to dtc.h Rob Herring
[not found] ` <20210727183023.3212077-2-robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2021-08-26 4:00 ` David Gibson
2021-09-27 20:56 ` Rob Herring
[not found] ` <CAL_Jsq+QAnyu=Fj_RtRu-dS4Ta0bZJWFUABsK1uKbnAKpXi1mA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-10-11 5:29 ` David Gibson
2021-07-27 18:30 ` [PATCH v3 2/5] Add has_type_markers() helper Rob Herring
2021-07-27 18:30 ` [PATCH v3 3/5] checks: Add markers on known properties Rob Herring
[not found] ` <20210727183023.3212077-4-robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2021-10-11 5:09 ` David Gibson
2021-10-11 13:57 ` Rob Herring
2021-07-27 18:30 ` [PATCH v3 4/5] dtc: Drop dts source restriction for yaml output Rob Herring
[not found] ` <20210727183023.3212077-5-robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2021-10-11 5:15 ` David Gibson
2021-10-11 13:22 ` Rob Herring
[not found] ` <CAL_Jsq+sMrRWqqPgcvoaiY0rLSp_s+gXOqJ9OuFLQ-3piUHSVA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-10-13 3:12 ` David Gibson [this message]
2021-10-14 1:29 ` Rob Herring
[not found] ` <CAL_Jsq+iv7eM+LZ1O8d3V18dHraEAyfgdT8ucFKKVXZc9jEp4g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-11-03 4:42 ` David Gibson
2021-11-03 15:59 ` Rob Herring
[not found] ` <CAL_JsqLNyfe8Ou4RXeLm0ie1vvJ+z15J6EDgB96dPbCC5qvHVQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-11-03 19:16 ` Rob Herring
[not found] ` <CAL_JsqKeNne0Bf0ahG_h977snsBtsk3hbQOPO-6RiyFSyiOsfA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-11-03 19:56 ` Simon Glass
[not found] ` <CAPnjgZ3BNPW+L4BrhQ9W4nLovSgcchWPfbznYxtf20sv2ntYaA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-11-03 22:42 ` Rob Herring
[not found] ` <CAL_JsqLdKsVO9kzkZcqL160COrpEp6GsR10AyPvmSG3B=grAXg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-11-03 22:48 ` Simon Glass
2021-11-09 4:41 ` David Gibson
2021-07-27 18:30 ` [PATCH v3 5/5] treesource: Maintain phandle label/path on output Rob Herring
[not found] ` <20210727183023.3212077-6-robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2021-10-11 5:21 ` David Gibson
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=YWZOjOzqhtakSw56@yekko \
--to=david-xt8fgy+axnrb3ne2bgzf6laj5h9x9tb+@public.gmane.org \
--cc=devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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