WAN: Fix a TX IRQ causing BUG() in PC300 and PCI200SYN drivers.
We must not wake the TX queue without free TX descriptors. sca_xmit() expects at least one free descriptor and BUGs otherwise. Problem reported and fix tested by Bernie Innocenti and Ward Vandewege. Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
9f5449611c
commit
eaff9453d3
@@ -293,6 +293,7 @@ static inline void sca_tx_done(port_t *port)
|
|||||||
struct net_device *dev = port->netdev;
|
struct net_device *dev = port->netdev;
|
||||||
card_t* card = port->card;
|
card_t* card = port->card;
|
||||||
u8 stat;
|
u8 stat;
|
||||||
|
unsigned count = 0;
|
||||||
|
|
||||||
spin_lock(&port->lock);
|
spin_lock(&port->lock);
|
||||||
|
|
||||||
@@ -316,9 +317,11 @@ static inline void sca_tx_done(port_t *port)
|
|||||||
dev->stats.tx_bytes += readw(&desc->len);
|
dev->stats.tx_bytes += readw(&desc->len);
|
||||||
}
|
}
|
||||||
writeb(0, &desc->stat); /* Free descriptor */
|
writeb(0, &desc->stat); /* Free descriptor */
|
||||||
|
count++;
|
||||||
port->txlast = (port->txlast + 1) % card->tx_ring_buffers;
|
port->txlast = (port->txlast + 1) % card->tx_ring_buffers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (count)
|
||||||
netif_wake_queue(dev);
|
netif_wake_queue(dev);
|
||||||
spin_unlock(&port->lock);
|
spin_unlock(&port->lock);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user