[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251030181313.09ef4b60@kernel.org>
Date: Thu, 30 Oct 2025 18:13:13 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Kory Maincent <kory.maincent@...tlin.com>
Cc: Vadim Fedorenko <vadim.fedorenko@...ux.dev>, Andrew Lunn
 <andrew+netdev@...n.ch>, "David S. Miller" <davem@...emloft.net>, Eric
 Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>,
 netdev@...r.kernel.org, Vladimir Oltean <vladimir.oltean@....com>
Subject: Re: [PATCH net-next] ti: netcp: convert to ndo_hwtstamp callbacks
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.
Powered by blists - more mailing lists
 
