From: Rob Herring <robh@kernel.org>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
<devicetree@vger.kernel.org>,
Linux-Renesas <linux-renesas-soc@vger.kernel.org>
Subject: Re: dt-validate crash on <foo>-gpio
Date: Tue, 12 Dec 2023 17:18:50 -0600 [thread overview]
Message-ID: <20231212231850.GA3076602-robh@kernel.org> (raw)
In-Reply-To: <CAMuHMdUqbbjRpkStD7JGQ0r9hfR-sgx23FKGDASofX87AzaEcA@mail.gmail.com>
On Mon, Dec 11, 2023 at 01:59:43PM +0100, Geert Uytterhoeven wrote:
> Hi Rob,
>
> When running "make dtbs_check" on a DTB in the Renesas BSP, I ran into
> the following backtrace:
>
> Traceback (most recent call last):
> File "dt-validate", line 8, in <module>
> sys.exit(main())
> File "dt-schema/dtschema/dtb_validate.py", line 144, in main
> sg.check_dtb(filename)
> File "dt-schema/dtschema/dtb_validate.py", line 87, in check_dtb
> dt = self.validator.decode_dtb(f.read())
> File "dt-schema/dtschema/validator.py", line 491, in decode_dtb
> return [dtschema.dtb.fdt_unflatten(self, dtb)]
> File "dt-schema/dtschema/dtb.py", line 483, in fdt_unflatten
> fixup_gpios(dt)
> File "dt-schema/dtschema/dtb.py", line 373, in fixup_gpios
> fixup_gpios(v)
> File "dt-schema/dtschema/dtb.py", line 373, in fixup_gpios
> fixup_gpios(v)
> File "dt-schema/dtschema/dtb.py", line 373, in fixup_gpios
> fixup_gpios(v)
> File "dt-schema/dtschema/dtb.py", line 378, in fixup_gpios
> val = v[0]
> TypeError: 'bool' object is not subscriptable
>
> Turns out the issue is triggered by the presence of a (non-documented)
> boolean "no-use-gpio" property.
>
> Apparently anything that matches "*-gpio" is treated as having a list of
> GPIO specifiers, causing a crash if that does not turn out to be true...
> While the introduction of a "no-use-gpio" boolean property might not
> survive public review, it would be good if the tooling wouldn't crash
> on it.
Seems like good discouragement on using unreviewed properties. ;) I'll
make a fix.
In the future, use anything but devicetree@vger for this kind of issue.
GH issue, devicetree-spec@vger, IRC are easier for me to see.
Rob
prev parent reply other threads:[~2023-12-12 23:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-11 12:59 dt-validate crash on <foo>-gpio Geert Uytterhoeven
2023-12-12 23:18 ` Rob Herring [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=20231212231850.GA3076602-robh@kernel.org \
--to=robh@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=geert@linux-m68k.org \
--cc=linux-renesas-soc@vger.kernel.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