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

From: jiale yao

Date: Mon Sep 28 2026 - 04:39:00 EST


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")