Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Mar 2011 20:58:12 +0000 (UTC)
From:      Marius Strobl <marius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r219933 - stable/8/sys/dev/ata/chipsets
Message-ID:  <201103232058.p2NKwC5K006974@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marius
Date: Wed Mar 23 20:58:12 2011
New Revision: 219933
URL: http://svn.freebsd.org/changeset/base/219933

Log:
  MFC: r219337
  
  Add missing bus_dmamap_sync() calls for the work DMA map.

Modified:
  stable/8/sys/dev/ata/chipsets/ata-ahci.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/dev/ata/chipsets/ata-ahci.c
==============================================================================
--- stable/8/sys/dev/ata/chipsets/ata-ahci.c	Wed Mar 23 20:56:56 2011	(r219932)
+++ stable/8/sys/dev/ata/chipsets/ata-ahci.c	Wed Mar 23 20:58:12 2011	(r219933)
@@ -320,7 +320,11 @@ ata_ahci_ch_attach(device_t dev)
 static int
 ata_ahci_ch_detach(device_t dev)
 {
-
+    struct ata_channel *ch = device_get_softc(dev);
+ 
+    if (ch->dma.work_tag && ch->dma.work_map)
+	bus_dmamap_sync(ch->dma.work_tag, ch->dma.work_map,
+	    BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
     ata_ahci_ch_suspend(dev);
     ata_dmafini(dev);
     return (0);
@@ -495,6 +499,9 @@ ata_ahci_begin_transaction(struct ata_re
 		 ATA_INL(ctlr->r_res2, ATA_AHCI_P_CMD + offset) &
 		 ~ATA_AHCI_P_CMD_ATAPI);
 
+    bus_dmamap_sync(ch->dma.work_tag, ch->dma.work_map,
+	BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
+
     /* issue command to controller */
     ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_CI + offset, 1);
     
@@ -537,6 +544,9 @@ ata_ahci_end_transaction(struct ata_requ
     /* kill the timeout */
     callout_stop(&request->callout);
 
+    bus_dmamap_sync(ch->dma.work_tag, ch->dma.work_map,
+	BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
+
     /* get status */
     tf_data = ATA_INL(ctlr->r_res2, ATA_AHCI_P_TFD + offset);
     request->status = tf_data;
@@ -590,6 +600,9 @@ ata_ahci_issue_cmd(device_t dev, u_int16
     clp->bytecount = 0;
     clp->cmd_table_phys = htole64(ch->dma.work_bus + ATA_AHCI_CT_OFFSET);
 
+    bus_dmamap_sync(ch->dma.work_tag, ch->dma.work_map,
+	BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
+
     /* issue command to controller */
     ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_CI + offset, 1);
 
@@ -600,6 +613,9 @@ ata_ahci_issue_cmd(device_t dev, u_int16
             break;
     }
 
+    bus_dmamap_sync(ch->dma.work_tag, ch->dma.work_map,
+	BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
+
     /* clear interrupts */
     ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_IS + offset,
 	    ATA_INL(ctlr->r_res2, ATA_AHCI_P_IS + offset));



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