Skip to content

Commit 2ffbb83

Browse files
author
Linus Torvalds
committed
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86
* 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86: x86: simplify "make ARCH=x86" and fix kconfig all.config x86: reboot fixup for wrap2c board x86: check boundary in count setup resource x86: fix reboot with no keyboard attached x86: add hpet sanity checks x86: on x86_64, correct reading of PC RTC when update in progress in time_64.c x86: fix freeze in x86_64 RTC update code in time_64.c ntp: fix typo that makes sync_cmos_clock erratic Remove x86 merge artifact from top Makefile x86: fixup cpu_info array conversion x86: show cpuinfo only for online CPUs x86: fix cpu-hotplug regression x86: ignore the sys_getcpu() tcache parameter x86: voyager use correct header file name x86: fix smp init sections x86: fix voyager_cat_init section x86: fix bogus memcpy in es7000_check_dsdt()
2 parents 6840999 + 80ef88d commit 2ffbb83

File tree

16 files changed

+81
-82
lines changed

16 files changed

+81
-82
lines changed

Makefile

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,12 +1332,7 @@ else
13321332
ALLINCLUDE_ARCHS := $(ALLSOURCE_ARCHS)
13331333
endif
13341334

1335-
# Take care of arch/x86
1336-
ifeq ($(ARCH), $(SRCARCH))
1337-
ALLSOURCE_ARCHS := $(ARCH)
1338-
else
1339-
ALLSOURCE_ARCHS := $(ARCH) $(SRCARCH)
1340-
endif
1335+
ALLSOURCE_ARCHS := $(SRCARCH)
13411336

13421337
define find-sources
13431338
( for arch in $(ALLSOURCE_ARCHS) ; do \

arch/x86/kernel/acpi/boot.c

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,38 @@ static int __init acpi_parse_hpet(struct acpi_table_header *table)
637637
}
638638

639639
hpet_address = hpet_tbl->address.address;
640+
641+
/*
642+
* Some broken BIOSes advertise HPET at 0x0. We really do not
643+
* want to allocate a resource there.
644+
*/
645+
if (!hpet_address) {
646+
printk(KERN_WARNING PREFIX
647+
"HPET id: %#x base: %#lx is invalid\n",
648+
hpet_tbl->id, hpet_address);
649+
return 0;
650+
}
651+
#ifdef CONFIG_X86_64
652+
/*
653+
* Some even more broken BIOSes advertise HPET at
654+
* 0xfed0000000000000 instead of 0xfed00000. Fix it up and add
655+
* some noise:
656+
*/
657+
if (hpet_address == 0xfed0000000000000UL) {
658+
if (!hpet_force_user) {
659+
printk(KERN_WARNING PREFIX "HPET id: %#x "
660+
"base: 0xfed0000000000000 is bogus\n "
661+
"try hpet=force on the kernel command line to "
662+
"fix it up to 0xfed00000.\n", hpet_tbl->id);
663+
hpet_address = 0;
664+
return 0;
665+
}
666+
printk(KERN_WARNING PREFIX
667+
"HPET id: %#x base: 0xfed0000000000000 fixed up "
668+
"to 0xfed00000.\n", hpet_tbl->id);
669+
hpet_address >>= 32;
670+
}
671+
#endif
640672
printk(KERN_INFO PREFIX "HPET id: %#x base: %#lx\n",
641673
hpet_tbl->id, hpet_address);
642674

arch/x86/kernel/cpu/mcheck/mce_64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,7 @@ static __cpuinit int mce_create_device(unsigned int cpu)
810810
int err;
811811
int i;
812812

813-
if (!mce_available(&cpu_data(cpu)))
813+
if (!mce_available(&boot_cpu_data))
814814
return -EIO;
815815

816816
memset(&per_cpu(device_mce, cpu).kobj, 0, sizeof(struct kobject));

arch/x86/kernel/cpu/proc.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,6 @@ static int show_cpuinfo(struct seq_file *m, void *v)
8989
int fpu_exception;
9090

