msm: camera: reqmgr: Fix for apply stuck issue for pd 1 device

In a edge case if there are only pd 1 devices then avoid reset
slot if last buf done req if last applied req. If rd_idx is equal to
last bufdone index then reset previous slot. Based on max PD in the
link calculate max retry attempt before triggering recovery to UMD.
Also fill trigger information during notify error.

CRs-Fixed: 2776184
Change-Id: Ifabf660df7861b78e7801dc7eebe0c5e71908e74
Signed-off-by: Wyes Karny <wkarny@codeaurora.org>
This commit is contained in:
Wyes Karny 2020-10-01 16:27:51 +05:30
commit 49ea8fb393

View file

@ -1594,6 +1594,7 @@ static int __cam_req_mgr_process_req(struct cam_req_mgr_core_link *link,
struct cam_req_mgr_core_session *session;
struct cam_req_mgr_connected_device *dev;
struct cam_req_mgr_core_link *tmp_link = NULL;
uint32_t max_retry = 0;
in_q = link->req.in_q;
session = (struct cam_req_mgr_core_session *)link->parent;
@ -1700,6 +1701,9 @@ static int __cam_req_mgr_process_req(struct cam_req_mgr_core_link *link,
if (rc < 0) {
/* Apply req failed retry at next sof */
slot->status = CRM_SLOT_STATUS_REQ_PENDING;
max_retry = MAXIMUM_RETRY_ATTEMPTS;
if (link->max_delay == 1)
max_retry++;
if (jiffies_to_msecs(jiffies - link->last_applied_jiffies) >
MINIMUM_WORKQUEUE_SCHED_TIME_IN_MS)
@ -1707,10 +1711,10 @@ static int __cam_req_mgr_process_req(struct cam_req_mgr_core_link *link,
if ((in_q->last_applied_idx < in_q->rd_idx) && check_retry_cnt) {
link->retry_cnt++;
if (link->retry_cnt == MAXIMUM_RETRY_ATTEMPTS) {
if (link->retry_cnt == max_retry) {
CAM_DBG(CAM_CRM,
"Max retry attempts reached on link[0x%x] for req [%lld]",
link->link_hdl,
"Max retry attempts (count %d) reached on link[0x%x] for req [%lld]",
max_retry, link->link_hdl,
in_q->slot[in_q->rd_idx].req_id);
__cam_req_mgr_notify_error_on_link(link, dev);
link->retry_cnt = 0;
@ -2805,6 +2809,8 @@ static int cam_req_mgr_process_trigger(void *priv, void *data)
if (idx >= 0) {
if (idx == in_q->last_applied_idx)
in_q->last_applied_idx = -1;
if (idx == in_q->rd_idx)
__cam_req_mgr_dec_idx(&idx, 1, in_q->num_slots);
__cam_req_mgr_reset_req_slot(link, idx);
}
}
@ -3034,6 +3040,7 @@ static int cam_req_mgr_cb_notify_err(
notify_err->link_hdl = err_info->link_hdl;
notify_err->dev_hdl = err_info->dev_hdl;
notify_err->error = err_info->error;
notify_err->trigger = err_info->trigger;
task->process_cb = &cam_req_mgr_process_error;
rc = cam_req_mgr_workq_enqueue_task(task, link, CRM_TASK_PRIORITY_0);