From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (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 13AEF2EDD69 for ; Thu, 29 Jan 2026 18:23:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.171.202.116 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769711030; cv=none; b=lZBFJG0pQGbjeeI6ToDF7fBCaiNI7udIscQ4unfD5CJvIZimgqP2yVW7DaLLqLkBujy6XfGAGPBQJ979A1v80wk0VtMmFGnMYQSxbi0BA/QwfD4FonP9YkQCvRZPmdGFOJuImy3xYVwM36yA7BPE/8bsUl8k7MYrp1Plp0Xrdxc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769711030; c=relaxed/simple; bh=ommC/eu2QpY+4Cq0nLk0ZpFQolUv4zEjWrAc/j/ZkIs=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=ORASGKRNFErvk1OZD4nllSaeBtOt0lEIJ+IuGokw0YXK08PseCxMO00cLlTlxL8S1dabdDvZvRwfyBbJ/uU/g+416XijO3GPDdpEXn78A49GFrjc58DDNp4wjyL71b0qY/f0wttGDVYxGrKorZRrb4igqX7lrCkvSOgMEK8gbN8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=VXe7PT/g; arc=none smtp.client-ip=185.171.202.116 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="VXe7PT/g" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 893E6C22F4A; Thu, 29 Jan 2026 18:23:46 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 72C9560746; Thu, 29 Jan 2026 18:23:43 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 75F60119A880F; Thu, 29 Jan 2026 19:23:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1769711023; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=PwAfvLWWh+vXsUJysWI2dSAkatsBYIcqHbbEI9TtIXQ=; b=VXe7PT/gHSvQHqhDCuWuGxpwjardbAu9bpULdSZfiirUs14NdGeho4ivjzEcWsK7yl17Jr 8xicnmreV2pohMU6Yb2GHuf7ODvdTuSQROGBbMJmQoSa+exJtUv0abo+bd6eYahRZNkQPd XUx9wePkVS6AO9JGjvV7CK7D+gZJGPMvnYK2TuyIsv2rNL0MPANiUSy9u8h9UNbeZ5XbpK 2B9gbtCp+tcLK9f/LcgQbmXJB0UOgOtpJCcgk1LnNcjpd9tcZ3jQEeDPH+dB72LUv5wMxR ROzojCZrbqdhNt+E2yz8rDjS/ajK4ib5r/2U6y/QP4MMckmCSi3Y87nNPmI6rA== From: Miquel Raynal To: Andy Shevchenko Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Richard Weinberger , Vignesh Raghavendra Subject: Re: [PATCH v1 1/1] mtd: cfi_cmdset_0001: Factor out do_write_buffer_locked() to reduce stack frame In-Reply-To: (Andy Shevchenko's message of "Sat, 24 Jan 2026 03:04:19 +0200") References: <20260124005203.3167280-1-andriy.shevchenko@linux.intel.com> User-Agent: mu4e 1.12.7; emacs 30.2 Date: Thu, 29 Jan 2026 19:23:39 +0100 Message-ID: <87ldhgl1lg.fsf@bootlin.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=utf-8 Content-Transfer-Encoding: quoted-printable X-Last-TLS-Session-Version: TLSv1.3 Hi Andy, >> Fix this by factoring out do_write_buffer_locked(). > > ... > >> XIP_INVAL_CACHED_RANGE(map, initial_adr, initial_len); >> ENABLE_VPP(map); > > It seems more logical to leave these two in the original call. > > ... [...] >> + DISABLE_VPP(map); > > Otherwise this will seem dangling here. > >> put_chip(map, chip, cmd_adr); >> mutex_unlock(&chip->mutex); >> return ret; > > ... > > Another approach is to leave goto as is in the _locked() and move DISABLE= _VPP() > there. > > Tell me what do you prefer? While I also find more logical to keep the ENABLE_VPP/DISABLE_VPP together, I do not mind to see them in one side or the other. I would by default let them in the main caller and suffi the inner function with "_locked()" as you did, but I'm fine either ways. Thanks, Miqu=C3=A8l