Received: by 2002:a05:7412:f584:b0:e2:908c:2ebd with SMTP id eh4csp2912027rdb; Wed, 6 Sep 2023 20:55:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHaxa1RXZrf078uW3AFXk7Uxpn1RtqPz6HVCsf9Kqrdl+zmeXBa8mOwHKcQ0CN/2UICGMu4 X-Received: by 2002:a17:906:7499:b0:9a5:d657:47e5 with SMTP id e25-20020a170906749900b009a5d65747e5mr3564422ejl.49.1694058910174; Wed, 06 Sep 2023 20:55:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694058910; cv=none; d=google.com; s=arc-20160816; b=iwtYNA7JS60Du/8pFwE7X9PsHT84hTthL+Qr1/KBMRmLKvA4fzut6ahtPPzRNCAG89 QwvpXoEqKzy7PXxsv946sAyUHRdPynatSMBBfzaXSqLNNBUKu7nryXjzK8ftvjbPafxc 6uBlTXioh4OsvLaSTIJLWETeeftz7yHFCAgczzSp0HIHNZEz6wCNLiJw8Hq4eDxvprKv D/LbLS7Kr8oVT7PZj0IDH8s3JYCHQhayHamBR91MxIw9oj2d3bCL77upDLSfuWFhCPsY Io+8o0DaEZEXE0ZyJPi0ZW2NHBcjU/69/VwbIDDxTIab7XLw7ODvBVBEusvOw9iNBsah apLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:date:to:cc:from:subject:references :in-reply-to:content-transfer-encoding:mime-version:message-id :dkim-signature; bh=JHbSwZaxRY4y8epF7seEt6LLA3NLlN1pmTG3mw/GDuQ=; fh=p4Gx3yedI/bMlOQQke5hjQk74Wnsw/ahZf3K4o7YjP4=; b=OmWmNo2mtK1i2Z8ArDTTWZJhMvJtKgEYraoiQUGqUxJS9yxbk8zxX882KQvyyq+gMA lzy7cmtqfJze1sbG//1Dmt2k+sjO0bQDCvVRKx5lGE0TmR1owG070lJoJqjUXHk195yj 5pZoM5mYpVM2ETIY9GUWCZXhLnzYBotWXG5OzdpCOpEIPvDXTEDoG79OB6UPILGznINd ePq8RZk550ybVb0YIMmsVTv6HvwepOWrPmUyOpIr3kj/tclHbW5+agSe3SUA6YK5NUzO HPPzhCJ9FZuXn+fQsn74gzrWftQbChLFBrlAf6ZlQsNiao9KD/xzMPLOYipw2Iw3c4AG TyVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Sr4Rx2br; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o27-20020a170906359b00b00991cb7517bdsi9822534ejb.948.2023.09.06.20.55.03; Wed, 06 Sep 2023 20:55:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Sr4Rx2br; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244721AbjIFVO1 (ORCPT + 23 others); Wed, 6 Sep 2023 17:14:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232411AbjIFVO0 (ORCPT ); Wed, 6 Sep 2023 17:14:26 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 686B5199F; Wed, 6 Sep 2023 14:14:19 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E0C4FC433C7; Wed, 6 Sep 2023 21:14:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694034859; bh=JHbSwZaxRY4y8epF7seEt6LLA3NLlN1pmTG3mw/GDuQ=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=Sr4Rx2bri7DkIK0+zTnKGsZA1leJXBPlNXJG48HQlNl8+/BoJVw6xZjnMD1g0dsno AXDKi0bf4zvsNLkXBcR+XJ4OhWvnUrevXqoyabun7c/mvRFiT7vGmDcM4XVw0ovq9/ OAVtFeHkel2YyMAldt7A1SVXYAUU1ME8f70vAvZN2TuWi7zwt5MkJHqY9kz88Eg6Ng zxvMZeyTXCitnhkA8Ihw5y3qgAYAvhTT+7PDFXOQzyD5N9i3y7mqzt6grXfQ4bGu+O cxIvIxS8b6T1DH4Zuz+vWZfVy8POScSLF+25b6po0VZBmbPVNeMkqnM6feKDBr47Bv xW22x3zOfzWDQ== Message-ID: <69e1945bebd93916e4408fd8a141fdc5.sboyd@kernel.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: References: <20230901070041.13463-1-quic_devipriy@quicinc.com> <3fe1655e30d62493a24e1f97ab7bf710.sboyd@kernel.org> Subject: Re: [PATCH V2] clk: qcom: clk-alpha-pll: Use determine_rate instead of round_rate From: Stephen Boyd Cc: quic_saahtoma@quicinc.com To: Devi Priya , Konrad Dybcio , agross@kernel.org, andersson@kernel.org, linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, mturquette@baylibre.com Date: Wed, 06 Sep 2023 14:14:16 -0700 User-Agent: alot/0.10 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Konrad Dybcio (2023-09-06 00:33:38) > On 5.09.2023 22:40, Stephen Boyd wrote: > > Quoting Devi Priya (2023-09-01 00:00:41) > >> The round_rate() API returns a long value as the errors are reported u= sing > >> negative error codes. This leads to long overflow when the clock rate > >> exceeds 2GHz.As the clock controller treats the clock rate above signed > >> long max as an error, use determine_rate in place of round_rate as the > >> determine_rate API does not possess such limitations. > >=20 > > Does this fix something, or is it preparing for PLLs that run faster > > than 2GHz? > I did some grepping and we already have multiple of these. >=20 > E.g. SM8250 CAMCC PLL2 (zonda) goes (or well, should go) up to 3.6 GHz. >=20 > Today, only stromer PLL uses determine rate, but perhaps all of them > should. >=20 > I would not at all be surprised if many otherwise inexplicable bugs > went away with that change. Are any of those arm32 systems? It would only matter on arm32 systems because sizeof(long) is limited to 32-bits and we don't have negative frequencies.