ARM_LPAE + VMSPLIT_2G cause swiotlb warning on Raspberry Pi 4

Robin Murphy robin.murphy at arm.com
Wed May 17 03:36:42 PDT 2023


On 2023-05-17 11:24, Stefan Wahren wrote:
> Hi Robin,
> 
> Am 17.05.23 um 12:06 schrieb Robin Murphy:
>> On 2023-05-17 07:23, Stefan Wahren wrote:
>>> Hi,
>>>
>>> Am 17.05.23 um 00:17 schrieb Florian Fainelli:
> 
> ...
> 
>>>
>>> [    1.419785] ------------[ cut here ]------------
>>> [    1.419811] WARNING: CPU: 2 PID: 1 at 
>>> include/linux/dma-direct.h:36 dma_map_page_attrs+0x360/0x368
>>> [    1.419862] Unable to xlate: 0x000000006ffd9000
>>
>> This suggests that the SWIOTLB buffer itself has somehow been 
>> allocated from ZONE_NORMAL rather than ZONE_DMA (unfortunately you 
>> trimmed the log line from swiotlb_print_info() saying exactly where it 
>> is). That can't happen with VMSPLIT_3G where we have less than 1GB of 
>> lowmem anyway, which explains that difference. I don't have an idea 
>> off-hand why LPAE would affect it.
> 
> This one?
> 
> [    0.000000] Dentry cache hash table entries: 262144 (order: 8, 
> 1048576 bytes, linear)
> [    0.000000] Inode-cache hash table entries: 131072 (order: 7, 524288 
> bytes, linear)
> [    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
> [    0.000000] software IO TLB: area num 4.
> [    0.000000] software IO TLB: mapped [mem 
> 0x0000000069e7f000-0x000000006de7f000] (64MB)

Yup, there you go - I may have slightly misinterpreted the stack trace, 
but the underlying symptom still stood out. SWIOTLB is unable to help 
because it can only bounce to somewhere that's still outside the DMA 
range map. From the initial log, your zones *do* look OK:

[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x0000000000000000-0x000000003fffefff]
[    0.000000]   Normal   [mem 0x000000003ffff000-0x000000006fffffff]
[    0.000000]   HighMem  [mem 0x0000000070000000-0x00000001ffffffff]

So apparently something's gone screwy in the area of the swiotlb_init() 
call.

Thanks,
Robin.

> [    0.000000] Memory: 3856044K/4050944K available (16384K kernel code, 
> 2481K rwdata, 6284K rodata, 2048K init, 430K bss, 129364K reserved, 
> 65536K cma-reserved, 2293760K highmem)
> [    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
> 
>>
>> Thanks,
>> Robin.
>>
>>> [    1.419879] Modules linked in:
>>> [    1.419902] CPU: 2 PID: 1 Comm: swapper/0 Not tainted 6.3.0-dirty #11
>>> [    1.419926] Hardware name: BCM2711
>>> [    1.419950]  unwind_backtrace from show_stack+0x10/0x14
>>> [    1.419990]  show_stack from dump_stack_lvl+0x40/0x4c
>>> [    1.420031]  dump_stack_lvl from __warn+0x7c/0x124
>>> [    1.420077]  __warn from warn_slowpath_fmt+0x118/0x174
>>> [    1.420122]  warn_slowpath_fmt from dma_map_page_attrs+0x360/0x368
>>> [    1.420169]  dma_map_page_attrs from bcm2835_dma_probe+0x1d8/0x41c
>>> [    1.420215]  bcm2835_dma_probe from platform_probe+0x5c/0xbc
>>> [    1.420262]  platform_probe from really_probe+0xc8/0x2dc
>>> [    1.420300]  really_probe from __driver_probe_device+0x84/0xe4
>>> [    1.420335]  __driver_probe_device from 
>>> driver_probe_device+0x30/0x104
>>> [    1.420369]  driver_probe_device from __driver_attach+0x90/0x174
>>> [    1.420403]  __driver_attach from bus_for_each_dev+0x6c/0xb4
>>> [    1.420435]  bus_for_each_dev from bus_add_driver+0xcc/0x1cc
>>> [    1.420465]  bus_add_driver from driver_register+0x7c/0x118
>>> [    1.420498]  driver_register from do_one_initcall+0x40/0x1e0
>>> [    1.420534]  do_one_initcall from kernel_init_freeable+0x1b8/0x220
>>> [    1.420578]  kernel_init_freeable from kernel_init+0x18/0x12c
>>> [    1.420627]  kernel_init from ret_from_fork+0x14/0x1c
>>> [    1.420662] Exception stack(0xf081dfb0 to 0xf081dff8)
>>> [    1.420684] dfa0:                                     00000000 
>>> 00000000 00000000 00000000
>>> [    1.420710] dfc0: 00000000 00000000 00000000 00000000 00000000 
>>> 00000000 00000000 00000000
>>> [    1.420734] dfe0: 00000000 00000000 00000000 00000000 00000013 
>>> 00000000
>>> [    1.420753] ---[ end trace 0000000000000000 ]---
>>> [    1.420771] ------------[ cut here ]------------
>>> [    1.420785] WARNING: CPU: 2 PID: 1 at 
>>> include/linux/dma-direct.h:36 swiotlb_map+0x1dc/0x3e4
>>> [    1.420829] Unable to xlate: 0x000000006ffd9000
>>> [    1.420844] Modules linked in:
>>> [    1.420863] CPU: 2 PID: 1 Comm: swapper/0 Tainted: G        W 
>>>   6.3.0-dirty #11
>>> [    1.420890] Hardware name: BCM2711
>>> [    1.420906]  unwind_backtrace from show_stack+0x10/0x14
>>> [    1.420942]  show_stack from dump_stack_lvl+0x40/0x4c
>>> [    1.420978]  dump_stack_lvl from __warn+0x7c/0x124
>>> [    1.421021]  __warn from warn_slowpath_fmt+0x118/0x174
>>> [    1.421066]  warn_slowpath_fmt from swiotlb_map+0x1dc/0x3e4
>>> [    1.421114]  swiotlb_map from dma_map_page_attrs+0x210/0x368
>>> [    1.421159]  dma_map_page_attrs from bcm2835_dma_probe+0x1d8/0x41c
>>> [    1.421201]  bcm2835_dma_probe from platform_probe+0x5c/0xbc
>>> [    1.421244]  platform_probe from really_probe+0xc8/0x2dc
>>> [    1.421281]  really_probe from __driver_probe_device+0x84/0xe4
>>> [    1.421314]  __driver_probe_device from 
>>> driver_probe_device+0x30/0x104
>>> [    1.421348]  driver_probe_device from __driver_attach+0x90/0x174
>>> [    1.421382]  __driver_attach from bus_for_each_dev+0x6c/0xb4
>>> [    1.421413]  bus_for_each_dev from bus_add_driver+0xcc/0x1cc
>>> [    1.421442]  bus_add_driver from driver_register+0x7c/0x118
>>> [    1.421475]  driver_register from do_one_initcall+0x40/0x1e0
>>> [    1.421509]  do_one_initcall from kernel_init_freeable+0x1b8/0x220
>>> [    1.421551]  kernel_init_freeable from kernel_init+0x18/0x12c
>>> [    1.421599]  kernel_init from ret_from_fork+0x14/0x1c
>>> [    1.421634] Exception stack(0xf081dfb0 to 0xf081dff8)
>>> [    1.421654] dfa0:                                     00000000 
>>> 00000000 00000000 00000000
>>> [    1.421679] dfc0: 00000000 00000000 00000000 00000000 00000000 
>>> 00000000 00000000 00000000
>>> [    1.421704] dfe0: 00000000 00000000 00000000 00000000 00000013 
>>> 00000000
>>> [    1.421722] ---[ end trace 0000000000000000 ]---
>>> [    1.421747] ------------[ cut here ]------------
>>>
>>>>
>>>> Thanks!
>>
>> _______________________________________________
>> linux-arm-kernel mailing list
>> linux-arm-kernel at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel



More information about the linux-arm-kernel mailing list