habanalabs: check running index in eqe control
authorOded Gabbay <ogabbay@kernel.org>
Wed, 19 May 2021 11:52:14 +0000 (14:52 +0300)
committerOded Gabbay <ogabbay@kernel.org>
Fri, 18 Jun 2021 12:23:40 +0000 (15:23 +0300)
commit1242e9f0f45873607f8e6699b4339c81d9f3de73
treebf5a12f130150236d06924ce5ef55459c7b042b4
parent7fb2a1f5b7f81dce20587e79aae8fe8a9ac03986
habanalabs: check running index in eqe control

To harden the event queue mechanism, we add a running index to the
control header of the entry.

The firmware writes the index in each entry and the driver verifies
that the index of the current entry is larger by 1 of the index of
the previous entry.

In case it isn't, the driver will treat the entry as if it wasn't
valid (it won't process it but won't skip it).

Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
drivers/misc/habanalabs/common/firmware_if.c
drivers/misc/habanalabs/common/habanalabs.h
drivers/misc/habanalabs/common/irq.c
drivers/misc/habanalabs/include/common/cpucp_if.h
drivers/misc/habanalabs/include/common/hl_boot_if.h