From 4367b85577904f39d17922aa64cbbb33fc9377a5 Mon Sep 17 00:00:00 2001 From: Sven-Ola Tuecke Date: Tue, 3 Feb 2026 19:27:36 +0100 Subject: [PATCH] Spacemit: prevent uninitialized thread shutdown (triggerd by the rabbit) Signed-off-by: Sven-Ola Tuecke --- ...revent-uninitialized-thread-shutdown.patch | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 patch/kernel/archive/spacemit-6.18/018-Spacemit-prevent-uninitialized-thread-shutdown.patch diff --git a/patch/kernel/archive/spacemit-6.18/018-Spacemit-prevent-uninitialized-thread-shutdown.patch b/patch/kernel/archive/spacemit-6.18/018-Spacemit-prevent-uninitialized-thread-shutdown.patch new file mode 100644 index 0000000000..6422263882 --- /dev/null +++ b/patch/kernel/archive/spacemit-6.18/018-Spacemit-prevent-uninitialized-thread-shutdown.patch @@ -0,0 +1,36 @@ +From 30d1e1e8208b91cd67fbe2138af396f19442cf05 Mon Sep 17 00:00:00 2001 +From: Sven-Ola Tuecke +Date: Tue, 3 Feb 2026 15:49:29 +0100 +Subject: [PATCH] Spacemit: prevent uninitialized thread shutdown + +Signed-off-by: Sven-Ola Tuecke +--- + drivers/remoteproc/k1x-rproc.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/drivers/remoteproc/k1x-rproc.c b/drivers/remoteproc/k1x-rproc.c +index f3548e6da..a56d75f2a 100644 +--- a/drivers/remoteproc/k1x-rproc.c ++++ b/drivers/remoteproc/k1x-rproc.c +@@ -633,7 +633,7 @@ static void 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); +@@ -664,7 +664,8 @@ static void spacemit_rproc_shutdown(struct platform_device *pdev) + + for (i = 0; i < MAX_MBOX; ++i) { + /* release the resource of rt thread */ +- kthread_stop(priv->mb[i].mb_thread); ++ if (priv->mb[i].kthread_running && priv->mb[i].mb_thread) ++ kthread_stop(priv->mb[i].mb_thread); + /* mbox_free_channel(priv->mb[i].chan); */ + } + } +-- +2.34.1 +