diff mbox

scsi: ufs: check link active or not after switch to HS mode

Message ID 20170624114405.18475-1-zangleigang@hisilicon.com (mailing list archive)
State Changes Requested, archived
Headers show

Commit Message

Zang Leigang June 24, 2017, 11:44 a.m. UTC
Some device can successfully link and switch to HS mode. But failed
to do more. ufshcd_verify_dev_init can help to find this earlier.

Signed-off-by: Zang Leigang <zangleigang@hisilicon.com>

Comments

subhashj@codeaurora.org June 28, 2017, 11:48 p.m. UTC | #1
On 2017-06-24 04:44, Zang Leigang wrote:
> Some device can successfully link and switch to HS mode. But failed
> to do more. ufshcd_verify_dev_init can help to find this earlier.
> 
> Signed-off-by: Zang Leigang <zangleigang@hisilicon.com>
> 
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> index ffe8d8608818..eb03388fc4bd 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -6373,6 +6373,14 @@ static int ufshcd_probe_hba(struct ufs_hba *hba)
>  					__func__, ret);
>  			goto out;
>  		}
> +
> +		/*
> +		 * Some device lost link after switch to HS mode. Check if
> +		 * connect is established here.
> +		 */

I have never across such failures. If this issue is limited to certain 
device vendors then I don't think if we want to do send NOP 
unconditionally for all the devices.
We should probably add quirk for these failed devices and send NOP only 
for such devices.


> +		ret = ufshcd_verify_dev_init(hba);
> +		if (ret)
> +			goto out;
>  	}
> 
>  	/* set the state as operational after switching to desired gear */
Zang Leigang June 29, 2017, 3:04 a.m. UTC | #2
On Wed, Jun 28, 2017 at 04:48:21PM -0700, Subhash Jadavani wrote:
> On 2017-06-24 04:44, Zang Leigang wrote:
> >Some device can successfully link and switch to HS mode. But failed
> >to do more. ufshcd_verify_dev_init can help to find this earlier.
> >
> >Signed-off-by: Zang Leigang <zangleigang@hisilicon.com>
> >
> >diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> >index ffe8d8608818..eb03388fc4bd 100644
> >--- a/drivers/scsi/ufs/ufshcd.c
> >+++ b/drivers/scsi/ufs/ufshcd.c
> >@@ -6373,6 +6373,14 @@ static int ufshcd_probe_hba(struct ufs_hba *hba)
> > 					__func__, ret);
> > 			goto out;
> > 		}
> >+
> >+		/*
> >+		 * Some device lost link after switch to HS mode. Check if
> >+		 * connect is established here.
> >+		 */
> 
> I have never across such failures. If this issue is limited to
> certain device vendors then I don't think if we want to do send NOP
> unconditionally for all the devices.
> We should probably add quirk for these failed devices and send NOP
> only for such devices.

I have double checked this issue, it's already fixed. This patch doesn't need
any more. Thanks.
> 
> 
> >+		ret = ufshcd_verify_dev_init(hba);
> >+		if (ret)
> >+			goto out;
> > 	}
> >
> > 	/* set the state as operational after switching to desired gear */
> 
> -- 
> The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
> a Linux Foundation Collaborative Project
diff mbox

Patch

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index ffe8d8608818..eb03388fc4bd 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -6373,6 +6373,14 @@  static int ufshcd_probe_hba(struct ufs_hba *hba)
 					__func__, ret);
 			goto out;
 		}
+
+		/*
+		 * Some device lost link after switch to HS mode. Check if
+		 * connect is established here.
+		 */
+		ret = ufshcd_verify_dev_init(hba);
+		if (ret)
+			goto out;
 	}
 
 	/* set the state as operational after switching to desired gear */