summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2026-04-12 21:33:26 +0300
committerJakub Kicinski <kuba@kernel.org>2026-04-12 21:33:26 +0300
commit4e17b9b43322e1cc1db88c7457bf57a00ff45b32 (patch)
tree03c239902b0a9275636774c48f93a46648137dd4 /include/linux
parent200df94709118d58f2ee3b398e63b2b03ac9b4d6 (diff)
parentbb14e3b63c63a48307843c82180bc8abb34e1acc (diff)
downloadlinux-4e17b9b43322e1cc1db88c7457bf57a00ff45b32.tar.xz
Merge branch 'net-phy-add-support-for-disabling-autonomous-eee'
Nicolai Buchwitz says: ==================== net: phy: add support for disabling autonomous EEE Some PHYs implement autonomous EEE where the PHY manages EEE independently, preventing the MAC from controlling LPI signaling. This conflicts with MACs that implement their own LPI control. This series adds a .disable_autonomous_eee callback to struct phy_driver and calls it from phy_support_eee(). When a MAC indicates it supports EEE, the PHY's autonomous EEE is automatically disabled. The setting is persisted across suspend/resume by re-applying it in phy_init_hw() after soft reset, following the same pattern suggested by Russell King for PHY tunables [1]. Patch 1 adds the phylib infrastructure. Patch 2 implements it for Broadcom BCM54xx (AutogrEEEn). Patch 3 converts the Realtek RTL8211F, which previously unconditionally disabled PHY-mode EEE in config_init. This came up while adding EEE support to the Cadence macb driver (used on Raspberry Pi 5 with a BCM54210PE PHY). The PHY's AutogrEEEn mode prevented the MAC from tracking LPI state. The Realtek RTL8211F has the same pattern, unconditionally disabling PHY-mode EEE with the comment "Disable PHY-mode EEE so LPI is passed to the MAC". Other BCM54xx PHYs likely have the same AutogrEEEn register layout, but I only have access to the BCM54210PE/BCM54213PE datasheets. It would be appreciated if Florian or others could confirm which other BCM54xx variants share this register so we can wire them up too. Tested on Raspberry Pi CM4 (bcmgenet + BCM54210PE), Raspberry Pi CM5 (Cadence GEM + BCM54210PE) and Raspberry Pi 5 (Cadence GEM + BCM54213PE). [1] https://lore.kernel.org/netdev/acuwvoydmJusuj9x@shell.armlinux.org.uk/ ==================== Link: https://patch.msgid.link/20260406-devel-autonomous-eee-v1-0-b335e7143711@tipi-net.de Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/brcmphy.h3
-rw-r--r--include/linux/phy.h14
2 files changed, 17 insertions, 0 deletions
diff --git a/include/linux/brcmphy.h b/include/linux/brcmphy.h
index 115a964f3006..174687c4c80a 100644
--- a/include/linux/brcmphy.h
+++ b/include/linux/brcmphy.h
@@ -266,6 +266,9 @@
#define BCM54XX_TOP_MISC_IDDQ_SD (1 << 2)
#define BCM54XX_TOP_MISC_IDDQ_SR (1 << 3)
+#define BCM54XX_TOP_MISC_MII_BUF_CNTL0 (MII_BCM54XX_EXP_SEL_TOP + 0x00)
+#define BCM54XX_MII_BUF_CNTL0_AUTOGREEEN_EN BIT(0)
+
#define BCM54XX_TOP_MISC_LED_CTL (MII_BCM54XX_EXP_SEL_TOP + 0x0C)
#define BCM54XX_LED4_SEL_INTR BIT(1)
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 5de4b172cd0b..199a7aaa341b 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -612,6 +612,8 @@ struct phy_oatc14_sqi_capability {
* @advertising_eee: Currently advertised EEE linkmodes
* @enable_tx_lpi: When True, MAC should transmit LPI to PHY
* @eee_active: phylib private state, indicating that EEE has been negotiated
+ * @autonomous_eee_disabled: Set when autonomous EEE has been disabled,
+ * used to re-apply after PHY soft reset
* @eee_cfg: User configuration of EEE
* @lp_advertising: Current link partner advertised linkmodes
* @host_interfaces: PHY interface modes supported by host
@@ -739,6 +741,7 @@ struct phy_device {
__ETHTOOL_DECLARE_LINK_MODE_MASK(eee_disabled_modes);
bool enable_tx_lpi;
bool eee_active;
+ bool autonomous_eee_disabled;
struct eee_config eee_cfg;
/* Host supported PHY interface types. Should be ignored if empty. */
@@ -1359,6 +1362,17 @@ struct phy_driver {
void (*get_stats)(struct phy_device *dev,
struct ethtool_stats *stats, u64 *data);
+ /**
+ * @disable_autonomous_eee: Disable PHY-autonomous EEE
+ *
+ * Some PHYs manage EEE autonomously, preventing the MAC from
+ * controlling LPI signaling. This callback disables autonomous
+ * EEE at the PHY.
+ *
+ * Return: 0 on success, negative errno on failure.
+ */
+ int (*disable_autonomous_eee)(struct phy_device *dev);
+
/* Get and Set PHY tunables */
/** @get_tunable: Return the value of a tunable */
int (*get_tunable)(struct phy_device *dev,