Linux kernel can not alloc dma buffer

I user dma_alloc_wc to alloc buffer for framebuffer just like that:

info->screen_base = (char __iomem *)dma_alloc_wc(&(client->dev), info->fix.smem_len, &phy_addr, GFP_KERNEL);

but it is failed. :joy:

  • error information
rock@rock-3a:~/share$ dmesg | grep "dma"
[    0.000000] OF: reserved mem: initialized node rknpu, compatible id shared-dma-pool
[    0.496337] dma-pl330 fe530000.dmac: Loaded driver for PL330 DMAC-241330
[    0.496403] dma-pl330 fe530000.dmac:         DBUFF-128x8bytes Num_Chans-8 Num_Peri-32 Num_Events-16
[    0.499879] dma-pl330 fe550000.dmac: Loaded driver for PL330 DMAC-241330
[    0.499936] dma-pl330 fe550000.dmac:         DBUFF-128x8bytes Num_Chans-8 Num_Peri-32 Num_Events-16
[    6.412012] of_dma_request_slave_channel: dma-names property of node '/serial@fe650000' missing or empty
[   78.638768] WARNING: CPU: 3 PID: 1094 at ./include/linux/dma-mapping.h:580 ssd1306_i2c_probe+0x454/0x478 [drv_oled_ssd1306]
[   78.640247] dma alloc failure, device may be missing a call to arch_setup_dma_ops
[   78.640265] WARNING: CPU: 3 PID: 1094 at arch/arm64/mm/dma-mapping.c:490 __dummy_alloc+0x1c/0x2c
[  231.561153] WARNING: CPU: 2 PID: 2000 at ./include/linux/dma-mapping.h:580 ssd1306_i2c_probe+0x454/0x478 [drv_oled_ssd1306]
[  231.562558] dma alloc failure, device may be missing a call to arch_setup_dma_ops
[  231.562574] WARNING: CPU: 2 PID: 2000 at arch/arm64/mm/dma-mapping.c:490 __dummy_alloc+0x1c/0x2c

  • kernel version
rock@rock-3a:~/share$ uname -a
Linux rock-3a 4.19.193-44-rockchip-g5a07852a55cf #rockchip SMP Tue Jun 14 12:35:45 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux
  • kernel function
static void *__dummy_alloc(struct device *dev, size_t size,
			               dma_addr_t *dma_handle, gfp_t flags,
			               unsigned long attrs)
{
	WARN(1, "dma alloc failure, device may be missing a call to arch_setup_dma_ops");
	return NULL;
}
  • device tree