diff options
author | Suman Anna | 2019-02-18 20:03:11 -0600 |
---|---|---|
committer | Suman Anna | 2019-02-23 19:20:51 -0600 |
commit | f21ae007405457dc0b6fec6c4506561c96c30410 (patch) | |
tree | 3e8cc36b0456a2081ed61dacb52ac8bdf360df3d | |
parent | 134a38de54986da890e45aa73d3a8ca4e76d3ac0 (diff) | |
download | remoteproc-f21ae007405457dc0b6fec6c4506561c96c30410.tar.gz remoteproc-f21ae007405457dc0b6fec6c4506561c96c30410.tar.xz remoteproc-f21ae007405457dc0b6fec6c4506561c96c30410.zip |
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>
-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 ae18d27b3a60..a7c6e523726c 100644 --- a/drivers/remoteproc/pru_rproc.c +++ b/drivers/remoteproc/pru_rproc.c | |||
@@ -182,6 +182,7 @@ struct rproc *pru_rproc_get(struct device_node *np, int index) | |||
182 | } | 182 | } |
183 | 183 | ||
184 | pru->client_np = np; | 184 | pru->client_np = np; |
185 | rproc->deny_sysfs_ops = 1; | ||
185 | 186 | ||
186 | mutex_unlock(&pru->lock); | 187 | mutex_unlock(&pru->lock); |
187 | 188 | ||
@@ -213,6 +214,7 @@ void pru_rproc_put(struct rproc *rproc) | |||
213 | 214 | ||
214 | mutex_lock(&pru->lock); | 215 | mutex_lock(&pru->lock); |
215 | pru->client_np = NULL; | 216 | pru->client_np = NULL; |
217 | rproc->deny_sysfs_ops = 0; | ||
216 | mutex_unlock(&pru->lock); | 218 | mutex_unlock(&pru->lock); |
217 | 219 | ||
218 | put_device(&rproc->dev); | 220 | put_device(&rproc->dev); |