-
Notifications
You must be signed in to change notification settings - Fork 478
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
Build xrt drivers on Linux 6.12-rc3 #8555
Open
dima-anet
wants to merge
4
commits into
Xilinx:master
Choose a base branch
from
dima-anet:linux-6.12
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
Conversation
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
Addresses the following compilation errors: > XRT-202310.2.15.225/build/Release/usr/src/xrt-2.15.0/driver/xocl//../include/xrt_cu.h:416:1: warning: 'inline' is not at beginning of declaration [-Wold-style-declaration] > 416 | static void inline xrt_cu_enable_intr(struct xrt_cu *xcu, u32 intr_type) > | ^~~~~~ > XRT-202310.2.15.225/build/Release/usr/src/xrt-2.15.0/driver/xocl//../include/xrt_cu.h:422:1: warning: 'inline' is not at beginning of declaration [-Wold-style-declaration] > 422 | static void inline xrt_cu_disable_intr(struct xrt_cu *xcu, u32 intr_type) > | ^~~~~~ > XRT-202310.2.15.225/build/Release/usr/src/xrt-2.15.0/driver/xocl//../include/xrt_cu.h:428:1: warning: 'inline' is not at beginning of declaration [-Wold-style-declaration] > 428 | static u32 inline xrt_cu_clear_intr(struct xrt_cu *xcu) > | ^~~~~~ > In file included from XRT-202310.2.15.225/build/Release/usr/src/xrt-2.15.0/driver/xocl/userpf/../xocl_subdev.c:20: > XRT-202310.2.15.225/build/Release/usr/src/xrt-2.15.0/driver/xocl/userpf/../xocl_drv.h: In function 'xocl_subdev_priv_alloc': > XRT-202310.2.15.225/build/Release/usr/src/xrt-2.15.0/driver/xocl/userpf/../xocl_drv.h:456:16: error: implicit declaration of function 'vzalloc'; did you mean 'kzalloc'? [-Werror=implicit-function-declaration] > 456 | priv = vzalloc(sizeof(*priv) + size); > | ^~~~~~~ > | kzalloc > XRT-202310.2.15.225/build/Release/usr/src/xrt-2.15.0/driver/xocl/userpf/../xocl_subdev.c:272:17: error: implicit declaration of function 'vfree'; did you mean 'kvfree'? [-Werror=implicit-function-declaration] > 272 | vfree(subdev_info); > | ^~~~~ > | kvfree > XRT-202310.2.15.225/build/Release/usr/src/xrt-2.15.0/driver/xocl/userpf/../xocl_subdev.c: In function 'xocl_request_firmware': > XRT-202310.2.15.225/build/Release/usr/src/xrt-2.15.0/driver/xocl/userpf/../xocl_subdev.c:2208:16: error: implicit declaration of function 'vmalloc'; di > mean 'kmalloc'? [-Werror=implicit-function-declaration] > 2208 | *buf = vmalloc(fw->size); > | ^~~~~~~ > | kmalloc > XRT-202310.2.15.225/build/Release/usr/src/xrt-2.15.0/driver/xocl/userpf/../xocl_debug.c:148:19: error: 'no_llseek' undeclared here (not in a function); did you mean 'noop_llseek'? > 148 | .llseek = no_llseek, > | ^~~~~~~~~ > | noop_llseek Signed-off-by: Dmitry Safonov <[email protected]>
See the upstream linux commit 0edb555a65d1 ("platform: Make platform_driver::remove() return void"). Generated with the following Coccinelle script: > @rule_remove@ > identifier D; > identifier func; > @@ > static struct platform_driver D = { > ..., > .remove = func, > ... > }; > @rule_func depends on rule_remove@ > identifier pdev; > identifier rule_remove.func; > fresh identifier Fn = "__" ## func; > @@ > static int > - func(struct platform_device *pdev) > + Fn(struct platform_device *pdev) > { > ... > } > + > + #if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 11, 0) > + void func(struct platform_device *pdev) > + { > + Fn(pdev); > + } > + #else > + #define func Fn > + #endif Though, it added new function with a brace on the same line, so I ran checkpath.pl --fix on the resulting patch. And then it seems there is either bug in spatch or it doesn't know how to deal with 'static', which prevented me from adding 'static void func(...)', so on top of checkpatch.pl, I ran > sed 's/^+\(void [[:print:]]\+_remove(struct platform_device \*pdev)\)$/+static \1/' And yet the last bit is also manual: I had to remove a stray semicolon, that was living after ps_remove() last curly brace, which post-spatch became '#endif;' and the compiler didn't quite liked it. Signed-off-by: Dmitry Safonov <[email protected]>
The driver doesn't have to declare I2C_CLASS_SPD support as it supports I2C_CLASS_HWMON, see linux commit 9fd12f385720 ("i2c: Don't let i2c adapters declare I2C_CLASS_SPD support if they support I2C_CLASS_HWMON"). Signed-off-by: Dmitry Safonov <[email protected]>
In linux v6.10 https://git.kernel.org/linus/1788cf6a91d9 switched tty port's from circ_buf to kfifo. Signed-off-by: Dmitry Safonov <[email protected]>
dima-anet - is not a collaborator |
Can one of the admins verify this patch? |
Also just to note: I fixed only build-errors, but there are also quite some warnings. Mostly about inline declarations and missed static keywords or extern declarations. |
houlz0507
approved these changes
Oct 22, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem solved by the commit
xrt doesn't build on linux kernels newer than v6.10
How problem was solved, alternative solutions (if any) and why they were rejected
Add more ifdefs, one patch generated with Сoccinelle.
What has been tested and how, request additional testing if necessary
So far, I only build tested on v6.12-rc3.
And local sources yet use 2023.1 release, so it might not fix all build issues (though, the biggest diff I generated on the latest master).
Risks (if any) associated the changes in the commit
For older kernels this should be no-op as guarded by ifdefs.