All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: core: Invoke mmc_pwrseq_post_power_on() prior MMC_POWER_ON state
@ 2015-02-02 16:00 ` Ulf Hansson
  0 siblings, 0 replies; 4+ messages in thread
From: Ulf Hansson @ 2015-02-02 16:00 UTC (permalink / raw)
  To: linux-mmc, Chris Ball
  Cc: linux-arm-kernel, Arend van Spriel, Sascha Hauer, Olof Johansson,
	Russell King, Hans de Goede, Doug Anderson, NeilBrown,
	Tomeu Vizoso, Javier Martinez Canillas, Ulf Hansson

Host drivers have different ways to sends their "init stream" to the
card. Some need to do it as part of a request, some do it from the
->set_ios() callback in the MMC_POWER_ON state and some don't send an
"init stream" at all.

To be able to use the reset GPIOs from the simple MMC power sequence
provider, the card need to be powered and the "init stream" must not
have been sent.

To cope with these requirements, invoke mmc_pwrseq_post_power_on()
prior we change the state to MMC_POWER_ON in mmc_power_up().

Host drivers shall perform power up operations in the MMC_POWER_UP
state. Unfortunate three hosts (au1xmmc, cb710-mmc and toshsd) don't
conform to this expectation. Instead those ignore the MMC_POWER_UP
state and delays their power up operations to the MMC_POWER_ON state.

Those hosts needs to change their behavior to enable proper support for
the simple MMC power sequence provider.

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

Some background to this patch:
http://marc.info/?t=142165904000001&r=1&w=2

---
 drivers/mmc/core/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 0dc64e6..23f10f7 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -1637,6 +1637,8 @@ void mmc_power_up(struct mmc_host *host, u32 ocr)
 	 */
 	mmc_delay(10);
 
+	mmc_pwrseq_post_power_on(host);
+
 	host->ios.clock = host->f_init;
 
 	host->ios.power_mode = MMC_POWER_ON;
@@ -1648,8 +1650,6 @@ void mmc_power_up(struct mmc_host *host, u32 ocr)
 	 */
 	mmc_delay(10);
 
-	mmc_pwrseq_post_power_on(host);
-
 	mmc_host_clk_release(host);
 }
 
-- 
1.9.1


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

* [PATCH] mmc: core: Invoke mmc_pwrseq_post_power_on() prior MMC_POWER_ON state
@ 2015-02-02 16:00 ` Ulf Hansson
  0 siblings, 0 replies; 4+ messages in thread
From: Ulf Hansson @ 2015-02-02 16:00 UTC (permalink / raw)
  To: linux-arm-kernel

Host drivers have different ways to sends their "init stream" to the
card. Some need to do it as part of a request, some do it from the
->set_ios() callback in the MMC_POWER_ON state and some don't send an
"init stream" at all.

To be able to use the reset GPIOs from the simple MMC power sequence
provider, the card need to be powered and the "init stream" must not
have been sent.

To cope with these requirements, invoke mmc_pwrseq_post_power_on()
prior we change the state to MMC_POWER_ON in mmc_power_up().

Host drivers shall perform power up operations in the MMC_POWER_UP
state. Unfortunate three hosts (au1xmmc, cb710-mmc and toshsd) don't
conform to this expectation. Instead those ignore the MMC_POWER_UP
state and delays their power up operations to the MMC_POWER_ON state.

Those hosts needs to change their behavior to enable proper support for
the simple MMC power sequence provider.

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

Some background to this patch:
http://marc.info/?t=142165904000001&r=1&w=2

---
 drivers/mmc/core/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 0dc64e6..23f10f7 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -1637,6 +1637,8 @@ void mmc_power_up(struct mmc_host *host, u32 ocr)
 	 */
 	mmc_delay(10);
 
+	mmc_pwrseq_post_power_on(host);
+
 	host->ios.clock = host->f_init;
 
 	host->ios.power_mode = MMC_POWER_ON;
@@ -1648,8 +1650,6 @@ void mmc_power_up(struct mmc_host *host, u32 ocr)
 	 */
 	mmc_delay(10);
 
