Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1167780pxb; Wed, 4 Nov 2020 01:36:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJywGu4W59CY5YajRCMhPZXUN/pWDrAohcVs6v2C6LU9DguQz7gAceXfwtHC0TxoUiNn3Arb X-Received: by 2002:a50:d582:: with SMTP id v2mr532280edi.218.1604482595617; Wed, 04 Nov 2020 01:36:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604482595; cv=none; d=google.com; s=arc-20160816; b=x2pyUKSkESx0yi3ZM3VZ6oiT+L+yIPN2nAS1G8huw5QkMt+yqQwD6vGtz68rgixa6e oZl/tdyrwwjI5XptUNM58OvEhRsPThhLQISI326CFr8WpN/aUe+AX+n6ZtlQOBZY2Gf5 A2RL1k9tDOXj5+daWtFwTAjVMEAl1hOKlKf5ipGc1pc75PTwZFonX5vphqFKRZBuFKd5 SLwWj/Y7TvVHOdwjsiQEC//Lia+Td5c4qrlr0IHGv+BG0cy5JOjUKOdfEomI1aJbPyUg icapNV5IG7VOnUzlf7bK04m/Rgo9E/oHEYJRY4r0rb9ktISbfGN9hYsOQyjqyKXTT+EY woFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=dSdpW81nx2ZMYTMRYGVAqF73yA+8yqW5N14k2LtHpUc=; b=CCkcLeWKe3GNfdq2W5g8ItQCYmS1u7E1LCNC1Q++kVTjnTV/j4UZnUW4SJbd9zP/YC HJzTxkzhk9cH372yrN2Wu09+Qoxfw8e8tKlOIJoFwbI/2+2kvHCsIPUTF0spl7twk9Mg T/VgajkbDgc3fDoVAFtoKsF+d3aFcUma8VTBD4SllT0Ch+2IVn+hNYyG/6l+y5iUeMzL alQcsjSGNHYVRDWjV8biJC5PTJ6HzYNUhy24Dw8Y3EcvZDUl/QCpvbSkUrCE7idQYAu9 GoimLFZ2ccEoeXJnvIwYJGXu7rS414blJp6jWyl32y2eA4BMloKeWws8tdI7ER2ZNvN2 U5rA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=D4oOw7+5; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bf27si904127edb.140.2020.11.04.01.36.12; Wed, 04 Nov 2020 01:36:35 -0800 (PST) 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=@linaro.org header.s=google header.b=D4oOw7+5; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728700AbgKDJdz (ORCPT + 99 others); Wed, 4 Nov 2020 04:33:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728644AbgKDJdx (ORCPT ); Wed, 4 Nov 2020 04:33:53 -0500 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE10EC0613D3 for ; Wed, 4 Nov 2020 01:33:53 -0800 (PST) Received: by mail-pf1-x441.google.com with SMTP id 13so16820941pfy.4 for ; Wed, 04 Nov 2020 01:33:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=dSdpW81nx2ZMYTMRYGVAqF73yA+8yqW5N14k2LtHpUc=; b=D4oOw7+5uthMp9z3s3BQWq+es3Ae4LHtVqIhZEWyr7TV5H6KRq06y+Bclo+itLToGX x8sVA8tTtSxyKBNmcx13a/i1gnzAXqNTL5RDbeCdkZnNUbMVEBjKm8Ytdzx0/OfNlOF8 jtn/Y1paB3Xfg1wTD3WWV3Sc2CLHpP7rBfJO9pMgu7F6tfCO/IWYNwnoT1QihnnL1w+l ghM9x5DxV1p+ir4gXZnsK647P/7c+66/eaMtTq6OmxGvHvax/zq/gAHjLQfwXeWBrNOO 9Ku/ejhZepG1x8JmA1rMvnJbD/cJD6hrUSEEZRqXnXQx3T5NvJTOTWJRsVPQjCf5oqGe 8R9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=dSdpW81nx2ZMYTMRYGVAqF73yA+8yqW5N14k2LtHpUc=; b=FNtda195+mmgbVPgROPo2xwXTeYl3ZfnKBp9mGxp/KlzduG5meLm1VFTjUkAaGPnOG crSAlyczrA93xzHtHgoVEF7NKhn34EjykXoDrRX3zMVWE6fjDh7Z5943csbTvxsSL5fK FXHQNSEJoyJ8/46t0B+hOocWMFw+NKEnt1mgtE5EaGly9YHSs4QmusQ+zzlBm4vn2KrA L/5J+RycBaEStRdwmj7hFJDMrlfFhFtEFBDMiLyjqdYk80g06vryZJpnLQYZKpoQOJnM F+Yy8aTc/3LWDHXtHvOj52tTeuLoKma5yn0uOYF4Zi2McNryMnuXvf/COAIsA0DilFA3 tocA== X-Gm-Message-State: AOAM531khSJhCd9SLyz+g6gkiOrn6WvuGviwZUPieL8TIbI+9WRXr2LC jWEet4pDcpINgD1MzXEGbRpkoA== X-Received: by 2002:a05:6a00:1707:b029:18a:a5f1:6809 with SMTP id h7-20020a056a001707b029018aa5f16809mr20859094pfc.77.1604482433232; Wed, 04 Nov 2020 01:33:53 -0800 (PST) Received: from localhost ([122.172.12.172]) by smtp.gmail.com with ESMTPSA id s19sm1704573pfe.26.2020.11.04.01.33.51 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Nov 2020 01:33:52 -0800 (PST) Date: Wed, 4 Nov 2020 15:03:49 +0530 From: Viresh Kumar To: Jon Hunter Cc: "Rafael J . Wysocki" , Thierry Reding , Sumit Gupta , linux-pm@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] cpufreq: tegra186: Fix get frequency callback Message-ID: <20201104093349.l3r3eftwyvaoqjf2@vireshk-i7> References: <20201103115514.547047-1-jonathanh@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201103115514.547047-1-jonathanh@nvidia.com> User-Agent: NeoMutt/20180716-391-311a52 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03-11-20, 11:55, Jon Hunter wrote: > Commit b89c01c96051 ("cpufreq: tegra186: Fix initial frequency") > implemented the CPUFREQ 'get' callback to determine the current > operating frequency for each CPU. This implementation used a simple > looked up to determine the current operating frequency. The problem > with this is that frequency table for different Tegra186 devices may > vary and so the default boot frequency for Tegra186 device may or may > not be present in the frequency table. If the default boot frequency is > not present in the frequency table, this causes the function > tegra186_cpufreq_get() to return 0 and in turn causes cpufreq_online() > to fail which prevents CPUFREQ from working. > > Fix this by always calculating the CPU frequency based upon the current > 'ndiv' setting for the CPU. Note that the CPU frequency for Tegra186 is > calculated by reading the current 'ndiv' setting, multiplying by the > CPU reference clock and dividing by a constant divisor. > > Fixes: b89c01c96051 ("cpufreq: tegra186: Fix initial frequency") > > Signed-off-by: Jon Hunter > --- > drivers/cpufreq/tegra186-cpufreq.c | 33 +++++++++++++++++++----------- > 1 file changed, 21 insertions(+), 12 deletions(-) Acked-by: Viresh Kumar Rafael: This needs to go in the next rc and so I am not applying it in my tree as this is the only fix I have for now. -- viresh