## Automatically generated incremental diff ## From: linux-2.6.4-rc3 ## To: linux-2.6.4 ## Robot: $Id: make-incremental-diff,v 1.12 2004/01/06 07:19:36 hpa Exp $ diff -urN linux-2.6.4-rc3/Makefile linux-2.6.4/Makefile --- linux-2.6.4-rc3/Makefile 2004-03-10 19:31:06.000000000 -0800 +++ linux-2.6.4/Makefile 2004-03-10 19:31:18.000000000 -0800 @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 6 SUBLEVEL = 4 -EXTRAVERSION =-rc3 +EXTRAVERSION = NAME=Feisty Dunnart # *DOCUMENTATION* diff -urN linux-2.6.4-rc3/arch/alpha/boot/misc.c linux-2.6.4/arch/alpha/boot/misc.c --- linux-2.6.4-rc3/arch/alpha/boot/misc.c 2004-02-17 19:57:30.000000000 -0800 +++ linux-2.6.4/arch/alpha/boot/misc.c 2004-03-10 19:31:19.000000000 -0800 @@ -205,3 +205,15 @@ /* puts(" done, booting the kernel.\n"); */ return output_ptr; } + +/* dummy-up printk */ +asmlinkage int printk(const char *fmt, ...) +{ + va_list args; + long ret; + + va_start(args, fmt); + ret = srm_printk(fmt, args); + va_end(args); + return ret; +} diff -urN linux-2.6.4-rc3/arch/alpha/kernel/osf_sys.c linux-2.6.4/arch/alpha/kernel/osf_sys.c --- linux-2.6.4-rc3/arch/alpha/kernel/osf_sys.c 2004-03-10 19:31:06.000000000 -0800 +++ linux-2.6.4/arch/alpha/kernel/osf_sys.c 2004-03-10 19:31:19.000000000 -0800 @@ -131,7 +131,7 @@ if (copy_to_user(dirent->d_name, name, namlen) || put_user(0, dirent->d_name + namlen)) return -EFAULT; - ((char *) dirent) += reclen; + dirent = (void *)dirent + reclen; buf->dirent = dirent; buf->count -= reclen; return 0; diff -urN linux-2.6.4-rc3/arch/alpha/kernel/pci_iommu.c linux-2.6.4/arch/alpha/kernel/pci_iommu.c --- linux-2.6.4-rc3/arch/alpha/kernel/pci_iommu.c 2004-02-17 19:59:45.000000000 -0800 +++ linux-2.6.4/arch/alpha/kernel/pci_iommu.c 2004-03-10 19:31:19.000000000 -0800 @@ -500,7 +500,7 @@ /* Given a scatterlist leader, choose an allocation method and fill in the blanks. */ -static inline int +static int sg_fill(struct scatterlist *leader, struct scatterlist *end, struct scatterlist *out, struct pci_iommu_arena *arena, dma_addr_t max_dma, int dac_allowed) diff -urN linux-2.6.4-rc3/arch/alpha/kernel/proto.h linux-2.6.4/arch/alpha/kernel/proto.h --- linux-2.6.4-rc3/arch/alpha/kernel/proto.h 2004-02-17 19:57:19.000000000 -0800 +++ linux-2.6.4/arch/alpha/kernel/proto.h 2004-03-10 19:31:19.000000000 -0800 @@ -203,9 +203,9 @@ unsigned char extra; } __mcheck_info; -#define mcheck_expected(cpu) ((void)(cpu), __mcheck_info.expected) -#define mcheck_taken(cpu) ((void)(cpu), __mcheck_info.taken) -#define mcheck_extra(cpu) ((void)(cpu), __mcheck_info.extra) +#define mcheck_expected(cpu) (*((void)(cpu), &__mcheck_info.expected)) +#define mcheck_taken(cpu) (*((void)(cpu), &__mcheck_info.taken)) +#define mcheck_extra(cpu) (*((void)(cpu), &__mcheck_info.extra)) #endif extern void process_mcheck_info(unsigned long vector, unsigned long la_ptr, diff -urN linux-2.6.4-rc3/arch/alpha/kernel/systbls.S linux-2.6.4/arch/alpha/kernel/systbls.S --- linux-2.6.4-rc3/arch/alpha/kernel/systbls.S 2004-02-17 19:58:33.000000000 -0800 +++ linux-2.6.4/arch/alpha/kernel/systbls.S 2004-03-10 19:31:19.000000000 -0800 @@ -444,6 +444,9 @@ .quad sys_clock_nanosleep .quad sys_semtimedop .quad sys_tgkill + .quad sys_stat64 /* 425 */ + .quad sys_lstat64 + .quad sys_fstat64 .size sys_call_table, . - sys_call_table .type sys_call_table, @object diff -urN linux-2.6.4-rc3/arch/alpha/lib/io.c linux-2.6.4/arch/alpha/lib/io.c --- linux-2.6.4-rc3/arch/alpha/lib/io.c 2004-02-17 19:59:06.000000000 -0800 +++ linux-2.6.4/arch/alpha/lib/io.c 2004-03-10 19:31:19.000000000 -0800 @@ -143,7 +143,7 @@ return; count--; *(unsigned char *) dst = inb(port); - ((unsigned char *) dst)++; + dst += 1; } while (count >= 4) { @@ -154,13 +154,13 @@ w |= inb(port) << 16; w |= inb(port) << 24; *(unsigned int *) dst = w; - ((unsigned int *) dst)++; + dst += 4; } while (count) { --count; *(unsigned char *) dst = inb(port); - ((unsigned char *) dst)++; + dst += 1; } } @@ -181,8 +181,8 @@ if (!count) return; count--; - *(unsigned short* ) dst = inw(port); - ((unsigned short *) dst)++; + *(unsigned short *) dst = inw(port); + dst += 2; } while (count >= 2) { @@ -191,7 +191,7 @@ w = inw(port); w |= inw(port) << 16; *(unsigned int *) dst = w; - ((unsigned int *) dst)++; + dst += 4; } if (count) { @@ -209,70 +209,72 @@ void insl (unsigned long port, void *dst, unsigned long count) { unsigned int l = 0, l2; - + if (!count) return; - + switch (((unsigned long) dst) & 0x3) { case 0x00: /* Buffer 32-bit aligned */ while (count--) { *(unsigned int *) dst = inl(port); - ((unsigned int *) dst)++; + dst += 4; } break; - + /* Assuming little endian Alphas in cases 0x01 -- 0x03 ... */ - + case 0x02: /* Buffer 16-bit aligned */ --count; - + l = inl(port); *(unsigned short *) dst = l; - ((unsigned short *) dst)++; - + dst += 2; + while (count--) { l2 = inl(port); *(unsigned int *) dst = l >> 16 | l2 << 16; - ((unsigned int *) dst)++; + dst += 4; l = l2; } *(unsigned short *) dst = l >> 16; break; + case 0x01: /* Buffer 8-bit aligned */ --count; - + l = inl(port); *(unsigned char *) dst = l; - ((unsigned char *) dst)++; + dst += 1; *(unsigned short *) dst = l >> 8; - ((unsigned short *) dst)++; + dst += 2; while (count--) { l2 = inl(port); *(unsigned int *) dst = l >> 24 | l2 << 8; - ((unsigned int *) dst)++; + dst += 4; l = l2; } *(unsigned char *) dst = l >> 24; break; + case 0x03: /* Buffer 8-bit aligned */ --count; - + l = inl(port); *(unsigned char *) dst = l; - ((unsigned char *) dst)++; + dst += 1; while (count--) { l2 = inl(port); *(unsigned int *) dst = l << 24 | l2 >> 8; - ((unsigned int *) dst)++; + dst += 4; l = l2; } *(unsigned short *) dst = l >> 8; - ((unsigned short *) dst)++; + dst += 2; *(unsigned char *) dst = l >> 24; break; } @@ -290,7 +292,7 @@ while (count) { count--; outb(*(char *)src, port); - ((char *) src)++; + src += 1; } } @@ -307,7 +309,7 @@ panic("outsw: memory not short aligned"); } outw(*(unsigned short*)src, port); - ((unsigned short *) src)++; + src += 2; --count; } @@ -315,7 +317,7 @@ unsigned int w; count -= 2; w = *(unsigned int *) src; - ((unsigned int *) src)++; + src += 4; outw(w >> 0, port); outw(w >> 16, port); } @@ -335,69 +337,69 @@ void outsl (unsigned long port, const void *src, unsigned long count) { unsigned int l = 0, l2; - + if (!count) return; - + switch (((unsigned long) src) & 0x3) { case 0x00: /* Buffer 32-bit aligned */ while (count--) { outl(*(unsigned int *) src, port); - ((unsigned int *) src)++; + src += 4; } break; - - /* Assuming little endian Alphas in cases 0x01 -- 0x03 ... */ - + case 0x02: /* Buffer 16-bit aligned */ --count; - + l = *(unsigned short *) src << 16; - ((unsigned short *) src)++; - + src += 2; + while (count--) { l2 = *(unsigned int *) src; - ((unsigned int *) src)++; + src += 4; outl (l >> 16 | l2 << 16, port); l = l2; } l2 = *(unsigned short *) src; outl (l >> 16 | l2 << 16, port); break; + case 0x01: /* Buffer 8-bit aligned */ --count; - + l = *(unsigned char *) src << 8; - ((unsigned char *) src)++; + src += 1; l |= *(unsigned short *) src << 16; - ((unsigned short *) src)++; + src += 2; while (count--) { l2 = *(unsigned int *) src; - ((unsigned int *) src)++; + src += 4; outl (l >> 8 | l2 << 24, port); l = l2; } l2 = *(unsigned char *) src; outl (l >> 8 | l2 << 24, port); break; + case 0x03: /* Buffer 8-bit aligned */ --count; - + l = *(unsigned char *) src << 24; - ((unsigned char *) src)++; + src += 1; while (count--) { l2 = *(unsigned int *) src; - ((unsigned int *) src)++; + src += 4; outl (l >> 24 | l2 << 8, port); l = l2; } l2 = *(unsigned short *) src; - ((unsigned short *) src)++; + src += 2; l2 |= *(unsigned char *) src << 16; outl (l >> 24 | l2 << 8, port); break; @@ -435,7 +437,7 @@ } while (count >= 0); count += 4; } - + if (count >= 2 && ((unsigned long)to & 1) == (from & 1)) { count -= 2; do { @@ -486,7 +488,7 @@ } while (count >= 0); count += 4; } - + if (count >= 2 && (to & 1) == ((unsigned long)from & 1)) { count -= 2; do { diff -urN linux-2.6.4-rc3/arch/i386/kernel/io_apic.c linux-2.6.4/arch/i386/kernel/io_apic.c --- linux-2.6.4-rc3/arch/i386/kernel/io_apic.c 2004-03-10 19:31:06.000000000 -0800 +++ linux-2.6.4/arch/i386/kernel/io_apic.c 2004-03-10 19:31:20.000000000 -0800 @@ -2152,10 +2152,6 @@ { int pin1, pin2; int vector; - unsigned int ver; - - ver = apic_read(APIC_LVR); - ver = GET_APIC_VERSION(ver); /* * get/set the timer IRQ vector: @@ -2169,17 +2165,11 @@ * mode for the 8259A whenever interrupts are routed * through I/O APICs. Also IRQ0 has to be enabled in * the 8259A which implies the virtual wire has to be - * disabled in the local APIC. Finally timer interrupts - * need to be acknowledged manually in the 8259A for - * do_slow_timeoffset() and for the i82489DX when using - * the NMI watchdog. + * disabled in the local APIC. */ apic_write_around(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT); init_8259A(1); - if (nmi_watchdog == NMI_IO_APIC && !APIC_INTEGRATED(ver)) - timer_ack = 1; - else - timer_ack = !cpu_has_tsc; + timer_ack = 1; enable_8259A_irq(0); pin1 = find_isa_irq_pin(0, mp_INT); @@ -2197,8 +2187,7 @@ disable_8259A_irq(0); setup_nmi(); enable_8259A_irq(0); - if (check_nmi_watchdog() < 0); - timer_ack = !cpu_has_tsc; + check_nmi_watchdog(); } return; } @@ -2221,8 +2210,7 @@ add_pin_to_irq(0, 0, pin2); if (nmi_watchdog == NMI_IO_APIC) { setup_nmi(); - if (check_nmi_watchdog() < 0); - timer_ack = !cpu_has_tsc; + check_nmi_watchdog(); } return; } diff -urN linux-2.6.4-rc3/arch/ppc64/kernel/entry.S linux-2.6.4/arch/ppc64/kernel/entry.S --- linux-2.6.4-rc3/arch/ppc64/kernel/entry.S 2004-02-17 19:57:12.000000000 -0800 +++ linux-2.6.4/arch/ppc64/kernel/entry.S 2004-03-10 19:31:25.000000000 -0800 @@ -570,11 +570,10 @@ * of all registers that it saves. We therefore save those registers * PROM might touch to the stack. (r0, r3-r13 are caller saved) */ - SAVE_8GPRS(2, r1) /* Save the TOC & incoming param(s) */ - SAVE_GPR(13, r1) /* Save paca */ - SAVE_8GPRS(14, r1) /* Save the non-volatiles */ - SAVE_10GPRS(22, r1) /* ditto */ - + SAVE_8GPRS(2, r1) + SAVE_GPR(13, r1) + SAVE_8GPRS(14, r1) + SAVE_10GPRS(22, r1) mfcr r4 std r4,_CCR(r1) mfctr r5 @@ -592,20 +591,16 @@ mfmsr r11 std r11,_MSR(r1) - /* Unfortunatly, the stack pointer is also clobbered, so it is saved - * in the SPRG2 which allows us to restore our original state after - * PROM returns. - */ - mtspr SPRG2,r1 - - /* put a relocation offset into r3 */ + /* Get the PROM entrypoint */ bl .reloc_offset LOADADDR(r12,prom) sub r12,r12,r3 - ld r12,PROMENTRY(r12) /* get the prom->entry value */ + ld r12,PROMENTRY(r12) mtlr r12 - mfmsr r11 /* grab the current MSR */ + /* Switch MSR to 32 bits mode + */ + mfmsr r11 li r12,1 rldicr r12,r12,MSR_SF_LG,(63-MSR_SF_LG) andc r11,r11,r12 @@ -615,22 +610,25 @@ mtmsrd r11 isync - REST_8GPRS(2, r1) /* Restore the TOC & param(s) */ - REST_GPR(13, r1) /* Restore paca */ - REST_8GPRS(14, r1) /* Restore the non-volatiles */ - REST_10GPRS(22, r1) /* ditto */ - blrl /* Entering PROM here... */ - - mfspr r1,SPRG2 /* Restore the stack pointer */ - ld r6,_MSR(r1) /* Restore the MSR */ - mtmsrd r6 + /* Restore arguments & enter PROM here... */ + ld r3,GPR3(r1) + blrl + + /* Just make sure that r1 top 32 bits didn't get + * corrupt by OF + */ + rldicl r1,r1,0,32 + + /* Restore the MSR (back to 64 bits) */ + ld r0,_MSR(r1) + mtmsrd r0 isync - REST_GPR(2, r1) /* Restore the TOC */ - REST_GPR(13, r1) /* Restore paca */ - REST_8GPRS(14, r1) /* Restore the non-volatiles */ - REST_10GPRS(22, r1) /* ditto */ - + /* Restore other registers */ + REST_GPR(2, r1) + REST_GPR(13, r1) + REST_8GPRS(14, r1) + REST_10GPRS(22, r1) ld r4,_CCR(r1) mtcr r4 ld r5,_CTR(r1) @@ -645,9 +643,10 @@ mtsrr0 r9 ld r10,_SRR1(r1) mtsrr1 r10 + addi r1,r1,PROM_FRAME_SIZE - ld r0,16(r1) /* get return address */ - + ld r0,16(r1) mtlr r0 - blr /* return to caller */ + blr + #endif /* defined(CONFIG_PPC_PSERIES) */ diff -urN linux-2.6.4-rc3/arch/ppc64/kernel/head.S linux-2.6.4/arch/ppc64/kernel/head.S --- linux-2.6.4-rc3/arch/ppc64/kernel/head.S 2004-03-10 19:31:07.000000000 -0800 +++ linux-2.6.4/arch/ppc64/kernel/head.S 2004-03-10 19:31:25.000000000 -0800 @@ -904,12 +904,13 @@ /* (((ea >> 28) & 0x1fff) << 15) | (ea >> 60) */ mfspr r21,DAR - rldicl r20,r21,36,32 /* Permits a full 32b of ESID */ - rldicr r20,r20,15,48 - rldicl r21,r21,4,60 - or r20,r20,r21 + rldicl r20,r21,36,51 + sldi r20,r20,15 + srdi r21,r21,60 + or r20,r20,r21 - li r21,9 /* VSID_RANDOMIZER */ + /* VSID_RANDOMIZER */ + li r21,9 sldi r21,r21,32 oris r21,r21,58231 ori r21,r21,39831 @@ -933,11 +934,11 @@ rldicl r23,r23,57,63 cmpwi r23,0 bne 2f - ld r23,8(r21) /* Get the current vsid part of the ste */ + li r23,0 rldimi r23,r20,12,0 /* Insert the new vsid value */ std r23,8(r21) /* Put new entry back into the stab */ eieio /* Order vsid update */ - ld r23,0(r21) /* Get the esid part of the ste */ + li r23,0 mfspr r20,DAR /* Get the new esid */ rldicl r20,r20,36,28 /* Permits a full 36b of ESID */ rldimi r23,r20,28,0 /* Insert the new esid value */ @@ -971,13 +972,13 @@ std r23,0(r21) sync - ld r23,8(r21) + li r23,0 rldimi r23,r20,12,0 std r23,8(r21) eieio - ld r23,0(r21) /* Get the esid part of the ste */ - mr r22,r23 + ld r22,0(r21) /* Get the esid part of the ste */ + li r23,0 mfspr r20,DAR /* Get the new esid */ rldicl r20,r20,36,28 /* Permits a full 32b of ESID */ rldimi r23,r20,28,0 /* Insert the new esid value */ diff -urN linux-2.6.4-rc3/arch/ppc64/kernel/pmac_feature.c linux-2.6.4/arch/ppc64/kernel/pmac_feature.c --- linux-2.6.4-rc3/arch/ppc64/kernel/pmac_feature.c 2004-02-17 19:58:49.000000000 -0800 +++ linux-2.6.4/arch/ppc64/kernel/pmac_feature.c 2004-03-10 19:31:25.000000000 -0800 @@ -221,7 +221,7 @@ mb(); k2_skiplist[1] = NULL; } else { - k2_skiplist[0] = pdev; + k2_skiplist[1] = pdev; mb(); MACIO_BIC(KEYLARGO_FCR1, K2_FCR1_FW_CLK_ENABLE); } diff -urN linux-2.6.4-rc3/arch/ppc64/kernel/pmac_pci.c linux-2.6.4/arch/ppc64/kernel/pmac_pci.c --- linux-2.6.4-rc3/arch/ppc64/kernel/pmac_pci.c 2004-03-10 19:31:07.000000000 -0800 +++ linux-2.6.4/arch/ppc64/kernel/pmac_pci.c 2004-03-10 19:31:25.000000000 -0800 @@ -152,7 +152,6 @@ struct pci_controller *hose; struct device_node *busdn; unsigned long addr; - int i; if (bus->self) busdn = pci_device_to_OF_node(bus->self); @@ -164,24 +163,6 @@ if (hose == NULL) return PCIBIOS_DEVICE_NOT_FOUND; - /* - * When a device in K2 is powered down, we die on config - * cycle accesses. Fix that here. - */ - for (i=0; i<2; i++) - if (k2_skiplist[i] && k2_skiplist[i]->bus == bus && - k2_skiplist[i]->devfn == devfn) { - switch (len) { - case 1: - *val = 0xff; break; - case 2: - *val = 0xffff; break; - default: - *val = 0xfffffffful; break; - } - return PCIBIOS_SUCCESSFUL; - } - addr = macrisc_cfg_access(hose, bus->number, devfn, offset); if (!addr) return PCIBIOS_DEVICE_NOT_FOUND; @@ -209,7 +190,6 @@ struct pci_controller *hose; struct device_node *busdn; unsigned long addr; - int i; if (bus->self) busdn = pci_device_to_OF_node(bus->self); @@ -221,15 +201,6 @@ if (hose == NULL) return PCIBIOS_DEVICE_NOT_FOUND; - /* - * When a device in K2 is powered down, we die on config - * cycle accesses. Fix that here. - */ - for (i=0; i<2; i++) - if (k2_skiplist[i] && k2_skiplist[i]->bus == bus && - k2_skiplist[i]->devfn == devfn) - return PCIBIOS_SUCCESSFUL; - addr = macrisc_cfg_access(hose, bus->number, devfn, offset); if (!addr) return PCIBIOS_DEVICE_NOT_FOUND; @@ -265,6 +236,17 @@ * implement self-view of the HT host yet */ +static int skip_k2_device(struct pci_bus *bus, unsigned int devfn) +{ + int i; + + for (i=0; i<2; i++) + if (k2_skiplist[i] && k2_skiplist[i]->bus == bus && + k2_skiplist[i]->devfn == devfn) + return 1; + return 0; +} + #define U3_HT_CFA0(devfn, off) \ ((((unsigned long)devfn) << 8) | offset) #define U3_HT_CFA1(bus, devfn, off) \ @@ -306,6 +288,24 @@ if (!addr) return PCIBIOS_DEVICE_NOT_FOUND; /* + * When a device in K2 is powered down, we die on config + * cycle accesses. Fix that here. We may ultimately want + * to cache the config space for those instead of returning + * 0xffffffff's to make life easier to HW detection tools + */ + if (skip_k2_device(bus, devfn)) { + switch (len) { + case 1: + *val = 0xff; break; + case 2: + *val = 0xffff; break; + default: + *val = 0xfffffffful; break; + } + return PCIBIOS_SUCCESSFUL; + } + + /* * Note: the caller has already checked that offset is * suitably aligned and that len is 1, 2 or 4. */ @@ -344,6 +344,13 @@ if (!addr) return PCIBIOS_DEVICE_NOT_FOUND; /* + * When a device in K2 is powered down, we die on config + * cycle accesses. Fix that here. + */ + if (skip_k2_device(bus, devfn)) + return PCIBIOS_SUCCESSFUL; + + /* * Note: the caller has already checked that offset is * suitably aligned and that len is 1, 2 or 4. */ @@ -719,6 +726,17 @@ /* Setup the linkage between OF nodes and PHBs */ pci_devs_phb_init(); + /* Fixup the PCI<->OF mapping for U3 AGP due to bus renumbering. We + * assume there is no P2P bridge on the AGP bus, which should be a + * safe assumptions hopefully. + */ + if (u3_agp) { + struct device_node *np = u3_agp->arch_data; + np->busno = 0xf0; + for (np = np->child; np; np = np->sibling) + np->busno = 0xf0; + } + pmac_check_ht_link(); /* Tell pci.c to use the common resource allocation mecanism */ diff -urN linux-2.6.4-rc3/arch/ppc64/kernel/prom.c linux-2.6.4/arch/ppc64/kernel/prom.c --- linux-2.6.4-rc3/arch/ppc64/kernel/prom.c 2004-03-10 19:31:07.000000000 -0800 +++ linux-2.6.4/arch/ppc64/kernel/prom.c 2004-03-10 19:31:25.000000000 -0800 @@ -130,6 +130,7 @@ struct prom_t prom; char *prom_display_paths[FB_MAX] __initdata = { 0, }; +phandle prom_display_nodes[FB_MAX] __initdata; unsigned int prom_num_displays = 0; char *of_stdout_device = 0; @@ -177,7 +178,7 @@ extern unsigned long reloc_offset(void); -extern void enter_prom(void *dummy,...); +extern void enter_prom(struct prom_args *args); extern void copy_and_flush(unsigned long dest, unsigned long src, unsigned long size, unsigned long offset); @@ -1500,13 +1501,12 @@ /* Default machine type. */ _systemcfg->platform = prom_find_machine_type(); - /* On pSeries, copy the CPU hold code */ if (_systemcfg->platform == PLATFORM_PSERIES) copy_and_flush(0, KERNELBASE - offset, 0x100, 0); /* Start storing things at klimit */ - mem = RELOC(klimit) - offset; + mem = RELOC(klimit) - offset; /* Get the full OF pathname of the stdout device */ p = (char *) mem; @@ -1646,10 +1646,10 @@ { phandle node; ihandle ih; - int i; + int i, j; unsigned long offset = reloc_offset(); struct prom_t *_prom = PTRRELOC(&prom); - char type[64], *path; + char type[16], *path; static unsigned char default_colors[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0xaa, @@ -1672,6 +1672,12 @@ _prom->disp_node = 0; + prom_print(RELOC("Looking for displays\n")); + if (RELOC(of_stdout_device) != 0) { + prom_print(RELOC("OF stdout is : ")); + prom_print(PTRRELOC(RELOC(of_stdout_device))); + prom_print(RELOC("\n")); + } for (node = 0; prom_next_node(&node); ) { type[0] = 0; call_prom(RELOC("getprop"), 4, 1, node, RELOC("device_type"), @@ -1682,19 +1688,48 @@ path = (char *) mem; memset(path, 0, 256); if ((long) call_prom(RELOC("package-to-path"), 3, 1, - node, path, 255) < 0) + node, path, 250) < 0) continue; - prom_print(RELOC("opening display ")); + prom_print(RELOC("found display : ")); + prom_print(path); + prom_print(RELOC("\n")); + + /* + * If this display is the device that OF is using for stdout, + * move it to the front of the list. + */ + mem += strlen(path) + 1; + i = RELOC(prom_num_displays); + RELOC(prom_num_displays) = i + 1; + if (RELOC(of_stdout_device) != 0 && i > 0 + && strcmp(PTRRELOC(RELOC(of_stdout_device)), path) == 0) { + for (; i > 0; --i) { + RELOC(prom_display_paths[i]) + = RELOC(prom_display_paths[i-1]); + RELOC(prom_display_nodes[i]) + = RELOC(prom_display_nodes[i-1]); + } + _prom->disp_node = (ihandle)(unsigned long)node; + } + RELOC(prom_display_paths[i]) = PTRUNRELOC(path); + RELOC(prom_display_nodes[i]) = node; + if (_prom->disp_node == 0) + _prom->disp_node = (ihandle)(unsigned long)node; + if (RELOC(prom_num_displays) >= FB_MAX) + break; + } + prom_print(RELOC("Opening displays...\n")); + for (j = RELOC(prom_num_displays) - 1; j >= 0; j--) { + path = PTRRELOC(RELOC(prom_display_paths[j])); + prom_print(RELOC("opening display : ")); prom_print(path); ih = (ihandle)call_prom(RELOC("open"), 1, 1, path); if (ih == (ihandle)0 || ih == (ihandle)-1) { prom_print(RELOC("... failed\n")); continue; } - prom_print(RELOC("... ok\n")); - if (_prom->disp_node == 0) - _prom->disp_node = (ihandle)(unsigned long)node; + prom_print(RELOC("... ok\n")); /* Setup a useable color table when the appropriate * method is available. Should update this to set-colors */ @@ -1711,26 +1746,8 @@ clut[2]) != 0) break; #endif /* CONFIG_LOGO_LINUX_CLUT224 */ - - /* - * If this display is the device that OF is using for stdout, - * move it to the front of the list. - */ - mem += strlen(path) + 1; - i = RELOC(prom_num_displays)++; - if (RELOC(of_stdout_device) != 0 && i > 0 - && strcmp(PTRRELOC(RELOC(of_stdout_device)), path) == 0) { - for (; i > 0; --i) - RELOC(prom_display_paths[i]) = RELOC(prom_display_paths[i-1]); - } - RELOC(prom_display_paths[i]) = PTRUNRELOC(path); - if (RELOC(prom_num_displays) >= FB_MAX) - break; - /* XXX Temporary workaround: only open the first display so we don't - * lose debug output - */ - break; } + return DOUBLEWORD_ALIGN(mem); } diff -urN linux-2.6.4-rc3/arch/ppc64/kernel/stab.c linux-2.6.4/arch/ppc64/kernel/stab.c --- linux-2.6.4-rc3/arch/ppc64/kernel/stab.c 2004-03-10 19:31:07.000000000 -0800 +++ linux-2.6.4/arch/ppc64/kernel/stab.c 2004-03-10 19:31:25.000000000 -0800 @@ -88,6 +88,8 @@ for (group = 0; group < 2; group++) { for (entry = 0; entry < 8; entry++, ste++) { if (!(ste->dw0.dw0.v)) { + ste->dw0.dword0 = 0; + ste->dw1.dword1 = 0; ste->dw1.dw1.vsid = vsid; ste->dw0.dw0.esid = esid; ste->dw0.dw0.kp = 1; @@ -135,6 +137,9 @@ castout_ste->dw0.dw0.v = 0; asm volatile("sync" : : : "memory"); /* Order update */ + + castout_ste->dw0.dword0 = 0; + castout_ste->dw1.dword1 = 0; castout_ste->dw1.dw1.vsid = vsid; old_esid = castout_ste->dw0.dw0.esid; castout_ste->dw0.dw0.esid = esid; diff -urN linux-2.6.4-rc3/drivers/block/ll_rw_blk.c linux-2.6.4/drivers/block/ll_rw_blk.c --- linux-2.6.4-rc3/drivers/block/ll_rw_blk.c 2004-03-10 19:31:08.000000000 -0800 +++ linux-2.6.4/drivers/block/ll_rw_blk.c 2004-03-10 19:31:27.000000000 -0800 @@ -2121,11 +2121,14 @@ goto again; } + req->flags |= REQ_CMD; + /* - * first three bits are identical in rq->flags and bio->bi_rw, - * see bio.h and blkdev.h + * inherit FAILFAST from bio and don't stack up + * retries for read ahead */ - req->flags = (bio->bi_rw & 7) | REQ_CMD; + if (ra || test_bit(BIO_RW_FAILFAST, &bio->bi_rw)) + req->flags |= REQ_FAILFAST; /* * REQ_BARRIER implies no merging, but lets make it explicit @@ -2133,12 +2136,6 @@ if (barrier) req->flags |= (REQ_HARDBARRIER | REQ_NOMERGE); - /* - * don't stack up retries for read ahead - */ - if (ra) - req->flags |= REQ_FAILFAST; - req->errors = 0; req->hard_sector = req->sector = sector; req->hard_nr_sectors = req->nr_sectors = nr_sectors; diff -urN linux-2.6.4-rc3/drivers/char/tty_io.c linux-2.6.4/drivers/char/tty_io.c --- linux-2.6.4-rc3/drivers/char/tty_io.c 2004-03-10 19:31:09.000000000 -0800 +++ linux-2.6.4/drivers/char/tty_io.c 2004-03-10 19:31:28.000000000 -0800 @@ -481,12 +481,15 @@ if (tty->session > 0) { struct list_head *l; for_each_task_pid(tty->session, PIDTYPE_SID, p, l, pid) { - if (p->tty == tty) - p->tty = NULL; - if (!p->leader) - continue; - send_group_sig_info(SIGHUP, SEND_SIG_PRIV, p); - send_group_sig_info(SIGCONT, SEND_SIG_PRIV, p); + task_t *task = p; + do { + if (task->tty == tty) + task->tty = NULL; + if (task->leader) { + send_group_sig_info(SIGHUP, SEND_SIG_PRIV, task); + send_group_sig_info(SIGCONT, SEND_SIG_PRIV, task); + } + } while_each_thread(p, task); if (tty->pgrp > 0) p->tty_old_pgrp = tty->pgrp; } @@ -591,8 +594,12 @@ tty->pgrp = -1; read_lock(&tasklist_lock); - for_each_task_pid(current->session, PIDTYPE_SID, p, l, pid) - p->tty = NULL; + for_each_task_pid(current->session, PIDTYPE_SID, p, l, pid) { + task_t *task = p; + do { + task->tty = NULL; + } while_each_thread(p, task); + } read_unlock(&tasklist_lock); unlock_kernel(); } @@ -1260,11 +1267,20 @@ struct pid *pid; read_lock(&tasklist_lock); - for_each_task_pid(tty->session, PIDTYPE_SID, p, l, pid) - p->tty = NULL; - if (o_tty) - for_each_task_pid(o_tty->session, PIDTYPE_SID, p,l, pid) - p->tty = NULL; + for_each_task_pid(tty->session, PIDTYPE_SID, p, l, pid) { + task_t *task = p; + do { + task->tty = NULL; + } while_each_thread(p, task); + } + if (o_tty) { + for_each_task_pid(o_tty->session, PIDTYPE_SID, p,l, pid) { + task_t *task = p; + do { + task->tty = NULL; + } while_each_thread(p, task); + } + } read_unlock(&tasklist_lock); } @@ -1615,8 +1631,12 @@ */ read_lock(&tasklist_lock); - for_each_task_pid(tty->session, PIDTYPE_SID, p, l, pid) - p->tty = NULL; + for_each_task_pid(tty->session, PIDTYPE_SID, p, l, pid) { + task_t *task = p; + do { + task->tty = NULL; + } while_each_thread(p, task); + } read_unlock(&tasklist_lock); } else return -EPERM; diff -urN linux-2.6.4-rc3/drivers/media/video/ir-kbd-gpio.c linux-2.6.4/drivers/media/video/ir-kbd-gpio.c --- linux-2.6.4-rc3/drivers/media/video/ir-kbd-gpio.c 2004-02-17 19:59:11.000000000 -0800 +++ linux-2.6.4/drivers/media/video/ir-kbd-gpio.c 2004-03-10 19:31:31.000000000 -0800 @@ -279,14 +279,18 @@ switch (sub->core->type) { case BTTV_AVERMEDIA: case BTTV_AVPHONE98: + case BTTV_AVERMEDIA98: ir_codes = ir_codes_avermedia; ir->mask_keycode = 0xf80000; ir->mask_keydown = 0x010000; break; - case BTTV_WINFAST2000: - ir_codes = winfast_codes; - ir->mask_keycode = 0x8f8; - break; + + case BTTV_PXELVWPLTVPAK: + ir_codes = ir_codes_pixelview; + ir->mask_keycode = 0x003e00; + ir->mask_keyup = 0x010000; + ir->polling = 50; // ms + break; case BTTV_PV_BT878P_9B: case BTTV_PV_BT878P_PLUS: ir_codes = ir_codes_pixelview; @@ -294,6 +298,17 @@ ir->mask_keyup = 0x008000; ir->polling = 50; // ms break; + + case BTTV_WINFAST2000: + ir_codes = winfast_codes; + ir->mask_keycode = 0x8f8; + break; + case BTTV_MAGICTVIEW061: + case BTTV_MAGICTVIEW063: + ir_codes = winfast_codes; + ir->mask_keycode = 0x0008e000; + ir->mask_keydown = 0x00200000; + break; } if (NULL == ir_codes) { kfree(ir); diff -urN linux-2.6.4-rc3/drivers/net/pcnet32.c linux-2.6.4/drivers/net/pcnet32.c --- linux-2.6.4-rc3/drivers/net/pcnet32.c 2004-03-10 19:31:10.000000000 -0800 +++ linux-2.6.4/drivers/net/pcnet32.c 2004-03-10 19:31:31.000000000 -0800 @@ -69,7 +69,7 @@ MODULE_DEVICE_TABLE (pci, pcnet32_pci_tbl); -int cards_found __initdata; +static int cards_found; /* * VLB I/O addresses diff -urN linux-2.6.4-rc3/drivers/usb/host/ohci-q.c linux-2.6.4/drivers/usb/host/ohci-q.c --- linux-2.6.4-rc3/drivers/usb/host/ohci-q.c 2004-03-10 19:31:12.000000000 -0800 +++ linux-2.6.4/drivers/usb/host/ohci-q.c 2004-03-10 19:31:35.000000000 -0800 @@ -187,6 +187,7 @@ switch (ed->type) { case PIPE_CONTROL: if (ohci->ed_controltail == NULL) { + WARN_ON (ohci->hc_control & OHCI_CTRL_CLE); writel (ed->dma, &ohci->regs->ed_controlhead); } else { ohci->ed_controltail->ed_next = ed; @@ -203,6 +204,7 @@ case PIPE_BULK: if (ohci->ed_bulktail == NULL) { + WARN_ON (ohci->hc_control & OHCI_CTRL_BLE); writel (ed->dma, &ohci->regs->ed_bulkhead); } else { ohci->ed_bulktail->ed_next = ed; @@ -271,27 +273,56 @@ * just the link to the ed is unlinked. * the link from the ed still points to another operational ed or 0 * so the HC can eventually finish the processing of the unlinked ed + * (assuming it already started that, which needn't be true). + * + * ED_UNLINK is a transient state: the HC may still see this ED, but soon + * it won't. ED_SKIP means the HC will finish its current transaction, + * but won't start anything new. The TD queue may still grow; device + * drivers don't know about this HCD-internal state. + * + * When the HC can't see the ED, something changes ED_UNLINK to one of: + * + * - ED_OPER: when there's any request queued, the ED gets rescheduled + * immediately. HC should be working on them. + * + * - ED_IDLE: when there's no TD queue. there's no reason for the HC + * to care about this ED; safe to disable the endpoint. + * + * When finish_unlinks() runs later, after SOF interrupt, it will often + * complete one or more URB unlinks before making that state change. */ static void ed_deschedule (struct ohci_hcd *ohci, struct ed *ed) { ed->hwINFO |= ED_SKIP; + wmb (); + ed->state = ED_UNLINK; + /* To deschedule something from the control or bulk list, just + * clear CLE/BLE and wait. There's no safe way to scrub out list + * head/current registers until later, and "later" isn't very + * tightly specified. Figure 6-5 and Section 6.4.2.2 show how + * the HC is reading the ED queues (while we modify them). + * + * For now, ed_schedule() is "later". It might be good paranoia + * to scrub those registers in finish_unlinks(), in case of bugs + * that make the HC try to use them. + */ switch (ed->type) { case PIPE_CONTROL: + /* remove ED from the HC's list: */ if (ed->ed_prev == NULL) { if (!ed->hwNextED) { ohci->hc_control &= ~OHCI_CTRL_CLE; writel (ohci->hc_control, &ohci->regs->control); - writel (0, &ohci->regs->ed_controlcurrent); - // post those pci writes - (void) readl (&ohci->regs->control); - } - writel (le32_to_cpup (&ed->hwNextED), - &ohci->regs->ed_controlhead); + // a readl() later syncs CLE with the HC + } else + writel (le32_to_cpup (&ed->hwNextED), + &ohci->regs->ed_controlhead); } else { ed->ed_prev->ed_next = ed->ed_next; ed->ed_prev->hwNextED = ed->hwNextED; } + /* remove ED from the HCD's list: */ if (ohci->ed_controltail == ed) { ohci->ed_controltail = ed->ed_prev; if (ohci->ed_controltail) @@ -302,20 +333,20 @@ break; case PIPE_BULK: + /* remove ED from the HC's list: */ if (ed->ed_prev == NULL) { if (!ed->hwNextED) { ohci->hc_control &= ~OHCI_CTRL_BLE; writel (ohci->hc_control, &ohci->regs->control); - writel (0, &ohci->regs->ed_bulkcurrent); - // post those pci writes - (void) readl (&ohci->regs->control); - } - writel (le32_to_cpup (&ed->hwNextED), - &ohci->regs->ed_bulkhead); + // a readl() later syncs BLE with the HC + } else + writel (le32_to_cpup (&ed->hwNextED), + &ohci->regs->ed_bulkhead); } else { ed->ed_prev->ed_next = ed->ed_next; ed->ed_prev->hwNextED = ed->hwNextED; } + /* remove ED from the HCD's list: */ if (ohci->ed_bulktail == ed) { ohci->ed_bulktail = ed->ed_prev; if (ohci->ed_bulktail) @@ -426,13 +457,25 @@ /* request unlinking of an endpoint from an operational HC. * put the ep on the rm_list * real work is done at the next start frame (SF) hardware interrupt + * caller guarantees HCD is running, so hardware access is safe, + * and that ed->state is ED_OPER */ static void start_ed_unlink (struct ohci_hcd *ohci, struct ed *ed) { ed->hwINFO |= ED_DEQUEUE; - ed->state = ED_UNLINK; ed_deschedule (ohci, ed); + /* rm_list is just singly linked, for simplicity */ + ed->ed_next = ohci->ed_rm_list; + ed->ed_prev = 0; + ohci->ed_rm_list = ed; + + /* enable SOF interrupt */ + writel (OHCI_INTR_SF, &ohci->regs->intrstatus); + writel (OHCI_INTR_SF, &ohci->regs->intrenable); + // flush those writes, and get latest HCCA contents + (void) readl (&ohci->regs->control); + /* SF interrupt might get delayed; record the frame counter value that * indicates when the HC isn't looking at it, so concurrent unlinks * behave. frame_no wraps every 2^16 msec, and changes right before @@ -440,18 +483,6 @@ */ ed->tick = OHCI_FRAME_NO(ohci->hcca) + 1; - /* rm_list is just singly linked, for simplicity */ - ed->ed_next = ohci->ed_rm_list; - ed->ed_prev = 0; - ohci->ed_rm_list = ed; - - /* enable SOF interrupt */ - if (HCD_IS_RUNNING (ohci->hcd.state)) { - writel (OHCI_INTR_SF, &ohci->regs->intrstatus); - writel (OHCI_INTR_SF, &ohci->regs->intrenable); - // flush those pci writes - (void) readl (&ohci->regs->control); - } } /*-------------------------------------------------------------------------* @@ -794,8 +825,6 @@ next->next_dl_td = rev; rev = next; - if (ed->hwTailP == cpu_to_le32 (next->td_dma)) - ed->hwTailP = next->hwNextTD; ed->hwHeadP = next->hwNextTD | toggle; } @@ -922,6 +951,10 @@ /* unlink urbs as requested, but rescan the list after * we call a completion since it might have unlinked * another (earlier) urb + * + * When we get here, the HC doesn't see this ed. But it + * must not be rescheduled until all completed URBs have + * been given back to the driver. */ rescan_this: completed = 0; @@ -941,12 +974,7 @@ continue; } - /* patch pointers hc uses ... tail, if we're removing - * an otherwise active td, and whatever td pointer - * points to this td - */ - if (ed->hwTailP == cpu_to_le32 (td->td_dma)) - ed->hwTailP = td->hwNextTD; + /* patch pointer hc uses */ savebits = *prev & ~cpu_to_le32 (TD_MASK); *prev = td->hwNextTD | savebits; @@ -965,9 +993,10 @@ /* ED's now officially unlinked, hc doesn't see */ ed->state = ED_IDLE; - ed->hwINFO &= ~(ED_SKIP | ED_DEQUEUE); ed->hwHeadP &= ~ED_H; ed->hwNextED = 0; + wmb (); + ed->hwINFO &= ~(ED_SKIP | ED_DEQUEUE); /* but if there's work queued, reschedule */ if (!list_empty (&ed->td_list)) { @@ -1040,7 +1069,7 @@ finish_urb (ohci, urb, regs); /* clean schedule: unlink EDs that are no longer busy */ - if (list_empty (&ed->td_list)) + if (list_empty (&ed->td_list) && ed->state == ED_OPER) start_ed_unlink (ohci, ed); /* ... reenabling halted EDs only after fault cleanup */ else if ((ed->hwINFO & (ED_SKIP | ED_DEQUEUE)) == ED_SKIP) { diff -urN linux-2.6.4-rc3/fs/ncpfs/sock.c linux-2.6.4/fs/ncpfs/sock.c --- linux-2.6.4-rc3/fs/ncpfs/sock.c 2004-02-17 19:57:26.000000000 -0800 +++ linux-2.6.4/fs/ncpfs/sock.c 2004-03-10 19:31:37.000000000 -0800 @@ -188,11 +188,14 @@ static int ncpdgram_send(struct socket *sock, struct ncp_request_reply *req) { struct msghdr msg; + struct iovec iov[3]; + /* sock_sendmsg updates iov pointers for us :-( */ + memcpy(iov, req->tx_ciov, req->tx_iovlen * sizeof(iov[0])); msg.msg_name = NULL; msg.msg_namelen = 0; msg.msg_control = NULL; - msg.msg_iov = req->tx_ciov; + msg.msg_iov = iov; msg.msg_iovlen = req->tx_iovlen; msg.msg_flags = MSG_DONTWAIT; return sock_sendmsg(sock, &msg, req->tx_totallen); diff -urN linux-2.6.4-rc3/fs/stat.c linux-2.6.4/fs/stat.c --- linux-2.6.4-rc3/fs/stat.c 2004-02-17 19:57:17.000000000 -0800 +++ linux-2.6.4/fs/stat.c 2004-03-10 19:31:37.000000000 -0800 @@ -283,7 +283,7 @@ /* ---------- LFS-64 ----------- */ -#if !defined(__alpha__) && !defined(__ia64__) && !defined(__mips64) && !defined(__x86_64__) && !defined(CONFIG_ARCH_S390X) +#if !defined(__ia64__) && !defined(__mips64) && !defined(__x86_64__) && !defined(CONFIG_ARCH_S390X) static long cp_new_stat64(struct kstat *stat, struct stat64 __user *statbuf) { diff -urN linux-2.6.4-rc3/include/asm-alpha/stat.h linux-2.6.4/include/asm-alpha/stat.h --- linux-2.6.4-rc3/include/asm-alpha/stat.h 2004-02-17 19:58:47.000000000 -0800 +++ linux-2.6.4/include/asm-alpha/stat.h 2004-03-10 19:31:37.000000000 -0800 @@ -1,7 +1,7 @@ #ifndef _ALPHA_STAT_H #define _ALPHA_STAT_H -struct __old_kernel_stat { +struct stat { unsigned int st_dev; unsigned int st_ino; unsigned int st_mode; @@ -14,27 +14,35 @@ unsigned long st_mtime; unsigned long st_ctime; unsigned int st_blksize; - int st_blocks; + unsigned int st_blocks; unsigned int st_flags; unsigned int st_gen; }; -struct stat { - unsigned int st_dev; - unsigned int st_ino; +/* The stat64 structure increases the size of dev_t, blkcnt_t, adds + nanosecond resolution times, and padding for expansion. */ + +struct stat64 { + unsigned long st_dev; + unsigned long st_ino; + unsigned long st_rdev; + long st_size; + unsigned long st_blocks; + unsigned int st_mode; - unsigned int st_nlink; unsigned int st_uid; unsigned int st_gid; - unsigned int st_rdev; - long st_size; + unsigned int st_blksize; + unsigned int st_nlink; + unsigned int __pad0; + unsigned long st_atime; + unsigned long st_atime_nsec; unsigned long st_mtime; + unsigned long st_mtime_nsec; unsigned long st_ctime; - unsigned int st_blksize; - int st_blocks; - unsigned int st_flags; - unsigned int st_gen; + unsigned long st_ctime_nsec; + long __unused[3]; }; #endif diff -urN linux-2.6.4-rc3/include/asm-alpha/unistd.h linux-2.6.4/include/asm-alpha/unistd.h --- linux-2.6.4-rc3/include/asm-alpha/unistd.h 2004-03-10 19:31:13.000000000 -0800 +++ linux-2.6.4/include/asm-alpha/unistd.h 2004-03-10 19:31:37.000000000 -0800 @@ -360,7 +360,10 @@ #define __NR_clock_nanosleep 422 #define __NR_semtimedop 423 #define __NR_tgkill 424 -#define NR_SYSCALLS 425 +#define __NR_stat64 425 +#define __NR_lstat64 426 +#define __NR_fstat64 427 +#define NR_SYSCALLS 428 #if defined(__GNUC__) @@ -573,9 +576,9 @@ return sys_lseek(fd, off, whence); } -static inline long _exit(int value) +static inline void _exit(int value) { - return sys_exit(value); + sys_exit(value); } #define exit(x) _exit(x) diff -urN linux-2.6.4-rc3/include/asm-ppc64/mmu_context.h linux-2.6.4/include/asm-ppc64/mmu_context.h --- linux-2.6.4-rc3/include/asm-ppc64/mmu_context.h 2004-03-10 19:31:13.000000000 -0800 +++ linux-2.6.4/include/asm-ppc64/mmu_context.h 2004-03-10 19:31:39.000000000 -0800 @@ -186,7 +186,7 @@ { unsigned long ordinal, vsid; - ordinal = (((ea >> 28) & 0x1fffff) * LAST_USER_CONTEXT) | (ea >> 60); + ordinal = (((ea >> 28) & 0x1fff) * LAST_USER_CONTEXT) | (ea >> 60); vsid = (ordinal * VSID_RANDOMIZER) & VSID_MASK; ifppcdebug(PPCDBG_HTABSTRESS) { @@ -209,7 +209,7 @@ { unsigned long ordinal, vsid; - ordinal = (((ea >> 28) & 0x1fffff) * LAST_USER_CONTEXT) | context; + ordinal = (((ea >> 28) & 0x1fff) * LAST_USER_CONTEXT) | context; vsid = (ordinal * VSID_RANDOMIZER) & VSID_MASK; ifppcdebug(PPCDBG_HTABSTRESS) { diff -urN linux-2.6.4-rc3/include/linux/kernel.h linux-2.6.4/include/linux/kernel.h --- linux-2.6.4-rc3/include/linux/kernel.h 2004-03-10 19:31:14.000000000 -0800 +++ linux-2.6.4/include/linux/kernel.h 2004-03-10 19:31:41.000000000 -0800 @@ -168,14 +168,14 @@ * "unnecessary" pointer comparison. */ #define min(x,y) ({ \ - const typeof(x) _x = (x); \ - const typeof(y) _y = (y); \ + typeof(x) _x = (x); \ + typeof(y) _y = (y); \ (void) (&_x == &_y); \ _x < _y ? _x : _y; }) #define max(x,y) ({ \ - const typeof(x) _x = (x); \ - const typeof(y) _y = (y); \ + typeof(x) _x = (x); \ + typeof(y) _y = (y); \ (void) (&_x == &_y); \ _x > _y ? _x : _y; }) diff -urN linux-2.6.4-rc3/init/initramfs.c linux-2.6.4/init/initramfs.c --- linux-2.6.4-rc3/init/initramfs.c 2004-03-10 19:31:14.000000000 -0800 +++ linux-2.6.4/init/initramfs.c 2004-03-10 19:31:42.000000000 -0800 @@ -16,7 +16,7 @@ message = x; } -static void __init *malloc(int size) +static void __init *malloc(size_t size) { return kmalloc(size, GFP_KERNEL); } diff -urN linux-2.6.4-rc3/kernel/stop_machine.c linux-2.6.4/kernel/stop_machine.c --- linux-2.6.4-rc3/kernel/stop_machine.c 2004-03-10 19:31:14.000000000 -0800 +++ linux-2.6.4/kernel/stop_machine.c 2004-03-10 19:31:42.000000000 -0800 @@ -3,6 +3,7 @@ #include #include #include +#include #include #include diff -urN linux-2.6.4-rc3/mm/page_alloc.c linux-2.6.4/mm/page_alloc.c --- linux-2.6.4-rc3/mm/page_alloc.c 2004-03-10 19:31:14.000000000 -0800 +++ linux-2.6.4/mm/page_alloc.c 2004-03-10 19:31:42.000000000 -0800 @@ -71,7 +71,7 @@ static void bad_page(const char *function, struct page *page) { - printk("Bad page state at %s\n", function); + printk("Bad page state at %s (in process '%s', page %p)\n", function, current->comm, page); printk("flags:0x%08lx mapping:%p mapped:%d count:%d\n", page->flags, page->mapping, page_mapped(page), page_count(page)); diff -urN linux-2.6.4-rc3/net/ipv4/esp4.c linux-2.6.4/net/ipv4/esp4.c --- linux-2.6.4-rc3/net/ipv4/esp4.c 2004-02-17 19:58:16.000000000 -0800 +++ linux-2.6.4/net/ipv4/esp4.c 2004-03-10 19:31:43.000000000 -0800 @@ -518,6 +518,8 @@ esp->conf.padlen = 0; if (esp->conf.ivlen) { esp->conf.ivec = kmalloc(esp->conf.ivlen, GFP_KERNEL); + if (unlikely(esp->conf.ivec == NULL)) + goto error; get_random_bytes(esp->conf.ivec, esp->conf.ivlen); } crypto_cipher_setkey(esp->conf.tfm, esp->conf.key, esp->conf.key_len); diff -urN linux-2.6.4-rc3/net/ipv4/ip_output.c linux-2.6.4/net/ipv4/ip_output.c --- linux-2.6.4-rc3/net/ipv4/ip_output.c 2004-03-10 19:31:14.000000000 -0800 +++ linux-2.6.4/net/ipv4/ip_output.c 2004-03-10 19:31:43.000000000 -0800 @@ -761,8 +761,11 @@ */ opt = ipc->opt; if (opt) { - if (inet->cork.opt == NULL) + if (inet->cork.opt == NULL) { inet->cork.opt = kmalloc(sizeof(struct ip_options) + 40, sk->sk_allocation); + if (unlikely(inet->cork.opt == NULL)) + return -ENOBUFS; + } memcpy(inet->cork.opt, opt, sizeof(struct ip_options)+opt->optlen); inet->cork.flags |= IPCORK_OPT; inet->cork.addr = ipc->addr; diff -urN linux-2.6.4-rc3/net/ipv6/addrconf.c linux-2.6.4/net/ipv6/addrconf.c --- linux-2.6.4-rc3/net/ipv6/addrconf.c 2004-03-10 19:31:14.000000000 -0800 +++ linux-2.6.4/net/ipv6/addrconf.c 2004-03-10 19:31:43.000000000 -0800 @@ -2673,26 +2673,6 @@ goto done; } #endif - /* multicast address */ - for (ifmca = idev->mc_list; ifmca; - ifmca = ifmca->next, ip_idx++) { - if (ip_idx < s_ip_idx) - continue; - if ((err = inet6_fill_ifmcaddr(skb, ifmca, - NETLINK_CB(cb->skb).pid, - cb->nlh->nlmsg_seq, RTM_NEWADDR)) <= 0) - goto done; - } - /* anycast address */ - for (ifaca = idev->ac_list; ifaca; - ifaca = ifaca->aca_next, ip_idx++) { - if (ip_idx < s_ip_idx) - continue; - if ((err = inet6_fill_ifacaddr(skb, ifaca, - NETLINK_CB(cb->skb).pid, - cb->nlh->nlmsg_seq, RTM_NEWADDR)) <= 0) - goto done; - } read_unlock_bh(&idev->lock); in6_dev_put(idev); } diff -urN linux-2.6.4-rc3/net/ipv6/esp6.c linux-2.6.4/net/ipv6/esp6.c --- linux-2.6.4-rc3/net/ipv6/esp6.c 2004-02-17 19:58:34.000000000 -0800 +++ linux-2.6.4/net/ipv6/esp6.c 2004-03-10 19:31:43.000000000 -0800 @@ -422,6 +422,8 @@ esp->conf.padlen = 0; if (esp->conf.ivlen) { esp->conf.ivec = kmalloc(esp->conf.ivlen, GFP_KERNEL); + if (unlikely(esp->conf.ivec == NULL)) + goto error; get_random_bytes(esp->conf.ivec, esp->conf.ivlen); } crypto_cipher_setkey(esp->conf.tfm, esp->conf.key, esp->conf.key_len); diff -urN linux-2.6.4-rc3/net/ipv6/ip6_output.c linux-2.6.4/net/ipv6/ip6_output.c --- linux-2.6.4-rc3/net/ipv6/ip6_output.c 2004-02-17 19:57:14.000000000 -0800 +++ linux-2.6.4/net/ipv6/ip6_output.c 2004-03-10 19:31:43.000000000 -0800 @@ -816,9 +816,12 @@ * setup for corking */ if (opt) { - if (np->cork.opt == NULL) + if (np->cork.opt == NULL) { np->cork.opt = kmalloc(opt->tot_len, sk->sk_allocation); + if (unlikely(np->cork.opt == NULL)) + return -ENOBUFS; + } memcpy(np->cork.opt, opt, opt->tot_len); inet->cork.flags |= IPCORK_OPT; /* need source address above miyazawa*/