aboutsummaryrefslogtreecommitdiff
path: root/drivers/scsi
Commit message (Collapse)AuthorAgeFilesLines
* scsi: ufs: expose APIs to allow compiling ufs_test as a moduleMaya Erez2014-10-232-0/+5
| | | | | | | | | | | | | The UFS tests are used for testing the functionality and performance of the UFS driver. In some of the tests ufs_test uses several scsi and UFS APIs for getting the disc information and sending UFS specific commands. The used APIs should be exposed in order to allow compilation of ufs_test as a module. Change-Id: I1263429bd3d5172af3b5552f0b8b503e32a04e51 Signed-off-by: Gilad Broner <gbroner@codeaurora.org> Signed-off-by: Maya Erez <merez@codeaurora.org>
* Merge "scsi: ufs: print the correct error state"Linux Build Service Account2014-10-201-1/+1
|\
| * scsi: ufs: print the correct error stateSubhash Jadavani2014-10-171-1/+1
| | | | | | | | | | | | | | | | UFS driver's error handler is not printing the saved error state information, this change fixes it. Change-Id: I02b06a8c49a32e8ce19a5523d7ccda8cd0b9a8ac Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* | Merge "scsi: ufs: add capability to keep auto bkops always enabled"Linux Build Service Account2014-10-201-11/+22
|\ \
| * | scsi: ufs: add capability to keep auto bkops always enabledSubhash Jadavani2014-10-161-11/+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: fix setting init power modeSubhash Jadavani2014-10-161-3/+4
|/ | | | | | | | | | | | | | | | | Immediately after successful UFS link startup, UFS link power mode would be in PWM-G1, 1-lane, SLOW-AUTO mode. But currently we are doing few of the DME local/peer attributes access before setting the "hba->pwr_info" to default power mode. If we are doing link startup as part of error recovery then old power mode might be set to FAST mode and doing DME peer access (after link startup but before updating "hba->pwr_info" to default power mode) unintentionally tries to switch from FAST to FAST_AUTO mode (if UFSHCD_QUIRK_DME_PEER_ACCESS_AUTO_MODE quirk is enabled). Above issue is fixed by setting the default power mode immediately after successful link startup. Change-Id: Ica332298114c9d24ecf67c7e452cebc07656415c Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* Merge "scsi: ufs: commit descriptors before setting the doorbell"Linux Build Service Account2014-10-141-0/+6
|\
| * scsi: ufs: commit descriptors before setting the doorbellGilad Broner2014-10-131-0/+6
| | | | | | | | | | | | | | | | | | | | | | Add a write memory barrier to make sure descriptors prepared are actually written to memory before ringing the doorbell. We have also added the write memory barrier after ringing the doorbell register so that controller sees the new request immediately. Change-Id: Ifb3fb294eda81a5bccddb05227eade1b7453921a Signed-off-by: Gilad Broner <gbroner@codeaurora.org> Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* | Merge "scsi: ufs: change clock gating timeout to 50ms"Linux Build Service Account2014-10-141-1/+1
|\ \
| * | scsi: ufs: change clock gating timeout to 50msSubhash Jadavani2014-10-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clock gating timeout is generally choosen such a way that it doesn't impact storage benchmark performance numbers. Although current timeout value of 150ms seems high hence this change reduces it to 50ms to save power clock gating timeout. Reducing it to 50ms doesn't affect the storage performance benchmark numbers. Change-Id: Ia131fc420995f44d8446f3800c19de40fedea504 Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* | | Merge "scsi: ufs: Add sysfs node to dynamically control hibern8 on idle"Linux Build Service Account2014-10-141-3/+92
|\| |
| * | scsi: ufs: Add sysfs node to dynamically control hibern8 on idleSubhash Jadavani2014-10-121-3/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* | | Merge "scsi: ufs: add support for hibern8 on idle"Linux Build Service Account2014-10-142-30/+318
|\| |
| * | scsi: ufs: add support for hibern8 on idleSubhash Jadavani2014-10-122-30/+318
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Merge "scsi: ufs: update bus vector name used for slow-auto mode"Linux Build Service Account2014-10-131-2/+3
|\ \ \ | |_|/ |/| |
| * | scsi: ufs: update bus vector name used for slow-auto modeNoa Rubens2014-10-071-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Set the bus vector name used for slow-auto mode to be "MIN". For each power mode a specific bus vector name should be selected from UFS DTS node. Slow-auto mode was missing this specification. Change-Id: I48de8e70823b75ed3bb4eefe7828f841f2e775eb Signed-off-by: Noa Rubens <noag@codeaurora.org>
* | | Merge "scsi: ufs: clear UTRD, UPIU req and rsp before new transfers"Linux Build Service Account2014-10-121-3/+12
|\ \ \ | |_|/ |/| |
| * | scsi: ufs: clear UTRD, UPIU req and rsp before new transfersMaya Erez2014-10-051-3/+12
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clear the UFS data structures before sending new request. The SCSI command is sent to the device within the UFS UPIU request. As part of the transfer UPIU preparation, the SCSI command is copied to the UPIU structure according to the SCSI command size. As different SCSI commands differ in size from each other, we need to clear the whole SCSI command field to prevent sending uninitialized data to the device. The UPIU response doesn't always include the sense data and can differ in size. Hence, the UPIU response should also be cleared before the transfer. Change-Id: I9bba619dc884e973a05566e0f975bd8473612644 Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org> Signed-off-by: Maya Erez <merez@codeaurora.org>
* | Merge "scsi: ufs: fix exception event handling"Linux Build Service Account2014-10-071-4/+6
|\ \
| * | scsi: ufs: fix exception event handlingMaya Erez2014-10-021-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The device can set the exception event bit in one of the response UPIU, for example to notify the need for urgent BKOPs operation. In such a case the host driver calls ufshcd_exception_event_handler to handle this notification. When trying to check the exception event status (for finding the cause for the exception event), the device may be busy with additional SCSI commands handling and may not respond within the 100ms timeout. To prevent that, we need to block SCSI commands during handling of exception events and allow retransmissions of the query requests, in case of timeout. CRs-Fixed: 725525 Change-Id: I67a55ad5f891a018f1dfff319233f875789805a1 Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org> Signed-off-by: Maya Erez <merez@codeaurora.org>
* | | Merge "scsi: ufs: reduce UFS dump prints for error case"Linux Build Service Account2014-10-061-15/+18
|\ \ \ | |_|/ |/| |
| * | scsi: ufs: reduce UFS dump prints for error caseGilad Broner2014-10-021-15/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When UFS controller reports an error a dump is printed to aid debugging. In certain cases the print outs is too excesive and not all the information is really needed. In addition, printing is done from interrupt context so long prints might cause the target to crash. This change reduces the amount of data printed out and moves part of the printing to the worker thread context. Change-Id: If3e13000b8165479f2dac4d0c8e513eaa9a3e3c2 Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
* | | Merge "scsi: ufs: tune UniPro parameters to optimize hibern8 exit time"Linux Build Service Account2014-10-012-0/+110
|\ \ \
| * | | scsi: ufs: tune UniPro parameters to optimize hibern8 exit timeSubhash Jadavani2014-09-262-0/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | | Merge "scsi: ufs: move dme peer quirk handling to ufshcd_dme_get_attr()"Linux Build Service Account2014-09-293-32/+39
|\| | | | |_|/ |/| |
| * | scsi: ufs: move dme peer quirk handling to ufshcd_dme_get_attr()Subhash Jadavani2014-09-263-32/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some UFS host controllers may only allow accessing the peer DME attribute in AUTO mode (FAST AUTO or SLOW AUTO) hence we had added a quirk for switching to AUTO power mode before accessing the peer DME attribute. But this quirk handling was only done in UFS driver's debugfs handling hence this patch moves it to main driver ufshcd.c so that this quirk handling is applied to all the peer DME accesses. As we are doing this, this patch fixes 2 more related problem: 1. Current quirk was only handling the switch from FAST to FAST AUTO hence this change adds the handling for SLOW to SLOW AUTO mode change as well. 2. ufsdbg_dme_read() helper function was always reading the local DME attribute hence this change fix the same. Change-Id: I475375fb57cd27cdafe1573c14d09dc7f9a2791b Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* | | Merge "scsi: ufs: introduce the capability for interrupt aggregation"Linux Build Service Account2014-09-271-5/+11
|\ \ \
| * | | scsi: ufs: introduce the capability for interrupt aggregationSubhash Jadavani2014-09-231-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | UFS HCI (Host Controller Interface) allows the transfer requests interrupts to be aggregated to generate the single interrupt but this can impact the performance. Hence introduce the capability which gives choice to use the interrupt aggregation capability or not. By default interrupt aggregation capability is kept disabled. Change-Id: I2a7e85a33f8208553576df327ddd2e183639af0a Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* | | | scsi: ufs_quirks: fix card model string copySubhash Jadavani2014-09-241-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Product name string (referred as "model" string in driver) starts from offset 02h in Product Name String Descriptor but currently we copy the product name from 00h offset of the descriptor which is incorrect. This change fixes the above problem by copying the product name from the right offset of the Product Name String Descriptor. Change-Id: I0ab2ecc19c7383d9782ba57af6441175d2ecda46 Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* | | | scsi: ufs: fix failure to read the string descriptorSubhash Jadavani2014-09-241-7/+31
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While reading variable size descriptors (like string descriptor), some UFS devices may report the "LENGTH" (field in "Transaction Specific fields" of Query Response UPIU) same as what was requested in Query Request UPIU instead of reporting the actual size of the variable size descriptor. Although it's safe to ignore the "LENGTH" field for variable size descriptors as we can always derive the length of the descriptor from the descriptor header fields. Hence this change impose the length match check only for fixed size descriptors (for which we always request the correct size as part of Query Request UPIU). Change-Id: I6be74b3e139b876275c265524cb6ee8489f3737c Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* | | Merge "scsi: ufs-qcom: enable host controller hardware clock gating"Linux Build Service Account2014-09-231-0/+19
|\ \ \ | |/ / |/| |
| * | scsi: ufs-qcom: enable host controller hardware clock gatingSubhash Jadavani2014-09-211-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-qcom: add support for new UFS controller revisionsSubhash Jadavani2014-09-191-8/+6
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | MSM8994v2 will have UFS controller revision 1.3.0 (major.minor.step) hence update the quirks check for this revision as well. Here is the list of UFS revisions (for quick reference): 8084 : 1.1.1 8994v1 : 1.2.0 8994v2 : 1.3.0 Future revisions: x.y.z where x >= 2 Change-Id: Iabc4b9117cda9d685e5a4fbaa9cc1f1bd40a5a60 Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* / scsi: ufs: debugfs: add option to read peer DME attributeSubhash Jadavani2014-09-173-13/+99
|/ | | | | | | | This patch adds the debugfs capability to read the DME attribute of peer UniPro/M-PHY. This should help for debugging. Change-Id: I26d3675bdda8b9fdf0f9aa6b81a1ffafbd828fd0 Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* Merge "scsi: ufs: fix bug when changing power mode via debugfs"Linux Build Service Account2014-09-143-210/+254
|\
| * scsi: ufs: fix bug when changing power mode via debugfsYaniv Gardi2014-09-123-210/+254
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | scsi: ufs: add option to change default UFS power management levelSubhash Jadavani2014-09-112-5/+32
|/ | | | | | | | | | | | | UFS device and link can be put in multiple different low power modes hence UFS driver supports multiple different low power modes. By default UFS driver selects the default (optimal) low power mode (which gives moderate power savings and have relatively less enter and exit latencies) but we might have to tune this default power mode for different chipset platforms to meet the low power requirements/goals. Hence this patch adds option to change default UFS low power mode (level). Change-Id: I45aaae9f46beb3b5d38bcc6dcbd728e79677276c Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* scsi: ufs-qcom: enable hibern8 during clock gatingSubhash Jadavani2014-09-091-0/+1
| | | | | | | | | | | | | | | By default UFS link operates in FAST mode which would keep the link active until host puts the link in hibern8. Power consumption during link active state is huge hence it's recommended to put the link in hibern8 as soon as possible. Clock gating mechanism kicks in after pre-defined idle timeout (150ms at this time) shorter than the runtime suspend timeout hence it would be idle to put the UFS link in hibern8 along with clock gating. Note that this aggressive power management approach doesn't affect the normal storage benchmark performance numbers as clock gating idle timeout has been choosen to not affect storage performance benchmarks. Change-Id: I5b88a7ea2d918750a3cc9150511e25caa1e57284 Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* scsi: ufs: debugfs: add option to read local DME attributeSubhash Jadavani2014-09-051-0/+49
| | | | | | | | This patch adds the debugfs capability to read the DME attribute of local UniPro/M-PHY. This should help for debugging. Change-Id: I2dea471f6bcf591a69206e127d3c9e3febbbc68f Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* scsi: ufs: remove unwanted checks from hibern8 sequenceSubhash Jadavani2014-09-052-32/+53
| | | | | | | | | | | We are unnecessarily checking for the request/task doorbell status during hibern8 enter/exit path but it's very important to have the minimal latencies for hibern8 enter/exit in order to achieve agressive power management strategies for UFS. So these unecessary checks are moved out of this hot path. Change-Id: Ibaeddca7bd516d71eb03b02a1fc1a86f05038f08 Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* phy: relocate and rename phy ufs filesYaniv Gardi2014-09-0319-4008/+37
| | | | | | | | | | | | | | | | | | | | This change contains: 1. Relocating the phy ufs files to reside under the phy driver since this is the location of any file that implements the APIs presented in the generic phy framework 2. Renaming ufs-msm-phy*.* files to be phy-qcom-ufs*.* files. Since UFS is not used strictly in a specific set of targets but rather its code is applicable to MSM, APQ, IPQ etc, any mentioning of "msm" in the file name should be changed to "qcom". Also, prefix of "phy-" is the naming convention of platform driver files that reside in the phy driver. 3. As a result of the relocation of files into the phy driver, a new path is created (include/linux/scsi/ufs) and there we expose ufs header files that are being used also from the drivers/scsi/ufs and from drivers/phy as well. Change-Id: Ie5cb47718911ff711d9401a389f56fa508fcddf3 Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
* ARM: dts: msm: rename attributes to more generic namesYaniv Gardi2014-09-033-3/+3
| | | | | | | | | | In this change the "compatible" attribute in dts files of ufsphy node and the "phy-names" attribute in ufs node are changed to a more generic name. This is done for apq8084 and for msm8994 targets. Change-Id: I46176459e9bc877456489e4728b86eecb2c16261 Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
* defconfig: change SCSI_UFS_MSM to SCSI_UFS_QCOMYaniv Gardi2014-09-013-10/+10
| | | | | | | | | Since UFS is not used strictly in a specific set of targets but rather its code is applicable to MSM, APQ, IPQ etc, "SCSI_UFS_MSM" should be changed to "SCSI_UFS_QCOM". Change-Id: I8851907f86055bb5012cb4a00f81511529ba4e03 Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
* scsi: ufs-msm: rename all entities from "msm" to "qcom"Yaniv Gardi2014-09-0110-943/+953
| | | | | | | | | Since UFS is not used strictly in a specific set of targets but rather its code is applicable to MSM, APQ, IPQ etc, everywhere where there is a use of "msm" should be replaced with "qcom". Change-Id: Ib96259bab6de506a40876c1c121a12bb75b655c1 Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
* Merge "scsi: ufs-msm: remove redundant dependencies in header files"Linux Build Service Account2014-08-304-10/+0
|\
| * scsi: ufs-msm: remove redundant dependencies in header filesYaniv Gardi2014-08-244-10/+0
| | | | | | | | | | | | | | | | In this change we simply remove dependencies in header files as they are not required. Change-Id: I73298a603f205fc102e9a39711263a10ace489e9 Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
* | scsi: ufs-msm: Add support for the new scm_call2 APIVikram Mulukutla2014-08-251-6/+2
| | | | | | | | | | | | | | | | | | | | The scm library has added support for a new secure world interface that is more aligned to the ARMv8 SMC calling convention. Use the new API while maintaining backward compatibility. Change-Id: I19b523edb7a849f50916dbbd426c92cc4c459799 Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
* | Merge "scsi: ufs-msm: remove global variable that is not in use"Linux Build Service Account2014-08-251-2/+0
|\ \
| * | scsi: ufs-msm: remove global variable that is not in useYaniv Gardi2014-08-211-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | In this change a global variable which is never referenced is being removed. Change-Id: I2eda5157cf5e77e61d776d450cb036ca51027a08 Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
* | | Merge "Merge upstream tag 'v3.10.49' into msm-3.10"Linux Build Service Account2014-08-249-53/+132
|\ \ \ | |_|/ |/| |