> >> hba->force_reset = false; > >> spin_unlock_irqrestore(hba->host->host_lock, flags); > >> err = ufshcd_reset_and_restore(hba); @@ -6232,6 > >> +6245,13 @@ static void ufshcd_err_handler(struct Scsi_Host > >> *host) > >> dev_err_ratelimited(hba->dev, "%s: exit: > >> saved_err 0x%x saved_uic_err 0x%x", > >> __func__, hba->saved_err, hba->saved_uic_err); > >> } > >> + /* Exit in an operational state or dead */ > >> + if (hba->ufshcd_state != UFSHCD_STATE_OPERATIONAL && > >> + hba->ufshcd_state != UFSHCD_STATE_ERROR) { > >> + if (--retries) > >> + goto again; > > Why do you need to retry here as well? > > Thanks for looking at this. > > It shouldn't hurt to retry bringing the device back to life. The alternative is > UFSHCD_STATE_ERROR which means dead. > > > ufshcd_reset_and_restore() already exists only if operational or dead? > > ufshcd_reset_and_restore() isn't the only path. There are also > ufshcd_quirk_dl_nac_errors() and ufshcd_config_pwr_mode() and in the > future perhaps others. > > This seems the right place to ensure that the error handler guarantees > operational (or dead) status. OK. Thanks. Avri