Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f3c8445e authored by Prudhvi Yarlagadda's avatar Prudhvi Yarlagadda Committed by Gerrit - the friendly Code Review server
Browse files

qcom-geni-se: Add IOMMU check in geni common driver



Add IOMMU check to prevent using IOMMU functionality
if it is not enabled

Change-Id: Ib653779444be869a71886fdd438a20bbf6f6af20
Signed-off-by: default avatarPrudhvi Yarlagadda <pyarlaga@codeaurora.org>
parent 6d0b2be2
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1342,6 +1342,10 @@ static int geni_se_iommu_map_and_attach(struct geni_se_device *geni_se_dev)
	int bypass = 1;
	struct device *cb_dev = geni_se_dev->cb_dev;

	/*Don't proceed if IOMMU node is disabled*/
	if (!iommu_present(&platform_bus_type))
		return 0;

	mutex_lock(&geni_se_dev->iommu_lock);
	if (likely(geni_se_dev->iommu_map)) {
		mutex_unlock(&geni_se_dev->iommu_lock);