Re: [PATCH net-next v2 0/2] Add Marvell PHY PTP support

From: Kory Maincent
Date: Wed Apr 09 2025 - 04:47:02 EST


On Wed, 9 Apr 2025 09:35:59 +0100
"Russell King (Oracle)" <linux@xxxxxxxxxxxxxxx> wrote:

> On Wed, Apr 09, 2025 at 10:31:30AM +0200, Kory Maincent wrote:
> > On Tue, 8 Apr 2025 21:38:19 +0100
> > "Russell King (Oracle)" <linux@xxxxxxxxxxxxxxx> wrote:
> >
> > > On Mon, Apr 07, 2025 at 06:39:14PM +0200, Kory Maincent wrote:
> [...]
> [...]
> [...]
> > >
> > > Okay, so I'm pleased to report that this now works on the Macchiatobin:
> > >
> > > where phc 2 is the mvpp2 clock, and phc 0 is the PHY.
> >
> > Great, thank you for the testing!
> >
> > >
> > > # ethtool -T eth2
> > > Time stamping parameters for eth2:
> > > Capabilities:
> > > hardware-transmit
> > > software-transmit
> > > hardware-receive
> > > software-receive
> > > software-system-clock
> > > hardware-raw-clock
> > > PTP Hardware Clock: 2
> > > Hardware Transmit Timestamp Modes:
> > > off
> > > on
> > > onestep-sync
> > > onestep-p2p
> > > Hardware Receive Filter Modes:
> > > none
> > > all
> > >
> > > So I guess that means that by default it's using PHC 2, and thus using
> > > the MVPP2 PTP implementation - which is good, it means that when we add
> > > Marvell PHY support, this won't switch to the PHY implementation.
> >
> > Yes.
> >
> > >
> > > Now, testing ethtool:
> > >
> > > $ ./ethtool --get-hwtimestamp-cfg eth2
> > > netlink error: Operation not supported
> > >
> > > Using ynl:
> > >
> > > # ./ynl/cli.py --spec netlink/specs/ethtool.yaml --no-schema --dump
> > > tsconfig-get --json '{"header":{"dev-name":"eth2"}}' []
> > >
> > > So, It's better, something still isn't correct as there's no
> > > configuration. Maybe mvpp2 needs updating first? If that's the case,
> > > then we're not yet in a position to merge PHY PTP support.
> >
> > Indeed mvpp2 has not been update to support the ndo_hwtstamp_get/set NDOs.
> > Vlad had made some work to update all net drivers to these NDOs but he never
> > send it mainline:
> > https://github.com/vladimiroltean/linux/commits/ndo-hwtstamp-v9
> >
> > I have already try to ping him on this but without success.
> > Vlad any idea on when you could send your series upstream?
>
> Right, and that means that the kernel is not yet ready to support
> Marvell PHY PTP, because all the pre-requisits to avoid breaking
> mvpp2 have not yet been merged.

Still I don't understand how this break mvpp2.
As you just tested this won't switch to the PHY PTP implementation. The old
usage of using SIOCG/SHWTSTAMP will still work, you simply won't be able to use
the new netlink feature of switching between the two PTP as long as
ndo_hwtstamp_get/set NDOs is not supported in mvpp2.

Regards,
--
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com