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

Commit 5629bf35 authored by Shubhraprakash Das's avatar Shubhraprakash Das Committed by Stephen Boyd
Browse files

msm: kgsl: Fix checking of remote iommu spin lock initialization



If remote spin lock is not configured to be used then the
initialization function will return a NULL value. Check this
value before using it.

Change-Id: Iacb4b7914a93e7aefcd20341ecedbaa466c98acb
Signed-off-by: default avatarShubhraprakash Das <sadas@codeaurora.org>
parent 87b1dc2a
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -920,15 +920,15 @@ static int kgsl_iommu_init_sync_lock(struct kgsl_mmu *mmu)

	iommu_access_ops = get_iommu_access_ops_v0();

	if (iommu_access_ops && iommu_access_ops->iommu_lock_initialize)
		lock_phy_addr = (iommu_access_ops->iommu_lock_initialize()
			- MSM_SHARED_RAM_BASE + msm_shared_ram_phys);

	if (iommu_access_ops && iommu_access_ops->iommu_lock_initialize) {
		lock_phy_addr = (uint32_t)
				iommu_access_ops->iommu_lock_initialize();
		if (!lock_phy_addr) {
			iommu_access_ops = NULL;
		KGSL_DRV_ERR(mmu->device,
				"GPU CPU sync lock is not supported by kernel\n");
		return -ENXIO;
			return status;
		}
		lock_phy_addr = lock_phy_addr - (uint32_t)MSM_SHARED_RAM_BASE +
				(uint32_t)msm_shared_ram_phys;
	}

	/* Align the physical address to PAGE boundary and store the offset */