[lkml]   [2022]   [Dec]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Patch in this message
    Subject[PATCH v12 4/6] remoteproc: pru: Make sysfs entries read-only for PRU client driven boots
    From: Suman Anna <>

    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 <>
    Signed-off-by: Grzegorz Jaszczyk <>
    Signed-off-by: MD Danish Anwar <>
    Reviewed-by: Roger Quadros <>
    drivers/remoteproc/pru_rproc.c | 2 ++
    1 file changed, 2 insertions(+)

    diff --git a/drivers/remoteproc/pru_rproc.c b/drivers/remoteproc/pru_rproc.c
    index fe4ca1584e91..8e2fbe392ef3 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;


    @@ -261,6 +262,7 @@ void pru_rproc_put(struct rproc *rproc)

    pru->client_np = NULL;
    + rproc->sysfs_read_only = false;

     \ /
      Last update: 2022-12-16 06:34    [W:3.250 / U:0.028 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site