From: Michael Kelley <hidden> Date: 2021-04-20 15:44:59
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 <redacted>
---
drivers/video/fbdev/hyperv_fb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -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);returnret;}
From: Wei Liu <wei.liu@kernel.org> Date: 2021-04-20 19:48:58
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 <redacted>
@@ -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);returnret;}
From: Joe Perches <joe@perches.com> Date: 2021-04-20 19:58:59
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 <redacted>
None of the callers of this function ever check the return status.
Why is important/useful to emit this message at all?
@@ -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;
}
From: Michael Kelley <hidden> Date: 2021-04-21 15:27:31
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:
quoted
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 <redacted>
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
@@ -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;
}