[PATCH 1/5] mmc: core: Add support to read command queue parameters

2014-12-02 Thread Sujit Reddy Thumma
eMMC cards with EXT_CSD version = 7, optionally support command queuing feature as defined by Jedec eMMC5.1. Add support for probing command queue feature for such type of cards. Signed-off-by: Sujit Reddy Thumma sthu...@codeaurora.org Signed-off-by: Asutosh Das asuto...@codeaurora.org

[RESEND PATCH V7 5/6] scsi: ufs: Fix device and host reset methods

2014-05-25 Thread Sujit Reddy Thumma
the device and host and re-initializing them in proper manner. Signed-off-by: Sujit Reddy Thumma sthu...@codeaurora.org Reviewed-by: Yaniv Gardi yga...@codeaurora.org Tested-by: Dolev Raviv dra...@codeaurora.org Acked-by: Vinayak Holikatti vinholika...@gmail.com --- drivers/scsi/ufs/ufshcd.c | 240

[RESEND PATCH V7 4/6] scsi: ufs: Fix hardware race conditions while aborting a command

2014-05-25 Thread Sujit Reddy Thumma
-existent in both controller and the device. Signed-off-by: Sujit Reddy Thumma sthu...@codeaurora.org Reviewed-by: Yaniv Gardi yga...@codeaurora.org Tested-by: Dolev Raviv dra...@codeaurora.org Acked-by: Vinayak Holikatti vinholika...@gmail.com --- drivers/scsi/ufs/ufshcd.c | 70

[RESEND PATCH V7 3/6] scsi: ufs: Fix broken task management command implementation

2014-05-25 Thread Sujit Reddy Thumma
set. Signed-off-by: Sujit Reddy Thumma sthu...@codeaurora.org Reviewed-by: Yaniv Gardi yga...@codeaurora.org Tested-by: Dolev Raviv dra...@codeaurora.org Acked-by: Vinayak Holikatti vinholika...@gmail.com --- drivers/scsi/ufs/ufshcd.c | 169

[RESEND PATCH V7 1/6] scsi: ufs: fix endianness sparse warnings

2014-05-25 Thread Sujit Reddy Thumma
Fix many warnings with incorrect endian assumptions which makes the code unportable to new architectures. The UFS specification defines the byte order as big-endian for UPIU structure and little-endian for the host controller transfer/task management descriptors. Signed-off-by: Sujit Reddy

[RESEND PATCH V7 0/6] scsi: ufs: TM, fatal-error handling and other fixes

2014-05-25 Thread Sujit Reddy Thumma
and rebase - [PATCH V2 4/4]: Fix a bug - sleeping in atomic context Sujit Reddy Thumma (6): scsi: ufs: fix endianness sparse warnings scsi: ufs: make undeclared functions static scsi: ufs: Fix broken task management command implementation scsi: ufs: Fix hardware race conditions while

Re: [PATCH V7 1/6] scsi: ufs: fix endianness sparse warnings

2014-05-25 Thread Sujit Reddy Thumma
On 11/18/2013 2:34 PM, vinayak holikatti wrote: On Mon, Sep 23, 2013 at 5:44 PM, vinayak holikatti vinholika...@gmail.com wrote: On Thu, Sep 19, 2013 at 4:44 PM, Sujit Reddy Thumma sthu...@codeaurora.org wrote: Fix many warnings with incorrect endian assumptions which makes the code

[PATCH V7 1/6] scsi: ufs: fix endianness sparse warnings

2013-09-19 Thread Sujit Reddy Thumma
Fix many warnings with incorrect endian assumptions which makes the code unportable to new architectures. The UFS specification defines the byte order as big-endian for UPIU structure and little-endian for the host controller transfer/task management descriptors. Signed-off-by: Sujit Reddy

[PATCH V7 2/6] scsi: ufs: make undeclared functions static

2013-09-19 Thread Sujit Reddy Thumma
Make undeclared functions static and declare exported symbols to suppress warnings from sparse tool. Signed-off-by: Sujit Reddy Thumma sthu...@codeaurora.org --- drivers/scsi/ufs/ufshcd.c | 4 ++-- drivers/scsi/ufs/ufshcd.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git

[PATCH V7 3/6] scsi: ufs: Fix broken task management command implementation

2013-09-19 Thread Sujit Reddy Thumma
set. Signed-off-by: Sujit Reddy Thumma sthu...@codeaurora.org Reviewed-by: Yaniv Gardi yga...@codeaurora.org Tested-by: Dolev Raviv dra...@codeaurora.org --- drivers/scsi/ufs/ufshcd.c | 169 +++--- drivers/scsi/ufs/ufshcd.h | 8 ++- 2 files changed

[PATCH V7 5/6] scsi: ufs: Fix device and host reset methods

2013-09-19 Thread Sujit Reddy Thumma
the device and host and re-initializing them in proper manner. Signed-off-by: Sujit Reddy Thumma sthu...@codeaurora.org Reviewed-by: Yaniv Gardi yga...@codeaurora.org Tested-by: Dolev Raviv dra...@codeaurora.org --- drivers/scsi/ufs/ufshcd.c | 240

[PATCH V7 6/6] scsi: ufs: Improve UFS fatal error handling

2013-09-19 Thread Sujit Reddy Thumma
in a separate error handling work. o SCSI is informed about the expected Unit-Attention exception from the device for the immediate command after a reset so that the SCSI layer take necessary steps to establish communication with the device. Signed-off-by: Sujit Reddy Thumma sthu...@codeaurora.org

[PATCH V7 4/6] scsi: ufs: Fix hardware race conditions while aborting a command

