summaryrefslogtreecommitdiff
path: root/include/linux (follow)
Commit message (Collapse)AuthorAge
* mmc: core: support DDR52 bus-speed during eMMC clock scalingAsutosh Das2016-05-31
| | | | | | | | | Add support for DDR52 bus-speed mode during clock scaling. The reason for this change is DDR52 can be supported at SVS mode. Change-Id: I68e5fca57ae5cbc154f5dd7001df368900cb3f57 Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
* mmc: sdhci: Add asynchronous interrupt support for sdio cardsRitesh Harjani2016-05-31
| | | | | | | | | | | | | | SD host controller have asynchronous interrupt support capability to detect card(sdio) interrupt even when clocks are gated(to save power). This patch add support and enable this capability/feature to of SD host controllers for sdio cards. Change-Id: Ic1945355a19ebfdb3bd000bf8138d8001cea53f6 Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org> [subhashj@codeaurora.org: fixed merge conflicts & compilatione error] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* mmc: block: workaround for timeout issue with some vendor devicesSubhash Jadavani2016-05-31
| | | | | | | | | | | | | | | | | | Commit 66a7393a3ba9685d1eddfbce72e3ef8f4848f19f ("mmc: block: ensure CMDQ is empty before queuing cache flush") added a workaround for particular vendor's eMMC devices. Workaround was to wait for all the outstanding requests to finish up before queuing the flush request. Now detailed root cause analysis from vendor shows that original issue can happen only if DCMD command is sent to device too quickly (within less than 6 microseconds) after completion of previous small sector (less than 8 sectors) read operations. Hence with this change, we are fine tuning the previous workaround such that it would almost have no impact on the storage benchmark performance numbers. Change-Id: I1df1c5d7bbcd7b526236651077b7dade2626cb30 Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org> [subhashj@codeaurora.org: fixed trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* mmc: block: ensure CMDQ is empty before queuing cache flushSubhash Jadavani2016-05-31
| | | | | | | | | | | | | | | Some devices might stop responding to new commands if device cache flush is queued to host controller while host controller is still processing outstanding requests. To workaround this issue, we are making the cmdq thread to wait for all the oustanding requests to be finished before queuing cache flush command on host controller. Change-Id: I15387734f51ca4cadfc9e11270f14d8a0806a00f Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org> [subhashj@codeaurora.org: fixed trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* mmc: core: Card specific custom settings for SDIOPavan Anamula2016-05-31
| | | | | | | | | | | Add quirk to modify custom settings for QCA6574 and QCA9377 cards. Change-Id: I05e70efa71a8b8b931dfff758194af6220a8bc46 Signed-off-by: Pavan Anamula <pavana@codeaurora.org> Signed-off-by: Sahitya Tummala <stummala@codeaurora.org> [subhashj@codeaurora.org: fixed trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* mmc: cmdq_hci: Add cyclic buffer to keep history of last 32 tasksVenkat Gopalakrishnan2016-05-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Keep track of task history for the last 32 tasks and dump it along with registers in case of any error for debugging. The log is of the following format: [index] <DATA|DCMD> Task: <lower 32bits> | Args: <upper 32bits> of the task descriptor structure. The values need to be decoded accordingly depending on the data or dcmd task descriptor. The last entry index denotes the latest entry in this list. ---- Circular Task History ---- cmdq-host: Last entry index: 1 cmdq-host: [00]DATA Task: 0x0400002f | Args: 0x00d37d18 cmdq-host: [01]DATA Task: 0x0400002f | Args: 0x00d38118 cmdq-host: [02]DCMD Task: 0x0186402f | Args: 0x03200101 Add a debugfs entry to enable/disable this dynamically. It is disabled by default. This applies only to eMMC devices. Usage: echo Y > /sys/kernel/debug/mmcX/cmdq_task_history X - denotes the slot id Change-Id: I6abf29aa928d3d8270405cfc104241043dadfe45 Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org> [subhashj@codeaurora.org: fixed compilation error] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* mmc: queue: fix the cmdq thread wake up handlingSubhash Jadavani2016-05-31
| | | | | | | | | | | | | | | | If request has to be requeued (due to any DCMD commmand pending or cmdq being halted) and if we change the task status to interruptible before going to sleep then thread may not wakeup again. Note that blk_requeue_request() doesn't trigger ->request_fn() again to wakeup the thread. Fix this issue by making cmdq thread wait for the completion of DCMD or until the cmdq is unhalted. This change also simplifies the cmdq thread function. Change-Id: Iebffc993241e5fadb2962fedc44576566dc66e9c Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org> Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
* mmc: debugfs: add debugfs entry to force raise host errorsVenkat Gopalakrishnan2016-05-31
| | | | | | | | | | | | | | | The SDHC spec allows to force raise errors that is useful for debugging error handler routines. Add debugfs entry force_error to trigger host errors from userspace. Check SDHCI_SET_INT_ERROR register for error bitmask info. Usage: echo 0x1 > /sys/kernel/debug/mmcX/force_error X - denotes the slot id Change-Id: I9f67442a79b2645cbdc3020d1a10c0b32840ce32 Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org> [subhashj@codeaurora.org: fixed trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* mmc: core: allow hosts to specify a large discard sizeKrishna Konda2016-05-31
| | | | | | | | | | | max_busy_timeout is used to decide whether R1B response should be used or a R1 response should be used. This is also used to decide what the discard size of mmc queue (registered with block layer) can be set to. In order to keep both the features in place, this change will allow for hosts to specify a larger discard size while still specifying max_busy_timeout. Change-Id: I1e607329c4377897a7cb4086db02cbc150bd02b7 Signed-off-by: Krishna Konda <kkonda@codeaurora.org>
* mmc: card: read the firmware version from ext_csdAsutosh Das2016-05-31
| | | | | | | | | | | | Read the firmware version from ext_csd register and print it for debugging purpose. Change-Id: I4c1fefd5bff753915c9858fb35c958335986c778 Signed-off-by: Asutosh Das <asutoshd@codeaurora.org> Signed-off-by: Sahitya Tummala <stummala@codeaurora.org> [subhashj@codeaurora.org: fixed trivial merge conflicts and compilation errors] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* mmc: core: add partial initialization supportMaya Erez2016-05-31
| | | | | | | | | | | | | | | This change adds the ability to partially initialize the MMC card by using card Sleep/Awake sequence (CMD5). Card will be sent to Sleep state during runtime/system suspend and will be woken up during runtime/system resume. By using this sequence the card doesn't need full initialization which gives time reduction in system/runtime resume path. Change-Id: Id8dadf03ef4226f7c4675fadbacac7bb15c0289e Signed-off-by: Talel Shenhar <tatias@codeaurora.org> Signed-off-by: Maya Erez <merez@codeaurora.org> [subhashj@codeaurora.org: fixed merge conflicts & compilation errors] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* mmc: sdhci-msm: add PM QoS legacy votingGilad Broner2016-05-31
| | | | | | | | | | | | | | | Add PM QoS voting mechanism to sdhci-msm driver for legacy eMMC. Two types of voting schemes are supported: 1) Vote for HW IRQ 2) Vote for a cpu group according to the request's designated cpu Using PM QoS voting should benefit performance. Change-Id: I5d2b71fc4eabfa5060f343634fbc7363f2ee1344 Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org> Signed-off-by: Gilad Broner <gbroner@codeaurora.org> [subhashj@codeaurora.org: fixed merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* mmc: sdhci-msm: add PM QoS votingGilad Broner2016-05-31
| | | | | | | | | | | | | Add PM QoS voting mechanism to sdhci-msm driver for command queueing. Two types of voting schemes are supported: 1) Vote for HW IRQ 2) Vote for a cpu group according to the request's designated cpu Using PM QoS voting should benefit performance. Change-Id: I8a20653eeb6348d5b442c846708d92c8fb64a8e9 Signed-off-by: Gilad Broner <gbroner@codeaurora.org> [subhashj@codeaurora.org: fixed trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* mmc: core: Check if card supports strobe before calling host opsRitesh Harjani2016-05-31
| | | | | | | | | | | Should check if mmc_card supports strobe before calling enhanced strobe host ops. This also adds a macro for use by LLD to know if card supports strobe Change-Id: Id79098ff66bd36be2496b86bf71556204aca7fe3 Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org> [subhashj@codeaurora.org: fixed trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* mmc: host: add support to allow SANITIZE operationPavan Anamula2016-05-31
| | | | | | | | | | | | SANITIZE is an operation performed by the storage device and its purpose is to delete its unmap memory regions. This change adds support for the SANITIZE capability. Change-Id: I58b647fb576c694aaa16c1e827d0784d4a5b4456 Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org> Signed-off-by: Pavan Anamula <pavana@codeaurora.org> [subhashj@codeaurora.org: fixed trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* mmc: core: kick block queue after unhalting cmdqGilad Broner2016-05-31
| | | | | | | | | | | | | If request has to be requeued due to cmdq being halted and if we change the task status to interruptible before going to sleep then cmdq thread may not wakeup again. Note that blk_requeue_request() doesn't trigger ->request_fn() again to wakeup the cmdq thread. Fix this issue by kicking the queue once cmdq state machine is unhalted. Change-Id: Icbfb3b6560285fa0a0ce7e83eee66b651d4594a0 Signed-off-by: Gilad Broner <gbroner@codeaurora.org> Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* mmc: core: Fix debugfs and IOCTL calls in cmdq modeRitesh Harjani2016-05-31
| | | | | | | | | | | | Currently getting status/ext_csd using debugfs or IOCTL calls in cmdq mode is not working. Fix it by halting the cmdq engine and making sure that card queue is empty before issuing these cmds. Change-Id: Idb89def9ff5c2fee6866759b9a8c652049552933 Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org> [subhashj@codeaurora.org: fixed merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* mmc: core: change test of auto_bkops configuredDov Levenglick2016-05-31
| | | | | | | | | | | | | | Changing the test of whether auto_bkops is configured allows for a case where the host tried to configure auto_bkops yet the CMD6 failed in configuring the device. This allows a case where manual bkops is configured on a eMMC 5.1 device Change-Id: Ia6c411f516bf27b8a5865109dcf4b290eb3d8e46 Signed-off-by: Dov Levenglick <dovl@codeaurora.org> [subhashj@codeaurora.org: fixed trivial merge conflicts & fixed compilation error] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* mmc: core: set MMC_PM_KEEP_POWER for certain Hynix mmc cardsDov Levenglick2016-05-31
| | | | | | | | | | | | Certain Hynix eMMC 5.0 cards might reach a fast EOL if the card's power is disabled between CMD5 and CMD0 (power off during reset). This patch sets the MMC_PM_KEEP_POWER flag to indicate that the card's power should be retained for suspend/resume sequences. Change-Id: I4bcc0f4bfd608745626816ca261369b432602c45 Signed-off-by: Dov Levenglick <dovl@codeaurora.org>
* mmc: schci: add support for MMC_PM_KEEP_POWER in eMMCDov Levenglick2016-05-31
| | | | | | | | | | | There are eMMC cards that should not be powered off during suspend/resume cycles. This patch adds support for such cards and avoids powering the card off during suspend or powering it back on during resume when MMC_PM_KEEP_POWER is set. Change-Id: Iec1a0aac80ee41dff56f192e7253c2bd00c15694 Signed-off-by: Dov Levenglick <dovl@codeaurora.org>
* mmc: host: add detect vops chainDov Levenglick2016-05-31
| | | | | | | | | | | | Add call from sdio to host_ops to sdhci_ops in order to indicate when a sdio card is detected. This will be used by hosts that require special handling for card detection. Change-Id: I65ec6ee464d658cd938d9254a0a748e6137f9223 Signed-off-by: Dov Levenglick <dovl@codeaurora.org> [subhashj@codeaurora.org: fixed trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* mmc: core: Update PON based on the system stateKrishna Konda2016-05-31
| | | | | | | | | | | | | | | | As per eMMC specification, the PON (Power Off Notification) must be sent by host to the card before turning off the power. This will allow card to prepare itself for the power off and may even reduce the initialization of eMMC upon next boot-up. Send long PON during system power off and send short PON during system reboot to reduce the reboot latency. Change-Id: If4188b8b80aaa0e6c4e00e1807aa9589d5e7efdb Signed-off-by: Sahitya Tummala <stummala@codeaurora.org> Signed-off-by: Krishna Konda <kkonda@codeaurora.org> [subhashj@codeaurora.org: fixed trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* mmc: core: add support for bkops during cmdqDov Levenglick2016-05-31
| | | | | | | | | | Add support for handling both manual and auto bkops when command queuing is running. Change-Id: Ib967ca3c0420f4e54b3e93c497eb538d7347199a Signed-off-by: Dov Levenglick <dovl@codeaurora.org> [subhashj@codeaurora.org: fixed trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* mmc: core: expose info about enhanced rpmb supportKrishna Konda2016-05-31
| | | | | | | | | | | | | | | | Following eMMC JEDEC JESD84-B51 standard, an ehannced form of rpmb is supported. What this enhanced mode supports is in addition to be able to write one rpmb or two rpmb frames at a time, 32 frames can be written at a time. Expose this information present in ext csd field so that the user space application that wants to make use of this can do so. Change-Id: I53fd962fd7e04b5d2d7804c289d7865c2c5618d5 Signed-off-by: Krishna Konda <kkonda@codeaurora.org> [subhashj@codeaurora.org: fixed trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* mmc: sdhci: cmdq: add notification for cmdq haltTalel Shenhar2016-05-31
| | | | | | | | | | | | | | | | During halted CMDQ mode, HW expects descriptors sizes same as used in CMDQ mode. Our SW uses the legacy path (SDHCI) in case CMDQ is halted, thus, we need to update legacy path of the fact that we are in Halted CMDQ state so it can adjust the descriptors size accordingly. This change adds a notification mechanism for that purpose. Change-Id: Iabb473696fb11827dfcce9b137c26b2c5a5a879d Signed-off-by: Talel Shenhar <tatias@codeaurora.org> [subhashj@codeaurora.org: fixed trivial merge conflicts & compilation errors] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* mmc: cmdq: add clock scaling for CMDQ modeTalel Shenhar2016-05-31
| | | | | | | | | | | | This change adds clock scaling ability to command-queueing mode, it does so by adding next logic: * Statistics collection for CMDQ data path * Empty the queue and Halt it before frequency change * Scale from data path in case host claiming is not possible Change-Id: I53a323b55df4d7c27e3ee3426ee4e856e533522c Signed-off-by: Talel Shenhar <tatias@codeaurora.org>
* mmc: core: Add MMC BKOPS statistics and debugfs ability to print themDov Levenglick2016-05-31
| | | | | | | | | | | | | | | | | | | | | | The BKOPS statistics are used for BKOPS unit tests and APT tests to determine test success or failure. The BKOPS statstics provide the following information: The number of times BKOPS were issued according to its severity level The number of times manual BKOPS was started/stopped (HPI) The number of times auto BKOPS was enabled/disabled In order to enable and reset the statistics: echo 1 > /sys/kernel/debug/mmc0/mmc0:0001/bkops_stats In order to disable the statistics: echo 0 > /sys/kernel/debug/mmc0/mmc0:0001/bkops_stats In order to view the statistics: cat /sys/kernel/debug/mmc0/mmc0:0001/bkops_stats Change-Id: Ib84319aedfb49dc022bc27efbda842a5db38c7e9 Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org> Signed-off-by: Dov Levenglick <dovl@codeaurora.org> [subhashj@codeaurora.org: fixed trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* mmc: add support for bkopsDov Levenglick2016-05-31
| | | | | | | | | | | Add support for manual and auto bkops for legacy (not command-queue) mode. Change-Id: I1333e1d4330393e446ba48a9474c83295744c050 Signed-off-by: Dov Levenglick <dovl@codeaurora.org> [subhashj@codeaurora.org: fixed merge conflicts and compilation errors] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* mmc: Add host ops for enhanced strobeVenkat Gopalakrishnan2016-05-31
| | | | | | | | | | Some hosts may need additional steps to get HS400 functional in enhanced strobe mode. Add host ops to facilitate that. Change-Id: I9663830e7ccedf8bf7970d0724a4c7ce212073fd Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org> [subhashj@codeaurora.org: fixed trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* mmc: enable Enhance Strobe for HS400Yi Sun2016-05-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | Enhance Strobe is defined in v5.1 eMMC spec. This commit is to implement it. Normal Strobe signal for HS400 is only provided during Data Out and CRC Response. While Enhance Strobe is enabled, Strobe signal is provided during Data Out, CRC Response and CMD Response. While enabling Enhance Strobe, the initialization of HS400 does not need enabling HS200 and executing tuning anymore. This simplifies the HS400 initialization process much. Per spec, there is a STROBE_SUPPORT added in EXT_CSD register to indicate that card supports Enhance Strobe or not. If it is supported, host can enable this feature by enabling the most significant bit of BUS_WIDTH before set HS_TIMING to HS400. Change-Id: I1003352cb31dfaec01fde352da7b879a13c94b3f Signed-off-by: Yi Sun <yi.y.sun@intel.com> [venkatg@codeaurora.org: Fix minor conflicts & compilation failure] Patch-mainline: linux-mmc @ 06/04/15, 19:50 Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org> [subhashj@codeaurora.org: fixed trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* mmc: block: Add cache barrier supportSahitya Tummala2016-05-31
| | | | | | | | | | | | | | | | | | | | | | eMMC cache barrier provides a way to perform delayed and in-order flushing of cached data. Host can use this to avoid flushing delays but still maintain the order between the data requests in cache. In case the device gets more barrier requests than it supports, then a barrier request is treated as a normal flush request in the device. If the eMMC cache flushing policy is set to 1, then the device inherently flushes all the cached requests in FIFO order. For such devices, as per spec, it is redundant to send any barrier requests to the device. This may add unnecessary overhead to both host and the device. So make sure to not send barrier requests in such cases. Change-Id: Ia7af316800a6895942d3cabcd64600d56fab25a6 Signed-off-by: Sahitya Tummala <stummala@codeaurora.org> [subhashj@codeaurora.org: fixed trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* mmc: block: add discard and secdiscard support for CMDQ modeSahitya Tummala2016-05-31
| | | | | | | | | | | Discard is supported in CMDQ mode only when device queue is empty. Hence, discard commands should be sent using DCMD slot with QBR (Queue Barrier) flag set. Change-Id: I630091cbd94ffcdcec71626257f912c15fd2e21e Signed-off-by: Sahitya Tummala <stummala@codeaurora.org> [subhashj@codeaurora.org: fixed trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* mmc: queue: add timeout capability to requestsAsutosh Das2016-05-31
| | | | | | | | | | Individual requests can have timeouts defined. The default timeout is set to 120 seconds. On a timeout, the block layer notifies the driver and error can be handled thereafter. Change-Id: Ifcd690411770ab266c12a01bb0993f92b0f18bc6 Signed-off-by: Asutosh Das <asutoshd@codeaurora.org> Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
* mmc: block: Add error handling to command queue hostAsutosh Das2016-05-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On error, the CMDQ engine stops processing requests. It is then halted and error handled. The error have been categorized as below: 1. Command error a. time-out - invalidate all pending tags & requeue - reset both card & controller b. crc - end the error mrq - tune - unhalt 2. Data error a. time-out - invalidate all pending tags & requeue - reset both card and controller b. crc - end the error mrq - tune - unhalt 3. RED error This is device specific error and is not recoverable. The card and controller are reset in this case and all pending tags are invalidated and requeued. Change-Id: I791d05f6b31d8f9b35a56fe85007b320c14e8b46 Signed-off-by: Asutosh Das <asutoshd@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: block: add support for partition switchAsutosh Das2016-05-31
| | | | | | | | | | | | | | | | | | | | There could be a switch of partition while RPMB access. RPMB thread would then hand-off the control to mmc-cmdq-thread in the following state: - partition set to RPMB in card - CMDQ mode disabled in card - Controller in halt state When the next request is received, the following has to be done - switch partition to the current partition - enable CMDQ in card - unhalt controller Change-Id: I9eca350572fd88476dfee9642696a223c5cd7ada Signed-off-by: Asutosh Das <asutoshd@codeaurora.org> Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org> [subhashj@codeaurora.org: fixed compilation error] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* mmc: core: Add halt supportAsutosh Das2016-05-31
| | | | | | | | | | Halt is a controller feature that can change the controller mode from command-queue to legacy. This feature is very helpful in error cases. Change-Id: I7f1465b609afed68886256bd605d4019716964f4 Signed-off-by: Asutosh Das <asutoshd@codeaurora.org> Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
* mmc: cmdq: support for command queue enabled hostVenkat Gopalakrishnan2016-05-31
| | | | | | | | | | | | | | | | | This patch adds CMDQ support for command-queue compatible hosts. Command queue is added in eMMC-5.1 specification. This enables the controller to process upto 32 requests at a time. Change-Id: I0486495ef57c64bf8427e917daeb184c69b8dc73 Signed-off-by: Asutosh Das <asutoshd@codeaurora.org> Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org> Signed-off-by: Konstantin Dorfman <kdorfman@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: core: add flush request support to command queueAsutosh Das2016-05-31
| | | | | | | | | | | | | Adds flush request support to command-queue. This uses DCMD feature of the controller for sending commands in command-queue mode. DCMD is a direct command feature that uses a pre-configured slot for sending commands other than Class 11. Change-Id: Iebf6b74173dc91b0dc7230d1e87c65983d15148e Signed-off-by: Asutosh Das <asutoshd@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: card: add read/write support in command queue modeVenkat Gopalakrishnan2016-05-31
| | | | | | | | | | | | | | | | Command queueing is defined in eMMC-5.1. It is designed for higher performance by ensuring upto 32 requests to be serviced at a time. Adds read/write support for CMDQ enabled devices. Change-Id: I136ddea8e5ca57eb4f85ca6e72c60001a7e24f78 Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org> Signed-off-by: Asutosh Das <asutoshd@codeaurora.org> Signed-off-by: Konstantin Dorfman <kdorfman@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: core: Add command queue initialzation supportAsutosh Das2016-05-31
| | | | | | | | | | | | | | | | | | Command Queueing (CQ) feature is introduced to eMMC standard in revision 5.1. CQ includes new commands for issuing tasks to the device, for ordering the execution of previously issued tasks and for additional task management functions. This patch adds initialization and enabling of command queue in the card and controller. If the card and the controller support CQ, then it is enabled. Change-Id: I92d893d1503396d4b00848813cc546fc263e77fd Signed-off-by: Asutosh Das <asutoshd@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: queue: initialization of command queueAsutosh Das2016-05-31
| | | | | | | | | | | | | | | | | | | | Command Queueing (CQ) feature is introduced to eMMC standard in revision 5.1. CQ includes new commands for issuing tasks to the device, for ordering the execution of previously issued tasks and for additional task management functions. The idea is to keep the legacy and CQ code as discrete as possible. Hence, a separate queue is created for CQ. The issuing path is non-blocking since several requests (max. 32) can be queued at a time. Change-Id: I5b48d1b3ed17585b907ec70ff7c8d583003ec9e1 Signed-off-by: Asutosh Das <asutoshd@codeaurora.org> Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org> [subhashj@codeaurora.org: fixed trivial merge conflicts & compilation error] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* mmc: core: devfreq: migrate to devfreq based clock scalingTalel Shenhar2016-05-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change adds the use of devfreq to MMC. Both eMMC and SD card will use it. For some workloads, such as video playback, it isn't necessary for these cards to run at high speed. Running at lower frequency, for example 52MHz, in such cases can still meet the deadlines for data transfers. Scaling down the clock frequency dynamically has 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 the 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. 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: I58ddbd93648ded82b304411956e035fb353cd97e Signed-off-by: Talel Shenhar <tatias@codeaurora.org> [subhashj@codeaurora.org: fixed trivial merge conflicts & compilation errors] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* mmc: add support for scheduling mmcqd on idle CPUDov Levenglick2016-05-31
| | | | | | | | | | | | | | In order to boost mmc performance on various platforms, add support for configuring whether set_wake_up_idle() should be called on the mmc queue thread (mmcqd). The decision will be set in each individual platform's dts file. CRs-Fixed: 787554 Change-Id: I3989d3f5b8228785e6d3bc49c7eb01ebf2fa2f38 Signed-off-by: Dov Levenglick <dovl@codeaurora.org> [subhashj@codeaurora.org: fixed trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* mmc: core: Add support to read command queue parametersAsutosh Das2016-05-31
| | | | | | | | | | | | | eMMC cards with EXT_CSD version >= 7, optionally support command queuing feature as defined by JEDEC eMMC5.1. Add support for probing command queue feature for such type of cards. Change-Id: I9454d0d6997ccbd1778a147354859467f4a9a7d3 Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org> Signed-off-by: Asutosh Das <asutoshd@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: block: add req pointer to mmc requestSahitya Tummala2016-05-31
| | | | | | | | | This is needed by ICE (Inline Crypto Engine) driver to get the ICE configuration data from the request. Change-Id: Ie69c64f4dc0c31290dec50d905e8b3d436c86d62 Signed-off-by: Sahitya Tummala <stummala@codeaurora.org> Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
* mmc: quirks: add new quirk that allows Cache disableTalel Shenhar2016-05-31
| | | | | | | | | | This change allows us to prevent cache enable for certain cards that have broken cache functionality. Change-Id: Iea3f8c8f4e5498a8742fa408a19e3e169d1fa8cb Signed-off-by: Talel Shenhar <tatias@codeaurora.org> [subhashj@codeaurora.org: fixed trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* mmc: block: avoid HPI for some Kingston cardsTalel Shenhar2016-05-31
| | | | | | | | | | Certain cards might get broken when HPI feature is used. This patch uses the HPI quirk to avoid the usage of HPI on Kingston MMC16G cards that have EXT_CSD_REV = 5 (mmc version 4.41) Change-Id: I4572eb9e71a281b56e25e5b4864d5777b16e2bc2 Signed-off-by: Talel Shenhar <tatias@codeaurora.org>
* mmc: quirks: add new quirk that allows HPI disableTalel Shenhar2016-05-31
| | | | | | | | | | | | | Certain cards might get broken when HPI feature is used. This patch allows host to avoid using HPI for such buggy cards by adding new quirk. As some of the other features like BKOPs/Cache are dependent on HPI feature, those features would also get disabled if HPI is disabled. Change-Id: I93a8810e4031eafcd44b5152296e065dc3330b63 Signed-off-by: Talel Shenhar <tatias@codeaurora.org>
* mmc: quirks: add support for quirks based on EXT_CSD_REVTalel Shenhar2016-05-31
| | | | | | | | | | | | | This change allows the usage of quirks based on the register value of EXT_CSD_REV. It was seen for several eMMC cards that same issues, such as data corruption while using cache, were relevant for all eMMC cards having the same EXT_CSD_REV value. This change allows us to distinguish between cards based on this register. Change-Id: I1663891c367a59b520bc505641c6c4ddad56fd1a Signed-off-by: Talel Shenhar <tatias@codeaurora.org>
* mmc: core: Add workaround for hosts that need addtional tuning for HS400Venkat Gopalakrishnan2016-05-31
| | | | | | | | | | | Add a capability to identify hosts that need additional tuning for HS400 and perform a post tuning process that maybe needed for proper HS400 functionality. Change-Id: I3895aabddce4dbecb208e3c522957e656f37e30d Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org> [subhashj@codeaurora.org: fixed trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>