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=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,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 DB71BC48BCD for ; Wed, 9 Jun 2021 08:31:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C3D9861359 for ; Wed, 9 Jun 2021 08:31:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237570AbhFIIc7 (ORCPT ); Wed, 9 Jun 2021 04:32:59 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:22171 "EHLO relay1-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232333AbhFIIc6 (ORCPT ); Wed, 9 Jun 2021 04:32:58 -0400 Received: (Authenticated sender: alexandre.belloni@bootlin.com) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id D449924000F; Wed, 9 Jun 2021 08:31:01 +0000 (UTC) Date: Wed, 9 Jun 2021 10:31:01 +0200 From: Alexandre Belloni To: =?iso-8859-1?Q?Cl=E9ment_L=E9ger?= Cc: Michael Turquette , Stephen Boyd , Nicolas Ferre , Ludovic Desroches , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] clk: at91: fix count of periph clocks passed to pmc_data_allocate Message-ID: References: <20210609080145.44226-1-clement.leger@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210609080145.44226-1-clement.leger@bootlin.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org hi, Subject should have been: clk: at91: sama5d2: fix count of periph clocks passed to pmc_data_allocate On 09/06/2021 10:01:44+0200, Clément Léger wrote: > When allocating clk_hw structure, only the periph32 clocks are considered. > Since sama5d2_periphck are also added to the phws there is currently an > out of bound write. Fix this by adding the count of periphck to periph32ck. > > Signed-off-by: Clément Léger Fixes: a2038077de9a ("clk: at91: add sama5d2 PMC driver") > --- > drivers/clk/at91/sama5d2.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/clk/at91/sama5d2.c b/drivers/clk/at91/sama5d2.c > index 3d1f78176c3e..663b73a032ee 100644 > --- a/drivers/clk/at91/sama5d2.c > +++ b/drivers/clk/at91/sama5d2.c > @@ -170,7 +170,7 @@ static void __init sama5d2_pmc_setup(struct device_node *np) > > sama5d2_pmc = pmc_data_allocate(PMC_AUDIOPLLCK + 1, > nck(sama5d2_systemck), > - nck(sama5d2_periph32ck), > + nck(sama5d2_periphck) + nck(sama5d2_periph32ck), > nck(sama5d2_gck), 3); > if (!sama5d2_pmc) > return; > -- > 2.32.0 > -- Alexandre Belloni, co-owner and COO, 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=-14.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 85B2BC47095 for ; Wed, 9 Jun 2021 09:15:36 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 4F3626023B for ; Wed, 9 Jun 2021 09:15:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4F3626023B 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=bombadil.20210309; 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=VbMakrmdNzs2h3uo7Fpe/HAno756X1XNlSSkHt7eYl0=; b=CcfyaLH4smN51o v1lMda5yTzLwIdIBkghWlQ+FaX6GnSNIWp5HQPUiuWBHDKgRUln3klWTAm1GxmwA16a53hrqXz9g3 mBqjZ5hWl3SRdaIIhwGbgDSk29HEcGD7aW+7Q+TV0/sAChLgIiMj3BGiF0leoItgrNu9ngTQ1w/gv FXLLorZJ6e0hsPABP9bRcR/KuhfQ97La4NL6fTLDNUjYENIJvlVJXi9GFDVtmtKTL8gyaSxNtYvsd 8lNgXXiR6VzNz1O5hQxi7jEBZq1ubcywbDD35Cis7h1NVwr9hO3GXjm3CIS2zwVR5zwVB0hhoJqvN 8LixhNkvmBU6sg+lLRDA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lquGu-00CavT-Bq; Wed, 09 Jun 2021 09:13:13 +0000 Received: from relay1-d.mail.gandi.net ([217.70.183.193]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lqtc9-00CNrn-LU for linux-arm-kernel@lists.infradead.org; Wed, 09 Jun 2021 08:31:07 +0000 Received: (Authenticated sender: alexandre.belloni@bootlin.com) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id D449924000F; Wed, 9 Jun 2021 08:31:01 +0000 (UTC) Date: Wed, 9 Jun 2021 10:31:01 +0200 From: Alexandre Belloni To: =?iso-8859-1?Q?Cl=E9ment_L=E9ger?= Subject: Re: [PATCH] clk: at91: fix count of periph clocks passed to pmc_data_allocate Message-ID: References: <20210609080145.44226-1-clement.leger@bootlin.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210609080145.44226-1-clement.leger@bootlin.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210609_013105_884794_8B3D49A4 X-CRM114-Status: GOOD ( 15.47 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stephen Boyd , Michael Turquette , linux-kernel@vger.kernel.org, Ludovic Desroches , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org hi, Subject should have been: clk: at91: sama5d2: fix count of periph clocks passed to pmc_data_allocate On 09/06/2021 10:01:44+0200, Cl=E9ment L=E9ger wrote: > When allocating clk_hw structure, only the periph32 clocks are considered. > Since sama5d2_periphck are also added to the phws there is currently an > out of bound write. Fix this by adding the count of periphck to periph32c= k. > = > Signed-off-by: Cl=E9ment L=E9ger Fixes: a2038077de9a ("clk: at91: add sama5d2 PMC driver") > --- > drivers/clk/at91/sama5d2.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > = > diff --git a/drivers/clk/at91/sama5d2.c b/drivers/clk/at91/sama5d2.c > index 3d1f78176c3e..663b73a032ee 100644 > --- a/drivers/clk/at91/sama5d2.c > +++ b/drivers/clk/at91/sama5d2.c > @@ -170,7 +170,7 @@ static void __init sama5d2_pmc_setup(struct device_no= de *np) > = > sama5d2_pmc =3D pmc_data_allocate(PMC_AUDIOPLLCK + 1, > nck(sama5d2_systemck), > - nck(sama5d2_periph32ck), > + nck(sama5d2_periphck) + nck(sama5d2_periph32ck), > nck(sama5d2_gck), 3); > if (!sama5d2_pmc) > return; > -- = > 2.32.0 > = -- = Alexandre Belloni, co-owner and COO, 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