From: xbw Date: Tue, 25 Mar 2014 11:14:37 +0000 (+0800) Subject: SDMMC: modify the data error, reset the IDMA before it is used next time. X-Git-Tag: firefly_0821_release~5846 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=3cdb3436f64cc9ca605f215786cf4a4f87100ebc;p=firefly-linux-kernel-4.4.55.git SDMMC: modify the data error, reset the IDMA before it is used next time. --- diff --git a/drivers/mmc/host/rk_sdmmc.c b/drivers/mmc/host/rk_sdmmc.c index 568fb02af48c..44790e43760d 100755 --- a/drivers/mmc/host/rk_sdmmc.c +++ b/drivers/mmc/host/rk_sdmmc.c @@ -727,6 +727,10 @@ static int dw_mci_submit_data_dma(struct dw_mci *host, struct mmc_data *data) if (host->prev_blksz != data->blksz) dw_mci_adjust_fifoth(host, data); + temp = mci_readl(host, CTRL); + temp |= (SDMMC_CTRL_DMA_RESET | SDMMC_CTRL_FIFO_RESET); + mci_writel(host, CTRL, temp); + /* Enable the DMA interface */ temp = mci_readl(host, CTRL); temp |= SDMMC_CTRL_DMA_ENABLE; @@ -1454,11 +1458,11 @@ static void dw_mci_command_complete(struct dw_mci *host, struct mmc_command *cmd cmd->error = -EIO; else cmd->error = 0; - MMC_DBG_CMD_FUNC(host->mmc, " command complete, cmd=%d,cmdError=0x%x [%s]",cmd->opcode, cmd->error,mmc_hostname(host->mmc)); + MMC_DBG_CMD_FUNC(host->mmc, " command complete, cmd=%d,cmdError=%d [%s]",cmd->opcode, cmd->error,mmc_hostname(host->mmc)); if (cmd->error) { if(MMC_SEND_STATUS != cmd->opcode) - MMC_DBG_ERR_FUNC(host->mmc, " command complete, cmd=%d,cmdError=0x%x [%s]",\ + MMC_DBG_ERR_FUNC(host->mmc, " command complete, cmd=%d,cmdError=%d [%s]",\ cmd->opcode, cmd->error,mmc_hostname(host->mmc)); /* newer ip versions need a delay between retries */