From patchwork Tue Mar 30 05:30:32 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: 12171673 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.7 required=3.0 tests=BAYES_00,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 7CCEEC433C1 for ; Tue, 30 Mar 2021 05:46:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 46AE161989 for ; Tue, 30 Mar 2021 05:46:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230168AbhC3FpW (ORCPT ); Tue, 30 Mar 2021 01:45:22 -0400 Received: from mail-eopbgr20078.outbound.protection.outlook.com ([40.107.2.78]:25454 "EHLO EUR02-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229667AbhC3Fox (ORCPT ); Tue, 30 Mar 2021 01:44:53 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B1goNuVOOojcg49ZZF8KNrAO5Sop6kVl/ptwmhYEjSQcylX5TtwrBwZh+vetG9dU/Y3hwFmj138aQB/QB3HtSApFA2j0eeRfsR9URhZLQkVyW772Ib7YxxE8vFThbOdjN/6RgjT1TWL/7QIcIRt6CZWVrOBUU6Qs9faLLN+5MYVR+f45KJasYsPnUgOrh9uo+eYI0Q2Y7aZPxgrn40ksgk5NVRGFvjwg4T2ajD/0qJDBDy22/ckg253YB5Bmf+Fq3aZg8+Qc3KdsAIVYK8sF4vSxN0XJEuT52pwsUCK7Xi0HMJWznpgFtSPUsxul9/FsxRN7G0NTFutbrIm43w/diA== 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=8RlHMDSypdQSJYG82fSLmpTa43T3LOXPnbT839t0l00=; b=F/8H1sgXRbHOgPNwbow0DHTVc/mgQo+pqjEzJQAFLalShhzZBpBUJJTPZ1K58ErUPPP55CCOb+0gft3xdNMQ8GeK1cfptFqFkPRjYDycdmUaXoGnEhRrVFARzTni7s9PJUc7utDhvoso7PCoJV4L7xevf5rngVkSI4o6JokknFlQalrvaBU1Gvb321M06Q2XeNPW/hywGizUE7YCzomMe4FCWu9ZmCTIw4wLzE9KHqvyUd+V7jBKDjSb/m+nOttT3funH2MIkEnT7uDbGgv3FokaDd9jEiWL4AfnKA5zlqy9M2Zxmp1jHXihXnaN5cPYGH2z1jMpfF4whHwWUMjiTA== 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=8RlHMDSypdQSJYG82fSLmpTa43T3LOXPnbT839t0l00=; b=YiDJa3HYK0z4XRwb/XVAi5ITtbW8Pd98H76QKtSU64m31cgEfMpTG+HfD+8YZLPEAHzLW0gV9yvgHGWEp3kU40znmCrqNjDslxNZzVsLsbQnAa1g86GWqMSESGRwxhT6hMbodH7A14drLwPdBishDtXEkh7POmiiBWOphU+I1Dw= 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 DB7PR04MB4489.eurprd04.prod.outlook.com (2603:10a6:5:35::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.25; Tue, 30 Mar 2021 05:44:50 +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.3977.033; Tue, 30 Mar 2021 05:44:50 +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 V2 1/4] remoteproc: imx: add missing of_node_put Date: Tue, 30 Mar 2021 13:30:32 +0800 Message-Id: <1617082235-15923-2-git-send-email-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1617082235-15923-1-git-send-email-peng.fan@oss.nxp.com> References: <1617082235-15923-1-git-send-email-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK2PR04CA0055.apcprd04.prod.outlook.com (2603:1096:202:14::23) 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 HK2PR04CA0055.apcprd04.prod.outlook.com (2603:1096:202:14::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3977.25 via Frontend Transport; Tue, 30 Mar 2021 05:44:46 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 281cb875-aa2a-4e72-f0fd-08d8f33eeef7 X-MS-TrafficTypeDiagnostic: DB7PR04MB4489: 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: DvB5iUKQofmvhvXHEHdnUkTRYHbH6BifzTw/snivHKl3AzqdY9o3v+r6cvi45Y1njnN5BxsARujVqWK6FK85AtuqnhS4xmHtSDxBE2obfu9hFRQT1zhXAne/UE2ONKQGGeQxD9VlHP9dWAMdS0zhYFMEBqGpD5wErXZrX/w7n6dSxFarVgxXdqz+pduP3F/0edifFHD1jxb7oCQhG5ao7euVG+DWvqau0DwjFIaloGxjKCOwu4c8qbbjZD+U2Z0MZR34fYQrpuOyLN+yQBiwunK+RK7d3zfx8aMD+cC900tigSMaA73fLiA8PmwX5Z29WEwOLqhQtBar7XRvmxxaZKuQJ2t+cl/FCo703XhsQDfxUSguVCg0F/dCck15QnKwohV1qDJbHMwTwmbgbZMsrJFjdDPiPw3JXOP+LFIzA/SsGmLogG0m9b6Nyfs8vJr8V4oOmhNOTKHtl5qyJgyljceqqJuijadAUYKJNqEdEOcp8tNuqdiIXc5PQwjJWqvI3AuvtEnInW2Lk3LnVv7MlIgrTySjIqyIv+CutMDBR9379HyK+lnHPMjDTme57vtpva8Rmjt2uo8+xBJAvf8VLhaUbVV7iHUBBseFQaYy2YJIPQe8m9PgheNhJLyKtnPVZpI2UFUkC8SoGc9SMuogt1fc30IMbMZBvtquJSHVwGI8+EuKBG85mswaUHMC8fZi 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)(39860400002)(396003)(366004)(376002)(346002)(136003)(956004)(2616005)(86362001)(66556008)(2906002)(6666004)(9686003)(6512007)(6486002)(26005)(66476007)(66946007)(8676002)(186003)(69590400012)(478600001)(4326008)(6506007)(5660300002)(38100700001)(316002)(52116002)(4744005)(8936002)(16526019)(7416002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: mLsADwSQb+oaZJbSTu8VrE5+S5MByIG5fh8tBtU3/6+lUucWuxmAbiOoQwwPrrTEkX48dSAhSoGpTkbwsWFkSeKdQJznNt9yVV5mGwHvZEnRJ03NSOkEgb7lMG2KlD5MUXqtistDlGjRlSQjKoytyaE/HSgRyh+XyUVmKENXFtciOc+wTRmS8JC1eZ9F01BSYIo5PvqX9EkgVgjyDKeLx/w28CtRG7A00ncm14vTtixfpBjMyq2lE/ToVMuWicxcaZZIv3RvoJnlWPDqdHtwP5w8zNY65JnnyXFsiFRECZ/EiwwZAJCUP8beHm0JmS/JcrPvBgJ8L5tpaWxXD6SylbR6pzNVMs5pslRW+irWJSOr0XW6aTXZeFfSSb5yk+yT2/8lQaMjPpVBst7FxExwFd5yIDPhc/61t2nVTU3/bGlZ3NC+sWiZI2iO0Ev/lallXRSRjgf1sB9NBYBK1l7CxIXu9/g06mU/+4LJKs1auQPcf8gYR3Vhsh3SxkfRue1RwCkzqEJZMa3AQQ3LyQ75k7hErKKqEMWVFgQGlEomMyzqa1Zb0Nt1ktXiZc/2J7QXd72xAMVu0Z/e9yQlAT8uhwH4AdrvQi6vrISCHjqCMJEZzQxHib2WuBuAKdq8P5MRZsVqS93kEM2NQQAqnp001aGwXVfMpQulEjo92QBg/uKeOXwMH6FjOmkxsaPNKDctdBpH82TjwCFhHWenQZNsUE7bHrOdtlK0jOncL421edTSSTx5SMbjap3UXoTvhtsq1E3pAegyRNgomtp97GG3HYHVj7sDl1c08CUaxsoBWtsp+DoGJ71SvGALojC3OfVQEYG8f8I4bRBKZKIGNM6Md7KwjuI1I17xnLZcX1/UFVSNDgM8IsjhmzgAEfuVGFQBTW/1QEQB+JMUto6u9efYQxdDDC7VFJ0O+BUSTzaPxuNPBvOhpkawcx1oxz5UhQFy9DCCoEzGl6gzijo227ujhipNsUkTgrubw7Bn27lctHrKot8pOhIHK+Qp9E4e3FgaiyaCtQCyEpyP3UTR3DZtwjaWqifM9kNmdH5IKvsC7Bv2461KWfqizRgqIwHYZQBNF3BcEUQdq51hi6A0s+t7yAxpyYTSlH8RSb7c68zS6f77+jYG1krULfvxvYN/djEnJdmAGOJQ6viPERZg+ErEkakJ/akbNrdtz14LgdfIABKHziP7PNixyrUk3b7lYR9GpxTiJFoTXxwuJwu4DR2zQeXpqZcqFSOUZ84aVT+gWljcNVldTwzj1UQOIGlMN1L9f1R3GdGl52vtUPBwUctXwNNYQjjL18fj+dMwSJF7u2h2Z5IkYC7kw6sKjAmwMM5C X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 281cb875-aa2a-4e72-f0fd-08d8f33eeef7 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Mar 2021 05:44:49.9172 (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: 8X+lXqOWkR1KFmFc6zMO1msC9K2v87zEIKiTDEBhXtwmeN2bnhh7A7gDkaD9CWoOkqfhT5LVl3zjKNMkmVW5OA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4489 Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.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 Tue Mar 30 05:30:33 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: 12171679 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.7 required=3.0 tests=BAYES_00,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 1D8EBC433E1 for ; Tue, 30 Mar 2021 05:46:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EC66860C3E for ; Tue, 30 Mar 2021 05:46:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230280AbhC3FpX (ORCPT ); Tue, 30 Mar 2021 01:45:23 -0400 Received: from mail-ve1eur02hn2226.outbound.protection.outlook.com ([52.100.10.226]:18158 "EHLO EUR02-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229569AbhC3Fo4 (ORCPT ); Tue, 30 Mar 2021 01:44:56 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oQRY4dYLJjnNKhXftyMLgX++BsCHw8V9qxjxHXmhCza1rtKWfbs70dhDURCMmveK2lxvxUugLnKd/mcGkv5Y9VNEiLc8JCxJWrpAQF5NHjTRI8DXyS1TWfmdP/IJNphcgMfvSojFOJf/Sk8rVE8TGDbW/nf/sH6qGYMkQuxrVPdxQHo7CCwLcyO/s3pgk4FlOMu2oYkxdeKlr5PYvheUj1bKE0WMkyAp+fn8r6UMk2brDQGi2oHgTR65j0EQVXjrRijqq9mgg3SJQiwhBWvnJ1hRIttfBtv919it1Zg/vt7pqsmcfhaN8fGKqypnLZk+SptxaIqjoGRin5LbSmg1RQ== 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=DCuzu08TrV15aHLkuS5+EM6C5N1xEeE8eTPBMjuMdNK2VYy5VHOgQZCtLkd9z2DnrKEQXtC9/lWUin/0Wl4+rUxplHHctUtIUy6/XAMQcnkNFDu+2iTNgVjPgp0b8WHUZOsCqykny4Tx76fAKFMHB5VQe2ZI/1cry3dWSlZG2WjFjT4CzwP/jenwmbMUkQeGZqcm77VivQlzV5g+phErfHU7hKBKAcnRgpLkvICIaEp4EZRrXdGb0D/bCs/RWIZSFCOVGiP0HSb48iCmS40PbM/RrGXO2dgCLk586eE7lTvudmrtAMN1OWZP8Xda6zGEoApXw8jkTg1Nvn4nUVQoEQ== 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=MJ/ipjPQNPEcFnm+VEa0y3wMb1jReq0qXWlD7pM7JcYoWHbd4+2Hd4t3YXEsdpziOZEVKZWMO2YOjxFmYYMEW8Znbtfz3YKYqa44L6uTd1Fyda4UV+CanK8QXVsnVqWHOdXaZPJEbTAtfneQncH2qUwkN48i3rmuWFdk2U06GT4= 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 DB7PR04MB4489.eurprd04.prod.outlook.com (2603:10a6:5:35::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.25; Tue, 30 Mar 2021 05:44:53 +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.3977.033; Tue, 30 Mar 2021 05:44:53 +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 V2 2/4] remoteproc: imx_rproc: enlarge IMX7D_RPROC_MEM_MAX Date: Tue, 30 Mar 2021 13:30:33 +0800 Message-Id: <1617082235-15923-3-git-send-email-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1617082235-15923-1-git-send-email-peng.fan@oss.nxp.com> References: <1617082235-15923-1-git-send-email-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK2PR04CA0055.apcprd04.prod.outlook.com (2603:1096:202:14::23) 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 HK2PR04CA0055.apcprd04.prod.outlook.com (2603:1096:202:14::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3977.25 via Frontend Transport; Tue, 30 Mar 2021 05:44:50 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 1ca4632f-8812-4b42-5ec3-08d8f33ef166 X-MS-TrafficTypeDiagnostic: DB7PR04MB4489: 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: ejjwuUZsFn4Bdd3TT5EOJvUPb40kC/T0yWAiePDkIEXYiuGWaeOGqQr+cROnh5xv1wFNByQCT8kYSTkeYSZPVVpTcjCBBPCu6uInh57qBW2To0nu5dePg+7GglXiyQRG3/ninKF25kMRWek+tH4XX4dX/siEBZ+nEp5KD9jUpJqvoAO+dMF1yUwkv3UNCYThcq9lmxeoRwufoB9AHEsCbmMOUywLHV+x4hElR8qhYkDbegWVjSG6m1Wyd9DQjCcrazm0K1P3MfWyNncl5ZdLcsl4/lhXcC27FmPszT44+8Uf71yzEqvuPBM1SW0wJaSjaSpjhMHbdf1zrviY+jOi+Zb3dcT7jfLRePh1AdgugIvVy6WUfz8DIphYLeQEGjaXjyREgEGB3Lx7cjS4KYcppgYGhoIFFEwDrRcucmwzqaTafcFLCqsAp6fvZQ5LUnF2Inaxkemh35nIQBFwHFTLeME9QCTKZyGKb2DRShBGAvrKcsVzJHU4IB25K2MEKxB6rDqU/gKijdZJWUG4iUg0lG3JaP2FPWGhEqr/ys8WNY4o+vR4GKuhpg63q7AXcsWMoTR8sTJd6IamDhxpZt+1VETSNPiKf4JPv/5MlT5HUNRFSs6C083InyDxLOAKMax0X6QCJDukKY1WYRRVYeor3HzRt+qzIirgFIRblxIxQb39CEMTkvBuFxhGNztbIFMRrA5SBVFSGwe5A7uuY1saoSTz6kuRNF8okBwwj/edwh/00V1SvJjuKbywhTeGbWNAf1Qd3XkTXCvihJqmCjyIYYVpF/nXFpqbtyTOGlyeECMfwibctbskcIUlRsq6PfyfmwlqwXjC7eKEXT+BC1pzrLgKVKv8SpyKC6OhkL/52LUyFO8qG81kfLtOT1GjH4M7GhtbO3MHAN008vC+XSOCtxVUMaSGLtz9f/Jnj88x2S3OEtH+NLpKZDUEazj/yRTf753DWrax6ymf9BLn5lJ6c14rGqoimAL9I2lsGKjbt3KDkpcO5A1TNlGY1BdmOR6rjS/JntGBxSnkqNHCujeAzg== 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)(39860400002)(396003)(366004)(376002)(346002)(136003)(956004)(2616005)(86362001)(66556008)(2906002)(6666004)(9686003)(6512007)(6486002)(26005)(66476007)(66946007)(8676002)(186003)(69590400012)(478600001)(4326008)(6506007)(5660300002)(38100700001)(316002)(52116002)(8936002)(83380400001)(16526019)(7416002)(161623001);DIR:OUT;SFP:1501; X-MS-Exchange-AntiSpam-MessageData: JvyrgFd5wTkqzCmhZKyg7VDccJC4dTVlegOaWEcxDw9AUg8CXOvNbPTjByGGF3WNGG4Upmb/ktjPrXb96LVR6XVcvWk/wrddQEOp+OPEP5b+p/L2b15VSXHMrKaDwKjavaJbMzhupRzGWiYQve6Q8KwL2gdvyqKtRmeMh6zedi+aBYVosd4MmGIiXppsT/ZD2B0JkPCmIsI1d0wmR5xYOiGTQJOV2boAXlmHMToEk+yCeC7pjn34jMgLV8OYQJHW3Ei/rLkk2Nn0JdWmDoC08bGNJ8h9mgcxc1pOqzY7HkSZ945KRbSz1L4bRX8zY5yo0QlDlLuI5cW5T16L5MbuG7fQZD9xGrMSZ8z1Gm90Anq3qQ7RvXBN8s2gbTtrXt2dBgSwelWujzdOGMNBR4lr/KEveZ8MVUpUlmghjH1vSGcQ01wVP/kLL/adWhpp57vneDr4wX/WL8I1mDQuZhk0dt8mgp3OdOqz/0eF0eqN/x+9/CPiDpAo5IKSEwXbi5wK4Y4zPw+njE4XrTL3TDmyRbEyPDUKhXFc+6eZCtqySvCJYl49wl2QUHSSD9ZwTaj0N4WFeUpKyIg0+PqT67X30ABGe9Ox7By4gJmCUT9LtH8sqGSwNLZJir9n5xewW4HIr3lxmY51yyW/E2R1MOqmaP/Xkf49J0Xz6IdHBY4FYdPChulwTLQxW9xpT+VAj57aGy96OZAgqO/USEJhgm5fTPeFLuSQ0KeSMGKzOY6Z5ZekM+PcWPAZcFVPelUuTIbJPwZQRMTiiEeuvdh8BW4ZtsdJ5CW3lYXHcyiVI8bwh/h0DG1c4cQ0oDXzcqN8+5LEgZ01Bd4osRYk4S2euKRy1WFsBAT4RFXMsCUc3eOyXoEM8DyfsgQheyUwAI/U4kBviFd/9LVhUsoVL+yZ+RQDxRxLrSf6TBQS1lP/Sb6Ldgh4Frnx6sAoz/EujUkWMtj9Z0TDdMqqRfo8+aYA3SRMyeKBZj4N11ZxSjGn2VcJ9VQsDMkpWIbTn/xq8zshSqkI47fyRM3MramdxwggtBRDXxe8LQax9WZUHSHqc7Gm/2vrsXiGheAp/yc+brKKdHDYglZcmDpwnuoss7tY+reV7mZGS8PixAV5EZaueREBSpN4EbFzOR1Z7ASVL6tLpUTxu1Y6a6nUc8Zc91P0xdd+cYkV6FLIaG1cTsUDYkvURkgChMHqYqDtbuRKTEUTNXZx5Q0vrpKWz1KJRrmq+z0WHF96iaipzXPjk2CidRERh+tkZmPMM85qMvbGXwRiSL1co/0W+72UlTjmEA2AGy+9OccvcemIWdP8xC4ZRyATn+/su2OB8nO9zP9Nyg6vB0SMm1eVRLiVfSAgKq1CYdE3fA== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1ca4632f-8812-4b42-5ec3-08d8f33ef166 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Mar 2021 05:44:53.7814 (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: a6Z/ef8BemmkLjxc/2/tAFWPGXU/7QtpdIKpFaFmBQ0zqQZhfrhee6kUK8en01+dIDGfbj53ymCmK4uHiiScEg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4489 Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.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 Tue Mar 30 05:30:34 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: 12171677 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.7 required=3.0 tests=BAYES_00,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 33591C433DB for ; Tue, 30 Mar 2021 05:46:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0BF1661928 for ; Tue, 30 Mar 2021 05:46:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230307AbhC3FpY (ORCPT ); Tue, 30 Mar 2021 01:45:24 -0400 Received: from mail-eopbgr20066.outbound.protection.outlook.com ([40.107.2.66]:43853 "EHLO EUR02-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230306AbhC3FpA (ORCPT ); Tue, 30 Mar 2021 01:45:00 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YUynbfLrawpGuIUXgc3Hq0K5vjkMuljQJDcc6ChX2hhbdMgF+jNrDeS3724rehfk6aksR/aI9OetLsfKHgMzf0Z+j7OtnnJfV9OFvGugSC0axzm5k4KCcQn54EJTGRS9TfmsISEbTGukIqsz0781g5Ll/xVa6wt7DKy3aeGxYVvTQL7Ye6r4XJedNDEnx1hPuQFagtUUI74jyRz6wBoGq6sXowqV3SVo27FZz6dDzGXTdrsyUs5p+O3rSgQLzKPZ/dQqQsseUlBG4BDcC+d66WBfCTMbIvYtjInIBiddeGK39XY03oUiyZHX0nxe96KJen1Cp10qtDCf5f6TnUv46w== 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=ECxKJbXQZTAqXR+HIVdkRJ+rVrMpLrfvCG2naF/TXWA=; b=NgAwnjmuluMcF77sqYmpsLBXyMR0emkFHvnoM06ByBC5sboNpwjxbY7DqY5tucwnoM7OMvAWwzoDl+6w9v0VWCBPP6nPtAJSYLMsyGkK1o+jeDVLf8US7g/3Zvq0CHQjapzhMkvRgRVjSkjCxrlIMHcvdTHm9zZKm33jj0k2uUPuVjmfkydBaFcdeb3Rd92I235RubDTWT6Rr8zlN9ZXyyxthafQaKyfUBstQqhUbt0mLLoGhAVCuePjvsYOk6h67aLZ+9/dudfwHQ6LRzoYsH2Fd9s3DHg/pY2PLQswLWifBmDh8B1I8+oq4Zx7KY5eDOi5bnQFEiB5+XU/QOCNgA== 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=ECxKJbXQZTAqXR+HIVdkRJ+rVrMpLrfvCG2naF/TXWA=; b=BxgVrtV+oM+nZrsqPKe0ISkh6EOideq+kOcVCxOnPAJ2OaVGJD+guTu2100fqJ8DF8wNiCKnzjMD9Fo1nW7r7cK5N8ZjFgA/of+IcL4IhmdsfjepPMmy2Cn8oHeVu5ac9JEleMk+DpAVfMAYJWv+x0hqkafp/469auhFSAdwvyo= 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 DB7PR04MB4489.eurprd04.prod.outlook.com (2603:10a6:5:35::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.25; Tue, 30 Mar 2021 05:44:58 +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.3977.033; Tue, 30 Mar 2021 05:44:58 +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 V2 3/4] remoteproc: imx: move memory parsing to rproc_ops Date: Tue, 30 Mar 2021 13:30:34 +0800 Message-Id: <1617082235-15923-4-git-send-email-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1617082235-15923-1-git-send-email-peng.fan@oss.nxp.com> References: <1617082235-15923-1-git-send-email-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK2PR04CA0055.apcprd04.prod.outlook.com (2603:1096:202:14::23) 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 HK2PR04CA0055.apcprd04.prod.outlook.com (2603:1096:202:14::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3977.25 via Frontend Transport; Tue, 30 Mar 2021 05:44:54 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 8d221769-5f59-4dae-a92f-08d8f33ef3e4 X-MS-TrafficTypeDiagnostic: DB7PR04MB4489: 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: kp8Fq5+MSAsabfgjgEerOkpb7O+5NOKTVSgIr1gcIK1VRtEBOQHP1hL4i+xaG5zvEAQUPe1R8f0+zAf41P2A55sU4siSWdkdMcDsavy9ptozZ37KAZPLyx2V+bi79sXE2gh2kG3kZVafKs95bqOgf6j65M4VbKkbJHS5Ok0vLcKSH0KZQxyaOdnL1FMdXQ645/zuo51KQA5l8SlWOW3FLBI5j42n4lZRkn1PsbM958OAzNOCNm3cJkhYm3NWkX3XbVSRu9A7LWmyRHCHaxf2jj66EOZmnEBe8GccwiQuE5kIYgdDmS4iUJRZgwbCIUvjj8F3UMEBWi58k3ZFdkwcW+TUo/m+C45rYZWagxeA5giGHrpJFoVpkY9tLx2AgjIdXUlQraFjzsHAYsH27vt5XMuR7MtVIsS2J/DbIAJtIGdwwe9dlChIO22uMDLrQp6w1ADz/kmcoiuLmlBMPgbVKLB25puoKE2pqZYJjEeN+67uabFTngoeVdetGyshNMvG3VFnMlM6NqmM82es2HRbXjONUuDdg0zsCW74kwtBU6SW2FzbZ+3lxTZVq+2q3CVa90MwAg58gWOy9GJSN+Os6MZd9OtZWtiB6v66Qwf0dUMDO0Eqnh9kdZozLkHRxe7mlVPjFwbCNJWJkzuEAbFHqM9ePHgS21cMSLLc5y03x1aSL2JMeQTa0h3N6mVvXG1C 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)(39860400002)(396003)(366004)(376002)(346002)(136003)(956004)(2616005)(86362001)(66556008)(2906002)(6666004)(9686003)(6512007)(6486002)(26005)(66476007)(66946007)(8676002)(186003)(69590400012)(478600001)(4326008)(6506007)(5660300002)(38100700001)(316002)(52116002)(8936002)(83380400001)(16526019)(7416002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: bam0A1d/M4m0Hfdn7U8XtMQLCMLV9JcX7i36B2WwWMOqn+5QXeAjLBDrSZJZxrT/T5V7Gc318L7gZ1u5bDygo+c8fCjMBdlGJteTZOQassUaTuuQgdU+HfC87m8AruqQqEqojA0+DR5eCLqblhpmJkN3Xe+WpRh3JH0uJraiFtByUp+hde1mgf0pLJwuJRiVOOZLWI54odf7qZNAl9fWw8tWGeg31kp87tzafofxmBEcB+no5Xfob0rsYWfZVtw27vZn8+LbOWFyUMopDYh+jtyRm7BT3eGJ8z7IBX4jxDLoPDaxaG1+c9AbIruvf4EMcHowJNxLLzqhWRNS7fH9ycv70HaqxfHUEBiS1ARa2ShSvbIceUiPhAtGgKvgUpQDYYmq3NyUj293CkQgkkUGeYB5KRofUkpn7wqCRWG5s5PiLBoauXlmwaEqNwBG+fg5/A9k1H2BITtcW5X2bYxULv3jOyMYzeViM7R4wINtTVK6UfKLrNIOwE0WF3ZcxSjm0BaU/hrqbaVhR2y25xu/ME2zgH4E0sbizZBsGF+t6GRGYjqtzLvUU7YBoofyUnjPgBBFVOSGrV+rwp3IHG8RasLHOBgeJ3pIJmjywNHS5d60JHHJ3MDsqOPdQWfQJ/6oIpw5dLWveY16OWmxRoVlCyGN1/w1KVoGNHhR9I1WLw63hh8+EAZL+ZOQSnlReGqYTOoVtB/q4OEOZ3AlpLdVJhntondGeJkR7XToNaPEbU2znTUCgxNJjmMnqb52NK6QfXcXVHLIaXq8wyfR3IdJE2fXDAr2ROY7zzg+2f+ZcP8gnY7+GWecSOnDJsp+iKd/HoD1ouH24hWNTDlWgBBWjF3mMubx4btRQZ2A0AWwx5V7bX8SKQNLYncs3nRcL6YIs1eAKquMkDceMACmIs4zyBFgmLN+Qgi8Dc2VXRcnDpNSCGndd/Nn4howr298EOlETBrifraxbNS3Jb07SnlHcnO7YsazA/GnmMQ96uhWX1elS/teH7oSxLNKjJ7RkKuPs6O2MYFX2vHC7pxGg5NYjpzS7URapJgYaV52fKWjhwrQZwHTk3b7tv4YkmkNPifcry4fOd1L4EmguCgtkd0/Y8eexcUcakx3gWblMpJcXISociGV10Vw4oJnnT3uNapiwRyrA25pqakHxvu8dfWlKLWfmsldhSrOpCqaWWO8d0uGc5RoSXB72pQPJlJLO2buPbH2IU0MiD7iBaRmrAdfd5BVC3sqPqzVdYHzPBs7V2HMNsq0CsfmA+C6bPCYMUoDVz/mxLTlNlPMc3L07rUu/z2+6SauSuFJVit+v3VCl7F6bA7qZuLMxzW9fWK+E438YYQaxF9ePJGYzsxEo/9y3Q== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8d221769-5f59-4dae-a92f-08d8f33ef3e4 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Mar 2021 05:44:57.9695 (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: tV8urTTh2YJkiqyTs6C9lGi94ELPdk+zvMV2Ed10ufohNl0kSu90pJKhVY3w0NtSrtdyS/m/youaM5GM/7xGJQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4489 Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org From: Peng Fan Use the rproc_ops::prepare() hook for doing memory resources reallocation when reattach an remote procesor. Suggested-by: Mathieu Poirier Signed-off-by: Peng Fan Reviewed-by: Mathieu Poirier --- 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 Tue Mar 30 05:30:35 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: 12171681 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.7 required=3.0 tests=BAYES_00,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 4A379C433C1 for ; Tue, 30 Mar 2021 05:46:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1C81261935 for ; Tue, 30 Mar 2021 05:46:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230344AbhC3Fp2 (ORCPT ); Tue, 30 Mar 2021 01:45:28 -0400 Received: from mail-eopbgr20089.outbound.protection.outlook.com ([40.107.2.89]:59207 "EHLO EUR02-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230339AbhC3FpE (ORCPT ); Tue, 30 Mar 2021 01:45:04 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a4EPv5AkFI7agWhEy8224ZmyN+QauzN+rt2Wb6F8LoM5m56bPnQYT8O6sBL+eCYkGhi9GRX4QRLXZWgTTMXGYQEP4gkVLUt3TYpnZoileg2yTyl/OUzgMi11sihesVvM/pFtexEiOWbLR5CKU5PKLnWheN9AZno8m++aIW5mY+0syMPlGmOQLE9ZjoXztJMbQivwl9UqrHTHVFpO7m4BOHGyFzTi+F60jKNA+X8OyuyV54ZRIBjhg3ZvyjjDyC0Uo6mFNUDPIB25H4kewECR2Q5ODHuIYqF/ABYJz38YKAY90E/ndrANMpKiIlI3XMcU2lAuFgwAjr8eC73hbbIwuQ== 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=yQ/Ce9/BCtNp7zfaw76f0potwJPpbeCzONI2lDH/WoU=; b=Yvcu+X0881qS/wCI05zzVbcovck6eqq/eYv/XHM5mUucuuvuTRY+IemfBOakpyZh2xrv+0jKkZ6MgAIJDBfVAn60ngEjnUGItQjtVC0glI/+42ai/ROxcHyaYAGlS688aAVleF+Se/XDG2wMLNYLRK2E5vVkJrqcYSTLz5pzD0eYgjiddGElHwzGe0y5BJLICnGdGkvTh68KPYFQsuCn0jEbkkh0VBU2vvj09H5wThAgs4KOWrvDnHt2+rQyf5HFR8MiVob9VTNvww9HkDKniSmheWkD4jPvajn8FkkjuZmwxRxMf5HgYU6lxznxutz15qGSXAUUoitF6v6Zycqs+Q== 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=yQ/Ce9/BCtNp7zfaw76f0potwJPpbeCzONI2lDH/WoU=; b=h0MJsiQ8aKMpl8el32rzBVR+nq4P87MgDZ3k/tG5ETIiSR0LBvkkLNz8W8ZwpGH4eCjiOcqSCcKJ52fDUaTHTt6jfK0BxZHce4D5iZEJz76SkIeh2RuIPmWnzRMf9JECJZYzZCecX3KZGW2mVQ2mb+sVG41mUFs/pfuAop1pCP4= 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 DB7PR04MB4489.eurprd04.prod.outlook.com (2603:10a6:5:35::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.25; Tue, 30 Mar 2021 05:45:02 +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.3977.033; Tue, 30 Mar 2021 05:45:01 +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 V2 4/4] remoteproc: imx_rproc: support remote cores booted before Linux Kernel Date: Tue, 30 Mar 2021 13:30:35 +0800 Message-Id: <1617082235-15923-5-git-send-email-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1617082235-15923-1-git-send-email-peng.fan@oss.nxp.com> References: <1617082235-15923-1-git-send-email-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK2PR04CA0055.apcprd04.prod.outlook.com (2603:1096:202:14::23) 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 HK2PR04CA0055.apcprd04.prod.outlook.com (2603:1096:202:14::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3977.25 via Frontend Transport; Tue, 30 Mar 2021 05:44:58 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: f44fd180-980e-4ad0-c9f8-08d8f33ef637 X-MS-TrafficTypeDiagnostic: DB7PR04MB4489: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3044; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /3uIE13ZpzilmPG6637h2u4sHA+KvIUNpJWjWcidn8hQHW+qValx3AZ7xeVRl6nfuTDeI+Np/9Du4cmtPR+4hMZTqtvtziGh1+oBi0rtR8kq/XoX3UsNzGhSS9S0NmJ62pBcn4L4HFwBMygIt/zHXNZkv1SU004W47f2gt79MRpmZ6rRwZroFKhRTS19rb/URsr087rdy/NlEYnLIx0Wi8bztzSl4WQ6TYglh33Z3HhaWTOLAaS3a7Mdqd1OZc89488ch7CB2ticmLzZ7SzAT5TDFa3SYRckQkJM6cSXF/P2ebT1lk/11tebGRJt7qUINtzm7z+uBfGe8LtjD1qDZcIZS1Vw1G927vm4sJjtWvVcwrCfoemO7u0frkyWOHbWKYK0wfcW5QsX7L3i+c7+Tm5vRihvDqpyZhUk+IvHE+JSsTDUYc4uox3LoYpp74CBLtgb72quhovj5nX042rIn/Msz2gcPDliy9bv9qc49Yr54ZXduvfHz3PR3JXSuXbIdWND494/7sY9rKEdJouP4q2cavk8w2InpYAFtdV4+pR9tqzMTMOnpzeHJs8jjjN4RHMACHbyitoAyiQHTuJ7TjRyzzJYy46cmT4JsLmy5cl6wx0puOHj3262vgH8U7QvECo9luNBikztTOckt2vpgQADoUO33b2s362xA96NPniVT4MRSuBEWkEg1otOIant 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)(39860400002)(396003)(366004)(376002)(346002)(136003)(956004)(2616005)(86362001)(66556008)(2906002)(6666004)(9686003)(6512007)(6486002)(26005)(66476007)(66946007)(8676002)(186003)(69590400012)(478600001)(4326008)(6506007)(5660300002)(38100700001)(316002)(52116002)(8936002)(83380400001)(16526019)(7416002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: NEvrRqJLNxPYJ9w598/UMR+7RztHiDGG9PC7Kaodlv6lSnIb9XkAnrM0hC3sufbX7Wqm1hTGsTr8j9PSKXlfwRHgG/ZfbM1AwMF0vVA8bqHpDaL5nLX+kMkOuZCDmYxnHC2KBM0S9JLxifFRCuzZtfGsATlYLkxhkpxE/gdVi8AaFofc6RLRPFdO8Gk4rgTZVTiA7XuNtFV7rS2hjwsJyEfGhsyAsshTF25CS4I5levXCv5g3P+B0LgVUeewaFefkRoCuUeAVnCjabHlorrV3Awm4qHzco0PO16tyxhVGVGJPCOVzkaO4a6gpNJkepxdS8jxXYKkbtppUmX5YVA0VRnna3wiaC6SPMVgmDbenldkbKg5QrRXXj0MFVGrRE93JUpi+MtAmJYlk+s4l8ELXj1tu7Du1k9gDXbXAUQLjW7wnlFTjNhJ7Z8EVIptAgMhFIRRPE22FZSACe9qFPe3/xaX2O1koSkJsi61suvBlixKTsUVdkwwfI+GtoYN/0gITmMVTx47odHaM11RJtYkfJwgv3SxqblMp5Gn521JkTVwuXPSQG/JVTAnIPsIWp7C1oRzTXUH030eOVnmC6F548vTEaALFS6WEIqT8QhSytFwiWXU50LCIPth4IvuNBjYUvJXMnd6mU2LMBPP0XsMFWkXCETXRWwysJBb8tEkjZYuYOxgZ/pKIT7Q1JPnyZlHI1EDD/io3EHNW9xiLzlx4cGv+XreyBrhblWOLXmEXgDQB/2bLwwbkKgdkccOXSG/pKKH0SufEbkM5t8HfqL1lCnDsfYtU4UWec/DfnkzPqUbybEtajaJPNZ3VA4zFVzmS5nfasaBSoNed0MSc/0QvE6yifGduMPBlqUE06ablmkl8zts0fa75LVX1h5YxvACQ4NlcSYT2V2yLne3jtwBRrvkSYqfQal4wTo7bCZUa3EwSQyf8QZ+2PRA8xsDaLOKkZ+U5x/B7XLaj/H8TN0HftcEeJ53fOWBUZ9CMkNfFGRXsT3FK0afMXtUg3ToEqeCkIyoDl79omEmfdQVgW5XRL8BMK7vS/wM9jQBtjWXOZK7WJOZ1KuGP0zVI79jqzXxD5BqGSFUV2we15WTbOYjE3DoQqAcUFEPOjNIZQWswnppwRLRVBTg6ksgoSju1RzG+OkAhK152m1FCaTcP/KyLfwYxSFj1YALc9b1ddF6Pi25fSzoNpiNYvfgeoklW6G8hahH3tKsB3Gx6h6HCtI3U6LGnawZZxAiaY8wfu+ry6ETbkxMon7KOH4P+OnpbbEt3OmbQ+l+gDYZSAvo91fLO6YXJkzuW1+mCi7D02QBtHrMmXfqXJ9CdAy64OBFZHzhYRN607mYe0VbkKi5RqNEPw== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f44fd180-980e-4ad0-c9f8-08d8f33ef637 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Mar 2021 05:45:01.8897 (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: 3/2HgjTCV44zJd98bavPaVmTMyiHXzNNYDFEesadKjCgbg0Jpbvhn7N87omljGMcp+YzOGz32027bQrcaijt9w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4489 Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org From: Peng Fan - Add rsc_table to hold the resource table published by remote cores. - Add attach hook. - Add imx_rproc_get_loaded_rsc_table to get resource table published by remote processors. - Add imx_rproc_detect_mode to detect remote cores' working mode. Signed-off-by: Peng Fan Reviewed-by: Mathieu Poirier --- 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");