linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
To: Miquel Raynal <miquel.raynal@bootlin.com>,
	Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	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
Subject: Re: [PATCH v5 0/3] mtd: spinand: fix continuous reading mode support
Date: Fri, 29 Aug 2025 10:15:35 +0300	[thread overview]
Message-ID: <7a8ef758-3117-4b1c-8362-39e2efffd5ef@iopsys.eu> (raw)
In-Reply-To: <20250824181850.3994184-1-mikhail.kshevetskiy@iopsys.eu>

Miquel,
is there any comments?

Best regards,

Mikhail Kshevetskiy

On 24.08.2025 21:18, Mikhail Kshevetskiy wrote:
> Continuous reading mode is broken for some spi controllers. There are two
> possible bug scenarios:
>
> 1) "continuous mode" flash and spi controller without dirmap support,
>    but with restriction on transfer length in adjust_op_size()
>
> 2) "continuous mode" flash and spi controller with dirmap support for a
>    single flash page
>
> In the first case, any read that exceeds the limit specified in adjust_op_size()
> will result in an EIO error. The limit may even be less than a size of a single
> flash page. In this case, any read will result in an error.
>
> In the second case, any read larger than flash page size will result in an EIO
> error or spinand driver spoofing (because the spi controller driver returns
> more bytes than were actually read).
>
> This patch series tries to fix continuous reading (spinand driver side).
> Unfortunately these fixes can't resolve "spinand driver spoofing" case.
> Spi controller drivers might need fixes as well.
>
> Changes v2:
>  * added helper to create reading dirmap descriptor
>  * fix spelling
>  * error code is not used for regular reading fallback anymore
>  * it's possible (but very unlucky) that someone will do raw reading
>    of the flash in continuous mode (i.e. without OOB), so fix dirmap
>    creation for that case as well.
>
> Changes v3:
>  * improve description
>  * move airoha spi controller driver fix to a separate airoha spi fix series
>
> Changes v4:
>  * the period '.' at the end of the commit title was removed
>
> Changes v5:
>  * rename spinand_create_rdesc_helper() to spinand_create_rdesc()
>  * get rid of controller_is_buggy boolean
>
> Mikhail Kshevetskiy (3):
>   mtd: spinand: fix direct mapping creation sizes
>   mtd: spinand: try a regular dirmap if creating a dirmap for continuous
>     reading fails
>   mtd: spinand: repeat reading in regular mode if continuous reading
>     fails
>
>  drivers/mtd/nand/spi/core.c | 74 +++++++++++++++++++++++++++++--------
>  1 file changed, 59 insertions(+), 15 deletions(-)
>

  parent reply	other threads:[~2025-08-29  7:15 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-20 12:20 [PATCH v3 0/3] mtd: spinand: fix continuous reading mode support Mikhail Kshevetskiy
2025-08-20 12:20 ` [PATCH v3 1/3] mtd: spinand: fix direct mapping creation sizes Mikhail Kshevetskiy
2025-08-24 16:27   ` Miquel Raynal
2025-08-24 17:13     ` [PATCH v4 0/3] mtd: spinand: fix continuous reading mode support Mikhail Kshevetskiy
2025-08-24 17:13       ` [PATCH v4 1/3] mtd: spinand: fix direct mapping creation sizes Mikhail Kshevetskiy
2025-08-24 17:13       ` [PATCH v4 2/3] mtd: spinand: try a regular dirmap if creating a dirmap for continuous reading fails Mikhail Kshevetskiy
2025-08-24 17:13       ` [PATCH v4 3/3] mtd: spinand: repeat reading in regular mode if " Mikhail Kshevetskiy
2025-08-24 18:18       ` [PATCH v5 0/3] mtd: spinand: fix continuous reading mode support Mikhail Kshevetskiy
2025-08-24 18:18         ` [PATCH v5 1/3] mtd: spinand: fix direct mapping creation sizes Mikhail Kshevetskiy
2025-08-24 18:18         ` [PATCH v5 2/3] mtd: spinand: try a regular dirmap if creating a dirmap for continuous reading fails Mikhail Kshevetskiy
2025-08-24 18:18         ` [PATCH v5 3/3] mtd: spinand: repeat reading in regular mode if " Mikhail Kshevetskiy
2025-08-29  7:15         ` Mikhail Kshevetskiy [this message]
2025-08-20 12:20 ` [PATCH v3 2/3] mtd: spinand: try a regular dirmap if creating a dirmap for " Mikhail Kshevetskiy
2025-08-20 12:21 ` [PATCH v3 3/3] mtd: spinand: repeat reading in regular mode if " 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=7a8ef758-3117-4b1c-8362-39e2efffd5ef@iopsys.eu \
    --to=mikhail.kshevetskiy@iopsys.eu \
    --cc=Takahiro.Kuwano@infineon.com \
    --cc=chengminglin@mxic.com.tw \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=mmkurbanov@salutedevices.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).