diff options
| author | Jingyi Wang <jingyi.wang@oss.qualcomm.com> | 2026-06-23 02:05:34 -0700 |
|---|---|---|
| committer | Bjorn Andersson <andersson@kernel.org> | 2026-07-15 12:18:05 -0500 |
| commit | 026a3fada43261e403c6c4d9bda9501547e3f108 (patch) | |
| tree | b9490697c05ed65f0d5328acfca00adfcf4c166a /include/linux | |
| parent | 3d88927742c6073d5eb772886a98aed014d50180 (diff) | |
remoteproc: core: Attach rproc asynchronously in rproc_add() path via schedule_work()
Unlike the remoteproc firmware load path where rproc_add() call
rproc_auto_boot_callback() asynchronously and ignores the return value of
rproc_boot(), the attach path calls rproc_boot() synchronously and
propagates its return value back to rproc_add(). This means a failure
during rproc_attach() causes rproc_add() to fail and triggers resource
release, removing the remoteproc from sysfs and making it unavailable for
recovery or further boot attempts.
Align the remoteproc attach path with the firmware load path by
introducing attach_work and scheduling rproc_boot() asynchronously via
schedule_work(). This keeps the remoteproc registered and available in
sysfs even if the initial attach attempt fails, and avoids blocking
rproc_add() on the attach result.
Signed-off-by: Jingyi Wang <jingyi.wang@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20260623-rproc-attach-issue-v3-1-8e24310707ce@oss.qualcomm.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/remoteproc.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h index 7c1546d48008..f1d14d075bf3 100644 --- a/include/linux/remoteproc.h +++ b/include/linux/remoteproc.h @@ -259,6 +259,7 @@ enum rproc_features { * @subdevs: list of subdevices, to following the running state * @notifyids: idr for dynamically assigning rproc-wide unique notify ids * @index: index of this rproc device + * @attach_work: workqueue for attaching rproc * @crash_handler: workqueue for handling a crash * @crash_cnt: crash counter * @recovery_disabled: flag that state if recovery was disabled @@ -301,6 +302,7 @@ struct rproc { struct list_head subdevs; struct idr notifyids; int index; + struct work_struct attach_work; struct work_struct crash_handler; unsigned int crash_cnt; bool recovery_disabled; |
