]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
kirkwood_egiga: bugfix: add DMA sequence points
authorAlbert Aribaud <albert.aribaud@free.fr>
Sat, 10 Jul 2010 13:41:29 +0000 (15:41 +0200)
committerBen Warren <biggerbadderben@gmail.com>
Mon, 12 Jul 2010 07:02:12 +0000 (00:02 -0700)
Insert isb() sequence points to ensure DMA descriptors
are filled in and set up before actual DMA occurs.

Signed-off-by: Albert Aribaud <albert.aribaud@free.fr>
Acked-by: Prafulla Wadaskar <prafulla@marvell.com>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
drivers/net/kirkwood_egiga.c

index 932792e364a25a9c7e9b152ef29b65cbcb4ff1c2..ea0c5223bbfba3ae67232e2ad54c2bdf4fa8f897 100644 (file)
@@ -447,6 +447,8 @@ static int kwgbe_init(struct eth_device *dev)
 
        /* Assignment of Rx CRDB of given RXUQ */
        KWGBEREG_WR(regs->rxcdp[RXUQ], (u32) dkwgbe->p_rxdesc_curr);
+       /* ensure previous write is done before enabling Rx DMA */
+       isb();
        /* Enable port Rx. */
        KWGBEREG_WR(regs->rqc, (1 << RXUQ));
 
@@ -536,8 +538,13 @@ static int kwgbe_send(struct eth_device *dev, volatile void *dataptr,
        p_txdesc->buf_ptr = (u8 *) p;
        p_txdesc->byte_cnt = datasize;
 
-       /* Apply send command using zeroth TXUQ */
+       /* Set this tc desc as zeroth TXUQ */
        KWGBEREG_WR(regs->tcqdp[TXUQ], (u32) p_txdesc);
+
+       /* ensure tx desc writes above are performed before we start Tx DMA */
+       isb();
+
+       /* Apply send command using zeroth TXUQ */
        KWGBEREG_WR(regs->tqc, (1 << TXUQ));
 
        /*