AHCI: Use bus_dmamap_sync(9) when accessing DMA buffers.

Reviewed by:	mav
Approved by:	kib (mentor)
Differential Revision: https://reviews.freebsd.org/D4240
This commit is contained in:
Michal Meloun 2015-11-28 14:30:42 +00:00
parent 1eb1d41a56
commit b1d2c95e1c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=291427

View File

@ -1606,10 +1606,15 @@ ahci_execute_transaction(struct ahci_slot *slot)
if ((ch->quirks & AHCI_Q_NOBSYRES) == 0 &&
(ch->quirks & AHCI_Q_ATI_PMP_BUG) == 0 &&
softreset == 2 && et == AHCI_ERR_NONE) {
while ((val = fis[2]) & ATA_S_BUSY) {
DELAY(10);
if (count++ >= timeout)
for ( ; count < timeout; count++) {
bus_dmamap_sync(ch->dma.rfis_tag,
ch->dma.rfis_map, BUS_DMASYNC_POSTREAD);
val = fis[2];
bus_dmamap_sync(ch->dma.rfis_tag,
ch->dma.rfis_map, BUS_DMASYNC_PREREAD);
if ((val & ATA_S_BUSY) == 0)
break;
DELAY(10);
}
}