Hi, On 5/3/24 5:43 AM, Andy Shevchenko wrote: > On Fri, May 3, 2024 at 12:14 AM Hans de Goede <hdegoede@xxxxxxxxxx> wrote: >> >> The mutex must be initialized before the LED class device is registered >> otherwise there is a race where it may get used before it is initialized: >> >> DEBUG_LOCKS_WARN_ON(lock->magic != lock) >> WARNING: CPU: 2 PID: 2045 at kernel/locking/mutex.c:587 __mutex_lock >> ... >> RIP: 0010:__mutex_lock+0x7db/0xc10 >> ... >> set_brightness_delayed_set_brightness.part.0+0x17/0x60 >> set_brightness_delayed+0xf1/0x100 >> process_one_work+0x222/0x5a0 > > ... > >> + mutex_init(&chip->mutex); > > devm_mutex_init() ? That is not in Torvald's tree yet. Regards, Hans