๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #22296

Re: [PATCH net v5 8/8] ptp: ocp: correct the ART 10 MHz input frequency

#22296
From: netdev-bot+sashiko
Date: Wed, 25 Nov 2026 04:44
96 lines
11471 bytes
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.

Critical: 0 ยท High: 0 ยท Medium: 1 ยท Low: 0

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] The patch fixes only the 10 MHz case.

--

ptp: ocp: correct the ART 10 MHz input frequency

This commit changes the frequency of the ART input selector named 10Mhz
from 1000000 Hz to 10000000 Hz. That makes it match the 10 MHz value that
ART pins advertise and the matching ART output entry, so DPLL frequency
set requests for 10 MHz no longer fail with -EINVAL.

Link: https://lore.kernel.org/r/179538006772.3135.15875996486888374193@kernel.org
Link: https://lore.kernel.org/r/179538007070.3135.8275620503580456948@kernel.org

> diff --git a/drivers/ptp/ptp_ocp.c b/drivers/ptp/ptp_ocp.c
> index 821ecd1a13c8e..93923d5a29922 100644
> --- a/drivers/ptp/ptp_ocp.c
> +++ b/drivers/ptp/ptp_ocp.c
> @@ -1385,7 +1385,7 @@ static const struct ocp_selector ptp_ocp_sma_out[] = {
>  
>  static const struct ocp_selector ptp_ocp_art_sma_in[] = {
>  	{ .name = "PPS1",	.value = 0x0001,  .frequency = 1 },
> -	{ .name = "10Mhz",	.value = 0x0008,  .frequency = 1000000 },
> +	{ .name = "10Mhz",	.value = 0x0008,  .frequency = 10000000 },
>  	{ }
>  };

[Severity: Medium]
The table change looks correct. Is the failure described in the commit
message still reachable on ART pins for two other advertised frequencies?

ptp_ocp_art_sma_init() registers every ART SMA pin with the shared
generic list:

drivers/ptp/ptp_ocp.c:ptp_ocp_art_sma_init() {
    ...
	.freq_supported_num = ARRAY_SIZE(ptp_ocp_sma_freq),
	.freq_supported = ptp_ocp_sma_freq,
    ...
}

That list also advertises IRIG-B (10000 Hz) and DCF77 (77500 Hz):

static struct dpll_pin_frequency ptp_ocp_sma_freq[] = {
	DPLL_PIN_FREQUENCY_1PPS,
	DPLL_PIN_FREQUENCY_10MHZ,
	DPLL_PIN_FREQUENCY_IRIG_B,
	DPLL_PIN_FREQUENCY_DCF77,
};

Neither ptp_ocp_art_sma_in[] nor ptp_ocp_art_sma_out[] has an entry for
10000 or 77500 Hz:

static const struct ocp_selector ptp_ocp_art_sma_out[] = {
	{ .name = "PHC",	.value = 0x0002,  .frequency = 1 },
	{ .name = "GNSS",	.value = 0x0004,  .frequency = 1 },
	{ .name = "10Mhz",	.value = 0x0010,  .frequency = 10000000 },
	{ }
};

dpll_pin_freq_set() in drivers/dpll/dpll_netlink.c validates a request
only against the advertised list through dpll_pin_is_freq_supported().
That means DPLL_CMD_PIN_SET with DPLL_A_PIN_FREQUENCY set to 10000 or
77500 on a non-fixed_fcn ART pin passes the core check.

The request then reaches ptp_ocp_dpll_frequency_set(), where it finds no
match and returns -EINVAL:

	tbl = bp->sma_op->tbl[sma->mode];
	for (i = 0; tbl[i].name; i++)
		if (tbl[i].frequency == frequency)
			return ptp_ocp_sma_store_val(bp, tbl[i].value,
						     sma->mode, sma_nr + 1);
	return -EINVAL;

Pin-get also keeps reporting IRIG-B and DCF77 for every ART pin, even
though the ART hardware has no selector for them.

Would it make sense to give ART pins their own freq_supported list that
contains only DPLL_PIN_FREQUENCY_1PPS and DPLL_PIN_FREQUENCY_10MHZ, either
in this patch or in a follow-up?

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261123-timecard-common-v5-d669cfa034-0-ahmadexp%40gmail.com
Technical Details
Message-ID: <179558188819.3135.13063151808595339248@kernel.org>
Path: mbox-mo1.pugleaf.net!news-can.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-371027-linux-kernel-netdev=dewy.ru
References: <20261123-timecard-common-v5-d669cfa034-8-ahmadexp@gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-can.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-371027-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v5 8/8] ptp: ocp: correct the ART 10 MHz input frequency
Date: Wed, 25 Nov 2026 04:44:48 +0000
Organization: Usenet Network
Message-ID: <179558188819.3135.13063151808595339248@kernel.org>
References: <20261123-timecard-common-v5-d669cfa034-8-ahmadexp@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="113080"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:CqMOZi15rzTOK3eZhKsGzQ3z0rY= sha256:S05FZPkC0r1VTapYsN6AnocD/fgVqjeBL/rZ1tGKD14=
	sha1:l79MR0XU07zQYNmvvnK7sfX+Wr0= sha256:goQxW9TSdNgtQHFulh+mh+fIxVHLHAQsE+Ag28LcdeA=
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 057EC125E37; Wed, 25 Nov 2026 07:45:21 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.5
X-Spam-Status: No, score=-3.5 tagged_above=-9999 required=6.31
	tests=[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,
	URIBL_BLOCKED=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 4_f7-wu0XP7r;
	Wed, 25 Nov 2026 07:45:09 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-371027-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 5B1D8125E3C; Wed, 25 Nov 2026 07:44:58 +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 7C12234A1E; Wed, 25 Nov 2026 04:44:52 +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=1795581890;
	b=D/TCsI1vKiGDcyz9dOlvcKx0BbjE8JfC5MPvSVoi0R3Khe14hMH6MMPhAIpvKO0F74pT
	 fmhaFiZljUad/nMhSdyX9FeLMlhbNZfLOHyWHdhfXoqQhofuFyCnzWB9Y3ACxzyrepiVk
	 REcRzq/BuncVZQ0X41pe+Elr2uYHoeBsJNnJ5+PFpwWqzzvkBkXxYD32YS9qKN3SccMaN
	 km6E+iltomsFnBHwdjzFIrIAzVnlr4WAZ8eJzcutvqpGc7d0bg650RrI/+KnsXexFdV6X
	 2QWAP6SwfOOSVGHsb+R5gnSIukKR1JtrcSC5bzFWuFZi8HrZsb9cLdjrGoHYp3anegg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795581890;
	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=f4nKhL6BCHc76e1QSsjNaolj45jPoNKK6t/qBjGnops=;
	b=qKHSbz+BT8rrd1XwEI39EvaVex/AjjX+vRrvK1VCsaNC5rMXqv3IKnKHxHAbX12ZPj9W
	 J08CB9gC5UwZVqDBJv+WiRrNpMDc79g/Hkd2s96pn88C3Y9GwCADli0FCDaKpMRfjjICM
	 qSH05lnhGGnHzt2UWZyWFTtq2GrQs4PtITJGkEVO8QZLZDIbP3wTkmyS8glCCNDW16MQD
	 xDSXrsME4PQXLU98YLaq+tZrP7xq7iFzVPPJPZmjDJus/pz+iqSix5C3YUMKkBhYS+8cg
	 q3LELeedl7YKMf1onu9FDQvVJVAG1LG4joqy6Tq5JoFmj/hU25tNlNZgq330rJwzcXg==
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=UZtjE7sk;
	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 A8E42606A334;
	Wed, 25 Nov 2026 04:44:50 +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=UZtjE7sk
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=1795581889;
	b=RySKVIBRt4pZSXLyEmqsgzguamLmOqhLxJJ833CHKMFx7hpZw5BaWLMav5G4gb2QO1iS
	 cgZMLB5entaWRd174jxI1SAgy2EjN76JeIuMZPhu2/pMtFE1vZNmSrCBP9skoPuBtsjsh
	 8gNA4z16k98EJyEs/KQBCdDOQSFnPqAwu66xezReikE7qb+yZx1cc0bxwleIK0c0nMx2M
	 ltjFMO3e/90BtHvnGGFrf96m4uzlIavM+jwrJEOOX/Zrg9ZaWx+2fIM2ncsvrZSGmo+TM
	 O44s0khT7VOMN4tNuW8kawJiZxeuugF6Y6mhQcwq4FQKpINw1Kq/I0z+z52FM1c4img==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795581889;
	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=f4nKhL6BCHc76e1QSsjNaolj45jPoNKK6t/qBjGnops=;
	b=fpuv6NnedOiiSpo4jartLMqaIq5i/yBbwJprff7pvtZILoLsEjYPhWjpPbW8mg6M9HEF
	 mO+PbLK2ADb+XA3QtF+M7CoPGjWZ5HfdOrLtOgFckopkqKFMZY5PM9p/FEf3ZIpjjxflH
	 CcU02wIBp44tH0BX/iT0ufKXlRG4horrznIobv7uDPrTHZsL3Aklp7KSCDjhpWrlFLQrD
	 AS1xcnLgWUTND4RBV6ki3gYf+/kzvM0YJDNhS4hqqnyNilRIdL1ep1fVhaq9APG5/nsDi
	 rUAssQJrMgaQT7NPFcoygwgE3Qbjhxpt36hJyZ/q+xcpjr8X9Eu8jae4uMNN3GFhCvg==
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=UZtjE7sk;
	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 CB71A606A326;
	Wed, 25 Nov 2026 04:44:49 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id A3BA81F000C6;
	Wed, 25 Nov 2026 04:44:48 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1795581889;
	bh=f4nKhL6BCHc76e1QSsjNaolj45jPoNKK6t/qBjGnops=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=UZtjE7skXqqrd1RhY8r7ERvpYZnJvl8wCgZiqlFa2s4jWULNFdhDV/Mhip1p5i97/
	 +GlIclikTjRkjFgfV1+vsx4+UlxGSZnwCve4q2U9joVDl7VAh5JorI+9PhTUCb5lw3
	 X12RqQUl2Ki/yZdBYrRaoEq5cOPiiMjxFxXtJ/etS/AxfrhYa4rP/wGgdwkhBOKPon
	 KI3LHGQ0JopXVX2iR+qCM9dw+rBHJjBLT3k7QDHNv9Ukf0ZFNVwoToTdv/AKCCa2kU
	 83ygPs34OkdUPu1YbQUpWSBqIqZ2PeWD4zm8WbB2sA97Zsa+veXVvlNqKHsojlD9/o
	 YMGbIi2Sz4B6A==
X-Cc: netdev@vger.kernel.org, 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-In-Reply-To: <20261123-timecard-common-v5-d669cfa034-8-ahmadexp@gmail.com>
X-sashiko-severity: Medium
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