## Automatically generated incremental diff
## From:   linux-2.4.23-pre4
## To:     linux-2.4.23-pre5
## Robot:  $Id: make-incremental-diff,v 1.11 2002/02/20 02:59:33 hpa Exp $

diff -urN linux-2.4.23-pre4/Documentation/Configure.help linux-2.4.23-pre5/Documentation/Configure.help
--- linux-2.4.23-pre4/Documentation/Configure.help	2003-09-21 13:22:26.000000000 -0700
+++ linux-2.4.23-pre5/Documentation/Configure.help	2003-09-21 13:22:29.000000000 -0700
@@ -4055,6 +4055,13 @@
   This option gives you AGP GART support for the HP ZX1 chipset
   for IA64 processors.
 
+CONFIG_AGP_ATI
+  This option gives you AGP support for the GLX component of
+  XFree86 4.x on the ATI RadeonIGP family of chipsets.
+
+  You should say Y here if you use XFree86 3.3.6 or 4.x and want to
+  use GLX or DRI.  If unsure, say N.
+
 Support for ISA-bus hardware
 CONFIG_ISA
   Find out whether you have ISA slots on your motherboard.  ISA is the
@@ -10008,6 +10015,17 @@
   Support for these adaptors is so far still incomplete and buggy.
   You have been warned.
 
+Hermes 802.11b in TMD7160/NCP130 based PCI adaptor support
+CONFIG_TMD_HERMES
+  Enable support for PCMCIA cards supported by the "Hermes" (aka
+  orinoco) driver when used in TMD7160 based PCI adaptors.  These
+  adaptors are not a full PCMCIA controller but act as a more limited
+  PCI <-> PCMCIA bridge.  Several vendors sell such adaptors so that
+  802.11b PCMCIA cards can be used in desktop machines.
+
+  Support for these adaptors is so far still incomplete and buggy.
+  You have been warned.
+
 Prism 2.5 PCI 802.11b adaptor support
 CONFIG_PCI_HERMES
   Enable support for PCI and mini-PCI 802.11b wireless NICs based on
@@ -16076,21 +16094,15 @@
   architectural foundations.
 
   In general, ReiserFS is as fast as ext2, but is very efficient with
-  large directories and small files.  Additional patches are needed
-  for NFS and quotas, please see <http://www.reiserfs.org/> for links.
-
-  It is more easily extended to have features currently found in
-  database and keyword search systems than block allocation based file
-  systems are.  The next version will be so extended, and will support
-  plugins consistent with our motto ``It takes more than a license to
-  make source code open.''
+  large directories and small files.  It is much faster for writes,
+  and slightly slower for reads than ext2.  It is much faster than
+  ext3.  It will be obsoleted by Reiser4 in not too long, so keep
+  an eye on our website for when Reiser4 ships.
 
-  Read <http://www.reiserfs.org/> to learn more about reiserfs.
+  Mount with the notail option if performance matters more to you than
+  saving space (the design flaw underlying this is fixed in reiser4).
 
-  Sponsored by Threshold Networks, Emusic.com, and Bigstorage.com.
-
-  If you like it, you can pay us to add new features to it that you
-  need, buy a support contract, or pay us to port it to another OS.
+  Read <http://www.namesys.com> to learn more about reiserfs.
 
 Enable extra Reiserfs consistency checks
 CONFIG_REISERFS_CHECK
@@ -27000,11 +27012,13 @@
 # Choice: ia64type
 Itanium
 CONFIG_ITANIUM
-  Select your IA64 processor type.  The default is Intel Itanium.
+  Select your IA-64 processor type.  The default is Intel Itanium.
+  This choice is safe for all IA-64 systems, but may not perform
+  optimally on systems with, say, Itanium 2 or newer processors.
 
-McKinley
+Itanium 2
 CONFIG_MCKINLEY
-  Select this to configure for a McKinley processor.
+  Select this to configure for an Itanium 2 (McKinley) processor.
 
 # Choice: ia64system
 IA-64 system type
@@ -27061,6 +27075,14 @@
   Say Y here to enable machine check support for IA-64.  If you're
   unsure, answer Y.
 
+Use PAL_HALT_LIGHT in idle loop
+CONFIG_IA64_PAL_IDLE
+  Say Y here to enable use of PAL_HALT_LIGHT in the cpu_idle loop.
+  This allows the CPU to enter a low power state when idle.  You
+  can enable CONFIG_IA64_PALINFO and check /proc/pal/cpu0/power_info
+  to see the power consumption and latency for this state.  If you're
+  unsure your firmware supports it, answer N.
+
 Disable IA-64 Virtual Hash Page Table
 CONFIG_DISABLE_VHPT
   The Virtual Hash Page Table (VHPT) enhances virtual address
@@ -28304,6 +28326,28 @@
 
 CONFIG_CRYPTO_TEST
   Quick & dirty crypto test module.
+  
+CONFIG_SOUND_WM97XX
+  Say Y here to support the Wolfson WM9705 and WM9712 touchscreen
+  controllers. These controllers are mainly found in PDA's 
+  i.e. Dell Axim and Toshiba e740
+
+  This is experimental code.
+  Please see Documentation/wolfson-touchscreen.txt for
+  a complete list of parameters.
+  
+  In order to use this driver, a char device called wm97xx with a major
+  number of 10 and minor number 16 will have to be created under 
+  /dev/touchscreen.
+  
+  e.g.
+  mknod /dev/touchscreen/wm97xx c 10 16
+
+  If you want to compile this as a module ( = code which can be
+  inserted in and removed from the running kernel whenever you want),
+  say M here.  The module will be called ac97_plugin_wm97xx.o.
+  
+  If unsure, say N.
 
 #
 # A couple of things I keep forgetting:
diff -urN linux-2.4.23-pre4/Documentation/networking/bonding.txt linux-2.4.23-pre5/Documentation/networking/bonding.txt
--- linux-2.4.23-pre4/Documentation/networking/bonding.txt	2003-08-25 04:44:39.000000000 -0700
+++ linux-2.4.23-pre5/Documentation/networking/bonding.txt	2003-09-21 13:22:29.000000000 -0700
@@ -527,9 +527,9 @@
 
 1) Bonding information files
 ----------------------------
-The bonding driver information files reside in the /proc/net/bond* directories.
+The bonding driver information files reside in the /proc/net/bonding directory.
 
-Sample contents of /proc/net/bond0/info after the driver is loaded with 
+Sample contents of /proc/net/bonding/bond0 after the driver is loaded with 
 parameters of mode=0 and miimon=1000 is shown below.
  
         Bonding Mode: load balancing (round-robin)
diff -urN linux-2.4.23-pre4/Makefile linux-2.4.23-pre5/Makefile
--- linux-2.4.23-pre4/Makefile	2003-09-21 13:22:26.000000000 -0700
+++ linux-2.4.23-pre5/Makefile	2003-09-21 13:22:29.000000000 -0700
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 4
 SUBLEVEL = 23
-EXTRAVERSION = -pre4
+EXTRAVERSION = -pre5
 
 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 
diff -urN linux-2.4.23-pre4/arch/i386/kernel/Makefile linux-2.4.23-pre5/arch/i386/kernel/Makefile
--- linux-2.4.23-pre4/arch/i386/kernel/Makefile	2003-08-25 04:44:39.000000000 -0700
+++ linux-2.4.23-pre5/arch/i386/kernel/Makefile	2003-09-21 13:22:29.000000000 -0700
@@ -38,7 +38,6 @@
 obj-$(CONFIG_APM)		+= apm.o
 obj-$(CONFIG_ACPI_BOOT)		+= acpi.o
 obj-$(CONFIG_ACPI_SLEEP)	+= acpi_wakeup.o
-obj-$(CONFIG_ACPI_HT_ONLY)	+= acpitable.o
 obj-$(CONFIG_SMP)		+= smp.o smpboot.o trampoline.o
 obj-$(CONFIG_X86_LOCAL_APIC)	+= mpparse.o apic.o nmi.o
 obj-$(CONFIG_X86_IO_APIC)	+= io_apic.o
diff -urN linux-2.4.23-pre4/arch/i386/kernel/acpi.c linux-2.4.23-pre5/arch/i386/kernel/acpi.c
--- linux-2.4.23-pre4/arch/i386/kernel/acpi.c	2003-08-25 04:44:39.000000000 -0700
+++ linux-2.4.23-pre5/arch/i386/kernel/acpi.c	2003-09-21 13:22:29.000000000 -0700
@@ -355,7 +355,6 @@
 
 	result = acpi_table_parse(ACPI_APIC, acpi_parse_madt);
 	if (!result) {
-		printk(KERN_WARNING PREFIX "MADT not present\n");
 		return 0;
 	}
 	else if (result < 0) {
diff -urN linux-2.4.23-pre4/arch/i386/kernel/acpitable.c linux-2.4.23-pre5/arch/i386/kernel/acpitable.c
--- linux-2.4.23-pre4/arch/i386/kernel/acpitable.c	2003-08-25 04:44:39.000000000 -0700
+++ linux-2.4.23-pre5/arch/i386/kernel/acpitable.c	1969-12-31 16:00:00.000000000 -0800
@@ -1,553 +0,0 @@
-/*
- *  acpitable.c - IA32-specific ACPI boot-time initialization (Revision: 1)
- *
- *  Copyright (C) 1999 Andrew Henroid
- *  Copyright (C) 2001 Richard Schaal
- *  Copyright (C) 2001 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
- *  Copyright (C) 2001 Jun Nakajima <jun.nakajima@intel.com>
- *  Copyright (C) 2001 Arjan van de Ven <arjanv@redhat.com>
- *
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- *
- * $Id: acpitable.c,v 1.7 2001/11/04 12:21:18 fenrus Exp $
- */
-#include <linux/config.h>
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/types.h>
-#include <linux/stddef.h>
-#include <linux/slab.h>
-#include <linux/pci.h>
-#include <asm/mpspec.h>
-#include <asm/io.h>
-#include <asm/apic.h>
-#include <asm/apicdef.h>
-#include <asm/page.h>
-#include <asm/pgtable.h>
-
-#include "acpitable.h"
-
-static acpi_table_handler acpi_boot_ops[ACPI_TABLE_COUNT];
-
-int acpi_lapic;
-
-static unsigned char __init
-acpi_checksum(void *buffer, int length)
-{
-	int i;
-	unsigned char *bytebuffer;
-	unsigned char sum = 0;
-
-	if (!buffer || length <= 0)
-		return 0;
-
-	bytebuffer = (unsigned char *) buffer;
-
-	for (i = 0; i < length; i++)
-		sum += *(bytebuffer++);
-
-	return sum;
-}
-
-static void __init
-acpi_print_table_header(acpi_table_header * header)
-{
-	if (!header)
-		return;
-
-	printk(KERN_INFO "ACPI table found: %.4s v%d [%.6s %.8s %d.%d]\n",
-	       header->signature, header->revision, header->oem_id,
-	       header->oem_table_id, header->oem_revision >> 16,
-	       header->oem_revision & 0xffff);
-
-	return;
-}
-
-/*******************************************************************************
- *
- * FUNCTION:    acpi_tb_scan_memory_for_rsdp
- *
- * PARAMETERS:  address       - Starting pointer for search
- *              length        - Maximum length to search
- *
- * RETURN:      Pointer to the RSDP if found and valid, otherwise NULL.
- *
- * DESCRIPTION: Search a block of memory for the RSDP signature
- *
- ******************************************************************************/
-
-static void *__init
-acpi_tb_scan_memory_for_rsdp(void *address, int length)
-{
-	int offset;
-
-	if (length <= 0)
-		return NULL;
-
-	/* Search from given start addr for the requested length  */
-
-	offset = 0;
-
-	while (offset < length) {
-		/* The signature must match and the checksum must be correct */
-		if (strncmp(address, RSDP_SIG, sizeof(RSDP_SIG) - 1) == 0 &&
-		    acpi_checksum(address, RSDP_CHECKSUM_LENGTH) == 0) {
-			/* If so, we have found the RSDP */
-			printk(KERN_INFO "ACPI: RSDP located at physical address %p\n",
-			       address);
-			return address;
-		}
-		offset += RSDP_SCAN_STEP;
-		address += RSDP_SCAN_STEP;
-	}
-
-	/* Searched entire block, no RSDP was found */
-	dprintk(KERN_INFO "ACPI: Searched entire block 0x%x:0x%x, no RSDP was found.\n",
-		(int)address, (int)address + length);
-	return NULL;
-}
-
-/*******************************************************************************
- *
- * FUNCTION:    acpi_find_root_pointer
- *
- * PARAMETERS:  none
- *
- * RETURN:      physical address of the RSDP 
- *
- * DESCRIPTION: Search lower 1_mbyte of memory for the root system descriptor
- *              pointer structure.  If it is found, set *RSDP to point to it.
- *
- *              NOTE: The RSDP must be either in the first 1_k of the Extended
- *              BIOS Data Area or between E0000 and FFFFF (ACPI 1.0 section
- *              5.2.2; assertion #421).
- *
- ******************************************************************************/
-
-static struct acpi_table_rsdp * __init
-acpi_find_root_pointer(void)
-{
-	struct acpi_table_rsdp * rsdp;
-
-	/*
-	 * Physical address is given
-	 */
-	/*
-	 * Region 1) Search EBDA (low memory) paragraphs
-	 */
-	rsdp = acpi_tb_scan_memory_for_rsdp(__va(LO_RSDP_WINDOW_BASE),
-					 LO_RSDP_WINDOW_SIZE);
-
-	if (rsdp)
-		return rsdp;
-
-	/*
-	 * Region 2) Search upper memory: 16-byte boundaries in E0000h-F0000h
-	 */
-	rsdp = acpi_tb_scan_memory_for_rsdp(__va(HI_RSDP_WINDOW_BASE),
-					       HI_RSDP_WINDOW_SIZE);
-
-	
-					     
-	if (rsdp)
-		return rsdp;
-
-	printk(KERN_ERR "ACPI: System description tables not found\n");
-	return NULL;
-}
-
-
-/*
- * Temporarily use the virtual area starting from FIX_IO_APIC_BASE_END,
- * to map the target physical address. The problem is that set_fixmap()
- * provides a single page, and it is possible that the page is not
- * sufficient.
- * By using this area, we can map up to MAX_IO_APICS pages temporarily,
- * i.e. until the next __va_range() call.
- *
- * Important Safety Note:  The fixed I/O APIC page numbers are *subtracted*
- * from the fixed base.  That's why we start at FIX_IO_APIC_BASE_END and
- * count idx down while incrementing the phys address.
- */
-static __init char *
-__va_range(unsigned long phys, unsigned long size)
-{
-	unsigned long base, offset, mapped_size;
-	int idx;
-
-	offset = phys & (PAGE_SIZE - 1);
-	mapped_size = PAGE_SIZE - offset;
-	set_fixmap(FIX_IO_APIC_BASE_END, phys);
-	base = fix_to_virt(FIX_IO_APIC_BASE_END);
-	dprintk("__va_range(0x%lx, 0x%lx): idx=%d mapped at %lx\n", phys, size,
-		FIX_IO_APIC_BASE_END, base);
-
-	/*
-	 * Most cases can be covered by the below.
-	 */
-	idx = FIX_IO_APIC_BASE_END;
-	while (mapped_size < size) {
-		if (--idx < FIX_IO_APIC_BASE_0)
-			return 0;	/* cannot handle this */
-		phys += PAGE_SIZE;
-		set_fixmap(idx, phys);
-		mapped_size += PAGE_SIZE;
-	}
-
-	return ((unsigned char *) base + offset);
-}
-
-static int __init acpi_tables_init(void)
-{
-	int result = -ENODEV;
-	acpi_table_header *header = NULL;
-	struct acpi_table_rsdp *rsdp = NULL;
-	struct acpi_table_rsdt *rsdt = NULL;
-	struct acpi_table_rsdt saved_rsdt;
-	int tables = 0;
-	int type = 0;
-	int i = 0;
-
-
-	rsdp = (struct acpi_table_rsdp *) acpi_find_root_pointer();
-
-	if (!rsdp)
-		return -ENODEV;
-		
-	printk(KERN_INFO "%.8s v%d [%.6s]\n", rsdp->signature, rsdp->revision,
-	       rsdp->oem_id);
-	       
-	if (strncmp(rsdp->signature, RSDP_SIG,strlen(RSDP_SIG))) {
-		printk(KERN_WARNING "RSDP table signature incorrect\n");
-		return -EINVAL;
-	}
-
-	rsdt = (struct acpi_table_rsdt *)
-	    __va_range(rsdp->rsdt_address, sizeof(struct acpi_table_rsdt));
-
-	if (!rsdt) {
-		printk(KERN_WARNING "ACPI: Invalid root system description tables (RSDT)\n");
-		return -ENODEV;
-	}
-	
-	header = & rsdt->header;
-	acpi_print_table_header(header);
-	
-	if (strncmp(header->signature, RSDT_SIG, strlen(RSDT_SIG))) {
-		printk(KERN_WARNING "ACPI: RSDT signature incorrect\n");
-		return -ENODEV;
-	}
-		
-	/* 
-	 * The number of tables is computed by taking the 
-	 * size of all entries (header size minus total 
-	 * size of RSDT) divided by the size of each entry
-	 * (4-byte table pointers).
-	 */
-	tables = (header->length - sizeof(acpi_table_header)) / 4;
-		    
-	memcpy(&saved_rsdt, rsdt, sizeof(saved_rsdt));
-
-	if (saved_rsdt.header.length > sizeof(saved_rsdt)) {
-		printk(KERN_WARNING "ACPI: Too big length in RSDT: %d\n", saved_rsdt.header.length);
-		return -ENODEV;
-	}
-
-	for (i = 0; i < tables; i++) {
-		/* Map in header, then map in full table length. */
-		header = (acpi_table_header *)
-			    __va_range(saved_rsdt.entry[i],
-				       sizeof(acpi_table_header));
-		if (!header)
-			break;
-		header = (acpi_table_header *)
-			    __va_range(saved_rsdt.entry[i], header->length);
-		if (!header)
-			break;
-
-		acpi_print_table_header(header);
-		
-		if (acpi_checksum(header,header->length)) {
-			printk(KERN_WARNING "ACPI %s has invalid checksum\n", 
-				acpi_table_signatures[i]);
-			continue;
-		}
-		
-		for (type = 0; type < ACPI_TABLE_COUNT; type++)
-			if (!strncmp((char *) &header->signature,
-			     acpi_table_signatures[type],strlen(acpi_table_signatures[type])))
-				break;
-
-		if (type >= ACPI_TABLE_COUNT) {
-			printk(KERN_WARNING "ACPI: Unsupported table %.4s\n",
-			       header->signature);
-			continue;
-		}
-
-
-		if (!acpi_boot_ops[type])
-			continue;
-			
-		result = acpi_boot_ops[type] (header,
-						 (unsigned long) saved_rsdt.
-						 entry[i]);
-	}
-
-	return result;
-}
-
-static int total_cpus __initdata = 0;
-int have_acpi_tables;
-
-extern void __init MP_processor_info(struct mpc_config_processor *);
-
-static void __init
-acpi_parse_lapic(struct acpi_table_lapic *local_apic)
-{
-	struct mpc_config_processor proc_entry;
-	int ix = 0;
-
-	if (!local_apic)
-		return;
-
-	printk(KERN_INFO "LAPIC (acpi_id[0x%04x] id[0x%x] enabled[%d])\n",
-		local_apic->acpi_id, local_apic->id, local_apic->flags.enabled);
-
-	printk(KERN_INFO "CPU %d (0x%02x00)", total_cpus, local_apic->id);
-
-	if (local_apic->flags.enabled) {
-		printk(" enabled\n");
-		ix = local_apic->id;
-		if (ix >= MAX_APICS) {
-			printk(KERN_WARNING
-			       "Processor #%d INVALID - (Max ID: %d).\n", ix,
-			       MAX_APICS);
-			return;
-		}
-		/* 
-		 * Fill in the info we want to save.  Not concerned about 
-		 * the processor ID.  Processor features aren't present in 
-		 * the table.
-		 */
-		proc_entry.mpc_type = MP_PROCESSOR;
-		proc_entry.mpc_apicid = local_apic->id;
-		proc_entry.mpc_cpuflag = CPU_ENABLED;
-		if (proc_entry.mpc_apicid == boot_cpu_physical_apicid) {
-			printk(" (BSP)");
-			proc_entry.mpc_cpuflag |= CPU_BOOTPROCESSOR;
-		}
-		proc_entry.mpc_cpufeature =
-		    (boot_cpu_data.x86 << 8) | 
-		    (boot_cpu_data.x86_model << 4) | 
-		     boot_cpu_data.x86_mask;
-		proc_entry.mpc_featureflag = boot_cpu_data.x86_capability[0];
-		proc_entry.mpc_reserved[0] = 0;
-		proc_entry.mpc_reserved[1] = 0;
-		proc_entry.mpc_apicver = 0x10;	/* integrated APIC */
-		MP_processor_info(&proc_entry);
-	} else {
-		printk(" disabled\n");
-	}
-
-	total_cpus++;
-	return;
-}
-
-static void __init
-acpi_parse_ioapic(struct acpi_table_ioapic *ioapic)
-{
-
-	if (!ioapic)
-		return;
-
-	printk(KERN_INFO
-	       "IOAPIC (id[0x%x] address[0x%x] global_irq_base[0x%x])\n",
-	       ioapic->id, ioapic->address, ioapic->global_irq_base);
-
-	if (nr_ioapics >= MAX_IO_APICS) {
-		printk(KERN_WARNING
-		       "Max # of I/O APICs (%d) exceeded (found %d).\n",
-		       MAX_IO_APICS, nr_ioapics);
-/*		panic("Recompile kernel with bigger MAX_IO_APICS!\n");   */
-	}
-}
-
-
-/* Interrupt source overrides inform the machine about exceptions
-   to the normal "PIC" mode interrupt routing */
-   
-static void __init
-acpi_parse_int_src_ovr(struct acpi_table_int_src_ovr *intsrc)
-{
-	if (!intsrc)
-		return;
-
-	printk(KERN_INFO
-	       "INT_SRC_OVR (bus[%d] irq[0x%x] global_irq[0x%x] polarity[0x%x] trigger[0x%x])\n",
-	       intsrc->bus, intsrc->bus_irq, intsrc->global_irq,
-	       intsrc->flags.polarity, intsrc->flags.trigger);
-}
-
-/*
- * At this point, we look at the interrupt assignment entries in the MPS
- * table.
- */ 
- 
-static void __init acpi_parse_nmi_src(struct acpi_table_nmi_src *nmisrc)
-{
-	if (!nmisrc)
-		return;
-
-	printk(KERN_INFO
-	       "NMI_SRC (polarity[0x%x] trigger[0x%x] global_irq[0x%x])\n",
-	       nmisrc->flags.polarity, nmisrc->flags.trigger,
-	       nmisrc->global_irq);
-
-}
-static void __init
-acpi_parse_lapic_nmi(struct acpi_table_lapic_nmi *localnmi)
-{
-	if (!localnmi)
-		return;
-
-	printk(KERN_INFO
-	       "LAPIC_NMI (acpi_id[0x%04x] polarity[0x%x] trigger[0x%x] lint[0x%x])\n",
-	       localnmi->acpi_id, localnmi->flags.polarity,
-	       localnmi->flags.trigger, localnmi->lint);
-}
-static void __init
-acpi_parse_lapic_addr_ovr(struct acpi_table_lapic_addr_ovr *lapic_addr_ovr)
-{
-	if (!lapic_addr_ovr)
-		return;
-
-	printk(KERN_INFO "LAPIC_ADDR_OVR (address[0x%lx])\n",
-	       (unsigned long) lapic_addr_ovr->address);
-
-}
-
-static void __init
-acpi_parse_plat_int_src(struct acpi_table_plat_int_src *plintsrc)
-{
-	if (!plintsrc)
-		return;
-
-	printk(KERN_INFO
-	       "PLAT_INT_SRC (polarity[0x%x] trigger[0x%x] type[0x%x] id[0x%04x] eid[0x%x] iosapic_vector[0x%x] global_irq[0x%x]\n",
-	       plintsrc->flags.polarity, plintsrc->flags.trigger,
-	       plintsrc->type, plintsrc->id, plintsrc->eid,
-	       plintsrc->iosapic_vector, plintsrc->global_irq);
-}
-static int __init
-acpi_parse_madt(acpi_table_header * header, unsigned long phys)
-{
-
-	struct acpi_table_madt *madt;	    
-	acpi_madt_entry_header *entry_header;
-	int table_size;
-	
-	madt = (struct acpi_table_madt *) __va_range(phys, header->length);
-
-	if (!madt)
-		return -EINVAL;
-
-	table_size = (int) (header->length - sizeof(*madt));
-	entry_header =
-	    (acpi_madt_entry_header *) ((void *) madt + sizeof(*madt));
-
-	while (entry_header && (table_size > 0)) {
-		switch (entry_header->type) {
-		case ACPI_MADT_LAPIC:
-			acpi_parse_lapic((struct acpi_table_lapic *)
-					 entry_header);
-			break;
-		case ACPI_MADT_IOAPIC:
-			acpi_parse_ioapic((struct acpi_table_ioapic *)
-					  entry_header);
-			break;
-		case ACPI_MADT_INT_SRC_OVR:
-			acpi_parse_int_src_ovr((struct acpi_table_int_src_ovr *)
-					       entry_header);
-			break;
-		case ACPI_MADT_NMI_SRC:
-			acpi_parse_nmi_src((struct acpi_table_nmi_src *)
-					   entry_header);
-			break;
-		case ACPI_MADT_LAPIC_NMI:
-			acpi_parse_lapic_nmi((struct acpi_table_lapic_nmi *)
-					     entry_header);
-			break;
-		case ACPI_MADT_LAPIC_ADDR_OVR:
-			acpi_parse_lapic_addr_ovr((struct
-						   acpi_table_lapic_addr_ovr *)
-						  entry_header);
-			break;
-		case ACPI_MADT_PLAT_INT_SRC:
-			acpi_parse_plat_int_src((struct acpi_table_plat_int_src
-						 *) entry_header);
-			break;
-		default:
-			printk(KERN_WARNING
-			       "Unsupported MADT entry type 0x%x\n",
-			       entry_header->type);
-			break;
-		}
-		table_size -= entry_header->length;
-		entry_header =
-		    (acpi_madt_entry_header *) ((void *) entry_header +
-						entry_header->length);
-	}
-
-	if (!total_cpus) {
-		printk("ACPI: No Processors found in the APCI table.\n");
-		return -EINVAL;
-	}
-
-	printk(KERN_INFO "%d CPUs total\n", total_cpus);
-
-	if (madt->lapic_address)
-		mp_lapic_addr = madt->lapic_address;
-	else
-		mp_lapic_addr = APIC_DEFAULT_PHYS_BASE;
-
-	printk(KERN_INFO "Local APIC address %x\n", madt->lapic_address);
-
-	return 0;
-}
-
-
-/*
- * Configure the processor info using MADT in the ACPI tables. If we fail to
- * configure that, then we use the MPS tables.
- */
-void __init
-acpi_boot_init(void)
-{
-
-	memset(&acpi_boot_ops, 0, sizeof(acpi_boot_ops));
-	acpi_boot_ops[ACPI_APIC] = acpi_parse_madt;
-
-	/*
-	 * Only do this when requested, either because of CPU/Bios type or from the command line
-	 */
-
-	if (!acpi_tables_init())
-		acpi_lapic = 1;
-}
-
diff -urN linux-2.4.23-pre4/arch/i386/kernel/acpitable.h linux-2.4.23-pre5/arch/i386/kernel/acpitable.h
--- linux-2.4.23-pre4/arch/i386/kernel/acpitable.h	2003-08-25 04:44:39.000000000 -0700
+++ linux-2.4.23-pre5/arch/i386/kernel/acpitable.h	1969-12-31 16:00:00.000000000 -0800
@@ -1,262 +0,0 @@
-/*
- *  acpitable.c - IA32-specific ACPI boot-time initialization (Revision: 1)
- *
- *  Copyright (C) 1999 Andrew Henroid
- *  Copyright (C) 2001 Richard Schaal
- *  Copyright (C) 2001 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
- *  Copyright (C) 2001 Jun Nakajima <jun.nakajima@intel.com>
- *  Copyright (C) 2001 Arjan van de Ven <arjanv@redhat.com>
- *
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- *
- * $Id: acpitable.h,v 1.3 2001/11/03 22:41:34 fenrus Exp $
- */
-
-/*
- * The following codes are cut&pasted from drivers/acpi. Part of the code
- * there can be not updated or delivered yet.
- * To avoid conflicts when CONFIG_ACPI is defined, the following codes are
- * modified so that they are self-contained in this file.
- * -- jun
- */
- 
-#ifndef _HEADER_ACPITABLE_H_
-#define _HEADER_ACPITABLE_H_
-
-//#define dprintk(s, args...) printk(s, ## args)
-#define dprintk(s, args...)
-
-typedef unsigned int ACPI_TBLPTR;
-
-typedef struct {		/* ACPI common table header */
-	char signature[4];	/* identifies type of table */
-	u32 length;		/* length of table,
-				   in bytes, * including header */
-	u8 revision;		/* specification minor version # */
-	u8 checksum;		/* to make sum of entire table == 0 */
-	char oem_id[6];		/* OEM identification */
-	char oem_table_id[8];	/* OEM table identification */
-	u32 oem_revision;	/* OEM revision number */
-	char asl_compiler_id[4];	/* ASL compiler vendor ID */
-	u32 asl_compiler_revision;	/* ASL compiler revision number */
-} acpi_table_header __attribute__ ((packed));;
-
-enum {
-	ACPI_APIC = 0,
-	ACPI_BOOT,
-	ACPI_DBGP,
-	ACPI_DSDT,
-	ACPI_ECDT,
-	ACPI_ETDT,
-	ACPI_FACP,
-	ACPI_FACS,
-	ACPI_OEMX,
-	ACPI_PSDT,
-	ACPI_SBST,
-	ACPI_SLIT,
-	ACPI_SPCR,
-	ACPI_SRAT,
-	ACPI_SSDT,
-	ACPI_SPMI,
-	ACPI_XSDT,
-	ACPI_TABLE_COUNT
-};
-
-static char *acpi_table_signatures[ACPI_TABLE_COUNT] = {
-	"APIC",
-	"BOOT",
-	"DBGP",
-	"DSDT",
-	"ECDT",
-	"ETDT",
-	"FACP",
-	"FACS",
-	"OEM",
-	"PSDT",
-	"SBST",
-	"SLIT",
-	"SPCR",
-	"SRAT",
-	"SSDT",
-	"SPMI",
-	"XSDT"
-};
-
-struct acpi_table_madt {
-	acpi_table_header header;
-	u32 lapic_address;
-	struct {
-		u32 pcat_compat:1;
-		u32 reserved:31;
-	} flags __attribute__ ((packed));
-} __attribute__ ((packed));;
-
-enum {
-	ACPI_MADT_LAPIC = 0,
-	ACPI_MADT_IOAPIC,
-	ACPI_MADT_INT_SRC_OVR,
-	ACPI_MADT_NMI_SRC,
-	ACPI_MADT_LAPIC_NMI,
-	ACPI_MADT_LAPIC_ADDR_OVR,
-	ACPI_MADT_IOSAPIC,
-	ACPI_MADT_LSAPIC,
-	ACPI_MADT_PLAT_INT_SRC,
-	ACPI_MADT_ENTRY_COUNT
-};
-
-#define RSDP_SIG			"RSD PTR "
-#define RSDT_SIG 			"RSDT"
-
-#define ACPI_DEBUG_PRINT(pl)
-
-#define ACPI_MEMORY_MODE                0x01
-#define ACPI_LOGICAL_ADDRESSING         0x00
-#define ACPI_PHYSICAL_ADDRESSING        0x01
-
-#define LO_RSDP_WINDOW_BASE         	0	/* Physical Address */
-#define HI_RSDP_WINDOW_BASE         	0xE0000	/* Physical Address */
-#define LO_RSDP_WINDOW_SIZE         	0x400
-#define HI_RSDP_WINDOW_SIZE         	0x20000
-#define RSDP_SCAN_STEP			16
-#define RSDP_CHECKSUM_LENGTH		20
-
-typedef int (*acpi_table_handler) (acpi_table_header * header, unsigned long);
-
-struct acpi_table_rsdp {
-	char signature[8];
-	u8 checksum;
-	char oem_id[6];
-	u8 revision;
-	u32 rsdt_address;
-} __attribute__ ((packed));
-
-struct acpi_table_rsdt {
-	acpi_table_header header;
-	u32 entry[ACPI_TABLE_COUNT];
-} __attribute__ ((packed));
-
-typedef struct {
-	u8 type;
-	u8 length;
-} acpi_madt_entry_header __attribute__ ((packed));
-
-typedef struct {
-	u16 polarity:2;
-	u16 trigger:2;
-	u16 reserved:12;
-} acpi_madt_int_flags __attribute__ ((packed));
-
-struct acpi_table_lapic {
-	acpi_madt_entry_header header;
-	u8 acpi_id;
-	u8 id;
-	struct {
-		u32 enabled:1;
-		u32 reserved:31;
-	} flags __attribute__ ((packed));
-} __attribute__ ((packed));
-
-struct acpi_table_ioapic {
-	acpi_madt_entry_header header;
-	u8 id;
-	u8 reserved;
-	u32 address;
-	u32 global_irq_base;
-} __attribute__ ((packed));
-
-struct acpi_table_int_src_ovr {
-	acpi_madt_entry_header header;
-	u8 bus;
-	u8 bus_irq;
-	u32 global_irq;
-	acpi_madt_int_flags flags;
-} __attribute__ ((packed));
-
-struct acpi_table_nmi_src {
-	acpi_madt_entry_header header;
-	acpi_madt_int_flags flags;
-	u32 global_irq;
-} __attribute__ ((packed));
-
-struct acpi_table_lapic_nmi {
-	acpi_madt_entry_header header;
-	u8 acpi_id;
-	acpi_madt_int_flags flags;
-	u8 lint;
-} __attribute__ ((packed));
-
-struct acpi_table_lapic_addr_ovr {
-	acpi_madt_entry_header header;
-	u8 reserved[2];
-	u64 address;
-} __attribute__ ((packed));
-
-struct acpi_table_iosapic {
-	acpi_madt_entry_header header;
-	u8 id;
-	u8 reserved;
-	u32 global_irq_base;
-	u64 address;
-} __attribute__ ((packed));
-
-struct acpi_table_lsapic {
-	acpi_madt_entry_header header;
-	u8 acpi_id;
-	u8 id;
-	u8 eid;
-	u8 reserved[3];
-	struct {
-		u32 enabled:1;
-		u32 reserved:31;
-	} flags;
-} __attribute__ ((packed));
-
-struct acpi_table_plat_int_src {
-	acpi_madt_entry_header header;
-	acpi_madt_int_flags flags;
-	u8 type;
-	u8 id;
-	u8 eid;
-	u8 iosapic_vector;
-	u32 global_irq;
-	u32 reserved;
-} __attribute__ ((packed));
-
-/*
- * ACPI Table Descriptor.  One per ACPI table
- */
-typedef struct acpi_table_desc {
-	struct acpi_table_desc *prev;
-	struct acpi_table_desc *next;
-	struct acpi_table_desc *installed_desc;
-	acpi_table_header *pointer;
-	void *base_pointer;
-	u8 *aml_pointer;
-	u64 physical_address;
-	u32 aml_length;
-	u32 length;
-	u32 count;
-	u16 table_id;
-	u8 type;
-	u8 allocation;
-	u8 loaded_into_namespace;
-
-} acpi_table_desc __attribute__ ((packed));;
-
-#endif
diff -urN linux-2.4.23-pre4/arch/i386/kernel/dmi_scan.c linux-2.4.23-pre5/arch/i386/kernel/dmi_scan.c
--- linux-2.4.23-pre4/arch/i386/kernel/dmi_scan.c	2003-09-21 13:22:26.000000000 -0700
+++ linux-2.4.23-pre5/arch/i386/kernel/dmi_scan.c	2003-09-21 13:22:29.000000000 -0700
@@ -895,11 +895,6 @@
 			MATCH(DMI_BOARD_NAME, "CUR-DLS"),
 			NO_MATCH, NO_MATCH }},
 
-	{ force_acpi_ht, "ASUS A7V", {
-			MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC"),
-			MATCH(DMI_BOARD_NAME, "<A7V>"),
-			MATCH(DMI_BIOS_VERSION, "ASUS A7V ACPI BIOS Revision 1011"), NO_MATCH }},
-
 	{ force_acpi_ht, "ABIT i440BX-W83977", {
 			MATCH(DMI_BOARD_VENDOR, "ABIT <http://www.abit.com>"),
 			MATCH(DMI_BOARD_NAME, "i440BX-W83977 (BP6)"),
@@ -932,7 +927,9 @@
 	{ disable_acpi_pci, "ASUS A7V", {
 			MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC"),
 			MATCH(DMI_BOARD_NAME, "<A7V>"),
-			MATCH(DMI_BIOS_VERSION, "ASUS A7V ACPI BIOS Revision 1007"), NO_MATCH }},
+			/* newer BIOS, Revision 1011, does work */
+			MATCH(DMI_BIOS_VERSION, "ASUS A7V ACPI BIOS Revision 1007"),
+			NO_MATCH }},
 #endif	// CONFIG_ACPI_BOOT
 
 	{ NULL, }
diff -urN linux-2.4.23-pre4/arch/i386/kernel/head.S linux-2.4.23-pre5/arch/i386/kernel/head.S
--- linux-2.4.23-pre4/arch/i386/kernel/head.S	2003-09-21 13:22:26.000000000 -0700
+++ linux-2.4.23-pre5/arch/i386/kernel/head.S	2003-09-21 13:22:29.000000000 -0700
@@ -113,7 +113,7 @@
 	popfl
 	jmp checkCPUtype
 1:
-#endif CONFIG_SMP
+#endif /* CONFIG_SMP */
 
 /*
  * Clear BSS first so that there are no surprises...
diff -urN linux-2.4.23-pre4/arch/i386/kernel/mpparse.c linux-2.4.23-pre5/arch/i386/kernel/mpparse.c
--- linux-2.4.23-pre4/arch/i386/kernel/mpparse.c	2003-09-21 13:22:26.000000000 -0700
+++ linux-2.4.23-pre5/arch/i386/kernel/mpparse.c	2003-09-21 13:22:29.000000000 -0700
@@ -683,6 +683,24 @@
 	struct mpc_config_lintsrc lintsrc;
 	int linttypes[2] = { mp_ExtINT, mp_NMI };
 	int i;
+	struct {
+		int mp_bus_id_to_type[MAX_MP_BUSSES];
+		int mp_bus_id_to_node[MAX_MP_BUSSES];
+		int mp_bus_id_to_local[MAX_MP_BUSSES];
+		int mp_bus_id_to_pci_bus[MAX_MP_BUSSES];
+		struct mpc_config_intsrc mp_irqs[MAX_IRQ_SOURCES];
+	} *bus_data;
+
+	bus_data = alloc_bootmem(sizeof(*bus_data));
+	if (!bus_data)
+		panic("SMP mptable: out of memory!\n");
+	mp_bus_id_to_type = bus_data->mp_bus_id_to_type;
+	mp_bus_id_to_node = bus_data->mp_bus_id_to_node;
+	mp_bus_id_to_local = bus_data->mp_bus_id_to_local;
+	mp_bus_id_to_pci_bus = bus_data->mp_bus_id_to_pci_bus;
+	mp_irqs = bus_data->mp_irqs;
+	for (i = 0; i < MAX_MP_BUSSES; ++i)
+		mp_bus_id_to_pci_bus[i] = -1;
 
 	/*
 	 * local APIC has default address
@@ -1021,7 +1039,7 @@
 			return i;
 	}
 
-	printk(KERN_ERR "ERROR: Unable to locate IOAPIC for IRQ %d/n", irq);
+	printk(KERN_ERR "ERROR: Unable to locate IOAPIC for IRQ %d\n", irq);
 
 	return -1;
 }
@@ -1206,8 +1224,6 @@
 	}
 }
 
-/* Ensure the ACPI SCI interrupt level is active low, edge-triggered */
-
 extern FADT_DESCRIPTOR acpi_fadt;
 
 void __init mp_config_ioapic_for_sci(int irq)
@@ -1216,6 +1232,7 @@
 	int ioapic_pin;
 	struct acpi_table_madt* madt;
 	struct acpi_table_int_src_ovr *entry = NULL;
+	acpi_interrupt_flags flags;
 	void *madt_end;
 	acpi_status status;
 
@@ -1234,30 +1251,36 @@
 
 		while ((void *) entry < madt_end) {
                 	if (entry->header.type == ACPI_MADT_INT_SRC_OVR &&
-			    acpi_fadt.sci_int == entry->bus_irq) {
-				/*
-				 * See the note at the end of ACPI 2.0b section
-				 * 5.2.10.8 for what this is about.
-				 */
-				if (entry->bus_irq != entry->global_irq) {
-					acpi_fadt.sci_int = entry->global_irq;
-					irq = entry->global_irq;
-					break;
-				}
-				else
-                			return;
-			}
-
+			    acpi_fadt.sci_int == entry->bus_irq)
+				goto found;
+			
                 	entry = (struct acpi_table_int_src_ovr *)
                 	        ((unsigned long) entry + entry->header.length);
         	}
 	}
+	/*
+	 * Although the ACPI spec says that the SCI should be level/low
+	 * don't reprogram it unless there is an explicit MADT OVR entry
+	 * instructing us to do so -- otherwise we break Tyan boards which
+	 * have the SCI wired edge/high but no MADT OVR.
+	 */
+	return;
 
+found:
+	/*
+	 * See the note at the end of ACPI 2.0b section
+	 * 5.2.10.8 for what this is about.
+	 */
+	flags = entry->flags;
+	acpi_fadt.sci_int = entry->global_irq;
+	irq = entry->global_irq;
+	
 	ioapic = mp_find_ioapic(irq);
 
 	ioapic_pin = irq - mp_ioapic_routing[ioapic].irq_start;
 
-	io_apic_set_pci_routing(ioapic, ioapic_pin, irq, 1, 1); // Active low, level triggered
+	io_apic_set_pci_routing(ioapic, ioapic_pin, irq, 
+				(flags.trigger >> 1) , (flags.polarity >> 1));
 }
 
 
@@ -1295,8 +1318,10 @@
 		}
 
 		/* Don't set up the ACPI SCI because it's already set up */
-		if (acpi_fadt.sci_int == irq)
+                if (acpi_fadt.sci_int == irq) {
+                        entry->irq = irq; /*we still need to set entry's irq*/
 			continue;
+                }
 	
 		ioapic = mp_find_ioapic(irq);
 		if (ioapic < 0)
diff -urN linux-2.4.23-pre4/arch/i386/kernel/setup.c linux-2.4.23-pre5/arch/i386/kernel/setup.c
--- linux-2.4.23-pre4/arch/i386/kernel/setup.c	2003-09-21 13:22:26.000000000 -0700
+++ linux-2.4.23-pre5/arch/i386/kernel/setup.c	2003-09-21 13:22:29.000000000 -0700
@@ -176,9 +176,9 @@
 static u32 disabled_x86_caps[NCAPINTS] __initdata = { 0 };
 
 #ifdef	CONFIG_ACPI_INTERPRETER
-	int acpi_disabled __initdata = 0;
+	int acpi_disabled = 0;
 #else
-	int acpi_disabled __initdata = 1;
+	int acpi_disabled = 1;
 #endif
 EXPORT_SYMBOL(acpi_disabled);
 
diff -urN linux-2.4.23-pre4/arch/i386/mm/ioremap.c linux-2.4.23-pre5/arch/i386/mm/ioremap.c
--- linux-2.4.23-pre4/arch/i386/mm/ioremap.c	2002-08-02 17:39:42.000000000 -0700
+++ linux-2.4.23-pre5/arch/i386/mm/ioremap.c	2003-09-21 13:22:29.000000000 -0700
@@ -140,7 +140,7 @@
 	 */
 	offset = phys_addr & ~PAGE_MASK;
 	phys_addr &= PAGE_MASK;
-	size = PAGE_ALIGN(last_addr) - phys_addr;
+	size = PAGE_ALIGN(last_addr+1) - phys_addr;
 
 	/*
 	 * Ok, go for it..
diff -urN linux-2.4.23-pre4/arch/ppc/boot/common/crt0.S linux-2.4.23-pre5/arch/ppc/boot/common/crt0.S
--- linux-2.4.23-pre4/arch/ppc/boot/common/crt0.S	2003-08-25 04:44:40.000000000 -0700
+++ linux-2.4.23-pre5/arch/ppc/boot/common/crt0.S	2003-09-21 13:22:29.000000000 -0700
@@ -70,7 +70,7 @@
 	## Set up the stack
 
 	lis	r9,_start@h		# r9 = &_start (text section entry)
-	addi	r9,r9,_start@l
+	ori	r9,r9,_start@l
 	subi	r1,r9,64		# Start the stack 64 bytes below _start
 	clrrwi	r1,r1,4			# Make sure it is aligned on 16 bytes.
 	li	r0,0
diff -urN linux-2.4.23-pre4/arch/ppc/boot/common/util.S linux-2.4.23-pre5/arch/ppc/boot/common/util.S
--- linux-2.4.23-pre4/arch/ppc/boot/common/util.S	2003-06-13 07:51:31.000000000 -0700
+++ linux-2.4.23-pre5/arch/ppc/boot/common/util.S	2003-09-21 13:22:29.000000000 -0700
@@ -160,9 +160,22 @@
 	blr
 
 
+/* udelay (on non-601 processors) needs to know the period of the
+ * timebase in nanoseconds.  This used to be hardcoded to be 60ns
+ * (period of 66MHz/4).  Now a variable is used that is initialized to
+ * 60 for backward compatibility, but it can be overridden as necessary
+ * with code something like this:
+ *    extern unsigned long timebase_period_ns;
+ *    timebase_period_ns = 1000000000 / bd->bi_tbfreq;
+ */
+	.data
+	.globl timebase_period_ns
+timebase_period_ns:
+	.long	60
+
+	.text
 /*
  * Delay for a number of microseconds
- * -- Use the BUS timer (assumes 66MHz)
  */
 	.globl	udelay
 udelay:
@@ -180,8 +193,13 @@
 
 .udelay_not_601:
 	mulli	r4,r3,1000	/* nanoseconds */
-	addi	r4,r4,59
-	li	r5,60
+	/*  Change r4 to be the number of ticks using:	
+	 *	(nanoseconds + (timebase_period_ns - 1 )) / timebase_period_ns
+	 *  timebase_period_ns defaults to 60 (16.6MHz) */
+	lis	r5,timebase_period_ns@ha
+	lwz	r5,timebase_period_ns@l(r5)
+	add	r4,r4,r5
+	addi	r4,r4,-1
 	divw	r4,r4,r5	/* BUS ticks */
 1:	mftbu	r5
 	mftb	r6
diff -urN linux-2.4.23-pre4/arch/ppc/boot/simple/Makefile linux-2.4.23-pre5/arch/ppc/boot/simple/Makefile
--- linux-2.4.23-pre4/arch/ppc/boot/simple/Makefile	2003-09-21 13:22:26.000000000 -0700
+++ linux-2.4.23-pre5/arch/ppc/boot/simple/Makefile	2003-09-21 13:22:29.000000000 -0700
@@ -31,6 +31,7 @@
 ifeq ($(CONFIG_IBM_OPENBIOS),y)
 ZIMAGE				:= zImage-TREE
 ZIMAGEINITRD			:= zImage.initrd-TREE
+END				:= treeboot
 ZNETBOOT			:= zImage.treeboot
 ZNETBOOTRD			:= zImage.initrd.treeboot
 TFTPIMAGE			:= /tftpboot/zImage.embedded
diff -urN linux-2.4.23-pre4/arch/ppc/boot/simple/embed_config.c linux-2.4.23-pre5/arch/ppc/boot/simple/embed_config.c
--- linux-2.4.23-pre4/arch/ppc/boot/simple/embed_config.c	2003-09-21 13:22:26.000000000 -0700
+++ linux-2.4.23-pre5/arch/ppc/boot/simple/embed_config.c	2003-09-21 13:22:29.000000000 -0700
@@ -22,6 +22,7 @@
 #if defined(CONFIG_405GP) || defined(CONFIG_NP405H) || defined(CONFIG_NP405L)
 #include <linux/netdevice.h>
 #endif
+extern unsigned long timebase_period_ns;
 
 /* For those boards that don't provide one.
 */
@@ -654,15 +655,12 @@
 	bd_t *(*get_board_info)(void) =
 	    (bd_t *(*)(void))(*(unsigned long *)BOARD_INFO_VECTOR);
 #if !defined(CONFIG_STB03xxx)
-	volatile emac_t *emacp;
-	emacp = (emac_t *)EMAC0_BASE;  /* assume 1st emac - armin */
-
 	/* shut down the Ethernet controller that the boot rom
 	 * sometimes leaves running.
 	 */
-	mtdcr(DCRN_MALCR, MALCR_MMSR);                /* 1st reset MAL */
-	while (mfdcr(DCRN_MALCR) & MALCR_MMSR) {};    /* wait for the reset */
-	emacp->em0mr0 = 0x20000000;        /* then reset EMAC */
+	mtdcr(DCRN_MALCR(DCRN_MAL_BASE), MALCR_MMSR);                /* 1st reset MAL */
+	while (mfdcr(DCRN_MALCR(DCRN_MAL_BASE)) & MALCR_MMSR) {};    /* wait for the reset */
+	out_be32((u32 *)EMAC0_BASE, 0x20000000);        /* then reset EMAC */
 	eieio();
 #endif
 
@@ -752,6 +750,7 @@
 	bd->bi_busfreq   = 100000000;
 	bd->bi_pci_busfreq= 33000000 ;
 #endif
+	timebase_period_ns = 1000000000 / bd->bi_tbfreq;
 }
 #endif
 
diff -urN linux-2.4.23-pre4/arch/ppc/boot/simple/misc-44x.c linux-2.4.23-pre5/arch/ppc/boot/simple/misc-44x.c
--- linux-2.4.23-pre4/arch/ppc/boot/simple/misc-44x.c	2003-09-21 13:22:26.000000000 -0700
+++ linux-2.4.23-pre5/arch/ppc/boot/simple/misc-44x.c	2003-09-21 13:22:29.000000000 -0700
@@ -19,10 +19,12 @@
 
 extern struct bi_record *decompress_kernel(unsigned long load_addr,
 	int num_words, unsigned long cksum);
+extern unsigned long timebase_period_ns;
 
 struct bi_record *
 load_kernel(unsigned long load_addr, int num_words, unsigned long cksum)
 {
+	timebase_period_ns = 3;
 	mtdcr(DCRN_MALCR(DCRN_MAL_BASE), MALCR_MMSR);		  /* reset MAL */
 	while (mfdcr(DCRN_MALCR(DCRN_MAL_BASE)) & MALCR_MMSR) {}; /* wait for reset */
 	*(volatile unsigned long *)PPC44x_EMAC0_MR0 = 0x20000000; /* reset EMAC */
diff -urN linux-2.4.23-pre4/arch/ppc/boot/simple/misc-embedded.c linux-2.4.23-pre5/arch/ppc/boot/simple/misc-embedded.c
--- linux-2.4.23-pre4/arch/ppc/boot/simple/misc-embedded.c	2003-06-13 07:51:31.000000000 -0700
+++ linux-2.4.23-pre5/arch/ppc/boot/simple/misc-embedded.c	2003-09-21 13:22:29.000000000 -0700
@@ -16,6 +16,7 @@
 #include <linux/types.h>
 #include <linux/elf.h>
 #include <asm/bootinfo.h>
+#include <asm/ibm4xx.h>
 #include <asm/mmu.h>
 #include <asm/mpc8xx.h>
 #include <asm/mpc8260.h>
diff -urN linux-2.4.23-pre4/arch/ppc/kernel/cputable.c linux-2.4.23-pre5/arch/ppc/kernel/cputable.c
--- linux-2.4.23-pre4/arch/ppc/kernel/cputable.c	2003-09-21 13:22:26.000000000 -0700
+++ linux-2.4.23-pre5/arch/ppc/kernel/cputable.c	2003-09-21 13:22:29.000000000 -0700
@@ -325,7 +325,7 @@
     {	/* PPC970 */
 	0xffff0000, 0x00390000, "PPC970",
 	CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
-	CPU_FTR_ALTIVEC_COMP,
+	CPU_FTR_ALTIVEC_COMP | CPU_FTR_CAN_NAP,
 	COMMON_PPC | PPC_FEATURE_64 | PPC_FEATURE_HAS_ALTIVEC,
 	128, 128,
 	__setup_cpu_ppc970
diff -urN linux-2.4.23-pre4/arch/ppc/kernel/head.S linux-2.4.23-pre5/arch/ppc/kernel/head.S
--- linux-2.4.23-pre4/arch/ppc/kernel/head.S	2003-09-21 13:22:26.000000000 -0700
+++ linux-2.4.23-pre5/arch/ppc/kernel/head.S	2003-09-21 13:22:29.000000000 -0700
@@ -1700,9 +1700,8 @@
 	mtspr	0x3f6,r0
 	isync
 	mfspr	r0,SPRN_HID0
-	li	r11,0x40		/* clear NAP bit */
-	sldi	r11,r11,48
-	andc	r0,r0,r11
+	li	r11,5			/* clear DOZE and SLEEP */
+	rldimi	r0,r11,52,8		/* and set NAP and DPM */
 	mtspr	SPRN_HID0,r0
 	mfspr	r0,SPRN_HID0
 	mfspr	r0,SPRN_HID0
diff -urN linux-2.4.23-pre4/arch/ppc/kernel/idle_gen.c linux-2.4.23-pre5/arch/ppc/kernel/idle_gen.c
--- linux-2.4.23-pre4/arch/ppc/kernel/idle_gen.c	2003-08-25 04:44:40.000000000 -0700
+++ linux-2.4.23-pre5/arch/ppc/kernel/idle_gen.c	2003-09-21 13:22:29.000000000 -0700
@@ -15,10 +15,15 @@
 
 void power_save(void)
 {
-	/* Make sure the CPU has the DOZE feature set. */
+	/*
+	 * Make sure the CPU has the DOZE or NAP feature set.
+	 * We assume that chip-specific initialization code
+	 * has set any other registers necessary (e.g. HID0).
+	 */
 	if (!(cur_cpu_spec[smp_processor_id()]->cpu_features
-				& CPU_FTR_CAN_DOZE))
+	      & (CPU_FTR_CAN_DOZE | CPU_FTR_CAN_NAP)))
 		return;
+
 	/*
 	 * Disable interrupts to prevent a lost wakeup
 	 * when going to sleep.  This is necessary even with
diff -urN linux-2.4.23-pre4/arch/ppc/kernel/signal.c linux-2.4.23-pre5/arch/ppc/kernel/signal.c
--- linux-2.4.23-pre4/arch/ppc/kernel/signal.c	2003-09-21 13:22:26.000000000 -0700
+++ linux-2.4.23-pre5/arch/ppc/kernel/signal.c	2003-09-21 13:22:29.000000000 -0700
@@ -315,7 +315,7 @@
 				     sizeof(sr->mc_vregs)))
 			return 1;
 	} else if (current->thread.used_vr)
-		memset(&current->thread.vr, 0, sizeof(current->thread.vr));
+		memset(&current->thread.vr, 0, ELF_NVRREG * sizeof(vector128));
 
 	/* Always get VRSAVE back */
 	if (__get_user(current->thread.vrsave, (u32 *)&sr->mc_vregs[32]))
@@ -371,7 +371,6 @@
 			  &rt_sf->uc.uc_stack.ss_flags)
 	    || __put_user(current->sas_ss_size, &rt_sf->uc.uc_stack.ss_size)
 	    || __put_user(&rt_sf->uc.uc_mcontext, &rt_sf->uc.uc_regs)
-	    || __copy_to_user(&rt_sf->uc.uc_oldsigmask, oldset, sizeof(*oldset))
 	    || __copy_to_user(&rt_sf->uc.uc_sigmask, oldset, sizeof(*oldset)))
 		goto badframe;
 
@@ -405,12 +404,13 @@
 static int do_setcontext(struct ucontext *ucp, struct pt_regs *regs)
 {
 	sigset_t set;
+	struct mcontext *mcp;
 
-	if (__copy_from_user(&set, &ucp->uc_sigmask, sizeof(set)))
+	if (__copy_from_user(&set, &ucp->uc_sigmask, sizeof(set))
+	    || __get_user(mcp, &ucp->uc_regs))
 		return -EFAULT;
 	restore_sigmask(&set);
-
-	if (restore_user_regs(regs, &ucp->uc_mcontext))
+	if (restore_user_regs(regs, mcp))
 		return -EFAULT;
 
 	return 0;
@@ -426,9 +426,6 @@
 		    || save_user_regs(regs, &old_ctx->uc_mcontext, 0)
 		    || __copy_to_user(&old_ctx->uc_sigmask,
 				      &current->blocked, sizeof(sigset_t))
-		    /* the next 2 things aren't strictly necessary */
-		    || __copy_to_user(&old_ctx->uc_oldsigmask,
-				      &current->blocked, sizeof(sigset_t))
 		    || __put_user(&old_ctx->uc_mcontext, &old_ctx->uc_regs))
 			return -EFAULT;
 	}
diff -urN linux-2.4.23-pre4/arch/x86_64/kernel/irq.c linux-2.4.23-pre5/arch/x86_64/kernel/irq.c
--- linux-2.4.23-pre4/arch/x86_64/kernel/irq.c	2002-11-28 15:53:12.000000000 -0800
+++ linux-2.4.23-pre5/arch/x86_64/kernel/irq.c	2003-09-21 13:22:29.000000000 -0700
@@ -32,6 +32,7 @@
 #include <linux/kernel_stat.h>
 #include <linux/irq.h>
 #include <linux/proc_fs.h>
+#include <linux/seq_file.h>
 
 #include <asm/atomic.h>
 #include <asm/io.h>
@@ -154,57 +155,56 @@
  * Generic, controller-independent functions:
  */
 
-int get_irq_list(char *buf)
+int show_interrupts(struct seq_file *p, void *v)
 {
 	int i, j;
 	struct irqaction * action;
-	char *p = buf;
 
-	p += sprintf(p, "           ");
+	seq_printf(p, "           ");
 	for (j=0; j<smp_num_cpus; j++)
-		p += sprintf(p, "CPU%d       ",j);
-	*p++ = '\n';
+		seq_printf(p, "CPU%d       ",j);
+	seq_putc(p,'\n');
 
 	for (i = 0 ; i < NR_IRQS ; i++) {
 		action = irq_desc[i].action;
 		if (!action) 
 			continue;
-		p += sprintf(p, "%3d: ",i);
+		seq_printf(p, "%3d: ",i);
 #ifndef CONFIG_SMP
-		p += sprintf(p, "%10u ", kstat_irqs(i));
+		seq_printf(p, "%10u ", kstat_irqs(i));
 #else
 		for (j = 0; j < smp_num_cpus; j++)
-			p += sprintf(p, "%10u ",
+			seq_printf(p, "%10u ",
 				kstat.irqs[cpu_logical_map(j)][i]);
 #endif
-		p += sprintf(p, " %14s", irq_desc[i].handler->typename);
-		p += sprintf(p, "  %s", action->name);
+		seq_printf(p, " %14s", irq_desc[i].handler->typename);
+		seq_printf(p, "  %s", action->name);
 
 		for (action=action->next; action; action = action->next)
-			p += sprintf(p, ", %s", action->name);
-		*p++ = '\n';
+			seq_printf(p, ", %s", action->name);
+		seq_putc(p,'\n');
 	}
-	p += sprintf(p, "NMI: ");
+	seq_printf(p, "NMI: ");
 	for (j = 0; j < smp_num_cpus; j++)
-		p += sprintf(p, "%10u ",
+		seq_printf(p, "%10u ",
 			nmi_count(cpu_logical_map(j)));
-	p += sprintf(p, "\n");
+	seq_printf(p, "\n");
 #if CONFIG_X86_LOCAL_APIC
-	p += sprintf(p, "LOC: ");
+	seq_printf(p, "LOC: ");
 	for (j = 0; j < smp_num_cpus; j++)
-		p += sprintf(p, "%10u ",
+		seq_printf(p, "%10u ",
 			apic_timer_irqs[cpu_logical_map(j)]);
-	p += sprintf(p, "\n");
+	seq_printf(p, "\n");
 #endif
-	p += sprintf(p, "ERR: %10u\n", atomic_read(&irq_err_count));
+	seq_printf(p, "ERR: %10u\n", atomic_read(&irq_err_count));
 #ifdef CONFIG_X86_IO_APIC
 #ifdef APIC_MISMATCH_DEBUG
-	p += sprintf(p, "MIS: %10u\n", atomic_read(&irq_mis_count));
+	seq_printf(p, "MIS: %10u\n", atomic_read(&irq_mis_count));
 #endif
 #endif
-	return p - buf;
-}
 
+	return 0;
+}
 
 /*
  * Global interrupt locks for SMP. Allow interrupts to come in on any
diff -urN linux-2.4.23-pre4/arch/x86_64/kernel/mpparse.c linux-2.4.23-pre5/arch/x86_64/kernel/mpparse.c
--- linux-2.4.23-pre4/arch/x86_64/kernel/mpparse.c	2003-09-21 13:22:26.000000000 -0700
+++ linux-2.4.23-pre5/arch/x86_64/kernel/mpparse.c	2003-09-21 13:22:29.000000000 -0700
@@ -713,7 +713,7 @@
 			return i;
 	}
 
-	printk(KERN_ERR "ERROR: Unable to locate IOAPIC for IRQ %d/n", irq);
+	printk(KERN_ERR "ERROR: Unable to locate IOAPIC for IRQ %d\n", irq);
 
 	return -1;
 }
diff -urN linux-2.4.23-pre4/arch/x86_64/kernel/setup.c linux-2.4.23-pre5/arch/x86_64/kernel/setup.c
--- linux-2.4.23-pre4/arch/x86_64/kernel/setup.c	2003-08-25 04:44:40.000000000 -0700
+++ linux-2.4.23-pre5/arch/x86_64/kernel/setup.c	2003-09-21 13:22:29.000000000 -0700
@@ -48,7 +48,7 @@
 #include <asm/bootsetup.h>
 #include <asm/proto.h>
 
-int acpi_disabled __initdata = 0;
+int acpi_disabled = 0;
 
 /*
  * Machine setup..
diff -urN linux-2.4.23-pre4/drivers/acpi/Config.in linux-2.4.23-pre5/drivers/acpi/Config.in
--- linux-2.4.23-pre4/drivers/acpi/Config.in	2003-08-25 04:44:40.000000000 -0700
+++ linux-2.4.23-pre5/drivers/acpi/Config.in	2003-09-21 13:22:29.000000000 -0700
@@ -8,6 +8,9 @@
   comment 'ACPI Support'
   bool         'ACPI Support' CONFIG_ACPI
   if [ "$CONFIG_ACPI" = "y" ]; then
+
+    define_bool CONFIG_ACPI_BOOT		y
+
     if [ "$CONFIG_SMP" = "y" ]; then
       bool         'CPU Enumeration Only' CONFIG_ACPI_HT_ONLY
     else
@@ -15,7 +18,6 @@
     fi
 
     if [ "$CONFIG_ACPI_HT_ONLY" = "n" ]; then
-      define_bool CONFIG_ACPI_BOOT		y
       define_bool CONFIG_ACPI_BUS		y
       define_bool CONFIG_ACPI_INTERPRETER	y
       define_bool CONFIG_ACPI_EC		y
diff -urN linux-2.4.23-pre4/drivers/acpi/ec.c linux-2.4.23-pre5/drivers/acpi/ec.c
--- linux-2.4.23-pre4/drivers/acpi/ec.c	2003-08-25 04:44:41.000000000 -0700
+++ linux-2.4.23-pre5/drivers/acpi/ec.c	2003-09-21 13:22:29.000000000 -0700
@@ -33,7 +33,7 @@
 #include <asm/io.h>
 #include <acpi/acpi_bus.h>
 #include <acpi/acpi_drivers.h>
-
+#include <acpi/actypes.h>
 
 #define _COMPONENT		ACPI_EC_COMPONENT
 ACPI_MODULE_NAME		("acpi_ec")
@@ -408,7 +408,10 @@
 	 * The EC object is in the handler context and is needed
 	 * when calling the acpi_ec_space_handler.
 	 */
-	*return_context = handler_context;
+	if(function == ACPI_REGION_DEACTIVATE) 
+		*return_context = NULL;
+	else 
+		*return_context = handler_context;
 
 	return AE_OK;
 }
diff -urN linux-2.4.23-pre4/drivers/acpi/events/evregion.c linux-2.4.23-pre5/drivers/acpi/events/evregion.c
--- linux-2.4.23-pre4/drivers/acpi/events/evregion.c	2003-08-25 04:44:41.000000000 -0700
+++ linux-2.4.23-pre5/drivers/acpi/events/evregion.c	2003-09-21 13:22:29.000000000 -0700
@@ -382,7 +382,7 @@
 	union acpi_operand_object       *obj_desc;
 	union acpi_operand_object       **last_obj_ptr;
 	acpi_adr_space_setup            region_setup;
-	void                            *region_context;
+	void                            **region_context;
 	union acpi_operand_object       *region_obj2;
 	acpi_status                     status;
 
@@ -394,7 +394,7 @@
 	if (!region_obj2) {
 		return_VOID;
 	}
-	region_context = region_obj2->extra.region_context;
+	region_context = &region_obj2->extra.region_context;
 
 	/* Get the address handler from the region object */
 
@@ -450,7 +450,7 @@
 
 			region_setup = handler_obj->address_space.setup;
 			status = region_setup (region_obj, ACPI_REGION_DEACTIVATE,
-					  handler_obj->address_space.context, &region_context);
+					  handler_obj->address_space.context, region_context);
 
 			/* Init routine may fail, Just ignore errors */
 
diff -urN linux-2.4.23-pre4/drivers/acpi/pci_link.c linux-2.4.23-pre5/drivers/acpi/pci_link.c
--- linux-2.4.23-pre4/drivers/acpi/pci_link.c	2003-08-25 04:44:41.000000000 -0700
+++ linux-2.4.23-pre5/drivers/acpi/pci_link.c	2003-09-21 13:22:29.000000000 -0700
@@ -216,7 +216,6 @@
 	return AE_CTRL_TERMINATE;
 }
 
-
 static int
 acpi_pci_link_get_current (
 	struct acpi_pci_link	*link)
@@ -275,6 +274,28 @@
 	return_VALUE(result);
 }
 
+static int
+acpi_pci_link_try_get_current (
+	struct acpi_pci_link *link,
+	int irq)
+{
+	int result;
+
+	ACPI_FUNCTION_TRACE("acpi_pci_link_try_get_current");
+
+	result = acpi_pci_link_get_current(link);
+	if (result && link->irq.active) {
+ 		return_VALUE(result);
+ 	}
+
+	if (!link->irq.active) {
+		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "No active IRQ resource found\n"));
+		printk(KERN_WARNING "_CRS returns NULL! Using IRQ %d for device (%s [%s]).\n", irq, acpi_device_name(link->device), acpi_device_bid(link->device));
+		link->irq.active = irq;
+	}
+	
+	return 0;
+}
 
 static int
 acpi_pci_link_set (
@@ -290,7 +311,8 @@
 	struct acpi_buffer	buffer = {sizeof(resource)+1, &resource};
 	int			i = 0;
 	int			valid = 0;
-
+	int			resource_type = 0;
+   
 	ACPI_FUNCTION_TRACE("acpi_pci_link_set");
 
 	if (!link || !irq)
@@ -313,12 +335,23 @@
 		}
 	}
 
+	/* If IRQ<=15, first try with a "normal" IRQ descriptor. If that fails, try with
+	 * an extended one */
+	if (irq <= 15) {
+		resource_type = ACPI_RSTYPE_IRQ;
+	} else {
+		resource_type = ACPI_RSTYPE_EXT_IRQ;
+	}
+
+retry_programming:
+   
 	memset(&resource, 0, sizeof(resource));
 
 	/* NOTE: PCI interrupts are always level / active_low / shared. But not all
 	   interrupts > 15 are PCI interrupts. Rely on the ACPI IRQ definition for 
 	   parameters */
-	if (irq <= 15) {
+	switch(resource_type) {
+	case ACPI_RSTYPE_IRQ:
 		resource.res.id = ACPI_RSTYPE_IRQ;
 		resource.res.length = sizeof(struct acpi_resource);
 		resource.res.data.irq.edge_level = link->irq.edge_level;
@@ -326,8 +359,9 @@
 		resource.res.data.irq.shared_exclusive = ACPI_SHARED;
 		resource.res.data.irq.number_of_interrupts = 1;
 		resource.res.data.irq.interrupts[0] = irq;
-	}
-	else {
+		break;
+	   
+	case ACPI_RSTYPE_EXT_IRQ:
 		resource.res.id = ACPI_RSTYPE_EXT_IRQ;
 		resource.res.length = sizeof(struct acpi_resource);
 		resource.res.data.extended_irq.producer_consumer = ACPI_CONSUMER;
@@ -337,11 +371,22 @@
 		resource.res.data.extended_irq.number_of_interrupts = 1;
 		resource.res.data.extended_irq.interrupts[0] = irq;
 		/* ignore resource_source, it's optional */
+		break;
 	}
 	resource.end.id = ACPI_RSTYPE_END_TAG;
 
 	/* Attempt to set the resource */
 	status = acpi_set_current_resources(link->handle, &buffer);
+   
+
+	/* if we failed and IRQ <= 15, try again with an extended descriptor */
+	if (ACPI_FAILURE(status) && (resource_type == ACPI_RSTYPE_IRQ)) {
+                resource_type = ACPI_RSTYPE_EXT_IRQ;
+                printk(PREFIX "Retrying with extended IRQ descriptor\n");
+                goto retry_programming;
+	}
+  
+	/* check for total failure */
 	if (ACPI_FAILURE(status)) {
 		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _SRS\n"));
 		return_VALUE(-ENODEV);
@@ -359,7 +404,7 @@
 	}
 
 	/* Make sure the active IRQ is the one we requested. */
-	result = acpi_pci_link_get_current(link);
+	result = acpi_pci_link_try_get_current(link, irq);
 	if (result) {
 		return_VALUE(result);
 	}
@@ -514,10 +559,9 @@
 		return_VALUE(0);
 	}
 
-	if (acpi_pci_link_allocate(link)) {
-		return -ENODEV;
-	}
-	   
+	if (acpi_pci_link_allocate(link))
+		return_VALUE(0);
+
 	if (!link->irq.active) {
 		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Link disabled\n"));
 		return_VALUE(0);
@@ -573,10 +617,6 @@
 		else
 			printk(" %d", link->irq.possible[i]);
 	}
-	if (!link->irq.active)
-		printk(", disabled");
-	else if (!found)
-		printk(", enabled at IRQ %d", link->irq.active);
 	printk(")\n");
 
 	/* TBD: Acquire/release lock */
diff -urN linux-2.4.23-pre4/drivers/acpi/tables.c linux-2.4.23-pre5/drivers/acpi/tables.c
--- linux-2.4.23-pre4/drivers/acpi/tables.c	2003-08-25 04:44:41.000000000 -0700
+++ linux-2.4.23-pre5/drivers/acpi/tables.c	2003-09-21 13:22:29.000000000 -0700
@@ -69,7 +69,8 @@
 
 static unsigned long		sdt_pa;		/* Physical Address */
 static unsigned long		sdt_count;	/* Table count */
-static struct acpi_table_sdt	*sdt_entry;
+
+static struct acpi_table_sdt	sdt_entry[ACPI_MAX_TABLES];
 
 void
 acpi_table_print (
@@ -418,12 +419,6 @@
 			sdt_count = ACPI_MAX_TABLES;
 		}
 
-		sdt_entry = alloc_bootmem(sdt_count * sizeof(struct acpi_table_sdt));
-		if (!sdt_entry) {
-			printk(KERN_ERR "ACPI: Could not allocate mem for SDT entries!\n");
-			return -ENOMEM;
-		}
-
 		for (i = 0; i < sdt_count; i++)
 			sdt_entry[i].pa = (unsigned long) mapped_xsdt->entry[i];
 	}
@@ -470,12 +465,6 @@
 			sdt_count = ACPI_MAX_TABLES;
 		}
 
-		sdt_entry = alloc_bootmem(sdt_count * sizeof(struct acpi_table_sdt));
-		if (!sdt_entry) {
-			printk(KERN_ERR "ACPI: Could not allocate mem for SDT entries!\n");
-			return -ENOMEM;
-		}
-
 		for (i = 0; i < sdt_count; i++)
 			sdt_entry[i].pa = (unsigned long) mapped_rsdt->entry[i];
 	}
diff -urN linux-2.4.23-pre4/drivers/char/Config.in linux-2.4.23-pre5/drivers/char/Config.in
--- linux-2.4.23-pre4/drivers/char/Config.in	2003-09-21 13:22:26.000000000 -0700
+++ linux-2.4.23-pre5/drivers/char/Config.in	2003-09-21 13:22:30.000000000 -0700
@@ -164,7 +164,7 @@
    dep_tristate 'Texas Instruments parallel link cable support' CONFIG_TIPAR $CONFIG_PARPORT
 fi
 
-if [ "$CONFIG_PPC64" ] ; then 
+if [ "$CONFIG_PPC64" = "y" ] ; then 
    bool 'pSeries Hypervisor Virtual Console support' CONFIG_HVC_CONSOLE
 fi
 if [ "$CONFIG_ALL_PPC" = "y" ]; then
@@ -327,6 +327,7 @@
       bool '  NVIDIA chipset support' CONFIG_AGP_NVIDIA
    fi
    if [ "$CONFIG_IA64" = "y" ]; then
+      bool '  Intel 460GX support' CONFIG_AGP_I460
       bool '  HP ZX1 AGP support' CONFIG_AGP_HP_ZX1
    fi
    bool '  ATI IGP chipset support' CONFIG_AGP_ATI
diff -urN linux-2.4.23-pre4/drivers/char/agp/agp.h linux-2.4.23-pre5/drivers/char/agp/agp.h
--- linux-2.4.23-pre4/drivers/char/agp/agp.h	2003-09-21 13:22:26.000000000 -0700
+++ linux-2.4.23-pre5/drivers/char/agp/agp.h	2003-09-21 13:22:30.000000000 -0700
@@ -256,6 +256,9 @@
 #ifndef PCI_DEVICE_ID_INTEL_82443GX_1
 #define PCI_DEVICE_ID_INTEL_82443GX_1   0x71a1
 #endif
+#ifndef PCI_DEVICE_ID_INTEL_460GX
+#define PCI_DEVICE_ID_INTEL_460GX       0x84ea
+#endif
 #ifndef PCI_DEVICE_ID_AMD_IRONGATE_0
 #define PCI_DEVICE_ID_AMD_IRONGATE_0    0x7006
 #endif
@@ -331,6 +334,14 @@
 #define INTEL_NBXCFG    0x50
 #define INTEL_ERRSTS    0x91
 
+/* Intel 460GX Registers */
+#define INTEL_I460_APBASE		0x10
+#define INTEL_I460_BAPBASE		0x98
+#define INTEL_I460_GXBCTL		0xa0
+#define INTEL_I460_AGPSIZ		0xa2
+#define INTEL_I460_ATTBASE		0xfe200000
+#define INTEL_I460_GATT_VALID		(1UL << 24)
+#define INTEL_I460_GATT_COHERENT	(1UL << 25)
 /* Intel 855GM/852GM registers */
 #define I855_GMCH_CTRL             0x52
 #define I855_GMCH_ENABLED          0x4
@@ -500,14 +511,16 @@
 #define NVIDIA_3_APBASE     0x50
 #define NVIDIA_3_APLIMIT    0x54
 
-/* HP ZX1 SBA registers */
-#define HP_ZX1_CTRL		0x200
+/* 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
-#define HP_ZX1_CACHE_FLUSH	0x428
+
+/* HP ZX1 LBA registers */
+#define HP_ZX1_AGP_STATUS	0x64
+#define HP_ZX1_AGP_COMMAND	0x68
 
 /* ATI register */
 #define ATI_APBASE                  0x10
diff -urN linux-2.4.23-pre4/drivers/char/agp/agpgart_be.c linux-2.4.23-pre5/drivers/char/agp/agpgart_be.c
--- linux-2.4.23-pre4/drivers/char/agp/agpgart_be.c	2003-09-21 13:22:26.000000000 -0700
+++ linux-2.4.23-pre5/drivers/char/agp/agpgart_be.c	2003-09-21 13:22:30.000000000 -0700
@@ -1427,9 +1427,605 @@
 
 #endif /* CONFIG_AGP_I810 */
  
- #ifdef CONFIG_AGP_INTEL
+#ifdef CONFIG_AGP_I460
 
-#endif /* CONFIG_AGP_I810 */
+/* BIOS configures the chipset so that one of two apbase registers are used */
+static u8 intel_i460_dynamic_apbase = 0x10;
+
+/* 460 supports multiple GART page sizes, so GART pageshift is dynamic */ 
+static u8 intel_i460_pageshift = 12;
+static u32 intel_i460_pagesize;
+
+/* Keep track of which is larger, chipset or kernel page size. */
+static u32 intel_i460_cpk = 1;
+
+/* Structure for tracking partial use of 4MB GART pages */
+static u32 **i460_pg_detail = NULL;
+static u32 *i460_pg_count = NULL;
+
+#define I460_CPAGES_PER_KPAGE (PAGE_SIZE >> intel_i460_pageshift)
+#define I460_KPAGES_PER_CPAGE ((1 << intel_i460_pageshift) >> PAGE_SHIFT)
+
+#define I460_SRAM_IO_DISABLE		(1 << 4)
+#define I460_BAPBASE_ENABLE		(1 << 3)
+#define I460_AGPSIZ_MASK		0x7
+#define I460_4M_PS			(1 << 1)
+
+#define log2(x)				ffz(~(x))
+
+static gatt_mask intel_i460_masks[] =
+{
+	{ INTEL_I460_GATT_VALID | INTEL_I460_GATT_COHERENT, 0 }
+};
+
+static unsigned long intel_i460_mask_memory(unsigned long addr, int type) 
+{
+	/* Make sure the returned address is a valid GATT entry */
+	return (agp_bridge.masks[0].mask | (((addr & 
+		     ~((1 << intel_i460_pageshift) - 1)) & 0xffffff000) >> 12));
+}
+
+static unsigned long intel_i460_unmask_memory(unsigned long addr)
+{
+	/* Turn a GATT entry into a physical address */
+	return ((addr & 0xffffff) << 12);
+}
+
+static int intel_i460_fetch_size(void)
+{
+	int i;
+	u8 temp;
+	aper_size_info_8 *values;
+
+	/* Determine the GART page size */
+	pci_read_config_byte(agp_bridge.dev, INTEL_I460_GXBCTL, &temp);
+	intel_i460_pageshift = (temp & I460_4M_PS) ? 22 : 12;
+	intel_i460_pagesize = 1UL << intel_i460_pageshift;
+
+	values = A_SIZE_8(agp_bridge.aperture_sizes);
+
+	pci_read_config_byte(agp_bridge.dev, INTEL_I460_AGPSIZ, &temp);
+
+	/* Exit now if the IO drivers for the GART SRAMS are turned off */
+	if (temp & I460_SRAM_IO_DISABLE) {
+		printk(KERN_WARNING PFX "GART SRAMS disabled on 460GX chipset\n");
+		printk(KERN_WARNING PFX "AGPGART operation not possible\n");
+		return 0;
+	}
+
+	/* Make sure we don't try to create an 2 ^ 23 entry GATT */
+	if ((intel_i460_pageshift == 0) && ((temp & I460_AGPSIZ_MASK) == 4)) {
+		printk(KERN_WARNING PFX "We can't have a 32GB aperture with 4KB"
+			" GART pages\n");
+		return 0;
+	}
+
+	/* Determine the proper APBASE register */
+	if (temp & I460_BAPBASE_ENABLE)
+		intel_i460_dynamic_apbase = INTEL_I460_BAPBASE;
+	else
+		intel_i460_dynamic_apbase = INTEL_I460_APBASE;
+
+	for (i = 0; i < agp_bridge.num_aperture_sizes; i++) {
+
+		/*
+		 * Dynamically calculate the proper num_entries and page_order 
+		 * values for the define aperture sizes. Take care not to
+		 * shift off the end of values[i].size.
+		 */	
+		values[i].num_entries = (values[i].size << 8) >>
+						(intel_i460_pageshift - 12);
+		values[i].page_order = log2((sizeof(u32)*values[i].num_entries)
+						>> PAGE_SHIFT);
+	}
+
+	for (i = 0; i < agp_bridge.num_aperture_sizes; i++) {
+		/* Neglect control bits when matching up size_value */
+		if ((temp & I460_AGPSIZ_MASK) == values[i].size_value) {
+			agp_bridge.previous_size =
+			    agp_bridge.current_size = (void *) (values + i);
+			agp_bridge.aperture_size_idx = i;
+			return values[i].size;
+		}
+	}
+
+	return 0;
+}
+
+/* There isn't anything to do here since 460 has no GART TLB. */ 
+static void intel_i460_tlb_flush(agp_memory * mem)
+{
+	return;
+}
+
+/*
+ * This utility function is needed to prevent corruption of the control bits
+ * which are stored along with the aperture size in 460's AGPSIZ register
+ */
+static void intel_i460_write_agpsiz(u8 size_value)
+{
+	u8 temp;
+
+	pci_read_config_byte(agp_bridge.dev, INTEL_I460_AGPSIZ, &temp);
+	pci_write_config_byte(agp_bridge.dev, INTEL_I460_AGPSIZ,
+		((temp & ~I460_AGPSIZ_MASK) | size_value));
+}
+
+static void intel_i460_cleanup(void)
+{
+	aper_size_info_8 *previous_size;
+
+	previous_size = A_SIZE_8(agp_bridge.previous_size);
+	intel_i460_write_agpsiz(previous_size->size_value);
+
+	if (intel_i460_cpk == 0) {
+		vfree(i460_pg_detail);
+		vfree(i460_pg_count);
+	}
+}
+
+
+/* Control bits for Out-Of-GART coherency and Burst Write Combining */
+#define I460_GXBCTL_OOG		(1UL << 0)
+#define I460_GXBCTL_BWC		(1UL << 2)
+
+static int intel_i460_configure(void)
+{
+	union {
+		u32 small[2];
+		u64 large;
+	} temp;
+	u8 scratch;
+	int i;
+
+	aper_size_info_8 *current_size;
+
+	temp.large = 0;
+
+	current_size = A_SIZE_8(agp_bridge.current_size);
+	intel_i460_write_agpsiz(current_size->size_value);	
+
+	/*
+	 * Do the necessary rigmarole to read all eight bytes of APBASE.
+	 * This has to be done since the AGP aperture can be above 4GB on
+	 * 460 based systems.
+	 */
+	pci_read_config_dword(agp_bridge.dev, intel_i460_dynamic_apbase, 
+		&(temp.small[0]));
+	pci_read_config_dword(agp_bridge.dev, intel_i460_dynamic_apbase + 4,
+		&(temp.small[1]));
+
+	/* Clear BAR control bits */
+	agp_bridge.gart_bus_addr = temp.large & ~((1UL << 3) - 1); 
+
+	pci_read_config_byte(agp_bridge.dev, INTEL_I460_GXBCTL, &scratch);
+	pci_write_config_byte(agp_bridge.dev, INTEL_I460_GXBCTL,
+			  (scratch & 0x02) | I460_GXBCTL_OOG | I460_GXBCTL_BWC);
+
+	/* 
+	 * Initialize partial allocation trackers if a GART page is bigger than
+	 * a kernel page.
+	 */
+	if (I460_CPAGES_PER_KPAGE >= 1) {
+		intel_i460_cpk = 1;
+	} else {
+		intel_i460_cpk = 0;
+
+		i460_pg_detail = (void *) vmalloc(sizeof(*i460_pg_detail) *
+					current_size->num_entries);
+		i460_pg_count = (void *) vmalloc(sizeof(*i460_pg_count) *
+					current_size->num_entries);
+	
+		for (i = 0; i < current_size->num_entries; i++) {
+			i460_pg_count[i] = 0;
+			i460_pg_detail[i] = NULL;
+		}
+	}
+
+	return 0;
+}
+
+static int intel_i460_create_gatt_table(void) {
+
+	char *table;
+	int i;
+	int page_order;
+	int num_entries;
+	void *temp;
+	unsigned int read_back;
+
+	/*
+	 * Load up the fixed address of the GART SRAMS which hold our
+	 * GATT table.
+	 */
+	table = (char *) __va(INTEL_I460_ATTBASE);
+
+	temp = agp_bridge.current_size;
+	page_order = A_SIZE_8(temp)->page_order;
+	num_entries = A_SIZE_8(temp)->num_entries;
+
+	agp_bridge.gatt_table_real = (u32 *) table;
+	agp_bridge.gatt_table = ioremap_nocache(virt_to_phys(table),
+		 			     (PAGE_SIZE * (1 << page_order)));
+	agp_bridge.gatt_bus_addr = virt_to_phys(agp_bridge.gatt_table_real);
+
+	for (i = 0; i < num_entries; i++) {
+		agp_bridge.gatt_table[i] = 0;
+	}
+
+	/* 
+	 * The 460 spec says we have to read the last location written to 
+	 * make sure that all writes have taken effect
+	 */
+	read_back = agp_bridge.gatt_table[i - 1];
+
+	return 0;
+}
+
+static int intel_i460_free_gatt_table(void)
+{
+	int num_entries;
+	int i;
+	void *temp;
+	unsigned int read_back;
+
+	temp = agp_bridge.current_size;
+
+	num_entries = A_SIZE_8(temp)->num_entries;
+
+	for (i = 0; i < num_entries; i++) {
+		agp_bridge.gatt_table[i] = 0;
+	}
+	
+	/* 
+	 * The 460 spec says we have to read the last location written to 
+	 * make sure that all writes have taken effect
+	 */
+	read_back = agp_bridge.gatt_table[i - 1];
+
+	iounmap(agp_bridge.gatt_table);
+
+	return 0;
+}
+
+/* These functions are called when PAGE_SIZE exceeds the GART page size */	
+
+static int intel_i460_insert_memory_cpk(agp_memory * mem,
+				     off_t pg_start, int type)
+{
+	int i, j, k, num_entries;
+	void *temp;
+	unsigned long paddr;
+	unsigned int read_back;
+
+	/* 
+	 * The rest of the kernel will compute page offsets in terms of
+	 * PAGE_SIZE.
+	 */
+	pg_start = I460_CPAGES_PER_KPAGE * pg_start;
+
+	temp = agp_bridge.current_size;
+	num_entries = A_SIZE_8(temp)->num_entries;
+
+	if ((pg_start + I460_CPAGES_PER_KPAGE * mem->page_count) > num_entries) {
+		printk(KERN_WARNING PFX "Looks like we're out of AGP memory\n");
+		return -EINVAL;
+	}
+
+	j = pg_start;
+	while (j < (pg_start + I460_CPAGES_PER_KPAGE * mem->page_count)) {
+		if (!PGE_EMPTY(agp_bridge.gatt_table[j])) {
+			return -EBUSY;
+		}
+		j++;
+	}
+
+	for (i = 0, j = pg_start; i < mem->page_count; i++) {
+
+		paddr = mem->memory[i];
+
+		for (k = 0; k < I460_CPAGES_PER_KPAGE; k++, j++, paddr += intel_i460_pagesize)
+			agp_bridge.gatt_table[j] = (unsigned int)
+			    agp_bridge.mask_memory(paddr, mem->type);
+	}
+
+	/* 
+	 * The 460 spec says we have to read the last location written to 
+	 * make sure that all writes have taken effect
+	 */
+	read_back = agp_bridge.gatt_table[j - 1];
+
+	return 0;
+}
+
+static int intel_i460_remove_memory_cpk(agp_memory * mem, off_t pg_start,
+				     int type)
+{
+	int i;
+	unsigned int read_back;
+
+	pg_start = I460_CPAGES_PER_KPAGE * pg_start;
+
+	for (i = pg_start; i < (pg_start + I460_CPAGES_PER_KPAGE * 
+							mem->page_count); i++) 
+		agp_bridge.gatt_table[i] = 0;
+
+	/* 
+	 * The 460 spec says we have to read the last location written to 
+	 * make sure that all writes have taken effect
+	 */
+	read_back = agp_bridge.gatt_table[i - 1];
+
+	return 0;
+}
+
+/*
+ * These functions are called when the GART page size exceeds PAGE_SIZE.
+ *
+ * This situation is interesting since AGP memory allocations that are
+ * smaller than a single GART page are possible.  The structures i460_pg_count
+ * and i460_pg_detail track partial allocation of the large GART pages to
+ * work around this issue.
+ *
+ * i460_pg_count[pg_num] tracks the number of kernel pages in use within
+ * GART page pg_num.  i460_pg_detail[pg_num] is an array containing a
+ * psuedo-GART entry for each of the aforementioned kernel pages.  The whole
+ * of i460_pg_detail is equivalent to a giant GATT with page size equal to
+ * that of the kernel.
+ */	
+
+static void *intel_i460_alloc_large_page(int pg_num)
+{
+	int i;
+	void *bp, *bp_end;
+	struct page *page;
+
+	i460_pg_detail[pg_num] = (void *) vmalloc(sizeof(u32) * 
+							I460_KPAGES_PER_CPAGE);
+	if (i460_pg_detail[pg_num] == NULL) {
+		printk(KERN_WARNING PFX "Out of memory, we're in trouble...\n");
+		return NULL;
+	}
+
+	for (i = 0; i < I460_KPAGES_PER_CPAGE; i++)
+		i460_pg_detail[pg_num][i] = 0;
+
+	bp = (void *) __get_free_pages(GFP_KERNEL, 
+					intel_i460_pageshift - PAGE_SHIFT);
+	if (bp == NULL) {
+		printk(KERN_WARNING PFX "Couldn't alloc 4M GART page...\n");
+		return NULL;
+	}
+
+	bp_end = bp + ((PAGE_SIZE * 
+			    (1 << (intel_i460_pageshift - PAGE_SHIFT))) - 1);
+
+	for (page = virt_to_page(bp); page <= virt_to_page(bp_end); page++) {
+		atomic_inc(&page->count);
+		set_bit(PG_locked, &page->flags);
+		atomic_inc(&agp_bridge.current_memory_agp);
+	}
+
+	return bp;		
+}
+
+static void intel_i460_free_large_page(int pg_num, unsigned long addr)
+{
+	struct page *page;
+	void *bp, *bp_end;
+
+	bp = (void *) __va(addr);
+	bp_end = bp + (PAGE_SIZE * 
+			(1 << (intel_i460_pageshift - PAGE_SHIFT)));
+
+	vfree(i460_pg_detail[pg_num]);
+	i460_pg_detail[pg_num] = NULL;
+
+	for (page = virt_to_page(bp); page < virt_to_page(bp_end); page++) {
+		put_page(page);
+		UnlockPage(page);
+		atomic_dec(&agp_bridge.current_memory_agp);
+	}
+
+	free_pages((unsigned long) bp, intel_i460_pageshift - PAGE_SHIFT);
+}
+	
+static int intel_i460_insert_memory_kpc(agp_memory * mem,
+				     off_t pg_start, int type)
+{
+	int i, pg, start_pg, end_pg, start_offset, end_offset, idx;
+	int num_entries;	
+	void *temp;
+	unsigned int read_back;
+	unsigned long paddr;
+
+	temp = agp_bridge.current_size;
+	num_entries = A_SIZE_8(temp)->num_entries;
+
+	/* Figure out what pg_start means in terms of our large GART pages */
+	start_pg 	= pg_start / I460_KPAGES_PER_CPAGE;
+	start_offset 	= pg_start % I460_KPAGES_PER_CPAGE;
+	end_pg 		= (pg_start + mem->page_count - 1) / 
+							I460_KPAGES_PER_CPAGE;
+	end_offset 	= (pg_start + mem->page_count - 1) % 
+							I460_KPAGES_PER_CPAGE;
+
+	if (end_pg > num_entries) {
+		printk(KERN_WARNING PFX "Looks like we're out of AGP memory\n");
+		return -EINVAL;
+	}
+
+	/* Check if the requested region of the aperture is free */
+	for (pg = start_pg; pg <= end_pg; pg++) {
+		/* Allocate new GART pages if necessary */
+		if (i460_pg_detail[pg] == NULL) {
+			temp = intel_i460_alloc_large_page(pg);
+			if (temp == NULL)
+				return -ENOMEM;
+			agp_bridge.gatt_table[pg] = agp_bridge.mask_memory(
+			    			       (unsigned long) temp, 0);
+			read_back = agp_bridge.gatt_table[pg];
+		}
+
+		for (idx = ((pg == start_pg) ? start_offset : 0);
+		     idx < ((pg == end_pg) ? (end_offset + 1) 
+				       : I460_KPAGES_PER_CPAGE);
+		     idx++) {
+			if(i460_pg_detail[pg][idx] != 0)
+				return -EBUSY;
+		}
+	}
+		
+	for (pg = start_pg, i = 0; pg <= end_pg; pg++) {
+		paddr = intel_i460_unmask_memory(agp_bridge.gatt_table[pg]);
+		for (idx = ((pg == start_pg) ? start_offset : 0);
+		     idx < ((pg == end_pg) ? (end_offset + 1)
+				       : I460_KPAGES_PER_CPAGE);
+		     idx++, i++) {
+			mem->memory[i] = paddr + (idx * PAGE_SIZE);
+			i460_pg_detail[pg][idx] =
+			    agp_bridge.mask_memory(mem->memory[i], mem->type);
+			    
+			i460_pg_count[pg]++;
+		}
+	}
+
+	return 0;
+}
+	
+static int intel_i460_remove_memory_kpc(agp_memory * mem,
+				     off_t pg_start, int type)
+{
+	int i, pg, start_pg, end_pg, start_offset, end_offset, idx;
+	int num_entries;
+	void *temp;
+	unsigned int read_back;
+	unsigned long paddr;
+
+	temp = agp_bridge.current_size;
+	num_entries = A_SIZE_8(temp)->num_entries;
+
+	/* Figure out what pg_start means in terms of our large GART pages */
+	start_pg 	= pg_start / I460_KPAGES_PER_CPAGE;
+	start_offset 	= pg_start % I460_KPAGES_PER_CPAGE;
+	end_pg 		= (pg_start + mem->page_count - 1) / 
+						I460_KPAGES_PER_CPAGE;
+	end_offset 	= (pg_start + mem->page_count - 1) % 
+						I460_KPAGES_PER_CPAGE;
+
+	for (i = 0, pg = start_pg; pg <= end_pg; pg++) {
+		for (idx = ((pg == start_pg) ? start_offset : 0);
+		     idx < ((pg == end_pg) ? (end_offset + 1)
+				       : I460_KPAGES_PER_CPAGE);
+		     idx++, i++) {
+			mem->memory[i] = 0;
+			i460_pg_detail[pg][idx] = 0;
+			i460_pg_count[pg]--;
+		}
+
+		/* Free GART pages if they are unused */
+		if (i460_pg_count[pg] == 0) {
+			paddr = intel_i460_unmask_memory(agp_bridge.gatt_table[pg]);
+			agp_bridge.gatt_table[pg] = agp_bridge.scratch_page;
+			read_back = agp_bridge.gatt_table[pg];
+
+			intel_i460_free_large_page(pg, paddr);
+		}
+	}
+		
+	return 0;
+}
+
+/* Dummy routines to call the approriate {cpk,kpc} function */
+
+static int intel_i460_insert_memory(agp_memory * mem,
+				     off_t pg_start, int type)
+{
+	if (intel_i460_cpk)
+		return intel_i460_insert_memory_cpk(mem, pg_start, type);
+	else
+		return intel_i460_insert_memory_kpc(mem, pg_start, type);
+}
+
+static int intel_i460_remove_memory(agp_memory * mem,
+				     off_t pg_start, int type)
+{
+	if (intel_i460_cpk)
+		return intel_i460_remove_memory_cpk(mem, pg_start, type);
+	else
+		return intel_i460_remove_memory_kpc(mem, pg_start, type);
+}
+
+/*
+ * If the kernel page size is smaller that the chipset page size, we don't
+ * want to allocate memory until we know where it is to be bound in the
+ * aperture (a multi-kernel-page alloc might fit inside of an already
+ * allocated GART page).  Consequently, don't allocate or free anything
+ * if i460_cpk (meaning chipset pages per kernel page) isn't set.
+ *
+ * Let's just hope nobody counts on the allocated AGP memory being there
+ * before bind time (I don't think current drivers do)...
+ */ 
+static unsigned long intel_i460_alloc_page(void)
+{
+	if (intel_i460_cpk)
+		return agp_generic_alloc_page();
+
+	/* Returning NULL would cause problems */
+	return ((unsigned long) ~0UL);
+}
+
+static void intel_i460_destroy_page(unsigned long page)
+{
+	if (intel_i460_cpk)
+		agp_generic_destroy_page(page);
+}
+
+static aper_size_info_8 intel_i460_sizes[3] =
+{
+	/* 
+	 * The 32GB aperture is only available with a 4M GART page size.
+	 * Due to the dynamic GART page size, we can't figure out page_order
+	 * or num_entries until runtime.
+	 */
+	{32768, 0, 0, 4},
+	{1024, 0, 0, 2},
+	{256, 0, 0, 1}
+};
+
+static int __init intel_i460_setup(struct pci_dev *pdev)
+{
+        agp_bridge.masks = intel_i460_masks;
+        agp_bridge.aperture_sizes = (void *) intel_i460_sizes;
+        agp_bridge.size_type = U8_APER_SIZE;
+        agp_bridge.num_aperture_sizes = 3;
+        agp_bridge.dev_private_data = NULL;
+        agp_bridge.needs_scratch_page = FALSE;
+        agp_bridge.configure = intel_i460_configure;
+        agp_bridge.fetch_size = intel_i460_fetch_size;
+        agp_bridge.cleanup = intel_i460_cleanup;
+        agp_bridge.tlb_flush = intel_i460_tlb_flush;
+        agp_bridge.mask_memory = intel_i460_mask_memory;
+        agp_bridge.agp_enable = agp_generic_agp_enable;
+        agp_bridge.cache_flush = global_cache_flush;
+        agp_bridge.create_gatt_table = intel_i460_create_gatt_table;
+        agp_bridge.free_gatt_table = intel_i460_free_gatt_table;
+        agp_bridge.insert_memory = intel_i460_insert_memory;
+        agp_bridge.remove_memory = intel_i460_remove_memory;
+        agp_bridge.alloc_by_type = agp_generic_alloc_by_type;
+        agp_bridge.free_by_type = agp_generic_free_by_type;
+        agp_bridge.agp_alloc_page = intel_i460_alloc_page;
+        agp_bridge.agp_destroy_page = intel_i460_destroy_page;
+        agp_bridge.suspend = agp_generic_suspend;
+        agp_bridge.resume = agp_generic_resume;
+        agp_bridge.cant_use_aperture = 1;
+
+        return 0;
+
+        (void) pdev; /* unused */
+}
+
+#endif		/* CONFIG_AGP_I460 */
 
 #ifdef CONFIG_AGP_INTEL
 
