From: Jacob Keller <jacob.e.keller@intel.com>
To: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>,
<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<intel-wired-lan@lists.osuosl.org>
Cc: <anthony.l.nguyen@intel.com>, <przemyslaw.kitszel@intel.com>,
<davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>,
<pabeni@redhat.com>, <richardcochran@gmail.com>,
Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Subject: Re: [Intel-wired-lan] [PATCH net-next 1/2] ptp: add control over HW timestamp latch point
Date: Mon, 21 Oct 2024 15:31:16 -0700 [thread overview]
Message-ID: <07bb7025-633a-479e-a45c-f07346b14d0d@intel.com> (raw)
In-Reply-To: <20241021141955.1466979-2-arkadiusz.kubalewski@intel.com>
On 10/21/2024 7:19 AM, Arkadiusz Kubalewski wrote:
> Currently HW support of PTP/timesync solutions in network PHY chips can be
> implemented with two different approaches, the timestamp maybe latched
> either at the beginning or after the Start of Frame Delimiter (SFD) [1].
>
> Allow ptp device drivers to provide user with control over the HW
> timestamp latch point with ptp sysfs ABI.
>
> [1] https://www.ieee802.org/3/cx/public/april20/tse_3cx_01_0420.pdf
>
> Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
> Signed-off-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
> ---
> Documentation/ABI/testing/sysfs-ptp | 12 ++++++++
> drivers/ptp/ptp_sysfs.c | 44 +++++++++++++++++++++++++++++
> include/linux/ptp_clock_kernel.h | 29 +++++++++++++++++++
> 3 files changed, 85 insertions(+)
>
> diff --git a/Documentation/ABI/testing/sysfs-ptp b/Documentation/ABI/testing/sysfs-ptp
> index 9c317ac7c47a..a0d89e0fd72e 100644
> --- a/Documentation/ABI/testing/sysfs-ptp
> +++ b/Documentation/ABI/testing/sysfs-ptp
> @@ -140,3 +140,15 @@ Description:
> PPS events to the Linux PPS subsystem. To enable PPS
> events, write a "1" into the file. To disable events,
> write a "0" into the file.
> +
> +What: /sys/class/ptp/ptp<N>/ts_point
> +Date: October 2024
> +Contact: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
> +Description:
> + This file provides control over the point in time in
> + which the HW timestamp is latched. As specified in IEEE
> + 802.3cx, the latch point can be either at the beginning
> + or after the end of Start of Frame Delimiter (SFD).
> + Value "0" means the timestamp is latched at the
> + beginning of the SFD. Value "1" means that timestamp is
> + latched after the end of SFD.
> diff --git a/drivers/ptp/ptp_sysfs.c b/drivers/ptp/ptp_sysfs.c
> index 6b1b8f57cd95..7e9f6ef368b6 100644
> --- a/drivers/ptp/ptp_sysfs.c
> +++ b/drivers/ptp/ptp_sysfs.c
> @@ -28,6 +28,46 @@ static ssize_t max_phase_adjustment_show(struct device *dev,
> }
> static DEVICE_ATTR_RO(max_phase_adjustment);
>
> +static ssize_t ts_point_show(struct device *dev, struct device_attribute *attr,
> + char *page)
> +{
> + struct ptp_clock *ptp = dev_get_drvdata(dev);
> + enum ptp_ts_point point;
> + int err;
> +
> + if (!ptp->info->get_ts_point)
> + return -EOPNOTSUPP;
> + err = ptp->info->get_ts_point(ptp->info, &point);
> + if (err)
> + return err;
> +
> + return sysfs_emit(page, "%d\n", point);
> +}
> +
Ok, so if the driver doesn't support this API, we just return EOPNOTSUPP
and don't support the API then.
Presumably hardware which doesn't timestamp according to this standard
would then simply not support the API?
next prev parent reply other threads:[~2024-10-21 22:31 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-21 14:19 [PATCH net-next 0/2] " Arkadiusz Kubalewski
2024-10-21 14:19 ` [PATCH net-next 1/2] " Arkadiusz Kubalewski
2024-10-21 15:20 ` [Intel-wired-lan] " Paul Menzel
2024-10-22 13:24 ` Kubalewski, Arkadiusz
2024-10-21 22:31 ` Jacob Keller [this message]
2024-10-22 14:51 ` Kubalewski, Arkadiusz
2024-10-23 2:12 ` Richard Cochran
2024-10-23 7:37 ` Kubalewski, Arkadiusz
2024-10-21 14:19 ` [PATCH net-next 2/2] ice: " Arkadiusz Kubalewski
2024-10-21 15:34 ` [Intel-wired-lan] " Paul Menzel
2024-10-22 13:24 ` Kubalewski, Arkadiusz
2024-10-22 13:40 ` Simon Horman
2024-10-22 14:52 ` Kubalewski, Arkadiusz
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=07bb7025-633a-479e-a45c-f07346b14d0d@intel.com \
--to=jacob.e.keller@intel.com \
--cc=aleksandr.loktionov@intel.com \
--cc=anthony.l.nguyen@intel.com \
--cc=arkadiusz.kubalewski@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
--cc=richardcochran@gmail.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®