summaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
authorTomer Tayar <ttayar@habana.ai>2022-11-18 15:08:33 +0200
committerOded Gabbay <ogabbay@kernel.org>2022-11-23 16:44:02 +0200
commit56fb517775f4d71dbca2b1fb3562276138361072 (patch)
tree33241b54dc4fb5b41b399b464bf63c63f77dbdb2 /drivers/misc
parent6825b5f81f273fcc1ec61e7e203b0ea40d9987fc (diff)
downloadlinux-stable-56fb517775f4d71dbca2b1fb3562276138361072.tar.gz
linux-stable-56fb517775f4d71dbca2b1fb3562276138361072.tar.bz2
linux-stable-56fb517775f4d71dbca2b1fb3562276138361072.zip
habanalabs: fix rc when new CPUCP opcodes are not supported
When the new CPUCP opcodes are not supported and a CPUCP packet fails, the return value is the F/W error resposone which is a positive value. If this packet is sent from IOCTL and the positive value is used, the ICOTL will not be considered as unsuccessful. Signed-off-by: Tomer Tayar <ttayar@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/habanalabs/common/firmware_if.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/misc/habanalabs/common/firmware_if.c b/drivers/misc/habanalabs/common/firmware_if.c
index c0909d76d6eb..cf8147e43833 100644
--- a/drivers/misc/habanalabs/common/firmware_if.c
+++ b/drivers/misc/habanalabs/common/firmware_if.c
@@ -324,6 +324,7 @@ int hl_fw_send_cpu_message(struct hl_device *hdev, u32 hw_queue_id, u32 *msg,
if (!prop->supports_advanced_cpucp_rc) {
dev_dbg(hdev->dev, "F/W ERROR %d for CPU packet %d\n", rc, opcode);
+ rc = -EIO;
goto scrub_descriptor;
}