Skip to content

Commit 0a677ee

Browse files
AngeloGioacchino Del Regnodlezcano
authored andcommitted
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 10debf8. Fixes: 10debf8 ("thermal/drivers/mediatek: Add delay after thermal banks initialization") Reported-by: "kernelci.org bot" <bot@kernelci.org> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20230419061146.22246-2-angelogioacchino.delregno@collabora.com
1 parent 2912d34 commit 0a677ee

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

drivers/thermal/mediatek/auxadc_thermal.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -816,6 +816,14 @@ static int mtk_thermal_bank_temperature(struct mtk_thermal_bank *bank)
816816
mt, conf->bank_data[bank->id].sensors[i], raw);
817817

818818

819+
/*
820+
* The first read of a sensor often contains very high bogus
821+
* temperature value. Filter these out so that the system does
822+
* not immediately shut down.
823+
*/
824+
if (temp > 200000)
825+
temp = 0;
826+
819827
if (temp > max)
820828
max = temp;
821829
}
@@ -1273,9 +1281,6 @@ static int mtk_thermal_probe(struct platform_device *pdev)
12731281

12741282
platform_set_drvdata(pdev, mt);
12751283

1276-
/* Delay for thermal banks to be ready */
1277-
msleep(30);
1278-
12791284
tzdev = devm_thermal_of_zone_register(&pdev->dev, 0, mt,
12801285
&mtk_thermal_ops);
12811286
if (IS_ERR(tzdev)) {

0 commit comments

Comments
 (0)