]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
remoteproc: imx_dsp_rproc: Skip RP_MBOX_SUSPEND_SYSTEM when mailbox TX channel is...
authorIuliana Prodan <iuliana.prodan@nxp.com>
Thu, 4 Dec 2025 12:28:23 +0000 (14:28 +0200)
committerMathieu Poirier <mathieu.poirier@linaro.org>
Mon, 15 Dec 2025 02:04:21 +0000 (19:04 -0700)
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>
Link: https://lore.kernel.org/r/20251204122825.756106-1-iuliana.prodan@oss.nxp.com
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
drivers/remoteproc/imx_dsp_rproc.c

index 5130a35214c92999bd7ddeea57089e98195599fa..f51deaacc7008fa2d5a65ccc01986072051f6490 100644 (file)
@@ -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 */