Re: [PATCH 0/3 3/3] auxdisplay: max6959: fix work initialization race and convert to devm_linedisp_register()
From: Andy Shevchenko
Date: Wed Aug 19 2026 - 03:52:55 EST
On Wed, Aug 19, 2026 at 08:15:56AM +0530, kr494167@xxxxxxxxx wrote:
> INIT_DELAYED_WORK(&priv->work, max6959_disp_update) was previously called
> inside max6959_linedisp_get_map_type(), which is invoked during/after
> linedisp_register(). Initializing a delayed_work structure inside a map
> query callback can re-initialize an active work item or race with
> max6959_linedisp_update().
>
> In addition, max6959_i2c_remove() called cancel_delayed_work_sync() before
> linedisp_unregister(&priv->linedisp), allowing sysfs updates to
> reschedule work after cancel_delayed_work_sync() completed.
>
> Fix these by moving INIT_DELAYED_WORK() to probe(), using
> devm_add_action_or_reset() for work cancellation, and converting to
> devm_linedisp_register(). Registering devm_linedisp_register() after
> work cancellation action ensures proper LIFO teardown order, allowing
> max6959_i2c_remove() to be removed entirely.
Use devm_delayed_work_autocancel() from devm-helpers.h.
Also try to squeeze this most likely AI-assisted commit message to the point.
...
Same comment to the other fix-patch.
--
With Best Regards,
Andy Shevchenko