Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3594199pxb; Mon, 16 Nov 2020 20:40:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJzOsSmi4DdCSeQbE9EMyRrA3vQfbS4jIn1ic4qSlUdeOGxqe7g0+DXWTINMuGU6Tw17wPzT X-Received: by 2002:aa7:df82:: with SMTP id b2mr18145242edy.251.1605588027402; Mon, 16 Nov 2020 20:40:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605588027; cv=none; d=google.com; s=arc-20160816; b=rFzy5673s6NtVsElx6FoaL/oajsNAtx+9sO+8SlaN9u4ZMVND3f9m46LGf22y0UeWt tQwhK2HRJ3wGoIBvt59YDbnairjaJNgb2KjE3vMYQhOHbLQqmdMW6d2mrEkEhd3RXoI6 gTEbL1i6B/uq6OXW7y3zTHatJPVUNDNi0FF6G0JpDC0NR6fAJbP8QrKGn1WcS34TVaTU RxuUmqVcrJ4jNtyR6QIBV5DdpG0QgQO87F9G3nEfWlftd6KjYHU/7CTDSsAOntiihb/T I/qo/o6Z8h9+ETZ1lnQjsG2rMqFpZ7KJQ4s9KZmJp2oBC/CwW/FHqWtqZcJMlw8Yf+TX i8Rw== 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=GXmmDGf+Ql390cIFcG7bVcYsBCCOZ8KyowjvFWUw4do=; b=j68tiRbvbQs/4tMNs7XTXLk9Gd4TUG2I70A7P3zCb4jjlMHoSpdKMf7RZ4IGruYoPp oDncTL7vWZepOeYcWKLG4x7bNadzkU7PIgTU1JQIqbS/ejudekQontzi+q2FNT/uH4RL C9mCkdGth5zAxeljLpU5cRrML7ujAo4QrMytDbc618SDKhvSunBRLiw6mUXVGwATfNzq /QuR8Ft7CsuNfutdoOE+A/aM3r/9NRm0yQ4FJryJuwTSUL2M67KD7JkFDOprlcg1faIU 3E03tuUI32eqiCyH7QJVssI7QFyljL6gY9TWYvU/vfpS5VqfZuwztWU3FybF2sCCESlj 0PnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=W5MwZyGZ; 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 ch5si13249427edb.190.2020.11.16.20.40.04; Mon, 16 Nov 2020 20:40:27 -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=W5MwZyGZ; 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 S1727220AbgKQEgE (ORCPT + 99 others); Mon, 16 Nov 2020 23:36:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726211AbgKQEgE (ORCPT ); Mon, 16 Nov 2020 23:36:04 -0500 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B256C0613CF for ; Mon, 16 Nov 2020 20:36:03 -0800 (PST) Received: by mail-pg1-x543.google.com with SMTP id f18so15211427pgi.8 for ; Mon, 16 Nov 2020 20:36:03 -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=GXmmDGf+Ql390cIFcG7bVcYsBCCOZ8KyowjvFWUw4do=; b=W5MwZyGZouVl3P4IMf7TuS8nrhz1X2sfj6Tx5PDGw7b8zEslxsX4DD6Wc/d3f63Lh9 jWuWdWnKjhrPsWfHRRG4PBQGyGJ4gARr+xcJ+fDBV10gD9O0ywrJctsAlOh+eCHYt380 bzwzHipfMZ9fWxQHyTTW7W0CgL6g9GyPCHhQvY/sn3Kci005p1xeb7svbNFUBnkQWB1K S+JbwwJ4vgukWB3zFnNPzpBUMctsk+ItOa1aYjRhg8WlLhJyOSmTgmXKb2rf4YVqLD4Q vWuVV9rzvNyzLsqVQjPtSXH9KpRlK9lLFOmSBLGMLYsu2xFhlCOYDC4j6PjH5ceqDKBB wqMQ== 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=GXmmDGf+Ql390cIFcG7bVcYsBCCOZ8KyowjvFWUw4do=; b=FR+yuafIZTPbyF8Wjv6lyik6d7ba7o4Ftn46mxhCGbs8j71FwxEILjcqVzk1ylH9db Zf6HWo5QF9cX+BT+lVOZzhkQ6UiVgkggBnDmAetmCQlsuzKHb5ZS5rgEqNDAsUbX3l0a L9cWlZc3dyC6SD+SCLbq5q2HRC6hIlHx54hU3/kqaO8ly5UhIKnppuog0J5P0y3oUXHP K84dtArcPZJJXTHpgV478qXLB9ORdZOFasOqEJ6cAPRfh90yT9VjVG3YXBVihE9OI9NJ un81VUCBnFBYzQK296BQ8uelaGLgq9RKyIEfZYwDh9pQw8Jlij3FxaUJrTPgNT51tYEg NNWA== X-Gm-Message-State: AOAM531WX/GBBRdtTj6t/Zl1t1f4kZUEhf75g5Wvm/BpSPJQCGwHpW0a zhRwI4GKb0ltOpofNgmu3W7FUQ== X-Received: by 2002:a17:90a:df93:: with SMTP id p19mr2783061pjv.170.1605587762764; Mon, 16 Nov 2020 20:36:02 -0800 (PST) Received: from localhost ([122.172.12.172]) by smtp.gmail.com with ESMTPSA id s21sm5726680pgm.65.2020.11.16.20.36.01 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Nov 2020 20:36:01 -0800 (PST) Date: Tue, 17 Nov 2020 10:06:00 +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: <20201117043600.bqzr3zmw6n7vj3fj@vireshk-i7> References: <20201103115514.547047-1-jonathanh@nvidia.com> <20201104093349.l3r3eftwyvaoqjf2@vireshk-i7> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716-391-311a52 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 16-11-20, 15:55, Jon Hunter wrote: > Hi Rafael, > > On 04/11/2020 09:33, Viresh Kumar wrote: > > 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. > > > Are you able to pick this up for v5.10 fixes? Applied to my tree now, will send a PULL request soon. -- viresh