From: Suresh Siddha Date: Wed, 1 Dec 2010 06:22:29 +0000 (-0800) Subject: x86, vt-d: Handle previous faults after enabling fault handling X-Git-Tag: firefly_0821_release~10186^2~594 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=15b118dd1202875aa8e08e0506d53f56eeed84c1;p=firefly-linux-kernel-4.4.55.git x86, vt-d: Handle previous faults after enabling fault handling commit 7f99d946e71e71d484b7543b49e990508e70d0c0 upstream. Fault handling is getting enabled after enabling the interrupt-remapping (as the success of interrupt-remapping can affect the apic mode and hence the fault handling mode). Hence there can potentially be some faults between the window of enabling interrupt-remapping in the vt-d and the fault-handling of the vt-d units. Handle any previous faults after enabling the vt-d fault handling. For v2.6.38 cleanup, need to check if we can remove the dmar_fault() in the enable_intr_remapping() and see if we can enable fault handling along with enabling intr-remapping. Signed-off-by: Suresh Siddha LKML-Reference: <20101201062244.630417138@intel.com> Acked-by: Chris Wright Signed-off-by: H. Peter Anvin Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/pci/dmar.c b/drivers/pci/dmar.c index 57530361f15d..91d039016ad9 100644 --- a/drivers/pci/dmar.c +++ b/drivers/pci/dmar.c @@ -1380,6 +1380,11 @@ int __init enable_drhd_fault_handling(void) (unsigned long long)drhd->reg_base_addr, ret); return -1; } + + /* + * Clear any previous faults. + */ + dmar_fault(iommu->irq, iommu); } return 0;