swiotlb: save io_tlb_used to local variable before leaving critical section
authorDongli Zhang <dongli.zhang@oracle.com>
Fri, 12 Apr 2019 11:38:26 +0000 (19:38 +0800)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Fri, 12 Apr 2019 23:44:46 +0000 (19:44 -0400)
commit53b29c336830db48ad3dc737f88b8c065b1f0851
tree005f8ea4c317a99f2b583c2fa3b9db21f4eeb0b2
parent83ca259489409a1fe8a83dad83a82f32174d4f31
swiotlb: save io_tlb_used to local variable before leaving critical section

When swiotlb is full, the kernel would print io_tlb_used. However, the
result might be inaccurate at that time because we have left the critical
section protected by spinlock.

Therefore, we backup the io_tlb_used into local variable before leaving
critical section.

Fixes: 83ca25948940 ("swiotlb: dump used and total slots when swiotlb buffer is full")
Suggested-by: HÃ¥kon Bugge <haakon.bugge@oracle.com>
Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
kernel/dma/swiotlb.c