🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #20649

Re: [PATCH net 3/4] ptp: ocp: report disabled SMA inputs consistently over DPLL

#20649
From: Ahmad Byagowi
Date: Mon, 23 Nov 2026 01:57
64 lines
14340 bytes
On Sun, 22 Nov 2026 at 20:41:09 +0000, netdev-bot+sashiko@kernel.org wrote:
> Can this check give the wrong answer after the driver is unbound and
> rebound, or after a module reload? sma->disabled exists only in software,
> and ptp_ocp_sma_store_val() is the only code that sets it. The FPGA keeps
> the mux values that the previous driver instance wrote.
>
> ptp_ocp_sma_fb_init() reads the mux registers only to work out the
> direction. It never sets sma->disabled:

Yes. I reproduced the stale software state using retained mux values and
a fresh driver instance. The v4 patch initializes disabled state
from the enable bits for direction-configurable FB-style connectors.
The existing direction selection picks an enabled side if either side
is enabled. If that selected side is also disabled, both buffers are
off, and the connector is represented as IN: None. The hardware does not
retain the previous direction in that disconnected state.

Initialization does not write the mux. Fixed-direction firmware, which
does not provide these enable bits, keeps its existing interpretation.
The ART initialization path is also unchanged.

> Would it help to set sma->disabled in ptp_ocp_sma_fb_init() from the
> enable bits, or to test SMA_ENABLE before masking?
>
> All of this assumes the FPGA treats mux 0 without SMA_ENABLE as disabled
> rather than as the 10 MHz selection, which I could not confirm.

The public SMA-selector RTL assigns bit 15 to the input/output enable
signals. The production top level uses those signals to control the
external input/output buffer enables. Thus a zero selector without its
enable bit does not enable the external 10 MHz input buffer.

Pinned sources:
https://github.com/Time-Appliances-Project/Time-Card/blob/1042bd6f9ddb1844c8b471efbf560c96c8e6cecc/FPGA/Open-Source/Ips/SmaSelector/SmaSelector.vhd#L293-L301
https://github.com/Time-Appliances-Project/Time-Card/blob/1042bd6f9ddb1844c8b471efbf560c96c8e6cecc/FPGA/Open-Source/Implementation/Xilinx/TimeCard_Production/Top/TimeCardTop.vhd#L473-L481

The software tests cover 243 configurations across FB/ADVA/ADVA X1 and
all four connectors, including enabled inputs, outputs and disconnected
states. They assert zero initialization writes and unchanged mux data,
then exercise re-enabling through the actual DPLL core get-before-set
function. The previous implementation fails the rebind assertion. This
is source/RTL validation, not a physical-card rebind test.

> This patch fixes that as well, because SMA_DISABLE matches the x1 "None"
> entry. Should the changelog mention this case for stable backporters?

Yes. The changelog now explains that ADVA X1 has no zero selector, so
the original disabled-input failure also blocked DPLL reads and later
frequency changes, rather than merely reporting a false 10 MHz.

> Could the paragraph be cut down to the testing that applies to this
> patch? Someone backporting only this commit could otherwise think it
> covers those other defects too.

