]> git.baikalelectronics.ru Git - kernel.git/commit
habanalabs: fix update of is_in_soft_reset
authorOded Gabbay <ogabbay@kernel.org>
Thu, 7 Jul 2022 08:39:19 +0000 (11:39 +0300)
committerOded Gabbay <ogabbay@kernel.org>
Tue, 12 Jul 2022 06:09:31 +0000 (09:09 +0300)
commitc99468dad934cccc5cf6567ea84297b7adc4d8f7
tree0b11e7b35f5536011d64d78b8c13602f200f6e7c
parentaa731487af3d644daaac51301b2fde0ee66dab78
habanalabs: fix update of is_in_soft_reset

reset_info.is_in_soft_reset should be updated both before in_reset
and inside the spin lock of the reset info structure.

The reasons are:

- When we are inside soft reset, it implies we are in reset. Therefore,
  if someone checks if we are in soft reset, he can deduce we are
  in reset, while the opposite is not correct and might be misleading.

- Both these flags are changed together so they must be changed
  inside the reset info spinlock.

Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
drivers/misc/habanalabs/common/device.c