From patchwork Fri Jun 10 09:59:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin LABBE X-Patchwork-Id: 1641854 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=baylibre-com.20210112.gappssmtp.com header.i=@baylibre-com.20210112.gappssmtp.com header.a=rsa-sha256 header.s=20210112 header.b=cRnq4Q/l; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKGfD0TRkz9s1l for ; Fri, 10 Jun 2022 19:59:45 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8637B843F3; Fri, 10 Jun 2022 11:59:30 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.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=baylibre-com.20210112.gappssmtp.com header.i=@baylibre-com.20210112.gappssmtp.com header.b="cRnq4Q/l"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9C88E843F3; Fri, 10 Jun 2022 11:59:28 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id EB09C843D6 for ; Fri, 10 Jun 2022 11:59:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=clabbe@baylibre.com Received: by mail-wr1-x432.google.com with SMTP id x17so35809926wrg.6 for ; Fri, 10 Jun 2022 02:59:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=date:from:to:subject:message-id:mime-version:content-disposition; bh=cUHkrDcHT4nygR0df3PbWrqe+9O6KD8Yq5JdI+HhfR0=; b=cRnq4Q/l+LK1/bhBbJqwUDy5p0u3h9QK/FO9VyxokmjCgqimkcZ6x5tFMABg1BB545 3lAraMbXx5ykrkoC2sL199XRR7/PnOPe0OvF7T7f7oi4rvq2DI6n7J4A7jLGNSIXp7+v NUI01OTsvd96KNsCmwi7nPdm4MasmKOhLhugYHn6riYjbpLzTLYZdYkzQao0oMhl5bxw Bx+GXjrKAdOYCvJL0oMw6pL+UEfTX+kOm986L6CsA0skNwvo3ss60kWk5q4uLCrf8Efp UrbcRPrbrU+g3StyaSagsC6UXz3vsQuTBS5FxSvoRNUKtp90o505qQ81oP/eqBIz1yf1 haRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition; bh=cUHkrDcHT4nygR0df3PbWrqe+9O6KD8Yq5JdI+HhfR0=; b=r/qntxu/cebdeDy8T+LF5ebm6YGwW+J2G2tToO+LivozM7TrxhVz1BZ+9QM9lt0/eh OPALByZQTqZ7Cl9QSomv+G2sh+meq6l7sZHSVDJM5KswxdBO9cmemV9cN+6QHGg5Q2ub SRXo3Rgo6EC+8IslfyU+f2gheaEb7RbYASgPxFOJ/P1xEW3d4UtlGEX6Rm1dPt79nV7J +ILw7CcPZnGL40uHTfJXabtpPCVdMrJIOcYkQd6K5LUeJaOgi7yEUeVTjRbOTeBw9Qry SspxV6NRxnMcm9EiS2JvhtoY4sGCsQs3OtI9By80pWewys/d7uClPZlM/I+6OUhdZH/w GFKA== X-Gm-Message-State: AOAM5302zhRSxSNWk3+KPbDtCxDDzfzra3RtXKxht6g3mGBaZZFOOimE 8ZSn/5ta6m9kBfBX4M37jo1plw== X-Google-Smtp-Source: ABdhPJwlCYO3lQ2P2zb75G2m+a9fsgwRaZbjWJh2UItRMAIl5p9GzyJO/Xc2k87urCEkq++xHYveHg== X-Received: by 2002:adf:ce03:0:b0:210:32ec:50fd with SMTP id p3-20020adfce03000000b0021032ec50fdmr42900003wrn.407.1654855165393; Fri, 10 Jun 2022 02:59:25 -0700 (PDT) Received: from Red ([2a01:cb1d:3d5:a100:264b:feff:fe03:2806]) by smtp.googlemail.com with ESMTPSA id y6-20020adfee06000000b0021004d7d75asm27576847wrn.84.2022.06.10.02.59.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 02:59:24 -0700 (PDT) Date: Fri, 10 Jun 2022 11:59:23 +0200 From: LABBE Corentin To: yogeshs@ti.com, lokeshvutla@ti.com, sjg@chromium.org, trini@konsulko.com, u-boot@lists.denx.de Subject: Boot regression on am335x-hs-evm Message-ID: MIME-Version: 1.0 Content-Disposition: inline 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 Hello I hit a boot regression on am335x-hs-evm. On current uboot, the board does not boot at all. This board uses both MLO and u-boot.img and only MLO was the problem. After a bisect, I found that e41651fffda7 ("dm: Support parent devices with of-platdata") was the problem. Reverting this patch lead to a success boot. I cutdown the revert to a minimal fix: But errorcount is always 0 which is puzzling me since according to my think, lists_bind_drivers() is ran before secure_boot_verify_image(). Any idea on how to debug further ? Thanks Regards --- a/drivers/core/lists.c +++ b/drivers/core/lists.c @@ -120,6 +120,7 @@ int lists_bind_drivers(struct udevice *parent, bool pre_reloc_only) int ret; ret = bind_drivers_pass(parent, pre_reloc_only); + return ret; if (!ret) break; if (ret != -EAGAIN && !result) I cannot debug further since printf() is not working at this stage. Since I wanted to know which error was badly handled, I tried to do this: --- a/arch/arm/mach-omap2/sec-common.c +++ b/arch/arm/mach-omap2/sec-common.c @@ -111,6 +111,8 @@ static u32 find_sig_start(char *image, size_t size) return 0; } +extern int errorcount; + int secure_boot_verify_image(void **image, size_t *size) { int result = 1; @@ -178,6 +180,7 @@ auth_exit: * via YMODEM. This is done to avoid disturbing the YMODEM serial * protocol transactions. */ + printf("ERRORCOUNT %d\n", errorcount); if (!(IS_ENABLED(CONFIG_SPL_BUILD) && IS_ENABLED(CONFIG_SPL_YMODEM_SUPPORT) && spl_boot_device() == BOOT_DEVICE_UART)) --- a/drivers/core/lists.c +++ b/drivers/core/lists.c @@ -20,6 +20,10 @@ #include #include +static int _errorcount; +int errorlist[1024]; +int errorcount; + struct driver *lists_driver_lookup_name(const char *name) { struct driver *drv = @@ -120,8 +124,9 @@ int lists_bind_drivers(struct udevice *parent, bool pre_reloc_only) int ret; ret = bind_drivers_pass(parent, pre_reloc_only); - if (!ret) - break; + errorlist[_errorcount] = ret; + _errorcount++; + errorcount = _errorcount; if (ret != -EAGAIN && !result) result = ret; }