From f4a952f180d2a028d500ff7f61b6d96fe972e5d0 Mon Sep 17 00:00:00 2001 From: Depeng Shao Date: Sat, 22 May 2021 15:01:58 +0800 Subject: [PATCH 1/2] msm: camera: reqmgr: Reset the slot if it is applied This change reset the slot when the next req is applied, it should be caused by some exception before, we need to reset this slot in case we applied wrong req to sub devices. CRs-Fixed: 2949657 Change-Id: I0b5f7b1d8450ed355701090b185812fb7a6b6e06 Signed-off-by: Depeng Shao --- drivers/cam_req_mgr/cam_req_mgr_core.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/cam_req_mgr/cam_req_mgr_core.c b/drivers/cam_req_mgr/cam_req_mgr_core.c index 9881516daf3d..5f6f3ae3e8b0 100644 --- a/drivers/cam_req_mgr/cam_req_mgr_core.c +++ b/drivers/cam_req_mgr/cam_req_mgr_core.c @@ -759,6 +759,24 @@ static int __cam_req_mgr_check_next_req_slot( CAM_DBG(CAM_CRM, "idx: %d: slot->status %d", idx, slot->status); + /* + * Some slot can't be reset due to irq congestion and + * performance issue, we need to reset it when we + * want to move to this slot. + */ + if (slot->status == CRM_SLOT_STATUS_REQ_APPLIED) { + CAM_WARN(CAM_CRM, + "slot[%d] wasn't reset, reset it now", + idx); + if (in_q->last_applied_idx == idx) { + CAM_WARN(CAM_CRM, + "last_applied_idx: %d", + in_q->last_applied_idx); + in_q->last_applied_idx = -1; + } + __cam_req_mgr_reset_req_slot(link, idx); + } + /* Check if there is new req from CSL, if not complete req */ if (slot->status == CRM_SLOT_STATUS_NO_REQ) { rc = __cam_req_mgr_check_for_lower_pd_devices(link); From 028478e7dff4fb6f1c73b3511a2594a24e63deec Mon Sep 17 00:00:00 2001 From: Kai Xing Date: Sat, 7 May 2022 15:48:00 +0530 Subject: [PATCH 2/2] msm: camera: fd: fix compile error for kernel 5.4 Function definition error: delete static keyword. CRs-Fixed: 3191744 Change-Id: Ifea089f47de02233b31695146b1ddacfbaec35a8 Signed-off-by: Kai Xing --- drivers/cam_fd/cam_fd_dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cam_fd/cam_fd_dev.c b/drivers/cam_fd/cam_fd_dev.c index e34c9bcc1e0b..3797a1145846 100644 --- a/drivers/cam_fd/cam_fd_dev.c +++ b/drivers/cam_fd/cam_fd_dev.c @@ -62,7 +62,7 @@ static int cam_fd_dev_open(struct v4l2_subdev *sd, return 0; } -static int cam_fd_dev_close_internal(struct v4l2_subdev *sd, +int cam_fd_dev_close_internal(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) { struct cam_fd_dev *fd_dev = &g_fd_dev;