Author: mmel
Date: Sat Nov 28 14:30:42 2015
New Revision: 291427
URL: https://svnweb.freebsd.org/changeset/base/291427

Log:
  AHCI: Use bus_dmamap_sync(9) when accessing DMA buffers.
  
  Reviewed by:  mav
  Approved by:  kib (mentor)
  Differential Revision: https://reviews.freebsd.org/D4240

Modified:
  head/sys/dev/ahci/ahci.c

Modified: head/sys/dev/ahci/ahci.c
==============================================================================
--- head/sys/dev/ahci/ahci.c    Sat Nov 28 12:12:28 2015        (r291426)
+++ head/sys/dev/ahci/ahci.c    Sat Nov 28 14:30:42 2015        (r291427)
@@ -1606,10 +1606,15 @@ ahci_execute_transaction(struct ahci_slo
                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);
                        }
                }
 
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to