Skip to content

Commit 0491f3f

Browse files
Xuewen Yanrafaeljw
authored andcommitted
PM: sleep: core: Avoid bit field races related to work_in_progress
In all of the system suspend transition phases, the async processing of a device may be carried out in parallel with power.work_in_progress updates for the device's parent or suppliers and if it touches bit fields from the same group (for example, power.must_resume or power.wakeup_path), bit field corruption is possible. To avoid that, turn work_in_progress in struct dev_pm_info into a proper bool field and relocate it to save space. Fixes: aa7a927 ("PM: sleep: Suspend async parents after suspending children") Fixes: 443046d ("PM: sleep: Make suspend of devices more asynchronous") Signed-off-by: Xuewen Yan <xuewen.yan@unisoc.com> Closes: https://lore.kernel.org/linux-pm/20260203063459.12808-1-xuewen.yan@unisoc.com/ Cc: All applicable <stable@vger.kernel.org> [ rjw: Added subject and changelog ] Link: https://patch.msgid.link/CAB8ipk_VX2VPm706Jwa1=8NSA7_btWL2ieXmBgHr2JcULEP76g@mail.gmail.com Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 5c9ecd8 commit 0491f3f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

include/linux/pm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,10 +681,10 @@ struct dev_pm_info {
681681
struct list_head entry;
682682
struct completion completion;
683683
struct wakeup_source *wakeup;
684+
bool work_in_progress; /* Owned by the PM core */
684685
bool wakeup_path:1;
685686
bool syscore:1;
686687
bool no_pm_callbacks:1; /* Owned by the PM core */
687-
bool work_in_progress:1; /* Owned by the PM core */
688688
bool smart_suspend:1; /* Owned by the PM core */
689689
bool must_resume:1; /* Owned by the PM core */
690690
bool may_skip_resume:1; /* Set by subsystems */

0 commit comments

Comments
 (0)