-
Notifications
You must be signed in to change notification settings - Fork 482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kernel driver: drm_prime_sg_to_page_addr_arrays was removed in Linux 5.12 #5943
Comments
@rbramand-xilinx we need you again! |
Hello, I have the same error using Kernel 4.18.0-348.el8.x86_64 (Centos 8).
Best regards |
Until a proper fix / modernization is available, the following workaround works for kernel 5.13: XRT/src/runtime_src/core/pcie/driver/linux/xocl/userpf/xocl_bo.c Lines 1177 to 1178 in 34849b8
needs to be changed to ret = drm_prime_sg_to_page_array(sgt, importing_xobj->pages,
attach->dmabuf->size >> PAGE_SHIFT); @rogumag Your second error should have been fixed as part of #5867. I guess the check for Red Hat's backported kernel features was missed (ping @rbramand-xilinx). Try the following change: XRT/src/runtime_src/core/pcie/driver/linux/xocl/userpf/xocl_bo.c Lines 1259 to 1263 in 34849b8
to #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 11, 0)
vma->vm_ops = xobj->base.funcs->vm_ops;
#elif defined(RHEL_RELEASE_CODE)
# if RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(8,4)
vma->vm_ops = xobj->base.funcs->vm_ops;
# else
vma->vm_ops = xobj->base.dev->driver->gem_vm_ops;
# endif
#else
vma->vm_ops = xobj->base.dev->driver->gem_vm_ops;
#endif If you're not on CentOS 8.4 change the |
@j-stephan thanks for your continuous support. By the way, Xilinx is hiring... ;-) @sonals @stsoe |
After making the prescribed changes, I was still unable to compile the drivers on 4.18.0-348. I had to make an additional change to xocl_drm.c. XRT/src/runtime_src/core/pcie/driver/linux/xocl/userpf/xocl_drm.c Lines 511 to 525 in d807afc
I don't know exactly which kernel versions apply or when the source changed, but I essentially modified lines 511 and 519 to align w/ 5.11 by dropping the minimum version to 4,18,0
After that change, the drivers compiled successfully with only a few warnings which appear to be benign.
and
I'm pretty sure that's not the right way to change the source, but for my purposes it got the job done so if anyone else comes across this and just needs to compile hopefully this helps. |
@j-stephan can you make a PR so you are credited for it, at least for normal kernels like the ones found in Debian/Ubuntu? |
I'll try to submit one this (European) evening. Unless @rbramand-xilinx wants to do this first? |
@j-stephan thanks for making the changes, please go ahead and submit your PR. |
Thanks for the modification. I will try it. Best regards |
While debugging my installation recipe https://github.com/keryell/sycl/blob/vitis-2021.2/sycl/doc/GettingStartedXilinxFPGA.md, it looks like in current |
There is also #6092 which should improve the situation. |
What is the status of this? |
I believe this is fixed. Sorry don't remember PR number, but I think there were several. |
Great! |
In Linux 5.12 the function
drm_prime_sg_to_page_addr_arrays
was split into two parts (AFAIK with no previous deprecation warning):drm_prime_sg_to_page_array
- marked as deprecateddrm_prime_sg_to_dma_addr_array
- not deprecated, seems to be the suggested replacement for the above.This causes DKMS to fail on up-to-date Linux distributions, such as Ubuntu 21.10:
The text was updated successfully, but these errors were encountered: