From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailout3.hostsharing.net (mailout3.hostsharing.net [144.76.133.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 57E2F3CF042 for ; Wed, 8 Apr 2026 13:40:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=144.76.133.104 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775655633; cv=none; b=umo1CzkeXM+rAzMsMpBFlS3sF7+33YUF/Ohif7hjISixsblmaX22gPwLJ6YChprltSGZ/phTojt2Mr4Ajp23ZTrgLoY8IyBW66VFjvVnNguLzE/Cj0+Nb8+KL3g2pQBmwzOhYjTvxPP0S7Jh3VFp+5hh7D1Jcd4vojh+ELj5xW4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775655633; c=relaxed/simple; bh=4rLJONxzCyJVWA/0Irv7IWbUoPFkeSMOfPgP8Aih06U=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=fkQIQhiuYc15dFrGXKsw2OsPvpGLLIFTBQMQ31uPnqO7jVasvfb1aaIicFr52LrJbbqwuBjLy015fm5RRqLtBdR1jGBVYAqFUzkd23S4EMAef/pdVCkLNJBrB82L1PbWNnMqp0BWYQEf/LA8XD/HhM4CBVhYybAbPiw3IRYKHm4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=wunner.de; spf=pass smtp.mailfrom=wunner.de; arc=none smtp.client-ip=144.76.133.104 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=wunner.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wunner.de Received: from h08.hostsharing.net (h08.hostsharing.net [IPv6:2a01:37:1000::53df:5f1c:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384 client-signature ECDSA (secp384r1) client-digest SHA384) (Client CN "*.hostsharing.net", Issuer "GlobalSign GCC R6 AlphaSSL CA 2025" (verified OK)) by mailout3.hostsharing.net (Postfix) with ESMTPS id D88A4C1D; Wed, 08 Apr 2026 15:40:30 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id ACABE60E3C71; Wed, 8 Apr 2026 15:40:30 +0200 (CEST) Date: Wed, 8 Apr 2026 15:40:30 +0200 From: Lukas Wunner To: Andy Shevchenko Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Miquel Raynal , Richard Weinberger , Vignesh Raghavendra Subject: Re: [PATCH v2 1/1] mtd: cfi_cmdset_0001: Factor out do_write_buffer_locked() to reduce stack frame Message-ID: References: <20260204012630.2211832-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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. 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