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

Commit eaff9453 authored by Krzysztof Halasa's avatar Krzysztof Halasa Committed by David S. Miller
Browse files

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: default avatarKrzysztof Hałasa <khc@pm.waw.pl>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9f544961
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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,9 +317,11 @@ 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;
	}

	if (count)
		netif_wake_queue(dev);
	spin_unlock(&port->lock);
}