remarkable-linux/drivers
Xiaoming.Zhang 9ac1353f38 [10/21] driver/net/skge.c: restart the interface when it's options or
pauseparam is set

On Wednesday 24 September 2008 07:47, Stephen Hemminger wrote:
> On Mon, 22 Sep 2008 14:52:17 -0700
>
> akpm@linux-foundation.org wrote:
> > From: "Xiaoming.Zhang" <Xiaoming.Zhang@resilience.com>
> >
> > We have an issue of the skge driver: The card won't work when it's
> > options are changed.  Here's the hardware info:
> >
> > # lspci -v
> > 05:04.0 Ethernet controller: Marvell Technology Group Ltd. 88E8001
> > Gigabit Ethernet Controller (rev 13) Subsystem: Marvell Technology Group
> > Ltd. Marvell RDK-8001 Flags: bus master, 66MHz, medium devsel, latency
> > 32, IRQ 16 Memory at d042c000 (32-bit, non-prefetchable) [size=16K] I/O
> > ports at d000 [size=256]
> >         [virtual] Expansion ROM at 20400000 [disabled] [size=128K]
> >         Capabilities: [48] Power Management version 2
> >         Capabilities: [50] Vital Product Data
> >
> > The happens in both Linux-2.6.26(skge version 1.23) and RHEL5.2(skge
> > version 1.6).
> >
> > For example, at first it is set to "speed 1000 duplex full auto-neg on"
> > and it works, then run
> >
> >        ethtool -s <ethx> autoneg off
> > or     ethtool -s <ethx> speed 100 duplex full autoneg off
> >
> > Then it will stop working. After that if we restart the interface:
> >
> > 	ifconifg <ethx> down
> > 	ifconfig <ethx> up
> >
> > It will work again. And `ethtool -A' has the same issue.
> >
> > So we think after setting the options, the interface should be restarted.
> >
> > Signed-off-by: Zhang Xiaoming <xiaoming.zhang@resilience.com>
> > Cc: Stephen Hemminger <shemminger@vyatta.com>
> > Cc: Jeff Garzik <jeff@garzik.org>
> > Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> > ---
> >
> >  drivers/net/skge.c |   12 ++++++++----
> >  1 file changed, 8 insertions(+), 4 deletions(-)
> >
> > diff -puN
> > drivers/net/skge.c~driver-net-skgec-restart-the-interface-when-its-option
> >s-or-pauseparam-is-set drivers/net/skge.c ---
> > a/drivers/net/skge.c~driver-net-skgec-restart-the-interface-when-its-opti
> >ons-or-pauseparam-is-set +++ a/drivers/net/skge.c
> > @@ -353,8 +353,10 @@ static int skge_set_settings(struct net_
> >  	skge->autoneg = ecmd->autoneg;
> >  	skge->advertising = ecmd->advertising;
> >
> > -	if (netif_running(dev))
> > -		skge_phy_reset(skge);
> > +	if (netif_running(dev)) {
> > +		skge_down(dev);
> > +		skge_up(dev);
> > +	}
> >
> >  	return (0);
> >  }
> > @@ -595,8 +597,10 @@ static int skge_set_pauseparam(struct ne
> >  			skge->flow_control = FLOW_MODE_NONE;
> >  	}
> >
> > -	if (netif_running(dev))
> > -		skge_phy_reset(skge);
> > +	if (netif_running(dev)) {
> > +		skge_down(dev);
> > +		skge_up(dev);
> > +	}
> >
> >  	return 0;
> >  }
>
> Since skge_up can fail because of out of memory, this code needs to
> check the return value. And then if it fails the "limbo state" needs
> to be handled in skge_down.

How about like this? It is tested.

Thank you.

Signed-off-by: Zhang Xiaoming <xiaoming.zhang@resilience.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-10-08 16:00:57 -07:00
..
accessibility braille_console: only register notifiers when the braille console is used 2008-10-02 15:53:13 -07:00
acpi Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2008-10-08 14:56:41 -07:00
amba
ata sata_nv: reinstate nv_hardreset() for non generic controllers 2008-09-29 00:14:34 -04:00
atm drivers/atm: Use DIV_ROUND_UP 2008-09-22 19:22:58 -07:00
auxdisplay
base
block aoe: Fix OOPS after SKB queue changes. 2008-09-23 20:47:22 -07:00
bluetooth Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2008-10-08 14:56:41 -07:00
cdrom
char kgdboc,tty: Fix tty polling search to use name correctly 2008-09-26 10:36:42 -05:00
clocksource
connector
cpufreq
cpuidle
crypto crypto: talitos - Avoid consecutive packets going out with same IV 2008-09-14 13:41:19 -07:00
dca
dio
dma dw_dmac: fix copy/paste bug in tasklet 2008-10-03 18:22:18 -07:00
edac
eisa
firewire
firmware
gpio
gpu
hid
hwmon hwmon: (ad7414) Make ad7414_update_device() static 2008-09-20 10:25:20 +02:00
i2c i2c-dev: Return correct error code on class_create() failure 2008-09-24 13:39:21 +02:00
ide ide: workaround for bogus gcc warning in ide_sysfs_register_port() 2008-10-05 18:23:28 +02:00
ieee1394
infiniband IPoIB: Fix crash when path record fails after path flush 2008-09-25 16:37:03 -07:00
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2008-09-22 07:46:06 -07:00
isdn mISDN: misc timerdev fixes 2008-09-22 19:18:15 -07:00
leds leds-pca955x: add proper error handling and fix bogus memory handling 2008-10-03 18:22:18 -07:00
lguest
macintosh
mca
md dm mpath: add missing path switching locking 2008-10-01 14:39:27 +01:00
media Revert "V4L/DVB (8904): cx88: add missing unlock_kernel" 2008-10-07 07:54:34 -07:00
memstick memstick: fix MSProHG 8-bit interface mode support 2008-09-13 14:41:52 -07:00
message
mfd mfd: Fix asic3 compilation 2008-09-30 09:57:22 +02:00
misc ia64: fix panic during `modprobe -r xpc' 2008-09-13 14:41:52 -07:00
mmc atmel-mci: Initialize BLKR before sending data transfer command 2008-10-06 14:26:24 -07:00
mtd
net [10/21] driver/net/skge.c: restart the interface when it's options or 2008-10-08 16:00:57 -07:00
nubus
of
oprofile
parisc
parport
pci Check mapped ranges on sysfs resource files 2008-10-02 18:52:51 -07:00
pcmcia pcmcia: Fix broken abuse of dev->driver_data 2008-09-22 08:42:50 -07:00
pnp
power
ps3
rapidio
regulator
rtc rtc: fix kernel panic on second use of SIGIO nofitication 2008-10-03 18:22:17 -07:00
s390 Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2008-10-08 14:56:41 -07:00
sbus
scsi scsi: fix fall out of sg-chaining patch in qlogicpti 2008-09-29 09:41:56 +02:00
serial atmel_serial: update the powersave handler to match serial core 2008-09-23 08:09:14 -07:00
sh
sn
spi orion_spi: fix handling of default transfer speed 2008-10-03 18:22:18 -07:00
ssb Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2008-10-01 06:12:56 -07:00
tc
telephony
thermal
uio
usb Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2008-10-01 06:12:56 -07:00
video fbdev: fix recursive notifier and locking when fbdev console is blanked 2008-10-03 18:22:17 -07:00
virtio
w1
watchdog ibmasr: remove unnecessary spin_unlock() 2008-09-23 08:09:13 -07:00
xen
zorro
Kconfig
Makefile