diff options
author | Alan Cox <alan@lxorguk.ukuu.org.uk> | 2006-03-27 12:58:20 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-03-29 19:30:28 -0500 |
commit | 5444a6f405618706eddbe1605ef8533b1b655764 (patch) | |
tree | 9265a1e65563add47a9fe5f1ddae44d6dd0742e3 /Documentation | |
parent | 692785e798f341c057ff976c35a3d86ad5af8ac6 (diff) |
[PATCH] libata: Simplex and other mode filtering logic
Add a field to the host_set called 'flags' (was host_set_flags changed
to suit Jeff)
Add a simplex_claimed field so we can remember who owns the DMA channel
Add a ->mode_filter() hook to allow drivers to filter modes
Add docs for mode_filter and set_mode
Filter according to simplex state
Filter cable in core
This provides the needed framework to support all the mode rules found
in the PATA world. The simplex filter deals with 'to spec' simplex DMA
systems found in older chips. The cable filter avoids duplicating the
same rules in each chip driver with PATA. Finally the mode filter is
neccessary because drive/chip combinations have errata that forbid
certain modes with some drives or types of ATA object.
Drive speed setup remains per channel for now and the filters now use
the framework Tejun put into place which cleans them up a lot from the
older libata-pata patches.
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/DocBook/libata.tmpl | 47 |
1 files changed, 43 insertions, 4 deletions
diff --git a/Documentation/DocBook/libata.tmpl b/Documentation/DocBook/libata.tmpl index d260d92089ad..5bcbb6ee3bc0 100644 --- a/Documentation/DocBook/libata.tmpl +++ b/Documentation/DocBook/libata.tmpl | |||
@@ -120,14 +120,27 @@ void (*dev_config) (struct ata_port *, struct ata_device *); | |||
120 | <programlisting> | 120 | <programlisting> |
121 | void (*set_piomode) (struct ata_port *, struct ata_device *); | 121 | void (*set_piomode) (struct ata_port *, struct ata_device *); |
122 | void (*set_dmamode) (struct ata_port *, struct ata_device *); | 122 | void (*set_dmamode) (struct ata_port *, struct ata_device *); |
123 | void (*post_set_mode) (struct ata_port *ap); | 123 | void (*post_set_mode) (struct ata_port *); |
124 | unsigned int (*mode_filter) (struct ata_port *, struct ata_device *, unsigned int); | ||
124 | </programlisting> | 125 | </programlisting> |
125 | 126 | ||
126 | <para> | 127 | <para> |
127 | Hooks called prior to the issue of SET FEATURES - XFER MODE | 128 | Hooks called prior to the issue of SET FEATURES - XFER MODE |
128 | command. dev->pio_mode is guaranteed to be valid when | 129 | command. The optional ->mode_filter() hook is called when libata |
129 | ->set_piomode() is called, and dev->dma_mode is guaranteed to be | 130 | has built a mask of the possible modes. This is passed to the |
130 | valid when ->set_dmamode() is called. ->post_set_mode() is | 131 | ->mode_filter() function which should return a mask of valid modes |
132 | after filtering those unsuitable due to hardware limits. It is not | ||
133 | valid to use this interface to add modes. | ||
134 | </para> | ||
135 | <para> | ||
136 | dev->pio_mode and dev->dma_mode are guaranteed to be valid when | ||
137 | ->set_piomode() and when ->set_dmamode() is called. The timings for | ||
138 | any other drive sharing the cable will also be valid at this point. | ||
139 | That is the library records the decisions for the modes of each | ||
140 | drive on a channel before it attempts to set any of them. | ||
141 | </para> | ||
142 | <para> | ||
143 | ->post_set_mode() is | ||
131 | called unconditionally, after the SET FEATURES - XFER MODE | 144 | called unconditionally, after the SET FEATURES - XFER MODE |
132 | command completes successfully. | 145 | command completes successfully. |
133 | </para> | 146 | </para> |
@@ -230,6 +243,32 @@ void (*dev_select)(struct ata_port *ap, unsigned int device); | |||
230 | 243 | ||
231 | </sect2> | 244 | </sect2> |
232 | 245 | ||
246 | <sect2><title>Private tuning method</title> | ||
247 | <programlisting> | ||
248 | void (*set_mode) (struct ata_port *ap); | ||
249 | </programlisting> | ||
250 | |||
251 | <para> | ||
252 | By default libata performs drive and controller tuning in | ||
253 | accordance with the ATA timing rules and also applies blacklists | ||
254 | and cable limits. Some controllers need special handling and have | ||
255 | custom tuning rules, typically raid controllers that use ATA | ||
256 | commands but do not actually do drive timing. | ||
257 | </para> | ||
258 | |||
259 | <warning> | ||
260 | <para> | ||
261 | This hook should not be used to replace the standard controller | ||
262 | tuning logic when a controller has quirks. Replacing the default | ||
263 | tuning logic in that case would bypass handling for drive and | ||
264 | bridge quirks that may be important to data reliability. If a | ||
265 | controller needs to filter the mode selection it should use the | ||
266 | mode_filter hook instead. | ||
267 | </para> | ||
268 | </warning> | ||
269 | |||
270 | </sect2> | ||
271 | |||
233 | <sect2><title>Reset ATA bus</title> | 272 | <sect2><title>Reset ATA bus</title> |
234 | <programlisting> | 273 | <programlisting> |
235 | void (*phy_reset) (struct ata_port *ap); | 274 | void (*phy_reset) (struct ata_port *ap); |