From: Tomer Tayar Date: Fri, 18 Nov 2022 13:08:33 +0000 (+0200) Subject: habanalabs: fix rc when new CPUCP opcodes are not supported X-Git-Tag: v6.2-rc1~67^2~6^2~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=56fb517775f4d71dbca2b1fb3562276138361072;p=thirdparty%2Fkernel%2Flinux.git 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 Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- diff --git a/drivers/misc/habanalabs/common/firmware_if.c b/drivers/misc/habanalabs/common/firmware_if.c index c0909d76d6eb2..cf8147e438335 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; }