From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.51 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796283410; b=0n3WMcd1jiJG5gl88VxDdCkKw6upd9ERdHNnxN3HJqSKyuYgzuv15252CtddjmxKb4Xj xOaCYnbtNoW2FGrEFtIfJv/JchxDoqzP9PEoIbarZtEcbICFVOPLCd6tKXaNxp/rA7gW3 PbPgrZFPdM7v9VFaqY9fx0yqSI9eQyhhjBRcNg3WjcVTdIv4AezUDw3PLmvDRit5inpzJ IZy87jZ8HQTgYevZJ/umgcsOIUkrQ50u/StSg9JMLVqWHVg45iO4YULxIzzQEhoHYFXTD rhKWOUGnGijmKN/57kl2SmBllT9iv2w55uvxFs/kJYDB/hh+HtvNjpEhrsipGNyWqXQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796283410; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; bh=oFXxznXycnf0fI4pTgAHIDYxVbZkqC/tdz7qUeGTIv8=; b=bB8WhfyXXLg8c23xlI90eXRK7+2XVS14UpYiBKWTfz+WyEyprS23c/blT1htov6lYIBZ 2Anagr12f2UZ1Spno+oDAZDyPciVBJVXkdEBiPzLLWqeb873xbFBkG2gA1s/l/n2a6u/H vHBoCSA4jZD2K4FkRecdUHe/N9pAVdS8dwmzUx+gpLU+BlkZC/+8uu+QtHe0pQuEAuBuH imrfI47lp3dVBMPPSNrXzGWq1sDeD4Yqs99JDpXF/FIVALffo9uorx4a1wun7oMrwm8GT cFP0JyyiTza4261nSwKdgMoDZwj1J/VoWLJNSMWjVIfNx3pQbOwel6WvqxT56DTIoxg== 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=a8u9DPsB; arc=none smtp.remote-ip=209.85.221.51 Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (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 80057606A32D for ; Thu, 3 Dec 2026 07:36:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 80057606A32D Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com 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=a8u9DPsB Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-492f0a1b685so10122737f8f.0 for ; Wed, 02 Dec 2026 23:36:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796283409; x=1796888209; 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=oFXxznXycnf0fI4pTgAHIDYxVbZkqC/tdz7qUeGTIv8=; b=a8u9DPsBewVoANiLk5U0n7D4ovIY3DkzVrGevsJSofD0z7fpMWZcyNRkFYSm4+aBIT TqiPPJHQ+GbI1OkNETT+nx12JvaMyjaPZn9C7Avph6iM6C3uo/PnPFWko6bnCYzITJ2m MdTwTbYbMmn1nbQR8WENtRK6Yuz6rsVTBrd75/+WuD9baWOMeK6Dx9rUkUwz1NvEeeqD AZsd1EhlkMxIv6wsxzH2DByAKXbOlL17Ib/J+NE+w2P6OEB8du0QV13YegN2jHTLBOSj CU9VqoEQGxR+puuzxdOxmdfsNcEzTQg3UYEdZhMG0DJvoiND6qMT0gz9g7uDhuD8tIhG yDeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796283409; x=1796888209; 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=oFXxznXycnf0fI4pTgAHIDYxVbZkqC/tdz7qUeGTIv8=; b=ZUHw5Q9NECZ7wK7ro+3li7qrox9BirtW70zVz5Y1YV/6IcR3LKwNH50cMvpXK0Z0bZ cmYix+LM86gToMJ0EkJo6aDveUTRdV5zD0ZsGbpVNi7xLFJoRyiAL8pSJiu4YwiFf5JK MCwbSSthntJMT6CO7s5qxZIlMzaFMT8xhTaC0YITxfdcvvPD/HNWp2UWQLFF5RjcfTOw OUDJVgqy49V/rHjwnVPzbE36o3ykn/MRpoaW8QUxjiVwHbYtft07oWA0RctcJCnqgYwo PWzfS3R3Yzu5h7aneNVBlZQcjjfmdIjBN+EcCuRsJskhbWWI/UlezgkmVPPf7yaqhQ+6 8r3A== X-Forwarded-Encrypted: i=1; AL+hErEQ92LPsluzCuJPb/TnbH4IQqE8go7IR424YIQUD8xuJbzY2tZG37pUKsk7fPB18PrJ2rkBwpe4/8x35FM=@vger.kernel.org X-Gm-Message-State: APuU4Z+iuLU9SWAT/1sYfMiI6nJTw5rrIgUcXooDp7cbWxeothymE8qQ MPb6+PQvGPrErusr3HBWdkOiWqudX4uafPCCUj31VsOlxB5y1TKekPS8 X-Gm-Gg: AZFdTZdfF3y7NUN0SKjc7vXoJN9II5kGRXNq9o/juNnQIbedONO4dzmnK5WqmkFm2MB ZSJh56zVu1zK7Nwxs2H1ziv4TTU51BWuAY95TMEfSi6CzaHxMibKZ8wsbuNuNvoEfUqCQ1Hv8eN 1T08mul4JRUBxDZjUL0grJD2d34rlpDOjKgTfUNl1x0272cftPqeaHewfyGF9hzSaiMqFdTI0Pv fZrc5byo0rbFbUDit+Z4G43VjguIYw+qAWpgv1jp2I6OsGzD4VEOGAysZe/KQpA+EWcF+QVi6U3 mygEcJPYQEN4OGUmFHmdTxBp9QiI6MUdSkz4HDqCLf8QddO2UDS4osRmbQcC6IRbashhM8OvpgZ H3LCW1671G3U6sxdlIVQMXGJH2rXkFlKAEDZVRIOum2McU/njguKQB/YExJ7JJtMiDcivg0qsqB 0mbI3viTkXJlWexMfkXKKQMb4Ns/kIUWbyAvYBOhXUDWuIH2ai31w+ytZe9gSs5cS7snCvDUQJe +anc7hogwlqakoaUlPgIG3i7xjJEt994SS6/VtJMGl2HJjwJPBEhM6RxZvmquDK9//SRi47RW/B gQ7cer/N1fYx6VB74Lv67TBFT+ib0qmehiJ6OSyu+N1PU/Z00mYOyDuh1m2G1VfQYl2wg7u6JZj j6yOjUMtIB2rSRgav8N+mLuKU+Xmsuw== X-Received: by 2002:a5d:6f07:0:b0:48f:fcac:a5e2 with SMTP id ffacd0b85a97d-4abb47b243dmr78359489f8f.38.1796283408695; Wed, 02 Dec 2026 23:36:48 -0800 (PST) Received: from romain-ThinkPad-P14s-Gen-5-AMD.home ([2a01:cb11:543:b100:337d:192a:5086:8974]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4ab6b205443sm87716493f8f.39.2026.12.02.23.36.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2026 23:36:48 -0800 (PST) From: Romain TISSERAND To: David Laight Cc: Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Stephen Boyd , Brian Masney , Jerome Brunet , Maxime Ripard , Frank Oltmanns , linux-clk@vger.kernel.org, linux-sunxi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] clk: sunxi-ng: nkm: use div64_ul() for the rate divisions Date: Thu, 3 Dec 2026 08:36:45 +0100 Message-ID: <20261203073646.3099665-1-romain.tisserand@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261202224025.07df2dd1@pumpkin> References: <20261118162237.1664352-1-romain.tisserand@gmail.com> <20261202224025.07df2dd1@pumpkin> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Hi David, On Wed, 2 Dec 2026 22:40:25 +0000, David Laight wrote: > Exactly when does the truncation happen? > That is what actual values cause a truncation? None. Every NKM clock in sunxi-ng has N <= 32, K <= 4 and M <= 16, so n * k <= 128 and m <= 16: the divisor always fits in 32 bits and do_div() gives the exact result today. > And if there is one, why does it only happen on 64bit. Only in the sense that the divisor is an unsigned long: on 64-bit it is 64 bits wide and do_div() takes a u32, so the conversion could in theory drop high bits; on 32-bit unsigned long is already 32 bits, so there is nothing to drop. With the real factor ranges it never happens on either. So "on 64-bit it would be truncated" overstates it, sorry for the misleading wording and for the Fixes: tag: there is no bug to fix. The patch only quiets the coccinelle do_div() check the robot reported, with no functional change. If the maintainers want it, I will send a v2 whose commit message says just that, without the Fixes: tag; otherwise it can simply be dropped. Thanks, Romain