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

From: jiale yao

Date: Sat Sep 26 2026 - 02:49:31 EST


At 2026-09-26 08:49:42, "Jonathan Cameron" <jic23@xxxxxxxxxx> wrote:
>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)
Thanks.
Fixes: b4b491c0832e ("iio: accel: kxcjk-1013: Support thresholds")
>
>Fix looks good to me.
>
>Jonathan
>
>> >
>> >--
>> >With Best Regards,
>> >Andy Shevchenko
>> >