Message ID | 20230130185101.2883245-1-arnd@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2347996wrn; Mon, 30 Jan 2023 11:08:05 -0800 (PST) X-Google-Smtp-Source: AK7set8zyiTIFP6Mhprz+9qRdNOsBeODAoMgWzWWNnBSz3umZ1s5JFFUkpJ6KGb3Y1wFn6euip0i X-Received: by 2002:a05:6a20:1616:b0:bc:4d0c:ce45 with SMTP id l22-20020a056a20161600b000bc4d0cce45mr15632960pzj.53.1675105685528; Mon, 30 Jan 2023 11:08:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675105685; cv=none; d=google.com; s=arc-20160816; b=SFRd3iT6sp4npDJfeV+EpI2+0/HSuPq5pLYNymo8x2vIQXNWXs9fbsGLxTj2cFVG87 foQDKV2PFkT5CXBaJ3wfN8Iktph9y8xcBq2MMxMRVpulXYEEVUA3IC2zTKZNrMofIgcQ rwDX8ONaZBInsBX1IFF9Q1thhl3MQh9u2y/dW2H7u3IwZ4PBKFFifWo8Bs/K9aR99EBJ x/ERpxyWji+8BQYefVER/EU9zsiCZ0p+FsdURi7SzJ81Yzc6klryYVhUrX9Kpfe/dNJT PkHGgEVA/i1YXyr0VOLQMi0+JA4D+1cRa5+QHr6Wox0R6kmeazJdQGlWaSnrmoI8r9fg fFyA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=HiiArGnPDRLuOPSZ3Q+ZWHwF3o7IHtonFg7ek1j6ROA=; b=OYPwNUAV5fMJPCTXIoUYBgb77ULvZwI8rLd7u7CMzumkmTVIiXKgnmcqryQQjMx6bs FlJUKFJXduLgsBahwT/SN4aDC1+da22hajR5a5boiVPPeMOc4ey3SWz2q8iMPNHJdYun MA8bF5Iu4Lv4iDYOPUVF3jhiBXM8zdQNoDH2VTjxtSfwDsTD+i29LdGLSyCdBiRN47+n uZZENkEyZ2+M58YioKJpZ40FRiBoqEUsnnYmycxEjc0hr1ES4jy/vcXeLVfPgGYnjdvZ MRYwsPBwJa31M1GEvJAc3hHszTnWMatgOCOeW4E+J3rEmUXSLuZVEAldOGbGbgYIR/wV 7Dog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ufCBQ9n2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x191-20020a6386c8000000b004def30299f5si12747733pgd.149.2023.01.30.11.07.53; Mon, 30 Jan 2023 11:08:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ufCBQ9n2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237992AbjA3SvM (ORCPT <rfc822;maxin.john@gmail.com> + 99 others); Mon, 30 Jan 2023 13:51:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237937AbjA3SvK (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 30 Jan 2023 13:51:10 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E885C2C65B; Mon, 30 Jan 2023 10:51:06 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3A74661216; Mon, 30 Jan 2023 18:51:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 53EE7C433EF; Mon, 30 Jan 2023 18:51:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1675104665; bh=stmljKudyEFFluMAGIJvUJoacI+Yf44SQf2dOTbzvZ4=; h=From:To:Cc:Subject:Date:From; b=ufCBQ9n2J9TX1VYyZ55mqURRQJ7lfY6bBvDnwfeM27kNWPGd8/7ndUTcDeB3koazM quW1HkujWecFZfJG7ZaiP3bqb8iFsLfgE3DDPf/VXJknp7CnIc1fsYnsE70CADAq8h Hh/dsyZlbkmTRfbNzCEOOTWiTL8xyxNQbC5LANQ7YC2ILmdIdj+YeNGD2eefUyPUHa K0dc/PnrqKEuA1OaA6Qfid+OV7CIZ4FgVZUksJjBIniz1bYFyKxwCS5kjhP0FXuKLW 2x0s4/NzlfPwaRWl3vr3KdZiNGu7uwCm6Seiug+vbGWfN4i3Kdfp1CxHfLlst/Rszp ybi5bdIgb4ZAg== From: Arnd Bergmann <arnd@kernel.org> To: Gustavo Pimentel <gustavo.pimentel@synopsys.com>, Vinod Koul <vkoul@kernel.org>, Serge Semin <Sergey.Semin@baikalelectronics.ru> Cc: Arnd Bergmann <arnd@arndb.de>, Manivannan Sadhasivam <mani@kernel.org>, Bjorn Helgaas <bhelgaas@google.com>, Lorenzo Pieralisi <lpieralisi@kernel.org>, Frank Li <Frank.Li@nxp.com>, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] [v2] dmaengine: dw-edma: reduce stack usage after debugfs rework Date: Mon, 30 Jan 2023 19:50:42 +0100 Message-Id: <20230130185101.2883245-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756475619682950104?= X-GMAIL-MSGID: =?utf-8?q?1756475619682950104?= |
Series |
[v2] dmaengine: dw-edma: reduce stack usage after debugfs rework
|
|
Commit Message
Arnd Bergmann
Jan. 30, 2023, 6:50 p.m. UTC
From: Arnd Bergmann <arnd@arndb.de> After the dw_edma_debugfs_entry arrays are no longer compile-time constant, they take up space on the stack, which exceeds the warning limit after inlining: drivers/dma/dw-edma/dw-edma-v0-debugfs.c:280:6: error: stack frame size (1784) exceeds limit (1400) in 'dw_edma_v0_debugfs_on' [-Werror,-Wframe-larger-than] void dw_edma_v0_debugfs_on(struct dw_edma *dw) Work around this by preventing dw_edma_debugfs_regs_{wr,rd} from both being inlined together, which cuts the stack frame size in half and makes it fit below the warning limit. Fixes: 5c0373eafd83 ("dmaengine: dw-edma: Move eDMA data pointer to debugfs node descriptor") Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- v2: rebase on top of dmaengine tree --- drivers/dma/dw-edma/dw-edma-v0-debugfs.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
Comments
On Mon, Jan 30, 2023 at 07:50:42PM +0100, Arnd Bergmann wrote: > From: Arnd Bergmann <arnd@arndb.de> > > After the dw_edma_debugfs_entry arrays are no longer compile-time This sentence doesn't look complete to me. > constant, they take up space on the stack, which exceeds the warning > limit after inlining: > > drivers/dma/dw-edma/dw-edma-v0-debugfs.c:280:6: error: stack frame size (1784) exceeds limit (1400) in 'dw_edma_v0_debugfs_on' [-Werror,-Wframe-larger-than] > void dw_edma_v0_debugfs_on(struct dw_edma *dw) > > Work around this by preventing dw_edma_debugfs_regs_{wr,rd} from both > being inlined together, which cuts the stack frame size in half and > makes it fit below the warning limit. > > Fixes: 5c0373eafd83 ("dmaengine: dw-edma: Move eDMA data pointer to debugfs node descriptor") > Signed-off-by: Arnd Bergmann <arnd@arndb.de> Small style comment below, with that: Reviewed-by: Manivannan Sadhasivam <mani@kernel.org> > --- > v2: rebase on top of dmaengine tree > --- > drivers/dma/dw-edma/dw-edma-v0-debugfs.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/dma/dw-edma/dw-edma-v0-debugfs.c b/drivers/dma/dw-edma/dw-edma-v0-debugfs.c > index 42380bf64a70..6542060bd01a 100644 > --- a/drivers/dma/dw-edma/dw-edma-v0-debugfs.c > +++ b/drivers/dma/dw-edma/dw-edma-v0-debugfs.c > @@ -136,7 +136,8 @@ static void dw_edma_debugfs_regs_ch(struct dw_edma *dw, enum dw_edma_dir dir, > dw_edma_debugfs_create_x32(dw, debugfs_regs, nr_entries, dent); > } > > -static void dw_edma_debugfs_regs_wr(struct dw_edma *dw, struct dentry *dent) > +static noinline_for_stack void > +dw_edma_debugfs_regs_wr(struct dw_edma *dw, struct dentry *dent) For consistency, the function arguments could be wrapped: static noinline_for_stack void dw_edma_debugfs_regs_wr(struct dw_edma *dw, struct dentry *dent) I could see that with the addition of "noinline_for_stack", the arguments are shifted towards the end of the line. But this style matches rest of the functions in this file. Thanks, Mani > { > const struct dw_edma_debugfs_entry debugfs_regs[] = { > /* eDMA global registers */ > @@ -197,7 +198,8 @@ static void dw_edma_debugfs_regs_wr(struct dw_edma *dw, struct dentry *dent) > } > } > > -static void dw_edma_debugfs_regs_rd(struct dw_edma *dw, struct dentry *dent) > +static noinline_for_stack void > +dw_edma_debugfs_regs_rd(struct dw_edma *dw, struct dentry *dent) > { > const struct dw_edma_debugfs_entry debugfs_regs[] = { > /* eDMA global registers */ > -- > 2.39.0 >
On Mon, Jan 30, 2023 at 07:50:42PM +0100, Arnd Bergmann wrote: > From: Arnd Bergmann <arnd@arndb.de> > > After the dw_edma_debugfs_entry arrays are no longer compile-time > constant, they take up space on the stack, which exceeds the warning > limit after inlining: > > drivers/dma/dw-edma/dw-edma-v0-debugfs.c:280:6: error: stack frame size (1784) exceeds limit (1400) in 'dw_edma_v0_debugfs_on' [-Werror,-Wframe-larger-than] > void dw_edma_v0_debugfs_on(struct dw_edma *dw) > > Work around this by preventing dw_edma_debugfs_regs_{wr,rd} from both > being inlined together, which cuts the stack frame size in half and > makes it fit below the warning limit. > > Fixes: 5c0373eafd83 ("dmaengine: dw-edma: Move eDMA data pointer to debugfs node descriptor") > Signed-off-by: Arnd Bergmann <arnd@arndb.de> Great! Thanks for the patch. Reviewed-by: Serge Semin <fancer.lancer@gmail.com> -Serge(y) > --- > v2: rebase on top of dmaengine tree > --- > drivers/dma/dw-edma/dw-edma-v0-debugfs.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/dma/dw-edma/dw-edma-v0-debugfs.c b/drivers/dma/dw-edma/dw-edma-v0-debugfs.c > index 42380bf64a70..6542060bd01a 100644 > --- a/drivers/dma/dw-edma/dw-edma-v0-debugfs.c > +++ b/drivers/dma/dw-edma/dw-edma-v0-debugfs.c > @@ -136,7 +136,8 @@ static void dw_edma_debugfs_regs_ch(struct dw_edma *dw, enum dw_edma_dir dir, > dw_edma_debugfs_create_x32(dw, debugfs_regs, nr_entries, dent); > } > > -static void dw_edma_debugfs_regs_wr(struct dw_edma *dw, struct dentry *dent) > +static noinline_for_stack void > +dw_edma_debugfs_regs_wr(struct dw_edma *dw, struct dentry *dent) > { > const struct dw_edma_debugfs_entry debugfs_regs[] = { > /* eDMA global registers */ > @@ -197,7 +198,8 @@ static void dw_edma_debugfs_regs_wr(struct dw_edma *dw, struct dentry *dent) > } > } > > -static void dw_edma_debugfs_regs_rd(struct dw_edma *dw, struct dentry *dent) > +static noinline_for_stack void > +dw_edma_debugfs_regs_rd(struct dw_edma *dw, struct dentry *dent) > { > const struct dw_edma_debugfs_entry debugfs_regs[] = { > /* eDMA global registers */ > -- > 2.39.0 >
On 30-01-23, 19:50, Arnd Bergmann wrote: > From: Arnd Bergmann <arnd@arndb.de> > > After the dw_edma_debugfs_entry arrays are no longer compile-time > constant, they take up space on the stack, which exceeds the warning > limit after inlining: > > drivers/dma/dw-edma/dw-edma-v0-debugfs.c:280:6: error: stack frame size (1784) exceeds limit (1400) in 'dw_edma_v0_debugfs_on' [-Werror,-Wframe-larger-than] > void dw_edma_v0_debugfs_on(struct dw_edma *dw) > > Work around this by preventing dw_edma_debugfs_regs_{wr,rd} from both > being inlined together, which cuts the stack frame size in half and > makes it fit below the warning limit. > > Fixes: 5c0373eafd83 ("dmaengine: dw-edma: Move eDMA data pointer to debugfs node descriptor") > Signed-off-by: Arnd Bergmann <arnd@arndb.de> > --- > v2: rebase on top of dmaengine tree I dont have 5c0373eafd83 in my tree, I guess that went thru PCI tree, so I am going to defer this after merge window > --- > drivers/dma/dw-edma/dw-edma-v0-debugfs.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/dma/dw-edma/dw-edma-v0-debugfs.c b/drivers/dma/dw-edma/dw-edma-v0-debugfs.c > index 42380bf64a70..6542060bd01a 100644 > --- a/drivers/dma/dw-edma/dw-edma-v0-debugfs.c > +++ b/drivers/dma/dw-edma/dw-edma-v0-debugfs.c > @@ -136,7 +136,8 @@ static void dw_edma_debugfs_regs_ch(struct dw_edma *dw, enum dw_edma_dir dir, > dw_edma_debugfs_create_x32(dw, debugfs_regs, nr_entries, dent); > } > > -static void dw_edma_debugfs_regs_wr(struct dw_edma *dw, struct dentry *dent) > +static noinline_for_stack void > +dw_edma_debugfs_regs_wr(struct dw_edma *dw, struct dentry *dent) > { > const struct dw_edma_debugfs_entry debugfs_regs[] = { > /* eDMA global registers */ > @@ -197,7 +198,8 @@ static void dw_edma_debugfs_regs_wr(struct dw_edma *dw, struct dentry *dent) > } > } > > -static void dw_edma_debugfs_regs_rd(struct dw_edma *dw, struct dentry *dent) > +static noinline_for_stack void > +dw_edma_debugfs_regs_rd(struct dw_edma *dw, struct dentry *dent) > { > const struct dw_edma_debugfs_entry debugfs_regs[] = { > /* eDMA global registers */ > -- > 2.39.0
Hello Vinod On Fri, Feb 10, 2023 at 02:22:28PM +0530, Vinod Koul wrote: > On 30-01-23, 19:50, Arnd Bergmann wrote: > > From: Arnd Bergmann <arnd@arndb.de> > > > > After the dw_edma_debugfs_entry arrays are no longer compile-time > > constant, they take up space on the stack, which exceeds the warning > > limit after inlining: > > > > drivers/dma/dw-edma/dw-edma-v0-debugfs.c:280:6: error: stack frame size (1784) exceeds limit (1400) in 'dw_edma_v0_debugfs_on' [-Werror,-Wframe-larger-than] > > void dw_edma_v0_debugfs_on(struct dw_edma *dw) > > > > Work around this by preventing dw_edma_debugfs_regs_{wr,rd} from both > > being inlined together, which cuts the stack frame size in half and > > makes it fit below the warning limit. > > > > Fixes: 5c0373eafd83 ("dmaengine: dw-edma: Move eDMA data pointer to debugfs node descriptor") > > Signed-off-by: Arnd Bergmann <arnd@arndb.de> > > --- > > v2: rebase on top of dmaengine tree > > I dont have 5c0373eafd83 in my tree, I guess that went thru PCI tree, so > I am going to defer this after merge window It's in the @Bjorn tree now https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git/commit/?h=pci/ctrl/dwc&id=5c0373eafd8334343da22338d8588ed61e8daba0 If you are ok with the fix then @Bjorn could take the patch in to his repo. Right, @Bjorn? -Serge(y) > > > --- > > drivers/dma/dw-edma/dw-edma-v0-debugfs.c | 6 ++++-- > > 1 file changed, 4 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/dma/dw-edma/dw-edma-v0-debugfs.c b/drivers/dma/dw-edma/dw-edma-v0-debugfs.c > > index 42380bf64a70..6542060bd01a 100644 > > --- a/drivers/dma/dw-edma/dw-edma-v0-debugfs.c > > +++ b/drivers/dma/dw-edma/dw-edma-v0-debugfs.c > > @@ -136,7 +136,8 @@ static void dw_edma_debugfs_regs_ch(struct dw_edma *dw, enum dw_edma_dir dir, > > dw_edma_debugfs_create_x32(dw, debugfs_regs, nr_entries, dent); > > } > > > > -static void dw_edma_debugfs_regs_wr(struct dw_edma *dw, struct dentry *dent) > > +static noinline_for_stack void > > +dw_edma_debugfs_regs_wr(struct dw_edma *dw, struct dentry *dent) > > { > > const struct dw_edma_debugfs_entry debugfs_regs[] = { > > /* eDMA global registers */ > > @@ -197,7 +198,8 @@ static void dw_edma_debugfs_regs_wr(struct dw_edma *dw, struct dentry *dent) > > } > > } > > > > -static void dw_edma_debugfs_regs_rd(struct dw_edma *dw, struct dentry *dent) > > +static noinline_for_stack void > > +dw_edma_debugfs_regs_rd(struct dw_edma *dw, struct dentry *dent) > > { > > const struct dw_edma_debugfs_entry debugfs_regs[] = { > > /* eDMA global registers */ > > -- > > 2.39.0 > > -- > ~Vinod
On 10-02-23, 15:35, Serge Semin wrote: > Hello Vinod > > On Fri, Feb 10, 2023 at 02:22:28PM +0530, Vinod Koul wrote: > > On 30-01-23, 19:50, Arnd Bergmann wrote: > > > From: Arnd Bergmann <arnd@arndb.de> > > > > > > After the dw_edma_debugfs_entry arrays are no longer compile-time > > > constant, they take up space on the stack, which exceeds the warning > > > limit after inlining: > > > > > > drivers/dma/dw-edma/dw-edma-v0-debugfs.c:280:6: error: stack frame size (1784) exceeds limit (1400) in 'dw_edma_v0_debugfs_on' [-Werror,-Wframe-larger-than] > > > void dw_edma_v0_debugfs_on(struct dw_edma *dw) > > > > > > Work around this by preventing dw_edma_debugfs_regs_{wr,rd} from both > > > being inlined together, which cuts the stack frame size in half and > > > makes it fit below the warning limit. > > > > > > Fixes: 5c0373eafd83 ("dmaengine: dw-edma: Move eDMA data pointer to debugfs node descriptor") > > > Signed-off-by: Arnd Bergmann <arnd@arndb.de> > > > --- > > > v2: rebase on top of dmaengine tree > > > > I dont have 5c0373eafd83 in my tree, I guess that went thru PCI tree, so > > I am going to defer this after merge window > > It's in the @Bjorn tree now > https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git/commit/?h=pci/ctrl/dwc&id=5c0373eafd8334343da22338d8588ed61e8daba0 > > If you are ok with the fix then @Bjorn could take the patch in to his > repo. Right, @Bjorn? Sure: Acked-by: Vinod Koul <vkoul@kernel.org>
On Fri, Feb 10, 2023 at 03:35:25PM +0300, Serge Semin wrote: > On Fri, Feb 10, 2023 at 02:22:28PM +0530, Vinod Koul wrote: > > On 30-01-23, 19:50, Arnd Bergmann wrote: > > > From: Arnd Bergmann <arnd@arndb.de> > > > > > > After the dw_edma_debugfs_entry arrays are no longer compile-time > > > constant, they take up space on the stack, which exceeds the warning > > > limit after inlining: > > > > > > drivers/dma/dw-edma/dw-edma-v0-debugfs.c:280:6: error: stack frame size (1784) exceeds limit (1400) in 'dw_edma_v0_debugfs_on' [-Werror,-Wframe-larger-than] > > > void dw_edma_v0_debugfs_on(struct dw_edma *dw) > > > > > > Work around this by preventing dw_edma_debugfs_regs_{wr,rd} from both > > > being inlined together, which cuts the stack frame size in half and > > > makes it fit below the warning limit. > > > > > > Fixes: 5c0373eafd83 ("dmaengine: dw-edma: Move eDMA data pointer to debugfs node descriptor") > > > Signed-off-by: Arnd Bergmann <arnd@arndb.de> > > > --- > > > v2: rebase on top of dmaengine tree > > > > I dont have 5c0373eafd83 in my tree, I guess that went thru PCI tree, so > > I am going to defer this after merge window > > It's in the @Bjorn tree now > https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git/commit/?h=pci/ctrl/dwc&id=5c0373eafd8334343da22338d8588ed61e8daba0 > > If you are ok with the fix then @Bjorn could take the patch in to his > repo. Right, @Bjorn? Yes, I squashed this into the original patch and tweaked the whitespace per Manivannan's comment. Note that we've moved to a shared PCI git tree, so the helgaas/pci.git tree is obsolete and will bit rot until we remove it completely. The new one is: https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git/ Bjorn
On Fri, Feb 10, 2023 at 05:29:40PM -0600, Bjorn Helgaas wrote: > On Fri, Feb 10, 2023 at 03:35:25PM +0300, Serge Semin wrote: > > On Fri, Feb 10, 2023 at 02:22:28PM +0530, Vinod Koul wrote: > > > On 30-01-23, 19:50, Arnd Bergmann wrote: > > > > From: Arnd Bergmann <arnd@arndb.de> > > > > > > > > After the dw_edma_debugfs_entry arrays are no longer compile-time > > > > constant, they take up space on the stack, which exceeds the warning > > > > limit after inlining: > > > > > > > > drivers/dma/dw-edma/dw-edma-v0-debugfs.c:280:6: error: stack frame size (1784) exceeds limit (1400) in 'dw_edma_v0_debugfs_on' [-Werror,-Wframe-larger-than] > > > > void dw_edma_v0_debugfs_on(struct dw_edma *dw) > > > > > > > > Work around this by preventing dw_edma_debugfs_regs_{wr,rd} from both > > > > being inlined together, which cuts the stack frame size in half and > > > > makes it fit below the warning limit. > > > > > > > > Fixes: 5c0373eafd83 ("dmaengine: dw-edma: Move eDMA data pointer to debugfs node descriptor") > > > > Signed-off-by: Arnd Bergmann <arnd@arndb.de> > > > > --- > > > > v2: rebase on top of dmaengine tree > > > > > > I dont have 5c0373eafd83 in my tree, I guess that went thru PCI tree, so > > > I am going to defer this after merge window > > > > It's in the @Bjorn tree now > > https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git/commit/?h=pci/ctrl/dwc&id=5c0373eafd8334343da22338d8588ed61e8daba0 > > > > If you are ok with the fix then @Bjorn could take the patch in to his > > repo. Right, @Bjorn? > > Yes, I squashed this into the original patch and tweaked the > whitespace per Manivannan's comment. Great! Thanks. > > Note that we've moved to a shared PCI git tree, so the helgaas/pci.git > tree is obsolete and will bit rot until we remove it completely. > > The new one is: > > https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git/ Good to know. Thanks again. -Serge(y) > > Bjorn
diff --git a/drivers/dma/dw-edma/dw-edma-v0-debugfs.c b/drivers/dma/dw-edma/dw-edma-v0-debugfs.c index 42380bf64a70..6542060bd01a 100644 --- a/drivers/dma/dw-edma/dw-edma-v0-debugfs.c +++ b/drivers/dma/dw-edma/dw-edma-v0-debugfs.c @@ -136,7 +136,8 @@ static void dw_edma_debugfs_regs_ch(struct dw_edma *dw, enum dw_edma_dir dir, dw_edma_debugfs_create_x32(dw, debugfs_regs, nr_entries, dent); } -static void dw_edma_debugfs_regs_wr(struct dw_edma *dw, struct dentry *dent) +static noinline_for_stack void +dw_edma_debugfs_regs_wr(struct dw_edma *dw, struct dentry *dent) { const struct dw_edma_debugfs_entry debugfs_regs[] = { /* eDMA global registers */ @@ -197,7 +198,8 @@ static void dw_edma_debugfs_regs_wr(struct dw_edma *dw, struct dentry *dent) } } -static void dw_edma_debugfs_regs_rd(struct dw_edma *dw, struct dentry *dent) +static noinline_for_stack void +dw_edma_debugfs_regs_rd(struct dw_edma *dw, struct dentry *dent) { const struct dw_edma_debugfs_entry debugfs_regs[] = { /* eDMA global registers */