Hi,

Running the mtd-utils UBI stress tests on the qspinor flash on the zcu102 board 
fails with the following error:

[10711.442888] m25p80 spi0.0: SPI transfer timed out

For full detailed error output dump please see below.


Tested with Linux kernel 4.9 on zcu102 with latest patches backported from 
master:
https://github.com/Xilinx/linux-xlnx/commits/master/drivers/spi/spi-zynqmp-gqspi.c


All zynqmp qspi patches backported except this one:

https://github.com/Xilinx/linux-xlnx/commit/c88530fa0fad13bfd2a005c03ed091a5240f2411#diff-c620405e8ec890034e2e641db4d58d58

The UBI stress test is included in the latest mtd-utils package from poky 
master which can be grabbed here:
https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/recipes-devtools/mtd/mtd-utils_git.bb

It can be installed via the meta package named "mtd-utils-tests".

In the linux dts we run the qspinor flash device at 50 Mhz and with the 
"has-io-mode" flag to force non-dma mode because dma-mode wil not work with 
UBIs vmalloced memory buffers.

The kernel is compiled with UBI and UBIFS enabled - the YP configuration 
fragment looks like this:
CONFIG_MTD_UBI=y
CONFIG_MTD_UBI_WL_THRESHOLD=4096
CONFIG_MTD_UBI_BEB_LIMIT=20
# CONFIG_MTD_UBI_FASTMAP is not set
# CONFIG_MTD_UBI_GLUEBI is not set
# CONFIG_MTD_UBI_BLOCK is not set
CONFIG_UBIFS_FS=y
# CONFIG_UBIFS_FS_ADVANCED_COMPR is not set
CONFIG_UBIFS_FS_LZO=y
CONFIG_UBIFS_FS_ZLIB=y
# CONFIG_UBIFS_ATIME_SUPPORT is not set
CONFIG_CRYPTO_DEFLATE=y
CONFIG_CRYPTO_LZO=y

For testing purposes we are using the following mtd partition layout which is 
passed via the kernel cmdline:
mtdparts=spi0.0:384k(qspi-fsbl),384k(qspi-fsbl-redun),128k(qspi-atf),1024k(qspi-u-boot),256k(qspi-u-boot-env),1024k(qspi-dtb),32m(qspi-kernel),-(qspi-filesystem)

Once installed, this is how we prepare and run the UBI stress test on the 32 MB 
partition (can also be run on the larger mtd7/qspi-filesystem partition but 
will be slower since it is about ~107MB):

root@zcu102:~# flash_erase /dev/mtd6 0 0
Erasing 128 Kibyte @ 0 --  0 % complete [   37.220268] random: crng init done
Erasing 128 Kibyte @ 1fe0000 -- 100 % complete
root@nanomind-ultra-zu9eg-zcu102:~# ubiattach /dev/ubi_ctrl -m 6
[  261.949178] ubi0: attaching mtd6
[  262.019544] ubi0: scanning is finished
[  262.023216] ubi0: empty MTD device detected
[  263.698423] ubi0: attached mtd6 (name "qspi-kernel", size 32 MiB)
[  263.704471] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 130944 bytes
[  263.711305] ubi0: min./max. I/O unit sizes: 1/512, sub-page size 1
[  263.717464] ubi0: VID header offset: 64 (aligned 64), data offset: 128
[  263.723976] ubi0: good PEBs: 256, bad PEBs: 0, corrupted PEBs: 0
[  263.729961] ubi0: user volume: 0, internal volumes: 1, max. volumes count: 
128
[  263.737172] ubi0: max/mean erase counter: 0/0, WL threshold: 4096, image 
sequence number: 2434763445
[  263.746281] ubi0: available PEBs: 252, total reserved PEBs: 4, PEBs reserved 
for bad PEB handling: 0
[  263.755422] ubi0: background thread "ubi_bgt0d" started, PID 2988
UBI device number 0, total 256 LEBs (33521664 bytes, 32.0 MiB), available 252 
LEBs (32997888 bytes, 31.5 MiB), LEB size 130944 bytes (127.9 KiB)

root@nanomind-ultra-zu9eg-zcu102:~# cd /usr/libexec/mtd-utils

