swiotlb: Add swiotlb_free() function
swiotlb_free() function frees all allocated memory for swiotlb. We need to initialize swiotlb before IOMMU initialization (x86 and powerpc needs to allocate memory from bootmem allocator). If IOMMU initialization is successful, we need to free swiotlb resource (don't want to waste 64MB). Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Cc: chrisw@sous-sol.org Cc: dwmw2@infradead.org Cc: joerg.roedel@amd.com Cc: muli@il.ibm.com LKML-Reference: <1257849980-22640-8-git-send-email-fujita.tomonori@lab.ntt.co.jp> [ -v2: build fix for the !CONFIG_SWIOTLB case ] Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
committed by
Ingo Molnar
parent
9f993ac3f7
commit
5740afdb68
@@ -88,4 +88,10 @@ swiotlb_dma_mapping_error(struct device *hwdev, dma_addr_t dma_addr);
|
||||
extern int
|
||||
swiotlb_dma_supported(struct device *hwdev, u64 mask);
|
||||
|
||||
#ifdef CONFIG_SWIOTLB
|
||||
extern void __init swiotlb_free(void);
|
||||
#else
|
||||
static inline void swiotlb_free(void) { }
|
||||
#endif
|
||||
|
||||
#endif /* __LINUX_SWIOTLB_H */
|
||||
|
Reference in New Issue
Block a user