]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
remoteproc: k3-r5: Fix crash when issuing rproc init
authorRichard Genoud (TI) <richard.genoud@bootlin.com>
Thu, 25 Jun 2026 13:30:06 +0000 (15:30 +0200)
committerTom Rini <trini@konsulko.com>
Fri, 10 Jul 2026 21:46:11 +0000 (15:46 -0600)
Prevent NULL pointer dereference with lockstep mode.

Since commit 21d03d60e909 ("j7200 defconfig: add rproc commands"),
issuing rproc init command with cluster configured in lockstep results
in a NULL pointer dereference.

This is because ti_sci_proc_request() is called on both cores on the
same cluster, without checking if they are populated.
To fix that, only request the core being probed, as there is no need to
request the other one.

Moreover, the old code was requesting both cores in lockstep mode, but
only releasing one:
it called k3_r5f_proc_request() with ti_sci_proc_release(), instead of
using k3_r5f_proc_request()/k3_r5f_proc_release() or
ti_sci_proc_request()/ti_sci_proc_release().

So, replacing k3_r5f_proc_request() by ti_sci_proc_request() restores
the intended behavior.

Fixes: 21d03d60e909 ("j7200 defconfig: add rproc commands")
Signed-off-by: Richard Genoud (TI) <richard.genoud@bootlin.com>
drivers/remoteproc/ti_k3_r5f_rproc.c

index 7326f5a4b30bf1b94e7ef80ab827f0ee040b3280..c5810dd0994a2bbd9281f685e2c79bd1b6983ef2 100644 (file)
@@ -861,7 +861,7 @@ static int k3_r5f_probe(struct udevice *dev)
                        return 0;
                }
 
-               ret = k3_r5f_proc_request(core);
+               ret = ti_sci_proc_request(&core->tsp);
                if (ret)
                        return ret;