🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #20648

Re: [PATCH net 2/4] ptp: ocp: use hardware selectors in DPLL frequency operations

#20648
From: Ahmad Byagowi
Date: Mon, 23 Nov 2026 01:57
65 lines
13801 bytes
On Sun, 22 Nov 2026 at 20:41:07 +0000, netdev-bot+sashiko@kernel.org wrote:
> Does this still return -EINVAL for an enabled input that has more than
> one destination?
>
> The commit message says that without the mask "an enabled,
> direction-configurable pin has no matching table entry and its DPLL get
> or dump fails". The sysfs ABI allows several input destinations, and
> sma_parse_inputs() ORs them into one selector:
>
> sma_parse_inputs() {
> 	...
> 	ret |= ptp_ocp_select_val_from_name(tbl[dir], argv[idx]);
>
> For example, writing "IN: TS1 TS2" to smaN gives 0x000C. After
> ptp_ocp_sma_store_val() adds SMA_ENABLE, 0x800C is written to the GPIO
> map.

Yes. I reproduced the error against the previous candidate. Masking the
enable bit alone did not fix combined destinations, and the DPLL core's
get-before-set path could still prevent recovery.

The v4 getter handles input combinations after the exact-match
lookup. Frequency-bearing destinations must agree to produce a known
frequency. Timestamp/counter destinations do not constrain it. A route
with no known frequency, conflicting frequencies or unknown bits returns
zero, as an individual timestamp route already does. This is a routing
interpretation, not a measurement of the input signal. Output selectors
still require an exact match.

The source-derived tests cover 4,669 masks across FB, ADVA and ADVA X1,
including TS1|TS2, timestamp-plus-PPS, conflicting destinations and
unknown bits. Recovery exercises the actual DPLL core get-before-set
function. The previous getter and a variant that chooses the first
conflicting frequency both fail runtime assertions.

> The commit message says passing the index can "fail on ART". Can a
> 10 MHz request on an ART input reach this line?
>
> The ART input table lists the 10Mhz entry at 1 MHz:
>
> static const struct ocp_selector ptp_ocp_art_sma_in[] = {
> 	...
> 	{ .name = "10Mhz",	.value = 0x0008,  .frequency = 1000000 },
>
> ART pins advertise ptp_ocp_sma_freq (1PPS, 10MHz, IRIG-B, DCF77). So
> dpll_pin_freq_set() accepts 10000000 and rejects 1000000.

Agreed. The selector fix was necessary but did not fix that separate
table error. I removed the misleading implication from patch 2 and
added a separate patch 5 changing the ART input frequency to 10000000.
The tests use the actual ART init/set/get functions and DPLL core
validation: 10000000 succeeds, 1000000 is rejected, and the fixed 0x08
default reads as 10000000. The old source fails those assertions.

Both issues are addressed in the v4 draft. Patch 2's expanded
behavior needs fresh review, so its earlier Reviewed-by is not retained.
All testing here is software-only with stubbed hardware operations.

The five-patch v4 series is posted separately to net:
https://lore.kernel.org/r/20261122-timecard-common-v4-e0db4ab1aa-0-ahmadexp@gmail.com

Ahmad

pw-bot: cr
Technical Details
Message-ID: <20261122-timecard-common-v4-e0db4ab1aa-r2-ahmadexp@gmail.com>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-368951-linux-kernel-netdev=dewy.ru
References: <20261118-timecard-common-301f823ddd-2-ahmadexp@gmail.com> <179538006772.3135.15875996486888374193@kernel.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-368951-linux-kernel-netdev=dewy.ru
From: ahmadexp@gmail.com (Ahmad Byagowi)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net 2/4] ptp: ocp: use hardware selectors in DPLL frequency operations
Date: Sun, 22 Nov 2026 17:57:55 -0800
Organization: Usenet Network
Message-ID: <20261122-timecard-common-v4-e0db4ab1aa-r2-ahmadexp@gmail.com>
References: <20261118-timecard-common-301f823ddd-2-ahmadexp@gmail.com> <179538006772.3135.15875996486888374193@kernel.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="3767067"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:xibozBwY72Th1/ahZhjdAToaF6c= sha256:yz05tGHBN5QIV0j/7cUdJayaOmIL91sUzNB7KORKT4c=
	sha1:tJUyrJRUrZ9uxAmdLfSIakUzzCI= sha256:dzwBXwNUuJcbDrjc62QI8zX9FUqG/PtbKvqeOCdVDRY=
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 658B5125D8B; Mon, 23 Nov 2026 04:58:16 +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 W_Ryri9G5CMn;
	Mon, 23 Nov 2026 04:58:12 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-368951-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 9DF9D125D89; Mon, 23 Nov 2026 04:58:03 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id ECDF82C239; Mon, 23 Nov 2026 01:58:00 +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=1795399080;
	b=Bbs79GaR1W1nEBvtQYy3R4Sco/HE1SHKch9aqqW617kpr+oMYPzGmDsPnWjqFHAtpM0G
	 6MIu/x7qeo4QaMKMZnueMOAMlFyU2yHAUjqoyHXJS4OfHjF+I9X5aSAPqZqiO73LItBH2
	 RknabWXfWTfB/J00nA/bIdCP2DgJpDj6DCWF/Ij10RjxnnOX3lt88p9jv+AcdbJVnnlI2
	 1rmuLIIz+aHO/5/evtHv1OdWwPhs+yZhGxehl3BHAyY9IcyV9XI+GVeWuojcQnMumozfy
	 3gRwrLQ31LUj2Pmhxx32dKyPlbMaIPAdRC0gAGV5BklGBOzSfzK/YDQHSRvGvLsulqQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795399080;
	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:In-Reply-To:References:
	 X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 Content-Transfer-Encoding;
	bh=ezHR48+9BwZ0n/i0dqiHwyr6GStnzWguX/xPKSwudYA=;
	b=b4oljT79SgSqTKt3s8nszWPS2e5CU+bZdplp6FQCI1NyS2tVbcrg4rlvCDPti+Z1h/ef
	 sn3Z8XurrmGcslbV3vcVYxsYw+60+LH0DthlCKkA/bAlA+9LxcNKF23oGVWo4HKKzUvnz
	 NhAMBVlNxhNHYKp2Y6IztG3uOdNGHA6n7RXKExWidvrGBAc3BSzUkzOzK6TpDTVh1AOq/
	 amHTze/S00nqpnE2HqE4DBIy6y5jdQ8SHq9vAAHxfnQNBLqoiNOTwuLXPc1NuLypsbg7M
	 vGYwWk9obQSUAUsMfJuHtuSraHlgfjGGlzsIFfHsle8UiIIM3apAR+lg4xKuFG5IieA==
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=qVXLSQMA;
	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 8DA28606A336;
	Mon, 23 Nov 2026 01:58:00 +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=qVXLSQMA
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=1795399079;
	b=sXnibaizIrvFwACrlmEAAR8bc0yDvrZxZODdfuOSE1zbOv6FYKiTWB6vg7D8NsHI9tK+
	 iS2TM4f6flyKoprX2X70nKb2CmHFTyb1CfjBCdOuN6jlHBZigB1YwQu+qTOzHLUkpm8MR
	 hZxyFPhUtM5YNbriWqRQ62hRHoq1683WD/4vawczSSbSRu+dX7aMmNlkU+tWzbPkriyBR
	 jI0QlilldS/Rx6vtjIruF8O4ZOkbmfzlpRPagqfEV3tb/n+8RMw0wLzm0VI2sOTYNn7OH
	 ALiPo0fYXfoMUB/DGL1wa4s0Xi0vWcjnZLNtUy0xgICoxFJ5sLpf5Mbg1Ge2yLQIMug==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795399079;
	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:In-Reply-To:References:MIME-Version:
	 Content-Transfer-Encoding;
	bh=ezHR48+9BwZ0n/i0dqiHwyr6GStnzWguX/xPKSwudYA=;
	b=X35RqjG8d4WEZYQOnh+l+LwZyU2I20v+oBWbHdlVvbpm+7FU2ql6A1nPepjY1W2+Vj3C
	 4wN9aGYgBYvZlv81I8avKEMpFkuOw/iuloN/VeaQe6M0p/ycnEo35GmNfucPo63mIde9e
	 55p5SRY/fMSMEVYlGbyIFjgHpnyFpVg9v0yHKfAKH4dVteM5DEgo5Nz0/Int97qHV0IAf
	 ZiI8F19JcZd6pJGhlMqvtIljUTB1IeiDGjd7KtyTzB0nD0O+a/rFvvFn4eLY/Uy6jWYZR
	 uIdFdgboiTPO94T2uAuW9Yg7iJZh5Y7pRG47VlDg7JvYfKCVhFqY2F0SVKTMf8/Z84w==
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=qVXLSQMA;
	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 66B6A606A31A
	for <netdev@vger.kernel.org>; Mon, 23 Nov 2026 01:57:59 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 66B6A606A31A
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-dy1-f179.google.com with SMTP id 5a478bee46e88-38587f3de36so3372330eec.0
        for <netdev@vger.kernel.org>; Sun, 22 Nov 2026 17:57:59 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20260707; t=1795399078; x=1796003878; darn=vger.kernel.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=ezHR48+9BwZ0n/i0dqiHwyr6GStnzWguX/xPKSwudYA=;
        b=qVXLSQMAZQUdwvLsyxyO5e4h0NaeBfaIJgmL4jY/s5YBmmgDPwPOia5qZV0daN0lLs
         UbNCMhZTJYzpxeZHvPtoOHBwftQqVCELbRhhUoYpzVf8aFFqJ4pR1dWFRppvhgxmYPob
         nLdyQPCf5di6lhai/0GMz3baxRyqz4UXzszm+ZAiKhkD6frX8vzF3y6Ki2iTvNFrhRSF
         z7w7dNfXtLhDpMRVIVVVWYDAvpq2aVbm9a++yicZxg//QiDCaJXyWwZcIkIipj29Ttim
         lhCjiLFBUJd1paCUlTNF3wXyoznMCCjw4K8HKMdqKzQ1WusB6SOc3ZsBqrc2GduH6HbG
         a0Fw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1795399078; x=1796003878;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :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=ezHR48+9BwZ0n/i0dqiHwyr6GStnzWguX/xPKSwudYA=;
        b=idaOtR5DW2riRpJbPLygFfnK77ESI9NKqdgDBumgLPy6IwnL/O4Mw0mX1I/+knQG/r
         98Tt1IqnHHyQMYbaJ+wMsMxKu/pGbQnLpY51nJX3E2kLG+aMEo0kcMFl0hd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qxd8PiPMC5rXVex0qARu9sjkYAjHpwKD2ZHKkmaAnMz
X-Received: by 2002:a05:693c:60cd:b0:386:98d9:d5cd with SMTP id 5a478bee46e88-38698d9d928mr8331670eec.39.1795399078400;
        Sun, 22 Nov 2026 17:57:58 -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 5a478bee46e88-38567abb870sm25649607eec.25.2026.11.22.17.57.57
        (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256);
        Sun, 22 Nov 2026 17:57:57 -0800 (PST)
X-Cc: netdev@vger.kernel.org,
	vadim.fedorenko@linux.dev,
	richardcochran@gmail.com,
	andrew+netdev@lunn.ch,
	arkadiusz.kubalewski@intel.com,
	davem@davemloft.net,
	edumazet@kernel.org,
	jiri@resnulli.us,
	kuba@kernel.org,
	linux-kernel@vger.kernel.org,
	pabeni@redhat.com
X-In-Reply-To: <179538006772.3135.15875996486888374193@kernel.org>
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