[PATCH v1 08/17] scsi: ufs: split broken LCC quirk

2015-09-13 Thread Yaniv Gardi
<subha...@codeaurora.org> Signed-off-by: Yaniv Gardi <yga...@codeaurora.org> --- drivers/scsi/ufs/ufshcd.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 0803a89..411ec17 100644 --- a/drivers/scsi/ufs/ufshcd.c +

[PATCH v1 09/17] scsi: ufs: disable vccq if it's not needed by UFS device

2015-09-13 Thread Yaniv Gardi
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. Signed-off-by: Subhash Jadavani <subha...@codeaurora.org> Signed-off-by: Yaniv Gardi <yga...@codeaurora.org> --- driv

[PATCH v1 11/17] scsi: ufs: add error recovery after DL NAC error

2015-09-13 Thread Yaniv Gardi
of kernel logs. Signed-off-by: Subhash Jadavani <subha...@codeaurora.org> Signed-off-by: Yaniv Gardi <yga...@codeaurora.org> --- drivers/scsi/ufs/ufshcd.c | 93 +++ drivers/scsi/ufs/ufshci.h | 2 + 2 files changed, 95 insertions(+) diff --g

[PATCH v1 07/17] scsi: ufs: separate device and host quirks

2015-09-13 Thread Yaniv Gardi
Currently we use the host quirks mechanism in order to handle both device and host controller quirks. In order to support various of UFS devices we should separate handling the device quirks from the host controller's. Signed-off-by: Raviv Shvili <rshv...@codeaurora.org> Signed-off-by:

[PATCH v1 12/17] scsi: ufs: add retry for query descriptors

2015-09-13 Thread Yaniv Gardi
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. Signed-off-by: Subhash Jadavani <subha...@codeaurora.org> Signed-off-by: Yaniv Gardi <yga...@codea

[PATCH v1 14/17] scsi: ufs: tune UniPro parameters to optimize hibern8 exit time

2015-09-13 Thread Yaniv Gardi
port 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. Signed-off-by: Subhash Jadavani <subha...@codeaurora.org> Signed-off-by: Yaniv Gardi <yga...@c

[PATCH v1 17/17] scsi: ufs-qcom: set PA_Local_TX_LCC_Enable before link startup

2015-09-13 Thread Yaniv Gardi
to HS mode and disables it if entered to PWM mode - adds printouts of testbus debug registers Signed-off-by: Yaniv Gardi <yga...@codeaurora.org> --- drivers/scsi/ufs/ufs-qcom.c | 116 +--- drivers/scsi/ufs/ufs-qcom.h | 9 drivers/scsi/ufs/uf

[PATCH v1 16/17] scsi: ufs: add delay before putting UFS rails in low power modes

2015-09-13 Thread Yaniv Gardi
void this situation, this change adds 2ms delay before putting these UFS rails in LPM mode. Signed-off-by: Subhash Jadavani <subha...@codeaurora.org> Signed-off-by: Yaniv Gardi <yga...@codeaurora.org> --- drivers/scsi/ufs/ufshcd.c | 9 + 1 file changed, 9 insertions(+) diff --gi

[PATCH v1 13/17] scsi: ufs: handle non spec compliant bkops behaviour by device

2015-09-13 Thread Yaniv Gardi
ed-off-by: Yaniv Gardi <yga...@codeaurora.org> --- drivers/scsi/ufs/ufshcd.c | 53 --- drivers/scsi/ufs/ufshcd.h | 6 ++ 2 files changed, 52 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c i

[PATCH v1 15/17] scsi: ufs: fix leakage during link off state

2015-09-13 Thread Yaniv Gardi
Jadavani <subha...@codeaurora.org> Signed-off-by: Yaniv Gardi <yga...@codeaurora.org> --- drivers/scsi/ufs/ufshcd.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 0938d6c..20b4c0e 100644 --- a/drivers/scsi/

[PATCH v1 02/17] scsi: ufs: add option to change default UFS power management level

2015-09-13 Thread Yaniv Gardi
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). Signed-off-by: Subhash Jadavani <subha...@codeaurora.org> Signed-off-by: Yaniv Gardi <yga...@codea

[PATCH v1 01/17] scsi: ufs-qcom: add number of lanes per direction

2015-09-13 Thread Yaniv Gardi
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. Signed-off-by: Gilad Broner <gbro...@codeaurora.org> Signed-off-by: Yaniv Gardi <yga...@codeaurora.org> --- ..

[PATCH v1 04/17] scsi: ufs: avoid spurious UFS host controller interrupts

2015-09-13 Thread Yaniv Gardi
interrupt handling. Signed-off-by: Subhash Jadavani <subha...@codeaurora.org> Signed-off-by: Yaniv Gardi <yga...@codeaurora.org> --- drivers/scsi/ufs/ufshcd.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c i

[PATCH v1 03/17] scsi: ufs: optimize system suspend handling

2015-09-13 Thread Yaniv Gardi
ding proper state checks in ufshcd_system_suspend(). Signed-off-by: Subhash Jadavani <subha...@codeaurora.org> Signed-off-by: Yaniv Gardi <yga...@codeaurora.org> --- drivers/scsi/ufs/ufshcd.c | 15 ++- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/scs

[PATCH v1 05/17] scsi: ufs: implement scsi host timeout handler

2015-09-13 Thread Yaniv Gardi
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. Signed-off-by: Gilad Broner <gbro...@codeaurora.org> Signed-off-by: Yaniv Gard

[PATCH v1 00/17] add fixes, device quirks, error recovery,

2015-09-13 Thread Yaniv Gardi
V1: This series should be pushed on top of 15 patches series: "Big fixes, retries, handle a race condition" Yaniv Gardi (17): scsi: ufs-qcom: add number of lanes per direction scsi: ufs: add option to change default UFS power management level scsi: ufs: optimize system suspen

[PATCH v5 4/8] add ufshcd_get_variant ufshcd_set_variant

2015-09-02 Thread Yaniv Gardi
Signed-off-by: Yaniv Gardi <yga...@codeaurora.org> --- drivers/scsi/ufs/ufs-qcom.c | 34 +- drivers/scsi/ufs/ufshcd.h | 21 + 2 files changed, 38 insertions(+), 17 deletions(-) diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/u

[PATCH v5 0/8] Fix error message and present UFS variant

2015-09-02 Thread Yaniv Gardi
in routine definition, build errors in case CONFIG_PM is not defined and some other minor fixes. Yaniv Gardi (8): phy: qcom-ufs: fix build error when the component is built as a module scsi: ufs-qcom: fix compilation warning if compiled as a module scsi: ufs-qcom: update configuration option

[PATCH v5 6/8] scsi: ufs: make the UFS variant a platform device

2015-09-02 Thread Yaniv Gardi
, system suspend/resume etc), parsers of clocks, regulators and pm_levels from DT. 2. What used to be the old platform "probe" is now "only" a pltfrm_init() routine, that does exactly the same, but only being called by the new probe function of the UFS variant. Signed-off-

[PATCH v5 8/8] scsi: ufs-qcom: add QUniPro hardware support and power optimizations

2015-09-02 Thread Yaniv Gardi
-by: Yaniv Gardi <yga...@codeaurora.org> --- drivers/scsi/ufs/ufs-qcom.c | 640 drivers/scsi/ufs/ufs-qcom.h | 31 ++- drivers/scsi/ufs/ufshcd.c | 8 +- drivers/scsi/ufs/ufshcd.h | 27 +- 4 files changed, 525 insertions(+), 181 deletions(-)

[PATCH v5 5/8] scsi: ufs: creates wrapper functions for vops

2015-09-02 Thread Yaniv Gardi
In order to simplify the code a set of wrapper functions is created to test and call each of the variant operations. Signed-off-by: Yaniv Gardi <yga...@codeaurora.org> --- drivers/scsi/ufs/ufs-qcom.c | 1 - drivers/scsi/ufs/ufshcd.c

[PATCH v5 7/8] scsi: ufs-qcom: add debug prints for test bus

2015-09-02 Thread Yaniv Gardi
Adds support for configuring and reading the test bus and debug registers. This change also adds another vops in order to print the debug registers. Signed-off-by: Yaniv Gardi <yga...@codeaurora.org> --- drivers/scsi/ufs/ufs-qcom.c | 165 +++- d

[PATCH v5 2/8] scsi: ufs-qcom: fix compilation warning if compiled as a module

2015-09-02 Thread Yaniv Gardi
This change fixes a compilation warning that happens if SCSI_UFS_QCOM is compiled as a module. Also this patch fixes an error happens when insmod the module: "ufs_qcom: module license 'unspecified' taints kernel." Signed-off-by: Yaniv Gardi <yga...@codeaurora.org> --- driv

[PATCH v5 1/8] phy: qcom-ufs: fix build error when the component is built as a module

2015-09-02 Thread Yaniv Gardi
defined! ERROR: "ufs_qcom_phy_disable_dev_ref_clk" [drivers/scsi/ufs/ufs-qcom.ko] undefined! ERROR: "ufs_qcom_phy_save_controller_version" [drivers/scsi/ufs/ufs-qcom.ko] undefined! ERROR: "ufs_qcom_phy_enable_iface_clk" [drivers/scsi/ufs/ufs-qcom.ko]

[PATCH v5 3/8] scsi: ufs-qcom: update configuration option of SCSI_UFS_QCOM component

2015-09-02 Thread Yaniv Gardi
This change is required in order to be able to build the component as a module. Signed-off-by: Yaniv Gardi <yga...@codeaurora.org> --- drivers/scsi/ufs/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/Kconfig b/drivers/scsi/ufs/Kconfig index e

[PATCH v3 04/15] scsi: ufs: clear outstanding_request bit in case query timeout

2015-09-02 Thread Yaniv Gardi
When sending a query to the device returns with a timeout error, we clear the corresponding bit in the DOORBELL register but we don't clear the outstanding_request field as we should. This patch fixes this bug. Signed-off-by: Yaniv Gardi <yga...@codeaurora.org> --- drivers/scsi/ufs/uf

[PATCH v3 05/15] scsi: ufs: increase fDeviceInit query response timeout

2015-09-02 Thread Yaniv Gardi
have to retry fDeviceInit query requests multiple times and each query request timeout prints one error message. Signed-off-by: Subhash Jadavani <subha...@codeaurora.org> Signed-off-by: Yaniv Gardi <yga...@codeaurora.org> --- drivers/scsi/ufs/ufshcd.c | 12 +++- 1 file changed, 1

[PATCH v3 01/15] scsi: ufs: clear UTRD, UPIU req and rsp before new transfers

2015-09-02 Thread Yaniv Gardi
<subha...@codeaurora.org> Signed-off-by: Maya Erez <me...@codeaurora.org> Signed-off-by: Yaniv Gardi <yga...@codeaurora.org> --- drivers/scsi/ufs/ufshcd.c | 17 + 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/

[PATCH v3 14/15] scsi: ufs: commit descriptors before setting the doorbell

2015-09-02 Thread Yaniv Gardi
bro...@codeaurora.org> Signed-off-by: Subhash Jadavani <subha...@codeaurora.org> Signed-off-by: Yaniv Gardi <yga...@codeaurora.org> --- drivers/scsi/ufs/ufshcd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 29851

[PATCH v3 09/15] scsi: ufs: add retries for hibern8 enter

2015-09-02 Thread Yaniv Gardi
is recovered to active state, tries to put the UFS link in hibern8 enter again until retry count expires. Signed-off-by: Subhash Jadavani <subha...@codeaurora.org> Signed-off-by: Yaniv Gardi <yga...@codeaurora.org> --- drivers/scsi/ufs/ufshcd.c | 26 -- 1 file

[PATCH v3 11/15] scsi: ufs: retry failed query flag requests

2015-09-02 Thread Yaniv Gardi
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. Signed-off-by: Gilad Broner <gbro...@codeaurora.org> Signed-off-by: Yaniv Gardi <yga...@codea

[PATCH v3 10/15] scsi: ufs: fix error recovery after the hibern8 exit failure

2015-09-02 Thread Yaniv Gardi
from first 2 context listed above. This change fixes the recovery by adding proper error handling mechanism. Signed-off-by: Subhash Jadavani <subha...@codeaurora.org> Signed-off-by: Yaniv Gardi <yga...@codeaurora.org> --- drivers/scsi/ufs/u

[PATCH v3 08/15] scsi: ufs: add retries to dme_peer get and set attribute

2015-09-02 Thread Yaniv Gardi
<lsus...@codeaurora.org> Signed-off-by: Yaniv Gardi <yga...@codeaurora.org> --- drivers/scsi/ufs/ufshcd.c | 40 +--- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 217b5cf..8d

[PATCH v3 12/15] scsi: ufs: reduce the interrupts for power mode change requests

2015-09-02 Thread Yaniv Gardi
events which is not quite necessary and instead we can just wait for the interrupt of 2nd completion, this should reduce the number of interrupts and could reduce the unnecessary CPU wakeups to handle extra interrupts. Signed-off-by: Subhash Jadavani <subha...@codeaurora.org> Signed-off-by: Yaniv

[PATCH v3 13/15] scsi: ufs: add missing memory barriers

2015-09-02 Thread Yaniv Gardi
of descriptors takes places before ringing the doorbell, similarly to setting up a transfer request. Signed-off-by: Gilad Broner <gbro...@codeaurora.org> Signed-off-by: Yaniv Gardi <yga...@codeaurora.org> --- drivers/scsi/ufs/ufshcd.c | 21 +++-- 1 file changed, 15 inse

[PATCH v3 00/15] Big fixes, retries, handle a race condition

2015-09-02 Thread Yaniv Gardi
the series of 8 patches I have uploaded to the upstream a week ago: "Fix error message and present UFS variant probe" Yaniv Gardi (15): scsi: ufs: clear UTRD, UPIU req and rsp before new transfers scsi: ufs: clear fields UTRD, UPIU req and rsp before new transfers scsi: ufs: verify

[PATCH v3 15/15] scsi: ufs: add wrapper for retrying sending query attribute

2015-09-02 Thread Yaniv Gardi
Sometimes queries from the device might return a failure so it is recommended to retry sending the query, before giving up. This change adds a wrapper to retry sending a query attribute, in cases where we need to wait longer, before we continue, or before reporting a failure. Signed-off-by: Yaniv

[PATCH v3 03/15] scsi: ufs: verify command tag validity

2015-09-02 Thread Yaniv Gardi
is done with tag which was set to -1 and so it is invalid. Assert command tag passed from scsi layer is valid. Signed-off-by: Gilad Broner <gbro...@codeaurora.org> Signed-off-by: Yaniv Gardi <yga...@codeaurora.org> --- drivers/scsi/ufs/ufshcd.c | 24 ++-- 1 file

[PATCH v3 06/15] scsi: ufs: avoid exception event handler racing with PM callbacks

2015-09-02 Thread Yaniv Gardi
while PM callbacks are running. Signed-off-by: Subhash Jadavani <subha...@codeaurora.org> Signed-off-by: Yaniv Gardi <yga...@codeaurora.org> --- drivers/scsi/ufs/ufshcd.c | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/driv

[PATCH v3 07/15] scsi: ufs: set REQUEST_SENSE command size to 18 bytes

