mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] remoteproc: imx_dsp_rproc: only reset carveout memory at RPROC_OFFLINE state
@ 2025-12-16  7:42 Shengjiu Wang
  2025-12-16  8:52 ` Daniel Baluta
  2025-12-17 23:06 ` Iuliana Prodan
  0 siblings, 2 replies; 3+ messages in thread
From: Shengjiu Wang @ 2025-12-16  7:42 UTC (permalink / raw)
  To: andersson, mathieu.poirier, shawnguo, s.hauer, kernel, festevam,
	daniel.baluta, linux-remoteproc, imx, linux-arm-kernel,
	linux-kernel

Don't need to reset memory at suspend and resume stage, because some
memory is used to save the software state for resume, if it is cleared,
the resume operation can fail.

Fixes: c4c432dfb00f ("remoteproc: imx_dsp_rproc: Add support of recovery and coredump process")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
---
 drivers/remoteproc/imx_dsp_rproc.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/remoteproc/imx_dsp_rproc.c b/drivers/remoteproc/imx_dsp_rproc.c
index d03017d6b214..ac8aa71aa56c 100644
--- a/drivers/remoteproc/imx_dsp_rproc.c
+++ b/drivers/remoteproc/imx_dsp_rproc.c
@@ -984,9 +984,11 @@ static int imx_dsp_rproc_load(struct rproc *rproc, const struct firmware *fw)
 	 * Clear buffers after pm rumtime for internal ocram is not
 	 * accessible if power and clock are not enabled.
 	 */
-	list_for_each_entry(carveout, &rproc->carveouts, node) {
-		if (carveout->va)
-			memset(carveout->va, 0, carveout->len);
+	if (rproc->state == RPROC_OFFLINE) {
+		list_for_each_entry(carveout, &rproc->carveouts, node) {
+			if (carveout->va)
+				memset(carveout->va, 0, carveout->len);
+		}
 	}
 
 	ret = imx_dsp_rproc_elf_load_segments(rproc, fw);
-- 
2.34.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] remoteproc: imx_dsp_rproc: only reset carveout memory at RPROC_OFFLINE state
  2025-12-16  7:42 [PATCH] remoteproc: imx_dsp_rproc: only reset carveout memory at RPROC_OFFLINE state Shengjiu Wang
@ 2025-12-16  8:52 ` Daniel Baluta
  2025-12-17 23:06 ` Iuliana Prodan
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Baluta @ 2025-12-16  8:52 UTC (permalink / raw)
  To: Shengjiu Wang
  Cc: andersson, mathieu.poirier, shawnguo, s.hauer, kernel, festevam,
	daniel.baluta, linux-remoteproc, imx, linux-arm-kernel,
	linux-kernel

On Tue, Dec 16, 2025 at 9:59 AM Shengjiu Wang <shengjiu.wang@nxp.com> wrote:
>
> Don't need to reset memory at suspend and resume stage, because some
> memory is used to save the software state for resume, if it is cleared,
> the resume operation can fail.

I would rephrase this as "Do not reset memory ...".

"Don't need .." suggests that this operation is unnecessary, but not wrong.

With that,

Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] remoteproc: imx_dsp_rproc: only reset carveout memory at RPROC_OFFLINE state
  2025-12-16  7:42 [PATCH] remoteproc: imx_dsp_rproc: only reset carveout memory at RPROC_OFFLINE state Shengjiu Wang
  2025-12-16  8:52 ` Daniel Baluta
@ 2025-12-17 23:06 ` Iuliana Prodan
  1 sibling, 0 replies; 3+ messages in thread
From: Iuliana Prodan @ 2025-12-17 23:06 UTC (permalink / raw)
  To: Shengjiu Wang, andersson, mathieu.poirier, shawnguo, s.hauer,
	kernel, festevam, daniel.baluta, linux-remoteproc, imx,
	linux-arm-kernel, linux-kernel

On 12/16/2025 9:42 AM, Shengjiu Wang wrote:
> Don't need to reset memory at suspend and resume stage, because some
> memory is used to save the software state for resume, if it is cleared,
> the resume operation can fail.
> 
> Fixes: c4c432dfb00f ("remoteproc: imx_dsp_rproc: Add support of recovery and coredump process")
> Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>

Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com>

Thanks,
Iulia

> ---
>   drivers/remoteproc/imx_dsp_rproc.c | 8 +++++---
>   1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/remoteproc/imx_dsp_rproc.c b/drivers/remoteproc/imx_dsp_rproc.c
> index d03017d6b214..ac8aa71aa56c 100644
> --- a/drivers/remoteproc/imx_dsp_rproc.c
> +++ b/drivers/remoteproc/imx_dsp_rproc.c
> @@ -984,9 +984,11 @@ static int imx_dsp_rproc_load(struct rproc *rproc, const struct firmware *fw)
>   	 * Clear buffers after pm rumtime for internal ocram is not
>   	 * accessible if power and clock are not enabled.
>   	 */
> -	list_for_each_entry(carveout, &rproc->carveouts, node) {
> -		if (carveout->va)
> -			memset(carveout->va, 0, carveout->len);
> +	if (rproc->state == RPROC_OFFLINE) {
> +		list_for_each_entry(carveout, &rproc->carveouts, node) {
> +			if (carveout->va)
> +				memset(carveout->va, 0, carveout->len);
> +		}
>   	}
>   
>   	ret = imx_dsp_rproc_elf_load_segments(rproc, fw);


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-12-18  2:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-16  7:42 [PATCH] remoteproc: imx_dsp_rproc: only reset carveout memory at RPROC_OFFLINE state Shengjiu Wang
2025-12-16  8:52 ` Daniel Baluta
2025-12-17 23:06 ` Iuliana Prodan

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®