From a9c40eef1f9a9824c706e1e38c02be5c054453ec Mon Sep 17 00:00:00 2001 From: Ambroz Bizjak Date: Wed, 24 Apr 2019 19:18:42 +0200 Subject: [PATCH] Fix kernel oops on boot due to bug in i2c driver. https://github.com/NixOS/nixpkgs/issues/60126 https://lkml.org/lkml/2019/4/24/1123 The patch should be removed in the next round of stable releases because the fix should be included. (cherry picked from commit 1e8a0805890fbb1cce1aa751296c82342b0cae7e) --- pkgs/os-specific/linux/kernel/i2c-oops.patch | 12 ++++++++++++ pkgs/os-specific/linux/kernel/patches.nix | 4 ++++ pkgs/top-level/all-packages.nix | 3 +++ 3 files changed, 19 insertions(+) create mode 100644 pkgs/os-specific/linux/kernel/i2c-oops.patch diff --git a/pkgs/os-specific/linux/kernel/i2c-oops.patch b/pkgs/os-specific/linux/kernel/i2c-oops.patch new file mode 100644 index 000000000000..2d4f25cec68d --- /dev/null +++ b/pkgs/os-specific/linux/kernel/i2c-oops.patch @@ -0,0 +1,12 @@ +diff --git a/drivers/hid/i2c-hid/i2c-hid-dmi-quirks.c b/drivers/hid/i2c-hid/i2c-hid-dmi-quirks.c +index 1d645c9ab417bf..cac262a912c124 100644 +--- a/drivers/hid/i2c-hid/i2c-hid-dmi-quirks.c ++++ b/drivers/hid/i2c-hid/i2c-hid-dmi-quirks.c +@@ -337,7 +337,8 @@ static const struct dmi_system_id i2c_hid_dmi_desc_override_table[] = { + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "FlexBook edge11 - M-FBE11"), + }, + .driver_data = (void *)&sipodev_desc +- } ++ }, ++ { } /* Terminate list */ + }; diff --git a/pkgs/os-specific/linux/kernel/patches.nix b/pkgs/os-specific/linux/kernel/patches.nix index 4c338b37deca..e02cd0545a4c 100644 --- a/pkgs/os-specific/linux/kernel/patches.nix +++ b/pkgs/os-specific/linux/kernel/patches.nix @@ -57,4 +57,8 @@ rec { sha256 = "1l8xq02rd7vakxg52xm9g4zng0ald866rpgm8kjlh88mwwyjkrwv"; }; }; + + # Fix kernel OOPS on boot: https://github.com/NixOS/nixpkgs/issues/60126 + # Remove with the next release. + i2c-oops = { name = "i2c-oops"; patch = ./i2c-oops.patch; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 06db8f150b5f..cdf7a8b9ff5a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -14988,6 +14988,7 @@ in [ kernelPatches.bridge_stp_helper kernelPatches.cpu-cgroup-v2."4.9" kernelPatches.modinst_arg_list_too_long + kernelPatches.i2c-oops ]; }; @@ -14998,6 +14999,7 @@ in # when adding a new linux version kernelPatches.cpu-cgroup-v2."4.11" kernelPatches.modinst_arg_list_too_long + kernelPatches.i2c-oops ]; }; @@ -15005,6 +15007,7 @@ in kernelPatches = [ kernelPatches.bridge_stp_helper kernelPatches.modinst_arg_list_too_long + kernelPatches.i2c-oops ]; };