Subject: Re: [PATCH net-next] tsnep: convert to ndo_hwtstamp_get() and ndo_hwtstamp_set()

From: Simon Horman <[email-masked]>
Date: Mon, 20 Oct 2025 11:08:14 +0100

+ Vadim

On Fri, Oct 17, 2025 at 10:34:30PM +0200, Gerhard Engleder wrote:
> From: Vladimir Oltean <[email-masked]>
> 
> I took over this patch from Vladimir Oltean. The only change from my
> side is the adaption of the commit message. I hope I mentioned his work
> correctly in the tags.
> 
> New timestamping API was introduced in commit 66f7223039c0 ("net: add
> NDOs for configuring hardware timestamping") from kernel v6.6.
> 
> It is time to convert the tsnep driver to the new API, so that
> timestamping configuration can be removed from the ndo_eth_ioctl()
> path completely.
> 
> The driver does not need the interface to be down in order for
> timestamping to be changed. Thus, the netif_running() restriction in
> tsnep_netdev_ioctl() is not migrated to the new API. There is no
> interaction with hardware registers for either operation, just a
> concurrency with the data path which is fine.
> 
> After removing the PHY timestamping logic from tsnep_netdev_ioctl(),
> the rest is almost equivalent to phy_do_ioctl_running(), except for the
> return code on the !netif_running() condition: -EINVAL vs -ENODEV.
> Let's make the conversion to phy_do_ioctl_running() anyway, on the
> premise that a return code standardized tree-wide is less complex.
> 
> Signed-off-by: Vladimir Oltean <[email-masked]>
> Signed-off-by: Gerhard Engleder <[email-masked]>
> Tested-by: Gerhard Engleder <[email-masked]>

Hi Gerhard, Vladimir, Vadim, all,

Recently Vadim has been working on converting a number of drivers to
use ndo_hwtstamp_get() and ndo_hwtstamp_set(). And this includes a
patch, rather similar to this one, for the tsnep [1].

I think it would be good to agree on the way forward here.

[1] https://lore.kernel.org/all/[email-masked]/

...