public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Chin Liang See <clsee@altera.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 05/51] mmc: dw_mmc: cleanups
Date: Wed, 1 Oct 2014 02:40:17 -0500	[thread overview]
Message-ID: <1412149217.11125.8.camel@clsee-VirtualBox.altera.com> (raw)
In-Reply-To: <1411304339-11348-6-git-send-email-marex@denx.de>

On Sun, 2014-09-21 at 14:58 +0200, marex at denx.de wrote:
> From: Pavel Machek <pavel@denx.de>
> 
> The dw_mmc driver was responding to errors with debug(). Change that
> to prinf()/puts() respectively so that any errors are immediately
> obvious. Also adjust english in comments.
> 
> Signed-off-by: Pavel Machek <pavel@denx.de>
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Chin Liang See <clsee@altera.com>
> Cc: Dinh Nguyen <dinguyen@altera.com>
> Cc: Albert Aribaud <albert.u.boot@aribaud.net>
> Cc: Tom Rini <trini@ti.com>
> Cc: Wolfgang Denk <wd@denx.de>
> Cc: Pavel Machek <pavel@denx.de>
> Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
> ---
>  drivers/mmc/dw_mmc.c | 34 ++++++++++++++++++++++------------
>  1 file changed, 22 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c
> index 0df30bc..785eed5 100644
> --- a/drivers/mmc/dw_mmc.c
> +++ b/drivers/mmc/dw_mmc.c
> @@ -119,7 +119,7 @@ static int dwmci_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
>  
>  	while (dwmci_readl(host, DWMCI_STATUS) & DWMCI_BUSY) {
>  		if (get_timer(start) > timeout) {
> -			printf("Timeout on data busy\n");
> +			printf("%s: Timeout on data busy\n", __func__);
>  			return TIMEOUT;
>  		}
>  	}
> @@ -177,14 +177,24 @@ static int dwmci_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
>  		}
>  	}
>  
> -	if (i == retry)
> +	if (i == retry) {
> +		printf("%s: Timeout.\n", __func__);
>  		return TIMEOUT;
> +	}
>  
>  	if (mask & DWMCI_INTMSK_RTO) {
> -		debug("Response Timeout..\n");
> +		/*
> +		 * Timeout here is not necessarily fatal. (e)MMC cards
> +		 * will splat here when they receive CMD55 as they do
> +		 * not support this command and that is exactly the way
> +		 * to tell them apart from SD cards. Thus, this output
> +		 * below shall be debug(). eMMC cards also do not favor
> +		 * CMD8, please keep that in mind.
> +		 */
> +		debug("%s: Response Timeout.\n", __func__);
>  		return TIMEOUT;
>  	} else if (mask & DWMCI_INTMSK_RE) {
> -		debug("Response Error..\n");
> +		printf("%s: Response Error.\n", __func__);
>  		return -1;
>  	}
>  
> @@ -204,7 +214,7 @@ static int dwmci_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
>  		do {
>  			mask = dwmci_readl(host, DWMCI_RINTSTS);
>  			if (mask & (DWMCI_DATA_ERR | DWMCI_DATA_TOUT)) {
> -				debug("DATA ERROR!\n");
> +				printf("%s: DATA ERROR!\n", __func__);
>  				return -1;
>  			}
>  		} while (!(mask & DWMCI_INTMSK_DTO));
> @@ -232,16 +242,16 @@ static int dwmci_setup_bus(struct dwmci_host *host, u32 freq)
>  	if ((freq == host->clock) || (freq == 0))
>  		return 0;
>  	/*
> -	 * If host->get_mmc_clk didn't define,
> +	 * If host->get_mmc_clk isn't defined,
>  	 * then assume that host->bus_hz is source clock value.
> -	 * host->bus_hz should be set from user.
> +	 * host->bus_hz should be set by user.
>  	 */
>  	if (host->get_mmc_clk)
>  		sclk = host->get_mmc_clk(host);
>  	else if (host->bus_hz)
>  		sclk = host->bus_hz;
>  	else {
> -		printf("Didn't get source clock value..\n");
> +		printf("%s: Didn't get source clock value.\n", __func__);
>  		return -EINVAL;
>  	}
>  
> @@ -260,7 +270,7 @@ static int dwmci_setup_bus(struct dwmci_host *host, u32 freq)
>  	do {
>  		status = dwmci_readl(host, DWMCI_CMD);
>  		if (timeout-- < 0) {
> -			printf("TIMEOUT error!!\n");
> +			printf("%s: Timeout!\n", __func__);
>  			return -ETIMEDOUT;
>  		}
>  	} while (status & DWMCI_CMD_START);
> @@ -275,7 +285,7 @@ static int dwmci_setup_bus(struct dwmci_host *host, u32 freq)
>  	do {
>  		status = dwmci_readl(host, DWMCI_CMD);
>  		if (timeout-- < 0) {
> -			printf("TIMEOUT error!!\n");
> +			printf("%s: Timeout!\n", __func__);
>  			return -ETIMEDOUT;
>  		}
>  	} while (status & DWMCI_CMD_START);
> @@ -290,7 +300,7 @@ static void dwmci_set_ios(struct mmc *mmc)
>  	struct dwmci_host *host = (struct dwmci_host *)mmc->priv;
>  	u32 ctype, regs;
>  
> -	debug("Buswidth = %d, clock: %d\n",mmc->bus_width, mmc->clock);
> +	debug("Buswidth = %d, clock: %d\n", mmc->bus_width, mmc->clock);
>  
>  	dwmci_setup_bus(host, mmc->clock);
>  	switch (mmc->bus_width) {
> @@ -329,7 +339,7 @@ static int dwmci_init(struct mmc *mmc)
>  	dwmci_writel(host, DWMCI_PWREN, 1);
>  
>  	if (!dwmci_wait_reset(host, DWMCI_RESET_ALL)) {
> -		debug("%s[%d] Fail-reset!!\n",__func__,__LINE__);
> +		printf("%s[%d] Fail-reset!!\n", __func__, __LINE__);
>  		return -1;
>  	}
>  

Acked-by: Chin Liang See <clsee@altera.com>

  reply	other threads:[~2014-10-01  7:40 UTC|newest]

Thread overview: 82+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-21 12:58 [U-Boot] [PATCH 00/51] arm: socfpga: Usability fixes Marek Vasut
2014-09-21 12:58 ` [U-Boot] [PATCH V2 01/51] net: Remove unused CONFIG_DW_SEARCH_PHY from configs Marek Vasut
2014-10-01  6:50   ` Chin Liang See
2014-09-21 12:58 ` [U-Boot] [PATCH 02/51] net: phy: Cleanup drivers/net/phy/micrel.c Marek Vasut
2014-10-01  6:57   ` Chin Liang See
2014-09-21 12:58 ` [U-Boot] [PATCH 03/51] net: dwc: Fix cache alignment issues Marek Vasut
2014-10-01  7:23   ` Chin Liang See
2014-10-01 11:21     ` Marek Vasut
2014-09-21 12:58 ` [U-Boot] [PATCH 04/51] net: dwc: Make the cache handling less cryptic Marek Vasut
2014-10-01  7:35   ` Chin Liang See
2014-09-21 12:58 ` [U-Boot] [PATCH 05/51] mmc: dw_mmc: cleanups Marek Vasut
2014-10-01  7:40   ` Chin Liang See [this message]
2014-09-21 12:58 ` [U-Boot] [PATCH 06/51] mmc: dw_mmc: Fix cache alignment issue Marek Vasut
2014-10-01  9:45   ` Chin Liang See
2014-10-01 11:30     ` Marek Vasut
2014-09-21 12:58 ` [U-Boot] [PATCH 07/51] tools: socfpga: Add socfpga preloader signing to mkimage Marek Vasut
2014-10-01 10:10   ` Chin Liang See
2014-10-01 11:51     ` Marek Vasut
2014-09-21 12:58 ` [U-Boot] [PATCH 08/51] arm: socfpga: Complete the list of base addresses Marek Vasut
2014-10-01 10:19   ` Chin Liang See
2014-10-01 11:54     ` Marek Vasut
2014-09-21 12:58 ` [U-Boot] [PATCH 09/51] arm: socfpga: Clean up base address file Marek Vasut
2014-10-01 10:30   ` Chin Liang See
2014-09-21 12:58 ` [U-Boot] [PATCH V2 10/51] arm: socfpga: Add watchdog disable for socfpga Marek Vasut
2014-10-01 10:50   ` Chin Liang See
2014-10-01 12:07     ` Marek Vasut
2014-09-21 12:58 ` [U-Boot] [PATCH 11/51] arm: socfpga: sysmgr: Clean up system manager Marek Vasut
2014-09-21 12:58 ` [U-Boot] [PATCH 12/51] arm: socfpga: clock: Implant order into bit definitions Marek Vasut
2014-09-21 12:58 ` [U-Boot] [PATCH 13/51] arm: socfpga: clock: Drop nonsense inlining from clock manager code Marek Vasut
2014-09-21 12:58 ` [U-Boot] [PATCH 14/51] arm: socfpga: clock: Add missing stubs into board file Marek Vasut
2014-09-21 12:58 ` [U-Boot] [PATCH V2 15/51] arm: socfpga: clock: Add code to read clock configuration Marek Vasut
2014-09-21 12:58 ` [U-Boot] [PATCH 16/51] arm: socfpga: clock: Trim down code duplication Marek Vasut
2014-09-21 12:58 ` [U-Boot] [PATCH 17/51] arm: socfpga: clock: Clean up bit definitions Marek Vasut
2014-09-21 12:58 ` [U-Boot] [PATCH 18/51] arm: socfpga: clock: Sync with reference code Marek Vasut
2014-09-21 12:58 ` [U-Boot] [PATCH 19/51] arm: socfpga: mmc: Pick the clock from clock manager Marek Vasut
2014-09-21 12:58 ` [U-Boot] [PATCH 20/51] arm: socfpga: timer: Pull the timer reload value from config file Marek Vasut
2014-09-21 12:58 ` [U-Boot] [PATCH 21/51] arm: socfpga: reset: Add EMAC reset functions Marek Vasut
2014-09-21 12:58 ` [U-Boot] [PATCH 22/51] arm: socfpga: misc: Add proper ethernet initialization Marek Vasut
2014-09-21 12:58 ` [U-Boot] [PATCH 23/51] arm: socfpga: misc: Add SD controller init Marek Vasut
2014-09-21 12:58 ` [U-Boot] [PATCH 24/51] arm: socfpga: misc: Align print_cpuinfo() output Marek Vasut
2014-09-21 12:58 ` [U-Boot] [PATCH 25/51] arm: socfpga: board: Correctly set ATAG position Marek Vasut
2014-09-21 12:58 ` [U-Boot] [PATCH 26/51] arm: socfpga: board: Align checkboard() output Marek Vasut
2014-09-21 13:11 ` [U-Boot] [PATCH 27/51] fpga: altera: Clean up the printing and debug Marek Vasut
2014-09-24 12:46   ` Michal Simek
2014-09-24 13:22     ` Marek Vasut
2014-09-21 13:12 ` [U-Boot] [PATCH 28/51] fpga: altera: Clean up altera_validate function Marek Vasut
2014-09-21 13:12   ` [U-Boot] [PATCH 29/51] fpga: altera: More indentation trimdown Marek Vasut
2014-09-21 13:12   ` [U-Boot] [PATCH 30/51] fpga: altera: Move altera_validate to the top Marek Vasut
2014-09-21 13:12   ` [U-Boot] [PATCH 31/51] fpga: altera: Make altera_validate return normal values Marek Vasut
2014-09-22  9:16     ` Pavel Machek
2014-09-22  9:36       ` Marek Vasut
2014-09-21 13:12   ` [U-Boot] [PATCH 32/51] fpga: altera: Clean up enums in altera.h Marek Vasut
2014-09-21 13:12   ` [U-Boot] [PATCH 33/51] fpga: altera: Turn the switches into table lookup Marek Vasut
2014-09-21 13:12   ` [U-Boot] [PATCH V2 34/51] arm: socfpga: fpga: Add SoCFPGA FPGA programming interface Marek Vasut
2014-09-21 13:12   ` [U-Boot] [PATCH 35/51] arm: socfpga: reset: Add function to reset FPGA bridges Marek Vasut
2014-09-21 13:12   ` [U-Boot] [PATCH 36/51] arm: socfpga: sysmgr: Add FPGA bits into system manager Marek Vasut
2014-09-21 13:12   ` [U-Boot] [PATCH 37/51] arm: cache: Add support for write-allocate D-Cache Marek Vasut
2014-09-21 13:12   ` [U-Boot] [PATCH 38/51] arm: socfpga: cache: Define cacheline size Marek Vasut
2014-09-21 13:12   ` [U-Boot] [PATCH 39/51] arm: socfpga: cache: Enable D-Cache Marek Vasut
2014-09-21 13:12   ` [U-Boot] [PATCH 40/51] arm: socfpga: cache: Enable PL310 L2 cache Marek Vasut
2014-09-21 13:12   ` [U-Boot] [PATCH 41/51] arm: socfpga: scu: Add SCU register file Marek Vasut
2014-09-21 13:12   ` [U-Boot] [PATCH 42/51] arm: socfpga: nic301: Add NIC-301 GPV " Marek Vasut
2014-09-21 13:12   ` [U-Boot] [PATCH 43/51] arm: socfpga: pl310: Map SDRAM to 0x0 Marek Vasut
2014-09-21 13:12   ` [U-Boot] [PATCH 44/51] arm: socfpga: nic301: Add NIC-301 configuration code Marek Vasut
2014-09-21 13:12   ` [U-Boot] [PATCH 45/51] arm: socfpga: Enable DWMMC for SOCFPGA Marek Vasut
2014-09-21 13:12   ` [U-Boot] [PATCH 46/51] arm: socfpga: Enable SDMMC boot for SOCFPGA U-Boot Marek Vasut
2014-09-21 13:12   ` [U-Boot] [PATCH 47/51] arm: socfpga: Move cache_enable to CPU code Marek Vasut
2014-09-21 13:12   ` [U-Boot] [PATCH 48/51] arm: socfpga: Add command to control HPS-FPGA bridges Marek Vasut
2014-09-21 13:12   ` [U-Boot] [PATCH 49/51] arm: socfpga: Clean up SoCFPGA configuration Marek Vasut
2014-09-21 13:12   ` [U-Boot] [PATCH 50/51] arm: socfpga: Split " Marek Vasut
2014-09-24 14:10     ` Dinh Nguyen
2014-09-24 15:38       ` Pavel Machek
2014-09-25 14:45         ` Marek Vasut
2014-09-25 14:43       ` Marek Vasut
2014-09-21 13:12   ` [U-Boot] [PATCH 51/51] arm: socfpga: Use CMD_FS_GENERIC Marek Vasut
2014-09-24 13:38     ` Michal Simek
2014-09-22  9:13   ` [U-Boot] [PATCH 28/51] fpga: altera: Clean up altera_validate function Pavel Machek
2014-09-23 15:15 ` [U-Boot] [PATCH 00/51] arm: socfpga: Usability fixes Stefan Roese
2014-09-29 11:12 ` Pavel Machek
2014-09-29 22:54   ` Marek Vasut
2014-10-01  6:18 ` Chin Liang See
2014-10-01 11:13   ` Marek Vasut

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=1412149217.11125.8.camel@clsee-VirtualBox.altera.com \
    --to=clsee@altera.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox