mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiawen Liu <1298662399@qq.com>
To: Bjorn Andersson <andersson@kernel.org>,
	Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] remoteproc: da8xx: handle reserved-memory cleanup registration failure
Date: Sun, 29 Nov 2026 16:46:19 +0400	[thread overview]
Message-ID: <tencent_C81C200575A59C3800DB7EB32A0BEA318A09@qq.com> (raw)

After attaching a device-specific reserved-memory region, the driver
registers a devres action to release it. If registering that action
fails, the reset helper releases the region immediately, but the ignored
error lets probe continue without the configured DMA pool.

Propagate the registration failure before internal-memory setup or remote
processor registration. A subsequent firmware carveout allocation can
otherwise use the wrong DMA area or fail.

Fixes: 16689f33e5ad ("remoteproc: da8xx: Use devm action to release reserved memory")
Signed-off-by: Jiawen Liu <1298662399@qq.com>
---
 drivers/remoteproc/da8xx_remoteproc.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/remoteproc/da8xx_remoteproc.c b/drivers/remoteproc/da8xx_remoteproc.c
index e57dcb5598dfa..38b3801449d56 100644
--- a/drivers/remoteproc/da8xx_remoteproc.c
+++ b/drivers/remoteproc/da8xx_remoteproc.c
@@ -269,7 +269,10 @@ static int da8xx_rproc_probe(struct platform_device *pdev)
 		ret = of_reserved_mem_device_init(dev);
 		if (ret)
 			return dev_err_probe(dev, ret, "device does not have specific CMA pool\n");
-		devm_add_action_or_reset(&pdev->dev, da8xx_rproc_mem_release, &pdev->dev);
+		ret = devm_add_action_or_reset(&pdev->dev,
+					       da8xx_rproc_mem_release, &pdev->dev);
+		if (ret)
+			return ret;
 	}
 
 	ret = da8xx_rproc_get_internal_memories(pdev, drproc);
-- 
2.34.1


                 reply	other threads:[~2026-11-29 14:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tencent_C81C200575A59C3800DB7EB32A0BEA318A09@qq.com \
    --to=1298662399@qq.com \
    --cc=andersson@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®