scsi: ufs: load debugging information to memory
authorhgchu <hg.chu@samsung.com>
Fri, 12 Jan 2018 04:28:54 +0000 (13:28 +0900)
committerJaeHun Jung <jh0801.jung@samsung.com>
Tue, 8 May 2018 08:20:27 +0000 (17:20 +0900)
Change-Id: I88953cc61f44795b5c90186a0214e2c659f31b67
Signed-off-by: hgchu <hg.chu@samsung.com>
drivers/scsi/ufs/ufshcd.c

index ae6b90659e32fbcf9236608c1a6677fcc4e5ad80..a4e2a7b3454414a37a4afe5664a0277b924abfc6 100644 (file)
@@ -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))) {