Re: [Linux-stm32] [PATCH net-next 00/11] net: stmmac: timestamping/ptp cleanups

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





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@xxxxxxxxxxx>




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux