Re: [RFC v3] irqchip: qcom: pdc: Introduce irq_set_wake call

From: Stephen Boyd
Date: Thu Apr 23 2020 - 22:37:43 EST


Quoting Maulik Shah (2020-04-22 05:14:21)
>
> We discussed this in RFC v2, pasting your reply from same.
>
>> That looks like a bug. It appears that gpiolib is only hooking the irq
>> disable path here so that it can keep track of what irqs are not in use
>> by gpiolib and allow them to be used for GPIO purposes when the irqs are
>> disabled. See commit 461c1a7d4733 ("gpiolib: override
>> irq_enable/disable"). That code in gpiolib should probably see if lazy
>> mode has been disabled on the irq and do similar things to what genirq
>> does and then let genirq mask the gpios if they trigger during the time
>> when the irq is disabled. Regardless of this design though, I don't
>> understand why this matters.

Yeah. I'm saying that the gpiolib code that forces all gpio irqs to be
non-lazy is broken. Please send a patch to fix gpiolib so that irqs can
be lazy again. I thought it didn't matter before but now that I've
learned more it sounds like we have to use lazy irqs here so that irqs
stay enabled on the path to suspend while they're disabled but marked
for wakeup. Otherwise I don't know how to make this work.