Re: [PATCH 1/4] i2c: riic: Abort the transfer on completion timeout
From: Geert Uytterhoeven
Date: Tue Aug 25 2026 - 09:23:19 EST
Hi Claudiu,
On Wed, 20 May 2026 at 15:21, Claudiu Beznea <claudiu.beznea@xxxxxxxxxx> wrote:
> From: Claudiu Beznea <claudiu.beznea.uj@xxxxxxxxxxxxxx>
>
> riic_xfer() configures a transfer and waits for the interrupt handler to
> signal its completion. If the completion times out, the device may be
> powered off through runtime PM. However, the transfer interrupt may still
> fire after the timeout.
>
> To avoid cases where riic_xfer() powers off the device (via runtime PM)
> while the interrupt handler is still running, disable and synchronize the
> interrupts after the completion times out.
>
> Fixes: 310c18a41450 ("i2c: riic: add driver")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@xxxxxxxxxxxxxx>
Thanks for your patch!
> --- a/drivers/i2c/busses/i2c-riic.c
> +++ b/drivers/i2c/busses/i2c-riic.c
> @@ -112,6 +112,7 @@ struct riic_dev {
> void __iomem *base;
> u8 *buf;
> struct i2c_msg *msg;
> + int *irqs;
Perhaps make this a zero-length array at the end of the structure,
so this does not need to be allocated separately?
> int bytes_left;
> int err;
> int is_last;
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds