[PATCH v8 0/5] Support for Qualcomm UFS QMP PHY on SDM845

2018-07-31 Thread Can Guo
ux" from sdm845 ufs phy clock list structure. Changes since v1: - Incorporated review comments from Vivek and Manu. - Update the commit title of patch 2. Can Guo (5): phy: Update PHY power control sequence phy: General struct and field cleanup phy: Add QMP phy based UFS phy support fo

[PATCH v8 3/5] phy: Add QMP phy based UFS phy support for sdm845

2018-07-31 Thread Can Guo
Add UFS PHY support to make SDM845 UFS work with common PHY framework. Signed-off-by: Can Guo --- drivers/phy/qualcomm/phy-qcom-qmp.c | 172 +++- drivers/phy/qualcomm/phy-qcom-qmp.h | 15 2 files changed, 186 insertions(+), 1 deletion(-) diff --git a

[PATCH v8 4/5] scsi: ufs: Power on phy after it is initialized

2018-07-31 Thread Can Guo
Y disabled. This change adds condition checks to phy power on calls which happen before phy initialization. Signed-off-by: Can Guo --- drivers/scsi/ufs/ufs-qcom.c | 4 +++- drivers/scsi/ufs/ufs-qcom.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/ufs-qcom.c

[PATCH v8 2/5] phy: General struct and field cleanup

2018-07-31 Thread Can Guo
Move MSM8996 specific PHY vreg list struct name to a genernal one as it is used by all PHYs. Add a specific field to handle dual lane situation. Signed-off-by: Can Guo Reviewed-by: Evan Green Reviewed-by: Manu Gautam Reviewed-by: Vivek Gautam --- drivers/phy/qualcomm/phy-qcom-qmp.c | 25

[PATCH v8 1/5] phy: Update PHY power control sequence

2018-07-31 Thread Can Guo
All PHYs should be powered on before register configuration starts. And only PCIe PHYs need an extra power control before deasserts reset state. Signed-off-by: Can Guo Reviewed-by: Manu Gautam Reviewed-by: Vivek Gautam Reviewed-by: Evan Green --- drivers/phy/qualcomm/phy-qcom-qmp.c | 19

[PATCH v8 5/5] dt-bindings: phy-qcom-qmp: Add UFS phy compatible string for sdm845

2018-07-31 Thread Can Guo
Update the compatible string for UFS QMP PHY on SDM845. Signed-off-by: Can Guo Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt b

[PATCH v3 1/2] phy: Add QMP phy based UFS phy support for sdm845

2018-03-27 Thread Can Guo
Add UFS PHY support to make SDM845 UFS work with common PHY framework. Signed-off-by: Can Guo --- drivers/phy/qualcomm/phy-qcom-qmp.c | 130 +--- drivers/phy/qualcomm/phy-qcom-qmp.h | 8 +++ 2 files changed, 127 insertions(+), 11 deletions(-) diff --git a

[PATCH v3 0/2] Support for Qualcomm UFS QMP PHY on SDM845

2018-03-27 Thread Can Guo
comments from Vivek and Rob. - Remove "ref_aux" from sdm845 ufs phy clock list structure. Changes since v1: - Incorporated review comments from Vivek and Manu. - Update the commit title of patch 2. Can Guo (2): phy: Add QMP phy based UFS phy support for sdm845 dt-bindings: phy-qcom-qm

[PATCH v3 2/2] dt-bindings: phy-qcom-qmp: Add UFS phy compatible string for sdm845

2018-03-27 Thread Can Guo
Update the compatible string for UFS QMP PHY on SDM845. Signed-off-by: Can Guo --- Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt b/Documentation/devicetree

[PATCH v4 2/2] dt-bindings: phy-qcom-qmp: Add UFS phy compatible string for sdm845

2018-04-11 Thread Can Guo
Update the compatible string for UFS QMP PHY on SDM845. Signed-off-by: Can Guo Reviewed-by: Vivek Gautam Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings

[PATCH v4 1/2] phy: Add QMP phy based UFS phy support for sdm845

2018-04-11 Thread Can Guo
Add UFS PHY support to make SDM845 UFS work with common PHY framework. Signed-off-by: Can Guo Reviewed-by: Vivek Gautam --- drivers/phy/qualcomm/phy-qcom-qmp.c | 130 +--- drivers/phy/qualcomm/phy-qcom-qmp.h | 8 +++ 2 files changed, 127 insertions(+), 11

[PATCH v4 0/2] Support for Qualcomm UFS QMP PHY on SDM845

2018-04-11 Thread Can Guo
comments from Vivek and Rob. Changes since v2: - Incorporated review comments from Vivek and Rob. - Remove "ref_aux" from sdm845 ufs phy clock list structure. Changes since v1: - Incorporated review comments from Vivek and Manu. - Update the commit title of patch 2. Can Guo (2): phy: A

[PATCH v1] phy: Add QMP phy based UFS phy support for sdm845.

2018-03-20 Thread Can Guo
Add UFS PHY support to make SDM845 UFS work with common PHY framework. Signed-off-by: Can Guo --- drivers/phy/qualcomm/phy-qcom-qmp.c | 120 +++- drivers/phy/qualcomm/phy-qcom-qmp.h | 8 +++ 2 files changed, 126 insertions(+), 2 deletions(-) diff --git a

[PATCH v1 1/2] phy: Add QMP phy based UFS phy support for sdm845

2018-03-20 Thread Can Guo
Add UFS PHY support to make SDM845 UFS work with common PHY framework. Signed-off-by: Can Guo --- drivers/phy/qualcomm/phy-qcom-qmp.c | 120 +++- drivers/phy/qualcomm/phy-qcom-qmp.h | 8 +++ 2 files changed, 126 insertions(+), 2 deletions(-) diff --git a

[PATCH v1 0/2] Support for Qualcomm UFS QMP PHY on SDM845

2018-03-20 Thread Can Guo
This patch series adds support for UFS QMP PHY on SDM845 and updates the compitable string for it. Can Guo (2): phy: Add QMP phy based UFS phy support for sdm845 dt-bindings: phy-qcom-qmp: Update UFS phy compitable string for sdm845 .../devicetree/bindings/phy/qcom-qmp-phy.txt | 3

[PATCH v1 2/2] dt-bindings: phy-qcom-qmp: Update UFS phy binding for sdm845

2018-03-20 Thread Can Guo
Update the compatible string for UFS QMP PHY on SDM845. Signed-off-by: Can Guo --- Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt b/Documentation/devicetree

[PATCH v2 1/2] phy: Add QMP phy based UFS phy support for sdm845

2018-03-20 Thread Can Guo
Add UFS PHY support to make SDM845 UFS work with common PHY framework. Signed-off-by: Can Guo --- drivers/phy/qualcomm/phy-qcom-qmp.c | 122 +++- drivers/phy/qualcomm/phy-qcom-qmp.h | 8 +++ 2 files changed, 127 insertions(+), 3 deletions(-) diff --git a

[PATCH v2 0/2] Support for Qualcomm UFS QMP PHY on SDM845

2018-03-20 Thread Can Guo
comments from Vivek and Manu. - Update the commit title of patch 2. Can Guo (2): phy: Add QMP phy based UFS phy support for sdm845 dt-bindings: phy-qcom-qmp: Add UFS phy compitable string for sdm845 .../devicetree/bindings/phy/qcom-qmp-phy.txt | 3 +- drivers/phy/qualcomm/phy-qcom-qmp.c

[PATCH v2 2/2] dt-bindings: phy-qcom-qmp: Add UFS phy compitable string for sdm845

2018-03-20 Thread Can Guo
Update the compatible string for UFS QMP PHY on SDM845. Signed-off-by: Can Guo --- Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt b/Documentation/devicetree

[PATCH v7 2/4] phy: General struct and field cleanup

2018-06-19 Thread Can Guo
Move MSM8996 specific PHY vreg list struct name to a genernal one as it is used by all PHYs. Add a specific field to handle dual lane situation. Signed-off-by: Can Guo --- drivers/phy/qualcomm/phy-qcom-qmp.c | 25 ++--- 1 file changed, 14 insertions(+), 11 deletions(-) diff

[PATCH v7 0/4] Support for Qualcomm UFS QMP PHY on SDM845

2018-06-19 Thread Can Guo
ommit title of patch 2. Can Guo (4): phy: Update PHY power control sequence phy: General struct and field cleanup phy: Add QMP phy based UFS phy support for sdm845 dt-bindings: phy-qcom-qmp: Add UFS phy compatible string for sdm845 .../devicetree/bindings/phy/qcom-qmp-phy.txt |

[PATCH v7 4/4] dt-bindings: phy-qcom-qmp: Add UFS phy compatible string for sdm845

2018-06-19 Thread Can Guo
Update the compatible string for UFS QMP PHY on SDM845. Signed-off-by: Can Guo Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt b

[PATCH v7 3/4] phy: Add QMP phy based UFS phy support for sdm845

2018-06-19 Thread Can Guo
Add UFS PHY support to make SDM845 UFS work with common PHY framework. Signed-off-by: Can Guo --- drivers/phy/qualcomm/phy-qcom-qmp.c | 173 +++- drivers/phy/qualcomm/phy-qcom-qmp.h | 15 2 files changed, 187 insertions(+), 1 deletion(-) diff --git a

[PATCH v7 1/4] phy: Update PHY power control sequence

2018-06-19 Thread Can Guo
All PHYs should be powered on before register configuration starts. And only PCIe PHYs need an extra power control before deasserts reset state. Signed-off-by: Can Guo --- drivers/phy/qualcomm/phy-qcom-qmp.c | 19 --- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git

[PATCH v2 1/1] scsi: ufs: make UFS Tx lane1 clock optional for QCOM platforms

2018-10-11 Thread Can Guo
when enable/disable lane clocks just for symmetry. Signed-off-by: Venkat Gopalakrishnan Signed-off-by: Subhash Jadavani Signed-off-by: Can Guo --- Changes since v1: - Incorporated review comments from Doug. - Update the commit title and commit message. drivers/scsi/ufs/ufs-qcom.c

[PATCH v10 1/6] phy: Update PHY power control sequence

2018-10-22 Thread Can Guo
All PHYs should be powered on before register configuration starts. And only PCIe PHYs need an extra power control before deasserts reset state. Signed-off-by: Can Guo Reviewed-by: Manu Gautam Reviewed-by: Vivek Gautam Reviewed-by: Evan Green --- drivers/phy/qualcomm/phy-qcom-qmp.c | 19

[PATCH v10 0/6] Support for Qualcomm UFS QMP PHY on SDM845

2018-10-22 Thread Can Guo
ate the commit title of patch 2. Can Guo (5): phy: Update PHY power control sequence phy: General struct and field cleanup phy: Add QMP phy based UFS phy support for sdm845 scsi: ufs: Power on phy after it is initialized dt-bindings: phy-qcom-qmp: Add UFS phy compatible string for sdm84

[PATCH v10 2/6] phy: General struct and field cleanup

2018-10-22 Thread Can Guo
Move MSM8996 specific PHY vreg list struct name to a genernal one as it is used by all PHYs. Add a specific field to handle dual lane situation. Signed-off-by: Can Guo Reviewed-by: Evan Green Reviewed-by: Manu Gautam Reviewed-by: Vivek Gautam --- drivers/phy/qualcomm/phy-qcom-qmp.c | 25

[PATCH v10 4/6] scsi: ufs: Add core reset support

2018-10-22 Thread Can Guo
From: Dov Levenglick Enables core reset support. Add full initialization of the PHY and the controller before initializing UFS PHY and during link recovery. Signed-off-by: Dov Levenglick Signed-off-by: Amit Nischal Signed-off-by: Subhash Jadavani Signed-off-by: Can Guo --- drivers/scsi/ufs

[PATCH v10 6/6] dt-bindings: phy-qcom-qmp: Add UFS phy compatible string for sdm845

2018-10-22 Thread Can Guo
Update the compatible string for UFS QMP PHY on SDM845. Signed-off-by: Can Guo Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt b

[PATCH v10 5/6] scsi: ufs: Power on phy after it is initialized

2018-10-22 Thread Can Guo
Y disabled. This change adds condition checks to phy power on calls which happen before phy initialization. Signed-off-by: Can Guo Reviewed-by: Evan Green Reviewed-by: Vivek Gautam --- drivers/scsi/ufs/ufs-qcom.c | 4 +++- drivers/scsi/ufs/ufs-qcom.h | 1 + 2 files changed, 4 insertions(+),

[PATCH v10 3/6] phy: Add QMP phy based UFS phy support for sdm845

2018-10-22 Thread Can Guo
Add UFS PHY support to make SDM845 UFS work with common PHY framework. Signed-off-by: Can Guo Reviewed-by: Evan Green Reviewed-by: Vivek Gautam --- drivers/phy/qualcomm/phy-qcom-qmp.c | 172 +++- drivers/phy/qualcomm/phy-qcom-qmp.h | 15 2 files changed

[PATCH v5 0/3] Support for Qualcomm UFS QMP PHY on SDM845

2018-05-22 Thread Can Guo
k and Manu. - Update the commit title of patch 2. Can Guo (3): phy: Power on PHY before start Serdes configuration phy: Add QMP phy based UFS phy support for sdm845 dt-bindings: phy-qcom-qmp: Add UFS phy compatible string for sdm845 .../devicetree/bindings/phy/qcom-qmp-phy.txt |

[PATCH v5 1/3] phy: Power on PHY before start Serdes configuration

2018-05-22 Thread Can Guo
PHYs should be powered on before register configuration starts. Signed-off-by: Can Guo --- drivers/phy/qualcomm/phy-qcom-qmp.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp.c b/drivers/phy/qualcomm/phy-qcom-qmp.c index 97ef942..9bfdba1 100644 --- a

[PATCH v5 2/3] phy: Add QMP phy based UFS phy support for sdm845

2018-05-22 Thread Can Guo
Add UFS PHY support to make SDM845 UFS work with common PHY framework. Signed-off-by: Can Guo --- drivers/phy/qualcomm/phy-qcom-qmp.c | 203 +--- drivers/phy/qualcomm/phy-qcom-qmp.h | 15 +++ 2 files changed, 206 insertions(+), 12 deletions(-) diff --git a

[PATCH v5 3/3] dt-bindings: phy-qcom-qmp: Add UFS phy compatible string for sdm845

2018-05-22 Thread Can Guo
Update the compatible string for UFS QMP PHY on SDM845. Signed-off-by: Can Guo --- Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt b/Documentation/devicetree

[PATCH v6 0/3] Support for Qualcomm UFS QMP PHY on SDM845

2018-05-28 Thread Can Guo
uot; from sdm845 ufs phy clock list structure. Changes since v1: - Incorporated review comments from Vivek and Manu. - Update the commit title of patch 2. Can Guo (3): phy: Update PHY power control sequence phy: Add QMP phy based UFS phy support for sdm845 dt-bindings: phy-qcom-qmp: Add UFS p

[PATCH v6 1/3] phy: Update PHY power control sequence

2018-05-28 Thread Can Guo
All PHYs should be powered on before register configuration starts. And only PCIe PHYs need an extra power control before deasserts reset state. Signed-off-by: Can Guo --- drivers/phy/qualcomm/phy-qcom-qmp.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/phy

[PATCH v6 2/3] phy: Add QMP phy based UFS phy support for sdm845

