All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oded Gabbay <oded.gabbay@gmail.com>
To: linux-kernel@vger.kernel.org, SW_Drivers@habana.ai
Cc: farah kassabri <fkassabri@habana.ai>
Subject: [PATCH 9/9] habanalabs: extend busy engines mask to 64 bits
Date: Sat, 15 Aug 2020 20:59:38 +0300	[thread overview]
Message-ID: <20200815175938.16619-9-oded.gabbay@gmail.com> (raw)
In-Reply-To: <20200815175938.16619-1-oded.gabbay@gmail.com>

From: farah kassabri <fkassabri@habana.ai>

change busy engines bitmask to 64 bits in order to represent
more engines, needed for future ASIC support.

Signed-off-by: farah kassabri <fkassabri@habana.ai>
Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
---
 drivers/misc/habanalabs/common/habanalabs.h       | 2 +-
 drivers/misc/habanalabs/common/habanalabs_ioctl.c | 2 +-
 drivers/misc/habanalabs/gaudi/gaudi.c             | 2 +-
 drivers/misc/habanalabs/goya/goya.c               | 2 +-
 include/uapi/misc/habanalabs.h                    | 6 ++++++
 5 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/misc/habanalabs/common/habanalabs.h b/drivers/misc/habanalabs/common/habanalabs.h
index 2decf7be3e08..dbf214421ae1 100644
--- a/drivers/misc/habanalabs/common/habanalabs.h
+++ b/drivers/misc/habanalabs/common/habanalabs.h
@@ -754,7 +754,7 @@ struct hl_asic_funcs {
 	void (*set_clock_gating)(struct hl_device *hdev);
 	void (*disable_clock_gating)(struct hl_device *hdev);
 	int (*debug_coresight)(struct hl_device *hdev, void *data);
-	bool (*is_device_idle)(struct hl_device *hdev, u32 *mask,
+	bool (*is_device_idle)(struct hl_device *hdev, u64 *mask,
 				struct seq_file *s);
 	int (*soft_reset_late_init)(struct hl_device *hdev);
 	void (*hw_queues_lock)(struct hl_device *hdev);
diff --git a/drivers/misc/habanalabs/common/habanalabs_ioctl.c b/drivers/misc/habanalabs/common/habanalabs_ioctl.c
index fe6c5534d378..a94800014243 100644
--- a/drivers/misc/habanalabs/common/habanalabs_ioctl.c
+++ b/drivers/misc/habanalabs/common/habanalabs_ioctl.c
@@ -132,7 +132,7 @@ static int hw_idle(struct hl_device *hdev, struct hl_info_args *args)
 		return -EINVAL;
 
 	hw_idle.is_idle = hdev->asic_funcs->is_device_idle(hdev,
-					&hw_idle.busy_engines_mask, NULL);
+					&hw_idle.busy_engines_mask_ext, NULL);
 
 	return copy_to_user(out, &hw_idle,
 		min((size_t) max_size, sizeof(hw_idle))) ? -EFAULT : 0;
diff --git a/drivers/misc/habanalabs/gaudi/gaudi.c b/drivers/misc/habanalabs/gaudi/gaudi.c
index 3360c3c207a9..e56f95e6c741 100644
--- a/drivers/misc/habanalabs/gaudi/gaudi.c
+++ b/drivers/misc/habanalabs/gaudi/gaudi.c
@@ -6041,7 +6041,7 @@ static int gaudi_armcp_info_get(struct hl_device *hdev)
 	return 0;
 }
 
-static bool gaudi_is_device_idle(struct hl_device *hdev, u32 *mask,
+static bool gaudi_is_device_idle(struct hl_device *hdev, u64 *mask,
 					struct seq_file *s)
 {
 	struct gaudi_device *gaudi = hdev->asic_specific;
diff --git a/drivers/misc/habanalabs/goya/goya.c b/drivers/misc/habanalabs/goya/goya.c
index 77a5963a4d10..021cd26fb018 100644
--- a/drivers/misc/habanalabs/goya/goya.c
+++ b/drivers/misc/habanalabs/goya/goya.c
@@ -5117,7 +5117,7 @@ static void goya_disable_clock_gating(struct hl_device *hdev)
 	/* clock gating not supported in Goya */
 }
 
-static bool goya_is_device_idle(struct hl_device *hdev, u32 *mask,
+static bool goya_is_device_idle(struct hl_device *hdev, u64 *mask,
 				struct seq_file *s)
 {
 	const char *fmt = "%-5d%-9s%#-14x%#-16x%#x\n";
diff --git a/include/uapi/misc/habanalabs.h b/include/uapi/misc/habanalabs.h
index ca6dc1fc250e..693081728ef3 100644
--- a/include/uapi/misc/habanalabs.h
+++ b/include/uapi/misc/habanalabs.h
@@ -319,6 +319,12 @@ struct hl_info_hw_idle {
 	 * Bits definition is according to `enum <chip>_enging_id'.
 	 */
 	__u32 busy_engines_mask;
+
+	/*
+	 * Extended Bitmask of busy engines.
+	 * Bits definition is according to `enum <chip>_enging_id'.
+	 */
+	__u64 busy_engines_mask_ext;
 };
 
 struct hl_info_device_status {
-- 
2.17.1


  parent reply	other threads:[~2020-08-15 22:03 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-15 17:59 [PATCH 1/9] habanalabs: change CB's ID to be 64 bits Oded Gabbay
2020-08-15 17:59 ` [PATCH 2/9] habanalabs: cast int to u32 before printing it with %u Oded Gabbay
2020-08-16 15:24   ` Tomer Tayar
2020-08-15 17:59 ` [PATCH 3/9] habanalabs: eliminate redundant else condition Oded Gabbay
2020-08-16 15:24   ` Tomer Tayar
2020-08-15 17:59 ` [PATCH 4/9] habanalabs: use standard BIT() and GENMASK() Oded Gabbay
2020-08-16 15:24   ` Tomer Tayar
2020-08-15 17:59 ` [PATCH 5/9] habanalabs: use FIELD_PREP() instead of << Oded Gabbay
2020-08-16 15:24   ` Tomer Tayar
2020-08-15 17:59 ` [PATCH 6/9] habanalabs: remove redundant assignment to variable Oded Gabbay
2020-08-16 15:24   ` Tomer Tayar
2020-08-15 17:59 ` [PATCH 7/9] habanalabs: check TPC vector pipe is empty Oded Gabbay
2020-08-16 15:24   ` Tomer Tayar
2020-08-15 17:59 ` Oded Gabbay [this message]
2020-08-16 15:24 ` [PATCH 1/9] habanalabs: change CB's ID to be 64 bits Tomer Tayar
     [not found] ` <20200815175938.16619-8-oded.gabbay@gmail.com>
2020-08-16 15:24   ` [PATCH 8/9] habanalabs: use 1U when shifting bits Tomer Tayar

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=20200815175938.16619-9-oded.gabbay@gmail.com \
    --to=oded.gabbay@gmail.com \
    --cc=SW_Drivers@habana.ai \
    --cc=fkassabri@habana.ai \
    --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 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.