powerpc/svm: stop using io_tlb_start
authorChristoph Hellwig <hch@lst.de>
Mon, 1 Mar 2021 07:44:23 +0000 (08:44 +0100)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Wed, 17 Mar 2021 00:13:52 +0000 (00:13 +0000)
Use the local variable that is passed to swiotlb_init_with_tbl for
freeing the memory in the failure case to isolate the code a little
better from swiotlb internals.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
arch/powerpc/platforms/pseries/svm.c

index 7b739cc7a8a93efb3774e1ccaee03827d86053de..1d829e257996fbb88f085428e0ba2e7f7b0a08e4 100644 (file)
@@ -55,9 +55,9 @@ void __init svm_swiotlb_init(void)
        if (vstart && !swiotlb_init_with_tbl(vstart, io_tlb_nslabs, false))
                return;
 
-       if (io_tlb_start)
-               memblock_free_early(io_tlb_start,
-                                   PAGE_ALIGN(io_tlb_nslabs << IO_TLB_SHIFT));
+
+       memblock_free_early(__pa(vstart),
+                           PAGE_ALIGN(io_tlb_nslabs << IO_TLB_SHIFT));
        panic("SVM: Cannot allocate SWIOTLB buffer");
 }