Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8553f321 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'timers-fixes-for-linus' of...

Merge branch 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  timers: fix build error in !oneshot case
  x86: c1e_idle: don't mark TSC unstable if CPU has invariant TSC
  x86: prevent C-states hang on AMD C1E enabled machines
  clockevents: prevent mode mismatch on cpu online
  clockevents: check broadcast device not tick device
  clockevents: prevent stale tick_next_period for onlining CPUs
  x86: prevent stale state of c1e_mask across CPU offline/online
  clockevents: prevent cpu online to interfere with nohz
parents be3be890 f8e256c6
Loading
Loading
Loading
Loading
+12 −5
Original line number Diff line number Diff line
@@ -246,6 +246,14 @@ static int __cpuinit check_c1e_idle(const struct cpuinfo_x86 *c)
	return 1;
}

static cpumask_t c1e_mask = CPU_MASK_NONE;
static int c1e_detected;

void c1e_remove_cpu(int cpu)
{
	cpu_clear(cpu, c1e_mask);
}

/*
 * C1E aware idle routine. We check for C1E active in the interrupt
 * pending message MSR. If we detect C1E, then we handle it the same
@@ -253,9 +261,6 @@ static int __cpuinit check_c1e_idle(const struct cpuinfo_x86 *c)
 */
static void c1e_idle(void)
{
	static cpumask_t c1e_mask = CPU_MASK_NONE;
	static int c1e_detected;

	if (need_resched())
		return;

@@ -265,8 +270,10 @@ static void c1e_idle(void)
		rdmsr(MSR_K8_INT_PENDING_MSG, lo, hi);
		if (lo & K8_INTP_C1E_ACTIVE_MASK) {
			c1e_detected = 1;
			mark_tsc_unstable("TSC halt in C1E");
			printk(KERN_INFO "System has C1E enabled\n");
			if (!boot_cpu_has(X86_FEATURE_CONSTANT_TSC))
				mark_tsc_unstable("TSC halt in AMD C1E");
			printk(KERN_INFO "System has AMD C1E enabled\n");
			set_cpu_cap(&boot_cpu_data, X86_FEATURE_AMDC1E);
		}
	}

+1 −0
Original line number Diff line number Diff line
@@ -88,6 +88,7 @@ static void cpu_exit_clear(void)
	cpu_clear(cpu, cpu_callin_map);

	numa_remove_cpu(cpu);
	c1e_remove_cpu(cpu);
}

/* We don't actually take CPU down, just spin without interrupts. */
+2 −0
Original line number Diff line number Diff line
@@ -93,6 +93,8 @@ DECLARE_PER_CPU(int, cpu_state);
static inline void play_dead(void)
{
	idle_task_exit();
	c1e_remove_cpu(raw_smp_processor_id());

	mb();
	/* Ack it */
	__get_cpu_var(cpu_state) = CPU_DEAD;
+2 −0
Original line number Diff line number Diff line
@@ -140,6 +140,8 @@ static inline unsigned int acpi_processor_cstate_check(unsigned int max_cstate)
	    boot_cpu_data.x86_model <= 0x05 &&
	    boot_cpu_data.x86_mask < 0x0A)
		return 1;
	else if (boot_cpu_has(X86_FEATURE_AMDC1E))
		return 1;
	else
		return max_cstate;
}
+1 −0
Original line number Diff line number Diff line
@@ -81,6 +81,7 @@
#define X86_FEATURE_LFENCE_RDTSC (3*32+18) /* Lfence synchronizes RDTSC */
#define X86_FEATURE_11AP	(3*32+19) /* Bad local APIC aka 11AP */
#define X86_FEATURE_NOPL	(3*32+20) /* The NOPL (0F 1F) instructions */
#define X86_FEATURE_AMDC1E	(3*32+21) /* AMD C1E detected */

/* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */
#define X86_FEATURE_XMM3	(4*32+ 0) /* Streaming SIMD Extensions-3 */
Loading