From patchwork Wed Jul 2 11:32:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 32969 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f198.google.com (mail-ie0-f198.google.com [209.85.223.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 173A720560 for ; Wed, 2 Jul 2014 11:32:18 +0000 (UTC) Received: by mail-ie0-f198.google.com with SMTP id rp18sf7629752iec.9 for ; Wed, 02 Jul 2014 04:32:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mime-version:in-reply-to:references :date:message-id:subject:from:to:cc:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=3aLi0H1holuKW80RcIgnxrFT0CKqZewJ570AaUaeNT8=; b=ThW0BZmPQPPpFBM/bq2tq88AF5A7Nz8Socx2qfo7Hj/K2A/FWXUUOxGct4/FG0/NnL V/ebE733PWoSwsLykOhDeOcZ9vraQTkHb5JWTWHlgmBVktSE4y7Y2ecRR/HS9Sxmqxi+ uEtEOxU29WSuKFCaKr8+IeS/BgXW2HYDn2Nt/sw0zgo6fznCV9IZK1hmGJqhBVL0JRs0 tqgNitHBe48PzRqU27UXvx2/Ak7pfKR19PKi0UlHDyqECZ5p9hk9kPWarpe0SZ5fKzG0 4by5nGMIoHvH+cnQhYychyYVm6wRRGqcVG9mbbBEWAWQyRCf8ZzJV6MtjZOmliFWBtcM Z7sg== X-Gm-Message-State: ALoCoQm55lF+PT3FlBwAbgS26OCnjpKAN5xLI/KwobCAeuIokI7AteUBdy3CIsz7J0yYzqtpwwzF X-Received: by 10.182.241.33 with SMTP id wf1mr27322336obc.37.1404300738252; Wed, 02 Jul 2014 04:32:18 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.85.40 with SMTP id m37ls4619qgd.18.gmail; Wed, 02 Jul 2014 04:32:18 -0700 (PDT) X-Received: by 10.221.44.73 with SMTP id uf9mr49452656vcb.9.1404300738157; Wed, 02 Jul 2014 04:32:18 -0700 (PDT) Received: from mail-ve0-f182.google.com (mail-ve0-f182.google.com [209.85.128.182]) by mx.google.com with ESMTPS id s10si661241vcx.51.2014.07.02.04.32.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 02 Jul 2014 04:32:18 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.182 as permitted sender) client-ip=209.85.128.182; Received: by mail-ve0-f182.google.com with SMTP id oy12so10934743veb.41 for ; Wed, 02 Jul 2014 04:32:18 -0700 (PDT) X-Received: by 10.52.172.5 with SMTP id ay5mr1104144vdc.38.1404300738026; Wed, 02 Jul 2014 04:32:18 -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 tc5csp286048vcb; Wed, 2 Jul 2014 04:32:17 -0700 (PDT) X-Received: by 10.66.184.175 with SMTP id ev15mr3345598pac.146.1404300737229; Wed, 02 Jul 2014 04:32:17 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id qp5si29962264pab.192.2014.07.02.04.32.16; Wed, 02 Jul 2014 04:32:16 -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 S1752149AbaGBLcP (ORCPT + 13 others); Wed, 2 Jul 2014 07:32:15 -0400 Received: from mail-ob0-f178.google.com ([209.85.214.178]:35502 "EHLO mail-ob0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751287AbaGBLcO (ORCPT ); Wed, 2 Jul 2014 07:32:14 -0400 Received: by mail-ob0-f178.google.com with SMTP id wn1so12218699obc.9 for ; Wed, 02 Jul 2014 04:32:13 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.182.20.169 with SMTP id o9mr57066972obe.59.1404300733598; Wed, 02 Jul 2014 04:32:13 -0700 (PDT) Received: by 10.182.233.166 with HTTP; Wed, 2 Jul 2014 04:32:13 -0700 (PDT) In-Reply-To: References: <20140702055330.GA3454@dragon> Date: Wed, 2 Jul 2014 17:02:13 +0530 Message-ID: Subject: Re: [PATCH 06/14] cpufreq: cpu0: defer probe if clock isn't registered yet From: Viresh Kumar To: Shawn Guo Cc: "Rafael J. Wysocki" , Lists linaro-kernel , "linux-pm@vger.kernel.org" , Linux Kernel Mailing List , Arvind Chauhan , Stephen Boyd , linux-arm-msm@vger.kernel.org, Sachin Kamat , Thomas P Abraham , Nishanth Menon , Tomasz Figa 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.128.182 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: , On 2 July 2014 11:25, Viresh Kumar wrote: > On 2 July 2014 11:23, Shawn Guo wrote: >> On Tue, Jul 01, 2014 at 10:02:35PM +0530, Viresh Kumar wrote: > >>> diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.c >>> index 4273a5f..b5b8e1c 100644 >>> --- a/drivers/cpufreq/cpufreq-cpu0.c >>> +++ b/drivers/cpufreq/cpufreq-cpu0.c >>> @@ -150,8 +150,17 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev) >>> >>> cpu_clk = clk_get(cpu_dev, NULL); >>> if (IS_ERR(cpu_clk)) { >>> - ret = PTR_ERR(cpu_clk); >> >> If you keep this ... >> >>> - pr_err("failed to get cpu0 clock: %d\n", ret); >>> + /* >>> + * If cpu's clk node is present, but clock is not yet >>> + * registered, we should try defering probe. >>> + */ >>> + if (PTR_ERR(cpu_clk) == -EPROBE_DEFER) { >> >> ... you can use 'ret' here ... >> >>> + dev_err(cpu_dev, "cpu0 clock not ready, retry\n"); >>> + ret = -EPROBE_DEFER; >> >> ... this can be saved ... >> >>> + } else { >>> + ret = PTR_ERR(cpu_clk); >> >> ... and this as well. > > All accepted. Thanks. The motive of this patch is changed completely after what you suggested and so logs are updated as well: cpufreq: cpu0: print relevant error when we defer probe Currently, we defer probe if regulator_get() returned -EPROBE_DEFER, i.e. regulator isn't registered yet. The same is true for clock as well and should be done there. Current code already does it, but it wasn't intentional probably. Its just that we are returning the right error with wrong print message. Fix print message to convey right error. Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq-cpu0.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.c index 4273a5f..0c16b2f 100644 --- a/drivers/cpufreq/cpufreq-cpu0.c +++ b/drivers/cpufreq/cpufreq-cpu0.c @@ -151,7 +151,16 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev) cpu_clk = clk_get(cpu_dev, NULL); if (IS_ERR(cpu_clk)) { ret = PTR_ERR(cpu_clk); - pr_err("failed to get cpu0 clock: %d\n", ret); + + /* + * If cpu's clk node is present, but clock is not yet + * registered, we should try defering probe. + */ + if (ret == -EPROBE_DEFER) + dev_err(cpu_dev, "cpu0 clock not ready, retry\n"); + else + dev_err(cpu_dev, "failed to get cpu0 clock: %d\n", ret); + goto out_put_reg; } -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in