From f2c84c0e84bfa637a7161eac10157cf3b05b4a73 Mon Sep 17 00:00:00 2001 From: Arthur Othieno Date: Sun, 30 Oct 2005 23:04:05 -0500 Subject: [PATCH] i386: CONFIG_PC removal CONFIG_PC is left-over cruft after the introduction of CONFIG_X86_PC with the subarch split. Remove it, and fixup the remaining users to depend on CONFIG_X86_PC instead. Signed-off-by: Arthur Othieno Signed-off-by: Linus Torvalds --- arch/i386/Kconfig | 5 ----- drivers/input/keyboard/Kconfig | 4 ++-- drivers/input/mouse/Kconfig | 2 +- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig index 5383e5e2d9b..bac0da731ee 100644 --- a/arch/i386/Kconfig +++ b/arch/i386/Kconfig @@ -1042,8 +1042,3 @@ config X86_TRAMPOLINE bool depends on X86_SMP || (X86_VOYAGER && SMP) default y - -config PC - bool - depends on X86 && !EMBEDDED - default y diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig index 571a68691a4..4a917748fd9 100644 --- a/drivers/input/keyboard/Kconfig +++ b/drivers/input/keyboard/Kconfig @@ -13,11 +13,11 @@ menuconfig INPUT_KEYBOARD if INPUT_KEYBOARD config KEYBOARD_ATKBD - tristate "AT keyboard" if !PC + tristate "AT keyboard" if !X86_PC default y select SERIO select SERIO_LIBPS2 - select SERIO_I8042 if PC + select SERIO_I8042 if X86_PC select SERIO_GSCPS2 if GSC help Say Y here if you want to use a standard AT or PS/2 keyboard. Usually diff --git a/drivers/input/mouse/Kconfig b/drivers/input/mouse/Kconfig index 537154dd7a8..574b18a523a 100644 --- a/drivers/input/mouse/Kconfig +++ b/drivers/input/mouse/Kconfig @@ -17,7 +17,7 @@ config MOUSE_PS2 default y select SERIO select SERIO_LIBPS2 - select SERIO_I8042 if PC + select SERIO_I8042 if X86_PC select SERIO_GSCPS2 if GSC ---help--- Say Y here if you have a PS/2 mouse connected to your system. This -- cgit v1.2.3 From a717f77362d4fe044721c126c89e2a38e731a576 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Mon, 31 Oct 2005 14:08:53 -0800 Subject: [PATCH] revert ide-scsi highmem cleanup Jeff Garzik points out that this was wrong: we need to disable local interrupts while holding KM_IRQ0 due to IRQ sharing. And holding interrupts off during a big PIO opration is expensive, so we only want to do that if we know the page was highmem. So revert commit 17fd47ab4d33e764216b87006d8118fa050b4c92 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/scsi/ide-scsi.c | 44 ++++++++++++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 12 deletions(-) diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c index 00d6a6657eb..a440ea38efa 100644 --- a/drivers/scsi/ide-scsi.c +++ b/drivers/scsi/ide-scsi.c @@ -180,12 +180,22 @@ static void idescsi_input_buffers (ide_drive_t *drive, idescsi_pc_t *pc, unsigne return; } count = min(pc->sg->length - pc->b_count, bcount); - buf = kmap_atomic(pc->sg->page, KM_IRQ0); - drive->hwif->atapi_input_bytes(drive, - buf + pc->b_count + pc->sg->offset, count); - kunmap_atomic(buf, KM_IRQ0); - bcount -= count; - pc->b_count += count; + if (PageHighMem(pc->sg->page)) { + unsigned long flags; + + local_irq_save(flags); + buf = kmap_atomic(pc->sg->page, KM_IRQ0) + + pc->sg->offset; + drive->hwif->atapi_input_bytes(drive, + buf + pc->b_count, count); + kunmap_atomic(buf - pc->sg->offset, KM_IRQ0); + local_irq_restore(flags); + } else { + buf = page_address(pc->sg->page) + pc->sg->offset; + drive->hwif->atapi_input_bytes(drive, + buf + pc->b_count, count); + } + bcount -= count; pc->b_count += count; if (pc->b_count == pc->sg->length) { pc->sg++; pc->b_count = 0; @@ -205,12 +215,22 @@ static void idescsi_output_buffers (ide_drive_t *drive, idescsi_pc_t *pc, unsign return; } count = min(pc->sg->length - pc->b_count, bcount); - buf = kmap_atomic(pc->sg->page, KM_IRQ0); - drive->hwif->atapi_output_bytes(drive, - buf + pc->b_count + pc->sg->offset, count); - kunmap_atomic(buf, KM_IRQ0); - bcount -= count; - pc->b_count += count; + if (PageHighMem(pc->sg->page)) { + unsigned long flags; + + local_irq_save(flags); + buf = kmap_atomic(pc->sg->page, KM_IRQ0) + + pc->sg->offset; + drive->hwif->atapi_output_bytes(drive, + buf + pc->b_count, count); + kunmap_atomic(buf - pc->sg->offset, KM_IRQ0); + local_irq_restore(flags); + } else { + buf = page_address(pc->sg->page) + pc->sg->offset; + drive->hwif->atapi_output_bytes(drive, + buf + pc->b_count, count); + } + bcount -= count; pc->b_count += count; if (pc->b_count == pc->sg->length) { pc->sg++; pc->b_count = 0; -- cgit v1.2.3 From 659603ef692d3f6c7c216e80310990253864bf2e Mon Sep 17 00:00:00 2001 From: Andrea Arcangeli Date: Mon, 31 Oct 2005 14:08:54 -0800 Subject: [PATCH] fix __writeback_single_inode WARN_ON When the inode count is zero in inode writeback, the WARN_ON(!(inode->i_state & I_WILL_FREE)); is broken, and needs to test for either I_WILL_FREE|I_FREEING. When the inode is in I_FREEING state, it's already out of the visibility of the vm so it can't be freed so it doesn't require the __iget and the generic_delete_inode path can call the sync internally to the lowlevel fs callback during the last iput. So the inode being in I_FREEING is also a valid condition for calling the sync with i_count == 0. The specific stack trace is this: 0xc00000007b8fb6e0 0xc00000000010118c .__writeback_single_inode +0x5c 0xc00000007b8fb6e0 0xc0000000001014dc (lr) .sync_inode +0x3c 0xc00000007b8fb790 0xc0000000001014dc .sync_inode +0x3c 0xc00000007b8fb820 0xc0000000001a5020 .ext2_sync_inode +0x64 0xc00000007b8fb8f0 0xc0000000001a65b4 .ext2_truncate +0x3f8 0xc00000007b8fba40 0xc0000000001a6940 .ext2_delete_inode +0xdc 0xc00000007b8fbac0 0xc0000000000f7a5c .generic_delete_inode +0x124 0xc00000007b8fbb50 0xc0000000000f5fe0 .iput +0xb8 0xc00000007b8fbbe0 0xc0000000000e9fd4 .sys_unlink +0x2a8 0xc00000007b8fbd10 0xc00000000001048c .ret_from_syscall_1 +0x0 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- fs/fs-writeback.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index ffab4783ac6..c27f8d4098b 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c @@ -247,7 +247,7 @@ __writeback_single_inode(struct inode *inode, struct writeback_control *wbc) wait_queue_head_t *wqh; if (!atomic_read(&inode->i_count)) - WARN_ON(!(inode->i_state & I_WILL_FREE)); + WARN_ON(!(inode->i_state & (I_WILL_FREE|I_FREEING))); else WARN_ON(inode->i_state & I_WILL_FREE); -- cgit v1.2.3 From d83c671fb7023f69a9582e622d01525054f23b66 Mon Sep 17 00:00:00 2001 From: James Courtier-Dutton Date: Mon, 31 Oct 2005 10:27:41 +0000 Subject: [PATCH] Creative Audigy 2 cardbus: Add IO window wakeup magic This adds the magic IO wakeup code for the CardBus version of the Creative Labs Audigy 2 to the snd-emu10k1 driver. Without the magic IO enable sequence, reading from the IO region of the card will fail spectacularly, and the machine will hang. My next task will be getting the driver to actually play sound without distortion. Signed-off-by: James Courtier-Dutton [ This is a work-in-progress, but since it avoids a total lockup if the emu10k module is loaded on a machine with the cardbus card inserted, we're better off with it than without it, even if sound quality is bad right now ] Signed-off-by: Linus Torvalds --- include/sound/emu10k1.h | 1 + sound/pci/emu10k1/emu10k1_main.c | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/include/sound/emu10k1.h b/include/sound/emu10k1.h index 14cb2718cb7..46e3c0bf3c9 100644 --- a/include/sound/emu10k1.h +++ b/include/sound/emu10k1.h @@ -1055,6 +1055,7 @@ typedef struct { unsigned char emu10k2_chip; /* Audigy 1 or Audigy 2. */ unsigned char ca0102_chip; /* Audigy 1 or Audigy 2. Not SB Audigy 2 Value. */ unsigned char ca0108_chip; /* Audigy 2 Value */ + unsigned char ca_cardbus_chip; /* Audigy 2 ZS Notebook */ unsigned char ca0151_chip; /* P16V */ unsigned char spk71; /* Has 7.1 speakers */ unsigned char sblive51; /* SBLive! 5.1 - extout 0x11 -> center, 0x12 -> lfe */ diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c index e9cd8e054f2..53aeff0b783 100644 --- a/sound/pci/emu10k1/emu10k1_main.c +++ b/sound/pci/emu10k1/emu10k1_main.c @@ -579,6 +579,30 @@ static int __devinit snd_emu10k1_ecard_init(emu10k1_t * emu) return 0; } +static int __devinit snd_emu10k1_cardbus_init(emu10k1_t * emu) +{ + unsigned long special_port; + unsigned int value; + + /* Special initialisation routine + * before the rest of the IO-Ports become active. + */ + special_port = emu->port + 0x38; + value = inl(special_port); + outl(0x00d00000, special_port); + value = inl(special_port); + outl(0x00d00001, special_port); + value = inl(special_port); + outl(0x00d0005f, special_port); + value = inl(special_port); + outl(0x00d0007f, special_port); + value = inl(special_port); + outl(0x0090007f, special_port); + value = inl(special_port); + + return 0; +} + /* * Create the EMU10K1 instance */ @@ -624,6 +648,16 @@ static emu_chip_details_t emu_chip_details[] = { .ca0108_chip = 1, .spk71 = 1, .ac97_chip = 1} , + /* Audigy 2 ZS Notebook Cardbus card.*/ + /* Tested by James@superbug.co.uk 30th October 2005 */ + /* Not working yet, but progressing. */ + {.vendor = 0x1102, .device = 0x0008, .subsystem = 0x20011102, + .driver = "Audigy2", .name = "Audigy 2 ZS Notebook [SB0530]", + .id = "Audigy2", + .emu10k2_chip = 1, + .ca0108_chip = 1, + .ca_cardbus_chip = 1, + .spk71 = 1} , {.vendor = 0x1102, .device = 0x0008, .driver = "Audigy2", .name = "Audigy 2 Value [Unknown]", .id = "Audigy2", @@ -1011,6 +1045,11 @@ int __devinit snd_emu10k1_create(snd_card_t * card, snd_emu10k1_free(emu); return err; } + } else if (emu->card_capabilities->ca_cardbus_chip) { + if ((err = snd_emu10k1_cardbus_init(emu)) < 0) { + snd_emu10k1_free(emu); + return err; + } } else { /* 5.1: Enable the additional AC97 Slots. If the emu10k1 version does not support this, it shouldn't do any harm */ -- cgit v1.2.3 From 1e4c85f97fe26fbd70da12148b3992c0e00361fd Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Mon, 31 Oct 2005 19:16:17 -0800 Subject: Revert "i386: move apic init in init_IRQs" Commit f2b36db692b7ff6972320ad9839ae656a3b0ee3e causes a bootup hang on at least one machine. Revert for now until we understand why. The old code may be ugly, but it works. Signed-off-by: Linus Torvalds --- arch/i386/kernel/apic.c | 77 ++++++--------------------- arch/i386/kernel/i8259.c | 4 -- arch/i386/kernel/io_apic.c | 6 +-- arch/i386/kernel/smpboot.c | 68 +++++++++++++++++------ arch/i386/kernel/time.c | 12 +---- include/asm-i386/apic.h | 3 +- include/asm-i386/hw_irq.h | 1 - include/asm-i386/mach-default/smpboot_hooks.h | 15 ++++++ include/asm-i386/mach-visws/smpboot_hooks.h | 7 +++ init/main.c | 11 ++++ 10 files changed, 104 insertions(+), 100 deletions(-) diff --git a/arch/i386/kernel/apic.c b/arch/i386/kernel/apic.c index 9204be6eedb..7c724ffa08b 100644 --- a/arch/i386/kernel/apic.c +++ b/arch/i386/kernel/apic.c @@ -803,7 +803,6 @@ no_apic: void __init init_apic_mappings(void) { - unsigned int orig_apicid; unsigned long apic_phys; /* @@ -825,11 +824,8 @@ void __init init_apic_mappings(void) * Fetch the APIC ID of the BSP in case we have a * default configuration (or the MP table is broken). */ - orig_apicid = boot_cpu_physical_apicid; - boot_cpu_physical_apicid = GET_APIC_ID(apic_read(APIC_ID)); - if ((orig_apicid != -1U) && (orig_apicid != boot_cpu_physical_apicid)) - printk(KERN_WARNING "Boot APIC ID in local APIC unexpected (%d vs %d)", - orig_apicid, boot_cpu_physical_apicid); + if (boot_cpu_physical_apicid == -1U) + boot_cpu_physical_apicid = GET_APIC_ID(apic_read(APIC_ID)); #ifdef CONFIG_X86_IO_APIC { @@ -1259,81 +1255,40 @@ fastcall void smp_error_interrupt(struct pt_regs *regs) } /* - * This initializes the IO-APIC and APIC hardware. + * This initializes the IO-APIC and APIC hardware if this is + * a UP kernel. */ -int __init APIC_init(void) +int __init APIC_init_uniprocessor (void) { - if (enable_local_apic < 0) { - printk(KERN_INFO "APIC disabled\n"); - return -1; - } + if (enable_local_apic < 0) + clear_bit(X86_FEATURE_APIC, boot_cpu_data.x86_capability); - /* See if we have a SMP configuration or have forced enabled - * the local apic. - */ - if (!smp_found_config && !acpi_lapic && !cpu_has_apic) { - enable_local_apic = -1; + if (!smp_found_config && !cpu_has_apic) return -1; - } /* - * Complain if the BIOS pretends there is an apic. - * Then get out because we don't have an a local apic. + * Complain if the BIOS pretends there is one. */ if (!cpu_has_apic && APIC_INTEGRATED(apic_version[boot_cpu_physical_apicid])) { printk(KERN_ERR "BIOS bug, local APIC #%d not detected!...\n", boot_cpu_physical_apicid); - printk(KERN_ERR "... forcing use of dummy APIC emulation. (tell your hw vendor)\n"); - enable_local_apic = -1; return -1; } verify_local_APIC(); - /* - * Should not be necessary because the MP table should list the boot - * CPU too, but we do it for the sake of robustness anyway. - * Makes no sense to do this check in clustered apic mode, so skip it - */ - if (!check_phys_apicid_present(boot_cpu_physical_apicid)) { - printk("weird, boot CPU (#%d) not listed by the BIOS.\n", - boot_cpu_physical_apicid); - physid_set(boot_cpu_physical_apicid, phys_cpu_present_map); - } - - /* - * Switch from PIC to APIC mode. - */ connect_bsp_APIC(); - setup_local_APIC(); -#ifdef CONFIG_X86_IO_APIC - /* - * Now start the IO-APICs - */ - if (smp_found_config && !skip_ioapic_setup && nr_ioapics) - setup_IO_APIC(); -#endif - return 0; -} + phys_cpu_present_map = physid_mask_of_physid(boot_cpu_physical_apicid); -void __init APIC_late_time_init(void) -{ - /* Improve our loops per jiffy estimate */ - loops_per_jiffy = ((1000 + HZ - 1)/HZ)*cpu_khz; - boot_cpu_data.loops_per_jiffy = loops_per_jiffy; - cpu_data[0].loops_per_jiffy = loops_per_jiffy; - - /* setup_apic_nmi_watchdog doesn't work properly before cpu_khz is - * initialized. So redo it here to ensure the boot cpu is setup - * properly. - */ - if (nmi_watchdog == NMI_LOCAL_APIC) - setup_apic_nmi_watchdog(); + setup_local_APIC(); #ifdef CONFIG_X86_IO_APIC - if (smp_found_config && !skip_ioapic_setup && nr_ioapics) - IO_APIC_late_time_init(); + if (smp_found_config) + if (!skip_ioapic_setup && nr_ioapics) + setup_IO_APIC(); #endif setup_boot_APIC_clock(); + + return 0; } diff --git a/arch/i386/kernel/i8259.c b/arch/i386/kernel/i8259.c index d86f2490928..323ef8ab324 100644 --- a/arch/i386/kernel/i8259.c +++ b/arch/i386/kernel/i8259.c @@ -435,8 +435,4 @@ void __init init_IRQ(void) setup_irq(FPU_IRQ, &fpu_irq); irq_ctx_init(smp_processor_id()); - -#ifdef CONFIG_X86_LOCAL_APIC - APIC_init(); -#endif } diff --git a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c index 5a77c52b20a..cc5d7ac5b2e 100644 --- a/arch/i386/kernel/io_apic.c +++ b/arch/i386/kernel/io_apic.c @@ -2387,15 +2387,11 @@ void __init setup_IO_APIC(void) sync_Arb_IDs(); setup_IO_APIC_irqs(); init_IO_APIC_traps(); + check_timer(); if (!acpi_ioapic) print_IO_APIC(); } -void __init IO_APIC_late_time_init(void) -{ - check_timer(); -} - /* * Called after all the initialization is done. If we didnt find any * APIC bugs then we can allow the modify fast path diff --git a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c index 5a2bbe0c4ff..01b618e73ec 100644 --- a/arch/i386/kernel/smpboot.c +++ b/arch/i386/kernel/smpboot.c @@ -1078,16 +1078,6 @@ void *xquad_portio; EXPORT_SYMBOL(xquad_portio); #endif -/* - * Fall back to non SMP mode after errors. - * - */ -static __init void disable_smp(void) -{ - cpu_set(0, cpu_sibling_map[0]); - cpu_set(0, cpu_core_map[0]); -} - static void __init smp_boot_cpus(unsigned int max_cpus) { int apicid, cpu, bit, kicked; @@ -1100,6 +1090,7 @@ static void __init smp_boot_cpus(unsigned int max_cpus) printk("CPU%d: ", 0); print_cpu_info(&cpu_data[0]); + boot_cpu_physical_apicid = GET_APIC_ID(apic_read(APIC_ID)); boot_cpu_logical_apicid = logical_smp_processor_id(); x86_cpu_to_apicid[0] = boot_cpu_physical_apicid; @@ -1111,27 +1102,68 @@ static void __init smp_boot_cpus(unsigned int max_cpus) cpus_clear(cpu_core_map[0]); cpu_set(0, cpu_core_map[0]); - map_cpu_to_logical_apicid(); - /* * If we couldn't find an SMP configuration at boot time, * get out of here now! */ if (!smp_found_config && !acpi_lapic) { printk(KERN_NOTICE "SMP motherboard not detected.\n"); - disable_smp(); + smpboot_clear_io_apic_irqs(); + phys_cpu_present_map = physid_mask_of_physid(0); + if (APIC_init_uniprocessor()) + printk(KERN_NOTICE "Local APIC not detected." + " Using dummy APIC emulation.\n"); + map_cpu_to_logical_apicid(); + cpu_set(0, cpu_sibling_map[0]); + cpu_set(0, cpu_core_map[0]); + return; + } + + /* + * Should not be necessary because the MP table should list the boot + * CPU too, but we do it for the sake of robustness anyway. + * Makes no sense to do this check in clustered apic mode, so skip it + */ + if (!check_phys_apicid_present(boot_cpu_physical_apicid)) { + printk("weird, boot CPU (#%d) not listed by the BIOS.\n", + boot_cpu_physical_apicid); + physid_set(hard_smp_processor_id(), phys_cpu_present_map); + } + + /* + * If we couldn't find a local APIC, then get out of here now! + */ + if (APIC_INTEGRATED(apic_version[boot_cpu_physical_apicid]) && !cpu_has_apic) { + printk(KERN_ERR "BIOS bug, local APIC #%d not detected!...\n", + boot_cpu_physical_apicid); + printk(KERN_ERR "... forcing use of dummy APIC emulation. (tell your hw vendor)\n"); + smpboot_clear_io_apic_irqs(); + phys_cpu_present_map = physid_mask_of_physid(0); + cpu_set(0, cpu_sibling_map[0]); + cpu_set(0, cpu_core_map[0]); return; } + verify_local_APIC(); + /* * If SMP should be disabled, then really disable it! */ - if (!max_cpus || (enable_local_apic < 0)) { - printk(KERN_INFO "SMP mode deactivated.\n"); - disable_smp(); + if (!max_cpus) { + smp_found_config = 0; + printk(KERN_INFO "SMP mode deactivated, forcing use of dummy APIC emulation.\n"); + smpboot_clear_io_apic_irqs(); + phys_cpu_present_map = physid_mask_of_physid(0); + cpu_set(0, cpu_sibling_map[0]); + cpu_set(0, cpu_core_map[0]); return; } + connect_bsp_APIC(); + setup_local_APIC(); + map_cpu_to_logical_apicid(); + + setup_portio_remap(); /* @@ -1212,6 +1244,10 @@ static void __init smp_boot_cpus(unsigned int max_cpus) cpu_set(0, cpu_sibling_map[0]); cpu_set(0, cpu_core_map[0]); + smpboot_setup_io_apic(); + + setup_boot_APIC_clock(); + /* * Synchronize the TSC with the AP */ diff --git a/arch/i386/kernel/time.c b/arch/i386/kernel/time.c index 07471bba2dc..41c5b2dc620 100644 --- a/arch/i386/kernel/time.c +++ b/arch/i386/kernel/time.c @@ -440,8 +440,8 @@ static int time_init_device(void) device_initcall(time_init_device); -extern void (*late_time_init)(void); #ifdef CONFIG_HPET_TIMER +extern void (*late_time_init)(void); /* Duplicate of time_init() below, with hpet_enable part added */ static void __init hpet_time_init(void) { @@ -458,11 +458,6 @@ static void __init hpet_time_init(void) printk(KERN_INFO "Using %s for high-res timesource\n",cur_timer->name); time_init_hook(); - -#ifdef CONFIG_X86_LOCAL_APIC - if (enable_local_apic >= 0) - APIC_late_time_init(); -#endif } #endif @@ -487,9 +482,4 @@ void __init time_init(void) printk(KERN_INFO "Using %s for high-res timesource\n",cur_timer->name); time_init_hook(); - -#ifdef CONFIG_X86_LOCAL_APIC - if (enable_local_apic >= 0) - late_time_init = APIC_late_time_init; -#endif } diff --git a/include/asm-i386/apic.h b/include/asm-i386/apic.h index a515e2aed82..8c454aa58ac 100644 --- a/include/asm-i386/apic.h +++ b/include/asm-i386/apic.h @@ -118,8 +118,7 @@ extern void release_lapic_nmi(void); extern void disable_timer_nmi_watchdog(void); extern void enable_timer_nmi_watchdog(void); extern void nmi_watchdog_tick (struct pt_regs * regs); -extern int APIC_init(void); -extern void APIC_late_time_init(void); +extern int APIC_init_uniprocessor (void); extern void disable_APIC_timer(void); extern void enable_APIC_timer(void); diff --git a/include/asm-i386/hw_irq.h b/include/asm-i386/hw_irq.h index 9139b89497a..622815bf324 100644 --- a/include/asm-i386/hw_irq.h +++ b/include/asm-i386/hw_irq.h @@ -55,7 +55,6 @@ void init_8259A(int aeoi); void FASTCALL(send_IPI_self(int vector)); void init_VISWS_APIC_irqs(void); void setup_IO_APIC(void); -void IO_APIC_late_time_init(void); void disable_IO_APIC(void); void print_IO_APIC(void); int IO_APIC_get_PCI_irq_vector(int bus, int slot, int fn); diff --git a/include/asm-i386/mach-default/smpboot_hooks.h b/include/asm-i386/mach-default/smpboot_hooks.h index d7c70c144f9..7f45f631105 100644 --- a/include/asm-i386/mach-default/smpboot_hooks.h +++ b/include/asm-i386/mach-default/smpboot_hooks.h @@ -1,6 +1,11 @@ /* two abstractions specific to kernel/smpboot.c, mainly to cater to visws * which needs to alter them. */ +static inline void smpboot_clear_io_apic_irqs(void) +{ + io_apic_irqs = 0; +} + static inline void smpboot_setup_warm_reset_vector(unsigned long start_eip) { CMOS_WRITE(0xa, 0xf); @@ -27,3 +32,13 @@ static inline void smpboot_restore_warm_reset_vector(void) *((volatile long *) phys_to_virt(0x467)) = 0; } + +static inline void smpboot_setup_io_apic(void) +{ + /* + * Here we can be sure that there is an IO-APIC in the system. Let's + * go and set it up: + */ + if (!skip_ioapic_setup && nr_ioapics) + setup_IO_APIC(); +} diff --git a/include/asm-i386/mach-visws/smpboot_hooks.h b/include/asm-i386/mach-visws/smpboot_hooks.h index 14d8e0375f7..d926471fa35 100644 --- a/include/asm-i386/mach-visws/smpboot_hooks.h +++ b/include/asm-i386/mach-visws/smpboot_hooks.h @@ -11,7 +11,14 @@ static inline void smpboot_setup_warm_reset_vector(unsigned long start_eip) /* for visws do nothing for any of these */ +static inline void smpboot_clear_io_apic_irqs(void) +{ +} + static inline void smpboot_restore_warm_reset_vector(void) { } +static inline void smpboot_setup_io_apic(void) +{ +} diff --git a/init/main.c b/init/main.c index 4075d97e94b..f142d403534 100644 --- a/init/main.c +++ b/init/main.c @@ -64,6 +64,10 @@ #endif #endif +#ifdef CONFIG_X86_LOCAL_APIC +#include +#endif + /* * Versions of gcc older than that listed below may actually compile * and link okay, but the end product can have subtle run time bugs. @@ -310,7 +314,14 @@ extern void setup_arch(char **); #ifndef CONFIG_SMP +#ifdef CONFIG_X86_LOCAL_APIC +static void __init smp_init(void) +{ + APIC_init_uniprocessor(); +} +#else #define smp_init() do { } while (0) +#endif static inline void setup_per_cpu_areas(void) { } static inline void smp_prepare_cpus(unsigned int maxcpus) { } -- cgit v1.2.3 From 541ab4af11d5b41b95cd633e9b1d96cea9947ac2 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Mon, 31 Oct 2005 21:12:40 -0800 Subject: Don't touch USB controller IO registers when they are disabled The USB "handoff" code is an early PCI quirk to make sure we own the USB controller (as opposed to the BIOS/SMM). But if the controller isn't even enabled yet, don't try to access it. Acked-by: Paul Mackerras (who had an alternate patch) Signed-off-by: Linus Torvalds --- drivers/usb/host/pci-quirks.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c index b7fd3f644e1..b1aa350fd32 100644 --- a/drivers/usb/host/pci-quirks.c +++ b/drivers/usb/host/pci-quirks.c @@ -138,11 +138,23 @@ reset_needed: } EXPORT_SYMBOL_GPL(uhci_check_and_reset_hc); +static inline int io_type_enabled(struct pci_dev *pdev, unsigned int mask) +{ + u16 cmd; + return !pci_read_config_word(pdev, PCI_COMMAND, &cmd) && (cmd & mask); +} + +#define pio_enabled(dev) io_type_enabled(dev, PCI_COMMAND_IO) +#define mmio_enabled(dev) io_type_enabled(dev, PCI_COMMAND_MEMORY) + static void __devinit quirk_usb_handoff_uhci(struct pci_dev *pdev) { unsigned long base = 0; int i; + if (!pio_enabled(pdev)) + return; + for (i = 0; i < PCI_ROM_RESOURCE; i++) if ((pci_resource_flags(pdev, i) & IORESOURCE_IO)) { base = pci_resource_start(pdev, i); @@ -153,12 +165,20 @@ static void __devinit quirk_usb_handoff_uhci(struct pci_dev *pdev) uhci_check_and_reset_hc(pdev, base); } +static int __devinit mmio_resource_enabled(struct pci_dev *pdev, int idx) +{ + return pci_resource_start(pdev, idx) && mmio_enabled(pdev); +} + static void __devinit quirk_usb_handoff_ohci(struct pci_dev *pdev) { void __iomem *base; int wait_time; u32 control; + if (!mmio_resource_enabled(pdev, 0)) + return; + base = ioremap_nocache(pci_resource_start(pdev, 0), pci_resource_len(pdev, 0)); if (base == NULL) return; @@ -201,6 +221,9 @@ static void __devinit quirk_usb_disable_ehci(struct pci_dev *pdev) u32 hcc_params, val, temp; u8 cap_length; + if (!mmio_resource_enabled(pdev, 0)) + return; + base = ioremap_nocache(pci_resource_start(pdev, 0), pci_resource_len(pdev, 0)); if (base == NULL) return; -- cgit v1.2.3 From 3aebf25bdcf030f3e4afeb9340486d5b46deb46e Mon Sep 17 00:00:00 2001 From: Anton Altaparmakov Date: Tue, 1 Nov 2005 15:49:31 +0000 Subject: NTFS: Fix a stupid bug causing writes to non-initialized pages to segfault. Signed-off-by: Anton Altaparmakov --- fs/ntfs/file.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/fs/ntfs/file.c b/fs/ntfs/file.c index cf3e6ced2d0..72753389181 100644 --- a/fs/ntfs/file.c +++ b/fs/ntfs/file.c @@ -668,10 +668,10 @@ map_buffer_cached: * to, we need to read it in before the write, * i.e. now. */ - if (!buffer_uptodate(bh) && ((bh_pos < pos && - bh_end > pos) || - (bh_end > end && - bh_end > end))) { + if (!buffer_uptodate(bh) && bh_pos < end && + bh_end > pos && + (bh_pos < pos || + bh_end > end)) { /* * If the buffer is fully or partially * within the initialized size, do an @@ -784,10 +784,11 @@ retry_remap: blocksize_bits); cdelta = 0; /* - * If the number of remaining clusters in the - * @pages is smaller or equal to the number of - * cached clusters, unlock the runlist as the - * map cache will be used from now on. + * If the number of remaining clusters touched + * by the write is smaller or equal to the + * number of cached clusters, unlock the + * runlist as the map cache will be used from + * now on. */ if (likely(vcn + vcn_len >= cend)) { if (rl_write_locked) { -- cgit v1.2.3