-
Notifications
You must be signed in to change notification settings - Fork 490
Port kernel driver to Linux 6.8 #8005
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
Conversation
keryell - is not a collaborator |
/build |
48e0c48
to
e28bed8
Compare
keryell - is not a collaborator |
I have signed-off the commits now. |
if (page_sz > (PAGE_SIZE << (MAX_ORDER-1))) { | ||
DRM_WARN("Unable to allocate with page size 0x%llx", page_sz); | ||
#endif | ||
DRM_WARN("Unable to allocate with page size 0x%llx", page_sz); |
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.
indent?
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.
Good catch.
Otherwise my question I put in the comment is whether this should not be just MAX_PAGE_ORDER
and MAX_ORDER
here instead of (MAX_PAGE_ORDER-1)
and (MAX_ORDER-1)
.
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.
Oh. Thanks for mention this. NR_PAGE_ORDERS should be used instead of MAX_PAGE_ORDER.
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.
Not exactly. I put some links to some discussion in each commit message for reference.
So, after rereading the literature and some changes like https://lwn.net/ml/linux-kernel/[email protected]/
I think the XRT code was not pessimistic about the allocation (and at least avoided the floppy-disk bughttps://lwn.net/ml/linux-mm/[email protected]/ ;-) )
So now the modern way to write it is just
if (page_sz > (PAGE_SIZE << MAX_ORDER_NR_PAGES)) {
by using definitions from https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/include/linux/mmzone.h?id=e8f897f4afef0031fe618a8e94127a0934896aba#n34
But actually this seems like the definitive answer that has been in use for quite some Linux releases, as it it is in 5.4 and 4.18 on my laptop.
e28bed8
to
ff1a437
Compare
I do not know if removing |
It should not be unconditionally removed. Maybe just add a Macro like |
Yes I can do that. |
This follows kernel commit 3652117f854819a148ff0fbe4492587d3520b5e5 https://lore.kernel.org/all/[email protected]/ Signed-off-by: Ronan Keryell <[email protected]>
Interestingly, the newer strscpy() matches exactly the return behavior of get_vendor_firmware_dir() API. strlcpy() has been removed in Linux 6.8 by commit d26270061ae66b915138af7cd73ca6f8b85e6b44. For the context: https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy KSPP/linux#89 Signed-off-by: Ronan Keryell <[email protected]>
ff1a437
to
002e8ba
Compare
This is not clear why the test on |
XOAH shows ERROR: Not enough host mem. Please check grub settings.: Cannot allocate memory on |
MAX_ORDER was replaced partially with MAX_PAGE_ORDER starting with Linux 6.8 anyway. Cf Linux commits fd37721803c6e73619108f76ad2e12a9aa5fafaf and 5e0a760b44417f7cadd79de2204d6247109558a0 https://lwn.net/Articles/956321/ https://lwn.net/ml/linux-kernel/[email protected]/ https://lwn.net/ml/linux-kernel/[email protected]/ Signed-off-by: Ronan Keryell <[email protected]>
This was removed in Linux with commit 2798ffcc1d6a788b5769b1fbcf0750dfc06ae98a https://lwn.net/Articles/952344/ https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Ronan Keryell <[email protected]>
002e8ba
to
72b6a9b
Compare
OK, the problem was that in |
This PR is not supposed to be squashed as its commits and their messages are independent. |
So, what is the problem on this PR? |
@stsoe Thanks! |
To be rebased on
main
once #8003 has landed.I think the code would benefit from some review by DRM experts because I have 0 expertise. @superm1 @airlied
This is to have https://github.com/amd/xdna-driver working along
amd/xdna-driver#3