From 7740384eab26998006e54c9b60c1721ea744cdb1 Mon Sep 17 00:00:00 2001 From: Jonathan Kim Date: Mon, 4 May 2020 10:31:20 -0400 Subject: [PATCH] libhsakmt: queue suspend/resume can return non-zero positive values New queue suspend/resume update can now return the number of successful queue requests so return success if IOCTL return is non-negative. This should be backwards compatible since old queue suspend/resume returns 0 on success. Signed-off-by: Jonathan Kim Change-Id: I06b70d95d203b2bfc19a0cc1b88c5719c695159a [ROCm/ROCR-Runtime commit: 93c333711a6503a739555097fa3c35a63277dc90] --- projects/rocr-runtime/src/debug.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/projects/rocr-runtime/src/debug.c b/projects/rocr-runtime/src/debug.c index 92cbaeb186..f7d9cbd22d 100644 --- a/projects/rocr-runtime/src/debug.c +++ b/projects/rocr-runtime/src/debug.c @@ -325,7 +325,11 @@ static HSAKMT_STATUS debug_trap(HSAuint32 NodeId, if (argout) *argout = args; - if (err == 0) + if ((op == KFD_IOC_DBG_TRAP_NODE_SUSPEND || + op == KFD_IOC_DBG_TRAP_NODE_RESUME) && err >= 0 && + err <= args.data2) + result = HSAKMT_STATUS_SUCCESS; + else if (err == 0) result = HSAKMT_STATUS_SUCCESS; else result = HSAKMT_STATUS_ERROR;