From: Marc Zyngier <marc.zyngier@arm.com>
To: Masahiro Yamada <yamada.masahiro@socionext.com>,
Thomas Gleixner <tglx@linutronix.de>,
Linus Walleij <linus.walleij@linaro.org>,
linux-gpio@vger.kernel.org, Rob Herring <robh+dt@kernel.org>
Cc: Jassi Brar <jaswinder.singh@linaro.org>,
devicetree@vger.kernel.org, Jason Cooper <jason@lakedaemon.net>,
Masami Hiramatsu <mhiramat@kernel.org>,
David Daney <david.daney@cavium.com>,
linux-kernel@vger.kernel.org, Mark Rutland <mark.rutland@arm.com>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v4 0/6] irqdomain, gpio: expand irq_domain_push_irq() for DT use and use it for GPIO
Date: Thu, 7 Sep 2017 13:39:11 +0100 [thread overview]
Message-ID: <b0f7495b-3b51-a75f-2a29-bbcd86eacb53@arm.com> (raw)
In-Reply-To: <1504784522-26841-1-git-send-email-yamada.masahiro@socionext.com>
On 07/09/17 12:41, Masahiro Yamada wrote:
>
> This series adds a GPIO controller for UniPhier SoC family.
> It also works as an irqchip in hierarchy domain manner.
>
> My problem is mapping of IRQ from this controller to the parent
> irqchip is not contiguous.
>
> IRQ line of GPIO ---> Parent interrupt
> 0 ---> 48
> 1 ---> 49
> ...
> 15 ---> 63
> 16 ---> 154
> 17 ---> 155
> ...
> 20 ---> 158
> 21 ---> 217
> 22 ---> 218
> ...
>
> So, I need to have an array of parent hwirqs somehow.
>
> Probably, most of people will try to use "interrupts" DT property,
> but I noticed a potential problem for hierarchy IRQ domain.
> If "interrupts" property exists in the device node, IRQ resource
> may be statically allocated when platform devices are populated
> from DT. I asked this question some time ago:
> https://lkml.org/lkml/2017/7/6/758
>
> After I tackled this, I decided to put the array in the driver,
> but I could not get a positive response for this.
> The discussion mostly happened in v1 thread:
> http://patchwork.ozlabs.org/patch/797145/
>
> Recently, the new API irq_domain_push_irq() was merged in the
> mainline. I thought this might be useful to solve the hierarchy
> domain issue. Hence, here is a trial.
>
> I found patch 2 is needed to avoid "type mismatch" error.
>
> One more thing, I am worried about a race condition.
>
> I think there is a possibility where a device tries to get IRQ
> after irq_domain_create_hierarchy(), but before irq_domain_push_irq().
>
> priv->domain = irq_domain_create_hierarchy(...)
> if (!priv->domain)
> return -ENOMEM;
>
> [ *** What if a irq consumer device request the irq here? *** ]
We've explicitly forbidden such a use case. There is a (not exactly fool
proof) check in irq_domain_push_irq(), but it is pretty easy to bypass
it. "Don't do it" is the conclusion we reached with David Daney.
If you don't want these interrupts to be requested, you might as well
flag them as IRQ_NOREQUEST, and unflag them when the hierarchy is ready.
Would that work for you?
Thanks,
M.
--
Jazz is not dead. It just smells funny...
next prev parent reply other threads:[~2017-09-07 12:39 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-07 11:41 [PATCH v4 0/6] irqdomain, gpio: expand irq_domain_push_irq() for DT use and use it for GPIO Masahiro Yamada
2017-09-07 11:41 ` [PATCH v4 1/6] irqdomain: rename variables in irq_domain_{push,pop}_irq() Masahiro Yamada
2017-09-07 12:47 ` Marc Zyngier
2017-09-07 17:45 ` David Daney
2017-09-08 15:05 ` Masahiro Yamada
2017-09-07 11:41 ` [PATCH v4 3/6] irqdomain: move IRQ_DOMAIN_NAME_ALLOCATED define to the original position Masahiro Yamada
2017-09-07 12:04 ` Marc Zyngier
2017-09-08 15:10 ` Masahiro Yamada
[not found] ` <1504784522-26841-1-git-send-email-yamada.masahiro-uWyLwvC0a2jby3iVrkZq2A@public.gmane.org>
2017-09-07 11:41 ` [PATCH v4 2/6] irqdomain: clear trigger type in irq_domain_push_irq() Masahiro Yamada
2017-09-07 12:25 ` Marc Zyngier
[not found] ` <a3e38f20-007b-1065-7999-95e2264f2155-5wv7dgnIgG8@public.gmane.org>
2017-09-08 15:09 ` Masahiro Yamada
2017-09-07 11:42 ` [PATCH v4 4/6] irqdomain: set irq domain flags before the irq domain becomes visible Masahiro Yamada
2017-09-07 11:42 ` [PATCH v4 5/6] irqdomain: add IRQ_DOMAIN_FLAG_NO_CREATE flag Masahiro Yamada
2017-09-07 11:42 ` [PATCH v4 6/6] gpio: uniphier: add UniPhier GPIO controller driver Masahiro Yamada
[not found] ` <1504784522-26841-7-git-send-email-yamada.masahiro-uWyLwvC0a2jby3iVrkZq2A@public.gmane.org>
2017-09-07 19:41 ` Rob Herring
[not found] ` <CAL_Jsq+Da1=myQGEpA_0f+dEU0Rk6RB3BJHVCzq0M0MyJ3UDoQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-09-08 15:14 ` Masahiro Yamada
2017-09-11 20:15 ` Rob Herring
2017-09-10 12:13 ` kbuild test robot
2017-09-12 14:03 ` Linus Walleij
2017-09-12 15:44 ` David Daney
[not found] ` <7e46f2a3-114f-0c34-d3c5-49e6422b9200-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8@public.gmane.org>
2017-09-13 8:31 ` Masahiro Yamada
2017-09-07 12:39 ` Marc Zyngier [this message]
2017-09-08 15:06 ` [PATCH v4 0/6] irqdomain, gpio: expand irq_domain_push_irq() for DT use and use it for GPIO Masahiro Yamada
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=b0f7495b-3b51-a75f-2a29-bbcd86eacb53@arm.com \
--to=marc.zyngier@arm.com \
--cc=david.daney@cavium.com \
--cc=devicetree@vger.kernel.org \
--cc=jason@lakedaemon.net \
--cc=jaswinder.singh@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mhiramat@kernel.org \
--cc=robh+dt@kernel.org \
--cc=tglx@linutronix.de \
--cc=yamada.masahiro@socionext.com \
/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).