Re: [PATCH] i2c: ocores: synchronize startup with interrupt handling

From: Markus Elfring

Date: Sat Oct 31 2026 - 06:27:15 EST


…
> Found by Sashiko AI review.
>
> Link: https://sashiko.dev/#/patchset/20260813153155.3953577-1-ruoyuw560@xxxxxxxxx
> ---
…

How do you think about to add any tags accordingly?
* Fixes
* Cc
* Signed-off-by


…
> +++ b/drivers/i2c/busses/i2c-ocores.c
…
> static irqreturn_t ocores_isr(int irq, void *dev_id)
> {
> struct ocores_i2c *i2c = dev_id;
> - u8 stat = oc_getreg(i2c, OCI2C_STATUS);
> + unsigned long flags;
> + u8 stat;
> +
> + spin_lock_irqsave(&i2c->process_lock, flags);
> + stat = oc_getreg(i2c, OCI2C_STATUS);
>
> if (i2c->flags & OCORES_FLAG_BROKEN_IRQ) {
…
> }
> ocores_process(i2c, stat);
> + spin_unlock_irqrestore(&i2c->process_lock, flags);
>
> return IRQ_HANDLED;
…

Under which circumstances would lock guards become applicable for
affected software components?
https://elixir.bootlin.com/linux/v7.3/source/include/linux/spinlock.h#L642-L645

Regards,
Markus