linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Mathieu Poirier <mathieu.poirier@linaro.org>
To: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>
Cc: andersson@kernel.org, shawnguo@kernel.org,
	s.hauer@pengutronix.de, daniel.baluta@nxp.com,
	iuliana.prodan@nxp.com, kernel@pengutronix.de,
	festevam@gmail.com, linux-imx@nxp.com,
	linux-remoteproc@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Peng Fan <peng.fan@nxp.com>
Subject: Re: [PATCH] remoteproc: imx_rproc: iterate all notifiyids in rx callback
Date: Tue, 27 Jun 2023 16:39:19 -0600	[thread overview]
Message-ID: <ZJtlF/tzh0ZMXji4@p14s> (raw)
In-Reply-To: <20230625123514.4069724-1-peng.fan@oss.nxp.com>

On Sun, Jun 25, 2023 at 08:35:14PM +0800, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> The current code has an assumption that there is one tx and one rx
> vring, but it is not always true. There maybe more vrings. So iterate
> all notifyids to not miss any vring events.

Can you be more specific on the use case where more than 2 virqueues are
allocated?  The remoteproc core can handle more than 2 but right now the only
configuration I see doesn't support more than that.

> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>  drivers/remoteproc/imx_rproc.c | 14 ++++++++++++--
>  1 file changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c
> index f9874fc5a80f..e3f40d0e9f3d 100644
> --- a/drivers/remoteproc/imx_rproc.c
> +++ b/drivers/remoteproc/imx_rproc.c
> @@ -725,13 +725,23 @@ static int imx_rproc_addr_init(struct imx_rproc *priv,
>  	return 0;
>  }
>  
> +static int imx_rproc_notified_idr_cb(int id, void *ptr, void *data)
> +{
> +	struct rproc *rproc = data;
> +
> +	if (rproc_vq_interrupt(rproc, id) == IRQ_NONE)
> +		dev_dbg(&rproc->dev, "no message in vqid: %d\n", id);
> +
> +	return 0;
> +}
> +
>  static void imx_rproc_vq_work(struct work_struct *work)
>  {
>  	struct imx_rproc *priv = container_of(work, struct imx_rproc,
>  					      rproc_work);
> +	struct rproc *rproc = priv->rproc;
>  
> -	rproc_vq_interrupt(priv->rproc, 0);
> -	rproc_vq_interrupt(priv->rproc, 1);
> +	idr_for_each(&rproc->notifyids, imx_rproc_notified_idr_cb, rproc);
>  }
>  
>  static void imx_rproc_rx_callback(struct mbox_client *cl, void *msg)
> -- 
> 2.37.1
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2023-06-27 22:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-25 12:35 [PATCH] remoteproc: imx_rproc: iterate all notifiyids in rx callback Peng Fan (OSS)
2023-06-27 22:39 ` Mathieu Poirier [this message]
2023-06-28  0:55   ` Peng Fan
2023-06-28 19:31     ` Mathieu Poirier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZJtlF/tzh0ZMXji4@p14s \
    --to=mathieu.poirier@linaro.org \
    --cc=andersson@kernel.org \
    --cc=daniel.baluta@nxp.com \
    --cc=festevam@gmail.com \
    --cc=iuliana.prodan@nxp.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=peng.fan@nxp.com \
    --cc=peng.fan@oss.nxp.com \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).