From patchwork Tue Apr 25 10:27:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 9697901 X-Patchwork-Delegate: eduardo.valentin@ti.com 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 94A5F60224 for ; Tue, 25 Apr 2017 10:31:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7EE8B28614 for ; Tue, 25 Apr 2017 10:31:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 73E6428618; Tue, 25 Apr 2017 10:31:31 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, 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 297D728614 for ; Tue, 25 Apr 2017 10:31:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1946494AbdDYKbR (ORCPT ); Tue, 25 Apr 2017 06:31:17 -0400 Received: from mail-pg0-f51.google.com ([74.125.83.51]:36107 "EHLO mail-pg0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1429477AbdDYK2F (ORCPT ); Tue, 25 Apr 2017 06:28:05 -0400 Received: by mail-pg0-f51.google.com with SMTP id g2so26438507pge.3 for ; Tue, 25 Apr 2017 03:28:05 -0700 (PDT) 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=aToqOncvUb3fhanrOlGuMX2MgJIDAzomj2BarJDd/4s=; b=aNZ8zHE4qTngh387h+qN8t0QRc7oHu6+0O9b6sIons9azAd51neC/zhDvr9vu7uSx+ BANnaiS+BiuNkdF4YgbEoSAFhzhomGbvGRisgv5k2OLjEzCWK0nF3V+P2XsCdA3aFbmv rMlOdObnLAYHd9vYftYmDhwVw6eaVU5SY+s/8= 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=aToqOncvUb3fhanrOlGuMX2MgJIDAzomj2BarJDd/4s=; b=A0lcRvuZEQEdvQ3nplVeaKEOYaYO/OZi0806ylnYHQmel3hT1jcv429ifuD8BOsUXs kTqDq4oiOHmc3tpapH8SWNbXsCOoIvIfCmUwtOXMVRVq/dnpja5l+8mvFVGIDPMzRS4E n5VYVxtkTUfI8E8u3m0QsR6V1tGa3tFGJGmYx5XkrbZt3bq6wLruF7f45K23q71fq3wv ScHHMin5H1xZxTqLZs9+7hK7ZgD5W8YGzIwaWz0nSIEO5cT0+n7AUzJARNh0yBaG9/sQ nyyz81fSt1VYw+niNowkX+WowW1yri6HdVWhYYgoOydaRwDkRdre0AtMgQ/iGPxb4tON cEeA== X-Gm-Message-State: AN3rC/4K/ZAJnkCBwfs8h3YNOTcK8Hkh9PCLGzOragWG/OmwlNMFfZc0 eYtLvcaOoO3MDsTU/rRT7A== X-Received: by 10.99.123.7 with SMTP id w7mr14316476pgc.82.1493116079833; Tue, 25 Apr 2017 03:27:59 -0700 (PDT) Received: from localhost ([122.172.121.5]) by smtp.gmail.com with ESMTPSA id p28sm35773003pfd.53.2017.04.25.03.27.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Apr 2017 03:27:59 -0700 (PDT) From: Viresh Kumar To: Javi Merino , Zhang Rui , Eduardo Valentin , Lukasz Luba , Amit Daniel Kachhap , Viresh Kumar Cc: linaro-kernel@lists.linaro.org, Rafael Wysocki , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Vincent Guittot , Punit Agrawal Subject: [PATCH V4 09/17] thermal: cpu_cooling: store cpufreq policy Date: Tue, 25 Apr 2017 15:57:16 +0530 Message-Id: X-Mailer: git-send-email 2.12.0.432.g71c3a4f4ba37 In-Reply-To: References: In-Reply-To: References: 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 The cpufreq policy can be used by the cpu_cooling driver, lets store it in the cpufreq_cooling_device structure. Signed-off-by: Viresh Kumar Tested-by: Lukasz Luba --- drivers/thermal/cpu_cooling.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c index 55ff45c1e917..7dddc7443f5d 100644 --- a/drivers/thermal/cpu_cooling.c +++ b/drivers/thermal/cpu_cooling.c @@ -67,6 +67,7 @@ struct power_table { * registered. * @cdev: thermal_cooling_device pointer to keep track of the * registered cooling device. + * @policy: cpufreq policy. * @cpufreq_state: integer value representing the current state of cpufreq * cooling devices. * @clipped_freq: integer value representing the absolute value of the clipped @@ -91,6 +92,7 @@ struct power_table { struct cpufreq_cooling_device { int id; struct thermal_cooling_device *cdev; + struct cpufreq_policy *policy; unsigned int cpufreq_state; unsigned int clipped_freq; unsigned int max_level; @@ -760,6 +762,7 @@ __cpufreq_cooling_register(struct device_node *np, if (!cpufreq_cdev) return ERR_PTR(-ENOMEM); + cpufreq_cdev->policy = policy; num_cpus = cpumask_weight(policy->related_cpus); cpufreq_cdev->time_in_idle = kcalloc(num_cpus, sizeof(*cpufreq_cdev->time_in_idle),