Agreed. I removed the repeated cross-patch testing claims, kept the
commit explanation specific to disabled inputs, and placed this patch's
test details below the separator. Since initialization behavior changed,
I have not carried forward the earlier Reviewed-by for this patch.

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
Technical Details
Message-ID: <20261122-timecard-common-v4-e0db4ab1aa-r3-ahmadexp@gmail.com>
Path: mbox-mo1.pugleaf.net!news-sfo.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-368952-linux-kernel-netdev=dewy.ru
References: <20261118-timecard-common-301f823ddd-3-ahmadexp@gmail.com> <179538006912.3135.16971430532149423594@kernel.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-sfo.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-368952-linux-kernel-netdev=dewy.ru
From: ahmadexp@gmail.com (Ahmad Byagowi)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net 3/4] ptp: ocp: report disabled SMA inputs consistently over DPLL
Date: Sun, 22 Nov 2026 17:57:59 -0800
Organization: Usenet Network
Message-ID: <20261122-timecard-common-v4-e0db4ab1aa-r3-ahmadexp@gmail.com>
References: <20261118-timecard-common-301f823ddd-3-ahmadexp@gmail.com> <179538006912.3135.16971430532149423594@kernel.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="3767116"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:RUUDBxgz/221L/s4mixF4Llgg+E= sha256:7saMpQu9s1RbQU/7kaR9BP8Tobbo99VmyzhjWkEp3Z8=
	sha1:gpyY7XNUapsiwP3qzT79g/DloL8= sha256:O0Rprk9PYWqIO1IfjgTaqhDyXNskYubq2rsjZg64Apo=
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 4B155125D8B; Mon, 23 Nov 2026 04:58:18 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.149
X-Spam-Status: No, score=-3.149 tagged_above=-9999 required=6.31
	tests=[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 9_gNGlUDYEwO;
	Mon, 23 Nov 2026 04:58:15 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-368952-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 sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id E4215125D83; Mon, 23 Nov 2026 04:58:06 +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 27AF56022C7; Mon, 23 Nov 2026 01:58:04 +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=1795399083;
	b=y5cH+nbNA4Fg84gzp1L1O29lyO3vSkiQNWm56S67+GFGo4UJZJp6iFkSXm5rM3htHojU
	 CGC+uwvTuc1L8wYqhdPd2smdlJInFtwV2DwF8uPJ5lBiqTNvjS6EbRO7NHeIGm6msxYbv
	 7EXIlpGqg19Kql2zXKAjR0vy6aI9j+aEu5DQbBKwHnhIVHbY8faihqo382PhgAdnS6pSa
	 4D1OoriJNLwxzUV4F5m/MAyvN111Gq+LHJThAmlRAKDYt92uXmbRGPoZkCEWwcqsCfCtq
	 WpsxvgCSw8PFZrWLe62Bg0Wod30vjpOTn2Ys6y6pKwAs4zBtqYZ1wJpcPfZW3vqgXLQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795399083;
	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=Ia/LiFOfvdAhK1CwZCpleLXreqssEtbUn/IkgtXbeoE=;
	b=ChVFVbLGZAp5BPXCvE5Ud4xI4fYtkQqPgM7CXk7IwBBpX4bpsMGUPzSAeejSAdg7rVUx
	 03hi8rawkLX4UYr0GsxFOaQ/rA+RCctpEb2Vk6Sy0a3wDpN/8Wr2J96f0v2YcHZ04UyoB
	 RUvxhlmuNRyiaSEb4Pu/9hZ7ViXc8M5Q4NCSE9Y8xpwpp8AzY1DymVmH27YYPLHUE9E5g
	 COIvBGSSHy16wGTz7q8jGzemf9dsA4B5zLdOom96BSXFRj6NQD7bzcGcwpb0Elwe3zdnb
	 +pZwkFyjy4YqMRgwbhzOhwqnKfdUfuYWfvQILEIgF0s0JjK2jZ3MbjmsqtH0WLa5N5A==
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=d+baH6Ps;
	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 9C218606A32D;
	Mon, 23 Nov 2026 01:58:03 +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=d+baH6Ps
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.48
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1795399082;
	b=el11r41UXaIEM8r8HJZl2RyqOOMOrcVOATRkKQiNcmmGM2sR30hnKkWxTjHIsQAeRmTd
	 ESgqUXjm/iVyLWn4mwYpDNqa4bKbUlXsRayMcnqpvTrPJnN5bAuGpczIu6rDCcWAuyeaG
	 NUh63dzsfqx09MVNp6s1u2AvaOlLLhTYnH8h2lk3VbDurcX7x893/ATj6wlXvoTpKK/k/
	 Y6nixqIKEaEvln52F82vkIvm5zlFEo0LBpB7khILyj1ufouGeM3MBA+3w6vH6NLdHkcPP
	 X1o03bkOnCsO4WlXl0cooJdru8Oeqcz0ugLV6t68eFMxbnJoro08Sd186gXQxDduodg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795399082;
	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=Ia/LiFOfvdAhK1CwZCpleLXreqssEtbUn/IkgtXbeoE=;
	b=uzFOGMViRIKFX58yyzR5boEy3KeZgjjZZ2R20t6gv9qOaEDcuJ16PG508LDt8Ni0lGUX
	 73q44QeujJHGHR+B/zWRxszjCbaMEInAWt75GOh8BHu4OE+YNNpYGl3sMLBt5oSgen+TI
	 fWjDCgK4jAQE4oe/SeTVZQRGpPAdbrXUSmrBFDyg3vwEwTocKUpJM4o4MkBf/MT9RC+N+
	 wGGIU8hDKgfOIymS8gf8PTLFcZKy77+bM6PKZqad3GTl8BUIgAP2617GWHCiwL481WD3s
	 BPNEc855UlC0w7AKdO52jL6OLBB16umOB0fY1SgGoQoLjZ+vBqrQdSgFry0sz0GKPJw==
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=d+baH6Ps;
	arc=none smtp.remote-ip=74.125.82.48
X-Received: from mail-dl1-f48.google.com (mail-dl1-f48.google.com [74.125.82.48])
	(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 71EA0606A333
	for <netdev@vger.kernel.org>; Mon, 23 Nov 2026 01:58:02 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 71EA0606A333
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-f48.google.com with SMTP id a92af1059eb24-1b546061d58so6329812c88.1
        for <netdev@vger.kernel.org>; Sun, 22 Nov 2026 17:58:02 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20260707; t=1795399081; x=1796003881; 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=Ia/LiFOfvdAhK1CwZCpleLXreqssEtbUn/IkgtXbeoE=;
        b=d+baH6PsXGkuzvWZh9Rqo2B0UstJXaqmSiDJQkpSS3mREGXoc/r1FnaVHROqVCfKqL
         884xWUpBNe1Ssr1pmfoIVyQjM+Pbd3hv/y41GosFfmYUE8qeQSFVYLgKDrYGiVDyD50A
         1JbpRm+NeTws+VpRavbRkpdmxDbi1uJNSEaNdNw71VE938DFbvFy9HGANXSKbFzRiL0i
         PITo1dvXs3QpGyNingx+2R3TgVbnraX82KRCRPsrXmnOwLFObnCg+CLrTqG3KjC7exHH
         m3PM+MRJJPbIwX9KiLeGuhZTgz5UHGoel099fhDvrQJVlUtIKnBiJRAvPgLUglzA9Ehw
         lvFA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1795399081; x=1796003881;
        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=Ia/LiFOfvdAhK1CwZCpleLXreqssEtbUn/IkgtXbeoE=;
        b=WTRBPPcogpK0Rvisc86JBedR5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J7nx5tRFgyY
	PI2ha4fLNiAh5m2DtGeRbgz6VjZwZILbjV2jbFMyQRI7LGfgbQnnoWjun1Hsmn8k/Y3BBlgsbo9
	Y8eAKmgB8HmHWonOjPw4H2ZX47ZCkqRom8AbdhkLCPUcOP5WGdyJyKus87rzfZN8j6eo9cIbM
X-Received: by 2002:a05:7022:4181:b0:1b0:4272:4282 with SMTP id a92af1059eb24-1b5568ba440mr17131127c88.17.1795399081588;
        Sun, 22 Nov 2026 17:58:01 -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-1b55682d301sm23843898c88.10.2026.11.22.17.58.00
        (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256);
        Sun, 22 Nov 2026 17:58:01 -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: <179538006912.3135.16971430532149423594@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