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
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions drivers/media/pci/intel/ipu-mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <linux/iova.h>
#include <linux/module.h>
#include <linux/sizes.h>
#include <linux/vmalloc.h>

#include "ipu.h"
#include "ipu-platform.h"
Expand Down
16 changes: 16 additions & 0 deletions drivers/media/pci/intel/ipu-psys.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.

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.

{
spinlock_t *ptl;
pte_t *ptep;

if (follow_pte(vma, address, &ptep, &ptl))
return -EINVAL;

*pfn = pte_pfn(ptep_get(ptep));
pte_unmap_unlock(ptep, ptl);
return 0;
}
#endif

static int ipu_psys_get_userpages(struct ipu_dma_buf_attach *attach)
{
struct vm_area_struct *vma;
Expand Down
1 change: 1 addition & 0 deletions drivers/media/pci/intel/ipu.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <linux/timer.h>
#include <linux/sched.h>
#include <linux/version.h>
#include <linux/vmalloc.h>

#include "ipu.h"
#include "ipu-buttress.h"
Expand Down