dwc3-msm: Use upstream IOMMU driver based dma_ops() with USB dev

MSM specific IOMMU driver has below limitations:
(a) dma_map_sg() API doesn't support unaligned buffer usage.
(b) It doesn't perform cache flush.
Some of USB usecase (e.g. host mode mass storage case) uses unaligned
buffer with dma_map_sg() API which fails due to above (a) limitation.
Upstream IOMMU driver doesn't have above limitation. Hence to allow
USB SMMU stage S1 functionality use UPSTREAM_IOVA_ALLOCATOR attribute
which sets upstream IOMMU driver's dma_ops() with dev.

Change-Id: I0fd8c1eb38d0db454009d44b86e6d68be9304058
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
diff --git a/drivers/usb/dwc3/dwc3-msm.c b/drivers/usb/dwc3/dwc3-msm.c
index 4e634e1..cae6c6e 100644
--- a/drivers/usb/dwc3/dwc3-msm.c
+++ b/drivers/usb/dwc3/dwc3-msm.c
@@ -3010,6 +3010,13 @@
 		return ret;
 	}
 	dev_dbg(mdwc->dev, "IOMMU mapping created: %pK\n", mdwc->iommu_map);
+	ret = iommu_domain_set_attr(mdwc->iommu_map->domain,
+			DOMAIN_ATTR_UPSTREAM_IOVA_ALLOCATOR, &atomic_ctx);
+	if (ret) {
+		dev_err(mdwc->dev, "set UPSTREAM_IOVA_ALLOCATOR failed(%d)\n",
+				ret);
+		goto release_mapping;
+	}
 
 	ret = iommu_domain_set_attr(mdwc->iommu_map->domain, DOMAIN_ATTR_ATOMIC,
 			&atomic_ctx);