mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-25 11:55:37 +00:00
iommu/dma: Trace bounce buffer usage when mapping buffers
commita63c357b9f
upstream. When commit82612d66d5
("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:82612d66d5
("iommu: Allow the dma-iommu api to use bounce buffers") Cc: stable@vger.kernel.org # v5.15+ Cc: Tom Murphy <murphyt7@tcd.ie> Cc: Lu Baolu <baolu.lu@linux.intel.com> Cc: Saravana Kannan <saravanak@google.com> Signed-off-by: Isaac J. Manjarres <isaacmanjarres@google.com> Link: https://lore.kernel.org/r/20231208234141.2356157-1-isaacmanjarres@google.com Signed-off-by: Joerg Roedel <jroedel@suse.de> Signed-off-by: Isaac J. Manjarres <isaacmanjarres@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
fc7c3be665
commit
77c20b4cbc
1 changed files with 3 additions and 0 deletions
|
@ -25,6 +25,7 @@
|
||||||
#include <linux/vmalloc.h>
|
#include <linux/vmalloc.h>
|
||||||
#include <linux/crash_dump.h>
|
#include <linux/crash_dump.h>
|
||||||
#include <linux/dma-direct.h>
|
#include <linux/dma-direct.h>
|
||||||
|
#include <trace/events/swiotlb.h>
|
||||||
|
|
||||||
struct iommu_dma_msi_page {
|
struct iommu_dma_msi_page {
|
||||||
struct list_head list;
|
struct list_head list;
|
||||||
|
@ -817,6 +818,8 @@ static dma_addr_t iommu_dma_map_page(struct device *dev, struct page *page,
|
||||||
void *padding_start;
|
void *padding_start;
|
||||||
size_t padding_size, aligned_size;
|
size_t padding_size, aligned_size;
|
||||||
|
|
||||||
|
trace_swiotlb_bounced(dev, phys, size, swiotlb_force);
|
||||||
|
|
||||||
aligned_size = iova_align(iovad, size);
|
aligned_size = iova_align(iovad, size);
|
||||||
phys = swiotlb_tbl_map_single(dev, phys, size, aligned_size,
|
phys = swiotlb_tbl_map_single(dev, phys, size, aligned_size,
|
||||||
iova_mask(iovad), dir, attrs);
|
iova_mask(iovad), dir, attrs);
|
||||||
|
|
Loading…
Reference in a new issue