Loading drivers/media/platform/msm/camera/cam_core/cam_context.c +1 −0 Original line number Diff line number Diff line Loading @@ -448,6 +448,7 @@ int cam_context_handle_start_dev(struct cam_context *ctx, } mutex_lock(&ctx->ctx_mutex); ctx->last_flush_req = 0; if (ctx->state_machine[ctx->state].ioctl_ops.start_dev) rc = ctx->state_machine[ctx->state].ioctl_ops.start_dev( ctx, cmd); Loading drivers/media/platform/msm/camera/cam_core/cam_context.h +2 −0 Original line number Diff line number Diff line Loading @@ -180,6 +180,7 @@ struct cam_ctx_ops { * @refcount: Context object refcount * @node: The main node to which this context belongs * @sync_mutex: mutex to sync with sync cb thread * @last_flush_req: Last request to flush * */ struct cam_context { Loading Loading @@ -215,6 +216,7 @@ struct cam_context { struct kref refcount; void *node; struct mutex sync_mutex; uint32_t last_flush_req; }; /** Loading drivers/media/platform/msm/camera/cam_core/cam_context_utils.c +14 −2 Original line number Diff line number Diff line Loading @@ -326,6 +326,17 @@ int32_t cam_context_prepare_dev_to_hw(struct cam_context *ctx, packet = (struct cam_packet *) (packet_addr + cmd->offset); if (packet->header.request_id <= ctx->last_flush_req) { CAM_DBG(CAM_CORE, "request %lld has been flushed, reject packet", packet->header.request_id); rc = -EINVAL; goto free_req; } if (packet->header.request_id > ctx->last_flush_req) ctx->last_flush_req = 0; /* preprocess the configuration */ memset(&cfg, 0, sizeof(cfg)); cfg.packet = packet; Loading Loading @@ -811,9 +822,10 @@ int32_t cam_context_flush_dev_to_hw(struct cam_context *ctx, goto end; } if (cmd->flush_type == CAM_FLUSH_TYPE_ALL) if (cmd->flush_type == CAM_FLUSH_TYPE_ALL) { ctx->last_flush_req = cmd->req_id; rc = cam_context_flush_ctx_to_hw(ctx); else if (cmd->flush_type == CAM_FLUSH_TYPE_REQ) } else if (cmd->flush_type == CAM_FLUSH_TYPE_REQ) rc = cam_context_flush_req_to_hw(ctx, cmd); else { rc = -EINVAL; Loading drivers/media/platform/msm/camera/cam_isp/cam_isp_context.c +17 −0 Original line number Diff line number Diff line Loading @@ -1493,6 +1493,12 @@ static int __cam_isp_ctx_flush_req_in_top_state( struct cam_isp_start_args start_isp; int rc = 0; if (flush_req->type == CAM_REQ_MGR_FLUSH_TYPE_ALL) { CAM_INFO(CAM_ISP, "Last request id to flush is %lld", flush_req->req_id); ctx->last_flush_req = flush_req->req_id; } CAM_DBG(CAM_ISP, "try to flush pending list"); spin_lock_bh(&ctx->lock); rc = __cam_isp_ctx_flush_req(ctx, &ctx->pending_req_list, flush_req); Loading Loading @@ -2232,6 +2238,17 @@ static int __cam_isp_ctx_config_dev_in_top_state( CAM_DBG(CAM_ISP, "Packet size 0x%x", packet->header.size); CAM_DBG(CAM_ISP, "packet op %d", packet->header.op_code); if (packet->header.request_id <= ctx->last_flush_req) { CAM_INFO(CAM_ISP, "request %lld has been flushed, reject packet", packet->header.request_id); rc = -EINVAL; goto free_req; } if (packet->header.request_id > ctx->last_flush_req) ctx->last_flush_req = 0; /* preprocess the configuration */ memset(&cfg, 0, sizeof(cfg)); cfg.packet = packet; Loading drivers/media/platform/msm/camera/cam_req_mgr/cam_req_mgr_core.c +15 −0 Original line number Diff line number Diff line Loading @@ -1494,6 +1494,9 @@ int cam_req_mgr_process_flush_req(void *priv, void *data) mutex_lock(&link->req.lock); if (flush_info->flush_type == CAM_REQ_MGR_FLUSH_TYPE_ALL) { link->last_flush_id = flush_info->req_id; CAM_INFO(CAM_CRM, "Last request id to flush is %lld", flush_info->req_id); for (i = 0; i < in_q->num_slots; i++) { slot = &in_q->slot[i]; slot->req_id = -1; Loading Loading @@ -2422,6 +2425,7 @@ int cam_req_mgr_link(struct cam_req_mgr_link_info *link_info) goto link_hdl_fail; } link_info->link_hdl = link->link_hdl; link->last_flush_id = 0; /* Allocate memory to hold data of all linked devs */ rc = __cam_req_mgr_create_subdevs(&link->l_dev, Loading Loading @@ -2547,6 +2551,17 @@ int cam_req_mgr_schedule_request( goto end; } if (sched_req->req_id <= link->last_flush_id) { CAM_INFO(CAM_CRM, "request %d is flushed, last_flush_id to flush %lld", sched_req->req_id, link->last_flush_id); rc = -EINVAL; goto end; } if (sched_req->req_id > link->last_flush_id) link->last_flush_id = 0; CAM_DBG(CAM_CRM, "link 0x%x req %lld, sync_mode %d", sched_req->link_hdl, sched_req->req_id, sched_req->sync_mode); Loading Loading
drivers/media/platform/msm/camera/cam_core/cam_context.c +1 −0 Original line number Diff line number Diff line Loading @@ -448,6 +448,7 @@ int cam_context_handle_start_dev(struct cam_context *ctx, } mutex_lock(&ctx->ctx_mutex); ctx->last_flush_req = 0; if (ctx->state_machine[ctx->state].ioctl_ops.start_dev) rc = ctx->state_machine[ctx->state].ioctl_ops.start_dev( ctx, cmd); Loading
drivers/media/platform/msm/camera/cam_core/cam_context.h +2 −0 Original line number Diff line number Diff line Loading @@ -180,6 +180,7 @@ struct cam_ctx_ops { * @refcount: Context object refcount * @node: The main node to which this context belongs * @sync_mutex: mutex to sync with sync cb thread * @last_flush_req: Last request to flush * */ struct cam_context { Loading Loading @@ -215,6 +216,7 @@ struct cam_context { struct kref refcount; void *node; struct mutex sync_mutex; uint32_t last_flush_req; }; /** Loading
drivers/media/platform/msm/camera/cam_core/cam_context_utils.c +14 −2 Original line number Diff line number Diff line Loading @@ -326,6 +326,17 @@ int32_t cam_context_prepare_dev_to_hw(struct cam_context *ctx, packet = (struct cam_packet *) (packet_addr + cmd->offset); if (packet->header.request_id <= ctx->last_flush_req) { CAM_DBG(CAM_CORE, "request %lld has been flushed, reject packet", packet->header.request_id); rc = -EINVAL; goto free_req; } if (packet->header.request_id > ctx->last_flush_req) ctx->last_flush_req = 0; /* preprocess the configuration */ memset(&cfg, 0, sizeof(cfg)); cfg.packet = packet; Loading Loading @@ -811,9 +822,10 @@ int32_t cam_context_flush_dev_to_hw(struct cam_context *ctx, goto end; } if (cmd->flush_type == CAM_FLUSH_TYPE_ALL) if (cmd->flush_type == CAM_FLUSH_TYPE_ALL) { ctx->last_flush_req = cmd->req_id; rc = cam_context_flush_ctx_to_hw(ctx); else if (cmd->flush_type == CAM_FLUSH_TYPE_REQ) } else if (cmd->flush_type == CAM_FLUSH_TYPE_REQ) rc = cam_context_flush_req_to_hw(ctx, cmd); else { rc = -EINVAL; Loading
drivers/media/platform/msm/camera/cam_isp/cam_isp_context.c +17 −0 Original line number Diff line number Diff line Loading @@ -1493,6 +1493,12 @@ static int __cam_isp_ctx_flush_req_in_top_state( struct cam_isp_start_args start_isp; int rc = 0; if (flush_req->type == CAM_REQ_MGR_FLUSH_TYPE_ALL) { CAM_INFO(CAM_ISP, "Last request id to flush is %lld", flush_req->req_id); ctx->last_flush_req = flush_req->req_id; } CAM_DBG(CAM_ISP, "try to flush pending list"); spin_lock_bh(&ctx->lock); rc = __cam_isp_ctx_flush_req(ctx, &ctx->pending_req_list, flush_req); Loading Loading @@ -2232,6 +2238,17 @@ static int __cam_isp_ctx_config_dev_in_top_state( CAM_DBG(CAM_ISP, "Packet size 0x%x", packet->header.size); CAM_DBG(CAM_ISP, "packet op %d", packet->header.op_code); if (packet->header.request_id <= ctx->last_flush_req) { CAM_INFO(CAM_ISP, "request %lld has been flushed, reject packet", packet->header.request_id); rc = -EINVAL; goto free_req; } if (packet->header.request_id > ctx->last_flush_req) ctx->last_flush_req = 0; /* preprocess the configuration */ memset(&cfg, 0, sizeof(cfg)); cfg.packet = packet; Loading
drivers/media/platform/msm/camera/cam_req_mgr/cam_req_mgr_core.c +15 −0 Original line number Diff line number Diff line Loading @@ -1494,6 +1494,9 @@ int cam_req_mgr_process_flush_req(void *priv, void *data) mutex_lock(&link->req.lock); if (flush_info->flush_type == CAM_REQ_MGR_FLUSH_TYPE_ALL) { link->last_flush_id = flush_info->req_id; CAM_INFO(CAM_CRM, "Last request id to flush is %lld", flush_info->req_id); for (i = 0; i < in_q->num_slots; i++) { slot = &in_q->slot[i]; slot->req_id = -1; Loading Loading @@ -2422,6 +2425,7 @@ int cam_req_mgr_link(struct cam_req_mgr_link_info *link_info) goto link_hdl_fail; } link_info->link_hdl = link->link_hdl; link->last_flush_id = 0; /* Allocate memory to hold data of all linked devs */ rc = __cam_req_mgr_create_subdevs(&link->l_dev, Loading Loading @@ -2547,6 +2551,17 @@ int cam_req_mgr_schedule_request( goto end; } if (sched_req->req_id <= link->last_flush_id) { CAM_INFO(CAM_CRM, "request %d is flushed, last_flush_id to flush %lld", sched_req->req_id, link->last_flush_id); rc = -EINVAL; goto end; } if (sched_req->req_id > link->last_flush_id) link->last_flush_id = 0; CAM_DBG(CAM_CRM, "link 0x%x req %lld, sync_mode %d", sched_req->link_hdl, sched_req->req_id, sched_req->sync_mode); Loading