All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [v2] dmaengine: dw-edma: reduce stack usage after debugfs rework
@ 2023-01-30 18:50 Arnd Bergmann
  2023-01-31  6:42 ` Manivannan Sadhasivam
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Arnd Bergmann @ 2023-01-30 18:50 UTC (permalink / raw)
  To: Gustavo Pimentel, Vinod Koul, Serge Semin
  Cc: Arnd Bergmann, Manivannan Sadhasivam, Bjorn Helgaas,
	Lorenzo Pieralisi, Frank Li, dmaengine, linux-kernel

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(-)

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


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] [v2] dmaengine: dw-edma: reduce stack usage after debugfs rework
  2023-01-30 18:50 [PATCH] [v2] dmaengine: dw-edma: reduce stack usage after debugfs rework Arnd Bergmann
@ 2023-01-31  6:42 ` Manivannan Sadhasivam
  2023-01-31  7:54 ` Serge Semin
  2023-02-10  8:52 ` Vinod Koul
  2 siblings, 0 replies; 8+ messages in thread
From: Manivannan Sadhasivam @ 2023-01-31  6:42 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Gustavo Pimentel, Vinod Koul, Serge Semin, Arnd Bergmann,
	Bjorn Helgaas, Lorenzo Pieralisi, Frank Li, dmaengine,
	linux-kernel

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
> 

-- 
மணிவண்ணன் சதாசிவம்

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] [v2] dmaengine: dw-edma: reduce stack usage after debugfs rework
  2023-01-30 18:50 [PATCH] [v2] dmaengine: dw-edma: reduce stack usage after debugfs rework Arnd Bergmann
  2023-01-31  6:42 ` Manivannan Sadhasivam
@ 2023-01-31  7:54 ` Serge Semin
  2023-02-10  8:52 ` Vinod Koul
  2 siblings, 0 replies; 8+ messages in thread
From: Serge Semin @ 2023-01-31  7:54 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Gustavo Pimentel, Vinod Koul, Serge Semin, Arnd Bergmann,
	Manivannan Sadhasivam, Bjorn Helgaas, Lorenzo Pieralisi,
	Frank Li, dmaengine, linux-kernel

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
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] [v2] dmaengine: dw-edma: reduce stack usage after debugfs rework
  2023-01-30 18:50 [PATCH] [v2] dmaengine: dw-edma: reduce stack usage after debugfs rework Arnd Bergmann
  2023-01-31  6:42 ` Manivannan Sadhasivam
  2023-01-31  7:54 ` Serge Semin
@ 2023-02-10  8:52 ` Vinod Koul
  2023-02-10 12:35   ` Serge Semin
  2 siblings, 1 reply; 8+ messages in thread
From: Vinod Koul @ 2023-02-10  8:52 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Gustavo Pimentel, Serge Semin, Arnd Bergmann,
	Manivannan Sadhasivam, Bjorn Helgaas, Lorenzo Pieralisi,
	Frank Li, dmaengine, linux-kernel

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

-- 
~Vinod

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] [v2] dmaengine: dw-edma: reduce stack usage after debugfs rework
  2023-02-10  8:52 ` Vinod Koul
@ 2023-02-10 12:35   ` Serge Semin
  2023-02-10 15:25     ` Vinod Koul
  2023-02-10 23:29     ` Bjorn Helgaas
  0 siblings, 2 replies; 8+ messages in thread
From: Serge Semin @ 2023-02-10 12:35 UTC (permalink / raw)
  To: Vinod Koul, Bjorn Helgaas
  Cc: Arnd Bergmann, Gustavo Pimentel, Serge Semin, Arnd Bergmann,
	Manivannan Sadhasivam, Lorenzo Pieralisi, Frank Li, dmaengine,
	linux-kernel

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] [v2] dmaengine: dw-edma: reduce stack usage after debugfs rework
  2023-02-10 12:35   ` Serge Semin
@ 2023-02-10 15:25     ` Vinod Koul
  2023-02-10 23:29     ` Bjorn Helgaas
  1 sibling, 0 replies; 8+ messages in thread
From: Vinod Koul @ 2023-02-10 15:25 UTC (permalink / raw)
  To: Serge Semin
  Cc: Bjorn Helgaas, Arnd Bergmann, Gustavo Pimentel, Serge Semin,
	Arnd Bergmann, Manivannan Sadhasivam, Lorenzo Pieralisi,
	Frank Li, dmaengine, linux-kernel

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>

-- 
~Vinod

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] [v2] dmaengine: dw-edma: reduce stack usage after debugfs rework
  2023-02-10 12:35   ` Serge Semin
  2023-02-10 15:25     ` Vinod Koul
@ 2023-02-10 23:29     ` Bjorn Helgaas
  2023-02-12 19:23       ` Serge Semin
  1 sibling, 1 reply; 8+ messages in thread
From: Bjorn Helgaas @ 2023-02-10 23:29 UTC (permalink / raw)
  To: Serge Semin
  Cc: Vinod Koul, Bjorn Helgaas, Arnd Bergmann, Gustavo Pimentel,
	Serge Semin, Arnd Bergmann, Manivannan Sadhasivam,
	Lorenzo Pieralisi, Frank Li, dmaengine, linux-kernel

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] [v2] dmaengine: dw-edma: reduce stack usage after debugfs rework
  2023-02-10 23:29     ` Bjorn Helgaas
@ 2023-02-12 19:23       ` Serge Semin
  0 siblings, 0 replies; 8+ messages in thread
From: Serge Semin @ 2023-02-12 19:23 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Vinod Koul, Bjorn Helgaas, Arnd Bergmann, Gustavo Pimentel,
	Serge Semin, Arnd Bergmann, Manivannan Sadhasivam,
	Lorenzo Pieralisi, Frank Li, dmaengine, linux-kernel

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-02-12 19:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-30 18:50 [PATCH] [v2] dmaengine: dw-edma: reduce stack usage after debugfs rework Arnd Bergmann
2023-01-31  6:42 ` Manivannan Sadhasivam
2023-01-31  7:54 ` Serge Semin
2023-02-10  8:52 ` Vinod Koul
2023-02-10 12:35   ` Serge Semin
2023-02-10 15:25     ` Vinod Koul
2023-02-10 23:29     ` Bjorn Helgaas
2023-02-12 19:23       ` Serge Semin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.