* [PATCH v1] swiotlb: move slot allocation explanation comment where it belongs
@ 2023-08-02 16:30 Petr Tesarik
2023-08-08 17:36 ` Christoph Hellwig
0 siblings, 1 reply; 2+ messages in thread
From: Petr Tesarik @ 2023-08-02 16:30 UTC (permalink / raw)
To: Christoph Hellwig, Marek Szyprowski, Robin Murphy, Jianxiong Gao,
Konrad Rzeszutek Wilk, open list:DMA MAPPING HELPERS, open list
Cc: Roberto Sassu, petr
From: Petr Tesarik <petr.tesarik.ext@huawei.com>
Move the comment down in front of the loop that actually sets the list
member of struct io_tlb_slot to zero.
Fixes: 26a7e094783d ("swiotlb: refactor swiotlb_tbl_map_single")
Signed-off-by: Petr Tesarik <petr.tesarik.ext@huawei.com>
---
kernel/dma/swiotlb.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index d7eac84f975b..50a0e9c45c39 100644
--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@ -1018,11 +1018,6 @@ static int swiotlb_area_find_slots(struct device *dev, struct io_tlb_pool *pool,
continue;
}
- /*
- * If we find a slot that indicates we have 'nslots' number of
- * contiguous buffers, we allocate the buffers from that slot
- * and mark the entries as '0' indicating unavailable.
- */
if (!iommu_is_span_boundary(slot_index, nslots,
nr_slots(tbl_dma_addr),
max_slots)) {
@@ -1038,6 +1033,11 @@ static int swiotlb_area_find_slots(struct device *dev, struct io_tlb_pool *pool,
return -1;
found:
+ /*
+ * If we find a slot that indicates we have 'nslots' number of
+ * contiguous buffers, we allocate the buffers from that slot onwards
+ * and set the list of free entries to '0' indicating unavailable.
+ */
for (i = slot_index; i < slot_index + nslots; i++) {
pool->slots[i].list = 0;
pool->slots[i].alloc_size = alloc_size - (offset +
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH v1] swiotlb: move slot allocation explanation comment where it belongs
2023-08-02 16:30 [PATCH v1] swiotlb: move slot allocation explanation comment where it belongs Petr Tesarik
@ 2023-08-08 17:36 ` Christoph Hellwig
0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2023-08-08 17:36 UTC (permalink / raw)
To: Petr Tesarik
Cc: Christoph Hellwig, Marek Szyprowski, Robin Murphy, Jianxiong Gao,
Konrad Rzeszutek Wilk, open list:DMA MAPPING HELPERS, open list,
Roberto Sassu, petr
Thanks, applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-08-08 18:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-02 16:30 [PATCH v1] swiotlb: move slot allocation explanation comment where it belongs Petr Tesarik
2023-08-08 17:36 ` Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox