Wind River Support Network

HomeDefectsLINCD-8512
Fixed

LINCD-8512 : nxp-s32g: ubiattach: error: cannot attach mtd0 (Operation not permitted)

Created: Mar 10, 2022    Updated: May 25, 2022
Resolved Date: May 22, 2022
Found In Version: 10.22.13.0
Fix Version: 10.22.21.0
Severity: Standard
Applicable for: Wind River Linux CD
Component/s: BSP

Description

root@nxp-s32g2xx:/opt/wr-test/testcases/bts/flash_dd_ubifs# cat /proc/mtd
dev: size erasesize name
mtd0: 04000000 00010000 "0.spi"
root@nxp-s32g2xx:/opt/wr-test/testcases/bts/flash_dd_ubifs# mtdinfo /dev/mtd0
mtd0
Name: 0.spi
Type: nor
Eraseblock size: 65536 bytes, 64.0 KiB
Amount of eraseblocks: 1024 (67108864 bytes, 64.0 MiB)
Minimum input/output unit size: 1 byte
Sub-page size: 1 byte
Character device major/minor: 90:0
Bad blocks are allowed: false
Device is writable: true
root@nxp-s32g2xx:/opt/wr-test/testcases/bts/flash_dd_ubifs# cat /proc/mtd
dev: size erasesize name
mtd0: 04000000 00010000 "0.spi"
root@nxp-s32g2xx:/opt/wr-test/testcases/bts/flash_dd_ubifs# mtdinfo /dev/mtd0
mtd0
Name: 0.spi
Type: nor
Eraseblock size: 65536 bytes, 64.0 KiB
Amount of eraseblocks: 1024 (67108864 bytes, 64.0 MiB)
Minimum input/output unit size: 1 byte
Sub-page size: 1 byte
Character device major/minor: 90:0
Bad blocks are allowed: false
Device is writable: true
<< [do_prepare_for_testcase] start dd file with UBI file system>>
********************
20277
root@nxp-s32g2xx:/opt/wr-test/testcases/bts/flash_dd_ubifs# flash_erase /dev/mtd0 0 0

Erasing 65536 Kibyte @ 0 – 0 % complete 
Erasing 65536 Kibyte @ 0 – 100 % complete 
root@nxp-s32g2xx:/opt/wr-test/testcases/bts/flash_dd_ubifs# ubiattach /dev/ubi_ctrl -m 0
ubiattach: error!: cannot attach mtd0
error 1 (Operation not permitted)

with below call trace

[ 4444.858415] ubi0: attaching mtd0
[ 4444.914533] spi-nor spi0.0: Unknown command extension type
[ 4444.915159] ubi0 warning: ubi_io_read: error -1 while reading 64 bytes from PEB 0:0, read only 0 bytes, retry
[ 4444.915267] spi-nor spi0.0: Unknown command extension type
[ 4444.915332] ubi0 warning: ubi_io_read: error -1 while reading 64 bytes from PEB 0:0, read only 0 bytes, retry
[ 4444.915402] spi-nor spi0.0: Unknown command extension type
[ 4444.915469] ubi0 warning: ubi_io_read: error -1 while reading 64 bytes from PEB 0:0, read only 0 bytes, retry
[ 4444.927375] spi-nor spi0.0: Unknown command extension type
[ 4444.927461] ubi0 error: ubi_io_read: error -1 while reading 64 bytes from PEB 0:0, read 0 bytes
[ 4444.927494] CPU: 0 PID: 1891 Comm: ubiattach Not tainted 5.15.30-rt34-yocto-preempt-rt #1
[ 4444.927504] Hardware name: Freescale S32G274A (DT)
[ 4444.927510] Call trace:
[ 4444.927512]  dump_backtrace+0x0/0x1d4
[ 4444.927525]  show_stack+0x24/0x30
[ 4444.927532]  dump_stack_lvl+0xb0/0xf4
[ 4444.927545]  dump_stack+0x18/0x34
[ 4444.927552]  ubi_io_read+0x1ec/0x424
[ 4444.927561]  ubi_io_read_ec_hdr+0x74/0x300
[ 4444.927572]  scan_peb.constprop.0+0xb4/0x714
[ 4444.927585]  scan_all.constprop.0+0xfc/0x440
[ 4444.927597]  ubi_attach+0xb0/0x1d0
[ 4444.927606]  ubi_attach_mtd_dev+0x26c/0x5d4
[ 4444.927618]  ctrl_cdev_ioctl+0x280/0x380
[ 4444.927629]  __arm64_sys_ioctl+0xb4/0xfc
[ 4444.927641]  invoke_syscall+0x5c/0x130
[ 4444.927653]  el0_svc_common.constprop.0+0x68/0x124
[ 4444.927666]  do_el0_svc+0x50/0xbc
[ 4444.927677]  el0_svc+0x54/0x130
[ 4444.927689]  el0t_64_sync_handler+0xa4/0x130
[ 4444.927696]  el0t_64_sync+0x1a0/0x1a4
[ 4445.256068] kobject: 'ubi_aeb_slab_cache' (ffffff880c250b78): kobject_release, parent 0000000000000000 (delayed 500)
[ 4445.256781] ubi0 error: ubi_attach_mtd_dev: failed to attach mtd0, error -1
[ 4445.258934] kobject: '(null)' (ffffff880f12a128): kobject_release, parent 0000000000000000 (delayed 1000)
[ 4445.809403] Writes:  Total: 3717365  Max/Min: 1880574/1836791   Fail: 0 

