🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #10794

[PATCH net] net: stmmac: ptp: fix support for PTP_EXTTS_REQUEST2 ioctl

#10794
From: James Clark
Date: Wed, 04 Nov 2026 05:25
53 lines
13283 bytes
Commit 7c571ac57d9d ("net: ptp: introduce .supported_extts_flags to
ptp_clock_info") modified the PTP core to validate the supported flags
of external timestamp requests, rather than relying on each driver to
check them.

stmmac_enable() and dwmac1000_ptp_enable() ignore the flags, and
neither stmmac_ptp_clock_ops nor dwmac1000_ptp_clock_ops was given any
.supported_extts_flags. Since PTP_EXTTS_REQUEST2 always implies
PTP_STRICT_FLAGS, the core now rejects every PTP_EXTTS_REQUEST2 for
this driver with -EOPNOTSUPP, where before that commit the same
requests succeeded. Only the PTP_EXTTS_REQUEST ioctl still works.

Tests on an NXP i.MX 8M Plus (FRDM-IMX8MPLUS, GMAC 5.10a) show that the
auxiliary snapshot inputs timestamp just the rising edge. The reference
manuals for the STM32MP13 (GMAC 4.20a) and the Cyclone V HPS (GMAC
3.70a, which uses dwmac1000_ptp_clock_ops) say the same.

Encode this in .supported_extts_flags. A PTP_EXTTS_REQUEST2 for the
rising edge then succeeds, and one for the falling edge or for both
edges fails with -EOPNOTSUPP.

Fixes: 7c571ac57d9d ("net: ptp: introduce .supported_extts_flags to ptp_clock_info")
Cc: stable@vger.kernel.org
Signed-off-by: James Clark <jjc@jclark.com>
---
I used an LLM coding assistant to help prepare this patch.

 drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
index a37405534beb..31a66e855d6b 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
@@ -277,6 +277,7 @@ const struct ptp_clock_info stmmac_ptp_clock_ops = {
 	.n_per_out = 0, /* will be overwritten in stmmac_ptp_register */
 	.n_pins = 0,
 	.pps = 0,
+	.supported_extts_flags = PTP_RISING_EDGE | PTP_STRICT_FLAGS,
 	.adjfine = stmmac_adjust_freq,
 	.adjtime = stmmac_adjust_time,
 	.gettimex64 = stmmac_get_timex,
@@ -294,6 +295,7 @@ const struct ptp_clock_info dwmac1000_ptp_clock_ops = {
 	.n_per_out = 0,
 	.n_pins = 0,
 	.pps = 0,
+	.supported_extts_flags = PTP_RISING_EDGE | PTP_STRICT_FLAGS,
 	.adjfine = stmmac_adjust_freq,
 	.adjtime = stmmac_adjust_time,
 	.gettimex64 = stmmac_get_timex,
-- 
2.56.0
Technical Details
Message-ID: <20261104052504.1886335-1-jjc@jclark.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-356207-linux-kernel-netdev=dewy.ru

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-356207-linux-kernel-netdev=dewy.ru
From: jjc@jclark.com (James Clark)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net] net: stmmac: ptp: fix support for PTP_EXTTS_REQUEST2 ioctl
Date: Wed,  4 Nov 2026 12:25:04 +0700
Organization: Usenet Network
Message-ID: <20261104052504.1886335-1-jjc@jclark.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="3331753"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:zJmxBBik+wdW/oYtVbWPcgBV7PY= sha256:f4hD1gE33NjOjRIgt0w926tp0SXK9dQw+mtgHq9w2Eo=
	sha1:tmekny7EGN79in3R6pTKKtt/gwQ= sha256:X7B0tLh45cMuVAZDqV5Z5Gzclp/ZkK0nNHsevqdlTJY=
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 D232F112AEE; Wed,  4 Nov 2026 08:25:38 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.05
X-Spam-Status: No, score=-3.05 tagged_above=-9999 required=6.31
	tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1,
	RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
	URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=jclark-com.20260707.gappssmtp.com
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 vHTWgVCIcU9I;
	Wed,  4 Nov 2026 08:25:31 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-356207-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=jclark.com
X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id 5F67D112AE9; Wed,  4 Nov 2026 08:25:23 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sto.lore.kernel.org (Postfix) with ESMTP id 7A12A60629D; Wed,  4 Nov 2026 05:25:22 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1793769920;
	b=1Yc8cFbyfMIHb4ndHjvQ02Dwg+m68q5N7c2F3tmF5QwZ4XzNb2IxV3aeyzv2OCm4b3j+
	 B9jEy5fwCrAzQ7K75esigaBSFf91gCVT4yEiEJ5Bsrbrb6nKwUclsf+EjJo1uTP5f+/Ub
	 iqk1fuItXfbcwy+l37IPwCegyNvxjUt+MqaC1i7zTyJJR0Ze7maySnJQ6zwU33pE+DZdQ
	 h8uoeOR5eqFra1mGv0EFnD08ralJ4VBdcZmGvB9LjKoCfGE1F4hnwONEQEHvOJJpIPZEc
	 7Ll6XXE2CKE1Hb9IixkwV1vwDuC1inwrPiub7o1a2m8obiValqIDWUxVJpIbMburqeQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793769920;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State:
	 X-Gm-Gg:X-Received:Received:From:To:Cc:Subject:Date:Message-ID:
	 X-Mailer:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 Content-Transfer-Encoding;
	bh=LOG7AOmS6IRRfgPKSJTi33/lfhAOaV7O3VJZu3BP5NY=;
	b=RPb4JhofD93BUwTz3mlof2H4orb3AiPmSk93HtB9cVqfvu/BD5L4U5/owhMO3IzfCynN
	 rCxnW9RQ0jiEVh1B66LA+mCa9U159CCoQp3iYNBAu69sn9RL4i6dWnQDcdvB6+ZAoux3p
	 AfKq+TbmwTKt9QY/9OCZ5VRa5pxjZ3FPswY0sWW6YKvwDPt0zgBksnFVqvRjIkk7xpknC
	 45avjkIm+CQ5lSTLvu+HIqTadBhyjVFpMeKTii2fZPUehrPijWbdr2lmzuPLNuZzNf1h7
	 Tt15nkmpaOkxz4APe0w3U5dtNWnVtJnrSe4IDARVu3fnKi9KcmynZ+khrBQ8cvZHVkQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=jclark-com.20260707.gappssmtp.com header.i=@jclark-com.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=nitJ5qF+;
	dmarc=none header.from=jclark.com;
	spf=pass smtp.mailfrom=jclark.com;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 28849606A329;
	Wed,  4 Nov 2026 05:25:20 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=jclark-com.20260707.gappssmtp.com header.i=@jclark-com.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=nitJ5qF+
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.179
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1793769914;
	b=qjQqUM7HA2+RjIK50UHRTXpQCzRWFZb6nZpqJAdvK5MkA8u4qYJSpaAB9WTiLpKe3ksH
	 b5+O6zVGMOy2M++02s5rr48oZZ87ZQlIc6BRQzpNsmImirJ4eYlXT0mhKuRZcqeR/k4W/
	 +kq9KFc26gQGnEoBntzVDO4HSOYBzsoLJmyhWBFSW9i9XdFXqvgP860VtSO8FJJcyLm13
	 KMYpq2DVvc0CCtAeDjvXWmLhw162YHYLY/6lxTILvyq3h7nghhG5JX+oMGTIznx3j74nK
	 VNQu5X2qV2hT6ndiz+sqZtbiKLLBZf0TRYoZHgG4ybR7HhS30H3Bb0DLuoOhnhCVmPg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793769914;
	h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
	 X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received:
	 From:To:Cc:Subject:Date:Message-ID:X-Mailer:MIME-Version:
	 Content-Transfer-Encoding;
	bh=LOG7AOmS6IRRfgPKSJTi33/lfhAOaV7O3VJZu3BP5NY=;
	b=R1X095QBzvL5qM1z7m2AHv13EFJU43EHwYJJU4rCB6uC0gaS7CJF398QjdFit88nJ+AJ
	 oc073h6Qey+KTJn6EAwS823tcgSy5goRbF+sJSLLR9XAq1vGu9sE/ayZnKmI3n5D3Lm88
	 AUFsdrKi7uJDRhTIJtt7iFziI+mJdyqZliWT5TtOm12/i9a1UFxKNEbfDJ2IxQ+IUrJ02
	 YSnvM/m6N4PZli2QO5OrsqXlSTP5rpRmvwVT8dppt5n9mV14ss0dPla0vM1IYShW8xaWl
	 BdaSlUEz7G+osmGi8kwDC60NzS4FgxmTetgyjoPZjl9Wec1ggR4hfGMIgxGU/vcEXSw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=none header.from=jclark.com;
	spf=pass smtp.mailfrom=jclark.com;
	dkim=pass header.d=jclark-com.20260707.gappssmtp.com header.i=@jclark-com.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=nitJ5qF+;
	arc=none smtp.remote-ip=74.125.82.179
X-Received: from mail-dy1-f179.google.com (mail-dy1-f179.google.com [74.125.82.179])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6F53B606A326
	for <netdev@vger.kernel.org>; Wed,  4 Nov 2026 05:25:13 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 6F53B606A326
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=jclark.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=jclark.com
X-Received: by mail-dy1-f179.google.com with SMTP id 5a478bee46e88-3514b90bb89so591506eec.1
        for <netdev@vger.kernel.org>; Tue, 03 Nov 2026 21:25:13 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=jclark-com.20260707.gappssmtp.com; s=20260707; t=1793769912; x=1794374712; darn=vger.kernel.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to:content-type;
        bh=LOG7AOmS6IRRfgPKSJTi33/lfhAOaV7O3VJZu3BP5NY=;
        b=nitJ5qF+g9pmuZqnfV6g0OB2usPhDHrYEncfSFTxZEDjIH1OwBIA3zox7IJFPp06xQ
         K40SE3iJq/v5lK77yc3wmc/H2K16h3UBaGoBS/BQR8tzXfNIu6//GCQHf1EnYCbZ+ywt
         miFb3XK1cclhKOn9uTeLPEpbQZQVmJ+Fgf10SMwBwim3ydvAujDiNXmmRufW9mEm5XZW
         SloOfOTgz8ZM3sfAxIDFP8cxjHM8mWCme4zti/cz7dAjWhAsxuYVrh9GFTU67ZFy0FHI
         ef/0aXDV7erBBR5vnomigRcB9xehqpQUKofRsctxlcIdPI88tpOPOcWYgtA96F3U/iER
         ivFg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1793769912; x=1794374712;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=LOG7AOmS6IRRfgPKSJTi33/lfhAOaV7O3VJZu3BP5NY=;
        b=E8myZ3FvPxkGdomY11KNCVyZw3ZYSZgIvhdDXe98aS9biZ2dv+YesNU4H2s/GOFIZ2
         buHj8tf5mHhwaDhmL+iIeSBaPbsCouVKZPdDT01fARt//yB0I9FA0EjHOnxTTEVI+qa6
         VOHHy4XGAr1qQ7NRwAHWbvcsxWN2xBHu7Ehr0cFsHb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XWTvEjjeA3jDifTfL1eP8h/GKoLF5isrp8mgywkg61u8h0F7V6ydBDqhVD
	/eyXrVl7yPIUmrO3wSg==
X-Received: by 2002:a05:7301:4242:b0:358:dfed:d0fe with SMTP id 5a478bee46e88-36a42219d4fmr21775375eec.5.1793769912239;
        Tue, 03 Nov 2026 21:25:12 -0800 (PST)
X-Received: from cantal.lan ([58.136.77.237])
        by smtp.gmail.com with ESMTPSA id 5a478bee46e88-36ca39c5f0csm3405176eec.29.2026.11.03.21.25.06
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Tue, 03 Nov 2026 21:25:10 -0800 (PST)
X-Cc: Maxime Chevallier <maxime.chevallier@bootlin.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Richard Cochran <richardcochran@gmail.com>,
	Jacob Keller <jacob.e.keller@intel.com>,
	Kory Maincent <kory.maincent@bootlin.com>,
	netdev@vger.kernel.org,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
X-Mailer: git-send-email 2.56.0
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list