Re: [PATCH] i2c: ocores: Disable clock on failed resume
Andi Shyti <[email protected]>
| Newsgroups | org.kernel.vger.linux-i2c,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
Hi Ruoyu,
On Thu, Aug 13, 2026 at 11:31:55PM +0800, Ruoyu Wang wrote:
> ocores_i2c_resume() enables the controller clock before reinitializing
> the hardware. If the clock rate changed while the device was suspended,
> ocores_init() may reject the resulting prescaler. The callback then
> returns an error with the clock still enabled, while the controller
> itself remains disabled.
>
> Disable and unprepare the clock when ocores_init() fails so the failed
> resume path balances the successful clk_prepare_enable() call.
>
> This issue was found by a static analysis checker and confirmed by manual
> source review.
>
> Fixes: e961a094afe0 ("i2c: ocores: add common clock support")
> Signed-off-by: Ruoyu Wang <[email protected]>
merged to i2c/i2c-2.
Thanks,
Andi