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 6E907ECAAA1 for ; Mon, 24 Oct 2022 12:24:04 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9EFCE80A55; Mon, 24 Oct 2022 14:23:19 +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="r4jHaKRO"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4FA77806EB; Mon, 24 Oct 2022 14:22:54 +0200 (CEST) Received: from mail-qv1-xf2b.google.com (mail-qv1-xf2b.google.com [IPv6:2607:f8b0:4864:20::f2b]) (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 4B80080713 for ; Mon, 24 Oct 2022 14:22:51 +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-qv1-xf2b.google.com with SMTP id n18so1029112qvt.11 for ; Mon, 24 Oct 2022 05:22:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; 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=3mN1sl94Mdg7Oh1dPvSpIajc/csDnYyTtIv0asqj+E0=; b=r4jHaKROzwa1AsnvbMpJlA8iTzuLaJHPr/1hjlLN4+V3s3/cFsKCYawBcssIA7Pf1/ NgcfPbHJQQR2wRcPqzYDXQagExYxjBJ6Ubft/kGJ14qfNH4N364XAUxW4k6A70edVC0S bl0ia4Yv0EBrtws+Z8onAlugkHXvWfvPYj8SU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=3mN1sl94Mdg7Oh1dPvSpIajc/csDnYyTtIv0asqj+E0=; b=X54lWAc8dXfClr7EfZKid4+ItXKm2gYtTqPLtZ0zxMqjE+M+3BhlcvHT+tPnsIZ6Wn ImJUJo5Z72D1iLHbsfW/3FaWQtP5p6a3vxuQ0Z3tE5kRNDeIH/LATL6mTK0nq8bHWjsR 03NOYyBKp/ShitxndHOc3q4JzzGtoOT5dl62YI8whEEhcpk7UsopOkWgASRt+2++KVta GwF2FPqXX3/UmVmRTKGBn3hwtbxFNM2VMc+pBS8zg9rKP0mmnsPymFdrkwSWuIgqpIYU B1lFkGKjN8HIZn/6W0GKPuQ8qUGE8D9Te4R+WeA+IEN9WEjPmsUky1eiNLpxGLIdML/m /P2A== X-Gm-Message-State: ACrzQf0s9z5KLrYT2JamHTcXx/xT54a+R1Jt3kAnzPxJHr0w5W3X0HYr qZu2ULxmql7VBmlH7iw6sS5qPw== X-Google-Smtp-Source: AMsMyM5528771uAG0vv6T0XnxBBk+j6Zdm5cML9sfctE1DjmY2Axv8TIn9hkdPobhbb6h1u/hF192A== X-Received: by 2002:a0c:e44d:0:b0:4bb:6814:cacc with SMTP id d13-20020a0ce44d000000b004bb6814caccmr5907157qvm.73.1666614170117; Mon, 24 Oct 2022 05:22:50 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b00-6400-f53f-b0aa-caa3-a9b8.res6.spectrum.com. [2603:6081:7b00:6400:f53f:b0aa:caa3:a9b8]) by smtp.gmail.com with ESMTPSA id n6-20020a05620a294600b006cfc7f9eea0sm15040902qkp.122.2022.10.24.05.22.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Oct 2022 05:22:49 -0700 (PDT) Date: Mon, 24 Oct 2022 08:22:47 -0400 From: Tom Rini To: Mattijs Korpershoek Cc: Sean Anderson , Gary Bisson , Patrick Delaunay , u-boot@lists.denx.de, Simon Glass , Matthias Schiffer , Jaehoon Chung Subject: Re: [PATCH v2] cmd: bcb: select user(0) hwpart in __bcb_load() Message-ID: <20221024122247.GZ2020586@bill-the-cat> References: <20221011-usb-hwpart-v2-0-e10181d4e0e6@baylibre.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="8O6+OvkaFRNbe+uZ" Content-Disposition: inline In-Reply-To: <20221011-usb-hwpart-v2-0-e10181d4e0e6@baylibre.com> 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.6 at phobos.denx.de X-Virus-Status: Clean --8O6+OvkaFRNbe+uZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Oct 13, 2022 at 02:25:59PM +0200, Mattijs Korpershoek wrote: > For some blk operations, it's possible that a different hw partition > gets selected via blk_dselect_hwpart(). > In that case, only the region of the device covered by that partition > is accessible. >=20 > This breaks "bcb load" which attempts to read the gpt and assumes it's > on the user(0) hw partition: >=20 > =3D> bcb load 2 misc > GUID Partition Table Header signature is wrong: 0xDE7B17AD07D9E5D6 !=3D 0= x5452415020494645 > find_valid_gpt: *** ERROR: Invalid GPT *** > GUID Partition Table Header signature is wrong: 0x0 !=3D 0x54524150204946= 45 > find_valid_gpt: *** ERROR: Invalid Backup GPT *** > Error: mmc 2:misc read failed (-2) >=20 > Add a fail-safe in __bcb_load() to ensure we will always read from the > user(0) hwpartition. >=20 > This fixes the following fastboot sequence: >=20 > $ fastboot erase mmc2boot1 # switch to hwpart1 > $ fastboot reboot bootloader # switch to hwpart0, then reads GPT >=20 > Signed-off-by: Mattijs Korpershoek > Reviewed-by: Sean Anderson Applied to u-boot/master, thanks! --=20 Tom --8O6+OvkaFRNbe+uZ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmNWg5cACgkQFHw5/5Y0 tyx8lAv+PYGg+n+4Pz+iv3aYGWJWlmLGmbJfVGnFGPef56Q44O3Agb7jG2t2sH8S sLeDY8+SMC7U0aYR8snQYhHtApOnFIteWqjyltA2T7qNMqybvN2N7W8I4+2GcE/u 98oKwLJwtLSGB0D2uRJZyGEd4oy+YuaUBgkYoR23D7ENsV69/Nyx4+LrwcjV7oZz imStXkBOwAxLOH8fkdFnGwWXcXJMzRZsNf7YlHva3VtfOed0YB8trNY6T9t9QdHD S1gSFxRV2mx4BNELxzQ3QKeeS3+LGjI1J+2sLp5bhuQ5yLYia/qB31avPmVZO7y2 kGxrOf1SgzxgDGNPdQKnGEXkkZGfWvQNyED3GnvVG1YiApshxoCTX3nxjPw0YjpT eXW6vThbLBsaE8kDZ+HbldQi8IgnrnjEfpE1nBCNMBaREzyj48FGcLnGA/sdgcxQ pl06lHRKtvSt/Oi8710/CuCT1af5xFfLtFbDnR3w6D2qrwRKAjENWw1/Ws0Lmlje Skc+HIIN =Tk2A -----END PGP SIGNATURE----- --8O6+OvkaFRNbe+uZ--