summaryrefslogtreecommitdiff
path: root/include (follow)
Commit message (Collapse)AuthorAge
...
| | * | | | | | | mmc: core: Fix clock frequency transitions during invalid statesSujit Reddy Thumma2016-05-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | eMMC and SD card specifications restrict the usage of a class of commands while commands in other class are in progress. For example, during erase operations the SD/eMMC spec. allows only CMD35, CMD36, CMD38. If clock scaling is enabled and decide to scale up the clocks it may be possible that CMD19/21 tuning commands are sent in between erase commands, which is illegal as per specification. Fix such illegal transactions to the card and also make clock scaling statistics accountable only for read/write commands instead of time consuming commands, like CMD38 erase, where transactions are independent of bus frequency. Change-Id: Iffba175787837e7f95bde8970f19d0f0f9d7d67d Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org> [merez@codeaurora.org: fix conflicts as mmc_update_clk_scaling is missing on 3.14] Signed-off-by: Maya Erez <merez@codeaurora.org>
| | * | | | | | | mmc: core: fix buffer overflow during memcpy of ext_csdSujit Reddy Thumma2016-05-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix buffer overflow while caching the mmc ext_csd content. Also, to avoid duplicate allocation keep the allocated ext_csd till the card is removed. CRs-Fixed: 583929 Change-Id: I5d69e37f6fd1f5249479d454c353be050df40b6d Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org> [subhashj@codeaurora.org: fixed trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
| | * | | | | | | mmc: core: add clock-scaling support to HS400 cardsAsutosh Das2016-05-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds clock scaling support to HS400 cards. Scaling down to 52MHz from HS400 involves: - switching the bus-speed mode to HS at 52MHz Scaling up to HS400 would require all of the initialization process upto HS400 mode selection. Change-Id: I8196d6666bcc0ef327659253df53a17792fa51f7 Signed-off-by: Asutosh Das <asutoshd@codeaurora.org> Signed-off-by: Krishna Konda <kkonda@codeaurora.org> [venkatg@codeaurora.org: fix mmc_select_hs args and MAX_DTRs as used in 3.14 kernel] Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org> [subhashj@codeaurora.org: fixed merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
| | * | | | | | | mmc: core: add wakeup functionality to sdio cardsAsutosh Das2016-05-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch initializes wakeup source if the detected card is a sdio card and enables the wakeup capability. Platform drivers would have to invoke: * pm_wakeup_event on this card device to signal a wakeup * corresponding pm_relax have to be invoked Change-Id: Ic8d5c98073e8ed3f676eb42fc0ce1f13a11cb40f Signed-off-by: Asutosh Das <asutoshd@codeaurora.org> [merez@codeaurora.org: fix conflicts due to different PM in 3.14] Signed-off-by: Maya Erez <merez@codeaurora.org> [subhashj@codeaurora.org: fixed trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
| | * | | | | | | mmc: Add long power off notification supportTatyana Brokhman2016-05-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At the moment only POWER_OFF_SHORT is sent to the device in case the host is suspended. This patch adds the support of sending POWER_OFF_LONG notification in case the device is powered off. According to device vendors the POWER_OFF_LONG notification will shorten the initialization time of the eMMC card during next boot up. Change-Id: I3c6f224398450cf10463cbb316613fd430d1e8d2 Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org> Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org> [merez@codeaurora.org: fix conflicts as some of the code was already included] Signed-off-by: Maya Erez <merez@codeaurora.org> [venkatg@codeaurora.org: Remove PM related code] Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org> [subhashj@codeaurora.org: fixed trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
| | * | | | | | | mmc: sdio: enable asynchronous interrupt support in 4-bit modeSubhash Jadavani2016-05-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SDIO 3.0 specification has added the support for asynchronous interrupt period during which card allows the clock to be gated off. Host needs to first read the "Support Asynchronous Interrupt" bit in CCCR register space to check if the card supports the feature or not. If yes and if the host wants to enable the feature, host needs to write '1' to "Enable Asynchronous Interrupt" bit in CCCR register space. This change allows the host controller driver to control whether to enable the asynchronous interrupt in card or not and if the asynchronous interrupt is enabled then clock gating feature would be enabled for such cards. Change-Id: I678cffb63af6a2013640a5eafa6ce9bfad8a51d6 Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org> [merez@codeaurora.org: fix CAPS2 index] Signed-off-by: Maya Erez <merez@codeaurora.org> [subhashj@codeaurora.org: fixed trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
| | * | | | | | | mmc: core: Add support for notifying host driver while scaling clocksSujit Reddy Thumma2016-05-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Host drivers can participate in clock scaling by registering ->notify_load host operation, which allows host driver to carry out platform specific operations for further power savings or increasing throughput based on whether load is LOW or HIGH respectively. This can be applicable to non-ultra high speed cards as well so remove the check for ultra high speed cards to initialize clock scaling. Change-Id: Icaab9520135e384f5470db68b2f25c5cdce5663a Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org> [merez:codeaurora@org: fix conflicts due to removal of stop transmission] Signed-off-by: Maya Erez <merez@codeaurora.org> [subhashj@codeaurora.org: fixed trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
| | * | | | | | | mmc: core: Log MMC clock frequency transitionsSujit Reddy Thumma2016-05-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use kernel's ftrace support to capture MMC clock frequency transitions which can be useful for debugging issues related to power consumption. Usage: mount -t debugfs none /sys/kernel/debug echo 1 > /sys/kernel/debug/tracing/events/mmc/mmc_clk/enable cat /sys/kernel/debug/tracing/trace_pipe Change-Id: I25c4ee39dcbe30e7665902a9f723a5a421b55ca3 Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
| | * | | | | | | mmc: block: do not pack REQ_FUA requestKonstantin Dorfman2016-05-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change will prevent packing of a request marked with REQ_FUA flag, because it has the same semantics as REQ_FLUSH. Also packing statistics are updated with FUA stop reason. Change-Id: Iaad37044ec43f93e898ed0c011b0bce7b91ae13d Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org>
| | * | | | | | | mmc: Keep track of current hard partitionOluwafemi Adeyemi2016-05-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | eMMC may have several hard partitions such as BOOT and RPMB in addition to the main USER partition. On resume(if card is reinitialized), the current hard partition is always switched to the default USER partition. But this switch to default partition is not propagated to the MMC block driver, which may have set the hard partition to any partition(BOOT/RPMB) other than USER before suspend. After resume, the MMC block driver still assumes it is accessing the previously set partition(BOOT/RPMB), and instead overwrites the USER partition(the current selected partition on the eMMC device). To prevent this, make MMC block driver aware of the partition switches done as part of card reinitialization. CRs-Fixed: 439313 Change-Id: I3e959101a1c56c1e6631da3d660f4b914e100503 Signed-off-by: Oluwafemi Adeyemi <aadeyemi@codeaurora.org> Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org> [subhashj@codeaurora.org: fixed trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
| | * | | | | | | mmc: do not pack random requestsMaya Erez2016-05-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Packed commands causes higher latency since the completion of each request is sent to the upper layer upon completion of the complete packed request. The benefit from this feature is card dependent. Some of the card vendors do not have any benefit from using packed commands for random requests. In case there is no benefit in random requests packing, it is better to disable the packing to prevent this high latency. This patch also add the new stop packing reason to the write packing statistics. Change-Id: I141887dcef2ceee14848634cc27c3c85f8edc7a5 Signed-off-by: Maya Erez <merez@codeaurora.org> [merez@codeaurora.org: fix conflicts due to removal of BKOPS] Signed-off-by: Maya Erez <merez@codeaurora.org>
| | * | | | | | | mmc: core: interrupt Background Operations if it takes too longSubhash Jadavani2016-05-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently we have 4 mins timeout for the blocking BKOPs to complete but we have seen instances where card is surprisingly taking even longer time to complete background operations. If card doesn't complete the BKOPs within specified timeout, we will send the HPI command to interrupt the ongoing BKOPs. Change-Id: I5df81bdfd9b19bee30a394ee0ff4390b292691d0 Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org> [merez@codeaurora.org: fix conflicts due to changes in 3.14] Signed-off-by: Maya Erez <merez@codeaurora.org>
| | * | | | | | | mmc: core: Add load based clock scaling supportSujit Reddy Thumma2016-05-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The SD3.0/eMMC4.5/SDIO3.0 cards can support clock rates upto 200MHz (SDR104 or HS200 bus speed modes). For some workloads like video playback it isn't necessary for these cards to run at such high speed. Running at lower frequency, say 50MHz, in such cases can still meet the deadlines for data transfers. Scaling down the clock frequency dynamically has huge power savings not only because the bus is running at lower frequency but also has an advantage of scaling down the system core voltage, if supported. Provide an ondemand clock scaling support similar to cpufreq ondemand governor having two thresholds, up_threshold and down_threshold to decide whether to increase the frequency or scale it down respectively. The sampling interval is in the order of milliseconds and should be chosen by host drivers that enable MMC_CAP2_CLK_SCALE capability to take advantage of clock scaling. The sampling interval mainly depends on the the clock switching delays and hence a host driver decision. If sampling interval is too low frequent switching of frequencies can lead to high power consumption and if sampling interval is too high, the clock scaling logic would take long time to realize that the underlying hardware (controller and card) is busy and scale up the clocks. Change-Id: I22a5054beec41b0b66b3bf030ddfcf284de448b3 Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org> [merez@codeaurora.org: fixed conflicts due to changes in 3.14] Signed-off-by: Maya Erez <merez@codeaurora.org> [venkatg@codeaurora.org: runtime pm related changes to accommodate pm framework from 3.14 kernel] Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org> [subhashj@codeaurora.org: fixed merge conflicts and fixed compilation errors] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
| | * | | | | | | mmc: block: Add MMC write packing statisticsTatyana Brokhman2016-05-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The write packing statistics are used for the packed commands unit tests in order to determine test success or failure Change-Id: I5eea513991c794543fbb3d009d8b7db0b0912fc5 Signed-off-by: Maya Erez <merez@codeaurora.org> Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org> [subhashj@codeaurora.org: fixed trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
| | * | | | | | | mmc: block: Add write packing controlTatyana Brokhman2016-05-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The write packing control will ensure that read requests latency is not increased due to long write packed commands. The trigger for enabling the write packing is managing to pack several write requests. The number of potential packed requests that will trigger the packing can be configured via sysfs by writing the required value to: /sys/block/<block_dev_name>/num_wr_reqs_to_start_packing. The trigger for disabling the write packing is fetching a read request. Change-Id: I22e8ab04cd9aca220678784c39306068a0996790 Signed-off-by: Maya Erez <merez@codeaurora.org> Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org> [merez@codeaurora.org: fixed trivial conflicts] Signed-off-by: Maya Erez <merez@codeaurora.org> [subhashj@codeaurora.org: fixed trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
| | * | | | | | | mmc: block: do not query the sd card if a fault is injectedAsutosh Das2016-05-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the fault injection framework introduces an error to the data block, the current code queries the SD card to find the number of blocks actually programmed. This value would be as requested by the generic block layer. So the entire request would be completed. Say, request 0 is pulled from queue and submitted. When this is being processed, request 1 is pulled from queue and prepared. Request 0 though is successful, fault-injection framework injects an error and modifies the bytes_xferred variable to a random value less than requested transfer. Request 1 is not processed and during the handling of error, the SD card is queried for the actual bytes programmed. This would be the correct value. Thus blk_end_request would complete this request and the control would return to fetch request 2. In this process, request 1 is not processed at all and the application waits indefinitely for request 1 to be processed. No further requests are issued to the queue. This patch identifies, if the fault injection-framework has inserted an error to this request and doesn't query the card and uses bytes_xferred to complete the request. Change-Id: I496802e244745bc7550402027a594d967cf7b756 Signed-off-by: Asutosh Das <asutoshd@codeaurora.org> [subhashj@codeaurora.org: fixed trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
| | * | | | | | | mmc: host: remove mmcq performance numbers statisticsSubhash Jadavani2016-05-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mmcq performance numbers are not captured since asynchronous MMC request support got added in MMC block driver. So printing out these numbers (which are all zeros) just adds confusion. This patch removes the printing of mmcq performance numbers statistics. CRs-Fixed: 364206 Change-Id: I7213b11c8e9e055894c9902af7e975de3be1c519 Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
| | * | | | | | | mmc: quirks: Fix data timeout values for certain SanDisk eMMC cardsPratibhasagar V2016-05-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some INAND MCP devices advertise incorrect data timeout values. This leads to data timeout errors on the platform. So, add a quirk for such devices to facilitate proper functionality. CRs-Fixed: 355347 Change-Id: If4fdd2724dc407450da8529222efca7ee94f50df Signed-off-by: Pratibhasagar V <pratibha@codeaurora.org> [merez@codeaurora.org: fix num of quirk to an additional quirk on 3.14] Signed-off-by: Maya Erez <merez@codeaurora.org> [subhashj@codeaurora.org: fixed trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
| | * | | | | | | mmc: core: capture performance numbers only when askedSubhash Jadavani2016-05-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently performance numbers are captured for each SDCC transfers unconditionally which may add the overhead and could reduce the SDCC read/write throughput numbers. This change adds additional control for enabling/disabling the capturing of performance numbers at runtime. We already have sysfs entry named "perf" for msm sdcc devices. Currently setting this entry to 0 clears the performance statistics. But now we are changing the definition of this entry as mentioned below: Disable performance capturing and clear the performance statistics: "echo 0 > /sys/devices/platform/msm_sdcc.<n>/perf" Enable performance capturing: "echo 1 > /sys/devices/platform/msm_sdcc.<n>/perf" CRs-fixed: 345170 Change-Id: I3ab9288fd87cc8a8ada6c0c3d066cac4f68d79b7 Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
| | * | | | | | | mmc: Add profiling code to measure performance at MMC layers.Aparna Mallavarapu2016-05-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Profiling code is added to measure read, write times for the MMC requests at various MMC layers. Profiling is done at the MMC queue and at the driver level. This information can be viewed through a sysfs entry called perf. Change-Id: I7c65bfe25a1f7774e3a9abf1f9539e690b3718ec Signed-off-by: Aparna Mallavarapu <aparnam@codeaurora.org> Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org> [subhashj@codeaurora.org: fixed trivial merge conflict] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
| | * | | | | | | mmc: core: Export mmc_set_ios so that host drivers can use itSujit Reddy Thumma2016-05-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mmc_set_ios() is used by host drivers during suspend/resume routines in indirect way i.e., by calling host->ops->set_ios(). But now with MMC_CLKGATE enabled, mmc_set_ios() also updates host->clk_gated flag. So export this API so that host controller drivers can use it. Change-Id: Ib0c177635bb8d87ba68c98e08b8d940c73f2b80c Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org> [merez@codeaurora.org: fix trivial conflicts] Signed-off-by: Maya Erez <merez@codeaurora.org>
| | * | | | | | | mmc: core: Determine correct access mode for eMMC cards by reading OCRSujith Reddy Thumma2016-05-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MMC core reads SEC_COUNT information from EXT_CSD register and assumes that the card supports sector access mode. Some eMMC cards (<=2GB) do not support this mode even though they have SEC_COUNT value defined, causing failure while populating extended partitions. Sector/Byte access mode information is stored in OCR register. Hence, read OCR bit 30 and then confirm it with SEC_COUNT value to know whether the card supports sector access mode or byte access mode. Change-Id: Ifdfff35309e8667cd2c2ac2761b9a708d5b785d3 Signed-off-by: Sujith Reddy Thumma <sthumma@codeaurora.org>
| | * | | | | | | mmc: sdio: Fix sdio_disable_wide to properly handle 8 bit bus width.Murali Palnati2016-05-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I2e712f5d8f6ff8da9fdabe8cf30e378c560e067f Signed-off-by: Murali Palnati <palnatim@codeaurora.org>
| | * | | | | | | mmc: core: Fix race between runtime PM suspend and block requestsSujith Reddy Thumma2016-05-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a possible race with mmc_claim_host() in mmc_sd_suspend()/ mmc_suspend() and mmc_claim_host() in mmc_blk_issue_rq() when runtime pm is enabled. Fix this by blocking processing of requests until the previous runtime suspend is processed and then resume as part of msmsdcc_enable(). Previous fix has card detection failure as a side effect during resume. Change-Id: I9cb31269638d9db4e630eb22b973a5335af1bda4 Signed-off-by: Sujith Reddy Thumma <sthumma@codeaurora.org> [sboyd: Dropped msm driver change] Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> [subhashj@codeaurora.org: fixed trivial merge conflict] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
| | * | | | | | | mmc: core: Fix MMC clock scaling in case of tuning failureSahitya Tummala2016-05-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the clock scaling state is changed from MMC_LOAD_LOW to MMC_LOAD_HIGH, the clocks are first scaled up and then tuning is performed. But in case of tuning failure, the current code does nothing but still retain the previous clock scale stats (state and curr_freq within struct clk_scaling). Hence, correct it to scale down the clocks in case of tuning failure so that clock scaling stats reflect the correct status. This also helps proceed with data transfers at lower clock rate in such cases. Change-Id: I7e9379d1e3ddc863132af31019604c22a42f8d59 Signed-off-by: Sahitya Tummala <stummala@codeaurora.org> [subhashj@codeaurora.org: fixed compilation error] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
| | * | | | | | | mmc: core: export mmc_host_may_gate_card functionSubhash Jadavani2016-05-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MMC Host driver might want to use the mmc_host_may_gate_card() API to know whether the clock can be gated to the card or not hence export this function for usage outside its current scope. Change-Id: I9ec4173063e2505eca179161cdf8cda033a3fd4b Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org> [merez@codeaurora.org: fix trivial conflicts] Signed-off-by: Maya Erez <merez@codeaurora.org>
| | * | | | | | | mmc: sdhci: add support nonhotplugGuoping Yu2016-05-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With some devices, SD card could not support hotplug as there is no cd-gpio, and also could not use polling way due to power comsumption. So add nonhotplug to meet such requirement and when SD card lost or removed manually, device will not crash until next reboot process to detect SD card. Change-Id: Ie8ea8ec57015f36689a119249003eeaa48391393 Signed-off-by: Guoping Yu <guopingy@codeaurora.org> [subhashj@codeaurora.org: fixed minor merge conflict] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
| | * | | | | | | mmc: sdhci: Add tracepoints to enhance debuggingVenkat Gopalakrishnan2016-05-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instrument the sdhci driver with tracepoints to aid in debugging issues and identifying latencies in the following path: * CMD completion * DATA completion * DMA preparation * Post DMA cleanup Change-Id: Ie8cd0c2fb6c1bd6ab13883123be021081f8b8f78 Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org> [subhashj@codeaurora.org: fixed minor merge conflict] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
| | * | | | | | | mmc: sdhci-msm: Fix issue with 1.8v switch sequence in 3.10 kernelSahitya Tummala2016-05-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The SD3.0 voltage switch sequence to 1.8v would involve stopping the SDCLK before changing the voltage level and with recent changes in 3.10 kernel, the peripheral clocks are also getting disabled instead of just stopping the clock to the card. This patch makes sure this doesn't happen by marking the flag card_clock_off in struct mmc_host before starting the voltage switch sequence and checking it in host controller driver. Change-Id: If62378ba1dd369e69524365a4421d57317c22ca2 Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
| | * | | | | | | mmc: sdhci: Defer release of CPU DMA PM QoS vote in high load casesSujit Reddy Thumma2016-05-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PM QoS vote of default value mean that the CPU is allowed to move into deepest low power mode whenever possible. Currently, if there are back-to-back MMC requests, with a short delay, the PM QoS vote to default value is done immediately which cause the immediate request to have high latency as the CPU might have idle'd and moved to deepest low power mode. To avoid this defer the PM QoS vote till a defined timeout (pm_qos_timeout_us), so that back-to-back requests may not suffer from additional latencies. In addition, if the load on MMC is low, the additional latency may be sustainable. Hence, aggressively release the vote in order to achieve additional power savings. CRs-Fixed: 501712 Change-Id: I82166b0ce9416eb0d519f7da26e5a96956093cb2 Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org> [subhashj@codeaurora.org: fixed minor merge conflict and fixed compilation errors] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
| | * | | | | | | Revert "mmc: core: Remove the ->enable|disable() callbacks"Subhash Jadavani2016-05-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 40433267331bc6b9d70d5cdd14bfa2c8e3e5f0ec as MSM platforms still needs ->enable/disable() callbacks. Conflicts: drivers/mmc/core/core.c Change-Id: Ifd986825c10f1475bfcdac37ea1f3b99e5f6daaf Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
| | * | | | | | | Revert "mmc: core: Remove MMC_CLKGATE"Subhash Jadavani2016-05-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 9eadcc0581a8ccaf4c2378aa1c193fb164304f1d. Clock gating is needed for Qualcomm Platforms hence reverting this upstream patch. Change-Id: I96ac0c1c7627e8e5c2d18782e2fc08608f0a7f91 Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* | | | | | | | | arm64: Add support for app specific settingsSarangdhar Joshi2016-06-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support to provide an interface that can be used from userspace to decide whether app specific settings need to be applied / cleared when particular processes are running. CRs-Fixed: 981519 997757 Change-Id: Id81f8b70de64f291a8586150f4d2c7c8f8b4420f Signed-off-by: Sarangdhar Joshi <spjoshi@codeaurora.org> [satyap@codeaurora.org: trivial merge conflict resolution and pull fixes for CR: 997757] Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
* | | | | | | | | clk: qcom: gdsc: Add GDSCs in msm8996 GCCRajendra Nayak2016-06-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add all data for the GDSCs which are part of msm8996 GCC block Change-Id: I12323575c44b1a3ba4cb2764a498480b3e62dcaa Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Taniya Das <tdas@codeaurora.org>
* | | | | | | | | msm: vidc: Enable blur support for encodeArun Menon2016-06-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add v4l2 control extensions to allow the video driver client to enable/disable blur feature in the firmware. CRs-Fixed: 975505 Change-Id: I1b340d13bfef3b71d049d53c9bb79e4effafc79a Signed-off-by: Arun Menon <avmenon@codeaurora.org>
* | | | | | | | | Revert "sched: warn/panic upon excessive scheduling latency"Joonwoo Park2016-06-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 8f90803a45d3aa349 ("sched: warn/panic upon excessive scheduling latency") as this feature is no longer used. Change-Id: I200d0e9e8dad5047522cd02a68de25d4a70a91a4 Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
* | | | | | | | | Revert "sched: add scheduling latency tracking procfs node"Joonwoo Park2016-06-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit b40bf941f61756bcc ("sched: add scheduling latency tracking procfs node") as this feature is no longer used. Change-Id: I5de789b6349e6ea78ae3725af2a3ffa72b7b7f11 Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
* | | | | | | | | sched: Remove the sched heavy task frequency guidance featureJoonwoo Park2016-06-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This has always been unused feature given its limitation of adding phantom load to the system. Since there are no immediate plans of using this and the fact that it adds unnecessary complications to the new load fixup mechanism, remove this feature for now. It can be revisited later in light of the new mechanism. Change-Id: Ie9501a898d0f423338293a8dde6bc56f493f1e75 Signed-off-by: Syed Rameez Mustafa <rameezmustafa@codeaurora.org> Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
* | | | | | | | | sched: eliminate sched_migration_fixup knobJoonwoo Park2016-06-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Kill unused scheduler knob sched_migration_fixup. With this change scheduler always adjusts CPU's busy time during migration. Change-Id: I5d59e89d5cc0f2c705c40036cd7b47f5d3f89e58 Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
* | | | | | | | | sched: eliminate sched_upmigrate_min_nice knobJoonwoo Park2016-06-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Kill unused scheduler knob sched_upmigrate_min_nice. Change-Id: I53ddfde39c78e78306bd746c1c4da9a94ec67cd8 Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
* | | | | | | | | msm: Fix failure in deregistering custom topologiesKarthik Reddy Katta2016-06-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | AVCS_MODE_DEREGISTER_ALL_CUSTOM_TOPOLOGIES is defined as "1" where as in ADSP the value is "2". Redefine the same to fix the mis-match with ADSP code. CRs-Fixed: 1005434 Change-Id: I210e43b53c6170425ee35c02b728698b33afb591 Signed-off-by: Karthik Reddy Katta <a_katta@codeaurora.org>
* | | | | | | | | clk: msm: clock-gcc-cobalt: Add the cnoc_periph RPM resource supportDeepak Katragadda2016-06-02
|/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for modelling a new cnoc_periph RPM resource on MSM COBALT. In addition, fix the rpm_res_type being used for the mmssnoc_axi_clk and remove the pnoc resource support. CRs-Fixed: 1003213 Change-Id: I9f9845fea425fc4463dae72e8f8ab6e8bda23121 Signed-off-by: Deepak Katragadda <dkatraga@codeaurora.org>
* | | | | | | | msm: camera: Add support for DPCM modesVijay kumar Tumati2016-06-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DPCM8 and DPCM6 are 10 bit to 8 and 10 bit to 6 bit compression formats respectively which sensor outputs and it is decompressed to 10 bit in CSID Change-Id: I8ec4de7d9cfa5e9c86d97bd9cb81feddc97dc7b8 Signed-off-by: Vijay kumar Tumati <vtumati@codeaurora.org> Signed-off-by: Sureshnaidu Laveti <lsuresh@codeaurora.org>
* | | | | | | | platform: qpnp-revid: add definitions for pmicobalt versionsAbhijeet Dharmapurikar2016-06-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some workarounds need to be applied only for v1.0 and v1.1 of pmicobalt. For drivers to check and compare the versions, add definitions for pmicobalt versions. CRs-Fixed: 1018090 Change-Id: I3c6c0b470c7d15802c7cf4cb8ced85548dbb81c7 Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
* | | | | | | | clk: qcom: Add MSM8996 Global Clock Control (GCC) driverStephen Boyd2016-06-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for the global clock controller found on MSM8996 based devices. This should allow most non-multimedia device drivers to probe and control their clocks. Change-Id: I559f5976b56bf8933df2c68fc4e29b2bd0ce1160 Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Taniya Das <tdas@codeaurora.org>
* | | | | | | | icnss: Add IPC loggingPrashanth Bhatta2016-06-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add IPC logging mechanism so that all the driver logs can be retrieved on the need basis. Also use pr_fmt to format the logs so that icnss driver logs are consistent. Change-Id: I977b04964ac28c18f4ad85094746aa864f03d0c3 Signed-off-by: Prashanth Bhatta <bhattap@codeaurora.org>
* | | | | | | | sched: eliminate sched_enable_power_aware knob and parameterJoonwoo Park2016-06-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Kill unused scheduler knob and parameter sched_enable_power_aware. HMP scheduler always take into account power cost for placing task. Change-Id: Ib26a21df9b903baac26c026862b0a41b4a8834f3 Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
* | | | | | | | sched: eliminate sched_freq_account_wait_time knobJoonwoo Park2016-06-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Kill unused scheduler knob sched_freq_account_wait_time. Change-Id: Ib74123ebd69dfa3f86cf7335099f50c12a6e93c3 Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
* | | | | | | | sched: eliminate sched_account_wait_time knobJoonwoo Park2016-06-01
| |/ / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Kill unused scheduler knob sched_account_wait_time. With this change scheduler always accounts task's wait time into demand. Change-Id: Ifa4bcb5685798f48fd020f3d0c9853220b3f5fdc Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
* | | | | | | leds: led-class: Retain the latest user brightness requestRam Chandrasekar2016-05-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Retain the latest user brightness request. This ensures that when a max brightness limit is altered, the last brightness request is taken into account, when restoring the current brightness. Change-Id: I6461e06f64abe336cabc27a3992d734f1fb745c6 Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>