diff options
author | 2017-07-03 21:28:23 +0200 | |
---|---|---|
committer | 2017-08-30 14:01:24 +0200 | |
commit | 5ea2a2ace5a0156e7c56d084a3306dc8f7015b8b (patch) | |
tree | 088458c3bbeaf70481e8248f1c86b0f68ab11bb2 /drivers/mmc/host | |
parent | mmc: mxcmmc: fix error return code in mxcmci_probe() (diff) | |
download | linux-5ea2a2ace5a0156e7c56d084a3306dc8f7015b8b.tar.gz linux-5ea2a2ace5a0156e7c56d084a3306dc8f7015b8b.tar.bz2 linux-5ea2a2ace5a0156e7c56d084a3306dc8f7015b8b.zip |
mmc: tmio: fix CMD12 (STOP) handling
I always anticipated this code to be not correct, but now I had a test
case to prove it. According to all documentation I have, setting the
TMIO_STOP_STP bit ever only worked during block transfers. This bit is
like manually enforcing an autocmd12 during a so far seamless transfer.
It does NOT work when the block transfer had errors. It also does NOT
work with any other cmd except block commands. For all those, CMD12 has
to be treated like any other command. So, basically, we could use this
bit only for mrq->data->stop cmds. But for these, we happily use the
autocmd12 feature using the TMIO_STOP_SEC bit. As a result, the above
bit is not useful for us and we need to treat CMD12 as a regular cmd
always. Just remove the special handling code. Note that the BSP
recognized this issue as well yet had a more cautious solution to the
problem [1]. Which is understandable but makes CMD12 handling even more
complicated.
Checked with a Renesas Salvator-X/M3-W which needed to send CMD12 when
retuning one of my SD cards.
[1] https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas-bsp.git/commit/?id=2838a2ff8ca776f6d18b7fbbe75f3df8dd64183a
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Tested-by: Jan Klötzke <jan.kloetzke@preh.de>
Tested-by: Nguyen Viet Dung <dung.nguyen.aj@renesas.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/host')
-rw-r--r-- | drivers/mmc/host/tmio_mmc_core.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/drivers/mmc/host/tmio_mmc_core.c b/drivers/mmc/host/tmio_mmc_core.c index db779732fd2e..ad31bdff30cc 100644 --- a/drivers/mmc/host/tmio_mmc_core.c +++ b/drivers/mmc/host/tmio_mmc_core.c @@ -349,12 +349,6 @@ static int tmio_mmc_start_command(struct tmio_mmc_host *host, int c = cmd->opcode; u32 irq_mask = TMIO_MASK_CMD; - /* CMD12 is handled by hardware */ - if (cmd->opcode == MMC_STOP_TRANSMISSION && !cmd->arg) { - sd_ctrl_write16(host, CTL_STOP_INTERNAL_ACTION, TMIO_STOP_STP); - return 0; - } - switch (mmc_resp_type(cmd)) { case MMC_RSP_NONE: c |= RESP_NONE; break; case MMC_RSP_R1: |