[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOMZO5BRmu-DFQ9QaPLvKXrDpPSnmK6X2ZA9m+TLXJhKqEj1dQ@mail.gmail.com>
Date: Fri, 11 Nov 2022 21:13:12 -0300
From: Fabio Estevam <festevam@...il.com>
To: Vladimir Oltean <vladimir.oltean@....com>
Cc: netdev@...r.kernel.org, Andrew Lunn <andrew@...n.ch>,
Florian Fainelli <f.fainelli@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Richard Cochran <richardcochran@...il.com>,
Steffen Bätz <steffen@...osonix.de>
Subject: Re: [PATCH net] net: dsa: make dsa_master_ioctl() see through
port_hwtstamp_get() shims
Hi Vladimir,
On Fri, Nov 11, 2022 at 6:10 PM Vladimir Oltean <vladimir.oltean@....com> wrote:
>
> There are multi-generational drivers like mv88e6xxx which have code like
> this:
>
> int mv88e6xxx_port_hwtstamp_get(struct dsa_switch *ds, int port,
> struct ifreq *ifr)
> {
> if (!chip->info->ptp_support)
> return -EOPNOTSUPP;
>
> ...
> }
>
> DSA wants to deny PTP timestamping on the master if the switch supports
> timestamping too. However it currently relies on the presence of the
> port_hwtstamp_get() callback to determine PTP capability, and this
> clearly does not work in that case (method is present but returns
> -EOPNOTSUPP).
>
> We should not deny PTP on the DSA master for those switches which truly
> do not support hardware timestamping.
>
> Create a dsa_port_supports_hwtstamp() method which actually probes for
> support by calling port_hwtstamp_get() and seeing whether that returned
> -EOPNOTSUPP or not.
>
> Fixes: f685e609a301 ("net: dsa: Deny PTP on master if switch supports it")
> Link: https://patchwork.kernel.org/project/netdevbpf/patch/20221110124345.3901389-1-festevam@gmail.com/
> Reported-by: Fabio Estevam <festevam@...il.com>
> Reported-by: Steffen Bätz <steffen@...osonix.de>
> Signed-off-by: Vladimir Oltean <vladimir.oltean@....com>
Thanks for your fix!
Tested-by: Fabio Estevam <festevam@...x.de>
Powered by blists - more mailing lists