aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/msm_sdcc.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2010-08-13Merge branch 'msm-mmc_sdcc' of git://codeaurora.org/quic/kernel/dwalker/linux-msmLinus Torvalds1-12/+23
* 'msm-mmc_sdcc' of git://codeaurora.org/quic/kernel/dwalker/linux-msm: mmc: msm_sdcc: Rename config MMC_MSM7X00A to MMC_MSM mmc: msm_sdcc: Compile the driver for msm7x30 mmc: msm: fix up build breakage on !PM
2010-08-12Merge branch 'msm-core' of git://codeaurora.org/quic/kernel/dwalker/linux-msmLinus Torvalds1-1/+1
* 'msm-core' of git://codeaurora.org/quic/kernel/dwalker/linux-msm: msm: mmc: Add msm prefix to platform data structure msm: trout: Remove extern declaration from source file arm: msm: Fix section mismatch in smd.c. arm: msm: trout add mmc support arm: msm: trout: add trout specific gpio interrupts arm: msm: remove unused #include <linux/version.h>
2010-08-11drivers/mmc/host/msm-sdcc: remove dead config optionsChristian Dietrich1-25/+0
CONFIG_MMC_MSM7X00A_RESUME_IN_WQ and CONFIG_MMC_EMBEDDED_SDIO don't exist in Kconfig and is never defined anywhere else, therefore removing all references for it from the source code. Signed-off-by: Christian Dietrich <qy03fugy@stud.informatik.uni-erlangen.de> Acked-by: David Brown <davidb@codeaurora.org> Cc: Daniel Walker <dwalker@codeaurora.org> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-08-09mmc: msm_sdcc: Compile the driver for msm7x30Sahitya Tummala1-12/+1
The controller base address is referred from platform resource instead of using #defines. This fixes the compilation error when driver is compiled for msm7x30. Signed-off-by: Sahitya Tummala <stummala@codeaurora.org> Signed-off-by: Daniel Walker <dwalker@codeaurora.org>
2010-08-09msm: mmc: Add msm prefix to platform data structureSahitya Tummala1-1/+1
Rename mmc_platform_data to msm_mmc_platform_data as it is used only by MSM platform. Signed-off-by: Sahitya Tummala <stummala@codeaurora.org> Signed-off-by: Daniel Walker <dwalker@codeaurora.org>
2010-06-23mmc: msm: fix up build breakage on !PMDaniel Walker1-16/+22
with PM disabled I get the following compile error, drivers/built-in.o: In function `msmsdcc_resume': linux-2.6/drivers/mmc/host/msm_sdcc.c:1352: undefined reference to `mmc_resume_host' drivers/built-in.o: In function `msmsdcc_suspend': linux-2.6/drivers/mmc/host/msm_sdcc.c:1330: undefined reference to `mmc_suspend_host' This adds ifdefs around the suspend/resume functions to prevent this. Signed-off-by: Daniel Walker <dwalker@codeaurora.org>
2010-05-27mmc: remove the "state" argument to mmc_suspend_host()Matt Fleming1-1/+1
Even though many mmc host drivers pass a pm_message_t argument to mmc_suspend_host() that argument isn't used the by MMC core. As host drivers are converted to dev_pm_ops they'll have to construct pm_message_t's (as they won't be passed by the PM subsystem any more) just to appease the mmc suspend interface. We might as well just delete the unused paramter. Signed-off-by: Matt Fleming <matt@console-pimps.org> Acked-by: Anton Vorontsov <cbouatmailru@gmail.com> Acked-by: Michal Miroslaw <mirq-linux@rere.qmqm.pl>ZZ Acked-by: Sascha Sommer <saschasommer@freenet.de> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-05-21Merge branch 'msm-mmc_sdcc' of git://codeaurora.org/quic/kernel/dwalker/linux-msmLinus Torvalds1-185/+287
* 'msm-mmc_sdcc' of git://codeaurora.org/quic/kernel/dwalker/linux-msm: drivers: mmc: msm_sdcc: Add EMBEDDED_SDIO support mmc: msm_sdcc: Fix issue where clocks could be disabled mid transaction mmc: msm_sdcc: Fix the dma exec function to use the proper delays mmc: msm_sdcc: Don't set host->curr.mrq until after we're sure the busclk timer won't fire mmc: msm_sdcc: Enable busclk idle timer for power savings mmc: msm_sdcc: Don't disable interrupts while suspending mmc: msm_sdcc: Fix issue where we might not end a sucessfull request mmc: msm_sdcc: Featurize busclock power save and disable it by default mmc: msm_sdcc: Fix bug where busclk expiry timer was not properly disabled mmc: msm_sdcc: Reduce command timeouts and improve reliability. mmc: msm_sdcc: Schedule clock disable after probe mmc: msm_sdcc: Wrap readl/writel calls with appropriate clk delays mmc: msm_sdcc: Driver clocking/irq improvements msm: Add 'execute' datamover callback mmc: msm_sdcc: Snoop SDIO_CCCR_ABORT register mmc: msm_sdcc: Clean up clock management and add a 10us delay after enabling clocks
2010-03-30include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.hTejun Heo1-0/+1
percpu.h is included by sched.h and module.h and thus ends up being included when building most .c files. percpu.h includes slab.h which in turn includes gfp.h making everything defined by the two files universally available and complicating inclusion dependencies. percpu.h -> slab.h dependency is about to be removed. Prepare for this change by updating users of gfp and slab facilities include those headers directly instead of assuming availability. As this conversion needs to touch large number of source files, the following script is used as the basis of conversion. http://userweb.kernel.org/~tj/misc/slabh-sweep.py The script does the followings. * Scan files for gfp and slab usages and update includes such that only the necessary includes are there. ie. if only gfp is used, gfp.h, if slab is used, slab.h. * When the script inserts a new include, it looks at the include blocks and try to put the new include such that its order conforms to its surrounding. It's put in the include block which contains core kernel includes, in the same order that the rest are ordered - alphabetical, Christmas tree, rev-Xmas-tree or at the end if there doesn't seem to be any matching order. * If the script can't find a place to put a new include (mostly because the file doesn't have fitting include block), it prints out an error message indicating which .h file needs to be added to the file. The conversion was done in the following steps. 1. The initial automatic conversion of all .c files updated slightly over 4000 files, deleting around 700 includes and adding ~480 gfp.h and ~3000 slab.h inclusions. The script emitted errors for ~400 files. 2. Each error was manually checked. Some didn't need the inclusion, some needed manual addition while adding it to implementation .h or embedding .c file was more appropriate for others. This step added inclusions to around 150 files. 3. The script was run again and the output was compared to the edits from #2 to make sure no file was left behind. 4. Several build tests were done and a couple of problems were fixed. e.g. lib/decompress_*.c used malloc/free() wrappers around slab APIs requiring slab.h to be added manually. 5. The script was run on all .h files but without automatically editing them as sprinkling gfp.h and slab.h inclusions around .h files could easily lead to inclusion dependency hell. Most gfp.h inclusion directives were ignored as stuff from gfp.h was usually wildly available and often used in preprocessor macros. Each slab.h inclusion directive was examined and added manually as necessary. 6. percpu.h was updated not to include slab.h. 7. Build test were done on the following configurations and failures were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my distributed build env didn't work with gcov compiles) and a few more options had to be turned off depending on archs to make things build (like ipr on powerpc/64 which failed due to missing writeq). * x86 and x86_64 UP and SMP allmodconfig and a custom test config. * powerpc and powerpc64 SMP allmodconfig * sparc and sparc64 SMP allmodconfig * ia64 SMP allmodconfig * s390 SMP allmodconfig * alpha SMP allmodconfig * um on x86_64 SMP allmodconfig 8. percpu.h modifications were reverted so that it could be applied as a separate patch and serve as bisection point. Given the fact that I had only a couple of failures from tests on step 6, I'm fairly confident about the coverage of this conversion patch. If there is a breakage, it's likely to be something in one of the arch headers which should be easily discoverable easily on most builds of the specific arch. Signed-off-by: Tejun Heo <tj@kernel.org> Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2010-03-18drivers: mmc: msm_sdcc: Add EMBEDDED_SDIO supportSan Mehat1-2/+10
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com> Signed-off-by: Daniel Walker <dwalker@codeaurora.org>
2010-03-18mmc: msm_sdcc: Fix issue where clocks could be disabled mid transactionSan Mehat1-34/+27
msmsdcc_enable_clocks() was incorrectly being called depending on the state of host->clks_on. This means the busclk idle timer was never being deleted if the clock was already on.. Bogus. Also fixes a possible double clk disable if the call to del_timer_sync() in msmsdcc_disable_clocks() raced with the busclk timer. Signed-off-by: San Mehat <san@google.com> Signed-off-by: Daniel Walker <dwalker@codeaurora.org>
2010-03-18mmc: msm_sdcc: Fix the dma exec function to use the proper delaysSan Mehat1-9/+10
Signed-off-by: San Mehat <san@google.com> Signed-off-by: Daniel Walker <dwalker@codeaurora.org>
2010-03-18mmc: msm_sdcc: Don't set host->curr.mrq until after we're sure the busclk timer won't fireDmitry Shmidt1-2/+2
Signed-off-by: San Mehat <san@google.com> Signed-off-by: Daniel Walker <dwalker@codeaurora.org>
2010-03-18mmc: msm_sdcc: Enable busclk idle timer for power savingsSan Mehat1-2/+1
Signed-off-by: San Mehat <san@google.com> Signed-off-by: Daniel Walker <dwalker@codeaurora.org>
2010-03-18mmc: msm_sdcc: Don't disable interrupts while suspendingSan Mehat1-3/+0
Signed-off-by: San Mehat <san@google.com> Signed-off-by: Daniel Walker <dwalker@codeaurora.org>
2010-03-18mmc: msm_sdcc: Fix issue where we might not end a sucessfull requestSan Mehat1-3/+4
Signed-off-by: San Mehat <san@google.com> Signed-off-by: Daniel Walker <dwalker@codeaurora.org>
2010-03-18mmc: msm_sdcc: Featurize busclock power save and disable it by defaultSan Mehat1-0/+13
Signed-off-by: San Mehat <san@google.com> Signed-off-by: Daniel Walker <dwalker@codeaurora.org>
2010-03-18mmc: msm_sdcc: Fix bug where busclk expiry timer was not properly disabledSan Mehat1-47/+52
Signed-off-by: San Mehat <san@google.com> Signed-off-by: Daniel Walker <dwalker@codeaurora.org>
2010-03-18mmc: msm_sdcc: Reduce command timeouts and improve reliability.San Mehat1-119/+148
Based on an original patch by Brent DeGraaf: "Previous versions of the SD driver were beset with excessive command timeouts. These timeouts were silent by default, but happened frequently, especially during heavy system activity and concurrent access of two or more SD devices. Worst case, these timeouts would occasionally hit at the end of a successful write, resulting in false failures that could adversely affect journaling file systems if timing was unfortunate. This update tightens the association and timing between dma transfers and the commands that trigger them by utilizing a new api implemented in the datamover. In addition, it also fixes a dma cache coherency issue that was exposed during testing of this fix that occasionally resulted in card corruption. Processing of results in the interrupt status routine was modified to process command results prior to data because overwritten command results were observed during testing since the data section can result in command issuances of its own. This change also eliminates the software command timeout, relying entirely on the hardware version, since the software timeout was found to cause problems of its own after extensive testing (having hardware timer and software timers addressing the same issue was found to cause a race condition under heavy system load)." This change originally added PROG_DONE handling, which has been split out into a separate patch. Also on our platform, the data mover driver maintains coherency to ensure API reliability, so the above mentioned cache corruption issue was not an issue for us. Signed-off-by: San Mehat <san@google.com> Cc: Brian Swetland <swetland@google.com> Change-Id: Ifbf17cfafb858106d73bf49af52b5161a265a484 Signed-off-by: San Mehat <san@google.com> Signed-off-by: Daniel Walker <dwalker@codeaurora.org>
2010-03-18mmc: msm_sdcc: Schedule clock disable after probeSan Mehat1-0/+2
Signed-off-by: San Mehat <san@google.com> Signed-off-by: Daniel Walker <dwalker@codeaurora.org>
2010-03-18mmc: msm_sdcc: Wrap readl/writel calls with appropriate clk delaysSan Mehat1-55/+61
As it turns out, all sdcc register writes must be delayed by at least 3 core clock cycles for the writes to take effect. *sigh* Also removes the 30us constant delay on clock enable in favor of a 3 core clock delay. Signed-off-by: San Mehat <san@google.com> Signed-off-by: Daniel Walker <dwalker@codeaurora.org>
2010-03-18mmc: msm_sdcc: Driver clocking/irq improvementsSan Mehat1-28/+61
- Clocks are now disabled after 1 second of inactivity - Fixed issue which was causing us to loop through our ISR twice - Bump core clock enable delay to 30us Signed-off-by: San Mehat <san@google.com> Signed-off-by: Daniel Walker <dwalker@codeaurora.org>
2010-03-18msm: Add 'execute' datamover callbackSan Mehat1-0/+1
Based on a patch from Brent DeGraaf: "The datamover supports channels which can be shared amongst devices. As a result, the actual data transfer may occur some time after the request is queued up. Some devices such as mmc host controllers will timeout if a command is issued too far in advance of the actual transfer, so if dma to other devices on the same channel is already in progress or queued up, the added delay can cause pending transfers to fail before they start. This change extends the api to allow a user callback to be invoked just before the actual transfer takes place, thus allowing actions directly associated with the dma transfer, such as device commands, to be invoked with precise timing. Without this mechanism, there is no way for a driver to realize this timing. Also adds a user pointer to the command structure for use by the caller to reference information that may be needed by the callback routine for proper identification and processing associated with that specific request. This change is necessary to fix problems associated with excessive command timeouts and race conditions in the mmc driver." This patch also fixes all the callers of msm_dmov_enqueue_cmd() to ensure their callback function is NULL. Signed-off-by: San Mehat <san@google.com> Cc: Brent DeGraaf <bdegraaf@quicinc.com> Cc: Brian Swetland <swetland@google.com> Signed-off-by: Daniel Walker <dwalker@codeaurora.org>
2010-03-18mmc: msm_sdcc: Snoop SDIO_CCCR_ABORT registerSan Mehat1-0/+14
Signed-off-by: San Mehat <san@google.com> Signed-off-by: Daniel Walker <dwalker@codeaurora.org>
2010-03-18mmc: msm_sdcc: Clean up clock management and add a 10us delay after enabling clocksSan Mehat1-40/+40
It appears that in some cases there may be a delay on the ARM9 in enabling our clock. As a result, we may put the controller into a bad state. Delay 10us after enabling clocks to let the peripheral settle. Note - this is all imperical. Also ensure set_ios() callback grabs the host lock. Signed-off-by: San Mehat <san@google.com> Signed-off-by: Daniel Walker <dwalker@codeaurora.org>
2010-01-20msm_sdcc.c: missing brackets in msmsdcc_resume()Roel Kluin1-3/+1
Since the curly brackets were missing the test and enable_irq(), if true, occurred twice. Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
2009-12-10HTC Dream: mmc compilation fixesPavel Machek1-4/+1
Add missing include for msm_sdcc compilation, and remove pwrsink support that is not mainline, yet. Signed-off-by: Pavel Machek <pavel@ucw.cz> [dwalker@codeaurora.org : fixed indent in mmc.h] Signed-off-by: Daniel Walker <dwalker@codeaurora.org>
2009-09-23msm_sdcc.c: move overly indented code to separate functionJoe Perches1-69/+63
Signed-off-by: Joe Perches <joe@perches.com> Cc: Pavel Machek <pavel@ucw.cz> Cc: Brian Swetland <swetland@google.com> Cc: Pierre Ossman <drzeus-list@drzeus.cx> Cc: San Mehat <san@android.com> Cc: Matt Fleming <matt@console-pimps.org> Cc: Ian Molton <ian@mnementh.co.uk> Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com> Cc: Philip Langdale <philipl@overt.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-23msm_sdcc.c: stylistic cleaningJoe Perches1-21/+24
Make it a bit more like typical kernel style. Signed-off-by: Joe Perches <joe@perches.com> Cc: Pavel Machek <pavel@ucw.cz> Cc: Brian Swetland <swetland@google.com> Cc: Pierre Ossman <drzeus-list@drzeus.cx> Cc: San Mehat <san@android.com> Cc: Matt Fleming <matt@console-pimps.org> Cc: Ian Molton <ian@mnementh.co.uk> Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com> Cc: Philip Langdale <philipl@overt.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-23msm_sdcc.c: convert printk(KERN_<level> to pr_<level>(Joe Perches1-58/+47
Signed-off-by: Joe Perches <joe@perches.com> Cc: Pavel Machek <pavel@ucw.cz> Cc: Brian Swetland <swetland@google.com> Cc: Pierre Ossman <drzeus-list@drzeus.cx> Cc: San Mehat <san@android.com> Cc: Matt Fleming <matt@console-pimps.org> Cc: Ian Molton <ian@mnementh.co.uk> Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com> Cc: Philip Langdale <philipl@overt.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-23mmc: msm_sdccc: driver for HTC DreamSan Mehat1-0/+1301
MMC Driver for HTC Dream. I picked the code up from Google git trees, removed stuff not strictly necessary, and did a few cleanups. It still works :-). Signed-off-by: Pavel Machek <pavel@ucw.cz> Cc: Brian Swetland <swetland@google.com> Cc: Pierre Ossman <drzeus-list@drzeus.cx> Cc: Joe Perches <joe@perches.com> Cc: Matt Fleming <matt@console-pimps.org> Cc: Ian Molton <ian@mnementh.co.uk> Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com> Cc: Philip Langdale <philipl@overt.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>