udmabuf icon indicating copy to clipboard operation
udmabuf copied to clipboard

The reserved space is used to expand the CMA space, and the u-dma-buf driver cannot be used normally

Open Noah-naihe opened this issue 2 years ago • 5 comments

I'm sorry, I have one more question here; Here I refer to xilinx's cma space extension for a link:https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18841683/Linux+Reserved+Memory#LinuxReservedMemory-ReservedmemoryforCMA The cma space was also successfully created. image Using this udmabuf driver before, it is normal to open up space for multiple Cmas. However, after expanding the cma space, it can not be used normally image

device tree: reserved-memory { #address-cells = <2>; #size-cells = <2>; ranges;

  		reserved: buffer@0 {
     		compatible = "shared-dma-pool";
     		reusable;
     		reg = <0x00000008 0x00000000 0x0 0x80000000>;
     		linux,cma-default;
  		};
};

Noah-naihe avatar Oct 28 '22 07:10 Noah-naihe

I refer to what you said, add the following device tree node in the device tree, but found that the compiler does not pass. I am using kernel 5.4.0, what is the impact of this image

Noah-naihe avatar Oct 28 '22 08:10 Noah-naihe

Thank you for the issue.

The first half of the problem may be cured by specifying the dma-mask property. See this issue #45 for details.

Please tell me what kind of error occurred in the latter half of the problem.

ikwzm avatar Oct 28 '22 10:10 ikwzm

I use 16G DDR. According to xilinx system memory allocation, it is 2+14GB allocation, among which 2G is in 0x0-0x80000000 and the other 14GB is in 0x8 00000000. However, in the device tree, the CMA sets the start address at 0x8 00000000 and the length is 2GB, but the physical address is still 2GB ahead. image Allocating 100MB of space also fails The 100MB space cannot be allocated successfully. The previous 1MB space can be allocated. So it's not the number of digits in the system. image

Noah-naihe avatar Oct 31 '22 02:10 Noah-naihe

u-dma-buf-mgr allocates memory from the default CMA. As far as this log is concerned, the default CMA area seems to be below 0x80000000 (2GBi). What are your CMA area settings?

ikwzm avatar Oct 31 '22 10:10 ikwzm

1GiB worked for me I allocated 1250MB of CMA and had the reusable flag removed.

noelpedro avatar May 05 '23 02:05 noelpedro