From 44ee8c59b5db9d4421709a581d30ceea24ad5b87 Mon Sep 17 00:00:00 2001 From: Zhen Chen Date: Wed, 27 Dec 2023 17:47:27 +0800 Subject: [PATCH] MALI: bifrost: log: Disable WARNINGs in validate_tracepoint_data() After integrating DDK g21(r46), the driver outputs the following WARNING after waking from sleep: [ 293.271414][ T209] prev_wp_active_end_time 18446744073605310680 > start_time 1119644647 for aid 1000 active_cnt 0 [ 293.224787][ T375] WARNING: CPU: 3 PID: 375 at drivers/gpu/arm/bifrost/mali_kbase_gpu_metrics.c:84 emit_tracepoint_for_active_gpu_metrics_ctx+0x138/0x1c4 [ 293.224825][ T375] Modules linked in: bcmdhd dhd_static_buf r8168 [ 293.224873][ T375] CPU: 3 PID: 375 Comm: kworker/u17:2 Not tainted 5.10.160 #1050 [ 293.224888][ T375] Hardware name: Rockchip RK3588 EVB1 LP4 V10 Board (DT) [ 293.224911][ T375] Workqueue: csf_scheduler_gpu_idle_ gpu_idle_worker [ 293.224936][ T375] pstate: 60c00009 (nZCv daif +PAN +UAO -TCO BTYPE=--) [ 293.224955][ T375] pc : emit_tracepoint_for_active_gpu_metrics_ctx+0x138/0x1c4 [ 293.224973][ T375] lr : emit_tracepoint_for_active_gpu_metrics_ctx+0x138/0x1c4 ... [ 293.225343][ T375] Call trace: [ 293.225364][ T375] emit_tracepoint_for_active_gpu_metrics_ctx+0x138/0x1c4 [ 293.225382][ T375] kbase_gpu_metrics_emit_tracepoint+0x54/0xf4 [ 293.225403][ T375] cleanup_csg_slot+0x20c/0x4f8 [ 293.225423][ T375] wait_csg_slots_suspend+0x320/0x3bc [ 293.225440][ T375] suspend_active_groups_on_powerdown+0xa8/0x1cc [ 293.225458][ T375] scheduler_suspend_on_idle+0x24/0x828 [ 293.225474][ T375] gpu_idle_worker+0x384/0x5c4 [ 293.225495][ T375] process_one_work+0x1f0/0x478 [ 293.225511][ T375] worker_thread+0x270/0x4cc [ 293.225531][ T375] kthread+0x138/0x340 [ 293.225552][ T375] ret_from_fork+0x10/0x18 The WARNING is due to the driver expecting 'gpu_ts' (gpu_timestamp) from the FW to be monotonically increasing, but here "after waking up, 'gpu_ts' is smaller than before sleep." 'gpu_ts' comes from the GPU's input signal CNTVALUEB. CNTVALUEB comes from the 'stimer' timer. derrick.huang@rock-chips.com confirmed that this timer loses power during sleep, and its count is reset when the system wakes up. This causes "'gpu_ts' to be smaller after waking up than before sleep." derrick.huang also mentioned that "for RK3588, it is not possible to make 'stimer' not lose power in the product." Here, we are temporarily disabling this WARNING. It is speculated that sleep-wake cycles might lead to certain profile features of the GPU not functioning correctly. Further testing will be conducted to check for other potential issues. Signed-off-by: Zhen Chen Change-Id: I9979bff7c7fb946437889561e90440de1037bb35 --- drivers/gpu/arm/bifrost/mali_kbase_gpu_metrics.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/arm/bifrost/mali_kbase_gpu_metrics.c b/drivers/gpu/arm/bifrost/mali_kbase_gpu_metrics.c index 7b33f86644ea..8e00c0dc830e 100644 --- a/drivers/gpu/arm/bifrost/mali_kbase_gpu_metrics.c +++ b/drivers/gpu/arm/bifrost/mali_kbase_gpu_metrics.c @@ -67,7 +67,7 @@ static inline void gpu_metrics_ctx_flag_clear(struct kbase_gpu_metrics_ctx *gpu_ static inline void validate_tracepoint_data(struct kbase_gpu_metrics_ctx *gpu_metrics_ctx, u64 start_time, u64 end_time, u64 total_active) { -#ifdef CONFIG_MALI_BIFROST_DEBUG +#if 0 WARN(total_active > NSEC_PER_SEC, "total_active %llu > 1 second for aid %u active_cnt %u", total_active, gpu_metrics_ctx->aid, gpu_metrics_ctx->active_cnt);