9191
#ifdef CONFIG_SMP
92-
if (!cpu_online(n))
93-
return 0;
9492
n = c->cpu_index;
9593
#endif
9694
seq_printf(m, "processor\t: %d\n"
@@ -177,14 +175,14 @@ static int show_cpuinfo(struct seq_file *m, void *v)
177175
static void *c_start(struct seq_file *m, loff_t *pos)
178176
{
179177
if (*pos == 0) /* just in case, cpu 0 is not the first */
180-
*pos = first_cpu(cpu_possible_map);
181-
if ((*pos) < NR_CPUS && cpu_possible(*pos))
178+
*pos = first_cpu(cpu_online_map);
179+
if ((*pos) < NR_CPUS && cpu_online(*pos))
182180
return &cpu_data(*pos);
183181
return NULL;
184182
}
185183
static void *c_next(struct seq_file *m, void *v, loff_t *pos)
186184
{
187-
*pos = next_cpu(*pos, cpu_possible_map);
185+
*pos = next_cpu(*pos, cpu_online_map);
188186
return c_start(m, pos);
189187
}
190188
static void c_stop(struct seq_file *m, void *v)

arch/x86/kernel/reboot_fixups_32.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ struct device_fixup {
3939
static struct device_fixup fixups_table[] = {
4040
{ PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5530_LEGACY, cs5530a_warm_reset },
4141
{ PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CS5536_ISA, cs5536_warm_reset },
42+
{ PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_SC1100_BRIDGE, cs5530a_warm_reset },
4243
};
4344

4445
/*

arch/x86/kernel/setup_64.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -892,7 +892,6 @@ void __cpuinit early_identify_cpu(struct cpuinfo_x86 *c)
892892

893893
#ifdef CONFIG_SMP
894894
c->phys_proc_id = (cpuid_ebx(1) >> 24) & 0xff;
895-
c->cpu_index = 0;
896895
#endif
897896
}
898897

@@ -1078,8 +1077,6 @@ static int show_cpuinfo(struct seq_file *m, void *v)
10781077

10791078

10801079
#ifdef CONFIG_SMP
1081-
if (!cpu_online(c->cpu_index))
1082-
return 0;
10831080
cpu = c->cpu_index;
10841081
#endif
10851082

@@ -1171,15 +1168,15 @@ static int show_cpuinfo(struct seq_file *m, void *v)
11711168
static void *c_start(struct seq_file *m, loff_t *pos)
11721169
{
11731170
if (*pos == 0) /* just in case, cpu 0 is not the first */
1174-
*pos = first_cpu(cpu_possible_map);
1175-
if ((*pos) < NR_CPUS && cpu_possible(*pos))
1171+
*pos = first_cpu(cpu_online_map);
1172+
if ((*pos) < NR_CPUS && cpu_online(*pos))
11761173
return &cpu_data(*pos);
11771174
return NULL;
11781175
}
11791176

11801177
static void *c_next(struct seq_file *m, void *v, loff_t *pos)
11811178
{
1182-
*pos = next_cpu(*pos, cpu_possible_map);
1179+
*pos = next_cpu(*pos, cpu_online_map);
11831180
return c_start(m, pos);
11841181
}
11851182

arch/x86/kernel/time_64.c

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -82,18 +82,15 @@ static int set_rtc_mmss(unsigned long nowtime)
8282
int retval = 0;
8383
int real_seconds, real_minutes, cmos_minutes;
8484
unsigned char control, freq_select;
85+
unsigned long flags;
8586

8687
/*
87-
* IRQs are disabled when we're called from the timer interrupt,
88-
* no need for spin_lock_irqsave()
88+
* set_rtc_mmss is called when irqs are enabled, so disable irqs here
8989
*/
90-
91-
spin_lock(&rtc_lock);
92-
90+
spin_lock_irqsave(&rtc_lock, flags);
9391
/*
9492
* Tell the clock it's being set and stop it.
9593
*/
96-
9794
control = CMOS_READ(RTC_CONTROL);
9895
CMOS_WRITE(control | RTC_SET, RTC_CONTROL);
9996

@@ -138,7 +135,7 @@ static int set_rtc_mmss(unsigned long nowtime)
138135
CMOS_WRITE(control, RTC_CONTROL);
139136
CMOS_WRITE(freq_select, RTC_FREQ_SELECT);
140137

141-
spin_unlock(&rtc_lock);
138+
spin_unlock_irqrestore(&rtc_lock, flags);
142139

143140
return retval;
144141
}
@@ -164,21 +161,27 @@ unsigned long read_persistent_clock(void)
164161
unsigned century = 0;
165162

166163
spin_lock_irqsave(&rtc_lock, flags);
164+
/*
165+
* if UIP is clear, then we have >= 244 microseconds before RTC
166+
* registers will be updated. Spec sheet says that this is the
167+
* reliable way to read RTC - registers invalid (off bus) during update
168+
*/
169+
while ((CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP))
170+
cpu_relax();
167171

168-
do {
169-
sec = CMOS_READ(RTC_SECONDS);
170-
min = CMOS_READ(RTC_MINUTES);
171-
hour = CMOS_READ(RTC_HOURS);
172-
day = CMOS_READ(RTC_DAY_OF_MONTH);
173-
mon = CMOS_READ(RTC_MONTH);
174-
year = CMOS_READ(RTC_YEAR);
172+
173+
/* now read all RTC registers while stable with interrupts disabled */
174+
sec = CMOS_READ(RTC_SECONDS);
175+
min = CMOS_READ(RTC_MINUTES);
176+
hour = CMOS_READ(RTC_HOURS);
177+
day = CMOS_READ(RTC_DAY_OF_MONTH);
178+
mon = CMOS_READ(RTC_MONTH);
179+
year = CMOS_READ(RTC_YEAR);
175180
#ifdef CONFIG_ACPI
176-
if (acpi_gbl_FADT.header.revision >= FADT2_REVISION_ID &&
177-
acpi_gbl_FADT.century)
178-
century = CMOS_READ(acpi_gbl_FADT.century);
181+
if (acpi_gbl_FADT.header.revision >= FADT2_REVISION_ID &&
182+
acpi_gbl_FADT.century)
183+
century = CMOS_READ(acpi_gbl_FADT.century);
179184
#endif
180-
} while (sec != CMOS_READ(RTC_SECONDS));
181-
182185
spin_unlock_irqrestore(&rtc_lock, flags);
183186

184187
/*

arch/x86/mach-voyager/voyager_cat.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ static voyager_module_t *voyager_initial_module;
568568
* boot cpu *after* all memory initialisation has been done (so we can
569569
* use kmalloc) but before smp initialisation, so we can probe the SMP
570570
* configuration and pick up necessary information. */
571-
void
571+
void __init
572572
voyager_cat_init(void)
573573
{
574574
voyager_module_t **modpp = &voyager_initial_module;

arch/x86/mach-voyager/voyager_smp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1900,7 +1900,7 @@ voyager_smp_prepare_cpus(unsigned int max_cpus)
19001900
smp_boot_cpus();
19011901
}
19021902

1903-
static void __devinit voyager_smp_prepare_boot_cpu(void)
1903+
static void __cpuinit voyager_smp_prepare_boot_cpu(void)
19041904
{
19051905
init_gdt(smp_processor_id());
19061906
switch_to_new_gdt();
@@ -1911,7 +1911,7 @@ static void __devinit voyager_smp_prepare_boot_cpu(void)
19111911
cpu_set(smp_processor_id(), cpu_present_map);
19121912
}
19131913

1914-
static int __devinit
1914+
static int __cpuinit
19151915
voyager_cpu_up(unsigned int cpu)
19161916
{
19171917
/* This only works at boot for x86. See "rewrite" above. */

arch/x86/pci/acpi.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ count_resource(struct acpi_resource *acpi_res, void *data)
7777
struct acpi_resource_address64 addr;
7878
acpi_status status;
7979

80+
if (info->res_num >= PCI_BUS_NUM_RESOURCES)
81+
return AE_OK;
82+
8083
status = resource_to_addr(acpi_res, &addr);
8184
if (ACPI_SUCCESS(status))
8285
info->res_num++;
@@ -93,6 +96,9 @@ setup_resource(struct acpi_resource *acpi_res, void *data)
9396
unsigned long flags;
9497
struct resource *root;
9598

99+
if (info->res_num >= PCI_BUS_NUM_RESOURCES)
100+
return AE_OK;
101+
96102
status = resource_to_addr(acpi_res, &addr);
97103
if (!ACPI_SUCCESS(status))
98104
return AE_OK;

0 commit comments

Comments
 (0)