Re: [PATCH net-next v5 1/4] net: ethtool: tsconfig: allow selecting a provider

From: Nicolai Buchwitz

Date: Tue Dec 01 2026 - 05:44:22 EST


Hi Maxime

On 1.12.2026 11:34, Maxime Chevallier wrote:

[...]

- if (!dev->netdev_ops->ndo_hwtstamp_set &&
- !phy_is_default_hwtstamp(dev->phydev) &&
- !netdev_ops_lock_dereference(dev->hwprov, dev))
+ has_hwts = dev->netdev_ops->ndo_hwtstamp_set ||
+ phy_is_default_hwtstamp(dev->phydev) ||

Isn't "phy_has_hwtstsamp() enough here ? We just need to check if there's some
timestamper available, the PHY's "default_timestamp" field shouldn't
matter, no ?

has_hwts also decides below whether the current source gets disabled
first. With phy_has_hwtstamp() that disable would go to the MAC path
and fail, as r8169 has no ndo_hwtstamp_set?

It means "something is active", so maybe hwts_active would be a better name.

[...]

Thanks,
Nicolai