Pull dma-mapping updates from Christoph Hellwig: - remove a not very useful and now unused swiotlb API (Christoph Hellwig) - fix a section mismatch (Randy Dunlap) * tag 'dma-mapping-6.3-2022-02-27' of git://git.infradead.org/users/hch/dma-mapping: swiotlb: mark swiotlb_memblock_alloc() as __init swiotlb: remove swiotlb_max_segment
Unified · Split
| @@ -121,7 +121,6 @@ static inline bool is_swiotlb_force_bounce(struct device *dev) · 120 unmodified lines | |||
| 121 | 121 | ||
| 122 | void swiotlb_init(bool addressing_limited, unsigned int flags); | 122 | void swiotlb_init(bool addressing_limited, unsigned int flags); |
| 123 | void __init swiotlb_exit(void); | 123 | void __init swiotlb_exit(void); |
| 124 | unsigned int swiotlb_max_segment(void); | ||
| 125 | size_t swiotlb_max_mapping_size(struct device *dev); | 124 | size_t swiotlb_max_mapping_size(struct device *dev); |
| 126 | bool is_swiotlb_active(struct device *dev); | 125 | bool is_swiotlb_active(struct device *dev); |
| 127 | void __init swiotlb_adjust_size(unsigned long size); | 126 | void __init swiotlb_adjust_size(unsigned long size); |
| @@ -140,10 +139,6 @@ static inline bool is_swiotlb_force_bounce(struct device *dev) · 12 unmodified lines | |||
| 140 | static inline void swiotlb_exit(void) | 139 | static inline void swiotlb_exit(void) |
| 141 | { | 140 | { |
| 142 | } | 141 | } |
| 143 | static inline unsigned int swiotlb_max_segment(void) | ||
| 144 | { | ||
| 145 | return 0; | ||
| 146 | } | ||
| 147 | static inline size_t swiotlb_max_mapping_size(struct device *dev) | 142 | static inline size_t swiotlb_max_mapping_size(struct device *dev) |
| 148 | { | 143 | { |
| 149 | return SIZE_MAX; | 144 | return SIZE_MAX; |
| @@ -156,14 +156,6 @@ setup_io_tlb_npages(char *str) · 155 unmodified lines | |||
| 156 | } | 156 | } |
| 157 | early_param("swiotlb", setup_io_tlb_npages); | 157 | early_param("swiotlb", setup_io_tlb_npages); |
| 158 | 158 | ||
| 159 | unsigned int swiotlb_max_segment(void) | ||
| 160 | { | ||
| 161 | if (!io_tlb_default_mem.nslabs) | ||
| 162 | return 0; | ||
| 163 | return rounddown(io_tlb_default_mem.nslabs << IO_TLB_SHIFT, PAGE_SIZE); | ||
| 164 | } | ||
| 165 | EXPORT_SYMBOL_GPL(swiotlb_max_segment); | ||
| 166 | |||
| 167 | unsigned long swiotlb_size_or_default(void) | 159 | unsigned long swiotlb_size_or_default(void) |
| 168 | { | 160 | { |
| 169 | return default_nslabs << IO_TLB_SHIFT; | 161 | return default_nslabs << IO_TLB_SHIFT; |
| @@ -300,7 +292,8 @@ static void swiotlb_init_io_tlb_mem(struct io_tlb_mem *mem, phys_addr_t start, · 130 unmodified lines | |||
| 300 | return; | 292 | return; |
| 301 | } | 293 | } |
| 302 | 294 | ||
| 303 | static void *swiotlb_memblock_alloc(unsigned long nslabs, unsigned int flags, | 295 | static void __init *swiotlb_memblock_alloc(unsigned long nslabs, |
| 296 | unsigned int flags, | ||
| 304 | int (*remap)(void *tlb, unsigned long nslabs)) | 297 | int (*remap)(void *tlb, unsigned long nslabs)) |
| 305 | { | 298 | { |
| 306 | size_t bytes = PAGE_ALIGN(nslabs << IO_TLB_SHIFT); | 299 | size_t bytes = PAGE_ALIGN(nslabs << IO_TLB_SHIFT); |