From: Pierre Ossman <drzeus-list@drzeus.cx>
To: LKML <linux-kernel@vger.kernel.org>,
Russell King <rmk+lkml@arm.linux.org.uk>
Subject: [PATCH][MMC] Power cycle (round 2)
Date: Wed, 16 Mar 2005 15:21:18 +0100 [thread overview]
Message-ID: <423840DE.2050509@drzeus.cx> (raw)
[-- Attachment #1: Type: text/plain, Size: 513 bytes --]
I didn't get any response from you the last time I submitted this so I'm
going to nag you some more ;)
This patch is vital for one of my MMC cards. The only other way I've
found to get it working is by changing the OCR. And that would cause
problems on other controllers so it was not an option.
The patch is rather well tested with over 500 downloads and no reported
problems. Just to keep everyone happy the default is still 'no' for
Kconfig but I personally would think a 'yes' would be better.
Rgds
Pierre
[-- Attachment #2: mmc-powercycle.patch --]
[-- Type: text/x-patch, Size: 1871 bytes --]
Index: linux-wbsd/drivers/mmc/mmc.c
===================================================================
--- linux-wbsd/drivers/mmc/mmc.c (revision 72)
+++ linux-wbsd/drivers/mmc/mmc.c (working copy)
@@ -666,13 +666,26 @@
host->ocr = mmc_select_voltage(host, ocr);
/*
- * Since we're changing the OCR value, we seem to
- * need to tell some cards to go back to the idle
- * state. We wait 1ms to give cards time to
- * respond.
+ * Some cards shut down when receiving an OCR of
+ * zero. But since they send their mask before
+ * shutting down we can still calculate a correct
+ * voltage. To get them back to life we need to
+ * cycle power.
+ *
+ * When changing OCR values we also need to put
+ * the cards in idle state.
*/
if (host->ocr)
+ {
+
+#ifdef CONFIG_MMC_POWERCYCLE
+ mmc_power_off(host);
+ mmc_delay(100);
+ mmc_power_up(host);
+#endif /* CONFIG_MMC_POWERCYCLE */
+
mmc_idle_cards(host);
+ }
} else {
host->ios.bus_mode = MMC_BUSMODE_OPENDRAIN;
host->ios.clock = host->f_min;
Index: linux-wbsd/drivers/mmc/Kconfig
===================================================================
--- linux-wbsd/drivers/mmc/Kconfig (revision 95)
+++ linux-wbsd/drivers/mmc/Kconfig (revision 96)
@@ -19,6 +19,18 @@
This is an option for use by developers; most people should
say N here. This enables MMC core and driver debugging.
+config MMC_POWERCYCLE
+ bool "Reboot cards after scan (EXPERIMENTAL)"
+ depends on MMC != n && EXPERIMENTAL
+ default n
+ help
+ Some cards to not follow the MMC spec. fully and shut down
+ during init. Enable this option to reboot the card after
+ the initial scan.
+
+ Most people should say N here. If you happen to have a card
+ that isn't detected then try enabling this option.
+
config MMC_BLOCK
tristate "MMC block device driver"
depends on MMC
reply other threads:[~2005-03-16 14:21 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=423840DE.2050509@drzeus.cx \
--to=drzeus-list@drzeus.cx \
--cc=linux-kernel@vger.kernel.org \
--cc=rmk+lkml@arm.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox