blob: 0727345388766d22cfbbc9441c92e291a5f8c841 [file] [log] [blame]
Matthew Wilcox3e082a92006-09-28 15:19:20 -06001/*
2 * scsi_wait_scan.c
3 *
4 * Copyright (C) 2006 James Bottomley <James.Bottomley@SteelEye.com>
5 *
6 * This is a simple module to wait until all the async scans are
7 * complete. The idea is to use it in initrd/initramfs scripts. You
8 * modprobe it after all the modprobes of the root SCSI drivers and it
9 * will wait until they have all finished scanning their busses before
10 * allowing the boot to proceed
11 */
12
13#include <linux/module.h>
Arjan van de Vend4d52912009-04-21 13:32:54 -070014#include <linux/device.h>
James Bottomley1ff2f402012-05-30 09:45:39 +000015#include "scsi_priv.h"
Matthew Wilcox3e082a92006-09-28 15:19:20 -060016
17static int __init wait_scan_init(void)
18{
Arjan van de Vend4d52912009-04-21 13:32:54 -070019 /*
20 * First we need to wait for device probing to finish;
21 * the drivers we just loaded might just still be probing
22 * and might not yet have reached the scsi async scanning
23 */
24 wait_for_device_probe();
Matthew Wilcox3e082a92006-09-28 15:19:20 -060025 return 0;
26}
27
28static void __exit wait_scan_exit(void)
29{
30}
31
32MODULE_DESCRIPTION("SCSI wait for scans");
33MODULE_AUTHOR("James Bottomley");
34MODULE_LICENSE("GPL");
35
36late_initcall(wait_scan_init);
37module_exit(wait_scan_exit);