Article View: linux.kernel.netdev
Article #19421Re: [PATCH net v2 3/4] ptp: ocp: report disabled SMA inputs consistently over DPLL
From: Vadim Fedorenko
Date: Thu, 19 Nov 2026 22:24
Date: Thu, 19 Nov 2026 22:24
44 lines
10335 bytes
10335 bytes
On 19/11/2026 21:19, Ahmad Byagowi wrote:
> Disabling an SMA input clears its mux field. Zero is also the selector
> for 10 MHz, so a DPLL read reports 10 MHz while sysfs reports None. The
> DPLL core then treats a request to enable 10 MHz as unchanged and skips
> the setter, leaving the input disabled.
>
> Substitute SMA_DISABLE for disabled inputs before looking up the
> frequency, as the sysfs path already does. The None entry reports zero
> Hz and a subsequent 10 MHz request reaches the setter.
>
> Reported by the netdev Sashiko AI review and confirmed by code
> inspection. Source-derived C regression tests pass with ASan/UBSan;
> restoring the faulty selector, mask, disabled-state or DCF value makes
> the corresponding regression fail. Tests use stubbed MMIO, not hardware.
> The driver object builds on current net with W=1 and KCFLAGS=-Werror. No
> physical card was tested.
>
> Codex prepared the fix, tests and changelog from the review and upstream
> source, at the request to separate common-driver fixes from WiWi support
> and validate removal ordering.
>
> Fixes: 09eeb3aecc6c ("ptp_ocp: implement DPLL ops")
> Link: https://lore.kernel.org/r/179502617840.3136.12704245716223038161@kernel.org
> Signed-off-by: Ahmad Byagowi <ahmadexp@gmail.com>
> ---
> drivers/ptp/ptp_ocp.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/ptp/ptp_ocp.c b/drivers/ptp/ptp_ocp.c
> index f1f97c1fa0..06d05fac6e 100644
> --- a/drivers/ptp/ptp_ocp.c
> +++ b/drivers/ptp/ptp_ocp.c
> @@ -5923,6 +5923,8 @@ static int ptp_ocp_dpll_frequency_get(const struct dpll_pin *pin,
>
> val = bp->sma_op->get(bp, sma_nr + 1);
> val &= SMA_SELECT_MASK;
> + if (sma->mode == SMA_MODE_IN && sma->disabled)
> + val = SMA_DISABLE;
> tbl = bp->sma_op->tbl[sma->mode];
> for (i = 0; tbl[i].name; i++)
> if (val == tbl[i].value) {
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Technical Details
Message-ID:
<ffec4c83-8026-43fb-b3fe-b0c3f9bbe2c7@linux.dev>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-367380-linux-kernel-netdev=dewy.ruReferences:
<20261119-timecard-common-v2-078fe69f33-0-ahmadexp@gmail.com> <20261119-timecard-common-v2-078fe69f33-3-ahmadexp@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-367380-linux-kernel-netdev=dewy.ru From: vadim.fedorenko@linux.dev (Vadim Fedorenko) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net v2 3/4] ptp: ocp: report disabled SMA inputs consistently over DPLL Date: Thu, 19 Nov 2026 22:24:05 +0000 Organization: Usenet Network Message-ID: <ffec4c83-8026-43fb-b3fe-b0c3f9bbe2c7@linux.dev> References: <20261119-timecard-common-v2-078fe69f33-0-ahmadexp@gmail.com> <20261119-timecard-common-v2-078fe69f33-3-ahmadexp@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: usenet.network; logging-data="2996731"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:dpbtje8CD9YTTJMX96B7InQiFR0= sha256:ZqB90X/gNmqjSELrMQ0POR4SDhpdSifZ1/XYucpEMl8= sha1:usxbc1UqyxwzgeJpELiFcAvWpCk= sha256:qXRdqMubb9+3OxZ6VdSABXICZg5HGx4Ub6lLG5rOVZs= Content-Language: en-US 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 EFC731157C6; Fri, 20 Nov 2026 01:24:27 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.05 X-Spam-Status: No, score=-3.05 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, 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, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key) header.d=linux.dev 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 2ygpUpvj8hjC; Fri, 20 Nov 2026 01:24:24 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-367380-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=linux.dev X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 12DB61157C5; Fri, 20 Nov 2026 01:24:15 +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 112922472A8; Thu, 19 Nov 2026 22:24:10 +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=1795127049; b=J4UujiH9dPFplccZ8+1X9wE7VWw20g/ueft+nlSyYfyhbcVio77lQ0bi3vfRJSbGpTQk tYlQJMG6emXxsRPbn17dBDZQZmvJV9kDpah7t/jmN9aJRfJRT6kBlqEAvmS7wV6FgPs1o 3MRm3XlGGwkvS5g/OvaGdl765vcIf0gxr8MDuy+RMyfGMpJkppaH0+4tKGstV7PXtjRmX +AC83YYS8XqXPd1ltmQuzdQ1TjpwMHClcPOX4FCHuyRV3Zs2sgQI8W1b3rMjpciynZoQg 2LYFdGTH9XtDag+dm0B4Z32X6563Qft9vJUaKXRGgNO5BFuyUqveYG5dsMlBzYgplXA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795127049; h=X-Original-To:Received:DMARC-Filter:X-Envelope-To:DKIM-Signature: X-Envelope-To:Received:X-Mizu-Trace-ID:X-Migadu-Flow:Message-ID:Date: X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe: List-Unsubscribe:List-Owner:Precedence:MIME-Version:User-Agent: Subject:To:Cc:References:Content-Language:From:In-Reply-To: Content-Type:Content-Transfer-Encoding; bh=MlhI3uLFihtIxO6VQXkXvq8PfKkWoJX+XTh7Gyi8uPo=; b=UMvIiluO5/4A1fiF5IJA3IQxqjsk+sKBZmIOVWsBXK56GXg0pIcs8HkTYbc3VYt6oJsq iRHnWdWJHm233E25KeiTKENqUvc5Xe6Quio4Q2tJGkcn/FNnOE2lR7FWp6hGbiKefzSF5 ptZGzqjqQk99Pu7Wns9ogzyMg/nqsdoRMC6jkq7n8V0hor+btYuxOoKrJJbPnBvuc3afD tVE+A71c0CQJJ8qSzKad7zaDK1ytvBn6YdGJnSpmxDuFw6bp1I9PxhreZEAQ04W5hoHJd PDycSND4ySW28JjfCJqR2bBri1oTGI22OleaLhDS3kSr2jloNpyDkHGH52i30uuYLyA== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=P7kUNGXO; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; 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 5642C606A331; Thu, 19 Nov 2026 22:24:09 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=P7kUNGXO X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.218 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795127048; b=bbFsZkimvJb052hIjXgRstNqFOzuaqF6wUShYT2Uoa0wIX4fEbid1pgglT1LOugMNWmN HITU83wcYFOof7E4bpxQEGzSJFp1ovpSwKoiUh/DSRo67f89HEC2PO/83yZjxeXh6uGrM AgpzyVM4MBitVuLfk2X2vM0EbsMhGnTT8oK/hA1c4Ir88m3+9JMLZT0I52Z79OPhpEVtX yoFYPWTjvMoIUPX0Q0StUECp/Q+B7bj9WS7VbwnbUBrmfYPz5ZbUNbi91z1sM7TtxaUvA 5SPiZAyDVStZVbwCP+m23RundzX9ZOQRVf3VPgnb3qGxy8UOi18jAIQe4RJ+LzmlIlg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795127048; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:Message-ID:Date:MIME-Version:User-Agent: Subject:To:Cc:References:Content-Language:From:In-Reply-To: Content-Type:Content-Transfer-Encoding; bh=MlhI3uLFihtIxO6VQXkXvq8PfKkWoJX+XTh7Gyi8uPo=; b=mD+6haqQ/e6PsNSkkuZIVxVF10w1nixeGeSpQcpMfrMQu1sS82r56pFGYwEIBJCdOnts D87ysv4UPxpFiC/HJsGsGugtgDE5UWjp4i72TW4izMJvTz/2QamfkMqLKV7JSSH21/2TO aW/GdEAq5B2IoyoJWQM2WWbmHd+6HJuPTV8whq+ZgQhqfIMjAXkxHXCvQlmgB6OvKWsRI TSoPNzO9Smnyi1sI/7E648LNvMp4hfsZ0AP3WhihwpqwrAXgAf44+ANkQbi+/plXWBp9/ 0HNMFyj2uwXGpgWWp3mY89gO3irqfA9GALtS/VrE2v0v1fI/tRmmUUJUK3JmlPk7C4g== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=P7kUNGXO; arc=none smtp.remote-ip=95.215.58.218 X-Received: from mta1.migadu.com (out-218.mta1.migadu.com [95.215.58.218]) (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 D4135606A320 for <netdev@vger.kernel.org>; Thu, 19 Nov 2026 22:24:07 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D4135606A320 X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Envelope-To: netdev@vger.kernel.org X-DKIM-Signature: a=rsa-sha256; bh=1Q5l2FHqNCjLOr770Cpwl0EQyPJyuaWKoV8UzD7ZWGc=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1795127045; v=1; x=1795731845; b=P7kUNGXOu0kBJK2UQDXk35Ywvrj7vpp1NbakIvkTY9IZ61XtNsUSkn2vQX/W4xkZJbShAvcs Q6R66Zoldx8HisVRLsWhuGrJNadhLqhh9z8jHrl1D+LbJec8iYYht1LpjC/FXXWgteZcC5diIYz ncCxSEVT0iDPYYTx/ReNDjLA= X-Envelope-To: netdev@vger.kernel.org X-Received: by smtp.migadu.com with ESMTPS id 5e7648e708128b93; Thu, 19 Nov 2026 22:24:05 +0000 X-Mizu-Trace-ID: 5e7648e708128b93 X-Migadu-Flow: FLOW_OUT 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 X-User-Agent: Mozilla Thunderbird X-Cc: andrew+netdev@lunn.ch, arkadiusz.kubalewski@intel.com, davem@davemloft.net, edumazet@kernel.org, jiri@resnulli.us, kuba@kernel.org, pabeni@redhat.com X-In-Reply-To: <20261119-timecard-common-v2-078fe69f33-3-ahmadexp@gmail.com>