aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/core
Commit message (Collapse)AuthorAgeFilesLines
* mmc: quirks: disable TEST_MMC_FW_PATCHINGZiyan2017-05-111-1/+1
| | | | | | | | | | | | | | I'm randomly getting broken kernels with this problematic emmc since switching to GCC 4.8. The problem seems to happen inside the mmc firmware patching procedure. We tried to disable GCC optimizations for these methods, but that didn't always fix the issue. By disabling TEST_MMC_FW_PATCHING, it seems like the kernel somewhat stabilized - we need to look into why it caused broken kernels/emmc lockups in the future. Change-Id: I7cf8fe14e7ab0358228a844c582e17d6bf9731a1
* mmc: quirks: change optimization levelZiyan2016-01-081-1/+1
| | | | | | For some reason, it's breaking with O0 right now but working with O1... Change-Id: Ib6f044b0137abf27f9348e2797cb271599b7fcd0
* mmc: quirks: Disable optimization on eMMC firmware patching if needed.Kyle Repinski2015-01-121-0/+11
| | | | | | | | | | | GCC 4.8 and above are breaking this code, even with as little as -Og. Signed-off-by: Kyle Repinski <repinski23@gmail.com> Conflicts: drivers/mmc/core/quirks.c Change-Id: Id165084ce96dfd825440b45dae8fc93230ce2862
* Revert "[REVIEW ME] tuna: temporary fix for gcc 4.8 build breakage"Ziyan2015-01-121-3/+0
| | | | This reverts commit f747c7de8f5a03987e9044dd56f2349b47e20bdc.
* [REVIEW ME] tuna: temporary fix for gcc 4.8 build breakageZiyann2014-11-261-0/+3
|
* [MMC] Provide access to Samsung's e-MMC Smart Report via sysfsScott Anderson2014-11-263-2/+181
| | | | | | | | | | | | | | | | | | | | | | | | | Added CONFIG_MMC_SAMSUNG_SMART which enables code that will expose Samsung's proprietary e-MMC health information to sysfs. Example output: $ cat /sys/devices/platform/*/*/mmc_host/mmc*/mmc*/samsung_smart version : 0 error mode : Normal super block size : 4194304 super page size : 32768 optimal write size : 32768 read reclaim count : 0 optimal trim size : 262144 number of banks : 2 initial bad blocks per bank : 10,4,0,0 runtime bad blocks per bank : 0,0,0,0 reserved blocks left per bank : 131,137,0,0 all erase counts (min,avg,max): 0,760,65535 SLC erase counts (min,avg,max): 0,5,74 MLC erase counts (min,avg,max): 0,790,65535 Change-Id: Ib476ea5d35264aa94b378f49121d31b20b751f04 Signed-off-by: Scott Anderson <saa@android.com>
* [MMC] Improve error handling of Samsung e-MMC wear leveling quirkScott Anderson2014-11-261-13/+28
| | | | | | | | | | | Prior to this change, errors when reading from the e-MMC during the handling of the quirk would not be detected. In addition, if an error did occur, the actual error code would be overwritten by the code that exits the special OEM mode. Change-Id: Ic470cf8ef4edb27119f0fdf1fa1b0cf44a2bf31e Signed-off-by: Scott Anderson <saa@android.com>
* Merge remote-tracking branch 'linux/linux-3.0.y' into stable-newpvrZiyann2014-11-261-1/+1
|\ | | | | | | | | Conflicts: arch/arm/include/asm/hardware/cache-l2x0.h
| * mmc: core: Fix bit width test failing on old eMMC cardsPhilip Rakity2013-05-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 836dc2fe89c968c10cada87e0dfae6626f8f9da3 upstream. PARTITION_SUPPORT needs to be set before doing the compare on version number so the bit width test does not get invalid data. Before this patch, a Sandisk iNAND eMMC card would detect 1-bit width although the hardware supports 4-bit. Only affects old emmc devices - pre 4.4 devices. Reported-by: Elad Yi <elad.yi@gmail.com> Signed-off-by: Philip Rakity <prakity@yahoo.com> Signed-off-by: Chris Ball <cjb@laptop.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | mmc: new api mmc_release_host_sync()Viswanath Puttagunta2014-10-014-6/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current mmc API to release a specific mmc host mmc_release_host() does not call host specific disable() function immediately, but schedules it to be called with some delay. Sometimes, during suspend/resume operations, this is causing host->disable() function not to be called before suspend and so the resources associated with host are not released resulting in clocks not being released. The new API mmc_release_host_sync() calls mmc_host_disable() immediately instead of calling mmc_host_lazy_diable(). Change-Id: I64f3c8a96c29d9f4cff0382a3fe131faf48f2da1 Signed-off-by: Viswanath Puttagunta <vishp@ti.com> Signed-off-by: Leonid Iziumtsev <x0153368@ti.com> Conflicts: drivers/mmc/core/sdio.c drivers/mmc/host/omap_hsmmc.c
* | SDIO: Add support for CCCR version 3.0 and SDIO revision 3.0Pradeep Gurumath2014-10-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | Add CCCR structure version 3 define in sdio.h and using it for check in API sdio_read_cccr Also added SDIO Revision number 3.0 in sdio.h which is referenced by the TI WiLink driver Change-Id: I309439a00d67b1ca97b11c332bc0ca5a54415356 Signed-off-by: Pradeep Gurumath <pradeepgurumath@ti.com> Signed-off-by: Panduranga Mallireddy <panduranga_mallireddy@ti.com>
* | mmc: core: Kill block requests if card is removedSujit Reddy Thumma2014-10-011-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Kill block requests when the host knows that the card is removed from the slot and is sure that subsequent requests are bound to fail. Do this silently so that the block layer doesn't output unnecessary error messages. This patch implements suggestion from Adrian Hunter, http://thread.gmane.org/gmane.linux.kernel.mmc/2714/focus=3474 Change-Id: I146299b4acbcce95f9cfac114ee3feb56d1a13bd Signed-off-by: Sujit Reddy Thumma <sthumma <at> codeaurora.org> Signed-off-by: David Taylor <x0158378@ti.com>
* | MMC: increased write data timeout for SD cards to 500msAndrii Guriev2014-10-011-3/+4
| | | | | | | | | | | | | | | | | | According to SD Specifications version 3.01 application note, the recommended write timeout for SD hosts is atleast 500 ms. Change-Id: I3c00b588c1c875d04ad1b5c40fc4270dc54611dc Signed-off-by: Andrii Guriev <x0160204@ti.com> Signed-off-by: Viswanath Puttagunta <vishp@ti.com>
* | Merge branch 'android-omap-3.0' into android-omap-tuna-3.0Todd Poynor2013-01-163-8/+11
|\ \
| * \ Merge branch 'android-3.0' into android-omap-3.0Todd Poynor2013-01-163-8/+11
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | Fixup incompatible code in opp.c: omap_init_opp_table() Change-Id: Iac7d60b814a539285d00e0a3dbb6e3f0060cb683 Signed-off-by: Todd Poynor <toddpoynor@google.com>
| | * \ Merge remote-tracking branch 'stable/linux-3.0.y' into android-3.0Todd Poynor2012-11-013-8/+11
| | |\ \ | | | |/ | | | | | | | | | | | | Change-Id: I9685feb9277b450da10d78a455b3c0674d6cfe18 Signed-off-by: Todd Poynor <toddpoynor@google.com>
| | | * mmc: sd: Handle SD3.0 cards not supporting UHS-I bus speed modeSubhash Jadavani2012-10-021-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit f2815f68dabbb373fd1c9f0fd4a609d486697c2b upstream. Here is Essential conditions to indicate Version 3.00 Card (SD_SPEC=2 and SD_SPEC3=1) : (1) The card shall support CMD6 (2) The card shall support CMD8 (3) The card shall support CMD42 (4) User area capacity shall be up to 2GB (SDSC) or 32GB (SDHC) User area capacity shall be more than or equal to 32GB and up to 2TB (SDXC) (5) Speed Class shall be supported (SDHC or SDXC) So even if SD card doesn't support any of the newly defined UHS-I bus speed mode, it can advertise itself as SD3.0 cards as long as it supports all the essential conditions of SD3.0 cards. Given this, these type of cards should atleast run in High Speed mode @50MHZ if it supports HS. But current initialization sequence for SD3.0 cards is such that these non-UHS-I SD3.0 cards runs in Default Speed mode @25MHz. This patch makes sure that these non-UHS-I SD3.0 cards run in High Speed Mode @50MHz. Tested this patch with SanDisk Extreme SDHC 8GB Class 10 card. Reported-by: "Hiremath, Vaibhav" <hvaibhav@ti.com> Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org> Signed-off-by: Chris Ball <cjb@laptop.org>
| | | * mmc: sdio: avoid spurious calls to interrupt handlersNicolas Pitre2012-06-012-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit bbbc4c4d8c5face097d695f9bf3a39647ba6b7e7 upstream. Commit 06e8935feb ("optimized SDIO IRQ handling for single irq") introduced some spurious calls to SDIO function interrupt handlers, such as when the SDIO IRQ thread is started, or the safety check performed upon a system resume. Let's add a flag to perform the optimization only when a real interrupt is signaled by the host driver and we know there is no point confirming it. Reported-by: Sujit Reddy Thumma <sthumma@codeaurora.org> Signed-off-by: Nicolas Pitre <nico@linaro.org> Signed-off-by: Chris Ball <cjb@laptop.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | | | Merge branch 'android-omap-3.0' into android-omap-tuna-3.0Todd Poynor2012-08-161-0/+1
|\ \ \ \ | |/ / /
| * | | Merge branch 'android-3.0' into android-omap-3.0Todd Poynor2012-08-161-0/+1
| |\ \ \ | | |/ /
| | * | mmc: Make sure host is disabled on suspendDmitry Shmidt2012-08-161-0/+1
| | | | | | | | | | | | | | | | | | | | Change-Id: Ie0bf2004e173cef8dad66722a152658d7727ab65 Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
| | * | Merge linux-stable 3.0.28 into android-3.0Todd Poynor2012-04-195-6/+12
| | |\ \ | | | |/ | | | | | | | | | | | | Change-Id: Iee820738e53627f5d0447a87ceff34443aa72786 Signed-off-by: Todd Poynor <toddpoynor@google.com>
* | | | Merge branch 'android-omap-3.0' into android-omap-tuna-3.0Todd Poynor2012-04-195-6/+12
|\ \ \ \ | |/ / / | | | | | | | | | | | | Change-Id: I336ba4d61beba035ecc237ccc68b012e48702a87 Signed-off-by: Todd Poynor <toddpoynor@google.com>
| * | | Merge linux-omap-3.0 into android-omap-3.0Todd Poynor2012-04-195-6/+12
| |\ \ \ | | | | | | | | | | | | | | | | | | | | Change-Id: I86dcae86b15baab2cb26e2c53faafb57c606a2b5 Signed-off-by: Todd Poynor <toddpoynor@google.com>
| | * \ \ Merge linux-stable 3.0.28 into linux-omap-3.0Todd Poynor2012-04-195-6/+12
| | |\ \ \ | | | | |/ | | | |/| | | | | | | | | | | Change-Id: I76904a60370e2cb9cc29ccde5d526d9183ff4f8e Signed-off-by: Todd Poynor <toddpoynor@google.com>
| | | * | mmc: core: Fix voltage select in DDR modeGirish K S2012-01-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 913047e9e5787a90696533a9f109552b7694ecc9 upstream. This patch fixes the wrong comparison before setting the interface voltage in DDR mode. The assignment to the variable ddr before comaprison is either ddr = MMC_1_2V_DDR_MODE; or ddr == MMC_1_8V_DDR_MODE. But the comparison is done with the extended csd value if ddr == EXT_CSD_CARD_TYPE_DDR_1_2V. Signed-off-by: Girish K S <girish.shivananjappa@linaro.org> Acked-by: Subhash Jadavani <subhashj@codeaurora.org> Acked-by: Philip Rakity <prakity@marvell.com> Signed-off-by: Chris Ball <cjb@laptop.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| | | * | mmc: core: ext_csd.raw_* used in comparison but never setAndrei Warkentin2011-11-111-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 5238acbe36dd5100fb6b035a995ae5fc89dd0708 upstream. f39b2dd9d ("mmc: core: Bus width testing needs to handle suspend/resume") added code to only compare read-only ext_csd fields in bus width testing code, yet it's comparing some fields that are never set. The affected fields are ext_csd.raw_erased_mem_count and ext_csd.raw_partition_support. Signed-off-by: Andrei Warkentin <andrey.warkentin@gmail.com> Acked-by: Philip Rakity <prakity@marvell.com> Signed-off-by: Chris Ball <cjb@laptop.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| | | * | mmc: core: Fix hangs related to insert/remove of cardsUlf Hansson2011-11-115-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 7f7e4129c23f0419257184dff6fec89d2d5a8964 upstream. During a rescan operation mmc_attach(sd|mmc|sdio) functions are called. The error handling in these function can trigger a detach of the bus, which also meant a power off. This is not notified by the rescan operation which then continues to the next attach function. If a power off has been done, the framework must never send any new commands to the host driver, without first doing a new power up. This will most likely trigger any host driver to hang. Moving power off out of detach and instead handle power off separately when it is actually needed, solves the issue. Signed-off-by: Ulf Hansson <ulf.hansson@stericsson.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Chris Ball <cjb@laptop.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | | | | [MMC] Patch the firmware of certain Samsung emmc parts to fix a bugKen Sumrall2012-03-012-0/+263
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Patch the firmware in certain Samsung emmc chips after every power-on to workaround a bug in the wear leveling code. Patch provided by Samsung Semiconductor, and the code to apply the patch was originally written by Jeonghwan Min of Samsung. Change-Id: Id40cfb8f68842fc4a47f60ae032f1b49c0fcb65e Signed-off-by: Ken Sumrall <ksumrall@android.com>
* | | | Merge branch 'android-3.0' into android-omap-3.0Erik Gilling2012-01-091-17/+7
|\ \ \ \ | | |_|/ | |/| |
| * | | mmc: Set suspend/resume bus operations if CONFIG_PM_RUNTIME is usedDmitry Shmidt2011-12-191-17/+7
| | | | | | | | | | | | | | | | Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
| * | | Merge commit 'v3.0.8' into android-3.0Colin Cross2011-10-273-14/+41
| |\ \ \ | | | |/ | | |/|
* | | | Merge branch 'linux-omap-3.0' into android-omap-3.0Colin Cross2011-10-273-14/+41
|\ \ \ \ | | |_|/ | |/| |
| * | | Merge commit 'v3.0.8' into linux-omap-3.0Colin Cross2011-10-273-14/+41
| |\ \ \ | | | |/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: drivers/tty/serial/omap-serial.c drivers/usb/musb/musb_gadget.c sound/soc/omap/omap-mcbsp.c Change-Id: Ic31b7266dda3ac8483f737272874ebf4725b5fe3
| | * | mmc: core: use non-reentrant workqueue for clock gatingMika Westerberg2011-10-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 50a50f9248497484c678631a9c1a719f1aaeab79 upstream. 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> Signed-off-by: Chris Ball <cjb@laptop.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| | * | mmc: core: prevent aggressive clock gating racing with ios updatesMika Westerberg2011-10-031-2/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 778e277cb82411c9002ca28ccbd216c4d9eb9158 upstream. 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> Signed-off-by: Chris Ball <cjb@laptop.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| | * | mmc: rename mmc_host_clk_{ungate|gate} to mmc_host_clk_{hold|release}Mika Westerberg2011-10-033-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 08c14071fda4e69abb9d5b1566651cd092b158d3 upstream. 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> Signed-off-by: Chris Ball <cjb@laptop.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | | Merge commit 'v3.0' into linux-omap-3.0Colin Cross2011-08-101-27/+50
| |\ \ \ | | |/ /
* | | | Merge branch 'android-3.0' into android-omap-3.0Colin Cross2011-09-082-17/+16
|\ \ \ \ | | |_|/ | |/| |
| * | | mmc: core: host: only use wakelock for detect workColin Cross2011-09-072-17/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is no need to take a wakelock for delayed lazy disable work, it will be cancelled in the suspend handler and force disabled. Only take the wakelock when the detect work is queued, and make sure to drop the wakelock if the work is cancelled. Change-Id: I1e507a5f98848954ea21d45e23b6192c3132a349 Signed-off-by: Colin Cross <ccross@android.com>
* | | | Merge branch 'android-3.0' into android-omap-3.0Colin Cross2011-08-101-27/+50
|\ \ \ \ | |/ / /
| * | | Merge commit 'v3.0' into android-3.0Colin Cross2011-08-101-27/+50
| |\ \ \ | | | |/ | | |/|
| | * | mmc: core: Bus width testing needs to handle suspend/resumePhilip Rakity2011-07-131-27/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On reading the ext_csd for the first time (in 1 bit mode), save the ext_csd information needed for bus width compare. On every pass we make re-reading the ext_csd, compare the data against the saved ext_csd data. This fixes a regression introduced in 3.0-rc1 by 08ee80cc397ac1a3 ("mmc: core: eMMC bus width may not work on all platforms"), which incorrectly assumed we would be re-reading the ext_csd at resume- time. Signed-off-by: Philip Rakity <prakity@marvell.com> Tested-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Chris Ball <cjb@laptop.org>
* | | | Merge branch 'linux-omap-3.0' into android-omap-3.0Colin Cross2011-07-151-2/+6
|\ \ \ \ | |/ / / |/| | / | | |/ | |/|
| * | MMC: eMMC: Sleep before OFFBalaji T K2011-07-141-2/+6
| |/ | | | | | | | | | | | | | | As per the eMMC spec the card should be put to sleep before Vcc is turned off. Put eMMC to sleep in the core suspend sequence. Signed-off-by: Madhusudhan Chikkature <madhu.cr@ti.com> Signed-off-by: Balaji T K <balajitk@ti.com>
* | Merge commit 'v3.0-rc5' into android-3.0Colin Cross2011-06-293-2/+41
|\ \ | |/
| * mmc: core: make erase timeout calculation allow for gated clockAdrian Hunter2011-06-251-1/+1
| | | | | | | | | | | | | | | | | | The erase timeout calculation may depend on clock rate which is zero if the clock is gated, so use mmc_host_clk_rate() which allows for that case. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Chris Ball <cjb@laptop.org>
| * mmc: sdio: reset card during power_restoreDaniel Drake2011-06-251-0/+39
| | | | | | | | | | | | | | | | | | mmc_sdio_power_restore() skips some steps that are performed in other power-related codepaths which are necessary to fully reset the card. Without this, runtime PM fails for SD8686 SDIO wifi on OLPC XO-1.5. Signed-off-by: Daniel Drake <dsd@laptop.org> Signed-off-by: Chris Ball <cjb@laptop.org>
| * mmc: sdio: fix runtime PM path during driver removalOhad Ben-Cohen2011-06-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After commit e1866b3 "PM / Runtime: Rework runtime PM handling during driver removal" was introduced, the driver core stopped incrementing the runtime PM usage counter of the device during the invocation of the ->remove() callback. This indirectly broke SDIO's runtime PM path during driver removal, because no one calls _put_sync() anymore after ->remove() completes. This means that the power of runtime-PM-managed SDIO cards is kept high after their driver is removed (even if it was powered down beforehand). Fix that by directly calling _put_sync() when the last usage counter is downref'ed by the SDIO bus. Reported-and-tested-by: Daniel Drake <dsd@laptop.org> Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com> Signed-off-by: Chris Ball <cjb@laptop.org>
* | Revert "mmc: subtract boot sectors from disk size for eMMC 4.3+ devices"Colin Cross2011-06-141-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit f0b0e4bec1e89014f3dcef4da8bcf95428cc771c. The reverted commit incorrectly calculates the size of eMMC devices in some (all?) cases. This revert may cause problems in cases where the bootloader was bug-compatible and puts a GPT partition at the incorrect end of the eMMC device. Signed-off-by: Colin Cross <ccross@android.com>