diff options
author | Oded Gabbay <oded.gabbay@gmail.com> | 2019-03-05 13:53:22 +0200 |
---|---|---|
committer | Oded Gabbay <oded.gabbay@gmail.com> | 2019-03-05 13:53:22 +0200 |
commit | 680cb3991c9ed72cefffc49e222a8c8d34ff5e3e (patch) | |
tree | 3c2cd9f66735aa23245d975d18627ae23088dd52 /drivers/misc/habanalabs/command_submission.c | |
parent | e0a29952c52787f8e4a4fc3046f3e47916ffa239 (diff) | |
download | lwn-680cb3991c9ed72cefffc49e222a8c8d34ff5e3e.tar.gz lwn-680cb3991c9ed72cefffc49e222a8c8d34ff5e3e.zip |
habanalabs: ratelimit warnings at start of IOCTLs
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>
Diffstat (limited to 'drivers/misc/habanalabs/command_submission.c')
-rw-r--r-- | drivers/misc/habanalabs/command_submission.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/misc/habanalabs/command_submission.c b/drivers/misc/habanalabs/command_submission.c index 19c84214a7ea..f908643f871f 100644 --- a/drivers/misc/habanalabs/command_submission.c +++ b/drivers/misc/habanalabs/command_submission.c @@ -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; |