linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/5] mmc: sdhci-esdhc-imx: add runtime pm support
@ 2013-11-04  8:38 Dong Aisheng
  2013-11-04  8:38 ` [PATCH v2 1/5] mmc: sdhci-pltfm: export pltfm suspend/resume api Dong Aisheng
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Dong Aisheng @ 2013-11-04  8:38 UTC (permalink / raw)
  To: linux-mmc; +Cc: linux-arm-kernel, cjb, shawn.guo, s.hauer, b29396, ulf.hansson

We disable root clock in runtime pm to save power.

Patch 2~4 are some fixes needed for enable runtime pm or it may
break the UHS cards(SD3.0/eMMC4.5).

Below are some tests result i ran which passed mmc_test tool after enable rpm:
SDHC UHS1 on imx6q sabreauto
eMMC 4.5 on imx6sl evk
SDXC UHS1 on imx6sl evk
eMMC DDR on imx6q sabresd
SDHC on imx6q sabresd

ChangeLog:
v1->v2: only patch 5 changed. Add pm_runtime_set_active
	based on Ulf's comments.

Dong Aisheng (5):
  mmc: sdhci-pltfm: export pltfm suspend/resume api
  mmc: sdhci-esdhc-imx: tuning bits should not be cleared during reset
  mmc: sdhci-esdhc-imx: clear SDHCI_CTRL_EXEC_TUNING should not affect
    other bits
  mmc: sdhci-esdhc-imx: fix runtime pm unblance issue
  mmc: sdhci-esdhc-imx: add runtime pm support

 drivers/mmc/host/sdhci-esdhc-imx.c |   81 ++++++++++++++++++++++++++++++------
 drivers/mmc/host/sdhci-pltfm.c     |    6 ++-
 drivers/mmc/host/sdhci-pltfm.h     |    2 +
 3 files changed, 74 insertions(+), 15 deletions(-)

-- 
1.7.2.rc3



^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v2 1/5] mmc: sdhci-pltfm: export pltfm suspend/resume api
  2013-11-04  8:38 [PATCH v2 0/5] mmc: sdhci-esdhc-imx: add runtime pm support Dong Aisheng
@ 2013-11-04  8:38 ` Dong Aisheng
  2013-11-04  8:38 ` [PATCH v2 2/5] mmc: sdhci-esdhc-imx: tuning bits should not be cleared during reset Dong Aisheng
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Dong Aisheng @ 2013-11-04  8:38 UTC (permalink / raw)
  To: linux-mmc; +Cc: linux-arm-kernel, cjb, shawn.guo, s.hauer, b29396, ulf.hansson

It is helpful for platforms code to use to elimiate duplicated code.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
---
 drivers/mmc/host/sdhci-pltfm.c |    6 ++++--
 drivers/mmc/host/sdhci-pltfm.h |    2 ++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c
index e2065a4..bef250e 100644
--- a/drivers/mmc/host/sdhci-pltfm.c
+++ b/drivers/mmc/host/sdhci-pltfm.c
@@ -237,19 +237,21 @@ int sdhci_pltfm_unregister(struct platform_device *pdev)
 EXPORT_SYMBOL_GPL(sdhci_pltfm_unregister);
 
 #ifdef CONFIG_PM
-static int sdhci_pltfm_suspend(struct device *dev)
+int sdhci_pltfm_suspend(struct device *dev)
 {
 	struct sdhci_host *host = dev_get_drvdata(dev);
 
 	return sdhci_suspend_host(host);
 }
+EXPORT_SYMBOL_GPL(sdhci_pltfm_suspend);
 
-static int sdhci_pltfm_resume(struct device *dev)
+int sdhci_pltfm_resume(struct device *dev)
 {
 	struct sdhci_host *host = dev_get_drvdata(dev);
 
 	return sdhci_resume_host(host);
 }
+EXPORT_SYMBOL_GPL(sdhci_pltfm_resume);
 
 const struct dev_pm_ops sdhci_pltfm_pmops = {
 	.suspend	= sdhci_pltfm_suspend,
diff --git a/drivers/mmc/host/sdhci-pltfm.h b/drivers/mmc/host/sdhci-pltfm.h
index e15ced79..04bc248 100644
--- a/drivers/mmc/host/sdhci-pltfm.h
+++ b/drivers/mmc/host/sdhci-pltfm.h
@@ -111,6 +111,8 @@ static inline void *sdhci_pltfm_priv(struct sdhci_pltfm_host *host)
 }
 
 #ifdef CONFIG_PM
+extern int sdhci_pltfm_suspend(struct device *dev);
+extern int sdhci_pltfm_resume(struct device *dev);
 extern const struct dev_pm_ops sdhci_pltfm_pmops;
 #define SDHCI_PLTFM_PMOPS (&sdhci_pltfm_pmops)
 #else
-- 
1.7.2.rc3



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v2 2/5] mmc: sdhci-esdhc-imx: tuning bits should not be cleared during reset
  2013-11-04  8:38 [PATCH v2 0/5] mmc: sdhci-esdhc-imx: add runtime pm support Dong Aisheng
  2013-11-04  8:38 ` [PATCH v2 1/5] mmc: sdhci-pltfm: export pltfm suspend/resume api Dong Aisheng
@ 2013-11-04  8:38 ` Dong Aisheng
  2013-11-04  8:38 ` [PATCH v2 3/5] mmc: sdhci-esdhc-imx: clear SDHCI_CTRL_EXEC_TUNING should not affect other bits Dong Aisheng
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Dong Aisheng @ 2013-11-04  8:38 UTC (permalink / raw)
  To: linux-mmc; +Cc: linux-arm-kernel, cjb, shawn.guo, s.hauer, b29396, ulf.hansson

We should not clear tuning bits during reset or the SD3.0/eMMC4.5 card
working on UHS mode may not work after reset since the former tuning
settings was lost.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
---
 drivers/mmc/host/sdhci-esdhc-imx.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index 5816585..f5e1dcf 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -45,6 +45,8 @@
 #define  ESDHC_MIX_CTRL_FBCLK_SEL	(1 << 25)
 /* Bits 3 and 6 are not SDHCI standard definitions */
 #define  ESDHC_MIX_CTRL_SDHCI_MASK	0xb7
+/* Tuning bits */
+#define  ESDHC_MIX_CTRL_TUNING_MASK	0x03c00000
 
 /* dll control register */
 #define ESDHC_DLL_CTRL			0x60
@@ -562,7 +564,10 @@ static void esdhc_writeb_le(struct sdhci_host *host, u8 val, int reg)
 		 * Do it manually here.
 		 */
 		if (esdhc_is_usdhc(imx_data)) {
-			writel(0, host->ioaddr + ESDHC_MIX_CTRL);
+			/* the tuning bits should be kept during reset */
+			new_val = readl(host->ioaddr + ESDHC_MIX_CTRL);
+			writel(new_val & ESDHC_MIX_CTRL_TUNING_MASK,
+					host->ioaddr + ESDHC_MIX_CTRL);
 			imx_data->is_ddr = 0;
 		}
 	}
-- 
1.7.2.rc3



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v2 3/5] mmc: sdhci-esdhc-imx: clear SDHCI_CTRL_EXEC_TUNING should not affect other bits
  2013-11-04  8:38 [PATCH v2 0/5] mmc: sdhci-esdhc-imx: add runtime pm support Dong Aisheng
  2013-11-04  8:38 ` [PATCH v2 1/5] mmc: sdhci-pltfm: export pltfm suspend/resume api Dong Aisheng
  2013-11-04  8:38 ` [PATCH v2 2/5] mmc: sdhci-esdhc-imx: tuning bits should not be cleared during reset Dong Aisheng
