mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Pratyush Yadav" <pratyush@kernel.org>,
	"Richard Weinberger" <richard@nod.at>,
	"Vignesh Raghavendra" <vigneshr@ti.com>,
	"Takahiro Kuwano" <takahiro.kuwano@infineon.com>,
	"Miquel Raynal" <miquel.raynal@bootlin.com>,
	"Michael Walle" <mwalle@kernel.org>
Cc: "Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
	linux-mtd@lists.infradead.org, "Steam Lin" <STLin2@winbond.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 07/15] mtd: spi-nor: Allow configuring the actual number of dummy cycles
Date: Fri, 02 Oct 2026 12:34:15 +0000	[thread overview]
Message-ID: <20261002123416.3699B1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20261002-winbond-master-spi-nor-w35t-v1-7-a22a2f95c26e@bootlin.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] mtd: spi-nor: volatile dummy cycle hardware config lost on resume
--

commit 55807f7f87f4c66c05c4d5c678570e0e6e21c0c9
Author: Miquel Raynal <miquel.raynal@bootlin.com>

mtd: spi-nor: Allow configuring the actual number of dummy cycles

This commit introduces a callback to configure the actual number of dummy
cycles expected by the SPI NOR chip. It ensures that the chip is configured
properly when the number of dummy cycles is maximized for the fastest read
variant advertised by the SFDP tables.

> Crete a callback to configure the chip for expecting a specific number
> of dummy cycles.

[Severity: Low]
This isn't a bug, but there's a typo (Crete) in the commit message.

> diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
> index 381bbc13f82ff..f45c2c07d0245 100644
> --- a/drivers/mtd/spi-nor/core.c
> +++ b/drivers/mtd/spi-nor/core.c
> @@ -2636,7 +2636,17 @@ static int spi_nor_setup(struct spi_nor *nor,
>  		return err;
>  	}
>  
> -	return spi_nor_set_addr_nbytes(nor);
> +	err = spi_nor_set_addr_nbytes(nor);
> +	if (err)
> +		return err;
> +
> +	if (nor->params->set_dummy) {
> +		err = nor->params->set_dummy(nor, nor->read_dummy);
> +		if (err)
> +			return err;
> +	}

[Severity: High]
Is the dummy cycle hardware configuration lost during a suspend and resume
cycle?

When a SPI NOR chip loses power during system suspend, its volatile dummy
cycle configuration register is reset to its power-on default.

Upon system resume, spi_nor_resume() calls spi_nor_init() to re-initialize
the volatile state of the chip:

drivers/mtd/spi-nor/core.c:spi_nor_resume() {
	...
	/* re-initialize the nor chip */
	ret = spi_nor_init(nor);
	...
}

However, spi_nor_init() does not restore the dummy cycle configuration using
nor->params->set_dummy().

Since the software state (nor->read_dummy) retains the custom dummy cycle
count while the hardware reverts to the default count, will subsequent reads
be misaligned and lead to data corruption?

> +
> +	return 0;
>  }

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261002-winbond-master-spi-nor-w35t-v1-0-a22a2f95c26e@bootlin.com?part=7

  reply	other threads:[~2026-10-02 12:34 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-02 12:21 [PATCH 00/15] mtd: spi-nor: winbond: Add support for the W35TxxNW family Miquel Raynal
2026-10-02 12:21 ` [PATCH 01/15] mtd: spi-nor: Only switch to ODTR if the chip has a callback for it Miquel Raynal
2026-10-02 12:21 ` [PATCH 02/15] mtd: spi-nor: Fix spacing between arguments Miquel Raynal
2026-10-02 12:21 ` [PATCH 03/15] mtd: spi-nor: Fix comment indentation to clarify the intent Miquel Raynal
2026-10-02 12:21 ` [PATCH 04/15] mtd: spi-nor: sfdp: Enhance a comment Miquel Raynal
2026-10-02 12:21 ` [PATCH 05/15] mtd: spi-nor: Drop stale values Miquel Raynal
2026-10-02 12:21 ` [PATCH 06/15] mtd: spi-nor: Fix WRSR with ODTR chips Miquel Raynal
2026-10-02 12:34   ` sashiko-bot
2026-10-02 12:21 ` [PATCH 07/15] mtd: spi-nor: Allow configuring the actual number of dummy cycles Miquel Raynal
2026-10-02 12:34   ` sashiko-bot [this message]
2026-10-02 12:21 ` [PATCH 08/15] mtd: spi-nor: Fix SWP for octal DTR chips Miquel Raynal
2026-10-02 12:29   ` sashiko-bot
2026-10-02 12:21 ` [PATCH 09/15] mtd: spi-nor: winbond: Prepare the introduction of W35TxxNW parts Miquel Raynal
2026-10-02 12:45   ` sashiko-bot
2026-10-02 12:21 ` [PATCH 10/15] mtd: spi-nor: winbond: Add support for W35T64NW-C Miquel Raynal
2026-10-02 12:21 ` [PATCH 11/15] mtd: spi-nor: winbond: Add support for W35T12NW-C Miquel Raynal
2026-10-02 12:21 ` [PATCH 12/15] mtd: spi-nor: winbond: Add support for W35T25NW-C/E Miquel Raynal
2026-10-02 12:21 ` [PATCH 13/15] mtd: spi-nor: winbond: Add support for W35T51NW-C/E Miquel Raynal
2026-10-02 12:32   ` sashiko-bot
2026-10-02 12:21 ` [PATCH 14/15] mtd: spi-nor: winbond: Add support for W35T01NW-C/E Miquel Raynal
2026-10-02 12:21 ` [PATCH 15/15] mtd: spi-nor: winbond: Add support for W35T02NW-C/E Miquel Raynal

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=20261002123416.3699B1F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=STLin2@winbond.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=mwalle@kernel.org \
    --cc=pratyush@kernel.org \
    --cc=richard@nod.at \
    --cc=sashiko-reviews@lists.linux.dev \
    --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®