From mboxrd@z Thu Jan 1 00:00:00 1970 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=-14.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 97C17C2B9F4 for ; Tue, 22 Jun 2021 09:24:07 +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 5C553611BF for ; Tue, 22 Jun 2021 09:24:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5C553611BF Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=gTanhenlF9bh4DZhrYoauezbG3/MTig+6M1AMwVK42k=; b=itcRsZB9uHB/GD Esi+WSEMahjIAItWBqZgi8MPMNoR4vsex4+P0g/Me0dz4pg2wtqmcdUBNmJutp1+J4h0ocWEPcD9N G1ULBrLwD+3kfCXQ3p4aRhB2cGC9CPj5X9/nLUkftCTAp1RbkTOtovvVvW70c6RpyHj7lG7NXaAoT ihFpjKJItIbPsWPX0N7heOhkiNoaADqvOMrW1lQEDMOptLST1DC1eavExv6eN8mefebGUtdz1LKk5 fmEXrxEmXRtdL3Gepq8UBaO8qLkiBoOzhUNZQLvBiTrHAu1QPHVZEaOKaF8rzPj6sKLo3n+TLLZ4r DCZzABYxdtiEoegTQ6iA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lvcc9-006O2H-B7; Tue, 22 Jun 2021 09:22:37 +0000 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lvcc5-006O1N-5E for linux-arm-kernel@lists.infradead.org; Tue, 22 Jun 2021 09:22:34 +0000 Received: by mail-wr1-x42d.google.com with SMTP id i94so22755680wri.4 for ; Tue, 22 Jun 2021 02:22:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=6VJLwpfX/aFjwt/MygIJ1XfrYdorqygCe7i+QCHuVDk=; b=nS/IsSEloNFNgx0eKkUBfOE0E5w+IN1mYHZeZFh1J9NJa3WRxyZx9rnh5+KFpQIpsn kQsXeSOse1TIb5jFxyLioM5Dbe+vYJ4ADWU5/7qZ/EfE2uJAlD5TiqKRulIUYNPPs5ck cOUZcjgTU4op2Apf5dQMPBFfQQIPheZRcrlNiRjRZ5giQkuc/3OETMQQQaXy5HQTyOyx MZHySG0jN8WKdX/bYw35PcZTz5yUrb8cu6e9qY6PwKHv98aAfE6FS2l4FnmmfmJsbqTr 0Hpe00dJKF7QrUozpA3bVMMnF4QKPHCrGF5Fh/vrX9T4AW2oHgXRMFSUehLsBdw+2/u3 PPjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=6VJLwpfX/aFjwt/MygIJ1XfrYdorqygCe7i+QCHuVDk=; b=EFAMKlQ8yxKNrzfpI0lsnAX3FXC7NwGgx5ginkby4vpq7gWyKMeciuKlJ00KimWdrV Ai4L+TS9Qjnok9ZMKF4u0HZ9CIje2k5uiGvrEmTcXMoBfbKAEoUn3WD+O2T6Hw+zee1a 4Pq35GbKJxw7qWkAW+Dt63SkKkreyr4YRnaSNMjRX7OjMMtvYuEkJWPy5baF+UvPAj4V 4XM2b54WZ3qNfPifOvnGSPxVB4AoJe89lI0gBpCU7o3SxwIzY+xdjOZqrzoMwnOvuezd AFlaqiDqF4uuhJRraZOlIO5jolS0Mb2MuZS1WTbIO66F99AlZWKi5XILByloDXCD8OPe ydIA== X-Gm-Message-State: AOAM531X7fbIxMAhKmvQkJ++kXUEN9LhD43YCGiPowtscb9glVxzjYb6 WNwXa80Nlcv7HbGhXKRam7Cqfg== X-Google-Smtp-Source: ABdhPJw5Ys0vZ5VL8BspxnKvGfYT0n0SNJzBm/f6dky2dNdWOKzgTA75cNI1mC5WfvtbF0JOkgL1PQ== X-Received: by 2002:a5d:698a:: with SMTP id g10mr3396424wru.129.1624353751594; Tue, 22 Jun 2021 02:22:31 -0700 (PDT) Received: from google.com (105.168.195.35.bc.googleusercontent.com. [35.195.168.105]) by smtp.gmail.com with ESMTPSA id n10sm19413600wri.77.2021.06.22.02.22.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Jun 2021 02:22:31 -0700 (PDT) Date: Tue, 22 Jun 2021 09:22:28 +0000 From: Quentin Perret To: Rob Herring Cc: Dong Aisheng , Stephen Boyd , Nicolas Boichat , KarimAllah Ahmed , linux-mm , "linux-kernel@vger.kernel.org" , Dong Aisheng , linux-arm-kernel , devicetree@vger.kernel.org Subject: Re: [PATCH 2/2] of: of_reserved_mem: mark nomap memory instead of removing Message-ID: References: <20210611131153.3731147-1-aisheng.dong@nxp.com> <20210611131153.3731147-2-aisheng.dong@nxp.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210622_022233_262645_CFAB9EDD X-CRM114-Status: GOOD ( 25.23 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Friday 11 Jun 2021 at 11:10:36 (-0600), Rob Herring wrote: > On Fri, Jun 11, 2021 at 7:13 AM Dong Aisheng wrote: > > > > 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 > > Good practice is to Cc the people involved in referenced commits. > Adding them now. This code is a minefield so I'd like other eyes on > it. Apologies for the delayed reply -- was away last week. I've been starring at this for 15 minutes, and still can't see how it could go wrong, so FWIW: Reviewed-by: Quentin Perret Thanks, Quentin > > Signed-off-by: Dong Aisheng > > --- > > 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); > > } > > -- > > 2.25.1 > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel