summaryrefslogtreecommitdiff
path: root/drivers/misc
diff options
context:
space:
mode:
authorOded Gabbay <ogabbay@kernel.org>2021-07-28 00:16:31 +0300
committerOded Gabbay <ogabbay@kernel.org>2021-09-01 18:38:24 +0300
commit83f14f2f9b632da439e8e1e51826db5eab5c242b (patch)
treef63175e8dcbcf63b423c72772b3695bdda44034a /drivers/misc
parentf5137aff6dcc3a85d0143ee91e6061c2c3611bf7 (diff)
habanalabs/gaudi: move scrubbing to late init
HW init is mostly about configuring registers. Therefore, it is better to activate DMAs only in late init and afterwards. Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/habanalabs/gaudi/gaudi.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/misc/habanalabs/gaudi/gaudi.c b/drivers/misc/habanalabs/gaudi/gaudi.c
index 55b133e34ac4..f2abd5011354 100644
--- a/drivers/misc/habanalabs/gaudi/gaudi.c
+++ b/drivers/misc/habanalabs/gaudi/gaudi.c
@@ -1566,6 +1566,11 @@ static int gaudi_late_init(struct hl_device *hdev)
return rc;
}
+ /* Scrub both SRAM and DRAM */
+ rc = hdev->asic_funcs->scrub_device_mem(hdev, 0, 0);
+ if (rc)
+ goto disable_pci_access;
+
rc = gaudi_fetch_psoc_frequency(hdev);
if (rc) {
dev_err(hdev->dev, "Failed to fetch psoc frequency\n");
@@ -4193,11 +4198,6 @@ static int gaudi_hw_init(struct hl_device *hdev)
goto disable_msi;
}
- /* Scrub both SRAM and DRAM */
- rc = hdev->asic_funcs->scrub_device_mem(hdev, 0, 0);
- if (rc)
- return rc;
-
/* Perform read from the device to flush all configuration */
RREG32(mmHW_STATE);