From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 91F71EB64D9 for ; Tue, 27 Jun 2023 22:39:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YdSHNqzGkXG1LL9p5e+RRUm+kN80JSoRRCUgrLbO3q4=; b=DJsBdShdAqs+ax N3hn4P6k3694gOY4BtYOY+8apZC0S140on4r86WHEVoZ2KBZt3A/FNKv2aqxDhOHV/yU1XLMfukk/ l3TnlFsA0373RoO3pA+KCYWbwyX1AXKAv69+YBLpW8lqtSV+1pI45XvShFXVAnjOkxRmyttL+Iwai jYrb7YL+sY+ORp4tvZsK6WLEWKSc19CU483qGANene8c98EDiAlUJwHmwup4oMZhLNPCqw8vLpT8U i+MwmEoJ3gTLxu88GVxUd5X9+mgjprG7vNwdCCvosLN9T685UDX77VWh3XkRlDqmMxYXUo1mn2mgI 4Dos0JGpaK9f3P1i4wtg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qEHLL-00EJzU-2C; Tue, 27 Jun 2023 22:39:27 +0000 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qEHLI-00EJyi-24 for linux-arm-kernel@lists.infradead.org; Tue, 27 Jun 2023 22:39:25 +0000 Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-666e916b880so2944501b3a.2 for ; Tue, 27 Jun 2023 15:39:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687905563; x=1690497563; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=JZGhAhIzfGUZ5jvLLPvwW9bXE1PlUJT6q1LYW9RbmeA=; b=K2tQkI6tJeFmedSnKnrAERFOE4bgmBgdliT3OeCdnrGIVgejVCv6UIq9RuljmPtdc5 ryTYQ48f4vKrxx2p40gw+z+wb58ai720OZZM5bik4nqGdX2G28WofbJ3Qv7OltUnLEU+ aVif9LwDbrFcOJoan44HwewjTk0Kpqv9GgXDhNA5MsN0KKBp0fzauGPuipOuCiy0xvS6 TPCff7d76LBMrtXfiMYR66112kfv14AoSbbfg6kJNy5PTLwvx+sTcVMHSrdi4mt6qCi9 AnMIGcRzf04VxH8HL7xTZL8C60XAuNhMS45S9Nt4lwiSrkIYCEZ7HrfHvl13cqNyvskx fhBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687905563; x=1690497563; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=JZGhAhIzfGUZ5jvLLPvwW9bXE1PlUJT6q1LYW9RbmeA=; b=OBwxOKbClkzlY//F/Ut4fH3wLkLOHkn8onDpQUVypYDu33Xvk0DROgyf+25H3FK1Nx jWNXlzxCQ3D2BQiXLRfpjhbWn1UvJuX7REi5JQuZYX5XKmfmG7XVZXYs7X+Zx8i40iNX yparl3T2HCA7H0S7ESdgRMpsJ5nZPA9Qu5AxGV/cMIwHqHu4TGqZAhCXpLzL4X6xlqJv UXdjEa+ls+2tB1Zrgiqo6aG96gXxrzOljL3F5X4cofh6j3xf9BWhmAWGjRnSx9LWuBT6 Y3crbsZI68h+0nqpdsgUBExUg3uhiTvYMDwaEcUtCECEwjjpcf6G1xzp3d3vMOJN2Kj+ 1Kkg== X-Gm-Message-State: AC+VfDzg5ZCScdvT/sjanIe55fKmY7kt+YLA9MWkBVLHKRbAgMlozq4N tH5v0+dm3V4Ecd7ERyoLFSUzeA== X-Google-Smtp-Source: ACHHUZ6Xwb8IGGHXUoDYmFFsvDwbFCwlXN4ISODmV7ztXiDgFDCZ+xk6Xe77dJLDaH8lFxIeuKmPRA== X-Received: by 2002:a05:6a00:2394:b0:668:73f5:dce0 with SMTP id f20-20020a056a00239400b0066873f5dce0mr21935921pfc.29.1687905562787; Tue, 27 Jun 2023 15:39:22 -0700 (PDT) Received: from p14s ([2604:3d09:148c:c800:144c:51f7:d15:64a2]) by smtp.gmail.com with ESMTPSA id j2-20020aa783c2000000b0066a36d7ce9bsm6058415pfn.171.2023.06.27.15.39.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jun 2023 15:39:22 -0700 (PDT) Date: Tue, 27 Jun 2023 16:39:19 -0600 From: Mathieu Poirier To: "Peng Fan (OSS)" 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 Subject: Re: [PATCH] remoteproc: imx_rproc: iterate all notifiyids in rx callback Message-ID: References: <20230625123514.4069724-1-peng.fan@oss.nxp.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230625123514.4069724-1-peng.fan@oss.nxp.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230627_153924_683514_BF264A94 X-CRM114-Status: GOOD ( 20.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sun, Jun 25, 2023 at 08:35:14PM +0800, Peng Fan (OSS) wrote: > From: Peng Fan > > 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 > --- > 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