[PATCH 0/3] Rockchip IOMMU fixes
Quentin Schulz
quentin.schulz at cherry.de
Mon Mar 17 04:55:12 PDT 2025
Hi Robin,
On 3/13/25 6:31 PM, Robin Murphy wrote:
> Hi all,
>
> I was expecting my DT probing change to flush out issues, and it seems
> some weaknesses in rockchip-iommu were the first to show. The first two
> patches here get things working again for me on my RK3399 NanoPC-T4
> (with a console on HDMI exercising the VOP MMU), the 3rd patch just
> finishes the cleanup since I was there and could test it.
>
> Thanks,
> Robin.
>
> Robin Murphy (3):
> iommu/rockchip: Allocate per-device data sensibly
> iommu/rockchip: Register in a sensible order
> iommu/rockchip: Retire global dma_dev workaround
>
Fixes the issue seen on next-20250314 on my RK3588 Tiger Haikou:
"""
[ 2.007506] Unable to handle kernel NULL pointer dereference at
virtual address 0000000000000298
[ 2.017346] Mem abort info:
[ 2.020465] ESR = 0x0000000096000004
[ 2.024654] EC = 0x25: DABT (current EL), IL = 32 bits
[ 2.030591] SET = 0, FnV = 0
[ 2.033999] EA = 0, S1PTW = 0
[ 2.037506] FSC = 0x04: level 0 translation fault
[ 2.042958] Data abort info:
[ 2.046170] ISV = 0, ISS = 0x00000004, ISS2 = 0x00000000
[ 2.052302] CM = 0, WnR = 0, TnD = 0, TagAccess = 0
[ 2.057949] GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[ 2.063885] [0000000000000298] user address but active_mm is swapper
[ 2.070989] Internal error: Oops: 0000000096000004 [#1] PREEMPT SMP
[ 2.077994] Modules linked in:
[ 2.081405] CPU: 7 UID: 0 PID: 1 Comm: swapper/0 Not tainted
6.14.0-rc6-next-20250314-dirty #10
[ 2.091132] Hardware name: Theobroma Systems RK3588-Q7 SoM on Haikou
devkit (DT)
[ 2.099397] pstate: 00400009 (nzcv daif +PAN -UAO -TCO -DIT -SSBS
BTYPE=--)
[ 2.107179] pc : devm_kmalloc+0x28/0x100
[ 2.111568] lr : rk_iommu_of_xlate+0x30/0x90
[ 2.116341] sp : ffff800081d0b840
[ 2.120040] x29: ffff800081d0b840 x28: 0000000000000000 x27:
ffff8000815d3e20
[ 2.128010] x26: 0000000000000001 x25: ffff8000815d4ed8 x24:
ffff0001f08e1f60
[ 2.135989] x23: 0000000000000000 x22: ffff8000811b3f58 x21:
0000000000000000
[ 2.143966] x20: 0000000000000010 x19: 0000000000000000 x18:
00000000ffffffff
[ 2.151944] x17: ffff0001f14acc00 x16: ffff0001f14aca00 x15:
ffff0001f148b27c
[ 2.159922] x14: ffff800081d0b820 x13: ffff0001f148ba1c x12:
0101010101010101
[ 2.167899] x11: 7f7f7f7f7f7f7f7f x10: 00000000000a2cc8 x9 :
0000000000000003
[ 2.175877] x8 : ffff0001f08e3540 x7 : 0000000000000000 x6 :
1d150c11f5f38080
[ 2.183855] x5 : ffff0001f0278000 x4 : 0000000000000000 x3 :
ffff800081a77218
[ 2.191832] x2 : 0000000000000dc0 x1 : 0000000000000010 x0 :
0000000000000090
[ 2.199812] Call trace:
[ 2.202538] devm_kmalloc+0x28/0x100 (P)
[ 2.206924] rk_iommu_of_xlate+0x30/0x90
[ 2.211307] of_iommu_xlate+0x94/0xc0
[ 2.215400] of_iommu_configure+0x1cc/0x250
[ 2.220075] of_dma_configure_id+0x144/0x24c
[ 2.224848] platform_dma_configure+0x8c/0xb4
[ 2.229716] __iommu_probe_device+0x2e4/0x4a0
[ 2.234583] probe_iommu_group+0x3c/0x68
[ 2.238965] bus_for_each_dev+0x7c/0xe0
[ 2.243244] iommu_device_register+0xd8/0x228
[ 2.248111] rk_iommu_probe+0x204/0x360
[ 2.252397] platform_probe+0x68/0xdc
[ 2.256488] really_probe+0xbc/0x2c0
[ 2.260484] __driver_probe_device+0x78/0x120
[ 2.265355] driver_probe_device+0x3c/0x154
[ 2.270032] __driver_attach+0x90/0x1a0
[ 2.274315] bus_for_each_dev+0x7c/0xe0
[ 2.278602] driver_attach+0x24/0x30
[ 2.282599] bus_add_driver+0xe4/0x208
[ 2.286781] driver_register+0x68/0x130
[ 2.291065] __platform_driver_register+0x24/0x30
[ 2.296322] rk_iommu_driver_init+0x1c/0x28
[ 2.300997] do_one_initcall+0x60/0x1d4
[ 2.305283] kernel_init_freeable+0x210/0x274
[ 2.310153] kernel_init+0x20/0x140
[ 2.314051] ret_from_fork+0x10/0x20
[ 2.318048] Code: a90153f3 b1020020 f9001bf7 aa0103f4 (b9429ab7)
[ 2.324857] ---[ end trace 0000000000000000 ]---
[ 2.330029] Kernel panic - not syncing: Attempted to kill init!
exitcode=0x0000000b
[ 2.338587] SMP: stopping secondary CPUs
[ 2.342971] Kernel Offset: disabled
[ 2.346862] CPU features: 0x0c00,000000e0,01202650,8200720b
[ 2.353089] Memory Limit: none
[ 2.356499] ---[ end Kernel panic - not syncing: Attempted to kill
init! exitcode=0x0000000b ]---
"""
Therefore:
Tested-by: Quentin Schulz <quentin.schulz at cherry.de>
Thanks!
Quentin
More information about the linux-arm-kernel
mailing list