From patchwork Wed Jul 2 04:03: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: 32939 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f198.google.com (mail-qc0-f198.google.com [209.85.216.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D8DFA20672 for ; Wed, 2 Jul 2014 04:03:43 +0000 (UTC) Received: by mail-qc0-f198.google.com with SMTP id m20sf24753328qcx.9 for ; Tue, 01 Jul 2014 21:03:43 -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:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=mUWEa/ZzGmhH13OtdeZLis6S5V7vm+a19VsgKBiqv5M=; b=iGc+pLLsEMPzzEJYo5xwbds/B+oPT/7wdp6KS98d/5kS5Tz4yVynZmXpzqYyek+Dj4 wi+yrRMVAgqc1gthtguuTKM9ZYReANjY69s5fRRl+HE1Ae3zbJhy8CPtw+ocCxRj6QXv OgsrCXJUcPGn7L1Eg034VMuxIOhtr/2VW61VMoHMe+rIy0/co28MJnjZ2xR0AwRylUVc sQWtim3GHv9kcrLAWUFUwkMXQJAH8BiFqSt6DQfVmspjX2mpMDcpUoSW4yinkSQSLjoE r3ux996NgZHFUfRDSy5EqRFV7J211xn6n0Ub1ijPqXg8AiXutYTiTjP4XY4clykatR2Y LyCg== X-Gm-Message-State: ALoCoQl72mUIAy2vVKtMiuZoampGCQjwL8TFJ3hwCeHjI1QIh9uGTeHx0RYno6epIWxa3f9ozASI X-Received: by 10.58.230.103 with SMTP id sx7mr2023750vec.33.1404273823297; Tue, 01 Jul 2014 21:03:43 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.33.202 with SMTP id j68ls2412209qgj.28.gmail; Tue, 01 Jul 2014 21:03:43 -0700 (PDT) X-Received: by 10.220.103.141 with SMTP id k13mr47143811vco.25.1404273823109; Tue, 01 Jul 2014 21:03:43 -0700 (PDT) Received: from mail-ve0-f179.google.com (mail-ve0-f179.google.com [209.85.128.179]) by mx.google.com with ESMTPS id w4si12352639vct.72.2014.07.01.21.03.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 01 Jul 2014 21:03:43 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.179 as permitted sender) client-ip=209.85.128.179; Received: by mail-ve0-f179.google.com with SMTP id sa20so10721404veb.10 for ; Tue, 01 Jul 2014 21:03:43 -0700 (PDT) X-Received: by 10.52.23.71 with SMTP id k7mr39651246vdf.27.1404273822995; Tue, 01 Jul 2014 21:03:42 -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.221.37.5 with SMTP id tc5csp264200vcb; Tue, 1 Jul 2014 21:03:42 -0700 (PDT) X-Received: by 10.68.106.101 with SMTP id gt5mr47048434pbb.134.1404273822233; Tue, 01 Jul 2014 21:03:42 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fl3si28940737pab.165.2014.07.01.21.03.41; Tue, 01 Jul 2014 21:03:41 -0700 (PDT) Received-SPF: none (google.com: linux-arm-msm-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 S1750871AbaGBEDk (ORCPT + 3 others); Wed, 2 Jul 2014 00:03:40 -0400 Received: from mail-qg0-f47.google.com ([209.85.192.47]:55651 "EHLO mail-qg0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750757AbaGBEDj (ORCPT ); Wed, 2 Jul 2014 00:03:39 -0400 Received: by mail-qg0-f47.google.com with SMTP id q108so4167811qgd.20 for ; Tue, 01 Jul 2014 21:03:38 -0700 (PDT) X-Received: by 10.224.129.68 with SMTP id n4mr79601346qas.66.1404273818811; Tue, 01 Jul 2014 21:03:38 -0700 (PDT) Received: from localhost (ec2-23-23-178-99.compute-1.amazonaws.com. [23.23.178.99]) by mx.google.com with ESMTPSA id b10sm15524355qgf.7.2014.07.01.21.03.32 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 01 Jul 2014 21:03:38 -0700 (PDT) From: Viresh Kumar To: rjw@rjwysocki.net, shawn.guo@linaro.org Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, arvind.chauhan@arm.com, sboyd@codeaurora.org, linux-arm-msm@vger.kernel.org, spk.linux@gmail.com, thomas.ab@samsung.com, nm@ti.com, t.figa@samsung.com, Viresh Kumar Subject: [PATCH V2 Resend 07/14] cpufreq: cpu0: OPPs can be populated at runtime Date: Wed, 2 Jul 2014 09:33:23 +0530 Message-Id: X-Mailer: git-send-email 2.0.0.rc2 In-Reply-To: <1ba7771e910084cd0820c19ca5994fe1b3d6451d.1404231535.git.viresh.kumar@linaro.org> References: Sender: linux-arm-msm-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-arm-msm@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.179 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: , OPPs can be populated statically, via DT, or added at run time with dev_pm_opp_add(). While this driver handles the first case correctly, it would fail to populate OPPs added at runtime. Because call to of_init_opp_table() would fail as there are no OPPs in DT and probe will return early. To fix this, remove error checking and call dev_pm_opp_init_cpufreq_table() unconditionally. Update bindings as well. Suggested-by: Stephen Boyd Signed-off-by: Viresh Kumar --- V2 Resend: Update bindings as well Documentation/devicetree/bindings/cpufreq/cpufreq-cpu0.txt | 6 ++++-- drivers/cpufreq/cpufreq-cpu0.c | 7 ++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Documentation/devicetree/bindings/cpufreq/cpufreq-cpu0.txt b/Documentation/devicetree/bindings/cpufreq/cpufreq-cpu0.txt index f055515..366690c 100644 --- a/Documentation/devicetree/bindings/cpufreq/cpufreq-cpu0.txt +++ b/Documentation/devicetree/bindings/cpufreq/cpufreq-cpu0.txt @@ -8,10 +8,12 @@ Both required and optional properties listed below must be defined under node /cpus/cpu@0. Required properties: -- operating-points: Refer to Documentation/devicetree/bindings/power/opp.txt - for details +- None Optional properties: +- operating-points: Refer to Documentation/devicetree/bindings/power/opp.txt for + details. OPPs *must* be supplied either via DT, i.e. this property, or + populated at runtime. - clock-latency: Specify the possible maximum transition latency for clock, in unit of nanoseconds. - voltage-tolerance: Specify the CPU voltage tolerance in percentage. diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.c index b5b8e1c..f47f703 100644 --- a/drivers/cpufreq/cpufreq-cpu0.c +++ b/drivers/cpufreq/cpufreq-cpu0.c @@ -164,11 +164,8 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev) goto out_put_reg; } - ret = of_init_opp_table(cpu_dev); - if (ret) { - pr_err("failed to init OPP table: %d\n", ret); - goto out_put_clk; - } + /* OPPs might be populated at runtime, don't check for error here */ + of_init_opp_table(cpu_dev); ret = dev_pm_opp_init_cpufreq_table(cpu_dev, &freq_table); if (ret) {