@ 2013-11-04  8:38 ` Dong Aisheng
  2013-11-04  8:38 ` [PATCH v2 4/5] mmc: sdhci-esdhc-imx: fix runtime pm unblance issue Dong Aisheng
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Dong Aisheng @ 2013-11-04  8:38 UTC (permalink / raw)
  To: linux-mmc; +Cc: linux-arm-kernel, cjb, shawn.guo, s.hauer, b29396, ulf.hansson

Current code will clear all turning related bits like ESDHC_STD_TUNING_EN
and ESDHC_MIX_CTRL_FBCLK_SEL when clear SDHCI_CTRL_EXEC_TUNING.
This may cause the card which has already passed the turning to become
unwork since the turning status lost.
We observed this failure when enable runtime pm.

BTW, imx needs to enable ESDHC_MIX_CTRL_FBCLK_SEL bit for turned clock.
The FBCLK_SEL will be cleared when SDHCI_CTRL_TUNED_CLK is cleared
and SDHCI_CTRL_EXEC_TUNING is not set.
This is used in case we change to another normal card from a UHS card
in the same slot. FBCLK_SEL is not needed for normal card.

After that, SDHCI_CTRL_EXEC_TUNING will only affect ESDHC_MIX_CTRL_EXE_TUNE.
Clearing it does not affect the turned card to remain working on UHS mode.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
---
 drivers/mmc/host/sdhci-esdhc-imx.c |   24 +++++++++++++-----------
 1 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index f5e1dcf..0bd99eb 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -439,24 +439,20 @@ static void esdhc_writew_le(struct sdhci_host *host, u16 val, int reg)
 		} else if (imx_data->socdata->flags & ESDHC_FLAG_STD_TUNING) {
 			u32 v = readl(host->ioaddr + SDHCI_ACMD12_ERR);
 			u32 m = readl(host->ioaddr + ESDHC_MIX_CTRL);
-			new_val = readl(host->ioaddr + ESDHC_TUNING_CTRL);
+			if (val & SDHCI_CTRL_TUNED_CLK) {
+				v |= ESDHC_MIX_CTRL_SMPCLK_SEL;
+			} else {
+				v &= ~ESDHC_MIX_CTRL_SMPCLK_SEL;
+				m &= ~ESDHC_MIX_CTRL_FBCLK_SEL;
+			}
+
 			if (val & SDHCI_CTRL_EXEC_TUNING) {
-				new_val |= ESDHC_STD_TUNING_EN |
-						ESDHC_TUNING_START_TAP;
 				v |= ESDHC_MIX_CTRL_EXE_TUNE;
 				m |= ESDHC_MIX_CTRL_FBCLK_SEL;
 			} else {
-				new_val &= ~ESDHC_STD_TUNING_EN;
 				v &= ~ESDHC_MIX_CTRL_EXE_TUNE;
-				m &= ~ESDHC_MIX_CTRL_FBCLK_SEL;
 			}
 
-			if (val & SDHCI_CTRL_TUNED_CLK)
-				v |= ESDHC_MIX_CTRL_SMPCLK_SEL;
-			else
-				v &= ~ESDHC_MIX_CTRL_SMPCLK_SEL;
-
-			writel(new_val, host->ioaddr + ESDHC_TUNING_CTRL);
 			writel(v, host->ioaddr + SDHCI_ACMD12_ERR);
 			writel(m, host->ioaddr + ESDHC_MIX_CTRL);
 		}
@@ -1038,6 +1034,12 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev)
 	if (imx_data->socdata->flags & ESDHC_FLAG_MAN_TUNING)
 		sdhci_esdhc_ops.platform_execute_tuning =
 					esdhc_executing_tuning;
+
+	if (imx_data->socdata->flags & ESDHC_FLAG_STD_TUNING)
+		writel(readl(host->ioaddr + ESDHC_TUNING_CTRL) |
+			ESDHC_STD_TUNING_EN | ESDHC_TUNING_START_TAP,
+			host->ioaddr + ESDHC_TUNING_CTRL);
+
 	boarddata = &imx_data->boarddata;
 	if (sdhci_esdhc_imx_probe_dt(pdev, boarddata) < 0) {
 		if (!host->mmc->parent->platform_data) {
-- 
1.7.2.rc3



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v2 4/5] mmc: sdhci-esdhc-imx: fix runtime pm unblance issue
  2013-11-04  8:38 [PATCH v2 0/5] mmc: sdhci-esdhc-imx: add runtime pm support Dong Aisheng
                   ` (2 preceding siblings ...)
  2013-11-04  8:38 ` [PATCH v2 3/5] mmc: sdhci-esdhc-imx: clear SDHCI_CTRL_EXEC_TUNING should not affect other bits Dong Aisheng
@ 2013-11-04  8:38 ` Dong Aisheng
  2013-11-04  8:38 ` [PATCH v2 5/5] mmc: sdhci-esdhc-imx: add runtime pm support Dong Aisheng
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Dong Aisheng @ 2013-11-04  8:38 UTC (permalink / raw)
  To: linux-mmc; +Cc: linux-arm-kernel, cjb, shawn.guo, s.hauer, b29396, ulf.hansson

Since we're using common esdhc_send_command for tuning commands and
the core code will call pm_runtime_put after command is finished.
So we add a pm_runtime_get_sync here to get the blance.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
---
 drivers/mmc/host/sdhci-esdhc-imx.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index 0bd99eb..da8026b 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -698,6 +698,7 @@ static void esdhc_prepare_tuning(struct sdhci_host *host, u32 val)
 	/* FIXME: delay a bit for card to be ready for next tuning due to errors */
 	mdelay(1);
 
+	pm_runtime_get_sync(host->mmc->parent);
 	reg = readl(host->ioaddr + ESDHC_MIX_CTRL);
 	reg |= ESDHC_MIX_CTRL_EXE_TUNE | ESDHC_MIX_CTRL_SMPCLK_SEL |
 			ESDHC_MIX_CTRL_FBCLK_SEL;
-- 
1.7.2.rc3



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v2 5/5] mmc: sdhci-esdhc-imx: add runtime pm support
  2013-11-04  8:38 [PATCH v2 0/5] mmc: sdhci-esdhc-imx: add runtime pm support Dong Aisheng
                   ` (3 preceding siblings ...)
  2013-11-04  8:38 ` [PATCH v2 4/5] mmc: sdhci-esdhc-imx: fix runtime pm unblance issue Dong Aisheng
@ 2013-11-04  8:38 ` Dong Aisheng
  2013-11-04 13:11   ` Ulf Hansson
  2013-11-05  2:03 ` [PATCH v2 0/5] " Shawn Guo
  2013-11-26 22:02 ` Chris Ball
  6 siblings, 1 reply; 10+ messages in thread
From: Dong Aisheng @ 2013-11-04  8:38 UTC (permalink / raw)
  To: linux-mmc; +Cc: linux-arm-kernel, cjb, shawn.guo, s.hauer, b29396, ulf.hansson

The root clock will be disabled in runtime pm which can be used to save power.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
---
 drivers/mmc/host/sdhci-esdhc-imx.c |   49 +++++++++++++++++++++++++++++++++++-
 1 files changed, 48 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index da8026b..6e64981 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -27,6 +27,7 @@
 #include <linux/of_gpio.h>
 #include <linux/pinctrl/consumer.h>
 #include <linux/platform_data/mmc-esdhc-imx.h>
+#include <linux/pm_runtime.h>
 #include "sdhci-pltfm.h"
 #include "sdhci-esdhc.h"
 
@@ -1121,6 +1122,12 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev)
 	if (err)
 		goto disable_clk;
 
