Skip to content

Commit

Permalink
Merge tag 'iommu-fixes-v4.19-rc5' of git://git.kernel.org/pub/scm/lin…
Browse files Browse the repository at this point in the history
…ux/kernel/git/joro/iommu

Joerg writes:
  "IOMMU Fixes for Linux v4.19-rc5

   Three fixes queued up:

	- Warning fix for Rockchip IOMMU where there were IRQ handlers
	  for offlined hardware.

	- Fix for Intel VT-d because recent changes caused boot failures
	  on some machines because it tried to allocate to much
	  contiguous memory.

	- Fix for AMD IOMMU to handle eMMC devices correctly that appear
	  as ACPI HID devices."

* tag 'iommu-fixes-v4.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu:
  iommu/amd: Return devid as alias for ACPI HID devices
  iommu/vt-d: Handle memory shortage on pasid table allocation
  iommu/rockchip: Free irqs in shutdown handler
  • Loading branch information
gregkh committed Sep 26, 2018
2 parents a385231 + 5ebb1bc commit c307aaf
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
6 changes: 6 additions & 0 deletions drivers/iommu/amd_iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,13 @@ static u16 get_alias(struct device *dev)

/* The callers make sure that get_device_id() does not fail here */
devid = get_device_id(dev);

/* For ACPI HID devices, we simply return the devid as such */
if (!dev_is_pci(dev))
return devid;

ivrs_alias = amd_iommu_alias_table[devid];

pci_for_each_dma_alias(pdev, __last_alias, &pci_alias);

if (ivrs_alias == pci_alias)
Expand Down
6 changes: 3 additions & 3 deletions drivers/iommu/intel-iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -2540,9 +2540,9 @@ static struct dmar_domain *dmar_insert_one_dev_info(struct intel_iommu *iommu,
if (dev && dev_is_pci(dev) && info->pasid_supported) {
ret = intel_pasid_alloc_table(dev);
if (ret) {
__dmar_remove_one_dev_info(info);
spin_unlock_irqrestore(&device_domain_lock, flags);
return NULL;
pr_warn("No pasid table for %s, pasid disabled\n",
dev_name(dev));
info->pasid_supported = 0;
}
}
spin_unlock_irqrestore(&device_domain_lock, flags);
Expand Down
2 changes: 1 addition & 1 deletion drivers/iommu/intel-pasid.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#define __INTEL_PASID_H

#define PASID_MIN 0x1
#define PASID_MAX 0x100000
#define PASID_MAX 0x20000

struct pasid_entry {
u64 val;
Expand Down
6 changes: 6 additions & 0 deletions drivers/iommu/rockchip-iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1241,6 +1241,12 @@ static int rk_iommu_probe(struct platform_device *pdev)

static void rk_iommu_shutdown(struct platform_device *pdev)
{
struct rk_iommu *iommu = platform_get_drvdata(pdev);
int i = 0, irq;

while ((irq = platform_get_irq(pdev, i++)) != -ENXIO)
devm_free_irq(iommu->dev, irq, iommu);

pm_runtime_force_suspend(&pdev->dev);
}

Expand Down

0 comments on commit c307aaf

Please sign in to comment.