public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Matthias Kaehlcke <mka@chromium.org>
To: Brian Norris <briannorris@chromium.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] regulator: core: Sleep (not delay) in set_voltage()
Date: Mon, 18 Apr 2022 15:50:29 -0700	[thread overview]
Message-ID: <Yl3rNeaYTz0CPjmL@google.com> (raw)
In-Reply-To: <20220418141158.1.If0fc61a894f537b052ca41572aff098cf8e7e673@changeid>

On Mon, Apr 18, 2022 at 02:12:39PM -0700, Brian Norris wrote:
> These delays can be relatively large (e.g., hundreds of microseconds on
> RK3399 Gru systems). Per Documentation/timers/timers-howto.rst, that
> should usually use a sleeping delay. Let's use fsleep() to handle both
> large and small delays appropriately. This avoids burning a bunch of CPU
> time and hurting scheduling latencies when hitting regulators a lot
> (e.g., during cpufreq).
> 
> The sleep vs. delay issue choice has been made differently over time --
> early versions of RK3399 Gru PWM-regulator support used usleep_range()
> in pwm-regulator.c. More of this got moved into the regulator core,
> in commits like:
> 
> 73e705bf81ce regulator: core: Add set_voltage_time op
> 
> At the same time, the sleep turned into a delay.
> 
> It's OK to sleep here, as we aren't in an atomic contexts. (All our
> callers grab various mutexes already.)
> 
> Signed-off-by: Brian Norris <briannorris@chromium.org>

Reviewed-by: Matthias Kaehlcke <mka@chromium.org>

      parent reply	other threads:[~2022-04-18 22:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-18 21:12 [PATCH 1/2] regulator: core: Sleep (not delay) in set_voltage() Brian Norris
2022-04-18 21:12 ` [PATCH 2/2] regulator: core: Replace _regulator_enable_delay() with fsleep() Brian Norris
2022-04-18 22:53   ` Matthias Kaehlcke
2022-04-20 16:28   ` Mark Brown
2022-04-20 18:24     ` Brian Norris
2022-04-20 21:11       ` Mark Brown
2022-04-18 22:50 ` Matthias Kaehlcke [this message]

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=Yl3rNeaYTz0CPjmL@google.com \
    --to=mka@chromium.org \
    --cc=briannorris@chromium.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.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