Commit 71822faa authored by Ilkka Virta's avatar Ilkka Virta Committed by David S. Miller

sungem: Soft lockup in sungem on Netra AC200 when switching interface up

From: Ilkka Virta <itvirta@iki.fi>

In the lockup situation the driver seems to go off in an eternal storm
of interrupts right after calling request_irq(). It doesn't actually
do anything interesting in the interrupt handler. Since connecting the link
afterwards works, something later in initialization must fix this.

Looking at gem_do_start() and gem_open(), it seems that the only thing
done while opening the device after the request_irq(), is a call to
napi_enable().

I don't know what the ordering requirements are for the
initialization, but I boldly tried to move the napi_enable() call
inside gem_do_start() before the link state is checked and interrupts
subsequently enabled, and it seems to work for me. Doesn't even break
anything too obvious...
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 15bde727
...@@ -2221,6 +2221,8 @@ static int gem_do_start(struct net_device *dev) ...@@ -2221,6 +2221,8 @@ static int gem_do_start(struct net_device *dev)
gp->running = 1; gp->running = 1;
napi_enable(&gp->napi);
if (gp->lstate == link_up) { if (gp->lstate == link_up) {
netif_carrier_on(gp->dev); netif_carrier_on(gp->dev);
gem_set_link_modes(gp); gem_set_link_modes(gp);
...@@ -2238,6 +2240,8 @@ static int gem_do_start(struct net_device *dev) ...@@ -2238,6 +2240,8 @@ static int gem_do_start(struct net_device *dev)
spin_lock_irqsave(&gp->lock, flags); spin_lock_irqsave(&gp->lock, flags);
spin_lock(&gp->tx_lock); spin_lock(&gp->tx_lock);
napi_disable(&gp->napi);
gp->running = 0; gp->running = 0;
gem_reset(gp); gem_reset(gp);
gem_clean_rings(gp); gem_clean_rings(gp);
...@@ -2338,8 +2342,6 @@ static int gem_open(struct net_device *dev) ...@@ -2338,8 +2342,6 @@ static int gem_open(struct net_device *dev)
if (!gp->asleep) if (!gp->asleep)
rc = gem_do_start(dev); rc = gem_do_start(dev);
gp->opened = (rc == 0); gp->opened = (rc == 0);
if (gp->opened)
napi_enable(&gp->napi);
mutex_unlock(&gp->pm_mutex); mutex_unlock(&gp->pm_mutex);
...@@ -2476,8 +2478,6 @@ static int gem_resume(struct pci_dev *pdev) ...@@ -2476,8 +2478,6 @@ static int gem_resume(struct pci_dev *pdev)
/* Re-attach net device */ /* Re-attach net device */
netif_device_attach(dev); netif_device_attach(dev);
napi_enable(&gp->napi);
} }
spin_lock_irqsave(&gp->lock, flags); spin_lock_irqsave(&gp->lock, flags);
......
Markdown is supported
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