diff options
Diffstat (limited to 'drivers/ata/libahci.c')
-rw-r--r-- | drivers/ata/libahci.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c index 8eea309ea212..137514dbbf65 100644 --- a/drivers/ata/libahci.c +++ b/drivers/ata/libahci.c | |||
@@ -1830,12 +1830,24 @@ static unsigned int ahci_qc_issue(struct ata_queued_cmd *qc) | |||
1830 | static bool ahci_qc_fill_rtf(struct ata_queued_cmd *qc) | 1830 | static bool ahci_qc_fill_rtf(struct ata_queued_cmd *qc) |
1831 | { | 1831 | { |
1832 | struct ahci_port_priv *pp = qc->ap->private_data; | 1832 | struct ahci_port_priv *pp = qc->ap->private_data; |
1833 | u8 *d2h_fis = pp->rx_fis + RX_FIS_D2H_REG; | 1833 | u8 *rx_fis = pp->rx_fis; |
1834 | 1834 | ||
1835 | if (pp->fbs_enabled) | 1835 | if (pp->fbs_enabled) |
1836 | d2h_fis += qc->dev->link->pmp * AHCI_RX_FIS_SZ; | 1836 | rx_fis += qc->dev->link->pmp * AHCI_RX_FIS_SZ; |
1837 | |||
1838 | /* | ||
1839 | * After a successful execution of an ATA PIO data-in command, | ||
1840 | * the device doesn't send D2H Reg FIS to update the TF and | ||
1841 | * the host should take TF and E_Status from the preceding PIO | ||
1842 | * Setup FIS. | ||
1843 | */ | ||
1844 | if (qc->tf.protocol == ATA_PROT_PIO && qc->dma_dir == DMA_FROM_DEVICE && | ||
1845 | !(qc->flags & ATA_QCFLAG_FAILED)) { | ||
1846 | ata_tf_from_fis(rx_fis + RX_FIS_PIO_SETUP, &qc->result_tf); | ||
1847 | qc->result_tf.command = (rx_fis + RX_FIS_PIO_SETUP)[15]; | ||
1848 | } else | ||
1849 | ata_tf_from_fis(rx_fis + RX_FIS_D2H_REG, &qc->result_tf); | ||
1837 | 1850 | ||
1838 | ata_tf_from_fis(d2h_fis, &qc->result_tf); | ||
1839 | return true; | 1851 | return true; |
1840 | } | 1852 | } |
1841 | 1853 | ||