Re: [PATCH net v3 2/2] net: ethtool: let tsconfig reach a PHY-only timestamp provider

From: Nicolai Buchwitz

Date: Sat Sep 26 2026 - 14:11:51 EST


Hi Maxime

On 26.9.2026 20:03, Maxime Chevallier wrote:

[...]

[Severity: Medium]

The removed ethnl_set_tsconfig_validate() required both ndo_hwtstamp_set
and ndo_hwtstamp_get. This new check in ethnl_set_tsconfig() only tests
ndo_hwtstamp_set. The matching check in tsconfig_prepare_data() only
tests ndo_hwtstamp_get.

What happens on a netdev that has ndo_hwtstamp_set but no
ndo_hwtstamp_get, and has neither a default timestamping PHY nor a
hwprov?

There is no in-tree driver with ndo_hwtstamp_set but not _get. All 73 files
have them in pairs...

Even further, the asymmetry is on purpose. The get side tests ndo_hwtstamp_get
and the set side tests ndo_hwtstamp_set, each gate testing what its own operation
needs.

If anyone insists on the symmetry, a v4 could add || !ndo_hwtstamp_get. But before
I respin again, let's hear if this is really needed.

The current way LGTM :)

Thanks!


BTW, I raised that point a while ago [1] but now that you're properly handling
the "MAC can't TS, but PHY can" case, we may be able to get rid of the
SIOCSHWTSTAMP code in phy_mii_ioctl() ? as a followup of course :)

The code seems dead indeed. I will have a look and send a follow up then next days...

[...]

Regards
Nicolai