From: Mark Rutland <mark.rutland@arm.com>
To: Rob Herring <robherring2@gmail.com>
Cc: "grant.likely@linaro.org" <grant.likely@linaro.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"rob.herring@calxeda.com" <rob.herring@calxeda.com>,
Pawel Moll <Pawel.Moll@arm.com>,
Stephen Warren <swarren@wwwdotorg.org>,
Ian Campbell <ijc+devicetree@hellion.org.uk>,
Kumar Gala <galak@kernel.crashing.org>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>
Subject: Re: [RFC 9/9] of/irq: create interrupts-extended property
Date: Mon, 28 Oct 2013 03:16:42 +0000 [thread overview]
Message-ID: <20131028031641.GA2782@kartoffel> (raw)
In-Reply-To: <CAL_JsqLN9eOWTo5pZV1m0i2GmxEMJWOcJvci_w=rCO7_h+X1Nw@mail.gmail.com>
On Sun, Oct 27, 2013 at 08:24:08PM +0000, Rob Herring wrote:
> On Sun, Oct 27, 2013 at 8:46 AM, Grant Likely <grant.likely@linaro.org> wrote:
> > On Tue, 15 Oct 2013 21:39:23 +0100, Grant Likely <grant.likely@linaro.org> wrote:
> >> The standard interrupts property in device tree can only handle
> >> interrupts coming from a single interrupt parent. If a device is wired
> >> to multiple interrupt controllers, then it needs to be attached to a
> >> node with an interrupt-map property to demux the interrupt specifiers
> >> which is confusing. It would be a lot easier if there was a form of the
> >> interrupts property that allows for a separate interrupt phandle for
> >> each interrupt specifier.
> >>
> >> This patch does exactly that by creating a new interrupts-extended
> >> property which reuses the phandle+arguments pattern used by GPIOs and
> >> other core bindings.
> >>
> >> Signed-off-by: Grant Likely <grant.likely@linaro.org>
> >> Cc: Rob Herring <rob.herring@calxeda.com>
> >
> > Alright, I want to merge this one. I've got an Ack from Tony, general
> > agreement from an in person converstaion from Ben (aside from wishing he
> > could think of a better property name), and various rumblings of
> > approval from anyone I talked to about it at ksummit. I'd like to have
> > something more that that to put into the commit text. Please take a look
> > and let me know if you agree/disagree with this binding.
The only comment I have is that I'm not keen on the name (it's a bit generic
and we might want to extend the interrupts binding in future), but I'm happy to
leave that as a matter of personal taste.
The best alternative I could come up with was parented-interrupts, but that
could be misinterpreted as describing the relationship backwards (i.e. this
device is the parent for those interrupts).
>
> I think it looks fine, but I'll throw out an alternative proposal.
> Simply allow for interrupt-parent to be an array in equal size to
> interrupts property. Then it is a minimal change to the existing
> binding:
>
> interrupt-parent = <&intc1>, <&intc2>;
> interrupts = <5 0>, <6 0>;
I'd prefer the interrupts-extended approach.
This might not matter, but if you have an existing driver with two interrupts,
and you attempt to describe the situation this way, e.g.
intc1: interrupt_controller1 {
compatible = "vendor,interrupt-controller";
#interrupt-cells = <1>;
};
intc2: interrupt_controller2 {
compatible = "vendor,another-interrupt-controller";
#interrupt-cells = <2>;
};
dev {
compatible = "vendor,some-device";
interrupt-parent = <&intc1>, <&intc2>;
interrupts = <5>, <65 73>;
};
The existing driver may read interrupts as two interrupts for intc1, and
believe it's been successful when it has not, and one of those interrupts might
never fire. That would be very bad for a timer for example.
Additionally it makes the interrupts list difficult for a human to read, as you
need to match it with an entry in another list (this problem exists with other
parallel properties like interrupt-names too, but we can't do much better
there).
It's also easy to make a typo (e.g. an extra cell in an interrupt) that will
parse as valid when you don't expect it to. At least with the phandle in the
list it's less likely to happen.
>
> Of course interrupts-extended is more inline with standard patterns
> for bindings.
I think for this reason alone it should be preferable. Unless I'm mistaken it
would be identical to the clock bindings pattern with a uniformly named
phandle+args property and a parallel -names property. I don't think the gpio
style ${NAME}-interrupts would easily fit here.
Thanks,
Mark.
next prev parent reply other threads:[~2013-10-28 3:16 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-15 20:39 [RFC 0/9] of: refactor IRQ parsing and add interrupts-extended implementation Grant Likely
2013-10-15 20:39 ` [RFC 1/9] of/irq: Rename of_irq_map_* functions to of_irq_parse_* Grant Likely
2013-10-16 10:47 ` Michal Simek
2013-10-15 20:39 ` [RFC 2/9] of/irq: Replace of_irq with of_phandle_args Grant Likely
2013-10-15 20:39 ` [RFC 4/9] of/irq: Refactor interrupt-map parsing Grant Likely
2013-10-29 16:23 ` Olof Johansson
2013-10-31 1:19 ` Ming Lei
[not found] ` <CACxGe6uE+KvycQq3XBavRcvprff6PhBaxX54W_Cb1cfuVpMXvQ@mail.gmail.com>
2013-10-31 18:57 ` Olof Johansson
2013-11-01 14:48 ` Grant Likely
2013-11-01 17:53 ` Grant Likely
[not found] ` <20131101175317.A812AC40868-WNowdnHR2B42iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2013-11-01 18:54 ` Grant Likely
2013-11-02 4:16 ` Ming Lei
[not found] ` <20131101185401.B298FC40868-WNowdnHR2B42iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2013-11-04 5:04 ` Olof Johansson
2013-11-05 15:18 ` Tomasz Figa
2013-11-05 15:21 ` [PATCH 1/2] of: irq: Fix interrupt-map entry matching Tomasz Figa
2013-11-07 11:32 ` Tomasz Figa
2013-11-07 16:40 ` Rob Herring
[not found] ` <CAL_JsqKUaioiz2dw3Sr8f7UfqzjagWH_je2-u_QGYXRK5g1=yg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-11-07 22:11 ` Tomasz Figa
2013-11-08 9:37 ` Grant Likely
2013-11-07 11:50 ` Sachin Kamat
2013-11-05 15:21 ` [PATCH 2/2] of: irq: Check for reg property presence only when parsing interrupt-map Tomasz Figa
2013-11-07 11:33 ` Tomasz Figa
2013-11-01 19:07 ` [RFC 4/9] of/irq: Refactor interrupt-map parsing Stephen Warren
2013-10-31 20:45 ` [RFC 4/9] of/irq: Refactor interrupt-map parsing [CPU hotplug clockevents issue] Stephen Warren
2013-10-15 20:39 ` [RFC 5/9] of: Add helper for printing an of_phandle_args structure Grant Likely
[not found] ` <1381869563-16083-1-git-send-email-grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2013-10-15 20:39 ` [RFC 3/9] of/irq: simplify args to irq_create_of_mapping Grant Likely
2013-10-15 20:39 ` [RFC 6/9] of: Add testcases for interrupt parsing Grant Likely
2013-10-15 20:39 ` [RFC 9/9] of/irq: create interrupts-extended property Grant Likely
2013-10-17 17:33 ` Tony Lindgren
2013-10-27 13:46 ` Grant Likely
2013-10-27 20:24 ` Rob Herring
2013-10-28 3:16 ` Mark Rutland [this message]
2013-10-28 6:54 ` Kumar Gala
[not found] ` <20131027134607.E1782C4039D-WNowdnHR2B42iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2013-10-28 21:47 ` Stephen Warren
2013-10-28 22:49 ` Mark Rutland
2013-10-28 23:16 ` Benjamin Herrenschmidt
[not found] ` <1381869563-16083-10-git-send-email-grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2013-10-28 6:54 ` Kumar Gala
[not found] ` <31D756E7-A7CD-42ED-8D1D-D1B38B85E3A0-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2013-10-28 23:41 ` Grant Likely
2013-11-11 22:58 ` Peter Crosthwaite
[not found] ` <CAEgOgz6=HhBkb2KtxcmHpNdE_0sNngw0NaL2SnLWj1opZkO3SA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-11-12 6:54 ` Grant Likely
[not found] ` <20131112065405.C75E8C42024-WNowdnHR2B42iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2013-11-12 7:49 ` Peter Crosthwaite
[not found] ` <CAEgOgz6j8YsvFgq8ZbE20ocHPA0C-eUGBb7F1gNiVBvJXLa8_g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-11-12 8:50 ` Grant Likely
[not found] ` <20131112085038.B6A75C421BB-WNowdnHR2B42iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2013-11-12 23:17 ` Peter Crosthwaite
2013-11-13 6:14 ` Grant Likely
2013-11-24 7:04 ` Peter Crosthwaite
2013-10-17 17:30 ` [RFC 0/9] of: refactor IRQ parsing and add interrupts-extended implementation Tony Lindgren
2013-10-15 20:39 ` [RFC 7/9] of/irq: Create of_irq_parse_and_map_pci() to consolidate arch code Grant Likely
2013-10-15 20:39 ` [RFC 8/9] microblaze/pci: Drop PowerPC-ism from irq parsing Grant Likely
[not found] ` < 1381869563-16083-10-git-send-email-grant.likely@linaro.org>
[not found] ` < CAEgOgz6=HhBkb2KtxcmHpNdE_0sNngw0NaL2SnLWj1opZkO3SA@mail.gmail.com>
[not found] ` < 20131112065405.C75E8C42024@trevor.secretlab.ca>
[not found] ` < CAEgOgz6j8YsvFgq8ZbE20ocHPA0C-eUGBb7F1gNiVBvJXLa8_g@mail.gmail.com>
[not found] ` < 20131112085038.B6A75C421BB@trevor.secretlab.ca>
[not found] ` < CAEgOgz4dM1zQdFpOkUwZqAUMUBe2eh3j1Ah0KgomVAOGgrPsVw@mail.gmail.com>
[not found] ` < 20131113061425.667F9C41807@trevor.secretlab.ca>
[not found] ` < CAEgOgz5BWzo-LGddjG6ZUtKt6GHxLmDUEndFOdVrn+1HTPvpGQ@mail.gmail.com>
[not found] ` <CAEgOgz5BWzo-LGddjG6ZUtKt6GHxLmDUEndFOdVrn+1HTPvpGQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-11-24 21:32 ` [RFC 9/9] of/irq: create interrupts-extended property Grant Likely
[not found] ` <20131124213212.226B8C402C3-WNowdnHR2B42iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2013-11-27 9:06 ` Peter Crosthwaite
[not found] ` < 20131124213212.226B8C402C3@trevor.secretlab.ca>
[not found] ` < CAEgOgz4yhDzy_BFiotK5Qi48sczR3PL1oPjPhNYC9O94P6AnzQ@mail.gmail.com>
[not found] ` <CAEgOgz4yhDzy_BFiotK5Qi48sczR3PL1oPjPhNYC9O94P6AnzQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-11-27 14:17 ` Grant Likely
2013-11-28 7:28 ` Peter Crosthwaite
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=20131028031641.GA2782@kartoffel \
--to=mark.rutland@arm.com \
--cc=Pawel.Moll@arm.com \
--cc=benh@kernel.crashing.org \
--cc=devicetree@vger.kernel.org \
--cc=galak@kernel.crashing.org \
--cc=grant.likely@linaro.org \
--cc=ijc+devicetree@hellion.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=rob.herring@calxeda.com \
--cc=robherring2@gmail.com \
--cc=swarren@wwwdotorg.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).