]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
PM: sleep: Drop superfluous might_sleep() calls
authorZhongqiu Han <quic_zhonhan@quicinc.com>
Tue, 17 Jun 2025 08:46:50 +0000 (16:46 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 3 Jul 2025 14:34:34 +0000 (16:34 +0200)
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>
drivers/base/power/main.c

index bf77d28e959fd3d6d74ba1aa55d86bce12877dc5..e6fc52b852956b427e27ae6e640be20210d87c60 100644 (file)
@@ -1095,7 +1095,6 @@ void dpm_resume(pm_message_t state)
        ktime_t starttime = ktime_get();
 
        trace_suspend_resume(TPS("dpm_resume"), state.event, true);
-       might_sleep();
 
        pm_transition = state;
        async_error = 0;
@@ -1198,7 +1197,6 @@ void dpm_complete(pm_message_t state)
        struct list_head list;
 
        trace_suspend_resume(TPS("dpm_complete"), state.event, true);
-       might_sleep();
 
        INIT_LIST_HEAD(&list);
        mutex_lock(&dpm_list_mtx);
@@ -2110,7 +2108,6 @@ int dpm_prepare(pm_message_t state)
        int error = 0;
 
        trace_suspend_resume(TPS("dpm_prepare"), state.event, true);
-       might_sleep();
 
        /*
         * Give a chance for the known devices to complete their probes, before