scsi: ufs: dump hw regs on link failures

Dump host state, power info and host/vendor specific registers
on link failures. This provides useful info to debug the failures.

Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
Venkat Gopalakrishnan 2017-02-03 16:58:24 -08:00 committed by Martin K. Petersen
parent 9c46b86762
commit 7942f7b568
1 changed files with 11 additions and 1 deletions

View File

@ -3554,6 +3554,12 @@ static int ufshcd_uic_pwr_ctrl(struct ufs_hba *hba, struct uic_command *cmd)
ret = (status != PWR_OK) ? status : -1; ret = (status != PWR_OK) ? status : -1;
} }
out: out:
if (ret) {
ufshcd_print_host_state(hba);
ufshcd_print_pwr_info(hba);
ufshcd_print_host_regs(hba);
}
spin_lock_irqsave(hba->host->host_lock, flags); spin_lock_irqsave(hba->host->host_lock, flags);
hba->active_uic_cmd = NULL; hba->active_uic_cmd = NULL;
hba->uic_async_done = NULL; hba->uic_async_done = NULL;
@ -4146,8 +4152,12 @@ link_startup:
ret = ufshcd_make_hba_operational(hba); ret = ufshcd_make_hba_operational(hba);
out: out:
if (ret) if (ret) {
dev_err(hba->dev, "link startup failed %d\n", ret); dev_err(hba->dev, "link startup failed %d\n", ret);
ufshcd_print_host_state(hba);
ufshcd_print_pwr_info(hba);
ufshcd_print_host_regs(hba);
}
return ret; return ret;
} }