netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Kory Maincent <kory.maincent@bootlin.com>
Cc: Vadim Fedorenko <vadim.fedorenko@linux.dev>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org, Vladimir Oltean <vladimir.oltean@nxp.com>
Subject: Re: [PATCH net-next] ti: netcp: convert to ndo_hwtstamp callbacks
Date: Thu, 30 Oct 2025 18:13:13 -0700	[thread overview]
Message-ID: <20251030181313.09ef4b60@kernel.org> (raw)
In-Reply-To: <20251030161824.0000568a@kmaincent-XPS-13-7390>

On Thu, 30 Oct 2025 16:18:24 +0100 Kory Maincent wrote:
> > But I might be missing something obvious here, if someone is at least a
> > bit aware of this code and can shed some light and confirm that phydev
> > is correctly set and attached to actual netdev, I'm happy to remove this
> > ugly part.  
> 
> Yeah, this driver seems a bit ugly to me also but maybe we are missing
> something. 

Since this is a TI device it may be one of those two-port things they
have for HSR/PRP(?). It's a single netdev but it actually has two ports
and PHY to forward frames along the ring. Hence two "modules"? I could
be wrong.

In any case - in a large refactoring effort like removing the hwts
ioctl we should try to avoid non-obvious cleanups. Unless the code is
actively maintained and someone is offering to help or at least test.
We still have a few drivers and a bunch of PHY plumbing to go thru..

So I'd copy what the original code was doing, add the goto in
netcp_ndo_hwtstamp_set() after the first failure..

This:

+		err = module->hwtstamp_set(intf_modpriv->module_priv, config,
+					   extack);
+		if ((err < 0) && (err != -EOPNOTSUPP)) {
+			NL_SET_ERR_MSG_WEAK_MOD(extack,
+						"At least one module failed to setup HW timestamps");
+			ret = err;
+		}
+		if (err == 0)
+			ret = err;

will leave ret at 0 if _any_ configuration succeeded which is worse.
User needs to know about the failure. We could keep going in the loop.
But hiding errors is a no-no.

      reply	other threads:[~2025-10-31  1:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-29 20:09 [PATCH net-next] ti: netcp: convert to ndo_hwtstamp callbacks Vadim Fedorenko
2025-10-30 10:30 ` Kory Maincent
2025-10-30 12:18   ` Vadim Fedorenko
2025-10-30 15:18     ` Kory Maincent
2025-10-31  1:13       ` Jakub Kicinski [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=20251030181313.09ef4b60@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kory.maincent@bootlin.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=vadim.fedorenko@linux.dev \
    --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;
as well as URLs for NNTP newsgroup(s).