Root/target/linux/x86/patches-3.2/902-8139cp_config_rx_mode.patch

1From f872b237c1750221932e715da2552225afe4a95c Mon Sep 17 00:00:00 2001
2From: Jason Wang <jasowang@redhat.com>
3Date: Fri, 30 Dec 2011 23:44:42 +0000
4Subject: [PATCH] 8139cp: properly config rx mode after resuming
5
6Rx mode should be reset after resming, so unconditionally updating rx
7mode rather than conditionally updating based on the value we
8remembered, otherwise unexpected value may be used by the nic after
9resuming.
10
11btw. I find and test this when debugging guest hibernation in qemu, as
12I did not have a 8139cp card in hand, this patch is untested in a
13physical 8139cp card, plase review it carefully.
14
15Signed-off-by: Jason Wang <jasowang@redhat.com>
16Signed-off-by: David S. Miller <davem@davemloft.net>
17---
18 drivers/net/ethernet/realtek/8139cp.c | 9 +++------
19 1 files changed, 3 insertions(+), 6 deletions(-)
20
21--- a/drivers/net/ethernet/realtek/8139cp.c
22+++ b/drivers/net/ethernet/realtek/8139cp.c
23@@ -860,7 +860,6 @@ static void __cp_set_rx_mode (struct net
24     struct cp_private *cp = netdev_priv(dev);
25     u32 mc_filter[2]; /* Multicast hash filter */
26     int rx_mode;
27- u32 tmp;
28 
29     /* Note: do not reorder, GCC is clever about common statements. */
30     if (dev->flags & IFF_PROMISC) {
31@@ -887,11 +886,9 @@ static void __cp_set_rx_mode (struct net
32     }
33 
34     /* We can safely update without stopping the chip. */
35- tmp = cp_rx_config | rx_mode;
36- if (cp->rx_config != tmp) {
37- cpw32_f (RxConfig, tmp);
38- cp->rx_config = tmp;
39- }
40+ cp->rx_config = cp_rx_config | rx_mode;
41+ cpw32_f(RxConfig, cp->rx_config);
42+
43     cpw32_f (MAR0 + 0, mc_filter[0]);
44     cpw32_f (MAR0 + 4, mc_filter[1]);
45 }
46

Archive Download this file



interactive