]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
Revert "Revert "xen-swiotlb: fix the check condition for xen_swiotlb_free_coherent""
authorDongli Zhang <dongli.zhang@oracle.com>
Mon, 29 Oct 2018 23:17:15 +0000 (07:17 +0800)
committerBrian Maly <brian.maly@oracle.com>
Tue, 30 Oct 2018 18:15:10 +0000 (14:15 -0400)
This reverts commit 4dbc2ddc8d51dd616b95d868b0223d102428b995.

The root cause of panic in commit 7fc30809bfa8 ("xen-swiotlb: fix the check
condition for xen_swiotlb_free_coherent") is identified. Enable this patch
again as the fix is already available.

The Reviewed-by by for the revert is only to sync the uek4 code with upstream.
It is not clear at the moment whether upstream code is correct.

Orabug: 28258102

Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/xen/swiotlb-xen.c

index 63ddeb6a9c9db79f3672040d06f94d8a752ae507..49ec555df3822d132408f146e50daf42e3c40019 100644 (file)
@@ -365,7 +365,7 @@ xen_swiotlb_free_coherent(struct device *hwdev, size_t size, void *vaddr,
         * physical address */
        phys = xen_bus_to_phys(dev_addr);
 
-       if (((dev_addr + size - 1 > dma_mask)) ||
+       if (((dev_addr + size - 1 <= dma_mask)) ||
            range_straddles_page_boundary(phys, size))
                xen_destroy_contiguous_region(phys, order);