From mboxrd@z Thu Jan 1 00:00:00 1970 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 C1338C47080 for ; Tue, 5 Apr 2022 09:29:07 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8A21F83AEF; Tue, 5 Apr 2022 11:29:05 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org 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=kernel.org header.i=@kernel.org header.b="Ed0IOtMP"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0392F83B0D; Tue, 5 Apr 2022 11:29:03 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (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 DFD3180291 for ; Tue, 5 Apr 2022 11:28:56 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7C126616C1; Tue, 5 Apr 2022 09:28:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D43D4C385A0; Tue, 5 Apr 2022 09:28:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649150935; bh=JewbIM1doPkdptZ7q8W9V0livumOK11fZglkSo6+ubM=; h=From:To:Cc:Subject:Date:From; b=Ed0IOtMPZ2HurxRXccY2rtfHzOBscf4pvgS0GvX+qZxrA+cjE1mIMOvCxe4K9IXqt JG+qQlUjtNLlgE1MUmXiI0dHczraGKIIEGJCqzEVmSvkQc7yeqEdwz3WrkdGMDGN9K +EGuQk/OpohQ9B1f45mUG5mYXgd1420Kt/QiKo6eKdWcIUpB0hMPwxJEDm+lQSlYdY 3Sap0YPH0zKnDMZeU0L6IJ4TOvTQoysfMQW7WvUR2j47fq1oLJwjm+kDvipYuClqfR FegRV6ZN3EmyXVjHAcHAxoNe/AS9dww/VYGKgHbFKQDMW1Pl63lYinztwoGncFDfWj g31Owh90/VDIA== Received: by pali.im (Postfix) id 3B8DA7B2; Tue, 5 Apr 2022 11:28:52 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Priyanka Jain , Simon Glass , Rick Chen , Andre Przywara , Michal Simek , =?UTF-8?q?Marek=20Beh=C3=BAn?= , Sinan Akman Cc: u-boot@lists.denx.de Subject: [PATCH] SPL: Do not enable SPL_SYS_MALLOC_SIMPLE without SPL_FRAMEWORK by default Date: Tue, 5 Apr 2022 11:28:22 +0200 Message-Id: <20220405092822.20547-1-pali@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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.5 at phobos.denx.de X-Virus-Status: Clean On P2020 board is SPL malloc simple always failing with error and loops: SD boot... alloc space exhausted Bad trap at PC: f8f8b5f0, SR: 21200, vector=d00 NIP: 00000000 XER: 00000000 LR: 00000000 REGS: f8f8b5f0 TRAP: 20000000 DAR: 00000000 MSR: 00021200 EE: 0 PR: 0 FP: 0 ME: 1 IR/DR: 00 GPR00: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 GPR08: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 GPR16: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 GPR24: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 Call backtrace: Exception in kernel pc f8f8b5f0 signal 0 Inspection showed that gd->malloc_limit is zero. And it is because generally SPL_FRAMEWORK initialize SPL's gd->malloc_limit. But when SPL_FRAMEWORK is not enabled then in most cases nobody initialize gd->malloc_limit and so SPL malloc simple does not work. So disable SPL_SYS_MALLOC_SIMPLE by default when SPL_FRAMEWORK is not enabled. SPL_SYS_MALLOC_SIMPLE can be disabled only by setting SPL_SYS_MALLOC_F_LEN to zero. So do it. This change fixes SPL error "alloc space exhausted" on P2020 board. Signed-off-by: Pali Rohár --- Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/Kconfig b/Kconfig index 9dd9ec7f6dfb..c36b375835f0 100644 --- a/Kconfig +++ b/Kconfig @@ -258,6 +258,7 @@ config SYS_MALLOC_LEN config SPL_SYS_MALLOC_F_LEN hex "Size of malloc() pool in SPL" depends on SYS_MALLOC_F && SPL + default 0 if !CONFIG_SPL_FRAMEWORK default 0x2800 if RCAR_GEN3 default SYS_MALLOC_F_LEN help -- 2.20.1