linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Sean Nyekjaer <sean@geanix.com>
To: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: mkl@pengutronix.de, "Sascha Hauer" <s.hauer@pengutronix.de>,
	linux-mtd@lists.infradead.org,
	"Martin Hundebøll" <martin@geanix.com>
Subject: Re: [Bug] mtd: rawnand: gpmi
Date: Fri, 20 Sep 2019 08:54:31 +0200	[thread overview]
Message-ID: <d68f60e9-282a-55f1-332d-208ad50508d5@geanix.com> (raw)
In-Reply-To: <6c0a1fdb-45cc-87aa-d1fb-f07f7e21a4a5@geanix.com>



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/

  reply	other threads:[~2019-09-20  6:55 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-05 20:26 [Bug] mtd: rawnand: gpmi Sean Nyekjaer
2019-09-05 20:39 ` Marc Kleine-Budde
     [not found]   ` <E8555824-943E-45B4-A0ED-D42E13156EEC@geanix.com>
2019-09-06  7:01     ` Marc Kleine-Budde
2019-09-06  7:12 ` Sascha Hauer
2019-09-06  9:59   ` Sean Nyekjaer
2019-09-06 10:13     ` Sascha Hauer
2019-09-06 11:06       ` Sean Nyekjaer
2019-09-06 13:28         ` Sascha Hauer
2019-09-06 15:05           ` Sean Nyekjaer
2019-09-10  9:55 ` Sascha Hauer
2019-09-10 10:18   ` Sean Nyekjaer
2019-09-10 10:48     ` Sascha Hauer
2019-09-10 11:00       ` Sean Nyekjaer
2019-09-10 11:08         ` Sascha Hauer
2019-09-10 11:51           ` Sean Nyekjaer
2019-09-19 11:21             ` Sean Nyekjaer
2019-09-19 11:27               ` Miquel Raynal
2019-09-19 12:15                 ` Sean Nyekjaer
2019-09-20  6:54                   ` Sean Nyekjaer [this message]
2019-09-20  9:17                   ` Sascha Hauer
2019-09-23 10:37                     ` Sean Nyekjaer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d68f60e9-282a-55f1-332d-208ad50508d5@geanix.com \
    --to=sean@geanix.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=martin@geanix.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=mkl@pengutronix.de \
    --cc=s.hauer@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).