Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

Pull iommu fixes from Joerg Roedel:

- Fix a use-after-free of the device iommu-group. Found in the arm-smmu
driver, but the fix is in generic code.

- Fix for the new Allwinner IOMMU driver to use the atomic
readl_timeout() variant in IO/TLB flushing code.

- A couple of cleanups to fix various compile warnings.

* tag 'iommu-fixes-v5.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu:
iommu/arm-smmu: Mark qcom_smmu_client_of_match as possibly unused
iommu: Fix use-after-free in iommu_release_device
iommu/amd: Make amd_iommu_apply_ivrs_quirks() static inline
iommu: SUN50I_IOMMU should depend on HAS_DMA
iommu/sun50i: Remove unused variable
iommu/sun50i: Change the readl timeout to the atomic variant

+7 -8
+1
drivers/iommu/Kconfig
··· 305 305 306 306 config SUN50I_IOMMU 307 307 bool "Allwinner H6 IOMMU Support" 308 + depends on HAS_DMA 308 309 depends on ARCH_SUNXI || COMPILE_TEST 309 310 select ARM_DMA_USE_IOMMU 310 311 select IOMMU_API
+1 -1
drivers/iommu/amd/amd_iommu.h
··· 102 102 #ifdef CONFIG_DMI 103 103 void amd_iommu_apply_ivrs_quirks(void); 104 104 #else 105 - static void amd_iommu_apply_ivrs_quirks(void) { } 105 + static inline void amd_iommu_apply_ivrs_quirks(void) { } 106 106 #endif 107 107 108 108 #endif
+1 -1
drivers/iommu/arm-smmu-qcom.c
··· 12 12 struct arm_smmu_device smmu; 13 13 }; 14 14 15 - static const struct of_device_id qcom_smmu_client_of_match[] = { 15 + static const struct of_device_id qcom_smmu_client_of_match[] __maybe_unused = { 16 16 { .compatible = "qcom,adreno" }, 17 17 { .compatible = "qcom,mdp4" }, 18 18 { .compatible = "qcom,mdss" },
+1 -1
drivers/iommu/iommu.c
··· 295 295 return; 296 296 297 297 iommu_device_unlink(dev->iommu->iommu_dev, dev); 298 - iommu_group_remove_device(dev); 299 298 300 299 ops->release_device(dev); 301 300 301 + iommu_group_remove_device(dev); 302 302 module_put(ops->owner); 303 303 dev_iommu_free(dev); 304 304 }
+3 -5
drivers/iommu/sun50i-iommu.c
··· 313 313 IOMMU_TLB_FLUSH_MICRO_TLB(1) | 314 314 IOMMU_TLB_FLUSH_MICRO_TLB(0)); 315 315 316 - ret = readl_poll_timeout(iommu->base + IOMMU_TLB_FLUSH_REG, 317 - reg, !reg, 318 - 1, 2000); 316 + ret = readl_poll_timeout_atomic(iommu->base + IOMMU_TLB_FLUSH_REG, 317 + reg, !reg, 318 + 1, 2000); 319 319 if (ret) 320 320 dev_warn(iommu->dev, "TLB Flush timed out!\n"); 321 321 ··· 556 556 { 557 557 struct sun50i_iommu_domain *sun50i_domain = to_sun50i_domain(domain); 558 558 phys_addr_t pt_phys; 559 - dma_addr_t pte_dma; 560 559 u32 *pte_addr; 561 560 u32 dte; 562 561 ··· 565 566 566 567 pt_phys = sun50i_dte_get_pt_address(dte); 567 568 pte_addr = (u32 *)phys_to_virt(pt_phys) + sun50i_iova_get_pte_index(iova); 568 - pte_dma = pt_phys + sun50i_iova_get_pte_index(iova) * PT_ENTRY_SIZE; 569 569 570 570 if (!sun50i_pte_is_page_valid(*pte_addr)) 571 571 return 0;