From 8094f525b4a5872be819cc035c6505f1dc78c280 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Fri, 23 Nov 2007 15:35:10 -0500 Subject: [PATCH] Import 2.3.99pre10-2 --- arch/i386/defconfig | 2 +- arch/i386/kernel/apic.c | 5 +++++ arch/i386/kernel/smp.c | 10 ++++++++++ arch/i386/kernel/smpboot.c | 5 +++++ include/asm-i386/apic.h | 5 +++++ 5 files changed, 26 insertions(+), 1 deletion(-) diff --git a/arch/i386/defconfig b/arch/i386/defconfig index e00ac753a26c..925311887515 100644 --- a/arch/i386/defconfig +++ b/arch/i386/defconfig @@ -19,6 +19,7 @@ CONFIG_UID16=y # CONFIG_M586 is not set # CONFIG_M586TSC is not set CONFIG_M686=y +# CONFIG_M686FX is not set # CONFIG_MK6 is not set # CONFIG_MK7 is not set CONFIG_X86_WP_WORKS_OK=y @@ -194,7 +195,6 @@ CONFIG_IDEPCI_SHARE_IRQ=y # CONFIG_BLK_DEV_OFFBOARD is not set # CONFIG_IDEDMA_PCI_AUTO is not set # CONFIG_BLK_DEV_IDEDMA is not set -# CONFIG_IDEDMA_PCI_EXPERIMENTAL is not set # CONFIG_IDEDMA_PCI_WIP is not set # CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set # CONFIG_BLK_DEV_AEC62XX is not set diff --git a/arch/i386/kernel/apic.c b/arch/i386/kernel/apic.c index eab365e260e1..0a19bb758be6 100644 --- a/arch/i386/kernel/apic.c +++ b/arch/i386/kernel/apic.c @@ -128,6 +128,11 @@ void disable_local_APIC(void) void __init sync_Arb_IDs(void) { + /* + * Wait for idle. + */ + apic_wait_icr_idle(); + Dprintk("Synchronizing Arb IDs.\n"); apic_write_around(APIC_ICR, APIC_DEST_ALLINC | APIC_INT_LEVELTRIG | APIC_DM_INIT); diff --git a/arch/i386/kernel/smp.c b/arch/i386/kernel/smp.c index 94ba5c49f70d..e08418fe0675 100644 --- a/arch/i386/kernel/smp.c +++ b/arch/i386/kernel/smp.c @@ -132,6 +132,11 @@ static inline void __send_IPI_shortcut(unsigned int shortcut, int vector) */ unsigned int cfg; + /* + * Wait for idle. + */ + apic_wait_icr_idle(); + /* * No need to touch the target chip field */ @@ -172,6 +177,11 @@ static inline void send_IPI_mask(int mask, int vector) __save_flags(flags); __cli(); + /* + * Wait for idle. + */ + apic_wait_icr_idle(); + /* * prepare target chip field */ diff --git a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c index ae84ff2b5749..e0ae38b28e42 100644 --- a/arch/i386/kernel/smpboot.c +++ b/arch/i386/kernel/smpboot.c @@ -502,6 +502,11 @@ static inline void inquire_remote_apic(int apicid) for (i = 0; i < sizeof(regs) / sizeof(*regs); i++) { printk("... APIC #%d %s: ", apicid, names[i]); + /* + * Wait for idle. + */ + apic_wait_icr_idle(); + apic_write_around(APIC_ICR2, SET_APIC_DEST_FIELD(apicid)); apic_write_around(APIC_ICR, APIC_DM_REMRD | regs[i]); diff --git a/include/asm-i386/apic.h b/include/asm-i386/apic.h index 9ee236336304..ce1662409a63 100644 --- a/include/asm-i386/apic.h +++ b/include/asm-i386/apic.h @@ -34,6 +34,11 @@ extern __inline unsigned long apic_read(unsigned long reg) return *((volatile unsigned long *)(APIC_BASE+reg)); } +static __inline__ void apic_wait_icr_idle(void) +{ + do { } while ( apic_read( APIC_ICR ) & APIC_ICR_BUSY ); +} + extern unsigned int apic_timer_irqs [NR_CPUS]; #ifdef CONFIG_X86_GOOD_APIC -- 2.39.5