• Sujit Reddy Thumma's avatar
    ufs: improve init sequence · 1d337ec2
    Sujit Reddy Thumma authored
    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: default avatarSujit Reddy Thumma <sthumma@codeaurora.org>
    Signed-off-by: default avatarDolev Raviv <draviv@codeaurora.org>
    Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
    1d337ec2
ufshcd.h 11.5 KB