Merge branch 'msm-fix' of git://codeaurora.org/quic/kernel/davidb/linux-msm into...
[pandora-kernel.git] / Documentation / blockdev / cciss.txt
1 This driver is for Compaq's SMART Array Controllers.
2
3 Supported Cards:
4 ----------------
5
6 This driver is known to work with the following cards:
7
8         * SA 5300
9         * SA 5i 
10         * SA 532
11         * SA 5312
12         * SA 641
13         * SA 642
14         * SA 6400
15         * SA 6400 U320 Expansion Module
16         * SA 6i
17         * SA P600
18         * SA P800
19         * SA E400
20         * SA P400i
21         * SA E200
22         * SA E200i
23         * SA E500
24         * SA P700m
25         * SA P212
26         * SA P410
27         * SA P410i
28         * SA P411
29         * SA P812
30         * SA P712m
31         * SA P711m
32
33 Detecting drive failures:
34 -------------------------
35
36 To get the status of logical volumes and to detect physical drive
37 failures, you can use the cciss_vol_status program found here:
38 http://cciss.sourceforge.net/#cciss_utils
39
40 Device Naming:
41 --------------
42
43 If nodes are not already created in the /dev/cciss directory, run as root:
44
45 # cd /dev
46 # ./MAKEDEV cciss
47
48 You need some entries in /dev for the cciss device.  The MAKEDEV script
49 can make device nodes for you automatically.  Currently the device setup
50 is as follows:
51
52 Major numbers:
53         104     cciss0  
54         105     cciss1  
55         106     cciss2
56         105     cciss3
57         108     cciss4
58         109     cciss5
59         110     cciss6
60         111     cciss7
61
62 Minor numbers:
63         b7 b6 b5 b4 b3 b2 b1 b0
64         |----+----| |----+----|
65              |           |
66              |           +-------- Partition ID (0=wholedev, 1-15 partition)
67              |
68              +-------------------- Logical Volume number
69
70 The device naming scheme is:
71 /dev/cciss/c0d0                 Controller 0, disk 0, whole device
72 /dev/cciss/c0d0p1               Controller 0, disk 0, partition 1
73 /dev/cciss/c0d0p2               Controller 0, disk 0, partition 2
74 /dev/cciss/c0d0p3               Controller 0, disk 0, partition 3
75
76 /dev/cciss/c1d1                 Controller 1, disk 1, whole device
77 /dev/cciss/c1d1p1               Controller 1, disk 1, partition 1
78 /dev/cciss/c1d1p2               Controller 1, disk 1, partition 2
79 /dev/cciss/c1d1p3               Controller 1, disk 1, partition 3
80
81 CCISS simple mode support
82 -------------------------
83
84 The "cciss_simple_mode=1" boot parameter may be used to prevent the driver
85 from putting the controller into "performant" mode. The difference is that
86 with simple mode, each command completion requires an interrupt, while with
87 "performant mode" (the default, and ordinarily better performing) it is
88 possible to have multiple command completions indicated by a single
89 interrupt.
90
91 SCSI tape drive and medium changer support
92 ------------------------------------------
93
94 SCSI sequential access devices and medium changer devices are supported and 
95 appropriate device nodes are automatically created.  (e.g.  
96 /dev/st0, /dev/st1, etc.  See the "st" man page for more details.) 
97 You must enable "SCSI tape drive support for Smart Array 5xxx" and 
98 "SCSI support" in your kernel configuration to be able to use SCSI
99 tape drives with your Smart Array 5xxx controller.
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). 
109 For example:
110
111         for x in /proc/driver/cciss/cciss[0-9]*
112         do
113                 echo "engage scsi" > $x
114         done
115
116 Once the SCSI core is engaged by the driver, it cannot be disengaged 
117 (except by unloading the driver, if it happens to be linked as a module.)
118
119 Note also that if no sequential access devices or medium changers are
120 detected, the SCSI core will not be engaged by the action of the above
121 script.
122
123 Hot plug support for SCSI tape drives
124 -------------------------------------
125
126 Hot plugging of SCSI tape drives is supported, with some caveats.
127 The cciss driver must be informed that changes to the SCSI bus
128 have been made.  This may be done via the /proc filesystem.
129 For example:
130
131         echo "rescan" > /proc/scsi/cciss0/1
132
133 This causes the driver to query the adapter about changes to the
134 physical SCSI buses and/or fibre channel arbitrated loop and the
135 driver to make note of any new or removed sequential access devices
136 or medium changers.  The driver will output messages indicating what 
137 devices have been added or removed and the controller, bus, target and 
138 lun used to address the device.  It then notifies the SCSI mid layer
139 of these changes.
140
141 Note that the naming convention of the /proc filesystem entries 
142 contains a number in addition to the driver name.  (E.g. "cciss0" 
143 instead of just "cciss" which you might expect.)
144
145 Note: ONLY sequential access devices and medium changers are presented 
146 as SCSI devices to the SCSI mid layer by the cciss driver.  Specifically, 
147 physical SCSI disk drives are NOT presented to the SCSI mid layer.  The 
148 physical SCSI disk drives are controlled directly by the array controller 
149 hardware and it is important to prevent the kernel from attempting to directly
150 access these devices too, as if the array controller were merely a SCSI 
151 controller in the same way that we are allowing it to access SCSI tape drives.
152
153 SCSI error handling for tape drives and medium changers
154 -------------------------------------------------------
155
156 The linux SCSI mid layer provides an error handling protocol which
157 kicks into gear whenever a SCSI command fails to complete within a
158 certain amount of time (which can vary depending on the command).
159 The cciss driver participates in this protocol to some extent.  The
160 normal protocol is a four step process.  First the device is told
161 to abort the command.  If that doesn't work, the device is reset.
162 If that doesn't work, the SCSI bus is reset.  If that doesn't work
163 the host bus adapter is reset.  Because the cciss driver is a block
164 driver as well as a SCSI driver and only the tape drives and medium
165 changers are presented to the SCSI mid layer, and unlike more 
166 straightforward SCSI drivers, disk i/o continues through the block
167 side during the SCSI error recovery process, the cciss driver only
168 implements the first two of these actions, aborting the command, and
169 resetting the device.  Additionally, most tape drives will not oblige 
170 in aborting commands, and sometimes it appears they will not even 
171 obey a reset command, though in most circumstances they will.  In
172 the case that the command cannot be aborted and the device cannot be 
173 reset, the device will be set offline.
174
175 In the event the error handling code is triggered and a tape drive is
176 successfully reset or the tardy command is successfully aborted, the 
177 tape drive may still not allow i/o to continue until some command
178 is issued which positions the tape to a known position.  Typically you
179 must rewind the tape (by issuing "mt -f /dev/st0 rewind" for example)
180 before i/o can proceed again to a tape drive which was reset.
181
182 There is a cciss_tape_cmds module parameter which can be used to make cciss
183 allocate more commands for use by tape drives.  Ordinarily only a few commands
184 (6) are allocated for tape drives because tape drives are slow and
185 infrequently used and the primary purpose of Smart Array controllers is to
186 act as a RAID controller for disk drives, so the vast majority of commands
187 are allocated for disk devices.  However, if you have more than a few tape
188 drives attached to a smart array, the default number of commands may not be
189 enought (for example, if you have 8 tape drives, you could only rewind 6
190 at one time with the default number of commands.)  The cciss_tape_cmds module
191 parameter allows more commands (up to 16 more) to be allocated for use by
192 tape drives.  For example:
193
194         insmod cciss.ko cciss_tape_cmds=16
195
196 Or, as a kernel boot parameter passed in via grub:  cciss.cciss_tape_cmds=8