Re: [PATCH] iio: gyro: mpu3050: Fix runtime PM leak on trigger errors
Linus Walleij <[email protected]>
| Newsgroups | org.kernel.vger.linux-iio,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <CAD++jLn9pTJKsSHWE0BEh0xMkck2L4+fRn1+MrXoF5nWsK=cSg@mail.gmail.com> |
On Fri, Aug 14, 2026 at 3:41 PM Ruoyu Wang <[email protected]> wrote: > The first user of the MPU-3050 data-ready trigger takes a runtime PM > reference before configuring the FIFO, sample engine and interrupt. If > any of those operations fails, iio_trigger_attach_poll_func() tears down > its IRQ resources without calling set_trigger_state(false). The buffer > error path then releases only its preenable reference, leaving the > trigger's reference held and preventing runtime suspend. > > Use pm_runtime_resume_and_get() so a resume failure does not leave a > usage count behind. Route later setup failures through a common unwind > that clears hw_irq_trigger and drops the trigger's reference. Successful > enable and disable behavior is unchanged. > > This issue was found by a static analysis checker and confirmed by > manual source review. > > Fixes: f11d59d87b8622 ("iio: Move attach/detach of the poll func to the core") > Signed-off-by: Ruoyu Wang <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Yours, Linus Walleij