summaryrefslogtreecommitdiff
path: root/drivers/scsi
AgeCommit message (Collapse)Author
2016-03-22scsi: ufs-qcom: fix uninitialized use warningVenkat Gopalakrishnan
Initialize flags before using. Change-Id: Id59be40b89eeac4a560a76590cbaed5055d73d70 Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-03-22scsi: ufs-qcom: ifdef msm bus scaling code appropriatelyVenkat Gopalakrishnan
ifdef msm-bus include and api's with CONFIG_MSM_BUS_SCALING. This makes compiling UFS driver clean when MSM_BUS_SCALING is not enabled. Change-Id: I50a3f43c7c1deb1033d4ece1493e0f205d8ed553 Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-03-22scsi: ufs-qcom: ifdef qcom ufs crypto code appropriatelyVenkat Gopalakrishnan
ifdef qcom ufs crypto related code based on CONFIG_SCSI_UFS_QCOM_ICE. This makes compiling UFS driver clean when QCOM_ICE is not enabled. Change-Id: I57917ccfa76bc1e80f15a024d1fefd15e0e902da Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-03-22scsi: pm: Remove use of CONFIG_PM_RUNTIMEVenkat Gopalakrishnan
CONFIG_PM_RUNTIME has been eliminated as of kernel 4.4 in favor of just using CONFIG_PM, hence remove its use. Change-Id: I096cde564c7bf2c7a041f0948617a7d74df71dd9 Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-03-22scsi: sd: remove check_events callbackSubhash Jadavani
->check_events() callback sends the Test Unit Ready command to check if underlying media state has changed or not, this is generally not required for embedded storage media (such as UFS). We have seen race between Test Unit Ready command and runtime suspend context which basically can put the Test Unit Ready command at the head of the request queue when queue's rpm_status is SUSPENDING. In this case, scsi_request_fn will not pull in the Test Unit Ready command as REQ_PM flag is not set for it. This basically causes the deadlock situation. Currently there is no better way to fix this error other than removing the check_events() callback which is anyway not required for embedded storage like UFS. Change-Id: Idac374ba1674fede38cb3dcfc2c1f8d3db234d1d Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-03-22scsi: sd: add null pointer check for scsi disk pointerSubhash Jadavani
scsi disk driver probe first calls the PM runtime get before actually allocating the scsi disk structure and if the PM runtime status was set to suspended at this time then it will trigger scsi disk driver's resume callback. But scsi disk driver's resume callback assumes that scsi disk structure is always available when it is called but that's not true always. Fix this issue by skipping the scsi disk resume if scsi disk structure isn't allocated. Change-Id: Ica920b1e07976140dc29847f4dc61aac9fa402ae Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-03-22scsi: reduce the informational log messages during initial probeSubhash Jadavani
There are many informational log messages printed during the LUN detection and while binding the scsi device with upper level driver. Most of these messages are KERN_NOTICE level and hence would show up on serial console. In fact, as we are using the dev_printk() APIs even KERN_DEBUG level messages are ending up on console. This patch removes most of these informational log messages to reduce the load on serial console during boot up. Change-Id: I332b71f529e04039645d1f41783395da8abc7f0b Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-03-22scsi: pm: keep request queue and scsi device runtime status in syncSubhash Jadavani
If scsi device is not runtime suspended while system resumes then scsi device's runtime PM status gets changed to RPM_ACTIVE (if its parent status is already set to RPM_ACTIVE) by the scsi system resume callback. But if the scsi device's runtime PM is managed by block layer then runtime status of scsi device's request queue might still remain in RPM_SUSPENDED hence all the new block requests submitted to the request queue will have to wait until the queue runtime status gets changed to RPM_ACTIVE which never happens as scsi device status is already marked RPM_ACTIVE. Fix this problem by changing the request queue runtime status to RPM_ACTIVE when scsi device runtime status changes to RPM_ACTIVE. Change-Id: I310cf8f1d7f13008b0ab9d87564fc0ac4d2e2314 Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-03-22scsi: pm: fix deadlock conditionSubhash Jadavani
We are seeing deadlock in scsi runtime resume context, here is the call trace: __switch_to+0x70/0x7c __schedule+0x4e0/0x734 schedule+0x70/0x7c __pm_runtime_barrier+0xdc/0x108 __pm_runtime_disable+0x60/0xf4 scsi_dev_type_resume+0x74/0xb4 scsi_runtime_resume+0x5c/0xbc __rpm_callback+0x3c/0x74 rpm_callback+0x60/0x84 rpm_resume+0x368/0x47c __pm_runtime_resume+0x6c/0x94 scsi_autopm_get_device+0x28/0x60 sg_open+0x148/0x5c0 chrdev_open+0x134/0x16c do_dentry_open+0x260/0x2dc vfs_open+0x3c/0x48 do_last+0x844/0xae8 path_openat+0x220/0x5c4 do_filp_open+0x2c/0x80 do_sys_open+0x160/0x1fc SyS_openat+0xc/0x18 It seems commit 3c31b52f96f7 ("scsi: async sd resume") has introduced a bug where runtime resume (for scsi devices not managed by upper level driver) context end up calling pm_runtime_disable() which waits for the runtime resume to finish and hence causing the deadlock. This change fixes this issue by making sure that we don't call pm_runtime_disable() if we are in runtime PM context. Change-Id: I770060c062ee828ef9117b8e5a4c248f48381f35 Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-03-22scsi: pm: fix null pointer access during sg_openSubhash Jadavani
When user space application opens any scsi generic device node (/dev/sg*), we will have following call stack: -> sg_open() -> scsi_autopm_get_device() -> pm_runtime_get_sync() -> scsi_runtime_resume() -> sdev_runtime_resume() -> blk_post_runtime_resume() The request queue device pointer (q->dev) is deferenced but it is NULL. q->dev is assigned when blk_pm_runtime_init() is called which only takes place for sd/sr type scsi devices. SCSI generic driver handles runtime PM get/put on its instead of block layer handling it. We can move the runtime PM get/put responsibility to block layer only if all the requests handled by sg driver are getting inserted to block layer request queue but this is not always true. For example, if LLD ioctl is issued via scsi generic ioctl then it may not get converted to block layer request (and hence doesn't get inserted into block layer request queue) and this may put us in situation where LLD driver handler the ioctl when it's runtime suspended. Better solution would be to let the sg driver manage its own runtime PM get/sync operations and fix the broken scsi_runtime_suspend and scsi_runtime_resume callbacks to handle SCSI devices which do not have upper layer driver (like SCSI disk). Change-Id: I1cae7f992f21a1c420d38c275a817d06baa8923d Signed-off-by: Gilad Broner <gbroner@codeaurora.org> [subhashj@codeaurora.org: fixed the compilation failure] 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-22scsi: Allow auto suspend override by low-level driverSujit Reddy Thumma
Until now the scsi mid-layer forbids runtime suspend till userspace enables it. This is mainly to quarantine some disks with broken runtime power management or have high latencies executing suspend resume callbacks. If the userspace doesn't enable the runtime suspend the underlying hardware will be always on even when it is not doing any useful work and thus wasting power. Some low-level drivers for the controllers can efficiently use runtime power management to reduce power consumption and improve battery life. Allow runtime suspend parameters override within the LLD itself instead of waiting for userspace to control the power management. Change-Id: I03e96a89d19c174deeb5bd4f94136c77073eb009 Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org> [subhashj@codeaurora.org: resolved trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-03-22scsi: sd: reduce log level for suspend/resume log messagesSubhash Jadavani
Generally driver should be silent during the normal operation of the device hence this change reduces the logs level for suspend/resume messages from KERN_NOTICE to KERN_DEBUG. Change-Id: I154fb7c759aa35ed32ea451729083c93fc385c11 Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org> [mattw@codeaurora.org: resolved trivial context conflicts] Signed-off-by: Matt Wagantall <mattw@codeaurora.org> [venkatg@codeaurora.org: resolved trivial merge conflicts] Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-03-22scsi: Adjust DBD setting in mode sense for caching mode page per LLDMaya Erez
Host sends MODE_SENSE_10 with caching mode page, to check if the device supports the cache feature. Some LLD standards requires DBD field to be set to 1. This patch allows LLD to define the setting of DBD if required. Change-Id: I7f6c0ff6613516c3ef49aacc0679b96b8bd9ccc8 Signed-off-by: Maya Erez <merez@codeaurora.org> [mattw@codeaurora.org: resolved a trivial context conflict in Scsi_Host struct definition] Signed-off-by: Matt Wagantall <mattw@codeaurora.org> [subhashj@codeaurora.org: resolved trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-03-22scsi/phy: Remove orphaned files after renamingVenkat Gopalakrishnan
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>
2016-03-22scsi: ufs: add checks before setting hibern8/clk-gating on idle statesSubhash Jadavani
"Hibern8 on idle" and "Clock gating on idle" features can be turned on/off selectively which means their state information is only important if that particular feature is enabled. This change makes sure that we only look at state of these features if feature itself is enabled. Change-Id: I25ef3d9dd60e69afe3f2d9dce602ae48f1b4a044 Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-03-22scsi: ufs: add quirk to increase host PA_SaveConfigTimeSubhash Jadavani
The maximum value PA_SaveConfigTime is 250 (10us) but this is not enough for some vendors. Gear switch from PWM to HS may fail even with this max. PA_SaveConfigTime. Gear switch can be issued by host controller as an error recovery and any software delay will not help on this case so we need to increase PA_SaveConfigTime to >32us as per vendor recommendation. This change adds a quirk to increase the PA_SaveConfigTime parameter. Change-Id: I02a0394bb07f165ba8ae6c5802567cc6d8ad0d16 Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-03-22scsi: ufs: return -ENOIOCTLCMD for unsupported IOCTLsSubhash Jadavani
UFS compat_ioctl(ufshcd_ioctl) should return -ENOIOCTLCMD for unsupported IOCTLs so that the IOCTLs can fall back to higher layer. Change-Id: If6137edd84d38c264555aa2d00ba3a1cab32edb5 Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-03-22scsi: ufs-qcom-ice: add null pointer checkSubhash Jadavani
ufs_qcom_ice_req_setup() function might access the uninitialized pointers, this change makes sure that there are no null pointer accesses. Change-Id: I83c3e2f015a474d5eba6ddaeeaa860e79717760f Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-03-22scsi: ufs: add crypto related operationsGilad Broner
UFS specification has been updated and crypto operations were added. Update the UFS driver code with the new registers and sequences to facilitate future usage. Change-Id: I020870f628977c3ebad6cc0afaef3cb1cdd15063 Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
2016-03-22crypto: ice: general driver clean-upGilad Broner
* Removed spinlock as it was not locking against anything * Removed conversion of interrupt status to error number as it is not used by API client, and in case several bits are set only 1 error is ever handled and the rest get lost. Instead pass to the client the complete status. * Removed redundant includes, variables * vops structure is returned after performing a lookup in the DTS. There's no need for that as we already know the structure to return. * Other minor corrections Change-Id: I6d2549ce04c9e4b19fdd8fe3dfee03d83bfd9d77 Signed-off-by: Gilad Broner <gbroner@codeaurora.org> [venkatg@codeaurora.org: dropped ice driver and mmc ice changes] Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-03-22scsi: ufs: ensure that host pa_tactivate is higher than deviceSubhash Jadavani
Some UFS devices require host PA_TACTIVATE to be higher than device PA_TACTIVATE otherwise it may get stuck during hibern8 sequence. This change allows this by using quirk. Change-Id: Iee1ee7a3e435b34a9e5cca3f5cff3a9b5c36fe1b Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-03-22crypto: ice: Make ICE init & reset API synchronousDinesh K Garg
ICE init & reset can be synchronous now because ICE does not need to go to secure side for any ICE configuration. This would simplify interface and make call more efficient. Change-Id: I7aa4e2d3ba3383d25758b21b8ae261a0220f35f9 Signed-off-by: Dinesh K Garg <dineshg@codeaurora.org> Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org> Signed-off-by: Gilad Broner <gbroner@codeaurora.org> [venkatg@codeaurora.org: dropped ice driver and mmc ice changes] Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-03-22scsi: ufs-ice: fix ICE error handlerGilad Broner
Current code does not actually handle ICE errors as the relevant quirk is not set. Also, ICE errors are checked only if some host controller error occurred. Removed the quirk and fixed the check for ICE errors. Also, removed redundant API crypto_engine_get_err() and crypto_engine_reset_err(). Change-Id: Ic7f4e9a2cd3771f1f52dff97b2be90d12e32d2e5 Signed-off-by: Gilad Broner <gbroner@codeaurora.org> [venkatg@codeaurora.org: dropped msm/ice.c changes] Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-03-22scsi: ufs: add support for compat ioctlSubhash Jadavani
Add support for compat ioctl so that 32-bit application can access the UFS ioctl calls on 64-bit kernel. Change-Id: Id4793bea84405adc7d692d6cf6f2265d1e491c28 Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-03-22scsi: ufs: allow updating bBootLunEn via ioctlSubhash Jadavani
"bBootLunEn" attribute value decides the active Boot LUN but there could be a case where userspace may want to change it during image update. This change allows writing to this parameter. Change-Id: I6e8d630606d8caf6197ef662003ec1ee646afe81 Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-03-22scsi: ufs: Fix compilation failure with CONFIG_LOCK_STATPatrick Daly
from include/linux/kobject.h:21:0, from include/linux/device.h:17, from include/linux/devfreq.h:16, from drivers/scsi/ufs/ufshcd.c:42: drivers/scsi/ufs/ufshcd.c: In function 'ufshcd_init_clk_gating': drivers/scsi/ufs/ufshcd.c:1548:19: error: 'clk_gating' undeclared (first use in this function) sysfs_attr_init(&clk_gating->enable_attr.attr); Change-Id: Ie61be8bc4472cf8960dc0afc3e0683c761ea177e Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
2016-03-22scsi: ufs-debugfs: overwrite error scenario value via debugfsYaniv Gardi
In the old code, there is no way to "disable" the already enabled error scenarios since the operator in use is a bit-wise OR operator. This change fixes this issue. Now, the new value overwrites the previous value so it's possible to disable all error scenarios by: echo 0 > /d/ufshcd0/err_inj_scenario Change-Id: I21eadb3345f6587edf5232ea3c03702bfdb930ad Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
2016-03-22scsi: ufs: fix condition in which DME command failure msg is printed outYaniv Gardi
The condition in which error message is printed out was incorrect and resulted error message only if retries exhausted. But retries happens only if DME command is a peer command, and thus DME commands which are not peer commands and fail are not printed out. This change fixes this issue. Change-Id: I43367befd810da0ebe34efd3a93751b582a19565 Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
2016-03-22scsi: ufs: fix inconsistency of power mode when error is injectedYaniv Gardi
There is an inconsistency between the actual power mode of the UFS controller (and UFS device), to the power mode informed to upper layers in case an error is injected during ERR_INJECT_PWR_CHANGE scenario. Meaning, power change error is reported although the power mode has actually changed successfully in the controller and in the device. This change fixes this inconsistency. Also, this change fixes a bug where a pointer to u8 is sent as a pointer to int, which results undesired behavior. Also, this change removes unused error injection scenarios: - ERR_INJECT_HIBERN8_ENTER - ERR_INJECT_HIBERN8_EXIT Change-Id: I14116656862e3db8f5d6a93b5c798a1470a6b716 Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
2016-03-22scsi: ufs: remove redundant condition for power changeYaniv Gardi
The removed condition is already checked inside the routine ufshcd_change_power_mode(). Also, a minor typo is fixed. Change-Id: Ib238ff9c4bdcd380406505d5319bd2d6c0ed6063 Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
2016-03-22scsi: ufs-qcom: add probe_defer in case phy driver not probed yetYaniv Gardi
In case UFS driver is probed before the phy driver does, the UFS driver should return a PROBE_DEFER code. Change-Id: I94ab353fed35889b92fb2f0baf5ee029894b999b Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
2016-03-22scsi: ufs: fix parameter type from bool to enum ufs_notify_change_statusYaniv Gardi
This change fixes the signature of the routine ufshcd_vops_clk_scale_notify() and the callback clk_scale_notify to receive enum ufs_notify_change_status instead of bool as their 3rd parameter. Change-Id: I8463f4f5f0a77bcbc3b0bcdfd05d1a02e334dc8e Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
2016-03-22scsi: ufs-qcom: fix check of select_major instead of select_minorYaniv Gardi
This change fixes a bug where we check the select_minor value instead of checking the select_major value. Change-Id: I852944215a0be484449b578be09b46095fb01931 Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
2016-03-22scsi: ufs-debugfs: modify "err_inj_scenario" debugfs entryYaniv Gardi
err_inj_scenario debugfs entry used to be a u32 entity. This change modifies it to be a file entity, so reading it (cat /d/.../err_inj_scenario) helps the user get useful information about the enabled/disabled error scenarios. Change-Id: Ia805e6f5357009752ddcace3ae4ed87061e48759 Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
2016-03-22scsi: ufs: do pm qos unvoting before calling scsi_done callbackSubhash Jadavani
We shouldn't be accessing scsi command's "request" structure after calling scsi_done callback but it seems pm qos unvoting code path is accessing this request structure even after caling the scsi_done callback. Fix this by releasing the pm qos vote before calling scsi_done. Change-Id: I5c8dd6ba7f0b619397924d73c1fd6c36fe86ebc1 Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-03-22scsi: ufs-debugfs: remove unnecessary error scenario use-casesYaniv Gardi
This change removes error scenario use-cases that have not been implemented yet, and one error scenario (ERR_INJECT_LINK_STARTUP) that anyway is not recoverable. Change-Id: I78948f64ee3868333ec27e17695980b642248dcf Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
2016-03-22scsi: ufs-debugfs: remove debugfs ability to control error codesYaniv Gardi
In order to simplify working with error injection feature, and since the capability of controlling error codes per error scenario has not been useful in debugging phase of the driver, it's decided to remove this feature. Now, the error injection framework randomly choose an error code from a list of error codes available per error scenario. Change-Id: Iee34b2aa99321f5f51190f26da364c9c129a3f77 Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
2016-03-22scsi: ufs: add retry for query descriptorsSubhash Jadavani
Query commands have 100ms timeout and it may timeout if they are issued in parallel to ongoing read/write SCSI commands, this change adds the retry (max: 10) in case command timeouts. Change-Id: If60e2dd85614c8e383018b1286a625a5e53f872f Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-03-22scsi: ufs-qcom: resume ICE driver after clock ungatingSubhash Jadavani
UFS core driver may power collapse the UFS host controller during clock gating hence we might loose some of the ICE register configuration. In order to restore ICE register configuration, we should call ICE driver's resume callback after ungating UFS clocks. Change-Id: I722a8037d81222c2cd493ebbe608a106f47cedfd Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-03-22scsi: ufs: change clock gating timeout based on loadSubhash Jadavani
Currently we have the same gating timeout for both high load and low load condition but having the different timeouts would help to save power in low load condition and increase performance in high load condition. This change also adds support to tune these timeouts via sysfs. Change-Id: I0ac79042d0fd0cd6a6a917ebe3b52db2a1abd0b9 Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-03-22scsi: ufs-qcom: do clock gating and hibern8 @10msSubhash Jadavani
This change enables the aggressive clock gating along with hibern8 at every 10ms. As hibern8 enter was already @10ms, we are now merging it with clock gating which will also be @10ms after this change. This change is needed to save power for real life usecases. Change-Id: I297d0f7d1c379f0b402298dc5dddd92ac33f6f25 Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-03-22scsi: ufs: don't suspend clock scaling during clock gatingSubhash Jadavani
Currently we are suspending clock scaling during clock gating which doesn't allow us to have clock gating timeout lower than clock scaling polling window. If clock gating timeout is smaller than the clock scaling polling window then we will mostly suspend the clock scaling before clock scaling polling window expires and we might get stuck in same state (scaled down or scaled up) for quite a long time. And for this reason, we have clock gating timeout (50ms) greater than clock scaling polling window (40ms). We would like to have aggressive clock gating timeout even lower than the clock scaling polling window hence this change is decoupling the clock scaling suspend/resume from clock gate/ungate. We will not suspend the clock scaling as part of clock gating instead clock scaling context will schedule scaling suspend work if there are no more pending transfer requests. Change-Id: I7c1e7580c63bbbfbad551d17921774afa3d95ca6 Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-03-22scsi: ufs: add reference counting for scsi block requestsSubhash Jadavani
Currently we call the scsi_block_requests()/scsi_unblock_requests() whenever we want to block/unblock scsi requests but as there is no reference counting, nesting of these calls could leave us in undesired state sometime. Consider following call flow sequence: 1. func1() calls scsi_block_requests() but calls func2() before calling scsi_unblock_requests() 2. func2() calls scsi_block_requests() 3. func2() calls scsi_unblock_requests() 4. func1() calls scsi_unblock_requests() As there is no reference counting, we will have scsi requests unblocked after #3 instead of it to be unblocked only after #4. Though we may not have failures seen with this, we might run into some failures in future. Better solution would be to fix this by adding reference counting. Change-Id: I1eaa39c0716cf41120269cf389ebb322e3006da1 Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-03-22scsi: ufs-qcom: don't disable host PHY ref_clk during aggressive gatingSubhash Jadavani
Enabling & disabling host PHY ref_clk generally may have high latencies hence don't disable them during aggresive clock gating otherwise it could affect the UFS performance badly. Change-Id: I1741c75a6295c7c0b0d77ff578ab977213dcc484 Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-03-22scsi: ufs: let aggressive clock gating context knownSubhash Jadavani
It is quite possible that we might need multiple clocks to be enabled when UFS transfers are active and we generally turn these clocks off during runtime & system suspend. In addition, we also vote these clocks off if aggressive clock gating feature is enabled. Idle timeout for aggressive clock gating feature is generally ~50 milliseconds. But turning these clocks on/off could have huge latencies hence we might only want to turn off few essential (and low latency) clocks during aggressive clock gating. This change adds support to let the vendor specific setup_clocks callback know whether it is called from aggressive clock gating context or normal clock gating context. Having this context information should help vendor specific setup_clocks callback to selectively disable clocks. Change-Id: I5e1523a57bc45a91faef463baac1cea2a2c8d2d6 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-22scsi: ufs: skip devoting device ref_clk during clock gatingSubhash Jadavani
Voting/devoting device ref_clk source could be time consuming hence add support to allow ufs variant to decide if it wants to control ref_clk during aggressive clock gating or not. This clock should still be gated off during runtime/system suspend. Change-Id: Ibec8cc8b3689ff4e2418039e74dbf311e589157e Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-03-22scsi: ufs: core power collapse after clock gatingSubhash Jadavani
Currently we power collapse UFS controller core only during runtime suspend but we could also power collapse it during clock gating as power collapse latencies are only few microseconds. This change adds this aggressive power collapse to save power. Change-Id: Id550bcbcd044670cec08a6abb7225cb9386993b5 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-22scsi: ufs: remove the duplicate function declarationsSubhash Jadavani
Commit 87ab449e105c ("scsi: ufs: splits vops and creates wrapper functions") introduced duplicate function declarations in header file, this change remove these duplicates. Change-Id: I382491e6dadd8b459977d5c3db9ea81a234f6273 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-22scsi: ufs-qcom: don't print error if ufs_qcom_update_sec_cfg failsSubhash Jadavani
Some platforms don't support restoring the secure configuration as secure configuration can never be lost hence scm_restore_sec_cfg() is expected to be failed for such platforms. This change changes the failure message level from error to debug. Change-Id: Ie4b96971d5c4c394576a78444fe5013749375c28 Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-03-22scsi: ufs: don't free irq in suspendSubhash Jadavani
If we had called the pm_qos_add_request() with PM QoS request type set to PM_QOS_REQ_AFFINE_IRQ then freeing up the irq makes the free_irq() to print out warning with call stack. We don't really need to free up irq during suspend, disabling it during suspend and reenabling it during resume should be good enough and that's how it was done on 3.10 kernel as well. Change-Id: I58379a05e1f9d5f18b46394d64bdf6f106afa963 Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>