[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220418104118.12878-4-p-mohan@ti.com>
Date: Mon, 18 Apr 2022 16:11:16 +0530
From: Puranjay Mohan <p-mohan@...com>
To: <linux-kernel@...r.kernel.org>
CC: <bjorn.andersson@...aro.org>, <mathieu.poirier@...aro.org>,
<krzysztof.kozlowski+dt@...aro.org>,
<linux-remoteproc@...r.kernel.org>, <devicetree@...r.kernel.org>,
<nm@...com>, <ssantosh@...nel.org>, <s-anna@...com>,
<p-mohan@...com>, <linux-arm-kernel@...ts.infradead.org>,
<rogerq@...nel.org>, <grygorii.strashko@...com>, <vigneshr@...com>,
<kishon@...com>
Subject: [PATCH v3 3/5] remoteproc: pru: Make sysfs entries read-only for PRU client driven boots
From: Suman Anna <s-anna@...com>
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@...com>
Co-developed-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@...aro.org>
Signed-off-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@...aro.org>
Signed-off-by: Puranjay Mohan <p-mohan@...com>
---
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 7a35b400287a..9fed3e0372d3 100644
--- a/drivers/remoteproc/pru_rproc.c
+++ b/drivers/remoteproc/pru_rproc.c
@@ -231,6 +231,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);
@@ -265,6 +266,7 @@ void pru_rproc_put(struct rproc *rproc)
}
pru->client_np = NULL;
+ rproc->sysfs_read_only = false;
mutex_unlock(&pru->lock);
put_device(&rproc->dev);
--
2.17.1
Powered by blists - more mailing lists