All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oded Gabbay <oded.gabbay@gmail.com>
To: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org
Subject: [PATCH 06/15] habanalabs: set DMA0 completion to SOB 1007
Date: Thu, 28 Feb 2019 10:46:15 +0200	[thread overview]
Message-ID: <20190228084624.25288-7-oded.gabbay@gmail.com> (raw)
In-Reply-To: <20190228084624.25288-1-oded.gabbay@gmail.com>

This patch fix a bug where DMA channel 0 completion address wasn't
initialized by the driver.

The patch sets the address to Sync Object no. 1007

Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
---
 drivers/misc/habanalabs/goya/goya.c                | 14 +++++++-------
 .../habanalabs/include/goya/asic_reg/goya_regs.h   |  1 +
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/misc/habanalabs/goya/goya.c b/drivers/misc/habanalabs/goya/goya.c
index 6f0075c4e935..578e4bdc3a49 100644
--- a/drivers/misc/habanalabs/goya/goya.c
+++ b/drivers/misc/habanalabs/goya/goya.c
@@ -1036,15 +1036,15 @@ static void goya_init_dma_ch(struct hl_device *hdev, int dma_id)
 	WREG32(mmDMA_CH_0_ERRMSG_WDATA + reg_off,
 			GOYA_ASYNC_EVENT_ID_DMA0_CH + dma_id);
 
-	if (dma_id) {
+	if (dma_id)
 		sob_addr = CFG_BASE + mmSYNC_MNGR_SOB_OBJ_1000 +
 				(dma_id - 1) * 4;
-		WREG32(mmDMA_CH_0_WR_COMP_ADDR_LO + reg_off,
-				lower_32_bits(sob_addr));
-		WREG32(mmDMA_CH_0_WR_COMP_ADDR_HI + reg_off,
-				upper_32_bits(sob_addr));
-		WREG32(mmDMA_CH_0_WR_COMP_WDATA + reg_off, 0x80000001);
-	}
+	else
+		sob_addr = CFG_BASE + mmSYNC_MNGR_SOB_OBJ_1007;
+
+	WREG32(mmDMA_CH_0_WR_COMP_ADDR_LO + reg_off, lower_32_bits(sob_addr));
+	WREG32(mmDMA_CH_0_WR_COMP_ADDR_HI + reg_off, upper_32_bits(sob_addr));
+	WREG32(mmDMA_CH_0_WR_COMP_WDATA + reg_off, 0x80000001);
 }
 
 /*
diff --git a/drivers/misc/habanalabs/include/goya/asic_reg/goya_regs.h b/drivers/misc/habanalabs/include/goya/asic_reg/goya_regs.h
index a3c746849f02..6cb0b6e54d41 100644
--- a/drivers/misc/habanalabs/include/goya/asic_reg/goya_regs.h
+++ b/drivers/misc/habanalabs/include/goya/asic_reg/goya_regs.h
@@ -108,6 +108,7 @@
 #define mmSYNC_MNGR_MON_PAY_ADDRL_0                                  0x113000
 #define mmSYNC_MNGR_SOB_OBJ_0                                        0x112000
 #define mmSYNC_MNGR_SOB_OBJ_1000                                     0x112FA0
+#define mmSYNC_MNGR_SOB_OBJ_1007                                     0x112FBC
 #define mmSYNC_MNGR_SOB_OBJ_1023                                     0x112FFC
 #define mmSYNC_MNGR_MON_STATUS_0                                     0x114000
 #define mmSYNC_MNGR_MON_STATUS_255                                   0x1143FC
-- 
2.17.1


  parent reply	other threads:[~2019-02-28  8:46 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-28  8:46 [PATCH 00/15] habanalabs fixes for merge window Oded Gabbay
2019-02-28  8:46 ` [PATCH 01/15] habanalabs: Dissociate RAZWI info from event types Oded Gabbay
2019-02-28  8:46 ` [PATCH 02/15] habanalabs: add MMU DRAM default page mapping Oded Gabbay
2019-02-28  8:46 ` [PATCH 03/15] habanalabs: disable CPU access on timeouts Oded Gabbay
2019-02-28  8:46 ` [PATCH 04/15] habanalabs: fix mmu cache registers init Oded Gabbay
2019-02-28  8:46 ` [PATCH 05/15] habanalabs: fix validation of WREG32 to DMA completion Oded Gabbay
2019-02-28  8:46 ` Oded Gabbay [this message]
2019-02-28  8:46 ` [PATCH 07/15] habanalabs: extend QMAN0 job timeout Oded Gabbay
2019-02-28  8:46 ` [PATCH 08/15] habanalabs: add comments in uapi/misc/habanalabs.h Oded Gabbay
2019-02-28  8:46 ` [PATCH 09/15] habanalabs: return correct error code on MMU mapping failure Oded Gabbay
2019-02-28  8:46 ` [PATCH 10/15] habanalabs: fix memory leak with CBs with unaligned size Oded Gabbay
2019-02-28  8:46 ` [PATCH 11/15] habanalabs: print pointer using %p Oded Gabbay
2019-02-28  9:31   ` Greg KH
2019-02-28  9:47     ` Oded Gabbay
2019-02-28  8:46 ` [PATCH 12/15] habanalabs: soft-reset device if context-switch fails Oded Gabbay
2019-02-28  8:46 ` [PATCH 13/15] habanalabs: fix little-endian<->cpu conversion warnings Oded Gabbay
2019-02-28  8:46 ` [PATCH 14/15] habanalabs: use NULL to initialize array of pointers Oded Gabbay
2019-02-28  8:46 ` [PATCH 15/15] habanalabs: fix little-endian<->cpu conversion warnings 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=20190228084624.25288-7-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 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.