This is an automatic generated email to let you know that the following patch 
were queued:

Subject: media: ivtv: don't call s_stream(0) if not streaming
Author:  Hans Verkuil <hverkuil-ci...@xs4all.nl>
Date:    Thu Nov 2 15:04:05 2023 +0100

Recently a WARN_ON was added in v4l2-subdev.c to warn if s_stream was
called unnecessarily. The ivtv driver hits this once when it is loaded for
the first time. Add a bool to avoid this warning.

[hverkuil: added a comment for the sd_video_is_streaming field]

Signed-off-by: Hans Verkuil <hverkuil-ci...@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mche...@kernel.org>

 drivers/media/pci/ivtv/ivtv-driver.h  | 1 +
 drivers/media/pci/ivtv/ivtv-streams.c | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

---

diff --git a/drivers/media/pci/ivtv/ivtv-driver.h 
b/drivers/media/pci/ivtv/ivtv-driver.h
index ce3a7ca51736..a6ffa99e16bc 100644
--- a/drivers/media/pci/ivtv/ivtv-driver.h
+++ b/drivers/media/pci/ivtv/ivtv-driver.h
@@ -619,6 +619,7 @@ struct ivtv {
        u32 hw_flags;                   /* hardware description of the board */
        v4l2_std_id tuner_std;          /* the norm of the card's tuner (fixed) 
*/
        struct v4l2_subdev *sd_video;   /* controlling video decoder subdev */
+       bool sd_video_is_streaming;     /* is video already streaming? */
        struct v4l2_subdev *sd_audio;   /* controlling audio subdev */
        struct v4l2_subdev *sd_muxer;   /* controlling audio muxer subdev */
        resource_size_t base_addr;      /* PCI resource base address */
diff --git a/drivers/media/pci/ivtv/ivtv-streams.c 
b/drivers/media/pci/ivtv/ivtv-streams.c
index 13d7d55e6594..af9e6235c74d 100644
--- a/drivers/media/pci/ivtv/ivtv-streams.c
+++ b/drivers/media/pci/ivtv/ivtv-streams.c
@@ -623,10 +623,12 @@ int ivtv_start_v4l2_encode_stream(struct ivtv_stream *s)
                /* Avoid tinny audio problem - ensure audio clocks are going */
                v4l2_subdev_call(itv->sd_audio, audio, s_stream, 1);
                /* Avoid unpredictable PCI bus hang - disable video clocks */
-               v4l2_subdev_call(itv->sd_video, video, s_stream, 0);
+               if (itv->sd_video_is_streaming)
+                       v4l2_subdev_call(itv->sd_video, video, s_stream, 0);
                ivtv_msleep_timeout(300, 0);
                ivtv_vapi(itv, CX2341X_ENC_INITIALIZE_INPUT, 0);
                v4l2_subdev_call(itv->sd_video, video, s_stream, 1);
+               itv->sd_video_is_streaming = true;
        }
 
        /* begin_capture */

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to