From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Cc: Richard Weinberger <richard@nod.at>,
Vignesh Raghavendra <vigneshr@ti.com>,
Lorenzo Bianconi <lorenzo@kernel.org>,
Ray Liu <ray.liu@airoha.com>, Mark Brown <broonie@kernel.org>,
Tudor Ambarus <tudor.ambarus@linaro.org>,
Martin Kurbanov <mmkurbanov@salutedevices.com>,
Takahiro Kuwano <Takahiro.Kuwano@infineon.com>,
Cheng Ming Lin <chengminglin@mxic.com.tw>,
linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, linux-spi@vger.kernel.org
Subject: Re: [PATCH RESEND v2 2/4] mtd: spinand: try a regular dirmap if creating a dirmap for continuous reading fails
Date: Sun, 24 Aug 2025 18:26:16 +0200 [thread overview]
Message-ID: <87jz2sit3r.fsf@bootlin.com> (raw)
In-Reply-To: <20250814065423.3980305-3-mikhail.kshevetskiy@iopsys.eu> (Mikhail Kshevetskiy's message of "Thu, 14 Aug 2025 09:54:21 +0300")
On 14/08/2025 at 09:54:21 +03, Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu> wrote:
> Continuous reading may result in multiple flash pages reading in one
> operation. Typically only one flash page has read/written (a little bit
> more than 2-4 Kb), but continuous reading requires the spi controller
> to read up to 512 Kb in one operation without toggling CS in beetween.
>
> Roughly speaking spi controllers can be divided on 2 categories:
> * spi controllers without dirmap acceleration support
> * spi controllers with dirmap acceleration support
>
> Usually, first of them have no issues with large reading support.
> Second group often supports acceleration of single page only reading.
> Thus enabling of continuous reading can break flash reading.
>
> This patch tries to create dirmap for continuous reading first and
> fallback to regular reading if spi controller refuses to create it.
>
> Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
> ---
> drivers/mtd/nand/spi/core.c | 43 ++++++++++++++++++++++++++++++-------
> 1 file changed, 35 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
> index 09dd6e40e308..0f8636047365 100644
> --- a/drivers/mtd/nand/spi/core.c
> +++ b/drivers/mtd/nand/spi/core.c
> @@ -1093,6 +1093,39 @@ static int spinand_mtd_block_isreserved(struct mtd_info *mtd, loff_t offs)
> return ret;
> }
>
> +static struct spi_mem_dirmap_desc *spinand_create_rdesc_helper(
Can we drop _helper from the name? Just spinand_create_rdesc() sounds
as useful.
> + struct spinand_device *spinand,
> + struct spi_mem_dirmap_info *info)
> +{
> + struct nand_device *nand = spinand_to_nand(spinand);
> + struct spi_mem_dirmap_desc *desc = NULL;
> +
Looks good otherwise.
Thanks,
Miquèl
next prev parent reply other threads:[~2025-08-24 16:26 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-14 6:54 [PATCH RESEND v2 0/4] mtd: spinand: fix continuous reading mode support Mikhail Kshevetskiy
2025-08-14 6:54 ` [PATCH RESEND v2 1/4] mtd: spinand: fix direct mapping creation sizes Mikhail Kshevetskiy
2025-08-14 6:54 ` [PATCH RESEND v2 2/4] mtd: spinand: try a regular dirmap if creating a dirmap for continuous reading fails Mikhail Kshevetskiy
2025-08-24 16:26 ` Miquel Raynal [this message]
2025-08-14 6:54 ` [PATCH RESEND v2 3/4] mtd: spinand: repeat reading in regular mode if " Mikhail Kshevetskiy
2025-08-24 16:24 ` Miquel Raynal
2025-08-14 6:54 ` [PATCH RESEND v2 4/4] spi: spi-airoha-snfi: return an error for continuous mode dirmap creation cases Mikhail Kshevetskiy
2025-08-14 15:29 ` Mark Brown
2025-08-14 15:33 ` Mikhail Kshevetskiy
2025-08-20 8:49 ` Frieder Schrempf
2025-08-20 9:49 ` Mikhail Kshevetskiy
2025-08-21 6:49 ` Lorenzo Bianconi
2025-08-24 15:50 ` Miquel Raynal
2025-08-20 8:49 ` Frieder Schrempf
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=87jz2sit3r.fsf@bootlin.com \
--to=miquel.raynal@bootlin.com \
--cc=Takahiro.Kuwano@infineon.com \
--cc=broonie@kernel.org \
--cc=chengminglin@mxic.com.tw \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=linux-spi@vger.kernel.org \
--cc=lorenzo@kernel.org \
--cc=mikhail.kshevetskiy@iopsys.eu \
--cc=mmkurbanov@salutedevices.com \
--cc=ray.liu@airoha.com \
--cc=richard@nod.at \
--cc=tudor.ambarus@linaro.org \
--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;
as well as URLs for NNTP newsgroup(s).