[PATCH][v2] mmc:sdhci: restore the enabled dma when do reset all

Subsystems: multimedia card (mmc), secure digital (sd) and sdio subsystem, secure digital host controller interface (sdhci) driver, the rest

STALE5324d

4 messages, 3 authors, 2012-01-11 · open the first message on its own page

[PATCH][v2] mmc:sdhci: restore the enabled dma when do reset all

From: Shaohui Xie <hidden>
Date: 2011-12-29 09:22:40

If dma is enabled, it'll be cleared when reset all is performed, this can
be observed on some platforms, such as P2041 which has a version 2.3
controller, but platform like P4080 which has a version 2.2 controller,
does not suffer this, so we will check if the dma is enabled, we should
restore it after reset all.

Signed-off-by: Shaohui Xie <redacted>
---
based on http://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc.git,
branch 'for-linus'.

changes for v2:
call the wrapper API instead of access the register directly.

 drivers/mmc/host/sdhci.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 19ed580..cf6a048 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -214,6 +214,11 @@ static void sdhci_reset(struct sdhci_host *host, u8 mask)
 
 	if (host->quirks & SDHCI_QUIRK_RESTORE_IRQS_AFTER_RESET)
 		sdhci_clear_set_irqs(host, SDHCI_INT_ALL_MASK, ier);
+
+	if (host->flags & (SDHCI_USE_SDMA | SDHCI_USE_ADMA)) {
+		if ((host->ops->enable_dma) && (mask & SDHCI_RESET_ALL))
+			host->ops->enable_dma(host);
+	}
 }
 
 static void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios);
-- 
1.6.4

RE: [PATCH][v2] mmc:sdhci: restore the enabled dma when do reset all

From: Xie Shaohui-B21989 <hidden>
Date: 2012-01-06 07:57:58

Hello, Chris,

Do you have any concern for this patch?


Best Regards,=20
Shaohui Xie=20
quoted hunk
-----Original Message-----
From: Xie Shaohui-B21989
Sent: Thursday, December 29, 2011 4:33 PM
To: linux-mmc@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org; Xie Shaohui-B21989
Subject: [PATCH][v2] mmc:sdhci: restore the enabled dma when do reset all

If dma is enabled, it'll be cleared when reset all is performed, this can
be observed on some platforms, such as P2041 which has a version 2.3
controller, but platform like P4080 which has a version 2.2 controller,
does not suffer this, so we will check if the dma is enabled, we should
restore it after reset all.

Signed-off-by: Shaohui Xie <redacted>
---
based on http://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc.git,
branch 'for-linus'.

changes for v2:
call the wrapper API instead of access the register directly.

drivers/mmc/host/sdhci.c |    5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index
19ed580..cf6a048 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -214,6 +214,11 @@ static void sdhci_reset(struct sdhci_host *host, u8
mask)

	if (host->quirks & SDHCI_QUIRK_RESTORE_IRQS_AFTER_RESET)
		sdhci_clear_set_irqs(host, SDHCI_INT_ALL_MASK, ier);
+
+	if (host->flags & (SDHCI_USE_SDMA | SDHCI_USE_ADMA)) {
+		if ((host->ops->enable_dma) && (mask & SDHCI_RESET_ALL))
+			host->ops->enable_dma(host);
+	}
}

static void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios);
--
1.6.4

RE: [PATCH][v2] mmc:sdhci: restore the enabled dma when do reset all

From: Xie Shaohui-B21989 <hidden>
Date: 2012-01-11 09:12:09

Hello, Chris,

May I have your attention to this patch, please?


Best Regards,=20
Shaohui Xie=20

-----Original Message-----
From: Xie Shaohui-B21989
Sent: Friday, January 06, 2012 3:58 PM
To: 'cjb@laptop.org'; linux-mmc@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org; Xie Shaohui-B21989
Subject: RE: [PATCH][v2] mmc:sdhci: restore the enabled dma when do reset
all

Hello, Chris,

Do you have any concern for this patch?


Best Regards,
Shaohui Xie
quoted
-----Original Message-----
From: Xie Shaohui-B21989
Sent: Thursday, December 29, 2011 4:33 PM
To: linux-mmc@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org; Xie Shaohui-B21989
Subject: [PATCH][v2] mmc:sdhci: restore the enabled dma when do reset
all

If dma is enabled, it'll be cleared when reset all is performed, this
can be observed on some platforms, such as P2041 which has a version
2.3 controller, but platform like P4080 which has a version 2.2
controller, does not suffer this, so we will check if the dma is
enabled, we should restore it after reset all.

Signed-off-by: Shaohui Xie <redacted>
---
based on http://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc.git,
branch 'for-linus'.

changes for v2:
call the wrapper API instead of access the register directly.

drivers/mmc/host/sdhci.c |    5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index
19ed580..cf6a048 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -214,6 +214,11 @@ static void sdhci_reset(struct sdhci_host *host,
u8
mask)

	if (host->quirks & SDHCI_QUIRK_RESTORE_IRQS_AFTER_RESET)
		sdhci_clear_set_irqs(host, SDHCI_INT_ALL_MASK, ier);
+
+	if (host->flags & (SDHCI_USE_SDMA | SDHCI_USE_ADMA)) {
+		if ((host->ops->enable_dma) && (mask & SDHCI_RESET_ALL))
+			host->ops->enable_dma(host);
+	}
}

static void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios);
--
1.6.4

Re: [PATCH][v2] mmc:sdhci: restore the enabled dma when do reset all

From: Chris Ball <hidden>
Date: 2012-01-11 19:59:13

Hi Shaohui,

On Thu, Dec 29 2011, Shaohui Xie wrote:
quoted hunk
If dma is enabled, it'll be cleared when reset all is performed, this can
be observed on some platforms, such as P2041 which has a version 2.3
controller, but platform like P4080 which has a version 2.2 controller,
does not suffer this, so we will check if the dma is enabled, we should
restore it after reset all.

Signed-off-by: Shaohui Xie <redacted>
---
based on http://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc.git,
branch 'for-linus'.

changes for v2:
call the wrapper API instead of access the register directly.

 drivers/mmc/host/sdhci.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 19ed580..cf6a048 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -214,6 +214,11 @@ static void sdhci_reset(struct sdhci_host *host, u8 mask)
 
 	if (host->quirks & SDHCI_QUIRK_RESTORE_IRQS_AFTER_RESET)
 		sdhci_clear_set_irqs(host, SDHCI_INT_ALL_MASK, ier);
+
+	if (host->flags & (SDHCI_USE_SDMA | SDHCI_USE_ADMA)) {
+		if ((host->ops->enable_dma) && (mask & SDHCI_RESET_ALL))
+			host->ops->enable_dma(host);
+	}
 }
 
 static void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios);
Thanks, I'll merge this for 3.3.

- Chris.
-- 
Chris Ball   [off-list ref]   <http://printf.net/>
One Laptop Per Child
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help