diff options
author | Mathieu Poirier <mathieu.poirier@linaro.org> | 2020-07-14 13:50:35 -0600 |
---|---|---|
committer | Bjorn Andersson <bjorn.andersson@linaro.org> | 2020-07-16 23:06:15 -0700 |
commit | 4a4dca1941fedc1b02635ff0b4ed51b9857d0382 (patch) | |
tree | 574f2c6fcdb58e1e8e5eed206c30854f971f4e0c /drivers/remoteproc/remoteproc_core.c | |
parent | 4d3ebb3b99905e0e1c83b320764495f5fc3f93fe (diff) | |
download | lwn-4a4dca1941fedc1b02635ff0b4ed51b9857d0382.tar.gz lwn-4a4dca1941fedc1b02635ff0b4ed51b9857d0382.zip |
remoteproc: Properly handle firmware name when attaching
This patch prevents the firmware image name from being displayed when
the remoteproc core is attaching to a remote processor. This is needed
needed since there is no guarantee about the nature of the firmware
image that is loaded by the external entity.
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Reviewed-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Tested-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Link: https://lore.kernel.org/r/20200714195035.1426873-10-mathieu.poirier@linaro.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Diffstat (limited to 'drivers/remoteproc/remoteproc_core.c')
-rw-r--r-- | drivers/remoteproc/remoteproc_core.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index 565778ccb39c..1b52004655ab 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -1627,6 +1627,14 @@ static int rproc_stop(struct rproc *rproc, bool crashed) rproc->state = RPROC_OFFLINE; + /* + * The remote processor has been stopped and is now offline, which means + * that the next time it is brought back online the remoteproc core will + * be responsible to load its firmware. As such it is no longer + * autonomous. + */ + rproc->autonomous = false; + dev_info(dev, "stopped remote processor %s\n", rproc->name); return 0; @@ -2145,6 +2153,16 @@ int rproc_add(struct rproc *rproc) /* create debugfs entries */ rproc_create_debug_dir(rproc); + /* + * Remind ourselves the remote processor has been attached to rather + * than booted by the remoteproc core. This is important because the + * RPROC_DETACHED state will be lost as soon as the remote processor + * has been attached to. Used in firmware_show() and reset in + * rproc_stop(). + */ + if (rproc->state == RPROC_DETACHED) + rproc->autonomous = true; + /* if rproc is marked always-on, request it to boot */ if (rproc->auto_boot) { ret = rproc_trigger_auto_boot(rproc); |