From d4050f9cb7a228cfd103a60e01adde63343b5f02 Mon Sep 17 00:00:00 2001 From: Hareesh Gundu Date: Tue, 4 May 2021 15:20:11 +0530 Subject: [PATCH] msm: kgsl: Print the process id for the context on a pagefault When a pagefault occurs we already print the task ID of the faulting group but also print the pid of the faulting context so that a multi thread context can get a better idea of which of its children was at fault. Change-Id: Ic0dedbad425d972fa43e845db8a8d3387ec00c12 Signed-off-by: Hareesh Gundu --- drivers/gpu/msm/kgsl_iommu.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/msm/kgsl_iommu.c b/drivers/gpu/msm/kgsl_iommu.c index c572a3b7ffc6..38f8100e5fc2 100644 --- a/drivers/gpu/msm/kgsl_iommu.c +++ b/drivers/gpu/msm/kgsl_iommu.c @@ -680,13 +680,17 @@ static int kgsl_iommu_fault_handler(struct iommu_domain *domain, no_page_fault_log = kgsl_mmu_log_fault_addr(mmu, ptbase, addr); if (!no_page_fault_log && __ratelimit(&_rs)) { + struct kgsl_context *context = kgsl_context_get(device, + contextidr); + dev_crit(ctx->kgsldev->dev, - "GPU PAGE FAULT: addr = %lX pid= %d name=%s\n", addr, - ptname, comm); + "GPU PAGE FAULT: addr = %lX pid= %d name=%s drawctxt=%d context pid = %d\n", + addr, ptname, comm, contextidr, context ? context->tid : 0); dev_crit(ctx->kgsldev->dev, - "context=%s TTBR0=0x%llx CIDR=0x%x (%s %s fault)\n", - ctx->name, ptbase, contextidr, - write ? "write" : "read", fault_type); + "context=%s TTBR0=0x%llx (%s %s fault)\n", + ctx->name, ptbase, write ? "write" : "read", fault_type); + + kgsl_context_put(context); if (gpudev->iommu_fault_block) { unsigned int fsynr1;