From patchwork Wed Apr 19 05:28:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 97589 Delivered-To: patch@linaro.org Received: by 10.140.109.52 with SMTP id k49csp159066qgf; Tue, 18 Apr 2017 22:30:37 -0700 (PDT) X-Received: by 10.98.155.20 with SMTP id r20mr1184694pfd.198.1492579837368; Tue, 18 Apr 2017 22:30:37 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 63si1298751pgi.231.2017.04.18.22.30.37; Tue, 18 Apr 2017 22:30:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-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-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-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 S1759722AbdDSFaf (ORCPT + 12 others); Wed, 19 Apr 2017 01:30:35 -0400 Received: from mail-pg0-f46.google.com ([74.125.83.46]:33449 "EHLO mail-pg0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759639AbdDSFae (ORCPT ); Wed, 19 Apr 2017 01:30:34 -0400 Received: by mail-pg0-f46.google.com with SMTP id 63so7405662pgh.0 for ; Tue, 18 Apr 2017 22:30:34 -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; bh=nF4eZx4La73PSvtYBBHwJfROyl8Bt2G7KZO3ltZ6t74=; b=C2wxQRXFSxsGvYmRAM2d556bj9LtnWxCTdqdnTEWKsyLVhq+bAX/ck9XtjWEy/Hppj 8MqEtwUgxnAwgoj4T0dyGDda527p1ZOaDtAhySw5mOGnOEI4sDCTR5xBkP3HwS+6rcEi s9NhNPIkQ29B5lXCQnS3jpKgPD+Jgc02RSUGY= 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; bh=nF4eZx4La73PSvtYBBHwJfROyl8Bt2G7KZO3ltZ6t74=; b=ByLrXJ2VEu7xWi0arc1a0Q2dNQeKam6L+KsmEt5/Pr3J7krSpopA6Zd9koS1QXiZ+d liwGM+IkPghp0ozazOC0SULVrlWo0614gnS9YQ6Vwy+cB3JEvrjo/WotTrOaq4ommMTs J7TH6nNE2/4fhQUbYfLbA3Cil5MzTT9D8nT3fBEa/4wZG6NcNSkapNT56X4WY7l+eTyi Z+3CamseTBAkoeWN1WBxz+JXjUVb9LZUlVwl58krPdCAr28WR9F/x/qaoZ0XBwjsG1GU +w/0mmxyAEmTaWXg+h6iKSLQYc+xE7giUl2yRgXBs/eQO29Q1iH9E6M9FOQXOXBbpRWU laGA== X-Gm-Message-State: AN3rC/73j/+m3MGYAHcyvd7jNFqcatnCHzOUqDOvEuWathpYMifMwvBM UDR9Z5HnPqWUzLS6 X-Received: by 10.98.62.9 with SMTP id l9mr1212830pfa.114.1492579833671; Tue, 18 Apr 2017 22:30:33 -0700 (PDT) Received: from localhost ([122.172.121.5]) by smtp.gmail.com with ESMTPSA id y28sm1672138pfk.16.2017.04.18.22.30.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Apr 2017 22:30:32 -0700 (PDT) From: Viresh Kumar To: Javi Merino , Zhang Rui , Eduardo Valentin , Lukasz Luba Cc: linaro-kernel@lists.linaro.org, Amit Daniel Kachhap , Rafael Wysocki , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Vincent Guittot , Punit Agrawal , Viresh Kumar Subject: [PATCH V3 00/17] thermal: cpu_cooling: improve interaction with cpufreq core Date: Wed, 19 Apr 2017 10:58:55 +0530 Message-Id: X-Mailer: git-send-email 2.12.0.432.g71c3a4f4ba37 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Hi Guys, The cpu_cooling driver is designed to use CPU frequency scaling to avoid high thermal states for a platform. But it wasn't glued really well with cpufreq core. For example clipped-cpus is copied from the policy structure and its much better to use the policy->cpus (or related_cpus) fields directly as they may have got updated. Not that things were broken before this series, but they can be optimized a bit more. This series tries to improve interactions between cpufreq core and cpu_cooling driver and does some fixes/cleanups to the cpu_cooling driver. I have tested it on ARM 32 (exynos) and 64 bit (hikey) boards and have pushed them for 0-day build bot and kernel CI testing as well. We should know if something is broken with these. @Lukasz: It would be good if you can give them a test, specially because of your work on the "power" specific bits in the driver. This series already has the improvements you suggested. Pushed here as well: git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm.git thermal/cooling V2->V3: - Additional check to guarantee that policy is valid. - Initialize freq-table and cpufreq_cdev->policy fields before they are used by the power-cooling functionality. - Thanks Lukasz for testing out and suggesting these changes. V1->V2: - Name cpufreq cooling dev as cpufreq_cdev everywhere (Eduardo). -- viresh Viresh Kumar (17): thermal: cpu_cooling: Avoid accessing potentially freed structures thermal: cpu_cooling: rearrange globals thermal: cpu_cooling: Name cpufreq cooling devices as cpufreq_cdev thermal: cpu_cooling: replace cool_dev with cdev thermal: cpu_cooling: remove cpufreq_cooling_get_level() thermal: cpu_cooling: get rid of a variable in cpufreq_set_cur_state() thermal: cpu_cooling: use cpufreq_policy to register cooling device cpufreq: create cpufreq_table_count_valid_entries() thermal: cpu_cooling: store cpufreq policy thermal: cpu_cooling: OPPs are registered for all CPUs thermal: cpu_cooling: get rid of 'allowed_cpus' thermal: cpu_cooling: merge frequency and power tables thermal: cpu_cooling: create structure for idle time stats thermal: cpu_cooling: get_level() can't fail thermal: cpu_cooling: don't store cpu_dev in cpufreq_cdev thermal: cpu_cooling: 'freq' can't be zero in cpufreq_state2power() thermal: cpu_cooling: Rearrange struct cpufreq_cooling_device drivers/cpufreq/arm_big_little.c | 2 +- drivers/cpufreq/cpufreq-dt.c | 2 +- drivers/cpufreq/cpufreq_stats.c | 13 +- drivers/cpufreq/dbx500-cpufreq.c | 2 +- drivers/cpufreq/mt8173-cpufreq.c | 4 +- drivers/cpufreq/qoriq-cpufreq.c | 3 +- drivers/thermal/cpu_cooling.c | 602 +++++++++------------ drivers/thermal/imx_thermal.c | 22 +- drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 22 +- include/linux/cpu_cooling.h | 32 +- include/linux/cpufreq.h | 14 + 11 files changed, 311 insertions(+), 407 deletions(-) -- 2.12.0.432.g71c3a4f4ba37