Re: [PATCH] driver core: remove polling for driver_probe_done(v2)

From: Ming Lei
Date: Fri Jan 30 2009 - 04:59:19 EST


2009/1/30 Arjan van de Ven <arjan@xxxxxxxxxxxxx>:
> On Fri, 30 Jan 2009 10:31:42 +0800
> tom.leiming@xxxxxxxxx wrote:
>
>> From: Ming Lei <tom.leiming@xxxxxxxxx>
>>
>> This patch renames driver_probe_done to driver_wait_probe_done,
>> and make it wait on condition of probing done to remove
>> polling for it in fs initialization. Also add
>> driver_wait_probe_done_and_dev_appear(name) to allow callers
>> to wait until all probing is done AND until the device @name
>> exists.
>
>> /**
>> + * driver_wait_probe_done_and_dev_appear
>> + * wait until the probe sequence is finished _and_ the dev @name
>> appears.
>
> Hi,
>
> sorry to be the bad guy, but I think you turned the "either one" into a
> "both".... so this isn't going to work ;(

IMHO, it will msleep if either one is ture, so we turn this into
return( not sleep) if both are false.
( eg, A||B->C <=> ~C->~A&&~B ) :-)

while (driver_probe_done() != 0 ||
(ROOT_DEV = name_to_dev_t(saved_root_name)) == 0)
msleep(100);
here:
driver_probe_done() == 0 && name_to_dev_t(saved_root_name)

===>

driver_wait_probe_done_and_dev_appear(name)
{
if (driver_probe_done() == 0 &&
(ROOT_DEV = name_to_dev_t(saved_root_name)))
return;
else
schedule();
}

Thanks!

>
> unless I'm just too tired and miss something subtle, but I am pretty
> sure DeMorgan does not work this way :)
>
>
> --
> Arjan van de Ven Intel Open Source Technology Centre
> For development, discussion and tips for power savings,
> visit http://www.lesswatts.org
>



--
Lei Ming
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/