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

Commit d46e67d3 authored by Sagar Gore's avatar Sagar Gore Committed by Gerrit - the friendly Code Review server
Browse files

msm: cam: reqmgr: Allocate input queue table per link



Moving input queue from session to per link. Usecases invovling
multiple pipelines or links can not share same input queue and
thus need separate input queue per link.

Change-Id: Ie314b5a026cb69700c624d40d9569a47ed59d151
Signed-off-by: default avatarSagar Gore <sgore@codeaurora.org>
parent 8a58c68a
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
@@ -902,7 +902,13 @@ static struct cam_req_mgr_core_link *__cam_req_mgr_reserve_link(
		CAM_ERR(CAM_CRM, "failed to create link, no mem");
		return NULL;
	}
	in_q = &session->in_q;
	in_q = (struct cam_req_mgr_req_queue *)
		kzalloc(sizeof(struct cam_req_mgr_req_queue), GFP_KERNEL);
	if (!in_q) {
		CAM_ERR(CAM_CRM, "failed to create input queue, no mem");
		kfree(link);
		return NULL;
	}
	mutex_init(&link->lock);

	mutex_lock(&link->lock);
@@ -928,7 +934,7 @@ static struct cam_req_mgr_core_link *__cam_req_mgr_reserve_link(
}

/**
 * __cam_req_mgr_reserve_link()
 * __cam_req_mgr_unreserve_link()
 *
 * @brief  : Reserves one link data struct within session
 * @session: session identifier
@@ -960,6 +966,8 @@ static void __cam_req_mgr_unreserve_link(
		CAM_DBG(CAM_CRM, "Active session links (%d)",
			session->num_links);
	}
	kfree((*link)->req.in_q);
	(*link)->req.in_q = NULL;
	kfree(*link);
	*link = NULL;
	mutex_unlock(&session->lock);
@@ -1902,10 +1910,7 @@ int cam_req_mgr_link(struct cam_req_mgr_link_info *link_info)
	cam_destroy_device_hdl(link->link_hdl);
	link_info->link_hdl = 0;
link_hdl_fail:
	mutex_lock(&link->lock);
	link->state = CAM_CRM_LINK_STATE_AVAILABLE;
	mutex_unlock(&link->lock);

	__cam_req_mgr_unreserve_link(cam_session, &link);
	mutex_unlock(&g_crm_core_dev->crm_lock);
	return rc;
}
+0 −1
Original line number Diff line number Diff line
@@ -315,7 +315,6 @@ 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_req_queue  in_q;
	struct list_head              entry;
	struct mutex                  lock;
	int32_t                       force_err_recovery;