OSDN Git Service

ufs: improve init sequence
authorSujit Reddy Thumma <sthumma@codeaurora.org>
Thu, 25 Sep 2014 12:32:26 +0000 (15:32 +0300)
committerChristoph Hellwig <hch@lst.de>
Wed, 1 Oct 2014 11:11:21 +0000 (13:11 +0200)
commit1d337ec2f35e69a046dab0cc77e64e68d1cdcd8b
tree88d672dad6fa282cd02e242d606a3340e42f209f
parentda461cec9a1ff0a074cd1db47598ba36a1686ef4
ufs: improve init sequence

In ->hce_enable_notify() callback the vendor specific initialization
may carry out additional DME configuration using UIC commands and
hence the UIC command completion interrupt enable bit should be set
before the post reset notification.
Add retries if the link-startup fails. This is required since due to
hardware timing issues, the Uni-Pro link-startup might fail. The UFS
HCI recovery procedure contradicts the Uni-Pro sequence. The UFS HCI
specifies to resend DME_LINKSTARTUP command after IS.ULLS (link-lost
interrupt) is received. The Uni-Pro specifies that if link-startup
fails the link is in "down" state. The link-lost is indicated to the
DME user only when the link is up. Hence, the UFS HCI recovery procedure
of waiting for IS.ULLS and retrying link-startup may not work properly.

At the end, if detection fails, power off (disable clocks, regulators,
phy) if the UFS device detection fails. This saves power while UFS device
is not embedded into the system.

Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
Signed-off-by: Dolev Raviv <draviv@codeaurora.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/scsi/ufs/ufshcd.c
drivers/scsi/ufs/ufshcd.h