[RESEND PATCH] i2c: rk3x: Handle a spurious start completion interrupt flag

Ondřej Jirman megous at megous.com
Tue Nov 30 07:54:43 PST 2021


On Mon, Nov 29, 2021 at 10:37:43AM +0100, Wolfram Sang wrote:
> 
> > This causes I2C transfer being aborted in polled mode from a stop completion
> > handler:
> 
> I wonder why this only happens in polling mode? The question behind that
> is: is it really a spurious irq from the HW or is it maybe a race in the
> driver? Because polling uses the same interrupt handler but just
> periodically polls it.

Spurious interupt happens in both modes.

Abort only happens in polled mode, becase polling executes the irq handler
before the stop condition interrupt fires. In that case rk3x_i2c_irq will
execute rk3x_i2c_handle_stop, which will terminate the transfer, becasuse
it's executed without STOP completion interrupt flag being set.

In interrupt mode, the interrupt handler alwyas executes after the stop
condition, so the spurious START interrupt is ignored in this case.

kind regards,
	o.



More information about the Linux-rockchip mailing list