From: Zhang Rui Date: Wed, 19 Mar 2025 00:53:07 +0000 (+0800) Subject: tools/power turbostat: Restore GFX sysfs fflush() call X-Git-Tag: v6.15-rc1~2^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f8b136ef2605c1bf62020462d10e35228760aa19;p=thirdparty%2Flinux.git tools/power turbostat: Restore GFX sysfs fflush() call Do fflush() to discard the buffered data, before each read of the graphics sysfs knobs. Fixes: ba99a4fc8c24 ("tools/power turbostat: Remove unnecessary fflush() call") Signed-off-by: Zhang Rui Signed-off-by: Len Brown --- diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c index 70e17d4ad9b60..c9a34c16c7a81 100644 --- a/tools/power/x86/turbostat/turbostat.c +++ b/tools/power/x86/turbostat/turbostat.c @@ -6039,6 +6039,7 @@ int snapshot_graphics(int idx) int retval; rewind(gfx_info[idx].fp); + fflush(gfx_info[idx].fp); switch (idx) { case GFX_rc6: