diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index f11f5072af5dc88d9eac4bdcfde0bcc7452355d8..e90c267e7f3e100ec207b6c8889e1d7effd348a7 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -544,7 +544,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;