diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 2c121d7..4e42180 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -31,7 +31,6 @@ #include #include #include -#include #include #include #include @@ -170,7 +169,11 @@ return -EIO; if (wbuf) - dma_flush_range((unsigned long)wbuf, (unsigned long)wbuf + buf_len); + dma_sync_single_for_device((unsigned long)wbuf, buf_len, + DMA_TO_DEVICE); + if (rbuf) + dma_sync_single_for_device((unsigned long)rbuf, buf_len, + DMA_FROM_DEVICE); memcpy((unsigned char *)ahci_port->cmd_tbl, fis, fis_len); @@ -187,8 +190,12 @@ if (ret) return -ETIMEDOUT; + if (wbuf) + dma_sync_single_for_cpu((unsigned long)wbuf, buf_len, + DMA_TO_DEVICE); if (rbuf) - dma_inv_range((unsigned long)rbuf, (unsigned long)rbuf + buf_len); + dma_sync_single_for_cpu((unsigned long)rbuf, buf_len, + DMA_FROM_DEVICE); return 0; }