Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jwrdegoede
Copy link
Contributor

Fix compilation with kernels >= 6.10.

Cc: @vicamo @smallorange (FYI)

Fix compilation with kernels >= 6.10.

Signed-off-by: Hans de Goede <[email protected]>
@@ -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)
Copy link
Contributor

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.

Copy link
Contributor Author

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)
Copy link
Contributor

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.

@vicamo
Copy link
Contributor

vicamo commented Oct 11, 2024

follow_pte is removed in v6.12-rc1, too. A revised revision is available in Ubuntu's experimental-dkms PPA.

@kupietz
Copy link

kupietz commented Oct 13, 2024

follow_pte is removed in v6.12-rc1, too. A revised revision is available in Ubuntu's experimental-dkms PPA.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants