Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4533274pxj; Tue, 22 Jun 2021 02:23:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx7rwmOqvFh6dVr5km8ZL2gdTMkrDujPpXRy8Di9/maJGxWzjicVIIFILsGhdSaoPnbL5xW X-Received: by 2002:a5d:9c59:: with SMTP id 25mr2062512iof.27.1624353803497; Tue, 22 Jun 2021 02:23:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624353803; cv=none; d=google.com; s=arc-20160816; b=C305hdylqFPhD48ZxtUsM4eg76PleIiDJMA/XmnErNDqpPaRm7t58Xn/NmBaQBmwAT V8ALy+s/RnlJgjfEezEGiK7C9pPeoAriygIa4GcROI5HOANkOV9/vYP1/GN0dDd8lr6c /Qm2q1Vbvr7pWfnNOFn7UGa9e+cA99sgroXEN/tKzU4M6YqhEO6pNWgx8j8kNBb34SrR P8isZqvIBczKULFiPizus/h9EeVyileS93gucIhG1jF1CXolUwnbArS2PlSoGUIdPMV8 GxhgX8bsQF34rmPOZDTGBE7vuMyHR92cJfLo3RcOn1qyFzpx5yqlbR2Sv20q0wteOq1z 4tIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=6VJLwpfX/aFjwt/MygIJ1XfrYdorqygCe7i+QCHuVDk=; b=aqD5PoXTMKWqSJtKOPSfqmX7Pd2CN4mGDLSmnGRoVOegQERPUCw/OICHJ+IBW69j2G ipYKsxI71YrnnKRq68lVfsx6ofrdlAy5nIhFcwT/gN0DYZ+dEG6XwwzpKw0U/Lm8FLzm eHnbsioACKUMFKyZC7zS+r3uywRm5g/VLy6I39sJeGTw+M7ynHf4p7XFdcvFVGiYvx9z xD1kjR3CPD3ZsUk1AF3lFYp55Hu/Y/GgFlKHWVyWyL05+PweB+27oCypH9pr/ZAIRyea PMb8GvpwmOCzIsz7v9snB8Am7Tf1EvI86YP2rmOFyh4kUJvoSNzgbBe+55SYMIh3IBIr x1Iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="nS/IsSEl"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s6si14827910iln.106.2021.06.22.02.23.03; Tue, 22 Jun 2021 02:23:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="nS/IsSEl"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229754AbhFVJYt (ORCPT + 99 others); Tue, 22 Jun 2021 05:24:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229490AbhFVJYs (ORCPT ); Tue, 22 Jun 2021 05:24:48 -0400 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14ACFC061574 for ; Tue, 22 Jun 2021 02:22:33 -0700 (PDT) Received: by mail-wr1-x429.google.com with SMTP id d11so20395207wrm.0 for ; Tue, 22 Jun 2021 02:22:33 -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=PICFYrW5aUmdcOOCU3Zj/DdT0zkQE7BOrQWDBqKKGPTNZW6MxrHLxZXQwOJ1QMBj0h yzAoCJtu+bBWWY4OE3wS9QMIDv8ABgYooJGX70ZuoHsPa3TlymVMXslduNxgXqaf4nqw p2mAP58ZIn6LOd37T6LbjhUPy+tqlNYB+LaNk5a8/5C7BGX8ehUci3kz8x1I3G7nFF6X HH4cz3gu61ilCSH9zmvTJ7Znmkgtp0SeeEeTwiG3jb3DrN11el3XChZyE4n3Xk2PGZ+d 8yDHjIkhBvo6ZP1uwCeLFk0oLy/9KErbn6/PvvuwmHHoHsE0BKroH7nVI73iXb7LCxo1 +1Gw== X-Gm-Message-State: AOAM532ROLlA1N0B7hIBE6rJkb0lf20lqudkoDIExKcQhrwUYMvfb3KV erWnfdsmvTmM9DKWJqUq2ICNAg== 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 > >