@@ -73,6 +73,7 @@ static ssize_t firmware_store(struct device *dev,
[RPROC_SUSPENDED] = "suspended",
[RPROC_RUNNING] = "running",
[RPROC_CRASHED] = "crashed",
+ [RPROC_DELETED] = "deleted",
[RPROC_LAST] = "invalid",
};
@@ -346,6 +346,7 @@ struct rproc_ops {
* a message.
* @RPROC_RUNNING: device is up and running
* @RPROC_CRASHED: device has crashed; need to start recovery
+ * @RPROC_DELETED: device is deleted
* @RPROC_LAST: just keep this one at the end
*
* Please note that the values of these states are used as indices
@@ -359,7 +360,8 @@ enum rproc_state {
RPROC_SUSPENDED = 1,
RPROC_RUNNING = 2,
RPROC_CRASHED = 3,
- RPROC_LAST = 4,
+ RPROC_DELETED = 4,
+ RPROC_LAST = 5,
};
/**
Add new state RPROC_DELETED to handle synchronization between rproc_del() and other operations on rproc. This state represents the rproc device that has been "deleted". CC: Loic Pallardy <loic.pallardy@st.com> CC: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Sarangdhar Joshi <spjoshi@codeaurora.org> --- The current patch series is a v2 version of original patch listed at https://lkml.org/lkml/2016/12/16/534 Changes from v1: * Add new RPROC_DELETED state * Use the new state RPROC_DELETED to handle race between rproc_del() and rproc_boot() drivers/remoteproc/remoteproc_sysfs.c | 1 + include/linux/remoteproc.h | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-)