Skip to content

Commit ea91593

Browse files
committed
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 parents 743f057 + b52649a commit ea91593

File tree

5 files changed

+11
-7
lines changed

5 files changed

+11
-7
lines changed

drivers/iommu/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ config IPMMU_VMSA
362362

363363
config SPAPR_TCE_IOMMU
364364
bool "sPAPR TCE IOMMU Support"
365-
depends on PPC_POWERNV || PPC_PSERIES || (PPC && COMPILE_TEST)
365+
depends on PPC_POWERNV || PPC_PSERIES
366366
select IOMMU_API
367367
help
368368
Enables bits of IOMMU API required by VFIO. The iommu_ops
@@ -457,7 +457,7 @@ config S390_AP_IOMMU
457457

458458
config MTK_IOMMU
459459
bool "MTK IOMMU Support"
460-
depends on ARM || ARM64 || COMPILE_TEST
460+
depends on HAS_DMA
461461
depends on ARCH_MEDIATEK || COMPILE_TEST
462462
select ARM_DMA_USE_IOMMU
463463
select IOMMU_API

drivers/iommu/amd_iommu_init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2936,7 +2936,7 @@ static int __init parse_amd_iommu_intr(char *str)
29362936
{
29372937
for (; *str; ++str) {
29382938
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;
29402940
break;
29412941
}
29422942
if (strncmp(str, "vapic", 5) == 0) {

drivers/iommu/intel-iommu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,11 +371,11 @@ int dmar_disabled = 0;
371371
int dmar_disabled = 1;
372372
#endif /* CONFIG_INTEL_IOMMU_DEFAULT_ON */
373373

374-
#ifdef INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON
374+
#ifdef CONFIG_INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON
375375
int intel_iommu_sm = 1;
376376
#else
377377
int intel_iommu_sm;
378-
#endif /* INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON */
378+
#endif /* CONFIG_INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON */
379379

380380
int intel_iommu_enabled = 0;
381381
EXPORT_SYMBOL_GPL(intel_iommu_enabled);

drivers/iommu/iommu.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ static struct dev_iommu *dev_iommu_get(struct device *dev)
170170

171171
static void dev_iommu_free(struct device *dev)
172172
{
173+
iommu_fwspec_free(dev);
173174
kfree(dev->iommu);
174175
dev->iommu = NULL;
175176
}
@@ -1428,7 +1429,7 @@ struct iommu_group *iommu_group_get_for_dev(struct device *dev)
14281429

14291430
return group;
14301431
}
1431-
EXPORT_SYMBOL(iommu_group_get_for_dev);
1432+
EXPORT_SYMBOL_GPL(iommu_group_get_for_dev);
14321433

14331434
struct iommu_domain *iommu_group_default_domain(struct iommu_group *group)
14341435
{

drivers/iommu/qcom_iommu.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -824,8 +824,11 @@ static int qcom_iommu_device_probe(struct platform_device *pdev)
824824
qcom_iommu->dev = dev;
825825

826826
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
827-
if (res)
827+
if (res) {
828828
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+
}
829832

830833
qcom_iommu->iface_clk = devm_clk_get(dev, "iface");
831834
if (IS_ERR(qcom_iommu->iface_clk)) {

0 commit comments

Comments
 (0)