Merge pull request #777 from shenki/linux-4.4.39-openpower1

Release 4.4.38-openpower1
diff --git a/openpower/configs/barreleye_defconfig b/openpower/configs/barreleye_defconfig
index 4e3a3fd..ca96d8a 100644
--- a/openpower/configs/barreleye_defconfig
+++ b/openpower/configs/barreleye_defconfig
@@ -16,7 +16,7 @@
 BR2_ROOTFS_POST_BUILD_SCRIPT="../openpower/scripts/fixup-target-var ../openpower/scripts/firmware-whitelist"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION=y
-BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.4.35"
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.4.38"
 BR2_LINUX_KERNEL_PATCH="$(BR2_EXTERNAL)/linux"
 BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
 BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL)/configs/linux/skiroot_defconfig"
diff --git a/openpower/configs/firenze_defconfig b/openpower/configs/firenze_defconfig
index 47b7153..1b00abc 100644
--- a/openpower/configs/firenze_defconfig
+++ b/openpower/configs/firenze_defconfig
@@ -15,7 +15,7 @@
 BR2_ROOTFS_POST_BUILD_SCRIPT="../openpower/scripts/fixup-target-var ../openpower/scripts/firmware-whitelist"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION=y
-BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.4.35"
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.4.38"
 BR2_LINUX_KERNEL_PATCH="$(BR2_EXTERNAL)/linux"
 BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
 BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL)/configs/linux/skiroot_defconfig"
diff --git a/openpower/configs/firestone_defconfig b/openpower/configs/firestone_defconfig
index 3daa191..50dac01 100644
--- a/openpower/configs/firestone_defconfig
+++ b/openpower/configs/firestone_defconfig
@@ -16,7 +16,7 @@
 BR2_ROOTFS_POST_BUILD_SCRIPT="../openpower/scripts/fixup-target-var ../openpower/scripts/firmware-whitelist"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION=y
-BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.4.35"
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.4.38"
 BR2_LINUX_KERNEL_PATCH="$(BR2_EXTERNAL)/linux"
 BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
 BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL)/configs/linux/skiroot_defconfig"
diff --git a/openpower/configs/garrison_defconfig b/openpower/configs/garrison_defconfig
index 11a1ccb..39149bb 100644
--- a/openpower/configs/garrison_defconfig
+++ b/openpower/configs/garrison_defconfig
@@ -16,7 +16,7 @@
 BR2_ROOTFS_POST_BUILD_SCRIPT="../openpower/scripts/fixup-target-var ../openpower/scripts/firmware-whitelist"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION=y
-BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.4.35"
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.4.38"
 BR2_LINUX_KERNEL_PATCH="$(BR2_EXTERNAL)/linux"
 BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
 BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL)/configs/linux/skiroot_defconfig"
diff --git a/openpower/configs/habanero_defconfig b/openpower/configs/habanero_defconfig
index f797daa..80c9291 100644
--- a/openpower/configs/habanero_defconfig
+++ b/openpower/configs/habanero_defconfig
@@ -16,7 +16,7 @@
 BR2_ROOTFS_POST_BUILD_SCRIPT="../openpower/scripts/fixup-target-var ../openpower/scripts/firmware-whitelist"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION=y
-BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.4.35"
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.4.38"
 BR2_LINUX_KERNEL_PATCH="$(BR2_EXTERNAL)/linux"
 BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
 BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL)/configs/linux/skiroot_defconfig"
diff --git a/openpower/configs/openpower_mambo_defconfig b/openpower/configs/openpower_mambo_defconfig
index a38a905..0beb640 100644
--- a/openpower/configs/openpower_mambo_defconfig
+++ b/openpower/configs/openpower_mambo_defconfig
@@ -14,7 +14,7 @@
 BR2_ROOTFS_POST_BUILD_SCRIPT="../openpower/scripts/fixup-target-var ../openpower/scripts/firmware-whitelist"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION=y
-BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.4.35"
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.4.38"
 BR2_LINUX_KERNEL_PATCH="$(BR2_EXTERNAL)/linux"
 BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
 BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL)/configs/linux/skiroot_defconfig"
diff --git a/openpower/configs/palmetto_defconfig b/openpower/configs/palmetto_defconfig
index 6208f0c..1a6b4cd 100644
--- a/openpower/configs/palmetto_defconfig
+++ b/openpower/configs/palmetto_defconfig
@@ -15,7 +15,7 @@
 BR2_ROOTFS_POST_BUILD_SCRIPT="../openpower/scripts/fixup-target-var ../openpower/scripts/firmware-whitelist"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION=y
-BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.4.35"
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.4.38"
 BR2_LINUX_KERNEL_PATCH="$(BR2_EXTERNAL)/linux"
 BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
 BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL)/configs/linux/skiroot_defconfig"
diff --git a/openpower/linux/0001-xhci-Use-xhci_pci_remove-for-xhci-device-shutdown.patch b/openpower/linux/0001-xhci-Use-xhci_pci_remove-for-xhci-device-shutdown.patch
index 234955b..991618a 100644
--- a/openpower/linux/0001-xhci-Use-xhci_pci_remove-for-xhci-device-shutdown.patch
+++ b/openpower/linux/0001-xhci-Use-xhci_pci_remove-for-xhci-device-shutdown.patch
@@ -1,7 +1,7 @@
-From 197ee8ecab34ec0fef76e813115ac6c904941b0b Mon Sep 17 00:00:00 2001
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
 From: Thadeu Lima De Souza Cascardo <thadeul@br.ibm.com>
 Date: Tue, 25 Mar 2014 10:45:16 -0400
-Subject: [PATCH 1/9] xhci: Use xhci_pci_remove for xhci device shutdown
+Subject: [PATCH 01/12] xhci: Use xhci_pci_remove for xhci device shutdown
 
 Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
 Signed-off-by: Joel Stanley <joel@jms.id.au>
@@ -23,5 +23,5 @@
  	.driver = {
  		.pm = &usb_hcd_pci_pm_ops
 -- 
-2.10.2
+2.11.0
 
diff --git a/openpower/linux/0002-drivers-drm-ast-Switch-SCU-to-VGA-output-on-POST.patch b/openpower/linux/0002-drivers-drm-ast-Switch-SCU-to-VGA-output-on-POST.patch
index 103b110..2832958 100644
--- a/openpower/linux/0002-drivers-drm-ast-Switch-SCU-to-VGA-output-on-POST.patch
+++ b/openpower/linux/0002-drivers-drm-ast-Switch-SCU-to-VGA-output-on-POST.patch
@@ -1,7 +1,7 @@
-From 3b72f1493ca01fe9bad672c24c5f62a7862f5001 Mon Sep 17 00:00:00 2001
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
 From: Jeremy Kerr <jk@ozlabs.org>
 Date: Wed, 2 Mar 2016 11:25:47 +0800
-Subject: [PATCH 2/9] drivers/drm/ast: Switch SCU to VGA output on POST
+Subject: [PATCH 02/12] drivers/drm/ast: Switch SCU to VGA output on POST
 
 On AST BMC platforms, the BMC may be using the VGA device for UART
 mirroring. In this case, we need to switch the DAC output to
@@ -68,5 +68,5 @@
 +	ast_moutdwm(ast, scu_addr | 0x2c, val);
 +}
 -- 
-2.10.2
+2.11.0
 
diff --git a/openpower/linux/0003-net-mlx4_core-Set-UAR-page-size-to-4KB-regardless-of.patch b/openpower/linux/0003-net-mlx4_core-Set-UAR-page-size-to-4KB-regardless-of.patch
index 0634d0d..cb197f2 100644
--- a/openpower/linux/0003-net-mlx4_core-Set-UAR-page-size-to-4KB-regardless-of.patch
+++ b/openpower/linux/0003-net-mlx4_core-Set-UAR-page-size-to-4KB-regardless-of.patch
@@ -1,7 +1,7 @@
-From 2f6a9eb658b2bda754c41e7595449ea61cc05643 Mon Sep 17 00:00:00 2001
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
 From: Huy Nguyen <huyn@mellanox.com>
 Date: Wed, 17 Feb 2016 17:24:26 +0200
-Subject: [PATCH 3/9] net/mlx4_core: Set UAR page size to 4KB regardless of
+Subject: [PATCH 03/12] net/mlx4_core: Set UAR page size to 4KB regardless of
  system page size
 
 problem description:
@@ -295,5 +295,5 @@
 +}
  #endif /* MLX4_DEVICE_H */
 -- 
-2.10.2
+2.11.0
 
diff --git a/openpower/linux/0004-xhci-do-not-halt-the-secondary-HCD.patch b/openpower/linux/0004-xhci-do-not-halt-the-secondary-HCD.patch
index 93d4449..a8df6ba 100644
--- a/openpower/linux/0004-xhci-do-not-halt-the-secondary-HCD.patch
+++ b/openpower/linux/0004-xhci-do-not-halt-the-secondary-HCD.patch
@@ -1,7 +1,7 @@
-From dc80fa5aeb79858a9ee9f1575ca7aaf085b7b3f8 Mon Sep 17 00:00:00 2001
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
 From: Joel Stanley <joel@jms.id.au>
 Date: Tue, 19 Jul 2016 22:43:26 +0930
-Subject: [PATCH 4/9] xhci: do not halt the secondary HCD
+Subject: [PATCH 04/12] xhci: do not halt the secondary HCD
 
 We can't halt the secondary HCD, because it's also the primary HCD,
 which will cause problems if we have devices attached to the primary
@@ -52,5 +52,5 @@
  
  	/* Deleting Compliance Mode Recovery Timer */
 -- 
-2.10.2
+2.11.0
 
diff --git a/openpower/linux/0005-net-mlx5-Add-pci-shutdown-callback.patch b/openpower/linux/0005-net-mlx5-Add-pci-shutdown-callback.patch
index 59e74dd..7e2ccf5 100644
--- a/openpower/linux/0005-net-mlx5-Add-pci-shutdown-callback.patch
+++ b/openpower/linux/0005-net-mlx5-Add-pci-shutdown-callback.patch
@@ -1,7 +1,7 @@
-From dbb3baa8fe3f31f24386b895b345f6a212e6240f Mon Sep 17 00:00:00 2001
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
 From: Carol L Soto <clsoto@linux.vnet.ibm.com>
 Date: Tue, 12 Jul 2016 17:04:07 -0500
-Subject: [PATCH 5/9] net/mlx5: Add pci shutdown callback
+Subject: [PATCH 05/12] net/mlx5: Add pci shutdown callback
 
 Backport of commit 5fc7197d3a256 ("net/mlx5: Add pci shutdown callback")
 so we can use for the OpenPower kernel.
@@ -157,5 +157,5 @@
  					  enum mlx5_dev_event event,
  					  unsigned long param);
 -- 
-2.10.2
+2.11.0
 
diff --git a/openpower/linux/0006-powerpc-boot-Add-OPAL-console-to-epapr-wrappers.patch b/openpower/linux/0006-powerpc-boot-Add-OPAL-console-to-epapr-wrappers.patch
index 85e0c35..c3e612f 100644
--- a/openpower/linux/0006-powerpc-boot-Add-OPAL-console-to-epapr-wrappers.patch
+++ b/openpower/linux/0006-powerpc-boot-Add-OPAL-console-to-epapr-wrappers.patch
@@ -1,7 +1,7 @@
-From e114c51a2db906edeedde2439b18e86ef1401a1a Mon Sep 17 00:00:00 2001
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
 From: Oliver O'Halloran <oohall@gmail.com>
 Date: Fri, 24 Jun 2016 17:28:43 +1000
-Subject: [PATCH 6/9] powerpc/boot: Add OPAL console to epapr wrappers
+Subject: [PATCH 06/12] powerpc/boot: Add OPAL console to epapr wrappers
 
 This patch adds an OPAL console backend to the powerpc boot wrapper so
 that decompression failures inside the wrapper can be reported to the
@@ -282,5 +282,5 @@
  	typeof(x) _x = (x);	\
  	typeof(y) _y = (y);	\
 -- 
-2.10.2
+2.11.0
 
diff --git a/openpower/linux/0007-tty-hvc-Use-opal-irqchip-interface-if-available.patch b/openpower/linux/0007-tty-hvc-Use-opal-irqchip-interface-if-available.patch
index 1c401a8..c1b53d1 100644
--- a/openpower/linux/0007-tty-hvc-Use-opal-irqchip-interface-if-available.patch
+++ b/openpower/linux/0007-tty-hvc-Use-opal-irqchip-interface-if-available.patch
@@ -1,7 +1,7 @@
-From 9dea75996f5054e9e49e99120dd0ce6082d7f6d8 Mon Sep 17 00:00:00 2001
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
 From: Samuel Mendoza-Jonas <sam@mendozajonas.com>
 Date: Wed, 13 Jul 2016 11:15:42 +1000
-Subject: [PATCH 7/9] tty/hvc: Use opal irqchip interface if available
+Subject: [PATCH 07/12] tty/hvc: Use opal irqchip interface if available
 
 Update the hvc driver to use the OPAL irqchip if made available by the
 running firmware. If it is not present, the driver falls back to the
@@ -34,5 +34,5 @@
  		pr_err("hvc_opal: Unable to map interrupt for device %s\n",
  			dev->dev.of_node->full_name);
 -- 
-2.10.2
+2.11.0
 
diff --git a/openpower/linux/0008-tty-hvc-Use-IRQF_SHARED-for-OPAL-hvc-consoles.patch b/openpower/linux/0008-tty-hvc-Use-IRQF_SHARED-for-OPAL-hvc-consoles.patch
index b1e2407..dfd8167 100644
--- a/openpower/linux/0008-tty-hvc-Use-IRQF_SHARED-for-OPAL-hvc-consoles.patch
+++ b/openpower/linux/0008-tty-hvc-Use-IRQF_SHARED-for-OPAL-hvc-consoles.patch
@@ -1,7 +1,7 @@
-From fb701b4efa037e94692051ee61f5bcffc56cd33f Mon Sep 17 00:00:00 2001
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
 From: Samuel Mendoza-Jonas <sam@mendozajonas.com>
 Date: Wed, 13 Jul 2016 11:15:41 +1000
-Subject: [PATCH 8/9] tty/hvc: Use IRQF_SHARED for OPAL hvc consoles
+Subject: [PATCH 08/12] tty/hvc: Use IRQF_SHARED for OPAL hvc consoles
 
 Commit 2def86a7200c
 ("hvc: Convert to using interrupts instead of opal events")
@@ -84,5 +84,5 @@
  
  	return 0;
 -- 
-2.10.2
+2.11.0
 
