mmc: sh_sdhi: Set SD_INFOx interrupt mask before command starting
authorKouei Abe <kouei.abe.cp@renesas.com>
Sat, 13 May 2017 13:51:15 +0000 (15:51 +0200)
committerJaehoon Chung <jh80.chung@samsung.com>
Fri, 9 Jun 2017 11:25:16 +0000 (20:25 +0900)
When setting interrupt mask after command starting, an unintended
interrupt status sometimes occurs.

Signed-off-by: Kouei Abe <kouei.abe.cp@renesas.com>
Signed-off-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Cc: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
drivers/mmc/sh_sdhi.c

index 25224e2e1db4b9fb4e4ceb2a276b5ac9035ea6c0..7f0b4c2603dbdb0e72b3bfad600f476a8941730c 100644 (file)
@@ -546,8 +546,6 @@ static int sh_sdhi_start_cmd(struct sh_sdhi_host *host,
                        break;
        }
 
-       sh_sdhi_writew(host, SDHI_CMD, (unsigned short)(opc & CMD_MASK));
-
        host->wait_int = 0;
        sh_sdhi_writew(host, SDHI_INFO1_MASK,
                       ~INFO1M_RESP_END & sh_sdhi_readw(host, SDHI_INFO1_MASK));
@@ -557,6 +555,8 @@ static int sh_sdhi_start_cmd(struct sh_sdhi_host *host,
                       INFO2M_RESP_TIMEOUT | INFO2M_ILA) &
                       sh_sdhi_readw(host, SDHI_INFO2_MASK));
 
+       sh_sdhi_writew(host, SDHI_CMD, (unsigned short)(opc & CMD_MASK));
+
        time = sh_sdhi_wait_interrupt_flag(host);
        if (!time)
                return sh_sdhi_error_manage(host);