diff options
Diffstat (limited to 'debian/patches/bugfix/x86')
11 files changed, 533 insertions, 0 deletions
diff --git a/debian/patches/bugfix/x86/perf-tools-fix-unwind-build-on-i386.patch b/debian/patches/bugfix/x86/perf-tools-fix-unwind-build-on-i386.patch new file mode 100644 index 000000000..e8727ef11 --- /dev/null +++ b/debian/patches/bugfix/x86/perf-tools-fix-unwind-build-on-i386.patch @@ -0,0 +1,37 @@ +From: Ben Hutchings <ben@decadent.org.uk> +Date: Sat, 22 Jul 2017 17:37:33 +0100 +Subject: perf tools: Fix unwind build on i386 +Forwarded: no + +EINVAL may not be defined when building unwind-libunwind.c with +REMOTE_UNWIND_LIBUNWIND, resulting in a compiler error in +LIBUNWIND__ARCH_REG_ID(). Its only caller, access_reg(), only checks +for a negative return value and doesn't care what it is. So change +-EINVAL to -1. + +Fixes: 52ffe0ff02fc ("Support x86(32-bit) cross platform callchain unwind.") +Signed-off-by: Ben Hutchings <ben@decadent.org.uk> +--- + +Index: linux/tools/perf/arch/x86/util/unwind-libunwind.c +=================================================================== +--- linux.orig/tools/perf/arch/x86/util/unwind-libunwind.c ++++ linux/tools/perf/arch/x86/util/unwind-libunwind.c +@@ -67,7 +67,7 @@ int LIBUNWIND__ARCH_REG_ID(int regnum) + break; + default: + pr_err("unwind: invalid reg id %d\n", regnum); +- return -EINVAL; ++ return -1; + } + + return id; +@@ -107,7 +107,7 @@ int LIBUNWIND__ARCH_REG_ID(int regnum) + break; + default: + pr_err("unwind: invalid reg id %d\n", regnum); +- return -EINVAL; ++ return -1; + } + + return id; diff --git a/debian/patches/bugfix/x86/platform-x86-ideapad-laptop-add-ideapad-310-15ikb-to.patch b/debian/patches/bugfix/x86/platform-x86-ideapad-laptop-add-ideapad-310-15ikb-to.patch new file mode 100644 index 000000000..c9cd5cfc4 --- /dev/null +++ b/debian/patches/bugfix/x86/platform-x86-ideapad-laptop-add-ideapad-310-15ikb-to.patch @@ -0,0 +1,37 @@ +From: Sven Rebhan <sven.rebhan@gmail.com> +Date: Tue, 21 Feb 2017 20:53:48 +0100 +Subject: platform/x86: ideapad-laptop: Add IdeaPad 310-15IKB to no_hw_rfkill +Origin: https://git.kernel.org/linus/1f3bc53d843f92d6e7e7cf56ee79acec918e6421 + +Like other Lenovo models the IdeaPad 310-15IKB does not have an hw rfkill +switch. This results in hard-blocked radios after boot, resulting in +always blocked radios rendering them unusable. + +Add the IdeaPad 310-15IKB to the no_hw_rfkill DMI list and allows using +the built-in radios. + +Signed-off-by: Sven Rebhan <Sven.Rebhan@googlemail.com> +[andy: massaged commit message] +Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> +--- + drivers/platform/x86/ideapad-laptop.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +Index: linux/drivers/platform/x86/ideapad-laptop.c +=================================================================== +--- linux.orig/drivers/platform/x86/ideapad-laptop.c ++++ linux/drivers/platform/x86/ideapad-laptop.c +@@ -1098,6 +1098,13 @@ static const struct dmi_system_id no_hw_ + }, + }, + { ++ .ident = "Lenovo ideapad 310-15IKB", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), ++ DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad 310-15IKB"), ++ }, ++ }, ++ { + .ident = "Lenovo ideapad Y700-15ACZ", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), diff --git a/debian/patches/bugfix/x86/platform-x86-ideapad-laptop-add-ideapad-v310-15isk-t.patch b/debian/patches/bugfix/x86/platform-x86-ideapad-laptop-add-ideapad-v310-15isk-t.patch new file mode 100644 index 000000000..43a075fea --- /dev/null +++ b/debian/patches/bugfix/x86/platform-x86-ideapad-laptop-add-ideapad-v310-15isk-t.patch @@ -0,0 +1,35 @@ +From: Andy Shevchenko <andriy.shevchenko@linux.intel.com> +Date: Tue, 21 Feb 2017 20:53:48 +0100 +Subject: platform/x86: ideapad-laptop: Add IdeaPad V310-15ISK to no_hw_rfkill +Origin: https://git.kernel.org/linus/ccc7179f4d9467947c94f4302d61cd5143842fcd + +Like other Lenovo models the IdeaPad V310-15ISK does not have an hw +rfkill switch. This results in hard-blocked radios after boot, resulting +in always blocked radios rendering them unusable. + +Add the IdeaPad V310-15ISK to the no_hw_rfkill DMI list and allows using +the built-in radios. + +Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> +--- + drivers/platform/x86/ideapad-laptop.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +Index: linux/drivers/platform/x86/ideapad-laptop.c +=================================================================== +--- linux.orig/drivers/platform/x86/ideapad-laptop.c ++++ linux/drivers/platform/x86/ideapad-laptop.c +@@ -1098,6 +1098,13 @@ static const struct dmi_system_id no_hw_ + }, + }, + { ++ .ident = "Lenovo V310-15ISK", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), ++ DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo V310-15ISK"), ++ }, ++ }, ++ { + .ident = "Lenovo ideapad 310-15IKB", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), diff --git a/debian/patches/bugfix/x86/platform-x86-ideapad-laptop-add-ideapad-v510-15ikb-t.patch b/debian/patches/bugfix/x86/platform-x86-ideapad-laptop-add-ideapad-v510-15ikb-t.patch new file mode 100644 index 000000000..f64747726 --- /dev/null +++ b/debian/patches/bugfix/x86/platform-x86-ideapad-laptop-add-ideapad-v510-15ikb-t.patch @@ -0,0 +1,37 @@ +From: Sven Eckelmann <sven@narfation.org> +Date: Sat, 1 Jul 2017 08:20:18 +0200 +Subject: platform/x86: ideapad-laptop: Add IdeaPad V510-15IKB to no_hw_rfkill +Origin: https://git.kernel.org/linus/0df4b805cbccbe3f8378f49c415adb2fcffdd3dc +Bug-Debian: https://bugs.debian.org/866706 + +Like other Lenovo models the IdeaPad V510-15IKB does not have an hw +rfkill switch. This results in hard-blocked radios after boot, resulting +in always blocked radios rendering them unusable. + +Add the IdeaPad V510-15IKB to the no_hw_rfkill DMI list and allows using +the built-in radios. + +Signed-off-by: Sven Eckelmann <sven@narfation.org> +Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> +--- + drivers/platform/x86/ideapad-laptop.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +Index: linux/drivers/platform/x86/ideapad-laptop.c +=================================================================== +--- linux.orig/drivers/platform/x86/ideapad-laptop.c ++++ linux/drivers/platform/x86/ideapad-laptop.c +@@ -1105,6 +1105,13 @@ static const struct dmi_system_id no_hw_ + }, + }, + { ++ .ident = "Lenovo V510-15IKB", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), ++ DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo V510-15IKB"), ++ }, ++ }, ++ { + .ident = "Lenovo ideapad 310-15IKB", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), diff --git a/debian/patches/bugfix/x86/platform-x86-ideapad-laptop-add-several-models-to-no.patch b/debian/patches/bugfix/x86/platform-x86-ideapad-laptop-add-several-models-to-no.patch new file mode 100644 index 000000000..4041cd9a3 --- /dev/null +++ b/debian/patches/bugfix/x86/platform-x86-ideapad-laptop-add-several-models-to-no.patch @@ -0,0 +1,112 @@ +From: Yang Jiaxun <yjx@flygoat.com> +Date: Tue, 4 Jul 2017 14:39:19 +0000 +Subject: platform/x86: ideapad-laptop: Add several models to no_hw_rfkill +Origin: https://git.kernel.org/linus/710c059c248a24609051f5a3dd1d8468cdc675b0 + +Some Lenovo ideapad models do not have hardware rfkill switches, but +trying to read the rfkill switches through the ideapad-laptop module. +It caused to always reported blocking breaking wifi. + +Fix it by adding those models to no_hw_rfkill_list. + +Signed-off-by: Yang Jiaxun <yjx@flygoat.com> +Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> +--- + drivers/platform/x86/ideapad-laptop.c | 70 +++++++++++++++++++++++++++++++++++ + 1 file changed, 70 insertions(+) + +Index: linux/drivers/platform/x86/ideapad-laptop.c +=================================================================== +--- linux.orig/drivers/platform/x86/ideapad-laptop.c ++++ linux/drivers/platform/x86/ideapad-laptop.c +@@ -1098,6 +1098,27 @@ static const struct dmi_system_id no_hw_ + }, + }, + { ++ .ident = "Lenovo V310-14IKB", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), ++ DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo V310-14IKB"), ++ }, ++ }, ++ { ++ .ident = "Lenovo V310-14ISK", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), ++ DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo V310-14ISK"), ++ }, ++ }, ++ { ++ .ident = "Lenovo V310-15IKB", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), ++ DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo V310-15IKB"), ++ }, ++ }, ++ { + .ident = "Lenovo V310-15ISK", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), +@@ -1112,6 +1133,41 @@ static const struct dmi_system_id no_hw_ + }, + }, + { ++ .ident = "Lenovo ideapad 300-15IBR", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), ++ DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad 300-15IBR"), ++ }, ++ }, ++ { ++ .ident = "Lenovo ideapad 300-15IKB", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), ++ DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad 300-15IKB"), ++ }, ++ }, ++ { ++ .ident = "Lenovo ideapad 300S-11IBR", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), ++ DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad 300S-11BR"), ++ }, ++ }, ++ { ++ .ident = "Lenovo ideapad 310-15ABR", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), ++ DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad 310-15ABR"), ++ }, ++ }, ++ { ++ .ident = "Lenovo ideapad 310-15IAP", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), ++ DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad 310-15IAP"), ++ }, ++ }, ++ { + .ident = "Lenovo ideapad 310-15IKB", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), +@@ -1119,6 +1175,20 @@ static const struct dmi_system_id no_hw_ + }, + }, + { ++ .ident = "Lenovo ideapad 310-15ISK", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), ++ DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad 310-15ISK"), ++ }, ++ }, ++ { ++ .ident = "Lenovo ideapad Y700-14ISK", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), ++ DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad Y700-14ISK"), ++ }, ++ }, ++ { + .ident = "Lenovo ideapad Y700-15ACZ", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), diff --git a/debian/patches/bugfix/x86/platform-x86-ideapad-laptop-add-y520-15ikbn-to-no_hw.patch b/debian/patches/bugfix/x86/platform-x86-ideapad-laptop-add-y520-15ikbn-to-no_hw.patch new file mode 100644 index 000000000..0020839df --- /dev/null +++ b/debian/patches/bugfix/x86/platform-x86-ideapad-laptop-add-y520-15ikbn-to-no_hw.patch @@ -0,0 +1,35 @@ +From: Olle Liljenzin <olle@liljenzin.se> +Date: Sun, 18 Jun 2017 13:09:31 +0200 +Subject: platform/x86: ideapad-laptop: Add Y520-15IKBN to no_hw_rfkill +Origin: https://git.kernel.org/linus/5d9f40b56630a8702b5f7a61a770f9b73aa07464 + +Lenovo Legion Y520-15IKBN is yet another Lenovo model that does not +have an hw rfkill switch, resulting in wifi always reported as hard +blocked. + +Add the model to the list of models without rfkill switch. + +Signed-off-by: Olle Liljenzin <olle@liljenzin.se> +Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> +--- + drivers/platform/x86/ideapad-laptop.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +Index: linux/drivers/platform/x86/ideapad-laptop.c +=================================================================== +--- linux.orig/drivers/platform/x86/ideapad-laptop.c ++++ linux/drivers/platform/x86/ideapad-laptop.c +@@ -1182,6 +1182,13 @@ static const struct dmi_system_id no_hw_ + }, + }, + { ++ .ident = "Lenovo Legion Y520-15IKBN", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), ++ DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Y520-15IKBN"), ++ }, ++ }, ++ { + .ident = "Lenovo Yoga 2 11 / 13 / Pro", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), diff --git a/debian/patches/bugfix/x86/platform-x86-ideapad-laptop-add-y720-15ikbn-to-no_hw.patch b/debian/patches/bugfix/x86/platform-x86-ideapad-laptop-add-y720-15ikbn-to-no_hw.patch new file mode 100644 index 000000000..59f3dc3f6 --- /dev/null +++ b/debian/patches/bugfix/x86/platform-x86-ideapad-laptop-add-y720-15ikbn-to-no_hw.patch @@ -0,0 +1,35 @@ +From: Olle Liljenzin <olle@liljenzin.se> +Date: Sun, 18 Jun 2017 14:37:58 +0200 +Subject: platform/x86: ideapad-laptop: Add Y720-15IKBN to no_hw_rfkill +Origin: https://git.kernel.org/linus/b2f2fe205c3b9b595dc50ee431230a45d03f9c2c + +Lenovo Legion Y720-15IKBN is yet another Lenovo model that does not +have an hw rfkill switch, resulting in wifi always reported as hard +blocked. + +Add the model to the list of models without rfkill switch. + +Signed-off-by: Olle Liljenzin <olle@liljenzin.se> +Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> +--- + drivers/platform/x86/ideapad-laptop.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +Index: linux/drivers/platform/x86/ideapad-laptop.c +=================================================================== +--- linux.orig/drivers/platform/x86/ideapad-laptop.c ++++ linux/drivers/platform/x86/ideapad-laptop.c +@@ -1189,6 +1189,13 @@ static const struct dmi_system_id no_hw_ + }, + }, + { ++ .ident = "Lenovo Legion Y720-15IKBN", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), ++ DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Y720-15IKBN"), ++ }, ++ }, ++ { + .ident = "Lenovo Yoga 2 11 / 13 / Pro", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), diff --git a/debian/patches/bugfix/x86/revert-perf-build-fix-libunwind-feature-detection-on.patch b/debian/patches/bugfix/x86/revert-perf-build-fix-libunwind-feature-detection-on.patch new file mode 100644 index 000000000..e571c91fe --- /dev/null +++ b/debian/patches/bugfix/x86/revert-perf-build-fix-libunwind-feature-detection-on.patch @@ -0,0 +1,24 @@ +From: Ben Hutchings <ben@decadent.org.uk> +Date: Fri, 25 Sep 2015 22:50:50 +0100 +Subject: Revert "perf build: Fix libunwind feature detection on 32-bit x86" +Forwarded: no + +This reverts commit 05b41775e2edd69a83f592e3534930c934d4038e. +It broke feature detection that was working just fine for us. +--- + tools/perf/Makefile.config | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: linux/tools/perf/Makefile.config +=================================================================== +--- linux.orig/tools/perf/Makefile.config ++++ linux/tools/perf/Makefile.config +@@ -42,7 +42,7 @@ ifeq ($(SRCARCH),x86) + LIBUNWIND_LIBS = -lunwind-x86_64 -lunwind -llzma + $(call detected,CONFIG_X86_64) + else +- LIBUNWIND_LIBS = -lunwind-x86 -llzma -lunwind ++ LIBUNWIND_LIBS = -lunwind -lunwind-x86 + endif + NO_PERF_REGS := 0 + endif diff --git a/debian/patches/bugfix/x86/tools-turbostat-Add-checks-for-failure-of-fgets-and-.patch b/debian/patches/bugfix/x86/tools-turbostat-Add-checks-for-failure-of-fgets-and-.patch new file mode 100644 index 000000000..77b56df47 --- /dev/null +++ b/debian/patches/bugfix/x86/tools-turbostat-Add-checks-for-failure-of-fgets-and-.patch @@ -0,0 +1,114 @@ +From: Ben Hutchings <ben@decadent.org.uk> +Date: Tue, 11 Sep 2018 03:07:28 +0100 +Subject: tools: turbostat: Add checks for failure of fgets() and fscanf() +Forwarded: https://marc.info/?l=linux-pm&m=153711036626779 + +Most calls to fgets() and fscanf() are followed by error checks. +Add an exit-on-error in the remaining cases. + +Signed-off-by: Ben Hutchings <ben@decadent.org.uk> +--- + tools/power/x86/turbostat/turbostat.c | 28 +++++++++++++++++---------- + 1 file changed, 18 insertions(+), 10 deletions(-) + +Index: linux/tools/power/x86/turbostat/turbostat.c +=================================================================== +--- linux.orig/tools/power/x86/turbostat/turbostat.c ++++ linux/tools/power/x86/turbostat/turbostat.c +@@ -2554,7 +2554,8 @@ int get_thread_siblings(struct cpu_topol + filep = fopen_or_die(path, "r"); + do { + offset -= BITMASK_SIZE; +- fscanf(filep, "%lx%c", &map, &character); ++ if (fscanf(filep, "%lx%c", &map, &character) != 2) ++ err(1, "%s: failed to parse file", path); + for (shift = 0; shift < BITMASK_SIZE; shift++) { + if ((map >> shift) & 0x1) { + so = shift + offset; +@@ -3407,14 +3408,14 @@ dump_sysfs_cstate_config(void) + input = fopen(path, "r"); + if (input == NULL) + continue; +- fgets(name_buf, sizeof(name_buf), input); ++ if (!fgets(name_buf, sizeof(name_buf), input)) ++ err(1, "%s: failed to read file", path); + + /* truncate "C1-HSW\n" to "C1", or truncate "C1\n" to "C1" */ + sp = strchr(name_buf, '-'); + if (!sp) + sp = strchrnul(name_buf, '\n'); + *sp = '\0'; +- + fclose(input); + + sprintf(path, "/sys/devices/system/cpu/cpu%d/cpuidle/state%d/desc", +@@ -3422,7 +3423,8 @@ dump_sysfs_cstate_config(void) + input = fopen(path, "r"); + if (input == NULL) + continue; +- fgets(desc, sizeof(desc), input); ++ if (!fgets(desc, sizeof(desc), input)) ++ err(1, "%s: failed to read file", path); + + fprintf(outf, "cpu%d: %s: %s", base_cpu, name_buf, desc); + fclose(input); +@@ -3444,7 +3446,8 @@ dump_sysfs_pstate_config(void) + fprintf(stderr, "NSFOD %s\n", path); + return; + } +- fgets(driver_buf, sizeof(driver_buf), input); ++ if (!fgets(driver_buf, sizeof(driver_buf), input)) ++ err(1, "%s: failed to read file", path); + fclose(input); + + sprintf(path, "/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor", +@@ -3454,7 +3457,8 @@ dump_sysfs_pstate_config(void) + fprintf(stderr, "NSFOD %s\n", path); + return; + } +- fgets(governor_buf, sizeof(governor_buf), input); ++ if (!fgets(governor_buf, sizeof(governor_buf), input)) ++ err(1, "%s: failed to read file", path); + fclose(input); + + fprintf(outf, "cpu%d: cpufreq driver: %s", base_cpu, driver_buf); +@@ -3463,7 +3467,8 @@ dump_sysfs_pstate_config(void) + sprintf(path, "/sys/devices/system/cpu/cpufreq/boost"); + input = fopen(path, "r"); + if (input != NULL) { +- fscanf(input, "%d", &turbo); ++ if (fscanf(input, "%d", &turbo) != 1) ++ err(1, "%s: failed to parse number from file", path); + fprintf(outf, "cpufreq boost: %d\n", turbo); + fclose(input); + } +@@ -3471,7 +3476,8 @@ dump_sysfs_pstate_config(void) + sprintf(path, "/sys/devices/system/cpu/intel_pstate/no_turbo"); + input = fopen(path, "r"); + if (input != NULL) { +- fscanf(input, "%d", &turbo); ++ if (fscanf(input, "%d", &turbo) != 1) ++ err(1, "%s: failed to parse number from file", path); + fprintf(outf, "cpufreq intel_pstate no_turbo: %d\n", turbo); + fclose(input); + } +@@ -5296,7 +5302,8 @@ void probe_sysfs(void) + input = fopen(path, "r"); + if (input == NULL) + continue; +- fgets(name_buf, sizeof(name_buf), input); ++ if (!fgets(name_buf, sizeof(name_buf), input)) ++ err(1, "%s: failed to read file", path); + + /* truncate "C1-HSW\n" to "C1", or truncate "C1\n" to "C1" */ + sp = strchr(name_buf, '-'); +@@ -5323,7 +5330,8 @@ void probe_sysfs(void) + input = fopen(path, "r"); + if (input == NULL) + continue; +- fgets(name_buf, sizeof(name_buf), input); ++ if (!fgets(name_buf, sizeof(name_buf), input)) ++ err(1, "%s: failed to read file", path); + /* truncate "C1-HSW\n" to "C1", or truncate "C1\n" to "C1" */ + sp = strchr(name_buf, '-'); + if (!sp) diff --git a/debian/patches/bugfix/x86/viafb-autoload-on-olpc-xo1.5-only.patch b/debian/patches/bugfix/x86/viafb-autoload-on-olpc-xo1.5-only.patch new file mode 100644 index 000000000..14df64f35 --- /dev/null +++ b/debian/patches/bugfix/x86/viafb-autoload-on-olpc-xo1.5-only.patch @@ -0,0 +1,36 @@ +From: Ben Hutchings <ben@decadent.org.uk> +Date: Sat, 20 Apr 2013 15:52:02 +0100 +Subject: viafb: Autoload on OLPC XO 1.5 only +Bug-Debian: https://bugs.debian.org/705788 +Forwarded: no + +It appears that viafb won't work automatically on all the boards for +which it has a PCI device ID match. Currently, it is blacklisted by +udev along with most other framebuffer drivers, so this doesn't matter +much. + +However, this driver is required for console support on the XO 1.5. +We need to allow it to be autoloaded on this model only, and then +un-blacklist it in udev. + +--- +Index: linux/drivers/video/fbdev/via/via-core.c +=================================================================== +--- linux.orig/drivers/video/fbdev/via/via-core.c ++++ linux/drivers/video/fbdev/via/via-core.c +@@ -752,7 +752,14 @@ static const struct pci_device_id via_pc + .driver_data = UNICHROME_VX900 }, + { } + }; +-MODULE_DEVICE_TABLE(pci, via_pci_table); ++ ++static const struct pci_device_id via_pci_autoload_table[] __initconst = { ++ /* OLPC XO 1.5 */ ++ { PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_VX855_DID), ++ .subvendor = 0x152d, .subdevice = 0x0833 }, ++ { } ++}; ++MODULE_DEVICE_TABLE(pci, via_pci_autoload_table); + + static struct pci_driver via_driver = { + .name = "viafb", diff --git a/debian/patches/bugfix/x86/x86-32-disable-3dnow-in-generic-config.patch b/debian/patches/bugfix/x86/x86-32-disable-3dnow-in-generic-config.patch new file mode 100644 index 000000000..2970dc8b4 --- /dev/null +++ b/debian/patches/bugfix/x86/x86-32-disable-3dnow-in-generic-config.patch @@ -0,0 +1,31 @@ +From: Ben Hutchings <ben@decadent.org.uk> +Date: Tue, 25 Sep 2018 19:44:13 +0100 +Subject: x86-32: Disable 3D-Now in generic config + +We want the 686 flavour to run on Geode LX and similar AMD family 5 +CPUs as well as family 6 and higher CPUs. This used to work with +CONFIG_M686=y. However commit 25d76ac88821 "x86/Kconfig: Explicitly +enumerate i686-class CPUs in Kconfig" in Linux 4.16 has made the +kernel require family 6 or higher. + +It looks like a sensible choice would be to enable CONFIG_MGEODE_LX +and CONFIG_X86_GENERIC (for more generic optimisations), but this +currently enables CONFIG_X86_USE_3D_NOW which will cause the kernel to +crash on CPUs without the AMD-specific 3D-Now instructions. + +Make CONFIG_X86_USE_3DNOW depend on CONFIG_X86_GENERIC being disabled. + +--- +Index: linux/arch/x86/Kconfig.cpu +=================================================================== +--- linux.orig/arch/x86/Kconfig.cpu ++++ linux/arch/x86/Kconfig.cpu +@@ -337,7 +337,7 @@ config X86_USE_PPRO_CHECKSUM + + config X86_USE_3DNOW + def_bool y +- depends on (MCYRIXIII || MK7 || MGEODE_LX) && !UML ++ depends on (MCYRIXIII || MK7 || MGEODE_LX) && !X86_GENERIC && !UML + + # + # P6_NOPs are a relatively minor optimization that require a family >= |