Skip to content

Commit e72ccd4

Browse files
committed
PM: sleep: Drop superfluous might_sleep() calls
JIRA: https://issues.redhat.com/browse/RHEL-109251 commit 5e8be76 Author: Zhongqiu Han <quic_zhonhan@quicinc.com> Date: Thu, 03 Jul 2025 16:34:34 +0000 Drop superfluous might_sleep() calls from dpm_resume(), dpm_complete(), and dpm_prepare(). These functions already invoke primitives that implicitly check for sleep in atomic context: - dpm_resume() and dpm_complete() invoke mutex_lock(), which internally triggers might_sleep(). - dpm_prepare() calls wait_for_device_probe(), which internally uses flush_work(), and thus might_sleep(). These annotations are unnecessary and can be dropped to reduce clutter. Signed-off-by: Zhongqiu Han <quic_zhonhan@quicinc.com> Link: https://patch.msgid.link/20250617084650.341262-1-quic_zhonhan@quicinc.com Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Mark Langsdorf <mlangsdo@redhat.com>
1 parent 1f49a55 commit e72ccd4

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

drivers/base/power/main.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,7 +1109,6 @@ void dpm_resume(pm_message_t state)
11091109
ktime_t starttime = ktime_get();
11101110

11111111
trace_suspend_resume(TPS("dpm_resume"), state.event, true);
1112-
might_sleep();
11131112

11141113
pm_transition = state;
11151114
async_error = 0;
@@ -1212,7 +1211,6 @@ void dpm_complete(pm_message_t state)
12121211
struct list_head list;
12131212

12141213
trace_suspend_resume(TPS("dpm_complete"), state.event, true);
1215-
might_sleep();
12161214

12171215
INIT_LIST_HEAD(&list);
12181216
mutex_lock(&dpm_list_mtx);
@@ -2123,7 +2121,6 @@ int dpm_prepare(pm_message_t state)
21232121
int error = 0;
21242122

21252123
trace_suspend_resume(TPS("dpm_prepare"), state.event, true);
2126-
might_sleep();
21272124

21282125
/*
21292126
* Give a chance for the known devices to complete their probes, before

0 commit comments

Comments
 (0)