From: Kouei Abe Date: Sat, 13 May 2017 13:51:15 +0000 (+0200) Subject: mmc: sh_sdhi: Set SD_INFOx interrupt mask before command starting X-Git-Tag: v2017.07-rc2~57^2~13 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3ebc62c987f000f33aa69231e24719547790264a;p=u-boot mmc: sh_sdhi: Set SD_INFOx interrupt mask before command starting When setting interrupt mask after command starting, an unintended interrupt status sometimes occurs. Signed-off-by: Kouei Abe Signed-off-by: Hiroyuki Yokoyama Cc: Hiroyuki Yokoyama Cc: Nobuhiro Iwamatsu Cc: Jaehoon Chung Reviewed-by: Nobuhiro Iwamatsu Reviewed-by: Jaehoon Chung --- diff --git a/drivers/mmc/sh_sdhi.c b/drivers/mmc/sh_sdhi.c index 25224e2e1d..7f0b4c2603 100644 --- a/drivers/mmc/sh_sdhi.c +++ b/drivers/mmc/sh_sdhi.c @@ -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);