From 076e3820595e50ca2aa75f3655c461a2a53428ef Mon Sep 17 00:00:00 2001
From: luckky <guodashun1@huawei.com>
Date: Fri, 1 Nov 2024 15:01:39 +0800
Subject: [PATCH] fix uint8 bug and change isolation default value

---
 src/c/hbm_online_repair/hbm_online_repair.env     | 2 +-
 src/c/hbm_online_repair/non-standard-hbm-repair.c | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/c/hbm_online_repair/hbm_online_repair.env b/src/c/hbm_online_repair/hbm_online_repair.env
index de56079..7166c8d 100644
--- a/src/c/hbm_online_repair/hbm_online_repair.env
+++ b/src/c/hbm_online_repair/hbm_online_repair.env
@@ -1,2 +1,2 @@
 HBM_ONLINE_REPAIR_LOG_LEVEL=1
-PAGE_ISOLATION_THRESHOLD=128
+PAGE_ISOLATION_THRESHOLD=3355443
diff --git a/src/c/hbm_online_repair/non-standard-hbm-repair.c b/src/c/hbm_online_repair/non-standard-hbm-repair.c
index f26d8ae..b8dde7a 100644
--- a/src/c/hbm_online_repair/non-standard-hbm-repair.c
+++ b/src/c/hbm_online_repair/non-standard-hbm-repair.c
@@ -359,7 +359,7 @@ static int write_file(char *path, const char *name, unsigned long long value)
 
     fd = open(fname, O_WRONLY);
     if (fd < 0) {
-        log(LOG_WARNING, "HBM ACLS: Cannot to open '%s': %s\n",
+        log(LOG_WARNING, "HBM: Cannot to open '%s': %s\n",
                     fname, strerror(errno));
         return -errno;
     }
@@ -367,7 +367,7 @@ static int write_file(char *path, const char *name, unsigned long long value)
     snprintf(buf, sizeof(buf), "0x%llx\n", value);
     ret = write(fd, buf, strlen(buf));
     if (ret <= 0)
-        log(LOG_WARNING, "HBM ACLS: Failed to set %s (0x%llx): %s\n",
+        log(LOG_WARNING, "HBM: Failed to set %s (0x%llx): %s\n",
                     fname, value, strerror(errno));
 
     close(fd);
@@ -557,7 +557,7 @@ static int hbmc_hbm_page_isolate(const struct hisi_common_error_section *err)
     return ret < 0 ? ret : 0;
 }
 
-static int hbmc_hbm_after_repair(bool is_acls, const int repair_ret, const unsigned long long paddr)
+static uint8_t hbmc_hbm_after_repair(bool is_acls, const int repair_ret, const unsigned long long paddr)
 {
     int ret;
     if (repair_ret <= 0) {
@@ -577,7 +577,7 @@ static int hbmc_hbm_after_repair(bool is_acls, const int repair_ret, const unsig
     }
 }
 
-static uint8_t hbmc_hbm_repair(const struct hisi_common_error_section *err, char *path)
+static int hbmc_hbm_repair(const struct hisi_common_error_section *err, char *path)
 {
     unsigned long long paddr;
     int ret;
-- 
2.43.0

