linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oded Gabbay <oded.gabbay@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: gregkh@linuxfoundation.org
Subject: [PATCH 05/15] habanalabs: use EQ MSI/X ID per chip
Date: Sun, 17 Mar 2019 21:59:17 +0200	[thread overview]
Message-ID: <20190317195927.26238-6-oded.gabbay@gmail.com> (raw)
In-Reply-To: <20190317195927.26238-1-oded.gabbay@gmail.com>

The Event Queue MSI/X ID is different per ASIC. This patch renames the
current define to have the GOYA_ prefix to mark it only for Goya. It also
moves it from the common armcp_if.h file to the ASIC specific goya_fw_if.h
file.

Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
---
 drivers/misc/habanalabs/goya/goya.c               | 8 ++++----
 drivers/misc/habanalabs/include/armcp_if.h        | 2 --
 drivers/misc/habanalabs/include/goya/goya_fw_if.h | 2 ++
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/misc/habanalabs/goya/goya.c b/drivers/misc/habanalabs/goya/goya.c
index a578d01a56a6..6ba0faa979bd 100644
--- a/drivers/misc/habanalabs/goya/goya.c
+++ b/drivers/misc/habanalabs/goya/goya.c
@@ -2205,10 +2205,10 @@ static int goya_enable_msix(struct hl_device *hdev)
 		}
 	}
 
-	irq = pci_irq_vector(hdev->pdev, EVENT_QUEUE_MSIX_IDX);
+	irq = pci_irq_vector(hdev->pdev, GOYA_EVENT_QUEUE_MSIX_IDX);
 
 	rc = request_irq(irq, hl_irq_handler_eq, 0,
-			goya_irq_name[EVENT_QUEUE_MSIX_IDX],
+			goya_irq_name[GOYA_EVENT_QUEUE_MSIX_IDX],
 			&hdev->event_queue);
 	if (rc) {
 		dev_err(hdev->dev, "Failed to request IRQ %d", irq);
@@ -2239,7 +2239,7 @@ static void goya_sync_irqs(struct hl_device *hdev)
 	for (i = 0 ; i < hdev->asic_prop.completion_queues_count ; i++)
 		synchronize_irq(pci_irq_vector(hdev->pdev, i));
 
-	synchronize_irq(pci_irq_vector(hdev->pdev, EVENT_QUEUE_MSIX_IDX));
+	synchronize_irq(pci_irq_vector(hdev->pdev, GOYA_EVENT_QUEUE_MSIX_IDX));
 }
 
 static void goya_disable_msix(struct hl_device *hdev)
@@ -2252,7 +2252,7 @@ static void goya_disable_msix(struct hl_device *hdev)
 
 	goya_sync_irqs(hdev);
 
-	irq = pci_irq_vector(hdev->pdev, EVENT_QUEUE_MSIX_IDX);
+	irq = pci_irq_vector(hdev->pdev, GOYA_EVENT_QUEUE_MSIX_IDX);
 	free_irq(irq, &hdev->event_queue);
 
 	for (i = 0 ; i < hdev->asic_prop.completion_queues_count ; i++) {
diff --git a/drivers/misc/habanalabs/include/armcp_if.h b/drivers/misc/habanalabs/include/armcp_if.h
index ccb82390241e..c8f28cadc335 100644
--- a/drivers/misc/habanalabs/include/armcp_if.h
+++ b/drivers/misc/habanalabs/include/armcp_if.h
@@ -32,8 +32,6 @@ struct hl_eq_entry {
 #define EQ_CTL_EVENT_TYPE_SHIFT		16
 #define EQ_CTL_EVENT_TYPE_MASK		0x03FF0000
 
-#define EVENT_QUEUE_MSIX_IDX		5
-
 enum pq_init_status {
 	PQ_INIT_STATUS_NA = 0,
 	PQ_INIT_STATUS_READY_FOR_CP,
diff --git a/drivers/misc/habanalabs/include/goya/goya_fw_if.h b/drivers/misc/habanalabs/include/goya/goya_fw_if.h
index a9920cb4a07b..0fa80fe9f6cc 100644
--- a/drivers/misc/habanalabs/include/goya/goya_fw_if.h
+++ b/drivers/misc/habanalabs/include/goya/goya_fw_if.h
@@ -8,6 +8,8 @@
 #ifndef GOYA_FW_IF_H
 #define GOYA_FW_IF_H
 
+#define GOYA_EVENT_QUEUE_MSIX_IDX	5
+
 #define CPU_BOOT_ADDR		0x7FF8040000ull
 
 #define UBOOT_FW_OFFSET		0x100000		/* 1MB in SRAM */
-- 
2.17.1


  parent reply	other threads:[~2019-03-17 20:00 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-17 19:59 [PATCH 00/15] habanalabs: various improvements and updates Oded Gabbay
2019-03-17 19:59 ` [PATCH 01/15] habanalabs: add new device CPU boot status Oded Gabbay
2019-03-17 19:59 ` [PATCH 02/15] habanalabs: rename goya_non_fatal_events array to all events Oded Gabbay
2019-03-17 19:59 ` [PATCH 03/15] habanalabs: remove implicit include from header files Oded Gabbay
2019-03-17 19:59 ` [PATCH 04/15] habanalabs: Move device CPU code into common file Oded Gabbay
2019-03-17 19:59 ` Oded Gabbay [this message]
2019-03-17 19:59 ` [PATCH 06/15] habanalabs: remove unused defines Oded Gabbay
2019-03-17 19:59 ` [PATCH 07/15] habanalabs: ratelimit warnings at start of IOCTLs Oded Gabbay
2019-03-17 19:59 ` [PATCH 08/15] habanalabs: Move PCI code into common file Oded Gabbay
2019-03-17 19:59 ` [PATCH 09/15] habanalabs: Remove unneeded function pointers Oded Gabbay
2019-03-17 19:59 ` [PATCH 10/15] uapi/habanalabs: add some comments in habanalabs.h Oded Gabbay
2019-03-17 19:59 ` [PATCH 11/15] habanalabs: Add a printout with the name of a busy engine Oded Gabbay
2019-03-17 19:59 ` [PATCH 12/15] habanalabs: Allow accessing DRAM virtual addresses via debugfs Oded Gabbay
2019-03-17 19:59 ` [PATCH 13/15] habanalabs: add MMU shadow mapping Oded Gabbay
2019-03-17 19:59 ` [PATCH 14/15] habanalabs: keep track of the device's dma mask Oded Gabbay
2019-03-17 19:59 ` [PATCH 15/15] habanalabs: never fail hard reset of device 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=20190317195927.26238-6-oded.gabbay@gmail.com \
    --to=oded.gabbay@gmail.com \
    --cc=gregkh@linuxfoundation.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;
as well as URLs for NNTP newsgroup(s).