Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 Nov 2015 14:30:42 +0000 (UTC)
From:      Michal Meloun <mmel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r291427 - head/sys/dev/ahci
Message-ID:  <201511281430.tASEUgsf086522@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 			}
 		}
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201511281430.tASEUgsf086522>