Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp496293pxv; Thu, 8 Jul 2021 07:17:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxxbDyXCMagJ1u6t3N5t4LAXf6RwmhiPZIFD7xp0x6BubcOOhC0/LP5HwQsQKpRwD1s0V+J X-Received: by 2002:a5d:8602:: with SMTP id f2mr24361295iol.61.1625753830197; Thu, 08 Jul 2021 07:17:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625753830; cv=none; d=google.com; s=arc-20160816; b=KWt/l0wZehj4KdT3M+um+ytZoEfiT8JhPOFH7NnZyagCCBs9i1/m3D3ZTYTCeYJKpz Td2+WogLTZO1MUlEkibLLuEa1zumTCOQXE8Z/34xrrCFgIIN6bmyMLTpzsaZ1Qij8GTH l4uojim12KRWhpM5MyzjMEGFjbKuM+qt/zzzwEJVUcTfTei/scTHbDgWNdF8AIzrSfr4 xSrWrqulP22k2HT8/LzPUt5nKTGgoRtwPysMqj9aXd0h8OlZKUSxUXHVQhCv3rOJO5yW 9wsWFofKbeJVIfeUdcZsbR8uaB9bB4o5IxDInYLI7X7ZY5VqaewvhrcMJEGa3S6saxmC 3ARg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=VLDQ/+sk3NVm2k8hxZIFY+UuEAgKtVpKUisR0tQbA0k=; b=ebbm3rnS39DUrvvkigC8/cQxWHCcP0DcGJjqKQOd4UBzv83CiJG6nc8m0JkDxO/5Bs VVGBvkT2cP9gbK8QPSsi0cuaIy7Py3QurZy09wwBoPJG9/BSi8a/NxXBAIZJFASuxesu yYByNZdOkfLVYkLUpL88y6+mDXq+0h7lgYFSHMQwDV+TMkRQ8/IPSJOWafKGIHmAeC14 HS23mBtgK3m29TgoUQKEg7q68G0MJ3BFPMw8PNuIsKTMrrsbF47W2qt+oDbsGKkkr5T6 JVEqbIYn5DCglpWwslsD3i8VeMKQWJ5QVy31g9dijXYOzGehFsdVvx8mhSiiUu8qDYOY QZ6w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i13si2848948ilm.156.2021.07.08.07.16.56; Thu, 08 Jul 2021 07:17:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231920AbhGHOSX convert rfc822-to-8bit (ORCPT + 99 others); Thu, 8 Jul 2021 10:18:23 -0400 Received: from mslow1.mail.gandi.net ([217.70.178.240]:60291 "EHLO mslow1.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229592AbhGHOSX (ORCPT ); Thu, 8 Jul 2021 10:18:23 -0400 Received: from relay6-d.mail.gandi.net (unknown [217.70.183.198]) by mslow1.mail.gandi.net (Postfix) with ESMTP id 37B69C46A2; Thu, 8 Jul 2021 14:13:58 +0000 (UTC) Received: (Authenticated sender: clement.leger@bootlin.com) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id DEEA2C000A; Thu, 8 Jul 2021 14:13:34 +0000 (UTC) Date: Thu, 8 Jul 2021 16:13:34 +0200 From: =?UTF-8?B?Q2zDqW1lbnQgTMOpZ2Vy?= To: Alexandre Belloni Cc: Stephen Boyd , Michael Turquette , linux-kernel@vger.kernel.org, Ludovic Desroches , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] clk: at91: fix count of periph clocks passed to pmc_data_allocate Message-ID: <20210708161334.039d09fb@fixe.home> In-Reply-To: References: <20210609080145.44226-1-clement.leger@bootlin.com> Organization: Bootlin X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Le Wed, 9 Jun 2021 10:31:01 +0200, Alexandre Belloni a écrit : > hi, > > Subject should have been: > clk: at91: sama5d2: fix count of periph clocks passed to > pmc_data_allocate > This patch can actually be discarded since it won't fix allocation at all but will just allocate more data than needed since nck already returns the max .id field of the periph array. > > > 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 > > >