aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-core.c
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2007-11-27 05:28:58 -0500
committerJeff Garzik <jeff@garzik.org>2008-01-23 05:24:11 -0500
commit00115e0f5bc3bfdf3f3855ad89c8895f10458f92 (patch)
tree5f174c1d68e1ec0770fefdb40b813f321a838095 /drivers/ata/libata-core.c
parent663f99b86ac7d4c0eed8c239638da0ea8849288b (diff)
libata: implement ATA_DFLAG_DUBIOUS_XFER
ATA_DFLAG_DUBIOUS_XFER is set whenever data transfer speed or method changes and gets cleared when data transfer command succeeds in the newly configured transfer mode. This will be used to improve speed down logic. Signed-off-by: Tejun Heo <htejun@gmail.com< Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/libata-core.c')
-rw-r--r--drivers/ata/libata-core.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 86c10cc751e9..124b6f111cc3 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -5797,6 +5797,22 @@ static void fill_result_tf(struct ata_queued_cmd *qc)
5797 ap->ops->tf_read(ap, &qc->result_tf); 5797 ap->ops->tf_read(ap, &qc->result_tf);
5798} 5798}
5799 5799
5800static void ata_verify_xfer(struct ata_queued_cmd *qc)
5801{
5802 struct ata_device *dev = qc->dev;
5803
5804 if (ata_tag_internal(qc->tag))
5805 return;
5806
5807 if (ata_is_nodata(qc->tf.protocol))
5808 return;
5809
5810 if ((dev->mwdma_mask || dev->udma_mask) && ata_is_pio(qc->tf.protocol))
5811 return;
5812
5813 dev->flags &= ~ATA_DFLAG_DUBIOUS_XFER;
5814}
5815
5800/** 5816/**
5801 * ata_qc_complete - Complete an active ATA command 5817 * ata_qc_complete - Complete an active ATA command
5802 * @qc: Command to complete 5818 * @qc: Command to complete
@@ -5868,6 +5884,9 @@ void ata_qc_complete(struct ata_queued_cmd *qc)
5868 break; 5884 break;
5869 } 5885 }
5870 5886
5887 if (unlikely(dev->flags & ATA_DFLAG_DUBIOUS_XFER))
5888 ata_verify_xfer(qc);
5889
5871 __ata_qc_complete(qc); 5890 __ata_qc_complete(qc);
5872 } else { 5891 } else {
5873 if (qc->flags & ATA_QCFLAG_EH_SCHEDULED) 5892 if (qc->flags & ATA_QCFLAG_EH_SCHEDULED)