Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp187057ybh; Sun, 12 Jul 2020 03:07:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxrWcZNYprv3PmlvTHGt45C48Vv32itrcDqYjTd97LXnrCaf+nxf2CK24Pymq0cxBtSx/nb X-Received: by 2002:a17:906:a44:: with SMTP id x4mr25101205ejf.193.1594548451779; Sun, 12 Jul 2020 03:07:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594548451; cv=none; d=google.com; s=arc-20160816; b=IVp6WVDTkRPccrLRnWjJ+gTPaockW4K60+kgpfCVY/E9tK9kdwvga1EgLxl0GieVip 1IaIrthCNJY7Cl+OKEF8c8RLU/45caIY0gtRkyggn5HBPIH+3iw9HnYa/qtSP7wXcSsC gT24P/kiDQheAssvSyAtTGM12In/n7eBo+5in2f/zwrmkHORBfwzatW8f/tlMWZRhEC1 W4ebnve3AwPofU5ZyYHSrmxRh6wAHhDMOPAsTeqoI0LLroJBwDWt79MPtr1g14sCMKF6 sqc81pJcmBrqqhlEKx+GnaOcv1rYAqjMIHcGVzMGpjsefNEazbRDftudFoVuzV1JdCTY Wrcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:mime-version:message-id :date:subject:cc:to:from; bh=efSfznaHRVOLPOniFGgvlT8Fr3h/o5mTkr8QrJEVayo=; b=S18L3hGDfxA926rTj886gf17TACkHqRbyEa/qmPIpN6MGNCtAVosxIYPhdDhoYuwCO OIaCLTRkCl565V2YrIoNdh/cHHlZtO+T8ddp9THUvce2ViY5vqqQWnzg0x7W1N02iJKN KbcBqUkw7gYFEDiw/PacM4yBFvE0w4GqlUrfCVr5LTBly41x3owHa8K1PLdBVLd0JpK1 CR4jkFtu77iagSPyZjOpnsZXCHE64vqjQE0L9nk1apYbucZlOFMB72bdZOrI4xn5AtNN JH7wHsUc2Irr3Lv5tDGX9VXVPdrhOr5sZRrrqZt0ramEcfaMN3bRcyffyh6iRrSFpyO3 KZQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=HqmEWCRm; 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 gj24si7348140ejb.139.2020.07.12.03.07.08; Sun, 12 Jul 2020 03:07:31 -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=HqmEWCRm; 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 S1728730AbgGLKGz (ORCPT + 99 others); Sun, 12 Jul 2020 06:06:55 -0400 Received: from hqnvemgate24.nvidia.com ([216.228.121.143]:5760 "EHLO hqnvemgate24.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728675AbgGLKGy (ORCPT ); Sun, 12 Jul 2020 06:06:54 -0400 Received: from hqpgpgate102.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Sun, 12 Jul 2020 03:05:03 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate102.nvidia.com (PGP Universal service); Sun, 12 Jul 2020 03:06:54 -0700 X-PGP-Universal: processed; by hqpgpgate102.nvidia.com on Sun, 12 Jul 2020 03:06:54 -0700 Received: from HQMAIL107.nvidia.com (172.20.187.13) by HQMAIL105.nvidia.com (172.20.187.12) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Sun, 12 Jul 2020 10:06:53 +0000 Received: from hqnvemgw03.nvidia.com (10.124.88.68) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Sun, 12 Jul 2020 10:06:54 +0000 Received: from moonraker.nvidia.com (Not Verified[10.26.75.246]) by hqnvemgw03.nvidia.com with Trustwave SEG (v7,5,8,10121) id ; Sun, 12 Jul 2020 03:06:53 -0700 From: Jon Hunter To: Thierry Reding CC: "Rafael J . Wysocki" , Viresh Kumar , , , Jon Hunter Subject: [PATCH 1/2] cpufreq: tegra186: Fix initial frequency Date: Sun, 12 Jul 2020 11:06:44 +0100 Message-ID: <20200712100645.13927-1-jonathanh@nvidia.com> X-Mailer: git-send-email 2.17.1 X-NVConfidentiality: public MIME-Version: 1.0 Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1594548303; bh=efSfznaHRVOLPOniFGgvlT8Fr3h/o5mTkr8QrJEVayo=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: X-NVConfidentiality:MIME-Version:Content-Type; b=HqmEWCRmNF6QaGG4iBINeBvBO7pjoiu4upmffuxhYh9vCgKecx95JbhuArhBIQSB8 FUujT2hTtPVPoPsNShBlI/O4E3mHVljRHXmK70nMVDi0ivnBqlRweO2ZmqBZJHYDSQ gz78o2MpSpFgL8HsurGCd0PidH1tGzE9apZmDV/S3Kbf1ZRPiV9PJouXNs5qPI1wnA YmpLkBoNfhfRvQQ3krPn1ZCuNIi8S5OxhQs8gw7VAN8oMcnBFhSMGZiJw6wRK9/c15 K6BJybO3FSvhSoCraWu1qXJcz+LwWdFfAUb0S7Y48WlP/UCsfVwUBNBjbKN2v8+Xk1 vQGJp1NqfHpbA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. So for Tegra186 the simplest way to fix this is read the register that sets the frequency for each CPU and set the initial frequency when initialising the CPUFREQ driver. Signed-off-by: Jon Hunter --- drivers/cpufreq/tegra186-cpufreq.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/cpufreq/tegra186-cpufreq.c b/drivers/cpufreq/tegra186-cpufreq.c index 3d2f143748ef..c44190ce3f03 100644 --- a/drivers/cpufreq/tegra186-cpufreq.c +++ b/drivers/cpufreq/tegra186-cpufreq.c @@ -59,6 +59,7 @@ static int tegra186_cpufreq_init(struct cpufreq_policy *policy) struct tegra186_cpufreq_cluster *cluster = &data->clusters[i]; const struct tegra186_cpufreq_cluster_info *info = cluster->info; + u32 edvd_val; int core; for (core = 0; core < ARRAY_SIZE(info->cpus); core++) { @@ -71,6 +72,13 @@ static int tegra186_cpufreq_init(struct cpufreq_policy *policy) policy->driver_data = data->regs + info->offset + EDVD_CORE_VOLT_FREQ(core); policy->freq_table = cluster->table; + + edvd_val = readl(policy->driver_data); + + for (i = 0; cluster->table[i].frequency != CPUFREQ_TABLE_END; i++) { + if (cluster->table[i].driver_data == edvd_val) + policy->cur = cluster->table[i].frequency; + } break; } -- 2.17.1