Merge branch 'iommu/fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu
One patch fixes an bug in the ARM/MSM IOMMU code which returned sucess in the unmap function even when an error occured and the other patch adds a workaround into the AMD IOMMU driver to better handle broken IVRS ACPI tables (this patch fixes the case when a device is not listed in the table but actually translated by the iommu). * 'iommu/fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: iommu/msm: Fix error handling in msm_iommu_unmap() iommu/amd: Work around broken IVRS tables
This commit is contained in:
Коммит
6308240296
|
@ -2863,6 +2863,9 @@ static unsigned device_dma_ops_init(void)
|
||||||
|
|
||||||
for_each_pci_dev(pdev) {
|
for_each_pci_dev(pdev) {
|
||||||
if (!check_device(&pdev->dev)) {
|
if (!check_device(&pdev->dev)) {
|
||||||
|
|
||||||
|
iommu_ignore_device(&pdev->dev);
|
||||||
|
|
||||||
unhandled += 1;
|
unhandled += 1;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -482,23 +482,19 @@ static size_t msm_iommu_unmap(struct iommu_domain *domain, unsigned long va,
|
||||||
|
|
||||||
priv = domain->priv;
|
priv = domain->priv;
|
||||||
|
|
||||||
if (!priv) {
|
if (!priv)
|
||||||
ret = -ENODEV;
|
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
|
||||||
|
|
||||||
fl_table = priv->pgtable;
|
fl_table = priv->pgtable;
|
||||||
|
|
||||||
if (len != SZ_16M && len != SZ_1M &&
|
if (len != SZ_16M && len != SZ_1M &&
|
||||||
len != SZ_64K && len != SZ_4K) {
|
len != SZ_64K && len != SZ_4K) {
|
||||||
pr_debug("Bad length: %d\n", len);
|
pr_debug("Bad length: %d\n", len);
|
||||||
ret = -EINVAL;
|
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!fl_table) {
|
if (!fl_table) {
|
||||||
pr_debug("Null page table\n");
|
pr_debug("Null page table\n");
|
||||||
ret = -EINVAL;
|
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -507,7 +503,6 @@ static size_t msm_iommu_unmap(struct iommu_domain *domain, unsigned long va,
|
||||||
|
|
||||||
if (*fl_pte == 0) {
|
if (*fl_pte == 0) {
|
||||||
pr_debug("First level PTE is 0\n");
|
pr_debug("First level PTE is 0\n");
|
||||||
ret = -ENODEV;
|
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче