Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1458839ybh; Mon, 13 Jul 2020 20:49:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyAFgeArklxGFLaI33x4VFD1PQR0ApgklcgY8P8Zb5+q5FnkcW2VoOngGtmjpvkeuc8eyaA X-Received: by 2002:aa7:c3d6:: with SMTP id l22mr2484166edr.148.1594698574914; Mon, 13 Jul 2020 20:49:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594698574; cv=none; d=google.com; s=arc-20160816; b=QPbJ3hoA+xxmNz3q6oqU29urrRzVTJ4xXYmZZaKu2QHiCDuk+JYxHZ6iNAO86wX57w 0jc0AhNChugpD9pVThbmBr8Y00Z/KzmW7iuFLJcBzsTWFp/Kr+gj/WclmfzFqlUBMvJE zAiWxND9ENPyHgG2IASA9jUWVaudouYgDA5dM+jLi/UyGAxqS9xyh9aPtb8+t9UKt9t/ 9bGXSHMIg28R1msAANJ805csU2+PbobrpYcVVEJHEuaOdPu4Go65uLRLe/XVFu9VG7lh QNN8m4jbUlQfaurL9VdI4I/tzsfOMt+N6UvlZB/enE+rzHkRKeWraaFeURkp6oAnWKv4 BRlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=DLRiKT8ElQL4w9dBG1pNFf3WLE40Y4LTcfhyA4y89Qg=; b=v5T7S2JOuMfeCr6SkYYNEh8SIw0m/MzLyJCzfZK5VOIYLWRWpYS7ko/jW0WKocEUfn Ftt4ZvMcWERzTBdJjJyPJKjpJpvwF+Qu1MpQLcfFDFis0l1RsMLNDYTdMDCPkUeLNE5S rrH8DSnJEPHmhIGninyAGzeNZbHRQhXZ0A0RnSecJq4yQRncQBqSxGMuRzIh2SX27LRb WkTRpay1n4UrA4REB0xGwosfs4h1dc9bcdFVOAg+xsElBiZYTughdFzKH2Gy/KPDSSh1 Nfqh7uxxcc7a7hmk3YHr/TgClqvLlFFXY7/6kgtperW2g/tD6i0OEsUVDzzaJO9O5Y+n 5Gbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ErCujttn; 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 z22si9485030edr.357.2020.07.13.20.49.11; Mon, 13 Jul 2020 20:49:34 -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=@linaro.org header.s=google header.b=ErCujttn; 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 S1726736AbgGNDqk (ORCPT + 99 others); Mon, 13 Jul 2020 23:46:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726505AbgGNDqj (ORCPT ); Mon, 13 Jul 2020 23:46:39 -0400 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 7F3D3C061794 for ; Mon, 13 Jul 2020 20:46:39 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id t6so7008435pgq.1 for ; Mon, 13 Jul 2020 20:46:39 -0700 (PDT) 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=DLRiKT8ElQL4w9dBG1pNFf3WLE40Y4LTcfhyA4y89Qg=; b=ErCujttnnbjTupMWYjrWFgnPa1oXUoINHMPQBlPbtAnMaDXkLDbtWq/V+Ugy3P31v9 kHcJD5sAtUisZHts9jZ6C+fj3CPgOweMZhm8K2+2q0Fj+/Fd56TdQOK3RIr+J7tXH5Kn gKB75yAzc8Oqp9WaojlhgtbOhjnxnmEbFhWTDVUuSwtfwOt7GYE+12BaMJWdBSP7vcuj aR9AdFjCaS3KhrTLPqNi5bXOojrdm82i532F8H4xOlpfTbEhHU0f3RMS4mQLiPFm6n0Q zfWygUQKn1A0eEK8J3+aLCc/+W//Q2+1tTk9b0nyrfITzsbQZmzlzm43hfb0kPvCRCCq c4Ig== 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=DLRiKT8ElQL4w9dBG1pNFf3WLE40Y4LTcfhyA4y89Qg=; b=mMow2isSHYzQ7klLhyAyKZzqU8Y4X8JKe+2JCwxlATXg4XYEFTHfn8iMQnxECciYsx DlIMo6hgEno41f3qyKeXxht4fsd4nqHlWJ2K/SGNk90e85iCF1KfaNkQOtTETry0i75u aIf8UCQsVWCt7sBzltxoW7cXI0aC1vRa4bncNUNmcJF+EcvwnQpbxwPdV8WZxSUXgyc8 LDbWYA6nf+Xcv4HGMNav5rWNd4UBuC4m20IoxXFge4INESaAirZC76oa0qSzRPdfc2En O2R+CqWAG5EoShVl5kD4RtpQ9vWmYC+Gjb929fAhwYpKkQjNaxGPgdGJ9JIQ6wjojH2I 33Zg== X-Gm-Message-State: AOAM5303kORqEHDVCiwYU9RdMe0JjHMDW/uXOONfgY5DRcwk+hV0XwWV Ix9dqg+yATozQXe75wL4tvsMCg== X-Received: by 2002:aa7:98c1:: with SMTP id e1mr2726090pfm.318.1594698398707; Mon, 13 Jul 2020 20:46:38 -0700 (PDT) Received: from localhost ([122.172.34.142]) by smtp.gmail.com with ESMTPSA id o2sm15692355pfh.160.2020.07.13.20.46.37 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Jul 2020 20:46:37 -0700 (PDT) Date: Tue, 14 Jul 2020 09:16:35 +0530 From: Viresh Kumar To: Jon Hunter Cc: Thierry Reding , "Rafael J . Wysocki" , linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] cpufreq: tegra186: Fix initial frequency Message-ID: <20200714034635.2zdv3wzmftjg2t4a@vireshk-i7> References: <20200712100645.13927-1-jonathanh@nvidia.com> <20200713032554.cykywnygxln6ukrl@vireshk-i7> <3d6091f2-6b04-185f-6c23-e39a34b87877@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3d6091f2-6b04-185f-6c23-e39a34b87877@nvidia.com> User-Agent: NeoMutt/20180716-391-311a52 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 13-07-20, 17:37, Jon Hunter wrote: > > On 13/07/2020 04:25, Viresh Kumar wrote: > > On 12-07-20, 11:06, Jon Hunter wrote: > >> Commit 6cc3d0e9a097 ("cpufreq: tegra186: add > >> CPUFREQ_NEED_INITIAL_FREQ_CHECK flag") fixed CPUFREQ support for > >> Tegra186 but as a consequence the following warnings are now seen on > >> boot ... > >> > >> cpufreq: cpufreq_online: CPU0: Running at unlisted freq: 0 KHz > >> cpufreq: cpufreq_online: CPU0: Unlisted initial frequency changed to: 2035200 KHz > >> cpufreq: cpufreq_online: CPU1: Running at unlisted freq: 0 KHz > >> cpufreq: cpufreq_online: CPU1: Unlisted initial frequency changed to: 2035200 KHz > >> cpufreq: cpufreq_online: CPU2: Running at unlisted freq: 0 KHz > >> cpufreq: cpufreq_online: CPU2: Unlisted initial frequency changed to: 2035200 KHz > >> cpufreq: cpufreq_online: CPU3: Running at unlisted freq: 0 KHz > >> cpufreq: cpufreq_online: CPU3: Unlisted initial frequency changed to: 2035200 KHz > >> cpufreq: cpufreq_online: CPU4: Running at unlisted freq: 0 KHz > >> cpufreq: cpufreq_online: CPU4: Unlisted initial frequency changed to: 2035200 KHz > >> cpufreq: cpufreq_online: CPU5: Running at unlisted freq: 0 KHz > >> cpufreq: cpufreq_online: CPU5: Unlisted initial frequency changed to: 2035200 KHz > >> > >> Although we could fix this by adding a 'get' operator for the Tegra186 > >> CPUFREQ driver, there is really little point because the CPUFREQ on > >> Tegra186 is set by writing a value stored in the frequency table to a > >> register and we just need to set the initial frequency. > > > > The hardware still runs at the frequency requested by cpufreq core here, right ? > > Yes. > > > It is better to provide the get() callback as it is also used to show the > > current frequency in userspace. > > I looked at that and I saw that if the get() callback is not provided, > the current frequency showed by userspace is policy->cur. For this > device, policy->cur is accurate and so if we added the get() callback we > essentially just going to return policy->cur. Therefore, given that we > already know policy->cur, I did not see the point in adding a device > specific handler to do the same thing. The get() callback is supposed to read the frequency from hardware and return it, no cached value here. policy->cur may end up being wrong in case there is a bug. -- viresh