scsi: ufs: fix error recovery after the hibern8 exit failure
authorYaniv Gardi <ygardi@codeaurora.org>
Mon, 1 Feb 2016 13:02:45 +0000 (15:02 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 24 Feb 2016 02:27:02 +0000 (21:27 -0500)
commit53c12d0ef6fcb77aaaa4640f3e17ffe2fd9cffa0
tree3f02dd78de5403937b3c09dff482d893db49fcb3
parent87d0b4a6da338464efdb9d20b94572ff60ee1f95
scsi: ufs: fix error recovery after the hibern8 exit failure

Hibern8 exit can be called from 3 different contexts:
    - ufshcd_hibern8_exit_work
    - ufshcd_ungate_work
    - runtime/system resume

If hibern8 exit fails for some reason then we try to bring the link to
active state by link startup but this recovery mechanism results into
deadlock or errors from first 2 context listed above. This change fixes
the recovery by adding proper error handling mechanism.

Reviewed-by: Gilad Broner <gbroner@codeaurora.org>
Reviewed-by: Dolev Raviv <draviv@codeaurora.org>
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ufs/ufshcd.c