Skip to contentSkip to conversation

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

PATCH New ludovic.desroches at atmel.com 4 participants 7 messages Feb 8, 2012 – Feb 11, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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

From: Ludovic Desroches <[email protected]>

---
 drivers/mmc/host/atmel-mci.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
drivers/mmc/host/atmel-mci.c +3 -0
index 09ac13b..dfa5dd9 100644
@@ -965,11 +965,14 @@ static void atmci_start_request(struct atmel_mci *host,
 	host->data_status = 0;
 
 	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_MCIEN);
 		atmci_writel(host, ATMCI_MR, host->mode_reg);
 		if (host->caps.has_cfg_reg)
 			atmci_writel(host, ATMCI_CFG, host->cfg_reg);
+		atmci_writel(host, ATMCI_IER, iflags);
 		host->need_reset = false;
 	}
 	atmci_writel(host, ATMCI_SDCR, slot->sdc_reg);
Signature · 1 line
1.7.5.4
#2 lore raw

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

Hello Jean-Christophe,

A customer using an Atheros AR6103 SDIO WLAN adapter faces this issue.

Sometimes we perform a software reset and he noticed that after he didn't get sdio irq. The interrupt mask register is also resetted when performing software reset.

Regards

Ludovic

Quoted 8 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 1 line · ludovic.desroches at atmel.com

From: Ludovic Desroches <[email protected]>

why do you need this?

Best Regards,
J.

#3 lore raw

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

Quoted 7 lines · Ludovic Desroches

Hello Jean-Christophe,

A customer using an Atheros AR6103 SDIO WLAN adapter faces this issue.

Sometimes we perform a software reset and he noticed that after he didn't get sdio irq. The interrupt mask register is also resetted when performing software reset.

so put this in the commit

Best Regards,
J.

#4 lore raw

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

In reply to ludovic.desroches at atmel.com

From: Ludovic Desroches <[email protected]>

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.

---
 drivers/mmc/host/atmel-mci.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
drivers/mmc/host/atmel-mci.c +3 -0
index 09ac13b..dfa5dd9 100644
@@ -965,11 +965,14 @@ static void atmci_start_request(struct atmel_mci *host,
 	host->data_status = 0;
 
 	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_MCIEN);
 		atmci_writel(host, ATMCI_MR, host->mode_reg);
 		if (host->caps.has_cfg_reg)
 			atmci_writel(host, ATMCI_CFG, host->cfg_reg);
+		atmci_writel(host, ATMCI_IER, iflags);
 		host->need_reset = false;
 	}
 	atmci_writel(host, ATMCI_SDCR, slot->sdc_reg);
Signature · 1 line
1.7.5.4
#5 lore raw

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

On 02/09/2012 11:55 AM, ludovic.desroches at atmel.com :

Quoted 7 lines

From: Ludovic Desroches <[email protected]>

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.

Chris, can you please queue this patch in a "fixes" branch?

Thanks, best regards,

Quoted 24 lines
Cc stable at vger.kernel.org
---
 drivers/mmc/host/atmel-mci.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
drivers/mmc/host/atmel-mci.c +3 -0
index 09ac13b..dfa5dd9 100644
@@ -965,11 +965,14 @@ static void atmci_start_request(struct atmel_mci *host,
 	host->data_status = 0;
 
 	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_MCIEN);
 		atmci_writel(host, ATMCI_MR, host->mode_reg);
 		if (host->caps.has_cfg_reg)
 			atmci_writel(host, ATMCI_CFG, host->cfg_reg);
+		atmci_writel(host, ATMCI_IER, iflags);
 		host->need_reset = false;
 	}
 	atmci_writel(host, ATMCI_SDCR, slot->sdc_reg);
Signature · 1 line
Nicolas Ferre
#6 lore raw

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

Hi,

Quoted 7 lines · Nicolas Ferre

On 02/09/2012 11:55 AM, ludovic.desroches at atmel.com :

Quoted 6 lines

From: Ludovic Desroches <[email protected]>

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.

Quoted 5 lines
Quoted 1 line

Chris, can you please queue this patch in a "fixes" branch?

Thanks, pushed to mmc-next for 3.3.

- Chris.

Signature · 2 lines
Chris Ball   <[email protected]>   <http://printf.net/>
One Laptop Per Child