Commit 83d4e671 authored by Mathieu Poirier's avatar Mathieu Poirier Committed by Bjorn Andersson
Browse files

remoteproc: Properly deal with a start request when attached



This patch takes into account scenarios where a remote processor
has been attached to when receiving a "start" command from sysfs.

As with the case with the running state, the command can't be
carried out if the remote processor is already in operation.

Signed-off-by: default avatarMathieu Poirier <mathieu.poirier@linaro.org>
Reviewed-by: default avatarArnaud Pouliquen <arnaud.pouliquen@st.com>
Link: https://lore.kernel.org/r/20210312162453.1234145-15-mathieu.poirier@linaro.org


Signed-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
parent 800dad00
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -32,7 +32,8 @@ static ssize_t rproc_cdev_write(struct file *filp, const char __user *buf, size_
		return -EFAULT;

	if (!strncmp(cmd, "start", len)) {
		if (rproc->state == RPROC_RUNNING)
		if (rproc->state == RPROC_RUNNING ||
		    rproc->state == RPROC_ATTACHED)
			return -EBUSY;

		ret = rproc_boot(rproc);
+2 −1
Original line number Diff line number Diff line
@@ -194,7 +194,8 @@ static ssize_t state_store(struct device *dev,
	int ret = 0;

	if (sysfs_streq(buf, "start")) {
		if (rproc->state == RPROC_RUNNING)
		if (rproc->state == RPROC_RUNNING ||
		    rproc->state == RPROC_ATTACHED)
			return -EBUSY;

		ret = rproc_boot(rproc);