2018-05-28 Thread Can Guo
Add UFS PHY support to make SDM845 UFS work with common PHY framework. Signed-off-by: Can Guo --- drivers/phy/qualcomm/phy-qcom-qmp.c | 200 +--- drivers/phy/qualcomm/phy-qcom-qmp.h | 15 +++ 2 files changed, 203 insertions(+), 12 deletions(-) diff --git a

[PATCH v6 3/3] dt-bindings: phy-qcom-qmp: Add UFS phy compatible string for sdm845

2018-05-28 Thread Can Guo
Update the compatible string for UFS QMP PHY on SDM845. Signed-off-by: Can Guo Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt b

[PATCH v2 2/3] scsi: ufs-qcom: Disable interrupt in reset path

2021-02-23 Thread Can Guo
From: Nitin Rawat Disable interrupt in reset path to flush pending IRQ handler in order to avoid possible NoC issues. Signed-off-by: Nitin Rawat Signed-off-by: Can Guo --- drivers/scsi/ufs/ufs-qcom.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/scsi/ufs/ufs-qcom.c

[PATCH v2 1/3] scsi: ufs: Minor adjustments to error handling

2021-02-23 Thread Can Guo
multiple times during error recovery. Signed-off-by: Can Guo --- drivers/scsi/ufs/ufshcd.c | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 80620c8..013eb73 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b

[PATCH v2 3/3] scsi: ufs: Remove redundant checks of !hba in suspend/resume callbacks

2021-02-23 Thread Can Guo
Runtime and system suspend/resume can only come after hba probe invokes platform_set_drvdata(pdev, hba), meaning hba cannot be NULL in these PM callbacks, so remove the checks of !hba. Signed-off-by: Can Guo --- drivers/scsi/ufs/ufshcd.c | 21 - 1 file changed, 21 deletions

Re: [PATCH v19 3/3] scsi: ufs: Prepare HPB read for cached sub-region

2021-02-09 Thread Can Guo
ed to fix it before move on - all the UFS3.1 HPB parts which I tested over the last few weeks are screwed due to this... I don't care where/how you want to get it fixed in next version. In my case, which may not be a valid fix, I simply hack the code as below and it works for me. - put_unaligned_be64(ppn, &cdb[6]); + memcpy(&cdb[6], &ppn, sizeof(u64)); Thanks, Can Guo. thanks, Bean

Re: [PATCH v3 1/3] scsi: ufs: Fix task management request completion timeout

2021-01-28 Thread Can Guo
On 2021-01-29 11:22, Bart Van Assche wrote: On 1/27/21 8:16 PM, Can Guo wrote: ufshcd_tmc_handler() calls blk_mq_tagset_busy_iter(fn = ufshcd_compl_tm()), but since blk_mq_tagset_busy_iter() only iterates over all reserved tags and requests which are not in IDLE state, ufshcd_compl_tm() never

Re: [PATCH v3 3/3] scsi: ufs: Fix wrong Task Tag used in task management request UPIUs

2021-01-28 Thread Can Guo
On 2021-01-29 11:15, Bart Van Assche wrote: On 1/27/21 8:16 PM, Can Guo wrote: In __ufshcd_issue_tm_cmd(), it is not right to use hba->nutrs + req->tag as the Task Tag in one TMR UPIU. Directly use req->tag as the Task Tag. Why is the current code wrong and why is this patch the p

Re: [PATCH v3 2/3] scsi: ufs: Fix a race condition btw task management request send and compl

2021-01-28 Thread Can Guo
On 2021-01-29 11:20, Bart Van Assche wrote: On 1/27/21 8:16 PM, Can Guo wrote: ufshcd_compl_tm() looks for all 0 bits in the REG_UTP_TASK_REQ_DOOR_BELL and call complete() for each req who has the req->end_io_data set. There can be a race condition btw tmc send/compl, because the

Re: [PATCH v3 2/3] scsi: ufs: Fix a race condition btw task management request send and compl

2021-01-28 Thread Can Guo
On 2021-01-29 14:06, Can Guo wrote: On 2021-01-29 11:20, Bart Van Assche wrote: On 1/27/21 8:16 PM, Can Guo wrote: ufshcd_compl_tm() looks for all 0 bits in the REG_UTP_TASK_REQ_DOOR_BELL and call complete() for each req who has the req->end_io_data set. There can be a race condition btw

Re: [PATCH v19 3/3] scsi: ufs: Prepare HPB read for cached sub-region

2021-02-04 Thread Can Guo
SCSI command. In the HPB version 1.0, the maximum read I/O size that can be converted to HPB read is 4KB. The dirty map of the active sub-region prevents an incorrect HPB read that has stale physical page number which is updated by previous write I/O. Reviewed-by: Can Guo Reviewed-by: Bart Van

Re: [PATCH v3 3/3] scsi: ufs: Fix wrong Task Tag used in task management request UPIUs

2021-02-04 Thread Can Guo
On 2021-02-01 10:39, Bart Van Assche wrote: On 1/28/21 9:57 PM, Can Guo wrote: On 2021-01-29 11:15, Bart Van Assche wrote: On 1/27/21 8:16 PM, Can Guo wrote: In __ufshcd_issue_tm_cmd(), it is not right to use hba->nutrs + req->tag as the Task Tag in one TMR UPIU. Directly use req->t

Re: [PATCH v19 2/3] scsi: ufs: L2P map management for HPB read

