mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Maxime Chevallier <maxime.chevallier@bootlin.com>
To: Nicolai Buchwitz <nb@tipi-net.de>, netdev-bot+sashiko@kernel.org
Cc: davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
	pabeni@redhat.com, horms@kernel.org, andrew@lunn.ch,
	kory.maincent@bootlin.com, vadim.fedorenko@linux.dev,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net v3 2/2] net: ethtool: let tsconfig reach a PHY-only timestamp provider
Date: Sat, 26 Sep 2026 20:03:14 +0200	[thread overview]
Message-ID: <8100d62f-7615-4129-a633-7f4c7404a0e2@bootlin.com> (raw)
In-Reply-To: <5ee2fdb9e5303f23b2d61c06479df489@tipi-net.de>

Hi,

On 9/26/26 19:53, Nicolai Buchwitz wrote:
> Hi (Cl|S)ashiko
> 
> On 26.9.2026 15:54, netdev-bot+sashiko@kernel.org wrote:
>> Thank you for your contribution! Sashiko AI review found 1 potential
>> issue(s) to consider.
>>
>> Critical: 0 · High: 0 · Medium: 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).
>>
>> - [Medium] The removed ethnl_set_tsconfig_validate() required both
>>   ndo_hwtstamp_set and ndo_hwtstamp_get.
>>
>> -- 
>>
>> net: ethtool: let tsconfig reach a PHY-only timestamp provider
>>
>> This patch lets TSCONFIG_GET and TSCONFIG_SET accept a device whose
>> timestamping is served by a default timestamping PHY or an already
>> installed hwprov, even when the netdev has no hwtstamp NDOs. It removes
>> the set_validate callback and moves the check into ethnl_set_tsconfig().
>> It also stops selecting a netdev source without ndo_hwtstamp_set, and
>> adds a NULL check for ndo_hwtstamp_get in dev_get_hwtstamp_phylib().
>>
>>> diff --git a/net/ethtool/tsconfig.c b/net/ethtool/tsconfig.c
>>> index 6be3aa5d4bc1e..2db0e7ba8b9f5 100644
>>> --- a/net/ethtool/tsconfig.c
>>> +++ b/net/ethtool/tsconfig.c
> 
>> [...]
> 
>>> @@ -313,6 +305,11 @@ static int ethnl_set_tsconfig(struct ethnl_req_info *req_base,
>>>      if (!netif_device_present(dev))
>>>          return -ENODEV;
>>>
>>> +    if (!dev->netdev_ops->ndo_hwtstamp_set &&
>>> +        !phy_is_default_hwtstamp(dev->phydev) &&
>>> +        !netdev_ops_lock_dereference(dev->hwprov, dev))
>>> +        return -EOPNOTSUPP;
>>> +
>>
>> [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 :)

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 :)

Maxime

[1] : https://lore.kernel.org/netdev/20260718143848.677531-1-maxime.chevallier@bootlin.com/
> 
>> [...]
> 
> Thanks,
> Nicolai


  reply	other threads:[~2026-09-26 18:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260925135237.3432266-1-nb@tipi-net.de>
2026-09-25 13:52 ` [PATCH net v3 1/2] net: ethtool: reject an out of range hwtstamp provider index Nicolai Buchwitz
2026-09-25 13:55   ` Kory Maincent
2026-09-25 14:07     ` Nicolai Buchwitz
2026-09-25 17:57       ` Kory Maincent
2026-09-25 13:52 ` [PATCH net v3 2/2] net: ethtool: let tsconfig reach a PHY-only timestamp provider Nicolai Buchwitz
2026-09-26 13:54   ` netdev-bot+sashiko
2026-09-26 17:53     ` Nicolai Buchwitz
2026-09-26 18:03       ` Maxime Chevallier [this message]
2026-09-26 18:11         ` Nicolai Buchwitz
2026-09-26 18:04   ` Maxime Chevallier

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=8100d62f-7615-4129-a633-7f4c7404a0e2@bootlin.com \
    --to=maxime.chevallier@bootlin.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=kory.maincent@bootlin.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nb@tipi-net.de \
    --cc=netdev-bot+sashiko@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=vadim.fedorenko@linux.dev \
    /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®