From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6A615611E; Mon, 14 Oct 2024 14:41:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728916862; cv=none; b=JsyMqSWfHW9zZZYFLUcU01iJXUVsMnDH/WYeljIIzfBYpyunXDk8VjcKRcouSTOqmzBuP6wCflMgfMc2QBmDyiaGhI4iNQ5NBsBwiyzyE6nDCUbGrDnsdAJjnA8NBdl8NkLtcEU/fjFNHh7F2lJtgs9xZlF2cvByN1W8zLJ5iM0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728916862; c=relaxed/simple; bh=MPC/RZWbA1rSR6yoULfhmSiiFlJM2s74Vr/QgqxUTnE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=o6u7M6g3f8FGFWPSYhNKcjyH4AS2e1WfLl+gmPPItmCtmZhyFZz/E36dFuXwVJ+Jrj4n60+d0IedClePVPv29PtiOrjrIV8tRR57PgRxkZ9KmCtl4syljMNO80OtNNzjUyUWlmO701m2eZQTHnsMsgG7Qb4RXW0o1eB5TV0ObaI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=XcCkguOw; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="XcCkguOw" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CD089C4CEC7; Mon, 14 Oct 2024 14:41:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1728916862; bh=MPC/RZWbA1rSR6yoULfhmSiiFlJM2s74Vr/QgqxUTnE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XcCkguOw6VrarPhZ88W2m5oFBh6o9O6kMe6MyXMuytOiFE99px85k3pwy3SwHfg05 +bQ7t9zvICrfYyKWXe4boRogSnmznzV1Pm87WYBF3hi1LnFt/u9g8e24DkCsp0AJrq rrQYr3fl99iqA/LJLa1KO659XReO2RKLlM29G3nM= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Iuliana Prodan , Peng Fan , Daniel Baluta , Mathieu Poirier , Sasha Levin Subject: [PATCH 6.6 086/213] remoteproc: imx_rproc: Use imx specific hook for find_loaded_rsc_table Date: Mon, 14 Oct 2024 16:19:52 +0200 Message-ID: <20241014141046.330711645@linuxfoundation.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241014141042.954319779@linuxfoundation.org> References: <20241014141042.954319779@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Peng Fan [ Upstream commit e954a1bd16102abc800629f9900715d8ec4c3130 ] 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. Reviewed-by: Iuliana Prodan Signed-off-by: Peng Fan Reviewed-by: Daniel Baluta Link: https://lore.kernel.org/r/20240719-imx_rproc-v2-2-10d0268c7eb1@nxp.com Signed-off-by: Mathieu Poirier Signed-off-by: Sasha Levin --- 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 d68d4b22f528e..610a69928dff2 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -669,6 +669,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, @@ -679,7 +690,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.43.0