Article View: linux.kernel.netdev
Article #21510[PATCH net v5 0/8] ptp: fix request serialization, teardown and SMA reporting
From: Ahmad Byagowi
Date: Tue, 24 Nov 2026 04:42
Date: Tue, 24 Nov 2026 04:42
79 lines
15007 bytes
15007 bytes
This series fixes PTP request serialization and timestamp shutdown, and corrects OCP SMA/DPLL reporting. It is based on net at 4392bb809812. It contains no WiWi board support or LED driver changes. The first two patches address prerequisites identified in v4 review: serialize all three sysfs enable callbacks with the ioctl paths, and prevent SJA1105 EXTTS disable from switching its shared pin to input. Patch 3 preserves Vadim's requested teardown design: after removing the user interfaces, send direct disable requests for each advertised EXTTS channel, followed by PPS. Do not use a pin-function helper for channel indices, alter pin assignments, or add a driver stopping flag or spinlock. The remaining patches handle hardware selector values and combined input routes, recover disabled SMA state on bind, report disabled inputs as zero Hz, and correct the DCF77 and ART 10 MHz frequencies. Rebind recovery is now separate from DPLL reporting, with the earlier b2c4f0ac53f3 Fixes tag, so kernels without DPLL support can receive that correction. Changes since v4: - New patch 1 takes pincfg_mux in extts_enable, pps_enable and period. All callback errors and existing permission checks are preserved. - New patch 2 changes the SJA1105 pin function only on EXTTS enable. - Patch 3 has unchanged code. Its message no longer presents the runtime sysfs/ioctl race as remaining after patch 1. It explains why an empty software subscription map is not proof of initially idle hardware. - Old patch 3 becomes patches 5 and 6, with separate Fixes tags. Correct the incremental ADVA X1 description: patch 4 already makes its zero input selector return zero Hz rather than -EINVAL. - Patches 4, 7 and 8 retain their v4 code and messages. Preserve Vadim's Reviewed-by on the unchanged DCF correction only. Validation of this revision: - Reproduced v4's shared-PPS runtime race and SJA1105 pin side effect with actual extracted functions, controlled scheduling and stubbed hardware. - 100 removal/shared-PPS model runs; 100 runtime serialization runs, each with four controlled interleavings; 100 SJA1105 runs, each with 14 chip/direction cases. All passed under ASan/UBSan. - Eight local KUnit cases passed in x86_64 QEMU with KASAN, lockdep and DEBUG_ATOMIC_SLEEP. These exercise real PTP register/unregister and real sysfs stores with a test clock, not physical OCP/SJA1105 hardware. - x86_64 and i386 allmodconfig and allyesconfig builds passed for the PTP subtree and SJA1105 PTP object with W=1 and KCFLAGS=-Werror. - SMA/DPLL tests cover 4,669 input combinations, 243 retained-mux rebind states, ART accessors, disabled-input re-enable and X1 direction change. - Twenty deliberately broken variants were rejected by runtime assertions. The review fixtures are local validation material, not new upstream test interfaces. No physical card or switch was tested for this revision. The reports came from the public review thread. Codex assisted with the code, regression tests and submission text; the commit messages identify the reports and distinguish modeled tests from hardware observations. Previous revision: https://lore.kernel.org/r/20261122-timecard-common-v4-e0db4ab1aa-0-ahmadexp@gmail.com Latest review reports: https://lore.kernel.org/r/179548551283.3135.17206659598806657887@kernel.org https://lore.kernel.org/r/179548551472.3135.11972018356692852897@kernel.org Ahmad Byagowi (8): ptp: serialize sysfs requests with the ioctl paths net: dsa: sja1105: leave the pin function unchanged on EXTTS disable ptp: disable all timestamp channels after removing the user interfaces ptp: ocp: handle hardware selectors and combined DPLL input routes ptp: ocp: recover disabled SMA inputs when binding the driver ptp: ocp: report zero frequency for disabled SMA inputs ptp: ocp: correct the DCF output frequency ptp: ocp: correct the ART 10 MHz input frequency drivers/net/dsa/sja1105/sja1105_ptp.c | 8 ++-- drivers/ptp/ptp_chardev.c | 14 ++++--- drivers/ptp/ptp_ocp.c | 58 ++++++++++++++++++--------- drivers/ptp/ptp_sysfs.c | 9 +++++ 4 files changed, 62 insertions(+), 27 deletions(-) base-commit: 4392bb809812ac79449cd0cf1f5e00469ee102d1
Technical Details
Message-ID:
<20261123-timecard-common-v5-d669cfa034-0-ahmadexp@gmail.com>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369999-linux-kernel-netdev=dewy.ruShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369999-linux-kernel-netdev=dewy.ru
From: ahmadexp@gmail.com (Ahmad Byagowi)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net v5 0/8] ptp: fix request serialization, teardown and SMA reporting
Date: Mon, 23 Nov 2026 20:42:33 -0800
Organization: Usenet Network
Message-ID: <20261123-timecard-common-v5-d669cfa034-0-ahmadexp@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="4052651"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:zNVAur/lpaAzJKwHsIhiUyKH/CI= sha256:yAEJEAeNhOTtSvlGLoQIjr2WHx9cfwuuICm+JRKVUBM=
sha1:cI+g3nazCXGZebFEy6Ayu/bwL+I= sha256:CvXqi8wF3a0oxI9n/+eShb+7eyV6kwJ7wJfVUvGmReo=
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 C263A125DD1; Tue, 24 Nov 2026 07:43:01 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.049
X-Spam-Status: No, score=-3.049 tagged_above=-9999 required=6.31
tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
FREEMAIL_FROM=0.001, 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] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
header.d=gmail.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 Ck5r56zzwDOa;
Tue, 24 Nov 2026 07:42:57 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-369999-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
by mail.dewy.ru (Postfix) with ESMTPS id 6828B125DCD; Tue, 24 Nov 2026 07:42:46 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by tor.lore.kernel.org (Postfix) with ESMTP id B904933033; Tue, 24 Nov 2026 04:42:41 +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=1795495358;
b=dFitq2sK06cfXUZ4ZveqJzj5niqXDwYDqZ23r6P0cV9Behmv7+TISx2nDgU5MVmgGxaT
xfVAMfnySgVLZaQbrUOfN2phGV2Vxc6XulMUcuUs1dHKPQf4/47q4w3deZ18pEeuL8FnK
XNMFiY7bamfeoeP+9xPuVpm1SbqAydUJNgnganuYF8aQWfjzaqah95N9NbKTXUgusjS3t
EroltoAvjsgJO/qP+yCmVtAK/5ALUTSbBzCEA4YUUcUqUj1Wci/tgtv8B2dNyygrV/DIF
QYzepbMqOhGTiqEanqFuBP1jJGuWOGeIFIQLidI9Q3/MICmDoHjwlEOdgBTLJT+xqlQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795495358;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
Received:From:To:Cc:Subject:Date:Message-ID:X-Mailing-List:List-Id:
List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
Precedence:MIME-Version:Content-Transfer-Encoding;
bh=IgI0m4pAxHEcjSpExF12okiRR9Quf+zHia2X8idMp2Q=;
b=aOjxZdt76h5GQ/JAc+679mdXo96jScnt2vYdkIid3pI03BZ43gNUKEFKxJH+13nbI4/w
znR7+pzzJd+8PKDvN1qezGvGDDHbP6bIUPPBBDouO3RZtdYps8COBkXV2jHyskEZQNWLy
R2/b3CQcj/zDbTlZh01LuwVyu7Xe+GgM+vbzlGpZyCvyp7namBEuwRDwFWyzFJeUt8a8o
+7QzBZ/4LupGvFmQ6+dqsKnXj0L4kz1iiRScLJWdLxj9KcsroezPCGSFBmorF05pZbPtn
gGI14esA5Q0a0/aRUhpLsnkITQTB2OKnI5BWvsBD6bNZxg4UDLNXDNce1F45Fzq5xhQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=C5jhZZ7R;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.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 334D3606A688;
Tue, 24 Nov 2026 04:42:38 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=C5jhZZ7R
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.45
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1795495357;
b=rqZ9F3axfFqAn19CEQbNNS/10P2ppiCTNmnr11yUYdEAttDCGCjwjDYbIdkM7qXOrkqv
QO74SDa+Cir1s1DmmoGJIF95T5ElYktMhrXtwLexw/TuGQmrwbHJ79Iv18HJWmechS0hk
DuneVRs1qhe89IWTC2csqfdavoEQb7l65dbEGA9LdaQTpOB+Gom4FoQgK2oYkd+u49DE7
1dzdRd4KtW4Wy4+F4wtwkBEq3ImktMMF1ZgIsWdOCEp+YkzmEGGneYod4aCl/0/dbm7mx
JmymYyIpWMBn2NFRXD1GMsBIkQq6GrNcXCTFMC04h9dYylDnIqo+yTwy6m4IsQ0HweQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795495357;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject:
Date:Message-ID:MIME-Version:Content-Transfer-Encoding;
bh=IgI0m4pAxHEcjSpExF12okiRR9Quf+zHia2X8idMp2Q=;
b=F1khple7rvQjrkRweeirWOLIPo42G/yjWYmKs8ovufhB0O/q0GIksb47YlVCkfjoZDsd
XKSdXOubFnA9gKKsafNo6p8xB/2W4TBliT6GvoNIKZ49ygivQ9VM1pM46elww4lEFoZ3g
T2UpVnULNxAf05rWCOMt9fL/P+u58zyKKab4GYODrI//xGik96ENnBTMmLKyqBn+LJ7Lx
cAbShj5a/yq/jGVZDp41qyVOFWTBMFy3x/R3ZSQtpHKUvMhh4qRrsbYYTDdzjA2NNIwOj
fYnui7ZtXVS2Zqqk3U3wrweLKWUdDxhnz2CsrU1+0fOeI3CPrAl9eBiydh1yq18tD/A==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=C5jhZZ7R;
arc=none smtp.remote-ip=74.125.82.45
X-Received: from mail-dl1-f45.google.com (mail-dl1-f45.google.com [74.125.82.45])
(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 F1AF2606A33A
for <netdev@vger.kernel.org>; Tue, 24 Nov 2026 04:42:36 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org F1AF2606A33A
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-dl1-f45.google.com with SMTP id a92af1059eb24-1a2af4c8d00so861242c88.0
for <netdev@vger.kernel.org>; Mon, 23 Nov 2026 20:42:36 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20260707; t=1795495356; x=1796100156; 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=IgI0m4pAxHEcjSpExF12okiRR9Quf+zHia2X8idMp2Q=;
b=C5jhZZ7RORotJuBdPyW8ypLkIqh6ota24QYMFEFFsWhWNjO5w9jCxRqwhWUfJEEo2h
GwRLuAAP2P7w4L1bPTWCXQSoJBoNxGtlXJ4nn5TQYMshckH53ZyvSdE5GZmKk0MOClp+
fOzThMGkog0ECS3rgjhN2iXxZ0HjiJZC32sE5hWOZpo737hKxrLkEtsi2CMFUyI1MaHT
/jwv5RAZ9v0QX4tKfHOectCVWJXgFrNz0dgdpFErPE5sLZctGbrbX2ysFBdnT95+uhJ/
ZAkWfrWm4IVfbON6lwepCctBGR2uh1k8yTzgrPGZZwNUaWswlQu49uY0/9TUQAwYsn9r
Ih8g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1795495356; x=1796100156;
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=IgI0m4p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cNRRoxUJf9R+lkueXC8ozy+AoZ2S1Uj/LGJNRKBvSkAfks7L
X3ZU7h7cfxWeQac5aVeygtV38Vyu/mwAfzBdEYpUnQ7OTAMLWJPiXWIGu8GLXZ8GJ3h7PCKPJ8A
IGFFdy3qzAfv7HnUOA0dLTDQKQ21AWsFyEJRmsxnJZeaody/+yi+cktvS6yTEWJOqnYtc8K4g
X-Received: by 2002:a05:701b:260e:b0:1a9:c52f:655c with SMTP id a92af1059eb24-1b556900476mr15545901c88.36.1795495356004;
Mon, 23 Nov 2026 20:42:36 -0800 (PST)
X-Received: from Mac.localdomain (198-27-228-154.fiber.dynamic.sonic.net. [198.27.228.154])
by smtp.gmail.com with ESMTPSA id a92af1059eb24-1b556829d31sm52424647c88.9.2026.11.23.20.42.34
(version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256);
Mon, 23 Nov 2026 20:42:35 -0800 (PST)
X-Cc: andrew@lunn.ch,
arkadiusz.kubalewski@intel.com,
arnd@arndb.de,
davem@davemloft.net,
edumazet@kernel.org,
jiri@resnulli.us,
john.stultz@linaro.org,
jonathan.lemon@gmail.com,
kuba@kernel.org,
linux-kernel@vger.kernel.org,
olteanv@gmail.com,
pabeni@redhat.com,
richardcochran@gmail.com,
rmk+kernel@armlinux.org.uk,
vadim.fedorenko@linux.dev
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