[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200521070205.26673-1-oded.gabbay@gmail.com>
Date: Thu, 21 May 2020 10:02:02 +0300
From: Oded Gabbay <oded.gabbay@...il.com>
To: linux-kernel@...r.kernel.org, SW_Drivers@...ana.ai
Cc: gregkh@...uxfoundation.org, Omer Shpigelman <oshpigelman@...ana.ai>
Subject: [PATCH 1/4] habanalabs: improve MMU cache invalidation code
From: Omer Shpigelman <oshpigelman@...ana.ai>
A new sequence is introduced to invalidate the MMU cache in order to avoid
timeouts.
Signed-off-by: Omer Shpigelman <oshpigelman@...ana.ai>
Reviewed-by: Oded Gabbay <oded.gabbay@...il.com>
Signed-off-by: Oded Gabbay <oded.gabbay@...il.com>
---
drivers/misc/habanalabs/gaudi/gaudi.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/misc/habanalabs/gaudi/gaudi.c b/drivers/misc/habanalabs/gaudi/gaudi.c
index 4cb1f71dd4f1..093384731f0d 100644
--- a/drivers/misc/habanalabs/gaudi/gaudi.c
+++ b/drivers/misc/habanalabs/gaudi/gaudi.c
@@ -5982,16 +5982,18 @@ static void gaudi_mmu_invalidate_cache(struct hl_device *hdev, bool is_hard,
timeout_usec = MMU_CONFIG_TIMEOUT_USEC;
/* L0 & L1 invalidation */
- WREG32(mmSTLB_INV_ALL_START, 1);
+ WREG32(mmSTLB_INV_PS, 2);
rc = hl_poll_timeout(
hdev,
- mmSTLB_INV_ALL_START,
+ mmSTLB_INV_PS,
status,
!status,
1000,
timeout_usec);
+ WREG32(mmSTLB_INV_SET, 0);
+
if (rc)
dev_notice_ratelimited(hdev->dev,
"Timeout when waiting for MMU cache invalidation\n");
--
2.17.1
Powered by blists - more mailing lists