public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: linux-mtd@lists.infradead.org,  linux-kernel@vger.kernel.org,
	 Richard Weinberger <richard@nod.at>,
	 Vignesh Raghavendra <vigneshr@ti.com>
Subject: Re: [PATCH v1 1/1] mtd: cfi_cmdset_0001: Factor out do_write_buffer_locked() to reduce stack frame
Date: Thu, 29 Jan 2026 19:23:39 +0100	[thread overview]
Message-ID: <87ldhgl1lg.fsf@bootlin.com> (raw)
In-Reply-To: <aXQak2FKyQpdQW2M@smile.fi.intel.com> (Andy Shevchenko's message of "Sat, 24 Jan 2026 03:04:19 +0200")

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èl

  reply	other threads:[~2026-01-29 18:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-24  0:52 [PATCH v1 1/1] mtd: cfi_cmdset_0001: Factor out do_write_buffer_locked() to reduce stack frame Andy Shevchenko
2026-01-24  1:04 ` Andy Shevchenko
2026-01-29 18:23   ` Miquel Raynal [this message]
2026-02-01  9:59     ` Raghavendra, Vignesh
2026-02-04  1:27       ` 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=87ldhgl1lg.fsf@bootlin.com \
    --to=miquel.raynal@bootlin.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --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