Skip to content
Snippets Groups Projects
Commit e5a6618b authored by farah kassabri's avatar farah kassabri Committed by Greg Kroah-Hartman
Browse files

habanalabs: fix bug in timestamps registration code


[ Upstream commit ac5af990 ]

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: default avatarfarah kassabri <fkassabri@habana.ai>
Reviewed-by: Oded Gabbay's avatarOded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay's avatarOded Gabbay <ogabbay@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent b08669fc
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment