Skip to contentSkip to conversation

net: ethtool: handle EOPNOTSUPP from ethtool get_ts_info() method

PATCH Applied Russell King (Oracle) 3 participants 3 messages Sep 11, 2025 – Sep 13, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: ethtool: handle EOPNOTSUPP from ethtool get_ts_info() method

Network drivers sometimes return -EOPNOTSUPP from their get_ts_info() method, and this should not cause the reporting of PHY timestamping information to be prohibited. Handle this error code, and also arrange for ethtool_net_get_ts_info_by_phc() to return -EOPNOTSUPP when the method is not implemented.

This allows e.g. PHYs connected to DSA switches which support timestamping to report their timestamping capabilities.

Fixes b9e3f7dc9ed9 ("net: ethtool: tsinfo: Enhance tsinfo to support several hwtstamp by net topology")

--
v2: add Fixes: tag

---
 net/ethtool/common.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
net/ethtool/common.c +2 -2
index 4f58648a27ad..92e6a681c797 100644
@@ -905,7 +905,7 @@ int ethtool_net_get_ts_info_by_phc(struct net_device *dev,
 	int err;
 
 	if (!ops->get_ts_info)
-		return -ENODEV;
+		return -EOPNOTSUPP;
 
 	/* Does ptp comes from netdev */
 	ethtool_init_tsinfo(info);
@@ -973,7 +973,7 @@ int ethtool_get_ts_info_by_phc(struct net_device *dev,
 	int err;
 
 	err = ethtool_net_get_ts_info_by_phc(dev, info, hwprov_desc);
-	if (err == -ENODEV) {
+	if (err == -ENODEV || err == -EOPNOTSUPP) {
 		struct phy_device *phy;
 
 		phy = ethtool_phy_get_ts_info_by_phc(dev, info, hwprov_desc);
Signature · 1 line
2.47.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · On Thu, 11 Sep 2025 15:43:15 +0100 "Russell King (Oracle)"…

Network drivers sometimes return -EOPNOTSUPP from their get_ts_info() method, and this should not cause the reporting of PHY timestamping information to be prohibited. Handle this error code, and also arrange for ethtool_net_get_ts_info_by_phc() to return -EOPNOTSUPP when the method is not implemented.

This allows e.g. PHYs connected to DSA switches which support timestamping to report their timestamping capabilities.

You forgot the v2 in the subject prefix.

Thank you!

Signature · 3 lines
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
#2 lore raw
In reply to Russell King (Oracle)
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:

Quoted 10 lines · On Thu, 11 Sep 2025 15:43:15 +0100 you wrote:

Network drivers sometimes return -EOPNOTSUPP from their get_ts_info() method, and this should not cause the reporting of PHY timestamping information to be prohibited. Handle this error code, and also arrange for ethtool_net_get_ts_info_by_phc() to return -EOPNOTSUPP when the method is not implemented.

This allows e.g. PHYs connected to DSA switches which support timestamping to report their timestamping capabilities.

[...]

Here is the summary with links:
- [net] net: ethtool: handle EOPNOTSUPP from ethtool get_ts_info() method

    https://git.kernel.org/netdev/net/c/201825fb4278

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html