Browse Source

Merge "msm: camera: reqmgr: Increase total link capacity" into camera-kernel.lnx.7.0

Camera Software Integration 1 year ago
parent
commit
ad71795ee2
2 changed files with 7 additions and 5 deletions
  1. 5 5
      drivers/cam_req_mgr/cam_req_mgr_core.c
  2. 2 0
      drivers/cam_req_mgr/cam_req_mgr_core.h

+ 5 - 5
drivers/cam_req_mgr/cam_req_mgr_core.c

@@ -22,7 +22,7 @@
 #include "cam_cpas_api.h"
 
 static struct cam_req_mgr_core_device *g_crm_core_dev;
-static struct cam_req_mgr_core_link g_links[MAXIMUM_LINKS_PER_SESSION];
+static struct cam_req_mgr_core_link g_links[MAXIMUM_LINKS_CAPACITY];
 
 static void __cam_req_mgr_reset_apply_data(struct cam_req_mgr_core_link *link)
 {
@@ -2865,7 +2865,7 @@ static struct cam_req_mgr_core_link *__cam_req_mgr_reserve_link(
 			session->num_links, MAXIMUM_LINKS_PER_SESSION);
 		return NULL;
 	}
-	for (i = 0; i < MAXIMUM_LINKS_PER_SESSION; i++) {
+	for (i = 0; i < MAXIMUM_LINKS_CAPACITY; i++) {
 		if (!atomic_cmpxchg(&g_links[i].is_used, 0, 1)) {
 			link = &g_links[i];
 			CAM_DBG(CAM_CRM, "alloc link index %d", i);
@@ -2873,7 +2873,7 @@ static struct cam_req_mgr_core_link *__cam_req_mgr_reserve_link(
 			break;
 		}
 	}
-	if (i == MAXIMUM_LINKS_PER_SESSION)
+	if (i == MAXIMUM_LINKS_CAPACITY)
 		return NULL;
 
 	in_q = kzalloc(sizeof(struct cam_req_mgr_req_queue),
@@ -5870,7 +5870,7 @@ static unsigned long cam_req_mgr_core_mini_dump_cb(void *dst, unsigned long len,
 	dumped_len += sizeof(*md);
 	remain_len -= dumped_len;
 
-	for (i = 0; i < MAXIMUM_LINKS_PER_SESSION; i++) {
+	for (i = 0; i < MAXIMUM_LINKS_CAPACITY; i++) {
 		if (remain_len < sizeof(*md_link)) {
 			CAM_ERR(CAM_CRM,
 			"Insufficent received length: %lu, dumped_len %lu",
@@ -5963,7 +5963,7 @@ int cam_req_mgr_core_device_init(void)
 	mutex_init(&g_crm_core_dev->crm_lock);
 	cam_req_mgr_debug_register(g_crm_core_dev);
 
-	for (i = 0; i < MAXIMUM_LINKS_PER_SESSION; i++) {
+	for (i = 0; i < MAXIMUM_LINKS_CAPACITY; i++) {
 		mutex_init(&g_links[i].lock);
 		spin_lock_init(&g_links[i].link_state_spin_lock);
 		spin_lock_init(&g_links[i].req.monitor_slock);

+ 2 - 0
drivers/cam_req_mgr/cam_req_mgr_core.h

@@ -41,6 +41,8 @@
 
 #define SYNC_LINK_SOF_CNT_MAX_LMT 1
 
+#define MAXIMUM_LINKS_CAPACITY     8
+
 #define MAXIMUM_LINKS_PER_SESSION  4
 
 #define MAXIMUM_RETRY_ATTEMPTS 3