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

From: Jonathan Cameron

Date: Sun Nov 01 2026 - 12:28:44 EST


On Sun, 1 Nov 2026 17:23:25 +0800
laixiangwu <laixiangwu@xxxxxxxxxxxxxxxxxxxx> wrote:

> Hi Jonathan,
>
> Thanks for the review comments on the first version.
Hi.

First a small process thing. Please do not send new versions in
reply to an older one. It leads to confusing threads and generally
puts your emails way back in potential reviewer's inboxes.

Start a new thread for each version.

Thanks,

Jonathan

>
> This is a rework of the runtime PM refcount fix for the mpu3050 data
> ready trigger, following the review feedback:
>
> - Patch 1 is a new precursor patch that splits the enable and disable
> paths out of mpu3050_drdy_trigger_set_state() into a pair of
> separate helpers. It is a pure code move with no functional change.
> - Patch 2 then applies the fix on top of the refactor, so the error
> label now only lives inside mpu3050_drdy_trigger_enable(), and it
> uses pm_runtime_resume_and_get() instead of pm_runtime_get_sync(),
> which keeps the usage counter balanced even when the resume fails.
>
> 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(-)
>
>
>
>