From: HeonGwang Chu Date: Tue, 20 Jun 2017 07:45:54 +0000 (+0900) Subject: [COMMON] scsi: ufs: add secure log X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=db1a0961845805ac57357a3f319cb4664a833501;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [COMMON] scsi: ufs: add secure log Change-Id: I28257ceec3f3c7ae8186af2099a075535331b7ac Signed-off-by: HeonGwang Chu --- diff --git a/drivers/scsi/ufs/ufs-exynos-dbg.c b/drivers/scsi/ufs/ufs-exynos-dbg.c index 0d5bfb396b79..a4a2ff8dc7b4 100644 --- a/drivers/scsi/ufs/ufs-exynos-dbg.c +++ b/drivers/scsi/ufs/ufs-exynos-dbg.c @@ -971,8 +971,8 @@ static void exynos_ufs_get_sfr(struct ufs_hba *hba, cfg->val = ufshcd_readl(hba, cfg->offset); else if (sel_api == LOG_VS_HCI_SFR) cfg->val = hci_readl(ufs, cfg->offset); -// else if (sel_api == LOG_FMP_SFR) -// cfg->val = exynos_smc(SMC_CMD_FMP_DUMP, 0, 0, cfg->offset); + else if (sel_api == LOG_FMP_SFR) + cfg->val = exynos_smc(SMC_CMD_FMP_SMU_DUMP, 0, 0, cfg->offset); else if (sel_api == LOG_UNIPRO_SFR) cfg->val = unipro_readl(ufs, cfg->offset); else if (sel_api == LOG_PMA_SFR) @@ -1116,8 +1116,8 @@ void exynos_ufs_dump_uic_info(struct ufs_hba *hba) { struct exynos_ufs *ufs = to_exynos_ufs(hba); -// /* secure log */ -// exynos_smc(SMC_CMD_UFS_LOG, 1, 0, hba->secure_log.paddr); + /* secure log */ + exynos_smc(SMC_CMD_UFS_LOG, 1, 0, hba->secure_log.paddr); exynos_ufs_get_sfr(hba, ufs->debug.sfr); exynos_ufs_get_attr(hba, ufs->debug.attr); @@ -1163,8 +1163,8 @@ int exynos_ufs_init_dbg(struct ufs_hba *hba) list_add_tail(&exynos_clki->list, &ufs->debug.misc.clk_list_head); } -// hba->secure_log.paddr = exynos_ss_get_spare_paddr(0); -// hba->secure_log.vaddr = (u32 *)exynos_ss_get_spare_vaddr(0); + hba->secure_log.paddr = exynos_ss_get_spare_paddr(0); + hba->secure_log.vaddr = (u32 *)exynos_ss_get_spare_vaddr(0); return 0; } diff --git a/drivers/scsi/ufs/ufs-exynos.c b/drivers/scsi/ufs/ufs-exynos.c index 4e3eb39aae00..50c83c33aad2 100644 --- a/drivers/scsi/ufs/ufs-exynos.c +++ b/drivers/scsi/ufs/ufs-exynos.c @@ -648,7 +648,7 @@ success: exynos_ufs_dev_hw_reset(hba); /* secure log */ -// exynos_smc(SMC_CMD_LOG, 0, 0, 2); + exynos_smc(SMC_CMD_UFS_LOG, 0, 0, 0); out: return; } @@ -893,7 +893,7 @@ static int __exynos_ufs_resume(struct ufs_hba *hba, enum ufs_pm_op pm_op) exynos_ufs_smu_resume(ufs); /* secure log */ -// exynos_smc(SMC_CMD_LOG, 0, 0, 2); + exynos_smc(SMC_CMD_UFS_LOG, 0, 0, 0); if (ufshcd_is_clkgating_allowed(hba)) clk_disable_unprepare(ufs->clk_hci); diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 9cfb410f88b4..fbf2e95e2a85 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -5921,6 +5921,9 @@ static int ufshcd_eh_device_reset_handler(struct scsi_cmnd *cmd) hba = shost_priv(host); tag = cmd->request->tag; + /* secure log */ + exynos_smc(SMC_CMD_UFS_LOG, 1, 0, hba->secure_log.paddr); + /* Dump debugging information to system memory */ ufshcd_vops_dbg_register_dump(hba); exynos_ufs_show_uic_info(hba); @@ -6013,6 +6016,8 @@ static int ufshcd_abort(struct scsi_cmnd *cmd) if (lrbp->lun == UFS_UPIU_UFS_DEVICE_WLUN) return ufshcd_eh_host_reset_handler(cmd); + /* secure log */ + exynos_smc(SMC_CMD_UFS_LOG, 1, 0, hba->secure_log.paddr); if (cmd->cmnd[0] == READ_10 || cmd->cmnd[0] == WRITE_10) { unsigned long lba = (cmd->cmnd[2] << 24) |