aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc (follow)
AgeCommit message (Collapse)AuthorFilesLines
2011-09-21Merge branch 'for-linus' of git://git.kernel.dk/linux-blockLinus Torvalds1-0/+3
* 'for-linus' of git://git.kernel.dk/linux-block: floppy: use del_timer_sync() in init cleanup blk-cgroup: be able to remove the record of unplugged device block: Don't check QUEUE_FLAG_SAME_COMP in __blk_complete_request mm: Add comment explaining task state setting in bdi_forker_thread() mm: Cleanup clearing of BDI_pending bit in bdi_forker_thread() block: simplify force plug flush code a little bit block: change force plug flush call order block: Fix queue_flag update when rq_affinity goes from 2 to 1 block: separate priority boosting from REQ_META block: remove READ_META and WRITE_META xen-blkback: fixed indentation and comments xen-blkback: Don't disconnect backend until state switched to XenbusStateClosed.
2011-08-31mmc: sdhci-s3c: Fix mmc card I/O problemGirish K S1-0/+2
This patch fixes the problem in sdhci-s3c host driver for Samsung Soc's. During the card identification stage the mmc core driver enumerates for the best bus width in combination with the highest available data rate. It starts enumerating from the highest bus width (8) to lowest width (1). In case of few MMC cards the 4-bit bus enumeration fails and tries the 1-bit bus enumeration. When switched to 1-bit bus mode the host driver has to clear the previous bus width setting and apply the new setting. The current patch will clear the previous bus mode and apply the new mode setting. Signed-off-by: Girish K S <girish.shivananjappa@linaro.org> Acked-by: Jaehoon Chung <jh80.chung@samsung.com> Cc: <stable@kernel.org> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-08-31mmc: sd: UHS-I bus speed should be set last in UHS initializationSubhash Jadavani1-28/+53
mmc_sd_init_uhs_card function sets the driver type, current limit and bus speed mode on card as well as on host controller side. Currently bus speed mode is set by sending CMD6 to card and immediately setting the timing mode in host controller. But then before initiating tuning sequence, it also tries to set current limit by sending CMD6 to card which results in data timeout errors in controller if bus speed mode is SDR50/SDR104 mode. So basically bus speed mode should be set only after current limit is set in the card and immediately after setting the bus speed mode, tuning sequence should be initiated. Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org> Reviewed-by: Arindam Nath <arindam.nath@amd.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-08-31mmc: sdhi: initialise mmc_data->flags before useSimon Horman1-2/+2
This corrects a logic error that I introduced in "mmc: sdhi: Add write16_hook" Reported-by: Magnus Damm <magnus.damm@gmail.com> Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-08-31mmc: core: use non-reentrant workqueue for clock gatingMika Westerberg1-1/+1
The default multithread workqueue can cause the same work to be executed concurrently on a different CPUs. This isn't really suitable for clock gating as it might already gated the clock and gating it twice results both host->clk_old and host->ios.clock to be set to 0. To prevent this from happening we use system_nrt_wq instead. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Tested-by: Chris Ball <cjb@laptop.org> Cc: <stable@kernel.org> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-08-31mmc: core: prevent aggressive clock gating racing with ios updatesMika Westerberg1-2/+29
We have seen at least two different races when clock gating kicks in in a middle of ios structure update. First one happens when ios->clock is changed outside of aggressive clock gating framework, for example via mmc_set_clock(). The race might happen when we run following code: mmc_set_ios(): ... if (ios->clock > 0) mmc_set_ungated(host); Now if gating kicks in right after the condition check we end up setting host->clk_gated to false even though we have just gated the clock. Next time a request is started we try to ungate and restore the clock in mmc_host_clk_hold(). However since we have host->clk_gated set to false the original clock is not restored. This eventually will cause the host controller to hang since its clock is disabled while we are trying to issue a request. For example on Intel Medfield platform we see: [ 13.818610] mmc2: Timeout waiting for hardware interrupt. [ 13.818698] sdhci: =========== REGISTER DUMP (mmc2)=========== [ 13.818753] sdhci: Sys addr: 0x00000000 | Version: 0x00008901 [ 13.818804] sdhci: Blk size: 0x00000000 | Blk cnt: 0x00000000 [ 13.818853] sdhci: Argument: 0x00000000 | Trn mode: 0x00000000 [ 13.818903] sdhci: Present: 0x1fff0000 | Host ctl: 0x00000001 [ 13.818951] sdhci: Power: 0x0000000d | Blk gap: 0x00000000 [ 13.819000] sdhci: Wake-up: 0x00000000 | Clock: 0x00000000 [ 13.819049] sdhci: Timeout: 0x00000000 | Int stat: 0x00000000 [ 13.819098] sdhci: Int enab: 0x00ff00c3 | Sig enab: 0x00ff00c3 [ 13.819147] sdhci: AC12 err: 0x00000000 | Slot int: 0x00000000 [ 13.819196] sdhci: Caps: 0x6bee32b2 | Caps_1: 0x00000000 [ 13.819245] sdhci: Cmd: 0x00000000 | Max curr: 0x00000000 [ 13.819292] sdhci: Host ctl2: 0x00000000 [ 13.819331] sdhci: ADMA Err: 0x00000000 | ADMA Ptr: 0x00000000 [ 13.819377] sdhci: =========================================== [ 13.919605] mmc2: Reset 0x2 never completed. and it never recovers. Second race might happen while running mmc_power_off(): static void mmc_power_off(struct mmc_host *host) { host->ios.clock = 0; host->ios.vdd = 0; [ clock gating kicks in here ] /* * Reset ocr mask to be the highest possible voltage supported for * this mmc host. This value will be used at next power up. */ host->ocr = 1 << (fls(host->ocr_avail) - 1); if (!mmc_host_is_spi(host)) { host->ios.bus_mode = MMC_BUSMODE_OPENDRAIN; host->ios.chip_select = MMC_CS_DONTCARE; } host->ios.power_mode = MMC_POWER_OFF; host->ios.bus_width = MMC_BUS_WIDTH_1; host->ios.timing = MMC_TIMING_LEGACY; mmc_set_ios(host); } If the clock gating worker kicks in while we are only partially updated the ios structure the host controller gets incomplete ios and might not work as supposed. Again on Intel Medfield platform we get: [ 4.185349] kernel BUG at drivers/mmc/host/sdhci.c:1155! [ 4.185422] invalid opcode: 0000 [#1] PREEMPT SMP [ 4.185509] Modules linked in: [ 4.185565] [ 4.185608] Pid: 4, comm: kworker/0:0 Not tainted 3.0.0+ #240 Intel Corporation Medfield/iCDKA [ 4.185742] EIP: 0060:[<c136364e>] EFLAGS: 00010083 CPU: 0 [ 4.185827] EIP is at sdhci_set_power+0x3e/0xd0 [ 4.185891] EAX: f5ff98e0 EBX: f5ff98e0 ECX: 00000000 EDX: 00000001 [ 4.185970] ESI: f5ff977c EDI: f5ff9904 EBP: f644fe98 ESP: f644fe94 [ 4.186049] DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068 [ 4.186125] Process kworker/0:0 (pid: 4, ti=f644e000 task=f644c0e0 task.ti=f644e000) [ 4.186219] Stack: [ 4.186257] f5ff98e0 f644feb0 c1365173 00000282 f5ff9460 f5ff96e0 f5ff96e0 f644feec [ 4.186418] c1355bd8 f644c0e0 c1499c3d f5ff96e0 f644fed4 00000006 f5ff96e0 00000286 [ 4.186579] f644fedc c107922b f644feec 00000286 f5ff9460 f5ff9700 f644ff10 c135839e [ 4.186739] Call Trace: [ 4.186802] [<c1365173>] sdhci_set_ios+0x1c3/0x340 [ 4.186883] [<c1355bd8>] mmc_gate_clock+0x68/0x120 [ 4.186963] [<c1499c3d>] ? _raw_spin_unlock_irqrestore+0x4d/0x60 [ 4.187052] [<c107922b>] ? trace_hardirqs_on+0xb/0x10 [ 4.187134] [<c135839e>] mmc_host_clk_gate_delayed+0xbe/0x130 [ 4.187219] [<c105ec09>] ? process_one_work+0xf9/0x5b0 [ 4.187300] [<c135841d>] mmc_host_clk_gate_work+0xd/0x10 [ 4.187379] [<c105ec82>] process_one_work+0x172/0x5b0 [ 4.187457] [<c105ec09>] ? process_one_work+0xf9/0x5b0 [ 4.187538] [<c1358410>] ? mmc_host_clk_gate_delayed+0x130/0x130 [ 4.187625] [<c105f3c8>] worker_thread+0x118/0x330 [ 4.187700] [<c1496cee>] ? preempt_schedule+0x2e/0x50 [ 4.187779] [<c105f2b0>] ? rescuer_thread+0x1f0/0x1f0 [ 4.187857] [<c1062cf4>] kthread+0x74/0x80 [ 4.187931] [<c1062c80>] ? __init_kthread_worker+0x60/0x60 [ 4.188015] [<c149acfa>] kernel_thread_helper+0x6/0xd [ 4.188079] Code: 81 fa 00 00 04 00 0f 84 a7 00 00 00 7f 21 81 fa 80 00 00 00 0f 84 92 00 00 00 81 fa 00 00 0 [ 4.188780] EIP: [<c136364e>] sdhci_set_power+0x3e/0xd0 SS:ESP 0068:f644fe94 [ 4.188898] ---[ end trace a7b23eecc71777e4 ]--- This BUG() comes from the fact that ios.power_mode was still in previous value (MMC_POWER_ON) and ios.vdd was set to zero. We prevent these by inhibiting the clock gating while we update the ios structure. Both problems can be reproduced by simply running the device in a reboot loop. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Tested-by: Chris Ball <cjb@laptop.org> Cc: <stable@kernel.org> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-08-31mmc: rename mmc_host_clk_{ungate|gate} to mmc_host_clk_{hold|release}Mika Westerberg3-11/+11
As per suggestion by Linus Walleij: > If you think the names of the functions are confusing then > you may rename them, say like this: > > mmc_host_clk_ungate() -> mmc_host_clk_hold() > mmc_host_clk_gate() -> mmc_host_clk_release() > > Which would make the usecases more clear (This is CC'd to stable@ because the next two patches, which fix observable races, depend on it.) Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Cc: <stable@kernel.org> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-08-28mmc: sdhci-esdhc-imx: add missing inclusion of linux/module.hShawn Guo1-0/+1
There are the following warnings and errorx when compiling the driver. The patch adds the missing inclusion of linux/module.h to fix them. drivers/mmc/host/sdhci-esdhc-imx.c:563:12: error: ‘THIS_MODULE’ undeclared here (not in a function) [..] Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-08-23block: separate priority boosting from REQ_METAChristoph Hellwig1-0/+3
Add a new REQ_PRIO to let requests preempt others in the cfq I/O schedule, and lave REQ_META purely for marking requests as metadata in blktrace. All existing callers of REQ_META except for XFS are updated to also set REQ_PRIO for now. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Namhyung Kim <namhyung@gmail.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2011-08-13mmc: dw_mmc: Fix DDR mode support.Seungwon Jeon1-2/+2
Host driver can't get a hint of DDR mode through ios->ddr flag anymore. ios->timing is currently used to inform DDR mode as a substitute. And capability of MMC_CAP_MMC_HIGHSPEED is added for DDR support. Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com> Acked-by: Will Newton <will.newton@imgtec.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-08-13mmc: core: use defined R1_STATE_PRG macro for card statusJaehoon Chung3-3/+3
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-08-13mmc: sdhci: use f_max instead of host->clock for timeoutsAndy Shevchenko1-5/+2
When timeout_clk is calculated the host->clock could be zero. So, instead of host->clock the calculation now uses mmc->f_max. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-08-13mmc: sdhci: move timeout_clk calculation farther downAndy Shevchenko1-19/+19
This moves the calculation below the assignment of mmc->f_max, which we need for calculating timeout_clk in the next patch in this series. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-08-13mmc: sdhci: check host->clock before using it as a denominatorAndy Shevchenko1-3/+5
Sometimes host->clock could be zero which is a legal situation. This patch checks host->clock before usage as a denominator when timeout is calculated. A similar patch is applied for mmc core (see commit e9b8684, "mmc: fix division by zero in MMC core"). Without this patch, the execution of the sdhci_calc_timeout could end up with a backtrace: <0>[ 4.014319] divide error: 0000 [#1] PREEMPT SMP <4>[ 4.014352] Modules linked in: g_ether <4>[ 4.014376] <4>[ 4.014393] Pid: 33, comm: kworker/u:2 Not tainted 3.0.0+ #646 <4>[ 4.014421] EIP: 0060:[<c12fa38e>] EFLAGS: 00010046 CPU: 1 <4>[ 4.014449] EIP is at sdhci_calc_timeout+0x2e/0x100 <4>[ 4.014468] EAX: 00000000 EBX: f5930fc8 ECX: 00000000 EDX: 00000000 <4>[ 4.014488] ESI: f5291de8 EDI: f5291db8 EBP: f5291c6c ESP: f5291c50 <4>[ 4.014508] DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068 <0>[ 4.014529] Process kworker/u:2 (pid: 33, ti=f5290000 task=f53065a0 task.ti=f5290000) <0>[ 4.014546] Stack: <4>[ 4.014557] 00000082 c1054fdd f5291c78 04000000 f5930fc8 f5291de8 f5291db8 f5291cac <4>[ 4.014611] c12fab7c c107a98b f5291c88 c13b6d3f f593109c f5882000 f5291cac c1054fdd <4>[ 4.014663] 00000000 00000000 f5882000 00000082 f5930fc8 f5291db8 0000000a f5291ccc <0>[ 4.014716] Call Trace: <4>[ 4.014743] [<c1054fdd>] ? mod_timer+0x11d/0x380 <4>[ 4.014770] [<c12fab7c>] sdhci_prepare_data+0x2c/0x3a0 <4>[ 4.014798] [<c107a98b>] ? trace_hardirqs_off+0xb/0x10 <4>[ 4.014827] [<c13b6d3f>] ? _raw_spin_unlock_irqrestore+0x2f/0x60 <4>[ 4.014854] [<c1054fdd>] ? mod_timer+0x11d/0x380 <4>[ 4.014880] [<c12fc7db>] sdhci_send_command+0xdb/0x210 <4>[ 4.014906] [<c12fd5f3>] sdhci_request+0xc3/0x150 <4>[ 4.014932] [<c12ec56a>] mmc_start_request+0xda/0x200 <4>[ 4.014960] [<c120d7c2>] ? __raw_spin_lock_init+0x32/0x60 <4>[ 4.014989] [<c1066a85>] ? __init_waitqueue_head+0x35/0x50 <4>[ 4.015015] [<c12ec70b>] mmc_wait_for_req+0x7b/0x90 <4>[ 4.015045] [<c12f0c67>] mmc_send_cxd_data+0xf7/0x130 <4>[ 4.015076] [<c12ecbc0>] ? mmc_erase+0x140/0x140 <4>[ 4.015102] [<c12f139d>] mmc_send_ext_csd+0x1d/0x20 <4>[ 4.015125] [<c12efef0>] mmc_get_ext_csd+0x70/0x140 <4>[ 4.015151] [<c12effe8>] mmc_compare_ext_csds+0x28/0x190 <4>[ 4.015176] [<c12f039f>] mmc_init_card+0x24f/0x650 <4>[ 4.015201] [<c13b6d5d>] ? _raw_spin_unlock_irqrestore+0x4d/0x60 <4>[ 4.015226] [<c107fd9c>] ? trace_hardirqs_on_caller+0x11c/0x160 <4>[ 4.015255] [<c12f09a4>] mmc_attach_mmc+0xa4/0x190 <4>[ 4.015282] [<c12ee3f0>] mmc_rescan+0x210/0x240 <4>[ 4.015311] [<c105f9b6>] process_one_work+0x176/0x550 <4>[ 4.015336] [<c105f93a>] ? process_one_work+0xfa/0x550 <4>[ 4.015360] [<c12ee1e0>] ? mmc_init_erase+0x140/0x140 <4>[ 4.015385] [<c1061c2a>] worker_thread+0x12a/0x2c0 <4>[ 4.015410] [<c1061b00>] ? manage_workers.clone.18+0x100/0x100 <4>[ 4.015437] [<c1066244>] kthread+0x74/0x80 <4>[ 4.015463] [<c10661d0>] ? __init_kthread_worker+0x60/0x60 <4>[ 4.015490] [<c13b7dfa>] kernel_thread_helper+0x6/0xd <0>[ 4.015507] Code: 57 89 d7 56 53 89 c3 83 ec 10 8b 40 04 8b 72 28 f6 c4 10 89 45 f0 0f 85 91 00 00 00 85 f6 0f 84 c1 00 00 00 8b 4e 04 31 d2 89 c8 <f7> 73 58 ba d3 4d 62 10 89 c1 8b 06 f7 e2 c1 ea 06 01 d1 f7 45 <0>[ 4.015829] EIP: [<c12fa38e>] sdhci_calc_timeout+0x2e/0x100 SS:ESP 0068:f5291c50 Reported-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-08-13mmc: Revert "mmc: sdhci: Fix SDHCI_QUIRK_TIMEOUT_USES_SDCLK"Andy Shevchenko1-4/+3
This reverts commit 4b01681c7764, which introduced a new potential divide by zero in the process of fixing one. The subsequent commits attempt to fix the issue properly. Signed-off-by: Chris Ball <cjb@laptop.org>
2011-08-13mmc: tmio: eliminate unused variable 'mmc' warningAxel Lin1-2/+0
Fix below compile warning: CC drivers/mmc/host/tmio_mmc.o drivers/mmc/host/tmio_mmc.c: In function 'tmio_mmc_suspend': drivers/mmc/host/tmio_mmc.c:30: warning: unused variable 'mmc' drivers/mmc/host/tmio_mmc.c: In function 'tmio_mmc_resume': drivers/mmc/host/tmio_mmc.c:45: warning: unused variable 'mmc' Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-08-13mmc: esdhc-imx: fix card interrupt loss on freescale eSDHCTony Lin1-9/+31
Apply a workaround for the imx eSDHC controller to avoid missing card interrupts. This makes SDIO work. Signed-off-by: Tony Lin <tony.lin@freescale.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-08-13mmc: sdhci-s3c: Fix build for header changeMark Brown1-0/+1
A header change has removed an implicit inclusion of module.h, breaking the build due to the use of THIS_MODULE. Fix that. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-08-13mmc: dw_mmc: Fix mask in IDMAC_SET_BUFFER1_SIZE macroShashidhar Hiremath1-1/+1
The mask used inside this macro was assuming Buffer_Size1's [BS1's] width to be 14 bits, it is actually 13 bits. Modify masks used in IDMAC_SET_BUFFER1_SIZE such that they use only 13 bits instead of current 14. Signed-off-by: Shashidhar Hiremath <shashidharh@vayavyalabs.com> Acked-by: Will Newton <will.newton@imgtec.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-08-13mmc: core: Detect eMMC v4.5 ext_csd entriesKyungmin Park1-1/+1
The eMMC v4.5 Spec is released now: EXT_CSD_REV Extended CSD Revision 255-7 Reserved 6 Revision 1.6 (for MMC v4.5) 5 Revision 1.5 (for MMV v4.41) ... Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-08-13mmc: mmc_test: avoid stalled file in debugfsAndy Shevchenko1-26/+30
During card removal and inserting cycle the test file in the debugfs could be stalled until the host driver removes it. Let's keep the file in the linked list and destroy it when card is removed. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Per Forlin <per.forlin@linaro.org> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-08-13mmc: sdhci-s3c: add BROKEN_ADMA_ZEROLEN_DESC quirkJaehoon Chung1-0/+3
Samsung SoCs need to set BROKEN_ADMA_ZEROLEN_DESC. (If ADMA operation is more than 65535, maybe set by zero.) Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-08-13mmc: sdhci: pxav3: controller needs 32 bit ADMA addressingPhilip Rakity1-1/+2
Enable the quirk. (Best used in conjunction with patch downgrading ADMA to SDMA when transfer is not aligned.) Signed-off-by: Philip Rakity <prakity@marvell.com> Acked-by: Zhangfei Gao <zhangfei.gao@marvell.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-08-13mmc: sdhci: fix retuning timer wrongly deleted in sdhci_tasklet_finishAaron Lu1-3/+0
Currently, the retuning timer for retuning mode 1 will be deleted in function sdhci_tasklet_finish after a mmc request done, which will make retuning timing never trigger again. This patch fixed this problem. Signed-off-by: Aaron Lu <Aaron.Lu@amd.com> Reviewed-by: Philip Rakity <prakity@marvell.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-07-27mmc: sdhci-esdhc-imx: add device tree probe supportShawn Guo1-9/+69
The patch adds device tree probe support for sdhci-esdhc-imx driver. Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Cc: Wolfram Sang <w.sang@pengutronix.de> Cc: Chris Ball <cjb@laptop.org> Cc: Grant Likely <grant.likely@secretlab.ca> Acked-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: Chris Ball <cjb@laptop.org>
2011-07-27mmc: sdhci-pltfm: dt device does not pass parent to sdhci_alloc_hostShawn Guo1-1/+2
Neither platform based nor dt based device needs to pass the parent to sdhci_alloc_host. There is no difference between platform and dt on this point. The patch makes the change to pass device itself than its parent to sdhci_alloc_host for dt case too. Otherwise the probe function of sdhci based drivers which is shared between platform and dt will fail on dt case. Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Cc: Chris Ball <cjb@laptop.org> Acked-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: Chris Ball <cjb@laptop.org>
2011-07-27mmc: sdhci-esdhc-imx: get rid of the uses of cpu_is_mx()Shawn Guo1-4/+53
The patch removes all the uses of cpu_is_mx(). Instead, it utilizes platform_device_id to distinguish the esdhc differences among SoCs. Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Cc: Wolfram Sang <w.sang@pengutronix.de> Cc: Chris Ball <cjb@laptop.org> Acked-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: Chris Ball <cjb@laptop.org>
2011-07-27mmc: sdhci-esdhc-imx: do not reference platform data after probeShawn Guo1-9/+13
The patch copies platform data into pltfm_imx_data and reference the data there than platform data after probe. This work is inspired by Grant Likely and Troy Kisky. Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Cc: Troy Kisky <troy.kisky@boundarydevices.com> Cc: Grant Likely <grant.likely@secretlab.ca> Cc: Wolfram Sang <w.sang@pengutronix.de> Cc: Chris Ball <cjb@laptop.org> Acked-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: Chris Ball <cjb@laptop.org>
2011-07-27mmc: sdhci-esdhc-imx: extend card_detect and write_protect support for mx5Shawn Guo1-51/+87
The patch extends card_detect and write_protect support to get mx5 family and more scenarios supported. The changes include: * Turn platform_data from optional to mandatory * Add cd_types and wp_types into platform_data to cover more use cases * Remove the use of flag ESDHC_FLAG_GPIO_FOR_CD * Adjust some machine codes to adopt the platform_data changes * Work around the issue that software reset will get card detection circuit stop working With this patch, card_detect and write_protect gets supported on mx5 based platforms. Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Cc: Chris Ball <cjb@laptop.org> Acked-by: Wolfram Sang <w.sang@pengutronix.de> Tested-by: Arnaud Patard <arnaud.patard@rtp-net.org> Acked-by: Chris Ball <cjb@laptop.org>
2011-07-26MMC / TMIO: Fix build issue related to struct scatterlistRafael J. Wysocki1-0/+1
Fix build issue caused by undefined struct scatterlist in drivers/mmc/host/tmio_mmc.c. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-07-25Merge 'akpm' patch seriesLinus Torvalds1-0/+1
* Merge akpm patch series: (122 commits) drivers/connector/cn_proc.c: remove unused local Documentation/SubmitChecklist: add RCU debug config options reiserfs: use hweight_long() reiserfs: use proper little-endian bitops pnpacpi: register disabled resources drivers/rtc/rtc-tegra.c: properly initialize spinlock drivers/rtc/rtc-twl.c: check return value of twl_rtc_write_u8() in twl_rtc_set_time() drivers/rtc: add support for Qualcomm PMIC8xxx RTC drivers/rtc/rtc-s3c.c: support clock gating drivers/rtc/rtc-mpc5121.c: add support for RTC on MPC5200 init: skip calibration delay if previously done misc/eeprom: add eeprom access driver for digsy_mtc board misc/eeprom: add driver for microwire 93xx46 EEPROMs checkpatch.pl: update $logFunctions checkpatch: make utf-8 test --strict checkpatch.pl: add ability to ignore various messages checkpatch: add a "prefer __aligned" check checkpatch: validate signature styles and To: and Cc: lines checkpatch: add __rcu as a sparse modifier checkpatch: suggest using min_t or max_t ... Did this as a merge because of (trivial) conflicts in - Documentation/feature-removal-schedule.txt - arch/xtensa/include/asm/uaccess.h that were just easier to fix up in the merge than in the patch series.
2011-07-25notifiers: pm: move pm notifiers into suspend.hAmerigo Wang1-0/+1
It is not necessary to share the same notifier.h. Signed-off-by: WANG Cong <amwang@redhat.com> Cc: David Miller <davem@davemloft.net> Acked-by: "Rafael J. Wysocki" <rjw@sisk.pl> Cc: Greg KH <greg@kroah.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-07-25Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivialLinus Torvalds2-3/+3
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (43 commits) fs: Merge split strings treewide: fix potentially dangerous trailing ';' in #defined values/expressions uwb: Fix misspelling of neighbourhood in comment net, netfilter: Remove redundant goto in ebt_ulog_packet trivial: don't touch files that are removed in the staging tree lib/vsprintf: replace link to Draft by final RFC number doc: Kconfig: `to be' -> `be' doc: Kconfig: Typo: square -> squared doc: Konfig: Documentation/power/{pm => apm-acpi}.txt drivers/net: static should be at beginning of declaration drivers/media: static should be at beginning of declaration drivers/i2c: static should be at beginning of declaration XTENSA: static should be at beginning of declaration SH: static should be at beginning of declaration MIPS: static should be at beginning of declaration ARM: static should be at beginning of declaration rcu: treewide: Do not use rcu_read_lock_held when calling rcu_dereference_check Update my e-mail address PCIe ASPM: forcedly -> forcibly gma500: push through device driver tree ... Fix up trivial conflicts: - arch/arm/mach-ep93xx/dma-m2p.c (deleted) - drivers/gpio/gpio-ep93xx.c (renamed and context nearby) - drivers/net/r8169.c (just context changes)
2011-07-25Merge branch 'next/fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/linux-arm-socLinus Torvalds1-4/+4
* 'next/fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/linux-arm-soc: (35 commits) ARM: msm: platsmp: determine number of CPU cores at boot time ARM: Tegra: Seaboard: Fix I2C bus numbering for ADT7461 ARM: Tegra: Trimslice: Tri-state DAP3 pinmux ARM: orion5x: fixup 5181 MPP mask check ARM: mxs-dma: include <linux/dmaengine.h> ARM: i.MX53: consistently use MX53_UART_PAD_CTRL for uart txd/rxd/rts/cts ARM: i.MX53: UARTn_CTS pin should not change RTS input select ARM: i.MX53: UARTn_TXD pin should not change RXD input select ARM: mx25: Fix typo on CAN1_RX pad setting iomux-mx53: add missing 'IOMUX_CONFIG_SION' for some I2C pad definitions ARM: NUC93X: add UL suffix to VMALLOC_END to ensure it is properly typed ARM: LPC32XXX: add UL suffix to VMALLOC_END to ensure it is properly typed ARM: CNS3XXX: add UL suffix to VMALLOC_END to ensure it is properly typed ARM: i.MX53: Fix IOMUX type o's ARM i.MX dma: Fix burstsize settings mach-mx5: fix the I2C clock parents ARM: mxs/tx28: according to the TX28's datasheet D4-D7 are not used for MMC0 ARM i.MX23/28: platform-mxsfb: Add missing include of linux/dma-mapping.h ARM: mx53: Fix some interrupts marked as reserved. MXC: iomux-v3: correct NO_PAD_CTRL definition ... Fix up trivial conflict in arch/arm/mach-imx/mach-mx31_3ds.c
2011-07-24Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-armLinus Torvalds1-1/+9
* 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm: (237 commits) ARM: 7004/1: fix traps.h compile warnings ARM: 6998/2: kernel: use proper memory barriers for bitops ARM: 6997/1: ep93xx: increase NR_BANKS to 16 for support of 128MB RAM ARM: Fix build errors caused by adding generic macros ARM: CPU hotplug: ensure we migrate all IRQs off a downed CPU ARM: CPU hotplug: pass in proper affinity mask on IRQ migration ARM: GIC: avoid routing interrupts to offline CPUs ARM: CPU hotplug: fix abuse of irqdesc->node ARM: 6981/2: mmci: adjust calculation of f_min ARM: 7000/1: LPAE: Use long long printk format for displaying the pud ARM: 6999/1: head, zImage: Always Enter the kernel in ARM state ARM: btc: avoid invalidating the branch target cache on kernel TLB maintanence ARM: ARM_DMA_ZONE_SIZE is no more ARM: mach-shark: move ARM_DMA_ZONE_SIZE to mdesc->dma_zone_size ARM: mach-sa1100: move ARM_DMA_ZONE_SIZE to mdesc->dma_zone_size ARM: mach-realview: move from ARM_DMA_ZONE_SIZE to mdesc->dma_zone_size ARM: mach-pxa: move from ARM_DMA_ZONE_SIZE to mdesc->dma_zone_size ARM: mach-ixp4xx: move from ARM_DMA_ZONE_SIZE to mdesc->dma_zone_size ARM: mach-h720x: move from ARM_DMA_ZONE_SIZE to mdesc->dma_zone_size ARM: mach-davinci: move from ARM_DMA_ZONE_SIZE to mdesc->dma_zone_size ...
2011-07-22Merge branches 'btc', 'dma', 'entry', 'fixes', 'linker-layout', 'misc', 'mmci', 'suspend' and 'vfp' into for-nextRussell King14-56/+135
2011-07-22Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-nextLinus Torvalds1-0/+1
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1287 commits) icmp: Fix regression in nexthop resolution during replies. net: Fix ppc64 BPF JIT dependencies. acenic: include NET_SKB_PAD headroom to incoming skbs ixgbe: convert to ndo_fix_features ixgbe: only enable WoL for magic packet by default ixgbe: remove ifdef check for non-existent define ixgbe: Pass staterr instead of re-reading status and error bits from descriptor ixgbe: Move interrupt related values out of ring and into q_vector ixgbe: add structure for containing RX/TX rings to q_vector ixgbe: inline the ixgbe_maybe_stop_tx function ixgbe: Update ATR to use recorded TX queues instead of CPU for routing igb: Fix for DH89xxCC near end loopback test e1000: always call e1000_check_for_link() on e1000_ce4100 MACs. netxen: add fw version compatibility check be2net: request native mode each time the card is reset ipv4: Constrain UFO fragment sizes to multiples of 8 bytes virtio_net: Fix panic in virtnet_remove ipv6: make fragment identifications less predictable ipv6: unshare inetpeers can: make function can_get_bittiming static ...
2011-07-21mmc: print debug messages for runtime PM actionsDaniel Drake1-0/+8
At http://www.mail-archive.com/linux-mmc@vger.kernel.org/msg08371.html (thread: "mmc: sdio: reset card during power_restore") we found and fixed a bug where mmc's runtime power management functions were not being called. We have now also made improvements to the SDIO powerup routine which could possibly mask this kind of issue in future. Add debug messages to the runtime PM hooks so that it is easy to verify if and when runtime PM is happening. Signed-off-by: Daniel Drake <dsd@laptop.org> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-07-21mmc: fix runtime PM with -ENOSYS suspend caseOhad Ben-Cohen1-6/+2
In the case where a driver returns -ENOSYS from its suspend handler to indicate that the device should be powered down over suspend, the remove routine of the driver was not being called, leading to lots of confusion during resume. The problem is that runtime PM is disabled during this process, and when we reach mmc_sdio_remove, calling the runtime PM functions here (validly) return errors, and this was causing us to skip the remove function. Fix this by ignoring the error value of pm_runtime_get_sync(), which can return valid errors. This also matches the behaviour of pci_device_remove(). Signed-off-by: Daniel Drake <dsd@laptop.org> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-07-21mmc: at91_mci: move register header from include/ to drivers/Jean-Christophe PLAGNIOL-VILLARD2-1/+117
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Cc: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-07-21mmc: mxs-mmc: fix clock rate settingKoen Beel1-16/+14
Fix clock rate setting in the mxs-mmc driver. Previously, if div2 was 0 then the value for TIMING_CLOCK_RATE would have been 255 instead of 0. The limits for div1 (TIMING_CLOCK_DIVIDE) and div2 (TIMING_CLOCK_RATE+1) were also not correctly defined. Can easily be reproduced on mx23evk: default clock for high speed sdio cards is 50 MHz. With a SSP_CLK of 28.8 MHz default), this resulted in an actual clock rate of about 56 kHz. Tested on mx23evk. Signed-off-by: Koen Beel <koen.beel@barco.com> Reviewed-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-07-21mmc: tmio: fix a deadlockGuennadi Liakhovetski3-3/+11
Currently the tmio-mmc driver contains a recursive runtime PM method invocation, which leads to a deadlock on a mutex. Avoid it by taking care not to request DMA too early. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-07-21mmc: tmio: fix a recently introduced bug in DMA codeGuennadi Liakhovetski1-1/+1
A recent commit "mmc: tmio: Share register access functions" has swapped arguments of a macro and broken DMA with TMIO MMC. This patch fixes the arguments back. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-07-21mmc: sh_mmcif: maximize power savingGuennadi Liakhovetski1-9/+18
This patch uses runtime PM to allow the system to power down the MMC controller, when the MMC closk is switched off. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-07-21mmc: tmio: maximize power savingGuennadi Liakhovetski2-27/+39
This patch uses runtime PM to allow the system to power down the MMC controller, when the MMC closk is switched off. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-07-21mmc: tmio: fix recursive spinlock, don't schedule with interrupts disabledGuennadi Liakhovetski2-7/+34
Calling mmc_request_done() under a spinlock with interrupts disabled leads to a recursive spin-lock on request retry path and to scheduling in atomic context. This patch fixes both these problems by moving mmc_request_done() to the scheduler workqueue. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-07-21mmc: omap_hsmmc: fix oops in omap_hsmmc_dma_cb()Adrian Hunter1-1/+2
In the case of an I/O error, the DMA will have been cleaned up in the MMC interrupt and the request structure pointer will be null. In that case, it is essential to check if the DMA is over before dereferencing host->mrq->data. Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-07-21mmc: omap_hsmmc: refactor duplicated codeAndy Shevchenko1-44/+41
There are a few places with the same functionality. This patch creates two functions omap_hsmmc_set_bus_width() and omap_hsmmc_set_bus_mode() to do the job. Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com> Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-07-21mmc: omap_hsmmc: fix a few bugs when setting the clock divisorAndy Shevchenko1-31/+28
There are two pieces of code which are similar, but not the same. Each of them contains a bug. The SYSCTL register should be read before writing to it in omap_hsmmc_context_restore() to retain the state of the reserved bits. Before setting the clock divisor and DTO bits the value from the SYSCTL register should be masked properly. We were lucky to have no problems with DTO bits. So, make sure we have clear DTO bits properly in omap_hsmmc_set_ios(). Additionally get rid of msleep(1). The actual time is rarely higher than 30us on OMAP 3630. The resulting pieces of code are refactored into the omap_hsmmc_set_clock() function. Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com> Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2011-07-21mmc: omap_hsmmc: introduce start_clock and re-use stop_clockAndy Shevchenko1-6/+13
There is similar code in two functions which enable the clock. Refactor this code to omap_hsmmc_start_clock(). Re-use omap_hsmmc_stop_clock() in omap_hsmmc_context_restore() as well. Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com> Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com> Signed-off-by: Chris Ball <cjb@laptop.org>