Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > fc11cd6e1c513a17304da94a5390f3cd > files > 4165

kernel-2.6.18-194.11.1.el5.src.rpm

From: Prarit Bhargava <prarit@redhat.com>
Date: Mon, 24 Nov 2008 09:42:45 -0500
Subject: [x86_64] panic if AMD cpu_khz is wrong
Message-id: 492ABD65.1030205@redhat.com
O-Subject: Re: [RHEL5.4 PATCH] panic if AMD cpu_khz is wrong
Bugzilla: 472523
RH-Acked-by: Neil Horman <nhorman@redhat.com>

Panic if AMD systems are initialized with incorrect cpu_khz value.

Upstream has a WARN, however I think a panic is more appropriate for RHEL.

http://marc.info/?l=linux-kernel&m=122651496115998&w=2

Compiled by me. [This bug happens lt 1% of the time and is difficult to
reproduce.  When it does hit, however, it causes all sorts of strange system
behavior.]

Resolves BZ 472523.  This patch depends on the previously submitted patch
for
BZ 467782.

diff --git a/arch/x86_64/kernel/time.c b/arch/x86_64/kernel/time.c
index 2d34020..6efcc7f 100644
--- a/arch/x86_64/kernel/time.c
+++ b/arch/x86_64/kernel/time.c
@@ -608,6 +608,9 @@ static unsigned int __init tsc_calibrate_cpu_khz(void)
 			break;
 	no_ctr_free = (i == 4);
 	if (no_ctr_free) {
+		/* It is possible that cpu_khz will still be calculated
+		   correctly.  Upstream WARN's here. */
+		panic("AMD no free perfctr.  cpu_khz calibration incorrect.... reboot system");
 		i = 3;
 		rdmsrl(MSR_K7_EVNTSEL3, evntsel3);
 		wrmsrl(MSR_K7_EVNTSEL3, 0);