diff options
author | Farhan Ali <farhan.ali@broadcom.com> | 2021-02-24 15:25:53 -0800 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-04-12 17:17:11 -0400 |
commit | c146de48727da66ea7dc43f12bd41814cff2faa8 (patch) | |
tree | e8dda04332332209a06314f9bc6a2d33aea4948c | |
parent | bedab97a21d2c672a4ae96155bf3b53af86752f0 (diff) | |
download | u-boot-c146de48727da66ea7dc43f12bd41814cff2faa8.tar.gz |
mtd: Update fail_addr when erase fails due to bad blocks
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>
-rw-r--r-- | drivers/mtd/nand/raw/nand_base.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c index 6557faddf9..3679ee727e 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; } |