On 19/09/2019 14.15, Sean Nyekjaer wrote:
Hi Sascha
Please let me know when you have some time to look into this :-)
I dosen't seem right that it writes the bbt on a 4.19 series kernel
twice
For me the disturbing part is:
[ 4.175918] Bad block table not found for chip 0
[ 4.184059] Bad block table not found for chip 0
Writing the BBT twice is expected.
Thanks,
Miquèl
Hi,
Tried this:
diff --git a/drivers/mtd/nand/raw/nand_bbt.c
b/drivers/mtd/nand/raw/nand_bbt.c
index 39db352f8757..b0337f8a0da4 100644
--- a/drivers/mtd/nand/raw/nand_bbt.c
+++ b/drivers/mtd/nand/raw/nand_bbt.c
@@ -1200,6 +1200,8 @@ static int nand_scan_bbt(struct mtd_info *mtd,
struct nand_bbt_descr *bd)
if (res)
goto err;
+ search_read_bbts(mtd, buf, td, md);
+
/* Prevent the bbt regions from erasing / writing */
mark_bbt_region(mtd, td);
if (md
Result is:
[ 2.191412] nand: device found, Manufacturer ID: 0x98, Chip ID: 0xdc
[ 2.198095] nand: Toshiba NAND 512MiB 3,3V 8-bit
[ 2.202848] nand: 512 MiB, SLC, erase size: 256 KiB, page size: 4096,
OOB size: 128
[ 2.217337] Bad block table not found for chip 0
[ 2.225535] Bad block table not found for chip 0
[ 2.230475] Scanning device for bad blocks
[ 2.749832] Bad eraseblock 798 at 0x00000c780000
[ 3.230712] Bad eraseblock 1536 at 0x000018000000
[ 3.236263] Bad eraseblock 1537 at 0x000018040000
[ 3.574122] Bad block table written to 0x00001ffc0000, version 0x01
[ 3.584874] Bad block table written to 0x00001ff80000, version 0x01
[ 3.592306] Bad block table found at page 131008, version 0x01
[ 3.600059] Bad block table found at page 130944, version 0x01
[ 3.607129] 3 fixed-partitions partitions found on MTD device gpmi-nand
[ 3.614105] Creating 3 MTD partitions on "gpmi-nand":
[ 3.619540] 0x000000000000-0x000000800000 : "boot"
[ 3.635437] 0x000000800000-0x00001ca00000 : "ubi"
[ 4.018183] 0x00001ca00000-0x000020000000 : "testing"
[ 4.070734] gpmi-nand 1806000.gpmi-nand: driver registered.
Seems like it's U-boot that is corrupting the table.
But I don't think it's related to the original issue with commit
ef347c0cfd619a9251e5a2f9ff72e33650a9bccb
/Sean
Enabled BBT in uboot :-)
[ 2.089572] nand: device found, Manufacturer ID: 0x98, Chip ID: 0xdc
[ 2.096098] nand: Toshiba NAND 512MiB 3,3V 8-bit
[ 2.101088] nand: 512 MiB, SLC, erase size: 256 KiB, page size: 4096,
OOB size: 128
[ 2.111704] Bad block table found at page 131008, version 0x01
[ 2.118589] Bad block table found at page 130944, version 0x01
[ 2.124846] nand_read_bbt: bad block at 0x00000c780000
[ 2.130279] nand_read_bbt: bad block at 0x000018000000
[ 2.135517] nand_read_bbt: bad block at 0x000018040000
[ 2.142081] 3 fixed-partitions partitions found on MTD device gpmi-nand
But my gut feeling was right, we still have the issue:
[ 304.192311] UBIFS error (ubi0:8 pid 264): ubifs_read_node: bad node
type (0 but expected 9)
[ 304.201279] UBIFS error (ubi0:8 pid 264): ubifs_read_node: bad node
at LEB 70:141016, LEB mapping status 1
[ 304.211141] Not a node, first 24 bytes:
[ 304.211163] 00000000: ff ff ff ff ff ff ff ff ff ff ff 62 2b 07 00 00
00 00 00 6c 00 00 00 09
...........b+......l....
[ 304.228038] CPU: 0 PID: 264 Comm: rm Not tainted 5.3.0 #190
[ 304.233644] Hardware name: Freescale i.MX6 Ultralite (Device Tree)
[ 304.239878] [<c011184c>] (unwind_backtrace) from [<c010cc24>]
(show_stack+0x10/0x14)
[ 304.247662] [<c010cc24>] (show_stack) from [<c0897674>]
(dump_stack+0xd4/0x108)
[ 304.255010] [<c0897674>] (dump_stack) from [<c03c1710>]
(ubifs_read_node+0x22c/0x268)
[ 304.262883] [<c03c1710>] (ubifs_read_node) from [<c03dd3a0>]
(ubifs_load_znode+0x80/0x454)
[ 304.271191] [<c03dd3a0>] (ubifs_load_znode) from [<c03c4600>]
(ubifs_lookup_level0+0xd8/0x208)
[ 304.279844] [<c03c4600>] (ubifs_lookup_level0) from [<c03c6058>]
(ubifs_tnc_next_ent+0x60/0x1c8)
[ 304.288668] [<c03c6058>] (ubifs_tnc_next_ent) from [<c03cd198>]
(ubifs_add_orphan+0xc0/0xf0)
[ 304.297139] [<c03cd198>] (ubifs_add_orphan) from [<c03b3000>]
(ubifs_jnl_update+0x208/0x670)
[ 304.305616] [<c03b3000>] (ubifs_jnl_update) from [<c03b87b4>]
(ubifs_unlink+0x1bc/0x2b0)
[ 304.313744] [<c03b87b4>] (ubifs_unlink) from [<c02954b0>]
(vfs_unlink+0x10c/0x224)
[ 304.321349] [<c02954b0>] (vfs_unlink) from [<c02996e0>]
(do_unlinkat+0x180/0x280)
[ 304.328866] [<c02996e0>] (do_unlinkat) from [<c0101000>]
(ret_fast_syscall+0x0/0x28)
[ 304.336635] Exception stack(0xc8ca3fa8 to 0xc8ca3ff0)
[ 304.341717] 3fa0: bee52f13 00000000 bee52f13
00000002 00000000 00008000
[ 304.349925] 3fc0: bee52f13 00000000 00000000 0000000a bee52e14
00000000 b6f5afa4 00087664
[ 304.358127] 3fe0: b6e33e11 bee52bfc 0006525f b6e33e18
/Sean
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/