BusLogic MultiMaster and FlashPoint SCSI Driver for Linux Version 2.0.10 for Linux 2.0 PRODUCTION RELEASE 11 August 1997 Leonard N. Zubkoff Dandelion Digital lnz@dandelion.com Copyright 1995 by Leonard N. Zubkoff INTRODUCTION BusLogic, Inc. designs and manufactures a variety of high performance SCSI host adapters which share a common programming interface across a diverse collection of bus architectures by virtue of their MultiMaster ASIC technology. This driver supports all present BusLogic MultiMaster Host Adapters, and should support any future MultiMaster designs with little or no modification. More recently, BusLogic has introduced the FlashPoint Host Adapters, which are less costly and rely on the host CPU, rather than including an onboard processor. Mylex/BusLogic has recently provided me with the FlashPoint Driver Developer's Kit, which comprises documentation and freely redistributable source code for the FlashPoint SCCB Manager. The SCCB Manager is the library of code that runs on the host CPU and performs functions analogous to the firmware on the MultiMaster Host Adapters. Thanks to their having provided the SCCB Manager, this driver now supports the FlashPoint Host Adapters as well. My primary goals in writing this completely new BusLogic driver for Linux are to achieve the full performance that BusLogic SCSI Host Adapters and modern SCSI peripherals are capable of, and to provide a highly robust driver that can be depended upon for high performance mission critical applications. All of the major performance and error recovery features can be configured from the Linux kernel command line, allowing individual installations to tune driver performance and error recovery to their particular needs. The latest information on Linux support for BusLogic SCSI Host Adapters, as well as the most recent release of this driver and the latest firmware for the BT-948/958/958D, will always be available from my Linux Home Page at URL "http://www.dandelion.com/Linux/". Bug reports should be sent via electronic mail to "lnz@dandelion.com". Please include with the bug report the complete configuration messages reported by the driver and SCSI subsystem at startup, along with any subsequent system messages relevant to SCSI operations, and a detailed description of your system's hardware configuration. BusLogic has been an excellent company to work with and I highly recommend their products to the Linux community. In November 1995, I was offered the opportunity to become a beta test site for their latest MultiMaster product, the BT-948 PCI Ultra SCSI Host Adapter, and then again for the BT-958 PCI Wide Ultra SCSI Host Adapter in January 1996. This was mutually beneficial since BusLogic received a degree and kind of testing that their own testing group cannot readily achieve, and the Linux community has available high performance host adapters that have been well tested with Linux even before being brought to market. This relationship has also given me the opportunity to interact directly with their technical staff, to understand more about the internal workings of their products, and in turn to educate them about the needs and potential of the Linux community. Their interest and support is greatly appreciated. Unlike some other vendors, if you contact BusLogic Technical Support with a problem and are running Linux, they will not tell you that your use of their products is unsupported. Their latest product marketing literature even states "BusLogic SCSI host adapters are compatible with all major operating systems including: ... Linux ...". BusLogic, Inc. is located at 4151 Burton Drive, Santa Clara, California, 95054, USA and can be reached by Voice at 408/492-9090 or by FAX at 408/492-1542. BusLogic maintains a World Wide Web site at http://www.buslogic.com, an anonymous FTP site at ftp.buslogic.com, and a BBS at 408/492-1984. BusLogic Technical Support can be reached by electronic mail at techsup@buslogic.com, by Voice at 408/654-0760, or by FAX at 408/492-1542. Contact information for offices in Europe and Japan is available on the Web site. DRIVER FEATURES o Configuration Reporting and Testing During system initialization, the driver reports extensively on the host adapter hardware configuration, including the synchronous transfer parameters negotiated with each target device. In addition, the driver tests the hardware interrupt configuration to verify that interrupts are actually delivered correctly to the interrupt handler. This should catch a high percentage of PCI motherboard configuration errors early, because when the host adapter is probed successfully, most of the remaining problems appear to be related to interrupts. Most often, any remaining hardware problems are related to the specific configuration of devices on the SCSI bus, and the quality of cabling and termination used. Finally, this BusLogic driver should never incorrectly attempt to support an Adaptec 154x Host Adapter. o Performance Features BusLogic SCSI Host Adapters directly implement SCSI-2 Tagged Queuing, and so support has been included in the driver to utilize tagged queuing with any target devices that report having the tagged queuing capability. Tagged queuing allows for multiple outstanding commands to be issued to each target device or logical unit, and can improve I/O performance substantially. In addition, BusLogic's Strict Round Robin Mode is used to optimize host adapter performance, and scatter/gather I/O can support as many segments as can be effectively utilized by the Linux I/O subsystem. Control over the use of tagged queuing for each target device as well as selection of the tagged queue depth is available from the kernel command line. By default, the queue depth is automatically determined based on the number, type, speed, and capabilities of the target devices found. In addition, tagged queuing is automatically disabled whenever the host adapter firmware version is known not to implement it correctly, or whenever a tagged queue depth of 1 is selected. Tagged queuing is also disabled for individual target devices if disconnect/reconnect is disabled for that device. In performance testing, sustained disk writes of 7.3MB per second have been observed to a /dev/sd device. o Robustness Features The driver implements extensive error recovery procedures. When the higher level parts of the SCSI subsystem request that a timed out command be reset, a selection is made between a full host adapter hard reset and SCSI bus reset versus sending a bus device reset message to the individual target device based on the recommendation of the SCSI subsystem. Error recovery strategies are selectable from the kernel command line individually for each target device, and also include sending a bus device reset to the specific target device associated with the command being reset, as well as suppressing error recovery entirely to avoid perturbing an improperly functioning device. If the bus device reset error recovery strategy is selected and sending a bus device reset does not restore correct operation, the next command that is reset will force a full host adapter hard reset and SCSI bus reset. SCSI bus resets caused by other devices and detected by the host adapter are also handled by issuing a hard reset to the host adapter and re-initialization. Finally, if tagged queuing is active and more than one command reset occurs in a 10 minute interval, or if a command reset occurs within the first 10 minutes of operation, then tagged queuing will be disabled for that target device. These error recovery options improve overall system robustness by preventing individual errant devices from causing the system as a whole to lock up or crash, and thereby allowing a clean shutdown and restart after the offending component is removed. o Extensive Testing This driver has undergone extensive testing and improvement over a period of several months, and is routinely being used on heavily loaded systems. Over 300 people retrieved the driver during the beta test period. In addition to testing in normal system operation, error recovery tests have been performed to verify proper system recovery in the case of simulated dropped interrupts, external SCSI bus resets, and SCSI command errors due to bad CD-ROM media. o PCI Configuration Support On PCI systems running kernels compiled with PCI BIOS support enabled, this driver will interrogate the PCI configuration space and use the I/O port addresses assigned by the system BIOS, rather than the ISA compatible I/O port addresses. The ISA compatible I/O port address is then disabled by the driver. On PCI systems it is also recommended that the AutoSCSI utility be used to disable the ISA compatible I/O port entirely as it is not necessary. The ISA compatible I/O port is disabled by default on the BT-948/958/958D. o /proc File System Support Copies of the host adapter configuration information together with data transfer and error recovery statistics are now available through the /proc/scsi/BusLogic/ interface. o Shared Interrupts Support On systems that support shared interrupts, any number of BusLogic Host Adapters may share the same interrupt request channel. o Wide SCSI Support All BusLogic MultiMaster SCSI Host Adapters share a common programming interface, except for the inevitable improvements and extensions as new models are released, so support for Wide SCSI data transfer has automatically been available without explicit driver support. When used with Linux 2.0.x, this driver adds explicit support for up to 15 target devices and 64 logical units per target device, to fully exploit the capabilities of the newest BusLogic Wide SCSI Host Adapters. SUPPORTED HOST ADAPTERS The following list comprises the supported BusLogic SCSI Host Adapters as of the date of this document. It is recommended that anyone purchasing a BusLogic Host Adapter not in the following table contact the author beforehand to verify that it is or will be supported. FlashPoint Series PCI Host Adapters: FlashPoint LT (BT-930) Ultra SCSI-2 FlashPoint DL (BT-932) Dual Channel Ultra SCSI-2 FlashPoint LW (BT-950) Wide Ultra SCSI-2 FlashPoint DW (BT-952) Dual Channel Wide Ultra SCSI-2 MultiMaster "W" Series Host Adapters: BT-948 PCI Ultra SCSI-2 BT-958 PCI Wide Ultra SCSI-2 BT-958D PCI Wide Differential Ultra SCSI-2 MultiMaster "C" Series Host Adapters: BT-946C PCI Fast SCSI-2 BT-956C PCI Wide Fast SCSI-2 BT-956CD PCI Wide Differential Fast SCSI-2 BT-445C VLB Fast SCSI-2 BT-747C EISA Fast SCSI-2 BT-757C EISA Wide Fast SCSI-2 BT-757CD EISA Wide Differential Fast SCSI-2 BT-545C ISA Fast SCSI-2 BT-540CF ISA Fast SCSI-2 MultiMaster "S" Series Host Adapters: BT-445S VLB Fast SCSI-2 BT-747S EISA Fast SCSI-2 BT-747D EISA Differential Fast SCSI-2 BT-757S EISA Wide Fast SCSI-2 BT-757D EISA Wide Differential Fast SCSI-2 BT-545S ISA Fast SCSI-2 BT-542D ISA Differential Fast SCSI-2 BT-742A EISA SCSI-2 (742A revision H) BT-542B ISA SCSI-2 (542B revision H) MultiMaster "A" Series Host Adapters: BT-742A EISA SCSI-2 (742A revisions A - G) BT-542B ISA SCSI-2 (542B revisions A - G) AMI FastDisk Host Adapters that are true BusLogic MultiMaster clones are also supported by this driver. BT-948/958/958D INSTALLATION NOTES The BT-948/958/958D PCI Ultra SCSI Host Adapters have some features which may require attention in some circumstances when installing Linux. o PCI I/O Port Assignments When configured to factory default settings, the BT-948/958/958D will only recognize the PCI I/O port assignments made by the motherboard's PCI BIOS. The BT-948/958/958D will not respond to any of the ISA compatible I/O ports that previous BusLogic SCSI Host Adapters respond to. This driver supports the PCI I/O port assignments, so this is the preferred configuration. However, if the obsolete BusLogic driver must be used for any reason, such as a Linux distribution that does not yet use this driver in its boot kernel, BusLogic has provided an AutoSCSI configuration option to enable a legacy ISA compatible I/O port. To enable this backward compatibility option, invoke the AutoSCSI utility via Ctrl-B at system startup and select "Adapter Configuration", "View/Modify Configuration", and then change the "ISA Compatible Port" setting from "Disable" to "Primary" or "Alternate". Once this driver has been installed, the "ISA Compatible Port" option should be set back to "Disable" to avoid possible future I/O port conflicts. The older BT-946C/956C/956CD also have this configuration option, but the factory default setting is "Primary". o PCI Slot Scanning Order In systems with multiple BusLogic PCI Host Adapters, the order in which the PCI slots are scanned may appear reversed with the BT-948/958/958D as compared to the BT-946C/956C/956CD. For booting from a SCSI disk to work correctly, it is necessary that the host adapter's BIOS and the kernel agree on which disk is the boot device, which requires that they recognize the PCI host adapters in the same order. The motherboard's PCI BIOS provides a standard way of enumerating the PCI host adapters, which is used by the Linux kernel. Some PCI BIOS implementations enumerate the PCI slots in order of increasing bus number and device number, while others do so in the opposite direction. Unfortunately, Microsoft decided that Windows 95 would always enumerate the PCI slots in order of increasing bus number and device number regardless of the PCI BIOS enumeration, and requires that their scheme be supported by the host adapter's BIOS to receive Windows 95 certification. Therefore, the factory default settings of the BT-948/958/958D enumerate the host adapters by increasing bus number and device number. To disable this feature, invoke the AutoSCSI utility via Ctrl-B at system startup and select "Adapter Configuration", "View/Modify Configuration", press Ctrl-F10, and then change the "Use Bus And Device # For PCI Scanning Seq." option to OFF. This driver will interrogate the setting of the PCI Scanning Sequence option so as to recognize the host adapters in the same order as they are enumerated by the host adapter's BIOS. o Mega-Transfers/Second The driver reports on the synchronous transfer parameters negotiated between the host adapter and target devices in units of "mega-transfers/second". For wide devices, the unit of transfer is 16 bits if wide negotiation has been successfully completed. Therefore, the total transfer rate to wide devices will generally be twice the synchronous tranfer rate reported by the driver. COMMAND LINE OPTIONS Many features of this driver are configurable by specification of appropriate kernel command line options. A full description of the command line options may be found in the comments before BusLogic_Setup in the kernel source code file "BusLogic.c". The following examples may be useful as a starting point: "BusLogic=NoProbe" No probing of any kind is to be performed, and hence no BusLogic Host Adapters will be detected. "BusLogic=NoProbeISA" No probing of the standard ISA I/O Addresses will be done, and hence only PCI Host Adapters will be detected. "BusLogic=NoProbePCI" No interrogation of PCI Configuration Space will be made, and hence only ISA Multimaster Host Adapters will be detected, as well as PCI Multimaster Host Adapters that have their ISA Compatible I/O Port set to "Primary" or "Alternate". "BusLogic=NoSortPCI" PCI MultiMaster Host Adapters will be enumerated in the order provided by the PCI BIOS, ignoring any setting of the AutoSCSI "Use Bus And Device # For PCI Scanning Seq." option. "BusLogic=MultiMasterFirst" By default, if both FlashPoint and PCI MultiMaster Host Adapters are present, this driver will probe for FlashPoint Host Adapters first unless the BIOS primary disk is controlled by the first PCI MultiMaster Host Adapter, in which case MultiMaster Host Adapters will be probed first. This option forces MultiMaster Host Adapters to be probed first. "BusLogic=FlashPointFirst" By default, if both FlashPoint and PCI MultiMaster Host Adapters are present, this driver will probe for FlashPoint Host Adapters first unless the BIOS primary disk is controlled by the first PCI MultiMaster Host Adapter, in which case MultiMaster Host Adapters will be probed first. This option forces FlashPoint Host Adapters to be probed first. "BusLogic=0x330" This command line limits probing to the single I/O port at 0x330. "BusLogic=0,1" This command line selects default probing and a tagged queue depth of 1 which also disables tagged queuing. It may be useful if problems arise during installation on a system with a flaky SCSI configuration. In cases of a marginal SCSI configuration it may also be beneficial to disable fast transfers and/or synchronous negotiation using AutoSCSI on FlashPoint and "W" and "C" series MultiMaster host adapters. Disconnect/reconnect may also be disabled for fast devices such as disk drives, but should not be disabled for tape drives or other devices where a single command may take over a second to execute. "BusLogic=0,0,30" This command line selects default probing and automatic tagged queue depth selection, but changes the bus settle time to 30 seconds. It may be useful with SCSI devices that take an unusually long time to become ready to accept commands after a SCSI bus reset. Some tape drives will not respond properly immediately after a SCSI bus reset, especially if a tape is present in the drive. "BusLogic=TQ:Disable" This command line selects default probing and disables tagged queuing. "BusLogic=0,15,TQ:N" This command line selects a tagged queue depth of 15 and disables tagged queuing for target 0, while allowing tagged queuing for all other target devices. Note that limiting the tagged queue depth or disabling tagged queuing can substantially impact performance. INSTALLATION This distribution was prepared for Linux kernel version 2.0.30, but should be compatible with 2.0.4 or any later 2.0 series kernel if BusLogic.patch is also applied. To install the new BusLogic SCSI driver, you may use the following commands, replacing "/usr/src" with wherever you keep your Linux kernel source tree: cd /usr/src tar -xvzf BusLogic-2.0.10.tar.gz mv README.* LICENSE.* BusLogic.[ch] FlashPoint.c linux/drivers/scsi patch -p < BusLogic.patch # Only for kernels prior to 2.0.30 cd linux make config make depend make zImage Then install "arch/i386/boot/zImage" as your standard kernel, run lilo if appropriate, and reboot. Be sure to answer "y" to the "BusLogic SCSI support" query during the "make config" step. If your system was already configured for the old BusLogic driver or for an older version of this driver, you may omit the "make config" step above. BUSLOGIC ANNOUNCEMENTS MAILING LIST The BusLogic Announcements Mailing List provides a forum for informing Linux users of new driver releases and other announcements regarding Linux support for BusLogic SCSI Host Adapters. To join the mailing list, send a message to "buslogic-announce-request@dandelion.com" with the line "subscribe" in the message body.