-	mmc_pwrseq_post_power_on(host);
-
 	mmc_host_clk_release(host);
 }
 
-- 
1.9.1

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

* Re: [PATCH] mmc: core: Invoke mmc_pwrseq_post_power_on() prior MMC_POWER_ON state
  2015-02-02 16:00 ` Ulf Hansson
@ 2015-02-02 19:00   ` Javier Martinez Canillas
  -1 siblings, 0 replies; 4+ messages in thread
From: Javier Martinez Canillas @ 2015-02-02 19:00 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: linux-mmc, Chris Ball, linux-arm-kernel, Arend van Spriel,
	Sascha Hauer, Olof Johansson, Russell King, Hans de Goede,
	Doug Anderson, NeilBrown, Tomeu Vizoso

Hello Ulf,

On Mon, Feb 2, 2015 at 5:00 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> Host drivers have different ways to sends their "init stream" to the
> card. Some need to do it as part of a request, some do it from the
> ->set_ios() callback in the MMC_POWER_ON state and some don't send an
> "init stream" at all.
>
> To be able to use the reset GPIOs from the simple MMC power sequence
> provider, the card need to be powered and the "init stream" must not
> have been sent.
>
> To cope with these requirements, invoke mmc_pwrseq_post_power_on()
> prior we change the state to MMC_POWER_ON in mmc_power_up().
>
> Host drivers shall perform power up operations in the MMC_POWER_UP
> state. Unfortunate three hosts (au1xmmc, cb710-mmc and toshsd) don't
> conform to this expectation. Instead those ignore the MMC_POWER_UP
> state and delays their power up operations to the MMC_POWER_ON state.
>
> Those hosts needs to change their behavior to enable proper support for
> the simple MMC power sequence provider.
>
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

The patch looks good to me and I tested that the WLAN chip attached to
the SDIO interface in my Exynos5250 Snow Chromebook is reset / powered
up correctly so:

Reviewed-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Tested-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>

Best regards,
Javier

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

* [PATCH] mmc: core: Invoke mmc_pwrseq_post_power_on() prior MMC_POWER_ON state
@ 2015-02-02 19:00   ` Javier Martinez Canillas
  0 siblings, 0 replies; 4+ messages in thread
From: Javier Martinez Canillas @ 2015-02-02 19:00 UTC (permalink / raw)
  To: linux-arm-kernel

Hello Ulf,

On Mon, Feb 2, 2015 at 5:00 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> Host drivers have different ways to sends their "init stream" to the
> card. Some need to do it as part of a request, some do it from the
> ->set_ios() callback in the MMC_POWER_ON state and some don't send an
> "init stream" at all.
>
> To be able to use the reset GPIOs from the simple MMC power sequence
> provider, the card need to be powered and the "init stream" must not
> have been sent.
>
> To cope with these requirements, invoke mmc_pwrseq_post_power_on()
> prior we change the state to MMC_POWER_ON in mmc_power_up().
>
> Host drivers shall perform power up operations in the MMC_POWER_UP
> state. Unfortunate three hosts (au1xmmc, cb710-mmc and toshsd) don't
> conform to this expectation. Instead those ignore the MMC_POWER_UP
> state and delays their power up operations to the MMC_POWER_ON state.
>
> Those hosts needs to change their behavior to enable proper support for
> the simple MMC power sequence provider.
>
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

The patch looks good to me and I tested that the WLAN chip attached to
the SDIO interface in my Exynos5250 Snow Chromebook is reset / powered
up correctly so:

Reviewed-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Tested-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>

Best regards,
Javier

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

end of thread, other threads:[~2015-02-02 19:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-02 16:00 [PATCH] mmc: core: Invoke mmc_pwrseq_post_power_on() prior MMC_POWER_ON state Ulf Hansson
2015-02-02 16:00 ` Ulf Hansson
2015-02-02 19:00 ` Javier Martinez Canillas
2015-02-02 19:00   ` Javier Martinez Canillas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.