From patchwork Thu Apr 8 01:44:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 12189757 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AB99AC433ED for ; Thu, 8 Apr 2021 02:01:39 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 242E461182 for ; Thu, 8 Apr 2021 02:01:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 242E461182 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oss.nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=g69A8+4iTzoQfCgkyUeNsX8j4Nf0HDsCPvnGOCwRf6w=; b=KrKJZvWYKa+lvYFhOkQxt78MB EnDX8q72W2fQlrISd8ljR5DZsfKo6nRvcXLNnL2WynSD3Zg6tfuMhfS2lfUOLnM9u5zLjexWpe35s 8+RbFQv/btEkru+3vPc/LrqexP4puVE0/soXxH6hl/dx4wFJFrnZUhRoBU+2hqlD62pmPNGQxB+hk Qj0XwwWrJyhxOkVb3HnTJQW7CU1qSnovhe+Reu39Xx1zQlc8nhDEwx3JWrffBmrJsGY8VlKdi5kir PoaGVZ2S1uT5X42lcGi+X8hq1s0vprUPnk+EqxAORLPUI1bwMzp76eBu3DLySeYLijwod8Rctdbub WwqOanrNg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lUJxR-006Xm3-Cb; Thu, 08 Apr 2021 01:59:45 +0000 Received: from mail-eopbgr140084.outbound.protection.outlook.com ([40.107.14.84] helo=EUR01-VE1-obe.outbound.protection.outlook.com) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lUJxG-006Xil-0P for linux-arm-kernel@lists.infradead.org; Thu, 08 Apr 2021 01:59:35 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k8rHY3LgRB/hsD3sMujF3EvO+FZWWrWByInomvhsYiyNteZtxaZggY+rUqht+CFzV2JqKfsZ+W4FUpYX396p4gmkHqsTDxulP/zMoBXiiVgZ4PplY+8LVD653qrWbzQbajipIVC9qOIHPatsBBkKeUhk/c7HOV0yziSXYbpWDLDFIE6mAGRLCnK199nSTf5wtLQpNb8m5z1UI2phgIomePJFYUP548+dJXI6SKQikQYXakyOZBNqbGjrSEVmEuYnk2hOB6fWZdAEhCE73svsFCRrGpZ1VTgBffqw4RcTtaO8TNpKzq9NWiXnZk7ptZNgBmwmxmhlsCvW4etIr3wU5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sttIUApDyABGOq7EwZCpeJzMHJnkpzX+IJHilenPjw4=; b=aZ/AkKkjOny+HmMv0EEAcorw0bWSY2DdY6vQ192ys63cSjPpOXQREAr1dz3MufqIa1CxzFwjC8xwz3Gge0kruHbnoRU3rhcIAoj3SwsnbA4EmH+0CJiQP7LkEzEsijc2IRKCMrwvelhXWzI74f4FvsuZjGRpFKd5fkzzq0qzPu4aIbtDyJx0CehLi4YSpo9vadBUYjE9lLr4254ZrWnOwuk4VjyEWIPq/jDKwKz3j/2yzTLZN2Hxz0LZQ7oDFCfLoiMHUe1UON1B9IfdKg/jG1ok+SGVx1nZUMqGoEzYV5PIn1zoYkOfMeY4Jdzc+2ZJzAX6evASTc2XiC/cudtWkg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sttIUApDyABGOq7EwZCpeJzMHJnkpzX+IJHilenPjw4=; b=jtY1sRi6/iFegTSO52F6WfWSD5gkSUAKOuZsyYWu9dkldNYDD69VP0UhaCM/xvIh98RP8sP7n3jkGWTky9hZyOaC+RT6l84M30n2Yarw2rIwlbr05VNHFFba2InxhAkxxZgcw8aFtVKXTRWZJ+79jFbhySkUW5YqjYnpWge4wgg= Authentication-Results: wizery.com; dkim=none (message not signed) header.d=none;wizery.com; dmarc=none action=none header.from=oss.nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB9PR04MB8140.eurprd04.prod.outlook.com (2603:10a6:10:249::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.17; Thu, 8 Apr 2021 01:59:29 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::c57a:6964:f72c:21cf]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::c57a:6964:f72c:21cf%11]) with mapi id 15.20.3999.032; Thu, 8 Apr 2021 01:59:29 +0000 From: peng.fan@oss.nxp.com To: ohad@wizery.com, bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, o.rempel@pengutronix.de Cc: shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-remoteproc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Peng Fan Subject: [PATCH V3 1/4] remoteproc: imx_rproc: add missing of_node_put Date: Thu, 8 Apr 2021 09:44:46 +0800 Message-Id: <1617846289-13496-2-git-send-email-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1617846289-13496-1-git-send-email-peng.fan@oss.nxp.com> References: <1617846289-13496-1-git-send-email-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK2PR02CA0219.apcprd02.prod.outlook.com (2603:1096:201:20::31) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.66) by HK2PR02CA0219.apcprd02.prod.outlook.com (2603:1096:201:20::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.4020.17 via Frontend Transport; Thu, 8 Apr 2021 01:59:26 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4f34d618-7c96-43f3-3497-08d8fa31f209 X-MS-TrafficTypeDiagnostic: DB9PR04MB8140: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2201; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6fF/ysxigxwZrQbIP0lerb2WdGbWjfCpso/YqMCXqqGNUVgaq66P84Lj6jvy98o9k7lJpHkSEyIf+dBbPuLAETA9oXTbAIIIbC1D1WM74ABmf9QGehLBZM9/iayaZw4sCVKsTgfeLUrM7AV/X5VUyZe/tcEbwEf0BXAqG7Wq+UTu5Vnkv6i1m7GOrIIUTUZj0saDnE3kMEDiEdpikdG4j2LDPovgCGwzrw8UNOqUO7AQePIlFLuMidEmP8BPVMTFNw5vFNMoZo0BaCqBcGpGjzEo/7qqAEKN8ZzK3Mfu4AxmvbE6OvZGI2yMN5NZY0Y5Yl23tP7OhZm2HZugNw44NsBqfxZOj0ltoddw+mJKufrc0lneMhindPvU7rVe5Kn3/kdk4gLD5Vb/nqnZb94M6vlEmJyIX56KgdWLXFDY1INudROn332U4iwT702geZbkE04zvgZWygwHPUl6PNZLVUdgOoul/ctGBmi4E32ZhVOncPiCN3LHsQcT1jp0GA7+8Gcdndxn8D4xqF4Qt5U3PFeQNsF0KfWEPD8oxQyJ/7vw5mfBB4sJk3MhrJPmEl/F/W15C2Htfdp+DtmlNaC3GClSfkbGEHlCIZWthCdp+i6x5KffMFgpCB5Z0NmC+BuwzcqBWsw1GCC8b2JFmGdPNiHojOscXESckeqmE9qziz5bK3W58fdiFGzaxKvQoLuV/bi2miieCQwupduVOOYxbrMvKkTmtxALZXgN1nK4ZEo= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(346002)(396003)(376002)(39860400002)(136003)(956004)(2616005)(4326008)(4744005)(8936002)(86362001)(6486002)(316002)(38350700001)(5660300002)(66946007)(52116002)(6666004)(8676002)(6506007)(9686003)(478600001)(26005)(7416002)(186003)(38100700001)(16526019)(6512007)(66476007)(66556008)(2906002)(69590400012); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: uUHB0kIaan3Jd8g6Qbl+ePMNCVqDbJvx/y+CLh55A73kvfT0m1a77B0Ern/KDia5WCGhQ3CSJs9FjD+p+2nZ7x+CYC1xP3Xu9G3Gx80mOE5AB9UkE/OcRoZzdQRTJzmfM6gbL2NyiVQEMYxOGwxtr+pICuKsV3/PAk/6hhAVNX+d7vUpNgq9ry7zdEzppFxNtDhMEkhdbxY7b5BAj7uI2BcRp3qbxHtnJy0yCD55l2Bgj/A2AZ5oo8Xol/OzQJZJhFZ3cg+ikHAFf4JEs1PX+9hJov7Hs37AWUVIErP8d9OFvPXQ92fKRsR6sezZ4dmtatsCFG+6cmByHOaL+0aoNLObiQgw9Avq17tgo9uiHVyc+jMtqcYwILhNCjWsK1R2PZmH/4TAgnUcMM8EYyKaTNZqYcQgtHbT5bG8pX6HDV55hfw2LulV7vGxeJ37j45x5wJGHnXcpR/H+WqHOa7++bfL2PcJsfhl9H9dCvWaRzJYYa2jGv6uyOrhHA3Z5SCyW+nj2CjcLkWd/pIMa7DbG4XqiMJO9GurgVjhXoRDkVEyAzicz1XvAzqcCwhHuYEQbfOdWn7c4PzqHIruOgGOZmXxXIoY4GkNYhRhvvyJ6PibV5HgHK5tbFjpfQQjZIjq2NUoNtylzD/RpbQ271BCxkJ2bw24QGMdrlVAxeboYkxrgfQUfNZ4CQODmHyPs79xzxmPh2J3bpAmO/tYYYTZiA9crTgg6GWSY5rKA+QtRWG2rIBTJ//BVEU5Ikdb/enIh7iBUIORuqHQmlWOdtSo+1fGgNPuGaOSzfk24HPpCiLaYDxH/Gyb2CeML4MGjMuP5QtsF+dtsA7dUpfPHVQarmkz83SzOjN/V3qjtNv3zvFmOzTumI7ca5uCILA6IAjGqS0pLmCsAMJ4ZQqEw2MrBolKJIJ+K2rK0XM3dEzdM4n3A6LSTgqTDQNQAf8218i/JV+oLVWfj0hvkeireKEXiXHRkTBHZaTqQ7ZlxJKSxlkDntk5rwywnIMZbKrNqUPSZPsFW8l63LJno7dARoVmw3cPasjoWd4oUTNx7e0HHr+ZUE0jaDbXtYAyzvYeJYNfCuRblBJ6t3EO2TvYgYJ61VnGA4NPEZxmkMAkmcSSPZt4fZxbeGuOghGvBmcgLy3G5QLIN4hwKjra/rh+GON4TWGGGZgw5yd/ygcBa2ylbCRym/odETnCPhl7ZjNa2dmwRIAhLTrtPlHb/dBZffhnMIrU+D9fF+61tN4ZSg57arMtanU+jG3uyVt7lGQ3aTAqDhKa+ujUouWiQ6J4gJtuDjJ1fTkWSfsCSwV8s9LQJAN6kMP+93134bFL9AO9DTHJze3fiKUGO+vtOQwDByDspw== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4f34d618-7c96-43f3-3497-08d8fa31f209 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Apr 2021 01:59:29.7594 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: L68APQjoYdMqYCeVf2ByaXlxnHfK3Z8xO1Uhcu3R5RgDYXFxsqBWvDPaBP+ofczT+R/oBYkMTq9xKmijOn4tHQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8140 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210408_025934_368227_A91261C8 X-CRM114-Status: UNSURE ( 8.61 ) X-CRM114-Notice: Please train this message. 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Peng Fan After of_parse_phandle, we need of_node_put to decrease the refcount of the device_node. Reported-by: Mathieu Poirier Signed-off-by: Peng Fan Reviewed-by: Mathieu Poirier --- drivers/remoteproc/imx_rproc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 6d3207ccbaef..077413319f58 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -459,6 +459,8 @@ static int imx_rproc_addr_init(struct imx_rproc *priv, return err; } + of_node_put(node); + if (b >= IMX7D_RPROC_MEM_MAX) break; From patchwork Thu Apr 8 01:44:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 12189759 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 38630C433B4 for ; Thu, 8 Apr 2021 02:01:51 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id ACABB611AF for ; Thu, 8 Apr 2021 02:01:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ACABB611AF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oss.nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=VHQH/DxLerhP07E7fqEcre7PQzx6cmQpjbKFDlz+pj0=; b=mdGrN8mPptEwEAKuvR0r+GRjf 54U3IQ1aa7mRmg8AZYHhgOFKIWBxP9BTL4QvCR5zi/EHJsQjtECMJfiTQ7YuOiaQQf72fuqdO+rzq BrdLDmynAw88eYTLX0Lb8pTgfwItSoz6tyv/8v5Utk5vDgQYXGFd8lnQvFeC3DrAo0BQ+C0ATIhP1 Xaw7cliKPN8w6FYT1F01FOZiTycil1ltNvGBgn8sQgw8XXSMvN+CgY6BDi4meO3+0EMPWpxYCDFUz BaPJR6mAoejgtX4EiW6c5Kh+dOoKtSPajs2PBJoJEalmG9u62DpNPSQJkDs9dtYLZ+tQ0V7FMWM42 MmapLMR5A==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lUJxb-006XpP-RZ; Thu, 08 Apr 2021 01:59:56 +0000 Received: from mail-ve1eur01hn2241.outbound.protection.outlook.com ([52.100.7.241] helo=EUR01-VE1-obe.outbound.protection.outlook.com) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lUJxH-006XkY-KZ for linux-arm-kernel@lists.infradead.org; Thu, 08 Apr 2021 01:59:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D/Z9kAh9ygCcEcN5DCaZADddtsyOg+l0kmukdnL0gLPN2/5pOWeIk/Ng9qMDTgFdcW+EUHqD9hCsuDbx5QmZh31BptFhV3BF096Ohm+ukTZXMAhOw67MIo6LwbLCqvHaDjPfrbwLGxA9iEqahLWFKWm6PJOauvzFAE5KliAprEP65hAhVl1SQ03ypHFMBLHh/V0m7L/PRIH8F1fx4uwKmsc7oAt2LdB3t0eFKbjaSV9c3n65Pf0OdjutfnVKTwkYjyWvBIZLcDfajlTfICROlQPurVj0a0c4kz15Om4UOCrO6Nw+Ld6nm6k4lhraPe3yGqsZlLqlWb5zPf5eLkbSDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=x9w7J+aWzGVngM3dEmxCQzurZ7ny8hTSneaNZC6Rtvg=; b=S3l0Cuugd0xiigiEtvOS4s0oVQS4XRz3ad00pnBXzVL1ZaLDLds+sbolowcaOajN5ae7HyypkMNUkmu/en0q6WksZbUR9rjS9mw/XEHm5msDMRemqWZqE3QS9ZDeRNmPlYXq682U5OikLiGgeqXpSZY3lqy2XyxoP/FrCsmrjQiow8Gz67nx4FibATSRShouuuH36zEi5T2e/EyXb+yAiH4jlzF9P2UZaVpJ7kLrQkrGve/YRYlTe404EGlBk7XW3zYiXG+XuXRBuoHrorCGEHnLQFBelWoxPm4lubEqjuU3VyP/EIWU/OfN+Zv1I/7Csv8PAfv71rCAeeVexqf73A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=x9w7J+aWzGVngM3dEmxCQzurZ7ny8hTSneaNZC6Rtvg=; b=IdeVR8zgE04gd/iSwOx4FFHu/Yfd8N6TU+ulp/43mvHzQRpMijp7f1TWcBNUf3RDDI58Dfnews3hkHM+YTlj9oFJ2YZaILM5xDDQPI0BEyOLbS8KNSk9RCKGJ4NeW9o+CxKIM2xki3PIkz7ajlBRfmFBK7vwyuAaoYUTlUE+UTU= Authentication-Results: wizery.com; dkim=none (message not signed) header.d=none;wizery.com; dmarc=none action=none header.from=oss.nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB9PR04MB8140.eurprd04.prod.outlook.com (2603:10a6:10:249::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.17; Thu, 8 Apr 2021 01:59:33 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::c57a:6964:f72c:21cf]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::c57a:6964:f72c:21cf%11]) with mapi id 15.20.3999.032; Thu, 8 Apr 2021 01:59:33 +0000 From: peng.fan@oss.nxp.com To: ohad@wizery.com, bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, o.rempel@pengutronix.de Cc: shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-remoteproc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Peng Fan Subject: [PATCH V3 2/4] remoteproc: imx_rproc: enlarge IMX7D_RPROC_MEM_MAX Date: Thu, 8 Apr 2021 09:44:47 +0800 Message-Id: <1617846289-13496-3-git-send-email-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1617846289-13496-1-git-send-email-peng.fan@oss.nxp.com> References: <1617846289-13496-1-git-send-email-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK2PR02CA0219.apcprd02.prod.outlook.com (2603:1096:201:20::31) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.66) by HK2PR02CA0219.apcprd02.prod.outlook.com (2603:1096:201:20::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.4020.17 via Frontend Transport; Thu, 8 Apr 2021 01:59:30 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 89573ea4-378b-4fd4-2cb8-08d8fa31f480 X-MS-TrafficTypeDiagnostic: DB9PR04MB8140: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1332; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: I+RGDtgOjRb+YijH+1a6TbnGTQaRV12EgplsWXqSQaW8Gd0Nuf2FtRWvDpXNfg1ofz4VihxVoZuksczscz3YQD46gkQWBvN/a8qqHnIm1N8RlMnNnExFMYapz0IBaIzD6i+ZiIyx1Z8oCiI+QLTXzEXz0SiwFPn4PyhzVq9WuWniFGcH+ubUTWpCjQ/2KAUQjIXk5HCPwvsOXu5l+gW6nUyXY8E1oIg+ncWfTg3t8MdJWDK8IZsBif2VZrpXoRQzORUH/IIvwgr67zXsZmzkYU8AwOvp2J3SLyJQ726Y3fIPhDVCrHcvoHOEkK1KSU8r2TUpxEfIM73t82f+QYTX1ldEG803sSyUVKyrjmGjTv33KtiahO27NaQ9QHK2i/Xj4693Z2nm3xFstzfKyUUg7Dw8nTnz8lVg2CPzEwvH940KCj+adrrLttsLz08j5N+Rf4CFKacmVAVKsMIepJAK9Ohe5OhuKa+TKEPvzyHnrHS7WsmzHRfYXYBWZwmDe1/XwmNk9Xf1jR0TpUtUj14M4aDLt7SLBBb6ND80U3yL1DVAz219T5Xcn8/fljLJ5nC7LW8SVCe26iejtvkkQPbzlFbFB6mBVhNKzAnElxe3vowdPnK0Ll3S5jK/doH4gwRaIoqRGj9UpLAyHpjlAD6dRml9dChcAPVhi8Fukl4sN/2e8Vvm8jeGelLYtC3CW3u5vI6soe7V+cTrp5APXNJ8uP2rkihFF9F0vQqfTPcvvux2nZ/2KQ3DT4uHE2Ba34kfytKsG1u0NVl1CwIDucPIwm0X+hw07Yrllwa+G9qLWV34CS/2zKKK6E1fouCz6Cx3jlhr2HeicSQk0gWNyEflTv5NoFHIYOi01vyEuTVdn7TMMOnvJ51rm4PIXpo1yCgCYw4SMKFQYtEJfwYS/iMcQUM5YiP0djY8i4pBmOWAiacADG6ZJE2FS0iyxxNYMHEOU+hsa8EDdMunWEUdO+LeZlycIouT72qiefoycyTkz6lL7YzzJourbPYZwL/OKECCQlRcEQ/ij+ZBOjIzWTislRSHB+9gwH9mWHu31Hfs1MvQf2ItcPoF18/qWHQhy899 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:5; SRV:; IPV:NLI; SFV:SPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:OSPM; SFS:(4636009)(366004)(346002)(396003)(376002)(39860400002)(136003)(956004)(2616005)(4326008)(83380400001)(8936002)(86362001)(6486002)(316002)(38350700001)(5660300002)(66946007)(52116002)(6666004)(8676002)(6506007)(9686003)(478600001)(26005)(7416002)(186003)(38100700001)(16526019)(6512007)(66476007)(66556008)(2906002)(69590400012)(161623001); DIR:OUT; SFP:1501; X-MS-Exchange-AntiSpam-MessageData: auC6TsOCofnFqSEB7MijjDjVzKFVlHy+lnQ7XoDZ+BFsQNpic8PK3mn16veVGYlO6er2L4Hai/EFWDtfN0+DAOuc1StPDRcXT9NrTEtIKuUtjgs8QBZRyrrJ0+GApWMBuL1etlKF3hp46LZ5poxS93VU7MY+lt2PUJbS3ZkUlJyCCnW5fmAHESE2mvGxnueJ9kZdnyFiMDm/is830dDIMD90YhZ2mi9PbGP0MGUwrxS8G+xhaB5xBYqEEyoSUuScadQC79kEUjlYCqZu8IgEd7QYFjyYCT8OIFNAZVOGNFLyWSs3Mmxei3/Rhgvq0A8O0tGHHpCpaiqPkdsSxvR80CCugpsLpBfnoUNnOh0sLp1/+CHe311h7VBpoLBRV4khYzFu+1+cxxH9bm3s4gGtWYcaiW/L8YjUJpWrlDJ833KWTFEBV4K5UFjEpmqQgTd1bSBmaPM7Tz6WyIgSMjttk/NvsMgSbtIybDpkbU40fPZkZHxTVvH+tyDD+YyT5QQ955BO1XHl2vH1Pc20j9E8ehvTBTvnd803VT38mW89w2767zALtRioxWfXTUVZEeZFAUQLDs/D/mw25JBc1BSIGOzL7ZR+OZT5uh10EIcNc1OxLpBZmqSp7Ps1inNXcV9oQwua1Olfhpyz6AoiVZv9TjcPELAPriNlfEiOj3DO1Fe6byXo8G2dNHHIuxQbLgARoyDlUF6txRCduZSS96g2EJId3i13gReWwG6wYB1SB4uGx9hakpOGgqBLioEU0isLV5PsOb3Tk+lz7aay8OzvXx4VWvPfu84kg+TL0qdiY3dYKJsJukWs8M5jcEznY5hryN57oWaLjY3nAXo+GtTxBBddsEONjmcGYhXTVtgQi3HLUrl4YwQBv2q8zjxmBcZR7jDvY4qVDfppORjN+DIWfPdUN6L/ac29U3uEZTb3CLfpypbam/pUsIvnzai3Kr64NDg/2pfId9TkDHzLx5FrdECUq1//IjGu3XQA8G1OXiLxoy14pJqidmHLQY+twXPUTEyV55YxAvYzlm9BXvrpqG7Eix1yqS5Bk7jb0oIqMpjQtljrTEMnz4h5FJWBmo605D3x4GhvELiwrGCrVh9Y0uIFbbhxJ68/+aPvz6X3cr1F8iIJqjYQeudxJgQvVogxtKBWBQD6hkaSfjktxBzPeXMlnkCRtdyM1rdzuakzSVXBl3cc85YH1QPMEWtwid4RLAHb2epe5JZ7PGukVdTXU8HIHRRT+6aj3raLUe0Ir+shfwplWGEjgVdBv++InXC0LVKg8zhBTV5Jde16jG/PJ325p40xm0owPrYoRgqHDSBvUSgrOcwvtQ+GtdhFBQR4K+UHWb9xDZVK86EO6gte8w== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 89573ea4-378b-4fd4-2cb8-08d8fa31f480 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Apr 2021 01:59:33.7336 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: TRkQnNFVvbz71etXG1YyHrRmg9Zv1976PeXZ2pkXl6inDGPxvRjaXQiK/rPxGVCx3VhEDQexKrJH+DiAIqNdRw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8140 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210408_025935_778797_F57D52E5 X-CRM114-Status: GOOD ( 14.43 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Peng Fan 8 is not enough when we need more, such as resource table for remote cores that booted before Linux Kernel, so enlarge IMX7D_RPROC_MEM_MAX to 32. And also rename it to IMX_RPROC_MEM_MAX which make more sense. Signed-off-by: Peng Fan Reviewed-by: Mathieu Poirier --- drivers/remoteproc/imx_rproc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 077413319f58..b05aae0ad7a2 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -48,7 +48,7 @@ | IMX6SX_SW_M4C_NON_SCLR_RST \ | IMX6SX_SW_M4C_RST) -#define IMX7D_RPROC_MEM_MAX 8 +#define IMX_RPROC_MEM_MAX 32 /** * struct imx_rproc_mem - slim internal memory structure @@ -88,7 +88,7 @@ struct imx_rproc { struct regmap *regmap; struct rproc *rproc; const struct imx_rproc_dcfg *dcfg; - struct imx_rproc_mem mem[IMX7D_RPROC_MEM_MAX]; + struct imx_rproc_mem mem[IMX_RPROC_MEM_MAX]; struct clk *clk; struct mbox_client cl; struct mbox_chan *tx_ch; @@ -272,7 +272,7 @@ static void *imx_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *i if (imx_rproc_da_to_sys(priv, da, len, &sys)) return NULL; - for (i = 0; i < IMX7D_RPROC_MEM_MAX; i++) { + for (i = 0; i < IMX_RPROC_MEM_MAX; i++) { if (sys >= priv->mem[i].sys_addr && sys + len < priv->mem[i].sys_addr + priv->mem[i].size) { unsigned int offset = sys - priv->mem[i].sys_addr; @@ -425,7 +425,7 @@ static int imx_rproc_addr_init(struct imx_rproc *priv, if (!(att->flags & ATT_OWN)) continue; - if (b >= IMX7D_RPROC_MEM_MAX) + if (b >= IMX_RPROC_MEM_MAX) break; priv->mem[b].cpu_addr = devm_ioremap(&pdev->dev, @@ -461,7 +461,7 @@ static int imx_rproc_addr_init(struct imx_rproc *priv, of_node_put(node); - if (b >= IMX7D_RPROC_MEM_MAX) + if (b >= IMX_RPROC_MEM_MAX) break; /* Not use resource version, because we might share region */ From patchwork Thu Apr 8 01:44:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 12189761 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE36CC433ED for ; Thu, 8 Apr 2021 02:02:04 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7995661182 for ; Thu, 8 Apr 2021 02:02:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7995661182 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oss.nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=iCIFc6EawmYKGiIcGWsmuEIF/NB2iMObnjUwPcDLpt8=; b=Iw3ZsN1J5oWAsuGOfMjSFnf20 kh9qcPC4lbBnPJDbLX1DwzHCvDsbYXj/hTGKNIRWvmYTnhRBfJZGYD3eZep0im9ccuNwOQUOIG+X/ 2AjKCt7H0clN8D8JEfeJtnWbWAID3mMUDc+C/OLdY5vw5E1CnlRbG34tKtHGJfSqjUnqZPVjiZw4k F+O5uwpMX4Lu9BHCSl+O6tB0WkYOm4sv02UGZV6B8v5UeVj4f4B1/jxB42yIq+E5IoInUHb/EGWtv zQmafjFPxaGfSGTamboBZnFDTk/+pPLNudrXr3b9uopdFsn+pr2Tpx2Wu42xo5NsfMDr2cxTX3Nv2 s2XZ0mbwQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lUJxn-006XwQ-6r; Thu, 08 Apr 2021 02:00:07 +0000 Received: from mail-eopbgr140043.outbound.protection.outlook.com ([40.107.14.43] helo=EUR01-VE1-obe.outbound.protection.outlook.com) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lUJxL-006XlM-U5 for linux-arm-kernel@lists.infradead.org; Thu, 08 Apr 2021 01:59:43 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U8KxW2vRPluv/BseEZrpkWZuCAt1s38kTRwMtgnO4GwFsyTdwJ6Bhwhh4rVrD0RJ/Fgy2EJ4inpA2NDy8KJ2CxfgPS52rF8fPhIIykYheytK0RqC929w7/zcRMdbAebVbnibyVyEL+9ddNzSY/xPzy36Zm1suuWF+h506tGTlcC7Mf7Wn4OwqLvli9ahkMZEHzsjuEYNeUshxAxZ3oD5vmmKxGYhSQBomNnQS7ld1rbsxDVUDxVyqpqFLacZ+lQMnE1FuoTUNDTBZTjdWnhqrQ8dV9NS0bwN6se50mA4CcsiqqfmwCmnFQ+agL+g4Ih5D1N1C7STBk5AD0fijMlVdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=j1kNPoe71Z6DxKMLquhWilNNh8lcd9+9GOrw/NZSOkg=; b=e6avbe+npE1YOOsy499Kv5L6vgL4fPY+ditV20Wo343fSNelXsbNNZir9ZmsOONXAEwcqrKRRBkk+OzYWOH5DEmnEqzvg20iOXNFsO5Rc4pd4wMWYBia2LkfffdfXoYJdAbsD4cUsARz+KBu7grAPyWebH9a2pV0J2pS6bRXLBGJQIkSj2Nc9tm5DCNQpdCVr/Fjomqjycv1+TJuEMAwuHtJuPHCc1Yu/RW1kFw53+qZqrV5jY49JyZR97wVVZwasNok+ZjAmHYkJdYNkXDIbD82XfX04k3aRfiJOu437Nf3lTufmvseciATlY7jwf/LmP5AWxHIirjV5+JSayB/fQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=j1kNPoe71Z6DxKMLquhWilNNh8lcd9+9GOrw/NZSOkg=; b=A0IjYgon+VditPufQf1VoynRmM5GwlPJsPeQM8g/8PjfeQitP2AadzWJarkRdYmNFrmPCEaR2gIz8+tVeUWK0zxNrx7CYGQ2dJ+gN/7Feb6aZBWEkBXmxlWLNHL4TksgcvlBqAmsRTfVW60kFgClXaDM1R83MBVKpPbmBdDbSzg= Authentication-Results: wizery.com; dkim=none (message not signed) header.d=none;wizery.com; dmarc=none action=none header.from=oss.nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB9PR04MB8140.eurprd04.prod.outlook.com (2603:10a6:10:249::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.17; Thu, 8 Apr 2021 01:59:38 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::c57a:6964:f72c:21cf]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::c57a:6964:f72c:21cf%11]) with mapi id 15.20.3999.032; Thu, 8 Apr 2021 01:59:38 +0000 From: peng.fan@oss.nxp.com To: ohad@wizery.com, bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, o.rempel@pengutronix.de Cc: shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-remoteproc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Peng Fan Subject: [PATCH V3 3/4] remoteproc: imx_rproc: move memory parsing to rproc_ops Date: Thu, 8 Apr 2021 09:44:48 +0800 Message-Id: <1617846289-13496-4-git-send-email-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1617846289-13496-1-git-send-email-peng.fan@oss.nxp.com> References: <1617846289-13496-1-git-send-email-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK2PR02CA0219.apcprd02.prod.outlook.com (2603:1096:201:20::31) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.66) by HK2PR02CA0219.apcprd02.prod.outlook.com (2603:1096:201:20::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.4020.17 via Frontend Transport; Thu, 8 Apr 2021 01:59:34 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 39066d99-c706-4f53-efcd-08d8fa31f70e X-MS-TrafficTypeDiagnostic: DB9PR04MB8140: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2449; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1ti2ezZTUWThkhw+QfOLBm7nJe2QyLD0SfHT1pq6iVEoLOROhp1BT0d/rUNjxyf8vZd1MXXB3SzmvDSpA3nYHi0Uhz1LWu7mm0aQuUBLhPn2swW7hg3Tl7sM5FkoJiJXbDbbjiNe7Kg1puFVW6TgsSb4pIsYgA4XiBy7Z78y9DDpawz+71exa3XPOiGnVePpV7ai3DJ/OCDM6M3s44/OOCd/6upbLQ+/cQvoSiTKM89PFXd4/Yl0FGtdT/1rxgkaQPxcdhnOw/CWDORWfDY96Abdgcq3CFQrPJY7G+f/hOmvw3WQpJuomE0WA14KWywsdYbWZ7vcoYXhJjbmVoIV+q17MCZMcIaQQNu4cuA0ZF/xhrlKTX0FPJOgBGFL/38JrKg2vgmWmCnphyQak1fqD4WGalNjbsOjcipM9yw+iBsncYfCgin6SyztFyMbZUgfCpXcVUlGwlFvQSZdM1VMbvnEODXIFnxVkg2ShYvRLDqwP8TpdCTsOzKQ4Lff5GQicPVFlGTNGLiiGKI/VxBo6M2pqW/aRlmwcFC6h9DNyLAuRMXrZWriHIugVUg8Zt2+aHKaSkQ6r4AK/+yLL4Njn4w+LwvKDdnMjioeBUY2QC0jlHle38EcXCAxTCrsTMws14/QfIV7vOETBXnHhTUUlBCFw6sAPTEAficlvv0KMj4A0tFQmVeS44qwcI4diAv8KuuRq+/hmmeOMtI2boIuMjvxqJY2URs3MbR678RJMho= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(346002)(396003)(376002)(39860400002)(136003)(956004)(2616005)(4326008)(83380400001)(8936002)(86362001)(6486002)(316002)(38350700001)(5660300002)(66946007)(52116002)(6666004)(8676002)(6506007)(9686003)(478600001)(26005)(7416002)(186003)(38100700001)(16526019)(6512007)(66476007)(66556008)(2906002)(69590400012); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 9O+6W2bIdxaKVjnns1LXIK2vs/yQ0CJrHZn6GlpPF5YKlQFSy33YHnEnA/ohbgpqKWWskOhztAOizO6505faOAsgKPK/xd08NuqQ7WEXnd92byFWVh/bIGyvl5CiPcKlAbWmNB5BEShfh+3GsJFYUWsrWUKO4lWDcoAm2CVLL2Sw8J9D8yA6xFoq9rwJyvVwEA5rbedpTSTDbKi8TuMQ2u37RYpJsHrSOKxYDJmWNDTpqCysb5447Byfz4yUaUhIjIwWiW4aU/LQSIbh0uNGZyVNBNbTox8JXF4g0FkmlDTAdnE4jP7C0q3eYOUtGf91/KbDhm9COmoZKY14y8bizOJuNyfwI2F/qjwN9tKV4nnbhD2tGakQyIhohPDxxGkIp/8SpfXtIJQ/f08g1YcqKcRYs2uMWqPjoOCGH1S+YOrHJhyKt0iCUUAyejSV1SLwIeTpBax2P3VPvSsNoA8e/PPH6RkcLKucvJy2alqng31lTQ20O4cIoBm4oo6yVCReObwzofZJiXadiKlsVlIcO9crenHPpn/1/FjwAYpuxI6Ecvxqp8yFyX0a2Nm6/SnDMUziXWqO2HHjMftTCI2NKADSREgW8Lp4BDlfO8oL3/Hi2ZbWFlCcaPg9t4xYvwGk7+ITHATNzj7l/me339izmWQPiuZsxMyEtvO/EHakgG90mNDlOMKG3qhwH0JYeHx/qdAbraGaWbJSNzD7/kqXhLWN1tVDvPEz7HFav+W3gSOaTaaRMJUkwj7J+0IzixoOJSUBXcbULk0oUFTz8+IkeomY6rAcQv8Qsz2Vbx6VXgV85REAPOXmzKmb2y/iw96QG9+Xtsd9ZWPh09k4l0+iwPaIZCxZnHsBXiYnj3H9l8lUhk9vR1+sbQ/p8FiEaKFH4+qYDcUuUge1LKmBEky86dgVU9K8zAGa+hTX5iL+3ftT8guKTA0St1PQcAjRd9Yi5x3zBDJLXyj7pp9o15oxY+IpdO8iQBsB6L3H64g+yN7REFnwHR1iDP4vkAkXSP/hsViipA7Qaf3uBhl3MasyyU0hFnIkxGWWlSEPxJQcYda87azN1H/9tyX6b94EmoigpYGPHOH7XLv+bkHlS/zIkEkCEhvI4Y3OfRdZH6KK5ZEJpGtr+77SL5+O6ZzKi4EqojAWxfDgvAmqDCzMZimwYznp62yo1jVq/Q3OGwTtnjvxupds3+aTT09xOhXnuIFEd6W1OCiIUQdItPVjTAhg1vv2DR2FRTLYwqV4CZGcMa2Q/CtXJsJTVWH8ujkbLS1xwN8w7AxyjRcI9HbAHOR8vSzDEORjtB1k+HqdOd0C7LTgr0EXOzOKy0nvE9O//h9YpvE0VaJNVrhUiyejarUwjQ== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 39066d99-c706-4f53-efcd-08d8fa31f70e X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Apr 2021 01:59:37.9717 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: PIXnn9xQaSt7vrut0ZeZd7Z/S3xn2HzbAAEAbQ266nRKE6OkvZGhQJpQaEh076cxVm0h90+qJfP6GAKiDytL4Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8140 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210408_025942_139171_52719487 X-CRM114-Status: GOOD ( 11.33 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Peng Fan Use the rproc_ops::prepare() hook for doing memory resources reallocation when reattaching a remote procesor. Suggested-by: Mathieu Poirier Reviewed-by: Mathieu Poirier Signed-off-by: Peng Fan --- drivers/remoteproc/imx_rproc.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index b05aae0ad7a2..7cd09971d1a4 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -317,7 +317,7 @@ static int imx_rproc_mem_release(struct rproc *rproc, return 0; } -static int imx_rproc_parse_memory_regions(struct rproc *rproc) +static int imx_rproc_prepare(struct rproc *rproc) { struct imx_rproc *priv = rproc->priv; struct device_node *np = priv->dev->of_node; @@ -363,10 +363,7 @@ static int imx_rproc_parse_memory_regions(struct rproc *rproc) static int imx_rproc_parse_fw(struct rproc *rproc, const struct firmware *fw) { - int ret = imx_rproc_parse_memory_regions(rproc); - - if (ret) - return ret; + int ret; ret = rproc_elf_load_rsc_table(rproc, fw); if (ret) @@ -399,6 +396,7 @@ static void imx_rproc_kick(struct rproc *rproc, int vqid) } static const struct rproc_ops imx_rproc_ops = { + .prepare = imx_rproc_prepare, .start = imx_rproc_start, .stop = imx_rproc_stop, .kick = imx_rproc_kick, From patchwork Thu Apr 8 01:44:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 12189763 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 51168C433B4 for ; Thu, 8 Apr 2021 02:02:17 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BAE79611AF for ; Thu, 8 Apr 2021 02:02:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BAE79611AF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oss.nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=xH1buVQlYNrlTMd9fu3HawnWFvl5TwV0dgXP51fc7vY=; b=EDqgKEDC27lftxW+HTRMPpB82 v0v5/9pAlXQtDfUc2Q6EdXXOrVs9AW16QuvgvLeE3rNb27ls6E142UjANHICjt25HypizyWedTw20 fej7Da5Gg8OtFo+velZELjmqYPD7k9O28ZkUn3dSWWEAInJcTPW4PtXlOkuccHWypns95hIBax7xE fwtoiHZG/0cPNE4ExavKxPXUZ/Ri80hFQX7Hxo+BNpQVXg7yJdc1+e73PSWf5LoYaC9+sO7A0bVLh 21CWXcte9RbX0rfvOzCmyvvTbxq30iVPI0yTu3R+PJGfQZwavsVbfMPek4sWDn5i2LPkVCBPUPxLr dxMp5j1Ww==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lUJy6-006Y1m-Ks; Thu, 08 Apr 2021 02:00:27 +0000 Received: from mail-eopbgr140043.outbound.protection.outlook.com ([40.107.14.43] helo=EUR01-VE1-obe.outbound.protection.outlook.com) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lUJxQ-006XlM-Ke for linux-arm-kernel@lists.infradead.org; Thu, 08 Apr 2021 01:59:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g+L3xi6c6zHXIZtq9NQklB8+WlP8+HTcFrjHkD191NlDtqeaugxx0MCeOB96p17n8D3D1lcYZwxvDS214TwezNWUSBzP/aDyIvDP5N9hk3Udj3dxGgnuSD39eNg4kt1AOKweJyl1fcgDTugi7lzaVdaE4IhqQRxMN/rm7/Gw8GUO6ROdPdXTmQJj18k+9SnRHI8PJsPDIXTRnYt4PHtUJkMM81yvg3vR4bKjQDSZlghmf7FoZQZMX68jr8EehsMjl6GF2OA5xrxPN1y4c0kHi+pDgjAIcPd5Erp+CuJjMVek8sBrVHt9fGScCQcawVYzZiwuiKYnfHk8Clcs1kEHmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qusxCsXs3I5Z0PqUbPNaGiJihqojpiGAZRdBw6OAFX4=; b=K8a6x9GYdgcwuJtisbzlFpi+6fXzZC1T7e54M+C2g8/mP0mhopthaJiqohxc9oMviX8ZDqdNi9d7gi1H8xfdJc+Kw8IyE+Xew3ebKUspN5SUEQRkoTcFsu91ekJ2VyLL3OYQrkLrGona1fsfIOow6xwORUkd9fBD+mqdhUYn/aVlklhSHGQHCODPML4ltMSEHxvpcY6HET8QFCX2EoKRhFXJt7pX9dMN47s7V3ss/pGdZX0u5Um0g1L5PzRqXlpsAEt1vRr4MKpbGaO0MakpTtorv+0pRIy8vWu2VMtsTDlrPCYhjGRm0Rk/pRYardHrg8HU7oMgmcSYioImGgdNXQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qusxCsXs3I5Z0PqUbPNaGiJihqojpiGAZRdBw6OAFX4=; b=DjBnzIrD9jPXBlWy1ryO0DbG/jLniZvT285XARy0OUzPq00yK3sVjKmLYV+eNkB7FdsoKhG1NiY9a9lQtUMvt3EnqsROxkY/E4rLnkqL1BbmLhcfKPs0RJPBqy+Jg9o0SrIKpbTIxKJWyuLjPAU5aAHj3j31ntshhiU87HrvTwU= Authentication-Results: wizery.com; dkim=none (message not signed) header.d=none;wizery.com; dmarc=none action=none header.from=oss.nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB9PR04MB8140.eurprd04.prod.outlook.com (2603:10a6:10:249::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.17; Thu, 8 Apr 2021 01:59:42 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::c57a:6964:f72c:21cf]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::c57a:6964:f72c:21cf%11]) with mapi id 15.20.3999.032; Thu, 8 Apr 2021 01:59:41 +0000 From: peng.fan@oss.nxp.com To: ohad@wizery.com, bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, o.rempel@pengutronix.de Cc: shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-remoteproc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Peng Fan Subject: [PATCH V3 4/4] remoteproc: imx_rproc: support remote cores booted before Linux Kernel Date: Thu, 8 Apr 2021 09:44:49 +0800 Message-Id: <1617846289-13496-5-git-send-email-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1617846289-13496-1-git-send-email-peng.fan@oss.nxp.com> References: <1617846289-13496-1-git-send-email-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK2PR02CA0219.apcprd02.prod.outlook.com (2603:1096:201:20::31) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.66) by HK2PR02CA0219.apcprd02.prod.outlook.com (2603:1096:201:20::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.4020.17 via Frontend Transport; Thu, 8 Apr 2021 01:59:38 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 99d6bd1b-c1d2-45fd-0bfa-08d8fa31f964 X-MS-TrafficTypeDiagnostic: DB9PR04MB8140: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: m8iyl+utLrQsebwBe2b0114s3EzPZIj+PGKDdNw/Jtmb5Np8HqKZIjnrw131OlM3/RjLFwxdISasfq6zXrb4lkE56ixBgrRz2PKZCkFs7Ahc2+BXsneLFyamrdSjHbEQJAMOGDKrfNX7Vbm0wuc+3FB4NDijXNqin0Wj82wtz4zsSOmIPN5CbymM6k75/V5r2VZLj88RI8paNc85KiFqzzJoWe5usidJ/6b4d5bexrUnUC0rcc9lH0ek/Ljeab5BsFp99kaCw+Zx/uNKsCiS4UaIYmIyEhCzjbe9vnKhB1UjQKdlxGxi06zGcQZspZujeq2vy3Bg6pwBHYV0AgJyDk+F71WkBhO9N8YSlloFpylRua1rm49kQ8YkcPr/k9T6G5iLR9iq7UJGkxXXG4r128q9AQaF0jyvd03Rc+zqRJepiMS9EJRVY+O4jPRsZk6vdLrJTadREWAFF6TiZqmKn3HEb5CRyNDrnAT18vUrJniUwB9070+gCJjDqCqtbmM2Y3NA8m09Th+6khXSUShttxk6iyZcwaVGEjWyyu/ClB+4/4HYb30Ie9AoP0P7NPCfhRSz0XaGNvflOcQgpJ4sY88a7JlZBo6/pW+8HFRLngwrWmZs3hbP/E4JG0BcaMRGi7x0lk5i4CFEEPAnNZhPs0KWZKbcDNrylYnwswn4ZLje+yYpasxhiZQUY5k/KTOaazZz3OJAj7NW4Ewy6bi2TmU3cLTYSQm5LHLeE/FZr+0= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(346002)(396003)(376002)(39860400002)(136003)(956004)(2616005)(4326008)(83380400001)(8936002)(86362001)(6486002)(316002)(38350700001)(5660300002)(66946007)(52116002)(6666004)(8676002)(6506007)(9686003)(478600001)(26005)(7416002)(186003)(38100700001)(16526019)(6512007)(66476007)(66556008)(2906002)(69590400012); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: L7FBPpbeMcUdXjeyC6aH67OIHbFTkgR2GCWZZ0J0lkYUuWGUD9uLVLapnxUjTQlOYwvgBUJUVhDoiEOKY371A3aml1Z+ZiLFF40JR4ta2vcHbLlCnjEqUcAY9v6GtTI1lBtECA/ubE3Uvju4b9a0W48kg95pNgRRbBeDCNDWoDVWW7fBAiw0U4A6Hl6wxjWAZV2QbImsRH4db4RNICE+/d5quLA0xFd3okICg7K7jihTDndzyBFzkm/A7BCRARY6LA0UJK9F3UFEpbJYONTOZBxbJpFe8WOezPC1ZdBOM7ZAU/hJbN61vjVzBshciXW46RiQKNqBwQFBbB1JyQyofKiDH/5N3cq6/vbJgru4TJjkp4sVCq/7jnzdhd5u4XpRSkUOzSr8UfwsnFTnqGiyPNMfiOVdy54+C9asTtVGRuSHAME9+eVIaUllrPP+tOCzjQ7anknHcZoXLMni5BBX4IwWGLWdIJh4ETKnG+oVUl7PG43X9e2WgxoT3T2mzgg2afxFImgU6JnJKcHGAB4zX2RpdfkI1er6PVVAELgB4tLIH/oLh9NKg8CBrs1Sa5FOlycGrtKkGODwkjqv2P2GGuKW7PfHFAGMIc2yRHiFTyEmFZv9H4ULD+PJZl/6LTG3jji+ewQhqrVtHHBkfwYFLQ7qkw3UY/HtLw4G4OuC1sDg+bZ5nhZm1NoguqecIhMjZlm+s9Guf2HP9fgzXJ4HSqhemSKBmx5JzFl92umYjbkfefB1Is0h5NoGrcPbOL7lbx2l2bKc9SG26yosIe0BY/l6K4m6h0jOMIovzn1PmhrhVz80fgvYt7SUMSpG/XT3D795KPOsWgL7DRk2g03gh5hb1UKjq8RylX3PAM4pYtA8CUzAClYzTeaBnGIevMLr0FeJ7hOlrG2ayZdku3TIqSjJlZ1nqIpRJkMFx4j2TLT2My1BwNktbL6b49t3ilJnOfq81vqRMwXXwh3FOU2s8q0RQY+iHGX29Hv2culQa6QrjImZxJQvveJn7i3MM0yZXbO7pyrSdIb+gogivihP6j6Umv11UhFgWqTxGxnwTr2id1KPsLVijtOE/zW45LTmbQAQRsO6gDN82pDrHoNFT3qL3WQ5Oz9pyeM0wbpVHRjr3cFyrwm5DbWiNUs70yMdg8H0GWWcMK5oYaR51uF79CD1GNGq5OflB6cIpy2Ag6Dvsu7N1WQeDQdGu+h9SyozyFMgEArGu/L9PnwoD0AoaVx6gz/j0nzCCqVvxG7fGJ9HnSDS/4VKrE2r4fT6AJbOMQpRzFsqp7qevs4/iDQtLC2A+IBxUtDrcYTv7ql5J5j4hb2g+X2bRd1L2Chi+RHGHDfWkk0A6WjC4sgGH07Euw== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 99d6bd1b-c1d2-45fd-0bfa-08d8fa31f964 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Apr 2021 01:59:41.9109 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: qaf2SM6Jj4elG9MtiDliUrGQNe5KIxLfH/fQNN3cEeECH3neLUmL6Pzv+BCJUsHdfZY295Bmw1uylgczEDVUZA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8140 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210408_025944_884646_BF095D25 X-CRM114-Status: GOOD ( 16.91 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Peng Fan - When remote cores are kicked before Linux Kernel, we are not able to get resource table from the firmware elf file, so we need to add rsc_table to hold the resource table published by remote cores and imx_rproc_get_loaded_rsc_table is to get the resource table. - Per remoteproc framework, add attach hook for processor in a detached state. - Add imx_rproc_detect_mode to detect remote cores' working mode to set the state which is required by remoteproc framework. Reviewed-by: Mathieu Poirier Signed-off-by: Peng Fan --- drivers/remoteproc/imx_rproc.c | 45 ++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 7cd09971d1a4..d6338872c6db 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -95,6 +95,7 @@ struct imx_rproc { struct mbox_chan *rx_ch; struct work_struct rproc_work; struct workqueue_struct *workqueue; + void __iomem *rsc_table; }; static const struct imx_rproc_att imx_rproc_att_imx8mq[] = { @@ -395,8 +396,26 @@ static void imx_rproc_kick(struct rproc *rproc, int vqid) __func__, vqid, err); } +static int imx_rproc_attach(struct rproc *rproc) +{ + return 0; +} + +static struct resource_table *imx_rproc_get_loaded_rsc_table(struct rproc *rproc, size_t *table_sz) +{ + struct imx_rproc *priv = rproc->priv; + + /* The resource table has already been mapped in imx_rproc_addr_init */ + if (!priv->rsc_table) + return NULL; + + *table_sz = SZ_1K; + return (struct resource_table *)priv->rsc_table; +} + static const struct rproc_ops imx_rproc_ops = { .prepare = imx_rproc_prepare, + .attach = imx_rproc_attach, .start = imx_rproc_start, .stop = imx_rproc_stop, .kick = imx_rproc_kick, @@ -404,6 +423,7 @@ static const struct rproc_ops imx_rproc_ops = { .load = rproc_elf_load_segments, .parse_fw = imx_rproc_parse_fw, .find_loaded_rsc_table = 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, }; @@ -470,6 +490,8 @@ static int imx_rproc_addr_init(struct imx_rproc *priv, } priv->mem[b].sys_addr = res.start; priv->mem[b].size = resource_size(&res); + if (!strcmp(node->name, "rsc_table")) + priv->rsc_table = priv->mem[b].cpu_addr; b++; } @@ -536,6 +558,25 @@ static void imx_rproc_free_mbox(struct rproc *rproc) mbox_free_channel(priv->rx_ch); } +static int imx_rproc_detect_mode(struct imx_rproc *priv) +{ + const struct imx_rproc_dcfg *dcfg = priv->dcfg; + struct device *dev = priv->dev; + int ret; + u32 val; + + ret = regmap_read(priv->regmap, dcfg->src_reg, &val); + if (ret) { + dev_err(dev, "Failed to read src\n"); + return ret; + } + + if (!(val & dcfg->src_stop)) + priv->rproc->state = RPROC_DETACHED; + + return 0; +} + static int imx_rproc_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -590,6 +631,10 @@ static int imx_rproc_probe(struct platform_device *pdev) goto err_put_mbox; } + ret = imx_rproc_detect_mode(priv); + if (ret) + goto err_put_mbox; + priv->clk = devm_clk_get(dev, NULL); if (IS_ERR(priv->clk)) { dev_err(dev, "Failed to get clock\n");