All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] video: hyperv_fb: Add ratelimit on error message
@ 2021-04-20 15:44 ` Michael Kelley
  0 siblings, 0 replies; 8+ messages in thread
From: Michael Kelley @ 2021-04-20 15:44 UTC (permalink / raw)
  To: kys, haiyangz, sthemmin, wei.liu, linux-kernel, linux-hyperv,
	linux-fbdev, dri-devel
  Cc: mikelley

Due to a full ring buffer, the driver may be unable to send updates to
the Hyper-V host.  But outputing the error message can make the problem
worse because console output is also typically written to the frame
buffer.  As a result, in some circumstances the error message is output
continuously.

Break the cycle by rate limiting the error message.  Also output
the error code for additional diagnosability.

Signed-off-by: Michael Kelley <mikelley@microsoft.com>
---
 drivers/video/fbdev/hyperv_fb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/hyperv_fb.c b/drivers/video/fbdev/hyperv_fb.c
index 4dc9077..a7e6eea 100644
--- a/drivers/video/fbdev/hyperv_fb.c
+++ b/drivers/video/fbdev/hyperv_fb.c
@@ -308,7 +308,7 @@ static inline int synthvid_send(struct hv_device *hdev,
 			       VM_PKT_DATA_INBAND, 0);
 
 	if (ret)
-		pr_err("Unable to send packet via vmbus\n");
+		pr_err_ratelimited("Unable to send packet via vmbus; error %d\n", ret);
 
 	return ret;
 }
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 1/1] video: hyperv_fb: Add ratelimit on error message
@ 2021-04-20 15:44 ` Michael Kelley
  0 siblings, 0 replies; 8+ messages in thread
From: Michael Kelley @ 2021-04-20 15:44 UTC (permalink / raw)
  To: kys, haiyangz, sthemmin, wei.liu, linux-kernel, linux-hyperv,
	linux-fbdev, dri-devel
  Cc: mikelley

Due to a full ring buffer, the driver may be unable to send updates to
the Hyper-V host.  But outputing the error message can make the problem
worse because console output is also typically written to the frame
buffer.  As a result, in some circumstances the error message is output
continuously.

Break the cycle by rate limiting the error message.  Also output
the error code for additional diagnosability.

Signed-off-by: Michael Kelley <mikelley@microsoft.com>
---
 drivers/video/fbdev/hyperv_fb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/hyperv_fb.c b/drivers/video/fbdev/hyperv_fb.c
index 4dc9077..a7e6eea 100644
--- a/drivers/video/fbdev/hyperv_fb.c
+++ b/drivers/video/fbdev/hyperv_fb.c
@@ -308,7 +308,7 @@ static inline int synthvid_send(struct hv_device *hdev,
 			       VM_PKT_DATA_INBAND, 0);
 
 	if (ret)
-		pr_err("Unable to send packet via vmbus\n");
+		pr_err_ratelimited("Unable to send packet via vmbus; error %d\n", ret);
 
 	return ret;
 }
-- 
1.8.3.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/1] video: hyperv_fb: Add ratelimit on error message
  2021-04-20 15:44 ` Michael Kelley
@ 2021-04-20 19:48   ` Wei Liu
  -1 siblings, 0 replies; 8+ messages in thread
From: Wei Liu @ 2021-04-20 19:48 UTC (permalink / raw)
  To: Michael Kelley
  Cc: kys, haiyangz, sthemmin, wei.liu, linux-kernel, linux-hyperv,
	linux-fbdev, dri-devel

On Tue, Apr 20, 2021 at 08:44:19AM -0700, Michael Kelley wrote:
> Due to a full ring buffer, the driver may be unable to send updates to
> the Hyper-V host.  But outputing the error message can make the problem
> worse because console output is also typically written to the frame
> buffer.  As a result, in some circumstances the error message is output
> continuously.
> 
> Break the cycle by rate limiting the error message.  Also output
> the error code for additional diagnosability.
> 
> Signed-off-by: Michael Kelley <mikelley@microsoft.com>

Applied to hyperv-next. Thanks.

> ---
>  drivers/video/fbdev/hyperv_fb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/video/fbdev/hyperv_fb.c b/drivers/video/fbdev/hyperv_fb.c
> index 4dc9077..a7e6eea 100644
> --- a/drivers/video/fbdev/hyperv_fb.c
> +++ b/drivers/video/fbdev/hyperv_fb.c
> @@ -308,7 +308,7 @@ static inline int synthvid_send(struct hv_device *hdev,
>  			       VM_PKT_DATA_INBAND, 0);
>  
>  	if (ret)
> -		pr_err("Unable to send packet via vmbus\n");
> +		pr_err_ratelimited("Unable to send packet via vmbus; error %d\n", ret);
>  
>  	return ret;
>  }
> -- 
> 1.8.3.1
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/1] video: hyperv_fb: Add ratelimit on error message
@ 2021-04-20 19:48   ` Wei Liu
  0 siblings, 0 replies; 8+ messages in thread
From: Wei Liu @ 2021-04-20 19:48 UTC (permalink / raw)
  To: Michael Kelley
  Cc: wei.liu, sthemmin, haiyangz, linux-hyperv, dri-devel,
	linux-kernel, linux-fbdev, kys

On Tue, Apr 20, 2021 at 08:44:19AM -0700, Michael Kelley wrote:
> Due to a full ring buffer, the driver may be unable to send updates to
> the Hyper-V host.  But outputing the error message can make the problem
> worse because console output is also typically written to the frame
> buffer.  As a result, in some circumstances the error message is output
> continuously.
> 
> Break the cycle by rate limiting the error message.  Also output
> the error code for additional diagnosability.
> 
> Signed-off-by: Michael Kelley <mikelley@microsoft.com>

Applied to hyperv-next. Thanks.

> ---
>  drivers/video/fbdev/hyperv_fb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/video/fbdev/hyperv_fb.c b/drivers/video/fbdev/hyperv_fb.c
> index 4dc9077..a7e6eea 100644
> --- a/drivers/video/fbdev/hyperv_fb.c
> +++ b/drivers/video/fbdev/hyperv_fb.c
> @@ -308,7 +308,7 @@ static inline int synthvid_send(struct hv_device *hdev,
>  			       VM_PKT_DATA_INBAND, 0);
>  
>  	if (ret)
> -		pr_err("Unable to send packet via vmbus\n");
> +		pr_err_ratelimited("Unable to send packet via vmbus; error %d\n", ret);
>  
>  	return ret;
>  }
> -- 
> 1.8.3.1
> 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/1] video: hyperv_fb: Add ratelimit on error message
  2021-04-20 15:44 ` Michael Kelley
@ 2021-04-20 19:58   ` Joe Perches
  -1 siblings, 0 replies; 8+ messages in thread
From: Joe Perches @ 2021-04-20 19:58 UTC (permalink / raw)
  To: Michael Kelley, kys, haiyangz, sthemmin, wei.liu, linux-kernel,
	linux-hyperv, linux-fbdev, dri-devel

On Tue, 2021-04-20 at 08:44 -0700, Michael Kelley wrote:
> Due to a full ring buffer, the driver may be unable to send updates to
> the Hyper-V host.  But outputing the error message can make the problem
> worse because console output is also typically written to the frame
> buffer.  As a result, in some circumstances the error message is output
> continuously.
> 
> Break the cycle by rate limiting the error message.  Also output
> the error code for additional diagnosability.
> 
> Signed-off-by: Michael Kelley <mikelley@microsoft.com>

None of the callers of this function ever check the return status.
Why is important/useful to emit this message at all?

> ---
>  drivers/video/fbdev/hyperv_fb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/video/fbdev/hyperv_fb.c b/drivers/video/fbdev/hyperv_fb.c
> index 4dc9077..a7e6eea 100644
> --- a/drivers/video/fbdev/hyperv_fb.c
> +++ b/drivers/video/fbdev/hyperv_fb.c
> @@ -308,7 +308,7 @@ static inline int synthvid_send(struct hv_device *hdev,
>  			       VM_PKT_DATA_INBAND, 0);
>  
> 
>  	if (ret)
> -		pr_err("Unable to send packet via vmbus\n");
> +		pr_err_ratelimited("Unable to send packet via vmbus; error %d\n", ret);
>  
> 
>  	return ret;
>  }



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/1] video: hyperv_fb: Add ratelimit on error message
@ 2021-04-20 19:58   ` Joe Perches
  0 siblings, 0 replies; 8+ messages in thread
From: Joe Perches @ 2021-04-20 19:58 UTC (permalink / raw)
  To: Michael Kelley, kys, haiyangz, sthemmin, wei.liu, linux-kernel,
	linux-hyperv, linux-fbdev, dri-devel

On Tue, 2021-04-20 at 08:44 -0700, Michael Kelley wrote:
> Due to a full ring buffer, the driver may be unable to send updates to
> the Hyper-V host.  But outputing the error message can make the problem
> worse because console output is also typically written to the frame
> buffer.  As a result, in some circumstances the error message is output
> continuously.
> 
> Break the cycle by rate limiting the error message.  Also output
> the error code for additional diagnosability.
> 
> Signed-off-by: Michael Kelley <mikelley@microsoft.com>

None of the callers of this function ever check the return status.
Why is important/useful to emit this message at all?

> ---
>  drivers/video/fbdev/hyperv_fb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/video/fbdev/hyperv_fb.c b/drivers/video/fbdev/hyperv_fb.c
> index 4dc9077..a7e6eea 100644
> --- a/drivers/video/fbdev/hyperv_fb.c
> +++ b/drivers/video/fbdev/hyperv_fb.c
> @@ -308,7 +308,7 @@ static inline int synthvid_send(struct hv_device *hdev,
>  			       VM_PKT_DATA_INBAND, 0);
>  
> 
>  	if (ret)
> -		pr_err("Unable to send packet via vmbus\n");
> +		pr_err_ratelimited("Unable to send packet via vmbus; error %d\n", ret);
>  
> 
>  	return ret;
>  }


_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH 1/1] video: hyperv_fb: Add ratelimit on error message
  2021-04-20 19:58   ` Joe Perches
@ 2021-04-21 15:27     ` Michael Kelley
  -1 siblings, 0 replies; 8+ messages in thread
From: Michael Kelley @ 2021-04-21 15:27 UTC (permalink / raw)
  To: Joe Perches, KY Srinivasan, Haiyang Zhang, Stephen Hemminger,
	wei.liu, linux-kernel, linux-hyperv, linux-fbdev, dri-devel

From: Joe Perches <joe@perches.com> Sent: Tuesday, April 20, 2021 12:59 PM
> 
> On Tue, 2021-04-20 at 08:44 -0700, Michael Kelley wrote:
> > Due to a full ring buffer, the driver may be unable to send updates to
> > the Hyper-V host.  But outputing the error message can make the problem
> > worse because console output is also typically written to the frame
> > buffer.  As a result, in some circumstances the error message is output
> > continuously.
> >
> > Break the cycle by rate limiting the error message.  Also output
> > the error code for additional diagnosability.
> >
> > Signed-off-by: Michael Kelley <mikelley@microsoft.com>
> 
> None of the callers of this function ever check the return status.
> Why is important/useful to emit this message at all?
>

Except during device initialization, the messages tell Hyper-V
about updates to the frame buffer contents.  The fbdev
framework functions (such as fillrect) that eventually call synthvid_send()
are void functions.   So the message is the only alert that something
has gone wrong in the communication with Hyper-V, which makes
it useful for diagnostic purposes.

Michael

 
> > ---
> >  drivers/video/fbdev/hyperv_fb.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/video/fbdev/hyperv_fb.c b/drivers/video/fbdev/hyperv_fb.c
> > index 4dc9077..a7e6eea 100644
> > --- a/drivers/video/fbdev/hyperv_fb.c
> > +++ b/drivers/video/fbdev/hyperv_fb.c
> > @@ -308,7 +308,7 @@ static inline int synthvid_send(struct hv_device *hdev,
> >  			       VM_PKT_DATA_INBAND, 0);
> >
> >
> >  	if (ret)
> > -		pr_err("Unable to send packet via vmbus\n");
> > +		pr_err_ratelimited("Unable to send packet via vmbus; error %d\n", ret);
> >
> >
> >  	return ret;
> >  }
> 


^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH 1/1] video: hyperv_fb: Add ratelimit on error message
@ 2021-04-21 15:27     ` Michael Kelley
  0 siblings, 0 replies; 8+ messages in thread
From: Michael Kelley @ 2021-04-21 15:27 UTC (permalink / raw)
  To: Joe Perches, KY Srinivasan, Haiyang Zhang, Stephen Hemminger,
	wei.liu, linux-kernel, linux-hyperv, linux-fbdev, dri-devel

From: Joe Perches <joe@perches.com> Sent: Tuesday, April 20, 2021 12:59 PM
> 
> On Tue, 2021-04-20 at 08:44 -0700, Michael Kelley wrote:
> > Due to a full ring buffer, the driver may be unable to send updates to
> > the Hyper-V host.  But outputing the error message can make the problem
> > worse because console output is also typically written to the frame
> > buffer.  As a result, in some circumstances the error message is output
> > continuously.
> >
> > Break the cycle by rate limiting the error message.  Also output
> > the error code for additional diagnosability.
> >
> > Signed-off-by: Michael Kelley <mikelley@microsoft.com>
> 
> None of the callers of this function ever check the return status.
> Why is important/useful to emit this message at all?
>

Except during device initialization, the messages tell Hyper-V
about updates to the frame buffer contents.  The fbdev
framework functions (such as fillrect) that eventually call synthvid_send()
are void functions.   So the message is the only alert that something
has gone wrong in the communication with Hyper-V, which makes
it useful for diagnostic purposes.

Michael

 
> > ---
> >  drivers/video/fbdev/hyperv_fb.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/video/fbdev/hyperv_fb.c b/drivers/video/fbdev/hyperv_fb.c
> > index 4dc9077..a7e6eea 100644
> > --- a/drivers/video/fbdev/hyperv_fb.c
> > +++ b/drivers/video/fbdev/hyperv_fb.c
> > @@ -308,7 +308,7 @@ static inline int synthvid_send(struct hv_device *hdev,
> >  			       VM_PKT_DATA_INBAND, 0);
> >
> >
> >  	if (ret)
> > -		pr_err("Unable to send packet via vmbus\n");
> > +		pr_err_ratelimited("Unable to send packet via vmbus; error %d\n", ret);
> >
> >
> >  	return ret;
> >  }
> 

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-04-21 15:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-20 15:44 [PATCH 1/1] video: hyperv_fb: Add ratelimit on error message Michael Kelley
2021-04-20 15:44 ` Michael Kelley
2021-04-20 19:48 ` Wei Liu
2021-04-20 19:48   ` Wei Liu
2021-04-20 19:58 ` Joe Perches
2021-04-20 19:58   ` Joe Perches
2021-04-21 15:27   ` Michael Kelley
2021-04-21 15:27     ` Michael Kelley

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.