Skip to content

Commit

Permalink
powerpc: Disable VPHN polling during a suspend operation
Browse files Browse the repository at this point in the history
Tie the polling mechanism into the ibm,suspend-me rtas call to
stop/restart polling before/after a suspend, hibernate, migrate,
or checkpoint restart operation. This ensures that the system has a
chance to disable the polling if the partition is migrated to a system
that does not support VPHN (and vice versa).

Signed-off-by: Jesse Larrew <jlarrew@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
  • Loading branch information
Jesse Larrew authored and Benjamin Herrenschmidt committed Dec 9, 2010
1 parent 9eff1a3 commit 3b7a27d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
10 changes: 10 additions & 0 deletions arch/powerpc/include/asm/topology.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ extern void __init dump_numa_cpu_topology(void);
extern int sysfs_add_device_to_node(struct sys_device *dev, int nid);
extern void sysfs_remove_device_from_node(struct sys_device *dev, int nid);

extern int start_topology_update(void);
extern int stop_topology_update(void);
#else

static inline void dump_numa_cpu_topology(void) {}
Expand All @@ -107,6 +109,14 @@ static inline void sysfs_remove_device_from_node(struct sys_device *dev,
{
}

static inline int start_topology_update(void)
{
return 0;
}
static inline int stop_topology_update(void)
{
return 0;
}
#endif /* CONFIG_NUMA */

#include <asm-generic/topology.h>
Expand Down
3 changes: 3 additions & 0 deletions arch/powerpc/kernel/rtas.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include <asm/atomic.h>
#include <asm/time.h>
#include <asm/mmu.h>
#include <asm/topology.h>

struct rtas_t rtas = {
.lock = __ARCH_SPIN_LOCK_UNLOCKED
Expand Down Expand Up @@ -713,6 +714,7 @@ static int __rtas_suspend_last_cpu(struct rtas_suspend_me_data *data, int wake_w
int cpu;

slb_set_size(SLB_MIN_SIZE);
stop_topology_update();
printk(KERN_DEBUG "calling ibm,suspend-me on cpu %i\n", smp_processor_id());

while (rc == H_MULTI_THREADS_ACTIVE && !atomic_read(&data->done) &&
Expand All @@ -728,6 +730,7 @@ static int __rtas_suspend_last_cpu(struct rtas_suspend_me_data *data, int wake_w
rc = atomic_read(&data->error);

atomic_set(&data->error, rc);
start_topology_update();

if (wake_when_done) {
atomic_set(&data->done, 1);
Expand Down

0 comments on commit 3b7a27d

Please sign in to comment.