summaryrefslogtreecommitdiffstats
path: root/include/ufs
diff options
context:
space:
mode:
authorDaniil Lunev <dlunev@chromium.org>2022-08-04 06:50:34 +1000
committerMartin K. Petersen <martin.petersen@oracle.com>2022-08-22 23:03:30 -0400
commit0f85e74756b5e85a0de6dce7d8c07f0b4e1f7726 (patch)
tree524738bf90394faf2f5b537582045836aaa62680 /include/ufs
parentb7dbc686f60b28d0843ed572f8aa59c3e76e142b (diff)
downloadlinux-0f85e74756b5e85a0de6dce7d8c07f0b4e1f7726.tar.gz
linux-0f85e74756b5e85a0de6dce7d8c07f0b4e1f7726.tar.bz2
linux-0f85e74756b5e85a0de6dce7d8c07f0b4e1f7726.zip
scsi: ufs: core: Use local_clock() for debugging timestamps
CLOCK_MONOTONIC is not advanced when the system is in suspend. This becomes problematic when debugging issues related to suspend-resume: the timestamps printed by ufshcd_print_trs can not be correlated with dmesg entries, which are timestamped with local_clock(). Change the used clock to local_clock() for the informational timestamp variables and adds mirroring *_local_clock instances for variables used in subsequent derevations (to not change the semantics of those derevations). Link: https://lore.kernel.org/r/20220804065019.v5.1.I699244ea7efbd326a34a6dfd9b5a31e78400cf68@changeid Acked-by: Stanley Chu <stanley.chu@mediatek.com> Acked-by: Avri Altman <avri.altman@wdc.com> Signed-off-by: Daniil Lunev <dlunev@chromium.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'include/ufs')
-rw-r--r--include/ufs/ufshcd.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h
index 7fe1a926cd99..d81e9a5da59e 100644
--- a/include/ufs/ufshcd.h
+++ b/include/ufs/ufshcd.h
@@ -160,8 +160,10 @@ struct ufs_pm_lvl_states {
* @task_tag: Task tag of the command
* @lun: LUN of the command
* @intr_cmd: Interrupt command (doesn't participate in interrupt aggregation)
- * @issue_time_stamp: time stamp for debug purposes
- * @compl_time_stamp: time stamp for statistics
+ * @issue_time_stamp: time stamp for debug purposes (CLOCK_MONOTONIC)
+ * @issue_time_stamp_local_clock: time stamp for debug purposes (local_clock)
+ * @compl_time_stamp: time stamp for statistics (CLOCK_MONOTONIC)
+ * @compl_time_stamp_local_clock: time stamp for debug purposes (local_clock)
* @crypto_key_slot: the key slot to use for inline crypto (-1 if none)
* @data_unit_num: the data unit number for the first block for inline crypto
* @req_abort_skip: skip request abort task flag
@@ -185,7 +187,9 @@ struct ufshcd_lrb {
u8 lun; /* UPIU LUN id field is only 8-bit wide */
bool intr_cmd;
ktime_t issue_time_stamp;
+ u64 issue_time_stamp_local_clock;
ktime_t compl_time_stamp;
+ u64 compl_time_stamp_local_clock;
#ifdef CONFIG_SCSI_UFS_CRYPTO
int crypto_key_slot;
u64 data_unit_num;
@@ -430,7 +434,7 @@ struct ufs_clk_scaling {
struct ufs_event_hist {
int pos;
u32 val[UFS_EVENT_HIST_LENGTH];
- ktime_t tstamp[UFS_EVENT_HIST_LENGTH];
+ u64 tstamp[UFS_EVENT_HIST_LENGTH];
unsigned long long cnt;
};
@@ -446,10 +450,10 @@ struct ufs_event_hist {
*/
struct ufs_stats {
u32 last_intr_status;
- ktime_t last_intr_ts;
+ u64 last_intr_ts;
u32 hibern8_exit_cnt;
- ktime_t last_hibern8_exit_tstamp;
+ u64 last_hibern8_exit_tstamp;
struct ufs_event_hist event[UFS_EVT_CNT];
};