]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
PM: runtime: Drop status check from pm_runtime_force_resume()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 27 Feb 2025 10:56:12 +0000 (11:56 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 3 Mar 2025 12:43:21 +0000 (13:43 +0100)
Since pm_runtime_force_resume() requires pm_runtime_force_suspend() to
be called before it on the same device, the runtime PM status of the
device is RPM_SUSPENDED when it is called unless the device's runtime
PM status is changed somewhere else in the meantime.

However, even if that happens, the power.needs_force_resume
check is still required to pass and that flag is only set by
pm_runtime_force_suspend() once and it is cleared at the end of
pm_runtime_force_resume(), so it cannot be taken into account
twice in a row.

According to the above, the pm_runtime_status_suspended(dev) check in
pm_runtime_force_resume() is redundant, so drop it.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Link: https://patch.msgid.link/2309120.iZASKD2KPV@rjwysocki.net
drivers/base/power/runtime.c

index a5aed89e1a6b857e3e3bba926640d96eabfca297..1714358b541e8a96a815aad27b67b367e0a0ecea 100644 (file)
@@ -1945,7 +1945,7 @@ int pm_runtime_force_resume(struct device *dev)
        int (*callback)(struct device *);
        int ret = 0;
 
-       if (!pm_runtime_status_suspended(dev) || !dev->power.needs_force_resume)
+       if (!dev->power.needs_force_resume)
                goto out;
 
        /*