linux_dsm_epyc7002/drivers/net/phy
Heiner Kallweit a200490717 net: phy: fix potential race in the phylib state machine
Russell reported the following race in the phylib state machine
(quoting from his mail):

if (phy_polling_mode(phydev) && phy_is_started(phydev))
	phy_queue_state_machine(phydev, PHY_STATE_TIME);

state = PHY_UP
thread 0			thread 1
				phy_disconnect()
				+-phy_is_started()
phy_is_started()                |
				`-phy_stop()
				  +-phydev->state = PHY_HALTED
				  `-phy_stop_machine()
				    `-cancel_delayed_work_sync()
phy_queue_state_machine()
`-mod_delayed_work()

At this point, the phydev->state_queue() has been added back onto the
system workqueue despite phy_stop_machine() having been called and
cancel_delayed_work_sync() called on it.

Fix this by protecting the complete operation in thread 0.

Fixes: 2b3e88ea65 ("net: phy: improve phy state checking")
Reported-by: Russell King - ARM Linux admin <linux@armlinux.org.uk>
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-02-14 12:04:55 -05:00
..
amd.c net: phy: remove flag PHY_HAS_INTERRUPT from driver configs 2018-11-11 09:36:56 -08:00
aquantia.c net: ethernet: Convert phydev advertize and supported from u32 to link mode 2018-11-11 10:10:01 -08:00
asix.c net: phy: Fixup GPLv2+ SPDX tags based on license text 2019-01-22 20:57:03 -08:00
at803x.c net: phy: remove flag PHY_HAS_INTERRUPT from driver configs 2018-11-11 09:36:56 -08:00
bcm7xxx.c
bcm63xx.c net: ethernet: Convert phydev advertize and supported from u32 to link mode 2018-11-11 10:10:01 -08:00
bcm87xx.c net: phy: Add missing features to PHY drivers 2019-01-16 15:41:02 -08:00
bcm-cygnus.c
bcm-phy-lib.c
bcm-phy-lib.h
broadcom.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-11-11 17:57:54 -08:00
cicada.c net: phy: remove flag PHY_HAS_INTERRUPT from driver configs 2018-11-11 09:36:56 -08:00
cortina.c net: phy: add missing phy driver features 2019-01-17 22:03:25 -08:00
davicom.c net: phy: remove flag PHY_HAS_INTERRUPT from driver configs 2018-11-11 09:36:56 -08:00
dp83tc811.c net: phy: remove flag PHY_HAS_INTERRUPT from driver configs 2018-11-11 09:36:56 -08:00
dp83640_reg.h
dp83640.c net: dp83640: expire old TX-skb 2019-02-04 08:54:52 -08:00
dp83822.c net: phy: remove flag PHY_HAS_INTERRUPT from driver configs 2018-11-11 09:36:56 -08:00
dp83848.c net: phy: remove flag PHY_HAS_INTERRUPT from driver configs 2018-11-11 09:36:56 -08:00
dp83867.c net: phy: remove flag PHY_HAS_INTERRUPT from driver configs 2018-11-11 09:36:56 -08:00
et1011c.c
fixed_phy.c Fixed PHY: Add fixed_phy_change_carrier() 2018-12-17 11:24:32 -08:00
icplus.c net: phy: icplus: allow configuring the interrupt function on IP101GR 2018-11-18 16:16:20 -08:00
intel-xway.c net: phy: remove flag PHY_HAS_INTERRUPT from driver configs 2018-11-11 09:36:56 -08:00
Kconfig
lxt.c net: phy: Convert u32 phydev->lp_advertising to linkmode 2018-11-11 10:10:01 -08:00
Makefile
marvell10g.c net: mii: Rename mii_stat1000_to_linkmode_lpa_t 2018-12-05 16:26:16 -08:00
marvell.c Revert "net: phy: marvell: avoid pause mode on SGMII-to-Copper for 88e151x" 2019-02-02 19:43:23 -08:00
mdio_bus.c net: phy: mdio_bus: add missing device_del() in mdiobus_register() error handling 2019-01-18 11:07:33 -08:00
mdio_device.c
mdio-bcm-iproc.c
mdio-bcm-unimac.c
mdio-bitbang.c
mdio-boardinfo.c
mdio-boardinfo.h
mdio-cavium.c
mdio-cavium.h
mdio-gpio.c net: phy: mdio-gpio: Add phy_ignore_ta_mask to platform data 2018-12-08 21:33:30 -08:00
mdio-hisi-femac.c net: phy: Fixup GPLv2+ SPDX tags based on license text 2019-01-22 20:57:03 -08:00
mdio-i2c.c
mdio-i2c.h
mdio-moxart.c
mdio-mscc-miim.c
mdio-mux-bcm-iproc.c
mdio-mux-gpio.c
mdio-mux-mmioreg.c
mdio-mux.c
mdio-octeon.c
mdio-sun4i.c
mdio-thunder.c
mdio-xgene.c
mdio-xgene.h
meson-gxl.c net: phy: meson-gxl: Use the genphy_soft_reset callback 2019-01-15 22:27:34 -08:00
micrel.c net: phy: Add missing features to PHY drivers 2019-01-16 15:41:02 -08:00
microchip_t1.c net: phy: remove flag PHY_HAS_INTERRUPT from driver configs 2018-11-11 09:36:56 -08:00
microchip.c net: phy: remove flag PHY_HAS_INTERRUPT from driver configs 2018-11-11 09:36:56 -08:00
mscc.c net: phy: mscc: Fix the VSC 8531/41 Chip Init sequence 2018-12-19 10:33:25 -08:00
national.c net: phy: remove flag PHY_HAS_INTERRUPT from driver configs 2018-11-11 09:36:56 -08:00
phy_device.c net: phy: phy driver features are mandatory 2019-01-19 10:03:08 -08:00
phy_led_triggers.c
phy-c45.c net: phy: Convert u32 phydev->lp_advertising to linkmode 2018-11-11 10:10:01 -08:00
phy-core.c net: phy: Add support for resolving 5G and 2.5G autoneg 2018-11-11 10:10:02 -08:00
phy.c net: phy: fix potential race in the phylib state machine 2019-02-14 12:04:55 -05:00
phylink.c net: phylink: avoid resolving link state too early 2019-02-12 12:25:18 -05:00
qsemi.c net: phy: remove flag PHY_HAS_INTERRUPT from driver configs 2018-11-11 09:36:56 -08:00
realtek.c net: phy: realtek: use new PHYID matching macros 2018-11-11 09:44:14 -08:00
rockchip.c net: phy: Fixup GPLv2+ SPDX tags based on license text 2019-01-22 20:57:03 -08:00
sfp-bus.c net: sfp: do not probe SFP module before we're attached 2019-02-08 15:11:25 -08:00
sfp.c net: sfp: do not probe SFP module before we're attached 2019-02-08 15:11:25 -08:00
sfp.h net: sfp: do not probe SFP module before we're attached 2019-02-08 15:11:25 -08:00
smsc.c net: phy: remove flag PHY_HAS_INTERRUPT from driver configs 2018-11-11 09:36:56 -08:00
spi_ks8995.c
ste10Xp.c net: phy: remove flag PHY_HAS_INTERRUPT from driver configs 2018-11-11 09:36:56 -08:00
swphy.c
swphy.h
teranetics.c net: phy: add missing phy driver features 2019-01-17 22:03:25 -08:00
uPD60620.c net: phy: Convert u32 phydev->lp_advertising to linkmode 2018-11-11 10:10:01 -08:00
vitesse.c net: phy: vitesse: remove duplicate support for VSC8574 2018-11-23 17:25:32 -08:00
xilinx_gmii2rgmii.c