Skip to content

Commit c307aaf

Browse files
committed
Merge tag 'iommu-fixes-v4.19-rc5' of git://git.kernel.org/pub/scm/linux/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
2 parents a385231 + 5ebb1bc commit c307aaf

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

drivers/iommu/amd_iommu.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,13 @@ static u16 get_alias(struct device *dev)
246246

247247
/* The callers make sure that get_device_id() does not fail here */
248248
devid = get_device_id(dev);
249+
250+
/* For ACPI HID devices, we simply return the devid as such */
251+
if (!dev_is_pci(dev))
252+
return devid;
253+
249254
ivrs_alias = amd_iommu_alias_table[devid];
255+
250256
pci_for_each_dma_alias(pdev, __last_alias, &pci_alias);
251257

252258
if (ivrs_alias == pci_alias)

drivers/iommu/intel-iommu.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2540,9 +2540,9 @@ static struct dmar_domain *dmar_insert_one_dev_info(struct intel_iommu *iommu,
25402540
if (dev && dev_is_pci(dev) && info->pasid_supported) {
25412541
ret = intel_pasid_alloc_table(dev);
25422542
if (ret) {
2543-
__dmar_remove_one_dev_info(info);
2544-
spin_unlock_irqrestore(&device_domain_lock, flags);
2545-
return NULL;
2543+
pr_warn("No pasid table for %s, pasid disabled\n",
2544+
dev_name(dev));
2545+
info->pasid_supported = 0;
25462546
}
25472547
}
25482548
spin_unlock_irqrestore(&device_domain_lock, flags);

drivers/iommu/intel-pasid.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#define __INTEL_PASID_H
1212

1313
#define PASID_MIN 0x1
14-
#define PASID_MAX 0x100000
14+
#define PASID_MAX 0x20000
1515

1616
struct pasid_entry {
1717
u64 val;

drivers/iommu/rockchip-iommu.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,6 +1241,12 @@ static int rk_iommu_probe(struct platform_device *pdev)
12411241

12421242
static void rk_iommu_shutdown(struct platform_device *pdev)
12431243
{
1244+
struct rk_iommu *iommu = platform_get_drvdata(pdev);
1245+
int i = 0, irq;
1246+
1247+
while ((irq = platform_get_irq(pdev, i++)) != -ENXIO)
1248+
devm_free_irq(iommu->dev, irq, iommu);
1249+
12441250
pm_runtime_force_suspend(&pdev->dev);
12451251
}
12461252

0 commit comments

Comments
 (0)