2021-02-08 Thread Can Guo
t(). -EWOULDBLOCK means there is no available tags for this request. -EBUSY means failed on blk_queue_enter(). To overcome starvation of map request, we can try N times in heavy traffic situation (maybe N=3?). LGTM. You make the call. Regards, Can Guo. Thanks, Daejun

Re: [PATCH v2] scsi: ufs: Fix possible infinite loop in ufshcd_hold

2020-07-29 Thread Can Guo
Hi Stanley, On 2020-07-29 18:26, Stanley Chu wrote: Hi Can, On Wed, 2020-07-29 at 16:43 +0800, Can Guo wrote: Hi Stanley, On 2020-07-29 10:40, Stanley Chu wrote: > In ufshcd_suspend(), after clk-gating is suspended and link is set > as Hibern8 state, ufshcd_hold() is still possibly i

Re: [PATCH v7 7/8] scsi: ufs: Move dumps in IRQ handler to error handler

2020-07-29 Thread Can Guo
Hi Asutosh, On 2020-07-29 02:06, Asutosh Das (asd) wrote: On 7/27/2020 10:00 PM, Can Guo wrote: Sometime dumps in IRQ handler are heavy enough to cause system stability issues, move them to error handler. Signed-off-by: Can Guo --- drivers/scsi/ufs/ufshcd.c | 31

Re: [PATCH v4] scsi: ufs: Cleanup completed request without interrupt notification

2020-07-31 Thread Can Guo
_set_bit(SCMD_STATE_COMPLETE, &scmd->state)) return BLK_EH_RESET_TIMER; if (scsi_abort_command(scmd) != SUCCESS) { set_host_byte(scmd, DID_TIME_OUT); scsi_eh_scmd_add(scmd); } } } Thanks, Can Guo.

[PATCH 1/8] scsi: ufs: Add checks before setting clk-gating states

2020-07-31 Thread Can Guo
Clock gating features can be turned on/off selectively which means its state information is only important if it is enabled. This change makes sure that we only look at state of clk-gating if it is enabled. Signed-off-by: Can Guo Reviewed-by: Avri Altman Reviewed-by: Hongwu Su Reviewed-by

[PATCH 2/8] ufs: ufs-qcom: Fix race conditions caused by func ufs_qcom_testbus_config

2020-07-31 Thread Can Guo
If ufs_qcom_dump_dbg_regs() calls ufs_qcom_testbus_config() from ufshcd_suspend/resume and/or clk gate/ungate context, pm_runtime_get_sync() and ufshcd_hold() will cause racing problems. Fix this by removing the unnecessary calls of pm_runtime_get_sync() and ufshcd_hold(). Signed-off-by: Can Guo

[PATCH 3/8] scsi: ufs-qcom: Remove testbus dump in ufs_qcom_dump_dbg_regs

2020-07-31 Thread Can Guo
Dumping testbus registers is heavy enough to cause stability issues sometime, just remove them as of now. Signed-off-by: Can Guo Reviewed-by: Hongwu Su Reviewed-by: Avri Altman Reviewed-by: Bean Huo diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c index 7da27ee..96e0999

[PATCH 6/8] scsi: ufs: Recover hba runtime PM error in error handler

2020-07-31 Thread Can Guo
in case any of them has failed to be resumed due to hba runtime resume failure. This is to unblock blk_queue_enter in case there are bios waiting inside it. Signed-off-by: Can Guo Reviewed-by: Bean Huo diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 2af081e..d57791c

[PATCH 5/8] scsi: ufs: Fix concurrency of error handler and other error recovery paths

2020-07-31 Thread Can Guo
mark link state as UIC_LINK_BROKEN_STATE and schedule the eh_work. In this case, error handler needs to do a full reset and restore to recover the link back to active. Before the link state is recovered to active, ufshcd_uic_pwr_ctrl simply returns -ENOLINK to avoid more errors. Signed-off-by: Can G

[PATCH 4/8] scsi: ufs: Add some debug infos to ufshcd_print_host_state

2020-07-31 Thread Can Guo
cleanup to some prints in ufshcd_print_host_regs as similar prints are already available in ufshcd_print_host_state. Signed-off-by: Can Guo Reviewed-by: Avri Altman Reviewed-by: Hongwu Su Reviewed-by: Asutosh Das Reviewed-by: Stanley Chu Reviewed-by: Bean Huo diff --git a/drivers/scsi/ufs

[PATCH 7/8] scsi: ufs: Move dumps in IRQ handler to error handler

2020-07-31 Thread Can Guo
Sometime dumps in IRQ handler are heavy enough to cause system stability issues, move them to error handler and only print basic host regs here. Signed-off-by: Can Guo Reviewed-by: Bean Huo diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index d57791c..8265a2a 100644 --- a

[PATCH 8/8] scsi: ufs: Fix a racing problem btw error handler and runtime PM ops

2020-07-31 Thread Can Guo
s not hurt since error handler can recover hba runtime PM error. Signed-off-by: Can Guo Reviewed-by: Bean Huo diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 8265a2a..ee24c1f 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -126,

[PATCH 3/8] scsi: ufs-qcom: Remove testbus dump in ufs_qcom_dump_dbg_regs

