Linux-Renesas-SoC Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] thermal: rcar_thermal: Use usleep_range() instead of udelay()
@ 2020-01-15 12:54 Geert Uytterhoeven
  2020-01-15 13:17 ` Daniel Lezcano
  0 siblings, 1 reply; 2+ messages in thread
From: Geert Uytterhoeven @ 2020-01-15 12:54 UTC (permalink / raw)
  To: Zhang Rui, Daniel Lezcano, Amit Kucheria, Kuninori Morimoto
  Cc: Niklas Söderlund, linux-pm, linux-renesas-soc, Geert Uytterhoeven

rcar_thermal_update_temp() takes a mutex, so it is always called in a
context that can sleep.  Hence replace the 300 µs busy loop by a call to
usleep_range(), to allow other threads to run.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/thermal/rcar_thermal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
index d0873de718da9218..a8dd96d2d24c4ce5 100644
--- a/drivers/thermal/rcar_thermal.c
+++ b/drivers/thermal/rcar_thermal.c
@@ -219,7 +219,7 @@ static int rcar_thermal_update_temp(struct rcar_thermal_priv *priv)
 		 * to get stable temperature.
 		 * see "Usage Notes" on datasheet
 		 */
-		udelay(300);
+		usleep_range(300, 400);
 
 		new = rcar_thermal_read(priv, THSSR) & CTEMP;
 		if (new == old) {
-- 
2.17.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] thermal: rcar_thermal: Use usleep_range() instead of udelay()
  2020-01-15 12:54 [PATCH] thermal: rcar_thermal: Use usleep_range() instead of udelay() Geert Uytterhoeven
@ 2020-01-15 13:17 ` Daniel Lezcano
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Lezcano @ 2020-01-15 13:17 UTC (permalink / raw)
  To: Geert Uytterhoeven, Zhang Rui, Amit Kucheria, Kuninori Morimoto
  Cc: Niklas Söderlund, linux-pm, linux-renesas-soc

On 15/01/2020 13:54, Geert Uytterhoeven wrote:
> rcar_thermal_update_temp() takes a mutex, so it is always called in a
> context that can sleep.  Hence replace the 300 µs busy loop by a call to
> usleep_range(), to allow other threads to run.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
>  drivers/thermal/rcar_thermal.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
> index d0873de718da9218..a8dd96d2d24c4ce5 100644
> --- a/drivers/thermal/rcar_thermal.c
> +++ b/drivers/thermal/rcar_thermal.c
> @@ -219,7 +219,7 @@ static int rcar_thermal_update_temp(struct rcar_thermal_priv *priv)
>  		 * to get stable temperature.
>  		 * see "Usage Notes" on datasheet
>  		 */
> -		udelay(300);
> +		usleep_range(300, 400);
>  
>  		new = rcar_thermal_read(priv, THSSR) & CTEMP;
>  		if (new == old) {
> 

Applied to the testing branch. If there is no problem it will be merged
to the linux-next branch.

  -- Daniel

-- 
 <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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-15 12:54 [PATCH] thermal: rcar_thermal: Use usleep_range() instead of udelay() Geert Uytterhoeven
2020-01-15 13:17 ` Daniel Lezcano

Linux-Renesas-SoC Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-renesas-soc/0 linux-renesas-soc/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-renesas-soc linux-renesas-soc/ https://lore.kernel.org/linux-renesas-soc \
		linux-renesas-soc@vger.kernel.org
	public-inbox-index linux-renesas-soc

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-renesas-soc


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git