From: Vladimir Oltean <vladimir.oltean@nxp.com>
To: Horatiu Vultur <horatiu.vultur@microchip.com>
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, richardcochran@gmail.com,
jacob.e.keller@intel.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, UNGLinuxDriver@microchip.com
Subject: Re: [PATCH net] net: lan966x: Remove ptp traps in case the ptp is not enabled.
Date: Fri, 17 May 2024 13:23:07 +0300 [thread overview]
Message-ID: <20240517102307.7we5psrgbf56mden@skbuf> (raw)
In-Reply-To: <20240517101811.vsqcg7moapixlfpj@DEN-DL-M31836.microchip.com>
On Fri, May 17, 2024 at 12:18:11PM +0200, Horatiu Vultur wrote:
> The 05/17/2024 13:04, Vladimir Oltean wrote:
> >
> > 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@nxp.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;
> > +
>
> This should also work.
> Initially I thought you wanted to have only the check for
> port->lan966x->ptp here. And that is why I said it would not work.
Ok. I see the patch was marked as "changes requested". I think the
second alternative would be better anyway, because a requested
configuration which cannot be supported will be rejected outright,
rather than doing some stuff, figuring out it cannot be done, then
undoing what was done. Would you mind sending a v2 like this?
next prev parent reply other threads:[~2024-05-17 10:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-14 19:35 [PATCH net] net: lan966x: Remove ptp traps in case the ptp is not enabled Horatiu Vultur
2024-05-14 22:21 ` Vladimir Oltean
2024-05-16 6:48 ` Horatiu Vultur
2024-05-17 10:04 ` Vladimir Oltean
2024-05-17 10:18 ` Horatiu Vultur
2024-05-17 10:23 ` Vladimir Oltean [this message]
2024-05-17 10:53 ` Horatiu Vultur
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=20240517102307.7we5psrgbf56mden@skbuf \
--to=vladimir.oltean@nxp.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horatiu.vultur@microchip.com \
--cc=jacob.e.keller@intel.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.