Commit c7e6e052 authored by Andrew Morton's avatar Andrew Morton Committed by Christoph Hellwig

[PATCH] 8139too not running s3 suspend/resume pci fix

From: "Adrian Yee" <brewt-linux-kernel@brewt.org>

Having an 8139 based device in my notebook, I often switch between it and
wireless.  The problem is that the 8139too driver does not save/restore the
pci configuration of the card if the device isn't running.  This simple
patch moves the save/restore code so that the code runs regardless of
whether or not the device is running.

I looked at other drivers and they all seem to do the same thing.  Is there
a reason why this isn't done like in the patch?
parent 5c952629
......@@ -2554,6 +2554,8 @@ static int rtl8139_suspend (struct pci_dev *pdev, u32 state)
void *ioaddr = tp->mmio_addr;
unsigned long flags;
pci_save_state (pdev, tp->pci_state);
if (!netif_running (dev))
return 0;
......@@ -2572,7 +2574,6 @@ static int rtl8139_suspend (struct pci_dev *pdev, u32 state)
spin_unlock_irqrestore (&tp->lock, flags);
pci_set_power_state (pdev, 3);
pci_save_state (pdev, tp->pci_state);
return 0;
}
......@@ -2583,9 +2584,9 @@ static int rtl8139_resume (struct pci_dev *pdev)
struct net_device *dev = pci_get_drvdata (pdev);
struct rtl8139_private *tp = dev->priv;
pci_restore_state (pdev, tp->pci_state);
if (!netif_running (dev))
return 0;
pci_restore_state (pdev, tp->pci_state);
pci_set_power_state (pdev, 0);
rtl8139_init_ring (dev);
rtl8139_hw_start (dev);
......
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