Article View: linux.kernel.netdev
Article #991[PATCH net v2 2/3] net: enetc: fix support for PTP_EXTTS_REQUEST2 ioctl
From: Vincent Jardin via B4 Relay
Date: Fri, 09 Oct 2026 00:00
Date: Fri, 09 Oct 2026 00:00
46 lines
8307 bytes
8307 bytes
From: Vincent Jardin <vjardin@free.fr>
Commit 7c571ac57d9d ("net: ptp: introduce .supported_extts_flags to
ptp_clock_info") moved the validation of the external timestamp request
flags into the PTP core. A driver that does not set
.supported_extts_flags still accepts the legacy PTP_EXTTS_REQUEST ioctl,
but every PTP_EXTTS_REQUEST2 request is rejected with -EOPNOTSUPP.
The ENETC timer is the QorIQ 1588 timer, set up by ptp_qoriq_init(), which
programs TMR_CTRL with ETEP1 and ETEP2 cleared, so it timestamps the
rising edge of its external trigger inputs. Declare that, with
PTP_STRICT_FLAGS, so that a falling edge request is rejected instead of
being timestamped on the rising edge.
This also makes the legacy PTP_EXTTS_REQUEST ioctl strict: a request for
the falling edge, or for both edges, now fails with -EOPNOTSUPP instead
of being timestamped on the rising edge. That cannot be avoided: the core
adds PTP_STRICT_FLAGS to every PTP_EXTTS_REQUEST2 request, so a driver
has to declare it to accept them, and once declared it applies to both
ioctls. Commit 3200fdd4021d ("broadcom: fix support for
PTP_EXTTS_REQUEST2 ioctl") made the same change for bcm-phy-ptp.
Fixes: 7c571ac57d9d ("net: ptp: introduce .supported_extts_flags to ptp_clock_info")
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Kory Maincent <kory.maincent@bootlin.com>
Signed-off-by: Vincent Jardin <vjardin@free.fr>
---
drivers/net/ethernet/freescale/enetc/enetc_ptp.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/freescale/enetc/enetc_ptp.c b/drivers/net/ethernet/freescale/enetc/enetc_ptp.c
index 162cbc801730..5ffee882d624 100644
--- a/drivers/net/ethernet/freescale/enetc/enetc_ptp.c
+++ b/drivers/net/ethernet/freescale/enetc/enetc_ptp.c
@@ -16,6 +16,7 @@ static struct ptp_clock_info enetc_ptp_caps = {
.n_per_out = 0,
.n_pins = 0,
.pps = 1,
+ .supported_extts_flags = PTP_RISING_EDGE | PTP_STRICT_FLAGS,
.adjfine = ptp_qoriq_adjfine,
.adjtime = ptp_qoriq_adjtime,
.gettime64 = ptp_qoriq_gettime,
--
2.43.0
Technical Details
Message-ID:
<20261009-for-upstream-qoriq-ptp-extts-flags-v2-2-0f4eeff2295d@free.fr>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-343363-linux-kernel-netdev=dewy.ruReferences:
<20261009-for-upstream-qoriq-ptp-extts-flags-v2-0-0f4eeff2295d@free.fr>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-343363-linux-kernel-netdev=dewy.ru From: devnull+vjardin.free.fr@kernel.org (Vincent Jardin via B4 Relay) Newsgroups: linux.kernel.netdev Subject: [PATCH net v2 2/3] net: enetc: fix support for PTP_EXTTS_REQUEST2 ioctl Date: Fri, 09 Oct 2026 02:00:57 +0200 Organization: Usenet Network Message-ID: <20261009-for-upstream-qoriq-ptp-extts-flags-v2-2-0f4eeff2295d@free.fr> References: <20261009-for-upstream-qoriq-ptp-extts-flags-v2-0-0f4eeff2295d@free.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Injection-Info: usenet.network; logging-data="999867"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:qg+PE9ovPjmxIihlCqrEBe6MNPE= sha256:vzdaeXhwjeshL9p+3W0XHK2suxmzIYJIpgLgnaEoJxE= sha1:fPOMk4JIHUIVXlq07o0BEUE0vY8= sha256:7U9zwJCLJ9TaFqhy8n4/HQmRiJAV5usJS6i/7vNeJ9A= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id DD90810F575; Fri, 9 Oct 2026 03:01:14 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.641 X-Spam-Status: No, score=-3.641 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.241, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AYYK9XBomfPj; Fri, 9 Oct 2026 03:01:11 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-343363-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id 88DC810F573; Fri, 9 Oct 2026 03:01:08 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id 96E4E2D8AE; Fri, 9 Oct 2026 00:01:06 +0000 (UTC) X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 43A732ED16D; Fri, 9 Oct 2026 00:01:05 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Iy4xOboK" X-Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1F2831A6811; Fri, 9 Oct 2026 00:01:05 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791504065; cv=none; b=d1A9jvKfh32KiRItaQHXAqlQt9N6PHF3gkBRyTK3ccolwU+5MK8Lv+ztElFSQeT8CSQ5vRcnmPaFRZESbyp6WDPxNwDDWCGN9APCfIspbDrgAUbrm+ZVnAQbrJj4UYtvfll7rbTvrBKu5ff87JvJxu9GrHcLX0PrMnbhWdDn+jo= X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791504065; c=relaxed/simple; bh=Y7LkpHq/EqWyjjE+GG2bE7LJnfYFsJcrS++uxn1ph3E=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=gyIQwr99XNKKvG9WqOvbWsP7GFzFO/mJveGVDQAuD0G96W3+9ikuoykKMZLNnBVR19ZKxAvwSwhv6PwyVlunnDhyTebU6VZrkMxbOWxy2yLqsSMNiMgYGOmk0W7Z6Y3euSqttGTUzkLbC9j2pr2iFN2Ep4vEYvoWx809c/SaIwA= X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Iy4xOboK; arc=none smtp.client-ip=10.30.226.201 X-Received: by smtp.kernel.org (Postfix) with ESMTPS id C1B31C2BCFB; Fri, 9 Oct 2026 00:01:04 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1791504064; bh=Y7LkpHq/EqWyjjE+GG2bE7LJnfYFsJcrS++uxn1ph3E=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=Iy4xOboKNHOGe1rTDUN/8G99DffoU75dV2Go1gIB9F+EMsF+xYzeKfsRLPLhKIXL1 n7n38nIfveBu2VtJd4A4oEseSQONdEoifAsER8WXuznNKfWrBV7sheZm63GaualyyJ gwEZzGJMonUiTc7xU8KSB7eifA9B6j2gMVJsC9xKxVRYMuvjOULnq4ewK4+VpIagGC xauznlRn3pHOgEnFapL5LqZIEXRB6RHdJ6ZxmqvdWOkOOnKJizwIBfvYggdU39GpVk gh28UdBGiqSpDRG2+Wre48WHGeM91Bw4ZZIwW70WG8jMeOhxcz0nUofiVcm1F39RZC 3IWCONWBe4vWw== X-Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9F95ACA6019; Fri, 9 Oct 2026 00:01:04 +0000 (UTC) X-Precedence: bulk X-Mailing-List: netdev@vger.kernel.org X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-In-Reply-To: <20261009-for-upstream-qoriq-ptp-extts-flags-v2-0-0f4eeff2295d@free.fr> X-Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, Ioana Ciornei <ioana.ciornei@nxp.com>, Vincent Jardin <vjardin@free.fr> X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1791504062; l=2060; i=vjardin@free.fr; s=20260525; h=from:subject:message-id; bh=L1S1HG7Gx1BM3jj/P7AoxFPVrkOFse7kf8sg7YIEDiE=; b=eRmCe6sdAQofk50PVPdYb/GrlX5PQxhsMTvHS4wDa/VC2UP92BHXocWqQ16BPBsJ8KuLwgtor LTSjNZ3wQlYBnbub8b+CbAPxtgNTQZBu9ZwbU2s6MeaQiLC2MvVLXQB X-Developer-Key: i=vjardin@free.fr; a=ed25519; pk=hppgLeFpGpKOi7LNwGEZ4jOYofJCoGd4Jf1ltAabiLw= X-Endpoint-Received: by B4 Relay for vjardin@free.fr/20260525 with auth_id=871 X-Original-From: Vincent Jardin <vjardin@free.fr> X-Reply-To: vjardin@free.fr