mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nicolai Buchwitz <nb@tipi-net.de>
To: netdev-bot+sashiko@kernel.org
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, horms@kernel.org, andrew@lunn.ch,
	kory.maincent@bootlin.com, jjc@jclark.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] net: ethtool: let tsconfig reach a PHY-only timestamp provider
Date: Wed, 23 Sep 2026 12:24:00 +0200	[thread overview]
Message-ID: <7a817f1e561fb387b0e01784ac4632f8@tipi-net.de> (raw)
In-Reply-To: <179015820246.2160803.17295463468229392731@kernel.org>

On 23.9.2026 12:10, netdev-bot+sashiko@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 3 potential
> issue(s) to consider.
> 
> Critical: 0 · High: 1 · Medium: 2 (1) · Low: 0
> 
> If you believe none of the issues are legitimate, please reply to each
> issue of Medium severity or higher and explain why the AI is wrong.
> If any of them are legitimate and you plan to respin, please let 
> patchwork
> know by including "pw-bot: cr" as a separate line at the end of your 
> reply
> (one such reply per series is enough).
> 
> - [High] TSCONFIG_SET now reports success (bare ACK, ret 0) with no
>   ETHTOOL_MSG_TSCONFIG_SET_REPLY on devices that have no hardware…
> - [Medium] With ethnl_set_tsconfig_validate() gone, 
> ethnl_set_tsconfig()
>   is reachable on netdevs that implement neither ndo_hwtstamp_get nor…
> - [Medium] net: ethtool: TSCONFIG_SET provider switch fails on devices
>   lacking ndo_hwtstamp_set
> 
> Pre-existing issues:
> - [Medium] A struct hwtstamp_provider installed into dev->hwprov by
>   TSCONFIG_SET is never freed when the netdevice is unregistered/freed…
> 
> --
> 
> net: ethtool: let tsconfig reach a PHY-only timestamp provider
> 
> This drops the ndo_hwtstamp_get check in tsconfig_prepare_data() and 
> the
> whole ethnl_set_tsconfig_validate() gate so that TSCONFIG_GET/SET can 
> be
> served by a PHY on a MAC that implements no hwtstamp NDO. A guard is 
> added
> in dev_get_hwtstamp_phylib() before calling ndo_hwtstamp_get.
> 
> Related discussion for the ioctl side:
> https://lore.kernel.org/netdev/20260918095540.34286-1-nb@tipi-net.de/
> 
>> diff --git a/net/core/dev_ioctl.c b/net/core/dev_ioctl.c
>> index 164643140a523..f6029f60c1dc9 100644
>> --- a/net/core/dev_ioctl.c
>> +++ b/net/core/dev_ioctl.c
>> @@ -267,7 +267,8 @@ int dev_get_hwtstamp_phylib(struct net_device 
>> *dev,
>>  		    hwprov->phydev)
>>  			return phy_hwtstamp_get(hwprov->phydev, cfg);
>> 
>> -		if (hwprov->source == HWTSTAMP_SOURCE_NETDEV)
>> +		if (hwprov->source == HWTSTAMP_SOURCE_NETDEV &&
>> +		    dev->netdev_ops->ndo_hwtstamp_get)
>>  			return dev->netdev_ops->ndo_hwtstamp_get(dev, cfg);
>> 
>>  		return -EOPNOTSUPP;
> 
> [Severity: Medium]
> This guard makes the read side safe, but can the install side now latch 
> a
> HWTSTAMP_SOURCE_NETDEV provider on a device that has no hwtstamp NDOs 
> at
> all, with no way back?

Ack, I will guard the install path in v2.

> [...]

> [Severity: Medium]
> With ethnl_set_tsconfig_validate() gone, a TSCONFIG_SET that selects
> the PHY provider now reaches ethnl_set_tsconfig() on a MAC without
> hwtstamp NDOs. Does the provider switch itself ever succeed there
> unless the PHY happens to be the default timestamper?

Will add a check in v2.

> [...]

> [Severity: High]
> Does removing this gate turn TSCONFIG_SET into a silent success on 
> devices
> that have no timestamp provider at all?

Ack, this is an ungly regression and would be the opposite of what 
e8ab231782e9
had fixed. I will narrow down the gate.

> [...]

> [Severity: Medium]
> This isn't a bug introduced by this patch, but the dev->hwprov lifetime
> looks unbalanced and dropping .set_validate widens the set of devices 
> that
> can reach the install path.

Agree on the issue, but would probably fix this in a separate patch.

> [...]

pw-bot: cr

      reply	other threads:[~2026-09-23 10:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-22  7:08 Nicolai Buchwitz
2026-09-22  8:05 ` Nicolai Buchwitz
2026-09-23  7:58 ` Kory Maincent
2026-09-23 10:10 ` netdev-bot+sashiko
2026-09-23 10:24   ` Nicolai Buchwitz [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7a817f1e561fb387b0e01784ac4632f8@tipi-net.de \
    --to=nb@tipi-net.de \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jjc@jclark.com \
    --cc=kory.maincent@bootlin.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev-bot+sashiko@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®