mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
msm: camera: sensor: Add changes to prevent unmap buffers
The function cam_mem_mgr_release can unmap buffers when in use. This change with cam_mem_put_cpu_buf prevents unmaping the buffers in use. CRs-Fixed: 3489559 Change-Id: I9c4e284c5961a2eb4ff0df362c93d6cea7d77cab Signed-off-by: illa lakshmi soujanya <[email protected]>
This commit is contained in:
parent
575f20ea96
commit
0724e68848
7 changed files with 39 additions and 2 deletions
|
|
@ -1,6 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
|
|
@ -580,6 +581,7 @@ int32_t cam_actuator_i2c_pkt_parse(struct cam_actuator_ctrl_t *a_ctrl,
|
|||
}
|
||||
break;
|
||||
}
|
||||
cam_mem_put_cpu_buf(cmd_desc[i].mem_handle);
|
||||
}
|
||||
|
||||
if (a_ctrl->cam_act_state == CAM_ACTUATOR_ACQUIRE) {
|
||||
|
|
@ -764,6 +766,7 @@ int32_t cam_actuator_i2c_pkt_parse(struct cam_actuator_ctrl_t *a_ctrl,
|
|||
}
|
||||
|
||||
end:
|
||||
cam_mem_put_cpu_buf(config.packet_handle);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
|
|
@ -501,11 +502,14 @@ int32_t cam_cmd_buf_parser(struct csiphy_device *csiphy_dev,
|
|||
csiphy_dev->csiphy_info[index].settle_time,
|
||||
csiphy_dev->csiphy_info[index].data_rate);
|
||||
|
||||
cam_mem_put_cpu_buf(cmd_desc->mem_handle);
|
||||
cam_mem_put_cpu_buf(cfg_dev->packet_handle);
|
||||
return rc;
|
||||
|
||||
reset_settings:
|
||||
cam_csiphy_reset_phyconfig_param(csiphy_dev, index);
|
||||
|
||||
cam_mem_put_cpu_buf(cfg_dev->packet_handle);
|
||||
cam_mem_put_cpu_buf(cmd_desc->mem_handle);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
* Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
|
|
@ -897,9 +897,12 @@ static int32_t cam_eeprom_parse_write_memory_packet(
|
|||
break;
|
||||
}
|
||||
}
|
||||
cam_mem_put_cpu_buf(cmd_desc[i].mem_handle);
|
||||
}
|
||||
return rc;
|
||||
|
||||
end:
|
||||
cam_mem_put_cpu_buf(cmd_desc[i].mem_handle);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
@ -1055,9 +1058,12 @@ static int32_t cam_eeprom_init_pkt_parser(struct cam_eeprom_ctrl_t *e_ctrl,
|
|||
}
|
||||
}
|
||||
e_ctrl->cal_data.num_map = num_map + 1;
|
||||
cam_mem_put_cpu_buf(cmd_desc[i].mem_handle);
|
||||
}
|
||||
return rc;
|
||||
|
||||
end:
|
||||
cam_mem_put_cpu_buf(cmd_desc[i].mem_handle);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
@ -1127,6 +1133,7 @@ static int32_t cam_eeprom_get_cal_data(struct cam_eeprom_ctrl_t *e_ctrl,
|
|||
e_ctrl->cal_data.num_data);
|
||||
memcpy(read_buffer, e_ctrl->cal_data.mapdata,
|
||||
e_ctrl->cal_data.num_data);
|
||||
cam_mem_put_cpu_buf(io_cfg->mem_handle[0]);
|
||||
} else {
|
||||
CAM_ERR(CAM_EEPROM, "Invalid direction");
|
||||
rc = -EINVAL;
|
||||
|
|
@ -1375,6 +1382,7 @@ static int32_t cam_eeprom_pkt_parse(struct cam_eeprom_ctrl_t *e_ctrl, void *arg)
|
|||
break;
|
||||
}
|
||||
|
||||
cam_mem_put_cpu_buf(dev_config.packet_handle);
|
||||
return rc;
|
||||
power_down:
|
||||
cam_eeprom_power_down(e_ctrl);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
|
|
@ -1172,6 +1173,7 @@ int cam_flash_i2c_pkt_parser(struct cam_flash_ctrl *fctrl, void *arg)
|
|||
|
||||
break;
|
||||
}
|
||||
cam_mem_put_cpu_buf(cmd_desc[i].mem_handle);
|
||||
}
|
||||
power_info = &fctrl->power_info;
|
||||
if (!power_info) {
|
||||
|
|
@ -1369,6 +1371,7 @@ update_req_mgr:
|
|||
add_req.req_id, add_req.trigger_eof);
|
||||
}
|
||||
}
|
||||
cam_mem_put_cpu_buf(config.packet_handle);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
@ -1545,6 +1548,8 @@ int cam_flash_pmic_pkt_parser(struct cam_flash_ctrl *fctrl, void *arg)
|
|||
rc = -EINVAL;
|
||||
return rc;
|
||||
}
|
||||
|
||||
cam_mem_put_cpu_buf(cmd_desc->mem_handle);
|
||||
break;
|
||||
}
|
||||
case CAM_FLASH_PACKET_OPCODE_SET_OPS: {
|
||||
|
|
@ -1652,6 +1657,8 @@ int cam_flash_pmic_pkt_parser(struct cam_flash_ctrl *fctrl, void *arg)
|
|||
rc = -EINVAL;
|
||||
return rc;
|
||||
}
|
||||
|
||||
cam_mem_put_cpu_buf(cmd_desc->mem_handle);
|
||||
break;
|
||||
}
|
||||
case CAM_FLASH_PACKET_OPCODE_NON_REALTIME_SET_OPS: {
|
||||
|
|
@ -1794,6 +1801,7 @@ int cam_flash_pmic_pkt_parser(struct cam_flash_ctrl *fctrl, void *arg)
|
|||
return rc;
|
||||
}
|
||||
|
||||
cam_mem_put_cpu_buf(cmd_desc->mem_handle);
|
||||
break;
|
||||
}
|
||||
case CAM_PKT_NOP_OPCODE: {
|
||||
|
|
@ -1856,6 +1864,7 @@ int cam_flash_pmic_pkt_parser(struct cam_flash_ctrl *fctrl, void *arg)
|
|||
}
|
||||
}
|
||||
|
||||
cam_mem_put_cpu_buf(config.packet_handle);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
|
|
@ -629,6 +630,7 @@ static int cam_ois_pkt_parse(struct cam_ois_ctrl_t *o_ctrl, void *arg)
|
|||
}
|
||||
break;
|
||||
}
|
||||
cam_mem_put_cpu_buf(cmd_desc[i].mem_handle);
|
||||
}
|
||||
|
||||
if (o_ctrl->cam_ois_state != CAM_OIS_CONFIG) {
|
||||
|
|
@ -841,6 +843,7 @@ static int cam_ois_pkt_parse(struct cam_ois_ctrl_t *o_ctrl, void *arg)
|
|||
(csl_packet->header.op_code & 0xFFFFFF));
|
||||
return -EINVAL;
|
||||
}
|
||||
cam_mem_put_cpu_buf(dev_config.packet_handle);
|
||||
|
||||
if (!rc)
|
||||
return rc;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
|
|
@ -336,6 +337,7 @@ static int32_t cam_sensor_i2c_pkt_parse(struct cam_sensor_ctrl_t *s_ctrl,
|
|||
}
|
||||
|
||||
end:
|
||||
cam_mem_put_cpu_buf(config.packet_handle);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
@ -586,9 +588,11 @@ int32_t cam_handle_mem_ptr(uint64_t handle, struct cam_sensor_ctrl_t *s_ctrl)
|
|||
"Failed to parse the command Buffer Header");
|
||||
goto end;
|
||||
}
|
||||
cam_mem_put_cpu_buf(cmd_desc[i].mem_handle);
|
||||
}
|
||||
|
||||
end:
|
||||
cam_mem_put_cpu_buf(handle);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
|
|
@ -319,6 +320,7 @@ static int32_t cam_sensor_get_io_buffer(
|
|||
io_cfg->direction);
|
||||
rc = -EINVAL;
|
||||
}
|
||||
cam_mem_put_cpu_buf(io_cfg->mem_handle[0]);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
@ -377,6 +379,7 @@ int32_t cam_sensor_util_write_qtimer_to_io_buffer(
|
|||
io_cfg->direction);
|
||||
rc = -EINVAL;
|
||||
}
|
||||
cam_mem_put_cpu_buf(io_cfg->mem_handle[0]);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
@ -824,9 +827,12 @@ int cam_sensor_i2c_command_parser(
|
|||
}
|
||||
}
|
||||
i2c_reg_settings->is_settings_valid = 1;
|
||||
cam_mem_put_cpu_buf(cmd_desc[i].mem_handle);
|
||||
}
|
||||
return rc;
|
||||
|
||||
end:
|
||||
cam_mem_put_cpu_buf(cmd_desc[i].mem_handle);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue