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

2015-10-28 Thread Yaniv Gardi
According to UFS device specification REQUEST_SENSE command can only report back up to 18 bytes of data. Reviewed-by: Dolev Raviv Signed-off-by: Gilad Broner Signed-off-by: Yaniv Gardi --- drivers/scsi/ufs/ufshcd.c | 12

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

2015-10-28 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. Reviewed-by: Dolev Raviv Signed-off-by: Gilad Broner

Re: [PATCH v2 00/17] add fixes, device quirks, error recovery,

2015-10-28 Thread Gilad Broner
Looks good to me. Reviewed-by: Gilad Broner > V2: > This series should be pushed on top of 15 patches series: > "Big fixes, retries, handle a race condition" > fixed and few comments. > > V1: > This series should be pushed on top of 15 patches series: > "Big fixes,

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

2015-10-28 Thread Yaniv Gardi
Performing several writes to UFS host controller registers has no guarantee of ordering, so we must make sure register writes to setup request list base address etc. are performed before the run/stop register is enabled. In addition, when setting up a task request, we must make sure the updating

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

2015-10-28 Thread Yaniv Gardi
If hibern8 enter command fails then UFS link state may be unknown which may result into timeout of all the commands issued after failure. This change does 2 things (for pre-defined number of retry counts) after hibern8 enter failure: 1. Recovers the UFS link to active state 2. If link is

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

2015-10-28 Thread Yaniv Gardi
Hibern8 exit can be called from 3 different context: - ufshcd_hibern8_exit_work - ufshcd_ungate_work - runtime/system resume If hibern8 exit fails for some reason then we try to bring the link to active state by link startup but this recovery mechanism results into deadlock or errors

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

2015-10-28 Thread Yaniv Gardi
DME commands such as Hibern8 enter/exit and gear switch generate 2 completion interrupts, one for confirmation that command is received by local UniPro and 2nd one is the final confirmation after communication with remote UniPro. Currently both of these completions are registered as interrupt

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

2015-10-28 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. Reviewed-by: Gilad

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

2015-10-28 Thread Yaniv Gardi
New revisions of UFS host controller supports the new UniPro hardware controller (referred as QUniPro). This patch adds the support to enable this new UniPro controller hardware. This change also adds power optimization for bus scaling feature, as well as support for HS-G3 power mode.

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

2015-10-28 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. Reviewed-by: Subhash Jadavani Reviewed-by: Gilad Broner Signed-off-by: Yaniv Gardi

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

