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>
Šī revīzija ir iekļauta:
@@ -1605,19 +1605,6 @@ static int __cam_custom_ctx_apply_default_req(
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int __cam_custom_ctx_shutdown_dev(
|
||||
struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
|
||||
{
|
||||
int rc = -EINVAL;
|
||||
|
||||
if (!sd || !fh) {
|
||||
CAM_ERR(CAM_CUSTOM, "Invalid input pointer");
|
||||
return rc;
|
||||
}
|
||||
|
||||
return cam_custom_subdev_close_internal(sd, fh);
|
||||
}
|
||||
|
||||
/* top state machine */
|
||||
static struct cam_ctx_ops
|
||||
cam_custom_dev_ctx_top_state_machine[CAM_CTX_STATE_MAX] = {
|
||||
@@ -1632,7 +1619,6 @@ static struct cam_ctx_ops
|
||||
.ioctl_ops = {
|
||||
.acquire_dev =
|
||||
__cam_custom_ctx_acquire_dev_in_available,
|
||||
.shutdown_dev = __cam_custom_ctx_shutdown_dev,
|
||||
},
|
||||
.crm_ops = {},
|
||||
.irq_ops = NULL,
|
||||
@@ -1644,7 +1630,6 @@ static struct cam_ctx_ops
|
||||
.release_dev = __cam_custom_release_dev_in_acquired,
|
||||
.config_dev = __cam_custom_ctx_config_dev_in_acquired,
|
||||
.release_hw = __cam_custom_ctx_release_hw_in_top_state,
|
||||
.shutdown_dev = __cam_custom_ctx_shutdown_dev,
|
||||
},
|
||||
.crm_ops = {
|
||||
.link = __cam_custom_ctx_link_in_acquired,
|
||||
@@ -1663,7 +1648,6 @@ static struct cam_ctx_ops
|
||||
.release_dev = __cam_custom_release_dev_in_acquired,
|
||||
.config_dev = __cam_custom_ctx_config_dev,
|
||||
.release_hw = __cam_custom_ctx_release_hw_in_top_state,
|
||||
.shutdown_dev = __cam_custom_ctx_shutdown_dev,
|
||||
},
|
||||
.crm_ops = {
|
||||
.unlink = __cam_custom_ctx_unlink_in_ready,
|
||||
@@ -1681,7 +1665,6 @@ static struct cam_ctx_ops
|
||||
.config_dev = __cam_custom_ctx_config_dev_in_flushed,
|
||||
.release_hw =
|
||||
__cam_custom_ctx_release_hw_in_activated_state,
|
||||
.shutdown_dev = __cam_custom_ctx_shutdown_dev,
|
||||
},
|
||||
.crm_ops = {
|
||||
.unlink = __cam_custom_ctx_unlink_in_ready,
|
||||
@@ -1698,7 +1681,6 @@ static struct cam_ctx_ops
|
||||
.config_dev = __cam_custom_ctx_config_dev,
|
||||
.release_hw =
|
||||
__cam_custom_ctx_release_hw_in_activated_state,
|
||||
.shutdown_dev = __cam_custom_ctx_shutdown_dev,
|
||||
},
|
||||
.crm_ops = {
|
||||
.unlink = __cam_custom_ctx_unlink_in_activated,
|
||||
|
@@ -150,16 +150,4 @@ int cam_custom_dev_context_init(struct cam_custom_context *ctx,
|
||||
*/
|
||||
int cam_custom_dev_context_deinit(struct cam_custom_context *ctx);
|
||||
|
||||
/**
|
||||
* cam_custom_subdev_close_internal()
|
||||
*
|
||||
* @brief: Close function for the Custom context
|
||||
*
|
||||
* @sd: Pointer to struct v4l2_subdev
|
||||
* @fh: Pointer to struct v4l2_subdev_fh
|
||||
*
|
||||
*/
|
||||
int cam_custom_subdev_close_internal(struct v4l2_subdev *sd,
|
||||
struct v4l2_subdev_fh *fh);
|
||||
|
||||
#endif /* _CAM_CUSTOM_CONTEXT_H_ */
|
||||
|
@@ -58,7 +58,7 @@ static int cam_custom_subdev_open(struct v4l2_subdev *sd,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int cam_custom_subdev_close_internal(struct v4l2_subdev *sd,
|
||||
static int cam_custom_subdev_close_internal(struct v4l2_subdev *sd,
|
||||
struct v4l2_subdev_fh *fh)
|
||||
{
|
||||
int rc = 0;
|
||||
@@ -89,7 +89,7 @@ end:
|
||||
static int cam_custom_subdev_close(struct v4l2_subdev *sd,
|
||||
struct v4l2_subdev_fh *fh)
|
||||
{
|
||||
bool crm_active = cam_req_mgr_is_open(CAM_CUSTOM);
|
||||
bool crm_active = cam_req_mgr_is_open();
|
||||
|
||||
if (crm_active) {
|
||||
CAM_DBG(CAM_CUSTOM, "CRM is ACTIVE, close should be from CRM");
|
||||
@@ -152,6 +152,7 @@ static int cam_custom_component_bind(struct device *dev,
|
||||
goto unregister;
|
||||
}
|
||||
|
||||
node->sd_handler = cam_custom_subdev_close_internal;
|
||||
cam_smmu_set_client_page_fault_handler(iommu_hdl,
|
||||
cam_custom_dev_iommu_fault_handler, node);
|
||||
|
||||
|
Atsaukties uz šo jaunā problēmā
Block a user