[RAMEN9610-14257] [COMMON] scsi: ufs: Move SFR dump to workqueue from ISR.
authorJaeHun Jung <jh0801.jung@samsung.com>
Thu, 4 Apr 2019 10:51:09 +0000 (19:51 +0900)
committerhskang <hs1218.kang@samsung.com>
Sun, 21 Apr 2019 09:10:12 +0000 (18:10 +0900)
Too many prints in the ISR when UFS error case.
So, Move to workqueue for system.

Change-Id: I213f265c0024b75220ce594c271f68a43c28e4dd
Signed-off-by: JaeHun Jung <jh0801.jung@samsung.com>
drivers/scsi/ufs/ufshcd.c

index ed0ee31db676b209f385ef43e932ddcad2220e9c..cb383551f4ccb0f72cc63e1f377e6b6801bfdc7a 100644 (file)
@@ -5457,6 +5457,21 @@ static void ufshcd_err_handler(struct work_struct *work)
        if (gpio_is_valid(info->ufs_reset_n_gpio))
                dev_info(hba->dev, "%s: RESET_N: 0x%08x\n", __func__, gpio_get_value(info->ufs_reset_n_gpio));
 
+       /* dump controller state before resetting */
+       if (hba->saved_err & (INT_FATAL_ERRORS | UIC_ERROR)) {
+               bool pr_prdt = !!(hba->saved_err &
+                               SYSTEM_BUS_FATAL_ERROR);
+
+               dev_err(hba->dev, "%s: saved_err 0x%x saved_uic_err 0x%x\n",
+                               __func__, hba->saved_err,
+                               hba->saved_uic_err);
+
+               ufshcd_print_host_regs(hba);
+               ufshcd_print_pwr_info(hba);
+               ufshcd_print_tmrs(hba, hba->outstanding_tasks);
+               ufshcd_print_trs(hba, hba->outstanding_reqs, pr_prdt);
+       }
+
        spin_lock_irqsave(hba->host->host_lock, flags);
        if (hba->ufshcd_state == UFSHCD_STATE_RESET)
                goto out;
@@ -5690,21 +5705,6 @@ static void ufshcd_check_errors(struct ufs_hba *hba)
 
                        hba->ufshcd_state = UFSHCD_STATE_EH_SCHEDULED;
 
-                       /* dump controller state before resetting */
-                       if (hba->saved_err & (INT_FATAL_ERRORS | UIC_ERROR)) {
-                               bool pr_prdt = !!(hba->saved_err &
-                                               SYSTEM_BUS_FATAL_ERROR);
-
-                               dev_err(hba->dev, "%s: saved_err 0x%x saved_uic_err 0x%x\n",
-                                       __func__, hba->saved_err,
-                                       hba->saved_uic_err);
-
-                               ufshcd_print_host_regs(hba);
-                               ufshcd_print_pwr_info(hba);
-                               ufshcd_print_tmrs(hba, hba->outstanding_tasks);
-                               ufshcd_print_trs(hba, hba->outstanding_reqs,
-                                                       pr_prdt);
-                       }
                        schedule_work(&hba->eh_work);
                }
        }