From patchwork Fri Jan 9 09:54:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "pi-cheng.chen" X-Patchwork-Id: 42899 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A28B42055F for ; Fri, 9 Jan 2015 09:56:13 +0000 (UTC) Received: by mail-wi0-f198.google.com with SMTP id r20sf602996wiv.1 for ; Fri, 09 Jan 2015 01:56:12 -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:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=m9rxHYfj43D/zA498K3tboOJJ4cHSTU/SuvhX1NkhbU=; b=FJ5gatXSQFXB3P+8WHHLnvrG17SkKkDUunBCQB8qwGObLZPaHpasRrEhfI02WM84oc Uri2Ovj8dyw665jQlOvMzrnHkABTD2jjtE1t5f7EcwLQ30lirw/Z1uwH/IQ9IyWHUsJS MISJn0RrKETHC89xb3TZUyWs4hlYr6L+OGyg6G5Oc5XWGh7B2h+1SoML+NY04zU1y3pg UjmFCq/QqgZJreLK2jHrz7zQR4RY2sielbgceyKPud1ogt4y1x9sLA7DQUbtCvYjf3Vj yVVUfiisvFP3F96tnwgWYABAsLP4TNQgipH39JaFCM8rnL3YFH7HPxY5UJSUKlC171IE xDLA== X-Gm-Message-State: ALoCoQkn2f8y26Rs+SOFbIFI2nTkg0We2lto559iZP2O/oJpv4eEz5hbq/z8IptQ0WEt8m+XYYYQ X-Received: by 10.194.178.234 with SMTP id db10mr1847439wjc.2.1420797372961; Fri, 09 Jan 2015 01:56:12 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.203.136 with SMTP id kq8ls394920lac.84.gmail; Fri, 09 Jan 2015 01:56:12 -0800 (PST) X-Received: by 10.112.130.65 with SMTP id oc1mr20670946lbb.7.1420797372706; Fri, 09 Jan 2015 01:56:12 -0800 (PST) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com. [209.85.217.173]) by mx.google.com with ESMTPS id np9si12567886lbb.0.2015.01.09.01.56.12 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 09 Jan 2015 01:56:12 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) client-ip=209.85.217.173; Received: by mail-lb0-f173.google.com with SMTP id z12so7288562lbi.4 for ; Fri, 09 Jan 2015 01:56:12 -0800 (PST) X-Received: by 10.152.45.4 with SMTP id i4mr20716009lam.74.1420797372585; Fri, 09 Jan 2015 01:56:12 -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.9.200 with SMTP id c8csp280241lbb; Fri, 9 Jan 2015 01:56:11 -0800 (PST) X-Received: by 10.68.242.137 with SMTP id wq9mr22347889pbc.98.1420797370814; Fri, 09 Jan 2015 01:56:10 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j1si12771222pdf.156.2015.01.09.01.56.09; Fri, 09 Jan 2015 01:56:10 -0800 (PST) Received-SPF: none (google.com: linux-kernel-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 S1757380AbbAIJ4H (ORCPT + 27 others); Fri, 9 Jan 2015 04:56:07 -0500 Received: from mail-pa0-f45.google.com ([209.85.220.45]:37321 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756871AbbAIJzI (ORCPT ); Fri, 9 Jan 2015 04:55:08 -0500 Received: by mail-pa0-f45.google.com with SMTP id lf10so17619916pab.4 for ; Fri, 09 Jan 2015 01:55:07 -0800 (PST) X-Received: by 10.70.38.161 with SMTP id h1mr22455183pdk.97.1420797307861; Fri, 09 Jan 2015 01:55:07 -0800 (PST) Received: from localhost.localdomain ([124.219.30.17]) by mx.google.com with ESMTPSA id fz15sm6622085pdb.71.2015.01.09.01.55.03 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Jan 2015 01:55:06 -0800 (PST) From: "pi-cheng.chen" To: "Rafael J. Wysocki" , Viresh Kumar , Matthias Brugger , Thomas Petazzoni Cc: "pi-cheng.chen" , linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Mike Turquette , linaro-kernel@lists.linaro.org, Eddie Huang , Yingjoe Chen Subject: [PATCH 1/2] cpufreq-dt: check CPU clock/power domain during initializing Date: Fri, 9 Jan 2015 17:54:50 +0800 Message-Id: <1420797291-15972-2-git-send-email-pi-cheng.chen@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1420797291-15972-1-git-send-email-pi-cheng.chen@linaro.org> References: <1420797291-15972-1-git-send-email-pi-cheng.chen@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: pi-cheng.chen@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.217.173 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: , Currently the DT based cpufreq driver is missing some way to check which CPUs share clocks. In the 1st patch, CPU clock/power domain information is added to the platform_data of cpufreq-dt so that cpufreq-dt driver could check which CPUs share clock/power. Signed-off-by: pi-cheng.chen --- drivers/cpufreq/cpufreq-dt.c | 15 +++++++++++++++ include/linux/cpufreq-dt.h | 6 ++++++ 2 files changed, 21 insertions(+) diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c index fde97d6..ff8c266 100644 --- a/drivers/cpufreq/cpufreq-dt.c +++ b/drivers/cpufreq/cpufreq-dt.c @@ -296,6 +296,21 @@ static int cpufreq_init(struct cpufreq_policy *policy) pd = cpufreq_get_driver_data(); if (!pd || !pd->independent_clocks) cpumask_setall(policy->cpus); + else if (pd && !list_empty(&pd->domain_list)) { + struct list_head *domain_node; + + list_for_each(domain_node, &pd->domain_list) { + struct cpufreq_cpu_domain *domain; + + domain = container_of(domain_node, + struct cpufreq_cpu_domain, node); + if (!cpumask_test_cpu(policy->cpu, &domain->cpus)) + continue; + + cpumask_copy(policy->cpus, &domain->cpus); + break; + } + } of_node_put(np); diff --git a/include/linux/cpufreq-dt.h b/include/linux/cpufreq-dt.h index 0414009..92bffd3 100644 --- a/include/linux/cpufreq-dt.h +++ b/include/linux/cpufreq-dt.h @@ -10,6 +10,11 @@ #ifndef __CPUFREQ_DT_H__ #define __CPUFREQ_DT_H__ +struct cpufreq_cpu_domain { + struct list_head node; + cpumask_t cpus; +}; + struct cpufreq_dt_platform_data { /* * True when each CPU has its own clock to control its @@ -17,6 +22,7 @@ struct cpufreq_dt_platform_data { * clock. */ bool independent_clocks; + struct list_head domain_list; }; #endif /* __CPUFREQ_DT_H__ */