Loading arch/arm64/boot/dts/qcom/kona-usb.dtsi +1 −0 Original line number Diff line number Diff line Loading @@ -13,6 +13,7 @@ reg-names = "core_base"; iommus = <&apps_smmu 0x0 0x0>; qcom,iommu-dma = "disabled"; #address-cells = <1>; #size-cells = <1>; ranges; Loading arch/arm64/include/asm/dma-iommu.h +11 −8 Original line number Diff line number Diff line Loading @@ -32,34 +32,37 @@ struct dma_iommu_mapping { #ifdef CONFIG_ARM64_DMA_USE_IOMMU struct dma_iommu_mapping * arm_iommu_create_mapping(struct bus_type *bus, dma_addr_t base, size_t size); __depr_arm_iommu_create_mapping(struct bus_type *bus, dma_addr_t base, size_t size); void arm_iommu_release_mapping(struct dma_iommu_mapping *mapping); void __depr_arm_iommu_release_mapping(struct dma_iommu_mapping *mapping); int arm_iommu_attach_device(struct device *dev, int __depr_arm_iommu_attach_device(struct device *dev, struct dma_iommu_mapping *mapping); void arm_iommu_detach_device(struct device *dev); void __depr_arm_iommu_detach_device(struct device *dev); void arm_iommu_put_dma_cookie(struct iommu_domain *domain); #else /* !CONFIG_ARM64_DMA_USE_IOMMU */ static inline struct dma_iommu_mapping * arm_iommu_create_mapping(struct bus_type *bus, dma_addr_t base, size_t size) __depr_arm_iommu_create_mapping(struct bus_type *bus, dma_addr_t base, size_t size) { return NULL; } static inline void arm_iommu_release_mapping(struct dma_iommu_mapping *mapping) static inline void __depr_arm_iommu_release_mapping(struct dma_iommu_mapping *mapping) { } static inline int arm_iommu_attach_device(struct device *dev, static inline int __depr_arm_iommu_attach_device(struct device *dev, struct dma_iommu_mapping *mapping) { return -ENODEV; } static inline void arm_iommu_detach_device(struct device *dev) static inline void __depr_arm_iommu_detach_device(struct device *dev) { } Loading arch/arm64/mm/dma-mapping.c +9 −8 Original line number Diff line number Diff line Loading @@ -1158,7 +1158,8 @@ static void arm_iommu_setup_dma_ops(struct device *dev, u64 dma_base, u64 size) * to calling arm_iommu_attach_device() to complete initialization. */ struct dma_iommu_mapping * arm_iommu_create_mapping(struct bus_type *bus, dma_addr_t base, size_t size) __depr_arm_iommu_create_mapping(struct bus_type *bus, dma_addr_t base, size_t size) { unsigned int bits = size >> PAGE_SHIFT; struct dma_iommu_mapping *mapping; Loading @@ -1184,7 +1185,7 @@ arm_iommu_create_mapping(struct bus_type *bus, dma_addr_t base, size_t size) kfree(mapping); return ERR_PTR(-ENOMEM); } EXPORT_SYMBOL(arm_iommu_create_mapping); EXPORT_SYMBOL(__depr_arm_iommu_create_mapping); /* * DEPRECATED Loading @@ -1194,7 +1195,7 @@ EXPORT_SYMBOL(arm_iommu_create_mapping); * Frees all resources associated with the iommu mapping. * The device associated with this mapping must be in the 'detached' state */ void arm_iommu_release_mapping(struct dma_iommu_mapping *mapping) void __depr_arm_iommu_release_mapping(struct dma_iommu_mapping *mapping) { if (!mapping) return; Loading @@ -1204,7 +1205,7 @@ void arm_iommu_release_mapping(struct dma_iommu_mapping *mapping) kfree(mapping); } EXPORT_SYMBOL(arm_iommu_release_mapping); EXPORT_SYMBOL(__depr_arm_iommu_release_mapping); /** * DEPRECATED Loading @@ -1219,7 +1220,7 @@ EXPORT_SYMBOL(arm_iommu_release_mapping); * * Only configures dma_ops for a single device in the iommu_group. */ int arm_iommu_attach_device(struct device *dev, int __depr_arm_iommu_attach_device(struct device *dev, struct dma_iommu_mapping *mapping) { int err; Loading Loading @@ -1265,7 +1266,7 @@ int arm_iommu_attach_device(struct device *dev, pr_debug("Attached IOMMU controller to %s device.\n", dev_name(dev)); return 0; } EXPORT_SYMBOL(arm_iommu_attach_device); EXPORT_SYMBOL(__depr_arm_iommu_attach_device); /** * DEPRECATED Loading @@ -1275,7 +1276,7 @@ EXPORT_SYMBOL(arm_iommu_attach_device); * Detaches the provided device from a previously attached map. * This voids the dma operations (dma_map_ops pointer) */ void arm_iommu_detach_device(struct device *dev) void __depr_arm_iommu_detach_device(struct device *dev) { struct iommu_domain *domain; int s1_bypass = 0; Loading Loading @@ -1307,7 +1308,7 @@ void arm_iommu_detach_device(struct device *dev) pr_debug("Detached IOMMU controller from %s device.\n", dev_name(dev)); } EXPORT_SYMBOL(arm_iommu_detach_device); EXPORT_SYMBOL(__depr_arm_iommu_detach_device); #else /*!CONFIG_ARM64_DMA_USE_IOMMU */ Loading drivers/hwtracing/coresight/coresight-tmc.c +6 −5 Original line number Diff line number Diff line Loading @@ -457,7 +457,7 @@ static int tmc_iommu_init(struct tmc_drvdata *drvdata) if (!of_property_read_bool(node, "iommus")) return 0; drvdata->iommu_mapping = arm_iommu_create_mapping(&amba_bustype, drvdata->iommu_mapping = __depr_arm_iommu_create_mapping(&amba_bustype, 0, (SZ_1G * 4ULL)); if (IS_ERR_OR_NULL(drvdata->iommu_mapping)) { dev_err(drvdata->dev, "Create mapping failed, err = %d\n", ret); Loading @@ -474,7 +474,8 @@ static int tmc_iommu_init(struct tmc_drvdata *drvdata) goto iommu_attach_fail; } ret = arm_iommu_attach_device(drvdata->dev, drvdata->iommu_mapping); ret = __depr_arm_iommu_attach_device(drvdata->dev, drvdata->iommu_mapping); if (ret) { dev_err(drvdata->dev, "Attach device failed, err = %d\n", ret); goto iommu_attach_fail; Loading @@ -483,7 +484,7 @@ static int tmc_iommu_init(struct tmc_drvdata *drvdata) return ret; iommu_attach_fail: arm_iommu_release_mapping(drvdata->iommu_mapping); __depr_arm_iommu_release_mapping(drvdata->iommu_mapping); iommu_map_err: drvdata->iommu_mapping = NULL; return ret; Loading @@ -494,8 +495,8 @@ static void tmc_iommu_deinit(struct tmc_drvdata *drvdata) if (!drvdata->iommu_mapping) return; arm_iommu_detach_device(drvdata->dev); arm_iommu_release_mapping(drvdata->iommu_mapping); __depr_arm_iommu_detach_device(drvdata->dev); __depr_arm_iommu_release_mapping(drvdata->iommu_mapping); drvdata->iommu_mapping = NULL; } Loading drivers/usb/dwc3/dwc3-msm.c +10 −10 Original line number Diff line number Diff line Loading @@ -2372,7 +2372,7 @@ static int dwc3_msm_suspend(struct dwc3_msm *mdwc) clk_disable_unprepare(mdwc->sleep_clk); if (mdwc->iommu_map) { arm_iommu_detach_device(mdwc->dev); __depr_arm_iommu_detach_device(mdwc->dev); dev_dbg(mdwc->dev, "IOMMU detached\n"); } } Loading Loading @@ -2518,7 +2518,7 @@ static int dwc3_msm_resume(struct dwc3_msm *mdwc) u32 tmp; if (mdwc->iommu_map) { ret = arm_iommu_attach_device(mdwc->dev, ret = __depr_arm_iommu_attach_device(mdwc->dev, mdwc->iommu_map); if (ret) dev_err(mdwc->dev, "IOMMU attach failed (%d)\n", Loading Loading @@ -3091,7 +3091,7 @@ static int dwc3_msm_init_iommu(struct dwc3_msm *mdwc) if (!of_property_read_bool(node, "iommus")) return 0; mdwc->iommu_map = arm_iommu_create_mapping(&platform_bus_type, mdwc->iommu_map = __depr_arm_iommu_create_mapping(&platform_bus_type, SMMU_BASE, SMMU_SIZE); if (IS_ERR_OR_NULL(mdwc->iommu_map)) { ret = PTR_ERR(mdwc->iommu_map) ?: -ENODEV; Loading @@ -3118,7 +3118,7 @@ static int dwc3_msm_init_iommu(struct dwc3_msm *mdwc) goto release_mapping; } ret = arm_iommu_attach_device(mdwc->dev, mdwc->iommu_map); ret = __depr_arm_iommu_attach_device(mdwc->dev, mdwc->iommu_map); if (ret) { dev_err(mdwc->dev, "IOMMU attach failed (%d)\n", ret); goto release_mapping; Loading @@ -3128,7 +3128,7 @@ static int dwc3_msm_init_iommu(struct dwc3_msm *mdwc) return 0; release_mapping: arm_iommu_release_mapping(mdwc->iommu_map); __depr_arm_iommu_release_mapping(mdwc->iommu_map); mdwc->iommu_map = NULL; return ret; } Loading Loading @@ -3555,7 +3555,7 @@ static int dwc3_msm_probe(struct platform_device *pdev) /* IOMMU will be reattached upon each resume/connect */ if (mdwc->iommu_map) arm_iommu_detach_device(mdwc->dev); __depr_arm_iommu_detach_device(mdwc->dev); /* * Clocks and regulators will not be turned on until the first time Loading Loading @@ -3606,8 +3606,8 @@ static int dwc3_msm_probe(struct platform_device *pdev) uninit_iommu: if (mdwc->iommu_map) { arm_iommu_detach_device(mdwc->dev); arm_iommu_release_mapping(mdwc->iommu_map); __depr_arm_iommu_detach_device(mdwc->dev); __depr_arm_iommu_release_mapping(mdwc->iommu_map); } of_platform_depopulate(&pdev->dev); err: Loading Loading @@ -3687,8 +3687,8 @@ static int dwc3_msm_remove(struct platform_device *pdev) if (mdwc->iommu_map) { if (!atomic_read(&dwc->in_lpm)) arm_iommu_detach_device(mdwc->dev); arm_iommu_release_mapping(mdwc->iommu_map); __depr_arm_iommu_detach_device(mdwc->dev); __depr_arm_iommu_release_mapping(mdwc->iommu_map); } return 0; Loading Loading
arch/arm64/boot/dts/qcom/kona-usb.dtsi +1 −0 Original line number Diff line number Diff line Loading @@ -13,6 +13,7 @@ reg-names = "core_base"; iommus = <&apps_smmu 0x0 0x0>; qcom,iommu-dma = "disabled"; #address-cells = <1>; #size-cells = <1>; ranges; Loading
arch/arm64/include/asm/dma-iommu.h +11 −8 Original line number Diff line number Diff line Loading @@ -32,34 +32,37 @@ struct dma_iommu_mapping { #ifdef CONFIG_ARM64_DMA_USE_IOMMU struct dma_iommu_mapping * arm_iommu_create_mapping(struct bus_type *bus, dma_addr_t base, size_t size); __depr_arm_iommu_create_mapping(struct bus_type *bus, dma_addr_t base, size_t size); void arm_iommu_release_mapping(struct dma_iommu_mapping *mapping); void __depr_arm_iommu_release_mapping(struct dma_iommu_mapping *mapping); int arm_iommu_attach_device(struct device *dev, int __depr_arm_iommu_attach_device(struct device *dev, struct dma_iommu_mapping *mapping); void arm_iommu_detach_device(struct device *dev); void __depr_arm_iommu_detach_device(struct device *dev); void arm_iommu_put_dma_cookie(struct iommu_domain *domain); #else /* !CONFIG_ARM64_DMA_USE_IOMMU */ static inline struct dma_iommu_mapping * arm_iommu_create_mapping(struct bus_type *bus, dma_addr_t base, size_t size) __depr_arm_iommu_create_mapping(struct bus_type *bus, dma_addr_t base, size_t size) { return NULL; } static inline void arm_iommu_release_mapping(struct dma_iommu_mapping *mapping) static inline void __depr_arm_iommu_release_mapping(struct dma_iommu_mapping *mapping) { } static inline int arm_iommu_attach_device(struct device *dev, static inline int __depr_arm_iommu_attach_device(struct device *dev, struct dma_iommu_mapping *mapping) { return -ENODEV; } static inline void arm_iommu_detach_device(struct device *dev) static inline void __depr_arm_iommu_detach_device(struct device *dev) { } Loading
arch/arm64/mm/dma-mapping.c +9 −8 Original line number Diff line number Diff line Loading @@ -1158,7 +1158,8 @@ static void arm_iommu_setup_dma_ops(struct device *dev, u64 dma_base, u64 size) * to calling arm_iommu_attach_device() to complete initialization. */ struct dma_iommu_mapping * arm_iommu_create_mapping(struct bus_type *bus, dma_addr_t base, size_t size) __depr_arm_iommu_create_mapping(struct bus_type *bus, dma_addr_t base, size_t size) { unsigned int bits = size >> PAGE_SHIFT; struct dma_iommu_mapping *mapping; Loading @@ -1184,7 +1185,7 @@ arm_iommu_create_mapping(struct bus_type *bus, dma_addr_t base, size_t size) kfree(mapping); return ERR_PTR(-ENOMEM); } EXPORT_SYMBOL(arm_iommu_create_mapping); EXPORT_SYMBOL(__depr_arm_iommu_create_mapping); /* * DEPRECATED Loading @@ -1194,7 +1195,7 @@ EXPORT_SYMBOL(arm_iommu_create_mapping); * Frees all resources associated with the iommu mapping. * The device associated with this mapping must be in the 'detached' state */ void arm_iommu_release_mapping(struct dma_iommu_mapping *mapping) void __depr_arm_iommu_release_mapping(struct dma_iommu_mapping *mapping) { if (!mapping) return; Loading @@ -1204,7 +1205,7 @@ void arm_iommu_release_mapping(struct dma_iommu_mapping *mapping) kfree(mapping); } EXPORT_SYMBOL(arm_iommu_release_mapping); EXPORT_SYMBOL(__depr_arm_iommu_release_mapping); /** * DEPRECATED Loading @@ -1219,7 +1220,7 @@ EXPORT_SYMBOL(arm_iommu_release_mapping); * * Only configures dma_ops for a single device in the iommu_group. */ int arm_iommu_attach_device(struct device *dev, int __depr_arm_iommu_attach_device(struct device *dev, struct dma_iommu_mapping *mapping) { int err; Loading Loading @@ -1265,7 +1266,7 @@ int arm_iommu_attach_device(struct device *dev, pr_debug("Attached IOMMU controller to %s device.\n", dev_name(dev)); return 0; } EXPORT_SYMBOL(arm_iommu_attach_device); EXPORT_SYMBOL(__depr_arm_iommu_attach_device); /** * DEPRECATED Loading @@ -1275,7 +1276,7 @@ EXPORT_SYMBOL(arm_iommu_attach_device); * Detaches the provided device from a previously attached map. * This voids the dma operations (dma_map_ops pointer) */ void arm_iommu_detach_device(struct device *dev) void __depr_arm_iommu_detach_device(struct device *dev) { struct iommu_domain *domain; int s1_bypass = 0; Loading Loading @@ -1307,7 +1308,7 @@ void arm_iommu_detach_device(struct device *dev) pr_debug("Detached IOMMU controller from %s device.\n", dev_name(dev)); } EXPORT_SYMBOL(arm_iommu_detach_device); EXPORT_SYMBOL(__depr_arm_iommu_detach_device); #else /*!CONFIG_ARM64_DMA_USE_IOMMU */ Loading
drivers/hwtracing/coresight/coresight-tmc.c +6 −5 Original line number Diff line number Diff line Loading @@ -457,7 +457,7 @@ static int tmc_iommu_init(struct tmc_drvdata *drvdata) if (!of_property_read_bool(node, "iommus")) return 0; drvdata->iommu_mapping = arm_iommu_create_mapping(&amba_bustype, drvdata->iommu_mapping = __depr_arm_iommu_create_mapping(&amba_bustype, 0, (SZ_1G * 4ULL)); if (IS_ERR_OR_NULL(drvdata->iommu_mapping)) { dev_err(drvdata->dev, "Create mapping failed, err = %d\n", ret); Loading @@ -474,7 +474,8 @@ static int tmc_iommu_init(struct tmc_drvdata *drvdata) goto iommu_attach_fail; } ret = arm_iommu_attach_device(drvdata->dev, drvdata->iommu_mapping); ret = __depr_arm_iommu_attach_device(drvdata->dev, drvdata->iommu_mapping); if (ret) { dev_err(drvdata->dev, "Attach device failed, err = %d\n", ret); goto iommu_attach_fail; Loading @@ -483,7 +484,7 @@ static int tmc_iommu_init(struct tmc_drvdata *drvdata) return ret; iommu_attach_fail: arm_iommu_release_mapping(drvdata->iommu_mapping); __depr_arm_iommu_release_mapping(drvdata->iommu_mapping); iommu_map_err: drvdata->iommu_mapping = NULL; return ret; Loading @@ -494,8 +495,8 @@ static void tmc_iommu_deinit(struct tmc_drvdata *drvdata) if (!drvdata->iommu_mapping) return; arm_iommu_detach_device(drvdata->dev); arm_iommu_release_mapping(drvdata->iommu_mapping); __depr_arm_iommu_detach_device(drvdata->dev); __depr_arm_iommu_release_mapping(drvdata->iommu_mapping); drvdata->iommu_mapping = NULL; } Loading
drivers/usb/dwc3/dwc3-msm.c +10 −10 Original line number Diff line number Diff line Loading @@ -2372,7 +2372,7 @@ static int dwc3_msm_suspend(struct dwc3_msm *mdwc) clk_disable_unprepare(mdwc->sleep_clk); if (mdwc->iommu_map) { arm_iommu_detach_device(mdwc->dev); __depr_arm_iommu_detach_device(mdwc->dev); dev_dbg(mdwc->dev, "IOMMU detached\n"); } } Loading Loading @@ -2518,7 +2518,7 @@ static int dwc3_msm_resume(struct dwc3_msm *mdwc) u32 tmp; if (mdwc->iommu_map) { ret = arm_iommu_attach_device(mdwc->dev, ret = __depr_arm_iommu_attach_device(mdwc->dev, mdwc->iommu_map); if (ret) dev_err(mdwc->dev, "IOMMU attach failed (%d)\n", Loading Loading @@ -3091,7 +3091,7 @@ static int dwc3_msm_init_iommu(struct dwc3_msm *mdwc) if (!of_property_read_bool(node, "iommus")) return 0; mdwc->iommu_map = arm_iommu_create_mapping(&platform_bus_type, mdwc->iommu_map = __depr_arm_iommu_create_mapping(&platform_bus_type, SMMU_BASE, SMMU_SIZE); if (IS_ERR_OR_NULL(mdwc->iommu_map)) { ret = PTR_ERR(mdwc->iommu_map) ?: -ENODEV; Loading @@ -3118,7 +3118,7 @@ static int dwc3_msm_init_iommu(struct dwc3_msm *mdwc) goto release_mapping; } ret = arm_iommu_attach_device(mdwc->dev, mdwc->iommu_map); ret = __depr_arm_iommu_attach_device(mdwc->dev, mdwc->iommu_map); if (ret) { dev_err(mdwc->dev, "IOMMU attach failed (%d)\n", ret); goto release_mapping; Loading @@ -3128,7 +3128,7 @@ static int dwc3_msm_init_iommu(struct dwc3_msm *mdwc) return 0; release_mapping: arm_iommu_release_mapping(mdwc->iommu_map); __depr_arm_iommu_release_mapping(mdwc->iommu_map); mdwc->iommu_map = NULL; return ret; } Loading Loading @@ -3555,7 +3555,7 @@ static int dwc3_msm_probe(struct platform_device *pdev) /* IOMMU will be reattached upon each resume/connect */ if (mdwc->iommu_map) arm_iommu_detach_device(mdwc->dev); __depr_arm_iommu_detach_device(mdwc->dev); /* * Clocks and regulators will not be turned on until the first time Loading Loading @@ -3606,8 +3606,8 @@ static int dwc3_msm_probe(struct platform_device *pdev) uninit_iommu: if (mdwc->iommu_map) { arm_iommu_detach_device(mdwc->dev); arm_iommu_release_mapping(mdwc->iommu_map); __depr_arm_iommu_detach_device(mdwc->dev); __depr_arm_iommu_release_mapping(mdwc->iommu_map); } of_platform_depopulate(&pdev->dev); err: Loading Loading @@ -3687,8 +3687,8 @@ static int dwc3_msm_remove(struct platform_device *pdev) if (mdwc->iommu_map) { if (!atomic_read(&dwc->in_lpm)) arm_iommu_detach_device(mdwc->dev); arm_iommu_release_mapping(mdwc->iommu_map); __depr_arm_iommu_detach_device(mdwc->dev); __depr_arm_iommu_release_mapping(mdwc->iommu_map); } return 0; Loading