diff --git a/drivers/amlogic/media_modules/frame_provider/decoder/mpeg12/vmpeg12_multi.c b/drivers/amlogic/media_modules/frame_provider/decoder/mpeg12/vmpeg12_multi.c index 249e6ff9d8e4..842e5be6aade 100644 --- a/drivers/amlogic/media_modules/frame_provider/decoder/mpeg12/vmpeg12_multi.c +++ b/drivers/amlogic/media_modules/frame_provider/decoder/mpeg12/vmpeg12_multi.c @@ -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); } diff --git a/drivers/amlogic/media_modules/frame_provider/decoder/utils/amvdec.c b/drivers/amlogic/media_modules/frame_provider/decoder/utils/amvdec.c index bcbb4042af73..1d4e6f5a49eb 100644 --- a/drivers/amlogic/media_modules/frame_provider/decoder/utils/amvdec.c +++ b/drivers/amlogic/media_modules/frame_provider/decoder/utils/amvdec.c @@ -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;