2020-07-31 Thread Can Guo
Dumping testbus registers is heavy enough to cause stability issues sometime, just remove them as of now. Signed-off-by: Can Guo Reviewed-by: Hongwu Su Reviewed-by: Avri Altman Reviewed-by: Bean Huo diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c index 7da27ee..96e0999

[PATCH 1/8] scsi: ufs: Add checks before setting clk-gating states

2020-07-31 Thread Can Guo
Clock gating features can be turned on/off selectively which means its state information is only important if it is enabled. This change makes sure that we only look at state of clk-gating if it is enabled. Signed-off-by: Can Guo Reviewed-by: Avri Altman Reviewed-by: Hongwu Su Reviewed-by

[PATCH 2/8] ufs: ufs-qcom: Fix race conditions caused by func ufs_qcom_testbus_config

2020-07-31 Thread Can Guo
If ufs_qcom_dump_dbg_regs() calls ufs_qcom_testbus_config() from ufshcd_suspend/resume and/or clk gate/ungate context, pm_runtime_get_sync() and ufshcd_hold() will cause racing problems. Fix this by removing the unnecessary calls of pm_runtime_get_sync() and ufshcd_hold(). Signed-off-by: Can Guo

[PATCH 4/8] scsi: ufs: Add some debug infos to ufshcd_print_host_state

2020-07-31 Thread Can Guo
cleanup to some prints in ufshcd_print_host_regs as similar prints are already available in ufshcd_print_host_state. Signed-off-by: Can Guo Reviewed-by: Avri Altman Reviewed-by: Hongwu Su Reviewed-by: Asutosh Das Reviewed-by: Stanley Chu Reviewed-by: Bean Huo diff --git a/drivers/scsi/ufs

[PATCH 7/8] scsi: ufs: Move dumps in IRQ handler to error handler

2020-07-31 Thread Can Guo
Sometime dumps in IRQ handler are heavy enough to cause system stability issues, move them to error handler and only print basic host regs here. Signed-off-by: Can Guo Reviewed-by: Bean Huo diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 6bdf2bf..523b771 100644 --- a

[PATCH 6/8] scsi: ufs: Recover hba runtime PM error in error handler

2020-07-31 Thread Can Guo
in case any of them has failed to be resumed due to hba runtime resume failure. This is to unblock blk_queue_enter in case there are bios waiting inside it. Signed-off-by: Can Guo Reviewed-by: Bean Huo diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index b3a2310..6bdf2bf

[PATCH 5/8] scsi: ufs: Fix concurrency of error handler and other error recovery paths

2020-07-31 Thread Can Guo
mark link state as UIC_LINK_BROKEN_STATE and schedule the eh_work. In this case, error handler needs to do a full reset and restore to recover the link back to active. Before the link state is recovered to active, ufshcd_uic_pwr_ctrl simply returns -ENOLINK to avoid more errors. Signed-off-by: Can G

[PATCH 8/8] scsi: ufs: Fix a racing problem btw error handler and runtime PM ops

2020-07-31 Thread Can Guo
s not hurt since error handler can recover hba runtime PM error. Signed-off-by: Can Guo Reviewed-by: Bean Huo diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 523b771..d3c679f 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -126,

Re: [PATCH v4] scsi: ufs: Cleanup completed request without interrupt notification

2020-07-31 Thread Can Guo
Hi Bart, On 2020-08-01 00:51, Bart Van Assche wrote: On 2020-07-31 01:00, Can Guo wrote: AFAIK, sychronization of scsi_done is not a problem here, because scsi layer use the atomic state, namely SCMD_STATE_COMPLETE, of a scsi cmd to prevent the concurrency of abort and real completion of it

Re: [PATCH v6] scsi: ufs: Quiesce all scsi devices before shutdown

2020-08-02 Thread Can Guo
_for_each_sdev(ufshcd_quiesce_sdev); Any reasons why don't use scsi_target_quiesce() here? Thanks, Can Guo. ret = ufshcd_suspend(hba, UFS_SHUTDOWN_PM); out:

Re: [PATCH v4] scsi: ufs: Cleanup completed request without interrupt notification

2020-08-02 Thread Can Guo
Hi Bart, On 2020-08-03 11:12, Bart Van Assche wrote: On 2020-07-31 16:17, Can Guo wrote: For scsi_dma_unmap() part, that is true - we should make it serialized with any other completion paths. I've found it during my fault injection test, so I've made a patch to fix it, but it onl

Re: [PATCH v4] scsi: ufs: Cleanup completed request without interrupt notification

2020-08-02 Thread Can Guo
Hi Stanley, On 2020-08-03 11:00, Stanley Chu wrote: Hi Can, On Sat, 2020-08-01 at 07:17 +0800, Can Guo wrote: Hi Bart, On 2020-08-01 00:51, Bart Van Assche wrote: > On 2020-07-31 01:00, Can Guo wrote: >> AFAIK, sychronization of scsi_done is not a problem here, because scsi >&g

[PATCH v9 1/9] scsi: ufs: Add checks before setting clk-gating states

2020-08-03 Thread Can Guo
Clock gating features can be turned on/off selectively which means its state information is only important if it is enabled. This change makes sure that we only look at state of clk-gating if it is enabled. Signed-off-by: Can Guo Reviewed-by: Avri Altman Reviewed-by: Hongwu Su Reviewed-by

