From: tip-bot for Chen Yu <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: yu.c.chen@intel.com, mingo@kernel.org, rafael@kernel.org,
bin.gao@intel.com, lenb@kernel.org, tglx@linutronix.de,
linux-kernel@vger.kernel.org, hpa@zytor.com
Subject: [tip:x86/urgent] x86/tsc: Read all ratio bits from MSR_PLATFORM_INFO
Date: Fri, 6 May 2016 02:54:38 -0700 [thread overview]
Message-ID: <tip-886123fb3a8656699dff40afa0573df359abeb18@git.kernel.org> (raw)
In-Reply-To: <1462505619-5516-1-git-send-email-yu.c.chen@intel.com>
Commit-ID: 886123fb3a8656699dff40afa0573df359abeb18
Gitweb: http://git.kernel.org/tip/886123fb3a8656699dff40afa0573df359abeb18
Author: Chen Yu <yu.c.chen@intel.com>
AuthorDate: Fri, 6 May 2016 11:33:39 +0800
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitDate: Fri, 6 May 2016 11:50:50 +0200
x86/tsc: Read all ratio bits from MSR_PLATFORM_INFO
Currently we read the tsc radio: ratio = (MSR_PLATFORM_INFO >> 8) & 0x1f;
Thus we get bit 8-12 of MSR_PLATFORM_INFO, however according to the SDM
(35.5), the ratio bits are bit 8-15.
Ignoring the upper bits can result in an incorrect tsc ratio, which causes the
TSC calibration and the Local APIC timer frequency to be incorrect.
Fix this problem by masking 0xff instead.
[ tglx: Massaged changelog ]
Fixes: 7da7c1561366 "x86, tsc: Add static (MSR) TSC calibration on Intel Atom SoCs"
Signed-off-by: Chen Yu <yu.c.chen@intel.com>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: stable@vger.kernel.org
Cc: Bin Gao <bin.gao@intel.com>
Cc: Len Brown <lenb@kernel.org>
Link: http://lkml.kernel.org/r/1462505619-5516-1-git-send-email-yu.c.chen@intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
arch/x86/kernel/tsc_msr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kernel/tsc_msr.c b/arch/x86/kernel/tsc_msr.c
index 92ae6ac..6aa0f4d 100644
--- a/arch/x86/kernel/tsc_msr.c
+++ b/arch/x86/kernel/tsc_msr.c
@@ -92,7 +92,7 @@ unsigned long 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;
prev parent reply other threads:[~2016-05-06 9:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-06 3:33 [PATCH] x86, tsc: Fix tsc ratio calibration to avoid broken mdelay yu.c.chen
2016-05-06 9:47 ` Thomas Gleixner
2016-05-06 9:53 ` Thomas Gleixner
2016-05-06 12:43 ` Chen, Yu C
2016-05-06 9:54 ` tip-bot for Chen Yu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-886123fb3a8656699dff40afa0573df359abeb18@git.kernel.org \
--to=tipbot@zytor.com \
--cc=bin.gao@intel.com \
--cc=hpa@zytor.com \
--cc=lenb@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=rafael@kernel.org \
--cc=tglx@linutronix.de \
--cc=yu.c.chen@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).