]> git.sur5r.net Git - u-boot/commitdiff
net: altera_tse: wait sgdma in altera_tse_recv
authorThomas Chou <thomas@wytron.com.tw>
Mon, 9 Nov 2015 00:00:00 +0000 (08:00 +0800)
committerThomas Chou <thomas@wytron.com.tw>
Thu, 12 Nov 2015 00:26:59 +0000 (08:26 +0800)
Move the sgdma wait from free_pkt to recv. This is the proper
place to wait recv sgdma done.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Marek Vasut <marex@denx.de>
drivers/net/altera_tse.c

index fe8c524829212e5b3fa11068841dace7c47773a2..8ec0beb3f24dd74b2aa926f9073dce6afccedbf5 100644 (file)
@@ -186,6 +186,7 @@ static int altera_tse_recv(struct udevice *dev, int flags, uchar **packetp)
 
        if (rx_desc->descriptor_status &
            ALT_SGDMA_DESCRIPTOR_STATUS_TERMINATED_BY_EOP_MSK) {
+               alt_sgdma_wait_transfer(priv->sgdma_rx);
                packet_length = rx_desc->actual_bytes_transferred;
                debug("recv %d bytes\n", packet_length);
                *packetp = priv->rx_buf;
@@ -203,7 +204,6 @@ static int altera_tse_free_pkt(struct udevice *dev, uchar *packet,
        struct alt_sgdma_descriptor *rx_desc = priv->rx_desc;
        unsigned long rx_buf = (unsigned long)priv->rx_buf;
 
-       alt_sgdma_wait_transfer(priv->sgdma_rx);
        invalidate_dcache_range(rx_buf, rx_buf + PKTSIZE_ALIGN);
        alt_sgdma_construct_descriptor(
                rx_desc,