[PATCH net-next 0/3] ptp: add pulse signal loopback support for debugging

Wei Fang posted 3 patches 4 weeks, 1 day ago
There is a newer version of this series
MAINTAINERS                      |   1 -
drivers/ptp/Kconfig              |   2 +-
drivers/ptp/Makefile             |   4 +-
drivers/ptp/ptp_clock.c          |  66 ++++++++++++++++++++
drivers/ptp/ptp_netc.c           |  25 ++++++++
drivers/ptp/ptp_qoriq.c          |  24 +++++++-
drivers/ptp/ptp_qoriq_debugfs.c  | 101 -------------------------------
include/linux/fsl/ptp_qoriq.h    |  10 ---
include/linux/ptp_clock_kernel.h |  10 +++
9 files changed, 125 insertions(+), 118 deletions(-)
delete mode 100644 drivers/ptp/ptp_qoriq_debugfs.c
[PATCH net-next 0/3] ptp: add pulse signal loopback support for debugging
Posted by Wei Fang 4 weeks, 1 day ago
Some PTP devices support looping back the periodic pulse signal for
debugging, so add the generic debugfs interfaces to the ptp_clock
driver. The first two patch are separated from the previous patch
set [1]. The third patch is new added.

[1]: https://lore.kernel.org/imx/20250827063332.1217664-1-wei.fang@nxp.com/ #patch 3 and 9

Wei Fang (3):
  ptp: add debugfs interfaces to loop back the periodic output signal
  ptp: netc: add the periodic output signal loopback support
  ptp: qoriq: covert to use generic interfaces to set loopback mode

 MAINTAINERS                      |   1 -
 drivers/ptp/Kconfig              |   2 +-
 drivers/ptp/Makefile             |   4 +-
 drivers/ptp/ptp_clock.c          |  66 ++++++++++++++++++++
 drivers/ptp/ptp_netc.c           |  25 ++++++++
 drivers/ptp/ptp_qoriq.c          |  24 +++++++-
 drivers/ptp/ptp_qoriq_debugfs.c  | 101 -------------------------------
 include/linux/fsl/ptp_qoriq.h    |  10 ---
 include/linux/ptp_clock_kernel.h |  10 +++
 9 files changed, 125 insertions(+), 118 deletions(-)
 delete mode 100644 drivers/ptp/ptp_qoriq_debugfs.c

-- 
2.34.1
Re: [PATCH net-next 0/3] ptp: add pulse signal loopback support for debugging
Posted by Richard Cochran 4 weeks, 1 day ago
On Wed, Sep 03, 2025 at 04:37:46PM +0800, Wei Fang wrote:
> Some PTP devices support looping back the periodic pulse signal for
> debugging,

What kinds of debugs can be resolved by this loopback feature?

It seems pointless to me...

Thanks,
Richard
Re: [PATCH net-next 0/3] ptp: add pulse signal loopback support for debugging
Posted by Vladimir Oltean 4 weeks, 1 day ago
On Wed, Sep 03, 2025 at 06:41:30AM -0700, Richard Cochran wrote:
> On Wed, Sep 03, 2025 at 04:37:46PM +0800, Wei Fang wrote:
> > Some PTP devices support looping back the periodic pulse signal for
> > debugging,
> 
> What kinds of debugs can be resolved by this loopback feature?

The commit message of patch 2/3 shows that you can record extts events
for the periodic output signal emitted by the device, without this
signal ever being required to be routed in any particular way on the PCB,
through the SoC's pins.

So you can make sure that the pulse intervals and their phase alignment
are correct from the perspective of the emitting PHC's time base.

Or you can use it as a built-in extts event generator when you have no
external equipment which does that, as I did a few years ago to validate
the extts functionality on ptp_qoriq.

> It seems pointless to me...

Well, it's pointless in the same sense that a mirror is pointless.