* Fix interrupt remapping hang if interrupt remapping disable in BIOS
@ 2009-09-07 14:13 Youquan Song
2009-09-07 14:59 ` Cyrill Gorcunov
0 siblings, 1 reply; 3+ messages in thread
From: Youquan Song @ 2009-09-07 14:13 UTC (permalink / raw)
To: mingo, hpa, tglx; +Cc: linux-kernel, dwmw2, Suresh Siddha, youqun.song
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 result kernel hang.
This bug exists on most platforms support interrupt remapping.
This patch add DMAR table INTR_REMAP flag check before enable interrup remapping
Signed-off-by: Youquan Song <youquan.song@intel.com>
---
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;
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: Fix interrupt remapping hang if interrupt remapping disable in BIOS
2009-09-07 14:13 Fix interrupt remapping hang if interrupt remapping disable in BIOS Youquan Song
@ 2009-09-07 14:59 ` Cyrill Gorcunov
2009-09-09 10:46 ` Youquan,Song
0 siblings, 1 reply; 3+ messages in thread
From: Cyrill Gorcunov @ 2009-09-07 14:59 UTC (permalink / raw)
To: Youquan Song
Cc: mingo, hpa, tglx, linux-kernel, dwmw2, Suresh Siddha, youqun.song
[Youquan Song - Mon, Sep 07, 2009 at 10:13:13AM -0400]
...
| 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;
Hi Youquan,
perhaps we could move this test to helper function
in dmar.c instead of plain external variable test?
-- Cyrill
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: Fix interrupt remapping hang if interrupt remapping disable in BIOS
2009-09-07 14:59 ` Cyrill Gorcunov
@ 2009-09-09 10:46 ` Youquan,Song
0 siblings, 0 replies; 3+ messages in thread
From: Youquan,Song @ 2009-09-09 10:46 UTC (permalink / raw)
To: Cyrill Gorcunov
Cc: Youquan Song, mingo, hpa, tglx, linux-kernel, dwmw2,
Suresh Siddha, youqun.song
On Mon, Sep 07, 2009 at 06:59:40PM +0400, Cyrill Gorcunov wrote:
> [Youquan Song - Mon, Sep 07, 2009 at 10:13:13AM -0400]
> ...
> | 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;
>
> Hi Youquan,
>
> perhaps we could move this test to helper function
> in dmar.c instead of plain external variable test?
Good point. I will update it and send it out soon.
- Youquan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-09-09 3:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-07 14:13 Fix interrupt remapping hang if interrupt remapping disable in BIOS Youquan Song
2009-09-07 14:59 ` Cyrill Gorcunov
2009-09-09 10:46 ` Youquan,Song
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox