Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
Merge commit 'eaaf04edecf315113d28e408f9521b6e0c16bf15'
Browse files Browse the repository at this point in the history
Change-Id: I2f505eb792e032cbb2f5655d1d22b4f5129c6942
Signed-off-by: Vaisakh Murali <[email protected]>
  • Loading branch information
mvaisakh committed Mar 20, 2023
2 parents 3640960 + eaaf04e commit edf4392
Showing 1 changed file with 34 additions and 15 deletions.
49 changes: 34 additions & 15 deletions techpack/camera/drivers/cam_lrme/lrme_hw_mgr/cam_lrme_hw_mgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,6 @@ static int cam_lrme_mgr_util_prepare_hw_update_entries(
CAM_ERR(CAM_LRME, "Exceed max num of entry");
return -EINVAL;
}

hw_entry[num_entry].handle = cmd_desc[i].mem_handle;
hw_entry[num_entry].len = cmd_desc[i].length;
hw_entry[num_entry].offset = cmd_desc[i].offset;
Expand Down Expand Up @@ -425,22 +424,27 @@ static int cam_lrme_mgr_util_submit_req(void *priv, void *data)
CAM_LRME_HW_CMD_SUBMIT,
&submit_args, sizeof(struct cam_lrme_hw_submit_args));

if (rc == -EBUSY)
CAM_DBG(CAM_LRME, "device busy");
else if (rc)
CAM_ERR(CAM_LRME, "submit request failed rc %d", rc);
if (rc) {
req_prio == 0 ? spin_lock(&hw_device->high_req_lock) :
spin_lock(&hw_device->normal_req_lock);
list_add(&frame_req->frame_list,
(req_prio == 0 ?
&hw_device->frame_pending_list_high :
&hw_device->frame_pending_list_normal));
req_prio == 0 ? spin_unlock(&hw_device->high_req_lock) :
spin_unlock(&hw_device->normal_req_lock);
if (rc == -EBUSY) {
CAM_DBG(CAM_LRME, "device busy");

req_prio == 0 ?
spin_lock(&hw_device->high_req_lock) :
spin_lock(&hw_device->normal_req_lock);
list_add(&frame_req->frame_list,
(req_prio == 0 ?
&hw_device->frame_pending_list_high :
&hw_device->frame_pending_list_normal));
req_prio == 0 ?
spin_unlock(&hw_device->high_req_lock) :
spin_unlock(
&hw_device->normal_req_lock);
rc = 0;
} else
CAM_ERR(CAM_LRME,
"submit request failed for frame req id: %llu rc %d",
frame_req->req_id, rc);
}
if (rc == -EBUSY)
rc = 0;
} else {
req_prio == 0 ? spin_lock(&hw_device->high_req_lock) :
spin_lock(&hw_device->normal_req_lock);
Expand Down Expand Up @@ -709,6 +713,7 @@ static int cam_lrme_mgr_hw_flush(void *hw_mgr_priv, void *hw_flush_args)
struct cam_hw_flush_args *args;
struct cam_lrme_device *hw_device;
struct cam_lrme_frame_request *frame_req = NULL, *req_to_flush = NULL;
struct cam_lrme_frame_request *frame_req_temp = NULL;
struct cam_lrme_frame_request **req_list = NULL;
uint32_t device_index;
struct cam_lrme_hw_flush_args lrme_flush_args;
Expand All @@ -733,6 +738,20 @@ static int cam_lrme_mgr_hw_flush(void *hw_mgr_priv, void *hw_flush_args)
goto end;
}

spin_lock(&hw_device->high_req_lock);
list_for_each_entry_safe(frame_req, frame_req_temp,
&hw_device->frame_pending_list_high, frame_list) {
list_del_init(&frame_req->frame_list);
}
spin_unlock(&hw_device->high_req_lock);

spin_lock(&hw_device->normal_req_lock);
list_for_each_entry_safe(frame_req, frame_req_temp,
&hw_device->frame_pending_list_normal, frame_list) {
list_del_init(&frame_req->frame_list);
}
spin_unlock(&hw_device->normal_req_lock);

req_list = (struct cam_lrme_frame_request **)args->flush_req_pending;
for (i = 0; i < args->num_req_pending; i++) {
frame_req = req_list[i];
Expand Down

0 comments on commit edf4392

Please sign in to comment.