Re: [PATCH v3] iio: gyro: mpu3050: fix runtime PM leak when enabling trigger fails
From: Andy Shevchenko
Date: Fri Jul 17 2026 - 14:02:10 EST
On Fri, Jul 17, 2026 at 11:20:22PM +0530, Biren Pandya wrote:
> mpu3050_drdy_trigger_set_state() calls pm_runtime_get_sync() when the
> trigger is enabled, but several error paths in the enable branch return
> directly without dropping the usage counter again. pm_runtime_get_sync()
> increments the usage counter, so every failed enable leaks a runtime PM
> reference and the device can no longer autosuspend. The driver state flag
> hw_irq_trigger is also left set after a failed enable.
>
> Jump to a common error label that drops the reference and clears
> hw_irq_trigger, mirroring the disable path. The success path deliberately
> keeps the reference, as the device must stay resumed while the trigger is
> active.
...
> -/**
> +/*
> * mpu3050_read_mem() - read MPU-3050 internal memory
> * @mpu3050: device to read from
> * @bank: target bank
Stray and actually wrong change. Please, use more brains and less AI.
--
With Best Regards,
Andy Shevchenko