mirror-linux/drivers/phy
Vladimir Oltean 139ad11431 phy: lynx-28g: serialize concurrent phy_set_mode_ext() calls to shared registers
The protocol converter configuration registers PCC8, PCCC, PCCD
(implemented by the driver), as well as others, control protocol
converters from multiple lanes (each represented as a different
struct phy). So, if there are simultaneous calls to phy_set_mode_ext()
to lanes sharing the same PCC register (either for the "old" or for the
"new" protocol), corruption of the values programmed to hardware is
possible, because lynx_28g_rmw() has no locking.

Add a spinlock in the struct lynx_28g_priv shared by all lanes, and take
the global spinlock from the phy_ops :: set_mode() implementation. There
are no other callers which modify PCC registers.

Fixes: 8f73b37cf3 ("phy: add support for the Layerscape SerDes 28G")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2023-10-06 10:59:52 +01:00
..
allwinner
amlogic
broadcom
cadence
freescale phy: lynx-28g: serialize concurrent phy_set_mode_ext() calls to shared registers 2023-10-06 10:59:52 +01:00
hisilicon phy-for-6.6 2023-09-03 10:38:02 -07:00
ingenic
intel
lantiq
marvell
mediatek phy-for-6.6 2023-09-03 10:38:02 -07:00
microchip
motorola
mscc
qualcomm phy-for-6.6 2023-09-03 10:38:02 -07:00
ralink
realtek
renesas
rockchip
samsung
socionext
st
starfive
sunplus
tegra
ti
xilinx
Kconfig phy-for-6.6 2023-09-03 10:38:02 -07:00
Makefile phy-for-6.6 2023-09-03 10:38:02 -07:00
phy-can-transceiver.c
phy-core-mipi-dphy.c
phy-core.c
phy-lgm-usb.c
phy-lpc18xx-usb-otg.c
phy-pistachio-usb.c
phy-xgene.c