]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: phy: Add helper for fixing RGMII PHY mode based on internal mac delay
authorInochi Amaoto <inochiama@gmail.com>
Fri, 14 Nov 2025 00:38:04 +0000 (08:38 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Dec 2025 13:03:04 +0000 (14:03 +0100)
commitd2b57ba171648096b77c493d4e142e1b6f26e546
tree4a302cb334535911b2e8bb1b1aef85b740999b61
parentc9d1c4152e6d32fa74034464854bee262a60bc43
net: phy: Add helper for fixing RGMII PHY mode based on internal mac delay

[ Upstream commit 24afd7827efb7c69adfc41835390470e3eec4740 ]

The "phy-mode" property of devicetree indicates whether the PCB has
delay now, which means the mac needs to modify the PHY mode based
on whether there is an internal delay in the mac.

This modification is similar for many ethernet drivers. To simplify
code, define the helper phy_fix_phy_mode_for_mac_delays(speed, mac_txid,
mac_rxid) to fix PHY mode based on whether mac adds internal delay.

Suggested-by: Russell King (Oracle) <linux@armlinux.org.uk>
Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20251114003805.494387-3-inochiama@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Stable-dep-of: db37c6e510de ("net: stmmac: dwmac-sophgo: Add phy interface filter")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/phy/phy-core.c
include/linux/phy.h