Olaf Hering f6806d
From: Michael Kelley <mikelley@microsoft.com>
Olaf Hering f6806d
Date: Tue, 20 Apr 2021 08:44:19 -0700
Olaf Hering f6806d
Patch-mainline: v5.13-rc1
Olaf Hering f6806d
Subject: video: hyperv_fb: Add ratelimit on error message
Olaf Hering f6806d
Git-commit: aa5b7d11c7cb87c266d705b237368985e7171958
Olaf Hering f6806d
References: bsc#1185724
Olaf Hering f6806d
Olaf Hering f6806d
Due to a full ring buffer, the driver may be unable to send updates to
Olaf Hering f6806d
the Hyper-V host.  But outputing the error message can make the problem
Olaf Hering f6806d
worse because console output is also typically written to the frame
Olaf Hering f6806d
buffer.  As a result, in some circumstances the error message is output
Olaf Hering f6806d
continuously.
Olaf Hering f6806d
Olaf Hering f6806d
Break the cycle by rate limiting the error message.  Also output
Olaf Hering f6806d
the error code for additional diagnosability.
Olaf Hering f6806d
Olaf Hering f6806d
Signed-off-by: Michael Kelley <mikelley@microsoft.com>
Olaf Hering f6806d
Link: https://lore.kernel.org/r/1618933459-10585-1-git-send-email-mikelley@microsoft.com
Olaf Hering f6806d
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Olaf Hering f6806d
Acked-by: Olaf Hering <ohering@suse.de>
Olaf Hering f6806d
---
Olaf Hering f6806d
 drivers/video/fbdev/hyperv_fb.c | 2 +-
Olaf Hering f6806d
 1 file changed, 1 insertion(+), 1 deletion(-)
Olaf Hering f6806d
Olaf Hering f6806d
diff --git a/drivers/video/fbdev/hyperv_fb.c b/drivers/video/fbdev/hyperv_fb.c
Olaf Hering f6806d
--- a/drivers/video/fbdev/hyperv_fb.c
Olaf Hering f6806d
+++ b/drivers/video/fbdev/hyperv_fb.c
Olaf Hering f6806d
@@ -308,7 +308,7 @@ static inline int synthvid_send(struct hv_device *hdev,
Olaf Hering f6806d
 			       VM_PKT_DATA_INBAND, 0);
Olaf Hering f6806d
 
Olaf Hering f6806d
 	if (ret)
Olaf Hering f6806d
-		pr_err("Unable to send packet via vmbus\n");
Olaf Hering f6806d
+		pr_err_ratelimited("Unable to send packet via vmbus; error %d\n", ret);
Olaf Hering f6806d
 
Olaf Hering f6806d
 	return ret;
Olaf Hering f6806d
 }