Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

swiotlb: pass a gfp_mask argument to swiotlb_init_late

Let the caller chose a zone to allocate from. This will be used
later on by the xen-swiotlb initialization on arm.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Tested-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>

+4 -7
+1 -1
arch/x86/pci/sta2x11-fixup.c
··· 57 57 int size = STA2X11_SWIOTLB_SIZE; 58 58 /* First instance: register your own swiotlb area */ 59 59 dev_info(&pdev->dev, "Using SWIOTLB (size %i)\n", size); 60 - if (swiotlb_init_late(size)) 60 + if (swiotlb_init_late(size, GFP_DMA)) 61 61 dev_emerg(&pdev->dev, "init swiotlb failed\n"); 62 62 } 63 63 list_add(&instance->list, &sta2x11_instance_list);
+1 -1
include/linux/swiotlb.h
··· 37 37 int swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, unsigned int flags); 38 38 unsigned long swiotlb_size_or_default(void); 39 39 extern int swiotlb_late_init_with_tbl(char *tlb, unsigned long nslabs); 40 - int swiotlb_init_late(size_t size); 40 + int swiotlb_init_late(size_t size, gfp_t gfp_mask); 41 41 extern void __init swiotlb_update_mem_attributes(void); 42 42 43 43 phys_addr_t swiotlb_tbl_map_single(struct device *hwdev, phys_addr_t phys,
+2 -5
kernel/dma/swiotlb.c
··· 292 292 * initialize the swiotlb later using the slab allocator if needed. 293 293 * This should be just like above, but with some error catching. 294 294 */ 295 - int swiotlb_init_late(size_t size) 295 + int swiotlb_init_late(size_t size, gfp_t gfp_mask) 296 296 { 297 297 unsigned long nslabs = ALIGN(size >> IO_TLB_SHIFT, IO_TLB_SEGSIZE); 298 298 unsigned long bytes; ··· 303 303 if (swiotlb_force_disable) 304 304 return 0; 305 305 306 - /* 307 - * Get IO TLB memory from the low pages 308 - */ 309 306 order = get_order(nslabs << IO_TLB_SHIFT); 310 307 nslabs = SLABS_PER_PAGE << order; 311 308 bytes = nslabs << IO_TLB_SHIFT; 312 309 313 310 while ((SLABS_PER_PAGE << order) > IO_TLB_MIN_SLABS) { 314 - vstart = (void *)__get_free_pages(GFP_DMA | __GFP_NOWARN, 311 + vstart = (void *)__get_free_pages(gfp_mask | __GFP_NOWARN, 315 312 order); 316 313 if (vstart) 317 314 break;