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>
bool need_soft_reset = false;
if (hl_device_disabled_or_in_reset(hdev)) {
bool need_soft_reset = false;
if (hl_device_disabled_or_in_reset(hdev)) {
+ dev_warn_ratelimited(hdev->dev,
"Device is %s. Can't submit new CS\n",
atomic_read(&hdev->in_reset) ? "in_reset" : "disabled");
rc = -EBUSY;
"Device is %s. Can't submit new CS\n",
atomic_read(&hdev->in_reset) ? "in_reset" : "disabled");
rc = -EBUSY;
int rc;
if (hl_device_disabled_or_in_reset(hdev)) {
int rc;
if (hl_device_disabled_or_in_reset(hdev)) {
+ dev_warn_ratelimited(hdev->dev,
"Device is disabled or in reset. Can't execute INFO IOCTL\n");
return -EBUSY;
}
"Device is disabled or in reset. Can't execute INFO IOCTL\n");
return -EBUSY;
}