devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: Devicetree Compiler <devicetree-compiler@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>
Subject: Re: [PATCH v2 1/3] checks: add phandle with arg property checks
Date: Thu, 24 Aug 2017 20:58:14 -0500	[thread overview]
Message-ID: <CAL_JsqJWEKfuaxU_sWDTwCNH3ffkqhcfu8xeLJ4JaPCZAdSZDQ@mail.gmail.com> (raw)
In-Reply-To: <20170825004943.GN5379@umbus.fritz.box>

[-- Attachment #1: Type: text/plain, Size: 1694 bytes --]

On Thu, Aug 24, 2017 at 7:49 PM, David Gibson <david@gibson.dropbear.id.au>
wrote:
> On Thu, Aug 24, 2017 at 12:23:16PM -0500, Rob Herring wrote:
>> On Wed, Aug 23, 2017 at 9:03 PM, David Gibson
>> <david@gibson.dropbear.id.au> wrote:
>> > On Tue, Aug 22, 2017 at 06:02:06PM -0500, Rob Herring wrote:
>> >> Many common bindings follow the same pattern of client properties
>> >> containing a phandle and N arg cells where N is defined in the
provider
>> >> with a '#<specifier>-cells' property such as:
>> >>

[...]

>> However, the check here is not perfect because we could have
>> "<&phandle1 1 2>" when really it should be "<&phandle1 &phandle2
>> &phandle3>". We don't fail until we're checking the 2nd phandle.
>> That's why I added the "or bad phandle" and the cell # in the message
>> above. In the opposite case, we'd be silent. One thing that could be
>> done is double check things against the markers if they are present.
>
> Uh.. I don't really understand what you're getting at here.  We should
> be able to determine which of these cases it should be by the
> #whatever-cells at &phandle1.

If #whatever-cells is wrong, we can't tell immediately. Say it is 1 in the
above case, but really should be 2. Then on the 2nd loop iteration, we
think the value "2" is a phandle which will actually succeed in the lookup.
The failure we get is #whatever-cells couldn't be found (or maybe it is
found by luck, who knows) in the node pointed to by phandle 2. There's a
case of this in the kernel that I hit which took me a minute to realize
what was going on. The point is that if the property value has errors, we
may go into the weeds and the error reported may not be that precise.

Rob

[-- Attachment #2: Type: text/html, Size: 2224 bytes --]

  reply	other threads:[~2017-08-25  1:58 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-22 23:02 [PATCH v2 0/3] dtc: checks for phandle with arg properties Rob Herring
     [not found] ` <20170822230208.20987-1-robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2017-08-22 23:02   ` [PATCH v2 1/3] checks: add phandle with arg property checks Rob Herring
     [not found]     ` <20170822230208.20987-2-robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2017-08-24  2:03       ` David Gibson
     [not found]         ` <20170824020338.GV5379-K0bRW+63XPQe6aEkudXLsA@public.gmane.org>
2017-08-24 17:23           ` Rob Herring
     [not found]             ` <CAL_Jsq+0Njjs_PHBSD-B7W9YFzdfpB2ApBcBD=48+BoXQKv2pw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-08-24 19:19               ` Rob Herring
     [not found]                 ` <CAL_Jsq+NVBF6npai2_CRSVchGN_EQBSYnQcw3rHZcNFKpP7pDg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-08-25 13:17                   ` David Gibson
     [not found]                     ` <20170825131727.GJ2772-K0bRW+63XPQe6aEkudXLsA@public.gmane.org>
2017-08-25 15:27                       ` Rob Herring
     [not found]                         ` <CAL_JsqKv=0Bu84Q0Mo9W9NhHqHE5VWCH_w38g=YMQ9ZCGqTFHw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-08-29  7:26                           ` David Gibson
2017-08-25  0:49               ` David Gibson
2017-08-25  1:58                 ` Rob Herring [this message]
2017-08-22 23:02   ` [PATCH v2 2/3] checks: add gpio binding properties check Rob Herring
     [not found]     ` <20170822230208.20987-3-robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2017-08-24  2:11       ` David Gibson
2017-08-22 23:02   ` [PATCH v2 3/3] checks: add interrupts property check Rob Herring
     [not found]     ` <20170822230208.20987-4-robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2017-08-24  2:15       ` 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=CAL_JsqJWEKfuaxU_sWDTwCNH3ffkqhcfu8xeLJ4JaPCZAdSZDQ@mail.gmail.com \
    --to=robh@kernel.org \
    --cc=david@gibson.dropbear.id.au \
    --cc=devicetree-compiler@vger.kernel.org \
    --cc=devicetree@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;
as well as URLs for NNTP newsgroup(s).