aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/s3c24xx/patches-2.6.26/1082-fix-glamo-mci-defeat-ops-during-suspend.patch.patch
diff options
context:
space:
mode:
authorMirko Vogt <mirko@openwrt.org>2008-12-13 01:54:56 +0000
committerMirko Vogt <mirko@openwrt.org>2008-12-13 01:54:56 +0000
commitc931b21161bf3d8a8cab193045b7deb52f914fb2 (patch)
tree6f4c70017b90c8dddb4845ce8a363d61268e016d /target/linux/s3c24xx/patches-2.6.26/1082-fix-glamo-mci-defeat-ops-during-suspend.patch.patch
parent738e5ca558af0a32073576d9a361d0b5e6383e8e (diff)
downloadupstream-c931b21161bf3d8a8cab193045b7deb52f914fb2.tar.gz
upstream-c931b21161bf3d8a8cab193045b7deb52f914fb2.tar.bz2
upstream-c931b21161bf3d8a8cab193045b7deb52f914fb2.zip
change prefix for kernelpatchbase 2.6.26
SVN-Revision: 13619
Diffstat (limited to 'target/linux/s3c24xx/patches-2.6.26/1082-fix-glamo-mci-defeat-ops-during-suspend.patch.patch')
-rwxr-xr-xtarget/linux/s3c24xx/patches-2.6.26/1082-fix-glamo-mci-defeat-ops-during-suspend.patch.patch73
1 files changed, 73 insertions, 0 deletions
diff --git a/target/linux/s3c24xx/patches-2.6.26/1082-fix-glamo-mci-defeat-ops-during-suspend.patch.patch b/target/linux/s3c24xx/patches-2.6.26/1082-fix-glamo-mci-defeat-ops-during-suspend.patch.patch
new file mode 100755
index 0000000000..938d89e61f
--- /dev/null
+++ b/target/linux/s3c24xx/patches-2.6.26/1082-fix-glamo-mci-defeat-ops-during-suspend.patch.patch
@@ -0,0 +1,73 @@
+From adeb466de3bb306dc68468c64be3ebc61960d788 Mon Sep 17 00:00:00 2001
+From: Andy Green <andy@openmoko.com>
+Date: Fri, 25 Jul 2008 23:06:01 +0100
+Subject: [PATCH] fix-glamo-mci-defeat-ops-during-suspend.patch
+
+We need to be able to use the config option CONFIG_MMC_UNSAFE_RESUME that allows the rootfs
+to live on SD. But when we use this, it tries to send a reset command to the SD card during
+suspend -- and unfortunately many things like Power have suspended by then.
+
+This patch again rejects IO on the MMC device during suspend of the MMC device, and it
+gives the result the rootfs on SD card works okay.
+
+Signed-off-by: Andy Green <andy@openmoko.com>
+---
+ drivers/mfd/glamo/glamo-mci.c | 14 ++++++++++++++
+ drivers/mfd/glamo/glamo-mci.h | 2 ++
+ 2 files changed, 16 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/mfd/glamo/glamo-mci.c b/drivers/mfd/glamo/glamo-mci.c
+index f559e5e..bbbbe4d 100644
+--- a/drivers/mfd/glamo/glamo-mci.c
++++ b/drivers/mfd/glamo/glamo-mci.c
+@@ -406,6 +406,14 @@ static void glamo_mci_send_request(struct mmc_host *mmc)
+ u16 status;
+ int n;
+
++ if (host->suspending) {
++ cmd->error = -EIO;
++ if (cmd->data)
++ cmd->data->error = -EIO;
++ mmc_request_done(mmc, mrq);
++ return;
++ }
++
+ host->ccnt++;
+ /*
+ * somehow 2.6.24 MCI manages to issue MMC_WRITE_BLOCK *without* the
+@@ -792,6 +800,9 @@ static int glamo_mci_remove(struct platform_device *pdev)
+ static int glamo_mci_suspend(struct platform_device *dev, pm_message_t state)
+ {
+ struct mmc_host *mmc = platform_get_drvdata(dev);
++ struct glamo_mci_host *host = mmc_priv(mmc);
++
++ host->suspending++;
+
+ return mmc_suspend_host(mmc, state);
+ }
+@@ -799,6 +810,9 @@ static int glamo_mci_suspend(struct platform_device *dev, pm_message_t state)
+ static int glamo_mci_resume(struct platform_device *dev)
+ {
+ struct mmc_host *mmc = platform_get_drvdata(dev);
++ struct glamo_mci_host *host = mmc_priv(mmc);
++
++ host->suspending--;
+
+ return mmc_resume_host(mmc);
+ }
+diff --git a/drivers/mfd/glamo/glamo-mci.h b/drivers/mfd/glamo/glamo-mci.h
+index 40c3e24..55852e7 100644
+--- a/drivers/mfd/glamo/glamo-mci.h
++++ b/drivers/mfd/glamo/glamo-mci.h
+@@ -34,6 +34,8 @@ struct glamo_mci_host {
+ int dma;
+ int data_max_size;
+
++ int suspending;
++
+ int power_mode_current;
+ unsigned int vdd_current;
+
+--
+1.5.6.3
+