From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) (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 44BAC4CDDD8 for ; Fri, 9 Oct 2026 11:27:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.118.77.12 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791545263; cv=none; b=PO6+389nEewXkYTWCJA761uKk0LnL0Bx1USXtUCdebFCAuknueV/aSSMhlxtfYcvXYHDXgB9s1hFLh1nxcR0hZSiBlJcfnb6g2kBXp3qnolr7i7et0UZHjgmxE6J176dNJlj2u4dbjRBNyBJKh+AVw5osma/QKSHf9wWIQZM+S0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791545263; c=relaxed/simple; bh=NeHpq2sH0N/tD/x3BuchI19QrNvAWROybqMth+/QPvg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:From:In-Reply-To: Content-Type:References; b=hKJISydjmnSDmRGLpbu3SIFygV7L6UqNMJQzw/tHplPWmy240qmicpKtnIr2IWKlG+K0ZPSMKMSrN1GPFUjwbrteQJOp+Rb4qhNXIfMkRLeaR8FLcdpiLvWvAj6zrDAk2vNNafPLYQB/hbGH7bupeatQ4Q2s+YxkB/10l//6lCs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=eh8QHMkE; arc=none smtp.client-ip=210.118.77.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="eh8QHMkE" Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20261009112731euoutp0273974bde7f8cc7403d11c454c16d7c91~c2On1ssPA2319423194euoutp02M for ; Fri, 9 Oct 2026 11:27:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20261009112731euoutp0273974bde7f8cc7403d11c454c16d7c91~c2On1ssPA2319423194euoutp02M DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1791545251; bh=sd29WIiqfdVWcWcizPFVJr9wsS2+jLlXGujHLrFRB5g=; h=Date:Subject:To:Cc:From:In-Reply-To:References:From; b=eh8QHMkEFgU8Sy6/PcFUtjJwUoiVOeRsuISS9DdNDMXzr4/dd5rCvbl1agE354YXu IQa6IB8mokguVKD/BFtqyA2b4KX15ZWKZRXbd53ZoMxMuTrqWf0JOvFFiKPGt8hpG7 bl9LHhiPnQc0C1zED5y0d78Q/oZ6/V/T5JYWBn7Q= Received: from eusmtip2.samsung.com (unknown [203.254.199.222]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20261009112730eucas1p1f516da70272a6482ddd5a6e5c90ba395~c2Onj92gJ0217302173eucas1p1R; Fri, 9 Oct 2026 11:27:30 +0000 (GMT) Received: from [106.210.134.192] (unknown [106.210.134.192]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20261009112729eusmtip2bd8329823fee0d3259af1274218235e5~c2OmuwG6m2544925449eusmtip2N; Fri, 9 Oct 2026 11:27:29 +0000 (GMT) Message-ID: <81d6c6be-d03b-4fa8-be30-1425c4d1ad40@samsung.com> Date: Fri, 9 Oct 2026 13:27:29 +0200 Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Betterbird (Windows) Subject: Re: [PATCH v2 2/2] of: reserved_mem: allocate and map the reserved_mem array early To: Wandun , linux-mm@kvack.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Mike Rapoport , Rob Herring , Saravana Kannan , Oreoluwa Babatunde , Andrew Morton Content-Language: en-US From: Marek Szyprowski In-Reply-To: Content-Transfer-Encoding: 7bit X-CMS-MailID: 20261009112730eucas1p1f516da70272a6482ddd5a6e5c90ba395 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20261008152450eucas1p1d5517eadc2c1d684ff6d4ddc010f6331 X-EPHeader: CA X-CMS-RootMailID: 20261008152450eucas1p1d5517eadc2c1d684ff6d4ddc010f6331 References: <20261008152403.766439-1-m.szyprowski@samsung.com> <20261008152403.766439-3-m.szyprowski@samsung.com> On 09.10.2026 04:16, Wandun wrote: > On 10/8/26 23:24, Marek Szyprowski wrote: >> Get rid of the static, limited-size reserved_mem array and replace it >> with array allocated by memblock_alloc_raw() and accessed through a >> temporary early_memremap() mapping. Such mapping is needed for some >> architectures (like ARM64), where linear map is not yet available during >> early boot scan. Having a single, writeable array with all reserved >> regions removes the need to perform two step initialization introduced >> by commit 8a6e02d0c00e ("of: reserved_mem: Restructure how the reserved >> memory regions are processed"), so all regions can be processed >> directly during the early scan again. > One concern about the ordering here: the new memblock_alloc_raw() for the > reserved_mem array runs *before* the static ("reg") regions are reserved, > so the array can be allocated from inside one of them which makes the > subsequent static region reservation fail. Well, that's what Sashiko already reported. It will be trivial to process 'static' regions before doing the reserved_mem allocation, but this in turn returns us to the point of not being able to handle their reservation failures. I wonder what's worse... Best regards -- Marek Szyprowski, PhD Samsung R&D Institute Poland