aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuman Anna <s-anna@ti.com>2019-02-18 20:03:11 -0600
committerGrzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>2020-12-21 23:25:39 +0100
commitf28e22548c9fd024c23cc0adc7b72dd2bcb84a28 (patch)
treece610b949e00f1577b4d3ff0af042fc868a81310
parenta2d47ee4963446a19129bdcabe829c8235482987 (diff)
downloadlinux-f28e22548c9fd024c23cc0adc7b72dd2bcb84a28.tar.gz
remoteproc: pru: Deny rproc sysfs ops for PRU client driven boots
The PRU remoteproc driver is not configured for 'auto-boot' by default, and allows to be booted either by in-kernel PRU client drivers or by userspace using the generic remoteproc sysfs interfaces. The sysfs interfaces should not be permitted to change the remoteproc firmwares or states when a PRU is being managed by an in-kernel client driver. Use the newly introduced remoteproc generic 'deny_sysfs_ops' flag to provide these restrictions by setting and clearing it appropriately during the PRU acquire and release steps. Signed-off-by: Suman Anna <s-anna@ti.com> Co-developed-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org> Signed-off-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
-rw-r--r--drivers/remoteproc/pru_rproc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/remoteproc/pru_rproc.c b/drivers/remoteproc/pru_rproc.c
index 568286040bc4..3ffd49f77cfc 100644
--- a/drivers/remoteproc/pru_rproc.c
+++ b/drivers/remoteproc/pru_rproc.c
@@ -228,6 +228,7 @@ struct rproc *pru_rproc_get(struct device_node *np, int index,
}
pru->client_np = np;
+ rproc->deny_sysfs_ops = true;
mutex_unlock(&pru->lock);
@@ -258,6 +259,7 @@ void pru_rproc_put(struct rproc *rproc)
mutex_lock(&pru->lock);
pru->client_np = NULL;
+ rproc->deny_sysfs_ops = false;
mutex_unlock(&pru->lock);
put_device(&rproc->dev);