accel/habanalabs: update pending reset flags with new reset requests
authorTomer Tayar <ttayar@habana.ai>
Wed, 10 May 2023 15:18:05 +0000 (18:18 +0300)
committerOded Gabbay <ogabbay@kernel.org>
Mon, 9 Oct 2023 09:37:17 +0000 (12:37 +0300)
commita35c99760146137bbcfafe82ed5dc9c7a00b640a
treebe25d26f4e75abbaa249de2e2bd428b3a6b9d2f3
parent5d89ce6f8c2775b926b63c14529c5970429ea935
accel/habanalabs: update pending reset flags with new reset requests

If hl_device_cond_reset() is called while a reset is already pending but
hasn't started, the reset request will be dropped.
If the flags of the new request are more severe, e.g. a hard reset while
the pending reset is a compute reset, the eventual reset won't be
suitable for the device status.

To prevent such cases, update the pending reset flags with the new
requests flags before the requests are dropped.

Signed-off-by: Tomer Tayar <ttayar@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
drivers/accel/habanalabs/common/device.c