diff mbox series

[linux,dev-6.0] media: aspeed: Use v4l2_dbg to replace v4l2_warn to avoid log spam

Message ID 20230211032235.20220-1-zev@bewilderbeest.net
State New
Headers show
Series [linux,dev-6.0] media: aspeed: Use v4l2_dbg to replace v4l2_warn to avoid log spam | expand

Commit Message

Zev Weiss Feb. 11, 2023, 3:22 a.m. UTC
From: Jammy Huang <jammy_huang@aspeedtech.com>

If the host is powered off, there will be many warning log. To avoid the
log spam in this condition, replace v4l2_warn with v4l2_dbg.

Signed-off-by: Jammy Huang <jammy_huang@aspeedtech.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
(cherry picked from commit def4d25856b2fa41c1c1390f1e8d1b027166f5e9)
---

This patch eliminates a lot of needless aspeed-video log noise that
the current dev-6.0 kernel exhibits.  It's now in the mainline kernel
and should be in the 6.2 release; it'd be nice to also backport to the
OpenBMC kernel.

 drivers/media/platform/aspeed/aspeed-video.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

Comments

Joel Stanley Feb. 21, 2023, 11:24 a.m. UTC | #1
On Sat, 11 Feb 2023 at 03:22, Zev Weiss <zev@bewilderbeest.net> wrote:
>
> From: Jammy Huang <jammy_huang@aspeedtech.com>
>
> If the host is powered off, there will be many warning log. To avoid the
> log spam in this condition, replace v4l2_warn with v4l2_dbg.
>
> Signed-off-by: Jammy Huang <jammy_huang@aspeedtech.com>
> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
> (cherry picked from commit def4d25856b2fa41c1c1390f1e8d1b027166f5e9)
> ---
>
> This patch eliminates a lot of needless aspeed-video log noise that
> the current dev-6.0 kernel exhibits.  It's now in the mainline kernel
> and should be in the 6.2 release; it'd be nice to also backport to the
> OpenBMC kernel.

Good idea. We should send it to stable, assuming Sasha's bot hasn't
picked it up already.

I've applied it to dev-6.0.

