[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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 v4 1/8] phy: qcom-ufs: fix build error when the component is built as a module

2015-08-30 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

[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

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

2015-08-30 Thread Yaniv Gardi
-by: Yaniv Gardi --- 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 --git a/drivers/scsi

[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 --- drivers/scsi/ufs/ufs-qcom.c | 165 +++- drivers/scsi/ufs/ufs-qcom.h | 37

[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 --- 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..5f45307 100644

[PATCH v4 4/8] add ufshcd_get_variant ufshcd_set_variant

2015-08-30 Thread Yaniv Gardi
Signed-off-by: Yaniv Gardi --- 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-qcom.c index 6c23bbf

[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 --- drivers/scsi/ufs/ufs-qcom.c | 1 - drivers/scsi/ufs/ufshcd.c | 104 +--- drivers/scsi/ufs/ufshcd.h

[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 2/8] scsi: ufs-qcom: fix compilation warning if compiled as a module

2015-08-30 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 --- drivers/scsi/ufs/ufs-qcom.c | 7 +

[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 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 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 2/8] scsi: ufs-qcom: fix compilation warning if compiled as a module

2015-08-30 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 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 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 v2 01/15] scsi: ufs: clear UTRD, UPIU req and rsp before new transfers

2015-08-27 Thread Yaniv Gardi
Signed-off-by: Maya Erez Signed-off-by: Yaniv Gardi --- drivers/scsi/ufs/ufshcd.c | 17 + 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 131c720..3428f72 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers

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

2015-08-27 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 Signed-off-by: Yaniv Gardi --- drivers/scsi/ufs/ufshcd.c | 8 1 file

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

2015-08-27 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 Signed-off-by: Yaniv Gardi --- drivers/scsi/ufs/ufshcd.c | 24 ++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/drivers

[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 Signed-off-by: Yaniv Gardi --- drivers/scsi/ufs/ufshcd.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/scsi

[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 Signed-off-by: Yaniv Gardi --- drivers/scsi/ufs/ufshcd.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/ufs

[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 Signed-off-by: Yaniv Gardi --- drivers/scsi/ufs/ufshcd.c | 26 -- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/drivers/scsi

[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 Signed-off-by: Yaniv Gardi --- drivers/scsi/ufs

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

2015-08-27 Thread Yaniv Gardi
-by: Subhash Jadavani Signed-off-by: Yaniv Gardi --- 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/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -833,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 Signed-off-by: Yaniv Gardi --- drivers/scsi/ufs/ufshcd.c | 63

[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 Signed-off-by: Yaniv Gardi --- drivers/scsi/ufs/ufshcd.c | 21 +++-- 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/ufs

[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 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 Signed-off-by: Yaniv Gardi --- drivers/scsi/ufs/ufshcd.c | 58 +++ 1 file changed, 53 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 --- drivers/scsi/ufs/ufshcd.c | 22

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

2015-08-27 Thread Yaniv Gardi
Signed-off-by: Yaniv Gardi --- 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 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers

[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 Signed-off-by: Yaniv Gardi --- 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 573a8cb..0e54183 100644

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

2015-08-27 Thread Yaniv Gardi
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 command tag validity scsi: ufs: clear outstanding_request bit i

[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 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 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 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 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 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 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 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 00/15] Big fixes, retries, handle a race condition

2015-08-27 Thread Yaniv Gardi
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 command tag validity scsi: ufs: clear outstanding_request bit in case query timeout

[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 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 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 02/15] scsi: ufs: clear fields UTRD, UPIU req and rsp before new transfers

2015-08-27 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...@codeaurora.org

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

2015-08-27 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/ufs/ufshcd.c index

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

2015-08-27 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 changed, 22 insertions

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

2015-08-23 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

[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 --- drivers/scsi/ufs/ufs-qcom.c | 7 +

[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 --- drivers/scsi/ufs/ufs-qcom.c | 1 - drivers/scsi/ufs/ufshcd.c | 104 +--- drivers/scsi/ufs/ufshcd.h

[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 --- 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..5f45307 100644

[PATCH v3 4/8] add ufshcd_get_variant ufshcd_set_variant

2015-08-23 Thread Yaniv Gardi
Signed-off-by: Yaniv Gardi --- 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-qcom.c index 6c23bbf

[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

[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 --- drivers/scsi/ufs/ufs-qcom.c | 165 +++- drivers/scsi/ufs/ufs-qcom.h | 37

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

2015-08-23 Thread Yaniv Gardi
-by: Yaniv Gardi --- 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 --git a/drivers/scsi

[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 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 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 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 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 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 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 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 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 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 --- drivers/scsi/ufs/ufshcd.c | 8 1 file changed, 8 insertions(+) diff

[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

[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 --- drivers/scsi/ufs/ufshcd.c | 22

[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 --- drivers/scsi/ufs/ufshcd.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs

<    1   2   3   4   5   6   7   8   9   >