Lines Matching refs:nslabs
185 if (!io_tlb_default_mem.nslabs) in swiotlb_max_segment()
187 return rounddown(io_tlb_default_mem.nslabs << IO_TLB_SHIFT, PAGE_SIZE); in swiotlb_max_segment()
217 if (!mem->nslabs) { in swiotlb_print_info()
223 (mem->nslabs << IO_TLB_SHIFT) >> 20); in swiotlb_print_info()
276 if (!mem->nslabs || mem->late_alloc) in swiotlb_update_mem_attributes()
279 bytes = PAGE_ALIGN(mem->nslabs << IO_TLB_SHIFT); in swiotlb_update_mem_attributes()
288 unsigned long nslabs, unsigned int flags, in swiotlb_init_io_tlb_mem() argument
292 unsigned long bytes = nslabs << IO_TLB_SHIFT, i; in swiotlb_init_io_tlb_mem()
294 mem->nslabs = nslabs; in swiotlb_init_io_tlb_mem()
299 mem->area_nslabs = nslabs / mem->nareas; in swiotlb_init_io_tlb_mem()
309 for (i = 0; i < mem->nslabs; i++) { in swiotlb_init_io_tlb_mem()
327 static void __init *swiotlb_memblock_alloc(unsigned long nslabs, in swiotlb_memblock_alloc() argument
329 int (*remap)(void *tlb, unsigned long nslabs)) in swiotlb_memblock_alloc()
331 size_t bytes = PAGE_ALIGN(nslabs << IO_TLB_SHIFT); in swiotlb_memblock_alloc()
350 if (remap && remap(tlb, nslabs) < 0) { in swiotlb_memblock_alloc()
364 int (*remap)(void *tlb, unsigned long nslabs)) in swiotlb_init_remap() argument
367 unsigned long nslabs; in swiotlb_init_remap() local
380 nslabs = default_nslabs; in swiotlb_init_remap()
381 nareas = limit_nareas(default_nareas, nslabs); in swiotlb_init_remap()
382 while ((tlb = swiotlb_memblock_alloc(nslabs, flags, remap)) == NULL) { in swiotlb_init_remap()
383 if (nslabs <= IO_TLB_MIN_SLABS) in swiotlb_init_remap()
385 nslabs = ALIGN(nslabs >> 1, IO_TLB_SEGSIZE); in swiotlb_init_remap()
386 nareas = limit_nareas(nareas, nslabs); in swiotlb_init_remap()
389 if (default_nslabs != nslabs) { in swiotlb_init_remap()
391 default_nslabs, nslabs); in swiotlb_init_remap()
392 default_nslabs = nslabs; in swiotlb_init_remap()
395 alloc_size = PAGE_ALIGN(array_size(sizeof(*mem->slots), nslabs)); in swiotlb_init_remap()
410 swiotlb_init_io_tlb_mem(mem, __pa(tlb), nslabs, flags, false, in swiotlb_init_remap()
428 int (*remap)(void *tlb, unsigned long nslabs)) in swiotlb_init_late() argument
431 unsigned long nslabs = ALIGN(size >> IO_TLB_SHIFT, IO_TLB_SEGSIZE); in swiotlb_init_late() local
445 order = get_order(nslabs << IO_TLB_SHIFT); in swiotlb_init_late()
446 nslabs = SLABS_PER_PAGE << order; in swiotlb_init_late()
454 nslabs = SLABS_PER_PAGE << order; in swiotlb_init_late()
462 rc = remap(vstart, nslabs); in swiotlb_init_late()
466 nslabs = ALIGN(nslabs >> 1, IO_TLB_SEGSIZE); in swiotlb_init_late()
467 if (nslabs < IO_TLB_MIN_SLABS) in swiotlb_init_late()
478 nareas = limit_nareas(default_nareas, nslabs); in swiotlb_init_late()
486 get_order(array_size(sizeof(*mem->slots), nslabs))); in swiotlb_init_late()
491 (nslabs << IO_TLB_SHIFT) >> PAGE_SHIFT); in swiotlb_init_late()
492 swiotlb_init_io_tlb_mem(mem, virt_to_phys(vstart), nslabs, 0, true, in swiotlb_init_late()
515 if (!mem->nslabs) in swiotlb_exit()
521 slots_size = PAGE_ALIGN(array_size(sizeof(*mem->slots), mem->nslabs)); in swiotlb_exit()
777 if (!mem || !mem->nslabs) { in swiotlb_tbl_map_single()
798 alloc_size, mem->nslabs, mem_used(mem)); in swiotlb_tbl_map_single()
956 return mem && mem->nslabs; in is_swiotlb_active()
973 if (!mem->nslabs) in swiotlb_create_debugfs_files()
976 debugfs_create_ulong("io_tlb_nslabs", 0400, mem->debugfs, &mem->nslabs); in swiotlb_create_debugfs_files()
1027 unsigned long nslabs = rmem->size >> IO_TLB_SHIFT; in rmem_swiotlb_device_init() local
1047 mem->slots = kcalloc(nslabs, sizeof(*mem->slots), GFP_KERNEL); in rmem_swiotlb_device_init()
1063 swiotlb_init_io_tlb_mem(mem, rmem->base, nslabs, SWIOTLB_FORCE, in rmem_swiotlb_device_init()