Re: [PATCH] iio: imu: kmx61: reject duplicate event disable

From: Jonathan Cameron

Date: Sun Oct 11 2026 - 07:31:52 EST


On Mon, 28 Sep 2026 16:30:02 +0800 (CST)
"jiale yao" <19888972804@xxxxxxx> wrote:

> At 2026-09-28 01:20:31, "Jonathan Cameron" <jic23@xxxxxxxxxx> wrote:
> >On Fri, 25 Sep 2026 17:18:44 +0300
> >Andy Shevchenko <andriy.shevchenko@xxxxxxxxx> wrote:
> >
> >> On Fri, Sep 25, 2026 at 10:10:05PM +0800, Jiale Yao wrote:
> >> > The IIO core does not filter duplicate writes to the event enable
> >> > attribute. kmx61_write_event_config() already ignores repeated enable
> >> > requests, but a repeated disable request still calls
> >> > kmx61_set_power_state(data, false, KMX61_ACC), dropping a runtime PM
> >> > reference that was not acquired for this request. This can underflow the
> >> > runtime PM usage count and trigger a "Runtime PM usage count underflow"
> >> > warning.
> >> >
> >> > Return early when the requested state already matches ev_enable_state.
> >>
> >> Same comments as per previous patches of the same topic.
> >>
> >Fixes tag needed.
>
> Fixes: fd3ae7a9f21c ("iio: imu: kmx61: Add support for any motion trigger")

Applied to the fixes-togreg branch of iio.git and marked for stable.

Thanks

Jonathan