* [PATCH] disable per-cpu hpet timer if ARAT is supported
@ 2009-08-12 3:16 Shaohua Li
2009-08-12 20:52 ` [tip:timers/hpet] x86, hpet: Disable " tip-bot for Shaohua Li
2009-08-14 21:41 ` [PATCH] disable " Pallipadi, Venkatesh
0 siblings, 2 replies; 3+ messages in thread
From: Shaohua Li @ 2009-08-12 3:16 UTC (permalink / raw)
To: linux-kernel; +Cc: mingo, venkatesh.pallipadi
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.
Impact: should have no impact except reserving less timers.
Signed-off-by: Shaohua Li <shaohua.li@intel.com>
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
index dedc2bd..5969e10 100644
--- a/arch/x86/kernel/hpet.c
+++ b/arch/x86/kernel/hpet.c
@@ -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);
@@ -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:
@@ -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);
}
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [tip:timers/hpet] x86, hpet: Disable per-cpu hpet timer if ARAT is supported
2009-08-12 3:16 [PATCH] disable per-cpu hpet timer if ARAT is supported Shaohua Li
@ 2009-08-12 20:52 ` tip-bot for Shaohua Li
2009-08-14 21:41 ` [PATCH] disable " Pallipadi, Venkatesh
1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Shaohua Li @ 2009-08-12 20:52 UTC (permalink / raw)
To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, shaohua.li, tglx, mingo
Commit-ID: 39fe05e58c5e448601ce46e6b03900d5bf31c4b0
Gitweb: http://git.kernel.org/tip/39fe05e58c5e448601ce46e6b03900d5bf31c4b0
Author: Shaohua Li <shaohua.li@intel.com>
AuthorDate: Wed, 12 Aug 2009 11:16:12 +0800
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Wed, 12 Aug 2009 16:45:02 +0200
x86, hpet: Disable per-cpu hpet timer if ARAT is supported
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>
---
arch/x86/kernel/hpet.c | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
index dedc2bd..5969e10 100644
--- a/arch/x86/kernel/hpet.c
+++ b/arch/x86/kernel/hpet.c
@@ -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);
@@ -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:
@@ -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);
}
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] disable per-cpu hpet timer if ARAT is supported
2009-08-12 3:16 [PATCH] disable per-cpu hpet timer if ARAT is supported Shaohua Li
2009-08-12 20:52 ` [tip:timers/hpet] x86, hpet: Disable " tip-bot for Shaohua Li
@ 2009-08-14 21:41 ` Pallipadi, Venkatesh
1 sibling, 0 replies; 3+ messages in thread
From: Pallipadi, Venkatesh @ 2009-08-14 21:41 UTC (permalink / raw)
To: Li, Shaohua; +Cc: linux-kernel, mingo
Acked-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
On Tue, 2009-08-11 at 20:16 -0700, Li, Shaohua wrote:
> 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.
> Impact: should have no impact except reserving less timers.
>
> Signed-off-by: Shaohua Li <shaohua.li@intel.com>
> diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
> index dedc2bd..5969e10 100644
> --- a/arch/x86/kernel/hpet.c
> +++ b/arch/x86/kernel/hpet.c
> @@ -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);
> @@ -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:
> @@ -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);
> }
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-08-14 21:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-12 3:16 [PATCH] disable per-cpu hpet timer if ARAT is supported Shaohua Li
2009-08-12 20:52 ` [tip:timers/hpet] x86, hpet: Disable " tip-bot for Shaohua Li
2009-08-14 21:41 ` [PATCH] disable " Pallipadi, Venkatesh
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.