From: Adrian Hunter <adrian.hunter@intel.com>
To: Claudiu Beznea <claudiu.beznea@microchip.com>,
eugen.hristev@microchip.com, ulf.hansson@linaro.org,
nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com,
ludovic.desroches@microchip.com
Cc: linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/2] mmc: sdhci-of-at91: wait for calibration done before proceed
Date: Fri, 24 Sep 2021 14:34:09 +0300 [thread overview]
Message-ID: <9c38e4b6-c052-ec98-bf25-1a8d05f6d73d@intel.com> (raw)
In-Reply-To: <20210924082851.2132068-2-claudiu.beznea@microchip.com>
On 24/09/21 11:28 am, Claudiu Beznea wrote:
> Datasheet specifies that at the end of calibration the SDMMC_CALCR_EN
> bit will be cleared. No commands should be send before calibration is
> done.
>
> Fixes: dbdea70f71d67 ("mmc: sdhci-of-at91: fix CALCR register being rewritten")
> Fixes: 727d836a375ad ("mmc: sdhci-of-at91: add DT property to enable calibration on full reset")
> Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
> ---
>
> Hi Nicolas,
>
> I haven't added your tag from previous version as I changed the
> implementation to use read_poll_timeout().
>
> Thank you,
> Claudiu Beznea
>
> drivers/mmc/host/sdhci-of-at91.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/mmc/host/sdhci-of-at91.c b/drivers/mmc/host/sdhci-of-at91.c
> index 5564d7b23e7c..134ba01d3063 100644
> --- a/drivers/mmc/host/sdhci-of-at91.c
> +++ b/drivers/mmc/host/sdhci-of-at91.c
> @@ -11,6 +11,7 @@
> #include <linux/delay.h>
> #include <linux/err.h>
> #include <linux/io.h>
> +#include <linux/iopoll.h>
> #include <linux/kernel.h>
> #include <linux/mmc/host.h>
> #include <linux/mmc/slot-gpio.h>
> @@ -114,6 +115,7 @@ static void sdhci_at91_reset(struct sdhci_host *host, u8 mask)
> {
> struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
> struct sdhci_at91_priv *priv = sdhci_pltfm_priv(pltfm_host);
> + unsigned int tmp;
>
> sdhci_reset(host, mask);
>
> @@ -126,6 +128,10 @@ static void sdhci_at91_reset(struct sdhci_host *host, u8 mask)
>
> sdhci_writel(host, calcr | SDMMC_CALCR_ALWYSON | SDMMC_CALCR_EN,
> SDMMC_CALCR);
> +
> + if (read_poll_timeout(sdhci_readl, tmp, !(tmp & SDMMC_CALCR_EN),
> + 10, 20000, false, host, SDMMC_CALCR))
> + dev_err(mmc_dev(host->mmc), "Failed to calibrate\n");
> }
> }
>
>
next prev parent reply other threads:[~2021-09-24 11:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-24 8:28 [PATCH v2 0/2] mmc: sdhci-of-at91: fix for shdci-of-at91 Claudiu Beznea
2021-09-24 8:28 ` [PATCH v2 1/2] mmc: sdhci-of-at91: wait for calibration done before proceed Claudiu Beznea
2021-09-24 11:34 ` Adrian Hunter [this message]
2021-09-24 8:28 ` [PATCH v2 2/2] mmc: sdhci-of-at91: replace while loop with read_poll_timeout Claudiu Beznea
2021-09-24 11:34 ` Adrian Hunter
2021-09-27 22:31 ` [PATCH v2 0/2] mmc: sdhci-of-at91: fix for shdci-of-at91 Ulf Hansson
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=9c38e4b6-c052-ec98-bf25-1a8d05f6d73d@intel.com \
--to=adrian.hunter@intel.com \
--cc=alexandre.belloni@bootlin.com \
--cc=claudiu.beznea@microchip.com \
--cc=eugen.hristev@microchip.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=ludovic.desroches@microchip.com \
--cc=nicolas.ferre@microchip.com \
--cc=ulf.hansson@linaro.org \
/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
all inboxes | Powered by JetHome®