From ed5239f82056b896d51a5431d61b441b669ef1fb Mon Sep 17 00:00:00 2001 From: Dongli Zhang Date: Tue, 30 Oct 2018 07:17:15 +0800 Subject: [PATCH] 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 --- drivers/xen/swiotlb-xen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.50.1