From: Srikanth Boyapally <srikanth.boyapally@amd.com>
To: Pratyush Yadav <pratyush@kernel.org>,
Michael Walle <mwalle@kernel.org>,
Takahiro Kuwano <takahiro.kuwano@infineon.com>,
Miquel Raynal <miquel.raynal@bootlin.com>,
Richard Weinberger <richard@nod.at>,
"Vignesh Raghavendra" <vigneshr@ti.com>
Cc: <linux-mtd@lists.infradead.org>, <linux-kernel@vger.kernel.org>,
<michal.simek@amd.com>, <git@amd.com>,
Srikanth Boyapally <srikanth.boyapally@amd.com>,
Sai Krishna Potthuri <sai.krishna.potthuri@amd.com>
Subject: [PATCH 2/2] mtd: spi-nor: Reset flash device on resume
Date: Fri, 20 Nov 2026 16:31:15 +0530 [thread overview]
Message-ID: <20261120-nor_11_20-v1-2-70332a54037f@amd.com> (raw)
In-Reply-To: <20261120-nor_11_20-v1-0-70332a54037f@amd.com>
From: Sai Krishna Potthuri <sai.krishna.potthuri@amd.com>
Reset the SPI NOR device before reinitializing it during resume.
This ensures that the flash is brought back to a known state before
spi_nor_init() restores the device configuration.
Signed-off-by: Sai Krishna Potthuri <sai.krishna.potthuri@amd.com>
Signed-off-by: Srikanth Boyapally <srikanth.boyapally@amd.com>
---
drivers/mtd/spi-nor/core.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
index 11227f8fa8ea..29bce6b7348d 100644
--- a/drivers/mtd/spi-nor/core.c
+++ b/drivers/mtd/spi-nor/core.c
@@ -45,6 +45,9 @@
#define SPI_NOR_SRST_SLEEP_MIN 200
#define SPI_NOR_SRST_SLEEP_MAX 400
+/* Perform a device reset */
+static int spi_nor_hw_reset(struct spi_nor *nor);
+
/**
* spi_nor_get_cmd_ext() - Get the command opcode extension based on the
* extension type.
@@ -3191,6 +3194,10 @@ static void spi_nor_resume(struct mtd_info *mtd)
struct device *dev = nor->dev;
int ret;
+ ret = spi_nor_hw_reset(nor);
+ if (ret)
+ dev_err(dev, "device reset failed during resume()\n");
+
/* re-initialize the nor chip */
ret = spi_nor_init(nor);
if (ret)
--
2.43.0
prev parent reply other threads:[~2026-11-20 11:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-20 11:01 [PATCH 0/2] mtd: spi-nor: Add flash reset support during resume Srikanth Boyapally
2026-11-20 11:01 ` [PATCH 1/2] mtd: spi-nor: Store GPIO info for resetting device " Srikanth Boyapally
2026-11-20 12:33 ` Michael Walle
2026-11-20 11:01 ` Srikanth Boyapally [this message]
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=20261120-nor_11_20-v1-2-70332a54037f@amd.com \
--to=srikanth.boyapally@amd.com \
--cc=git@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=michal.simek@amd.com \
--cc=miquel.raynal@bootlin.com \
--cc=mwalle@kernel.org \
--cc=pratyush@kernel.org \
--cc=richard@nod.at \
--cc=sai.krishna.potthuri@amd.com \
--cc=takahiro.kuwano@infineon.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®