Broken Framework laptop drivers on 6.11 kernel

UPDATE:

The fix for this has landed on both unstable and stable! Please update your flake inputs. You can now use the 6.11 kernel with no issues.

Old information (from before the fix landed):

There’s currently a driver issue causing the latest kernel to fail to build on Framework laptops. This only affects you if all of the below applies to you:

  • You use the latest kernel, set via boot.kernelPackages = pkgs.linuxPackages_latest;.
  • You use a Framework laptop
  • You either use nixos-hardware for sourcing your Framework-laptop-specific configurations, or you use the framework-laptop-kmod drivers, set via boot.extraModulePackages = with config.boot.kernelPackages; [ framework-laptop-kmod ];

Upon updating your inputs (whether through channels or flakes) and rebuilding, you’ll see a build failure. This is due to the current Framework drivers on nixpkgs being incompatible with the new kernel. The great news is that the functionality of this driver has seemingly been added into the 6.11 kernel, largely superseding the need for this driver.

I’ll split the steps for solving this build failure into two sections: people that use nixos-hardware, and people who do Framework hardware configuration manually.

You don’t use nixos-hardware, and configure hardware features manually

Your life should be relatively easy! As the kernel now seems to support what the drivers do, you can just remove the line boot.extraModulePackages = with config.boot.kernelPackages; [ framework-laptop-kmod ]; from your configuration.

You use nixos-hardware

While the functionality of the drivers may have been superseded by kernel 6.11, nixos-hardware still includes the drivers. I plan on making a PR to remove these in the future.

A patch to the drivers to support 6.11 has been merged upstream to nixpkgs in both unstable and stable (24.05). The fix has landed in nixos-unstable, so if you use unstable, it’ll work properly. However, it’ll be a bit longer before stable gets this fix.

If you’re using nixos-hardware on stable, and want a temporary solution until the fix lands, you have several solutions. These include:

  • Overriding what nixos-hardware does so the drivers aren’t included: boot.extraModulePackages = lib.mkForce [];
  • Locking your kernel version to 6.10, like this: boot.kernelPackages = pkgs.linuxPackagesFor (pkgs.linuxKernel.kernels.linux_6_10);. This is what I’m currently doing, and it’s working great for me.
9 Likes

Are these drivers still needed with the updated ChromeOS EC support in 6.11? https://www.phoronix.com/news/Linux-6.11-Feature-Recap

Interesting: maybe. On my laptop (Framework 13 AMD 7640u), it appears that 6.11 accomplishes at least some of what the drivers were already doing.

Here are the four categories, and what they result in:

  • 6.10 without the patch → No, The keyboard button does not appear in the Gnome control center
  • 6.10 with the patch → Yes, the option to change the keyboard brighness appears in the gnome control center
  • 6.11 without the path → Yes, the option to change the keyboard brighness appears in the gnome control center
  • 6.11 with the patch → unable to build

However, I’m hesitant to say for certain that everything the patch does is now integrated into the kernel. That’d be a question for the maintainer of the kernel module here. I know that nixos-hardware has the kernel module integrated into all of its framework machines, not just the AMD ones, so it could be that 6.11 only fixes this for AMD machines. If anyone with an Intel Framework could attempt to replicate, I’d appreciate it.

Also, something I just figured out: using framework_tool as a way to debug this won’t work. framework_tool relies on some of its commands to be called via sudo, and the kernel module is all about making these available to userspace (non-sudo users). I don’t know of the best way to test this on something that isn’t Gnome.

Note that the author of the framework-laptop-kmod driver recently closed the upstreaming issue mentioning that driver wasn’t useful anymore since kblight, hwmon and charge control are now in the kernel.

Ref: Commit upstream? · Issue #8 · DHowett/framework-laptop-kmod · GitHub

Great to know: I edited the post to reflect this. I can make a PR to nixos-hardware suggesting they remove the use of the kmod tool.

I assume that only once this PR has been implemented can we begin to use the 6.11 kernel. Can you let us know through this thread when that happens?

Yes, I’ve been checking regularly to see when the PRs land, and will update when they do.

If you want something temporary, you could always just not use the kmod drivers for now like I said in the post (recently edited), since much of their functionality has been upstreamed into the latest kernel version. I expect it’ll only be another day or two before the PR lands, though.

1 Like

Update: the fix has landed on both unstable and stable! Things should now just work. I’m updating the post to reflect this.

3 Likes

I just updated and can confirm. Running kernel 6.11.0 just fine.

2 Likes