]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
habanalabs: ratelimit warnings at start of IOCTLs
authorOded Gabbay <oded.gabbay@gmail.com>
Tue, 5 Mar 2019 11:53:22 +0000 (13:53 +0200)
committerOded Gabbay <oded.gabbay@gmail.com>
Tue, 5 Mar 2019 11:53:22 +0000 (13:53 +0200)
At the start of some IOCTLs we check if the device is disabled or in reset.
If it is, we return -EBUSY and print a message to kernel log.

Because these IOCTLs can be called at very high frequency, use ratelimit
to avoid spamming the kernel log. Also use the same type of message -
dev_warn - in all the relevant IOCTLs.

Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
drivers/misc/habanalabs/command_submission.c
drivers/misc/habanalabs/habanalabs_ioctl.c

index 19c84214a7ea8890543ea8341033ed1ceb89df12..f908643f871fae84efb3a30ec6345ede71d815f6 100644 (file)
@@ -604,7 +604,7 @@ int hl_cs_ioctl(struct hl_fpriv *hpriv, void *data)
        bool need_soft_reset = false;
 
        if (hl_device_disabled_or_in_reset(hdev)) {
-               dev_warn(hdev->dev,
+               dev_warn_ratelimited(hdev->dev,
                        "Device is %s. Can't submit new CS\n",
                        atomic_read(&hdev->in_reset) ? "in_reset" : "disabled");
                rc = -EBUSY;
index 2c2739a3c5ec7ce3c3b415a25675b13310670bfa..19b96afc030830f69f10385ac5b589558a3c9d96 100644 (file)
@@ -106,7 +106,7 @@ static int hl_info_ioctl(struct hl_fpriv *hpriv, void *data)
        int rc;
 
        if (hl_device_disabled_or_in_reset(hdev)) {
-               dev_err(hdev->dev,
+               dev_warn_ratelimited(hdev->dev,
                        "Device is disabled or in reset. Can't execute INFO IOCTL\n");
                return -EBUSY;
        }