media_modules: timeout_process trigger softlockup crash [1/1]

PD#SWPL-6395

Problem:
timeout trigger softlockup.

Solution:
1 amvdec_stop,adjust timeout HZ to HZ/10,Cancel
  the  timeout warning.
2 First clear timeout, after amvdec_stop Reduce
  frequent triggers timeout_process.

Verify:
T962X2

Change-Id: I5312786395db30fdb511d6e980f20e4ed466c3c1
Signed-off-by: Conglin Guo <conglin.guo@amlogic.com>
This commit is contained in:
Conglin Guo
2019-04-12 15:14:52 +08:00
committed by Dongjin Kim
parent 959f192fd0
commit 4614ea7532
2 changed files with 8 additions and 7 deletions

View File

@@ -2135,18 +2135,19 @@ static void reset_process_time(struct vdec_mpeg12_hw_s *hw)
}
static void start_process_time(struct vdec_mpeg12_hw_s *hw)
{
hw->decode_timeout_count = 2;
hw->decode_timeout_count = 10;
hw->start_process_time = jiffies;
}
static void timeout_process(struct vdec_mpeg12_hw_s *hw)
{
struct vdec_s *vdec = hw_to_vdec(hw);
reset_process_time(hw);
amvdec_stop();
debug_print(DECODE_ID(hw), PRINT_FLAG_ERROR,
"%s decoder timeout, status=%d, level=%d\n",
__func__, vdec->status, READ_VREG(VLD_MEM_VIFIFO_LEVEL));
hw->dec_result = DEC_RESULT_DONE;
reset_process_time(hw);
hw->first_i_frame_ready = 0;
vdec_schedule_work(&hw->work);
}

View File

@@ -810,7 +810,7 @@ EXPORT_SYMBOL(amhevc_start);
void amvdec_stop(void)
{
ulong timeout = jiffies + HZ;
ulong timeout = jiffies + HZ/10;
WRITE_VREG(MPSR, 0);
WRITE_VREG(CPSR, 0);
@@ -820,7 +820,7 @@ void amvdec_stop(void)
break;
}
timeout = jiffies + HZ;
timeout = jiffies + HZ/10;
while (READ_VREG(LMEM_DMA_CTRL) & 0x8000) {
if (time_after(jiffies, timeout))
break;
@@ -859,7 +859,7 @@ EXPORT_SYMBOL(amvdec_stop);
void amvdec2_stop(void)
{
if (has_vdec2()) {
ulong timeout = jiffies + HZ;
ulong timeout = jiffies + HZ/10;
WRITE_VREG(VDEC2_MPSR, 0);
WRITE_VREG(VDEC2_CPSR, 0);
@@ -889,7 +889,7 @@ EXPORT_SYMBOL(amhcodec_stop);
void amhevc_stop(void)
{
if (has_hevc_vdec()) {
ulong timeout = jiffies + HZ;
ulong timeout = jiffies + HZ/10;
WRITE_VREG(HEVC_MPSR, 0);
WRITE_VREG(HEVC_CPSR, 0);
@@ -899,7 +899,7 @@ void amhevc_stop(void)
break;
}
timeout = jiffies + HZ;
timeout = jiffies + HZ/10;
while (READ_VREG(HEVC_LMEM_DMA_CTRL) & 0x8000) {
if (time_after(jiffies, timeout))
break;