summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2025-02-12 21:49:15 +0300
committerJakub Kicinski <kuba@kernel.org>2025-02-12 21:49:15 +0300
commitfea5d562822bac85ceb44ad108f845ad6d04a704 (patch)
tree35dbb0a05b02c9d6e3a461d2d6968548ff2a093f /include/linux
parent12739192b1996a6f8814ea3bef5f45110bc5a74c (diff)
parente252af1a67fe66ec901e33035210b231d9d211b7 (diff)
downloadlinux-fea5d562822bac85ceb44ad108f845ad6d04a704.tar.xz
Merge branch 'use-phylib-for-reset-randomization-and-adjustable-polling'
Oleksij Rempel says: ==================== Use PHYlib for reset randomization and adjustable polling This patch set tackles a DP83TG720 reset lock issue and improves PHY polling. Rather than adding a separate polling worker to randomize PHY resets, I chose to extend the PHYlib framework - which already handles most of the needed functionality - with adjustable polling. This approach not only addresses the DP83TG720-specific problem (where synchronized resets can lock the link) but also lays the groundwork for optimizing PHY stats polling across all PHY drivers. With generic PHY stats coming in, we can adjust the polling interval based on hardware characteristics, such as using longer intervals for PHYs with stable HW counters or shorter ones for high-speed links prone to counter overflows. Patch version changes are tracked in separate patches. ==================== Link: https://patch.msgid.link/20250210082358.200751-1-o.rempel@pengutronix.de Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/phy.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 83994b394d8e..64982eba71d1 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -1270,6 +1270,19 @@ struct phy_driver {
*/
int (*led_polarity_set)(struct phy_device *dev, int index,
unsigned long modes);
+
+ /**
+ * @get_next_update_time: Get the time until the next update event
+ * @dev: PHY device
+ *
+ * Callback to determine the time (in jiffies) until the next
+ * update event for the PHY state machine. Allows PHY drivers to
+ * dynamically adjust polling intervals based on link state or other
+ * conditions.
+ *
+ * Returns the time in jiffies until the next update event.
+ */
+ unsigned int (*get_next_update_time)(struct phy_device *dev);
};
#define to_phy_driver(d) container_of_const(to_mdio_common_driver(d), \
struct phy_driver, mdiodrv)