diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/swiotlb.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/swiotlb.c b/lib/swiotlb.c index eee512b63f17..0c12d7cce300 100644 --- a/lib/swiotlb.c +++ b/lib/swiotlb.c | |||
@@ -123,8 +123,9 @@ static dma_addr_t swiotlb_virt_to_bus(struct device *hwdev, | |||
123 | return phys_to_dma(hwdev, virt_to_phys(address)); | 123 | return phys_to_dma(hwdev, virt_to_phys(address)); |
124 | } | 124 | } |
125 | 125 | ||
126 | static void swiotlb_print_info(unsigned long bytes) | 126 | void swiotlb_print_info(void) |
127 | { | 127 | { |
128 | unsigned long bytes = io_tlb_nslabs << IO_TLB_SHIFT; | ||
128 | phys_addr_t pstart, pend; | 129 | phys_addr_t pstart, pend; |
129 | 130 | ||
130 | pstart = virt_to_phys(io_tlb_start); | 131 | pstart = virt_to_phys(io_tlb_start); |
@@ -142,7 +143,7 @@ static void swiotlb_print_info(unsigned long bytes) | |||
142 | * structures for the software IO TLB used to implement the DMA API. | 143 | * structures for the software IO TLB used to implement the DMA API. |
143 | */ | 144 | */ |
144 | void __init | 145 | void __init |
145 | swiotlb_init_with_default_size(size_t default_size) | 146 | swiotlb_init_with_default_size(size_t default_size, int verbose) |
146 | { | 147 | { |
147 | unsigned long i, bytes; | 148 | unsigned long i, bytes; |
148 | 149 | ||
@@ -178,14 +179,14 @@ swiotlb_init_with_default_size(size_t default_size) | |||
178 | io_tlb_overflow_buffer = alloc_bootmem_low(io_tlb_overflow); | 179 | io_tlb_overflow_buffer = alloc_bootmem_low(io_tlb_overflow); |
179 | if (!io_tlb_overflow_buffer) | 180 | if (!io_tlb_overflow_buffer) |
180 | panic("Cannot allocate SWIOTLB overflow buffer!\n"); | 181 | panic("Cannot allocate SWIOTLB overflow buffer!\n"); |
181 | 182 | if (verbose) | |
182 | swiotlb_print_info(bytes); | 183 | swiotlb_print_info(); |
183 | } | 184 | } |
184 | 185 | ||
185 | void __init | 186 | void __init |
186 | swiotlb_init(void) | 187 | swiotlb_init(int verbose) |
187 | { | 188 | { |
188 | swiotlb_init_with_default_size(64 * (1<<20)); /* default to 64MB */ | 189 | swiotlb_init_with_default_size(64 * (1<<20), verbose); /* default to 64MB */ |
189 | } | 190 | } |
190 | 191 | ||
191 | /* | 192 | /* |
@@ -262,7 +263,7 @@ swiotlb_late_init_with_default_size(size_t default_size) | |||
262 | if (!io_tlb_overflow_buffer) | 263 | if (!io_tlb_overflow_buffer) |
263 | goto cleanup4; | 264 | goto cleanup4; |
264 | 265 | ||
265 | swiotlb_print_info(bytes); | 266 | swiotlb_print_info(); |
266 | 267 | ||
267 | late_alloc = 1; | 268 | late_alloc = 1; |
268 | 269 | ||