Hi Michal, Thanks for your patch. I tested it, arriving at the same result as before (with mainline 3.19) except for your version is set to ignore real bad blocks, which I hope was a temporary solution. I'm attaching the beginning of the kernel panic dump. The NULL pointer happens during parsing the partition table in the DT as a result of adding a NAND partition.
I noticed that the driver calls nand_add_partition even if there are no partitions in the DT. Is this driver behaviour consistent? dump: [ 27.696237] Ignoring bad block marker at at 0x0001f23fc000. [ 27.982825] Bad block table written to 0x0001ffc00000, version 0x01 [ 28.000800] Bad block table written to 0x0001ff800000, version 0x01 [ 28.008443] Unable to handle kernel NULL pointer dereference at virtual address 00000713 [ 28.016602] pgd = c0004000 [ 28.019309] [00000713] *pgd=00000000 [ 28.022921] Internal error: Oops: 17 [#1] SMP ARM [ 28.027621] Modules linked in: sunxi_nand(+) ofnandpart nand nand_ids nand_hynix mtd nand_ecc [ 28.036242] CPU: 0 PID: 70 Comm: kworker/u2:0 Not tainted 3.19.0-rc3-00472-ge238956-dirty #16 [ 28.044753] Hardware name: Allwinner A1X (Device Tree) [ 28.049886] task: df66ed00 ti: dec5c000 task.ti: dec5c000 [ 28.055290] PC is at kmem_cache_alloc+0x48/0x16c [ 28.059911] LR is at getname_kernel+0x40/0x80 --Vladimir On 9 January 2015 at 21:06, Michal Suchanek <[email protected]> wrote: > On 9 January 2015 at 18:16, Vladimir Komendantskiy > <[email protected]> wrote: > > Can you help me understand this strange bug on a10s-olinuxino-m? I guess > my > > DT record for NAND MTD partitions is somehow incorrect because I happen > to > > get a kernel panic in the mainline 3.19 kernel that looks like this: > > > > [ 0.599782] nand: device found, Manufacturer ID: 0xad, Chip ID: 0xde > > [ 0.606203] nand: Hynix H27UCG8T2ETR-BC 8GiB 3.3V 8-bit > > [ 0.611433] nand: 8192 MiB, MLC, erase size: 4096 KiB, page size: > 16384, > > OOB size: 1664 > > [ 0.628428] Bad block table found at page 524032, version 0x01 > > [ 0.650299] Bad block table found at page 523776, version 0x01 > > [ 0.664100] nand_bbt: ECC error in BBT at 0x0000ffc00005 > > [ 0.677393] nand_bbt: ECC error in BBT at 0x0000ff800005 > > [ 0.682711] Scanning device for bad blocks > > [ 1.086137] random: nonblocking pool is initialized > > [ 1.769233] Bad eraseblock 1992 at 0x0001f23fc000 > > [ 1.814688] Bad block table written to 0x0001ffc00000, version 0x01 > > [ 1.832192] Bad block table written to 0x0001ff800000, version 0x01 > > [ 1.839592] 4 ofpart partitions found on MTD device H27UCG8T2ETR-BC > 8GiB > > 3.3V 8-bit > > [ 1.847297] Creating 4 MTD partitions on "H27UCG8T2ETR-BC 8GiB 3.3V > > 8-bit": > > [ 1.854275] 0x000000000000-0x000000400000 : "boot0" > > [ 1.859622] 0x000000400000-0x000000800000 : "boot1" > > [ 1.864877] 0x000000800000-0x000001800000 : "kernel" > > [ 1.870197] 0x000001800000-0x000200000000 : "rootfs" > > > > <...snip...> > > > > [ 2.124638] Registering SWP/SWPB emulation handler > > [ 2.129842] Unable to handle kernel NULL pointer dereference at > virtual > > address 00000713 > > > > > > SWP/SWPB instruction emulation has nothing to do with the NFC. The kernel > > boots OK as soon as I disable the NFC in the device tree. In a successful > > boot attempt, this is followed by mmc0 initialisation. So, it looks like > the > > culprit is mmc0. However, disabling the leaf mmc nodes in the device tree > > does not change the outcome. > > > > Here is my nfc configuration added to the mainline > > sunxi-a10s-olinuxino-micro.dts. The pinctrl-0 definitions are standard, > same > > as in Boris' repo for Cubietruck. > > > > nfc: nand@01c03000 { compatible = "allwinner,sun4i-a10-nand"; reg = > > <0x01c03000 0x1000>; interrupts = <37>; clocks = <&ahb_gates 13>, > > <&nand_clk>; clock-names = "ahb", "mod"; #address-cells = <1>; > #size-cells = > > <0>; pinctrl-names = "default"; pinctrl-0 = <&nand_pins_a > &nand_cs0_pins_a > > &nand_rb0_pins_a>; status = "okay"; nand@0 { reg = <0>; allwinner,rb = > <0>; > > #address-cells = <1>; #size-cells = <2>; nand-on-flash-bbt; > nand-ecc-mode = > > "hw"; boot0@0 { label = "boot0"; reg = <0x0 0x0 0x400000>; }; > boot1@400000 { > > label = "boot1"; reg = <0x400000 0x0 0x400000>; }; kernel@800000 { > label = > > "kernel"; reg = <0x800000 0x0 0x1000000>; }; rootfs@1800000 { label = > > "rootfs"; reg = <0x1800000 0x1 0xfe800000>; }; }; }; > > > > Hello, > > I use this tree with the nand patches and cubieboard DT patches > https://github.com/hramrach/linux-sunxi/tree/sunxi-nand-next > > I can boot this on cubieboard1&2 so you should be able to adapt the > cubieboard1 patch to sun5i > > HTH > > Michal > > -- > You received this message because you are subscribed to the Google Groups > "linux-sunxi" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "linux-sunxi" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
