]> git.karo-electronics.de Git - linux-beck.git/commitdiff
net: bcmgenet: cleanup for dmadesc_set()
authorPetri Gynther <pgynther@google.com>
Tue, 5 Apr 2016 21:00:01 +0000 (14:00 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 5 Apr 2016 23:33:52 +0000 (19:33 -0400)
dmadesc_set() is used for setting the Tx buffer DMA address, length,
and status bits on a Tx ring descriptor when a frame is being Tx'ed.

Always set the Tx buffer DMA address first, before updating the length
and status bits, i.e. giving the Tx descriptor to the hardware.

The reason this is a cleanup rather than a fix is that the hardware
won't transmit anything from a Tx ring until the TDMA producer index
has been incremented. As long as the dmadesc_set() writes complete
before the TDMA producer index write, life is good.

Signed-off-by: Petri Gynther <pgynther@google.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/genet/bcmgenet.c

index d77cd6dee0922ffef0772a82042dd8d7e356845e..f7b42b9fc9795074c97d26a73e768ec843340efd 100644 (file)
@@ -104,8 +104,8 @@ static inline void dmadesc_set_addr(struct bcmgenet_priv *priv,
 static inline void dmadesc_set(struct bcmgenet_priv *priv,
                               void __iomem *d, dma_addr_t addr, u32 val)
 {
-       dmadesc_set_length_status(priv, d, val);
        dmadesc_set_addr(priv, d, addr);
+       dmadesc_set_length_status(priv, d, val);
 }
 
 static inline dma_addr_t dmadesc_get_addr(struct bcmgenet_priv *priv,