-
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
Open
jwrdegoede
wants to merge
1
commit into
intel:master
Choose a base branch
from
jwrdegoede:ipu6-kernel-6.10-fixes
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe 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:
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; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 withoutstatic
but implemented asstatic
.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.