nxp-imx / mfgtools

Freescale/NXP I.MX Chip image deploy tools.
BSD 3-Clause "New" or "Revised" License
534 stars 294 forks source link

LIBUSB_ERROR_TIMEOUT with big rootfs.tar.bz2 #134

Closed jessie80 closed 4 years ago

jessie80 commented 4 years ago

Hi customer met LIBUSB_ERR0R_TIMEOUT during downloading the roofs.tar.bz2 which is compiled with bitbake fsl-image-validation-imx. but smaller rootfs.tar.bz is working well.

below is the uuu log..
C:\uuu_cg>uuu -v -V lgecg_emmc_download.uuu uuu (Universal Update Utility) for nxp imx chips -- libuuu_1.2.135-0-gacaf035

Build in config: Pctl Chip Vid Pid BcdVersion

    SDPS:    MX8QXP          0x1fc9  0x012f  [0x0002..0xffff]
    SDPS:    MX8QM           0x1fc9  0x0129  [0x0002..0xffff]
    SDPS:    MX28            0x15a2  0x004f
    SDPS:    MX815           0x1fc9  0x013e
    SDP:     MX7D            0x15a2  0x0076
    SDP:     MX6Q            0x15a2  0x0054
    SDP:     MX6D            0x15a2  0x0061
    SDP:     MX6SL           0x15a2  0x0063
    SDP:     MX6SX           0x15a2  0x0071
    SDP:     MX6UL           0x15a2  0x007d
    SDP:     MX6ULL          0x15a2  0x0080
    SDP:     MX6SLL          0x1fc9  0x0128
    SDP:     MX7ULP          0x1fc9  0x0126
    SDP:     MXRT106X        0x1fc9  0x0135
    SDP:     MX8MM           0x1fc9  0x0134
    SDP:     MX8MQ           0x1fc9  0x012b
    SDPU:    SPL             0x0525  0xb4a4  [0x0000..0x04ff]
    SDPV:    SPL1            0x0525  0xb4a4  [0x0500..0x9998]
    SDPU:    SPL             0x0525  0xb4a4  [0x9999..0x9999]
    FBK:                     0x066f  0x9afe
    FBK:                     0x066f  0x9bff
    FB:                      0x0525  0xa4a5
    FB:                      0x18d1  0x0d02

