From 0e7647367dd72968b063048337ed6c5e975f50f0 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Tue, 24 Oct 2006 21:45:00 +1000 Subject: [PATCH] --- yaml --- r: 40298 b: refs/heads/master c: a1aa28970316d7fb606321d5ab7fb3873641ab54 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/arch/arm/mach-ixp2000/ixdp2400.c | 4 +- trunk/arch/arm/mach-lh7a40x/Kconfig | 4 +- trunk/arch/powerpc/boot/Makefile | 2 +- trunk/arch/powerpc/configs/cell_defconfig | 19 +-- trunk/arch/powerpc/kernel/cputable.c | 86 +----------- trunk/arch/powerpc/kernel/head_64.S | 21 ++- trunk/arch/powerpc/kernel/misc_32.S | 74 +++++++++++ trunk/arch/powerpc/kernel/misc_64.S | 124 ++++++++++++++++++ trunk/arch/powerpc/kernel/module_32.c | 39 ++---- trunk/arch/powerpc/kernel/module_64.c | 49 ++----- trunk/arch/powerpc/kernel/prom.c | 8 +- trunk/arch/powerpc/kernel/setup_32.c | 8 +- trunk/arch/powerpc/kernel/setup_64.c | 11 -- trunk/arch/powerpc/kernel/time.c | 63 ++++++--- trunk/arch/powerpc/kernel/vdso.c | 43 ------ trunk/arch/powerpc/kernel/vdso32/vdso32.lds.S | 12 -- .../arch/powerpc/kernel/vdso64/gettimeofday.S | 6 +- trunk/arch/powerpc/kernel/vdso64/vdso64.lds.S | 10 -- trunk/arch/powerpc/oprofile/op_model_power4.c | 2 +- .../arch/powerpc/platforms/cell/spufs/file.c | 2 +- .../powerpc/platforms/cell/spufs/hw_ops.c | 2 +- trunk/arch/powerpc/platforms/chrp/setup.c | 4 +- trunk/arch/powerpc/platforms/iseries/setup.c | 5 - trunk/arch/powerpc/platforms/powermac/sleep.S | 3 +- trunk/arch/powerpc/sysdev/i8259.c | 5 - trunk/arch/powerpc/sysdev/ipic.c | 4 +- trunk/arch/powerpc/sysdev/qe_lib/ucc.c | 2 - trunk/arch/powerpc/sysdev/qe_lib/ucc_fast.c | 2 +- trunk/arch/powerpc/sysdev/qe_lib/ucc_slow.c | 2 +- trunk/arch/powerpc/sysdev/tsi108_dev.c | 4 +- trunk/arch/ppc/boot/simple/relocate.S | 6 +- trunk/arch/ppc/kernel/misc.S | 74 +++++++++++ trunk/arch/ppc/kernel/setup.c | 10 +- trunk/arch/um/drivers/mconsole_kern.c | 23 +--- trunk/arch/um/drivers/mconsole_user.c | 1 - trunk/arch/um/include/mconsole.h | 1 - trunk/arch/x86_64/kernel/io_apic.c | 62 +++------ trunk/arch/x86_64/kernel/smpboot.c | 7 +- trunk/drivers/atm/horizon.c | 2 +- trunk/drivers/char/drm/r300_cmdbuf.c | 33 ++++- trunk/drivers/char/drm/radeon_state.c | 109 ++++++++++++++- trunk/drivers/misc/Kconfig | 1 - trunk/drivers/misc/ioc4.c | 1 - trunk/drivers/mmc/tifm_sd.c | 1 - trunk/drivers/net/Kconfig | 1 - .../net/wireless/bcm43xx/bcm43xx_dma.h | 1 - trunk/drivers/video/backlight/corgi_bl.c | 4 +- trunk/fs/Kconfig | 2 - trunk/include/asm-arm/arch-pxa/irqs.h | 2 +- trunk/include/asm-powerpc/asm-compat.h | 52 -------- trunk/include/asm-powerpc/cputable.h | 37 ++++-- trunk/include/asm-powerpc/firmware.h | 17 ++- trunk/include/asm-powerpc/i8259.h | 1 - trunk/include/asm-powerpc/ppc_asm.h | 18 +-- trunk/include/asm-powerpc/prom.h | 10 +- trunk/include/asm-powerpc/reg.h | 26 ---- trunk/include/asm-powerpc/time.h | 27 ++-- trunk/include/asm-powerpc/timex.h | 20 +-- trunk/include/asm-x86_64/hw_irq.h | 2 - trunk/net/dccp/Kconfig | 6 +- trunk/net/dccp/ackvec.c | 12 +- trunk/net/dccp/ackvec.h | 3 +- trunk/net/dccp/ccids/Kconfig | 17 +-- trunk/net/dccp/ccids/ccid2.c | 2 +- trunk/net/dccp/ccids/ccid3.c | 3 +- trunk/net/dccp/dccp.h | 2 +- trunk/net/dccp/input.c | 4 +- trunk/net/dccp/ipv4.c | 4 +- trunk/net/dccp/ipv6.c | 2 +- trunk/net/dccp/options.c | 2 +- trunk/net/ieee80211/Kconfig | 2 - trunk/net/ipv4/ipconfig.c | 2 +- trunk/net/ipv6/netfilter/ip6_tables.c | 21 ++- trunk/net/ipv6/netfilter/ip6t_ah.c | 7 +- trunk/net/ipv6/netfilter/ip6t_frag.c | 7 +- trunk/net/ipv6/netfilter/ip6t_hbh.c | 7 +- trunk/net/ipv6/netfilter/ip6t_rt.c | 7 +- trunk/net/xfrm/xfrm_state.c | 18 ++- trunk/scripts/mod/modpost.c | 2 - trunk/sound/pci/intel8x0.c | 6 - 81 files changed, 677 insertions(+), 632 deletions(-) diff --git a/[refs] b/[refs] index 363271ea8665..9067cb38065c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 9f4c7ac227423eb4a514ce0bbd3a884a26541e63 +refs/heads/master: a1aa28970316d7fb606321d5ab7fb3873641ab54 diff --git a/trunk/arch/arm/mach-ixp2000/ixdp2400.c b/trunk/arch/arm/mach-ixp2000/ixdp2400.c index 0fdd03ab36e6..9ee63834e603 100644 --- a/trunk/arch/arm/mach-ixp2000/ixdp2400.c +++ b/trunk/arch/arm/mach-ixp2000/ixdp2400.c @@ -135,11 +135,11 @@ static void ixdp2400_pci_postinit(void) if (ixdp2x00_master_npu()) { dev = pci_get_bus_and_slot(1, IXDP2400_SLAVE_ENET_DEVFN); pci_remove_bus_device(dev); - pci_dev_put(dev); + pci_dev_put(dev) } else { dev = pci_get_bus_and_slot(1, IXDP2400_MASTER_ENET_DEVFN); pci_remove_bus_device(dev); - pci_dev_put(dev); + pci_dev_put(dev) ixdp2x00_slave_pci_postinit(); } diff --git a/trunk/arch/arm/mach-lh7a40x/Kconfig b/trunk/arch/arm/mach-lh7a40x/Kconfig index 147b01928a9b..558a34f53b1c 100644 --- a/trunk/arch/arm/mach-lh7a40x/Kconfig +++ b/trunk/arch/arm/mach-lh7a40x/Kconfig @@ -14,7 +14,7 @@ config MACH_LPD7A400 bool "LPD7A400 Card Engine" select ARCH_LH7A400 # select IDE_POLL -# select HAS_TOUCHSCREEN_ADS7843_LH7 + select HAS_TOUCHSCREEN_ADS7843_LH7 help Say Y here if you are using Logic Product Development's LPD7A400 CardEngine. For the time being, the LPD7A400 and @@ -24,7 +24,7 @@ config MACH_LPD7A404 bool "LPD7A404 Card Engine" select ARCH_LH7A404 # select IDE_POLL -# select HAS_TOUCHSCREEN_ADC_LH7 + select HAS_TOUCHSCREEN_ADC_LH7 help Say Y here if you are using Logic Product Development's LPD7A404 CardEngine. For the time being, the LPD7A400 and diff --git a/trunk/arch/powerpc/boot/Makefile b/trunk/arch/powerpc/boot/Makefile index 4b2be611f77f..37ddfcab0003 100644 --- a/trunk/arch/powerpc/boot/Makefile +++ b/trunk/arch/powerpc/boot/Makefile @@ -115,7 +115,7 @@ endif quiet_cmd_wrap = WRAP $@ cmd_wrap =$(CONFIG_SHELL) $(wrapper) -c -o $@ -p $2 $(CROSSWRAP) vmlinux quiet_cmd_wrap_initrd = WRAP $@ - cmd_wrap_initrd =$(CONFIG_SHELL) $(wrapper) -c -o $@ -p $2 $(CROSSWRAP) \ + cmd_wrap_initrd =$(wrapper) -c -o $@ -p $2 $(CROSSWRAP) \ -i $(obj)/ramdisk.image.gz vmlinux $(obj)/zImage.chrp: vmlinux $(wrapperbits) diff --git a/trunk/arch/powerpc/configs/cell_defconfig b/trunk/arch/powerpc/configs/cell_defconfig index 0aba06d7d2ec..892d5dd3254e 100644 --- a/trunk/arch/powerpc/configs/cell_defconfig +++ b/trunk/arch/powerpc/configs/cell_defconfig @@ -254,7 +254,6 @@ CONFIG_SYN_COOKIES=y CONFIG_INET_TUNNEL=y CONFIG_INET_XFRM_MODE_TRANSPORT=y CONFIG_INET_XFRM_MODE_TUNNEL=y -# CONFIG_INET_XFRM_MODE_BEET is not set CONFIG_INET_DIAG=y CONFIG_INET_TCP_DIAG=y # CONFIG_TCP_CONG_ADVANCED is not set @@ -276,9 +275,7 @@ CONFIG_INET6_XFRM_TUNNEL=m CONFIG_INET6_TUNNEL=m CONFIG_INET6_XFRM_MODE_TRANSPORT=y CONFIG_INET6_XFRM_MODE_TUNNEL=y -# CONFIG_INET6_XFRM_MODE_BEET is not set # CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set -# CONFIG_IPV6_SIT is not set CONFIG_IPV6_TUNNEL=m # CONFIG_IPV6_SUBTREES is not set # CONFIG_IPV6_MULTIPLE_TABLES is not set @@ -408,12 +405,6 @@ CONFIG_BLK_DEV_INITRD=y # CONFIG_CDROM_PKTCDVD is not set # CONFIG_ATA_OVER_ETH is not set -# -# Misc devices -# -# CONFIG_SGI_IOC4 is not set -# CONFIG_TIFM_CORE is not set - # # ATA/ATAPI/MFM/RLL support # @@ -747,6 +738,7 @@ CONFIG_GEN_RTC=y # TPM devices # # CONFIG_TCG_TPM is not set +# CONFIG_TELCLOCK is not set # # I2C support @@ -810,7 +802,6 @@ CONFIG_I2C_ALGOBIT=y # # Dallas's 1-wire bus # -# CONFIG_W1 is not set # # Hardware Monitoring support @@ -818,10 +809,15 @@ CONFIG_I2C_ALGOBIT=y # CONFIG_HWMON is not set # CONFIG_HWMON_VID is not set +# +# Misc devices +# + # # Multimedia devices # # CONFIG_VIDEO_DEV is not set +CONFIG_VIDEO_V4L2=y # # Digital Video Broadcasting Devices @@ -927,7 +923,6 @@ CONFIG_EXT3_FS=y CONFIG_EXT3_FS_XATTR=y # CONFIG_EXT3_FS_POSIX_ACL is not set # CONFIG_EXT3_FS_SECURITY is not set -# CONFIG_EXT4DEV_FS is not set CONFIG_JBD=y # CONFIG_JBD_DEBUG is not set CONFIG_FS_MBCACHE=y @@ -935,7 +930,6 @@ CONFIG_FS_MBCACHE=y # CONFIG_JFS_FS is not set CONFIG_FS_POSIX_ACL=y # CONFIG_XFS_FS is not set -# CONFIG_GFS2_FS is not set # CONFIG_OCFS2_FS is not set # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set @@ -1135,7 +1129,6 @@ CONFIG_DEBUG_FS=y # CONFIG_DEBUG_VM is not set # CONFIG_DEBUG_LIST is not set # CONFIG_FORCED_INLINING is not set -# CONFIG_HEADERS_CHECK is not set # CONFIG_RCU_TORTURE_TEST is not set # CONFIG_DEBUG_STACKOVERFLOW is not set # CONFIG_DEBUG_STACK_USAGE is not set diff --git a/trunk/arch/powerpc/kernel/cputable.c b/trunk/arch/powerpc/kernel/cputable.c index bfd499ee3753..95382f994404 100644 --- a/trunk/arch/powerpc/kernel/cputable.c +++ b/trunk/arch/powerpc/kernel/cputable.c @@ -18,7 +18,6 @@ #include #include -#include /* for PTRRELOC on ARCH=ppc */ struct cpu_spec* cur_cpu_spec = NULL; EXPORT_SYMBOL(cur_cpu_spec); @@ -74,7 +73,7 @@ extern void __restore_cpu_ppc970(void); #define PPC_FEATURE_SPE_COMP 0 #endif -static struct cpu_spec cpu_specs[] = { +struct cpu_spec cpu_specs[] = { #ifdef CONFIG_PPC64 { /* Power3 */ .pvr_mask = 0xffff0000, @@ -228,21 +227,6 @@ static struct cpu_spec cpu_specs[] = { .oprofile_type = PPC_OPROFILE_POWER4, .platform = "ppc970", }, - { /* PPC970GX */ - .pvr_mask = 0xffff0000, - .pvr_value = 0x00450000, - .cpu_name = "PPC970GX", - .cpu_features = CPU_FTRS_PPC970, - .cpu_user_features = COMMON_USER_POWER4 | - PPC_FEATURE_HAS_ALTIVEC_COMP, - .icache_bsize = 128, - .dcache_bsize = 128, - .num_pmcs = 8, - .cpu_setup = __setup_cpu_ppc970, - .oprofile_cpu_type = "ppc64/970", - .oprofile_type = PPC_OPROFILE_POWER4, - .platform = "ppc970", - }, { /* Power5 GR */ .pvr_mask = 0xffff0000, .pvr_value = 0x003a0000, @@ -1168,71 +1152,3 @@ static struct cpu_spec cpu_specs[] = { #endif /* !CLASSIC_PPC */ #endif /* CONFIG_PPC32 */ }; - -struct cpu_spec *identify_cpu(unsigned long offset) -{ - struct cpu_spec *s = cpu_specs; - struct cpu_spec **cur = &cur_cpu_spec; - unsigned int pvr = mfspr(SPRN_PVR); - int i; - - s = PTRRELOC(s); - cur = PTRRELOC(cur); - - if (*cur != NULL) - return PTRRELOC(*cur); - - for (i = 0; i < ARRAY_SIZE(cpu_specs); i++,s++) - if ((pvr & s->pvr_mask) == s->pvr_value) { - *cur = cpu_specs + i; -#ifdef CONFIG_PPC64 - /* ppc64 expects identify_cpu to also call setup_cpu - * for that processor. I will consolidate that at a - * later time, for now, just use our friend #ifdef. - * we also don't need to PTRRELOC the function pointer - * on ppc64 as we are running at 0 in real mode. - */ - if (s->cpu_setup) { - s->cpu_setup(offset, s); - } -#endif /* CONFIG_PPC64 */ - return s; - } - BUG(); - return NULL; -} - -void do_feature_fixups(unsigned long value, void *fixup_start, void *fixup_end) -{ - struct fixup_entry { - unsigned long mask; - unsigned long value; - long start_off; - long end_off; - } *fcur, *fend; - - fcur = fixup_start; - fend = fixup_end; - - for (; fcur < fend; fcur++) { - unsigned int *pstart, *pend, *p; - - if ((value & fcur->mask) == fcur->value) - continue; - - /* These PTRRELOCs will disappear once the new scheme for - * modules and vdso is implemented - */ - pstart = ((unsigned int *)fcur) + (fcur->start_off / 4); - pend = ((unsigned int *)fcur) + (fcur->end_off / 4); - - for (p = pstart; p < pend; p++) { - *p = 0x60000000u; - asm volatile ("dcbst 0, %0" : : "r" (p)); - } - asm volatile ("sync" : : : "memory"); - for (p = pstart; p < pend; p++) - asm volatile ("icbi 0,%0" : : "r" (p)); - asm volatile ("sync; isync" : : : "memory"); - } -} diff --git a/trunk/arch/powerpc/kernel/head_64.S b/trunk/arch/powerpc/kernel/head_64.S index 291e3629b504..645c7f10fb28 100644 --- a/trunk/arch/powerpc/kernel/head_64.S +++ b/trunk/arch/powerpc/kernel/head_64.S @@ -1580,6 +1580,11 @@ _STATIC(__start_initialization_iSeries) li r0,0 stdu r0,-STACK_FRAME_OVERHEAD(r1) + LOAD_REG_IMMEDIATE(r3,cpu_specs) + LOAD_REG_IMMEDIATE(r4,cur_cpu_spec) + li r5,0 + bl .identify_cpu + LOAD_REG_IMMEDIATE(r2,__toc_start) addi r2,r2,0x4000 addi r2,r2,0x4000 @@ -1641,8 +1646,6 @@ _GLOBAL(__start_initialization_multiplatform) cmpwi r0,0x3c /* 970FX */ beq 1f cmpwi r0,0x44 /* 970MP */ - beq 1f - cmpwi r0,0x45 /* 970GX */ bne 2f 1: bl .__cpu_preinit_ppc970 2: @@ -1961,6 +1964,13 @@ _STATIC(start_here_multiplatform) addi r2,r2,0x4000 add r2,r2,r26 + LOAD_REG_IMMEDIATE(r3, cpu_specs) + add r3,r3,r26 + LOAD_REG_IMMEDIATE(r4,cur_cpu_spec) + add r4,r4,r26 + mr r5,r26 + bl .identify_cpu + /* Do very early kernel initializations, including initial hash table, * stab and slb setup before we turn on relocation. */ @@ -1990,6 +2000,13 @@ _STATIC(start_here_common) li r0,0 stdu r0,-STACK_FRAME_OVERHEAD(r1) + /* Apply the CPUs-specific fixups (nop out sections not relevant + * to this CPU + */ + li r3,0 + bl .do_cpu_ftr_fixups + bl .do_fw_ftr_fixups + /* ptr to current */ LOAD_REG_IMMEDIATE(r4, init_task) std r4,PACACURRENT(r13) diff --git a/trunk/arch/powerpc/kernel/misc_32.S b/trunk/arch/powerpc/kernel/misc_32.S index 412bea3cf813..88fd73fdf048 100644 --- a/trunk/arch/powerpc/kernel/misc_32.S +++ b/trunk/arch/powerpc/kernel/misc_32.S @@ -101,6 +101,80 @@ _GLOBAL(reloc_got2) mtlr r11 blr +/* + * identify_cpu, + * called with r3 = data offset and r4 = CPU number + * doesn't change r3 + */ +_GLOBAL(identify_cpu) + addis r8,r3,cpu_specs@ha + addi r8,r8,cpu_specs@l + mfpvr r7 +1: + lwz r5,CPU_SPEC_PVR_MASK(r8) + and r5,r5,r7 + lwz r6,CPU_SPEC_PVR_VALUE(r8) + cmplw 0,r6,r5 + beq 1f + addi r8,r8,CPU_SPEC_ENTRY_SIZE + b 1b +1: + addis r6,r3,cur_cpu_spec@ha + addi r6,r6,cur_cpu_spec@l + sub r8,r8,r3 + stw r8,0(r6) + blr + +/* + * do_cpu_ftr_fixups - goes through the list of CPU feature fixups + * and writes nop's over sections of code that don't apply for this cpu. + * r3 = data offset (not changed) + */ +_GLOBAL(do_cpu_ftr_fixups) + /* Get CPU 0 features */ + addis r6,r3,cur_cpu_spec@ha + addi r6,r6,cur_cpu_spec@l + lwz r4,0(r6) + add r4,r4,r3 + lwz r4,CPU_SPEC_FEATURES(r4) + + /* Get the fixup table */ + addis r6,r3,__start___ftr_fixup@ha + addi r6,r6,__start___ftr_fixup@l + addis r7,r3,__stop___ftr_fixup@ha + addi r7,r7,__stop___ftr_fixup@l + + /* Do the fixup */ +1: cmplw 0,r6,r7 + bgelr + addi r6,r6,16 + lwz r8,-16(r6) /* mask */ + and r8,r8,r4 + lwz r9,-12(r6) /* value */ + cmplw 0,r8,r9 + beq 1b + lwz r8,-8(r6) /* section begin */ + lwz r9,-4(r6) /* section end */ + subf. r9,r8,r9 + beq 1b + /* write nops over the section of code */ + /* todo: if large section, add a branch at the start of it */ + srwi r9,r9,2 + mtctr r9 + add r8,r8,r3 + lis r0,0x60000000@h /* nop */ +3: stw r0,0(r8) + andi. r10,r4,CPU_FTR_SPLIT_ID_CACHE@l + beq 2f + dcbst 0,r8 /* suboptimal, but simpler */ + sync + icbi 0,r8 +2: addi r8,r8,4 + bdnz 3b + sync /* additional sync needed on g4 */ + isync + b 1b + /* * call_setup_cpu - call the setup_cpu function for this cpu * r3 = data offset, r24 = cpu number diff --git a/trunk/arch/powerpc/kernel/misc_64.S b/trunk/arch/powerpc/kernel/misc_64.S index 21fd2c662a99..c70e20708a1f 100644 --- a/trunk/arch/powerpc/kernel/misc_64.S +++ b/trunk/arch/powerpc/kernel/misc_64.S @@ -246,6 +246,130 @@ _GLOBAL(__flush_dcache_icache) isync blr +/* + * identify_cpu and calls setup_cpu + * In: r3 = base of the cpu_specs array + * r4 = address of cur_cpu_spec + * r5 = relocation offset + */ +_GLOBAL(identify_cpu) + mfpvr r7 +1: + lwz r8,CPU_SPEC_PVR_MASK(r3) + and r8,r8,r7 + lwz r9,CPU_SPEC_PVR_VALUE(r3) + cmplw 0,r9,r8 + beq 1f + addi r3,r3,CPU_SPEC_ENTRY_SIZE + b 1b +1: + sub r0,r3,r5 + std r0,0(r4) + ld r4,CPU_SPEC_SETUP(r3) + cmpdi 0,r4,0 + add r4,r4,r5 + beqlr + ld r4,0(r4) + add r4,r4,r5 + mtctr r4 + /* Calling convention for cpu setup is r3=offset, r4=cur_cpu_spec */ + mr r4,r3 + mr r3,r5 + bctr + +/* + * do_cpu_ftr_fixups - goes through the list of CPU feature fixups + * and writes nop's over sections of code that don't apply for this cpu. + * r3 = data offset (not changed) + */ +_GLOBAL(do_cpu_ftr_fixups) + /* Get CPU 0 features */ + LOAD_REG_IMMEDIATE(r6,cur_cpu_spec) + sub r6,r6,r3 + ld r4,0(r6) + sub r4,r4,r3 + ld r4,CPU_SPEC_FEATURES(r4) + /* Get the fixup table */ + LOAD_REG_IMMEDIATE(r6,__start___ftr_fixup) + sub r6,r6,r3 + LOAD_REG_IMMEDIATE(r7,__stop___ftr_fixup) + sub r7,r7,r3 + /* Do the fixup */ +1: cmpld r6,r7 + bgelr + addi r6,r6,32 + ld r8,-32(r6) /* mask */ + and r8,r8,r4 + ld r9,-24(r6) /* value */ + cmpld r8,r9 + beq 1b + ld r8,-16(r6) /* section begin */ + ld r9,-8(r6) /* section end */ + subf. r9,r8,r9 + beq 1b + /* write nops over the section of code */ + /* todo: if large section, add a branch at the start of it */ + srwi r9,r9,2 + mtctr r9 + sub r8,r8,r3 + lis r0,0x60000000@h /* nop */ +3: stw r0,0(r8) + andi. r10,r4,CPU_FTR_SPLIT_ID_CACHE@l + beq 2f + dcbst 0,r8 /* suboptimal, but simpler */ + sync + icbi 0,r8 +2: addi r8,r8,4 + bdnz 3b + sync /* additional sync needed on g4 */ + isync + b 1b + +/* + * do_fw_ftr_fixups - goes through the list of firmware feature fixups + * and writes nop's over sections of code that don't apply for this firmware. + * r3 = data offset (not changed) + */ +_GLOBAL(do_fw_ftr_fixups) + /* Get firmware features */ + LOAD_REG_IMMEDIATE(r6,powerpc_firmware_features) + sub r6,r6,r3 + ld r4,0(r6) + /* Get the fixup table */ + LOAD_REG_IMMEDIATE(r6,__start___fw_ftr_fixup) + sub r6,r6,r3 + LOAD_REG_IMMEDIATE(r7,__stop___fw_ftr_fixup) + sub r7,r7,r3 + /* Do the fixup */ +1: cmpld r6,r7 + bgelr + addi r6,r6,32 + ld r8,-32(r6) /* mask */ + and r8,r8,r4 + ld r9,-24(r6) /* value */ + cmpld r8,r9 + beq 1b + ld r8,-16(r6) /* section begin */ + ld r9,-8(r6) /* section end */ + subf. r9,r8,r9 + beq 1b + /* write nops over the section of code */ + /* todo: if large section, add a branch at the start of it */ + srwi r9,r9,2 + mtctr r9 + sub r8,r8,r3 + lis r0,0x60000000@h /* nop */ +3: stw r0,0(r8) +BEGIN_FTR_SECTION + dcbst 0,r8 /* suboptimal, but simpler */ + sync + icbi 0,r8 +END_FTR_SECTION_IFSET(CPU_FTR_SPLIT_ID_CACHE) + addi r8,r8,4 + bdnz 3b + sync /* additional sync needed on g4 */ + isync + b 1b #if defined(CONFIG_PPC_PMAC) || defined(CONFIG_PPC_MAPLE) /* diff --git a/trunk/arch/powerpc/kernel/module_32.c b/trunk/arch/powerpc/kernel/module_32.c index e2c3c6a85f33..92f4e5f64f02 100644 --- a/trunk/arch/powerpc/kernel/module_32.c +++ b/trunk/arch/powerpc/kernel/module_32.c @@ -24,8 +24,6 @@ #include #include -#include "setup.h" - #if 0 #define DEBUGP printk #else @@ -271,50 +269,33 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, return 0; } -static const Elf_Shdr *find_section(const Elf_Ehdr *hdr, - const Elf_Shdr *sechdrs, - const char *name) -{ - char *secstrings; - unsigned int i; - - secstrings = (char *)hdr + sechdrs[hdr->e_shstrndx].sh_offset; - for (i = 1; i < hdr->e_shnum; i++) - if (strcmp(secstrings+sechdrs[i].sh_name, name) == 0) - return &sechdrs[i]; - return NULL; -} - int module_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, struct module *me) { - const Elf_Shdr *sect; + char *secstrings; + unsigned int i; me->arch.bug_table = NULL; me->arch.num_bugs = 0; /* Find the __bug_table section, if present */ - sect = find_section(hdr, sechdrs, "__bug_table"); - if (sect != NULL) { - me->arch.bug_table = (void *) sect->sh_addr; - me->arch.num_bugs = sect->sh_size / sizeof(struct bug_entry); + secstrings = (char *)hdr + sechdrs[hdr->e_shstrndx].sh_offset; + for (i = 1; i < hdr->e_shnum; i++) { + if (strcmp(secstrings+sechdrs[i].sh_name, "__bug_table")) + continue; + me->arch.bug_table = (void *) sechdrs[i].sh_addr; + me->arch.num_bugs = sechdrs[i].sh_size / sizeof(struct bug_entry); + break; } - /* + /* * Strictly speaking this should have a spinlock to protect against * traversals, but since we only traverse on BUG()s, a spinlock * could potentially lead to deadlock and thus be counter-productive. */ list_add(&me->arch.bug_list, &module_bug_list); - /* Apply feature fixups */ - sect = find_section(hdr, sechdrs, "__ftr_fixup"); - if (sect != NULL) - do_feature_fixups(cur_cpu_spec->cpu_features, - (void *)sect->sh_addr, - (void *)sect->sh_addr + sect->sh_size); - return 0; } diff --git a/trunk/arch/powerpc/kernel/module_64.c b/trunk/arch/powerpc/kernel/module_64.c index 8dd1f0aae5d6..ba34001fca8e 100644 --- a/trunk/arch/powerpc/kernel/module_64.c +++ b/trunk/arch/powerpc/kernel/module_64.c @@ -22,9 +22,6 @@ #include #include #include -#include - -#include "setup.h" /* FIXME: We don't do .init separately. To do this, we'd need to have a separate r2 value in the init and core section, and stub between @@ -403,11 +400,6 @@ int apply_relocate_add(Elf64_Shdr *sechdrs, | (value & 0x03fffffc); break; - case R_PPC64_REL64: - /* 64 bits relative (used by features fixups) */ - *location = value - (unsigned long)location; - break; - default: printk("%s: Unknown ADD relocation: %lu\n", me->name, @@ -421,33 +413,23 @@ int apply_relocate_add(Elf64_Shdr *sechdrs, LIST_HEAD(module_bug_list); -static const Elf_Shdr *find_section(const Elf_Ehdr *hdr, - const Elf_Shdr *sechdrs, - const char *name) -{ - char *secstrings; - unsigned int i; - - secstrings = (char *)hdr + sechdrs[hdr->e_shstrndx].sh_offset; - for (i = 1; i < hdr->e_shnum; i++) - if (strcmp(secstrings+sechdrs[i].sh_name, name) == 0) - return &sechdrs[i]; - return NULL; -} - int module_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, struct module *me) { - const Elf_Shdr *sect; + char *secstrings; + unsigned int i; me->arch.bug_table = NULL; me->arch.num_bugs = 0; /* Find the __bug_table section, if present */ - sect = find_section(hdr, sechdrs, "__bug_table"); - if (sect != NULL) { - me->arch.bug_table = (void *) sect->sh_addr; - me->arch.num_bugs = sect->sh_size / sizeof(struct bug_entry); + secstrings = (char *)hdr + sechdrs[hdr->e_shstrndx].sh_offset; + for (i = 1; i < hdr->e_shnum; i++) { + if (strcmp(secstrings+sechdrs[i].sh_name, "__bug_table")) + continue; + me->arch.bug_table = (void *) sechdrs[i].sh_addr; + me->arch.num_bugs = sechdrs[i].sh_size / sizeof(struct bug_entry); + break; } /* @@ -457,19 +439,6 @@ int module_finalize(const Elf_Ehdr *hdr, */ list_add(&me->arch.bug_list, &module_bug_list); - /* Apply feature fixups */ - sect = find_section(hdr, sechdrs, "__ftr_fixup"); - if (sect != NULL) - do_feature_fixups(cur_cpu_spec->cpu_features, - (void *)sect->sh_addr, - (void *)sect->sh_addr + sect->sh_size); - - sect = find_section(hdr, sechdrs, "__fw_ftr_fixup"); - if (sect != NULL) - do_feature_fixups(powerpc_firmware_features, - (void *)sect->sh_addr, - (void *)sect->sh_addr + sect->sh_size); - return 0; } diff --git a/trunk/arch/powerpc/kernel/prom.c b/trunk/arch/powerpc/kernel/prom.c index bdb412d4b748..865b9648d0d5 100644 --- a/trunk/arch/powerpc/kernel/prom.c +++ b/trunk/arch/powerpc/kernel/prom.c @@ -1014,7 +1014,7 @@ EXPORT_SYMBOL(find_all_nodes); /** Checks if the given "compat" string matches one of the strings in * the device's "compatible" property */ -int device_is_compatible(const struct device_node *device, const char *compat) +int device_is_compatible(struct device_node *device, const char *compat) { const char* cp; int cplen, l; @@ -1491,8 +1491,7 @@ static int __init prom_reconfig_setup(void) __initcall(prom_reconfig_setup); #endif -struct property *of_find_property(const struct device_node *np, - const char *name, +struct property *of_find_property(struct device_node *np, const char *name, int *lenp) { struct property *pp; @@ -1513,8 +1512,7 @@ struct property *of_find_property(const struct device_node *np, * Find a property with a given name for a given node * and return the value. */ -const void *get_property(const struct device_node *np, const char *name, - int *lenp) +const void *get_property(struct device_node *np, const char *name, int *lenp) { struct property *pp = of_find_property(np,name,lenp); return pp ? pp->value : NULL; diff --git a/trunk/arch/powerpc/kernel/setup_32.c b/trunk/arch/powerpc/kernel/setup_32.c index a4c2964a3ca6..191d0ab09222 100644 --- a/trunk/arch/powerpc/kernel/setup_32.c +++ b/trunk/arch/powerpc/kernel/setup_32.c @@ -91,7 +91,6 @@ int ucache_bsize; unsigned long __init early_init(unsigned long dt_ptr) { unsigned long offset = reloc_offset(); - struct cpu_spec *spec; /* First zero the BSS -- use memset_io, some platforms don't have * caches on yet */ @@ -101,11 +100,8 @@ unsigned long __init early_init(unsigned long dt_ptr) * Identify the CPU type and fix up code sections * that depend on which cpu we have. */ - spec = identify_cpu(offset); - - do_feature_fixups(spec->cpu_features, - PTRRELOC(&__start___ftr_fixup), - PTRRELOC(&__stop___ftr_fixup)); + identify_cpu(offset, 0); + do_cpu_ftr_fixups(offset); return KERNELBASE + offset; } diff --git a/trunk/arch/powerpc/kernel/setup_64.c b/trunk/arch/powerpc/kernel/setup_64.c index 16278968dab6..4b2e32eab9dc 100644 --- a/trunk/arch/powerpc/kernel/setup_64.c +++ b/trunk/arch/powerpc/kernel/setup_64.c @@ -170,9 +170,6 @@ void __init setup_paca(int cpu) void __init early_setup(unsigned long dt_ptr) { - /* Identify CPU type */ - identify_cpu(0); - /* Assume we're on cpu 0 for now. Don't write to the paca yet! */ setup_paca(0); @@ -351,14 +348,6 @@ void __init setup_system(void) { DBG(" -> setup_system()\n"); - /* Apply the CPUs-specific and firmware specific fixups to kernel - * text (nop out sections not relevant to this CPU or this firmware) - */ - do_feature_fixups(cur_cpu_spec->cpu_features, - &__start___ftr_fixup, &__stop___ftr_fixup); - do_feature_fixups(powerpc_firmware_features, - &__start___fw_ftr_fixup, &__stop___fw_ftr_fixup); - /* * Unflatten the device-tree passed by prom_init or kexec */ diff --git a/trunk/arch/powerpc/kernel/time.c b/trunk/arch/powerpc/kernel/time.c index a1b5e4b16151..5b59bc18dfe7 100644 --- a/trunk/arch/powerpc/kernel/time.c +++ b/trunk/arch/powerpc/kernel/time.c @@ -220,8 +220,11 @@ static void account_process_time(struct pt_regs *regs) */ struct cpu_purr_data { int initialized; /* thread is running */ + u64 tb0; /* timebase at origin time */ + u64 purr0; /* PURR at origin time */ u64 tb; /* last TB value read */ u64 purr; /* last PURR value read */ + u64 stolen; /* stolen time so far */ spinlock_t lock; }; @@ -231,8 +234,10 @@ static void snapshot_tb_and_purr(void *data) { struct cpu_purr_data *p = &__get_cpu_var(cpu_purr_data); - p->tb = mftb(); - p->purr = mfspr(SPRN_PURR); + p->tb0 = mftb(); + p->purr0 = mfspr(SPRN_PURR); + p->tb = p->tb0; + p->purr = 0; wmb(); p->initialized = 1; } @@ -253,24 +258,37 @@ void snapshot_timebases(void) void calculate_steal_time(void) { - u64 tb, purr; + u64 tb, purr, t0; s64 stolen; - struct cpu_purr_data *pme; + struct cpu_purr_data *p0, *pme, *phim; + int cpu; if (!cpu_has_feature(CPU_FTR_PURR)) return; - pme = &per_cpu(cpu_purr_data, smp_processor_id()); + cpu = smp_processor_id(); + pme = &per_cpu(cpu_purr_data, cpu); if (!pme->initialized) return; /* this can happen in early boot */ - spin_lock(&pme->lock); + p0 = &per_cpu(cpu_purr_data, cpu & ~1); + phim = &per_cpu(cpu_purr_data, cpu ^ 1); + spin_lock(&p0->lock); tb = mftb(); - purr = mfspr(SPRN_PURR); - stolen = (tb - pme->tb) - (purr - pme->purr); - if (stolen > 0) + purr = mfspr(SPRN_PURR) - pme->purr0; + if (!phim->initialized || !cpu_online(cpu ^ 1)) { + stolen = (tb - pme->tb) - (purr - pme->purr); + } else { + t0 = pme->tb0; + if (phim->tb0 < t0) + t0 = phim->tb0; + stolen = phim->tb - t0 - phim->purr - purr - p0->stolen; + } + if (stolen > 0) { account_steal_time(current, stolen); + p0->stolen += stolen; + } pme->tb = tb; pme->purr = purr; - spin_unlock(&pme->lock); + spin_unlock(&p0->lock); } /* @@ -279,17 +297,30 @@ void calculate_steal_time(void) */ static void snapshot_purr(void) { - struct cpu_purr_data *pme; + int cpu; + u64 purr; + struct cpu_purr_data *p0, *pme, *phim; unsigned long flags; if (!cpu_has_feature(CPU_FTR_PURR)) return; - pme = &per_cpu(cpu_purr_data, smp_processor_id()); - spin_lock_irqsave(&pme->lock, flags); - pme->tb = mftb(); - pme->purr = mfspr(SPRN_PURR); + cpu = smp_processor_id(); + pme = &per_cpu(cpu_purr_data, cpu); + p0 = &per_cpu(cpu_purr_data, cpu & ~1); + phim = &per_cpu(cpu_purr_data, cpu ^ 1); + spin_lock_irqsave(&p0->lock, flags); + pme->tb = pme->tb0 = mftb(); + purr = mfspr(SPRN_PURR); + if (!phim->initialized) { + pme->purr = 0; + pme->purr0 = purr; + } else { + /* set p->purr and p->purr0 for no change in p0->stolen */ + pme->purr = phim->tb - phim->tb0 - phim->purr - p0->stolen; + pme->purr0 = purr - pme->purr; + } pme->initialized = 1; - spin_unlock_irqrestore(&pme->lock, flags); + spin_unlock_irqrestore(&p0->lock, flags); } #endif /* CONFIG_PPC_SPLPAR */ diff --git a/trunk/arch/powerpc/kernel/vdso.c b/trunk/arch/powerpc/kernel/vdso.c index c913ad5cad29..1a7e19cdab39 100644 --- a/trunk/arch/powerpc/kernel/vdso.c +++ b/trunk/arch/powerpc/kernel/vdso.c @@ -36,8 +36,6 @@ #include #include -#include "setup.h" - #undef DEBUG #ifdef DEBUG @@ -588,43 +586,6 @@ static __init int vdso_fixup_datapage(struct lib32_elfinfo *v32, return 0; } - -static __init int vdso_fixup_features(struct lib32_elfinfo *v32, - struct lib64_elfinfo *v64) -{ - void *start32; - unsigned long size32; - -#ifdef CONFIG_PPC64 - void *start64; - unsigned long size64; - - start64 = find_section64(v64->hdr, "__ftr_fixup", &size64); - if (start64) - do_feature_fixups(cur_cpu_spec->cpu_features, - start64, start64 + size64); - - start64 = find_section64(v64->hdr, "__fw_ftr_fixup", &size64); - if (start64) - do_feature_fixups(powerpc_firmware_features, - start64, start64 + size64); -#endif /* CONFIG_PPC64 */ - - start32 = find_section32(v32->hdr, "__ftr_fixup", &size32); - if (start32) - do_feature_fixups(cur_cpu_spec->cpu_features, - start32, start32 + size32); - -#ifdef CONFIG_PPC64 - start32 = find_section32(v32->hdr, "__fw_ftr_fixup", &size32); - if (start32) - do_feature_fixups(powerpc_firmware_features, - start32, start32 + size32); -#endif /* CONFIG_PPC64 */ - - return 0; -} - static __init int vdso_fixup_alt_funcs(struct lib32_elfinfo *v32, struct lib64_elfinfo *v64) { @@ -673,9 +634,6 @@ static __init int vdso_setup(void) if (vdso_fixup_datapage(&v32, &v64)) return -1; - if (vdso_fixup_features(&v32, &v64)) - return -1; - if (vdso_fixup_alt_funcs(&v32, &v64)) return -1; @@ -756,7 +714,6 @@ void __init vdso_init(void) * Setup the syscall map in the vDOS */ vdso_setup_syscall_map(); - /* * Initialize the vDSO images in memory, that is do necessary * fixups of vDSO symbols, locate trampolines, etc... diff --git a/trunk/arch/powerpc/kernel/vdso32/vdso32.lds.S b/trunk/arch/powerpc/kernel/vdso32/vdso32.lds.S index 26e138c4ce17..6187af2d54c3 100644 --- a/trunk/arch/powerpc/kernel/vdso32/vdso32.lds.S +++ b/trunk/arch/powerpc/kernel/vdso32/vdso32.lds.S @@ -32,18 +32,6 @@ SECTIONS PROVIDE (_etext = .); PROVIDE (etext = .); - . = ALIGN(8); - __ftr_fixup : { - *(__ftr_fixup) - } - -#ifdef CONFIG_PPC64 - . = ALIGN(8); - __fw_ftr_fixup : { - *(__fw_ftr_fixup) - } -#endif - /* Other stuff is appended to the text segment: */ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } .rodata1 : { *(.rodata1) } diff --git a/trunk/arch/powerpc/kernel/vdso64/gettimeofday.S b/trunk/arch/powerpc/kernel/vdso64/gettimeofday.S index 40ffd9b6cef7..56e76ff5498f 100644 --- a/trunk/arch/powerpc/kernel/vdso64/gettimeofday.S +++ b/trunk/arch/powerpc/kernel/vdso64/gettimeofday.S @@ -229,10 +229,8 @@ V_FUNCTION_BEGIN(__do_get_xsec) xor r0,r8,r8 /* create dependency */ add r3,r3,r0 - /* Get TB & offset it. We use the MFTB macro which will generate - * workaround code for Cell. - */ - MFTB(r7) + /* Get TB & offset it */ + mftb r7 ld r9,CFG_TB_ORIG_STAMP(r3) subf r7,r9,r7 diff --git a/trunk/arch/powerpc/kernel/vdso64/vdso64.lds.S b/trunk/arch/powerpc/kernel/vdso64/vdso64.lds.S index 2d70f35d50b5..4a2b6dc0960c 100644 --- a/trunk/arch/powerpc/kernel/vdso64/vdso64.lds.S +++ b/trunk/arch/powerpc/kernel/vdso64/vdso64.lds.S @@ -31,16 +31,6 @@ SECTIONS PROVIDE (_etext = .); PROVIDE (etext = .); - . = ALIGN(8); - __ftr_fixup : { - *(__ftr_fixup) - } - - . = ALIGN(8); - __fw_ftr_fixup : { - *(__fw_ftr_fixup) - } - /* Other stuff is appended to the text segment: */ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } .rodata1 : { *(.rodata1) } diff --git a/trunk/arch/powerpc/oprofile/op_model_power4.c b/trunk/arch/powerpc/oprofile/op_model_power4.c index 6a927effcc77..506f6b79f893 100644 --- a/trunk/arch/powerpc/oprofile/op_model_power4.c +++ b/trunk/arch/powerpc/oprofile/op_model_power4.c @@ -76,7 +76,7 @@ static inline int mmcra_must_set_sample(void) { if (__is_processor(PV_POWER4) || __is_processor(PV_POWER4p) || __is_processor(PV_970) || __is_processor(PV_970FX) || - __is_processor(PV_970MP) || __is_processor(PV_970GX)) + __is_processor(PV_970MP)) return 1; return 0; diff --git a/trunk/arch/powerpc/platforms/cell/spufs/file.c b/trunk/arch/powerpc/platforms/cell/spufs/file.c index 533e2723e184..0de8e114e6b6 100644 --- a/trunk/arch/powerpc/platforms/cell/spufs/file.c +++ b/trunk/arch/powerpc/platforms/cell/spufs/file.c @@ -385,7 +385,7 @@ static ssize_t spufs_mbox_read(struct file *file, char __user *buf, udata = (void __user *)buf; spu_acquire(ctx); - for (count = 0; (count + 4) <= len; count += 4, udata++) { + for (count = 0; count <= len; count += 4, udata++) { int ret; ret = ctx->ops->mbox_read(ctx, &mbox_data); if (ret == 0) diff --git a/trunk/arch/powerpc/platforms/cell/spufs/hw_ops.c b/trunk/arch/powerpc/platforms/cell/spufs/hw_ops.c index d805ffed892d..efc452e71ab0 100644 --- a/trunk/arch/powerpc/platforms/cell/spufs/hw_ops.c +++ b/trunk/arch/powerpc/platforms/cell/spufs/hw_ops.c @@ -147,7 +147,7 @@ static void spu_hw_signal1_write(struct spu_context *ctx, u32 data) static u32 spu_hw_signal2_read(struct spu_context *ctx) { - return in_be32(&ctx->spu->problem->signal_notify2); + return in_be32(&ctx->spu->problem->signal_notify1); } static void spu_hw_signal2_write(struct spu_context *ctx, u32 data) diff --git a/trunk/arch/powerpc/platforms/chrp/setup.c b/trunk/arch/powerpc/platforms/chrp/setup.c index 49b8dabcbc99..cae3d13229b9 100644 --- a/trunk/arch/powerpc/platforms/chrp/setup.c +++ b/trunk/arch/powerpc/platforms/chrp/setup.c @@ -477,10 +477,8 @@ static void __init chrp_find_8259(void) " address, polling\n"); i8259_init(pic, chrp_int_ack); - if (ppc_md.get_irq == NULL) { + if (ppc_md.get_irq == NULL) ppc_md.get_irq = i8259_irq; - irq_set_default_host(i8259_get_host()); - } if (chrp_mpic != NULL) { cascade_irq = irq_of_parse_and_map(pic, 0); if (cascade_irq == NO_IRQ) diff --git a/trunk/arch/powerpc/platforms/iseries/setup.c b/trunk/arch/powerpc/platforms/iseries/setup.c index 6f73469fd3b0..a0ff7ba7d666 100644 --- a/trunk/arch/powerpc/platforms/iseries/setup.c +++ b/trunk/arch/powerpc/platforms/iseries/setup.c @@ -694,11 +694,6 @@ void * __init iSeries_early_setup(void) { unsigned long phys_mem_size; - /* Identify CPU type. This is done again by the common code later - * on but calling this function multiple times is fine. - */ - identify_cpu(0); - powerpc_firmware_features |= FW_FEATURE_ISERIES; powerpc_firmware_features |= FW_FEATURE_LPAR; diff --git a/trunk/arch/powerpc/platforms/powermac/sleep.S b/trunk/arch/powerpc/platforms/powermac/sleep.S index adee28da353f..1174ca128efa 100644 --- a/trunk/arch/powerpc/platforms/powermac/sleep.S +++ b/trunk/arch/powerpc/platforms/powermac/sleep.S @@ -45,8 +45,7 @@ .section .text .align 5 -#if defined(CONFIG_PM) || defined(CONFIG_CPU_FREQ_PMAC) || \ - (defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PPC32)) +#if defined(CONFIG_PM) || defined(CONFIG_CPU_FREQ_PMAC) /* This gets called by via-pmu.c late during the sleep process. * The PMU was already send the sleep command and will shut us down diff --git a/trunk/arch/powerpc/sysdev/i8259.c b/trunk/arch/powerpc/sysdev/i8259.c index ad87adc975bc..0450265d73bb 100644 --- a/trunk/arch/powerpc/sysdev/i8259.c +++ b/trunk/arch/powerpc/sysdev/i8259.c @@ -224,11 +224,6 @@ static struct irq_host_ops i8259_host_ops = { .xlate = i8259_host_xlate, }; -struct irq_host *i8259_get_host(void) -{ - return i8259_host; -} - /** * i8259_init - Initialize the legacy controller * @node: device node of the legacy PIC (can be NULL, but then, it will match diff --git a/trunk/arch/powerpc/sysdev/ipic.c b/trunk/arch/powerpc/sysdev/ipic.c index 746f78c15375..bc4d4a7f9657 100644 --- a/trunk/arch/powerpc/sysdev/ipic.c +++ b/trunk/arch/powerpc/sysdev/ipic.c @@ -473,9 +473,9 @@ static int ipic_set_irq_type(unsigned int virq, unsigned int flow_type) desc->status |= flow_type & IRQ_TYPE_SENSE_MASK; if (flow_type & IRQ_TYPE_LEVEL_LOW) { desc->status |= IRQ_LEVEL; - desc->handle_irq = handle_level_irq; + set_irq_handler(virq, handle_level_irq); } else { - desc->handle_irq = handle_edge_irq; + set_irq_handler(virq, handle_edge_irq); } /* only EXT IRQ senses are programmable on ipic diff --git a/trunk/arch/powerpc/sysdev/qe_lib/ucc.c b/trunk/arch/powerpc/sysdev/qe_lib/ucc.c index ac12a44d516f..916c9e5df57f 100644 --- a/trunk/arch/powerpc/sysdev/qe_lib/ucc.c +++ b/trunk/arch/powerpc/sysdev/qe_lib/ucc.c @@ -207,7 +207,6 @@ int ucc_set_qe_mux_rxtx(int ucc_num, enum qe_clock clock, enum comm_dir mode) case QE_CLK18: source = 8; break; case QE_CLK7: source = 9; break; case QE_CLK8: source = 10; break; - case QE_CLK16: source = 11; break; default: source = -1; break; } break; @@ -223,7 +222,6 @@ int ucc_set_qe_mux_rxtx(int ucc_num, enum qe_clock clock, enum comm_dir mode) case QE_CLK22: source = 8; break; case QE_CLK7: source = 9; break; case QE_CLK8: source = 10; break; - case QE_CLK16: source = 11; break; default: source = -1; break; } break; diff --git a/trunk/arch/powerpc/sysdev/qe_lib/ucc_fast.c b/trunk/arch/powerpc/sysdev/qe_lib/ucc_fast.c index 75fa3104a43a..c2be7348fcbd 100644 --- a/trunk/arch/powerpc/sysdev/qe_lib/ucc_fast.c +++ b/trunk/arch/powerpc/sysdev/qe_lib/ucc_fast.c @@ -163,7 +163,7 @@ int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** ucc /* check if the UCC port number is in range. */ if ((uf_info->ucc_num < 0) || (uf_info->ucc_num > UCC_MAX_NUM - 1)) { - uccf_err("ucc_fast_init: Illegal UCC number!"); + uccf_err("ucc_fast_init: Illagal UCC number!"); return -EINVAL; } diff --git a/trunk/arch/powerpc/sysdev/qe_lib/ucc_slow.c b/trunk/arch/powerpc/sysdev/qe_lib/ucc_slow.c index a49da6b73ecf..1fb88ef7cf06 100644 --- a/trunk/arch/powerpc/sysdev/qe_lib/ucc_slow.c +++ b/trunk/arch/powerpc/sysdev/qe_lib/ucc_slow.c @@ -152,7 +152,7 @@ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** ucc /* check if the UCC port number is in range. */ if ((us_info->ucc_num < 0) || (us_info->ucc_num > UCC_MAX_NUM - 1)) { - uccs_err("ucc_slow_init: Illegal UCC number!"); + uccs_err("ucc_slow_init: Illagal UCC number!"); return -EINVAL; } diff --git a/trunk/arch/powerpc/sysdev/tsi108_dev.c b/trunk/arch/powerpc/sysdev/tsi108_dev.c index 97f37ef4bbbf..11de090eb901 100644 --- a/trunk/arch/powerpc/sysdev/tsi108_dev.c +++ b/trunk/arch/powerpc/sysdev/tsi108_dev.c @@ -48,7 +48,7 @@ phys_addr_t get_csrbase(void) tsi = of_find_node_by_type(NULL, "tsi-bridge"); if (tsi) { unsigned int size; - const void *prop = get_property(tsi, "reg", &size); + void *prop = get_property(tsi, "reg", &size); tsi108_csr_base = of_translate_address(tsi, prop); of_node_put(tsi); }; @@ -79,7 +79,7 @@ static int __init tsi108_eth_of_init(void) hw_info tsi_eth_data; unsigned int *id; unsigned int *phy_id; - const void *mac_addr; + void *mac_addr; phandle *ph; memset(r, 0, sizeof(r)); diff --git a/trunk/arch/ppc/boot/simple/relocate.S b/trunk/arch/ppc/boot/simple/relocate.S index 1bbbcd2f2bcb..0c021556d78e 100644 --- a/trunk/arch/ppc/boot/simple/relocate.S +++ b/trunk/arch/ppc/boot/simple/relocate.S @@ -154,8 +154,8 @@ do_relocate_out: start_ldr: /* Clear all of BSS and set up stack for C calls */ - lis r3,__bss_start@h - ori r3,r3,__bss_start@l + lis r3,edata@h + ori r3,r3,edata@l lis r4,end@h ori r4,r4,end@l subi r3,r3,4 @@ -163,7 +163,7 @@ start_ldr: li r0,0 50: stwu r0,4(r3) cmpw cr0,r3,r4 - blt 50b + bne 50b 90: mr r9,r1 /* Save old stack pointer (in case it matters) */ lis r1,.stack@h ori r1,r1,.stack@l diff --git a/trunk/arch/ppc/kernel/misc.S b/trunk/arch/ppc/kernel/misc.S index d319f9ba2379..5f6684012ded 100644 --- a/trunk/arch/ppc/kernel/misc.S +++ b/trunk/arch/ppc/kernel/misc.S @@ -109,6 +109,80 @@ _GLOBAL(reloc_got2) mtlr r11 blr +/* + * identify_cpu, + * called with r3 = data offset and r4 = CPU number + * doesn't change r3 + */ +_GLOBAL(identify_cpu) + addis r8,r3,cpu_specs@ha + addi r8,r8,cpu_specs@l + mfpvr r7 +1: + lwz r5,CPU_SPEC_PVR_MASK(r8) + and r5,r5,r7 + lwz r6,CPU_SPEC_PVR_VALUE(r8) + cmplw 0,r6,r5 + beq 1f + addi r8,r8,CPU_SPEC_ENTRY_SIZE + b 1b +1: + addis r6,r3,cur_cpu_spec@ha + addi r6,r6,cur_cpu_spec@l + sub r8,r8,r3 + stw r8,0(r6) + blr + +/* + * do_cpu_ftr_fixups - goes through the list of CPU feature fixups + * and writes nop's over sections of code that don't apply for this cpu. + * r3 = data offset (not changed) + */ +_GLOBAL(do_cpu_ftr_fixups) + /* Get CPU 0 features */ + addis r6,r3,cur_cpu_spec@ha + addi r6,r6,cur_cpu_spec@l + lwz r4,0(r6) + add r4,r4,r3 + lwz r4,CPU_SPEC_FEATURES(r4) + + /* Get the fixup table */ + addis r6,r3,__start___ftr_fixup@ha + addi r6,r6,__start___ftr_fixup@l + addis r7,r3,__stop___ftr_fixup@ha + addi r7,r7,__stop___ftr_fixup@l + + /* Do the fixup */ +1: cmplw 0,r6,r7 + bgelr + addi r6,r6,16 + lwz r8,-16(r6) /* mask */ + and r8,r8,r4 + lwz r9,-12(r6) /* value */ + cmplw 0,r8,r9 + beq 1b + lwz r8,-8(r6) /* section begin */ + lwz r9,-4(r6) /* section end */ + subf. r9,r8,r9 + beq 1b + /* write nops over the section of code */ + /* todo: if large section, add a branch at the start of it */ + srwi r9,r9,2 + mtctr r9 + add r8,r8,r3 + lis r0,0x60000000@h /* nop */ +3: stw r0,0(r8) + andi. r10,r4,CPU_FTR_SPLIT_ID_CACHE@l + beq 2f + dcbst 0,r8 /* suboptimal, but simpler */ + sync + icbi 0,r8 +2: addi r8,r8,4 + bdnz 3b + sync /* additional sync needed on g4 */ + isync + b 1b + /* * call_setup_cpu - call the setup_cpu function for this cpu * r3 = data offset, r24 = cpu number diff --git a/trunk/arch/ppc/kernel/setup.c b/trunk/arch/ppc/kernel/setup.c index 27faeca2c7a2..75fe13815be2 100644 --- a/trunk/arch/ppc/kernel/setup.c +++ b/trunk/arch/ppc/kernel/setup.c @@ -38,7 +38,6 @@ #include #include #include -#include #define USES_PPC_SYS (defined(CONFIG_85xx) || defined(CONFIG_83xx) || \ defined(CONFIG_MPC10X_BRIDGE) || defined(CONFIG_8260) || \ @@ -54,6 +53,8 @@ extern void platform_init(unsigned long r3, unsigned long r4, unsigned long r5, unsigned long r6, unsigned long r7); +extern void identify_cpu(unsigned long offset, unsigned long cpu); +extern void do_cpu_ftr_fixups(unsigned long offset); extern void reloc_got2(unsigned long offset); extern void ppc6xx_idle(void); @@ -300,7 +301,6 @@ early_init(int r3, int r4, int r5) { unsigned long phys; unsigned long offset = reloc_offset(); - struct cpu_spec *spec; /* Default */ phys = offset + KERNELBASE; @@ -313,10 +313,8 @@ early_init(int r3, int r4, int r5) * Identify the CPU type and fix up code sections * that depend on which cpu we have. */ - spec = identify_cpu(offset); - do_feature_fixups(spec->cpu_features, - PTRRELOC(&__start___ftr_fixup), - PTRRELOC(&__stop___ftr_fixup)); + identify_cpu(offset, 0); + do_cpu_ftr_fixups(offset); return phys; } diff --git a/trunk/arch/um/drivers/mconsole_kern.c b/trunk/arch/um/drivers/mconsole_kern.c index 7b172160fe04..d08bd036ccb8 100644 --- a/trunk/arch/um/drivers/mconsole_kern.c +++ b/trunk/arch/um/drivers/mconsole_kern.c @@ -79,7 +79,7 @@ static irqreturn_t mconsole_interrupt(int irq, void *dev_id) /* long to avoid size mismatch warnings from gcc */ long fd; struct mconsole_entry *new; - static struct mc_request req; /* that's OK */ + struct mc_request req; fd = (long) dev_id; while (mconsole_get_request(fd, &req)){ @@ -91,7 +91,6 @@ static irqreturn_t mconsole_interrupt(int irq, void *dev_id) mconsole_reply(&req, "Out of memory", 1, 0); else { new->request = req; - new->request.regs = get_irq_regs()->regs; list_add(&new->list, &mc_requests); } } @@ -315,21 +314,9 @@ void mconsole_stop(struct mc_request *req) { deactivate_fd(req->originating_fd, MCONSOLE_IRQ); os_set_fd_block(req->originating_fd, 1); - mconsole_reply(req, "stopped", 0, 0); - while (mconsole_get_request(req->originating_fd, req)) { - if (req->cmd->handler == mconsole_go) - break; - if (req->cmd->handler == mconsole_stop) { - mconsole_reply(req, "Already stopped", 1, 0); - continue; - } - if (req->cmd->handler == mconsole_sysrq) { - struct pt_regs *old_regs; - old_regs = set_irq_regs((struct pt_regs *)&req->regs); - mconsole_sysrq(req); - set_irq_regs(old_regs); - continue; - } + mconsole_reply(req, "", 0, 0); + while(mconsole_get_request(req->originating_fd, req)){ + if(req->cmd->handler == mconsole_go) break; (*req->cmd->handler)(req); } os_set_fd_block(req->originating_fd, 0); @@ -686,7 +673,9 @@ static void with_console(struct mc_request *req, void (*proc)(void *), static void sysrq_proc(void *arg) { char *op = arg; + struct pt_regs *old_regs = set_irq_regs(¤t->thread.regs); handle_sysrq(*op, NULL); + set_irq_regs(old_regs); } void mconsole_sysrq(struct mc_request *req) diff --git a/trunk/arch/um/drivers/mconsole_user.c b/trunk/arch/um/drivers/mconsole_user.c index 75aef6f7ef6e..17068eb746c0 100644 --- a/trunk/arch/um/drivers/mconsole_user.c +++ b/trunk/arch/um/drivers/mconsole_user.c @@ -14,7 +14,6 @@ #include #include #include "user.h" -#include "sysdep/ptrace.h" #include "mconsole.h" #include "umid.h" #include "user_util.h" diff --git a/trunk/arch/um/include/mconsole.h b/trunk/arch/um/include/mconsole.h index 2666815b6af5..58f67d391105 100644 --- a/trunk/arch/um/include/mconsole.h +++ b/trunk/arch/um/include/mconsole.h @@ -61,7 +61,6 @@ struct mc_request struct mconsole_request request; struct mconsole_command *cmd; - union uml_pt_regs regs; }; extern char mconsole_socket_name[]; diff --git a/trunk/arch/x86_64/kernel/io_apic.c b/trunk/arch/x86_64/kernel/io_apic.c index fe429e5d6b29..b000017e4b5d 100644 --- a/trunk/arch/x86_64/kernel/io_apic.c +++ b/trunk/arch/x86_64/kernel/io_apic.c @@ -63,7 +63,7 @@ int timer_over_8254 __initdata = 1; static struct { int pin, apic; } ioapic_i8259 = { -1, -1 }; static DEFINE_SPINLOCK(ioapic_lock); -DEFINE_SPINLOCK(vector_lock); +static DEFINE_SPINLOCK(vector_lock); /* * # of IRQ routing registers @@ -612,15 +612,15 @@ static int __assign_irq_vector(int irq, cpumask_t mask, cpumask_t *result) * Also, we've got to be careful not to trash gate * 0x80, because int 0x80 is hm, kind of importantish. ;) */ - static int current_vector = FIRST_DEVICE_VECTOR, current_offset = 0; + static struct { + int vector; + int offset; + } pos[NR_CPUS] = { [ 0 ... NR_CPUS - 1] = {FIRST_DEVICE_VECTOR, 0} }; int old_vector = -1; int cpu; BUG_ON((unsigned)irq >= NR_IRQ_VECTORS); - /* Only try and allocate irqs on cpus that are present */ - cpus_and(mask, mask, cpu_online_map); - if (irq_vector[irq] > 0) old_vector = irq_vector[irq]; if (old_vector > 0) { @@ -630,15 +630,15 @@ static int __assign_irq_vector(int irq, cpumask_t mask, cpumask_t *result) } for_each_cpu_mask(cpu, mask) { - cpumask_t domain, new_mask; - int new_cpu; + cpumask_t domain; + int first, new_cpu; int vector, offset; domain = vector_allocation_domain(cpu); - cpus_and(new_mask, domain, cpu_online_map); + first = first_cpu(domain); - vector = current_vector; - offset = current_offset; + vector = pos[first].vector; + offset = pos[first].offset; next: vector += 8; if (vector >= FIRST_SYSTEM_VECTOR) { @@ -646,24 +646,24 @@ static int __assign_irq_vector(int irq, cpumask_t mask, cpumask_t *result) offset = (offset + 1) % 8; vector = FIRST_DEVICE_VECTOR + offset; } - if (unlikely(current_vector == vector)) + if (unlikely(pos[first].vector == vector)) continue; if (vector == IA32_SYSCALL_VECTOR) goto next; - for_each_cpu_mask(new_cpu, new_mask) + for_each_cpu_mask(new_cpu, domain) if (per_cpu(vector_irq, new_cpu)[vector] != -1) goto next; /* Found one! */ - current_vector = vector; - current_offset = offset; + for_each_cpu_mask(new_cpu, domain) { + pos[new_cpu].vector = vector; + pos[new_cpu].offset = offset; + } if (old_vector >= 0) { - cpumask_t old_mask; int old_cpu; - cpus_and(old_mask, irq_domain[irq], cpu_online_map); - for_each_cpu_mask(old_cpu, old_mask) + for_each_cpu_mask(old_cpu, irq_domain[irq]) per_cpu(vector_irq, old_cpu)[old_vector] = -1; } - for_each_cpu_mask(new_cpu, new_mask) + for_each_cpu_mask(new_cpu, domain) per_cpu(vector_irq, new_cpu)[vector] = irq; irq_vector[irq] = vector; irq_domain[irq] = domain; @@ -684,32 +684,6 @@ static int assign_irq_vector(int irq, cpumask_t mask, cpumask_t *result) return vector; } -void __setup_vector_irq(int cpu) -{ - /* Initialize vector_irq on a new cpu */ - /* This function must be called with vector_lock held */ - unsigned long flags; - int irq, vector; - - - /* Mark the inuse vectors */ - for (irq = 0; irq < NR_IRQ_VECTORS; ++irq) { - if (!cpu_isset(cpu, irq_domain[irq])) - continue; - vector = irq_vector[irq]; - per_cpu(vector_irq, cpu)[vector] = irq; - } - /* Mark the free vectors */ - for (vector = 0; vector < NR_VECTORS; ++vector) { - irq = per_cpu(vector_irq, cpu)[vector]; - if (irq < 0) - continue; - if (!cpu_isset(cpu, irq_domain[irq])) - per_cpu(vector_irq, cpu)[vector] = -1; - } -} - - extern void (*interrupt[NR_IRQS])(void); static struct irq_chip ioapic_chip; diff --git a/trunk/arch/x86_64/kernel/smpboot.c b/trunk/arch/x86_64/kernel/smpboot.c index 62c2e747af58..7b7a6870288a 100644 --- a/trunk/arch/x86_64/kernel/smpboot.c +++ b/trunk/arch/x86_64/kernel/smpboot.c @@ -581,16 +581,12 @@ void __cpuinit start_secondary(void) * smp_call_function(). */ lock_ipi_call_lock(); - spin_lock(&vector_lock); - /* Setup the per cpu irq handling data structures */ - __setup_vector_irq(smp_processor_id()); /* * Allow the master to continue. */ cpu_set(smp_processor_id(), cpu_online_map); per_cpu(cpu_state, smp_processor_id()) = CPU_ONLINE; - spin_unlock(&vector_lock); unlock_ipi_call_lock(); cpu_idle(); @@ -803,6 +799,7 @@ static int __cpuinit do_boot_cpu(int cpu, int apicid) cpu, node); } + alternatives_smp_switch(1); c_idle.idle = get_idle_for_cpu(cpu); @@ -1249,10 +1246,8 @@ int __cpu_disable(void) local_irq_disable(); remove_siblinginfo(cpu); - spin_lock(&vector_lock); /* It's now safe to remove this processor from the online map */ cpu_clear(cpu, cpu_online_map); - spin_unlock(&vector_lock); remove_cpu_from_maps(); fixup_irqs(cpu_online_map); return 0; diff --git a/trunk/drivers/atm/horizon.c b/trunk/drivers/atm/horizon.c index 4dc10105d610..44268cba5a5a 100644 --- a/trunk/drivers/atm/horizon.c +++ b/trunk/drivers/atm/horizon.c @@ -1789,7 +1789,7 @@ static inline void CLOCK_IT (const hrz_dev *dev, u32 ctrl) WRITE_IT_WAIT(dev, ctrl | SEEPROM_SK); } -static u16 __devinit read_bia (const hrz_dev * dev, u16 addr) +static u16 __init read_bia (const hrz_dev * dev, u16 addr) { u32 ctrl = rd_regl (dev, CONTROL_0_REG); diff --git a/trunk/drivers/char/drm/r300_cmdbuf.c b/trunk/drivers/char/drm/r300_cmdbuf.c index 26bdf2ca59d7..d14477ba3679 100644 --- a/trunk/drivers/char/drm/r300_cmdbuf.c +++ b/trunk/drivers/char/drm/r300_cmdbuf.c @@ -538,6 +538,36 @@ static __inline__ int r300_emit_bitblt_multi(drm_radeon_private_t *dev_priv, return 0; } +static __inline__ int r300_emit_indx_buffer(drm_radeon_private_t *dev_priv, + drm_radeon_kcmd_buffer_t *cmdbuf) +{ + u32 *cmd = (u32 *) cmdbuf->buf; + int count, ret; + RING_LOCALS; + + count=(cmd[0]>>16) & 0x3fff; + + if ((cmd[1] & 0x8000ffff) != 0x80000810) { + DRM_ERROR("Invalid indx_buffer reg address %08X\n", cmd[1]); + return DRM_ERR(EINVAL); + } + ret = r300_check_offset(dev_priv, cmd[2]); + if (ret) { + DRM_ERROR("Invalid indx_buffer offset is %08X\n", cmd[2]); + return DRM_ERR(EINVAL); + } + + BEGIN_RING(count+2); + OUT_RING(cmd[0]); + OUT_RING_TABLE((int *)(cmdbuf->buf + 4), count + 1); + ADVANCE_RING(); + + cmdbuf->buf += (count+2)*4; + cmdbuf->bufsz -= (count+2)*4; + + return 0; +} + static __inline__ int r300_emit_raw_packet3(drm_radeon_private_t *dev_priv, drm_radeon_kcmd_buffer_t *cmdbuf) { @@ -578,10 +608,11 @@ static __inline__ int r300_emit_raw_packet3(drm_radeon_private_t *dev_priv, case RADEON_CNTL_BITBLT_MULTI: return r300_emit_bitblt_multi(dev_priv, cmdbuf); + case RADEON_CP_INDX_BUFFER: /* DRAW_INDX_2 without INDX_BUFFER seems to lock up the gpu */ + return r300_emit_indx_buffer(dev_priv, cmdbuf); case RADEON_CP_3D_DRAW_IMMD_2: /* triggers drawing using in-packet vertex data */ case RADEON_CP_3D_DRAW_VBUF_2: /* triggers drawing of vertex buffers setup elsewhere */ case RADEON_CP_3D_DRAW_INDX_2: /* triggers drawing using indices to vertex buffer */ - case RADEON_CP_INDX_BUFFER: /* DRAW_INDX_2 without INDX_BUFFER seems to lock up the gpu */ case RADEON_WAIT_FOR_IDLE: case RADEON_CP_NOP: /* these packets are safe */ diff --git a/trunk/drivers/char/drm/radeon_state.c b/trunk/drivers/char/drm/radeon_state.c index feac5f005d47..6e04fdd732ac 100644 --- a/trunk/drivers/char/drm/radeon_state.c +++ b/trunk/drivers/char/drm/radeon_state.c @@ -275,6 +275,8 @@ static __inline__ int radeon_check_and_fixup_packet3(drm_radeon_private_t * unsigned int *cmdsz) { u32 *cmd = (u32 *) cmdbuf->buf; + u32 offset, narrays; + int count, i, k; *cmdsz = 2 + ((cmd[0] & RADEON_CP_PACKET_COUNT_MASK) >> 16); @@ -288,10 +290,106 @@ static __inline__ int radeon_check_and_fixup_packet3(drm_radeon_private_t * return DRM_ERR(EINVAL); } - /* Check client state and fix it up if necessary */ - if (cmd[0] & 0x8000) { /* MSB of opcode: next DWORD GUI_CNTL */ - u32 offset; + switch(cmd[0] & 0xff00) { + /* XXX Are there old drivers needing other packets? */ + case RADEON_3D_DRAW_IMMD: + case RADEON_3D_DRAW_VBUF: + case RADEON_3D_DRAW_INDX: + case RADEON_WAIT_FOR_IDLE: + case RADEON_CP_NOP: + case RADEON_3D_CLEAR_ZMASK: +/* case RADEON_CP_NEXT_CHAR: + case RADEON_CP_PLY_NEXTSCAN: + case RADEON_CP_SET_SCISSORS: */ /* probably safe but will never need them? */ + /* these packets are safe */ + break; + + case RADEON_CP_3D_DRAW_IMMD_2: + case RADEON_CP_3D_DRAW_VBUF_2: + case RADEON_CP_3D_DRAW_INDX_2: + case RADEON_3D_CLEAR_HIZ: + /* safe but r200 only */ + if (dev_priv->microcode_version != UCODE_R200) { + DRM_ERROR("Invalid 3d packet for r100-class chip\n"); + return DRM_ERR(EINVAL); + } + break; + + case RADEON_3D_LOAD_VBPNTR: + count = (cmd[0] >> 16) & 0x3fff; + + if (count > 18) { /* 12 arrays max */ + DRM_ERROR("Too large payload in 3D_LOAD_VBPNTR (count=%d)\n", + count); + return DRM_ERR(EINVAL); + } + + /* carefully check packet contents */ + narrays = cmd[1] & ~0xc000; + k = 0; + i = 2; + while ((k < narrays) && (i < (count + 2))) { + i++; /* skip attribute field */ + if (radeon_check_and_fixup_offset(dev_priv, filp_priv, &cmd[i])) { + DRM_ERROR + ("Invalid offset (k=%d i=%d) in 3D_LOAD_VBPNTR packet.\n", + k, i); + return DRM_ERR(EINVAL); + } + k++; + i++; + if (k == narrays) + break; + /* have one more to process, they come in pairs */ + if (radeon_check_and_fixup_offset(dev_priv, filp_priv, &cmd[i])) { + DRM_ERROR + ("Invalid offset (k=%d i=%d) in 3D_LOAD_VBPNTR packet.\n", + k, i); + return DRM_ERR(EINVAL); + } + k++; + i++; + } + /* do the counts match what we expect ? */ + if ((k != narrays) || (i != (count + 2))) { + DRM_ERROR + ("Malformed 3D_LOAD_VBPNTR packet (k=%d i=%d narrays=%d count+1=%d).\n", + k, i, narrays, count + 1); + return DRM_ERR(EINVAL); + } + break; + + case RADEON_3D_RNDR_GEN_INDX_PRIM: + if (dev_priv->microcode_version != UCODE_R100) { + DRM_ERROR("Invalid 3d packet for r200-class chip\n"); + return DRM_ERR(EINVAL); + } + if (radeon_check_and_fixup_offset(dev_priv, filp_priv, &cmd[1])) { + DRM_ERROR("Invalid rndr_gen_indx offset\n"); + return DRM_ERR(EINVAL); + } + break; + + case RADEON_CP_INDX_BUFFER: + if (dev_priv->microcode_version != UCODE_R200) { + DRM_ERROR("Invalid 3d packet for r100-class chip\n"); + return DRM_ERR(EINVAL); + } + if ((cmd[1] & 0x8000ffff) != 0x80000810) { + DRM_ERROR("Invalid indx_buffer reg address %08X\n", cmd[1]); + return DRM_ERR(EINVAL); + } + if (radeon_check_and_fixup_offset(dev_priv, filp_priv, &cmd[2])) { + DRM_ERROR("Invalid indx_buffer offset is %08X\n", cmd[2]); + return DRM_ERR(EINVAL); + } + break; + + case RADEON_CNTL_HOSTDATA_BLT: + case RADEON_CNTL_PAINT_MULTI: + case RADEON_CNTL_BITBLT_MULTI: + /* MSB of opcode: next DWORD GUI_CNTL */ if (cmd[1] & (RADEON_GMC_SRC_PITCH_OFFSET_CNTL | RADEON_GMC_DST_PITCH_OFFSET_CNTL)) { offset = cmd[2] << 10; @@ -313,6 +411,11 @@ static __inline__ int radeon_check_and_fixup_packet3(drm_radeon_private_t * } cmd[3] = (cmd[3] & 0xffc00000) | offset >> 10; } + break; + + default: + DRM_ERROR("Invalid packet type %x\n", cmd[0] & 0xff00); + return DRM_ERR(EINVAL); } return 0; diff --git a/trunk/drivers/misc/Kconfig b/trunk/drivers/misc/Kconfig index 00db31c314e0..b6c045dc97b4 100644 --- a/trunk/drivers/misc/Kconfig +++ b/trunk/drivers/misc/Kconfig @@ -30,7 +30,6 @@ config IBM_ASM config SGI_IOC4 tristate "SGI IOC4 Base IO support" - depends on PCI ---help--- This option enables basic support for the IOC4 chip on certain SGI IO controller cards (IO9, IO10, and PCI-RT). This option diff --git a/trunk/drivers/misc/ioc4.c b/trunk/drivers/misc/ioc4.c index 79354bbbbd6a..1c3c14a3839c 100644 --- a/trunk/drivers/misc/ioc4.c +++ b/trunk/drivers/misc/ioc4.c @@ -32,7 +32,6 @@ #include #include #include -#include /*************** * Definitions * diff --git a/trunk/drivers/mmc/tifm_sd.c b/trunk/drivers/mmc/tifm_sd.c index 0fdc55b08a6d..2bacff60913d 100644 --- a/trunk/drivers/mmc/tifm_sd.c +++ b/trunk/drivers/mmc/tifm_sd.c @@ -14,7 +14,6 @@ #include #include #include -#include #define DRIVER_NAME "tifm_sd" #define DRIVER_VERSION "0.6" diff --git a/trunk/drivers/net/Kconfig b/trunk/drivers/net/Kconfig index e38846eb51fa..e2ed24918a58 100644 --- a/trunk/drivers/net/Kconfig +++ b/trunk/drivers/net/Kconfig @@ -2717,7 +2717,6 @@ config PPP_MPPE select CRYPTO select CRYPTO_SHA1 select CRYPTO_ARC4 - select CRYPTO_ECB ---help--- Support for the MPPE Encryption protocol, as employed by the Microsoft Point-to-Point Tunneling Protocol. diff --git a/trunk/drivers/net/wireless/bcm43xx/bcm43xx_dma.h b/trunk/drivers/net/wireless/bcm43xx/bcm43xx_dma.h index d1105e569a41..ea16078cfe98 100644 --- a/trunk/drivers/net/wireless/bcm43xx/bcm43xx_dma.h +++ b/trunk/drivers/net/wireless/bcm43xx/bcm43xx_dma.h @@ -4,7 +4,6 @@ #include #include #include -#include #include #include diff --git a/trunk/drivers/video/backlight/corgi_bl.c b/trunk/drivers/video/backlight/corgi_bl.c index d07ecb53c68b..2ebbfd95145f 100644 --- a/trunk/drivers/video/backlight/corgi_bl.c +++ b/trunk/drivers/video/backlight/corgi_bl.c @@ -111,7 +111,7 @@ static struct backlight_properties corgibl_data = { .update_status = corgibl_set_intensity, }; -static int corgibl_probe(struct platform_device *pdev) +static int __init corgibl_probe(struct platform_device *pdev) { struct corgibl_machinfo *machinfo = pdev->dev.platform_data; @@ -166,4 +166,4 @@ module_exit(corgibl_exit); MODULE_AUTHOR("Richard Purdie "); MODULE_DESCRIPTION("Corgi Backlight Driver"); -MODULE_LICENSE("GPL"); +MODULE_LICENSE("GPLv2"); diff --git a/trunk/fs/Kconfig b/trunk/fs/Kconfig index 133dcc8a4150..fee318e6f4bb 100644 --- a/trunk/fs/Kconfig +++ b/trunk/fs/Kconfig @@ -1777,7 +1777,6 @@ config RPCSEC_GSS_KRB5 select CRYPTO select CRYPTO_MD5 select CRYPTO_DES - select CRYPTO_CBC help Provides for secure RPC calls by means of a gss-api mechanism based on Kerberos V5. This is required for @@ -1796,7 +1795,6 @@ config RPCSEC_GSS_SPKM3 select CRYPTO_MD5 select CRYPTO_DES select CRYPTO_CAST5 - select CRYPTO_CBC help Provides for secure RPC calls by means of a gss-api mechanism based on the SPKM3 public-key mechanism. diff --git a/trunk/include/asm-arm/arch-pxa/irqs.h b/trunk/include/asm-arm/arch-pxa/irqs.h index 67ed43674c63..f3bc70eee35b 100644 --- a/trunk/include/asm-arm/arch-pxa/irqs.h +++ b/trunk/include/asm-arm/arch-pxa/irqs.h @@ -73,7 +73,7 @@ #define IRQ_TO_GPIO(i) (((i) < IRQ_GPIO(2)) ? ((i) - IRQ_GPIO0) : IRQ_TO_GPIO_2_x(i)) #if defined(CONFIG_PXA25x) -#define PXA_LAST_GPIO 84 +#define PXA_LAST_GPIO 80 #elif defined(CONFIG_PXA27x) #define PXA_LAST_GPIO 127 #endif diff --git a/trunk/include/asm-powerpc/asm-compat.h b/trunk/include/asm-powerpc/asm-compat.h index c89bd58ee283..8e64be0cc47d 100644 --- a/trunk/include/asm-powerpc/asm-compat.h +++ b/trunk/include/asm-powerpc/asm-compat.h @@ -14,58 +14,6 @@ # define ASM_CONST(x) __ASM_CONST(x) #endif - -/* - * Feature section common macros - * - * Note that the entries now contain offsets between the table entry - * and the code rather than absolute code pointers in order to be - * useable with the vdso shared library. There is also an assumption - * that values will be negative, that is, the fixup table has to be - * located after the code it fixes up. - */ -#ifdef CONFIG_PPC64 -#ifdef __powerpc64__ -/* 64 bits kernel, 64 bits code */ -#define MAKE_FTR_SECTION_ENTRY(msk, val, label, sect) \ -99: \ - .section sect,"a"; \ - .align 3; \ -98: \ - .llong msk; \ - .llong val; \ - .llong label##b-98b; \ - .llong 99b-98b; \ - .previous -#else /* __powerpc64__ */ -/* 64 bits kernel, 32 bits code (ie. vdso32) */ -#define MAKE_FTR_SECTION_ENTRY(msk, val, label, sect) \ -99: \ - .section sect,"a"; \ - .align 3; \ -98: \ - .llong msk; \ - .llong val; \ - .long 0xffffffff; \ - .long label##b-98b; \ - .long 0xffffffff; \ - .long 99b-98b; \ - .previous -#endif /* !__powerpc64__ */ -#else /* CONFIG_PPC64 */ -/* 32 bits kernel, 32 bits code */ -#define MAKE_FTR_SECTION_ENTRY(msk, val, label, sect) \ -99: \ - .section sect,"a"; \ - .align 2; \ -98: \ - .long msk; \ - .long val; \ - .long label##b-98b; \ - .long 99b-98b; \ - .previous -#endif /* !CONFIG_PPC64 */ - #ifdef __powerpc64__ /* operations for longs and pointers */ diff --git a/trunk/include/asm-powerpc/cputable.h b/trunk/include/asm-powerpc/cputable.h index a9a40149a7c0..12707ab9dc98 100644 --- a/trunk/include/asm-powerpc/cputable.h +++ b/trunk/include/asm-powerpc/cputable.h @@ -89,11 +89,8 @@ struct cpu_spec { extern struct cpu_spec *cur_cpu_spec; -extern unsigned int __start___ftr_fixup, __stop___ftr_fixup; - -extern struct cpu_spec *identify_cpu(unsigned long offset); -extern void do_feature_fixups(unsigned long value, void *fixup_start, - void *fixup_end); +extern void identify_cpu(unsigned long offset, unsigned long cpu); +extern void do_cpu_ftr_fixups(unsigned long offset); #endif /* __ASSEMBLY__ */ @@ -147,7 +144,6 @@ extern void do_feature_fixups(unsigned long value, void *fixup_start, #define CPU_FTR_CI_LARGE_PAGE LONG_ASM_CONST(0x0000100000000000) #define CPU_FTR_PAUSE_ZERO LONG_ASM_CONST(0x0000200000000000) #define CPU_FTR_PURR LONG_ASM_CONST(0x0000400000000000) -#define CPU_FTR_CELL_TB_BUG LONG_ASM_CONST(0x0000800000000000) #ifndef __ASSEMBLY__ @@ -336,7 +332,7 @@ extern void do_feature_fixups(unsigned long value, void *fixup_start, #define CPU_FTRS_CELL (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \ - CPU_FTR_PAUSE_ZERO | CPU_FTR_CI_LARGE_PAGE | CPU_FTR_CELL_TB_BUG) + CPU_FTR_PAUSE_ZERO | CPU_FTR_CI_LARGE_PAGE) #define CPU_FTRS_PA6T (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | \ CPU_FTR_ALTIVEC_COMP | CPU_FTR_CI_LARGE_PAGE | \ @@ -435,12 +431,29 @@ static inline int cpu_has_feature(unsigned long feature) #ifdef __ASSEMBLY__ -#define BEGIN_FTR_SECTION_NESTED(label) label: -#define BEGIN_FTR_SECTION BEGIN_FTR_SECTION_NESTED(97) -#define END_FTR_SECTION_NESTED(msk, val, label) \ - MAKE_FTR_SECTION_ENTRY(msk, val, label, __ftr_fixup) +#define BEGIN_FTR_SECTION 98: + +#ifndef __powerpc64__ #define END_FTR_SECTION(msk, val) \ - END_FTR_SECTION_NESTED(msk, val, 97) +99: \ + .section __ftr_fixup,"a"; \ + .align 2; \ + .long msk; \ + .long val; \ + .long 98b; \ + .long 99b; \ + .previous +#else /* __powerpc64__ */ +#define END_FTR_SECTION(msk, val) \ +99: \ + .section __ftr_fixup,"a"; \ + .align 3; \ + .llong msk; \ + .llong val; \ + .llong 98b; \ + .llong 99b; \ + .previous +#endif /* __powerpc64__ */ #define END_FTR_SECTION_IFSET(msk) END_FTR_SECTION((msk), (msk)) #define END_FTR_SECTION_IFCLR(msk) END_FTR_SECTION((msk), 0) diff --git a/trunk/include/asm-powerpc/firmware.h b/trunk/include/asm-powerpc/firmware.h index fdf9aff71150..1022737f4f34 100644 --- a/trunk/include/asm-powerpc/firmware.h +++ b/trunk/include/asm-powerpc/firmware.h @@ -96,16 +96,19 @@ extern void machine_check_fwnmi(void); /* This is true if we are using the firmware NMI handler (typically LPAR) */ extern int fwnmi_active; -extern unsigned int __start___fw_ftr_fixup, __stop___fw_ftr_fixup; - #else /* __ASSEMBLY__ */ -#define BEGIN_FW_FTR_SECTION_NESTED(label) label: -#define BEGIN_FW_FTR_SECTION BEGIN_FW_FTR_SECTION_NESTED(97) -#define END_FW_FTR_SECTION_NESTED(msk, val, label) \ - MAKE_FTR_SECTION_ENTRY(msk, val, label, __fw_ftr_fixup) +#define BEGIN_FW_FTR_SECTION 96: + #define END_FW_FTR_SECTION(msk, val) \ - END_FW_FTR_SECTION_NESTED(msk, val, 97) +97: \ + .section __fw_ftr_fixup,"a"; \ + .align 3; \ + .llong msk; \ + .llong val; \ + .llong 96b; \ + .llong 97b; \ + .previous #define END_FW_FTR_SECTION_IFSET(msk) END_FW_FTR_SECTION((msk), (msk)) #define END_FW_FTR_SECTION_IFCLR(msk) END_FW_FTR_SECTION((msk), 0) diff --git a/trunk/include/asm-powerpc/i8259.h b/trunk/include/asm-powerpc/i8259.h index db1362f8c603..78489fb8d140 100644 --- a/trunk/include/asm-powerpc/i8259.h +++ b/trunk/include/asm-powerpc/i8259.h @@ -7,7 +7,6 @@ #ifdef CONFIG_PPC_MERGE extern void i8259_init(struct device_node *node, unsigned long intack_addr); extern unsigned int i8259_irq(void); -extern struct irq_host *i8259_get_host(void); #else extern void i8259_init(unsigned long intack_addr, int offset); extern int i8259_irq(void); diff --git a/trunk/include/asm-powerpc/ppc_asm.h b/trunk/include/asm-powerpc/ppc_asm.h index fa083d8e4663..a940cfe040da 100644 --- a/trunk/include/asm-powerpc/ppc_asm.h +++ b/trunk/include/asm-powerpc/ppc_asm.h @@ -30,9 +30,9 @@ BEGIN_FTR_SECTION; \ mfspr ra,SPRN_PURR; /* get processor util. reg */ \ END_FTR_SECTION_IFSET(CPU_FTR_PURR); \ BEGIN_FTR_SECTION; \ - MFTB(ra); /* or get TB if no PURR */ \ + mftb ra; /* or get TB if no PURR */ \ END_FTR_SECTION_IFCLR(CPU_FTR_PURR); \ - ld rb,PACA_STARTPURR(r13); \ + ld rb,PACA_STARTPURR(r13); \ std ra,PACA_STARTPURR(r13); \ subf rb,rb,ra; /* subtract start value */ \ ld ra,PACA_USER_TIME(r13); \ @@ -45,9 +45,9 @@ BEGIN_FTR_SECTION; \ mfspr ra,SPRN_PURR; /* get processor util. reg */ \ END_FTR_SECTION_IFSET(CPU_FTR_PURR); \ BEGIN_FTR_SECTION; \ - MFTB(ra); /* or get TB if no PURR */ \ + mftb ra; /* or get TB if no PURR */ \ END_FTR_SECTION_IFCLR(CPU_FTR_PURR); \ - ld rb,PACA_STARTPURR(r13); \ + ld rb,PACA_STARTPURR(r13); \ std ra,PACA_STARTPURR(r13); \ subf rb,rb,ra; /* subtract start value */ \ ld ra,PACA_SYSTEM_TIME(r13); \ @@ -274,16 +274,6 @@ END_FTR_SECTION_IFSET(CPU_FTR_601) #define ISYNC_601 #endif -#ifdef CONFIG_PPC_CELL -#define MFTB(dest) \ -90: mftb dest; \ -BEGIN_FTR_SECTION_NESTED(96); \ - cmpwi dest,0; \ - beq- 90b; \ -END_FTR_SECTION_NESTED(CPU_FTR_CELL_TB_BUG, CPU_FTR_CELL_TB_BUG, 96) -#else -#define MFTB(dest) mftb dest -#endif #ifndef CONFIG_SMP #define TLBSYNC diff --git a/trunk/include/asm-powerpc/prom.h b/trunk/include/asm-powerpc/prom.h index ec11d44eaeb5..524629769336 100644 --- a/trunk/include/asm-powerpc/prom.h +++ b/trunk/include/asm-powerpc/prom.h @@ -134,7 +134,7 @@ extern struct device_node *of_find_all_nodes(struct device_node *prev); extern struct device_node *of_get_parent(const struct device_node *node); extern struct device_node *of_get_next_child(const struct device_node *node, struct device_node *prev); -extern struct property *of_find_property(const struct device_node *np, +extern struct property *of_find_property(struct device_node *np, const char *name, int *lenp); extern struct device_node *of_node_get(struct device_node *node); @@ -158,12 +158,10 @@ extern void of_detach_node(const struct device_node *); extern void finish_device_tree(void); extern void unflatten_device_tree(void); extern void early_init_devtree(void *); -extern int device_is_compatible(const struct device_node *device, - const char *); +extern int device_is_compatible(struct device_node *device, const char *); extern int machine_is_compatible(const char *compat); -extern const void *get_property(const struct device_node *node, - const char *name, - int *lenp); +extern const void *get_property(struct device_node *node, const char *name, + int *lenp); extern void print_properties(struct device_node *node); extern int prom_n_addr_cells(struct device_node* np); extern int prom_n_size_cells(struct device_node* np); diff --git a/trunk/include/asm-powerpc/reg.h b/trunk/include/asm-powerpc/reg.h index 6faae7b14d55..8fb96811b55d 100644 --- a/trunk/include/asm-powerpc/reg.h +++ b/trunk/include/asm-powerpc/reg.h @@ -591,7 +591,6 @@ #define PV_630 0x0040 #define PV_630p 0x0041 #define PV_970MP 0x0044 -#define PV_970GX 0x0045 #define PV_BE 0x0070 #define PV_PA6T 0x0090 @@ -619,35 +618,10 @@ : "=r" (rval)); rval;}) #define mtspr(rn, v) asm volatile("mtspr " __stringify(rn) ",%0" : : "r" (v)) -#ifdef __powerpc64__ -#ifdef CONFIG_PPC_CELL -#define mftb() ({unsigned long rval; \ - asm volatile( \ - "90: mftb %0;\n" \ - "97: cmpwi %0,0;\n" \ - " beq- 90b;\n" \ - "99:\n" \ - ".section __ftr_fixup,\"a\"\n" \ - ".align 3\n" \ - "98:\n" \ - " .llong %1\n" \ - " .llong %1\n" \ - " .llong 97b-98b\n" \ - " .llong 99b-98b\n" \ - ".previous" \ - : "=r" (rval) : "i" (CPU_FTR_CELL_TB_BUG)); rval;}) -#else #define mftb() ({unsigned long rval; \ asm volatile("mftb %0" : "=r" (rval)); rval;}) -#endif /* !CONFIG_PPC_CELL */ - -#else /* __powerpc64__ */ - #define mftbl() ({unsigned long rval; \ asm volatile("mftbl %0" : "=r" (rval)); rval;}) -#define mftbu() ({unsigned long rval; \ - asm volatile("mftbu %0" : "=r" (rval)); rval;}) -#endif /* !__powerpc64__ */ #define mttbl(v) asm volatile("mttbl %0":: "r"(v)) #define mttbu(v) asm volatile("mttbu %0":: "r"(v)) diff --git a/trunk/include/asm-powerpc/time.h b/trunk/include/asm-powerpc/time.h index a78285010d62..b051d4c88c3b 100644 --- a/trunk/include/asm-powerpc/time.h +++ b/trunk/include/asm-powerpc/time.h @@ -82,35 +82,30 @@ struct div_result { #define __USE_RTC() 0 #endif -#ifdef CONFIG_PPC64 - -/* For compatibility, get_tbl() is defined as get_tb() on ppc64 */ -#define get_tbl get_tb - -#else - +/* On ppc64 this gets us the whole timebase; on ppc32 just the lower half */ static inline unsigned long get_tbl(void) { -#if defined(CONFIG_403GCX) unsigned long tbl; + +#if defined(CONFIG_403GCX) asm volatile("mfspr %0, 0x3dd" : "=r" (tbl)); - return tbl; #else - return mftbl(); + asm volatile("mftb %0" : "=r" (tbl)); #endif + return tbl; } static inline unsigned int get_tbu(void) { -#ifdef CONFIG_403GCX unsigned int tbu; + +#if defined(CONFIG_403GCX) asm volatile("mfspr %0, 0x3dc" : "=r" (tbu)); - return tbu; #else - return mftbu(); + asm volatile("mftbu %0" : "=r" (tbu)); #endif + return tbu; } -#endif /* !CONFIG_PPC64 */ static inline unsigned int get_rtcl(void) { @@ -136,7 +131,7 @@ static inline u64 get_tb(void) { return mftb(); } -#else /* CONFIG_PPC64 */ +#else static inline u64 get_tb(void) { unsigned int tbhi, tblo, tbhi2; @@ -149,7 +144,7 @@ static inline u64 get_tb(void) return ((u64)tbhi << 32) | tblo; } -#endif /* !CONFIG_PPC64 */ +#endif static inline void set_tb(unsigned int upper, unsigned int lower) { diff --git a/trunk/include/asm-powerpc/timex.h b/trunk/include/asm-powerpc/timex.h index 92dedde761d1..3b9a8e786806 100644 --- a/trunk/include/asm-powerpc/timex.h +++ b/trunk/include/asm-powerpc/timex.h @@ -8,7 +8,6 @@ */ #include -#include #define CLOCK_TICK_RATE 1024000 /* Underlying HZ */ @@ -16,11 +15,13 @@ typedef unsigned long cycles_t; static inline cycles_t get_cycles(void) { -#ifdef __powerpc64__ - return mftb(); -#else cycles_t ret; +#ifdef __powerpc64__ + + __asm__ __volatile__("mftb %0" : "=r" (ret) : ); + +#else /* * For the "cycle" counter we use the timebase lower half. * Currently only used on SMP. @@ -29,19 +30,18 @@ static inline cycles_t get_cycles(void) ret = 0; __asm__ __volatile__( - "97: mftb %0\n" + "98: mftb %0\n" "99:\n" ".section __ftr_fixup,\"a\"\n" - ".align 2\n" - "98:\n" " .long %1\n" " .long 0\n" - " .long 97b-98b\n" - " .long 99b-98b\n" + " .long 98b\n" + " .long 99b\n" ".previous" : "=r" (ret) : "i" (CPU_FTR_601)); - return ret; #endif + + return ret; } #endif /* __KERNEL__ */ diff --git a/trunk/include/asm-x86_64/hw_irq.h b/trunk/include/asm-x86_64/hw_irq.h index 179cce755aa7..792dd52fcd70 100644 --- a/trunk/include/asm-x86_64/hw_irq.h +++ b/trunk/include/asm-x86_64/hw_irq.h @@ -76,8 +76,6 @@ #ifndef __ASSEMBLY__ typedef int vector_irq_t[NR_VECTORS]; DECLARE_PER_CPU(vector_irq_t, vector_irq); -extern void __setup_vector_irq(int cpu); -extern spinlock_t vector_lock; /* * Various low-level irq details needed by irq.c, process.c, diff --git a/trunk/net/dccp/Kconfig b/trunk/net/dccp/Kconfig index ef8919cca74b..e2a095d0fd80 100644 --- a/trunk/net/dccp/Kconfig +++ b/trunk/net/dccp/Kconfig @@ -4,15 +4,15 @@ menu "DCCP Configuration (EXPERIMENTAL)" config IP_DCCP tristate "The DCCP Protocol (EXPERIMENTAL)" ---help--- - Datagram Congestion Control Protocol (RFC 4340) + Datagram Congestion Control Protocol - From http://www.ietf.org/rfc/rfc4340.txt: + From draft-ietf-dccp-spec-11 . The Datagram Congestion Control Protocol (DCCP) is a transport protocol that implements bidirectional, unicast connections of congestion-controlled, unreliable datagrams. It should be suitable for use by applications such as streaming media, Internet telephony, - and on-line games. + and on-line games To compile this protocol support as a module, choose M here: the module will be called dccp. diff --git a/trunk/net/dccp/ackvec.c b/trunk/net/dccp/ackvec.c index f8208874ac7d..4d176d33983f 100644 --- a/trunk/net/dccp/ackvec.c +++ b/trunk/net/dccp/ackvec.c @@ -113,7 +113,7 @@ int dccp_insert_option_ackvec(struct sock *sk, struct sk_buff *skb) memcpy(to, from, len); /* - * From RFC 4340, A.2: + * From draft-ietf-dccp-spec-11.txt: * * For each acknowledgement it sends, the HC-Receiver will add an * acknowledgement record. ack_seqno will equal the HC-Receiver @@ -224,7 +224,7 @@ static inline int dccp_ackvec_set_buf_head_state(struct dccp_ackvec *av, } /* - * Implements the RFC 4340, Appendix A + * Implements the draft-ietf-dccp-spec-11.txt Appendix A */ int dccp_ackvec_add(struct dccp_ackvec *av, const struct sock *sk, const u64 ackno, const u8 state) @@ -237,7 +237,7 @@ int dccp_ackvec_add(struct dccp_ackvec *av, const struct sock *sk, * We may well decide to do buffer compression, etc, but for now lets * just drop. * - * From Appendix A.1.1 (`New Packets'): + * From Appendix A: * * Of course, the circular buffer may overflow, either when the * HC-Sender is sending data at a very high rate, when the @@ -274,9 +274,9 @@ int dccp_ackvec_add(struct dccp_ackvec *av, const struct sock *sk, /* * A.1.2. Old Packets * - * When a packet with Sequence Number S <= buf_ackno - * arrives, the HC-Receiver will scan the table for - * the byte corresponding to S. (Indexing structures + * When a packet with Sequence Number S arrives, and + * S <= buf_ackno, the HC-Receiver will scan the table + * for the byte corresponding to S. (Indexing structures * could reduce the complexity of this scan.) */ u64 delta = dccp_delta_seqno(ackno, av->dccpav_buf_ackno); diff --git a/trunk/net/dccp/ackvec.h b/trunk/net/dccp/ackvec.h index cf8f20ce23a9..2424effac7f6 100644 --- a/trunk/net/dccp/ackvec.h +++ b/trunk/net/dccp/ackvec.h @@ -28,7 +28,8 @@ /** struct dccp_ackvec - ack vector * - * This data structure is the one defined in RFC 4340, Appendix A. + * This data structure is the one defined in the DCCP draft + * Appendix A. * * @dccpav_buf_head - circular buffer head * @dccpav_buf_tail - circular buffer tail diff --git a/trunk/net/dccp/ccids/Kconfig b/trunk/net/dccp/ccids/Kconfig index 8533dabfb9f8..32752f750447 100644 --- a/trunk/net/dccp/ccids/Kconfig +++ b/trunk/net/dccp/ccids/Kconfig @@ -22,11 +22,11 @@ config IP_DCCP_CCID2 for lost packets, would prefer CCID 2 to CCID 3. On-line games may also prefer CCID 2. - CCID 2 is further described in RFC 4341, - http://www.ietf.org/rfc/rfc4341.txt + CCID 2 is further described in: + http://www.icir.org/kohler/dccp/draft-ietf-dccp-ccid2-10.txt - This text was extracted from RFC 4340 (sec. 10.1), - http://www.ietf.org/rfc/rfc4340.txt + This text was extracted from: + http://www.icir.org/kohler/dccp/draft-ietf-dccp-spec-13.txt If in doubt, say M. @@ -53,14 +53,15 @@ config IP_DCCP_CCID3 suitable than CCID 2 for applications such streaming media where a relatively smooth sending rate is of importance. - CCID 3 is further described in RFC 4342, - http://www.ietf.org/rfc/rfc4342.txt + CCID 3 is further described in: + + http://www.icir.org/kohler/dccp/draft-ietf-dccp-ccid3-11.txt. The TFRC congestion control algorithms were initially described in RFC 3448. - This text was extracted from RFC 4340 (sec. 10.2), - http://www.ietf.org/rfc/rfc4340.txt + This text was extracted from: + http://www.icir.org/kohler/dccp/draft-ietf-dccp-spec-13.txt If in doubt, say M. diff --git a/trunk/net/dccp/ccids/ccid2.c b/trunk/net/dccp/ccids/ccid2.c index 2fbb84bf4e26..2efb505aeb35 100644 --- a/trunk/net/dccp/ccids/ccid2.c +++ b/trunk/net/dccp/ccids/ccid2.c @@ -23,7 +23,7 @@ */ /* - * This implementation should follow RFC 4341 + * This implementation should follow: draft-ietf-dccp-ccid2-10.txt * * BUGS: * - sequence number wrapping diff --git a/trunk/net/dccp/ccids/ccid3.c b/trunk/net/dccp/ccids/ccid3.c index cec23ad286de..67d2dc0e7c67 100644 --- a/trunk/net/dccp/ccids/ccid3.c +++ b/trunk/net/dccp/ccids/ccid3.c @@ -379,7 +379,8 @@ static void ccid3_hc_tx_packet_sent(struct sock *sk, int more, int len) packet->dccphtx_seqno = dp->dccps_gss; /* * Check if win_count have changed - * Algorithm in "8.1. Window Counter Value" in RFC 4342. + * Algorithm in "8.1. Window Counter Valuer" in + * draft-ietf-dccp-ccid3-11.txt */ quarter_rtt = timeval_delta(&now, &hctx->ccid3hctx_t_last_win_count); if (likely(hctx->ccid3hctx_rtt > 8)) diff --git a/trunk/net/dccp/dccp.h b/trunk/net/dccp/dccp.h index 272e8584564e..0a21be437ed3 100644 --- a/trunk/net/dccp/dccp.h +++ b/trunk/net/dccp/dccp.h @@ -50,7 +50,7 @@ extern void dccp_time_wait(struct sock *sk, int state, int timeo); #define DCCP_TIMEWAIT_LEN (60 * HZ) /* how long to wait to destroy TIME-WAIT * state, about 60 seconds */ -/* RFC 1122, 4.2.3.1 initial RTO value */ +/* draft-ietf-dccp-spec-11.txt initial RTO value */ #define DCCP_TIMEOUT_INIT ((unsigned)(3 * HZ)) /* Maximal interval between probes for local resources. */ diff --git a/trunk/net/dccp/input.c b/trunk/net/dccp/input.c index 1d24881ac0ab..7f9dc6ac58c9 100644 --- a/trunk/net/dccp/input.c +++ b/trunk/net/dccp/input.c @@ -216,11 +216,11 @@ static int __dccp_rcv_established(struct sock *sk, struct sk_buff *skb, dccp_send_sync(sk, DCCP_SKB_CB(skb)->dccpd_seq, DCCP_PKT_SYNCACK); /* - * From RFC 4340, sec. 5.7 + * From the draft: * * As with DCCP-Ack packets, DCCP-Sync and DCCP-SyncAck packets * MAY have non-zero-length application data areas, whose - * contents receivers MUST ignore. + * contents * receivers MUST ignore. */ goto discard; } diff --git a/trunk/net/dccp/ipv4.c b/trunk/net/dccp/ipv4.c index e08e7688a263..aaaf4d09516b 100644 --- a/trunk/net/dccp/ipv4.c +++ b/trunk/net/dccp/ipv4.c @@ -183,7 +183,7 @@ static inline void dccp_do_pmtu_discovery(struct sock *sk, dccp_sync_mss(sk, mtu); /* - * From RFC 4340, sec. 14.1: + * From: draft-ietf-dccp-spec-11.txt * * DCCP-Sync packets are the best choice for upward * probing, since DCCP-Sync probes do not risk application @@ -733,7 +733,7 @@ static void dccp_v4_ctl_send_reset(struct sk_buff *rxskb) dccp_hdr_reset(skb)->dccph_reset_code = DCCP_SKB_CB(rxskb)->dccpd_reset_code; - /* See "8.3.1. Abnormal Termination" in RFC 4340 */ + /* See "8.3.1. Abnormal Termination" in draft-ietf-dccp-spec-11 */ seqno = 0; if (DCCP_SKB_CB(rxskb)->dccpd_ack_seq != DCCP_PKT_WITHOUT_ACK_SEQ) dccp_set_seqno(&seqno, DCCP_SKB_CB(rxskb)->dccpd_ack_seq + 1); diff --git a/trunk/net/dccp/ipv6.c b/trunk/net/dccp/ipv6.c index eb0ff7ab05ed..c8bf89bfb088 100644 --- a/trunk/net/dccp/ipv6.c +++ b/trunk/net/dccp/ipv6.c @@ -550,7 +550,7 @@ static void dccp_v6_ctl_send_reset(struct sk_buff *rxskb) dccp_hdr_reset(skb)->dccph_reset_code = DCCP_SKB_CB(rxskb)->dccpd_reset_code; - /* See "8.3.1. Abnormal Termination" in RFC 4340 */ + /* See "8.3.1. Abnormal Termination" in draft-ietf-dccp-spec-11 */ seqno = 0; if (DCCP_SKB_CB(rxskb)->dccpd_ack_seq != DCCP_PKT_WITHOUT_ACK_SEQ) dccp_set_seqno(&seqno, DCCP_SKB_CB(rxskb)->dccpd_ack_seq + 1); diff --git a/trunk/net/dccp/options.c b/trunk/net/dccp/options.c index fb0db1f7cd7b..07a34696ac97 100644 --- a/trunk/net/dccp/options.c +++ b/trunk/net/dccp/options.c @@ -215,7 +215,7 @@ int dccp_parse_options(struct sock *sk, struct sk_buff *skb) elapsed_time); break; /* - * From RFC 4340, sec. 10.3: + * From draft-ietf-dccp-spec-11.txt: * * Option numbers 128 through 191 are for * options sent from the HC-Sender to the diff --git a/trunk/net/ieee80211/Kconfig b/trunk/net/ieee80211/Kconfig index a64be6cdf078..f7e84e9d13ad 100644 --- a/trunk/net/ieee80211/Kconfig +++ b/trunk/net/ieee80211/Kconfig @@ -32,7 +32,6 @@ config IEEE80211_CRYPT_WEP depends on IEEE80211 select CRYPTO select CRYPTO_ARC4 - select CRYPTO_ECB select CRC32 ---help--- Include software based cipher suites in support of IEEE @@ -59,7 +58,6 @@ config IEEE80211_CRYPT_TKIP depends on IEEE80211 && NET_RADIO select CRYPTO select CRYPTO_MICHAEL_MIC - select CRYPTO_ECB select CRC32 ---help--- Include software based cipher suites in support of IEEE 802.11i diff --git a/trunk/net/ipv4/ipconfig.c b/trunk/net/ipv4/ipconfig.c index 955a07abb91d..f8ce84759159 100644 --- a/trunk/net/ipv4/ipconfig.c +++ b/trunk/net/ipv4/ipconfig.c @@ -420,7 +420,7 @@ ic_rarp_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt { struct arphdr *rarp; unsigned char *rarp_ptr; - u32 sip, tip; + unsigned long sip, tip; unsigned char *sha, *tha; /* s for "source", t for "target" */ struct ic_device *d; diff --git a/trunk/net/ipv6/netfilter/ip6_tables.c b/trunk/net/ipv6/netfilter/ip6_tables.c index 53bf977cca63..4ab368fa0b8f 100644 --- a/trunk/net/ipv6/netfilter/ip6_tables.c +++ b/trunk/net/ipv6/netfilter/ip6_tables.c @@ -111,7 +111,7 @@ ip6_packet_match(const struct sk_buff *skb, const char *outdev, const struct ip6t_ip6 *ip6info, unsigned int *protoff, - int *fragoff, int *hotdrop) + int *fragoff) { size_t i; unsigned long ret; @@ -169,11 +169,9 @@ ip6_packet_match(const struct sk_buff *skb, unsigned short _frag_off; protohdr = ipv6_find_hdr(skb, protoff, -1, &_frag_off); - if (protohdr < 0) { - if (_frag_off == 0) - *hotdrop = 1; + if (protohdr < 0) return 0; - } + *fragoff = _frag_off; dprintf("Packet protocol %hi ?= %s%hi.\n", @@ -292,7 +290,7 @@ ip6t_do_table(struct sk_buff **pskb, IP_NF_ASSERT(e); IP_NF_ASSERT(back); if (ip6_packet_match(*pskb, indev, outdev, &e->ipv6, - &protoff, &offset, &hotdrop)) { + &protoff, &offset)) { struct ip6t_entry_target *t; if (IP6T_MATCH_ITERATE(e, do_match, @@ -1440,9 +1438,6 @@ static void __exit ip6_tables_fini(void) * If target header is found, its offset is set in *offset and return protocol * number. Otherwise, return -1. * - * If the first fragment doesn't contain the final protocol header or - * NEXTHDR_NONE it is considered invalid. - * * Note that non-1st fragment is special case that "the protocol number * of last header" is "next header" field in Fragment header. In this case, * *offset is meaningless and fragment offset is stored in *fragoff if fragoff @@ -1466,12 +1461,12 @@ int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset, if ((!ipv6_ext_hdr(nexthdr)) || nexthdr == NEXTHDR_NONE) { if (target < 0) break; - return -ENOENT; + return -1; } hp = skb_header_pointer(skb, start, sizeof(_hdr), &_hdr); if (hp == NULL) - return -EBADMSG; + return -1; if (nexthdr == NEXTHDR_FRAGMENT) { unsigned short _frag_off, *fp; fp = skb_header_pointer(skb, @@ -1480,7 +1475,7 @@ int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset, sizeof(_frag_off), &_frag_off); if (fp == NULL) - return -EBADMSG; + return -1; _frag_off = ntohs(*fp) & ~0x7; if (_frag_off) { @@ -1491,7 +1486,7 @@ int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset, *fragoff = _frag_off; return hp->nexthdr; } - return -ENOENT; + return -1; } hdrlen = 8; } else if (nexthdr == NEXTHDR_AUTH) diff --git a/trunk/net/ipv6/netfilter/ip6t_ah.c b/trunk/net/ipv6/netfilter/ip6t_ah.c index 46486645eb75..ec1b1608156c 100644 --- a/trunk/net/ipv6/netfilter/ip6t_ah.c +++ b/trunk/net/ipv6/netfilter/ip6t_ah.c @@ -54,14 +54,9 @@ match(const struct sk_buff *skb, const struct ip6t_ah *ahinfo = matchinfo; unsigned int ptr; unsigned int hdrlen = 0; - int err; - err = ipv6_find_hdr(skb, &ptr, NEXTHDR_AUTH, NULL); - if (err < 0) { - if (err != -ENOENT) - *hotdrop = 1; + if (ipv6_find_hdr(skb, &ptr, NEXTHDR_AUTH, NULL) < 0) return 0; - } ah = skb_header_pointer(skb, ptr, sizeof(_ah), &_ah); if (ah == NULL) { diff --git a/trunk/net/ipv6/netfilter/ip6t_frag.c b/trunk/net/ipv6/netfilter/ip6t_frag.c index cd22eaaccdca..78d9c8b9e28a 100644 --- a/trunk/net/ipv6/netfilter/ip6t_frag.c +++ b/trunk/net/ipv6/netfilter/ip6t_frag.c @@ -52,14 +52,9 @@ match(const struct sk_buff *skb, struct frag_hdr _frag, *fh; const struct ip6t_frag *fraginfo = matchinfo; unsigned int ptr; - int err; - err = ipv6_find_hdr(skb, &ptr, NEXTHDR_FRAGMENT, NULL); - if (err < 0) { - if (err != -ENOENT) - *hotdrop = 1; + if (ipv6_find_hdr(skb, &ptr, NEXTHDR_FRAGMENT, NULL) < 0) return 0; - } fh = skb_header_pointer(skb, ptr, sizeof(_frag), &_frag); if (fh == NULL) { diff --git a/trunk/net/ipv6/netfilter/ip6t_hbh.c b/trunk/net/ipv6/netfilter/ip6t_hbh.c index 3f25babe0440..d32a205e3af2 100644 --- a/trunk/net/ipv6/netfilter/ip6t_hbh.c +++ b/trunk/net/ipv6/netfilter/ip6t_hbh.c @@ -65,14 +65,9 @@ match(const struct sk_buff *skb, u8 _opttype, *tp = NULL; u8 _optlen, *lp = NULL; unsigned int optlen; - int err; - err = ipv6_find_hdr(skb, &ptr, match->data, NULL); - if (err < 0) { - if (err != -ENOENT) - *hotdrop = 1; + if (ipv6_find_hdr(skb, &ptr, match->data, NULL) < 0) return 0; - } oh = skb_header_pointer(skb, ptr, sizeof(_optsh), &_optsh); if (oh == NULL) { diff --git a/trunk/net/ipv6/netfilter/ip6t_rt.c b/trunk/net/ipv6/netfilter/ip6t_rt.c index 54d7d14134fd..bcb2e168a5bc 100644 --- a/trunk/net/ipv6/netfilter/ip6t_rt.c +++ b/trunk/net/ipv6/netfilter/ip6t_rt.c @@ -58,14 +58,9 @@ match(const struct sk_buff *skb, unsigned int hdrlen = 0; unsigned int ret = 0; struct in6_addr *ap, _addr; - int err; - err = ipv6_find_hdr(skb, &ptr, NEXTHDR_ROUTING, NULL); - if (err < 0) { - if (err != -ENOENT) - *hotdrop = 1; + if (ipv6_find_hdr(skb, &ptr, NEXTHDR_ROUTING, NULL) < 0) return 0; - } rh = skb_header_pointer(skb, ptr, sizeof(_route), &_route); if (rh == NULL) { diff --git a/trunk/net/xfrm/xfrm_state.c b/trunk/net/xfrm/xfrm_state.c index 899de9ed22a6..84bbf8474f3e 100644 --- a/trunk/net/xfrm/xfrm_state.c +++ b/trunk/net/xfrm/xfrm_state.c @@ -505,14 +505,6 @@ __xfrm_state_locate(struct xfrm_state *x, int use_spi, int family) x->id.proto, family); } -static void xfrm_hash_grow_check(int have_hash_collision) -{ - if (have_hash_collision && - (xfrm_state_hmask + 1) < xfrm_state_hashmax && - xfrm_state_num > xfrm_state_hmask) - schedule_work(&xfrm_hash_work); -} - struct xfrm_state * xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr, struct flowi *fl, struct xfrm_tmpl *tmpl, @@ -606,8 +598,6 @@ xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr, x->lft.hard_add_expires_seconds = XFRM_ACQ_EXPIRES; x->timer.expires = jiffies + XFRM_ACQ_EXPIRES*HZ; add_timer(&x->timer); - xfrm_state_num++; - xfrm_hash_grow_check(x->bydst.next != NULL); } else { x->km.state = XFRM_STATE_DEAD; xfrm_state_put(x); @@ -624,6 +614,14 @@ xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr, return x; } +static void xfrm_hash_grow_check(int have_hash_collision) +{ + if (have_hash_collision && + (xfrm_state_hmask + 1) < xfrm_state_hashmax && + xfrm_state_num > xfrm_state_hmask) + schedule_work(&xfrm_hash_work); +} + static void __xfrm_state_insert(struct xfrm_state *x) { unsigned int h; diff --git a/trunk/scripts/mod/modpost.c b/trunk/scripts/mod/modpost.c index 2e1141623147..41277963f47a 100644 --- a/trunk/scripts/mod/modpost.c +++ b/trunk/scripts/mod/modpost.c @@ -921,8 +921,6 @@ static int init_section_ref_ok(const char *name) ".fixup", ".smp_locks", ".plt", /* seen on ARCH=um build on x86_64. Harmless */ - "__ftr_fixup", /* powerpc cpu feature fixup */ - "__fw_ftr_fixup", /* powerpc firmware feature fixup */ NULL }; /* Start of section names */ diff --git a/trunk/sound/pci/intel8x0.c b/trunk/sound/pci/intel8x0.c index 9c1bce7afa86..7f22dab07240 100644 --- a/trunk/sound/pci/intel8x0.c +++ b/trunk/sound/pci/intel8x0.c @@ -1961,12 +1961,6 @@ static struct ac97_quirk ac97_quirks[] __devinitdata = { .name = "Tyan Thunder K8WE", .type = AC97_TUNE_HP_ONLY }, - { - .subvendor = 0x10f7, - .subdevice = 0x834c, - .name = "Panasonic CF-R4", - .type = AC97_TUNE_HP_ONLY, - }, { .subvendor = 0x110a, .subdevice = 0x0056,