[PATCH v9 3/9] scsi: ufs-qcom: Remove testbus dump in ufs_qcom_dump_dbg_regs

2020-08-03 Thread Can Guo
Dumping testbus registers is heavy enough to cause stability issues sometime, just remove them as of now. Signed-off-by: Can Guo Reviewed-by: Hongwu Su Reviewed-by: Avri Altman Reviewed-by: Bean Huo --- drivers/scsi/ufs/ufs-qcom.c | 32 1 file changed, 32

[PATCH v9 9/9] scsi: ufs: Properly release resources if a task is aborted successfully

2020-08-03 Thread Can Guo
. To fix it, instead of releasing resources "mannually", use the existing func __ufshcd_transfer_req_compl(). This can also eliminate racing of scsi_dma_unmap() from the real completion in IRQ handler path. Signed-off-by: Can Guo CC: Stanley Chu --- drivers/scsi/ufs/ufshcd.c | 5 +--

[PATCH v9 7/9] scsi: ufs: Move dumps in IRQ handler to error handler

2020-08-03 Thread Can Guo
Sometime dumps in IRQ handler are heavy enough to cause system stability issues, move them to error handler and only print basic host regs here. Signed-off-by: Can Guo Reviewed-by: Bean Huo --- drivers/scsi/ufs/ufshcd.c | 23 +++ 1 file changed, 15 insertions(+), 8

[PATCH v9 8/9] scsi: ufs: Fix a racing problem btw error handler and runtime PM ops

2020-08-03 Thread Can Guo
s not hurt since error handler can recover hba runtime PM error. Signed-off-by: Can Guo Reviewed-by: Bean Huo --- drivers/scsi/ufs/ufshcd.c | 84 --- 1 file changed, 50 insertions(+), 34 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/s

[PATCH v9 2/9] ufs: ufs-qcom: Fix race conditions caused by func ufs_qcom_testbus_config

2020-08-03 Thread Can Guo
If ufs_qcom_dump_dbg_regs() calls ufs_qcom_testbus_config() from ufshcd_suspend/resume and/or clk gate/ungate context, pm_runtime_get_sync() and ufshcd_hold() will cause racing problems. Fix this by removing the unnecessary calls of pm_runtime_get_sync() and ufshcd_hold(). Signed-off-by: Can Guo

[PATCH v9 5/9] scsi: ufs: Fix concurrency of error handler and other error recovery paths

2020-08-03 Thread Can Guo
mark link state as UIC_LINK_BROKEN_STATE and schedule the eh_work. In this case, error handler needs to do a full reset and restore to recover the link back to active. Before the link state is recovered to active, ufshcd_uic_pwr_ctrl simply returns -ENOLINK to avoid more errors. Signed-off-by: Can G

[PATCH v9 6/9] scsi: ufs: Recover hba runtime PM error in error handler

2020-08-03 Thread Can Guo
in case any of them has failed to be resumed due to hba runtime resume failure. This is to unblock blk_queue_enter in case there are bios waiting inside it. Signed-off-by: Can Guo Reviewed-by: Bean Huo --- drivers/scsi/ufs/ufshcd.c | 108 ++ 1 file

[PATCH v9 4/9] scsi: ufs: Add some debug infos to ufshcd_print_host_state

2020-08-03 Thread Can Guo
cleanup to some prints in ufshcd_print_host_regs as similar prints are already available in ufshcd_print_host_state. Signed-off-by: Can Guo Reviewed-by: Avri Altman Reviewed-by: Hongwu Su Reviewed-by: Asutosh Das Reviewed-by: Stanley Chu Reviewed-by: Bean Huo --- drivers/scsi/ufs/ufshcd.c

Re: [PATCH v7] scsi: ufs: Quiesce all scsi devices before shutdown

2020-08-03 Thread Can Guo
r_doorbell_clr(hba, U64_MAX); [2] Please let me know your ideas, thanks! Regards, Can Guo. ret = ufshcd_suspend(hba, UFS_SHUTDOWN_PM); out:

Re: [PATCH v7] scsi: ufs: Quiesce all scsi devices before shutdown

2020-08-03 Thread Can Guo
Slightly updated my comments On 2020-08-03 19:50, Can Guo wrote: Hi Stanley, On 2020-08-03 18:04, Stanley Chu wrote: Currently I/O request could be still submitted to UFS device while UFS is working on shutdown flow. This may lead to racing as below scenarios and finally system may crash due

Re: [PATCH v7] scsi: ufs: Quiesce all scsi devices before shutdown

2020-08-03 Thread Can Guo
_device like below. It is to make sure no more PM requests sent to scsi devices (since PM requests are only sent during PM ops). shost_for_each_device(sdev, hba->host) { scsi_autopm_get_device(sdev); scsi_device_quiesce(sdev); } Please let me know which one do y

Re: [PATCH] scsi: ufs: Remove an unpaired ufshcd_scsi_unblock_requests() in err_handler()

2020-08-19 Thread Can Guo
h. Correct the coding mistake. "fixes" tag please, for those who don't read the commit message. Thanks, Avri Already added one in the V2 of it. Thanks, Can Guo. Signed-off-by: Can Guo diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 2b55c2e..b8441ad

