From 259e6f55d0fb0de8bf6d426d228ef48dd12b6ab6 Mon Sep 17 00:00:00 2001 From: Mangalaram ARCHANA Date: Thu, 3 Oct 2019 10:49:52 +0530 Subject: [PATCH] msm: camera: req_mgr: Increase device handles in hdl_tbl Increasing device handles to 128 in handle table. CRs-Fixed: 2532741 Change-Id: I58278026d08865cd7935bf4f0dd04f6a594c6dbc Signed-off-by: Mangalaram ARCHANA --- drivers/cam_req_mgr/cam_req_mgr_util.c | 14 +++++++------- drivers/cam_req_mgr/cam_req_mgr_util.h | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/cam_req_mgr/cam_req_mgr_util.c b/drivers/cam_req_mgr/cam_req_mgr_util.c index ce83e64363f5..88b6bf079e9c 100644 --- a/drivers/cam_req_mgr/cam_req_mgr_util.c +++ b/drivers/cam_req_mgr/cam_req_mgr_util.c @@ -45,7 +45,7 @@ int cam_req_mgr_util_init(void) hdl_tbl = hdl_tbl_local; spin_unlock_bh(&hdl_tbl_lock); - bitmap_size = BITS_TO_LONGS(CAM_REQ_MGR_MAX_HANDLES) * sizeof(long); + bitmap_size = BITS_TO_LONGS(CAM_REQ_MGR_MAX_HANDLES_V2) * sizeof(long); hdl_tbl->bitmap = kzalloc(bitmap_size, GFP_KERNEL); if (!hdl_tbl->bitmap) { rc = -ENOMEM; @@ -92,7 +92,7 @@ int cam_req_mgr_util_free_hdls(void) return -EINVAL; } - for (i = 0; i < CAM_REQ_MGR_MAX_HANDLES; i++) { + for (i = 0; i < CAM_REQ_MGR_MAX_HANDLES_V2; i++) { if (hdl_tbl->hdl[i].state == HDL_ACTIVE) { CAM_WARN(CAM_CRM, "Dev handle = %x session_handle = %x", hdl_tbl->hdl[i].hdl_value, @@ -101,7 +101,7 @@ int cam_req_mgr_util_free_hdls(void) clear_bit(i, hdl_tbl->bitmap); } } - bitmap_zero(hdl_tbl->bitmap, CAM_REQ_MGR_MAX_HANDLES); + bitmap_zero(hdl_tbl->bitmap, CAM_REQ_MGR_MAX_HANDLES_V2); spin_unlock_bh(&hdl_tbl_lock); return 0; @@ -113,7 +113,7 @@ static int32_t cam_get_free_handle_index(void) idx = find_first_zero_bit(hdl_tbl->bitmap, hdl_tbl->bits); - if (idx >= CAM_REQ_MGR_MAX_HANDLES || idx < 0) + if (idx >= CAM_REQ_MGR_MAX_HANDLES_V2 || idx < 0) return -ENOSR; set_bit(idx, hdl_tbl->bitmap); @@ -201,7 +201,7 @@ void *cam_get_device_priv(int32_t dev_hdl) } idx = CAM_REQ_MGR_GET_HDL_IDX(dev_hdl); - if (idx >= CAM_REQ_MGR_MAX_HANDLES) { + if (idx >= CAM_REQ_MGR_MAX_HANDLES_V2) { CAM_ERR_RATE_LIMIT(CAM_CRM, "Invalid idx"); goto device_priv_fail; } @@ -245,7 +245,7 @@ void *cam_get_device_ops(int32_t dev_hdl) } idx = CAM_REQ_MGR_GET_HDL_IDX(dev_hdl); - if (idx >= CAM_REQ_MGR_MAX_HANDLES) { + if (idx >= CAM_REQ_MGR_MAX_HANDLES_V2) { CAM_ERR(CAM_CRM, "Invalid idx"); goto device_ops_fail; } @@ -288,7 +288,7 @@ static int cam_destroy_hdl(int32_t dev_hdl, int dev_hdl_type) } idx = CAM_REQ_MGR_GET_HDL_IDX(dev_hdl); - if (idx >= CAM_REQ_MGR_MAX_HANDLES) { + if (idx >= CAM_REQ_MGR_MAX_HANDLES_V2) { CAM_ERR(CAM_CRM, "Invalid idx %d", idx); goto destroy_hdl_fail; } diff --git a/drivers/cam_req_mgr/cam_req_mgr_util.h b/drivers/cam_req_mgr/cam_req_mgr_util.h index f22c6cbae8ef..c0e339eedd9b 100644 --- a/drivers/cam_req_mgr/cam_req_mgr_util.h +++ b/drivers/cam_req_mgr/cam_req_mgr_util.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-only */ /* - * Copyright (c) 2016-2018, The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2019, The Linux Foundation. All rights reserved. */ #ifndef _CAM_REQ_MGR_UTIL_API_H_ @@ -54,7 +54,7 @@ struct handle { * @bits: size of bit map in bits */ struct cam_req_mgr_util_hdl_tbl { - struct handle hdl[CAM_REQ_MGR_MAX_HANDLES]; + struct handle hdl[CAM_REQ_MGR_MAX_HANDLES_V2]; void *bitmap; size_t bits; };