2015-10-28 Thread Yaniv Gardi
This change turns the UFS variant (SCSI_UFS_QCOM) into a UFS a platform device. In order to do so a few additional changes are required: 1. The ufshcd-pltfrm is no longer serves as a platform device. Now it only serves as a group of platform APIs such as PM APIs (runtime suspend/resume,

RE: [PATCH v5 00/15] Big fixes, retries, handle a race condition

2015-10-28 Thread Dolev Raviv
Reviewed-by: Dolev Raviv Thanks, Dolev -- Qualcomm Israel, on behalf of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project -Original Message- From: Yaniv Gardi

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

2015-10-28 Thread Yaniv Gardi
fDeviceInit query response time for some devices is too long that default query request timeout of 100ms may not be enough. Experiments show that fDeviceInit response sometimes takes 500ms so to be on safer side this change sets the timeout to 600ms. Without this change, we might unnecessarily

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

2015-10-28 Thread Yaniv Gardi
A race condition appear to exist between request completion when scsi_done() is called to end the request and set the tag back to -1 (at blk_queue_end_tag() scsi_end_request), and scsi layer error handling which aborts the command and reuses it to request sense data. Sending the request sense is

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

2015-10-28 Thread Yaniv Gardi
Some of the data structures (like response UPIU) and/or its elements (unused fields) should be cleared before sending out the respective command to UFS device. This change clears the UPIU response data structure for query commands and NOP command before sending out the command. We also initialize

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

2015-10-28 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. Reviewed-by: Subhash Jadavani Reviewed-by: Gilad Broner

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

2015-10-28 Thread Yaniv Gardi
V9: update commit message with Reviewed-by and update commit message of patch 4/8 V8: add phy attributes to UFS devicetree documentation file V7: removed additional dead code V6: removed dead code from ufs-qcom.c and added calling to ufshcd_dealloc_host() in ufshcd-pltfrm.c in case of an error

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

2015-10-28 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. Reviewed-by: Akinobu Mita Reviewed-by: Subhash Jadavani Reviewed-by: Gilad Broner Signed-off-by: Yaniv

[PATCH v9 4/8] scsi: ufs: add ufshcd_get_variant ufshcd_set_variant

2015-10-28 Thread Yaniv Gardi
This patch adds ufshcd_get_variant() and ufshcd_set_variant() routines in order to get/set the variant specific data. Reviewed-by: Akinobu Mita Reviewed-by: Subhash Jadavani Reviewed-by: Gilad Broner Signed-off-by: Yaniv

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

2015-10-28 Thread Yaniv Gardi
Export the following functions in order to avoid build errors when the component PHY_QCOM_UFS is compiled as a module: ERROR: "ufs_qcom_phy_disable_ref_clk" [drivers/scsi/ufs/ufs-qcom.ko] undefined! ERROR: "ufs_qcom_phy_enable_ref_clk" [drivers/scsi/ufs/ufs-qcom.ko] undefined!

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

2015-10-28 Thread Yaniv Gardi
This change is required in order to be able to build the component as a module. Reviewed-by: Akinobu Mita Reviewed-by: Subhash Jadavani Reviewed-by: Gilad Broner Signed-off-by: Yaniv Gardi ---

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

2015-10-28 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." Reviewed-by: Akinobu Mita Reviewed-by: Subhash Jadavani

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

2015-10-28 Thread Yaniv Gardi
Clear the UFS data structures before sending new request. The SCSI command is sent to the device within the UFS UPIU request. As part of the transfer UPIU preparation, the SCSI command is copied to the UPIU structure according to the SCSI command size. As different SCSI commands differ in size

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

2015-10-28 Thread Yaniv Gardi
Important: This serie of 15 small patches should be pushed after the series of 8 patches "Fix error message and present UFS variant probe" V6: update Reviewed-by from various reviewers V5: removed un-necessary wmb() V4: fixing a few comments from reviewers V3: removed specific calls to wmb()

Re: [PATCH v2 1/2] clk: qcom: common: Add API to register board clocks backwards compatibly

2015-10-28 Thread Georgi Djakov
On 10/28/2015 03:06 AM, Stephen Boyd wrote: > On 10/27, Stephen Boyd wrote: >> + >> +int qcom_cc_register_board_clk(struct device *dev, const char *path, >> + const char *name, unsigned long rate) >> +{ >> +return _qcom_cc_register_board_clk(dev, path, name, rate, >>

Re: [PATCH v2 1/2] clk: qcom: common: Add API to register board clocks backwards compatibly

2015-10-28 Thread Stephen Boyd
On 10/28/2015 11:03 AM, Georgi Djakov wrote: > On 10/28/2015 03:06 AM, Stephen Boyd wrote: >> On 10/27, Stephen Boyd wrote: >>> + >>> +int qcom_cc_register_board_clk(struct device *dev, const char *path, >>> + const char *name, unsigned long rate) >>> +{ >>> + return

Re: [PATCH] arm: dts: qcom: Add board clocks

2015-10-28 Thread Andy Gross
On Mon, Oct 26, 2015 at 06:26:53PM -0700, Stephen Boyd wrote: > These clocks are fixed rate board sources that should be in DT. > Add them. > > Cc: Georgi Djakov > Signed-off-by: Stephen Boyd > --- Reviewed-by: Andy Gross

Re: [PATCH] sched: Update task->on_rq when tasks are moving between runqueues

2015-10-28 Thread Olav Haugan
On 15-10-25 11:09:24, Peter Zijlstra wrote: > On Sat, Oct 24, 2015 at 11:01:02AM -0700, Olav Haugan wrote: > > Task->on_rq has three states: > > 0 - Task is not on runqueue (rq) > > 1 (TASK_ON_RQ_QUEUED) - Task is on rq > > 2 (TASK_ON_RQ_MIGRATING) - Task is on rq but in the process of