@@ -4442,6 +5038,8 @@
 #define log2(x)		ffz(~(x))
 #endif
 
+#define HP_ZX1_IOC_OFFSET	0x1000  /* ACPI reports SBA, we want IOC */
+
 #define HP_ZX1_IOVA_BASE	GB(1UL)
 #define HP_ZX1_IOVA_SIZE	GB(1UL)
 #define HP_ZX1_GART_SIZE	(HP_ZX1_IOVA_SIZE / 2)
@@ -4451,19 +5049,16 @@
 #define HP_ZX1_IOVA_TO_PDIR(va)	((va - hp_private.iova_base) >> \
 					hp_private.io_tlb_shift)
 
+static int hp_zx1_gart_found;
+
 static aper_size_info_fixed hp_zx1_sizes[] =
 {
 	{0, 0, 0},		/* filled in by hp_zx1_fetch_size() */
 };
 
-static gatt_mask hp_zx1_masks[] =
-{
-	{HP_ZX1_PDIR_VALID_BIT, 0}
-};
-
 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;
@@ -4490,7 +5085,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;
@@ -4506,13 +5101,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) {
@@ -4526,7 +5121,7 @@
 	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;
 
@@ -4561,44 +5156,21 @@
 	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();
 }
@@ -4618,19 +5190,17 @@
 	struct _hp_private *hp = &hp_private;
 
 	agp_bridge.gart_bus_addr = hp->gart_base;
-	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);
+	agp_bridge.mode = INREG32(hp->lba_regs, HP_ZX1_AGP_STATUS);
 
 	if (hp->io_pdir_owner) {
-		OUTREG64(hp->registers, HP_ZX1_PDIR_BASE,
+		OUTREG64(hp->ioc_regs, 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,
+		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->registers, HP_ZX1_PCOM);
+		INREG64(hp->ioc_regs, HP_ZX1_PCOM);
 	}
 
 	return 0;
@@ -4641,17 +5211,18 @@
 	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);
+	iounmap((void *) hp->lba_regs);
 }
 
 static void hp_zx1_tlbflush(agp_memory * mem)
 {
 	struct _hp_private *hp = &hp_private;
 
-	OUTREG64(hp->registers, HP_ZX1_PCOM, 
+	OUTREG64(hp->ioc_regs, HP_ZX1_PCOM, 
 		hp->gart_base | log2(hp->gart_size));
-	INREG64(hp->registers, HP_ZX1_PCOM);
+	INREG64(hp->ioc_regs, HP_ZX1_PCOM);
 }
 
 static int hp_zx1_create_gatt_table(void)
@@ -4718,11 +5289,6 @@
 		j++;
 	}
 
-	if (mem->is_flushed == FALSE) {
-		CACHE_FLUSH();
-		mem->is_flushed = TRUE;
-	}
-
 	for (i = 0, j = io_pg_start; i < mem->page_count; i++) {
 		unsigned long paddr;
 
@@ -4762,14 +5328,23 @@
 	return HP_ZX1_PDIR_VALID_BIT | addr;
 }
 
-static unsigned long hp_zx1_unmask_memory(unsigned long addr)
+static void hp_zx1_agp_enable(u32 mode)
 {
-	return addr & ~(HP_ZX1_PDIR_VALID_BIT);
+	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);
 }
 
-static int __init hp_zx1_setup (struct pci_dev *pdev)
+static int __init hp_zx1_setup(u64 ioc_hpa, u64 lba_hpa)
 {
-	agp_bridge.masks = hp_zx1_masks;
 	agp_bridge.dev_private_data = NULL;
 	agp_bridge.size_type = FIXED_APER_SIZE;
 	agp_bridge.needs_scratch_page = FALSE;
@@ -4778,8 +5353,7 @@
 	agp_bridge.cleanup = hp_zx1_cleanup;
 	agp_bridge.tlb_flush = hp_zx1_tlbflush;
 	agp_bridge.mask_memory = hp_zx1_mask_memory;
-	agp_bridge.unmask_memory = hp_zx1_unmask_memory;
-	agp_bridge.agp_enable = agp_generic_agp_enable;
+	agp_bridge.agp_enable = hp_zx1_agp_enable;
 	agp_bridge.cache_flush = global_cache_flush;
 	agp_bridge.create_gatt_table = hp_zx1_create_gatt_table;
 	agp_bridge.free_gatt_table = hp_zx1_free_gatt_table;
@@ -4790,10 +5364,76 @@
 	agp_bridge.agp_alloc_page = agp_generic_alloc_page;
 	agp_bridge.agp_destroy_page = agp_generic_destroy_page;
 	agp_bridge.cant_use_aperture = 1;
+	agp_bridge.type = HP_ZX1;
 
-	return hp_zx1_ioc_init();
+	fake_bridge_dev.vendor = PCI_VENDOR_ID_HP;
+	fake_bridge_dev.device = PCI_DEVICE_ID_HP_PCIX_LBA;
 
-	(void) pdev; /* unused */
+	return hp_zx1_ioc_init(ioc_hpa, lba_hpa);
+}
+
+static acpi_status __init hp_zx1_gart_probe(acpi_handle obj, u32 depth, void *context, void **ret)
+{
+	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 = acpi_hp_csr_space(obj, &lba_hpa, &length);
+	if (ACPI_FAILURE(status))
+		return AE_OK;
+
+	/* 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 = acpi_hp_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 AE_OK;
+				}
+			}
+		}
+
+		status = acpi_get_parent(handle, &parent);
+		handle = parent;
+	} while (ACPI_SUCCESS(status));
+
+	if (hp_zx1_setup(sba_hpa + HP_ZX1_IOC_OFFSET, lba_hpa))
+		return AE_OK;
+
+	printk(KERN_INFO PFX "Detected HP ZX1 %s AGP chipset (ioc=%lx, lba=%lx)\n",
+		(char *) context, sba_hpa + HP_ZX1_IOC_OFFSET, lba_hpa);
+
+	hp_zx1_gart_found = 1;
+	return AE_CTRL_TERMINATE;
+}
+
+static int __init
+hp_zx1_gart_init(void)
+{
+	acpi_get_devices("HWP0003", hp_zx1_gart_probe, "HWP0003", NULL);
+	if (hp_zx1_gart_found)
+		return 0;
+
+	acpi_get_devices("HWP0007", hp_zx1_gart_probe, "HWP0007", NULL);
+	if (hp_zx1_gart_found)
+		return 0;
+
+	return -ENODEV;
 }
 
 #endif /* CONFIG_AGP_HP_ZX1 */
@@ -5432,6 +6072,15 @@
 
 #endif /* CONFIG_AGP_INTEL */
 
+#ifdef CONFIG_AGP_I460
+	{ PCI_DEVICE_ID_INTEL_460GX,
+		PCI_VENDOR_ID_INTEL,
+		INTEL_460GX,
+		"Intel",
+		"460GX",
+		intel_i460_setup },
+#endif
+
 #ifdef CONFIG_AGP_SIS
 	{ PCI_DEVICE_ID_SI_740,
 		PCI_VENDOR_ID_SI,
@@ -5645,15 +6294,6 @@
 		nvidia_generic_setup },
 #endif /* CONFIG_AGP_NVIDIA */
 
-#ifdef CONFIG_AGP_HP_ZX1
-	{ PCI_DEVICE_ID_HP_ZX1_LBA,
-		PCI_VENDOR_ID_HP,
-		HP_ZX1,
-		"HP",
-		"ZX1",
-		hp_zx1_setup },
-#endif
-
 #ifdef CONFIG_AGP_ATI
 	{ PCI_DEVICE_ID_ATI_RS100,
 	  PCI_VENDOR_ID_ATI,
@@ -5785,6 +6425,11 @@
 	struct pci_dev *dev = NULL;
 	u8 cap_ptr = 0x00;
 
+#ifdef CONFIG_AGP_HP_ZX1
+	if (hp_zx1_gart_init() == 0)
+		return 0;
+#endif
+
 	if ((dev = pci_find_class(PCI_CLASS_BRIDGE_HOST << 8, NULL)) == NULL)
 		return -ENODEV;
 
@@ -6058,23 +6703,6 @@
 
 #endif	/* CONFIG_AGP_SWORKS */
 
-#ifdef CONFIG_AGP_HP_ZX1
-	if (dev->vendor == PCI_VENDOR_ID_HP) {
-		do {
-			/* ZX1 LBAs can be either PCI or AGP bridges */
-			if (pci_find_capability(dev, PCI_CAP_ID_AGP)) {
-				printk(KERN_INFO PFX "Detected HP ZX1 AGP "
-				       "chipset at %s\n", dev->slot_name);
-				agp_bridge.type = HP_ZX1;
-				agp_bridge.dev = dev;
-				return hp_zx1_setup(dev);
-			}
-			dev = pci_find_class(PCI_CLASS_BRIDGE_HOST << 8, dev);
-		} while (dev);
-		return -ENODEV;
-	}
-#endif	/* CONFIG_AGP_HP_ZX1 */
-
 	/* find capndx */
 	cap_ptr = pci_find_capability(dev, PCI_CAP_ID_AGP);
 	if (cap_ptr == 0x00)
diff -urN linux-2.4.23-pre4/drivers/char/drm-4.0/agpsupport.c linux-2.4.23-pre5/drivers/char/drm-4.0/agpsupport.c
--- linux-2.4.23-pre4/drivers/char/drm-4.0/agpsupport.c	2003-09-21 13:22:27.000000000 -0700
+++ linux-2.4.23-pre5/drivers/char/drm-4.0/agpsupport.c	2003-09-21 13:22:30.000000000 -0700
@@ -264,6 +264,7 @@
 #if LINUX_VERSION_CODE >= 0x020400
 		case INTEL_I840:	head->chipset = "Intel i840";    break;
 #endif
+		case INTEL_460GX:	head->chipset = "Intel 460GX";	 break;
 
 		case VIA_GENERIC:	head->chipset = "VIA";           break;
 		case VIA_VP3:		head->chipset = "VIA VP3";       break;
@@ -300,6 +301,7 @@
 			break;
 		case SVWRKS_HE: 	head->chipset = "Serverworks HE"; break;
 		case SVWRKS_LE: 	head->chipset = "Serverworks LE"; break;
+		case HP_ZX1:		head->chipset = "HP ZX1";	break;
 
 		default:		head->chipset = "Unknown";       break;
 		}
diff -urN linux-2.4.23-pre4/drivers/ide/ide-cd.c linux-2.4.23-pre5/drivers/ide/ide-cd.c
--- linux-2.4.23-pre4/drivers/ide/ide-cd.c	2003-09-21 13:22:27.000000000 -0700
+++ linux-2.4.23-pre5/drivers/ide/ide-cd.c	2003-09-21 13:22:30.000000000 -0700
@@ -2231,7 +2231,7 @@
 	minor = (drive->select.b.unit) << PARTN_BITS;
 	dev = MKDEV(HWIF(drive)->major, minor);
 	stat = cdrom_get_last_written(dev, &toc->capacity);
-	if (stat)
+	if (stat || !toc->capacity)
 		stat = cdrom_read_capacity(drive, &toc->capacity, sense);
 	if (stat)
 		toc->capacity = 0x1fffff;
diff -urN linux-2.4.23-pre4/drivers/ide/ide-probe.c linux-2.4.23-pre5/drivers/ide/ide-probe.c
--- linux-2.4.23-pre4/drivers/ide/ide-probe.c	2003-09-21 13:22:27.000000000 -0700
+++ linux-2.4.23-pre5/drivers/ide/ide-probe.c	2003-09-21 13:22:30.000000000 -0700
@@ -879,7 +879,7 @@
 	 *  
 	 *  BenH.
 	 */
-	if (wait_hwif_ready(hwif))
+	if (ide_wait_hwif_ready(hwif))
 		printk(KERN_WARNING "%s: Wait for ready failed before probe !\n", hwif->name);
 #endif /* CONFIG_PPC */
 
diff -urN linux-2.4.23-pre4/drivers/ide/ide-tape.c linux-2.4.23-pre5/drivers/ide/ide-tape.c
--- linux-2.4.23-pre4/drivers/ide/ide-tape.c	2003-06-13 07:51:33.000000000 -0700
+++ linux-2.4.23-pre5/drivers/ide/ide-tape.c	2003-09-21 13:22:30.000000000 -0700
@@ -1,5 +1,5 @@
 /*
- * linux/drivers/ide/ide-tape.c		Version 1.17b	Dec, 2002
+ * linux/drivers/ide/ide-tape.c		Version 1.17c	Sep, 2003
  *
  * Copyright (C) 1995 - 1999 Gadi Oxman <gadio@netvision.net.il>
  *
@@ -313,6 +313,9 @@
  *			Cosmetic fixes to miscellaneous debugging output messages.
  *			Set the minimum /proc/ide/hd?/settings values for "pipeline",
  *			 "pipeline_min", and "pipeline_max" to 1.
+ * Ver 1.17c Sep 2003	Stuart Hayes <stuart_hayes@dell.com>
+ *			Initialized "feature" in idetape_issue_packet_command
+ *			 (this was causing lockups on certain systems)
  *
  * Here are some words from the first releases of hd.c, which are quoted
  * in ide.c and apply here as well:
@@ -422,7 +425,7 @@
  *		sharing a (fast) ATA-2 disk with any (slow) new ATAPI device.
  */
 
-#define IDETAPE_VERSION "1.17b-ac1"
+#define IDETAPE_VERSION "1.17c"
 
 #include <linux/config.h>
 #include <linux/module.h>
@@ -2367,6 +2370,8 @@
 	atapi_feature_t feature;
 	atapi_bcount_t bcount;
 
+	feature.all = 0;
+
 #if IDETAPE_DEBUG_BUGS
 	if (tape->pc->c[0] == IDETAPE_REQUEST_SENSE_CMD &&
 	    pc->c[0] == IDETAPE_REQUEST_SENSE_CMD) {
diff -urN linux-2.4.23-pre4/drivers/net/bonding/bond_main.c linux-2.4.23-pre5/drivers/net/bonding/bond_main.c
--- linux-2.4.23-pre4/drivers/net/bonding/bond_main.c	2003-09-21 13:22:27.000000000 -0700
+++ linux-2.4.23-pre5/drivers/net/bonding/bond_main.c	2003-09-21 13:22:31.000000000 -0700
@@ -420,6 +420,12 @@
  *	  HW address and MTU with proper unwind; Consolidate procfs code,
  *	  add CHANGENAME handler; Enhance netdev notification handling.
  *	  Version to 2.4.0.
+ *
+ * 2003/09/15 - Stephen Hemminger <shemminger at osdl dot org>,
+ *	       Amir Noam <amir.noam at intel dot com>
+ *	- Convert /proc to seq_file interface.
+ *	  Change /proc/net/bondX/info to /proc/net/bonding/bondX.
+ *	  Set version to 2.4.1.
  */
 
 #include <linux/config.h>
@@ -453,6 +459,8 @@
 #include <linux/skbuff.h>
 #include <net/sock.h>
 #include <linux/rtnetlink.h>
+#include <linux/proc_fs.h>
+#include <linux/seq_file.h>
 
 #include <linux/if_bonding.h>
 #include <linux/smp.h>
@@ -464,8 +472,8 @@
 #include "bond_3ad.h"
 #include "bond_alb.h"
 
-#define DRV_VERSION	"2.4.0"
-#define DRV_RELDATE	"August 7, 2003"
+#define DRV_VERSION	"2.4.1"
+#define DRV_RELDATE	"September 15, 2003"
 #define DRV_NAME	"bonding"
 #define DRV_DESCRIPTION	"Ethernet Channel Bonding Driver"
 
@@ -553,6 +561,9 @@
 };
 
 static LIST_HEAD(bond_dev_list);
+#ifdef CONFIG_PROC_FS
+static struct proc_dir_entry *bond_proc_dir = NULL;
+#endif
 
 MODULE_PARM(max_bonds, "i");
 MODULE_PARM_DESC(max_bonds, "Max number of bonded devices");
@@ -980,8 +991,6 @@
 		add_timer(alb_timer);
 	}
 
-	MOD_INC_USE_COUNT;
-
 	if (miimon > 0) {  /* link check interval, in milliseconds. */
 		init_timer(timer);
 		timer->expires  = jiffies + (miimon * HZ / 1000);
@@ -1055,7 +1064,6 @@
 		bond_alb_deinitialize(bond);
 	}
 
-	MOD_DEC_USE_COUNT;
 	return 0;
 }
 
@@ -3351,172 +3359,218 @@
 }
 
 #ifdef CONFIG_PROC_FS
-static int bond_read_proc(char *buf, char **start, off_t off, int count, int *eof, void *data)
+
+#define SEQ_START_TOKEN ((void *)1)
+
+static void *bond_info_seq_start(struct seq_file *seq, loff_t *pos)
 {
-	struct bonding *bond = (struct bonding *) data;
-	int len = 0;
-	u16 link;
-	slave_t *slave = NULL;
+	struct bonding *bond = seq->private;
+	loff_t off = 0;
+	struct slave *slave;
 
 	/* make sure the bond won't be taken away */
 	read_lock(&dev_base_lock);
+	read_lock_bh(&bond->lock);
 
-	len += sprintf(buf + len, "%s\n", version);
+	if (*pos == 0) {
+		return SEQ_START_TOKEN;
+	}
 
-	/*
-	 * This function locks the mutex, so we can't lock it until
-	 * afterwards
-	 */
-	link = bond_check_mii_link(bond);
+	for (slave = bond->prev; slave != (slave_t *)bond;
+	     slave = slave->prev) {
+
+		if (++off == *pos) {
+			return slave;
+		}
+	}
+
+	return NULL;
+}
 
-	len += sprintf(buf + len, "Bonding Mode: %s\n",
-		       bond_mode_name());
+static void *bond_info_seq_next(struct seq_file *seq, void *v, loff_t *pos)
+{
+	struct bonding *bond = seq->private;
+	struct slave *slave = v;
+
+	++*pos;
+	if (v == SEQ_START_TOKEN) {
+		slave = bond->prev;
+	} else {
+		slave = slave->prev;
+	}
+
+	return (slave == (struct slave *) bond) ? NULL : slave;
+}
+
+static void bond_info_seq_stop(struct seq_file *seq, void *v)
+{
+	struct bonding *bond = seq->private;
+
+	read_unlock_bh(&bond->lock);
+	read_unlock(&dev_base_lock);
+}
+
+static void bond_info_show_master(struct seq_file *seq, struct bonding *bond)
+{
+	struct slave *curr;
+
+	read_lock(&bond->ptrlock);
+	curr = bond->current_slave;
+	read_unlock(&bond->ptrlock);
+
+	seq_printf(seq, "Bonding Mode: %s\n", bond_mode_name());
 
 	if (USES_PRIMARY(bond_mode)) {
-		read_lock_bh(&bond->lock);
-		read_lock(&bond->ptrlock);
-		if (bond->current_slave != NULL) {
-			len += sprintf(buf + len,
-				"Currently Active Slave: %s\n",
-				bond->current_slave->dev->name);
+		if (curr) {
+			seq_printf(seq,
+				   "Currently Active Slave: %s\n",
+				   curr->dev->name);
 		}
-		read_unlock(&bond->ptrlock);
-		read_unlock_bh(&bond->lock);
 	}
 
-	len += sprintf(buf + len, "MII Status: ");
-	len += sprintf(buf + len,
-			link == BMSR_LSTATUS ? "up\n" : "down\n");
-	len += sprintf(buf + len, "MII Polling Interval (ms): %d\n",
-			miimon);
-	len += sprintf(buf + len, "Up Delay (ms): %d\n",
-			updelay * miimon);
-	len += sprintf(buf + len, "Down Delay (ms): %d\n",
-			downdelay * miimon);
-	len += sprintf(buf + len, "Multicast Mode: %s\n",
-		       multicast_mode_name());
-
-	read_lock_bh(&bond->lock);
+	seq_printf(seq, "MII Status: %s\n", (curr) ? "up" : "down");
+	seq_printf(seq, "MII Polling Interval (ms): %d\n", miimon);
+	seq_printf(seq, "Up Delay (ms): %d\n", updelay * miimon);
+	seq_printf(seq, "Down Delay (ms): %d\n", downdelay * miimon);
+	seq_printf(seq, "Multicast Mode: %s\n", multicast_mode_name());
 
 	if (bond_mode == BOND_MODE_8023AD) {
 		struct ad_info ad_info;
 
-		len += sprintf(buf + len, "\n802.3ad info\n");
+		seq_puts(seq, "\n802.3ad info\n");
 
 		if (bond_3ad_get_active_agg_info(bond, &ad_info)) {
-			len += sprintf(buf + len, "bond %s has no active aggregator\n", bond->device->name);
+			seq_printf(seq, "bond %s has no active aggregator\n",
+				   bond->device->name);
 		} else {
-			len += sprintf(buf + len, "Active Aggregator Info:\n");
+			seq_printf(seq, "Active Aggregator Info:\n");
 
-			len += sprintf(buf + len, "\tAggregator ID: %d\n", ad_info.aggregator_id);
-			len += sprintf(buf + len, "\tNumber of ports: %d\n", ad_info.ports);
-			len += sprintf(buf + len, "\tActor Key: %d\n", ad_info.actor_key);
-			len += sprintf(buf + len, "\tPartner Key: %d\n", ad_info.partner_key);
-			len += sprintf(buf + len, "\tPartner Mac Address: %02x:%02x:%02x:%02x:%02x:%02x\n",
-				       ad_info.partner_system[0],
-				       ad_info.partner_system[1],
-				       ad_info.partner_system[2],
-				       ad_info.partner_system[3],
-				       ad_info.partner_system[4],
-				       ad_info.partner_system[5]);
+			seq_printf(seq, "\tAggregator ID: %d\n",
+				   ad_info.aggregator_id);
+			seq_printf(seq, "\tNumber of ports: %d\n",
+				   ad_info.ports);
+			seq_printf(seq, "\tActor Key: %d\n",
+				   ad_info.actor_key);
+			seq_printf(seq, "\tPartner Key: %d\n",
+				   ad_info.partner_key);
+			seq_printf(seq, "\tPartner Mac Address: %02x:%02x:%02x:%02x:%02x:%02x\n",
+				   ad_info.partner_system[0],
+				   ad_info.partner_system[1],
+				   ad_info.partner_system[2],
+				   ad_info.partner_system[3],
+				   ad_info.partner_system[4],
+				   ad_info.partner_system[5]);
 		}
 	}
+}
 
-	for (slave = bond->prev; slave != (slave_t *)bond;
-	     slave = slave->prev) {
-		len += sprintf(buf + len, "\nSlave Interface: %s\n", slave->dev->name);
-
-		len += sprintf(buf + len, "MII Status: ");
-
-		len += sprintf(buf + len,
-			slave->link == BOND_LINK_UP ?
-			"up\n" : "down\n");
-		len += sprintf(buf + len, "Link Failure Count: %d\n",
-			slave->link_failure_count);
+static void bond_info_show_slave(struct seq_file *seq, const struct slave *slave)
+{
+	seq_printf(seq, "\nSlave Interface: %s\n", slave->dev->name);
+	seq_printf(seq, "MII Status: %s\n",
+		   (slave->link == BOND_LINK_UP) ?  "up" : "down");
+	seq_printf(seq, "Link Failure Count: %d\n",
+		   slave->link_failure_count);
 
-		if (app_abi_ver >= 1) {
-			len += sprintf(buf + len,
-				       "Permanent HW addr: %02x:%02x:%02x:%02x:%02x:%02x\n",
-				       slave->perm_hwaddr[0],
-				       slave->perm_hwaddr[1],
-				       slave->perm_hwaddr[2],
-				       slave->perm_hwaddr[3],
-				       slave->perm_hwaddr[4],
-				       slave->perm_hwaddr[5]);
-		}
+	if (app_abi_ver >= 1) {
+		seq_printf(seq,
+			   "Permanent HW addr: %02x:%02x:%02x:%02x:%02x:%02x\n",
+			   slave->perm_hwaddr[0],
+			   slave->perm_hwaddr[1],
+			   slave->perm_hwaddr[2],
+			   slave->perm_hwaddr[3],
+			   slave->perm_hwaddr[4],
+			   slave->perm_hwaddr[5]);
+	}
 
-		if (bond_mode == BOND_MODE_8023AD) {
-			struct aggregator *agg = SLAVE_AD_INFO(slave).port.aggregator;
+	if (bond_mode == BOND_MODE_8023AD) {
+		const struct aggregator *agg
+			= SLAVE_AD_INFO(slave).port.aggregator;
 
-			if (agg) {
-				len += sprintf(buf + len, "Aggregator ID: %d\n",
-					       agg->aggregator_identifier);
-			} else {
-				len += sprintf(buf + len, "Aggregator ID: N/A\n");
-			}
+		if (agg) {
+			seq_printf(seq, "Aggregator ID: %d\n",
+				   agg->aggregator_identifier);
+		} else {
+			seq_puts(seq, "Aggregator ID: N/A\n");
 		}
 	}
-	read_unlock_bh(&bond->lock);
+}
 
-	/*
-	 * Figure out the calcs for the /proc/net interface
-	 */
-	if (len <= off + count) {
-		*eof = 1;
-	}
-	*start = buf + off;
-	len -= off;
-	if (len > count) {
-		len = count;
-	}
-	if (len < 0) {
-		len = 0;
+static int bond_info_seq_show(struct seq_file *seq, void *v)
+{
+	if (v == SEQ_START_TOKEN) {
+		seq_printf(seq, "%s\n", version);
+		bond_info_show_master(seq, seq->private);
+	} else {
+		bond_info_show_slave(seq, v);
 	}
 
-	read_unlock(&dev_base_lock);
-
-	return len;
+	return 0;
 }
-#endif /* CONFIG_PROC_FS */
+
+static struct seq_operations bond_info_seq_ops = {
+	.start = bond_info_seq_start,
+	.next  = bond_info_seq_next,
+	.stop  = bond_info_seq_stop,
+	.show  = bond_info_seq_show,
+};
+
+static int bond_info_open(struct inode *inode, struct file *file)
+{
+	struct seq_file *seq;
+	struct proc_dir_entry *proc;
+	int rc;
+
+	rc = seq_open(file, &bond_info_seq_ops);
+	if (!rc) {
+		/* recover the pointer buried in proc_dir_entry data */
+		seq = file->private_data;
+		proc = PDE(inode);
+		seq->private = proc->data;
+	}
+	return rc;
+}
+
+static struct file_operations bond_info_fops = {
+	.owner	 = THIS_MODULE,
+	.open    = bond_info_open,
+	.read    = seq_read,
+	.llseek  = seq_lseek,
+	.release = seq_release,
+};
 
 static int bond_create_proc_info(struct bonding *bond)
 {
-#ifdef CONFIG_PROC_FS
 	struct net_device *dev = bond->device;
 
-	bond->bond_proc_dir = proc_mkdir(dev->name, proc_net);
-	if (bond->bond_proc_dir == NULL) {
-		printk(KERN_ERR "%s: Cannot init /proc/net/%s/\n",
-			dev->name, dev->name);
-		return -ENOMEM;
-	}
-	bond->bond_proc_dir->owner = THIS_MODULE;
-
-	bond->bond_proc_info_file =
-		create_proc_read_entry("info", 0, bond->bond_proc_dir,
-					bond_read_proc, bond);
-	if (bond->bond_proc_info_file == NULL) {
-		printk(KERN_ERR "%s: Cannot init /proc/net/%s/info\n",
-			dev->name, dev->name);
-		remove_proc_entry(dev->name, proc_net);
-		return -ENOMEM;
+	if (bond_proc_dir) {
+		bond->bond_proc_file = create_proc_entry(dev->name,
+							 S_IRUGO, 
+							 bond_proc_dir);
+		if (bond->bond_proc_file == NULL) {
+			printk(KERN_WARNING
+			       "%s: Cannot create /proc/net/bonding/%s\n", 
+			       dev->name, dev->name);
+		} else {
+			bond->bond_proc_file->data = bond;
+			bond->bond_proc_file->proc_fops = &bond_info_fops;
+			bond->bond_proc_file->owner = THIS_MODULE;
+			memcpy(bond->procdir_name, dev->name, IFNAMSIZ);
+		}
 	}
-	bond->bond_proc_info_file->owner = THIS_MODULE;
 
-	memcpy(bond->procdir_name, dev->name, IFNAMSIZ);
-#endif /* CONFIG_PROC_FS */
 	return 0;
 }
 
 static void bond_destroy_proc_info(struct bonding *bond)
 {
-#ifdef CONFIG_PROC_FS
-	remove_proc_entry("info", bond->bond_proc_dir);
-	remove_proc_entry(bond->procdir_name, proc_net);
-	memset(bond->procdir_name, 0, IFNAMSIZ);
-	bond->bond_proc_dir = NULL;
-#endif /* CONFIG_PROC_FS */
+	if (bond_proc_dir && bond->bond_proc_file) {
+		remove_proc_entry(bond->procdir_name, bond_proc_dir);
+		memset(bond->procdir_name, 0, IFNAMSIZ);
+		bond->bond_proc_file = NULL;
+	}
 }
+#endif /* CONFIG_PROC_FS */
 
 /*
  * Change HW address
@@ -3648,13 +3702,11 @@
  */
 static inline int bond_event_changename(struct bonding *bond)
 {
-	int error;
-
+#ifdef CONFIG_PROC_FS
 	bond_destroy_proc_info(bond);
-	error = bond_create_proc_info(bond);
-	if (error) {
-		return NOTIFY_BAD;
-	}
+	bond_create_proc_info(bond);
+#endif
+
 	return NOTIFY_DONE;
 }
 
@@ -3770,16 +3822,18 @@
 }
 
 static struct notifier_block bond_netdev_notifier = {
-	notifier_call: bond_netdev_event,
+	.notifier_call = bond_netdev_event,
 };
 
-static void bond_deinit(struct net_device *dev)
+static inline void bond_deinit(struct net_device *dev)
 {
 	struct bonding *bond = dev->priv;
 
 	list_del(&bond->bond_list);
 
+#ifdef CONFIG_PROC_FS
 	bond_destroy_proc_info(bond);
+#endif
 }
 
 static void bond_free_all(void)
@@ -3791,8 +3845,15 @@
 
 		unregister_netdev(dev);
 		bond_deinit(dev);
-		kfree(dev);
+		free_netdev(dev);
 	}
+
+#ifdef CONFIG_PROC_FS
+	if (bond_proc_dir) {
+		remove_proc_entry(DRV_NAME, proc_net);
+		bond_proc_dir = NULL;
+	}
+#endif
 }
 
 /*
@@ -3803,7 +3864,6 @@
 {
 	struct bonding *bond;
 	int count;
-	int err = 0;
 
 #ifdef BONDING_DEBUG
 	printk (KERN_INFO "Begin bond_init for %s\n", dev->name);
@@ -3881,27 +3941,14 @@
 	} else {
 		printk("out ARP monitoring\n");
 	}
-
-	err = bond_create_proc_info(bond);
-	if (err) {
-		printk(KERN_ERR "%s: Failed to create proc entry\n",
-			dev->name);
-		return err;
-	}
-
-	/* Future:
-	 * If anything fails beyond this point
-	 * make sure to destroy the proc entry
-	 */
+ 
+#ifdef CONFIG_PROC_FS
+	bond_create_proc_info(bond);
+#endif
 
 	list_add_tail(&bond->bond_list, &bond_dev_list);
 
 	return 0;
-/*
-err_out:
-	bond_destroy_proc_info(bond);
-	return err;
-*/
 }
 
 /*
@@ -4183,6 +4230,16 @@
 		primary = NULL;
 	}
 
+#ifdef CONFIG_PROC_FS
+	bond_proc_dir = proc_mkdir(DRV_NAME, proc_net);
+	if (bond_proc_dir == NULL)  {
+		printk(KERN_WARNING
+		       "bonding_init(): can not create /proc/net/" DRV_NAME);
+	} else {
+		bond_proc_dir->owner = THIS_MODULE;
+	}
+#endif
+
 	rtnl_lock();
 
 	err = 0;
@@ -4197,7 +4254,7 @@
 
 		err = dev_alloc_name(dev, "bond%d");
 		if (err < 0) {
-			kfree(dev);
+			free_netdev(dev);
 			goto out_err;
 		}
 
@@ -4207,7 +4264,7 @@
 		 */
 		err = bond_init(dev);
 		if (err < 0) {
-			kfree(dev);
+			free_netdev(dev);
 			goto out_err;
 		}
 
@@ -4216,7 +4273,7 @@
 		err = register_netdevice(dev);
 		if (err < 0) {
 			bond_deinit(dev);
-			kfree(dev);
+			free_netdev(dev);
 			goto out_err;
 		}
 	}
diff -urN linux-2.4.23-pre4/drivers/net/bonding/bonding.h linux-2.4.23-pre5/drivers/net/bonding/bonding.h
--- linux-2.4.23-pre4/drivers/net/bonding/bonding.h	2003-09-21 13:22:27.000000000 -0700
+++ linux-2.4.23-pre5/drivers/net/bonding/bonding.h	2003-09-21 13:22:31.000000000 -0700
@@ -101,8 +101,7 @@
 	struct timer_list arp_timer;
 	struct net_device_stats stats;
 #ifdef CONFIG_PROC_FS
-	struct proc_dir_entry *bond_proc_dir;
-	struct proc_dir_entry *bond_proc_info_file;
+	struct proc_dir_entry *bond_proc_file;
 	char procdir_name[IFNAMSIZ];
 #endif /* CONFIG_PROC_FS */
 	struct list_head bond_list;
diff -urN linux-2.4.23-pre4/drivers/net/wireless/Config.in linux-2.4.23-pre5/drivers/net/wireless/Config.in
--- linux-2.4.23-pre4/drivers/net/wireless/Config.in	2002-11-28 15:53:14.000000000 -0800
+++ linux-2.4.23-pre5/drivers/net/wireless/Config.in	2003-09-21 13:22:31.000000000 -0700
@@ -14,6 +14,7 @@
 
 if [ "$CONFIG_PCI" = "y" ]; then
    dep_tristate '    Hermes in PLX9052 based PCI adaptor support (Netgear MA301 etc.) (EXPERIMENTAL)' CONFIG_PLX_HERMES $CONFIG_HERMES $CONFIG_EXPERIMENTAL
+   dep_tristate '    Hermes in TMD7160/NCP130 based PCI adaptor support (Pheecom WL-PCI etc.) (EXPERIMENTAL)' CONFIG_TMD_HERMES $CONFIG_HERMES $CONFIG_EXPERIMENTAL
    dep_tristate '    Prism 2.5 PCI 802.11b adaptor support (EXPERIMENTAL)' CONFIG_PCI_HERMES $CONFIG_HERMES $CONFIG_EXPERIMENTAL
 fi
 
diff -urN linux-2.4.23-pre4/drivers/net/wireless/Makefile linux-2.4.23-pre5/drivers/net/wireless/Makefile
--- linux-2.4.23-pre4/drivers/net/wireless/Makefile	2002-08-02 17:39:44.000000000 -0700
+++ linux-2.4.23-pre5/drivers/net/wireless/Makefile	2003-09-21 13:22:31.000000000 -0700
@@ -18,6 +18,7 @@
 obj-$(CONFIG_PCMCIA_HERMES)	+= orinoco_cs.o
 obj-$(CONFIG_APPLE_AIRPORT)	+= airport.o
 obj-$(CONFIG_PLX_HERMES)	+= orinoco_plx.o
+obj-$(CONFIG_TMD_HERMES)	+= orinoco_tmd.o
 obj-$(CONFIG_PCI_HERMES)	+= orinoco_pci.o
 
 obj-$(CONFIG_AIRO)		+= airo.o
diff -urN linux-2.4.23-pre4/drivers/net/wireless/airo.c linux-2.4.23-pre5/drivers/net/wireless/airo.c
--- linux-2.4.23-pre4/drivers/net/wireless/airo.c	2003-09-21 13:22:27.000000000 -0700
+++ linux-2.4.23-pre5/drivers/net/wireless/airo.c	2003-09-21 13:22:31.000000000 -0700
@@ -1440,7 +1440,7 @@
   
 	int i,j;
 	u32 counter;
-	u8 *cipher;
+	u8 *cipher, plain[16];
 	struct scatterlist sg[1];
 
 	crypto_cipher_setkey(tfm, pkey, 16);
@@ -1451,8 +1451,9 @@
 		aes_counter[13] = (u8)(counter >> 16);
 		aes_counter[12] = (u8)(counter >> 24);
 		counter++;
-		sg[0].page = virt_to_page(aes_counter);
-		sg[0].offset = ((long) aes_counter & ~PAGE_MASK);
+		memcpy (plain, aes_counter, 16);
+		sg[0].page = virt_to_page(plain);
+		sg[0].offset = ((long) plain & ~PAGE_MASK);
 		sg[0].length = 16;
 		crypto_cipher_encrypt(tfm, sg, sg, 16);
 		cipher = kmap(sg[0].page) + sg[0].offset;
diff -urN linux-2.4.23-pre4/drivers/scsi/ide-scsi.c linux-2.4.23-pre5/drivers/scsi/ide-scsi.c
--- linux-2.4.23-pre4/drivers/scsi/ide-scsi.c	2003-08-25 04:44:42.000000000 -0700
+++ linux-2.4.23-pre5/drivers/scsi/ide-scsi.c	2003-09-21 13:22:32.000000000 -0700
@@ -531,6 +531,8 @@
 	atapi_bcount_t bcount;
 	struct request *rq = pc->rq;
 
+	feature.all = 0;
+
 	/* Set the current packet command */
 	scsi->pc = pc;
 	/* We haven't transferred any data yet */
@@ -539,6 +541,7 @@
 	/* Request to transfer the entire buffer at once */
 	bcount.all = IDE_MIN(pc->request_transfer, 63 * 1024);
 
+
 	if (drive->using_dma && rq->bh) {
 		if (test_bit(PC_WRITING, &pc->flags))
 			feature.b.dma = !HWIF(drive)->ide_dma_write(drive);
diff -urN linux-2.4.23-pre4/drivers/sound/ac97_codec.c linux-2.4.23-pre5/drivers/sound/ac97_codec.c
--- linux-2.4.23-pre4/drivers/sound/ac97_codec.c	2003-08-25 04:44:42.000000000 -0700
+++ linux-2.4.23-pre5/drivers/sound/ac97_codec.c	2003-09-21 13:22:32.000000000 -0700
@@ -1077,6 +1077,9 @@
 /* WM9711, WM9712 */
 static int wolfson_init11(struct ac97_codec * codec)
 {
+	/* stop pop's during suspend/resume */
+	codec->codec_write(codec, AC97_WM97XX_TEST, codec->codec_read(codec, AC97_WM97XX_TEST) & 0xffbf);
+
 	/* set out3 volume */
 	codec->codec_write(codec, AC97_WM9711_OUT3VOL, 0x0808);
 	return 0;
diff -urN linux-2.4.23-pre4/drivers/sound/forte.c linux-2.4.23-pre5/drivers/sound/forte.c
--- linux-2.4.23-pre4/drivers/sound/forte.c	2003-08-25 04:44:42.000000000 -0700
+++ linux-2.4.23-pre5/drivers/sound/forte.c	2003-09-21 13:22:32.000000000 -0700
@@ -50,7 +50,7 @@
 #include <asm/io.h>
 
 #define DRIVER_NAME	"forte"
-#define DRIVER_VERSION 	"$Id: forte.c,v 1.63 2003/03/01 05:32:42 mkp Exp $"
+#define DRIVER_VERSION 	"$Id: forte.c,v 1.65 2003/09/18 15:28:39 mkp Exp $"
 #define PFX 		DRIVER_NAME ": "
 
 #undef M_DEBUG
@@ -157,7 +157,6 @@
 	void 			*buf; 		/* Buffer */
 	dma_addr_t		buf_handle; 	/* Buffer handle */
 
-        unsigned int 		record;
 	unsigned int		format;
         unsigned int		rate;
 	unsigned int		stereo;
@@ -367,11 +366,11 @@
 
 
 static struct file_operations forte_mixer_fops = {
-	owner:	    		THIS_MODULE,
-	llseek:         	no_llseek,
-	ioctl:          	forte_mixer_ioctl,
-	open:           	forte_mixer_open,
-	release:        	forte_mixer_release,
+	.owner			= THIS_MODULE,
+	.llseek			= no_llseek,
+	.ioctl			= forte_mixer_ioctl,
+	.open			= forte_mixer_open,
+	.release		= forte_mixer_release,
 };
 
 
@@ -665,14 +664,14 @@
  * Locking:	Lock held.
  */
 
-static void
+static int
 forte_channel_prep (struct forte_channel *channel)
 {
 	struct page *page;
 	int i;
 	
 	if (channel->buf)
-		return;
+		return 0;
 
 	forte_channel_buffer (channel, channel->frag_sz, channel->frag_num);
 	channel->buf_pages = channel->buf_sz >> PAGE_SHIFT;
@@ -690,7 +689,7 @@
 					     &channel->buf_handle);
 
 	if (!channel->buf || !channel->buf_handle)
-		BUG();
+		return -ENOMEM;
 
 	page = virt_to_page (channel->buf);
 	
@@ -709,6 +708,8 @@
 
 	DPRINTK ("%s: %s buffer @ %p (%p)\n", __FUNCTION__, channel->name, 
 		 channel->buf, channel->buf_handle);
+
+	return 0;
 }
 
 
@@ -789,7 +790,6 @@
 	else if (channel == &chip->rec) {
 		channel->name = "PCM_IN";
 		channel->iobase = chip->iobase + FORTE_CAP_OFFSET;
-		channel->record = 1;
 		DPRINTK ("%s: PCM-IN iobase @ %p\n", __FUNCTION__, 
 			 (void *) channel->iobase);
 	}
@@ -800,12 +800,15 @@
 
 	/* Defaults: 48kHz, 16-bit, stereo */
 	channel->ctrl = inw (channel->iobase + FORTE_PLY_CTRL);
+
+	channel->frag_sz = FORTE_DEF_FRAG_SIZE;
+	channel->frag_num = FORTE_DEF_FRAGMENTS;
+	channel->frag_msecs = 0;
+
 	forte_channel_reset (channel);
 	forte_channel_stereo (channel, 1);
 	forte_channel_format (channel, AFMT_S16_LE);
 	forte_channel_rate (channel, 48000);
-	channel->frag_sz = FORTE_DEF_FRAG_SIZE;
-	channel->frag_num = FORTE_DEF_FRAGMENTS;
 
 	chip->trigger = 0;
 	spin_unlock_irq (&chip->lock);
@@ -828,6 +831,9 @@
 static void
 forte_channel_free (struct forte_chip *chip, struct forte_channel *channel)
 {
+	struct page *page;
+	int i;
+
 	DPRINTK ("%s: %s\n", __FUNCTION__, channel->name);
 
 	if (!channel->buf_handle)
@@ -835,7 +841,12 @@
 
 	pci_free_consistent (chip->pci_dev, channel->buf_pages * PAGE_SIZE, 
 			     channel->buf, channel->buf_handle);
-	
+
+	page = virt_to_page (channel->buf);
+
+	for (i = 0; i < channel->buf_pages ; i++)
+		mem_map_unreserve (page++);
+
 	memset (channel, 0x0, sizeof (*channel));
 }
 
@@ -1071,7 +1082,7 @@
 
 		spin_unlock_irq (&chip->lock);
 
-		return copy_to_user ((void *) arg, &abi, sizeof (abi));
+		return copy_to_user ((void *) arg, &abi, sizeof (abi)) ? -EFAULT : 0;
 
 	case SNDCTL_DSP_GETIPTR:
 		DPRINTK ("%s: GETIPTR\n", __FUNCTION__);
@@ -1092,7 +1103,7 @@
 
 		spin_unlock_irq (&chip->lock);
 
-		return copy_to_user ((void *) arg, &cinfo, sizeof (cinfo));
+		return copy_to_user ((void *) arg, &cinfo, sizeof (cinfo)) ? -EFAULT : 0;
 
         case SNDCTL_DSP_GETOSPACE:
 		if (!wr)
@@ -1120,7 +1131,7 @@
 
 		spin_unlock_irq (&chip->lock);
 		
-		return copy_to_user ((void *) arg, &abi, sizeof (abi));
+		return copy_to_user ((void *) arg, &abi, sizeof (abi)) ? -EFAULT : 0;
 
 	case SNDCTL_DSP_GETOPTR:
 		if (!wr)
@@ -1139,7 +1150,7 @@
 
 		spin_unlock_irq (&chip->lock);
 
-		return copy_to_user ((void *) arg, &cinfo, sizeof (cinfo));
+		return copy_to_user ((void *) arg, &cinfo, sizeof (cinfo)) ? -EFAULT : 0;
 
 	case SNDCTL_DSP_GETODELAY:
 		if (!wr)
@@ -1189,7 +1200,12 @@
 				forte_channel_start (&chip->play);
 			else {		
 				chip->trigger = 1;
-				forte_channel_prep (&chip->play);
+
+				if (forte_channel_prep (&chip->play)) {
+					spin_unlock_irq (&chip->lock);
+					return -ENOMEM;
+				}
+					
 				forte_channel_stop (&chip->play);
 			}
 
@@ -1202,7 +1218,12 @@
 				forte_channel_start (&chip->rec);
 			else {		
 				chip->trigger = 1;
-				forte_channel_prep (&chip->rec);
+
+				if (forte_channel_prep (&chip->rec)) {
+					spin_unlock_irq (&chip->lock);
+					return -ENOMEM;
+				}
+					
 				forte_channel_stop (&chip->rec);
 			}
 
@@ -1397,7 +1418,11 @@
 		goto out;
 	}
 
-	forte_channel_prep (channel);
+	if (forte_channel_prep (channel)) {
+		ret = -ENOMEM;
+		goto out;
+	}
+		
 	channel->mapped = 1;
 
         if (vma->vm_pgoff != 0) {
@@ -1461,7 +1486,10 @@
 	spin_lock_irqsave (&chip->lock, flags);
 
 	/* Set up buffers with the right fragment size */
-	forte_channel_prep (channel);
+	if (forte_channel_prep (channel)) {
+		spin_unlock_irqrestore (&chip->lock, flags);
+		return -ENOMEM;
+	}
 
 	while (i) {
 		/* All fragment buffers in use -> wait */
@@ -1569,7 +1597,10 @@
 	spin_lock_irqsave (&chip->lock, flags);
 
 	/* Set up buffers with the right fragment size */
-	forte_channel_prep (channel);
+	if (forte_channel_prep (channel)) {
+		spin_unlock_irqrestore (&chip->lock, flags);
+		return -ENOMEM;
+	}		
 
 	/* Start recording */
 	if (!chip->trigger)
@@ -1637,15 +1668,15 @@
 
 
 static struct file_operations forte_dsp_fops = {
-	owner:			THIS_MODULE,
-	llseek:     		&no_llseek,
-	read:       		&forte_dsp_read,
-	write:      		&forte_dsp_write,
-	poll:       		&forte_dsp_poll,
-	ioctl:      		&forte_dsp_ioctl,
-	open:       		&forte_dsp_open,
-	release:    		&forte_dsp_release,
-	mmap:			&forte_dsp_mmap,
+	.owner			= THIS_MODULE,
+	.llseek			= &no_llseek,
+	.read			= &forte_dsp_read,
+	.write			= &forte_dsp_write,
+	.poll			= &forte_dsp_poll,
+	.ioctl			= &forte_dsp_ioctl,
+	.open			= &forte_dsp_open,
+	.release		= &forte_dsp_release,
+	.mmap			= &forte_dsp_mmap,
 };
 
 
@@ -2104,11 +2135,10 @@
 
 
 static struct pci_driver forte_pci_driver = {
-	name:       		DRIVER_NAME,
-	id_table:   		forte_pci_ids,
-	probe:      		forte_probe,
-	remove:     		forte_remove,
-
+	.name			= DRIVER_NAME,
+	.id_table		= forte_pci_ids,
+	.probe			= forte_probe,
+	.remove			= forte_remove,
 };
 
 
diff -urN linux-2.4.23-pre4/drivers/sound/i810_audio.c linux-2.4.23-pre5/drivers/sound/i810_audio.c
--- linux-2.4.23-pre4/drivers/sound/i810_audio.c	2003-09-21 13:22:27.000000000 -0700
+++ linux-2.4.23-pre5/drivers/sound/i810_audio.c	2003-09-21 13:22:32.000000000 -0700
@@ -72,17 +72,16 @@
  *
  *  ICH 4 caveats
  *
- *      The ICH4 has the feature, that the codec ID doesn't have to be 
- *      congruent with the IO connection.
+ *	The ICH4 has the feature, that the codec ID doesn't have to be 
+ *	congruent with the IO connection.
  * 
- *      Therefore, from driver version 0.23 on, there is a "codec ID" <->
- *      "IO register base offset" mapping (card->ac97_id_map) field.
+ *	Therefore, from driver version 0.23 on, there is a "codec ID" <->
+ *	"IO register base offset" mapping (card->ac97_id_map) field.
  *   
- *      Juergen "George" Sawinski (jsaw) 
+ *	Juergen "George" Sawinski (jsaw) 
  */
  
 #include <linux/module.h>
-#include <linux/version.h>
 #include <linux/string.h>
 #include <linux/ctype.h>
 #include <linux/ioport.h>
@@ -92,6 +91,7 @@
 #include <linux/slab.h>
 #include <linux/soundcard.h>
 #include <linux/pci.h>
+#include <linux/interrupt.h>
 #include <asm/io.h>
 #include <asm/dma.h>
 #include <linux/init.h>
@@ -99,7 +99,6 @@
 #include <linux/spinlock.h>
 #include <linux/smp_lock.h>
 #include <linux/ac97_codec.h>
-#include <linux/wrapper.h>
 #include <asm/uaccess.h>
 #include <asm/hardirq.h>
 
@@ -143,10 +142,10 @@
 #define PCI_DEVICE_ID_AMD_8111_AC97	0x746d
 #endif
 
-static int ftsodell=0;
-static int strict_clocking=0;
-static unsigned int clocking=0;
-static int spdif_locked=0;
+static int ftsodell;
+static int strict_clocking;
+static unsigned int clocking;
+static int spdif_locked;
 
 //#define DEBUG
 //#define DEBUG2
@@ -182,7 +181,7 @@
 struct i810_channel 
 {
 	/* these sg guys should probably be allocated
-	   seperately as nocache. Must be 8 byte aligned */
+	   separately as nocache. Must be 8 byte aligned */
 	struct sg_item sg[SG_LEN];	/* 32*8 */
 	u32 offset;			/* 4 */
 	u32 port;			/* 4 */
@@ -191,7 +190,7 @@
 };
 
 /*
- * we have 3 seperate dma engines.  pcm in, pcm out, and mic.
+ * we have 3 separate dma engines.  pcm in, pcm out, and mic.
  * each dma engine has controlling registers.  These goofy
  * names are from the datasheet, but make it easy to write
  * code while leafing through it.
@@ -317,7 +316,7 @@
 	/*@FIXME to be verified*/	{  3, 0x0001 }, /* AMD8111 */
 };
 
-static struct pci_device_id i810_pci_tbl [] __initdata = {
+static struct pci_device_id i810_pci_tbl [] = {
 	{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801,
 	 PCI_ANY_ID, PCI_ANY_ID, 0, 0, ICH82801AA},
 	{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82901,
@@ -880,7 +879,7 @@
 #define DMABUF_DEFAULTORDER (16-PAGE_SHIFT)
 #define DMABUF_MINORDER 1
 
-/* allocate DMA buffer, playback and recording buffer should be allocated seperately */
+/* allocate DMA buffer, playback and recording buffer should be allocated separately */
 static int alloc_dmabuf(struct i810_state *state)
 {
 	struct dmabuf *dmabuf = &state->dmabuf;
@@ -922,7 +921,7 @@
 	/* now mark the pages as reserved; otherwise remap_page_range doesn't do what we want */
 	pend = virt_to_page(rawbuf + (PAGE_SIZE << order) - 1);
 	for (page = virt_to_page(rawbuf); page <= pend; page++)
-		mem_map_reserve(page);
+		SetPageReserved(page);
 
 	return 0;
 }
@@ -937,7 +936,7 @@
 		/* undo marking the pages as reserved */
 		pend = virt_to_page(dmabuf->rawbuf + (PAGE_SIZE << dmabuf->buforder) - 1);
 		for (page = virt_to_page(dmabuf->rawbuf); page <= pend; page++)
-			mem_map_unreserve(page);
+			ClearPageReserved(page);
 		pci_free_consistent(state->card->pci_dev, PAGE_SIZE << dmabuf->buforder,
 				    dmabuf->rawbuf, dmabuf->dma_handle);
 	}
@@ -1370,7 +1369,7 @@
 #endif
 }
 
-static void i810_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t i810_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct i810_card *card = (struct i810_card *)dev_id;
 	u32 status;
@@ -1382,7 +1381,7 @@
 	if(!(status & INT_MASK)) 
 	{
 		spin_unlock(&card->lock);
-		return;  /* not for us */
+		return IRQ_NONE;  /* not for us */
 	}
 
 	if(status & (INT_PO|INT_PI|INT_MC))
@@ -1391,6 +1390,7 @@
  	/* clear 'em */
 	outl(status & INT_MASK, card->iobase + GLOB_STA);
 	spin_unlock(&card->lock);
+	return IRQ_HANDLED;
 }
 
 /* in this loop, dmabuf.count signifies the amount of data that is
@@ -1800,7 +1800,8 @@
 		}
 		if (c != NULL) {
 			outb(2, state->card->iobase+c->port+OFF_CR);   /* reset DMA machine */
-			while ( inb(state->card->iobase+c->port+OFF_CR) & 2 );
+			while ( inb(state->card->iobase+c->port+OFF_CR) & 2 )
+				cpu_relax();
 			outl((u32)state->card->chandma +
 			    c->num*sizeof(struct i810_channel),
 			    state->card->iobase+c->port+OFF_BDBAR);
@@ -2386,9 +2387,9 @@
 				i810_set_dac_channels ( state, channels );
 
 				/* check that they really got turned on */
-				if ( !state->card->ac97_status & SURR_ON )
+				if (!(state->card->ac97_status & SURR_ON))
 					val &= ~DSP_BIND_SURR;
-				if ( !state->card->ac97_status & CENTER_LFE_ON )
+				if (!(state->card->ac97_status & CENTER_LFE_ON))
 					val &= ~DSP_BIND_CENTER_LFE;
 			}
 		}
@@ -2537,15 +2538,15 @@
 }
 
 static /*const*/ struct file_operations i810_audio_fops = {
-	owner:		THIS_MODULE,
-	llseek:		no_llseek,
-	read:		i810_read,
-	write:		i810_write,
-	poll:		i810_poll,
-	ioctl:		i810_ioctl,
-	mmap:		i810_mmap,
-	open:		i810_open,
-	release:	i810_release,
+	.owner		= THIS_MODULE,
+	.llseek		= no_llseek,
+	.read		= i810_read,
+	.write		= i810_write,
+	.poll		= i810_poll,
+	.ioctl		= i810_ioctl,
+	.mmap		= i810_mmap,
+	.open		= i810_open,
+	.release	= i810_release,
 };
 
 /* Write AC97 codec registers */
@@ -2682,10 +2683,10 @@
 }
 
 static /*const*/ struct file_operations i810_mixer_fops = {
-	owner:		THIS_MODULE,
-	llseek:		no_llseek,
-	ioctl:		i810_ioctl_mixdev,
-	open:		i810_open_mixdev,
+	.owner		= THIS_MODULE,
+	.llseek		= no_llseek,
+	.ioctl		= i810_ioctl_mixdev,
+	.open		= i810_open_mixdev,
 };
 
 /* AC97 codec initialisation.  These small functions exist so we don't
@@ -3250,7 +3251,6 @@
 out_pio:	
 	release_region(card->iobase, 64);
 	release_region(card->ac97base, 256);
-out_chan:
 	pci_free_consistent(pci_dev, sizeof(struct i810_channel)*NR_HW_CH,
 	    card->channel, card->chandma);
 out_mem:
@@ -3423,22 +3423,19 @@
 #define I810_MODULE_NAME "intel810_audio"
 
 static struct pci_driver i810_pci_driver = {
-	name:		I810_MODULE_NAME,
-	id_table:	i810_pci_tbl,
-	probe:		i810_probe,
-	remove:		__devexit_p(i810_remove),
+	.name		= I810_MODULE_NAME,
+	.id_table	= i810_pci_tbl,
+	.probe		= i810_probe,
+	.remove		= __devexit_p(i810_remove),
 #ifdef CONFIG_PM
-	suspend:	i810_pm_suspend,
-	resume:		i810_pm_resume,
+	.suspend	= i810_pm_suspend,
+	.resume		= i810_pm_resume,
 #endif /* CONFIG_PM */
 };
 
 
 static int __init i810_init_module (void)
 {
-	if (!pci_present())   /* No PCI bus in this machine! */
-		return -ENODEV;
-
 	printk(KERN_INFO "Intel 810 + AC97 Audio, version "
 	       DRIVER_VERSION ", " __TIME__ " " __DATE__ "\n");
 
diff -urN linux-2.4.23-pre4/drivers/video/Config.in linux-2.4.23-pre5/drivers/video/Config.in
--- linux-2.4.23-pre4/drivers/video/Config.in	2003-09-21 13:22:27.000000000 -0700
+++ linux-2.4.23-pre5/drivers/video/Config.in	2003-09-21 13:22:33.000000000 -0700
@@ -300,6 +300,7 @@
            "$CONFIG_FB_PM3" = "y" -o "$CONFIG_FB_TRIDENT" = "y" -o \
 	   "$CONFIG_FB_P9100" = "y" -o "$CONFIG_FB_ATY128" = "y" -o \
 	   "$CONFIG_FB_RIVA" = "y" -o "$CONFIG_FB_RADEON" = "y" -o \
+	   "$CONFIG_FB_INTEL" = "y" -o \
 	   "$CONFIG_FB_SGIVW" = "y" -o "$CONFIG_FB_CYBER2000" = "y" -o \
 	   "$CONFIG_FB_SA1100" = "y" -o "$CONFIG_FB_3DFX" = "y" -o \
 	   "$CONFIG_FB_PMAG_BA" = "y" -o "$CONFIG_FB_PMAGB_B" = "y" -o \
@@ -320,12 +321,13 @@
 	      "$CONFIG_FB_VALKYRIE" = "m" -o "$CONFIG_FB_PLATINUM" = "m" -o \
               "$CONFIG_FB_IGA" = "m" -o "$CONFIG_FB_MATROX" = "m" -o \
 	      "$CONFIG_FB_CT65550" = "m" -o "$CONFIG_FB_PM2" = "m" -o \
-              "$CONFIG_FB_PM3" = "m" -o "$CONFIG_FB_TRIDENT" = "y" -o \
+              "$CONFIG_FB_PM3" = "m" -o "$CONFIG_FB_TRIDENT" = "m" -o \
 	      "$CONFIG_FB_P9100" = "m" -o "$CONFIG_FB_ATY128" = "m" -o \
 	      "$CONFIG_FB_RIVA" = "m" -o "$CONFIG_FB_3DFX" = "m" -o \
 	      "$CONFIG_FB_SGIVW" = "m" -o "$CONFIG_FB_CYBER2000" = "m" -o \
 	      "$CONFIG_FB_PMAG_BA" = "m" -o "$CONFIG_FB_PMAGB_B" = "m" -o \
 	      "$CONFIG_FB_MAXINE" = "m" -o "$CONFIG_FB_RADEON" = "m" -o \
+	      "$CONFIG_FB_INTEL" = "m" -o \
 	      "$CONFIG_FB_SA1100" = "m" -o "$CONFIG_FB_SIS" = "m" -o \
 	      "$CONFIG_FB_TX3912" = "m" -o "$CONFIG_FB_NEOMAGIC" = "m" -o \
 	      "$CONFIG_FB_STI" = "m" -o "$CONFIG_FB_INTEL" = "m" ]; then
@@ -336,6 +338,7 @@
 	   "$CONFIG_FB_MAC" = "y" -o "$CONFIG_FB_VESA" = "y" -o \
 	   "$CONFIG_FB_VIRTUAL" = "y" -o "$CONFIG_FB_TBOX" = "y" -o \
 	   "$CONFIG_FB_Q40" = "y" -o "$CONFIG_FB_RADEON" = "y" -o \
+	   "$CONFIG_FB_INTEL" = "y" -o \
 	   "$CONFIG_FB_CONTROL" = "y" -o "$CONFIG_FB_CLGEN" = "y" -o \
 	   "$CONFIG_FB_VIRGE" = "y" -o "$CONFIG_FB_CYBER" = "y" -o \
 	   "$CONFIG_FB_VALKYRIE" = "y" -o "$CONFIG_FB_PLATINUM" = "y" -o \
@@ -358,10 +361,11 @@
 	      "$CONFIG_FB_VALKYRIE" = "m" -o "$CONFIG_FB_PLATINUM" = "m" -o \
 	      "$CONFIG_FB_CT65550" = "m" -o "$CONFIG_FB_MATROX" = "m" -o \
 	      "$CONFIG_FB_PM2" = "m" -o "$CONFIG_FB_SGIVW" = "m" -o \
-              "$CONFIG_FB_PM3" = "m" -o "$CONFIG_FB_TRIDENT" = "y" -o \
+              "$CONFIG_FB_PM3" = "m" -o "$CONFIG_FB_TRIDENT" = "m" -o \
 	      "$CONFIG_FB_RIVA" = "m" -o "$CONFIG_FB_ATY128" = "m" -o \
 	      "$CONFIG_FB_CYBER2000" = "m" -o "$CONFIG_FB_SIS" = "m" -o \
 	      "$CONFIG_FB_SA1100" = "m" -o "$CONFIG_FB_RADEON" = "m" -o \
+	      "$CONFIG_FB_INTEL" = "m" -o \
 	      "$CONFIG_FB_PVR2" = "m" -o "$CONFIG_FB_VOODOO1" = "m" -o \
 	      "$CONFIG_FB_NEOMAGIC" = "m" -o "$CONFIG_FB_INTEL" = "m" ]; then
 	    define_tristate CONFIG_FBCON_CFB16 m
@@ -393,6 +397,7 @@
 	   "$CONFIG_FB_RIVA" = "y" -o "$CONFIG_FB_ATY128" = "y" -o \
 	   "$CONFIG_FB_FM2" = "y" -o "$CONFIG_FB_SGIVW" = "y" -o \
 	   "$CONFIG_FB_RADEON" = "y" -o "$CONFIG_FB_PVR2" = "y" -o \
+	   "$CONFIG_FB_INTEL" = "y" -o \
 	   "$CONFIG_FB_3DFX" = "y" -o "$CONFIG_FB_SIS" = "y" -o \
 	   "$CONFIG_FB_VOODOO1" = "y" -o "$CONFIG_FB_CYBER2000" = "y" -o \
 	   "$CONFIG_FB_STI" = "y"  -o "$CONFIG_FB_INTEL" = "y" ]; then
@@ -403,13 +408,13 @@
 	      "$CONFIG_FB_CONTROL" = "m" -o "$CONFIG_FB_CLGEN" = "m" -o \
 	      "$CONFIG_FB_TGA" = "m" -o "$CONFIG_FB_PLATINUM" = "m" -o \
 	      "$CONFIG_FB_MATROX" = "m" -o "$CONFIG_FB_PM2" = "m" -o \
-              "$CONFIG_FB_PM3" = "m" -o "$CONFIG_FB_TRIDENT" = "y" -o \
+              "$CONFIG_FB_PM3" = "m" -o "$CONFIG_FB_TRIDENT" = "m" -o \
 	      "$CONFIG_FB_RIVA" = "m" -o "$CONFIG_FB_ATY128" = "m" -o \
 	      "$CONFIG_FB_3DFX" = "m" -o "$CONFIG_FB_RADEON" = "m" -o \
+	      "$CONFIG_FB_INTEL" = "m" -o \
 	      "$CONFIG_FB_SGIVW" = "m" -o "$CONFIG_FB_SIS" = "m" -o \
 	      "$CONFIG_FB_PVR2" = "m" -o "$CONFIG_FB_VOODOO1" = "m" -o \
-	      "$CONFIG_FB_CYBER2000" = "m" -o "$CONFIG_FB_STI" = "y" -o \
-	      "$CONFIG_FB_INTEL" = "m" ]; then
+	      "$CONFIG_FB_CYBER2000" = "m" -o "$CONFIG_FB_STI" = "m" ]; then
 	    define_tristate CONFIG_FBCON_CFB32 m
 	 fi
       fi
@@ -456,9 +461,9 @@
 	    define_tristate CONFIG_FBCON_HGA m
 	 fi
       fi
-      if [ "$CONFIG_FB_STI" = "y" ]; then
-	 define_tristate CONFIG_FBCON_STI y
-      fi
+   fi
+   if [ "$CONFIG_FB_STI" = "y" ]; then
+      define_tristate CONFIG_FBCON_STI y
    fi
    bool '  Support only 8 pixels wide fonts' CONFIG_FBCON_FONTWIDTH8_ONLY
    if [ "$CONFIG_SPARC32" = "y" -o "$CONFIG_SPARC64" = "y" ]; then
diff -urN linux-2.4.23-pre4/drivers/video/aty/atyfb_base.c linux-2.4.23-pre5/drivers/video/aty/atyfb_base.c
--- linux-2.4.23-pre4/drivers/video/aty/atyfb_base.c	2003-09-21 13:22:27.000000000 -0700
+++ linux-2.4.23-pre5/drivers/video/aty/atyfb_base.c	2003-09-21 13:22:33.000000000 -0700
@@ -313,7 +313,7 @@
     int pll, mclk, xclk;
     u32 features;
 } aty_chips[] __initdata = {
-    /* Note to kernel maintainers: Please resfuse any patch to change a clock rate,
+    /* Note to kernel maintainers: Please REFUSE any patch to change a clock rate,
        unless someone proves that a value is incorrect for him with a dump of
        the driver information table in the BIOS. Patches accepted in the past have
        caused chips to be overclocked by as much as 50%!
@@ -498,10 +498,12 @@
      * off. It is a Rage Mobility M1, but doesn't happen on these chips
      * in general. (Daniel Mantione, 26 june 2003)
      */
-      aty_st_lcd(aty_ld_lcd(LCD_GEN_CTRL, info) | SHADOW_RW_EN, info);
+      aty_st_lcd(LCD_GEN_CTRL, aty_ld_lcd(LCD_GEN_CTRL, info) | SHADOW_RW_EN,
+		 info);
       aty_st_le32(CRTC_H_TOTAL_DISP, crtc->h_tot_disp, info);
       aty_st_le32(CRTC_H_SYNC_STRT_WID, crtc->h_sync_strt_wid, info);
-      aty_st_lcd(aty_ld_lcd(LCD_GEN_CTRL, info) & ~SHADOW_RW_EN, info);
+      aty_st_lcd(LCD_GEN_CTRL, aty_ld_lcd(LCD_GEN_CTRL, info) & ~SHADOW_RW_EN,
+		 info);
     /* End hack */
 #endif
 
@@ -2479,6 +2481,8 @@
             info->frame_buffer = (unsigned long) addr + 0x800000UL;
             info->frame_buffer_phys = addr + 0x800000UL;
 
+            aty_init_register_array(info);
+
             /*
              * Figure mmap addresses from PCI config space.
              * Split Framebuffer in big- and little-endian halfs.
@@ -2669,6 +2673,7 @@
 
                 default_var.pixclock = 1000000000 / T;
             }
+
 #else /* __sparc__ */
 
             aux_app = 0;
diff -urN linux-2.4.23-pre4/drivers/video/aty/mach64_ct.c linux-2.4.23-pre5/drivers/video/aty/mach64_ct.c
--- linux-2.4.23-pre4/drivers/video/aty/mach64_ct.c	2003-09-21 13:22:27.000000000 -0700
+++ linux-2.4.23-pre5/drivers/video/aty/mach64_ct.c	2003-09-21 13:22:33.000000000 -0700
@@ -86,7 +86,7 @@
 
 u8 stdcall aty_ld_pll(int offset, const struct fb_info_aty *info)
 {
-    u32 addr;
+    unsigned long addr;
 
     addr = info->ati_regbase + CLOCK_CNTL + 1;
     /* write addr byte */
@@ -98,7 +98,7 @@
 
 static void stdcall aty_st_pll(int offset, u8 val, const struct fb_info_aty *info)
 {
-    u32 addr;
+    unsigned long addr;
     addr = info->ati_regbase + CLOCK_CNTL + 1;
     /* write addr byte */
     writeb((offset << 2) | PLL_WR_EN,addr);
diff -urN linux-2.4.23-pre4/include/acpi/acconfig.h linux-2.4.23-pre5/include/acpi/acconfig.h
--- linux-2.4.23-pre4/include/acpi/acconfig.h	2003-08-25 04:44:43.000000000 -0700
+++ linux-2.4.23-pre5/include/acpi/acconfig.h	2003-09-21 13:22:33.000000000 -0700
@@ -64,7 +64,7 @@
 
 /* Version string */
 
-#define ACPI_CA_VERSION                 0x20030813
+#define ACPI_CA_VERSION                 0x20030916
 
 /* Maximum objects in the various object caches */
 
diff -urN linux-2.4.23-pre4/include/asm-i386/acpi.h linux-2.4.23-pre5/include/asm-i386/acpi.h
--- linux-2.4.23-pre4/include/asm-i386/acpi.h	2003-08-25 04:44:43.000000000 -0700
+++ linux-2.4.23-pre5/include/asm-i386/acpi.h	2003-09-21 13:22:33.000000000 -0700
@@ -106,12 +106,6 @@
         :"0"(n_hi), "1"(n_lo))
 
 
-#ifdef CONFIG_ACPI_HT_ONLY
-extern int acpi_lapic;
-#define acpi_ioapic 0
-
-#else /* CONFIG_ACPI_HT_ONLY */
-
 #ifdef CONFIG_ACPI_BOOT 
 extern int acpi_lapic;
 extern int acpi_ioapic;
@@ -144,7 +138,6 @@
 #  define acpi_ioapic 0
 
 #endif
-#endif /* !CONFIG_ACPI_HT_ONLY */
 
 #ifdef CONFIG_ACPI_SLEEP
 
diff -urN linux-2.4.23-pre4/include/asm-ppc/ucontext.h linux-2.4.23-pre5/include/asm-ppc/ucontext.h
--- linux-2.4.23-pre4/include/asm-ppc/ucontext.h	2003-09-21 13:22:27.000000000 -0700
+++ linux-2.4.23-pre5/include/asm-ppc/ucontext.h	2003-09-21 13:22:34.000000000 -0700
@@ -16,12 +16,11 @@
 	struct ucontext *uc_link;
 	stack_t		 uc_stack;
 	int		 uc_pad[7];
-	struct mcontext	*uc_regs;	/* backward compat */
-	sigset_t	 uc_oldsigmask;	/* backward compat */
-	int		 uc_pad2;
+	struct mcontext	*uc_regs;	/* points to uc_mcontext field */
 	sigset_t	 uc_sigmask;
 	/* glibc has 1024-bit signal masks, ours are 64-bit */
 	int		 uc_maskext[30];
+	int		 uc_pad2[3];
 	struct mcontext	 uc_mcontext;
 };
 
diff -urN linux-2.4.23-pre4/include/asm-x86_64/msr.h linux-2.4.23-pre5/include/asm-x86_64/msr.h
--- linux-2.4.23-pre4/include/asm-x86_64/msr.h	2002-11-28 15:53:15.000000000 -0800
+++ linux-2.4.23-pre5/include/asm-x86_64/msr.h	2003-09-21 13:22:34.000000000 -0700
@@ -173,6 +173,9 @@
 
 /* VIA Cyrix defined MSRs*/
 #define MSR_VIA_FCR			0x1107
+#define MSR_VIA_LONGHAUL		0x110a
+#define MSR_VIA_RNG			0x110b
+#define MSR_VIA_BCR2			0x1147
 
 /* Intel defined MSRs. */
 #define MSR_IA32_P5_MC_ADDR		0
diff -urN linux-2.4.23-pre4/include/linux/acpi.h linux-2.4.23-pre5/include/linux/acpi.h
--- linux-2.4.23-pre4/include/linux/acpi.h	2003-08-25 04:44:44.000000000 -0700
+++ linux-2.4.23-pre5/include/linux/acpi.h	2003-09-21 13:22:34.000000000 -0700
@@ -369,16 +369,10 @@
 
 #else /*!CONFIG_ACPI_BOOT*/
 
-#ifdef	CONFIG_ACPI_HT_ONLY
-int acpi_boot_init (void);
-
-#else /* !CONFIG_ACPI_HT_ONLY */
-
 static inline int acpi_boot_init(void)
 {
 	return 0;
 }
-#endif	/* !CONFIG_ACPI_HT_ONLY */
 
 #endif /*!CONFIG_ACPI_BOOT*/
 
diff -urN linux-2.4.23-pre4/include/linux/agp_backend.h linux-2.4.23-pre5/include/linux/agp_backend.h
--- linux-2.4.23-pre4/include/linux/agp_backend.h	2003-09-21 13:22:27.000000000 -0700
+++ linux-2.4.23-pre5/include/linux/agp_backend.h	2003-09-21 13:22:34.000000000 -0700
@@ -57,6 +57,7 @@
 	INTEL_I865_G,
 	INTEL_I7205,
 	INTEL_I7505,
+	INTEL_460GX,
 	VIA_GENERIC,
 	VIA_VP3,
 	VIA_MVP3,
diff -urN linux-2.4.23-pre4/include/linux/netdevice.h linux-2.4.23-pre5/include/linux/netdevice.h
--- linux-2.4.23-pre4/include/linux/netdevice.h	2003-09-21 13:22:27.000000000 -0700
+++ linux-2.4.23-pre5/include/linux/netdevice.h	2003-09-21 13:22:34.000000000 -0700
@@ -49,6 +49,7 @@
 
 #define HAVE_ALLOC_NETDEV		/* feature macro: alloc_xxxdev
 					   functions are available. */
+#define HAVE_FREE_NETDEV
 
 #define NET_XMIT_SUCCESS	0
 #define NET_XMIT_DROP		1	/* skb dropped			*/
@@ -871,6 +872,10 @@
 extern void		dev_clear_fastroute(struct net_device *dev);
 #endif
 
+static inline void free_netdev(struct net_device *dev)
+{
+	kfree(dev);
+}
 
 #endif /* __KERNEL__ */
 
diff -urN linux-2.4.23-pre4/include/linux/proc_fs.h linux-2.4.23-pre5/include/linux/proc_fs.h
--- linux-2.4.23-pre4/include/linux/proc_fs.h	2002-08-02 17:39:45.000000000 -0700
+++ linux-2.4.23-pre5/include/linux/proc_fs.h	2003-09-21 13:22:34.000000000 -0700
@@ -209,4 +209,9 @@
 
 #endif /* CONFIG_PROC_FS */
 
+static inline struct proc_dir_entry *PDE(const struct inode *inode)
+{
+	return (struct proc_dir_entry *)inode->u.generic_ip;
+}
+
 #endif /* _LINUX_PROC_FS_H */
diff -urN linux-2.4.23-pre4/mm/page_alloc.c linux-2.4.23-pre5/mm/page_alloc.c
--- linux-2.4.23-pre4/mm/page_alloc.c	2003-09-21 13:22:27.000000000 -0700
+++ linux-2.4.23-pre5/mm/page_alloc.c	2003-09-21 13:22:34.000000000 -0700
@@ -258,8 +258,6 @@
 	struct page * page = NULL;
 	int __freed;
 
-	if (!(gfp_mask & __GFP_WAIT))
-		goto out;
 	if (in_interrupt())
 		BUG();
 
@@ -512,14 +510,12 @@
 		class_idx = zone_idx(zone);
 
 		sum += zone->nr_cache_pages;
-		do {
-			unsigned int free = zone->free_pages - zone->watermarks[class_idx].high;
-			zonep++;
-			zone = *zonep;
+		for (zone = pgdat->node_zones; zone < pgdat->node_zones + MAX_NR_ZONES; zone++) {
+			int free = zone->free_pages - zone->watermarks[class_idx].high;
 			if (free <= 0)
 				continue;
 			sum += free;
-		} while (zone);
+		}
 	}
 
 	return sum;
diff -urN linux-2.4.23-pre4/mm/vmscan.c linux-2.4.23-pre5/mm/vmscan.c
--- linux-2.4.23-pre4/mm/vmscan.c	2003-09-21 13:22:27.000000000 -0700
+++ linux-2.4.23-pre5/mm/vmscan.c	2003-09-21 13:22:34.000000000 -0700
@@ -401,6 +401,8 @@
 		if (!memclass(page_zone(page), classzone))
 			continue;
 
+		max_scan--;
+
 		/* Racy check to avoid trylocking when not worthwhile */
 		if (!page->buffers && (page_count(page) != 1 || !page->mapping))
 			goto page_mapped;
diff -urN linux-2.4.23-pre4/net/core/dev.c linux-2.4.23-pre5/net/core/dev.c
--- linux-2.4.23-pre4/net/core/dev.c	2003-09-21 13:22:27.000000000 -0700
+++ linux-2.4.23-pre5/net/core/dev.c	2003-09-21 13:22:34.000000000 -0700
@@ -851,7 +851,11 @@
 	 * engine, but this requires more changes in devices. */
 
 	smp_mb__after_clear_bit(); /* Commit netif_running(). */
-	netif_poll_disable(dev);
+	while (test_bit(__LINK_STATE_RX_SCHED, &dev->state)) {
+		/* No hurry. */
+		current->state = TASK_INTERRUPTIBLE;
+		schedule_timeout(1);
+	}
 
 	/*
 	 *	Call the device specific close. This cannot fail.
diff -urN linux-2.4.23-pre4/net/ipv4/netfilter/ip_nat_amanda.c linux-2.4.23-pre5/net/ipv4/netfilter/ip_nat_amanda.c
--- linux-2.4.23-pre4/net/ipv4/netfilter/ip_nat_amanda.c	2003-08-25 04:44:44.000000000 -0700
+++ linux-2.4.23-pre5/net/ipv4/netfilter/ip_nat_amanda.c	2003-09-21 13:22:34.000000000 -0700
@@ -101,7 +101,7 @@
 	struct ip_conntrack_expect *exp = expect;
 	struct ip_ct_amanda_expect *ct_amanda_info = &exp->help.exp_amanda_info;
 	struct ip_conntrack_tuple t = exp->tuple;
-	int port;
+	u_int16_t port;
 
 	MUST_BE_LOCKED(&ip_amanda_lock);
 
@@ -115,7 +115,7 @@
 	   writable */
 
 	t.dst.ip = newip;
-	for (port = ct_amanda_info->port + 10; port != 0; port++) {
+	for (port = ct_amanda_info->port; port != 0; port++) {
 		t.dst.u.tcp.port = htons(port);
 		if (ip_conntrack_change_expect(exp, &t) == 0)
 			break;
diff -urN linux-2.4.23-pre4/net/ipv4/netfilter/ip_nat_irc.c linux-2.4.23-pre5/net/ipv4/netfilter/ip_nat_irc.c
--- linux-2.4.23-pre4/net/ipv4/netfilter/ip_nat_irc.c	2003-08-25 04:44:44.000000000 -0700
+++ linux-2.4.23-pre5/net/ipv4/netfilter/ip_nat_irc.c	2003-09-21 13:22:34.000000000 -0700
@@ -99,7 +99,7 @@
 	struct ip_conntrack_tuple t;
 	struct iphdr *iph = (*pskb)->nh.iph;
 	struct tcphdr *tcph = (void *) iph + iph->ihl * 4;
-	int port;
+	u_int16_t port;
 
 	/* "4294967296 65635 " */
 	char buffer[18];
diff -urN linux-2.4.23-pre4/net/sunrpc/svcsock.c linux-2.4.23-pre5/net/sunrpc/svcsock.c
--- linux-2.4.23-pre4/net/sunrpc/svcsock.c	2003-09-21 13:22:27.000000000 -0700
+++ linux-2.4.23-pre5/net/sunrpc/svcsock.c	2003-09-21 13:22:34.000000000 -0700
@@ -317,9 +317,9 @@
 	struct svc_sock	*svsk = rqstp->rq_sock;
 	struct socket	*sock = svsk->sk_sock;
 	struct msghdr	msg;
-	struct { struct cmsghdr cmh;
-		struct in_pktinfo pki;
-	} cm;
+	char 		buffer[CMSG_SPACE(sizeof(struct in_pktinfo))];
+	struct cmsghdr *cmh = (struct cmsghdr *)buffer;
+	struct in_pktinfo *pki = (struct in_pktinfo *)CMSG_DATA(cmh);
 	int		i, buflen, len;
 
 	for (i = buflen = 0; i < nr; i++)
@@ -330,13 +330,13 @@
 	msg.msg_iov     = iov;
 	msg.msg_iovlen  = nr;
 	if (rqstp->rq_prot == IPPROTO_UDP) {
-		msg.msg_control = &cm;
-		msg.msg_controllen = sizeof(cm);
-		cm.cmh.cmsg_len = sizeof(cm);
-		cm.cmh.cmsg_level = SOL_IP;
-		cm.cmh.cmsg_type = IP_PKTINFO;
-		cm.pki.ipi_ifindex = 0;
-		cm.pki.ipi_spec_dst.s_addr = rqstp->rq_daddr;
+		msg.msg_control = cmh;
+		msg.msg_controllen = sizeof(buffer);
+		cmh->cmsg_len = CMSG_LEN(sizeof(*pki));
+		cmh->cmsg_level = SOL_IP;
+		cmh->cmsg_type = IP_PKTINFO;
+		pki->ipi_ifindex = 0;
+		pki->ipi_spec_dst.s_addr = rqstp->rq_daddr;
 	} else {
 		msg.msg_control = NULL;
 		msg.msg_controllen = 0;
