[PATCH net-next 3/3] net: ethtool: tsconfig: Re-configure hwtstamp upon provider change

Maxime Chevallier
2025-10-15T10:28:06Z

When a hwprov timestamping source is changed, but without updating the
timestamping parameters, we may want to reconfigure the timestamping
source to enable the new provider.

This is especially important if the same HW unit implements 2 providers,
a precise and an approx one. In this case, we need to make sure we call
the hwtstamp_set operation for the newly selected provider.

Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
---
net/ethtool/tsconfig.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ethtool/tsconfig.c b/net/ethtool/tsconfig.c
index 169b413b31fc..e8333452926d 100644
--- a/net/ethtool/tsconfig.c
+++ b/net/ethtool/tsconfig.c
@@ -416,7 +416,7 @@ static int ethnl_set_tsconfig(struct ethnl_req_info *req_base,
kfree_rcu(__hwprov, rcu_head);
}

- if (config_mod) {
+ if (config_mod || hwprov_mod) {
ret = dev_set_hwtstamp_phylib(dev, &hwtst_config,
info->extack);
if (ret < 0)
--
2.49.0