libata: more doc updates

Document recently-added ata_port_operations hooks.

Fill several doc stubs in libata-core.c.

+84 -33
+40 -20
Documentation/DocBook/libata.tmpl
··· 14 14 </authorgroup> 15 15 16 16 <copyright> 17 - <year>2003</year> 17 + <year>2003-2005</year> 18 18 <holder>Jeff Garzik</holder> 19 19 </copyright> 20 20 ··· 145 145 </para> 146 146 147 147 <programlisting> 148 - u8 (*check_status)(struct ata_port *ap); 149 - void (*dev_select)(struct ata_port *ap, unsigned int device); 148 + int (*check_atapi_dma) (struct ata_queued_cmd *qc); 150 149 </programlisting> 151 150 152 151 <para> 153 - Reads the Status ATA shadow register from hardware. On some 154 - hardware, this has the side effect of clearing the interrupt 155 - condition. 152 + Allow low-level driver to filter ATA PACKET commands, returning a status 153 + indicating whether or not it is OK to use DMA for the supplied PACKET 154 + command. 155 + </para> 156 + 157 + <programlisting> 158 + u8 (*check_status)(struct ata_port *ap); 159 + u8 (*check_altstatus)(struct ata_port *ap); 160 + u8 (*check_err)(struct ata_port *ap); 161 + </programlisting> 162 + 163 + <para> 164 + Reads the Status/AltStatus/Error ATA shadow register from 165 + hardware. On some hardware, reading the Status register has 166 + the side effect of clearing the interrupt condition. 156 167 </para> 157 168 158 169 <programlisting> ··· 173 162 <para> 174 163 Issues the low-level hardware command(s) that causes one of N 175 164 hardware devices to be considered 'selected' (active and 176 - available for use) on the ATA bus. 165 + available for use) on the ATA bus. This generally has no 166 + meaning on FIS-based devices. 177 167 </para> 178 168 179 169 <programlisting> ··· 192 180 <programlisting> 193 181 void (*bmdma_setup) (struct ata_queued_cmd *qc); 194 182 void (*bmdma_start) (struct ata_queued_cmd *qc); 183 + void (*bmdma_stop) (struct ata_port *ap); 184 + u8 (*bmdma_status) (struct ata_port *ap); 195 185 </programlisting> 196 186 197 187 <para> 198 - When setting up an IDE BMDMA transaction, these hooks arm 199 - (->bmdma_setup) and fire (->bmdma_start) the hardware's DMA 200 - engine. 188 + When setting up an IDE BMDMA transaction, these hooks arm 189 + (->bmdma_setup), fire (->bmdma_start), and halt (->bmdma_stop) 190 + the hardware's DMA engine. ->bmdma_status is used to read the standard 191 + PCI IDE DMA Status register. 192 + </para> 193 + 194 + <para> 195 + These hooks are typically either no-ops, or simply not implemented, in 196 + FIS-based drivers. 201 197 </para> 202 198 203 199 <programlisting> ··· 225 205 ->qc_issue is used to make a command active, once the hardware 226 206 and S/G tables have been prepared. IDE BMDMA drivers use the 227 207 helper function ata_qc_issue_prot() for taskfile protocol-based 228 - dispatch. More advanced drivers roll their own ->qc_issue 229 - implementation, using this as the "issue new ATA command to 230 - hardware" hook. 208 + dispatch. More advanced drivers implement their own ->qc_issue. 231 209 </para> 232 210 233 211 <programlisting> ··· 233 215 </programlisting> 234 216 235 217 <para> 236 - This is a high level error handling function, called from the 237 - error handling thread, when a command times out. 218 + This is a high level error handling function, called from the 219 + error handling thread, when a command times out. Most newer 220 + hardware will implement its own error handling code here. IDE BMDMA 221 + drivers may use the helper function ata_eng_timeout(). 238 222 </para> 239 223 240 224 <programlisting> ··· 275 255 tasks. 276 256 </para> 277 257 <para> 278 - ->host_stop() is called when the rmmod or hot unplug process 279 - begins. The hook must stop all hardware interrupts, DMA 280 - engines, etc. 281 - </para> 282 - <para> 283 258 ->port_stop() is called after ->host_stop(). It's sole function 284 259 is to release DMA/memory resources, now that they are no longer 285 260 actively being used. 261 + </para> 262 + <para> 263 + ->host_stop() is called after all ->port_stop() calls 264 + have completed. The hook must finalize hardware shutdown, release DMA 265 + and other resources, etc. 286 266 </para> 287 267 288 268 </sect1>
+44 -13
drivers/scsi/libata-core.c
··· 1241 1241 } 1242 1242 1243 1243 /** 1244 - * __sata_phy_reset - 1245 - * @ap: 1244 + * __sata_phy_reset - Wake/reset a low-level SATA PHY 1245 + * @ap: SATA port associated with target SATA PHY. 1246 1246 * 1247 - * LOCKING: 1247 + * This function issues commands to standard SATA Sxxx 1248 + * PHY registers, to wake up the phy (and device), and 1249 + * clear any reset condition. 1250 + * 1251 + * LOCKING: None. Serialized during ata_bus_probe(). 1248 1252 * 1249 1253 */ 1250 1254 void __sata_phy_reset(struct ata_port *ap) ··· 1293 1289 } 1294 1290 1295 1291 /** 1296 - * __sata_phy_reset - 1297 - * @ap: 1292 + * sata_phy_reset - Reset SATA bus. 1293 + * @ap: SATA port associated with target SATA PHY. 1298 1294 * 1299 - * LOCKING: 1295 + * This function resets the SATA bus, and then probes 1296 + * the bus for devices. 1297 + * 1298 + * LOCKING: None. Serialized during ata_bus_probe(). 1300 1299 * 1301 1300 */ 1302 1301 void sata_phy_reset(struct ata_port *ap) ··· 1311 1304 } 1312 1305 1313 1306 /** 1314 - * ata_port_disable - 1315 - * @ap: 1307 + * ata_port_disable - Disable port. 1308 + * @ap: Port to be disabled. 1316 1309 * 1317 - * LOCKING: 1310 + * Modify @ap data structure such that the system 1311 + * thinks that the entire port is disabled, and should 1312 + * never attempt to probe or communicate with devices 1313 + * on this port. 1314 + * 1315 + * LOCKING: host_set lock, or some other form of 1316 + * serialization. 1318 1317 */ 1319 1318 1320 1319 void ata_port_disable(struct ata_port *ap) ··· 1429 1416 * ata_set_mode - Program timings and issue SET FEATURES - XFER 1430 1417 * @ap: port on which timings will be programmed 1431 1418 * 1432 - * LOCKING: 1419 + * Set ATA device disk transfer mode (PIO3, UDMA6, etc.). 1420 + * 1421 + * LOCKING: None. Serialized during ata_bus_probe(). 1433 1422 * 1434 1423 */ 1435 1424 static void ata_set_mode(struct ata_port *ap) ··· 1482 1467 * @tmout_pat: impatience timeout 1483 1468 * @tmout: overall timeout 1484 1469 * 1485 - * LOCKING: 1470 + * Sleep until ATA Status register bit BSY clears, 1471 + * or a timeout occurs. 1472 + * 1473 + * LOCKING: None. 1486 1474 * 1487 1475 */ 1488 1476 ··· 1574 1556 * ata_bus_edd - 1575 1557 * @ap: 1576 1558 * 1577 - * LOCKING: 1559 + * LOCKING: None. Serialized during ata_bus_probe(). 1578 1560 * 1579 1561 */ 1580 1562 ··· 1927 1909 * @ap: Port associated with device @dev 1928 1910 * @dev: Device to which command will be sent 1929 1911 * 1930 - * LOCKING: 1912 + * Issue SET FEATURES - XFER MODE command to device @dev 1913 + * on port @ap. 1914 + * 1915 + * LOCKING: None. Serialized during ata_bus_probe(). 1931 1916 */ 1932 1917 1933 1918 static void ata_dev_set_xfermode(struct ata_port *ap, struct ata_device *dev) ··· 2002 1981 * ata_fill_sg - Fill PCI IDE PRD table 2003 1982 * @qc: Metadata associated with taskfile to be transferred 2004 1983 * 1984 + * Fill PCI IDE PRD (scatter-gather) table with segments 1985 + * associated with the current disk command. 1986 + * 2005 1987 * LOCKING: 1988 + * spin_lock_irqsave(host_set lock) 2006 1989 * 2007 1990 */ 2008 1991 static void ata_fill_sg(struct ata_queued_cmd *qc) ··· 2053 2028 * ata_check_atapi_dma - Check whether ATAPI DMA can be supported 2054 2029 * @qc: Metadata associated with taskfile to check 2055 2030 * 2031 + * Allow low-level driver to filter ATA PACKET commands, returning 2032 + * a status indicating whether or not it is OK to use DMA for the 2033 + * supplied PACKET command. 2034 + * 2056 2035 * LOCKING: 2057 2036 * RETURNS: 0 when ATAPI DMA can be used 2058 2037 * nonzero otherwise ··· 2074 2045 /** 2075 2046 * ata_qc_prep - Prepare taskfile for submission 2076 2047 * @qc: Metadata associated with taskfile to be prepared 2048 + * 2049 + * Prepare ATA taskfile for submission. 2077 2050 * 2078 2051 * LOCKING: 2079 2052 * spin_lock_irqsave(host_set lock)