Skip to content

Commit 3fa8cad

Browse files
Deepthi Dharwarozbenh
authored andcommitted
powerpc/pseries/cpuidle: smt-snooze-delay cleanup.
smt-snooze-delay was designed to disable NAP state or delay the entry to the NAP state prior to adoption of cpuidle framework. This is per-cpu variable. With the coming of CPUIDLE framework, states can be disabled on per-cpu basis using the cpuidle/enable sysfs entry. Also, with the coming of cpuidle driver each state's target residency is per-driver unlike earlier which was per-device. Therefore, the per-cpu sysfs smt-snooze-delay which decides the target residency of the idle state on a particular cpu causes more confusion to the user as we cannot have different smt-snooze-delay (target residency) values for each cpu. In the current code, smt-snooze-delay functionality is completely broken. It makes sense to remove smt-snooze-delay from idle driver with the coming of cpuidle framework. However, sysfs files are retained as ppc64_util currently utilises it. Once we fix ppc64_util, propose to clean up the kernel code. Signed-off-by: Deepthi Dharwar <deepthi@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
1 parent bf7f61f commit 3fa8cad

File tree

3 files changed

+0
-26
lines changed

3 files changed

+0
-26
lines changed

arch/powerpc/include/asm/processor.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -450,13 +450,6 @@ enum idle_boot_override {IDLE_NO_OVERRIDE = 0, IDLE_POWERSAVE_OFF};
450450

451451
extern int powersave_nap; /* set if nap mode can be used in idle loop */
452452
extern void power7_nap(void);
453-
454-
#ifdef CONFIG_PSERIES_CPUIDLE
455-
extern void update_smt_snooze_delay(int cpu, int residency);
456-
#else
457-
static inline void update_smt_snooze_delay(int cpu, int residency) {}
458-
#endif
459-
460453
extern void flush_instruction_cache(void);
461454
extern void hard_reset_now(void);
462455
extern void poweroff_now(void);

arch/powerpc/kernel/sysfs.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ static ssize_t store_smt_snooze_delay(struct device *dev,
5151
return -EINVAL;
5252

5353
per_cpu(smt_snooze_delay, cpu->dev.id) = snooze;
54-
update_smt_snooze_delay(cpu->dev.id, snooze);
55-
5654
return count;
5755
}
5856

drivers/cpuidle/cpuidle-pseries.c

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -162,23 +162,6 @@ static struct cpuidle_state shared_states[] = {
162162
.enter = &shared_cede_loop },
163163
};
164164

165-
void update_smt_snooze_delay(int cpu, int residency)
166-
{
167-
struct cpuidle_driver *drv = cpuidle_get_driver();
168-
struct cpuidle_device *dev = per_cpu(cpuidle_devices, cpu);
169-
170-
if (cpuidle_state_table != dedicated_states)
171-
return;
172-
173-
if (residency < 0) {
174-
/* Disable the Nap state on that cpu */
175-
if (dev)
176-
dev->states_usage[1].disable = 1;
177-
} else
178-
if (drv)
179-
drv->states[1].target_residency = residency;
180-
}
181-
182165
static int pseries_cpuidle_add_cpu_notifier(struct notifier_block *n,
183166
unsigned long action, void *hcpu)
184167
{

0 commit comments

Comments
 (0)