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.

alpha: use iommu_is_span_boundary helper function

iommu_is_span_boundary in lib/iommu-helper.c was exported for PARISC IOMMUs
(commit 3715863aa142c4f4c5208f5f3e5e9bac06006d2f). Alpha's IOMMU can use it.

This removes the check on the boundary size alignment because
iommu_is_span_boundary does.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Richard Henderson <rth@twiddle.net>
Acked-by: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
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
fd28841d 9efda797

+5 -10
+3
arch/alpha/Kconfig
··· 330 330 config PCI_SYSCALL 331 331 def_bool PCI 332 332 333 + config IOMMU_HELPER 334 + def_bool PCI 335 + 333 336 config ALPHA_CORE_AGP 334 337 bool 335 338 depends on ALPHA_GENERIC || ALPHA_TITAN || ALPHA_MARVEL
+2 -10
arch/alpha/kernel/pci_iommu.c
··· 10 10 #include <linux/scatterlist.h> 11 11 #include <linux/log2.h> 12 12 #include <linux/dma-mapping.h> 13 + #include <linux/iommu-helper.h> 13 14 14 15 #include <asm/io.h> 15 16 #include <asm/hwrpb.h> ··· 126 125 return iommu_arena_new_node(0, hose, base, window_size, align); 127 126 } 128 127 129 - static inline int is_span_boundary(unsigned int index, unsigned int nr, 130 - unsigned long shift, 131 - unsigned long boundary_size) 132 - { 133 - shift = (shift + index) & (boundary_size - 1); 134 - return shift + nr > boundary_size; 135 - } 136 - 137 128 /* Must be called with the arena lock held */ 138 129 static long 139 130 iommu_arena_find_pages(struct device *dev, struct pci_iommu_arena *arena, ··· 140 147 base = arena->dma_base >> PAGE_SHIFT; 141 148 if (dev) { 142 149 boundary_size = dma_get_seg_boundary(dev) + 1; 143 - BUG_ON(!is_power_of_2(boundary_size)); 144 150 boundary_size >>= PAGE_SHIFT; 145 151 } else { 146 152 boundary_size = 1UL << (32 - PAGE_SHIFT); ··· 153 161 154 162 again: 155 163 while (i < n && p+i < nent) { 156 - if (!i && is_span_boundary(p, n, base, boundary_size)) { 164 + if (!i && iommu_is_span_boundary(p, n, base, boundary_size)) { 157 165 p = ALIGN(p + 1, mask + 1); 158 166 goto again; 159 167 }