lkml.org 
[lkml]   [2011]   [Jan]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH -v3 1/4] pci, usb: Make usb handoff func all take base remapping
On 01/10/2011 09:21 PM, Benjamin Herrenschmidt wrote:
> On Mon, 2011-01-10 at 17:20 -0800, Yinghai Lu wrote:
>>
>> for early access, can not use udelay yet, it will take some one.
>> Also msleep will cause crash, because it needs scheduler there.
>
> Right, and that's for such special cases (hopefully rare) that we have
> system_state... Much better than your function pointers I reckon.

system_state does not work.
it only have BOOTING and RUNNING ...
RUNNING is set in init/main.c::init_post().
so early_quirk and pci_quirk all with BOOTING stage...

slab_is_available() could be used, but looks alike abuse.

>
> We could even wrap it into a safe_delay() function or whatever (in fact
> why not make msleep() itself safe ? It's not like it was timing critical
> code :-)

like
void safe_udelay(unsigned long usecs)
{
if (slab_is_available())
udelay(usecs)
else
early_udelay(usecs);
}

or wonder if you are happy with

void __weak safe_udelay(unsigned long usecs)
{
udelay(usecs);
}

and will have x86 have it's own safe_udelay...


Yinghai


\
 
 \ /
  Last update: 2011-01-11 07:39    [W:0.185 / U:0.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site