From b2bd543adf23a2a9dbae9e0b91afb3209b527820 Mon Sep 17 00:00:00 2001 From: Vishalsingh Hajeri Date: Wed, 31 Jul 2019 15:29:13 -0700 Subject: [PATCH] msm: camera: isp: Dump page fault info for pending request If bubble report is set from usersapce we move the active request back to pending request list while handling error. We need to iterate through pending request list as well when dumping page fault info for erroneous request. Change-Id: I2458313affbae6cb161f077eef7bdd0263c43ae2 Signed-off-by: Vishalsingh Hajeri Signed-off-by: Mukund Madhusudan Atre --- drivers/cam_isp/cam_isp_context.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/drivers/cam_isp/cam_isp_context.c b/drivers/cam_isp/cam_isp_context.c index 9c0d4d6c2817..d88adebea4f7 100644 --- a/drivers/cam_isp/cam_isp_context.c +++ b/drivers/cam_isp/cam_isp_context.c @@ -3876,6 +3876,36 @@ static int cam_isp_context_dump_active_request(void *data, unsigned long iova, req->request_id, rc); } + /* + * In certain scenarios we observe both overflow and SMMU pagefault + * for a particular request. If overflow is handled before page fault + * we need to traverse through pending request list because if + * bubble recovery is enabled on any request we move that request + * and all the subsequent requests to the pending list while handling + * overflow error. + */ + + CAM_INFO(CAM_ISP, + "Iterating over pending req list of isp ctx %d state %d", + ctx->ctx_id, ctx->state); + + list_for_each_entry_safe(req, req_temp, + &ctx->pending_req_list, list) { + req_isp = (struct cam_isp_ctx_req *) req->req_priv; + hw_update_data = &req_isp->hw_update_data; + pf_dbg_entry = &(req->pf_data); + CAM_INFO(CAM_ISP, "req_id : %lld ", req->request_id); + + rc = cam_context_dump_pf_info_to_hw(ctx, pf_dbg_entry->packet, + iova, buf_info, &mem_found); + if (rc) + CAM_ERR(CAM_ISP, "Failed to dump pf info"); + + if (mem_found) + CAM_ERR(CAM_ISP, "Found page fault in req %lld %d", + req->request_id, rc); + } + return rc; }