diff -Nru a/Makefile b/Makefile --- a/Makefile Sat Jul 12 01:46:25 2003 +++ b/Makefile Sat Jul 12 01:46:25 2003 @@ -213,7 +213,7 @@ NOSTDINC_FLAGS = -nostdinc -iwithprefix include CPPFLAGS := -D__KERNEL__ -Iinclude -CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -O2 \ +CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -g -O2 \ -fno-strict-aliasing -fno-common AFLAGS := -D__ASSEMBLY__ $(CPPFLAGS) diff -Nru a/arch/ia64/Kconfig b/arch/ia64/Kconfig --- a/arch/ia64/Kconfig Sat Jul 12 01:46:25 2003 +++ b/arch/ia64/Kconfig Sat Jul 12 01:46:25 2003 @@ -708,6 +708,33 @@ keys are documented in . Don't say Y unless you really know what this hack does. +config IA64_EARLY_PRINTK + bool "Early printk support" + depends on DEBUG_KERNEL && !IA64_GENERIC + help + Selecting this option uses the VGA screen or serial console for + printk() output before the consoles are initialised. It is useful + for debugging problems early in the boot process, but only if you + have a suitable VGA/serial console attached. If you're unsure, + select N. + +config IA64_EARLY_PRINTK_UART + bool "Early printk on MMIO serial port" + depends on IA64_EARLY_PRINTK + +config IA64_EARLY_PRINTK_UART_BASE + hex "UART MMIO base address" + depends on IA64_EARLY_PRINTK_UART + default "ff5e0000" + +config IA64_EARLY_PRINTK_VGA + bool "Early printk on VGA" + depends on IA64_EARLY_PRINTK + +config IA64_EARLY_PRINTK_SGI_SN + bool "Early printk on SGI SN serial console" + depends on IA64_EARLY_PRINTK && (IA64_GENERIC || IA64_SGI_SN2) + config DEBUG_SLAB bool "Debug memory allocations" depends on DEBUG_KERNEL diff -Nru a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S --- a/arch/ia64/kernel/entry.S Sat Jul 12 01:46:25 2003 +++ b/arch/ia64/kernel/entry.S Sat Jul 12 01:46:25 2003 @@ -688,7 +688,7 @@ mov b7=r0 // clear b7 ;; (pUStk) st1 [r14]=r3 - movl r17=THIS_CPU(ia64_phys_stacked_size_p8) + addl r17=THIS_CPU(ia64_phys_stacked_size_p8),r0 ;; mov r16=ar.bsp // get existing backing store pointer srlz.i // ensure interruption collection is off @@ -841,7 +841,7 @@ shr.u r18=r19,16 // get byte size of existing "dirty" partition ;; mov r16=ar.bsp // get existing backing store pointer - movl r17=THIS_CPU(ia64_phys_stacked_size_p8) + addl r17=THIS_CPU(ia64_phys_stacked_size_p8),r0 ;; ld4 r17=[r17] // r17 = cpu_data->phys_stacked_size_p8 (pKStk) br.cond.dpnt skip_rbs_switch diff -Nru a/arch/ia64/kernel/fsys.S b/arch/ia64/kernel/fsys.S --- a/arch/ia64/kernel/fsys.S Sat Jul 12 01:46:24 2003 +++ b/arch/ia64/kernel/fsys.S Sat Jul 12 01:46:24 2003 @@ -165,7 +165,7 @@ .altrp b6 .body add r9=TI_FLAGS+IA64_TASK_SIZE,r16 - movl r3=THIS_CPU(cpu_info) + addl r3=THIS_CPU(cpu_info),r0 mov.m r31=ar.itc // put time stamp into r31 (ITC) == now (35 cyc) #ifdef CONFIG_SMP @@ -177,7 +177,7 @@ movl r19=xtime // xtime is a timespec struct ld8 r10=[r10] // r10 <- __per_cpu_offset[0] - movl r21=THIS_CPU(cpu_info) + addl r21=THIS_CPU(cpu_info),r0 ;; add r10=r21, r10 // r10 <- &cpu_data(time_keeper_id) tbit.nz p8,p0 = r2, IA64_SAL_PLATFORM_FEATURE_ITC_DRIFT_BIT diff -Nru a/arch/ia64/kernel/init_task.c b/arch/ia64/kernel/init_task.c --- a/arch/ia64/kernel/init_task.c Sat Jul 12 01:46:25 2003 +++ b/arch/ia64/kernel/init_task.c Sat Jul 12 01:46:25 2003 @@ -2,7 +2,7 @@ * This is where we statically allocate and initialize the initial * task. * - * Copyright (C) 1999, 2002 Hewlett-Packard Co + * Copyright (C) 1999, 2002-2003 Hewlett-Packard Co * David Mosberger-Tang */ @@ -34,7 +34,7 @@ struct thread_info thread_info; } s; unsigned long stack[KERNEL_STACK_SIZE/sizeof (unsigned long)]; -} init_task_mem __attribute__((section(".data.init_task"))) = {{ +} init_task_mem asm ("init_task_mem") __attribute__((section(".data.init_task"))) = {{ .task = INIT_TASK(init_task_mem.s.task), .thread_info = INIT_THREAD_INFO(init_task_mem.s.task) }}; diff -Nru a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c --- a/arch/ia64/kernel/process.c Sat Jul 12 01:46:25 2003 +++ b/arch/ia64/kernel/process.c Sat Jul 12 01:46:25 2003 @@ -45,7 +45,7 @@ ia64_do_show_stack (struct unw_frame_info *info, void *arg) { unsigned long ip, sp, bsp; - char buf[80]; /* don't make it so big that it overflows the stack! */ + char buf[128]; /* don't make it so big that it overflows the stack! */ printk("\nCall Trace:\n"); do { @@ -55,7 +55,9 @@ unw_get_sp(info, &sp); unw_get_bsp(info, &bsp); - snprintf(buf, sizeof(buf), " [<%016lx>] %%s\n\t\t\t\tsp=%016lx bsp=%016lx\n", + snprintf(buf, sizeof(buf), + " [<%016lx>] %%s\n" + " sp=%016lx bsp=%016lx\n", ip, sp, bsp); print_symbol(buf, ip); } while (unw_unwind(info) >= 0); diff -Nru a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c --- a/arch/ia64/kernel/time.c Sat Jul 12 01:46:25 2003 +++ b/arch/ia64/kernel/time.c Sat Jul 12 01:46:25 2003 @@ -83,12 +83,11 @@ itc_get_offset (void) { unsigned long elapsed_cycles, lost = jiffies - wall_jiffies; - unsigned long now, last_tick; + unsigned long now = ia64_get_itc(), last_tick; last_tick = (cpu_data(TIME_KEEPER_ID)->itm_next - (lost + 1)*cpu_data(TIME_KEEPER_ID)->itm_delta); - now = ia64_get_itc(); if (unlikely((long) (now - last_tick) < 0)) { printk(KERN_ERR "CPU %d: now < last_tick (now=0x%lx,last_tick=0x%lx)!\n", smp_processor_id(), now, last_tick); diff -Nru a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c --- a/drivers/acpi/pci_irq.c Sat Jul 12 01:46:25 2003 +++ b/drivers/acpi/pci_irq.c Sat Jul 12 01:46:25 2003 @@ -24,6 +24,8 @@ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +#include + #include #include #include @@ -36,6 +38,9 @@ #ifdef CONFIG_X86_IO_APIC #include #endif +#ifdef CONFIG_IOSAPIC +# include +#endif #include #include @@ -248,6 +253,8 @@ return_VALUE(0); } + entry->irq = entry->link.index; + if (!entry->irq && entry->link.handle) { entry->irq = acpi_pci_link_get_irq(entry->link.handle, entry->link.index); if (!entry->irq) { @@ -356,7 +363,11 @@ } } +#ifdef CONFIG_IA64 + dev->irq = gsi_to_irq(irq); +#else dev->irq = irq; +#endif ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device %s using IRQ %d\n", dev->slot_name, dev->irq)); @@ -369,6 +380,10 @@ irq_mask |= (1 << dev->irq); eisa_set_level_irq(dev->irq); } +#endif +#ifdef CONFIG_IOSAPIC + if (acpi_irq_model == ACPI_IRQ_MODEL_IOSAPIC) + iosapic_enable_intr(dev->irq); #endif return_VALUE(dev->irq); diff -Nru a/drivers/char/agp/hp-agp.c b/drivers/char/agp/hp-agp.c --- a/drivers/char/agp/hp-agp.c Sat Jul 12 01:46:25 2003 +++ b/drivers/char/agp/hp-agp.c Sat Jul 12 01:46:25 2003 @@ -1,17 +1,36 @@ /* - * HP AGPGART routines. + * HP AGPGART routines. + * Copyright (C) 2002-2003 Hewlett-Packard Co + * Bjorn Helgaas */ +#include #include #include #include #include + +#include + #include "agp.h" #ifndef log2 #define log2(x) ffz(~(x)) #endif +#define HP_ZX1_IOC_OFFSET 0x1000 /* ACPI reports SBA, we want IOC */ + +/* HP ZX1 IOC registers */ +#define HP_ZX1_IBASE 0x300 +#define HP_ZX1_IMASK 0x308 +#define HP_ZX1_PCOM 0x310 +#define HP_ZX1_TCNFG 0x318 +#define HP_ZX1_PDIR_BASE 0x320 + +/* HP ZX1 LBA registers */ +#define HP_ZX1_AGP_STATUS 0x64 +#define HP_ZX1_AGP_COMMAND 0x68 + #define HP_ZX1_IOVA_BASE GB(1UL) #define HP_ZX1_IOVA_SIZE GB(1UL) #define HP_ZX1_GART_SIZE (HP_ZX1_IOVA_SIZE / 2) @@ -20,6 +39,9 @@ #define HP_ZX1_PDIR_VALID_BIT 0x8000000000000000UL #define HP_ZX1_IOVA_TO_PDIR(va) ((va - hp_private.iova_base) >> hp_private.io_tlb_shift) +/* AGP bridge need not be PCI device, but DRM thinks it is. */ +static struct pci_dev fake_bridge_dev; + static struct aper_size_info_fixed hp_zx1_sizes[] = { {0, 0, 0}, /* filled in by hp_zx1_fetch_size() */ @@ -31,8 +53,8 @@ }; static struct _hp_private { - struct pci_dev *ioc; - volatile u8 *registers; + volatile u8 *ioc_regs; + volatile u8 *lba_regs; u64 *io_pdir; // PDIR for entire IOVA u64 *gatt; // PDIR just for GART (subset of above) u64 gatt_entries; @@ -59,7 +81,7 @@ * - IOVA space is 1Gb in size * - first 512Mb is IOMMU, second 512Mb is GART */ - hp->io_tlb_ps = INREG64(hp->registers, HP_ZX1_TCNFG); + hp->io_tlb_ps = INREG64(hp->ioc_regs, HP_ZX1_TCNFG); switch (hp->io_tlb_ps) { case 0: hp->io_tlb_shift = 12; break; case 1: hp->io_tlb_shift = 13; break; @@ -75,13 +97,13 @@ hp->io_page_size = 1 << hp->io_tlb_shift; hp->io_pages_per_kpage = PAGE_SIZE / hp->io_page_size; - hp->iova_base = INREG64(hp->registers, HP_ZX1_IBASE) & ~0x1; + hp->iova_base = INREG64(hp->ioc_regs, HP_ZX1_IBASE) & ~0x1; hp->gart_base = hp->iova_base + HP_ZX1_IOVA_SIZE - HP_ZX1_GART_SIZE; hp->gart_size = HP_ZX1_GART_SIZE; hp->gatt_entries = hp->gart_size / hp->io_page_size; - hp->io_pdir = phys_to_virt(INREG64(hp->registers, HP_ZX1_PDIR_BASE)); + hp->io_pdir = phys_to_virt(INREG64(hp->ioc_regs, HP_ZX1_PDIR_BASE)); hp->gatt = &hp->io_pdir[HP_ZX1_IOVA_TO_PDIR(hp->gart_base)]; if (hp->gatt[0] != HP_ZX1_SBA_IOMMU_COOKIE) { @@ -95,7 +117,8 @@ return 0; } -static int __init hp_zx1_ioc_owner(u8 ioc_rev) +static int __init +hp_zx1_ioc_owner (void) { struct _hp_private *hp = &hp_private; @@ -130,47 +153,28 @@ return 0; } -static int __init hp_zx1_ioc_init(void) +static int __init +hp_zx1_ioc_init (u64 ioc_hpa, u64 lba_hpa) { struct _hp_private *hp = &hp_private; - struct pci_dev *ioc; - int i; - u8 ioc_rev; - - ioc = pci_find_device(PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_ZX1_IOC, NULL); - if (!ioc) { - printk(KERN_ERR PFX "Detected HP ZX1 AGP bridge but no IOC\n"); - return -ENODEV; - } - hp->ioc = ioc; - - pci_read_config_byte(ioc, PCI_REVISION_ID, &ioc_rev); - for (i = 0; i < PCI_NUM_RESOURCES; i++) { - if (pci_resource_flags(ioc, i) == IORESOURCE_MEM) { - hp->registers = (u8 *) ioremap(pci_resource_start(ioc, i), - pci_resource_len(ioc, i)); - break; - } - } - if (!hp->registers) { - printk(KERN_ERR PFX "Detected HP ZX1 AGP bridge but no CSRs\n"); - return -ENODEV; - } + hp->ioc_regs = ioremap(ioc_hpa, 1024); + hp->lba_regs = ioremap(lba_hpa, 256); /* * If the IOTLB is currently disabled, we can take it over. * Otherwise, we have to share with sba_iommu. */ - hp->io_pdir_owner = (INREG64(hp->registers, HP_ZX1_IBASE) & 0x1) == 0; + hp->io_pdir_owner = (INREG64(hp->ioc_regs, HP_ZX1_IBASE) & 0x1) == 0; if (hp->io_pdir_owner) - return hp_zx1_ioc_owner(ioc_rev); + return hp_zx1_ioc_owner(); return hp_zx1_ioc_shared(); } -static int hp_zx1_fetch_size(void) +static int +hp_zx1_fetch_size(void) { int size; @@ -180,47 +184,53 @@ return size; } -static int hp_zx1_configure(void) +static int +hp_zx1_configure (void) { struct _hp_private *hp = &hp_private; agp_bridge->gart_bus_addr = hp->gart_base; +#if 0 + /* ouch!! can't do that with a non-PCI AGP bridge... */ agp_bridge->capndx = pci_find_capability(agp_bridge->dev, PCI_CAP_ID_AGP); - pci_read_config_dword(agp_bridge->dev, - agp_bridge->capndx + PCI_AGP_STATUS, &agp_bridge->mode); +#else + agp_bridge->capndx = 0; +#endif + agp_bridge->mode = INREG32(hp->lba_regs, HP_ZX1_AGP_STATUS); if (hp->io_pdir_owner) { - OUTREG64(hp->registers, HP_ZX1_PDIR_BASE, - virt_to_phys(hp->io_pdir)); - OUTREG64(hp->registers, HP_ZX1_TCNFG, hp->io_tlb_ps); - OUTREG64(hp->registers, HP_ZX1_IMASK, ~(HP_ZX1_IOVA_SIZE - 1)); - OUTREG64(hp->registers, HP_ZX1_IBASE, hp->iova_base | 0x1); - OUTREG64(hp->registers, HP_ZX1_PCOM, - hp->iova_base | log2(HP_ZX1_IOVA_SIZE)); - INREG64(hp->registers, HP_ZX1_PCOM); + OUTREG64(hp->ioc_regs, HP_ZX1_PDIR_BASE, virt_to_phys(hp->io_pdir)); + OUTREG64(hp->ioc_regs, HP_ZX1_TCNFG, hp->io_tlb_ps); + OUTREG64(hp->ioc_regs, HP_ZX1_IMASK, ~(HP_ZX1_IOVA_SIZE - 1)); + OUTREG64(hp->ioc_regs, HP_ZX1_IBASE, hp->iova_base | 0x1); + OUTREG64(hp->ioc_regs, HP_ZX1_PCOM, hp->iova_base | log2(HP_ZX1_IOVA_SIZE)); + INREG64(hp->ioc_regs, HP_ZX1_PCOM); } return 0; } -static void hp_zx1_cleanup(void) +static void +hp_zx1_cleanup (void) { struct _hp_private *hp = &hp_private; if (hp->io_pdir_owner) - OUTREG64(hp->registers, HP_ZX1_IBASE, 0); - iounmap((void *) hp->registers); + OUTREG64(hp->ioc_regs, HP_ZX1_IBASE, 0); + iounmap((void *) hp->ioc_regs); } -static void hp_zx1_tlbflush(struct agp_memory *mem) +static void +hp_zx1_tlbflush (struct agp_memory *mem) { struct _hp_private *hp = &hp_private; - OUTREG64(hp->registers, HP_ZX1_PCOM, hp->gart_base | log2(hp->gart_size)); - INREG64(hp->registers, HP_ZX1_PCOM); + OUTREG64(hp->ioc_regs, HP_ZX1_PCOM, hp->gart_base | log2(hp->gart_size)); + INREG64(hp->ioc_regs, HP_ZX1_PCOM); } -static int hp_zx1_create_gatt_table(void) +static int +hp_zx1_create_gatt_table (void) { struct _hp_private *hp = &hp_private; int i; @@ -247,7 +257,8 @@ return 0; } -static int hp_zx1_free_gatt_table(void) +static int +hp_zx1_free_gatt_table (void) { struct _hp_private *hp = &hp_private; @@ -259,8 +270,8 @@ return 0; } -static int hp_zx1_insert_memory(struct agp_memory *mem, off_t pg_start, - int type) +static int +hp_zx1_insert_memory (struct agp_memory *mem, off_t pg_start, int type) { struct _hp_private *hp = &hp_private; int i, k; @@ -305,8 +316,8 @@ return 0; } -static int hp_zx1_remove_memory(struct agp_memory *mem, off_t pg_start, - int type) +static int +hp_zx1_remove_memory (struct agp_memory *mem, off_t pg_start, int type) { struct _hp_private *hp = &hp_private; int i, io_pg_start, io_pg_count; @@ -325,11 +336,28 @@ return 0; } -static unsigned long hp_zx1_mask_memory(unsigned long addr, int type) +static unsigned long +hp_zx1_mask_memory (unsigned long addr, int type) { return HP_ZX1_PDIR_VALID_BIT | addr; } +static void +hp_zx1_enable (u32 mode) +{ + struct _hp_private *hp = &hp_private; + u32 command; + + command = INREG32(hp->lba_regs, HP_ZX1_AGP_STATUS); + + command = agp_collect_device_status(mode, command); + command |= 0x00000100; + + OUTREG32(hp->lba_regs, HP_ZX1_AGP_COMMAND, command); + + agp_device_command(command, 0); +} + struct agp_bridge_driver hp_zx1_driver = { .owner = THIS_MODULE, .size_type = FIXED_APER_SIZE, @@ -339,7 +367,7 @@ .tlb_flush = hp_zx1_tlbflush, .mask_memory = hp_zx1_mask_memory, .masks = hp_zx1_masks, - .agp_enable = agp_generic_enable, + .agp_enable = hp_zx1_enable, .cache_flush = global_cache_flush, .create_gatt_table = hp_zx1_create_gatt_table, .free_gatt_table = hp_zx1_free_gatt_table, @@ -352,71 +380,93 @@ .cant_use_aperture = 1, }; -static int __init agp_hp_probe(struct pci_dev *pdev, - const struct pci_device_id *ent) +static int __init +hp_zx1_setup (u64 ioc_hpa, u64 lba_hpa) { struct agp_bridge_data *bridge; int error; - /* ZX1 LBAs can be either PCI or AGP bridges */ - if (!pci_find_capability(pdev, PCI_CAP_ID_AGP)) - return -ENODEV; - - printk(KERN_INFO PFX "Detected HP ZX1 AGP chipset at %s\n", - pdev->slot_name); + printk(KERN_INFO PFX "Detected HP ZX1 AGP chipset (ioc=%lx, lba=%lx)\n", ioc_hpa, lba_hpa); - error = hp_zx1_ioc_init(); + error = hp_zx1_ioc_init(ioc_hpa, lba_hpa); if (error) return error; bridge = agp_alloc_bridge(); if (!bridge) return -ENOMEM; - bridge->driver = &hp_zx1_driver; - bridge->dev = pdev; - pci_set_drvdata(pdev, bridge); + fake_bridge_dev.vendor = PCI_VENDOR_ID_HP; + fake_bridge_dev.device = PCI_DEVICE_ID_HP_ZX1_LBA; + bridge->dev = &fake_bridge_dev; + return agp_add_bridge(bridge); } -static void __devexit agp_hp_remove(struct pci_dev *pdev) +static acpi_status __init +zx1_gart_probe (acpi_handle obj, u32 depth, void *context, void **ret) { - struct agp_bridge_data *bridge = pci_get_drvdata(pdev); - - agp_remove_bridge(bridge); - agp_put_bridge(bridge); -} - -static struct pci_device_id agp_hp_pci_table[] __initdata = { - { - .class = (PCI_CLASS_BRIDGE_HOST << 8), - .class_mask = ~0, - .vendor = PCI_VENDOR_ID_HP, - .device = PCI_DEVICE_ID_HP_ZX1_LBA, - .subvendor = PCI_ANY_ID, - .subdevice = PCI_ANY_ID, - }, - { } -}; + acpi_handle handle, parent; + acpi_status status; + struct acpi_buffer buffer; + struct acpi_device_info *info; + u64 lba_hpa, sba_hpa, length; + int match; + + status = hp_acpi_csr_space(obj, &lba_hpa, &length); + if (ACPI_FAILURE(status)) + return 1; + + /* Look for an enclosing IOC scope and find its CSR space */ + handle = obj; + do { + buffer.length = ACPI_ALLOCATE_LOCAL_BUFFER; + status = acpi_get_object_info(handle, &buffer); + if (ACPI_SUCCESS(status)) { + /* TBD check _CID also */ + info = buffer.pointer; + info->hardware_id.value[sizeof(info->hardware_id)-1] = '\0'; + match = (strcmp(info->hardware_id.value, "HWP0001") == 0); + ACPI_MEM_FREE(info); + if (match) { + status = hp_acpi_csr_space(handle, &sba_hpa, &length); + if (ACPI_SUCCESS(status)) + break; + else { + printk(KERN_ERR PFX "Detected HP ZX1 " + "AGP LBA but no IOC.\n"); + return status; + } + } + } -MODULE_DEVICE_TABLE(pci, agp_hp_pci_table); + status = acpi_get_parent(handle, &parent); + handle = parent; + } while (ACPI_SUCCESS(status)); -static struct pci_driver agp_hp_pci_driver = { - .name = "agpgart-hp", - .id_table = agp_hp_pci_table, - .probe = agp_hp_probe, - .remove = agp_hp_remove, -}; + if (hp_zx1_setup(sba_hpa + HP_ZX1_IOC_OFFSET, lba_hpa)) + return 1; + return 0; +} -static int __init agp_hp_init(void) +static int __init +agp_hp_init (void) { - return pci_module_init(&agp_hp_pci_driver); + acpi_status status; + + status = acpi_get_devices("HWP0003", zx1_gart_probe, "HWP0003 AGP LBA", NULL); + if (!(ACPI_SUCCESS(status))) { + agp_bridge->type = NOT_SUPPORTED; + printk(KERN_INFO PFX "Failed to initialize zx1 AGP.\n"); + return -ENODEV; + } + return 0; } -static void __exit agp_hp_cleanup(void) +static void __exit +agp_hp_cleanup (void) { - pci_unregister_driver(&agp_hp_pci_driver); } module_init(agp_hp_init); diff -Nru a/drivers/char/agp/i460-agp.c b/drivers/char/agp/i460-agp.c --- a/drivers/char/agp/i460-agp.c Sat Jul 12 01:46:25 2003 +++ b/drivers/char/agp/i460-agp.c Sat Jul 12 01:46:25 2003 @@ -608,7 +608,7 @@ .name = "agpgart-intel-i460", .id_table = agp_intel_i460_pci_table, .probe = agp_intel_i460_probe, - .remove = agp_intel_i460_remove, + .remove = __exit_p(agp_intel_i460_remove), }; static int __init agp_intel_i460_init(void) diff -Nru a/drivers/media/radio/Makefile b/drivers/media/radio/Makefile --- a/drivers/media/radio/Makefile Sat Jul 12 01:46:25 2003 +++ b/drivers/media/radio/Makefile Sat Jul 12 01:46:25 2003 @@ -2,6 +2,8 @@ # Makefile for the kernel character device drivers. # +obj-y := dummy.o + miropcm20-objs := miropcm20-rds-core.o miropcm20-radio.o obj-$(CONFIG_RADIO_AZTECH) += radio-aztech.o diff -Nru a/drivers/media/radio/dummy.c b/drivers/media/radio/dummy.c --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/drivers/media/radio/dummy.c Sat Jul 12 01:46:26 2003 @@ -0,0 +1 @@ +/* just so the linker knows what kind of object files it's deadling with... */ diff -Nru a/drivers/media/video/Makefile b/drivers/media/video/Makefile --- a/drivers/media/video/Makefile Sat Jul 12 01:46:25 2003 +++ b/drivers/media/video/Makefile Sat Jul 12 01:46:25 2003 @@ -6,6 +6,8 @@ bttv-risc.o bttv-vbi.o zoran-objs := zr36120.o zr36120_i2c.o zr36120_mem.o +obj-y := dummy.o + obj-$(CONFIG_VIDEO_DEV) += videodev.o v4l2-common.o v4l1-compat.o obj-$(CONFIG_VIDEO_BT848) += bttv.o msp3400.o tvaudio.o \ diff -Nru a/drivers/media/video/dummy.c b/drivers/media/video/dummy.c --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/drivers/media/video/dummy.c Sat Jul 12 01:46:26 2003 @@ -0,0 +1 @@ +/* just so the linker knows what kind of object files it's deadling with... */ diff -Nru a/drivers/net/tulip/media.c b/drivers/net/tulip/media.c --- a/drivers/net/tulip/media.c Sat Jul 12 01:46:25 2003 +++ b/drivers/net/tulip/media.c Sat Jul 12 01:46:25 2003 @@ -278,6 +278,10 @@ for (i = 0; i < init_length; i++) outl(init_sequence[i], ioaddr + CSR12); } + + (void) inl(ioaddr + CSR6); /* flush CSR12 writes */ + udelay(500); /* Give MII time to recover */ + tmp_info = get_u16(&misc_info[1]); if (tmp_info) tp->advertising[phy_num] = tmp_info | 1; diff -Nru a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c --- a/drivers/scsi/qla1280.c Sat Jul 12 01:46:25 2003 +++ b/drivers/scsi/qla1280.c Sat Jul 12 01:46:25 2003 @@ -284,7 +284,7 @@ #define QL1280_TARGET_MODE_SUPPORT 0 /* Target mode support */ #define QL1280_LUN_SUPPORT 0 #define WATCHDOGTIMER 0 -#define MEMORY_MAPPED_IO 0 +#define MEMORY_MAPPED_IO 1 #define DEBUG_QLA1280_INTR 0 #define USE_NVRAM_DEFAULTS 0 #define DEBUG_PRINT_NVRAM 0 @@ -2491,7 +2491,7 @@ /* * Get memory mapped I/O address. */ - pci_read_config_word (ha->pdev, PCI_BASE_ADDRESS_1, &mmapbase); + pci_read_config_dword (ha->pdev, PCI_BASE_ADDRESS_1, &mmapbase); mmapbase &= PCI_BASE_ADDRESS_MEM_MASK; /* diff -Nru a/include/asm-ia64/system.h b/include/asm-ia64/system.h --- a/include/asm-ia64/system.h Sat Jul 12 01:46:25 2003 +++ b/include/asm-ia64/system.h Sat Jul 12 01:46:25 2003 @@ -20,9 +20,9 @@ #include /* 0xa000000000000000 - 0xa000000000000000+PERCPU_PAGE_SIZE remain unmapped */ -#define PERCPU_ADDR (0xa000000000000000 + PERCPU_PAGE_SIZE) -#define GATE_ADDR (0xa000000000000000 + 2*PERCPU_PAGE_SIZE) +#define GATE_ADDR (0xa000000000000000 + PERCPU_PAGE_SIZE) #define KERNEL_START 0xa000000100000000 +#define PERCPU_ADDR (-PERCPU_PAGE_SIZE) #ifndef __ASSEMBLY__ diff -Nru a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h --- a/include/linux/nfs_fs.h Sat Jul 12 01:46:25 2003 +++ b/include/linux/nfs_fs.h Sat Jul 12 01:46:25 2003 @@ -408,7 +408,7 @@ nfs_size_to_loff_t(__u64 size) { loff_t maxsz = (((loff_t) ULONG_MAX) << PAGE_CACHE_SHIFT) + PAGE_CACHE_SIZE - 1; - if (size > maxsz) + if (size > (__u64) maxsz) return maxsz; return (loff_t) size; } diff -Nru a/include/linux/sysctl.h b/include/linux/sysctl.h --- a/include/linux/sysctl.h Sat Jul 12 01:46:25 2003 +++ b/include/linux/sysctl.h Sat Jul 12 01:46:25 2003 @@ -130,6 +130,7 @@ KERN_PIDMAX=55, /* int: PID # limit */ KERN_CORE_PATTERN=56, /* string: pattern for core-file names */ KERN_PANIC_ON_OOPS=57, /* int: whether we will panic on an oops */ + KERN_CACHEDECAYTICKS=58, /* ulong: value for cache_decay_ticks (EXPERIMENTAL!) */ }; diff -Nru a/kernel/printk.c b/kernel/printk.c --- a/kernel/printk.c Sat Jul 12 01:46:25 2003 +++ b/kernel/printk.c Sat Jul 12 01:46:25 2003 @@ -313,6 +313,12 @@ __call_console_drivers(start, end); } } +#ifdef CONFIG_IA64_EARLY_PRINTK + if (!console_drivers) { + void early_printk (const char *str, size_t len); + early_printk(&LOG_BUF(start), end - start); + } +#endif } /* @@ -630,7 +636,11 @@ * for us. */ spin_lock_irqsave(&logbuf_lock, flags); +#ifdef CONFIG_IA64_EARLY_PRINTK + con_start = log_end; +#else con_start = log_start; +#endif spin_unlock_irqrestore(&logbuf_lock, flags); } release_console_sem(); @@ -683,3 +693,117 @@ tty->driver->write(tty, 0, msg, strlen(msg)); return; } + +#ifdef CONFIG_IA64_EARLY_PRINTK + +#include + +# ifdef CONFIG_IA64_EARLY_PRINTK_VGA + + +#define VGABASE ((char *)0xc0000000000b8000) +#define VGALINES 24 +#define VGACOLS 80 + +static int current_ypos = VGALINES, current_xpos = 0; + +static void +early_printk_vga (const char *str, size_t len) +{ + char c; + int i, k, j; + + while (len-- > 0) { + c = *str++; + if (current_ypos >= VGALINES) { + /* scroll 1 line up */ + for (k = 1, j = 0; k < VGALINES; k++, j++) { + for (i = 0; i < VGACOLS; i++) { + writew(readw(VGABASE + 2*(VGACOLS*k + i)), + VGABASE + 2*(VGACOLS*j + i)); + } + } + for (i = 0; i < VGACOLS; i++) { + writew(0x720, VGABASE + 2*(VGACOLS*j + i)); + } + current_ypos = VGALINES-1; + } + if (c == '\n') { + current_xpos = 0; + current_ypos++; + } else if (c != '\r') { + writew(((0x7 << 8) | (unsigned short) c), + VGABASE + 2*(VGACOLS*current_ypos + current_xpos++)); + if (current_xpos >= VGACOLS) { + current_xpos = 0; + current_ypos++; + } + } + } +} + +# endif /* CONFIG_IA64_EARLY_PRINTK_VGA */ + +# ifdef CONFIG_IA64_EARLY_PRINTK_UART + +#include +#include + +static void early_printk_uart(const char *str, size_t len) +{ + static char *uart = NULL; + unsigned long uart_base; + char c; + + if (!uart) { + uart_base = 0; +# ifdef CONFIG_SERIAL_8250_HCDP + { + extern unsigned long hcdp_early_uart(void); + uart_base = hcdp_early_uart(); + } +# endif +# if CONFIG_IA64_EARLY_PRINTK_UART_BASE + if (!uart_base) + uart_base = CONFIG_IA64_EARLY_PRINTK_UART_BASE; +# endif + if (!uart_base) + return; + + uart = ioremap(uart_base, 64); + if (!uart) + return; + } + + while (len-- > 0) { + c = *str++; + while ((readb(uart + UART_LSR) & UART_LSR_TEMT) == 0) + cpu_relax(); /* spin */ + + writeb(c, uart + UART_TX); + + if (c == '\n') + writeb('\r', uart + UART_TX); + } +} + +# endif /* CONFIG_IA64_EARLY_PRINTK_UART */ + +#ifdef CONFIG_IA64_EARLY_PRINTK_SGI_SN +extern int sn_sal_console_out(const char *str, int len); +#endif + +void early_printk(const char *str, size_t len) +{ +#ifdef CONFIG_IA64_EARLY_PRINTK_UART + early_printk_uart(str, len); +#endif +#ifdef CONFIG_IA64_EARLY_PRINTK_VGA + early_printk_vga(str, len); +#endif +#ifdef CONFIG_IA64_EARLY_PRINTK_SGI_SN + sn_sal_console_out(str, len); +#endif +} + +#endif /* CONFIG_IA64_EARLY_PRINTK */ diff -Nru a/kernel/sched.c b/kernel/sched.c --- a/kernel/sched.c Sat Jul 12 01:46:25 2003 +++ b/kernel/sched.c Sat Jul 12 01:46:25 2003 @@ -176,7 +176,7 @@ static DEFINE_PER_CPU(struct runqueue, runqueues); #define cpu_rq(cpu) (&per_cpu(runqueues, (cpu))) -#define this_rq() (&__get_cpu_var(runqueues)) +#define this_rq() (cpu_rq(smp_processor_id())) /* not __get_cpu_var(runqueues)! */ #define task_rq(p) cpu_rq(task_cpu(p)) #define cpu_curr(cpu) (cpu_rq(cpu)->curr) #define rt_task(p) ((p)->prio < MAX_RT_PRIO) diff -Nru a/kernel/sysctl.c b/kernel/sysctl.c --- a/kernel/sysctl.c Sat Jul 12 01:46:25 2003 +++ b/kernel/sysctl.c Sat Jul 12 01:46:25 2003 @@ -551,6 +551,16 @@ .mode = 0644, .proc_handler = &proc_dointvec, }, +#ifdef CONFIG_SMP + { + .ctl_name = KERN_CACHEDECAYTICKS, + .procname = "cache_decay_ticks", + .data = &cache_decay_ticks, + .maxlen = sizeof(cache_decay_ticks), + .mode = 0644, + .proc_handler = &proc_doulongvec_minmax, + }, +#endif { .ctl_name = 0 } }; diff -Nru a/kernel/timer.c b/kernel/timer.c --- a/kernel/timer.c Sat Jul 12 01:46:25 2003 +++ b/kernel/timer.c Sat Jul 12 01:46:25 2003 @@ -160,7 +160,7 @@ */ void add_timer(struct timer_list *timer) { - tvec_base_t *base = &get_cpu_var(tvec_bases); + tvec_base_t *base = &per_cpu(tvec_bases, get_cpu()); unsigned long flags; BUG_ON(timer_pending(timer) || !timer->function); @@ -171,7 +171,7 @@ internal_add_timer(base, timer); timer->base = base; spin_unlock_irqrestore(&base->lock, flags); - put_cpu_var(tvec_bases); + put_cpu(); } /*** @@ -234,7 +234,7 @@ return 1; spin_lock_irqsave(&timer->lock, flags); - new_base = &__get_cpu_var(tvec_bases); + new_base = &per_cpu(tvec_bases, smp_processor_id()); repeat: old_base = timer->base; @@ -792,7 +792,7 @@ */ static void run_timer_softirq(struct softirq_action *h) { - tvec_base_t *base = &__get_cpu_var(tvec_bases); + tvec_base_t *base = &per_cpu(tvec_bases, smp_processor_id()); if (time_after_eq(jiffies, base->timer_jiffies)) __run_timers(base); diff -Nru a/mm/memory.c b/mm/memory.c --- a/mm/memory.c Sat Jul 12 01:46:25 2003 +++ b/mm/memory.c Sat Jul 12 01:46:25 2003 @@ -114,8 +114,10 @@ } pmd = pmd_offset(dir, 0); pgd_clear(dir); - for (j = 0; j < PTRS_PER_PMD ; j++) + for (j = 0; j < PTRS_PER_PMD ; j++) { + prefetchw(pmd + j + PREFETCH_STRIDE/sizeof(*pmd)); free_one_pmd(tlb, pmd+j); + } pmd_free_tlb(tlb, pmd); } diff -Nru a/mm/slab.c b/mm/slab.c --- a/mm/slab.c Sat Jul 12 01:46:25 2003 +++ b/mm/slab.c Sat Jul 12 01:46:25 2003 @@ -2457,7 +2457,7 @@ static void reap_timer_fnc(unsigned long data) { int cpu = smp_processor_id(); - struct timer_list *rt = &__get_cpu_var(reap_timers); + struct timer_list *rt = &per_cpu(reap_timers, cpu); cache_reap(); mod_timer(rt, jiffies + REAPTIMEOUT_CPUC + cpu); diff -Nru a/mm/swap.c b/mm/swap.c --- a/mm/swap.c Sat Jul 12 01:46:25 2003 +++ b/mm/swap.c Sat Jul 12 01:46:25 2003 @@ -113,34 +113,35 @@ void lru_cache_add(struct page *page) { - struct pagevec *pvec = &get_cpu_var(lru_add_pvecs); + struct pagevec *pvec = &per_cpu(lru_add_pvecs, get_cpu()); page_cache_get(page); if (!pagevec_add(pvec, page)) __pagevec_lru_add(pvec); - put_cpu_var(lru_add_pvecs); + put_cpu(); } void lru_cache_add_active(struct page *page) { - struct pagevec *pvec = &get_cpu_var(lru_add_active_pvecs); + struct pagevec *pvec = &per_cpu(lru_add_active_pvecs, get_cpu()); page_cache_get(page); if (!pagevec_add(pvec, page)) __pagevec_lru_add_active(pvec); - put_cpu_var(lru_add_active_pvecs); + put_cpu(); } void lru_add_drain(void) { - struct pagevec *pvec = &get_cpu_var(lru_add_pvecs); + int cpu = get_cpu(); + struct pagevec *pvec = &per_cpu(lru_add_pvecs, cpu); if (pagevec_count(pvec)) __pagevec_lru_add(pvec); - pvec = &__get_cpu_var(lru_add_active_pvecs); + pvec = &per_cpu(lru_add_active_pvecs, cpu); if (pagevec_count(pvec)) __pagevec_lru_add_active(pvec); - put_cpu_var(lru_add_pvecs); + put_cpu(); } /* (); + struct pagevec *pvec = &per_cpu(lru_add_pvecs, cpu); if (pagevec_count(pvec)) __pagevec_lru_add(pvec); - pvec = &__get_cpu_var(lru_add_active_pvecs); + pvec = &per_cpu(lru_add_active_pvecs, cpu); if (pagevec_count(pvec)) __pagevec_lru_add_active(pvec); - put_cpu_var(lru_add_pvecs); + put_cpu(); } /*