From 2ea8cc4dc6cf12f34e4ebaba078924dde0a7bd20 Mon Sep 17 00:00:00 2001 From: hgchu Date: Fri, 12 Jan 2018 17:19:01 +0900 Subject: [PATCH] [COMMON] ufs: Add UFS cmd logging Change-Id: I1351d79793480cf8ebf596f8860c976ee8c607d2 Signed-off-by: hgchu --- drivers/scsi/ufs/Kconfig | 12 ++++++++++++ drivers/scsi/ufs/ufshcd.c | 6 ++++++ 2 files changed, 18 insertions(+) diff --git a/drivers/scsi/ufs/Kconfig b/drivers/scsi/ufs/Kconfig index 4df1cc00826a..62c08f9bbbc6 100644 --- a/drivers/scsi/ufs/Kconfig +++ b/drivers/scsi/ufs/Kconfig @@ -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 diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 224d75dc75dc..28ddf6ede645 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -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", -- 2.20.1