Merge "msm: camera: reqmgr: Increasing number of links in a session" into dev/msm-4.9-camx

This commit is contained in:
Jeyaprakash Soundrapandian 2018-10-08 13:47:21 -07:00 • committed by Gerrit - the friendly Code Review server
commit f134320e72
2 changed files with 19 additions and 9 deletions

View file

@ -1325,9 +1325,9 @@ static struct cam_req_mgr_core_link *__cam_req_mgr_reserve_link(
return NULL;
}
if (session->num_links >= MAX_LINKS_PER_SESSION) {
if (session->num_links >= MAXIMUM_LINKS_PER_SESSION) {
CAM_ERR(CAM_CRM, "Reached max links %d per session limit %d",
session->num_links, MAX_LINKS_PER_SESSION);
session->num_links, MAXIMUM_LINKS_PER_SESSION);
return NULL;
}
@ -1362,7 +1362,7 @@ static struct cam_req_mgr_core_link *__cam_req_mgr_reserve_link(
mutex_lock(&session->lock);
/* Loop through and find a free index */
for (i = 0; i < MAX_LINKS_PER_SESSION; i++) {
for (i = 0; i < MAXIMUM_LINKS_PER_SESSION; i++) {
if (!session->links[i]) {
CAM_DBG(CAM_CRM,
"Free link index %d found, num_links=%d",
@ -1372,7 +1372,7 @@ static struct cam_req_mgr_core_link *__cam_req_mgr_reserve_link(
}
}
if (i == MAX_LINKS_PER_SESSION) {
if (i == MAXIMUM_LINKS_PER_SESSION) {
CAM_ERR(CAM_CRM, "Free link index not found");
goto error;
}
@ -1433,7 +1433,7 @@ static void __cam_req_mgr_unreserve_link(
return;
}
for (i = 0; i < MAX_LINKS_PER_SESSION; i++) {
for (i = 0; i < MAXIMUM_LINKS_PER_SESSION; i++) {
if (session->links[i] == link)
session->links[i] = NULL;
}
@ -1445,7 +1445,7 @@ static void __cam_req_mgr_unreserve_link(
* of only having 2 links in a given session
*/
session->sync_mode = CAM_REQ_MGR_SYNC_MODE_NO_SYNC;
for (i = 0; i < MAX_LINKS_PER_SESSION; i++) {
for (i = 0; i < MAXIMUM_LINKS_PER_SESSION; i++) {
if (session->links[i])
session->links[i]->sync_link = NULL;
}
@ -2387,7 +2387,7 @@ int cam_req_mgr_destroy_session(
ses_info->session_hdl,
cam_session->num_links);
for (i = 0; i < MAX_LINKS_PER_SESSION; i++) {
for (i = 0; i < MAXIMUM_LINKS_PER_SESSION; i++) {
link = cam_session->links[i];
if (!link)
@ -2628,7 +2628,8 @@ int cam_req_mgr_sync_config(
}
if ((sync_info->num_links < 0) ||
(sync_info->num_links > MAX_LINKS_PER_SESSION)) {
(sync_info->num_links >
MAX_LINKS_PER_SESSION)) {
CAM_ERR(CAM_CRM, "Invalid num links %d", sync_info->num_links);
return -EINVAL;
}
@ -2777,6 +2778,13 @@ int cam_req_mgr_link_control(struct cam_req_mgr_link_control *control)
goto end;
}
if (control->num_links > MAX_LINKS_PER_SESSION) {
CAM_ERR(CAM_CRM, "Invalid number of links %d",
control->num_links);
rc = -EINVAL;
goto end;
}
mutex_lock(&g_crm_core_dev->crm_lock);
for (i = 0; i < control->num_links; i++) {
link = (struct cam_req_mgr_core_link *)

View file

@ -34,6 +34,8 @@
#define SYNC_LINK_SOF_CNT_MAX_LMT 1
#define MAXIMUM_LINKS_PER_SESSION 4
/**
* enum crm_workq_task_type
* @codes: to identify which type of task is present
@ -353,7 +355,7 @@ struct cam_req_mgr_core_link {
struct cam_req_mgr_core_session {
int32_t session_hdl;
uint32_t num_links;
struct cam_req_mgr_core_link *links[MAX_LINKS_PER_SESSION];
struct cam_req_mgr_core_link *links[MAXIMUM_LINKS_PER_SESSION];
struct list_head entry;
struct mutex lock;
int32_t force_err_recovery;