* [PATCH v4] remoteproc: Add device awake calls in rproc boot and shutdown path
@ 2025-04-01 7:59 Souradeep Chowdhury
2025-04-03 8:01 ` Mukesh Ojha
0 siblings, 1 reply; 2+ messages in thread
From: Souradeep Chowdhury @ 2025-04-01 7:59 UTC (permalink / raw)
To: Mathieu Poirier, Bjorn Andersson, linux-remoteproc, linux-kernel
Cc: Souradeep Chowdhury
Add device awake calls in case of rproc boot and rproc shutdown path.
Currently, device awake call is only present in the recovery path
of remoteproc. If a user stops and starts rproc by using the sysfs
interface, then on pm suspension the firmware loading fails as the
request_firmware call under adsp_load returns failure. Add device
awake calls to fix this.
Signed-off-by: Souradeep Chowdhury <quic_schowdhu@quicinc.com>
---
Changes in v4
*Remove stability from mailing list
*Remove the extra tab in v3
*Change the commit description
drivers/remoteproc/remoteproc_core.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index c2cf0d277729..5d6c4e694b4c 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -1917,6 +1917,7 @@ int rproc_boot(struct rproc *rproc)
return -EINVAL;
}
+ pm_stay_awake(rproc->dev.parent);
dev = &rproc->dev;
ret = mutex_lock_interruptible(&rproc->lock);
@@ -1961,6 +1962,7 @@ int rproc_boot(struct rproc *rproc)
atomic_dec(&rproc->power);
unlock_mutex:
mutex_unlock(&rproc->lock);
+ pm_relax(rproc->dev.parent);
return ret;
}
EXPORT_SYMBOL(rproc_boot);
@@ -1991,6 +1993,7 @@ int rproc_shutdown(struct rproc *rproc)
struct device *dev = &rproc->dev;
int ret = 0;
+ pm_stay_awake(rproc->dev.parent);
ret = mutex_lock_interruptible(&rproc->lock);
if (ret) {
dev_err(dev, "can't lock rproc %s: %d\n", rproc->name, ret);
@@ -2027,6 +2030,7 @@ int rproc_shutdown(struct rproc *rproc)
rproc->table_ptr = NULL;
out:
mutex_unlock(&rproc->lock);
+ pm_relax(rproc->dev.parent);
return ret;
}
EXPORT_SYMBOL(rproc_shutdown);
--
2.34.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH v4] remoteproc: Add device awake calls in rproc boot and shutdown path
2025-04-01 7:59 [PATCH v4] remoteproc: Add device awake calls in rproc boot and shutdown path Souradeep Chowdhury
@ 2025-04-03 8:01 ` Mukesh Ojha
0 siblings, 0 replies; 2+ messages in thread
From: Mukesh Ojha @ 2025-04-03 8:01 UTC (permalink / raw)
To: Souradeep Chowdhury
Cc: Mathieu Poirier, Bjorn Andersson, linux-remoteproc, linux-kernel
On Tue, Apr 01, 2025 at 01:29:21PM +0530, Souradeep Chowdhury wrote:
> Add device awake calls in case of rproc boot and rproc shutdown path.
> Currently, device awake call is only present in the recovery path
> of remoteproc. If a user stops and starts rproc by using the sysfs
> interface, then on pm suspension the firmware loading fails as the
"firmware loading which relies on userspace to load the firmware may
fail as during suspend freezing of processes happens and due to which
usermodehelper gets disable."
> request_firmware call under adsp_load returns failure. Add device
> awake calls to fix this.
>
> Signed-off-by: Souradeep Chowdhury <quic_schowdhu@quicinc.com>
> ---
> Changes in v4
>
> *Remove stability from mailing list
> *Remove the extra tab in v3
> *Change the commit description
nit: It would have been better if you have added detail what are all thing
happened between as v1-v3 here and link to respective lore links.
Changes in v3:
..,
Changes in v2:
..,
>
> drivers/remoteproc/remoteproc_core.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
> index c2cf0d277729..5d6c4e694b4c 100644
> --- a/drivers/remoteproc/remoteproc_core.c
> +++ b/drivers/remoteproc/remoteproc_core.c
> @@ -1917,6 +1917,7 @@ int rproc_boot(struct rproc *rproc)
> return -EINVAL;
> }
>
> + pm_stay_awake(rproc->dev.parent);
> dev = &rproc->dev;
>
> ret = mutex_lock_interruptible(&rproc->lock);
> @@ -1961,6 +1962,7 @@ int rproc_boot(struct rproc *rproc)
> atomic_dec(&rproc->power);
> unlock_mutex:
> mutex_unlock(&rproc->lock);
> + pm_relax(rproc->dev.parent);
> return ret;
> }
> EXPORT_SYMBOL(rproc_boot);
> @@ -1991,6 +1993,7 @@ int rproc_shutdown(struct rproc *rproc)
> struct device *dev = &rproc->dev;
> int ret = 0;
>
> + pm_stay_awake(rproc->dev.parent);
> ret = mutex_lock_interruptible(&rproc->lock);
> if (ret) {
> dev_err(dev, "can't lock rproc %s: %d\n", rproc->name, ret);
> @@ -2027,6 +2030,7 @@ int rproc_shutdown(struct rproc *rproc)
> rproc->table_ptr = NULL;
> out:
> mutex_unlock(&rproc->lock);
> + pm_relax(rproc->dev.parent);
> return ret;
> }
> EXPORT_SYMBOL(rproc_shutdown);
Changes looks fine to me.
Feel free to add
Reviewed-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com>
-Mukesh
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-04-03 8:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-01 7:59 [PATCH v4] remoteproc: Add device awake calls in rproc boot and shutdown path Souradeep Chowdhury
2025-04-03 8:01 ` Mukesh Ojha
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®