[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <f779fc72-ec40-214b-eb81-d21d6b15d5b3@kernel.org>
Date: Mon, 5 Aug 2019 16:03:10 +0100
From: Marc Zyngier <maz@...nel.org>
To: Martin Blumenstingl <martin.blumenstingl@...glemail.com>
Cc: tglx@...utronix.de, jason@...edaemon.net, ralf@...ux-mips.org,
paul.burton@...s.com, jhogan@...nel.org, robh+dt@...nel.org,
linux-mips@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, mark.rutland@....com,
john@...ozen.org, Hauke Mehrtens <hauke@...ke-m.de>
Subject: Re: [PATCH 3/5] MIPS: lantiq: add an irq_domain and irq_chip for EBU
On 03/08/2019 18:33, Martin Blumenstingl wrote:
> Hi Marc,
>
> On Sat, Aug 3, 2019 at 11:12 AM Marc Zyngier <maz@...nel.org> wrote:
>>
>> Hi Martin,
>>
>> On Thu, 01 Aug 2019 18:42:42 +0100,
>> Martin Blumenstingl <martin.blumenstingl@...glemail.com> wrote:
>>
>> [...]
>>
>>>>> +static void ltq_ebu_irq_handler(struct irq_desc *desc)
>>>>> +{
>>>>> + struct irq_domain *domain = irq_desc_get_handler_data(desc);
>>>>> + struct irq_chip *irqchip = irq_desc_get_chip(desc);
>>>>> +
>>>>> + chained_irq_enter(irqchip, desc);
>>>>> +
>>>>> + generic_handle_irq(irq_find_mapping(domain, 0));
>>>>
>>>> Having an irqdomain for a single interrupt is a bit over the top... Is
>>>> that for the convenience of the DT infrastructure?
>>> yes, I did it to get DT support
>>> please let me know if there's a "better" way (preferably with another
>>> driver as example)
>>
>> To be honest, the chained handler is what troubles me the most. You
>> normally would use such a construct if you had a multiplexer. In your
>> case, you have a 1:1 relationship between input and output. It is just
>> that this irqchip allows the trigger to be adapted, which normally
>> calls for a hierarchical implementation.
>>
>> In your case, with only a single interrupt, it doesn't matter much
>> though.
> I see, thank you for the explanation
>
> can you name a driver for a hierarchical irqchip driver that you
> consider "clean" which I could use as reference?
Finding a "clean" driver is a challenge, as the world of IRQ controllers
is where both HW and SW engineers (me included) love to "innovate" ;-).
I'd recommend you have a look at drivers/irqchip/irq-mtk-cirq.c, which
is almost as simple as it gets.
Thanks,
M.
--
Jazz is not dead, it just smells funny...
Powered by blists - more mailing lists