]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amd/display: Fix nanosec stat overflow
authorAric Cyr <aric.cyr@amd.com>
Thu, 29 Aug 2019 15:53:52 +0000 (11:53 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 13 Apr 2024 10:50:15 +0000 (12:50 +0200)
[ Upstream commit 14d68acfd04b39f34eea7bea65dda652e6db5bf6 ]

[Why]
Nanosec stats can overflow on long running systems potentially causing
statistic logging issues.

[How]
Use 64bit types for nanosec stats to ensure no overflow.

Reviewed-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Aric Cyr <aric.cyr@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/display/modules/inc/mod_stats.h

index 3812094b52e8fd01bed37eaf0dc8e2c823b22fbd..88b312c3eb43aa4c2913d05577fe780472c46f8c 100644 (file)
@@ -51,10 +51,10 @@ void mod_stats_update_event(struct mod_stats *mod_stats,
                unsigned int length);
 
 void mod_stats_update_flip(struct mod_stats *mod_stats,
-               unsigned long timestamp_in_ns);
+               unsigned long long timestamp_in_ns);
 
 void mod_stats_update_vupdate(struct mod_stats *mod_stats,
-               unsigned long timestamp_in_ns);
+               unsigned long long timestamp_in_ns);
 
 void mod_stats_update_freesync(struct mod_stats *mod_stats,
                unsigned int v_total_min,