Skip to content

Commit 5499d01

Browse files
kelleymhChristoph Hellwig
authored andcommitted
swiotlb: fix debugfs reporting of reserved memory pools
For io_tlb_nslabs, the debugfs code reports the correct value for a specific reserved memory pool. But for io_tlb_used, the value reported is always for the default pool, not the specific reserved pool. Fix this. Fixes: 5c850d3 ("swiotlb: fix passing local variable to debugfs_create_ulong()") Signed-off-by: Michael Kelley <mikelley@microsoft.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
1 parent a90922f commit 5499d01

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

kernel/dma/swiotlb.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -930,7 +930,9 @@ EXPORT_SYMBOL_GPL(is_swiotlb_active);
930930

931931
static int io_tlb_used_get(void *data, u64 *val)
932932
{
933-
*val = mem_used(&io_tlb_default_mem);
933+
struct io_tlb_mem *mem = data;
934+
935+
*val = mem_used(mem);
934936
return 0;
935937
}
936938
DEFINE_DEBUGFS_ATTRIBUTE(fops_io_tlb_used, io_tlb_used_get, NULL, "%llu\n");
@@ -943,7 +945,7 @@ static void swiotlb_create_debugfs_files(struct io_tlb_mem *mem,
943945
return;
944946

945947
debugfs_create_ulong("io_tlb_nslabs", 0400, mem->debugfs, &mem->nslabs);
946-
debugfs_create_file("io_tlb_used", 0400, mem->debugfs, NULL,
948+
debugfs_create_file("io_tlb_used", 0400, mem->debugfs, mem,
947949
&fops_io_tlb_used);
948950
}
949951

0 commit comments

Comments
 (0)