From patchwork Fri May 8 06:23:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 48152 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D396E2121F for ; Fri, 8 May 2015 06:25:07 +0000 (UTC) Received: by wiun10 with SMTP id n10sf4261684wiu.1 for ; Thu, 07 May 2015 23:25:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:in-reply-to:references :sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=P9n3pOsYzGCOR7ijR/6Peit4yD3+Ghz4cboVJX6digc=; b=FNpgoikOZoGYcnK56tD+bShr8EuBP7+nbWZJyBA9iMbnHquzYOJxQ6LJxH2jt7pG6M st/m+662hA3lrtHFfakL/VfYGX4gnAaPe/7rm+qwZqMAwXXqhDoiN1Xua6ox4WQ0xnNK EyIbgT6EE10UfT6YvtbP7JFWBqVrlIE9gcQ143nPWWw8QsPCvIgAzoASDA2q/PVYwSxF uRHO3SD/UAi+bL2hM2Q0dCwPWACAkyb2clxAD+EP3zN58fl6bj6xYTqEAzvdtpBnWZvC H9N0cBCgjotNb3RCQVMRMbcbYI2FdG5bdLEvcdwjFgxIT86pqJHS0SOOJC3wqmsciUHz YaeA== X-Gm-Message-State: ALoCoQkP/sWTHcgVr9uKWYnjz8DWYWPPGlpZNt+DwKqfVXo/ZPoyIEVXOtjKGbIDYURCCBvPCMnL X-Received: by 10.112.142.170 with SMTP id rx10mr1223638lbb.12.1431066307166; Thu, 07 May 2015 23:25:07 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.30.74 with SMTP id q10ls310972lah.35.gmail; Thu, 07 May 2015 23:25:07 -0700 (PDT) X-Received: by 10.112.219.70 with SMTP id pm6mr1646178lbc.41.1431066307022; Thu, 07 May 2015 23:25:07 -0700 (PDT) Received: from mail-la0-f51.google.com (mail-la0-f51.google.com. [209.85.215.51]) by mx.google.com with ESMTPS id ev1si2694357lbc.0.2015.05.07.23.25.07 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 May 2015 23:25:07 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) client-ip=209.85.215.51; Received: by laat2 with SMTP id t2so45989939laa.1 for ; Thu, 07 May 2015 23:25:06 -0700 (PDT) X-Received: by 10.112.29.36 with SMTP id g4mr875192lbh.56.1431066306913; Thu, 07 May 2015 23:25:06 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp269293lbb; Thu, 7 May 2015 23:25:06 -0700 (PDT) X-Received: by 10.69.15.132 with SMTP id fo4mr3901396pbd.57.1431066305047; Thu, 07 May 2015 23:25:05 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t17si5783046pdi.227.2015.05.07.23.25.04; Thu, 07 May 2015 23:25:05 -0700 (PDT) Received-SPF: none (google.com: linux-pm-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751319AbbEHGZD (ORCPT + 11 others); Fri, 8 May 2015 02:25:03 -0400 Received: from mail-pd0-f176.google.com ([209.85.192.176]:35445 "EHLO mail-pd0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751384AbbEHGZC (ORCPT ); Fri, 8 May 2015 02:25:02 -0400 Received: by pdbqd1 with SMTP id qd1so66779128pdb.2 for ; Thu, 07 May 2015 23:25:02 -0700 (PDT) X-Received: by 10.70.30.193 with SMTP id u1mr3815474pdh.59.1431066284145; Thu, 07 May 2015 23:24:44 -0700 (PDT) Received: from localhost ([122.172.243.237]) by mx.google.com with ESMTPSA id om10sm3979275pbb.58.2015.05.07.23.24.42 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 07 May 2015 23:24:43 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, sboyd@codeaurora.org, prarit@redhat.com, skannan@codeaurora.org, Srivatsa Bhat , Viresh Kumar Subject: [PATCH V3 08/14] cpufreq: Track cpu managing sysfs kobjects separately Date: Fri, 8 May 2015 11:53:51 +0530 Message-Id: X-Mailer: git-send-email 2.4.0 In-Reply-To: References: In-Reply-To: References: Sender: linux-pm-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Saravana Kannan In order to prepare for the next few commits, that will stop migrating sysfs files on cpu hotplug, this patch starts managing sysfs-cpu separately. The behavior is still the same as we are still migrating sysfs files on hotplug, later commits would change that. Signed-off-by: Saravana Kannan Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq.c | 11 +++++++---- include/linux/cpufreq.h | 4 +++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 652a843a553b..75647c13a12b 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -982,7 +982,7 @@ static int cpufreq_add_dev_symlink(struct cpufreq_policy *policy) for_each_cpu(j, policy->cpus) { struct device *cpu_dev; - if (j == policy->cpu) + if (j == policy->kobj_cpu) continue; pr_debug("Adding link for CPU: %u\n", j); @@ -1201,6 +1201,7 @@ static int update_policy_cpu(struct cpufreq_policy *policy, unsigned int cpu, down_write(&policy->rwsem); policy->cpu = cpu; + policy->kobj_cpu = cpu; up_write(&policy->rwsem); return 0; @@ -1258,10 +1259,12 @@ static int cpufreq_add_dev(struct device *dev, struct subsys_interface *sif) * the creation of a brand new one. So we need to perform this update * by invoking update_policy_cpu(). */ - if (recover_policy && cpu != policy->cpu) + if (recover_policy && cpu != policy->cpu) { WARN_ON(update_policy_cpu(policy, cpu, dev)); - else + } else { policy->cpu = cpu; + policy->kobj_cpu = cpu; + } cpumask_copy(policy->cpus, cpumask_of(cpu)); @@ -1440,7 +1443,7 @@ static int __cpufreq_remove_dev_prepare(struct device *dev, CPUFREQ_NAME_LEN); up_write(&policy->rwsem); - if (cpu != policy->cpu) { + if (cpu != policy->kobj_cpu) { sysfs_remove_link(&dev->kobj, "cpufreq"); } else if (cpus > 1) { /* Nominate new CPU */ diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 48e37c07eb84..29ad97c34fd5 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -65,7 +65,9 @@ struct cpufreq_policy { unsigned int shared_type; /* ACPI: ANY or ALL affected CPUs should set cpufreq */ - unsigned int cpu; /* cpu nr of CPU managing this policy */ + unsigned int cpu; /* cpu managing this policy, must be online */ + unsigned int kobj_cpu; /* cpu managing sysfs files, can be offline */ + struct clk *clk; struct cpufreq_cpuinfo cpuinfo;/* see above */