Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mtd: rawnand: print offset instead of page number for bad blocks

This makes printed info consistent with other kernel messages. After
scanning NAND BBT create_bbt() prints offset of each bad block. This
change makes is easy to verify nand_erase_nand() failure reason.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20220326163304.30806-1-zajec5@gmail.com

authored by

Rafał Miłecki and committed by
Miquel Raynal
f7c48bcc 54647cd0

+5 -4
+5 -4
drivers/mtd/nand/raw/nand_base.c
··· 4502 4502 len = instr->len; 4503 4503 4504 4504 while (len) { 4505 + loff_t ofs = (loff_t)page << chip->page_shift; 4506 + 4505 4507 /* Check if we have a bad block, we do not erase bad blocks! */ 4506 4508 if (nand_block_checkbad(chip, ((loff_t) page) << 4507 4509 chip->page_shift, allowbbt)) { 4508 - pr_warn("%s: attempt to erase a bad block at page 0x%08x\n", 4509 - __func__, page); 4510 + pr_warn("%s: attempt to erase a bad block at 0x%08llx\n", 4511 + __func__, (unsigned long long)ofs); 4510 4512 ret = -EIO; 4511 4513 goto erase_exit; 4512 4514 } ··· 4526 4524 if (ret) { 4527 4525 pr_debug("%s: failed erase, page 0x%08x\n", 4528 4526 __func__, page); 4529 - instr->fail_addr = 4530 - ((loff_t)page << chip->page_shift); 4527 + instr->fail_addr = ofs; 4531 4528 goto erase_exit; 4532 4529 } 4533 4530