diff options
author | Krzysztof Halasa <khc@pm.waw.pl> | 2010-12-12 12:06:47 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-12-12 15:03:00 -0800 |
commit | eaff9453d3e2b63969af93e9d42a85e803060121 (patch) | |
tree | f27368d0796494cc8d8469e2f387cb2d43f4b209 /drivers/net | |
parent | 9f5449611c9d6d7bdcae8020a197d8b4d9b6443c (diff) |
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>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wan/hd64572.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/wan/hd64572.c b/drivers/net/wan/hd64572.c index ea476cbd38b..e305274f83f 100644 --- a/drivers/net/wan/hd64572.c +++ b/drivers/net/wan/hd64572.c @@ -293,6 +293,7 @@ static inline void sca_tx_done(port_t *port) struct net_device *dev = port->netdev; card_t* card = port->card; u8 stat; + unsigned count = 0; spin_lock(&port->lock); @@ -316,10 +317,12 @@ static inline void sca_tx_done(port_t *port) dev->stats.tx_bytes += readw(&desc->len); } writeb(0, &desc->stat); /* Free descriptor */ + count++; port->txlast = (port->txlast + 1) % card->tx_ring_buffers; } - netif_wake_queue(dev); + if (count) + netif_wake_queue(dev); spin_unlock(&port->lock); } |