2010-01-15 01:54:17

by Pallipadi, Venkatesh

[permalink] [raw]
Subject: [patch 2/4] x86: Do not use hpet MSI as clockevent broadcast device

Current kernel uses hpet MSI interrupts as both percpu clockevent device
and also as clockevent broadcast device in place of IRQ0 timer.
There seems to be issues with HPET MSI usage on some platforms. So,
restrict it to be only used as a percpu clockevent device.

Signed-off-by: Venkatesh Pallipadi <[email protected]>
---
arch/x86/kernel/hpet.c | 2 +-
include/linux/clockchips.h | 2 ++
kernel/time/tick-broadcast.c | 3 ++-
3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
index ba6e658..dd9370b 100644
--- a/arch/x86/kernel/hpet.c
+++ b/arch/x86/kernel/hpet.c
@@ -556,7 +556,7 @@ static void init_one_hpet_msi_clockevent(struct hpet_dev *hdev, int cpu)
evt->irq = hdev->irq;

evt->rating = 110;
- evt->features = CLOCK_EVT_FEAT_ONESHOT;
+ evt->features = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_NO_BROADCAST;
if (hdev->flags & HPET_DEV_PERI_CAP)
evt->features |= CLOCK_EVT_FEAT_PERIODIC;

diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h
index 0cf725b..5352187 100644
--- a/include/linux/clockchips.h
+++ b/include/linux/clockchips.h
@@ -50,9 +50,11 @@ enum clock_event_nofitiers {
*
* - Clockevent source stops in C3 State and needs broadcast support.
* - Local APIC timer is used as a dummy device.
+ * - Do not use this device as a broadcast device.
*/
#define CLOCK_EVT_FEAT_C3STOP 0x000004
#define CLOCK_EVT_FEAT_DUMMY 0x000008
+#define CLOCK_EVT_FEAT_NO_BROADCAST 0x000010

/**
* struct clock_event_device - clock event device descriptor
diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c
index b3bafd5..113f954 100644
--- a/kernel/time/tick-broadcast.c
+++ b/kernel/time/tick-broadcast.c
@@ -69,7 +69,8 @@ int tick_check_broadcast_device(struct clock_event_device *dev)
{
if ((tick_broadcast_device.evtdev &&
tick_broadcast_device.evtdev->rating >= dev->rating) ||
- (dev->features & CLOCK_EVT_FEAT_C3STOP))
+ dev->features & CLOCK_EVT_FEAT_C3STOP ||
+ dev->features & CLOCK_EVT_FEAT_NO_BROADCAST)
return 0;

clockevents_exchange_device(NULL, dev);
--
1.6.0.6

--


2010-01-15 02:07:16

by Pallipadi, Venkatesh

[permalink] [raw]
Subject: Re: [patch 2/4] x86: Do not use hpet MSI as clockevent broadcast device

On Thu, 2010-01-14 at 18:00 -0800, H. Peter Anvin wrote:
> On 01/14/2010 05:39 PM, Venkatesh Pallipadi wrote:
> > Current kernel uses hpet MSI interrupts as both percpu clockevent device
> > and also as clockevent broadcast device in place of IRQ0 timer.
> > There seems to be issues with HPET MSI usage on some platforms. So,
> > restrict it to be only used as a percpu clockevent device.
>
> Any ideas of which platforms? It would help avoiding "cargo cult
> programming" in the future.
>
> Other than that, I presume this is a .33 patch?
>
> -hpa
>

The problem reported by Mark has only been on (AMD) 790x series chip
sets.

I am not quite sure what the quick-fix for .33 would be.
- Either use dmi to stop using HPET MSI on this chipset
- or stop using HPET MSI altogether, until this complete patchset
provides a better alternative for .34.
I think it should be first option.

Thanks,
Venki

2010-01-15 02:09:07

by H. Peter Anvin

[permalink] [raw]
Subject: Re: [patch 2/4] x86: Do not use hpet MSI as clockevent broadcast device

On 01/14/2010 05:39 PM, Venkatesh Pallipadi wrote:
> Current kernel uses hpet MSI interrupts as both percpu clockevent device
> and also as clockevent broadcast device in place of IRQ0 timer.
> There seems to be issues with HPET MSI usage on some platforms. So,
> restrict it to be only used as a percpu clockevent device.

Any ideas of which platforms? It would help avoiding "cargo cult
programming" in the future.

Other than that, I presume this is a .33 patch?

-hpa

--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.