FAILED: patch "[PATCH] media: chips-media: wave5: Add timeout while stop_streaming" failed to apply to 6.18-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 6.18-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.18.y
git checkout FETCH_HEAD
git cherry-pick -x 2ae7faed2e60d6d07d9efdd962d20dcb15330ced
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026090953-underline-result-7e3d@gregkh' --subject-prefix 'PATCH 6.18.y' 'HEAD^..'
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 2ae7faed2e60d6d07d9efdd962d20dcb15330ced Mon Sep 17 00:00:00 2001
From: Jackson Lee <[email protected]>
Date: Fri, 26 Jun 2026 10:22:29 +0900
Subject: [PATCH] media: chips-media: wave5: Add timeout while stop_streaming
When stop_streaming is called, an infinite loop may occur in some cases. Add a bounded poll of the queue status: loop until the queues drain, sleeping briefly between polls, and bail out once VPU_DEC_STOP_TIMEOUT elapses.
drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c +9 -6
@@ -5,6 +5,7 @@* Copyright (C) 2021-2023 CHIPS&MEDIA INC */ +#include <linux/delay.h> #include <linux/pm_runtime.h> #include "wave5-helper.h"
@@ -1537,15 +1538,15 @@ static void wave5_vpu_dec_stop_streaming(struct vb2_queue *q) {struct vpu_instance *inst =vb2_get_drv_priv (q);struct v4l2_m2m_ctx *m2m_ctx = inst->v4l2_fh.m2m_ctx; - -bool check_cmd = TRUE; +unsigned long timeout;dev_dbg (inst->dev->dev,"%s: type: %u\n" , __func__, q->type);pm_runtime_resume_and_get (inst->dev->dev); inst->empty_queue = true; -while (check_cmd) { + + timeout = jiffies +msecs_to_jiffies (VPU_DEC_STOP_TIMEOUT ); +while (true) {struct queue_status_info q_status; -struct dec_output_info dec_output_info;wave5_vpu_dec_give_command (inst,DEC_GET_QUEUE_STATUS , &q_status); if ((inst->state == VPU_INST_STATE_STOP ||
@@ -1554,8 +1555,10 @@ static void wave5_vpu_dec_stop_streaming(struct vb2_queue *q) q_status.report_queue_count == 0)break ; -if (wave5_vpu_dec_get_output_info (inst, &dec_output_info)) -dev_dbg (inst->dev->dev,"there is no output info\n" ); +if (time_after (jiffies, timeout)) +break ; + +usleep_range (1000 ,2000 ); }v4l2_m2m_update_stop_streaming_state (m2m_ctx, q);
drivers/media/platform/chips-media/wave5/wave5-vpuconfig.h +1 -1
@@ -59,7 +59,7 @@// application specific configuration #define VPU_ENC_TIMEOUT 60000#define VPU_DEC_TIMEOUT 60000 -#define VPU_DEC_STOP_TIMEOUT 10 +#define VPU_DEC_STOP_TIMEOUT 300// for WAVE encoder #define USE_SRC_PRP_AXI 0
Sasha Levin
maintainerPATCH 1/1 media: chips-media: wave5: Add timeout while stop_streaming
From: Jackson Lee <[email protected]>
[ Upstream commit 2ae7faed2e60d6d07d9efdd962d20dcb15330ced ]
When stop_streaming is called, an infinite loop may occur in some cases. Add a bounded poll of the queue status: loop until the queues drain, sleeping briefly between polls, and bail out once VPU_DEC_STOP_TIMEOUT elapses.
--- .../media/platform/chips-media/wave5/wave5-vpu-dec.c | 12 ++++++------ .../platform/chips-media/wave5/wave5-vpuconfig.h | 1 + 2 files changed, 7 insertions(+), 6 deletions(-)
drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c +6 -6
@@ -5,6 +5,7 @@* Copyright (C) 2021-2023 CHIPS&MEDIA INC */ +#include <linux/delay.h> #include <linux/pm_runtime.h> #include "wave5-helper.h"
@@ -1480,25 +1481,24 @@ static void wave5_vpu_dec_stop_streaming(struct vb2_queue *q) {struct vpu_instance *inst =vb2_get_drv_priv (q);struct v4l2_m2m_ctx *m2m_ctx = inst->v4l2_fh.m2m_ctx; -bool check_cmd = TRUE; +unsigned long timeout;dev_dbg (inst->dev->dev,"%s: type: %u\n" , __func__, q->type);pm_runtime_resume_and_get (inst->dev->dev); -while (check_cmd) { + timeout = jiffies +msecs_to_jiffies (VPU_DEC_STOP_TIMEOUT ); +while (true) {struct queue_status_info q_status; -struct dec_output_info dec_output_info;wave5_vpu_dec_give_command (inst,DEC_GET_QUEUE_STATUS , &q_status);if (q_status.report_queue_count ==0 )break ; -if (wave5_vpu_wait_interrupt (inst,VPU_DEC_TIMEOUT ) <0 ) +if (time_after (jiffies, timeout))break ; -if (wave5_vpu_dec_get_output_info (inst, &dec_output_info)) -dev_dbg (inst->dev->dev,"there is no output info\n" ); +usleep_range (1000 ,2000 ); }v4l2_m2m_update_stop_streaming_state (m2m_ctx, q);
drivers/media/platform/chips-media/wave5/wave5-vpuconfig.h +1 -0
@@ -59,6 +59,7 @@// application specific configuration #define VPU_ENC_TIMEOUT 60000#define VPU_DEC_TIMEOUT 60000 +#define VPU_DEC_STOP_TIMEOUT 300// for WAVE encoder #define USE_SRC_PRP_AXI 0
Signature · 1 line
2.53.0