Re: [PATCH 4/4] mci: bcm2835: set timeout value to 100ms

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon Nov 4, 2024 at 1:27 PM CET, Sascha Hauer wrote:
> On Thu, Oct 31, 2024 at 10:27:21AM +0100, Sebastien Bourdelin wrote:
> > From: Sebastien Bourdelin <sebastien.bourdelin@xxxxxxxx>
> > 
> > As mentionned in the Raspberry Pi4 bootrom Changelog [1]:
> > "Increase timeout of early SD/EMMC commands to 100ms".
> > The BCM2711 SDHCI can take up to 100ms to complete a command.
> > 
> > Without this change, we had noticed that Barebox sometime stay stucked
> > on a timeout error while trying to boot Linux from the eMMC.
> > 
> > [1] https://github.com/raspberrypi/rpi-eeprom/blob/master/firmware-2711/release-notes.md#2022-03-10---promote-the-2022-03-10-beta-release-to-lateststable
> > 
> > Signed-off-by: Sebastien Bourdelin <sebastien.bourdelin@xxxxxxxx>
> > ---
> >  drivers/mci/mci-bcm2835.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > diff --git a/drivers/mci/mci-bcm2835.c b/drivers/mci/mci-bcm2835.c
> > index cbf99ee7ca..3b086ed22c 100644
> > --- a/drivers/mci/mci-bcm2835.c
> > +++ b/drivers/mci/mci-bcm2835.c
> > @@ -128,6 +128,10 @@ static int bcm2835_mci_request(struct mci_host *mci, struct mci_cmd *cmd,
> >  		block_data |= data->blocksize;
> >  	}
> >  
> > +	/* BCM2xxx SDHCI might take up to 100ms to complete a command */
> > +	if (cmd != NULL)
> > +		cmd->busy_timeout = 100;
>
> Do we need this for all commands or just some specific ones?
I actually have no idea, the CM4s datasheet doesn't give much
informations regarding the eMMC controller and we just found that
information in the rpi-eeprom changelog, and saw it was also the defaut
timeout value used in U-boot [1].
After this change, we haven't been able to reproduce the issue.

We know for sure this issue happens at least on a read
command.

[1] https://github.com/u-boot/u-boot/blob/master/drivers/mmc/sdhci.c#L195
>
> cmd is always non NULL, no need to check.
Ok, i can send a v2 for that, just let me know if my explanation for
your first question is enough. 
>
> Sascha






[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux