From: Jason Wang Date: Fri, 30 Dec 2011 23:44:42 +0000 (+0000) Subject: 8139cp: properly config rx mode after resuming X-Git-Tag: v2.6.39-400.9.0~423^2~19^2~11^2~407 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=8560cba3fd4d2316fbe1659c346655be37e08ed0;p=users%2Fjedix%2Flinux-maple.git 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. (cherry picked from commit f872b237c1750221932e715da2552225afe4a95c) Signed-off-by: Jason Wang Signed-off-by: David S. Miller Signed-off-by: Joe Jin --- diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c index 10c45051caea..eb8631292b8b 100644 --- a/drivers/net/8139cp.c +++ b/drivers/net/8139cp.c @@ -891,7 +891,6 @@ static void __cp_set_rx_mode (struct net_device *dev) 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) { @@ -918,11 +917,9 @@ static void __cp_set_rx_mode (struct net_device *dev) } /* 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]); }