All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Pali Rohár" <pali@kernel.org>
To: u-boot@lists.denx.de
Subject: Bisected: omap_hsmmc 3.3V IO voltage incompatible with N900 (Was: Re: Bisected: mmc cause reboot loops on N900)
Date: Wed, 1 Jul 2020 10:32:09 +0200	[thread overview]
Message-ID: <20200701083209.pzjr7edgvanfwkz2@pali> (raw)
In-Reply-To: <20200612130306.5qjfonf2kfkaervv@pali>

On Friday 12 June 2020 15:03:06 Pali Roh?r wrote:
> On Tuesday 26 May 2020 19:49:54 Pali Roh?r wrote:
> > On Thursday 07 May 2020 17:19:38 Pali Roh?r wrote:
> > > On Thursday 07 May 2020 19:10:14 Faiz Abbas wrote:
> > > > On 26/04/20 3:59 am, Pali Roh?r wrote:
> > > > > On Sunday 26 April 2020 00:20:07 Pali Roh?r wrote:
> > > > >> On Saturday 25 April 2020 23:26:15 Pali Roh?r wrote:
> > > > >>> Now I tried git bisect and here is problematic commit which caused whole
> > > > >>> reboot loop:
> > > > >>>
> > > > >>> 04a2ea248f58b3b6216d0cd0a6b8698df8b14355 is the first bad commit
> > > > >>> commit 04a2ea248f58b3b6216d0cd0a6b8698df8b14355
> > > > >>> Author: Jean-Jacques Hiblot <jjhiblot@ti.com>
> > > > >>> Date:   Thu Sep 21 16:30:08 2017 +0200
> > > > >>>
> > > > >>>     mmc: disable UHS modes if Vcc cannot be switched on and off
> > > > >>>     
> > > > >>>     If a power cycle cannot be done on Vcc, it is safer not to try the UHS
> > > > >>>     modes because we wouldn't be able to recover from an error occurring
> > > > >>>     during the UHS initialization.
> > > > >>>     
> > > > >>>     Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
> > > > >>>
> > > > >>> :040000 040000 04de51428c8311a4b2fb3ad876ac3f6071ab57ee ea7a7959a4bd591c92a2c3d413d5643a8457d2ff M      drivers
> > > > >>> :040000 040000 03f639baf2a2f55003cb750981fd8accc5b4a993 fbcb9607d37959f0b5240f5d727133f58cc35379 M      include
> > > > >>>
> > > > >>> It changes only core mmc code, nothing platform / board specific.
> > > > >>> U-Boot compiled from commit before above has fully working eMMC access
> > > > >>> on real Nokia N900. I can read files on FAT eMMC partition without any
> > > > >>> problem.
> > > > >>>
> > > > >>> I'm not sure what is happening here, but it looks like that omap hs mmc
> > > > >>> driver used on Nokia N900 is maybe not correctly hooked for UHS support.
> > > > >>>
> > > > >>> The most suspicious it that this problem cannot be reproduced in qemu
> > > > >>> n900 emulator. It happens only on real N900 hw.
> > > > >>
> > > > >> I took main change from above commit, reverted it on master and U-Boot
> > > > >> stopped crashing! No reboot loop anymore. Here is change which fixes
> > > > >> reboot loop on Nokia N900:
> > > > >>
> > > > >> diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
> > > > >> index 523c055967..d07c7745da 100644
> > > > >> --- a/drivers/mmc/mmc.c
> > > > >> +++ b/drivers/mmc/mmc.c
> > > > >> @@ -2786,18 +2786,7 @@ int mmc_get_op_cond(struct mmc *mmc)
> > > > >>  		      MMC_QUIRK_RETRY_APP_CMD;
> > > > >>  #endif
> > > > >>  
> > > > >> -	err = mmc_power_cycle(mmc);
> > > > >> -	if (err) {
> > > > >> -		/*
> > > > >> -		 * if power cycling is not supported, we should not try
> > > > >> -		 * to use the UHS modes, because we wouldn't be able to
> > > > >> -		 * recover from an error during the UHS initialization.
> > > > >> -		 */
> > > > >> -		pr_debug("Unable to do a full power cycle. Disabling the UHS modes for safety\n");
> > > > >> -		uhs_en = false;
> > > > >> -		mmc->host_caps &= ~UHS_CAPS;
> > > > >> -		err = mmc_power_on(mmc);
> > > > >> -	}
> > > > >> +	err = mmc_power_on(mmc);
> > > > >>  	if (err)
> > > > >>  		return err;
> > > > >>  
> > > > >>
> > > > >> Jean, do you have any idea what is happening in above code? It looks
> > > > >> like something is broken in power cycle / power on sequence if it cause
> > > > >> "data abort" and reboot of board.
> > > > >>
> > > > >>
> > > > >> But even with above my change eMMC on N900 cannot be initialized...
> > > > >> I'm running second git bisect with applying above change on every
> > > > >> commit. It is in progress now.
> > > > > 
> > > > > And second bisect finished. Result is:
> > > > > 
> > > > > d2c05f50e12f87128597a28146de7092aaa847c3 is the first bad commit
> > > > > commit d2c05f50e12f87128597a28146de7092aaa847c3
> > > > > Author: Faiz Abbas <faiz_abbas@ti.com>
> > > > > Date:   Fri Apr 5 14:18:46 2019 +0530
> > > > > 
> > > > >     mmc: omap_hsmmc: Set 3.3V for IO voltage
> > > > >     
> > > > >     Pbias voltage should match the IO voltage set for the SD card. With the
> > > > >     latest pbias change to 3.3V, update the capabilities and IO voltages
> > > > >     settings to 3.3V.
> > > > >     
> > > > >     Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
> > > > > 
> > > > > :040000 040000 819148217b64a6beaf8247464de6b4384d4581a4 e4fd9288ddb794f33596339813d5386f3bed8fd7 M      drivers
> > > > > 
> > > > > I revered above commit on top of master and eMMC on Nokia N900 finally
> > > > > started working again!
> > > > > 
> > > > > Faiz, what is the reason for above commit? It basically changes in omap
> > > > > hs mmc driver IO voltage from 3.0V to 3.3V. And seems this change is
> > > > > incompatible with Nokia N900. Are there any problems with 3.0V on some
> > > > > omap3 boards? If not I would vote for revering that commit. Or at least
> > > > > making IO voltage configurable.
> > > > > 
> > > > 
> > > > For the power_cycle patch, it looks like there is a null pointer dereference
> > > > that might be causing the reboot loops (probably because your platform doesn't
> > > > have DM_MMC enabled) Can you add a few more prints to see where the data abort
> > > > comes from exactly?
> > > 
> > > Hello Faiz!
> > > 
> > > Sorry, but this is problematic. Because of reboot loops I cannot read
> > > what exactly is put on the display and reboot cause clearing display.
> > > 
> > > Month ago I was able to detect that problem is somewhere in function
> > > mmc_set_ios() from mmc.c file. I put long debug line prior and also
> > > after mmc_set_ios() call. And it was printed only prior. Not after.
> > > So I think NULL pointer dereference is in mmc_set_ios() function.
> > > 
> > > > For the second patch IO voltage patch, what exactly do you see without reverting it?
> > > > Are you able to reach prompt but mmc commands fail?
> > > 
> > > Yes, after reverting 04a2ea248f58b3b6216d0cd0a6b8698df8b14355 there is
> > > no reboot loop anymore. Just mmc commands fail and eMMC is not detected
> > > at all.
> > > 
> > > > Its possible that your platform requires a pbias of 3.0V to work.
> > 
> > Hello Faiz!
> > 
> > Now I figured out what is the root cause of second 3.0V vs 3.3V problem.
> > 
> > In commit d2c05f50e12f87128597a28146de7092aaa847c3 you forgot to replace
> > one usage of 3.0V by 3.3V. Below is patch which changes also this last
> > one usage. Applying it has same effect on Nokia N900 as reverting
> > that problematic commit d2c05f50e12f87128597a28146de7092aaa847c3:
> > 
> > diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c
> > index 8636cd713a..dc26e54795 100644
> > --- a/drivers/mmc/omap_hsmmc.c
> > +++ b/drivers/mmc/omap_hsmmc.c
> > @@ -840,7 +840,7 @@ static int omap_hsmmc_init_setup(struct mmc *mmc)
> >  	omap_hsmmc_conf_bus_power(mmc, (reg_val & VS33_3V3SUP) ?
> >  			  MMC_SIGNAL_VOLTAGE_330 : MMC_SIGNAL_VOLTAGE_180);
> >  #else
> > -	writel(DTW_1_BITMODE | SDBP_PWROFF | SDVS_3V0, &mmc_base->hctl);
> > +	writel(DTW_1_BITMODE | SDBP_PWROFF | SDVS_3V3, &mmc_base->hctl);
> >  	writel(readl(&mmc_base->capa) | VS33_3V3SUP | VS18_1V8SUP,
> >  		&mmc_base->capa);
> >  #endif
> > 
> > So eMMC on real N900 is working fine either with 3.0V or 3.3V. But 3.3V
> > needs to be configured on all places.
> 
> Hello! Could you please take a look at this issue and my above fix?

Ping. Any comment for above issue or my fix?

> > First problem with reboot loop and crash in mmc_set_ios() still remains.
> > Reverting 04a2ea248f58b3b6216d0cd0a6b8698df8b14355 fixes it.

  reply	other threads:[~2020-07-01  8:32 UTC|newest]

Thread overview: 101+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-31 22:35 [PATCH 00/11] Fixes for Nokia RX-51 Pali Rohár
2020-03-31 22:35 ` [PATCH 01/11] Nokia RX-51: Update my email address Pali Rohár
2020-03-31 22:35 ` [PATCH 02/11] Nokia RX-51: Add README.nokia_rx51 file to MAINTAINERS Pali Rohár
2020-03-31 22:35 ` [PATCH 03/11] Nokia RX-51: Move comment about CONFIG_SYS_TEXT_BASE to correct place Pali Rohár
2020-03-31 22:35 ` [PATCH 04/11] Nokia RX-51: Move code from defconfig back to C header file Pali Rohár
2020-03-31 22:35 ` [PATCH 05/11] Nokia RX-51: Revert back onenand defitions Pali Rohár
2020-03-31 22:35 ` [PATCH 06/11] Nokia RX-51: Remove PART* macros Pali Rohár
2020-03-31 22:35 ` [PATCH 07/11] Nokia RX-51: Remember setup_console_atag option Pali Rohár
2020-03-31 22:35 ` [PATCH 08/11] Nokia RX-51: Enable CONFIG_CONSOLE_MUX Pali Rohár
2020-04-14 10:19   ` Lokesh Vutla
2020-03-31 22:35 ` [PATCH 09/11] Nokia RX-51: Disable some unused features to decrease size of u-boot binary Pali Rohár
2020-03-31 22:35 ` [PATCH 10/11] Nokia RX-51: Update README.nokia_rx51 Pali Rohár
2020-03-31 22:35 ` [PATCH 11/11] Nokia RX-51: Add automated test for running RX-51 build in qemu Pali Rohár
2020-04-14 10:40   ` Pali Rohár
2020-04-21 14:55     ` Lokesh Vutla
2020-04-21 17:36       ` Simon Glass
2020-04-21 20:12         ` Tom Rini
2020-04-21 20:37           ` Simon Glass
2020-04-21 20:46             ` Tom Rini
2020-04-21 20:49               ` Simon Glass
2020-04-21 20:51                 ` Tom Rini
2020-04-21 21:34                   ` Pali Rohár
2020-04-21 23:24                     ` Tom Rini
2020-04-23  7:34                       ` Pali Rohár
2020-04-23 12:24                         ` Tom Rini
2020-04-23 17:48                           ` Pali Rohár
2020-04-25  9:00                             ` [PATCH v2] " Pali Rohár
2020-04-27  8:40                               ` Pali Rohár
2020-04-27 18:00                               ` Tom Rini
2020-04-28  7:37                                 ` Pali Rohár
2020-05-08 12:52                                   ` Pali Rohár
2020-05-08 13:10                                     ` Tom Rini
2020-05-09 16:28                                       ` Lokesh Vutla
2020-05-09 16:35                                         ` Pali Rohár
2020-05-09 20:56                                           ` Tom Rini
2020-05-14 22:41                                             ` Pali Rohár
2020-05-15  0:01                                               ` Tom Rini
2020-05-15  7:33                                                 ` Pali Rohár
2020-05-15 13:20                                                   ` Tom Rini
2020-05-15 13:46                                                     ` Pali Rohár
2020-05-15 13:48                                                       ` Tom Rini
2020-05-15 13:51                                                         ` Pali Rohár
2020-05-15 13:53                                                           ` Tom Rini
2020-05-15 13:58                                                             ` Pali Rohár
2020-05-15 14:16                                                               ` Tom Rini
2020-05-15 17:40                                                                 ` Pali Rohár
2020-05-15 18:34                                                                   ` Tom Rini
2020-05-17 12:31                                                                     ` Pali Rohár
2020-05-17 12:38                                                                       ` [PATCH v3] " Pali Rohár
2020-05-26  9:18                                                                         ` Pali Rohár
2020-05-26  9:22                                                                           ` Lokesh Vutla
2020-05-26  9:32                                                                             ` Pali Rohár
2020-05-26  9:33                                                                               ` Lokesh Vutla
2020-04-21 21:03               ` [PATCH 11/11] " Pali Rohár
2020-04-21 20:53             ` Pali Rohár
2020-03-31 22:42 ` U-Boot is broken on real N900 HW (Was: Re: [PATCH 00/11] Fixes for Nokia RX-51) Pali Rohár
     [not found]   ` <3c7dda52-10b3-e8c3-a382-785c80f124e7@wizzup.org>
2020-04-02 18:42     ` U-Boot is broken on real N900 HW Pali Rohár
2020-04-25 10:42       ` Pali Rohár
2020-04-25 11:36         ` Adam Ford
2020-04-25 11:50           ` Pali Rohár
2020-04-25 12:00             ` Adam Ford
2020-04-25 12:11               ` Pali Rohár
2020-04-25 23:54                 ` U-Boot i2c bus num 1 is broken on Nokia N900 (Was: Re: U-Boot is broken on real N900 HW) Pali Rohár
2020-04-27  7:03                   ` Heiko Schocher
2020-10-26 21:48                     ` U-Boot i2c bus num 1 is broken on Nokia N900 Pali Rohár
2020-10-28  5:42                       ` Heiko Schocher
2020-10-28 10:46                         ` Pali Rohár
2020-10-29  7:51                         ` Ivaylo Dimitrov
2020-10-29  9:32                           ` Heiko Schocher
2020-10-29  9:36                             ` Pali Rohár
2020-10-30  7:00                             ` Ivaylo Dimitrov
2020-10-30  7:24                               ` Heiko Schocher
2020-10-31 11:47                                 ` Ivaylo Dimitrov
2020-11-02  7:13                                   ` Heiko Schocher
2020-04-25 12:07             ` U-Boot is broken on real N900 HW Pali Rohár
2020-04-25 13:19               ` Pali Rohár
2020-04-25 13:48                 ` Pali Rohár
2020-04-25 21:26             ` Bisected: mmc cause reboot loops on N900 (Was: Re: U-Boot is broken on real N900 HW) Pali Rohár
2020-04-25 22:20               ` Pali Rohár
2020-04-25 22:29                 ` Bisected: omap_hsmmc 3.3V IO voltage incompatible with N900 (Was: Re: Bisected: mmc cause reboot loops on N900) Pali Rohár
2020-05-07 13:40                   ` Faiz Abbas
2020-05-07 15:19                     ` Pali Rohár
2020-05-26 17:49                       ` Pali Rohár
2020-06-12 13:03                         ` Pali Rohár
2020-07-01  8:32                           ` Pali Rohár [this message]
2020-07-01  8:51                             ` Faiz Abbas
2020-05-03 21:31                 ` Bisected: mmc cause reboot loops on N900 Pali Rohár
2020-04-26 17:13               ` Bisected: mmc cause reboot loops on N900 (Was: Re: U-Boot is broken on real N900 HW) Pavel Machek
2020-04-06 20:12   ` U-Boot is broken on real N900 HW (Was: Re: [PATCH 00/11] Fixes for Nokia RX-51) Pavel Machek
2020-04-06 22:27     ` Pali Rohár
2020-04-13 10:41 ` [PATCH 00/11] Fixes for Nokia RX-51 Pali Rohár
2020-04-14 10:23   ` Lokesh Vutla
2020-04-14 10:31     ` Pali Rohár
2020-04-14 10:44       ` Lokesh Vutla
2020-04-14 11:17         ` Pali Rohár
2020-04-14 11:51           ` Lokesh Vutla
2020-04-14 12:01             ` Pali Rohár
2020-04-16 21:57               ` Pali Rohár
2020-04-20  8:12                 ` Lokesh Vutla
2020-04-20 23:21                   ` Pali Rohár
2020-05-11 12:47     ` Lokesh Vutla

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200701083209.pzjr7edgvanfwkz2@pali \
    --to=pali@kernel.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.