mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Wen Gu <guwen@linux.alibaba.com>
To: richardcochran@gmail.com, andrew+netdev@lunn.ch,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com
Cc: xuanzhuo@linux.alibaba.com, dust.li@linux.alibaba.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	guwen@linux.alibaba.com
Subject: [PATCH net-next v5 2/2] ptp: add sysfs documentation for Alibaba CIPU PHC driver
Date: Thu, 30 Oct 2025 20:13:14 +0800	[thread overview]
Message-ID: <20251030121314.56729-3-guwen@linux.alibaba.com> (raw)
In-Reply-To: <20251030121314.56729-1-guwen@linux.alibaba.com>

This adds documentation for the sysfs files exposed by the Alibaba
CIPU PHC driver.

Signed-off-by: Wen Gu <guwen@linux.alibaba.com>
---
 .../ABI/testing/sysfs-ptp-devices-cipu        | 227 ++++++++++++++++++
 MAINTAINERS                                   |   1 +
 2 files changed, 228 insertions(+)
 create mode 100644 Documentation/ABI/testing/sysfs-ptp-devices-cipu

diff --git a/Documentation/ABI/testing/sysfs-ptp-devices-cipu b/Documentation/ABI/testing/sysfs-ptp-devices-cipu
new file mode 100644
index 000000000000..0abf2fb8eb1e
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-ptp-devices-cipu
@@ -0,0 +1,227 @@
+What:           /sys/class/ptp/ptp<N>/device/cipu/ptp_gettm
+Date:           October 2025
+Contact:        Wen Gu <guwen@linux.alibaba.com>
+Description:
+                Count of PTP gettime64 and gettimex64 operations performed
+                on the Alibaba CIPU PTP device.
+
+What:           /sys/class/ptp/ptp<N>/device/cipu/ptp_gettm_inval_err
+Date:           October 2025
+Contact:        Wen Gu <guwen@linux.alibaba.com>
+Description:
+                Count of failed PTP gettime64 or gettimex64 operations due
+                to invalid timestamp.
+
+                Invalid timestamps are indicated by bit63 (PTP_CIPU_M_TS_ABN)
+                in the timestamp register being set.
+
+                The driver will also trigger device status check when this
+                occurs.
+
+What:           /sys/class/ptp/ptp<N>/device/cipu/ptp_gettm_tout_err
+Date:           October 2025
+Contact:        Wen Gu <guwen@linux.alibaba.com>
+Description:
+                Count of failed PTP gettime64 or gettimex64 operations due
+                to register read timeout (exceeding max_lat_ns).
+
+What:           /sys/class/ptp/ptp<N>/device/cipu/ptp_gettm_excd_thresh
+Date:           October 2025
+Contact:        Wen Gu <guwen@linux.alibaba.com>
+Description:
+                Count of times system time and PHC time offset exceeded
+                the configured threshold (thresh_us).
+
+                This is only recorded and does not affect the returned
+                timestamp.
+
+What:           /sys/class/ptp/ptp<N>/device/cipu/dev_clk_abn
+Date:           October 2025
+Contact:        Wen Gu <guwen@linux.alibaba.com>
+Description:
+                Count of atomic clock abnormal events (bit1 set in sync_stat).
+
+What:           /sys/class/ptp/ptp<N>/device/cipu/dev_clk_abn_rec
+Date:           October 2025
+Contact:        Wen Gu <guwen@linux.alibaba.com>
+Description:
+                Count of recovery from atomic clock abnormal events (bit1
+                cleared in sync_stat after being set).
+
+What:           /sys/class/ptp/ptp<N>/device/cipu/dev_maint
+Date:           October 2025
+Contact:        Wen Gu <guwen@linux.alibaba.com>
+Description:
+                Count of maintenance events (bit0 set in sync_stat).
+
+What:           /sys/class/ptp/ptp<N>/device/cipu/dev_maint_rec
+Date:           October 2025
+Contact:        Wen Gu <guwen@linux.alibaba.com>
+Description:
+                Count of recovery from maintenance events (bit0 cleared
+                in sync_stat).
+
+What:           /sys/class/ptp/ptp<N>/device/cipu/dev_maint_tout
+Date:           October 2025
+Contact:        Wen Gu <guwen@linux.alibaba.com>
+Description:
+                Count of maintenance events that failed to recover within
+                mt_tout_us timeout.
+
+What:           /sys/class/ptp/ptp<N>/device/cipu/dev_busy
+Date:           October 2025
+Contact:        Wen Gu <guwen@linux.alibaba.com>
+Description:
+                Count of device busy events (bit4 set in sync_stat).
+
+What:           /sys/class/ptp/ptp<N>/device/cipu/dev_busy_rec
+Date:           October 2025
+Contact:        Wen Gu <guwen@linux.alibaba.com>
+Description:
+                Count of recovery from device busy events (bit4 cleared
+                in sync_stat).
+
+What:           /sys/class/ptp/ptp<N>/device/cipu/dev_err
+Date:           October 2025
+Contact:        Wen Gu <guwen@linux.alibaba.com>
+Description:
+                Count of device error events (bit7 set in sync_stat).
+
+What:           /sys/class/ptp/ptp<N>/device/cipu/dev_err_rec
+Date:           October 2025
+Contact:        Wen Gu <guwen@linux.alibaba.com>
+Description:
+                Count of recovery from device error events (bit7 cleared
+                in sync_stat).
+
+What:           /sys/class/ptp/ptp<N>/device/cipu/drv_cap
+Date:           October 2025
+Contact:        Wen Gu <guwen@linux.alibaba.com>
+Description:
+                Driver capabilities bitmask (u32):
+
+                ========  ============================
+                bit 0     support TAI time mode
+                bit 1     support epoch base time mode
+                bit 2     support abnormal event IRQ
+                bit 3     support recovery event IRQ
+                bit 31:4  reserved
+                ========  ============================
+
+                Currently TAI time mode (bit0) is not supported.
+
+What:           /sys/class/ptp/ptp<N>/device/cipu/reg_dev_feat
+Date:           October 2025
+Contact:        Wen Gu <guwen@linux.alibaba.com>
+Description:
+                Device feature bitmask, same bit definitions as drv_cap.
+
+What:           /sys/class/ptp/ptp<N>/device/cipu/reg_gst_feat
+Date:           October 2025
+Contact:        Wen Gu <guwen@linux.alibaba.com>
+Description:
+                Feature bitmask negotiated by driver and device, same
+                bit definitions as drv_cap but only features supported
+                by both device and driver are set.
+
+What:           /sys/class/ptp/ptp<N>/device/cipu/reg_drv_ver
+Date:           October 2025
+Contact:        Wen Gu <guwen@linux.alibaba.com>
+Description:
+                Driver version encoding (u32):
+
+                =========  ===================
+                bit 7:0    subminor version
+                bit 15:8   minor version
+                bit 23:16  major version
+                bit 24     0 for intree driver
+                bit 31:25  reserved
+                =========  ===================
+
+What:           /sys/class/ptp/ptp<N>/device/cipu/reg_env_ver
+Date:           October 2025
+Contact:        Wen Gu <guwen@linux.alibaba.com>
+Description:
+                Environment encoding (u32):
+
+                =========  =======================
+                bit 7:0    kernel patchlevel
+                bit 15:8   kernel sublevel
+                bit 23:16  kernel version
+                bit 26:24  reserved
+                bit 31:27  0x1F for Linux upstream
+                =========  =======================
+
+What:           /sys/class/ptp/ptp<N>/device/cipu/reg_dev_stat
+Date:           October 2025
+Contact:        Wen Gu <guwen@linux.alibaba.com>
+Description:
+                Device status (u8):
+
+                =  =========================================
+                0  RESET, device reset
+                1  FEATURE_OK, feature negotiation complete
+                2  DRIVER_OK, fully configured, ready to use
+                =  =========================================
+
+What:           /sys/class/ptp/ptp<N>/device/cipu/reg_sync_stat
+Date:           October 2025
+Contact:        Wen Gu <guwen@linux.alibaba.com>
+Description:
+                Device sync status bitmask (u8):
+
+                =====  =====================
+                bit 0  maintenance
+                bit 1  atomic clock abnormal
+                bit 4  device busy
+                bit 7  device error
+                =====  =====================
+
+                other bits are reserved.
+
+What:           /sys/class/ptp/ptp<N>/device/cipu/reg_tm_prec_ns
+Date:           October 2025
+Contact:        Wen Gu <guwen@linux.alibaba.com>
+Description:
+                Time precision reported by device, in nanoseconds (u32).
+
+What:           /sys/class/ptp/ptp<N>/device/cipu/reg_epo_base_yr
+Date:           October 2025
+Contact:        Wen Gu <guwen@linux.alibaba.com>
+Description:
+                Epoch base year used when epoch mode is enabled (u32).
+
+What:           /sys/class/ptp/ptp<N>/device/cipu/reg_leap_sec
+Date:           October 2025
+Contact:        Wen Gu <guwen@linux.alibaba.com>
+Description:
+                Leap seconds offset reported by device, in seconds (u32).
+
+What:           /sys/class/ptp/ptp<N>/device/cipu/reg_max_lat_ns
+Date:           October 2025
+Contact:        Wen Gu <guwen@linux.alibaba.com>
+Description:
+                Maximum device register read latency tolerated,
+                in nanoseconds (u32).
+
+                Exceeding this is treated as timeout. e.g. see
+                ptp_gettm_tout_err.
+
+What:           /sys/class/ptp/ptp<N>/device/cipu/reg_mt_tout_us
+Date:           October 2025
+Contact:        Wen Gu <guwen@linux.alibaba.com>
+Description:
+                Maintenance recovery timeout in microseconds (u32).
+
+                If exceeded while maintenance status is set, reported as
+                dev_maint_tout event.
+
+What:           /sys/class/ptp/ptp<N>/device/cipu/reg_thresh_us
+Date:           October 2025
+Contact:        Wen Gu <guwen@linux.alibaba.com>
+Description:
+                Threshold (u32, in microseconds) for acceptable
+                PHC vs system time offset.
+
+                Exceeding this only increments ptp_gettm_excd_thresh
+                counter.
diff --git a/MAINTAINERS b/MAINTAINERS
index b1543fcd12ea..1a4f4a2a96ce 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -800,6 +800,7 @@ M:	Wen Gu <guwen@linux.alibaba.com>
 M:	Xuan Zhuo <xuanzhuo@linux.alibaba.com>
 L:	netdev@vger.kernel.org
 S:	Supported
+F:	Documentation/ABI/testing/sysfs-ptp-devices-cipu
 F:	drivers/ptp/ptp_cipu.c
 
 ALIBABA ELASTIC RDMA DRIVER
-- 
2.43.5


      parent reply	other threads:[~2025-10-30 12:13 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-30 12:13 [PATCH net-next v5 0/2] ptp: Alibaba CIPU PTP clock driver Wen Gu
2025-10-30 12:13 ` [PATCH net-next v5 1/2] ptp: introduce Alibaba CIPU PHC driver Wen Gu
2025-10-31 23:58   ` Jakub Kicinski
2025-11-05 10:22     ` Wen Gu
2025-11-06  0:24       ` Jakub Kicinski
2025-11-27  5:48         ` Wen Gu
2025-11-27 16:36           ` Jakub Kicinski
2025-11-28  6:22             ` Wen Gu
2025-11-28 18:24               ` Jakub Kicinski
2025-12-01  6:04                 ` Wen Gu
2025-12-12  6:50                   ` Wen Gu
2025-12-12 22:50                     ` Jakub Kicinski
2025-12-14 14:03                       ` Wen Gu
2025-12-16 21:58                         ` Jakub Kicinski
2025-12-17 12:40                           ` Wen Gu
2025-12-22  7:18                           ` Wen Gu
2026-01-02 19:51                             ` Jakub Kicinski
2026-01-04  6:11                               ` Wen Gu
2026-01-09  9:25                                 ` David Woodhouse
2026-01-12  3:45                                   ` Wen Gu
2025-12-18 12:28         ` David Woodhouse
2025-12-22 12:44           ` Wen Gu
2025-10-30 12:13 ` Wen Gu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251030121314.56729-3-guwen@linux.alibaba.com \
    --to=guwen@linux.alibaba.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=dust.li@linux.alibaba.com \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.com \
    --cc=xuanzhuo@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®