Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Mar 2011 20:59:20 +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: r219934 - stable/8/sys/dev/ata/chipsets
Message-ID:  <201103232059.p2NKxKpX007051@svn.freebsd.org>

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

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

Modified:
  stable/8/sys/dev/ata/chipsets/ata-siliconimage.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-siliconimage.c
==============================================================================
--- stable/8/sys/dev/ata/chipsets/ata-siliconimage.c	Wed Mar 23 20:58:12 2011	(r219933)
+++ stable/8/sys/dev/ata/chipsets/ata-siliconimage.c	Wed Mar 23 20:59:20 2011	(r219934)
@@ -494,7 +494,11 @@ ata_siiprb_ch_attach(device_t dev)
 static int
 ata_siiprb_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_POSTWRITE);
     ata_dmafini(dev);
     return 0;
 }
@@ -576,6 +580,8 @@ ata_siiprb_begin_transaction(struct ata_
 	}
     }
 
+    bus_dmamap_sync(ch->dma.work_tag, ch->dma.work_map, BUS_DMASYNC_PREWRITE);
+
     /* activate the prb */
     prb_bus = ch->dma.work_bus;
     ATA_OUTL(ctlr->r_res2, 0x1c00 + offset, prb_bus);
@@ -598,7 +604,9 @@ ata_siiprb_end_transaction(struct ata_re
 
     /* kill the timeout */
     callout_stop(&request->callout);
-    
+
+    bus_dmamap_sync(ch->dma.work_tag, ch->dma.work_map, BUS_DMASYNC_POSTWRITE);
+
     prb = (struct ata_siiprb_command *)
 	((u_int8_t *)rman_get_virtual(ctlr->r_res2) + offset);
 
@@ -671,6 +679,8 @@ ata_siiprb_issue_cmd(device_t dev)
     int offset = ch->unit * 0x2000;
     int timeout;
 
+    bus_dmamap_sync(ch->dma.work_tag, ch->dma.work_map, BUS_DMASYNC_PREWRITE);
+
     /* issue command to chip */
     ATA_OUTL(ctlr->r_res2, 0x1c00 + offset, prb_bus);
     ATA_OUTL(ctlr->r_res2, 0x1c04 + offset, prb_bus >> 32);
@@ -681,6 +691,9 @@ ata_siiprb_issue_cmd(device_t dev)
         if ((status = ATA_INL(ctlr->r_res2, 0x1008 + offset)) & 0x00010000)
             break;
     }
+
+    bus_dmamap_sync(ch->dma.work_tag, ch->dma.work_map, BUS_DMASYNC_POSTWRITE);
+
     // SOS XXX ATA_OUTL(ctlr->r_res2, 0x1008 + offset, 0x00010000);
     ATA_OUTL(ctlr->r_res2, 0x1008 + offset, 0x08ff08ff);
 



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