# This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet v2.4.27-pre2 -> 1.1393 # arch/sh64/kernel/pci_sh5.c 1.2 -> 1.3 # include/linux/acpi.h 1.20 -> 1.21 # include/linux/kernel.h 1.22 -> 1.23 # include/net/sctp/constants.h 1.7 -> 1.8 # drivers/acpi/pci_root.c 1.6 -> 1.8 # arch/sh64/mach-cayman/setup.c 1.1 -> 1.2 # include/asm-i386/acpi.h 1.16 -> 1.17 # drivers/char/amd7xx_tco.c 1.2 -> (deleted) # arch/sh64/lib/io.c 1.2 -> 1.3 # drivers/acpi/toshiba_acpi.c 1.9 -> 1.11 # drivers/media/video/videodev.c 1.17 -> 1.18 # Documentation/cciss.txt 1.11 -> 1.12 # drivers/acpi/fan.c 1.5 -> 1.6 # fs/jfs/namei.c 1.22 -> 1.23 # drivers/acpi/tables.c 1.13 -> 1.14 # include/asm-sh64/registers.h 1.2 -> 1.3 # include/asm-sh64/processor.h 1.3 -> 1.4 # arch/x86_64/kernel/setup.c 1.12 -> 1.13 # drivers/char/Config.in 1.65 -> 1.66 # fs/jfs/jfs_txnmgr.c 1.33 -> 1.34 # drivers/pci/pci.c 1.48 -> 1.49 # include/asm-sh64/io.h 1.2 -> 1.3 # arch/i386/kernel/mpparse.c 1.47 -> 1.49 # arch/x86_64/kernel/mpparse.c 1.13 -> 1.15 # drivers/char/tipar.c 1.4 -> 1.5 # include/asm-sh64/keyboard.h 1.1 -> 1.2 # arch/i386/kernel/io_apic.c 1.34 -> 1.36 # arch/sh64/vmlinux.lds.S 1.1 -> 1.2 # arch/x86_64/kernel/e820.c 1.20 -> 1.21 # arch/sh64/kernel/head.S 1.1 -> 1.2 # net/sctp/associola.c 1.8 -> 1.10 # arch/i386/kernel/pci-pc.c 1.35 -> 1.37 # include/net/sctp/user.h 1.4 -> 1.5 # arch/sh64/mm/cache.c 1.2 -> 1.3 # drivers/acpi/processor.c 1.16 -> 1.17 # arch/x86_64/kernel/i8259.c 1.3 -> 1.4 # drivers/acpi/bus.c 1.24 -> 1.28 # drivers/acpi/thermal.c 1.11 -> 1.12 # include/asm-sh64/cayman.h 1.1 -> 1.2 # drivers/acpi/asus_acpi.c 1.7 -> 1.8 # arch/sh64/kernel/entry.S 1.2 -> 1.3 # fs/ext2/super.c 1.11 -> 1.12 # arch/x86_64/kernel/pci-pc.c 1.8 -> 1.9 # include/asm-x86_64/acpi.h 1.13 -> 1.14 # arch/sh64/kernel/time.c 1.3 -> 1.4 # arch/sh64/mach-cayman/irq.c 1.3 -> 1.4 # drivers/scsi/scsi_scan.c 1.35 -> 1.36 # drivers/acpi/battery.c 1.7 -> 1.9 # drivers/acpi/button.c 1.9 -> 1.12 # fs/jfs/jfs_dtree.c 1.16 -> 1.17 # drivers/acpi/ac.c 1.5 -> 1.6 # arch/i386/kernel/acpi.c 1.28 -> 1.31 # include/asm-sh64/unistd.h 1.1 -> 1.2 # drivers/acpi/Config.in 1.17 -> 1.19 # arch/x86_64/kernel/io_apic.c 1.9 -> 1.11 # net/sctp/crc32c.c 1.1 -> 1.2 # arch/i386/kernel/i8259.c 1.4 -> 1.5 # arch/sh64/defconfig 1.6 -> 1.7 # drivers/char/Makefile 1.42 -> 1.43 # drivers/acpi/Makefile 1.17 -> 1.18 # arch/x86_64/kernel/acpi.c 1.16 -> 1.20 # drivers/block/cciss.c 1.45 -> 1.46 # drivers/acpi/pci_irq.c 1.15 -> 1.16 # arch/sh64/config.in 1.11 -> 1.13 # drivers/acpi/pci_link.c 1.14 -> 1.16 # Documentation/kernel-parameters.txt 1.15 -> 1.16 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 04/05/03 marcelo@logos.cnet 1.1378 # Changed EXTRAVERSION to -pre2 # -------------------------------------------- # 04/05/03 davem@nuts.davemloft.net 1.1366.1.2 # Merge http://linux-lksctp.bkbits.net/lksctp-2.4.work # into nuts.davemloft.net:/disk1/BK/net-2.4 # -------------------------------------------- # 04/05/03 davem@kernel.bkbits.net 1.1379 # Merge davem@nuts.davemloft.net:/disk1/BK/net-2.4 # into kernel.bkbits.net:/home/davem/net-2.4 # -------------------------------------------- # 04/05/04 ross@datscreative.com.au 1.1380 # [PATCH] nVidia supplied nForce2 workaround # # * Fixup for C1 Halt Disconnect problem on nForce2 systems. # * # * From information provided by "Allen Martin" : # * # * A hang is caused when the CPU generates a very fast CONNECT/HALT cycle # * sequence. Workaround is to set the SYSTEM_IDLE_TIMEOUT to 80 ns. # * This allows the state-machine and timer to return to a proper state within # * 80 ns of the CONNECT and probe appearing together. Since the CPU will not # * issue another HALT within 80 ns of the initial HALT, the failure condition # * is avoided. # -------------------------------------------- # 04/05/04 len.brown@intel.com 1.1359.6.13 # [ACPI] export symbols to button module # -------------------------------------------- # 04/05/04 zwane@linuxpower.ca 1.1381 # [PATCH] remove amd7(saucy)_tco # # This driver has already been removed in 2.6, essentially we've had # problems getting it working (it's been a while now) with a lot of boards, # all seems to be alright until the actual point where the hardware is # supposed to reset the system. So lets just back it out. # # It applies to -bk # # Index: linux-2.4.26/drivers/char/Config.in # =================================================================== # RCS file: /home/cvsroot/linux-2.4.26/drivers/char/Config.in,v # retrieving revision 1.1.1.1 # -------------------------------------------- # 04/05/04 marcelo@logos.cnet 1.1382 # Delete: drivers/char/amd7xx_tco.c # -------------------------------------------- # 04/05/04 len.brown@intel.com 1.1359.6.14 # [ACPI] PCI Interrupt Link fixes # # Handle BIOS that reference disabled PCI Interrupt Link Devices # http://bugme.osdl.org/show_bug.cgi?id=1581 # # Clean up VIA _CRS = 0 BIOS workaround # # Handle BIOS returning _CRS outside _PRS # http://bugme.osdl.org/show_bug.cgi?id=2567 # # delete now unused _SRS retry code # -------------------------------------------- # 04/05/04 len.brown@intel.com 1.1359.6.15 # [ACPI] rmmod ACPI modules vs /proc # from Anil S Keshavamurthy and David Shaohua Li # http://bugzilla.kernel.org/show_bug.cgi?id=2457 # -------------------------------------------- # 04/05/04 shaggy@austin.ibm.com 1.1359.16.2 # JFS: [CHECKER] Memory leak in jfs_link # -------------------------------------------- # 04/05/04 shaggy@austin.ibm.com 1.1359.16.3 # JFS: [CHECKER] get rid of txAbortCommit # # txAbortCommit is broken and fixing it makes it equivalent to txAbort, # so get rid of it and use txAbort instead. # -------------------------------------------- # 04/05/04 shaggy@austin.ibm.com 1.1383 # Merge jfs@jfs.bkbits.net:linux-2.4 # into austin.ibm.com:/shaggy/bk/jfs-2.4 # -------------------------------------------- # 04/05/04 Richard.Curnow@superh.com 1.1382.1.1 # [PATCH] Patch [sh64]: Fix liveness dependency constraints in _syscalln() # # This patch was created by Sean McGoogan : # # [sh64] Bug fix: add clearer (more explicit) liveness dependency # constraints to _syscalln() assembler inline functions, to stop more # aggressive compiler optimisers passing the arguments pertaining to the # TRAPA in arbitrary registers. This is an essential bug fix for sh64, to # remove some dangerous congenital assumptions in the register # assignments. # -------------------------------------------- # 04/05/04 Richard.Curnow@superh.com 1.1382.1.2 # [PATCH] Fix Cayman PCI IRQ routing for PCI cards containing bridges # # This patch is against 2.4.26 and fixes the handling of PCI interrupts on # the Cayman board when PCI cards containing PCI bridges are plugged in. # -------------------------------------------- # 04/05/04 Richard.Curnow@superh.com 1.1382.1.3 # [PATCH] Patch [sh64]: Fix approach for calibrating CPU MHz so it works even if the I-cache is disabled. # # the subject line says it all. # -------------------------------------------- # 04/05/04 Richard.Curnow@superh.com 1.1382.1.4 # [PATCH] Patch [sh64]: Clean-up handling of the SR.WATCH bit # # [sh64] Add a new config option to selectively enable the SR.WATCH bit # during boot. If enabled, the bit remains set in SR in both kernel and # user mode. It allows hardware watchpoints and tracing to be set up and # used across the debug link to help in diagnosing problems. # -------------------------------------------- # 04/05/04 Richard.Curnow@superh.com 1.1382.1.5 # [PATCH] Patch [sh64]: Remove obsolete CONFIG_UNCACHED_MEMORY_OFFSET option # # [sh64] Remove refs to obsolete CONFIG_UNCACHED_MEMORY_OFFSET option # -------------------------------------------- # 04/05/04 Richard.Curnow@superh.com 1.1382.1.6 # [PATCH] Patch [sh64]: clean-up to allow building on Cayman board without configuring PCI support # # [sh64] Decouple io_addr handling to allow building for Cayman without # supporting PCI. Tidy up naming + comments to emphasize when entities # relate to the Cayman SMSC SuperIO chip (as distinct from the SMSC LAN # controller chip.) # -------------------------------------------- # 04/05/04 Richard.Curnow@superh.com 1.1382.1.7 # [PATCH] Patch [sh64]: Handle base of RAM not being 512Mb aligned # # [sh64] Allow base of RAM to be other than 512Mb-aligned. (Align the # base address down when creating the kernel's superpage entries in the # ITLB and DTLB). # -------------------------------------------- # 04/05/04 Richard.Curnow@superh.com 1.1382.1.8 # [PATCH] Patch [sh64]: Allow greater choice over the effective address at which the kernel runs # # [sh64] Modify the reserved effective addresses used by the cache # coherency functions to allow more choice in the the effective address at # which the kernel itself is executed. # -------------------------------------------- # 04/05/04 marcelo@logos.cnet 1.1384 # Merge http://jfs.bkbits.net/linux-2.4 # into logos.cnet:/home/marcelo/bk/linux-2.4 # -------------------------------------------- # 04/05/04 achurch@achurch.org 1.1385 # [PATCH] ext2fs sb= mount option fix # # The following patch fixes a bug in the processing of the sb= # (alternate superblock) mount option for ext2: for devices with 1024-byte # blocks, the value from the option is never actually used. # -------------------------------------------- # 04/05/05 m.c.p@kernel.linux-systeme.com 1.1386 # [PATCH] copy WARN_ON() definition from 2.6 # # -------------------------------------------- # 04/05/05 len.brown@intel.com 1.1382.1.9 # Merge intel.com:/home/lenb/bk/linux-2.4.27 # into intel.com:/home/lenb/src/linux-acpi-test-2.4.27 # -------------------------------------------- # 04/05/06 chad.dupuis@hp.com 1.1387 # [PATCH] Fix HP HSG80 storage array entry on SCSI device list # # -------------------------------------------- # 04/05/06 len.brown@intel.com 1.1359.6.16 # [ACPI] enhance "pci=noacpi" to skip PCI probe (David Shaohua Li) # add "acpi=noirq" to just disable IRQ config # http://bugzilla.kernel.org/show_bug.cgi?id=1662 # -------------------------------------------- # 04/05/06 len.brown@intel.com 1.1388 # Merge intel.com:/home/lenb/bk/linux-2.4.27 # into intel.com:/home/lenb/src/linux-acpi-test-2.4.27 # -------------------------------------------- # 04/05/06 len.brown@intel.com 1.1359.6.17 # [ACPI] parse ACPI MCFG table and set pci_mmcfg_base_addr # from 2.6 via Sundar/Dely Sy # -------------------------------------------- # 04/05/06 len.brown@intel.com 1.1389 # Merge intel.com:/home/lenb/src/linux-acpi-test-2.4.26 # into intel.com:/home/lenb/src/linux-acpi-test-2.4.27 # -------------------------------------------- # 04/05/07 marcelo@logos.cnet 1.1390 # Matt Domsch: Lower printk severity for PCI devices with no PCI_CACHE_LINE_SIZE implemented # -------------------------------------------- # 04/05/07 kraxel@bytesex.org 1.1391 # [PATCH] Fix V4L miss of range check oops # # > I caused an oops in unusual circumstances by accidentally "forcing" a # > video device number which was too high or already taken (don't know # > which). # # Fixed by adding a range check for the number passed in by the driver. # -------------------------------------------- # 04/05/08 mikem@beardog.cca.cpqcorp.net 1.1392 # [PATCH] cciss update: support for two new controllers # # This patch adds support for 2 new controllers. One is 6422, a PCI-Express version of the 6400. The other is a SATA controller that uses the cciss interface. # This controller is also the first Smart Array to use the HP vendor ID. # Please consider this for inclusion. # # Thanks, # mikem # -------------------------------------------- # 04/05/08 lkml@lievin.net 1.1393 # [PATCH] tipar char driver: wrong timeout value # # -------------------------------------------- # diff -Nru a/Documentation/cciss.txt b/Documentation/cciss.txt --- a/Documentation/cciss.txt Sun May 9 15:31:35 2004 +++ b/Documentation/cciss.txt Sun May 9 15:31:35 2004 @@ -14,6 +14,8 @@ * SA 6400 * SA 6400 U320 Expansion Module * SA 6i + * SA 6422 + * SA V100 If nodes are not already created in the /dev/cciss directory diff -Nru a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt --- a/Documentation/kernel-parameters.txt Sun May 9 15:31:35 2004 +++ b/Documentation/kernel-parameters.txt Sun May 9 15:31:35 2004 @@ -69,8 +69,9 @@ 53c7xx= [HW,SCSI] Amiga SCSI controllers. acpi= [HW,ACPI] Advanced Configuration and Power Interface - force Force ACPI on, even if blacklisted platform - off Disable ACPI + force Enable ACPI if default was off + off Disable ACPI if default was on + noirq Do not use ACPI for IRQ routing (see pci=noacpi) ht Limit ACPI to boot-time LAPIC enumeration for HT, disabling the run-time AML interpreter. strict Be less tolerant of platforms that are not diff -Nru a/arch/i386/kernel/acpi.c b/arch/i386/kernel/acpi.c --- a/arch/i386/kernel/acpi.c Sun May 9 15:31:35 2004 +++ b/arch/i386/kernel/acpi.c Sun May 9 15:31:35 2004 @@ -59,7 +59,10 @@ Boot-time Configuration -------------------------------------------------------------------------- */ -int acpi_noirq __initdata = 0; /* skip ACPI IRQ initialization */ +#ifdef CONFIG_ACPI_PCI +int acpi_noirq __initdata; /* skip ACPI IRQ initialization */ +int acpi_pci_disabled __initdata; /* skip ACPI PCI scan and IRQ initialization */ +#endif int acpi_ht __initdata = 1; /* enable HT */ enum acpi_irq_model_id acpi_irq_model; @@ -105,6 +108,35 @@ return ((unsigned char *) base + offset); } +#ifdef CONFIG_ACPI_MMCONFIG + +u32 pci_mmcfg_base_addr; + +static int __init +acpi_parse_mcfg(unsigned long phys_addr, + unsigned long size) +{ + struct acpi_table_mcfg *mcfg = NULL; + + if (!phys_addr || !size) + return -EINVAL; + + mcfg = (struct acpi_table_mcfg *) __acpi_map_table(phys_addr, size); + if (!mcfg) { + printk(KERN_WARNING PREFIX "Unable to map MCFG\n"); + return -ENODEV; + } + + if (mcfg->base_reserved) { + printk(KERN_ERR PREFIX "MMCONFIG not in low 4GB of memory\n"); + return -ENODEV; + } + + pci_mmcfg_base_addr = mcfg->base_address; + + return 0; +} +#endif /* CONFIG_ACPI_MMCONFIG */ #ifdef CONFIG_X86_LOCAL_APIC @@ -406,6 +438,15 @@ return result; } +#ifdef CONFIG_ACPI_MMCONFIG + result = acpi_table_parse(ACPI_MCFG, acpi_parse_mcfg); + if (result < 0) { + printk(KERN_ERR PREFIX "Error %d parsing MCFG\n", result); + } else if (result > 1) { + printk(KERN_WARNING PREFIX "Multiple MCFG tables exist\n"); + } +#endif + #ifdef CONFIG_X86_LOCAL_APIC /* @@ -502,9 +543,6 @@ return result; } - /* Build a default routing table for legacy (ISA) interrupts. */ - mp_config_acpi_legacy_irqs(); - /* Record sci_int for use when looking for MADT sci_int override */ acpi_table_parse(ACPI_FADT, acpi_parse_fadt); @@ -521,6 +559,9 @@ */ if (!acpi_sci_override_gsi) acpi_sci_ioapic_setup(acpi_fadt.sci_int, 0, 0); + + /* Fill in identity legacy mapings where no override */ + mp_config_acpi_legacy_irqs(); result = acpi_table_parse_madt(ACPI_MADT_NMI_SRC, acpi_parse_nmi_src); if (result < 0) { diff -Nru a/arch/i386/kernel/i8259.c b/arch/i386/kernel/i8259.c --- a/arch/i386/kernel/i8259.c Sun May 9 15:31:35 2004 +++ b/arch/i386/kernel/i8259.c Sun May 9 15:31:35 2004 @@ -12,6 +12,7 @@ #include #include +#include #include #include #include @@ -498,7 +499,8 @@ outb(LATCH >> 8 , 0x40); /* MSB */ #ifndef CONFIG_VISWS - setup_irq(2, &irq2); + if (!acpi_ioapic) + setup_irq(2, &irq2); #endif /* diff -Nru a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c --- a/arch/i386/kernel/io_apic.c Sun May 9 15:31:35 2004 +++ b/arch/i386/kernel/io_apic.c Sun May 9 15:31:35 2004 @@ -1691,18 +1691,10 @@ /* * - * IRQ's that are handled by the old PIC in all cases: + * IRQ's that are handled by the PIC in the MPS IOAPIC case. * - IRQ2 is the cascade IRQ, and cannot be a io-apic IRQ. * Linux doesn't really care, as it's not actually used * for any interrupt handling anyway. - * - There used to be IRQ13 here as well, but all - * MPS-compliant must not use it for FPU coupling and we - * want to use exception 16 anyway. And there are - * systems who connect it to an I/O APIC for other uses. - * Thus we don't mark it special any longer. - * - * Additionally, something is definitely wrong with irq9 - * on PIIX4 boards. */ #define PIC_IRQS (1<<2) @@ -1710,7 +1702,11 @@ { enable_IO_APIC(); - io_apic_irqs = ~PIC_IRQS; + if (acpi_ioapic) + io_apic_irqs = ~0; /* all IRQs go through IOAPIC */ + else + io_apic_irqs = ~PIC_IRQS; + printk("ENABLING IO-APIC IRQs\n"); /* @@ -1872,7 +1868,7 @@ entry.vector = assign_irq_vector(irq); - printk(KERN_DEBUG "IOAPIC[%d]: Set PCI routing entry (%d-%d -> 0x%x -> " + Dprintk(KERN_DEBUG "IOAPIC[%d]: Set PCI routing entry (%d-%d -> 0x%x -> " "IRQ %d Mode:%i Active:%i)\n", ioapic, mp_ioapics[ioapic].mpc_apicid, pin, entry.vector, irq, edge_level, active_high_low); diff -Nru a/arch/i386/kernel/mpparse.c b/arch/i386/kernel/mpparse.c --- a/arch/i386/kernel/mpparse.c Sun May 9 15:31:35 2004 +++ b/arch/i386/kernel/mpparse.c Sun May 9 15:31:35 2004 @@ -1111,8 +1111,6 @@ u32 global_irq) { struct mpc_config_intsrc intsrc; - int i = 0; - int found = 0; int ioapic = -1; int pin = -1; @@ -1145,23 +1143,9 @@ (intsrc.mpc_irqflag >> 2) & 3, intsrc.mpc_srcbus, intsrc.mpc_srcbusirq, intsrc.mpc_dstapic, intsrc.mpc_dstirq); - /* - * If an existing [IOAPIC.PIN -> IRQ] routing entry exists we override it. - * Otherwise create a new entry (e.g. global_irq == 2). - */ - for (i = 0; i < mp_irq_entries; i++) { - if ((mp_irqs[i].mpc_srcbus == intsrc.mpc_srcbus) - && (mp_irqs[i].mpc_srcbusirq == intsrc.mpc_srcbusirq)) { - mp_irqs[i] = intsrc; - found = 1; - break; - } - } - if (!found) { - mp_irqs[mp_irq_entries] = intsrc; - if (++mp_irq_entries == MAX_IRQ_SOURCES) - panic("Max # of irq sources exceeded!\n"); - } + mp_irqs[mp_irq_entries] = intsrc; + if (++mp_irq_entries == MAX_IRQ_SOURCES) + panic("Max # of irq sources exceeded!\n"); return; } @@ -1206,13 +1190,19 @@ return; /* - * Use the default configuration for the IRQs 0-15. These may be + * Use the default configuration for the IRQs 0-15. Unless * overriden by (MADT) interrupt source override entries. */ for (i = 0; i < 16; i++) { + int idx; - if (i == 2) - continue; /* Don't connect IRQ2 */ + for (idx = 0; idx < mp_irq_entries; idx++) + if (mp_irqs[idx].mpc_srcbus == MP_ISA_BUS && + (mp_irqs[idx].mpc_srcbusirq == i || + mp_irqs[idx].mpc_dstirq == i)) + break; + if (idx != mp_irq_entries) + continue; /* IRQ already used */ mp_irqs[mp_irq_entries].mpc_type = MP_INTSRC; mp_irqs[mp_irq_entries].mpc_irqflag = 0; /* Conforming */ @@ -1308,11 +1298,13 @@ if (!io_apic_set_pci_routing(ioapic, ioapic_pin, irq, edge_level, active_high_low)) entry->irq = irq; - printk(KERN_DEBUG "%02x:%02x:%02x[%c] -> %d-%d -> IRQ %d\n", - entry->id.segment, entry->id.bus, - entry->id.device, ('A' + entry->pin), - mp_ioapic_routing[ioapic].apic_id, ioapic_pin, - entry->irq); + printk(KERN_DEBUG "%02x:%02x:%02x[%c] -> %d-%d" + " -> IRQ %d %s %s\n", entry->id.segment, entry->id.bus, + entry->id.device, ('A' + entry->pin), + mp_ioapic_routing[ioapic].apic_id, ioapic_pin, + entry->irq, edge_level ? "level" : "edge", + active_high_low ? "low" : "high"); + } print_IO_APIC(); diff -Nru a/arch/i386/kernel/pci-pc.c b/arch/i386/kernel/pci-pc.c --- a/arch/i386/kernel/pci-pc.c Sun May 9 15:31:35 2004 +++ b/arch/i386/kernel/pci-pc.c Sun May 9 15:31:35 2004 @@ -1328,6 +1328,39 @@ dev->transparent = 1; } +/* + * Fixup for C1 Halt Disconnect problem on nForce2 systems. + * + * From information provided by "Allen Martin" : + * + * A hang is caused when the CPU generates a very fast CONNECT/HALT cycle + * sequence. Workaround is to set the SYSTEM_IDLE_TIMEOUT to 80 ns. + * This allows the state-machine and timer to return to a proper state within + * 80 ns of the CONNECT and probe appearing together. Since the CPU will not + * issue another HALT within 80 ns of the initial HALT, the failure condition + * is avoided. + */ +static void __devinit pci_fixup_nforce2(struct pci_dev *dev) +{ + u32 val, fixed_val; + u8 rev; + + pci_read_config_byte(dev, PCI_REVISION_ID, &rev); + + /* + * Chip Old value New value + * C17 0x1F01FF01 0x1F0FFF01 + * C18D 0x9F01FF01 0x9F0FFF01 + */ + fixed_val = rev < 0xC1 ? 0x1F01FF01 : 0x9F01FF01; + + pci_read_config_dword(dev, 0x6c, &val); + if (val != fixed_val) { + printk(KERN_WARNING "PCI: nForce2 C1 Halt Disconnect fixup\n"); + pci_write_config_dword(dev, 0x6c, fixed_val); + } +} + struct pci_fixup pcibios_fixups[] = { { PCI_FIXUP_HEADER, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82451NX, pci_fixup_i450nx }, { PCI_FIXUP_HEADER, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82454GX, pci_fixup_i450gx }, @@ -1343,6 +1376,7 @@ { PCI_FIXUP_HEADER, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8367_0, pci_fixup_via_northbridge_bug }, { PCI_FIXUP_HEADER, PCI_VENDOR_ID_NCR, PCI_DEVICE_ID_NCR_53C810, pci_fixup_ncr53c810 }, { PCI_FIXUP_HEADER, PCI_VENDOR_ID_INTEL, PCI_ANY_ID, pci_fixup_transparent_bridge }, + { PCI_FIXUP_HEADER, PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2, pci_fixup_nforce2}, { 0 } }; @@ -1433,7 +1467,6 @@ if (!acpi_noirq && !acpi_pci_irq_init()) { pci_using_acpi_prt = 1; printk(KERN_INFO "PCI: Using ACPI for IRQ routing\n"); - printk(KERN_INFO "PCI: if you experience problems, try using option 'pci=noacpi' or even 'acpi=off'\n"); } #endif if (!pci_using_acpi_prt) { diff -Nru a/arch/sh64/config.in b/arch/sh64/config.in --- a/arch/sh64/config.in Sun May 9 15:31:35 2004 +++ b/arch/sh64/config.in Sun May 9 15:31:35 2004 @@ -58,8 +58,7 @@ # Use 32-bit addressing for now. # EMI based. -# P2 (UNCACHED) required to use identity mapping -# P1 (CACHED) assumes non-identity. +# (CACHED) assumes non-identity. # # Memory options @@ -68,7 +67,6 @@ int 'Memory size (in MB)' CONFIG_MEMORY_SIZE_IN_MB 64 hex 'Cached Area Offset' CONFIG_CACHED_MEMORY_OFFSET 20000000 -hex 'Uncached Area Offset' CONFIG_UNCACHED_MEMORY_OFFSET 00000000 hex 'Physical memory start address' CONFIG_MEMORY_START 80000000 # @@ -304,6 +302,7 @@ bool "Debug: audit page tables on return from syscall/exception/interrupt" CONFIG_SH64_PAGE_TABLE_AUDIT dep_bool "Debug: report TLB fill/purge activity through /proc/tlb" CONFIG_SH64_PROC_TLB $CONFIG_PROC_FS dep_bool "Debug: report ASIDS through /proc/asids" CONFIG_SH64_PROC_ASIDS $CONFIG_PROC_FS +bool "Debug: set SR.WATCH to enable hardware watchpoints and trace" CONFIG_SH64_SR_WATCH int 'Kernel messages buffer length shift (0 = default)' CONFIG_LOG_BUF_SHIFT 0 diff -Nru a/arch/sh64/defconfig b/arch/sh64/defconfig --- a/arch/sh64/defconfig Sun May 9 15:31:35 2004 +++ b/arch/sh64/defconfig Sun May 9 15:31:35 2004 @@ -490,6 +490,7 @@ # CONFIG_SH64_PAGE_TABLE_AUDIT is not set # CONFIG_SH64_PROC_TLB is not set # CONFIG_SH64_PROC_ASIDS is not set +# CONFIG_SH64_SR_WATCH is not set # # Library routines diff -Nru a/arch/sh64/kernel/entry.S b/arch/sh64/kernel/entry.S --- a/arch/sh64/kernel/entry.S Sun May 9 15:31:35 2004 +++ b/arch/sh64/kernel/entry.S Sun May 9 15:31:35 2004 @@ -1607,12 +1607,6 @@ shlli r36, 31, r36 andc r1, r36, r1 /* turn sr.mmu off in real mode section */ - /* Bodge : force sr.watch high on return. Can't understand why else this - isn't happening. */ - movi 1, r38 - shlli r38, 26, r38 - or r38, r0, r0 - putcon r1, ssr _loada .poke0-CONFIG_CACHED_MEMORY_OFFSET, r36 /* real mode target address */ _loada 1f, r37 /* virtual mode return addr */ diff -Nru a/arch/sh64/kernel/head.S b/arch/sh64/kernel/head.S --- a/arch/sh64/kernel/head.S Sun May 9 15:31:35 2004 +++ b/arch/sh64/kernel/head.S Sun May 9 15:31:35 2004 @@ -37,18 +37,29 @@ #define MMUDR_END DTLB_LAST_VAR_UNRESTRICTED+TLB_STEP #define MMUDR_STEP TLB_STEP +/* Safety check : CONFIG_CACHED_MEMORY_OFFSET has to be a multiple of 512Mb */ +#if (CONFIG_CACHED_MEMORY_OFFSET & ((1UL<<29)-1)) +#error "CONFIG_CACHED_MEMORY_OFFSET must be a multiple of 512Mb" +#endif + /* * MMU defines: Fixed TLBs. */ -#define MMUIR_TEXT_H 0x0000000000000003 | (CONFIG_CACHED_MEMORY_OFFSET + CONFIG_MEMORY_START) +/* Deal safely with the case where the base of RAM is not 512Mb aligned */ + +#define ALIGN_512M_MASK (0xffffffffe0000000) +#define ALIGNED_EFFECTIVE ((CONFIG_CACHED_MEMORY_OFFSET + CONFIG_MEMORY_START) & ALIGN_512M_MASK) +#define ALIGNED_PHYSICAL (CONFIG_MEMORY_START & ALIGN_512M_MASK) + +#define MMUIR_TEXT_H (0x0000000000000003 | ALIGNED_EFFECTIVE) /* Enabled, Shared, ASID 0, Eff. Add. 0xA0000000 */ -#define MMUIR_TEXT_L 0x000000000000009a | (CONFIG_MEMORY_START) +#define MMUIR_TEXT_L (0x000000000000009a | ALIGNED_PHYSICAL) /* 512 Mb, Cacheable, Write-back, execute, Not User, Ph. Add. */ -#define MMUDR_CACHED_H 0x0000000000000003 | (CONFIG_CACHED_MEMORY_OFFSET + CONFIG_MEMORY_START) +#define MMUDR_CACHED_H 0x0000000000000003 | ALIGNED_EFFECTIVE /* Enabled, Shared, ASID 0, Eff. Add. 0xA0000000 */ -#define MMUDR_CACHED_L 0x000000000000015a | (CONFIG_MEMORY_START) +#define MMUDR_CACHED_L 0x000000000000015a | ALIGNED_PHYSICAL /* 512 Mb, Cacheable, Write-back, read/write, Not User, Ph. Add. */ #ifdef CONFIG_ICACHE_DISABLED @@ -209,15 +220,19 @@ /* Map one big (512Mb) page for ITLB */ movi MMUIR_FIRST, r21 movi MMUIR_TEXT_L, r22 /* PTEL first */ + add.l r22, r63, r22 /* Sign extend */ putcfg r21, 1, r22 /* Set MMUIR[0].PTEL */ movi MMUIR_TEXT_H, r22 /* PTEH last */ + add.l r22, r63, r22 /* Sign extend */ putcfg r21, 0, r22 /* Set MMUIR[0].PTEH */ /* Map one big CACHED (512Mb) page for DTLB */ movi MMUDR_FIRST, r21 movi MMUDR_CACHED_L, r22 /* PTEL first */ + add.l r22, r63, r22 /* Sign extend */ putcfg r21, 1, r22 /* Set MMUDR[0].PTEL */ movi MMUDR_CACHED_H, r22 /* PTEH last */ + add.l r22, r63, r22 /* Sign extend */ putcfg r21, 0, r22 /* Set MMUDR[0].PTEH */ /* diff -Nru a/arch/sh64/kernel/pci_sh5.c b/arch/sh64/kernel/pci_sh5.c --- a/arch/sh64/kernel/pci_sh5.c Sun May 9 15:31:35 2004 +++ b/arch/sh64/kernel/pci_sh5.c Sun May 9 15:31:35 2004 @@ -320,43 +320,70 @@ { int result = -1; - if (dev->bus->number == 0) { - switch ((slot + (pin-1)) & 3) { - case 0: - result = IRQ_INTA; - break; - case 1: - result = IRQ_INTB; - break; - case 2: - result = IRQ_INTC; - break; - case 3: - result = IRQ_INTD; - break; - } - } - - if (dev->bus->number == 2) { - switch((slot + (pin-1)) & 3) { - case 0: - result = IRQ_P2INTA; - break; - case 1: - result = IRQ_P2INTB; - break; - case 2: - result = IRQ_P2INTC; - break; - case 3: - result = IRQ_P2INTD; - break; - } - } + /* The complication here is that the PCI IRQ lines from the Cayman's 2 + 5V slots get into the CPU via a different path from the IRQ lines + from the 3 3.3V slots. Thus, we have to detect whether the card's + interrupts go via the 5V or 3.3V path, i.e. the 'bridge swizzling' + at the point where we cross from 5V to 3.3V is not the normal case. - dprintk("map_cayman_irq for dev %d on bus %d slot %d, pin is %d : irq=%d\n", - dev->devfn,dev->bus->number,slot,pin,result); + The added complication is that we don't know that the 5V slots are + always bus 2, because a card containing a PCI-PCI bridge may be + plugged into a 3.3V slot, and this changes the bus numbering. + Also, the Cayman has an intermediate PCI bus that goes a custom + expansion board header (and to the secondary bridge). This bus has + never been used in practice. + + The 1ary onboard PCI-PCI bridge is device 3 on bus 0 + The 2ary onboard PCI-PCI bridge is device 0 on the 2ary bus of the 1ary bridge. + */ + + struct slot_pin { + int slot; + int pin; + } path[4]; + int i=0; + int base; + + while (dev->bus->number > 0) { + + slot = path[i].slot = PCI_SLOT(dev->devfn); + pin = path[i].pin = bridge_swizzle(pin, slot); + dev = dev->bus->self; + i++; + if (i > 3) panic("PCI path to root bus too long!\n"); + } + + slot = PCI_SLOT(dev->devfn); + /* This is the slot on bus 0 through which the device is eventually + reachable. */ + + /* Now work back up. */ + if ((slot < 3) || (i == 0)) { + /* Bus 0 (incl. PCI-PCI bridge itself) : perform the final + swizzle now. */ + result = IRQ_INTA + bridge_swizzle(pin, slot) - 1; + } else { + i--; + slot = path[i].slot; + pin = path[i].pin; + if (slot > 0) { + panic("PCI expansion bus device found - not handled!\n"); + } else { + if (i > 0) { + /* 5V slots */ + i--; + slot = path[i].slot; + pin = path[i].pin; + /* 'pin' was swizzled earlier wrt slot, don't do it again. */ + result = IRQ_P2INTA + (pin - 1); + } else { + /* IRQ for 2ary PCI-PCI bridge : unused */ + result = -1; + } + } + } + return result; } diff -Nru a/arch/sh64/kernel/time.c b/arch/sh64/kernel/time.c --- a/arch/sh64/kernel/time.c Sun May 9 15:31:35 2004 +++ b/arch/sh64/kernel/time.c Sun May 9 15:31:35 2004 @@ -404,13 +404,14 @@ { unsigned int count; unsigned long __dummy; - + unsigned long ctc_val_init, ctc_val; + /* ** Regardless the toolchain, force the compiler to use the ** arbitrary register r3 as a clock tick counter. ** NOTE: r3 must be in accordance with rtc_interrupt() */ - register unsigned long long __clock_tick_count __asm__ ("r3"); + register unsigned long long __rtc_irq_flag __asm__ ("r3"); sti(); do {} while (ctrl_inb(R64CNT) != 0); @@ -419,13 +420,17 @@ /* * r3 is arbitrary. CDC does not support "=z". */ + ctc_val_init = 0xffffffff; + ctc_val = ctc_val_init; + asm volatile("gettr " __t0 ", %1\n\t" + "putcon %0, cr62\n\t" "and %2, r63, %2\n\t" "_pta 4, " __t0 "\n\t" - "addi %0, 1, %0\n\t" "beq/l %2, r63, " __t0 "\n\t" "ptabs %1, " __t0 "\n\t" - : "=r"(count), "=r" (__dummy), "=r" (__clock_tick_count) + "getcon cr62, %0\n\t" + : "=r"(ctc_val), "=r" (__dummy), "=r" (__rtc_irq_flag) : "0" (0)); cli(); /* @@ -445,11 +450,13 @@ * .... * * SH-5: - * CPU clock = 2 stages * loop - * .... + * Use CTC register to count. This approach returns the right value + * even if the I-cache is disabled (e.g. whilst debugging.) * */ + count = ctc_val_init - ctc_val; /* CTC counts down */ + #if defined (CONFIG_SH_SIMULATOR) /* * Let's pretend we are a 5MHz SH-5 to avoid a too @@ -457,18 +464,13 @@ * calibration within a reasonable time. */ return 5000000; -#elif defined (CONFIG_ICACHE_DISABLED) - /* - * Let's pretend we are a 300MHz SH-5. - */ - return 300000000; #else /* * This really is count by the number of clock cycles - * per loop (2) by the ratio between a complete R64CNT + * by the ratio between a complete R64CNT * wrap-around (128) and CUI interrupt being raised (64). */ - return count*2*2; + return count*2; #endif } diff -Nru a/arch/sh64/lib/io.c b/arch/sh64/lib/io.c --- a/arch/sh64/lib/io.c Sun May 9 15:31:35 2004 +++ b/arch/sh64/lib/io.c Sun May 9 15:31:35 2004 @@ -27,17 +27,23 @@ #define dprintk(x...) -//#define io_addr(x) (((unsigned)(x) & 0x000fffff)| PCI_ST50_IO_ADDR ) - +static int io_addr(int x) { + if (x < 0x400) { #ifdef CONFIG_SH_CAYMAN -extern unsigned long smsc_virt; -extern unsigned long pciio_virt; -#define io_addr(x) ( ((x)<0x400) ? \ - (((x) << 2)|smsc_virt) : \ - ((unsigned long)(x)+pciio_virt) ) + return (x << 2) | smsc_superio_virt; #else -#define io_addr(x) ((unsigned long)(x)+pciio_virt) + panic ("Illegal access to I/O port 0x%04x\n", x); + return 0; #endif + } else { +#ifdef CONFIG_PCI + return (x + pciio_virt); +#else + panic ("Illegal access to I/O port 0x%04x\n", x); + return 0; +#endif + } +} unsigned long inb(unsigned long port) { diff -Nru a/arch/sh64/mach-cayman/irq.c b/arch/sh64/mach-cayman/irq.c --- a/arch/sh64/mach-cayman/irq.c Sun May 9 15:31:35 2004 +++ b/arch/sh64/mach-cayman/irq.c Sun May 9 15:31:35 2004 @@ -27,9 +27,12 @@ #define EPLD_STATUS_BASE (epld_virt + 0x10) #define EPLD_MASK_BASE (epld_virt + 0x20) +/* Note the SMSC SuperIO chip and SMSC LAN chip interrupts are all muxed onto + the same SH-5 interrupt */ + static void cayman_interrupt_smsc(int irq, void *dev_id, struct pt_regs *regs) { - printk(KERN_INFO "CAYMAN: spurious interrupt\n"); + printk(KERN_INFO "CAYMAN: spurious SMSC interrupt\n"); } static void cayman_interrupt_pci2(int irq, void *dev_id, struct pt_regs *regs) diff -Nru a/arch/sh64/mach-cayman/setup.c b/arch/sh64/mach-cayman/setup.c --- a/arch/sh64/mach-cayman/setup.c Sun May 9 15:31:35 2004 +++ b/arch/sh64/mach-cayman/setup.c Sun May 9 15:31:35 2004 @@ -74,7 +74,7 @@ #define ITI TOP_PRIORITY /* WDT Ints */ /* Setup for the SMSC FDC37C935 */ -#define SMSC_BASE 0x04000000 +#define SMSC_SUPERIO_BASE 0x04000000 #define SMSC_CONFIG_PORT_ADDR 0x3f0 #define SMSC_INDEX_PORT_ADDR SMSC_CONFIG_PORT_ADDR #define SMSC_DATA_PORT_ADDR 0x3f1 @@ -91,14 +91,14 @@ #define SMSC_KEYBOARD_DEVICE 7 -#define SMSC_READ_INDEXED(index) ({ \ +#define SMSC_SUPERIO_READ_INDEXED(index) ({ \ outb((index), SMSC_INDEX_PORT_ADDR); \ inb(SMSC_DATA_PORT_ADDR); }) -#define SMSC_WRITE_INDEXED(val, index) ({ \ +#define SMSC_SUPERIO_WRITE_INDEXED(val, index) ({ \ outb((index), SMSC_INDEX_PORT_ADDR); \ outb((val), SMSC_DATA_PORT_ADDR); }) -unsigned long smsc_virt; +unsigned long smsc_superio_virt; /* * Platform dependent structures: maps and parms block. @@ -145,13 +145,13 @@ RES, RES, RES, RES, RES, RES, RES, ITI, /* IRQ 56-63 */ }; -static int __init smsc_setup(void) +static int __init smsc_superio_setup(void) { unsigned char devid, devrev; - smsc_virt = onchip_remap(SMSC_BASE, 1024, "SMSC"); - if (!smsc_virt) { - panic("Unable to remap SMSC\n"); + smsc_superio_virt = onchip_remap(SMSC_SUPERIO_BASE, 1024, "SMSC SuperIO"); + if (!smsc_superio_virt) { + panic("Unable to remap SMSC SuperIO\n"); } /* Initially the chip is in run state */ @@ -160,20 +160,20 @@ outb(SMSC_ENTER_CONFIG_KEY, SMSC_CONFIG_PORT_ADDR); /* Read device ID info */ - devid = SMSC_READ_INDEXED(SMSC_DEVICE_ID_INDEX); - devrev = SMSC_READ_INDEXED(SMSC_DEVICE_REV_INDEX); - printk("SMSC devid %02x rev %02x\n", devid, devrev); + devid = SMSC_SUPERIO_READ_INDEXED(SMSC_DEVICE_ID_INDEX); + devrev = SMSC_SUPERIO_READ_INDEXED(SMSC_DEVICE_REV_INDEX); + printk("SMSC SuperIO devid %02x rev %02x\n", devid, devrev); /* Select the keyboard device */ - SMSC_WRITE_INDEXED(SMSC_KEYBOARD_DEVICE, SMCS_LOGICAL_DEV_INDEX); + SMSC_SUPERIO_WRITE_INDEXED(SMSC_KEYBOARD_DEVICE, SMCS_LOGICAL_DEV_INDEX); /* enable it */ - SMSC_WRITE_INDEXED(1, SMSC_ACTIVATE_INDEX); + SMSC_SUPERIO_WRITE_INDEXED(1, SMSC_ACTIVATE_INDEX); /* Select the interrupts */ /* On a PC keyboard is IRQ1, mouse is IRQ12 */ - SMSC_WRITE_INDEXED(1, SMSC_PRIMARY_INT_INDEX); - SMSC_WRITE_INDEXED(12, SMSC_SECONDARY_INT_INDEX); + SMSC_SUPERIO_WRITE_INDEXED(1, SMSC_PRIMARY_INT_INDEX); + SMSC_SUPERIO_WRITE_INDEXED(12, SMSC_SECONDARY_INT_INDEX); /* Exit the configuraton state */ outb(SMSC_EXIT_CONFIG_KEY, SMSC_CONFIG_PORT_ADDR); @@ -184,7 +184,7 @@ /* This is grotty, but, because kernel is always referenced on the link line * before any devices, this is safe. */ -__initcall(smsc_setup); +__initcall(smsc_superio_setup); void __init platform_setup(void) { diff -Nru a/arch/sh64/mm/cache.c b/arch/sh64/mm/cache.c --- a/arch/sh64/mm/cache.c Sun May 9 15:31:35 2004 +++ b/arch/sh64/mm/cache.c Sun May 9 15:31:35 2004 @@ -474,7 +474,7 @@ /* Assumes this address (+ (2**n_synbits) pages up from it) aren't used for anything else in the kernel */ -#define MAGIC_PAGE0_START 0xffffffffe0000000ULL +#define MAGIC_PAGE0_START 0xffffffffec000000ULL static void sh64_dcache_purge_coloured_phy_page(unsigned long paddr, unsigned long eaddr) { @@ -740,8 +740,8 @@ /****************************************************************************/ /* These *MUST* lie in an area of virtual address space that's otherwise unused. */ -#define UNIQUE_EADDR_START 0xc0000000UL -#define UNIQUE_EADDR_END 0xd0000000UL +#define UNIQUE_EADDR_START 0xe0000000UL +#define UNIQUE_EADDR_END 0xe8000000UL static unsigned long sh64_make_unique_eaddr(unsigned long user_eaddr, unsigned long paddr) { diff -Nru a/arch/sh64/vmlinux.lds.S b/arch/sh64/vmlinux.lds.S --- a/arch/sh64/vmlinux.lds.S Sun May 9 15:31:35 2004 +++ b/arch/sh64/vmlinux.lds.S Sun May 9 15:31:35 2004 @@ -38,7 +38,6 @@ OUTPUT_ARCH(sh:sh5) #define C_PHYS(x) AT (ADDR(x) - CONFIG_CACHED_MEMORY_OFFSET) -#define U_PHYS(x) AT (ADDR(x) - CONFIG_UNCACHED_MEMORY_OFFSET) ENTRY(__start) SECTIONS diff -Nru a/arch/x86_64/kernel/acpi.c b/arch/x86_64/kernel/acpi.c --- a/arch/x86_64/kernel/acpi.c Sun May 9 15:31:35 2004 +++ b/arch/x86_64/kernel/acpi.c Sun May 9 15:31:35 2004 @@ -56,7 +56,10 @@ /* -------------------------------------------------------------------------- Boot-time Configuration -------------------------------------------------------------------------- */ - +#ifdef CONFIG_ACPI_PCI +int acpi_noirq __initdata; /* skip ACPI IRQ initialization */ +int acpi_pci_disabled __initdata; /* skip ACPI PCI scan and IRQ initialization */ +#endif int acpi_ht __initdata = 1; /* enable HT */ enum acpi_irq_model_id acpi_irq_model; @@ -119,11 +122,40 @@ #endif } +#ifdef CONFIG_ACPI_MMCONFIG + +u32 pci_mmcfg_base_addr; + +static int __init +acpi_parse_mcfg(unsigned long phys_addr, + unsigned long size) +{ + struct acpi_table_mcfg *mcfg = NULL; + + if (!phys_addr || !size) + return -EINVAL; + + mcfg = (struct acpi_table_mcfg *) __acpi_map_table(phys_addr, size); + if (!mcfg) { + printk(KERN_WARNING PREFIX "Unable to map MCFG\n"); + return -ENODEV; + } + + if (mcfg->base_reserved) { + printk(KERN_ERR PREFIX "MMCONFIG not in low 4GB of memory\n"); + return -ENODEV; + } + + pci_mmcfg_base_addr = mcfg->base_address; + + return 0; +} +#endif /* CONFIG_ACPI_MMCONFIG */ + #ifdef CONFIG_X86_LOCAL_APIC static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE; - static int __init acpi_parse_madt ( unsigned long phys_addr, @@ -330,7 +362,7 @@ #endif /*CONFIG_X86_IO_APIC && CONFIG_ACPI_INTERPRETER*/ - +#ifdef CONFIG_HPET_TIMER static int __init acpi_parse_hpet ( unsigned long phys_addr, @@ -351,6 +383,7 @@ return 0; } +#endif /* CONFIG_HPET_TIMER */ #ifdef CONFIG_ACPI_BUS /* @@ -457,17 +490,16 @@ return result; } -#ifdef CONFIG_X86_LOCAL_APIC +#ifdef CONFIG_ACPI_MMCONFIG + result = acpi_table_parse(ACPI_MCFG, acpi_parse_mcfg); + if (result < 0) { + printk(KERN_ERR PREFIX "Error %d parsing MCFG\n", result); + } else if (result > 1) { + printk(KERN_WARNING PREFIX "Multiple MCFG tables exist\n"); + } +#endif - /* this check should not need to be here -lenb */ - /* If "nolocalapic" is specified don't look further */ - extern int apic_disabled; - if (apic_disabled) { - printk(KERN_INFO PREFIX "Skipping Local/IO-APIC probe due to \"nolocalapic\"\n"); - return 0; - } - printk(KERN_INFO PREFIX "Parsing Local APIC info in MADT\n"); - +#ifdef CONFIG_X86_LOCAL_APIC /* * MADT @@ -573,9 +605,6 @@ return result; } - /* Build a default routing table for legacy (ISA) interrupts. */ - mp_config_acpi_legacy_irqs(); - /* Record sci_int for use when looking for MADT sci_int override */ acpi_table_parse(ACPI_FADT, acpi_parse_fadt); @@ -593,6 +622,9 @@ if (!acpi_sci_override_gsi) acpi_sci_ioapic_setup(acpi_fadt.sci_int, 0, 0); + /* Fill in identity legacy mapings where no override */ + mp_config_acpi_legacy_irqs(); + result = acpi_table_parse_madt(ACPI_MADT_NMI_SRC, acpi_parse_nmi_src); if (result < 0) { printk(KERN_ERR PREFIX "Error parsing NMI SRC entry\n"); @@ -609,9 +641,11 @@ if (acpi_lapic && acpi_ioapic) smp_found_config = 1; +#ifdef CONFIG_HPET_TIMER result = acpi_table_parse(ACPI_HPET, acpi_parse_hpet); if (result < 0) printk("ACPI: no HPET table found (%d).\n", result); +#endif #endif /*CONFIG_X86_IO_APIC && CONFIG_ACPI_INTERPRETER*/ diff -Nru a/arch/x86_64/kernel/e820.c b/arch/x86_64/kernel/e820.c --- a/arch/x86_64/kernel/e820.c Sun May 9 15:31:35 2004 +++ b/arch/x86_64/kernel/e820.c Sun May 9 15:31:35 2004 @@ -567,10 +567,10 @@ acpi_strict = 1; } - else if (!memcmp(from, "pci=noacpi", 10)) { + else if (!memcmp(from, "pci=noacpi", 10)) + acpi_disable_pci(); + else if (!memcmp(from, "acpi=noirq", 10)) acpi_noirq_set(); - } - else if (!memcmp(from, "acpi_sci=edge", 13)) acpi_sci_flags.trigger = 1; else if (!memcmp(from, "acpi_sci=level", 14)) diff -Nru a/arch/x86_64/kernel/i8259.c b/arch/x86_64/kernel/i8259.c --- a/arch/x86_64/kernel/i8259.c Sun May 9 15:31:35 2004 +++ b/arch/x86_64/kernel/i8259.c Sun May 9 15:31:35 2004 @@ -13,6 +13,7 @@ #include #include +#include #include #include #include @@ -439,6 +440,7 @@ #endif #ifndef CONFIG_VISWS - setup_irq(2, &irq2); + if (!acpi_ioapic) + setup_irq(2, &irq2); #endif } diff -Nru a/arch/x86_64/kernel/io_apic.c b/arch/x86_64/kernel/io_apic.c --- a/arch/x86_64/kernel/io_apic.c Sun May 9 15:31:35 2004 +++ b/arch/x86_64/kernel/io_apic.c Sun May 9 15:31:35 2004 @@ -1684,18 +1684,10 @@ /* * - * IRQ's that are handled by the old PIC in all cases: + * IRQ's that are handled by the PIC in the MPS IOAPIC case. * - IRQ2 is the cascade IRQ, and cannot be a io-apic IRQ. * Linux doesn't really care, as it's not actually used * for any interrupt handling anyway. - * - There used to be IRQ13 here as well, but all - * MPS-compliant must not use it for FPU coupling and we - * want to use exception 16 anyway. And there are - * systems who connect it to an I/O APIC for other uses. - * Thus we don't mark it special any longer. - * - * Additionally, something is definitely wrong with irq9 - * on PIIX4 boards. */ #define PIC_IRQS (1<<2) @@ -1703,7 +1695,11 @@ { enable_IO_APIC(); - io_apic_irqs = ~PIC_IRQS; + if (acpi_ioapic) + io_apic_irqs = ~0; /* all IRQs go through IOAPIC */ + else + io_apic_irqs = ~PIC_IRQS; + printk("ENABLING IO-APIC IRQs\n"); /* @@ -1858,7 +1854,7 @@ entry.vector = assign_irq_vector(irq); - printk(KERN_DEBUG "IOAPIC[%d]: Set PCI routing entry (%d-%d -> 0x%x -> " + Dprintk(KERN_DEBUG "IOAPIC[%d]: Set PCI routing entry (%d-%d -> 0x%x -> " "IRQ %d Mode:%i Active:%i)\n", ioapic, mp_ioapics[ioapic].mpc_apicid, pin, entry.vector, irq, edge_level, active_high_low); diff -Nru a/arch/x86_64/kernel/mpparse.c b/arch/x86_64/kernel/mpparse.c --- a/arch/x86_64/kernel/mpparse.c Sun May 9 15:31:35 2004 +++ b/arch/x86_64/kernel/mpparse.c Sun May 9 15:31:35 2004 @@ -793,8 +793,6 @@ u32 global_irq) { struct mpc_config_intsrc intsrc; - int i = 0; - int found = 0; int ioapic = -1; int pin = -1; @@ -827,23 +825,9 @@ (intsrc.mpc_irqflag >> 2) & 3, intsrc.mpc_srcbus, intsrc.mpc_srcbusirq, intsrc.mpc_dstapic, intsrc.mpc_dstirq); - /* - * If an existing [IOAPIC.PIN -> IRQ] routing entry exists we override it. - * Otherwise create a new entry (e.g. global_irq == 2). - */ - for (i = 0; i < mp_irq_entries; i++) { - if ((mp_irqs[i].mpc_srcbus == intsrc.mpc_srcbus) - && (mp_irqs[i].mpc_dstirq == intsrc.mpc_dstirq)) { - mp_irqs[i] = intsrc; - found = 1; - break; - } - } - if (!found) { - mp_irqs[mp_irq_entries] = intsrc; - if (++mp_irq_entries == MAX_IRQ_SOURCES) - panic("Max # of irq sources exceeded!\n"); - } + mp_irqs[mp_irq_entries] = intsrc; + if (++mp_irq_entries == MAX_IRQ_SOURCES) + panic("Max # of irq sources exceeded!\n"); return; } @@ -874,13 +858,22 @@ intsrc.mpc_dstapic = mp_ioapics[ioapic].mpc_apicid; /* - * Use the default configuration for the IRQs 0-15. These may be + * Use the default configuration for the IRQs 0-15. Unless * overriden by (MADT) interrupt source override entries. */ for (i = 0; i < 16; i++) { + int idx; - if (i == 2) - continue; /* Don't connect IRQ2 */ + for (idx = 0; idx < mp_irq_entries; idx++) + if (mp_irqs[idx].mpc_srcbus == MP_ISA_BUS && + (mp_irqs[idx].mpc_srcbusirq == i || + mp_irqs[idx].mpc_dstirq == i)) + break; + + if (idx != mp_irq_entries) { + printk(KERN_DEBUG "ACPI: IRQ%d used by override.\n", i); + continue; /* IRQ already used */ + } intsrc.mpc_irqtype = mp_INT; intsrc.mpc_srcbusirq = i; /* Identity mapped */ @@ -982,10 +975,11 @@ entry->irq = irq; printk(KERN_DEBUG "%02x:%02x:%02x[%c] -> %d-%d -> vector 0x%02x" - " -> IRQ %d\n", entry->id.segment, entry->id.bus, - entry->id.device, ('A' + entry->pin), - mp_ioapic_routing[ioapic].apic_id, ioapic_pin, vector, - entry->irq); + " -> IRQ %d %s %s\n", entry->id.segment, entry->id.bus, + entry->id.device, ('A' + entry->pin), + mp_ioapic_routing[ioapic].apic_id, ioapic_pin, vector, + entry->irq, edge_level ? "level" : "edge", + active_high_low ? "low" : "high"); } print_IO_APIC(); diff -Nru a/arch/x86_64/kernel/pci-pc.c b/arch/x86_64/kernel/pci-pc.c --- a/arch/x86_64/kernel/pci-pc.c Sun May 9 15:31:35 2004 +++ b/arch/x86_64/kernel/pci-pc.c Sun May 9 15:31:35 2004 @@ -646,7 +646,7 @@ pcibios_last_bus = simple_strtol(str+8, NULL, 0); return NULL; } else if (!strncmp(str, "noacpi", 6)) { - acpi_noirq_set(); + acpi_disable_pci(); return NULL; } return str; diff -Nru a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c --- a/arch/x86_64/kernel/setup.c Sun May 9 15:31:35 2004 +++ b/arch/x86_64/kernel/setup.c Sun May 9 15:31:35 2004 @@ -48,11 +48,8 @@ #include #include -int acpi_disabled = 0; -#ifdef CONFIG_ACPI_BOOT -int acpi_noirq __initdata = 0; /* skip ACPI IRQ initialization */ -#endif - +int acpi_disabled; +EXPORT_SYMBOL(acpi_disabled); int swiotlb; diff -Nru a/drivers/acpi/Config.in b/drivers/acpi/Config.in --- a/drivers/acpi/Config.in Sun May 9 15:31:35 2004 +++ b/drivers/acpi/Config.in Sun May 9 15:31:35 2004 @@ -16,6 +16,7 @@ define_bool CONFIG_ACPI_POWER y if [ "$CONFIG_PCI" = "y" ]; then define_bool CONFIG_ACPI_PCI y + define_bool CONFIG_ACPI_MMCONFIG y fi define_bool CONFIG_ACPI_SLEEP y define_bool CONFIG_ACPI_SYSTEM y @@ -28,7 +29,6 @@ tristate ' ASUS Laptop Extras' CONFIG_ACPI_ASUS tristate ' Toshiba Laptop Extras' CONFIG_ACPI_TOSHIBA bool ' Debug Statements' CONFIG_ACPI_DEBUG - bool ' Relaxed AML Checking' CONFIG_ACPI_RELAXED_AML else if [ "$CONFIG_SMP" = "y" ]; then define_bool CONFIG_ACPI_BOOT y diff -Nru a/drivers/acpi/Makefile b/drivers/acpi/Makefile --- a/drivers/acpi/Makefile Sun May 9 15:31:35 2004 +++ b/drivers/acpi/Makefile Sun May 9 15:31:35 2004 @@ -14,7 +14,7 @@ EXTRA_CFLAGS += $(ACPI_CFLAGS) -export-objs := acpi_ksyms.o processor.o +export-objs := acpi_ksyms.o processor.o bus.o obj-$(CONFIG_ACPI) := acpi_ksyms.o diff -Nru a/drivers/acpi/ac.c b/drivers/acpi/ac.c --- a/drivers/acpi/ac.c Sun May 9 15:31:35 2004 +++ b/drivers/acpi/ac.c Sun May 9 15:31:35 2004 @@ -156,6 +156,7 @@ acpi_ac_dir); if (!acpi_device_dir(device)) return_VALUE(-ENODEV); + acpi_device_dir(device)->owner = THIS_MODULE; } /* 'state' [R] */ @@ -168,6 +169,7 @@ else { entry->read_proc = acpi_ac_read_state; entry->data = acpi_driver_data(device); + entry->owner = THIS_MODULE; } return_VALUE(0); @@ -318,6 +320,7 @@ acpi_ac_dir = proc_mkdir(ACPI_AC_CLASS, acpi_root_dir); if (!acpi_ac_dir) return_VALUE(-ENODEV); + acpi_ac_dir->owner = THIS_MODULE; result = acpi_bus_register_driver(&acpi_ac_driver); if (result < 0) { diff -Nru a/drivers/acpi/asus_acpi.c b/drivers/acpi/asus_acpi.c --- a/drivers/acpi/asus_acpi.c Sun May 9 15:31:35 2004 +++ b/drivers/acpi/asus_acpi.c Sun May 9 15:31:35 2004 @@ -41,7 +41,7 @@ #include #include -#define ASUS_ACPI_VERSION "0.27" +#define ASUS_ACPI_VERSION "0.28" #define PROC_ASUS "asus" //the directory #define PROC_MLED "mled" @@ -125,12 +125,11 @@ L5x, //L5800C L8L, //L8400L M1A, //M1300A - M2E, //M2400E + M2E, //M2400E, L4400L + P30, //Samsung P30 S1x, //S1300A, but also L1400B and M2400A (L84F) S2x, //S200 (J1 reported), Victor MP-XP7210 - //TODO A1370D does not seem to have an ATK device - // L8400 model doesn't have ATK - xxN, //M2400N, M3700N, S1300N (Centrino) + xxN, //M2400N, M3700N, M6800N, S1300N, S5200N (Centrino) END_MODEL } model; //Models currently supported u16 event_count[128]; //count for each event TODO make this better @@ -140,6 +139,7 @@ #define A1x_PREFIX "\\_SB.PCI0.ISA.EC0." #define L3C_PREFIX "\\_SB.PCI0.PX40.ECD0." #define M1A_PREFIX "\\_SB.PCI0.PX40.EC0." +#define P30_PREFIX "\\_SB.PCI0.LPCB.EC0." #define S1x_PREFIX "\\_SB.PCI0.PX40." #define S2x_PREFIX A1x_PREFIX #define xxN_PREFIX "\\_SB.PCI0.SBRG.EC0." @@ -166,7 +166,7 @@ .mt_lcd_switch = A1x_PREFIX "_Q10", .lcd_status = "\\BKLI", .brightness_up = A1x_PREFIX "_Q0E", - .brightness_down = A1x_PREFIX "_Q0F", + .brightness_down = A1x_PREFIX "_Q0F" }, { @@ -176,11 +176,8 @@ .wled_status = "\\SG66", .mt_lcd_switch = "\\Q10", .lcd_status = "\\BAOF", - .brightness_up = "\\Q0E", - .brightness_down = "\\Q0F", .brightness_set = "SPLV", .brightness_get = "GPLV", - .brightness_status = "\\CMOD", .display_set = "SDSP", .display_get = "\\INFB" }, @@ -217,11 +214,8 @@ .mt_wled = "WLED", .mt_lcd_switch = L3C_PREFIX "_Q10", .lcd_status = "\\GL32", - .brightness_up = L3C_PREFIX "_Q0F", - .brightness_down = L3C_PREFIX "_Q0E", .brightness_set = "SPLV", .brightness_get = "GPLV", - .brightness_status = "\\BLVL", .display_set = "SDSP", .display_get = "\\_SB.PCI0.PCI1.VGAC.NMAP" }, @@ -233,11 +227,8 @@ .mt_wled = "WLED", .mt_lcd_switch = "\\Q10", .lcd_status = "\\BKLG", - .brightness_up = "\\Q0E", - .brightness_down = "\\Q0F", .brightness_set = "SPLV", .brightness_get = "GPLV", - .brightness_status = "\\BLVL", .display_set = "SDSP", .display_get = "\\INFB" }, @@ -257,14 +248,10 @@ { .name = "L5x", .mt_mled = "MLED", -// .mt_wled = "WLED", -// .wled_status = "\\WRED", -/* Present, but not controlled by ACPI */ +/* WLED present, but not controlled by ACPI */ .mt_tled = "TLED", .mt_lcd_switch = "\\Q0D", .lcd_status = "\\BAOF", - .brightness_up = "\\Q0C", - .brightness_down = "\\Q0B", .brightness_set = "SPLV", .brightness_get = "GPLV", .display_set = "SDSP", @@ -294,8 +281,6 @@ .mt_wled = "WLED", .mt_lcd_switch = "\\Q10", .lcd_status = "\\GP06", - .brightness_up = "\\Q0E", - .brightness_down = "\\Q0F", .brightness_set = "SPLV", .brightness_get = "GPLV", .display_set = "SDSP", @@ -303,17 +288,26 @@ }, { + .name = "P30", + .mt_wled = "WLED", + .mt_lcd_switch = P30_PREFIX "_Q0E", + .lcd_status = "\\BKLT", + .brightness_up = P30_PREFIX "_Q68", + .brightness_down = P30_PREFIX "_Q69", + .brightness_get = "GPLV", + .display_set = "SDSP", + .display_get = "\\DNXT" + }, + + { .name = "S1x", .mt_mled = "MLED", .mled_status = "\\EMLE", .mt_wled = "WLED", .mt_lcd_switch = S1x_PREFIX "Q10" , .lcd_status = "\\PNOF", - .brightness_up = S1x_PREFIX "Q0F", - .brightness_down = S1x_PREFIX "Q0E", .brightness_set = "SPLV", - .brightness_get = "GPLV", - .brightness_status = "\\BRIT", + .brightness_get = "GPLV" }, { @@ -323,22 +317,17 @@ .mt_lcd_switch = S2x_PREFIX "_Q10", .lcd_status = "\\BKLI", .brightness_up = S2x_PREFIX "_Q0B", - .brightness_down = S2x_PREFIX "_Q0A", + .brightness_down = S2x_PREFIX "_Q0A" }, { .name = "xxN", .mt_mled = "MLED", -// .mt_wled = "WLED", -// .wled_status = "\\PO33", -/* Present, but not controlled by ACPI */ +/* WLED present, but not controlled by ACPI */ .mt_lcd_switch = xxN_PREFIX "_Q10", .lcd_status = "\\BKLT", - .brightness_up = xxN_PREFIX "_Q0F", - .brightness_down = xxN_PREFIX "_Q0E", .brightness_set = "SPLV", .brightness_get = "GPLV", - .brightness_status = "\\LBTN", .display_set = "SDSP", .display_get = "\\ADVG" } @@ -663,6 +652,23 @@ } +static int read_brightness(struct asus_hotk *hotk) +{ + int value; + + if(hotk->methods->brightness_get) { /* SPLV/GPLV laptop */ + if (!read_acpi_int(hotk->handle, hotk->methods->brightness_get, + &value)) + printk(KERN_WARNING "Asus ACPI: Error reading brightness\n"); + } else if (hotk->methods->brightness_status) { /* For D1 for example */ + if (!read_acpi_int(NULL, hotk->methods->brightness_status, + &value)) + printk(KERN_WARNING "Asus ACPI: Error reading brightness\n"); + } else /* No GPLV method */ + value = hotk->brightness; + return value; +} + /* * Change the brightness level */ @@ -679,7 +685,7 @@ } /* No SPLV method if we are here, act as appropriate */ - value -= hotk->brightness; + value -= read_brightness(hotk); while (value != 0) { status = acpi_evaluate_object(NULL, (value > 0) ? hotk->methods->brightness_up : @@ -692,23 +698,6 @@ return; } -static int read_brightness(struct asus_hotk *hotk) -{ - int value; - - if(hotk->methods->brightness_get) { /* SPLV/GPLV laptop */ - if (!read_acpi_int(hotk->handle, hotk->methods->brightness_get, - &value)) - printk(KERN_WARNING "Asus ACPI: Error reading brightness\n"); - } else if (hotk->methods->brightness_status) { /* For D1 for example */ - if (!read_acpi_int(NULL, hotk->methods->brightness_status, - &value)) - printk(KERN_WARNING "Asus ACPI: Error reading brightness\n"); - } else /* No GPLV method */ - value = hotk->brightness; - return value; -} - static int proc_read_brn(char *page, char **start, off_t off, int count, int *eof, void *data) @@ -929,12 +918,29 @@ return -ENODEV; } - /* For testing purposes */ + /* This needs to be called for some laptops to init properly */ if (!read_acpi_int(hotk->handle, "BSTS", &bsts_result)) printk(KERN_WARNING " Error calling BSTS\n"); else if (bsts_result) printk(KERN_NOTICE " BSTS called, 0x%02x returned\n", bsts_result); + /* Samsung P30 has a device with a valid _HID whose INIT does not + * return anything. Catch this one and any similar here */ + if (buffer.pointer == NULL) { + if (asus_info && /* Samsung P30 */ + strncmp(asus_info->oem_table_id, "ODEM", 4) == 0) { + hotk->model = P30; + printk(KERN_NOTICE " Samsung P30 detected, supported\n"); + } else { + hotk->model = M2E; + printk(KERN_WARNING " no string returned by INIT\n"); + printk(KERN_WARNING " trying default values, supply " + "the developers with your DSDT\n"); + } + hotk->methods = &model_conf[hotk->model]; + return AE_OK; + } + model = (union acpi_object *) buffer.pointer; if (model->type == ACPI_TYPE_STRING) { printk(KERN_NOTICE " %s model detected, ", model->string.pointer); @@ -953,12 +959,14 @@ hotk->model = L8L; else if (strncmp(model->string.pointer, "M2N", 3) == 0 || strncmp(model->string.pointer, "M3N", 3) == 0 || + strncmp(model->string.pointer, "M6N", 3) == 0 || strncmp(model->string.pointer, "S1N", 3) == 0 || strncmp(model->string.pointer, "S5N", 3) == 0) hotk->model = xxN; else if (strncmp(model->string.pointer, "M1", 2) == 0) hotk->model = M1A; - else if (strncmp(model->string.pointer, "M2", 2) == 0) + else if (strncmp(model->string.pointer, "M2", 2) == 0 || + strncmp(model->string.pointer, "L4E", 3) == 0) hotk->model = M2E; else if (strncmp(model->string.pointer, "L2", 2) == 0) hotk->model = L2D; @@ -994,6 +1002,13 @@ else if (strncmp(model->string.pointer, "S5N", 3) == 0) hotk->methods->mt_mled = NULL; /* S5N has no MLED */ + else if (strncmp(model->string.pointer, "M6N", 3) == 0) { + hotk->methods->display_get = NULL; //TODO + hotk->methods->lcd_status = "\\_SB.BKLT"; + hotk->methods->mt_wled = "WLED"; + hotk->methods->wled_status = "\\_SB.PCI0.SBRG.SG13"; + /* M6N differs slightly and has a usable WLED */ + } else if (asus_info) { if (strncmp(asus_info->oem_table_id, "L1", 2) == 0) hotk->methods->mled_status = NULL; diff -Nru a/drivers/acpi/battery.c b/drivers/acpi/battery.c --- a/drivers/acpi/battery.c Sun May 9 15:31:35 2004 +++ b/drivers/acpi/battery.c Sun May 9 15:31:35 2004 @@ -474,14 +474,18 @@ else p += sprintf(p, "capacity state: critical\n"); - if ((bst->state & 0x01) && (bst->state & 0x02)) + if ((bst->state & 0x01) && (bst->state & 0x02)){ p += sprintf(p, "charging state: charging/discharging\n"); + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "Battery Charging and Discharging?\n")); + } else if (bst->state & 0x01) p += sprintf(p, "charging state: discharging\n"); else if (bst->state & 0x02) p += sprintf(p, "charging state: charging\n"); - else - p += sprintf(p, "charging state: unknown\n"); + else { + p += sprintf(p, "charging state: charged\n"); + } if (bst->present_rate == ACPI_BATTERY_VALUE_UNKNOWN) p += sprintf(p, "present rate: unknown\n"); @@ -609,6 +613,7 @@ acpi_battery_dir); if (!acpi_device_dir(device)) return_VALUE(-ENODEV); + acpi_device_dir(device)->owner = THIS_MODULE; } /* 'info' [R] */ @@ -621,6 +626,7 @@ else { entry->read_proc = acpi_battery_read_info; entry->data = acpi_driver_data(device); + entry->owner = THIS_MODULE; } /* 'status' [R] */ @@ -633,6 +639,7 @@ else { entry->read_proc = acpi_battery_read_state; entry->data = acpi_driver_data(device); + entry->owner = THIS_MODULE; } /* 'alarm' [R/W] */ @@ -646,6 +653,7 @@ entry->read_proc = acpi_battery_read_alarm; entry->write_proc = acpi_battery_write_alarm; entry->data = acpi_driver_data(device); + entry->owner = THIS_MODULE; } return_VALUE(0); @@ -797,6 +805,7 @@ acpi_battery_dir = proc_mkdir(ACPI_BATTERY_CLASS, acpi_root_dir); if (!acpi_battery_dir) return_VALUE(-ENODEV); + acpi_battery_dir->owner = THIS_MODULE; result = acpi_bus_register_driver(&acpi_battery_driver); if (result < 0) { diff -Nru a/drivers/acpi/bus.c b/drivers/acpi/bus.c --- a/drivers/acpi/bus.c Sun May 9 15:31:35 2004 +++ b/drivers/acpi/bus.c Sun May 9 15:31:35 2004 @@ -1769,15 +1769,23 @@ } +struct acpi_device *acpi_fixed_pwr_button; +struct acpi_device *acpi_fixed_sleep_button; + +EXPORT_SYMBOL(acpi_fixed_pwr_button); +EXPORT_SYMBOL(acpi_fixed_sleep_button); + static int acpi_bus_scan_fixed ( struct acpi_device *root) { int result = 0; - struct acpi_device *device = NULL; ACPI_FUNCTION_TRACE("acpi_bus_scan_fixed"); + acpi_fixed_pwr_button = NULL; + acpi_fixed_sleep_button = NULL; + if (!root) return_VALUE(-ENODEV); @@ -1785,11 +1793,11 @@ * Enumerate all fixed-feature devices. */ if (acpi_fadt.pwr_button == 0) - result = acpi_bus_add(&device, acpi_root, + result = acpi_bus_add(&acpi_fixed_pwr_button, acpi_root, NULL, ACPI_BUS_TYPE_POWER_BUTTON); if (acpi_fadt.sleep_button == 0) - result = acpi_bus_add(&device, acpi_root, + result = acpi_bus_add(&acpi_fixed_sleep_button, acpi_root, NULL, ACPI_BUS_TYPE_SLEEP_BUTTON); return_VALUE(result); @@ -1964,8 +1972,10 @@ acpi_ec_init(); /* ACPI Embedded Controller */ #endif #ifdef CONFIG_ACPI_PCI - acpi_pci_link_init(); /* ACPI PCI Interrupt Link */ - acpi_pci_root_init(); /* ACPI PCI Root Bridge */ + if (!acpi_pci_disabled) { + acpi_pci_link_init(); /* ACPI PCI Interrupt Link */ + acpi_pci_root_init(); /* ACPI PCI Root Bridge */ + } #endif /* * Enumerate devices in the ACPI namespace. diff -Nru a/drivers/acpi/button.c b/drivers/acpi/button.c --- a/drivers/acpi/button.c Sun May 9 15:31:35 2004 +++ b/drivers/acpi/button.c Sun May 9 15:31:35 2004 @@ -69,6 +69,8 @@ -------------------------------------------------------------------------- */ static struct proc_dir_entry *acpi_button_dir; +extern struct acpi_device *acpi_fixed_pwr_button; +extern struct acpi_device *acpi_fixed_sleep_button; static int acpi_button_read_info ( @@ -171,10 +173,15 @@ acpi_button_dir); break; } + + if (!entry) + return_VALUE(-ENODEV); + entry->owner = THIS_MODULE; acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), entry); if (!acpi_device_dir(device)) return_VALUE(-ENODEV); + acpi_device_dir(device)->owner = THIS_MODULE; /* 'info' [R] */ entry = create_proc_entry(ACPI_BUTTON_FILE_INFO, @@ -186,6 +193,7 @@ else { entry->read_proc = acpi_button_read_info; entry->data = acpi_driver_data(device); + entry->owner = THIS_MODULE; } if (button->type==ACPI_BUTTON_TYPE_LID){ @@ -199,6 +207,7 @@ else { entry->read_proc = acpi_button_lid_read_state; entry->data = acpi_driver_data(device); + entry->owner = THIS_MODULE; } } @@ -210,10 +219,28 @@ acpi_button_remove_fs ( struct acpi_device *device) { + struct acpi_button *button = NULL; + ACPI_FUNCTION_TRACE("acpi_button_remove_fs"); + button = acpi_driver_data(device); if (acpi_device_dir(device)) { - remove_proc_entry(acpi_device_bid(device), acpi_button_dir); + switch (button->type) { + case ACPI_BUTTON_TYPE_POWER: + case ACPI_BUTTON_TYPE_POWERF: + remove_proc_entry(ACPI_BUTTON_SUBCLASS_POWER, + acpi_button_dir); + break; + case ACPI_BUTTON_TYPE_SLEEP: + case ACPI_BUTTON_TYPE_SLEEPF: + remove_proc_entry(ACPI_BUTTON_SUBCLASS_SLEEP, + acpi_button_dir); + break; + case ACPI_BUTTON_TYPE_LID: + remove_proc_entry(ACPI_BUTTON_SUBCLASS_LID, + acpi_button_dir); + break; + } acpi_device_dir(device) = NULL; } @@ -470,6 +497,7 @@ acpi_button_dir = proc_mkdir(ACPI_BUTTON_CLASS, acpi_root_dir); if (!acpi_button_dir) return_VALUE(-ENODEV); + acpi_button_dir->owner = THIS_MODULE; result = acpi_bus_register_driver(&acpi_button_driver); if (result < 0) { @@ -485,6 +513,12 @@ acpi_button_exit (void) { ACPI_FUNCTION_TRACE("acpi_button_exit"); + + if(acpi_fixed_pwr_button) + acpi_button_remove(acpi_fixed_pwr_button, ACPI_BUS_TYPE_POWER_BUTTON); + + if(acpi_fixed_sleep_button) + acpi_button_remove(acpi_fixed_sleep_button, ACPI_BUS_TYPE_SLEEP_BUTTON); acpi_bus_unregister_driver(&acpi_button_driver); diff -Nru a/drivers/acpi/fan.c b/drivers/acpi/fan.c --- a/drivers/acpi/fan.c Sun May 9 15:31:35 2004 +++ b/drivers/acpi/fan.c Sun May 9 15:31:35 2004 @@ -151,6 +151,7 @@ acpi_fan_dir); if (!acpi_device_dir(device)) return_VALUE(-ENODEV); + acpi_device_dir(device)->owner = THIS_MODULE; } /* 'status' [R/W] */ @@ -164,6 +165,7 @@ entry->read_proc = acpi_fan_read_state; entry->write_proc = acpi_fan_write_state; entry->data = acpi_driver_data(device); + entry->owner = THIS_MODULE; } return_VALUE(0); @@ -267,6 +269,7 @@ acpi_fan_dir = proc_mkdir(ACPI_FAN_CLASS, acpi_root_dir); if (!acpi_fan_dir) return_VALUE(-ENODEV); + acpi_fan_dir->owner = THIS_MODULE; result = acpi_bus_register_driver(&acpi_fan_driver); if (result < 0) { diff -Nru a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c --- a/drivers/acpi/pci_irq.c Sun May 9 15:31:35 2004 +++ b/drivers/acpi/pci_irq.c Sun May 9 15:31:35 2004 @@ -373,7 +373,7 @@ if (!irq) { printk(KERN_WARNING PREFIX "No IRQ known for interrupt pin %c of device %s", ('A' + pin), dev->slot_name); /* Interrupt Line values above 0xF are forbidden */ - if (dev->irq && dev->irq >= 0xF) { + if (dev->irq && (dev->irq <= 0xF)) { printk(" - using IRQ %d\n", dev->irq); return_VALUE(dev->irq); } diff -Nru a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c --- a/drivers/acpi/pci_link.c Sun May 9 15:31:35 2004 +++ b/drivers/acpi/pci_link.c Sun May 9 15:31:35 2004 @@ -90,6 +90,9 @@ PCI Link Device Management -------------------------------------------------------------------------- */ +/* + * set context (link) possible list from resource list + */ static acpi_status acpi_pci_link_check_possible ( struct acpi_resource *resource, @@ -128,7 +131,7 @@ struct acpi_resource_ext_irq *p = &resource->data.extended_irq; if (!p || !p->number_of_interrupts) { ACPI_DEBUG_PRINT((ACPI_DB_WARN, - "Blank IRQ resource\n")); + "Blank EXT IRQ resource\n")); return AE_OK; } for (i = 0; (inumber_of_interrupts && idata.irq; if (!p || !p->number_of_interrupts) { - ACPI_DEBUG_PRINT((ACPI_DB_WARN, - "Blank IRQ resource\n")); + /* + * IRQ descriptors may have no IRQ# bits set, + * particularly those those w/ _STA disabled + */ + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "Blank IRQ resource\n")); return AE_OK; } *irq = p->interrupts[0]; @@ -204,8 +211,12 @@ { struct acpi_resource_ext_irq *p = &resource->data.extended_irq; if (!p || !p->number_of_interrupts) { + /* + * extended IRQ descriptors must + * return at least 1 IRQ + */ ACPI_DEBUG_PRINT((ACPI_DB_WARN, - "Blank IRQ resource\n")); + "Blank EXT IRQ resource\n")); return AE_OK; } *irq = p->interrupts[0]; @@ -219,6 +230,13 @@ return AE_CTRL_TERMINATE; } +/* + * Run _CRS and set link->irq.active + * + * return value: + * 0 - success + * !0 - failure + */ static int acpi_pci_link_get_current ( struct acpi_pci_link *link) @@ -234,15 +252,19 @@ link->irq.active = 0; - /* Make sure the link is enabled (no use querying if it isn't). */ - result = acpi_bus_get_status(link->device); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Unable to read status\n")); - goto end; - } - if (!link->device->status.enabled) { - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Link disabled\n")); - return_VALUE(0); + /* in practice, status disabled is meaningless, ignore it */ + if (acpi_strict) { + /* Query _STA, set link->device->status */ + result = acpi_bus_get_status(link->device); + if (result) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Unable to read status\n")); + goto end; + } + + if (!link->device->status.enabled) { + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Link disabled\n")); + return_VALUE(0); + } } /* @@ -257,18 +279,11 @@ goto end; } - if (!irq) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "No IRQ resource found\n")); + if (acpi_strict && !irq) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "_CRS returned 0\n")); result = -ENODEV; - goto end; } - /* - * Note that we don't validate that the current IRQ (_CRS) exists - * within the possible IRQs (_PRS): we blindly assume that whatever - * IRQ a boot-enabled Link device is set to is the correct one. - * (Required to support systems such as the Toshiba 5005-S504.) - */ link->irq.active = irq; ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Link at IRQ %d \n", link->irq.active)); @@ -278,32 +293,6 @@ } 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 ( struct acpi_pci_link *link, int irq) @@ -317,8 +306,7 @@ 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) @@ -341,33 +329,18 @@ } } - resource_type = link->irq.resource_type; - - if (resource_type != ACPI_RSTYPE_IRQ && - resource_type != ACPI_RSTYPE_EXT_IRQ){ - /* 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 */ - switch(resource_type) { + switch(link->irq.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; resource.res.data.irq.active_high_low = link->irq.active_high_low; - resource.res.data.irq.shared_exclusive = ACPI_SHARED; + if (link->irq.edge_level == ACPI_EDGE_SENSITIVE) + resource.res.data.irq.shared_exclusive = ACPI_EXCLUSIVE; + else + resource.res.data.irq.shared_exclusive = ACPI_SHARED; resource.res.data.irq.number_of_interrupts = 1; resource.res.data.irq.interrupts[0] = irq; break; @@ -378,55 +351,63 @@ resource.res.data.extended_irq.producer_consumer = ACPI_CONSUMER; resource.res.data.extended_irq.edge_level = link->irq.edge_level; resource.res.data.extended_irq.active_high_low = link->irq.active_high_low; - resource.res.data.extended_irq.shared_exclusive = ACPI_SHARED; + if (link->irq.edge_level == ACPI_EDGE_SENSITIVE) + resource.res.data.irq.shared_exclusive = ACPI_EXCLUSIVE; + else + resource.res.data.irq.shared_exclusive = ACPI_SHARED; resource.res.data.extended_irq.number_of_interrupts = 1; resource.res.data.extended_irq.interrupts[0] = irq; /* ignore resource_source, it's optional */ break; + default: + printk("ACPI BUG: resource_type %d\n", link->irq.resource_type); + return_VALUE(-EINVAL); } 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); } - /* Make sure the device is enabled. */ + /* Query _STA, set device->status */ result = acpi_bus_get_status(link->device); if (result) { ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Unable to read status\n")); return_VALUE(result); } if (!link->device->status.enabled) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Link disabled\n")); - return_VALUE(-ENODEV); + printk(KERN_WARNING PREFIX + "%s [%s] disabled and referenced, BIOS bug.\n", + acpi_device_name(link->device), + acpi_device_bid(link->device)); } - /* Make sure the active IRQ is the one we requested. */ - result = acpi_pci_link_try_get_current(link, irq); + /* Query _CRS, set link->irq.active */ + result = acpi_pci_link_get_current(link); if (result) { return_VALUE(result); } - + + /* + * Is current setting not what we set? + * set link->irq.active + */ if (link->irq.active != irq) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "Attempt to enable at IRQ %d resulted in IRQ %d\n", - irq, link->irq.active)); - link->irq.active = 0; - acpi_ut_evaluate_object (link->handle, "_DIS", 0, NULL); - return_VALUE(-ENODEV); + /* + * policy: when _CRS doesn't return what we just _SRS + * assume _SRS worked and override _CRS value. + */ + printk(KERN_WARNING PREFIX + "%s [%s] BIOS reported IRQ %d, using IRQ %d\n", + acpi_device_name(link->device), + acpi_device_bid(link->device), + link->irq.active, irq); + link->irq.active = irq; } ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Set IRQ %d\n", link->irq.active)); @@ -480,7 +461,7 @@ #define PIRQ_PENALTY_ISA_USED (16*16*16*16*16) #define PIRQ_PENALTY_ISA_ALWAYS (16*16*16*16*16*16) -static int acpi_irq_penalty[ACPI_MAX_IRQS] = { +static int __initdata acpi_irq_penalty[ACPI_MAX_IRQS] = { PIRQ_PENALTY_ISA_ALWAYS, /* IRQ0 timer */ PIRQ_PENALTY_ISA_ALWAYS, /* IRQ1 keyboard */ PIRQ_PENALTY_ISA_ALWAYS, /* IRQ2 cascade */ @@ -553,10 +534,24 @@ if (link->irq.setonboot) return_VALUE(0); - if (link->irq.active) { + /* + * search for active IRQ in list of possible IRQs. + */ + for (i = 0; i < link->irq.possible_count; ++i) { + if (link->irq.active == link->irq.possible[i]) + break; + } + + /* + * if active found, use it; else pick entry from end of possible list. + */ + if (i != link->irq.possible_count) { irq = link->irq.active; } else { - irq = link->irq.possible[0]; + irq = link->irq.possible[link->irq.possible_count - 1]; + if (acpi_strict) + printk(KERN_WARNING PREFIX "_CRS %d not found" + " in _PRS\n", link->irq.active); } if (acpi_irq_balance || !link->irq.active) { @@ -572,7 +567,8 @@ /* Attempt to enable the link device at this IRQ. */ if (acpi_pci_link_set(link, irq)) { - printk(PREFIX "Unable to set IRQ for %s [%s] (likely buggy ACPI BIOS). Aborting ACPI-based IRQ routing. Try pci=noacpi or acpi=off\n", + printk(PREFIX "Unable to set IRQ for %s [%s] (likely buggy ACPI BIOS).\n" + "Try pci=noacpi or acpi=off\n", acpi_device_name(link->device), acpi_device_bid(link->device)); return_VALUE(-ENODEV); @@ -624,7 +620,7 @@ return_VALUE(0); if (!link->irq.active) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Link disabled\n")); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Link active IRQ is 0!\n")); return_VALUE(0); } @@ -670,7 +666,6 @@ /* query and set link->irq.active */ acpi_pci_link_get_current(link); -//#ifdef CONFIG_ACPI_DEBUG printk(PREFIX "%s [%s] (IRQs", acpi_device_name(device), acpi_device_bid(device)); for (i = 0; i < link->irq.possible_count; i++) { @@ -681,8 +676,16 @@ else printk(" %d", link->irq.possible[i]); } - printk(")\n"); -//#endif /* CONFIG_ACPI_DEBUG */ + + printk(")"); + + if (!found) + printk(" *%d", link->irq.active); + + if(!link->device->status.enabled) + printk(", disabled."); + + printk("\n"); /* TBD: Acquire/release lock */ list_add_tail(&link->node, &acpi_link.entries); diff -Nru a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c --- a/drivers/acpi/pci_root.c Sun May 9 15:31:35 2004 +++ b/drivers/acpi/pci_root.c Sun May 9 15:31:35 2004 @@ -118,6 +118,7 @@ { int result = 0; struct acpi_pci_root *root = NULL; + struct acpi_pci_root *tmp; acpi_status status = AE_OK; unsigned long value = 0; acpi_handle handle = NULL; @@ -152,8 +153,6 @@ switch (status) { case AE_OK: root->id.segment = (u16) value; - printk("_SEG exists! Unsupported. Abort.\n"); - BUG(); break; case AE_NOT_FOUND: ACPI_DEBUG_PRINT((ACPI_DB_INFO, @@ -187,6 +186,14 @@ goto end; } + /* Some systems have wrong _BBN */ + list_for_each_entry(tmp, &acpi_pci_roots, node) { + if ((tmp->id.segment == root->id.segment) + && (tmp->id.bus == root->id.bus)) + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Wrong _BBN value, please reboot and using option 'pci=noacpi'\n")); + } + /* * Device & Function * ----------------- @@ -213,7 +220,12 @@ * PCI namespace does not get created until this call is made (and * thus the root bridge's pci_dev does not exist). */ +#ifdef CONFIG_X86 root->bus = pcibios_scan_root(root->id.bus); +#else + root->bus = pcibios_scan_root(root->handle, + root->id.segment, root->id.bus); +#endif if (!root->bus) { ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Bus %02x:%02x not present in PCI namespace\n", diff -Nru a/drivers/acpi/processor.c b/drivers/acpi/processor.c --- a/drivers/acpi/processor.c Sun May 9 15:31:35 2004 +++ b/drivers/acpi/processor.c Sun May 9 15:31:35 2004 @@ -2011,6 +2011,7 @@ if (!acpi_device_dir(device)) return_VALUE(-ENODEV); } + acpi_device_dir(device)->owner = THIS_MODULE; /* 'info' [R] */ entry = create_proc_entry(ACPI_PROCESSOR_FILE_INFO, @@ -2022,6 +2023,7 @@ else { entry->read_proc = acpi_processor_read_info; entry->data = acpi_driver_data(device); + entry->owner = THIS_MODULE; } /* 'power' [R] */ @@ -2034,6 +2036,7 @@ else { entry->read_proc = acpi_processor_read_power; entry->data = acpi_driver_data(device); + entry->owner = THIS_MODULE; } /* 'performance' [R/W] */ @@ -2047,6 +2050,7 @@ entry->read_proc = acpi_processor_read_performance; entry->write_proc = acpi_processor_write_performance; entry->data = acpi_driver_data(device); + entry->owner = THIS_MODULE; } /* 'throttling' [R/W] */ @@ -2060,6 +2064,7 @@ entry->read_proc = acpi_processor_read_throttling; entry->write_proc = acpi_processor_write_throttling; entry->data = acpi_driver_data(device); + entry->owner = THIS_MODULE; } /* 'limit' [R/W] */ @@ -2073,6 +2078,7 @@ entry->read_proc = acpi_processor_read_limit; entry->write_proc = acpi_processor_write_limit; entry->data = acpi_driver_data(device); + entry->owner = THIS_MODULE; } return_VALUE(0); @@ -2349,6 +2355,7 @@ acpi_processor_dir = proc_mkdir(ACPI_PROCESSOR_CLASS, acpi_root_dir); if (!acpi_processor_dir) return_VALUE(-ENODEV); + acpi_processor_dir->owner = THIS_MODULE; result = acpi_bus_register_driver(&acpi_processor_driver); if (result < 0) { diff -Nru a/drivers/acpi/tables.c b/drivers/acpi/tables.c --- a/drivers/acpi/tables.c Sun May 9 15:31:35 2004 +++ b/drivers/acpi/tables.c Sun May 9 15:31:35 2004 @@ -58,6 +58,7 @@ [ACPI_SSDT] = "SSDT", [ACPI_SPMI] = "SPMI", [ACPI_HPET] = "HPET", + [ACPI_MCFG] = "MCFG", }; static char *mps_inti_flags_polarity[] = { "dfl", "high", "res", "low" }; diff -Nru a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c --- a/drivers/acpi/thermal.c Sun May 9 15:31:35 2004 +++ b/drivers/acpi/thermal.c Sun May 9 15:31:35 2004 @@ -1051,6 +1051,7 @@ acpi_thermal_dir); if (!acpi_device_dir(device)) return_VALUE(-ENODEV); + acpi_device_dir(device)->owner = THIS_MODULE; } /* 'state' [R] */ @@ -1063,6 +1064,7 @@ else { entry->read_proc = acpi_thermal_read_state; entry->data = acpi_driver_data(device); + entry->owner = THIS_MODULE; } /* 'temperature' [R] */ @@ -1075,6 +1077,7 @@ else { entry->read_proc = acpi_thermal_read_temperature; entry->data = acpi_driver_data(device); + entry->owner = THIS_MODULE; } /* 'trip_points' [R/W] */ @@ -1088,6 +1091,7 @@ entry->read_proc = acpi_thermal_read_trip_points; entry->write_proc = acpi_thermal_write_trip_points; entry->data = acpi_driver_data(device); + entry->owner = THIS_MODULE; } /* 'cooling_mode' [R/W] */ @@ -1101,6 +1105,7 @@ entry->read_proc = acpi_thermal_read_cooling_mode; entry->write_proc = acpi_thermal_write_cooling_mode; entry->data = acpi_driver_data(device); + entry->owner = THIS_MODULE; } /* 'polling_frequency' [R/W] */ @@ -1114,6 +1119,7 @@ entry->read_proc = acpi_thermal_read_polling; entry->write_proc = acpi_thermal_write_polling; entry->data = acpi_driver_data(device); + entry->owner = THIS_MODULE; } return_VALUE(0); @@ -1332,6 +1338,7 @@ acpi_thermal_dir = proc_mkdir(ACPI_THERMAL_CLASS, acpi_root_dir); if (!acpi_thermal_dir) return_VALUE(-ENODEV); + acpi_thermal_dir->owner = THIS_MODULE; result = acpi_bus_register_driver(&acpi_thermal_driver); if (result < 0) { diff -Nru a/drivers/acpi/toshiba_acpi.c b/drivers/acpi/toshiba_acpi.c --- a/drivers/acpi/toshiba_acpi.c Sun May 9 15:31:35 2004 +++ b/drivers/acpi/toshiba_acpi.c Sun May 9 15:31:35 2004 @@ -503,6 +503,8 @@ proc = create_proc_read_entry(item->name, S_IFREG | S_IRUGO | S_IWUSR, toshiba_proc_dir, (read_proc_t*)dispatch_read, item); + if (proc) + proc->owner = THIS_MODULE; if (proc && item->write_func) proc->write_proc = (write_proc_t*)dispatch_write; } @@ -526,6 +528,8 @@ acpi_status status = AE_OK; u32 hci_result; + if (acpi_disabled) + return -ENODEV; /* simple device detection: look for HCI method */ if (is_valid_acpi_path(METHOD_HCI_1)) method_hci = METHOD_HCI_1; @@ -548,6 +552,7 @@ if (!toshiba_proc_dir) { status = AE_ERROR; } else { + toshiba_proc_dir->owner = THIS_MODULE; status = add_device(); if (ACPI_FAILURE(status)) remove_proc_entry(PROC_TOSHIBA, acpi_root_dir); diff -Nru a/drivers/block/cciss.c b/drivers/block/cciss.c --- a/drivers/block/cciss.c Sun May 9 15:31:35 2004 +++ b/drivers/block/cciss.c Sun May 9 15:31:35 2004 @@ -45,13 +45,13 @@ #include #define CCISS_DRIVER_VERSION(maj,min,submin) ((maj<<16)|(min<<8)|(submin)) -#define DRIVER_NAME "HP CISS Driver (v 2.4.50)" -#define DRIVER_VERSION CCISS_DRIVER_VERSION(2,4,50) +#define DRIVER_NAME "HP CISS Driver (v 2.4.52)" +#define DRIVER_VERSION CCISS_DRIVER_VERSION(2,4,52) /* Embedded module documentation macros - see modules.h */ MODULE_AUTHOR("Hewlett-Packard Company"); -MODULE_DESCRIPTION("Driver for HP SA5xxx SA6xxx Controllers version 2.4.50"); -MODULE_SUPPORTED_DEVICE("HP SA5i SA5i+ SA532 SA5300 SA5312 SA641 SA642 SA6400 6i"); +MODULE_DESCRIPTION("Driver for HP SA5xxx SA6xxx Controllers version 2.4.52"); +MODULE_SUPPORTED_DEVICE("HP SA5i SA5i+ SA532 SA5300 SA5312 SA641 SA642 SA6400 6i SA6422 V100"); MODULE_LICENSE("GPL"); #include "cciss_cmd.h" @@ -78,6 +78,10 @@ 0x0E11, 0x409D, 0, 0, 0}, { PCI_VENDOR_ID_COMPAQ, PCI_DEVICE_ID_COMPAQ_CISSC, 0x0E11, 0x4091, 0, 0, 0}, + { PCI_VENDOR_ID_COMPAQ, PCI_DEVICE_ID_COMPAQ_CISSC, + 0x0E11, 0x409E, 0, 0, 0}, + { PCI_VENDOR_ID_COMPAQ, PCI_DEVICE_ID_COMPAQ_CISSC, + 0x103C, 0x3211, 0, 0, 0}, {0,} }; MODULE_DEVICE_TABLE(pci, cciss_pci_device_id); @@ -98,6 +102,8 @@ { 0x409C0E11, "Smart Array 6400", &SA5_access}, { 0x409D0E11, "Smart Array 6400 EM", &SA5_access}, { 0x40910E11, "Smart Array 6i", &SA5_access}, + { 0x409E0E11, "Smart Array 6422", &SA5_access}, + { 0x3211103C, "Smart Array V100", &SA5_access}, }; /* How long to wait (in millesconds) for board to go into simple mode */ diff -Nru a/drivers/char/Config.in b/drivers/char/Config.in --- a/drivers/char/Config.in Sun May 9 15:31:35 2004 +++ b/drivers/char/Config.in Sun May 9 15:31:35 2004 @@ -273,7 +273,6 @@ if [ "$CONFIG_SGI_IP22" = "y" ]; then dep_tristate ' Indy/I2 Hardware Watchdog' CONFIG_INDYDOG $CONFIG_SGI_IP22 fi - dep_tristate ' AMD 766/768 TCO Timer/Watchdog' CONFIG_AMD7XX_TCO $CONFIG_EXPERIMENTAL if [ "$CONFIG_8xx" = "y" ]; then tristate ' MPC8xx Watchdog Timer' CONFIG_8xx_WDT fi diff -Nru a/drivers/char/Makefile b/drivers/char/Makefile --- a/drivers/char/Makefile Sun May 9 15:31:35 2004 +++ b/drivers/char/Makefile Sun May 9 15:31:35 2004 @@ -320,7 +320,6 @@ obj-$(CONFIG_SCx200_WDT) += scx200_wdt.o obj-$(CONFIG_WAFER_WDT) += wafer5823wdt.o obj-$(CONFIG_SOFT_WATCHDOG) += softdog.o -obj-$(CONFIG_AMD7XX_TCO) += amd7xx_tco.o obj-$(CONFIG_INDYDOG) += indydog.o obj-$(CONFIG_8xx_WDT) += mpc8xx_wdt.o diff -Nru a/drivers/char/amd7xx_tco.c b/drivers/char/amd7xx_tco.c --- a/drivers/char/amd7xx_tco.c Sun May 9 15:31:35 2004 +++ /dev/null Wed Dec 31 16:00:00 1969 @@ -1,387 +0,0 @@ -/* - * AMD 766/768 TCO Timer Driver - * (c) Copyright 2002 Zwane Mwaikambo - * All Rights Reserved. - * - * Parts from; - * Hardware driver for the AMD 768 Random Number Generator (RNG) - * (c) Copyright 2001 Red Hat Inc - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License version 2 - * as published by the Free Software Foundation. - * - * The author(s) of this software shall not be held liable for damages - * of any nature resulting due to the use of this software. This - * software is provided AS-IS with no warranties. - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define AMDTCO_MODULE_VER "build 20021116" -#define AMDTCO_MODULE_NAME "amd7xx_tco" -#define PFX AMDTCO_MODULE_NAME ": " - -#define MAX_TIMEOUT 38 /* max of 38 seconds, although the system will only - * reset itself after the second timeout */ - -/* pmbase registers */ -#define TCO_RELOAD_REG 0x40 /* bits 0-5 are current count, 6-7 are reserved */ -#define TCO_INITVAL_REG 0x41 /* bits 0-5 are value to load, 6-7 are reserved */ -#define TCO_TIMEOUT_MASK 0x3f -#define TCO_STATUS1_REG 0x44 -#define TCO_STATUS2_REG 0x46 -#define NDTO_STS2 (1 << 1) /* we're interested in the second timeout */ -#define BOOT_STS (1 << 2) /* will be set if NDTO_STS2 was set before reboot */ -#define TCO_CTRL1_REG 0x48 -#define TCO_HALT (1 << 11) -#define NO_REBOOT (1 << 10) /* in DevB:3x48 */ - -static char banner[] __initdata = KERN_INFO PFX AMDTCO_MODULE_VER "\n"; -static int timeout = 38; -static u32 pmbase; /* PMxx I/O base */ -static struct pci_dev *dev; -static struct semaphore open_sem; -static spinlock_t amdtco_lock; /* only for device access */ -static int expect_close = 0; - -MODULE_PARM(timeout, "i"); -MODULE_PARM_DESC(timeout, "range is 0-38 seconds, default is 38"); - -static inline u8 seconds_to_ticks(int seconds) -{ - /* the internal timer is stored as ticks which decrement - * every 0.6 seconds */ - return (seconds * 10) / 6; -} - -static inline int ticks_to_seconds(u8 ticks) -{ - return (ticks * 6) / 10; -} - -static inline int amdtco_status(void) -{ - u16 reg; - int status = 0; - - reg = inb(pmbase+TCO_CTRL1_REG); - if ((reg & TCO_HALT) == 0) - status |= WDIOF_KEEPALIVEPING; - - reg = inb(pmbase+TCO_STATUS2_REG); - if (reg & BOOT_STS) - status |= WDIOF_CARDRESET; - - return status; -} - -static inline void amdtco_ping(void) -{ - outb(1, pmbase+TCO_RELOAD_REG); -} - -static inline int amdtco_gettimeout(void) -{ - u8 reg = inb(pmbase+TCO_RELOAD_REG) & TCO_TIMEOUT_MASK; - return ticks_to_seconds(reg); -} - -static inline void amdtco_settimeout(unsigned int timeout) -{ - u8 reg = seconds_to_ticks(timeout) & TCO_TIMEOUT_MASK; - outb(reg, pmbase+TCO_INITVAL_REG); -} - -static inline void amdtco_global_enable(void) -{ - u16 reg; - - spin_lock(&amdtco_lock); - - /* clear NO_REBOOT on DevB:3x48 p97 */ - pci_read_config_word(dev, 0x48, ®); - reg &= ~NO_REBOOT; - pci_write_config_word(dev, 0x48, reg); - - spin_unlock(&amdtco_lock); -} - -static inline void amdtco_enable(void) -{ - u16 reg; - - spin_lock(&amdtco_lock); - reg = inw(pmbase+TCO_CTRL1_REG); - reg &= ~TCO_HALT; - outw(reg, pmbase+TCO_CTRL1_REG); - spin_unlock(&amdtco_lock); -} - -static inline void amdtco_disable(void) -{ - u16 reg; - - spin_lock(&amdtco_lock); - reg = inw(pmbase+TCO_CTRL1_REG); - reg |= TCO_HALT; - outw(reg, pmbase+TCO_CTRL1_REG); - spin_unlock(&amdtco_lock); -} - -static int amdtco_fop_open(struct inode *inode, struct file *file) -{ - if (down_trylock(&open_sem)) - return -EBUSY; - -#ifdef CONFIG_WATCHDOG_NOWAYOUT - MOD_INC_USE_COUNT; -#endif - - if (timeout > MAX_TIMEOUT) - timeout = MAX_TIMEOUT; - - amdtco_disable(); - amdtco_settimeout(timeout); - amdtco_global_enable(); - amdtco_enable(); - amdtco_ping(); - printk(KERN_INFO PFX "Watchdog enabled, timeout = %ds of %ds\n", - amdtco_gettimeout(), timeout); - - return 0; -} - - -static int amdtco_fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) -{ - int new_timeout; - int tmp; - - static struct watchdog_info ident = { - options: WDIOF_SETTIMEOUT | WDIOF_CARDRESET, - identity: "AMD 766/768" - }; - - switch (cmd) { - default: - return -ENOTTY; - - case WDIOC_GETSUPPORT: - if (copy_to_user((struct watchdog_info *)arg, &ident, sizeof ident)) - return -EFAULT; - return 0; - - case WDIOC_GETSTATUS: - return put_user(amdtco_status(), (int *)arg); - - case WDIOC_KEEPALIVE: - amdtco_ping(); - return 0; - - case WDIOC_SETTIMEOUT: - if (get_user(new_timeout, (int *)arg)) - return -EFAULT; - - if (new_timeout < 0) - return -EINVAL; - - if (new_timeout > MAX_TIMEOUT) - new_timeout = MAX_TIMEOUT; - - timeout = new_timeout; - amdtco_settimeout(timeout); - /* fall through and return the new timeout */ - - case WDIOC_GETTIMEOUT: - return put_user(amdtco_gettimeout(), (int *)arg); - - case WDIOC_SETOPTIONS: - if (copy_from_user(&tmp, (int *)arg, sizeof tmp)) - return -EFAULT; - - if (tmp & WDIOS_DISABLECARD) - amdtco_disable(); - - if (tmp & WDIOS_ENABLECARD) - amdtco_enable(); - - return 0; - } -} - - -static int amdtco_fop_release(struct inode *inode, struct file *file) -{ - if (expect_close) { - amdtco_disable(); - printk(KERN_INFO PFX "Watchdog disabled\n"); - } else { - amdtco_ping(); - printk(KERN_CRIT PFX "Unexpected close!, timeout in %d seconds\n", timeout); - } - - up(&open_sem); - return 0; -} - - -static ssize_t amdtco_fop_write(struct file *file, const char *data, size_t len, loff_t *ppos) -{ - if (ppos != &file->f_pos) - return -ESPIPE; - - if (len) { -#ifndef CONFIG_WATCHDOG_NOWAYOUT - size_t i; - char c; - expect_close = 0; - - for (i = 0; i != len; i++) { - if (get_user(c, data + i)) - return -EFAULT; - - if (c == 'V') - expect_close = 1; - } -#endif - amdtco_ping(); - } - - return len; -} - - -static int amdtco_notify_sys(struct notifier_block *this, unsigned long code, void *unused) -{ - if (code == SYS_DOWN || code == SYS_HALT) - amdtco_disable(); - - return NOTIFY_DONE; -} - - -static struct notifier_block amdtco_notifier = -{ - notifier_call: amdtco_notify_sys -}; - -static struct file_operations amdtco_fops = -{ - owner: THIS_MODULE, - write: amdtco_fop_write, - ioctl: amdtco_fop_ioctl, - open: amdtco_fop_open, - release: amdtco_fop_release -}; - -static struct miscdevice amdtco_miscdev = -{ - minor: WATCHDOG_MINOR, - name: "watchdog", - fops: &amdtco_fops -}; - -static struct pci_device_id amdtco_pci_tbl[] __initdata = { - { 0x1022, 0x7443, PCI_ANY_ID, PCI_ANY_ID, }, - { 0, } -}; - -MODULE_DEVICE_TABLE (pci, amdtco_pci_tbl); - -static int __init amdtco_init(void) -{ - int ret; - - sema_init(&open_sem, 1); - spin_lock_init(&amdtco_lock); - - pci_for_each_dev(dev) { - if (pci_match_device (amdtco_pci_tbl, dev) != NULL) - goto found_one; - } - - return -ENODEV; - -found_one: - - if ((ret = register_reboot_notifier(&amdtco_notifier))) { - printk(KERN_ERR PFX "Unable to register reboot notifier err = %d\n", ret); - goto out_clean; - } - - if ((ret = misc_register(&amdtco_miscdev))) { - printk(KERN_ERR PFX "Unable to register miscdev on minor %d\n", WATCHDOG_MINOR); - goto out_unreg_reboot; - } - - pci_read_config_dword(dev, 0x58, &pmbase); - pmbase &= 0x0000FF00; - - if (pmbase == 0) { - printk (KERN_ERR PFX "power management base not set\n"); - ret = -EIO; - goto out_unreg_misc; - } - - /* ret = 0; */ - printk(banner); - goto out_clean; - -out_unreg_misc: - misc_deregister(&amdtco_miscdev); -out_unreg_reboot: - unregister_reboot_notifier(&amdtco_notifier); -out_clean: - return ret; -} - -static void __exit amdtco_exit(void) -{ - misc_deregister(&amdtco_miscdev); - unregister_reboot_notifier(&amdtco_notifier); -} - - -#ifndef MODULE -static int __init amdtco_setup(char *str) -{ - int ints[4]; - - str = get_options (str, ARRAY_SIZE(ints), ints); - if (ints[0] > 0) - timeout = ints[1]; - - if (!timeout || timeout > 38) - timeout = MAX_TIMEOUT; - - return 1; -} - -__setup("amd7xx_tco=", amdtco_setup); -#endif - -module_init(amdtco_init); -module_exit(amdtco_exit); - -MODULE_AUTHOR("Zwane Mwaikambo "); -MODULE_DESCRIPTION("AMD 766/768 TCO Timer Driver"); -MODULE_LICENSE("GPL"); -EXPORT_NO_SYMBOLS; - diff -Nru a/drivers/char/tipar.c b/drivers/char/tipar.c --- a/drivers/char/tipar.c Sun May 9 15:31:35 2004 +++ b/drivers/char/tipar.c Sun May 9 15:31:35 2004 @@ -124,7 +124,7 @@ /* ----- global defines ----------------------------------------------- */ -#define START(x) { x=jiffies+HZ/(timeout/10); } +#define START(x) { x = jiffies + (HZ * timeout) / 10; } #define WAIT(x) { \ if (time_before((x), jiffies)) return -1; \ if (need_resched()) schedule(); } diff -Nru a/drivers/media/video/videodev.c b/drivers/media/video/videodev.c --- a/drivers/media/video/videodev.c Sun May 9 15:31:35 2004 +++ b/drivers/media/video/videodev.c Sun May 9 15:31:35 2004 @@ -553,19 +553,19 @@ /* pick a minor number */ down(&videodev_lock); - if (-1 == nr) { + if (nr >= 0 && nr < end-base) { + /* use the one the driver asked for */ + i = base+nr; + if (NULL != video_device[i]) { + up(&videodev_lock); + return -ENFILE; + } + } else { /* use first free */ for(i=base;islot_name); return -EINVAL; diff -Nru a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c --- a/drivers/scsi/scsi_scan.c Sun May 9 15:31:35 2004 +++ b/drivers/scsi/scsi_scan.c Sun May 9 15:31:35 2004 @@ -148,7 +148,7 @@ {"EMULEX", "MD21/S2 ESDI", "*", BLIST_SINGLELUN}, {"CANON", "IPUBJD", "*", BLIST_SPARSELUN}, {"nCipher", "Fastness Crypto", "*", BLIST_FORCELUN}, - {"DEC","HSG80","*", BLIST_FORCELUN | BLIST_NOSTARTONADD}, + {"DEC","HSG80","*", BLIST_SPARSELUN | BLIST_LARGELUN | BLIST_NOSTARTONADD}, {"COMPAQ","LOGICAL VOLUME","*", BLIST_FORCELUN}, {"COMPAQ","CR3500","*", BLIST_FORCELUN}, {"NEC", "PD-1 ODX654P", "*", BLIST_FORCELUN | BLIST_SINGLELUN}, diff -Nru a/fs/ext2/super.c b/fs/ext2/super.c --- a/fs/ext2/super.c Sun May 9 15:31:35 2004 +++ b/fs/ext2/super.c Sun May 9 15:31:35 2004 @@ -427,7 +427,7 @@ unsigned short resuid = EXT2_DEF_RESUID; unsigned short resgid = EXT2_DEF_RESGID; unsigned long block; - unsigned long logic_sb_block = 1; + unsigned long logic_sb_block; unsigned long offset = 0; kdev_t dev = sb->s_dev; int blocksize = BLOCK_SIZE; @@ -465,6 +465,8 @@ if (blocksize != BLOCK_SIZE) { logic_sb_block = (sb_block*BLOCK_SIZE) / blocksize; offset = (sb_block*BLOCK_SIZE) % blocksize; + } else { + logic_sb_block = sb_block; } if (!(bh = sb_bread(sb, logic_sb_block))) { diff -Nru a/fs/jfs/jfs_dtree.c b/fs/jfs/jfs_dtree.c --- a/fs/jfs/jfs_dtree.c Sun May 9 15:31:35 2004 +++ b/fs/jfs/jfs_dtree.c Sun May 9 15:31:35 2004 @@ -982,7 +982,9 @@ split->pxdlist = &pxdlist; rc = dtSplitRoot(tid, ip, split, &rmp); - DT_PUTPAGE(rmp); + if (!rc) + DT_PUTPAGE(rmp); + DT_PUTPAGE(smp); goto freeKeyName; @@ -1876,6 +1878,9 @@ xlen = lengthPXD(pxd); xsize = xlen << JFS_SBI(sb)->l2bsize; rmp = get_metapage(ip, rbn, xsize, 1); + if (!rmp) + return -EIO; + rp = rmp->data; BT_MARK_DIRTY(rmp, ip); diff -Nru a/fs/jfs/jfs_txnmgr.c b/fs/jfs/jfs_txnmgr.c --- a/fs/jfs/jfs_txnmgr.c Sun May 9 15:31:35 2004 +++ b/fs/jfs/jfs_txnmgr.c Sun May 9 15:31:35 2004 @@ -1,5 +1,5 @@ /* - * Copyright (C) International Business Machines Corp., 2000-2003 + * Copyright (C) International Business Machines Corp., 2000-2004 * Portions Copyright (C) Christoph Hellwig, 2001-2002 * * This program is free software; you can redistribute it and/or modify @@ -175,7 +175,6 @@ struct tlock * tlck); static void mapLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, struct tlock * tlck); -static void txAbortCommit(struct commit * cd); static void txAllocPMap(struct inode *ip, struct maplock * maplock, struct tblock * tblk); static void txForce(struct tblock * tblk); @@ -1295,7 +1294,7 @@ out: if (rc != 0) - txAbortCommit(&cd); + txAbort(tid, 1); TheEnd: jfs_info("txCommit: tid = %d, returning %d", tid, rc); @@ -2632,64 +2631,6 @@ return; } - - -/* - * txAbortCommit() - * - * function: abort commit. - * - * frees tlocks of transaction; line-locks and segment locks for all - * segments in comdata structure. frees malloc storage - * sets state of file-system to FM_MDIRTY in super-block. - * log age of page-frames in memory for which caller has - * are reset to 0 (to avoid logwarap). - */ -static void txAbortCommit(struct commit * cd) -{ - struct tblock *tblk; - tid_t tid; - lid_t lid, next; - struct metapage *mp; - - jfs_warn("txAbortCommit: cd:0x%p", cd); - - /* - * free tlocks of the transaction - */ - tid = cd->tid; - tblk = tid_to_tblock(tid); - for (lid = tblk->next; lid; lid = next) { - next = lid_to_tlock(lid)->next; - - mp = lid_to_tlock(lid)->mp; - if (mp) { - mp->lid = 0; - - /* - * reset lsn of page to avoid logwarap; - */ - if (mp->xflag & COMMIT_PAGE) - LogSyncRelease(mp); - } - - /* insert tlock at head of freelist */ - TXN_LOCK(); - txLockFree(lid); - TXN_UNLOCK(); - } - - tblk->next = tblk->last = 0; - - /* free the transaction block */ - txEnd(tid); - - /* - * mark filesystem dirty - */ - jfs_error(cd->sb, "txAbortCommit"); -} - /* * txLazyCommit(void) diff -Nru a/fs/jfs/namei.c b/fs/jfs/namei.c --- a/fs/jfs/namei.c Sun May 9 15:31:35 2004 +++ b/fs/jfs/namei.c Sun May 9 15:31:35 2004 @@ -784,14 +784,14 @@ goto out; if ((rc = dtSearch(dir, &dname, &ino, &btstack, JFS_CREATE))) - goto out; + goto free_dname; /* * create entry for new link in parent directory */ ino = ip->i_ino; if ((rc = dtInsert(tid, dir, &dname, &ino, &btstack))) - goto out; + goto free_dname; /* update object inode */ ip->i_nlink++; /* for new link */ @@ -803,6 +803,9 @@ iplist[0] = ip; iplist[1] = dir; rc = txCommit(tid, 2, &iplist[0], 0); + + free_dname: + free_UCSname(&dname); out: txEnd(tid); diff -Nru a/include/asm-i386/acpi.h b/include/asm-i386/acpi.h --- a/include/asm-i386/acpi.h Sun May 9 15:31:35 2004 +++ b/include/asm-i386/acpi.h Sun May 9 15:31:35 2004 @@ -99,32 +99,42 @@ :"=r"(n_hi), "=r"(n_lo) \ :"0"(n_hi), "1"(n_lo)) +#ifdef CONFIG_ACPI_PCI +extern int acpi_noirq; +extern int acpi_pci_disabled; +static inline void acpi_noirq_set(void) { acpi_noirq = 1; } +static inline void acpi_disable_pci(void) +{ + acpi_pci_disabled = 1; + acpi_noirq_set(); +} +extern int acpi_irq_balance_set(char *str); +#else +static inline void acpi_noirq_set(void) { } +static inline void acpi_disable_pci(void) { acpi_noirq_set(); } +static inline int acpi_irq_balance_set(char *str) { return 0; } +#endif #ifdef CONFIG_ACPI_BOOT extern int acpi_lapic; extern int acpi_ioapic; -extern int acpi_noirq; extern int acpi_strict; extern int acpi_disabled; extern int acpi_ht; -static inline void disable_acpi(void) { acpi_disabled = 1; acpi_ht = 0; } +static inline void disable_acpi(void) +{ + acpi_disabled = 1; + acpi_ht = 0; + acpi_disable_pci(); +} /* Fixmap pages to reserve for ACPI boot-time tables (see fixmap.h) */ #define FIX_ACPI_PAGES 4 #else /* !CONFIG_ACPI_BOOT */ -# define acpi_lapic 0 -# define acpi_ioapic 0 - +#define acpi_lapic 0 +#define acpi_ioapic 0 #endif /* !CONFIG_ACPI_BOOT */ - -#ifdef CONFIG_ACPI_PCI -static inline void acpi_noirq_set(void) { acpi_noirq = 1; } -extern int acpi_irq_balance_set(char *str); -#else -static inline void acpi_noirq_set(void) { } -static inline int acpi_irq_balance_set(char *str) { return 0; } -#endif #ifdef CONFIG_ACPI_SLEEP diff -Nru a/include/asm-sh64/cayman.h b/include/asm-sh64/cayman.h --- a/include/asm-sh64/cayman.h Sun May 9 15:31:35 2004 +++ b/include/asm-sh64/cayman.h Sun May 9 15:31:35 2004 @@ -13,7 +13,7 @@ */ -/* Setup for the SMSC FDC37C935 */ +/* Setup for the SMSC FDC37C935 / LAN91C100FD */ #define SMSC_IRQ IRQ_IRL1 /* Setup for PCI Bus 2, which transmits interrupts via the EPLD */ diff -Nru a/include/asm-sh64/io.h b/include/asm-sh64/io.h --- a/include/asm-sh64/io.h Sun May 9 15:31:35 2004 +++ b/include/asm-sh64/io.h Sun May 9 15:31:35 2004 @@ -107,6 +107,13 @@ #ifdef __KERNEL__ +#ifdef CONFIG_SH_CAYMAN +extern unsigned long smsc_superio_virt; +#endif +#ifdef CONFIG_PCI +extern unsigned long pciio_virt; +#endif + #define IO_SPACE_LIMIT 0xffffffff /* diff -Nru a/include/asm-sh64/keyboard.h b/include/asm-sh64/keyboard.h --- a/include/asm-sh64/keyboard.h Sun May 9 15:31:35 2004 +++ b/include/asm-sh64/keyboard.h Sun May 9 15:31:35 2004 @@ -19,7 +19,7 @@ #include #ifdef CONFIG_SH_CAYMAN -#define KEYBOARD_IRQ (START_EXT_IRQS + 2) /* SMSC IRQ 1 */ +#define KEYBOARD_IRQ (START_EXT_IRQS + 2) /* SMSC SuperIO IRQ 1 */ #endif #define DISABLE_KBD_DURING_INTERRUPTS 0 @@ -61,7 +61,7 @@ */ #ifdef CONFIG_SH_CAYMAN -#define AUX_IRQ (START_EXT_IRQS + 6) /* SMSC IRQ12 */ +#define AUX_IRQ (START_EXT_IRQS + 6) /* SMSC SuperIO IRQ12 */ #endif #define aux_request_irq(hand, dev_id) \ diff -Nru a/include/asm-sh64/processor.h b/include/asm-sh64/processor.h --- a/include/asm-sh64/processor.h Sun May 9 15:31:35 2004 +++ b/include/asm-sh64/processor.h Sun May 9 15:31:35 2004 @@ -101,7 +101,7 @@ */ #define SR_FD 0x00008000 -#ifdef ST_DEBUG +#if defined(CONFIG_SH64_SR_WATCH) #define SR_MMU 0x84000000 #else #define SR_MMU 0x80000000 diff -Nru a/include/asm-sh64/registers.h b/include/asm-sh64/registers.h --- a/include/asm-sh64/registers.h Sun May 9 15:31:35 2004 +++ b/include/asm-sh64/registers.h Sun May 9 15:31:35 2004 @@ -115,7 +115,7 @@ #define SR_HARMLESS 0x00000000500080f0 /* Write ignores for most */ #define SR_ENABLE_FPU 0xffffffffffff7fff /* AND with this */ -#ifdef ST_DEBUG +#if defined (CONFIG_SH64_SR_WATCH) #define SR_ENABLE_MMU 0x0000000084000000 /* OR with this */ #else #define SR_ENABLE_MMU 0x0000000080000000 /* OR with this */ diff -Nru a/include/asm-sh64/unistd.h b/include/asm-sh64/unistd.h --- a/include/asm-sh64/unistd.h Sun May 9 15:31:35 2004 +++ b/include/asm-sh64/unistd.h Sun May 9 15:31:35 2004 @@ -287,20 +287,31 @@ type name(void) \ { \ register unsigned long __sc0 __asm__ ("r9") = ((0x10 << 16) | __NR_##name); \ -__asm__ __volatile__ ("trapa %1" \ +__asm__ __volatile__ ("trapa %1 !\t\t\t" #name "()" \ : "=r" (__sc0) \ : "r" (__sc0) ); \ __syscall_return(type,__sc0); \ } + /* + * The apparent spurious "dummy" assembler comment is *needed*, + * as without it, the compiler treats the arg variables + * as no longer live just before the asm. The compiler can + * then optimize the storage into any registers it wishes. + * The additional dummy statement forces the compiler to put + * the arguments into the correct registers before the TRAPA. + */ #define _syscall1(type,name,type1,arg1) \ type name(type1 arg1) \ { \ register unsigned long __sc0 __asm__ ("r9") = ((0x11 << 16) | __NR_##name); \ register unsigned long __sc2 __asm__ ("r2") = (unsigned long) arg1; \ -__asm__ __volatile__ ("trapa %1" \ +__asm__ __volatile__ ("trapa %1 !\t\t\t" #name "(%2)" \ : "=r" (__sc0) \ : "r" (__sc0), "r" (__sc2)); \ +__asm__ __volatile__ ("!dummy %0 %1" \ + : \ + : "r" (__sc0), "r" (__sc2)); \ __syscall_return(type,__sc0); \ } @@ -310,9 +321,12 @@ register unsigned long __sc0 __asm__ ("r9") = ((0x12 << 16) | __NR_##name); \ register unsigned long __sc2 __asm__ ("r2") = (unsigned long) arg1; \ register unsigned long __sc3 __asm__ ("r3") = (unsigned long) arg2; \ -__asm__ __volatile__ ("trapa %1" \ +__asm__ __volatile__ ("trapa %1 !\t\t\t" #name "(%2,%3)" \ : "=r" (__sc0) \ : "r" (__sc0), "r" (__sc2), "r" (__sc3) ); \ +__asm__ __volatile__ ("!dummy %0 %1 %2" \ + : \ + : "r" (__sc0), "r" (__sc2), "r" (__sc3) ); \ __syscall_return(type,__sc0); \ } @@ -323,9 +337,12 @@ register unsigned long __sc2 __asm__ ("r2") = (unsigned long) arg1; \ register unsigned long __sc3 __asm__ ("r3") = (unsigned long) arg2; \ register unsigned long __sc4 __asm__ ("r4") = (unsigned long) arg3; \ -__asm__ __volatile__ ("trapa %1" \ +__asm__ __volatile__ ("trapa %1 !\t\t\t" #name "(%2,%3,%4)" \ : "=r" (__sc0) \ : "r" (__sc0), "r" (__sc2), "r" (__sc3), "r" (__sc4) ); \ +__asm__ __volatile__ ("!dummy %0 %1 %2 %3" \ + : \ + : "r" (__sc0), "r" (__sc2), "r" (__sc3), "r" (__sc4) ); \ __syscall_return(type,__sc0); \ } @@ -337,9 +354,12 @@ register unsigned long __sc3 __asm__ ("r3") = (unsigned long) arg2; \ register unsigned long __sc4 __asm__ ("r4") = (unsigned long) arg3; \ register unsigned long __sc5 __asm__ ("r5") = (unsigned long) arg4; \ -__asm__ __volatile__ ("trapa %1" \ +__asm__ __volatile__ ("trapa %1 !\t\t\t" #name "(%2,%3,%4,%5)" \ : "=r" (__sc0) \ : "r" (__sc0), "r" (__sc2), "r" (__sc3), "r" (__sc4), "r" (__sc5) );\ +__asm__ __volatile__ ("!dummy %0 %1 %2 %3 %4" \ + : \ + : "r" (__sc0), "r" (__sc2), "r" (__sc3), "r" (__sc4), "r" (__sc5) );\ __syscall_return(type,__sc0); \ } @@ -352,9 +372,13 @@ register unsigned long __sc4 __asm__ ("r4") = (unsigned long) arg3; \ register unsigned long __sc5 __asm__ ("r5") = (unsigned long) arg4; \ register unsigned long __sc6 __asm__ ("r6") = (unsigned long) arg5; \ -__asm__ __volatile__ ("trapa %1" \ +__asm__ __volatile__ ("trapa %1 !\t\t\t" #name "(%2,%3,%4,%5,%6)" \ : "=r" (__sc0) \ - : "r" (__sc0), "r" (__sc2), "r" (__sc3), "r" (__sc4), "r" (__sc5), \ + : "r" (__sc0), "r" (__sc2), "r" (__sc3), "r" (__sc4), "r" (__sc5), \ + "r" (__sc6)); \ +__asm__ __volatile__ ("!dummy %0 %1 %2 %3 %4 %5" \ + : \ + : "r" (__sc0), "r" (__sc2), "r" (__sc3), "r" (__sc4), "r" (__sc5), \ "r" (__sc6)); \ __syscall_return(type,__sc0); \ } @@ -369,9 +393,13 @@ register unsigned long __sc5 __asm__ ("r5") = (unsigned long) arg4; \ register unsigned long __sc6 __asm__ ("r6") = (unsigned long) arg5; \ register unsigned long __sc7 __asm__ ("r7") = (unsigned long) arg6; \ -__asm__ __volatile__ ("trapa %1" \ +__asm__ __volatile__ ("trapa %1 !\t\t\t" #name "(%2,%3,%4,%5,%6,%7)" \ : "=r" (__sc0) \ - : "r" (__sc0), "r" (__sc2), "r" (__sc3), "r" (__sc4), "r" (__sc5), \ + : "r" (__sc0), "r" (__sc2), "r" (__sc3), "r" (__sc4), "r" (__sc5), \ + "r" (__sc6), "r" (__sc7)); \ +__asm__ __volatile__ ("!dummy %0 %1 %2 %3 %4 %5 %6" \ + : \ + : "r" (__sc0), "r" (__sc2), "r" (__sc3), "r" (__sc4), "r" (__sc5), \ "r" (__sc6), "r" (__sc7)); \ __syscall_return(type,__sc0); \ } diff -Nru a/include/asm-x86_64/acpi.h b/include/asm-x86_64/acpi.h --- a/include/asm-x86_64/acpi.h Sun May 9 15:31:35 2004 +++ b/include/asm-x86_64/acpi.h Sun May 9 15:31:35 2004 @@ -91,39 +91,48 @@ :"r"(d32), \ "0"(n_lo), "1"(n_hi)) - #define ACPI_SHIFT_RIGHT_64(n_hi, n_lo) \ asm("shrl $1,%2;" \ "rcrl $1,%3;" \ :"=r"(n_hi), "=r"(n_lo) \ :"0"(n_hi), "1"(n_lo)) - +#ifdef CONFIG_ACPI_PCI +extern int acpi_noirq; +extern int acpi_pci_disabled; +static inline void acpi_noirq_set(void) { acpi_noirq = 1; } +static inline void acpi_disable_pci(void) +{ + acpi_pci_disabled = 1; + acpi_noirq_set(); +} +extern int acpi_irq_balance_set(char *str); +#else +static inline void acpi_noirq_set(void) { } +static inline void acpi_disable_pci(void) { acpi_noirq_set(); } +static inline int acpi_irq_balance_set(char *str) { return 0; } +#endif #ifdef CONFIG_ACPI_BOOT extern int acpi_lapic; extern int acpi_ioapic; -extern int acpi_noirq; extern int acpi_strict; extern int acpi_disabled; extern int acpi_ht; -static inline void disable_acpi(void) { acpi_disabled = 1; acpi_ht = 0; } +static inline void disable_acpi(void) +{ + acpi_disabled = 1; + acpi_ht = 0; + acpi_disable_pci(); +} /* Fixmap pages to reserve for ACPI boot-time tables (see fixmap.h) */ #define FIX_ACPI_PAGES 4 -#else /* CONFIG_ACPI_BOOT */ -# define acpi_lapic 0 -# define acpi_ioapic 0 - -#endif +#else /* !CONFIG_ACPI_BOOT */ +#define acpi_lapic 0 +#define acpi_ioapic 0 +#endif /* !CONFIG_ACPI_BOOT */ -#ifdef CONFIG_ACPI_PCI -static inline void acpi_noirq_set(void) { acpi_noirq = 1; } -extern int acpi_irq_balance_set(char *str); -#else -static inline void acpi_noirq_set(void) { } -static inline int acpi_irq_balance_set(char *str) { return 0; } -#endif #ifdef CONFIG_ACPI_SLEEP diff -Nru a/include/linux/acpi.h b/include/linux/acpi.h --- a/include/linux/acpi.h Sun May 9 15:31:35 2004 +++ b/include/linux/acpi.h Sun May 9 15:31:35 2004 @@ -319,6 +319,14 @@ /* Table Handlers */ +/* PCI MMCONFIG */ +struct acpi_table_mcfg { + struct acpi_table_header header; + u8 reserved[8]; + u32 base_address; + u32 base_reserved; +} __attribute__ ((packed)); + enum acpi_table_id { ACPI_TABLE_UNKNOWN = 0, ACPI_APIC, @@ -338,6 +346,7 @@ ACPI_SSDT, ACPI_SPMI, ACPI_HPET, + ACPI_MCFG, ACPI_TABLE_COUNT }; diff -Nru a/include/linux/kernel.h b/include/linux/kernel.h --- a/include/linux/kernel.h Sun May 9 15:31:35 2004 +++ b/include/linux/kernel.h Sun May 9 15:31:35 2004 @@ -196,4 +196,11 @@ #define BUG_ON(condition) do { if (unlikely((condition)!=0)) BUG(); } while(0) +#define WARN_ON(condition) do { \ + if (unlikely((condition)!=0)) { \ + printk("Badness in %s at %s:%d\n", __FUNCTION__, __FILE__, __LINE__); \ + dump_stack(); \ + } \ +} while (0) + #endif /* _LINUX_KERNEL_H */ diff -Nru a/include/net/sctp/constants.h b/include/net/sctp/constants.h --- a/include/net/sctp/constants.h Sun May 9 15:31:35 2004 +++ b/include/net/sctp/constants.h Sun May 9 15:31:35 2004 @@ -231,11 +231,6 @@ /* This is a table of printable names of sctp_state_t's. */ extern const char *sctp_state_tbl[], *sctp_evttype_tbl[], *sctp_status_tbl[]; -/* SCTP reachability state for each address */ -#define SCTP_ADDR_NOHB 4 -#define SCTP_ADDR_REACHABLE 2 -#define SCTP_ADDR_NOT_REACHABLE 1 - /* Maximum chunk length considering padding requirements. */ enum { SCTP_MAX_CHUNK_LEN = ((1<<16) - sizeof(__u32)) }; diff -Nru a/include/net/sctp/user.h b/include/net/sctp/user.h --- a/include/net/sctp/user.h Sun May 9 15:31:35 2004 +++ b/include/net/sctp/user.h Sun May 9 15:31:35 2004 @@ -1,7 +1,7 @@ /* SCTP kernel reference Implementation + * (C) Copyright IBM Corp. 2001, 2004 * Copyright (c) 1999-2000 Cisco, Inc. * Copyright (c) 1999-2001 Motorola, Inc. - * Copyright (c) 2001-2003 International Business Machines, Corp. * Copyright (c) 2002 Intel Corp. * * This file is part of the SCTP kernel reference Implementation @@ -246,7 +246,7 @@ * event that happened to the address. They include: */ enum sctp_spc_state { - SCTP_ADDR_REACHABLE, + SCTP_ADDR_AVAILABLE, SCTP_ADDR_UNREACHABLE, SCTP_ADDR_REMOVED, SCTP_ADDR_ADDED, diff -Nru a/net/sctp/associola.c b/net/sctp/associola.c --- a/net/sctp/associola.c Sun May 9 15:31:35 2004 +++ b/net/sctp/associola.c Sun May 9 15:31:35 2004 @@ -1,5 +1,5 @@ /* SCTP kernel reference Implementation - * (C) Copyright IBM Corp. 2001, 2003 + * (C) Copyright IBM Corp. 2001, 2004 * Copyright (c) 1999-2000 Cisco, Inc. * Copyright (c) 1999-2001 Motorola, Inc. * Copyright (c) 2001 Intel Corp. @@ -604,7 +604,7 @@ switch (command) { case SCTP_TRANSPORT_UP: transport->active = SCTP_ACTIVE; - spc_state = SCTP_ADDR_REACHABLE; + spc_state = SCTP_ADDR_AVAILABLE; break; case SCTP_TRANSPORT_DOWN: @@ -951,6 +951,9 @@ void sctp_assoc_update(struct sctp_association *asoc, struct sctp_association *new) { + struct sctp_transport *trans; + struct list_head *pos, *temp; + /* Copy in new parameters of peer. */ asoc->c = new->c; asoc->peer.rwnd = new->peer.rwnd; @@ -959,20 +962,19 @@ sctp_tsnmap_init(&asoc->peer.tsn_map, SCTP_TSN_MAP_SIZE, asoc->peer.i.initial_tsn); - /* FIXME: - * Do we need to copy primary_path etc? - * - * More explicitly, addresses may have been removed and - * this needs accounting for. - */ + /* Remove any peer addresses not present in the new association. */ + list_for_each_safe(pos, temp, &asoc->peer.transport_addr_list) { + trans = list_entry(pos, struct sctp_transport, transports); + if (!sctp_assoc_lookup_paddr(new, &trans->ipaddr)) + sctp_assoc_del_peer(asoc, &trans->ipaddr); + } /* If the case is A (association restart), use * initial_tsn as next_tsn. If the case is B, use * current next_tsn in case data sent to peer * has been discarded and needs retransmission. */ - if (sctp_state(asoc, ESTABLISHED)) { - + if (asoc->state >= SCTP_STATE_ESTABLISHED) { asoc->next_tsn = new->next_tsn; asoc->ctsn_ack_point = new->ctsn_ack_point; asoc->adv_peer_ack_point = new->adv_peer_ack_point; @@ -983,6 +985,15 @@ sctp_ssnmap_clear(asoc->ssnmap); } else { + /* Add any peer addresses from the new association. */ + list_for_each(pos, &new->peer.transport_addr_list) { + trans = list_entry(pos, struct sctp_transport, + transports); + if (!sctp_assoc_lookup_paddr(asoc, &trans->ipaddr)) + sctp_assoc_add_peer(asoc, &trans->ipaddr, + GFP_ATOMIC); + } + asoc->ctsn_ack_point = asoc->next_tsn - 1; asoc->adv_peer_ack_point = asoc->ctsn_ack_point; if (!asoc->ssnmap) { @@ -991,7 +1002,6 @@ new->ssnmap = NULL; } } - } /* Update the retran path for sending a retransmitted packet. diff -Nru a/net/sctp/crc32c.c b/net/sctp/crc32c.c --- a/net/sctp/crc32c.c Sun May 9 15:31:35 2004 +++ b/net/sctp/crc32c.c Sun May 9 15:31:35 2004 @@ -69,7 +69,7 @@ /* with 24 and 32 Parity Bits", */ /* IEEE Transactions on Communications, Vol.41, No.6, June 1993 */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -__u32 crc_c[256] = { +static const __u32 crc_c[256] = { 0x00000000, 0xF26B8303, 0xE13B70F7, 0x1350F3F4, 0xC79A971F, 0x35F1141C, 0x26A1E7E8, 0xD4CA64EB, 0x8AD958CF, 0x78B2DBCC, 0x6BE22838, 0x9989AB3B,