diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2009-11-10 05:46:19 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-11-10 06:32:00 -0500 |
commit | ad32e8cb86e7894aac51c8963eaa9f36bb8a4e14 (patch) | |
tree | 4dce812e83de8bd130fd141afc1229b38b483736 /lib/swiotlb.c | |
parent | 5740afdb68abadc473fd5392df733558a58c1254 (diff) |
swiotlb: Defer swiotlb init printing, export swiotlb_print_info()
This enables us to avoid printing swiotlb memory info when we
initialize swiotlb. After swiotlb initialization, we could find
that we don't need swiotlb.
This patch removes the code to print swiotlb memory info in
swiotlb_init() and exports the function to do that.
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
Cc: tony.luck@intel.com
Cc: benh@kernel.crashing.org
LKML-Reference: <1257849980-22640-9-git-send-email-fujita.tomonori@lab.ntt.co.jp>
[ -v2: merge up conflict ]
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'lib/swiotlb.c')
-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 | ||