๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #21465

Re: [PATCH net v4 3/5] ptp: ocp: preserve disabled SMA inputs across driver rebind

#21465
From: netdev-bot+sashiko
Date: Tue, 24 Nov 2026 01:58
97 lines
11772 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] The commit message describes an ADVA X1 failure that no longer
  exists in the tree this patch applies to.
- [Low] The Fixes: tag is incomplete.

--

ptp: ocp: preserve disabled SMA inputs across driver rebind

This patch makes ptp_ocp_dpll_frequency_get() substitute SMA_DISABLE for
disabled inputs, so the None entry reports zero Hz. It also recovers the
disabled flag from the mux enable bits in ptp_ocp_sma_fb_init() for
direction-configurable connectors, so a disabled input stays disabled
across a driver rebind.

Link: https://lore.kernel.org/r/179502617840.3136.12704245716223038161@kernel.org
Link: https://lore.kernel.org/r/179538006912.3135.16971430532149423594@kernel.org

> Disabling an SMA input clears its mux field. Zero is also the selector
> for 10 MHz on FB and ADVA, so a DPLL read reports 10 MHz while sysfs
> reports None. The DPLL core then skips a 10 MHz request as unchanged,
> leaving the input disabled. ADVA X1 has no zero selector; its disabled
> input instead fails the frequency lookup, blocking DPLL reads and later
> frequency changes.

[Severity: Low]
Does the ADVA X1 part of this description still hold for the tree this
patch applies to?

The previous patch in this series, "ptp: ocp: handle hardware selectors
and combined DPLL input routes", changed ptp_ocp_dpll_frequency_get().
An input that fails the exact match now falls through to the
combined-destination loop instead of returning -EINVAL:

drivers/ptp/ptp_ocp.c:ptp_ocp_dpll_frequency_get() {
    ...
	if (sma->mode == SMA_MODE_OUT)
		return -EINVAL;

	/* Inputs can feed several destinations, including timestampers. */
	*frequency = 0;
	for (i = 0; tbl[i].name; i++) {
		if (!(val & tbl[i].value))
			continue;
    ...
	return 0;
}

For a disabled ADVA X1 input, ptp_ocp_sma_store_val() has written 0 to
the mux, so val == 0. No entry in ptp_ocp_adva_x1_sma_in has value 0, so
the exact match fails. The loop then matches no bits, and the function
returns 0 with *frequency = 0. So the DPLL read succeeds, and
dpll_pin_freq_set() is not blocked.

With this patch, val = SMA_DISABLE matches the None entry, which gives
the same 0 Hz result. On ADVA X1, the new frequency_get hunk does not
appear to change anything visible. Only the rebind recovery in
ptp_ocp_sma_fb_init() has an effect there, since ocp_adva_x1_sma_op also
uses ptp_ocp_sma_fb_init.

The description matches the original 09eeb3aecc6c code. Could the
changelog say what this patch changes on top of the previous patch in
the series?

> Fixes: 09eeb3aecc6c ("ptp_ocp: implement DPLL ops")

[Severity: Low]
Should this also have a Fixes: tag for b2c4f0ac53f3 ("ptp: ocp: Add
ability to disable input selectors.")?

The init-time recovery in ptp_ocp_sma_fb_init() fixes a lost disabled
state that goes back to that commit. It added the software-only
sma->disabled flag and the SMA_DISABLE substitution in
ptp_ocp_sma_show(). It also added this write in ptp_ocp_sma_store_val(),
which clears the SMA_ENABLE bit:

	if (sma->disabled)
		val = 0;

After a rebind with an input set to "IN: None", bp is freshly zeroed, so
disabled is false. For SMA1, for example, ptp_ocp_sma_fb_init() sees
BIT(15) of sma_map1->gpio1 clear and sets mode = SMA_MODE_OUT. Sysfs then
reports an output function for a connector with neither buffer enabled.
This happens without any DPLL involvement.

With only Fixes: 09eeb3aecc6c, stable trees that have b2c4f0ac53f3 but
not the DPLL ops commit would not be offered the rebind part of this
fix.

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261122-timecard-common-v4-e0db4ab1aa-0-ahmadexp%40gmail.com
Technical Details
Message-ID: <179548551472.3135.11972018356692852897@kernel.org>
Path: mbox-mo1.pugleaf.net!news-lon.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!2.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369949-linux-kernel-netdev=dewy.ru
References: <20261122-timecard-common-v4-e0db4ab1aa-3-ahmadexp@gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lon.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!2.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369949-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v4 3/5] ptp: ocp: preserve disabled SMA inputs across driver rebind
Date: Tue, 24 Nov 2026 01:58:34 +0000
Organization: Usenet Network
Message-ID: <179548551472.3135.11972018356692852897@kernel.org>
References: <20261122-timecard-common-v4-e0db4ab1aa-3-ahmadexp@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network; logging-data="4029935"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:2b6OFiPnwiEjz2ZYfI0KCE45sts= sha256:D7rlbdFrb6/nqkxidgvmPLFHbeH3XflMzBTeDt6nRBk= sha1:SLBe/tHLOJpSoCCL5WLS2JkxQ8U= sha256:mNzzTclByjMLePaTsjiecmu1oiq2zez1uQ5fjIE0vls=
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 C54A8125DC9; Tue, 24 Nov 2026 04:58:53 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.401
X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, 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 r33Bi-vPws9v; Tue, 24 Nov 2026 04:58:50 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-369949-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id A032A125DC7; Tue, 24 Nov 2026 04:58:41 +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 73C9733B3A; Tue, 24 Nov 2026 01:58:37 +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=1795485517; b=1Abmon6ovDbE0u5YMvaJzh9nMshCce0GxvAT+vk5k9eZEMr2rH4q3bhkBC2u81PC/xV2 g1TXcdBB+faUzQDPs5iIFRGG63nJ5MErebCykX4xcCRKq2ODeMss9DXo/3QDudtCydddS xVUUcaLyXuFl47IlOvauPCIkNy82hb3+hH0FHzF8Q0syi48VgDs7/hfYFk5MjlDBOq+NC F2fGEP3G00/LGOefTuIZffHj9fYbVvWNnh0ZSbusQ7xa2kpRnfZIw4kj40H7Bwg70dGTb 6q4f4AtsVYQqlZdk2yXmwmuSAgVJg7XD0rU9NvqRXWQMGZJ6zfScZQqXPVrcibqrAKQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795485517; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=x9dCxxVeI1e5hPeiBhDom4pt4jpE4Lz80MrJvu1yG6M=; b=EnSr7Xh2ycohEr0zBAgDttXW7j5TNDO1NQBvkroLtgDxybMAne46EDPIqp6E2Cg2s/OA sdoq+W/aMR3BnHfnAXNxuLS8SetdkG0wIXvUOXnKfl2Y10euFyQPgJkoEiav4k3MReiqj DAIVzkCitZnfkbLZeLNxHlqPt0JMYQt04I9zgSeD8ADZw4Kc7RL+9U+mL0Rdl8G/rB4y6 mr90NW3poY785QIUZeYPm0ixdcCyc7YaALBBhGLIpbtwgXPe6S1w6uXRHbiD2VebJ2w2k Sa7ivCld/z7KBzJT2N9ficzYxzM4BKx6nJBUITmkfvQ1wAEtO58ikXAxoVJzzUZp3Zg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=QfHfljj1; 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 4BE5C606A31E; Tue, 24 Nov 2026 01:58:37 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=QfHfljj1
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795485516; b=Oqz8uLY2OXUOwhBCrJWLICUMisoJOrUcerL1BR9a8e8+7U9O3x1os0HxEtNTwuE1yESq OhxmTpyvlfdE9MB3iRe0xroQgqbKlL5PpaOyN4XD3bLsEixf6cRSbX06NVJs8Nti4eI/p kF+87jXeHanAL485VjlOzqwQwtufcNKaIUJDyZndnxpClHGP+QViVlv+jHgts5GXLvMFI ZsORnGHmN0lb2U2SZJLyOBtoYgUzoHuTTouVTPCI0unTS1FUdZVYazjnK2cUo1Jdn7kPS ZvKpNDl37QBHwpxuV8ZUinH16JslpPbEHmYWADLnHYEacGpvsvpD5mWFesn8EPNi5ZA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795485516; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=x9dCxxVeI1e5hPeiBhDom4pt4jpE4Lz80MrJvu1yG6M=; b=S3ckRPwwaCT25m8fYmPrb3j60lpUEI8i/LuIkWzIqQfCpd3X839CjHq7ER0lUkJkhUPU yjyduVv5i776Q95Vg5L4wxCaRLwhC5h0Zl0kw7w7Ib7dVAzIcj6VnWPKnl+rpNy4fhhQa oNtpwDb3BKT0+iGlefe8SufuEu1EOoGvmN6uhSwkDhZU0xoWw2UY1NcSSSfk8qNay/6bQ R7iDoRoRaI7gkFp5RG1NDBSaAJuHKS8480rfOaY5crDdgzvCtAH2O5bimxdVFL2vq5vuW ddoCWhTvz5iKL8yy3KLzxB4nU3kf/+B8aRsorOAs/pbo6B5eb6oAZ1Oq768kPKeVRKg==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=QfHfljj1; arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6A0D5606A322 for <netdev@vger.kernel.org>; Tue, 24 Nov 2026 01:58:36 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 356D31F000CA; Tue, 24 Nov 2026 01:58:35 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795485516; bh=x9dCxxVeI1e5hPeiBhDom4pt4jpE4Lz80MrJvu1yG6M=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=QfHfljj11JoUFmXqpbpeJvLBOqMyIWxxKeqNphmH5NVAEVK75s4rLUvmXsTe8bMZG trZBlQYuRxHT2P1ObkAlu9mPmxhqjlGCyJI3cIf9ukFi4aXGxLuNrw47spK+gmVGk7 2uv5DdTmaMqFRsNq/snU5dWtNKu+KMChm7hTXtL8PjR81glYYwe2PzvqZNJWwZIIpV EIx0V79Tv3qM0Hk+vTOrqR/VOzqi4eVPdTaLX12Fx08mmMggMtVYXmtUBQPp32Kac5 2nepMlqUkrNjDSVCCTGB6rnV0wNwUd84lk1SlhwcvzBvcxM8qpD/fPZmBRaki4kpCe x747AEaTvf7yw==
X-Cc: netdev@vger.kernel.org, andrew+netdev@lunn.ch, arkadiusz.kubalewski@intel.com, davem@davemloft.net, edumazet@kernel.org, jiri@resnulli.us, kuba@kernel.org, pabeni@redhat.com, richardcochran@gmail.com, rmk+kernel@armlinux.org.uk, vadim.fedorenko@linux.dev, vladimir.oltean@nxp.com
X-In-Reply-To: <20261122-timecard-common-v4-e0db4ab1aa-3-ahmadexp@gmail.com>
X-sashiko-severity: Low
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