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

Commit 780b2011 authored by Shravya Samala's avatar Shravya Samala Committed by Gerrit - the friendly Code Review server
Browse files

msm: camera: req_mgr: Delay detection mechanism



Created debugfs variable to track the count
of bubble occurrence. Also trace events were added
in case of bubble occurrence, timeouts and dual tfe
irq mismatch. These traces when enabled
will help to gather relative information on which
device bubble occurred or timeout happened or if any
irq mismatch happened in case of dual tfe.

CRs-Fixed: 2666621
Change-Id: I4b46009caa6778aa97d3564eec267299a2370dc4
Signed-off-by: default avatarShravya Samala <shravyas@codeaurora.org>
parent 588b9cbc
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
#include "cam_cdm_util.h"
#include "cam_isp_context.h"
#include "cam_common_util.h"
#include "cam_req_mgr_debug.h"

static const char isp_dev_name[] = "cam-isp";

@@ -1373,6 +1374,12 @@ static int __cam_isp_ctx_epoch_in_applied(struct cam_isp_context *ctx_isp,
	CAM_DBG(CAM_ISP, "next Substate[%s]",
		__cam_isp_ctx_substate_val_to_type(
		ctx_isp->substate_activated));

	cam_req_mgr_debug_delay_detect();
	trace_cam_delay_detect("ISP",
		"bubble epoch_in_applied", req->request_id,
		ctx->ctx_id, ctx->link_hdl, ctx->session_hdl,
		CAM_DEFAULT_VALUE);
end:
	if (request_id == 0) {
		req = list_last_entry(&ctx->active_req_list,
@@ -1567,6 +1574,13 @@ static int __cam_isp_ctx_epoch_in_bubble_applied(
	CAM_DBG(CAM_ISP, "next Substate[%s]",
		__cam_isp_ctx_substate_val_to_type(
		ctx_isp->substate_activated));

	cam_req_mgr_debug_delay_detect();
	trace_cam_delay_detect("ISP",
		"bubble epoch_in_bubble_applied",
		req->request_id, ctx->ctx_id,
		ctx->link_hdl, ctx->session_hdl,
		CAM_DEFAULT_VALUE);
end:
	req = list_last_entry(&ctx->active_req_list, struct cam_ctx_request,
		list);
+22 −1
Original line number Diff line number Diff line
@@ -23,6 +23,8 @@
#include "cam_cpas_api.h"
#include "cam_mem_mgr_api.h"
#include "cam_common_util.h"
#include "cam_req_mgr_debug.h"
#include "cam_trace.h"

#define CAM_TFE_HW_ENTRIES_MAX  20
#define CAM_TFE_HW_CONFIG_TIMEOUT 60
@@ -2448,6 +2450,12 @@ static int cam_tfe_mgr_config_hw(void *hw_mgr_priv,
					"CDM workqueue delay detected, wait for some more time req_id=%llu rc=%d ctx_index %d",
					cfg->request_id, rc,
					ctx->ctx_index);
				cam_req_mgr_debug_delay_detect();
				trace_cam_delay_detect("CDM",
					"CDM workqueue delay detected",
					cfg->request_id, ctx->ctx_index,
					CAM_DEFAULT_VALUE,
					CAM_DEFAULT_VALUE, rc);
				continue;
			}

@@ -2455,6 +2463,14 @@ static int cam_tfe_mgr_config_hw(void *hw_mgr_priv,
				"config done completion timeout for req_id=%llu rc=%d ctx_index %d",
				cfg->request_id, rc,
				ctx->ctx_index);

			cam_req_mgr_debug_delay_detect();
			trace_cam_delay_detect("ISP",
				"config done completion timeout",
				cfg->request_id, ctx->ctx_index,
				CAM_DEFAULT_VALUE, CAM_DEFAULT_VALUE,
				rc);

			if (rc == 0)
				rc = -ETIMEDOUT;

@@ -4956,8 +4972,13 @@ static int cam_tfe_hw_mgr_check_irq_for_dual_tfe(
			tfe_hw_mgr_ctx->dual_tfe_irq_mismatch_cnt++;
		}

		if (tfe_hw_mgr_ctx->dual_tfe_irq_mismatch_cnt == 1)
		if (tfe_hw_mgr_ctx->dual_tfe_irq_mismatch_cnt == 1) {
			cam_tfe_mgr_ctx_irq_dump(tfe_hw_mgr_ctx);
			trace_cam_delay_detect("ISP", "dual tfe irq mismatch",
				CAM_DEFAULT_VALUE, tfe_hw_mgr_ctx->ctx_index,
				CAM_DEFAULT_VALUE, CAM_DEFAULT_VALUE,
				rc);
		}
		rc = 0;
	}

+10 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
#include "cam_trace.h"
#include "cam_debug_util.h"
#include "cam_req_mgr_dev.h"
#include "cam_req_mgr_debug.h"

static struct cam_req_mgr_core_device *g_crm_core_dev;
static struct cam_req_mgr_core_link g_links[MAXIMUM_LINKS_PER_SESSION];
@@ -1471,6 +1472,15 @@ static int __cam_req_mgr_process_req(struct cam_req_mgr_core_link *link,
				"Max retry attempts reached on link[0x%x] for req [%lld]",
				link->link_hdl,
				in_q->slot[in_q->rd_idx].req_id);

			cam_req_mgr_debug_delay_detect();
			trace_cam_delay_detect("CRM",
				"Max retry attempts reached",
				in_q->slot[in_q->rd_idx].req_id,
				CAM_DEFAULT_VALUE,
				link->link_hdl,
				CAM_DEFAULT_VALUE, rc);

			__cam_req_mgr_notify_error_on_link(link, dev);
			link->retry_cnt = 0;
		}
+11 −1
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
 */

#include "cam_req_mgr_debug.h"
@@ -8,6 +8,7 @@
#define MAX_SESS_INFO_LINE_BUFF_LEN 256

static char sess_info_buffer[MAX_SESS_INFO_LINE_BUFF_LEN];
static int cam_debug_mgr_delay_detect;

static int cam_req_mgr_debug_set_bubble_recovery(void *data, u64 val)
{
@@ -128,5 +129,14 @@ int cam_req_mgr_debug_register(struct cam_req_mgr_core_device *core_dev)
		debugfs_root, core_dev, &bubble_recovery))
		return -ENOMEM;

	if (!debugfs_create_u32("delay_detect_count", 0644,
		debugfs_root, &cam_debug_mgr_delay_detect))
		return -ENOMEM;

	return 0;
}

void cam_req_mgr_debug_delay_detect(void)
{
	cam_debug_mgr_delay_detect += 1;
}
+5 −1
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
 */

#ifndef _CAM_REQ_MGR_DEBUG_H_
@@ -11,4 +11,8 @@

int cam_req_mgr_debug_register(struct cam_req_mgr_core_device *core_dev);

/* cam_req_mgr_debug_delay_detect()
 * @brief    : increment debug_fs varaible by 1 whenever delay occurred.
 */
void cam_req_mgr_debug_delay_detect(void);
#endif
Loading