linux-stable/drivers/misc/habanalabs
farah kassabri fa4c8baa6b habanalabs: fix bug in timestamps registration code
[ Upstream commit ac5af9900f ]

Protect re-using the same timestamp buffer record before actually
adding it to the to interrupt wait list.
Mark ts buff offset as in use in the spinlock protection area of the
interrupt wait list to avoid getting in the re-use section in
ts_buff_get_kernel_ts_record before adding the node to the list.
this scenario might happen when multiple threads are racing on
same offset and one thread could set data in the ts buff in
ts_buff_get_kernel_ts_record then the other thread takes over
and get to ts_buff_get_kernel_ts_record and we will try
to re-use the same ts buff offset then we will try to
delete a non existing node from the list.

Signed-off-by: farah kassabri <fkassabri@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-03-10 09:33:58 +01:00
..
common habanalabs: fix bug in timestamps registration code 2023-03-10 09:33:58 +01:00
gaudi habanalabs/gaudi: use 8KB aligned address for TPC kernels 2022-09-20 15:51:54 +03:00
gaudi2 treewide: use get_random_u32() when possible 2022-10-11 17:42:58 -06:00
goya habanalabs: send device active message to f/w 2022-09-19 15:08:37 +03:00
include habanalabs/gaudi2: allow user to flush PCIE by read 2022-09-19 15:10:01 +03:00
Kconfig habanalabs: select FW_LOADER in Kconfig 2022-09-18 13:29:52 +03:00
Makefile habanalabs: build ASICs from new to old 2022-09-20 15:42:08 +03:00