[PATCH v4 0/2] iio: gyro: mpu3050: Fix runtime PM refcount leak in trigger enable path

From: Xiangwu Lai

Date: Tue Nov 03 2026 - 23:01:06 EST


Hi Jonathan,

Thanks for the review! This version addresses both comments on the
trigger helpers: the dispatcher now uses an else, and the error
return for the IRQ status read in the enable path is propagated.
The disable path is left as is, as you concluded it was not worth
the effort to fix.

Patch 1 splits the enable and disable paths out of
mpu3050_drdy_trigger_set_state() into separate helpers. It is a pure
code move with no functional change. Patch 2 applies the runtime PM
refcount fix on top, using pm_runtime_resume_and_get() instead of
pm_runtime_get_sync(), which also keeps the usage counter balanced
when the resume fails.

Changes in v4:
- use an else for the either/or dispatch in
mpu3050_drdy_trigger_set_state(), as suggested by the reviewer.
- propagate the error from the IRQ status read in the enable path
instead of only printing it, as suggested by the reviewer.

Changes in v3:
- no code changes, the series was reposted as a new top-level thread.

Changes in v2:
- split the enable and disable paths out of
mpu3050_drdy_trigger_set_state() into a precursor patch and use
pm_runtime_resume_and_get() instead of pm_runtime_get_sync(), as
suggested by the reviewer.

v3: https://lore.kernel.org/r/20261103092002.1332-1-laixiangwu@xxxxxxxxxxxxxxxxxxxx/
v2: https://lore.kernel.org/r/20261101092327.197-1-laixiangwu@xxxxxxxxxxxxxxxxxxxx/
v1: https://lore.kernel.org/r/20261030084305.1660-1-laixiangwu@xxxxxxxxxxxxxxxxxxxx/

laixiangwu (2):
iio: gyro: mpu3050: Split data ready trigger enable/disable into
helpers
iio: gyro: mpu3050: Fix runtime PM refcount leak in trigger enable
path

drivers/iio/gyro/mpu3050-core.c | 182 +++++++++++++++++++-------------
1 file changed, 108 insertions(+), 74 deletions(-)

--
2.50.1.windows.1