Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp5471158rwj; Wed, 21 Dec 2022 03:10:39 -0800 (PST) X-Google-Smtp-Source: AMrXdXufEhMC7Dy5iE/eiHeFL+sdjq2OuPtzkw5m9qGyHyV6791TLY8DEqv+iekP7Bf79fH+YLmo X-Received: by 2002:a17:902:f68a:b0:192:49f4:fe67 with SMTP id l10-20020a170902f68a00b0019249f4fe67mr997339plg.57.1671621039744; Wed, 21 Dec 2022 03:10:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671621039; cv=none; d=google.com; s=arc-20160816; b=Ehi7LjCNa8U3gxAQr8MsXBx506+HiAjubuIUI3l4diid1tfEBKiMRox/N13DDRpfoD mAWHLknyFKVjgLW6xKuFPKQOd46Gqi52cNUE7IiycHpTuxCWIWTsm8krlfRsCrEA4kNP 8MoK4YzwgANKF6VIziug8ibRjBEkegRSLEwRLdcmonDXogrktdpCKTl1htkXCTY4bRde KC60JJm5LgsWRshoDvGlrXq3mOkAjxN/l0veSyL4mAL720YTxK3ufgIddSS2bRW0jgv3 Hh0zq7Qo0u8wc0V49j34OlUX0xeXqR1S/pxNi6wtY7NdKHynKCR305HGIz7el0IluxV2 xAFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=oz3aYqRhQFYUSFjS42hlRVMvrBSrDD/Af9iSdJFkOi0=; b=cvtdh3tY6cNfIQdAbZoODrW2GJSmRwLGqL4HUdcDS934DtWOoziwwhBsTtuQpJgdig M2L+rK09lVJc/jgPfTYJpKuIjsxcechRx8ziVAovv4J28y+5N/SZd2f3laX28fBDaEhA p7cnYDDM6yq9PxRknecq0sWY767NIjzLruMPvIye6G0rz/mU34p8CATKc53aD2U4IDB5 3o9OwXrAAFqg4fHMD2jzoTUynCVXOMPxY8TYR1+71SHhsx8PSslL9P63A/EbH5CSFrqx 5ZhhXF5iYx3Uol2VthnlX/ZkV5Yn4YJhJYG6Kljr025AfmEFikO9e0m8Ogbhl+ytGo+A WEqw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h62-20020a636c41000000b0048a5e036c44si9473906pgc.383.2022.12.21.03.10.30; Wed, 21 Dec 2022 03:10:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234736AbiLUK4A (ORCPT + 69 others); Wed, 21 Dec 2022 05:56:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234583AbiLUKzg (ORCPT ); Wed, 21 Dec 2022 05:55:36 -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 982B42315C 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-kernel@vger.kernel.org X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 > >