Skip to contentSkip to conversation

make scsi_wait_scan always modular

PATCH In review James Bottomley 2 participants 6 messages Mar 11, 2007 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 make scsi_wait_scan always modular

Currently scsi_wait_scan is only built modular if SCSI is modular. However, it's perfectly possible for a built in SCSI still to have modular drivers and thus need scsi_wait_scan as a module. Therefore, scsi_wait_scan should always be built as a module (unless the kernel doesn't support modules).

James

drivers/scsi/Kconfig +6 -0
index 4cd280e..f3bc0f4 100644
@@ -241,6 +241,12 @@ config SCSI_SCAN_ASYNC
 	  You can override this choice by specifying "scsi_mod.scan=sync"
 	  or async on the kernel's command line.
 
+config SCSI_WAIT_SCAN
+	tristate
+	default m
+	depends on SCSI
+	depends on MODULES
+
 menu "SCSI Transports"
 	depends on SCSI
 
drivers/scsi/Makefile +1 -1
index 79ecf4e..41c7883 100644
@@ -145,7 +145,7 @@ obj-$(CONFIG_CHR_DEV_SCH)	+= ch.o
 # This goes last, so that "real" scsi devices probe earlier
 obj-$(CONFIG_SCSI_DEBUG)	+= scsi_debug.o
 
-obj-$(CONFIG_SCSI)		+= scsi_wait_scan.o
+obj-$(CONFIG_SCSI_WAIT_SCAN)	+= scsi_wait_scan.o
 
 scsi_mod-y			+= scsi.o hosts.o scsi_ioctl.o constants.o \
 				   scsicam.o scsi_error.o scsi_lib.o \
#1 lore raw

Hi

Quoted 30 lines · James Bottomley

Currently scsi_wait_scan is only built modular if SCSI is modular. However, it's perfectly possible for a built in SCSI still to have modular drivers and thus need scsi_wait_scan as a module. Therefore, scsi_wait_scan should always be built as a module (unless the kernel doesn't support modules).

James

drivers/scsi/Kconfig +6 -0
index 4cd280e..f3bc0f4 100644
@@ -241,6 +241,12 @@ config SCSI_SCAN_ASYNC
 	  You can override this choice by specifying "scsi_mod.scan=sync"
 	  or async on the kernel's command line.
 
+config SCSI_WAIT_SCAN
+	tristate
+	default m
+	depends on SCSI
+	depends on MODULES
+
 menu "SCSI Transports"
 	depends on SCSI
 
drivers/scsi/Makefile +0 -0
index 79ecf4e..41c7883 100644

drivers/scsi/Makefile obj-$(CONFIG_CHR_DEV_SCH) += ch.o · line 148

Quoted 5 lines
drivers/scsi/Makefile +1 -1
@@ -145,7 +145,7 @@ obj-$(CONFIG_CHR_DEV_SCH)	+= ch.o
 # This goes last, so that "real" scsi devices probe earlier
 obj-$(CONFIG_SCSI_DEBUG)	+= scsi_debug.o
 
-obj-$(CONFIG_SCSI)		+= scsi_wait_scan.o
+obj-$(CONFIG_SCSI_WAIT_SCAN)	+= scsi_wait_scan.o

Which means, with this change you cannot build a kernel without module support but with scsi_wait_scan, which was possible before. Don't know if anybody would ever want to do this though...

Thanks
Guennadi
---
Guennadi Liakhovetski

#2 lore raw
Quoted 3 lines · Guennadi Liakhovetski

Which means, with this change you cannot build a kernel without module support but with scsi_wait_scan, which was possible before. Don't know if anybody would ever want to do this though...

I'll do something about that if you can tell me how one might use scsi_wait_scan without module support in the kernel ...

James

#3 lore raw
Quoted 7 lines · James Bottomley
Quoted 3 lines · Guennadi Liakhovetski

Which means, with this change you cannot build a kernel without module support but with scsi_wait_scan, which was possible before. Don't know if anybody would ever want to do this though...

I'll do something about that if you can tell me how one might use scsi_wait_scan without module support in the kernel ...

I won't:-) Just from the comment at the top of the patch I didn't get the impression that this indeed was its intended result. Building statically with scsi_wait_scan would mean that you might allow async scan, but then some time at late_initcall() time you want a sync point. Could this ever be desired? If not, just ignore my comment.

Thanks
Guennadi
---
Guennadi Liakhovetski

#4 lore raw
Quoted 6 lines · Guennadi Liakhovetski
Quoted 5 lines · James Bottomley
Quoted 3 lines · Guennadi Liakhovetski

Which means, with this change you cannot build a kernel without module support but with scsi_wait_scan, which was possible before. Don't know if anybody would ever want to do this though...

Quoted 8 lines
Quoted 2 lines

I'll do something about that if you can tell me how one might use scsi_wait_scan without module support in the kernel ...

I won't:-) Just from the comment at the top of the patch I didn't get the impression that this indeed was its intended result. Building statically with scsi_wait_scan would mean that you might allow async scan, but then some time at late_initcall() time you want a sync point. Could this ever be desired? If not, just ignore my comment.

scsi_wait_scan is designed to be a module that is loaded *after* you've loaded all HBA modules that doesn't return from module_init until the scans previously launched by the HBA module insertions are complete. In a monolithic kernel, this is done by the async scan infrastructure but in a modular kernel, you have to have some signal that you've finished loading the SCSI modules (which is what scsi_wait_scan is).

So, if you build a kernel without module support, ipso facto you have no SCSI modules to load and therefore you can't have a use for scsi_wait_scan.

James

#5 lore raw
Quoted 3 lines · James Bottomley

scsi_wait_scan is designed to be a module that is loaded *after* you've loaded all HBA modules that doesn't return from module_init until the scans previously launched by the HBA module insertions are complete.

sure

Quoted 4 lines

In
a monolithic kernel, this is done by the async scan infrastructure but in a modular kernel, you have to have some signal that you've finished loading the SCSI modules (which is what scsi_wait_scan is).

So, if now (before this patch) you build a monolithic kernel, scsi_wait_scan will be built in, scsi_complete_async_scans() will be called at late_initcall time, but it will be redundant because

Quoted 2 lines

In
a monolithic kernel, this is done by the async scan infrastructure

so, it will just have no effect, right?

If so, then, of course it only makes sense as a module.

Thanks
Guennadi
---
Guennadi Liakhovetski