public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Lukas Wunner <lukas@wunner.de>
Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>
Subject: Re: [PATCH v2 1/1] mtd: cfi_cmdset_0001: Factor out do_write_buffer_locked() to reduce stack frame
Date: Thu, 9 Apr 2026 00:17:28 +0300	[thread overview]
Message-ID: <adbF6F3N11cZDIIm@ashevche-desk.local> (raw)
In-Reply-To: <adZnVlDAsGTCCXF8@ashevche-desk.local>

On Wed, Apr 08, 2026 at 05:34:02PM +0300, Andy Shevchenko wrote:
> On Wed, Apr 08, 2026 at 03:40:30PM +0200, Lukas Wunner wrote:
> > On Wed, Apr 08, 2026 at 02:27:43PM +0300, Andy Shevchenko wrote:
> > > On Wed, Apr 08, 2026 at 08:35:52AM +0200, Lukas Wunner wrote:
> > > > On Wed, Feb 04, 2026 at 02:25:27AM +0100, Andy Shevchenko wrote:
> > > > > Compiler is not happy about used stack frame:
> > > > > 
> > > > > drivers/mtd/chips/cfi_cmdset_0001.c: In function 'do_write_buffer':
> > > > > drivers/mtd/chips/cfi_cmdset_0001.c:1887:1: error: the frame size of 1296 bytes is larger than 1280 bytes [-Werror=frame-larger-than=]
> > > > > 
> > > > > Fix this by factoring out do_write_buffer_locked().
> > > > 
> > > > FWIW, the issue only occurs with CONFIG_KASAN_STACK=y, so an alternative
> > > > to refactoring the function is to disable KASAN for this particular file:
> > > 
> > > I would like to avoid such big hammers.
> > > 
> > > Somehow I lost the track of this patch, I need to find it locally and check
> > > the status, I will come up with updated one once I found the latest version.
> > 
> > I just wanted to highlight that it's a KASAN-specific issue that doesn't
> > show up unless CONFIG_KASAN_STACK=y.  I think it's worth mentioning that
> > in the commit message.
> 
> Sure, makes sense.

Sorry, I forgot this in v3. If you still think it's crucial to have, I will
wait for MTD maintainers and update later on, but please, comment on v3, so
I won't forget it again (as it was two email threads for v2 and I missed one
to check carefully for the requests).

> > I'm not saying disabling KASAN is the right approach here, but it's one
> > *possible* approach.  Ideally the number of variables on the stack should
> > be reduced.  Perhaps alocating them on the heap would be more appropriate
> > than refactoring the code, I don't know.
> 
> Thanks, Lukas, for reviewing and proposing alternatives!

FWIW, v3 just has been sent: 20260408211407.2295175-1-andriy.shevchenko@linux.intel.com

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2026-04-08 21:17 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-04  1:25 [PATCH v2 1/1] mtd: cfi_cmdset_0001: Factor out do_write_buffer_locked() to reduce stack frame Andy Shevchenko
2026-02-04 21:12 ` Andy Shevchenko
2026-02-05  8:51   ` Miquel Raynal
2026-02-05 15:57     ` Andy Shevchenko
2026-02-05 17:34       ` Miquel Raynal
2026-02-06  5:56         ` Vignesh Raghavendra
2026-02-06  7:44           ` Andy Shevchenko
2026-04-08  6:35 ` Lukas Wunner
2026-04-08 11:27   ` Andy Shevchenko
2026-04-08 13:40     ` Lukas Wunner
2026-04-08 14:33       ` Andy Shevchenko
2026-04-08 21:17         ` Andy Shevchenko [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-01-24 13:35 Andy Shevchenko
2026-01-24 22:41 ` kernel test robot
2026-02-10 10:05   ` Vignesh Raghavendra
2026-02-10 14:45     ` Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=adbF6F3N11cZDIIm@ashevche-desk.local \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=lukas@wunner.de \
    --cc=miquel.raynal@bootlin.com \
    --cc=richard@nod.at \
    --cc=vigneshr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox