Loading arch/arm/mm/dma-mapping.c +19 −2 Original line number Diff line number Diff line Loading @@ -2304,11 +2304,15 @@ int arm_iommu_attach_device(struct device *dev, struct dma_iommu_mapping *mapping) { int err; int s1_bypass = 0; err = __arm_iommu_attach_device(dev, mapping); if (err) return err; iommu_domain_get_attr(mapping->domain, DOMAIN_ATTR_S1_BYPASS, &s1_bypass); if (!s1_bypass) set_dma_ops(dev, &iommu_ops); return 0; } Loading Loading @@ -2343,7 +2347,20 @@ static void __arm_iommu_detach_device(struct device *dev) */ void arm_iommu_detach_device(struct device *dev) { struct dma_iommu_mapping *mapping; int s1_bypass = 0; mapping = to_dma_iommu_mapping(dev); if (!mapping) { dev_warn(dev, "Not attached\n"); return; } __arm_iommu_detach_device(dev); iommu_domain_get_attr(mapping->domain, DOMAIN_ATTR_S1_BYPASS, &s1_bypass); if (!s1_bypass) set_dma_ops(dev, NULL); } EXPORT_SYMBOL_GPL(arm_iommu_detach_device); Loading Loading
arch/arm/mm/dma-mapping.c +19 −2 Original line number Diff line number Diff line Loading @@ -2304,11 +2304,15 @@ int arm_iommu_attach_device(struct device *dev, struct dma_iommu_mapping *mapping) { int err; int s1_bypass = 0; err = __arm_iommu_attach_device(dev, mapping); if (err) return err; iommu_domain_get_attr(mapping->domain, DOMAIN_ATTR_S1_BYPASS, &s1_bypass); if (!s1_bypass) set_dma_ops(dev, &iommu_ops); return 0; } Loading Loading @@ -2343,7 +2347,20 @@ static void __arm_iommu_detach_device(struct device *dev) */ void arm_iommu_detach_device(struct device *dev) { struct dma_iommu_mapping *mapping; int s1_bypass = 0; mapping = to_dma_iommu_mapping(dev); if (!mapping) { dev_warn(dev, "Not attached\n"); return; } __arm_iommu_detach_device(dev); iommu_domain_get_attr(mapping->domain, DOMAIN_ATTR_S1_BYPASS, &s1_bypass); if (!s1_bypass) set_dma_ops(dev, NULL); } EXPORT_SYMBOL_GPL(arm_iommu_detach_device); Loading