Re: [PATCH v2] Input: lm8323 - drain PWM work and finish with outputs disabled
From: Dmitry Torokhov
Date: Sun Nov 15 2026 - 21:36:59 EST
Hi Hongyan,
On Sun, Nov 15, 2026 at 07:48:12PM +0800, Hongyan Xu wrote:
> A PWM brightness callback can leave private work pending when the
> managed LED and chip state are released. Merely cancelling that
> work also discards the final LED_OFF requested by LED unregister.
> Flushing alone is insufficient if an earlier fade is still
> running: the worker waits for an IRQ to requeue it, and the
> managed IRQ is released before the LEDs during teardown.
>
> Install cleanup before registering each LED. Once LED unregister
> and IRQ teardown have stopped the producers, cancel its work and
> use the documented single-END shutdown sequence: put END with
> RESET set in unused script slot 59, stop the channel and restart
> at that slot. Do not overwrite a running brightness script. The
> engine then disables its output autonomously without another IRQ
> or a worker accessing freed driver data. A current long RAMP can
> delay completion, as documented by the device specification.
>
> Found by the author's in-house static analysis tool.
>
> Fixes: a48b2d4a0091 ("Input: introduce lm8323 keypad driver")
This driver is being removed, no need to patch it.
Thanks.
--
Dmitry