mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Santhosh Kumar K <s-k6@ti.com>
To: Miquel Raynal <miquel.raynal@bootlin.com>,
	Mark Brown <broonie@kernel.org>,
	Richard Weinberger <richard@nod.at>,
	"Vignesh Raghavendra" <vigneshr@ti.com>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	<linux-spi@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-mtd@lists.infradead.org>,
	Michael Walle <mwalle@kernel.org>,
	"Takahiro Kuwano" <takahiro.kuwano@infineon.com>,
	Pratyush Yadav <pratyush@kernel.org>,
	Steam Lin <STLin2@winbond.com>, <s-k6@ti.com>
Subject: Re: [PATCH 4/4] spi: cadence-qspi: Prevent SPI NAND continuous reads
Date: Wed, 10 Jun 2026 11:33:43 +0530	[thread overview]
Message-ID: <d60a2a0b-a548-4cf2-8e0a-5f8be066a34c@ti.com> (raw)
In-Reply-To: <20260326-winbond-v7-0-rc1-cadence-cont-read-v1-4-0d626e1dfb2b@bootlin.com>

Hello Mark and Miquel,

On 26/03/26 22:17, Miquel Raynal wrote:
> TI AM62Ax errata i2351, entitled "OSPI: Direct Access Controller (DAC)
> does not support Continuous Read mode with NAND Flash", explains that
> the CS can be deasserted almost at any time during a transfer (basically
> there is an interconnect arbitration every 1023 byte). This is an
> expected internal behaviour of the controller, but this leads to
> spurious CS deasserts. These are totally forbidden during SPI NAND
> continuous read transfers, because they indicate an end of transfer and
> the continuous read is then stopped on the flash side.
> 
> I initially tried to query the flash type and geometry to decide whether
> to apply a spi message size limit (there is a spi helper for that) but
> we cannot reliably get up to the MTD structure to discriminate if it is
> a NOR or a NAND we are playing with (it is not relevant to limit SPI NOR
> transfers, they are not affected). If we actually take this path, what
> limitation shall we enforce? The errata mentions 1023B, this is super
> low, less than a typical page size (about 2k or 4k, for most of them),
> so this is not usable. On my side, I only observed this problem on a
> 2-page read in octal DTR mode with more than 12 dummy cycles. The
> writesize summed with the oobsize could be a relevant boundary, but it
> is still quite arbitrary. Hence, I opted for implementing a controller
> capability flag, which then is used to decide whether the SPI NAND
> continuous read feature can be enabled.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>

Just to confirm, has this patch not been picked up yet?

Regards,
Santhosh.

> ---
> I do not know if all flavours of this controller have the same
> limitation, or whether it is integration specific. As I only found
> mention of this errata for the AM62 processor, I opted for limiting the
> flag to a single compatible.
> ---
>   drivers/spi/spi-cadence-quadspi.c | 8 ++++++++
>   1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c
> index 649ff55333f0..9f9b3013aa5d 100644
> --- a/drivers/spi/spi-cadence-quadspi.c
> +++ b/drivers/spi/spi-cadence-quadspi.c
> @@ -1740,6 +1740,12 @@ static const struct spi_controller_mem_caps cqspi_mem_caps = {
>   	.per_op_freq = true,
>   };
>   
> +static const struct spi_controller_mem_caps cqspi_am654_mem_caps = {
> +	.dtr = true,
> +	.per_op_freq = true,
> +	.no_cs_assertion = true,
> +};
> +
>   static int cqspi_setup_flash(struct cqspi_st *cqspi)
>   {
>   	struct platform_device *pdev = cqspi->pdev;
> @@ -1797,6 +1803,8 @@ static int cqspi_probe(struct platform_device *pdev)
>   	host->mode_bits = SPI_RX_QUAD | SPI_RX_DUAL;
>   	host->mem_ops = &cqspi_mem_ops;
>   	host->mem_caps = &cqspi_mem_caps;
> +	if (of_device_is_compatible(pdev->dev.of_node, "ti,am654-ospi"))
> +		host->mem_caps = &cqspi_am654_mem_caps;
>   
>   	cqspi = spi_controller_get_devdata(host);
>   	if (of_device_is_compatible(pdev->dev.of_node, "starfive,jh7110-qspi"))
> 


  reply	other threads:[~2026-06-10  6:04 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-26 16:47 [PATCH 0/4] spi: spi-mem/mtd: spinand: Prevent SPI NAND continuous reads on am65/am62 Miquel Raynal
2026-03-26 16:47 ` [PATCH 1/4] spi: spi-mem: Add a no_cs_assertion capability Miquel Raynal
2026-04-27 23:46   ` Mark Brown
2026-06-10  7:00   ` Michael Walle
2026-03-26 16:47 ` [PATCH 2/4] mtd: spinand: Make sure continuous read is always disabled during probe Miquel Raynal
2026-03-26 16:47 ` [PATCH 3/4] mtd: spinand: Prevent continuous reads on some controllers Miquel Raynal
2026-03-26 16:47 ` [PATCH 4/4] spi: cadence-qspi: Prevent SPI NAND continuous reads Miquel Raynal
2026-06-10  6:03   ` Santhosh Kumar K [this message]
2026-04-27 13:28 ` [PATCH 0/4] spi: spi-mem/mtd: spinand: Prevent SPI NAND continuous reads on am65/am62 Miquel Raynal
2026-04-27 23:45   ` Mark Brown
2026-04-28 12:44 ` Miquel Raynal
2026-09-28 14:51   ` Miquel Raynal
2026-09-28 15:08     ` Mark Brown
2026-10-01 16:39       ` Miquel Raynal
2026-10-04 13:37         ` Mark Brown

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=d60a2a0b-a548-4cf2-8e0a-5f8be066a34c@ti.com \
    --to=s-k6@ti.com \
    --cc=STLin2@winbond.com \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=mwalle@kernel.org \
    --cc=pratyush@kernel.org \
    --cc=richard@nod.at \
    --cc=takahiro.kuwano@infineon.com \
    --cc=thomas.petazzoni@bootlin.com \
    --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

all inboxes | Powered by JetHome®