lkml.org 
[lkml]   [2011]   [Jan]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH] x86: Add safe_udelay() and safe_msleep()
On 01/13/2011 04:44 PM, Greg KH wrote:
> On Thu, Jan 13, 2011 at 04:31:04PM -0800, Yinghai Lu wrote:
>> there are some udelay() in drivers/usb/early/ehci-dbgp.c
>>
>> that is for early USB debug port console support.
>>
>> We should replace them with early version udelay()
>
> Again, I fail to see why. They work fine today, right?

did not test that for a while.

from code review, we should not use udelay() that early.

in arch/x86/lib/delay.c we have
inline void __const_udelay(unsigned long xloops)
{
int d0;
xloops *= 4;
asm("mull %%edx"
:"=d" (xloops), "=&a" (d0)
:"1" (xloops), "0"
(this_cpu_read(cpu_info.loops_per_jiffy) * (HZ/4)));

__delay(++xloops);
}
EXPORT_SYMBOL(__const_udelay);
that percpu cpu_info.loops_per_jiffy only have value after smp_prepare_cpus() is called.

>
> You _really_ need to prove what you are trying to do here, with lots of
> details and descriptions of what the problem is, as it's getting a bit
> annoying...

sorry for that.

Yinghai


\
 
 \ /
  Last update: 2011-01-14 02:17    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site