rpms/kernel/devel linux-2.6-r8169-fix-RxMissed-register-access.patch, NONE, 1.1 linux-2.6-r8169-wake-up-the-phy-of-the-8168.patch, NONE, 1.1 TODO, 1.30, 1.31 kernel.spec, 1.1085, 1.1086

Chuck Ebbert cebbert at fedoraproject.org
Sun Oct 26 05:37:43 UTC 2008


Author: cebbert

Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv24207

Modified Files:
	TODO kernel.spec 
Added Files:
	linux-2.6-r8169-fix-RxMissed-register-access.patch 
	linux-2.6-r8169-wake-up-the-phy-of-the-8168.patch 
Log Message:
Two patches for the r8169 network driver that should fix bug #460747

linux-2.6-r8169-fix-RxMissed-register-access.patch:

--- NEW FILE linux-2.6-r8169-fix-RxMissed-register-access.patch ---
From: Francois Romieu <romieu at fr.zoreil.com>
Date: Wed, 10 Sep 2008 20:28:56 +0000 (+0200)
Subject: r8169: fix RxMissed register access
X-Git-Tag: v2.6.28-rc1~717^2~195^2~71
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=523a609496dbc3897e530db2a2f27650d125ea00

r8169: fix RxMissed register access

- the register is defined for the 8169 chipset only and there is
  no 8169 beyond RTL_GIGA_MAC_VER_06.
- only the lower 3 bytes of the register are valid

Fixes:
1. http://bugzilla.kernel.org/show_bug.cgi?id=10180
2. http://bugzilla.kernel.org/show_bug.cgi?id=11062 (bits of)

Tested by Hermann Gausterer and Adam Huffman.

Signed-off-by: Francois Romieu <romieu at fr.zoreil.com>
Cc: Edward Hsu <edward_hsu at realtek.com.tw>
Signed-off-by: Jeff Garzik <jgarzik at redhat.com>
---

Index: vanilla-2.6.27/drivers/net/r8169.c
===================================================================
--- vanilla-2.6.27.orig/drivers/net/r8169.c
+++ vanilla-2.6.27/drivers/net/r8169.c
@@ -2099,8 +2099,6 @@ static void rtl_hw_start_8168(struct net
 
 	RTL_R8(IntrMask);
 
-	RTL_W32(RxMissed, 0);
-
 	rtl_set_rx_mode(dev);
 
 	RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb);
@@ -2143,8 +2141,6 @@ static void rtl_hw_start_8101(struct net
 
 	RTL_R8(IntrMask);
 
-	RTL_W32(RxMissed, 0);
-
 	rtl_set_rx_mode(dev);
 
 	RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb);
@@ -2922,6 +2918,17 @@ static int rtl8169_poll(struct napi_stru
 	return work_done;
 }
 
+static void rtl8169_rx_missed(struct net_device *dev, void __iomem *ioaddr)
+{
+	struct rtl8169_private *tp = netdev_priv(dev);
+
+	if (tp->mac_version > RTL_GIGA_MAC_VER_06)
+		return;
+
+	dev->stats.rx_missed_errors += (RTL_R32(RxMissed) & 0xffffff);
+	RTL_W32(RxMissed, 0);
+}
+
 static void rtl8169_down(struct net_device *dev)
 {
 	struct rtl8169_private *tp = netdev_priv(dev);
@@ -2939,9 +2946,7 @@ core_down:
 
 	rtl8169_asic_down(ioaddr);
 
-	/* Update the error counts. */
-	dev->stats.rx_missed_errors += RTL_R32(RxMissed);
-	RTL_W32(RxMissed, 0);
+	rtl8169_rx_missed(dev, ioaddr);
 
 	spin_unlock_irq(&tp->lock);
 
@@ -3063,8 +3068,7 @@ static struct net_device_stats *rtl8169_
 
 	if (netif_running(dev)) {
 		spin_lock_irqsave(&tp->lock, flags);
-		dev->stats.rx_missed_errors += RTL_R32(RxMissed);
-		RTL_W32(RxMissed, 0);
+		rtl8169_rx_missed(dev, ioaddr);
 		spin_unlock_irqrestore(&tp->lock, flags);
 	}
 
@@ -3089,8 +3093,7 @@ static int rtl8169_suspend(struct pci_de
 
 	rtl8169_asic_down(ioaddr);
 
-	dev->stats.rx_missed_errors += RTL_R32(RxMissed);
-	RTL_W32(RxMissed, 0);
+	rtl8169_rx_missed(dev, ioaddr);
 
 	spin_unlock_irq(&tp->lock);
 

linux-2.6-r8169-wake-up-the-phy-of-the-8168.patch:

--- NEW FILE linux-2.6-r8169-wake-up-the-phy-of-the-8168.patch ---
From: Francois Romieu <romieu at fr.zoreil.com>
Date: Wed, 3 Sep 2008 22:17:12 +0000 (+0200)
Subject: r8169: wake up the PHY of the 8168
X-Git-Tag: v2.6.28-rc1~717^2^2~13
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=a2de6b89b74b28052e293fdb39975a5a03c432e0

r8169: wake up the PHY of the 8168

This is typically needed when some other OS puts the PHY
to sleep due to the disabling of WOL options in the BIOS
of the system.

Signed-off-by: Francois Romieu <romieu at fr.zoreil.com>
Tested-by: Chiaki Ishikawa <chiaki.ishikawa at ubin.jp>
Cc: Edward Hsu <edward_hsu at realtek.com.tw>
Cc: RyanKao <ryankao at realtek.com.tw>
---

diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 59fbc64..9881563 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -865,9 +865,13 @@ static int rtl8169_set_speed_xmii(struct net_device *dev,
 
 	auto_nego |= ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM;
 
-	if ((tp->mac_version == RTL_GIGA_MAC_VER_12) ||
-	    (tp->mac_version == RTL_GIGA_MAC_VER_17)) {
-		/* Vendor specific (0x1f) and reserved (0x0e) MII registers. */
+	if ((tp->mac_version == RTL_GIGA_MAC_VER_11) ||
+	    (tp->mac_version == RTL_GIGA_MAC_VER_12) ||
+	    (tp->mac_version >= RTL_GIGA_MAC_VER_17)) {
+		/*
+		 * Wake up the PHY.
+		 * Vendor specific (0x1f) and reserved (0x0e) MII registers.
+		 */
 		mdio_write(ioaddr, 0x1f, 0x0000);
 		mdio_write(ioaddr, 0x0e, 0x0000);
 	}


Index: TODO
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/TODO,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- TODO	26 Oct 2008 05:04:32 -0000	1.30
+++ TODO	26 Oct 2008 05:37:12 -0000	1.31
@@ -187,3 +187,8 @@
 linux-2.6-sched-features-disable-hrtick.patch
 linux-2.6-sched_clock-prevent-scd-clock-from-moving-backwards
 	Scheduler patches from 2.6.28, should go to -stable
+
+linux-2.6-r8169-fix-RxMissed-register-access.patch
+linux-2.6-r8169-wake-up-the-phy-of-the-8168.patch
+	Selected patches from the r8169 2.6.28 driver.
+	Should go to stable after confirming they fix reported bugs.


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.1085
retrieving revision 1.1086
diff -u -r1.1085 -r1.1086
--- kernel.spec	26 Oct 2008 05:04:32 -0000	1.1085
+++ kernel.spec	26 Oct 2008 05:37:12 -0000	1.1086
@@ -663,13 +663,15 @@
 Patch2002: linux-2.6-e1000e-add-support-for-82567LM-3-and-82567LF-3-ICH10D-parts.patch
 Patch2003: linux-2.6-e1000e-add-support-for-new-82574L-part.patch
 
+# r8169 fixes
+Patch2005: linux-2.6-r8169-fix-RxMissed-register-access.patch
+Patch2006: linux-2.6-r8169-wake-up-the-phy-of-the-8168.patch
+
 # Make Eee laptop driver suck less
 Patch2011: linux-2.6-eeepc-laptop-update.patch
 
 # atl2 network driver
 Patch2020: linux-2.6-netdev-atl2.patch
-# latest upstream r8169 driver
-Patch2021: linux-2.6.27-net-r8169-2.6.28.patch
 
 # Fix DEBUG_SHIRQ problem in tulip driver.  (454575)
 Patch2030: linux-2.6-net-tulip-interrupt.patch
@@ -1251,12 +1253,13 @@
 ApplyPatch linux-2.6-e1000e-add-support-for-82567LM-3-and-82567LF-3-ICH10D-parts.patch
 ApplyPatch linux-2.6-e1000e-add-support-for-new-82574L-part.patch
 
+ApplyPatch linux-2.6-r8169-fix-RxMissed-register-access.patch
+ApplyPatch linux-2.6-r8169-wake-up-the-phy-of-the-8168.patch
+
 ApplyPatch linux-2.6-eeepc-laptop-update.patch
 
 # atl2 network driver
 ApplyPatch linux-2.6-netdev-atl2.patch
-# update r8169 to latest upstream
-#ApplyPatch linux-2.6.27-net-r8169-2.6.28.patch
 
 ApplyPatch linux-2.6-net-tulip-interrupt.patch
 
@@ -1867,6 +1870,9 @@
 %kernel_variant_files -k vmlinux %{with_kdump} kdump
 
 %changelog
+* Sat Oct 25 2008 Chuck Ebbert <cebbert at redhat.com> 2.6.27.4-50.rc3
+- Two patches for the r8169 network driver that should fix bug #460747
+
 * Sat Oct 25 2008 Chuck Ebbert <cebbert at redhat.com> 2.6.27.4-49.rc3
 - Scheduler fixes from 2.6.28, fixing performance problems:
     Disable HRTICK scheduler feature.




More information about the scm-commits mailing list