Re: [PATCH] ELAN touchpad i2c_hid bugs fix

From: Dmitry Torokhov
Date: Mon Mar 25 2019 - 14:30:43 EST


On Mon, Mar 25, 2019 at 11:23 AM <hotwater438@xxxxxxxxxxxx> wrote:
>
> Hi.
>
> Mar 25, 2019, 6:56 PM by dtor@xxxxxxxxxxxx:
>
> If you want to keep on using edge you need to make sure that i2c-hid
> never loses edge, as replaying of previously disabled interrupts in
> not at all reliable. So you need to "kick" the device after
> enable_irq() by initiating read from it and be ready to not get any
> data or get valid data and process accordingly.
>
> I'm sorry, but how edge can be loosed? There is device ID and quirk's which are associated with that ID, and quirk will always trigger edge irq.

If edge arrives while interrupt is disabled and replay of the
interrupt does not work when it is reenabled (and I do not think it
ever works for GPIO, you can hunt for Thomas Gleixner emails to that
effect on LKML), then ISR in the driver will never be called, so
driver will never read from the device to reset the interrupt
condition and interrupt will never be reasserted again -> edge lost.

Thanks.

--
Dmitry