Wait for Known USB Device Appear... New USB Device Attached at 1:13 1:13>Start Cmd:SDP: boot -f u-boot.imx 6400%libusb: error [windows_transfer_callback] detected I/O error 1167: [1167] 장치가 연결되지 않았습니다. libusb: error [hid_submit_bulk_transfer] HID transfer failed: [1167] 장치가 연결되지 않았습니다. 1:13>Okay New USB Device Attached at 1:13 1:13>Start Cmd:FB: ucmd setenv fastboot_dev mmc 1:13>Okay 1:13>Start Cmd:FB: ucmd setenv mmcdev ${emmc_dev} 1:13>Okay 1:13>Start Cmd:FB: flash bootloader u-boot.imx 0x400000000x2001:13>Okay 1:13>Start Cmd:FB: ucmd if env exists emmc_ack; then ; else setenv emmc_ack 0; fi; 1:13>Okay 1:13>Start Cmd:FB: ucmd setenv emmc_cmd mmc partconf ${emmc_dev} ${emmc_ack} 1 0 1:13>Okay 1:13>Start Cmd:FB: ucmd if test "${emmc_skip_fb}" != "yes"; then run emmc_cmd; fi 1:13>Okay 1:13>Start Cmd:FB: ucmd setenv emmc_cmd mmc bootbus ${emmc_dev} 2 2 1; 1:13>Okay 1:13>Start Cmd:FB: ucmd if test "${emmc_skip_fb}" != "yes"; then run emmc_cmd; fi 1:13>Okay 1:13>Start Cmd:FB: ucmd echo '[warkap] step #0 before download -f zImage' 1:13>Okay 1:13>Start Cmd:FB: ucmd setenv fastboot_buffer ${loadaddr} 1:13>Okay 1:13>Start Cmd:FB: download -f zImage 1:13>Okay 1:13>Start Cmd:FB: ucmd echo '[warkap] step #1 after download -f zImage' 1:13>Okay 1:13>Start Cmd:FB: ucmd setenv fastboot_buffer ${fdt_addr} 1:13>Okay 1:13>Start Cmd:FB: download -f imx6sx-sdb-lgecg.dtb 1:13>Okay 1:13>Start Cmd:FB: ucmd setenv fastboot_buffer ${initrd_addr} 1:13>Okay 1:13>Start Cmd:FB: download -f _initramfs.cpio.gz.uboot 1:13>Okay 1:13>Start Cmd:FB: acmd ${kboot} ${loadaddr} ${initrd_addr} ${fdt_addr} 1:13>Okay New USB Device Attached at 1:13 1:13>Start Cmd:FBK: ucmd while [ ! -e /dev/mmcblkboot0 ]; do sleep 1; echo "wait for /dev/mmcblkboot appear"; done; 1:13>Okay 1:13>Start Cmd:FBK: ucmd dev=`ls /dev/mmcblkboot`; dev=($dev); dev=${dev[0]}; dev=${dev#/dev/mmcblk}; dev=${dev%boot}; echo $dev > /tmp/mmcdev; 1:13>Okay 1:13>Start Cmd:FBK: ucmd mmc=cat /tmp/mmcdev; PARTSTR=$'10M,500M,0c\n600M,,83\n'; echo "$PARTSTR" | sfdisk --force /dev/mmcblk${mmc} Checking that no-one is using this disk right now ... OK

Disk /dev/mmcblk3: 3.7 GiB, 3959422976 bytes, 7733248 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x67e6b631

Old situation:

Device Boot Start End Sectors Size Id Type /dev/mmcblk3p1 20480 1044479 1024000 500M c W95 FAT32 (LBA) /dev/mmcblk3p2 1228800 7733247 6504448 3.1G 83 Linux

Created a new DOS disklabel with disk identifier 0xe090e6d2. /dev/mmcblk3p1: Created a new partition 1 of type 'W95 FAT32 (LBA)' and of size 500 MiB. /dev/mmcblk3p2: Created a new partition 2 of type 'Linux' and of size 3.1 GiB. /dev/mmcblk3p3: Done.

New situation: Disklabel type: dos Disk identifier: 0xe090e6d2

Device Boot Start End Sectors Size Id Type /dev/mmcblk3p1 20480 1044479 1024000 500M c W95 FAT32 (LBA) /dev/mmcblk3p2 1228800 7733247 6504448 3.1G 83 Linux

The partition table has been altered. Calling ioctl() to re-read partition table. Syncing disks. 1:13>Okay 1:13>Start Cmd:FBK: ucmd mmc=cat /tmp/mmcdev; dd if=/dev/zero of=/dev/mmcblk${mmc} bs=1k seek=4096 count=1 1:13>Okay 1:13>Start Cmd:FBK: ucmd sync 1:13>Okay 1:13>Start Cmd:FBK: ucmd mmc=cat /tmp/mmcdev; while [ ! -e /dev/mmcblk${mmc}p1 ]; do sleep 1; done 1:13>Okay 1:13>Start Cmd:FBK: ucmd mmc=cat /tmp/mmcdev; mkfs.vfat /dev/mmcblk${mmc}p1 mkfs.fat 4.1 (2017-01-24) 1:13>Okay 1:13>Start Cmd:FBK: ucmd mmc=cat /tmp/mmcdev; mkdir -p /mnt/fat 1:13>Okay 1:13>Start Cmd:FBK: ucmd mmc=cat /tmp/mmcdev; mount -t vfat /dev/mmcblk${mmc}p1 /mnt/fat 1:13>Okay 1:13>Start Cmd:FBK: ucp zImage t:/mnt/fat 99%1:13>Okay 1:13>Start Cmd:FBK: ucp imx6sx-sdb-lgecg.dtb t:/mnt/fat 152%1:13>Okay 1:13>Start Cmd:FBK: ucmd umount /mnt/fat 1:13>Okay 1:13>Start Cmd:FBK: ucmd mmc=cat /tmp/mmcdev; mkfs.ext3 -F -E nodiscard /dev/mmcblk${mmc}p2 Creating filesystem with 813056 4k blocks and 203600 inodes Filesystem UUID: ea45f09c-b6ed-464c-96e0-7286d9e0c1ba Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912

Allocating group tables: done Writing inode tables: done Creating journal (16384 blocks): done Writing superblocks and filesystem accounting information: done

1:13>Okay 1:13>Start Cmd:FBK: ucmd mkdir -p /mnt/ext3 1:13>Okay 1:13>Start Cmd:FBK: ucmd mmc=cat /tmp/mmcdev; mount /dev/mmcblk${mmc}p2 /mnt/ext3 1:13>Okay 1:13>Start Cmd:FBK: acmd export EXTRACT_UNSAFE_SYMLINKS=1; tar -jx -C /mnt/ext3 1:13>Okay 1:13>Start Cmd:FBK: ucp imx6sxsabresd.rootfs.tar.bz2 t:- 48%1:13>Fail Bulk(W):LIBUSB_ERROR_TIMEOUT

Could you please check and help me to find the root cause?

nxpfrankli commented 4 years ago

I may cause slow sd\emmc write speed.

Can you

https://github.com/NXPmicro/imx-uuc/blob/master/ufb.c

line 532: ret = write_file(g_open_file, p, size); if (ret < 0) key = FAIL;

you can print out how much time consumed by this function

nxpfrankli commented 4 years ago

Do you have uart log?

jessie80 commented 4 years ago

for your first comment, it seems it is not uuu source code itself. If there is similar code part on uuu (window version) to check the write speed, i'll try with customer. Could you please guide me? Or i've never seen this imx-uuc before. So, how could i modify and apply to system regarding of ufb.c, i'll try..

Anyway, below is the uart log. U-Boot 2018.03-00044-ga3070e6-dirty (Aug 30 2019 - 11:22:41 +0900)

CPU:   Freescale i.MX6SX rev1.2 996 MHz (running at 792 MHz) CPU:   Extended Commercial temperature grade (-20C to 105C) at 48C Reset cause: POR Model: Freescale i.MX6 SoloX SDB RevB Board Board: MX6SX SABRE SDB rev@ DRAM:  256 MiB PMIC: PFUZE100! DEV_ID=0x11 REV_ID=0x21 MMC:   FSL_SDHC: 0, FSL_SDHC: 1 Loading Environment from MMC... MMC Device 2 not found *** Warning - No MMC card found, using default environment

Failed (-5) Display: Hannstar-XGA (1024x768) Video: 1024x768x18 In:    serial Out:   serial Err:   serial MMC Device 2 not found no mmc device at slot 2 flash target is MMC:2 MMC Device 2 not found invalid mmc device 2 Net: Error: ethernet@02188000 address not set. No ethernet found. Fastboot: Normal Boot from USB for mfgtools Use default environment for                              mfgtools Run bootcmd_mfg: run mfgtool_args;if iminfo ${initrd_addr}; then if test ${tee} = yes; then bootm ${tee_addr} ${initrd_addr} ${fdt_addr}; else bootz ${loadaddr} ${initrd_addr} ${fdt_addr}; fi; else echo "Run fastboot ..."; fastboot 0; fi; Hit any key to stop autoboot:  0

Checking Image at 86800000 ...

Unknown image format! Run fastboot ... flash target is MMC:1 Starting download of 629760 bytes .... downloading of 629760 bytes finished writing to partition 'bootloader' support sparse flash partition for bootloader Initializing 'bootloader' switch to partitions #1, OK mmc1(part 1) is current device Writing 'bootloader'

MMC write: dev # 1, block # 2, count 1230 ... 1230 blocks written: OK Writing 'bootloader' DONE! [warkap] step #0 before download -f zImage Starting download of 6870616 bytes .................................................... downloading of 6870616 bytes finished [warkap] step #1 after download -f zImage Starting download of 42895 bytes

downloading of 42895 bytes finished Starting download of 12348071 bytes .......................................................................... .................... downloading of 12348071 bytes finished Kernel image @ 0x80800000 [ 0x000000 - 0x68d658 ]

Loading init Ramdisk from Legacy Image at 86800000 ...

   Image Name:   fsl-image-mfgtool-initramfs-imx6    Image Type:   ARM Linux RAMDisk Image (uncompressed)    Data Size:    12348007 Bytes = 11.8 MiB    Load Address: 00000000    Entry Point:  00000000    Verifying Checksum ... OK

Flattened Device Tree blob at 83000000

   Booting using the fdt blob at 0x83000000    Using Device Tree in place at 83000000, end 8300d78e switch to ldo_bypass mode!

Starting kernel ...

vddarm: bypassed regulator has no supply! vddarm: failed to get the current voltage(-517) vddsoc: bypassed regulator has no supply! vddsoc: failed to get the current voltage(-517) imx6sx-pinctrl 20e0000.iomuxc: Invalid fsl,pins or pins property in node /soc/aips-bus@02000000/iomuxc@020e0000/imx6x-sdb/wdoggrp gpio-9 (cts): _gpiod_direction_output_raw: tried to set a GPIO tied to an IRQ as output gpio-12 (cts): _gpiod_direction_output_raw: tried to set a GPIO tied to an IRQ as output fec 2188000.ethernet (unnamed net_device) (uninitialized): Invalid MAC address: 00:00:00:00:00:00 caam-snvs 20cc000.caam-snvs: can't get snvs clock Found New UDC: ci_hdrc.0 ci_hdrc.0 0 ffs.utp0 run utp at /dev/usb-utp0/ep0 . uuu fastboot client 1.0.0 [built Apr 14 2019 13:43:48] Start init usb write string Start handle command uuc /dev/utp uuc 0.5 [built Apr 14 2019 13:43:48] UTP: Waiting for /dev/utp to appear run shell cmd: while [ ! -e /dev/mmcblkboot0 ]; do sleep 1; echo "wait for /dev/mmcblkboot appear"; done; run shell cmd: dev=`ls /dev/mmcblkboot`; dev=($dev); dev=${dev[0]}; dev=${dev#/dev/mmcblk}; dev=${dev%boot}; echo $dev > /tmp/mmcdev; run shell cmd: mmc=cat /tmp/mmcdev; PARTSTR=$'10M,500M,0c\n600M,,83\n'; echo "$PARTSTR" | sfdisk --force /dev/mmcblk${mmc} Partition #1 contains a vfat signature. Partition #2 contains a ext3 signature. run shell cmd: mmc=cat /tmp/mmcdev; dd if=/dev/zero of=/dev/mmcblk${mmc} bs=1k seek=4096 count=1 1+0 records in 1+0 records out 1024 bytes (1.0 kB, 1.0 KiB) copied, 0.00171967 s, 595 kB/s run shell cmd: sync run shell cmd: mmc=cat /tmp/mmcdev; while [ ! -e /dev/mmcblk${mmc}p1 ]; do sleep 1; done run shell cmd: mmc=cat /tmp/mmcdev; mkfs.vfat /dev/mmcblk${mmc}p1 run shell cmd: mmc=cat /tmp/mmcdev; mkdir -p /mnt/fat run shell cmd: mmc=cat /tmp/mmcdev; mount -t vfat /dev/mmcblk${mmc}p1 /mnt/fat WOpen:/mnt/fat WOpen:/mnt/fat/zImage WOpen:/mnt/fat WOpen:/mnt/fat/imx6sx-sdb-lgecg.dtb run shell cmd: umount /mnt/fat run shell cmd: mmc=cat /tmp/mmcdev; mkfs.ext3 -F -E nodiscard /dev/mmcblk${mmc}p2 mke2fs 1.43.8 (1-Jan-2018) run shell cmd: mkdir -p /mnt/ext3 run shell cmd: mmc=cat /tmp/mmcdev; mount /dev/mmcblk${mmc}p2 /mnt/ext3 run shell cmd: export EXTRACT_UNSAFE_SYMLINKS=1; tar -jx -C /mnt/ext3 WOpen:-

guwhite commented 4 years ago

I'm having the same issue and with a similar serial log. Here are a few levers I've tried (Remove # to invoke).

Levers for available free memory space

FBK: ucmd echo 'vm.min_free_kbytes = 65536' > /etc/sysctl.d/01_minfreekbytes.conf

FBK: ucmd echo 'vm.swappiness = 80' > /etc/sysctl.d/swappiness.conf

FBK: ucmd sysctl -p /etc/sysctl.d/01_minfreekbytes.conf

FBK: ucmd sysctl -p /etc/sysctl.d/swappiness.conf

Levers for CPU clocking

FBK: ucmd echo powersave > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

Levers for CPU enable

FBK: ucmd echo "0" >/sys/devices/system/cpu/cpu1/online

FBK: ucmd echo "0" >/sys/devices/system/cpu/cpu2/online

FBK: ucmd echo "0" >/sys/devices/system/cpu/cpu3/online

Levers for disk caching

FBK: ucmd echo 100 > /proc/sys/vm/dirty_expire_centisecs

FBK: ucmd echo 100 > /proc/sys/vm/dirty_writeback_centisecs

The only thing in the above that seems to affect the results is to limit the CPU to only cpu0 (it takes a long time but it passes). Turning on the other CPUs will eventually fail but at different places. In my scenario, enabling CPU0 and CPU3 will result in the script failing at the "unmount" command for some reason. Looking for suggestions.

nxpfrankli commented 4 years ago

Does https://github.com/NXPmicro/mfgtools/pull/137 can work around this problem?

It's strange problem. Only 40MB used by ufb. I am not sure why usb can't allocate 64k memory. Our USB driver owner is checking it.

guwhite commented 4 years ago

137 does not help in my scenario. Our scripts are different from above by first copying the bz2 to a temporary directory and untaring from there to disk instead of directly host copy / untar to disk.

jessie80 commented 4 years ago

@nxpfrankli i'm waiting the feedback from customer. as i know, he is on the business trip. he may be back in next Monday. I'll update soon.

jessie80 commented 4 years ago

@nxpfrankli According to the customer , with your temporal binary, TIMEOUT issue is resolved. Is there any progress from USBdriver owner?

nxpfrankli commented 4 years ago

not yet. Not sure why there are not continue 64K memory at that time

nxpfrankli commented 4 years ago

5.4 kernel's usb support scatter list. Q2 release will include this change. this problem can be fixed at 5.4 kernel.

franklin-woo commented 4 years ago

I got a same issue. My rootfs file size 674mb. I built the yocto(zeus) and kernel version is 5.4.3.

Below log is some part of uuu verbose log.

Allocating group tables: done
Writing inode tables: done
Creating journal (8192 blocks): done Writing superblocks and filesystem accounting information: done

1:1>Okay (2.124s) 1:1>Start Cmd:FBK: ucmd mmc=cat /tmp/mmcdev; mkfs.ext4 /dev/mmcblk${mmc}p4 Discarding device blocks: done
Creating filesystem with 841680 4k blocks and 210496 inodes Filesystem UUID: d3b6b55d-1798-4021-9418-b56e3c7e5ff4 Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200

Allocating group tables: done
Writing inode tables: done
Creating journal (16384 blocks): done Writing superblocks and filesystem accounting information: done

1:1>Okay (3.781s) 1:1>Start Cmd:FBK: ucmd mkdir -p /mnt/rootfs 1:1>Okay (0.027s) 1:1>Start Cmd:FBK: ucmd mmc=cat /tmp/mmcdev; mount -t ext4 /dev/mmcblk${mmc}p2 /mnt/rootfs 1:1>Okay (0.105s) 1:1>Start Cmd:FBK: acmd tar -jx -C /mnt/rootfs 1:1>Okay (0.051s) 1:1>Start Cmd:FBK: ucp firmware/fsl-image-qt5-rootfs.tar.bz2 t:- 4%1:1>Fail Bulk(R):LIBUSB_ERROR_NO_DEVICE(165.7s)

And the kernel log.

U-Boot 2019.04-lf-5.4.y_v2019.04+g228843cdf5 (Jun 24 2020 - 19:00:51 +0900)

CPU: Freescale i.MX6SOLO rev1.3 996 MHz (running at 792 MHz) CPU: Extended Commercial temperature grade (-20C to 105C) at 45C Reset cause: POR Model: Freescale i.MX6 DualLite SABRE Smart Device Board Board: MX6-SabreSD I2C: ready DRAM: 512 MiB

........

Starting kernel ...

[ 0.000000] Booting Linux on physical CPU 0x0 [ 0.000000] Linux version 5.4.3+gf8118585ee3c (frank@frank-desktop) (gcc version 9.2.0 (GCC)) #1 SMP PREEMPT Thu Jun 25 17:42:03 KST 2020 [ 0.000000] CPU: ARMv7 Processor [412fc09a] revision 10 (ARMv7), cr=10c5387d [ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache [ 0.000000] OF: fdt: Machine model: Freescale i.MX6 DualLite SABRE Smart Device Board [ 0.000000] Memory policy: Data cache writeback [ 0.000000] Reserved memory: created CMA memory pool at 0x1c000000, size 320 MiB [ 0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool [ 0.000000] CPU: All CPU(s) started in SVC mode. [ 0.000000] percpu: Embedded 20 pages/cpu s50920 r8192 d22808 u81920 [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 130048 [ 0.000000] Kernel command line: console=ttymxc0,115200 rdinit=/linuxrc clk_ignore_unused mfg_mmcdev=3 [ 0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes, linear) [ 0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes, linear) [ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off [ 0.000000] Memory: 154912K/524288K available (11264K kernel code, 1014K rwdata, 3504K rodata, 1024K init, 6576K bss, 41696K reserved, 32 7680K cma-reserved, 0K highmem)

........

719872 bytes (720 kB, 703 KiB) copied, 0.0482173 s, 14.9 MB/s run shell cmd: mmc=cat /tmp/mmcdev; echo 1 > /sys/block/mmcblk${mmc}boot0/force_ro run shell cmd: mmc=cat /tmp/mmcdev; while [ ! -e /dev/mmcblk${mmc}p1 ]; do sleep 1; done run shell cmd: mmc=cat /tmp/mmcdev; mkfs.vfat /dev/mmcblk${mmc}p1 run shell cmd: mmc=cat /tmp/mmcdev; mkdir -p /mnt/fat run shell cmd: mmc=cat /tmp/mmcdev; mount -t vfat /dev/mmcblk${mmc}p1 /mnt/fat WOpen:/mnt/fat WOpen:/mnt/fat/zImage [ 9.378323] random: crng init done WOpen:/mnt/fat WOpen:/mnt/fat/imx6dl-sabresd.dtb run shell cmd: umount /mnt/fat run shell cmd: mmc=cat /tmp/mmcdev; mkfs.ext4 /dev/mmcblk${mmc}p2 mke2fs 1.45.3 (14-Jul-2019) run shell cmd: mmc=cat /tmp/mmcdev; mkfs.ext4 /dev/mmcblk${mmc}p3 mke2fs 1.45.3 (14-Jul-2019) run shell cmd: mmc=cat /tmp/mmcdev; mkfs.ext4 /dev/mmcblk${mmc}p4 mke2fs 1.45.3 (14-Jul-2019) run shell cmd: mkdir -p /mnt/rootfs run shell cmd: mmc=cat /tmp/mmcdev; mount -t ext4 /dev/mmcblk${mmc}p2 /mnt/rootfs [ 20.723176] EXT4-fs (mmcblk3p2): mounted filesystem with ordered data mode. Opts: (null) run shell cmd: tar -jx -C /mnt/rootfs WOpen:- [ 35.050381] usb_otg_vbus: disabling [ 35.054076] usb_h1_vbus: disabling [ 35.057512] wm8962-supply: disabling [ 35.071654] MPCIE_3V3: disabling [ 35.074928] sensors-supply: disabling [ 64.491168] imx-sdma 20ec000.sdma: Direct firmware load for imx/sdma/sdma-imx6q.bin failed with error -2 [ 64.513356] imx-sdma 20ec000.sdma: Falling back to sysfs fallback for: imx/sdma/sdma-imx6q.bin [ 69.610247] cfg80211: failed to load regulatory.db failure write to usb ep

nxpfrankli commented 4 years ago

I check your kernel git commit hash value, which not include, Latest kernel will publish at Jun 30. Please update it and try again.

commit ff01b0f10d5f5ada52140561b21387092dadf446 Author: Peter Chen peter.chen@nxp.com Date: Fri Feb 21 21:40:57 2020 +0800

MLK-23349-2 usb: chipidea: udc: add sg list support

For low system memory system (eg, 265M), it may met OOM issue if the
request buffer is large (eg, 64KB). We ran out below OOM issue for f_fs.
Luckily, the f_fs supports sg list now, the OOM issue is fixed with
this patch.

ufb: page allocation failure: order:4, mode:0x40cc0(GFP_KERNEL|__GFP_COMP),
nodemask=(null),cpuset=/,mems_allowed=0
CPU: 2 PID: 370 Comm: ufb Not tainted 5.4.3-1.1.0+g54b3750d61fd #1
Hardware name: NXP i.MX8MNano DDR4 EVK board (DT)
franklin-woo commented 4 years ago

udc: add sg list support

I check your kernel git commit hash value, which not include, Latest kernel will publish at Jun 30. Please update it and try again.

commit ff01b0f10d5f5ada52140561b21387092dadf446 Author: Peter Chen peter.chen@nxp.com Date: Fri Feb 21 21:40:57 2020 +0800

MLK-23349-2 usb: chipidea: udc: add sg list support

For low system memory system (eg, 265M), it may met OOM issue if the
request buffer is large (eg, 64KB). We ran out below OOM issue for f_fs.
Luckily, the f_fs supports sg list now, the OOM issue is fixed with
this patch.

ufb: page allocation failure: order:4, mode:0x40cc0(GFP_KERNEL|__GFP_COMP),
nodemask=(null),cpuset=/,mems_allowed=0
CPU: 2 PID: 370 Comm: ufb Not tainted 5.4.3-1.1.0+g54b3750d61fd #1
Hardware name: NXP i.MX8MNano DDR4 EVK board (DT)

Thank you for reply.

I found the patch below link.

https://www.spinics.net/lists/linux-usb/msg191815.html https://www.spinics.net/lists/linux-usb/msg194332.html

I applied the patch in my kernel, But it's not the work. I get the same error as before. :( Can you give me the official patch link?

ghost commented 4 years ago

udc: add sg list support

I check your kernel git commit hash value, which not include, Latest kernel will publish at Jun 30. Please update it and try again. commit ff01b0f10d5f5ada52140561b21387092dadf446 Author: Peter Chen peter.chen@nxp.com Date: Fri Feb 21 21:40:57 2020 +0800

MLK-23349-2 usb: chipidea: udc: add sg list support

For low system memory system (eg, 265M), it may met OOM issue if the
request buffer is large (eg, 64KB). We ran out below OOM issue for f_fs.
Luckily, the f_fs supports sg list now, the OOM issue is fixed with
this patch.

ufb: page allocation failure: order:4, mode:0x40cc0(GFP_KERNEL|__GFP_COMP),
nodemask=(null),cpuset=/,mems_allowed=0
CPU: 2 PID: 370 Comm: ufb Not tainted 5.4.3-1.1.0+g54b3750d61fd #1
Hardware name: NXP i.MX8MNano DDR4 EVK board (DT)

Thank you for reply.

I found the patch below link.

https://www.spinics.net/lists/linux-usb/msg191815.html https://www.spinics.net/lists/linux-usb/msg194332.html

I applied the patch in my kernel, But it's not the work. I get the same error as before. :( Can you give me the official patch link?

Hi, have you solved your issue ? im experiencing the same one under windows/ubuntu my rootfs file size only 100MB

=============================================================== C:\Users---\Downloads\windows>uuu ./example_kernel_nand.uuu uuu (Universal Update Utility) for nxp imx chips -- libuuu_1.3.191-0-g4fe24b9

Success 0 Failure 1

1:10 21/24 [Bulk(R):LIBUSB_ERROR_TIMEOUT ] FBK: ucp rootfs.tar t:-

and using this script ending:

burn rootfs

FBK: ucmd source /tmp/mtd.sh; flash_erase /dev/mtd${nandrootfs} 0 0 FBK: ucmd source /tmp/mtd.sh; ubiattach /dev/ubi_ctrl -m ${nandrootfs} FBK: ucmd source /tmp/mtd.sh; ubimkvol /dev/ubi0 -Nnandrootfs -m FBK: ucmd source /tmp/mtd.sh; mkdir -p /mnt/mtd FBK: ucmd source /tmp/mtd.sh; mount -t ubifs ubi0:nandrootfs /mnt/mtd

FBK: acmd export EXTRACT_UNSAFE_SYMLINKS=1; tar -xv -C /mnt/mtd FBK: ucp rootfs.tar t:- FBK: sync FBK: ucmd umount /mnt/mtd

FBK: done

franklin-woo commented 4 years ago

I tested today with the kernel 5.7.7 and 5.8-rc3. But still not the work. It occurs same error. :(

nxpfrankli commented 4 years ago

I am not sure peter's patch upstreamed.

MLK-23349-2 usb: chipidea: udc: add sg list support Can you try our release https://source.codeaurora.org/external/imx/linux-imx/commit/?h=rel_imx_5.4.24_2.1.0&id=babac008e5cf168abca1a85bda2e8071ca27a5c0

franklin-woo commented 4 years ago

imx_5.4.24_2.1.0 branch is the same. doesn't work. My board is only sent below 128mb. If it exceeds 128mb, the transfer will fail.


1:1>Okay (1.568s) 1:1>Start Cmd:FBK: ucmd mmc=cat /tmp/mmcdev; dd if=/dev/zero of=/dev/mmcblk${mmc} bs=1k seek=4096 count=1 1:1>Okay (0.049s) 1:1>Start Cmd:FBK: ucmd sync 1:1>Okay (0.025s) 1:1>Start Cmd:FBK: ucmd mmc=cat /tmp/mmcdev; echo 0 > /sys/block/mmcblk${mmc}boot0/force_ro 1:1>Okay (0.035s) 1:1>Start Cmd:FBK: ucp firmware/u-boot-dtb.imx t:/tmp 99%1:1>Okay (0.146s) 1:1>Start Cmd:FBK: ucmd mmc=cat /tmp/mmcdev; dd if=/tmp/u-boot-dtb.imx of=/dev/mmc${mmc}boot0 bs=1K seek=32 1:1>Okay (0.089s) 1:1>Start Cmd:FBK: ucmd mmc=cat /tmp/mmcdev; echo 1 > /sys/block/mmcblk${mmc}boot0/force_ro 1:1>Okay (0.033s) 1:1>Start Cmd:FBK: ucmd mmc=cat /tmp/mmcdev; while [ ! -e /dev/mmcblk${mmc}p1 ]; do sleep 1; done 1:1>Okay (0.032s) 1:1>Start Cmd:FBK: ucmd mmc=cat /tmp/mmcdev; mkfs.vfat /dev/mmcblk${mmc}p1 mkfs.fat 4.1 (2017-01-24) 1:1>Okay (0.11s) 1:1>Start Cmd:FBK: ucmd mmc=cat /tmp/mmcdev; mkdir -p /mnt/fat 1:1>Okay (0.042s) 1:1>Start Cmd:FBK: ucmd mmc=cat /tmp/mmcdev; mount -t vfat /dev/mmcblk${mmc}p1 /mnt/fat 1:1>Okay (0.104s) 1:1>Start Cmd:FBK: ucp firmware/zImage t:/mnt/fat 99%1:1>Okay (2.58s) 1:1>Start Cmd:FBK: ucp firmware/imx6dl-sabresd.dtb t:/mnt/fat 102%1:1>Okay (0.014s) 1:1>Start Cmd:FBK: ucmd umount /mnt/fat 1:1>Okay (0.526s) 1:1>Start Cmd:FBK: ucmd mmc=cat /tmp/mmcdev; mkfs.ext3 -F -E nodiscard /dev/mmcblk${mmc}p2 Creating filesystem with 262144 4k blocks and 65536 inodes Filesystem UUID: be6d3d24-4a46-41b3-9eef-b5f71a954457 Superblock backups stored on blocks: 32768, 98304, 163840, 229376

Allocating group tables: done
Writing inode tables: done
Creating journal (8192 blocks): done Writing superblocks and filesystem accounting information: done

1:1>Okay (12.51s) 1:1>Start Cmd:FBK: ucmd mkdir -p /mnt/rootfs 1:1>Okay (0.025s) 1:1>Start Cmd:FBK: ucmd mmc=cat /tmp/mmcdev; mount -t ext3 /dev/mmcblk${mmc}p2 /mnt/rootfs 1:1>Okay (0.118s) 1:1>Start Cmd:FBK: ucp firmware/fsl-image-qt5-rootfs.tar.bz2 t:/mnt/rootfs 19%1:1>Fail Bulk(R):LIBUSB_ERROR_TIMEOUT(38.39s)

nxpfrankli commented 4 years ago

what's your physical memory size?

franklin-woo commented 4 years ago

what's your physical memory size?

Memory size is 512MB.

nxpfrankli commented 4 years ago

Any output at board uart console?

franklin-woo commented 4 years ago

Any output at board uart console?

Refer to below log.

U-Boot 2019.04-lf-5.4.y_v2019.04+g228843cdf5 (Jun 24 2020 - 19:00:51 +0900)

CPU: Freescale i.MX6SOLO rev1.3 996 MHz (running at 792 MHz) CPU: Extended Commercial temperature grade (-20C to 105C) at 44C Reset cause: POR Model: Freescale i.MX6 DualLite SABRE Smart Device Board Board: MX6-SabreSD I2C: ready DRAM: 512 MiB

MMC: FSL_SDHC: 1, FSL_SDHC: 2, FSL_SDHC: 3 Loading Environment from MMC... MMC: no card present *** Warning - No block device, using default environment

No panel detected: default to HDMI Display: HDMI (1024x768) In: serial Out: serial Err: serial MMC: no card present flash target is MMC:2 MMC: no card present MMC card init failed! MMC: no card present ** Block device MMC 2 not supported Net: Board Net Initialization Failed No ethernet found. Fastboot: Normal Boot from USB for mfgtools *** Warning - Use default environment for mfgtools , using default environment

Run bootcmd_mfg: run mfgtool_args;if iminfo ${initrd_addr}; then if test ${tee} = yes; then bootm ${tee_addr} ${initrd_addr} ${fdt_addr}; el se bootz ${loadaddr} ${initrd_addr} ${fdt_addr}; fi; else echo "Run fastboot ..."; fastboot 0; fi; Hit any key to stop autoboot: 0

Checking Image at 12c00000 ...

Unknown image format! Run fastboot ... Starting download of 8559608 bytes ................................................................. downloading of 8559608 bytes finished Starting download of 48162 bytes

downloading of 48162 bytes finished Starting download of 12475878 bytes .......................................................................... ..................... downloading of 12475878 bytes finished Kernel image @ 0x12000000 [ 0x000000 - 0x829bf8 ]

Loading init Ramdisk from Legacy Image at 12c00000 ...

Image Name: fsl-image-mfgtool-initramfs-imx6 Image Type: ARM Linux RAMDisk Image (uncompressed) Data Size: 12475814 Bytes = 11.9 MiB Load Address: 00000000 Entry Point: 00000000 Verifying Checksum ... OK

Flattened Device Tree blob at 18000000

Booting using the fdt blob at 0x18000000 Using Device Tree in place at 18000000, end 1800ec21 No PMIC found!

Starting kernel ...

[ 0.000000] Booting Linux on physical CPU 0x0 [ 0.000000] Linux version 5.4.24-00060-gbabac008e5cf (frank@frank-desktop) (gcc version 9.2.0 (GCC)) #1 SMP Thu Jul 2 09:29:09 KST 2020 [ 0.000000] CPU: ARMv7 Processor [412fc09a] revision 10 (ARMv7), cr=10c5387d [ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache [ 0.000000] OF: fdt: Machine model: Freescale i.MX6 DualLite SABRE Smart Device Board [ 0.000000] Memory policy: Data cache writeback [ 0.000000] Reserved memory: created CMA memory pool at 0x1c000000, size 320 MiB [ 0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool [ 0.000000] CPU: All CPU(s) started in SVC mode. [ 0.000000] percpu: Embedded 20 pages/cpu s50664 r8192 d23064 u81920 [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 130048 [ 0.000000] Kernel command line: console=ttymxc0,115200 rdinit=/linuxrc clk_ignore_unused mfg_mmcdev=3 [ 0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes, linear) [ 0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes, linear) [ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off [ 0.000000] Memory: 153688K/524288K available (11264K kernel code, 1246K rwdata, 3912K rodata, 1024K init, 6563K bss, 42920K reserved, 32 7680K cma-reserved, 0K highmem) [ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1 [ 0.000000] Running RCU self tests [ 0.000000] rcu: Hierarchical RCU implementation. [ 0.000000] rcu: RCU event tracing is enabled. [ 0.000000] rcu: RCU lockdep checking is enabled. [ 0.000000] rcu: RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2. [ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies. [ 0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2 [ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16 [ 0.000000] L2C-310 erratum 769419 enabled [ 0.000000] L2C-310 enabling early BRESP for Cortex-A9 [ 0.000000] L2C-310 full line of zeros enabled for Cortex-A9 [ 0.000000] L2C-310 ID prefetch enabled, offset 16 lines [ 0.000000] L2C-310 dynamic clock gating enabled, standby mode enabled [ 0.000000] L2C-310 cache controller enabled, 16 ways, 512 kB [ 0.000000] L2C-310: CACHE_ID 0x410000c8, AUX_CTRL 0x76450001 [ 0.000000] random: get_random_bytes called from start_kernel+0x2b4/0x4d4 with crng_init=0 [ 0.000000] Switching to timer-based delay loop, resolution 333ns [ 0.000007] sched_clock: 32 bits at 3000kHz, resolution 333ns, wraps every 715827882841ns [ 0.000041] clocksource: mxc_timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 637086815595 ns [ 0.001757] Console: colour dummy device 80x30 [ 0.001801] Lock dependency validator: Copyright (c) 2006 Red Hat, Inc., Ingo Molnar [ 0.001818] ... MAX_LOCKDEP_SUBCLASSES: 8 [ 0.001835] ... MAX_LOCK_DEPTH: 48 [ 0.001850] ... MAX_LOCKDEP_KEYS: 8192 [ 0.001866] ... CLASSHASH_SIZE: 4096 [ 0.001882] ... MAX_LOCKDEP_ENTRIES: 32768 [ 0.001897] ... MAX_LOCKDEP_CHAINS: 65536 [ 0.001913] ... CHAINHASH_SIZE: 32768 [ 0.001930] memory used by lock dependency info: 3997 kB [ 0.001946] memory used for stack traces: 2112 kB [ 0.001963] per task-struct memory footprint: 1536 bytes [ 0.002061] Calibrating delay loop (skipped), value calculated using timer frequency.. 6.00 BogoMIPS (lpj=30000) [ 0.002090] pid_max: default: 32768 minimum: 301 [ 0.002453] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear) [ 0.002480] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear) [ 0.005877] CPU: Testing write buffer coherency: ok [ 0.005984] CPU0: Spectre v2: using BPIALL workaround [ 0.007307] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000 [ 0.009930] Setting up static identity map for 0x10100000 - 0x10100078 [ 0.010537] rcu: Hierarchical SRCU implementation. [ 0.011879] smp: Bringing up secondary CPUs ... [ 0.014336] smp: Brought up 1 node, 1 CPU [ 0.014363] SMP: Total of 1 processors activated (6.00 BogoMIPS). [ 0.014382] CPU: All CPU(s) started in SVC mode. [ 0.016665] devtmpfs: initialized [ 0.048662] VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4 [ 0.049950] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns [ 0.050025] futex hash table entries: 512 (order: 3, 32768 bytes, linear) [ 0.064461] pinctrl core: initialized pinctrl subsystem [ 0.069648] NET: Registered protocol family 16 [ 0.090135] DMA: preallocated 256 KiB pool for atomic coherent allocations [ 0.093320] cpuidle: using governor menu [ 0.093630] CPU identified as i.MX6DL, silicon rev 1.3 [ 0.115948] mxs_phy 20c9000.usbphy: 20c9000.usbphy supply phy-3p0 not found, using dummy regulator [ 0.117694] mxs_phy 20ca000.usbphy: 20ca000.usbphy supply phy-3p0 not found, using dummy regulator [ 0.147978] No ATAGs? [ 0.148272] hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers. [ 0.148365] hw-breakpoint: maximum watchpoint size is 4 bytes. [ 0.151674] imx6dl-pinctrl 20e0000.iomuxc: initialized IMX pinctrl driver [ 0.259150] vgaarb: loaded [ 0.260796] SCSI subsystem initialized [ 0.262301] usbcore: registered new interface driver usbfs [ 0.262524] usbcore: registered new interface driver hub [ 0.262830] usbcore: registered new device driver usb [ 0.263166] usb_phy_generic usbphynop1: usbphynop1 supply vcc not found, using dummy regulator [ 0.263713] usb_phy_generic usbphynop2: usbphynop2 supply vcc not found, using dummy regulator [ 0.266469] gpio-155 (scl): enforced open drain please flag it properly in DT/ACPI DSDT/board file [ 0.267894] i2c i2c-0: IMX I2C adapter registered [ 0.269108] gpio-108 (scl): enforced open drain please flag it properly in DT/ACPI DSDT/board file [ 0.270507] i2c i2c-1: IMX I2C adapter registered [ 0.271546] gpio-3 (scl): enforced open drain please flag it properly in DT/ACPI DSDT/board file [ 0.271931] i2c i2c-2: IMX I2C adapter registered [ 0.272356] mc: Linux media interface: v0.10 [ 0.272473] videodev: Linux video capture interface: v2.00 [ 0.273005] pps_core: LinuxPPS API ver. 1 registered [ 0.273027] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti giometti@linux.it [ 0.273085] PTP clock support registered [ 0.274077] Advanced Linux Sound Architecture Driver Initialized. [ 0.280426] clocksource: Switched to clocksource mxc_timer1 [ 1.157642] VFS: Disk quotas dquot_6.6.0 [ 1.157805] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes) [ 1.184241] thermal_sys: Registered thermal governor 'step_wise' [ 1.184937] NET: Registered protocol family 2 [ 1.186767] tcp_listen_portaddr_hash hash table entries: 256 (order: 1, 10240 bytes, linear) [ 1.186873] TCP established hash table entries: 4096 (order: 2, 16384 bytes, linear) [ 1.186966] TCP bind hash table entries: 4096 (order: 5, 147456 bytes, linear) [ 1.187455] TCP: Hash tables configured (established 4096 bind 4096) [ 1.187842] UDP hash table entries: 256 (order: 2, 20480 bytes, linear) [ 1.187952] UDP-Lite hash table entries: 256 (order: 2, 20480 bytes, linear) [ 1.188365] NET: Registered protocol family 1 [ 1.190568] RPC: Registered named UNIX socket transport module. [ 1.190664] RPC: Registered udp transport module. [ 1.190683] RPC: Registered tcp transport module. [ 1.190704] RPC: Registered tcp NFSv4.1 backchannel transport module. [ 1.192069] PCI: CLS 0 bytes, default 64 [ 1.193400] Unpacking initramfs... [ 2.318257] Freeing initrd memory: 12184K [ 2.319514] hw perfevents: no interrupt-affinity property for /pmu, guessing. [ 2.320011] hw perfevents: enabled with armv7_cortex_a9 PMU driver, 7 counters available [ 2.322780] Bus freq driver module loaded [ 2.326443] Initialise system trusted keyrings [ 2.327157] workingset: timestamp_bits=30 max_order=17 bucket_order=0 [ 2.346248] NFS: Registering the id_resolver key type [ 2.346417] Key type id_resolver registered [ 2.346507] Key type id_legacy registered [ 2.346555] nfs4filelayout_init: NFSv4 File Layout Driver Registering... [ 2.347240] fuse: init (API version 7.31) [ 2.394410] Key type asymmetric registered [ 2.394589] Asymmetric key parser 'x509' registered [ 2.394794] io scheduler mq-deadline registered [ 2.394820] io scheduler kyber registered [ 2.401654] imx6q-pcie 1ffc000.pcie: couldn't get pcie-phy [ 2.404174] pwm-backlight backlight-lvds: backlight-lvds supply power not found, using dummy regulator [ 2.413308] mxs-dma 110000.dma-apbh: initialized [ 2.421728] 2020000.serial: ttymxc0 at MMIO 0x2020000 (irq = 24, base_baud = 5000000) is a IMX [ 3.220975] printk: console [ttymxc0] enabled [ 3.234590] imx-ipuv3 2400000.ipu: IPUv3H probed [ 3.279552] loop: module loaded [ 3.285027] imx ahci driver is registered. [ 3.294162] libphy: Fixed MDIO Bus: probed [ 3.299608] CAN device driver interface [ 3.311292] pps pps0: new PPS source ptp0 [ 3.316792] fec 2188000.ethernet: Invalid MAC address: 00:00:00:00:00:00 [ 3.323624] fec 2188000.ethernet: Using random MAC address: 5e:11:01:65:f2:fa [ 3.338050] libphy: fec_enet_mii_bus: probed [ 3.344455] fec 2188000.ethernet eth0: registered PHC device 0 [ 3.352273] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver [ 3.358834] ehci-pci: EHCI PCI platform driver [ 3.363480] ehci-mxc: Freescale On-Chip EHCI Host driver [ 3.369742] usbcore: registered new interface driver usb-storage [ 3.380060] imx_usb 2184000.usb: 2184000.usb supply vbus not found, using dummy regulator [ 3.563871] imx_usb 2184200.usb: 2184200.usb supply vbus not found, using dummy regulator [ 3.576858] ci_hdrc ci_hdrc.1: EHCI Host Controller [ 3.582213] ci_hdrc ci_hdrc.1: new USB bus registered, assigned bus number 1 [ 3.610462] ci_hdrc ci_hdrc.1: USB 2.0 started, EHCI 1.00 [ 3.617341] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.04 [ 3.625835] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1 [ 3.633144] usb usb1: Product: EHCI Host Controller [ 3.638049] usb usb1: Manufacturer: Linux 5.4.24-00060-gbabac008e5cf ehci_hcd [ 3.645261] usb usb1: SerialNumber: ci_hdrc.1 [ 3.653446] hub 1-0:1.0: USB hub found [ 3.657486] hub 1-0:1.0: 1 port detected [ 3.676863] snvs_rtc 20cc000.snvs:snvs-rtc-lp: registered as rtc0 [ 3.683611] i2c /dev entries driver [ 3.698739] imx2-wdt 20c0000.wdog: timeout 60 sec (nowayout=0) [ 3.707760] sdhci: Secure Digital Host Controller Interface driver [ 3.714044] sdhci: Copyright(c) Pierre Ossman [ 3.718424] sdhci-pltfm: SDHCI platform and OF driver helper [ 3.726046] sdhci-esdhc-imx 2194000.usdhc: Got CD GPIO [ 3.731362] sdhci-esdhc-imx 2194000.usdhc: Got WP GPIO [ 3.772915] mmc1: SDHCI controller on 2194000.usdhc [2194000.usdhc] using ADMA [ 3.781634] sdhci-esdhc-imx 2198000.usdhc: Got CD GPIO [ 3.786860] sdhci-esdhc-imx 2198000.usdhc: Got WP GPIO [ 3.825331] mmc2: SDHCI controller on 2198000.usdhc [2198000.usdhc] using ADMA [ 3.867256] mmc3: SDHCI controller on 219c000.usdhc [219c000.usdhc] using ADMA [ 3.879571] caam 2100000.caam: device ID = 0x0a16010000000100 (Era 4) [ 3.886479] caam 2100000.caam: job rings = 2, qi = 0 [ 4.031905] mmc3: new DDR MMC card at address 0001 [ 4.040627] usb 1-1: new high-speed USB device number 2 using ci_hdrc [ 4.059762] mmcblk3: mmc3:0001 DG4008 7.28 GiB [ 4.071188] mmcblk3boot0: mmc3:0001 DG4008 partition 1 4.00 MiB [ 4.077707] mmcblk3boot1: mmc3:0001 DG4008 partition 2 4.00 MiB [ 4.087151] usb 1-1: New USB device found, idVendor=05e3, idProduct=0608, bcdDevice=77.63 [ 4.095623] usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0 [ 4.102904] usb 1-1: Product: USB2.0 Hub [ 4.117589] mmcblk3rpmb: mmc3:0001 DG4008 partition 3 4.00 MiB, chardev (243:0) [ 4.133813] hub 1-1:1.0: USB hub found [ 4.143481] hub 1-1:1.0: 4 ports detected [ 4.162138] mmcblk3: p1 p2 p3 p4 [ 4.419661] caam algorithms registered in /proc/crypto [ 4.514562] caam_jr 2101000.jr0: registering rng-caam [ 4.524258] usbcore: registered new interface driver usbhid [ 4.529862] usbhid: USB HID core driver [ 4.552543] fsl-ssi-dai 202c000.ssi: No cache defaults, reading back from HW [ 4.567265] NET: Registered protocol family 10 [ 4.575658] Segment Routing with IPv6 [ 4.579470] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver [ 4.587636] NET: Registered protocol family 17 [ 4.592334] can: controller area network core (rev 20170425 abi 9) [ 4.598754] NET: Registered protocol family 29 [ 4.603382] can: raw protocol (rev 20170425) [ 4.607825] can: broadcast manager protocol (rev 20170425 t) [ 4.613599] can: netlink gateway (rev 20190810) max_hops=1 [ 4.619549] Key type dns_resolver registered [ 4.624854] Registering SWP/SWPB emulation handler [ 4.630268] Loading compiled-in X.509 certificates [ 4.737207] imx6q-pcie 1ffc000.pcie: couldn't get pcie-phy [ 4.757846] imx6q-pcie 1ffc000.pcie: couldn't get pcie-phy [ 4.765764] galcore 130000.gpu: ignoring dependency for device, assuming no driver [ 4.775581] mxc_vpu 2040000.vpu_fsl: ignoring dependency for device, assuming no driver [ 4.788731] imx6q-pcie 1ffc000.pcie: couldn't get pcie-phy [ 4.796982] input: gpio-keys as /devices/soc0/gpio-keys/input/input0 [ 4.813312] imx6q-pcie 1ffc000.pcie: couldn't get pcie-phy [ 4.819987] snvs_rtc 20cc000.snvs:snvs-rtc-lp: setting system clock to 1970-01-01T00:00:01 UTC (1) [ 4.829595] cfg80211: Loading compiled-in X.509 certificates for regulatory database [ 4.866202] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7' [ 4.873877] clk: Not disabling unused clocks [ 4.879369] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2 [ 4.888330] platform regulatory.0: Falling back to sysfs fallback for: regulatory.db [ 4.896360] ALSA device list: [ 4.899558] No soundcards found. [ 4.906530] Freeing unused kernel memory: 1024K [ 4.911870] Run /linuxrc as init process Found New UDC: ci_hdrc.0 ci_hdrc.0 0 ffs.utp0 [ 5.118433] file system registered [ 5.183781] Mass Storage Function, version: 2009/09/11 [ 5.189109] LUN: removable file: (no medium) run utp at /dev/usb-utp0/ep0 . uuu fastboot client 1.0.0 [built [ 5.230321] read descriptors Jun 22 2020 10:52:23] Start init[ 5.236103] read strings usb write string Start handle command uuc /dev/utp uuc 0.6 [built Jun 22 2020 10:52:22] UTP: Waiting for /dev/utp to appear [ 6.649171] configfs-gadget gadget: high-speed config #1: c run shell cmd: cmdline=cat /proc/cmdline;cmdline=${cmdline#mfg_mmcdev=};cmds=($cmdline);echo ${cmds[0]}>/tmp/mmcdev run shell cmd: mmc=cat /tmp/mmcdev; while [ ! -e /dev/mmcblk${mmc} ]; do sleep 1; echo "wait for /dev/mmcblk${mmc} appear"; done; run shell cmd: mmc=cat /tmp/mmcdev; PARTSTR=$'20M,100M,0c\n121M,1024M,0\n1146M,1024M,0\n2170M,,83\n'; echo "$PARTSTR" | sfdisk --force /de v/mmcblk${mmc} [ 7.116017] random: fast init done [ 7.176413] mmcblk3: p1 p2 p3 p4 Partition #1 contains a vfat signature. Partition #2 contains a ext3 signature. Partition #3 contains a ext4 signature. Partition #4 contains a ext4 signature. [ 8.618416] mmcblk3: p1 p2 p3 p4 run shell cmd: mmc=cat /tmp/mmcdev; dd if=/dev/zero of=/dev/mmcblk${mmc} bs=1k seek=4096 count=1 1+0 records in 1+0 records out 1024 bytes (1.0 kB, 1.0 KiB) copied, 0.00633633 s, 162 kB/s run shell cmd: sync run shell cmd: mmc=cat /tmp/mmcdev; echo 0 > /sys/block/mmcblk${mmc}boot0/force_ro WOpen:/tmp WOpen:/tmp/u-boot-dtb.imx run shell cmd: mmc=cat /tmp/mmcdev; dd if=/tmp/u-boot-dtb.imx of=/dev/mmc${mmc}boot0 bs=1K seek=32 707+0 records in 707+0 records out 723968 bytes (724 kB, 707 KiB) copied, 0.0456507 s, 15.9 MB/s run shell cmd: mmc=cat /tmp/mmcdev; echo 1 > /sys/block/mmcblk${mmc}boot0/force_ro run shell cmd: mmc=cat /tmp/mmcdev; while [ ! -e /dev/mmcblk${mmc}p1 ]; do sleep 1; done run shell cmd: mmc=cat /tmp/mmcdev; mkfs.vfat /dev/mmcblk${mmc}p1 run shell cmd: mmc=cat /tmp/mmcdev; mkdir -p /mnt/fat run shell cmd: mmc=cat /tmp/mmcdev; mount -t vfat /dev/mmcblk${mmc}p1 /mnt/fat WOpen:/mnt/fat WOpen:/mnt/fat/zImage [ 9.911726] random: crng init done WOpen:/mnt/fat WOpen:/mnt/fat/imx6dl-sabresd.dtb run shell cmd: umount /mnt/fat run shell cmd: mmc=cat /tmp/mmcdev; mkfs.ext3 -F -E nodiscard /dev/mmcblk${mmc}p2 mke2fs 1.45.3 (14-Jul-2019) run shell cmd: mkdir -p /mnt/rootfs run shell cmd: mmc=cat /tmp/mmcdev; mount -t ext3 /dev/mmcblk${mmc}p2 /mnt/rootfs [ 23.449752] EXT4-fs (mmcblk3p2): mounting ext3 file system using the ext4 subsystem [ 23.498599] EXT4-fs (mmcblk3p2): mounted filesystem with ordered data mode. Opts: (null) WOpen:/mnt/rootfs WOpen:/mnt/rootfs/fsl-image-qt5-rootfs.tar.bz2 [ 35.041354] MPCIE_3V3: disabling [ 35.044805] sensors-supply: disabling [ 35.048503] hdmi-5v-supply: disabling [ 35.053686] mipi_dsi_pwr_on: disabling [ 40.150312] 8<--- cut here --- [ 40.153402] Unable to handle kernel paging request at virtual address c04e1a1f [ 40.160644] pgd = e5a40413 [ 40.163368] [c04e1a1f] pgd=1040840e(bad) [ 40.167404] Internal error: Oops: 80d [#1] SMP ARM [ 40.172207] Modules linked in: [ 40.175280] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.4.24-00060-gbabac008e5cf #1 [ 40.182944] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree) [ 40.189494] PC is at __handle_domain_irq+0x8/0xdc [ 40.194216] LR is at gic_handle_irq+0x48/0x9c [ 40.198584] pc : [] lr : [] psr: a0070193 [ 40.204859] sp : c1201eb4 ip : 000003ff fp : 5924d24b [ 40.210092] r10: c1201ed8 r9 : c1264ff4 r8 : 00000000 [ 40.215326] r7 : f4a00100 r6 : c1209130 r5 : 000003ff r4 : f4a0010c [ 40.221861] r3 : c1201ed8 r2 : 00000001 r1 : 00000057 r0 : c6018400 [ 40.228399] Flags: NzCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment none [ 40.235628] Control: 10c5387d Table: 16984059 DAC: 00000051 [ 40.241384] Process swapper/0 (pid: 0, stack limit = 0x6abaffa9) [ 40.247399] Stack: (0xc1201eb4 to 0xc1202000) [ 40.251768] 1ea0: c04e1620 c07a752c 20070013 [ 40.259958] 1ec0: ffffffff c1201f0c c1332ec8 c1200000 00000009 c0101a70 00000001 00000006 [ 40.268147] 1ee0: 00000000 c120c580 00000001 589aa498 c120f1c4 cbb16db8 c1332ec8 00000009 [ 40.276337] 1f00: 00000009 5924d24b 00000000 c1201f28 c018c3d0 c07a752c 20070013 ffffffff [ 40.284526] 1f20: 00000051 00000000 c120f1c4 c01a7a54 00000001 c1208b08 c1201f83 c01b44a0 [ 40.292716] 1f40: 008a8e09 cbb16db8 c120f1c4 00000001 c1208b64 c1197db0 c1208ed4 c120f1c4 [ 40.300906] 1f60: cbb16db8 c07a791c c1200000 00000000 c1208b28 c0167eb4 c1208b00 00000001 [ 40.309095] 1f80: 00337bc0 c1208b08 c1173a50 000000ce 00000001 c1208b00 00000000 c1337bc0 [ 40.317285] 1fa0: 00000001 c1173a50 00000000 c016833c c1337c08 c1100e20 ffffffff ffffffff [ 40.325474] 1fc0: 00000000 c110057c 00000000 c1173a50 824ede4f c1208b08 c1100330 00000051 [ 40.333663] 1fe0: 10c0387d 00000f8c 18000000 412fc09a 10c5387d 00000000 00000000 00000000 [ 40.341861] [] (__handle_domain_irq) from [<00000009>] (0x9) [ 40.348403] Code: ea272554 c1216de8 e72de10c e1a0c005 (e7cc700e) [ 40.354521] ---[ end trace e984bb4bc0ae4bbd ]--- [ 40.359151] Kernel panic - not syncing: Attempted to kill the idle task! [ 40.365876] ---[ end Kernel panic - not syncing: Attempted to kill the idle task! ]---

nxpfrankli commented 4 years ago

It looks like the other problem. What's your hardware platform?

[ 40.153402] Unable to handle kernel paging request at virtual address c04e1a1f [ 40.160644] pgd = e5a40413 [ 40.163368] [c04e1a1f] *pgd=1040840e(bad) [ 40.167404] Internal error: Oops: 80d [#1] SMP ARM [ 40.172207] Modules linked in: [ 40.175280] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.4.24-00060-gbabac008e5cf #1 [ 40.182944] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree) [ 40.189494] PC is at __handle_domain_irq+0x8/0xdc [ 40.194216] LR is at gic_handle_irq+0x48/0x9c

franklin-woo commented 4 years ago

It looks like the other problem. What's your hardware platform?

[ 40.153402] Unable to handle kernel paging request at virtual address c04e1a1f [ 40.160644] pgd = e5a40413 [ 40.163368] [c04e1a1f] *pgd=1040840e(bad) [ 40.167404] Internal error: Oops: 80d [#1] SMP ARM [ 40.172207] Modules linked in: [ 40.175280] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.4.24-00060-gbabac008e5cf #1 [ 40.182944] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree) [ 40.189494] PC is at __handle_domain_irq+0x8/0xdc [ 40.194216] LR is at gic_handle_irq+0x48/0x9c

Sorry. That log is my test code error log. Please refer to below log. And h/w spec is 8G emmc, 512MB ram, i.MX6solo

run shell cmd: mmc=cat /tmp/mmcdev; echo 1 > /sys/block/mmcblk${mmc}boot0/force_ro run shell cmd: mmc=cat /tmp/mmcdev; while [ ! -e /dev/mmcblk${mmc}p1 ]; do sleep 1; done run shell cmd: mmc=cat /tmp/mmcdev; mkfs.vfat /dev/mmcblk${mmc}p1 run shell cmd: mmc=cat /tmp/mmcdev; mkdir -p /mnt/fat run shell cmd: mmc=cat /tmp/mmcdev; mount -t vfat /dev/mmcblk${mmc}p1 /mnt/fat WOpen:/mnt/fat WOpen:/mnt/fat/zImage [ 9.424295] random: crng init done WOpen:/mnt/fat WOpen:/mnt/fat/imx6dl-sabresd.dtb run shell cmd: umount /mnt/fat run shell cmd: mmc=cat /tmp/mmcdev; mkfs.ext4 /dev/mmcblk${mmc}p2 mke2fs 1.45.3 (14-Jul-2019) run shell cmd: mmc=cat /tmp/mmcdev; mkfs.ext4 /dev/mmcblk${mmc}p3 mke2fs 1.45.3 (14-Jul-2019) run shell cmd: mkdir -p /mnt/rootfs run shell cmd: mkdir -p /mnt/data run shell cmd: mmc=cat /tmp/mmcdev; mount -t ext4 /dev/mmcblk${mmc}p2 /mnt/rootfs [ 15.256417] EXT4-fs (mmcblk3p2): mounted filesystem with ordered data mode. Opts: (null) run shell cmd: mmc=cat /tmp/mmcdev; mount -t ext4 /dev/mmcblk${mmc}p3 /mnt/data [ 15.339890] EXT4-fs (mmcblk3p3): mounted filesystem with ordered data mode. Opts: (null) run shell cmd: export EXTRACT_UNSAFE_SYMLINKS=1; tar -jx -C /mnt/rootfs WOpen:- [ 35.043997] usb_otg_vbus: disabling [ 35.047707] usb_h1_vbus: disabling [ 35.051141] wm8962-supply: disabling [ 35.074458] MPCIE_3V3: disabling [ 35.077733] sensors-supply: disabling [ 35.081430] hdmi-5v-supply: disabling [ 35.108736] mipi_dsi_pwr_on: disabling [ 69.604921] cfg80211: failed to load regulatory.db failure write to usb ep

ghost commented 4 years ago

i figure out the solution for this issue. burn the kernel and dtb in the filesystem, will cause ECC error in uboot, so I burn the kernel and dtb in uboot. this one works successfully every time, im using NAND (check attached config)

uuu.txt WeChat Image_20200702104847

franklin-woo commented 4 years ago

i figure out the solution for this issue. burn the kernel and dtb in the filesystem, will cause ECC error in uboot, so I burn the kernel and dtb in uboot. this one works successfully every time, im using NAND (check attached config)

uuu.txt WeChat Image_20200702104847

Your solution doesn't work for me either. I think, even if you skip downloading the kernel and bootloader, the rootfs will be transferred.

ghost commented 4 years ago

maybe add sdcard ? im assuming you doing prototyping.