From: Maxime Chevallier <maxime.chevallier@bootlin.com>
To: javen <javen_xu@realsil.com.cn>,
andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, nb@tipi-net.de
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
daniel@makrotopia.org, vladimir.oltean@nxp.com
Subject: Re: [PATCH net-next v5 1/4] net: ethtool: tsconfig: allow selecting a provider
Date: Tue, 1 Dec 2026 11:34:45 +0100 [thread overview]
Message-ID: <368fde0f-d512-46ea-b077-f613911c624b@bootlin.com> (raw)
In-Reply-To: <20261201094454.1150-2-javen_xu@realsil.com.cn>
Hi,
On 12/1/26 10:44, javen wrote:
> From: Javen <javen_xu@realsil.com.cn>
>
> A hwtstamp provider can obly ne selected with ETHTOOL_MSG_TSCONFIG_SET
> when the device already has an active time stamping source: a MAC
> implementing ndo_hwtstamp_set(), a PHY flagged as default_timestamp, or
> a previously selected dev->hwprov.
>
> This patch makes it possible to select a PHY time stamper on a MAC
> without time stamping support. New phy drivers are expected to reply on
> dev->hwprov rather than default_timestamp.
>
> Signed-off-by: Javen <javen_xu@realsil.com.cn>
> ---
> Changes in v5:
> - new file.
> ---
> net/ethtool/tsconfig.c | 17 +++++++++++------
> 1 file changed, 11 insertions(+), 6 deletions(-)
>
> diff --git a/net/ethtool/tsconfig.c b/net/ethtool/tsconfig.c
> index 2db0e7ba8b9f..9c983666a1b0 100644
> --- a/net/ethtool/tsconfig.c
> +++ b/net/ethtool/tsconfig.c
> @@ -300,14 +300,16 @@ static int ethnl_set_tsconfig(struct ethnl_req_info *req_base,
> struct hwtstamp_provider *hwprov = NULL;
> struct net_device *dev = req_base->dev;
> struct nlattr **tb = info->attrs;
> + bool has_hwts;
> int ret;
>
> 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))
> + has_hwts = dev->netdev_ops->ndo_hwtstamp_set ||
> + phy_is_default_hwtstamp(dev->phydev) ||
Isn't "phy_has_hwtstsamp() enough here ? We just need to check if there's some
timestamper available, the PHY's "default_timestamp" field shouldn't
matter, no ?
I may be missing something though,
Maxime
next prev parent reply other threads:[~2026-12-01 10:34 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-01 9:44 [PATCH net-next v5 0/4] net: phy: realtek: add PTP support for RTL8127a javen
2026-12-01 9:44 ` [PATCH net-next v5 1/4] net: ethtool: tsconfig: allow selecting a provider javen
2026-12-01 10:06 ` Nicolai Buchwitz
2026-12-01 10:34 ` Maxime Chevallier [this message]
2026-12-01 10:44 ` Nicolai Buchwitz
2026-12-01 9:44 ` [PATCH net-next v5 2/4] r8169: hold MDIO bus lock while loading firmware javen
2026-12-01 10:18 ` Nicolai Buchwitz
2026-12-01 9:44 ` [PATCH net-next v5 3/4] net: phy: realtek: add PTP clock support for RTL8127a javen
2026-12-01 10:23 ` Nicolai Buchwitz
2026-12-01 9:44 ` [PATCH net-next v5 4/4] net: phy: realtek: add hardware timestamping " javen
2026-12-01 10:36 ` Nicolai Buchwitz
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=368fde0f-d512-46ea-b077-f613911c624b@bootlin.com \
--to=maxime.chevallier@bootlin.com \
--cc=andrew@lunn.ch \
--cc=daniel@makrotopia.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=javen_xu@realsil.com.cn \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=nb@tipi-net.de \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=vladimir.oltean@nxp.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®