Re: [RESEND PATCH v2] backlight: pm8941-wled: Add default-brightness property

2015-10-27 Thread Rob Herring
On Mon, Oct 26, 2015 at 12:45 PM, Bjorn Andersson wrote: > Default the brightness to 2048 and add possibility to override this in > device tree. > > Suggested-by: Rob Clark > Signed-off-by: Bjorn Andersson >

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

2015-10-27 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" V5: removed un-necessary wmb() V4: fixing a few comments from reviewers V3: removed specific calls to wmb() since they are redundant. V2: a few minor

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

2015-10-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 |

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

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

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

2015-10-27 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 v5 03/15] scsi: ufs: verify command tag validity

2015-10-27 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

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

2015-10-27 Thread ygardi
>> 2015-10-25 23:40 GMT+09:00 : 2015-09-02 19:13 GMT+09:00 Yaniv Gardi : > Performing several writes to UFS host controller registers has > no gurrantee of ordering, so we must make sure register writes > to setup request list base

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

2015-10-27 Thread Yaniv Gardi
Add a write memory barrier to make sure descriptors prepared are actually written to memory before ringing the doorbell. We have also added the write memory barrier after ringing the doorbell register so that controller sees the new request immediately. Signed-off-by: Gilad Broner

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

2015-10-27 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 v5 15/15] scsi: ufs: add wrapper for retrying sending query attribute

2015-10-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 v5 12/15] scsi: ufs: reduce the interrupts for power mode change requests

2015-10-27 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

Re: [PATCH v2 17/17] scsi: ufs-qcom: fix compilation warnings

2015-10-27 Thread ygardi
> On 10/26/2015 08:41 AM, Yaniv Gardi wrote: >> Tnis patch fixes the following compilation warnings: >> ...ufs-qcom.c:1201:40: >> warning: incorrect type in argument 1 (different address spaces) >> ...ufs-qcom.c:1201:40: >> expected void const *ptr >> ...ufs-qcom.c:1201:40: >> got

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

2015-10-27 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 v5 09/15] scsi: ufs: add retries for hibern8 enter

2015-10-27 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 v5 07/15] scsi: ufs: set REQUEST_SENSE command size to 18 bytes

2015-10-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 | 12 +++- 1 file changed, 7 insertions(+), 5

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

2015-10-27 Thread Yaniv Gardi
If device raises the exception event in the response to the commands sent during the runtime/system PM callbacks, exception event handler might run in parallel with PM callbacks and may see unclocked register accesses. This change fixes this issue by not scheduling the exception event handler

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

2015-10-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 ---

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

2015-10-27 Thread Gilad Broner
Reviewed-by: Gilad Broner > 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

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

2015-10-27 Thread Gilad Broner
Reviewed-by: Gilad Broner > 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 - >

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

2015-10-27 Thread Gilad Broner
Reviewed-by: Gilad Broner > 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

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

2015-10-27 Thread Gilad Broner
Reviewed-by: Gilad Broner > 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

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

2015-10-27 Thread Gilad Broner
Reviewed-by: Gilad Broner > 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

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

2015-10-27 Thread Gilad Broner
Reviewed-by: Gilad Broner > 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 > > --- >

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

2015-10-27 Thread Gilad Broner
Looks OK. Reviewed-by: Gilad Broner > 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

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

2015-10-27 Thread Gilad Broner
Reviewed-by: Gilad Broner > 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

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

2015-10-27 Thread Gilad Broner
Reviewed-by: Gilad Broner > 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:

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

2015-10-27 Thread Gilad Broner
Reviewed-by: Gilad Broner > 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: >

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

2015-10-27 Thread Gilad Broner
Reviewed-by: Gilad Broner > 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

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

2015-10-27 Thread Gilad Broner
Reviewed-by: Gilad Broner > 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.

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

2015-10-27 Thread Gilad Broner
Reviewed-by: Gilad Broner > If device raises the exception event in the response to the commands > sent during the runtime/system PM callbacks, exception event handler > might run in parallel with PM callbacks and may see unclocked register > accesses. This change fixes

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

2015-10-27 Thread Gilad Broner
Looks OK. Reviewed-by: Gilad Broner > 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

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

2015-10-27 Thread Gilad Broner
Reviewed-by: Gilad Broner > 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

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

2015-10-27 Thread Gilad Broner
Reviewed-by: Gilad Broner > 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

Re: [PATCH v2 17/17] scsi: ufs-qcom: fix compilation warnings

2015-10-27 Thread Stephen Boyd
On 10/27/2015 03:10 AM, yga...@codeaurora.org wrote: >> On 10/26/2015 08:41 AM, Yaniv Gardi wrote: >>> Tnis patch fixes the following compilation warnings: >>> ...ufs-qcom.c:1201:40: >>> warning: incorrect type in argument 1 (different address spaces) >>> ...ufs-qcom.c:1201:40: >>>

Re: [PATCH v2 17/17] scsi: ufs-qcom: fix compilation warnings

2015-10-27 Thread ygardi
> On 10/27/2015 03:10 AM, yga...@codeaurora.org wrote: >>> On 10/26/2015 08:41 AM, Yaniv Gardi wrote: Tnis patch fixes the following compilation warnings: ...ufs-qcom.c:1201:40: warning: incorrect type in argument 1 (different address spaces) ...ufs-qcom.c:1201:40:

