From: Nicholas Mc Guire <der.herr@hofr.at>
To: Mark Brown <broonie@kernel.org>
Cc: Nicholas Mc Guire <hofrat@osadl.org>,
Bard Liao <bardliao@realtek.com>,
Oder Chiou <oder_chiou@realtek.com>,
Liam Girdwood <lgirdwood@gmail.com>,
Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ASoC: rt5651: use msleep for large delays
Date: Wed, 11 Jan 2017 15:06:45 +0000 [thread overview]
Message-ID: <20170111150645.GB16045@osadl.at> (raw)
In-Reply-To: <20170111145926.22jkebrb7ojemyhq@sirena.org.uk>
On Wed, Jan 11, 2017 at 02:59:26PM +0000, Mark Brown wrote:
> On Wed, Jan 11, 2017 at 12:49:36PM +0100, Nicholas Mc Guire wrote:
>
> > if (!rt5651->hp_mute)
> > - usleep_range(80000, 85000);
> > + msleep(85);
>
> If you're doing conversions like this I'd expect us to be picking the
> lower number rather than the higher number - people are saying "wait for
> at least X and at most Y" and msleep() is "wait for at least X" so we
> should be picking X.
useleep_range() sets the timer to max and only if there happens to be a
timer between min and max uses that - so the mean of runs is generally
a bit above max. E.g.
usleep_range(*,200) 5000 samples - idle system
100,200 190,200
Min. :188481 Min. :197793
1st Qu.:207062 1st Qu.:207051
Median :207139 Median :207133
Mean :207254 Mean :207244
3rd Qu.:207341 3rd Qu.:207610
Max. :225340 Max. :214885
So to keep the behavior as close to the current code as possible
it seemed better to select the upper value.
Am I missing something ?
thx!
hofrat
next prev parent reply other threads:[~2017-01-11 15:07 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-11 11:49 Nicholas Mc Guire
2017-01-11 11:55 ` Joe Perches
2017-01-11 12:01 ` Nicholas Mc Guire
2017-01-11 14:59 ` Mark Brown
2017-01-11 15:06 ` Nicholas Mc Guire [this message]
2017-01-11 18:06 ` Mark Brown
2017-01-11 18:59 ` Nicholas Mc Guire
2017-01-12 15:04 ` Mark Brown
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=20170111150645.GB16045@osadl.at \
--to=der.herr@hofr.at \
--cc=alsa-devel@alsa-project.org \
--cc=bardliao@realtek.com \
--cc=broonie@kernel.org \
--cc=hofrat@osadl.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=oder_chiou@realtek.com \
--cc=perex@perex.cz \
--cc=tiwai@suse.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
all inboxes | Powered by JetHome®