Re: [Regression] "irqdomain: Don't set type when mapping an IRQ" breaks nexus7 gpio buttons

From: Linus Walleij
Date: Wed Aug 10 2016 - 15:42:40 EST


On Wed, Aug 10, 2016 at 11:56 AM, Jon Hunter <jonathanh@xxxxxxxxxx> wrote:
> Hi Marc, Linus,
> On 10/08/16 10:41, Marc Zyngier wrote:
>> On 10/08/16 00:03, Linus Walleij wrote:
>>> On Tue, Aug 9, 2016 at 3:20 PM, Jon Hunter <jonathanh@xxxxxxxxxx> wrote:
>>>
>>>> If that works, then does the following also work (without the above) ...
>>>>
>>>> diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
>>>> index b4c1bc7c9ca2..e111b72e3162 100644
>>>> --- a/kernel/irq/chip.c
>>>> +++ b/kernel/irq/chip.c
>>>> @@ -824,6 +824,7 @@ __irq_do_set_handler(struct irq_desc *desc, irq_flow_handler_t handle,
>>>> irq_settings_set_norequest(desc);
>>>> irq_settings_set_nothread(desc);
>>>> desc->action = &chained_action;
>>>> + __irq_set_trigger(desc, irqd_get_trigger_type(&desc->irq_data));
>>>> irq_startup(desc, true);
>>>> }
>>>> }
(...)
>>> I tried this on my problematic platform and then this happens:
>>>
>>> preparing networking...
>>> [ 2.628246] ------------[ cut here ]------------
>>> [ 2.628303] WARNING: CPU: 0 PID: 92 at ../kernel/irq/chip.c:26
>>> bad_chained_irq+0x44/0x4c
(...)
> Just to confirm is that with or without the proposed change?

This is with:
+ __irq_set_trigger(desc, irqd_get_trigger_type(&desc->irq_data));

No other changes.

Before the change it boots, but the IRQs don't work.

After the change it boots and crashes like that.

> Linus, I have been trying to find out which qcom board has this smsc911x
> but I was unable to find any, so more info on the platform would be great!

It has nothing to do with the SMSC911x per se. The problem pertains
to *all* IRQs from the PMIC.

This is the original APQ8060 Dragonboard from BSquare.
https://dflund.se/~triad/krad/dragonboard/

Qualcomm also have a development board called "Surf" which
likely have this problem.

This is the MFD irqchip driver that has the problem:
drivers/mfd/pm8921-core.c

No IRQs from this works. Not even the power button or anything.

> I have been testing this on various Tegra boards that use gpio irqchips
> for various external functions and have not seen any such problems so far.

John seems to be seeing it on other Qualcomm gpiochip drivers with
APQ8064 on the Nexus 7. I would be surprised if any of the APQ8064
boards doesn't have the issue.

Yours,
Linus Walleij