aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-core.c
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2007-05-27 09:10:40 -0400
committerJeff Garzik <jeff@garzik.org>2007-06-04 16:48:34 -0400
commit464cf177df7727efcc5506322fc5d0c8b896f545 (patch)
tree7b6546aab9c5a7f326ddc27c7a456287172f3c64 /drivers/ata/libata-core.c
parenta862b5c8cd5d847779a049a5fc8cf5b1e6f5fa07 (diff)
libata: always use polling SETXFER
Several people have reported LITE-ON LTR-48246S detection failed because SETXFER fails. It seems the device raises IRQ too early after SETXFER. This is controller independent. The same problem has been reported for different controllers. So, now we have pata_via where the controller raises IRQ before it's ready after SETXFER and a device which does similar thing. This patch makes libata always execute SETXFER via polling. As this only happens during EH, performance impact is nil. Setting ATA_TFLAG_POLLING is also moved from issue hot path to ata_dev_set_xfermode() - the only place where SETXFER can be issued. Note that ATA_TFLAG_POLLING applies only to drivers which implement SFF TF interface and use libata HSM. More advanced controllers ignore the flag. This doesn't matter for this fix as SFF TF controllers are the problematic ones. 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.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index af625147df62..4733f009c7c9 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -3933,10 +3933,13 @@ static unsigned int ata_dev_set_xfermode(struct ata_device *dev)
3933 /* set up set-features taskfile */ 3933 /* set up set-features taskfile */
3934 DPRINTK("set features - xfer mode\n"); 3934 DPRINTK("set features - xfer mode\n");
3935 3935
3936 /* Some controllers and ATAPI devices show flaky interrupt
3937 * behavior after setting xfer mode. Use polling instead.
3938 */
3936 ata_tf_init(dev, &tf); 3939 ata_tf_init(dev, &tf);
3937 tf.command = ATA_CMD_SET_FEATURES; 3940 tf.command = ATA_CMD_SET_FEATURES;
3938 tf.feature = SETFEATURES_XFER; 3941 tf.feature = SETFEATURES_XFER;
3939 tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE; 3942 tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE | ATA_TFLAG_POLLING;
3940 tf.protocol = ATA_PROT_NODATA; 3943 tf.protocol = ATA_PROT_NODATA;
3941 tf.nsect = dev->xfer_mode; 3944 tf.nsect = dev->xfer_mode;
3942 3945
@@ -5414,14 +5417,6 @@ unsigned int ata_qc_issue_prot(struct ata_queued_cmd *qc)
5414 } 5417 }
5415 } 5418 }
5416 5419
5417 /* Some controllers show flaky interrupt behavior after
5418 * setting xfer mode. Use polling instead.
5419 */
5420 if (unlikely(qc->tf.command == ATA_CMD_SET_FEATURES &&
5421 qc->tf.feature == SETFEATURES_XFER) &&
5422 (ap->flags & ATA_FLAG_SETXFER_POLLING))
5423 qc->tf.flags |= ATA_TFLAG_POLLING;
5424
5425 /* select the device */ 5420 /* select the device */
5426 ata_dev_select(ap, qc->dev->devno, 1, 0); 5421 ata_dev_select(ap, qc->dev->devno, 1, 0);
5427 5422