Merge pull request #2065 from shenki/kernel-4.16.4

kernel: Move to Linux 4.16.4-openpower1
diff --git a/openpower/configs/barreleye_defconfig b/openpower/configs/barreleye_defconfig
index 4ddeb75..cb26a52 100644
--- a/openpower/configs/barreleye_defconfig
+++ b/openpower/configs/barreleye_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.16.1"
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.16.4"
 BR2_LINUX_KERNEL_PATCH="$(BR2_EXTERNAL_OP_BUILD_PATH)/linux"
 BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
 BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_OP_BUILD_PATH)/configs/linux/skiroot_defconfig"
diff --git a/openpower/configs/firenze_defconfig b/openpower/configs/firenze_defconfig
index bb8d52b..653e8be 100644
--- a/openpower/configs/firenze_defconfig
+++ b/openpower/configs/firenze_defconfig
@@ -13,7 +13,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.16.1"
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.16.4"
 BR2_LINUX_KERNEL_PATCH="$(BR2_EXTERNAL_OP_BUILD_PATH)/linux"
 BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
 BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_OP_BUILD_PATH)/configs/linux/skiroot_defconfig"
diff --git a/openpower/configs/firestone_defconfig b/openpower/configs/firestone_defconfig
index 8137e83..9e18ba1 100644
--- a/openpower/configs/firestone_defconfig
+++ b/openpower/configs/firestone_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.16.1"
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.16.4"
 BR2_LINUX_KERNEL_PATCH="$(BR2_EXTERNAL_OP_BUILD_PATH)/linux"
 BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
 BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_OP_BUILD_PATH)/configs/linux/skiroot_defconfig"
diff --git a/openpower/configs/garrison_defconfig b/openpower/configs/garrison_defconfig
index ccb5a4a..fab65c1 100644
--- a/openpower/configs/garrison_defconfig
+++ b/openpower/configs/garrison_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.16.1"
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.16.4"
 BR2_LINUX_KERNEL_PATCH="$(BR2_EXTERNAL_OP_BUILD_PATH)/linux"
 BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
 BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_OP_BUILD_PATH)/configs/linux/skiroot_defconfig"
diff --git a/openpower/configs/habanero_defconfig b/openpower/configs/habanero_defconfig
index 20e84c4..27802d1 100644
--- a/openpower/configs/habanero_defconfig
+++ b/openpower/configs/habanero_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.16.1"
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.16.4"
 BR2_LINUX_KERNEL_PATCH="$(BR2_EXTERNAL_OP_BUILD_PATH)/linux"
 BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
 BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_OP_BUILD_PATH)/configs/linux/skiroot_defconfig"
diff --git a/openpower/configs/openpower_mambo_defconfig b/openpower/configs/openpower_mambo_defconfig
index 3f89280..355caaf 100644
--- a/openpower/configs/openpower_mambo_defconfig
+++ b/openpower/configs/openpower_mambo_defconfig
@@ -11,7 +11,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.16.1"
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.16.4"
 BR2_LINUX_KERNEL_PATCH="$(BR2_EXTERNAL_OP_BUILD_PATH)/linux"
 BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
 BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_OP_BUILD_PATH)/configs/linux/skiroot_defconfig"
diff --git a/openpower/configs/openpower_p9_mambo_defconfig b/openpower/configs/openpower_p9_mambo_defconfig
index 5de9b9a..cff6f4a 100644
--- a/openpower/configs/openpower_p9_mambo_defconfig
+++ b/openpower/configs/openpower_p9_mambo_defconfig
@@ -11,7 +11,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.16.1"
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.16.4"
 BR2_LINUX_KERNEL_PATCH="$(BR2_EXTERNAL_OP_BUILD_PATH)/linux"
 BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
 BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_OP_BUILD_PATH)/configs/linux/skiroot_defconfig"
diff --git a/openpower/configs/p9dsu_defconfig b/openpower/configs/p9dsu_defconfig
index f7dc28d..4c5e5de 100644
--- a/openpower/configs/p9dsu_defconfig
+++ b/openpower/configs/p9dsu_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.16.1"
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.16.4"
 BR2_LINUX_KERNEL_PATCH="$(BR2_EXTERNAL_OP_BUILD_PATH)/linux"
 BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
 BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_OP_BUILD_PATH)/configs/linux/skiroot_defconfig"
diff --git a/openpower/configs/palmetto_defconfig b/openpower/configs/palmetto_defconfig
index e03ce42..eb845fa 100644
--- a/openpower/configs/palmetto_defconfig
+++ b/openpower/configs/palmetto_defconfig
@@ -13,7 +13,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.16.1"
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.16.4"
 BR2_LINUX_KERNEL_PATCH="$(BR2_EXTERNAL_OP_BUILD_PATH)/linux"
 BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
 BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_OP_BUILD_PATH)/configs/linux/skiroot_defconfig"
diff --git a/openpower/configs/pseries_defconfig b/openpower/configs/pseries_defconfig
index 4c3706e..e9e3005 100644
--- a/openpower/configs/pseries_defconfig
+++ b/openpower/configs/pseries_defconfig
@@ -13,7 +13,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.16.1"
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.16.4"
 BR2_LINUX_KERNEL_PATCH="$(BR2_EXTERNAL_OP_BUILD_PATH)/linux"
 BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
 BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_OP_BUILD_PATH)/configs/linux/pseries_skiroot_defconfig"
diff --git a/openpower/configs/romulus_defconfig b/openpower/configs/romulus_defconfig
index 3091d62..7fb6c1d 100644
--- a/openpower/configs/romulus_defconfig
+++ b/openpower/configs/romulus_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.16.1"
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.16.4"
 BR2_LINUX_KERNEL_PATCH="$(BR2_EXTERNAL_OP_BUILD_PATH)/linux"
 BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
 BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_OP_BUILD_PATH)/configs/linux/skiroot_defconfig"
diff --git a/openpower/configs/vesnin_defconfig b/openpower/configs/vesnin_defconfig
index db06499..e38b6ab 100644
--- a/openpower/configs/vesnin_defconfig
+++ b/openpower/configs/vesnin_defconfig
@@ -13,7 +13,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.16.1"
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.16.4"
 BR2_LINUX_KERNEL_PATCH="$(BR2_EXTERNAL_OP_BUILD_PATH)/linux"
 BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
 BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_OP_BUILD_PATH)/configs/linux/skiroot_defconfig"
diff --git a/openpower/configs/witherspoon_defconfig b/openpower/configs/witherspoon_defconfig
index c06608b..442a9fc 100644
--- a/openpower/configs/witherspoon_defconfig
+++ b/openpower/configs/witherspoon_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.16.1"
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.16.4"
 BR2_LINUX_KERNEL_PATCH="$(BR2_EXTERNAL_OP_BUILD_PATH)/linux"
 BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
 BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_OP_BUILD_PATH)/configs/linux/skiroot_defconfig"
diff --git a/openpower/configs/zaius_defconfig b/openpower/configs/zaius_defconfig
index 545df64..0159091 100644
--- a/openpower/configs/zaius_defconfig
+++ b/openpower/configs/zaius_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.16.1"
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.16.4"
 BR2_LINUX_KERNEL_PATCH="$(BR2_EXTERNAL_OP_BUILD_PATH)/linux"
 BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
 BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_OP_BUILD_PATH)/configs/linux/skiroot_defconfig"
diff --git a/openpower/configs/zz_defconfig b/openpower/configs/zz_defconfig
index abc6e22..57385c6 100644
--- a/openpower/configs/zz_defconfig
+++ b/openpower/configs/zz_defconfig
@@ -13,7 +13,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.16.1"
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.16.4"
 BR2_LINUX_KERNEL_PATCH="$(BR2_EXTERNAL_OP_BUILD_PATH)/linux"
 BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
 BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_OP_BUILD_PATH)/configs/linux/skiroot_defconfig"
diff --git a/openpower/linux/0001-xhci-Reset-controller-on-xhci-shutdown.patch b/openpower/linux/0001-xhci-Reset-controller-on-xhci-shutdown.patch
index 55c0f56..6ad582b 100644
--- a/openpower/linux/0001-xhci-Reset-controller-on-xhci-shutdown.patch
+++ b/openpower/linux/0001-xhci-Reset-controller-on-xhci-shutdown.patch
@@ -1,7 +1,7 @@
 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
 From: Brian King <brking@linux.vnet.ibm.com>
 Date: Wed, 25 Oct 2017 10:42:59 +1100
-Subject: [PATCH 1/4] xhci: Reset controller on xhci shutdown
+Subject: [PATCH 1/2] xhci: Reset controller on xhci shutdown
 
 Fixes kexec boot. Without a hard reset, some USB chips will fail to
 initialize in a kexec booted kernel.
diff --git a/openpower/linux/0004-Release-OpenPower-kernel.patch b/openpower/linux/0002-Release-OpenPower-kernel.patch
similarity index 77%
rename from openpower/linux/0004-Release-OpenPower-kernel.patch
rename to openpower/linux/0002-Release-OpenPower-kernel.patch
index c5bcf72..b0e3d0c 100644
--- a/openpower/linux/0004-Release-OpenPower-kernel.patch
+++ b/openpower/linux/0002-Release-OpenPower-kernel.patch
@@ -1,7 +1,7 @@
 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
 From: Joel Stanley <joel@jms.id.au>
 Date: Mon, 9 Apr 2018 12:03:25 +0930
-Subject: [PATCH 4/4] Release OpenPower kernel
+Subject: [PATCH 2/2] Release OpenPower kernel
 
 Signed-off-by: Joel Stanley <joel@jms.id.au>
 ---
@@ -9,15 +9,15 @@
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/Makefile b/Makefile
-index 1773c718074e..692f4f732128 100644
+index d51175192ac1..9aacc376200a 100644
 --- a/Makefile
 +++ b/Makefile
 @@ -2,7 +2,7 @@
  VERSION = 4
  PATCHLEVEL = 16
- SUBLEVEL = 1
+ SUBLEVEL = 4
 -EXTRAVERSION =
-+EXTRAVERSION = -openpower2
++EXTRAVERSION = -openpower1
  NAME = Fearless Coyote
  
  # *DOCUMENTATION*
