r8169: do not bring device down when suspending

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Thursday, June 18, 2009 - 3:02 pm

Gitweb:     http://git.kernel.org/linus/4bb3f522077f6b10531451f50c376d6137ebd364
Commit:     4bb3f522077f6b10531451f50c376d6137ebd364
Parent:     c2f3f3a2fe4e35db352cfe1176e384e36bfd91b1
Author:     françois romieu <romieu@fr.zoreil.com>
AuthorDate: Wed Jun 17 11:41:45 2009 +0000
Committer:  David S. Miller <davem@davemloft.net>
CommitDate: Wed Jun 17 18:46:47 2009 -0700

    r8169: do not bring device down when suspending
    
    Stopping all activity through ChipCmd and blindly acking the irqs
    is neither nice nor completely needed: the transition to low-power
    mode does enough work and it apparently keeps the device in a sane
    state.
    
    Patch suggested by a fix for http://bugzilla.kernel.org/show_bug.cgi?id=9512
    
    The rtl_shutdown path is kept unchanged so far.
    
    Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
    Tested-by: Anders Eriksson <aeriksson@fastmail.fm>
    Cc: Edward Hsu <edward_hsu@realtek.com.tw>
    Signed-off-by: David S. Miller <davem@davemloft.net>
---
 drivers/net/r8169.c |   19 ++++++++-----------
 1 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 35196fa..4e22462 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -3811,22 +3811,11 @@ static struct net_device_stats *rtl8169_get_stats(struct net_device *dev)
 
 static void rtl8169_net_suspend(struct net_device *dev)
 {
-	struct rtl8169_private *tp = netdev_priv(dev);
-	void __iomem *ioaddr = tp->mmio_addr;
-
 	if (!netif_running(dev))
 		return;
 
 	netif_device_detach(dev);
 	netif_stop_queue(dev);
-
-	spin_lock_irq(&tp->lock);
-
-	rtl8169_asic_down(ioaddr);
-
-	rtl8169_rx_missed(dev, ioaddr);
-
-	spin_unlock_irq(&tp->lock);
 }
 
 #ifdef CONFIG_PM
@@ -3876,9 +3865,17 @@ static struct dev_pm_ops rtl8169_pm_ops = {
 static void rtl_shutdown(struct pci_dev *pdev)
 {
 	struct net_device *dev = pci_get_drvdata(pdev);
+	struct rtl8169_private *tp = netdev_priv(dev);
+	void __iomem *ioaddr = tp->mmio_addr;
 
 	rtl8169_net_suspend(dev);
 
+	spin_lock_irq(&tp->lock);
+
+	rtl8169_asic_down(ioaddr);
+
+	spin_unlock_irq(&tp->lock);
+
 	if (system_state == SYSTEM_POWER_OFF) {
 		pci_wake_from_d3(pdev, true);
 		pci_set_power_state(pdev, PCI_D3hot);
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
r8169: do not bring device down when suspending, Linux Kernel Mailing ..., (Thu Jun 18, 3:02 pm)