From c15493bc30678d80640848f42a60b7892ce0b02c Mon Sep 17 00:00:00 2001 From: Maximilian Attems Date: Sun, 6 Jul 2008 09:50:26 +0000 Subject: [PATCH] sdhci fixes for olpc by dilinger landed upstream nuke them svn path=/dists/trunk/linux-2.6/; revision=11799 --- .../sdhci-quirk-marvell-cafe-interrupt.patch | 66 ---------------- ...sdhci-quirk-marvell-cafe-vdd-powerup.patch | 78 ------------------- debian/patches/series/1~experimental.1 | 2 - 3 files changed, 146 deletions(-) delete mode 100644 debian/patches/bugfix/all/sdhci-quirk-marvell-cafe-interrupt.patch delete mode 100644 debian/patches/bugfix/all/sdhci-quirk-marvell-cafe-vdd-powerup.patch diff --git a/debian/patches/bugfix/all/sdhci-quirk-marvell-cafe-interrupt.patch b/debian/patches/bugfix/all/sdhci-quirk-marvell-cafe-interrupt.patch deleted file mode 100644 index 79ca0db56..000000000 --- a/debian/patches/bugfix/all/sdhci-quirk-marvell-cafe-interrupt.patch +++ /dev/null @@ -1,66 +0,0 @@ - -The CaFe chip has a hardware bug that ends up with us getting a timeout -value that's too small, causing the following sorts of problems: - -[ 60.525138] mmcblk0: error -110 transferring data -[ 60.531477] end_request: I/O error, dev mmcblk0, sector 1484353 -[ 60.533371] Buffer I/O error on device mmcblk0p2, logical block 181632 -[ 60.533371] lost page write due to I/O error on mmcblk0p2 - -Presumably this is an off-by-one error in the hardware. Incrementing -the timeout count value that we stuff into the TIMEOUT_CONTROL register -gets us a value that works. This bug was originally discovered by -Pierre Ossman, I believe. - -[thanks to Robert Millan for proving that this was still a problem] - -Signed-off-by: Andres Salomon ---- - drivers/mmc/host/sdhci.c | 12 +++++++++++- - 1 files changed, 11 insertions(+), 1 deletions(-) - -diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c -index 5b74c8c..2b3f06a 100644 ---- a/drivers/mmc/host/sdhci.c -+++ b/drivers/mmc/host/sdhci.c -@@ -57,6 +57,8 @@ static unsigned int debug_quirks = 0; - #define SDHCI_QUIRK_RESET_AFTER_REQUEST (1<<8) - /* Controller needs voltage and power writes to happen separately */ - #define SDHCI_QUIRK_NO_SIMULT_VDD_AND_POWER (1<<9) -+/* Controller has an off-by-one issue with timeout value */ -+#define SDHCI_QUIRK_INCR_TIMEOUT_CONTROL (1<<10) - - static const struct pci_device_id pci_ids[] __devinitdata = { - { -@@ -134,7 +136,8 @@ static const struct pci_device_id pci_ids[] __devinitdata = { - .device = PCI_DEVICE_ID_MARVELL_CAFE_SD, - .subvendor = PCI_ANY_ID, - .subdevice = PCI_ANY_ID, -- .driver_data = SDHCI_QUIRK_NO_SIMULT_VDD_AND_POWER, -+ .driver_data = SDHCI_QUIRK_NO_SIMULT_VDD_AND_POWER | -+ SDHCI_QUIRK_INCR_TIMEOUT_CONTROL, - }, - - { -@@ -479,6 +482,13 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_data *data) - break; - } - -+ /* -+ * Compensate for an off-by-one error in the CaFe hardware; otherwise, -+ * a too-small count gives us interrupt timeouts. -+ */ -+ if ((host->chip->quirks & SDHCI_QUIRK_INCR_TIMEOUT_CONTROL)) -+ count++; -+ - if (count >= 0xF) { - printk(KERN_WARNING "%s: Too large timeout requested!\n", - mmc_hostname(host->mmc)); --- -1.5.5.3 - --- -To unsubscribe from this list: send the line "unsubscribe linux-kernel" in -the body of a message to majordomo@vger.kernel.org -More majordomo info at http://vger.kernel.org/majordomo-info.html -Please read the FAQ at http://www.tux.org/lkml/ \ No newline at end of file diff --git a/debian/patches/bugfix/all/sdhci-quirk-marvell-cafe-vdd-powerup.patch b/debian/patches/bugfix/all/sdhci-quirk-marvell-cafe-vdd-powerup.patch deleted file mode 100644 index e5d822f83..000000000 --- a/debian/patches/bugfix/all/sdhci-quirk-marvell-cafe-vdd-powerup.patch +++ /dev/null @@ -1,78 +0,0 @@ -This has been sitting around unloved for way too long.. - -The Marvell CaFe chip's SD implementation chokes during card insertion -if one attempts to set the voltage and power up in the same -SDHCI_POWER_CONTROL register write. This adds a quirk that does -that particular dance in two steps. - -It also adds an entry to pci_ids.h for the CaFe chip's SD device. - -Signed-off-by: Andres Salomon ---- - drivers/mmc/host/sdhci.c | 18 ++++++++++++++++++ - include/linux/pci_ids.h | 1 + - 2 files changed, 19 insertions(+), 0 deletions(-) - -diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c -index 07c2048..5b74c8c 100644 ---- a/drivers/mmc/host/sdhci.c -+++ b/drivers/mmc/host/sdhci.c -@@ -55,6 +55,8 @@ static unsigned int debug_quirks = 0; - #define SDHCI_QUIRK_32BIT_DMA_SIZE (1<<7) - /* Controller needs to be reset after each request to stay stable */ - #define SDHCI_QUIRK_RESET_AFTER_REQUEST (1<<8) -+/* Controller needs voltage and power writes to happen separately */ -+#define SDHCI_QUIRK_NO_SIMULT_VDD_AND_POWER (1<<9) - - static const struct pci_device_id pci_ids[] __devinitdata = { - { -@@ -128,6 +130,14 @@ static const struct pci_device_id pci_ids[] __devinitdata = { - }, - - { -+ .vendor = PCI_VENDOR_ID_MARVELL, -+ .device = PCI_DEVICE_ID_MARVELL_CAFE_SD, -+ .subvendor = PCI_ANY_ID, -+ .subdevice = PCI_ANY_ID, -+ .driver_data = SDHCI_QUIRK_NO_SIMULT_VDD_AND_POWER, -+ }, -+ -+ { - .vendor = PCI_VENDOR_ID_JMICRON, - .device = PCI_DEVICE_ID_JMICRON_JMB38X_SD, - .subvendor = PCI_ANY_ID, -@@ -774,6 +784,14 @@ static void sdhci_set_power(struct sdhci_host *host, unsigned short power) - BUG(); - } - -+ /* -+ * At least the CaFe chip gets confused if we set the voltage -+ * and set turn on power at the same time, so set the voltage first. -+ */ -+ if ((host->chip->quirks & SDHCI_QUIRK_NO_SIMULT_VDD_AND_POWER)) -+ writeb(pwr & ~SDHCI_POWER_ON, -+ host->ioaddr + SDHCI_POWER_CONTROL); -+ - writeb(pwr, host->ioaddr + SDHCI_POWER_CONTROL); - - out: -diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h -index eafc9d6..6595382 100644 ---- a/include/linux/pci_ids.h -+++ b/include/linux/pci_ids.h -@@ -1520,6 +1520,7 @@ - #define PCI_DEVICE_ID_MARVELL_GT64260 0x6430 - #define PCI_DEVICE_ID_MARVELL_MV64360 0x6460 - #define PCI_DEVICE_ID_MARVELL_MV64460 0x6480 -+#define PCI_DEVICE_ID_MARVELL_CAFE_SD 0x4101 - - #define PCI_VENDOR_ID_V3 0x11b0 - #define PCI_DEVICE_ID_V3_V960 0x0001 --- -1.5.5.3 - --- -To unsubscribe from this list: send the line "unsubscribe linux-kernel" in -the body of a message to majordomo@vger.kernel.org -More majordomo info at http://vger.kernel.org/majordomo-info.html -Please read the FAQ at http://www.tux.org/lkml/ \ No newline at end of file diff --git a/debian/patches/series/1~experimental.1 b/debian/patches/series/1~experimental.1 index 7814326e9..8769a60e8 100644 --- a/debian/patches/series/1~experimental.1 +++ b/debian/patches/series/1~experimental.1 @@ -49,5 +49,3 @@ + bugfix/fix-hifn_795X-divdi3.patch + bugfix/all/mtd-prevent-physmap-from-causing-request_module-runaway-loop-modprobe-net-pf-1.patch #+ features/all/0001-iwlwifi-Set-monitor-mode-for-3945.patch -#+ bugfix/all/sdhci-quirk-marvell-cafe-vdd-powerup.patch -#+ bugfix/all/sdhci-quirk-marvell-cafe-interrupt.patch