From patchwork Mon Mar 2 17:17:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javi Merino X-Patchwork-Id: 5916021 X-Patchwork-Delegate: eduardo.valentin@ti.com Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9BA1B9F380 for ; Mon, 2 Mar 2015 17:19:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C581A201CE for ; Mon, 2 Mar 2015 17:19:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C9E67201B9 for ; Mon, 2 Mar 2015 17:19:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755860AbbCBRSm (ORCPT ); Mon, 2 Mar 2015 12:18:42 -0500 Received: from foss.arm.com ([217.140.101.70]:48002 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755781AbbCBRSl (ORCPT ); Mon, 2 Mar 2015 12:18:41 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2FB992A; Mon, 2 Mar 2015 09:18:59 -0800 (PST) Received: from collaborate-mta1.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTP id DEBF73F5FA; Mon, 2 Mar 2015 09:18:40 -0800 (PST) Received: from e104805.cambridge.arm.com (e104805.cambridge.arm.com [10.2.131.108]) by collaborate-mta1.arm.com (Postfix) with SMTP id BFFEC13F815; Mon, 2 Mar 2015 11:18:36 -0600 (CST) Received: by e104805.cambridge.arm.com (sSMTP sendmail emulation); Mon, 02 Mar 2015 17:18:36 +0000 From: Javi Merino To: edubezval@gmail.com, rui.zhang@intel.com Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, punit.agrawal@arm.com, lina.iyer@linaro.org, broonie@kernel.org, tixy@linaro.org, Javi Merino , Viresh Kumar , "Rafael J. Wysocki" Subject: [PATCH v3 4/5] Revert "cpufreq: remove CPUFREQ_UPDATE_POLICY_CPU notifications" Date: Mon, 2 Mar 2015 17:17:22 +0000 Message-Id: <1425316643-31991-5-git-send-email-javi.merino@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1425316643-31991-1-git-send-email-javi.merino@arm.com> References: <1425316643-31991-1-git-send-email-javi.merino@arm.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This reverts commit d9f354460db8 ("cpufreq: remove CPUFREQ_UPDATE_POLICY_CPU notifications"). When the lead cpu of a group of cpus managed by cpufreq is hotplugged out, the cpu device cached in drivers/thermal/cpu_cooling.c needs to be updated accordingly. Bring back the CPUFREQ_UPDATE_POLICY_CPU notifier so that we can react to it. Cc: Viresh Kumar Cc: Rafael J. Wysocki Signed-off-by: Javi Merino --- Hi Viresh, We just noticed that you removed this from v4.0-rc1 when we were planning on using it, that's why are reverting the patch. The user is introduced in the next patch: "[PATCH v3 5/5] thermal: cpu_cooling: update the cpu device when cpufreq updates the policy cpu". drivers/cpufreq/cpufreq.c | 3 +++ include/linux/cpufreq.h | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 28e59a48b35f..215147050c3d 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -1095,6 +1095,9 @@ static int update_policy_cpu(struct cpufreq_policy *policy, unsigned int cpu, policy->cpu = cpu; up_write(&policy->rwsem); + blocking_notifier_call_chain(&cpufreq_policy_notifier_list, + CPUFREQ_UPDATE_POLICY_CPU, policy); + return 0; } diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 2ee4888c1f47..7e1a389b4e92 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -368,8 +368,9 @@ static inline void cpufreq_resume(void) {} #define CPUFREQ_INCOMPATIBLE (1) #define CPUFREQ_NOTIFY (2) #define CPUFREQ_START (3) -#define CPUFREQ_CREATE_POLICY (4) -#define CPUFREQ_REMOVE_POLICY (5) +#define CPUFREQ_UPDATE_POLICY_CPU (4) +#define CPUFREQ_CREATE_POLICY (5) +#define CPUFREQ_REMOVE_POLICY (6) #ifdef CONFIG_CPU_FREQ int cpufreq_register_notifier(struct notifier_block *nb, unsigned int list);