]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
firmware: stratix10-svc: handle NO_RESPONSE in async poll
authorAdrian Ng Ho Yin <adrian.ho.yin.ng@altera.com>
Tue, 14 Jul 2026 05:37:46 +0000 (13:37 +0800)
committerDinh Nguyen <dinguyen@kernel.org>
Tue, 14 Jul 2026 21:33:21 +0000 (16:33 -0500)
Define INTEL_SIP_SMC_STATUS_NO_RESPONSE (0x3) and handle it in
stratix10_svc_async_poll() the same way as INTEL_SIP_SMC_STATUS_BUSY,
returning -EAGAIN so callers can retry instead of treating the poll as
a hard failure.

When the Secure Device Manager has not yet produced a response for an
asynchronous transaction, ATF is expected to return
INTEL_SIP_SMC_STATUS_NO_RESPONSE. Without this handling, the service
layer maps the status to -EINVAL and async clients cannot distinguish
"not ready yet" from a real error.

Fixes: bcb9f4f07061 ("firmware: stratix10-svc: Add support for async communication")
Cc: stable@vger.kernel.org
Signed-off-by: Adrian Ng Ho Yin <adrian.ho.yin.ng@altera.com>
Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
drivers/firmware/stratix10-svc.c
include/linux/firmware/intel/stratix10-smc.h

index 6306b79a14a12ead5369c87a9fd65ed24dc5d1c5..c346f5fd397f3aad0097157dd6d17b5741508059 100644 (file)
@@ -1499,8 +1499,9 @@ int stratix10_svc_async_poll(struct stratix10_svc_chan *chan,
                        WARN_ON_ONCE(1);
                }
                return 0;
-       } else if (handle->res.a0 == INTEL_SIP_SMC_STATUS_BUSY) {
-               dev_dbg(ctrl->dev, "async message is still in progress\n");
+       } else if (handle->res.a0 == INTEL_SIP_SMC_STATUS_BUSY ||
+                  handle->res.a0 == INTEL_SIP_SMC_STATUS_NO_RESPONSE) {
+               dev_dbg(ctrl->dev, "async message is not ready yet\n");
                return -EAGAIN;
        }
 
index 2c603a24967fc9cd6223cf1576535961b23bfa1e..9224974fffc47cd6a5afdd35af090e7c62d85795 100644 (file)
@@ -67,6 +67,9 @@
  * INTEL_SIP_SMC_STATUS_REJECTED:
  * Secure monitor software reject the service client's request.
  *
+ * INTEL_SIP_SMC_STATUS_NO_RESPONSE:
+ * Secure monitor software has no response for the request yet.
+ *
  * INTEL_SIP_SMC_STATUS_ERROR:
  * There is error during the process of service request.
  *
@@ -77,6 +80,7 @@
 #define INTEL_SIP_SMC_STATUS_OK                                0x0
 #define INTEL_SIP_SMC_STATUS_BUSY                      0x1
 #define INTEL_SIP_SMC_STATUS_REJECTED                  0x2
+#define INTEL_SIP_SMC_STATUS_NO_RESPONSE               0x3
 #define INTEL_SIP_SMC_STATUS_ERROR                     0x4
 #define INTEL_SIP_SMC_RSU_ERROR                                0x7