[PATCH v3] sched: fix incorrect wait time and wait count statistics

2015-10-27 Thread Joonwoo Park
At present scheduler resets task's wait start timestamp when the task migrates to another rq. This misleads scheduler itself into reporting less wait time than actual by omitting time spent for waiting prior to migration and also more wait count than actual by counting migration as wait end event

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

2015-10-27 Thread Rob Herring
On Sun, Oct 25, 2015 at 5:50 AM, Yaniv Gardi wrote: > 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

Re: [PATCH v2 17/17] scsi: ufs-qcom: fix compilation warnings

2015-10-27 Thread Stephen Boyd
On 10/27/2015 11:22 AM, yga...@codeaurora.org wrote: >> On 10/27/2015 03:10 AM, yga...@codeaurora.org wrote: On 10/26/2015 08:41 AM, Yaniv Gardi wrote: > Tnis patch fixes the following compilation warnings: > ...ufs-qcom.c:1201:40: > warning: incorrect type in argument 1

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

2015-10-27 Thread Stephen Boyd
On 10/26, Stephen Boyd wrote: > We want to put the XO board clocks into the dt files. Add an API > to do this generically. This also makes a place for us to handle > the case where the RPM driver is enabled or disabled. > > Cc: Georgi Djakov > Signed-off-by: Stephen

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

2015-10-27 Thread Stephen Boyd
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, > +

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

2015-10-27 Thread Stephen Boyd
We want to put the XO board clocks into the dt files, but we also need to be backwards compatible with an older dtb. Add an API to the common code to do this. This also makes a place for us to handle the case when the RPM clock driver is enabled and we don't want to register the fixed factor

Re: [PATCH v3 5/8] clk: qcom: Add support for RPM Clocks

2015-10-27 Thread Stephen Boyd
On 10/20, Georgi Djakov wrote: > diff --git a/drivers/clk/qcom/clk-smd-rpm.c b/drivers/clk/qcom/clk-smd-rpm.c > new file mode 100644 > index ..aa634bdf0aae > --- /dev/null > +++ b/drivers/clk/qcom/clk-smd-rpm.c > @@ -0,0 +1,260 @@ > + > +static int clk_smd_rpm_set_rate_active(struct

Re: [PATCH v3 1/8] arm64: dts: qcom: 8x16: Add fixed rate on-board oscillator

2015-10-27 Thread Stephen Boyd
On 10/20, Georgi Djakov wrote: > diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi > b/arch/arm64/boot/dts/qcom/msm8916.dtsi > index 8748fcca70f4..355a2acea796 100644 > --- a/arch/arm64/boot/dts/qcom/msm8916.dtsi > +++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi > @@ -80,6 +80,15 @@ >

Re: [PATCH v3 6/8] clk: qcom: Add RPM clock controller driver

2015-10-27 Thread Stephen Boyd
On 10/20, Georgi Djakov wrote: > diff --git a/drivers/clk/qcom/rpmcc.c b/drivers/clk/qcom/rpmcc.c > new file mode 100644 > index ..88283e2c95f7 > --- /dev/null > +++ b/drivers/clk/qcom/rpmcc.c > @@ -0,0 +1,198 @@ > +/* > + * Copyright (c) 2015, Linaro Limited > + * Copyright (c) 2014,

Re: [PATCH] sched: fix incorrect wait time and wait count statistics

2015-10-27 Thread Peter Zijlstra
(Excessive quoting for Olav) On Mon, Oct 26, 2015 at 06:44:48PM -0700, Joonwoo Park wrote: > On 10/25/2015 03:26 AM, Peter Zijlstra wrote: > > Also note that on both sites we also set TASK_ON_RQ_MIGRATING -- albeit > > late. Can't you simply set that earlier (and back to QUEUED later) and > >

[PATCH v2 2/2] clk: qcom: Move cxo/pxo/xo into dt files

2015-10-27 Thread Stephen Boyd
Put these clocks into the dt files instead of registering them from C code. This provides a few benefits. It allows us to specify the frequency of these clocks at the board level instead of hard-coding them in the driver. It allows us to insert an RPM clock in between the consumers of the crystals

Re: [PATCH] sched: fix incorrect wait time and wait count statistics

2015-10-27 Thread Joonwoo Park
On Tue, Oct 27, 2015 at 01:57:28PM +0100, Peter Zijlstra wrote: > > (Excessive quoting for Olav) > > On Mon, Oct 26, 2015 at 06:44:48PM -0700, Joonwoo Park wrote: > > On 10/25/2015 03:26 AM, Peter Zijlstra wrote: > > > > Also note that on both sites we also set TASK_ON_RQ_MIGRATING -- albeit >

[PATCH v4] sched: fix incorrect wait time and wait count statistics

2015-10-27 Thread Joonwoo Park
At present scheduler resets task's wait start timestamp when the task migrates to another rq. This misleads scheduler itself into reporting less wait time than actual by omitting time spent for waiting prior to migration and also more wait count than actual by counting migration as wait end event