[PATCH] drm/hyperv: Add ratelimit on error message
Thomas Zimmermann
tzimmermann at suse.de
Sat Sep 10 18:06:05 UTC 2022
Hi
Am 09.09.22 um 17:09 schrieb Saurabh Sengar:
> 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.
> Rate limiting the error message, also output the error code for additional
> diagnosability.
>
> Signed-off-by: Saurabh Sengar <ssengar at linux.microsoft.com>
> ---
> drivers/gpu/drm/hyperv/hyperv_drm_proto.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/hyperv/hyperv_drm_proto.c b/drivers/gpu/drm/hyperv/hyperv_drm_proto.c
> index 76a182a..013a782 100644
> --- a/drivers/gpu/drm/hyperv/hyperv_drm_proto.c
> +++ b/drivers/gpu/drm/hyperv/hyperv_drm_proto.c
> @@ -208,7 +208,7 @@ static inline int hyperv_sendpacket(struct hv_device *hdev, struct synthvid_msg
> VM_PKT_DATA_INBAND, 0);
>
> if (ret)
> - drm_err(&hv->dev, "Unable to send packet via vmbus\n");
> + drm_err_ratelimited(&hv->dev, "Unable to send packet via vmbus; error %d\n", ret);
I better option would probably be drm_err_once(). Then you'd get the
first error message and skip all others.
Best regards
Thomas
>
> return ret;
> }
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20220910/7f21f34d/attachment.sig>
More information about the dri-devel
mailing list