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

Fix version checks for 4.7.x kernels #34

Closed
wants to merge 1 commit into from
Closed

Fix version checks for 4.7.x kernels #34

wants to merge 1 commit into from

Conversation

RobertCochran
Copy link

Checking for "4.6.0 or less" when trying to determine when to use 4.7.x
series features does the wrong thing when running a 4.6 kernel when it
isn't the first release; a version of 4.6.4 will cause the selection of
4.7.x features, which will proceed to fail to build because the kernel
is a 4.6.x series. Fix the condition so that the right thing happens
with later 4.6.x series kernels.

Checking for "4.6.0 or less" when trying to determine when to use 4.7.x
series features does the wrong thing when running a 4.6 kernel when it
isn't the first release; a version of 4.6.4 will cause the selection of
4.7.x features, which will proceed to fail to build because the kernel
is a 4.6.x series. Fix the condition so that the right thing happens
with later 4.6.x series kernels.
@RobertCochran
Copy link
Author

I checked over the error - it has nothing to do with what I changed.
It appears a DRM interface has changed in the kernel master tree.

@carbinefreak
Copy link

The fix is actually in the devel branch. A few of us have working builds off of it look at the issue linked.

#32

@RobertCochran
Copy link
Author

There's no way that could be true.

The last commit was a nearly a month ago, a good two weeks (at least) before I
fetched my copy of the repository.

Maybe I didn't make myself clear: this patch fixes building on 4.6.x series
kernels that aren't 4.6.0. The way the check was written -
KERNEL_VERSION(4, 6, 0) >= LINUX_VERSION_CODE - breaks when you're using a
kernel like 4.6.4 (as I am): 4.6.0 isn't >= 4.6.4, so it chooses the 4.7.x
codepath. Except that won't work here, because 4.6.4 isn't a 4.7.x series
kernel.

What I changed was that instead of checking for
KERNEL_VERSION(4, 6, 0) >= LINUX_VERSION_CODE, I instead check for
KERNEL_VERSION(4, 7, 0) > LINUX_VERSION_CODE, which does the Right Thing in
both cases: 4.7.x series kernels use the new codepath, anything older uses the
old codepath.

@carbinefreak
Copy link

But it is! this is built off of the devel branch in 4.7.0

spectre-gentoo carbinefreak # lsmod
Module Size Used by
vboxnetflt 16292 0
vboxnetadp 18502 0
vboxdrv 356365 2 vboxnetadp,vboxnetflt
evdi 32347 2
x86_pkg_temp_thermal 5303 0
efivarfs 5351 1
spectre-gentoo carbinefreak # uname -r
4.7.0
spectre-gentoo carbinefreak # xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x48 cap: 0xb, Source Output, Sink Output, Sink Offload crtcs: 4 outputs: 5 associated providers: 1 name:Intel
Provider 1: id: 0x128 cap: 0x2, Sink Output crtcs: 1 outputs: 1 associated providers: 1 name:modesetting
spectre-gentoo carbinefreak #

@RobertCochran
Copy link
Author

spectre-gentoo carbinefreak # uname -r
4.7.0

You are not listening closely enough. This patch has nothing to do with
building on 4.7.x. This patch has to do with selecting the proper codepath on
4.6.x series kernels that aren't 4.6.0. If you build on a 4.6.x kernel that is
not
4.6.0, then the condition fails (because 4.6.0 is not >= 4.6.4, my
version) and selects the 4.7.x codepath. But this is wrong, because 4.6.4 is
not a 4.7.x series, it's a 4.6.x series. My patch fixes the condition to do the
correct thing for all 4.6.x series releases. Again, this has nothing to do
with building on 4.7.x. That is not what this patch is about.

@displaylink-mlukaszek
Copy link
Contributor

Thanks for the PR, we've included the fix as part of 7974979, but with slightly changed code formatting.

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