>
>  drivers/media/platform/aspeed/aspeed-video.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/media/platform/aspeed/aspeed-video.c b/drivers/media/platform/aspeed/aspeed-video.c
> index 20f795ccc11b..c0cebac4b966 100644
> --- a/drivers/media/platform/aspeed/aspeed-video.c
> +++ b/drivers/media/platform/aspeed/aspeed-video.c
> @@ -549,13 +549,13 @@ static int aspeed_video_start_frame(struct aspeed_video *video)
>         u32 seq_ctrl = aspeed_video_read(video, VE_SEQ_CTRL);
>
>         if (video->v4l2_input_status) {
> -               v4l2_warn(&video->v4l2_dev, "No signal; don't start frame\n");
> +               v4l2_dbg(1, debug, &video->v4l2_dev, "No signal; don't start frame\n");
>                 return 0;
>         }
>
>         if (!(seq_ctrl & VE_SEQ_CTRL_COMP_BUSY) ||
>             !(seq_ctrl & VE_SEQ_CTRL_CAP_BUSY)) {
> -               v4l2_warn(&video->v4l2_dev, "Engine busy; don't start frame\n");
> +               v4l2_dbg(1, debug, &video->v4l2_dev, "Engine busy; don't start frame\n");
>                 return -EBUSY;
>         }
>
> @@ -564,7 +564,7 @@ static int aspeed_video_start_frame(struct aspeed_video *video)
>                                        struct aspeed_video_buffer, link);
>         if (!buf) {
>                 spin_unlock_irqrestore(&video->lock, flags);
> -               v4l2_warn(&video->v4l2_dev, "No buffers; don't start frame\n");
> +               v4l2_dbg(1, debug, &video->v4l2_dev, "No buffers; don't start frame\n");
>                 return -EPROTO;
>         }
>
> @@ -977,7 +977,7 @@ static void aspeed_video_get_resolution(struct aspeed_video *video)
>                                                       res_check(video),
>                                                       MODE_DETECT_TIMEOUT);
>                 if (!rc) {
> -                       v4l2_warn(&video->v4l2_dev, "Timed out; first mode detect\n");
> +                       v4l2_dbg(1, debug, &video->v4l2_dev, "Timed out; first mode detect\n");
>                         clear_bit(VIDEO_RES_DETECT, &video->flags);
>                         return;
>                 }
> @@ -998,7 +998,7 @@ static void aspeed_video_get_resolution(struct aspeed_video *video)
>                                                       MODE_DETECT_TIMEOUT);
>                 clear_bit(VIDEO_RES_DETECT, &video->flags);
>                 if (!rc) {
> -                       v4l2_warn(&video->v4l2_dev, "Timed out; second mode detect\n");
> +                       v4l2_dbg(1, debug, &video->v4l2_dev, "Timed out; second mode detect\n");
>                         return;
>                 }
>
> @@ -1021,7 +1021,7 @@ static void aspeed_video_get_resolution(struct aspeed_video *video)
>         } while (invalid_resolution && (tries++ < INVALID_RESOLUTION_RETRIES));
>
>         if (invalid_resolution) {
> -               v4l2_warn(&video->v4l2_dev, "Invalid resolution detected\n");
> +               v4l2_dbg(1, debug, &video->v4l2_dev, "Invalid resolution detected\n");
>                 return;
>         }
>
> @@ -1683,7 +1683,7 @@ static void aspeed_video_stop_streaming(struct vb2_queue *q)
>                                 !test_bit(VIDEO_FRAME_INPRG, &video->flags),
>                                 STOP_TIMEOUT);
>         if (!rc) {
> -               v4l2_warn(&video->v4l2_dev, "Timed out when stopping streaming\n");
> +               v4l2_dbg(1, debug, &video->v4l2_dev, "Timed out when stopping streaming\n");
>
>                 /*
>                  * Need to force stop any DMA and try and get HW into a good
> --
> 2.39.1
>
diff mbox series

Patch

diff --git a/drivers/media/platform/aspeed/aspeed-video.c b/drivers/media/platform/aspeed/aspeed-video.c
index 20f795ccc11b..c0cebac4b966 100644
--- a/drivers/media/platform/aspeed/aspeed-video.c
+++ b/drivers/media/platform/aspeed/aspeed-video.c
@@ -549,13 +549,13 @@  static int aspeed_video_start_frame(struct aspeed_video *video)
 	u32 seq_ctrl = aspeed_video_read(video, VE_SEQ_CTRL);
 
 	if (video->v4l2_input_status) {
-		v4l2_warn(&video->v4l2_dev, "No signal; don't start frame\n");
+		v4l2_dbg(1, debug, &video->v4l2_dev, "No signal; don't start frame\n");
 		return 0;
 	}
 
 	if (!(seq_ctrl & VE_SEQ_CTRL_COMP_BUSY) ||
 	    !(seq_ctrl & VE_SEQ_CTRL_CAP_BUSY)) {
-		v4l2_warn(&video->v4l2_dev, "Engine busy; don't start frame\n");
+		v4l2_dbg(1, debug, &video->v4l2_dev, "Engine busy; don't start frame\n");
 		return -EBUSY;
 	}
 
@@ -564,7 +564,7 @@  static int aspeed_video_start_frame(struct aspeed_video *video)
 				       struct aspeed_video_buffer, link);
 	if (!buf) {
 		spin_unlock_irqrestore(&video->lock, flags);
-		v4l2_warn(&video->v4l2_dev, "No buffers; don't start frame\n");
+		v4l2_dbg(1, debug, &video->v4l2_dev, "No buffers; don't start frame\n");
 		return -EPROTO;
 	}
 
@@ -977,7 +977,7 @@  static void aspeed_video_get_resolution(struct aspeed_video *video)
 						      res_check(video),
 						      MODE_DETECT_TIMEOUT);
 		if (!rc) {
-			v4l2_warn(&video->v4l2_dev, "Timed out; first mode detect\n");
+			v4l2_dbg(1, debug, &video->v4l2_dev, "Timed out; first mode detect\n");
 			clear_bit(VIDEO_RES_DETECT, &video->flags);
 			return;
 		}
@@ -998,7 +998,7 @@  static void aspeed_video_get_resolution(struct aspeed_video *video)
 						      MODE_DETECT_TIMEOUT);
 		clear_bit(VIDEO_RES_DETECT, &video->flags);
 		if (!rc) {
-			v4l2_warn(&video->v4l2_dev, "Timed out; second mode detect\n");
+			v4l2_dbg(1, debug, &video->v4l2_dev, "Timed out; second mode detect\n");
 			return;
 		}
 
@@ -1021,7 +1021,7 @@  static void aspeed_video_get_resolution(struct aspeed_video *video)
 	} while (invalid_resolution && (tries++ < INVALID_RESOLUTION_RETRIES));
 
 	if (invalid_resolution) {
-		v4l2_warn(&video->v4l2_dev, "Invalid resolution detected\n");
+		v4l2_dbg(1, debug, &video->v4l2_dev, "Invalid resolution detected\n");
 		return;
 	}
 
@@ -1683,7 +1683,7 @@  static void aspeed_video_stop_streaming(struct vb2_queue *q)
 				!test_bit(VIDEO_FRAME_INPRG, &video->flags),
 				STOP_TIMEOUT);
 	if (!rc) {
-		v4l2_warn(&video->v4l2_dev, "Timed out when stopping streaming\n");
+		v4l2_dbg(1, debug, &video->v4l2_dev, "Timed out when stopping streaming\n");
 
 		/*
 		 * Need to force stop any DMA and try and get HW into a good