Home Home > GIT Browse > SLE15
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Suchanek <msuchanek@suse.de>2019-01-18 12:09:07 +0100
committerMichal Suchanek <msuchanek@suse.de>2019-01-18 12:16:55 +0100
commit4ace38c72512241042494f81441727bce75d783e (patch)
tree0bed53ef7d448938e01a3ba9b61ba2c653000a3e
parentb18d46108a6bacf34ae2a77896bce0b402def876 (diff)
powerpc/powernv: Clear LPCR[PECE1] via stop-api only for deep
state offline (bsc#1119766, bsc#1055121).
-rw-r--r--patches.arch/powerpc-powernv-Clear-LPCR-PECE1-via-stop-api-only-f.patch62
-rw-r--r--series.conf1
2 files changed, 63 insertions, 0 deletions
diff --git a/patches.arch/powerpc-powernv-Clear-LPCR-PECE1-via-stop-api-only-f.patch b/patches.arch/powerpc-powernv-Clear-LPCR-PECE1-via-stop-api-only-f.patch
new file mode 100644
index 0000000000..34cae27e91
--- /dev/null
+++ b/patches.arch/powerpc-powernv-Clear-LPCR-PECE1-via-stop-api-only-f.patch
@@ -0,0 +1,62 @@
+From 5d298baa41883fc421acfd932799c0f4177249ae Mon Sep 17 00:00:00 2001
+From: "Gautham R. Shenoy" <ego@linux.vnet.ibm.com>
+Date: Thu, 31 Aug 2017 17:17:41 +0530
+Subject: [PATCH] powerpc/powernv: Clear LPCR[PECE1] via stop-api only for deep
+ state offline
+
+References: bsc#1119766, bsc#1055121
+Patch-mainline: v4.14-rc2
+Git-commit: 5d298baa41883fc421acfd932799c0f4177249ae
+
+Commit 24be85a23d1f ("powerpc/powernv: Clear PECE1 in LPCR via
+stop-api only on Hotplug") clears the PECE1 bit of the LPCR via
+stop-api during CPU-Hotplug to prevent wakeup due to a decrementer on
+an offlined CPU which is in a deep stop state.
+
+In the case where the stop-api support is found to be lacking, the
+commit 785a12afdb4a ("powerpc/powernv/idle: Disable LOSE_FULL_CONTEXT
+states when stop-api fails") disables deep states that lose hypervisor
+context. Thus in this case, the offlined CPU will be put to some
+shallow idle state.
+
+However, we currently unconditionally clear the PECE1 in LPCR via
+stop-api during CPU-Hotplug even when deep states are disabled due to
+stop-api failure.
+
+Fix this by clearing PECE1 of LPCR via stop-api during CPU-Hotplug
+*only* when the offlined CPU will be put to a deep state that loses
+hypervisor context.
+
+Fixes: 24be85a23d1f ("powerpc/powernv: Clear PECE1 in LPCR via stop-api only on Hotplug")
+Reported-by: Pavithra Prakash <pavirampu@linux.vnet.ibm.com>
+Signed-off-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>
+Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
+Tested-by: Pavithra Prakash <pavrampu@linux.vnet.ibm.com>
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+Acked-by: Michal Suchanek <msuchanek@suse.de>
+---
+ arch/powerpc/platforms/powernv/idle.c | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/arch/powerpc/platforms/powernv/idle.c b/arch/powerpc/platforms/powernv/idle.c
+index 9f59041a172b..443d5ca71995 100644
+--- a/arch/powerpc/platforms/powernv/idle.c
++++ b/arch/powerpc/platforms/powernv/idle.c
+@@ -393,7 +393,13 @@ static void pnv_program_cpu_hotplug_lpcr(unsigned int cpu, u64 lpcr_val)
+ u64 pir = get_hard_smp_processor_id(cpu);
+
+ mtspr(SPRN_LPCR, lpcr_val);
+- opal_slw_set_reg(pir, SPRN_LPCR, lpcr_val);
++
++ /*
++ * Program the LPCR via stop-api only if the deepest stop state
++ * can lose hypervisor context.
++ */
++ if (supported_cpuidle_states & OPAL_PM_LOSE_FULL_CONTEXT)
++ opal_slw_set_reg(pir, SPRN_LPCR, lpcr_val);
+ }
+
+ /*
+--
+2.19.2
+
diff --git a/series.conf b/series.conf
index 14ecd3ec91..454694a959 100644
--- a/series.conf
+++ b/series.conf
@@ -6990,6 +6990,7 @@
patches.arch/s390-sles15-01-07-02-dynamic-topology.patch
patches.arch/powerpc-sysrq-Fix-oops-whem-ppmu-is-not-registered.patch
patches.arch/powerpc-tm-Flush-TM-only-if-CPU-has-TM-feature.patch
+ patches.arch/powerpc-powernv-Clear-LPCR-PECE1-via-stop-api-only-f.patch
patches.arch/powerpc-eeh-Create-PHB-PEs-after-EEH-is-initialized.patch
patches.arch/powerpc-pseries-Fix-OF-ERROR-Bad-of_node_put-on-cpus.patch
patches.arch/powerpc-pseries-Fix-parent_dn-reference-leak-in-add_.patch