The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Oded Gabbay <ogabbay@kernel.org>
To: linux-kernel@vger.kernel.org
Subject: [PATCH 02/11] habanalabs: remove in_debug check in device open
Date: Tue, 14 Dec 2021 17:05:42 +0200	[thread overview]
Message-ID: <20211214150551.1568192-2-ogabbay@kernel.org> (raw)
In-Reply-To: <20211214150551.1568192-1-ogabbay@kernel.org>

The driver supports only a single user anyway, so there is no point
in checking whether we are in_debug state when a user tries to open
the device, because if we are in_debug, it means a user is already
using the device.

Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
---
 drivers/misc/habanalabs/common/habanalabs.h     | 5 +++--
 drivers/misc/habanalabs/common/habanalabs_drv.c | 8 --------
 2 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/drivers/misc/habanalabs/common/habanalabs.h b/drivers/misc/habanalabs/common/habanalabs.h
index eda1c70f6966..362eee3f028c 100644
--- a/drivers/misc/habanalabs/common/habanalabs.h
+++ b/drivers/misc/habanalabs/common/habanalabs.h
@@ -2561,8 +2561,9 @@ struct last_error_session_info {
  * @init_done: is the initialization of the device done.
  * @device_cpu_disabled: is the device CPU disabled (due to timeouts)
  * @dma_mask: the dma mask that was set for this device
- * @in_debug: is device under debug. This, together with fpriv_list, enforces
- *            that only a single user is configuring the debug infrastructure.
+ * @in_debug: whether the device is in a state where the profiling/tracing infrastructure
+ *            can be used. This indication is needed because in some ASICs we need to do
+ *            specific operations to enable that infrastructure.
  * @power9_64bit_dma_enable: true to enable 64-bit DMA mask support. Relevant
  *                           only to POWER9 machines.
  * @cdev_sysfs_created: were char devices and sysfs nodes created.
diff --git a/drivers/misc/habanalabs/common/habanalabs_drv.c b/drivers/misc/habanalabs/common/habanalabs_drv.c
index 62a02ef43bb7..d59201f93de9 100644
--- a/drivers/misc/habanalabs/common/habanalabs_drv.c
+++ b/drivers/misc/habanalabs/common/habanalabs_drv.c
@@ -153,14 +153,6 @@ int hl_device_open(struct inode *inode, struct file *filp)
 		goto out_err;
 	}
 
-	if (hdev->in_debug) {
-		dev_err_ratelimited(hdev->dev,
-			"Can't open %s because it is being debugged by another user\n",
-			dev_name(hdev->dev));
-		rc = -EPERM;
-		goto out_err;
-	}
-
 	if (hdev->is_compute_ctx_active) {
 		dev_dbg_ratelimited(hdev->dev,
 			"Can't open %s because another user is working on it\n",
-- 
2.25.1


  reply	other threads:[~2021-12-14 15:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-14 15:05 [PATCH 01/11] habanalabs: return correct clock throttling period Oded Gabbay
2021-12-14 15:05 ` Oded Gabbay [this message]
2021-12-14 15:05 ` [PATCH 03/11] habanalabs: add current PI value to cpu packets Oded Gabbay
2021-12-14 15:05 ` [PATCH 04/11] habanalabs: fix hwmon handling for legacy f/w Oded Gabbay
2021-12-14 15:05 ` [PATCH 05/11] habanalabs: keep control device alive during hard reset Oded Gabbay
2021-12-14 15:05 ` [PATCH 06/11] habanalabs: sysfs support for two infineon versions Oded Gabbay
2021-12-14 15:05 ` [PATCH 07/11] habanalabs: expose soft reset sysfs nodes for inference ASIC Oded Gabbay
2021-12-14 15:05 ` [PATCH 08/11] habanalabs: clean MMU headers definitions Oded Gabbay
2021-12-14 15:05 ` [PATCH 09/11] habanalabs: modify cpu boot status error print Oded Gabbay
2021-12-14 15:05 ` [PATCH 10/11] habanalabs: prevent wait if CS in multi-CS list completed Oded Gabbay
2021-12-14 15:05 ` [PATCH 11/11] habanalabs: change wait_for_interrupt implementation 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=20211214150551.1568192-2-ogabbay@kernel.org \
    --to=ogabbay@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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