From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CB37BC433E0 for ; Fri, 17 Jul 2020 09:10:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B01E62076A for ; Fri, 17 Jul 2020 09:10:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726221AbgGQJKI (ORCPT ); Fri, 17 Jul 2020 05:10:08 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:54759 "EHLO relay4-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725912AbgGQJKI (ORCPT ); Fri, 17 Jul 2020 05:10:08 -0400 X-Originating-IP: 90.65.108.121 Received: from localhost (lfbn-lyo-1-1676-121.w90-65.abo.wanadoo.fr [90.65.108.121]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 87555E0019; Fri, 17 Jul 2020 09:09:59 +0000 (UTC) Date: Fri, 17 Jul 2020 11:09:59 +0200 From: Alexandre Belloni To: Claudiu Beznea Cc: mturquette@baylibre.com, sboyd@kernel.org, nicolas.ferre@microchip.com, ludovic.desroches@microchip.com, bbrezillon@kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 01/19] clk: at91: clk-generated: continue if __clk_determine_rate() returns error Message-ID: <20200717090959.GI3428@piout.net> References: <1594812267-6697-1-git-send-email-claudiu.beznea@microchip.com> <1594812267-6697-2-git-send-email-claudiu.beznea@microchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1594812267-6697-2-git-send-email-claudiu.beznea@microchip.com> Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org On 15/07/2020 14:24:09+0300, Claudiu Beznea wrote: > __clk_determine_rate() may return error. Skip the current step > in case of error. > > Fixes: 1a1a36d72e3d3 ("clk: at91: clk-generated: make gclk determine audio_pll rate") > Signed-off-by: Claudiu Beznea Reviewed-by: Alexandre Belloni > --- > drivers/clk/at91/clk-generated.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/clk/at91/clk-generated.c b/drivers/clk/at91/clk-generated.c > index 44a46dcc0518..995a13133cfb 100644 > --- a/drivers/clk/at91/clk-generated.c > +++ b/drivers/clk/at91/clk-generated.c > @@ -170,7 +170,8 @@ static int clk_generated_determine_rate(struct clk_hw *hw, > > for (div = 1; div < GENERATED_MAX_DIV + 2; div++) { > req_parent.rate = req->rate * div; > - __clk_determine_rate(parent, &req_parent); > + if (__clk_determine_rate(parent, &req_parent)) > + continue; > clk_generated_best_diff(req, parent, req_parent.rate, div, > &best_diff, &best_rate); > > -- > 2.7.4 > -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A8FBEC433E3 for ; Fri, 17 Jul 2020 09:11:34 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 73F5E2070E for ; Fri, 17 Jul 2020 09:11:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="lcklU71x" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 73F5E2070E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Novl4Oou5rWhbLqPxxIeVI/JejjXJqLrybnMlHJtoqA=; b=lcklU71xtfVx5CDibu9MatBnC lrqZTTTZzfrEWZfktI8s7tHk0eaO+MNq89wxING2juiFUkKnUWBEYTEnoVh7wARo1CWgqUI6ZumF9 VH8fHh4dbs8dyyIXUwahLdbuGJ80VemS4gz3mBaPuvsCFwpvTd9gT/w9t4jG9oC1m+bjU5GpdnedU sA26DXDZ6iJrKcezdqo7WIWq+Bx9tQMeq2mWX03uOKyMKv7cHv4+XKLUOrEeeZ+t55dX/231BWPS7 VYv1yWxBCEGKNpMXinf93cfbIzsZp5ItDA7xou3Ai7bA0+O3NXqvrgV9xRHDvv22Ds+brs1Af2vSc QIcoVW3uA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jwMNl-0008AX-Ho; Fri, 17 Jul 2020 09:10:17 +0000 Received: from relay4-d.mail.gandi.net ([217.70.183.196]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jwMNd-00083L-77 for linux-arm-kernel@lists.infradead.org; Fri, 17 Jul 2020 09:10:15 +0000 X-Originating-IP: 90.65.108.121 Received: from localhost (lfbn-lyo-1-1676-121.w90-65.abo.wanadoo.fr [90.65.108.121]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 87555E0019; Fri, 17 Jul 2020 09:09:59 +0000 (UTC) Date: Fri, 17 Jul 2020 11:09:59 +0200 From: Alexandre Belloni To: Claudiu Beznea Subject: Re: [PATCH 01/19] clk: at91: clk-generated: continue if __clk_determine_rate() returns error Message-ID: <20200717090959.GI3428@piout.net> References: <1594812267-6697-1-git-send-email-claudiu.beznea@microchip.com> <1594812267-6697-2-git-send-email-claudiu.beznea@microchip.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1594812267-6697-2-git-send-email-claudiu.beznea@microchip.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200717_051009_387528_A9C1BAC4 X-CRM114-Status: GOOD ( 13.06 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: bbrezillon@kernel.org, sboyd@kernel.org, mturquette@baylibre.com, linux-kernel@vger.kernel.org, ludovic.desroches@microchip.com, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 15/07/2020 14:24:09+0300, Claudiu Beznea wrote: > __clk_determine_rate() may return error. Skip the current step > in case of error. > > Fixes: 1a1a36d72e3d3 ("clk: at91: clk-generated: make gclk determine audio_pll rate") > Signed-off-by: Claudiu Beznea Reviewed-by: Alexandre Belloni > --- > drivers/clk/at91/clk-generated.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/clk/at91/clk-generated.c b/drivers/clk/at91/clk-generated.c > index 44a46dcc0518..995a13133cfb 100644 > --- a/drivers/clk/at91/clk-generated.c > +++ b/drivers/clk/at91/clk-generated.c > @@ -170,7 +170,8 @@ static int clk_generated_determine_rate(struct clk_hw *hw, > > for (div = 1; div < GENERATED_MAX_DIV + 2; div++) { > req_parent.rate = req->rate * div; > - __clk_determine_rate(parent, &req_parent); > + if (__clk_determine_rate(parent, &req_parent)) > + continue; > clk_generated_best_diff(req, parent, req_parent.rate, div, > &best_diff, &best_rate); > > -- > 2.7.4 > -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel