habanalabs: rate limit multi CS completion errors
authorOfir Bitton <obitton@habana.ai>
Thu, 9 Sep 2021 06:56:37 +0000 (09:56 +0300)
committerOded Gabbay <ogabbay@kernel.org>
Tue, 14 Sep 2021 12:00:04 +0000 (15:00 +0300)
As user can send wrong arguments to multi CS API, we rate limit
the amount of errors dumped to dmesg, in addition we change the
severity to warning.

Signed-off-by: Ofir Bitton <obitton@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
drivers/misc/habanalabs/common/command_submission.c

index 5b7de85..a4ed91e 100644 (file)
@@ -2630,7 +2630,8 @@ static int hl_multi_cs_wait_ioctl(struct hl_fpriv *hpriv, void *data)
                 * completed after the poll function.
                 */
                if (!mcs_data.completion_bitmap) {
-                       dev_err(hdev->dev, "Multi-CS got completion on wait but no CS completed\n");
+                       dev_warn_ratelimited(hdev->dev,
+                               "Multi-CS got completion on wait but no CS completed\n");
                        rc = -EFAULT;
                }
        }