Re: [Bug] mtd: rawnand: gpmi

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Sep 19, 2019 at 02:15:22PM +0200, 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.

I don't think that U-Boot is corrupting the table. Apparently
ef347c0cfd619a925 introduces a unwanted change in the page layout of the
NAND. I would expect that with the known good kernel you have a bbt
written by either the Kernel or U-Boot, doesn't matter, both parties can
read it. Once you start the broken Kernel the kernel can no longer read
the table, re-writes it, can now read it itself, but U-Boot no longer
can read it, then re-writes it with the effect that Linux re-writes it
again.

I don't know how the differences look, you have to nail that down
yourself by systematically using nandwrite and nandread, maybe with or
without oob. Once you found the differences I can help you in finding
the issue in my patch. Alternatively I can offer you to have a look
myself, but you would have to provide me a board, either physically
by mail or virtually by ssh.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/




[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux