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

Commit 1fcda3d1 authored by illa lakshmi soujanya's avatar illa lakshmi soujanya Committed by Gerrit - the friendly Code Review server
Browse files

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: default avatarilla lakshmi soujanya <quic_illa@quicinc.com>
parent 51108f0b
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
// 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>
@@ -563,6 +564,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) {
@@ -732,6 +734,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;
}

+4 −0
Original line number Diff line number Diff line
// 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>
@@ -294,7 +295,10 @@ int32_t cam_cmd_buf_parser(struct csiphy_device *csiphy_dev,
		csiphy_dev->csiphy_info.settle_time,
		csiphy_dev->csiphy_info.data_rate);

	cam_mem_put_cpu_buf(cmd_desc->mem_handle);
	cam_mem_put_cpu_buf(cfg_dev->packet_handle);
	return rc;

}

void cam_csiphy_cphy_irq_config(struct csiphy_device *csiphy_dev)
+9 −1
Original line number Diff line number Diff line
// 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>
@@ -892,9 +892,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;
}

@@ -1051,9 +1054,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;
}

@@ -1123,6 +1129,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;
@@ -1371,6 +1378,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);
+9 −0
Original line number Diff line number Diff line
// 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>
@@ -1187,6 +1188,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) {
@@ -1377,6 +1379,7 @@ int cam_flash_i2c_pkt_parser(struct cam_flash_ctrl *fctrl, void *arg)
			fctrl->bridge_intf.crm_cb->add_req(&add_req);
		CAM_DBG(CAM_FLASH, "add req to req_mgr= %lld", add_req.req_id);
	}
	cam_mem_put_cpu_buf(config.packet_handle);
	return rc;
}

@@ -1560,6 +1563,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: {
@@ -1654,6 +1659,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: {
@@ -1803,6 +1810,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: {
@@ -1851,6 +1859,7 @@ int cam_flash_pmic_pkt_parser(struct cam_flash_ctrl *fctrl, void *arg)
		CAM_DBG(CAM_FLASH, "add req to req_mgr= %lld", add_req.req_id);
	}

	cam_mem_put_cpu_buf(config.packet_handle);
	return rc;
}

+3 −0
Original line number Diff line number Diff line
// 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>
@@ -571,6 +572,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) {
@@ -729,6 +731,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;
Loading