linux/drivers/net/dsa
Heiner Kallweit 5ceaeb99ff net: dsa: mv88e6xxx: fix few issues in mv88e6390x_port_set_cmode
This patches fixes few issues in mv88e6390x_port_set_cmode().

1. When entering the function the old cmode may be 0, in this case
   mv88e6390x_serdes_get_lane() returns -ENODEV. As result we bail
   out and have no chance to set a new mode. Therefore deal properly
   with -ENODEV.

2. Once we have disabled power and irq, let's set the cached cmode to 0.
   This reflects the actual status and is cleaner if we bail out with an
   error in the following function calls.

3. The cached cmode is used by mv88e6390x_serdes_get_lane(),
   mv88e6390_serdes_power_lane() and mv88e6390_serdes_irq_enable().
   Currently we set the cached mode to the new one at the very end of
   the function only, means until then we use the old one what may be
   wrong.

4. When calling mv88e6390_serdes_irq_enable() we use the lane value
   belonging to the old cmode. Get the lane belonging to the new cmode
   before calling this function.

It's hard to provide a good "Fixes" tag because quite a few smaller
changes have been done to the code in question recently.

Fixes: d235c48b40 ("net: dsa: mv88e6xxx: power serdes on/off for 10G interfaces on 6390X")
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-03-27 21:53:50 -07:00
..
b53 dsa: Remove phydev parameter from disable_port call 2019-02-24 22:30:34 -08:00
microchip net: dsa: microchip: add KSZ9893 switch support 2019-03-03 13:48:49 -08:00
mv88e6xxx net: dsa: mv88e6xxx: fix few issues in mv88e6390x_port_set_cmode 2019-03-27 21:53:50 -07:00
Kconfig net: dsa: lantiq_gswip: Depend on HAS_IOMEM 2018-09-25 20:27:43 -07:00
Makefile net: dsa: Add Lantiq / Intel DSA driver for vrx200 2018-09-13 08:14:33 -07:00
bcm_sf2.c dsa: Remove phydev parameter from disable_port call 2019-02-24 22:30:34 -08:00
bcm_sf2.h net: dsa: bcm_sf2: Add support for CFP statistics 2019-02-08 22:11:07 -08:00
bcm_sf2_cfp.c net: dsa: bcm_sf2: Remove set but not used variables 'v6_spec, v6_m_spec' 2019-02-17 15:31:47 -08:00
bcm_sf2_regs.h net: dsa: bcm_sf2: Add support for CFP statistics 2019-02-08 22:11:07 -08:00
dsa_loop.c net: phy: fixed-phy: Drop GPIO from fixed_phy_add() 2019-02-04 18:33:36 -08:00
dsa_loop.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
dsa_loop_bdinfo.c net: dsa: Mock-up driver 2017-04-01 12:39:32 -07:00
lan9303-core.c dsa: Remove phydev parameter from disable_port call 2019-02-24 22:30:34 -08:00
lan9303.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-11-04 09:26:51 +09:00
lan9303_i2c.c net: dsa: lan9303: Adjust indenting 2017-11-08 13:29:06 +09:00
lan9303_mdio.c net: dsa: lan9303: Adjust indenting 2017-11-08 13:29:06 +09:00
lantiq_gswip.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-03-02 12:54:35 -08:00
lantiq_pce.h net: dsa: Add Lantiq / Intel DSA driver for vrx200 2018-09-13 08:14:33 -07:00
mt7530.c drivers: net: Remove unnecessary semicolon 2019-03-01 23:13:49 -08:00
mt7530.h net: dsa: mt7530: support the 7530 switch on the Mediatek MT7621 SoC 2019-01-30 14:26:07 -08:00
mv88e6060.c mv88e6060: disable hardware level MAC learning 2018-12-03 16:04:21 -08:00
mv88e6060.h net: dsa: Keep the mii bus and address in the private structure 2016-04-13 18:15:23 -04:00
qca8k.c net: dsa: qca8k: extend slave-bus implementations 2019-03-26 10:47:10 -07:00
qca8k.h net: dsa: qca8k: extend slave-bus implementations 2019-03-26 10:47:10 -07:00
realtek-smi.c net: dsa: realtek-smi: fix OF child-node lookup 2019-01-17 14:04:49 -08:00
realtek-smi.h net: dsa: realtek-smi: Add Realtek SMI driver 2018-07-18 13:43:38 +09:00
rtl8366.c dsa: rtl8366: Remove unused variable. 2018-07-18 14:42:18 +09:00
rtl8366rb.c dsa: Remove phydev parameter from disable_port call 2019-02-24 22:30:34 -08:00
vitesse-vsc73xx.c dsa: Remove phydev parameter from disable_port call 2019-02-24 22:30:34 -08:00