scsi: ufs: core: Do not exit ufshcd_err_handler() unless operational or dead
authorAdrian Hunter <adrian.hunter@intel.com>
Sat, 2 Oct 2021 15:45:50 +0000 (18:45 +0300)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 5 Oct 2021 02:20:38 +0000 (22:20 -0400)
commit87bf6a6bbe8bd62b5924b00161d28a0d6df151ca
tree2a3a549439028fbd53ddb96c7e51309c5d21ef9a
parent54a4045342a8bffabde1827bfd6d86b63163111d
scsi: ufs: core: Do not exit ufshcd_err_handler() unless operational or dead

Callers of ufshcd_err_handler() expect it to return in an operational
state. However, the code does not check the state before exiting.

Add a check for the state and perform retries until either success or the
maximum number of retries is reached.

Link: https://lore.kernel.org/r/20211002154550.128511-3-adrian.hunter@intel.com
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ufs/ufshcd.c