Re: [PATCH] iio: accel: kxcjk-1013: reject duplicate event disable

From: Jonathan Cameron

Date: Fri Sep 25 2026 - 20:50:01 EST


On Fri, 25 Sep 2026 22:38:07 +0800 (CST)
"jiale yao" <19888972804@xxxxxxx> wrote:

> At 2026-09-25 22:17:19, "Andy Shevchenko" <andriy.shevchenko@xxxxxxxxx> wrote:
> >On Fri, Sep 25, 2026 at 10:09:43PM +0800, Jiale Yao wrote:
> >> The IIO core does not filter duplicate writes to the event enable
> >> attribute. kxcjk1013_write_event_config() already ignores repeated
> >> enable requests, but a repeated disable request still calls
> >> kxcjk1013_set_power_state(data, false), 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.
> >
> >Sounds like a bug that needs to be fixed and hence Fixes tag to be applied.
> Sure, I'll add the Fixes tag in v2, 24h later, for any other comments before sending it.
For a simple request for a fixes tag, I'm also fine with you just
replying with that tag. b4 will pick it up (though technically in the
wrong place so I'll massage things whilst applying)

Fix looks good to me.

Jonathan

> >
> >--
> >With Best Regards,
> >Andy Shevchenko
> >