Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp827104lqa; Sun, 28 Apr 2024 06:10:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXLJHdnXJXY6u/pV6sAy8NXSP7OaOyXYN1dopZiyIVfn1cHgFAKpfSZWA8OqqvjcVawKaVlge3l6CT/o4gTv6x9gjP6zTweqWkMZwSTPA== X-Google-Smtp-Source: AGHT+IEX//TTmF0GeAsVn9V8phePA75ApKccEPibouNpBw8Ld19X7PqNsL/CXPADii/5M87VXumC X-Received: by 2002:a05:6a20:2445:b0:1ac:8824:14b6 with SMTP id t5-20020a056a20244500b001ac882414b6mr9774393pzc.39.1714309839836; Sun, 28 Apr 2024 06:10:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714309839; cv=pass; d=google.com; s=arc-20160816; b=ssZy+S7HQ+tqht8kVs46lgmI1+elxLHJa5X65bD+iMwXzeKYlU67i2zsCeGFCAir9a 6utai2L/je36trAR7QkYiv4VaxC9uGVFxjwINudzxzL5od1BqLBUBFd9z2PpaxDdjCrn Fp6gU8en9B2sL3kD2/0hrKFGCJCKBPPqD9RcRBN8itONkVbGGv33BJ5Qkpv6YyS3Qhec sRjcJ/z1qQ0rPD3iw7G0FOKeUfES23U2OttOhoyHMTH+HJcdmorLX/ksk77SVeTFR9ta PF1cs8wcwTj0zj1gtrJdDWPJXfYmcxz1Tz+0eYynmZdyIRIEsGRHSnzKp6zTW+Vc+ZX0 NZCA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=NhgCnJKPmb4AsGDiMaLDS91P6nngDSMLvYORDn1dWMg=; fh=ekHbtTX60+KwACf/6m0yYv09SZDdkSwnSJhUEoe3US0=; b=B12ILI+sf6IUkSr3EWVH3epYeyC5KmsLI8YXYxOLABlOUTJm9eriE540n3mwoNDrQH bXo9eSfn79awWKU9wMkQ+hhdwNi8m2uO3D2QN5oCssUSu85PnUWU2tCUTmLuxZQh6Gz2 DoStaBotNJCxu6Zbs0EVCbkrNZpyRhseITMOfGCCAqZ8t3LowneR8YIVBXHOdvHvlXNI yTgaQEYowsWVHl8jaKjzXTYdMr6QzvQ/NWSV816uE5MwrBUpI9kKNln6H9RhLaW4gFmx 6QVGseFJn8cwBwl2dsUTT73kLHWd4U5NKhUrkqScsmClKTLXPSf4dGrz++6f5UzFEKMS N7Xg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=md3BQSOT; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-161432-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-161432-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id i8-20020a63cd08000000b005e43a9f911fsi18738240pgg.53.2024.04.28.06.10.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Apr 2024 06:10:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-161432-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=md3BQSOT; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-161432-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-161432-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 72232281B6B for ; Sun, 28 Apr 2024 13:10:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DFAB66CDBA; Sun, 28 Apr 2024 13:10:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="md3BQSOT" Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8519222064; Sun, 28 Apr 2024 13:10:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714309832; cv=none; b=nFK8kWHh6QbKGNkA8TGeSayZo9EXCDnsc6DpNyKV9b2HnG9PNwseFmH3DvsWeXL1Nm+io7dI0rDJzEXtT3kOMxv9WpiJ+mMteN68iV710A5zSis9vo9XyZPbq5WZapdvaHDVMMKeAE2pq0pIbMj9tXz8kwUHCLhIiWDaDZ5O9RI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714309832; c=relaxed/simple; bh=lpiHaZYM8+2Y3uyoOmqD9y7aDSEx9LkyS3ICJpEoe0U=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=aaiDtaOMAoinVS9fe/KRCi/OILnKtHHLPyI2nie8lSbyR00PeVSXbW0AsM+qat3G6cerIfK7kZyP2lt4VxYLid1MWOsSyLCxB6h6GvrZqwaa6CQezEJpk24Suotpx/mEeDSlOF2t1Lr/XGkTZNdhF0Acp0SUZpjvVxZrLrQUO70= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=md3BQSOT; arc=none smtp.client-ip=209.85.128.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-41adf155cffso26701745e9.2; Sun, 28 Apr 2024 06:10:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714309829; x=1714914629; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=NhgCnJKPmb4AsGDiMaLDS91P6nngDSMLvYORDn1dWMg=; b=md3BQSOT/BuhGAqsgYYNRT5/NUfQH+SRm8msLIx0eKf3Yicg9jnJzaAhGu2WeLzx3J rwItg2ee2ZTiFTDNqZlLi9+f3CgRr5S00WZb4FJWp+K14Sd6kT+R5VajGLYlfmHHyYxb SBvPaZ2N3VY6mw++dhl8TGTGSz0OV2AD2mpJGpmtR/mjw+m2r6zRBvRYt1RikE0/Fjtp 6eS3r8Ik1e8bVw6q09jKE9uf+XqtqIArEaoG0XfnjbvaMG9iMcI2uP5L9kIk4ejoyT3h sv74Wl5FR0+L0kqvfayxRiQkB0yzDrNq3Pu/AxzbA2ur3WnevrharB68oUwjrPn+saaH OFNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714309829; x=1714914629; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NhgCnJKPmb4AsGDiMaLDS91P6nngDSMLvYORDn1dWMg=; b=h3Wnzl68GZxTGPhnFV53ZpJNOts4TQISFZyemRQWAk/6i3nb3EmYn30ktJwXFV029U ZaedUfn5IkONhEdZ/M7Uqy/F50sNTFk6nyv6RAn0IPTYScg5KEe3cjgUWLwHcez5xbN+ pRzIsm31iXbIZk5RsqiwuHKwj2+AGHT6wvDO6VynDOTPLysQsH5vmQPiX10ET8XTpJpD 2rnAa5Kcemdk+jCgvS6xUvsCsW4jW7xeM+NRpd7P69V5w9TVxjPWzUx+zlvZl4pziaLF 6i0FDkgBs+4yZU6M3IZLBkOG/dzSgsG+apVEB68KURbF4xWfNBxSrGwI5ql0Z6afBxf5 558g== X-Forwarded-Encrypted: i=1; AJvYcCVD7Qeq1aBQGjfeH0F4bi0ldTU/RLakzZ2kaS9RRGwSFQWTPJe+Hb0C87Gk8SVbR1eIIpOMxNejA6YGOK6ADrVyI5RrlNB63GmBKVlN X-Gm-Message-State: AOJu0YzKtlkyhlKBKlXwOQIUyBYC3AD65HUXeiaKsdBZeqKpD0zHfluR a3DD5gP1bU+cw1ZLEIBhuWp2gkyuxemBgh8Rbgi4keMaMat5DlX9RgdBWdCxo9LW/VqVj4OmLws AgHzB1iDjp7RGC+x4C3g5VTzjYGcZA0FVLfI= X-Received: by 2002:a05:600c:1988:b0:418:f826:58c3 with SMTP id t8-20020a05600c198800b00418f82658c3mr6752323wmq.15.1714309828506; Sun, 28 Apr 2024 06:10:28 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240428125505.434962-1-skseofh@gmail.com> In-Reply-To: <20240428125505.434962-1-skseofh@gmail.com> From: DaeRo Lee Date: Sun, 28 Apr 2024 22:10:17 +0900 Message-ID: Subject: Re: [PATCH] of: of_reserved_mem: clean-up reserved memory with no-map To: robh@kernel.org, saravanak@google.com, rppt@kernel.org Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Daero Lee Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 2024=EB=85=84 4=EC=9B=94 28=EC=9D=BC (=EC=9D=BC) =EC=98=A4=ED=9B=84 9:55, <= skseofh@gmail.com>=EB=8B=98=EC=9D=B4 =EC=9E=91=EC=84=B1: > > 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_add= r_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 =3D 0; if (nomap) { /* * If the memory is already reserved (by another region), w= e @@ -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 =3D memblock_mark_nomap(base, size); + if (err) + return err; } return memblock_reserve(base, size); } Regards, DaeRo Lee