Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1387786lqa; Mon, 29 Apr 2024 07:15:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWC5pkDPWXW86NHH0SRLVm7YVLao0633Vmk9A8jYihh/8wwdfBzaJZSIG22eOoQgJWRP31zARynMIqZ/hUoz9ctz3GY86697qA+aoC74A== X-Google-Smtp-Source: AGHT+IHQ68Xn+Qo+QI9GEKItuDohpmJ7Pd2KN6bQtTsSV5RiE8lsaqZoRLtxpW7CM8+E50ZNDfyi X-Received: by 2002:a17:906:3bcf:b0:a55:5ed2:44d5 with SMTP id v15-20020a1709063bcf00b00a555ed244d5mr7112658ejf.68.1714400152528; Mon, 29 Apr 2024 07:15:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714400152; cv=pass; d=google.com; s=arc-20160816; b=jZ1Yern0Dmsk/sPURW+yVGvB3CUAsk8Yj9EhmXnG2n62NPNkWRlvAFohNNHoDCrbr9 cTPF0x4himAMk574EZyUEk9SHxuO/MUMgT47r2bssR9xnNL0lYTIIf8IJdCvmDJiN4iL DJhkT5n+Nj3wvWnNDCpW3QsDahaV9XG56nhhBsLbpM3BcXBeoXToge8jr2U+qkr3Fxap CSHUoiIUQ9JfP8/Cxgx88eI38c6Agv4slnJQZLfm/KVrojowM6Iluq6s5COcyb7dmldB eU9NLLFnelwUUvODY3uOsyUJ9iMArOodVAUl8dWTXnebSsY3Tsk6B2YKbyqsUh/GXobW Pzpg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=tfOy2mWkE+J6LLqBdZv0frPkTEpQ9bL8rCQxeXxGYZY=; fh=YRi7Qf6q/SsVU28aQIbyVJCjU+7u28DlWsxucfcp9JY=; b=CTvdl59wqU490VtxpflKKXLi+R2jMttuDx16hX4+VYP8faRFzpfXqC/0bb76bQiMQa F0c0v8aN+3PDrxlFY+s+I266GYUjUOEJM3lmBIksu9ivlS7Xm+VB4y/hs2KA53Onk0z5 Mi1DRo8WFHzW1JfIRi9rFNviyr6rO6uis9QNlBUcAPWbxAFluYeROevnNDS7qEbbhjW3 zNaKm32uLk6FochDpYgSMWjNAELMtLJxHLorBDIcCkIQM6DKVZJeg6im9xXPgAhvkgGx IeN8KoMkJ+E1EtDLQYgtPvk/Rpv8WZKXaMOdEMBqYqny4njPAAiIssZhR5tTMsq3RJen uzAg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kO1Lr8JK; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-162429-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162429-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a20-20020a170906369400b00a52178087e5si14584040ejc.471.2024.04.29.07.15.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 07:15:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-162429-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kO1Lr8JK; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-162429-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162429-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 441811F21A9C for ; Mon, 29 Apr 2024 14:15:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B38077BAEC; Mon, 29 Apr 2024 14:15:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="kO1Lr8JK" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D90689468; Mon, 29 Apr 2024 14:15:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714400144; cv=none; b=eq6ycXxmTQVmNc4/zG53d9y/aZ38c0O6b7w0GQa6gltKXtFo6QeXLql3PWfdAqfbX6d8/CH6c9MWbNxoiC7zMmNT07ZB1FNB6lSGMm+hhb/bA5lnt0s/7vmyJUydCenaUsHcdeXR3rcqXWK0bDbv4u2Lb33+wTHrPmlv31ZtYVo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714400144; c=relaxed/simple; bh=vuuOwM7T+XqaDUqJ/gHO8wY+etvNSA1mgu0PlzAtGVI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=BwTVi/1xHJf8XxOiOSjAOwrG05PzwFwbWaCJUiKx+MOxNSXCl/aY31Do8+TTSBuBe5KfeQl46NRdEPeILqGSmiZkxkLDYVImCrszl4bn2ivc9xERjaLGc0oMNsoVQzobNLKuLD5yC/9kUkkXFKol/JIV6fYYGktbXitrhbEvjUY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kO1Lr8JK; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6237FC113CD; Mon, 29 Apr 2024 14:15:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714400144; bh=vuuOwM7T+XqaDUqJ/gHO8wY+etvNSA1mgu0PlzAtGVI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=kO1Lr8JKrRg+1o2So9meps8NArO/1498jgiMl20ww+6yVDH9bfKFg6Z7wywgh/hnd 61zLwEGVgwPzZyEnEJAJs8ERc3Gc2QwdxAdVNQx+55cYWa3LWhFb08dFScSczWIXpQ VSspQb2UVfotl4v4riOsUIwqm0UrUaH1n4iqItMenNN5TrggvXaYMgdAfBKoMmj28f CgmtkvDlVK/7qek5j+h8IeYTUPgCj3uRshSpod4pDb19f33CIu3Z8iV38yIRj4KorF /hdzHNk2ZNKRNkiIGgpXeU8bOeXqX06EpbVW8qvJqiYLaLrd0iCpp7ORt4l0MaW71O 6BVFDvslnQYcQ== Date: Mon, 29 Apr 2024 17:14:21 +0300 From: Mike Rapoport To: DaeRo Lee Cc: robh@kernel.org, saravanak@google.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Daero Lee Subject: Re: [PATCH] of: of_reserved_mem: clean-up reserved memory with no-map Message-ID: References: <20240428125505.434962-1-skseofh@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Sun, Apr 28, 2024 at 10:10:17PM +0900, DaeRo Lee wrote: > 2024년 4월 28일 (일) 오후 9:55, 님이 작성: > > > > From: Daero Lee > > > > In early_init_dt_reserve_memory we only add memory w/o no-map flag to > > memblock.reserved. But we need to add memory w/ no-map flag to > > memblock.reserved, because NOMAP and memblock.reserved are semantically > > different. > > > > Signed-off-by: Daero Lee > > --- > > 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 8236ecae2953..1c916da8adaf 100644 > > --- a/drivers/of/of_reserved_mem.c > > +++ b/drivers/of/of_reserved_mem.c > > @@ -91,7 +91,8 @@ static int __init early_init_dt_reserve_memory(phys_addr_t base, > > memblock_is_region_reserved(base, size)) > > return -EBUSY; > > > > - return memblock_mark_nomap(base, size); > > + if (memblock_mark_nomap(base, size)) > > + return; > Sorry. The return value is wrong. > > Here is what I want to do: > > --- a/drivers/of/of_reserved_mem.c > +++ b/drivers/of/of_reserved_mem.c > @@ -81,6 +81,7 @@ static void __init > fdt_reserved_mem_save_node(unsigned long node, const char *un > static int __init early_init_dt_reserve_memory(phys_addr_t base, > phys_addr_t size, bool nomap) > { > + int err = 0; > if (nomap) { > /* > * If the memory is already reserved (by another region), we > @@ -91,7 +92,10 @@ static int __init > early_init_dt_reserve_memory(phys_addr_t base, > memblock_is_region_reserved(base, size)) > return -EBUSY; > > - return memblock_mark_nomap(base, size); > + > + err = memblock_mark_nomap(base, size); > + if (err) > + return err; > } > return memblock_reserve(base, size); > } Makes sense to me. > Regards, > DaeRo Lee -- Sincerely yours, Mike.