linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oded Gabbay <ogabbay@kernel.org>
To: linux-kernel@vger.kernel.org
Cc: Dafna Hirschfeld <dhirschfeld@habana.ai>
Subject: [PATCH 7/9] habanalabs/gaudi: use memory_scrub_val from debugfs
Date: Thu, 23 Jun 2022 23:42:10 +0300	[thread overview]
Message-ID: <20220623204212.1628709-7-ogabbay@kernel.org> (raw)
In-Reply-To: <20220623204212.1628709-1-ogabbay@kernel.org>

From: Dafna Hirschfeld <dhirschfeld@habana.ai>

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>
---
 Documentation/ABI/testing/debugfs-driver-habanalabs | 3 ++-
 drivers/misc/habanalabs/gaudi/gaudi.c               | 5 ++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Documentation/ABI/testing/debugfs-driver-habanalabs b/Documentation/ABI/testing/debugfs-driver-habanalabs
index 0f8d20fe343f..deb66944cd0c 100644
--- a/Documentation/ABI/testing/debugfs-driver-habanalabs
+++ b/Documentation/ABI/testing/debugfs-driver-habanalabs
@@ -182,7 +182,8 @@ Date:           May 2022
 KernelVersion:  5.19
 Contact:        dhirschfeld@habana.ai
 Description:    The value to which the dram will be set to when the user
-                scrubs the dram using 'memory_scrub' debugfs file
+                scrubs the dram using 'memory_scrub' debugfs file and
+                the scrubbing value when using module param 'memory_scrub'
 
 What:           /sys/kernel/debug/habanalabs/hl<n>/mmu
 Date:           Jan 2019
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;
-- 
2.25.1


  parent reply	other threads:[~2022-06-23 20:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-23 20:42 [PATCH 1/9] habanalabs: move memory_scrub_val to hdev struct Oded Gabbay
2022-06-23 20:42 ` [PATCH 2/9] habanalabs/gaudi: fix warning: var might be used uninitialized Oded Gabbay
2022-06-23 20:42 ` [PATCH 3/9] habanalabs/gaudi: fix a race condition causing DMAR error Oded Gabbay
2022-06-23 20:42 ` [PATCH 4/9] habanalabs: print if firmware is secured during load Oded Gabbay
2022-06-23 20:42 ` [PATCH 5/9] habanalabs: don't do memory scrubbing when unmapping Oded Gabbay
2022-06-23 20:42 ` [PATCH 6/9] habanalabs: don't send addr and size to scrub_device_mem cb Oded Gabbay
2022-06-23 20:42 ` Oded Gabbay [this message]
2022-06-23 20:42 ` [PATCH 8/9] habanalabs: move call to scrub_device_mem after ctx_fini Oded Gabbay
2022-06-23 20:42 ` [PATCH 9/9] habanalabs: set default value for memory_scrub 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=20220623204212.1628709-7-ogabbay@kernel.org \
    --to=ogabbay@kernel.org \
    --cc=dhirschfeld@habana.ai \
    --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).