scsi_wait_scan.c 958 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  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. #include <linux/module.h>
  13. #include <linux/device.h>
  14. #include "scsi_priv.h"
  15. static int __init wait_scan_init(void)
  16. {
  17. /*
  18. * First we need to wait for device probing to finish;
  19. * the drivers we just loaded might just still be probing
  20. * and might not yet have reached the scsi async scanning
  21. */
  22. wait_for_device_probe();
  23. return 0;
  24. }
  25. static void __exit wait_scan_exit(void)
  26. {
  27. }
  28. MODULE_DESCRIPTION("SCSI wait for scans");
  29. MODULE_AUTHOR("James Bottomley");
  30. MODULE_LICENSE("GPL");
  31. late_initcall(wait_scan_init);
  32. module_exit(wait_scan_exit);