OpenCloudOS-Kernel/drivers/phy/freescale
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
..
Kconfig phy: freescale: Add i.MX8qm Mixel LVDS PHY support 2022-07-08 10:43:20 +05:30
Makefile phy: freescale: Add i.MX8qm Mixel LVDS PHY support 2022-07-08 10:43:20 +05:30
phy-fsl-imx8-mipi-dphy.c phy: freescale: phy-fsl-imx8-mipi-dphy: Add i.MX8qxp LVDS PHY mode support 2022-04-20 12:59:50 +05:30
phy-fsl-imx8m-pcie.c phy: Explicitly include correct DT includes 2023-07-17 11:52:56 +05:30
phy-fsl-imx8mq-usb.c phy: fsl-imx8mq-usb: add dev_err_probe if getting vbus failed 2023-08-22 19:28:11 +05:30
phy-fsl-imx8qm-lvds-phy.c phy: freescale: phy-fsl-imx8qm-lvds-phy: Convert to platform remove callback returning void 2023-03-20 18:14:56 +05:30
phy-fsl-lynx-28g.c phy: lynx-28g: serialize concurrent phy_set_mode_ext() calls to shared registers 2023-10-06 10:59:52 +01:00