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 C4A68C636D6 for ; Fri, 17 Feb 2023 18:31:06 +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=7u6ve4uS+gQY+t5RPquOSGYPl0mB9VgZSJ5ryZQ+kUg=; b=n+7ZHhCPlIHkWC oMwV8g9fQyJNYkeZHaTm14uMe5Xg1WWydw5F4eMrVB5UwFhscdvzXyNST4HpIhpguJCVvavOz1tba T/KainxpGp8VvRMCG0D2yqCIooOBNfCcleFaMQHeE98+QFcL9j80rDFwH7LGVGjGAX54wRPc00za/ OwFyIMpcwQkuoZcYYGpcj/MoT3PEFN9vbG7asR70dATr7hrdVlEP9w5Mw0lExluy1xBOUL4g5N5Uf Uj3odf0w2SyinXPPBwci3zgqUaTDf3BGr6tx5OsV3qgfwfzGmekNlPuukJYGA0tGM5KP1xctTSCB4 RtVVvZtIGBFjF77beb+g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pT5Ug-00FO60-9j; Fri, 17 Feb 2023 18:30:02 +0000 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pT5Ub-00FO4R-S6 for linux-arm-kernel@lists.infradead.org; Fri, 17 Feb 2023 18:29:59 +0000 Received: by mail-pg1-x532.google.com with SMTP id e1so1132683pgu.6 for ; Fri, 17 Feb 2023 10:29:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=ZbrN/wtqaLP+762+fL1BSuVTDl18qAdomxpq221PnGA=; b=CLH8BrYtdo+HFeDqBo6ECWp7h8IqocBPKFAQ92ku6OSDeeNKoEt28tmutSJZslL6ib WwAEHOlm7li0xrHHZ306Hqkn6Zmqni02+izqd6RlK5SNGM8qH9qzOnFjVZG3QIUwBJw1 DCP7zU8GgALgWrIrxK3NW90YZ2+9l/N5Eg4POe3nTTNc72sDuoLFHIHX11WeyejN6ihR HQuPjY4t2Mz8depH1lPI6KXySN3wltGidqRKBqLJp6m56OrhV1oVzBBILEUgGTtIYHb7 IpNOo80buSz4cmvpVeNPv4AIM5XndamZ+YouLE0+v9CU2YP/fqX3tXWxt8vw8Ediylgv 2qnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=ZbrN/wtqaLP+762+fL1BSuVTDl18qAdomxpq221PnGA=; b=yl3mILzK1k/2yTEE1rpOviP5WXfheYvWmtFruI929VmAamA26IydY9HqhxAWukLcvA xbLXDChNx2ThVut3m4vb/wyvOSQ/Uvn7pNDZpPdLYxPCE3GZXcfwvuASuEMN10bqN9H1 BNHzfrr4CfCOAmM0XnD77ecMAZ5mzPd8S8pqR8XiY2FOGu7f472aghG9vApfdL/bDCT2 uFJugn74WEa8pW0K+jgnR8a7LQsWuHty4GOEeDRMjyT0vHdKUAc72ylSG2sEcBztkSh3 11bi+tgj3qasnuK1OmNp3Ii7NpujzmS3QMrAUAjtwz5esowxBR52H3rRl/F723LPtpQq r67w== X-Gm-Message-State: AO0yUKX85HqWgSPpw2GHQAiFKKCfEc9MbxdblCxhQq/GhIgpwxrcs22R zvjb9ns+c2LR3xGYlL72VrU57w== X-Google-Smtp-Source: AK7set97CeB2IXS5TthkfDUlCh14fu8UEJl1CYVdlUy/CZKjrPzYPCKYQcH5cb7tkaELIW/vJtBykQ== X-Received: by 2002:a62:3207:0:b0:5a8:f259:21ff with SMTP id y7-20020a623207000000b005a8f25921ffmr1458995pfy.14.1676658593791; Fri, 17 Feb 2023 10:29:53 -0800 (PST) Received: from p14s ([2604:3d09:148c:c800:e03d:a736:2176:868f]) by smtp.gmail.com with ESMTPSA id e24-20020aa78c58000000b00581c741f95csm3361347pfd.46.2023.02.17.10.29.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Feb 2023 10:29:53 -0800 (PST) Date: Fri, 17 Feb 2023 11:29:50 -0700 From: Mathieu Poirier To: "Iuliana Prodan (OSS)" Cc: Bjorn Andersson , Shawn Guo , Sascha Hauer , "S.J. Wang" , Fabio Estevam , Daniel Baluta , Iuliana Prodan , linux-imx , linux-remoteproc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Pengutronix Kernel Team Subject: Re: [PATCH v5] remoteproc: imx_dsp_rproc: add module parameter to ignore ready flag from remote processor Message-ID: <20230217182950.GA585964@p14s> References: <20230217094124.9440-1-iuliana.prodan@oss.nxp.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230217094124.9440-1-iuliana.prodan@oss.nxp.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230217_102957_945459_17765DD0 X-CRM114-Status: GOOD ( 32.45 ) 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 Hi Iuliana, On Fri, Feb 17, 2023 at 11:41:24AM +0200, Iuliana Prodan (OSS) wrote: > From: Iuliana Prodan > > There are cases when we want to test a simple "hello world" > application on the DSP and we don't have IPC between the cores. > Therefore, do not wait for a confirmation from the remote processor > at start. > > Added "no_mailboxes" flag while inserting the module to not initialize > any mailboxes, and so ignore remote processor reply after start. > By default, this is off - do not ignore reply from rproc. > > Signed-off-by: Iuliana Prodan > Reviewed-by: Daniel Baluta > --- > Changes since v4 > - s/ignore_dsp_ready/no_mailboxes > - make imx_dsp_rproc_mbox_init() a function pointer which, > based on the no_mailboxes module parameter, can initialize > the mailboxes (= imx_dsp_rproc_mbox_alloc()), in case they exists, > otherwise does nothing (= imx_dsp_rproc_mbox_no_alloc()). > > Changes since v3 > - do not instantiate static var to 0, this is done by default > - do not initialize mailbox if not IPC between the core > > Changes since v2 > - s/ignoreready/ignore_dsp_ready > > Changes since v1 > - change BIT(31) to BIT(1) for REMOTE_SKIP_WAIT > --- > drivers/remoteproc/imx_dsp_rproc.c | 33 ++++++++++++++++++++++++++++-- > 1 file changed, 31 insertions(+), 2 deletions(-) > > diff --git a/drivers/remoteproc/imx_dsp_rproc.c b/drivers/remoteproc/imx_dsp_rproc.c > index 95da1cbefacf..85eea85b1655 100644 > --- a/drivers/remoteproc/imx_dsp_rproc.c > +++ b/drivers/remoteproc/imx_dsp_rproc.c > @@ -28,6 +28,15 @@ > > #define DSP_RPROC_CLK_MAX 5 > > +/* > + * Module parameters > + */ > +static unsigned int no_mailboxes; > +module_param_named(no_mailboxes, no_mailboxes, int, 0644); > +MODULE_PARM_DESC(no_mailboxes, > + "There is no mailbox between cores, so ignore remote proc " > + "reply after start, default is 0 (off)."); > + > #define REMOTE_IS_READY BIT(0) > #define REMOTE_READY_WAIT_MAX_RETRIES 500 > > @@ -172,6 +181,9 @@ static const struct imx_rproc_att imx_dsp_rproc_att_imx8ulp[] = { > { 0x30000000, 0x90000000, 0x10000000, 0}, > }; > > +/* Initialize the mailboxes between cores, if exists */ > +static int (*imx_dsp_rproc_mbox_init)(struct imx_dsp_rproc *priv); > + > /* Reset function for DSP on i.MX8MP */ > static int imx8mp_dsp_reset(struct imx_dsp_rproc *priv) > { > @@ -492,12 +504,12 @@ static void imx_dsp_rproc_rxdb_callback(struct mbox_client *cl, void *data) > } > > /** > - * imx_dsp_rproc_mbox_init() - request mailbox channels > + * imx_dsp_rproc_mbox_alloc() - request mailbox channels > * @priv: private data pointer > * > * Request three mailbox channels (tx, rx, rxdb). > */ > -static int imx_dsp_rproc_mbox_init(struct imx_dsp_rproc *priv) > +static int imx_dsp_rproc_mbox_alloc(struct imx_dsp_rproc *priv) > { > struct device *dev = priv->rproc->dev.parent; > struct mbox_client *cl; > @@ -560,6 +572,18 @@ static int imx_dsp_rproc_mbox_init(struct imx_dsp_rproc *priv) > return ret; > } > > +/** > + * imx_dsp_rproc_mbox_no_alloc() > + * > + * Empty function for no mailbox between cores > + * > + * Always return 0 > + */ > +static int imx_dsp_rproc_mbox_no_alloc(struct imx_dsp_rproc *priv) > +{ > + return 0; > +} > + > static void imx_dsp_rproc_free_mbox(struct imx_dsp_rproc *priv) > { > mbox_free_channel(priv->tx_ch); > @@ -903,6 +927,11 @@ static int imx_dsp_rproc_probe(struct platform_device *pdev) > priv->rproc = rproc; > priv->dsp_dcfg = dsp_dcfg; > > + if (no_mailboxes) > + imx_dsp_rproc_mbox_init = imx_dsp_rproc_mbox_no_alloc; > + else > + imx_dsp_rproc_mbox_init = imx_dsp_rproc_mbox_alloc; > + This looks good now. The merge window for the 6.3 cycle opens on Sunday, which I find too close to start adding new things. As such I will apply your patch to my local branch and publish it in three weeks when v6.3-rc2 comes out. Thanks, Mathieu > dev_set_drvdata(dev, rproc); > > INIT_WORK(&priv->rproc_work, imx_dsp_rproc_vq_work); > -- > 2.17.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel