mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Rouven Czerwinski <r.czerwinski@pengutronix.de>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Barebox List <barebox@lists.infradead.org>
Subject: Re: [PATCH] mci: sdhci: Add and use common sdhci_wait_for_done()
Date: Tue, 28 Mar 2023 14:33:02 +0200	[thread overview]
Message-ID: <d90227e075600ebc79a52db4ea85c5450eefad02.camel@pengutronix.de> (raw)
In-Reply-To: <20230328095859.GK19113@pengutronix.de>

Hi,

On Tue, 2023-03-28 at 11:58 +0200, Sascha Hauer wrote:
> On Mon, Mar 27, 2023 at 03:01:31PM +0200, Rouven Czerwinski wrote:
> > Hi,
> > 
> > On Tue, 2023-03-21 at 10:50 +0100, Sascha Hauer wrote:
> > > We have different driver specific variants of functions polling
> > > for the
> > > device ready in the tree. Add a common sdhci_wait_for_done() and
> > > use
> > > it where appropriate. This fixes a few deficiencies with the
> > > driver
> > > specific variants.
> > > 
> > > rk_sdhci_wait_for_done() didn't check the SDHCI_INT_TIMEOUT bit
> > > and
> > > returned -EPERM instead when it ought to return -ETIMEDOUT. The
> > > core
> > > tries to detect a SD card first and expects a -ETIMEDOUT for the
> > > setup
> > > command when really a eMMC is connected. Only with a -ETIMEDOUT
> > > the core
> > > tries to detect a eMMC next.
> > > 
> > > at91_sdhci_wait_for_done() returned the status instead of the
> > > expected
> > > 0 value for success.
> > 
> > I had to revert this commit to run barebox_update on the CM3
> > RK3566.
> > Otherwise writes to the boot partition would hang indefinitely.
> 
> Same here. The following fixes this.
> 
> At some point during MMC initialization we probe for a SDIO card.
> This
> is expected to fail for non SDIO cards and we have to call
> sdhci_reset()
> in the error path then. It's a bit weird that the effect is that
> everything apparently works but writing to boot partitions does not.
> 
> Sascha

Jip, this fixes it, you can add a:

Tested-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>

> 
> ---------------------------8<---------------------------
> 
> From db92d5c12080c0ad108bd1d8bb0481584a36ae4b Mon Sep 17 00:00:00
> 2001
> From: Sascha Hauer <s.hauer@pengutronix.de>
> Date: Tue, 28 Mar 2023 11:43:35 +0200
> Subject: [PATCH] fixup! mci: sdhci: Add and use common
> sdhci_wait_for_done()
> 
> ---
>  drivers/mci/rockchip-dwcmshc-sdhci.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/mci/rockchip-dwcmshc-sdhci.c
> b/drivers/mci/rockchip-dwcmshc-sdhci.c
> index e055a8ea71..a98600cc4c 100644
> --- a/drivers/mci/rockchip-dwcmshc-sdhci.c
> +++ b/drivers/mci/rockchip-dwcmshc-sdhci.c
> @@ -263,10 +263,8 @@ static int rk_sdhci_send_cmd(struct mci_host
> *mci, struct mci_cmd *cmd,
>         sdhci_write16(&host->sdhci, SDHCI_COMMAND, command);
>  
>         ret = sdhci_wait_for_done(&host->sdhci,
> SDHCI_INT_CMD_COMPLETE);
> -       if (ret == -EPERM)
> +       if (ret)
>                 goto error;
> -       else if (ret)
> -               return ret;
>  
>         sdhci_read_response(&host->sdhci, cmd);
>         sdhci_write32(&host->sdhci, SDHCI_INT_STATUS,
> SDHCI_INT_CMD_COMPLETE);
> -- 
> 2.39.2
> 




      reply	other threads:[~2023-03-28 12:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-21  9:50 Sascha Hauer
2023-03-27 13:01 ` Rouven Czerwinski
2023-03-28  9:58   ` Sascha Hauer
2023-03-28 12:33     ` Rouven Czerwinski [this message]

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=d90227e075600ebc79a52db4ea85c5450eefad02.camel@pengutronix.de \
    --to=r.czerwinski@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox