linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: edubezval@gmail.com (Eduardo Valentin)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/9] thermal: rockchip: handle the power sequence for tsadc controller
Date: Thu, 28 Apr 2016 08:04:33 -0700	[thread overview]
Message-ID: <20160428150432.GA20009@localhost.localdomain> (raw)
In-Reply-To: <57216C65.5040501@gmail.com>

On Thu, Apr 28, 2016 at 09:50:29AM +0800, Caesar Wang wrote:
> 
> 
> ? 2016?04?28? 07:48, Eduardo Valentin ??:
> >On Mon, Apr 18, 2016 at 11:35:56AM +0800, Caesar Wang wrote:
> >>+		regmap_write(grf, GRF_TSADC_TESTBIT_L, GRF_TSADC_TSEN_PD_ON);
> >>+		mdelay(10);
> >>+		regmap_write(grf, GRF_TSADC_TESTBIT_L, GRF_TSADC_TSEN_PD_OFF);
> >>+		udelay(100); /* The spec note says at least 15 us */
> >>+		regmap_write(grf, GRF_SARADC_TESTBIT, GRF_SARADC_TESTBIT_ON);
> >>+		regmap_write(grf, GRF_TSADC_TESTBIT_H, GRF_TSADC_TESTBIT_H_ON);
> >>+		udelay(200); /* The spec note says at least 90 us */
> >Does it make sense to use usleep_range() instead?
> 
> I think so in the past, but I'm digging into the the udelay/usleep for
> kernel.

What do you mean by in the past? timekeeping doc still recommends the
range 10us to 20ms for usleep_range()

> 
> In general,
> 
> udelay < 10us ~100us
> mdelay > 1m, <1000ms/HZ
> usleep_range(min,max) > 100us, <20ms

even here, your udelays could be replaced by usleep_range().

Any particular reason you believe spining is better than sleeping in
your case?

> msleep > 20ms,  < 1000ms
> 
> So the udelay is suit for tsadc power sequence.
> ---
> 
> 
> Also,  we have used the mdelay(10), so it doesn't matter if use the udelay.
> After all the udelay is stable than the usleep_range.

What do you mean udelay is stable than usleep_range? usleep_range will
give the opportunity to the scheduler to coalesce wakeups. udelay is a
busyloop spin. Besides, I am not sure the current situation, but
busylooping may be affected by cpu frequency.

> 
> -Caesar
> 
> >1.9.1
> >
> >
> >
> >
> >-- 
> >Thanks,
> >Caesar

  parent reply	other threads:[~2016-04-28 15:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-18  3:35 [PATCH 0/9] thermal: rockchip: Support rk3366/rk3399 SoCS and fixes the driver Caesar Wang
2016-04-18  3:35 ` [PATCH 1/9] thermal: rockchip: disable thermal->clk in err case Caesar Wang
2016-04-18  3:35 ` [PATCH 2/9] thermal: rockchip: fixes the code_to_temp for tsadc driver Caesar Wang
2016-04-18  3:35 ` [PATCH 3/9] thermal: rockchip: update the tsadc table for rk3399 Caesar Wang
2016-04-18  3:35 ` [PATCH 4/9] thermal: rockchip: handle the power sequence for tsadc controller Caesar Wang
2016-04-27 23:48   ` Eduardo Valentin
     [not found]     ` <57216C65.5040501@gmail.com>
2016-04-28 15:04       ` Eduardo Valentin [this message]
2016-05-03  2:27         ` Caesar Wang
2016-04-18  3:35 ` [PATCH 5/9] thermal: rockchip: Support RK3366 SoCs in the thermal driver Caesar Wang
2016-04-18  3:35 ` [PATCH 6/9] thermal: rockchip: add the notes for better reading Caesar Wang
2016-04-18  3:36 ` [PATCH 8/9] thermal: rockchip: add the set_trips function Caesar Wang
2016-04-18  3:36 ` [PATCH 9/9] arm64: dts: rockchip: move the rk3368 thermal data into rk3368.dtsi Caesar Wang
2016-04-22  8:18   ` Heiko Stübner
2016-04-27 23:52 ` [PATCH 0/9] thermal: rockchip: Support rk3366/rk3399 SoCS and fixes the driver Eduardo Valentin

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=20160428150432.GA20009@localhost.localdomain \
    --to=edubezval@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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).