Skip to contentSkip to conversation

mtd: spinand: propagate spinand_wait() errors from spinand_write_page()

PATCH Applied Gabor Juhos 2 participants 2 messages Jul 8, 2025 – Jul 28, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mtd: spinand: propagate spinand_wait() errors from spinand_write_page()

Since commit 3d1f08b032dc ("mtd: spinand: Use the external ECC engine logic") the spinand_write_page() function ignores the errors returned by spinand_wait(). Change the code to propagate those up to the stack as it was done before the offending change.

Fixes 3d1f08b032dc ("mtd: spinand: Use the external ECC engine logic")
---
 drivers/mtd/nand/spi/core.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/mtd/nand/spi/core.c +4 -1
index 7099db7a62be61f563380b724ac849057a834211..8cce63aef1b5ad7cda2f6ab28d29565aa979498f 100644
@@ -688,7 +688,10 @@ int spinand_write_page(struct spinand_device *spinand,
 			   SPINAND_WRITE_INITIAL_DELAY_US,
 			   SPINAND_WRITE_POLL_DELAY_US,
 			   &status);
-	if (!ret && (status & STATUS_PROG_FAILED))
+	if (ret)
+		return ret;
+
+	if (status & STATUS_PROG_FAILED)
 		return -EIO;
 
 	return nand_ecc_finish_io_req(nand, (struct nand_page_io_req *)req);

---
base-commit: 19272b37aa4f83ca52bdf9c16d5d81bdd1354494
change-id: 20250708-spinand-propagate-wait-timeout-a0220ea7c322

Best regards,

Signature · 1 line
Gabor Juhos <[email protected]>
maintainer Applied
#1 lore raw
Quoted 6 lines · Gabor Juhos

Since commit 3d1f08b032dc ("mtd: spinand: Use the external ECC engine logic") the spinand_write_page() function ignores the errors returned by spinand_wait(). Change the code to propagate those up to the stack as it was done before the offending change.

Applied to nand/next, thanks!

[1/1] mtd: spinand: propagate spinand_wait() errors from spinand_write_page()

      commit: e4c896ce424a4aa248c1784c5cef9ddd0e4900fb

Patche(s) should be available on mtd/linux.git and will be part of the next PR (provided that no robot complains by then).

Kind regards,
Miquèl