Re: [PATCH net] net: don't require the hwtstamp NDOs when a PHY provides timestamping

From: Jakub Kicinski

Date: Mon Sep 21 2026 - 19:38:05 EST


On Mon, 21 Sep 2026 12:23:37 +0200 Nicolai Buchwitz wrote:
> > One detail for whoever narrows the tsconfig gates later: the fix is not
> > a
> > mechanical copy of this one. The HWTSTAMP_SOURCE_NETDEV branch in
> > dev_get_hwtstamp_phylib() still calls the callback with no NULL test:
> >
> > net/core/dev_ioctl.c:dev_get_hwtstamp_phylib() {
> > ...
> > if (hwprov->source == HWTSTAMP_SOURCE_NETDEV)
> > return dev->netdev_ops->ndo_hwtstamp_get(dev, cfg);
> > ...
> > }
> >
> > dev->hwprov is only ever assigned in ethnl_set_tsconfig(), which is
> > reached through ethnl_set_tsconfig_validate(), so that branch is safe
> > today precisely because of the check under discussion. Should the two
> > sites be changed together?
>
> No, IMHO not here. It would change change behaviour that never worked.
> Thus I would suggest fixing this with a follow-up to net-next.

Not sure I agree that it's separate but whatever, I don't want the ioctl
fix to miss rc5.

I'd prefer the netlink fix to also target net, tho. Netlink
functionality should match the IOCTL, targeting -next would put user
space in an awkward position when deciding between the two.