Skip to content

Commit 0ba3759

Browse files
Venkatesh Pallipadilenb
Venkatesh Pallipadi
authored andcommitted
---
yaml --- r: 143292 b: "refs/heads/rpi-3.2.27+kamal-st7735fb" c: db954b5 h: "refs/heads/rpi-3.2.27+kamal-st7735fb" v: v3
1 parent e71cba8 commit 0ba3759

File tree

6 files changed

+38
-30
lines changed

6 files changed

+38
-30
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
"refs/heads/rpi-3.2.27+kamal-st7735fb": 18b2646fe3babeb40b34a0c1751e0bf5adfdc64c
2+
"refs/heads/rpi-3.2.27+kamal-st7735fb": db954b5898dd3ef3ef93f4144158ea8f97deb058

trunk/arch/x86/include/asm/cpufeature.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@
154154
* CPUID levels like 0x6, 0xA etc
155155
*/
156156
#define X86_FEATURE_IDA (7*32+ 0) /* Intel Dynamic Acceleration */
157+
#define X86_FEATURE_ARAT (7*32+ 1) /* Always Running APIC Timer */
157158

158159
/* Virtualization flags: Linux defined */
159160
#define X86_FEATURE_TPR_SHADOW (8*32+ 0) /* Intel TPR Shadow */

trunk/arch/x86/kernel/apic/apic.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,12 @@ static void __cpuinit setup_APIC_timer(void)
431431
{
432432
struct clock_event_device *levt = &__get_cpu_var(lapic_events);
433433

434+
if (cpu_has(&current_cpu_data, X86_FEATURE_ARAT)) {
435+
lapic_clockevent.features &= ~CLOCK_EVT_FEAT_C3STOP;
436+
/* Make LAPIC timer preferrable over percpu HPET */
437+
lapic_clockevent.rating = 150;
438+
}
439+
434440
memcpy(levt, &lapic_clockevent, sizeof(*levt));
435441
levt->cpumask = cpumask_of(smp_processor_id());
436442

trunk/arch/x86/kernel/cpu/addon_cpuid_features.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ void __cpuinit init_scattered_cpuid_features(struct cpuinfo_x86 *c)
3131

3232
static const struct cpuid_bit __cpuinitconst cpuid_bits[] = {
3333
{ X86_FEATURE_IDA, CR_EAX, 1, 0x00000006 },
34+
{ X86_FEATURE_ARAT, CR_EAX, 2, 0x00000006 },
3435
{ 0, 0, 0, 0 }
3536
};
3637

trunk/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c

Lines changed: 26 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ struct acpi_cpufreq_data {
6868
unsigned int max_freq;
6969
unsigned int resume;
7070
unsigned int cpu_feature;
71-
u64 saved_aperf, saved_mperf;
7271
};
7372

7473
static DEFINE_PER_CPU(struct acpi_cpufreq_data *, drv_data);
@@ -242,23 +241,26 @@ static u32 get_cur_val(const struct cpumask *mask)
242241
return cmd.val;
243242
}
244243

245-
struct perf_pair {
244+
struct perf_cur {
246245
union {
247246
struct {
248247
u32 lo;
249248
u32 hi;
250249
} split;
251250
u64 whole;
252-
} aperf, mperf;
251+
} aperf_cur, mperf_cur;
253252
};
254253

255254

256255
static long read_measured_perf_ctrs(void *_cur)
257256
{
258-
struct perf_pair *cur = _cur;
257+
struct perf_cur *cur = _cur;
259258

260-
rdmsr(MSR_IA32_APERF, cur->aperf.split.lo, cur->aperf.split.hi);
261-
rdmsr(MSR_IA32_MPERF, cur->mperf.split.lo, cur->mperf.split.hi);
259+
rdmsr(MSR_IA32_APERF, cur->aperf_cur.split.lo, cur->aperf_cur.split.hi);
260+
rdmsr(MSR_IA32_MPERF, cur->mperf_cur.split.lo, cur->mperf_cur.split.hi);
261+
262+
wrmsr(MSR_IA32_APERF, 0, 0);
263+
wrmsr(MSR_IA32_MPERF, 0, 0);
262264

263265
return 0;
264266
}
@@ -279,57 +281,52 @@ static long read_measured_perf_ctrs(void *_cur)
279281
static unsigned int get_measured_perf(struct cpufreq_policy *policy,
280282
unsigned int cpu)
281283
{
282-
struct perf_pair readin, cur;
284+
struct perf_cur cur;
283285
unsigned int perf_percent;
284286
unsigned int retval;
285287

286-
if (!work_on_cpu(cpu, read_measured_perf_ctrs, &readin))
288+
if (!work_on_cpu(cpu, read_measured_perf_ctrs, &cur))
287289
return 0;
288290

289-
cur.aperf.whole = readin.aperf.whole -
290-
per_cpu(drv_data, cpu)->saved_aperf;
291-
cur.mperf.whole = readin.mperf.whole -
292-
per_cpu(drv_data, cpu)->saved_mperf;
293-
per_cpu(drv_data, cpu)->saved_aperf = readin.aperf.whole;
294-
per_cpu(drv_data, cpu)->saved_mperf = readin.mperf.whole;
295-
296291
#ifdef __i386__
297292
/*
298293
* We dont want to do 64 bit divide with 32 bit kernel
299294
* Get an approximate value. Return failure in case we cannot get
300295
* an approximate value.
301296
*/
302-
if (unlikely(cur.aperf.split.hi || cur.mperf.split.hi)) {
297+
if (unlikely(cur.aperf_cur.split.hi || cur.mperf_cur.split.hi)) {
303298
int shift_count;
304299
u32 h;
305300

306-
h = max_t(u32, cur.aperf.split.hi, cur.mperf.split.hi);
301+
h = max_t(u32, cur.aperf_cur.split.hi, cur.mperf_cur.split.hi);
307302
shift_count = fls(h);
308303

309-
cur.aperf.whole >>= shift_count;
310-
cur.mperf.whole >>= shift_count;
304+
cur.aperf_cur.whole >>= shift_count;
305+
cur.mperf_cur.whole >>= shift_count;
311306
}
312307

313-
if (((unsigned long)(-1) / 100) < cur.aperf.split.lo) {
308+
if (((unsigned long)(-1) / 100) < cur.aperf_cur.split.lo) {
314309
int shift_count = 7;
315-
cur.aperf.split.lo >>= shift_count;
316-
cur.mperf.split.lo >>= shift_count;
310+
cur.aperf_cur.split.lo >>= shift_count;
311+
cur.mperf_cur.split.lo >>= shift_count;
317312
}
318313

319-
if (cur.aperf.split.lo && cur.mperf.split.lo)
320-
perf_percent = (cur.aperf.split.lo * 100) / cur.mperf.split.lo;
314+
if (cur.aperf_cur.split.lo && cur.mperf_cur.split.lo)
315+
perf_percent = (cur.aperf_cur.split.lo * 100) /
316+
cur.mperf_cur.split.lo;
321317
else
322318
perf_percent = 0;
323319

324320
#else
325-
if (unlikely(((unsigned long)(-1) / 100) < cur.aperf.whole)) {
321+
if (unlikely(((unsigned long)(-1) / 100) < cur.aperf_cur.whole)) {
326322
int shift_count = 7;
327-
cur.aperf.whole >>= shift_count;
328-
cur.mperf.whole >>= shift_count;
323+
cur.aperf_cur.whole >>= shift_count;
324+
cur.mperf_cur.whole >>= shift_count;
329325
}
330326

331-
if (cur.aperf.whole && cur.mperf.whole)
332-
perf_percent = (cur.aperf.whole * 100) / cur.mperf.whole;
327+
if (cur.aperf_cur.whole && cur.mperf_cur.whole)
328+
perf_percent = (cur.aperf_cur.whole * 100) /
329+
cur.mperf_cur.whole;
333330
else
334331
perf_percent = 0;
335332

trunk/drivers/acpi/processor_idle.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,9 @@ static void acpi_timer_check_state(int state, struct acpi_processor *pr,
145145
struct acpi_processor_power *pwr = &pr->power;
146146
u8 type = local_apic_timer_c2_ok ? ACPI_STATE_C3 : ACPI_STATE_C2;
147147

148+
if (cpu_has(&cpu_data(pr->id), X86_FEATURE_ARAT))
149+
return;
150+
148151
/*
149152
* Check, if one of the previous states already marked the lapic
150153
* unstable

0 commit comments

Comments
 (0)