diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.10-ck6/arch/i386/kernel/pci-dma.c linux-2.6.10-ck7/arch/i386/kernel/pci-dma.c --- linux-2.6.10-ck6/arch/i386/kernel/pci-dma.c 2004-10-19 08:57:04.000000000 +1000 +++ linux-2.6.10-ck7/arch/i386/kernel/pci-dma.c 2005-03-01 22:34:38.000000000 +1100 @@ -89,11 +89,11 @@ int dma_declare_coherent_memory(struct d if (!mem_base) goto out; - dev->dma_mem = kmalloc(GFP_KERNEL, sizeof(struct dma_coherent_mem)); + dev->dma_mem = kmalloc(sizeof(struct dma_coherent_mem), GFP_KERNEL); if (!dev->dma_mem) goto out; memset(dev->dma_mem, 0, sizeof(struct dma_coherent_mem)); - dev->dma_mem->bitmap = kmalloc(GFP_KERNEL, bitmap_size); + dev->dma_mem->bitmap = kmalloc(bitmap_size, GFP_KERNEL); if (!dev->dma_mem->bitmap) goto free1_out; memset(dev->dma_mem->bitmap, 0, bitmap_size); diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.10-ck6/arch/ia64/ia32/sys_ia32.c linux-2.6.10-ck7/arch/ia64/ia32/sys_ia32.c --- linux-2.6.10-ck6/arch/ia64/ia32/sys_ia32.c 2004-10-19 08:57:05.000000000 +1000 +++ linux-2.6.10-ck7/arch/ia64/ia32/sys_ia32.c 2005-03-01 22:34:38.000000000 +1100 @@ -1415,7 +1415,7 @@ sys32_ipc(u32 call, int first, int secon case SHMDT: return sys_shmdt(compat_ptr(ptr)); case SHMGET: - return sys_shmget(first, second, third); + return sys_shmget(first, (unsigned)second, third); case SHMCTL: return compat_sys_shmctl(first, second, compat_ptr(ptr)); diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.10-ck6/arch/ia64/kernel/entry.S linux-2.6.10-ck7/arch/ia64/kernel/entry.S --- linux-2.6.10-ck6/arch/ia64/kernel/entry.S 2004-12-25 10:14:46.000000000 +1100 +++ linux-2.6.10-ck7/arch/ia64/kernel/entry.S 2005-03-01 22:34:38.000000000 +1100 @@ -51,8 +51,11 @@ * setup a null register window frame. */ ENTRY(ia64_execve) - .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(3) - alloc loc1=ar.pfs,3,2,4,0 + /* + * Allocate 8 input registers since ptrace() may clobber them + */ + .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(8) + alloc loc1=ar.pfs,8,2,4,0 mov loc0=rp .body mov out0=in0 // filename @@ -113,8 +116,11 @@ END(ia64_execve) * u64 tls) */ GLOBAL_ENTRY(sys_clone2) - .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(6) - alloc r16=ar.pfs,6,2,6,0 + /* + * Allocate 8 input registers since ptrace() may clobber them + */ + .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(8) + alloc r16=ar.pfs,8,2,6,0 DO_SAVE_SWITCH_STACK adds r2=PT(R16)+IA64_SWITCH_STACK_SIZE+16,sp mov loc0=rp @@ -142,8 +148,11 @@ END(sys_clone2) * Deprecated. Use sys_clone2() instead. */ GLOBAL_ENTRY(sys_clone) - .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(5) - alloc r16=ar.pfs,5,2,6,0 + /* + * Allocate 8 input registers since ptrace() may clobber them + */ + .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(8) + alloc r16=ar.pfs,8,2,6,0 DO_SAVE_SWITCH_STACK adds r2=PT(R16)+IA64_SWITCH_STACK_SIZE+16,sp mov loc0=rp @@ -1183,7 +1192,10 @@ END(sys_rt_sigsuspend) ENTRY(sys_rt_sigreturn) PT_REGS_UNWIND_INFO(0) - alloc r2=ar.pfs,0,0,1,0 + /* + * Allocate 8 input registers since ptrace() may clobber them + */ + alloc r2=ar.pfs,8,0,1,0 .prologue PT_REGS_SAVES(16) adds sp=-16,sp diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.10-ck6/arch/ia64/kernel/fsys.S linux-2.6.10-ck7/arch/ia64/kernel/fsys.S --- linux-2.6.10-ck6/arch/ia64/kernel/fsys.S 2004-12-25 10:14:46.000000000 +1100 +++ linux-2.6.10-ck7/arch/ia64/kernel/fsys.S 2005-03-01 22:34:38.000000000 +1100 @@ -612,8 +612,9 @@ GLOBAL_ENTRY(fsys_bubble_down) ;; mov rp=r2 // set the real return addr tbit.z p8,p0=r3,TIF_SYSCALL_TRACE - -(p8) br.call.sptk.many b6=b6 // ignore this return addr + ;; +(p10) br.cond.spnt.many ia64_ret_from_syscall // p10==true means out registers are more than 8 +(p8) br.call.sptk.many b6=b6 // ignore this return addr br.cond.sptk ia64_trace_syscall END(fsys_bubble_down) diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.10-ck6/arch/ia64/kernel/gate.S linux-2.6.10-ck7/arch/ia64/kernel/gate.S --- linux-2.6.10-ck6/arch/ia64/kernel/gate.S 2004-06-16 17:35:31.000000000 +1000 +++ linux-2.6.10-ck7/arch/ia64/kernel/gate.S 2005-03-01 22:34:38.000000000 +1100 @@ -81,6 +81,7 @@ GLOBAL_ENTRY(__kernel_syscall_via_epc) LOAD_FSYSCALL_TABLE(r14) mov r16=IA64_KR(CURRENT) // 12 cycle read latency + tnat.nz p10,p9=r15 mov r19=NR_syscalls-1 ;; shladd r18=r17,3,r14 @@ -119,7 +120,8 @@ GLOBAL_ENTRY(__kernel_syscall_via_epc) #endif mov r10=-1 - mov r8=ENOSYS +(p10) mov r8=EINVAL +(p9) mov r8=ENOSYS FSYS_RETURN END(__kernel_syscall_via_epc) diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.10-ck6/arch/ia64/kernel/ivt.S linux-2.6.10-ck7/arch/ia64/kernel/ivt.S --- linux-2.6.10-ck6/arch/ia64/kernel/ivt.S 2004-12-25 10:14:46.000000000 +1100 +++ linux-2.6.10-ck7/arch/ia64/kernel/ivt.S 2005-03-01 22:34:38.000000000 +1100 @@ -51,6 +51,7 @@ #include #include #include +#include #if 1 # define PSR_DEFAULT_BITS psr.ac @@ -732,10 +733,12 @@ ENTRY(break_fault) ssm psr.ic | PSR_DEFAULT_BITS ;; srlz.i // guarantee that interruption collection is on + mov r3=NR_syscalls - 1 ;; (p15) ssm psr.i // restore psr.i + // p10==true means out registers are more than 8 or r15's Nat is true +(p10) br.cond.spnt.many ia64_ret_from_syscall ;; - mov r3=NR_syscalls - 1 movl r16=sys_call_table adds r15=-1024,r15 // r15 contains the syscall number---subtract 1024 @@ -836,8 +839,11 @@ END(interrupt) * On exit: * - executing on bank 1 registers * - psr.ic enabled, interrupts restored + * - p10: TRUE if syscall is invoked with more than 8 out + * registers or r15's Nat is true * - r1: kernel's gp * - r3: preserved (same as on entry) + * - r8: -EINVAL if p10 is true * - r12: points to kernel stack * - r13: points to current task * - p15: TRUE if interrupts need to be re-enabled @@ -871,12 +877,17 @@ GLOBAL_ENTRY(ia64_syscall_setup) ;; st8 [r16]=r19,PT(AR_RNAT)-PT(CR_IFS) // store ar.pfs.pfm in cr.ifs + extr.u r11=r19,7,7 // I0 // get sol of ar.pfs + and r8=0x7f,r19 // A // get sof of ar.pfs + st8 [r17]=r27,PT(AR_BSPSTORE)-PT(AR_RSC)// save ar.rsc + tbit.nz p15,p0=r29,IA64_PSR_I_BIT // I0 (p9) mov in1=-1 + ;; (pUStk) sub r18=r18,r22 // r18=RSE.ndirty*8 - tbit.nz p15,p0=r29,IA64_PSR_I_BIT tnat.nz p10,p0=in2 + add r11=8,r11 ;; (pKStk) adds r16=PT(PR)-PT(AR_RNAT),r16 // skip over ar_rnat field (pKStk) adds r17=PT(B0)-PT(AR_BSPSTORE),r17 // skip over ar_bspstore field @@ -904,25 +915,29 @@ GLOBAL_ENTRY(ia64_syscall_setup) (p13) mov in5=-1 ;; st8 [r16]=r21,PT(R8)-PT(AR_FPSR) // save ar.fpsr - st8.spill [r17]=r15 // save r15 tnat.nz p14,p0=in6 + cmp.lt p10,p9=r11,r8 // frame size can't be more than local+8 ;; stf8 [r16]=f1 // ensure pt_regs.r8 != 0 (see handle_syscall_error) +(p9) tnat.nz p10,p0=r15 adds r12=-16,r1 // switch to kernel memory stack (with 16 bytes of scratch) + + st8.spill [r17]=r15 // save r15 tnat.nz p8,p0=in7 + nop.i 0 mov r13=r2 // establish `current' movl r1=__gp // establish kernel global pointer ;; (p14) mov in6=-1 (p8) mov in7=-1 - tnat.nz p9,p0=r15 + nop.i 0 cmp.eq pSys,pNonSys=r0,r0 // set pSys=1, pNonSys=0 movl r17=FPSR_DEFAULT ;; mov.m ar.fpsr=r17 // set ar.fpsr to kernel default value -(p9) mov r15=-1 +(p10) mov r8=-EINVAL br.ret.sptk.many b7 END(ia64_syscall_setup) diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.10-ck6/arch/ia64/kernel/process.c linux-2.6.10-ck7/arch/ia64/kernel/process.c --- linux-2.6.10-ck6/arch/ia64/kernel/process.c 2004-12-25 10:14:46.000000000 +1100 +++ linux-2.6.10-ck7/arch/ia64/kernel/process.c 2005-03-01 22:34:38.000000000 +1100 @@ -613,7 +613,7 @@ dump_fpu (struct pt_regs *pt, elf_fpregs return 1; /* f0-f31 are always valid so we always return 1 */ } -asmlinkage long +long sys_execve (char __user *filename, char __user * __user *argv, char __user * __user *envp, struct pt_regs *regs) { diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.10-ck6/arch/mips/kernel/linux32.c linux-2.6.10-ck7/arch/mips/kernel/linux32.c --- linux-2.6.10-ck6/arch/mips/kernel/linux32.c 2004-08-15 14:08:04.000000000 +1000 +++ linux-2.6.10-ck7/arch/mips/kernel/linux32.c 2005-03-01 22:34:38.000000000 +1100 @@ -1117,7 +1117,7 @@ sys32_ipc (u32 call, int first, int seco err = sys_shmdt ((char *)A(ptr)); break; case SHMGET: - err = sys_shmget (first, second, third); + err = sys_shmget (first, (unsigned)second, third); break; case SHMCTL: err = do_sys32_shmctl (first, second, (void *)AA(ptr)); diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.10-ck6/arch/ppc64/kernel/prom_init.c linux-2.6.10-ck7/arch/ppc64/kernel/prom_init.c --- linux-2.6.10-ck6/arch/ppc64/kernel/prom_init.c 2004-12-25 10:14:47.000000000 +1100 +++ linux-2.6.10-ck7/arch/ppc64/kernel/prom_init.c 2005-03-01 22:34:38.000000000 +1100 @@ -846,7 +846,7 @@ static void __init prom_initialize_tce_t prom_debug("TCE table: %s\n", path); prom_debug("\tnode = 0x%x\n", node); - prom_debug("\tbase = 0x%x\n", vbase); + prom_debug("\tbase = 0x%x\n", base); prom_debug("\tsize = 0x%x\n", minsize); /* Initialize the table to have a one-to-one mapping diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.10-ck6/arch/ppc64/kernel/syscalls.c linux-2.6.10-ck7/arch/ppc64/kernel/syscalls.c --- linux-2.6.10-ck6/arch/ppc64/kernel/syscalls.c 2004-08-15 14:08:05.000000000 +1000 +++ linux-2.6.10-ck7/arch/ppc64/kernel/syscalls.c 2005-03-01 22:34:38.000000000 +1100 @@ -57,7 +57,8 @@ check_bugs(void) * This is really horribly ugly. */ asmlinkage int -sys_ipc (uint call, int first, int second, long third, void __user *ptr, long fifth) +sys_ipc (uint call, int first, unsigned long second, long third, + void __user *ptr, long fifth) { int version, ret; @@ -67,15 +68,16 @@ sys_ipc (uint call, int first, int secon ret = -ENOSYS; switch (call) { case SEMOP: - ret = sys_semtimedop (first, (struct sembuf __user *)ptr, second, - NULL); + ret = sys_semtimedop(first, (struct sembuf __user *)ptr, + (unsigned)second, NULL); break; case SEMTIMEDOP: - ret = sys_semtimedop (first, (struct sembuf __user *)ptr, second, + ret = sys_semtimedop(first, (struct sembuf __user *)ptr, + (unsigned)second, (const struct timespec __user *) fifth); break; case SEMGET: - ret = sys_semget (first, second, third); + ret = sys_semget (first, (int)second, third); break; case SEMCTL: { union semun fourth; @@ -85,11 +87,12 @@ sys_ipc (uint call, int first, int secon break; if ((ret = get_user(fourth.__pad, (void __user * __user *)ptr))) break; - ret = sys_semctl (first, second, third, fourth); + ret = sys_semctl(first, (int)second, third, fourth); break; } case MSGSND: - ret = sys_msgsnd (first, (struct msgbuf __user *) ptr, second, third); + ret = sys_msgsnd(first, (struct msgbuf __user *)ptr, + (size_t)second, third); break; case MSGRCV: switch (version) { @@ -103,27 +106,29 @@ sys_ipc (uint call, int first, int secon (struct ipc_kludge __user *) ptr, sizeof (tmp)) ? -EFAULT : 0)) break; - ret = sys_msgrcv (first, tmp.msgp, second, tmp.msgtyp, - third); + ret = sys_msgrcv(first, tmp.msgp, (size_t) second, + tmp.msgtyp, third); break; } default: ret = sys_msgrcv (first, (struct msgbuf __user *) ptr, - second, fifth, third); + (size_t)second, fifth, third); break; } break; case MSGGET: - ret = sys_msgget ((key_t) first, second); + ret = sys_msgget ((key_t)first, (int)second); break; case MSGCTL: - ret = sys_msgctl (first, second, (struct msqid_ds __user *) ptr); + ret = sys_msgctl(first, (int)second, + (struct msqid_ds __user *)ptr); break; case SHMAT: switch (version) { default: { ulong raddr; - ret = do_shmat (first, (char __user *) ptr, second, &raddr); + ret = do_shmat(first, (char __user *) ptr, + (int)second, &raddr); if (ret) break; ret = put_user (raddr, (ulong __user *) third); @@ -133,8 +138,8 @@ sys_ipc (uint call, int first, int secon ret = -EINVAL; if (!segment_eq(get_fs(), get_ds())) break; - ret = do_shmat (first, (char __user *) ptr, second, - (ulong *) third); + ret = do_shmat(first, (char __user *)ptr, + (int)second, (ulong *)third); break; } break; @@ -142,10 +147,11 @@ sys_ipc (uint call, int first, int secon ret = sys_shmdt ((char __user *)ptr); break; case SHMGET: - ret = sys_shmget (first, second, third); + ret = sys_shmget (first, (size_t)second, third); break; case SHMCTL: - ret = sys_shmctl (first, second, (struct shmid_ds __user *) ptr); + ret = sys_shmctl(first, (int)second, + (struct shmid_ds __user *)ptr); break; } diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.10-ck6/arch/s390/kernel/compat_linux.c linux-2.6.10-ck7/arch/s390/kernel/compat_linux.c --- linux-2.6.10-ck6/arch/s390/kernel/compat_linux.c 2004-12-25 10:14:47.000000000 +1100 +++ linux-2.6.10-ck7/arch/s390/kernel/compat_linux.c 2005-03-01 22:34:38.000000000 +1100 @@ -331,7 +331,7 @@ asmlinkage long sys32_ipc(u32 call, int case SHMDT: return sys_shmdt(compat_ptr(ptr)); case SHMGET: - return sys_shmget(first, second, third); + return sys_shmget(first, (unsigned)second, third); case SHMCTL: return compat_sys_shmctl(first, second, compat_ptr(ptr)); } diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.10-ck6/arch/s390/kernel/sys_s390.c linux-2.6.10-ck7/arch/s390/kernel/sys_s390.c --- linux-2.6.10-ck6/arch/s390/kernel/sys_s390.c 2004-06-16 17:35:34.000000000 +1000 +++ linux-2.6.10-ck7/arch/s390/kernel/sys_s390.c 2005-03-01 22:34:38.000000000 +1100 @@ -145,7 +145,7 @@ asmlinkage long old_select(struct sel_ar * * This is really horribly ugly. */ -asmlinkage long sys_ipc(uint call, int first, int second, +asmlinkage long sys_ipc(uint call, int first, unsigned long second, unsigned long third, void __user *ptr) { struct ipc_kludge tmp; @@ -153,24 +153,25 @@ asmlinkage long sys_ipc(uint call, int f switch (call) { case SEMOP: - return sys_semtimedop (first, (struct sembuf __user *) ptr, second, - NULL); + return sys_semtimedop(first, (struct sembuf __user *)ptr, + (unsigned)second, NULL); case SEMTIMEDOP: - return sys_semtimedop (first, (struct sembuf __user *) ptr, second, + return sys_semtimedop(first, (struct sembuf __user *)ptr, + (unsigned)second, (const struct timespec __user *) third); case SEMGET: - return sys_semget (first, second, third); + return sys_semget(first, (int)second, third); case SEMCTL: { union semun fourth; if (!ptr) return -EINVAL; if (get_user(fourth.__pad, (void __user * __user *) ptr)) return -EFAULT; - return sys_semctl (first, second, third, fourth); + return sys_semctl(first, (int)second, third, fourth); } case MSGSND: return sys_msgsnd (first, (struct msgbuf __user *) ptr, - second, third); + (size_t)second, third); break; case MSGRCV: if (!ptr) @@ -179,15 +180,17 @@ asmlinkage long sys_ipc(uint call, int f sizeof (struct ipc_kludge))) return -EFAULT; return sys_msgrcv (first, tmp.msgp, - second, tmp.msgtyp, third); + (size_t)second, tmp.msgtyp, third); case MSGGET: - return sys_msgget ((key_t) first, second); + return sys_msgget((key_t)first, (int)second); case MSGCTL: - return sys_msgctl (first, second, (struct msqid_ds __user *) ptr); + return sys_msgctl(first, (int)second, + (struct msqid_ds __user *)ptr); case SHMAT: { ulong raddr; - ret = do_shmat (first, (char __user *) ptr, second, &raddr); + ret = do_shmat(first, (char __user *)ptr, + (int)second, &raddr); if (ret) return ret; return put_user (raddr, (ulong __user *) third); @@ -196,9 +199,9 @@ asmlinkage long sys_ipc(uint call, int f case SHMDT: return sys_shmdt ((char __user *)ptr); case SHMGET: - return sys_shmget (first, second, third); + return sys_shmget(first, (size_t)second, third); case SHMCTL: - return sys_shmctl (first, second, + return sys_shmctl(first, (int)second, (struct shmid_ds __user *) ptr); default: return -ENOSYS; diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.10-ck6/arch/sparc/kernel/auxio.c linux-2.6.10-ck7/arch/sparc/kernel/auxio.c --- linux-2.6.10-ck6/arch/sparc/kernel/auxio.c 2004-12-25 10:14:47.000000000 +1100 +++ linux-2.6.10-ck7/arch/sparc/kernel/auxio.c 2005-03-01 22:34:38.000000000 +1100 @@ -53,7 +53,8 @@ void __init auxio_probe(void) #endif } } - prom_getproperty(auxio_nd, "reg", (char *) auxregs, sizeof(auxregs)); + if(prom_getproperty(auxio_nd, "reg", (char *) auxregs, sizeof(auxregs)) <= 0) + return; prom_apply_obio_ranges(auxregs, 0x1); /* Map the register both read and write */ r.flags = auxregs[0].which_io & 0xF; @@ -121,7 +122,8 @@ void __init auxio_power_probe(void) return; /* Map the power control register. */ - prom_getproperty(node, "reg", (char *)®s, sizeof(regs)); + if (prom_getproperty(node, "reg", (char *)®s, sizeof(regs)) <= 0) + return; prom_apply_obio_ranges(®s, 1); memset(&r, 0, sizeof(r)); r.flags = regs.which_io & 0xF; diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.10-ck6/arch/sparc/kernel/idprom.c linux-2.6.10-ck7/arch/sparc/kernel/idprom.c --- linux-2.6.10-ck6/arch/sparc/kernel/idprom.c 2004-03-11 21:28:54.000000000 +1100 +++ linux-2.6.10-ck7/arch/sparc/kernel/idprom.c 2005-03-01 22:34:38.000000000 +1100 @@ -53,13 +53,12 @@ static void __init display_system_type(u for (i = 0; i < NUM_SUN_MACHINES; i++) { if(Sun_Machines[i].id_machtype == machtype) { - if (machtype != (SM_SUN4M_OBP | 0x00)) + if (machtype != (SM_SUN4M_OBP | 0x00) || + prom_getproperty(prom_root_node, "banner-name", + sysname, sizeof(sysname)) <= 0) printk("TYPE: %s\n", Sun_Machines[i].name); - else { - prom_getproperty(prom_root_node, "banner-name", - sysname, sizeof(sysname)); + else printk("TYPE: %s\n", sysname); - } return; } } diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.10-ck6/arch/sparc/kernel/sun4c_irq.c linux-2.6.10-ck7/arch/sparc/kernel/sun4c_irq.c --- linux-2.6.10-ck6/arch/sparc/kernel/sun4c_irq.c 2004-08-15 14:08:05.000000000 +1000 +++ linux-2.6.10-ck7/arch/sparc/kernel/sun4c_irq.c 2005-03-01 22:34:38.000000000 +1100 @@ -217,13 +217,18 @@ void __init sun4c_init_IRQ(void) panic("Cannot find /interrupt-enable node"); /* Depending on the "address" property is bad news... */ - prom_getproperty(ie_node, "reg", (char *) int_regs, sizeof(int_regs)); - memset(&phyres, 0, sizeof(struct resource)); - phyres.flags = int_regs[0].which_io; - phyres.start = int_regs[0].phys_addr; - interrupt_enable = (char *) sbus_ioremap(&phyres, 0, - int_regs[0].reg_size, "sun4c_intr"); + interrupt_enable = NULL; + if (prom_getproperty(ie_node, "reg", (char *) int_regs, + sizeof(int_regs)) != -1) { + memset(&phyres, 0, sizeof(struct resource)); + phyres.flags = int_regs[0].which_io; + phyres.start = int_regs[0].phys_addr; + interrupt_enable = (char *) sbus_ioremap(&phyres, 0, + int_regs[0].reg_size, "sun4c_intr"); + } } + if (!interrupt_enable) + panic("Cannot map interrupt_enable"); BTFIXUPSET_CALL(sbint_to_irq, sun4c_sbint_to_irq, BTFIXUPCALL_NORM); BTFIXUPSET_CALL(enable_irq, sun4c_enable_irq, BTFIXUPCALL_NORM); diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.10-ck6/arch/sparc/mm/iommu.c linux-2.6.10-ck7/arch/sparc/mm/iommu.c --- linux-2.6.10-ck6/arch/sparc/mm/iommu.c 2004-12-25 10:14:47.000000000 +1100 +++ linux-2.6.10-ck7/arch/sparc/mm/iommu.c 2005-03-01 22:34:38.000000000 +1100 @@ -71,14 +71,16 @@ iommu_init(int iommund, struct sbus_bus prom_printf("Unable to allocate iommu structure\n"); prom_halt(); } - prom_getproperty(iommund, "reg", (void *) iommu_promregs, - sizeof(iommu_promregs)); - memset(&r, 0, sizeof(r)); - r.flags = iommu_promregs[0].which_io; - r.start = iommu_promregs[0].phys_addr; - iommu->regs = (struct iommu_regs *) - sbus_ioremap(&r, 0, PAGE_SIZE * 3, "iommu_regs"); - if(!iommu->regs) { + iommu->regs = NULL; + if (prom_getproperty(iommund, "reg", (void *) iommu_promregs, + sizeof(iommu_promregs)) != -1) { + memset(&r, 0, sizeof(r)); + r.flags = iommu_promregs[0].which_io; + r.start = iommu_promregs[0].phys_addr; + iommu->regs = (struct iommu_regs *) + sbus_ioremap(&r, 0, PAGE_SIZE * 3, "iommu_regs"); + } + if (!iommu->regs) { prom_printf("Cannot map IOMMU registers\n"); prom_halt(); } diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.10-ck6/arch/sparc/mm/io-unit.c linux-2.6.10-ck7/arch/sparc/mm/io-unit.c --- linux-2.6.10-ck6/arch/sparc/mm/io-unit.c 2004-12-25 10:14:47.000000000 +1100 +++ linux-2.6.10-ck7/arch/sparc/mm/io-unit.c 2005-03-01 22:34:38.000000000 +1100 @@ -52,13 +52,15 @@ iounit_init(int sbi_node, int io_node, s iounit->rotor[1] = IOUNIT_BMAP2_START; iounit->rotor[2] = IOUNIT_BMAPM_START; - prom_getproperty(sbi_node, "reg", (void *) iommu_promregs, - sizeof(iommu_promregs)); - prom_apply_generic_ranges(io_node, 0, iommu_promregs, 3); - memset(&r, 0, sizeof(r)); - r.flags = iommu_promregs[2].which_io; - r.start = iommu_promregs[2].phys_addr; - xpt = (iopte_t *) sbus_ioremap(&r, 0, PAGE_SIZE * 16, "XPT"); + xpt = NULL; + if(prom_getproperty(sbi_node, "reg", (void *) iommu_promregs, + sizeof(iommu_promregs)) != -1) { + prom_apply_generic_ranges(io_node, 0, iommu_promregs, 3); + memset(&r, 0, sizeof(r)); + r.flags = iommu_promregs[2].which_io; + r.start = iommu_promregs[2].phys_addr; + xpt = (iopte_t *) sbus_ioremap(&r, 0, PAGE_SIZE * 16, "XPT"); + } if(!xpt) panic("Cannot map External Page Table."); sbus->iommu = (struct iommu_struct *)iounit; diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.10-ck6/arch/sparc/mm/sun4c.c linux-2.6.10-ck7/arch/sparc/mm/sun4c.c --- linux-2.6.10-ck6/arch/sparc/mm/sun4c.c 2004-10-19 08:57:05.000000000 +1000 +++ linux-2.6.10-ck7/arch/sparc/mm/sun4c.c 2005-03-01 22:34:38.000000000 +1100 @@ -511,7 +511,8 @@ void __init sun4c_probe_memerr_reg(void) node = prom_searchsiblings(prom_root_node, "memory-error"); if (!node) return; - prom_getproperty(node, "reg", (char *)regs, sizeof(regs)); + if (prom_getproperty(node, "reg", (char *)regs, sizeof(regs)) <= 0) + return; /* hmm I think regs[0].which_io is zero here anyways */ sun4c_memerr_reg = ioremap(regs[0].phys_addr, regs[0].reg_size); } diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.10-ck6/arch/sparc/prom/console.c linux-2.6.10-ck7/arch/sparc/prom/console.c --- linux-2.6.10-ck6/arch/sparc/prom/console.c 2004-03-11 21:28:54.000000000 +1100 +++ linux-2.6.10-ck7/arch/sparc/prom/console.c 2005-03-01 22:34:38.000000000 +1100 @@ -111,6 +111,7 @@ prom_query_input_device(void) int st_p; char propb[64]; char *p; + int propl; switch(prom_vers) { case PROM_V0: @@ -139,14 +140,16 @@ prom_query_input_device(void) if(strncmp(propb, "serial", sizeof("serial"))) return PROMDEV_I_UNK; } - prom_getproperty(prom_root_node, "stdin-path", propb, sizeof(propb)); - p = propb; - while(*p) p++; p -= 2; - if(p[0] == ':') { - if(p[1] == 'a') - return PROMDEV_ITTYA; - else if(p[1] == 'b') - return PROMDEV_ITTYB; + propl = prom_getproperty(prom_root_node, "stdin-path", propb, sizeof(propb)); + if(propl > 2) { + p = propb; + while(*p) p++; p -= 2; + if(p[0] == ':') { + if(p[1] == 'a') + return PROMDEV_ITTYA; + else if(p[1] == 'b') + return PROMDEV_ITTYB; + } } return PROMDEV_I_UNK; } @@ -179,7 +182,7 @@ prom_query_output_device(void) restore_current(); spin_unlock_irqrestore(&prom_lock, flags); propl = prom_getproperty(st_p, "device_type", propb, sizeof(propb)); - if (propl >= 0 && propl == sizeof("display") && + if (propl == sizeof("display") && strncmp("display", propb, sizeof("display")) == 0) { return PROMDEV_OSCREEN; @@ -188,16 +191,20 @@ prom_query_output_device(void) if(propl >= 0 && strncmp("serial", propb, sizeof("serial")) != 0) return PROMDEV_O_UNK; - prom_getproperty(prom_root_node, "stdout-path", propb, sizeof(propb)); - if(strncmp(propb, con_name_jmc, CON_SIZE_JMC) == 0) + propl = prom_getproperty(prom_root_node, "stdout-path", + propb, sizeof(propb)); + if(propl == CON_SIZE_JMC && + strncmp(propb, con_name_jmc, CON_SIZE_JMC) == 0) return PROMDEV_OTTYA; - p = propb; - while(*p) p++; p -= 2; - if(p[0]==':') { - if(p[1] == 'a') - return PROMDEV_OTTYA; - else if(p[1] == 'b') - return PROMDEV_OTTYB; + if(propl > 2) { + p = propb; + while(*p) p++; p-= 2; + if(p[0]==':') { + if(p[1] == 'a') + return PROMDEV_OTTYA; + else if(p[1] == 'b') + return PROMDEV_OTTYB; + } } } else { switch(*romvec->pv_stdin) { diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.10-ck6/arch/sparc/prom/tree.c linux-2.6.10-ck7/arch/sparc/prom/tree.c --- linux-2.6.10-ck6/arch/sparc/prom/tree.c 2004-03-11 21:28:54.000000000 +1100 +++ linux-2.6.10-ck7/arch/sparc/prom/tree.c 2005-03-01 22:34:38.000000000 +1100 @@ -176,8 +176,11 @@ void prom_getstring(int node, char *prop */ int prom_nodematch(int node, char *name) { + int error; + static char namebuf[128]; - prom_getproperty(node, "name", namebuf, sizeof(namebuf)); + error = prom_getproperty(node, "name", namebuf, sizeof(namebuf)); + if (error == -1) return 0; if(strcmp(namebuf, name) == 0) return 1; return 0; } diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.10-ck6/arch/sparc64/kernel/sys_sparc32.c linux-2.6.10-ck7/arch/sparc64/kernel/sys_sparc32.c --- linux-2.6.10-ck6/arch/sparc64/kernel/sys_sparc32.c 2004-12-25 10:14:47.000000000 +1100 +++ linux-2.6.10-ck7/arch/sparc64/kernel/sys_sparc32.c 2005-03-01 22:34:38.000000000 +1100 @@ -242,7 +242,7 @@ asmlinkage long sys32_getegid16(void) static long get_tv32(struct timeval *o, struct compat_timeval __user *i) { - return (!access_ok(VERIFY_READ, tv32, sizeof(*tv32)) || + return (!access_ok(VERIFY_READ, i, sizeof(*i)) || (__get_user(o->tv_sec, &i->tv_sec) | __get_user(o->tv_usec, &i->tv_usec))); } @@ -835,7 +835,7 @@ asmlinkage long compat_sys_ipc(u32 call, err = sys_shmdt(ptr); goto out; case SHMGET: - err = sys_shmget(first, second, third); + err = sys_shmget(first, (unsigned)second, third); goto out; case SHMCTL: err = do_sys32_shmctl(first, second, ptr); diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.10-ck6/arch/sparc64/kernel/sys_sparc.c linux-2.6.10-ck7/arch/sparc64/kernel/sys_sparc.c --- linux-2.6.10-ck6/arch/sparc64/kernel/sys_sparc.c 2004-08-15 14:08:05.000000000 +1000 +++ linux-2.6.10-ck7/arch/sparc64/kernel/sys_sparc.c 2005-03-01 22:34:38.000000000 +1100 @@ -199,7 +199,8 @@ out: * This is really horribly ugly. */ -asmlinkage long sys_ipc(unsigned int call, int first, int second, unsigned long third, void __user *ptr, long fifth) +asmlinkage long sys_ipc(unsigned int call, int first, unsigned long second, + unsigned long third, void __user *ptr, long fifth) { int err; @@ -207,14 +208,15 @@ asmlinkage long sys_ipc(unsigned int cal if (call <= SEMCTL) { switch (call) { case SEMOP: - err = sys_semtimedop(first, ptr, second, NULL); + err = sys_semtimedop(first, ptr, + (unsigned)second, NULL); goto out; case SEMTIMEDOP: - err = sys_semtimedop(first, ptr, second, + err = sys_semtimedop(first, ptr, (unsigned)second, (const struct timespec __user *) fifth); goto out; case SEMGET: - err = sys_semget(first, second, (int)third); + err = sys_semget(first, (int)second, (int)third); goto out; case SEMCTL: { union semun fourth; @@ -225,7 +227,7 @@ asmlinkage long sys_ipc(unsigned int cal if (get_user(fourth.__pad, (void __user * __user *) ptr)) goto out; - err = sys_semctl(first, second | IPC_64, + err = sys_semctl(first, (int)second | IPC_64, (int)third, fourth); goto out; } @@ -237,17 +239,18 @@ asmlinkage long sys_ipc(unsigned int cal if (call <= MSGCTL) { switch (call) { case MSGSND: - err = sys_msgsnd(first, ptr, second, (int)third); + err = sys_msgsnd(first, ptr, (size_t)second, + (int)third); goto out; case MSGRCV: - err = sys_msgrcv(first, ptr, second, fifth, + err = sys_msgrcv(first, ptr, (size_t)second, fifth, (int)third); goto out; case MSGGET: - err = sys_msgget((key_t) first, second); + err = sys_msgget((key_t)first, (int)second); goto out; case MSGCTL: - err = sys_msgctl(first, second | IPC_64, ptr); + err = sys_msgctl(first, (int)second | IPC_64, ptr); goto out; default: err = -ENOSYS; @@ -258,7 +261,7 @@ asmlinkage long sys_ipc(unsigned int cal switch (call) { case SHMAT: { ulong raddr; - err = do_shmat(first, ptr, second, &raddr); + err = do_shmat(first, ptr, (int)second, &raddr); if (!err) { if (put_user(raddr, (ulong __user *) third)) @@ -270,10 +273,10 @@ asmlinkage long sys_ipc(unsigned int cal err = sys_shmdt(ptr); goto out; case SHMGET: - err = sys_shmget(first, second, (int)third); + err = sys_shmget(first, (size_t)second, (int)third); goto out; case SHMCTL: - err = sys_shmctl(first, second | IPC_64, ptr); + err = sys_shmctl(first, (int)second | IPC_64, ptr); goto out; default: err = -ENOSYS; diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.10-ck6/arch/x86_64/ia32/ipc32.c linux-2.6.10-ck7/arch/x86_64/ia32/ipc32.c --- linux-2.6.10-ck6/arch/x86_64/ia32/ipc32.c 2004-05-23 12:54:27.000000000 +1000 +++ linux-2.6.10-ck7/arch/x86_64/ia32/ipc32.c 2005-03-01 22:34:38.000000000 +1100 @@ -49,7 +49,7 @@ sys32_ipc(u32 call, int first, int secon case SHMDT: return sys_shmdt(compat_ptr(ptr)); case SHMGET: - return sys_shmget(first, second, third); + return sys_shmget(first, (unsigned)second, third); case SHMCTL: return compat_sys_shmctl(first, second, compat_ptr(ptr)); } diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.10-ck6/drivers/block/cciss_scsi.c linux-2.6.10-ck7/drivers/block/cciss_scsi.c --- linux-2.6.10-ck6/drivers/block/cciss_scsi.c 2004-12-25 10:14:47.000000000 +1100 +++ linux-2.6.10-ck7/drivers/block/cciss_scsi.c 2005-03-01 22:34:38.000000000 +1100 @@ -691,14 +691,13 @@ static int cciss_scsi_detect(int ctlr) { struct Scsi_Host *sh; + int error; sh = scsi_host_alloc(&cciss_driver_template, sizeof(struct ctlr_info *)); if (sh == NULL) - return 0; - + goto fail; sh->io_port = 0; // good enough? FIXME, sh->n_io_port = 0; // I don't think we use these two... - sh->this_id = SELF_SCSI_ID; ((struct cciss_scsi_adapter_data_t *) @@ -706,10 +705,16 @@ cciss_scsi_detect(int ctlr) sh->hostdata[0] = (unsigned long) hba[ctlr]; sh->irq = hba[ctlr]->intr; sh->unique_id = sh->irq; - scsi_add_host(sh, &hba[ctlr]->pdev->dev); /* XXX handle failure */ + error = scsi_add_host(sh, &hba[ctlr]->pdev->dev); + if (error) + goto fail_host_put; scsi_scan_host(sh); - return 1; + + fail_host_put: + scsi_host_put(sh); + fail: + return 0; } static void __exit cleanup_cciss_module(void); diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.10-ck6/drivers/net/r8169.c linux-2.6.10-ck7/drivers/net/r8169.c --- linux-2.6.10-ck6/drivers/net/r8169.c 2004-12-25 10:14:49.000000000 +1100 +++ linux-2.6.10-ck7/drivers/net/r8169.c 2005-03-01 22:34:38.000000000 +1100 @@ -1389,12 +1389,12 @@ static int rtl8169_alloc_rx_skb(struct p dma_addr_t mapping; int ret = 0; - skb = dev_alloc_skb(RX_BUF_SIZE); + skb = dev_alloc_skb(RX_BUF_SIZE + NET_IP_ALIGN); if (!skb) goto err_out; skb->dev = dev; - skb_reserve(skb, 2); + skb_reserve(skb, NET_IP_ALIGN); *sk_buff = skb; mapping = pci_map_single(pdev, skb->tail, RX_BUF_SIZE, @@ -1638,10 +1638,10 @@ static inline int rtl8169_try_rx_copy(st if (pkt_size < rx_copybreak) { struct sk_buff *skb; - skb = dev_alloc_skb(pkt_size + 2); + skb = dev_alloc_skb(pkt_size + NET_IP_ALIGN); if (skb) { skb->dev = dev; - skb_reserve(skb, 2); + skb_reserve(skb, NET_IP_ALIGN); eth_copy_and_sum(skb, sk_buff[0]->tail, pkt_size, 0); *sk_buff = skb; rtl8169_return_to_asic(desc); diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.10-ck6/drivers/net/tulip/de2104x.c linux-2.6.10-ck7/drivers/net/tulip/de2104x.c --- linux-2.6.10-ck6/drivers/net/tulip/de2104x.c 2004-12-25 10:14:49.000000000 +1100 +++ linux-2.6.10-ck7/drivers/net/tulip/de2104x.c 2005-03-01 22:34:38.000000000 +1100 @@ -1958,8 +1958,6 @@ static int __devinit de_init_one (struct dev->tx_timeout = de_tx_timeout; dev->watchdog_timeo = TX_TIMEOUT; - dev->irq = pdev->irq; - de = dev->priv; de->de21040 = ent->driver_data == 0 ? 1 : 0; de->pdev = pdev; @@ -1995,6 +1993,8 @@ static int __devinit de_init_one (struct goto err_out_res; } + dev->irq = pdev->irq; + /* obtain and check validity of PCI I/O address */ pciaddr = pci_resource_start(pdev, 1); if (!pciaddr) { diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.10-ck6/drivers/s390/block/dasd_genhd.c linux-2.6.10-ck7/drivers/s390/block/dasd_genhd.c --- linux-2.6.10-ck6/drivers/s390/block/dasd_genhd.c 2004-08-15 14:08:08.000000000 +1000 +++ linux-2.6.10-ck7/drivers/s390/block/dasd_genhd.c 2005-03-01 22:34:38.000000000 +1100 @@ -149,8 +149,8 @@ dasd_destroy_partitions(struct dasd_devi * Can't call delete_partitions directly. Use ioctl. * The ioctl also does locking and invalidation. */ - memset(&bpart, sizeof(struct blkpg_partition), 0); - memset(&barg, sizeof(struct blkpg_ioctl_arg), 0); + memset(&bpart, 0, sizeof(struct blkpg_partition)); + memset(&barg, 0, sizeof(struct blkpg_ioctl_arg)); barg.data = &bpart; barg.op = BLKPG_DEL_PARTITION; for (bpart.pno = device->gdp->minors - 1; bpart.pno > 0; bpart.pno--) diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.10-ck6/drivers/s390/cio/cmf.c linux-2.6.10-ck7/drivers/s390/cio/cmf.c --- linux-2.6.10-ck6/drivers/s390/cio/cmf.c 2004-10-19 08:57:06.000000000 +1000 +++ linux-2.6.10-ck7/drivers/s390/cio/cmf.c 2005-03-01 22:34:38.000000000 +1100 @@ -526,7 +526,7 @@ readall_cmb (struct ccw_device *cdev, st time = get_clock() - cdev->private->cmb_start_time; spin_unlock_irqrestore(cdev->ccwlock, flags); - memset(data, sizeof(struct cmbdata), 0); + memset(data, 0, sizeof(struct cmbdata)); /* we only know values before device_busy_time */ data->size = offsetof(struct cmbdata, device_busy_time); @@ -736,7 +736,7 @@ readall_cmbe (struct ccw_device *cdev, s time = get_clock() - cdev->private->cmb_start_time; spin_unlock_irqrestore(cdev->ccwlock, flags); - memset (data, sizeof(struct cmbdata), 0); + memset (data, 0, sizeof(struct cmbdata)); /* we only know values before device_busy_time */ data->size = offsetof(struct cmbdata, device_busy_time); diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.10-ck6/drivers/s390/cio/css.c linux-2.6.10-ck7/drivers/s390/cio/css.c --- linux-2.6.10-ck6/drivers/s390/cio/css.c 2004-12-25 10:14:49.000000000 +1100 +++ linux-2.6.10-ck7/drivers/s390/cio/css.c 2005-03-01 22:34:38.000000000 +1100 @@ -527,7 +527,7 @@ css_enqueue_subchannel_slow(unsigned lon new_slow_sch = kmalloc(sizeof(struct slow_subchannel), GFP_ATOMIC); if (!new_slow_sch) return -ENOMEM; - memset(new_slow_sch, sizeof(struct slow_subchannel), 0); + memset(new_slow_sch, 0, sizeof(struct slow_subchannel)); new_slow_sch->schid = schid; spin_lock_irqsave(&slow_subchannel_lock, flags); list_add_tail(&new_slow_sch->slow_list, &slow_subchannels_head); diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.10-ck6/drivers/scsi/advansys.c linux-2.6.10-ck7/drivers/scsi/advansys.c --- linux-2.6.10-ck6/drivers/scsi/advansys.c 2004-12-25 10:14:49.000000000 +1100 +++ linux-2.6.10-ck7/drivers/scsi/advansys.c 2005-03-01 22:34:38.000000000 +1100 @@ -4322,12 +4322,12 @@ advansys_detect(struct scsi_host_templat int ioport = 0; int share_irq = FALSE; int iolen = 0; + struct device *dev = NULL; #ifdef CONFIG_PCI int pci_init_search = 0; struct pci_dev *pci_devicep[ASC_NUM_BOARD_SUPPORTED]; int pci_card_cnt_max = 0; int pci_card_cnt = 0; - struct device *dev = NULL; struct pci_dev *pci_devp = NULL; int pci_device_id_cnt = 0; unsigned int pci_device_id[ASC_PCI_DEVICE_ID_CNT] = { @@ -8944,7 +8944,7 @@ DvcAdvWritePCIConfigByte( #ifdef CONFIG_PCI pci_write_config_byte(to_pci_dev(asc_dvc->cfg->dev), offset, byte_data); #else /* CONFIG_PCI */ - return 0; + return; #endif /* CONFIG_PCI */ } @@ -12014,13 +12014,13 @@ AscInitFromAscDvcVar( PortAddr iop_base; ushort cfg_msw; ushort warn_code; - ushort pci_device_id; + ushort pci_device_id = 0; iop_base = asc_dvc->iop_base; +#ifdef CONFIG_PCI if (asc_dvc->cfg->dev) pci_device_id = to_pci_dev(asc_dvc->cfg->dev)->device; - else - pci_device_id = 0; +#endif warn_code = 0; cfg_msw = AscGetChipCfgMsw(iop_base); if ((cfg_msw & ASC_CFG_MSW_CLR_MASK) != 0) { diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.10-ck6/drivers/scsi/ahci.c linux-2.6.10-ck7/drivers/scsi/ahci.c --- linux-2.6.10-ck6/drivers/scsi/ahci.c 2004-12-25 10:14:49.000000000 +1100 +++ linux-2.6.10-ck7/drivers/scsi/ahci.c 2005-03-01 22:34:38.000000000 +1100 @@ -939,6 +939,7 @@ static int ahci_init_one (struct pci_dev unsigned long base; void *mmio_base; unsigned int board_idx = (unsigned int) ent->driver_data; + int pci_dev_busy = 0; int rc; VPRINTK("ENTER\n"); @@ -951,8 +952,10 @@ static int ahci_init_one (struct pci_dev return rc; rc = pci_request_regions(pdev, DRV_NAME); - if (rc) + if (rc) { + pci_dev_busy = 1; goto err_out; + } pci_enable_intx(pdev); @@ -1014,7 +1017,8 @@ err_out_free_ent: err_out_regions: pci_release_regions(pdev); err_out: - pci_disable_device(pdev); + if (!pci_dev_busy) + pci_disable_device(pdev); return rc; } diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.10-ck6/drivers/scsi/libata-core.c linux-2.6.10-ck7/drivers/scsi/libata-core.c --- linux-2.6.10-ck6/drivers/scsi/libata-core.c 2005-03-01 22:34:29.000000000 +1100 +++ linux-2.6.10-ck7/drivers/scsi/libata-core.c 2005-03-01 22:34:38.000000000 +1100 @@ -3559,6 +3559,7 @@ int ata_pci_init_one (struct pci_dev *pd struct ata_port_info *port[2]; u8 tmp8, mask; unsigned int legacy_mode = 0; + int disable_dev_on_err = 1; int rc; DPRINTK("ENTER\n"); @@ -3588,8 +3589,10 @@ int ata_pci_init_one (struct pci_dev *pd return rc; rc = pci_request_regions(pdev, DRV_NAME); - if (rc) + if (rc) { + disable_dev_on_err = 0; goto err_out; + } if (legacy_mode) { if (!request_region(0x1f0, 8, "libata")) { @@ -3599,8 +3602,10 @@ int ata_pci_init_one (struct pci_dev *pd conflict = ____request_resource(&ioport_resource, &res); if (!strcmp(conflict->name, "libata")) legacy_mode |= (1 << 0); - else + else { + disable_dev_on_err = 0; printk(KERN_WARNING "ata: 0x1f0 IDE port busy\n"); + } } else legacy_mode |= (1 << 0); @@ -3611,8 +3616,10 @@ int ata_pci_init_one (struct pci_dev *pd conflict = ____request_resource(&ioport_resource, &res); if (!strcmp(conflict->name, "libata")) legacy_mode |= (1 << 1); - else + else { + disable_dev_on_err = 0; printk(KERN_WARNING "ata: 0x170 IDE port busy\n"); + } } else legacy_mode |= (1 << 1); } @@ -3663,7 +3670,8 @@ err_out_regions: release_region(0x170, 8); pci_release_regions(pdev); err_out: - pci_disable_device(pdev); + if (disable_dev_on_err) + pci_disable_device(pdev); return rc; } diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.10-ck6/drivers/scsi/sata_nv.c linux-2.6.10-ck7/drivers/scsi/sata_nv.c --- linux-2.6.10-ck6/drivers/scsi/sata_nv.c 2004-12-25 10:14:49.000000000 +1100 +++ linux-2.6.10-ck7/drivers/scsi/sata_nv.c 2005-03-01 22:34:38.000000000 +1100 @@ -321,6 +321,7 @@ static int nv_init_one (struct pci_dev * struct nv_host *host; struct ata_port_info *ppi; struct ata_probe_ent *probe_ent; + int pci_dev_busy = 0; int rc; if (!printed_version++) @@ -331,8 +332,10 @@ static int nv_init_one (struct pci_dev * goto err_out; rc = pci_request_regions(pdev, DRV_NAME); - if (rc) + if (rc) { + pci_dev_busy = 1; goto err_out_disable; + } rc = pci_set_dma_mask(pdev, ATA_DMA_MASK); if (rc) @@ -404,7 +407,8 @@ err_out_free_ent: err_out_regions: pci_release_regions(pdev); err_out_disable: - pci_disable_device(pdev); + if (!pci_dev_busy) + pci_disable_device(pdev); err_out: return rc; } diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.10-ck6/drivers/scsi/sata_promise.c linux-2.6.10-ck7/drivers/scsi/sata_promise.c --- linux-2.6.10-ck6/drivers/scsi/sata_promise.c 2004-12-25 10:14:49.000000000 +1100 +++ linux-2.6.10-ck7/drivers/scsi/sata_promise.c 2005-03-01 22:34:38.000000000 +1100 @@ -546,6 +546,7 @@ static int pdc_ata_init_one (struct pci_ unsigned long base; void *mmio_base; unsigned int board_idx = (unsigned int) ent->driver_data; + int pci_dev_busy = 0; int rc; if (!printed_version++) @@ -560,8 +561,10 @@ static int pdc_ata_init_one (struct pci_ return rc; rc = pci_request_regions(pdev, DRV_NAME); - if (rc) + if (rc) { + pci_dev_busy = 1; goto err_out; + } rc = pci_set_dma_mask(pdev, ATA_DMA_MASK); if (rc) @@ -640,7 +643,8 @@ err_out_free_ent: err_out_regions: pci_release_regions(pdev); err_out: - pci_disable_device(pdev); + if (!pci_dev_busy) + pci_disable_device(pdev); return rc; } diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.10-ck6/drivers/scsi/sata_sil.c linux-2.6.10-ck7/drivers/scsi/sata_sil.c --- linux-2.6.10-ck6/drivers/scsi/sata_sil.c 2004-12-25 10:14:49.000000000 +1100 +++ linux-2.6.10-ck7/drivers/scsi/sata_sil.c 2005-03-01 22:34:38.000000000 +1100 @@ -332,6 +332,7 @@ static int sil_init_one (struct pci_dev void *mmio_base; int rc; unsigned int i; + int pci_dev_busy = 0; u32 tmp, irq_mask; if (!printed_version++) @@ -346,8 +347,10 @@ static int sil_init_one (struct pci_dev return rc; rc = pci_request_regions(pdev, DRV_NAME); - if (rc) + if (rc) { + pci_dev_busy = 1; goto err_out; + } rc = pci_set_dma_mask(pdev, ATA_DMA_MASK); if (rc) @@ -434,7 +437,8 @@ err_out_free_ent: err_out_regions: pci_release_regions(pdev); err_out: - pci_disable_device(pdev); + if (!pci_dev_busy) + pci_disable_device(pdev); return rc; } diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.10-ck6/drivers/scsi/sata_sis.c linux-2.6.10-ck7/drivers/scsi/sata_sis.c --- linux-2.6.10-ck6/drivers/scsi/sata_sis.c 2004-12-25 10:14:49.000000000 +1100 +++ linux-2.6.10-ck7/drivers/scsi/sata_sis.c 2005-03-01 22:34:38.000000000 +1100 @@ -200,14 +200,17 @@ static int sis_init_one (struct pci_dev int rc; u32 genctl; struct ata_port_info *ppi; + int pci_dev_busy = 0; rc = pci_enable_device(pdev); if (rc) return rc; rc = pci_request_regions(pdev, DRV_NAME); - if (rc) + if (rc) { + pci_dev_busy = 1; goto err_out; + } rc = pci_set_dma_mask(pdev, ATA_DMA_MASK); if (rc) @@ -259,7 +262,8 @@ err_out_regions: pci_release_regions(pdev); err_out: - pci_disable_device(pdev); + if (!pci_dev_busy) + pci_disable_device(pdev); return rc; } diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.10-ck6/drivers/scsi/sata_svw.c linux-2.6.10-ck7/drivers/scsi/sata_svw.c --- linux-2.6.10-ck6/drivers/scsi/sata_svw.c 2004-12-25 10:14:49.000000000 +1100 +++ linux-2.6.10-ck7/drivers/scsi/sata_svw.c 2005-03-01 22:34:38.000000000 +1100 @@ -338,6 +338,7 @@ static int k2_sata_init_one (struct pci_ struct ata_probe_ent *probe_ent = NULL; unsigned long base; void *mmio_base; + int pci_dev_busy = 0; int rc; if (!printed_version++) @@ -359,8 +360,10 @@ static int k2_sata_init_one (struct pci_ /* Request PCI regions */ rc = pci_request_regions(pdev, DRV_NAME); - if (rc) + if (rc) { + pci_dev_busy = 1; goto err_out; + } rc = pci_set_dma_mask(pdev, ATA_DMA_MASK); if (rc) @@ -433,7 +436,8 @@ err_out_free_ent: err_out_regions: pci_release_regions(pdev); err_out: - pci_disable_device(pdev); + if (!pci_dev_busy) + pci_disable_device(pdev); return rc; } diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.10-ck6/drivers/scsi/sata_sx4.c linux-2.6.10-ck7/drivers/scsi/sata_sx4.c --- linux-2.6.10-ck6/drivers/scsi/sata_sx4.c 2004-12-25 10:14:49.000000000 +1100 +++ linux-2.6.10-ck7/drivers/scsi/sata_sx4.c 2005-03-01 22:34:38.000000000 +1100 @@ -1366,6 +1366,7 @@ static int pdc_sata_init_one (struct pci void *mmio_base, *dimm_mmio = NULL; struct pdc_host_priv *hpriv = NULL; unsigned int board_idx = (unsigned int) ent->driver_data; + int pci_dev_busy = 0; int rc; if (!printed_version++) @@ -1380,8 +1381,10 @@ static int pdc_sata_init_one (struct pci return rc; rc = pci_request_regions(pdev, DRV_NAME); - if (rc) + if (rc) { + pci_dev_busy = 1; goto err_out; + } rc = pci_set_dma_mask(pdev, ATA_DMA_MASK); if (rc) @@ -1471,7 +1474,8 @@ err_out_free_ent: err_out_regions: pci_release_regions(pdev); err_out: - pci_disable_device(pdev); + if (!pci_dev_busy) + pci_disable_device(pdev); return rc; } diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.10-ck6/drivers/scsi/sata_uli.c linux-2.6.10-ck7/drivers/scsi/sata_uli.c --- linux-2.6.10-ck6/drivers/scsi/sata_uli.c 2004-12-25 10:14:49.000000000 +1100 +++ linux-2.6.10-ck7/drivers/scsi/sata_uli.c 2005-03-01 22:34:38.000000000 +1100 @@ -200,14 +200,17 @@ static int uli_init_one (struct pci_dev struct ata_port_info *ppi; int rc; unsigned int board_idx = (unsigned int) ent->driver_data; + int pci_dev_busy = 0; rc = pci_enable_device(pdev); if (rc) return rc; rc = pci_request_regions(pdev, DRV_NAME); - if (rc) + if (rc) { + pci_dev_busy = 1; goto err_out; + } rc = pci_set_dma_mask(pdev, ATA_DMA_MASK); if (rc) @@ -265,7 +268,8 @@ err_out_regions: pci_release_regions(pdev); err_out: - pci_disable_device(pdev); + if (!pci_dev_busy) + pci_disable_device(pdev); return rc; } diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.10-ck6/drivers/scsi/sata_via.c linux-2.6.10-ck7/drivers/scsi/sata_via.c --- linux-2.6.10-ck6/drivers/scsi/sata_via.c 2004-12-25 10:14:49.000000000 +1100 +++ linux-2.6.10-ck7/drivers/scsi/sata_via.c 2005-03-01 22:34:38.000000000 +1100 @@ -170,6 +170,7 @@ static int svia_init_one (struct pci_dev int rc; struct ata_port_info *ppi; struct ata_probe_ent *probe_ent; + int pci_dev_busy = 0; u8 tmp8; if (!printed_version++) @@ -180,8 +181,10 @@ static int svia_init_one (struct pci_dev return rc; rc = pci_request_regions(pdev, DRV_NAME); - if (rc) + if (rc) { + pci_dev_busy = 1; goto err_out; + } pci_read_config_byte(pdev, SATA_PATA_SHARING, &tmp8); if (tmp8 & SATA_2DEV) { @@ -266,7 +269,8 @@ static int svia_init_one (struct pci_dev err_out_regions: pci_release_regions(pdev); err_out: - pci_disable_device(pdev); + if (!pci_dev_busy) + pci_disable_device(pdev); return rc; } diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.10-ck6/drivers/scsi/sata_vsc.c linux-2.6.10-ck7/drivers/scsi/sata_vsc.c --- linux-2.6.10-ck6/drivers/scsi/sata_vsc.c 2004-12-25 10:14:49.000000000 +1100 +++ linux-2.6.10-ck7/drivers/scsi/sata_vsc.c 2005-03-01 22:34:38.000000000 +1100 @@ -255,6 +255,7 @@ static int __devinit vsc_sata_init_one ( static int printed_version; struct ata_probe_ent *probe_ent = NULL; unsigned long base; + int pci_dev_busy = 0; void *mmio_base; int rc; @@ -274,8 +275,10 @@ static int __devinit vsc_sata_init_one ( } rc = pci_request_regions(pdev, DRV_NAME); - if (rc) + if (rc) { + pci_dev_busy = 1; goto err_out; + } /* * Use 32 bit DMA mask, because 64 bit address support is poor. @@ -352,7 +355,8 @@ err_out_free_ent: err_out_regions: pci_release_regions(pdev); err_out: - pci_disable_device(pdev); + if (!pci_dev_busy) + pci_disable_device(pdev); return rc; } diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.10-ck6/drivers/usb/serial/ftdi_sio.c linux-2.6.10-ck7/drivers/usb/serial/ftdi_sio.c --- linux-2.6.10-ck6/drivers/usb/serial/ftdi_sio.c 2005-03-01 22:34:29.000000000 +1100 +++ linux-2.6.10-ck7/drivers/usb/serial/ftdi_sio.c 2005-03-01 22:34:38.000000000 +1100 @@ -1137,7 +1137,7 @@ static int set_serial_info(struct usb_se goto check_and_exit; } - if ((new_serial.baud_base != priv->baud_base) || + if ((new_serial.baud_base != priv->baud_base) && (new_serial.baud_base < 9600)) return -EINVAL; diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.10-ck6/drivers/video/cg3.c linux-2.6.10-ck7/drivers/video/cg3.c --- linux-2.6.10-ck6/drivers/video/cg3.c 2004-12-25 10:14:50.000000000 +1100 +++ linux-2.6.10-ck7/drivers/video/cg3.c 2005-03-01 22:34:38.000000000 +1100 @@ -209,7 +209,7 @@ cg3_blank(int blank, struct fb_info *inf case FB_BLANK_HSYNC_SUSPEND: /* VESA blank (hsync off) */ case FB_BLANK_POWERDOWN: /* Poweroff */ val = sbus_readb(®s->control); - val |= CG3_CR_ENABLE_VIDEO; + val &= ~CG3_CR_ENABLE_VIDEO; sbus_writeb(val, ®s->control); par->flags |= CG3_FLAG_BLANKED; break; diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.10-ck6/include/asm-ia64/unistd.h linux-2.6.10-ck7/include/asm-ia64/unistd.h --- linux-2.6.10-ck6/include/asm-ia64/unistd.h 2004-12-25 10:14:51.000000000 +1100 +++ linux-2.6.10-ck7/include/asm-ia64/unistd.h 2005-03-01 22:34:38.000000000 +1100 @@ -373,7 +373,7 @@ asmlinkage unsigned long sys_mmap2( int fd, long pgoff); struct pt_regs; struct sigaction; -asmlinkage long sys_execve(char __user *filename, char __user * __user *argv, +long sys_execve(char __user *filename, char __user * __user *argv, char __user * __user *envp, struct pt_regs *regs); asmlinkage long sys_pipe(long arg0, long arg1, long arg2, long arg3, long arg4, long arg5, long arg6, long arg7, long stack); diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.10-ck6/include/asm-sparc/floppy.h linux-2.6.10-ck7/include/asm-sparc/floppy.h --- linux-2.6.10-ck6/include/asm-sparc/floppy.h 2004-03-11 21:29:30.000000000 +1100 +++ linux-2.6.10-ck7/include/asm-sparc/floppy.h 2005-03-01 22:34:38.000000000 +1100 @@ -312,8 +312,8 @@ static int sun_floppy_init(void) } /* The sun4m lets us know if the controller is actually usable. */ - if(sparc_cpu_model == sun4m) { - prom_getproperty(fd_node, "status", state, sizeof(state)); + if(sparc_cpu_model == sun4m && + prom_getproperty(fd_node, "status", state, sizeof(state)) != -1) { if(!strcmp(state, "disabled")) { goto no_sun_fdc; } diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.10-ck6/include/asm-sparc/oplib.h linux-2.6.10-ck7/include/asm-sparc/oplib.h --- linux-2.6.10-ck6/include/asm-sparc/oplib.h 2004-05-23 12:54:36.000000000 +1000 +++ linux-2.6.10-ck7/include/asm-sparc/oplib.h 2005-03-01 22:34:38.000000000 +1100 @@ -10,6 +10,7 @@ #include #include +#include /* The master romvec pointer... */ extern struct linux_romvec *romvec; @@ -244,8 +245,8 @@ extern int prom_getproplen(int thisnode, /* Fetch the requested property using the given buffer. Returns * the number of bytes the prom put into your buffer or -1 on error. */ -extern int prom_getproperty(int thisnode, char *property, - char *prop_buffer, int propbuf_size); +extern int __must_check prom_getproperty(int thisnode, char *property, + char *prop_buffer, int propbuf_size); /* Acquire an integer property. */ extern int prom_getint(int node, char *property); diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.10-ck6/include/asm-x86_64/mmu_context.h linux-2.6.10-ck7/include/asm-x86_64/mmu_context.h --- linux-2.6.10-ck6/include/asm-x86_64/mmu_context.h 2005-03-01 22:34:29.000000000 +1100 +++ linux-2.6.10-ck7/include/asm-x86_64/mmu_context.h 2004-03-11 21:29:28.000000000 +1100 @@ -54,10 +54,9 @@ static inline void switch_mm(struct mm_s out_of_line_bug(); if(!test_and_set_bit(cpu, &next->cpu_vm_mask)) { /* We were in lazy tlb mode and leave_mm disabled - * tlb flush IPI delivery. We must reload CR3 - * to make sure to use no freed page tables. + * tlb flush IPI delivery. We must flush our tlb. */ - asm volatile("movq %0,%%cr3" :: "r" (__pa(next->pgd)) : "memory"); + local_flush_tlb(); load_LDT_nolock(&next->context, cpu); } } diff -Naurp --exclude-from=/home/con/kernel/dontdiff linux-2.6.10-ck6/Makefile linux-2.6.10-ck7/Makefile --- linux-2.6.10-ck6/Makefile 2005-03-01 22:34:29.000000000 +1100 +++ linux-2.6.10-ck7/Makefile 2005-03-01 22:34:38.000000000 +1100 @@ -1,8 +1,8 @@ VERSION = 2 PATCHLEVEL = 6 SUBLEVEL = 10 -EXTRAVERSION = -ck6 -NAME=Excuse Me Mr. +EXTRAVERSION = -ck7 +NAME=Bulls On Parade # *DOCUMENTATION* # To see a list of typical targets execute "make help"