From patchwork Wed Dec 29 01:57:05 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yan, Zheng" X-Patchwork-Id: 437691 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oBT1vFHL018030 for ; Wed, 29 Dec 2010 01:57:15 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750867Ab0L2B5J (ORCPT ); Tue, 28 Dec 2010 20:57:09 -0500 Received: from mga14.intel.com ([143.182.124.37]:6513 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750837Ab0L2B5I (ORCPT ); Tue, 28 Dec 2010 20:57:08 -0500 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga102.ch.intel.com with ESMTP; 28 Dec 2010 17:57:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.60,242,1291622400"; d="scan'208";a="367498079" Received: from unknown (HELO [10.239.36.20]) ([10.239.36.20]) by azsmga001.ch.intel.com with ESMTP; 28 Dec 2010 17:57:05 -0800 Message-ID: <4D1A9571.4030604@linux.intel.com> Date: Wed, 29 Dec 2010 09:57:05 +0800 From: "Yan, Zheng" User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Thunderbird/3.1.7 MIME-Version: 1.0 To: linux-btrfs@vger.kernel.org CC: mingo@redhat.com, tglx@linutronix.de Subject: [PATCH] x86: hpet: Fix HPET timer + NMI watchdog panic Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Wed, 29 Dec 2010 01:57:15 +0000 (UTC) diff --git a/arch/x86/include/asm/hardirq.h b/arch/x86/include/asm/hardirq.h index 55e4de6..cca94f2 100644 --- a/arch/x86/include/asm/hardirq.h +++ b/arch/x86/include/asm/hardirq.h @@ -12,6 +12,9 @@ typedef struct { unsigned int apic_timer_irqs; /* arch dependent */ unsigned int irq_spurious_count; #endif +#ifdef CONFIG_HPET_TIMER + unsigned int hpet_timer_irqs; +#endif unsigned int x86_platform_ipis; /* arch dependent */ unsigned int apic_perf_irqs; unsigned int apic_irq_work_irqs; diff --git a/arch/x86/kernel/apic/nmi.c b/arch/x86/kernel/apic/nmi.c index c90041c..cdb38d9 100644 --- a/arch/x86/kernel/apic/nmi.c +++ b/arch/x86/kernel/apic/nmi.c @@ -80,8 +80,15 @@ static inline int mce_in_progress(void) */ static inline unsigned int get_timer_irqs(int cpu) { - return per_cpu(irq_stat, cpu).apic_timer_irqs + + unsigned int irqs; +#ifdef CONFIG_HPET_TIMER + irqs = per_cpu(irq_stat, cpu).hpet_timer_irqs; +#else + irqs = 0; +#endif + irqs += per_cpu(irq_stat, cpu).apic_timer_irqs + per_cpu(irq_stat, cpu).irq0_irqs; + return irqs; } #ifdef CONFIG_SMP diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c index 4ff5968..b536474c 100644 --- a/arch/x86/kernel/hpet.c +++ b/arch/x86/kernel/hpet.c @@ -517,6 +517,7 @@ static irqreturn_t hpet_interrupt_handler(int irq, void *data) struct hpet_dev *dev = (struct hpet_dev *)data; struct clock_event_device *hevt = &dev->evt; + inc_irq_stat(hpet_timer_irqs); if (!hevt->event_handler) { printk(KERN_INFO "Spurious HPET timer interrupt on HPET timer %d\n", dev->num); diff --git a/arch/x86/kernel/time.c b/arch/x86/kernel/time.c index fb5cc5e1..2098c56 100644 --- a/arch/x86/kernel/time.c +++ b/arch/x86/kernel/time.c @@ -56,7 +56,7 @@ unsigned long profile_pc(struct pt_regs *regs) EXPORT_SYMBOL(profile_pc); /* - * Default timer interrupt handler for PIT/HPET + * Default timer interrupt handler for PIT */ static irqreturn_t timer_interrupt(int irq, void *dev_id) {