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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C306FC4332F for ; Wed, 21 Dec 2022 10:55:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234626AbiLUKz6 (ORCPT ); Wed, 21 Dec 2022 05:55:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234514AbiLUKzf (ORCPT ); Wed, 21 Dec 2022 05:55:35 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FAC822BDE for ; Wed, 21 Dec 2022 02:55:17 -0800 (PST) Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p7wkg-0007CM-NR; Wed, 21 Dec 2022 11:55:10 +0100 Received: from mfe by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1p7wke-0004Gd-Jo; Wed, 21 Dec 2022 11:55:08 +0100 Date: Wed, 21 Dec 2022 11:55:08 +0100 From: Marco Felsch To: "Peng Fan (OSS)" Cc: bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de, 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 V2] remoteproc: imx_rproc: use imx specific hook for find_loaded_rsc_table Message-ID: <20221221105508.3ukfhevdn2fv6aud@pengutronix.de> References: <20220111033333.403448-1-peng.fan@oss.nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220111033333.403448-1-peng.fan@oss.nxp.com> User-Agent: NeoMutt/20180716 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: mfe@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-remoteproc@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org Hi, On 22-01-11, Peng Fan (OSS) wrote: > From: Peng Fan > > If there is a resource table device tree node, use the address as > the resource table address, otherwise use the address(where > .resource_table section loaded) inside the Cortex-M elf file. > > And there is an update in NXP SDK that Resource Domain Control(RDC) > enabled to protect TCM, linux not able to write the TCM space when > updating resource table status and cause kernel dump. So use the address > from device tree could avoid kernel dump. > > Note: NXP M4 SDK not check resource table update, so it does not matter > use whether resource table address specified in elf file or in device > tree. But to reflect the fact that if people specific resource table > address in device tree, it means people are aware and going to use it, > not the address specified in elf file. > > Signed-off-by: Peng Fan > --- > > V2: > Update commit message What is the status of this patch? Regards, Marco > > drivers/remoteproc/imx_rproc.c | 13 ++++++++++++- > 1 file changed, 12 insertions(+), 1 deletion(-) > > diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c > index 7a096f1891e6..0bd24c937a73 100644 > --- a/drivers/remoteproc/imx_rproc.c > +++ b/drivers/remoteproc/imx_rproc.c > @@ -499,6 +499,17 @@ static struct resource_table *imx_rproc_get_loaded_rsc_table(struct rproc *rproc > return (struct resource_table *)priv->rsc_table; > } > > +static struct resource_table * > +imx_rproc_elf_find_loaded_rsc_table(struct rproc *rproc, const struct firmware *fw) > +{ > + struct imx_rproc *priv = rproc->priv; > + > + if (priv->rsc_table) > + return (struct resource_table *)priv->rsc_table; > + > + return rproc_elf_find_loaded_rsc_table(rproc, fw); > +} > + > static const struct rproc_ops imx_rproc_ops = { > .prepare = imx_rproc_prepare, > .attach = imx_rproc_attach, > @@ -508,7 +519,7 @@ static const struct rproc_ops imx_rproc_ops = { > .da_to_va = imx_rproc_da_to_va, > .load = rproc_elf_load_segments, > .parse_fw = imx_rproc_parse_fw, > - .find_loaded_rsc_table = rproc_elf_find_loaded_rsc_table, > + .find_loaded_rsc_table = imx_rproc_elf_find_loaded_rsc_table, > .get_loaded_rsc_table = imx_rproc_get_loaded_rsc_table, > .sanity_check = rproc_elf_sanity_check, > .get_boot_addr = rproc_elf_get_boot_addr, > -- > 2.25.1 > > 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 9C00EC4332F for ; Wed, 21 Dec 2022 10:58:48 +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=szf97omttZRqMSI4rPO+Qk/44h9D6hZ2UZIeRm/u+0w=; b=IHObwFEJ8OkrfK yUqWaqnDiI5MmkO9n40ur019zwzbeN7Bt9iVT02dkjQLXgiMwcitcrGng8HBncE16cPHtwr65Zv6w FNNpW03o2AP9JnKThG+OreevzuDYmSq8yyFKBE7+T5zy8wF9MoQs5szREIKzuMYRKIkjip2KjI6SX c2ze6uowDjGcJGJsIan3QkxbbWtsBTkoV8QfXRZuDq6Tm7V4Qv+iK/ZSmgdnwu+HccbfemMw3fvs5 BVJD0gnPQ5Ov/Y8HWbddRNa69sBDnTpMsy9+bqedmcBF2wN+gFJ8fT884oOo1h8Q8exWfSCNtZG8p /HXnlTb8Vjh19WqI7qsg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7wnC-00Drb6-9x; Wed, 21 Dec 2022 10:57:46 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7wkk-00DpIq-5d for linux-arm-kernel@lists.infradead.org; Wed, 21 Dec 2022 10:55:15 +0000 Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p7wkg-0007CM-NR; Wed, 21 Dec 2022 11:55:10 +0100 Received: from mfe by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1p7wke-0004Gd-Jo; Wed, 21 Dec 2022 11:55:08 +0100 Date: Wed, 21 Dec 2022 11:55:08 +0100 From: Marco Felsch To: "Peng Fan (OSS)" Cc: bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de, 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 V2] remoteproc: imx_rproc: use imx specific hook for find_loaded_rsc_table Message-ID: <20221221105508.3ukfhevdn2fv6aud@pengutronix.de> References: <20220111033333.403448-1-peng.fan@oss.nxp.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220111033333.403448-1-peng.fan@oss.nxp.com> User-Agent: NeoMutt/20180716 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: mfe@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221221_025514_499007_824E2E2C X-CRM114-Status: GOOD ( 25.68 ) 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, On 22-01-11, Peng Fan (OSS) wrote: > From: Peng Fan > > If there is a resource table device tree node, use the address as > the resource table address, otherwise use the address(where > .resource_table section loaded) inside the Cortex-M elf file. > > And there is an update in NXP SDK that Resource Domain Control(RDC) > enabled to protect TCM, linux not able to write the TCM space when > updating resource table status and cause kernel dump. So use the address > from device tree could avoid kernel dump. > > Note: NXP M4 SDK not check resource table update, so it does not matter > use whether resource table address specified in elf file or in device > tree. But to reflect the fact that if people specific resource table > address in device tree, it means people are aware and going to use it, > not the address specified in elf file. > > Signed-off-by: Peng Fan > --- > > V2: > Update commit message What is the status of this patch? Regards, Marco > > drivers/remoteproc/imx_rproc.c | 13 ++++++++++++- > 1 file changed, 12 insertions(+), 1 deletion(-) > > diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c > index 7a096f1891e6..0bd24c937a73 100644 > --- a/drivers/remoteproc/imx_rproc.c > +++ b/drivers/remoteproc/imx_rproc.c > @@ -499,6 +499,17 @@ static struct resource_table *imx_rproc_get_loaded_rsc_table(struct rproc *rproc > return (struct resource_table *)priv->rsc_table; > } > > +static struct resource_table * > +imx_rproc_elf_find_loaded_rsc_table(struct rproc *rproc, const struct firmware *fw) > +{ > + struct imx_rproc *priv = rproc->priv; > + > + if (priv->rsc_table) > + return (struct resource_table *)priv->rsc_table; > + > + return rproc_elf_find_loaded_rsc_table(rproc, fw); > +} > + > static const struct rproc_ops imx_rproc_ops = { > .prepare = imx_rproc_prepare, > .attach = imx_rproc_attach, > @@ -508,7 +519,7 @@ static const struct rproc_ops imx_rproc_ops = { > .da_to_va = imx_rproc_da_to_va, > .load = rproc_elf_load_segments, > .parse_fw = imx_rproc_parse_fw, > - .find_loaded_rsc_table = rproc_elf_find_loaded_rsc_table, > + .find_loaded_rsc_table = imx_rproc_elf_find_loaded_rsc_table, > .get_loaded_rsc_table = imx_rproc_get_loaded_rsc_table, > .sanity_check = rproc_elf_sanity_check, > .get_boot_addr = rproc_elf_get_boot_addr, > -- > 2.25.1 > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel