From patchwork Thu Jan 21 01:03:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 12034049 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.9 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 C006BC433DB for ; Thu, 21 Jan 2021 01:16:52 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 66EAC23888 for ; Thu, 21 Jan 2021 01:16:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 66EAC23888 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=kFHanEakSdTcrbz0nm9LgnvogecTsIk/Y7h65tYgnDk=; b=iqaWuXXueJ7qav39wXaDovnu1 r6RPEjazoZfjC26xIMK2qV3MnBOXBs2mXj1wVOeUKXlpa/LWE6osyRJrZVG0X2rlPsVuMgWIsMbYD O4+prAR61Dk9avUouJikAPv8A7H8rITV3HJPt0Tmipw0XPw7JNtO0wPaSZ35fLsjqoH1R7kXor56I bsHwfnANmlNhtqnsihTRGOZ9I8evxf9TuQEbGjhtLG2MsYo/O+TVbW9vEFJWmxz5oPXdBrgAsuIDc s6RHHOdX+BTtU7qUa/VuGOCpTvQu+7bRFugKuQkhEyqhCwI4vHVO+LCOpos6JH09WXYqH6o2/kBBC je64d49Xw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l2OZ1-0008IA-T3; Thu, 21 Jan 2021 01:15:07 +0000 Received: from mail-vi1eur05on2075.outbound.protection.outlook.com ([40.107.21.75] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l2OYi-00089u-Fe for linux-arm-kernel@lists.infradead.org; Thu, 21 Jan 2021 01:14:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=neDpiKGO4rGRMFlN2UWxUsqadd99bTb2qg6Ykk341oUUTibgo2gLugEmvpLh2AhK7U2uLgPx23lrBmjsC5pEBSz82LqaAHYIXMg/XwRLtAt2/V9BDjibH2c6qUrTvSaKfTkP+UOoR4E8rel9q955710VnHYVQQr/M7ykiw4rmVLg+7fi5HHf079BaKUf1XXhV/UuqJPGQ67fhmhhCwgZFwL31CQngl+Pm43G0M1d4iIv7vLKgcP9JkO09LXGghjBynPBp+/zni2wpSs7wOguAVXoApdvmpKumsA6WlXu9h4fldKFihXHgh4/w7T5z8iK5qAkH/w0Fo/73ct4TW36nQ== 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=NrM/10lxX+u8ygpoSj3Cn75qK7g8pM1NhQgG/rAaoNk=; b=aTpnFsuNA59iQC1vZOCAxDuxyCuW+ZgcbQ8Pl/VWDsXhsSkdMb9xOCZR8Pzf9YBQ8jwxeFRrMy04+4aanutrxWlDgnKWHOlwV42W6R2gHgiItzysbGrhTrr5ETunC3HcQx8zje/XdeW3gf0woxuNBvvf7F1RuMIFhboXoixvK5FLhdKDvbCT6wrveg0Ioa2Zz8A9rTallIOPveq70QqZFnDxcY8mgEDdgVjjmO743U7gXF4wpeNEuG2gkVhuC99uns/0rM1vQTsD8tjs4empw9kBgfK+RvVO7JfpP2WQvtiGC++ZqTd9kwBwDMS+M+DMfZ5cIMJE42w4Ao+m7P0V9w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NrM/10lxX+u8ygpoSj3Cn75qK7g8pM1NhQgG/rAaoNk=; b=j5LGOjIlFhTkl2xwcFbmkOuUVSdAbGUrzoipuvl+42UP0t8EZIZDbHf6nEuNCmqkrtiqgLT4PGVEiNPQVruw6UPY8sxN2A9dbAlDvf2+T7mBLeKgsNMbkCvf830+w1Ne34WeFcG2P71s2AzYhkrBX/mFcixdkywFOunNbxz+yic= Authentication-Results: wizery.com; dkim=none (message not signed) header.d=none;wizery.com; dmarc=none action=none header.from=nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DBBPR04MB7948.eurprd04.prod.outlook.com (2603:10a6:10:1e6::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3763.11; Thu, 21 Jan 2021 01:14:45 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::c964:9:850a:fc5]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::c964:9:850a:fc5%10]) with mapi id 15.20.3763.014; Thu, 21 Jan 2021 01:14:45 +0000 From: peng.fan@nxp.com To: ohad@wizery.com, bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, o.rempel@pengutronix.de, robh+dt@kernel.org, devicetree@vger.kernel.org Subject: [PATCH V9 06/10] remoteproc: imx_rproc: use devm_ioremap Date: Thu, 21 Jan 2021 09:03:31 +0800 Message-Id: <1611191015-22584-7-git-send-email-peng.fan@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1611191015-22584-1-git-send-email-peng.fan@nxp.com> References: <1611191015-22584-1-git-send-email-peng.fan@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: SGAP274CA0018.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b6::30) 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 SGAP274CA0018.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b6::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3784.12 via Frontend Transport; Thu, 21 Jan 2021 01:14:39 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: b995e028-906b-4362-f1ef-08d8bda9f02b X-MS-TrafficTypeDiagnostic: DBBPR04MB7948: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:849; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KdikDrbC1KaYlYsjxl/nT6YDwHaeqrqeAVkGODSwpg0DlxICMGZDLvBnJipSbsVhmHAhKO5mRmZ9bTmUUmdETFZPE7x5F7cHZ3T/iFjxSTawy/6Dr7AHhuZRdwFuQM1LFyxshKy/hk9ZVJcVyHJIM3WYEJaxeT9DWk5it6iTRyFARqAhGLDKnwmmwa3G4xo7iyPnMVnpKC3ukkXKgv5gSir0vkShCGI34G66Dy5ONDuj4nYfSNyvk82+usOkRmQL/Pc9jX+Ihkm29yPPgl07Eos48WZnSgnjwEq4VsdQILPbdM3+473KJHpLIy/CO2AmOq1Bc8gzPpGMSIBdwEl+01vR074W9spoAP2wv4GLr1ZmR0rthbjotn4LMBu6hCl2V+nzcfdbFa3jbAqGsTEzkDzh11YoDqr0FJvaUuAP8jLgycsPahxbLyF08kusR+sgsYyobAuZoPsM8329YzdFuA== 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)(136003)(39860400002)(396003)(366004)(376002)(346002)(69590400011)(66476007)(186003)(2906002)(6666004)(52116002)(2616005)(4326008)(7416002)(5660300002)(83380400001)(66946007)(26005)(16526019)(956004)(36756003)(316002)(8936002)(9686003)(6506007)(8676002)(478600001)(6486002)(6512007)(86362001)(66556008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: byFOzOn9G12/AeOw6OtM0gN6SOP1WCjBAuSL2WmhS7uoboo/19sHPtonJP6xFN+fu5lgiNOKq/LnnXKPA8wNtXtHVNg4cAn3hOHKntmiqipc6kD/Fc3mFujUXdm5y0+X/O9Z2c2Pr1AANGkYWSI/RrvSPhmKdsjtjW97WMMDD26dXXCHbLiaLfLdKza3qRAodT2bvRqsS3ApBvRrduLvdVQbrJqHmoWRp2Pd2LMAZXud4xHDfkPptUuldpOJtxh1DYXAcYAD2IwpoMrg0V5FHNZq6WOD2q+afYTiltpcw58YUX8s9ijGRtGf/WeyQXvsPUCelh/zjs/lAHMJYYlg0LEITFaBNmVwt7Pez1L0d5ZFP60wWJWwI/adBpvWfOjRU8WgHd+yw1qOD3Sx22hF1bfUn71a6+iQ8aEla29Lg1n/7Ypavj5KrOJ6KvIJja+eIp6dYQhsgGOesKRfMCiRU9ndCNRXrd/B8h69EyUvlBbRTkDGMWfiwr48TKIS+Wu8/iI+j0W+5QXnUbUsTZolGK/UMGNbRMyuPsyKAshOxpww5QK3Ae/p6w64vHcvjLByyrKlbKaMvFdMQqzEfkHN5LHNSVhDhWYfFZq1QqslFC2TSKU9cCYlA+VB713Ou10R/IDvm3vjeO87OIjMuDS1a1KY/Fj4ruLkexw2cU3686t9AtlNwe0Zbk+PHj/ycx7ficreHV6RyyozGenh6qyHewXgMBb04QCwPQugi1wlUtwT+Y9HhUqjTDHAbfH9EU0yAHTAsypdWobttJTgoBDvSCOkFvPk1Wpd0zgIsu0+anGeCH0alTbL2vAV8aGG6Veu50seed1qVTgBK1fXqnKv4DS95yUsv7i/Vu0BT7JHsPVqyx89Xuqs4rx8YTTownYyzLwxRb/gTIy/8NArOoL/lq5tuTnLf83JTi+Z9/MYpCSnXra6StR0avZlV0lbVm74NzwCdLcRIvvpGybdmUqDdy1XlxBr/kiy9TMrycLhVW5lutYFhgm9TJUgsf9EQPo+ X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b995e028-906b-4362-f1ef-08d8bda9f02b X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2021 01:14:45.3637 (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: r7z46wDPxh34JyYZZTJyfAFOuoPAhH++OwjyP6UJuqL4KWQCDVHBAhLdXnBQCeCWvbfjvYhwECpFQ44vpC97IA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7948 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210120_201448_560756_1602DE56 X-CRM114-Status: GOOD ( 13.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peng Fan , shawnguo@kernel.org, s.hauer@pengutronix.de, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, patrice.chotard@st.com, paul@crapouillou.net, agross@kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, matthias.bgg@gmail.com, festevam@gmail.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Peng Fan We might need to map an region multiple times, becaue the region might be shared between remote processors, such i.MX8QM with dual M4 cores. So use devm_ioremap, not devm_ioremap_resource. Reviewed-by: Oleksij Rempel Reviewed-by: Richard Zhu Signed-off-by: Peng Fan Reviewed-by: Mathieu Poirier --- drivers/remoteproc/imx_rproc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 2a093cea4997..47fc1d06be6a 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -296,7 +296,8 @@ static int imx_rproc_addr_init(struct imx_rproc *priv, if (b >= IMX7D_RPROC_MEM_MAX) break; - priv->mem[b].cpu_addr = devm_ioremap_resource(&pdev->dev, &res); + /* Not use resource version, because we might share region */ + priv->mem[b].cpu_addr = devm_ioremap(&pdev->dev, res.start, resource_size(&res)); if (IS_ERR(priv->mem[b].cpu_addr)) { dev_err(dev, "failed to remap %pr\n", &res); err = PTR_ERR(priv->mem[b].cpu_addr);