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

- From: Arnd Bergmann \<arnd@arndb.de\>
- Date: 2012-09-21 12:34:04 
- List: linuxppc-dev
- Page: https://ratatoskr.run/linuxppc-dev/2012/09/9471343
- Thread: https://ratatoskr.run/linux-mmc/2012/08/9470758/t.md

```text
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.

	Arnd
```
