Skip to content

Commit f94cb36

Browse files
Petr TesarikChristoph Hellwig
authored andcommitted
swiotlb: move slot allocation explanation comment where it belongs
Move the comment down in front of the loop that actually sets the list member of struct io_tlb_slot to zero. Fixes: 26a7e09 ("swiotlb: refactor swiotlb_tbl_map_single") Signed-off-by: Petr Tesarik <petr.tesarik.ext@huawei.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
1 parent 1395706 commit f94cb36

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

kernel/dma/swiotlb.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,11 +1018,6 @@ static int swiotlb_area_find_slots(struct device *dev, struct io_tlb_pool *pool,
10181018
continue;
10191019
}
10201020

1021-
/*
1022-
* If we find a slot that indicates we have 'nslots' number of
1023-
* contiguous buffers, we allocate the buffers from that slot
1024-
* and mark the entries as '0' indicating unavailable.
1025-
*/
10261021
if (!iommu_is_span_boundary(slot_index, nslots,
10271022
nr_slots(tbl_dma_addr),
10281023
max_slots)) {
@@ -1038,6 +1033,11 @@ static int swiotlb_area_find_slots(struct device *dev, struct io_tlb_pool *pool,
10381033
return -1;
10391034

10401035
found:
1036+
/*
1037+
* If we find a slot that indicates we have 'nslots' number of
1038+
* contiguous buffers, we allocate the buffers from that slot onwards
1039+
* and set the list of free entries to '0' indicating unavailable.
1040+
*/
10411041
for (i = slot_index; i < slot_index + nslots; i++) {
10421042
pool->slots[i].list = 0;
10431043
pool->slots[i].alloc_size = alloc_size - (offset +

0 commit comments

Comments
 (0)