Linux 2.4 SCSI scanning patches

by Kurt Garloff <garloff@suse.de>, 8/2003

In general, the SCSI code in 2.4 is a mess. Not it's functionality, but it's documentation and structure. For the scanning code, a few patches have been created to improve the structure of the code and to introduce new features. The patches have been heavily inspired by the code that has been cleaned up by Pat Mansfield and others for kernel 2.6.
Patches
Name Description
scsi-scan-blist-update Update of the blacklist
scsi-scan-inqsize Send an INQUIRY with 36 bytes first and another, longer, one if the device supports more data. Needed to avoid trouble with broken USB devices.
scsi-scan-llun-blklst Introduce boot/module parameter that allows to manually mark devices with the BLIST_SPARSELUN and BLIST_LARGELUN blacklist flags, allowing them to be scanned beyond LUN 7 (despite reporting as SCSI-2) and to not stop scanning on non-present LUNs.
Syntax: llun_blklst=C,B,T[,C,B,T[,C,B,T[,...]]] : This sets the flags for up to 8 devices addressed by the host adapter (Controller) number, Channel (Bus) numnber and SCSI Target ID.
scsi-scan-scleanup Patch that restructures (not to say: puts some structure to) the code in in scsi_scan.c. Should not contain any functional changes.
scsi-scan-newopts Introduce new options to tweak the scanning process:
  • scsi_sparselun=1: 1 switches on the SPARSELUN flag for all devices, thus disabling the optimization that stops scanning, if a LUN was not found. (However, we still require LUN 0 INQUIRY to be successful before going any further.
  • scsi_largelun=1: switches on the LARGELUN flag for all devices, thus disabling the check for SCSI-3 before scanning beyong LUN 7.
  • max_scsi_sparseluns=N: Allows to set a lower limit for the LUNs to be searched for SPARSELUN devices.
Furthermore, the BLIST_INQUIRY_36 and _58 flags are supported now.
scsi-scan-report-luns Use the REPORT_LUNS command when searching for SCSI LUNs (2.6 backport). It makes SPARSELUN and LARGELUN flags unecessary for devices that support it as we don't do serial probing of all LUNs anymore than. The command is specified in SCSI-3 standard and thus only tried for SCSI-3 devices by default. For SCSI-2, it can be enabled manually, though. We introduce the blacklist flag BLIST_NOREPLUN to be able to workaround broken devices.
Parameters:
  • scsi_noreportlun=1: switches off the REPORT_LUN usage completely
  • scsi_reportlun2=1: enable the use of REPORT_LUN for SCSI-2 devices _if_ connected to a host adapter that supports more than 8 LUNs.
  • max_report_luns=N: Sets the limit of LUNs per target that may be reported by a REPORT_LUN command
scsi-scan-allow-ghost-devs Allow devices attached to LUNS that are reported offline by the target to still be accessed.
Syntax: scsi_allow_ghost_devices=N: Allows all LUNs with a unit number smaller than N to be accessed despite being reported offline.
This is needed for some EMC storage devices
scsi-scan-large-timeout Allows to set the INQUIRY timeout while scanning to higher values to accomodate for broken hardware.
Syntax: scsi_inq_timeout=N: Sets the scanning timeout in seconds. (The code adds half a second, so 0 is safe.)
scsi-scan-use-26-devinfo To be done: Use the 2.6 scsi_devinfo.{h,c} blacklist in 2.4 as well. Merge contents.
Note that the patches need to be applied in the order presented here.
Last modified: $Id$