summaryrefslogtreecommitdiff
authorJian Wang <jian.wang@amlogic.com>2018-03-12 12:20:14 (GMT)
committer jie.yuan <jie.yuan@amlogic.com>2018-04-18 03:09:43 (GMT)
commit1943cff54523c9640382fe9c69c26d4d0d8dab87 (patch)
tree28f3992a8e35bae1ec5b9bb47833302bbb24b63a
parent9d73d1b9e6d6bec500ae56dfecb598b9c3a2261e (diff)
downloadcommon-1943cff54523c9640382fe9c69c26d4d0d8dab87.zip
common-1943cff54523c9640382fe9c69c26d4d0d8dab87.tar.gz
common-1943cff54523c9640382fe9c69c26d4d0d8dab87.tar.bz2
ionvideo: fix ionvideo_thread panic [1/1]
PD# 161775: fix ionvideo_thread panic merge from jintao.xu 3.14 jane commit: [PATCH] NEEDLEPLAT-4635: fix ionvideo_thread panic[1/1] [Problem] Kernel panic (ionvideo_thread+0x5ac/0x6bc) in the field [Solution] Add ge2d timeout protect [Platform] Needle/Stark [Test] Change-Id: Iee8a6930bbb6b3a140db73e74aa287f2367b71b0 Signed-off-by: Jian Wang <jian.wang@amlogic.com>
Diffstat
-rw-r--r--drivers/amlogic/media/video_processor/ionvideo/ionvideo.c23
-rw-r--r--drivers/amlogic/media/video_processor/ionvideo/ionvideo.h1
2 files changed, 17 insertions, 7 deletions
diff --git a/drivers/amlogic/media/video_processor/ionvideo/ionvideo.c b/drivers/amlogic/media/video_processor/ionvideo/ionvideo.c
index 9005473..1b5978b 100644
--- a/drivers/amlogic/media/video_processor/ionvideo/ionvideo.c
+++ b/drivers/amlogic/media/video_processor/ionvideo/ionvideo.c
@@ -310,12 +310,14 @@ static int ionvideo_fillbuff(struct ionvideo_dev *dev,
vf_put(vf, dev->vf_receiver_name);
return ret;
}
+ if (dev->wait_ge2d_timeout) {
+ IONVID_INFO("ppmgr2_process timeout\n");
+ dev->wait_ge2d_timeout = false;
+ return -EAGAIN;
+ }
+ dev->wait_ge2d_timeout = false;
videoc_omx_compute_pts(dev, vf);
buf->timecode.frames = 0;
- if (vf->flag & VFRAME_FLAG_ERROR_RECOVERY)
- buf->timecode.frames |= 1;
- if (vf->flag & VFRAME_FLAG_SYNCFRAME)
- buf->timecode.frames |= 2;
vf_put(vf, dev->vf_receiver_name);
buf->timestamp.tv_sec = dev->pts >> 32;
buf->timestamp.tv_usec = dev->pts & 0xFFFFFFFF;
@@ -361,6 +363,7 @@ static void ionvideo_thread_tick(struct ionvideo_dev *dev)
if (dev->active_state == ION_INACTIVE)
return;
+ dev->wait_ge2d_timeout = false;
vf = vf_peek(dev->vf_receiver_name);
if (!vf) {
dev->vf_wait_cnt++;
@@ -920,15 +923,21 @@ static int ionvideo_v4l2_release(void)
static int video_receiver_event_fun(int type, void *data, void *private_data)
{
struct ionvideo_dev *dev = (struct ionvideo_dev *)private_data;
-
+ int timeout = 0;
if (type == VFRAME_EVENT_PROVIDER_UNREG) {
dev->receiver_register = 0;
dev->is_omx_video_started = 0;
if (dev->active_state == ION_ACTIVE) {
/*if player killed thread may have exit.*/
dev->active_state = ION_INACTIVE_REQ;
- wait_for_completion_timeout(&dev->inactive_done,
- msecs_to_jiffies(100));
+ dev->wait_ge2d_timeout = false;
+ timeout = wait_for_completion_timeout(
+ &dev->inactive_done,
+ msecs_to_jiffies(200));
+ if (!timeout) {
+ IONVID_INFO("unreg:wait timeout\n");
+ dev->wait_ge2d_timeout = true;
+ }
}
/*tsync_avevent(VIDEO_STOP, 0);*/
diff --git a/drivers/amlogic/media/video_processor/ionvideo/ionvideo.h b/drivers/amlogic/media/video_processor/ionvideo/ionvideo.h
index 14bb5f9..8ab646b 100644
--- a/drivers/amlogic/media/video_processor/ionvideo/ionvideo.h
+++ b/drivers/amlogic/media/video_processor/ionvideo/ionvideo.h
@@ -302,6 +302,7 @@ struct ionvideo_dev {
struct mutex mutex_input;
struct mutex mutex_output;
struct v4l2_buffer ionvideo_input[IONVIDEO_POOL_SIZE + 1];
+ bool wait_ge2d_timeout;
};
unsigned int get_ionvideo_debug(void);