habanalabs: mark linux image as not loaded after hw_fini
authorTomer Tayar <ttayar@habana.ai>
Fri, 9 Jul 2021 14:34:45 +0000 (17:34 +0300)
committerOded Gabbay <ogabbay@kernel.org>
Sun, 29 Aug 2021 06:47:46 +0000 (09:47 +0300)
commita9623a8b3ae67d04187b7a4478d4e4155720eebc
treec0d3d8fcb0522d13a6ffba519707b7275c43a81e
parent89aad770d692e4d2d9a604c1674e9dfa69421430
habanalabs: mark linux image as not loaded after hw_fini

If hard reset fails after the call to hw_fini and before loading the
linux image to the device, a subsequent call to hw_fini should
communicate via COMMS (or MSG_TO_CPU regs for old FW versions).
However, the driver still tries in this case to communicate via the GIC,
and thus no hard reset is actually done.
To avoid that, the patch clears the linux_loaded flag after every call
to hw_fini.

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