diff --git a/openpower/linux/0002-powerpc-eeh-Fix-race-with-driver-un-bind.patch b/openpower/linux/0002-powerpc-eeh-Fix-race-with-driver-un-bind.patch
deleted file mode 100644
index 14e33fd..0000000
--- a/openpower/linux/0002-powerpc-eeh-Fix-race-with-driver-un-bind.patch
+++ /dev/null
@@ -1,256 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Michael Neuling <mikey@neuling.org>
-Date: Mon, 26 Mar 2018 15:17:07 +1100
-Subject: [PATCH 2/4] powerpc/eeh: Fix race with driver un/bind
-
-The current EEH callbacks can race with a driver unbind. This can
-result in a backtraces like this:
-
-  EEH: Frozen PHB#0-PE#1fc detected
-  EEH: PE location: S000009, PHB location: N/A
-  CPU: 2 PID: 2312 Comm: kworker/u258:3 Not tainted 4.15.6-openpower1 #2
-  Workqueue: nvme-wq nvme_reset_work [nvme]
-  Call Trace:
-    dump_stack+0x9c/0xd0 (unreliable)
-    eeh_dev_check_failure+0x420/0x470
-    eeh_check_failure+0xa0/0xa4
-    nvme_reset_work+0x138/0x1414 [nvme]
-    process_one_work+0x1ec/0x328
-    worker_thread+0x2e4/0x3a8
-    kthread+0x14c/0x154
-    ret_from_kernel_thread+0x5c/0xc8
-  nvme nvme1: Removing after probe failure status: -19
-  <snip>
-  cpu 0x23: Vector: 300 (Data Access) at [c000000ff50f3800]
-      pc: c0080000089a0eb0: nvme_error_detected+0x4c/0x90 [nvme]
-      lr: c000000000026564: eeh_report_error+0xe0/0x110
-      sp: c000000ff50f3a80
-     msr: 9000000000009033
-     dar: 400
-   dsisr: 40000000
-    current = 0xc000000ff507c000
-    paca    = 0xc00000000fdc9d80   softe: 0        irq_happened: 0x01
-      pid   = 782, comm = eehd
-  Linux version 4.15.6-openpower1 (smc@smc-desktop) (gcc version 6.4.0 (Buildroot 2017.11.2-00008-g4b6188e)) #2 SM                                             P Tue Feb 27 12:33:27 PST 2018
-  enter ? for help
-    eeh_report_error+0xe0/0x110
-    eeh_pe_dev_traverse+0xc0/0xdc
-    eeh_handle_normal_event+0x184/0x4c4
-    eeh_handle_event+0x30/0x288
-    eeh_event_handler+0x124/0x170
-    kthread+0x14c/0x154
-    ret_from_kernel_thread+0x5c/0xc8
-
-The first part is an EEH (on boot), the second half is the resulting
-crash. nvme probe starts the nvme_reset_work() worker thread. This
-worker thread starts touching the device which see a device error
-(EEH) and hence queues up an event in the powerpc EEH worker
-thread. nvme_reset_work() then continues and runs
-nvme_remove_dead_ctrl_work() which results in unbinding the driver
-from the device and hence releases all resources. At the same time,
-the EEH worker thread starts doing the EEH .error_detected() driver
-callback, which no longer works since the resources have been freed.
-
-This fixes the problem in the same way the generic PCIe AER code (in
-drivers/pci/pcie/aer/aerdrv_core.c) does. It makes the EEH code hold
-the device_lock() while performing the driver EEH callbacks and
-associated code. This ensures either the callbacks are no longer
-register, or if they are registered the driver will not be removed
-from underneath us.
-
-This has been broken forever. The EEH call backs were first introduced
-in 2005 (in 77bd7415610) but it's not clear if a lock was needed back
-then.
-
-Fixes: 77bd74156101 ("[PATCH] powerpc: PCI Error Recovery: PPC64 core recovery routines")
-Cc: stable@vger.kernel.org # v2.6.16+
-Signed-off-by: Michael Neuling <mikey@neuling.org>
-Reviewed-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
-(cherry picked from commit f0295e047fcf52ccb42561fb7de6942f5201b676)
-Signed-off-by: Joel Stanley <joel@jms.id.au>
----
- arch/powerpc/kernel/eeh_driver.c | 68 ++++++++++++++++++++------------
- 1 file changed, 42 insertions(+), 26 deletions(-)
-
-diff --git a/arch/powerpc/kernel/eeh_driver.c b/arch/powerpc/kernel/eeh_driver.c
-index 0c0b66fc5bfb..295ba833846e 100644
---- a/arch/powerpc/kernel/eeh_driver.c
-+++ b/arch/powerpc/kernel/eeh_driver.c
-@@ -207,18 +207,18 @@ static void *eeh_report_error(void *data, void *userdata)
- 
- 	if (!dev || eeh_dev_removed(edev) || eeh_pe_passed(edev->pe))
- 		return NULL;
-+
-+	device_lock(&dev->dev);
- 	dev->error_state = pci_channel_io_frozen;
- 
- 	driver = eeh_pcid_get(dev);
--	if (!driver) return NULL;
-+	if (!driver) goto out_no_dev;
- 
- 	eeh_disable_irq(dev);
- 
- 	if (!driver->err_handler ||
--	    !driver->err_handler->error_detected) {
--		eeh_pcid_put(dev);
--		return NULL;
--	}
-+	    !driver->err_handler->error_detected)
-+		goto out;
- 
- 	rc = driver->err_handler->error_detected(dev, pci_channel_io_frozen);
- 
-@@ -227,8 +227,12 @@ static void *eeh_report_error(void *data, void *userdata)
- 	if (*res == PCI_ERS_RESULT_NONE) *res = rc;
- 
- 	edev->in_error = true;
--	eeh_pcid_put(dev);
- 	pci_uevent_ers(dev, PCI_ERS_RESULT_NONE);
-+
-+out:
-+	eeh_pcid_put(dev);
-+out_no_dev:
-+	device_unlock(&dev->dev);
- 	return NULL;
- }
- 
-@@ -251,15 +255,14 @@ static void *eeh_report_mmio_enabled(void *data, void *userdata)
- 	if (!dev || eeh_dev_removed(edev) || eeh_pe_passed(edev->pe))
- 		return NULL;
- 
-+	device_lock(&dev->dev);
- 	driver = eeh_pcid_get(dev);
--	if (!driver) return NULL;
-+	if (!driver) goto out_no_dev;
- 
- 	if (!driver->err_handler ||
- 	    !driver->err_handler->mmio_enabled ||
--	    (edev->mode & EEH_DEV_NO_HANDLER)) {
--		eeh_pcid_put(dev);
--		return NULL;
--	}
-+	    (edev->mode & EEH_DEV_NO_HANDLER))
-+		goto out;
- 
- 	rc = driver->err_handler->mmio_enabled(dev);
- 
-@@ -267,7 +270,10 @@ static void *eeh_report_mmio_enabled(void *data, void *userdata)
- 	if (rc == PCI_ERS_RESULT_NEED_RESET) *res = rc;
- 	if (*res == PCI_ERS_RESULT_NONE) *res = rc;
- 
-+out:
- 	eeh_pcid_put(dev);
-+out_no_dev:
-+	device_unlock(&dev->dev);
- 	return NULL;
- }
- 
-@@ -290,20 +296,20 @@ static void *eeh_report_reset(void *data, void *userdata)
- 
- 	if (!dev || eeh_dev_removed(edev) || eeh_pe_passed(edev->pe))
- 		return NULL;
-+
-+	device_lock(&dev->dev);
- 	dev->error_state = pci_channel_io_normal;
- 
- 	driver = eeh_pcid_get(dev);
--	if (!driver) return NULL;
-+	if (!driver) goto out_no_dev;
- 
- 	eeh_enable_irq(dev);
- 
- 	if (!driver->err_handler ||
- 	    !driver->err_handler->slot_reset ||
- 	    (edev->mode & EEH_DEV_NO_HANDLER) ||
--	    (!edev->in_error)) {
--		eeh_pcid_put(dev);
--		return NULL;
--	}
-+	    (!edev->in_error))
-+		goto out;
- 
- 	rc = driver->err_handler->slot_reset(dev);
- 	if ((*res == PCI_ERS_RESULT_NONE) ||
-@@ -311,7 +317,10 @@ static void *eeh_report_reset(void *data, void *userdata)
- 	if (*res == PCI_ERS_RESULT_DISCONNECT &&
- 	     rc == PCI_ERS_RESULT_NEED_RESET) *res = rc;
- 
-+out:
- 	eeh_pcid_put(dev);
-+out_no_dev:
-+	device_unlock(&dev->dev);
- 	return NULL;
- }
- 
-@@ -362,10 +371,12 @@ static void *eeh_report_resume(void *data, void *userdata)
- 
- 	if (!dev || eeh_dev_removed(edev) || eeh_pe_passed(edev->pe))
- 		return NULL;
-+
-+	device_lock(&dev->dev);
- 	dev->error_state = pci_channel_io_normal;
- 
- 	driver = eeh_pcid_get(dev);
--	if (!driver) return NULL;
-+	if (!driver) goto out_no_dev;
- 
- 	was_in_error = edev->in_error;
- 	edev->in_error = false;
-@@ -375,18 +386,20 @@ static void *eeh_report_resume(void *data, void *userdata)
- 	    !driver->err_handler->resume ||
- 	    (edev->mode & EEH_DEV_NO_HANDLER) || !was_in_error) {
- 		edev->mode &= ~EEH_DEV_NO_HANDLER;
--		eeh_pcid_put(dev);
--		return NULL;
-+		goto out;
- 	}
- 
- 	driver->err_handler->resume(dev);
- 
--	eeh_pcid_put(dev);
- 	pci_uevent_ers(dev, PCI_ERS_RESULT_RECOVERED);
-+out:
-+	eeh_pcid_put(dev);
- #ifdef CONFIG_PCI_IOV
- 	if (eeh_ops->notify_resume && eeh_dev_to_pdn(edev))
- 		eeh_ops->notify_resume(eeh_dev_to_pdn(edev));
- #endif
-+out_no_dev:
-+	device_unlock(&dev->dev);
- 	return NULL;
- }
- 
-@@ -406,23 +419,26 @@ static void *eeh_report_failure(void *data, void *userdata)
- 
- 	if (!dev || eeh_dev_removed(edev) || eeh_pe_passed(edev->pe))
- 		return NULL;
-+
-+	device_lock(&dev->dev);
- 	dev->error_state = pci_channel_io_perm_failure;
- 
- 	driver = eeh_pcid_get(dev);
--	if (!driver) return NULL;
-+	if (!driver) goto out_no_dev;
- 
- 	eeh_disable_irq(dev);
- 
- 	if (!driver->err_handler ||
--	    !driver->err_handler->error_detected) {
--		eeh_pcid_put(dev);
--		return NULL;
--	}
-+	    !driver->err_handler->error_detected)
-+		goto out;
- 
- 	driver->err_handler->error_detected(dev, pci_channel_io_perm_failure);
- 
--	eeh_pcid_put(dev);
- 	pci_uevent_ers(dev, PCI_ERS_RESULT_DISCONNECT);
-+out:
-+	eeh_pcid_put(dev);
-+out_no_dev:
-+	device_unlock(&dev->dev);
- 	return NULL;
- }
- 
diff --git a/openpower/linux/0003-powerpc-mm-radix-Fix-checkstops-caused-by-invalid-tl.patch b/openpower/linux/0003-powerpc-mm-radix-Fix-checkstops-caused-by-invalid-tl.patch
deleted file mode 100644
index 8e871e8..0000000
--- a/openpower/linux/0003-powerpc-mm-radix-Fix-checkstops-caused-by-invalid-tl.patch
+++ /dev/null
@@ -1,71 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Michael Ellerman <mpe@ellerman.id.au>
-Date: Thu, 12 Apr 2018 15:53:52 +1000
-Subject: [PATCH 3/4] powerpc/mm/radix: Fix checkstops caused by invalid tlbiel
-
-In tlbiel_radix_set_isa300() we use the PPC_TLBIEL() macro to
-construct tlbiel instructions. The instruction takes 5 fields, two of
-which are registers, and the others are constants. But because it's
-constructed with inline asm the compiler doesn't know that.
-
-We got the constraint wrong on the 'r' field, using "r" tells the
-compiler to put the value in a register. The value we then get in the
-macro is the *register number*, not the value of the field.
-
-That means when we mask the register number with 0x1 we get 0 or 1
-depending on which register the compiler happens to put the constant
-in, eg:
-
-  li      r10,1
-  tlbiel  r8,r9,2,0,0
-
-  li      r7,1
-  tlbiel  r10,r6,0,0,1
-
-If we're unlucky we might generate an invalid instruction form, for
-example RIC=0, PRS=1 and R=0, tlbiel r8,r7,0,1,0, this has been
-observed to cause machine checks:
-
-  Oops: Machine check, sig: 7 [#1]
-  CPU: 24 PID: 0 Comm: swapper
-  NIP:  00000000000385f4 LR: 000000000100ed00 CTR: 000000000000007f
-  REGS: c00000000110bb40 TRAP: 0200
-  MSR:  9000000000201003 <SF,HV,ME,RI,LE>  CR: 48002222  XER: 20040000
-  CFAR: 00000000000385d0 DAR: 0000000000001c00 DSISR: 00000200 SOFTE: 1
-
-If the machine check happens early in boot while we have MSR_ME=0 it
-will escalate into a checkstop and kill the box entirely.
-
-To fix it we could change the inline asm constraint to "i" which
-tells the compiler the value is a constant. But a better fix is to just
-pass a literal 1 into the macro, which bypasses any problems with inline
-asm constraints.
-
-Fixes: d4748276ae14 ("powerpc/64s: Improve local TLB flush for boot and MCE on POWER9")
-Cc: stable@vger.kernel.org # v4.16+
-Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
-Signed-off-by: Joel Stanley <joel@jms.id.au>
----
- arch/powerpc/mm/tlb-radix.c | 5 ++---
- 1 file changed, 2 insertions(+), 3 deletions(-)
-
-diff --git a/arch/powerpc/mm/tlb-radix.c b/arch/powerpc/mm/tlb-radix.c
-index a07f5372a4bf..9ab051155af3 100644
---- a/arch/powerpc/mm/tlb-radix.c
-+++ b/arch/powerpc/mm/tlb-radix.c
-@@ -33,13 +33,12 @@ static inline void tlbiel_radix_set_isa300(unsigned int set, unsigned int is,
- {
- 	unsigned long rb;
- 	unsigned long rs;
--	unsigned int r = 1; /* radix format */
- 
- 	rb = (set << PPC_BITLSHIFT(51)) | (is << PPC_BITLSHIFT(53));
- 	rs = ((unsigned long)pid << PPC_BITLSHIFT(31));
- 
--	asm volatile(PPC_TLBIEL(%0, %1, %2, %3, %4)
--		     : : "r"(rb), "r"(rs), "i"(ric), "i"(prs), "r"(r)
-+	asm volatile(PPC_TLBIEL(%0, %1, %2, %3, 1)
-+		     : : "r"(rb), "r"(rs), "i"(ric), "i"(prs)
- 		     : "memory");
- }
-