public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Oded Gabbay <ogabbay@kernel.org>
To: linux-kernel@vger.kernel.org
Cc: SW_Drivers@habana.ai, Omer Shpigelman <oshpigelman@habana.ai>
Subject: [PATCH] habanalabs: fix hard reset print and comment
Date: Wed,  4 Nov 2020 16:08:58 +0200	[thread overview]
Message-ID: <20201104140908.10178-2-ogabbay@kernel.org> (raw)
In-Reply-To: <20201104140908.10178-1-ogabbay@kernel.org>

From: Omer Shpigelman <oshpigelman@habana.ai>

One of the first steps of a hard reset flow is to close all open user
contexts. This user process teradown might take some time due to long
cleanup in our driver or some other reason even before our cleanup flow.
Hence fix the relevant print and comment to be more accurate.

Signed-off-by: Omer Shpigelman <oshpigelman@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
---
 drivers/misc/habanalabs/common/device.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/misc/habanalabs/common/device.c b/drivers/misc/habanalabs/common/device.c
index 421e37123b03..3b82020648c7 100644
--- a/drivers/misc/habanalabs/common/device.c
+++ b/drivers/misc/habanalabs/common/device.c
@@ -793,17 +793,20 @@ static int device_kill_open_processes(struct hl_device *hdev)
 
 	mutex_unlock(&hdev->fpriv_list_lock);
 
-	/* We killed the open users, but because the driver cleans up after the
-	 * user contexts are closed (e.g. mmu mappings), we need to wait again
-	 * to make sure the cleaning phase is finished before continuing with
-	 * the reset
+	/*
+	 * We killed the open users, but that doesn't mean they are closed.
+	 * It could be that they are running a long cleanup phase in the driver
+	 * e.g. MMU unmappings, or running other long teardown flow even before
+	 * our cleanup.
+	 * Therefore we need to wait again to make sure they are closed before
+	 * continuing with the reset.
 	 */
 
 	pending_cnt = pending_total;
 
 	while ((!list_empty(&hdev->fpriv_list)) && (pending_cnt)) {
 		dev_info(hdev->dev,
-			"Waiting for all unmap operations to finish before hard reset\n");
+			"Waiting for all user contexts to get closed before hard reset\n");
 
 		pending_cnt--;
 
-- 
2.17.1


  reply	other threads:[~2020-11-04 14:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-04 14:08 [PATCH] habanalabs: add 'needs reset' state in driver Oded Gabbay
2020-11-04 14:08 ` Oded Gabbay [this message]
2020-11-04 14:08 ` [PATCH] habanalabs/gaudi: increase MAX CS to 16K Oded Gabbay
2020-11-04 14:09 ` [PATCH] habanalabs/gaudi: remove pcie_en strap toggle Oded Gabbay
2020-11-04 14:09 ` [PATCH] habanalabs: Move repeatedly included headers to habanalabs.h Oded Gabbay
2020-11-04 14:09 ` [PATCH] habanalabs: release signal if collective wait was dropped Oded Gabbay
2020-11-04 14:09 ` [PATCH] habanalabs: remove duplicate print Oded Gabbay
2020-11-04 14:09 ` [PATCH] habanalabs: reset device upon fw read failure Oded Gabbay
2020-11-04 14:09 ` [PATCH] habanalabs: restore vm_pgoff after mmap Oded Gabbay
2020-11-04 14:09 ` [PATCH] habanalabs: Separate CS job completion from its deallocation Oded Gabbay
2020-11-04 14:09 ` [PATCH] habanalabs: Skip updating CI of internal queues if not in use Oded Gabbay
2020-11-04 14:09 ` [PATCH] habanalabs: Small refactoring of cs_do_release() Oded Gabbay

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201104140908.10178-2-ogabbay@kernel.org \
    --to=ogabbay@kernel.org \
    --cc=SW_Drivers@habana.ai \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oshpigelman@habana.ai \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox