2018-02-21 05:08:07

by Asutosh Das (asd)

[permalink] [raw]
Subject: [PATCH 1/9] scsi: ufs: Allowing power mode change

From: Yaniv Gardi <[email protected]>

Due to M-PHY issues, moving from HS to any other mode or gear or
even Hibern8 causes some un-predicted behavior of the device.
This patch fixes this issues.

Signed-off-by: Yaniv Gardi <[email protected]>
Signed-off-by: Subhash Jadavani <[email protected]>
Signed-off-by: Can Guo <[email protected]>
Signed-off-by: Asutosh Das <[email protected]>
---
drivers/scsi/ufs/ufshcd.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 011c336..d74d529 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -4167,9 +4167,13 @@ static int ufshcd_link_startup(struct ufs_hba *hba)
goto out;
} while (ret && retries--);

- if (ret)
+ if (ret) {
/* failed to get the link up... retire */
goto out;
+ } else {
+ ufshcd_dme_set(hba, UIC_ARG_MIB(TX_LCC_ENABLE), 0);
+ ufshcd_dme_set(hba, UIC_ARG_MIB(TX_LCC_ENABLE), 1);
+ }

if (link_startup_again) {
link_startup_again = false;
--
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.



2018-02-23 05:11:22

by Kyuho Choi

[permalink] [raw]
Subject: Re: [PATCH 1/9] scsi: ufs: Allowing power mode change

Hi Asutosh,

I've simple question in below.

On 2/21/18, Asutosh Das <[email protected]> wrote:
> From: Yaniv Gardi <[email protected]>
>
> Due to M-PHY issues, moving from HS to any other mode or gear or
> even Hibern8 causes some un-predicted behavior of the device.
> This patch fixes this issues.
>
> Signed-off-by: Yaniv Gardi <[email protected]>
> Signed-off-by: Subhash Jadavani <[email protected]>
> Signed-off-by: Can Guo <[email protected]>
> Signed-off-by: Asutosh Das <[email protected]>
> ---
> drivers/scsi/ufs/ufshcd.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> index 011c336..d74d529 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -4167,9 +4167,13 @@ static int ufshcd_link_startup(struct ufs_hba *hba)
> goto out;
> } while (ret && retries--);
>
> - if (ret)
> + if (ret) {
> /* failed to get the link up... retire */
> goto out;
> + } else {
> + ufshcd_dme_set(hba, UIC_ARG_MIB(TX_LCC_ENABLE), 0);
> + ufshcd_dme_set(hba, UIC_ARG_MIB(TX_LCC_ENABLE), 1);
> + }
>

Every ufs host has same issue and affected?.

> if (link_startup_again) {
> link_startup_again = false;
> --
> Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center,
> Inc.
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux
> Foundation Collaborative Project.
>
>

2018-02-23 07:05:00

by Asutosh Das (asd)

[permalink] [raw]
Subject: Re: [PATCH 1/9] scsi: ufs: Allowing power mode change

On 2/23/2018 10:40 AM, Kyuho Choi wrote:
> Hi Asutosh,
>
> I've simple question in below.
>
> On 2/21/18, Asutosh Das <[email protected]> wrote:
>> From: Yaniv Gardi <[email protected]>
>>
>> Due to M-PHY issues, moving from HS to any other mode or gear or
>> even Hibern8 causes some un-predicted behavior of the device.
>> This patch fixes this issues.
>>
>> Signed-off-by: Yaniv Gardi <[email protected]>
>> Signed-off-by: Subhash Jadavani <[email protected]>
>> Signed-off-by: Can Guo <[email protected]>
>> Signed-off-by: Asutosh Das <[email protected]>
>> ---
>> drivers/scsi/ufs/ufshcd.c | 6 +++++-
>> 1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
>> index 011c336..d74d529 100644
>> --- a/drivers/scsi/ufs/ufshcd.c
>> +++ b/drivers/scsi/ufs/ufshcd.c
>> @@ -4167,9 +4167,13 @@ static int ufshcd_link_startup(struct ufs_hba *hba)
>> goto out;
>> } while (ret && retries--);
>>
>> - if (ret)
>> + if (ret) {
>> /* failed to get the link up... retire */
>> goto out;
>> + } else {
>> + ufshcd_dme_set(hba, UIC_ARG_MIB(TX_LCC_ENABLE), 0);
>> + ufshcd_dme_set(hba, UIC_ARG_MIB(TX_LCC_ENABLE), 1);
>> + }
>>
>
> Every ufs host has same issue and affected?.
>
>> if (link_startup_again) {
>> link_startup_again = false;
>> --
>> Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center,
>> Inc.
>> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux
>> Foundation Collaborative Project.
>>
>>
Hi Choi
Thanks for the review.

No - I can't say if every host has the same issue. However, I get your
point. It could be done with a quirk.

I'll fix this in v2 after collating all the comments from the rest of
the patches.

-asd

--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a
Linux Foundation Collaborative Project