From patchwork Mon May 19 06:17:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 30361 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ig0-f197.google.com (mail-ig0-f197.google.com [209.85.213.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4CCFF20EAF for ; Mon, 19 May 2014 06:18:35 +0000 (UTC) Received: by mail-ig0-f197.google.com with SMTP id hn18sf10593124igb.0 for ; Sun, 18 May 2014 23:18:34 -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=HIVDAiLy0DnSHdnj5wTeBhEU/eoAwSXUp50kvYXgzUw=; b=APJbSi0e9t43tenTqye5u0/QKwxp5Jx5SyKEk/tviVrOlIeVlQhImG5L5i72I+J7ON bU5yLsLd+ev6//okawHuiFa7DiWmsPqbVUC/caOG4v4SS60iboXAz548kAPNfB9VzffD yFx6Hqb6OtSn7lyd/hJiH5S/Gu1JIcuebid7Hl4LqB/pSlSjIktea0kBfpxP26VRWXbV hx2eyxuSIWm9PPzJk0pigNsWitEr6QunugaX887g9SGWuFt2ya5K8QBgnGYQbfJwSe/x ly9r9Mus+1IT2MUXicfLukhAIZm3NlUXRuttM1lSGb9tAtoU2ApzJ7yfYwAIcZ7xf5+I P5QA== X-Gm-Message-State: ALoCoQneeAI/qGNeczBtXEl+pXnjwkZnoTraTNhC6mH2SwZXVBowJcUVWmmHE6iO1K7DHKYSVFQu X-Received: by 10.42.209.18 with SMTP id ge18mr13725360icb.7.1400480314729; Sun, 18 May 2014 23:18:34 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.36.148 with SMTP id p20ls1495869qgp.80.gmail; Sun, 18 May 2014 23:18:34 -0700 (PDT) X-Received: by 10.221.44.73 with SMTP id uf9mr12776629vcb.9.1400480314627; Sun, 18 May 2014 23:18:34 -0700 (PDT) Received: from mail-ve0-f173.google.com (mail-ve0-f173.google.com [209.85.128.173]) by mx.google.com with ESMTPS id tj4si3664485vdc.51.2014.05.18.23.18.34 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 18 May 2014 23:18:34 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.173 as permitted sender) client-ip=209.85.128.173; Received: by mail-ve0-f173.google.com with SMTP id pa12so5857347veb.4 for ; Sun, 18 May 2014 23:18:34 -0700 (PDT) X-Received: by 10.58.246.132 with SMTP id xw4mr15095826vec.2.1400480314535; Sun, 18 May 2014 23:18:34 -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.220.221.72 with SMTP id ib8csp223359vcb; Sun, 18 May 2014 23:18:34 -0700 (PDT) X-Received: by 10.68.249.195 with SMTP id yw3mr40134999pbc.134.1400480313072; Sun, 18 May 2014 23:18:33 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id xx4si18165141pab.114.2014.05.18.23.18.32; Sun, 18 May 2014 23:18:32 -0700 (PDT) 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 S1752875AbaESGSX (ORCPT + 27 others); Mon, 19 May 2014 02:18:23 -0400 Received: from mail-wi0-f169.google.com ([209.85.212.169]:39711 "EHLO mail-wi0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752845AbaESGSU (ORCPT ); Mon, 19 May 2014 02:18:20 -0400 Received: by mail-wi0-f169.google.com with SMTP id hi2so4656420wib.0 for ; Sun, 18 May 2014 23:18:18 -0700 (PDT) X-Received: by 10.180.92.103 with SMTP id cl7mr10969166wib.26.1400480298490; Sun, 18 May 2014 23:18:18 -0700 (PDT) Received: from localhost ([213.122.173.131]) by mx.google.com with ESMTPSA id gd5sm12800730wjb.40.2014.05.18.23.18.14 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 18 May 2014 23:18:17 -0700 (PDT) From: Viresh Kumar To: rjw@rjwysocki.net Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, arvind.chauhan@arm.com, inderpal.s@samsung.com, pavel@ucw.cz, nm@ti.com, chander.kashyap@linaro.org, Viresh Kumar , Shawn Guo Subject: [PATCH 3/5] cpufreq: imx6q: don't initialize opp table Date: Mon, 19 May 2014 11:47:23 +0530 Message-Id: X-Mailer: git-send-email 2.0.0.rc2 In-Reply-To: References: In-Reply-To: References: 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: 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.128.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: , OPP tables are already initialized for CPU0 by cpufreq core and so we don't need to reinitialize them from imx6q specific code. Cc: Shawn Guo Signed-off-by: Viresh Kumar --- arch/arm/mach-imx/mach-imx6q.c | 36 ++++++++---------------------------- drivers/cpufreq/imx6q-cpufreq.c | 20 +------------------- 2 files changed, 9 insertions(+), 47 deletions(-) diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c index e60456d..03819e7 100644 --- a/arch/arm/mach-imx/mach-imx6q.c +++ b/arch/arm/mach-imx/mach-imx6q.c @@ -290,12 +290,18 @@ static void __init imx6q_init_machine(void) #define OCOTP_CFG3_SPEED_996MHZ 0x2 #define OCOTP_CFG3_SPEED_852MHZ 0x1 -static void __init imx6q_opp_check_speed_grading(struct device *cpu_dev) +static void __init imx6q_opp_check_speed_grading(void) { + struct device *cpu_dev = get_cpu_device(0); struct device_node *np; void __iomem *base; u32 val; + if (!cpu_dev) { + pr_warn("failed to get cpu0 device\n"); + return; + } + np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-ocotp"); if (!np) { pr_warn("failed to find ocotp node\n"); @@ -336,32 +342,6 @@ put_node: of_node_put(np); } -static void __init imx6q_opp_init(void) -{ - struct device_node *np; - struct device *cpu_dev = get_cpu_device(0); - - if (!cpu_dev) { - pr_warn("failed to get cpu0 device\n"); - return; - } - np = of_node_get(cpu_dev->of_node); - if (!np) { - pr_warn("failed to find cpu0 node\n"); - return; - } - - if (of_init_opp_table(cpu_dev)) { - pr_warn("failed to init OPP table\n"); - goto put_node; - } - - imx6q_opp_check_speed_grading(cpu_dev); - -put_node: - of_node_put(np); -} - static struct platform_device imx6q_cpufreq_pdev = { .name = "imx6q-cpufreq", }; @@ -376,7 +356,7 @@ static void __init imx6q_init_late(void) imx6q_cpuidle_init(); if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ)) { - imx6q_opp_init(); + imx6q_opp_check_speed_grading(); platform_device_register(&imx6q_cpufreq_pdev); } } diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c index e27fca8..c4c4e70 100644 --- a/drivers/cpufreq/imx6q-cpufreq.c +++ b/drivers/cpufreq/imx6q-cpufreq.c @@ -191,26 +191,8 @@ static int imx6q_cpufreq_probe(struct platform_device *pdev) goto put_node; } - /* - * We expect an OPP table supplied by platform. - * Just, incase the platform did not supply the OPP - * table, it will try to get it. - */ num = dev_pm_opp_get_opp_count(cpu_dev); - if (num < 0) { - ret = of_init_opp_table(cpu_dev); - if (ret < 0) { - dev_err(cpu_dev, "failed to init OPP table: %d\n", ret); - goto put_node; - } - - num = dev_pm_opp_get_opp_count(cpu_dev); - if (num < 0) { - ret = num; - dev_err(cpu_dev, "no OPP table is found: %d\n", ret); - goto put_node; - } - } + WARN_ON(num < 0); ret = dev_pm_opp_init_cpufreq_table(cpu_dev, &freq_table); if (ret) {