Re: [PATCH] iio: gyro: bmg160: reject duplicate event disable
From: Andy Shevchenko
Date: Fri Sep 25 2026 - 10:24:26 EST
On Fri, Sep 25, 2026 at 10:09:54PM +0800, Jiale Yao wrote:
> The IIO core does not filter duplicate writes to the event enable
> attribute.
Can it be done there once for all?
> bmg160_write_event_config() already ignores repeated enable
> requests, but a repeated disable request still calls
> bmg160_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.
--
With Best Regards,
Andy Shevchenko