From: Manfred Spraul Date: Sun, 11 Sep 2005 20:33:28 +0000 (+0100) Subject: [PATCH] forcedeth: Initialize link settings in every nv_open() X-Git-Tag: v2.6.13.2~9 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=2498037d5a6668b733acc712a3106ffd4e1ef735;p=karo-tx-linux.git [PATCH] forcedeth: Initialize link settings in every nv_open() R�diger found a bug in nv_open that explains some of the reports with duplex mismatches: nv_open calls nv_update_link_speed for initializing the hardware link speed registers. If current link setting matches the values in np->linkspeed and np->duplex, then the function does nothing. Usually, doing nothing is the right thing, but not in nv_open: During nv_open, the registers must be initialized because the nic was reset. The attached patch fixes that by setting np->linkspeed to an invalid value before calling nv_update_link_speed from nv_open. Signed-Off-By: Manfred Spraul Signed-off-by: Jeff Garzik Signed-off-by: Chris Wright --- diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index 64f0f697c958..96ee37bb9399 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c @@ -1888,6 +1888,9 @@ static int nv_open(struct net_device *dev) writel(NVREG_MIISTAT_MASK, base + NvRegMIIStatus); dprintk(KERN_INFO "startup: got 0x%08x.\n", miistat); } + /* set linkspeed to invalid value, thus force nv_update_linkspeed + * to init hw */ + np->linkspeed = 0; ret = nv_update_linkspeed(dev); nv_start_rx(dev); nv_start_tx(dev);