Steps to Reproduce

/lpg-build/cdc/fast_prod/WRLINUX_MASTER_WR/MASTER_WR_GIT/wrlinux-10/setup.sh --machines nxp-s32g --templates feature/docker --distros wrlinux --dl-layers --accept-eula=yes
source environment-setup-x86_64-wrlinuxsdk-linux
source oe-init-build-env build_BTS_nxp-s32g_standard_std_wrlinux_default
cd /buildarea1/common/WRLINUX_MASTER_WR/build_dir/GIT_202204/lxbuilds/prj_198923/wrlinux/layers/nxp-s32g
git am --keep-cr /folk/wgao/s32g/patches/master-wr/standard/layers/nxp-s32g/0001-nxp-s32g-linux-add-one-patch-to-add-dspi-support.patch
cd /buildarea1/common/WRLINUX_MASTER_WR/build_dir/GIT_202204/lxbuilds/prj_198923/wrlinux/build_BTS_nxp-s32g_standard_std_wrlinux_default
echo KERNEL_FEATURES:append = \" features/usb/serial-all.scc\" >> conf/local.conf
echo KERNEL_VERSION_SANITY_SKIP=\"1\" >> conf/local.conf
echo IMAGE_FSTYPES += \" tar.bz2\" >> conf/local.conf
echo BB_NUMBER_THREADS ?= \"24\" >> conf/local.conf
echo PARALLEL_MAKE ?= \"-j 24\" >> conf/local.conf
echo BB_DANGLINGAPPENDS_WARNONLY = \"1\" >> conf/local.conf
echo HSE_LOCAL_FIRMWARE_DIR = \"/folk/wgao/s32g/firmware/hse/\" >> conf/local.conf
echo HSE_FW_NAME_S32G2 = \"s32g2xx_hse_fw_0.1.0_1.0.0_pb211015.bin.pink\" >> conf/local.conf
echo IPCF_M7_APP_BIN_DIR = \"/folk/wgao/s32g/firmware/ipcf\" >> conf/local.conf
echo IMAGE_INSTALL:append = \" ipc-shm\" >> conf/local.conf
echo LLCE_LOCAL_FIRMWARE_DIR = \"/folk/wgao/s32g/firmware/llce/s32g2\" >> conf/local.conf
echo LLCE_LOCAL_FIRMWARE_DIR_S32G3 = \"/folk/wgao/s32g/firmware/llce/s32g3\" >> conf/local.conf
echo WRL_RECIPES:wr-nxp-s32g += \"llce\" >> conf/local.conf
echo IMAGE_INSTALL:append:nxp-s32g = \" llce\" >> conf/local.conf
bitbake-layers add-layer /net/pek-lpgtest16/buildarea1/wgao/wrlinux_master/wr-testing/bts-dev
echo require templates/feature/bts/template.conf >> conf/local.conf
bitbake wrlinux-image-std


Boot on EVB and do mtd test.

http://pek-lpgtest3.wrs.com/lpg-build/cdc/publiclog/WRLinuxCDStandard/S220301/2022WW10/GIT_20220311/BSP/nxp-s32g2xx_preempt-rt_glibc-std/NXP_S32G274A_EVB_OE_systemd_mtd0/flash_dd_ubifs/flash_dd_ubifs-mtd0.log
Live chat
Online