diff options
author | Suman Anna <s-anna@ti.com> | 2023-01-06 13:10:44 +0100 |
---|---|---|
committer | Mathieu Poirier <mathieu.poirier@linaro.org> | 2023-01-06 17:15:19 +0100 |
commit | 2da812ffcd11c31ef897615798a8a66041a5b73b (patch) | |
tree | 4da2089ce605f4c58243c0e6275685b240495930 /drivers/remoteproc | |
parent | remoteproc: pru: Add APIs to get and put the PRU cores (diff) | |
download | linux-2da812ffcd11c31ef897615798a8a66041a5b73b.tar.xz linux-2da812ffcd11c31ef897615798a8a66041a5b73b.zip |
remoteproc: pru: Make sysfs entries read-only 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 'sysfs_read_only' 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>
Signed-off-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
Reviewed-by: Roger Quadros <rogerq@kernel.org>
Link: https://lore.kernel.org/r/20230106121046.886863-5-danishanwar@ti.com
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Diffstat (limited to 'drivers/remoteproc')
-rw-r--r-- | drivers/remoteproc/pru_rproc.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/remoteproc/pru_rproc.c b/drivers/remoteproc/pru_rproc.c index 1036bfd446b6..c16242e2d435 100644 --- a/drivers/remoteproc/pru_rproc.c +++ b/drivers/remoteproc/pru_rproc.c @@ -223,6 +223,7 @@ struct rproc *pru_rproc_get(struct device_node *np, int index, } pru->client_np = np; + rproc->sysfs_read_only = true; mutex_unlock(&pru->lock); @@ -261,6 +262,7 @@ void pru_rproc_put(struct rproc *rproc) } pru->client_np = NULL; + rproc->sysfs_read_only = false; mutex_unlock(&pru->lock); rproc_put(rproc); |