From patchwork Fri Jun 11 13:11:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aisheng Dong X-Patchwork-Id: 12315727 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,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 4D7E6C48BD1 for ; Fri, 11 Jun 2021 13:15:02 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 18DF661078 for ; Fri, 11 Jun 2021 13:15:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 18DF661078 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=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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:In-Reply-To:References: List-Owner; bh=2yVwaGiBVcjiuW9qU7dkGIfkmZLXu9sc2PG7IlkTmxs=; b=Tt5oBPU3tqMDOW lAZsE6zkhkkhM6fVmk17yvWsz6ocPPWfbmCaP26PGHBBo2DIwofaCFmtcrHRGEedY/bOP3OcBs78M Cf6ZNYa0vJimdQxmgi1z57xfAq6jPwaYfqKNjKTkeZJ1cPHFaI0hzZQAOYVl2MWHyRZZAkUw5xsRp WNMD5FpbBb59/WapFB7M07qyKfZOjzNfBl3dNbMYJjNTvxopQqAOKMo1MuFClOMoQHht1DVtnXley tIIHsNGdXFgYT5lNSVEsv4PXhH86ExpI2myGZYCJiQi/Xq9hItpQFsY2M3H56OtD5zEGcsn6guz5h /s3r4WUHM3S6lzt1t7xw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lrgyB-005M6H-7I; Fri, 11 Jun 2021 13:13:07 +0000 Received: from mail-eopbgr60042.outbound.protection.outlook.com ([40.107.6.42] helo=EUR04-DB3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lrgy2-005M43-9X for linux-arm-kernel@lists.infradead.org; Fri, 11 Jun 2021 13:12:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QkcN02KbVYgWapS6jw3MJZu6YgHwxRu1K0lBtzcQSsXFFm6klzNoy1sWdzmRWkhEN8dWEqtLU0eiirpu8bfCp1re063RGyV9Z5f6qkd37eaHshDXE7d2VT+41pNXuXWBXl1FEsL7Qcmf878QcVYzjBwF5FT8s+uxhKFnczD+O6q+A6Tbw/y4pNwwElaVk7R0iDa7tr93PY6kK01hf7g2ddJ5XTLHKqXWsxGFNHwymheDDf9RO15cOZX6OvfDU1TDEHmrVbrzw9YybQJqXQp1WDKLqLUakbl/cxYxKXHhnu37hyOGsX4vCTehX3s8KcqfkHpUQ+qsM75XM6AqQ+nPXw== 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=n2XwapsonnYDvMtrSQFqNohq8Gt+SUQPy/DuLED+/NI=; b=gCAIW26cjBscqSw7BoDKjqB5rch0wpPj2wjpllWhxRke0eNUYg5p2ZPmUEIJnQMXD0mFE+0wXpppqLHV3hCgZ0r24pyX+l7Xsj6Q2kT1PfoouXdmCrpxEq/yd8E5buCCv3Hz44UDlHYX9XaoqzDP7sQjNvaPUeTVFreoak9QJsAToz11SykjgW61HoQEXMt6FbtGAEflOZ75aKcrZ7+1xet8p9t08vXcjYUIfdBdIT0CZY8Ir1Ny5mTg/PDOlcTbN5390kCA1MHgjBKemaD92SVDMtTSEbFEB2tsY8v2cmwBR9/dLI6FkKByvwpDwVzT2eBFGdLsnZPAqvanLlPiEw== 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=n2XwapsonnYDvMtrSQFqNohq8Gt+SUQPy/DuLED+/NI=; b=d/6qYsZn5TPxi0wEH7dY6x9la/a2VJI2HoNmKoMrFFzi+mGIWDejGvRR/HkwhNXlNnD1j1IwiZeQd7nFdkZgyHeA7dpixbrMa1zibBegSoID0Z3hZS2lSproRkm8j6qeWZwndsAIAjY5oHlW/TKZjPAxo74A80ze+XR0rOlIJf0= Authentication-Results: kvack.org; dkim=none (message not signed) header.d=none;kvack.org; dmarc=none action=none header.from=nxp.com; Received: from DB9PR04MB8477.eurprd04.prod.outlook.com (2603:10a6:10:2c3::11) by DU2PR04MB8710.eurprd04.prod.outlook.com (2603:10a6:10:2dd::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.22; Fri, 11 Jun 2021 13:12:55 +0000 Received: from DB9PR04MB8477.eurprd04.prod.outlook.com ([fe80::9daa:ab21:f749:36d2]) by DB9PR04MB8477.eurprd04.prod.outlook.com ([fe80::9daa:ab21:f749:36d2%7]) with mapi id 15.20.4219.023; Fri, 11 Jun 2021 13:12:55 +0000 From: Dong Aisheng To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, dongas86@gmail.com, linux-arm-kernel@lists.infradead.org, Dong Aisheng , Rob Herring , devicetree@vger.kernel.org Subject: [PATCH 1/2] of: of_reserved_mem: only call memblock_free for normal reserved memory Date: Fri, 11 Jun 2021 21:11:52 +0800 Message-Id: <20210611131153.3731147-1-aisheng.dong@nxp.com> X-Mailer: git-send-email 2.25.1 X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: SG2PR04CA0169.apcprd04.prod.outlook.com (2603:1096:4::31) To DB9PR04MB8477.eurprd04.prod.outlook.com (2603:10a6:10:2c3::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.66) by SG2PR04CA0169.apcprd04.prod.outlook.com (2603:1096:4::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.21 via Frontend Transport; Fri, 11 Jun 2021 13:12:53 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 658f50a3-ba07-4f64-b4a4-08d92cdaa04e X-MS-TrafficTypeDiagnostic: DU2PR04MB8710: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2582; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iMCtaXzLHhVjtx3G+HoPU71QkLqrizFhaSzYQjlcVYa/tTd6Jldo1Np2ftj8ANzUm2eV15avo/47zHhNCHEI3RbsDaD9k2I5+XB6dCXJa3eei83wiIv1zJELHrn7rJV68Hykkxzj6+AKjSrazBkClN0FNoz/HWGGQ2Zv5VMpxqI4Q3AcJDlYAQ+/BaMIijoQSQyHd3x1YlOgMOjP7jrIc/IYuyXnvsRLDVtMiCJKTG8UrAlbTm/enOO0tOyneNKnCLXRGY/QpAHG3IAnokN+uW5Mto83rZU6T+EiFA4EyGwlIQhtFaFiV2FTiXctqcefETUKostAqtbRfyYbxtSc/F8uJm9qdazh5xbKByFBeUbWxirQn6WbLvCdHjgFnAjOR7R1tlw9P7Vh6mQbhVWCfTMs0hGLW6BDWNcmjqbEy7eIhcAk3DMaPDzjn0FOV3K78wATmZDRBDlar/ZIK9j21CPvl4M8aLXuLLAI5mkndBvXgVGiuFOL4asDQfAhz2A5A+BmOqQhb+uBqDEVYrzsrbc0gvp2m70YAAc0yCUOcuvLKN88L9DZGG5dnO+HiAIZZHASO+WcUDX7mWk0scvkGVCzB35+P4+3DH5/2Sste/b8G1/j5RQK3vMWL2ubMTLtOeHzfHnPX1zWrJ7KIJC95pYgVHtP7+8yBXkPGfHW5XTabhFOeru73iy/U3gYu/vC X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB9PR04MB8477.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(346002)(366004)(39860400002)(376002)(396003)(6506007)(52116002)(478600001)(186003)(26005)(36756003)(66946007)(66476007)(16526019)(66556008)(6512007)(1076003)(5660300002)(4326008)(956004)(54906003)(2616005)(4744005)(8936002)(2906002)(83380400001)(6486002)(316002)(38100700002)(6916009)(86362001)(8676002)(38350700002)(69590400013); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: RANvs0jRt85TAQ0YlAVRwHRMxN9gkoO6mHavQr6H/q0tMWfp2g+n80Sy4Y9jljedQ2SbFZZZECBdn36IbFOT7JYtcZKG5ErES6SEy4myl9mcMza/kAzoKBO2WjVwRhr4UzRZxx1zI/qqNtj67xtd4u7ZeZDhqf05n+LNPGe5fvq0DCiu5vWh3w6KR3OtpBE/WXE+nUzOV7p1H/WfHW2kwS7Q8vx55vD07t91Uw0h8nmFPFm0FmyotsfshcfqxVwXsquQkvhAKvD+cx/dse3hxxsHOIK5eeFNBh3MgoIidltqzM1FBCubn7OeBZy6ZUk1+aWTuFfqukhDFKwLzAtx0X0bwmkbEpMYVsthRlOnSOjqqJJJtfVQ+kyRhHjQkt4uEugja6pmDamaIDd50IZNuC3NcYCI7AA+Wha8JYGIPF3Caj5+AZy52ZwXRqeASZ7fOAiZbc2bB+G7tvJ48VtDAA26EILLZUn6IKWsK6A6gl0SH9sMv5HZGaO3JE+eBQluLOjCtgro6yWzZcohV+qHvAHNSBsgN5BTgLk9i/nKPybEU1H0edXlVx8gCH5qkzsp3y2nXe79LLL53UHmclMqN+gU0bYTogSE7tHF1cVZcgEJT7aXgXbEqNOUJEw1JgJiTsVm7Q7jmgJaafQubjWjM5t9FQ8wKxBsdZ7yNW84fjHME8wbd4UNMXRCtJvgXUjHdbp93qlIuhyoyEC9EXuBdNfSYezpUVUePeDVkOJTeNz3i1gf1crUPDvbTpSXOSAiIcWf2bgj5eGrhuNctO1OKFSepxOI3ylTrlCHZw05LRpip77sYdut9OHH7tmvjrvPtjKIp3KGA3gU9c4RV0LNuK4oMuCZxFYWnCoaGN51u0peevgTdNAaOwcqz9qcX5I68eqsWhuqZIcUrVq0Ygk+ze2CuhAbD5vxzGHTeo5uUxoOJsNyy/bT1cEAqGie7AEsORZSqBVqTH6BvlaYn+BAbkt9aE9HPQRWO1JETMFhX0JsVb/ZIJP41vplcqHFPdSzvWYigFS5DEegA5YQmrhqovpQKuzPV8OeJfiTuIeIGrYhbwRQc0C7wlpxUbBIXX+QKi43yvuY5MBgSND2QdLFXMfoeps+/eWsVDCT/jgRwvjV5i+cruXAVSNXVqvsv+brp2kXp4LN85tIGVBIU5FI3M1eM4sFDCrjCTeQuH6wog83qUj714CrPcWXNAGenizmU3SENiYvhbB++ohgSOfR5S7jfN7RIlvx1IafjCzyvtu7aOjs1EBLP0/t0DZ2rDiY5xgnHC+kOdYm1O9E9l0bp3EEDkKJgKIEbYOcxLhUSjPpb//ufc2sq94FFyz4M3bp X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 658f50a3-ba07-4f64-b4a4-08d92cdaa04e X-MS-Exchange-CrossTenant-AuthSource: DB9PR04MB8477.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2021 13:12:55.7245 (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: 0kRN4n5C6anEMEZD/CHuTUgW8FicYXqUo6u18RUE9HkMCWGNL/GOXv0nxHj/o22iMzOcfeDqkGN/s01747NLvw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8710 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210611_061258_370572_F62E4930 X-CRM114-Status: GOOD ( 10.76 ) 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 For nomap case, the memory block will be removed by memblock_remove() in early_init_dt_alloc_reserved_memory_arch(). So it's meaningless to call memblock_free() on error path. Cc: Rob Herring Cc: devicetree@vger.kernel.org Signed-off-by: Dong Aisheng --- drivers/of/of_reserved_mem.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c index 4592b71aba5c..367f298a83b2 100644 --- a/drivers/of/of_reserved_mem.c +++ b/drivers/of/of_reserved_mem.c @@ -275,9 +275,10 @@ void __init fdt_init_reserved_mem(void) if (err != 0 && err != -ENOENT) { pr_info("node %s compatible matching fail\n", rmem->name); - memblock_free(rmem->base, rmem->size); if (nomap) memblock_add(rmem->base, rmem->size); + else + memblock_free(rmem->base, rmem->size); } } } From patchwork Fri Jun 11 13:11:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aisheng Dong X-Patchwork-Id: 12315729 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,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 88476C48BE0 for ; Fri, 11 Jun 2021 13:15:24 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 4ED19613E3 for ; Fri, 11 Jun 2021 13:15:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4ED19613E3 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=bombadil.20210309; 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=XrOhE35lTVIU87K0XUeCOsSS/6X1VoBpqmfHqyUJ3fk=; b=fJwCKQGtBcZDZL sM8xI/1nNp/Wr5+sugR/mwpp3Q3kQAXTKBbq3Iws3O+Z2dFiDCPqs47evcITmiZPw53q/IaKKTBtr DXwodb1LvRg1ta/5xgXhj//t9tx0zDklThqUiQz0VNHHXGI4cTxKevMyUAbZa5PBLNoHQVaFPdCJ+ Vca0hyp7W4g+yDFVAKVpYvh/0Eh48eXg5QikBpgNWTvho05NxoTKL5HwiuUMpY0QiukccT3/Vjut5 5irsdxx5sht3UwRMyu+p8Yekm+aoANv6fvQ2TQNEUQA8s/BWAZVzPDkI1PQkrcW4ZsXJr5kJiOmZC 5mGZIvN8fjFAcTgY0HFg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lrgyc-005MJw-MZ; Fri, 11 Jun 2021 13:13:35 +0000 Received: from mail-eopbgr60086.outbound.protection.outlook.com ([40.107.6.86] helo=EUR04-DB3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lrgyD-005M8n-DW for linux-arm-kernel@lists.infradead.org; Fri, 11 Jun 2021 13:13:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Bv7XBeg/1Ynk6H8KoyuWAmiltFauCA2vGWBdql10kfhbcTrQQJrfYNSOPrj5ydjOslcLqd1+8//kF1eJotuWSJ/1sGshGuT6S49IrXfXe1qY64E6rHWsZ5AVcRGQg3B8WVpjMnczqLoDzyLbD1gTOqfwv/tG6HiLrzPyD6MKJQcI2h2B3ECWSbu+ElNMnMFBwcyQbQoGKj4BkKU9iyuoIDxZCLoGt/P6xuyhdGwokNqq9KMhKBJax2YefjCKIpumx7BI9l8OesX1ywFSxlomrBU1xiW5X582vlbHDGgHXKme6avIvithDwLwUxT5nFPKUfGfXYEJAeiz2KgLLVrnXQ== 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=tMpfsIPY2/S7DikLvKZr/U2M6vzvgaE0blbiK6orvdk=; b=gTpPuhd2DE9707nqcKPFqP/x4BVgnVzrYlQmfO/a1aYqJA4BuhgBlSe2AEpKA8sRBJiKhrZWhR+NtyIEguWycdvj46m2GRea9nsBOOhBO+bJyyMLenVZVRnLBehyizTfmK3KrBrluaDVgTlKj4U0ndHjAMi9eCfVDVyzWZBUuS+/3d/JI0NpJQBoox3RpNpV0eCuQeLo8r3nC/zOAcp+Na1rZcOVG4bjkIvtYEvOOEOh0+JXuI7NfykycfI6XQsRahlhWmig23Izou6m49ZDIn/DqPpNX4GE7ZS9TP1ytyZty/go6pyrFFIDQB0IpiEAoIHuk6xw14ftsHSTCL1I7g== 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=tMpfsIPY2/S7DikLvKZr/U2M6vzvgaE0blbiK6orvdk=; b=PIQq3AU3led6g1Eh1uYqfsAOwSBhlP4DWHIv26EEm5JmfMW51tWwSe+/GisZl+LfFudvTVg42FRMxancaNQz6C0Knj1kLilt04kO54cqY2MZqhytFIpgHWHcBuL3gMSPrvR5FYk/6DdopLIUMvrtQzrvYtinor5m0+EUq9Xc7qw= Authentication-Results: kvack.org; dkim=none (message not signed) header.d=none;kvack.org; dmarc=none action=none header.from=nxp.com; Received: from DB9PR04MB8477.eurprd04.prod.outlook.com (2603:10a6:10:2c3::11) by DU2PR04MB8710.eurprd04.prod.outlook.com (2603:10a6:10:2dd::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.22; Fri, 11 Jun 2021 13:12:58 +0000 Received: from DB9PR04MB8477.eurprd04.prod.outlook.com ([fe80::9daa:ab21:f749:36d2]) by DB9PR04MB8477.eurprd04.prod.outlook.com ([fe80::9daa:ab21:f749:36d2%7]) with mapi id 15.20.4219.023; Fri, 11 Jun 2021 13:12:58 +0000 From: Dong Aisheng To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, dongas86@gmail.com, linux-arm-kernel@lists.infradead.org, Dong Aisheng , Rob Herring , devicetree@vger.kernel.org Subject: [PATCH 2/2] of: of_reserved_mem: mark nomap memory instead of removing Date: Fri, 11 Jun 2021 21:11:53 +0800 Message-Id: <20210611131153.3731147-2-aisheng.dong@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210611131153.3731147-1-aisheng.dong@nxp.com> References: <20210611131153.3731147-1-aisheng.dong@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: SG2PR04CA0169.apcprd04.prod.outlook.com (2603:1096:4::31) To DB9PR04MB8477.eurprd04.prod.outlook.com (2603:10a6:10:2c3::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.66) by SG2PR04CA0169.apcprd04.prod.outlook.com (2603:1096:4::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.21 via Frontend Transport; Fri, 11 Jun 2021 13:12:56 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: febd4de1-6ed7-457b-776c-08d92cdaa20a X-MS-TrafficTypeDiagnostic: DU2PR04MB8710: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:565; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tMALSzJPY7CFzcNs6e8GL1SGJt/r2amjvms9Lm8S+SiO9nEu0MSSNctrKQEft/2RT1DVebhdBEJKFhz/EPFFhPV5hfyXU1KUACxVi/nf95hrLo3T08qrxYV9u9iL15ZzUoKixoa6WV9HTDvkOSR1/oNZz8gAn6V3+4eIkGH9Q2qD0ii3f/eIMxmKapYG3enC+XNH1miwv6PK0zrXtbb2WOYXcD8jaSw9vSMHr6eb6rWDNDCt8FzkHd64PbhHleegyI5hH2EDNDTGxinfY0nCaLsyZ/xD9Kl6Tc6vVyx0GHTt6327od2b+AKUfA6kjt/YrTJcm2k4cBhphOCnDWWeKE2vAdhUHvdfzKxIqScSfv5XTCVBt2GDO5ZBMTEji0J9zOFCtAjIQtINe2NcvM1JRI3d/P7QObWI7Crp8tGbrkMxm4A5OCFN68URIclLgjNiyENxrAMtol2WW7/5RJV2Umih2N9+lFGxlCGOnuwKtCLpTWhI/Ak0pdLD38hFd+4yRY7QlINM3Aru9G+0IrdU/SgtpMMwFOdfU4INXFpH/PZWiE3kx1Uyf3uib0VDxsUYALQLTzq/43X1RGweJLN+cmweA6Jumfs55zAtqJ1YE9H4BR7dyJ9X725JKGtp+4eYdZxGhiVYIrwG99PC39RZ+zdJ2fdVKHgZrs3UBE70+qTqfG+K0VkvbCtoI7nCzQ5V X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB9PR04MB8477.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(346002)(366004)(39860400002)(376002)(396003)(6506007)(52116002)(478600001)(186003)(26005)(36756003)(66946007)(66476007)(16526019)(66556008)(6512007)(1076003)(5660300002)(4326008)(956004)(54906003)(2616005)(8936002)(6666004)(2906002)(83380400001)(6486002)(316002)(38100700002)(6916009)(86362001)(8676002)(38350700002)(69590400013); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: iB9nQjq66CSGOoX44UPyjtjYIph086vasE8IE+YniOCHh9Bgu5gCeAfr5dGmmxELYnnOyrPn5CMchTxWs79/DwjnPQYt/oQ7r9IYRYXr5KmYTUiZWx6YaYaS5wFm3sR8xrIz1qVraPod/7ZFBYE+kr4Vv/dfKAY6J/Za5O6E+PfYMtPbT2xXHOu/3kHxlkaQUaPL3bG2AcH7uCCq25ypT4FNYGs9ZSB++3VK6JNKsjpY9m42A7u/C5j3DzsZeHsHLpHt89fJLzmUwEC69yjf3Ya1Yh9/PVdBIz3vu1Fx5trktbakR3R/GhIMMTTPZ/fvVykBgPZIZ30ql+bQjiyE5BN8dKK8p0aQEt9U4C5y3FkUew5zDwU31H/QDXdkcRbj+E6889g4tKrTfCel1k9wljB7PuJdQ48y/4Zkmer979Yd4RaJIojxJg3CYNotK+28JY4VoYeFP1jth6qZ61zPWZ+vC8ZX+EfcXEzXns5k99WlFo+uDSXKnZ14dwRQGM6Bd9eUpJStrSvf/AoQ9coZJ2sEu8A8n/DcCdRBt5G4/sgzk2Utma41+ymwjWfD5h1p7E1MoMmQjsaZn8OAWSo2g+jtiWn9pvITw9o/PYMmDOaGuhNNlPWCXKMAOGYR17k0XHHS9mRqlnXdSV9BEVLqfCgj3q5klfxsgcjesn9arc84XzvHZ3q95wLPhDL/PAhJbg9jkYp2h3UbjwRB1U3GbIuwbr7jV6MesZeQvteSi8hcPviDx9qfxnJu5bpqx92LTN7xLK5shcoPAXXr9yRSgrw5bwOBFX0qkYFEQGhytTebaE/gF4gEd7l//tipCEE8cpKZcXGIXWTpv3LFsdr3ZLhlE6Q3/91CqPQp3Jh0/pqAz1P3q0pRwGn7Hz7Su/lQqExDDsPwIAkE2q94dkFYwbWWkwOSSqzzdXkTPcqn+z3zUwjgazJWRz1wNNjtkAPu5mgDVmeNTGi4O+NDUZSRhUF5LG2nVrYRJEn9lr5WE+dvkk00xdd3revvfAsC+XAbZvPxbE3aP/DbY4j7ZtERKtob5VXdczKPuVvNkQOpExBtA0EsomDE8MeGhMpcyAv8dQnzJLW1EzwwEwOZJp/VatbwZ47NkLXUF/XLzUqUZuSvQZsfkabh52zOU613YPUfFt0yJm9v5umrcYUJAq3O9jkwkwg3Z3lqC7IquNlk/1ED/XjlGqXmdpKqh0/rjKQqzGEJIB6IIETsIo2WYPs2AHBuwp20FzpC/ek1plWeIaun+lRF8UuAhjdrxkVZrsMWwK/TunqmL4sKwTE4dOgO3eItA5QfPd2AGDKBx4DR8AIjNRr7iEOUCJUkRcsCdgdb X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: febd4de1-6ed7-457b-776c-08d92cdaa20a X-MS-Exchange-CrossTenant-AuthSource: DB9PR04MB8477.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2021 13:12:58.6138 (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: hZgWb7KmxWVGK+cAtxQwysuQm7xxWd5sTTQMDYyV2HUXQKXfXRVS6gDXWDAavrkAbwRbCNfN4qRAnNBLYB/+HA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8710 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210611_061309_499395_9AF3F0C3 X-CRM114-Status: GOOD ( 12.96 ) 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 Since commit 86588296acbf ("fdt: Properly handle "no-map" field in the memory region"), nomap memory is changed to call memblock_mark_nomap() instead of memblock_remove(). But it only changed the reserved memory with fixed addr and size case in early_init_dt_reserve_memory_arch(), not including the dynamical allocation by size case in early_init_dt_alloc_reserved_memory_arch(). Cc: Rob Herring Cc: devicetree@vger.kernel.org Signed-off-by: Dong Aisheng Reviewed-by: Quentin Perret --- drivers/of/of_reserved_mem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c index 367f298a83b2..ebba88395bf8 100644 --- a/drivers/of/of_reserved_mem.c +++ b/drivers/of/of_reserved_mem.c @@ -42,7 +42,7 @@ static int __init early_init_dt_alloc_reserved_memory_arch(phys_addr_t size, *res_base = base; if (nomap) - return memblock_remove(base, size); + return memblock_mark_nomap(base, size); return memblock_reserve(base, size); } @@ -276,7 +276,7 @@ void __init fdt_init_reserved_mem(void) pr_info("node %s compatible matching fail\n", rmem->name); if (nomap) - memblock_add(rmem->base, rmem->size); + memblock_clear_nomap(rmem->base, rmem->size); else memblock_free(rmem->base, rmem->size); }