linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert+renesas@glider.be>
To: Zhang Rui <rui.zhang@intel.com>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Amit Kucheria <amit.kucheria@verdurent.com>,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: "Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>,
	linux-pm@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	"Geert Uytterhoeven" <geert+renesas@glider.be>
Subject: [PATCH] thermal: rcar_thermal: Use usleep_range() instead of udelay()
Date: Wed, 15 Jan 2020 13:54:17 +0100	[thread overview]
Message-ID: <20200115125417.5263-1-geert+renesas@glider.be> (raw)

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


             reply	other threads:[~2020-01-15 12:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-15 12:54 Geert Uytterhoeven [this message]
2020-01-15 13:17 ` [PATCH] thermal: rcar_thermal: Use usleep_range() instead of udelay() 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=20200115125417.5263-1-geert+renesas@glider.be \
    --to=geert+renesas@glider.be \
    --cc=amit.kucheria@verdurent.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=niklas.soderlund+renesas@ragnatech.se \
    --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).