Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 761ed01b authored by Andy Fleming's avatar Andy Fleming Committed by David S. Miller
Browse files

gianfar: Wait for both RX and TX to stop



When gracefully stopping the controller, the driver was continuing if
*either* RX or TX had stopped.  We need to wait for both, or the
controller could get into an invalid state.

Signed-off-by: default avatarAndy Fleming <afleming@freescale.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d87ff58f
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1511,9 +1511,9 @@ static void gfar_halt_nodisable(struct net_device *dev)
		tempval |= (DMACTRL_GRS | DMACTRL_GTS);
		gfar_write(&regs->dmactrl, tempval);

		while (!(gfar_read(&regs->ievent) &
			 (IEVENT_GRSC | IEVENT_GTSC)))
			cpu_relax();
		spin_event_timeout(((gfar_read(&regs->ievent) &
			 (IEVENT_GRSC | IEVENT_GTSC)) ==
			 (IEVENT_GRSC | IEVENT_GTSC)), -1, 0);
	}
}