]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.19/thermal-rcar_gen3_thermal-disable-interrupt-in-.remo.patch
d4f6cfee4785c0264e659009cb3d07e0079ee23a
[thirdparty/kernel/stable-queue.git] / queue-4.19 / thermal-rcar_gen3_thermal-disable-interrupt-in-.remo.patch
1 From acb10b0b025982c3c9283698a251d1c4414d9c3b Mon Sep 17 00:00:00 2001
2 From: Jiada Wang <jiada_wang@mentor.com>
3 Date: Wed, 24 Apr 2019 14:11:45 +0900
4 Subject: thermal: rcar_gen3_thermal: disable interrupt in .remove
5
6 [ Upstream commit 63f55fcea50c25ae5ad45af92d08dae3b84534c2 ]
7
8 Currently IRQ remains enabled after .remove, later if device is probed,
9 IRQ is requested before .thermal_init, this may cause IRQ function be
10 called before device is initialized.
11
12 this patch disables interrupt in .remove, to ensure irq function
13 only be called after device is fully initialized.
14
15 Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
16 Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
17 Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org>
18 Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
19 Signed-off-by: Sasha Levin <sashal@kernel.org>
20 ---
21 drivers/thermal/rcar_gen3_thermal.c | 3 +++
22 1 file changed, 3 insertions(+)
23
24 diff --git a/drivers/thermal/rcar_gen3_thermal.c b/drivers/thermal/rcar_gen3_thermal.c
25 index 7aed5337bdd3..704c8ad045bb 100644
26 --- a/drivers/thermal/rcar_gen3_thermal.c
27 +++ b/drivers/thermal/rcar_gen3_thermal.c
28 @@ -328,6 +328,9 @@ MODULE_DEVICE_TABLE(of, rcar_gen3_thermal_dt_ids);
29 static int rcar_gen3_thermal_remove(struct platform_device *pdev)
30 {
31 struct device *dev = &pdev->dev;
32 + struct rcar_gen3_thermal_priv *priv = dev_get_drvdata(dev);
33 +
34 + rcar_thermal_irq_set(priv, false);
35
36 pm_runtime_put(dev);
37 pm_runtime_disable(dev);
38 --
39 2.20.1
40