imx7: dev->coherent_dma_mask NULL warning

Fabio Estevam festevam at gmail.com
Tue Aug 17 17:23:26 PDT 2021


Hi,

Launching the hostapd application on an imx7d based board with an
ath10k Wifi chip leads to the following warning:

 ------------[ cut here ]------------
 WARNING: CPU: 0 PID: 489 at kernel/dma/mapping.c:427 dma_alloc_attrs+0xd0/0x114
 Modules linked in: ath10k_sdio ath10k_core ath
 CPU: 0 PID: 489 Comm: hostapd Not tainted 5.10.48-stable-standard #1
 Hardware name: Freescale i.MX7 Dual (Device Tree)
 [<c0111378>] (unwind_backtrace) from [<c010bc04>] (show_stack+0x10/0x14)
 [<c010bc04>] (show_stack) from [<c0e26094>] (dump_stack+0xdc/0x104)
 [<c0e26094>] (dump_stack) from [<c0125574>] (__warn+0xd8/0x114)
 [<c0125574>] (__warn) from [<c0e20ecc>] (warn_slowpath_fmt+0x60/0xbc)
 [<c0e20ecc>] (warn_slowpath_fmt) from [<c01b9eac>] (dma_alloc_attrs+0xd0/0x114)
 [<c01b9eac>] (dma_alloc_attrs) from [<bf01373c>]
(ath10k_add_interface+0x2f0/0x1094 [ath10k_core])
 [<bf01373c>] (ath10k_add_interface [ath10k_core]) from [<c0d94470>]
(drv_add_interface+0x88/0x2fc)
 [<c0d94470>] (drv_add_interface) from [<c0db6c58>]
(ieee80211_do_open+0x4c8/0xc70)
 [<c0db6c58>] (ieee80211_do_open) from [<c0b12b7c>] (__dev_open+0xf0/0x170)
 [<c0b12b7c>] (__dev_open) from [<c0b12f40>] (__dev_change_flags+0x164/0x1d0)
 [<c0b12f40>] (__dev_change_flags) from [<c0b12fc4>]
(dev_change_flags+0x18/0x48)
 [<c0b12fc4>] (dev_change_flags) from [<c0bcf968>] (devinet_ioctl+0x6d4/0x868)
 [<c0bcf968>] (devinet_ioctl) from [<c0bd2684>] (inet_ioctl+0x210/0x3b0)
 [<c0bd2684>] (inet_ioctl) from [<c0ae44d4>] (sock_ioctl+0x56c/0x718)
 [<c0ae44d4>] (sock_ioctl) from [<c02ccfb8>] (sys_ioctl+0xf0/0xbf0)
 [<c02ccfb8>] (sys_ioctl) from [<c0100080>] (ret_fast_syscall+0x0/0x28)
 Exception stack(0xc3293fa8 to 0xc3293ff0)
 3fa0:                   bea0190c 00000000 00000008 00008914 bea0190c 00001003
 3fc0: bea0190c 00000000 00000008 00000036 00eeef10 00eeedb8 00000000 000186a0
 3fe0: 0051dbcc bea018fc 004ba26d b6c49fb8
 irq event stamp: 145521
 hardirqs last  enabled at (145531): [<c01949f4>] console_unlock+0x434/0x654
 hardirqs last disabled at (145540): [<c01949ec>] console_unlock+0x42c/0x654
 softirqs last  enabled at (145472): [<c0101604>] __do_softirq+0x324/0x5c4
 softirqs last disabled at (145415): [<c012e1bc>] irq_exit+0x17c/0x1dc
 ---[ end trace 37715f05492d4493 ]---

which comes from:

void *dma_alloc_attrs(struct device *dev, size_t size, dma_addr_t *dma_handle,
....
WARN_ON_ONCE(!dev->coherent_dma_mask);

Where should the coherent_dma_mask be set to avoid this problem?

Thanks,

Fabio Estevam



More information about the ath10k mailing list