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

Commit 2ed641f5 authored by Divya Sharma's avatar Divya Sharma
Browse files

Revert "msm: camera: common: Enable debugfs compile check."



This reverts commit cf807409.

Change-Id: Ib8d6808ed0072ce5c8ff14cd5b3ae3a597a51008
Signed-off-by: default avatarDivya Sharma <divyash@codeaurora.org>
parent cf807409
Loading
Loading
Loading
Loading
+19 −18
Original line number Diff line number Diff line
@@ -2025,31 +2025,32 @@ static int cam_cpas_util_get_internal_ops(struct platform_device *pdev,
	return rc;
}

#if IS_ENABLED(CONFIG_DEBUG_FS)
static int cam_cpas_util_create_debugfs(
	struct cam_cpas *cpas_core)
{
	int rc = 0;

	cpas_core->dentry = debugfs_create_dir("camera_cpas", NULL);
	if (IS_ERR(cpas_core->dentry)) {
		rc = PTR_ERR(cpas_core->dentry);
		goto end;
	if (!cpas_core->dentry)
		return -ENOMEM;

	if (!debugfs_create_bool("ahb_bus_scaling_disable",
		0644,
		cpas_core->dentry,
		&cpas_core->ahb_bus_scaling_disable)) {
		CAM_ERR(CAM_CPAS,
			"failed to create ahb_bus_scaling_disable entry");
		rc = -ENOMEM;
		goto err;
	}

	debugfs_create_bool("ahb_bus_scaling_disable", 0644, cpas_core->dentry,
		&cpas_core->ahb_bus_scaling_disable);
	return 0;

end:
err:
	debugfs_remove_recursive(cpas_core->dentry);
	cpas_core->dentry = NULL;
	return rc;
}
#else
static inline int cam_cpas_util_create_debugfs(struct cam_cpas *cpas_core)
{
	CAM_WARN(CAM_CPAS, "DebugFS not enabled in kernel");
	return 0;
}
#endif

int cam_cpas_hw_probe(struct platform_device *pdev,
	struct cam_hw_intf **hw_intf)
@@ -2195,6 +2196,8 @@ int cam_cpas_hw_probe(struct platform_device *pdev,
		goto axi_cleanup;

	rc  = cam_cpas_util_create_debugfs(cpas_core);
	if (rc)
		CAM_WARN(CAM_CPAS, "Failed to create dentry");

	*hw_intf = cpas_hw_intf;
	return 0;
@@ -2247,9 +2250,7 @@ int cam_cpas_hw_remove(struct cam_hw_intf *cpas_hw_intf)
	cam_cpas_util_unregister_bus_client(&cpas_core->ahb_bus_client);
	cam_cpas_util_client_cleanup(cpas_hw);
	cam_cpas_soc_deinit_resources(&cpas_hw->soc_info);
#if IS_ENABLED(CONFIG_DEBUG_FS)
	debugfs_remove_recursive(cpas_core->dentry);
#endif
	cpas_core->dentry = NULL;
	flush_workqueue(cpas_core->work_queue);
	destroy_workqueue(cpas_core->work_queue);
+67 −32
Original line number Diff line number Diff line
@@ -1882,51 +1882,87 @@ static int cam_icp_get_a5_fw_dump_lvl(void *data, u64 *val)
DEFINE_SIMPLE_ATTRIBUTE(cam_icp_debug_fw_dump, cam_icp_get_a5_fw_dump_lvl,
	cam_icp_set_a5_fw_dump_lvl, "%08llu");

#if IS_ENABLED(CONFIG_DEBUG_FS)
static int cam_icp_hw_mgr_create_debugfs_entry(void)
{
	int rc = 0;

	icp_hw_mgr.dentry = debugfs_create_dir("camera_icp", NULL);
	if (IS_ERR(icp_hw_mgr.dentry)) {
		rc = PTR_ERR(icp_hw_mgr.dentry);
		goto end;
	if (IS_ERR_OR_NULL(icp_hw_mgr.dentry)) {
		CAM_ERR(CAM_ICP, "Debugfs entry dir: %s failed",
			"camrea_icp");
		return -ENOMEM;
	}

	debugfs_create_bool("icp_pc", 0644, icp_hw_mgr.dentry,
		&icp_hw_mgr.icp_pc_flag);
	if (!debugfs_create_bool("icp_pc",
		0644,
		icp_hw_mgr.dentry,
		&icp_hw_mgr.icp_pc_flag)) {
		CAM_ERR(CAM_ICP, "failed to create icp_pc entry");
		rc = -ENOMEM;
		goto err;
	}

	debugfs_create_bool("ipe_bps_pc", 0644, icp_hw_mgr.dentry,
		&icp_hw_mgr.ipe_bps_pc_flag);
	if (!debugfs_create_bool("ipe_bps_pc",
		0644,
		icp_hw_mgr.dentry,
		&icp_hw_mgr.ipe_bps_pc_flag)) {
		CAM_ERR(CAM_ICP, "failed to create ipe_bps_pc entry");
		rc = -ENOMEM;
		goto err;
	}

	debugfs_create_file("icp_debug_clk", 0644, icp_hw_mgr.dentry, NULL,
		&cam_icp_debug_default_clk);
	if (!debugfs_create_file("icp_debug_clk",
		0644,
		icp_hw_mgr.dentry, NULL,
		&cam_icp_debug_default_clk)) {
		CAM_ERR(CAM_ICP, "failed to create icp_debug_clk entry");
		rc = -ENOMEM;
		goto err;
	}

	debugfs_create_bool("a5_jtag_debug", 0644, icp_hw_mgr.dentry,
		&icp_hw_mgr.a5_jtag_debug);
	if (!debugfs_create_bool("a5_jtag_debug",
		0644,
		icp_hw_mgr.dentry,
		&icp_hw_mgr.a5_jtag_debug)) {
		rc = -ENOMEM;
		goto err;
	}

	debugfs_create_file("a5_debug_type", 0644, icp_hw_mgr.dentry, NULL,
		&cam_icp_debug_type_fs);
	if (!debugfs_create_file("a5_debug_type",
		0644,
		icp_hw_mgr.dentry,
		NULL, &cam_icp_debug_type_fs)) {
		CAM_ERR(CAM_ICP, "failed to create a5_debug_type");
		rc = -ENOMEM;
		goto err;
	}

	debugfs_create_file("a5_debug_lvl", 0644, icp_hw_mgr.dentry, NULL,
		&cam_icp_debug_fs);
	if (!debugfs_create_file("a5_debug_lvl",
		0644,
		icp_hw_mgr.dentry,
		NULL, &cam_icp_debug_fs)) {
		CAM_ERR(CAM_ICP, "failed to create a5_dbg_lvl");
		rc = -ENOMEM;
		goto err;
	}

	debugfs_create_file("a5_fw_dump_lvl", 0644, icp_hw_mgr.dentry, NULL,
		&cam_icp_debug_fw_dump);
end:
	/* Set default hang dump lvl */
	icp_hw_mgr.a5_fw_dump_lvl = HFI_FW_DUMP_ON_FAILURE;
	return rc;
	if (!debugfs_create_file("a5_fw_dump_lvl",
		0644,
		icp_hw_mgr.dentry,
		NULL, &cam_icp_debug_fw_dump)) {
		CAM_ERR(CAM_ICP, "failed to create a5_fw_dump_lvl");
		rc = -ENOMEM;
		goto err;
	}
#else
static inline int cam_icp_hw_mgr_create_debugfs_entry(void)
{

	/* Set default hang dump lvl */
	icp_hw_mgr.a5_fw_dump_lvl = HFI_FW_DUMP_ON_FAILURE;
	CAM_WARN(CAM_ICP, "DebugFS not enabled in kernel");
	return 0;
	return rc;
err:
	debugfs_remove_recursive(icp_hw_mgr.dentry);
	icp_hw_mgr.dentry = NULL;
	return rc;
}
#endif

static int cam_icp_mgr_process_cmd(void *priv, void *data)
{
@@ -5964,9 +6000,10 @@ static int cam_icp_mgr_create_wq(void)
	}

	rc = cam_icp_hw_mgr_create_debugfs_entry();
	if (rc)
	if (rc) {
		CAM_ERR(CAM_ICP, "create_debugfs_entry fail= rc: %d", rc);
		goto debugfs_create_failed;

	}
	for (i = 0; i < ICP_WORKQ_NUM_TASK; i++)
		icp_hw_mgr.msg_work->task.pool[i].payload =
				&icp_hw_mgr.msg_work_data[i];
@@ -6137,9 +6174,7 @@ void cam_icp_hw_mgr_deinit(void)
{
	int i = 0;

#if IS_ENABLED(CONFIG_DEBUG_FS)
	debugfs_remove_recursive(icp_hw_mgr.dentry);
#endif
	icp_hw_mgr.dentry = NULL;
	cam_icp_mgr_destroy_wq();
	kfree(icp_hw_mgr.devices[CAM_ICP_DEV_BPS]);
+16 −18
Original line number Diff line number Diff line
@@ -5297,30 +5297,30 @@ static int cam_isp_context_dump_active_request(void *data, unsigned long iova,
	return rc;
}

#if IS_ENABLED(CONFIG_DEBUG_FS)
static int cam_isp_context_debug_register(void)
{
	int rc = 0;
	isp_ctx_debug.dentry = debugfs_create_dir("camera_isp_ctx",
		NULL);

	isp_ctx_debug.dentry = debugfs_create_dir("camera_isp_ctx", NULL);
	if (IS_ERR(isp_ctx_debug.dentry)) {
		rc = PTR_ERR(isp_ctx_debug.dentry);
		goto end;
	if (IS_ERR_OR_NULL(isp_ctx_debug.dentry)) {
		CAM_ERR(CAM_ISP, "failed to create dentry");
		return -ENOMEM;
	}

	debugfs_create_u32("enable_state_monitor_dump", 0644,
		isp_ctx_debug.dentry, &isp_ctx_debug.enable_state_monitor_dump);

end:
	return rc;
	if (!debugfs_create_u32("enable_state_monitor_dump",
		0644,
		isp_ctx_debug.dentry,
		&isp_ctx_debug.enable_state_monitor_dump)) {
		CAM_ERR(CAM_ISP, "failed to create enable_state_monitor_dump");
		goto err;
	}
#else
static inline int cam_isp_context_debug_register(void)
{
	CAM_WARN(CAM_ISP, "DebugFS not enabled in kernel");

	return 0;

err:
	debugfs_remove_recursive(isp_ctx_debug.dentry);
	return -ENOMEM;
}
#endif

int cam_isp_context_init(struct cam_isp_context *ctx,
	struct cam_context *ctx_base,
@@ -5400,9 +5400,7 @@ int cam_isp_context_deinit(struct cam_isp_context *ctx)
			__cam_isp_ctx_substate_val_to_type(
			ctx->substate_activated));

#if IS_ENABLED(CONFIG_DEBUG_FS)
	debugfs_remove_recursive(isp_ctx_debug.dentry);
#endif
	isp_ctx_debug.dentry = NULL;
	memset(ctx, 0, sizeof(*ctx));

+49 −28
Original line number Diff line number Diff line
@@ -7725,43 +7725,64 @@ DEFINE_SIMPLE_ATTRIBUTE(cam_ife_camif_debug,
	cam_ife_get_camif_debug,
	cam_ife_set_camif_debug, "%16llu");

#if IS_ENABLED(CONFIG_DEBUG_FS)
static int cam_ife_hw_mgr_debug_register(void)
{
	int rc = 0;
	g_ife_hw_mgr.debug_cfg.dentry = debugfs_create_dir("camera_ife",
		NULL);

	g_ife_hw_mgr.debug_cfg.dentry = debugfs_create_dir("camera_ife", NULL);
	if (IS_ERR(g_ife_hw_mgr.debug_cfg.dentry))
	{
		rc = PTR_ERR(g_ife_hw_mgr.debug_cfg.dentry);
		goto end;
	if (!g_ife_hw_mgr.debug_cfg.dentry) {
		CAM_ERR(CAM_ISP, "failed to create dentry");
		return -ENOMEM;
	}

	if (!debugfs_create_file("ife_csid_debug",
		0644,
		g_ife_hw_mgr.debug_cfg.dentry, NULL,
		&cam_ife_csid_debug)) {
		CAM_ERR(CAM_ISP, "failed to create cam_ife_csid_debug");
		goto err;
	}

	debugfs_create_file("ife_csid_debug", 0644,
		g_ife_hw_mgr.debug_cfg.dentry, NULL, &cam_ife_csid_debug);
	debugfs_create_u32("enable_recovery", 0644,
	if (!debugfs_create_u32("enable_recovery",
		0644,
		g_ife_hw_mgr.debug_cfg.dentry,
		&g_ife_hw_mgr.debug_cfg.enable_recovery);
	debugfs_create_bool("enable_req_dump", 0644,
		&g_ife_hw_mgr.debug_cfg.enable_recovery)) {
		CAM_ERR(CAM_ISP, "failed to create enable_recovery");
		goto err;
	}

	if (!debugfs_create_bool("enable_req_dump",
		0644,
		g_ife_hw_mgr.debug_cfg.dentry,
		&g_ife_hw_mgr.debug_cfg.enable_req_dump);
	debugfs_create_file("ife_camif_debug", 0644,
		g_ife_hw_mgr.debug_cfg.dentry, NULL, &cam_ife_camif_debug);
	debugfs_create_bool("per_req_reg_dump", 0644,
		&g_ife_hw_mgr.debug_cfg.enable_req_dump)) {
		CAM_ERR(CAM_ISP, "failed to create enable_req_dump");
		goto err;
	}

	if (!debugfs_create_file("ife_camif_debug",
		0644,
		g_ife_hw_mgr.debug_cfg.dentry, NULL,
		&cam_ife_camif_debug)) {
		CAM_ERR(CAM_ISP, "failed to create cam_ife_camif_debug");
		goto err;
	}

	if (!debugfs_create_bool("per_req_reg_dump",
		0644,
		g_ife_hw_mgr.debug_cfg.dentry,
		&g_ife_hw_mgr.debug_cfg.per_req_reg_dump);
end:
	g_ife_hw_mgr.debug_cfg.enable_recovery = 0;
	return rc;
		&g_ife_hw_mgr.debug_cfg.per_req_reg_dump)) {
		CAM_ERR(CAM_ISP, "failed to create per_req_reg_dump entry");
		goto err;
	}
#else
static inline int cam_ife_hw_mgr_debug_register(void)
{

	g_ife_hw_mgr.debug_cfg.enable_recovery = 0;
	CAM_WARN(CAM_ISP, "DebugFS not enabled in kernel");

	return 0;

err:
	debugfs_remove_recursive(g_ife_hw_mgr.debug_cfg.dentry);
	return -ENOMEM;
}
#endif

int cam_ife_hw_mgr_init(struct cam_hw_mgr_intf *hw_mgr_intf, int *iommu_hdl)
{
@@ -7771,6 +7792,8 @@ int cam_ife_hw_mgr_init(struct cam_hw_mgr_intf *hw_mgr_intf, int *iommu_hdl)
	struct cam_ife_hw_mgr_ctx *ctx_pool;
	struct cam_isp_hw_mgr_res *res_list_ife_out;

	CAM_DBG(CAM_ISP, "Enter");

	memset(&g_ife_hw_mgr, 0, sizeof(g_ife_hw_mgr));

	mutex_init(&g_ife_hw_mgr.ctx_mutex);
@@ -7978,9 +8001,7 @@ void cam_ife_hw_mgr_deinit(void)
	int i = 0;

	cam_req_mgr_workq_destroy(&g_ife_hw_mgr.workq);
#if IS_ENABLED(CONFIG_DEBUG_FS)
	debugfs_remove_recursive(g_ife_hw_mgr.debug_cfg.dentry);
#endif
	g_ife_hw_mgr.debug_cfg.dentry = NULL;

	for (i = 0; i < CAM_CTX_MAX; i++) {
+48 −27
Original line number Diff line number Diff line
@@ -5263,42 +5263,65 @@ DEFINE_DEBUGFS_ATTRIBUTE(cam_tfe_camif_debug,
	cam_tfe_get_camif_debug,
	cam_tfe_set_camif_debug, "%16llu");

#if IS_ENABLED(CONFIG_DEBUG_FS)
static int cam_tfe_hw_mgr_debug_register(void)
{
	int rc = 0;
	g_tfe_hw_mgr.debug_cfg.dentry = debugfs_create_dir("camera_tfe",
		NULL);

	g_tfe_hw_mgr.debug_cfg.dentry = debugfs_create_dir("camera_tfe", NULL);
	if (IS_ERR(g_tfe_hw_mgr.debug_cfg.dentry)) {
		rc = PTR_ERR(g_tfe_hw_mgr.debug_cfg.dentry);
		goto end;
	if (!g_tfe_hw_mgr.debug_cfg.dentry) {
		CAM_ERR(CAM_ISP, "failed to create dentry");
		return -ENOMEM;
	}

	debugfs_create_file("tfe_csid_debug", 0644,
		g_tfe_hw_mgr.debug_cfg.dentry, NULL, &cam_tfe_csid_debug);
	debugfs_create_u32("enable_recovery", 0644,
	if (!debugfs_create_file("tfe_csid_debug",
		0644,
		g_tfe_hw_mgr.debug_cfg.dentry, NULL,
		&cam_tfe_csid_debug)) {
		CAM_ERR(CAM_ISP, "failed to create cam_tfe_csid_debug");
		goto err;
	}

	if (!debugfs_create_u32("enable_recovery",
		0644,
		g_tfe_hw_mgr.debug_cfg.dentry,
		&g_tfe_hw_mgr.debug_cfg.enable_recovery);
	debugfs_create_u32("enable_reg_dump", 0644,
		&g_tfe_hw_mgr.debug_cfg.enable_recovery)) {
		CAM_ERR(CAM_ISP, "failed to create enable_recovery");
		goto err;
	}

	if (!debugfs_create_u32("enable_reg_dump",
		0644,
		g_tfe_hw_mgr.debug_cfg.dentry,
		&g_tfe_hw_mgr.debug_cfg.enable_reg_dump);
	debugfs_create_file("tfe_camif_debug", 0644,
		g_tfe_hw_mgr.debug_cfg.dentry, NULL, &cam_tfe_camif_debug);
	debugfs_create_u32("per_req_reg_dump", 0644,
		&g_tfe_hw_mgr.debug_cfg.enable_reg_dump)) {
		CAM_ERR(CAM_ISP, "failed to create enable_reg_dump");
		goto err;
	}

	if (!debugfs_create_file("tfe_camif_debug",
		0644,
		g_tfe_hw_mgr.debug_cfg.dentry, NULL,
		&cam_tfe_camif_debug)) {
		CAM_ERR(CAM_ISP, "failed to create cam_tfe_camif_debug");
		goto err;
	}

	if (!debugfs_create_u32("per_req_reg_dump",
		0644,
		g_tfe_hw_mgr.debug_cfg.dentry,
		&g_tfe_hw_mgr.debug_cfg.per_req_reg_dump);
end:
	g_tfe_hw_mgr.debug_cfg.enable_recovery = 0;
	return rc;
		&g_tfe_hw_mgr.debug_cfg.per_req_reg_dump)) {
		CAM_ERR(CAM_ISP, "failed to create per_req_reg_dump entry");
		goto err;
	}
#else
static inline int cam_tfe_hw_mgr_debug_register(void)
{


	g_tfe_hw_mgr.debug_cfg.enable_recovery = 0;
	CAM_WARN(CAM_ISP, "DebugFS not enabled in kernel");

	return 0;

err:
	debugfs_remove_recursive(g_tfe_hw_mgr.debug_cfg.dentry);
	return -ENOMEM;
}
#endif

int cam_tfe_hw_mgr_init(struct cam_hw_mgr_intf *hw_mgr_intf, int *iommu_hdl)
{
@@ -5506,9 +5529,7 @@ void cam_tfe_hw_mgr_deinit(void)
	int i = 0;

	cam_req_mgr_workq_destroy(&g_tfe_hw_mgr.workq);
#if IS_ENABLED(CONFIG_DEBUG_FS)
	debugfs_remove_recursive(g_tfe_hw_mgr.debug_cfg.dentry);
#endif
	g_tfe_hw_mgr.debug_cfg.dentry = NULL;

	for (i = 0; i < CAM_CTX_MAX; i++) {
Loading