Commit graph

563364 commits

Author SHA1 Message Date
Lee Susman
94df812520 scsi: ufs: add test case string for long random tests
Add missing test name strings to long random tests.
These test names are used to distinguish between test case when running
automatic tests.

Change-Id: I1d375eb3cfdd2ae645ba086b7e3121026f3652ae
Signed-off-by: Lee Susman <lsusman@codeaurora.org>
2016-03-22 10:59:19 -07:00
Lee Susman
6c27c43e7c scsi: ufs: fix sector increment in ufs_long_seq_test
Currently, request sector is incremented in the long sequential test
using a calculation which assumes the device logical block size is
512B (equal to sector size) but this is not the case.
This patch changes the calculation to be correct, using the test bio size,
and assuming sector size is 512B.

Change-Id: I807be243b65834edf9201488a849777e43bb658a
Signed-off-by: Lee Susman <lsusman@codeaurora.org>
Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
2016-03-22 10:59:18 -07:00
Lee Susman
d4cf62968e scsi: ufs: add long random read/write unit tests
Generalize the long_sequential_test framework to execute long random read
and long random write tests as well.
The random tests submit a large number of 4KB requests to randomly chosen
LBAs. Currently the tests are defined to read/write 64MB.

Change-Id: I9d797c0d61d863b2a9fbcd593a1be9065202ef76
Signed-off-by: Lee Susman <lsusman@codeaurora.org>
[merez@codeaurora.org: fix trivial conflicts]
Signed-off-by: Maya Erez <merez@codeaurora.org>
2016-03-22 10:59:18 -07:00
Lee Susman
580910dcef scsi: ufs: add check_completion_fn to long_sequential unit test
This patch adds a completion condition to the long sequential unit test.
The condition is the completion of ALL the requests that where created.
Before this condition, the calculated test throughput was not accurate
since the transfered size was not constant.
This patch also increases the request size to the maximum - 128 bios.
In addition, the calculated throughput is always printed to the log.

Change-Id: Ibc16dc60486ff2b58cbc8ce02aee2ad87fea7ba1
Signed-off-by: Lee Susman <lsusman@codeaurora.org>
2016-03-22 10:59:17 -07:00
Lee Susman
0f26d7cf9a scsi: ufs: fix's to ufs_lun_depth unit test
This patch fixes the ufs unit test case "lun_depth" to work properly.
In cases where nutrs == lun_qdepth, 0 was an argument for the random
number generating function, which returned bogus numbers as a result.
In this patch we distinguish between equality and inequality cases, where
in the equality case we remove the irrelevant test cases.

Change-Id: Id7967e894e9d4d0fa1e250852895debcefcbf818
Signed-off-by: Lee Susman <lsusman@codeaurora.org>
2016-03-22 10:59:16 -07:00
Lee Susman
c5761a4b7a scsi: ufs: fix's to ufs_parallel test
This patch fixes the ufs unit test case "parallel_read_write_test"
to work properly. Changes are mainly in the logic deciding on the toggle
of request direction.

Change-Id: I3ba60421de1afb05dca780d82fcf10b9910a0bc1
Signed-off-by: Lee Susman <lsusman@codeaurora.org>
2016-03-22 10:59:15 -07:00
Dolev Raviv
d5098866ba scsi: ufs: Unit test fixes
Match new unit descriptor size definition.
Update logging with:
- prefix with module name
- add '\n' in the end
- test_pr_* removed

Change-Id: Ic086f9b62c5431ba85a667b771e930ea96d253e0
Signed-off-by: Dolev Raviv <draviv@codeaurora.org>
2016-03-22 10:59:14 -07:00
Dolev Raviv
e39c9f9b7e scsi: ufs: ufs device queue depth test
This test is trying to stress the edge cases of the UFS device queue.
This queue has two such edges, the total queue depth and the command per
LU. To test those edges properly, two deviations from the edge in addition
to the edge are tested as well. One deviation will be fixed (1), and the
second will be picked randomly.
The test will fill a request queue with random read requests. The amount
of request will vary each iteration and will be either the one of the
edges or the sum of this edge with one deviations.
Only reads or only writes will be tested within each iteration.

Change-Id: Ib02a63b2c8d6898f01e418a617ccc79eba67dab5
Signed-off-by: Dolev Raviv <draviv@codeaurora.org>
2016-03-22 10:59:13 -07:00
Dolev Raviv
f0e8866cef scsi: ufs: random parallel read and write test
Tests stability on scenarios of multiple threads running random reads
and random writes.
The test introduces the infrastructure for more complex multi-threaded
tests.

Change-Id: I3775f61c65d90d093e4a5b9a9a3e6724f68b5185
Signed-off-by: Dolev Raviv <draviv@codeaurora.org>
2016-03-22 10:59:12 -07:00
Dolev Raviv
79d8df4453 scsi: ufs: multiple queries test
Sends parallel queries with a pseudo random command. The test sends 33
queries, to make sure at least the queue depth is reached.
It tests stability in case of multiple queries.

Change-Id: I00f5992b495d17696d2ae50b510253a96ce5c979
Signed-off-by: Dolev Raviv <draviv@codeaurora.org>
[merez@codeaurora.org: fix conflicts due to exiting changes in 3.14]
Signed-off-by: Maya Erez <merez@codeaurora.org>
2016-03-22 10:59:12 -07:00
Dolev Raviv
2ca1be32b2 scsi: ufs: mixed long sequential
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: dropped block/test-iosched changes]
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-03-22 10:59:11 -07:00
Dolev Raviv
6bb2201614 scsi: ufs: add support for test specific completion check
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: dropped block/test-iosched changes]
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-03-22 10:59:10 -07:00
Dolev Raviv
e6628ef0a2 scsi: ufs: rework unit test infrastructure
Upgrade the APIs used.
Encapsulate test ops (read/write/open functions) and dentry creation
in macros.
Fix naming collisions with mmc tests.

Change-Id: I5c48b369beaf902f8187ced9d884a2149a8644f0
Signed-off-by: Dolev Raviv <draviv@codeaurora.org>
2016-03-22 10:59:09 -07:00
Lee Susman
29cfc516b3 scsi: ufs: long sequential read/write tests
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: dropped test-iosched changes]
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-03-22 10:59:08 -07:00
Subhash Jadavani
c004818cad scsi: ufs-qcom: disable clock scaling
There is possible race condition between clock scaling and clock gating
work, disabling clock scaling until proper fix for the race condition is
found.

Change-Id: Id5c65ac3454f51164d84c033c1e0a56dee951120
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-03-22 10:59:07 -07:00
Gilad Broner
80cb9e5fe7 scsi: ufs: fix static code analysis issues
Running static code analysis tools on the UFS driver code reported
a few issues: non-static functions, usage of pointer after is it freed
and non-initialized variable.
This change fixes these issues.

Change-Id: I0bcc11b057033866fff07a70754fa1751dbc729c
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
[subhashj@codeaurora.org: resolved merge conflicts, skipped changes
to ufs_test.c]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-03-22 10:59:06 -07:00
Gilad Broner
57ef59d9b2 scsi: ufs: implement scsi host timeout handler
A race condition exists between request requeueing and scsi layer
error handling:
When UFS driver queuecommand returns a busy status for a request,
it will be requeued and its tag will be freed and set to -1.
At the same time it is possible that the request will timeout and
scsi layer will start error handling for it. The scsi layer reuses
the request and its tag to send error related commands to the device,
however its tag is no longer valid.
As this request was never really sent to the device, there is no
point to start error handling with the device.
Implement the scsi error handling timeout callback and bypass SCSI
error handling for request that were not actually sent to the device.
For such requests simply reset the block layer timer. Otherwise, let
SCSI layer perform the usual error handling.

Change-Id: Iebed05c95a61f7dcf0a177e5c371b6575ead54d8
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
2016-03-22 10:59:06 -07:00
Gilad Broner
c5c33e40b8 scsi: ufs: retry failed query flag requests
UFS flag query requests may fail sometimes due to timeouts etc.
Add a wrapper function to retry up to 10 times in case of such
failure, similar to retries being made for attribute queries.

Change-Id: Ie3ea4b3c516481e9ec176ab9db884a8a75cd33f9
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
[subhashj@codeaurora.org: resolved trivial merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-03-22 10:59:05 -07:00
Krishna Konda
dc20c1b847 scsi: ufs-qcom: update the bio data stcuture
The 3.14 kernel has changed the members of the bio data structure. This
change updates those data structures referenced in the ufs qcom ice
driver.

Change-Id: I60e982bce8f59b87c30e0f63999914ee5c401f0a
Signed-off-by: Krishna Konda <kkonda@codeaurora.org>
2016-03-22 10:59:04 -07:00
Subhash Jadavani
295bcc19e7 scsi: ufs-qcom-ice: add support for register interface changes
This change adds support for following changes in register interface for
newer UFS controllers:
The register UFS_ICE_CTRL_INFO_n_1 contains 32-bit LSB of crypto data-unit
base number. The register UFS_ICE_CTRL_INFO_n_2 contains 32-bit MSB of the
crypto data-unit base number. The register UFS_ICE_CTRL_INFO_n_3 contains
bitfields BYPASS, CNFG_KEY_INDX, and CDU_SIZE.

Change-Id: I2a9b0b87e912a876e46746431c75e32a0e21a1c6
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: Krishna Konda <kkonda@codeaurora.org>
2016-03-22 10:59:03 -07:00
Gilad Broner
cd64baf8a1 scsi: ufs: convert statistics macros to functions
Kernel coding style requires to use actual functions for
function-like or lengthy macros.
The statistics macros are such, so replace them with functions.

Change-Id: I464768ccb7ba5bba4149dc45adacd777c08a2413
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
2016-03-22 10:59:02 -07:00
Gilad Broner
1478bf7fa3 scsi: ufs: verify command tag validity
A race condition appear to exist between request completion when
scsi_done() is called to end the request and set the tag back to
-1 (at blk_queue_end_tag() scsi_end_request), and scsi layer error
handling which aborts the command and reuses it to request sense
data. Sending the request sense is done with tag which was set to -1
and so it is invalid.
Assert command tag passed from scsi layer is valid.

Change-Id: I71b82e1e6aca4bbf316a2a732a42c564ab0d2248
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
[subhashj@codeaurora.org: resolved trivial merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-03-22 10:59:01 -07:00
Gilad Broner
2d109dcf97 scsi: ufs: remove debugfs entries on driver unloading
debugfs entries that were set up on driver initialization
were not removed in the driver unloading path.
Added removal of the debugfs entries.
Also, cleaned up the unnecessary macro wrapping those functions.

Change-Id: I656b1f76713684547d1f9ca3aa75430b47bd5eff
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
2016-03-22 10:59:00 -07:00
Subhash Jadavani
43b632cb97 scsi: ufshcd: fix possible unclocked register access
vendor specific setup_clocks ops may depend on clocks managed by ufshcd
driver so if the vendor specific setup_clocks callback is called when
the required clocks are turned off, it results into unclocked register
access.

This change make sure that required clocks are enabled before vendor
specific setup_clocks callback is called.

Change-Id: I670c6b69aa361eb5023ef7d945ff45c3fa986fd7
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
[venkatg@codeaurora.org: resolved trivial merge conflicts]
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-03-22 10:58:59 -07:00
Gilad Broner
25245a746c scsi: ufs: add missing memory barriers
Performing several writes to UFS host controller registers has
no gurrantee of ordering, so we must make sure register writes
to setup request list base address etc. are performed before the
run/stop register is enabled.
In addition, when setting up a task request, we must make sure
the updating of descriptors takes places before ringing the
doorbell, similarly to setting up a transfer request.

Change-Id: I740331fe94da3cf8a8e7faee9020c88889aadea3
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
2016-03-22 10:58:59 -07:00
Gilad Broner
d791fc7234 scsi: ufs: add host state prints in failure cases
Whenever some UFS failure occurs the driver prints the UFS
registers in order to help with analysis of the failure.
However this may not be sufficient in some cases, so having
the host controller state as it is represented and managed in
the driver will contribute to analysis efforts.
Added prints of various fields in the hba struct which may be
of interest.

Change-Id: I8385a6b40f6937f07d8f0f0c51f5cf36babf7515
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
[subhashj@codeaurora.org: resolved merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-03-22 10:58:58 -07:00
Subhash Jadavani
04825be019 scsi: ufs-qcom: disable lane symbol clocks if link is not active
UFS lane symbol clocks can be disabled if the UFS link is not active,
this change adds support to vote these clocks off when link is inactive.

Change-Id: Id441d34b0b8ad4f3a3f3e0dacb8c9797b1de64b6
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-03-22 10:58:57 -07:00
Subhash Jadavani
01955a9ec9 scsi: ufs-qcom: enable power management features
UFS power management features (clock gating & scaling, Hibern8 on Idle)
are kept disabled until they are verified on latest UFS host controller.
Now that they are verified on newer host controller, this change enables
them.

Change-Id: I9fb94ee58ab5fbbd5d22a0190624e1a8839060f0
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-03-22 10:58:56 -07:00
Subhash Jadavani
978703baab scsi: ufs-qcom: skip update secure configuration
On latest UFS PHY HW revisions, UFS host controller secure configuration
is retained even during UFS host controller power collapse so we can
skip restoring the secure configuration after coming out of power collapse.

Change-Id: I6cb882c99bd621622286c0f045cbefd9c1b1a0b7
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-03-22 10:58:55 -07:00
Gilad Broner
65b6feb781 scsi: ufs: add instance number to UFS debug-fs entry
UFS exposes a debug-fs directory with various information under
the name "ufs", which will not scale in case more than one UFS
controller is available in the system.
Add the instance number (inherited from the scsi host number) to
the debug-fs entry name.

Change-Id: I1a31be72b90c26cc840219d7ba2944ec4c0bc8f8
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
[subhashj@codeaurora.org: resolved merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-03-22 10:58:54 -07:00
Gilad Broner
2aa36bf1f9 scsi: ufs: add request completion time statistics
When running benchmarks on a system and inspecting the effect of
performance related changes it can be useful to know in a
simple way how long it takes for UFS requests to complete.
Add statistics for UFS requests completion times and measure
minimum, maximum and average completion times for all requests
and also according to request type: read, write and flush.

Change-Id: I85639d629939e3ae3bba6de065ceadae0da3dc99
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
[subhashj@codeaurora.org: resolved merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-03-22 10:58:53 -07:00
Gilad Broner
9eccb6a00d scsi: ufs: fix tag statistics for flush requests
rq_data_dir(rq) will always be either READ or WRITE so conditional
logic could never classify a request as a flush request causing
flush statistics to always be zero.
In addition it is neccesary to check the request type is FS in
order not to count other request type as read/write.

Change-Id: I678203ba47f8296caefa3f197566f2c65abdf059
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
2016-03-22 10:58:52 -07:00
Yaniv Gardi
741bd793f5 scsi: ufs: minimize exposure of ufs header files
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>
2016-03-22 10:58:52 -07:00
Devesh Jhunjhunwala
832a53931e soc: qcom: Include the kryo-l2-accessors driver in build
Add the kryo-l2-accessors driver to the build.

Signed-off-by: Devesh Jhunjhunwala <deveshj@codeaurora.org>
2016-03-22 10:58:51 -07:00
Devesh Jhunjhunwala
f910a321bd clk: msm: Add documentation for gdsc regulator driver
This is a snapshot of gdsc-regulator documentation as of
msm-3.18 commit:

e70ad0cd5efdd9dc91a77dcdac31d6132e1315c1 (Promotion of
kernel.lnx.3.18-151201.)

Signed-off-by: Devesh Jhunjhunwala <deveshj@codeaurora.org>
2016-03-22 10:58:50 -07:00
Maya Erez
de8b5072ec scsi; ufs: compile UFS unit tests as module
UFS Unit tests are used by test teams to test stability
and performance of the UFS driver.
They are inactive unless manually activated and do not impact the
functionality of the UFS driver.

Change-Id: I41ae523dce60b05bb57554f9f8f38c42dbdea4a7
Signed-off-by: Maya Erez <merez@codeaurora.org>
2016-03-22 10:58:49 -07:00
Subhash Jadavani
465485894a scsi: ufs-qcom: allow HS-G3 on newer host controllers.
HS-G3 mode is working as expected with newer host controller revisions
hence this change removes the restriction of only running in PWM gears.

Change-Id: I4df0b6875455730e990a20a2810784f1c32d949f
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-03-22 10:58:48 -07:00
Yaniv Gardi
0fe711f7ea scsi: ufs: renaming "debugfs" files with correct prefix
The old names doesn't include the driver name (as prefix or at all).
This change adds the "ufs" and the "ufs-qcom" prefix to file names
and by that creates uniform naming convention in the driver.

Change-Id: I221b489cc4237882d7e62a9d80bc1ee3f2bcf4a6
Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
2016-03-22 10:58:47 -07:00
Gilad Broner
3a18ae55d2 scsi: ufs: don't use FTRACE_EVENT_ENABLED macro
Trace events have their own trace_<name>_enabled() function
that can be called in order to check if its enabled or not.
FTRACE_EVENT_ENABLED is redundant and will be dropped so
use the trace event function instead.

Change-Id: I4d2cc031ebbd5250bcff9526eaa916d6d691dbfc
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
[subhashj@codeaurora.org: resolved merge conflicts]
2016-03-22 10:58:46 -07:00
Yaniv Gardi
fac1cf559d phy: qcom-ufs: move decision of rate B calibration to ufs driver
Until now, the decision if phy calibration is according to rate A or
rate B values, was done in the phy driver. It made the phy dependent on
the ufs unipro which is unnecessary binding.
This change moves the decision into the ufs driver, and pass it through
a function parameter to the calibration routine in the phy driver.

Change-Id: I7a51d84142c31da57ba5de6ec98526e5c7d1b544
Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
[venkatg@codeaurora.org: resolved trivial merge conflicts]
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-03-22 10:58:45 -07:00
Gilad Broner
da7f098c89 scsi: ufs: enable runtime pm only after ufshcd init
Previous code enables runtime pm before ufshcd_init() is completed,
and before the hba struct is stored in the platform device private
data. This means that pm runtime calls will have null hba pointer
as well as partially initialized driver.
Instead, enable pm runtime only after ufshcd_init() is done and
after hba struct is stored in the platform device private data.

Change-Id: I8225736916a9eda3d9f58d2b0e2566065766b914
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
2016-03-22 10:58:45 -07:00
Subhash Jadavani
413d97dd2a scsi: ufs-qcom: implement pre and post notification for clock scaling
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>
2016-03-22 10:58:43 -07:00
Subhash Jadavani
1811e9b0bb scsi: ufs: add pre & post status change to clk_scale_notify ops
Some UFS host controller implementation may require vendor specific
configurations before and after changing the UFS controller
clock frequencies. This change adds the support for this.

Change-Id: Id4171ef8786fa6883d9af914dc2a675cb62c6a72
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
[venkatg@codeaurora.org: resolved trivial merge conflicts]
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-03-22 10:58:43 -07:00
Subhash Jadavani
8ef05b55a0 scsi: ufs-qcom: disable low power modes and run slow on newer controller
Newer UFS controllers (revision 2) still need to be validated properly
hence disable the low power modes for it until they are validated
thoroughly.
Also run the UFS interface in PWM gear until High Speed Gear operation
is stabililized.

Change-Id: I310b49030d084557f487f3095fc7e1cfa68335e6
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-03-22 10:58:42 -07:00
Subhash Jadavani
061c93d4f1 scsi: ufs-qcom: fix device reference clock control handling
UFS device reference clock control has moved inside UFS controller register
address space for newer Qualcomm chipsets and if we try to do ioremp on the
corresponding memory address then it would fail as the same memory address
space is already ioremapped.
This issue is fixed by removing the requirement of passing reference clock
control register address space resource via device tree node for newer
chipsets.

Change-Id: I8d93f9856d33d3b300bd7994d1dff1d1be84596d
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
[subhashj@codeaurora.org: resolved merge conflicts, skipped changes to
msmthulium.dtsi]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-03-22 10:58:41 -07:00
Subhash Jadavani
ddc6e01269 scsi: ufs-qcom: enable UFSHCD_QUIRK_BROKEN_UFS_HCI_VERSION
Newer revisions of Qualcomm UFS host controller may not advertise
the correct version information in UFS HCI VER register. To handle
this, enable UFSHCD_QUIRK_BROKEN_UFS_HCI_VERSION to let UFS standard
host controller driver call into vendor specific operation to get
right UFS HCI VER register value.

Change-Id: Ibd50b8bb8a87003181ea306690e87728576d49fb
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-03-22 10:58:40 -07:00
Subhash Jadavani
e77d1e1a1d phy: ufs-qcom: disable RX LineCfg
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>
2016-03-22 10:58:39 -07:00
Subhash Jadavani
aa161ba54d scsi: ufs-qcom: allow HS-G3
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>
2016-03-22 10:58:38 -07:00
Subhash Jadavani
99a7595323 scsi: ufs-qcom: cap maximum gear to HS-G2 for legacy host controller
HS-G3 operations may not reliably work on legacy QCOM UFS host controller
hardware (major revision = 0x01) even though capability exchange during
link startup phase may end up negotiating maximum supported gear as G3.
This change downgrades the maximum supported gear to HS-G2 for legacy
host controllers.

Change-Id: Iad95ed4271f83db888940263ea6c6c804d56a422
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-03-22 10:58:37 -07:00
Subhash Jadavani
588cbce99c scsi: ufs: add load based scaling of UFS gear
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>
2016-03-22 10:58:37 -07:00