Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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")
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Kory Maincent <kory.maincent@bootlin.com>
Link: https://patch.msgid.link/E1uwiW3-00000004jRF-3CnC@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Russell King (Oracle) and committed by
Jakub Kicinski
201825fb 2690cb08

+2 -2
+2 -2
net/ethtool/common.c
··· 905 905 int err; 906 906 907 907 if (!ops->get_ts_info) 908 - return -ENODEV; 908 + return -EOPNOTSUPP; 909 909 910 910 /* Does ptp comes from netdev */ 911 911 ethtool_init_tsinfo(info); ··· 973 973 int err; 974 974 975 975 err = ethtool_net_get_ts_info_by_phc(dev, info, hwprov_desc); 976 - if (err == -ENODEV) { 976 + if (err == -ENODEV || err == -EOPNOTSUPP) { 977 977 struct phy_device *phy; 978 978 979 979 phy = ethtool_phy_get_ts_info_by_phc(dev, info, hwprov_desc);