2013-09-19 Thread Sujit Reddy Thumma
-existent in both controller and the device. Signed-off-by: Sujit Reddy Thumma sthu...@codeaurora.org Reviewed-by: Yaniv Gardi yga...@codeaurora.org Tested-by: Dolev Raviv dra...@codeaurora.org --- drivers/scsi/ufs/ufshcd.c | 70 +-- 1 file changed, 55

[PATCH V2 1/3] scsi: ufs: Allow vendor specific initialization

2013-08-26 Thread Sujit Reddy Thumma
be extended in future, for example, for power mode transitions. The operations are vendor/board specific and hence determined with the help of compatible property in device tree. Signed-off-by: Sujit Reddy Thumma sthu...@codeaurora.org --- drivers/scsi/ufs/ufshcd-pci.c| 8 +- drivers/scsi

[PATCH V2 0/3] scsi: ufs: Add support for clock and regulator initializaiton

2013-08-26 Thread Sujit Reddy Thumma
on scsi-misc. - Minor code fixes. Sujit Reddy Thumma (3): scsi: ufs: Allow vendor specific initialization scsi: ufs: Add regulator enable support scsi: ufs: Add clock initialization support .../devicetree/bindings/ufs/ufshcd-pltfrm.txt | 37 ++ drivers/scsi/ufs/ufs.h

[PATCH V2 3/3] scsi: ufs: Add clock initialization support

2013-08-26 Thread Sujit Reddy Thumma
Add generic clock initialization support for UFSHCD platform driver. The clock info is read from device tree using standard clock bindings. A generic max-clock-frequency-hz property is defined to save information on maximum operating clock frequency the h/w supports. Signed-off-by: Sujit Reddy

[PATCH V2 2/3] scsi: ufs: Add regulator enable support

2013-08-26 Thread Sujit Reddy Thumma
or VCCQ2 are optional as they can be generated using internal LDO inside the UFS device. Add DT bindings for voltage regulators that can be controlled from host driver. Signed-off-by: Sujit Reddy Thumma sthu...@codeaurora.org --- .../devicetree/bindings/ufs/ufshcd-pltfrm.txt | 24 +++ drivers

[PATCH V6 1/4] scsi: ufs: Fix broken task management command implementation

2013-08-14 Thread Sujit Reddy Thumma
set. Signed-off-by: Sujit Reddy Thumma sthu...@codeaurora.org Reviewed-by: Yaniv Gardi yga...@codeaurora.org Tested-by: Dolev Raviv dra...@codeaurora.org --- drivers/scsi/ufs/ufshcd.c | 173 ++--- drivers/scsi/ufs/ufshcd.h |8 ++- 2 files changed

[PATCH V6 0/4] scsi: ufs: Improve UFS error handling

2013-08-14 Thread Sujit Reddy Thumma
. - [PATCH V2 3/4]: Minor cleanup and rebase - [PATCH V2 4/4]: Fix a bug - sleeping in atomic context Sujit Reddy Thumma (4): scsi: ufs: Fix broken task management command implementation scsi: ufs: Fix hardware race conditions while aborting a command scsi: ufs: Fix device and host reset

[PATCH V6 3/4] scsi: ufs: Fix device and host reset methods

2013-08-14 Thread Sujit Reddy Thumma
the device and host and re-initializing them in proper manner. Signed-off-by: Sujit Reddy Thumma sthu...@codeaurora.org Reviewed-by: Yaniv Gardi yga...@codeaurora.org Tested-by: Dolev Raviv dra...@codeaurora.org --- drivers/scsi/ufs/ufshcd.c | 240

[PATCH V6 2/4] scsi: ufs: Fix hardware race conditions while aborting a command

2013-08-14 Thread Sujit Reddy Thumma
-existent in both controller and the device. Signed-off-by: Sujit Reddy Thumma sthu...@codeaurora.org Reviewed-by: Yaniv Gardi yga...@codeaurora.org Tested-by: Dolev Raviv dra...@codeaurora.org --- drivers/scsi/ufs/ufshcd.c | 70 +++- 1 files changed, 55

[PATCH 0/3] scsi: ufs: Add support for clock and regulator initializaiton

2013-08-13 Thread Sujit Reddy Thumma
controller. In addition, the vendor specific operations can also be used to control the power supply of controller and Uni-Pro h/w blocks. This patchset adds support for vendor specific initialization, regulator and clock initialization based on device-tree properties. Sujit Reddy Thumma (3): scsi

[PATCH 2/3] scsi: ufs: Add regulator enable support

2013-08-13 Thread Sujit Reddy Thumma
or VCCQ2 are optional as they can be generated using internal LDO inside the UFS device. Add DT bindings for voltage regulators that can be controlled from host driver. Signed-off-by: Sujit Reddy Thumma sthu...@codeaurora.org --- .../devicetree/bindings/ufs/ufshcd-pltfrm.txt | 18 ++ drivers

[PATCH 1/3] scsi: ufs: Allow vendor specific initialization

2013-08-13 Thread Sujit Reddy Thumma
be extended in future, for example, for power mode transitions. The operations are vendor/board specific and hence determined with the help of compatible property in device tree. Signed-off-by: Sujit Reddy Thumma sthu...@codeaurora.org --- drivers/scsi/ufs/ufshcd-pci.c|8 ++- drivers

[PATCH 3/3] scsi: ufs: Add clock initialization support

2013-08-13 Thread Sujit Reddy Thumma
Add generic clock initialization support for UFSHCD platform driver. The clock info is read from device tree using standard clock bindings. A generic max-clock-frequency-hz property is defined to save information on maximum operating clock frequency the h/w supports. Signed-off-by: Sujit Reddy

Re: [PATCH 1/3] scsi: ufs: Allow vendor specific initialization

2013-08-13 Thread Sujit Reddy Thumma
On 8/13/2013 7:23 PM, Josh Cartwright wrote: On Tue, Aug 13, 2013 at 04:30:18PM +0530, Sujit Reddy Thumma wrote: [..] diff --git a/drivers/scsi/ufs/ufshcd-pci.c b/drivers/scsi/ufs/ufshcd-pci.c index a823cf4..829f7a4 100644 --- a/drivers/scsi/ufs/ufshcd-pci.c +++ b/drivers/scsi/ufs/ufshcd-pci.c

Re: [PATCH V3 4/4] scsi: ufs: Improve UFS fatal error handling

2013-07-29 Thread Sujit Reddy Thumma
On 7/24/2013 7:09 PM, Seungwon Jeon wrote: On Wed, July 24, 2013, Sujit Reddy Thumma wrote: On 7/23/2013 2:04 PM, Seungwon Jeon wrote: On Sat, July 20, 2013, Sujit Reddy Thumma wrote: On 7/19/2013 7:28 PM, Seungwon Jeon wrote: On Tue, July 09, 2013, Sujit Reddy Thumma wrote: Error handling

Re: [PATCH V3 3/4] scsi: ufs: Fix device and host reset methods

2013-07-29 Thread Sujit Reddy Thumma
On 7/24/2013 7:09 PM, Seungwon Jeon wrote: On Wed, July 24, 2013, Sujit Reddy Thumma wrote: On 7/23/2013 1:57 PM, Seungwon Jeon wrote: On Sat, July 20, 2013, Sujit Reddy Thumma wrote: On 7/19/2013 7:27 PM, Seungwon Jeon wrote: On Tue, July 09, 2013, Sujit Reddy Thumma wrote: As of now SCSI

[PATCH V5 1/4] scsi: ufs: Fix broken task management command implementation

2013-07-29 Thread Sujit Reddy Thumma
set. Signed-off-by: Sujit Reddy Thumma sthu...@codeaurora.org --- drivers/scsi/ufs/ufshcd.c | 173 ++--- drivers/scsi/ufs/ufshcd.h |8 ++- 2 files changed, 122 insertions(+), 59 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi

[PATCH V5 3/4] scsi: ufs: Fix device and host reset methods

2013-07-29 Thread Sujit Reddy Thumma
the device and host and re-initializing them in proper manner. Signed-off-by: Sujit Reddy Thumma sthu...@codeaurora.org --- drivers/scsi/ufs/ufshcd.c | 240 +++-- drivers/scsi/ufs/ufshcd.h |2 + 2 files changed, 189 insertions(+), 53 deletions(-) diff

[PATCH V5 0/4] scsi: ufs: Improve UFS error handling

2013-07-29 Thread Sujit Reddy Thumma
]: Commit text update to clarify the hardware race with more details. - [PATCH V2 3/4]: Minor cleanup and rebase - [PATCH V2 4/4]: Fix a bug - sleeping in atomic context Sujit Reddy Thumma (4): scsi: ufs: Fix broken task management command implementation scsi: ufs: Fix

[PATCH V4 2/2] scsi: ufs: Set fDeviceInit flag to initiate device initialization

2013-07-23 Thread Sujit Reddy Thumma
specification for device initialization completion. Signed-off-by: Dolev Raviv dra...@codeaurora.org Signed-off-by: Sujit Reddy Thumma sthu...@codeaurora.org --- drivers/scsi/ufs/ufs.h| 96 +-- drivers/scsi/ufs/ufshcd.c | 238

[PATCH V4 0/2] Add suport for internal request (NOP and Query Request)

2013-07-23 Thread Sujit Reddy Thumma
of reserving tag[MAX_QUEUE - 1]. - Changed the internal_cmd naming to dev_cmd to avoid confusion with other type of internal commands other than NOP and QUERY. Dolev Raviv (1): scsi: ufs: Set fDeviceInit flag to initiate device initialization Sujit Reddy Thumma (1

[PATCH V4 1/2] scsi: ufs: Add support for host assisted background operations

2013-07-23 Thread Sujit Reddy Thumma
and due to continuous data transfers the runtime suspend is not triggered, the BKOPS is enabled when the device raises a level-2 exception (outstanding operations - performance impact). Signed-off-by: Sujit Reddy Thumma sthu...@codeaurora.org --- drivers/scsi/ufs/ufs.h| 23 +++ drivers/scsi/ufs

[PATCH V4 1/2] scsi: ufs: Add support for sending NOP OUT UPIU

2013-07-23 Thread Sujit Reddy Thumma
in order to requeue the request. To avoid frequent collisions between internal commands and scsi commands the device management command tag is allocated in the opposite direction w.r.t block layer tag allocation. Signed-off-by: Sujit Reddy Thumma sthu...@codeaurora.org Signed-off-by: Dolev Raviv dra

[PATCH V4 0/2] scsi: ufs: Add support to control UFS device background operations

2013-07-23 Thread Sujit Reddy Thumma
- Forced enable of auto bkops during initialization to make sure device and driver state are matched. Sujit Reddy Thumma (2): scsi: ufs: Add support for host assisted background operations scsi: ufs: Add runtime PM support for UFS host controller driver drivers/scsi/ufs/ufs.h

[PATCH V4 2/2] scsi: ufs: Add runtime PM support for UFS host controller driver

2013-07-23 Thread Sujit Reddy Thumma
Add runtime PM helpers to suspend/resume UFS controller at runtime. Enable runtime PM by default for pci and platform drivers as the initialized hardware can suspend if it is not used after bootup. Signed-off-by: Sujit Reddy Thumma sthu...@codeaurora.org --- drivers/scsi/ufs/ufshcd-pci.c

[PATCH V4 3/4] scsi: ufs: Fix device and host reset methods

2013-07-23 Thread Sujit Reddy Thumma
the device and host and re-initializing them in proper manner. Signed-off-by: Sujit Reddy Thumma sthu...@codeaurora.org --- drivers/scsi/ufs/ufshcd.c | 437 +++-- drivers/scsi/ufs/ufshcd.h |2 + 2 files changed, 381 insertions(+), 58 deletions(-) diff

[PATCH V4 2/4] scsi: ufs: Fix hardware race conditions while aborting a command

2013-07-23 Thread Sujit Reddy Thumma
-existent in both controller and the device. Signed-off-by: Sujit Reddy Thumma sthu...@codeaurora.org --- drivers/scsi/ufs/ufshcd.c | 70 +++- 1 files changed, 55 insertions(+), 15 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs

[PATCH V4 0/4] scsi: ufs: Improve UFS error handling

2013-07-23 Thread Sujit Reddy Thumma
- sleeping in atomic context Sujit Reddy Thumma (4): scsi: ufs: Fix broken task management command implementation scsi: ufs: Fix hardware race conditions while aborting a command scsi: ufs: Fix device and host reset methods scsi: ufs: Improve UFS fatal error handling drivers/scsi/ufs/ufshcd.c

[PATCH V4 1/4] scsi: ufs: Fix broken task management command implementation

2013-07-23 Thread Sujit Reddy Thumma
set. Signed-off-by: Sujit Reddy Thumma sthu...@codeaurora.org --- drivers/scsi/ufs/ufshcd.c | 174 ++--- drivers/scsi/ufs/ufshcd.h |8 ++- 2 files changed, 123 insertions(+), 59 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi

[PATCH V4 4/4] scsi: ufs: Improve UFS fatal error handling

2013-07-23 Thread Sujit Reddy Thumma
is informed about the expected Unit-Attention exception from the device for the immediate command after a reset so that the SCSI layer take necessary steps to establish communication with the device. Signed-off-by: Sujit Reddy Thumma sthu...@codeaurora.org --- drivers/scsi/ufs/ufshcd.c | 350

Re: [PATCH V3 3/4] scsi: ufs: Fix device and host reset methods

2013-07-23 Thread Sujit Reddy Thumma
On 7/23/2013 1:57 PM, Seungwon Jeon wrote: On Sat, July 20, 2013, Sujit Reddy Thumma wrote: On 7/19/2013 7:27 PM, Seungwon Jeon wrote: On Tue, July 09, 2013, Sujit Reddy Thumma wrote: As of now SCSI initiated error handling is broken because, the reset APIs don't try to bring back the device

Re: [PATCH V3 1/4] scsi: ufs: Fix broken task management command implementation

2013-07-23 Thread Sujit Reddy Thumma
On 7/23/2013 1:54 PM, Seungwon Jeon wrote: On Sat, July 20, 2013, Sujit Reddy Thumma wrote: On 7/19/2013 7:26 PM, Seungwon Jeon wrote: On Tue, July 09, 2013 Sujit Reddy Thumma wrote: Currently, sending Task Management (TM) command to the card might be broken in some scenarios as listed below

Re: [PATCH V3 4/4] scsi: ufs: Improve UFS fatal error handling

2013-07-23 Thread Sujit Reddy Thumma
On 7/23/2013 2:04 PM, Seungwon Jeon wrote: On Sat, July 20, 2013, Sujit Reddy Thumma wrote: On 7/19/2013 7:28 PM, Seungwon Jeon wrote: On Tue, July 09, 2013, Sujit Reddy Thumma wrote: Error handling in UFS driver is broken and resets the host controller for fatal errors without re

Re: [PATCH V3 1/2] scsi: ufs: Add support for sending NOP OUT UPIU

2013-07-19 Thread Sujit Reddy Thumma
On 7/19/2013 7:17 PM, Seungwon Jeon wrote: On Thu, July 18, 2013, Sujit Reddy Thumma wrote: + * ufshcd_wait_for_register - wait for register value to change + * @hba - per-adapter interface + * @reg - mmio register offset + * @mask - mask to apply to read register value + * @val - wait

Re: [PATCH V3 2/4] scsi: ufs: Fix hardware race conditions while aborting a command

2013-07-19 Thread Sujit Reddy Thumma
On 7/19/2013 7:26 PM, Seungwon Jeon wrote: On Tue, July 09, 2013, Sujit Reddy Thumma wrote: There is a possible race condition in the hardware when the abort command is issued to terminate the ongoing SCSI command as described below: - A bit in the door-bell register is set in the controller

Re: [PATCH V3 1/4] scsi: ufs: Fix broken task management command implementation

2013-07-19 Thread Sujit Reddy Thumma
On 7/19/2013 7:26 PM, Seungwon Jeon wrote: On Tue, July 09, 2013 Sujit Reddy Thumma wrote: Currently, sending Task Management (TM) command to the card might be broken in some scenarios as listed below: Problem: If there are more than 8 TM commands the implementation returns error

Re: [PATCH V3 4/4] scsi: ufs: Improve UFS fatal error handling

2013-07-19 Thread Sujit Reddy Thumma
On 7/19/2013 7:28 PM, Seungwon Jeon wrote: On Tue, July 09, 2013, Sujit Reddy Thumma wrote: Error handling in UFS driver is broken and resets the host controller for fatal errors without re-initialization. Correct the fatal error handling sequence according to UFS Host Controller Interface

Re: [PATCH V3 3/4] scsi: ufs: Fix device and host reset methods

2013-07-19 Thread Sujit Reddy Thumma
On 7/19/2013 7:27 PM, Seungwon Jeon wrote: On Tue, July 09, 2013, Sujit Reddy Thumma wrote: As of now SCSI initiated error handling is broken because, the reset APIs don't try to bring back the device initialized and ready for further transfers. In case of timeouts, the scsi error handler

Re: [PATCH V3 1/2] scsi: ufs: Add support for host assisted background operations

2013-07-19 Thread Sujit Reddy Thumma
I'm not sure that BKOPS with runtime-pm associates. Do you think it's helpful for power management? How about hibernation scheme for runtime-pm? I'm testing and I can introduce soon. Well, I am thinking on following approach when we introduce power management. ufshcd_runtime_suspend() {

Re: [PATCH V3 1/2] scsi: ufs: Add support for host assisted background operations

2013-07-17 Thread Sujit Reddy Thumma
I'm not sure that BKOPS with runtime-pm associates. Do you think it's helpful for power management? How about hibernation scheme for runtime-pm? I'm testing and I can introduce soon. Well, I am thinking on following approach when we introduce power management. ufshcd_runtime_suspend() {

Re: [PATCH V3 1/2] scsi: ufs: Add support for sending NOP OUT UPIU

2013-07-17 Thread Sujit Reddy Thumma
+ * ufshcd_wait_for_register - wait for register value to change + * @hba - per-adapter interface + * @reg - mmio register offset + * @mask - mask to apply to read register value + * @val - wait condition + * @interval_us - polling interval in microsecs + * @timeout_ms - timeout in millisecs +

Re: [PATCH V3 1/2] scsi: ufs: Add support for sending NOP OUT UPIU

2013-07-11 Thread Sujit Reddy Thumma
On 7/10/2013 6:58 PM, Seungwon Jeon wrote: On Tue, July 09, 2013, Sujit Reddy Thumma wrote: As part of device initialization sequence, sending NOP OUT UPIU and waiting for NOP IN UPIU response is mandatory. This confirms that the device UFS Transport (UTP) layer is functional and the host can

Re: [PATCH V3 1/2] scsi: ufs: Add support for host assisted background operations

2013-07-11 Thread Sujit Reddy Thumma
(); /* Link and the device for more savings */ } } Let me know if this is okay. On Tue, July 09, 2013, Sujit Reddy Thumma wrote: Background operations in the UFS device can be disabled by the host to reduce the response latency of transfer requests. Add support for enabling/disabling

Re: [PATCH V3 2/2] scsi: ufs: Add runtime PM support for UFS host controller driver

2013-07-11 Thread Sujit Reddy Thumma
On 7/10/2013 7:01 PM, Seungwon Jeon wrote: On Tue, July 09, 2013, Sujit Reddy Thumma wrote: Add runtime PM helpers to suspend/resume UFS controller at runtime. Enable runtime PM by default for pci and platform drivers as the initialized hardware can suspend if it is not used after bootup

[PATCH V3 0/2] Add suport for internal request (NOP and Query Request)

2013-07-09 Thread Sujit Reddy Thumma
[MAX_QUEUE - 1]. - Changed the internal_cmd naming to dev_cmd to avoid confusion with other type of internal commands other than NOP and QUERY. Dolev Raviv (1): scsi: ufs: Set fDeviceInit flag to initiate device initialization Sujit Reddy Thumma (1): scsi: ufs: Add support

[PATCH V3 1/2] scsi: ufs: Add support for sending NOP OUT UPIU

2013-07-09 Thread Sujit Reddy Thumma
in order to requeue the request. To avoid frequent collisions between internal commands and scsi commands the device management command tag is allocated in the opposite direction w.r.t block layer tag allocation. Signed-off-by: Sujit Reddy Thumma sthu...@codeaurora.org Signed-off-by: Dolev Raviv dra

[PATCH V3 2/2] scsi: ufs: Set fDeviceInit flag to initiate device initialization

2013-07-09 Thread Sujit Reddy Thumma
specification for device initialization completion. Signed-off-by: Dolev Raviv dra...@codeaurora.org Signed-off-by: Sujit Reddy Thumma sthu...@codeaurora.org --- drivers/scsi/ufs/ufs.h| 88 +- drivers/scsi/ufs/ufshcd.c | 292 - drivers

[PATCH V3 2/4] scsi: ufs: Fix hardware race conditions while aborting a command

2013-07-09 Thread Sujit Reddy Thumma
-existent in both controller and the device. Signed-off-by: Sujit Reddy Thumma sthu...@codeaurora.org --- drivers/scsi/ufs/ufshcd.c | 70 +++- 1 files changed, 55 insertions(+), 15 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs

[PATCH V3 1/2] scsi: ufs: Add support for host assisted background operations

2013-07-09 Thread Sujit Reddy Thumma
and due to continuous data transfers the runtime suspend is not triggered, the BKOPS is enabled when the device raises a level-2 exception (outstanding operations - performance impact). Signed-off-by: Sujit Reddy Thumma sthu...@codeaurora.org --- drivers/scsi/ufs/ufs.h| 25 - drivers/scsi

[PATCH V3 0/4] scsi: ufs: Improve UFS error handling

2013-07-09 Thread Sujit Reddy Thumma
tm_slots_in_use will track which slots are in use by the driver. - [PATCH V2 2/4]: Commit text update to clarify the hardware race with more details. - [PATCH V2 3/4]: Minor cleanup and rebase - [PATCH V2 4/4]: Fix a bug - sleeping in atomic context Sujit Reddy

[PATCH V3 3/4] scsi: ufs: Fix device and host reset methods

2013-07-09 Thread Sujit Reddy Thumma
the device and host and re-initializing them in proper manner. Signed-off-by: Sujit Reddy Thumma sthu...@codeaurora.org --- drivers/scsi/ufs/ufshcd.c | 467 +++-- drivers/scsi/ufs/ufshcd.h |2 + 2 files changed, 411 insertions(+), 58 deletions(-) diff

[PATCH V3 1/4] scsi: ufs: Fix broken task management command implementation

2013-07-09 Thread Sujit Reddy Thumma
set. Signed-off-by: Sujit Reddy Thumma sthu...@codeaurora.org --- drivers/scsi/ufs/ufshcd.c | 177 ++--- drivers/scsi/ufs/ufshcd.h |8 ++- 2 files changed, 126 insertions(+), 59 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi

[PATCH V3 2/2] scsi: ufs: Add runtime PM support for UFS host controller driver

2013-07-09 Thread Sujit Reddy Thumma
Add runtime PM helpers to suspend/resume UFS controller at runtime. Enable runtime PM by default for pci and platform drivers as the initialized hardware can suspend if it is not used after bootup. Signed-off-by: Sujit Reddy Thumma sthu...@codeaurora.org --- drivers/scsi/ufs/ufshcd-pci.c

[PATCH V3 4/4] scsi: ufs: Improve UFS fatal error handling

2013-07-09 Thread Sujit Reddy Thumma
is informed about the expected Unit-Attentioni exception from the device for the immediate command after a reset so that the SCSI layer take necessary steps to establish communication with the device. Signed-off-by: Sujit Reddy Thumma sthu...@codeaurora.org --- drivers/scsi/ufs/ufshcd.c | 349

Re: [PATCH V2 4/4] scsi: ufs: Improve UFS fatal error handling

