mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
swiotlb: fix debugfs reporting of reserved memory pools
[ Upstream commit5499d01c02] 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:5c850d3188("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
e6c69b06e7
commit
4aa9243ebe
@@ -919,7 +919,9 @@ EXPORT_SYMBOL_GPL(is_swiotlb_active);
|
|||||||
|
|
||||||
static int io_tlb_used_get(void *data, u64 *val)
|
static int io_tlb_used_get(void *data, u64 *val)
|
||||||
{
|
{
|
||||||
*val = mem_used(&io_tlb_default_mem);
|
struct io_tlb_mem *mem = data;
|
||||||
|
|
||||||
|
*val = mem_used(mem);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DEFINE_DEBUGFS_ATTRIBUTE(fops_io_tlb_used, io_tlb_used_get, NULL, "%llu\n");
|
DEFINE_DEBUGFS_ATTRIBUTE(fops_io_tlb_used, io_tlb_used_get, NULL, "%llu\n");
|
||||||
@@ -932,7 +934,7 @@ static void swiotlb_create_debugfs_files(struct io_tlb_mem *mem,
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
debugfs_create_ulong("io_tlb_nslabs", 0400, mem->debugfs, &mem->nslabs);
|
debugfs_create_ulong("io_tlb_nslabs", 0400, mem->debugfs, &mem->nslabs);
|
||||||
debugfs_create_file("io_tlb_used", 0400, mem->debugfs, NULL,
|
debugfs_create_file("io_tlb_used", 0400, mem->debugfs, mem,
|
||||||
&fops_io_tlb_used);
|
&fops_io_tlb_used);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user