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 A07E8C433E2 for ; Fri, 17 Jul 2020 09:12:03 +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 6D87620684 for ; Fri, 17 Jul 2020 09:12:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="B3CvX8QF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6D87620684 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=ES/strFK74NUJCIQv5VQDkvcdJD/TCMLM6kCJDBqGKg=; b=B3CvX8QFAeSSQQMmlDALkjnb8 v6y32EVMTtuldPPYj2itcKof2HCiHsCC4tHz7nP6puWd5LszNLrHXuxmgiEisy+mGXWd83GqNy/0Z 9QR1PKJSFXTnIViwCpv30Mz1Z1rN+m3ub6mS662Fsq+XeRyZvvaGmxobVFkY8FjptG9Z//oIn1bk/ r+sUBFfUCMqLOUszqlaGGWr2QPTqcfkxjOUJ+cuwdYB+XWSsnBs9I4NOhZJAv/38cGK2oh0DPk49B KSRJUDcQs1/d34CG6HbUwKwHPOh1gQyMlm8LlL0OEvAEHROKKfSSvjqwTcujQC+DoYIZLEts2TU/k KeFeGtavQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jwMOD-0008OC-CH; Fri, 17 Jul 2020 09:10:45 +0000 Received: from relay11.mail.gandi.net ([217.70.178.231]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jwMOA-0008MW-32 for linux-arm-kernel@lists.infradead.org; Fri, 17 Jul 2020 09:10:43 +0000 Received: from localhost (lfbn-lyo-1-1676-121.w90-65.abo.wanadoo.fr [90.65.108.121]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay11.mail.gandi.net (Postfix) with ESMTPSA id EAC4F100007; Fri, 17 Jul 2020 09:10:36 +0000 (UTC) Date: Fri, 17 Jul 2020 11:10:36 +0200 From: Alexandre Belloni To: Claudiu Beznea Subject: Re: [PATCH 02/19] clk: at91: clk-generated: check best_rate against ranges Message-ID: <20200717091036.GJ3428@piout.net> References: <1594812267-6697-1-git-send-email-claudiu.beznea@microchip.com> <1594812267-6697-3-git-send-email-claudiu.beznea@microchip.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1594812267-6697-3-git-send-email-claudiu.beznea@microchip.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200717_051042_244476_FE28FDCE X-CRM114-Status: GOOD ( 13.56 ) 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:10+0300, Claudiu Beznea wrote: > Check best_rate against available clock ranges. > > Fixes: df70aeef6083 ("clk: at91: add generated clock driver") > Signed-off-by: Claudiu Beznea Reviewed-by: Alexandre Belloni > --- > drivers/clk/at91/clk-generated.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/clk/at91/clk-generated.c b/drivers/clk/at91/clk-generated.c > index 995a13133cfb..f8e557e0e1b8 100644 > --- a/drivers/clk/at91/clk-generated.c > +++ b/drivers/clk/at91/clk-generated.c > @@ -185,8 +185,8 @@ static int clk_generated_determine_rate(struct clk_hw *hw, > __clk_get_name((req->best_parent_hw)->clk), > req->best_parent_rate); > > - if (best_rate < 0) > - return best_rate; > + if (best_rate < 0 || (gck->range.max && best_rate > gck->range.max)) > + return -EINVAL; > > req->rate = best_rate; > return 0; > -- > 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