summaryrefslogtreecommitdiff
path: root/include/linux (follow)
Commit message (Collapse)AuthorAge
* scsi: ufs: mixed long sequentialDolev Raviv2016-03-22
| | | | | | | | | | | | | | | | | | | | | The test will verify correctness of sequential data pattern written to the device while new data (with same pattern) is written simultaneously. First this test will run a long sequential write scenario. This first stage will write the pattern that will be read later. Second, sequential read requests will read and compare the same data. The second stage reads, will issue in Parallel to write requests with the same LBA and size. NOTE: The test requires a long timeout. The purpose of this test is to mix read and write requests on the same LBA while checking for the read data correctness. Change-Id: I6a437ce689b66233af3055d07a7f62f1e7b40765 Signed-off-by: Dolev Raviv <draviv@codeaurora.org> [venkatg@codeaurora.org: Changes to ufs_test.c are already present as part of earlier commit, hence drop them here] Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
* scsi: ufs: add support for test specific completion checkDolev Raviv2016-03-22
| | | | | | | | | | | | | Introduce a new callback 'check_test_completion_fn' to test-iosched framework. This callback is necessary to determine if a test has completed or not in situation where the request queue is empty, but the test was not completed. Change-Id: I60bd8cccffacab11a5a7cba78caccf53fea3e1d8 Signed-off-by: Dolev Raviv <draviv@codeaurora.org> [venkatg@codeaurora.org: Changes to ufs_test.c are already present as part of earlier commit, hence drop them here] Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
* scsi: ufs: long sequential read/write testsLee Susman2016-03-22
| | | | | | | | | | | | | | | | | | | | | This test adds the ability to test the UFS task management feature in the driver. It loads the queue with requests in order to allow the task management to operate in full capacity. Modify test-iosched infrastructure to support the new tests: - expose check_test_completion() Note: we submit 16-bio requests since the current HW is very slow and we don't want to exceed the timeout duration. Change-Id: I8ee752cba3c6838d8edc05747fa0288c4b347ef6 Signed-off-by: Dolev Raviv <draviv@codeaurora.org> Signed-off-by: Lee Susman <lsusman@codeaurora.org> [merez@codeaurora.org: fix trivial conflicts in ufs_test.c] Signed-off-by: Maya Erez <merez@codeaurora.org> [venkatg@codeaurora.org: Changes to ufs_test.c are already present as part of earlier commit, hence drop them here] Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
* block: add test bio size define to test-ioschedLee Susman2016-03-22
| | | | | | | | | Add a define for the test bio size (which is the size of a page), this is used for allocating the right sized buffer for the bio during test request creation. Change-Id: I9505c85c4352009bdee442172eb8ae8f4254cfb0 Signed-off-by: Lee Susman <lsusman@codeaurora.org>
* mmc: card: change long_sequential_test time measurements to ktimeLee Susman2016-03-22
| | | | | | | | | | | | | Change time measurements in long_sequential_test from jiffies to ktime, and make the relevant change in test-iosched infrastructure. In long_sequential_test we measure throughput, and the jiffies resolution is not sensitive enough for this calculation. Change-Id: If7c9a03c687f61996609c014e056bcd7132b9012 Signed-off-by: Lee Susman <lsusman@codeaurora.org> [venkatg@codeaurora.org: Drop changes to mmc_block_test.c] Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
* mmc: enhance long_sequential_test for higher throughputLee Susman2016-03-22
| | | | | | | | | | | | | | Change the test design so that requests are dynamically created and freed. This enables running tests with more than 128 requests, therefore more than 50MiB can be written/read and makes it possible to measure driver write/read throughput more accurately. Change-Id: I56c9d6c1afba5c91a0621a16d97feafd4689521d Signed-off-by: Lee Susman <lsusman@codeaurora.org> [merez@codeaurora.org: fix conflicts due to BKOPS tests removal] Signed-off-by: Maya Erez <merez@codeaurora.org> [venkatg@codeaurora.org: Drop changes to mmc_block_test.c] Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
* block: test-iosched: Add support for setting rq_diskDolev Raviv2016-03-22
| | | | | | | | | Some block devices requires the rq_disk field to be assigned. This patch exposes a new API to the block device test utility for getting the rq_disk assigned, in the created request. Change-Id: I61dc4dad50eb7600728156a6cd08bb1ee134df0d Signed-off-by: Dolev Raviv <draviv@codeaurora.org>
* block: test-iosched infrastructure enhancementLee Susman2016-03-22
| | | | | | | | | | | | | | | | | Add functionality to test-iosched so that it could simulate the ROW scheduler behaviour. The main additions are: - 3 distinct requests queue with counters - support for urgent request pending - reinsert request implementation (callback + dispatch behavior) Change-Id: I83b5d9e3d2b8cd9a2353afa6a3e6a4cbc83b0cd4 Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org> Signed-off-by: Lee Susman <lsusman@codeaurora.org> [merez@codeaurora.org: fixed conflicts due to bkops tests removal] Signed-off-by: Maya Erez <merez@codeaurora.org> [venkatg@codeaurora.org: Dropping elevator is_urgent_fn and reinsert_req_fn ops fn as they are not present in 3.18 kernel] Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
* mmc: card: Add long sequential read test to test-ioschedLee Susman2016-03-22
| | | | | | | | | | | | Long sequential read test measures read throughput at the driver level by reading large requests sequentially. Change-Id: I3b6d685930e1d0faceabbc7d20489111734cc9d4 Signed-off-by: Lee Susman <lsusman@codeaurora.org> [merez@codeaurora.org: Fix conflicts as BKOPS tests were removed] Signed-off-by: Maya Erez <merez@codeaurora.org> [venkatg@codeaurora.org: Drop changes to mmc_block_test.c] Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
* block: Add test-iosched schedulerMaya Erez2016-03-22
| | | | | | | | | The test scheduler allows testing a block device by dispatching specific requests according to the test case and declare PASS/FAIL according to the requests completion error code Change-Id: Ief91f9fed6e3c3c75627d27264d5252ea14f10ad Signed-off-by: Maya Erez <merez@codeaurora.org>
* block: blk-flush: Add support for Barrier flagDolev Raviv2016-03-22
| | | | | | | | | | | | | | | | | | | A barrier request is used to control ordering of write requests without clearing the device's cache. LLD support for barrier is optional. If LLD doesn't support barrier, flush will be issued instead to insure logical correctness. To maintain this fallback flush s/w path and flags are appended. This patch implements the necessary requests marking in order to support the barrier feature in the block layer. This patch implements two major changes required for the barrier support. (1) A new flush execution-policy is added to support "ordered" requests and a fallback , in case barrier is not supported by LLD. (2) If there is a flush pending in the flush-queue, the received barrier is ignored, in order not to miss a demand for an actual flush. Change-Id: I6072d759e5c3bd983105852d81732e949da3d448 Signed-off-by: Dolev Raviv <draviv@codeaurora.org>
* block: Definition for barrier requests flagDolev Raviv2016-03-22
| | | | | | | | | | | | | | A barrier request is a type of flush request used to control ordering of write requests without clearing the device's cache. LLD support for barrier is optional. To maintain backward compatibility, barrier request has to maintain flush s/w path and flags. This patch introduces those flags to define interface between the block layer and the LLD. Change-Id: Iefa8e9a5c1b5e8256eaeb0322c435becd4669de9 Signed-off-by: Dolev Raviv <draviv@codeaurora.org> [imaund@codeaurora.org: Resolved context conflicts] Signed-off-by: Ian Maund <imaund@codeaurora.org>
* PM / devfreq: Add new flag to do simple clock scalingSahitya Tummala2016-03-22
| | | | | | | | | | | | | Add new flag "simple_scaling" to on demand governor so that the clocks can be scaled up only when the load is more than up threshold and can be scaled down only when the load is less than down differential data as provided within struct devfreq_simple_ondemand_data. Change-Id: Ibc6ab6297c1b64b6e6eaaa76d735d0b9ae0f6477 Signed-off-by: Sahitya Tummala <stummala@codeaurora.org> [venkatg@codeaurora.org: dereference stat variables] Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
* block: add REQ_URGENT to request flagsTatyana Brokhman2016-03-22
| | | | | | | | | | | | | | | This patch adds a new flag to be used in cmd_flags field of struct request for marking request as urgent. Urgent request is the one that should be given priority currently handled (regular) request by the device driver. The decision of a request urgency is taken by the scheduler. Change-Id: Ic20470987ef23410f1d0324f96f00578f7df8717 Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org> [subhashj@codeaurora.org: resolved trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org> [venkatg@codeaurora.org: resolved trivial merge conflict] Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
* scsi/phy: Remove orphaned files after renamingVenkat Gopalakrishnan2016-03-22
| | | | | | | | Delete renamed orphan files after rebasing 3.18 ufs driver changes onto 4.4 ufs driver. Change-Id: Id241ad01bbb0fa74e209c66f8a2d97c05088e33b Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
* scsi: ufs: minimize exposure of ufs header filesYaniv Gardi2016-03-22
| | | | | | | | | | | | | | | | | | | | Until now, the phy-qcom-ufs-*.* files used ufs data structures and macros and thus, we had to expose most of them in include/linux/scsi/ufs path. But now, after removing support for phy 28nm in apq8084 under kernel 3.14, we can minimize the exposure of code to essential minimum. To do that, we relocate the ufs.h, unipro.h, ufshcd.h and ufs-qcom.h files back to reside internally in the driver. Also this patch contains some very minor changes suggested by the upstream checkpatch script. Change-Id: Id2a923a6a0b1c76565c25f2797a666f3a0d1315f Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org> [subhashj@codeaurora.org: resolved merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org> [venkatg@codeaurora.org: fixed header includes and other trivial merge conflicts] Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
* scsi: ufs-qcom: implement pre and post notification for clock scalingSubhash Jadavani2016-03-22
| | | | | | | | QUniPro controller requires additional configuration before and after clock scaling, this change adds the support for it. Change-Id: I0add27ff3ab54f72b8b79e1e554541c2e492a4c8 Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* phy: ufs-qcom: disable RX LineCfgSubhash Jadavani2016-03-22
| | | | | | | | | | | | | | Some UFS devices send incorrect LineCfg data as part of power mode change sequence which may cause host PHY to go into bad state. Currently we workaround this issue by disabling the device's TX LCC but disabling TX LCC is much more complicated if both host and device supports UniPro 1.6 specification. To simplify the workaround, this change disables the host PHY's RX LineCfg to skip processing incorrect LineCfg from device. Change-Id: I1eac56c11dd001eb0c53ba8e16aa512a656ab9ea Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org> [venkatg@codeaurora.org: resolved trivial merge conflicts] Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
* scsi: ufs-qcom: allow HS-G3Subhash Jadavani2016-03-22
| | | | | | | | Change the maximum high speed gear to HS-G3 so if both host and device supports HS-G3, UFS link will be allowed to operate in HS-G3. Change-Id: I1117990948f9c09ae103cd1e692716e0010362cb Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* scsi: ufs: add load based scaling of UFS gearSubhash Jadavani2016-03-22
| | | | | | | | | | | | | | | | UFS driver's load based clock scaling feature scales down the ufs related clocks in order to allow low power modes of chipsets. UniPro 1.6 supports maximum gear up to HS-G3 (High Speed Gear3) and some of the chipsets low power modes may not be allowed in HS-G3 hence this change adds support to scale gear between HS-G3 and HS-G2 based on same existing load based clock scaling logic. Change-Id: I25c70230a77321efd654af7c496c43936324ae40 Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org> [subhashj@codeaurora.org: resolved trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org> [venkatg@codeaurora.org: resolved trivial merge conflicts] Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
* scsi: ufs: add UFS power collapse support during hibern8Subhash Jadavani2016-03-22
| | | | | | | | | | | | | | UFS host controller hardware may allow the host controller to be power collapsed when UFS link is hibern8 state, this change allows the UFS host controller to be power collapsed during hibern8. Change-Id: I42f962484b9d6635be1139b1fc6447dd2ca2200c Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org> [subhashj@codeaurora.org: resolved trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org> [venkatg@codeaurora.org: resolved trivial merge conflicts] Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
* scsi: ufs-qcom: change device reference clock controlGilad Broner2016-03-22
| | | | | | | | | | | | | | As of HW major version 2, bit 'UFS_DEV_REF_CLK_EN' which is used to gate/ungate the ref_clk to external UFS device, was moved into the UFS register space to UFS_CFG1 register. This change adds support to appropriately control the device reference clock and it also adds the missing documentation for the device reference clock control register address space. Change-Id: I66a6a75dc5a1cf130b1cee90ae20f9f950edfb3a Signed-off-by: Gilad Broner <gbroner@codeaurora.org> [subhashj@codeaurora.org: resolved trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* scsi: ufs-qcom: expose debug registers by debugfsDov Levenglick2016-03-22
| | | | | | | | | | | | Add support for exposing debug registers via debugfs. This can be used for runtime debugging of failures/errors without the need to add more prints to the console. In order to avoid unnecessary code duplication, the function for dumping registers to a file (in debugfs.c) has been slightly modified and exposed as an external function. Signed-off-by: Dov Levenglick <dovl@codeaurora.org> Change-Id: I77f9f3a6d041f805a93d095446f3e8077977036f
* scsi: ufs-qcom: add debug prints for test busDov Levenglick2016-03-22
| | | | | | | | | | | Adds support for configuring and reading the test bus and debug registers. The configuration is controlled by debugfs. Reading can be triggered either by debugfs or by the kernel code. Change-Id: I943e3c1b1e383a91a8abbb8dab9714434c56b6f5 Signed-off-by: Dov Levenglick <dovl@codeaurora.org> [imaund@codeaurora.org: Resolved context conflicts] Signed-off-by: Ian Maund <imaund@codeaurora.org>
* scsi: ufs-qcom: add ICE debug printsDov Levenglick2016-03-22
| | | | | | | | | Add ICE debug prints for debugging purposes. These prints will be shown as part of dumping registers during error handling. Enabling can be controlled by debugfs. Change-Id: I7d070cc8df099e6c526997d39973a3e1c161091b Signed-off-by: Dov Levenglick <dovl@codeaurora.org>
* scsi: ufs-qcom: add print suppressing debugfs mechanismDov Levenglick2016-03-22
| | | | | | | | | | Provide a mechanism for the userspace to suppress specific debug prints via debugfs. This is useful in order to avoid cases where too much printing would cause watchdog timers to expire. Change-Id: I2500b7621b631e260d98595ed8cfe7d5a496dc10 Signed-off-by: Dov Levenglick <dovl@codeaurora.org>
* scsi: ufs-qcom: set device ref. clk bitGilad Broner2016-03-22
| | | | | | | | | | | | | | | | | | As of HW major version 2, a new bit 'UFS_DEV_REF_CLK_EN' was added to UFS_CFG1 register which needs to be set as part of hibernate enter/exit sequences during suspend/resume. Change-Id: I66a6a75dc5a1cf130b1cee90ae20f9f950edfb3a Signed-off-by: Gilad Broner <gbroner@codeaurora.org> [imaund@codeaurora.org: Resolved context conflicts and updated a conditional in ufs_qcom_advertise_quirks to use the ufs_qcom_host struct when querying major hw versions] Signed-off-by: Ian Maund <imaund@codeaurora.org> [subhashj@codeaurora.org: resolved trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org> [venkatg@codeaurora.org: resolved trivial merge conflicts, drop changes to include/linux/phy/phy-qcom-ufs.h] Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
* scsi: ufs: add print suppressing debugfs mechanismDov Levenglick2016-03-22
| | | | | | | | | | | | | Provides a mechanism for the userspace to suppress specific debug prints via the debugfs. This is useful in order to avoid cases where too much printing would cause watchdog timers to expire. Change-Id: I1ab068cd616ddac767ec5f30ab130e3b1ac34e15 Signed-off-by: Dov Levenglick <dovl@codeaurora.org> [imaund@codeaurora.org: Resolved context conflicts] Signed-off-by: Ian Maund <imaund@codeaurora.org> [subhashj@codeaurora.org: resolved trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* scsi: ufs: perform ice_init as part of UFS initializationMaya Erez2016-03-22
| | | | | | | | | | | ice_init may need UFS clocks to be enabled in order to allow enabling ICE as part of its initialization. To allow that, ice_init should be done as part of UFS initialization sequence. In such a case ice_reset is no longer needed to be called as part of UFS initialization and should be moved to host reset scenarios. Change-Id: Iaa851083a9f73045c7ca02d69dd65b3a00b85bff Signed-off-by: Maya Erez <merez@codeaurora.org>
* scsi: ufs: set right GenSelectorIndex for M-PHY attributesSubhash Jadavani2016-03-22
| | | | | | | | | | | | | | | | | | | | | | | | | | DME attributes read/write commands need GenSelectorIndex argument and according to UFS host controller specification, it should specify the targeted M-PHY data lane. This is the valid range of GenSelectorIndex for M-PHY attributes: 0 to (2 * PA_MaxDataLanes - 1) Example (Note: PA_MaxDataLanes is UniPro protocol constant set to 4): --------------------------------------- MPHY Access target | GenSelectorIndex --------------------------------------- TX Lane0 | 0 TX Lane1 | 1 RX Lane0 | 4 RX Lane1 | 5 --------------------------------------- This change make sure that correct GenSelectorIndex is passed for M-PHY attributes Change-Id: I38c14b5801ece7fce7a7970385756859618efd32 Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org> [venkatg@codeaurora.org: resolved trivial merge conflicts] Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
* scsi: ufs-qcom: add QUniPro hardware supportSubhash Jadavani2016-03-22
| | | | | | | | | | | New revisions of UFS host controller supports the new UniPro hardware controller (referred as QUniPro). This patch adds the support to enable this new UniPro controller hardware. Change-Id: Iccbcc38c36e6d9b9fcbb5c7fd7a3e3326c1c4ce0 Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org> [subhashj@codeaurora.org: resolved trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* scsi: ufs-qcom: remove support for save/restore phy configurationYaniv Gardi2016-03-22
| | | | | | | | | | | | | | Since support for 28nm phy removed in kernel 3.14, all related code that is specific to phy 28nm is also removed. Specifically the quirk that enables save/restore phy configuration is removed (and all its relevant callbacks) as it's unique to 28nm ufs phy. Change-Id: Ie723885bacb52548573fc1140d09b0ea5f067382 Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org> [venkatg@codeaurora.org: drop changes to include/linux/phy/phy-qcom-ufs.h] Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
* scsi: ufs-qcom: add number of lanes per directionGilad Broner2016-03-22
| | | | | | | | | | | | Different platform may have different number of lanes for the UFS link. Add parameter to device tree specifying how many lanes should be configured for the UFS link. Change-Id: Ida8b13b916f76b3cc7afd3da3d04219e95627678 Signed-off-by: Gilad Broner <gbroner@codeaurora.org> [subhashj@codeaurora.org: resolved trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* scsi: ufs: optimize clock, pm_qos, hibern8 handling in queuecommandSubhash Jadavani2016-03-22
| | | | | | | | | | | | | ufshcd_queuecommand() vote for the resources in this order: clocks, pm_qos latency, hibern8 exit. If any of these votes are not already applied, each one has to be applied asynchronously and in that case we are releasing all the previously applied resource votes (for example, if hibern8 exit has to be completed asynchronously, we release the votes for pm_qos and clocks as well). This is not a optimal solution instead we should skip scheduling the unvoting work for already voted resources. Change-Id: Ie700d9b3bf64370a5885787f7313d41adb5b3566 Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* scsi: ufs: reduce printout for aborted requestsGilad Broner2016-03-22
| | | | | | | | | | | | | Details printed for each request that is aborted can overload the target as there can be several requests that are aborted at once. This change will print full request details only for the first aborted request since the last link reset, and minimal details for other subsequent requests. Change-Id: I2868262e0b687c9ddd771a52708428b7de14bea2 Signed-off-by: Gilad Broner <gbroner@codeaurora.org> [subhashj@codeaurora.org: resolved trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* scsi: ufs-qcom: save ufs_qcom_host object pointersGilad Broner2016-03-22
| | | | | | | | | Analyzing crash logs is made easier when the different UFS objects state is accessible. Save a pointer to the main ufs_qcom_host object when it is allocated. Change-Id: I8eb909729dee7209e5d9b1af2652fe76ccd3c0ca Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
* scsi: ufs: skip request abort task when previous aborts failedGilad Broner2016-03-22
| | | | | | | | | | On certain error conditions request abort task itself might fail when aborting a request. In such case, subsequent request aborts should skip issuing the abort task as it is expected to fail as well, and device reset handler will be called next. Change-Id: I28c111c58e8c7fd54b836c6933d5fc56682c28b9 Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
* scsi: ufs: add error recovery after DL NAC errorSubhash Jadavani2016-03-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | Some vendor's UFS device sends back to back NACs for the DL data frames causing the host controller to raise the DFES error status. Sometimes such UFS devices send back to back NAC without waiting for new retransmitted DL frame from the host and in such cases it might be possible the Host UniPro goes into bad state without raising the DFES error interrupt. If this happens then all the pending commands would timeout only after respective SW command (which is generally too large). This change workarounds such device behaviour like this: - As soon as SW sees the DL NAC error, it would schedule the error handler - Error handler would sleep for 50ms to see if there any fatal errors raised by UFS controller. - If there are fatal errors then SW does normal error recovery. - If there are no fatal errors then SW sends the NOP command to device to check if link is alive. - If NOP command times out, SW does normal error recovery - If NOP command succeed, skip the error handling. If DL NAC error is seen multiple times with some vendor's UFS devices then enable this quirk to initiate quick error recovery and also silence related error logs to reduce spamming of kernel logs. Change-Id: Id2f0c05c414d700ba923513f8c9e3d1e6a8a749a Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* scsi: ufs-qcom: implement ufs dbg_register_dump cbDolev Raviv2016-03-22
| | | | | | | | | | | | Errors such as UIC errors, illegal OCS values, and others may require information kept in non standard UFS registers but controller debug registers. Implementing dbg_register_dump cb gives access to such register while debugging those issues. Change-Id: I259c3d691b95f72ea62ed162492f9081d472de80 Signed-off-by: Dolev Raviv <draviv@codeaurora.org> Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* scsi: ufs: Improve fatal error logsDolev Raviv2016-03-22
| | | | | | | | | | | | | | | | | | | Errors such as UIC error, illegal OCS values, and others may require more information for debugging. Such information could be hibern8 events, events sequences, recoverable errors, error history, and more. This patch improves tracking of important errors and events in debug level to be enabled when debugging a such issues. It includes: * UIC error history * Successful hibern8 events * Successful command after hibern8 exit * Clk-freq info * Failed device command * Infrastructure for dumping host controller debug information Change-Id: If3b38b86caeec4ffc669d001b452050a4a6b5173 Signed-off-by: Dolev Raviv <draviv@codeaurora.org> [subhashj@codeaurora.org: resolved trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* scsi: ufs: disable vccq if it's not needed by UFS deviceSubhash Jadavani2016-03-22
| | | | | | | | | | | | Some UFS devices don't require VCCQ rail for device operations hence this change adds support to recognize such devices and remove vote for the unused VCCQ rail. Change-Id: I7f0ffb9141bf9f13ce457c8c5eba7705ae288872 [subhashj@codeaurora.org: resolved trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org> [venkatg@codeaurora.org: resolved trivial merge conflicts] Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
* scsi: ufs: add cpu-dma latency PM QOS requestGilad Broner2016-03-22
| | | | | | | | | | | | | | Add PM QOS cpu-dma latency request to the driver. Latency parameter value is taken from the device tree node using an optional parameter 'qcom,cpu-dma-latency-us'. Unless specified, a default of 200us is used. Change-Id: I3e10da9e65fc7324897c866b0c2a40cc5e6ca070 Signed-off-by: Gilad Broner <gbroner@codeaurora.org> [subhashj@codeaurora.org: resolved trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org> [venkatg@codeaurora.org: resolved trivial merge conflicts] Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
* scsi: ufs: add Inline Crypto Engine (ICE) support to UFSMaya Erez2016-03-22
| | | | | | | | | | | | | | | | In-order to enhance storage encryption performance, an Inline Cryptographic Engine is introduced to UFS. This patch adds in-line encryption capabilities to the UFS driver. Change-Id: Id3cb913498809b32e1f7eba96395b05a9bf3219f Signed-off-by: Noa Rubens <noag@codeaurora.org> Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org> Signed-off-by: Maya Erez <merez@codeaurora.org> [subhashj@codeaurora.org: resolved trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org> [venkatg@codeaurora.org: resolved trivial merge conflicts] Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
* scsi: ufs: add capability to keep auto bkops always enabledSubhash Jadavani2016-03-22
| | | | | | | | | | | | | UFS device requires to perform bkops (back ground operations) periodically but host can control (via auto-bkops parameter of device) when device can perform bkops based on its performance requirements. In general, host would like to enable the device's auto-bkops only when it's not doing any regular data transfer but sometimes device may not behave properly if host keeps the auto-bkops disabled. This change adds the capability to let the device auto-bkops always enabled except suspend. Change-Id: I92c4531f88cb75a563568270584926eb73b53c98 Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* scsi: ufs: Add sysfs node to dynamically control hibern8 on idleSubhash Jadavani2016-03-22
| | | | | | | | | | | | Provide an option to enable/disable hibern8 on idle functionality during runtime. Write 1 or 0 to "hibern8_on_idle_enable" sysfs node to enable/disable hibern8 on idle functionality. Change-Id: Id4b6253c3c53ed71575c05596abbd4dd99821eff [subhashj@codeaurora.org: resolved trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org> [venkatg@codeaurora.org: resolved trivial merge conflicts] Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
* scsi: ufs: add support for hibern8 on idleSubhash Jadavani2016-03-22
| | | | | | | | | | | | | | | | | | In order to save power we should put the UFS link into hibern8 as soon as UFS link is idle and power measurement of active usecases (like audio/video playback/recording) show that putting UFS link in hibern8 @ 10ms of idle (if not earlier) would save significant power. Our current available solution is to do hibern8 with clock gating @idle timeout of 150ms. As clock gating has huge latencies (7ms each in enter and exit), we cannot bring down the idle timeout to <=10ms without degrading UFS throughput. Hence this change has added support to enter into hibern8 with another idle timer. Change-Id: I5a31f18fc21015d4a68236da9fd94f3f016e1d44 Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org> [subhashj@codeaurora.org: resolved trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* scsi: ufs: tune UniPro parameters to optimize hibern8 exit timeSubhash Jadavani2016-03-22
| | | | | | | | | | | | | | | Optimal values of local UniPro parameters like PA_Hibern8Time & PA_TActivate can help reduce the hibern8 exit latency. If both host and device supports UniPro ver1.6 or later, these parameters will be automatically tuned during link startup itself. But if either host or device doesn't support UniPro ver 1.6 or later, we have to manually tune them. But to keep manual tuning logic simple, we will only do manual tuning if local unipro version doesn't support ver1.6 or later. Change-Id: I533afe9b62a35602e4e766d76912db7ac9a480b6 Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org> [venkatg@codeaurora.org: resolved trivial merge conflicts] Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
* scsi: ufs-qcom: enable host controller hardware clock gatingSubhash Jadavani2016-03-22
| | | | | | | | | | | | The UTP controller has a number of internal clock gating cells (CGCs). Internal hardware sub-modules within the UTP controller control the CGCs. Hardware CGCs disable the clock to inactivate UTP sub-modules not involved in a specific operation, UTP controller CGCs are by default disabled and this change enables them (after every UFS link startup) to save some power leakage. Change-Id: I47bba62436c5913eb6755e59c36a11fea2e9468f Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* scsi: ufs: debugfs: add option to read peer DME attributeSubhash Jadavani2016-03-22
| | | | | | | | | | | This patch adds the debugfs capability to read the DME attribute of peer UniPro/M-PHY. This should help for debugging. Change-Id: I26d3675bdda8b9fdf0f9aa6b81a1ffafbd828fd0 [subhashj@codeaurora.org: resolved trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org> [venkatg@codeaurora.org: resolved trivial merge conflicts] Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
* scsi: ufs: fix bug when changing power mode via debugfsYaniv Gardi2016-03-22
| | | | | | | | | | | | | | | | | | | | | | So far when required to change UFS power mode via debugfs the final power parameters to which the UFS device is configured were determined based on comparison between the new required power (gear, lane, mode) and qcom pre-defined power preferences, and the minimum between them was the configured power which is incorrect. This change fixes this issue so what is done is a comparison between the new required power and the device maximum supported power parameters. If the new required power parameters exceed the device maximum supported power, then the UFS power mode is not changed. This change also contains a few cosmetic changes that simplify code that is related to the above power change. Change-Id: If08d3ce50af2dc17a6f68583dd1e7973aeb3c33a Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org> [subhashj@codeaurora.org: resolved merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org> [venkatg@codeaurora.org: resolved trivial merge conflicts] Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>