root@nanomind-ultra-zu9eg-zcu102:/usr/libexec/mtd-utils# ./runubitests.sh 
/dev/ubi0
Running mkvol_basic /dev/ubi0
Running mkvol_bad /dev/ubi0
[ 1016.527084] ubi0 error: ubi_cdev_ioctl: bad volume creation request
[ 1016.533283] Volume creation request dump:
[ 1016.537268]  vol_id    -2
[ 1016.539864]  alignment 1
[ 1016.542387]  bytes     32997888
[ 1016.545511]  vol_type  3
[ 1016.548022]  name_len  22
[ 1016.550632]  1st 16 characters of name: mkvol_bad:test_m
[ 1016.559727] ubi0 error: ubi_cdev_ioctl: bad volume creation request
[ 1016.565926] Volume creation request dump:
[ 1016.569916]  vol_id    128
[ 1016.572602]  alignment 1
[ 1016.575113]  bytes     32997888
[ 1016.578250]  vol_type  3
[ 1016.580762]  name_len  22
[ 1016.583359]  1st 16 characters of name: mkvol_bad:test_m
[ 1016.588698] ubi0 error: ubi_cdev_ioctl: bad volume creation request
[ 1016.594914] Volume creation request dump:
[ 1016.598929]  vol_id    0
[ 1016.601420]  alignment 0
[ 1016.603930]  bytes     32997888
[ 1016.607062]  vol_type  3
[ 1016.609578]  name_len  22
[ 1016.612176]  1st 16 characters of name: mkvol_bad:test_m
[ 1016.617510] ubi0 error: ubi_cdev_ioctl: bad volume creation request
[ 1016.623734] Volume creation request dump:
[ 1016.627723]  vol_id    0
[ 1016.630237]  alignment -1
[ 1016.632841]  bytes     32997888
[ 1016.635960]  vol_type  3
[ 1016.638483]  name_len  22
[ 1016.641087]  1st 16 characters of name: mkvol_bad:test_m
[ 1016.646399] ubi0 error: ubi_cdev_ioctl: bad volume creation request
[ 1016.652639] Volume creation request dump:
[ 1016.656626]  vol_id    0
[ 1016.659135]  alignment 130945
[ 1016.662093]  bytes     32997888
[ 1016.665218]  vol_type  3
[ 1016.667728]  name_len  22
[ 1016.670339]  1st 16 characters of name: mkvol_bad:test_m
[ 1016.675650] ubi0 error: ubi_cdev_ioctl: bad volume creation request
[ 1016.681890] Volume creation request dump:
[ 1016.685877]  vol_id    0
[ 1016.688395]  alignment 1
[ 1016.690904]  bytes     -1
[ 1016.693514]  vol_type  3
[ 1016.696025]  name_len  22
[ 1016.698636]  1st 16 characters of name: mkvol_bad:test_m
[ 1016.703954] ubi0 error: ubi_cdev_ioctl: bad volume creation request
[ 1016.710188] Volume creation request dump:
[ 1016.714174]  vol_id    0
[ 1016.716690]  alignment 1
[ 1016.719200]  bytes     0
[ 1016.721724]  vol_type  3
[ 1016.724235]  name_len  22
[ 1016.726845]  1st 16 characters of name: mkvol_bad:test_m
[ 1016.732160] ubi0 error: ubi_create_volume: not enough PEBs, only 252 
available
[ 1016.739361] ubi0 error: ubi_create_volume: cannot create volume 0, error -28
[ 1016.746397] ubi0 error: ubi_create_volume: not enough PEBs, only 252 
available
[ 1016.753596] ubi0 error: ubi_create_volume: cannot create volume 0, error -28
[ 1016.760629] ubi0 error: ubi_cdev_ioctl: bad volume creation request
[ 1016.766868] Volume creation request dump:
[ 1016.770854]  vol_id    0
[ 1016.773370]  alignment 1
[ 1016.775881]  bytes     130944
[ 1016.778838]  vol_type  7
[ 1016.781355]  name_len  22
[ 1016.783953]  1st 16 characters of name: mkvol_bad:test_m
[ 1018.167306] ubi0 error: ubi_create_volume: volume 0 already exists
[ 1018.173425] ubi0 error: ubi_create_volume: cannot create volume 0, error -17
[ 1018.180466] ubi0 error: ubi_create_volume: volume "mkvol_bad:test_mkvol()" 
exists (ID 0)
[ 1018.188528] ubi0 error: ubi_create_volume: cannot create volume 1, error -17
[ 1021.453946] ubi0 error: ubi_create_volume: volume "mkvol_bad:test_mkvol()" 
exists (ID 0)
[ 1021.461979] ubi0 error: ubi_create_volume: cannot create volume 1, error -17
[ 1445.897980] ubi0 error: ubi_open_volume: cannot open device 0, volume 128, 
error -22
[ 1445.905691] ubi0 error: ubi_open_volume: cannot open device 0, volume -1, 
error -22
[ 1445.913312] ubi0 error: ubi_open_volume: cannot open device 0, volume 128, 
error -22
[ 1445.921034] ubi0 error: ubi_open_volume: cannot open device 0, volume 0, 
error -19
[ 1449.199375] ubi0 error: ubi_open_volume: cannot open device 0, volume 0, 
error -19
Running mkvol_paral /dev/ubi0
Running rsvol /dev/ubi0
Running io_basic /dev/ubi0
Running io_read /dev/ubi0
[10711.339253] Unable to handle kernel paging request at virtual address 
ffffff800a919000
[10711.347105] pgd = ffffff8008ce7000
[10711.350476] [ffffff800a919000] *pgd=000000087fffe003[10711.355245] , 
*pud=000000087fffe003
, *pmd=000000087a7b5003[10711.360712] , *pte=0000000000000000
[10711.364189]
[10711.365667] Internal error: Oops: 96000047 [#1] SMP
[10711.370528] Modules linked in:
[10711.373566] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.9.0-adi #2
[10711.379728] Hardware name: ZynqMP ZCU102 Rev1.0 (DT)
[10711.384676] task: ffffff8008bef780 task.stack: ffffff8008be0000
[10711.390585] PC is at __memcpy+0xac/0x180
[10711.394488] LR is at zynqmp_qspi_readrxfifo.constprop.4+0x98/0xc0
[10711.400561] pc : [<ffffff80084220ac>] lr : [<ffffff80085643d8>] pstate: 
800001c5
[10711.407944] sp : ffffffc87ff63e80
[10711.411236] x29: ffffffc87ff63e80 x28: ffffff8008be0000
[10711.416529] x27: 0000000000000001 x26: ffffff8008a45a10
[10711.421824] x25: ffffff8008bfd728 x24: ffffffc87b04ca00
[10711.427118] x23: 0000000000000090 x22: ffffffc87b026000
[10711.432413] x21: 0000000000000001 x20: 0000000000000001
[10711.437708] x19: ffffffc87b0265b8 x18: 0000000000000007
[10711.442888] m25p80 spi0.0: SPI transfer timed out
[10711.442905] ubi0 warning: ubi_io_read: error -110 while reading 8192 bytes 
from PEB 163:129, read only 0 bytes, retry
[10711.458290] x17: 0000000000000001 x16: 0000000000000019
[10711.463574] x15: 0000000000000033 x14: 0000000100000008
[10711.468869] x13: 0004af413cfdd646 x12: 003d0aa4b5dfb59b
[10711.474164] x11: 00000000003d0900 x10: 0000000000000040
[10711.479459] x9 : ffffff8008bf9b80 x8 : ffffffc87b400000
[10711.484753] x7 : ffffffc87b400028 x6 : ffffff800a919000
[10711.490048] x5 : ffffffc87b400000 x4 : 00000048773a4000
[10711.495343] x3 : 0000000000000000 x2 : 0000000000000001
[10711.500638] x1 : ffffffc87ff63eb9 x0 : ffffff800a919000


Notice: The output from mkvol_bad can be ignored - it is expected errors. 
However, the io_read test failing is not good.

The mtd/ubi folks tell us that these tests are supposed to run successfully on 
any platform.

It would be great if someone could try reproduce this to confirm the issue. For 
normal operation the zynqmp qspi driver seems to work fine but when stress 
tested it seems to fail in this way.

Br, Martin




-- 
_______________________________________________
meta-xilinx mailing list
meta-xilinx@yoctoproject.org
https://lists.yoctoproject.org/listinfo/meta-xilinx

Reply via email to