提交 b9f8ab2d 编写于 作者: A Alan Cox 提交者: Jeff Garzik

libata: IORDY handling

I believe this version meets all Sergei's objections

Correct the logic for when we issue a set features for transfer mode

- If the device has IORDY and the controller has IORDY - set the mode
- If the device has IORDY and the controller does not - turn IORDY off
- If neither has IORDY do nothing
Signed-off-by: NAlan Cox <alan@redhat.com>
Signed-off-by: NJeff Garzik <jeff@garzik.org>
上级 bd3adca5
...@@ -4373,7 +4373,14 @@ static unsigned int ata_dev_set_xfermode(struct ata_device *dev) ...@@ -4373,7 +4373,14 @@ static unsigned int ata_dev_set_xfermode(struct ata_device *dev)
tf.feature = SETFEATURES_XFER; tf.feature = SETFEATURES_XFER;
tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE | ATA_TFLAG_POLLING; tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE | ATA_TFLAG_POLLING;
tf.protocol = ATA_PROT_NODATA; tf.protocol = ATA_PROT_NODATA;
tf.nsect = dev->xfer_mode; /* If we are using IORDY we must send the mode setting command */
if (ata_pio_need_iordy(dev))
tf.nsect = dev->xfer_mode;
/* If the device has IORDY and the controller does not - turn it off */
else if (ata_id_has_iordy(dev->id))
tf.nsect = 0x01;
else /* In the ancient relic department - skip all of this */
return 0;
err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0, 0); err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0, 0);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册