2013-07-04 Thread Sujit Reddy Thumma
On 7/3/2013 10:22 PM, Santosh Y wrote: + +/** + * ufshcd_fatal_err_handler - handle fatal errors + * @work: pointer to work structure */ static void ufshcd_fatal_err_handler(struct work_struct *work) { struct ufs_hba *hba; + unsigned long flags; + u32 err_xfer = 0; +

Re: [PATCH 1/4] scsi: ufs: Fix broken task management command implementation

2013-07-03 Thread Sujit Reddy Thumma
On 7/2/2013 9:21 PM, Santosh Y wrote: On Fri, Jun 28, 2013 at 5:02 PM, Sujit Reddy Thumma sthu...@codeaurora.org wrote: On 6/27/2013 4:49 PM, Santosh Y wrote: + spin_lock_irqsave(host-host_lock, flags); task_req_descp = hba-utmrdl_base_addr; task_req_descp

Re: [PATCH 1/4] scsi: ufs: Fix broken task management command implementation

2013-07-03 Thread Sujit Reddy Thumma
On 7/3/2013 9:53 PM, Santosh Y wrote: On Wed, Jul 3, 2013 at 9:22 PM, Sujit Reddy Thumma sthu...@codeaurora.org wrote: On 7/2/2013 9:21 PM, Santosh Y wrote: On Fri, Jun 28, 2013 at 5:02 PM, Sujit Reddy Thumma sthu...@codeaurora.org wrote: On 6/27/2013 4:49 PM, Santosh Y wrote

Re: [PATCH V2 3/4] scsi: ufs: Fix device and host reset methods

2013-07-03 Thread Sujit Reddy Thumma
On 7/3/2013 11:19 AM, Santosh Y wrote: + +/** + * ufshcd_eh_device_reset_handler - device reset handler registered to + *scsi layer. + * @cmd - SCSI command pointer + * + * Returns SUCCESS/FAILED + */ +static int ufshcd_eh_device_reset_handler(struct scsi_cmnd

Re: [PATCH] block: Fix possible sleep in invalid context

2013-07-01 Thread Sujit Reddy Thumma
On 7/2/2013 8:34 AM, Aaron Lu wrote: Fix this by releasing spin_lock_irq() before calling pm_runtime_autosuspend() in blk_post_runtime_resume(). Hi Sujit, Thanks for testing out block layer runtime PM! As for the problem here, it is already fixed by: commit

Re: [PATCH 1/4] scsi: ufs: Fix broken task management command implementation

2013-06-28 Thread Sujit Reddy Thumma
On 6/27/2013 4:49 PM, Santosh Y wrote: + spin_lock_irqsave(host-host_lock, flags); task_req_descp = hba-utmrdl_base_addr; task_req_descp += free_slot; @@ -2353,38 +2387,39 @@ ufshcd_issue_tm_cmd(struct ufs_hba *hba, (struct utp_upiu_task_req *)

Re: [PATCH 1/2] scsi: ufs: Add support for host assisted background operations

2013-06-28 Thread Sujit Reddy Thumma
On 6/26/2013 11:06 PM, Santosh Y wrote: +/** * ufshcd_memory_alloc - allocate memory for host memory space data structures * @hba: per adapter instance * @@ -1803,6 +1904,9 @@ ufshcd_transfer_rsp_status(struct ufs_hba *hba, struct ufshcd_lrb *lrbp) */

[PATCH V2 2/2] scsi: ufs: Add runtime PM helpers for UFS host driver

2013-06-28 Thread Sujit Reddy Thumma
Add runtime PM helpers to suspend/resume the UFS controller device at runtime. Signed-off-by: Sujit Reddy Thumma sthu...@codeaurora.org --- drivers/scsi/ufs/ufshcd-pci.c| 60 ++ drivers/scsi/ufs/ufshcd-pltfrm.c | 41 ++ 2 files

[PATCH V2 0/4] scsi: ufs: Improve UFS error handling

2013-06-28 Thread Sujit Reddy Thumma
- sleeping in atomic context Sujit Reddy Thumma (4): scsi: ufs: Fix broken task management command implementation scsi: ufs: Fix hardware race conditions while aborting a command scsi: ufs: Fix device and host reset methods scsi: ufs: Improve UFS fatal error handling drivers/scsi/ufs/ufshcd.c

[PATCH V2 3/4] scsi: ufs: Fix device and host reset methods

2013-06-28 Thread Sujit Reddy Thumma
the device and host and re-initializing them in proper manner. Signed-off-by: Sujit Reddy Thumma sthu...@codeaurora.org --- drivers/scsi/ufs/ufshcd.c | 446 +++-- drivers/scsi/ufs/ufshcd.h |2 + 2 files changed, 393 insertions(+), 55 deletions(-) diff

[PATCH V2 2/4] scsi: ufs: Fix hardware race conditions while aborting a command

2013-06-28 Thread Sujit Reddy Thumma
-existent in both controller and the device. Signed-off-by: Sujit Reddy Thumma sthu...@codeaurora.org --- drivers/scsi/ufs/ufshcd.c | 70 +++- 1 files changed, 55 insertions(+), 15 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs

[PATCH V2 4/4] scsi: ufs: Improve UFS fatal error handling

2013-06-28 Thread Sujit Reddy Thumma
is informed about the expected Unit-Attentioni exception from the device for the immediate command after a reset so that the SCSI layer take necessary steps to establish communication with the device. Signed-off-by: Sujit Reddy Thumma sthu...@codeaurora.org --- drivers/scsi/ufs/ufshcd.c | 357

[PATCH V2 1/4] scsi: ufs: Fix broken task management command implementation

2013-06-28 Thread Sujit Reddy Thumma
-by: Sujit Reddy Thumma sthu...@codeaurora.org --- drivers/scsi/ufs/ufshcd.c | 175 ++--- drivers/scsi/ufs/ufshcd.h |8 ++- 2 files changed, 124 insertions(+), 59 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index

Re: [PATCH 1/2] scsi: ufs: Add support for sending NOP OUT UPIU

2013-06-14 Thread Sujit Reddy Thumma
On 6/13/2013 10:03 AM, Sujit Reddy Thumma wrote: static struct scsi_host_template ufshcd_driver_template = { @@ -1771,8 +2064,8 @@ int ufshcd_init(struct device *dev, struct ufs_hba **hba_handle, /* Configure LRB */ ufshcd_host_memory_configure(hba); - host-can_queue

[PATCH 1/2] scsi: ufs: Add support for host assisted background operations

2013-06-13 Thread Sujit Reddy Thumma
and due to continuous data transfers the runtime suspend is not triggered, the BKOPS is enabled when the device raises a level-2 exception (outstanding operations - performance impact). Change-Id: I8853c528af3bec2adaf49923d21cabca32b99142 Signed-off-by: Sujit Reddy Thumma sthu...@codeaurora.org

[PATCH 2/2] scsi: ufs: Add runtime PM helpers for UFS host driver

2013-06-13 Thread Sujit Reddy Thumma
Add runtime PM helpers to suspend/resume the UFS controller device at runtime. Change-Id: I70b8f7ab9c5a806234701a5eb7735910ee6d052e Signed-off-by: Sujit Reddy Thumma sthu...@codeaurora.org --- drivers/scsi/ufs/ufshcd-pci.c| 60 ++ drivers/scsi/ufs/ufshcd

[PATCH 0/2] scsi: ufs: Add support to control UFS device background operations

2013-06-13 Thread Sujit Reddy Thumma
to initiate device initialization Sujit Reddy Thumma (2): scsi: ufs: Add support for host assisted background operations scsi: ufs: Add runtime PM helpers for UFS host driver drivers/scsi/ufs/ufs.h | 25 +++- drivers/scsi/ufs/ufshcd-pci.c| 60 ++- drivers/scsi/ufs/ufshcd

[PATCH 0/4] scsi: ufs: Improve UFS error handling

2013-06-13 Thread Sujit Reddy Thumma
operations [PATCH 2/2] scsi: ufs: Add runtime PM helpers for UFS host driver Sujit Reddy Thumma (4): scsi: ufs: Fix broken task management command implementation scsi: ufs: Fix hardware race conditions while aborting a command scsi: ufs: Fix device and host reset methods scsi: ufs: Improve UFS

[PATCH 3/4] scsi: ufs: Fix device and host reset methods

2013-06-13 Thread Sujit Reddy Thumma
the device and host and re-initializing them in proper manner. Signed-off-by: Sujit Reddy Thumma sthu...@codeaurora.org --- drivers/scsi/ufs/ufshcd.c | 446 +++-- drivers/scsi/ufs/ufshcd.h |2 + 2 files changed, 391 insertions(+), 57 deletions(-) diff

[PATCH 2/4] scsi: ufs: Fix hardware race conditions while aborting a command

2013-06-13 Thread Sujit Reddy Thumma
so that after the abort operation, the command is guaranteed to be non-existent in both controller and the device. Signed-off-by: Sujit Reddy Thumma sthu...@codeaurora.org --- drivers/scsi/ufs/ufshcd.c | 71 ++-- 1 files changed, 55 insertions(+), 16

[PATCH 4/4] scsi: ufs: Improve UFS fatal error handling

2013-06-13 Thread Sujit Reddy Thumma
is informed about the expected Unit-Attentioni exception from the device for the immediate command after a reset so that the SCSI layer take necessary steps to establish communication with the device. Signed-off-by: Sujit Reddy Thumma sthu...@codeaurora.org --- drivers/scsi/ufs/ufshcd.c | 348

[PATCH 1/4] scsi: ufs: Fix broken task management command implementation

2013-06-13 Thread Sujit Reddy Thumma
communication, abruptly ending the request on kill interrupt signal might cause h/w malfunction. Fix: Wait for hardware completion interrupt with TASK_UNINTERRUPTIBLE set. Signed-off-by: Sujit Reddy Thumma sthu...@codeaurora.org --- drivers/scsi/ufs/ufshcd.c | 174

Re: [PATCH 1/2] scsi: ufs: Add support for sending NOP OUT UPIU

2013-06-12 Thread Sujit Reddy Thumma
On 6/12/2013 11:00 AM, Santosh Y wrote: +/* + * ufshcd_wait_for_register - wait for register value to change + * @hba - per-adapter interface + * @reg - mmio register offset + * @mask - mask to apply to read register value + * @val - wait condition + * @interval_us - polling interval in

Re: [PATCH 2/2] scsi: ufs: Set fDeviceInit flag to initiate device initialization

2013-06-12 Thread Sujit Reddy Thumma
On 6/12/2013 11:04 AM, Santosh Y wrote: /** + * ufshcd_query_request() - API for issuing query request to the device. + * @hba: ufs driver context + * @query: params for query request + * @descriptor: buffer for sending/receiving descriptor + * @retries: number of times to try executing

[PATCH V5 1/1] scsi: ufs: Add support for sending NOP OUT UPIU

2013-05-09 Thread Sujit Reddy Thumma
the device connection path and test whether the UTP layer on the device side is functional during initialization. Signed-off-by: Sujit Reddy Thumma sthu...@codeaurora.org Acked-by: Santosh Y santos...@gmail.com --- v5: - rebase on top of Seungwon Jeon's UFS V4 patchset v4: - Removed

[PATCH 1/2] Documentation: devicetree: Add DT bindings for UFS host controller

2013-05-09 Thread Sujit Reddy Thumma
Compatible list is used in commit 03b1781 but is not documented. Add necessary device tree bindings to describe on-chip UFS host controllers. Signed-off-by: Sujit Reddy Thumma sthu...@codeaurora.org --- .../devicetree/bindings/ufs/ufshcd-pltfrm.txt | 16 1 files changed

[PATCH 2/2] scsi: ufs: Fix the response UPIU length setting

2013-05-09 Thread Sujit Reddy Thumma
The response UPIU length should be in DWORD and not in bytes. Signed-off-by: Maya Erez me...@codeaurora.org Signed-off-by: Sujit Reddy Thumma sthu...@codeaurora.org --- drivers/scsi/ufs/ufshcd.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b

Re: [PATCH V3 1/1] scsi: ufs: Add support for sending NOP OUT UPIU

2013-05-07 Thread Sujit Reddy Thumma
On 5/7/2013 2:57 PM, Seungwon Jeon wrote: On Monday, May 06, 2013, Sujit Reddy Thumma wrote: As part of device initialization sequence, sending NOP OUT UPIU and waiting for NOP IN UPIU response is mandatory. This confirms that the device UFS Transport (UTP) layer is functional and the host can

[PATCH V2 1/1] scsi: ufs: Add support for sending NOP OUT UPIU

2013-05-06 Thread Sujit Reddy Thumma
the device connection path and test whether the UTP layer on the device side is functional during initialization. Signed-off-by: Sujit Reddy Thumma sthu...@codeaurora.org --- v2: - fixed INTERNAL_CMD_TAG check in readl_poll_timeout - minor cleanup from v1 - rebased on Seungwon Jeon's UFS V3

[PATCH V3 1/1] scsi: ufs: Add support for sending NOP OUT UPIU

2013-05-06 Thread Sujit Reddy Thumma
the device connection path and test whether the UTP layer on the device side is functional during initialization. Signed-off-by: Sujit Reddy Thumma sthu...@codeaurora.org --- v3: - minor bug fix in error path v2: - fixed INTERNAL_CMD_TAG check in readl_poll_timeout - minor cleanup from v1

[PATCH 1/1] scsi: ufs: Set fDeviceInit flag to initiate device initialization

2013-05-06 Thread Sujit Reddy Thumma
specification for device initialization completion. Signed-off-by: Dolev Raviv dra...@codeaurora.org Signed-off-by: Sujit Reddy Thumma sthu...@codeaurora.org --- drivers/scsi/ufs/ufs.h| 10 - drivers/scsi/ufs/ufshcd.c | 102 + drivers/scsi/ufs

[RFC] scsi: ufs: Rework UFS host driver implementation

2013-05-03 Thread Sujit Reddy Thumma
specific power management Signed-off-by: Sujit Reddy Thumma sthu...@codeaurora.org --- The patch is not complete and does not handle some of the points mentioned above. This is just for review on design part. --- drivers/scsi/ufs/Makefile |2 +- drivers/scsi/ufs/ufs.c| 341

Re: [PATCH 1/1] scsi: ufs: Add support for sending NOP OUT UPIU

2013-05-02 Thread Sujit Reddy Thumma
On 5/2/2013 12:57 PM, Santosh Y wrote: + +/** + * ufshcd_validate_dev_connection() - Check device connection status + * @hba: per-adapter instance + * + * Send NOP OUT UPIU and wait for NOP IN response to check whether the + * device Transport Protocol (UTP) layer is ready after a reset. + * If

Re: [PATCH 1/1] scsi: ufs: Generalize UFS Interconnect Layer (UIC) command support

2013-05-02 Thread Sujit Reddy Thumma
On 5/2/2013 12:49 PM, Santosh Y wrote: -static inline void -ufshcd_send_uic_command(struct ufs_hba *hba, struct uic_command *uic_cmnd) +static int ufshcd_send_uic_command(struct ufs_hba *hba, + struct uic_command *uic_cmnd, int retries) { + int err = 0; + unsigned

  1   2   >