hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/arch/sparc/kernel/iommu-common.c
....@@ -166,13 +166,6 @@
166166 }
167167 }
168168
169
- if (dev)
170
- boundary_size = ALIGN(dma_get_seg_boundary(dev) + 1,
171
- 1 << iommu->table_shift);
172
- else
173
- boundary_size = ALIGN(1ULL << 32, 1 << iommu->table_shift);
174
-
175
- boundary_size = boundary_size >> iommu->table_shift;
176169 /*
177170 * if the skip_span_boundary_check had been set during init, we set
178171 * things up so that iommu_is_span_boundary() merely checks if the
....@@ -181,6 +174,9 @@
181174 if ((iommu->flags & IOMMU_NO_SPAN_BOUND) != 0) {
182175 shift = 0;
183176 boundary_size = iommu->poolsize * iommu->nr_pools;
177
+ } else {
178
+ boundary_size = dma_get_seg_boundary_nr_pages(dev,
179
+ iommu->table_shift);
184180 }
185181 n = iommu_area_alloc(iommu->map, limit, start, npages, shift,
186182 boundary_size, align_mask);