All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/6] x86: tsc: Read all ratio bits from MSR_PLATFORM_INFO
@ 2017-07-26  3:12 Bin Meng
  2017-07-26  3:12 ` [U-Boot] [PATCH 2/6] x86: tsc: Identify Intel-specific code Bin Meng
                   ` (5 more replies)
  0 siblings, 6 replies; 19+ messages in thread
From: Bin Meng @ 2017-07-26  3:12 UTC (permalink / raw)
  To: u-boot

Currently we read the tsc radio like this:

	ratio = (MSR_PLATFORM_INFO >> 8) & 0x1f;

Thus we get bit 8-12 of MSR_PLATFORM_INFO, however according to the
Intel manual, the ratio bits are bit 8-15.

Fix this problem by masking 0xff instead.

This keeps in sync with Linux kernel commit:
  886123f: x86/tsc: Read all ratio bits from MSR_PLATFORM_INFO

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
---

 drivers/timer/tsc_timer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/timer/tsc_timer.c b/drivers/timer/tsc_timer.c
index 5c4ec00..ffbc709 100644
--- a/drivers/timer/tsc_timer.c
+++ b/drivers/timer/tsc_timer.c
@@ -92,7 +92,7 @@ static unsigned long __maybe_unused try_msr_calibrate_tsc(void)
 
 	if (freq_desc_tables[cpu_index].msr_plat) {
 		rdmsr(MSR_PLATFORM_INFO, lo, hi);
-		ratio = (lo >> 8) & 0x1f;
+		ratio = (lo >> 8) & 0xff;
 	} else {
 		rdmsr(MSR_IA32_PERF_STATUS, lo, hi);
 		ratio = (hi >> 8) & 0x1f;
-- 
2.9.2

^ permalink raw reply related	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2017-08-01 12:22 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-26  3:12 [U-Boot] [PATCH 1/6] x86: tsc: Read all ratio bits from MSR_PLATFORM_INFO Bin Meng
2017-07-26  3:12 ` [U-Boot] [PATCH 2/6] x86: tsc: Identify Intel-specific code Bin Meng
2017-07-26  3:16   ` Bin Meng
2017-08-01  9:11   ` Simon Glass
2017-08-01 12:21     ` Bin Meng
2017-07-26  3:12 ` [U-Boot] [PATCH 3/6] x86: tsc: Remove the fail handling in try_msr_calibrate_tsc() Bin Meng
2017-08-01  9:11   ` Simon Glass
2017-08-01 12:21     ` Bin Meng
2017-07-26  3:12 ` [U-Boot] [PATCH 4/6] x86: tsc: Update comments and expand definitions in freq_desc_tables[] Bin Meng
2017-08-01  9:11   ` Simon Glass
2017-08-01 12:21     ` Bin Meng
2017-07-26  3:12 ` [U-Boot] [PATCH 5/6] x86: tsc: Correct Silvermont reference clock values Bin Meng
2017-08-01  9:11   ` Simon Glass
2017-08-01 12:21     ` Bin Meng
2017-07-26  3:12 ` [U-Boot] [PATCH 6/6] x86: tsc: Rename try_msr_calibrate_tsc() to cpu_mhz_from_msr() Bin Meng
2017-08-01  9:11   ` Simon Glass
2017-08-01 12:22     ` Bin Meng
2017-08-01  9:10 ` [U-Boot] [PATCH 1/6] x86: tsc: Read all ratio bits from MSR_PLATFORM_INFO Simon Glass
2017-08-01 12:21   ` Bin Meng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.