Re: why does x86 "make defconfig" build a single, lonely module?

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Satyam Sharma
Date: Monday, May 14, 2007 - 5:00 am

Hello,


It seems there is a:

late_initcall(wait_scan_init);

in drivers/scsi/scsi_wait_scan.c too. So we can get rid of the redundant:

#ifndef MODULE
late_initcal(scsi_complete_async_scans);
#endif

in drivers/scsi/scsi_scan.c by enforcing SCSI_WAIT_SCAN=y when
SCSI=y (and =m when SCSI=m).

I guess this is probably the behaviour that James wanted originally?

Anyway, attached patch (subsumes previous one) cleans up all this.
Now, scsi_wait_scan is the only guy who controls waiting upon async
scans to complete:

If SCSI=n, SCSI_WAIT_SCAN=n, obviously.

If SCSI=y, SCSI_WAIT_SCAN=y, so it gets built-in and is run at
late_initcall.

If SCSI=m, SCSI_WAIT_SCAN=m too and would hopefully be run
by the initrd/initramfs scripts to wait for async SCSI bus scans to
finish before allowing the boot to proceed.

[ Attached patch does _not_ expose SCSI_WAIT_SCAN to the
user at kernel configuration time, so if somebody wants it to be
built as a module even when SCSI=y (why would anybody
want that, doesn't make much sense to me to modprobe
scsi_wait_scan _after_ boot-up), it would not be possible to
do so. But if someone really wants that, let me know, we can
add a depends, tristate "..." and help in this Kconfig option to
accomplish that too. ]

Thanks,
Satyam

Signed-off-by: Satyam Sharma <satyam.sharma@gmail.com>

---

 drivers/scsi/Kconfig     |    5 +++--
 drivers/scsi/scsi_scan.c |    5 +----
 2 files changed, 4 insertions(+), 6 deletions(-)

---

diff -ruNp a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
--- a/drivers/scsi/Kconfig	2007-05-10 23:19:32.000000000 +0530
+++ b/drivers/scsi/Kconfig	2007-05-14 17:37:27.000000000 +0530
@@ -243,9 +243,10 @@ config SCSI_SCAN_ASYNC

 config SCSI_WAIT_SCAN
 	tristate
-	default m
 	depends on SCSI
-	depends on MODULES
+	default y if SCSI=y
+	default m if SCSI=m
+	default n

 menu "SCSI Transports"
 	depends on SCSI
diff -ruNp a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
--- a/drivers/scsi/scsi_scan.c	2007-05-14 16:06:43.000000000 +0530
+++ b/drivers/scsi/scsi_scan.c	2007-05-14 16:10:34.000000000 +0530
@@ -184,14 +184,11 @@ int scsi_complete_async_scans(void)
 /* Only exported for the benefit of scsi_wait_scan */
 EXPORT_SYMBOL_GPL(scsi_complete_async_scans);

-#ifndef MODULE
 /*
  * For async scanning we need to wait for all the scans to complete before
  * trying to mount the root fs.  Otherwise non-modular drivers may not be ready
- * yet.
+ * yet.  This is done by scsi_wait_scan.
  */
-late_initcall(scsi_complete_async_scans);
-#endif

 /**
  * scsi_unlock_floptical - unlock device via a special MODE SENSE command
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: why does x86 "make defconfig" build a single, lonely m ..., Satyam Sharma, (Mon May 14, 5:00 am)
Asynchronous scsi scanning, Matthew Wilcox, (Tue May 15, 5:02 am)
Re: Asynchronous scsi scanning, Simon Arlott, (Tue May 15, 9:30 am)
Re: Asynchronous scsi scanning, Matthew Wilcox, (Tue May 15, 10:29 am)
[PATCH] SCSI: Let users disable SCSI_WAIT_SCAN to be built, Stefan Richter, (Tue May 15, 2:56 pm)
Re: Asynchronous scsi scanning, Satyam Sharma, (Tue May 15, 4:27 pm)
Re: Asynchronous scsi scanning, Arjan van de Ven, (Tue May 15, 4:28 pm)
Re: Asynchronous scsi scanning, Satyam Sharma, (Tue May 15, 4:49 pm)
Re: Asynchronous scsi scanning, Matthew Wilcox, (Tue May 15, 7:51 pm)
Re: Asynchronous scsi scanning, Roland Dreier, (Tue May 15, 7:59 pm)
Re: Asynchronous scsi scanning, Satyam Sharma, (Thu May 17, 10:13 am)
Re: Asynchronous scsi scanning, Matthew Wilcox, (Thu May 17, 10:20 am)
sysfs makes scaling suck Re: Asynchronous scsi scanning, Benjamin LaHaise, (Thu May 17, 10:32 am)
Re: Asynchronous scsi scanning, Satyam Sharma, (Thu May 17, 10:41 am)
Re: sysfs makes scaling suck Re: Asynchronous scsi scanning, James Bottomley, (Thu May 17, 10:45 am)
Re: sysfs makes scaling suck Re: Asynchronous scsi scanning, Benjamin LaHaise, (Thu May 17, 10:49 am)
Re: Asynchronous scsi scanning, Christoph Hellwig, (Thu May 17, 11:24 am)
Re: Asynchronous scsi scanning, Satyam Sharma, (Thu May 17, 11:47 am)
Re: Asynchronous scsi scanning, Christoph Hellwig, (Thu May 17, 11:51 am)
Re: Asynchronous scsi scanning, Satyam Sharma, (Thu May 17, 12:04 pm)
Re: Asynchronous scsi scanning, Matthew Wilcox, (Thu May 17, 12:39 pm)
Re: Asynchronous scsi scanning, Benjamin LaHaise, (Thu May 17, 12:43 pm)
Re: Asynchronous scsi scanning, Matthew Wilcox, (Thu May 17, 2:30 pm)
Re: Asynchronous scsi scanning, Dave Jones, (Thu May 17, 2:42 pm)
Re: Asynchronous scsi scanning, Peter Jones, (Thu May 17, 3:00 pm)
Re: Asynchronous scsi scanning, Peter Jones, (Thu May 17, 3:24 pm)
Re: Asynchronous scsi scanning, Satyam Sharma, (Thu May 17, 8:41 pm)
Re: Asynchronous scsi scanning, Satyam Sharma, (Thu May 17, 10:28 pm)
Re: Asynchronous scsi scanning, Matthew Wilcox, (Fri May 18, 4:19 am)
Re: Asynchronous scsi scanning, Matthew Wilcox, (Fri May 18, 4:24 am)
Re: Asynchronous scsi scanning, Satyam Sharma, (Fri May 18, 6:06 am)
Re: Asynchronous scsi scanning, Satyam Sharma, (Fri May 18, 6:14 am)
Re: Asynchronous scsi scanning, Stefan Richter, (Fri May 18, 7:00 am)