summaryrefslogtreecommitdiffstats
path: root/drivers/misc/habanalabs/gaudi/gaudi.c
diff options
context:
space:
mode:
authorDafna Hirschfeld <dhirschfeld@habana.ai>2022-06-23 06:47:48 +0200
committerOded Gabbay <ogabbay@kernel.org>2022-07-12 08:09:25 +0200
commit70852c95ac0e6234eaa87e267054dcbc0712f240 (patch)
tree77e9ba1d7062191b232f7511977cc1a5e131cfb9 /drivers/misc/habanalabs/gaudi/gaudi.c
parenthabanalabs: don't send addr and size to scrub_device_mem cb (diff)
downloadlinux-70852c95ac0e6234eaa87e267054dcbc0712f240.tar.xz
linux-70852c95ac0e6234eaa87e267054dcbc0712f240.zip
habanalabs/gaudi: use memory_scrub_val from debugfs
In the callback scrub_device_mem, use 'memory_scrub_val' from debugfs for the scrubbing value. Signed-off-by: Dafna Hirschfeld <dhirschfeld@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Diffstat (limited to 'drivers/misc/habanalabs/gaudi/gaudi.c')
-rw-r--r--drivers/misc/habanalabs/gaudi/gaudi.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/misc/habanalabs/gaudi/gaudi.c b/drivers/misc/habanalabs/gaudi/gaudi.c
index bc5e74505d03..8cf3382fa039 100644
--- a/drivers/misc/habanalabs/gaudi/gaudi.c
+++ b/drivers/misc/habanalabs/gaudi/gaudi.c
@@ -4851,7 +4851,7 @@ static int gaudi_scrub_device_mem(struct hl_device *hdev)
struct asic_fixed_properties *prop = &hdev->asic_prop;
u64 addr, size, dummy_val;
int rc = 0;
- u64 val = 0;
+ u64 val = hdev->memory_scrub_val;
if (!hdev->memory_scrub)
return 0;
@@ -4871,7 +4871,6 @@ static int gaudi_scrub_device_mem(struct hl_device *hdev)
/* Scrub SRAM */
addr = prop->sram_user_base_address;
size = hdev->pldm ? 0x10000 : prop->sram_size - SRAM_USER_BASE_OFFSET;
- val = 0x7777777777777777ull;
dev_dbg(hdev->dev, "Scrubing SRAM: 0x%09llx - 0x%09llx val: 0x%llx\n",
addr, addr + size, val);
@@ -4882,7 +4881,7 @@ static int gaudi_scrub_device_mem(struct hl_device *hdev)
}
/* Scrub HBM using all DMA channels in parallel */
- rc = gaudi_scrub_device_dram(hdev, 0xdeadbeaf);
+ rc = gaudi_scrub_device_dram(hdev, val);
if (rc) {
dev_err(hdev->dev, "Failed to clear HBM (%d)\n", rc);
return rc;