Article View: linux.kernel.netdev
Article #27344Re: [PATCH net-next v6 3/4] net: phy: realtek: add PTP clock support for RTL8127a
From: Nicolai Buchwitz
Date: Sat, 05 Dec 2026 11:19
Date: Sat, 05 Dec 2026 11:19
29 lines
9170 bytes
9170 bytes
Hi Javen
On 4.12.2026 03:11, javen wrote:
> [...]
> +static int rtl8127a_ptp_adjfine(struct ptp_clock_info *info, long
> scaled_ppm)
> +{
> + struct rtl8127a_ptp *ptp = container_of(info, struct rtl8127a_ptp,
> info);
> + int pm, ret;
> + u64 diff;
> + u32 rate;
> +
> + if (diff_by_scaled_ppm(1ULL << 32, scaled_ppm, &diff))
> + rate = -(u32)diff;
> + else
> + rate = diff;
Looks like my suggestion broke an edge case here, sorry!
scaled_ppm = 32000000 passes the max_adj check but gives 0x200000,
which sets the sign bit. max_adj = 488280 should fix it.
> [...]
Thanks
Nicolai
Technical Details
Message-ID:
<a0a4ff999369d36b980988e6ec9b7dd4@tipi-net.de>Path:
mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377946-linux-kernel-netdev=dewy.ruReferences:
<20261204021116.66-1-javen_xu@realsil.com.cn> <20261204021116.66-4-javen_xu@realsil.com.cn>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377946-linux-kernel-netdev=dewy.ru From: nb@tipi-net.de (Nicolai Buchwitz) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v6 3/4] net: phy: realtek: add PTP clock support for RTL8127a Date: Sat, 05 Dec 2026 12:19:11 +0100 Organization: Usenet Network Message-ID: <a0a4ff999369d36b980988e6ec9b7dd4@tipi-net.de> References: <20261204021116.66-1-javen_xu@realsil.com.cn> <20261204021116.66-4-javen_xu@realsil.com.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: usenet.network; logging-data="3014284"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:BA4ACYSqJqcG86uaAk1Z9fmS9sQ= sha256:TWOQJ51EN0tP3s9KvYz741pcx6kqTbecFVA33sRy1cc= sha1:W1VI4HRTurTJnicF5G524uKtXXc= sha256:TaLtFvYssy+gvnacScAfoDu8jFNRboo9JWxztNKBPJg= 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 4FFCF117DF9; Sat, 5 Dec 2026 14:19:40 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.298 X-Spam-Status: No, score=-3.298 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.001, 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=tipi-net.de 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 b0RhBDTSjQnS; Sat, 5 Dec 2026 14:19:38 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-377946-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=tipi-net.de X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4]) by mail.dewy.ru (Postfix) with ESMTPS id 82E28117DF5; Sat, 5 Dec 2026 14:19:28 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sin.lore.kernel.org (Postfix) with ESMTP id 170F32DBA4; Sat, 5 Dec 2026 11:19:24 +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=1796469559; b=ch7Yu0cRI/onqrXyQYyZUH+BK8M1reNjFRcp8HTBsZBq8kzarHeOPGSpQ4re94aOaNeR VfseUVIy2onplQi2My/aqfYAxehbY0gSKRxwZgI5HhpX36tB7xArc7AieMUf+7Z5Gsuvr ZkildqaX6gf9fwZ0Ko30/nWdcxL0h1vIQrko0XyHdw6T6zgFMkqFs/e2pdFbfb7eEh4wy VikImlUDJ+scTKgtylOw2J1VD/SaTdSFV8whE9ktOXCcyg8ZmAHD5JC/ZVMcOU6weJw3f ul6r3iFA76I4Io7bkninZqSFM/giwivAeKerIBjuOkYjM1GtX+GVqp4aD7QmrxyBGDQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796469559; h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature: X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe: List-Unsubscribe:List-Owner:Precedence:MIME-Version:Date:From:To:Cc: Subject:In-Reply-To:References:Message-ID:X-Sender:Content-Type: Content-Transfer-Encoding:X-Last-TLS-Session-Version; bh=YAl8HQ/4GsCiz9UXbgRWHRB8dL88KqrfzrtJQOlbaz4=; b=eIYXrZ5/kg1iiyhKY0HHsvnPjo48YFLW9HaP1vo+bCKHbk3aU2KLM02eopku3zGQ1u1s PQz89rpGZrGPS8KcuYTcRhD82/0j1YWmkFFJvpsr8QIY/V/KmHjXDwkyUevAubo3xcjPL 85stmMdiH1INPs1uYl9rYuT7lrsJLs5kVq06DzNb/6NSdXAfyaehq4lV6HLYQcEmRRYTy alDTLMLUfNK4dVo9eeXMHdGndzfyUOpc1gH6dr0pYLfN53WYPuqjWXcgqFIvBMsSxcT6l TwF/4O87IMAgXUQJKyv4IhcRFJ/Ap9idyXaRX+dqv991HrpuHqktSq/wjQZuRYVDgTw== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=tipi-net.de header.i=@tipi-net.de header.a=rsa-sha256 header.s=dkim header.b=TZsPL4zN; dmarc=none header.from=tipi-net.de; spf=pass smtp.mailfrom=tipi-net.de; 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 3BC06606A688; Sat, 5 Dec 2026 11:19:19 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tipi-net.de header.i=@tipi-net.de header.a=rsa-sha256 header.s=dkim header.b=TZsPL4zN X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=194.13.80.246 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796469558; b=SuhjPb6TjQZzVqAslTgElVW1fOHa0SOuZdcdVg4MNCZ3ScwBm4ZA7OxtUntOhgkVKvIS WvCuYC3KJUXIOJHiZ3IO7W5pXbShRcJYm3Q2KoCjzC9/RaTHnwpVl2UNqk5BeqmO8yZ6j 66Nw6emrgZCN5QzVEfLyEEmYWt3oj1MYDoqUWU2QrqGMli4q+tsIqo5yWE9A8h3dX+Uuw Dkj4Sq+7iZCu/ztzDUgDYImJf2K7vDjlHMiGWyzlD/2slrrhJxixxUQAHj6scr2u1Clcb rN8gRZMDgXxtDqpMVkVegz6Psi2GR/nk1kBC/A/i9rjX3n3wl2Gs2Q2++J/CpmrWgwg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796469558; h=DMARC-Filter:Received:DKIM-Signature:MIME-Version:Date:From:To:Cc: Subject:In-Reply-To:References:Message-ID:X-Sender:Content-Type: Content-Transfer-Encoding:X-Last-TLS-Session-Version; bh=YAl8HQ/4GsCiz9UXbgRWHRB8dL88KqrfzrtJQOlbaz4=; b=I/jMlZZkW/+OOWo5NFgN1uvwHR3Zs7MhLCSTGvwjWWC5GZUjfLPoPAy6k66l2xa17eds GCW6mF9FCL3q5zMCUJCOy6hSGkSheMdOM3eVbqLvkTlZuDgGNXESDpFJucIDjrNPgxiF0 6sqPRVNrHTy0j/Q8/9GJaVOC1QleCnDkv/tXVfqb+gS8ZwAf+pInjQn9aDskt+TgCc3Fc rph8pGAukw6Ota4cwS5MxJqIJR6B9O0XwNFfujqEjTcDZO8HNVGQHodZjqOBI3uZkP9Lj kj2pDbYZ/V5P72E8zuiyC4Qe7VDQM1eNReR0COEChffApW6lsLQmM8sZOyRhzv//8nQ== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=tipi-net.de; spf=pass smtp.mailfrom=tipi-net.de; dkim=pass header.d=tipi-net.de header.i=@tipi-net.de header.a=rsa-sha256 header.s=dkim header.b=TZsPL4zN; arc=none smtp.remote-ip=194.13.80.246 X-Received: from mail.tipi-net.de (mail.tipi-net.de [194.13.80.246]) (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 E966D606A322; Sat, 5 Dec 2026 11:19:17 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org E966D606A322 X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tipi-net.de X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tipi-net.de X-Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 5BE53A1630; Sat, 05 Dec 2026 12:19:11 +0100 (CET) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tipi-net.de; s=dkim; t=1796469554; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=YAl8HQ/4GsCiz9UXbgRWHRB8dL88KqrfzrtJQOlbaz4=; b=TZsPL4zNhvTrFA3EnvoarT4hMvUy9G5uV6KES9zaCluR+LdgsKrnN6mLBxYZZrypbR2GyD 21JFSR5q6NR1ktHlzm6Nfm65aDFm/Aa7zpwJnb9UAX76MPiUKNHMyYnKxTaPx3I4sGo17g K7/fcKSWW8hgkJ/iCpMuqSc8JvP2IXb6mQGZBMVGPQb3aCSRTtG1I05L5ONYIQfp5wmmGA UL/7j85xfUBlij1iCnd6k1Q4mqxwviT5mESExcs49okTdDHuvLGnD+3FOui4GKS66Jedx5 h4Jc413rjLKErgWkLhbGzKsWA4EwyUL2QifE/gNMXIDH4ApTG8t6nkkD8WaMGg== 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-Cc: andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, maxime.chevallier@bootlin.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, daniel@makrotopia.org, vladimir.oltean@nxp.com X-In-Reply-To: <20261204021116.66-4-javen_xu@realsil.com.cn> X-Sender: nb@tipi-net.de X-Last-TLS-Session-Version: TLSv1.3