diff options
author | Alan Cox <alan@redhat.com> | 2009-03-24 06:23:19 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2009-03-24 22:48:26 -0400 |
commit | 3d47aa8e7e7b2aa09256590388aa8dddc79280f9 (patch) | |
tree | 82f4c85842e5e02489eb0533609dabb865e55198 /include/linux/libata.h | |
parent | c0f2ee34a5a0b79fd98d965ad8ae765d4639bfa5 (diff) |
[libata] Drain data on errors
If the device is signalling that there is data to drain after an error we
should read the bytes out and throw them away. Without this some devices
and controllers get wedged and don't recover.
Based on earlier work by Mark Lord
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'include/linux/libata.h')
-rw-r--r-- | include/linux/libata.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h index 19af7d22a7f8..3a07a32dfc2e 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -836,6 +836,8 @@ struct ata_port_operations { | |||
836 | void (*bmdma_start)(struct ata_queued_cmd *qc); | 836 | void (*bmdma_start)(struct ata_queued_cmd *qc); |
837 | void (*bmdma_stop)(struct ata_queued_cmd *qc); | 837 | void (*bmdma_stop)(struct ata_queued_cmd *qc); |
838 | u8 (*bmdma_status)(struct ata_port *ap); | 838 | u8 (*bmdma_status)(struct ata_port *ap); |
839 | |||
840 | void (*drain_fifo)(struct ata_queued_cmd *qc); | ||
839 | #endif /* CONFIG_ATA_SFF */ | 841 | #endif /* CONFIG_ATA_SFF */ |
840 | 842 | ||
841 | ssize_t (*em_show)(struct ata_port *ap, char *buf); | 843 | ssize_t (*em_show)(struct ata_port *ap, char *buf); |
@@ -1587,6 +1589,7 @@ extern int ata_sff_softreset(struct ata_link *link, unsigned int *classes, | |||
1587 | extern int sata_sff_hardreset(struct ata_link *link, unsigned int *class, | 1589 | extern int sata_sff_hardreset(struct ata_link *link, unsigned int *class, |
1588 | unsigned long deadline); | 1590 | unsigned long deadline); |
1589 | extern void ata_sff_postreset(struct ata_link *link, unsigned int *classes); | 1591 | extern void ata_sff_postreset(struct ata_link *link, unsigned int *classes); |
1592 | extern void ata_sff_drain_fifo(struct ata_queued_cmd *qc); | ||
1590 | extern void ata_sff_error_handler(struct ata_port *ap); | 1593 | extern void ata_sff_error_handler(struct ata_port *ap); |
1591 | extern void ata_sff_post_internal_cmd(struct ata_queued_cmd *qc); | 1594 | extern void ata_sff_post_internal_cmd(struct ata_queued_cmd *qc); |
1592 | extern int ata_sff_port_start(struct ata_port *ap); | 1595 | extern int ata_sff_port_start(struct ata_port *ap); |