summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJone Chou <jonechou@google.com>2023-05-04 17:15:10 +0800
committerJone Chou <jonechou@google.com>2023-05-04 23:36:54 +0800
commitaae7c197108f729a5fb0f3c30eb6f37830c5137f (patch)
tree9e98d4d99c9794101b7cdab238c58f57a6c5514d
parent95994cd0076a6a77f090e695f90d623331b8e9a1 (diff)
downloadgs-aae7c197108f729a5fb0f3c30eb6f37830c5137f.tar.gz
google/debug: modify delta time vairable type
make sure all of delta time is possitive in code flow and change total timeout time in panic message to be second level. Bug: 278827197 Signed-off-by: Jone Chou <jonechou@google.com> Change-Id: Ie695db76c29c58273fc148f985562f367d7c2047
-rw-r--r--drivers/soc/google/debug/pixel-suspend-diag.c12
-rw-r--r--include/soc/google/debug-snapshot-log.h4
2 files changed, 8 insertions, 8 deletions
diff --git a/drivers/soc/google/debug/pixel-suspend-diag.c b/drivers/soc/google/debug/pixel-suspend-diag.c
index 4a9b519c1876..1b9a29a0b0d3 100644
--- a/drivers/soc/google/debug/pixel-suspend-diag.c
+++ b/drivers/soc/google/debug/pixel-suspend-diag.c
@@ -26,9 +26,9 @@
(((delta) >> PIXEL_SUSPEND_DIAG_DELTA_TIME_L_SHIFT) & PIXEL_SUSPEND_DIAG_DELTA_TIME_L_MASK)
#define PIXEL_SUSPEND_DIAG_DELTA_TIME(delta_h, delta_l) \
- ((((int64_t)(delta_h) & PIXEL_SUSPEND_DIAG_DELTA_TIME_H_MASK) << \
+ ((((uint64_t)(delta_h) & PIXEL_SUSPEND_DIAG_DELTA_TIME_H_MASK) << \
PIXEL_SUSPEND_DIAG_DELTA_TIME_H_SHIFT) | \
- (((int64_t)(delta_l) & PIXEL_SUSPEND_DIAG_DELTA_TIME_L_MASK) << \
+ (((uint64_t)(delta_l) & PIXEL_SUSPEND_DIAG_DELTA_TIME_L_MASK) << \
PIXEL_SUSPEND_DIAG_DELTA_TIME_L_SHIFT))
enum pixel_suspend_diag_item_index {
@@ -100,7 +100,7 @@ static void pixel_suspend_diag_handle_suspend_resume(struct dbg_snapshot_log *ds
{
uint64_t idx = (last_idx + 1) % ARRAY_SIZE(dss_log->suspend);
bool has_dev_pm_cb = (idx != curr_idx);
- int64_t delta_time = 0;
+ uint64_t delta_time = 0;
int i;
if (!has_dev_pm_cb) {
@@ -139,13 +139,13 @@ static void pixel_suspend_diag_handle_suspend_resume(struct dbg_snapshot_log *ds
crash:
pixel_suspend_diag_inst.force_panic = 0x1;
pixel_suspend_diag_inst.timeout = pixel_suspend_diag_items[i].timeout;
- panic("%s: %s%s(%ld) to %s%s(%ld) %stook %lld ns\n", __func__,
+ panic("%s: %s%s(%ld) to %s%s(%ld) %stook %llu.%llu s\n", __func__,
dss_log->suspend[last_idx].log ? dss_log->suspend[last_idx].log : "",
dss_log->suspend[last_idx].en == DSS_FLAG_IN ? " IN" : " OUT", last_idx,
dss_log->suspend[curr_idx].log ? dss_log->suspend[curr_idx].log : "",
dss_log->suspend[curr_idx].en == DSS_FLAG_IN ? " IN" : " OUT", curr_idx,
has_dev_pm_cb ? "callbacks " : "",
- delta_time);
+ delta_time / NSEC_PER_SEC, (delta_time % NSEC_PER_SEC) / USEC_PER_SEC);
}
void pixel_suspend_diag_suspend_resume(void *dbg_snapshot_log, const char *action, bool start,
@@ -175,7 +175,7 @@ bool pixel_suspend_diag_dev_pm_cb_end(void *dbg_snapshot_log, uint64_t first_log
uint64_t i;
struct dbg_snapshot_log *dss_log = dbg_snapshot_log;
uint64_t end_time;
- int64_t delta_time;
+ uint64_t delta_time;
if (!pixel_suspend_diag_inst.enable)
return false;
diff --git a/include/soc/google/debug-snapshot-log.h b/include/soc/google/debug-snapshot-log.h
index e0f389810f26..4c89765af753 100644
--- a/include/soc/google/debug-snapshot-log.h
+++ b/include/soc/google/debug-snapshot-log.h
@@ -63,8 +63,8 @@ struct suspend_log {
int event;
#if IS_ENABLED(CONFIG_PIXEL_SUSPEND_DIAG)
short core;
- short delta_time_h;
- int delta_time_l;
+ unsigned short delta_time_h;
+ unsigned int delta_time_l;
#else
int core;
#endif