Skip to content

Fix build on Kernel v. 6.12#86

Open
mfrischknecht wants to merge 2 commits intognif:masterfrom
mfrischknecht:correct-unaligned-include
Open

Fix build on Kernel v. 6.12#86
mfrischknecht wants to merge 2 commits intognif:masterfrom
mfrischknecht:correct-unaligned-include

Conversation

@mfrischknecht
Copy link
Copy Markdown

asm/unaligned.h has been moved to linux/unaligned.h since Linux v. 6.12 1, which breaks the build of vendor-reset e.g. on NixOS unstable (and likely other distributions, as soon as those switch to 6.12, too).

On my system, the build fails with this error:

/build/source/src/amd/amdgpu/atom.c:32:10: fatal error: asm/unaligned.h: No such file or directory
   32 | #include <asm/unaligned.h>
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
make[3]: *** [/nix/store/lacdcr5zi7w59f8xsq4cfi41mzgc6dcn-linux-6.12-dev/lib/modules/6.12.0/source/scripts/Makefile.build:229: /build/source/src/amd/amdgpu/atom.o] Error 1

Footnotes

  1. https://github.com/torvalds/linux/commit/5f60d5f6bbc12e782fac78110b0ee62698f3b576

`asm/unaligned.h` has been moved to `linux/unaligned.h` since Linux v. 6.12.
C.f. e.g. torvalds/linux@5f60d5f
@VoodaGod
Copy link
Copy Markdown

VoodaGod commented Nov 27, 2024

unfortunately this breaks the build on previous kernels, should try to make this change conditional like this:

#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0)

…so the module builds for both kernels below 6.12 and above. Thanks, @VoodaGod!

Co-authored-by: Jason Rensburger <l33tjas.0n@gmail.com>
@mfrischknecht
Copy link
Copy Markdown
Author

@VoodaGod I'm currently out of town, so I've just applied you suggestion through the GitHub mobile interface. I hope that's okay like this. Thanks!

Note: I havent tested this myself yet. I should be able to until friday.

@mfrischknecht
Copy link
Copy Markdown
Author

For completeness' sake: I've also tested building the module with some older Kernels through my NixOS config and had no issues.

I didn't switch to these Kernels and test the functionality, but as there haven't been many logic related changes in the recent past (and I've used the module through multiple of these older Kernel versions myself), I don't anticipate any problems in that regard.

mfrischknecht added a commit to mfrischknecht/nixpkgs that referenced this pull request Dec 22, 2024
`asm/unaligned.h` has been moved to `linux/unaligned.h` since
Linux v. 6.12 [^1]. This has broken the build for `vendor-reset`
on newer versions.

I've opened a PR with the upstream project [^2], but that has been
sitting unmerged on GitHub for a while now, so I decided to add the
fix temporarily using `fetchpatch` in the NixOS module for now.
When it will (hopefully) eventually be merged, we should be able to
remove the patch and just switch to an up-to-date upstream version.

[^1]: torvalds/linux@5f60d5f
[^2]: gnif/vendor-reset#86
alyssais pushed a commit to NixOS/nixpkgs that referenced this pull request Dec 23, 2024
`asm/unaligned.h` has been moved to `linux/unaligned.h` since
Linux v. 6.12 [^1]. This has broken the build for `vendor-reset`
on newer versions.

I've opened a PR with the upstream project [^2], but that has been
sitting unmerged on GitHub for a while now, so I decided to add the
fix temporarily using `fetchpatch` in the NixOS module for now.
When it will (hopefully) eventually be merged, we should be able to
remove the patch and just switch to an up-to-date upstream version.

[^1]: torvalds/linux@5f60d5f
[^2]: gnif/vendor-reset#86
@kutukvpavel
Copy link
Copy Markdown

Kernel 6.12 made it into Debian Stable backports. Had to manually edit the DKMS source for now, can confirm this PR fixes the issue and works for both >=6.12 and <=6.11 kernels.
@gnif Can you merge this, please?

@marcusball
Copy link
Copy Markdown

If anyone needs this fix on Arch using the AUR package, I was able to manually add it by updating the pkgbuild file. I started the reinstall using yay --editmenu -S vendor-reset-dkms-git, then entering the editor when prompted, and adding the prepare function to the build, which downloads and applies patches for the two commits in this PR.

prepare() { 
    cd "$srcdir/$_pkgbase" 
     
    wget "https://github.com/gnif/vendor-reset/commit/ab1b34848097587aca1f248958358ddb1dc90917.diff" 
    wget "https://github.com/gnif/vendor-reset/commit/54ffd6a012e7567b0288bc5fcc3678b545bd5aec.diff" 

    patch -p1 < "ab1b34848097587aca1f248958358ddb1dc90917.diff" 
    patch -p1 < "54ffd6a012e7567b0288bc5fcc3678b545bd5aec.diff" 
} 

@ipaqmaster
Copy link
Copy Markdown

ipaqmaster commented Jul 20, 2025

Will a fix be added for >=6.12 builds at some stage? This one is a red mark on the build server.
(Without having to edit the build script first)

@fcaronte
Copy link
Copy Markdown

fcaronte commented Aug 10, 2025

I succefully install this version on Proxmox 9 and seem to work correctly

Edit
At the end I discovered that vendor-reset never work on my apu Ryzen 5626U.
My system was working using vfio and stop to work after the update to 6.14 Kernel versions so I must downgrade to 6.8. I don't know if and how to make this to work with my apu. I try to use AI to help but without success

@ZEGEIZI
Copy link
Copy Markdown

ZEGEIZI commented Sep 27, 2025

I succefully install this version on Proxmox 9 and seem to work correctly

Edit At the end I discovered that vendor-reset never work on my apu Ryzen 5626U. My system was working using vfio and stop to work after the update to 6.14 Kernel versions so I must downgrade to 6.8. I don't know if and how to make this to work with my apu. I try to use AI to help but without success

I also encountered such a problem

@fcaronte
Copy link
Copy Markdown

Actually for me a resolve installing again the 6.8 kernel and set as default, practically as I understand vfio on 6.8 wasn't work for my integrated apu and this is way can be shutdown and wake more time without problems on windows or Linux VM without use vendor-reset, on new kernel instead vfio was able to do the reset but not correctly and so after one working launch the next one is working with glitches UI on the TV screen, when using RDP is okay and GPU is connected correctly, so it has some dirty status after reset and I can't find a way to say to vfio to do nothing after VM wake or shutdown to can try if work as the same as the 6.8 kernel version

I succefully install this version on Proxmox 9 and seem to work correctly

Edit At the end I discovered that vendor-reset never work on my apu Ryzen 5626U. My system was working using vfio and stop to work after the update to 6.14 Kernel versions so I must downgrade to 6.8. I don't know if and how to make this to work with my apu. I try to use AI to help but without success

I also encountered such a problem

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.

7 participants