Re: [PATCH 1/2] remoteproc: imx_rproc: dummy kick method

From: nikita . shubin
Date: Thu Mar 05 2020 - 12:29:56 EST




05.03.2020, 19:17, "Mathieu Poirier" <mathieu.poirier@xxxxxxxxxx>:
> On Wed, 4 Mar 2020 at 07:25, Nikita Shubin <NShubin@xxxxxxxxxx> wrote:
>> Âadd kick method that does nothing, to avoid errors in rproc_virtio_notify.
>>
>> ÂSigned-off-by: Nikita Shubin <NShubin@xxxxxxxxxx>
>> Â---
>> ÂÂdrivers/remoteproc/imx_rproc.c | 6 ++++++
>> ÂÂ1 file changed, 6 insertions(+)
>>
>> Âdiff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c
>> Âindex 3e72b6f38d4b..796b6b86550a 100644
>> Â--- a/drivers/remoteproc/imx_rproc.c
>> Â+++ b/drivers/remoteproc/imx_rproc.c
>> Â@@ -240,9 +240,15 @@ static void *imx_rproc_da_to_va(struct rproc *rproc, u64 da, int len)
>> ÂÂÂÂÂÂÂÂÂreturn va;
>> ÂÂ}
>>
>> Â+static void imx_rproc_kick(struct rproc *rproc, int vqid)
>> Â+{
>> Â+
>> Â+}
>> Â+
>
> If rproc::kick() is empty, how does the MCU know there is packets to
> fetch in the virtio queues?

Well, of course it doesn't i understand this perfectly - just following documentation citing:

| Every remoteproc implementation should at least provide the ->start and ->stop
| handlers. If rpmsg/virtio functionality is also desired, then the ->kick handler
| should be provided as well.

But i as i mentioned in "remoteproc: Fix NULL pointer dereference in rproc_virtio_notify" kick method will be called if
"resource_table exists in firmware and has "Virtio device entry" defined" anyway, the imx_rproc is not in control of what
exactly it is booting, so such situation can occur.

>
>> ÂÂstatic const struct rproc_ops imx_rproc_ops = {
>> ÂÂÂÂÂÂÂÂÂ.start = imx_rproc_start,
>> ÂÂÂÂÂÂÂÂÂ.stop = imx_rproc_stop,
>> Â+ .kick = imx_rproc_kick,
>> ÂÂÂÂÂÂÂÂÂ.da_to_va = imx_rproc_da_to_va,
>> ÂÂ};
>>
>> Â--
>> Â2.24.1