summaryrefslogtreecommitdiffstats
path: root/target/linux/x86/patches-3.2/902-8139cp_config_rx_mode.patch
diff options
context:
space:
mode:
authorjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>2012-02-07 21:56:51 +0000
committerjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>2012-02-07 21:56:51 +0000
commit4cca99b95fc7be5f90a94b5b41b45c5c32360a38 (patch)
treeed09a964ee9a382c0a1e108b0c418280054de14d /target/linux/x86/patches-3.2/902-8139cp_config_rx_mode.patch
parent9b433b090a57ca648ca0e3eeb3ddc68136a7ccc7 (diff)
8139cp: backport patches to make driver stable again
List of patches that Jo-Philipp groveled out of git. Redux: defuzzed. Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@30366 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/x86/patches-3.2/902-8139cp_config_rx_mode.patch')
-rw-r--r--target/linux/x86/patches-3.2/902-8139cp_config_rx_mode.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/target/linux/x86/patches-3.2/902-8139cp_config_rx_mode.patch b/target/linux/x86/patches-3.2/902-8139cp_config_rx_mode.patch
new file mode 100644
index 000000000..e5c17d16f
--- /dev/null
+++ b/target/linux/x86/patches-3.2/902-8139cp_config_rx_mode.patch
@@ -0,0 +1,45 @@
+From f872b237c1750221932e715da2552225afe4a95c Mon Sep 17 00:00:00 2001
+From: Jason Wang <jasowang@redhat.com>
+Date: Fri, 30 Dec 2011 23:44:42 +0000
+Subject: [PATCH] 8139cp: properly config rx mode after resuming
+
+Rx mode should be reset after resming, so unconditionally updating rx
+mode rather than conditionally updating based on the value we
+remembered, otherwise unexpected value may be used by the nic after
+resuming.
+
+btw. I find and test this when debugging guest hibernation in qemu, as
+I did not have a 8139cp card in hand, this patch is untested in a
+physical 8139cp card, plase review it carefully.
+
+Signed-off-by: Jason Wang <jasowang@redhat.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/ethernet/realtek/8139cp.c | 9 +++------
+ 1 files changed, 3 insertions(+), 6 deletions(-)
+
+--- a/drivers/net/ethernet/realtek/8139cp.c
++++ b/drivers/net/ethernet/realtek/8139cp.c
+@@ -860,7 +860,6 @@ static void __cp_set_rx_mode (struct net
+ struct cp_private *cp = netdev_priv(dev);
+ u32 mc_filter[2]; /* Multicast hash filter */
+ int rx_mode;
+- u32 tmp;
+
+ /* Note: do not reorder, GCC is clever about common statements. */
+ if (dev->flags & IFF_PROMISC) {
+@@ -887,11 +886,9 @@ static void __cp_set_rx_mode (struct net
+ }
+
+ /* We can safely update without stopping the chip. */
+- tmp = cp_rx_config | rx_mode;
+- if (cp->rx_config != tmp) {
+- cpw32_f (RxConfig, tmp);
+- cp->rx_config = tmp;
+- }
++ cp->rx_config = cp_rx_config | rx_mode;
++ cpw32_f(RxConfig, cp->rx_config);
++
+ cpw32_f (MAR0 + 0, mc_filter[0]);
+ cpw32_f (MAR0 + 4, mc_filter[1]);
+ }