From patchwork Thu Jul 3 02:19:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 4469001 Return-Path: X-Original-To: patchwork-linux-arm-msm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 932CFBEEAA for ; Thu, 3 Jul 2014 02:19:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B0606203AE for ; Thu, 3 Jul 2014 02:19:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AE9812039E for ; Thu, 3 Jul 2014 02:19:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754077AbaGCCTa (ORCPT ); Wed, 2 Jul 2014 22:19:30 -0400 Received: from mail-oa0-f44.google.com ([209.85.219.44]:65175 "EHLO mail-oa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750822AbaGCCTa (ORCPT ); Wed, 2 Jul 2014 22:19:30 -0400 Received: by mail-oa0-f44.google.com with SMTP id i7so13253506oag.17 for ; Wed, 02 Jul 2014 19:19:29 -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:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=Q8q7ee0U0eZEXoTOtMCfA3tgEJcWXoMOtlAuGoFLbDw=; b=JWlzqLH/zwUOtcfitQJNNydfxCqQQqfol1bDeGbrnwnZoyOcXSO7HHIwskiNb/p0+h hzhVxgPkppdtLpYICnYfcf9RM0GLsjXjKuNljR3pCiU30cD4umDw1wWWo9oasYnEsELl RQCN/aSKq+ugYPrs5n+5z6yBwmhVYFXZhbZRW17h3HdhboOcGi/crbiCC+nxByrzBLKn zhnFMxOktllkQl3gPFsk/Oj80yX3jzlhqqv1b9bIcrjQco1y1Ai+RYNS/QUroNooba5P gmjXEWwps4WQ4ac89wvyCkUzAdQvxdRuGt/gTTya3WKQEAC1AON9Su6KkUElFpmMmgMB NWHA== X-Gm-Message-State: ALoCoQlmGfiFY2r6y2UA+C6uZYhpJ/yhPmQdsOjHgK4q+vd+zH5XYvYlhqKkGxDxUNV2NyBUnhKS MIME-Version: 1.0 X-Received: by 10.60.176.103 with SMTP id ch7mr1587901oec.64.1404353969499; Wed, 02 Jul 2014 19:19:29 -0700 (PDT) Received: by 10.182.233.166 with HTTP; Wed, 2 Jul 2014 19:19:29 -0700 (PDT) In-Reply-To: <53B4A607.7030001@codeaurora.org> References: <20140702055330.GA3454@dragon> <53B4A607.7030001@codeaurora.org> Date: Thu, 3 Jul 2014 07:49:29 +0530 Message-ID: Subject: Re: [PATCH 06/14] cpufreq: cpu0: defer probe if clock isn't registered yet From: Viresh Kumar To: Stephen Boyd Cc: Shawn Guo , "Rafael J. Wysocki" , Lists linaro-kernel , "linux-pm@vger.kernel.org" , Linux Kernel Mailing List , Arvind Chauhan , linux-arm-msm@vger.kernel.org, Sachin Kamat , Thomas P Abraham , Nishanth Menon , Tomasz Figa Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 3 July 2014 06:08, Stephen Boyd wrote: > Please make this a dev_dbg() or just remove it entirely. Sending a > message to the log on probe defer just duplicates what the driver core > is already doing. Updated as: Author: Viresh Kumar Date: Thu Jun 26 10:40:21 2014 +0530 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. We do a dev_err() in this case. Sending a message to the log on probe defer just duplicates what the driver core is already doing. Convert it to dev_dbg() instead. We should defer in case of clk_get() as well. 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 Acked-by: Santosh Shilimkar --- drivers/cpufreq/cpufreq-cpu0.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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..8a1166c 100644 --- a/drivers/cpufreq/cpufreq-cpu0.c +++ b/drivers/cpufreq/cpufreq-cpu0.c @@ -140,7 +140,7 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev) * not yet registered, we should try defering probe. */ if (PTR_ERR(cpu_reg) == -EPROBE_DEFER) { - dev_err(cpu_dev, "cpu0 regulator not ready, retry\n"); + dev_dbg(cpu_dev, "cpu0 regulator not ready, retry\n"); ret = -EPROBE_DEFER; goto out_put_node; } @@ -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_dbg(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-arm-msm" in