Commit 0a677eea authored by AngeloGioacchino Del Regno's avatar AngeloGioacchino Del Regno Committed by Daniel Lezcano

Revert "thermal/drivers/mediatek: Add delay after thermal banks initialization"

Some more testing revealed that this commit introduces a regression on some
MT8173 Chromebooks and at least on one MT6795 Sony Xperia M5 smartphone due
to the delay being apparently variable and machine specific.

Another solution would be to delay for a bit more (~70ms) but this is not
feasible for two reasons: first of all, we're adding an even bigger delay
in a probe function; second, some machines need less, some may need even
more, making the msleep at probe solution highly suboptimal.

This reverts commit 10debf8c.

Fixes: 10debf8c ("thermal/drivers/mediatek: Add delay after thermal banks initialization")
Reported-by: default avatar"kernelci.org bot" <bot@kernelci.org>
Signed-off-by: default avatarAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20230419061146.22246-2-angelogioacchino.delregno@collabora.com
parent 2912d341
...@@ -816,6 +816,14 @@ static int mtk_thermal_bank_temperature(struct mtk_thermal_bank *bank) ...@@ -816,6 +816,14 @@ static int mtk_thermal_bank_temperature(struct mtk_thermal_bank *bank)
mt, conf->bank_data[bank->id].sensors[i], raw); mt, conf->bank_data[bank->id].sensors[i], raw);
/*
* The first read of a sensor often contains very high bogus
* temperature value. Filter these out so that the system does
* not immediately shut down.
*/
if (temp > 200000)
temp = 0;
if (temp > max) if (temp > max)
max = temp; max = temp;
} }
...@@ -1273,9 +1281,6 @@ static int mtk_thermal_probe(struct platform_device *pdev) ...@@ -1273,9 +1281,6 @@ static int mtk_thermal_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, mt); platform_set_drvdata(pdev, mt);
/* Delay for thermal banks to be ready */
msleep(30);
tzdev = devm_thermal_of_zone_register(&pdev->dev, 0, mt, tzdev = devm_thermal_of_zone_register(&pdev->dev, 0, mt,
&mtk_thermal_ops); &mtk_thermal_ops);
if (IS_ERR(tzdev)) { if (IS_ERR(tzdev)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment