From: Dongli Zhang Date: Mon, 29 Oct 2018 23:17:15 +0000 (+0800) Subject: Revert "Revert "xen-swiotlb: fix the check condition for xen_swiotlb_free_coherent"" X-Git-Tag: v4.1.12-124.31.3~445 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=ed5239f82056b896d51a5431d61b441b669ef1fb;p=users%2Fjedix%2Flinux-maple.git Revert "Revert "xen-swiotlb: fix the check condition for xen_swiotlb_free_coherent"" 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 Reviewed-by: Boris Ostrovsky Signed-off-by: Brian Maly --- diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c index 63ddeb6a9c9d..49ec555df382 100644 --- a/drivers/xen/swiotlb-xen.c +++ b/drivers/xen/swiotlb-xen.c @@ -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);