From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) (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 5CB9E314A95 for ; Wed, 8 Apr 2026 21:17:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.20 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775683053; cv=none; b=qQ88vGSvFSoiBm/pAlF8WauEwDUEdfbmgib+s5GosvMrUFw32cHZ0EHRax82jLOVnu3ISeMhN1Qn9MPbOGYCxBDUQwZ36PyyT12R3F2Q6NBjK5Lw3nCYy1lb5lfBf6R5txmcoL3cN+4igM2zU+eXBjuSPBC8JpGo3UtnKWx0BGo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775683053; c=relaxed/simple; bh=Pz81uMFs2Qmae/VhHfgnh2rVYPhupxolCWPOu86YAbw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=d2TpY2oxgwdj94PkwR98j7IklJWYcJFYhpyqTi6N+Vk3QjqrUuL7N6hLxnLmctvB1y8p4arC4ZP0/oE0PNgmKH2EUoTwSu80eXQPkN1uW+jR5yqDMCBoqlKtCZ7h50gT3A0RitkawhHB+7xwrjvX4ZTphbSrXfvM4VBA6q2v8dc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=U+mLeu5X; arc=none smtp.client-ip=198.175.65.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="U+mLeu5X" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1775683052; x=1807219052; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=Pz81uMFs2Qmae/VhHfgnh2rVYPhupxolCWPOu86YAbw=; b=U+mLeu5XsVxp67VbRFpip3I+gWYA3Zd0zZ9n4fkWwO8gG4PnWvsHN2pn 3lfxuFgTd3R3hthkckXs8HyLRd8lOVgfrxQnJ8G1C03ag+MtKxRXZX+iF qKQeIg0MkKiFi/ClkD+l1O+N8Fxbg4AD/8mPc3dXQBu/r4ghOUa7jMKhH 6NqaccOKhc62+26wxIy4fc1HQvBVHV10z+73nvehRjjyqywdhawlNjxUD 9aZl4Bz2GSBKZStRVlyOYeXFMFK4GdAyDlSwCFHBqHsY8dWX3OhAsV5Lg eIjoCmP1cfF9rQfZuY5dj/WtDLF8oGWt7Dr+Kln9YOO5vZUHDeoSKXJpv g==; X-CSE-ConnectionGUID: AgQJlOMZTqWlYhQQh8+r9w== X-CSE-MsgGUID: uV/cv/dCTHGAKZBfnxLDEg== X-IronPort-AV: E=McAfee;i="6800,10657,11753"; a="76396230" X-IronPort-AV: E=Sophos;i="6.23,168,1770624000"; d="scan'208";a="76396230" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Apr 2026 14:17:32 -0700 X-CSE-ConnectionGUID: /6SbeINxR0KpWpI5k7UQOQ== X-CSE-MsgGUID: 1rkp+oivQWaqAwfPr0zc8g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,168,1770624000"; d="scan'208";a="223823953" Received: from vpanait-mobl.ger.corp.intel.com (HELO localhost) ([10.245.245.72]) by fmviesa006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Apr 2026 14:17:30 -0700 Date: Thu, 9 Apr 2026 00:17:28 +0300 From: Andy Shevchenko To: Lukas Wunner 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: Organization: Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo 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