From patchwork Fri Jul 11 14:54:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 33499 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f197.google.com (mail-pd0-f197.google.com [209.85.192.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2181720672 for ; Fri, 11 Jul 2014 14:54:38 +0000 (UTC) Received: by mail-pd0-f197.google.com with SMTP id fp1sf6948116pdb.4 for ; Fri, 11 Jul 2014 07:54:38 -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:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=uF/9x8Ta0JghOBDWkOPVyKPo24MSlT8AvY2Jt+IBaHs=; b=X/0g7ErrHrgOPU1d3hMoLKjXDEJZr90NJAzOUi7vQYsVfDKnLh46HB5YestqvX0nIr u7R4xsNWUCha1EarhciiJyr+Yldw16iwipkqJhNQihw1Jv2Xtn6dnsdGU1cy0CUjdHGs N3Zpv0RoMpLySlKOJNgwvq7K7x5dfwaZ+iAWWUGTEAYOiy/s7ANg86GG2sc0YFxEeI8G yvm4VFUKwQknDqjLbXXvcMffqR2ilLfPTmeq0F7k28aoPNTwKsxyfV+RUHVI0nXWr0un EyNMxoAY3Uw8P5UKHT1Ijpxc6ILoW7c6F9HLN5OFf3OuNubYD1fo2m1w0sWk+1LYD7Im 6j1g== X-Gm-Message-State: ALoCoQnZTykSkr+3vV46X+t6ZID3X6ynl25AJSRJXdpIU1Bn3IgWo6hKllawlC3tmo2HVg0Hyd5r X-Received: by 10.68.236.129 with SMTP id uu1mr2331301pbc.1.1405090477987; Fri, 11 Jul 2014 07:54:37 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.34.147 with SMTP id l19ls433511qgl.42.gmail; Fri, 11 Jul 2014 07:54:37 -0700 (PDT) X-Received: by 10.52.106.162 with SMTP id gv2mr1254080vdb.47.1405090477857; Fri, 11 Jul 2014 07:54:37 -0700 (PDT) Received: from mail-vc0-f180.google.com (mail-vc0-f180.google.com [209.85.220.180]) by mx.google.com with ESMTPS id gt8si1701628vdc.53.2014.07.11.07.54.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 11 Jul 2014 07:54:37 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.180 as permitted sender) client-ip=209.85.220.180; Received: by mail-vc0-f180.google.com with SMTP id im17so2242379vcb.39 for ; Fri, 11 Jul 2014 07:54:37 -0700 (PDT) X-Received: by 10.52.244.81 with SMTP id xe17mr43715136vdc.24.1405090477765; Fri, 11 Jul 2014 07:54:37 -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 tc5csp42006vcb; Fri, 11 Jul 2014 07:54:37 -0700 (PDT) X-Received: by 10.70.34.6 with SMTP id v6mr24592008pdi.29.1405090476701; Fri, 11 Jul 2014 07:54:36 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bi15si1357654pdb.161.2014.07.11.07.54.36; Fri, 11 Jul 2014 07:54:36 -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 S1752308AbaGKOyf (ORCPT + 15 others); Fri, 11 Jul 2014 10:54:35 -0400 Received: from mail-pd0-f176.google.com ([209.85.192.176]:37529 "EHLO mail-pd0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752193AbaGKOye (ORCPT ); Fri, 11 Jul 2014 10:54:34 -0400 Received: by mail-pd0-f176.google.com with SMTP id ft15so1519878pdb.7 for ; Fri, 11 Jul 2014 07:54:34 -0700 (PDT) X-Received: by 10.68.137.98 with SMTP id qh2mr55227484pbb.26.1405090473928; Fri, 11 Jul 2014 07:54:33 -0700 (PDT) Received: from localhost ([122.167.123.210]) by mx.google.com with ESMTPSA id wd7sm10194070pab.47.2014.07.11.07.54.30 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 11 Jul 2014 07:54:33 -0700 (PDT) From: Viresh Kumar To: rjw@rjwysocki.net Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, arvind.chauhan@arm.com, ttynkkynen@nvidia.com, Viresh Kumar Subject: [PATCH Resend] cpufreq: cpu0: OPPs can be populated at runtime Date: Fri, 11 Jul 2014 20:24:19 +0530 Message-Id: X-Mailer: git-send-email 2.0.0.rc2 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.220.180 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. Acked-by: Santosh Shilimkar Suggested-by: Stephen Boyd Tested-by: Stephen Boyd Signed-off-by: Viresh Kumar --- Hi Rafael, This was earlier sent as part of: https://lkml.org/lkml/2014/7/1/358 series. But actually is an fix and can (should?) be pushed for 3.16. Rest of the patches from that series are cleanups/updates and so can go in 3.17. Please see if you can take it for 3.16. 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 ee1ae30..86beda9 100644 --- a/drivers/cpufreq/cpufreq-cpu0.c +++ b/drivers/cpufreq/cpufreq-cpu0.c @@ -152,11 +152,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) {