[COMMON] ufs: Add UFS cmd logging
authorhgchu <hg.chu@samsung.com>
Fri, 12 Jan 2018 08:19:01 +0000 (17:19 +0900)
committerJaeHun Jung <jh0801.jung@samsung.com>
Tue, 8 May 2018 08:20:45 +0000 (17:20 +0900)
Change-Id: I1351d79793480cf8ebf596f8860c976ee8c607d2
Signed-off-by: hgchu <hg.chu@samsung.com>
drivers/scsi/ufs/Kconfig
drivers/scsi/ufs/ufshcd.c

index 4df1cc00826a2b5512d30c9be4e2ba64fc37c5b5..62c08f9bbbc6a0a2f2d5860fcd186ff00f81062a 100644 (file)
@@ -103,6 +103,18 @@ config SCSI_UFS_ASYNC_RELINK
 
          If unsure, say N.
 
+config SCSI_UFS_CMD_LOGGING
+       tristate "UFS cmd loggging support"
+       depends on SCSI_UFSHCD && SCSI_UFSHCD_PLATFORM
+       ---help---
+         This feature is to support UFS cmd logging.
+         When UFS cmd transferred to UFS HCI
+         various data logs for debugging purpose.
+
+         If you want to enable this feature, say Y or M here.
+
+         If unsure, say N.
+
 config SCSI_UFS_QCOM
        tristate "QCOM specific hooks to UFS controller platform driver"
        depends on SCSI_UFSHCD_PLATFORM && ARCH_QCOM
index 224d75dc75dc53e2ef187da659e4364f22ca4c56..28ddf6ede645d72b1774bd5cc14b4608a9e6b15b 100644 (file)
@@ -2530,6 +2530,9 @@ static int ufshcd_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
        spin_lock_irqsave(hba->host->host_lock, flags);
        if (hba->vops && hba->vops->set_nexus_t_xfer_req)
                hba->vops->set_nexus_t_xfer_req(hba, tag, lrbp->cmd);
+#ifdef CONFIG_SCSI_UFS_CMD_LOGGING
+       exynos_ufs_cmd_log_start(hba, cmd);
+#endif
        ufshcd_send_command(hba, tag);
 
        if (hba->monitor.flag & UFSHCD_MONITOR_LEVEL1)
@@ -4970,6 +4973,9 @@ static void __ufshcd_transfer_req_compl(struct ufs_hba *hba, int reason,
                        clear_bit_unlock(index, &hba->lrb_in_use);
                        /* Do not touch lrbp after scsi done */
                        cmd->scsi_done(cmd);
+#ifdef CONFIG_SCSI_UFS_CMD_LOGGING
+                       exynos_ufs_cmd_log_end(hba, index);
+#endif
                        __ufshcd_release(hba);
                        if (hba->monitor.flag & UFSHCD_MONITOR_LEVEL1)
                                dev_info(hba->dev, "Transfer Done(%d)\n",