remoteproc: k3-r5: Fix error handling when power-up failed

commit 9ab27eb586 upstream.

By simply bailing out, the driver was violating its rule and internal
assumptions that either both or no rproc should be initialized. E.g.,
this could cause the first core to be available but not the second one,
leading to crashes on its shutdown later on while trying to dereference
that second instance.

Fixes: 61f6f68447 ("remoteproc: k3-r5: Wait for core0 power-up before powering up core1")
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Acked-by: Beleswar Padhi <b-padhi@ti.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/9f481156-f220-4adf-b3d9-670871351e26@siemens.com
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Jan Kiszka
2024-08-19 17:24:51 +02:00
committed by Greg Kroah-Hartman
parent ea79bdc674
commit 7afb5e3aa9
+2 -1
View File
@@ -1332,7 +1332,7 @@ init_rmem:
dev_err(dev,
"Timed out waiting for %s core to power up!\n",
rproc->name);
return ret;
goto err_powerup;
}
}
@@ -1348,6 +1348,7 @@ err_split:
}
}
err_powerup:
rproc_del(rproc);
err_add:
k3_r5_reserved_mem_exit(kproc);