linux/drivers/misc/habanalabs
Oded Gabbay 3f5398cfbf habanalabs: improve IOCTLs behavior when disabled or reset
This patch makes some improvement in how IOCTLs behave when the device is
disabled or under reset.

The new code checks, at the start of every IOCTL, if the device is
disabled or in reset. If so, it prints an appropriate kernel message and
returns -EBUSY to user-space.

In addition, the code modifies the location of where the
hard_reset_pending flag is being set or cleared:

1. It is now cleared immediately after the reset *tear-down* flow is
   finished but before the re-initialization flow begins.

2. It is being set in the remove function of the device, to make the
   behavior the same with the hard-reset flow

There are two exceptions to the disable or in reset check:

1. The HL_INFO_DEVICE_STATUS opcode in the INFO IOCTL. This opcode allows
   the user to inquire about the status of the device, whether it is
   operational, in reset or malfunction (disabled). If the driver will
   block this IOCTL, the user won't be able to retrieve the status in
   case of malfunction or in reset.

2. The WAIT_FOR_CS IOCTL. This IOCTL allows the user to inquire about the
   status of a CS. We want to allow the user to continue to do so, even if
   we started a soft-reset process because it will allow the user to get
   the correct error code for each CS he submitted.

Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
2019-04-06 15:41:35 +03:00
..
goya habanalabs: refactoring in goya.c 2019-04-02 15:56:16 +03:00
include habanalabs: add goya implementation for debug configuration 2019-04-01 22:23:02 +03:00
asid.c habanalabs: add context and ASID modules 2019-02-18 09:46:44 +01:00
command_buffer.c habanalabs: improve IOCTLs behavior when disabled or reset 2019-04-06 15:41:35 +03:00
command_submission.c habanalabs: improve error messages 2019-03-27 09:44:28 +02:00
context.c habanalabs: add virtual memory and MMU modules 2019-02-18 09:46:46 +01:00
debugfs.c habanalabs: Allow accessing DRAM virtual addresses via debugfs 2019-03-12 13:53:17 +02:00
device.c habanalabs: improve IOCTLs behavior when disabled or reset 2019-04-06 15:41:35 +03:00
firmware_if.c habanalabs: Move device CPU code into common file 2019-03-04 10:22:09 +02:00
habanalabs_drv.c habanalabs: ASIC_AUTO_DETECT enum value is redundant 2019-04-04 14:33:34 +03:00
habanalabs_ioctl.c habanalabs: improve IOCTLs behavior when disabled or reset 2019-04-06 15:41:35 +03:00
habanalabs.h habanalabs: ASIC_AUTO_DETECT enum value is redundant 2019-04-04 14:33:34 +03:00
hw_queue.c habanalabs: perform accounting for active CS 2019-03-03 15:13:15 +02:00
hwmon.c habanalabs: fix little-endian<->cpu conversion warnings 2019-02-28 13:07:52 +01:00
irq.c habanalabs: fix little-endian<->cpu conversion warnings 2019-02-28 13:07:52 +01:00
Kconfig habanalabs: adjust Kconfig to fix build errors 2019-03-02 12:03:56 +01:00
Makefile habanalabs: Move PCI code into common file 2019-03-05 16:48:42 +02:00
memory.c habanalabs: improve IOCTLs behavior when disabled or reset 2019-04-06 15:41:35 +03:00
mmu.c habanalabs: fix mapping with page size bigger than 4KB 2019-03-14 16:54:45 +02:00
pci.c habanalabs: keep track of the device's dma mask 2019-03-07 18:03:23 +02:00
sysfs.c habanalabs: fix little-endian<->cpu conversion warnings 2019-02-28 13:07:52 +01:00