From 26e03c2621f2fbefe6ce861c7e26fb8228bbcc3e Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Wed, 9 Dec 2015 23:48:47 +0000 Subject: [PATCH 01/15] Update to 4.3.1 --- debian/changelog | 7 ++++ ...rcept-ac-to-avoid-guest-host-exploit.patch | 38 ------------------- ...id-guest-host-dos-by-intercepting-ac.patch | 34 ----------------- debian/patches/series | 2 - 4 files changed, 7 insertions(+), 74 deletions(-) delete mode 100644 debian/patches/bugfix/x86/kvm-x86-svm-intercept-ac-to-avoid-guest-host-exploit.patch delete mode 100644 debian/patches/bugfix/x86/kvm-x86-vmx-avoid-guest-host-dos-by-intercepting-ac.patch diff --git a/debian/changelog b/debian/changelog index bc7fb0a3f..16689447c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +linux (4.3.1-1~exp1) UNRELEASED; urgency=medium + + * New upstream stable update: + https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.3.1 + + -- Ben Hutchings Wed, 09 Dec 2015 23:20:32 +0000 + linux (4.3-1~exp2) experimental; urgency=medium [ Ben Hutchings ] diff --git a/debian/patches/bugfix/x86/kvm-x86-svm-intercept-ac-to-avoid-guest-host-exploit.patch b/debian/patches/bugfix/x86/kvm-x86-svm-intercept-ac-to-avoid-guest-host-exploit.patch deleted file mode 100644 index b8ffd077f..000000000 --- a/debian/patches/bugfix/x86/kvm-x86-svm-intercept-ac-to-avoid-guest-host-exploit.patch +++ /dev/null @@ -1,38 +0,0 @@ -Subject: KVM x86 SVM: intercept #AC to avoid guest->host exploit - ---- -M arch/x86/kvm/svm.c -1 file changed, 8 insertions(+), 0 deletions(-) - - ---- a/arch/x86/kvm/svm.c -+++ b/arch/x86/kvm/svm.c -@@ -1106,6 +1106,7 @@ static void init_vmcb(struct vcpu_svm *s - set_exception_intercept(svm, PF_VECTOR); - set_exception_intercept(svm, UD_VECTOR); - set_exception_intercept(svm, MC_VECTOR); -+ set_exception_intercept(svm, AC_VECTOR); - - set_intercept(svm, INTERCEPT_INTR); - set_intercept(svm, INTERCEPT_NMI); -@@ -1795,6 +1796,12 @@ static int ud_interception(struct vcpu_s - return 1; - } - -+static int ac_interception(struct vcpu_svm *svm) -+{ -+ kvm_queue_exception_e(&svm->vcpu, AC_VECTOR, 0); -+ return 1; -+} -+ - static void svm_fpu_activate(struct kvm_vcpu *vcpu) - { - struct vcpu_svm *svm = to_svm(vcpu); -@@ -3369,6 +3376,7 @@ static int (*const svm_exit_handlers[])( - [SVM_EXIT_EXCP_BASE + PF_VECTOR] = pf_interception, - [SVM_EXIT_EXCP_BASE + NM_VECTOR] = nm_interception, - [SVM_EXIT_EXCP_BASE + MC_VECTOR] = mc_interception, -+ [SVM_EXIT_EXCP_BASE + AC_VECTOR] = ac_interception, - [SVM_EXIT_INTR] = intr_interception, - [SVM_EXIT_NMI] = nmi_interception, - [SVM_EXIT_SMI] = nop_on_interception, diff --git a/debian/patches/bugfix/x86/kvm-x86-vmx-avoid-guest-host-dos-by-intercepting-ac.patch b/debian/patches/bugfix/x86/kvm-x86-vmx-avoid-guest-host-dos-by-intercepting-ac.patch deleted file mode 100644 index 79ed6243d..000000000 --- a/debian/patches/bugfix/x86/kvm-x86-vmx-avoid-guest-host-dos-by-intercepting-ac.patch +++ /dev/null @@ -1,34 +0,0 @@ -From: Eric Northup -Date: Thu Sep 10 11:36:28 2015 -0700 -Subject: KVM x86 vmx: avoid guest->host DOS by intercepting #AC - -A pathological (or malicious) guest can hang a host core by -mis-configuring its GDT/IDT and enabling alignment checks. - -[bwh: Forward-ported to 4.2: AC_VECTOR is already defined so don't add it] - ---- a/arch/x86/kvm/vmx.c -+++ b/arch/x86/kvm/vmx.c -@@ -1567,7 +1567,7 @@ static void update_exception_bitmap(stru - u32 eb; - - eb = (1u << PF_VECTOR) | (1u << UD_VECTOR) | (1u << MC_VECTOR) | -- (1u << NM_VECTOR) | (1u << DB_VECTOR); -+ (1u << NM_VECTOR) | (1u << DB_VECTOR) | (1u << AC_VECTOR); - if ((vcpu->guest_debug & - (KVM_GUESTDBG_ENABLE | KVM_GUESTDBG_USE_SW_BP)) == - (KVM_GUESTDBG_ENABLE | KVM_GUESTDBG_USE_SW_BP)) -@@ -5146,6 +5146,13 @@ static int handle_exception(struct kvm_v - kvm_run->debug.arch.pc = vmcs_readl(GUEST_CS_BASE) + rip; - kvm_run->debug.arch.exception = ex_no; - break; -+ case AC_VECTOR: -+ /* -+ * We have already enabled interrupts and pre-emption, so -+ * it's OK to loop here if that is what will happen. -+ */ -+ kvm_queue_exception_e(vcpu, AC_VECTOR, error_code); -+ return 1; - default: - kvm_run->exit_reason = KVM_EXIT_EXCEPTION; - kvm_run->ex.exception = ex_no; diff --git a/debian/patches/series b/debian/patches/series index 8c104897b..7c917d70b 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -87,8 +87,6 @@ bugfix/all/selftests-vm-try-harder-to-allocate-huge-pages.patch bugfix/all/selftests-breakpoints-actually-build-it.patch bugfix/all/rds-fix-race-condition-when-sending-a-message-on-unbound-socket.patch bugfix/all/media-media-vivid-osd-fix-info-leak-in-ioctl.patch -bugfix/x86/kvm-x86-vmx-avoid-guest-host-dos-by-intercepting-ac.patch -bugfix/x86/kvm-x86-svm-intercept-ac-to-avoid-guest-host-exploit.patch bugfix/x86/kvm-svm-unconditionally-intercept-DB.patch bugfix/x86/kvm-x86-rename-update_db_bp_intercept-to-update_bp_i.patch bugfix/all/usbvision-fix-overflow-of-interfaces-array.patch From 602f5b40472cea907590030b7c1248da13c771f5 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Wed, 9 Dec 2015 23:49:11 +0000 Subject: [PATCH 02/15] Set ABI to 1 --- debian/changelog | 3 +++ debian/config/defines | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 16689447c..4e727f404 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,9 @@ linux (4.3.1-1~exp1) UNRELEASED; urgency=medium * New upstream stable update: https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.3.1 + [ Ben Hutchings ] + * Set ABI to 1 + -- Ben Hutchings Wed, 09 Dec 2015 23:20:32 +0000 linux (4.3-1~exp2) experimental; urgency=medium diff --git a/debian/config/defines b/debian/config/defines index b7abd466c..8194a2f01 100644 --- a/debian/config/defines +++ b/debian/config/defines @@ -1,5 +1,5 @@ [abi] -abiname: trunk +abiname: 1 [base] arches: From b9adbeeabeba0dc5aa776e20e781d2d46e784b71 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Fri, 11 Dec 2015 12:21:29 +0000 Subject: [PATCH 03/15] [armhf] rtc: Enable RTC_DRV_DS1307, RTC_DRV_PCF8563 (Closes: #807632) --- debian/changelog | 1 + debian/config/armhf/config.armmp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/debian/changelog b/debian/changelog index 4e727f404..77386af8a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,7 @@ linux (4.3.1-1~exp1) UNRELEASED; urgency=medium [ Ben Hutchings ] * Set ABI to 1 + * [armhf] rtc: Enable RTC_DRV_DS1307, RTC_DRV_PCF8563 (Closes: #807632) -- Ben Hutchings Wed, 09 Dec 2015 23:20:32 +0000 diff --git a/debian/config/armhf/config.armmp b/debian/config/armhf/config.armmp index 285f9c3e7..8dec08808 100644 --- a/debian/config/armhf/config.armmp +++ b/debian/config/armhf/config.armmp @@ -757,9 +757,11 @@ CONFIG_REGULATOR_VEXPRESS=m ## file: drivers/rtc/Kconfig ## CONFIG_RTC_DRV_AS3722=y +CONFIG_RTC_DRV_DS1307=y CONFIG_RTC_DRV_ISL12057=y CONFIG_RTC_DRV_PALMAS=y CONFIG_RTC_DRV_PCF8523=y +CONFIG_RTC_DRV_PCF8563=y CONFIG_RTC_DRV_TWL4030=y CONFIG_RTC_DRV_S5M=y CONFIG_RTC_DRV_DA9052=y From ea6701206722204dcf777c500f3452c744136129 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Fri, 11 Dec 2015 16:56:37 +0000 Subject: [PATCH 04/15] [armhf] Enable MACH_ARMADA_375, MACH_ARMADA_38X, MACH_ARMADA_39X, RTC_DRV_ARMADA38X (Closes: #807633) --- debian/changelog | 5 ++++- debian/config/armhf/config.armmp | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 77386af8a..9ce0cb752 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,7 +5,10 @@ linux (4.3.1-1~exp1) UNRELEASED; urgency=medium [ Ben Hutchings ] * Set ABI to 1 - * [armhf] rtc: Enable RTC_DRV_DS1307, RTC_DRV_PCF8563 (Closes: #807632) + * [armhf] rtc: Enable RTC_DRV_DS1307, RTC_DRV_PCF8563, RTC_DRV_ARMADA38X + (Closes: #807632) + * [armhf] Enable MACH_ARMADA_375, MACH_ARMADA_38X, MACH_ARMADA_39X + (Closes: #807633) -- Ben Hutchings Wed, 09 Dec 2015 23:20:32 +0000 diff --git a/debian/config/armhf/config.armmp b/debian/config/armhf/config.armmp index 8dec08808..f0138ed69 100644 --- a/debian/config/armhf/config.armmp +++ b/debian/config/armhf/config.armmp @@ -59,6 +59,9 @@ CONFIG_SOC_IMX6Q=y ## CONFIG_ARCH_MVEBU=y CONFIG_MACH_ARMADA_370=y +CONFIG_MACH_ARMADA_375=y +CONFIG_MACH_ARMADA_38X=y +CONFIG_MACH_ARMADA_39X=y CONFIG_MACH_ARMADA_XP=y ## @@ -773,6 +776,7 @@ CONFIG_RTC_DRV_VT8500=y CONFIG_RTC_DRV_SUN6I=y CONFIG_RTC_DRV_SUNXI=y CONFIG_RTC_DRV_MV=y +CONFIG_RTC_DRV_ARMADA38X=y CONFIG_RTC_DRV_MC13XXX=y CONFIG_RTC_DRV_TEGRA=y CONFIG_RTC_DRV_MXC=y From dc05a59cb175fdca1d4ab9498dec016b2031e981 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Fri, 11 Dec 2015 17:00:45 +0000 Subject: [PATCH 05/15] [armhf] net: Enable MVPP2 as module --- debian/changelog | 1 + debian/config/armhf/config.armmp | 1 + 2 files changed, 2 insertions(+) diff --git a/debian/changelog b/debian/changelog index 9ce0cb752..8d10d9517 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,6 +9,7 @@ linux (4.3.1-1~exp1) UNRELEASED; urgency=medium (Closes: #807632) * [armhf] Enable MACH_ARMADA_375, MACH_ARMADA_38X, MACH_ARMADA_39X (Closes: #807633) + * [armhf] net: Enable MVPP2 as module -- Ben Hutchings Wed, 09 Dec 2015 23:20:32 +0000 diff --git a/debian/config/armhf/config.armmp b/debian/config/armhf/config.armmp index f0138ed69..1952640fd 100644 --- a/debian/config/armhf/config.armmp +++ b/debian/config/armhf/config.armmp @@ -563,6 +563,7 @@ CONFIG_E100=m ## CONFIG_MVMDIO=m CONFIG_MVNETA=m +CONFIG_MVPP2=m ## ## file: drivers/net/ethernet/microchip/Kconfig From d89f74a7bada999e5c5b8ac45a78338f315c96bf Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Fri, 11 Dec 2015 18:36:54 +0000 Subject: [PATCH 06/15] [armel/kirkwood] dts: Fix QNAP TS219 power-off (Closes: #807696) --- debian/changelog | 1 + ...ts-kirkwood-fix-qnap-ts219-power-off.patch | 31 +++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 33 insertions(+) create mode 100644 debian/patches/bugfix/arm/arm-dts-kirkwood-fix-qnap-ts219-power-off.patch diff --git a/debian/changelog b/debian/changelog index 8d10d9517..58cdd9895 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,7 @@ linux (4.3.1-1~exp1) UNRELEASED; urgency=medium * [armhf] Enable MACH_ARMADA_375, MACH_ARMADA_38X, MACH_ARMADA_39X (Closes: #807633) * [armhf] net: Enable MVPP2 as module + * [armel/kirkwood] dts: Fix QNAP TS219 power-off (Closes: #807696) -- Ben Hutchings Wed, 09 Dec 2015 23:20:32 +0000 diff --git a/debian/patches/bugfix/arm/arm-dts-kirkwood-fix-qnap-ts219-power-off.patch b/debian/patches/bugfix/arm/arm-dts-kirkwood-fix-qnap-ts219-power-off.patch new file mode 100644 index 000000000..76ebec98f --- /dev/null +++ b/debian/patches/bugfix/arm/arm-dts-kirkwood-fix-qnap-ts219-power-off.patch @@ -0,0 +1,31 @@ +From: Helmut Klein +Date: Wed, 11 Nov 2015 15:03:04 +0100 +Subject: ARM: dts: Kirkwood: Fix QNAP TS219 power-off +Origin: https://git.kernel.org/linus/5442f0eadf2885453d5b2ed8c8592f32a3744f8e + +The "reg" entry in the "poweroff" section of "kirkwood-ts219.dtsi" +addressed the wrong uart (0 = console). This patch changes the address +to select uart 1, which is the uart connected to the pic +microcontroller, which can switch the device off. + +Signed-off-by: Helmut Klein +Signed-off-by: Andrew Lunn +Fixes: 4350a47bbac3 ("ARM: Kirkwood: Make use of the QNAP Power off driver.") +Signed-off-by: Gregory CLEMENT +--- + arch/arm/boot/dts/kirkwood-ts219.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm/boot/dts/kirkwood-ts219.dtsi b/arch/arm/boot/dts/kirkwood-ts219.dtsi +index c56ab6b..0e46560 100644 +--- a/arch/arm/boot/dts/kirkwood-ts219.dtsi ++++ b/arch/arm/boot/dts/kirkwood-ts219.dtsi +@@ -40,7 +40,7 @@ + }; + poweroff@12100 { + compatible = "qnap,power-off"; +- reg = <0x12000 0x100>; ++ reg = <0x12100 0x100>; + clocks = <&gate_clk 7>; + }; + spi@10600 { diff --git a/debian/patches/series b/debian/patches/series index 7c917d70b..d18da730c 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -96,3 +96,4 @@ bugfix/all/isdn_ppp-add-checks-for-allocation-failure-in-isdn_p.patch bugfix/all/ppp-slip-validate-vj-compression-slot-parameters-com.patch bugfix/all/btrfs-fix-truncation-of-compressed-and-inlined-exten.patch bugfix/x86/drm-i915-shut-up-gen8-sde-irq-dmesg-noise.patch +bugfix/arm/arm-dts-kirkwood-fix-qnap-ts219-power-off.patch From 9b8687a49d26870bc95188c0617e5f470c137336 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sat, 12 Dec 2015 22:35:04 +0000 Subject: [PATCH 07/15] [armhf] udeb: Add leds-modules package containing leds-gpio driver (Closes: #807721) --- debian/changelog | 2 ++ debian/installer/armhf/modules/armhf-armmp/leds-modules | 1 + debian/installer/modules/leds-modules | 1 + 3 files changed, 4 insertions(+) create mode 100644 debian/installer/armhf/modules/armhf-armmp/leds-modules create mode 100644 debian/installer/modules/leds-modules diff --git a/debian/changelog b/debian/changelog index 58cdd9895..2715b61f6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -11,6 +11,8 @@ linux (4.3.1-1~exp1) UNRELEASED; urgency=medium (Closes: #807633) * [armhf] net: Enable MVPP2 as module * [armel/kirkwood] dts: Fix QNAP TS219 power-off (Closes: #807696) + * [armhf] udeb: Add leds-modules package containing leds-gpio driver + (Closes: #807721) -- Ben Hutchings Wed, 09 Dec 2015 23:20:32 +0000 diff --git a/debian/installer/armhf/modules/armhf-armmp/leds-modules b/debian/installer/armhf/modules/armhf-armmp/leds-modules new file mode 100644 index 000000000..85d9f2565 --- /dev/null +++ b/debian/installer/armhf/modules/armhf-armmp/leds-modules @@ -0,0 +1 @@ +#include diff --git a/debian/installer/modules/leds-modules b/debian/installer/modules/leds-modules new file mode 100644 index 000000000..fef2e5303 --- /dev/null +++ b/debian/installer/modules/leds-modules @@ -0,0 +1 @@ +leds-gpio From efc870db168e3e953d8d01dd4820d71ad6e2d3aa Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sat, 12 Dec 2015 22:53:37 +0000 Subject: [PATCH 08/15] [x86] drm/i915: Mark uneven memory banks on gen4 desktop as unknown swizzling (Closes: #780363) --- debian/changelog | 2 + ...even-memory-banks-on-gen4-desktop-as.patch | 115 ++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 118 insertions(+) create mode 100644 debian/patches/bugfix/x86/drm-i915-mark-uneven-memory-banks-on-gen4-desktop-as.patch diff --git a/debian/changelog b/debian/changelog index 2715b61f6..2e9405c2d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,6 +13,8 @@ linux (4.3.1-1~exp1) UNRELEASED; urgency=medium * [armel/kirkwood] dts: Fix QNAP TS219 power-off (Closes: #807696) * [armhf] udeb: Add leds-modules package containing leds-gpio driver (Closes: #807721) + * [x86] drm/i915: Mark uneven memory banks on gen4 desktop as unknown + swizzling (Closes: #780363) -- Ben Hutchings Wed, 09 Dec 2015 23:20:32 +0000 diff --git a/debian/patches/bugfix/x86/drm-i915-mark-uneven-memory-banks-on-gen4-desktop-as.patch b/debian/patches/bugfix/x86/drm-i915-mark-uneven-memory-banks-on-gen4-desktop-as.patch new file mode 100644 index 000000000..d430fabc9 --- /dev/null +++ b/debian/patches/bugfix/x86/drm-i915-mark-uneven-memory-banks-on-gen4-desktop-as.patch @@ -0,0 +1,115 @@ +From: Chris Wilson +Date: Thu, 19 Nov 2015 09:58:05 +0000 +Subject: drm/i915: Mark uneven memory banks on gen4 desktop as unknown + swizzling +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +Origin: http://cgit.freedesktop.org/drm-intel/commit?id=a53f2afb7e3dfc2c7acbb0c015b44783d99d8119 +Bug-Debian: https://bugs.debian.org/780363 + +We have varied reports of swizzling corruption on gen4 desktop, and +confirmation that one at least is triggered by uneven memory banks +(L-shaped memory). The implication is that the swizzling varies between +the paired channels and the remainder of memory on the single channel. As +the object then has unpredictable swizzling (it will vary depending on +exact page allocation and may even change during the object's lifetime as +the pages are replaced), we have to report to userspace that the swizzling +is unknown. + +However, some existing userspace is buggy when it meets an unknown +swizzling configuration and so we need to tell another white lie and +mark the swizzling as NONE but report it as UNKNOWN through the extended +get-tiling-ioctl. See + +commit 5eb3e5a5e11d14f9deb2a4b83555443b69ab9940 +Author: Chris Wilson +Date: Sun Jun 28 09:19:26 2015 +0100 + + drm/i915: Declare the swizzling unknown for L-shaped configurations + +for the previous example where we found that telling the truth to +userspace just ends up in a world of hurt. + +Also since we don't truly know what the swizzling is on the pages, we +need to keep them pinned to prevent swapping as the reports also +suggest that some gen4 devices have previously undetected bit17 +swizzling. + +v2: Combine unknown + quirk patches to prevent userspace ever seeing +unknown swizzling through the normal get-tiling-ioctl. Also use the same +path for the existing uneven bank detection for mobile gen4. + +Reported-by: Matti Hämäläinen +Tested-by: Matti Hämäläinen +References: https://bugs.freedesktop.org/show_bug.cgi?id=90725 +Signed-off-by: Chris Wilson +Cc: Matti Hämäläinen +Cc: Daniel Vetter +Cc: Jani Nikula +Cc: stable@vger.kernel.org +Reviewed-by: Daniel Vetter +Link: http://patchwork.freedesktop.org/patch/msgid/1447927085-31726-1-git-send-email-chris@chris-wilson.co.uk +Signed-off-by: Jani Nikula +--- + drivers/gpu/drm/i915/i915_gem_fence.c | 36 ++++++++++++++++++++++++++--------- + 1 file changed, 27 insertions(+), 9 deletions(-) + +--- a/drivers/gpu/drm/i915/i915_gem_fence.c ++++ b/drivers/gpu/drm/i915/i915_gem_fence.c +@@ -647,11 +647,10 @@ i915_gem_detect_bit_6_swizzle(struct drm + } + + /* check for L-shaped memory aka modified enhanced addressing */ +- if (IS_GEN4(dev)) { +- uint32_t ddc2 = I915_READ(DCC2); +- +- if (!(ddc2 & DCC2_MODIFIED_ENHANCED_DISABLE)) +- dev_priv->quirks |= QUIRK_PIN_SWIZZLED_PAGES; ++ if (IS_GEN4(dev) && ++ !(I915_READ(DCC2) & DCC2_MODIFIED_ENHANCED_DISABLE)) { ++ swizzle_x = I915_BIT_6_SWIZZLE_UNKNOWN; ++ swizzle_y = I915_BIT_6_SWIZZLE_UNKNOWN; + } + + if (dcc == 0xffffffff) { +@@ -680,16 +679,35 @@ i915_gem_detect_bit_6_swizzle(struct drm + * matching, which was the case for the swizzling required in + * the table above, or from the 1-ch value being less than + * the minimum size of a rank. ++ * ++ * Reports indicate that the swizzling actually ++ * varies depending upon page placement inside the ++ * channels, i.e. we see swizzled pages where the ++ * banks of memory are paired and unswizzled on the ++ * uneven portion, so leave that as unknown. + */ +- if (I915_READ16(C0DRB3) != I915_READ16(C1DRB3)) { +- swizzle_x = I915_BIT_6_SWIZZLE_NONE; +- swizzle_y = I915_BIT_6_SWIZZLE_NONE; +- } else { ++ if (I915_READ16(C0DRB3) == I915_READ16(C1DRB3)) { + swizzle_x = I915_BIT_6_SWIZZLE_9_10; + swizzle_y = I915_BIT_6_SWIZZLE_9; + } + } + ++ if (swizzle_x == I915_BIT_6_SWIZZLE_UNKNOWN || ++ swizzle_y == I915_BIT_6_SWIZZLE_UNKNOWN) { ++ /* Userspace likes to explode if it sees unknown swizzling, ++ * so lie. We will finish the lie when reporting through ++ * the get-tiling-ioctl by reporting the physical swizzle ++ * mode as unknown instead. ++ * ++ * As we don't strictly know what the swizzling is, it may be ++ * bit17 dependent, and so we need to also prevent the pages ++ * from being moved. ++ */ ++ dev_priv->quirks |= QUIRK_PIN_SWIZZLED_PAGES; ++ swizzle_x = I915_BIT_6_SWIZZLE_NONE; ++ swizzle_y = I915_BIT_6_SWIZZLE_NONE; ++ } ++ + dev_priv->mm.bit_6_swizzle_x = swizzle_x; + dev_priv->mm.bit_6_swizzle_y = swizzle_y; + } diff --git a/debian/patches/series b/debian/patches/series index d18da730c..feaab99d1 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -97,3 +97,4 @@ bugfix/all/ppp-slip-validate-vj-compression-slot-parameters-com.patch bugfix/all/btrfs-fix-truncation-of-compressed-and-inlined-exten.patch bugfix/x86/drm-i915-shut-up-gen8-sde-irq-dmesg-noise.patch bugfix/arm/arm-dts-kirkwood-fix-qnap-ts219-power-off.patch +bugfix/x86/drm-i915-mark-uneven-memory-banks-on-gen4-desktop-as.patch From 0f2fe8b81a29edc5f240ec2a4e7d32eda734fd83 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sat, 12 Dec 2015 23:45:20 +0000 Subject: [PATCH 09/15] Enable CC_STACKPROTECTOR_STRONG (Closes: #805652) --- debian/changelog | 1 + debian/config/armel/config-reduced | 4 ++++ debian/config/config | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 2e9405c2d..6577afb12 100644 --- a/debian/changelog +++ b/debian/changelog @@ -15,6 +15,7 @@ linux (4.3.1-1~exp1) UNRELEASED; urgency=medium (Closes: #807721) * [x86] drm/i915: Mark uneven memory banks on gen4 desktop as unknown swizzling (Closes: #780363) + * Enable CC_STACKPROTECTOR_STRONG (Closes: #805652) -- Ben Hutchings Wed, 09 Dec 2015 23:20:32 +0000 diff --git a/debian/config/armel/config-reduced b/debian/config/armel/config-reduced index 2606fd14f..7392e0dc9 100644 --- a/debian/config/armel/config-reduced +++ b/debian/config/armel/config-reduced @@ -2,6 +2,10 @@ ## file: arch/Kconfig ## # CONFIG_KPROBES is not set +## choice: Stack Protector buffer overflow detection +CONFIG_CC_STACKPROTECTOR_REGULAR=y +# CONFIG_CC_STACKPROTECTOR_STRONG is not set +## end choice ## ## file: block/Kconfig.iosched diff --git a/debian/config/config b/debian/config/config index 5dbc43a6e..aef085974 100644 --- a/debian/config/config +++ b/debian/config/config @@ -5,7 +5,7 @@ CONFIG_OPROFILE=m CONFIG_KPROBES=y CONFIG_JUMP_LABEL=y ## choice: Stack Protector buffer overflow detection -CONFIG_CC_STACKPROTECTOR_REGULAR=y +CONFIG_CC_STACKPROTECTOR_STRONG=y ## end choice ## From 7a68d42a2b3e2ec22c4ddfa39a5ddaef2c4b0197 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sat, 12 Dec 2015 23:53:41 +0000 Subject: [PATCH 10/15] [x86] input: Enable KEYBOARD_GPIO, INPUT_SOC_BUTTON_ARRAY (Closes: #804864) --- debian/changelog | 1 + debian/config/kernelarch-x86/config | 2 ++ debian/installer/modules/input-modules | 2 ++ 3 files changed, 5 insertions(+) diff --git a/debian/changelog b/debian/changelog index 6577afb12..fa2a4d54c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -16,6 +16,7 @@ linux (4.3.1-1~exp1) UNRELEASED; urgency=medium * [x86] drm/i915: Mark uneven memory banks on gen4 desktop as unknown swizzling (Closes: #780363) * Enable CC_STACKPROTECTOR_STRONG (Closes: #805652) + * [x86] input: Enable KEYBOARD_GPIO, INPUT_SOC_BUTTON_ARRAY (Closes: #804864) -- Ben Hutchings Wed, 09 Dec 2015 23:20:32 +0000 diff --git a/debian/config/kernelarch-x86/config b/debian/config/kernelarch-x86/config index c91333518..66f7fb91b 100644 --- a/debian/config/kernelarch-x86/config +++ b/debian/config/kernelarch-x86/config @@ -711,6 +711,7 @@ CONFIG_INPUT_JOYSTICK=y CONFIG_INPUT_KEYBOARD=y CONFIG_KEYBOARD_ATKBD=y CONFIG_KEYBOARD_LKKBD=m +CONFIG_KEYBOARD_GPIO=m CONFIG_KEYBOARD_NEWTON=m CONFIG_KEYBOARD_SUNKBD=m CONFIG_KEYBOARD_XTKBD=m @@ -724,6 +725,7 @@ CONFIG_INPUT_APANEL=m CONFIG_INPUT_ATLAS_BTNS=m CONFIG_INPUT_UINPUT=m CONFIG_INPUT_IDEAPAD_SLIDEBAR=m +CONFIG_INPUT_SOC_BUTTON_ARRAY=m ## ## file: drivers/input/mouse/Kconfig diff --git a/debian/installer/modules/input-modules b/debian/installer/modules/input-modules index 55c440b2c..bfc4dda29 100644 --- a/debian/installer/modules/input-modules +++ b/debian/installer/modules/input-modules @@ -30,3 +30,5 @@ synaptics_usb ? wistron_btns ? i2c-hid ? virtio-input ? +gpio_keys ? +soc_button_array ? From 405f12a12b6d6b2fdf4b31336867676683a1dae8 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sun, 13 Dec 2015 00:04:40 +0000 Subject: [PATCH 11/15] [x86] nouveau: bios: return actual size of the buffer retrieved via _ROM (Closes: #772716) --- debian/changelog | 2 ++ ...ize-of-the-buffer-retrieved-via-_rom.patch | 25 +++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 28 insertions(+) create mode 100644 debian/patches/bugfix/x86/bios-return-actual-size-of-the-buffer-retrieved-via-_rom.patch diff --git a/debian/changelog b/debian/changelog index fa2a4d54c..dd297550d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -17,6 +17,8 @@ linux (4.3.1-1~exp1) UNRELEASED; urgency=medium swizzling (Closes: #780363) * Enable CC_STACKPROTECTOR_STRONG (Closes: #805652) * [x86] input: Enable KEYBOARD_GPIO, INPUT_SOC_BUTTON_ARRAY (Closes: #804864) + * [x86] nouveau: bios: return actual size of the buffer retrieved via _ROM + (Closes: #772716) -- Ben Hutchings Wed, 09 Dec 2015 23:20:32 +0000 diff --git a/debian/patches/bugfix/x86/bios-return-actual-size-of-the-buffer-retrieved-via-_rom.patch b/debian/patches/bugfix/x86/bios-return-actual-size-of-the-buffer-retrieved-via-_rom.patch new file mode 100644 index 000000000..ef2f72c9a --- /dev/null +++ b/debian/patches/bugfix/x86/bios-return-actual-size-of-the-buffer-retrieved-via-_rom.patch @@ -0,0 +1,25 @@ +From: Ben Skeggs +Date: Thu, 19 Nov 2015 13:18:34 +1000 +Subject: bios: return actual size of the buffer retrieved via _ROM +Origin: http://cgit.freedesktop.org/~darktama/nouveau/commit/?id=fcd74e81e65aee8a2a33bdca3142a5358dac7582 +Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90626 +Bug-Debian: https://bugs.debian.org/772716 + +Fixes detection of a failed attempt at fetching the entire ROM image +in one-shot (a violation of the spec, that works a lot of the time). + +Tested on a HP Zbook 15 G2. + +Signed-off-by: Ben Skeggs +[bwh: Adjust filename for in-tree driver] + +--- a/drivers/gpu/drm/nouveau/nouveau_acpi.c ++++ b/drivers/gpu/drm/nouveau/nouveau_acpi.c +@@ -367,6 +367,7 @@ static int nouveau_rom_call(acpi_handle rom_handle, uint8_t *bios, + return -ENODEV; + } + obj = (union acpi_object *)buffer.pointer; ++ len = min(len, (int)obj->buffer.length); + memcpy(bios+offset, obj->buffer.pointer, len); + kfree(buffer.pointer); + return len; diff --git a/debian/patches/series b/debian/patches/series index feaab99d1..803c64b6e 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -98,3 +98,4 @@ bugfix/all/btrfs-fix-truncation-of-compressed-and-inlined-exten.patch bugfix/x86/drm-i915-shut-up-gen8-sde-irq-dmesg-noise.patch bugfix/arm/arm-dts-kirkwood-fix-qnap-ts219-power-off.patch bugfix/x86/drm-i915-mark-uneven-memory-banks-on-gen4-desktop-as.patch +bugfix/x86/bios-return-actual-size-of-the-buffer-retrieved-via-_rom.patch From 2f385335951d406f7bb705b2a4da4a447e5b5c0f Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sun, 13 Dec 2015 00:14:50 +0000 Subject: [PATCH 12/15] [armhf] Add support for Odroid-XU4 (Closes: #804850) --- debian/changelog | 5 + ...ort-odroid-xu4-board-for-exynos5422-.patch | 294 ++++++++++++++++++ ...r-off-method-for-exynos5422-odroidxu.patch | 35 +++ ...dio-configuration-to-separate-exynos.patch | 185 +++++++++++ ...manual-shutdown-method-for-odroid-xu.patch | 116 +++++++ debian/patches/series | 4 + 6 files changed, 639 insertions(+) create mode 100644 debian/patches/features/arm/arm-dts-add-support-odroid-xu4-board-for-exynos5422-.patch create mode 100644 debian/patches/features/arm/arm-dts-fix-power-off-method-for-exynos5422-odroidxu.patch create mode 100644 debian/patches/features/arm/arm-dts-split-audio-configuration-to-separate-exynos.patch create mode 100644 debian/patches/features/arm/mfd-s2mps11-add-manual-shutdown-method-for-odroid-xu.patch diff --git a/debian/changelog b/debian/changelog index dd297550d..f4524cc29 100644 --- a/debian/changelog +++ b/debian/changelog @@ -19,6 +19,11 @@ linux (4.3.1-1~exp1) UNRELEASED; urgency=medium * [x86] input: Enable KEYBOARD_GPIO, INPUT_SOC_BUTTON_ARRAY (Closes: #804864) * [x86] nouveau: bios: return actual size of the buffer retrieved via _ROM (Closes: #772716) + * [armhf] Add support for Odroid-XU4 (Closes: #804850) + - mfd: s2mps11: Add manual shutdown method for Odroid XU3 + - dts: Fix power off method for exynos5422-odroidxu3-common + - dts: Split audio configuration to separate exynos5422-odroidxu3-audio + - dts: Add support Odroid XU4 board for exynos5422-odroidxu4 -- Ben Hutchings Wed, 09 Dec 2015 23:20:32 +0000 diff --git a/debian/patches/features/arm/arm-dts-add-support-odroid-xu4-board-for-exynos5422-.patch b/debian/patches/features/arm/arm-dts-add-support-odroid-xu4-board-for-exynos5422-.patch new file mode 100644 index 000000000..d969e5916 --- /dev/null +++ b/debian/patches/features/arm/arm-dts-add-support-odroid-xu4-board-for-exynos5422-.patch @@ -0,0 +1,294 @@ +From: Krzysztof Kozlowski +Date: Wed, 16 Sep 2015 08:37:11 +0900 +Subject: [3/3] ARM: dts: Add support Odroid XU4 board for exynos5422-odroidxu4 +Origin: https://git.kernel.org/linus/6658356014cbf772c7f11154adc0c46717b3322b +Bug-Debian: https://bugs.debian.org/804850 + +Add Hardkernel Odroid XU4 board Device Tree sources. The board differs +from Odroid XU3 and XU3-Lite by: +1. No green and red LEDs (except standard red power LED). +2. Only two PWM outputs are used (fan and blue LED) +3. No audio codec. +4. Two USB3 ports in host mode (no micro USB3 connector for OTG). +5. Realtek RTL8153-CG gigabit network adapter (instead of SMSC9514). +6. Additional connector with IO ports (I2S_0, I2C_5). +7. No DisplayPort (like XU3-Lite). +8. No TI INA231 power measurement sensors (like XU3-Lite). + +Signed-off-by: Krzysztof Kozlowski +Reviewed-by: Javier Martinez Canillas +Signed-off-by: Kukjin Kim +--- + arch/arm/boot/dts/Makefile | 1 + + arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi | 50 +--------------------- + arch/arm/boot/dts/exynos5422-odroidxu3-lite.dts | 50 ++++++++++++++++++++++ + arch/arm/boot/dts/exynos5422-odroidxu3.dts | 50 ++++++++++++++++++++++ + arch/arm/boot/dts/exynos5422-odroidxu4.dts | 48 +++++++++++++++++++++ + 5 files changed, 150 insertions(+), 49 deletions(-) + create mode 100644 arch/arm/boot/dts/exynos5422-odroidxu4.dts + +diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile +index 233159d..3d27fe3 100644 +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -123,6 +123,7 @@ dtb-$(CONFIG_ARCH_EXYNOS5) += \ + exynos5420-smdk5420.dtb \ + exynos5422-odroidxu3.dtb \ + exynos5422-odroidxu3-lite.dtb \ ++ exynos5422-odroidxu4.dtb \ + exynos5440-sd5v1.dtb \ + exynos5440-ssdk5440.dtb \ + exynos5800-peach-pi.dtb +diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi b/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi +index 2f0fb86..a83d569 100644 +--- a/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi ++++ b/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi +@@ -46,40 +46,6 @@ + reset-gpios = <&gpd1 0 1>; + }; + +- pwmleds { +- compatible = "pwm-leds"; +- +- greenled { +- label = "green:mmc0"; +- pwms = <&pwm 1 2000000 0>; +- pwm-names = "pwm1"; +- /* +- * Green LED is much brighter than the others +- * so limit its max brightness +- */ +- max_brightness = <127>; +- linux,default-trigger = "mmc0"; +- }; +- +- blueled { +- label = "blue:heartbeat"; +- pwms = <&pwm 2 2000000 0>; +- pwm-names = "pwm2"; +- max_brightness = <255>; +- linux,default-trigger = "heartbeat"; +- }; +- }; +- +- gpioleds { +- compatible = "gpio-leds"; +- redled { +- label = "red:microSD"; +- gpios = <&gpx2 3 GPIO_ACTIVE_HIGH>; +- default-state = "off"; +- linux,default-trigger = "mmc1"; +- }; +- }; +- + fan0: pwm-fan { + compatible = "pwm-fan"; + pwms = <&pwm 0 20972 0>; +@@ -417,18 +383,6 @@ + }; + }; + +-&pwm { +- /* +- * PWM 0 -- fan +- * PWM 1 -- Green LED +- * PWM 2 -- Blue LED +- * PWM 3 -- on MIPI connector for backlight +- */ +- pinctrl-0 = <&pwm0_out &pwm1_out &pwm2_out &pwm3_out>; +- pinctrl-names = "default"; +- status = "okay"; +-}; +- + &tmu_cpu0 { + vtmu-supply = <&ldo7_reg>; + status = "okay"; +@@ -464,9 +418,7 @@ + dr_mode = "host"; + }; + +-&usbdrd_dwc3_1 { +- dr_mode = "otg"; +-}; ++/* usbdrd_dwc3_1 mode customized in each board */ + + &usbdrd3_0 { + vdd33-supply = <&ldo9_reg>; +diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3-lite.dts b/arch/arm/boot/dts/exynos5422-odroidxu3-lite.dts +index 9c0cea9..b1b3608 100644 +--- a/arch/arm/boot/dts/exynos5422-odroidxu3-lite.dts ++++ b/arch/arm/boot/dts/exynos5422-odroidxu3-lite.dts +@@ -18,4 +18,54 @@ + / { + model = "Hardkernel Odroid XU3 Lite"; + compatible = "hardkernel,odroid-xu3-lite", "samsung,exynos5800", "samsung,exynos5"; ++ ++ pwmleds { ++ compatible = "pwm-leds"; ++ ++ greenled { ++ label = "green:mmc0"; ++ pwms = <&pwm 1 2000000 0>; ++ pwm-names = "pwm1"; ++ /* ++ * Green LED is much brighter than the others ++ * so limit its max brightness ++ */ ++ max_brightness = <127>; ++ linux,default-trigger = "mmc0"; ++ }; ++ ++ blueled { ++ label = "blue:heartbeat"; ++ pwms = <&pwm 2 2000000 0>; ++ pwm-names = "pwm2"; ++ max_brightness = <255>; ++ linux,default-trigger = "heartbeat"; ++ }; ++ }; ++ ++ gpioleds { ++ compatible = "gpio-leds"; ++ redled { ++ label = "red:microSD"; ++ gpios = <&gpx2 3 GPIO_ACTIVE_HIGH>; ++ default-state = "off"; ++ linux,default-trigger = "mmc1"; ++ }; ++ }; ++}; ++ ++&pwm { ++ /* ++ * PWM 0 -- fan ++ * PWM 1 -- Green LED ++ * PWM 2 -- Blue LED ++ * PWM 3 -- on MIPI connector for backlight ++ */ ++ pinctrl-0 = <&pwm0_out &pwm1_out &pwm2_out &pwm3_out>; ++ pinctrl-names = "default"; ++ status = "okay"; ++}; ++ ++&usbdrd_dwc3_1 { ++ dr_mode = "otg"; + }; +diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3.dts b/arch/arm/boot/dts/exynos5422-odroidxu3.dts +index d8647a4..0c0bbdb 100644 +--- a/arch/arm/boot/dts/exynos5422-odroidxu3.dts ++++ b/arch/arm/boot/dts/exynos5422-odroidxu3.dts +@@ -17,6 +17,40 @@ + / { + model = "Hardkernel Odroid XU3"; + compatible = "hardkernel,odroid-xu3", "samsung,exynos5800", "samsung,exynos5"; ++ ++ pwmleds { ++ compatible = "pwm-leds"; ++ ++ greenled { ++ label = "green:mmc0"; ++ pwms = <&pwm 1 2000000 0>; ++ pwm-names = "pwm1"; ++ /* ++ * Green LED is much brighter than the others ++ * so limit its max brightness ++ */ ++ max_brightness = <127>; ++ linux,default-trigger = "mmc0"; ++ }; ++ ++ blueled { ++ label = "blue:heartbeat"; ++ pwms = <&pwm 2 2000000 0>; ++ pwm-names = "pwm2"; ++ max_brightness = <255>; ++ linux,default-trigger = "heartbeat"; ++ }; ++ }; ++ ++ gpioleds { ++ compatible = "gpio-leds"; ++ redled { ++ label = "red:microSD"; ++ gpios = <&gpx2 3 GPIO_ACTIVE_HIGH>; ++ default-state = "off"; ++ linux,default-trigger = "mmc1"; ++ }; ++ }; + }; + + &i2c_0 { +@@ -50,3 +84,19 @@ + shunt-resistor = <10000>; + }; + }; ++ ++&pwm { ++ /* ++ * PWM 0 -- fan ++ * PWM 1 -- Green LED ++ * PWM 2 -- Blue LED ++ * PWM 3 -- on MIPI connector for backlight ++ */ ++ pinctrl-0 = <&pwm0_out &pwm1_out &pwm2_out &pwm3_out>; ++ pinctrl-names = "default"; ++ status = "okay"; ++}; ++ ++&usbdrd_dwc3_1 { ++ dr_mode = "otg"; ++}; +diff --git a/arch/arm/boot/dts/exynos5422-odroidxu4.dts b/arch/arm/boot/dts/exynos5422-odroidxu4.dts +new file mode 100644 +index 0000000..2faf886 +--- /dev/null ++++ b/arch/arm/boot/dts/exynos5422-odroidxu4.dts +@@ -0,0 +1,48 @@ ++/* ++ * Hardkernel Odroid XU4 board device tree source ++ * ++ * Copyright (c) 2015 Krzysztof Kozlowski ++ * Copyright (c) 2014 Collabora Ltd. ++ * Copyright (c) 2013-2015 Samsung Electronics Co., Ltd. ++ * http://www.samsung.com ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++*/ ++ ++/dts-v1/; ++#include "exynos5422-odroidxu3-common.dtsi" ++ ++/ { ++ model = "Hardkernel Odroid XU4"; ++ compatible = "hardkernel,odroid-xu4", "samsung,exynos5800", \ ++ "samsung,exynos5"; ++ ++ pwmleds { ++ compatible = "pwm-leds"; ++ ++ blueled { ++ label = "blue:heartbeat"; ++ pwms = <&pwm 2 2000000 0>; ++ pwm-names = "pwm2"; ++ max_brightness = <255>; ++ linux,default-trigger = "heartbeat"; ++ }; ++ }; ++}; ++ ++&pwm { ++ /* ++ * PWM 0 -- fan ++ * PWM 2 -- Blue LED ++ */ ++ pinctrl-0 = <&pwm0_out &pwm2_out>; ++ pinctrl-names = "default"; ++ samsung,pwm-outputs = <0>, <2>; ++ status = "okay"; ++}; ++ ++&usbdrd_dwc3_1 { ++ dr_mode = "host"; ++}; diff --git a/debian/patches/features/arm/arm-dts-fix-power-off-method-for-exynos5422-odroidxu.patch b/debian/patches/features/arm/arm-dts-fix-power-off-method-for-exynos5422-odroidxu.patch new file mode 100644 index 000000000..3da6c730d --- /dev/null +++ b/debian/patches/features/arm/arm-dts-fix-power-off-method-for-exynos5422-odroidxu.patch @@ -0,0 +1,35 @@ +From: Krzysztof Kozlowski +Date: Mon, 17 Aug 2015 08:55:51 +0900 +Subject: [1/3] ARM: dts: Fix power off method for exynos5422-odroidxu3-common +Origin: https://git.kernel.org/linus/0fb033bb3a384fdf1c08bcfaf429ca6431de91c7 +Bug-Debian: https://bugs.debian.org/804850 + +The Odroid XU3 family boards have ACOKB pin of PMIC grounded, instead of +pulled up as usual. This means that PMIC must manually set PWRHOLD field +in its CTRL1 register to low before initiating power down. + +This fixes Odroid XU3 powering off: +[ 25.966053] reboot: Power down +[ 25.967679] Power down. +[ 26.070174] Power down failed, please power off system manually. + +Signed-off-by: Krzysztof Kozlowski +Reported-by: Anand Moon +Reviewed-by: Javier Martinez Canillas +Signed-off-by: Kukjin Kim +--- + arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi b/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi +index 3b43e57..90d298d 100644 +--- a/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi ++++ b/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi +@@ -160,6 +160,7 @@ + s2mps11,buck2-ramp-enable = <1>; + s2mps11,buck3-ramp-enable = <1>; + s2mps11,buck4-ramp-enable = <1>; ++ samsung,s2mps11-acokb-ground; + + interrupt-parent = <&gpx0>; + interrupts = <4 IRQ_TYPE_EDGE_FALLING>; diff --git a/debian/patches/features/arm/arm-dts-split-audio-configuration-to-separate-exynos.patch b/debian/patches/features/arm/arm-dts-split-audio-configuration-to-separate-exynos.patch new file mode 100644 index 000000000..4605a6086 --- /dev/null +++ b/debian/patches/features/arm/arm-dts-split-audio-configuration-to-separate-exynos.patch @@ -0,0 +1,185 @@ +From: Krzysztof Kozlowski +Date: Wed, 16 Sep 2015 08:37:07 +0900 +Subject: [2/3] ARM: dts: Split audio configuration to separate + exynos5422-odroidxu3-audio +Origin: https://git.kernel.org/linus/8cec734904f55d5551ac97fa9910752ef521a673 +Bug-Debian: https://bugs.debian.org/804850 + +The Odroid XU4 board does not have audio codec so before adding DTS +for new board split the audio codec to separate DTSI file. Include +the audio codec DTSI in Odroid XU3 and XU3-Lite boards. + +Signed-off-by: Krzysztof Kozlowski +Reviewed-by: Javier Martinez Canillas +Signed-off-by: Kukjin Kim +--- + arch/arm/boot/dts/exynos5422-odroidxu3-audio.dtsi | 61 ++++++++++++++++++++++ + arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi | 47 ----------------- + arch/arm/boot/dts/exynos5422-odroidxu3-lite.dts | 1 + + arch/arm/boot/dts/exynos5422-odroidxu3.dts | 1 + + 4 files changed, 63 insertions(+), 47 deletions(-) + create mode 100644 arch/arm/boot/dts/exynos5422-odroidxu3-audio.dtsi + +diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3-audio.dtsi b/arch/arm/boot/dts/exynos5422-odroidxu3-audio.dtsi +new file mode 100644 +index 0000000..9493923 +--- /dev/null ++++ b/arch/arm/boot/dts/exynos5422-odroidxu3-audio.dtsi +@@ -0,0 +1,61 @@ ++/* ++ * Hardkernel Odroid XU3 Audio Codec device tree source ++ * ++ * Copyright (c) 2015 Krzysztof Kozlowski ++ * Copyright (c) 2014 Collabora Ltd. ++ * Copyright (c) 2013 Samsung Electronics Co., Ltd. ++ * http://www.samsung.com ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++*/ ++ ++/ { ++ sound: sound { ++ compatible = "simple-audio-card"; ++ ++ simple-audio-card,name = "Odroid-XU3"; ++ simple-audio-card,widgets = ++ "Headphone", "Headphone Jack", ++ "Speakers", "Speakers"; ++ simple-audio-card,routing = ++ "Headphone Jack", "HPL", ++ "Headphone Jack", "HPR", ++ "Headphone Jack", "MICBIAS", ++ "IN1", "Headphone Jack", ++ "Speakers", "SPKL", ++ "Speakers", "SPKR"; ++ ++ simple-audio-card,format = "i2s"; ++ simple-audio-card,bitclock-master = <&link0_codec>; ++ simple-audio-card,frame-master = <&link0_codec>; ++ ++ simple-audio-card,cpu { ++ sound-dai = <&i2s0 0>; ++ system-clock-frequency = <19200000>; ++ }; ++ ++ link0_codec: simple-audio-card,codec { ++ sound-dai = <&max98090>; ++ clocks = <&i2s0 CLK_I2S_CDCLK>; ++ }; ++ }; ++}; ++ ++&hsi2c_5 { ++ status = "okay"; ++ max98090: max98090@10 { ++ compatible = "maxim,max98090"; ++ reg = <0x10>; ++ interrupt-parent = <&gpx3>; ++ interrupts = <2 0>; ++ clocks = <&i2s0 CLK_I2S_CDCLK>; ++ clock-names = "mclk"; ++ #sound-dai-cells = <0>; ++ }; ++}; ++ ++&i2s0 { ++ status = "okay"; ++}; +diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi b/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi +index 90d298d..2f0fb86 100644 +--- a/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi ++++ b/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi +@@ -80,36 +80,6 @@ + }; + }; + +- sound: sound { +- compatible = "simple-audio-card"; +- +- simple-audio-card,name = "Odroid-XU3"; +- simple-audio-card,widgets = +- "Headphone", "Headphone Jack", +- "Speakers", "Speakers"; +- simple-audio-card,routing = +- "Headphone Jack", "HPL", +- "Headphone Jack", "HPR", +- "Headphone Jack", "MICBIAS", +- "IN1", "Headphone Jack", +- "Speakers", "SPKL", +- "Speakers", "SPKR"; +- +- simple-audio-card,format = "i2s"; +- simple-audio-card,bitclock-master = <&link0_codec>; +- simple-audio-card,frame-master = <&link0_codec>; +- +- simple-audio-card,cpu { +- sound-dai = <&i2s0 0>; +- system-clock-frequency = <19200000>; +- }; +- +- link0_codec: simple-audio-card,codec { +- sound-dai = <&max98090>; +- clocks = <&i2s0 CLK_I2S_CDCLK>; +- }; +- }; +- + fan0: pwm-fan { + compatible = "pwm-fan"; + pwms = <&pwm 0 20972 0>; +@@ -376,19 +346,6 @@ + }; + }; + +-&hsi2c_5 { +- status = "okay"; +- max98090: max98090@10 { +- compatible = "maxim,max98090"; +- reg = <0x10>; +- interrupt-parent = <&gpx3>; +- interrupts = <2 0>; +- clocks = <&i2s0 CLK_I2S_CDCLK>; +- clock-names = "mclk"; +- #sound-dai-cells = <0>; +- }; +-}; +- + &i2c_2 { + samsung,i2c-sda-delay = <100>; + samsung,i2c-max-bus-freq = <66000>; +@@ -400,10 +357,6 @@ + }; + }; + +-&i2s0 { +- status = "okay"; +-}; +- + &mfc { + samsung,mfc-r = <0x43000000 0x800000>; + samsung,mfc-l = <0x51000000 0x800000>; +diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3-lite.dts b/arch/arm/boot/dts/exynos5422-odroidxu3-lite.dts +index c06882b..9c0cea9 100644 +--- a/arch/arm/boot/dts/exynos5422-odroidxu3-lite.dts ++++ b/arch/arm/boot/dts/exynos5422-odroidxu3-lite.dts +@@ -13,6 +13,7 @@ + + /dts-v1/; + #include "exynos5422-odroidxu3-common.dtsi" ++#include "exynos5422-odroidxu3-audio.dtsi" + + / { + model = "Hardkernel Odroid XU3 Lite"; +diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3.dts b/arch/arm/boot/dts/exynos5422-odroidxu3.dts +index 78e6a50..d8647a4 100644 +--- a/arch/arm/boot/dts/exynos5422-odroidxu3.dts ++++ b/arch/arm/boot/dts/exynos5422-odroidxu3.dts +@@ -12,6 +12,7 @@ + + /dts-v1/; + #include "exynos5422-odroidxu3-common.dtsi" ++#include "exynos5422-odroidxu3-audio.dtsi" + + / { + model = "Hardkernel Odroid XU3"; diff --git a/debian/patches/features/arm/mfd-s2mps11-add-manual-shutdown-method-for-odroid-xu.patch b/debian/patches/features/arm/mfd-s2mps11-add-manual-shutdown-method-for-odroid-xu.patch new file mode 100644 index 000000000..331d1dc02 --- /dev/null +++ b/debian/patches/features/arm/mfd-s2mps11-add-manual-shutdown-method-for-odroid-xu.patch @@ -0,0 +1,116 @@ +From: Krzysztof Kozlowski +Date: Mon, 14 Sep 2015 21:12:45 +0900 +Subject: mfd: s2mps11: Add manual shutdown method for Odroid XU3 +Origin: https://git.kernel.org/linus/d785334a0d5deff30a487c74324b842d2179553d +Bug-Debian: https://bugs.debian.org/804850 + +On Odroid XU3 board (with S2MPS11 PMIC) the PWRHOLD bit in CTRL1 +register must be manually set to 0 before initiating power off sequence. + +One of usual power down methods for Exynos based devices looks like: +1. PWRHOLD pin of PMIC is connected to PSHOLD of Exynos SoC. +2. Exynos holds up this pin during system operation. +3. ACOKB pin of PMIC is pulled up to VBATT and optionally to pin in + other device. +4. When PWRHOLD/PSHOLD goes low, the PMIC will turn off the power if + ACOKB goes high. + +On Odroid XU3 family the difference is in (3) - the ACOKB is grounded. +This means that PMIC must manually set PWRHOLD field to low and then +wait for signal from Application Processor (the usual change in +PWRHOLD/PSHOLD pin will actually cut off the power). + +The patch adds respective binding allowing Odroid XU3 device to be +powered off. + +Signed-off-by: Krzysztof Kozlowski +Reported-by: Anand Moon +Tested-by: Anand Moon +Reviewed-by: Javier Martinez Canillas +Signed-off-by: Lee Jones +--- + drivers/mfd/sec-core.c | 30 ++++++++++++++++++++++++++++++ + include/linux/mfd/samsung/core.h | 2 ++ + include/linux/mfd/samsung/s2mps11.h | 1 + + 3 files changed, 33 insertions(+) + +diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c +index d206a3e..2d1137a 100644 +--- a/drivers/mfd/sec-core.c ++++ b/drivers/mfd/sec-core.c +@@ -278,6 +278,8 @@ static struct sec_platform_data *sec_pmic_i2c_parse_dt_pdata( + * not parsed here. + */ + ++ pd->manual_poweroff = of_property_read_bool(dev->of_node, ++ "samsung,s2mps11-acokb-ground"); + return pd; + } + #else +@@ -440,6 +442,33 @@ static int sec_pmic_remove(struct i2c_client *i2c) + return 0; + } + ++static void sec_pmic_shutdown(struct i2c_client *i2c) ++{ ++ struct sec_pmic_dev *sec_pmic = i2c_get_clientdata(i2c); ++ unsigned int reg, mask; ++ ++ if (!sec_pmic->pdata->manual_poweroff) ++ return; ++ ++ switch (sec_pmic->device_type) { ++ case S2MPS11X: ++ reg = S2MPS11_REG_CTRL1; ++ mask = S2MPS11_CTRL1_PWRHOLD_MASK; ++ break; ++ default: ++ /* ++ * Currently only one board with S2MPS11 needs this, so just ++ * ignore the rest. ++ */ ++ dev_warn(sec_pmic->dev, ++ "Unsupported device %lu for manual power off\n", ++ sec_pmic->device_type); ++ return; ++ } ++ ++ regmap_update_bits(sec_pmic->regmap_pmic, reg, mask, 0); ++} ++ + #ifdef CONFIG_PM_SLEEP + static int sec_pmic_suspend(struct device *dev) + { +@@ -491,6 +520,7 @@ static struct i2c_driver sec_pmic_driver = { + }, + .probe = sec_pmic_probe, + .remove = sec_pmic_remove, ++ .shutdown = sec_pmic_shutdown, + .id_table = sec_pmic_id, + }; + +diff --git a/include/linux/mfd/samsung/core.h b/include/linux/mfd/samsung/core.h +index 7511538..aa78957 100644 +--- a/include/linux/mfd/samsung/core.h ++++ b/include/linux/mfd/samsung/core.h +@@ -132,6 +132,8 @@ struct sec_platform_data { + int buck2_init; + int buck3_init; + int buck4_init; ++ /* Whether or not manually set PWRHOLD to low during shutdown. */ ++ bool manual_poweroff; + }; + + /** +diff --git a/include/linux/mfd/samsung/s2mps11.h b/include/linux/mfd/samsung/s2mps11.h +index 7981a9d..b288965 100644 +--- a/include/linux/mfd/samsung/s2mps11.h ++++ b/include/linux/mfd/samsung/s2mps11.h +@@ -179,6 +179,7 @@ enum s2mps11_regulators { + #define S2MPS11_BUCK_N_VOLTAGES (S2MPS11_BUCK_VSEL_MASK + 1) + #define S2MPS11_RAMP_DELAY 25000 /* uV/us */ + ++#define S2MPS11_CTRL1_PWRHOLD_MASK BIT(4) + + #define S2MPS11_BUCK2_RAMP_SHIFT 6 + #define S2MPS11_BUCK34_RAMP_SHIFT 4 diff --git a/debian/patches/series b/debian/patches/series index 803c64b6e..f37662c18 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -99,3 +99,7 @@ bugfix/x86/drm-i915-shut-up-gen8-sde-irq-dmesg-noise.patch bugfix/arm/arm-dts-kirkwood-fix-qnap-ts219-power-off.patch bugfix/x86/drm-i915-mark-uneven-memory-banks-on-gen4-desktop-as.patch bugfix/x86/bios-return-actual-size-of-the-buffer-retrieved-via-_rom.patch +features/arm/mfd-s2mps11-add-manual-shutdown-method-for-odroid-xu.patch +features/arm/arm-dts-fix-power-off-method-for-exynos5422-odroidxu.patch +features/arm/arm-dts-split-audio-configuration-to-separate-exynos.patch +features/arm/arm-dts-add-support-odroid-xu4-board-for-exynos5422-.patch From 8b24f6f29267ac9868571cb46310ded21e9e595d Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sun, 13 Dec 2015 00:16:18 +0000 Subject: [PATCH 13/15] udeb: Add hid-chicony to input-modules (Closes: #766570) --- debian/changelog | 1 + debian/installer/modules/input-modules | 1 + 2 files changed, 2 insertions(+) diff --git a/debian/changelog b/debian/changelog index f4524cc29..c1d2e6cf9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -24,6 +24,7 @@ linux (4.3.1-1~exp1) UNRELEASED; urgency=medium - dts: Fix power off method for exynos5422-odroidxu3-common - dts: Split audio configuration to separate exynos5422-odroidxu3-audio - dts: Add support Odroid XU4 board for exynos5422-odroidxu4 + * udeb: Add hid-chicony to input-modules (Closes: #766570) -- Ben Hutchings Wed, 09 Dec 2015 23:20:32 +0000 diff --git a/debian/installer/modules/input-modules b/debian/installer/modules/input-modules index bfc4dda29..8a906fd9c 100644 --- a/debian/installer/modules/input-modules +++ b/debian/installer/modules/input-modules @@ -5,6 +5,7 @@ hid-a4tech ? hid-apple ? hid-belkin ? hid-cherry ? +hid-chicony ? hid-cypress ? hid-ezkey ? hid-holtek-kbd ? From 0eb4bd660ef57dddb4284846856fae3281f5c6cd Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sun, 13 Dec 2015 00:32:29 +0000 Subject: [PATCH 14/15] sched: Enable CFS_BANDWIDTH (Closes: #802746) --- debian/changelog | 1 + debian/config/armel/config-reduced | 1 + debian/config/config | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index c1d2e6cf9..f3cf57a49 100644 --- a/debian/changelog +++ b/debian/changelog @@ -25,6 +25,7 @@ linux (4.3.1-1~exp1) UNRELEASED; urgency=medium - dts: Split audio configuration to separate exynos5422-odroidxu3-audio - dts: Add support Odroid XU4 board for exynos5422-odroidxu4 * udeb: Add hid-chicony to input-modules (Closes: #766570) + * sched: Enable CFS_BANDWIDTH (Closes: #802746) -- Ben Hutchings Wed, 09 Dec 2015 23:20:32 +0000 diff --git a/debian/config/armel/config-reduced b/debian/config/armel/config-reduced index 7392e0dc9..c6d10b210 100644 --- a/debian/config/armel/config-reduced +++ b/debian/config/armel/config-reduced @@ -27,6 +27,7 @@ CONFIG_IOSCHED_DEADLINE=m ## #. Saves about 7K # CONFIG_MEMCG is not set +# CONFIG_CFS_BANDWIDTH is not set # CONFIG_CHECKPOINT_RESTORE is not set CONFIG_CC_OPTIMIZE_FOR_SIZE=y # CONFIG_PROFILING is not set diff --git a/debian/config/config b/debian/config/config index aef085974..a2144ed9a 100644 --- a/debian/config/config +++ b/debian/config/config @@ -5225,7 +5225,7 @@ CONFIG_MEMCG_SWAP=y CONFIG_CGROUP_PERF=y CONFIG_CGROUP_SCHED=y CONFIG_FAIR_GROUP_SCHED=y -# CONFIG_CFS_BANDWIDTH is not set +CONFIG_CFS_BANDWIDTH=y # CONFIG_RT_GROUP_SCHED is not set CONFIG_BLK_CGROUP=y # CONFIG_DEBUG_BLK_CGROUP is not set From 5c96b47d417a3f7b5011ef685daa573c1d0d5533 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sun, 13 Dec 2015 00:38:54 +0000 Subject: [PATCH 15/15] Prepare to release linux (4.3.1-1). --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index f3cf57a49..d212b4984 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -linux (4.3.1-1~exp1) UNRELEASED; urgency=medium +linux (4.3.1-1) unstable; urgency=medium * New upstream stable update: https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.3.1 @@ -27,7 +27,7 @@ linux (4.3.1-1~exp1) UNRELEASED; urgency=medium * udeb: Add hid-chicony to input-modules (Closes: #766570) * sched: Enable CFS_BANDWIDTH (Closes: #802746) - -- Ben Hutchings Wed, 09 Dec 2015 23:20:32 +0000 + -- Ben Hutchings Sun, 13 Dec 2015 00:38:54 +0000 linux (4.3-1~exp2) experimental; urgency=medium