diff --git a/openpower/linux/0009-Release-4.4.35-openpower1.patch b/openpower/linux/0009-Release-4.4.35-openpower1.patch
deleted file mode 100644
index 06be11e..0000000
--- a/openpower/linux/0009-Release-4.4.35-openpower1.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From 4c657a96a3904a5e9c346b6089b9802cf06bbf23 Mon Sep 17 00:00:00 2001
-From: Joel Stanley <joel@jms.id.au>
-Date: Tue, 16 Aug 2016 23:00:23 +0930
-Subject: [PATCH 9/9] Release 4.4.35-openpower1
-
-Signed-off-by: Joel Stanley <joel@jms.id.au>
----
- Makefile | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/Makefile b/Makefile
-index f88830af1533..08e43a4f0f47 100644
---- a/Makefile
-+++ b/Makefile
-@@ -1,7 +1,7 @@
- VERSION = 4
- PATCHLEVEL = 4
- SUBLEVEL = 35
--EXTRAVERSION =
-+EXTRAVERSION = -openpower1
- NAME = Blurry Fish Butt
- 
- # *DOCUMENTATION*
--- 
-2.10.2
-
diff --git a/openpower/linux/0009-usb-xhci-allow-xhci_check_bandwith-in-XHCI_STATE_REM.patch b/openpower/linux/0009-usb-xhci-allow-xhci_check_bandwith-in-XHCI_STATE_REM.patch
new file mode 100644
index 0000000..4596969
--- /dev/null
+++ b/openpower/linux/0009-usb-xhci-allow-xhci_check_bandwith-in-XHCI_STATE_REM.patch
@@ -0,0 +1,63 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jeremy Kerr <jk@ozlabs.org>
+Date: Thu, 1 Dec 2016 18:15:59 +0800
+Subject: [PATCH 09/12] usb/xhci: allow xhci_check_bandwith in
+ XHCI_STATE_REMOVING
+
+Change 98d74f9ce (and backported as 0eb1e16bf9) introduced
+XHCI_STATE_REMOVING, where PCI XHCI HCDs are flagged as removing dring
+pci->remove. This included a check in xhci_check_bandwith to supress any
+configuration changes while the hcd is in this state.
+
+However, it looks like some controllers hang during halt if we haven't
+set configration 0 (via usb_hcd_alloc_bandwidth()).
+
+This change allows the configuration 0 update while removing.
+
+[This may be specific to our XHCI hacks for kexec...]
+
+From Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>:
+
+ > What concerned me about 0004-xhci-do-not-halt-the-secondary-HCD.patch
+ > was that I'd still see eventual halt failures , though they seemed to
+ > occur on the shutdown hook, instead of the distro probe path. But since
+ > the probe goes ok, the bind continues and the device doesn't disappear.
+ > With JK's patch applied, I ran a bind-unbind stress test and couldn't
+ > reproduce the halt failure anymore. further probe and enumeration seems
+ > to work ok.
+ >
+ > I don't understand why the change fixes the hang but as JK said, it may
+ > be a particularity of this TI device not handling halts correctly . I
+ > don't think it will be accepted upstream as is, though, so we might want
+ > to make it a hardware quirk for this specific device if we confirm the
+ > TI device requires it for proper halting.
+ >
+ > Other than that, i think it's safe to make the change, and I don't think
+ > xhci spec forbids reconfiguration prior to halt.
+ >
+ > In short, this seems to work but I don't fully understand why. It
+ > doesn't seem harmful and if it fixes the issue, we can make it a quirk.
+
+Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
+Signed-off-by: Joel Stanley <joel@jms.id.au>
+---
+ drivers/usb/host/xhci.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
+index ec92a843325b..db557113cf3d 100644
+--- a/drivers/usb/host/xhci.c
++++ b/drivers/usb/host/xhci.c
+@@ -2770,8 +2770,7 @@ int xhci_check_bandwidth(struct usb_hcd *hcd, struct usb_device *udev)
+ 	if (ret <= 0)
+ 		return ret;
+ 	xhci = hcd_to_xhci(hcd);
+-	if ((xhci->xhc_state & XHCI_STATE_DYING) ||
+-		(xhci->xhc_state & XHCI_STATE_REMOVING))
++	if (xhci->xhc_state & XHCI_STATE_DYING)
+ 		return -ENODEV;
+ 
+ 	xhci_dbg(xhci, "%s called for udev %p\n", __func__, udev);
+-- 
+2.11.0
+
diff --git a/openpower/linux/0010-powerpc-boot-Request-no-dynamic-linker-for-boot-wrap.patch b/openpower/linux/0010-powerpc-boot-Request-no-dynamic-linker-for-boot-wrap.patch
new file mode 100644
index 0000000..7059ede
--- /dev/null
+++ b/openpower/linux/0010-powerpc-boot-Request-no-dynamic-linker-for-boot-wrap.patch
@@ -0,0 +1,79 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Nicholas Piggin <npiggin@gmail.com>
+Date: Mon, 28 Nov 2016 12:42:26 +1100
+Subject: [PATCH 10/12] powerpc/boot: Request no dynamic linker for boot
+ wrapper
+
+The boot wrapper performs its own relocations and does not require
+PT_INTERP segment. However currently we don't tell the linker that.
+
+Prior to binutils 2.28 that works OK. But since binutils commit
+1a9ccd70f9a7 ("Fix the linker so that it will not silently generate ELF
+binaries with invalid program headers. Fix readelf to report such
+invalid binaries.") binutils tries to create a program header segment
+due to PT_INTERP, and the link fails because there is no space for it:
+
+  ld: arch/powerpc/boot/zImage.pseries: Not enough room for program headers, try linking with -N
+  ld: final link failed: Bad value
+
+So tell the linker not to do that, by passing --no-dynamic-linker.
+
+Cc: stable@vger.kernel.org
+Reported-by: Anton Blanchard <anton@samba.org>
+Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
+[mpe: Drop dependency on ld-version.sh and massage change log]
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+(cherry picked from commit ff45000fcb56b5b0f1a14a865d3541746d838a0a)
+Signed-off-by: Joel Stanley <joel@jms.id.au>
+
+Signed-off-by: Joel Stanley <joel@jms.id.au>
+---
+ arch/powerpc/boot/wrapper | 25 ++++++++++++++++++++++++-
+ 1 file changed, 24 insertions(+), 1 deletion(-)
+
+diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper
+index ceaa75d5a684..8c8394e4e164 100755
+--- a/arch/powerpc/boot/wrapper
++++ b/arch/powerpc/boot/wrapper
+@@ -161,6 +161,28 @@ case "$elfformat" in
+     elf32-powerpc)	format=elf32ppc	;;
+ esac
+ 
++ld_version()
++{
++    # Poached from scripts/ld-version.sh, but we don't want to call that because
++    # this script (wrapper) is distributed separately from the kernel source.
++    # Extract linker version number from stdin and turn into single number.
++    awk '{
++	gsub(".*\\)", "");
++	gsub(".*version ", "");
++	gsub("-.*", "");
++	split($1,a, ".");
++	print a[1]*100000000 + a[2]*1000000 + a[3]*10000;
++	exit
++    }'
++}
++
++# Do not include PT_INTERP segment when linking pie. Non-pie linking
++# just ignores this option.
++LD_VERSION=$(${CROSS}ld --version | ld_version)
++LD_NO_DL_MIN_VERSION=$(echo 2.26 | ld_version)
++if [ "$LD_VERSION" -ge "$LD_NO_DL_MIN_VERSION" ] ; then
++	nodl="--no-dynamic-linker"
++fi
+ 
+ platformo=$object/"$platform".o
+ lds=$object/zImage.lds
+@@ -412,7 +434,8 @@ if [ "$platform" != "miboot" ]; then
+     if [ -n "$link_address" ] ; then
+         text_start="-Ttext $link_address"
+     fi
+-    ${CROSS}ld -m $format -T $lds $text_start $pie -o "$ofile" \
++#link everything
++    ${CROSS}ld -m $format -T $lds $text_start $pie $nodl -o "$ofile" \
+ 	$platformo $tmp $object/wrapper.a
+     rm $tmp
+ fi
+-- 
+2.11.0
+
diff --git a/openpower/linux/0011-powerpc-Convert-cmp-to-cmpd-in-idle-enter-sequence.patch b/openpower/linux/0011-powerpc-Convert-cmp-to-cmpd-in-idle-enter-sequence.patch
new file mode 100644
index 0000000..41888e3
--- /dev/null
+++ b/openpower/linux/0011-powerpc-Convert-cmp-to-cmpd-in-idle-enter-sequence.patch
@@ -0,0 +1,45 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Segher Boessenkool <segher@kernel.crashing.org>
+Date: Thu, 6 Oct 2016 13:42:19 +0000
+Subject: [PATCH 11/12] powerpc: Convert cmp to cmpd in idle enter sequence
+
+PowerPC's "cmp" instruction has four operands. Normally people write
+"cmpw" or "cmpd" for the second cmp operand 0 or 1. But, frequently
+people forget, and write "cmp" with just three operands.
+
+With older binutils this is silently accepted as if this was "cmpw",
+while often "cmpd" is wanted. With newer binutils GAS will complain
+about this for 64-bit code. For 32-bit code it still silently assumes
+"cmpw" is what is meant.
+
+In this instance the code comes directly from ISA v2.07, including the
+cmp, but cmpd is correct. Backport to stable so that new toolchains can
+build old kernels.
+
+Fixes: 948cf67c4726 ("powerpc: Add NAP mode support on Power7 in HV mode")
+Cc: stable@vger.kernel.org # v3.0
+Reviewed-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
+Signed-off-by: Segher Boessenkool <segher@kernel.crashing.org>
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+(cherry picked from commit 80f23935cadb1c654e81951f5a8b7ceae0acc1b4)
+Signed-off-by: Joel Stanley <joel@jms.id.au>
+---
+ arch/powerpc/kernel/idle_power7.S | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/arch/powerpc/kernel/idle_power7.S b/arch/powerpc/kernel/idle_power7.S
+index 112ccf497562..73f638789a38 100644
+--- a/arch/powerpc/kernel/idle_power7.S
++++ b/arch/powerpc/kernel/idle_power7.S
+@@ -44,7 +44,7 @@
+ 	std	r0,0(r1);					\
+ 	ptesync;						\
+ 	ld	r0,0(r1);					\
+-1:	cmp	cr0,r0,r0;					\
++1:	cmpd	cr0,r0,r0;					\
+ 	bne	1b;						\
+ 	IDLE_INST;						\
+ 	b	.
+-- 
+2.11.0
+
diff --git a/openpower/linux/0012-Release-4.4.38-openpower1.patch b/openpower/linux/0012-Release-4.4.38-openpower1.patch
new file mode 100644
index 0000000..5a271ae
--- /dev/null
+++ b/openpower/linux/0012-Release-4.4.38-openpower1.patch
@@ -0,0 +1,37 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Joel Stanley <joel@jms.id.au>
+Date: Wed, 14 Dec 2016 13:20:09 +1030
+Subject: [PATCH 12/12] Release 4.4.38-openpower1
+
+ - Backports to fix building with modern binutils
+   * powerpc: Convert cmp to cmpd in idle enter sequence
+   * powerpc/boot: Request no dynamic linker for boot wrapper
+
+ - Add fix for our xhci workarounds. This fixes a hang in Petitboot when
+   shutting down with a usb device attached to an external usb hub.
+    * usb/xhci: allow xhci_check_bandwith in XHCI_STATE_REMOVING
+
+ - Move to latest upstream stable release
+   * Includes fixes from 4.4.36, 4.4.37, 4.4.38
+
+Signed-off-by: Joel Stanley <joel@jms.id.au>
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 6876efe0d735..fd471c6e111c 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,7 +1,7 @@
+ VERSION = 4
+ PATCHLEVEL = 4
+ SUBLEVEL = 38
+-EXTRAVERSION =
++EXTRAVERSION = -openpower1
+ NAME = Blurry Fish Butt
+ 
+ # *DOCUMENTATION*
+-- 
+2.11.0
+