Commit b207384e authored by Ludovic Desroches's avatar Ludovic Desroches Committed by Greg Kroah-Hartman

mmc: atmel-mci: save and restore sdioirq when soft reset is performed

commit 18ee684b upstream.

Sometimes a software reset is needed. Then some registers are saved and
restored but the interrupt mask register is missing. It causes issues
with sdio devices whose interrupts are masked after reset.
Signed-off-by: default avatarLudovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: default avatarNicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: default avatarChris Ball <cjb@laptop.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2edcb814
...@@ -965,11 +965,14 @@ static void atmci_start_request(struct atmel_mci *host, ...@@ -965,11 +965,14 @@ static void atmci_start_request(struct atmel_mci *host,
host->data_status = 0; host->data_status = 0;
if (host->need_reset) { if (host->need_reset) {
iflags = atmci_readl(host, ATMCI_IMR);
iflags &= (ATMCI_SDIOIRQA | ATMCI_SDIOIRQB);
atmci_writel(host, ATMCI_CR, ATMCI_CR_SWRST); atmci_writel(host, ATMCI_CR, ATMCI_CR_SWRST);
atmci_writel(host, ATMCI_CR, ATMCI_CR_MCIEN); atmci_writel(host, ATMCI_CR, ATMCI_CR_MCIEN);
atmci_writel(host, ATMCI_MR, host->mode_reg); atmci_writel(host, ATMCI_MR, host->mode_reg);
if (host->caps.has_cfg_reg) if (host->caps.has_cfg_reg)
atmci_writel(host, ATMCI_CFG, host->cfg_reg); atmci_writel(host, ATMCI_CFG, host->cfg_reg);
atmci_writel(host, ATMCI_IER, iflags);
host->need_reset = false; host->need_reset = false;
} }
atmci_writel(host, ATMCI_SDCR, slot->sdc_reg); atmci_writel(host, ATMCI_SDCR, slot->sdc_reg);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment