提交 cdbec504 编写于 作者: Z Zihao Yu

riscv: fix issue of no DMA buffer for eth

* By default, dev.coherent_dma_mask is DMA_BIT_MASK(32) for all devices.
  But when we put the kernel over 4GB physical memory, devices can not
  get DMA buffer with this default mask. Setting this mask to
  DMA_BIT_MASK(64) can fix this issue. Note that by default
  arch_setup_pdev_archdata() is defined as a weak function.
上级 63eef6e8
......@@ -3,3 +3,4 @@ obj-y += fault.o
obj-y += extable.o
obj-y += ioremap.o
obj-y += cacheflush.o
obj-y += dma.o
#include <linux/dma-mapping.h>
#include <linux/platform_device.h>
void arch_setup_pdev_archdata(struct platform_device *pdev)
{
if (pdev->dev.coherent_dma_mask == DMA_MASK_NONE &&
pdev->dev.dma_mask == NULL) {
pdev->dev.coherent_dma_mask = DMA_BIT_MASK(64);
pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册