Commit 88d11360 authored by Stephen Hemminger's avatar Stephen Hemminger Committed by Linus Torvalds

[PATCH] sky2: netconsole suspend/resume interaction

A couple of fixes that should prevent crashes when using netconsole and
suspend/resume. First, netconsole poll routine shouldn't run unless the
device is up; second, the NAPI poll should be disabled during suspend.

This is only an issue on sky2, because it has to have one NAPI poll
routine for both ports on dual port boards. Normal drivers use
netif_rx_schedule_prep and that checks for netif_running.
Signed-off-by: default avatarStephen Hemminger <shemminger@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 99172157
...@@ -2255,8 +2255,10 @@ static irqreturn_t sky2_intr(int irq, void *dev_id, struct pt_regs *regs) ...@@ -2255,8 +2255,10 @@ static irqreturn_t sky2_intr(int irq, void *dev_id, struct pt_regs *regs)
static void sky2_netpoll(struct net_device *dev) static void sky2_netpoll(struct net_device *dev)
{ {
struct sky2_port *sky2 = netdev_priv(dev); struct sky2_port *sky2 = netdev_priv(dev);
struct net_device *dev0 = sky2->hw->dev[0];
sky2_intr(sky2->hw->pdev->irq, sky2->hw, NULL); if (netif_running(dev) && __netif_rx_schedule_prep(dev0))
__netif_rx_schedule(dev0);
} }
#endif #endif
...@@ -3446,6 +3448,7 @@ static int sky2_suspend(struct pci_dev *pdev, pm_message_t state) ...@@ -3446,6 +3448,7 @@ static int sky2_suspend(struct pci_dev *pdev, pm_message_t state)
sky2_down(dev); sky2_down(dev);
netif_device_detach(dev); netif_device_detach(dev);
netif_poll_disable(dev);
} }
} }
...@@ -3474,6 +3477,8 @@ static int sky2_resume(struct pci_dev *pdev) ...@@ -3474,6 +3477,8 @@ static int sky2_resume(struct pci_dev *pdev)
struct net_device *dev = hw->dev[i]; struct net_device *dev = hw->dev[i];
if (dev && netif_running(dev)) { if (dev && netif_running(dev)) {
netif_device_attach(dev); netif_device_attach(dev);
netif_poll_enable(dev);
err = sky2_up(dev); err = sky2_up(dev);
if (err) { if (err) {
printk(KERN_ERR PFX "%s: could not up: %d\n", printk(KERN_ERR PFX "%s: could not up: %d\n",
......
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