diff options
Diffstat (limited to 'drivers/pci/intel-iommu.c')
| -rw-r--r-- | drivers/pci/intel-iommu.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c index 25fc1df486bb..ef167b8b047d 100644 --- a/drivers/pci/intel-iommu.c +++ b/drivers/pci/intel-iommu.c | |||
| @@ -1855,11 +1855,40 @@ static int __init init_dmars(void) | |||
| 1855 | } | 1855 | } |
| 1856 | } | 1856 | } |
| 1857 | 1857 | ||
| 1858 | /* | ||
| 1859 | * Start from the sane iommu hardware state. | ||
| 1860 | */ | ||
| 1858 | for_each_drhd_unit(drhd) { | 1861 | for_each_drhd_unit(drhd) { |
| 1859 | if (drhd->ignored) | 1862 | if (drhd->ignored) |
| 1860 | continue; | 1863 | continue; |
| 1861 | 1864 | ||
| 1862 | iommu = drhd->iommu; | 1865 | iommu = drhd->iommu; |
| 1866 | |||
| 1867 | /* | ||
| 1868 | * If the queued invalidation is already initialized by us | ||
| 1869 | * (for example, while enabling interrupt-remapping) then | ||
| 1870 | * we got the things already rolling from a sane state. | ||
| 1871 | */ | ||
| 1872 | if (iommu->qi) | ||
| 1873 | continue; | ||
| 1874 | |||
| 1875 | /* | ||
| 1876 | * Clear any previous faults. | ||
| 1877 | */ | ||
| 1878 | dmar_fault(-1, iommu); | ||
| 1879 | /* | ||
| 1880 | * Disable queued invalidation if supported and already enabled | ||
| 1881 | * before OS handover. | ||
| 1882 | */ | ||
| 1883 | dmar_disable_qi(iommu); | ||
| 1884 | } | ||
| 1885 | |||
| 1886 | for_each_drhd_unit(drhd) { | ||
| 1887 | if (drhd->ignored) | ||
| 1888 | continue; | ||
| 1889 | |||
| 1890 | iommu = drhd->iommu; | ||
| 1891 | |||
| 1863 | if (dmar_enable_qi(iommu)) { | 1892 | if (dmar_enable_qi(iommu)) { |
| 1864 | /* | 1893 | /* |
| 1865 | * Queued Invalidate not enabled, use Register Based | 1894 | * Queued Invalidate not enabled, use Register Based |
