linux_dsm_epyc7002/drivers/net/dsa/mv88e6xxx
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
..
chip.c net: dsa: mv88e6xxx: Set correct interface mode for CPU/DSA ports 2019-03-08 22:55:28 -08:00
chip.h net: dsa: mv88e6xxx: Set correct interface mode for CPU/DSA ports 2019-03-08 22:55:28 -08:00
global1_atu.c net: dsa: mv88e6xxx: Fix counting of ATU violations 2019-02-05 16:37:52 -08:00
global1_vtu.c net: dsa: mv88e6xxx: Make VTU miss violations less spammy 2018-03-29 15:04:22 -04:00
global1.c net: dsa: mv88e6xxx: Fix clearing of stats counters 2018-11-11 10:19:10 -08:00
global1.h net: dsa: mv88e6xxx: Fix ATU Miss Violation 2018-09-17 08:03:53 -07:00
global2_avb.c net: dsa: mv88e6xxx: Add MV88E6165 AVB register access 2018-07-18 15:05:38 -07:00
global2_scratch.c net: dsa: mv88e6xxx: scratch registers and external MDIO pins 2018-02-22 14:46:32 -05:00
global2.c net: dsa: mv88e6xxx: Remove OF check for IRQ domain 2018-05-20 18:58:27 -04:00
global2.h net: dsa: mv88e6xxx: Add MV88E6165 AVB register access 2018-07-18 15:05:38 -07:00
hwtstamp.c net: dsa: mv88e6xxx: Longer timeout for PTP TX timestamp 2018-07-18 15:05:38 -07:00
hwtstamp.h net: dsa: mv88e6xxx: Add hwtimestamp support for the 6165 2018-07-18 15:05:38 -07:00
Kconfig net: dsa: mv88e6xxx: expose switch time as a PTP hardware clock 2018-02-14 14:33:36 -05:00
Makefile net: dsa: mv88e6xxx: add rx/tx timestamping support 2018-02-14 14:33:37 -05:00
phy.c net: dsa: mv88e6xxx: Fix writing to a PHY page. 2018-09-02 16:16:23 -07:00
phy.h net: dsa: mv88e6xxx: remove EEE support 2017-08-01 20:09:10 -07:00
port.c net: dsa: mv88e6xxx: fix few issues in mv88e6390x_port_set_cmode 2019-03-27 21:53:50 -07:00
port.h net: dsa: mv88e6xxx: Set correct interface mode for CPU/DSA ports 2019-03-08 22:55:28 -08:00
ptp.c net: dsa: mv88e6xxx: Fix -Wformat-security warnings 2019-02-23 13:44:57 -08:00
ptp.h net: dsa: mv88e6xxx: Set PTP Ethertype 2018-07-18 15:05:38 -07:00
serdes.c net: dsa: mv88e6xxx: support in-band signalling on SGMII ports with external PHYs 2019-03-04 10:52:39 -08:00
serdes.h net: dsa: mv88e6xxx: support in-band signalling on SGMII ports with external PHYs 2019-03-04 10:52:39 -08:00