summaryrefslogtreecommitdiff
path: root/include (follow)
Commit message (Collapse)AuthorAge
...
* | | | 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: add trace event for ufs commandsLee Susman2016-03-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the ftrace infrastructure to conditionally trace ufs command events. New trace event is created, which samples the following ufs command data: - device name - optional identification string - task tag - doorbell register - number of transfer bytes - interrupt status register - request start LBA - command opcode Currently we only fully trace read(10) and write(10) commands. All other commands which pass through ufshcd_send_command() will be printed with "-1" in the lba and transfer_len fields. Usage: echo 1 > /sys/kernel/debug/tracing/events/ufs/enable cat /sys/kernel/debug/tracing/trace_pipe Change-Id: Id6e16a8c0b2a833c5453ed9923384f641e374a71 Signed-off-by: Lee Susman <lsusman@codeaurora.org> [gbroner@codeaurora.org: fix merge conflict] Signed-off-by: Gilad Broner <gbroner@codeaurora.org> [subhashj@codeaurora.org: resolved merge conflicts and compilation error] 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 time profiling supportSubhash Jadavani2016-03-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds the profiling support for some of the time critical operations like hibern8 enter/exit, clock gating & clock scaling. Change-Id: I4dde1078dcd2af47f051639b03c44c423ee344fa Signed-off-by: Subhash Jadavani <subhashj@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>
* | | | scsi: ufs: add option to change default UFS power management levelSubhash Jadavani2016-03-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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> [venkatg@codeaurora.org: resolved trivial merge conflicts] Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
* | | | scsi: ufs: debugfs: add option to read local DME attributeSubhash Jadavani2016-03-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Jadavani2016-03-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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> [venkatg@codeaurora.org: resolved trivial merge conflicts] Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
* | | | phy: relocate and rename phy ufs filesYaniv Gardi2016-03-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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> [gbroner@codeaurora.org: fix merge conflicts] Signed-off-by: Gilad Broner <gbroner@codeaurora.org> [venkatg@codeaurora.org: resolved merge conflicts by keeping upstream version] Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
* | | | scsi: ufs: add additional tracing messagesSubhash Jadavani2016-03-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds following tracing messages: - Add support to trace the automatic background operations enable/disable events. - Add addition logs to trace the UFS device and UFS link state during suspend/resume and initialization. Change-Id: I732b255296042442e50278c2700c52bd166e1d8b 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: Add support for clock scaling using devfreq frameworkSahitya Tummala2016-03-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The clocks for UFS device will be managed by generic DVFS (Dynamic Voltage and Frequency Scaling) framework within kernel. This devfreq framework works with different governors to scale the clocks. By default, UFS devices uses simple_ondemand governor which scales the clocks up if the load is more than upthreshold and scales down if the load is less than downthreshold. Change-Id: I1c3944a5b1771b967c1df3e441a75fd584d6e2a5 Signed-off-by: Sahitya Tummala <stummala@codeaurora.org> [gbroner@codeaurora.org: fix usage of devfreq governor data] Signed-off-by: Gilad Broner <gbroner@codeaurora.org> [subhashj@codeaurora.org: resolved merge conflicts, dropped most of the changes as they are already present on baseline] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* | | | scsi: ufs: Add support for clock gatingSahitya Tummala2016-03-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The UFS controller clocks can be gated after certain period of inactivity, which is typically less than runtime suspend timeout. In addition to clocks the link will also be put into Hibern8 mode to save more power. The clock gating can be turned on by enabling the capability UFSHCD_CAP_CLK_GATING. To enable entering into Hibern8 mode as part of clock gating, set the capability UFSHCD_CAP_HIBERN8_WITH_CLK_GATING. The tracing events for clock gating can be enabled through debugfs as: echo 1 > /sys/kernel/debug/tracing/events/ufs/ufshcd_clk_gating/enable cat /sys/kernel/debug/tracing/trace_pipe Change-Id: I3e5e7e78130941ad7109fc05a46d7c3720245a1a Signed-off-by: Sahitya Tummala <stummala@codeaurora.org> [gbroner@codeaurora.org: fix merge conflicts] Signed-off-by: Gilad Broner <gbroner@codeaurora.org> [subhashj@codeaurora.org: resolved merge conflicts, dropped most of the changes as they are already present on baseline] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* | | | scsi: ufs: add trace support for ufs power managementSujit Reddy Thumma2016-03-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add ftrace support for profiling ufs power management latencies. Usage: echo 1 > /sys/kernel/debug/tracing/events/ufs/enable cat /sys/kernel/debug/tracing/trace_pipe Change-Id: If5c063179cc69a500d4902eb00b4ca3dc16e27f0 Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org> [subhashj@codeaurora.org: resolved trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* | | | uapi: scsi: ufs: add ioctl interface for query requestDolev Raviv2016-03-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch exposes the ioctl interface for UFS driver via SCSI device ioctl interface. As of now UFS driver would provide the ioctl for query interface to connected UFS device. Change-Id: Ib8301a69550408bfcb5fc85bb9c0498450c8cc31 Signed-off-by: Dolev Raviv <draviv@codeaurora.org> Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org> [subhashj@codeaurora.org: resolved trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
* | | | scsi: ufs: created UFS unit-tests frameworkDolev Raviv2016-03-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Created a new UFS block device test framework. This test includes: - Basic read after write command - Random buffer length - Ability to run test multiple times Change-Id: I06fe7bf7d325037d6039a4acfdfb9c2c8960a435 Signed-off-by: Dolev Raviv <draviv@codeaurora.org> Signed-off-by: Maya Erez <merez@codeaurora.org> Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
* | | | soc: qcom: Add kryo l2 accessors driver snapshotDevesh Jhunjhunwala2016-03-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a snapshot of kryo l2 accessors driver as of msm-3.18 commit: e70ad0cd5efdd9dc91a77dcdac31d6132e1315c1 (Promotion of kernel.lnx.3.18-151201.) Signed-off-by: Devesh Jhunjhunwala <deveshj@codeaurora.org>
* | | | clk: msm: clock: Add support for MSM8996/COBALT clock treeTaniya Das2016-03-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add clock tree support for MSM8996 and MSMCOBALT, and add corresponding dt bindings header files. Change-Id: If0281f96ce5dd29b04f190efa1527888bc240bb5 Signed-off-by: Taniya Das <tdas@codeaurora.org>
* | | | clk: msm: Add support for MSM clocksTaniya Das2016-03-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Support added for MSM clock and modifications in the clk framework to use the MSM clock framework. Change-Id: Ibbcf0ffbf9d30dde2dcb0e943225ad95dd4e857d Signed-off-by: Taniya Das <tdas@codeaurora.org>
* | | | trace: power: Add clock_set_rate_complete and clock_state trace eventsColin Cross2016-03-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The clock_set_rate_complete even is used to monitor the latency of the clk_set_rate API, and the clock_state event is used to add support in debugfs to take a snapshot of all the clocks present and their current state to ftrace. This is a squash of the following commits: 1. clk: qcom: Add support to record clock state using ftrace 2. tracing: power: Define clock_set_rate_complete trace event Signed-off-by: Taniya Das <tdas@codeaurora.org>
* | | | QoS: Enhance framework to support cpu/irq specific QoS requestsPraveen Chidambaram2016-03-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QoS request for CPU_DMA_LATENCY can be better optimized if the request can be set only for the required cpus and not all cpus. This helps save power on other cores, while still gauranteeing the quality of service. Enhance the QoS constraints data structures to support target value for each core. Requests specify if the QoS is applicable to all cores (default) or to a selective subset of the cores or to a core(s), that the IRQ is affine to. QoS requests that need to track an IRQ can be set to apply only on the cpus to which the IRQ's smp_affinity attribute is set to. The QoS framework will automatically track IRQ migration between the cores. The QoS is updated to be applied only to the core(s) that the IRQ has been migrated to. Idle and interested drivers can request a PM QoS value for a constraint across all cpus, or a specific cpu or a set of cpus. Separate APIs have been added to request for individual cpu or a cpumask. The default behaviour of PM QoS is maintained i.e, requests that do not specify a type of the request will continue to be effected on all cores. Requests that want to specify an affinity of cpu(s) or an irq, can modify the PM QoS request data structures by specifying the type of the request and either the mask of the cpus or the IRQ number depending on the type. Updating the request does not reset the type of the request. The userspace sysfs interface does not support CPU/IRQ affinity. Change-Id: I09ae85a1e8585d44440e86d63504ad734e8e3e36 Signed-off-by: Praveen Chidambaram <pchidamb@codeaurora.org> Conflicts: kernel/power/qos.c
* | | | QoS: Modify data structures and function arguments for scalability.Praveen Chidambaram2016-03-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QoS add requests uses a handle to the priority list that is used internally to save the request, but this does not extend well. Also, dev_pm_qos structure definition seems to use a list object directly. The 'derivative' relationship seems to be broken. Use pm_qos_request objects instead of passing around the protected priority list object. Change-Id: Ie4c9c22dd4ea13265fe01f080ba68cf77d9d484d Signed-off-by: Praveen Chidambaram <pchidamb@codeaurora.org> [mattw@codeaurora.org: resolve context conflicts and extend struct modifications to additional affected users] Signed-off-by: Matt Wagantall <mattw@codeaurora.org> Conflicts: include/linux/pm_qos.h
* | | | msm: fix compiler errors/warnings in some driversAbhijeet Dharmapurikar2016-03-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | fix compiler warnings/errors in some drivers. Change-Id: Ibc47729b5c5b7c4277bd4666ec56fe8995548b88 Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
* | | | soc: spm: Snapshot of the SPM driver from 3.18 kernelAbhijeet Dharmapurikar2016-03-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a snapshot of the SPM driver from 3.18 kernel. The upstream spm.c file is used as a idle driver. So updated spm driver from 3.18 kernel to msm-spm.c on 4.4 kernel. Change-Id: I73b020214fdcc7eb695cf8f5b52cf7885a0a10cd Signed-off-by: Mahesh Sivasubramanian <msivasub@codeaurora.org>
* | | | regulator: core: put debugfs consumer handle when unregistering a regulatorDavid Collins2016-03-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ensure that regulator_put() is called on the core debugfs consumer pointer for a given regulator when the debugfs interface is no longer needed. This includes inside of the regulator_unregister() function as well as in the error return path of rdev_init_debugfs(). Change-Id: I10563ae1716f31bdc5840d22633fdbfe278330f1 Signed-off-by: David Collins <collinsd@codeaurora.org>
* | | | regulator: core: add regulator_list_corner_voltage functionDavid Collins2016-03-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce a regulator_list_corner_voltage function for consumers that need to know the maximum absolute voltage that may be physically configured when a regulator is operating at a given voltage corner. Change-Id: Ide7a0b502796774fcad01f5cb5679f0938c72f96 Signed-off-by: David Collins <collinsd@codeaurora.org> [adharmap: fixed merge conflicts] Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org> Conflicts: include/linux/regulator/consumer.h
* | | | regulator: core: fix regulator bypass logicOsvaldo Banuelos2016-03-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the regulator debugfs consumer does not call regulator_allow_bypass() on its regulator handles, regulators will not be placed on bypass mode even if all other consumers request for this. Fix this by introducing an open offset count that can be used to selectively disregard the debugfs consumer. Also, introduce a debugfs file to allow or disallow bypass mode on each regulator by leveraging on the new open offset count. Change-Id: If12534dac5e6b1c82acac9b5250137b4f816b922 Signed-off-by: Osvaldo Banuelos <osvaldob@codeaurora.org>
* | | | regulator: Call proxy-consumer functions for each regulator registeredDavid Collins2016-03-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a call to regulator_proxy_consumer_register() at the end of regulator_register() and a call to regulator_proxy_consumer_unregister() at the beginning of regulator_unregister(). These calls ensure that proxy consumer features may be used by any type of regulator regardless of the driver supporting it. Change-Id: Ia70da1df47042fa673c42f389136557f868d19a3 Signed-off-by: David Collins <collinsd@codeaurora.org> [abhimany: resolve trivial merge conflicts] Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org> [adharmap: resolve trivial merge conflicts] Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
* | | | regulator: Add regulator_bulk_set_voltageJustin Paupore2016-03-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a convenience API to set the voltage on multiple consumers stored in a struct regulator_bulk_data[] in one API call. Change-Id: Iaeb5ba8c357a66f1401fb1e142bb03904e8e9c7c Signed-off-by: Justin Paupore <jpaupore@codeaurora.org>
* | | | regulator: add notifier event for regulator enableDavid Collins2016-03-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a notifier event which is triggered when a regulator is enabled. This can be used by a driver which must configure the hardware state whenever a given supply is enabled even if some other consumer was responsible for enabling the supply. Change-Id: Ic8363308b64953451dd01756e1bfdc2a64527096 Signed-off-by: David Collins <collinsd@codeaurora.org> Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org> [osvaldob: resolve trivial merge conflicts] Signed-off-by: Osvaldo Banuelos <osvaldob@codeaurora.org> [adharmap: 0x100 was taken by PRE_VOLTAGE_CHANGE use 0x1000 for ENABLE]
* | | | of/address: Add new API of_iomap_by_name and of_get_address_by_nameXiaocheng Li2016-03-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Create new API of_iomap_by_name and of_get_address_by_name, which would read "reg-names" property and get the reg address by its name. Change-Id: I7ce30da5a7cbc29f8349641af97ac7ed16b4f506 Signed-off-by: Xiaocheng Li <lix@codeaurora.org> [imaund@codeaurora.org: Resolved trivial context conflicts.] Signed-off-by: Ian Maund <imaund@codeaurora.org>
* | | | spmi_devices: change to platform_devicesAbhijeet Dharmapurikar2016-03-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change to using upstream spmi bus architecture. All the spmi devices, marked by spmi-dev-container, become platform devices. spmi-slave-container devices become spmi_devices each representing a slave. The read/write functions use regmap api's instead of calls to spmi_ext_register_read/write() implemented by the spmi bus. This regmap is instantiated per slave. The spmi bus helper functions like spmi_get_irq get changed to their platform bus equivalents. Change Kconfig files include * Remove dependence on OF_SPMI, MSM_QPNP_INT * There were few places where an earlier commit dcc2aedc80746acee589e4b47d3e6adf5d3ec253 missed adding dependence on SPMI along with MSM_SPMI. Fix them. * Add depends on ARCH_MSM. ARCH_MSM is used for internal builds. Change the nodes in DTSI files to confirm to the modified drivers. Update their binding docs to drop spmi-dev-container and spmi-slave-container; Finally update defconfig to use upstream SPMI. Change-Id: Ic85bff27c09c84b152cb38acbc3cadd05c0ec57a Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
* | | | bif: Add snapshot of bif-core framework and qpnp-bsi driverOsvaldo Banuelos2016-03-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This snapshot is taken as of msm-3.18 commit bd4743e (Merge "ARM: dts: msm: Add display configuration for msmgold") Change-Id: I6f9c2fb7bcede6196da26a49dbd6aab598a0b5a9 Signed-off-by: Osvaldo Banuelos <osvaldob@codeaurora.org> Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
* | | | qpnp: Add snapshot of some qpnp, regulator and charger driversAbhijeet Dharmapurikar2016-03-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This snapshot is taken as of msm-3.18 commit 9da4ddc (Merge "clk: msm: clock-gcc: Associate gfx rail voting with gfx3d branch") Change-Id: Idd2f467f1f1863a156d1757589dfe78158f0e43f Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>