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

Commit ded39f35 authored by Harshitha Sai Neelati's avatar Harshitha Sai Neelati
Browse files

msm: kgsl: Initialize cb_num for secure context



Currently we are not initializing cb_num for secure context.
This is causing problems in the kgsl fault handler path when
there is a pagefault for secure context. Hence initialize cb_num
for secure context.

Change-Id: I35a37193f512f315f443e9f0d92fdae11411bbd2
Signed-off-by: default avatarHarshitha Sai Neelati <hsaineel@codeaurora.org>
parent d915a465
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -1230,6 +1230,7 @@ static int _init_secure_pt(struct kgsl_mmu *mmu, struct kgsl_pagetable *pt)
	struct kgsl_iommu_context *ctx = &iommu->secure_context;
	int secure_vmid = VMID_CP_PIXEL;
	struct kgsl_global_memdesc *md;
	int cb_num;

	if (!mmu->secured)
		return -EPERM;
@@ -1259,6 +1260,17 @@ static int _init_secure_pt(struct kgsl_mmu *mmu, struct kgsl_pagetable *pt)
	iommu_set_fault_handler(iommu_pt->domain,
				kgsl_iommu_fault_handler, pt);

	ret = iommu_domain_get_attr(iommu_pt->domain,
				DOMAIN_ATTR_CONTEXT_BANK, &cb_num);
	if (ret) {
		dev_err(device->dev, "get DOMAIN_ATTR_CONTEXT_BANK failed: %d\n",
			ret);
		_free_pt(ctx, pt);
		return ret;
	}

	ctx->cb_num = cb_num;

	/* Map any pending secure global buffers */
	list_for_each_entry(md, &device->globals, node) {
		if (md->memdesc.flags & KGSL_MEMFLAGS_SECURE)