[PATCH 2/4] net: mvneta: Fix transmit errors due to dirty txdesc

Sebastian Hesselbarth sebastian.hesselbarth at gmail.com
Thu Apr 9 18:01:52 PDT 2015

Marvell Neta's transmit descriptor (txdesc) is allocated by dma_alloc_coherent()
but not zeroed before calling mvneta_send the first time. This can cause spurious
transmit errors due to improperly set bits in txdesc's cmd_sts field.

Fix initial transmit errors by always writing whole cmd_sts field instead of ORing
the bits.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth at gmail.com>
Cc: barebox at lists.infradead.org
Cc: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
Cc: Ezequiel Garcia <ezequiel.garcia at free-electrons.com>
Cc: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>
 drivers/net/mvneta.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mvneta.c b/drivers/net/mvneta.c
index d4c8a2c68dd2..3be2ec531fb1 100644
--- a/drivers/net/mvneta.c
+++ b/drivers/net/mvneta.c
@@ -396,7 +396,7 @@ static int mvneta_send(struct eth_device *edev, void *data, int len)
 	dma_sync_single_for_device((unsigned long)data, len, DMA_TO_DEVICE);
 	/* Fill the Tx descriptor */
-	txdesc->cmd_sts |= MVNETA_TX_L4_CSUM_NOT | MVNETA_TXD_FLZ_DESC;
+	txdesc->cmd_sts = MVNETA_TX_L4_CSUM_NOT | MVNETA_TXD_FLZ_DESC;
 	txdesc->buf_ptr = (u32)data;
 	txdesc->byte_cnt = len;

More information about the barebox mailing list