diff options
author | Thorsten Leemhuis <fedora@leemhuis.info> | 2017-06-14 19:14:30 +0200 |
---|---|---|
committer | Thorsten Leemhuis <fedora@leemhuis.info> | 2017-06-14 19:14:30 +0200 |
commit | e0260a5ef682636e2d0269968881729f0294838f (patch) | |
tree | 96c355ef104dcc7ea00f69c08f5713f21d56e642 | |
parent | 5bae90a8be827a033db42e0cdfd3caecae789c04 (diff) | |
parent | 61735b7e1fbe3b2527050eb70d48fdbb0cc33fad (diff) | |
download | kernel-4.11.5-300.vanilla.knurd.1.fc26.tar.gz kernel-4.11.5-300.vanilla.knurd.1.fc26.tar.xz kernel-4.11.5-300.vanilla.knurd.1.fc26.zip |
Merge remote-tracking branch 'origin/f26' into f26-user-thl-vanilla-fedorakernel-4.11.5-300.vanilla.knurd.1.fc26
-rw-r--r-- | 0001-efi-Fix-boot-panic-because-of-invalid-BGRT-image-add.patch | 114 | ||||
-rw-r--r-- | AllWinner-net-emac.patch | 321 | ||||
-rw-r--r-- | arm-hikey-fixWiFi.patch | 1 | ||||
-rw-r--r-- | baseconfig/arm/CONFIG_ROCKCHIP_CDN_DP (renamed from baseconfig/arm/armv7/CONFIG_ROCKCHIP_CDN_DP) | 0 | ||||
-rw-r--r-- | baseconfig/arm/armv7/CONFIG_REGULATOR_ACT8865 | 1 | ||||
-rw-r--r-- | dell-laptop-Adds-support-for-keyboard-backlight-timeout-AC-settings.patch | 197 | ||||
-rw-r--r-- | kernel-aarch64-debug.config | 1 | ||||
-rw-r--r-- | kernel-aarch64.config | 1 | ||||
-rw-r--r-- | kernel-armv7hl-debug.config | 2 | ||||
-rw-r--r-- | kernel-armv7hl-lpae-debug.config | 2 | ||||
-rw-r--r-- | kernel-armv7hl-lpae.config | 2 | ||||
-rw-r--r-- | kernel-armv7hl.config | 2 | ||||
-rw-r--r-- | kernel.spec | 17 | ||||
-rw-r--r-- | sources | 2 |
14 files changed, 655 insertions, 8 deletions
diff --git a/0001-efi-Fix-boot-panic-because-of-invalid-BGRT-image-add.patch b/0001-efi-Fix-boot-panic-because-of-invalid-BGRT-image-add.patch new file mode 100644 index 000000000..4a714e36d --- /dev/null +++ b/0001-efi-Fix-boot-panic-because-of-invalid-BGRT-image-add.patch @@ -0,0 +1,114 @@ +From 87c19e8de4f56d803d133c3e38bbd7b069e06df3 Mon Sep 17 00:00:00 2001 +From: Dave Young <dyoung@redhat.com> +Date: Fri, 9 Jun 2017 08:45:58 +0000 +Subject: [PATCH] efi: Fix boot panic because of invalid BGRT image address + +Maniaxx reported a kernel boot crash in the EFI code, which I emulated +by using same invalid phys addr in code: + + BUG: unable to handle kernel paging request at ffffffffff280001 + IP: efi_bgrt_init+0xfb/0x153 + ... + Call Trace: + ? bgrt_init+0xbc/0xbc + acpi_parse_bgrt+0xe/0x12 + acpi_table_parse+0x89/0xb8 + acpi_boot_init+0x445/0x4e2 + ? acpi_parse_x2apic+0x79/0x79 + ? dmi_ignore_irq0_timer_override+0x33/0x33 + setup_arch+0xb63/0xc82 + ? early_idt_handler_array+0x120/0x120 + start_kernel+0xb7/0x443 + ? early_idt_handler_array+0x120/0x120 + x86_64_start_reservations+0x29/0x2b + x86_64_start_kernel+0x154/0x177 + secondary_startup_64+0x9f/0x9f + +There is also a similar bug filed in bugzilla.kernel.org: + + https://bugzilla.kernel.org/show_bug.cgi?id=195633 + +The crash is caused by this commit: + + 7b0a911478c7 efi/x86: Move the EFI BGRT init code to early init code + +The root cause is the firmware on those machines provides invalid BGRT +image addresses. + +In a kernel before above commit BGRT initializes late and uses ioremap() +to map the image address. Ioremap validates the address, if it is not a +valid physical address ioremap() just fails and returns. However in current +kernel EFI BGRT initializes early and uses early_memremap() which does not +validate the image address, and kernel panic happens. + +According to ACPI spec the BGRT image address should fall into +EFI_BOOT_SERVICES_DATA, see the section 5.2.22.4 of below document: + + http://www.uefi.org/sites/default/files/resources/ACPI_6_1.pdf + +Fix this issue by validating the image address in efi_bgrt_init(). If the +image address does not fall into any EFI_BOOT_SERVICES_DATA areas we just +bail out with a warning message. + +Reported-by: Maniaxx <tripleshiftone@gmail.com> +Signed-off-by: Dave Young <dyoung@redhat.com> +Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> +Cc: Linus Torvalds <torvalds@linux-foundation.org> +Cc: Matt Fleming <matt@codeblueprint.co.uk> +Cc: Peter Zijlstra <peterz@infradead.org> +Cc: Thomas Gleixner <tglx@linutronix.de> +Cc: linux-efi@vger.kernel.org +Fixes: 7b0a911478c7 ("efi/x86: Move the EFI BGRT init code to early init code") +Link: http://lkml.kernel.org/r/20170609084558.26766-2-ard.biesheuvel@linaro.org +Signed-off-by: Ingo Molnar <mingo@kernel.org> +[labbott@redhat.com: Backport to 4.11] +Signed-off-by: Laura Abbott <labbott@redhat.com> +--- + arch/x86/platform/efi/efi-bgrt.c | 24 ++++++++++++++++++++++++ + 1 file changed, 24 insertions(+) + +diff --git a/arch/x86/platform/efi/efi-bgrt.c b/arch/x86/platform/efi/efi-bgrt.c +index 04ca876..08ee795 100644 +--- a/arch/x86/platform/efi/efi-bgrt.c ++++ b/arch/x86/platform/efi/efi-bgrt.c +@@ -27,6 +27,26 @@ struct bmp_header { + u32 size; + } __packed; + ++static bool efi_bgrt_addr_valid(u64 addr) ++{ ++ efi_memory_desc_t *md; ++ ++ for_each_efi_memory_desc(md) { ++ u64 size; ++ u64 end; ++ ++ if (md->type != EFI_BOOT_SERVICES_DATA) ++ continue; ++ ++ size = md->num_pages << EFI_PAGE_SHIFT; ++ end = md->phys_addr + size; ++ if (addr >= md->phys_addr && addr < end) ++ return true; ++ } ++ ++ return false; ++} ++ + void __init efi_bgrt_init(struct acpi_table_header *table) + { + void *image; +@@ -62,6 +82,10 @@ void __init efi_bgrt_init(struct acpi_table_header *table) + goto out; + } + ++ if (!efi_bgrt_addr_valid(bgrt->image_address)) { ++ pr_notice("Ignoring BGRT: invalid image address\n"); ++ goto out; ++ } + image = early_memremap(bgrt->image_address, sizeof(bmp_header)); + if (!image) { + pr_notice("Ignoring BGRT: failed to map image header memory\n"); +-- +2.7.5 + diff --git a/AllWinner-net-emac.patch b/AllWinner-net-emac.patch index ebe9a3c94..9417fb80e 100644 --- a/AllWinner-net-emac.patch +++ b/AllWinner-net-emac.patch @@ -2177,3 +2177,324 @@ index 6872135..347c262 100644 &mmc0 { pinctrl-names = "default"; pinctrl-0 = <&mmc0_pins>; +From patchwork Fri Jun 9 15:34:36 2017 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: ARM: sun8i: h3: Enable EMAC with external PHY on Orange Pi Plus 2E +From: Chen-Yu Tsai <wens@csie.org> +X-Patchwork-Id: 9778837 +Message-Id: <20170609153436.18370-1-wens@csie.org> +To: Maxime Ripard <maxime.ripard@free-electrons.com> +Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, + Chen-Yu Tsai <wens@csie.org>, Corentin Labbe <clabbe.montjoie@gmail.com>, + linux-sunxi@googlegroups.co, linux-arm-kernel@lists.infradead.org +Date: Fri, 9 Jun 2017 23:34:36 +0800 + +The Orange Pi Plus 2E, unlike the Orange Pi PC and PC Plus which its +schematics are based on, uses an external Realtek RTL8211E PHY in +RGMII mode, with a GPIO enabling the regulator for I/O signalling +power supplies. The PHY's main power supply is enabled by the main +5V power supply. + +Add the regulator and PHY nodes, and override the PHY phandle under +the EMAC node, so that the EMAC works properly on this board. + +Signed-off-by: Chen-Yu Tsai <wens@csie.org> +--- + arch/arm/boot/dts/sun8i-h3-orangepi-plus2e.dts | 26 ++++++++++++++++++++++++++ + 1 file changed, 26 insertions(+) + +diff --git a/arch/arm/boot/dts/sun8i-h3-orangepi-plus2e.dts b/arch/arm/boot/dts/sun8i-h3-orangepi-plus2e.dts +index 5851a47a3089..80026f3caafc 100644 +--- a/arch/arm/boot/dts/sun8i-h3-orangepi-plus2e.dts ++++ b/arch/arm/boot/dts/sun8i-h3-orangepi-plus2e.dts +@@ -50,4 +50,30 @@ + / { + model = "Xunlong Orange Pi Plus 2E"; + compatible = "xunlong,orangepi-plus2e", "allwinner,sun8i-h3"; ++ ++ reg_gmac_3v3: gmac-3v3 { ++ compatible = "regulator-fixed"; ++ regulator-name = "gmac-3v3"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ startup-delay-us = <100000>; ++ enable-active-high; ++ gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; /* PD6 */ ++ }; ++}; ++ ++&emac { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&emac_rgmii_pins>; ++ phy-supply = <®_gmac_3v3>; ++ phy-handle = <&ext_rgmii_phy>; ++ phy-mode = "rgmii"; ++ status = "okay"; ++}; ++ ++&mdio { ++ ext_rgmii_phy: ethernet-phy@1 { ++ compatible = "ethernet-phy-ieee802.3-c22"; ++ reg = <1>; ++ }; + }; +From patchwork Mon Jun 5 19:21:26 2017 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [1/5] ARM: sun8i: orangepi-plus: Enable dwmac-sun8i +From: Corentin LABBE <clabbe.montjoie@gmail.com> +X-Patchwork-Id: 9767313 +Message-Id: <20170605192130.25320-2-clabbe.montjoie@gmail.com> +To: robh+dt@kernel.org, mark.rutland@arm.com, linux@armlinux.org.uk, + maxime.ripard@free-electrons.com, wens@csie.org, + catalin.marinas@arm.com, will.deacon@arm.com +Cc: devicetree@vger.kernel.org, linux-sunxi@googlegroups.com, + Corentin Labbe <clabbe.montjoie@gmail.com>, + linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org +Date: Mon, 5 Jun 2017 21:21:26 +0200 + +The dwmac-sun8i hardware is present on the Orange PI plus. +It uses an external PHY rtl8211e via RGMII. + +This patch create the needed regulator, emac and phy nodes. + +Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com> +--- + arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts | 32 ++++++++++++++++++++++++++++ + 1 file changed, 32 insertions(+) + +diff --git a/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts b/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts +index 8c40ab7bfa72..331ed683ac62 100644 +--- a/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts ++++ b/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts +@@ -47,6 +47,20 @@ + model = "Xunlong Orange Pi Plus / Plus 2"; + compatible = "xunlong,orangepi-plus", "allwinner,sun8i-h3"; + ++ aliases { ++ ethernet0 = &emac; ++ }; ++ ++ reg_gmac_3v3: gmac-3v3 { ++ compatible = "regulator-fixed"; ++ regulator-name = "gmac-3v3"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ startup-delay-us = <100000>; ++ enable-active-high; ++ gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; ++ }; ++ + reg_usb3_vbus: usb3-vbus { + compatible = "regulator-fixed"; + pinctrl-names = "default"; +@@ -64,6 +78,24 @@ + status = "okay"; + }; + ++&emac { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&emac_rgmii_pins>; ++ phy-supply = <®_gmac_3v3>; ++ phy-handle = <&ext_rgmii_phy>; ++ phy-mode = "rgmii"; ++ ++ allwinner,leds-active-low; ++ status = "okay"; ++}; ++ ++&mdio { ++ ext_rgmii_phy: ethernet-phy@1 { ++ compatible = "ethernet-phy-ieee802.3-c22"; ++ reg = <0>; ++ }; ++}; ++ + &mmc2 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc2_8bit_pins>; +From patchwork Mon Jun 5 19:21:27 2017 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [2/5] ARM: sun8i: bananapi-m2-plus: Enable dwmac-sun8i +From: Corentin LABBE <clabbe.montjoie@gmail.com> +X-Patchwork-Id: 9767321 +Message-Id: <20170605192130.25320-3-clabbe.montjoie@gmail.com> +To: robh+dt@kernel.org, mark.rutland@arm.com, linux@armlinux.org.uk, + maxime.ripard@free-electrons.com, wens@csie.org, + catalin.marinas@arm.com, will.deacon@arm.com +Cc: devicetree@vger.kernel.org, linux-sunxi@googlegroups.com, + Corentin Labbe <clabbe.montjoie@gmail.com>, + linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org +Date: Mon, 5 Jun 2017 21:21:27 +0200 + +The dwmac-sun8i hardware is present on the Banana Pi M2+ +It uses an external PHY rtl8211e via RGMII. + +This patch create the needed regulator, emac and phy nodes. + +Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com> +--- + arch/arm/boot/dts/sun8i-h3-bananapi-m2-plus.dts | 29 +++++++++++++++++++++++++ + 1 file changed, 29 insertions(+) + +diff --git a/arch/arm/boot/dts/sun8i-h3-bananapi-m2-plus.dts b/arch/arm/boot/dts/sun8i-h3-bananapi-m2-plus.dts +index 883072b611fa..d756ff825116 100644 +--- a/arch/arm/boot/dts/sun8i-h3-bananapi-m2-plus.dts ++++ b/arch/arm/boot/dts/sun8i-h3-bananapi-m2-plus.dts +@@ -52,6 +52,7 @@ + compatible = "sinovoip,bpi-m2-plus", "allwinner,sun8i-h3"; + + aliases { ++ ethernet0 = &emac; + serial0 = &uart0; + serial1 = &uart1; + }; +@@ -84,6 +85,16 @@ + }; + }; + ++ reg_gmac_3v3: gmac-3v3 { ++ compatible = "regulator-fixed"; ++ regulator-name = "gmac-3v3"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ startup-delay-us = <100000>; ++ enable-active-high; ++ gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; ++ }; ++ + wifi_pwrseq: wifi_pwrseq { + compatible = "mmc-pwrseq-simple"; + pinctrl-names = "default"; +@@ -104,12 +115,30 @@ + status = "okay"; + }; + ++&emac { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&emac_rgmii_pins>; ++ phy-supply = <®_gmac_3v3>; ++ phy-handle = <&ext_rgmii_phy>; ++ phy-mode = "rgmii"; ++ ++ allwinner,leds-active-low; ++ status = "okay"; ++}; ++ + &ir { + pinctrl-names = "default"; + pinctrl-0 = <&ir_pins_a>; + status = "okay"; + }; + ++&mdio { ++ ext_rgmii_phy: ethernet-phy@1 { ++ compatible = "ethernet-phy-ieee802.3-c22"; ++ reg = <0>; ++ }; ++}; ++ + &mmc0 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>; +From patchwork Wed May 31 07:18:40 2017 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [v6,09/21] arm: sun8i: orangepi-zero: Enable dwmac-sun8i +From: Corentin LABBE <clabbe.montjoie@gmail.com> +X-Patchwork-Id: 9756075 +Message-Id: <20170531071852.12422-10-clabbe.montjoie@gmail.com> +To: robh+dt@kernel.org, mark.rutland@arm.com, + maxime.ripard@free-electrons.com, + wens@csie.org, linux@armlinux.org.uk, catalin.marinas@arm.com, + will.deacon@arm.com, peppe.cavallaro@st.com, alexandre.torgue@st.com +Cc: devicetree@vger.kernel.org, netdev@vger.kernel.org, + linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, + Corentin Labbe <clabbe.montjoie@gmail.com>, + linux-arm-kernel@lists.infradead.org +Date: Wed, 31 May 2017 09:18:40 +0200 + +The dwmac-sun8i hardware is present on the Orange PI Zero. +It uses the internal PHY. + +This patch create the needed emac node. + +Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com> +--- + arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts b/arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts +index 9e8b082c134f..dd3525a0f06a 100644 +--- a/arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts ++++ b/arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts +@@ -57,6 +57,7 @@ + aliases { + serial0 = &uart0; + /* ethernet0 is the H3 emac, defined in sun8i-h3.dtsi */ ++ ethernet0 = &emac; + ethernet1 = &xr819; + }; + +@@ -103,6 +104,13 @@ + status = "okay"; + }; + ++&emac { ++ phy-handle = <&int_mii_phy>; ++ phy-mode = "mii"; ++ allwinner,leds-active-low; ++ status = "okay"; ++}; ++ + &mmc0 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc0_pins_a>; +From patchwork Wed May 31 07:18:44 2017 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [v6,13/21] arm: sun8i: nanopi-neo: Enable dwmac-sun8i +From: Corentin LABBE <clabbe.montjoie@gmail.com> +X-Patchwork-Id: 9756089 +Message-Id: <20170531071852.12422-14-clabbe.montjoie@gmail.com> +To: robh+dt@kernel.org, mark.rutland@arm.com, + maxime.ripard@free-electrons.com, + wens@csie.org, linux@armlinux.org.uk, catalin.marinas@arm.com, + will.deacon@arm.com, peppe.cavallaro@st.com, alexandre.torgue@st.com +Cc: devicetree@vger.kernel.org, netdev@vger.kernel.org, + linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, + Corentin Labbe <clabbe.montjoie@gmail.com>, + linux-arm-kernel@lists.infradead.org +Date: Wed, 31 May 2017 09:18:44 +0200 + +The dwmac-sun8i hardware is present on the NanoPi Neo. +It uses the internal PHY. +This patch create the needed emac node. + +Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com> +--- + arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts b/arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts +index 8d2cc6e9a03f..78f6c24952dd 100644 +--- a/arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts ++++ b/arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts +@@ -46,3 +46,10 @@ + model = "FriendlyARM NanoPi NEO"; + compatible = "friendlyarm,nanopi-neo", "allwinner,sun8i-h3"; + }; ++ ++&emac { ++ phy-handle = <&int_mii_phy>; ++ phy-mode = "mii"; ++ allwinner,leds-active-low; ++ status = "okay"; ++}; diff --git a/arm-hikey-fixWiFi.patch b/arm-hikey-fixWiFi.patch index 9ea70efd5..19d28314b 100644 --- a/arm-hikey-fixWiFi.patch +++ b/arm-hikey-fixWiFi.patch @@ -498,4 +498,3 @@ index 5132d8ed4664..49f6a6242cf9 100644 leds { -- 2.13.0 - diff --git a/baseconfig/arm/armv7/CONFIG_ROCKCHIP_CDN_DP b/baseconfig/arm/CONFIG_ROCKCHIP_CDN_DP index 98a696d76..98a696d76 100644 --- a/baseconfig/arm/armv7/CONFIG_ROCKCHIP_CDN_DP +++ b/baseconfig/arm/CONFIG_ROCKCHIP_CDN_DP diff --git a/baseconfig/arm/armv7/CONFIG_REGULATOR_ACT8865 b/baseconfig/arm/armv7/CONFIG_REGULATOR_ACT8865 deleted file mode 100644 index f1e82abd5..000000000 --- a/baseconfig/arm/armv7/CONFIG_REGULATOR_ACT8865 +++ /dev/null @@ -1 +0,0 @@ -# CONFIG_REGULATOR_ACT8865 is not set diff --git a/dell-laptop-Adds-support-for-keyboard-backlight-timeout-AC-settings.patch b/dell-laptop-Adds-support-for-keyboard-backlight-timeout-AC-settings.patch new file mode 100644 index 000000000..bf370c6e4 --- /dev/null +++ b/dell-laptop-Adds-support-for-keyboard-backlight-timeout-AC-settings.patch @@ -0,0 +1,197 @@ +From patchwork Sun Apr 23 19:40:47 2017 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 8bit +Subject: dell-laptop: Adds support for keyboard backlight timeout AC settings +From: =?utf-8?q?Pali_Roh=C3=A1r?= <pali.rohar@gmail.com> +X-Patchwork-Id: 9695273 +Message-Id: <1492976447-10339-1-git-send-email-pali.rohar@gmail.com> +To: Matthew Garrett <mjg59@srcf.ucam.org>, + Darren Hart <dvhart@infradead.org>, Andy Shevchenko <andy@infradead.org>, + Arcadiy Ivanov <arcadiy@ivanov.biz>, + Mario Limonciello <mario.limonciello@dell.com> +Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, + =?UTF-8?q?Pali=20Roh=C3=A1r?= <pali.rohar@gmail.com> +Date: Sun, 23 Apr 2017 21:40:47 +0200 + +When changing keyboard backlight state on new Dell laptops, firmware +expects a new timeout AC value filled in Set New State SMBIOS call. + +Without it any change of keyboard backlight state on new Dell laptops +fails. And user can see following error message in dmesg: + + dell_laptop: Setting old previous keyboard state failed + leds dell::kbd_backlight: Setting an LED's brightness failed (-6) + +This patch adds support for retrieving current timeout AC values and also +updating them. Current timeout value in sysfs is displayed based on current +AC status, like current display brightness value. + +Detection if Dell laptop supports or not new timeout AC settings is done by +checking existence of Keyboard Backlight with AC SMBIOS token (0x0451). + +Signed-off-by: Pali Rohár <pali.rohar@gmail.com> +Acked-by: Mario Limonciello <mario.limonciello@dell.com> +--- +I have not tested this patch yet as I do not have affected machine. I would +appreciate some testing of this patch on more new Dell laptops. Without +this patch changing keyboard backlight is not possible on affected machines. +--- + drivers/platform/x86/dell-laptop.c | 59 ++++++++++++++++++++++++++++++++---- + 1 file changed, 53 insertions(+), 6 deletions(-) + +diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c +index f57dd28..cddf3c2 100644 +--- a/drivers/platform/x86/dell-laptop.c ++++ b/drivers/platform/x86/dell-laptop.c +@@ -42,6 +42,7 @@ + #define KBD_LED_AUTO_50_TOKEN 0x02EB + #define KBD_LED_AUTO_75_TOKEN 0x02EC + #define KBD_LED_AUTO_100_TOKEN 0x02F6 ++#define KBD_LED_AC_TOKEN 0x0451 + + struct quirk_entry { + u8 touchpad_led; +@@ -1024,7 +1025,7 @@ static void touchpad_led_exit(void) + * bit 2 Pointing stick + * bit 3 Any mouse + * bits 4-7 Reserved for future use +- * cbRES2, byte3 Current Timeout ++ * cbRES2, byte3 Current Timeout on battery + * bits 7:6 Timeout units indicator: + * 00b Seconds + * 01b Minutes +@@ -1036,6 +1037,15 @@ static void touchpad_led_exit(void) + * cbRES3, byte0 Current setting of ALS value that turns the light on or off. + * cbRES3, byte1 Current ALS reading + * cbRES3, byte2 Current keyboard light level. ++ * cbRES3, byte3 Current timeout on AC Power ++ * bits 7:6 Timeout units indicator: ++ * 00b Seconds ++ * 01b Minutes ++ * 10b Hours ++ * 11b Days ++ * Bits 5:0 Timeout value (0-63) in sec/min/hr/day ++ * NOTE: A value of 0 means always on (no timeout) if any bits of RES3 byte2 ++ * are set upon return from the upon return from the [Get Feature information] call. + * + * cbArg1 0x2 = Set New State + * cbRES1 Standard return codes (0, -1, -2) +@@ -1058,7 +1068,7 @@ static void touchpad_led_exit(void) + * bit 2 Pointing stick + * bit 3 Any mouse + * bits 4-7 Reserved for future use +- * cbArg2, byte3 Desired Timeout ++ * cbArg2, byte3 Desired Timeout on battery + * bits 7:6 Timeout units indicator: + * 00b Seconds + * 01b Minutes +@@ -1067,6 +1077,13 @@ static void touchpad_led_exit(void) + * bits 5:0 Timeout value (0-63) in sec/min/hr/day + * cbArg3, byte0 Desired setting of ALS value that turns the light on or off. + * cbArg3, byte2 Desired keyboard light level. ++ * cbArg3, byte3 Desired Timeout on AC power ++ * bits 7:6 Timeout units indicator: ++ * 00b Seconds ++ * 01b Minutes ++ * 10b Hours ++ * 11b Days ++ * bits 5:0 Timeout value (0-63) in sec/min/hr/day + */ + + +@@ -1112,6 +1129,8 @@ struct kbd_state { + u8 triggers; + u8 timeout_value; + u8 timeout_unit; ++ u8 timeout_value_ac; ++ u8 timeout_unit_ac; + u8 als_setting; + u8 als_value; + u8 level; +@@ -1131,6 +1150,7 @@ struct kbd_state { + static struct kbd_info kbd_info; + static bool kbd_als_supported; + static bool kbd_triggers_supported; ++static bool kbd_timeout_ac_supported; + + static u8 kbd_mode_levels[16]; + static int kbd_mode_levels_count; +@@ -1269,6 +1289,8 @@ static int kbd_get_state(struct kbd_state *state) + state->als_setting = buffer->output[2] & 0xFF; + state->als_value = (buffer->output[2] >> 8) & 0xFF; + state->level = (buffer->output[2] >> 16) & 0xFF; ++ state->timeout_value_ac = (buffer->output[2] >> 24) & 0x3F; ++ state->timeout_unit_ac = (buffer->output[2] >> 30) & 0x3; + + out: + dell_smbios_release_buffer(); +@@ -1288,6 +1310,8 @@ static int kbd_set_state(struct kbd_state *state) + buffer->input[1] |= (state->timeout_unit & 0x3) << 30; + buffer->input[2] = state->als_setting & 0xFF; + buffer->input[2] |= (state->level & 0xFF) << 16; ++ buffer->input[2] |= (state->timeout_value_ac & 0x3F) << 24; ++ buffer->input[2] |= (state->timeout_unit_ac & 0x3) << 30; + dell_smbios_send_request(4, 11); + ret = buffer->output[0]; + dell_smbios_release_buffer(); +@@ -1394,6 +1418,13 @@ static inline int kbd_init_info(void) + if (ret) + return ret; + ++ /* NOTE: Old models without KBD_LED_AC_TOKEN token supports only one ++ * timeout value which is shared for both battery and AC power ++ * settings. So do not try to set AC values on old models. ++ */ ++ if (dell_smbios_find_token(KBD_LED_AC_TOKEN)) ++ kbd_timeout_ac_supported = true; ++ + kbd_get_state(&state); + + /* NOTE: timeout value is stored in 6 bits so max value is 63 */ +@@ -1573,8 +1604,14 @@ static ssize_t kbd_led_timeout_store(struct device *dev, + return ret; + + new_state = state; +- new_state.timeout_value = value; +- new_state.timeout_unit = unit; ++ ++ if (kbd_timeout_ac_supported && power_supply_is_system_supplied() > 0) { ++ new_state.timeout_value_ac = value; ++ new_state.timeout_unit_ac = unit; ++ } else { ++ new_state.timeout_value = value; ++ new_state.timeout_unit = unit; ++ } + + ret = kbd_set_state_safe(&new_state, &state); + if (ret) +@@ -1587,16 +1624,26 @@ static ssize_t kbd_led_timeout_show(struct device *dev, + struct device_attribute *attr, char *buf) + { + struct kbd_state state; ++ int value; + int ret; + int len; ++ u8 unit; + + ret = kbd_get_state(&state); + if (ret) + return ret; + +- len = sprintf(buf, "%d", state.timeout_value); ++ if (kbd_timeout_ac_supported && power_supply_is_system_supplied() > 0) { ++ value = state.timeout_value_ac; ++ unit = state.timeout_unit_ac; ++ } else { ++ value = state.timeout_value; ++ unit = state.timeout_unit; ++ } ++ ++ len = sprintf(buf, "%d", value); + +- switch (state.timeout_unit) { ++ switch (unit) { + case KBD_TIMEOUT_SECONDS: + return len + sprintf(buf+len, "s\n"); + case KBD_TIMEOUT_MINUTES: diff --git a/kernel-aarch64-debug.config b/kernel-aarch64-debug.config index 24424629a..3d89e6961 100644 --- a/kernel-aarch64-debug.config +++ b/kernel-aarch64-debug.config @@ -4255,6 +4255,7 @@ CONFIG_RMI4_I2C=m CONFIG_RMI4_SMB=m CONFIG_RMI4_SPI=m CONFIG_ROCKCHIP_ANALOGIX_DP=m +# CONFIG_ROCKCHIP_CDN_DP is not set CONFIG_ROCKCHIP_DW_HDMI=m CONFIG_ROCKCHIP_DW_MIPI_DSI=m CONFIG_ROCKCHIP_EFUSE=m diff --git a/kernel-aarch64.config b/kernel-aarch64.config index 95ecda6ca..505d4810a 100644 --- a/kernel-aarch64.config +++ b/kernel-aarch64.config @@ -4233,6 +4233,7 @@ CONFIG_RMI4_I2C=m CONFIG_RMI4_SMB=m CONFIG_RMI4_SPI=m CONFIG_ROCKCHIP_ANALOGIX_DP=m +# CONFIG_ROCKCHIP_CDN_DP is not set CONFIG_ROCKCHIP_DW_HDMI=m CONFIG_ROCKCHIP_DW_MIPI_DSI=m CONFIG_ROCKCHIP_EFUSE=m diff --git a/kernel-armv7hl-debug.config b/kernel-armv7hl-debug.config index 9e4321b25..2982f5267 100644 --- a/kernel-armv7hl-debug.config +++ b/kernel-armv7hl-debug.config @@ -4511,7 +4511,7 @@ CONFIG_REGMAP_SPI=y CONFIG_REGMAP_SPMI=m CONFIG_REGMAP=y # CONFIG_REGULATOR_88PM800 is not set -# CONFIG_REGULATOR_ACT8865 is not set +CONFIG_REGULATOR_ACT8865=m CONFIG_REGULATOR_AD5398=m CONFIG_REGULATOR_ANATOP=m CONFIG_REGULATOR_AS3722=m diff --git a/kernel-armv7hl-lpae-debug.config b/kernel-armv7hl-lpae-debug.config index 0710a1a1b..c04bb8517 100644 --- a/kernel-armv7hl-lpae-debug.config +++ b/kernel-armv7hl-lpae-debug.config @@ -4244,7 +4244,7 @@ CONFIG_REGMAP_IRQ=y CONFIG_REGMAP_MMIO=y CONFIG_REGMAP_SPI=y CONFIG_REGMAP=y -# CONFIG_REGULATOR_ACT8865 is not set +CONFIG_REGULATOR_ACT8865=m CONFIG_REGULATOR_AD5398=m # CONFIG_REGULATOR_ANATOP is not set CONFIG_REGULATOR_AS3722=m diff --git a/kernel-armv7hl-lpae.config b/kernel-armv7hl-lpae.config index fd495dd52..2f48a6c6a 100644 --- a/kernel-armv7hl-lpae.config +++ b/kernel-armv7hl-lpae.config @@ -4222,7 +4222,7 @@ CONFIG_REGMAP_IRQ=y CONFIG_REGMAP_MMIO=y CONFIG_REGMAP_SPI=y CONFIG_REGMAP=y -# CONFIG_REGULATOR_ACT8865 is not set +CONFIG_REGULATOR_ACT8865=m CONFIG_REGULATOR_AD5398=m # CONFIG_REGULATOR_ANATOP is not set CONFIG_REGULATOR_AS3722=m diff --git a/kernel-armv7hl.config b/kernel-armv7hl.config index 9d2612878..d6dc918c2 100644 --- a/kernel-armv7hl.config +++ b/kernel-armv7hl.config @@ -4489,7 +4489,7 @@ CONFIG_REGMAP_SPI=y CONFIG_REGMAP_SPMI=m CONFIG_REGMAP=y # CONFIG_REGULATOR_88PM800 is not set -# CONFIG_REGULATOR_ACT8865 is not set +CONFIG_REGULATOR_ACT8865=m CONFIG_REGULATOR_AD5398=m CONFIG_REGULATOR_ANATOP=m CONFIG_REGULATOR_AS3722=m diff --git a/kernel.spec b/kernel.spec index f2e556852..962d263e0 100644 --- a/kernel.spec +++ b/kernel.spec @@ -58,7 +58,7 @@ Summary: The Linux kernel %define stable_rc 0 # Do we have a -stable update to apply? -%define stable_update 4 +%define stable_update 5 # Set rpm version accordingly %if 0%{?stable_update} %define stablerev %{stable_update} @@ -640,6 +640,9 @@ Patch502: firmware-Drop-WARN-from-usermodehelper_read_trylock-.patch Patch509: MODSIGN-Don-t-try-secure-boot-if-EFI-runtime-is-disa.patch +# rhbz 1436686 +Patch600: dell-laptop-Adds-support-for-keyboard-backlight-timeout-AC-settings.patch + #CVE-2016-3134 rhbz 1317383 1317384 Patch665: netfilter-x_tables-deal-with-bogus-nextoffset-values.patch @@ -670,6 +673,9 @@ Patch679: actual_udpencap_fix.patch Patch680: 0001-platform-x86-thinkpad_acpi-guard-generic-hotkey-case.patch Patch681: 0002-platform-x86-thinkpad_acpi-add-mapping-for-new-hotke.patch +# rhbz 1461337 +Patch682: 0001-efi-Fix-boot-panic-because-of-invalid-BGRT-image-add.patch + # END OF PATCH DEFINITIONS %endif @@ -2238,6 +2244,15 @@ fi # # %changelog +* Wed Jun 14 2017 Laura Abbott <labbott@fedoraproject.org> - 4.11.5-300 +- Linux v4.11.5 + +* Wed Jun 14 2017 Peter Robinson <pbrobinson@fedoraproject.org> +- Minor fixes for sun8i-dwmac plus extra device support + +* Wed Jun 14 2017 Laura Abbott <labbott@fedoraproject.org> +- Add fix for EFI BGRT crash (rhbz 1461337) + * Wed Jun 07 2017 Laura Abbott <labbott@fedoraproject.org> - 4.11.4-300 - Linux v4.11.4 @@ -1,3 +1,3 @@ SHA512 (perf-man-4.11.tar.gz) = 0b070d2f10a743329de2f532e2d7e19ef385a3e6ef3c700b591ae2697604dbe542b36e31121b3e37517ee8071ab800386fa8663c24a5b36520a18e096c6eefc8 SHA512 (linux-4.11.tar.xz) = 6610eed97ffb7207c71771198c36179b8244ace7222bebb109507720e26c5f17d918079a56d5febdd8605844d67fb2df0ebe910fa2f2f53690daf6e2a8ad09c3 -SHA512 (patch-4.11.4.xz) = d38c48994e852c51f126d362faae0ee939043917287223e68eac84c59b43cda5908e5a31af6aa6b0fc1aeecbbc6d89b6c6351fefbc51c0becb9a7223f38a2c7b +SHA512 (patch-4.11.5.xz) = c337470c79961c88b806a449ee3bbb3b5428c1f1d6751133de00b67901a6ad8db2ed8899e0b5ca89ff902f29f58a6721053d25e286a2120e7cf2e578907c8645 |