lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a275c50b-2bcb-4fea-bc73-b367d05dba08@foss.st.com>
Date: Wed, 10 Sep 2025 17:10:48 +0200
From: Gatien CHEVALLIER <gatien.chevallier@...s.st.com>
To: "Russell King (Oracle)" <linux@...linux.org.uk>,
        Andrew Lunn
	<andrew@...n.ch>, Heiner Kallweit <hkallweit1@...il.com>
CC: Richard Cochran <richardcochran@...il.com>,
        Jesper Dangaard Brouer
	<hawk@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>, <netdev@...r.kernel.org>,
        <linux-stm32@...md-mailman.stormreply.com>,
        "John
 Fastabend" <john.fastabend@...il.com>,
        Alexei Starovoitov <ast@...nel.org>,
        Andrew Lunn <andrew+netdev@...n.ch>,
        Eric Dumazet <edumazet@...gle.com>,
        Stanislav Fomichev <sdf@...ichev.me>,
        Maxime Coquelin
	<mcoquelin.stm32@...il.com>,
        Jakub Kicinski <kuba@...nel.org>, <bpf@...r.kernel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        "David S. Miller"
	<davem@...emloft.net>,
        <linux-arm-kernel@...ts.infradead.org>
Subject: Re: [Linux-stm32] [PATCH net-next 00/11] net: stmmac:
 timestamping/ptp cleanups



On 9/9/25 18:47, Russell King (Oracle) wrote:
> Hi,
> 
> This series cleans up the hardware timestamping / PTP initialisation
> and cleanup code in the stmmac driver. Several key points in no
> particular order:
> 
> 1. Golden rule: unregister first, then release resources.
>     stmmac_release_ptp didn't do this.
> 
> 2. Avoid leaking resources - __stmmac_open() failure leaves the
>     timestamping support initialised, but stops its clock. Also
>     violates (1).
> 
> 3. Avoid double-release of resources - stmmac_open() followed by
>     stmmac_xdp_open() failing results in the PTP clock prepare and
>     enable counts being released, and if the interface is then
>     brought down, they are incorrectly released again. As XDP
>     doesn't gain any additional prepare/enables on the PTP clock,
>     remove this incorrect cleanup.
> 
> 4. Changing the MTU of the interface is disruptive to PTP, and
>     remains so as long as. This is not fixed by this series (too
>     invasive at the moment.)
> 
> 5. Avoid exporting functions that aren't used...
> 
> 6. Avoid unnecessary runtime PM state manipulations (no point
>     manipulating this when MTU changes).
> 
> 7. Make the PTP/timestamping initialisation more readable - no
>     point calling functions in the same file from one callsite
>     that return error codes from one location in the called function,
>     to only have the sole callee print messages depending on that
>     return code. Also simplifying the mess in stmmac_hw_setup().
>     Also placing support checks in a better location. Also getting
>     rid of the "ptp_register" boolean through this restructuring.
> 
> Not tested beyond compile testing. (I don't have my Jetson Xavier NX
> platform.) So anyone testing this and providing feedback would be
> most welcome.
> 
> On that point... I hardly (never?) seem to get testing feedback from
> anyone when touching stmmac. I suspect that's because of the structure
> of the driver, where MAINTAINERS only lists people for their appropriate
> dwmac-* files. Thus they don't get Cc'd for core stmmac changes. Not
> sure what the solution is, but manually picking out all the entries
> in MAINTAINERS every time doesn't scale.
> 
> Therefore, I suggest merging this into net-next so people get to test
> it by way of it being in a tree they might be using.
> 
>   drivers/net/ethernet/stmicro/stmmac/stmmac.h      |   1 -
>   drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 113 ++++++++++++----------
>   drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c  |  10 +-
>   3 files changed, 67 insertions(+), 57 deletions(-)
> 

Tried on the stm32mp135f-dk board and was able to run ptp4l with
coherent timestamps, so:

Tested-by: Gatien Chevallier <gatien.chevallier@...s.st.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