public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] MMC: Add 400ms to CAFE SD controller resume path
@ 2009-05-13 20:05 Deepak Saxena
  2009-05-22 11:51 ` Pierre Ossman
  0 siblings, 1 reply; 6+ messages in thread
From: Deepak Saxena @ 2009-05-13 20:05 UTC (permalink / raw)
  To: pierre; +Cc: linux-kernel


The CAFE SD controller takes a long time to completely resume
and w/o this patch, we do not redetect an existing card but
instead detect it as a new one. Even with MMC_UNSAFE_RESUME
enabled, this leads to the partition table on the device being
wiped out.
    
See http://dev.laptop.org/ticket/6532 for gory details.

Signed-off-by: Deepak Saxena <dsaxena@laptop.org>

---

diff --git a/drivers/mmc/host/sdhci-pci.c b/drivers/mmc/host/sdhci-pci.c
index 65be279..9941bb0 100644
--- a/drivers/mmc/host/sdhci-pci.c
+++ b/drivers/mmc/host/sdhci-pci.c
@@ -105,10 +105,26 @@ static const struct sdhci_pci_fixes sdhci_ene_714 = {
 			  SDHCI_QUIRK_BROKEN_DMA,
 };
 
+
+/*
+ * This 400ms timeout is needed to ensure that the chip has proper time to
+ * wake up an redetect an already inserted card. Without this, we end up
+ * corrupting the partition table on the device.
+ *
+ * See http://dev.laptop.org/ticket/6532 for lots of ugly details.
+ */
+static int cafe_resume(struct sdhci_pci_chip *chip)
+{
+	msleep(400);
+
+	return 0;
+}
+
 static const struct sdhci_pci_fixes sdhci_cafe = {
 	.quirks		= SDHCI_QUIRK_NO_SIMULT_VDD_AND_POWER |
 			  SDHCI_QUIRK_NO_BUSY_IRQ |
 			  SDHCI_QUIRK_BROKEN_TIMEOUT_VAL,
+	.resume		= cafe_resume,
 };
 
 static int jmicron_pmos(struct sdhci_pci_chip *chip, int on)


-- 
In the end, they will not say, "those were dark times,"  they will ask
"why were their poets silent?" - Bertold Brecht


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

end of thread, other threads:[~2009-06-13 10:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-13 20:05 [PATCH] MMC: Add 400ms to CAFE SD controller resume path Deepak Saxena
2009-05-22 11:51 ` Pierre Ossman
2009-05-28  8:36   ` Andrew Morton
2009-05-28  8:48     ` Pierre Ossman
2009-06-04 23:33       ` Deepak Saxena
2009-06-13 10:34         ` Pierre Ossman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox