Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 224F6C636D6 for ; Thu, 23 Feb 2023 10:01:25 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7B78085AD6; Thu, 23 Feb 2023 11:01:21 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=foss.st.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=foss.st.com header.i=@foss.st.com header.b="ZL2egGPk"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 274B085AD6; Thu, 23 Feb 2023 11:01:19 +0100 (CET) Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id DBAA885AD6 for ; Thu, 23 Feb 2023 11:01:15 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=foss.st.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=prvs=041805acfd=patrick.delaunay@foss.st.com Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 31N9IYTg025230 for ; Thu, 23 Feb 2023 11:01:15 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=message-id : date : mime-version : subject : to : references : from : in-reply-to : content-type : content-transfer-encoding; s=selector1; bh=q/IBgWuowr5RyEKqEvUqkDsmI0Rii+klGj4e77ENJKU=; b=ZL2egGPkYHY7WskjxpT3hAiBCy2Tp6P9pL4P/nprDhygTfpMw/SHB8uDdDqLP2pwHdMG GhCDLueyezfkuhSanfkST12wNTawDPgRYrtkFcNpLtGoNkY2mHMhQGkR1xWXgNsGlUQb J2yFsiO3cQAy6QCnoxfs77A9VNeJv1xKSY66PK3FMoDUXe820Bwop83cNR0Y7W+YYcix hdgyReWRnsi1xixBxNrKOGO1FvguC07ebdPqYyHBnQ61QOumFrDxgNidDhBuh/xpztKy eagBDg/PdAtWGr+gj/wxyXTwuIM7+KLZNrMsg9PaF+VioKR9+cIf48dxKNav+togtGdR WQ== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3nwyb8teku-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 23 Feb 2023 11:01:15 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 721AD10002A for ; Thu, 23 Feb 2023 11:01:14 +0100 (CET) Received: from Webmail-eu.st.com (shfdag1node3.st.com [10.75.129.71]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 5D705212303 for ; Thu, 23 Feb 2023 11:01:14 +0100 (CET) Received: from [10.48.0.157] (10.48.0.157) by SHFDAG1NODE3.st.com (10.75.129.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Thu, 23 Feb 2023 11:01:13 +0100 Message-ID: Date: Thu, 23 Feb 2023 11:01:12 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH] lmb: Default to not-LMB_USE_MAX_REGIONS Content-Language: en-US To: References: <20230125230823.1567778-1-trini@konsulko.com> <32b441a41602eda85b65682d60354141fbc9c5d8.camel@toradex.com> <7077d0d45bb5e7d0e805cd2c360135b687ef56b0.camel@toradex.com> From: Patrick DELAUNAY In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.48.0.157] X-ClientProxiedBy: SHFCAS1NODE1.st.com (10.75.129.72) To SHFDAG1NODE3.st.com (10.75.129.71) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.170.22 definitions=2023-02-23_06,2023-02-22_02,2023-02-09_01 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean On 2/8/23 16:16, Tom Rini wrote: > On Wed, Feb 08, 2023 at 03:13:31PM +0000, Philippe Schenker wrote: >> On Wed, 2023-02-08 at 09:54 -0500, Tom Rini wrote: >>> On Wed, Feb 08, 2023 at 02:33:58PM +0000, Philippe Schenker wrote: >>> >>>> Hi Tom, >>>> >>>> We currently face an issue on our apalis-imx8 machine, that is not >>>> able >>>> to boot with a ramdisk. What happens is that there are all 8 of 8 >>>> LMBs >>>> reserved and fdt tries to allocate one more, probably for >>>> relocation. >>>> >>>> I now stumbled on this recent patch and noticed that in my >>>> understanding >>>> this is introducing a regression to all the boards you remove >>>> `CONFIG_LMB_MAX_REGIONS=64` isn't it? Or do I miss something? >>>> >>>> For the other question this raises to me is it in general safe to >>>> just >>>> increase this limit, let's say to 16? >>>> >>>> And since it was quite an effort debugging this issue I thought of >>>> adding a debug print if the MAX cnt in lmb.c is being hit to ease >>>> that >>>> pain for other devs, would you be fine with something like this? >>> Right, so with the late in the cycle change to make EFI use LMBs as >>> well, a lot of platforms hit the 8 of 8 LMBs now in use problem. The >>> change here switches from a static allocation of a maximum number of >>> LMBs to dynamically allocating as many of them as needed. >> >> But since you no longer enable LMB_USE_MAX_REGIONS then theres the two >> limits (default=8) >> >> LMB_MEMORY_REGIONS=8 >> LMB_RESERVED_REGIONS=8 >> >> that are limiting the maximum LMB numbers. So in my view this commit >> does create a regression for all boards you delete >> `CONFIG_LMB_MAX_REGIONS=64`. >> >> At least for me rgn->max is still set to 8 and also after this commit I >> hit that limit. [1] >> >> [1] https://source.denx.de/u-boot/u-boot/-/blob/master/lib/lmb.c#L288 > Ugh, you're right and I missed what this ended up doing, thanks for > explaining it. I'll go revert my commit shortly and pick up one of the > ones that raised the default. Hi, only for reference, with new LMB management config LMB_USE_MAX_REGIONS bool "Use a common number of memory and reserved regions in lmb lib" depends on LMB - default y The correct patch without regression is for each board -CONFIG_LMB_MAX_REGIONS=64 +CONFIG_LMB_RESERVED_REGIONS=64 See https://lore.kernel.org/all/20210310091632.17103-1-patrick.delaunay@foss.st.com/ Patrick