+	pm_runtime_set_active(&pdev->dev);
+	pm_runtime_enable(&pdev->dev);
+	pm_runtime_set_autosuspend_delay(&pdev->dev, 50);
+	pm_runtime_use_autosuspend(&pdev->dev);
+	pm_suspend_ignore_children(&pdev->dev, 1);
+
 	return 0;
 
 disable_clk:
@@ -1141,6 +1148,9 @@ static int sdhci_esdhc_imx_remove(struct platform_device *pdev)
 
 	sdhci_remove_host(host, dead);
 
+	pm_runtime_dont_use_autosuspend(&pdev->dev);
+	pm_runtime_disable(&pdev->dev);
+
 	clk_disable_unprepare(imx_data->clk_per);
 	clk_disable_unprepare(imx_data->clk_ipg);
 	clk_disable_unprepare(imx_data->clk_ahb);
@@ -1150,12 +1160,49 @@ static int sdhci_esdhc_imx_remove(struct platform_device *pdev)
 	return 0;
 }
 
+#ifdef CONFIG_PM_RUNTIME
+static int sdhci_esdhc_runtime_suspend(struct device *dev)
+{
+	struct sdhci_host *host = dev_get_drvdata(dev);
+	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
+	struct pltfm_imx_data *imx_data = pltfm_host->priv;
+	int ret;
+
+	ret = sdhci_runtime_suspend_host(host);
+
+	clk_disable_unprepare(imx_data->clk_per);
+	clk_disable_unprepare(imx_data->clk_ipg);
+	clk_disable_unprepare(imx_data->clk_ahb);
+
+	return ret;
+}
+
+static int sdhci_esdhc_runtime_resume(struct device *dev)
+{
+	struct sdhci_host *host = dev_get_drvdata(dev);
+	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
+	struct pltfm_imx_data *imx_data = pltfm_host->priv;
+
+	clk_prepare_enable(imx_data->clk_per);
+	clk_prepare_enable(imx_data->clk_ipg);
+	clk_prepare_enable(imx_data->clk_ahb);
+
+	return sdhci_runtime_resume_host(host);
+}
+#endif
+
+static const struct dev_pm_ops sdhci_esdhc_pmops = {
+	SET_SYSTEM_SLEEP_PM_OPS(sdhci_pltfm_suspend, sdhci_pltfm_resume)
+	SET_RUNTIME_PM_OPS(sdhci_esdhc_runtime_suspend,
+				sdhci_esdhc_runtime_resume, NULL)
+};
+
 static struct platform_driver sdhci_esdhc_imx_driver = {
 	.driver		= {
 		.name	= "sdhci-esdhc-imx",
 		.owner	= THIS_MODULE,
 		.of_match_table = imx_esdhc_dt_ids,
-		.pm	= SDHCI_PLTFM_PMOPS,
+		.pm	= &sdhci_esdhc_pmops,
 	},
 	.id_table	= imx_esdhc_devtype,
 	.probe		= sdhci_esdhc_imx_probe,
-- 
1.7.2.rc3



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 5/5] mmc: sdhci-esdhc-imx: add runtime pm support
  2013-11-04  8:38 ` [PATCH v2 5/5] mmc: sdhci-esdhc-imx: add runtime pm support Dong Aisheng
@ 2013-11-04 13:11   ` Ulf Hansson
  0 siblings, 0 replies; 10+ messages in thread
From: Ulf Hansson @ 2013-11-04 13:11 UTC (permalink / raw)
  To: Dong Aisheng
  Cc: linux-mmc, linux-arm-kernel@lists.infradead.org, Chris Ball,
	Shawn Guo, Sascha Hauer

On 4 November 2013 09:38, Dong Aisheng <b29396@freescale.com> wrote:
> The root clock will be disabled in runtime pm which can be used to save power.
>
> Signed-off-by: Dong Aisheng <b29396@freescale.com>

