Skip to content
Snippets Groups Projects
Commit 32ce5d87 authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman
Browse files

bus: simple-pm-bus: fix forced runtime PM use


The simple-pm-bus driver only enables runtime PM for some buses
('simple-pm-bus') yet has started calling pm_runtime_force_suspend() and
pm_runtime_force_resume() during system suspend unconditionally.

This currently works, but that is not obvious and depends on
implementation details which may change at some point.

Add dedicated system sleep ops and only call pm_runtime_force_suspend()
and pm_runtime_force_resume() for buses that use runtime PM to avoid any
future surprises.

Fixes: c4583930 ("drivers: bus: simple-pm-bus: Use clocks")
Cc: Liu Ying <victor.liu@nxp.com>
Signed-off-by: default avatarJohan Hovold <johan+linaro@kernel.org>
Reviewed-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
Acked-by: default avatarLiu Ying <victor.liu@nxp.com>
Acked-by: default avatarRafael J. Wysocki <rafael@kernel.org>
Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20250214102130.3000-1-johan+linaro@kernel.org


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6d991f56
No related branches found
No related tags found
No related merge requests found
......@@ -109,9 +109,29 @@ static int simple_pm_bus_runtime_resume(struct device *dev)
return 0;
}
static int simple_pm_bus_suspend(struct device *dev)
{
struct simple_pm_bus *bus = dev_get_drvdata(dev);
if (!bus)
return 0;
return pm_runtime_force_suspend(dev);
}
static int simple_pm_bus_resume(struct device *dev)
{
struct simple_pm_bus *bus = dev_get_drvdata(dev);
if (!bus)
return 0;
return pm_runtime_force_resume(dev);
}
static const struct dev_pm_ops simple_pm_bus_pm_ops = {
RUNTIME_PM_OPS(simple_pm_bus_runtime_suspend, simple_pm_bus_runtime_resume, NULL)
NOIRQ_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
NOIRQ_SYSTEM_SLEEP_PM_OPS(simple_pm_bus_suspend, simple_pm_bus_resume)
};
#define ONLY_BUS ((void *) 1) /* Match if the device is only a bus. */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment