diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index 5e7fe519430af43207eee4d97c742be65ce99f7f..9ca6e6b8084dcf58b5e7d5b8b754b1a7fc4a2f0e 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -547,7 +547,7 @@ static inline void iommu_iotlb_gather_add_page(struct iommu_domain *domain,
 	 * structure can be rewritten.
 	 */
 	if (gather->pgsize != size ||
-	    end < gather->start || start > gather->end) {
+	    end + 1 < gather->start || start > gather->end + 1) {
 		if (gather->pgsize)
 			iommu_iotlb_sync(domain, gather);
 		gather->pgsize = size;