Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 358818
b: refs/heads/master
c: 6fe3675
h: refs/heads/master
v: v3
  • Loading branch information
Hiroshi Doyu authored and Marek Szyprowski committed Feb 25, 2013
1 parent 628848c commit 05b0c4a
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fab112a394b9cf5e3bf888af6ff5076ba9fa0f06
refs/heads/master: 6fe367580339a3adf77273d4366652665319bdeb
1 change: 1 addition & 0 deletions trunk/arch/arm/include/asm/dma-iommu.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ void arm_iommu_release_mapping(struct dma_iommu_mapping *mapping);

int arm_iommu_attach_device(struct device *dev,
struct dma_iommu_mapping *mapping);
void arm_iommu_detach_device(struct device *dev);

#endif /* __KERNEL__ */
#endif
25 changes: 25 additions & 0 deletions trunk/arch/arm/mm/dma-mapping.c
Original file line number Diff line number Diff line change
Expand Up @@ -1848,4 +1848,29 @@ int arm_iommu_attach_device(struct device *dev,
return 0;
}

/**
* arm_iommu_detach_device
* @dev: valid struct device pointer
*
* 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)
{
struct dma_iommu_mapping *mapping;

mapping = to_dma_iommu_mapping(dev);
if (!mapping) {
dev_warn(dev, "Not attached\n");
return;
}

iommu_detach_device(mapping->domain, dev);
kref_put(&mapping->kref, release_iommu_mapping);
mapping = NULL;
set_dma_ops(dev, NULL);

pr_debug("Detached IOMMU controller from %s device.\n", dev_name(dev));
}

#endif

0 comments on commit 05b0c4a

Please sign in to comment.