Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751552AbZIGHOc (ORCPT ); Mon, 7 Sep 2009 03:14:32 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751374AbZIGHOb (ORCPT ); Mon, 7 Sep 2009 03:14:31 -0400 Received: from mga09.intel.com ([134.134.136.24]:28031 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751347AbZIGHOb (ORCPT ); Mon, 7 Sep 2009 03:14:31 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.44,345,1249282800"; d="scan'208";a="446245491" Date: Mon, 7 Sep 2009 10:52:52 -0400 From: Youquan Song To: mingo@elte.hu, hpa@zytor.com, tglx@linutronix.de Cc: linux-kernel@vger.kernel.org, dwmw2@infradead.org, suresh.b.siddha@intel.com, youquan.song@intel.com Subject: [PATCH] interrupt remapping: Fix interrupt remapping hang if interrupt remapping disable in BIOS Message-ID: <20090907145252.GA30436@youquan-linux.bj.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.9i Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2113 Lines: 61 BIOS clear DMAR table INTR_REMAP flag to disable interrupt remapping. Current kernel only check interrupt remapping(IR) flag in DRHD's extended capability register to decide interrupt remapping support or not. But IR flag will not affected by BIOS setting. So though BIOS disable interrupt remapping feature, However, intr_remapping_supported function will report interrupt supported. On this cases, it will continue to enable interrupt remapping which will cause kernel hang. This bug exist on almost platform support interrupt remapping. This patch add DMAR table INTR_REMAP flag check before enable interrup remapping Signed-off-by: Youquan, Song --- diff --git a/drivers/pci/dmar.c b/drivers/pci/dmar.c index a8a4383..78f4ca8 100644 --- a/drivers/pci/dmar.c +++ b/drivers/pci/dmar.c @@ -43,7 +43,7 @@ */ LIST_HEAD(dmar_drhd_units); -static struct acpi_table_header * __initdata dmar_tbl; +struct acpi_table_header * __initdata dmar_tbl; static acpi_size dmar_tbl_size; static void __init dmar_register_drhd_unit(struct dmar_drhd_unit *drhd) diff --git a/drivers/pci/intr_remapping.c b/drivers/pci/intr_remapping.c index ebfa47b..97d1561 100644 --- a/drivers/pci/intr_remapping.c +++ b/drivers/pci/intr_remapping.c @@ -16,6 +16,7 @@ static struct ioapic_scope ir_ioapic[MAX_IO_APICS]; static int ir_ioapic_num; int intr_remapping_enabled; +extern struct acpi_table_header *__initdata dmar_tbl; static int disable_intremap; static __init int setup_nointremap(char *str) @@ -607,9 +608,14 @@ end: int __init intr_remapping_supported(void) { struct dmar_drhd_unit *drhd; - + struct acpi_table_dmar *dmar; + if (disable_intremap) return 0; + + dmar = (struct acpi_table_dmar *)dmar_tbl; + if (!(dmar->flags & 0x1)) + return 0; for_each_drhd_unit(drhd) { struct intel_iommu *iommu = drhd->iommu; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/