aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/i386/defconfig14
-rw-r--r--arch/i386/kernel/mpparse.c8
-rw-r--r--arch/i386/kernel/setup.c4
-rw-r--r--arch/i386/kernel/smpboot.c10
-rw-r--r--arch/i386/mach-generic/bigsmp.c2
-rw-r--r--arch/i386/mach-generic/default.c2
-rw-r--r--arch/i386/mach-generic/es7000.c2
-rw-r--r--arch/i386/mach-generic/summit.c2
-rw-r--r--arch/i386/mm/init.c4
-rw-r--r--arch/x86_64/defconfig16
-rw-r--r--arch/x86_64/ia32/ia32_aout.c4
-rw-r--r--arch/x86_64/kernel/pci-calgary.c11
-rw-r--r--arch/x86_64/kernel/time.c25
13 files changed, 70 insertions, 34 deletions
diff --git a/arch/i386/defconfig b/arch/i386/defconfig
index 88b7c1cf65a2..5d80edfc61b7 100644
--- a/arch/i386/defconfig
+++ b/arch/i386/defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.19-git14 3# Linux kernel version: 2.6.20-rc3
4# Sat Dec 9 21:23:14 2006 4# Fri Jan 5 11:54:46 2007
5# 5#
6CONFIG_X86_32=y 6CONFIG_X86_32=y
7CONFIG_GENERIC_TIME=y 7CONFIG_GENERIC_TIME=y
@@ -1287,6 +1287,11 @@ CONFIG_USB_MON=y
1287# 1287#
1288 1288
1289# 1289#
1290# Virtualization
1291#
1292# CONFIG_KVM is not set
1293
1294#
1290# File systems 1295# File systems
1291# 1296#
1292CONFIG_EXT2_FS=y 1297CONFIG_EXT2_FS=y
@@ -1471,6 +1476,8 @@ CONFIG_TRACE_IRQFLAGS_SUPPORT=y
1471# CONFIG_ENABLE_MUST_CHECK is not set 1476# CONFIG_ENABLE_MUST_CHECK is not set
1472CONFIG_MAGIC_SYSRQ=y 1477CONFIG_MAGIC_SYSRQ=y
1473CONFIG_UNUSED_SYMBOLS=y 1478CONFIG_UNUSED_SYMBOLS=y
1479# CONFIG_DEBUG_FS is not set
1480# CONFIG_HEADERS_CHECK is not set
1474CONFIG_DEBUG_KERNEL=y 1481CONFIG_DEBUG_KERNEL=y
1475CONFIG_LOG_BUF_SHIFT=18 1482CONFIG_LOG_BUF_SHIFT=18
1476CONFIG_DETECT_SOFTLOCKUP=y 1483CONFIG_DETECT_SOFTLOCKUP=y
@@ -1489,12 +1496,10 @@ CONFIG_DETECT_SOFTLOCKUP=y
1489# CONFIG_DEBUG_HIGHMEM is not set 1496# CONFIG_DEBUG_HIGHMEM is not set
1490CONFIG_DEBUG_BUGVERBOSE=y 1497CONFIG_DEBUG_BUGVERBOSE=y
1491# CONFIG_DEBUG_INFO is not set 1498# CONFIG_DEBUG_INFO is not set
1492# CONFIG_DEBUG_FS is not set
1493# CONFIG_DEBUG_VM is not set 1499# CONFIG_DEBUG_VM is not set
1494# CONFIG_DEBUG_LIST is not set 1500# CONFIG_DEBUG_LIST is not set
1495# CONFIG_FRAME_POINTER is not set 1501# CONFIG_FRAME_POINTER is not set
1496# CONFIG_FORCED_INLINING is not set 1502# CONFIG_FORCED_INLINING is not set
1497# CONFIG_HEADERS_CHECK is not set
1498# CONFIG_RCU_TORTURE_TEST is not set 1503# CONFIG_RCU_TORTURE_TEST is not set
1499# CONFIG_LKDTM is not set 1504# CONFIG_LKDTM is not set
1500CONFIG_EARLY_PRINTK=y 1505CONFIG_EARLY_PRINTK=y
@@ -1527,6 +1532,7 @@ CONFIG_CRC32=y
1527# CONFIG_LIBCRC32C is not set 1532# CONFIG_LIBCRC32C is not set
1528CONFIG_ZLIB_INFLATE=y 1533CONFIG_ZLIB_INFLATE=y
1529CONFIG_PLIST=y 1534CONFIG_PLIST=y
1535CONFIG_IOMAP_COPY=y
1530CONFIG_GENERIC_HARDIRQS=y 1536CONFIG_GENERIC_HARDIRQS=y
1531CONFIG_GENERIC_IRQ_PROBE=y 1537CONFIG_GENERIC_IRQ_PROBE=y
1532CONFIG_GENERIC_PENDING_IRQ=y 1538CONFIG_GENERIC_PENDING_IRQ=y
diff --git a/arch/i386/kernel/mpparse.c b/arch/i386/kernel/mpparse.c
index 2ce67228dff8..49bff3596bff 100644
--- a/arch/i386/kernel/mpparse.c
+++ b/arch/i386/kernel/mpparse.c
@@ -36,7 +36,7 @@
36 36
37/* Have we found an MP table */ 37/* Have we found an MP table */
38int smp_found_config; 38int smp_found_config;
39unsigned int __initdata maxcpus = NR_CPUS; 39unsigned int __cpuinitdata maxcpus = NR_CPUS;
40 40
41/* 41/*
42 * Various Linux-internal data structures created from the 42 * Various Linux-internal data structures created from the
@@ -102,9 +102,9 @@ static int __init mpf_checksum(unsigned char *mp, int len)
102 */ 102 */
103 103
104static int mpc_record; 104static int mpc_record;
105static struct mpc_config_translation *translation_table[MAX_MPC_ENTRY] __initdata; 105static struct mpc_config_translation *translation_table[MAX_MPC_ENTRY] __cpuinitdata;
106 106
107static void __devinit MP_processor_info (struct mpc_config_processor *m) 107static void __cpuinit MP_processor_info (struct mpc_config_processor *m)
108{ 108{
109 int ver, apicid; 109 int ver, apicid;
110 physid_mask_t phys_cpu; 110 physid_mask_t phys_cpu;
@@ -822,7 +822,7 @@ void __init mp_register_lapic_address(u64 address)
822 Dprintk("Boot CPU = %d\n", boot_cpu_physical_apicid); 822 Dprintk("Boot CPU = %d\n", boot_cpu_physical_apicid);
823} 823}
824 824
825void __devinit mp_register_lapic (u8 id, u8 enabled) 825void __cpuinit mp_register_lapic (u8 id, u8 enabled)
826{ 826{
827 struct mpc_config_processor processor; 827 struct mpc_config_processor processor;
828 int boot_cpu = 0; 828 int boot_cpu = 0;
diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c
index 6f6cb7b31d18..4b31ad70c1ac 100644
--- a/arch/i386/kernel/setup.c
+++ b/arch/i386/kernel/setup.c
@@ -77,7 +77,7 @@ extern struct resource code_resource;
77extern struct resource data_resource; 77extern struct resource data_resource;
78 78
79/* cpu data as detected by the assembly code in head.S */ 79/* cpu data as detected by the assembly code in head.S */
80struct cpuinfo_x86 new_cpu_data __initdata = { 0, 0, 0, 0, -1, 1, 0, 0, -1 }; 80struct cpuinfo_x86 new_cpu_data __cpuinitdata = { 0, 0, 0, 0, -1, 1, 0, 0, -1 };
81/* common cpu data for all cpus */ 81/* common cpu data for all cpus */
82struct cpuinfo_x86 boot_cpu_data __read_mostly = { 0, 0, 0, 0, -1, 1, 0, 0, -1 }; 82struct cpuinfo_x86 boot_cpu_data __read_mostly = { 0, 0, 0, 0, -1, 1, 0, 0, -1 };
83EXPORT_SYMBOL(boot_cpu_data); 83EXPORT_SYMBOL(boot_cpu_data);
@@ -495,7 +495,7 @@ static void set_mca_bus(int x) { }
495#endif 495#endif
496 496
497/* Overridden in paravirt.c if CONFIG_PARAVIRT */ 497/* Overridden in paravirt.c if CONFIG_PARAVIRT */
498char * __attribute__((weak)) memory_setup(void) 498char * __init __attribute__((weak)) memory_setup(void)
499{ 499{
500 return machine_specific_memory_setup(); 500 return machine_specific_memory_setup();
501} 501}
diff --git a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c
index 300d9b38d02e..dea7ef9d3e82 100644
--- a/arch/i386/kernel/smpboot.c
+++ b/arch/i386/kernel/smpboot.c
@@ -159,7 +159,7 @@ void __init smp_alloc_memory(void)
159 * a given CPU 159 * a given CPU
160 */ 160 */
161 161
162static void __devinit smp_store_cpu_info(int id) 162static void __cpuinit smp_store_cpu_info(int id)
163{ 163{
164 struct cpuinfo_x86 *c = cpu_data + id; 164 struct cpuinfo_x86 *c = cpu_data + id;
165 165
@@ -364,7 +364,7 @@ extern void calibrate_delay(void);
364 364
365static atomic_t init_deasserted; 365static atomic_t init_deasserted;
366 366
367static void __devinit smp_callin(void) 367static void __cpuinit smp_callin(void)
368{ 368{
369 int cpuid, phys_id; 369 int cpuid, phys_id;
370 unsigned long timeout; 370 unsigned long timeout;
@@ -538,7 +538,7 @@ set_cpu_sibling_map(int cpu)
538/* 538/*
539 * Activate a secondary processor. 539 * Activate a secondary processor.
540 */ 540 */
541static void __devinit start_secondary(void *unused) 541static void __cpuinit start_secondary(void *unused)
542{ 542{
543 /* 543 /*
544 * Don't put *anything* before secondary_cpu_init(), SMP 544 * Don't put *anything* before secondary_cpu_init(), SMP
@@ -931,7 +931,7 @@ static inline struct task_struct * alloc_idle_task(int cpu)
931#define alloc_idle_task(cpu) fork_idle(cpu) 931#define alloc_idle_task(cpu) fork_idle(cpu)
932#endif 932#endif
933 933
934static int __devinit do_boot_cpu(int apicid, int cpu) 934static int __cpuinit do_boot_cpu(int apicid, int cpu)
935/* 935/*
936 * NOTE - on most systems this is a PHYSICAL apic ID, but on multiquad 936 * NOTE - on most systems this is a PHYSICAL apic ID, but on multiquad
937 * (ie clustered apic addressing mode), this is a LOGICAL apic ID. 937 * (ie clustered apic addressing mode), this is a LOGICAL apic ID.
@@ -1432,7 +1432,7 @@ void __cpu_die(unsigned int cpu)
1432} 1432}
1433#endif /* CONFIG_HOTPLUG_CPU */ 1433#endif /* CONFIG_HOTPLUG_CPU */
1434 1434
1435int __devinit __cpu_up(unsigned int cpu) 1435int __cpuinit __cpu_up(unsigned int cpu)
1436{ 1436{
1437#ifdef CONFIG_HOTPLUG_CPU 1437#ifdef CONFIG_HOTPLUG_CPU
1438 int ret=0; 1438 int ret=0;
diff --git a/arch/i386/mach-generic/bigsmp.c b/arch/i386/mach-generic/bigsmp.c
index 33d9f93557ba..8a210fa915b5 100644
--- a/arch/i386/mach-generic/bigsmp.c
+++ b/arch/i386/mach-generic/bigsmp.c
@@ -45,7 +45,7 @@ static struct dmi_system_id __initdata bigsmp_dmi_table[] = {
45}; 45};
46 46
47 47
48static __init int probe_bigsmp(void) 48static int probe_bigsmp(void)
49{ 49{
50 if (def_to_bigsmp) 50 if (def_to_bigsmp)
51 dmi_bigsmp = 1; 51 dmi_bigsmp = 1;
diff --git a/arch/i386/mach-generic/default.c b/arch/i386/mach-generic/default.c
index 96c19821e47d..8685208d8512 100644
--- a/arch/i386/mach-generic/default.c
+++ b/arch/i386/mach-generic/default.c
@@ -18,7 +18,7 @@
18#include <asm/mach-default/mach_mpparse.h> 18#include <asm/mach-default/mach_mpparse.h>
19 19
20/* should be called last. */ 20/* should be called last. */
21static __init int probe_default(void) 21static int probe_default(void)
22{ 22{
23 return 1; 23 return 1;
24} 24}
diff --git a/arch/i386/mach-generic/es7000.c b/arch/i386/mach-generic/es7000.c
index aa144d82334d..b8963a5a3b25 100644
--- a/arch/i386/mach-generic/es7000.c
+++ b/arch/i386/mach-generic/es7000.c
@@ -19,7 +19,7 @@
19#include <asm/mach-es7000/mach_mpparse.h> 19#include <asm/mach-es7000/mach_mpparse.h>
20#include <asm/mach-es7000/mach_wakecpu.h> 20#include <asm/mach-es7000/mach_wakecpu.h>
21 21
22static __init int probe_es7000(void) 22static int probe_es7000(void)
23{ 23{
24 /* probed later in mptable/ACPI hooks */ 24 /* probed later in mptable/ACPI hooks */
25 return 0; 25 return 0;
diff --git a/arch/i386/mach-generic/summit.c b/arch/i386/mach-generic/summit.c
index f7e5d66648dc..74883ccb8f73 100644
--- a/arch/i386/mach-generic/summit.c
+++ b/arch/i386/mach-generic/summit.c
@@ -18,7 +18,7 @@
18#include <asm/mach-summit/mach_ipi.h> 18#include <asm/mach-summit/mach_ipi.h>
19#include <asm/mach-summit/mach_mpparse.h> 19#include <asm/mach-summit/mach_mpparse.h>
20 20
21static __init int probe_summit(void) 21static int probe_summit(void)
22{ 22{
23 /* probed later in mptable/ACPI hooks */ 23 /* probed later in mptable/ACPI hooks */
24 return 0; 24 return 0;
diff --git a/arch/i386/mm/init.c b/arch/i386/mm/init.c
index 60a7e57af197..c5c5ea700cc7 100644
--- a/arch/i386/mm/init.c
+++ b/arch/i386/mm/init.c
@@ -283,7 +283,7 @@ void __init add_one_highpage_init(struct page *page, int pfn, int bad_ppro)
283 SetPageReserved(page); 283 SetPageReserved(page);
284} 284}
285 285
286static int add_one_highpage_hotplug(struct page *page, unsigned long pfn) 286static int __meminit add_one_highpage_hotplug(struct page *page, unsigned long pfn)
287{ 287{
288 free_new_highpage(page); 288 free_new_highpage(page);
289 totalram_pages++; 289 totalram_pages++;
@@ -300,7 +300,7 @@ static int add_one_highpage_hotplug(struct page *page, unsigned long pfn)
300 * has been added dynamically that would be 300 * has been added dynamically that would be
301 * onlined here is in HIGHMEM 301 * onlined here is in HIGHMEM
302 */ 302 */
303void online_page(struct page *page) 303void __meminit online_page(struct page *page)
304{ 304{
305 ClearPageReserved(page); 305 ClearPageReserved(page);
306 add_one_highpage_hotplug(page, page_to_pfn(page)); 306 add_one_highpage_hotplug(page, page_to_pfn(page));
diff --git a/arch/x86_64/defconfig b/arch/x86_64/defconfig
index 9cc7c21547a2..69584c295305 100644
--- a/arch/x86_64/defconfig
+++ b/arch/x86_64/defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.19-git14 3# Linux kernel version: 2.6.20-rc3
4# Sat Dec 9 21:23:09 2006 4# Fri Jan 5 11:54:41 2007
5# 5#
6CONFIG_X86_64=y 6CONFIG_X86_64=y
7CONFIG_64BIT=y 7CONFIG_64BIT=y
@@ -1056,6 +1056,7 @@ CONFIG_HWMON=y
1056# CONFIG_SENSORS_LM92 is not set 1056# CONFIG_SENSORS_LM92 is not set
1057# CONFIG_SENSORS_MAX1619 is not set 1057# CONFIG_SENSORS_MAX1619 is not set
1058# CONFIG_SENSORS_PC87360 is not set 1058# CONFIG_SENSORS_PC87360 is not set
1059# CONFIG_SENSORS_PC87427 is not set
1059# CONFIG_SENSORS_SIS5595 is not set 1060# CONFIG_SENSORS_SIS5595 is not set
1060# CONFIG_SENSORS_SMSC47M1 is not set 1061# CONFIG_SENSORS_SMSC47M1 is not set
1061# CONFIG_SENSORS_SMSC47M192 is not set 1062# CONFIG_SENSORS_SMSC47M192 is not set
@@ -1066,6 +1067,7 @@ CONFIG_SENSORS_SMSC47B397=m
1066# CONFIG_SENSORS_W83781D is not set 1067# CONFIG_SENSORS_W83781D is not set
1067# CONFIG_SENSORS_W83791D is not set 1068# CONFIG_SENSORS_W83791D is not set
1068# CONFIG_SENSORS_W83792D is not set 1069# CONFIG_SENSORS_W83792D is not set
1070# CONFIG_SENSORS_W83793 is not set
1069# CONFIG_SENSORS_W83L785TS is not set 1071# CONFIG_SENSORS_W83L785TS is not set
1070# CONFIG_SENSORS_W83627HF is not set 1072# CONFIG_SENSORS_W83627HF is not set
1071# CONFIG_SENSORS_W83627EHF is not set 1073# CONFIG_SENSORS_W83627EHF is not set
@@ -1311,6 +1313,11 @@ CONFIG_USB_MON=y
1311# 1313#
1312 1314
1313# 1315#
1316# Virtualization
1317#
1318# CONFIG_KVM is not set
1319
1320#
1314# Firmware Drivers 1321# Firmware Drivers
1315# 1322#
1316# CONFIG_EDD is not set 1323# CONFIG_EDD is not set
@@ -1502,6 +1509,8 @@ CONFIG_TRACE_IRQFLAGS_SUPPORT=y
1502# CONFIG_ENABLE_MUST_CHECK is not set 1509# CONFIG_ENABLE_MUST_CHECK is not set
1503CONFIG_MAGIC_SYSRQ=y 1510CONFIG_MAGIC_SYSRQ=y
1504CONFIG_UNUSED_SYMBOLS=y 1511CONFIG_UNUSED_SYMBOLS=y
1512CONFIG_DEBUG_FS=y
1513# CONFIG_HEADERS_CHECK is not set
1505CONFIG_DEBUG_KERNEL=y 1514CONFIG_DEBUG_KERNEL=y
1506CONFIG_LOG_BUF_SHIFT=18 1515CONFIG_LOG_BUF_SHIFT=18
1507CONFIG_DETECT_SOFTLOCKUP=y 1516CONFIG_DETECT_SOFTLOCKUP=y
@@ -1519,12 +1528,10 @@ CONFIG_DETECT_SOFTLOCKUP=y
1519# CONFIG_DEBUG_KOBJECT is not set 1528# CONFIG_DEBUG_KOBJECT is not set
1520CONFIG_DEBUG_BUGVERBOSE=y 1529CONFIG_DEBUG_BUGVERBOSE=y
1521# CONFIG_DEBUG_INFO is not set 1530# CONFIG_DEBUG_INFO is not set
1522CONFIG_DEBUG_FS=y
1523# CONFIG_DEBUG_VM is not set 1531# CONFIG_DEBUG_VM is not set
1524# CONFIG_DEBUG_LIST is not set 1532# CONFIG_DEBUG_LIST is not set
1525# CONFIG_FRAME_POINTER is not set 1533# CONFIG_FRAME_POINTER is not set
1526# CONFIG_FORCED_INLINING is not set 1534# CONFIG_FORCED_INLINING is not set
1527# CONFIG_HEADERS_CHECK is not set
1528# CONFIG_RCU_TORTURE_TEST is not set 1535# CONFIG_RCU_TORTURE_TEST is not set
1529# CONFIG_LKDTM is not set 1536# CONFIG_LKDTM is not set
1530# CONFIG_DEBUG_RODATA is not set 1537# CONFIG_DEBUG_RODATA is not set
@@ -1553,3 +1560,4 @@ CONFIG_CRC32=y
1553# CONFIG_LIBCRC32C is not set 1560# CONFIG_LIBCRC32C is not set
1554CONFIG_ZLIB_INFLATE=y 1561CONFIG_ZLIB_INFLATE=y
1555CONFIG_PLIST=y 1562CONFIG_PLIST=y
1563CONFIG_IOMAP_COPY=y
diff --git a/arch/x86_64/ia32/ia32_aout.c b/arch/x86_64/ia32/ia32_aout.c
index be87df506f39..fe83edb93c10 100644
--- a/arch/x86_64/ia32/ia32_aout.c
+++ b/arch/x86_64/ia32/ia32_aout.c
@@ -241,7 +241,7 @@ static u32 __user *create_aout_tables(char __user *p, struct linux_binprm *bprm)
241 get_user(c,p++); 241 get_user(c,p++);
242 } while (c); 242 } while (c);
243 } 243 }
244 put_user(NULL,argv); 244 put_user(0, argv);
245 current->mm->arg_end = current->mm->env_start = (unsigned long) p; 245 current->mm->arg_end = current->mm->env_start = (unsigned long) p;
246 while (envc-->0) { 246 while (envc-->0) {
247 char c; 247 char c;
@@ -250,7 +250,7 @@ static u32 __user *create_aout_tables(char __user *p, struct linux_binprm *bprm)
250 get_user(c,p++); 250 get_user(c,p++);
251 } while (c); 251 } while (c);
252 } 252 }
253 put_user(NULL,envp); 253 put_user(0, envp);
254 current->mm->env_end = (unsigned long) p; 254 current->mm->env_end = (unsigned long) p;
255 return sp; 255 return sp;
256} 256}
diff --git a/arch/x86_64/kernel/pci-calgary.c b/arch/x86_64/kernel/pci-calgary.c
index 87d90cb68a74..3d65b1d4c2b3 100644
--- a/arch/x86_64/kernel/pci-calgary.c
+++ b/arch/x86_64/kernel/pci-calgary.c
@@ -1068,6 +1068,8 @@ void __init detect_calgary(void)
1068 if (!early_pci_allowed()) 1068 if (!early_pci_allowed())
1069 return; 1069 return;
1070 1070
1071 printk(KERN_DEBUG "Calgary: detecting Calgary via BIOS EBDA area\n");
1072
1071 ptr = (unsigned long)phys_to_virt(get_bios_ebda()); 1073 ptr = (unsigned long)phys_to_virt(get_bios_ebda());
1072 1074
1073 rio_table_hdr = NULL; 1075 rio_table_hdr = NULL;
@@ -1088,14 +1090,14 @@ void __init detect_calgary(void)
1088 offset = *((unsigned short *)(ptr + offset)); 1090 offset = *((unsigned short *)(ptr + offset));
1089 } 1091 }
1090 if (!rio_table_hdr) { 1092 if (!rio_table_hdr) {
1091 printk(KERN_ERR "Calgary: Unable to locate " 1093 printk(KERN_DEBUG "Calgary: Unable to locate Rio Grande table "
1092 "Rio Grande Table in EBDA - bailing!\n"); 1094 "in EBDA - bailing!\n");
1093 return; 1095 return;
1094 } 1096 }
1095 1097
1096 ret = build_detail_arrays(); 1098 ret = build_detail_arrays();
1097 if (ret) { 1099 if (ret) {
1098 printk(KERN_ERR "Calgary: build_detail_arrays ret %d\n", ret); 1100 printk(KERN_DEBUG "Calgary: build_detail_arrays ret %d\n", ret);
1099 return; 1101 return;
1100 } 1102 }
1101 1103
@@ -1128,6 +1130,9 @@ void __init detect_calgary(void)
1128 } 1130 }
1129 } 1131 }
1130 1132
1133 printk(KERN_DEBUG "Calgary: finished detection, Calgary %s\n",
1134 calgary_found ? "found" : "not found");
1135
1131 if (calgary_found) { 1136 if (calgary_found) {
1132 iommu_detected = 1; 1137 iommu_detected = 1;
1133 calgary_detected = 1; 1138 calgary_detected = 1;
diff --git a/arch/x86_64/kernel/time.c b/arch/x86_64/kernel/time.c
index 9f05bc9b2dad..5cc76d0d331f 100644
--- a/arch/x86_64/kernel/time.c
+++ b/arch/x86_64/kernel/time.c
@@ -656,6 +656,25 @@ core_initcall(cpufreq_tsc);
656 */ 656 */
657 657
658#define TICK_COUNT 100000000 658#define TICK_COUNT 100000000
659#define TICK_MIN 5000
660
661/*
662 * Some platforms take periodic SMI interrupts with 5ms duration. Make sure none
663 * occurs between the reads of the hpet & TSC.
664 */
665static void __init read_hpet_tsc(int *hpet, int *tsc)
666{
667 int tsc1, tsc2, hpet1;
668
669 do {
670 tsc1 = get_cycles_sync();
671 hpet1 = hpet_readl(HPET_COUNTER);
672 tsc2 = get_cycles_sync();
673 } while (tsc2 - tsc1 > TICK_MIN);
674 *hpet = hpet1;
675 *tsc = tsc2;
676}
677
659 678
660static unsigned int __init hpet_calibrate_tsc(void) 679static unsigned int __init hpet_calibrate_tsc(void)
661{ 680{
@@ -666,13 +685,11 @@ static unsigned int __init hpet_calibrate_tsc(void)
666 local_irq_save(flags); 685 local_irq_save(flags);
667 local_irq_disable(); 686 local_irq_disable();
668 687
669 hpet_start = hpet_readl(HPET_COUNTER); 688 read_hpet_tsc(&hpet_start, &tsc_start);
670 rdtscl(tsc_start);
671 689
672 do { 690 do {
673 local_irq_disable(); 691 local_irq_disable();
674 hpet_now = hpet_readl(HPET_COUNTER); 692 read_hpet_tsc(&hpet_now, &tsc_now);
675 tsc_now = get_cycles_sync();
676 local_irq_restore(flags); 693 local_irq_restore(flags);
677 } while ((tsc_now - tsc_start) < TICK_COUNT && 694 } while ((tsc_now - tsc_start) < TICK_COUNT &&
678 (hpet_now - hpet_start) < TICK_COUNT); 695 (hpet_now - hpet_start) < TICK_COUNT);