aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-05-07 21:45:27 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2019-05-07 21:45:27 -0400
commit498e8631f27ed649bd3e31998a00b2b9b288cf3a (patch)
tree6a5dc9cc69e9142129192c667f5eb2bc65391801 /kernel
parente4eaa9efbf79ccf6dc9915a9623049ef341bba85 (diff)
parent063b8271ec8f706d833e61dfca40c512504a62c1 (diff)
Merge branch 'stable/for-linus-5.2' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb
Pull swiotlb updates from Konrad Rzeszutek Wilk: "Cleanups in the swiotlb code and extra debugfs knobs to help with the field diagnostics" * 'stable/for-linus-5.2' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb: swiotlb-xen: ensure we have a single callsite for xen_dma_map_page swiotlb-xen: simplify the DMA sync method implementations swiotlb-xen: use ->map_page to implement ->map_sg swiotlb-xen: make instances match their method names swiotlb: save io_tlb_used to local variable before leaving critical section swiotlb: dump used and total slots when swiotlb buffer is full
Diffstat (limited to 'kernel')
-rw-r--r--kernel/dma/swiotlb.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index 53012db1e53c..6f7619c1f877 100644
--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@ -452,6 +452,7 @@ phys_addr_t swiotlb_tbl_map_single(struct device *hwdev,
452 unsigned long mask; 452 unsigned long mask;
453 unsigned long offset_slots; 453 unsigned long offset_slots;
454 unsigned long max_slots; 454 unsigned long max_slots;
455 unsigned long tmp_io_tlb_used;
455 456
456 if (no_iotlb_memory) 457 if (no_iotlb_memory)
457 panic("Can not allocate SWIOTLB buffer earlier and can't now provide you with the DMA bounce buffer"); 458 panic("Can not allocate SWIOTLB buffer earlier and can't now provide you with the DMA bounce buffer");
@@ -538,9 +539,12 @@ phys_addr_t swiotlb_tbl_map_single(struct device *hwdev,
538 } while (index != wrap); 539 } while (index != wrap);
539 540
540not_found: 541not_found:
542 tmp_io_tlb_used = io_tlb_used;
543
541 spin_unlock_irqrestore(&io_tlb_lock, flags); 544 spin_unlock_irqrestore(&io_tlb_lock, flags);
542 if (!(attrs & DMA_ATTR_NO_WARN) && printk_ratelimit()) 545 if (!(attrs & DMA_ATTR_NO_WARN) && printk_ratelimit())
543 dev_warn(hwdev, "swiotlb buffer is full (sz: %zd bytes)\n", size); 546 dev_warn(hwdev, "swiotlb buffer is full (sz: %zd bytes), total %lu (slots), used %lu (slots)\n",
547 size, io_tlb_nslabs, tmp_io_tlb_used);
544 return DMA_MAPPING_ERROR; 548 return DMA_MAPPING_ERROR;
545found: 549found:
546 io_tlb_used += nslots; 550 io_tlb_used += nslots;