Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1553232ybh; Tue, 14 Jul 2020 00:27:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwf7zesymHdMoGHU4tm839zN74D8zW/yGNolw+aCOAGZxnM7FsNnpfD/retLoTNwvBnfevJ X-Received: by 2002:aa7:da90:: with SMTP id q16mr3069393eds.44.1594711636854; Tue, 14 Jul 2020 00:27:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594711636; cv=none; d=google.com; s=arc-20160816; b=v1tYarmdAJKvCjnPedCZtgtwwDaHFIwbMFzi9B5kSi/DAzSjfZUb8Y3D3zz5UuRNOt RecwCulzH2e0ZKeiH7xh/ybNPAoQ0+XzgkCyNoghJjK64O5JDT9IMp14Ngh7jGDh0tz0 V/gt9tXiNZpjR1vSlQAJVNKo3rTbAUW+xa6tpUBvDvR5dVu1R0yaltKyCUJMAOa/G046 ouCxyrcLRT46qKArxKv8bMMuefckHex6svPM2t74wB+JvnlLMO8GzSEHF1vSpko7n9ah yxWSrVY2XuDYHBVL5t4DwPhRQKx2lcl0JXMRBzlvlYtTAAWkjBJhrSM9/dZU1D+JHgxC YKaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=tZth7Y/1Zt4r7X56D1QfoSroo5wy+uKCt1xfia33abs=; b=R7IFFzAQKDb+l5ezDXXzhyoBNWsVMKMzON/YEqNfiy2HTIt75mYFEsRPcNtaUUVwjX s4Ow3dSxbBSWC4HxFvXTmoYOnmNvzRW+1PIuM8pZohuh/t3Gj4K+zkZwijeM+xzl+8qK Gqhjq7+4lMiE9FvSEpvTBYcaZUEH0iFgLrEIIt9y9x5/HSKjDyV2nmqI1n2xsIoZMAKV DHZgUyTiA7gafET7zYJEd/obswkTESaoUviEtoZ3ZwFYuyspgG6Uy3K1ysyiCW0LXlWJ SYlmyehroWfvrTaMesEHWmOYA1LcVO1PAZOIGnHiEtwDNc1EjHr9584+Si4q3TnZSdwl 36+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b="cYd9/1x8"; 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=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h5si10504643eji.26.2020.07.14.00.26.54; Tue, 14 Jul 2020 00:27:16 -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=@nvidia.com header.s=n1 header.b="cYd9/1x8"; 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=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725977AbgGNH0o (ORCPT + 99 others); Tue, 14 Jul 2020 03:26:44 -0400 Received: from hqnvemgate24.nvidia.com ([216.228.121.143]:13527 "EHLO hqnvemgate24.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725306AbgGNH0o (ORCPT ); Tue, 14 Jul 2020 03:26:44 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Tue, 14 Jul 2020 00:24:51 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Tue, 14 Jul 2020 00:26:43 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Tue, 14 Jul 2020 00:26:43 -0700 Received: from [10.26.72.103] (172.20.13.39) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 14 Jul 2020 07:26:42 +0000 Subject: Re: [PATCH 1/2] cpufreq: tegra186: Fix initial frequency To: Viresh Kumar CC: Thierry Reding , "Rafael J . Wysocki" , , References: <20200712100645.13927-1-jonathanh@nvidia.com> <20200713032554.cykywnygxln6ukrl@vireshk-i7> <3d6091f2-6b04-185f-6c23-e39a34b87877@nvidia.com> <20200714034635.2zdv3wzmftjg2t4a@vireshk-i7> From: Jon Hunter Message-ID: Date: Tue, 14 Jul 2020 08:26:39 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200714034635.2zdv3wzmftjg2t4a@vireshk-i7> X-Originating-IP: [172.20.13.39] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To HQMAIL107.nvidia.com (172.20.187.13) Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1594711491; bh=tZth7Y/1Zt4r7X56D1QfoSroo5wy+uKCt1xfia33abs=; h=X-PGP-Universal:Subject:To:CC:References:From:Message-ID:Date: User-Agent:MIME-Version:In-Reply-To:X-Originating-IP: X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=cYd9/1x8IOG/7Cbt/2SBVThW3A52KXxB0rGRifWa+q/f1NG4Vl5MRGjv3vcqslarC kZ1TvM16r/bLO8bh3vch4uDH2Dq5/GiCzud04FF94egLOdDh5/UyUhwU5c0QwTq11d lVc0vK1WeATMF4hKm54eJ572bLOcJjrI0Qna/jpVNlS0l7D5Zg82j4h8km0GZODnep w2UNwqhWiEZZjXaps7ldudd+1VjjURM3TT/g3cRjKvQHQZtE+qsWiliG+kMpDiZZ2H CztIWOx58saq5uk1XvM+mvpFNnZAYnJklKcVj/tRjuNk9oisIhdwNySDiqB3v4F3Ts UpKgmip/O2B6w== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 14/07/2020 04:46, Viresh Kumar wrote: > 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. OK, I can add a get callback. However, there are a few other drivers that set the current frequency in the init() and don't implement a get() callback ... drivers/cpufreq/pasemi-cpufreq.c drivers/cpufreq/ppc_cbe_cpufreq.c drivers/cpufreq/intel_pstate.c Jon -- nvpublic