Linux IIO development
 help / color / mirror / Atom feed
* [PATCH v4 0/2] iio: gyro: mpu3050: Fix runtime PM refcount leak in trigger enable path
@ 2026-11-04  4:00 Xiangwu Lai
  2026-11-04  4:00 ` [PATCH v4 1/2] iio: gyro: mpu3050: Split data ready trigger enable/disable into helpers Xiangwu Lai
  2026-11-04  4:00 ` [PATCH v4 2/2] iio: gyro: mpu3050: Fix runtime PM refcount leak in trigger enable path Xiangwu Lai
  0 siblings, 2 replies; 6+ messages in thread
From: Xiangwu Lai @ 2026-11-04  4:00 UTC (permalink / raw)
  To: jic23, linux-iio; +Cc: linux-kernel, andy, dlechner, nuno.sa, Xiangwu Lai

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@cmss.chinamobile.com/
v2: https://lore.kernel.org/r/20261101092327.197-1-laixiangwu@cmss.chinamobile.com/
v1: https://lore.kernel.org/r/20261030084305.1660-1-laixiangwu@cmss.chinamobile.com/

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




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-11-05 15:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-04  4:00 [PATCH v4 0/2] iio: gyro: mpu3050: Fix runtime PM refcount leak in trigger enable path Xiangwu Lai
2026-11-04  4:00 ` [PATCH v4 1/2] iio: gyro: mpu3050: Split data ready trigger enable/disable into helpers Xiangwu Lai
2026-11-05 15:31   ` Joshua Crofts
2026-11-04  4:00 ` [PATCH v4 2/2] iio: gyro: mpu3050: Fix runtime PM refcount leak in trigger enable path Xiangwu Lai
2026-11-04 11:58   ` Andy Shevchenko
2026-11-05  8:18     ` Xiangwu Lai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox