From aee9809c8797003db2ad50443c71a26559b576a8 Mon Sep 17 00:00:00 2001 From: hgchu Date: Fri, 12 Jan 2018 13:28:54 +0900 Subject: [PATCH] scsi: ufs: load debugging information to memory Change-Id: I88953cc61f44795b5c90186a0214e2c659f31b67 Signed-off-by: hgchu --- drivers/scsi/ufs/ufshcd.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index ae6b90659e32..a4e2a7b34544 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -3737,7 +3737,9 @@ static int ufshcd_uic_pwr_ctrl(struct ufs_hba *hba, struct uic_command *cmd) ret = (status != PWR_OK) ? status : -1; } out: + /* Dump debugging information to system memory */ if (ret) { + ufshcd_vops_dbg_register_dump(hba); ufshcd_print_host_state(hba); ufshcd_print_pwr_info(hba); ufshcd_print_host_regs(hba); @@ -5286,6 +5288,8 @@ static void ufshcd_err_handler(struct work_struct *work) pm_runtime_get_sync(hba->dev); ufshcd_hold(hba, false); + /* Dump debugging information to system memory */ + ufshcd_vops_dbg_register_dump(hba); spin_lock_irqsave(hba->host->host_lock, flags); if (hba->ufshcd_state == UFSHCD_STATE_RESET) goto out; @@ -5737,6 +5741,8 @@ static int ufshcd_eh_device_reset_handler(struct scsi_cmnd *cmd) hba = shost_priv(host); tag = cmd->request->tag; + /* Dump debugging information to system memory */ + ufshcd_vops_dbg_register_dump(hba); lrbp = &hba->lrb[tag]; err = ufshcd_issue_tm_cmd(hba, lrbp->lun, 0, UFS_LOGICAL_RESET, &resp); if (err || resp != UPIU_TASK_MANAGEMENT_FUNC_COMPL) { @@ -5825,6 +5831,8 @@ static int ufshcd_abort(struct scsi_cmnd *cmd) return ufshcd_eh_host_reset_handler(cmd); ufshcd_hold(hba, false); + /* Dump debugging information to system memory */ + ufshcd_vops_dbg_register_dump(hba); reg = ufshcd_readl(hba, REG_UTP_TRANSFER_REQ_DOOR_BELL); /* If command is already aborted/completed, return SUCCESS */ if (!(test_bit(tag, &hba->outstanding_reqs))) { -- 2.20.1