Merge tag 'iommu-fixes-v5.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu

Pull IOMMU fixes from Joerg Roedel:

- Fix a memory leak when dev_iommu gets freed and a sub-pointer does
not

- Build dependency fixes for Mediatek, spapr_tce, and Intel IOMMU
driver

- Export iommu_group_get_for_dev() only for GPLed modules

- Fix AMD IOMMU interrupt remapping when x2apic is enabled

- Fix error path in the QCOM IOMMU driver probe function

* tag 'iommu-fixes-v5.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu:
iommu/qcom: Fix local_base status check
iommu: Properly export iommu_group_get_for_dev()
iommu/vt-d: Use right Kconfig option name
iommu/amd: Fix legacy interrupt remapping for x2APIC-enabled system
iommu: spapr_tce: Disable compile testing to fix build on book3s_32 config
iommu/mediatek: Fix MTK_IOMMU dependencies
iommu: Fix the memory leak in dev_iommu_free()

+2 -2
drivers/iommu/Kconfig
··· 362 362 363 363 config SPAPR_TCE_IOMMU 364 364 bool "sPAPR TCE IOMMU Support" 365 - depends on PPC_POWERNV || PPC_PSERIES || (PPC && COMPILE_TEST) 365 + depends on PPC_POWERNV || PPC_PSERIES 366 366 select IOMMU_API 367 367 help 368 368 Enables bits of IOMMU API required by VFIO. The iommu_ops ··· 457 457 458 458 config MTK_IOMMU 459 459 bool "MTK IOMMU Support" 460 - depends on ARM || ARM64 || COMPILE_TEST 460 + depends on HAS_DMA 461 461 depends on ARCH_MEDIATEK || COMPILE_TEST 462 462 select ARM_DMA_USE_IOMMU 463 463 select IOMMU_API
+1 -1
drivers/iommu/amd_iommu_init.c
··· 2936 2936 { 2937 2937 for (; *str; ++str) { 2938 2938 if (strncmp(str, "legacy", 6) == 0) { 2939 - amd_iommu_guest_ir = AMD_IOMMU_GUEST_IR_LEGACY; 2939 + amd_iommu_guest_ir = AMD_IOMMU_GUEST_IR_LEGACY_GA; 2940 2940 break; 2941 2941 } 2942 2942 if (strncmp(str, "vapic", 5) == 0) {
+2 -2
drivers/iommu/intel-iommu.c
··· 371 371 int dmar_disabled = 1; 372 372 #endif /* CONFIG_INTEL_IOMMU_DEFAULT_ON */ 373 373 374 - #ifdef INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON 374 + #ifdef CONFIG_INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON 375 375 int intel_iommu_sm = 1; 376 376 #else 377 377 int intel_iommu_sm; 378 - #endif /* INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON */ 378 + #endif /* CONFIG_INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON */ 379 379 380 380 int intel_iommu_enabled = 0; 381 381 EXPORT_SYMBOL_GPL(intel_iommu_enabled);
+2 -1
drivers/iommu/iommu.c
··· 170 170 171 171 static void dev_iommu_free(struct device *dev) 172 172 { 173 + iommu_fwspec_free(dev); 173 174 kfree(dev->iommu); 174 175 dev->iommu = NULL; 175 176 } ··· 1429 1428 1430 1429 return group; 1431 1430 } 1432 - EXPORT_SYMBOL(iommu_group_get_for_dev); 1431 + EXPORT_SYMBOL_GPL(iommu_group_get_for_dev); 1433 1432 1434 1433 struct iommu_domain *iommu_group_default_domain(struct iommu_group *group) 1435 1434 {
+4 -1
drivers/iommu/qcom_iommu.c
··· 824 824 qcom_iommu->dev = dev; 825 825 826 826 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 827 - if (res) 827 + if (res) { 828 828 qcom_iommu->local_base = devm_ioremap_resource(dev, res); 829 + if (IS_ERR(qcom_iommu->local_base)) 830 + return PTR_ERR(qcom_iommu->local_base); 831 + } 829 832 830 833 qcom_iommu->iface_clk = devm_clk_get(dev, "iface"); 831 834 if (IS_ERR(qcom_iommu->iface_clk)) {