Commit 0007a4c9 authored by Stephen M. Cameron's avatar Stephen M. Cameron Committed by Jens Axboe

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: default avatarStephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 7035b5df
...@@ -98,14 +98,12 @@ You must enable "SCSI tape drive support for Smart Array 5xxx" and ...@@ -98,14 +98,12 @@ You must enable "SCSI tape drive support for Smart Array 5xxx" and
"SCSI support" in your kernel configuration to be able to use SCSI "SCSI support" in your kernel configuration to be able to use SCSI
tape drives with your Smart Array 5xxx controller. tape drives with your Smart Array 5xxx controller.
Additionally, note that the driver will not engage the SCSI core at init Additionally, note that the driver will engage the SCSI core at init
time. The driver must be directed to dynamically engage the SCSI core via time if any tape drives or medium changers are detected. The driver may
the /proc filesystem entry which the "block" side of the driver creates as also be directed to dynamically engage the SCSI core via the /proc filesystem
/proc/driver/cciss/cciss* at runtime. This is because at driver init time, entry which the "block" side of the driver creates as
the SCSI core may not yet be initialized (because the driver is a block /proc/driver/cciss/cciss* at runtime. This is best done via a script.
driver) and attempting to register it with the SCSI core in such a case
would cause a hang. This is best done via an initialization script
(typically in /etc/init.d, but could vary depending on distribution).
For example: For example:
for x in /proc/driver/cciss/cciss[0-9]* for x in /proc/driver/cciss/cciss[0-9]*
......
...@@ -5163,6 +5163,7 @@ static int __devinit cciss_init_one(struct pci_dev *pdev, ...@@ -5163,6 +5163,7 @@ static int __devinit cciss_init_one(struct pci_dev *pdev,
h->cciss_max_sectors = 8192; h->cciss_max_sectors = 8192;
rebuild_lun_table(h, 1, 0); rebuild_lun_table(h, 1, 0);
cciss_engage_scsi(h);
h->busy_initializing = 0; h->busy_initializing = 0;
return 1; return 1;
......
...@@ -1720,5 +1720,6 @@ static int cciss_eh_abort_handler(struct scsi_cmnd *scsicmd) ...@@ -1720,5 +1720,6 @@ static int cciss_eh_abort_handler(struct scsi_cmnd *scsicmd)
/* If no tape support, then these become defined out of existence */ /* If no tape support, then these become defined out of existence */
#define cciss_scsi_setup(cntl_num) #define cciss_scsi_setup(cntl_num)
#define cciss_engage_scsi(h)
#endif /* CONFIG_CISS_SCSI_TAPE */ #endif /* CONFIG_CISS_SCSI_TAPE */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment