]> jspc29.x-matter.uni-frankfurt.de Git - trbnettools.git/commitdiff
update
authorhadaq <hadaq>
Wed, 19 Oct 2011 16:38:26 +0000 (16:38 +0000)
committerhadaq <hadaq>
Wed, 19 Oct 2011 16:38:26 +0000 (16:38 +0000)
pexor/kernel-module/pexor_trb.c

index 0e6af13812004d7a0addbf77ad3aef582e4ee14c..1255e520978f0fc2b4f245e3b779bf4dfdbcafe8 100644 (file)
@@ -1355,13 +1355,13 @@ int pexor_ioctl_trbnet_request(struct pexor_privdata *priv, unsigned long arg)
     for (sg_ctr = 0; sg_ctr < priv->dma.nr_sglist; sg_ctr++) {
       unsigned int loops = 0;
       
-      mb();
       /* sync current sg-entry to Device */
       dma_sync_single_for_device(priv->class_dev,
                                  sg_dma_address(&priv->dma.sglist[sg_ctr]),
                                  sg_dma_len(&priv->dma.sglist[sg_ctr]),
                                  DMA_FROM_DEVICE);
-      
+      mb();
+
       iowrite32(sg_dma_address(&priv->dma.sglist[sg_ctr]),
                 priv->pexor.dma_dest);
       iowrite32(sg_dma_len(&priv->dma.sglist[sg_ctr]) / 4,
@@ -1397,6 +1397,14 @@ int pexor_ioctl_trbnet_request(struct pexor_privdata *priv, unsigned long arg)
           goto OUT_IOCTL;
         }
       }
+      
+      /* sync current sg-entry to CPU */
+      dma_sync_single_for_cpu(priv->class_dev,
+                              sg_dma_address(&priv->dma.sglist[sg_ctr]),
+                              sg_dma_len(&priv->dma.sglist[sg_ctr]),
+                              DMA_FROM_DEVICE);
+      mb();
+      
       /* Check for kernel timeout */
       if (loops == PEXOR_DMA_MAXPOLLS) {
         pexor_msg(KERN_ERR
@@ -1411,12 +1419,6 @@ int pexor_ioctl_trbnet_request(struct pexor_privdata *priv, unsigned long arg)
         goto OUT_IOCTL;
       }
 
-      /* sync current sg-entry to CPU */
-      dma_sync_single_for_cpu(priv->class_dev,
-                              sg_dma_address(&priv->dma.sglist[sg_ctr]),
-                              sg_dma_len(&priv->dma.sglist[sg_ctr]),
-                              DMA_FROM_DEVICE);
-      mb();
       
       /* Check status: do we need another dma for data */
       if (dmaSize > 0) {