Skip to content

Commit

Permalink
Merge branch 'iommu/fixes' of git://git.kernel.org/pub/scm/linux/kern…
Browse files Browse the repository at this point in the history
…el/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
  • Loading branch information
Linus Torvalds committed Feb 9, 2012
2 parents 19e75ed + 05df1f3 commit 6308240
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
3 changes: 3 additions & 0 deletions drivers/iommu/amd_iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -2863,6 +2863,9 @@ static unsigned device_dma_ops_init(void)

for_each_pci_dev(pdev) {
if (!check_device(&pdev->dev)) {

iommu_ignore_device(&pdev->dev);

unhandled += 1;
continue;
}
Expand Down
7 changes: 1 addition & 6 deletions drivers/iommu/msm_iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -482,23 +482,19 @@ static size_t msm_iommu_unmap(struct iommu_domain *domain, unsigned long va,

priv = domain->priv;

if (!priv) {
ret = -ENODEV;
if (!priv)
goto fail;
}

fl_table = priv->pgtable;

if (len != SZ_16M && len != SZ_1M &&
len != SZ_64K && len != SZ_4K) {
pr_debug("Bad length: %d\n", len);
ret = -EINVAL;
goto fail;
}

if (!fl_table) {
pr_debug("Null page table\n");
ret = -EINVAL;
goto fail;
}

Expand All @@ -507,7 +503,6 @@ static size_t msm_iommu_unmap(struct iommu_domain *domain, unsigned long va,

if (*fl_pte == 0) {
pr_debug("First level PTE is 0\n");
ret = -ENODEV;
goto fail;
}

Expand Down

0 comments on commit 6308240

Please sign in to comment.