udmabuf: udmabuf of_reserved_mem_device failed
Hello,
I’m trying to set up a udmabuf on a memory device inside the PL side of a ZynqMP at address 0x4_0000_0000. I’m using the Petalinux kernel version 4.19.0-xilinx-v2019.1 with a Debian Stretch rootfs. I’m running into an issue though, of_reserved_mem_device_init is failing, returning -22. Here is the section of my device tree for the reserved memory region and udmabuf:
amba_pl@0 {
#address-cells = <0x2>;
#size-cells = <0x2>;
compatible = "simple-bus";
ranges;
reserved-memory {
#address-cells = <2>;
#size-cells = <2>;
ranges;
image_buf0: image_buf@0 {
compatible = "shared-dma-pool";
reusable;
reg = <0x4 0x0 0x0 0x400000>;
label = "image_buf0";
};
};
udmabuf@0 {
compatible = "ikwzm,udmabuf-0.10.a";
device-name = "udmabuf0";
size = <0x0 0x400000>;
memory-region = <&image_buf0>;
};
};
Here’s what happens when I try to load udmabuf:
rocky@zynq:~/repos/udmabuf$ sudo insmod udmabuf.ko
[ 1076.852053] udmabuf amba_pl@0:udmabuf@0: of_reserved_mem_device_init failed. return=-22
[ 1076.860210] udmabuf amba_pl@0:udmabuf@0: driver installed.
[ 1076.865730] udmabuf: probe of amba_pl@0:udmabuf@0 failed with error -22
I’ve attached the full kernel log as well. Can you help me find where it is going wrong?
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 22 (10 by maintainers)
I think this did it! I see this when I load the kernel module:
I see lots of cacheline fills to the memory on HPM0 on my ILA. I tested this on both kernel 4.19 and 5.4, both seemed to work correctly.
Thank you so much for your help. I couldn’t have gotten this working on my own.
https://github.com/ikwzm/udmabuf/issues/33
I posted there my working device tree.
You can look at that… I was struggling with similar problem. Check first your compatibility nose if you are using udmabuf or the other one u-dma-buf.
If I remember correctly I had the reserved memory node outside of the amba section, only the udma bug inside