scsi: ufs: issue link starup 2 times if device isn't active
authorsubhashj@codeaurora.org <subhashj@codeaurora.org>
Tue, 4 Apr 2017 19:32:20 +0000 (19:32 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 12 Apr 2017 10:41:19 +0000 (12:41 +0200)
commitc5fc946a15dc2da428f4cca19ed5be1ad20dff30
tree328b16d6940b8b90be0bb2965b6656154ade5f9b
parenta17bddc4a78102ab55c7dbf76018b91e85694b07
scsi: ufs: issue link starup 2 times if device isn't active

[ Upstream commit 7caf489b99a42a9017ef3d733912aea8794677e7 ]

If we issue the link startup to the device while its UniPro state is
LinkDown (and device state is sleep/power-down) then link startup
will not move the device state to Active. Device will only move to
active state if the link starup is issued when its UniPro state is
LinkUp. So in this case, we would have to issue the link startup 2
times to make sure that device moves to active state.

Reviewed-by: Gilad Broner <gbroner@codeaurora.org>
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/scsi/ufs/ufshcd.c