From 0fa22cf38198d0f2377302ff9c0e9373ea8f1ea1 Mon Sep 17 00:00:00 2001 From: Harish Kasiviswanathan Date: Wed, 4 Aug 2021 10:39:32 -0400 Subject: [PATCH] Fall back to pci-ids if FRU product_name is empty rocm-smi --showproductname will not show "Card series" in its output if product_name exported by Kernel is empty string. This has been raised a regression by customer. BUG: SWDEV-297228 Signed-off-by: Harish Kasiviswanathan Change-Id: I9aae24778e2d3a30aa661d8f338278c1666590fb [ROCm/amdsmi commit: 7a8c3f362977254aa99e699b956c631a3d9598af] --- projects/amdsmi/src/rocm_smi.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/amdsmi/src/rocm_smi.cc b/projects/amdsmi/src/rocm_smi.cc index 45a1e3e1ea..ac9e9d86e3 100755 --- a/projects/amdsmi/src/rocm_smi.cc +++ b/projects/amdsmi/src/rocm_smi.cc @@ -1852,7 +1852,7 @@ rsmi_dev_name_get(uint32_t dv_ind, char *name, size_t len) { ret = get_dev_name_from_file(dv_ind, name, len); - if (ret) { + if (ret || name[0] == '\0') { ret = get_dev_name_from_id(dv_ind, name, len, NAME_STR_DEVICE); }