Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp261926pxv; Thu, 15 Jul 2021 03:47:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzcp0PPNeNEB1GeuS6vcR7WoT/fDJJsJP3stvcmR4S4WTK3kSvWhVUXNgX8uKcJ4A4ZRnU4 X-Received: by 2002:a05:6402:517c:: with SMTP id d28mr6042349ede.299.1626346063506; Thu, 15 Jul 2021 03:47:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626346063; cv=none; d=google.com; s=arc-20160816; b=tzy5ceqzx1Hbrps0jy80FXdqaI3mp5KhJ0MyXNyiNvLoTh4nGUnUkhBVSuipqGE9sy aqj7bDSyH87oEqA5eqgXihF+Fz18sTcU3+VjZ4ml4+vHBkVJ7IC8MJGw5qMKus032pOa 6cFE+ryuHDRJblfVcqvB1x3H8T6P2f5W3YYFMJSPqRV8zaw8kraak55xcvUG0O+Ue1CZ wZ1gV35gWCpzl/B0PR4wESV5KzrY0XsN6K8um2R8RfMv1wiJX/mHcXRYzasrqXLd4nPj qtf20ylgpxwPoMs5Y4/793+2nyMabWee5xtlHQQMRDjZDz8/BQp7HytEap4tX6Djvf2M iZrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=E1r2M9qlATX1/79jz2l+ymskeoXA9h+PcZ2ca6/n34o=; b=V6FZByGYSSm65WYNYKNQtq2jF1XM/CUBi212JmZQX9dlhY7gP+waCJgtDAAgLrPMqu B14OlMAuEHNk2StjApd+We3gAvIdcL+G5tXh+UQv3y/5Ce1Qf/WBkcuwGdfc0qqznDTr E0iG5vBgu0NF+lqsytHoUrczJDs8REAW596NJyOuHAyaXyewgBRJEpPpppHZg+Aj6xF/ xplZXCbaKTcSRth0Pdhh0c4LvbRU7ITNHSF+e2FHKWgs1DDde8l8LSw6xOpaIIuXFLRk /QL0Z+5AEu/lkYykauOoqg9QWFJSK10uCQnlY0GlXfBXvnH2KMlRNminAKW50QH4ZxEf rYlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jtgMOGkq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cb18si7235001edb.378.2021.07.15.03.47.20; Thu, 15 Jul 2021 03:47:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jtgMOGkq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240656AbhGOIWn (ORCPT + 99 others); Thu, 15 Jul 2021 04:22:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232568AbhGOIWm (ORCPT ); Thu, 15 Jul 2021 04:22:42 -0400 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F09F6C06175F; Thu, 15 Jul 2021 01:19:49 -0700 (PDT) Received: by mail-pj1-x1034.google.com with SMTP id b5-20020a17090a9905b029016fc06f6c5bso3501671pjp.5; Thu, 15 Jul 2021 01:19:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=E1r2M9qlATX1/79jz2l+ymskeoXA9h+PcZ2ca6/n34o=; b=jtgMOGkqqw+vOJ+t3+o3wTS+9Z1k34ju3mvZxn/7HxptmbXYo6xcg2QlTpwajGlDAY FJkqGOzWEsaqGcT+yELG8R0oqZLrqAxZ29tfgk0dfmUm/tBYQclFDuXmNZM4ILIVO1Jc e3oDGXGjEXq7SJ5igFusO/AJ7vK00Tg54CBPGoUP1bwh1HthlNNQPsUTC/bsyhiViUy1 kn0SIKkcCA930T0Ad6XwqhxS8GBtuZ4vJQzsSoL6G8FuolDx/+StFxKzkzXZbWws1YY3 flEA9JCqYo710jMKWSSKAo53VJaxzAY+ZJnCzx5AnszC5r0Rbnt0joRJVKEFZsilLrsI LpmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=E1r2M9qlATX1/79jz2l+ymskeoXA9h+PcZ2ca6/n34o=; b=rDN8nkfCdATTlj1au9XwXGCrgDMg+njKL8TUlRYnSIMqVIpKRpTMSAN2Q0zHIy7EbA YZC7nttxP4/vR1y2SRn5/zvTS7B9Abmk2fbQpENajTyWs/5fL/B17t1pTwb+G/Gvm7fy vTtseKLTVg/SIm6MRYts8RW0ahhIqQP9tmMd7N1j/9Yu4RKaUKyGTT6Wgg9gCOIAJM1E S0ryUyPDwfztDJlZMapKqQkdcD4EmqmXsxtQgkoJ16jNxvizPa8fnrxQp3wHkQSswkc1 Hc+AXo1P1aowOtY4xia8kzNvx2VXgUOnAb+oI5qz4SEk6KNcP80UpT7NRPCK6hwQi5en tnSg== X-Gm-Message-State: AOAM530KARH67U4u/kJnxoxEbYcK8X9LWHzv0k5kwpdBa5xSxeIl/LTY w72cHrI0dxKUxnUXH4BRlr85Fnky+kFsPm02v9c= X-Received: by 2002:a17:90b:1194:: with SMTP id gk20mr4153360pjb.181.1626337189528; Thu, 15 Jul 2021 01:19:49 -0700 (PDT) MIME-Version: 1.0 References: <20210714064129.1321277-1-victor.liu@nxp.com> <1f1b38f9c42093bea5e6a8ccb458bdf799069157.camel@nxp.com> <0ae047e216298e6239e39ec40a2d545ac07a7406.camel@nxp.com> In-Reply-To: From: Andy Shevchenko Date: Thu, 15 Jul 2021 11:19:13 +0300 Message-ID: Subject: Re: [RFC PATCH] clk: fractional-divider: Correct max_{m,n} handed over to rational_best_approximation() To: Liu Ying , Mauro Carvalho Chehab Cc: Andy Shevchenko , linux-clk , Linux Kernel Mailing List , Heikki Krogerus , Michael Turquette , Stephen Boyd , Dong Aisheng , NXP Linux Team , Jacky Bai Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org +Cc: Mauro (below Q about sphinx and docs) On Thu, Jul 15, 2021 at 11:14 AM Andy Shevchenko wrote: > On Thu, Jul 15, 2021 at 11:02 AM Andy Shevchenko > wrote: ... > Now I realize one more item which is missed in the big picture. > When we have overflowed the denominator (n) and shifted the values, we > are expecting that the caller will check the rate and use another > 2^scale (see (6) below) prescaler if needed to drop frequency to the > needed values. The first few users of this were the drivers of the IPs > which have an additional prescaler themselves. I dunno if there is any > flag in CCF to show that the set frequency is 2^scale higher than > asked. > > It means if > > r_o / r_u >> N_lim (5) > > we will get m and n *saturated* without this snipped, while with it > they will be much much better with a nuance that resulting frequency > is shifted left by > > scale = ln2(r_o/r_u) - nlim (6) > > scale bits. I think I have at some point to introduce a documentation and explain all this from the thread there. Mauro, is sphinx capable of producing TeX formulas? -- With Best Regards, Andy Shevchenko