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 79DB7EB64D9 for ; Tue, 4 Jul 2023 15:09:18 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 39E7785F9F; Tue, 4 Jul 2023 17:09:16 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="axcUqWNz"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 564D585E35; Tue, 4 Jul 2023 17:09:15 +0200 (CEST) Received: from mail-yw1-x112c.google.com (mail-yw1-x112c.google.com [IPv6:2607:f8b0:4864:20::112c]) (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 8472085DB6 for ; Tue, 4 Jul 2023 17:09:10 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-yw1-x112c.google.com with SMTP id 00721157ae682-579d5d89b41so43956927b3.2 for ; Tue, 04 Jul 2023 08:09:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; t=1688483349; x=1691075349; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=l9DzbS5VcWcIdS3Q1/KSnSuIRA5lOSInGO8NUKa2Kx8=; b=axcUqWNzKAptJKaGiAPv0Nps9jFQvgFKzZ1pnON+WZyaUbwhIcdKotQgPZdkWXD1o7 LNBpjlLXQ95o9xjcq81/nhz2Gc5t6pyU+OAm83D8a66lcZLdQe+q9a7Sr4lWMtFxSpOK ESBc/RwFQZp7p+z+V13LfHJtBt9VQ3QA80c+0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688483349; x=1691075349; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=l9DzbS5VcWcIdS3Q1/KSnSuIRA5lOSInGO8NUKa2Kx8=; b=MaLN/I7EUibatyznWasdksrtB9Fc/xRRR6jxzhrK5zseCNhyMtpq8gdi0z2mib480i z7h+9UQvTHwqK0fmde/MAixPXyqOlshGyTYXJrWJVvYVEqnYqjPbz2rACJwPFVmstQTE /1IuDRzKRIGsfpdBS18vNMVBXKyInr0qfrJh9bOSIjwlguXsvNbESNbJO7dYyQ5svzkh YNoOkwtMY5fPtvY1qDRfqTe/yobas1mVkt+99cgCkq8cVLfTqR4pvV7ecUXcxrA+5NRr 5m2GW4mbcXp9dc6ZR5V/r/RgBtm7/VpSGtIfHesfk6Dhi1Dxu+Fep7tAV2Ed8+ISyhgK Cd7w== X-Gm-Message-State: ABy/qLb4ksHPkikALc2kR/eiQfPaosn6TWRjoCF+X6cHYfrcZmsuHzxo z1kYuWp5wW7nykxIxK/Eeaw1OQ== X-Google-Smtp-Source: APBJJlG608mnaOR7i8C1tsOl8zRgVfXj+04HNIqqpArsiH9Z2IrUM6PdZFA8GBEUHXoT67T9XlSxGQ== X-Received: by 2002:a81:5210:0:b0:56d:2ad0:cb45 with SMTP id g16-20020a815210000000b0056d2ad0cb45mr13641118ywb.1.1688483349081; Tue, 04 Jul 2023 08:09:09 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b00-6400-14ad-500d-821f-5c7e.res6.spectrum.com. [2603:6081:7b00:6400:14ad:500d:821f:5c7e]) by smtp.gmail.com with ESMTPSA id z4-20020a816504000000b0056d4649670fsm5670093ywb.133.2023.07.04.08.09.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jul 2023 08:09:08 -0700 (PDT) Date: Tue, 4 Jul 2023 11:09:06 -0400 From: Tom Rini To: Fabio Estevam Cc: Francesco Dolcini , Simon Glass , Marek Vasut , u-boot@lists.denx.de, Marcel Ziswiler , Fabio Estevam Subject: Re: v2023.07-rc5 regression: Image overlaps SPL Message-ID: <20230704150906.GG3931582@bill-the-cat> References: <37cfa797-eea6-2f20-16a4-7a44a075d760@denx.de> <20230703200115.GD3931582@bill-the-cat> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="0Lg+4GGvkuXSTOcG" Content-Disposition: inline In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett 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.8 at phobos.denx.de X-Virus-Status: Clean --0Lg+4GGvkuXSTOcG Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jul 04, 2023 at 11:39:59AM -0300, Fabio Estevam wrote: > Hi Francesco, >=20 > On Mon, Jul 3, 2023 at 5:49=E2=80=AFPM Francesco Dolcini wrote: >=20 > > If I do this small partial revert > > > > --- a/arch/arm/dts/imx7d-colibri-eval-v3-u-boot.dtsi > > +++ b/arch/arm/dts/imx7d-colibri-eval-v3-u-boot.dtsi > > @@ -15,7 +15,8 @@ > > pinctrl-0 =3D <&pinctrl_lcdif_dat > > &pinctrl_lcdif_ctrl>; > > display =3D <&display0>; > > - u-boot,dm-pre-reloc; > > + bootph-all; >=20 > I managed to reproduce the behavior on a imx7d-sabresd by doing: >=20 > --- a/board/freescale/mx7dsabresd/mx7dsabresd.c > +++ b/board/freescale/mx7dsabresd/mx7dsabresd.c > @@ -25,6 +25,7 @@ > #include > #include > #include > +#include >=20 > DECLARE_GLOBAL_DATA_PTR; >=20 > @@ -289,6 +290,20 @@ int power_init_board(void) > } > #endif >=20 > +int board_fix_fdt(void *rw_fdt_blob) > +{ > + int ret; > + > + int offset =3D fdt_path_offset(rw_fdt_blob, > "/soc/bus@30800000/usb@30b20000"); > + > + ret =3D fdt_status_disabled(rw_fdt_blob, offset); > + > + printf("******** offset is 0x%x\n", offset); > + printf("******** ret is %d\n", ret); > + > + return 0; > +} > + > int board_late_init(void) >=20 > --- a/configs/mx7dsabresd_defconfig > +++ b/configs/mx7dsabresd_defconfig > @@ -86,3 +86,4 @@ CONFIG_USB_GADGET_PRODUCT_NUM=3D0xa4a5 > CONFIG_CI_UDC=3Dy > CONFIG_USB_GADGET_DOWNLOAD=3Dy > CONFIG_ERRNO_STR=3Dy > +CONFIG_OF_BOARD_FIXUP=3Dy >=20 > With top of tree U-Boot it fails with: >=20 > ******** offset is 0x7ba4 > ******** ret is -3 >=20 > If u-boot.dtsi gets smaller, for example, by reverting 0aea5dda2928 > then it succeeds: >=20 > ******** offset is 0x7988 > ******** ret is 0 >=20 > > fdt_status_disabled() returns 0 again. > > > > With the current master, fdt_status_disabled() returns -3, > > -FDT_ERR_NOSPACE, and I assume I could just change my code to call > > fdt_increase_size() and call it done. > > > > However, what the reason for this different behavior triggered by that > > change in the *-u-boot.dtsi ? Is this expected? > > > > From a quick check multiple place in the code just disable/enable nodes > > or set properties without taking care of this, are those going to be > > affected by that commit that created the regression? Are those all > > buggy? > > > > $ git grep fdt_setprop |wc -l > > 461 > > > > We have some helper around, for example > > arch/arm/mach-imx/imx8/fdt.c:disable_fdt_node(), but this is for example > > just specific on that file. >=20 > Here is my suggestion: let's increase the fdt size locally on your > board for now, just like turris_omnia.c: >=20 > --- a/board/toradex/colibri_imx7/colibri_imx7.c > +++ b/board/toradex/colibri_imx7/colibri_imx7.c > @@ -315,6 +315,15 @@ int board_fix_fdt(void *rw_fdt_blob) > if (is_cpu_type(MXC_CPU_MX7S)) { > int offset =3D fdt_path_offset(rw_fdt_blob, > "/soc/bus@30800000/usb@30b20000"); >=20 > + /* > + * We're either adding status =3D "disabled" property, or changing > + * status =3D "okay" to status =3D "disabled". In both cases we'l= l need more > + * space. Increase the size a little. > + */ > + if (fdt_increase_size(rw_fdt_blob, 32) < 0) { > + printf("Cannot increase FDT size.\n"); > + return -ENOMEM; > + } > return fdt_status_disabled(rw_fdt_blob, offset); > } >=20 > Then for the next cycle, we should plan on adding this > fdt_increase_size() into the common fdt_status_disabled(). I'm a little leary of generic changes here having an unexpected size / performance impact. The API specifically does not "just" handle this case like it does for some others. We should update the docs around fdt_set_node_status and fdt_status_disabled to reference the return codes of fdt_setprop_string itself and check for anyone else that hasn't been considering this possible failure case. --=20 Tom --0Lg+4GGvkuXSTOcG Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmSkNgwACgkQFHw5/5Y0 tywE+AwAnj6VNj0PWbHOaAmxO2gsCQGrV2BSNgsR+IVUvoXS00kSBV/Png4QU8no hbFGHzUjKzSNv7mnukIgexsOPQ2GHomba5mRmlu0Wh4+FHQGU2CH74vECNsw8o2H uuP0AXyLoVCgvAlhfI8j1Kq8tfEbzFtr+2tVe1HgQmvCLLrqUUG6cda09u9Z9pXz dXmHg/PwvVbB0Tm72tPQvP8fKbmWZUG7YYcDP9g96dUVnLNCKjNBnfd4ufxdHS9h tFP/A5n/fbUznbpgdN2cgbt/WZgggMjDgrSzI9nr5xK1sU0b2F90EXof2Qwuycvo vobqlyfeChvdTbAmOjHk1y+704vhDTBBd6N30ajoA9kViWfaSo9uyvJy0pXXY1pJ xJ27VfGcsk38QmP/x0VLE9N7b3BZevjeiwBvAEVXCKzA4YUTaZuRk32NscGs6zNk lGyPruRbYi4+UmIak7BJVhgiGKi7oePlMNkvabChQU1ixApmBrHwVfa59aYMuc+D 3SmJ7Ze7 =a4Gn -----END PGP SIGNATURE----- --0Lg+4GGvkuXSTOcG--