From: Arnd Bergmann <arnd@arndb.de>
To: Chunhe Lan <Chunhe.Lan@freescale.com>
Cc: 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: Fri, 10 Aug 2012 13:27:47 +0000 [thread overview]
Message-ID: <201208101327.47789.arnd@arndb.de> (raw)
In-Reply-To: <1344637513-29383-1-git-send-email-Chunhe.Lan@freescale.com>
On Friday 10 August 2012, Chunhe Lan wrote:
> +static inline void mmc_delay(unsigned int ms)
> +{
> + if (ms < 1000 / HZ) {
> + cond_resched();
> + mdelay(ms);
> + } else {
> + msleep(ms);
> + }
> +}
I would actually question the point in this function to start with: The
decision whether to call mdelay() or msleep() should only be based on
whether you are allowed to sleep in the caller context. The idea of
cond_resched();
mdelay(ms);
sets off alarm bells, and I would always replace that with msleep().
Arnd
next prev parent reply other threads:[~2012-08-10 13:28 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 [this message]
2012-09-21 20:52 ` Chunhe Lan
2012-09-21 12:33 ` Arnd Bergmann
2012-09-24 15:20 ` Chunhe Lan
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=201208101327.47789.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=Chunhe.Lan@freescale.com \
--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