Re: [PATCH v9 8/9] scsi: ufs: Fix a racing problem btw error handler and runtime PM ops

2020-08-05 Thread Can Guo
d.o] Error 1 make[2]: *** [scripts/Makefile.build:497: drivers/scsi/ufs] Error 2 make[1]: *** [scripts/Makefile.build:497: drivers/scsi] Error 2 make: *** [Makefile:1764: drivers] Error 2 Thanks Martin, will fix it in next version. Can Guo.

[PATCH 4/9] scsi: ufs: Add some debug infos to ufshcd_print_host_state

2020-08-05 Thread Can Guo
cleanup to some prints in ufshcd_print_host_regs as similar prints are already available in ufshcd_print_host_state. Signed-off-by: Can Guo Reviewed-by: Avri Altman Reviewed-by: Hongwu Su Reviewed-by: Asutosh Das Reviewed-by: Stanley Chu Reviewed-by: Bean Huo diff --git a/drivers/scsi/ufs

[PATCH 3/9] scsi: ufs-qcom: Remove testbus dump in ufs_qcom_dump_dbg_regs

2020-08-05 Thread Can Guo
Dumping testbus registers is heavy enough to cause stability issues sometime, just remove them as of now. Signed-off-by: Can Guo Reviewed-by: Hongwu Su Reviewed-by: Avri Altman Reviewed-by: Bean Huo diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c index 823eccf..6b75338

[PATCH 2/9] ufs: ufs-qcom: Fix race conditions caused by func ufs_qcom_testbus_config

2020-08-05 Thread Can Guo
If ufs_qcom_dump_dbg_regs() calls ufs_qcom_testbus_config() from ufshcd_suspend/resume and/or clk gate/ungate context, pm_runtime_get_sync() and ufshcd_hold() will cause racing problems. Fix this by removing the unnecessary calls of pm_runtime_get_sync() and ufshcd_hold(). Signed-off-by: Can Guo

[PATCH 7/9] scsi: ufs: Move dumps in IRQ handler to error handler

2020-08-05 Thread Can Guo
Sometime dumps in IRQ handler are heavy enough to cause system stability issues, move them to error handler and only print basic host regs here. Signed-off-by: Can Guo Reviewed-by: Bean Huo diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 6a10003..a79fbbd 100644 --- a

[PATCH 6/9] scsi: ufs: Recover hba runtime PM error in error handler

2020-08-05 Thread Can Guo
in case any of them has failed to be resumed due to hba runtime resume failure. This is to unblock blk_queue_enter in case there are bios waiting inside it. Signed-off-by: Can Guo Reviewed-by: Bean Huo diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 2604016..6a10003

[PATCH 5/9] scsi: ufs: Fix concurrency of error handler and other error recovery paths

2020-08-05 Thread Can Guo
mark link state as UIC_LINK_BROKEN_STATE and schedule the eh_work. In this case, error handler needs to do a full reset and restore to recover the link back to active. Before the link state is recovered to active, ufshcd_uic_pwr_ctrl simply returns -ENOLINK to avoid more errors. Signed-off-by: Can G

[PATCH 8/9] scsi: ufs: Fix a racing problem btw error handler and runtime PM ops

2020-08-05 Thread Can Guo
does not hurt since error handler can recover hba runtime PM error. Signed-off-by: Can Guo Reviewed-by: Bean Huo diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index a79fbbd..b2947ab 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -126,

[PATCH 9/9] scsi: ufs: Properly release resources if a task is aborted successfully

2020-08-05 Thread Can Guo
. To fix it, instead of releasing resources "mannually", use the existing func __ufshcd_transfer_req_compl(). This can also eliminate racing of scsi_dma_unmap() from the real completion in IRQ handler path. Signed-off-by: Can Guo CC: Stanley Chu Reviewed-by: Stanley Chu diff --git

[PATCH 1/9] scsi: ufs: Add checks before setting clk-gating states

2020-08-05 Thread Can Guo
Clock gating features can be turned on/off selectively which means its state information is only important if it is enabled. This change makes sure that we only look at state of clk-gating if it is enabled. Signed-off-by: Can Guo Reviewed-by: Avri Altman Reviewed-by: Hongwu Su Reviewed-by

Re: [PATCH v7 0/4] scsi: ufs: Add Host Performance Booster Support

2020-08-06 Thread Can Guo
tag to the very first patch (changes to ufshcd.h), but not the whole series. Please remove those tags accordingly. Thanks, Can Guo.

Re: [PATCH v1] scsi: ufs: no need to send one Abort Task TM in case the task in DB was cleared

2020-08-06 Thread Can Guo
ump host infos/regs like it does in the old code. If a cmd was completed but without a notifying intr, this is kind of a problem that we/host should look into, because it's pasted at least 30 sec since the cmd was sent, so those dumps are necessary to debug the problem. How ab

Re: [PATCH v1] scsi: ufs: no need to send one Abort Task TM in case the task in DB was cleared

2020-08-06 Thread Can Guo
nt of this part? Thanks, Can Guo. >} > >/* Print Transfer Request of aborted task */ Hi Can Thanks, do you mean that change to like this: Author: Bean Huo Date: Thu Aug 6 11:34:45 2020 +0200 scsi: ufs: no need to send one Abort Task TM in case the task in was clea

  1   2   3   4   5   6   >