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

From: Andy Shevchenko

Date: Fri Sep 25 2026 - 10:17:47 EST


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.

--
With Best Regards,
Andy Shevchenko