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: Ofir Bitton <obitton@habana.ai>
Subject: [PATCH 09/12] habanalabs: do not set max power on a secured device
Date: Mon,  4 Jul 2022 12:29:38 +0300	[thread overview]
Message-ID: <20220704092941.2237683-9-ogabbay@kernel.org> (raw)
In-Reply-To: <20220704092941.2237683-1-ogabbay@kernel.org>

From: Ofir Bitton <obitton@habana.ai>

Max power API is not supported in secured devices. Hence, we should
skip setting it during boot.

Signed-off-by: Ofir Bitton <obitton@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
---
 drivers/misc/habanalabs/common/device.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/misc/habanalabs/common/device.c b/drivers/misc/habanalabs/common/device.c
index 9f3778c82e54..99d84b46aeb6 100644
--- a/drivers/misc/habanalabs/common/device.c
+++ b/drivers/misc/habanalabs/common/device.c
@@ -1545,7 +1545,8 @@ int hl_device_reset(struct hl_device *hdev, u32 flags)
 			goto out_err;
 		}
 
-		hl_fw_set_max_power(hdev);
+		if (!hdev->asic_prop.fw_security_enabled)
+			hl_fw_set_max_power(hdev);
 	} else {
 		rc = hdev->asic_funcs->non_hard_reset_late_init(hdev);
 		if (rc) {
@@ -1914,7 +1915,8 @@ int hl_device_init(struct hl_device *hdev, struct class *hclass)
 	/* Need to call this again because the max power might change,
 	 * depending on card type for certain ASICs
 	 */
-	if (hdev->asic_prop.set_max_power_on_device_init)
+	if (hdev->asic_prop.set_max_power_on_device_init &&
+			!hdev->asic_prop.fw_security_enabled)
 		hl_fw_set_max_power(hdev);
 
 	/*
-- 
2.25.1


  parent reply	other threads:[~2022-07-04  9:30 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-04  9:29 [PATCH 01/12] habanalabs/gaudi2: reset device upon critical ECC event Oded Gabbay
2022-07-04  9:29 ` [PATCH 02/12] habanalabs: wait for preboot ready after hard reset Oded Gabbay
2022-07-04  9:29 ` [PATCH 03/12] habanalabs: naming refactor of user interrupt flow Oded Gabbay
2022-07-04  9:29 ` [PATCH 04/12] habanalabs: add support for common decoder interrupts Oded Gabbay
2022-07-04  9:29 ` [PATCH 05/12] habanalabs: save f/w preboot minor version Oded Gabbay
2022-07-04  9:29 ` [PATCH 06/12] habanalabs: allow detection of unsupported f/w packets Oded Gabbay
2022-07-04  9:29 ` [PATCH 07/12] habanalabs/gaudi2: remove unused variable Oded Gabbay
2022-07-04  9:29 ` [PATCH 08/12] habanalabs/gaudi2: SM mask can only be 8-bit Oded Gabbay
2022-07-04  9:29 ` Oded Gabbay [this message]
2022-07-04  9:29 ` [PATCH 10/12] habanalabs: don't declare tmp twice in same function Oded Gabbay
2022-07-04  9:29 ` [PATCH 11/12] habanalabs: make sure variable is set before used Oded Gabbay
2022-07-04  9:29 ` [PATCH 12/12] habanalabs/gaudi2: remove unused defines 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=20220704092941.2237683-9-ogabbay@kernel.org \
    --to=ogabbay@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=obitton@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