Merge branch 'perf/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/acme...
[firefly-linux-kernel-4.4.55.git] / drivers / xen / swiotlb-xen.c
index 8e964b91c447b117b7d4d17731201254a79365d5..19e6a2041371c0fe9a908c71ac5c83cdbad3c015 100644 (file)
@@ -153,7 +153,7 @@ void __init xen_swiotlb_init(int verbose)
        char *m = NULL;
        unsigned int repeat = 3;
 
-       nr_tbl = swioltb_nr_tbl();
+       nr_tbl = swiotlb_nr_tbl();
        if (nr_tbl)
                xen_io_tlb_nslabs = nr_tbl;
        else {
@@ -166,7 +166,7 @@ retry:
        /*
         * Get IO TLB memory from any location.
         */
-       xen_io_tlb_start = alloc_bootmem(bytes);
+       xen_io_tlb_start = alloc_bootmem_pages(PAGE_ALIGN(bytes));
        if (!xen_io_tlb_start) {
                m = "Cannot allocate Xen-SWIOTLB buffer!\n";
                goto error;
@@ -179,7 +179,7 @@ retry:
                               bytes,
                               xen_io_tlb_nslabs);
        if (rc) {
-               free_bootmem(__pa(xen_io_tlb_start), bytes);
+               free_bootmem(__pa(xen_io_tlb_start), PAGE_ALIGN(bytes));
                m = "Failed to get contiguous memory for DMA from Xen!\n"\
                    "You either: don't have the permissions, do not have"\
                    " enough free memory under 4GB, or the hypervisor memory"\