-
Notifications
You must be signed in to change notification settings - Fork 53
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
media: ipu6: Fix compilation with kernels >= 6.10 #242
base: master
Are you sure you want to change the base?
Conversation
Fix compilation with kernels >= 6.10. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
@@ -128,6 +128,22 @@ ipu_psys_lookup_kbuffer_by_kaddr(struct ipu_psys_fh *fh, void *kaddr) | |||
return NULL; | |||
} | |||
|
|||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 10, 0) | |||
/* Dropped from 6.10, use our own copy for now */ | |||
static int follow_pfn(struct vm_area_struct *vma, unsigned long address, unsigned long *pfn) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think usually it's preferred to use the new API call and fix backward compatibility. While hopefully there won't too many revisions left for IPU6 out-of-tree driver, I think either way works and of course the decision goes to Intel developers.
This fails the build against v6.10-rc1..v6.10-rc3 because follow_pfn
is only removed after v6.10-rc4 by the way. Declared without static
but implemented as static
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no new API, follow_pfn() is removed and there is no replacement. follow_pte() has existed all along.
As for not building against 6.10-rc1 - 6.10-rc3 I did not realize that, but there is no way to check for the RC level and AFAIK we only care about building against the actual final .0 release and not against RC releases.
@@ -128,6 +128,22 @@ ipu_psys_lookup_kbuffer_by_kaddr(struct ipu_psys_fh *fh, void *kaddr) | |||
return NULL; | |||
} | |||
|
|||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 10, 0) | |||
/* Dropped from 6.10, use our own copy for now */ | |||
static int follow_pfn(struct vm_area_struct *vma, unsigned long address, unsigned long *pfn) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While nvidia driver depends on this as well, Ubuntu kernel decided to revert that commit. Therefore we will add a line before the owning copy:
#define follow_pfn backport__follow_pfn
This pull request will be integrated into Ubuntu's next ipu6-drivers dkms update.
|
Thanks! The Ubuntu source works also fine on Fedora 40 with mainline kernel 6.12-rc2 and brings back my ov2740 camera on ThinkPad X1 Carbon Gen 11. |
Fix compilation with kernels >= 6.10.
Cc: @vicamo @smallorange (FYI)