Files
BPI-CM9-Linux/build/patch/kernel/archive/spacemit-6.6/016-Spacemit-prevent-uninitialized-thread-shutdown.patch

36 lines
1.2 KiB
Diff

From 0c0474a3c58a057d84e82e092eeaef2df9d9766b Mon Sep 17 00:00:00 2001
From: Sven-Ola Tuecke <[email protected]>
Date: Tue, 3 Feb 2026 15:49:29 +0100
Subject: [PATCH] Spacemit: prevent uninitialized thread shutdown
Signed-off-by: Sven-Ola Tuecke <[email protected]>
---
drivers/remoteproc/k1x-rproc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/remoteproc/k1x-rproc.c b/drivers/remoteproc/k1x-rproc.c
index e2cbb9cb78..ef4dc7794e 100644
--- a/drivers/remoteproc/k1x-rproc.c
+++ b/drivers/remoteproc/k1x-rproc.c
@@ -825,7 +825,7 @@ static int spacemit_rproc_remove(struct platform_device *pdev)
struct spacemit_rproc *ddata = rproc->priv;
for (i = 0; i < MAX_MBOX; ++i)
- if (ddata->mb[i].kthread_running)
+ if (ddata->mb[i].kthread_running && ddata->mb[i].mb_thread)
kthread_stop(ddata->mb[i].mb_thread);
rproc_del(rproc);
@@ -863,7 +863,7 @@ static void spacemit_rproc_shutdown(struct platform_device *pdev)
for (i = 0; i < MAX_MBOX; ++i) {
/* release the resource of rt thread */
- if (priv->mb[i].kthread_running) {
+ if (priv->mb[i].kthread_running && priv->mb[i].mb_thread) {
if (!frozen((priv->mb[i].mb_thread)))
kthread_stop(priv->mb[i].mb_thread);
}
--
2.34.1