Jelajahi Sumber

msm: camera: reqmgr: Handle fatal error notification

Handle fatal error notification by any device on the link.
On receiving the error propagate it to all connected devices.

CRs-Fixed: 3045706
Change-Id: Ia36a3262a48ea35afc8b98df21056461c5c523ef
Signed-off-by: Karthik Anantha Ram <[email protected]>
Karthik Anantha Ram 3 tahun lalu
induk
melakukan
26f225b85b
1 mengubah file dengan 11 tambahan dan 5 penghapusan
  1. 11 5
      drivers/cam_req_mgr/cam_req_mgr_core.c

+ 11 - 5
drivers/cam_req_mgr/cam_req_mgr_core.c

@@ -2928,7 +2928,8 @@ int cam_req_mgr_process_error(void *priv, void *data)
 	in_q = link->req.in_q;
 
 	mutex_lock(&link->req.lock);
-	if (err_info->error == CRM_KMD_ERR_BUBBLE) {
+	switch (err_info->error) {
+	case CRM_KMD_ERR_BUBBLE:
 		idx = __cam_req_mgr_find_slot_for_req(in_q, err_info->req_id);
 		if (idx < 0) {
 			CAM_ERR_RATE_LIMIT(CAM_CRM,
@@ -2952,10 +2953,6 @@ int cam_req_mgr_process_error(void *priv, void *data)
 				mutex_unlock(&link->req.lock);
 				return -EINVAL;
 			}
-			/* Notify all devices in the link about error */
-			__cam_req_mgr_send_evt(err_info->req_id, CAM_REQ_MGR_LINK_EVT_ERR,
-				err_info->error, link);
-
 			/* Bring processing pointer to bubbled req id */
 			__cam_req_mgr_tbl_set_all_skip_cnt(&link->req.l_tbl);
 			in_q->rd_idx = idx;
@@ -2979,8 +2976,17 @@ int cam_req_mgr_process_error(void *priv, void *data)
 			link->state = CAM_CRM_LINK_STATE_ERR;
 			spin_unlock_bh(&link->link_state_spin_lock);
 			link->open_req_cnt++;
+
+			/* Apply immediately to highest pd device on same frame */
 			__cam_req_mgr_apply_on_bubble(link, err_info);
 		}
+		break;
+	case CRM_KMD_ERR_FATAL:
+		rc = __cam_req_mgr_send_evt(err_info->req_id,
+			CAM_REQ_MGR_LINK_EVT_ERR, err_info->error, link);
+		break;
+	default:
+		break;
 	}
 	mutex_unlock(&link->req.lock);