public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH] mtd: Update fail_addr when erase fails due to bad blocks
@ 2021-02-24 23:25 Farhan Ali
  2021-04-13 14:27 ` Tom Rini
  0 siblings, 1 reply; 2+ messages in thread
From: Farhan Ali @ 2021-02-24 23:25 UTC (permalink / raw)
  To: u-boot

For all other erase failures, the fail_addr is updated with the
failing address. Only in the case of erase failure due to bad block
detection, the fail_addr is not updated. This change simply updates
the fail_addr for this specific scenario so that it is consistent with
the rest of the code.

Signed-off-by: Farhan Ali <farhan.ali@broadcom.com>
---
Cc: Simon Glass <sjg@chromium.org>

 drivers/mtd/nand/raw/nand_base.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c
index 6557fad..3679ee7 100644
--- a/drivers/mtd/nand/raw/nand_base.c
+++ b/drivers/mtd/nand/raw/nand_base.c
@@ -3559,6 +3559,8 @@ int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr,
 			pr_warn("%s: attempt to erase a bad block at page 0x%08x\n",
 				    __func__, page);
 			instr->state = MTD_ERASE_FAILED;
+			instr->fail_addr =
+				((loff_t)page << chip->page_shift);
 			goto erase_exit;
 		}
 
-- 
1.8.3.1

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4203 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210224/54e9bd03/attachment.bin>

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH] mtd: Update fail_addr when erase fails due to bad blocks
  2021-02-24 23:25 [PATCH] mtd: Update fail_addr when erase fails due to bad blocks Farhan Ali
@ 2021-04-13 14:27 ` Tom Rini
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini @ 2021-04-13 14:27 UTC (permalink / raw)
  To: u-boot

On Wed, Feb 24, 2021 at 03:25:53PM -0800, Farhan Ali wrote:

> For all other erase failures, the fail_addr is updated with the
> failing address. Only in the case of erase failure due to bad block
> detection, the fail_addr is not updated. This change simply updates
> the fail_addr for this specific scenario so that it is consistent with
> the rest of the code.
> 
> Signed-off-by: Farhan Ali <farhan.ali@broadcom.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210413/00742a9c/attachment.sig>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-04-13 14:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-24 23:25 [PATCH] mtd: Update fail_addr when erase fails due to bad blocks Farhan Ali
2021-04-13 14:27 ` Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox