From patchwork Thu Mar 9 11:45:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 95115 Delivered-To: patch@linaro.org Received: by 10.140.82.71 with SMTP id g65csp319740qgd; Thu, 9 Mar 2017 03:48:46 -0800 (PST) X-Received: by 10.99.67.6 with SMTP id q6mr13210955pga.156.1489060126514; Thu, 09 Mar 2017 03:48:46 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b128si6247598pfa.161.2017.03.09.03.48.46; Thu, 09 Mar 2017 03:48:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S932438AbdCILsp (ORCPT + 25 others); Thu, 9 Mar 2017 06:48:45 -0500 Received: from mail-pf0-f176.google.com ([209.85.192.176]:33696 "EHLO mail-pf0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932262AbdCILp7 (ORCPT ); Thu, 9 Mar 2017 06:45:59 -0500 Received: by mail-pf0-f176.google.com with SMTP id w189so28055303pfb.0 for ; Thu, 09 Mar 2017 03:45:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=2A74XnESQ3WL10JM/NNkjcDPGeQjnVPbJwdkHT2TOsQ=; b=EfBj+3jOm42Sa5wFQmboX1axVBnJzdZM1/6/PgJKR6RVuo15VswfG3r9fdUuHrjK0t CikWnIWGWyDQ6FB6OMOI11z6F2+og7elnrhmCxg0DsB1Kl2bepAywl/dN0Uc1RiJpjjJ 7M0R/IacDTOY4AmGsuT5WZjjdh38vy5oCcOUs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=2A74XnESQ3WL10JM/NNkjcDPGeQjnVPbJwdkHT2TOsQ=; b=Fv3SZnlJe2tG2mzOZceK249yrElQy3zj6UrmlANC5Yt86tgO6t7f8V5NvIqr6ADUNg 5CL0eJRhhRa5jU7uw5nGwotyU7o/HQvMeLl9kaFGl5mgwR+t0je3VnSLB3HdvgN/iP0y NkpZ1HN54nDKKruTYoRkI2n3oYXowvf4NZVD7RqhHkyaNNcLKZAaMoTG0h+ZwQBaP4WW /6tO6ikpojLHomowAiaofe1GHll9YkkHRS6grZbJM1TABqRu8iCZsJg11yg0G9BsXL1+ CjyOWC6WJcQ6QgsoeQodZKksLA+sgRwT5RvK5TENG0V+mmgOt+OgEpolP3AiNHQhgEXn EgcQ== X-Gm-Message-State: AMke39lHGYpjWCAoRT6E5EDD4Cm8nEXx+T5R6u5DMrsInNF8IF9lngP/PZ8GYkCUMikRWVem X-Received: by 10.99.213.81 with SMTP id v17mr12962941pgi.130.1489059948436; Thu, 09 Mar 2017 03:45:48 -0800 (PST) Received: from localhost ([122.171.239.200]) by smtp.gmail.com with ESMTPSA id 67sm12042232pfd.120.2017.03.09.03.45.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Mar 2017 03:45:47 -0800 (PST) From: Viresh Kumar To: Rafael Wysocki , Ingo Molnar , Peter Zijlstra , Viresh Kumar Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Vincent Guittot , smuckle.linux@gmail.com, juri.lelli@arm.com, Morten.Rasmussen@arm.com, patrick.bellasi@arm.com, eas-dev@lists.linaro.org Subject: [RFC 3/9] cpufreq: Add dvfs_possible_from_any_cpu policy flag Date: Thu, 9 Mar 2017 17:15:13 +0530 Message-Id: <4f57e9a7dddcd7e0f821c127cd4e9d87c5807c6c.1489058244.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.7.1.410.g6faf27b In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On many platforms any CPU (from any cpufreq policy) can perform DVFS on behalf of other CPUs. Add a flag to identify such cpufreq policies. Also enable it for cpufreq-dt driver which is used only on ARM platforms currently. Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq-dt.c | 1 + include/linux/cpufreq.h | 9 +++++++++ 2 files changed, 10 insertions(+) -- 2.7.1.410.g6faf27b diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c index c943787d761e..e57b45f20544 100644 --- a/drivers/cpufreq/cpufreq-dt.c +++ b/drivers/cpufreq/cpufreq-dt.c @@ -274,6 +274,7 @@ static int cpufreq_init(struct cpufreq_policy *policy) transition_latency = CPUFREQ_ETERNAL; policy->cpuinfo.transition_latency = transition_latency; + policy->dvfs_possible_from_any_cpu = true; return 0; diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 87165f06a307..9490a314c515 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -120,6 +120,15 @@ struct cpufreq_policy { bool fast_switch_possible; bool fast_switch_enabled; + /* + * Remote DVFS flag (Not added to the driver structure as we don't want + * to access another structure from scheduler hotpath). + * + * Should be set if any CPU (from same or different policy) can do DVFS + * on behalf of any other CPU. + */ + bool dvfs_possible_from_any_cpu; + /* Cached frequency lookup from cpufreq_driver_resolve_freq. */ unsigned int cached_target_freq; int cached_resolved_idx;