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

Commit e34b9eec authored by Venkat Chinta's avatar Venkat Chinta
Browse files

msm: camera: isp: Avoid stop during IFE flush



This change avoids stopping hardware in IFE flush as the sequence
to stop HW is leading to bad HW state. This change also removes
BUG from irq controller.

Change-Id: Icf86c13c85370f32a4d37f02909ff0594943be59
Signed-off-by: default avatarVenkat Chinta <vchinta@codeaurora.org>
parent 30b32197
Loading
Loading
Loading
Loading
+0 −46
Original line number Diff line number Diff line
@@ -1489,11 +1489,6 @@ static int __cam_isp_ctx_flush_req_in_top_state(
	struct cam_context *ctx,
	struct cam_req_mgr_flush_request *flush_req)
{
	struct cam_isp_context           *ctx_isp =
		(struct cam_isp_context *) ctx->ctx_priv;
	struct cam_isp_stop_args          stop_isp;
	struct cam_hw_stop_args           stop_args;
	struct cam_isp_start_args         start_isp;
	int rc = 0;

	if (flush_req->type == CAM_REQ_MGR_FLUSH_TYPE_ALL) {
@@ -1507,47 +1502,6 @@ static int __cam_isp_ctx_flush_req_in_top_state(
	rc = __cam_isp_ctx_flush_req(ctx, &ctx->pending_req_list, flush_req);
	spin_unlock_bh(&ctx->lock);

	if (flush_req->type == CAM_REQ_MGR_FLUSH_TYPE_ALL) {
		/* if active and wait list are empty, return */
		spin_lock_bh(&ctx->lock);
		if ((list_empty(&ctx->wait_req_list)) &&
			(list_empty(&ctx->active_req_list))) {
			spin_unlock_bh(&ctx->lock);
			CAM_DBG(CAM_ISP, "active and wait list are empty");
			goto end;
		}
		spin_unlock_bh(&ctx->lock);

		/* Stop hw first before active list flush */
		stop_args.ctxt_to_hw_map = ctx_isp->hw_ctx;
		stop_isp.hw_stop_cmd = CAM_ISP_HW_STOP_AT_FRAME_BOUNDARY;
		stop_isp.stop_only = true;
		stop_args.args = (void *)&stop_isp;
		ctx->hw_mgr_intf->hw_stop(ctx->hw_mgr_intf->hw_mgr_priv,
				&stop_args);

		spin_lock_bh(&ctx->lock);
		CAM_DBG(CAM_ISP, "try to flush wait list");
		rc = __cam_isp_ctx_flush_req(ctx, &ctx->wait_req_list,
		flush_req);
		CAM_DBG(CAM_ISP, "try to flush active list");
		rc = __cam_isp_ctx_flush_req(ctx, &ctx->active_req_list,
		flush_req);
		ctx_isp->active_req_cnt = 0;
		spin_unlock_bh(&ctx->lock);

		/* Start hw */
		start_isp.hw_config.ctxt_to_hw_map = ctx_isp->hw_ctx;
		start_isp.start_only = true;
		start_isp.hw_config.priv = NULL;

		rc = ctx->hw_mgr_intf->hw_start(ctx->hw_mgr_intf->hw_mgr_priv,
			&start_isp);
	}

end:
	CAM_DBG(CAM_ISP, "Flush request in top state %d",
		 ctx->state);
	return rc;
}

+2 −2
Original line number Diff line number Diff line
@@ -616,9 +616,9 @@ static void cam_irq_controller_th_processing(
			rc = irq_bh_api->get_bh_payload_func(
				evt_handler->bottom_half, &bh_cmd);
			if (rc || !bh_cmd) {
				CAM_ERR(CAM_ISP,
				CAM_ERR_RATE_LIMIT(CAM_ISP,
					"No payload, IRQ handling frozen");
				BUG();
				continue;
			}
		}