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 14B55C77B7A for ; Thu, 18 May 2023 20:56:17 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 14EAF85021; Thu, 18 May 2023 22:56:16 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.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=gmail.com header.i=@gmail.com header.b="PIy1K16I"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9F97C862A6; Thu, 18 May 2023 22:56:14 +0200 (CEST) Received: from mail-ua1-x929.google.com (mail-ua1-x929.google.com [IPv6:2607:f8b0:4864:20::929]) (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 9F7C985659 for ; Thu, 18 May 2023 22:56:11 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=mibodhi@gmail.com Received: by mail-ua1-x929.google.com with SMTP id a1e0cc1a2514c-783f88ce548so1392217241.1 for ; Thu, 18 May 2023 13:56:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684443370; x=1687035370; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=+y8PpGSP/lh9xvwyutIZsPAD9Dgi/ZiP3FeY+QPJaxQ=; b=PIy1K16Ii9NWKYbMPZIEo8tCnP9vE2TEgelhzsUKLIF807JjiX71teH4HeUk6XSZfG YBwh7xrs+szd9r6ZRd1ToGCSLnwqUU7h1ln6x18oIa+X5lzrQ0+OEAqBoWtCN8A/k3UB ljEnpJqLq9HBLFTtu56TRC/oWnKUvVjTe0jvn17Yljywj7zl3nvlknFuIv95W13u6o8j GF1TyzoU9zmOorP/zlN0kTMEPZMdhLVOQ7UE61QIHLKoFdzXyHTzLKGMAR80+nKfsB82 7ImFn2Kw1XIkFHqnvYHzzRRrevV5GVotZiCMfVk+6t79WHe4jDYUzQlf6ME9ERp5qyXa Uimw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684443370; x=1687035370; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+y8PpGSP/lh9xvwyutIZsPAD9Dgi/ZiP3FeY+QPJaxQ=; b=O4b+bJ2DoHVC6jqoF609bznXjc08VuA5uhShNSX0sblBgAhj+kLY281/y1ezIh/Nsl n1zHY7ru75QdVDMaI/TzpawKqJq7t+3qPAk7wjUdknc2HA+ry2R4cdOUqpRE70zm8Mry n8W4mUCMLvKsOIU82WfSdd4fEOumDYhzrPhZ7Q2qg34bF/wme+Byl6QWPyJ7xIYmZ+ee vSgX4Q0GGQxEvzZxMWM43PSwo/cJFqDd4Rtqay+pPAk7VrEeDh9sBrBGZX/jjIDZsL+/ fDblX3um22J6vn6OOD9GPmK7u0UlFetsfpyv29qI3z+W6TMeevip7w4JXWEQPBGi1+Qk e5mA== X-Gm-Message-State: AC+VfDzJXnrruaraHSnfIlBbtv94X+KaHtM0jXdVRL2bzE4A0PiZVHJU 83x/Qijb/L77KpoLKzc/SRIGqUiAt99sFKSYJA4= X-Google-Smtp-Source: ACHHUZ66/pnB3c/fJjLMSkr4UZmdXVlgLNW7Inuf/p5dWxOXDWE4w2P4rJ3/jumEZ6ECmrZPStazSOmsxqqeqrx0MLg= X-Received: by 2002:a67:af19:0:b0:437:e4db:48a3 with SMTP id v25-20020a67af19000000b00437e4db48a3mr788951vsl.34.1684443370238; Thu, 18 May 2023 13:56:10 -0700 (PDT) MIME-Version: 1.0 References: <20230507135452.GZ293044@bill-the-cat> <20230507140104.7wuzf7ymdkznxl26@pali> <20230507144044.GA293044@bill-the-cat> <20230507145604.jxlxh42telwibq2o@pali> <20230507164511.GB293044@bill-the-cat> <20230507203616.a7ptbxfzvfqdtikz@pali> <20230516070427.elndxd63jbnat2px@pali> <20230516153620.GH2398826@bill-the-cat> <20230516185223.2vew4jqy36ytfyyc@pali> <20230516185646.GL2398826@bill-the-cat> <20230516223010.fnkjgjyoixwc2ls2@pali> <512f1507-2aaf-34ef-753a-5da3146a5f91@denx.de> In-Reply-To: <512f1507-2aaf-34ef-753a-5da3146a5f91@denx.de> From: Tony Dinh Date: Thu, 18 May 2023 13:55:58 -0700 Message-ID: Subject: Re: mmc: Read eMMC partition access bits before card reset To: Stefan Roese Cc: =?UTF-8?Q?Pali_Roh=C3=A1r?= , Tom Rini , Martin Rowe , U-Boot Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 Hi Stefan, On Wed, May 17, 2023 at 1:26=E2=80=AFAM Stefan Roese wrote: > > Hi Pali, > > On 5/17/23 00:30, Pali Roh=C3=A1r wrote: > > On Tuesday 16 May 2023 14:56:46 Tom Rini wrote: > >> On Tue, May 16, 2023 at 08:52:23PM +0200, Pali Roh=C3=A1r wrote: > >>> On Tuesday 16 May 2023 11:36:20 Tom Rini wrote: > >>>> On Tue, May 16, 2023 at 09:04:27AM +0200, Pali Roh=C3=A1r wrote: > >>>>> On Sunday 07 May 2023 22:36:16 Pali Roh=C3=A1r wrote: > >>>>>> On Sunday 07 May 2023 12:45:11 Tom Rini wrote: > >>>>>>> On Sun, May 07, 2023 at 04:56:04PM +0200, Pali Roh=C3=A1r wrote: > >>>>>>>> On Sunday 07 May 2023 10:40:44 Tom Rini wrote: > >>>>>>>>> On Sun, May 07, 2023 at 04:01:04PM +0200, Pali Roh=C3=A1r wrote= : > >>>>>>>>>> On Sunday 07 May 2023 09:54:52 Tom Rini wrote: > >>>>>>>>>>> On Fri, May 05, 2023 at 09:37:10PM +0200, Pali Roh=C3=A1r wro= te: > >>>>>>>>>>>> On Wednesday 03 May 2023 13:14:56 Tom Rini wrote: > >>>>>>>>>>>>> On Wed, May 03, 2023 at 11:18:39AM +0200, Stefan Roese wrot= e: > >>>>>>>>>>>>> > >>>>>>>>>>>>>> Hi Tom, > >>>>>>>>>>>>>> > >>>>>>>>>>>>>> please pull this next batch of mostly Marvell related patc= hes: > >>>>>>>>>>>>> > >>>>>>>>>>>>> NAK. With commit: > >>>>>>>>>>>>> commit 461fa17970de418a93832f734a595031c0b72128 > >>>>>>>>>>>>> Author: Pali Roh=C3=A1r > >>>>>>>>>>>>> Date: Thu Apr 13 22:57:48 2023 +0200 > >>>>>>>>>>>>> > >>>>>>>>>>>>> mmc: Read eMMC partition access bits before card reset > >>>>>>>>>>>>> > >>>>>>>>>>>>> eMMC specification in section "Access partitions" says= that all reset > >>>>>>>>>>>>> events will restore the access bits in PARTITION_CONFI= G CSD register to > >>>>>>>>>>>>> default User Data Area value (0b000). > >>>>>>>>>>>>> > >>>>>>>>>>>>> So read partition access bits from PARTITION_CONFIG CS= D register before > >>>>>>>>>>>>> issuing card reset. This allows SPL/U-Boot to get info= rmation which eMMC > >>>>>>>>>>>>> partition was in use before SPL/U-Boot was booted. For= some platforms this > >>>>>>>>>>>>> is the way how to determinate boot partition from whic= h BootROM loaded SPL. > >>>>>>>>>>>>> > >>>>>>>>>>>>> Signed-off-by: Pali Roh=C3=A1r > >>>>>>>>>>>>> > >>>>>>>>>>>>> My am335x_evm now fails to boot with: > >>>>>>>>>>>>> > >>>>>>>>>>>>> U-Boot SPL 2023.07-rc1-00021-g461fa17970de (May 03 2023 - 1= 3:10:10 -0400) > >>>>>>>>>>>>> Trying to boot from MMC1 > >>>>>>>>>>>>> omap_hsmmc_send_cmd: timedout waiting on cmd inhibit to cle= ar > >>>>>>>>>>>>> spl: mmc init failed with error: -110 > >>>>>>>>>>>>> SPL: failed to boot from all boot devices > >>>>>>>>>>>>> ### ERROR ### Please RESET the board ### > >>>>>>>>>>>>> > >>>>>>>>>>>>> I can provide more details / test patches as needed. > >>>>>>>>>>>>> > >>>>>>>>>>>>> -- > >>>>>>>>>>>>> Tom > >>>>>>>>>>>> > >>>>>>>>>>>> I do not know what to do with this... The only idea is to hi= de this code > >>>>>>>>>>>> behind CONFIG symbol and enable it only for mvebu. For examp= le by this: > >>>>>>>>>>> > >>>>>>>>>>> Well, maybe the problem is we're trying this on uSD cards? Th= e failure I > >>>>>>>>>>> reported was uSD and not eMMC. > >>>>>>>>>> > >>>>>>>>>> Maybe it is that reason. Problem is that at this stage we do n= ot know if > >>>>>>>>>> card is SD or MMC. > >>>>>>>>>> > >>>>>>>>>> Martin, can you check if booting from SD card is working fine = on mvebu > >>>>>>>>>> clearfog? > >>>>>>>>>> > >>>>>>>>>>> I see a failure with this commit on > >>>>>>>>>>> rpi_3_32b, also from uSD boot. This time it's: > >>>>>>>>>>> Loading Environment from FAT... fsm 0, hsts 00000000 > >>>>>>>>>>> fsm 0, hsts 00000000 > >>>>>>>>>>> ... > >>>>>>>>>>> > >>>>>>>>>>> once in U-Boot itself. Going to the commit prior to the abov= e one and > >>>>>>>>>>> the board is fine again. > >>>>>>>>>>> > >>>>>>>>>>> -- > >>>>>>>>>>> Tom > >>>>>>>>>> > >>>>>>>>>> Immediately after that "problematic code" is card reset functi= on. So > >>>>>>>>>> another reason for failure is that card reset functionality do= es not > >>>>>>>>>> work correctly on your board / platform. > >>>>>>>>> > >>>>>>>>> Well, we're at two different platforms and controllers that thi= s change > >>>>>>>>> breaks things on, so I'm not sure where the fault is exactly. = My > >>>>>>>>> mx6cuboxi is still fine booting from uSD. Another TI platform = from the > >>>>>>>>> same general era as am335x fails the same way (not a surprise),= amlogic > >>>>>>>>> libretech-cc is fine, pine64_plus is fine, and my newer TI plat= forms are > >>>>>>>>> also fine with this. So maybe the Kconfig is fine, but we just= want > >>>>>>>>> default y, default n if ARCH_OMAP2PLUS || ARCH_BCM283X (the TI = platforms > >>>>>>>>> that work are not ARCH_OMAP2PLUS). > >>>>>>>>> > >>>>>>>>> -- > >>>>>>>>> Tom > >>>>>>>> > >>>>>>>> And do you see this problem in SPL or in proper U-Boot? > >>>>>>>> > >>>>>>>> If omap2plus is problematic then I can do tests on Nokia N900 or= at its > >>>>>>>> qemu emulated version (to which can be attached gdb). But Nokia = N900 is > >>>>>>>> without SPL. > >>>>>>> > >>>>>>> > >>>>>>> OK, so on am335x_evm mine is setup so I can X/Y modem boot it bef= ore it > >>>>>>> tries uSD. In this case, full U-Boot also fails: > >>>>>>> Loading Environment from FAT... omap_hsmmc_send_cmd: timedout wai= ting on > >>>>>>> cmd inhibit to clear > >>>>>>> ** Bad device specification mmc 0 ** > >>>>>>> > >>>>>>> Note that N900 in QEMU passes, but I suspect that's a matter of t= he > >>>>>>> emulator not being faithful to some undocumented bug/feature of t= he > >>>>>>> chipset and that it would also fail like this on real HW or that = we > >>>>>>> aren't relying on MMC in such a way that the QEMU tests actually = report > >>>>>>> failure. When I booted the above, it was not a lock-up since we = can > >>>>>>> continue on in this case, rather than failure to load U-Boot itse= lf. > >>>>>>> > >>>>>>> > >>>>>>> -- > >>>>>>> Tom > >>>>>> > >>>>>> Ok, I have tested it on Nokia N900 HW and interesting is that SD c= ard is > >>>>>> also working fine. But its initialization is slower and prints war= ning: > >>>>>> > >>>>>> omap_hsmmc_send_cmd: timeout waiting on cmd inhibit to clear > >>>>> > >>>>> Ok, so what with it? > >>>> > >>>> Seems like this change is a real bad idea to introduce on ARCH_OMAP2= PLUS > >>>> platforms, and probably ARCH_BCM283X too, so rework with a Kconfig > >>>> option that defaults to on except for the above as I suggested? > >>>> > >>>> -- > >>>> Tom > >>> > >>> Ok, patch is on the list... I'm curious if patch stay here on the lis= t > >>> more than one year like some other... > >> > >> I mean, since I asked you to spin a new patch and you posted a patch o= n > >> top of the previously rejected one, someone will need to pick it up an= d > >> fold it together. I don't know how motivated Stefan is to clear out th= e > >> original patch. > >> > >> -- > >> Tom > > > > As I see that most of my patches are completely ignored, I have no > > motivation to do something more in this area. I really would not do > > something which would be also ignored like anything else. > > Hmmm, I don't know what to make of this. Pali, I really appreciate all > your great work in the Marvell / MVEBU area and others as well. Very > important fixes and good improvements indeed. And I pushed many patches > (many hundreds!) from you to mainline in the last years. I'm not aware > of bigger counts of patches from you that are "completely ignored". And > they don't show up in my patchworks list either. So what are these > "completely ignored" patches your are referring to? Pardon me for chiming in unsolicited! I think many PowerPC patches from Pali have been around for quite a long time (I had some interests so I did follow that topic for a while). Probably the problem is that Wolfgang was the maintainer and he had been inactive before passing away, and we don't have a 2nd maintainer or a replacement. All the best, Tony > > Thanks, > Stefan