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

Commit e1e1f042 authored by Ramesh V's avatar Ramesh V Committed by Gerrit - the friendly Code Review server
Browse files

msm: camera: sof freeze enhancement



Enable CSID IRQ dynamically and add sof recover logic,
in case kernel get sof freeze hints from userspace,will
enable IRQs to monitor the status of moduels,if sof recovers
after 2.5 secs then kernel get MSM_SD_UNNOTIFY_FREEZE to disable
all the IRQs.

CRs-Fixed: 973732
Change-Id: I7aa6dcd60e0858258c40c3d6517e2974e6e2b722
Signed-off-by: default avatarRamesh V <ramev@codeaurora.org>
parent 422bb915
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@
#include "msm_isp_axi_util.h"

#define HANDLE_TO_IDX(handle) (handle & 0xFF)
#define ISP_SOF_DEBUG_COUNT 0
#define ISP_SOF_DEBUG_COUNT 5

static int msm_isp_update_dual_HW_ms_info_at_start(
	struct vfe_device *vfe_dev,
+2 −0
Original line number Diff line number Diff line
@@ -1107,6 +1107,8 @@ static long msm_isp_ioctl_unlocked(struct v4l2_subdev *sd,
		vfe_dev->isp_raw1_debug = 0;
		vfe_dev->isp_raw2_debug = 0;
		break;
	case MSM_SD_UNNOTIFY_FREEZE:
		break;
	case MSM_SD_SHUTDOWN:
		while (vfe_dev->vfe_open_cnt != 0)
			msm_isp_close_node(sd, NULL);
+3 −1
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@

#define ISPIF_TIMEOUT_SLEEP_US                1000
#define ISPIF_TIMEOUT_ALL_US               1000000
#define ISPIF_SOF_DEBUG_COUNT                    0
#define ISPIF_SOF_DEBUG_COUNT                    5

#undef CDBG
#ifdef CONFIG_MSMB_CAMERA_DEBUG
@@ -1490,6 +1490,8 @@ static long msm_ispif_subdev_ioctl(struct v4l2_subdev *sd,
		ispif->ispif_rdi2_debug = 0;
		return 0;
	}
	case MSM_SD_UNNOTIFY_FREEZE:
		return 0;
	case MSM_SD_SHUTDOWN:
		return 0;
	default:
+16 −4
Original line number Diff line number Diff line
@@ -503,12 +503,16 @@ static inline int __msm_sd_close_subdevs(struct msm_sd_subdev *msm_sd,
	return 0;
}

static inline int __msm_sd_notify_freeze_subdevs(struct msm_sd_subdev *msm_sd)
static inline int __msm_sd_notify_freeze_subdevs(struct msm_sd_subdev *msm_sd,
	int enable)
{
	struct v4l2_subdev *sd;
	sd = &msm_sd->sd;

	if (enable)
		v4l2_subdev_call(sd, core, ioctl, MSM_SD_NOTIFY_FREEZE, NULL);
	else
		v4l2_subdev_call(sd, core, ioctl, MSM_SD_UNNOTIFY_FREEZE, NULL);

	return 0;
}
@@ -716,10 +720,18 @@ static long msm_private_ioctl(struct file *file, void *fh,
		break;

	case MSM_CAM_V4L2_IOCTL_NOTIFY_DEBUG: {
		pr_err("Notifying subdevs about potential sof freeze\n");
		if (event_data->status) {
			pr_err("%s:Notifying subdevs about potential sof freeze\n",
				__func__);
		} else {
			pr_err("%s:Notifying subdevs about sof recover\n",
				__func__);
		}

		if (!list_empty(&msm_v4l2_dev->subdevs)) {
			list_for_each_entry(msm_sd, &ordered_sd_list, list)
				__msm_sd_notify_freeze_subdevs(msm_sd);
				__msm_sd_notify_freeze_subdevs(msm_sd,
					event_data->status);
		}
	}
		break;
+3 −1
Original line number Diff line number Diff line
/* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -444,6 +444,8 @@ static long msm_buf_mngr_subdev_ioctl(struct v4l2_subdev *sd,
	case VIDIOC_MSM_BUF_MNGR_FLUSH:
		rc = msm_generic_buf_mngr_flush(buf_mngr_dev, argp);
		break;
	case MSM_SD_UNNOTIFY_FREEZE:
		break;
	case MSM_SD_SHUTDOWN:
		msm_buf_mngr_sd_shutdown(buf_mngr_dev, argp);
		break;
Loading