Skip to contentSkip to conversation

mtd: Notify user when erasure of a block failed during erase op

PATCH Applied Stefan Riedmueller 2 participants 2 messages Mar 16, 2021 – Mar 17, 2021 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mtd: Notify user when erasure of a block failed during erase op

Give the user information about the faulty block when an erase operation fails with error.

---
 drivers/mtd/core.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/mtd/core.c +4 -1
index af33ad665c5a..22eb2a056c4e 100644
@@ -222,8 +222,11 @@ static int mtd_op_erase(struct cdev *cdev, loff_t count, loff_t offset)
 			printf("Skipping bad block at 0x%08llx\n", addr);
 		} else {
 			ret = mtd_erase(mtd, &erase);
-			if (ret)
+			if (ret) {
+				printf("%s: failed to erase block at 0x%08llx\n",
+					__func__, addr);
 				return ret;
+			}
 		}
 
 		addr += mtd->erasesize;
Signature · 7 lines
2.25.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Applied
#1 lore raw
Quoted 7 lines · Stefan Riedmueller

Give the user information about the faulty block when an erase operation fails with error.

---
 drivers/mtd/core.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Applied, thanks

Sascha

Quoted 27 lines
drivers/mtd/core.c +4 -1
index af33ad665c5a..22eb2a056c4e 100644
@@ -222,8 +222,11 @@ static int mtd_op_erase(struct cdev *cdev, loff_t count, loff_t offset)
 			printf("Skipping bad block at 0x%08llx\n", addr);
 		} else {
 			ret = mtd_erase(mtd, &erase);
-			if (ret)
+			if (ret) {
+				printf("%s: failed to erase block at 0x%08llx\n",
+					__func__, addr);
 				return ret;
+			}
 		}
 
 		addr += mtd->erasesize;
Signature · 7 lines
2.25.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Signature · 9 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox