## Automatically generated incremental diff ## From: linux-2.6.9-rc4 ## To: linux-2.6.9 ## Robot: $Id: make-incremental-diff,v 1.12 2004/01/06 07:19:36 hpa Exp $ diff -urN linux-2.6.9-rc4/Documentation/scsi/ChangeLog.megaraid linux-2.6.9/Documentation/scsi/ChangeLog.megaraid --- linux-2.6.9-rc4/Documentation/scsi/ChangeLog.megaraid 2004-10-18 15:13:21.823681815 -0700 +++ linux-2.6.9/Documentation/scsi/ChangeLog.megaraid 2004-10-18 15:13:40.272432684 -0700 @@ -1,3 +1,11 @@ +Release Date : Mon Sep 27 22:15:07 EDT 2004 - Atul Mukker +Current Version : 2.20.4.0 (scsi module), 2.20.2.0 (cmm module) +Older Version : 2.20.3.1 (scsi module), 2.20.2.0 (cmm module) + +i. Fix data corruption. Because of a typo in the driver, the IO packets + were wrongly shared by the ioctl path. This causes a whole IO command + to be replaced by an incoming ioctl command. + Release Date : Tue Aug 24 09:43:35 EDT 2004 - Atul Mukker Current Version : 2.20.3.1 (scsi module), 2.20.2.0 (cmm module) Older Version : 2.20.3.0 (scsi module), 2.20.2.0 (cmm module) diff -urN linux-2.6.9-rc4/Makefile linux-2.6.9/Makefile --- linux-2.6.9-rc4/Makefile 2004-10-18 15:13:21.957687269 -0700 +++ linux-2.6.9/Makefile 2004-10-18 15:13:40.412438383 -0700 @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 6 SUBLEVEL = 9 -EXTRAVERSION = -rc4 +EXTRAVERSION = NAME=Zonked Quokka # *DOCUMENTATION* diff -urN linux-2.6.9-rc4/arch/h8300/kernel/ptrace.c linux-2.6.9/arch/h8300/kernel/ptrace.c --- linux-2.6.9-rc4/arch/h8300/kernel/ptrace.c 2004-10-18 15:13:22.264699765 -0700 +++ linux-2.6.9/arch/h8300/kernel/ptrace.c 2004-10-18 15:13:41.390478189 -0700 @@ -107,7 +107,7 @@ /* read the word at location addr in the USER area. */ case PTRACE_PEEKUSR: { - unsigned long tmp; + unsigned long tmp = 0; if ((addr & 3) || addr < 0 || addr >= sizeof(struct user)) { ret = -EIO; diff -urN linux-2.6.9-rc4/arch/h8300/lib/checksum.c linux-2.6.9/arch/h8300/lib/checksum.c --- linux-2.6.9-rc4/arch/h8300/lib/checksum.c 2004-08-13 22:36:13.000000000 -0700 +++ linux-2.6.9/arch/h8300/lib/checksum.c 2004-10-18 15:13:41.393478311 -0700 @@ -32,6 +32,7 @@ of the assembly has to go. */ #include +#include static inline unsigned short from32to16(unsigned long x) { diff -urN linux-2.6.9-rc4/arch/h8300/platform/h8300h/generic/timer.c linux-2.6.9/arch/h8300/platform/h8300h/generic/timer.c --- linux-2.6.9-rc4/arch/h8300/platform/h8300h/generic/timer.c 2004-08-13 22:36:56.000000000 -0700 +++ linux-2.6.9/arch/h8300/platform/h8300h/generic/timer.c 2004-10-18 15:13:41.421479450 -0700 @@ -32,7 +32,7 @@ #define H8300_TIMER_FREQ CONFIG_CPU_CLOCK*1000/8192 /* Timer input freq. */ -int platform_timer_setup(irqreturn_t (*timer_int)(int, void *, struct pt_regs *)) +void __init platform_timer_setup(irqreturn_t (*timer_int)(int, void *, struct pt_regs *)) { /* setup 8bit timer ch2 */ ctrl_outb(H8300_TIMER_FREQ / HZ, TCORA2); /* set interval */ @@ -69,7 +69,7 @@ #define H8300_TIMER_FREQ CONFIG_CPU_CLOCK*1000/8 /* Timer input freq. */ -int platform_timer_setup(irqreturn_t (*timer_int)(int, void *, struct pt_regs *)) +void __init platform_timer_setup(irqreturn_t (*timer_int)(int, void *, struct pt_regs *)) { *(unsigned short *)GRA= H8300_TIMER_FREQ / HZ; /* set interval */ *(unsigned short *)TCNT=0; /* clear counter */ diff -urN linux-2.6.9-rc4/arch/ia64/kernel/fsys.S linux-2.6.9/arch/ia64/kernel/fsys.S --- linux-2.6.9-rc4/arch/ia64/kernel/fsys.S 2004-10-18 15:13:22.410705707 -0700 +++ linux-2.6.9/arch/ia64/kernel/fsys.S 2004-10-18 15:13:41.836496342 -0700 @@ -234,7 +234,7 @@ cmp.eq p9,p0 = 1,r8 // MMIO64 ? extr r2 = r21,24,8 // time_interpolator->jitter cmp.eq p10,p0 = 2,r8 // MMIO32 ? - cmp.lt p11,p0 = 2,r8 // function? + cmp.ltu p11,p0 = 2,r8 // function or other clock (p11) br.cond.spnt.many fsys_fallback_syscall ;; setf.sig f7 = r3 // Setup for scaling of counter @@ -338,7 +338,7 @@ .prologue .altrp b6 .body - cmp4.lt p6, p0 = CLOCK_MONOTONIC, r32 + cmp4.ltu p6, p0 = CLOCK_MONOTONIC, r32 // Fallback if this is not CLOCK_REALTIME or CLOCK_MONOTONIC (p6) br.spnt.few fsys_fallback_syscall mov r31 = r33 diff -urN linux-2.6.9-rc4/arch/m32r/kernel/entry.S linux-2.6.9/arch/m32r/kernel/entry.S --- linux-2.6.9-rc4/arch/m32r/kernel/entry.S 2004-10-18 15:13:22.492709045 -0700 +++ linux-2.6.9/arch/m32r/kernel/entry.S 2004-10-18 15:13:41.992502691 -0700 @@ -3,6 +3,7 @@ * * Copyright (c) 2001, 2002 Hirokazu Takata, Hitoshi Yamamoto, H. Kondo * Copyright (c) 2003 Hitoshi Yamamoto + * Copyright (c) 2004 Hirokazu Takata * * Taken from i386 version. * Copyright (C) 1991, 1992 Linus Torvalds @@ -798,7 +799,7 @@ .long sys_swapon .long sys_reboot .long old_readdir - .long old_mmap /* 90 */ + .long sys_ni_syscall /* 90 - old_mmap syscall holder */ .long sys_munmap .long sys_truncate .long sys_ftruncate @@ -993,15 +994,6 @@ .long sys_mq_getsetattr .long sys_ni_syscall /* reserved for kexec */ .long sys_waitid - .long sys_perfctr_info - .long sys_vperfctr_open - .long sys_vperfctr_control - .long sys_vperfctr_unlink - .long sys_vperfctr_iresume - .long sys_vperfctr_read /* 290 */ - .long sys_add_key - .long sys_request_key - .long sys_keyctl syscall_table_size=(.-sys_call_table) diff -urN linux-2.6.9-rc4/arch/m32r/kernel/sys_m32r.c linux-2.6.9/arch/m32r/kernel/sys_m32r.c --- linux-2.6.9-rc4/arch/m32r/kernel/sys_m32r.c 2004-10-18 15:13:22.519710144 -0700 +++ linux-2.6.9/arch/m32r/kernel/sys_m32r.c 2004-10-18 15:13:42.021503871 -0700 @@ -7,8 +7,6 @@ * Taken from i386 version. */ -/* $Id$ */ - #include #include #include @@ -88,10 +86,9 @@ return error; } -static inline long do_mmap2( - unsigned long addr, unsigned long len, +asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot, unsigned long flags, - int fd, unsigned long pgoff) + unsigned long fd, unsigned long pgoff) { int error = -EBADF; struct file *file = NULL; @@ -113,62 +110,6 @@ return error; } -asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, - unsigned long prot, unsigned long flags, - unsigned long fd, unsigned long pgoff) -{ - return do_mmap2(addr, len, prot, flags, fd, pgoff); -} - -/* - * Perform the select(nd, in, out, ex, tv) and mmap() system - * calls. Linux/M32R didn't use to be able to handle more than - * 4 system call parameters, so these system calls used a memory - * block for parameter passing.. - */ - -struct mmap_arg_struct { - unsigned long addr; - unsigned long len; - unsigned long prot; - unsigned long flags; - unsigned long fd; - unsigned long offset; -}; - -asmlinkage int old_mmap(struct mmap_arg_struct *arg) -{ - struct mmap_arg_struct a; - int err = -EFAULT; - - if (copy_from_user(&a, arg, sizeof(a))) - goto out; - - err = -EINVAL; - if (a.offset & ~PAGE_MASK) - goto out; - err = do_mmap2(a.addr, a.len, a.prot, a.flags, a.fd, - a.offset>>PAGE_SHIFT); -out: - return err; -} - -struct sel_arg_struct { - unsigned long n; - fd_set __user *inp, *outp, *exp; - struct timeval __user *tvp; -}; - -asmlinkage int old_select(struct sel_arg_struct __user *arg) -{ - struct sel_arg_struct a; - - if (copy_from_user(&a, arg, sizeof(a))) - return -EFAULT; - /* sys_select() does the appropriate kernel locking */ - return sys_select(a.n, a.inp, a.outp, a.exp, a.tvp); -} - /* * sys_ipc() is the de-multiplexer for the SysV IPC calls.. * diff -urN linux-2.6.9-rc4/arch/ppc/Kconfig linux-2.6.9/arch/ppc/Kconfig --- linux-2.6.9-rc4/arch/ppc/Kconfig 2004-10-18 15:13:22.710717918 -0700 +++ linux-2.6.9/arch/ppc/Kconfig 2004-10-18 15:13:42.464521902 -0700 @@ -35,10 +35,6 @@ bool default y -config GENERIC_IOMAP - bool - default y - source "init/Kconfig" menu "Processor" diff -urN linux-2.6.9-rc4/arch/ppc/kernel/pci.c linux-2.6.9/arch/ppc/kernel/pci.c --- linux-2.6.9-rc4/arch/ppc/kernel/pci.c 2004-10-18 15:13:22.779720727 -0700 +++ linux-2.6.9/arch/ppc/kernel/pci.c 2004-10-18 15:13:42.523524304 -0700 @@ -1709,6 +1709,32 @@ res->child = NULL; } +void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max) +{ + unsigned long start = pci_resource_start(dev, bar); + unsigned long len = pci_resource_len(dev, bar); + unsigned long flags = pci_resource_flags(dev, bar); + + if (!len) + return NULL; + if (max && len > max) + len = max; + if (flags & IORESOURCE_IO) + return ioport_map(start, len); + if (flags & IORESOURCE_MEM) + return (void __iomem *) start; + /* What? */ + return NULL; +} + +void pci_iounmap(struct pci_dev *dev, void __iomem *addr) +{ + /* Nothing to do */ +} +EXPORT_SYMBOL(pci_iomap); +EXPORT_SYMBOL(pci_iounmap); + + /* * Null PCI config access functions, for the case when we can't * find a hose. diff -urN linux-2.6.9-rc4/arch/ppc/mm/pgtable.c linux-2.6.9/arch/ppc/mm/pgtable.c --- linux-2.6.9-rc4/arch/ppc/mm/pgtable.c 2004-08-13 22:36:18.000000000 -0700 +++ linux-2.6.9/arch/ppc/mm/pgtable.c 2004-10-18 15:13:42.534524751 -0700 @@ -22,6 +22,7 @@ #include #include +#include #include #include #include @@ -271,6 +272,18 @@ vunmap((void *) (PAGE_MASK & (unsigned long)addr)); } +void __iomem *ioport_map(unsigned long port, unsigned int len) +{ + return (void __iomem *) (port + _IO_BASE); +} + +void ioport_unmap(void __iomem *addr) +{ + /* Nothing to do */ +} +EXPORT_SYMBOL(ioport_map); +EXPORT_SYMBOL(ioport_unmap); + int map_page(unsigned long va, phys_addr_t pa, int flags) { diff -urN linux-2.6.9-rc4/arch/ppc64/kernel/Makefile linux-2.6.9/arch/ppc64/kernel/Makefile --- linux-2.6.9-rc4/arch/ppc64/kernel/Makefile 2004-10-18 15:13:22.899725611 -0700 +++ linux-2.6.9/arch/ppc64/kernel/Makefile 2004-10-18 15:13:42.704531671 -0700 @@ -19,7 +19,7 @@ iSeries_IoMmTable.o pci-obj-$(CONFIG_PPC_MULTIPLATFORM) += pci_dn.o pci_dma_direct.o -obj-$(CONFIG_PCI) += pci.o pci_iommu.o $(pci-obj-y) +obj-$(CONFIG_PCI) += pci.o pci_iommu.o iomap.o $(pci-obj-y) obj-$(CONFIG_PPC_ISERIES) += iSeries_irq.o \ iSeries_VpdInfo.o XmPciLpEvent.o \ diff -urN linux-2.6.9-rc4/arch/ppc64/kernel/eeh.c linux-2.6.9/arch/ppc64/kernel/eeh.c --- linux-2.6.9-rc4/arch/ppc64/kernel/eeh.c 2004-10-18 15:13:22.906725896 -0700 +++ linux-2.6.9/arch/ppc64/kernel/eeh.c 2004-10-18 15:13:42.731532770 -0700 @@ -697,121 +697,6 @@ } EXPORT_SYMBOL(eeh_remove_device); -/* - * Here comes the EEH implementation of the IOMAP - * interfaces. - */ -unsigned int fastcall ioread8(void __iomem *addr) -{ - return readb(addr); -} -unsigned int fastcall ioread16(void __iomem *addr) -{ - return readw(addr); -} -unsigned int fastcall ioread32(void __iomem *addr) -{ - return readl(addr); -} -EXPORT_SYMBOL(ioread8); -EXPORT_SYMBOL(ioread16); -EXPORT_SYMBOL(ioread32); - -void fastcall iowrite8(u8 val, void __iomem *addr) -{ - writeb(val, addr); -} -void fastcall iowrite16(u16 val, void __iomem *addr) -{ - writew(val, addr); -} -void fastcall iowrite32(u32 val, void __iomem *addr) -{ - writel(val, addr); -} -EXPORT_SYMBOL(iowrite8); -EXPORT_SYMBOL(iowrite16); -EXPORT_SYMBOL(iowrite32); - -/* - * These are the "repeat read/write" functions. Note the - * non-CPU byte order. We do things in "IO byteorder" - * here. - * - * FIXME! We could make these do EEH handling if we really - * wanted. Not clear if we do. - */ -void ioread8_rep(void __iomem *addr, void *dst, unsigned long count) -{ - _insb((u8 __force *) addr, dst, count); -} -void ioread16_rep(void __iomem *addr, void *dst, unsigned long count) -{ - _insw_ns((u16 __force *) addr, dst, count); -} -void ioread32_rep(void __iomem *addr, void *dst, unsigned long count) -{ - _insl_ns((u32 __force *) addr, dst, count); -} -EXPORT_SYMBOL(ioread8_rep); -EXPORT_SYMBOL(ioread16_rep); -EXPORT_SYMBOL(ioread32_rep); - -void iowrite8_rep(void __iomem *addr, const void *src, unsigned long count) -{ - _outsb((u8 __force *) addr, src, count); -} -void iowrite16_rep(void __iomem *addr, const void *src, unsigned long count) -{ - _outsw_ns((u16 __force *) addr, src, count); -} -void iowrite32_rep(void __iomem *addr, const void *src, unsigned long count) -{ - _outsl_ns((u32 __force *) addr, src, count); -} -EXPORT_SYMBOL(iowrite8_rep); -EXPORT_SYMBOL(iowrite16_rep); -EXPORT_SYMBOL(iowrite32_rep); - -void __iomem *ioport_map(unsigned long port, unsigned int len) -{ - if (!_IO_IS_VALID(port)) - return NULL; - return (void __iomem *) (port+pci_io_base); -} - -void ioport_unmap(void __iomem *addr) -{ - /* Nothing to do */ -} -EXPORT_SYMBOL(ioport_map); -EXPORT_SYMBOL(ioport_unmap); - -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max) -{ - unsigned long start = pci_resource_start(dev, bar); - unsigned long len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len) - return NULL; - if (max && len > max) - len = max; - if (flags & IORESOURCE_IO) - return ioport_map(start, len); - if (flags & IORESOURCE_MEM) - return (void __iomem *) start; - /* What? */ - return NULL; -} - -void pci_iounmap(struct pci_dev *dev, void __iomem *addr) -{ - /* Nothing to do */ -} -EXPORT_SYMBOL(pci_iomap); -EXPORT_SYMBOL(pci_iounmap); - static int proc_eeh_show(struct seq_file *m, void *v) { unsigned int cpu; diff -urN linux-2.6.9-rc4/arch/ppc64/kernel/iomap.c linux-2.6.9/arch/ppc64/kernel/iomap.c --- linux-2.6.9-rc4/arch/ppc64/kernel/iomap.c 1969-12-31 16:00:00.000000000 -0800 +++ linux-2.6.9/arch/ppc64/kernel/iomap.c 2004-10-18 15:13:42.777534642 -0700 @@ -0,0 +1,119 @@ +#include +#include +#include +#include + +/* + * Here comes the ppc64 implementation of the IOMAP + * interfaces. + */ +unsigned int fastcall ioread8(void __iomem *addr) +{ + return readb(addr); +} +unsigned int fastcall ioread16(void __iomem *addr) +{ + return readw(addr); +} +unsigned int fastcall ioread32(void __iomem *addr) +{ + return readl(addr); +} +EXPORT_SYMBOL(ioread8); +EXPORT_SYMBOL(ioread16); +EXPORT_SYMBOL(ioread32); + +void fastcall iowrite8(u8 val, void __iomem *addr) +{ + writeb(val, addr); +} +void fastcall iowrite16(u16 val, void __iomem *addr) +{ + writew(val, addr); +} +void fastcall iowrite32(u32 val, void __iomem *addr) +{ + writel(val, addr); +} +EXPORT_SYMBOL(iowrite8); +EXPORT_SYMBOL(iowrite16); +EXPORT_SYMBOL(iowrite32); + +/* + * These are the "repeat read/write" functions. Note the + * non-CPU byte order. We do things in "IO byteorder" + * here. + * + * FIXME! We could make these do EEH handling if we really + * wanted. Not clear if we do. + */ +void ioread8_rep(void __iomem *addr, void *dst, unsigned long count) +{ + _insb((u8 __force *) addr, dst, count); +} +void ioread16_rep(void __iomem *addr, void *dst, unsigned long count) +{ + _insw_ns((u16 __force *) addr, dst, count); +} +void ioread32_rep(void __iomem *addr, void *dst, unsigned long count) +{ + _insl_ns((u32 __force *) addr, dst, count); +} +EXPORT_SYMBOL(ioread8_rep); +EXPORT_SYMBOL(ioread16_rep); +EXPORT_SYMBOL(ioread32_rep); + +void iowrite8_rep(void __iomem *addr, const void *src, unsigned long count) +{ + _outsb((u8 __force *) addr, src, count); +} +void iowrite16_rep(void __iomem *addr, const void *src, unsigned long count) +{ + _outsw_ns((u16 __force *) addr, src, count); +} +void iowrite32_rep(void __iomem *addr, const void *src, unsigned long count) +{ + _outsl_ns((u32 __force *) addr, src, count); +} +EXPORT_SYMBOL(iowrite8_rep); +EXPORT_SYMBOL(iowrite16_rep); +EXPORT_SYMBOL(iowrite32_rep); + +void __iomem *ioport_map(unsigned long port, unsigned int len) +{ + if (!_IO_IS_VALID(port)) + return NULL; + return (void __iomem *) (port+pci_io_base); +} + +void ioport_unmap(void __iomem *addr) +{ + /* Nothing to do */ +} +EXPORT_SYMBOL(ioport_map); +EXPORT_SYMBOL(ioport_unmap); + +void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max) +{ + unsigned long start = pci_resource_start(dev, bar); + unsigned long len = pci_resource_len(dev, bar); + unsigned long flags = pci_resource_flags(dev, bar); + + if (!len) + return NULL; + if (max && len > max) + len = max; + if (flags & IORESOURCE_IO) + return ioport_map(start, len); + if (flags & IORESOURCE_MEM) + return (void __iomem *) start; + /* What? */ + return NULL; +} + +void pci_iounmap(struct pci_dev *dev, void __iomem *addr) +{ + /* Nothing to do */ +} +EXPORT_SYMBOL(pci_iomap); +EXPORT_SYMBOL(pci_iounmap); diff -urN linux-2.6.9-rc4/arch/ppc64/kernel/prom_init.c linux-2.6.9/arch/ppc64/kernel/prom_init.c --- linux-2.6.9-rc4/arch/ppc64/kernel/prom_init.c 2004-10-18 15:13:22.966728338 -0700 +++ linux-2.6.9/arch/ppc64/kernel/prom_init.c 2004-10-18 15:13:42.827536677 -0700 @@ -590,12 +590,15 @@ unsigned long top = base + size; unsigned long cnt = RELOC(mem_reserve_cnt); + if (size == 0) + return; + /* We need to always keep one empty entry so that we * have our terminator with "size" set to 0 since we are * dumb and just copy this entire array to the boot params */ base = _ALIGN_DOWN(base, PAGE_SIZE); - top = _ALIGN_DOWN(top, PAGE_SIZE); + top = _ALIGN_UP(top, PAGE_SIZE); size = top - base; if (cnt >= (MEM_RESERVE_MAP_SIZE - 1)) diff -urN linux-2.6.9-rc4/arch/ppc64/kernel/smp.c linux-2.6.9/arch/ppc64/kernel/smp.c --- linux-2.6.9-rc4/arch/ppc64/kernel/smp.c 2004-10-18 15:13:22.976728745 -0700 +++ linux-2.6.9/arch/ppc64/kernel/smp.c 2004-10-18 15:13:42.839537165 -0700 @@ -390,7 +390,8 @@ static inline int __devinit smp_startup_cpu(unsigned int lcpu) { int status; - unsigned long start_here = __pa(pseries_secondary_smp_init); + unsigned long start_here = __pa((u32)*((unsigned long *) + pseries_secondary_smp_init)); unsigned int pcpu; /* At boot time the cpus are already spinning in hold diff -urN linux-2.6.9-rc4/arch/ppc64/mm/hash_low.S linux-2.6.9/arch/ppc64/mm/hash_low.S --- linux-2.6.9-rc4/arch/ppc64/mm/hash_low.S 2004-10-18 15:13:22.989729274 -0700 +++ linux-2.6.9/arch/ppc64/mm/hash_low.S 2004-10-18 15:13:42.854537776 -0700 @@ -263,7 +263,7 @@ /* if we failed because typically the HPTE wasn't really here * we try an insertion. */ - cmpi 0,r3,-1 + cmpdi 0,r3,-1 beq- htab_insert_pte /* Clear the BUSY bit and Write out the PTE */ diff -urN linux-2.6.9-rc4/arch/um/Kconfig linux-2.6.9/arch/um/Kconfig --- linux-2.6.9-rc4/arch/um/Kconfig 2004-10-18 15:13:23.369744741 -0700 +++ linux-2.6.9/arch/um/Kconfig 2004-10-18 15:13:43.430561220 -0700 @@ -143,7 +143,6 @@ will appear to be running simultaneously. If the host is a multiprocessor, then UML processes may run simultaneously, depending on the host scheduler. - CONFIG_SMP will be set to whatever this option is set to. It is safe to leave this unchanged. config NR_CPUS @@ -179,6 +178,7 @@ config HIGHMEM bool "Highmem support" + depends on BROKEN config KERNEL_STACK_ORDER int "Kernel stack size order" @@ -226,6 +226,7 @@ source "lib/Kconfig" menu "SCSI support" +depends on BROKEN config SCSI tristate "SCSI support" @@ -242,6 +243,8 @@ source "drivers/md/Kconfig" -source "drivers/mtd/Kconfig" +if BROKEN + source "drivers/mtd/Kconfig" +endif source "arch/um/Kconfig.debug" diff -urN linux-2.6.9-rc4/arch/um/Kconfig_block linux-2.6.9/arch/um/Kconfig_block --- linux-2.6.9-rc4/arch/um/Kconfig_block 2004-10-18 15:13:23.370744781 -0700 +++ linux-2.6.9/arch/um/Kconfig_block 2004-10-18 15:13:43.431561261 -0700 @@ -54,6 +54,7 @@ config MMAPPER tristate "Example IO memory driver" + depends on BROKEN help The User-Mode Linux port can provide support for IO Memory emulation with this option. This allows a host file to be diff -urN linux-2.6.9-rc4/arch/um/Kconfig_char linux-2.6.9/arch/um/Kconfig_char --- linux-2.6.9-rc4/arch/um/Kconfig_char 2004-10-18 15:13:23.371744822 -0700 +++ linux-2.6.9/arch/um/Kconfig_char 2004-10-18 15:13:43.432561302 -0700 @@ -72,6 +72,10 @@ well, since UML's gdb currently requires an xterm. It is safe to say 'Y' here. +config NOCONFIG_CHAN + bool + default !(XTERM_CHAN && TTY_CHAN && PTY_CHAN && PORT_CHAN && FD_CHAN && NULL_CHAN) + config CON_ZERO_CHAN string "Default main console channel initialization" default "fd:0,fd:1" diff -urN linux-2.6.9-rc4/arch/um/Kconfig_net linux-2.6.9/arch/um/Kconfig_net --- linux-2.6.9-rc4/arch/um/Kconfig_net 2004-10-18 15:13:23.372744863 -0700 +++ linux-2.6.9/arch/um/Kconfig_net 2004-10-18 15:13:43.443561749 -0700 @@ -135,7 +135,7 @@ config UML_NET_PCAP bool "pcap transport" - depends on UML_NET + depends on UML_NET && BROKEN help The pcap transport makes a pcap packet stream on the host look like an ethernet device inside UML. This is useful for making diff -urN linux-2.6.9-rc4/arch/um/Makefile linux-2.6.9/arch/um/Makefile --- linux-2.6.9-rc4/arch/um/Makefile 2004-10-18 15:13:23.372744863 -0700 +++ linux-2.6.9/arch/um/Makefile 2004-10-18 15:13:43.460562441 -0700 @@ -5,20 +5,13 @@ ARCH_DIR = arch/um OS := $(shell uname -s) +#We require it or things break. +SHELL := /bin/bash -# Recalculate MODLIB to reflect the EXTRAVERSION changes (via KERNELRELEASE) -# The way the toplevel Makefile is written EXTRAVERSION is not supposed -# to be changed outside the toplevel Makefile, but recalculating MODLIB is -# a sufficient workaround until we no longer need architecture dependent -# EXTRAVERSION... -MODLIB := $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE) - -ifeq ($(CONFIG_DEBUG_INFO),y) -CFLAGS := $(subst -fomit-frame-pointer,,$(CFLAGS)) -endif +filechk_gen_header = $< -core-y += $(ARCH_DIR)/kernel/ \ - $(ARCH_DIR)/drivers/ \ +core-y += $(ARCH_DIR)/kernel/ \ + $(ARCH_DIR)/drivers/ \ $(ARCH_DIR)/sys-$(SUBARCH)/ # Have to precede the include because the included Makefiles reference them. @@ -31,13 +24,6 @@ GEN_HEADERS += $(ARCH_DIR)/include/task.h $(ARCH_DIR)/include/kern_constants.h -# This target adds dependencies to "prepare". They are defined in the included -# Makefiles (see Makefile-i386). - -.PHONY: sys_prepare -sys_prepare: - @: - MAKEFILE-$(CONFIG_MODE_TT) += Makefile-tt MAKEFILE-$(CONFIG_MODE_SKAS) += Makefile-skas @@ -45,11 +31,12 @@ include $(addprefix $(ARCH_DIR)/,$(MAKEFILE-y)) endif +ARCH_INCLUDE := -I$(ARCH_DIR)/include +SYS_DIR := $(ARCH_DIR)/include/sysdep-$(SUBARCH) + include $(ARCH_DIR)/Makefile-$(SUBARCH) include $(ARCH_DIR)/Makefile-os-$(OS) -ARCH_INCLUDE = -I$(ARCH_DIR)/include - # -Derrno=kernel_errno - This turns all kernel references to errno into # kernel_errno to separate them from the libc errno. This allows -fno-common # in CFLAGS. Otherwise, it would cause ld to complain about the two different @@ -59,7 +46,7 @@ -D_LARGEFILE64_SOURCE $(ARCH_INCLUDE) -Derrno=kernel_errno \ -Dsigprocmask=kernel_sigprocmask $(MODE_INCLUDE) -CFLAGS += $(call check_gcc,-fno-unit-at-a-time,) +CFLAGS += $(call cc-option,-fno-unit-at-a-time,) LINK_WRAPS = -Wl,--wrap,malloc -Wl,--wrap,free -Wl,--wrap,calloc @@ -72,23 +59,17 @@ SIZE = (($(CONFIG_NEST_LEVEL) + $(CONFIG_KERNEL_HALF_GIGS)) * 0x20000000) ifeq ($(CONFIG_MODE_SKAS), y) -$(SYS_HEADERS) : $(TOPDIR)/$(ARCH_DIR)/include/skas_ptregs.h +$(SYS_HEADERS) : $(ARCH_DIR)/include/skas_ptregs.h endif -include/linux/version.h: arch/$(ARCH)/Makefile - -$(ARCH_DIR)/vmlinux.lds.S : - touch $@ - -prepare: $(ARCH_SYMLINKS) $(SYS_HEADERS) $(GEN_HEADERS) - -LDFLAGS_vmlinux = -r +prepare: $(ARCH_SYMLINKS) $(SYS_HEADERS) $(GEN_HEADERS) \ + $(ARCH_DIR)/kernel/vmlinux.lds.S # These aren't in Makefile-tt because they are needed in the !CONFIG_MODE_TT + # CONFIG_MODE_SKAS + CONFIG_STATIC_LINK case. LINK_TT = -static -LD_SCRIPT_TT := uml.lds +LD_SCRIPT_TT := uml.lds.S ifeq ($(CONFIG_STATIC_LINK),y) LINK-y += $(LINK_TT) @@ -118,13 +99,14 @@ -DELF_FORMAT=\"$(ELF_FORMAT)\" $(CPP_MODE_TT) \ -DKERNEL_STACK_SIZE=$(STACK_SIZE)) -export CPPFLAGS_$(LD_SCRIPT-y) = $(CPPFLAGS_vmlinux.lds) -P -C -Uum - -LD_SCRIPT-y := $(ARCH_DIR)/kernel/$(LD_SCRIPT-y) - -linux: vmlinux $(LD_SCRIPT-y) - $(CC) -Wl,-T,$(LD_SCRIPT-y) $(LINK-y) $(LINK_WRAPS) \ - -o linux vmlinux -L/usr/lib -lutil +CFLAGS_vmlinux = $(LINK-y) $(LINK_WRAPS) +define cmd_vmlinux__ + $(CC) $(CFLAGS_vmlinux) -o $@ \ + -Wl,-T,$(vmlinux-lds) $(vmlinux-init) \ + -Wl,--start-group $(vmlinux-main) -Wl,--end-group \ + -L/usr/lib -lutil \ + $(filter-out $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) FORCE ,$^) +endef USER_CFLAGS := $(patsubst -I%,,$(CFLAGS)) USER_CFLAGS := $(patsubst -Derrno=kernel_errno,,$(USER_CFLAGS)) @@ -135,76 +117,72 @@ # To get a definition of F_SETSIG USER_CFLAGS += -D_GNU_SOURCE -# From main Makefile, these options are set after including the ARCH makefile. -# So copy them here. - -ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE -USER_CFLAGS += -Os -else -USER_CFLAGS += -O2 -endif - -ifndef CONFIG_FRAME_POINTER -USER_CFLAGS += -fomit-frame-pointer -endif - -ifdef CONFIG_DEBUG_INFO -USER_CFLAGS += -g -endif - -CLEAN_FILES += linux x.i gmon.out $(ARCH_DIR)/uml.lds \ - $(ARCH_DIR)/dyn_link.ld.s $(ARCH_DIR)/include/uml-config.h \ - $(GEN_HEADERS) +#When cleaning we don't include .config, so we don't include +#TT or skas makefiles and don't clean skas_ptregs.h. +CLEAN_FILES += linux x.i gmon.out $(ARCH_DIR)/include/uml-config.h \ + $(GEN_HEADERS) $(ARCH_DIR)/include/skas_ptregs.h MRPROPER_FILES += $(SYMLINK_HEADERS) $(ARCH_SYMLINKS) \ - $(addprefix $(ARCH_DIR)/kernel/,$(KERN_SYMLINKS)) + $(addprefix $(ARCH_DIR)/kernel/,$(KERN_SYMLINKS)) $(ARCH_DIR)/os archmrproper: @: archclean: + $(Q)$(MAKE) $(clean)=$(ARCH_DIR)/util @find . \( -name '*.bb' -o -name '*.bbg' -o -name '*.da' \ -o -name '*.gcov' \) -type f -print | xargs rm -f +#We need to re-preprocess this when the symlink dest changes. +#So we touch it. +$(ARCH_DIR)/kernel/vmlinux.lds.S: FORCE + @echo ' SYMLINK $@' + $(Q)ln -sf $(LD_SCRIPT-y) $@ + $(Q)touch $@ + $(SYMLINK_HEADERS): - cd $(TOPDIR)/$(dir $@) ; \ + @echo ' SYMLINK $@' + $(Q)cd $(TOPDIR)/$(dir $@) ; \ ln -sf $(basename $(notdir $@))-$(SUBARCH)$(suffix $@) $(notdir $@) include/asm-um/arch: - cd $(TOPDIR)/include/asm-um && ln -sf ../asm-$(SUBARCH) arch + @echo ' SYMLINK $@' + $(Q)cd $(TOPDIR)/include/asm-um && ln -sf ../asm-$(SUBARCH) arch $(ARCH_DIR)/include/sysdep: - cd $(ARCH_DIR)/include && ln -sf sysdep-$(SUBARCH) sysdep + @echo ' SYMLINK $@' + $(Q)cd $(ARCH_DIR)/include && ln -sf sysdep-$(SUBARCH) sysdep $(ARCH_DIR)/os: - cd $(ARCH_DIR) && ln -sf os-$(OS) os + @echo ' SYMLINK $@' + $(Q)cd $(ARCH_DIR) && ln -sf os-$(OS) os # Generated files define filechk_umlconfig sed 's/ CONFIG/ UML_CONFIG/' endef -$(ARCH_DIR)/include/uml-config.h : $(TOPDIR)/include/linux/autoconf.h +$(ARCH_DIR)/include/uml-config.h : include/linux/autoconf.h $(call filechk,umlconfig) -filechk_gen_header = $< +$(ARCH_DIR)/include/task.h: $(ARCH_DIR)/util/mk_task + $(call filechk,gen_header) -$(ARCH_DIR)/include/task.h : $(ARCH_DIR)/util/mk_task +$(ARCH_DIR)/include/kern_constants.h: $(ARCH_DIR)/util/mk_constants $(call filechk,gen_header) -$(ARCH_DIR)/include/kern_constants.h : $(ARCH_DIR)/util/mk_constants +$(ARCH_DIR)/include/skas_ptregs.h: $(ARCH_DIR)/kernel/skas/util/mk_ptregs $(call filechk,gen_header) -$(ARCH_DIR)/util/mk_task $(ARCH_DIR)/util/mk_constants : $(ARCH_DIR)/util \ - sys_prepare FORCE ; +$(ARCH_DIR)/util/mk_task $(ARCH_DIR)/util/mk_constants: $(ARCH_DIR)/util \ + FORCE ; -$(ARCH_DIR)/util: FORCE - $(Q)$(MAKE) $(build)=$@ +$(ARCH_DIR)/kernel/skas/util/mk_ptregs: $(ARCH_DIR)/kernel/skas/util FORCE ; -export SUBARCH USER_CFLAGS OS +$(ARCH_DIR)/util: scripts_basic $(SYS_DIR)/sc.h FORCE + $(Q)$(MAKE) $(build)=$@ -all: linux +$(ARCH_DIR)/kernel/skas/util: scripts_basic FORCE + $(Q)$(MAKE) $(build)=$@ -define archhelp - echo '* linux - Binary kernel image (./linux)' -endef +export SUBARCH USER_CFLAGS OS diff -urN linux-2.6.9-rc4/arch/um/Makefile-i386 linux-2.6.9/arch/um/Makefile-i386 --- linux-2.6.9-rc4/arch/um/Makefile-i386 2004-10-18 15:13:23.373744904 -0700 +++ linux-2.6.9/arch/um/Makefile-i386 2004-10-18 15:13:43.467562726 -0700 @@ -1,12 +1,12 @@ ifeq ($(CONFIG_HOST_2G_2G), y) -TOP_ADDR = 0x80000000 +TOP_ADDR := 0x80000000 else -TOP_ADDR = 0xc0000000 +TOP_ADDR := 0xc0000000 endif ifeq ($(CONFIG_MODE_SKAS),y) ifneq ($(CONFIG_MODE_TT),y) - START = 0x8048000 + START := 0x8048000 endif endif @@ -16,37 +16,30 @@ ARCH_CFLAGS += -DUM_FASTCALL endif -ELF_ARCH = $(SUBARCH) -ELF_FORMAT = elf32-$(SUBARCH) +ELF_ARCH := $(SUBARCH) +ELF_FORMAT := elf32-$(SUBARCH) OBJCOPYFLAGS := -O binary -R .note -R .comment -S -SYS_DIR := $(ARCH_DIR)/include/sysdep-i386 SYS_UTIL_DIR := $(ARCH_DIR)/sys-i386/util -SYS_HEADERS = $(SYS_DIR)/sc.h $(SYS_DIR)/thread.h - -sys_prepare: $(SYS_DIR)/sc.h +SYS_HEADERS := $(SYS_DIR)/sc.h $(SYS_DIR)/thread.h prepare: $(SYS_HEADERS) -filechk_$(SYS_DIR)/sc.h := $(SYS_UTIL_DIR)/mk_sc - $(SYS_DIR)/sc.h: $(SYS_UTIL_DIR)/mk_sc - $(call filechk,$@) - -filechk_$(SYS_DIR)/thread.h := $(SYS_UTIL_DIR)/mk_thread + $(call filechk,gen_header) $(SYS_DIR)/thread.h: $(SYS_UTIL_DIR)/mk_thread - $(call filechk,$@) + $(call filechk,gen_header) -$(SYS_UTIL_DIR)/mk_sc: scripts/basic/fixdep include/config/MARKER FORCE ; +$(SYS_UTIL_DIR)/mk_sc: scripts_basic FORCE $(Q)$(MAKE) $(build)=$(SYS_UTIL_DIR) $@ -$(SYS_UTIL_DIR)/mk_thread: $(ARCH_SYMLINKS) $(GEN_HEADERS) sys_prepare FORCE ; +$(SYS_UTIL_DIR)/mk_thread: scripts_basic $(ARCH_SYMLINKS) $(GEN_HEADERS) FORCE $(Q)$(MAKE) $(build)=$(SYS_UTIL_DIR) $@ -$(SYS_UTIL_DIR): include/asm FORCE +$(SYS_UTIL_DIR): scripts_basic include/asm FORCE $(Q)$(MAKE) $(build)=$(SYS_UTIL_DIR) CLEAN_FILES += $(SYS_HEADERS) diff -urN linux-2.6.9-rc4/arch/um/Makefile-skas linux-2.6.9/arch/um/Makefile-skas --- linux-2.6.9-rc4/arch/um/Makefile-skas 2004-10-18 15:13:23.373744904 -0700 +++ linux-2.6.9/arch/um/Makefile-skas 2004-10-18 15:13:43.467562726 -0700 @@ -9,12 +9,9 @@ CFLAGS-$(CONFIG_GPROF) += $(PROFILE) LINK-$(CONFIG_GPROF) += $(PROFILE) -MODE_INCLUDE += -I$(TOPDIR)/$(ARCH_DIR)/kernel/skas/include +MODE_INCLUDE += -I$(srctree)/$(ARCH_DIR)/kernel/skas/include LINK_SKAS = -Wl,-rpath,/lib -LD_SCRIPT_SKAS = dyn.lds +LD_SCRIPT_SKAS = dyn.lds.S -GEN_HEADERS += $(TOPDIR)/$(ARCH_DIR)/include/skas_ptregs.h - -$(TOPDIR)/$(ARCH_DIR)/include/skas_ptregs.h : - $(Q)$(MAKE) $(build)=$(ARCH_DIR)/kernel/skas $@ +GEN_HEADERS += $(ARCH_DIR)/include/skas_ptregs.h diff -urN linux-2.6.9-rc4/arch/um/Makefile-tt linux-2.6.9/arch/um/Makefile-tt --- linux-2.6.9-rc4/arch/um/Makefile-tt 2004-08-13 22:37:38.000000000 -0700 +++ linux-2.6.9/arch/um/Makefile-tt 2004-10-18 15:13:43.468562767 -0700 @@ -3,5 +3,4 @@ # Licensed under the GPL # -MODE_INCLUDE += -I$(TOPDIR)/$(ARCH_DIR)/kernel/tt/include - +MODE_INCLUDE += -I$(srctree)/$(ARCH_DIR)/kernel/tt/include diff -urN linux-2.6.9-rc4/arch/um/drivers/chan_kern.c linux-2.6.9/arch/um/drivers/chan_kern.c --- linux-2.6.9-rc4/arch/um/drivers/chan_kern.c 2004-10-18 15:13:23.387745473 -0700 +++ linux-2.6.9/arch/um/drivers/chan_kern.c 2004-10-18 15:13:43.476563092 -0700 @@ -19,6 +19,7 @@ #include "line.h" #include "os.h" +#ifdef CONFIG_NOCONFIG_CHAN static void *not_configged_init(char *str, int device, struct chan_opts *opts) { printk(KERN_ERR "Using a channel type which is configured out of " @@ -87,6 +88,7 @@ .free = not_configged_free, .winch = 0, }; +#endif /* CONFIG_NOCONFIG_CHAN */ void generic_close(int fd, void *unused) { diff -urN linux-2.6.9-rc4/arch/um/drivers/ubd_kern.c linux-2.6.9/arch/um/drivers/ubd_kern.c --- linux-2.6.9-rc4/arch/um/drivers/ubd_kern.c 2004-10-18 15:13:23.420746817 -0700 +++ linux-2.6.9/arch/um/drivers/ubd_kern.c 2004-10-18 15:13:43.531565331 -0700 @@ -396,14 +396,13 @@ */ int intr_count = 0; -static void ubd_finish(struct request *req, int error) +/* call ubd_finish if you need to serialize */ +static void __ubd_finish(struct request *req, int error) { int nsect; if(error){ - spin_lock(&ubd_io_lock); end_request(req, 0); - spin_unlock(&ubd_io_lock); return; } nsect = req->current_nr_sectors; @@ -412,11 +411,17 @@ req->errors = 0; req->nr_sectors -= nsect; req->current_nr_sectors = 0; - spin_lock(&ubd_io_lock); end_request(req, 1); +} + +static inline void ubd_finish(struct request *req, int error) +{ + spin_lock(&ubd_io_lock); + __ubd_finish(req, error); spin_unlock(&ubd_io_lock); } +/* Called without ubd_io_lock held */ static void ubd_handler(void) { struct io_thread_req req; @@ -768,9 +773,11 @@ unsigned long stack; int err; + /* Set by CONFIG_BLK_DEV_UBD_SYNC or ubd=sync.*/ if(global_openflags.s){ - printk(KERN_INFO "ubd : Synchronous mode\n"); - return(0); + printk(KERN_INFO "ubd: Synchronous mode\n"); + /* Letting ubd=sync be like using ubd#s= instead of ubd#= is + * enough. So use anyway the io thread. */ } stack = alloc_stack(0, 0); io_pid = start_io_thread(stack + PAGE_SIZE - sizeof(void *), @@ -965,6 +972,7 @@ return(0); } +/* Called with ubd_io_lock held */ static int prepare_request(struct request *req, struct io_thread_req *io_req) { struct gendisk *disk = req->rq_disk; @@ -977,9 +985,7 @@ if((rq_data_dir(req) == WRITE) && !dev->openflags.w){ printk("Write attempted on readonly ubd device %s\n", disk->disk_name); - spin_lock(&ubd_io_lock); end_request(req, 0); - spin_unlock(&ubd_io_lock); return(1); } @@ -1029,6 +1035,7 @@ return(0); } +/* Called with ubd_io_lock held */ static void do_ubd_request(request_queue_t *q) { struct io_thread_req io_req; @@ -1040,7 +1047,7 @@ err = prepare_request(req, &io_req); if(!err){ do_io(&io_req); - ubd_finish(req, io_req.error); + __ubd_finish(req, io_req.error); } } } diff -urN linux-2.6.9-rc4/arch/um/include/Makefile linux-2.6.9/arch/um/include/Makefile --- linux-2.6.9-rc4/arch/um/include/Makefile 2004-08-13 22:38:09.000000000 -0700 +++ linux-2.6.9/arch/um/include/Makefile 1969-12-31 16:00:00.000000000 -0800 @@ -1,7 +0,0 @@ -all : sc.h - -sc.h : ../util/mk_sc - ../util/mk_sc > $@ - -../util/mk_sc : - $(MAKE) -C ../util mk_sc diff -urN linux-2.6.9-rc4/arch/um/include/sysdep-i386/checksum.h linux-2.6.9/arch/um/include/sysdep-i386/checksum.h --- linux-2.6.9-rc4/arch/um/include/sysdep-i386/checksum.h 2004-10-18 15:13:23.451748078 -0700 +++ linux-2.6.9/arch/um/include/sysdep-i386/checksum.h 2004-10-18 15:13:43.548566023 -0700 @@ -103,7 +103,8 @@ are modified, we must also specify them as outputs, or gcc will assume they contain their original values. */ : "=r" (sum), "=r" (iph), "=r" (ihl) - : "1" (iph), "2" (ihl)); + : "1" (iph), "2" (ihl) + : "memory"); return(sum); } diff -urN linux-2.6.9-rc4/arch/um/kernel/Makefile linux-2.6.9/arch/um/kernel/Makefile --- linux-2.6.9-rc4/arch/um/kernel/Makefile 2004-10-18 15:13:23.456748282 -0700 +++ linux-2.6.9/arch/um/kernel/Makefile 2004-10-18 15:13:43.553566226 -0700 @@ -4,11 +4,7 @@ # extra-y := vmlinux.lds - -# Descend into ../util for make clean. This is here because it doesn't work -# in arch/um/Makefile. - -subdir- = ../util +clean-files := vmlinux.lds.S obj-y = checksum.o config.o exec_kern.o exitcode.o frame_kern.o frame.o \ helper.o init_task.o irq.o irq_user.o ksyms.o main.o mem.o mem_user.o \ @@ -29,24 +25,16 @@ user-objs-$(CONFIG_TTY_LOG) += tty_log.o USER_OBJS := $(filter %_user.o,$(obj-y)) $(user-objs-y) config.o helper.o \ - main.o process.o tempfile.o time.o tty_log.o umid.o user_util.o + main.o process.o tempfile.o time.o tty_log.o umid.o user_util.o frame.o USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file)) -CFLAGS_frame.o := $(patsubst -fomit-frame-pointer,,$(USER_CFLAGS)) - -# This has to be separate because it needs be compiled with frame pointers -# regardless of how the rest of the kernel is built. - -$(obj)/frame.o: $(src)/frame.c - $(CC) $(CFLAGS_$(notdir $@)) -c -o $@ $< +CFLAGS_frame.o := -fno-omit-frame-pointer $(USER_OBJS) : %.o: %.c - $(CC) $(CFLAGS_$(notdir $@)) $(USER_CFLAGS) -c -o $@ $< + $(CC) $(USER_CFLAGS) $(CFLAGS_$(notdir $@)) -c -o $@ $< QUOTE = 'my $$config=`cat $(TOPDIR)/.config`; $$config =~ s/"/\\"/g ; $$config =~ s/\n/\\n"\n"/g ; while() { $$_ =~ s/CONFIG/$$config/; print $$_ }' -$(obj)/config.o : $(obj)/config.c - quiet_cmd_quote = QUOTE $@ cmd_quote = $(PERL) -e $(QUOTE) < $< > $@ diff -urN linux-2.6.9-rc4/arch/um/kernel/irq.c linux-2.6.9/arch/um/kernel/irq.c --- linux-2.6.9-rc4/arch/um/kernel/irq.c 2004-10-18 15:13:23.464748607 -0700 +++ linux-2.6.9/arch/um/kernel/irq.c 2004-10-18 15:13:43.561566552 -0700 @@ -441,6 +441,8 @@ err = activate_fd(irq, fd, type, dev_id); return(err); } +EXPORT_SYMBOL(um_request_irq); +EXPORT_SYMBOL(reactivate_fd); /* this was setup_x86_irq but it seems pretty generic */ int setup_irq(unsigned int irq, struct irqaction * new) diff -urN linux-2.6.9-rc4/arch/um/kernel/ksyms.c linux-2.6.9/arch/um/kernel/ksyms.c --- linux-2.6.9-rc4/arch/um/kernel/ksyms.c 2004-10-18 15:13:23.465748648 -0700 +++ linux-2.6.9/arch/um/kernel/ksyms.c 2004-10-18 15:13:43.562566593 -0700 @@ -60,6 +60,7 @@ EXPORT_SYMBOL(copy_to_user_skas); EXPORT_SYMBOL(copy_from_user_skas); #endif +EXPORT_SYMBOL(uml_strdup); EXPORT_SYMBOL(os_stat_fd); EXPORT_SYMBOL(os_stat_file); diff -urN linux-2.6.9-rc4/arch/um/kernel/physmem.c linux-2.6.9/arch/um/kernel/physmem.c --- linux-2.6.9-rc4/arch/um/kernel/physmem.c 2004-10-18 15:13:23.472748933 -0700 +++ linux-2.6.9/arch/um/kernel/physmem.c 2004-10-18 15:13:43.569566878 -0700 @@ -8,6 +8,7 @@ #include "linux/slab.h" #include "linux/vmalloc.h" #include "linux/bootmem.h" +#include "linux/module.h" #include "asm/types.h" #include "asm/pgtable.h" #include "kern_util.h" @@ -36,7 +37,7 @@ struct phys_desc *d; while(*n != NULL){ - d = rb_entry(n, struct phys_desc, rb); + d = rb_entry(*n, struct phys_desc, rb); if(d->virt == virt) return(n); @@ -56,7 +57,7 @@ if(*n == NULL) return(NULL); - return(rb_entry(n, struct phys_desc, rb)); + return(rb_entry(*n, struct phys_desc, rb)); } static void insert_phys_mapping(struct phys_desc *desc) @@ -220,6 +221,10 @@ kfree(desc); } +EXPORT_SYMBOL(physmem_forget_descriptor); +EXPORT_SYMBOL(physmem_remove_mapping); +EXPORT_SYMBOL(physmem_subst_mapping); + void arch_free_page(struct page *page, int order) { void *virt; diff -urN linux-2.6.9-rc4/arch/um/kernel/skas/Makefile linux-2.6.9/arch/um/kernel/skas/Makefile --- linux-2.6.9-rc4/arch/um/kernel/skas/Makefile 2004-10-18 15:13:23.480749259 -0700 +++ linux-2.6.9/arch/um/kernel/skas/Makefile 2004-10-18 15:13:43.576567163 -0700 @@ -3,26 +3,14 @@ # Licensed under the GPL # -obj-y = exec_kern.o exec_user.o mem.o mem_user.o mmu.o process.o \ +obj-y := exec_kern.o exec_user.o mem.o mem_user.o mmu.o process.o \ process_kern.o syscall_kern.o syscall_user.o time.o tlb.o trap_user.o \ uaccess.o sys-$(SUBARCH)/ -hostprogs-y := util/mk_ptregs -clean-files := include/skas_ptregs.h +subdir-y := util USER_OBJS = $(filter %_user.o,$(obj-y)) process.o time.o USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file)) -$(TOPDIR)/arch/um/include/skas_ptregs.h : $(src)/util/mk_ptregs - @echo -n ' Generating $@' - @$< > $@.tmp - @if [ -r $@ ] && cmp -s $@ $@.tmp; then \ - echo ' (unchanged)'; \ - rm -f $@.tmp; \ - else \ - echo ' (updated)'; \ - mv -f $@.tmp $@; \ - fi - $(USER_OBJS) : %.o: %.c $(CC) $(CFLAGS_$(notdir $@)) $(USER_CFLAGS) -c -o $@ $< diff -urN linux-2.6.9-rc4/arch/um/kernel/skas/util/Makefile linux-2.6.9/arch/um/kernel/skas/util/Makefile --- linux-2.6.9-rc4/arch/um/kernel/skas/util/Makefile 2004-10-18 15:13:23.489749625 -0700 +++ linux-2.6.9/arch/um/kernel/skas/util/Makefile 2004-10-18 15:13:43.586567570 -0700 @@ -1,9 +1,2 @@ -all: mk_ptregs - -mk_ptregs : mk_ptregs.o - $(HOSTCC) -o mk_ptregs mk_ptregs.o - -mk_ptregs.o : mk_ptregs.c - $(HOSTCC) -c $< - -clean-files := mk_ptregs *.o *~ +hostprogs-y := mk_ptregs +always := $(hostprogs-y) diff -urN linux-2.6.9-rc4/arch/um/kernel/time_kern.c linux-2.6.9/arch/um/kernel/time_kern.c --- linux-2.6.9-rc4/arch/um/kernel/time_kern.c 2004-10-18 15:13:23.496749910 -0700 +++ linux-2.6.9/arch/um/kernel/time_kern.c 2004-10-18 15:13:43.592567814 -0700 @@ -44,7 +44,9 @@ static int first_tick; static unsigned long long prev_usecs; +#ifdef CONFIG_UML_REAL_TIME_CLOCK static long long delta; /* Deviation per interval */ +#endif #define MILLION 1000000 @@ -60,7 +62,7 @@ } if(first_tick){ -#if defined(CONFIG_UML_REAL_TIME_CLOCK) +#ifdef CONFIG_UML_REAL_TIME_CLOCK /* We've had 1 tick */ unsigned long long usecs = os_usecs(); diff -urN linux-2.6.9-rc4/arch/um/kernel/vmlinux.lds.S linux-2.6.9/arch/um/kernel/vmlinux.lds.S --- linux-2.6.9-rc4/arch/um/kernel/vmlinux.lds.S 2004-08-13 22:36:09.000000000 -0700 +++ linux-2.6.9/arch/um/kernel/vmlinux.lds.S 1969-12-31 16:00:00.000000000 -0800 @@ -1,11 +0,0 @@ -#include - -OUTPUT_FORMAT(ELF_FORMAT) -OUTPUT_ARCH(ELF_ARCH) -ENTRY(_start) -jiffies = jiffies_64; - -SECTIONS -{ -#include "asm/common.lds.S" -} diff -urN linux-2.6.9-rc4/arch/um/sys-i386/Makefile linux-2.6.9/arch/um/sys-i386/Makefile --- linux-2.6.9-rc4/arch/um/sys-i386/Makefile 2004-10-18 15:13:23.523751009 -0700 +++ linux-2.6.9/arch/um/sys-i386/Makefile 2004-10-18 15:13:43.636569605 -0700 @@ -8,10 +8,13 @@ USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file)) SYMLINKS = bitops.c semaphore.c highmem.c module.c -SYMLINKS := $(foreach f,$(SYMLINKS),$(src)/$f) +# this needs to be before the foreach, because clean-files does not accept +# complete paths like $(src)/$f. clean-files := $(SYMLINKS) +SYMLINKS := $(foreach f,$(SYMLINKS),$(src)/$f) + bitops.c-dir = lib semaphore.c-dir = kernel highmem.c-dir = mm diff -urN linux-2.6.9-rc4/arch/um/sys-i386/util/Makefile linux-2.6.9/arch/um/sys-i386/util/Makefile --- linux-2.6.9-rc4/arch/um/sys-i386/util/Makefile 2004-10-18 15:13:23.528751212 -0700 +++ linux-2.6.9/arch/um/sys-i386/util/Makefile 2004-10-18 15:13:43.641569808 -0700 @@ -6,8 +6,3 @@ HOSTCFLAGS_mk_thread_kern.o := $(CFLAGS) $(CPPFLAGS) HOSTCFLAGS_mk_thread_user.o := $(USER_CFLAGS) - -clean : - $(RM) -f $(build-targets) - -archmrproper : clean diff -urN linux-2.6.9-rc4/arch/x86_64/kernel/suspend_asm.S linux-2.6.9/arch/x86_64/kernel/suspend_asm.S --- linux-2.6.9-rc4/arch/x86_64/kernel/suspend_asm.S 2004-10-18 15:13:23.599754102 -0700 +++ linux-2.6.9/arch/x86_64/kernel/suspend_asm.S 2004-10-18 15:13:43.885579739 -0700 @@ -39,29 +39,28 @@ /* set up cr3 */ leaq init_level4_pgt(%rip),%rax subq $__START_KERNEL_map,%rax - movq %rax,%cr3 + movq %rax,%cr3 movq mmu_cr4_features(%rip), %rax movq %rax, %rdx - andq $~(1<<7), %rdx # PGE - movq %rdx, %cr4; # turn off PGE - movq %cr3, %rcx; # flush TLB - movq %rcx, %cr3; - movq %rax, %cr4; # turn PGE back on + movq %rdx, %cr4; # turn off PGE + movq %cr3, %rcx; # flush TLB + movq %rcx, %cr3; + movq %rax, %cr4; # turn PGE back on movl nr_copy_pages(%rip), %eax xorl %ecx, %ecx - movq $0, loop(%rip) + movq $0, %r10 testl %eax, %eax - je .L108 + jz done .L105: xorl %esi, %esi - movq $0, loop2(%rip) + movq $0, %r11 jmp .L104 .p2align 4,,7 -.L111: - movq loop(%rip), %rcx +copy_one_page: + movq %r10, %rcx .L104: movq pagedir_nosave(%rip), %rdx movq %rcx, %rax @@ -71,27 +70,26 @@ movzbl (%rsi,%rax), %eax movb %al, (%rsi,%rcx) - movq %cr3, %rax; # flush TLB - movq %rax, %cr3; + movq %cr3, %rax; # flush TLB + movq %rax, %cr3; - movq loop2(%rip), %rax + movq %r11, %rax incq %rax cmpq $4095, %rax movq %rax, %rsi - movq %rax, loop2(%rip) - jbe .L111 - movq loop(%rip), %rax + movq %rax, %r11 + jbe copy_one_page + movq %r10, %rax incq %rax movq %rax, %rcx - movq %rax, loop(%rip) + movq %rax, %r10 mov nr_copy_pages(%rip), %eax cmpq %rax, %rcx jb .L105 -.L108: - .align 4 +done: movl $24, %eax + movl %eax, %ds - movl %eax, %ds movq saved_context_esp(%rip), %rsp movq saved_context_ebp(%rip), %rbp movq saved_context_eax(%rip), %rax @@ -111,10 +109,3 @@ pushq saved_context_eflags(%rip) ; popfq call swsusp_restore ret - - .section .data.nosave -loop: - .quad 0 -loop2: - .quad 0 - .previous diff -urN linux-2.6.9-rc4/drivers/acpi/scan.c linux-2.6.9/drivers/acpi/scan.c --- linux-2.6.9-rc4/drivers/acpi/scan.c 2004-10-18 15:13:23.772761144 -0700 +++ linux-2.6.9/drivers/acpi/scan.c 2004-10-18 15:13:44.078587595 -0700 @@ -204,6 +204,8 @@ return AE_BAD_PARAMETER; element = &(package->package.elements[0]); + if (!element) + return AE_BAD_PARAMETER; if (element->type == ACPI_TYPE_PACKAGE) { if ((element->package.count < 2) || (element->package.elements[0].type != ACPI_TYPE_LOCAL_REFERENCE) || diff -urN linux-2.6.9-rc4/drivers/base/firmware_class.c linux-2.6.9/drivers/base/firmware_class.c --- linux-2.6.9-rc4/drivers/base/firmware_class.c 2004-10-18 15:13:23.804762446 -0700 +++ linux-2.6.9/drivers/base/firmware_class.c 2004-10-18 15:13:44.177591624 -0700 @@ -235,6 +235,8 @@ struct firmware *fw; ssize_t retval; + if (!capable(CAP_SYS_RAWIO)) + return -EPERM; down(&fw_lock); fw = fw_priv->fw; if (test_bit(FW_STATUS_DONE, &fw_priv->status)) { diff -urN linux-2.6.9-rc4/drivers/char/agp/intel-agp.c linux-2.6.9/drivers/char/agp/intel-agp.c --- linux-2.6.9-rc4/drivers/char/agp/intel-agp.c 2004-10-18 15:13:23.865764929 -0700 +++ linux-2.6.9/drivers/char/agp/intel-agp.c 2004-10-18 15:13:44.517605463 -0700 @@ -1778,7 +1778,7 @@ .name = "agpgart-intel", .id_table = agp_intel_pci_table, .probe = agp_intel_probe, - .remove = agp_intel_remove, + .remove = __devexit_p(agp_intel_remove), .resume = agp_intel_resume, }; diff -urN linux-2.6.9-rc4/drivers/input/joystick/Kconfig linux-2.6.9/drivers/input/joystick/Kconfig --- linux-2.6.9-rc4/drivers/input/joystick/Kconfig 2004-10-18 15:13:24.247780477 -0700 +++ linux-2.6.9/drivers/input/joystick/Kconfig 2004-10-18 15:13:45.074628134 -0700 @@ -249,7 +249,7 @@ config JOYSTICK_JOYDUMP tristate "Gameport data dumper" - depends on INPUT && INPUT_JOYSTICK + depends on INPUT && INPUT_JOYSTICK && GAMEPORT help Say Y here if you want to dump data from your joystick into the system log for debugging purposes. Say N if you are making a production diff -urN linux-2.6.9-rc4/drivers/input/serio/parkbd.c linux-2.6.9/drivers/input/serio/parkbd.c --- linux-2.6.9-rc4/drivers/input/serio/parkbd.c 2004-10-18 15:13:24.275781617 -0700 +++ linux-2.6.9/drivers/input/serio/parkbd.c 2004-10-18 15:13:45.136630657 -0700 @@ -160,6 +160,7 @@ serio = kmalloc(sizeof(struct serio), GFP_KERNEL); if (serio) { + memset(serio, 0, sizeof(struct serio)); serio->type = parkbd_mode; serio->write = parkbd_write, strlcpy(serio->name, "PARKBD AT/XT keyboard adapter", sizeof(serio->name)); diff -urN linux-2.6.9-rc4/drivers/mtd/chips/cfi_cmdset_0001.c linux-2.6.9/drivers/mtd/chips/cfi_cmdset_0001.c --- linux-2.6.9-rc4/drivers/mtd/chips/cfi_cmdset_0001.c 2004-10-18 15:13:24.739800502 -0700 +++ linux-2.6.9/drivers/mtd/chips/cfi_cmdset_0001.c 2004-10-18 15:13:46.592689919 -0700 @@ -603,6 +603,8 @@ } spin_unlock(&shared->lock); } + } else { + spin_unlock(&shared->lock); } } diff -urN linux-2.6.9-rc4/drivers/mtd/maps/lubbock-flash.c linux-2.6.9/drivers/mtd/maps/lubbock-flash.c --- linux-2.6.9-rc4/drivers/mtd/maps/lubbock-flash.c 2004-08-13 22:37:26.000000000 -0700 +++ linux-2.6.9/drivers/mtd/maps/lubbock-flash.c 2004-10-18 15:13:46.658692605 -0700 @@ -1,5 +1,5 @@ /* - * $Id: lubbock-flash.c,v 1.15 2004/07/12 21:59:44 dwmw2 Exp $ + * $Id: lubbock-flash.c,v 1.18 2004/09/28 18:54:40 nico Exp $ * * Map driver for the Lubbock developer platform. * @@ -15,11 +15,13 @@ #include #include #include +#include #include #include #include #include #include +#include #include @@ -82,16 +84,14 @@ lubbock_maps[flashboot].name = "Lubbock Boot ROM"; for (i = 0; i < 2; i++) { - lubbock_maps[i].virt = (unsigned long)ioremap(lubbock_maps[i].phys, WINDOW_SIZE); + lubbock_maps[i].virt = (void __iomem *)ioremap(lubbock_maps[i].phys, WINDOW_SIZE); if (!lubbock_maps[i].virt) { printk(KERN_WARNING "Failed to ioremap %s\n", lubbock_maps[i].name); if (!ret) ret = -ENOMEM; continue; } - lubbock_maps[i].cached = __ioremap(lubbock_maps[i].phys, - WINDOW_SIZE, - L_PTE_CACHEABLE, 1); + lubbock_maps[i].cached = ioremap_cached(lubbock_maps[i].phys, WINDOW_SIZE); if (!lubbock_maps[i].cached) printk(KERN_WARNING "Failed to ioremap cached %s\n", lubbock_maps[i].name); simple_map_init(&lubbock_maps[i]); diff -urN linux-2.6.9-rc4/drivers/pci/hotplug/rpaphp_pci.c linux-2.6.9/drivers/pci/hotplug/rpaphp_pci.c --- linux-2.6.9-rc4/drivers/pci/hotplug/rpaphp_pci.c 2004-10-18 15:13:25.202819347 -0700 +++ linux-2.6.9/drivers/pci/hotplug/rpaphp_pci.c 2004-10-18 15:13:47.407723091 -0700 @@ -362,7 +362,7 @@ int rpaphp_unconfig_pci_adapter(struct slot *slot) { int retval = 0; - struct list_head *ln; + struct list_head *ln, *tmp; dbg("Entry %s: slot[%s]\n", __FUNCTION__, slot->name); if (list_empty(&slot->dev.pci_funcs)) { @@ -373,7 +373,7 @@ goto exit; } /* remove the devices from the pci core */ - list_for_each (ln, &slot->dev.pci_funcs) { + list_for_each_safe (ln, tmp, &slot->dev.pci_funcs) { struct rpaphp_pci_func *func; func = list_entry(ln, struct rpaphp_pci_func, sibling); diff -urN linux-2.6.9-rc4/drivers/pci/probe.c linux-2.6.9/drivers/pci/probe.c --- linux-2.6.9-rc4/drivers/pci/probe.c 2004-10-18 15:13:25.219820039 -0700 +++ linux-2.6.9/drivers/pci/probe.c 2004-10-18 15:13:47.425723823 -0700 @@ -373,7 +373,10 @@ child->bridge_ctl = bctl; cmax = pci_scan_child_bus(child); - if (cmax > max) max = cmax; + if (cmax > max) + max = cmax; + if (child->subordinate > max) + max = child->subordinate; } else { /* * We need to assign a number to this bus which we always diff -urN linux-2.6.9-rc4/drivers/scsi/megaraid/megaraid_mbox.c linux-2.6.9/drivers/scsi/megaraid/megaraid_mbox.c --- linux-2.6.9-rc4/drivers/scsi/megaraid/megaraid_mbox.c 2004-10-18 15:13:25.461829889 -0700 +++ linux-2.6.9/drivers/scsi/megaraid/megaraid_mbox.c 2004-10-18 15:13:49.580811535 -0700 @@ -10,7 +10,7 @@ * 2 of the License, or (at your option) any later version. * * FILE : megaraid_mbox.c - * Version : v2.20.3.1 (August 24 2004) + * Version : v2.20.4 (September 27 2004) * * Authors: * Atul Mukker @@ -197,7 +197,7 @@ * ### global data ### */ static uint8_t megaraid_mbox_version[8] = - { 0x02, 0x20, 0x02, 0x00, 7, 22, 20, 4 }; + { 0x02, 0x20, 0x04, 0x00, 9, 27, 20, 4 }; /* @@ -3562,7 +3562,7 @@ for (i = 0; i < MBOX_MAX_USER_CMDS; i++) { scb = adapter->uscb_list + i; - ccb = raid_dev->ccb_list + i; + ccb = raid_dev->uccb_list + i; scb->ccb = (caddr_t)ccb; ccb->mbox64 = raid_dev->umbox64 + i; diff -urN linux-2.6.9-rc4/drivers/scsi/megaraid/megaraid_mbox.h linux-2.6.9/drivers/scsi/megaraid/megaraid_mbox.h --- linux-2.6.9-rc4/drivers/scsi/megaraid/megaraid_mbox.h 2004-10-18 15:13:25.462829930 -0700 +++ linux-2.6.9/drivers/scsi/megaraid/megaraid_mbox.h 2004-10-18 15:13:49.581811576 -0700 @@ -21,8 +21,8 @@ #include "megaraid_ioctl.h" -#define MEGARAID_VERSION "2.20.3.1" -#define MEGARAID_EXT_VERSION "(Release Date: Tue Aug 24 09:43:35 EDT 2004)" +#define MEGARAID_VERSION "2.20.4.0" +#define MEGARAID_EXT_VERSION "(Release Date: Mon Sep 27 22:15:07 EDT 2004)" /* diff -urN linux-2.6.9-rc4/drivers/usb/class/usblp.c linux-2.6.9/drivers/usb/class/usblp.c --- linux-2.6.9-rc4/drivers/usb/class/usblp.c 2004-10-18 15:13:25.636837012 -0700 +++ linux-2.6.9/drivers/usb/class/usblp.c 2004-10-18 15:13:50.435846335 -0700 @@ -397,10 +397,6 @@ { info("usblp%d: removed", usblp->minor); - usb_buffer_free (usblp->dev, USBLP_BUF_SIZE, - usblp->writebuf, usblp->writeurb->transfer_dma); - usb_buffer_free (usblp->dev, USBLP_BUF_SIZE, - usblp->readbuf, usblp->readurb->transfer_dma); kfree (usblp->device_id_string); kfree (usblp->statusbuf); usb_free_urb(usblp->writeurb); @@ -1159,6 +1155,10 @@ usb_set_intfdata (intf, NULL); usblp_unlink_urbs(usblp); + usb_buffer_free (usblp->dev, USBLP_BUF_SIZE, + usblp->writebuf, usblp->writeurb->transfer_dma); + usb_buffer_free (usblp->dev, USBLP_BUF_SIZE, + usblp->readbuf, usblp->readurb->transfer_dma); if (!usblp->used) usblp_cleanup (usblp); diff -urN linux-2.6.9-rc4/drivers/usb/gadget/net2280.c linux-2.6.9/drivers/usb/gadget/net2280.c --- linux-2.6.9-rc4/drivers/usb/gadget/net2280.c 2004-10-18 15:13:25.670838396 -0700 +++ linux-2.6.9/drivers/usb/gadget/net2280.c 2004-10-18 15:13:50.506849225 -0700 @@ -303,13 +303,16 @@ /* init to our chosen defaults, notably so that we NAK OUT * packets until the driver queues a read (+note erratum 0112) */ - writel ( (1 << SET_NAK_OUT_PACKETS_MODE) + tmp = (1 << SET_NAK_OUT_PACKETS_MODE) | (1 << SET_NAK_OUT_PACKETS) | (1 << CLEAR_EP_HIDE_STATUS_PHASE) - | (1 << CLEAR_INTERRUPT_MODE) - | (1 << CLEAR_ENDPOINT_TOGGLE) - | (1 << CLEAR_ENDPOINT_HALT) - , &ep->regs->ep_rsp); + | (1 << CLEAR_INTERRUPT_MODE); + + if (ep->num != 0) { + tmp |= (1 << CLEAR_ENDPOINT_TOGGLE) + | (1 << CLEAR_ENDPOINT_HALT); + } + writel (tmp, &ep->regs->ep_rsp); /* scrub most status bits, and flush any fifo state */ writel ( (1 << TIMEOUT) @@ -1920,8 +1923,6 @@ , &dev->usb->stdrsp); writel ( (1 << USB_ROOT_PORT_WAKEUP_ENABLE) | (1 << SELF_POWERED_USB_DEVICE) - /* erratum 0102 workaround */ - | ((dev->chiprev == 0100) ? 0 : 1) << SUSPEND_IMMEDIATELY | (1 << REMOTE_WAKEUP_SUPPORT) | (dev->softconnect << USB_DETECT_ENABLE) | (1 << SELF_POWERED_STATUS) @@ -2047,6 +2048,8 @@ stop_activity (dev, driver); spin_unlock_irqrestore (&dev->lock, flags); + net2280_pullup (&dev->gadget, 0); + driver->unbind (&dev->gadget); dev->gadget.dev.driver = NULL; dev->driver = NULL; @@ -2552,8 +2555,6 @@ if (stat & (1 << SUSPEND_REQUEST_INTERRUPT)) { if (dev->driver->suspend) dev->driver->suspend (&dev->gadget); - /* we use SUSPEND_IMMEDIATELY */ - stat &= ~(1 << SUSPEND_REQUEST_INTERRUPT); } else { if (dev->driver->resume) dev->driver->resume (&dev->gadget); diff -urN linux-2.6.9-rc4/drivers/usb/host/ehci-hcd.c linux-2.6.9/drivers/usb/host/ehci-hcd.c --- linux-2.6.9-rc4/drivers/usb/host/ehci-hcd.c 2004-10-18 15:13:25.695839413 -0700 +++ linux-2.6.9/drivers/usb/host/ehci-hcd.c 2004-10-18 15:13:50.559851382 -0700 @@ -695,9 +695,18 @@ timer_action_done (ehci, TIMER_IO_WATCHDOG); if (ehci->reclaim_ready) end_unlink_async (ehci, regs); + + /* another CPU may drop ehci->lock during a schedule scan while + * it reports urb completions. this flag guards against bogus + * attempts at re-entrant schedule scanning. + */ + if (ehci->scanning) + return; + ehci->scanning = 1; scan_async (ehci, regs); if (ehci->next_uframe != -1) scan_periodic (ehci, regs); + ehci->scanning = 0; /* the IO watchdog guards against hardware or driver bugs that * misplace IRQs, and should let us run completely without IRQs. diff -urN linux-2.6.9-rc4/drivers/usb/host/ehci.h linux-2.6.9/drivers/usb/host/ehci.h --- linux-2.6.9-rc4/drivers/usb/host/ehci.h 2004-10-18 15:13:25.699839576 -0700 +++ linux-2.6.9/drivers/usb/host/ehci.h 2004-10-18 15:13:50.578852156 -0700 @@ -53,6 +53,7 @@ struct ehci_qh *async; struct ehci_qh *reclaim; unsigned reclaim_ready : 1; + unsigned scanning : 1; /* periodic schedule support */ #define DEFAULT_I_TDPS 1024 /* some HCs can do less */ diff -urN linux-2.6.9-rc4/drivers/usb/input/hid-core.c linux-2.6.9/drivers/usb/input/hid-core.c --- linux-2.6.9-rc4/drivers/usb/input/hid-core.c 2004-10-18 15:13:25.721840472 -0700 +++ linux-2.6.9/drivers/usb/input/hid-core.c 2004-10-18 15:13:50.637854557 -0700 @@ -926,6 +926,8 @@ case -ENOENT: case -ESHUTDOWN: return; + case -ETIMEDOUT: /* NAK */ + break; default: /* error */ warn("input irq status %d received", urb->status); } @@ -1859,8 +1861,8 @@ static void __exit hid_exit(void) { - hiddev_exit(); usb_deregister(&hid_driver); + hiddev_exit(); } module_init(hid_init); diff -urN linux-2.6.9-rc4/drivers/usb/media/konicawc.c linux-2.6.9/drivers/usb/media/konicawc.c --- linux-2.6.9-rc4/drivers/usb/media/konicawc.c 2004-10-18 15:13:25.730840838 -0700 +++ linux-2.6.9/drivers/usb/media/konicawc.c 2004-10-18 15:13:50.647854964 -0700 @@ -362,8 +362,8 @@ else if (!urb->status && !cam->last_data_urb->status) len = konicawc_compress_iso(uvd, cam->last_data_urb, urb); - resubmit_urb(uvd, urb); resubmit_urb(uvd, cam->last_data_urb); + resubmit_urb(uvd, urb); cam->last_data_urb = NULL; uvd->stats.urb_length = len; uvd->stats.data_count += len; diff -urN linux-2.6.9-rc4/drivers/usb/serial/digi_acceleport.c linux-2.6.9/drivers/usb/serial/digi_acceleport.c --- linux-2.6.9-rc4/drivers/usb/serial/digi_acceleport.c 2004-10-18 15:13:25.790843280 -0700 +++ linux-2.6.9/drivers/usb/serial/digi_acceleport.c 2004-10-18 15:13:50.791860825 -0700 @@ -1546,13 +1546,17 @@ dbg( "digi_close: TOP: port=%d, open_count=%d", priv->dp_port_num, port->open_count ); + /* if disconnected, just clear flags */ + if (!usb_get_intfdata(port->serial->interface)) + goto exit; + /* do cleanup only after final close on this port */ spin_lock_irqsave( &priv->dp_port_lock, flags ); priv->dp_in_close = 1; spin_unlock_irqrestore( &priv->dp_port_lock, flags ); /* tell line discipline to process only XON/XOFF */ - tty->closing = 1; + tty->closing = 1; /* wait for output to drain */ if( (filp->f_flags&(O_NDELAY|O_NONBLOCK)) == 0 ) { @@ -1616,6 +1620,7 @@ tty->closing = 0; +exit: spin_lock_irqsave( &priv->dp_port_lock, flags ); priv->dp_write_urb_in_use = 0; priv->dp_in_close = 0; diff -urN linux-2.6.9-rc4/drivers/video/cyber2000fb.c linux-2.6.9/drivers/video/cyber2000fb.c --- linux-2.6.9-rc4/drivers/video/cyber2000fb.c 2004-10-18 15:13:25.910848164 -0700 +++ linux-2.6.9/drivers/video/cyber2000fb.c 2004-10-18 15:13:51.258879833 -0700 @@ -1166,7 +1166,7 @@ .vmode = FB_VMODE_NONINTERLACED }; -static char igs_regs[] __devinitdata = { +static char igs_regs[] = { EXT_CRT_IRQ, 0, EXT_CRT_TEST, 0, EXT_SYNC_CTL, 0, @@ -1289,7 +1289,7 @@ return cfb; } -static void __devinit +static void cyberpro_free_fb_info(struct cfb_info *cfb) { if (cfb) { diff -urN linux-2.6.9-rc4/fs/ext3/inode.c linux-2.6.9/fs/ext3/inode.c --- linux-2.6.9-rc4/fs/ext3/inode.c 2004-10-18 15:13:26.719881092 -0700 +++ linux-2.6.9/fs/ext3/inode.c 2004-10-18 15:13:52.260920616 -0700 @@ -1579,6 +1579,12 @@ offset, nr_segs, ext3_direct_io_get_blocks, NULL); + /* + * Reacquire the handle: ext3_direct_io_get_block() can restart the + * transaction + */ + handle = journal_current_handle(); + out_stop: if (handle) { int err; diff -urN linux-2.6.9-rc4/fs/proc/array.c linux-2.6.9/fs/proc/array.c --- linux-2.6.9-rc4/fs/proc/array.c 2004-10-18 15:13:27.822925986 -0700 +++ linux-2.6.9/fs/proc/array.c 2004-10-18 15:13:53.227959974 -0700 @@ -360,7 +360,11 @@ read_unlock(&tasklist_lock); /* Temporary variable needed for gcc-2.96 */ - start_time = jiffies_64_to_clock_t(task->start_time - INITIAL_JIFFIES); + /* convert timespec -> nsec*/ + start_time = (unsigned long long)task->start_time.tv_sec * NSEC_PER_SEC + + task->start_time.tv_nsec; + /* convert nsec -> ticks */ + start_time = nsec_to_clock_t(start_time); res = sprintf(buffer,"%d (%s) %c %d %d %d %d %d %lu %lu \ %lu %lu %lu %lu %lu %ld %ld %ld %ld %d %ld %llu %lu %ld %lu %lu %lu %lu %lu \ diff -urN linux-2.6.9-rc4/fs/xfs/linux-2.6/xfs_ioctl.c linux-2.6.9/fs/xfs/linux-2.6/xfs_ioctl.c --- linux-2.6.9-rc4/fs/xfs/linux-2.6/xfs_ioctl.c 2004-10-18 15:13:28.157939621 -0700 +++ linux-2.6.9/fs/xfs/linux-2.6/xfs_ioctl.c 2004-10-18 15:13:53.457969336 -0700 @@ -818,13 +818,15 @@ if (!capable(CAP_SYS_ADMIN)) return -EPERM; - freeze_bdev(inode->i_sb->s_bdev); + if (inode->i_sb->s_frozen == SB_UNFROZEN) + freeze_bdev(inode->i_sb->s_bdev); return 0; case XFS_IOC_THAW: if (!capable(CAP_SYS_ADMIN)) return -EPERM; - thaw_bdev(inode->i_sb->s_bdev, inode->i_sb); + if (inode->i_sb->s_frozen != SB_UNFROZEN) + thaw_bdev(inode->i_sb->s_bdev, inode->i_sb); return 0; case XFS_IOC_GOINGDOWN: { diff -urN linux-2.6.9-rc4/fs/xfs/linux-2.6/xfs_super.c linux-2.6.9/fs/xfs/linux-2.6/xfs_super.c --- linux-2.6.9-rc4/fs/xfs/linux-2.6/xfs_super.c 2004-10-18 15:13:28.165939947 -0700 +++ linux-2.6.9/fs/xfs/linux-2.6/xfs_super.c 2004-10-18 15:13:53.466969702 -0700 @@ -339,16 +339,16 @@ int sync) { vnode_t *vp = LINVFS_GET_VP(inode); - int error, flags = FLUSH_INODE; + int error = 0, flags = FLUSH_INODE; - error = 0; if (vp) { vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address); if (sync) flags |= FLUSH_SYNC; VOP_IFLUSH(vp, flags, error); } - return error; + + return -error; } STATIC void @@ -491,8 +491,14 @@ break; spin_lock(&vfsp->vfs_sync_lock); - if (!timeleft) { - timeleft = (xfs_syncd_centisecs * HZ) / 100; + /* + * We can get woken by laptop mode, to do a sync - + * that's the (only!) case where the list would be + * empty with time remaining. + */ + if (!timeleft || list_empty(&vfsp->vfs_sync_list)) { + if (!timeleft) + timeleft = (xfs_syncd_centisecs * HZ) / 100; INIT_LIST_HEAD(&vfsp->vfs_sync_work.w_list); list_add_tail(&vfsp->vfs_sync_work.w_list, &vfsp->vfs_sync_list); @@ -595,9 +601,10 @@ if (unlikely(laptop_mode)) { int prev_sync_seq = vfsp->vfs_sync_seq; + /* * The disk must be active because we're syncing. - * We schedule syncd now (now that the disk is + * We schedule xfssyncd now (now that the disk is * active) instead of later (when it might not be). */ wake_up_process(vfsp->vfs_sync_task); diff -urN linux-2.6.9-rc4/fs/xfs/linux-2.6/xfs_vfs.h linux-2.6.9/fs/xfs/linux-2.6/xfs_vfs.h --- linux-2.6.9-rc4/fs/xfs/linux-2.6/xfs_vfs.h 2004-10-18 15:13:28.178940476 -0700 +++ linux-2.6.9/fs/xfs/linux-2.6/xfs_vfs.h 2004-10-18 15:13:53.491970720 -0700 @@ -216,4 +216,8 @@ extern void bhv_remove_all_vfsops(struct vfs *, int); extern void bhv_remove_vfsops(struct vfs *, int); +#define fs_frozen(vfsp) ((vfsp)->vfs_super->s_frozen) +#define fs_check_frozen(vfsp, level) \ + vfs_check_frozen(vfsp->vfs_super, level); + #endif /* __XFS_VFS_H__ */ diff -urN linux-2.6.9-rc4/fs/xfs/xfs_fsops.c linux-2.6.9/fs/xfs/xfs_fsops.c --- linux-2.6.9-rc4/fs/xfs/xfs_fsops.c 2004-10-18 15:13:28.457951832 -0700 +++ linux-2.6.9/fs/xfs/xfs_fsops.c 2004-10-18 15:13:53.787982767 -0700 @@ -590,9 +590,6 @@ xfs_mount_t *mp, __uint32_t inflags) { - if (!capable(CAP_SYS_ADMIN)) - return -EPERM; - switch (inflags) { case XFS_FSOP_GOING_FLAGS_DEFAULT: { struct vfs *vfsp = XFS_MTOVFS(mp); @@ -602,7 +599,7 @@ xfs_force_shutdown(mp, XFS_FORCE_UMOUNT); thaw_bdev(sb->s_bdev, sb); } - + break; } case XFS_FSOP_GOING_FLAGS_LOGFLUSH: diff -urN linux-2.6.9-rc4/fs/xfs/xfs_log.c linux-2.6.9/fs/xfs/xfs_log.c --- linux-2.6.9-rc4/fs/xfs/xfs_log.c 2004-10-18 15:13:28.534954966 -0700 +++ linux-2.6.9/fs/xfs/xfs_log.c 2004-10-18 15:13:53.841984965 -0700 @@ -811,7 +811,7 @@ xlog_t *log = mp->m_log; vfs_t *vfsp = XFS_MTOVFS(mp); - if (vfsp->vfs_super->s_frozen || XFS_FORCED_SHUTDOWN(mp) || + if (fs_frozen(vfsp) || XFS_FORCED_SHUTDOWN(mp) || (vfsp->vfs_flag & VFS_RDONLY)) return 0; diff -urN linux-2.6.9-rc4/fs/xfs/xfs_trans.c linux-2.6.9/fs/xfs/xfs_trans.c --- linux-2.6.9-rc4/fs/xfs/xfs_trans.c 2004-10-18 15:13:28.589957205 -0700 +++ linux-2.6.9/fs/xfs/xfs_trans.c 2004-10-18 15:13:53.879986512 -0700 @@ -131,7 +131,7 @@ xfs_mount_t *mp, uint type) { - vfs_check_frozen(XFS_MTOVFS(mp)->vfs_super, SB_FREEZE_TRANS); + fs_check_frozen(XFS_MTOVFS(mp), SB_FREEZE_TRANS); atomic_inc(&mp->m_active_trans); return (_xfs_trans_alloc(mp, type)); diff -urN linux-2.6.9-rc4/include/asm-generic/pgtable.h linux-2.6.9/include/asm-generic/pgtable.h --- linux-2.6.9-rc4/include/asm-generic/pgtable.h 2004-08-13 22:36:44.000000000 -0700 +++ linux-2.6.9/include/asm-generic/pgtable.h 2004-10-18 15:13:54.160997949 -0700 @@ -13,11 +13,19 @@ * Note: the old pte is known to not be writable, so we don't need to * worry about dirty bits etc getting lost. */ +#ifndef __HAVE_ARCH_SET_PTE_ATOMIC #define ptep_establish(__vma, __address, __ptep, __entry) \ do { \ set_pte(__ptep, __entry); \ flush_tlb_page(__vma, __address); \ } while (0) +#else /* __HAVE_ARCH_SET_PTE_ATOMIC */ +#define ptep_establish(__vma, __address, __ptep, __entry) \ +do { \ + set_pte_atomic(__ptep, __entry); \ + flush_tlb_page(__vma, __address); \ +} while (0) +#endif /* __HAVE_ARCH_SET_PTE_ATOMIC */ #endif #ifndef __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS diff -urN linux-2.6.9-rc4/include/asm-h8300/bitops.h linux-2.6.9/include/asm-h8300/bitops.h --- linux-2.6.9-rc4/include/asm-h8300/bitops.h 2004-08-13 22:36:56.000000000 -0700 +++ linux-2.6.9/include/asm-h8300/bitops.h 2004-10-18 15:13:54.162998030 -0700 @@ -273,6 +273,8 @@ return result + __ffs(tmp); } +#define find_first_bit(addr, size) find_next_bit(addr, size, 0) + /* * Every architecture must define this function. It's the fastest * way of searching a 140-bit bitmap where the first 100 bits are diff -urN linux-2.6.9-rc4/include/asm-i386/linkage.h linux-2.6.9/include/asm-i386/linkage.h --- linux-2.6.9-rc4/include/asm-i386/linkage.h 2004-08-13 22:38:10.000000000 -0700 +++ linux-2.6.9/include/asm-i386/linkage.h 2004-10-18 15:13:54.204999740 -0700 @@ -5,6 +5,10 @@ #define FASTCALL(x) x __attribute__((regparm(3))) #define fastcall __attribute__((regparm(3))) +#ifdef CONFIG_REGPARM +# define prevent_tail_call(ret) __asm__ ("" : "=r" (ret) : "0" (ret)) +#endif + #ifdef CONFIG_X86_ALIGNMENT_16 #define __ALIGN .align 16,0x90 #define __ALIGN_STR ".align 16,0x90" diff -urN linux-2.6.9-rc4/include/asm-i386/pgtable-3level.h linux-2.6.9/include/asm-i386/pgtable-3level.h --- linux-2.6.9-rc4/include/asm-i386/pgtable-3level.h 2004-10-18 15:13:28.894969619 -0700 +++ linux-2.6.9/include/asm-i386/pgtable-3level.h 2004-10-18 15:13:54.212000025 -0700 @@ -54,6 +54,7 @@ smp_wmb(); ptep->pte_low = pte.pte_low; } +#define __HAVE_ARCH_SET_PTE_ATOMIC #define set_pte_atomic(pteptr,pteval) \ set_64bit((unsigned long long *)(pteptr),pte_val(pteval)) #define set_pmd(pmdptr,pmdval) \ diff -urN linux-2.6.9-rc4/include/asm-m32r/unistd.h linux-2.6.9/include/asm-m32r/unistd.h --- linux-2.6.9-rc4/include/asm-m32r/unistd.h 2004-10-18 15:13:29.052976050 -0700 +++ linux-2.6.9/include/asm-m32r/unistd.h 2004-10-18 15:13:54.405007880 -0700 @@ -294,25 +294,16 @@ #define __NR_mq_getsetattr (__NR_mq_open+5) #define __NR_sys_kexec_load 283 #define __NR_waitid 284 -#define __NR_perfctr_info 285 -#define __NR_vperfctr_open (__NR_perfctr_info+1) -#define __NR_vperfctr_control (__NR_perfctr_info+2) -#define __NR_vperfctr_unlink (__NR_perfctr_info+3) -#define __NR_vperfctr_iresume (__NR_perfctr_info+4) -#define __NR_vperfctr_read (__NR_perfctr_info+5) -#define __NR_add_key 291 -#define __NR_request_key 292 -#define __NR_keyctl 293 -#define NR_syscalls 294 +#define NR_syscalls 285 -/* user-visible error numbers are in the range -1 - -128: see +/* user-visible error numbers are in the range -1 - -124: see * */ #define __syscall_return(type, res) \ do { \ - if ((unsigned long)(res) >= (unsigned long)(-(128 + 1))) { \ + if ((unsigned long)(res) >= (unsigned long)(-(124 + 1))) { \ /* Avoid using "res" which is declared to be in register r0; \ errno might expand to a function call and clobber it. */ \ int __err = -(res); \ diff -urN linux-2.6.9-rc4/include/asm-ppc/io.h linux-2.6.9/include/asm-ppc/io.h --- linux-2.6.9-rc4/include/asm-ppc/io.h 2004-10-18 15:13:29.099977963 -0700 +++ linux-2.6.9/include/asm-ppc/io.h 2004-10-18 15:13:54.470010526 -0700 @@ -398,6 +398,79 @@ return 0; } +/* + * Here comes the ppc implementation of the IOMAP + * interfaces. + */ +static inline unsigned int ioread8(void __iomem *addr) +{ + return readb(addr); +} + +static inline unsigned int ioread16(void __iomem *addr) +{ + return readw(addr); +} + +static inline unsigned int ioread32(void __iomem *addr) +{ + return readl(addr); +} + +static inline void iowrite8(u8 val, void __iomem *addr) +{ + writeb(val, addr); +} + +static inline void iowrite16(u16 val, void __iomem *addr) +{ + writew(val, addr); +} + +static inline void iowrite32(u32 val, void __iomem *addr) +{ + writel(val, addr); +} + +static inline void ioread8_rep(void __iomem *addr, void *dst, unsigned long count) +{ + _insb((u8 __force *) addr, dst, count); +} + +static inline void ioread16_rep(void __iomem *addr, void *dst, unsigned long count) +{ + _insw_ns((u16 __force *) addr, dst, count); +} + +static inline void ioread32_rep(void __iomem *addr, void *dst, unsigned long count) +{ + _insl_ns((u32 __force *) addr, dst, count); +} + +static inline void iowrite8_rep(void __iomem *addr, const void *src, unsigned long count) +{ + _outsb((u8 __force *) addr, src, count); +} + +static inline void iowrite16_rep(void __iomem *addr, const void *src, unsigned long count) +{ + _outsw_ns((u16 __force *) addr, src, count); +} + +static inline void iowrite32_rep(void __iomem *addr, const void *src, unsigned long count) +{ + _outsl_ns((u32 __force *) addr, src, count); +} + +/* Create a virtual mapping cookie for an IO port range */ +extern void __iomem *ioport_map(unsigned long port, unsigned int nr); +extern void ioport_unmap(void __iomem *); + +/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ +struct pci_dev; +extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); +extern void pci_iounmap(struct pci_dev *dev, void __iomem *); + #endif /* _PPC_IO_H */ #ifdef CONFIG_8260_PCI9 diff -urN linux-2.6.9-rc4/include/asm-um/dma-mapping.h linux-2.6.9/include/asm-um/dma-mapping.h --- linux-2.6.9-rc4/include/asm-um/dma-mapping.h 2004-10-18 15:13:29.193981789 -0700 +++ linux-2.6.9/include/asm-um/dma-mapping.h 2004-10-18 15:13:54.599015776 -0700 @@ -1,6 +1,8 @@ #ifndef _ASM_DMA_MAPPING_H #define _ASM_DMA_MAPPING_H +#include + static inline int dma_supported(struct device *dev, u64 mask) { diff -urN linux-2.6.9-rc4/include/asm-um/smp.h linux-2.6.9/include/asm-um/smp.h --- linux-2.6.9-rc4/include/asm-um/smp.h 2004-10-18 15:13:29.204982236 -0700 +++ linux-2.6.9/include/asm-um/smp.h 2004-10-18 15:13:54.611016265 -0700 @@ -8,10 +8,6 @@ #include "asm/current.h" #include "linux/cpumask.h" -extern cpumask_t cpu_online_map; -extern cpumask_t cpu_possible_map; - - #define smp_processor_id() (current_thread->cpu) #define cpu_logical_map(n) (n) #define cpu_number_map(n) (n) @@ -19,8 +15,6 @@ extern int hard_smp_processor_id(void); #define NO_PROC_ID -1 -#define cpu_online(cpu) cpu_isset(cpu, cpu_online_map) - extern int ncpus; diff -urN linux-2.6.9-rc4/include/linux/acct.h linux-2.6.9/include/linux/acct.h --- linux-2.6.9-rc4/include/linux/acct.h 2004-08-13 22:36:32.000000000 -0700 +++ linux-2.6.9/include/linux/acct.h 2004-10-18 15:13:54.659018218 -0700 @@ -172,17 +172,24 @@ #endif } -static inline u64 jiffies_64_to_AHZ(u64 x) +static inline u64 nsec_to_AHZ(u64 x) { -#if (TICK_NSEC % (NSEC_PER_SEC / AHZ)) == 0 -#if HZ != AHZ - do_div(x, HZ / AHZ); -#endif -#else - x *= TICK_NSEC; +#if (NSEC_PER_SEC % AHZ) == 0 do_div(x, (NSEC_PER_SEC / AHZ)); +#elif (AHZ % 512) == 0 + x *= AHZ/512; + do_div(x, (NSEC_PER_SEC / 512)); +#else + /* + * max relative error 5.7e-8 (1.8s per year) for AHZ <= 1024, + * overflow after 64.99 years. + * exact for AHZ=60, 72, 90, 120, 144, 180, 300, 600, 900, ... + */ + x *= 9; + do_div(x, (unsigned long)((9ull * NSEC_PER_SEC + (AHZ/2)) + / AHZ)); #endif - return x; + return x; } #endif /* __KERNEL */ diff -urN linux-2.6.9-rc4/include/linux/highmem.h linux-2.6.9/include/linux/highmem.h --- linux-2.6.9-rc4/include/linux/highmem.h 2004-08-13 22:37:37.000000000 -0700 +++ linux-2.6.9/include/linux/highmem.h 2004-10-18 15:13:54.740021515 -0700 @@ -40,6 +40,8 @@ void *addr = kmap_atomic(page, KM_USER0); clear_user_page(addr, vaddr, page); kunmap_atomic(addr, KM_USER0); + /* Make sure this page is cleared on other CPU's too before using it */ + smp_wmb(); } static inline void clear_highpage(struct page *page) @@ -73,6 +75,8 @@ copy_user_page(vto, vfrom, vaddr, to); kunmap_atomic(vfrom, KM_USER0); kunmap_atomic(vto, KM_USER1); + /* Make sure this page is cleared on other CPU's too before using it */ + smp_wmb(); } static inline void copy_highpage(struct page *to, struct page *from) diff -urN linux-2.6.9-rc4/include/linux/linkage.h linux-2.6.9/include/linux/linkage.h --- linux-2.6.9-rc4/include/linux/linkage.h 2004-08-13 22:37:14.000000000 -0700 +++ linux-2.6.9/include/linux/linkage.h 2004-10-18 15:13:54.763022451 -0700 @@ -14,6 +14,10 @@ #define asmlinkage CPP_ASMLINKAGE #endif +#ifndef prevent_tail_call +# define prevent_tail_call(ret) do { } while (0) +#endif + #ifndef __ALIGN #define __ALIGN .align 4,0x90 #define __ALIGN_STR ".align 4,0x90" diff -urN linux-2.6.9-rc4/include/linux/sched.h linux-2.6.9/include/linux/sched.h --- linux-2.6.9-rc4/include/linux/sched.h 2004-10-18 15:13:29.452992330 -0700 +++ linux-2.6.9/include/linux/sched.h 2004-10-18 15:13:54.829025138 -0700 @@ -508,7 +508,7 @@ struct timer_list real_timer; unsigned long utime, stime; unsigned long nvcsw, nivcsw; /* context switch counts */ - u64 start_time; + struct timespec start_time; /* mm fault and swap info: this can arguably be seen as either mm-specific or thread-specific */ unsigned long min_flt, maj_flt; /* process credentials */ diff -urN linux-2.6.9-rc4/include/linux/times.h linux-2.6.9/include/linux/times.h --- linux-2.6.9-rc4/include/linux/times.h 2004-08-13 22:36:14.000000000 -0700 +++ linux-2.6.9/include/linux/times.h 2004-10-18 15:13:54.846025830 -0700 @@ -55,6 +55,26 @@ } #endif +static inline u64 nsec_to_clock_t(u64 x) +{ +#if (NSEC_PER_SEC % USER_HZ) == 0 + do_div(x, (NSEC_PER_SEC / USER_HZ)); +#elif (USER_HZ % 512) == 0 + x *= USER_HZ/512; + do_div(x, (NSEC_PER_SEC / 512)); +#else + /* + * max relative error 5.7e-8 (1.8s per year) for USER_HZ <= 1024, + * overflow after 64.99 years. + * exact for HZ=60, 72, 90, 120, 144, 180, 300, 600, 900, ... + */ + x *= 9; + do_div(x, (unsigned long)((9ull * NSEC_PER_SEC + (USER_HZ/2)) + / USER_HZ)); +#endif + return x; +} + struct tms { clock_t tms_utime; clock_t tms_stime; diff -urN linux-2.6.9-rc4/kernel/acct.c linux-2.6.9/kernel/acct.c --- linux-2.6.9-rc4/kernel/acct.c 2004-08-13 22:36:59.000000000 -0700 +++ linux-2.6.9/kernel/acct.c 2004-10-18 15:13:55.258042599 -0700 @@ -384,6 +384,8 @@ unsigned long vsize; unsigned long flim; u64 elapsed; + u64 run_time; + struct timespec uptime; /* * First check to see if there is enough free_space to continue @@ -401,7 +403,13 @@ ac.ac_version = ACCT_VERSION | ACCT_BYTEORDER; strlcpy(ac.ac_comm, current->comm, sizeof(ac.ac_comm)); - elapsed = jiffies_64_to_AHZ(get_jiffies_64() - current->start_time); + /* calculate run_time in nsec*/ + do_posix_clock_monotonic_gettime(&uptime); + run_time = (u64)uptime.tv_sec*NSEC_PER_SEC + uptime.tv_nsec; + run_time -= (u64)current->start_time.tv_sec*NSEC_PER_SEC + + current->start_time.tv_nsec; + /* convert nsec -> AHZ */ + elapsed = nsec_to_AHZ(run_time); #if ACCT_VERSION==3 ac.ac_etime = encode_float(elapsed); #else diff -urN linux-2.6.9-rc4/kernel/exit.c linux-2.6.9/kernel/exit.c --- linux-2.6.9-rc4/kernel/exit.c 2004-10-18 15:13:29.656000593 -0700 +++ linux-2.6.9/kernel/exit.c 2004-10-18 15:13:55.275043291 -0700 @@ -1376,6 +1376,8 @@ struct siginfo __user *infop, int options, struct rusage __user *ru) { + long ret; + if (options & ~(WNOHANG|WNOWAIT|WEXITED|WSTOPPED|WCONTINUED)) return -EINVAL; if (!(options & (WEXITED|WSTOPPED|WCONTINUED))) @@ -1398,15 +1400,25 @@ return -EINVAL; } - return do_wait(pid, options, infop, NULL, ru); + ret = do_wait(pid, options, infop, NULL, ru); + + /* avoid REGPARM breakage on x86: */ + prevent_tail_call(ret); + return ret; } asmlinkage long sys_wait4(pid_t pid, int __user *stat_addr, int options, struct rusage __user *ru) { + long ret; + if (options & ~(WNOHANG|WUNTRACED|__WNOTHREAD|__WCLONE|__WALL)) return -EINVAL; - return do_wait(pid, options | WEXITED, NULL, stat_addr, ru); + ret = do_wait(pid, options | WEXITED, NULL, stat_addr, ru); + + /* avoid REGPARM breakage on x86: */ + prevent_tail_call(ret); + return ret; } #ifdef __ARCH_WANT_SYS_WAITPID diff -urN linux-2.6.9-rc4/kernel/fork.c linux-2.6.9/kernel/fork.c --- linux-2.6.9-rc4/kernel/fork.c 2004-10-18 15:13:29.760004826 -0700 +++ linux-2.6.9/kernel/fork.c 2004-10-18 15:13:55.278043413 -0700 @@ -992,7 +992,7 @@ p->utime = p->stime = 0; p->lock_depth = -1; /* -1 = no lock */ - p->start_time = get_jiffies_64(); + do_posix_clock_monotonic_gettime(&p->start_time); p->security = NULL; p->io_context = NULL; p->io_wait = NULL; @@ -1146,7 +1146,8 @@ bad_fork_cleanup_namespace: exit_namespace(p); bad_fork_cleanup_mm: - mmput(p->mm); + if (p->mm) + mmput(p->mm); bad_fork_cleanup_signal: exit_signal(p); bad_fork_cleanup_sighand: diff -urN linux-2.6.9-rc4/kernel/posix-timers.c linux-2.6.9/kernel/posix-timers.c --- linux-2.6.9-rc4/kernel/posix-timers.c 2004-10-18 15:13:29.768005152 -0700 +++ linux-2.6.9/kernel/posix-timers.c 2004-10-18 15:13:55.286043738 -0700 @@ -219,11 +219,6 @@ .clock_set = do_posix_clock_monotonic_settime }; -#ifdef CONFIG_TIME_INTERPOLATION - /* Clocks are more accurate with time interpolators */ - clock_realtime.res = clock_monotonic.res = time_interpolator_resolution(); -#endif - register_posix_clock(CLOCK_REALTIME, &clock_realtime); register_posix_clock(CLOCK_MONOTONIC, &clock_monotonic); diff -urN linux-2.6.9-rc4/mm/oom_kill.c linux-2.6.9/mm/oom_kill.c --- linux-2.6.9-rc4/mm/oom_kill.c 2004-10-18 15:13:29.950012559 -0700 +++ linux-2.6.9/mm/oom_kill.c 2004-10-18 15:13:55.491052082 -0700 @@ -26,6 +26,7 @@ /** * oom_badness - calculate a numeric value for how bad this task has been * @p: task struct of which task we should calculate + * @p: current uptime in seconds * * The formula used is relatively simple and documented inline in the * function. The main rationale is that we want to select a good task @@ -41,7 +42,7 @@ * of least surprise ... (be careful when you change it) */ -static unsigned long badness(struct task_struct *p) +static unsigned long badness(struct task_struct *p, unsigned long uptime) { unsigned long points, cpu_time, run_time, s; @@ -56,12 +57,16 @@ points = p->mm->total_vm; /* - * CPU time is in seconds and run time is in minutes. There is no - * particular reason for this other than that it turned out to work - * very well in practice. + * CPU time is in tens of seconds and run time is in thousands + * of seconds. There is no particular reason for this other than + * that it turned out to work very well in practice. */ cpu_time = (p->utime + p->stime) >> (SHIFT_HZ + 3); - run_time = (get_jiffies_64() - p->start_time) >> (SHIFT_HZ + 10); + + if (uptime >= p->start_time.tv_sec) + run_time = (uptime - p->start_time.tv_sec) >> 10; + else + run_time = 0; s = int_sqrt(cpu_time); if (s) @@ -111,10 +116,12 @@ unsigned long maxpoints = 0; struct task_struct *g, *p; struct task_struct *chosen = NULL; + struct timespec uptime; + do_posix_clock_monotonic_gettime(&uptime); do_each_thread(g, p) if (p->pid) { - unsigned long points = badness(p); + unsigned long points = badness(p, uptime.tv_sec); if (points > maxpoints) { chosen = p; maxpoints = points; diff -urN linux-2.6.9-rc4/mm/page-writeback.c linux-2.6.9/mm/page-writeback.c --- linux-2.6.9-rc4/mm/page-writeback.c 2004-10-18 15:13:29.951012600 -0700 +++ linux-2.6.9/mm/page-writeback.c 2004-08-13 22:37:26.000000000 -0700 @@ -153,11 +153,9 @@ if (dirty_ratio < 5) dirty_ratio = 5; - /* - * Keep the ratio between dirty_ratio and background_ratio roughly - * what the sysctls are after dirty_ratio has been scaled (above). - */ - background_ratio = dirty_background_ratio * dirty_ratio/vm_dirty_ratio; + background_ratio = dirty_background_ratio; + if (background_ratio >= dirty_ratio) + background_ratio = dirty_ratio / 2; background = (background_ratio * total_pages) / 100; dirty = (dirty_ratio * total_pages) / 100; diff -urN linux-2.6.9-rc4/mm/vmscan.c linux-2.6.9/mm/vmscan.c --- linux-2.6.9-rc4/mm/vmscan.c 2004-10-18 15:13:29.990014187 -0700 +++ linux-2.6.9/mm/vmscan.c 2004-10-18 15:13:55.517053140 -0700 @@ -181,7 +181,7 @@ struct shrinker *shrinker; if (scanned == 0) - return 0; + scanned = SWAP_CLUSTER_MAX; if (!down_read_trylock(&shrinker_rwsem)) return 0; @@ -1065,7 +1065,8 @@ total_reclaimed += sc.nr_reclaimed; if (zone->all_unreclaimable) continue; - if (zone->pages_scanned > zone->present_pages * 2) + if (zone->pages_scanned >= (zone->nr_active + + zone->nr_inactive) * 4) zone->all_unreclaimable = 1; /* * If we've done a decent amount of scanning and @@ -1102,8 +1103,10 @@ zone->prev_priority = zone->temp_priority; } - if (!all_zones_ok) + if (!all_zones_ok) { + cond_resched(); goto loop_again; + } return total_reclaimed; } diff -urN linux-2.6.9-rc4/net/sunrpc/auth_gss/auth_gss.c linux-2.6.9/net/sunrpc/auth_gss/auth_gss.c --- linux-2.6.9-rc4/net/sunrpc/auth_gss/auth_gss.c 2004-10-18 15:13:31.454073775 -0700 +++ linux-2.6.9/net/sunrpc/auth_gss/auth_gss.c 2004-10-18 15:13:56.994113257 -0700 @@ -246,7 +246,7 @@ spin_lock_init(&ctx->gc_seq_lock); atomic_set(&ctx->count,1); - if (simple_get_bytes(&p, end, uid, sizeof(uid))) + if (simple_get_bytes(&p, end, uid, sizeof(*uid))) goto err_free_ctx; /* FIXME: discarded timeout for now */ if (simple_get_bytes(&p, end, &timeout, sizeof(timeout))) diff -urN linux-2.6.9-rc4/net/sunrpc/svcauth.c linux-2.6.9/net/sunrpc/svcauth.c --- linux-2.6.9-rc4/net/sunrpc/svcauth.c 2004-10-18 15:13:31.482074915 -0700 +++ linux-2.6.9/net/sunrpc/svcauth.c 2004-10-18 15:13:57.089117123 -0700 @@ -183,7 +183,7 @@ } /* Didn't find anything */ if (!set) - goto out_noset; + goto out_nada; auth_domain_cache.entries++; out_set: set_bit(CACHE_HASHED, &item->h.flags); @@ -193,6 +193,8 @@ cache_fresh(&auth_domain_cache, &item->h, item->h.expiry_time); cache_get(&item->h); return item; +out_nada: + tmp = NULL; out_noset: read_unlock(&auth_domain_cache.hash_lock); return tmp; diff -urN linux-2.6.9-rc4/security/selinux/hooks.c linux-2.6.9/security/selinux/hooks.c --- linux-2.6.9-rc4/security/selinux/hooks.c 2004-10-18 15:13:31.632081020 -0700 +++ linux-2.6.9/security/selinux/hooks.c 2004-10-18 15:13:57.266124328 -0700 @@ -2466,21 +2466,14 @@ return error; } -static int selinux_file_mmap(struct file *file, unsigned long prot, unsigned long flags) +static int file_map_prot_check(struct file *file, unsigned long prot, int shared) { - u32 av; - int rc; - - rc = secondary_ops->file_mmap(file, prot, flags); - if (rc) - return rc; - if (file) { /* read access is always possible with a mapping */ - av = FILE__READ; + u32 av = FILE__READ; /* write access only matters if the mapping is shared */ - if ((flags & MAP_TYPE) == MAP_SHARED && (prot & PROT_WRITE)) + if (shared && (prot & PROT_WRITE)) av |= FILE__WRITE; if (prot & PROT_EXEC) @@ -2491,6 +2484,18 @@ return 0; } +static int selinux_file_mmap(struct file *file, unsigned long prot, unsigned long flags) +{ + int rc; + + rc = secondary_ops->file_mmap(file, prot, flags); + if (rc) + return rc; + + return file_map_prot_check(file, prot, + (flags & MAP_TYPE) == MAP_SHARED); +} + static int selinux_file_mprotect(struct vm_area_struct *vma, unsigned long prot) { @@ -2500,7 +2505,7 @@ if (rc) return rc; - return selinux_file_mmap(vma->vm_file, prot, vma->vm_flags); + return file_map_prot_check(vma->vm_file, prot, vma->vm_flags&VM_SHARED); } static int selinux_file_lock(struct file *file, unsigned int cmd) @@ -2625,6 +2630,11 @@ tsec2->exec_sid = tsec1->exec_sid; tsec2->create_sid = tsec1->create_sid; + /* Retain ptracer SID across fork, if any. + This will be reset by the ptrace hook upon any + subsequent ptrace_attach operations. */ + tsec2->ptrace_sid = tsec1->ptrace_sid; + return 0; }