From d74472f0b2553e59eafb7feee0ff9558136a17e0 Mon Sep 17 00:00:00 2001 From: Finn Thain Date: Tue, 1 May 2007 22:33:02 +0200 Subject: SONIC: small fix and cleanup Fix a potential problem in the timeout handling: don't free the DMA buffers before resetting the chip. Also a trivial cleanup. Bring macsonic and jazzsonic into sync. Signed-off-by: Finn Thain Signed-off-by: Geert Uytterhoeven Signed-off-by: Linus Torvalds --- drivers/net/sonic.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'drivers/net/sonic.c') diff --git a/drivers/net/sonic.c b/drivers/net/sonic.c index c6320c719931..687c1413c4ee 100644 --- a/drivers/net/sonic.c +++ b/drivers/net/sonic.c @@ -178,8 +178,13 @@ static void sonic_tx_timeout(struct net_device *dev) { struct sonic_local *lp = netdev_priv(dev); int i; - /* Stop the interrupts for this */ + /* + * put the Sonic into software-reset mode and + * disable all interrupts before releasing DMA buffers + */ SONIC_WRITE(SONIC_IMR, 0); + SONIC_WRITE(SONIC_ISR, 0x7fff); + SONIC_WRITE(SONIC_CMD, SONIC_CR_RST); /* We could resend the original skbs. Easier to re-initialise. */ for (i = 0; i < SONIC_NUM_TDS; i++) { if(lp->tx_laddr[i]) { -- cgit v1.2.3