Other Parts Discussed in Thread: TMDS64EVM
Hi,
I'm working on a custom board featuring an AM6442 and an eMMC (SFEM020GB2ED1TB from Swissbit). Currently I use an SD card to boot our customized yocto distribution. Under low load the eMMC seems to works fine. But writing bigger files continuously (eg: cp /dev/random /emmcmnt/test) leads to kernel panic as follow:
root@sepcos-cpu:/mnt# cp /dev/random >> /mnt/test2 [ 671.800700] mmc0: running CQE recovery [ 671.810809] Unable to handle kernel paging request at virtual address 81c9e5008d1afa96 [ 671.818814] Mem abort info: [ 671.821638] ESR = 0x0000000096000004 [ 671.822143] Unable to handle kernel paging request at virtual address 005335b677a61c7c [ 671.825413] EC = 0x25: DABT (current EL), IL = 32 bits [ 671.825420] SET = 0, FnV = 0 [ 671.825424] EA = 0, S1PTW = 0 [ 671.825428] FSC = 0x04: level 0 translation fault [ 671.825433] Data abort info: [ 671.825435] ISV = 0, ISS = 0x00000004 [ 671.825438] CM = 0, WnR = 0 [ 671.833596] Mem abort info: [ 671.838641] [81c9e5008d1afa96] address between user and kernel address ranges [ 671.838649] Internal error: Oops: 0000000096000004 [#1] PREEMPT SMP [ 671.838658] Modules linked in: [ 671.841791] ESR = 0x0000000096000004 [ 671.844824] xhci_plat_hcd pci_endpoint_test rpmsg_ctrl rpmsg_char cdns3 [ 671.849768] EC = 0x25: DABT (current EL), IL = 32 bits [ 671.852566] cdns_usb_common irq_pruss_intc icssg_prueth crct10dif_ce pru_rproc icss_iep hsr overlay phy_can_transceiver ti_k3_r5_remoteproc pci_j721e_host [ 671.857948] ------------[ cut here ]------------ [ 671.859373] pci_j721e pcie_cadence_host cdns3_ti pcie_cadence rti_wdt [ 671.862172] WARNING: CPU: 1 PID: 102 at mm/slab_common.c:923 free_large_kmalloc+0x8c/0xc4 [ 671.869284] virtio_rpmsg_bus [ 671.875530] Modules linked in: [ 671.878571] rpmsg_ns [ 671.882304] xhci_plat_hcd [ 671.888984] ti_k3_m4_remoteproc [ 671.894277] pci_endpoint_test [ 671.908151] ti_k3_common [ 671.912749] rpmsg_ctrl [ 671.919255] k3_j72xx_bandgap [ 671.927408] rpmsg_char [ 671.930362] cfg80211 [ 671.933400] cdns3 [ 671.935660] rfkill [ 671.938353] cdns_usb_common [ 671.941567] sa2ul [ 671.944606] irq_pruss_intc [ 671.947212] pruss [ 671.949645] icssg_prueth [ 671.952598] ti_am335x_tscadc [ 671.955031] crct10dif_ce [ 671.957291] m_can_platform [ 671.959290] pru_rproc [ 671.961377] m_can [ 671.964243] icss_iep [ 671.966243] can_dev [ 671.969021] hsr [ 671.971021] rtc_rv3032 [ 671.973627] overlay [ 671.976580] lm75 [ 671.979186] phy_can_transceiver [ 671.981967] spi_omap2_mcspi [ 671.984313] ti_k3_r5_remoteproc [ 671.986313] optee_rng [ 671.988571] pci_j721e_host [ 671.990744] rng_core [ 671.992569] pci_j721e [ 671.995004] cryptodev(O) [ 671.997175] pcie_cadence_host [ 671.999087] fuse [ 672.002299] cdns3_ti [ 672.005166] drm [ 672.008378] pcie_cadence [ 672.010725] drm_panel_orientation_quirks [ 672.013503] rti_wdt [ 672.015763] ipv6 [ 672.018108] virtio_rpmsg_bus [ 672.020714] [ 672.023753] rpmsg_ns [ 672.025670] CPU: 0 PID: 607 Comm: cat Tainted: G O 6.1.46-gf8110d9ce8 #1 [ 672.027927] ti_k3_m4_remoteproc [ 672.029754] Hardware name: Secheron test 9 (DT) [ 672.032359] ti_k3_common [ 672.036354] pstate: 00000005 (nzcv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 672.038524] k3_j72xx_bandgap [ 672.040438] pc : kmem_cache_free+0x5c/0x360 [ 672.043391] cfg80211 [ 672.044871] lr : bvec_free+0x6c/0xbc [ 672.047130] rfkill [ 672.055196] sp : ffff800008003d50 [ 672.058407] sa2ul [ 672.062920] x29: ffff800008003d50 [ 672.065526] pruss [ 672.072465] x28: 0000000000000020 [ 672.075418] ti_am335x_tscadc [ 672.079585] x27: 0000000000000000 [ 672.081844] m_can_platform [ 672.085403] [ 672.087489] m_can [ 672.090789] x26: ffff000006369c80 [ 672.092789] can_dev [ 672.096088] x25: 0000000000000000 [ 672.098088] rtc_rv3032 [ 672.101475] x24: ffff000002fef100 [ 672.104428] lm75 [ 672.107814] [ 672.110594] spi_omap2_mcspi [ 672.112074] x23: 0000000000001000 [ 672.114074] optee_rng [ 672.117374] x22: ff80800008455c40 [ 672.119546] rng_core [ 672.122933] x21: 81c9e5008d1afa96 [ 672.125366] cryptodev(O) [ 672.128752] [ 672.130666] fuse [ 672.132145] x20: ffff000001bd5000 [ 672.135012] drm [ 672.138312] x19: ffff0000019b6d00 [ 672.140658] drm_panel_orientation_quirks [ 672.144045] x18: 0000000000040193 [ 672.146304] ipv6 [ 672.149690] [ 672.152296] [ 672.153776] x17: ffff800076964000 [ 672.155690] CPU: 1 PID: 102 Comm: kworker/u4:2 Tainted: G O 6.1.46-gf8110d9ce8 #1 [ 672.158989] x16: ffff800008000000 [ 672.160815] Hardware name: Secheron test 9 (DT) [ 672.164201] x15: 0000ffffa1b8f000 [ 672.168197] Workqueue: writeback wb_workfn [ 672.171580] [ 672.173494] (flush-179:0) [ 672.174973] x14: 2cedab2461a805b8 [ 672.176453] [ 672.179753] x13: 39db9250edf2f25a [ 672.188599] pstate: 40000005 (nZcv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 672.191985] x12: 6867c5487405885c [ 672.196498] pc : free_large_kmalloc+0x8c/0xc4 [ 672.199884] [ 672.199886] x11: 0000000000000040 [ 672.203963] lr : kfree+0x78/0x7c [ 672.205442] x10: ffff800076964000 [ 672.208134] sp : ffff800009ef3610 [ 672.211434] x9 : ffff000001808168 [ 672.212914] x29: ffff800009ef3610 [ 672.216300] [ 672.223240] x28: ffff00000e00b3b0 [ 672.226626] x8 : ffff00007fbbd988 [ 672.230966] x27: 0000000000045800 [ 672.232446] x7 : 0000000000000000 [ 672.235745] [ 672.238958] x6 : 0000000000000000 [ 672.242344] x26: ffff000001955380 [ 672.245644] [ 672.249030] x25: ffff00000d56f000 [ 672.252330] x5 : fffffffffffffd10 [ 672.253810] x24: 0000000000000002 [ 672.257197] x4 : 0000000000000000 [ 672.260495] [ 672.263882] x3 : ffff000001bd5000 [ 672.267268] x23: 0000000000000800 [ 672.268748] [ 672.272134] x22: ffff00000e00b288 [ 672.275434] x2 : 000000000000002f [ 672.276914] x21: 0000000000000000 [ 672.280300] x1 : 81c9e5008d1afa96 [ 672.283600] [ 672.286987] x0 : 81c9e5008d1afa97 [ 672.290373] x20: 0000000000000001 [ 672.291853] [ 672.295239] x19: fffffc0000065540 [ 672.298541] Call trace: [ 672.300019] x18: 0000000000040193 [ 672.303408] kmem_cache_free+0x5c/0x360 [ 672.306704] [ 672.310091] bvec_free+0x6c/0xbc [ 672.313477] x17: 0000000000000000 [ 672.314957] bio_free+0x58/0x80 [ 672.318344] x16: 0000000000000000 [ 672.321644] bio_put+0x114/0x1d0 [ 672.323122] x15: ffffffffffffffff [ 672.326509] __read_end_io+0x3c/0x1a0 [ 672.328942] [ 672.332328] mpage_end_io+0x20/0x44 [ 672.336148] x14: ffffffffffffffff [ 672.337628] bio_endio+0x178/0x190 [ 672.340840] x13: ffffffffffffffff [ 672.344140] blk_update_request+0x1d8/0x394 [ 672.347266] x12: ffff00000deb5ff8 [ 672.350652] mmc_blk_cqe_complete_rq+0xfc/0x16c [ 672.353866] [ 672.357252] mmc_blk_mq_complete+0x2c/0x50 [ 672.360897] x11: 0000000000000400 [ 672.362377] blk_complete_reqs+0x54/0x70 [ 672.365850] x10: ffff00000d56f000 [ 672.369150] blk_done_softirq+0x20/0x30 [ 672.372536] x9 : 0000000000000003 [ 672.375923] _stext+0x124/0x2a4 [ 672.380088] [ 672.383475] ____do_softirq+0x10/0x20 [ 672.387987] x8 : 000000006ce02b81 [ 672.389467] call_on_irq_stack+0x24/0x4c [ 672.393546] x7 : 000000000000001c [ 672.396846] do_softirq_own_stack+0x1c/0x30 [ 672.400752] x6 : 0000000000000000 [ 672.404139] __irq_exit_rcu+0xcc/0xf4 [ 672.407958] [ 672.411345] irq_exit_rcu+0x10/0x20 [ 672.414470] x5 : 0000000000000000 [ 672.415950] el1_interrupt+0x38/0x70 [ 672.419596] x4 : 0000000000316019 [ 672.422895] el1h_64_irq_handler+0x18/0x2c [ 672.426801] x3 : fffffc0000065540 [ 672.430187] el1h_64_irq+0x64/0x68 [ 672.434354] [ 672.437741] __arch_copy_from_user+0x1b8/0x230 [ 672.441386] x2 : 1b7bb27fd0b9d375 [ 672.442866] generic_perform_write+0xe8/0x1e0 [ 672.446339] x1 : ffff000001955380 [ 672.449638] ext4_buffered_write_iter+0x80/0x130 [ 672.453197] x0 : 0403b74f6b0ad13e [ 672.456583] ext4_file_write_iter+0x58/0x7c4 [ 672.460662] [ 672.464049] vfs_write+0x220/0x2b0 [ 672.467435] Call trace: [ 672.468915] ksys_write+0x68/0xf4 [ 672.473341] free_large_kmalloc+0x8c/0xc4 [ 672.476640] __arm64_sys_write+0x1c/0x2c [ 672.480980] kfree+0x78/0x7c [ 672.484366] invoke_syscall+0x48/0x114 [ 672.488965] ext4_ext_map_blocks+0x200/0x12f0 [ 672.492352] el0_svc_common.constprop.0+0xd4/0xfc [ 672.496605] ext4_map_blocks+0x214/0x5b0 [ 672.498085] do_el0_svc+0x30/0xd0 [ 672.501471] ext4_writepages+0x568/0xc70 [ 672.503905] el0_svc+0x2c/0x84 [ 672.507204] do_writepages+0x88/0x1b0 [ 672.511197] el0t_64_sync_handler+0xbc/0x140 [ 672.515103] __writeback_single_inode+0x38/0x1a0 [ 672.517970] el0t_64_sync+0x18c/0x190 [ 672.521704] writeback_sb_inodes+0x210/0x410 [ 672.526048] Code: 9249e3d6 d1000401 f240001f 9a951035 (f94002a0) [ 672.530730] __writeback_inodes_wb+0x50/0x110 [ 672.534641] ---[ end trace 0000000000000000 ]--- [ 672.537936] wb_writeback.isra.0+0x1b4/0x1c4 [ 672.541845] Kernel panic - not syncing: Oops: Fatal exception in interrupt [ 672.541851] SMP: stopping secondary CPUs [ 672.544882] wb_workfn+0x1bc/0x3a0 [ 672.548537] process_one_work+0x1d0/0x320 [ 672.552799] worker_thread+0x14c/0x444 [ 672.557407] kthread+0x10c/0x110 [ 672.561064] ret_from_fork+0x10/0x20 [ 672.565326] ---[ end trace 0000000000000000 ]--- [ 672.571523] Kernel Offset: disabled [ 672.621432] CPU features: 0x00000,00800084,0000420b [ 672.626299] Memory Limit: none [ 672.629347] Rebooting in 5 seconds..
dmesg indeed confirms that CQE is enabled:
root@sepcos-cpu:~# dmesg | grep mmc0 [ 1.446746] mmc0: CQHCI version 5.10 [ 1.492136] mmc0: SDHCI controller on fa10000.mmc [fa10000.mmc] using ADMA 64-bit [ 1.638398] mmc0: Command Queue Engine enabled [ 1.642913] mmc0: new HS200 MMC card at address 0001 [ 1.648828] mmcblk0: mmc0:0001 00010G 9.60 GiB [ 1.656122] mmcblk0boot0: mmc0:0001 00010G 31.5 MiB [ 1.662637] mmcblk0boot1: mmc0:0001 00010G 31.5 MiB [ 1.669516] mmcblk0rpmb: mmc0:0001 00010G 4.00 MiB, chardev (240:0)
Here's what the ios file looks like:
root@sepcos-cpu:~# cat /sys/kernel/debug/mmc0/ios clock: 200000000 Hz actual clock: 200000000 Hz vdd: 7 (1.65 - 1.95 V) bus mode: 2 (push-pull) chip select: 0 (don't care) power mode: 2 (on) bus width: 3 (8 bits) timing spec: 9 (mmc HS200) signal voltage: 1 (1.80 V) driver type: 0 (driver type B)
The eMMC schematics are identical to the TMDS64EVM, so is the DTB section for it.
My kernel is a 6.1 from the ti-linux-kernel project (commit f8110d9ce8019f576bb813cade4f66a04a0cd2a3). I should also mention that my custom kernel combined with TI's DTB for the EVM works well on the EVM itself.
My eMMC is supposed to support eMMC5.1 standard, thus supporting command queuing.
Any guess about where the issue might come from ?
Regards
Pierre