From: Greg Kroah-Hartman Date: Mon, 22 Jan 2024 20:44:37 +0000 (-0800) Subject: 5.15-stable patches X-Git-Tag: v4.19.306~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8bf593a7195a7a9ecd38ab67087132fb3be54674;p=thirdparty%2Fkernel%2Fstable-queue.git 5.15-stable patches added patches: iommu-dma-trace-bounce-buffer-usage-when-mapping-buffers.patch --- diff --git a/queue-5.15/iommu-dma-trace-bounce-buffer-usage-when-mapping-buffers.patch b/queue-5.15/iommu-dma-trace-bounce-buffer-usage-when-mapping-buffers.patch new file mode 100644 index 00000000000..5dbfb82e30a --- /dev/null +++ b/queue-5.15/iommu-dma-trace-bounce-buffer-usage-when-mapping-buffers.patch @@ -0,0 +1,51 @@ +From a63c357b9fd56ad5fe64616f5b22835252c6a76a Mon Sep 17 00:00:00 2001 +From: "Isaac J. Manjarres" +Date: Fri, 8 Dec 2023 15:41:40 -0800 +Subject: iommu/dma: Trace bounce buffer usage when mapping buffers + +From: Isaac J. Manjarres + +commit a63c357b9fd56ad5fe64616f5b22835252c6a76a upstream. + +When commit 82612d66d51d ("iommu: Allow the dma-iommu api to +use bounce buffers") was introduced, it did not add the logic +for tracing the bounce buffer usage from iommu_dma_map_page(). + +All of the users of swiotlb_tbl_map_single() trace their bounce +buffer usage, except iommu_dma_map_page(). This makes it difficult +to track SWIOTLB usage from that function. Thus, trace bounce buffer +usage from iommu_dma_map_page(). + +Fixes: 82612d66d51d ("iommu: Allow the dma-iommu api to use bounce buffers") +Cc: stable@vger.kernel.org # v5.15+ +Cc: Tom Murphy +Cc: Lu Baolu +Cc: Saravana Kannan +Signed-off-by: Isaac J. Manjarres +Link: https://lore.kernel.org/r/20231208234141.2356157-1-isaacmanjarres@google.com +Signed-off-by: Joerg Roedel +Signed-off-by: Isaac J. Manjarres +Signed-off-by: Greg Kroah-Hartman +--- + drivers/iommu/dma-iommu.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/iommu/dma-iommu.c ++++ b/drivers/iommu/dma-iommu.c +@@ -25,6 +25,7 @@ + #include + #include + #include ++#include + + struct iommu_dma_msi_page { + struct list_head list; +@@ -817,6 +818,8 @@ static dma_addr_t iommu_dma_map_page(str + void *padding_start; + size_t padding_size, aligned_size; + ++ trace_swiotlb_bounced(dev, phys, size, swiotlb_force); ++ + aligned_size = iova_align(iovad, size); + phys = swiotlb_tbl_map_single(dev, phys, size, aligned_size, + iova_mask(iovad), dir, attrs); diff --git a/queue-5.15/series b/queue-5.15/series index b78e212053b..757a642398f 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -287,3 +287,4 @@ iio-adc-ad7091r-pass-iio_dev-to-event-handler.patch hid-wacom-correct-behavior-when-processing-some-confidence-false-touches.patch serial-sc16is7xx-add-check-for-unsupported-spi-modes-during-probe.patch serial-sc16is7xx-set-safe-default-spi-clock-frequency.patch +iommu-dma-trace-bounce-buffer-usage-when-mapping-buffers.patch