[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240517100425.l5ddxbuyxbgx42ti@skbuf>
Date: Fri, 17 May 2024 13:04:25 +0300
From: Vladimir Oltean <vladimir.oltean@....com>
To: Horatiu Vultur <horatiu.vultur@...rochip.com>
Cc: davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
pabeni@...hat.com, richardcochran@...il.com,
jacob.e.keller@...el.com, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, UNGLinuxDriver@...rochip.com
Subject: Re: [PATCH net] net: lan966x: Remove ptp traps in case the ptp is
not enabled.
On Thu, May 16, 2024 at 08:48:55AM +0200, Horatiu Vultur wrote:
> > Alternatively, the -EOPNOTSUPP check could be moved before programming
> > the traps in the first place.
>
> Thanks for the review.
> Actually I don't think this alternative will work. In case of PHY
> timestamping, we would still like to add those rules regardless if
> ptp is enabled on lan966x.
>
> >
> > Reviewed-by: Vladimir Oltean <vladimir.oltean@....com>
>
> --
> /Horatiu
I don't understand why this would not have worked?
diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c
index b12d3b8a64fd..1439a36e8394 100644
--- a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c
+++ b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c
@@ -474,14 +474,14 @@ static int lan966x_port_hwtstamp_set(struct net_device *dev,
cfg->source != HWTSTAMP_SOURCE_PHYLIB)
return -EOPNOTSUPP;
+ if (cfg->source == HWTSTAMP_SOURCE_NETDEV && !port->lan966x->ptp)
+ return -EOPNOTSUPP;
+
err = lan966x_ptp_setup_traps(port, cfg);
if (err)
return err;
if (cfg->source == HWTSTAMP_SOURCE_NETDEV) {
- if (!port->lan966x->ptp)
- return -EOPNOTSUPP;
-
err = lan966x_ptp_hwtstamp_set(port, cfg, extack);
if (err) {
lan966x_ptp_del_traps(port);
Powered by blists - more mailing lists