public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH v2 1/3] remoteproc: imx_dsp_rproc: Skip RP_MBOX_SUSPEND_SYSTEM when mailbox TX channel is uninitialized
@ 2025-12-04 12:28 Iuliana Prodan (OSS)
  2025-12-04 12:28 ` [PATCH v2 2/3] remoteproc: imx_dsp_rproc: Rename macro to reflect multiple contexts Iuliana Prodan (OSS)
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Iuliana Prodan (OSS) @ 2025-12-04 12:28 UTC (permalink / raw)
  To: Bjorn Andersson, Mathieu Poirier, Shawn Guo, Sascha Hauer,
	S.J. Wang, Fabio Estevam, Daniel Baluta, Iuliana Prodan
  Cc: imx, linux-remoteproc, linux-arm-kernel, linux-kernel,
	Pengutronix Kernel Team

From: Iuliana Prodan <iuliana.prodan@nxp.com>

Firmwares that do not use mailbox communication (e.g., the hello_world
sample) leave priv->tx_ch as NULL. The current suspend logic
unconditionally sends RP_MBOX_SUSPEND_SYSTEM, which is invalid without
an initialized TX channel.

Detect the no_mailboxes case early and skip sending the suspend
message. Instead, proceed directly to the runtime PM suspend path,
which is the correct behavior for firmwares that cannot respond to
mailbox requests.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
---
Changes since v1:
- Wrapped commit message to 75 characters
- Changed dev_err to dev_dbg since this case is normal behavior
---
 drivers/remoteproc/imx_dsp_rproc.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/remoteproc/imx_dsp_rproc.c b/drivers/remoteproc/imx_dsp_rproc.c
index 5130a35214c9..f51deaacc700 100644
--- a/drivers/remoteproc/imx_dsp_rproc.c
+++ b/drivers/remoteproc/imx_dsp_rproc.c
@@ -1242,6 +1242,15 @@ static int imx_dsp_suspend(struct device *dev)
 	if (rproc->state != RPROC_RUNNING)
 		goto out;
 
+	/*
+	 * No channel available for sending messages;
+	 * indicates no mailboxes present, so trigger PM runtime suspend
+	 */
+	if (!priv->tx_ch) {
+		dev_dbg(dev, "No initialized mbox tx channel, suspend directly.\n");
+		goto out;
+	}
+
 	reinit_completion(&priv->pm_comp);
 
 	/* Tell DSP that suspend is happening */
-- 
2.25.1



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

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

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-04 12:28 [PATCH v2 1/3] remoteproc: imx_dsp_rproc: Skip RP_MBOX_SUSPEND_SYSTEM when mailbox TX channel is uninitialized Iuliana Prodan (OSS)
2025-12-04 12:28 ` [PATCH v2 2/3] remoteproc: imx_dsp_rproc: Rename macro to reflect multiple contexts Iuliana Prodan (OSS)
2025-12-04 17:17   ` Frank Li
2025-12-09 14:10   ` Daniel Baluta
2025-12-04 12:28 ` [PATCH v2 3/3] remoteproc: imx_dsp_rproc: Wait for suspend ACK only if WAIT_FW_CONFIRMATION is set Iuliana Prodan (OSS)
2025-12-04 17:20   ` Frank Li
2025-12-09 14:11   ` Daniel Baluta
2025-12-09 14:09 ` [PATCH v2 1/3] remoteproc: imx_dsp_rproc: Skip RP_MBOX_SUSPEND_SYSTEM when mailbox TX channel is uninitialized Daniel Baluta
2025-12-15  2:11 ` Mathieu Poirier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox