msm: camera: common: Return appropriate error code for cancelled requests

If a request is submitted post flush and the request ID of that
request is <= last flush req ID return an appropriate error code
to indicate the same.

CRs-Fixed: 2720555
Change-Id: Ic26c4fc5f0ba490ed277b3bb301cc02d1fa027d6
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
Signed-off-by: Mukund Madhusudan Atre <matre@codeaurora.org>
This commit is contained in:
Karthik Anantha Ram
2020-07-01 12:38:18 -07:00
committed by Mukund Madhusudan Atre
parent cd3fb3812a
commit cb24ba9b79
2 changed files with 12 additions and 3 deletions

View File

@@ -2829,8 +2829,17 @@ static int cam_req_mgr_cb_add_req(struct cam_req_mgr_add_request *add_req)
/* Validate if req id is present in input queue */
idx = __cam_req_mgr_find_slot_for_req(link->req.in_q, add_req->req_id);
if (idx < 0) {
CAM_ERR(CAM_CRM, "req %lld not found in in_q", add_req->req_id);
rc = -ENOENT;
if (((uint32_t)add_req->req_id) <= (link->last_flush_id)) {
CAM_ERR(CAM_CRM,
"req %lld not found in in_q; it has been flushed [last_flush_req %u]",
add_req->req_id, link->last_flush_id);
rc = -EBADR;
} else {
CAM_ERR(CAM_CRM,
"req %lld not found in in_q",
add_req->req_id);
rc = -ENOENT;
}
goto end;
}