From 991475c10bec7db04853659495c291b7bca48c9d Mon Sep 17 00:00:00 2001 From: Maulik Shah Date: Thu, 29 Jul 2021 18:07:55 +0530 Subject: [PATCH] soc: qcom: sys_pm_vx: Print LPM exit log and correct timestamp Print the LPM enter/exit alternative for only timestamp lines and no DRV vote present. While at this also print the timestamp shifted by time shift given. Change-Id: I03c6e45d49a6c7c0af17dc7dad4f42f8806939a6 Signed-off-by: Maulik Shah --- drivers/soc/qcom/sys_pm_vx.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/soc/qcom/sys_pm_vx.c b/drivers/soc/qcom/sys_pm_vx.c index f9a181906948..771f374a3829 100644 --- a/drivers/soc/qcom/sys_pm_vx.c +++ b/drivers/soc/qcom/sys_pm_vx.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-only -/* Copyright (c) 2020, The Linux Foundation. All rights reserved. */ +/* Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. */ #define pr_fmt(fmt) "%s: " fmt, __func__ @@ -113,6 +113,7 @@ static int read_vx_data(struct vx_platform_data *pd, struct vx_log *log) data[i].ts = read_word(base, itr); if (!data[i].ts) break; + data[i].ts <<= hdr->flags.ts_shift; vx = kcalloc(ALIGN(pd->ndrv, 4), sizeof(*vx), GFP_KERNEL); if (!vx) goto no_mem; @@ -144,6 +145,7 @@ static void show_vx_data(struct vx_platform_data *pd, struct vx_log *log, struct vx_header *hdr = &log->header; struct vx_data *data; u32 prev; + bool from_exit = false; seq_printf(seq, "Mode : %s\n" "Duration (ms) : %u\n" @@ -169,7 +171,13 @@ static void show_vx_data(struct vx_platform_data *pd, struct vx_log *log, for (j = 0, prev = data->drv_vx[0]; j < pd->ndrv; j++) prev |= data->drv_vx[j]; if (!prev) { - seq_printf(seq, "%s Enter", MODE_STR(hdr->mode.type)); + if (!from_exit) { + seq_printf(seq, "%s Enter\n", MODE_STR(hdr->mode.type)); + from_exit = true; + } else { + seq_printf(seq, "%s Exit\n", MODE_STR(hdr->mode.type)); + from_exit = false; + } continue; } for (j = 0; j < pd->ndrv; j++)