From 37cdc4bc4f59a47bf1ee9308768ffcf2abd37040 Mon Sep 17 00:00:00 2001 From: Bhaumik Bhatt Date: Tue, 22 Dec 2020 11:49:22 -0800 Subject: [PATCH] bus: mhi: host: Introduce and use fast suspend counter MHI fast suspend state change counter can be used to track the number of times device enters the state. Introduce and use it for accurate tracking of MHI low power states. Change-Id: Ibaa0428d5ba13b7776a0c9af58a357f59bb9eda5 Signed-off-by: Bhaumik Bhatt Signed-off-by: Lazarus Motha --- drivers/bus/mhi/host/debugfs.c | 4 ++-- include/linux/mhi.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/bus/mhi/host/debugfs.c b/drivers/bus/mhi/host/debugfs.c index cfec7811dfbb..55dd7375c06f 100644 --- a/drivers/bus/mhi/host/debugfs.c +++ b/drivers/bus/mhi/host/debugfs.c @@ -25,8 +25,8 @@ static int mhi_debugfs_states_show(struct seq_file *m, void *d) mhi_cntrl->wake_set ? "true" : "false"); /* counters */ - seq_printf(m, "M0: %u M2: %u M3: %u", mhi_cntrl->M0, mhi_cntrl->M2, - mhi_cntrl->M3); + seq_printf(m, "M0: %u M2: %u M3: %u, M3_fast: %u", mhi_cntrl->M0, + mhi_cntrl->M2, mhi_cntrl->M3, mhi_cntrl->M3_fast); seq_printf(m, " device wake: %u pending packets: %u\n", atomic_read(&mhi_cntrl->dev_wake), diff --git a/include/linux/mhi.h b/include/linux/mhi.h index bac68bbd7f68..3ba339d087b8 100644 --- a/include/linux/mhi.h +++ b/include/linux/mhi.h @@ -354,7 +354,7 @@ struct mhi_controller_config { * @dev_state: MHI device state * @dev_wake: Device wakeup count * @pending_pkts: Pending packets for the controller - * @M0, M2, M3: Counters to track number of device MHI state changes + * @M0, M2, M3, M3_fast: Counters to track number of device MHI state changes * @transition_list: List of MHI state transitions * @transition_lock: Lock for protecting MHI state transition list * @wlock: Lock for protecting device wakeup @@ -444,7 +444,7 @@ struct mhi_controller { enum mhi_state dev_state; atomic_t dev_wake; atomic_t pending_pkts; - u32 M0, M2, M3; + u32 M0, M2, M3, M3_fast; struct list_head transition_list; spinlock_t transition_lock; spinlock_t wlock;