From: Chunhe Lan <b25806@freescale.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Chunhe Lan <Chunhe.Lan@freescale.com>,
linux-mmc@vger.kernel.org, cjb@laptop.org,
Kumar Gala <galak@kernel.crashing.org>
Subject: Re: [v4 1/2] mmc: Move mmc_delay() to include/linux/mmc/core.h
Date: Tue, 25 Dec 2012 16:13:15 +0800 [thread overview]
Message-ID: <50D9601B.1070503@freescale.com> (raw)
In-Reply-To: <201212211939.47563.arnd@arndb.de>
On 12/22/2012 03:39 AM, Arnd Bergmann wrote:
> On Friday 21 December 2012, Chunhe Lan wrote:
>> +static inline void mmc_delay(unsigned int ms)
>> +{
>> + ktime_t end = ktime_add_us(ktime_get(), ms * 1000);
>> +
>> + while (1) {
>> + s64 remaining;
>> +
>> + cond_resched();
>> + remaining = ktime_to_us(ktime_sub(end, ktime_get()));
>> + if (remaining < 0)
>> + break;
>> +
>> + udelay(min_t(u32, remaining, 100));
>> + }
>> +}
> The new logic is more accurate than the old one, but it still wastes
> a lot of energy and CPU cycles. Could you perhaps use an hrtimer to
> set the exact timeout and actually sleep?
I think that does not have to use hrtimer, and it makes a fuss.
And mmc structure has not included the hrtimer variable.
Thanks,
Chunhe
>
> Arnd
>
prev parent reply other threads:[~2012-12-25 8:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-21 9:27 [v4 1/2] mmc: Move mmc_delay() to include/linux/mmc/core.h Chunhe Lan
2012-12-21 9:28 ` [v4 2/2] mmc: Use mmc_delay() instead of mdelay() for time delay Chunhe Lan
2012-12-21 19:39 ` [v4 1/2] mmc: Move mmc_delay() to include/linux/mmc/core.h Arnd Bergmann
2012-12-25 8:13 ` Chunhe Lan [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=50D9601B.1070503@freescale.com \
--to=b25806@freescale.com \
--cc=Chunhe.Lan@freescale.com \
--cc=arnd@arndb.de \
--cc=cjb@laptop.org \
--cc=galak@kernel.crashing.org \
--cc=linux-mmc@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.