Commit d119b392 authored by Michal Schmidt's avatar Michal Schmidt Committed by David S. Miller
Browse files

skge: fix occasional BUG during MTU change

The BUG_ON(skge->tx_ring.to_use != skge->tx_ring.to_clean) in skge_up()
was sometimes observed when setting MTU.

skge_down() disables the TX queue, but then reenables it by mistake via
Fix it by moving the waking of the queue from skge_tx_clean() to the
other caller. And to make sure start_xmit is not in progress on another
CPU, skge_down() should call netif_tx_disable().

The bug was reported to me by Jiri Jilek whose Debian system sometimes
failed to boot. He tested the patch and the bug did not happen anymore.

Signed-off-by: default avatarMichal Schmidt <>
Acked-by: default avatarStephen Hemminger <>
Signed-off-by: default avatarDavid S. Miller <>
parent fc59f9a3
......@@ -2674,7 +2674,7 @@ static int skge_down(struct net_device *dev)
if (netif_msg_ifdown(skge))
printk(KERN_INFO PFX "%s: disabling interface\n", dev->name);
if (hw->chip_id == CHIP_ID_GENESIS && hw->phy_type == SK_PHY_XMAC)
......@@ -2881,7 +2881,6 @@ static void skge_tx_clean(struct net_device *dev)
skge->tx_ring.to_clean = e;
static void skge_tx_timeout(struct net_device *dev)
......@@ -2893,6 +2892,7 @@ static void skge_tx_timeout(struct net_device *dev)
skge_write8(skge->hw, Q_ADDR(txqaddr[skge->port], Q_CSR), CSR_STOP);
static int skge_change_mtu(struct net_device *dev, int new_mtu)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment