Re: [PATCH 1/9] Consolidate driver_probe_done() loops into one place

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Rafael J. Wysocki <rjw <at> sisk.pl> writes:

> From: Arjan van de Ven <arjan <at> linux.intel.com>
> 
> there's a few places that currently loop over driver_probe_done(), and
> I'm about to add another one. This patch abstracts it into a helper
> to reduce duplication.
[snip]
> +int wait_for_device_probe(void)
> +{
> +	/* wait for the known devices to complete their probing */
> +	while (driver_probe_done() != 0)
> +		msleep(100);
> +	async_synchronize_full();
> +	return 0;
> +}
[snip]
> Index: linux-2.6/init/do_mounts.c
> ===================================================================
> --- linux-2.6.orig/init/do_mounts.c
> +++ linux-2.6/init/do_mounts.c
[snip]
> @@ -399,6 +403,7 @@ void __init prepare_namespace(void)
>  		while (driver_probe_done() != 0 ||
>  			(ROOT_DEV = name_to_dev_t(saved_root_name)) == 0)
>  			msleep(100);
> +		async_synchronize_full();
>  	}

Note that even this loop can be consolidated.  The while loop above can be
equivalently rewritten as

  while ((ROOT_DEV = name_to_dev_t(saved_root_name)) == 0)
    msleep(100);
  while (driver_probe_done() != 0)
    msleep(100);

which, with your patch applied is equivalent to

  while ((ROOT_DEV = name_to_dev_t(saved_root_name)) == 0)
    msleep(100);
  wait_for_device_probe();

- Hari


_______________________________________________
linux-pm mailing list
linux-pm@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/linux-pm

[Index of Archives]     [Linux ACPI]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [CPU Freq]     [Kernel Newbies]     [Fedora Kernel]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux