]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
mmc: sdhci: report error once the maximum tuning loops exhausted or timeout
authorDong Aisheng <b29396@freescale.com>
Fri, 18 Oct 2013 11:48:45 +0000 (19:48 +0800)
committerChris Ball <chris@printf.net>
Mon, 21 Oct 2013 19:58:06 +0000 (15:58 -0400)
The original code missed to report an error when the maximum tuning
loops exhausted or timeout, it will cause the upper layer to wrongly
think the tuning process is passed.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
drivers/mmc/host/sdhci.c

index 66bce7a8e996e6e18c9ea17ba90b4bb174f976c9..cbde17d97e9dae6cfe31bb775e8937d2adc5af59 100644 (file)
@@ -1989,6 +1989,7 @@ static int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode)
        if (!tuning_loop_counter || !timeout) {
                ctrl &= ~SDHCI_CTRL_TUNED_CLK;
                sdhci_writew(host, ctrl, SDHCI_HOST_CONTROL2);
+               err = -EIO;
        } else {
                if (!(ctrl & SDHCI_CTRL_TUNED_CLK)) {
                        pr_info(DRIVER_NAME ": Tuning procedure"