Re: [PATCH] PM: sleep: wakeirq: harden dev_pm_clear_wake_irq() against races

From: Markus Elfring

Date: Mon Feb 02 2026 - 11:20:36 EST



> Address this by using double-checked locking. This retains the
> performance benefit of avoiding the lock when dev->power.wakeirq is
> NULL, consistent with the original logic, but adds a necessary re-check
> after acquiring dev->power.lock. Additionally, use READ_ONCE() and
> WRITE_ONCE() to annotate the shared variable accesses to avoid data races
> as defined by the kernel documentation.


How do you think about to apply lock guards in the affected function implementations?

Regards,
Markus