summaryrefslogtreecommitdiff
path: root/arch/ia64/lib/swiotlb.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/ia64/lib/swiotlb.c')
-rw-r--r--arch/ia64/lib/swiotlb.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/arch/ia64/lib/swiotlb.c b/arch/ia64/lib/swiotlb.c
index e4770828db59..d38b01538184 100644
--- a/arch/ia64/lib/swiotlb.c
+++ b/arch/ia64/lib/swiotlb.c
@@ -61,9 +61,8 @@ static char *io_tlb_start, *io_tlb_end;
/*
* The number of IO TLB blocks (in groups of 64) betweeen io_tlb_start and
* io_tlb_end. This is command line adjustable via setup_io_tlb_npages.
- * Default to 64MB.
*/
-static unsigned long io_tlb_nslabs = 32768;
+static unsigned long io_tlb_nslabs;
/*
* When the IOMMU overflows we return a fallback buffer. This sets the size.
@@ -113,10 +112,15 @@ __setup("swiotlb=", setup_io_tlb_npages);
* structures for the software IO TLB used to implement the PCI DMA API.
*/
void
-swiotlb_init(void)
+swiotlb_init_with_default_size (size_t default_size)
{
unsigned long i;
+ if (!io_tlb_nslabs) {
+ io_tlb_nslabs = (default_size >> PAGE_SHIFT);
+ io_tlb_nslabs = ALIGN(io_tlb_nslabs, IO_TLB_SEGSIZE);
+ }
+
/*
* Get IO TLB memory from the low pages
*/
@@ -145,6 +149,12 @@ swiotlb_init(void)
virt_to_phys(io_tlb_start), virt_to_phys(io_tlb_end));
}
+void
+swiotlb_init (void)
+{
+ swiotlb_init_with_default_size(64 * (1<<20)); /* default to 64MB */
+}
+
static inline int
address_needs_mapping(struct device *hwdev, dma_addr_t addr)
{