summaryrefslogtreecommitdiff
path: root/drivers/misc/habanalabs/context.c
diff options
context:
space:
mode:
authorJoerg Roedel <jroedel@suse.de>2019-06-24 10:23:16 +0200
committerJoerg Roedel <jroedel@suse.de>2019-06-24 10:23:16 +0200
commitceedd5f74d8cfe34db4e654a7808e3c5de40d6f5 (patch)
treee19c18292231202e9cd8d484ee43f46b2c9c9ad1 /drivers/misc/habanalabs/context.c
parent1b961423158caaae49d3900b7c9c37477bbfa9b3 (diff)
parent4b972a01a7da614b4796475f933094751a295a2f (diff)
Merge tag 'v5.2-rc6' into generic-dma-ops
Linux 5.2-rc6
Diffstat (limited to 'drivers/misc/habanalabs/context.c')
-rw-r--r--drivers/misc/habanalabs/context.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/misc/habanalabs/context.c b/drivers/misc/habanalabs/context.c
index 4804cdcf4c48..f4c92f110a72 100644
--- a/drivers/misc/habanalabs/context.c
+++ b/drivers/misc/habanalabs/context.c
@@ -26,6 +26,12 @@ static void hl_ctx_fini(struct hl_ctx *ctx)
dma_fence_put(ctx->cs_pending[i]);
if (ctx->asid != HL_KERNEL_ASID_ID) {
+ /*
+ * The engines are stopped as there is no executing CS, but the
+ * Coresight might be still working by accessing addresses
+ * related to the stopped engines. Hence stop it explicitly.
+ */
+ hdev->asic_funcs->halt_coresight(hdev);
hl_vm_ctx_fini(ctx);
hl_asid_free(hdev, ctx->asid);
}