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.

MIPS/octeon: use swiotlb_init instead of open coding it

Use the generic swiotlb initialization helper instead of open coding it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Tested-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>

+3 -14
+2 -13
arch/mips/cavium-octeon/dma-octeon.c
··· 186 186 return daddr; 187 187 } 188 188 189 - char *octeon_swiotlb; 190 - 191 189 void __init plat_swiotlb_setup(void) 192 190 { 193 191 phys_addr_t start, end; 194 192 phys_addr_t max_addr; 195 193 phys_addr_t addr_size; 196 194 size_t swiotlbsize; 197 - unsigned long swiotlb_nslabs; 198 195 u64 i; 199 196 200 197 max_addr = 0; ··· 233 236 if (OCTEON_IS_OCTEON2() && max_addr >= 0x100000000ul) 234 237 swiotlbsize = 64 * (1<<20); 235 238 #endif 236 - swiotlb_nslabs = swiotlbsize >> IO_TLB_SHIFT; 237 - swiotlb_nslabs = ALIGN(swiotlb_nslabs, IO_TLB_SEGSIZE); 238 - swiotlbsize = swiotlb_nslabs << IO_TLB_SHIFT; 239 239 240 - octeon_swiotlb = memblock_alloc_low(swiotlbsize, PAGE_SIZE); 241 - if (!octeon_swiotlb) 242 - panic("%s: Failed to allocate %zu bytes align=%lx\n", 243 - __func__, swiotlbsize, PAGE_SIZE); 244 - 245 - if (swiotlb_init_with_tbl(octeon_swiotlb, swiotlb_nslabs, 1) == -ENOMEM) 246 - panic("Cannot allocate SWIOTLB buffer"); 240 + swiotlb_adjust_size(swiotlbsize); 241 + swiotlb_init(1); 247 242 }
+1 -1
arch/mips/pci/pci-octeon.c
··· 664 664 665 665 /* BAR1 movable regions contiguous to cover the swiotlb */ 666 666 octeon_bar1_pci_phys = 667 - virt_to_phys(octeon_swiotlb) & ~((1ull << 22) - 1); 667 + io_tlb_default_mem.start & ~((1ull << 22) - 1); 668 668 669 669 for (index = 0; index < 32; index++) { 670 670 union cvmx_pci_bar1_indexx bar1_index;