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)
commitbd4a338886a8cc5809f45d569df395acb846ce8e
tree0b11e7b35f5536011d64d78b8c13602f200f6e7c
parent08f0aa9548fd624f7ad5ae1135423706b5e9fa6a
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