* [PATCH AUTOSEL 4.14 046/150] PM / Domains: Deal with multiple states but no governor in genpd
[not found] <20191116154729.9573-1-sashal@kernel.org>
@ 2019-11-16 15:45 ` Sasha Levin
2019-11-16 15:46 ` [PATCH AUTOSEL 4.14 074/150] thermal: rcar_thermal: Prevent hardware access during system suspend Sasha Levin
1 sibling, 0 replies; 2+ messages in thread
From: Sasha Levin @ 2019-11-16 15:45 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Ulf Hansson, Lina Iyer, Rafael J . Wysocki, Sasha Levin, linux-pm
From: Ulf Hansson <ulf.hansson@linaro.org>
[ Upstream commit 2c9b7f8772033cc8bafbd4eefe2ca605bf3eb094 ]
A caller of pm_genpd_init() that provides some states for the genpd via the
->states pointer in the struct generic_pm_domain, should also provide a
governor. This because it's the job of the governor to pick a state that
satisfies the constraints.
Therefore, let's print a warning to inform the user about such bogus
configuration and avoid to bail out, by instead picking the shallowest
state before genpd invokes the ->power_off() callback.
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Lina Iyer <ilina@codeaurora.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/base/power/domain.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index c276ba1c0a19e..e811f24148897 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -369,6 +369,10 @@ static int genpd_power_off(struct generic_pm_domain *genpd, bool one_dev_on,
return -EAGAIN;
}
+ /* Default to shallowest state. */
+ if (!genpd->gov)
+ genpd->state_idx = 0;
+
if (genpd->power_off) {
int ret;
@@ -1598,6 +1602,8 @@ int pm_genpd_init(struct generic_pm_domain *genpd,
ret = genpd_set_default_power_state(genpd);
if (ret)
return ret;
+ } else if (!gov) {
+ pr_warn("%s : no governor for states\n", genpd->name);
}
mutex_lock(&gpd_list_lock);
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH AUTOSEL 4.14 074/150] thermal: rcar_thermal: Prevent hardware access during system suspend
[not found] <20191116154729.9573-1-sashal@kernel.org>
2019-11-16 15:45 ` [PATCH AUTOSEL 4.14 046/150] PM / Domains: Deal with multiple states but no governor in genpd Sasha Levin
@ 2019-11-16 15:46 ` Sasha Levin
1 sibling, 0 replies; 2+ messages in thread
From: Sasha Levin @ 2019-11-16 15:46 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Geert Uytterhoeven, Niklas Söderlund, Eduardo Valentin,
Sasha Levin, linux-pm
From: Geert Uytterhoeven <geert+renesas@glider.be>
[ Upstream commit 3a31386217628ffe2491695be2db933c25dde785 ]
On r8a7791/koelsch, sometimes the following message is printed during
system suspend:
rcar_thermal e61f0000.thermal: thermal sensor was broken
This happens if the workqueue runs while the device is already
suspended. Fix this by using the freezable system workqueue instead,
cfr. commit 51e20d0e3a60cf46 ("thermal: Prevent polling from happening
during system suspend").
Fixes: e0a5172e9eec7f0d ("thermal: rcar: add interrupt support")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/thermal/rcar_thermal.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
index 73e5fee6cf1d5..83126e2dce36d 100644
--- a/drivers/thermal/rcar_thermal.c
+++ b/drivers/thermal/rcar_thermal.c
@@ -401,8 +401,8 @@ static irqreturn_t rcar_thermal_irq(int irq, void *data)
rcar_thermal_for_each_priv(priv, common) {
if (rcar_thermal_had_changed(priv, status)) {
rcar_thermal_irq_disable(priv);
- schedule_delayed_work(&priv->work,
- msecs_to_jiffies(300));
+ queue_delayed_work(system_freezable_wq, &priv->work,
+ msecs_to_jiffies(300));
}
}
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-11-16 16:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20191116154729.9573-1-sashal@kernel.org>
2019-11-16 15:45 ` [PATCH AUTOSEL 4.14 046/150] PM / Domains: Deal with multiple states but no governor in genpd Sasha Levin
2019-11-16 15:46 ` [PATCH AUTOSEL 4.14 074/150] thermal: rcar_thermal: Prevent hardware access during system suspend Sasha Levin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).