msm: camera: common: Change shutdown sequence for subdevices

In subdev close call if CRM is still active wait for shutdown
from CRM [media device]. Remove subdevice check for active
handles, shutdown to happen irrespective of any active context.

If CRM is not active, subdevice shutdown should ensure there is
no access to kernel allocated buffers since at this point
memmgr is de-initialized.

As part of ICP close, remove usage of HFI queues, trigger PIL
to transfer FW memory ownership back to HLOS and power off ICP.

CRs-Fixed: 2976107
Change-Id: Ib05b3fbdcc33f4072da7ef77cf0118a807860e8c
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
Этот коммит содержится в:
Karthik Anantha Ram
2021-06-24 15:09:00 -07:00
родитель 1c49642a1f
Коммит d785949196
40 изменённых файлов: 85 добавлений и 397 удалений

Просмотреть файл

@@ -195,12 +195,6 @@ static int __cam_ope_handle_buf_done_in_ready(void *ctx,
return cam_context_buf_done_from_hw(ctx, done, evt_id);
}
static int __cam_ope_shutdown_dev(
struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
{
return cam_ope_subdev_close_internal(sd, fh);
}
static struct cam_ctx_ops
cam_ope_ctx_state_machine[CAM_CTX_STATE_MAX] = {
/* Uninit */
@@ -213,7 +207,6 @@ static struct cam_ctx_ops
{
.ioctl_ops = {
.acquire_dev = __cam_ope_acquire_dev_in_available,
.shutdown_dev = __cam_ope_shutdown_dev,
},
.crm_ops = {},
.irq_ops = NULL,
@@ -226,7 +219,6 @@ static struct cam_ctx_ops
.config_dev = __cam_ope_config_dev_in_ready,
.flush_dev = __cam_ope_flush_dev_in_ready,
.dump_dev = __cam_ope_dump_dev_in_ready,
.shutdown_dev = __cam_ope_shutdown_dev,
},
.crm_ops = {},
.irq_ops = __cam_ope_handle_buf_done_in_ready,
@@ -240,7 +232,6 @@ static struct cam_ctx_ops
.config_dev = __cam_ope_config_dev_in_ready,
.flush_dev = __cam_ope_flush_dev_in_ready,
.dump_dev = __cam_ope_dump_dev_in_ready,
.shutdown_dev = __cam_ope_shutdown_dev,
},
.crm_ops = {},
.irq_ops = __cam_ope_handle_buf_done_in_ready,
@@ -248,15 +239,11 @@ static struct cam_ctx_ops
},
/* Flushed */
{
.ioctl_ops = {
.shutdown_dev = __cam_ope_shutdown_dev,
},
.ioctl_ops = {},
},
/* Activated */
{
.ioctl_ops = {
.shutdown_dev = __cam_ope_shutdown_dev,
},
.ioctl_ops = {},
.crm_ops = {},
.irq_ops = NULL,
.pagefault_ops = cam_ope_context_dump_active_request,

Просмотреть файл

@@ -41,12 +41,4 @@ int cam_ope_context_init(struct cam_ope_context *ctx,
*/
int cam_ope_context_deinit(struct cam_ope_context *ctx);
/**
* cam_ope_subdev_close_internal() - Close function for the icp dev
* @sd: Pointer to struct v4l2_subdev
* @fh: Pointer to struct v4l2_subdev_fh
*/
int cam_ope_subdev_close_internal(struct v4l2_subdev *sd,
struct v4l2_subdev_fh *fh);
#endif /* _CAM_OPE_CONTEXT_H_ */

Просмотреть файл

@@ -95,7 +95,7 @@ end:
return rc;
}
int cam_ope_subdev_close_internal(struct v4l2_subdev *sd,
static int cam_ope_subdev_close_internal(struct v4l2_subdev *sd,
struct v4l2_subdev_fh *fh)
{
int rc = 0;
@@ -137,7 +137,7 @@ end:
static int cam_ope_subdev_close(struct v4l2_subdev *sd,
struct v4l2_subdev_fh *fh)
{
bool crm_active = cam_req_mgr_is_open(CAM_OPE);
bool crm_active = cam_req_mgr_is_open();
if (crm_active) {
CAM_DBG(CAM_OPE, "CRM is ACTIVE, close should be from CRM");
@@ -215,6 +215,7 @@ static int cam_ope_subdev_component_bind(struct device *dev,
g_ope_dev.open_cnt = 0;
mutex_init(&g_ope_dev.ope_lock);
node->sd_handler = cam_ope_subdev_close_internal;
CAM_DBG(CAM_OPE, "Subdev component bound successfully");
return rc;