Acked-by: Ulf Hansson <ulf.hansson@linaro.org>

> ---
>  drivers/mmc/host/sdhci-esdhc-imx.c |   49 +++++++++++++++++++++++++++++++++++-
>  1 files changed, 48 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
> index da8026b..6e64981 100644
> --- a/drivers/mmc/host/sdhci-esdhc-imx.c
> +++ b/drivers/mmc/host/sdhci-esdhc-imx.c
> @@ -27,6 +27,7 @@
>  #include <linux/of_gpio.h>
>  #include <linux/pinctrl/consumer.h>
>  #include <linux/platform_data/mmc-esdhc-imx.h>
> +#include <linux/pm_runtime.h>
>  #include "sdhci-pltfm.h"
>  #include "sdhci-esdhc.h"
>
> @@ -1121,6 +1122,12 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev)
>         if (err)
>                 goto disable_clk;
>
> +       pm_runtime_set_active(&pdev->dev);
> +       pm_runtime_enable(&pdev->dev);
> +       pm_runtime_set_autosuspend_delay(&pdev->dev, 50);
> +       pm_runtime_use_autosuspend(&pdev->dev);
> +       pm_suspend_ignore_children(&pdev->dev, 1);
> +
>         return 0;
>
>  disable_clk:
> @@ -1141,6 +1148,9 @@ static int sdhci_esdhc_imx_remove(struct platform_device *pdev)
>
>         sdhci_remove_host(host, dead);
>
> +       pm_runtime_dont_use_autosuspend(&pdev->dev);
> +       pm_runtime_disable(&pdev->dev);
> +
>         clk_disable_unprepare(imx_data->clk_per);
>         clk_disable_unprepare(imx_data->clk_ipg);
>         clk_disable_unprepare(imx_data->clk_ahb);
> @@ -1150,12 +1160,49 @@ static int sdhci_esdhc_imx_remove(struct platform_device *pdev)
>         return 0;
>  }
>
> +#ifdef CONFIG_PM_RUNTIME
> +static int sdhci_esdhc_runtime_suspend(struct device *dev)
> +{
> +       struct sdhci_host *host = dev_get_drvdata(dev);
> +       struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
> +       struct pltfm_imx_data *imx_data = pltfm_host->priv;
> +       int ret;
> +
> +       ret = sdhci_runtime_suspend_host(host);
> +
> +       clk_disable_unprepare(imx_data->clk_per);
> +       clk_disable_unprepare(imx_data->clk_ipg);
> +       clk_disable_unprepare(imx_data->clk_ahb);
> +
> +       return ret;
> +}
> +
> +static int sdhci_esdhc_runtime_resume(struct device *dev)
> +{
> +       struct sdhci_host *host = dev_get_drvdata(dev);
> +       struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
> +       struct pltfm_imx_data *imx_data = pltfm_host->priv;
> +
> +       clk_prepare_enable(imx_data->clk_per);
> +       clk_prepare_enable(imx_data->clk_ipg);
> +       clk_prepare_enable(imx_data->clk_ahb);
> +
> +       return sdhci_runtime_resume_host(host);
> +}
> +#endif
> +
> +static const struct dev_pm_ops sdhci_esdhc_pmops = {
> +       SET_SYSTEM_SLEEP_PM_OPS(sdhci_pltfm_suspend, sdhci_pltfm_resume)
> +       SET_RUNTIME_PM_OPS(sdhci_esdhc_runtime_suspend,
> +                               sdhci_esdhc_runtime_resume, NULL)
> +};
> +
>  static struct platform_driver sdhci_esdhc_imx_driver = {
>         .driver         = {
>                 .name   = "sdhci-esdhc-imx",
>                 .owner  = THIS_MODULE,
>                 .of_match_table = imx_esdhc_dt_ids,
> -               .pm     = SDHCI_PLTFM_PMOPS,
> +               .pm     = &sdhci_esdhc_pmops,
>         },
>         .id_table       = imx_esdhc_devtype,
>         .probe          = sdhci_esdhc_imx_probe,
> --
> 1.7.2.rc3
>
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 0/5] mmc: sdhci-esdhc-imx: add runtime pm support
  2013-11-04  8:38 [PATCH v2 0/5] mmc: sdhci-esdhc-imx: add runtime pm support Dong Aisheng
                   ` (4 preceding siblings ...)
  2013-11-04  8:38 ` [PATCH v2 5/5] mmc: sdhci-esdhc-imx: add runtime pm support Dong Aisheng
