Re: [PATCH] i2c: nomadik: handle pm_runtime errors

From: Wolfram Sang

Date: Tue Nov 10 2026 - 14:53:06 EST


On Tue, Nov 10, 2026 at 03:06:16PM +0200, Dmitry Guzman wrote:
> In nmk_i2c_xfer(), pm_runtime_get_sync() is called on start and then
> the controller registers are accessed without checking the return value.
> If pm_runtime_get_sync() fails, access to the register of the device that
> was not correctly powered on may cause a bus fault or other unpredictable
> system behavior.
>
> Replace pm_runtime_get_sync() with pm_runtime_resume_and_get() that
> always return 0 on success and automatically restores PM usage counter
> on failure, and return immediately if it returns any error.
>
> Signed-off-by: Dmitry Guzman <Dmitry.Guzman@xxxxxxxxxxxx>

Applied to my for-andi branch, thanks!