Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

cciss: auto engage SCSI mid layer at driver load time

A long time ago, probably in 2002, one of the distros, or maybe more than
one, loaded block drivers prior to loading the SCSI mid layer. This meant
that the cciss driver, being a block driver, could not engage the SCSI mid
layer at init time without panicking, and relied on being poked by a
userland program after the system was up (and the SCSI mid layer was
therefore present) to engage the SCSI mid layer.

This is no longer the case, and cciss can safely rely on the SCSI mid
layer being present at init time and engage the SCSI mid layer straight
away. This means that users will see their tape drives and medium
changers at driver load time without need for a script in /etc/rc.d that
does this:

for x in /proc/driver/cciss/cciss*
do
echo "engage scsi" > $x
done

However, if no tape drives or medium changers are detected, the SCSI mid
layer will not be engaged. If a tape drive or medium change is later
hot-added to the system it will then be necessary to use the above script
or similar for the device(s) to be acceesible.

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Stephen M. Cameron and committed by
Jens Axboe
0007a4c9 7035b5df

+8 -8
+6 -8
Documentation/blockdev/cciss.txt
··· 98 98 "SCSI support" in your kernel configuration to be able to use SCSI 99 99 tape drives with your Smart Array 5xxx controller. 100 100 101 - Additionally, note that the driver will not engage the SCSI core at init 102 - time. The driver must be directed to dynamically engage the SCSI core via 103 - the /proc filesystem entry which the "block" side of the driver creates as 104 - /proc/driver/cciss/cciss* at runtime. This is because at driver init time, 105 - the SCSI core may not yet be initialized (because the driver is a block 106 - driver) and attempting to register it with the SCSI core in such a case 107 - would cause a hang. This is best done via an initialization script 108 - (typically in /etc/init.d, but could vary depending on distribution). 101 + Additionally, note that the driver will engage the SCSI core at init 102 + time if any tape drives or medium changers are detected. The driver may 103 + also be directed to dynamically engage the SCSI core via the /proc filesystem 104 + entry which the "block" side of the driver creates as 105 + /proc/driver/cciss/cciss* at runtime. This is best done via a script. 106 + 109 107 For example: 110 108 111 109 for x in /proc/driver/cciss/cciss[0-9]*
+1
drivers/block/cciss.c
··· 5163 5163 h->cciss_max_sectors = 8192; 5164 5164 5165 5165 rebuild_lun_table(h, 1, 0); 5166 + cciss_engage_scsi(h); 5166 5167 h->busy_initializing = 0; 5167 5168 return 1; 5168 5169
+1
drivers/block/cciss_scsi.c
··· 1720 1720 /* If no tape support, then these become defined out of existence */ 1721 1721 1722 1722 #define cciss_scsi_setup(cntl_num) 1723 + #define cciss_engage_scsi(h) 1723 1724 1724 1725 #endif /* CONFIG_CISS_SCSI_TAPE */