diff mbox series

[1/3] thermal: rcar_thermal: Prevent hardware access during system suspend

Message ID 20180927113235.30354-2-geert+renesas@glider.be (mailing list archive)
State Superseded
Delegated to: Geert Uytterhoeven
Headers show
Series thermal: Fix workqueue-related issues in drivers | expand

Commit Message

Geert Uytterhoeven Sept. 27, 2018, 11:32 a.m. UTC
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>
---
 drivers/thermal/rcar_thermal.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Niklas Söderlund Sept. 28, 2018, 8:51 a.m. UTC | #1
Hi Geert,

Thanks for your patch.

On 2018-09-27 13:32:33 +0200, Geert Uytterhoeven wrote:
> 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>

> ---
>  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 78f932822d381c9d..ea132e122b174757 100644
> --- a/drivers/thermal/rcar_thermal.c
> +++ b/drivers/thermal/rcar_thermal.c
> @@ -434,8 +434,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.17.1
>
diff mbox series

Patch

diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
index 78f932822d381c9d..ea132e122b174757 100644
--- a/drivers/thermal/rcar_thermal.c
+++ b/drivers/thermal/rcar_thermal.c
@@ -434,8 +434,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));
 		}
 	}