From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) (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 7845118A93F for ; Wed, 8 Apr 2026 14:34:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.17 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775658843; cv=none; b=orpJnt/kTY0eMh8dE6727CtKCwZGj2huTYdz9FsfKNUG8c9WM+ykVOcNT/l/Xs75b61DaC3u9kc3/b94nBE1fSp98MMu0Nk0Ji6YQgrPU53rJ2k0KZAskBL16WEAOGzh9bW6f05T07FdFuhnDDzmY0ZLz/0grmVVTtywR8boaCo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775658843; c=relaxed/simple; bh=nqOqG5Y0bw2N3gZBXXVuy9ZFnSrp6BKjj2IhzRDWsw8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=hFYZ5pM2P5WWjxG0mct2UD/fMt8LbR/F2AuN3ayI0+/GOwqyV30FiQkBE/4gfEDb0Ds1UsLTyrohGlBAF1vh6RnDwP7yjRNC9be8va8e9pFr9i3862kgHgkAIj2UsQmVJjF7pwrG52LxltVcFK2IOz9wY5sx/HGLTrKVlZ4y4g0= 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=WoHrqFqX; arc=none smtp.client-ip=198.175.65.17 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="WoHrqFqX" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1775658842; x=1807194842; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=nqOqG5Y0bw2N3gZBXXVuy9ZFnSrp6BKjj2IhzRDWsw8=; b=WoHrqFqXHdKnWPeelW7DiTkc6hzw2a2NAkEz5ujnp80kEmlRQwtTSsD2 Mz3dw2UUol7TA0x0SUeDOpHas5gkpn3mFmOE6IoZrYR57icjUv3lK++/N GVKXDMbisZYqrZyoPwXu8+J6P/2lZoF0kFsv8WcW3Skp+iFINc8X+yCCe t17h2jQpKZZX423rQZPB27FLftuejEAxLLqkYaEN1he0sg8DGYHgvIe5h d+6nBLyoy3FT6SP/dvalH/Xj3ffxl77emcOVlcKKmXQ791Px91Wtp1yoD r8Btxwduf3rUX5/ZjNVKzGUmXtE4o38+WCRLFe0ny6NUpUvXazDnsKVd0 w==; X-CSE-ConnectionGUID: UKeyANizSPiItr3kEXuyzg== X-CSE-MsgGUID: XLv77C7OR6ydXasgFKG0BQ== X-IronPort-AV: E=McAfee;i="6800,10657,11753"; a="76609926" X-IronPort-AV: E=Sophos;i="6.23,167,1770624000"; d="scan'208";a="76609926" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Apr 2026 07:34:02 -0700 X-CSE-ConnectionGUID: shs8NeIhS9CLvIkiPvTbWg== X-CSE-MsgGUID: 2uZnOa+nS9qVF60o6hnUhQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,167,1770624000"; d="scan'208";a="232865436" Received: from vpanait-mobl.ger.corp.intel.com (HELO localhost) ([10.245.245.72]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Apr 2026 07:34:00 -0700 Date: Wed, 8 Apr 2026 17:33:58 +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 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. > 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! -- With Best Regards, Andy Shevchenko