From patchwork Thu Jun 16 05:35:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Courbot X-Patchwork-Id: 9179845 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0592B60776 for ; Thu, 16 Jun 2016 05:36:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EC4BB27D45 for ; Thu, 16 Jun 2016 05:36:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E11872804C; Thu, 16 Jun 2016 05:36:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 97BF127D45 for ; Thu, 16 Jun 2016 05:36:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751830AbcFPFfu (ORCPT ); Thu, 16 Jun 2016 01:35:50 -0400 Received: from hqemgate16.nvidia.com ([216.228.121.65]:13440 "EHLO hqemgate16.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751246AbcFPFft (ORCPT ); Thu, 16 Jun 2016 01:35:49 -0400 Received: from hqnvupgp07.nvidia.com (Not Verified[216.228.121.13]) by hqemgate16.nvidia.com id ; Wed, 15 Jun 2016 22:35:31 -0700 Received: from HQMAIL106.nvidia.com ([172.20.12.94]) by hqnvupgp07.nvidia.com (PGP Universal service); Wed, 15 Jun 2016 22:32:13 -0700 X-PGP-Universal: processed; by hqnvupgp07.nvidia.com on Wed, 15 Jun 2016 22:32:13 -0700 Received: from DRHKMAIL103.nvidia.com (10.25.59.17) by HQMAIL106.nvidia.com (172.18.146.12) with Microsoft SMTP Server (TLS) id 15.0.1130.7; Thu, 16 Jun 2016 05:35:47 +0000 Received: from HQMAIL101.nvidia.com (172.20.187.10) by drhkmail103.nvidia.com (10.25.59.17) with Microsoft SMTP Server (TLS) id 15.0.1130.7; Thu, 16 Jun 2016 05:35:43 +0000 Received: from percival.nvidia.com (172.20.13.39) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1130.7 via Frontend Transport; Thu, 16 Jun 2016 05:35:41 +0000 From: Alexandre Courbot To: Viresh Kumar CC: , , , , Alexandre Courbot Subject: [PATCH RFC] Revert "cpufreq: dt: Identify cpu-sharing for platforms without operating-points-v2" Date: Thu, 16 Jun 2016 14:35:24 +0900 Message-ID: <20160616053524.19921-1-acourbot@nvidia.com> X-Mailer: git-send-email 2.8.3 X-NVConfidentiality: public MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This is not an actual request for revert, but rather for comments about the observed behavior since I am not really familiar with cpufreq. I am observing a serious performance regression on Jetson TK1 since 4.7-rc1: namely, moving windows under X would become unsufferably slow, and graphical performance under X in general is seriously degraded. After bisecting, I found the regression to be visible since commit 1530b9963eeb ("cpufreq: dt: Identify cpu-sharing for platforms without operating-points-v2") If I revert this commit, I noticed that the CPU frequency immediately jumps to a higher frequency once I start moving windows (resulting in a smooth and responsive action), whereas enabling this commit causes the CPU frequency to remain low (typically 204 Mhz) in that case, resulting in CPU-bound slowness. What happens is that with 1530b9963eeb applied, dev_pm_opp_get_sharing_cpus() returns zero causing the fallback variable to remain false, whereas without it opp_v1 is set to true. It is not clear to me whether this is a cpufreq issue or a Tegra issue, so I am posting this in the hope to get clarifications from either side. Thanks! --- drivers/cpufreq/cpufreq-dt.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c index 3957de801ae8..eef245cd4b7f 100644 --- a/drivers/cpufreq/cpufreq-dt.c +++ b/drivers/cpufreq/cpufreq-dt.c @@ -146,7 +146,7 @@ static int cpufreq_init(struct cpufreq_policy *policy) struct clk *cpu_clk; struct dev_pm_opp *suspend_opp; unsigned int transition_latency; - bool fallback = false; + bool opp_v1 = false; const char *name; int ret; @@ -166,16 +166,14 @@ static int cpufreq_init(struct cpufreq_policy *policy) /* Get OPP-sharing information from "operating-points-v2" bindings */ ret = dev_pm_opp_of_get_sharing_cpus(cpu_dev, policy->cpus); if (ret) { - if (ret != -ENOENT) - goto out_put_clk; - /* * operating-points-v2 not supported, fallback to old method of - * finding shared-OPPs for backward compatibility if the - * platform hasn't set sharing CPUs. + * finding shared-OPPs for backward compatibility. */ - if (dev_pm_opp_get_sharing_cpus(cpu_dev, policy->cpus)) - fallback = true; + if (ret == -ENOENT) + opp_v1 = true; + else + goto out_put_clk; } /* @@ -215,7 +213,7 @@ static int cpufreq_init(struct cpufreq_policy *policy) goto out_free_opp; } - if (fallback) { + if (opp_v1) { cpumask_setall(policy->cpus); /*