Thread (7 messages) flat view 7 messages, 4 authors, 2012-09-24

Re: [PATCH v3 1/2] mmc: Move mmc_delay() to include/linux/mmc/core.h

From: Chunhe Lan <hidden>
Date: 2012-09-21 08:50:25
Also in: linux-mmc

On 08/10/2012 09:27 AM, Arnd Bergmann wrote:
On Friday 10 August 2012, Chunhe Lan wrote:
quoted
+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().
     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.

     Thanks,
     Chunhe
	Arnd
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help