From: Florian Fainelli <f.fainelli@gmail.com> To: "devicetree@vger.kernel.org" <devicetree@vger.kernel.org> Cc: Grant Likely <grant.likely@linaro.org>, Rob Herring <robh+dt@kernel.org>, Brian Norris <computersforpeace@gmail.com>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, Florian Fainelli <f.fainelli@gmail.com> Subject: Re: [PATCH] of/irq: lookup 'interrupts-extended' property first Date: Thu, 31 Jul 2014 11:00:01 -0700 [thread overview] Message-ID: <CAGVrzcYfA8rCXGRW7g0JhT4GQKT8SQj+pMvCh25yoXLFGNM_Pw@mail.gmail.com> (raw) In-Reply-To: <1403220823-19444-1-git-send-email-f.fainelli@gmail.com> 2014-06-19 16:33 GMT-07:00 Florian Fainelli <f.fainelli@gmail.com>: > In case the Device Tree blob passed by the boot agent supplies both an > 'interrupts-extended' and an 'interrupts' property in order to allow for > older kernels to be usable, prefer the new-style 'interrupts-extended' > property which convey a lot more information. > > This allows us to have bootloaders willingly maintaining backwards > compatibility with older kernels without entirely deprecating the > 'interrupts' property (although that is a clear violation of the binding > specified at > Documentation/devicetree/bindings/interrupt-controller/interrupts.txt) Any comments on this? Brian suggested that I update interrupt-controller/interrupts.txt to specify the look up ordering change as well. Thanks! > > Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> > --- > drivers/of/irq.c | 17 +++++++++-------- > 1 file changed, 9 insertions(+), 8 deletions(-) > > diff --git a/drivers/of/irq.c b/drivers/of/irq.c > index 3e06a699352d..1af3be2396db 100644 > --- a/drivers/of/irq.c > +++ b/drivers/of/irq.c > @@ -301,16 +301,17 @@ int of_irq_parse_one(struct device_node *device, int index, struct of_phandle_ar > /* Get the reg property (if any) */ > addr = of_get_property(device, "reg", NULL); > > + /* Try the new-style interrupts-extended */ > + res = of_parse_phandle_with_args(device, "interrupts-extended", > + "#interrupt-cells", index, out_irq); > + if (!res) > + return of_irq_parse_raw(addr, out_irq); > + > /* Get the interrupts property */ > intspec = of_get_property(device, "interrupts", &intlen); > - if (intspec == NULL) { > - /* Try the new-style interrupts-extended */ > - res = of_parse_phandle_with_args(device, "interrupts-extended", > - "#interrupt-cells", index, out_irq); > - if (res) > - return -EINVAL; > - return of_irq_parse_raw(addr, out_irq); > - } > + if (intspec == NULL) > + return -EINVAL; > + > intlen /= sizeof(*intspec); > > pr_debug(" intspec=%d intlen=%d\n", be32_to_cpup(intspec), intlen); > -- > 1.9.1 > -- Florian
WARNING: multiple messages have this Message-ID (diff)
From: Florian Fainelli <f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> To: "devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" <devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> Cc: Grant Likely <grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>, Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>, Brian Norris <computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>, "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>, Florian Fainelli <f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> Subject: Re: [PATCH] of/irq: lookup 'interrupts-extended' property first Date: Thu, 31 Jul 2014 11:00:01 -0700 [thread overview] Message-ID: <CAGVrzcYfA8rCXGRW7g0JhT4GQKT8SQj+pMvCh25yoXLFGNM_Pw@mail.gmail.com> (raw) In-Reply-To: <1403220823-19444-1-git-send-email-f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 2014-06-19 16:33 GMT-07:00 Florian Fainelli <f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: > In case the Device Tree blob passed by the boot agent supplies both an > 'interrupts-extended' and an 'interrupts' property in order to allow for > older kernels to be usable, prefer the new-style 'interrupts-extended' > property which convey a lot more information. > > This allows us to have bootloaders willingly maintaining backwards > compatibility with older kernels without entirely deprecating the > 'interrupts' property (although that is a clear violation of the binding > specified at > Documentation/devicetree/bindings/interrupt-controller/interrupts.txt) Any comments on this? Brian suggested that I update interrupt-controller/interrupts.txt to specify the look up ordering change as well. Thanks! > > Signed-off-by: Florian Fainelli <f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > --- > drivers/of/irq.c | 17 +++++++++-------- > 1 file changed, 9 insertions(+), 8 deletions(-) > > diff --git a/drivers/of/irq.c b/drivers/of/irq.c > index 3e06a699352d..1af3be2396db 100644 > --- a/drivers/of/irq.c > +++ b/drivers/of/irq.c > @@ -301,16 +301,17 @@ int of_irq_parse_one(struct device_node *device, int index, struct of_phandle_ar > /* Get the reg property (if any) */ > addr = of_get_property(device, "reg", NULL); > > + /* Try the new-style interrupts-extended */ > + res = of_parse_phandle_with_args(device, "interrupts-extended", > + "#interrupt-cells", index, out_irq); > + if (!res) > + return of_irq_parse_raw(addr, out_irq); > + > /* Get the interrupts property */ > intspec = of_get_property(device, "interrupts", &intlen); > - if (intspec == NULL) { > - /* Try the new-style interrupts-extended */ > - res = of_parse_phandle_with_args(device, "interrupts-extended", > - "#interrupt-cells", index, out_irq); > - if (res) > - return -EINVAL; > - return of_irq_parse_raw(addr, out_irq); > - } > + if (intspec == NULL) > + return -EINVAL; > + > intlen /= sizeof(*intspec); > > pr_debug(" intspec=%d intlen=%d\n", be32_to_cpup(intspec), intlen); > -- > 1.9.1 > -- Florian -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2014-07-31 18:08 UTC|newest] Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top 2014-06-19 23:33 [PATCH] of/irq: lookup 'interrupts-extended' property first Florian Fainelli 2014-07-31 18:00 ` Florian Fainelli [this message] 2014-07-31 18:00 ` Florian Fainelli 2014-08-06 16:54 ` Brian Norris 2014-08-06 18:42 ` Rob Herring 2014-08-06 18:42 ` Rob Herring 2014-08-06 20:12 ` Brian Norris 2014-08-06 21:50 ` Tim Bird 2014-08-06 21:50 ` Tim Bird 2014-08-06 22:12 ` Florian Fainelli 2014-08-06 22:12 ` Florian Fainelli 2014-08-15 12:56 ` Grant Likely 2014-08-06 22:24 ` Rob Herring
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=CAGVrzcYfA8rCXGRW7g0JhT4GQKT8SQj+pMvCh25yoXLFGNM_Pw@mail.gmail.com \ --to=f.fainelli@gmail.com \ --cc=computersforpeace@gmail.com \ --cc=devicetree@vger.kernel.org \ --cc=grant.likely@linaro.org \ --cc=linux-kernel@vger.kernel.org \ --cc=robh+dt@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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.