Skip to content

Commit

Permalink
x86, hpet: Disable per-cpu hpet timer if ARAT is supported
Browse files Browse the repository at this point in the history
If CPU support always running local APIC timer, per-cpu hpet
timer could be disabled, which is useless and wasteful in such
case. Let's leave the timers to others.

The effect is that we reserve less timers.

Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Cc: venkatesh.pallipadi@intel.com
LKML-Reference: <20090812031612.GA10062@sli10-desk.sh.intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Shaohua Li authored and Ingo Molnar committed Aug 12, 2009
1 parent 7cb7beb commit 39fe05e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions arch/x86/kernel/hpet.c
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,8 @@ static void hpet_msi_capability_lookup(unsigned int start_timer)
unsigned int num_timers_used = 0;
int i;

if (boot_cpu_has(X86_FEATURE_ARAT))
return;
id = hpet_readl(HPET_ID);

num_timers = ((id & HPET_ID_NUMBER) >> HPET_ID_NUMBER_SHIFT);
Expand Down Expand Up @@ -872,10 +874,8 @@ int __init hpet_enable(void)

if (id & HPET_ID_LEGSUP) {
hpet_legacy_clockevent_register();
hpet_msi_capability_lookup(2);
return 1;
}
hpet_msi_capability_lookup(0);
return 0;

out_nohpet:
Expand Down Expand Up @@ -908,9 +908,17 @@ static __init int hpet_late_init(void)
if (!hpet_virt_address)
return -ENODEV;

if (hpet_readl(HPET_ID) & HPET_ID_LEGSUP)
hpet_msi_capability_lookup(2);
else
hpet_msi_capability_lookup(0);

hpet_reserve_platform_timers(hpet_readl(HPET_ID));
hpet_print_config();

if (boot_cpu_has(X86_FEATURE_ARAT))
return 0;

for_each_online_cpu(cpu) {
hpet_cpuhp_notify(NULL, CPU_ONLINE, (void *)(long)cpu);
}
Expand Down

0 comments on commit 39fe05e

Please sign in to comment.