lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <DB6PR0402MB28387FE79F2742C9BEBD4037997F0@DB6PR0402MB2838.eurprd04.prod.outlook.com>
Date:   Tue, 12 Jun 2018 08:51:25 +0000
From:   Yogesh Narayan Gaur <yogeshnarayan.gaur@....com>
To:     Boris Brezillon <boris.brezillon@...tlin.com>
CC:     "richard@....at" <richard@....at>,
        Prabhakar Kushwaha <prabhakar.kushwaha@....com>,
        Han Xu <han.xu@....com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-spi@...r.kernel.org" <linux-spi@...r.kernel.org>,
        "marek.vasut@...il.com" <marek.vasut@...il.com>,
        Frieder Schrempf <frieder.schrempf@...eet.de>,
        "broonie@...nel.org" <broonie@...nel.org>,
        "linux-mtd@...ts.infradead.org" <linux-mtd@...ts.infradead.org>,
        "miquel.raynal@...tlin.com" <miquel.raynal@...tlin.com>,
        Fabio Estevam <fabio.estevam@....com>,
        David Wolfe <david.wolfe@....com>,
        "computersforpeace@...il.com" <computersforpeace@...il.com>,
        "dwmw2@...radead.org" <dwmw2@...radead.org>
Subject: RE: [PATCH 03/11] spi: Add a driver for the Freescale/NXP QuadSPI
 controller

Hi Boris,

-----Original Message-----
From: Boris Brezillon [mailto:boris.brezillon@...tlin.com] 
Sent: Tuesday, June 12, 2018 12:43 PM
To: Yogesh Narayan Gaur <yogeshnarayan.gaur@....com>
Cc: richard@....at; Prabhakar Kushwaha <prabhakar.kushwaha@....com>; Han Xu <han.xu@....com>; linux-kernel@...r.kernel.org; linux-spi@...r.kernel.org; marek.vasut@...il.com; Frieder Schrempf <frieder.schrempf@...eet.de>; broonie@...nel.org; linux-mtd@...ts.infradead.org; miquel.raynal@...tlin.com; Fabio Estevam <fabio.estevam@....com>; David Wolfe <david.wolfe@....com>; computersforpeace@...il.com; dwmw2@...radead.org
Subject: Re: [PATCH 03/11] spi: Add a driver for the Freescale/NXP QuadSPI controller

On Tue, 12 Jun 2018 06:42:42 +0000
Yogesh Narayan Gaur <yogeshnarayan.gaur@....com> wrote:

> I have tried JFFS2 mounting with smaller partition size but still getting failure.
> For partition size equal or less than 1MB, getting errors as
>     [   25.044930] jffs2: Too few erase blocks (4)
> Thus, need to have size more than 1MB.
> 
> For 2MB partition size getting error message from jffs2_scan_eraseblock().
>     root@...012ardb:~# cat /proc/mtd
>     dev:    size   erasesize  name
>     mtd0: 04000000 00040000 "20c0000.quadspi-0"
>     mtd1: 00500000 00040000 "rcw"
>     mtd2: 00a00000 00040000 "test"
>     mtd3: 00200000 00040000 "rootfs"
>     root@...012ardb:~#  mkdir /media/ram ; flash_eraseall /dev/mtd3
>     flash_eraseall has been replaced by `flash_erase <mtddev> 0 0`; please use it
>     Erasing 256 Kibyte @ 1c0000 -- 100 % complete
>     root@...012ardb:~# mount -t jffs2 /dev/mtdblock3 /media/ram/
>     [   26.380989] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000000: 0x0dd0 instead
>     [   26.390509] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000004c: 0x7366 instead
>     [   26.399999] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000050: 0x736c instead

That's weird. Can you tell me on which platform you're testing?
lsxxx or vf610? Can you dump the NOR after the erase to make sure the memory is actually erased (filled with 0xff)?

I am working on lsxxx platform. With further debugging, I found that my erase operation for second flash device is not working properly.
Need to have debugging for this in Frieder Patch.

When I have created multiple partition for First flash device, then JFFS2 mounting and booting of Linux kernel from rootfstype=jffs2 is successful.
    root@...012ardb:~# cat /proc/mtd
    dev:    size   erasesize  name
    mtd0: 00500000 00040000 "rcw"
    mtd1: 00a00000 00040000 "test"
    mtd2: 02e00000 00040000 "rootfs"
    mtd3: 04000000 00040000 "20c0000.quadspi-1"
In above list, for MTD2 partition, able to perform JFFS2 mounting.

Below is logs of erase for both flashes:
    root@...012ardb:~# cat /proc/mtd
    dev:    size   erasesize  name
    mtd0: 04000000 00040000 "20c0000.quadspi-0"
    mtd1: 04000000 00040000 "20c0000.quadspi-1"
    root@...012ardb:~# mtd_debug erase /dev/mtd0 0x1000000 0x2000000
    Erased 33554432 bytes from address 0x01000000 in flash
    root@...012ardb:~#
    root@...012ardb:~# mtd_debug read /dev/mtd0 0x1000000 0xa00000 rp
    Copied 10485760 bytes from address 0x01000000 in flash to rp
    root@...012ardb:~# hexdump rp
    0000000 ffff ffff ffff ffff ffff ffff ffff ffff
    *
    0a00000
    root@...012ardb:~#
    root@...012ardb:~# mtd_debug erase /dev/mtd1 0x1000000 0x2000000
     [   25.023027] random: crng init done
    Erased 33554432 bytes from address 0x01000000 in flash
    root@...012ardb:~# mtd_debug read /dev/mtd1 0x1000000 0xa00000 rp
    Copied 10485760 bytes from address 0x01000000 in flash to rp
    root@...012ardb:~#
    root@...012ardb:~# hexdump rp
    0000000 1985 2003 000c 0000 b0b1 e41e ffff ffff
    0000010 ffff ffff ffff ffff ffff ffff ffff ffff
    *
    0040000 1985 2003 000c 0000 b0b1 e41e ffff ffff
    0040010 ffff ffff ffff ffff ffff ffff ffff ffff

--
Yogesh Gaur

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