linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mmc: rtsx: add card power off during probe
@ 2014-09-12  1:39 micky_ching
  2014-09-16 18:01 ` Ulf Hansson
  0 siblings, 1 reply; 9+ messages in thread
From: micky_ching @ 2014-09-12  1:39 UTC (permalink / raw)
  To: chris, ulf.hansson, sameo
  Cc: gregkh, dan.carpenter, devel, linux-kernel, linux-mmc, rogerable,
	wei_wang, Micky Ching

From: Roger Tseng <rogerable@realtek.com>

Some platform have both UEFI driver and MFD/mmc driver, if entering
linux while card in the slot, the card power is already on, and rtsx-mmc
driver have no chance to make card power off. This will lead UHSI card
failed to enter UHSI mode.

It is hard to control the UEFI driver leaving state, so we power off the
card power during probe.

Signed-off-by: Roger Tseng <rogerable@realtek.com>
Signed-off-by: Micky Ching <micky_ching@realsil.com.cn>
---
 drivers/mmc/host/rtsx_pci_sdmmc.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/rtsx_pci_sdmmc.c b/drivers/mmc/host/rtsx_pci_sdmmc.c
index dfde4a2..57b0796 100644
--- a/drivers/mmc/host/rtsx_pci_sdmmc.c
+++ b/drivers/mmc/host/rtsx_pci_sdmmc.c
@@ -1341,8 +1341,13 @@ static int rtsx_pci_sdmmc_drv_probe(struct platform_device *pdev)
 	host->pcr = pcr;
 	host->mmc = mmc;
 	host->pdev = pdev;
-	host->power_state = SDMMC_POWER_OFF;
 	INIT_WORK(&host->work, sd_request);
+	sd_power_off(host);
+	/*
+	 * ref: SD spec 3.01: 6.4.1.2 Power On or Power Cycle
+	 */
+	usleep_range(1000, 2000);
+
 	platform_set_drvdata(pdev, host);
 	pcr->slots[RTSX_SD_CARD].p_dev = pdev;
 	pcr->slots[RTSX_SD_CARD].card_event = rtsx_pci_sdmmc_card_event;
-- 
1.7.9.5


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

end of thread, other threads:[~2014-09-23 19:51 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-12  1:39 [PATCH] mmc: rtsx: add card power off during probe micky_ching
2014-09-16 18:01 ` Ulf Hansson
2014-09-17  9:11   ` micky
2014-09-17 19:29     ` Ulf Hansson
2014-09-18  7:19       ` Roger Tseng
2014-09-18 21:14         ` Ulf Hansson
2014-09-22 10:09           ` Roger Tseng
2014-09-23  9:20             ` Ulf Hansson
2014-09-23 19:51               ` Adrian Hunter

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).