.. | .. |
---|
166 | 166 | } |
---|
167 | 167 | } |
---|
168 | 168 | |
---|
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; |
---|
176 | 169 | /* |
---|
177 | 170 | * if the skip_span_boundary_check had been set during init, we set |
---|
178 | 171 | * things up so that iommu_is_span_boundary() merely checks if the |
---|
.. | .. |
---|
181 | 174 | if ((iommu->flags & IOMMU_NO_SPAN_BOUND) != 0) { |
---|
182 | 175 | shift = 0; |
---|
183 | 176 | boundary_size = iommu->poolsize * iommu->nr_pools; |
---|
| 177 | + } else { |
---|
| 178 | + boundary_size = dma_get_seg_boundary_nr_pages(dev, |
---|
| 179 | + iommu->table_shift); |
---|
184 | 180 | } |
---|
185 | 181 | n = iommu_area_alloc(iommu->map, limit, start, npages, shift, |
---|
186 | 182 | boundary_size, align_mask); |
---|