Re: [PATCH v2] firmware: stratix10-rsu: Add synchronous fallback for async SVC operations

From: Dinh Nguyen

Date: Mon Jul 13 2026 - 08:46:24 EST




On 7/10/26 02:04, tze.yee.ng@xxxxxxxxxx wrote:
From: Mahesh Rao <mahesh.rao@xxxxxxxxxx>

The RSU driver was migrated to the Stratix10 asynchronous service
framework, which assumes async client registration always succeeds. On
platforms where the async controller is unavailable or RSU async support
is not present, probe fails or sysfs operations cannot reach firmware.

Detect async capability at probe via stratix10_svc_add_async_client() and
fall back to the legacy synchronous rsu_send_msg() path when registration
fails. Track capability in priv->async and branch accordingly for:

- Initial RSU status and retry counter during probe (retry is bundled in
async status; issue COMMAND_RSU_RETRY separately in sync mode)
- notify sysfs store (notify, status, and retry)
- SPT table retrieval (COMMAND_RSU_GET_SPT_TABLE async vs mbox
COMMAND_MBOX_SEND_CMD synchronous)

Restore synchronous callbacks (rsu_status_callback, rsu_retry_callback,
rsu_get_spt_callback) and wire COMMAND_MBOX_SEND_CMD payload handling in
__rsu_send_msg_locked.

Improve probe and remove cleanup: return on intermediate probe failures,
remove the async client when registered, and free the SPT response buffer
on sync-path allocation errors.

Suggested-by: Anders Hedlund <anders.hedlund@xxxxxxxxxxxxx>
Signed-off-by: Mahesh Rao <mahesh.rao@xxxxxxxxxx>
Signed-off-by: Asyraaf Azhar <mohamad.asyraaf.azhar@xxxxxxxxxx>
Signed-off-by: Tze Yee Ng <tze.yee.ng@xxxxxxxxxx>
---
Changes in v2:
- The functional change is unchanged from v1.
- Rebased onto dinguyen/socfpga_firmware_for_v7.3 for v7.3 integration,
instead of the v1 base. That tree already includes the QSPI device-info
series (COMMAND_RSU_GET_DEVICE_INFO probe path and sysfs) and the probe
teardown refactor (__rsu_send_msg_locked() / rsu_send_msg() split, goto
remove_async_client / goto free_channel labels).
- Wire COMMAND_MBOX_SEND_CMD payload handling in __rsu_send_msg_locked()
instead of rsu_send_msg(), matching the rebased locking model
(lockdep_assert_held(&priv->lock)).
- Add kernel-doc for priv->get_spt_response_buf in struct
stratix10_rsu_priv.
---
drivers/firmware/stratix10-rsu.c | 227 ++++++++++++++++++++++++++++---
1 file changed, 207 insertions(+), 20 deletions(-)


Applied!

Thanks,
Dinh