@ 2013-11-05  2:03 ` Shawn Guo
  2013-11-13 11:18   ` Dong Aisheng
  2013-11-26 22:02 ` Chris Ball
  6 siblings, 1 reply; 10+ messages in thread
From: Shawn Guo @ 2013-11-05  2:03 UTC (permalink / raw)
  To: Dong Aisheng; +Cc: linux-mmc, linux-arm-kernel, cjb, s.hauer, ulf.hansson

On Mon, Nov 04, 2013 at 04:38:24PM +0800, Dong Aisheng wrote:
> We disable root clock in runtime pm to save power.
> 
> Patch 2~4 are some fixes needed for enable runtime pm or it may
> break the UHS cards(SD3.0/eMMC4.5).
> 
> Below are some tests result i ran which passed mmc_test tool after enable rpm:
> SDHC UHS1 on imx6q sabreauto
> eMMC 4.5 on imx6sl evk
> SDXC UHS1 on imx6sl evk
> eMMC DDR on imx6q sabresd
> SDHC on imx6q sabresd
> 
> ChangeLog:
> v1->v2: only patch 5 changed. Add pm_runtime_set_active
> 	based on Ulf's comments.
> 
> Dong Aisheng (5):
>   mmc: sdhci-pltfm: export pltfm suspend/resume api
>   mmc: sdhci-esdhc-imx: tuning bits should not be cleared during reset
>   mmc: sdhci-esdhc-imx: clear SDHCI_CTRL_EXEC_TUNING should not affect
>     other bits
>   mmc: sdhci-esdhc-imx: fix runtime pm unblance issue
>   mmc: sdhci-esdhc-imx: add runtime pm support

For the series,

Acked-by: Shawn Guo <shawn.guo@linaro.org>


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 0/5] mmc: sdhci-esdhc-imx: add runtime pm support
  2013-11-05  2:03 ` [PATCH v2 0/5] " Shawn Guo
@ 2013-11-13 11:18   ` Dong Aisheng
  0 siblings, 0 replies; 10+ messages in thread
From: Dong Aisheng @ 2013-11-13 11:18 UTC (permalink / raw)
  To: Shawn Guo
  Cc: Dong Aisheng, Sascha Hauer, Chris Ball, linux-mmc@vger.kernel.org,
	Ulf Hansson, linux-arm-kernel@lists.infradead.org

Hi Chris,

On Tue, Nov 5, 2013 at 10:03 AM, Shawn Guo <shawn.guo@linaro.org> wrote:
> On Mon, Nov 04, 2013 at 04:38:24PM +0800, Dong Aisheng wrote:
>> We disable root clock in runtime pm to save power.
>>
>> Patch 2~4 are some fixes needed for enable runtime pm or it may
>> break the UHS cards(SD3.0/eMMC4.5).
>>
>> Below are some tests result i ran which passed mmc_test tool after enable rpm:
>> SDHC UHS1 on imx6q sabreauto
>> eMMC 4.5 on imx6sl evk
>> SDXC UHS1 on imx6sl evk
>> eMMC DDR on imx6q sabresd
>> SDHC on imx6q sabresd
>>
>> ChangeLog:
>> v1->v2: only patch 5 changed. Add pm_runtime_set_active
>>       based on Ulf's comments.
>>
>> Dong Aisheng (5):
>>   mmc: sdhci-pltfm: export pltfm suspend/resume api
>>   mmc: sdhci-esdhc-imx: tuning bits should not be cleared during reset
>>   mmc: sdhci-esdhc-imx: clear SDHCI_CTRL_EXEC_TUNING should not affect
>>     other bits
>>   mmc: sdhci-esdhc-imx: fix runtime pm unblance issue
>>   mmc: sdhci-esdhc-imx: add runtime pm support
>
> For the series,
>
> Acked-by: Shawn Guo <shawn.guo@linaro.org>
>

Would you help pick this series with Ulf's ack?

Regards
Dong Aisheng

>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 0/5] mmc: sdhci-esdhc-imx: add runtime pm support
  2013-11-04  8:38 [PATCH v2 0/5] mmc: sdhci-esdhc-imx: add runtime pm support Dong Aisheng
                   ` (5 preceding siblings ...)
  2013-11-05  2:03 ` [PATCH v2 0/5] " Shawn Guo
@ 2013-11-26 22:02 ` Chris Ball
  6 siblings, 0 replies; 10+ messages in thread
From: Chris Ball @ 2013-11-26 22:02 UTC (permalink / raw)
  To: Dong Aisheng; +Cc: linux-mmc, linux-arm-kernel, shawn.guo, s.hauer, ulf.hansson

Hi Dong,

On Mon, Nov 04 2013, Dong Aisheng wrote:
> We disable root clock in runtime pm to save power.
>
> Patch 2~4 are some fixes needed for enable runtime pm or it may
> break the UHS cards(SD3.0/eMMC4.5).
>
> Below are some tests result i ran which passed mmc_test tool after enable rpm:
> SDHC UHS1 on imx6q sabreauto
> eMMC 4.5 on imx6sl evk
> SDXC UHS1 on imx6sl evk
> eMMC DDR on imx6q sabresd
> SDHC on imx6q sabresd
>
> ChangeLog:
> v1->v2: only patch 5 changed. Add pm_runtime_set_active
> 	based on Ulf's comments.
>
> Dong Aisheng (5):
>   mmc: sdhci-pltfm: export pltfm suspend/resume api
>   mmc: sdhci-esdhc-imx: tuning bits should not be cleared during reset
>   mmc: sdhci-esdhc-imx: clear SDHCI_CTRL_EXEC_TUNING should not affect
>     other bits
>   mmc: sdhci-esdhc-imx: fix runtime pm unblance issue
>   mmc: sdhci-esdhc-imx: add runtime pm support

Thanks, all pushed to mmc-next for 3.14.

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-11-26 22:02 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-04  8:38 [PATCH v2 0/5] mmc: sdhci-esdhc-imx: add runtime pm support Dong Aisheng
2013-11-04  8:38 ` [PATCH v2 1/5] mmc: sdhci-pltfm: export pltfm suspend/resume api Dong Aisheng
2013-11-04  8:38 ` [PATCH v2 2/5] mmc: sdhci-esdhc-imx: tuning bits should not be cleared during reset Dong Aisheng
2013-11-04  8:38 ` [PATCH v2 3/5] mmc: sdhci-esdhc-imx: clear SDHCI_CTRL_EXEC_TUNING should not affect other bits Dong Aisheng
2013-11-04  8:38 ` [PATCH v2 4/5] mmc: sdhci-esdhc-imx: fix runtime pm unblance issue Dong Aisheng
2013-11-04  8:38 ` [PATCH v2 5/5] mmc: sdhci-esdhc-imx: add runtime pm support Dong Aisheng
2013-11-04 13:11   ` Ulf Hansson
2013-11-05  2:03 ` [PATCH v2 0/5] " Shawn Guo
2013-11-13 11:18   ` Dong Aisheng
2013-11-26 22:02 ` Chris Ball

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).