linux/drivers/misc/habanalabs
Omer Shpigelman b75f22505a habanalabs: add signal/wait to CS IOCTL operations
Add the following two operations to the CS IOCTL:

Signal:

The signal operation is basically a command submission, that is created by
the driver upon user request. It will be implemented using a dedicated PQE
that will increment a specific SOB. There will be a new flag:
HL_CS_FLAGS_SIGNAL. When the user set this flag in the CS IOCTL structure,
the driver will execute a dedicated code path that will prepare this
special PQE and submit it. The user only needs to provide a queue index on
which to put the signal.

Wait:

The wait operation is also a command submission that is created by the
driver upon user request. It will be implemented using a dedicated PQE that
will contain packets of "ARM a monitor" + FENCE packet. There will be a new
flag: HL_CS_FLAGS_WAIT. When the user set this flag in the CS structure,
the driver will execute a dedicated code path that will prepare this
special PQE and submit it.

The user needs to provide the following parameters:
1. queue ID
2. an array of signal_seq numbers and the number of signals to wait on
   (the length of signal_seq_arr).

The IOCTL will return the CS sequence number of the wait it put on the
queue ID.

Currently, the code supports signal_seq_nr==1. But this API definition will
allow us to put a single PQE that waits on multiple signals.

To correctly configure the monitor and fence, the driver will need to
retrieve the specified signal CS object that contains the relevant SOB and
its expected value. In case the signal CS has already been completed, there
is no point of adding a wait operation. In this case, the driver will
return to the user *without* putting anything on the PQ. The return code
should reflect to the user that the signal was completed, as we won't
return a CS sequence number for this wait.

Signed-off-by: Omer Shpigelman <oshpigelman@habana.ai>
Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
2020-05-19 14:48:41 +03:00
..
goya habanalabs: define ASIC-dependent interface for signal/wait 2020-05-19 14:48:41 +03:00
include habanalabs: update F/W register map 2020-05-19 14:48:41 +03:00
asid.c habanalabs: stop using the acronym KMD 2019-09-05 14:55:27 +03:00
command_buffer.c habanalabs: print all CB handles as hex numbers 2020-05-19 14:48:41 +03:00
command_submission.c habanalabs: add signal/wait to CS IOCTL operations 2020-05-19 14:48:41 +03:00
context.c habanalabs: add signal/wait to CS IOCTL operations 2020-05-19 14:48:41 +03:00
debugfs.c habanalabs: remove stop-on-error flag from DMA 2020-05-17 12:06:22 +03:00
device.c habanalabs: re-factor H/W queues initialization 2020-05-17 12:06:22 +03:00
firmware_if.c habanalabs: load CPU device boot loader from host 2020-05-19 14:48:41 +03:00
habanalabs_drv.c habanalabs: add missing MODULE_DEVICE_TABLE 2020-05-19 14:48:41 +03:00
habanalabs_ioctl.c habanalabs: Add INFO IOCTL opcode for time sync information 2020-05-19 14:48:41 +03:00
habanalabs.h habanalabs: add signal/wait to CS IOCTL operations 2020-05-19 14:48:41 +03:00
hw_queue.c habanalabs: handle the h/w sync object 2020-05-19 14:48:41 +03:00
hwmon.c habanalabs: support hwmon_reset_history attribute 2020-05-19 14:48:41 +03:00
irq.c habanalabs: replace __le32_to_cpu with le32_to_cpu 2019-09-05 14:55:27 +03:00
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
memory.c habanalabs: split the host MMU properties 2020-03-24 10:54:16 +02:00
mmu.c habanalabs: split the host MMU properties 2020-03-24 10:54:16 +02:00
pci.c habanalabs: hl_pci_set_dma_mask() can be static 2020-05-19 14:48:41 +03:00
sysfs.c habanalabs: print warning when reset is requested 2020-05-17 12:06:22 +03:00