Re: [PATCH 1/2] [i2c-bcm2835] Fully clean up hardware state machine after a timeout

From: Andi Shyti
Date: Tue Oct 31 2023 - 07:43:48 EST


Hi Mike,

> When the driver detects a timeout, there's no guarantee that the ISR
> would have fired. Thus after a timeout, it's the foreground that
> becomes responsible to reset the hardware state machine. The change
> here just duplicates what is already implemented in the ISR.

Is this a fix? What failing here?

Can we have a feedback from Florian, Ray or Scott here?

...

> if (!time_left) {
> + /* Since we can't trust the ISR to have cleaned up, do the
> + * full cleanup here... */

Please use the

/*
* comment
* comment
*/

format

> bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_C,
> BCM2835_I2C_C_CLEAR);
> + bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_S, BCM2835_I2C_S_CLKT |
> + BCM2835_I2C_S_ERR | BCM2835_I2C_S_DONE);

I'm not sure this is really making any difference though. How
have you tested this?

Have you tried reading those registers before and understand what
went wrong?

Andi