Skip to content

Commit 761ed01

Browse files
Andy Flemingdavem330
authored andcommitted
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: Andy Fleming <afleming@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent d87ff58 commit 761ed01

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎drivers/net/gianfar.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1511,9 +1511,9 @@ static void gfar_halt_nodisable(struct net_device *dev)
15111511
tempval |= (DMACTRL_GRS | DMACTRL_GTS);
15121512
gfar_write(&regs->dmactrl, tempval);
15131513

1514-
while (!(gfar_read(&regs->ievent) &
1515-
(IEVENT_GRSC | IEVENT_GTSC)))
1516-
cpu_relax();
1514+
spin_event_timeout(((gfar_read(&regs->ievent) &
1515+
(IEVENT_GRSC | IEVENT_GTSC)) ==
1516+
(IEVENT_GRSC | IEVENT_GTSC)), -1, 0);
15171517
}
15181518
}
15191519

0 commit comments

Comments
 (0)