From 570dfe1ed4ab5458d757a981b986845b66adb292 Mon Sep 17 00:00:00 2001 From: Randall Huang Date: Wed, 16 Oct 2024 16:29:59 +0800 Subject: [PATCH] storage: support new UFS error history algorithm Bug: 359746077 Test: adb bugreport Change-Id: I52a7ae0f1f9b60349437c0b3b5de630dd41b5627 Signed-off-by: Randall Huang --- storage/dump_storage.cpp | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/storage/dump_storage.cpp b/storage/dump_storage.cpp index e6b3e4c..47c5e76 100644 --- a/storage/dump_storage.cpp +++ b/storage/dump_storage.cpp @@ -221,14 +221,23 @@ int main() { read_buffer(18, 131072, "kioxia_12_ufs_err_history.dat"); break; case 0x1AD: //SKhynix - read_buffer(0, 4096, "hynix_00_ufs_err_history.dat"); - read_buffer(16, 131072, "skhynix_10_ufs_err_history.dat"); - read_buffer(17, 131072, "skhynix_11_ufs_err_history.dat"); - read_buffer(18, 131072, "skhynix_12_ufs_err_history.dat"); - read_buffer(19, 131072, "skhynix_13_ufs_err_history.dat"); + if (!strcmp(ufs_ver.c_str(), "0x0310")) { + read_buffer(0, 4096, "skhynix_00_ufs_err_history.dat"); + read_buffer(16, 131072, "skhynix_10_ufs_err_history.dat"); + read_buffer(17, 131072, "skhynix_11_ufs_err_history.dat"); + read_buffer(18, 131072, "skhynix_12_ufs_err_history.dat"); + read_buffer(19, 131072, "skhynix_13_ufs_err_history.dat"); + } else { + read_buffer(0, 4096, "skhynix_00_ufs_err_history.dat"); + read_buffer(16, 524288, "skhynix_10_ufs_err_history.dat"); + read_buffer(17, 524288, "skhynix_11_ufs_err_history.dat"); + } break; case 0x1CE: //SAMSUNG - read_buffer(16, 8404992, "samsung_10_ufs_err_history.dat"); + if (!strcmp(ufs_ver.c_str(), "0x0310")) + read_buffer(16, 8404992, "samsung_10_ufs_err_history.dat"); + else + read_buffer(16, 12599296, "samsung_10_ufs_err_history.dat"); break; default: break;