Skip to contentSkip to conversation

video: hyperv_fb: Add ratelimit on error message

PATCH Applied Michael Kelley 3 participants 4 messages Apr 20, 2021 – Apr 21, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 video: hyperv_fb: Add ratelimit on error message

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.

---
 drivers/video/fbdev/hyperv_fb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/fbdev/hyperv_fb.c +1 -1
index 4dc9077..a7e6eea 100644
@@ -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;
 }
Signature · 1 line
1.8.3.1
maintainer Applied
#1 lore raw
Quoted 10 lines · Michael Kelley

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.

Applied to hyperv-next. Thanks.

Quoted 20 lines
---
 drivers/video/fbdev/hyperv_fb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/fbdev/hyperv_fb.c +1 -1
index 4dc9077..a7e6eea 100644
@@ -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;
 }
Signature · 1 line
1.8.3.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw
In reply to Michael Kelley
Quoted 10 lines · Michael Kelley

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.

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

Quoted 17 lines

---
 drivers/video/fbdev/hyperv_fb.c | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/fbdev/hyperv_fb.c +0 -0
index 4dc9077..a7e6eea 100644
@@ -308,7 +308,7 @@ static inline int synthvid_send(struct hv_device *hdev,
  			       VM_PKT_DATA_INBAND, 0);

  if (ret)

drivers/video/fbdev/hyperv_fb.c +1 -1
-		pr_err("Unable to send packet via vmbus\n");
+		pr_err_ratelimited("Unable to send packet via vmbus; error %d\n", ret);

Quoted 2 lines

  return ret;
 }

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw

From: Joe Perches <[email protected]> Sent: Tuesday, April 20, 2021 12:59 PM

Quoted 8 lines · Michael Kelley
Quoted 6 lines

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.

Quoted 8 lines
Quoted 4 lines

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

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

Quoted 12 lines
Quoted 12 lines

---
 drivers/video/fbdev/hyperv_fb.c | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/fbdev/hyperv_fb.c +0 -0
index 4dc9077..a7e6eea 100644
@@ -308,7 +308,7 @@ static inline int synthvid_send(struct hv_device *hdev,
  			       VM_PKT_DATA_INBAND, 0);
 
 
Quoted 8 lines
Quoted 7 lines
drivers/video/fbdev/hyperv_fb.c +1 -1
  	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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel