Because info ioctl is used to retrieve data, some of its opcodes may be
used during hard reset.
Other ioctls should be blocked while device is not operational.
Signed-off-by: Dani Liberman <dliberman@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
        enum hl_cs_type cs_type;
 
        if (!hl_device_operational(hdev, &status)) {
-               dev_warn_ratelimited(hdev->dev,
-                       "Device is %s. Can't submit new CS\n",
-                       hdev->status[status]);
                return -EBUSY;
        }
 
         * user interrupt
         */
        if (!hl_device_operational(hpriv->hdev, NULL))
-               return -EPERM;
+               return -EBUSY;
 
        if (flags & HL_WAIT_CS_FLAGS_INTERRUPT)
                rc = hl_interrupt_wait_ioctl(hpriv, data);
 
                const struct hl_ioctl_desc *ioctl, struct device *dev)
 {
        struct hl_fpriv *hpriv = filep->private_data;
-       struct hl_device *hdev = hpriv->hdev;
        unsigned int nr = _IOC_NR(cmd);
        char stack_kdata[128] = {0};
        char *kdata = NULL;
        u32 hl_size;
        int retcode;
 
-       if (hdev->hard_reset_pending) {
-               dev_crit_ratelimited(dev,
-                       "Device HARD reset pending! Please close FD\n");
-               return -ENODEV;
-       }
-
        /* Do not trust userspace, use our own definition */
        func = ioctl->func;