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=-3.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 534B4CA9EC3 for ; Mon, 28 Oct 2019 15:26:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 234AE21783 for ; Mon, 28 Oct 2019 15:26:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729460AbfJ1P0T (ORCPT ); Mon, 28 Oct 2019 11:26:19 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:43828 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726934AbfJ1P0S (ORCPT ); Mon, 28 Oct 2019 11:26:18 -0400 Received: from cust-east-parth2-46-193-72-114.wb.wifirst.net (46.193.72.114) (HELO kreacher.localnet) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.292) id b9bc03ccfbeada10; Mon, 28 Oct 2019 16:26:16 +0100 From: "Rafael J. Wysocki" To: Viresh Kumar Cc: John Hubbard , Shilpasri G Bhat , LKML , Preeti U Murthy , linux-pm@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH v2] cpufreq: powernv: fix stack bloat and NR_CPUS limitation Date: Mon, 28 Oct 2019 16:26:16 +0100 Message-ID: <3664438.dB2cPXlXpS@kreacher> In-Reply-To: <20191018050712.qr2axffmbms5h4xb@vireshk-i7> References: <20191018045539.3765565-1-jhubbard@nvidia.com> <20191018050712.qr2axffmbms5h4xb@vireshk-i7> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Friday, October 18, 2019 7:07:12 AM CET Viresh Kumar wrote: > On 17-10-19, 21:55, John Hubbard wrote: > > The following build warning occurred on powerpc 64-bit builds: > > > > drivers/cpufreq/powernv-cpufreq.c: In function 'init_chip_info': > > drivers/cpufreq/powernv-cpufreq.c:1070:1: warning: the frame size of 1040 bytes is larger than 1024 bytes [-Wframe-larger-than=] > > > > This is due to putting 1024 bytes on the stack: > > > > unsigned int chip[256]; > > > > ...and while looking at this, it also has a bug: it fails with a stack > > overrun, if CONFIG_NR_CPUS > 256. > > > > Fix both problems by dynamically allocating based on CONFIG_NR_CPUS. > > > > Fixes: 053819e0bf840 ("cpufreq: powernv: Handle throttling due to Pmax capping at chip level") > > Cc: Shilpasri G Bhat > > Cc: Preeti U Murthy > > Cc: Viresh Kumar > > Cc: Rafael J. Wysocki > > Cc: linux-pm@vger.kernel.org > > Cc: linuxppc-dev@lists.ozlabs.org > > Signed-off-by: John Hubbard > > --- > > > > Changes since v1: includes Viresh's review commit fixes. > > > > drivers/cpufreq/powernv-cpufreq.c | 17 +++++++++++++---- > > 1 file changed, 13 insertions(+), 4 deletions(-) > > Acked-by: Viresh Kumar > > Applying as 5.5 material, thanks!