From: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
To: Miquel Raynal <miquel.raynal@bootlin.com>,
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>,
Takahiro Kuwano <Takahiro.Kuwano@infineon.com>,
Martin Kurbanov <mmkurbanov@salutedevices.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
Cc: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Subject: [PATCH v2 4/4] spi: spi-airoha-snfi: return an error for continuous mode dirmap creation cases
Date: Sat, 9 Aug 2025 00:01:47 +0300 [thread overview]
Message-ID: <20250808210147.3085391-5-mikhail.kshevetskiy@iopsys.eu> (raw)
In-Reply-To: <20250808210147.3085391-1-mikhail.kshevetskiy@iopsys.eu>
This driver can accelerate single page operations only, thus
continuous reading mode should not be used.
Continuous reading will use sizes up to the size of one erase block.
This size is much larger than the size of single flash page. Use this
difference to identify continuous reading and return an error.
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
---
drivers/spi/spi-airoha-snfi.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/spi/spi-airoha-snfi.c b/drivers/spi/spi-airoha-snfi.c
index dbe640986825..043a03cd90a1 100644
--- a/drivers/spi/spi-airoha-snfi.c
+++ b/drivers/spi/spi-airoha-snfi.c
@@ -618,6 +618,10 @@ static int airoha_snand_dirmap_create(struct spi_mem_dirmap_desc *desc)
if (desc->info.offset + desc->info.length > U32_MAX)
return -EINVAL;
+ /* continuous reading is not supported */
+ if (desc->info.length > SPI_NAND_CACHE_SIZE)
+ return -E2BIG;
+
if (!airoha_snand_supports_op(desc->mem, &desc->info.op_tmpl))
return -EOPNOTSUPP;
--
2.47.2
next prev parent reply other threads:[~2025-08-08 21:02 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-04 19:21 [PATCH 0/4] drivers: mtd: spi-nand: fix continuous reading mode Mikhail Kshevetskiy
2025-08-04 19:21 ` [PATCH 1/4] drivers: mtd: spi-nand: fix direct mapping creation sizes Mikhail Kshevetskiy
2025-08-05 15:24 ` Miquel Raynal
2025-08-04 19:21 ` [PATCH 2/4] drivers: mtd: spi-nand: try a regular dirmap if creating a dirmap for continuous reading fails Mikhail Kshevetskiy
2025-08-05 15:30 ` Miquel Raynal
2025-08-05 15:35 ` Mikhail Kshevetskiy
2025-08-06 9:03 ` Miquel Raynal
2025-08-08 21:01 ` [PATCH v2 0/4] mtd: spinand: fix continuous reading mode support Mikhail Kshevetskiy
2025-08-08 21:01 ` [PATCH v2 1/4] mtd: spinand: fix direct mapping creation sizes Mikhail Kshevetskiy
2025-08-08 21:01 ` [PATCH v2 2/4] mtd: spinand: try a regular dirmap if creating a dirmap for continuous reading fails Mikhail Kshevetskiy
2025-08-08 21:01 ` [PATCH v2 3/4] mtd: spinand: repeat reading in regular mode if " Mikhail Kshevetskiy
2025-08-08 21:01 ` Mikhail Kshevetskiy [this message]
2025-08-04 19:21 ` [PATCH 3/4] drivers: mtd: spi-nand: " Mikhail Kshevetskiy
2025-08-05 15:36 ` Miquel Raynal
2025-08-18 12:05 ` Mikhail Kshevetskiy
2025-08-04 19:21 ` [PATCH 4/4] drivers: spi: spi-airoha-snfi: return an error for continuous mode dirmap creation cases Mikhail Kshevetskiy
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=20250808210147.3085391-5-mikhail.kshevetskiy@iopsys.eu \
--to=mikhail.kshevetskiy@iopsys.eu \
--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=miquel.raynal@bootlin.com \
--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).