summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/pseries/suspend.c
diff options
context:
space:
mode:
authorHaren Myneni <hbabu@us.ibm.com>2014-02-25 20:02:18 -0800
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2014-03-07 15:54:49 +1100
commit6b36ba8492abd1c819e949e085cc547b062d8593 (patch)
tree83f51a02cb13333cbd9675a135828e4316699107 /arch/powerpc/platforms/pseries/suspend.c
parent39a33b59f43088aa33f29ace6b978333dd0bca4a (diff)
downloadblackbird-op-linux-6b36ba8492abd1c819e949e085cc547b062d8593.tar.gz
blackbird-op-linux-6b36ba8492abd1c819e949e085cc547b062d8593.zip
powerpc/pseries: Update dynamic cache nodes for suspend/resume operation
pHyp can change cache nodes for suspend/resume operation. Currently the device tree is updated by drmgr in userspace after all non boot CPUs are enabled. Hence, we do not modify the cache list based on the latest cache nodes. Also we do not remove cache entries for the primary CPU. This patch removes the cache list for the boot CPU, updates the device tree before enabling nonboot CPUs and adds cache list for the boot cpu. This patch also has the side effect that older versions of drmgr will perform a second device tree update from userspace. While this is a redundant waste of a couple cycles it is harmless since firmware returns the same data for the subsequent update-nodes/properties rtas calls. Signed-off-by: Haren Myneni <hbabu@us.ibm.com> Signed-off-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms/pseries/suspend.c')
-rw-r--r--arch/powerpc/platforms/pseries/suspend.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/pseries/suspend.c b/arch/powerpc/platforms/pseries/suspend.c
index 16a255255d30..1d9c580ab772 100644
--- a/arch/powerpc/platforms/pseries/suspend.c
+++ b/arch/powerpc/platforms/pseries/suspend.c
@@ -26,6 +26,7 @@
#include <asm/mmu.h>
#include <asm/rtas.h>
#include <asm/topology.h>
+#include "../../kernel/cacheinfo.h"
static u64 stream_id;
static struct device suspend_dev;
@@ -79,6 +80,23 @@ static int pseries_suspend_cpu(void)
}
/**
+ * pseries_suspend_enable_irqs
+ *
+ * Post suspend configuration updates
+ *
+ **/
+static void pseries_suspend_enable_irqs(void)
+{
+ /*
+ * Update configuration which can be modified based on device tree
+ * changes during resume.
+ */
+ cacheinfo_cpu_offline(smp_processor_id());
+ post_mobility_fixup();
+ cacheinfo_cpu_online(smp_processor_id());
+}
+
+/**
* pseries_suspend_enter - Final phase of hibernation
*
* Return value:
@@ -235,6 +253,7 @@ static int __init pseries_suspend_init(void)
return rc;
ppc_md.suspend_disable_cpu = pseries_suspend_cpu;
+ ppc_md.suspend_enable_irqs = pseries_suspend_enable_irqs;
suspend_set_ops(&pseries_suspend_ops);
return 0;
}
OpenPOWER on IntegriCloud