All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oded Gabbay <oded.gabbay@gmail.com>
To: linux-kernel@vger.kernel.org, oshpigelman@habana.ai,
	ttayar@habana.ai, gregkh@linuxfoundation.org
Subject: [PATCH 01/11] habanalabs: add dedicated define for hard reset
Date: Mon, 11 May 2020 14:32:22 +0300	[thread overview]
Message-ID: <20200511113232.5771-2-oded.gabbay@gmail.com> (raw)
In-Reply-To: <20200511113232.5771-1-oded.gabbay@gmail.com>

From: Omer Shpigelman <oshpigelman@habana.ai>

Gaudi requires longer waiting during reset due to closing of network ports.
Add this explanation to the relevant comment in the code and add a
dedicated define for this reset timeout period, instead of multiplying
another define.

Signed-off-by: Omer Shpigelman <oshpigelman@habana.ai>
Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
---
 drivers/misc/habanalabs/device.c     | 5 +++--
 drivers/misc/habanalabs/habanalabs.h | 2 ++
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/misc/habanalabs/device.c b/drivers/misc/habanalabs/device.c
index c89157dafa33..f618cff9a167 100644
--- a/drivers/misc/habanalabs/device.c
+++ b/drivers/misc/habanalabs/device.c
@@ -1326,11 +1326,12 @@ void hl_device_fini(struct hl_device *hdev)
 	 * This function is competing with the reset function, so try to
 	 * take the reset atomic and if we are already in middle of reset,
 	 * wait until reset function is finished. Reset function is designed
-	 * to always finish (could take up to a few seconds in worst case).
+	 * to always finish. However, in Gaudi, because of all the network
+	 * ports, the hard reset could take between 10-30 seconds
 	 */
 
 	timeout = ktime_add_us(ktime_get(),
-				HL_PENDING_RESET_PER_SEC * 1000 * 1000 * 4);
+				HL_HARD_RESET_MAX_TIMEOUT * 1000 * 1000);
 	rc = atomic_cmpxchg(&hdev->in_reset, 0, 1);
 	while (rc) {
 		usleep_range(50, 200);
diff --git a/drivers/misc/habanalabs/habanalabs.h b/drivers/misc/habanalabs/habanalabs.h
index cfb306daa8d4..d77410886a67 100644
--- a/drivers/misc/habanalabs/habanalabs.h
+++ b/drivers/misc/habanalabs/habanalabs.h
@@ -25,6 +25,8 @@
 
 #define HL_PENDING_RESET_PER_SEC	30
 
+#define HL_HARD_RESET_MAX_TIMEOUT	120
+
 #define HL_DEVICE_TIMEOUT_USEC		1000000 /* 1 s */
 
 #define HL_HEARTBEAT_PER_USEC		5000000 /* 5 s */
-- 
2.17.1


  reply	other threads:[~2020-05-11 11:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-11 11:32 [PATCH 00/11] Adding GAUDI ASIC support to habanalabs driver Oded Gabbay
2020-05-11 11:32 ` Oded Gabbay [this message]
2020-05-11 11:32 ` [PATCH 02/11] habanalabs: set PM profile to auto only for goya Oded Gabbay
2020-05-11 11:32 ` [PATCH 03/11] habanalabs: support clock gating enable/disable Oded Gabbay
2020-05-11 11:32 ` [PATCH 04/11] habanalabs: get card type, location from F/W Oded Gabbay
2020-05-11 11:32 ` [PATCH 06/11] uapi: habanalabs: add gaudi defines Oded Gabbay
2020-05-11 11:32 ` [PATCH 07/11] habanalabs: add gaudi asic-dependent code Oded Gabbay
2020-05-11 11:32 ` [PATCH 08/11] habanalabs: add hwmgr module for gaudi Oded Gabbay
2020-05-11 11:32 ` [PATCH 09/11] habanalabs: add gaudi security module Oded Gabbay
2020-05-11 11:32 ` [PATCH 10/11] habanalabs: add gaudi profiler module Oded Gabbay
2020-05-11 11:32 ` [PATCH 11/11] habanalabs: enable gaudi code in driver 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=20200511113232.5771-2-oded.gabbay@gmail.com \
    --to=oded.gabbay@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oshpigelman@habana.ai \
    --cc=ttayar@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.