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

Driver is Incompatible with Kernel 5.18 #7

Closed
FedX-sudo opened this issue May 31, 2022 · 6 comments
Closed

Driver is Incompatible with Kernel 5.18 #7

FedX-sudo opened this issue May 31, 2022 · 6 comments

Comments

@FedX-sudo
Copy link

Distribution (run cat /etc/os-release):

BUG_REPORT_URL="https://github.com/NixOS/nixpkgs/issues"
BUILD_ID="22.11pre381914.f1c167688a6"
DOCUMENTATION_URL="https://nixos.org/learn.html"
HOME_URL="https://nixos.org/"
ID=nixos
LOGO="nix-snowflake"
NAME=NixOS
PRETTY_NAME="NixOS 22.11 (Raccoon)"
SUPPORT_URL="https://nixos.org/community.html"
VERSION="22.11 (Raccoon)"
VERSION_CODENAME=raccoon
VERSION_ID="22.11"

Issue/Bug Description:
After attempting to Linux 5.18 (persists between mainline and Zen Kernel), the recompile returns the following error:

In file included from /build/source/system76-io.c:39:
/build/source/system76-io_hwmon.c: In function 'io_fan_input_show':
/build/source/system76-io_hwmon.c:46:5: error: ISO C90 forbids mixed declarations and code [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wdeclaration-after-statement-Werror=declaration-after-statement8;;]
   46 |     const char * name = io_fan_name(to_sensor_dev_attr(attr)->index);
      |     ^~~~~
/build/source/system76-io_hwmon.c: In function 'io_pwm_show':
/build/source/system76-io_hwmon.c:82:5: error: ISO C90 forbids mixed declarations and code [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wdeclaration-after-statement-Werror=declaration-after-statement8;;]
   82 |     const char * name = io_fan_name(to_sensor_dev_attr(attr)->index);
      |     ^~~~~
/build/source/system76-io_hwmon.c: In function 'io_pwm_set':
/build/source/system76-io_hwmon.c:105:5: error: ISO C90 forbids mixed declarations and code [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wdeclaration-after-statement-Werror=declaration-after-statement8;;]
  105 |     const char * name = io_fan_name(to_sensor_dev_attr(attr)->index);
      |     ^~~~~
checking whether we are cross compiling... no
checking whether the compiler supports GNU C... yes
In file included from /build/source/system76-io.c:38:
At top level:
/build/source/system76-io_dev.c:272:12: error: 'io_dev_suspend' defined but not used [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-function-Werror=unused-function8;;]
  272 | static int io_dev_suspend(struct io_dev * io_dev, u16 * value, int timeout) {
      |            ^~~~~~~~~~~~~~
checking for suffix of object files... o
checking whether gcc accepts -g... yes
checking whether the compiler supports GNU C... yes
checking whether gcc accepts -g... yes
checking for gcc option to enable C11 features... none needed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... none
checking for gcc option to enable C11 features... none needed
cc1: all warnings being treated as errors
make[2]: *** [/nix/store/gkf4nhq306r54y7f9mfinmlpjppn04wc-linux-5.18-dev/lib/modules/5.18.0/source/scripts/Makefile.build:288: /build/source/system76-io.o] Error 1
make[1]: *** [/nix/store/gkf4nhq306r54y7f9mfinmlpjppn04wc-linux-5.18-dev/lib/modules/5.18.0/source/Makefile:1834: /build/source] Error 2
make[1]: Leaving directory '/nix/store/gkf4nhq306r54y7f9mfinmlpjppn04wc-linux-5.18-dev/lib/modules/5.18.0/build'
make: *** [Makefile:5: all] Error 2
error: builder for '/nix/store/fz7chwllww0pq8l7lj001y6d4cq5p216-system76-io-module-1.0.1-5.18.drv' failed with exit code 2
error: 1 dependencies of derivation '/nix/store/zka7zn1b7q2ssjamhwqivcp76i0fz1qg-hwdb.bin.drv' failed to build
error (ignored): error: cannot unlink '/tmp/nix-build-cockpit-270.drv-1/source': Directory not empty
error: 1 dependencies of derivation '/nix/store/rfrxxcq4szy51p97zhky9yajis5gjqs6-kernel-modules.drv' failed to build
error: 1 dependencies of derivation '/nix/store/h3gb9vx3v163lg6qic5cfzzhlaa61dgd-linux-5.18-modules.drv' failed to build
error: 1 dependencies of derivation '/nix/store/1sdqc8xxf3sxmk3925rb36mvpi7xai4r-unit-systemd-udevd.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/jxrcqfwls9bnhadrw3d7m6297kc8f69b-nixos-system-SBOS_Galp5-22.11pre381914.f1c167688a6.drv' failed to build

Unless I am gravley mistaken, this means the Io driver is incompatible with kernel 5.18.

Steps to reproduce (if you know):

  • Install NixOS
  • Switch to Nixpkgs Unstable for latest kernel
  • Set boot.kernelPackages = pkgs.linuxPackages_latest;
  • Set hardware.system76.enableAll = true;
  • Rebuild NixOS

Presumably you can reproduce on any system, but I am unsure of the steps required on non-nix systems.

Expected behavior:
Kernel rebuilds without error

@shlevy
Copy link

shlevy commented Jun 16, 2022

Build succeeds on 5.17 kernels, FYI

@jackpot51
Copy link
Member

I believe #5 and #6 together will fix the build on 5.18. I will ask @pop-os/quality-assurance to review them.

@shlevy
Copy link

shlevy commented Jun 16, 2022

Will try to patch those in nixpkgs in the mean time and report back.

@shlevy
Copy link

shlevy commented Jun 16, 2022

Running with 5.18 with a patched system76-io-dkms (lsmod shows system76_io, dmesg shows successful module load)

@jackpot51
Copy link
Member

Awesome! I hope we can get it patched here ASAP

github-actions bot pushed a commit to NixOS/nixpkgs that referenced this issue Jun 16, 2022
@jackpot51
Copy link
Member

Fixed with 1.0.2

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

No branches or pull requests

3 participants