From: Chunhe Lan <b25806@freescale.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Chunhe Lan <Chunhe.Lan@freescale.com>,
linux-mmc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
kumar.gala@freescale.com, cjb@laptop.org,
Kumar Gala <galak@kernel.crashing.org>
Subject: Re: [PATCH v3 1/2] mmc: Move mmc_delay() to include/linux/mmc/core.h
Date: Mon, 24 Sep 2012 11:20:58 -0400 [thread overview]
Message-ID: <50607A5A.3060103@freescale.com> (raw)
In-Reply-To: <201209211233.54545.arnd@arndb.de>
On 09/21/2012 08:33 AM, Arnd Bergmann wrote:
> On Friday 21 September 2012, Chunhe Lan wrote:
>> On 08/10/2012 09:27 AM, Arnd Bergmann wrote:
>>> On Friday 10 August 2012, Chunhe Lan wrote:
>>>
>>> cond_resched();
>>> mdelay(ms);
>>>
>>> sets off alarm bells, and I would always replace that with msleep().
>> I think that it does not replace with msleep().
>> When the time of sleep is very short, program should not been scheduled
>> in the context. Because it expends the more time.
>>
> A time measured in miliseconds is never "very short" for the scheduler,
> a lot of things can happen during that time span. The code I quoted
> also does not care too much about accuracy, otherwise it would adapt
> the time in the mdelay based on whether the cond_resched() actually
> schedules to another thread.
OK. As you have mentioned, it would been modified to such:
static inline void mmc_delay(unsigned int ms)
{
if (ms < 1000 / HZ) {
cond_resched();
msleep(ms);
} else {
msleep(ms);
}
}
OR such:
static inline void mmc_delay(unsigned int ms)
{
msleep(ms);
}
OR other code?
Thanks,
Chunhe
>
> Arnd
>
next prev parent reply other threads:[~2012-09-24 3:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-10 22:25 [PATCH v3 1/2] mmc: Move mmc_delay() to include/linux/mmc/core.h Chunhe Lan
2012-08-10 13:27 ` Arnd Bergmann
2012-09-21 20:52 ` Chunhe Lan
2012-09-21 12:33 ` Arnd Bergmann
2012-09-24 15:20 ` Chunhe Lan [this message]
2012-09-24 13:17 ` Arnd Bergmann
2012-09-24 14:38 ` Tabi Timur-B04825
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=50607A5A.3060103@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=kumar.gala@freescale.com \
--cc=linux-mmc@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.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