Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 313627
b: refs/heads/master
c: 16aaaff
h: refs/heads/master
i:
  313625: bc1d364
  313623: 7947e6d
v: v3
  • Loading branch information
Deepthi Dharwar authored and Benjamin Herrenschmidt committed Jul 3, 2012
1 parent 67be15f commit 248f13f
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 25ebc45b93452d0bc60271f178237123c4b26808
refs/heads/master: 16aaaff68440dd95de98adb075303355814be6e0
2 changes: 0 additions & 2 deletions trunk/arch/powerpc/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -389,10 +389,8 @@ extern int powersave_nap; /* set if nap mode can be used in idle loop */

#ifdef CONFIG_PSERIES_IDLE
extern void update_smt_snooze_delay(int snooze);
extern int pseries_notify_cpuidle_add_cpu(int cpu);
#else
static inline void update_smt_snooze_delay(int snooze) {}
static inline int pseries_notify_cpuidle_add_cpu(int cpu) { return 0; }
#endif

extern void flush_instruction_cache(void);
Expand Down
25 changes: 19 additions & 6 deletions trunk/arch/powerpc/platforms/pseries/processor_idle.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <linux/moduleparam.h>
#include <linux/cpuidle.h>
#include <linux/cpu.h>
#include <linux/notifier.h>

#include <asm/paca.h>
#include <asm/reg.h>
Expand Down Expand Up @@ -186,17 +187,28 @@ static struct cpuidle_state shared_states[MAX_IDLE_STATE_COUNT] = {
.enter = &shared_cede_loop },
};

int pseries_notify_cpuidle_add_cpu(int cpu)
static int pseries_cpuidle_add_cpu_notifier(struct notifier_block *n,
unsigned long action, void *hcpu)
{
int hotcpu = (unsigned long)hcpu;
struct cpuidle_device *dev =
per_cpu_ptr(pseries_cpuidle_devices, cpu);
if (dev && cpuidle_get_driver()) {
cpuidle_disable_device(dev);
cpuidle_enable_device(dev);
per_cpu_ptr(pseries_cpuidle_devices, hotcpu);

switch (action & 0xf) {
case CPU_ONLINE:
if (dev && cpuidle_get_driver()) {
cpuidle_disable_device(dev);
cpuidle_enable_device(dev);
}
break;
}
return 0;
return NOTIFY_OK;
}

static struct notifier_block setup_hotplug_notifier = {
.notifier_call = pseries_cpuidle_add_cpu_notifier,
};

/*
* pseries_cpuidle_driver_init()
*/
Expand Down Expand Up @@ -321,6 +333,7 @@ static int __init pseries_processor_idle_init(void)
return retval;
}

register_cpu_notifier(&setup_hotplug_notifier);
printk(KERN_DEBUG "pseries_idle_driver registered\n");

return 0;
Expand Down
1 change: 0 additions & 1 deletion trunk/arch/powerpc/platforms/pseries/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ static void __devinit smp_xics_setup_cpu(int cpu)
set_cpu_current_state(cpu, CPU_STATE_ONLINE);
set_default_offline_state(cpu);
#endif
pseries_notify_cpuidle_add_cpu(cpu);
}

static int __devinit smp_pSeries_kick_cpu(int nr)
Expand Down

0 comments on commit 248f13f

Please sign in to comment.