2015-09-02 Thread Yaniv Gardi
According to UFS device specification REQUEST_SENSE command can only report back up to 18 bytes of data. Signed-off-by: Gilad Broner <gbro...@codeaurora.org> Signed-off-by: Yaniv Gardi <yga...@codeaurora.org> --- drivers/scsi/ufs/ufshcd.c | 11 ++- 1 file changed, 6 inse

[PATCH v3 02/15] scsi: ufs: clear fields UTRD, UPIU req and rsp before new transfers

2015-09-02 Thread Yaniv Gardi
the PRDT table length to zero which should take care of commands which doesn't have any data associated with it. We are also clearing the unused fields in request UPIU for NOP command. Signed-off-by: Subhash Jadavani <subha...@codeaurora.org> Signed-off-by: Yaniv Gardi <yga...@codea

[PATCH v7 2/8] scsi: ufs-qcom: fix compilation warning if compiled as a module

2015-09-02 Thread Yaniv Gardi
This change fixes a compilation warning that happens if SCSI_UFS_QCOM is compiled as a module. Also this patch fixes an error happens when insmod the module: "ufs_qcom: module license 'unspecified' taints kernel." Signed-off-by: Yaniv Gardi <yga...@codeaurora.org> --- driv

[PATCH v7 3/8] scsi: ufs-qcom: update configuration option of SCSI_UFS_QCOM component

2015-09-02 Thread Yaniv Gardi
This change is required in order to be able to build the component as a module. Signed-off-by: Yaniv Gardi <yga...@codeaurora.org> --- drivers/scsi/ufs/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/Kconfig b/drivers/scsi/ufs/Kconfig index e

[PATCH v7 8/8] scsi: ufs-qcom: add QUniPro hardware support and power optimizations

2015-09-02 Thread Yaniv Gardi
-by: Yaniv Gardi <yga...@codeaurora.org> --- drivers/scsi/ufs/ufs-qcom.c | 640 drivers/scsi/ufs/ufs-qcom.h | 31 ++- drivers/scsi/ufs/ufshcd.c | 8 +- drivers/scsi/ufs/ufshcd.h | 27 +- 4 files changed, 525 insertions(+), 181 deletions(-)

[PATCH v7 7/8] scsi: ufs-qcom: add debug prints for test bus

2015-09-02 Thread Yaniv Gardi
Adds support for configuring and reading the test bus and debug registers. This change also adds another vops in order to print the debug registers. Signed-off-by: Yaniv Gardi <yga...@codeaurora.org> --- drivers/scsi/ufs/ufs-qcom.c | 165 +++- d

[PATCH v7 6/8] scsi: ufs: make the UFS variant a platform device

2015-09-02 Thread Yaniv Gardi
, system suspend/resume etc), parsers of clocks, regulators and pm_levels from DT. 2. What used to be the old platform "probe" is now "only" a pltfrm_init() routine, that does exactly the same, but only being called by the new probe function of the UFS variant. Signed-off-

[PATCH v7 4/8] add ufshcd_get_variant ufshcd_set_variant

2015-09-02 Thread Yaniv Gardi
Signed-off-by: Yaniv Gardi <yga...@codeaurora.org> --- drivers/scsi/ufs/ufs-qcom.c | 34 +- drivers/scsi/ufs/ufshcd.h | 21 + 2 files changed, 38 insertions(+), 17 deletions(-) diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/u

[PATCH v7 5/8] scsi: ufs: creates wrapper functions for vops

2015-09-02 Thread Yaniv Gardi
In order to simplify the code a set of wrapper functions is created to test and call each of the variant operations. Signed-off-by: Yaniv Gardi <yga...@codeaurora.org> --- drivers/scsi/ufs/ufs-qcom.c | 1 - drivers/scsi/ufs/ufshcd.c

[PATCH v7 1/8] phy: qcom-ufs: fix build error when the component is built as a module

2015-09-02 Thread Yaniv Gardi
defined! ERROR: "ufs_qcom_phy_disable_dev_ref_clk" [drivers/scsi/ufs/ufs-qcom.ko] undefined! ERROR: "ufs_qcom_phy_save_controller_version" [drivers/scsi/ufs/ufs-qcom.ko] undefined! ERROR: "ufs_qcom_phy_enable_iface_clk" [drivers/scsi/ufs/ufs-qcom.ko]

[PATCH v7 0/8] Fix error message and present UFS variant

2015-09-02 Thread Yaniv Gardi
and modify the compatible strings in Documentation/devicetree/bindings/ufs/ufshcd-pltfrm.txt V3: fixes a few minor issues. V2: fixes a few issues of unnecessary EXPORT_SYMBOL, types of parameters in routine definition, build errors in case CONFIG_PM is not defined and some other minor fixes. Yaniv

[PATCH v6 5/8] scsi: ufs: creates wrapper functions for vops

2015-09-02 Thread Yaniv Gardi
In order to simplify the code a set of wrapper functions is created to test and call each of the variant operations. Signed-off-by: Yaniv Gardi <yga...@codeaurora.org> --- drivers/scsi/ufs/ufs-qcom.c | 1 - drivers/scsi/ufs/ufshcd.c

[PATCH v6 4/8] add ufshcd_get_variant ufshcd_set_variant

2015-09-02 Thread Yaniv Gardi
Signed-off-by: Yaniv Gardi <yga...@codeaurora.org> --- drivers/scsi/ufs/ufs-qcom.c | 34 +- drivers/scsi/ufs/ufshcd.h | 21 + 2 files changed, 38 insertions(+), 17 deletions(-) diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/u

[PATCH v6 1/8] phy: qcom-ufs: fix build error when the component is built as a module

2015-09-02 Thread Yaniv Gardi
defined! ERROR: "ufs_qcom_phy_disable_dev_ref_clk" [drivers/scsi/ufs/ufs-qcom.ko] undefined! ERROR: "ufs_qcom_phy_save_controller_version" [drivers/scsi/ufs/ufs-qcom.ko] undefined! ERROR: "ufs_qcom_phy_enable_iface_clk" [drivers/scsi/ufs/ufs-qcom.ko]

[PATCH v6 2/8] scsi: ufs-qcom: fix compilation warning if compiled as a module

2015-09-02 Thread Yaniv Gardi
This change fixes a compilation warning that happens if SCSI_UFS_QCOM is compiled as a module. Also this patch fixes an error happens when insmod the module: "ufs_qcom: module license 'unspecified' taints kernel." Signed-off-by: Yaniv Gardi <yga...@codeaurora.org> --- driv

[PATCH v6 3/8] scsi: ufs-qcom: update configuration option of SCSI_UFS_QCOM component

2015-09-02 Thread Yaniv Gardi
This change is required in order to be able to build the component as a module. Signed-off-by: Yaniv Gardi <yga...@codeaurora.org> --- drivers/scsi/ufs/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/Kconfig b/drivers/scsi/ufs/Kconfig index e

[PATCH v6 0/8] Fix error message and present UFS variant

2015-09-02 Thread Yaniv Gardi
in Documentation/devicetree/bindings/ufs/ufshcd-pltfrm.txt V3: fixes a few minor issues. V2: fixes a few issues of unnecessary EXPORT_SYMBOL, types of parameters in routine definition, build errors in case CONFIG_PM is not defined and some other minor fixes. Yaniv Gardi (8): phy: qcom-ufs: fix

[PATCH v4 7/8] scsi: ufs-qcom: add debug prints for test bus

2015-08-30 Thread Yaniv Gardi
Adds support for configuring and reading the test bus and debug registers. This change also adds another vops in order to print the debug registers. Signed-off-by: Yaniv Gardi yga...@codeaurora.org --- drivers/scsi/ufs/ufs-qcom.c | 165 +++- drivers/scsi

[PATCH v4 1/8] phy: qcom-ufs: fix build error when the component is built as a module

2015-08-30 Thread Yaniv Gardi
! ERROR: ufs_qcom_phy_save_controller_version [drivers/scsi/ufs/ufs-qcom.ko] undefined! ERROR: ufs_qcom_phy_enable_iface_clk [drivers/scsi/ufs/ufs-qcom.ko] undefined! make[1]: *** [__modpost] Error 1 Signed-off-by: Yaniv Gardi yga...@codeaurora.org --- drivers/phy/phy-qcom-ufs.c | 11

[PATCH v4 0/8] Fix error message and present UFS variant

2015-08-30 Thread Yaniv Gardi
in case CONFIG_PM is not defined and some other minor fixes. Yaniv Gardi (8): phy: qcom-ufs: fix build error when the component is built as a module scsi: ufs-qcom: fix compilation warning if compiled as a module scsi: ufs-qcom: update configuration option of SCSI_UFS_QCOM component add

[PATCH v4 3/8] scsi: ufs-qcom: update configuration option of SCSI_UFS_QCOM component

2015-08-30 Thread Yaniv Gardi
This change is required in order to be able to build the component as a module. Signed-off-by: Yaniv Gardi yga...@codeaurora.org --- drivers/scsi/ufs/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/Kconfig b/drivers/scsi/ufs/Kconfig index e945383

[PATCH v4 8/8] scsi: ufs-qcom: add QUniPro hardware support and power optimizations

2015-08-30 Thread Yaniv Gardi
-by: Yaniv Gardi yga...@codeaurora.org --- drivers/scsi/ufs/ufs-qcom.c | 640 drivers/scsi/ufs/ufs-qcom.h | 31 ++- drivers/scsi/ufs/ufshcd.c | 8 +- drivers/scsi/ufs/ufshcd.h | 27 +- 4 files changed, 525 insertions(+), 181 deletions(-) diff

[PATCH v4 6/8] scsi: ufs: make the UFS variant a platform device

2015-08-30 Thread Yaniv Gardi
, system suspend/resume etc), parsers of clocks, regulators and pm_levels from DT. 2. What used to be the old platform probe is now only a pltfrm_init() routine, that does exactly the same, but only being called by the new probe function of the UFS variant. Signed-off-by: Yaniv Gardi yga

[PATCH v4 4/8] add ufshcd_get_variant ufshcd_set_variant

2015-08-30 Thread Yaniv Gardi
Signed-off-by: Yaniv Gardi yga...@codeaurora.org --- drivers/scsi/ufs/ufs-qcom.c | 34 +- drivers/scsi/ufs/ufshcd.h | 21 + 2 files changed, 38 insertions(+), 17 deletions(-) diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs

[PATCH v4 5/8] scsi: ufs: creates wrapper functions for vops

2015-08-30 Thread Yaniv Gardi
In order to simplify the code a set of wrapper functions is created to test and call each of the variant operations. Signed-off-by: Yaniv Gardi yga...@codeaurora.org --- drivers/scsi/ufs/ufs-qcom.c | 1 - drivers/scsi/ufs/ufshcd.c | 104 +--- drivers

[PATCH v2 09/15] scsi: ufs: add retries for hibern8 enter

2015-08-27 Thread Yaniv Gardi
is recovered to active state, tries to put the UFS link in hibern8 enter again until retry count expires. Signed-off-by: Subhash Jadavani subha...@codeaurora.org Signed-off-by: Yaniv Gardi yga...@codeaurora.org --- drivers/scsi/ufs/ufshcd.c | 26 -- 1 file changed, 24 insertions

[PATCH v2 15/15] scsi: ufs: add wrapper for retrying sending query attribute

2015-08-27 Thread Yaniv Gardi
Sometimes queries from the device might return a failure so it is recommended to retry sending the query, before giving up. This change adds a wrapper to retry sending a query attribute, in cases where we need to wait longer, before we continue, or before reporting a failure. Signed-off-by: Yaniv

[PATCH v2 14/15] scsi: ufs: commit descriptors before setting the doorbell

2015-08-27 Thread Yaniv Gardi
...@codeaurora.org Signed-off-by: Subhash Jadavani subha...@codeaurora.org Signed-off-by: Yaniv Gardi yga...@codeaurora.org --- drivers/scsi/ufs/ufshcd.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 298511a..024cc86 100644 --- a/drivers

[PATCH v2 13/15] scsi: ufs: add missing memory barriers

2015-08-27 Thread Yaniv Gardi
of descriptors takes places before ringing the doorbell, similarly to setting up a transfer request. Signed-off-by: Gilad Broner gbro...@codeaurora.org Signed-off-by: Yaniv Gardi yga...@codeaurora.org --- drivers/scsi/ufs/ufshcd.c | 21 +++-- 1 file changed, 15 insertions(+), 6

[PATCH v2 11/15] scsi: ufs: retry failed query flag requests

2015-08-27 Thread Yaniv Gardi
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. Signed-off-by: Gilad Broner gbro...@codeaurora.org Signed-off-by: Yaniv Gardi yga...@codeaurora.org

[PATCH v2 12/15] scsi: ufs: reduce the interrupts for power mode change requests

2015-08-27 Thread Yaniv Gardi
events which is not quite necessary and instead we can just wait for the interrupt of 2nd completion, this should reduce the number of interrupts and could reduce the unnecessary CPU wakeups to handle extra interrupts. Signed-off-by: Subhash Jadavani subha...@codeaurora.org Signed-off-by: Yaniv Gardi

[PATCH v2 10/15] scsi: ufs: fix error recovery after the hibern8 exit failure

2015-08-27 Thread Yaniv Gardi
from first 2 context listed above. This change fixes the recovery by adding proper error handling mechanism. Signed-off-by: Subhash Jadavani subha...@codeaurora.org Signed-off-by: Yaniv Gardi yga...@codeaurora.org --- drivers/scsi/ufs/ufshcd.c | 58

[PATCH v2 06/15] scsi: ufs: avoid exception event handler racing with PM callbacks

2015-08-27 Thread Yaniv Gardi
while PM callbacks are running. Signed-off-by: Subhash Jadavani subha...@codeaurora.org Signed-off-by: Yaniv Gardi yga...@codeaurora.org --- drivers/scsi/ufs/ufshcd.c | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs

[PATCH v2 07/15] scsi: ufs: set REQUEST_SENSE command size to 18 bytes

2015-08-27 Thread Yaniv Gardi
According to UFS device specification REQUEST_SENSE command can only report back up to 18 bytes of data. Signed-off-by: Gilad Broner gbro...@codeaurora.org Signed-off-by: Yaniv Gardi yga...@codeaurora.org --- drivers/scsi/ufs/ufshcd.c | 11 ++- 1 file changed, 6 insertions(+), 5

[PATCH v2 04/15] scsi: ufs: clear outstanding_request bit in case query timeout

2015-08-27 Thread Yaniv Gardi
When sending a query to the device returns with a timeout error, we clear the corresponding bit in the DOORBELL register but we don't clear the outstanding_request field as we should. This patch fixes this bug. Signed-off-by: Yaniv Gardi yga...@codeaurora.org --- drivers/scsi/ufs/ufshcd.c | 22

[PATCH v2 05/15] scsi: ufs: increase fDeviceInit query response timeout

2015-08-27 Thread Yaniv Gardi
have to retry fDeviceInit query requests multiple times and each query request timeout prints one error message. Signed-off-by: Subhash Jadavani subha...@codeaurora.org Signed-off-by: Yaniv Gardi yga...@codeaurora.org --- drivers/scsi/ufs/ufshcd.c | 12 +++- 1 file changed, 11 insertions

[PATCH v2 08/15] scsi: ufs: add retries to dme_peer get and set attribute

2015-08-27 Thread Yaniv Gardi
lsus...@codeaurora.org Signed-off-by: Yaniv Gardi yga...@codeaurora.org --- drivers/scsi/ufs/ufshcd.c | 40 +--- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 217b5cf..8d5bdf0 100644

[PATCH v3 6/8] scsi: ufs: make the UFS variant a platform device

2015-08-23 Thread Yaniv Gardi
, system suspend/resume etc), parsers of clocks, regulators and pm_levels from DT. 2. What used to be the old platform probe is now only a pltfrm_init() routine, that does exactly the same, but only being called by the new probe function of the UFS variant. Signed-off-by: Yaniv Gardi yga

[PATCH v3 1/8] phy: qcom-ufs: fix build error when the component is built as a module

2015-08-23 Thread Yaniv Gardi
! ERROR: ufs_qcom_phy_save_controller_version [drivers/scsi/ufs/ufs-qcom.ko] undefined! ERROR: ufs_qcom_phy_enable_iface_clk [drivers/scsi/ufs/ufs-qcom.ko] undefined! make[1]: *** [__modpost] Error 1 Signed-off-by: Yaniv Gardi yga...@codeaurora.org --- drivers/phy/phy-qcom-ufs.c | 11

[PATCH v2 0/8] Fix error message and present UFS variant

2015-08-23 Thread Yaniv Gardi
V3: fixes a few minor issues. V2: fixes a few issues of unnecessary EXPORT_SYMBOL, types of parameters in routine definition, build errors in case CONFIG_PM is not defined and some other minor fixes. Yaniv Gardi (8): phy: qcom-ufs: fix build error when the component is built as a module

[PATCH v3 4/8] add ufshcd_get_variant ufshcd_set_variant

2015-08-23 Thread Yaniv Gardi
Signed-off-by: Yaniv Gardi yga...@codeaurora.org --- drivers/scsi/ufs/ufs-qcom.c | 34 +- drivers/scsi/ufs/ufshcd.h | 21 + 2 files changed, 38 insertions(+), 17 deletions(-) diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs

[PATCH v3 8/8] scsi: ufs-qcom: add QUniPro hardware support and power optimizations

2015-08-23 Thread Yaniv Gardi
-by: Yaniv Gardi yga...@codeaurora.org --- drivers/scsi/ufs/ufs-qcom.c | 640 drivers/scsi/ufs/ufs-qcom.h | 31 ++- drivers/scsi/ufs/ufshcd.c | 8 +- drivers/scsi/ufs/ufshcd.h | 27 +- 4 files changed, 525 insertions(+), 181 deletions(-) diff

[PATCH v3 7/8] scsi: ufs-qcom: add debug prints for test bus

2015-08-23 Thread Yaniv Gardi
Adds support for configuring and reading the test bus and debug registers. This change also adds another vops in order to print the debug registers. Signed-off-by: Yaniv Gardi yga...@codeaurora.org --- drivers/scsi/ufs/ufs-qcom.c | 165 +++- drivers/scsi

[PATCH v3 2/8] scsi: ufs-qcom: fix compilation warning if compiled as a module

2015-08-23 Thread Yaniv Gardi
This change fixes a compilation warning that happens if SCSI_UFS_QCOM is compiled as a module. Also this patch fixes an error happens when insmod the module: ufs_qcom: module license 'unspecified' taints kernel. Signed-off-by: Yaniv Gardi yga...@codeaurora.org --- drivers/scsi/ufs/ufs-qcom.c

[PATCH v3 5/8] scsi: ufs: creates wrapper functions for vops

2015-08-23 Thread Yaniv Gardi
In order to simplify the code a set of wrapper functions is created to test and call each of the variant operations. Signed-off-by: Yaniv Gardi yga...@codeaurora.org --- drivers/scsi/ufs/ufs-qcom.c | 1 - drivers/scsi/ufs/ufshcd.c | 104 +--- drivers

[PATCH v3 3/8] scsi: ufs-qcom: update configuration option of SCSI_UFS_QCOM component

2015-08-23 Thread Yaniv Gardi
This change is required in order to be able to build the component as a module. Signed-off-by: Yaniv Gardi yga...@codeaurora.org --- drivers/scsi/ufs/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/Kconfig b/drivers/scsi/ufs/Kconfig index e945383

[PATCH v1 08/15] scsi: ufs: add retries to dme_peer get and set attribute

2015-08-21 Thread Yaniv Gardi
The dme_peer get/set attribute commands are prone to errors, therefore we add three retries for the UIC command sending. Error code returned from ufshcd_send_uic_cmd() is checked, and unless it was successful or the retries have finished, another command will be sent. Signed-off-by: Yaniv Gardi

[PATCH v1 11/15] scsi: ufs: retry failed query flag requests

2015-08-21 Thread Yaniv Gardi
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. Signed-off-by: Yaniv Gardi yga...@codeaurora.org --- drivers/scsi/ufs/ufshcd.c | 63

[PATCH v1 10/15] scsi: ufs: fix error recovery after the hibern8 exit failure

2015-08-21 Thread Yaniv Gardi
from first 2 context listed above. This change fixes the recovery by adding proper error handling mechanism. Signed-off-by: Yaniv Gardi yga...@codeaurora.org --- drivers/scsi/ufs/ufshcd.c | 58 +++ 1 file changed, 53 insertions(+), 5 deletions(-) diff

[PATCH v1 09/15] scsi: ufs: add retries for hibern8 enter

2015-08-21 Thread Yaniv Gardi
is recovered to active state, tries to put the UFS link in hibern8 enter again until retry count expires. Signed-off-by: Yaniv Gardi yga...@codeaurora.org --- drivers/scsi/ufs/ufshcd.c | 26 -- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/ufs

[PATCH v1 00/15] Big fixes, retries, handle a race condition

2015-08-21 Thread Yaniv Gardi
This serie of 15 small patches should be pushed after the series of 8 patches I have uploaded to the upstream a week ago: Fix error message and present UFS variant probe Yaniv Gardi (15): scsi: ufs: clear UTRD, UPIU req and rsp before new transfers scsi: ufs: clear fields UTRD, UPIU req

[PATCH v1 03/15] scsi: ufs: verify command tag validity

2015-08-21 Thread Yaniv Gardi
is done with tag which was set to -1 and so it is invalid. Assert command tag passed from scsi layer is valid. Signed-off-by: Yaniv Gardi yga...@codeaurora.org --- drivers/scsi/ufs/ufshcd.c | 22 +- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/ufs

[PATCH v1 05/15] scsi: ufs: increase fDeviceInit query response timeout

2015-08-21 Thread Yaniv Gardi
have to retry fDeviceInit query requests multiple times and each query request timeout prints one error message. Signed-off-by: Yaniv Gardi yga...@codeaurora.org --- drivers/scsi/ufs/ufshcd.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/ufshcd.c b

[PATCH v1 01/15] scsi: ufs: clear UTRD, UPIU req and rsp before new transfers

2015-08-21 Thread Yaniv Gardi
from each other, we need to clear the whole SCSI command field to prevent sending uninitialized data to the device. The UPIU response doesn't always include the sense data and can differ in size. Hence, the UPIU response should also be cleared before the transfer. Signed-off-by: Yaniv Gardi yga

[PATCH v1 07/15] scsi: ufs: set REQUEST_SENSE command size to 18 bytes

2015-08-21 Thread Yaniv Gardi
According to UFS device specification REQUEST_SENSE command can only report back up to 18 bytes of data. Signed-off-by: Yaniv Gardi yga...@codeaurora.org --- drivers/scsi/ufs/ufshcd.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b

[PATCH v1 06/15] scsi: ufs: avoid exception event handler racing with PM callbacks

2015-08-21 Thread Yaniv Gardi
while PM callbacks are running. Signed-off-by: Yaniv Gardi yga...@codeaurora.org --- drivers/scsi/ufs/ufshcd.c | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index ab48220..f248df2 100644 --- a/drivers/scsi/ufs

[PATCH v1 04/15] scsi: ufs: clear outstanding_request bit in case query timeout

2015-08-21 Thread Yaniv Gardi
When sending a query to the device returns with a timeout error, we clear the corresponding bit in the DOORBELL register but we don't clear the outstanding_request field as we should. This patch fixes this bug. Signed-off-by: Yaniv Gardi yga...@codeaurora.org --- drivers/scsi/ufs/ufshcd.c | 22

[PATCH v1 02/15] scsi: ufs: clear fields UTRD, UPIU req and rsp before new transfers

2015-08-21 Thread Yaniv Gardi
the PRDT table length to zero which should take care of commands which doesn't have any data associated with it. We are also clearing the unused fields in request UPIU for NOP command. Signed-off-by: Yaniv Gardi yga...@codeaurora.org --- drivers/scsi/ufs/ufshcd.c | 8 1 file changed, 8

[PATCH v1 15/15] scsi: ufs: add wrapper for retrying sending query attribute

2015-08-21 Thread Yaniv Gardi
Sometimes queries from the device might return a failure so it is recommended to retry sending the query, before giving up. This change adds a wrapper to retry sending a query attribute, in cases where we need to wait longer, before we continue, or before reporting a failure. Signed-off-by: Yaniv

[PATCH v1 12/15] scsi: ufs: reduce the interrupts for power mode change requests

2015-08-21 Thread Yaniv Gardi
events which is not quite necessary and instead we can just wait for the interrupt of 2nd completion, this should reduce the number of interrupts and could reduce the unnecessary CPU wakeups to handle extra interrupts. Signed-off-by: Yaniv Gardi yga...@codeaurora.org --- drivers/scsi/ufs/ufshcd.c

[PATCH v1 13/15] scsi: ufs: add missing memory barriers

2015-08-21 Thread Yaniv Gardi
of descriptors takes places before ringing the doorbell, similarly to setting up a transfer request. Signed-off-by: Yaniv Gardi yga...@codeaurora.org --- drivers/scsi/ufs/ufshcd.c | 21 +++-- 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b

<    1   2   3   4   >