net: sun8i_emac: Don't hand out TX descriptor too early
authorAndre Przywara <andre.przywara@arm.com>
Mon, 6 Jul 2020 00:40:33 +0000 (01:40 +0100)
committerJagan Teki <jagan@amarulasolutions.com>
Wed, 21 Oct 2020 18:12:36 +0000 (23:42 +0530)
commitc35380c756a607f857b57aaaf93c53648ca10e9e
tree590632f0c1256d1b91f49b01413a6049dfc1e1b0
parent2808cf6c60b5484296651e23066c4b36594f0240
net: sun8i_emac: Don't hand out TX descriptor too early

When initialising the TX DMA descriptors, we mostly chain them up,
but of course don't know about any data or its length yet.
That means they are still invalid, and the OWN bit should NOT be set
yet.

In fact when we later tell the MAC about the beginning of the chain,
and enable TX DMA in the start() routine, the MAC will start fetching
TX descriptors prematurely, as it can be seen by dumping the TX_DMA_STA
and TX_DMA_CUR_DESC registers.

Clear the owner bit, to not give the MAC the wrong illusion that it
owns the descriptors already.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Maxime Ripard <mripard@kernel.org>
Tested-by: Amit Singh Tomar <amittomer25@gmail.com> # Pine64+
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
drivers/net/sun8i_emac.c