habanalabs: release kernel context after hw_fini
authorOded Gabbay <oded.gabbay@gmail.com>
Wed, 23 Sep 2020 12:06:52 +0000 (15:06 +0300)
committerOded Gabbay <oded.gabbay@gmail.com>
Fri, 25 Sep 2020 11:44:20 +0000 (14:44 +0300)
commit9e2e8fc7d65c9c2b58a4bf5b6c62a6fbb3762d05
tree4d761242e909959d50c897d96a91f3a1ded55cb7
parentfc6121e961cba2e4790493f656b7066e250f9521
habanalabs: release kernel context after hw_fini

Some engines use resources that belong to the kernel context (e.g. MMU
mappings). In case the halt-engines doesn't work properly due to H/W
restriction, we need to make sure the kernel context lives on until after
the hw_fini. The hw_fini resets the ASIC after that no engine is alive and
we can safely close the kernel context.

Reviewed-by: Tomer Tayar <ttayar@habana.ai>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
drivers/misc/habanalabs/common/device.c