Commit 92367fdf authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull iommu fixes from Joerg Roedel:

 - Maintainer update for S390 IOMMU driver

 - A fix for the set_platform_dma_ops() call-back in the Exynos
   IOMMU driver

 - Intel VT-d fixes from Lu Baolu:
    - Fix a lockdep splat
    - Fix a supplement of the specification
    - Fix a warning in perfmon code

* tag 'iommu-fixes-6.3-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu:
  iommu/vt-d: Fix an IOMMU perfmon warning when CPU hotplug
  iommu/vt-d: Allow zero SAGAW if second-stage not supported
  iommu/vt-d: Remove unnecessary locking in intel_irq_remapping_alloc()
  iommu/exynos: Fix set_platform_dma_ops() callback
  MAINTAINERS: Update s390-iommu driver maintainer information
parents 7b50567b 16812c96
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -18288,8 +18288,9 @@ F: drivers/s390/block/dasd*
F:	include/linux/dasd_mod.h
S390 IOMMU (PCI)
M:	Niklas Schnelle <schnelle@linux.ibm.com>
M:	Matthew Rosato <mjrosato@linux.ibm.com>
M:	Gerald Schaefer <gerald.schaefer@linux.ibm.com>
R:	Gerald Schaefer <gerald.schaefer@linux.ibm.com>
L:	linux-s390@vger.kernel.org
S:	Supported
F:	drivers/iommu/s390-iommu.c
+10 −7
Original line number Diff line number Diff line
@@ -1415,23 +1415,26 @@ static struct iommu_device *exynos_iommu_probe_device(struct device *dev)
	return &data->iommu;
}

static void exynos_iommu_release_device(struct device *dev)
static void exynos_iommu_set_platform_dma(struct device *dev)
{
	struct exynos_iommu_owner *owner = dev_iommu_priv_get(dev);
	struct sysmmu_drvdata *data;

	if (owner->domain) {
		struct iommu_group *group = iommu_group_get(dev);

		if (group) {
#ifndef CONFIG_ARM
			WARN_ON(owner->domain !=
				iommu_group_default_domain(group));
#endif
			exynos_iommu_detach_device(owner->domain, dev);
			iommu_group_put(group);
		}
	}
}

static void exynos_iommu_release_device(struct device *dev)
{
	struct exynos_iommu_owner *owner = dev_iommu_priv_get(dev);
	struct sysmmu_drvdata *data;

	exynos_iommu_set_platform_dma(dev);

	list_for_each_entry(data, &owner->controllers, owner_node)
		device_link_del(data->link);
@@ -1479,7 +1482,7 @@ static const struct iommu_ops exynos_iommu_ops = {
	.domain_alloc = exynos_iommu_domain_alloc,
	.device_group = generic_device_group,
#ifdef CONFIG_ARM
	.set_platform_dma_ops = exynos_iommu_release_device,
	.set_platform_dma_ops = exynos_iommu_set_platform_dma,
#endif
	.probe_device = exynos_iommu_probe_device,
	.release_device = exynos_iommu_release_device,
+2 −1
Original line number Diff line number Diff line
@@ -1071,7 +1071,8 @@ static int alloc_iommu(struct dmar_drhd_unit *drhd)
	}

	err = -EINVAL;
	if (cap_sagaw(iommu->cap) == 0) {
	if (!cap_sagaw(iommu->cap) &&
	    (!ecap_smts(iommu->ecap) || ecap_slts(iommu->ecap))) {
		pr_info("%s: No supported address widths. Not attempting DMA translation.\n",
			iommu->name);
		drhd->ignored = 1;
+2 −0
Original line number Diff line number Diff line
@@ -641,6 +641,8 @@ struct iommu_pmu {
	DECLARE_BITMAP(used_mask, IOMMU_PMU_IDX_MAX);
	struct perf_event	*event_list[IOMMU_PMU_IDX_MAX];
	unsigned char		irq_name[16];
	struct hlist_node	cpuhp_node;
	int			cpu;
};

#define IOMMU_IRQ_ID_OFFSET_PRQ		(DMAR_UNITS_SUPPORTED)
+0 −6
Original line number Diff line number Diff line
@@ -311,14 +311,12 @@ static int set_ioapic_sid(struct irte *irte, int apic)
	if (!irte)
		return -1;

	down_read(&dmar_global_lock);
	for (i = 0; i < MAX_IO_APICS; i++) {
		if (ir_ioapic[i].iommu && ir_ioapic[i].id == apic) {
			sid = (ir_ioapic[i].bus << 8) | ir_ioapic[i].devfn;
			break;
		}
	}
	up_read(&dmar_global_lock);

	if (sid == 0) {
		pr_warn("Failed to set source-id of IOAPIC (%d)\n", apic);
@@ -338,14 +336,12 @@ static int set_hpet_sid(struct irte *irte, u8 id)
	if (!irte)
		return -1;

	down_read(&dmar_global_lock);
	for (i = 0; i < MAX_HPET_TBS; i++) {
		if (ir_hpet[i].iommu && ir_hpet[i].id == id) {
			sid = (ir_hpet[i].bus << 8) | ir_hpet[i].devfn;
			break;
		}
	}
	up_read(&dmar_global_lock);

	if (sid == 0) {
		pr_warn("Failed to set source-id of HPET block (%d)\n", id);
@@ -1339,9 +1335,7 @@ static int intel_irq_remapping_alloc(struct irq_domain *domain,
	if (!data)
		goto out_free_parent;

	down_read(&dmar_global_lock);
	index = alloc_irte(iommu, &data->irq_2_iommu, nr_irqs);
	up_read(&dmar_global_lock);
	if (index < 0) {
		pr_warn("Failed to allocate IRTE\n");
		kfree(data);
Loading