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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j7ZtERKtob5VXdczKPuVvNkQOpExBtA0EsomDE8MeGhMpcyAv8dQnzJLW1EzwwEwOZJp/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); }