From patchwork Thu Feb 19 11:32:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 44827 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1621E21554 for ; Thu, 19 Feb 2015 11:34:26 +0000 (UTC) Received: by mail-wi0-f200.google.com with SMTP id r20sf5193750wiv.3 for ; Thu, 19 Feb 2015 03:34:25 -0800 (PST) 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=WdEzH4FB/Awhxbg0tMLKFBnylcL1w/zfcuiEmHW54jI=; b=BDKet+zagIChyFrBIViSnJ0tKHrV2SwZGcOuWlvweOv0fK/xc0wKuAni2pyeeYHizT 0KLnPfxxq1rH7G+8WeDrJEBQnMSVrkOwwPsGLw3BHQPaW9Adw4/mP9AKqkUbNSv8s4av PBtWydND2axA8ifwwX+BBCe/BHlV9OT1mr9pDewfrU6PYgkw0DEGcJiBw0qRfD0aRoR2 G3XkHs4BG47A3lzK0iC3dK9lwJ99L79Isd7Ssv8yHF7wEx8kMrKHBzB6QoJkIi0YoTq1 dAcnNI5BG4oFy37PNL+fyIMEdQIK2D1ptldfRcoU2byNbai0SSUaU1qqQP0CQ1HEDk5Y UouQ== X-Gm-Message-State: ALoCoQmV8uC94kE+g9CaetoS4Is+wcaQO1UIvGKR+ZEZA41lWEkMrRwFJhDGPdjAw9cm3efK/sim X-Received: by 10.180.8.67 with SMTP id p3mr958180wia.7.1424345665422; Thu, 19 Feb 2015 03:34:25 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.116.9 with SMTP id js9ls147686lab.69.gmail; Thu, 19 Feb 2015 03:34:25 -0800 (PST) X-Received: by 10.152.23.233 with SMTP id p9mr3417434laf.123.1424345665245; Thu, 19 Feb 2015 03:34:25 -0800 (PST) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com. [209.85.215.45]) by mx.google.com with ESMTPS id am5si17023467lac.158.2015.02.19.03.34.25 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Feb 2015 03:34:25 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45; Received: by labms9 with SMTP id ms9so6933294lab.10 for ; Thu, 19 Feb 2015 03:34:25 -0800 (PST) X-Received: by 10.112.64.193 with SMTP id q1mr2519493lbs.88.1424345665155; Thu, 19 Feb 2015 03:34:25 -0800 (PST) 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.35.133 with SMTP id h5csp431856lbj; Thu, 19 Feb 2015 03:34:24 -0800 (PST) X-Received: by 10.70.90.107 with SMTP id bv11mr6653846pdb.87.1424345662564; Thu, 19 Feb 2015 03:34:22 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m4si12171655pdm.252.2015.02.19.03.34.21; Thu, 19 Feb 2015 03:34:22 -0800 (PST) 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 S1753450AbbBSLeT (ORCPT + 11 others); Thu, 19 Feb 2015 06:34:19 -0500 Received: from mail-pd0-f172.google.com ([209.85.192.172]:45020 "EHLO mail-pd0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753449AbbBSLeQ (ORCPT ); Thu, 19 Feb 2015 06:34:16 -0500 Received: by pdbnh10 with SMTP id nh10so8247287pdb.11 for ; Thu, 19 Feb 2015 03:34:15 -0800 (PST) X-Received: by 10.66.149.106 with SMTP id tz10mr7039729pab.90.1424345655746; Thu, 19 Feb 2015 03:34:15 -0800 (PST) Received: from localhost ([122.172.249.58]) by mx.google.com with ESMTPSA id pe9sm23413436pbb.57.2015.02.19.03.34.14 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 19 Feb 2015 03:34:14 -0800 (PST) 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, Viresh Kumar Subject: [PATCH V2 14/20] cpufreq: Track cpu managing sysfs kobjects separately Date: Thu, 19 Feb 2015 17:02:16 +0530 Message-Id: <58ae61a8e5c09f94140d68f3c081559823fa885f.1424345053.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.3.0.rc0.44.ga94655d 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.45 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 155e6ff2fa85..fff08145d9ff 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -981,7 +981,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); @@ -1200,6 +1200,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; @@ -1257,10 +1258,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)); @@ -1439,7 +1442,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 */