Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7190233b authored by Wyes Karny's avatar Wyes Karny Committed by Gerrit - the friendly Code Review server
Browse files

msm: camera: reqmgr: reset slots after deactivating session



After Deactivate request comes in link control we are deactivating
the link and resetting every slots in the in_q.

CRs-Fixed: 2685198
Change-Id: I3f152d6486ccfe81ec44ea27ed992aacf18342bc
Signed-off-by: default avatarWyes Karny <wkarny@codeaurora.org>
parent af0ad3b9
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -3422,6 +3422,8 @@ int cam_req_mgr_link_control(struct cam_req_mgr_link_control *control)

	struct cam_req_mgr_connected_device *dev = NULL;
	struct cam_req_mgr_link_evt_data     evt_data;
	struct cam_req_mgr_req_queue        *in_q = NULL;
	struct cam_req_mgr_slot             *slot = NULL;

	if (!control) {
		CAM_ERR(CAM_CRM, "Control command is NULL");
@@ -3485,6 +3487,18 @@ int cam_req_mgr_link_control(struct cam_req_mgr_link_control *control)
				if (dev->ops && dev->ops->process_evt)
					dev->ops->process_evt(&evt_data);
			}
			in_q = link->req.in_q;
			/* reset all slots */
			for (j = 0; j < in_q->num_slots; j++) {
				slot = &in_q->slot[j];
				slot->req_id = -1;
				slot->sync_mode =
					CAM_REQ_MGR_SYNC_MODE_NO_SYNC;
				slot->skip_idx = 1;
				slot->status = CRM_SLOT_STATUS_NO_REQ;
			}
			in_q->wr_idx = 0;
			in_q->rd_idx = 0;
		} else {
			CAM_ERR(CAM_CRM, "Invalid link control command");
			rc = -EINVAL;