devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Rob Herring <robh+dt@kernel.org>
Cc: "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" 
	<devicetree@vger.kernel.org>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>
Subject: Re: [PATCH dt-schema] Fix interrupt controllers with interrupt-map
Date: Sat, 30 May 2020 14:30:55 +0200	[thread overview]
Message-ID: <CAMuHMdVU4UnZCDoO842YQ0_q+CvRJ7+a_vf68ck95PCN6Zt4jg@mail.gmail.com> (raw)
In-Reply-To: <CAL_Jsq+goALPsbhQ=Euh7fUupfC1gXO+AZXR=Obm9G_zMN7q4A@mail.gmail.com>

Hi Rob,

Cc Rasmus

On Fri, May 29, 2020 at 11:44 PM Rob Herring <robh+dt@kernel.org> wrote:
> On Fri, May 29, 2020 at 10:02 AM Geert Uytterhoeven
> <geert@linux-m68k.org> wrote:
> > On Fri, May 29, 2020 at 5:54 PM Rob Herring <robh+dt@kernel.org> wrote:
> > > On Thu, May 28, 2020 at 7:23 AM Geert Uytterhoeven
> > > <geert+renesas@glider.be> wrote:
> > > > When an interrupt controller has an "interrupt-map" property, an "is
> > > > valid under each of" error is triggered.
> > > >
> > > > Fix this by allowing "interrupt-controller" and "interrupt-map" to
> > > > coexist, in both the interrrupts meta-schema and the
> > > > interrupt-controller schema.
> > >
> > > But both should not be present. If 'interrupt-controller' is present,
> >
> > Why not?
>
> Well, maybe I'm wrong. If you have more than just transparent
> remapping (i.e. mask/unmask/clear), then perhaps both are appropriate
> because you want get the irq domain for the first irq parent.

Indeed, that's the case for rza1-irqc.

> > > the Linux irq parsing code will ignore 'interrupt-map'. Seems like
> > > that's backwards, but this parsing code is older than dirt and we'd
> > > probably break some 1990s machine changing it.
> >
> > That's fine.  rza1_irqc_parse_map() parses the interrupt-map itself,
> > to map from downstream to upstream interrupts.
>
> You shouldn't really be parsing interrupt-map yourself. The code there

Of course I had tried that before[1];

|    I also considered extracting the parsing code in of_irq_parse_raw() in a
|    new public helper function:
|
|        int of_irq_parse_map(struct device_node **ipar, u32 *addrsize,
|                             u32 *intsize, const __be32 **match_array,
|                             struct of_phandle_args *out_irq);
|
|    However, that API is a bit ugly due to many output parameters
|    (of_irq_parse_raw() needs to iterate the interrupt hierarchy).
|    In addition, it's less efficient for irq-renesas-rza1.c, as the
|    interrupt-map must be parsed 8 times.

Or is there a better way?

In the mean time, drivers/irqchip/irq-ls-extirq.c has landed, which was
mimiced after irq-renesas-rza1.c.

> doesn't account for #address-cells which can be a factor for
> interrupt-map. dtc is gaining some checks for 'interrupt-map', so
> let's hope you have it right.

The driver code indeed doesn't account for #address-cells, but the
binding says it must be zero anyway.

[1] "[PATCH v4 2/2] irqchip: Add Renesas RZ/A1 Interrupt Controller driver"
    http://lore.kernel.org/r/20190527121711.5138-3-geert+renesas@glider.be

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

  reply	other threads:[~2020-05-30 12:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-28 13:23 [PATCH dt-schema] Fix interrupt controllers with interrupt-map Geert Uytterhoeven
2020-05-29 15:54 ` Rob Herring
2020-05-29 16:02   ` Geert Uytterhoeven
2020-05-29 21:44     ` Rob Herring
2020-05-30 12:30       ` Geert Uytterhoeven [this message]
2020-06-08 20:25 ` 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=CAMuHMdVU4UnZCDoO842YQ0_q+CvRJ7+a_vf68ck95PCN6Zt4jg@mail.gmail.com \
    --to=geert@linux-m68k.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --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: 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).