diff options
author | Chuanhua Lei <[email protected]> | 2018-09-06 18:03:23 +0800 |
---|---|---|
committer | Thomas Gleixner <[email protected]> | 2018-09-06 14:22:01 +0200 |
commit | 17f6bac2249356c795339e03a0742cd79be3cab8 (patch) | |
tree | 8846acfe8d95a7bf4dd26e843b332143885fbb37 /drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | |
parent | 4331f4d5ada5684fc77fa16e3f6177f077c9e6ec (diff) |
x86/tsc: Prevent result truncation on 32bit
Loops per jiffy is calculated by multiplying tsc_khz with 1e3 and then
dividing it by HZ.
Both tsc_khz and the temporary variable holding the multiplication result
are of type unsigned long, so on 32bit the result is truncated to the lower
32bit.
Use u64 as type for the temporary variable and cast tsc_khz to it before
multiplying.
[ tglx: Massaged changelog and removed pointless braces ]
Fixes: cf7a63ef4e02 ("x86/tsc: Calibrate tsc only once")
Signed-off-by: Chuanhua Lei <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Cc: [email protected]
Cc: "H. Peter Anvin" <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Len Brown <[email protected]>
Cc: Pavel Tatashin <[email protected]>
Cc: Rajvi Jingar <[email protected]>
Cc: Dou Liyang <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c')
0 files changed, 0 insertions, 0 deletions