[PATCH 1/4] umr: Print errors to stderr

Luben Tuikov luben.tuikov at amd.com
Thu Mar 10 00:42:23 UTC 2022


Print the following error message,
   Invalid gca config data header
to stderr, since printing it to stdout,
confuses parser scripts.

Also modify this message to be clearer. For instance,
   Invalid or unknown GCA config data header version:4

Cc: Alex Deucher <Alexander.Deucher at amd.com>
Cc: Tom StDenis <tom.stdenis at amd.com>
Signed-off-by: Luben Tuikov <luben.tuikov at amd.com>
---
 src/lib/scan_config.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/lib/scan_config.c b/src/lib/scan_config.c
index c7f4e9d3c69faa..3503bbd92a104a 100644
--- a/src/lib/scan_config.c
+++ b/src/lib/scan_config.c
@@ -122,7 +122,7 @@ static uint64_t read_int_drm(int cardno, char *fname)
 }
 
 /**
- * umr_scan_config - Scan the debugfs confiruration data
+ * umr_scan_config - Scan the debugfs configuration data
  */
 int umr_scan_config(struct umr_asic *asic, int xgmi_scan)
 {
@@ -246,7 +246,9 @@ gca_config:
 		case 4: parse_rev4(asic, data, &r);
 			break;
 		default:
-			printf("Invalid gca config data header\n");
+			fprintf(stderr,
+				"Invalid or unknown GCA config data header version:%d\n",
+				data[0]);
 			return -1;
 	}
 

base-commit: 818bb1e8f1b5a26fda0e3d7abfc1e68605ebad28
-- 
2.35.1.291.gdab1b7905d



More information about the amd-gfx mailing list