remoteproc: imx_rproc race

Matthias Fend matthias.fend at emfend.at
Thu Apr 7 23:58:53 PDT 2022


Hi all,

to support remote processors started before Linux booted on i.MX8MP 
SoCs, the rsc-table device tree property was introduced.
This entry specifies a location in a shared memory area where the remote 
processor will place the resource table.
In the MCUXpresso SDK samples for i.MX8MP, this is achieved by copying 
the resource table to this location during startup.
While this use case works fine, I don't see how this is supposed to work 
when booting the same remote processor firmware from user space.

Note that I expected "[PATCH V2] remoteproc: imx_rproc: use imx specific 
hook for find_loaded_rsc_table" [1] to be applied at some point.
Without this patch there seem to be some other issues as well.

After starting the remote processor here:
remoteproc_core.c: rproc_start(): 'ret = rproc->ops->start(rproc);'
both cores are running in parallel and both cores are trying to write to 
the resource table.
While Linux starts setting status flags like VIRTIO_CONFIG_S_DRIVER, the 
remote processor copies the entire resource table to the same place 
during its startup sequence.
If the copy runs after Linux has set the status flags, those flags will 
be reset and the remote processor will wait for them forever. Since this 
is racy, this will most likely fail.

Can anyone tell me how it is intended to cover both cases (other than 
using different firmware images for the remote processor)?

Thanks
  ~Matthias

[1] 
http://lists.infradead.org/pipermail/linux-arm-kernel/2022-January/709047.html



More information about the linux-arm-kernel mailing list