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

iommu: parisc: pass struct device to iommu_alloc_range

This adds struct device argument to sba_alloc_range and ccio_alloc_range, a
preparation for modifications to fix the IOMMU segment boundary problem. This
change enables ccio_alloc_range to access to LLD's segment boundary limits.

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Kyle McMartin <kyle@parisc-linux.org>
Cc: Matthew Wilcox <matthew@wil.cx>
Cc: Grant Grundler <grundler@parisc-linux.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

FUJITA Tomonori and committed by
Linus Torvalds
7c8cda62 3715863a

+7 -7
+2 -2
drivers/parisc/ccio-dma.c
··· 341 341 * of available pages for the requested size. 342 342 */ 343 343 static int 344 - ccio_alloc_range(struct ioc *ioc, size_t size) 344 + ccio_alloc_range(struct ioc *ioc, struct device *dev, size_t size) 345 345 { 346 346 unsigned int pages_needed = size >> IOVP_SHIFT; 347 347 unsigned int res_idx; ··· 760 760 ioc->msingle_pages += size >> IOVP_SHIFT; 761 761 #endif 762 762 763 - idx = ccio_alloc_range(ioc, size); 763 + idx = ccio_alloc_range(ioc, dev, size); 764 764 iovp = (dma_addr_t)MKIOVP(idx); 765 765 766 766 pdir_start = &(ioc->pdir_base[idx]);
+3 -3
drivers/parisc/iommu-helpers.h
··· 96 96 97 97 static inline unsigned int 98 98 iommu_coalesce_chunks(struct ioc *ioc, struct device *dev, 99 - struct scatterlist *startsg, int nents, 100 - int (*iommu_alloc_range)(struct ioc *, size_t)) 99 + struct scatterlist *startsg, int nents, 100 + int (*iommu_alloc_range)(struct ioc *, struct device *, size_t)) 101 101 { 102 102 struct scatterlist *contig_sg; /* contig chunk head */ 103 103 unsigned long dma_offset, dma_len; /* start/len of DMA stream */ ··· 166 166 dma_len = ALIGN(dma_len + dma_offset, IOVP_SIZE); 167 167 sg_dma_address(contig_sg) = 168 168 PIDE_FLAG 169 - | (iommu_alloc_range(ioc, dma_len) << IOVP_SHIFT) 169 + | (iommu_alloc_range(ioc, dev, dma_len) << IOVP_SHIFT) 170 170 | dma_offset; 171 171 n_mappings++; 172 172 }
+2 -2
drivers/parisc/sba_iommu.c
··· 404 404 * resource bit map. 405 405 */ 406 406 static int 407 - sba_alloc_range(struct ioc *ioc, size_t size) 407 + sba_alloc_range(struct ioc *ioc, struct device *dev, size_t size) 408 408 { 409 409 unsigned int pages_needed = size >> IOVP_SHIFT; 410 410 #ifdef SBA_COLLECT_STATS ··· 710 710 ioc->msingle_calls++; 711 711 ioc->msingle_pages += size >> IOVP_SHIFT; 712 712 #endif 713 - pide = sba_alloc_range(ioc, size); 713 + pide = sba_alloc_range(ioc, dev, size); 714 714 iovp = (dma_addr_t) pide << IOVP_SHIFT; 715 715 716 716 DBG_RUN("%s() 0x%p -> 0x%lx\n",