devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: Amjad Ouled-Ameur <aouledameur@baylibre.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Amit Kucheria <amitk@kernel.org>, Zhang Rui <rui.zhang@intel.com>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org,
	Fabien Parent <fparent@baylibre.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	AngeloGioacchino Del Regno 
	<angelogioacchino.delregno@collabora.com>,
	Rob Herring <robh@kernel.org>,
	Markus Schneider-Pargmann <msp@baylibre.com>,
	Hsin-Yi Wang <hsinyi@chromium.org>,
	Michael Kao <michael.kao@mediatek.com>
Subject: Re: [PATCH v9 5/5] thermal: mediatek: add delay after thermal banks initialization
Date: Fri, 27 Jan 2023 22:03:51 +0100	[thread overview]
Message-ID: <7a01c3f6-3800-472e-e18f-82af1b3f8d9e@linaro.org> (raw)
In-Reply-To: <20221018-up-i350-thermal-bringup-v9-5-55a1ae14af74@baylibre.com>

On 27/01/2023 16:44, Amjad Ouled-Ameur wrote:
> Thermal sensor reads performed immediately after thermal bank
> initialization returns bogus values. This is currently tackled by returning
> 0 if the temperature is bogus (exceeding 200000).
> 
> Instead, add a delay between the bank init and the thermal zone device
> register to properly fix this.
> 
> Signed-off-by: Michael Kao <michael.kao@mediatek.com>
> Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
> Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>
> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> ---
>   drivers/thermal/mtk_thermal.c | 11 +++--------
>   1 file changed, 3 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/thermal/mtk_thermal.c b/drivers/thermal/mtk_thermal.c
> index b8e06f6c7c42..ab7db385afb3 100644
> --- a/drivers/thermal/mtk_thermal.c
> +++ b/drivers/thermal/mtk_thermal.c
> @@ -730,14 +730,6 @@ static int mtk_thermal_bank_temperature(struct mtk_thermal_bank *bank)
>   
>   		temp = mt->raw_to_mcelsius(mt, 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)
>   			max = temp;
>   	}
> @@ -1160,6 +1152,9 @@ static int mtk_thermal_probe(struct platform_device *pdev)
>   
>   	platform_set_drvdata(pdev, mt);
>   
> +	// Delay for thermal banks to be ready

Coding style for comments is : /* */

No need to resend, I'll take care of changing the comment format.

> +	msleep(30);
> +
>   	tzdev = devm_thermal_of_zone_register(&pdev->dev, 0, mt,
>   					      &mtk_thermal_ops);
>   	if (IS_ERR(tzdev)) {
> 

-- 
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog


  reply	other threads:[~2023-01-27 21:04 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-27 15:44 [PATCH v9 0/5] thermal: mediatek: Add support for MT8365 SoC Amjad Ouled-Ameur
2023-01-27 15:44 ` [PATCH v9 1/5] dt-bindings: thermal: mediatek: add binding documentation " Amjad Ouled-Ameur
2023-01-27 15:44 ` [PATCH v9 2/5] thermal: mediatek: control buffer enablement tweaks Amjad Ouled-Ameur
2023-01-27 21:48   ` Daniel Lezcano
2023-01-27 22:21     ` Amjad Ouled-Ameur
2023-01-28  7:52       ` Daniel Lezcano
2023-03-09 17:14     ` Amjad Ouled-Ameur
2023-01-27 15:44 ` [PATCH v9 3/5] thermal: mediatek: add support for MT8365 SoC Amjad Ouled-Ameur
2023-01-27 15:44 ` [PATCH v9 4/5] thermal: mediatek: add callback for raw to mcelsius conversion Amjad Ouled-Ameur
2023-01-27 21:56   ` Daniel Lezcano
2023-01-27 15:44 ` [PATCH v9 5/5] thermal: mediatek: add delay after thermal banks initialization Amjad Ouled-Ameur
2023-01-27 21:03   ` Daniel Lezcano [this message]
2023-01-27 21:59 ` [PATCH v9 0/5] thermal: mediatek: Add support for MT8365 SoC Daniel Lezcano
2023-01-27 22:23   ` Amjad Ouled-Ameur
2023-03-06 10:13   ` Amjad Ouled-Ameur
2023-03-08 18:00     ` Daniel Lezcano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7a01c3f6-3800-472e-e18f-82af1b3f8d9e@linaro.org \
    --to=daniel.lezcano@linaro.org \
    --cc=amitk@kernel.org \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=aouledameur@baylibre.com \
    --cc=devicetree@vger.kernel.org \
    --cc=fparent@baylibre.com \
    --cc=hsinyi@chromium.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=matthias.bgg@gmail.com \
    --cc=michael.kao@mediatek.com \
    --cc=msp@baylibre.com \
    --cc=rafael@kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=robh@kernel.org \
    --cc=rui.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).