aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-06-10 14:47:26 -0400
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-06-10 14:47:26 -0400
commitf0cd91a68acdc9b49d7f6738b514a426da627649 (patch)
tree8ad73564015794197583b094217ae0a71e71e753
parent60eef25701d25e99c991dd0f4a9f3832a0c3ad3e (diff)
parent128e6ced247cda88f96fa9f2e4ba8b2c4a681560 (diff)
Merge ../linux-2.6
-rw-r--r--CREDITS19
-rw-r--r--Documentation/DMA-API.txt49
-rw-r--r--Documentation/DMA-mapping.txt22
-rw-r--r--Documentation/HOWTO3
-rw-r--r--Documentation/block/switching-sched.txt22
-rw-r--r--Documentation/cpu-freq/index.txt2
-rw-r--r--Documentation/devices.txt5
-rw-r--r--Documentation/dvb/get_dvb_firmware8
-rw-r--r--Documentation/feature-removal-schedule.txt14
-rw-r--r--Documentation/filesystems/sysfs.txt5
-rw-r--r--Documentation/firmware_class/README17
-rw-r--r--Documentation/firmware_class/firmware_sample_driver.c11
-rw-r--r--Documentation/i2c/busses/i2c-parport16
-rw-r--r--Documentation/memory-barriers.txt4
-rw-r--r--Documentation/networking/operstates.txt161
-rw-r--r--Documentation/networking/xfrm_sync.txt166
-rw-r--r--Documentation/pci.txt12
-rw-r--r--Documentation/power/video.txt2
-rw-r--r--Documentation/scsi/ChangeLog.megaraid25
-rw-r--r--Documentation/serial/driver31
-rw-r--r--Documentation/sound/alsa/Audiophile-Usb.txt81
-rw-r--r--Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl4
-rw-r--r--Documentation/spi/pxa2xx234
-rw-r--r--Documentation/spi/spi-summary34
-rw-r--r--Documentation/vm/hugetlbpage.txt11
-rw-r--r--Documentation/watchdog/watchdog-api.txt3
-rw-r--r--MAINTAINERS96
-rw-r--r--Makefile24
-rw-r--r--README23
-rw-r--r--arch/alpha/kernel/alpha_ksyms.c1
-rw-r--r--arch/alpha/kernel/process.c6
-rw-r--r--arch/alpha/kernel/smp.c14
-rw-r--r--arch/alpha/kernel/sys_titan.c2
-rw-r--r--arch/alpha/lib/strncpy.S8
-rw-r--r--arch/arm/Kconfig2
-rw-r--r--arch/arm/Kconfig.debug2
-rw-r--r--arch/arm/Makefile2
-rw-r--r--arch/arm/boot/compressed/misc.c4
-rw-r--r--arch/arm/common/scoop.c12
-rw-r--r--arch/arm/configs/collie_defconfig430
-rw-r--r--arch/arm/configs/ep93xx_defconfig79
-rw-r--r--arch/arm/configs/ixp2000_defconfig59
-rw-r--r--arch/arm/configs/ixp23xx_defconfig58
-rw-r--r--arch/arm/configs/versatile_defconfig390
-rw-r--r--arch/arm/kernel/Makefile2
-rw-r--r--arch/arm/kernel/asm-offsets.c8
-rw-r--r--arch/arm/kernel/dma-isa.c23
-rw-r--r--arch/arm/kernel/head-nommu.S6
-rw-r--r--arch/arm/kernel/head.S8
-rw-r--r--arch/arm/kernel/process.c37
-rw-r--r--arch/arm/kernel/setup.c8
-rw-r--r--arch/arm/lib/backtrace.S4
-rw-r--r--arch/arm/lib/div64.S4
-rw-r--r--arch/arm/mach-aaec2000/aaed2000.c7
-rw-r--r--arch/arm/mach-aaec2000/core.c5
-rw-r--r--arch/arm/mach-aaec2000/core.h1
-rw-r--r--arch/arm/mach-at91rm9200/devices.c12
-rw-r--r--arch/arm/mach-ep93xx/ts72xx.c8
-rw-r--r--arch/arm/mach-imx/generic.c52
-rw-r--r--arch/arm/mach-imx/mx1ads.c76
-rw-r--r--arch/arm/mach-ixp23xx/core.c18
-rw-r--r--arch/arm/mach-ixp4xx/Kconfig17
-rw-r--r--arch/arm/mach-ixp4xx/Makefile3
-rw-r--r--arch/arm/mach-ixp4xx/common.c2
-rw-r--r--arch/arm/mach-pxa/corgi_ssp.c9
-rw-r--r--arch/arm/mach-pxa/dma.c17
-rw-r--r--arch/arm/mach-pxa/mainstone.c6
-rw-r--r--arch/arm/mach-realview/realview_eb.c5
-rw-r--r--arch/arm/mach-s3c2410/Kconfig2
-rw-r--r--arch/arm/mach-s3c2410/common-smdk.c2
-rw-r--r--arch/arm/mach-s3c2410/s3c2440-clock.c2
-rw-r--r--arch/arm/mach-s3c2410/sleep.S6
-rw-r--r--arch/arm/mach-sa1100/irq.c16
-rw-r--r--arch/arm/mm/ioremap.c4
-rw-r--r--arch/arm/mm/mm-armv.c4
-rw-r--r--arch/arm/mm/proc-xsc3.S3
-rw-r--r--arch/arm/tools/mach-types89
-rw-r--r--arch/arm/vfp/vfpdouble.c2
-rw-r--r--arch/arm/vfp/vfpmodule.c4
-rw-r--r--arch/arm/vfp/vfpsingle.c2
-rw-r--r--arch/i386/Kconfig10
-rw-r--r--arch/i386/Kconfig.debug9
-rw-r--r--arch/i386/kernel/Makefile2
-rw-r--r--arch/i386/kernel/acpi/boot.c4
-rw-r--r--arch/i386/kernel/acpi/earlyquirk.c23
-rw-r--r--arch/i386/kernel/apic.c12
-rw-r--r--arch/i386/kernel/apm.c2
-rw-r--r--arch/i386/kernel/cpu/amd.c2
-rw-r--r--arch/i386/kernel/cpu/cpufreq/powernow-k8.c10
-rw-r--r--arch/i386/kernel/cpu/intel_cacheinfo.c2
-rw-r--r--arch/i386/kernel/cpuid.c2
-rw-r--r--arch/i386/kernel/io_apic.c5
-rw-r--r--arch/i386/kernel/kprobes.c39
-rw-r--r--arch/i386/kernel/mpparse.c12
-rw-r--r--arch/i386/kernel/msr.c2
-rw-r--r--arch/i386/kernel/ptrace.c7
-rw-r--r--arch/i386/kernel/setup.c17
-rw-r--r--arch/i386/kernel/smpboot.c4
-rw-r--r--arch/i386/kernel/syscall_table.S2
-rw-r--r--arch/i386/kernel/timers/timer_tsc.c4
-rw-r--r--arch/i386/kernel/traps.c4
-rw-r--r--arch/i386/kernel/vm86.c2
-rw-r--r--arch/i386/mach-generic/probe.c16
-rw-r--r--arch/i386/mach-voyager/voyager_cat.c1
-rw-r--r--arch/i386/mm/init.c2
-rw-r--r--arch/i386/oprofile/nmi_int.c7
-rw-r--r--arch/i386/pci/irq.c2
-rw-r--r--arch/i386/power/cpu.c2
-rw-r--r--arch/ia64/Kconfig2
-rw-r--r--arch/ia64/configs/sn2_defconfig78
-rw-r--r--arch/ia64/ia32/binfmt_elf32.c3
-rw-r--r--arch/ia64/ia32/ia32_entry.S2
-rw-r--r--arch/ia64/kernel/Makefile3
-rw-r--r--arch/ia64/kernel/entry.S2
-rw-r--r--arch/ia64/kernel/iosapic.c4
-rw-r--r--arch/ia64/kernel/irq.c1
-rw-r--r--arch/ia64/kernel/kprobes.c10
-rw-r--r--arch/ia64/kernel/mca.c10
-rw-r--r--arch/ia64/kernel/mca_drv.c54
-rw-r--r--arch/ia64/kernel/palinfo.c2
-rw-r--r--arch/ia64/kernel/ptrace.c4
-rw-r--r--arch/ia64/kernel/salinfo.c2
-rw-r--r--arch/ia64/kernel/topology.c9
-rw-r--r--arch/ia64/lib/memcpy_mck.S9
-rw-r--r--arch/ia64/mm/discontig.c66
-rw-r--r--arch/ia64/pci/pci.c3
-rw-r--r--arch/ia64/sn/kernel/sn2/sn_hwperf.c8
-rw-r--r--arch/ia64/sn/kernel/xpc_partition.c8
-rw-r--r--arch/ia64/sn/pci/tioce_provider.c6
-rw-r--r--arch/m32r/kernel/entry.S55
-rw-r--r--arch/m32r/kernel/process.c4
-rw-r--r--arch/m32r/kernel/signal.c4
-rw-r--r--arch/mips/Kconfig171
-rw-r--r--arch/mips/Kconfig.debug8
-rw-r--r--arch/mips/Makefile17
-rw-r--r--arch/mips/au1000/common/Makefile2
-rw-r--r--arch/mips/au1000/common/int-handler.S68
-rw-r--r--arch/mips/au1000/common/irq.c21
-rw-r--r--arch/mips/au1000/common/prom.c24
-rw-r--r--arch/mips/au1000/common/sleeper.S5
-rw-r--r--arch/mips/au1000/common/time.c1
-rw-r--r--arch/mips/cobalt/Makefile2
-rw-r--r--arch/mips/cobalt/int-handler.S25
-rw-r--r--arch/mips/cobalt/irq.c6
-rw-r--r--arch/mips/configs/atlas_defconfig83
-rw-r--r--arch/mips/configs/bigsur_defconfig64
-rw-r--r--arch/mips/configs/capcella_defconfig143
-rw-r--r--arch/mips/configs/cobalt_defconfig68
-rw-r--r--arch/mips/configs/db1000_defconfig70
-rw-r--r--arch/mips/configs/db1100_defconfig71
-rw-r--r--arch/mips/configs/db1200_defconfig68
-rw-r--r--arch/mips/configs/db1500_defconfig105
-rw-r--r--arch/mips/configs/db1550_defconfig73
-rw-r--r--arch/mips/configs/ddb5476_defconfig69
-rw-r--r--arch/mips/configs/ddb5477_defconfig67
-rw-r--r--arch/mips/configs/decstation_defconfig69
-rw-r--r--arch/mips/configs/e55_defconfig288
-rw-r--r--arch/mips/configs/ev64120_defconfig67
-rw-r--r--arch/mips/configs/ev96100_defconfig64
-rw-r--r--arch/mips/configs/ip22_defconfig77
-rw-r--r--arch/mips/configs/ip27_defconfig54
-rw-r--r--arch/mips/configs/ip32_defconfig67
-rw-r--r--arch/mips/configs/it8172_defconfig66
-rw-r--r--arch/mips/configs/ivr_defconfig67
-rw-r--r--arch/mips/configs/jaguar-atx_defconfig56
-rw-r--r--arch/mips/configs/jmr3927_defconfig72
-rw-r--r--arch/mips/configs/lasat200_defconfig69
-rw-r--r--arch/mips/configs/malta_defconfig86
-rw-r--r--arch/mips/configs/mipssim_defconfig64
-rw-r--r--arch/mips/configs/mpc30x_defconfig95
-rw-r--r--arch/mips/configs/ocelot_3_defconfig72
-rw-r--r--arch/mips/configs/ocelot_c_defconfig66
-rw-r--r--arch/mips/configs/ocelot_defconfig64
-rw-r--r--arch/mips/configs/ocelot_g_defconfig66
-rw-r--r--arch/mips/configs/pb1100_defconfig70
-rw-r--r--arch/mips/configs/pb1500_defconfig73
-rw-r--r--arch/mips/configs/pb1550_defconfig73
-rw-r--r--arch/mips/configs/pnx8550-jbs_defconfig76
-rw-r--r--arch/mips/configs/pnx8550-v2pci_defconfig85
-rw-r--r--arch/mips/configs/qemu_defconfig48
-rw-r--r--arch/mips/configs/rbhma4500_defconfig95
-rw-r--r--arch/mips/configs/rm200_defconfig121
-rw-r--r--arch/mips/configs/sb1250-swarm_defconfig63
-rw-r--r--arch/mips/configs/sead_defconfig50
-rw-r--r--arch/mips/configs/tb0226_defconfig218
-rw-r--r--arch/mips/configs/tb0229_defconfig282
-rw-r--r--arch/mips/configs/tb0287_defconfig1132
-rw-r--r--arch/mips/configs/workpad_defconfig185
-rw-r--r--arch/mips/configs/yosemite_defconfig54
-rw-r--r--arch/mips/ddb5xxx/ddb5074/Makefile2
-rw-r--r--arch/mips/ddb5xxx/ddb5074/int-handler.S120
-rw-r--r--arch/mips/ddb5xxx/ddb5074/irq.c26
-rw-r--r--arch/mips/ddb5xxx/ddb5476/Makefile2
-rw-r--r--arch/mips/ddb5xxx/ddb5476/dbg_io.c2
-rw-r--r--arch/mips/ddb5xxx/ddb5476/int-handler.S112
-rw-r--r--arch/mips/ddb5xxx/ddb5476/irq.c30
-rw-r--r--arch/mips/ddb5xxx/ddb5476/vrc5476_irq.c6
-rw-r--r--arch/mips/ddb5xxx/ddb5477/Makefile2
-rw-r--r--arch/mips/ddb5xxx/ddb5477/int-handler.S75
-rw-r--r--arch/mips/ddb5xxx/ddb5477/irq.c24
-rw-r--r--arch/mips/ddb5xxx/ddb5477/kgdb_io.c2
-rw-r--r--arch/mips/dec/boot/decstation.c3
-rw-r--r--arch/mips/dec/int-handler.S14
-rw-r--r--arch/mips/dec/setup.c3
-rw-r--r--arch/mips/defconfig77
-rw-r--r--arch/mips/galileo-boards/ev96100/Makefile2
-rw-r--r--arch/mips/galileo-boards/ev96100/int-handler.S33
-rw-r--r--arch/mips/galileo-boards/ev96100/irq.c19
-rw-r--r--arch/mips/gt64120/ev64120/Makefile2
-rw-r--r--arch/mips/gt64120/ev64120/int-handler.S113
-rw-r--r--arch/mips/gt64120/ev64120/irq.c27
-rw-r--r--arch/mips/gt64120/ev64120/serialGT.c2
-rw-r--r--arch/mips/gt64120/momenco_ocelot/Makefile2
-rw-r--r--arch/mips/gt64120/momenco_ocelot/dbg_io.c2
-rw-r--r--arch/mips/gt64120/momenco_ocelot/int-handler.S131
-rw-r--r--arch/mips/gt64120/momenco_ocelot/irq.c36
-rw-r--r--arch/mips/ite-boards/generic/Makefile2
-rw-r--r--arch/mips/ite-boards/generic/dbg_io.c2
-rw-r--r--arch/mips/ite-boards/generic/int-handler.S63
-rw-r--r--arch/mips/ite-boards/generic/irq.c18
-rw-r--r--arch/mips/ite-boards/generic/time.c1
-rw-r--r--arch/mips/ite-boards/ivr/init.c2
-rw-r--r--arch/mips/ite-boards/qed-4n-s01b/init.c2
-rw-r--r--arch/mips/jazz/Makefile2
-rw-r--r--arch/mips/jazz/int-handler.S282
-rw-r--r--arch/mips/jazz/irq.c78
-rw-r--r--arch/mips/jmr3927/common/rtc_ds1742.c60
-rw-r--r--arch/mips/jmr3927/rbhma3100/Makefile2
-rw-r--r--arch/mips/jmr3927/rbhma3100/int-handler.S74
-rw-r--r--arch/mips/jmr3927/rbhma3100/irq.c6
-rw-r--r--arch/mips/kernel/Makefile5
-rw-r--r--arch/mips/kernel/asm-offsets.c7
-rw-r--r--arch/mips/kernel/branch.c2
-rw-r--r--arch/mips/kernel/cpu-bugs64.c8
-rw-r--r--arch/mips/kernel/cpu-probe.c15
-rw-r--r--arch/mips/kernel/entry.S69
-rw-r--r--arch/mips/kernel/gdb-low.S32
-rw-r--r--arch/mips/kernel/gdb-stub.c61
-rw-r--r--arch/mips/kernel/genex.S43
-rw-r--r--arch/mips/kernel/head.S57
-rw-r--r--arch/mips/kernel/i8259.c4
-rw-r--r--arch/mips/kernel/irq-msc01.c9
-rw-r--r--arch/mips/kernel/irq.c18
-rw-r--r--arch/mips/kernel/kspd.c398
-rw-r--r--arch/mips/kernel/linux32.c74
-rw-r--r--arch/mips/kernel/mips-mt.c449
-rw-r--r--arch/mips/kernel/mips_ksyms.c15
-rw-r--r--arch/mips/kernel/module.c6
-rw-r--r--arch/mips/kernel/proc.c2
-rw-r--r--arch/mips/kernel/process.c21
-rw-r--r--arch/mips/kernel/ptrace.c18
-rw-r--r--arch/mips/kernel/ptrace32.c14
-rw-r--r--arch/mips/kernel/r4k_switch.S34
-rw-r--r--arch/mips/kernel/rtlx.c518
-rw-r--r--arch/mips/kernel/scall32-o32.S13
-rw-r--r--arch/mips/kernel/scall64-64.S2
-rw-r--r--arch/mips/kernel/scall64-n32.S2
-rw-r--r--arch/mips/kernel/scall64-o32.S4
-rw-r--r--arch/mips/kernel/setup.c23
-rw-r--r--arch/mips/kernel/signal-common.h30
-rw-r--r--arch/mips/kernel/smp-mt.c (renamed from arch/mips/kernel/smp_mt.c)44
-rw-r--r--arch/mips/kernel/smp.c17
-rw-r--r--arch/mips/kernel/smtc-asm.S130
-rw-r--r--arch/mips/kernel/smtc-proc.c93
-rw-r--r--arch/mips/kernel/smtc.c1322
-rw-r--r--arch/mips/kernel/syscall.c27
-rw-r--r--arch/mips/kernel/time.c3
-rw-r--r--arch/mips/kernel/traps.c232
-rw-r--r--arch/mips/kernel/vmlinux.lds.S22
-rw-r--r--arch/mips/kernel/vpe.c665
-rw-r--r--arch/mips/lasat/Makefile2
-rw-r--r--arch/mips/lasat/interrupt.c14
-rw-r--r--arch/mips/lasat/lasatIRQ.S69
-rw-r--r--arch/mips/math-emu/dp_fint.c4
-rw-r--r--arch/mips/math-emu/dp_flong.c4
-rw-r--r--arch/mips/math-emu/sp_fint.c4
-rw-r--r--arch/mips/math-emu/sp_flong.c4
-rw-r--r--arch/mips/mips-boards/atlas/atlas_int.c92
-rw-r--r--arch/mips/mips-boards/generic/Makefile4
-rw-r--r--arch/mips/mips-boards/generic/gdb_hook.c2
-rw-r--r--arch/mips/mips-boards/generic/init.c2
-rw-r--r--arch/mips/mips-boards/generic/memory.c9
-rw-r--r--arch/mips/mips-boards/generic/mipsIRQ.S155
-rw-r--r--arch/mips/mips-boards/generic/pci.c1
-rw-r--r--arch/mips/mips-boards/generic/time.c68
-rw-r--r--arch/mips/mips-boards/malta/Makefile1
-rw-r--r--arch/mips/mips-boards/malta/malta_int.c105
-rw-r--r--arch/mips/mips-boards/malta/malta_smp.c128
-rw-r--r--arch/mips/mips-boards/sead/sead_int.c86
-rw-r--r--arch/mips/mips-boards/sim/cmdline.c59
-rw-r--r--arch/mips/mips-boards/sim/sim_cmdline.c6
-rw-r--r--arch/mips/mips-boards/sim/sim_int.c64
-rw-r--r--arch/mips/mips-boards/sim/sim_irq.S4
-rw-r--r--arch/mips/mips-boards/sim/sim_mem.c9
-rw-r--r--arch/mips/mips-boards/sim/sim_smp.c14
-rw-r--r--arch/mips/mm/c-r3k.c5
-rw-r--r--arch/mips/mm/c-r4k.c98
-rw-r--r--arch/mips/mm/c-sb1.c1
-rw-r--r--arch/mips/mm/c-tx39.c7
-rw-r--r--arch/mips/mm/cache.c1
-rw-r--r--arch/mips/mm/fault.c13
-rw-r--r--arch/mips/mm/highmem.c2
-rw-r--r--arch/mips/mm/init.c50
-rw-r--r--arch/mips/mm/pg-r4k.c1
-rw-r--r--arch/mips/mm/sc-rm7k.c2
-rw-r--r--arch/mips/mm/tlb-r4k.c85
-rw-r--r--arch/mips/mm/tlbex.c89
-rw-r--r--arch/mips/momentum/jaguar_atx/Makefile2
-rw-r--r--arch/mips/momentum/jaguar_atx/dbg_io.c2
-rw-r--r--arch/mips/momentum/jaguar_atx/int-handler.S128
-rw-r--r--arch/mips/momentum/jaguar_atx/irq.c35
-rw-r--r--arch/mips/momentum/jaguar_atx/setup.c36
-rw-r--r--arch/mips/momentum/ocelot_3/Makefile2
-rw-r--r--arch/mips/momentum/ocelot_3/int-handler.S137
-rw-r--r--arch/mips/momentum/ocelot_3/irq.c38
-rw-r--r--arch/mips/momentum/ocelot_3/setup.c24
-rw-r--r--arch/mips/momentum/ocelot_c/Makefile2
-rw-r--r--arch/mips/momentum/ocelot_c/dbg_io.c2
-rw-r--r--arch/mips/momentum/ocelot_c/int-handler.S102
-rw-r--r--arch/mips/momentum/ocelot_c/irq.c30
-rw-r--r--arch/mips/momentum/ocelot_g/Makefile2
-rw-r--r--arch/mips/momentum/ocelot_g/dbg_io.c2
-rw-r--r--arch/mips/momentum/ocelot_g/int-handler.S131
-rw-r--r--arch/mips/momentum/ocelot_g/irq.c38
-rw-r--r--arch/mips/oprofile/common.c14
-rw-r--r--arch/mips/oprofile/op_model_mipsxx.c34
-rw-r--r--arch/mips/oprofile/op_model_rm9000.c2
-rw-r--r--arch/mips/philips/pnx8550/common/Makefile2
-rw-r--r--arch/mips/philips/pnx8550/common/int.c23
-rw-r--r--arch/mips/philips/pnx8550/common/mipsIRQ.S76
-rw-r--r--arch/mips/philips/pnx8550/common/platform.c1
-rw-r--r--arch/mips/pmc-sierra/yosemite/Makefile2
-rw-r--r--arch/mips/pmc-sierra/yosemite/irq-handler.S93
-rw-r--r--arch/mips/pmc-sierra/yosemite/irq.c33
-rw-r--r--arch/mips/qemu/Makefile2
-rw-r--r--arch/mips/qemu/q-int.S17
-rw-r--r--arch/mips/qemu/q-irq.c3
-rw-r--r--arch/mips/sgi-ip22/Makefile2
-rw-r--r--arch/mips/sgi-ip22/ip22-int.c59
-rw-r--r--arch/mips/sgi-ip22/ip22-irq.S118
-rw-r--r--arch/mips/sgi-ip27/Makefile2
-rw-r--r--arch/mips/sgi-ip27/TODO4
-rw-r--r--arch/mips/sgi-ip27/ip27-irq-glue.S45
-rw-r--r--arch/mips/sgi-ip27/ip27-irq.c27
-rw-r--r--arch/mips/sgi-ip27/ip27-timer.c2
-rw-r--r--arch/mips/sgi-ip32/Makefile2
-rw-r--r--arch/mips/sgi-ip32/ip32-irq-glue.S86
-rw-r--r--arch/mips/sgi-ip32/ip32-irq.c44
-rw-r--r--arch/mips/sibyte/bcm1480/Makefile2
-rw-r--r--arch/mips/sibyte/bcm1480/irq.c77
-rw-r--r--arch/mips/sibyte/bcm1480/irq_handler.S165
-rw-r--r--arch/mips/sibyte/sb1250/Makefile2
-rw-r--r--arch/mips/sibyte/sb1250/irq.c78
-rw-r--r--arch/mips/sibyte/sb1250/irq_handler.S147
-rw-r--r--arch/mips/sni/Makefile2
-rw-r--r--arch/mips/sni/int-handler.S106
-rw-r--r--arch/mips/sni/irq.c37
-rw-r--r--arch/mips/tx4927/common/Makefile2
-rw-r--r--arch/mips/tx4927/common/tx4927_irq.c30
-rw-r--r--arch/mips/tx4927/common/tx4927_irq_handler.S103
-rw-r--r--arch/mips/tx4938/common/Makefile2
-rw-r--r--arch/mips/tx4938/common/irq.c21
-rw-r--r--arch/mips/tx4938/common/irq_handler.S84
-rw-r--r--arch/mips/vr41xx/Kconfig13
-rw-r--r--arch/mips/vr41xx/common/Makefile2
-rw-r--r--arch/mips/vr41xx/common/int-handler.S114
-rw-r--r--arch/mips/vr41xx/common/irq.c29
-rw-r--r--arch/parisc/Kconfig31
-rw-r--r--arch/parisc/defconfig494
-rw-r--r--arch/parisc/kernel/asm-offsets.c3
-rw-r--r--arch/parisc/kernel/cache.c4
-rw-r--r--arch/parisc/kernel/entry.S36
-rw-r--r--arch/parisc/kernel/head.S15
-rw-r--r--arch/parisc/kernel/init_task.c10
-rw-r--r--arch/parisc/kernel/pacache.S25
-rw-r--r--arch/parisc/kernel/sys_parisc.c8
-rw-r--r--arch/parisc/kernel/syscall.S10
-rw-r--r--arch/parisc/kernel/syscall_table.S8
-rw-r--r--arch/parisc/kernel/vmlinux.lds.S54
-rw-r--r--arch/parisc/mm/fault.c2
-rw-r--r--arch/parisc/mm/init.c28
-rw-r--r--arch/parisc/mm/ioremap.c3
-rw-r--r--arch/powerpc/Kconfig6
-rw-r--r--arch/powerpc/Makefile4
-rw-r--r--arch/powerpc/configs/cell_defconfig40
-rw-r--r--arch/powerpc/configs/g5_defconfig58
-rw-r--r--arch/powerpc/configs/iseries_defconfig43
-rw-r--r--arch/powerpc/configs/pseries_defconfig54
-rw-r--r--arch/powerpc/kernel/Makefile2
-rw-r--r--arch/powerpc/kernel/asm-offsets.c1
-rw-r--r--arch/powerpc/kernel/cputable.c16
-rw-r--r--arch/powerpc/kernel/entry_32.S35
-rw-r--r--arch/powerpc/kernel/head_64.S49
-rw-r--r--arch/powerpc/kernel/idle.c4
-rw-r--r--arch/powerpc/kernel/idle_6xx.S63
-rw-r--r--arch/powerpc/kernel/idle_power4.S10
-rw-r--r--arch/powerpc/kernel/iommu.c36
-rw-r--r--arch/powerpc/kernel/irq.c36
-rw-r--r--arch/powerpc/kernel/kprobes.c28
-rw-r--r--arch/powerpc/kernel/module_64.c16
-rw-r--r--arch/powerpc/kernel/pci_iommu.c40
-rw-r--r--arch/powerpc/kernel/ppc_ksyms.c1
-rw-r--r--arch/powerpc/kernel/prom.c72
-rw-r--r--arch/powerpc/kernel/prom_init.c165
-rw-r--r--arch/powerpc/kernel/ptrace.c5
-rw-r--r--arch/powerpc/kernel/rtas-proc.c4
-rw-r--r--arch/powerpc/kernel/setup-common.c8
-rw-r--r--arch/powerpc/kernel/setup_64.c8
-rw-r--r--arch/powerpc/kernel/sysfs.c22
-rw-r--r--arch/powerpc/kernel/systbl.S22
-rw-r--r--arch/powerpc/kernel/vio.c6
-rw-r--r--arch/powerpc/mm/hugetlbpage.c295
-rw-r--r--arch/powerpc/mm/init_64.c7
-rw-r--r--arch/powerpc/mm/numa.c32
-rw-r--r--arch/powerpc/platforms/cell/Kconfig3
-rw-r--r--arch/powerpc/platforms/cell/setup.c78
-rw-r--r--arch/powerpc/platforms/cell/spu_base.c101
-rw-r--r--arch/powerpc/platforms/cell/spu_callbacks.c26
-rw-r--r--arch/powerpc/platforms/cell/spufs/switch.c2
-rw-r--r--arch/powerpc/platforms/chrp/chrp.h1
-rw-r--r--arch/powerpc/platforms/chrp/pci.c6
-rw-r--r--arch/powerpc/platforms/chrp/setup.c44
-rw-r--r--arch/powerpc/platforms/iseries/setup.c7
-rw-r--r--arch/powerpc/platforms/powermac/low_i2c.c90
-rw-r--r--arch/powerpc/platforms/powermac/pci.c2
-rw-r--r--arch/powerpc/platforms/powermac/pfunc_core.c18
-rw-r--r--arch/powerpc/platforms/powermac/setup.c12
-rw-r--r--arch/powerpc/platforms/pseries/eeh.c6
-rw-r--r--arch/powerpc/platforms/pseries/eeh_event.c8
-rw-r--r--arch/powerpc/platforms/pseries/rtasd.c2
-rw-r--r--arch/powerpc/platforms/pseries/setup.c2
-rw-r--r--arch/powerpc/sysdev/dart_iommu.c12
-rw-r--r--arch/ppc/kernel/asm-offsets.c1
-rw-r--r--arch/ppc/kernel/entry.S33
-rw-r--r--arch/ppc/kernel/head_8xx.S4
-rw-r--r--arch/ppc/kernel/ppc_ksyms.c1
-rw-r--r--arch/ppc/platforms/4xx/ocotea.c2
-rw-r--r--arch/ppc/platforms/mpc8272ads_setup.c116
-rw-r--r--arch/ppc/platforms/mpc866ads_setup.c140
-rw-r--r--arch/ppc/platforms/mpc885ads_setup.c131
-rw-r--r--arch/ppc/platforms/pq2ads.c31
-rw-r--r--arch/ppc/syslib/ibm440gx_common.c13
-rw-r--r--arch/ppc/syslib/ibm440gx_common.h4
-rw-r--r--arch/ppc/syslib/mpc8xx_devices.c25
-rw-r--r--arch/ppc/syslib/ppc_sys.c13
-rw-r--r--arch/ppc/syslib/pq2_devices.c16
-rw-r--r--arch/ppc/syslib/pq2_sys.c16
-rw-r--r--arch/s390/appldata/appldata_base.c2
-rw-r--r--arch/s390/kernel/compat_signal.c2
-rw-r--r--arch/s390/kernel/compat_wrapper.S50
-rw-r--r--arch/s390/kernel/ptrace.c5
-rw-r--r--arch/s390/kernel/signal.c5
-rw-r--r--arch/s390/kernel/syscalls.S6
-rw-r--r--arch/s390/kernel/time.c9
-rw-r--r--arch/s390/kernel/vmlinux.lds.S4
-rw-r--r--arch/s390/mm/extmem.c19
-rw-r--r--arch/sparc/kernel/ioport.c5
-rw-r--r--arch/sparc/kernel/module.c1
-rw-r--r--arch/sparc/kernel/sparc_ksyms.c13
-rw-r--r--arch/sparc/kernel/systbls.S7
-rw-r--r--arch/sparc64/Kconfig2
-rw-r--r--arch/sparc64/defconfig19
-rw-r--r--arch/sparc64/kernel/head.S30
-rw-r--r--arch/sparc64/kernel/kprobes.c12
-rw-r--r--arch/sparc64/kernel/module.c5
-rw-r--r--arch/sparc64/kernel/pci.c1
-rw-r--r--arch/sparc64/kernel/pci_iommu.c4
-rw-r--r--arch/sparc64/kernel/pci_sun4v.c4
-rw-r--r--arch/sparc64/kernel/ptrace.c5
-rw-r--r--arch/sparc64/kernel/setup.c23
-rw-r--r--arch/sparc64/kernel/smp.c16
-rw-r--r--arch/sparc64/kernel/sys32.S2
-rw-r--r--arch/sparc64/kernel/systbls.S16
-rw-r--r--arch/sparc64/lib/checksum.S5
-rw-r--r--arch/sparc64/lib/csum_copy.S5
-rw-r--r--arch/sparc64/mm/tlb.c5
-rw-r--r--arch/um/Kconfig14
-rw-r--r--arch/um/Kconfig.i38619
-rw-r--r--arch/um/Makefile19
-rw-r--r--arch/um/Makefile-i3864
-rw-r--r--arch/um/defconfig240
-rw-r--r--arch/um/include/kern_util.h13
-rw-r--r--arch/um/include/longjmp.h4
-rw-r--r--arch/um/include/sysdep-i386/kernel-offsets.h2
-rw-r--r--arch/um/include/sysdep-x86_64/kernel-offsets.h2
-rw-r--r--arch/um/kernel/irq.c93
-rw-r--r--arch/um/kernel/physmem.c2
-rw-r--r--arch/um/kernel/ptrace.c6
-rw-r--r--arch/um/kernel/skas/Makefile10
-rw-r--r--arch/um/kernel/time_kern.c12
-rw-r--r--arch/um/os-Linux/file.c2
-rw-r--r--arch/um/os-Linux/irq.c47
-rw-r--r--arch/um/os-Linux/main.c32
-rw-r--r--arch/um/os-Linux/mem.c118
-rw-r--r--arch/um/os-Linux/process.c25
-rw-r--r--arch/um/os-Linux/skas/process.c42
-rw-r--r--arch/um/os-Linux/start_up.c24
-rw-r--r--arch/um/os-Linux/sys-i386/registers.c4
-rw-r--r--arch/um/os-Linux/sys-x86_64/registers.c4
-rw-r--r--arch/um/os-Linux/time.c10
-rw-r--r--arch/um/os-Linux/trap.c4
-rw-r--r--arch/um/os-Linux/uaccess.c4
-rw-r--r--arch/um/os-Linux/umid.c4
-rw-r--r--arch/um/os-Linux/user_syms.c7
-rw-r--r--arch/um/os-Linux/util.c2
-rw-r--r--arch/um/scripts/Makefile.rules12
-rw-r--r--arch/um/sys-i386/Makefile13
-rw-r--r--arch/um/sys-i386/signal.c6
-rw-r--r--arch/um/sys-i386/stub_segv.c4
-rw-r--r--arch/um/sys-i386/syscalls.c9
-rw-r--r--arch/um/sys-x86_64/Makefile13
-rw-r--r--arch/um/sys-x86_64/signal.c24
-rw-r--r--arch/um/sys-x86_64/stub_segv.c10
-rw-r--r--arch/um/sys-x86_64/syscalls.c2
-rw-r--r--arch/x86_64/defconfig19
-rw-r--r--arch/x86_64/ia32/Makefile4
-rw-r--r--arch/x86_64/ia32/ia32_binfmt.c4
-rw-r--r--arch/x86_64/ia32/ia32entry.S2
-rw-r--r--arch/x86_64/kernel/Makefile4
-rw-r--r--arch/x86_64/kernel/e820.c8
-rw-r--r--arch/x86_64/kernel/entry.S7
-rw-r--r--arch/x86_64/kernel/io_apic.c35
-rw-r--r--arch/x86_64/kernel/kprobes.c16
-rw-r--r--arch/x86_64/kernel/mce.c2
-rw-r--r--arch/x86_64/kernel/mce_amd.c2
-rw-r--r--arch/x86_64/kernel/mpparse.c12
-rw-r--r--arch/x86_64/kernel/pci-dma.c4
-rw-r--r--arch/x86_64/kernel/pci-gart.c18
-rw-r--r--arch/x86_64/kernel/pci-nommu.c7
-rw-r--r--arch/x86_64/kernel/pmtimer.c2
-rw-r--r--arch/x86_64/kernel/process.c4
-rw-r--r--arch/x86_64/kernel/ptrace.c6
-rw-r--r--arch/x86_64/kernel/setup.c55
-rw-r--r--arch/x86_64/kernel/traps.c38
-rw-r--r--arch/x86_64/mm/numa.c2
-rw-r--r--arch/x86_64/mm/srat.c19
-rw-r--r--block/as-iosched.c18
-rw-r--r--block/cfq-iosched.c134
-rw-r--r--block/deadline-iosched.c13
-rw-r--r--block/elevator.c65
-rw-r--r--block/ll_rw_blk.c30
-rw-r--r--block/noop-iosched.c7
-rw-r--r--drivers/Kconfig2
-rw-r--r--drivers/base/bus.c5
-rw-r--r--drivers/base/class.c45
-rw-r--r--drivers/base/dd.c2
-rw-r--r--drivers/base/firmware_class.c39
-rw-r--r--drivers/base/power/suspend.c17
-rw-r--r--drivers/base/topology.c2
-rw-r--r--drivers/block/cciss.c96
-rw-r--r--drivers/block/floppy.c2
-rw-r--r--drivers/block/ub.c18
-rw-r--r--drivers/char/Kconfig2
-rw-r--r--drivers/char/agp/Kconfig2
-rw-r--r--drivers/char/agp/amd64-agp.c3
-rw-r--r--drivers/char/agp/efficeon-agp.c8
-rw-r--r--drivers/char/agp/via-agp.c7
-rw-r--r--drivers/char/cs5535_gpio.c5
-rw-r--r--drivers/char/drm/drmP.h5
-rw-r--r--drivers/char/drm/drm_agpsupport.c2
-rw-r--r--drivers/char/drm/drm_bufs.c5
-rw-r--r--drivers/char/drm/drm_drv.c4
-rw-r--r--drivers/char/drm/drm_memory.c134
-rw-r--r--drivers/char/drm/drm_memory.h128
-rw-r--r--drivers/char/drm/drm_memory_debug.h2
-rw-r--r--drivers/char/drm/drm_pci.c1
-rw-r--r--drivers/char/drm/drm_stub.c2
-rw-r--r--drivers/char/drm/r300_cmdbuf.c2
-rw-r--r--drivers/char/drm/via_irq.c12
-rw-r--r--drivers/char/genrtc.c8
-rw-r--r--drivers/char/ipmi/ipmi_bt_sm.c2
-rw-r--r--drivers/char/ipmi/ipmi_si_intf.c42
-rw-r--r--drivers/char/keyboard.c38
-rw-r--r--drivers/char/mem.c14
-rw-r--r--drivers/char/mwave/mwavedd.c2
-rw-r--r--drivers/char/pcmcia/cm4000_cs.c12
-rw-r--r--drivers/char/pcmcia/cm4040_cs.c11
-rw-r--r--drivers/char/rio/host.h9
-rw-r--r--drivers/char/rio/rioboot.c1
-rw-r--r--drivers/char/rio/rioctrl.c43
-rw-r--r--drivers/char/rio/rioioctl.h56
-rw-r--r--drivers/char/snsc.c3
-rw-r--r--drivers/char/sonypi.c3
-rw-r--r--drivers/char/tipar.c2
-rw-r--r--drivers/char/tpm/Kconfig11
-rw-r--r--drivers/char/tpm/Makefile1
-rw-r--r--drivers/char/tpm/tpm.c786
-rw-r--r--drivers/char/tpm/tpm.h39
-rw-r--r--drivers/char/tpm/tpm_atmel.c58
-rw-r--r--drivers/char/tpm/tpm_atmel.h25
-rw-r--r--drivers/char/tpm/tpm_bios.c137
-rw-r--r--drivers/char/tpm/tpm_infineon.c61
-rw-r--r--drivers/char/tpm/tpm_nsc.c49
-rw-r--r--drivers/char/tpm/tpm_tis.c665
-rw-r--r--drivers/char/tty_io.c12
-rw-r--r--drivers/char/vt.c8
-rw-r--r--drivers/char/watchdog/i8xx_tco.c16
-rw-r--r--drivers/char/watchdog/s3c2410_wdt.c6
-rw-r--r--drivers/char/watchdog/sc1200wdt.c2
-rw-r--r--drivers/cpufreq/Kconfig2
-rw-r--r--drivers/cpufreq/cpufreq.c27
-rw-r--r--drivers/cpufreq/cpufreq_conservative.c6
-rw-r--r--drivers/cpufreq/cpufreq_ondemand.c28
-rw-r--r--drivers/edac/e752x_edac.c17
-rw-r--r--drivers/firmware/Makefile3
-rw-r--r--drivers/firmware/dmi_scan.c (renamed from arch/i386/kernel/dmi_scan.c)12
-rw-r--r--drivers/hwmon/w83792d.c5
-rw-r--r--drivers/i2c/busses/Kconfig5
-rw-r--r--drivers/i2c/busses/i2c-i801.c5
-rw-r--r--drivers/i2c/busses/i2c-parport-light.c9
-rw-r--r--drivers/i2c/busses/i2c-parport.c9
-rw-r--r--drivers/i2c/busses/i2c-parport.h2
-rw-r--r--drivers/i2c/busses/i2c-sis96x.c8
-rw-r--r--drivers/i2c/busses/scx200_acb.c18
-rw-r--r--drivers/i2c/chips/ds1374.c16
-rw-r--r--drivers/i2c/chips/m41t00.c24
-rw-r--r--drivers/ide/legacy/ide-cs.c1
-rw-r--r--drivers/ide/pci/alim15x3.c2
-rw-r--r--drivers/ide/pci/atiixp.c1
-rw-r--r--drivers/ide/pci/pdc202xx_old.c2
-rw-r--r--drivers/ide/pci/sgiioc4.c16
-rw-r--r--drivers/ide/ppc/pmac.c2
-rw-r--r--drivers/ide/setup-pci.c13
-rw-r--r--drivers/ieee1394/ohci1394.c2
-rw-r--r--drivers/ieee1394/sbp2.c211
-rw-r--r--drivers/ieee1394/sbp2.h18
-rw-r--r--drivers/infiniband/core/cm.c12
-rw-r--r--drivers/infiniband/core/mad.c52
-rw-r--r--drivers/infiniband/core/mad_priv.h5
-rw-r--r--drivers/infiniband/core/mad_rmpp.c20
-rw-r--r--drivers/infiniband/core/sysfs.c2
-rw-r--r--drivers/infiniband/core/ucm.c12
-rw-r--r--drivers/infiniband/core/uverbs_mem.c4
-rw-r--r--drivers/infiniband/hw/ipath/ipath_debug.h15
-rw-r--r--drivers/infiniband/hw/ipath/ipath_diag.c15
-rw-r--r--drivers/infiniband/hw/ipath/ipath_driver.c49
-rw-r--r--drivers/infiniband/hw/ipath/ipath_eeprom.c7
-rw-r--r--drivers/infiniband/hw/ipath/ipath_file_ops.c6
-rw-r--r--drivers/infiniband/hw/ipath/ipath_ht400.c21
-rw-r--r--drivers/infiniband/hw/ipath/ipath_init_chip.c37
-rw-r--r--drivers/infiniband/hw/ipath/ipath_intr.c25
-rw-r--r--drivers/infiniband/hw/ipath/ipath_kernel.h13
-rw-r--r--drivers/infiniband/hw/ipath/ipath_keys.c6
-rw-r--r--drivers/infiniband/hw/ipath/ipath_layer.c18
-rw-r--r--drivers/infiniband/hw/ipath/ipath_pe800.c16
-rw-r--r--drivers/infiniband/hw/ipath/ipath_qp.c180
-rw-r--r--drivers/infiniband/hw/ipath/ipath_rc.c15
-rw-r--r--drivers/infiniband/hw/ipath/ipath_registers.h31
-rw-r--r--drivers/infiniband/hw/ipath/ipath_ruc.c17
-rw-r--r--drivers/infiniband/hw/ipath/ipath_sysfs.c14
-rw-r--r--drivers/infiniband/hw/ipath/ipath_ud.c6
-rw-r--r--drivers/infiniband/hw/ipath/ipath_verbs.c160
-rw-r--r--drivers/infiniband/hw/ipath/ipath_verbs.h8
-rw-r--r--drivers/infiniband/hw/ipath/ips_common.h2
-rw-r--r--drivers/infiniband/hw/mthca/mthca_cmd.c2
-rw-r--r--drivers/infiniband/hw/mthca/mthca_cq.c41
-rw-r--r--drivers/infiniband/hw/mthca/mthca_dev.h2
-rw-r--r--drivers/infiniband/hw/mthca/mthca_mad.c2
-rw-r--r--drivers/infiniband/hw/mthca/mthca_mr.c15
-rw-r--r--drivers/infiniband/hw/mthca/mthca_provider.c2
-rw-r--r--drivers/infiniband/hw/mthca/mthca_provider.h22
-rw-r--r--drivers/infiniband/hw/mthca/mthca_qp.c66
-rw-r--r--drivers/infiniband/hw/mthca/mthca_srq.c64
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_ib.c1
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_vlan.c4
-rw-r--r--drivers/infiniband/ulp/srp/ib_srp.c199
-rw-r--r--drivers/infiniband/ulp/srp/ib_srp.h4
-rw-r--r--drivers/input/evdev.c21
-rw-r--r--drivers/input/input.c11
-rw-r--r--drivers/input/joystick/sidewinder.c11
-rw-r--r--drivers/input/keyboard/corgikbd.c12
-rw-r--r--drivers/input/keyboard/hil_kbd.c2
-rw-r--r--drivers/input/keyboard/spitzkbd.c16
-rw-r--r--drivers/input/misc/wistron_btns.c49
-rw-r--r--drivers/input/mouse/alps.c4
-rw-r--r--drivers/input/mouse/lifebook.c24
-rw-r--r--drivers/input/mouse/logips2pp.c6
-rw-r--r--drivers/input/mouse/psmouse-base.c4
-rw-r--r--drivers/input/serio/i8042-io.h4
-rw-r--r--drivers/input/touchscreen/ads7846.c445
-rw-r--r--drivers/input/touchscreen/corgi_ts.c2
-rw-r--r--drivers/isdn/capi/capi.c1
-rw-r--r--drivers/isdn/gigaset/bas-gigaset.c597
-rw-r--r--drivers/isdn/gigaset/common.c3
-rw-r--r--drivers/isdn/gigaset/ev-layer.c3
-rw-r--r--drivers/isdn/gigaset/gigaset.h7
-rw-r--r--drivers/isdn/gigaset/i4l.c2
-rw-r--r--drivers/isdn/gigaset/isocdata.c10
-rw-r--r--drivers/isdn/gigaset/usb-gigaset.c4
-rw-r--r--drivers/isdn/i4l/isdn_tty.c2
-rw-r--r--drivers/leds/Kconfig7
-rw-r--r--drivers/leds/led-class.c9
-rw-r--r--drivers/leds/ledtrig-timer.c17
-rw-r--r--drivers/macintosh/therm_adt746x.c4
-rw-r--r--drivers/md/md.c42
-rw-r--r--drivers/md/raid0.c5
-rw-r--r--drivers/md/raid1.c29
-rw-r--r--drivers/md/raid10.c46
-rw-r--r--drivers/media/Kconfig45
-rw-r--r--drivers/media/common/Kconfig3
-rw-r--r--drivers/media/dvb/Kconfig10
-rw-r--r--drivers/media/dvb/b2c2/Kconfig6
-rw-r--r--drivers/media/dvb/bt8xx/Kconfig3
-rw-r--r--drivers/media/dvb/bt8xx/dvb-bt8xx.c6
-rw-r--r--drivers/media/dvb/cinergyT2/cinergyT2.c5
-rw-r--r--drivers/media/dvb/dvb-core/dvb_frontend.c12
-rw-r--r--drivers/media/dvb/dvb-core/dvbdev.c4
-rw-r--r--drivers/media/dvb/dvb-usb/Kconfig2
-rw-r--r--drivers/media/dvb/dvb-usb/cxusb.c17
-rw-r--r--drivers/media/dvb/frontends/cx24123.c565
-rw-r--r--drivers/media/dvb/frontends/dvb-pll.c4
-rw-r--r--drivers/media/dvb/pluto2/Kconfig3
-rw-r--r--drivers/media/dvb/pluto2/Makefile2
-rw-r--r--drivers/media/dvb/ttpci/Kconfig12
-rw-r--r--drivers/media/dvb/ttpci/budget-av.c6
-rw-r--r--drivers/media/dvb/ttpci/budget-ci.c105
-rw-r--r--drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c6
-rw-r--r--drivers/media/radio/Kconfig30
-rw-r--r--drivers/media/video/Kconfig79
-rw-r--r--drivers/media/video/Makefile10
-rw-r--r--drivers/media/video/bt8xx/Kconfig2
-rw-r--r--drivers/media/video/bt8xx/Makefile2
-rw-r--r--drivers/media/video/bt8xx/bttv-cards.c4
-rw-r--r--drivers/media/video/bt8xx/bttv-risc.c14
-rw-r--r--drivers/media/video/cx25840/cx25840-firmware.c49
-rw-r--r--drivers/media/video/cx88/cx88-alsa.c2
-rw-r--r--drivers/media/video/cx88/cx88-cards.c2
-rw-r--r--drivers/media/video/cx88/cx88-core.c16
-rw-r--r--drivers/media/video/cx88/cx88-dvb.c2
-rw-r--r--drivers/media/video/cx88/cx88-video.c2
-rw-r--r--drivers/media/video/em28xx/Kconfig2
-rw-r--r--drivers/media/video/em28xx/em28xx-video.c10
-rw-r--r--drivers/media/video/et61x251/Kconfig2
-rw-r--r--drivers/media/video/pwc/Kconfig2
-rw-r--r--drivers/media/video/pwc/Makefile17
-rw-r--r--drivers/media/video/saa7127.c1
-rw-r--r--drivers/media/video/saa7134/saa7134-cards.c1
-rw-r--r--drivers/media/video/saa7134/saa7134-core.c6
-rw-r--r--drivers/media/video/saa7134/saa7134-video.c2
-rw-r--r--drivers/media/video/sn9c102/Kconfig2
-rw-r--r--drivers/media/video/tuner-types.c4
-rw-r--r--drivers/media/video/tveeprom.c2
-rw-r--r--drivers/media/video/usbvideo/Kconfig6
-rw-r--r--drivers/media/video/vivi.c5
-rw-r--r--drivers/media/video/zc0301/Kconfig2
-rw-r--r--drivers/message/fusion/mptbase.c90
-rw-r--r--drivers/message/fusion/mptbase.h10
-rw-r--r--drivers/message/fusion/mptfc.c134
-rw-r--r--drivers/message/fusion/mptsas.c99
-rw-r--r--drivers/message/fusion/mptscsih.c50
-rw-r--r--drivers/message/fusion/mptspi.c68
-rw-r--r--drivers/mmc/Kconfig2
-rw-r--r--drivers/mmc/at91_mci.c3
-rw-r--r--drivers/mmc/au1xmmc.c10
-rw-r--r--drivers/mmc/imxmmc.c84
-rw-r--r--drivers/mmc/mmc.c63
-rw-r--r--drivers/mmc/mmc_block.c9
-rw-r--r--drivers/mmc/mmci.c3
-rw-r--r--drivers/mmc/pxamci.c27
-rw-r--r--drivers/mmc/sdhci.c4
-rw-r--r--drivers/mmc/wbsd.c12
-rw-r--r--drivers/net/au1000_eth.c18
-rw-r--r--drivers/net/b44.c28
-rw-r--r--drivers/net/bnx2.c20
-rw-r--r--drivers/net/dl2k.c13
-rw-r--r--drivers/net/e1000/e1000_ethtool.c5
-rw-r--r--drivers/net/e1000/e1000_main.c19
-rw-r--r--drivers/net/forcedeth.c473
-rw-r--r--drivers/net/gianfar.c56
-rw-r--r--drivers/net/gianfar.h67
-rw-r--r--drivers/net/gianfar_ethtool.c20
-rw-r--r--drivers/net/gianfar_sysfs.c24
-rw-r--r--drivers/net/hamradio/dmascc.c1
-rw-r--r--drivers/net/hamradio/scc.c1
-rw-r--r--drivers/net/hamradio/yam.c1
-rw-r--r--drivers/net/irda/Kconfig20
-rw-r--r--drivers/net/irda/Makefile2
-rw-r--r--drivers/net/irda/irda-usb.c8
-rw-r--r--drivers/net/irda/sir-dev.h13
-rw-r--r--drivers/net/irda/sir_dev.c315
-rw-r--r--drivers/net/irda/sir_kthread.c508
-rw-r--r--drivers/net/irda/smsc-ircc2.c330
-rw-r--r--drivers/net/ixp2000/enp2611.c13
-rw-r--r--drivers/net/ixp2000/pm3386.c30
-rw-r--r--drivers/net/ixp2000/pm3386.h1
-rw-r--r--drivers/net/mv643xx_eth.c2
-rw-r--r--drivers/net/ne.c33
-rw-r--r--drivers/net/netconsole.c2
-rw-r--r--drivers/net/pcmcia/axnet_cs.c13
-rw-r--r--drivers/net/pcmcia/nmclan_cs.c2
-rw-r--r--drivers/net/pcmcia/pcnet_cs.c1
-rw-r--r--drivers/net/pcnet32.c2
-rw-r--r--drivers/net/phy/mdio_bus.c4
-rw-r--r--drivers/net/pppoe.c3
-rw-r--r--drivers/net/sis900.c1
-rw-r--r--drivers/net/skge.c8
-rw-r--r--drivers/net/sky2.c282
-rw-r--r--drivers/net/sky2.h7
-rw-r--r--drivers/net/spider_net.c12
-rw-r--r--drivers/net/spider_net.h2
-rw-r--r--drivers/net/sungem_phy.c56
-rw-r--r--drivers/net/sungem_phy.h1
-rw-r--r--drivers/net/tg3.c97
-rw-r--r--drivers/net/tg3.h1
-rw-r--r--drivers/net/tulip/winbond-840.c4
-rw-r--r--drivers/net/via-rhine.c40
-rw-r--r--drivers/net/wireless/Kconfig2
-rw-r--r--drivers/net/wireless/airo.c46
-rw-r--r--drivers/net/wireless/arlan-main.c4
-rw-r--r--drivers/net/wireless/atmel.c11
-rw-r--r--drivers/net/wireless/bcm43xx/Kconfig3
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx.h17
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx_debugfs.c8
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx_dma.c44
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx_dma.h8
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx_main.c53
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx_main.h6
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx_phy.c3
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx_pio.c92
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx_pio.h16
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx_power.c115
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx_power.h9
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx_sysfs.c115
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx_sysfs.h16
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx_wx.c15
-rw-r--r--drivers/net/wireless/hostap/hostap_ioctl.c4
-rw-r--r--drivers/net/wireless/orinoco.c6
-rw-r--r--drivers/net/wireless/wavelan.c2
-rw-r--r--drivers/parisc/pdc_stable.c2
-rw-r--r--drivers/parisc/sba_iommu.c45
-rw-r--r--drivers/parisc/superio.c4
-rw-r--r--drivers/parport/parport_pc.c20
-rw-r--r--drivers/pci/hotplug/rpaphp_core.c3
-rw-r--r--drivers/pci/msi.c231
-rw-r--r--drivers/pci/pci-acpi.c60
-rw-r--r--drivers/pci/pci-driver.c6
-rw-r--r--drivers/pci/pci.c12
-rw-r--r--drivers/pci/pci.h11
-rw-r--r--drivers/pci/quirks.c55
-rw-r--r--drivers/pcmcia/Kconfig2
-rw-r--r--drivers/pcmcia/at91_cf.c51
-rw-r--r--drivers/pcmcia/ds.c22
-rw-r--r--drivers/pcmcia/i82365.c7
-rw-r--r--drivers/pcmcia/pcmcia_ioctl.c23
-rw-r--r--drivers/pcmcia/pcmcia_resource.c18
-rw-r--r--drivers/pcmcia/pd6729.c2
-rw-r--r--drivers/pcmcia/pxa2xx_sharpsl.c8
-rw-r--r--drivers/pnp/manager.c4
-rw-r--r--drivers/rtc/rtc-dev.c23
-rw-r--r--drivers/rtc/rtc-m48t86.c72
-rw-r--r--drivers/rtc/rtc-sa1100.c8
-rw-r--r--drivers/rtc/rtc-test.c2
-rw-r--r--drivers/rtc/rtc-vr41xx.c2
-rw-r--r--drivers/s390/block/dasd.c5
-rw-r--r--drivers/s390/block/dasd_devmap.c102
-rw-r--r--drivers/s390/block/dasd_eckd.c51
-rw-r--r--drivers/s390/block/dasd_eckd.h46
-rw-r--r--drivers/s390/block/dasd_int.h12
-rw-r--r--drivers/s390/char/tape_3590.c22
-rw-r--r--drivers/s390/char/tape_std.h1
-rw-r--r--drivers/s390/cio/chsc.c30
-rw-r--r--drivers/s390/cio/css.h4
-rw-r--r--drivers/s390/cio/device_fsm.c2
-rw-r--r--drivers/s390/cio/qdio.c36
-rw-r--r--drivers/s390/net/ctcmain.c26
-rw-r--r--drivers/s390/net/ctctty.c10
-rw-r--r--drivers/s390/net/cu3088.c10
-rw-r--r--drivers/s390/net/iucv.c36
-rw-r--r--drivers/s390/net/iucv.h622
-rw-r--r--drivers/s390/net/lcs.c347
-rw-r--r--drivers/s390/net/lcs.h14
-rw-r--r--drivers/s390/net/netiucv.c36
-rw-r--r--drivers/s390/net/qeth.h18
-rw-r--r--drivers/s390/net/qeth_eddp.c18
-rw-r--r--drivers/s390/net/qeth_fs.h2
-rw-r--r--drivers/s390/net/qeth_main.c108
-rw-r--r--drivers/s390/net/qeth_mpc.h4
-rw-r--r--drivers/s390/net/qeth_proc.c8
-rw-r--r--drivers/s390/net/qeth_sys.c6
-rw-r--r--drivers/s390/net/qeth_tso.h4
-rw-r--r--drivers/s390/s390mach.c34
-rw-r--r--drivers/sbus/char/openprom.c15
-rw-r--r--drivers/scsi/Kconfig4
-rw-r--r--drivers/scsi/advansys.c2
-rw-r--r--drivers/scsi/aic7xxx/aic7xxx_osm_pci.c1
-rw-r--r--drivers/scsi/aic7xxx/aic7xxx_pci.c12
-rw-r--r--drivers/scsi/ibmvscsi/ibmvscsi.c30
-rw-r--r--drivers/scsi/libata-core.c12
-rw-r--r--drivers/scsi/lpfc/lpfc_crtn.h1
-rw-r--r--drivers/scsi/lpfc/lpfc_disc.h1
-rw-r--r--drivers/scsi/lpfc/lpfc_els.c95
-rw-r--r--drivers/scsi/lpfc/lpfc_hbadisc.c18
-rw-r--r--drivers/scsi/lpfc/lpfc_hw.h3
-rw-r--r--drivers/scsi/lpfc/lpfc_init.c22
-rw-r--r--drivers/scsi/lpfc/lpfc_mbox.c33
-rw-r--r--drivers/scsi/lpfc/lpfc_nportdisc.c134
-rw-r--r--drivers/scsi/lpfc/lpfc_scsi.c68
-rw-r--r--drivers/scsi/lpfc/lpfc_version.h2
-rw-r--r--drivers/scsi/megaraid.c1
-rw-r--r--drivers/scsi/megaraid/megaraid_mbox.c59
-rw-r--r--drivers/scsi/megaraid/megaraid_mbox.h7
-rw-r--r--drivers/scsi/megaraid/megaraid_mm.c6
-rw-r--r--drivers/scsi/ppa.c7
-rw-r--r--drivers/scsi/qla2xxx/qla_os.c19
-rw-r--r--drivers/scsi/sata_mv.c134
-rw-r--r--drivers/scsi/sata_sil24.c6
-rw-r--r--drivers/scsi/scsi_devinfo.c3
-rw-r--r--drivers/scsi/scsi_lib.c29
-rw-r--r--drivers/scsi/scsi_transport_sas.c4
-rw-r--r--drivers/scsi/sim710.c2
-rw-r--r--drivers/scsi/st.c2
-rw-r--r--drivers/serial/8250.c74
-rw-r--r--drivers/serial/8250_au1x00.c5
-rw-r--r--drivers/serial/cpm_uart/cpm_uart.h58
-rw-r--r--drivers/serial/cpm_uart/cpm_uart_core.c309
-rw-r--r--drivers/serial/cpm_uart/cpm_uart_cpm1.c56
-rw-r--r--drivers/serial/cpm_uart/cpm_uart_cpm2.c16
-rw-r--r--drivers/serial/imx.c40
-rw-r--r--drivers/serial/m32r_sio.c1
-rw-r--r--drivers/serial/serial_core.c123
-rw-r--r--drivers/serial/sunsu.c1
-rw-r--r--drivers/sn/ioc3.c2
-rw-r--r--drivers/sn/ioc4.c2
-rw-r--r--drivers/spi/Kconfig34
-rw-r--r--drivers/spi/Makefile4
-rw-r--r--drivers/spi/pxa2xx_spi.c1486
-rw-r--r--drivers/spi/spi.c13
-rw-r--r--drivers/spi/spi_bitbang.c104
-rw-r--r--drivers/spi/spi_butterfly.c1
-rw-r--r--drivers/spi/spi_mpc83xx.c483
-rw-r--r--drivers/spi/spi_s3c24xx.c453
-rw-r--r--drivers/spi/spi_s3c24xx_gpio.c188
-rw-r--r--drivers/usb/atm/speedtch.c2
-rw-r--r--drivers/usb/atm/ueagle-atm.c52
-rw-r--r--drivers/usb/atm/usbatm.c8
-rw-r--r--drivers/usb/core/Kconfig7
-rw-r--r--drivers/usb/core/hcd-pci.c7
-rw-r--r--drivers/usb/core/hcd.c13
-rw-r--r--drivers/usb/core/hub.c31
-rw-r--r--drivers/usb/core/usb.c2
-rw-r--r--drivers/usb/gadget/Kconfig4
-rw-r--r--drivers/usb/gadget/at91_udc.c4
-rw-r--r--drivers/usb/gadget/ether.c6
-rw-r--r--drivers/usb/gadget/file_storage.c38
-rw-r--r--drivers/usb/gadget/gadget_chips.h6
-rw-r--r--drivers/usb/gadget/inode.c25
-rw-r--r--drivers/usb/gadget/net2280.c108
-rw-r--r--drivers/usb/gadget/net2280.h415
-rw-r--r--drivers/usb/gadget/zero.c7
-rw-r--r--drivers/usb/host/ehci-pci.c2
-rw-r--r--drivers/usb/host/ohci-at91.c35
-rw-r--r--drivers/usb/host/ohci-hcd.c2
-rw-r--r--drivers/usb/host/ohci-pci.c2
-rw-r--r--drivers/usb/host/ohci-s3c2410.c41
-rw-r--r--drivers/usb/host/pci-quirks.c1
-rw-r--r--drivers/usb/host/pci-quirks.h7
-rw-r--r--drivers/usb/host/uhci-hcd.c9
-rw-r--r--drivers/usb/host/uhci-hcd.h1
-rw-r--r--drivers/usb/host/uhci-hub.c18
-rw-r--r--drivers/usb/input/Kconfig56
-rw-r--r--drivers/usb/input/Makefile1
-rw-r--r--drivers/usb/input/hid-core.c18
-rw-r--r--drivers/usb/input/hid-ff.c6
-rw-r--r--drivers/usb/input/hid.h5
-rw-r--r--drivers/usb/input/hiddev.c1
-rw-r--r--drivers/usb/input/keyspan_remote.c2
-rw-r--r--drivers/usb/input/usbtouchscreen.c605
-rw-r--r--drivers/usb/input/wacom.c136
-rw-r--r--drivers/usb/misc/emi26.c4
-rw-r--r--drivers/usb/misc/emi62.c4
-rw-r--r--drivers/usb/misc/usbtest.c13
-rw-r--r--drivers/usb/net/asix.c327
-rw-r--r--drivers/usb/net/pegasus.c22
-rw-r--r--drivers/usb/net/rndis_host.c28
-rw-r--r--drivers/usb/serial/Kconfig19
-rw-r--r--drivers/usb/serial/Makefile2
-rw-r--r--drivers/usb/serial/airprime.c1
-rw-r--r--drivers/usb/serial/ark3116.c465
-rw-r--r--drivers/usb/serial/console.c2
-rw-r--r--drivers/usb/serial/ftdi_sio.c7
-rw-r--r--drivers/usb/serial/ftdi_sio.h37
-rw-r--r--drivers/usb/serial/funsoft.c65
-rw-r--r--drivers/usb/serial/generic.c1
-rw-r--r--drivers/usb/serial/omninet.c12
-rw-r--r--drivers/usb/serial/pl2303.c2
-rw-r--r--drivers/usb/serial/pl2303.h5
-rw-r--r--drivers/usb/serial/usb-serial.c31
-rw-r--r--drivers/usb/serial/usb-serial.h6
-rw-r--r--drivers/usb/serial/whiteheat.c1
-rw-r--r--drivers/usb/storage/Kconfig3
-rw-r--r--drivers/usb/storage/unusual_devs.h9
-rw-r--r--drivers/video/Kconfig2
-rw-r--r--drivers/video/aty/radeon_base.c2
-rw-r--r--drivers/video/au1100fb.c21
-rw-r--r--drivers/video/au1200fb.c1922
-rw-r--r--drivers/video/backlight/backlight.c18
-rw-r--r--drivers/video/backlight/lcd.c32
-rw-r--r--drivers/video/console/fbcon.c4
-rw-r--r--drivers/video/fbmem.c14
-rw-r--r--drivers/video/fbsysfs.c92
-rw-r--r--drivers/video/i810/i810_main.c4
-rw-r--r--drivers/video/logo/Makefile2
-rw-r--r--drivers/video/matrox/g450_pll.c23
-rw-r--r--drivers/video/matrox/matroxfb_DAC1064.h2
-rw-r--r--drivers/video/matrox/matroxfb_base.h2
-rw-r--r--drivers/video/maxinefb.c4
-rw-r--r--drivers/video/pm2fb.c4
-rw-r--r--drivers/video/savage/savagefb_driver.c8
-rw-r--r--fs/9p/fcall.c21
-rw-r--r--fs/9p/mux.c222
-rw-r--r--fs/9p/mux.h4
-rw-r--r--fs/9p/vfs_file.c13
-rw-r--r--fs/9p/vfs_inode.c19
-rw-r--r--fs/Kconfig6
-rw-r--r--fs/Makefile2
-rw-r--r--fs/affs/namei.c3
-rw-r--r--fs/autofs4/autofs_i.h5
-rw-r--r--fs/autofs4/root.c10
-rw-r--r--fs/autofs4/waitq.c77
-rw-r--r--fs/binfmt_flat.c30
-rw-r--r--fs/bio.c3
-rw-r--r--fs/block_dev.c2
-rw-r--r--fs/cifs/CHANGES13
-rw-r--r--fs/cifs/README8
-rw-r--r--fs/cifs/cifsfs.c99
-rw-r--r--fs/cifs/cifsfs.h2
-rw-r--r--fs/cifs/cifsproto.h2
-rw-r--r--fs/cifs/cifssmb.c42
-rw-r--r--fs/cifs/connect.c103
-rw-r--r--fs/cifs/dir.c18
-rw-r--r--fs/cifs/fcntl.c2
-rw-r--r--fs/cifs/file.c44
-rw-r--r--fs/cifs/inode.c6
-rw-r--r--fs/cifs/link.c6
-rw-r--r--fs/cifs/ntlmssp.c14
-rw-r--r--fs/cifs/readdir.c45
-rw-r--r--fs/cifs/xattr.c8
-rw-r--r--fs/compat.c195
-rw-r--r--fs/configfs/dir.c137
-rw-r--r--fs/debugfs/inode.c3
-rw-r--r--fs/exec.c29
-rw-r--r--fs/exportfs/expfs.c2
-rw-r--r--fs/ext3/inode.c13
-rw-r--r--fs/ext3/ioctl.c18
-rw-r--r--fs/ext3/resize.c2
-rw-r--r--fs/fuse/dev.c39
-rw-r--r--fs/fuse/file.c10
-rw-r--r--fs/fuse/fuse_i.h3
-rw-r--r--fs/fuse/inode.c13
-rw-r--r--fs/inotify.c9
-rw-r--r--fs/jffs2/nodelist.c6
-rw-r--r--fs/jfs/jfs_metapage.c20
-rw-r--r--fs/lockd/svclock.c2
-rw-r--r--fs/locks.c30
-rw-r--r--fs/namei.c19
-rw-r--r--fs/namespace.c7
-rw-r--r--fs/nfs/dir.c5
-rw-r--r--fs/nfs/direct.c8
-rw-r--r--fs/nfs/file.c5
-rw-r--r--fs/nfs/inode.c5
-rw-r--r--fs/nfs/nfs4proc.c10
-rw-r--r--fs/nfsd/export.c4
-rw-r--r--fs/nfsd/vfs.c7
-rw-r--r--fs/ocfs2/aops.c46
-rw-r--r--fs/ocfs2/aops.h4
-rw-r--r--fs/ocfs2/extent_map.c6
-rw-r--r--fs/ocfs2/file.c86
-rw-r--r--fs/ocfs2/journal.c8
-rw-r--r--fs/ocfs2/uptodate.c4
-rw-r--r--fs/ocfs2/vote.c6
-rw-r--r--fs/open.c25
-rw-r--r--fs/partitions/check.c46
-rw-r--r--fs/pipe.c189
-rw-r--r--fs/proc/base.c21
-rw-r--r--fs/reiserfs/xattr_acl.c5
-rw-r--r--fs/smbfs/dir.c5
-rw-r--r--fs/smbfs/request.c4
-rw-r--r--fs/splice.c963
-rw-r--r--fs/stat.c2
-rw-r--r--fs/sysfs/dir.c1
-rw-r--r--fs/sysfs/file.c76
-rw-r--r--fs/sysfs/sysfs.h1
-rw-r--r--fs/xfs/linux-2.6/xfs_file.c12
-rw-r--r--fs/xfs/linux-2.6/xfs_lrw.c14
-rw-r--r--fs/xfs/linux-2.6/xfs_lrw.h4
-rw-r--r--fs/xfs/linux-2.6/xfs_vnode.h12
-rw-r--r--fs/xfs/xfs_alloc.c5
-rw-r--r--fs/xfs/xfs_rename.c12
-rw-r--r--fs/xfs/xfs_vfsops.c27
-rw-r--r--fs/xfs/xfs_vnodeops.c2
-rw-r--r--include/asm-alpha/smp.h4
-rw-r--r--include/asm-alpha/termbits.h1
-rw-r--r--include/asm-arm/arch-aaec2000/debug-macro.S1
-rw-r--r--include/asm-arm/arch-aaec2000/entry-macro.S1
-rw-r--r--include/asm-arm/arch-imx/debug-macro.S2
-rw-r--r--include/asm-arm/arch-imx/imx-uart.h10
-rw-r--r--include/asm-arm/arch-ixp23xx/memory.h2
-rw-r--r--include/asm-arm/arch-ixp4xx/io.h7
-rw-r--r--include/asm-arm/arch-ixp4xx/memory.h2
-rw-r--r--include/asm-arm/arch-l7200/serial_l7200.h2
-rw-r--r--include/asm-arm/arch-l7200/uncompress.h2
-rw-r--r--include/asm-arm/arch-pxa/dma.h26
-rw-r--r--include/asm-arm/arch-pxa/pxa2xx_spi.h71
-rw-r--r--include/asm-arm/arch-s3c2410/spi-gpio.h31
-rw-r--r--include/asm-arm/arch-s3c2410/spi.h29
-rw-r--r--include/asm-arm/bug.h1
-rw-r--r--include/asm-arm/procinfo.h2
-rw-r--r--include/asm-arm/spinlock.h6
-rw-r--r--include/asm-arm/system.h6
-rw-r--r--include/asm-arm/unistd.h39
-rw-r--r--include/asm-generic/pgtable.h11
-rw-r--r--include/asm-i386/atomic.h5
-rw-r--r--include/asm-i386/cpufeature.h1
-rw-r--r--include/asm-i386/i387.h30
-rw-r--r--include/asm-i386/io_apic.h1
-rw-r--r--include/asm-i386/pgtable-2level.h3
-rw-r--r--include/asm-i386/pgtable-3level.h20
-rw-r--r--include/asm-i386/pgtable.h4
-rw-r--r--include/asm-i386/unistd.h4
-rw-r--r--include/asm-ia64/acpi.h5
-rw-r--r--include/asm-ia64/bitops.h1
-rw-r--r--include/asm-ia64/machvec.h2
-rw-r--r--include/asm-ia64/sn/sn2/sn_hwperf.h6
-rw-r--r--include/asm-ia64/sn/sn_sal.h17
-rw-r--r--include/asm-ia64/thread_info.h2
-rw-r--r--include/asm-ia64/topology.h5
-rw-r--r--include/asm-ia64/unistd.h4
-rw-r--r--include/asm-m32r/assembler.h5
-rw-r--r--include/asm-m32r/mappi3/mappi3_pld.h22
-rw-r--r--include/asm-m32r/ptrace.h25
-rw-r--r--include/asm-m32r/semaphore.h64
-rw-r--r--include/asm-m32r/sigcontext.h2
-rw-r--r--include/asm-m32r/system.h67
-rw-r--r--include/asm-mips/addrspace.h1
-rw-r--r--include/asm-mips/asmmacro.h47
-rw-r--r--include/asm-mips/bitops.h56
-rw-r--r--include/asm-mips/cacheflush.h1
-rw-r--r--include/asm-mips/cpu-features.h2
-rw-r--r--include/asm-mips/cpu-info.h10
-rw-r--r--include/asm-mips/cpu.h6
-rw-r--r--include/asm-mips/delay.h22
-rw-r--r--include/asm-mips/ds1742.h13
-rw-r--r--include/asm-mips/elf.h45
-rw-r--r--include/asm-mips/fpu.h4
-rw-r--r--include/asm-mips/futex.h141
-rw-r--r--include/asm-mips/hazards.h2
-rw-r--r--include/asm-mips/inst.h33
-rw-r--r--include/asm-mips/interrupt.h65
-rw-r--r--include/asm-mips/irq.h30
-rw-r--r--include/asm-mips/kspd.h36
-rw-r--r--include/asm-mips/mach-generic/ide.h46
-rw-r--r--include/asm-mips/mach-jmr3927/ds1742.h4
-rw-r--r--include/asm-mips/mach-mips/param.h13
-rw-r--r--include/asm-mips/marvell.h2
-rw-r--r--include/asm-mips/mips-boards/atlas.h18
-rw-r--r--include/asm-mips/mips-boards/atlasint.h19
-rw-r--r--include/asm-mips/mips-boards/generic.h1
-rw-r--r--include/asm-mips/mips_mt.h15
-rw-r--r--include/asm-mips/mipsmtregs.h16
-rw-r--r--include/asm-mips/mipsregs.h138
-rw-r--r--include/asm-mips/mmu_context.h112
-rw-r--r--include/asm-mips/page.h2
-rw-r--r--include/asm-mips/pgtable-32.h61
-rw-r--r--include/asm-mips/pgtable-64.h13
-rw-r--r--include/asm-mips/pgtable.h103
-rw-r--r--include/asm-mips/processor.h22
-rw-r--r--include/asm-mips/ptrace.h4
-rw-r--r--include/asm-mips/r4kcache.h130
-rw-r--r--include/asm-mips/rtc.h4
-rw-r--r--include/asm-mips/rtlx.h38
-rw-r--r--include/asm-mips/serial.h12
-rw-r--r--include/asm-mips/sigcontext.h10
-rw-r--r--include/asm-mips/smp.h5
-rw-r--r--include/asm-mips/smtc.h55
-rw-r--r--include/asm-mips/smtc_ipi.h118
-rw-r--r--include/asm-mips/smtc_proc.h23
-rw-r--r--include/asm-mips/sparsemem.h14
-rw-r--r--include/asm-mips/stackframe.h187
-rw-r--r--include/asm-mips/system.h34
-rw-r--r--include/asm-mips/unistd.h18
-rw-r--r--include/asm-mips/vpe.h37
-rw-r--r--include/asm-parisc/io.h17
-rw-r--r--include/asm-parisc/page.h25
-rw-r--r--include/asm-parisc/pgtable.h63
-rw-r--r--include/asm-parisc/unistd.h8
-rw-r--r--include/asm-powerpc/cputable.h14
-rw-r--r--include/asm-powerpc/io.h6
-rw-r--r--include/asm-powerpc/iommu.h7
-rw-r--r--include/asm-powerpc/irq.h7
-rw-r--r--include/asm-powerpc/machdep.h6
-rw-r--r--include/asm-powerpc/page_64.h1
-rw-r--r--include/asm-powerpc/pgalloc.h2
-rw-r--r--include/asm-powerpc/spu.h1
-rw-r--r--include/asm-powerpc/termbits.h1
-rw-r--r--include/asm-powerpc/thread_info.h8
-rw-r--r--include/asm-powerpc/topology.h24
-rw-r--r--include/asm-powerpc/uaccess.h19
-rw-r--r--include/asm-powerpc/unistd.h24
-rw-r--r--include/asm-ppc/commproc.h1
-rw-r--r--include/asm-ppc/cpm2.h2
-rw-r--r--include/asm-ppc/page.h1
-rw-r--r--include/asm-ppc/ppc_sys.h2
-rw-r--r--include/asm-ppc/reg_booke.h1
-rw-r--r--include/asm-s390/cache.h2
-rw-r--r--include/asm-s390/futex.h124
-rw-r--r--include/asm-s390/lowcore.h4
-rw-r--r--include/asm-s390/unistd.h8
-rw-r--r--include/asm-sparc/unistd.h16
-rw-r--r--include/asm-sparc64/dma-mapping.h141
-rw-r--r--include/asm-sparc64/pci.h4
-rw-r--r--include/asm-sparc64/pgtable.h17
-rw-r--r--include/asm-sparc64/tlbflush.h2
-rw-r--r--include/asm-sparc64/unistd.h16
-rw-r--r--include/asm-um/irqflags.h6
-rw-r--r--include/asm-um/uaccess.h6
-rw-r--r--include/asm-x86_64/cache.h4
-rw-r--r--include/asm-x86_64/cpufeature.h1
-rw-r--r--include/asm-x86_64/e820.h2
-rw-r--r--include/asm-x86_64/elf.h2
-rw-r--r--include/asm-x86_64/i387.h20
-rw-r--r--include/asm-x86_64/io_apic.h1
-rw-r--r--include/asm-x86_64/mmzone.h3
-rw-r--r--include/asm-x86_64/percpu.h2
-rw-r--r--include/asm-x86_64/unistd.h10
-rw-r--r--include/asm-xtensa/ioctls.h2
-rw-r--r--include/asm-xtensa/signal.h2
-rw-r--r--include/linux/audit.h22
-rw-r--r--include/linux/debugfs.h5
-rw-r--r--include/linux/device.h2
-rw-r--r--include/linux/dma-mapping.h1
-rw-r--r--include/linux/elevator.h2
-rw-r--r--include/linux/firmware.h1
-rw-r--r--include/linux/fs.h19
-rw-r--r--include/linux/fs_uart_pd.h60
-rw-r--r--include/linux/fsl_devices.h11
-rw-r--r--include/linux/genhd.h1
-rw-r--r--include/linux/ide.h1
-rw-r--r--include/linux/input.h106
-rw-r--r--include/linux/kernel.h1
-rw-r--r--include/linux/kobject.h5
-rw-r--r--include/linux/list.h2
-rw-r--r--include/linux/m48t86.h4
-rw-r--r--include/linux/memory_hotplug.h3
-rw-r--r--include/linux/mempolicy.h1
-rw-r--r--include/linux/mmc/card.h1
-rw-r--r--include/linux/mmc/mmc.h1
-rw-r--r--include/linux/mmzone.h2
-rw-r--r--include/linux/mod_devicetable.h48
-rw-r--r--include/linux/mv643xx.h2
-rw-r--r--include/linux/netdevice.h5
-rw-r--r--include/linux/netfilter/x_tables.h12
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack_helper_h323_asn1.h2
-rw-r--r--include/linux/netlink.h1
-rw-r--r--include/linux/pagemap.h2
-rw-r--r--include/linux/pci.h33
-rw-r--r--include/linux/pci_ids.h8
-rw-r--r--include/linux/pipe_fs_i.h48
-rw-r--r--include/linux/pm.h8
-rw-r--r--include/linux/pm_legacy.h7
-rw-r--r--include/linux/rcupdate.h1
-rw-r--r--include/linux/sched.h4
-rw-r--r--include/linux/security.h16
-rw-r--r--include/linux/selinux.h177
-rw-r--r--include/linux/serial_core.h1
-rw-r--r--include/linux/signal.h4
-rw-r--r--include/linux/skbuff.h7
-rw-r--r--include/linux/slab.h1
-rw-r--r--include/linux/spi/ads7846.h7
-rw-r--r--include/linux/spi/spi.h45
-rw-r--r--include/linux/spi/spi_bitbang.h8
-rw-r--r--include/linux/sunrpc/metrics.h12
-rw-r--r--include/linux/sunrpc/xprt.h1
-rw-r--r--include/linux/swap.h2
-rw-r--r--include/linux/syscalls.h11
-rw-r--r--include/linux/sysfs.h6
-rw-r--r--include/linux/usb/net2280.h444
-rw-r--r--include/linux/videodev2.h5
-rw-r--r--include/linux/vt_kern.h5
-rw-r--r--include/net/arp.h2
-rw-r--r--include/net/ax25.h10
-rw-r--r--include/net/compat.h3
-rw-r--r--include/net/ieee80211.h6
-rw-r--r--include/net/ieee80211softmac.h11
-rw-r--r--include/net/inet_timewait_sock.h2
-rw-r--r--include/net/ipv6.h2
-rw-r--r--include/net/irda/irlmp.h2
-rw-r--r--include/net/neighbour.h1
-rw-r--r--include/net/netrom.h8
-rw-r--r--include/net/rose.h14
-rw-r--r--include/net/sctp/command.h1
-rw-r--r--include/net/sctp/sctp.h6
-rw-r--r--include/net/sctp/structs.h1
-rw-r--r--include/net/sock.h3
-rw-r--r--include/net/xfrm.h8
-rw-r--r--include/scsi/srp.h23
-rw-r--r--include/sound/pcm.h6
-rw-r--r--include/sound/pcm_oss.h2
-rw-r--r--init/Kconfig9
-rw-r--r--init/do_mounts.c5
-rw-r--r--init/initramfs.c8
-rw-r--r--init/main.c2
-rw-r--r--ipc/msg.c11
-rw-r--r--ipc/sem.c11
-rw-r--r--ipc/shm.c21
-rw-r--r--ipc/util.c10
-rw-r--r--kernel/audit.c160
-rw-r--r--kernel/audit.h10
-rw-r--r--kernel/auditfilter.c289
-rw-r--r--kernel/auditsc.c269
-rw-r--r--kernel/cpuset.c25
-rw-r--r--kernel/exit.c5
-rw-r--r--kernel/extable.c2
-rw-r--r--kernel/fork.c11
-rw-r--r--kernel/hrtimer.c10
-rw-r--r--kernel/irq/manage.c6
-rw-r--r--kernel/kprobes.c3
-rw-r--r--kernel/module.c12
-rw-r--r--kernel/power/main.c2
-rw-r--r--kernel/power/pm.c20
-rw-r--r--kernel/power/snapshot.c9
-rw-r--r--kernel/profile.c2
-rw-r--r--kernel/ptrace.c64
-rw-r--r--kernel/rcupdate.c23
-rw-r--r--kernel/sched.c64
-rw-r--r--kernel/signal.c4
-rw-r--r--kernel/softirq.c4
-rw-r--r--kernel/softlockup.c4
-rw-r--r--kernel/timer.c20
-rw-r--r--kernel/uid16.c59
-rw-r--r--kernel/workqueue.c2
-rw-r--r--lib/Kconfig.debug4
-rw-r--r--lib/kobject.c14
-rw-r--r--lib/kobject_uevent.c8
-rw-r--r--mm/filemap.c32
-rw-r--r--mm/madvise.c3
-rw-r--r--mm/memory_hotplug.c14
-rw-r--r--mm/mempolicy.c1
-rw-r--r--mm/migrate.c11
-rw-r--r--mm/oom_kill.c71
-rw-r--r--mm/page_alloc.c42
-rw-r--r--mm/shmem.c3
-rw-r--r--mm/slab.c51
-rw-r--r--mm/slob.c10
-rw-r--r--mm/sparse.c16
-rw-r--r--mm/vmscan.c2
-rw-r--r--net/802/tr.c1
-rw-r--r--net/atm/clip.c462
-rw-r--r--net/ax25/af_ax25.c93
-rw-r--r--net/ax25/ax25_addr.c9
-rw-r--r--net/ax25/ax25_ds_timer.c3
-rw-r--r--net/ax25/ax25_iface.c13
-rw-r--r--net/ax25/ax25_ip.c3
-rw-r--r--net/ax25/ax25_out.c3
-rw-r--r--net/ax25/ax25_route.c2
-rw-r--r--net/ax25/ax25_timer.c3
-rw-r--r--net/ax25/ax25_uid.c4
-rw-r--r--net/ax25/sysctl_net_ax25.c10
-rw-r--r--net/bridge/br.c3
-rw-r--r--net/bridge/br_forward.c8
-rw-r--r--net/bridge/br_if.c28
-rw-r--r--net/bridge/br_input.c1
-rw-r--r--net/bridge/netfilter/ebt_log.c2
-rw-r--r--net/bridge/netfilter/ebtables.c20
-rw-r--r--net/core/dev.c122
-rw-r--r--net/core/filter.c5
-rw-r--r--net/core/link_watch.c10
-rw-r--r--net/core/neighbour.c21
-rw-r--r--net/core/net-sysfs.c49
-rw-r--r--net/core/skbuff.c8
-rw-r--r--net/core/stream.c1
-rw-r--r--net/core/wireless.c8
-rw-r--r--net/dccp/proto.c13
-rw-r--r--net/decnet/dn_neigh.c5
-rw-r--r--net/ethernet/Makefile1
-rw-r--r--net/ethernet/sysctl_net_ether.c14
-rw-r--r--net/ieee80211/softmac/Kconfig1
-rw-r--r--net/ieee80211/softmac/ieee80211softmac_assoc.c42
-rw-r--r--net/ieee80211/softmac/ieee80211softmac_auth.c16
-rw-r--r--net/ieee80211/softmac/ieee80211softmac_event.c40
-rw-r--r--net/ieee80211/softmac/ieee80211softmac_io.c18
-rw-r--r--net/ieee80211/softmac/ieee80211softmac_module.c6
-rw-r--r--net/ieee80211/softmac/ieee80211softmac_scan.c10
-rw-r--r--net/ieee80211/softmac/ieee80211softmac_wx.c37
-rw-r--r--net/ipv4/af_inet.c2
-rw-r--r--net/ipv4/arp.c4
-rw-r--r--net/ipv4/devinet.c1
-rw-r--r--net/ipv4/fib_frontend.c1
-rw-r--r--net/ipv4/inet_hashtables.c4
-rw-r--r--net/ipv4/ip_input.c2
-rw-r--r--net/ipv4/ip_options.c2
-rw-r--r--net/ipv4/ip_output.c2
-rw-r--r--net/ipv4/ipcomp.c9
-rw-r--r--net/ipv4/netfilter/Kconfig6
-rw-r--r--net/ipv4/netfilter/arp_tables.c2
-rw-r--r--net/ipv4/netfilter/ip_conntrack_core.c1
-rw-r--r--net/ipv4/netfilter/ip_conntrack_helper_h323.c2
-rw-r--r--net/ipv4/netfilter/ip_conntrack_helper_h323_asn1.c46
-rw-r--r--net/ipv4/netfilter/ip_conntrack_helper_pptp.c4
-rw-r--r--net/ipv4/netfilter/ip_conntrack_proto_sctp.c11
-rw-r--r--net/ipv4/netfilter/ip_nat_proto_gre.c12
-rw-r--r--net/ipv4/netfilter/ip_nat_snmp_basic.c16
-rw-r--r--net/ipv4/netfilter/ip_nat_standalone.c2
-rw-r--r--net/ipv4/netfilter/ip_tables.c39
-rw-r--r--net/ipv4/netfilter/ipt_LOG.c2
-rw-r--r--net/ipv4/netfilter/ipt_recent.c2
-rw-r--r--net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c1
-rw-r--r--net/ipv4/route.c5
-rw-r--r--net/ipv4/tcp.c13
-rw-r--r--net/ipv4/tcp_highspeed.c5
-rw-r--r--net/ipv4/tcp_input.c3
-rw-r--r--net/ipv4/tcp_ipv4.c1
-rw-r--r--net/ipv4/tcp_output.c25
-rw-r--r--net/ipv4/xfrm4_output.c2
-rw-r--r--net/ipv4/xfrm4_policy.c2
-rw-r--r--net/ipv6/exthdrs.c16
-rw-r--r--net/ipv6/inet6_connection_sock.c2
-rw-r--r--net/ipv6/ip6_input.c3
-rw-r--r--net/ipv6/ipcomp6.c2
-rw-r--r--net/ipv6/netfilter/ip6_tables.c15
-rw-r--r--net/ipv6/netfilter/ip6t_LOG.c2
-rw-r--r--net/ipv6/netfilter/ip6t_eui64.c2
-rw-r--r--net/ipv6/route.c21
-rw-r--r--net/ipv6/xfrm6_policy.c8
-rw-r--r--net/ipx/af_ipx.c4
-rw-r--r--net/ipx/ipx_route.c2
-rw-r--r--net/irda/iriap.c3
-rw-r--r--net/irda/irias_object.c3
-rw-r--r--net/irda/irlap.c3
-rw-r--r--net/llc/llc_input.c3
-rw-r--r--net/netfilter/nf_conntrack_core.c15
-rw-r--r--net/netfilter/nf_conntrack_l3proto_generic.c1
-rw-r--r--net/netfilter/nf_conntrack_proto_sctp.c11
-rw-r--r--net/netfilter/nfnetlink_log.c4
-rw-r--r--net/netfilter/x_tables.c6
-rw-r--r--net/netlink/af_netlink.c3
-rw-r--r--net/netrom/af_netrom.c18
-rw-r--r--net/netrom/nr_dev.c1
-rw-r--r--net/rose/af_rose.c13
-rw-r--r--net/rose/rose_dev.c1
-rw-r--r--net/rose/rose_link.c6
-rw-r--r--net/rose/rose_route.c7
-rw-r--r--net/sched/act_ipt.c5
-rw-r--r--net/sched/sch_generic.c6
-rw-r--r--net/sched/sch_hfsc.c6
-rw-r--r--net/sched/sch_netem.c2
-rw-r--r--net/sctp/input.c144
-rw-r--r--net/sctp/inqueue.c1
-rw-r--r--net/sctp/sm_sideeffect.c16
-rw-r--r--net/sctp/sm_statefuns.c140
-rw-r--r--net/sctp/sm_statetable.c10
-rw-r--r--net/sctp/socket.c29
-rw-r--r--net/sctp/ulpqueue.c27
-rw-r--r--net/socket.c3
-rw-r--r--net/sunrpc/auth_gss/auth_gss.c1
-rw-r--r--net/sunrpc/auth_gss/gss_krb5_crypto.c11
-rw-r--r--net/sunrpc/cache.c1
-rw-r--r--net/sunrpc/stats.c3
-rw-r--r--net/sysctl_net.c8
-rw-r--r--net/tipc/name_distr.c3
-rw-r--r--net/x25/x25_timer.c4
-rw-r--r--net/xfrm/xfrm_input.c2
-rw-r--r--net/xfrm/xfrm_policy.c16
-rw-r--r--net/xfrm/xfrm_state.c33
-rw-r--r--scripts/gen_initramfs_list.sh6
-rw-r--r--scripts/kconfig/conf.c3
-rw-r--r--scripts/kconfig/lxdialog/checklist.c19
-rw-r--r--scripts/mkmakefile5
-rw-r--r--scripts/mod/file2alias.c36
-rw-r--r--scripts/mod/modpost.c105
-rw-r--r--scripts/mod/modpost.h23
-rw-r--r--security/dummy.c6
-rw-r--r--security/selinux/Makefile2
-rw-r--r--security/selinux/avc.c13
-rw-r--r--security/selinux/exports.c74
-rw-r--r--security/selinux/hooks.c19
-rw-r--r--security/selinux/include/security.h5
-rw-r--r--security/selinux/ss/mls.c32
-rw-r--r--security/selinux/ss/mls.h4
-rw-r--r--security/selinux/ss/services.c239
-rw-r--r--sound/core/Kconfig12
-rw-r--r--sound/core/oss/pcm_oss.c8
-rw-r--r--sound/core/pcm.c12
-rw-r--r--sound/core/pcm_lib.c6
-rw-r--r--sound/core/pcm_memory.c8
-rw-r--r--sound/drivers/dummy.c14
-rw-r--r--sound/drivers/mpu401/mpu401.c16
-rw-r--r--sound/drivers/mpu401/mpu401_uart.c42
-rw-r--r--sound/drivers/serial-u16550.c14
-rw-r--r--sound/drivers/virmidi.c14
-rw-r--r--sound/isa/es18xx.c2
-rw-r--r--sound/isa/opti9xx/miro.c3
-rw-r--r--sound/oss/Kconfig306
-rw-r--r--sound/oss/ad1848.c10
-rw-r--r--sound/oss/ad1889.c198
-rw-r--r--sound/oss/ad1889.h101
-rw-r--r--sound/oss/dmasound/tas_common.c4
-rw-r--r--sound/oss/nm256_audio.c6
-rw-r--r--sound/pci/ad1889.c3
-rw-r--r--sound/pci/ali5451/ali5451.c2
-rw-r--r--sound/pci/als300.c2
-rw-r--r--sound/pci/als4000.c2
-rw-r--r--sound/pci/atiixp.c2
-rw-r--r--sound/pci/atiixp_modem.c2
-rw-r--r--sound/pci/au88x0/au8810.c2
-rw-r--r--sound/pci/au88x0/au8820.c2
-rw-r--r--sound/pci/au88x0/au8830.c2
-rw-r--r--sound/pci/azt3328.c2
-rw-r--r--sound/pci/bt87x.c4
-rw-r--r--sound/pci/ca0106/ca0106_main.c2
-rw-r--r--sound/pci/cmipci.c2
-rw-r--r--sound/pci/cs4281.c2
-rw-r--r--sound/pci/cs46xx/cs46xx.c2
-rw-r--r--sound/pci/cs5535audio/cs5535audio.c2
-rw-r--r--sound/pci/emu10k1/emu10k1.c2
-rw-r--r--sound/pci/emu10k1/emu10k1x.c3
-rw-r--r--sound/pci/ens1370.c2
-rw-r--r--sound/pci/es1938.c2
-rw-r--r--sound/pci/es1968.c3
-rw-r--r--sound/pci/fm801.c2
-rw-r--r--sound/pci/hda/hda_intel.c2
-rw-r--r--sound/pci/hda/patch_analog.c13
-rw-r--r--sound/pci/hda/patch_realtek.c1
-rw-r--r--sound/pci/hda/patch_sigmatel.c4
-rw-r--r--sound/pci/ice1712/ice1712.c3
-rw-r--r--sound/pci/ice1712/ice1724.c2
-rw-r--r--sound/pci/intel8x0.c8
-rw-r--r--sound/pci/intel8x0m.c2
-rw-r--r--sound/pci/korg1212/korg1212.c2
-rw-r--r--sound/pci/maestro3.c3
-rw-r--r--sound/pci/mixart/mixart.c3
-rw-r--r--sound/pci/nm256/nm256.c2
-rw-r--r--sound/pci/pcxhr/pcxhr.c3
-rw-r--r--sound/pci/pcxhr/pcxhr_hwdep.c4
-rw-r--r--sound/pci/riptide/riptide.c4
-rw-r--r--sound/pci/rme32.c2
-rw-r--r--sound/pci/rme96.c2
-rw-r--r--sound/pci/rme9652/hdsp.c2
-rw-r--r--sound/pci/rme9652/hdspm.c2
-rw-r--r--sound/pci/rme9652/rme9652.c2
-rw-r--r--sound/pci/sonicvibes.c2
-rw-r--r--sound/pci/trident/trident.c2
-rw-r--r--sound/pci/via82xx.c18
-rw-r--r--sound/pci/via82xx_modem.c2
-rw-r--r--sound/pci/vx222/vx222.c2
-rw-r--r--sound/pci/ymfpci/ymfpci.c2
-rw-r--r--sound/pcmcia/Kconfig4
-rw-r--r--sound/ppc/daca.c2
-rw-r--r--sound/ppc/toonie.c2
-rw-r--r--sound/ppc/tumbler.c2
-rw-r--r--sound/usb/usbquirks.h9
-rw-r--r--usr/gen_init_cpio.c4
1551 files changed, 37075 insertions, 20003 deletions
diff --git a/CREDITS b/CREDITS
index 787564bc248b..9bf714a1c7d9 100644
--- a/CREDITS
+++ b/CREDITS
@@ -1194,15 +1194,9 @@ S: Brecksville, OH 44141-1334
1194S: USA 1194S: USA
1195 1195
1196N: Tristan Greaves 1196N: Tristan Greaves
1197E: Tristan.Greaves@icl.com 1197E: tristan@extricate.org
1198E: tmg296@ecs.soton.ac.uk 1198W: http://www.extricate.org/
1199W: http://www.ecs.soton.ac.uk/~tmg296
1200D: Miscellaneous ipv4 sysctl patches 1199D: Miscellaneous ipv4 sysctl patches
1201S: 15 Little Mead
1202S: Denmead
1203S: Hampshire
1204S: PO7 6HS
1205S: United Kingdom
1206 1200
1207N: Michael A. Griffith 1201N: Michael A. Griffith
1208E: grif@cs.ucr.edu 1202E: grif@cs.ucr.edu
@@ -3247,14 +3241,9 @@ S: 12725 SW Millikan Way, Suite 400
3247S: Beaverton, Oregon 97005 3241S: Beaverton, Oregon 97005
3248S: USA 3242S: USA
3249 3243
3250N: Marcelo W. Tosatti 3244N: Marcelo Tosatti
3251E: marcelo.tosatti@cyclades.com 3245E: marcelo@kvack.org
3252D: Miscellaneous kernel hacker
3253D: v2.4 kernel maintainer 3246D: v2.4 kernel maintainer
3254D: Current pc300/cyclades maintainer
3255S: Cyclades Corporation
3256S: Av Cristovao Colombo, 462. Floresta.
3257S: Porto Alegre
3258S: Brazil 3247S: Brazil
3259 3248
3260N: Stefan Traby 3249N: Stefan Traby
diff --git a/Documentation/DMA-API.txt b/Documentation/DMA-API.txt
index 1af0f2d50220..2ffb0d62f0fe 100644
--- a/Documentation/DMA-API.txt
+++ b/Documentation/DMA-API.txt
@@ -33,7 +33,9 @@ pci_alloc_consistent(struct pci_dev *dev, size_t size,
33 33
34Consistent memory is memory for which a write by either the device or 34Consistent memory is memory for which a write by either the device or
35the processor can immediately be read by the processor or device 35the processor can immediately be read by the processor or device
36without having to worry about caching effects. 36without having to worry about caching effects. (You may however need
37to make sure to flush the processor's write buffers before telling
38devices to read that memory.)
37 39
38This routine allocates a region of <size> bytes of consistent memory. 40This routine allocates a region of <size> bytes of consistent memory.
39it also returns a <dma_handle> which may be cast to an unsigned 41it also returns a <dma_handle> which may be cast to an unsigned
@@ -304,12 +306,12 @@ dma address with dma_mapping_error(). A non zero return value means the mapping
304could not be created and the driver should take appropriate action (eg 306could not be created and the driver should take appropriate action (eg
305reduce current DMA mapping usage or delay and try again later). 307reduce current DMA mapping usage or delay and try again later).
306 308
307int 309 int
308dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, 310 dma_map_sg(struct device *dev, struct scatterlist *sg,
309 enum dma_data_direction direction) 311 int nents, enum dma_data_direction direction)
310int 312 int
311pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, 313 pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg,
312 int nents, int direction) 314 int nents, int direction)
313 315
314Maps a scatter gather list from the block layer. 316Maps a scatter gather list from the block layer.
315 317
@@ -327,12 +329,33 @@ critical that the driver do something, in the case of a block driver
327aborting the request or even oopsing is better than doing nothing and 329aborting the request or even oopsing is better than doing nothing and
328corrupting the filesystem. 330corrupting the filesystem.
329 331
330void 332With scatterlists, you use the resulting mapping like this:
331dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries, 333
332 enum dma_data_direction direction) 334 int i, count = dma_map_sg(dev, sglist, nents, direction);
333void 335 struct scatterlist *sg;
334pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, 336
335 int nents, int direction) 337 for (i = 0, sg = sglist; i < count; i++, sg++) {
338 hw_address[i] = sg_dma_address(sg);
339 hw_len[i] = sg_dma_len(sg);
340 }
341
342where nents is the number of entries in the sglist.
343
344The implementation is free to merge several consecutive sglist entries
345into one (e.g. with an IOMMU, or if several pages just happen to be
346physically contiguous) and returns the actual number of sg entries it
347mapped them to. On failure 0, is returned.
348
349Then you should loop count times (note: this can be less than nents times)
350and use sg_dma_address() and sg_dma_len() macros where you previously
351accessed sg->address and sg->length as shown above.
352
353 void
354 dma_unmap_sg(struct device *dev, struct scatterlist *sg,
355 int nhwentries, enum dma_data_direction direction)
356 void
357 pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg,
358 int nents, int direction)
336 359
337unmap the previously mapped scatter/gather list. All the parameters 360unmap the previously mapped scatter/gather list. All the parameters
338must be the same as those and passed in to the scatter/gather mapping 361must be the same as those and passed in to the scatter/gather mapping
diff --git a/Documentation/DMA-mapping.txt b/Documentation/DMA-mapping.txt
index 10bf4deb96aa..7c717699032c 100644
--- a/Documentation/DMA-mapping.txt
+++ b/Documentation/DMA-mapping.txt
@@ -58,11 +58,15 @@ translating each of those pages back to a kernel address using
58something like __va(). [ EDIT: Update this when we integrate 58something like __va(). [ EDIT: Update this when we integrate
59Gerd Knorr's generic code which does this. ] 59Gerd Knorr's generic code which does this. ]
60 60
61This rule also means that you may not use kernel image addresses 61This rule also means that you may use neither kernel image addresses
62(ie. items in the kernel's data/text/bss segment, or your driver's) 62(items in data/text/bss segments), nor module image addresses, nor
63nor may you use kernel stack addresses for DMA. Both of these items 63stack addresses for DMA. These could all be mapped somewhere entirely
64might be mapped somewhere entirely different than the rest of physical 64different than the rest of physical memory. Even if those classes of
65memory. 65memory could physically work with DMA, you'd need to ensure the I/O
66buffers were cacheline-aligned. Without that, you'd see cacheline
67sharing problems (data corruption) on CPUs with DMA-incoherent caches.
68(The CPU could write to one word, DMA would write to a different one
69in the same cache line, and one of them could be overwritten.)
66 70
67Also, this means that you cannot take the return of a kmap() 71Also, this means that you cannot take the return of a kmap()
68call and DMA to/from that. This is similar to vmalloc(). 72call and DMA to/from that. This is similar to vmalloc().
@@ -284,6 +288,11 @@ There are two types of DMA mappings:
284 288
285 in order to get correct behavior on all platforms. 289 in order to get correct behavior on all platforms.
286 290
291 Also, on some platforms your driver may need to flush CPU write
292 buffers in much the same way as it needs to flush write buffers
293 found in PCI bridges (such as by reading a register's value
294 after writing it).
295
287- Streaming DMA mappings which are usually mapped for one DMA transfer, 296- Streaming DMA mappings which are usually mapped for one DMA transfer,
288 unmapped right after it (unless you use pci_dma_sync_* below) and for which 297 unmapped right after it (unless you use pci_dma_sync_* below) and for which
289 hardware can optimize for sequential accesses. 298 hardware can optimize for sequential accesses.
@@ -303,6 +312,9 @@ There are two types of DMA mappings:
303 312
304Neither type of DMA mapping has alignment restrictions that come 313Neither type of DMA mapping has alignment restrictions that come
305from PCI, although some devices may have such restrictions. 314from PCI, although some devices may have such restrictions.
315Also, systems with caches that aren't DMA-coherent will work better
316when the underlying buffers don't share cache lines with other data.
317
306 318
307 Using Consistent DMA mappings. 319 Using Consistent DMA mappings.
308 320
diff --git a/Documentation/HOWTO b/Documentation/HOWTO
index 6c9e746267da..915ae8c986c6 100644
--- a/Documentation/HOWTO
+++ b/Documentation/HOWTO
@@ -603,7 +603,8 @@ start exactly where you are now.
603 603
604 604
605---------- 605----------
606Thanks to Paolo Ciarrocchi who allowed the "Development Process" section 606Thanks to Paolo Ciarrocchi who allowed the "Development Process"
607(http://linux.tar.bz/articles/2.6-development_process) section
607to be based on text he had written, and to Randy Dunlap and Gerrit 608to be based on text he had written, and to Randy Dunlap and Gerrit
608Huizenga for some of the list of things you should and should not say. 609Huizenga for some of the list of things you should and should not say.
609Also thanks to Pat Mochel, Hanna Linder, Randy Dunlap, Kay Sievers, 610Also thanks to Pat Mochel, Hanna Linder, Randy Dunlap, Kay Sievers,
diff --git a/Documentation/block/switching-sched.txt b/Documentation/block/switching-sched.txt
new file mode 100644
index 000000000000..5fa130a67531
--- /dev/null
+++ b/Documentation/block/switching-sched.txt
@@ -0,0 +1,22 @@
1As of the Linux 2.6.10 kernel, it is now possible to change the
2IO scheduler for a given block device on the fly (thus making it possible,
3for instance, to set the CFQ scheduler for the system default, but
4set a specific device to use the anticipatory or noop schedulers - which
5can improve that device's throughput).
6
7To set a specific scheduler, simply do this:
8
9echo SCHEDNAME > /sys/block/DEV/queue/scheduler
10
11where SCHEDNAME is the name of a defined IO scheduler, and DEV is the
12device name (hda, hdb, sga, or whatever you happen to have).
13
14The list of defined schedulers can be found by simply doing
15a "cat /sys/block/DEV/queue/scheduler" - the list of valid names
16will be displayed, with the currently selected scheduler in brackets:
17
18# cat /sys/block/hda/queue/scheduler
19noop anticipatory deadline [cfq]
20# echo anticipatory > /sys/block/hda/queue/scheduler
21# cat /sys/block/hda/queue/scheduler
22noop [anticipatory] deadline cfq
diff --git a/Documentation/cpu-freq/index.txt b/Documentation/cpu-freq/index.txt
index 5009805f9378..ffdb5323df37 100644
--- a/Documentation/cpu-freq/index.txt
+++ b/Documentation/cpu-freq/index.txt
@@ -53,4 +53,4 @@ the CPUFreq Mailing list:
53* http://lists.linux.org.uk/mailman/listinfo/cpufreq 53* http://lists.linux.org.uk/mailman/listinfo/cpufreq
54 54
55Clock and voltage scaling for the SA-1100: 55Clock and voltage scaling for the SA-1100:
56* http://www.lart.tudelft.nl/projects/scaling 56* http://www.lartmaker.nl/projects/scaling
diff --git a/Documentation/devices.txt b/Documentation/devices.txt
index 3c406acd4dfa..b369a8c46a73 100644
--- a/Documentation/devices.txt
+++ b/Documentation/devices.txt
@@ -1721,11 +1721,6 @@ Your cooperation is appreciated.
1721 These devices support the same API as the generic SCSI 1721 These devices support the same API as the generic SCSI
1722 devices. 1722 devices.
1723 1723
1724 97 block Packet writing for CD/DVD devices
1725 0 = /dev/pktcdvd0 First packet-writing module
1726 1 = /dev/pktcdvd1 Second packet-writing module
1727 ...
1728
1729 98 char Control and Measurement Device (comedi) 1724 98 char Control and Measurement Device (comedi)
1730 0 = /dev/comedi0 First comedi device 1725 0 = /dev/comedi0 First comedi device
1731 1 = /dev/comedi1 Second comedi device 1726 1 = /dev/comedi1 Second comedi device
diff --git a/Documentation/dvb/get_dvb_firmware b/Documentation/dvb/get_dvb_firmware
index 15fc8fbef67e..4820366b6ae8 100644
--- a/Documentation/dvb/get_dvb_firmware
+++ b/Documentation/dvb/get_dvb_firmware
@@ -259,9 +259,9 @@ sub dibusb {
259} 259}
260 260
261sub nxt2002 { 261sub nxt2002 {
262 my $sourcefile = "Broadband4PC_4_2_11.zip"; 262 my $sourcefile = "Technisat_DVB-PC_4_4_COMPACT.zip";
263 my $url = "http://www.bbti.us/download/windows/$sourcefile"; 263 my $url = "http://www.bbti.us/download/windows/$sourcefile";
264 my $hash = "c6d2ea47a8f456d887ada0cfb718ff2a"; 264 my $hash = "476befae8c7c1bb9648954060b1eec1f";
265 my $outfile = "dvb-fe-nxt2002.fw"; 265 my $outfile = "dvb-fe-nxt2002.fw";
266 my $tmpdir = tempdir(DIR => "/tmp", CLEANUP => 1); 266 my $tmpdir = tempdir(DIR => "/tmp", CLEANUP => 1);
267 267
@@ -269,8 +269,8 @@ sub nxt2002 {
269 269
270 wgetfile($sourcefile, $url); 270 wgetfile($sourcefile, $url);
271 unzip($sourcefile, $tmpdir); 271 unzip($sourcefile, $tmpdir);
272 verify("$tmpdir/SkyNETU.sys", $hash); 272 verify("$tmpdir/SkyNET.sys", $hash);
273 extract("$tmpdir/SkyNETU.sys", 375832, 5908, $outfile); 273 extract("$tmpdir/SkyNET.sys", 331624, 5908, $outfile);
274 274
275 $outfile; 275 $outfile;
276} 276}
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt
index 293fed113dff..43ab119963d5 100644
--- a/Documentation/feature-removal-schedule.txt
+++ b/Documentation/feature-removal-schedule.txt
@@ -25,8 +25,9 @@ Who: Adrian Bunk <bunk@stusta.de>
25 25
26--------------------------- 26---------------------------
27 27
28What: drivers depending on OBSOLETE_OSS_DRIVER 28What: drivers that were depending on OBSOLETE_OSS_DRIVER
29When: January 2006 29 (config options already removed)
30When: before 2.6.19
30Why: OSS drivers with ALSA replacements 31Why: OSS drivers with ALSA replacements
31Who: Adrian Bunk <bunk@stusta.de> 32Who: Adrian Bunk <bunk@stusta.de>
32 33
@@ -56,6 +57,15 @@ Who: Jody McIntyre <scjody@steamballoon.com>
56 57
57--------------------------- 58---------------------------
58 59
60What: sbp2: module parameter "force_inquiry_hack"
61When: July 2006
62Why: Superceded by parameter "workarounds". Both parameters are meant to be
63 used ad-hoc and for single devices only, i.e. not in modprobe.conf,
64 therefore the impact of this feature replacement should be low.
65Who: Stefan Richter <stefanr@s5r6.in-berlin.de>
66
67---------------------------
68
59What: Video4Linux API 1 ioctls and video_decoder.h from Video devices. 69What: Video4Linux API 1 ioctls and video_decoder.h from Video devices.
60When: July 2006 70When: July 2006
61Why: V4L1 AP1 was replaced by V4L2 API. during migration from 2.4 to 2.6 71Why: V4L1 AP1 was replaced by V4L2 API. during migration from 2.4 to 2.6
diff --git a/Documentation/filesystems/sysfs.txt b/Documentation/filesystems/sysfs.txt
index c8bce82ddcac..89b1d196ca80 100644
--- a/Documentation/filesystems/sysfs.txt
+++ b/Documentation/filesystems/sysfs.txt
@@ -246,6 +246,7 @@ class/
246devices/ 246devices/
247firmware/ 247firmware/
248net/ 248net/
249fs/
249 250
250devices/ contains a filesystem representation of the device tree. It maps 251devices/ contains a filesystem representation of the device tree. It maps
251directly to the internal kernel device tree, which is a hierarchy of 252directly to the internal kernel device tree, which is a hierarchy of
@@ -264,6 +265,10 @@ drivers/ contains a directory for each device driver that is loaded
264for devices on that particular bus (this assumes that drivers do not 265for devices on that particular bus (this assumes that drivers do not
265span multiple bus types). 266span multiple bus types).
266 267
268fs/ contains a directory for some filesystems. Currently each
269filesystem wanting to export attributes must create its own hierarchy
270below fs/ (see ./fuse.txt for an example).
271
267 272
268More information can driver-model specific features can be found in 273More information can driver-model specific features can be found in
269Documentation/driver-model/. 274Documentation/driver-model/.
diff --git a/Documentation/firmware_class/README b/Documentation/firmware_class/README
index 43e836c07ae8..e9cc8bb26f7d 100644
--- a/Documentation/firmware_class/README
+++ b/Documentation/firmware_class/README
@@ -105,20 +105,3 @@
105 on the setup, so I think that the choice on what firmware to make 105 on the setup, so I think that the choice on what firmware to make
106 persistent should be left to userspace. 106 persistent should be left to userspace.
107 107
108 - Why register_firmware()+__init can be useful:
109 - For boot devices needing firmware.
110 - To make the transition easier:
111 The firmware can be declared __init and register_firmware()
112 called on module_init. Then the firmware is warranted to be
113 there even if "firmware hotplug userspace" is not there yet or
114 it doesn't yet provide the needed firmware.
115 Once the firmware is widely available in userspace, it can be
116 removed from the kernel. Or made optional (CONFIG_.*_FIRMWARE).
117
118 In either case, if firmware hotplug support is there, it can move the
119 firmware out of kernel memory into the real filesystem for later
120 usage.
121
122 Note: If persistence is implemented on top of initramfs,
123 register_firmware() may not be appropriate.
124
diff --git a/Documentation/firmware_class/firmware_sample_driver.c b/Documentation/firmware_class/firmware_sample_driver.c
index ad3edaba4533..87feccdb5c9f 100644
--- a/Documentation/firmware_class/firmware_sample_driver.c
+++ b/Documentation/firmware_class/firmware_sample_driver.c
@@ -5,8 +5,6 @@
5 * 5 *
6 * Sample code on how to use request_firmware() from drivers. 6 * Sample code on how to use request_firmware() from drivers.
7 * 7 *
8 * Note that register_firmware() is currently useless.
9 *
10 */ 8 */
11 9
12#include <linux/module.h> 10#include <linux/module.h>
@@ -17,11 +15,6 @@
17 15
18#include "linux/firmware.h" 16#include "linux/firmware.h"
19 17
20#define WE_CAN_NEED_FIRMWARE_BEFORE_USERSPACE_IS_AVAILABLE
21#ifdef WE_CAN_NEED_FIRMWARE_BEFORE_USERSPACE_IS_AVAILABLE
22char __init inkernel_firmware[] = "let's say that this is firmware\n";
23#endif
24
25static struct device ghost_device = { 18static struct device ghost_device = {
26 .bus_id = "ghost0", 19 .bus_id = "ghost0",
27}; 20};
@@ -104,10 +97,6 @@ static void sample_probe_async(void)
104 97
105static int sample_init(void) 98static int sample_init(void)
106{ 99{
107#ifdef WE_CAN_NEED_FIRMWARE_BEFORE_USERSPACE_IS_AVAILABLE
108 register_firmware("sample_driver_fw", inkernel_firmware,
109 sizeof(inkernel_firmware));
110#endif
111 device_initialize(&ghost_device); 100 device_initialize(&ghost_device);
112 /* since there is no real hardware insertion I just call the 101 /* since there is no real hardware insertion I just call the
113 * sample probe functions here */ 102 * sample probe functions here */
diff --git a/Documentation/i2c/busses/i2c-parport b/Documentation/i2c/busses/i2c-parport
index d9f23c0763f1..77b995dfca22 100644
--- a/Documentation/i2c/busses/i2c-parport
+++ b/Documentation/i2c/busses/i2c-parport
@@ -12,18 +12,22 @@ meant as a replacement for the older, individual drivers:
12 teletext adapters) 12 teletext adapters)
13 13
14It currently supports the following devices: 14It currently supports the following devices:
15 * Philips adapter 15 * (type=0) Philips adapter
16 * home brew teletext adapter 16 * (type=1) home brew teletext adapter
17 * Velleman K8000 adapter 17 * (type=2) Velleman K8000 adapter
18 * ELV adapter 18 * (type=3) ELV adapter
19 * Analog Devices evaluation boards (ADM1025, ADM1030, ADM1031, ADM1032) 19 * (type=4) Analog Devices ADM1032 evaluation board
20 * Barco LPT->DVI (K5800236) adapter 20 * (type=5) Analog Devices evaluation boards: ADM1025, ADM1030, ADM1031
21 * (type=6) Barco LPT->DVI (K5800236) adapter
21 22
22These devices use different pinout configurations, so you have to tell 23These devices use different pinout configurations, so you have to tell
23the driver what you have, using the type module parameter. There is no 24the driver what you have, using the type module parameter. There is no
24way to autodetect the devices. Support for different pinout configurations 25way to autodetect the devices. Support for different pinout configurations
25can be easily added when needed. 26can be easily added when needed.
26 27
28Earlier kernels defaulted to type=0 (Philips). But now, if the type
29parameter is missing, the driver will simply fail to initialize.
30
27 31
28Building your own adapter 32Building your own adapter
29------------------------- 33-------------------------
diff --git a/Documentation/memory-barriers.txt b/Documentation/memory-barriers.txt
index 92f0056d928c..c61d8b876fdb 100644
--- a/Documentation/memory-barriers.txt
+++ b/Documentation/memory-barriers.txt
@@ -1031,7 +1031,7 @@ conflict on any particular lock.
1031LOCKS VS MEMORY ACCESSES 1031LOCKS VS MEMORY ACCESSES
1032------------------------ 1032------------------------
1033 1033
1034Consider the following: the system has a pair of spinlocks (N) and (Q), and 1034Consider the following: the system has a pair of spinlocks (M) and (Q), and
1035three CPUs; then should the following sequence of events occur: 1035three CPUs; then should the following sequence of events occur:
1036 1036
1037 CPU 1 CPU 2 1037 CPU 1 CPU 2
@@ -1678,7 +1678,7 @@ CPU's caches by some other cache event:
1678 smp_wmb(); 1678 smp_wmb();
1679 <A:modify v=2> <C:busy> 1679 <A:modify v=2> <C:busy>
1680 <C:queue v=2> 1680 <C:queue v=2>
1681 p = &b; q = p; 1681 p = &v; q = p;
1682 <D:request p> 1682 <D:request p>
1683 <B:modify p=&v> <D:commit p=&v> 1683 <B:modify p=&v> <D:commit p=&v>
1684 <D:read p> 1684 <D:read p>
diff --git a/Documentation/networking/operstates.txt b/Documentation/networking/operstates.txt
new file mode 100644
index 000000000000..4a21d9bb836b
--- /dev/null
+++ b/Documentation/networking/operstates.txt
@@ -0,0 +1,161 @@
1
21. Introduction
3
4Linux distinguishes between administrative and operational state of an
5interface. Admininstrative state is the result of "ip link set dev
6<dev> up or down" and reflects whether the administrator wants to use
7the device for traffic.
8
9However, an interface is not usable just because the admin enabled it
10- ethernet requires to be plugged into the switch and, depending on
11a site's networking policy and configuration, an 802.1X authentication
12to be performed before user data can be transferred. Operational state
13shows the ability of an interface to transmit this user data.
14
15Thanks to 802.1X, userspace must be granted the possibility to
16influence operational state. To accommodate this, operational state is
17split into two parts: Two flags that can be set by the driver only, and
18a RFC2863 compatible state that is derived from these flags, a policy,
19and changeable from userspace under certain rules.
20
21
222. Querying from userspace
23
24Both admin and operational state can be queried via the netlink
25operation RTM_GETLINK. It is also possible to subscribe to RTMGRP_LINK
26to be notified of updates. This is important for setting from userspace.
27
28These values contain interface state:
29
30ifinfomsg::if_flags & IFF_UP:
31 Interface is admin up
32ifinfomsg::if_flags & IFF_RUNNING:
33 Interface is in RFC2863 operational state UP or UNKNOWN. This is for
34 backward compatibility, routing daemons, dhcp clients can use this
35 flag to determine whether they should use the interface.
36ifinfomsg::if_flags & IFF_LOWER_UP:
37 Driver has signaled netif_carrier_on()
38ifinfomsg::if_flags & IFF_DORMANT:
39 Driver has signaled netif_dormant_on()
40
41These interface flags can also be queried without netlink using the
42SIOCGIFFLAGS ioctl.
43
44TLV IFLA_OPERSTATE
45
46contains RFC2863 state of the interface in numeric representation:
47
48IF_OPER_UNKNOWN (0):
49 Interface is in unknown state, neither driver nor userspace has set
50 operational state. Interface must be considered for user data as
51 setting operational state has not been implemented in every driver.
52IF_OPER_NOTPRESENT (1):
53 Unused in current kernel (notpresent interfaces normally disappear),
54 just a numerical placeholder.
55IF_OPER_DOWN (2):
56 Interface is unable to transfer data on L1, f.e. ethernet is not
57 plugged or interface is ADMIN down.
58IF_OPER_LOWERLAYERDOWN (3):
59 Interfaces stacked on an interface that is IF_OPER_DOWN show this
60 state (f.e. VLAN).
61IF_OPER_TESTING (4):
62 Unused in current kernel.
63IF_OPER_DORMANT (5):
64 Interface is L1 up, but waiting for an external event, f.e. for a
65 protocol to establish. (802.1X)
66IF_OPER_UP (6):
67 Interface is operational up and can be used.
68
69This TLV can also be queried via sysfs.
70
71TLV IFLA_LINKMODE
72
73contains link policy. This is needed for userspace interaction
74described below.
75
76This TLV can also be queried via sysfs.
77
78
793. Kernel driver API
80
81Kernel drivers have access to two flags that map to IFF_LOWER_UP and
82IFF_DORMANT. These flags can be set from everywhere, even from
83interrupts. It is guaranteed that only the driver has write access,
84however, if different layers of the driver manipulate the same flag,
85the driver has to provide the synchronisation needed.
86
87__LINK_STATE_NOCARRIER, maps to !IFF_LOWER_UP:
88
89The driver uses netif_carrier_on() to clear and netif_carrier_off() to
90set this flag. On netif_carrier_off(), the scheduler stops sending
91packets. The name 'carrier' and the inversion are historical, think of
92it as lower layer.
93
94netif_carrier_ok() can be used to query that bit.
95
96__LINK_STATE_DORMANT, maps to IFF_DORMANT:
97
98Set by the driver to express that the device cannot yet be used
99because some driver controlled protocol establishment has to
100complete. Corresponding functions are netif_dormant_on() to set the
101flag, netif_dormant_off() to clear it and netif_dormant() to query.
102
103On device allocation, networking core sets the flags equivalent to
104netif_carrier_ok() and !netif_dormant().
105
106
107Whenever the driver CHANGES one of these flags, a workqueue event is
108scheduled to translate the flag combination to IFLA_OPERSTATE as
109follows:
110
111!netif_carrier_ok():
112 IF_OPER_LOWERLAYERDOWN if the interface is stacked, IF_OPER_DOWN
113 otherwise. Kernel can recognise stacked interfaces because their
114 ifindex != iflink.
115
116netif_carrier_ok() && netif_dormant():
117 IF_OPER_DORMANT
118
119netif_carrier_ok() && !netif_dormant():
120 IF_OPER_UP if userspace interaction is disabled. Otherwise
121 IF_OPER_DORMANT with the possibility for userspace to initiate the
122 IF_OPER_UP transition afterwards.
123
124
1254. Setting from userspace
126
127Applications have to use the netlink interface to influence the
128RFC2863 operational state of an interface. Setting IFLA_LINKMODE to 1
129via RTM_SETLINK instructs the kernel that an interface should go to
130IF_OPER_DORMANT instead of IF_OPER_UP when the combination
131netif_carrier_ok() && !netif_dormant() is set by the
132driver. Afterwards, the userspace application can set IFLA_OPERSTATE
133to IF_OPER_DORMANT or IF_OPER_UP as long as the driver does not set
134netif_carrier_off() or netif_dormant_on(). Changes made by userspace
135are multicasted on the netlink group RTMGRP_LINK.
136
137So basically a 802.1X supplicant interacts with the kernel like this:
138
139-subscribe to RTMGRP_LINK
140-set IFLA_LINKMODE to 1 via RTM_SETLINK
141-query RTM_GETLINK once to get initial state
142-if initial flags are not (IFF_LOWER_UP && !IFF_DORMANT), wait until
143 netlink multicast signals this state
144-do 802.1X, eventually abort if flags go down again
145-send RTM_SETLINK to set operstate to IF_OPER_UP if authentication
146 succeeds, IF_OPER_DORMANT otherwise
147-see how operstate and IFF_RUNNING is echoed via netlink multicast
148-set interface back to IF_OPER_DORMANT if 802.1X reauthentication
149 fails
150-restart if kernel changes IFF_LOWER_UP or IFF_DORMANT flag
151
152if supplicant goes down, bring back IFLA_LINKMODE to 0 and
153IFLA_OPERSTATE to a sane value.
154
155A routing daemon or dhcp client just needs to care for IFF_RUNNING or
156waiting for operstate to go IF_OPER_UP/IF_OPER_UNKNOWN before
157considering the interface / querying a DHCP address.
158
159
160For technical questions and/or comments please e-mail to Stefan Rompf
161(stefan at loplof.de).
diff --git a/Documentation/networking/xfrm_sync.txt b/Documentation/networking/xfrm_sync.txt
new file mode 100644
index 000000000000..8be626f7c0b8
--- /dev/null
+++ b/Documentation/networking/xfrm_sync.txt
@@ -0,0 +1,166 @@
1
2The sync patches work is based on initial patches from
3Krisztian <hidden@balabit.hu> and others and additional patches
4from Jamal <hadi@cyberus.ca>.
5
6The end goal for syncing is to be able to insert attributes + generate
7events so that the an SA can be safely moved from one machine to another
8for HA purposes.
9The idea is to synchronize the SA so that the takeover machine can do
10the processing of the SA as accurate as possible if it has access to it.
11
12We already have the ability to generate SA add/del/upd events.
13These patches add ability to sync and have accurate lifetime byte (to
14ensure proper decay of SAs) and replay counters to avoid replay attacks
15with as minimal loss at failover time.
16This way a backup stays as closely uptodate as an active member.
17
18Because the above items change for every packet the SA receives,
19it is possible for a lot of the events to be generated.
20For this reason, we also add a nagle-like algorithm to restrict
21the events. i.e we are going to set thresholds to say "let me
22know if the replay sequence threshold is reached or 10 secs have passed"
23These thresholds are set system-wide via sysctls or can be updated
24per SA.
25
26The identified items that need to be synchronized are:
27- the lifetime byte counter
28note that: lifetime time limit is not important if you assume the failover
29machine is known ahead of time since the decay of the time countdown
30is not driven by packet arrival.
31- the replay sequence for both inbound and outbound
32
331) Message Structure
34----------------------
35
36nlmsghdr:aevent_id:optional-TLVs.
37
38The netlink message types are:
39
40XFRM_MSG_NEWAE and XFRM_MSG_GETAE.
41
42A XFRM_MSG_GETAE does not have TLVs.
43A XFRM_MSG_NEWAE will have at least two TLVs (as is
44discussed further below).
45
46aevent_id structure looks like:
47
48 struct xfrm_aevent_id {
49 struct xfrm_usersa_id sa_id;
50 __u32 flags;
51 };
52
53xfrm_usersa_id in this message layout identifies the SA.
54
55flags are used to indicate different things. The possible
56flags are:
57 XFRM_AE_RTHR=1, /* replay threshold*/
58 XFRM_AE_RVAL=2, /* replay value */
59 XFRM_AE_LVAL=4, /* lifetime value */
60 XFRM_AE_ETHR=8, /* expiry timer threshold */
61 XFRM_AE_CR=16, /* Event cause is replay update */
62 XFRM_AE_CE=32, /* Event cause is timer expiry */
63 XFRM_AE_CU=64, /* Event cause is policy update */
64
65How these flags are used is dependent on the direction of the
66message (kernel<->user) as well the cause (config, query or event).
67This is described below in the different messages.
68
69The pid will be set appropriately in netlink to recognize direction
70(0 to the kernel and pid = processid that created the event
71when going from kernel to user space)
72
73A program needs to subscribe to multicast group XFRMNLGRP_AEVENTS
74to get notified of these events.
75
762) TLVS reflect the different parameters:
77-----------------------------------------
78
79a) byte value (XFRMA_LTIME_VAL)
80This TLV carries the running/current counter for byte lifetime since
81last event.
82
83b)replay value (XFRMA_REPLAY_VAL)
84This TLV carries the running/current counter for replay sequence since
85last event.
86
87c)replay threshold (XFRMA_REPLAY_THRESH)
88This TLV carries the threshold being used by the kernel to trigger events
89when the replay sequence is exceeded.
90
91d) expiry timer (XFRMA_ETIMER_THRESH)
92This is a timer value in milliseconds which is used as the nagle
93value to rate limit the events.
94
953) Default configurations for the parameters:
96----------------------------------------------
97
98By default these events should be turned off unless there is
99at least one listener registered to listen to the multicast
100group XFRMNLGRP_AEVENTS.
101
102Programs installing SAs will need to specify the two thresholds, however,
103in order to not change existing applications such as racoon
104we also provide default threshold values for these different parameters
105in case they are not specified.
106
107the two sysctls/proc entries are:
108a) /proc/sys/net/core/sysctl_xfrm_aevent_etime
109used to provide default values for the XFRMA_ETIMER_THRESH in incremental
110units of time of 100ms. The default is 10 (1 second)
111
112b) /proc/sys/net/core/sysctl_xfrm_aevent_rseqth
113used to provide default values for XFRMA_REPLAY_THRESH parameter
114in incremental packet count. The default is two packets.
115
1164) Message types
117----------------
118
119a) XFRM_MSG_GETAE issued by user-->kernel.
120XFRM_MSG_GETAE does not carry any TLVs.
121The response is a XFRM_MSG_NEWAE which is formatted based on what
122XFRM_MSG_GETAE queried for.
123The response will always have XFRMA_LTIME_VAL and XFRMA_REPLAY_VAL TLVs.
124*if XFRM_AE_RTHR flag is set, then XFRMA_REPLAY_THRESH is also retrieved
125*if XFRM_AE_ETHR flag is set, then XFRMA_ETIMER_THRESH is also retrieved
126
127b) XFRM_MSG_NEWAE is issued by either user space to configure
128or kernel to announce events or respond to a XFRM_MSG_GETAE.
129
130i) user --> kernel to configure a specific SA.
131any of the values or threshold parameters can be updated by passing the
132appropriate TLV.
133A response is issued back to the sender in user space to indicate success
134or failure.
135In the case of success, additionally an event with
136XFRM_MSG_NEWAE is also issued to any listeners as described in iii).
137
138ii) kernel->user direction as a response to XFRM_MSG_GETAE
139The response will always have XFRMA_LTIME_VAL and XFRMA_REPLAY_VAL TLVs.
140The threshold TLVs will be included if explicitly requested in
141the XFRM_MSG_GETAE message.
142
143iii) kernel->user to report as event if someone sets any values or
144thresholds for an SA using XFRM_MSG_NEWAE (as described in #i above).
145In such a case XFRM_AE_CU flag is set to inform the user that
146the change happened as a result of an update.
147The message will always have XFRMA_LTIME_VAL and XFRMA_REPLAY_VAL TLVs.
148
149iv) kernel->user to report event when replay threshold or a timeout
150is exceeded.
151In such a case either XFRM_AE_CR (replay exceeded) or XFRM_AE_CE (timeout
152happened) is set to inform the user what happened.
153Note the two flags are mutually exclusive.
154The message will always have XFRMA_LTIME_VAL and XFRMA_REPLAY_VAL TLVs.
155
156Exceptions to threshold settings
157--------------------------------
158
159If you have an SA that is getting hit by traffic in bursts such that
160there is a period where the timer threshold expires with no packets
161seen, then an odd behavior is seen as follows:
162The first packet arrival after a timer expiry will trigger a timeout
163aevent; i.e we dont wait for a timeout period or a packet threshold
164to be reached. This is done for simplicity and efficiency reasons.
165
166-JHS
diff --git a/Documentation/pci.txt b/Documentation/pci.txt
index 711210b38f5f..66bbbf1d1ef6 100644
--- a/Documentation/pci.txt
+++ b/Documentation/pci.txt
@@ -259,7 +259,17 @@ on the bus need to be capable of doing it, so this is something which needs
259to be handled by platform and generic code, not individual drivers. 259to be handled by platform and generic code, not individual drivers.
260 260
261 261
2628. Obsolete functions 2628. Vendor and device identifications
263~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
264For the future, let's avoid adding device ids to include/linux/pci_ids.h.
265
266PCI_VENDOR_ID_xxx for vendors, and a hex constant for device ids.
267
268Rationale: PCI_VENDOR_ID_xxx constants are re-used, but device ids are not.
269 Further, device ids are arbitrary hex numbers, normally used only in a
270 single location, the pci_device_id table.
271
2729. Obsolete functions
263~~~~~~~~~~~~~~~~~~~~~ 273~~~~~~~~~~~~~~~~~~~~~
264There are several functions which you might come across when trying to 274There are several functions which you might come across when trying to
265port an old driver to the new PCI interface. They are no longer present 275port an old driver to the new PCI interface. They are no longer present
diff --git a/Documentation/power/video.txt b/Documentation/power/video.txt
index d18a57d1a531..43a889f8f08d 100644
--- a/Documentation/power/video.txt
+++ b/Documentation/power/video.txt
@@ -140,7 +140,7 @@ IBM TP T41p s3_bios (2), switch to X after resume
140IBM TP T42 s3_bios (2) 140IBM TP T42 s3_bios (2)
141IBM ThinkPad T42p (2373-GTG) s3_bios (2) 141IBM ThinkPad T42p (2373-GTG) s3_bios (2)
142IBM TP X20 ??? (*) 142IBM TP X20 ??? (*)
143IBM TP X30 s3_bios (2) 143IBM TP X30 s3_bios, s3_mode (4)
144IBM TP X31 / Type 2672-XXH none (1), use radeontool (http://fdd.com/software/radeon/) to turn off backlight. 144IBM TP X31 / Type 2672-XXH none (1), use radeontool (http://fdd.com/software/radeon/) to turn off backlight.
145IBM TP X32 none (1), but backlight is on and video is trashed after long suspend. s3_bios,s3_mode (4) works too. Perhaps that gets better results? 145IBM TP X32 none (1), but backlight is on and video is trashed after long suspend. s3_bios,s3_mode (4) works too. Perhaps that gets better results?
146IBM Thinkpad X40 Type 2371-7JG s3_bios,s3_mode (4) 146IBM Thinkpad X40 Type 2371-7JG s3_bios,s3_mode (4)
diff --git a/Documentation/scsi/ChangeLog.megaraid b/Documentation/scsi/ChangeLog.megaraid
index 09f6300eda4b..c173806c91fa 100644
--- a/Documentation/scsi/ChangeLog.megaraid
+++ b/Documentation/scsi/ChangeLog.megaraid
@@ -1,3 +1,28 @@
1Release Date : Mon Apr 11 12:27:22 EST 2006 - Seokmann Ju <sju@lsil.com>
2Current Version : 2.20.4.8 (scsi module), 2.20.2.6 (cmm module)
3Older Version : 2.20.4.7 (scsi module), 2.20.2.6 (cmm module)
4
51. Fixed a bug in megaraid_reset_handler().
6 Customer reported "Unable to handle kernel NULL pointer dereference
7 at virtual address 00000000" when system goes to reset condition
8 for some reason. It happened randomly.
9 Root Cause: in the megaraid_reset_handler(), there is possibility not
10 returning pending packets in the pend_list if there are multiple
11 pending packets.
12 Fix: Made the change in the driver so that it will return all packets
13 in the pend_list.
14
152. Added change request.
16 As found in the following URL, rmb() only didn't help the
17 problem. I had to increase the loop counter to 0xFFFFFF. (6 F's)
18 http://marc.theaimsgroup.com/?l=linux-scsi&m=110971060502497&w=2
19
20 I attached a patch for your reference, too.
21 Could you check and get this fix in your driver?
22
23 Best Regards,
24 Jun'ichi Nomura
25
1Release Date : Fri Nov 11 12:27:22 EST 2005 - Seokmann Ju <sju@lsil.com> 26Release Date : Fri Nov 11 12:27:22 EST 2005 - Seokmann Ju <sju@lsil.com>
2Current Version : 2.20.4.7 (scsi module), 2.20.2.6 (cmm module) 27Current Version : 2.20.4.7 (scsi module), 2.20.2.6 (cmm module)
3Older Version : 2.20.4.6 (scsi module), 2.20.2.6 (cmm module) 28Older Version : 2.20.4.6 (scsi module), 2.20.2.6 (cmm module)
diff --git a/Documentation/serial/driver b/Documentation/serial/driver
index 42ef9970bc86..88ad615dd338 100644
--- a/Documentation/serial/driver
+++ b/Documentation/serial/driver
@@ -3,14 +3,11 @@
3 -------------------- 3 --------------------
4 4
5 5
6 $Id: driver,v 1.10 2002/07/22 15:27:30 rmk Exp $
7
8
9This document is meant as a brief overview of some aspects of the new serial 6This document is meant as a brief overview of some aspects of the new serial
10driver. It is not complete, any questions you have should be directed to 7driver. It is not complete, any questions you have should be directed to
11<rmk@arm.linux.org.uk> 8<rmk@arm.linux.org.uk>
12 9
13The reference implementation is contained within serial_amba.c. 10The reference implementation is contained within amba_pl011.c.
14 11
15 12
16 13
@@ -31,6 +28,11 @@ The serial core provides a few helper functions. This includes identifing
31the correct port structure (via uart_get_console) and decoding command line 28the correct port structure (via uart_get_console) and decoding command line
32arguments (uart_parse_options). 29arguments (uart_parse_options).
33 30
31There is also a helper function (uart_write_console) which performs a
32character by character write, translating newlines to CRLF sequences.
33Driver writers are recommended to use this function rather than implementing
34their own version.
35
34 36
35Locking 37Locking
36------- 38-------
@@ -86,6 +88,7 @@ hardware.
86 - TIOCM_DTR DTR signal. 88 - TIOCM_DTR DTR signal.
87 - TIOCM_OUT1 OUT1 signal. 89 - TIOCM_OUT1 OUT1 signal.
88 - TIOCM_OUT2 OUT2 signal. 90 - TIOCM_OUT2 OUT2 signal.
91 - TIOCM_LOOP Set the port into loopback mode.
89 If the appropriate bit is set, the signal should be driven 92 If the appropriate bit is set, the signal should be driven
90 active. If the bit is clear, the signal should be driven 93 active. If the bit is clear, the signal should be driven
91 inactive. 94 inactive.
@@ -141,6 +144,10 @@ hardware.
141 enable_ms(port) 144 enable_ms(port)
142 Enable the modem status interrupts. 145 Enable the modem status interrupts.
143 146
147 This method may be called multiple times. Modem status
148 interrupts should be disabled when the shutdown method is
149 called.
150
144 Locking: port->lock taken. 151 Locking: port->lock taken.
145 Interrupts: locally disabled. 152 Interrupts: locally disabled.
146 This call must not sleep 153 This call must not sleep
@@ -160,6 +167,8 @@ hardware.
160 state. Enable the port for reception. It should not activate 167 state. Enable the port for reception. It should not activate
161 RTS nor DTR; this will be done via a separate call to set_mctrl. 168 RTS nor DTR; this will be done via a separate call to set_mctrl.
162 169
170 This method will only be called when the port is initially opened.
171
163 Locking: port_sem taken. 172 Locking: port_sem taken.
164 Interrupts: globally disabled. 173 Interrupts: globally disabled.
165 174
@@ -169,6 +178,11 @@ hardware.
169 RTS nor DTR; this will have already been done via a separate 178 RTS nor DTR; this will have already been done via a separate
170 call to set_mctrl. 179 call to set_mctrl.
171 180
181 Drivers must not access port->info once this call has completed.
182
183 This method will only be called when there are no more users of
184 this port.
185
172 Locking: port_sem taken. 186 Locking: port_sem taken.
173 Interrupts: caller dependent. 187 Interrupts: caller dependent.
174 188
@@ -200,12 +214,13 @@ hardware.
200 The interaction of the iflag bits is as follows (parity error 214 The interaction of the iflag bits is as follows (parity error
201 given as an example): 215 given as an example):
202 Parity error INPCK IGNPAR 216 Parity error INPCK IGNPAR
203 None n/a n/a character received 217 n/a 0 n/a character received, marked as
204 Yes n/a 0 character discarded 218 TTY_NORMAL
205 Yes 0 1 character received, marked as 219 None 1 n/a character received, marked as
206 TTY_NORMAL 220 TTY_NORMAL
207 Yes 1 1 character received, marked as 221 Yes 1 0 character received, marked as
208 TTY_PARITY 222 TTY_PARITY
223 Yes 1 1 character discarded
209 224
210 Other flags may be used (eg, xon/xoff characters) if your 225 Other flags may be used (eg, xon/xoff characters) if your
211 hardware supports hardware "soft" flow control. 226 hardware supports hardware "soft" flow control.
diff --git a/Documentation/sound/alsa/Audiophile-Usb.txt b/Documentation/sound/alsa/Audiophile-Usb.txt
index 4692c8e77dc1..b535c2a198f8 100644
--- a/Documentation/sound/alsa/Audiophile-Usb.txt
+++ b/Documentation/sound/alsa/Audiophile-Usb.txt
@@ -1,4 +1,4 @@
1 Guide to using M-Audio Audiophile USB with ALSA and Jack v1.2 1 Guide to using M-Audio Audiophile USB with ALSA and Jack v1.3
2 ======================================================== 2 ========================================================
3 3
4 Thibault Le Meur <Thibault.LeMeur@supelec.fr> 4 Thibault Le Meur <Thibault.LeMeur@supelec.fr>
@@ -22,16 +22,16 @@ The device has 4 audio interfaces, and 2 MIDI ports:
22 * Midi In (Mi) 22 * Midi In (Mi)
23 * Midi Out (Mo) 23 * Midi Out (Mo)
24 24
25The internal DAC/ADC has the following caracteristics: 25The internal DAC/ADC has the following characteristics:
26* sample depth of 16 or 24 bits 26* sample depth of 16 or 24 bits
27* sample rate from 8kHz to 96kHz 27* sample rate from 8kHz to 96kHz
28* Two ports can't use different sample depths at the same time.Moreover, the 28* Two ports can't use different sample depths at the same time. Moreover, the
29Audiophile USB documentation gives the following Warning: "Please exit any 29Audiophile USB documentation gives the following Warning: "Please exit any
30audio application running before switching between bit depths" 30audio application running before switching between bit depths"
31 31
32Due to the USB 1.1 bandwidth limitation, a limited number of interfaces can be 32Due to the USB 1.1 bandwidth limitation, a limited number of interfaces can be
33activated at the same time depending on the audio mode selected: 33activated at the same time depending on the audio mode selected:
34 * 16-bit/48kHz ==> 4 channels in/ 4 channels out 34 * 16-bit/48kHz ==> 4 channels in/4 channels out
35 - Ai+Ao+Di+Do 35 - Ai+Ao+Di+Do
36 * 24-bit/48kHz ==> 4 channels in/2 channels out, 36 * 24-bit/48kHz ==> 4 channels in/2 channels out,
37 or 2 channels in/4 channels out 37 or 2 channels in/4 channels out
@@ -41,8 +41,8 @@ activated at the same time depending on the audio mode selected:
41 41
42Important facts about the Digital interface: 42Important facts about the Digital interface:
43-------------------------------------------- 43--------------------------------------------
44 * The Do port additionnaly supports surround-encoded AC-3 and DTS passthrough, 44 * The Do port additionally supports surround-encoded AC-3 and DTS passthrough,
45though I haven't tested it under linux 45though I haven't tested it under Linux
46 - Note that in this setup only the Do interface can be enabled 46 - Note that in this setup only the Do interface can be enabled
47 * Apart from recording an audio digital stream, enabling the Di port is a way 47 * Apart from recording an audio digital stream, enabling the Di port is a way
48to synchronize the device to an external sample clock 48to synchronize the device to an external sample clock
@@ -60,24 +60,23 @@ synchronization error (for instance sound played at an odd sample rate)
60The Audiophile USB MIDI ports will be automatically supported once the 60The Audiophile USB MIDI ports will be automatically supported once the
61following modules have been loaded: 61following modules have been loaded:
62 * snd-usb-audio 62 * snd-usb-audio
63 * snd-seq
64 * snd-seq-midi 63 * snd-seq-midi
65 64
66No additionnal setting is required. 65No additional setting is required.
67 66
682.2 - Audio ports 672.2 - Audio ports
69----------------- 68-----------------
70 69
71Audio functions of the Audiophile USB device are handled by the snd-usb-audio 70Audio functions of the Audiophile USB device are handled by the snd-usb-audio
72module. This module can work in a default mode (without any device-specific 71module. This module can work in a default mode (without any device-specific
73parameter), or in an advanced mode with the device-specific parameter called 72parameter), or in an "advanced" mode with the device-specific parameter called
74"device_setup". 73"device_setup".
75 74
762.2.1 - Default Alsa driver mode 752.2.1 - Default Alsa driver mode
77 76
78The default behaviour of the snd-usb-audio driver is to parse the device 77The default behavior of the snd-usb-audio driver is to parse the device
79capabilities at startup and enable all functions inside the device (including 78capabilities at startup and enable all functions inside the device (including
80all ports at any sample rates and any sample depths supported). This approach 79all ports at any supported sample rates and sample depths). This approach
81has the advantage to let the driver easily switch from sample rates/depths 80has the advantage to let the driver easily switch from sample rates/depths
82automatically according to the need of the application claiming the device. 81automatically according to the need of the application claiming the device.
83 82
@@ -114,9 +113,9 @@ gain).
114For people having this problem, the snd-usb-audio module has a new module 113For people having this problem, the snd-usb-audio module has a new module
115parameter called "device_setup". 114parameter called "device_setup".
116 115
1172.2.2.1 - Initializing the working mode of the Audiohile USB 1162.2.2.1 - Initializing the working mode of the Audiophile USB
118 117
119As far as the Audiohile USB device is concerned, this value let the user 118As far as the Audiophile USB device is concerned, this value let the user
120specify: 119specify:
121 * the sample depth 120 * the sample depth
122 * the sample rate 121 * the sample rate
@@ -174,20 +173,20 @@ The parameter can be given:
174 173
175IMPORTANT NOTE WHEN SWITCHING CONFIGURATION: 174IMPORTANT NOTE WHEN SWITCHING CONFIGURATION:
176------------------------------------------- 175-------------------------------------------
177 * You may need to _first_ intialize the module with the correct device_setup 176 * You may need to _first_ initialize the module with the correct device_setup
178 parameter and _only_after_ turn on the Audiophile USB device 177 parameter and _only_after_ turn on the Audiophile USB device
179 * This is especially true when switching the sample depth: 178 * This is especially true when switching the sample depth:
180 - first trun off the device 179 - first turn off the device
181 - de-register the snd-usb-audio module 180 - de-register the snd-usb-audio module (modprobe -r)
182 - change the device_setup parameter (by either manually reprobing the module 181 - change the device_setup parameter by changing the device_setup
183 or changing modprobe.conf) 182 option in /etc/modprobe.conf
184 - turn on the device 183 - turn on the device
185 184
1862.2.2.3 - Audiophile USB's device_setup structure 1852.2.2.3 - Audiophile USB's device_setup structure
187 186
188If you want to understand the device_setup magic numbers for the Audiophile 187If you want to understand the device_setup magic numbers for the Audiophile
189USB, you need some very basic understanding of binary computation. However, 188USB, you need some very basic understanding of binary computation. However,
190this is not required to use the parameter and you may skip thi section. 189this is not required to use the parameter and you may skip this section.
191 190
192The device_setup is one byte long and its structure is the following: 191The device_setup is one byte long and its structure is the following:
193 192
@@ -231,11 +230,11 @@ Caution:
231 230
2322.2.3 - USB implementation details for this device 2312.2.3 - USB implementation details for this device
233 232
234You may safely skip this section if you're not interrested in driver 233You may safely skip this section if you're not interested in driver
235development. 234development.
236 235
237This section describes some internals aspect of the device and summarize the 236This section describes some internal aspects of the device and summarize the
238data I got by usb-snooping the windows and linux drivers. 237data I got by usb-snooping the windows and Linux drivers.
239 238
240The M-Audio Audiophile USB has 7 USB Interfaces: 239The M-Audio Audiophile USB has 7 USB Interfaces:
241a "USB interface": 240a "USB interface":
@@ -277,9 +276,9 @@ Here is a short description of the AltSettings capabilities:
277 - 16-bit depth, 8-48kHz sample mode 276 - 16-bit depth, 8-48kHz sample mode
278 - Synch playback (Do), audio format type III IEC1937_AC-3 277 - Synch playback (Do), audio format type III IEC1937_AC-3
279 278
280In order to ensure a correct intialization of the device, the driver 279In order to ensure a correct initialization of the device, the driver
281_must_know_ how the device will be used: 280_must_know_ how the device will be used:
282 * if DTS is choosen, only Interface 2 with AltSet nb.6 must be 281 * if DTS is chosen, only Interface 2 with AltSet nb.6 must be
283 registered 282 registered
284 * if 96KHz only AltSets nb.1 of each interface must be selected 283 * if 96KHz only AltSets nb.1 of each interface must be selected
285 * if samples are using 24bits/48KHz then AltSet 2 must me used if 284 * if samples are using 24bits/48KHz then AltSet 2 must me used if
@@ -290,7 +289,7 @@ _must_know_ how the device will be used:
290 is not connected 289 is not connected
291 290
292When device_setup is given as a parameter to the snd-usb-audio module, the 291When device_setup is given as a parameter to the snd-usb-audio module, the
293parse_audio_enpoint function uses a quirk called 292parse_audio_endpoints function uses a quirk called
294"audiophile_skip_setting_quirk" in order to prevent AltSettings not 293"audiophile_skip_setting_quirk" in order to prevent AltSettings not
295corresponding to device_setup from being registered in the driver. 294corresponding to device_setup from being registered in the driver.
296 295
@@ -317,9 +316,8 @@ However you may see the following warning message:
317using the "default" ALSA device. This is less efficient than it could be. 316using the "default" ALSA device. This is less efficient than it could be.
318Consider using a hardware device instead rather than using the plug layer." 317Consider using a hardware device instead rather than using the plug layer."
319 318
320
3213.2 - Patching alsa to use direct pcm device 3193.2 - Patching alsa to use direct pcm device
322------------------------------------------- 320--------------------------------------------
323A patch for Jack by Andreas Steinmetz adds support for Big Endian devices. 321A patch for Jack by Andreas Steinmetz adds support for Big Endian devices.
324However it has not been included in the CVS tree. 322However it has not been included in the CVS tree.
325 323
@@ -331,3 +329,32 @@ After having applied the patch you can run jackd with the following command
331line: 329line:
332 % jackd -R -dalsa -Phw:1,0 -r48000 -p128 -n2 -D -Chw:1,1 330 % jackd -R -dalsa -Phw:1,0 -r48000 -p128 -n2 -D -Chw:1,1
333 331
3323.2 - Getting 2 input and/or output interfaces in Jack
333------------------------------------------------------
334
335As you can see, starting the Jack server this way will only enable 1 stereo
336input (Di or Ai) and 1 stereo output (Ao or Do).
337
338This is due to the following restrictions:
339* Jack can only open one capture device and one playback device at a time
340* The Audiophile USB is seen as 2 (or three) Alsa devices: hw:1,0, hw:1,1
341 (and optionally hw:1,2)
342If you want to get Ai+Di and/or Ao+Do support with Jack, you would need to
343combine the Alsa devices into one logical "complex" device.
344
345If you want to give it a try, I recommend reading the information from
346this page: http://www.sound-man.co.uk/linuxaudio/ice1712multi.html
347It is related to another device (ice1712) but can be adapted to suit
348the Audiophile USB.
349
350Enabling multiple Audiophile USB interfaces for Jackd will certainly require:
351* patching Jack with the previously mentioned "Big Endian" patch
352* patching Jackd with the MMAP_COMPLEX patch (see the ice1712 page)
353* patching the alsa-lib/src/pcm/pcm_multi.c file (see the ice1712 page)
354* define a multi device (combination of hw:1,0 and hw:1,1) in your .asoundrc
355 file
356* start jackd with this device
357
358I had no success in testing this for now, but this may be due to my OS
359configuration. If you have any success with this kind of setup, please
360drop me an email.
diff --git a/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl b/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
index 68eeebc17ff4..1faf76383bab 100644
--- a/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
+++ b/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
@@ -1172,7 +1172,7 @@
1172 } 1172 }
1173 1173
1174 /* PCI IDs */ 1174 /* PCI IDs */
1175 static struct pci_device_id snd_mychip_ids[] = { 1175 static struct pci_device_id snd_mychip_ids[] __devinitdata = {
1176 { PCI_VENDOR_ID_FOO, PCI_DEVICE_ID_BAR, 1176 { PCI_VENDOR_ID_FOO, PCI_DEVICE_ID_BAR,
1177 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, 1177 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, },
1178 .... 1178 ....
@@ -1565,7 +1565,7 @@
1565 <informalexample> 1565 <informalexample>
1566 <programlisting> 1566 <programlisting>
1567<![CDATA[ 1567<![CDATA[
1568 static struct pci_device_id snd_mychip_ids[] = { 1568 static struct pci_device_id snd_mychip_ids[] __devinitdata = {
1569 { PCI_VENDOR_ID_FOO, PCI_DEVICE_ID_BAR, 1569 { PCI_VENDOR_ID_FOO, PCI_DEVICE_ID_BAR,
1570 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, 1570 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, },
1571 .... 1571 ....
diff --git a/Documentation/spi/pxa2xx b/Documentation/spi/pxa2xx
new file mode 100644
index 000000000000..9c45f3df2e18
--- /dev/null
+++ b/Documentation/spi/pxa2xx
@@ -0,0 +1,234 @@
1PXA2xx SPI on SSP driver HOWTO
2===================================================
3This a mini howto on the pxa2xx_spi driver. The driver turns a PXA2xx
4synchronous serial port into a SPI master controller
5(see Documentation/spi/spi_summary). The driver has the following features
6
7- Support for any PXA2xx SSP
8- SSP PIO and SSP DMA data transfers.
9- External and Internal (SSPFRM) chip selects.
10- Per slave device (chip) configuration.
11- Full suspend, freeze, resume support.
12
13The driver is built around a "spi_message" fifo serviced by workqueue and a
14tasklet. The workqueue, "pump_messages", drives message fifo and the tasklet
15(pump_transfer) is responsible for queuing SPI transactions and setting up and
16launching the dma/interrupt driven transfers.
17
18Declaring PXA2xx Master Controllers
19-----------------------------------
20Typically a SPI master is defined in the arch/.../mach-*/board-*.c as a
21"platform device". The master configuration is passed to the driver via a table
22found in include/asm-arm/arch-pxa/pxa2xx_spi.h:
23
24struct pxa2xx_spi_master {
25 enum pxa_ssp_type ssp_type;
26 u32 clock_enable;
27 u16 num_chipselect;
28 u8 enable_dma;
29};
30
31The "pxa2xx_spi_master.ssp_type" field must have a value between 1 and 3 and
32informs the driver which features a particular SSP supports.
33
34The "pxa2xx_spi_master.clock_enable" field is used to enable/disable the
35corresponding SSP peripheral block in the "Clock Enable Register (CKEN"). See
36the "PXA2xx Developer Manual" section "Clocks and Power Management".
37
38The "pxa2xx_spi_master.num_chipselect" field is used to determine the number of
39slave device (chips) attached to this SPI master.
40
41The "pxa2xx_spi_master.enable_dma" field informs the driver that SSP DMA should
42be used. This caused the driver to acquire two DMA channels: rx_channel and
43tx_channel. The rx_channel has a higher DMA service priority the tx_channel.
44See the "PXA2xx Developer Manual" section "DMA Controller".
45
46NSSP MASTER SAMPLE
47------------------
48Below is a sample configuration using the PXA255 NSSP.
49
50static struct resource pxa_spi_nssp_resources[] = {
51 [0] = {
52 .start = __PREG(SSCR0_P(2)), /* Start address of NSSP */
53 .end = __PREG(SSCR0_P(2)) + 0x2c, /* Range of registers */
54 .flags = IORESOURCE_MEM,
55 },
56 [1] = {
57 .start = IRQ_NSSP, /* NSSP IRQ */
58 .end = IRQ_NSSP,
59 .flags = IORESOURCE_IRQ,
60 },
61};
62
63static struct pxa2xx_spi_master pxa_nssp_master_info = {
64 .ssp_type = PXA25x_NSSP, /* Type of SSP */
65 .clock_enable = CKEN9_NSSP, /* NSSP Peripheral clock */
66 .num_chipselect = 1, /* Matches the number of chips attached to NSSP */
67 .enable_dma = 1, /* Enables NSSP DMA */
68};
69
70static struct platform_device pxa_spi_nssp = {
71 .name = "pxa2xx-spi", /* MUST BE THIS VALUE, so device match driver */
72 .id = 2, /* Bus number, MUST MATCH SSP number 1..n */
73 .resource = pxa_spi_nssp_resources,
74 .num_resources = ARRAY_SIZE(pxa_spi_nssp_resources),
75 .dev = {
76 .platform_data = &pxa_nssp_master_info, /* Passed to driver */
77 },
78};
79
80static struct platform_device *devices[] __initdata = {
81 &pxa_spi_nssp,
82};
83
84static void __init board_init(void)
85{
86 (void)platform_add_device(devices, ARRAY_SIZE(devices));
87}
88
89Declaring Slave Devices
90-----------------------
91Typically each SPI slave (chip) is defined in the arch/.../mach-*/board-*.c
92using the "spi_board_info" structure found in "linux/spi/spi.h". See
93"Documentation/spi/spi_summary" for additional information.
94
95Each slave device attached to the PXA must provide slave specific configuration
96information via the structure "pxa2xx_spi_chip" found in
97"include/asm-arm/arch-pxa/pxa2xx_spi.h". The pxa2xx_spi master controller driver
98will uses the configuration whenever the driver communicates with the slave
99device.
100
101struct pxa2xx_spi_chip {
102 u8 tx_threshold;
103 u8 rx_threshold;
104 u8 dma_burst_size;
105 u32 timeout_microsecs;
106 u8 enable_loopback;
107 void (*cs_control)(u32 command);
108};
109
110The "pxa2xx_spi_chip.tx_threshold" and "pxa2xx_spi_chip.rx_threshold" fields are
111used to configure the SSP hardware fifo. These fields are critical to the
112performance of pxa2xx_spi driver and misconfiguration will result in rx
113fifo overruns (especially in PIO mode transfers). Good default values are
114
115 .tx_threshold = 12,
116 .rx_threshold = 4,
117
118The "pxa2xx_spi_chip.dma_burst_size" field is used to configure PXA2xx DMA
119engine and is related the "spi_device.bits_per_word" field. Read and understand
120the PXA2xx "Developer Manual" sections on the DMA controller and SSP Controllers
121to determine the correct value. An SSP configured for byte-wide transfers would
122use a value of 8.
123
124The "pxa2xx_spi_chip.timeout_microsecs" fields is used to efficiently handle
125trailing bytes in the SSP receiver fifo. The correct value for this field is
126dependent on the SPI bus speed ("spi_board_info.max_speed_hz") and the specific
127slave device. Please note the the PXA2xx SSP 1 does not support trailing byte
128timeouts and must busy-wait any trailing bytes.
129
130The "pxa2xx_spi_chip.enable_loopback" field is used to place the SSP porting
131into internal loopback mode. In this mode the SSP controller internally
132connects the SSPTX pin the the SSPRX pin. This is useful for initial setup
133testing.
134
135The "pxa2xx_spi_chip.cs_control" field is used to point to a board specific
136function for asserting/deasserting a slave device chip select. If the field is
137NULL, the pxa2xx_spi master controller driver assumes that the SSP port is
138configured to use SSPFRM instead.
139
140NSSP SALVE SAMPLE
141-----------------
142The pxa2xx_spi_chip structure is passed to the pxa2xx_spi driver in the
143"spi_board_info.controller_data" field. Below is a sample configuration using
144the PXA255 NSSP.
145
146/* Chip Select control for the CS8415A SPI slave device */
147static void cs8415a_cs_control(u32 command)
148{
149 if (command & PXA2XX_CS_ASSERT)
150 GPCR(2) = GPIO_bit(2);
151 else
152 GPSR(2) = GPIO_bit(2);
153}
154
155/* Chip Select control for the CS8405A SPI slave device */
156static void cs8405a_cs_control(u32 command)
157{
158 if (command & PXA2XX_CS_ASSERT)
159 GPCR(3) = GPIO_bit(3);
160 else
161 GPSR(3) = GPIO_bit(3);
162}
163
164static struct pxa2xx_spi_chip cs8415a_chip_info = {
165 .tx_threshold = 12, /* SSP hardward FIFO threshold */
166 .rx_threshold = 4, /* SSP hardward FIFO threshold */
167 .dma_burst_size = 8, /* Byte wide transfers used so 8 byte bursts */
168 .timeout_microsecs = 64, /* Wait at least 64usec to handle trailing */
169 .cs_control = cs8415a_cs_control, /* Use external chip select */
170};
171
172static struct pxa2xx_spi_chip cs8405a_chip_info = {
173 .tx_threshold = 12, /* SSP hardward FIFO threshold */
174 .rx_threshold = 4, /* SSP hardward FIFO threshold */
175 .dma_burst_size = 8, /* Byte wide transfers used so 8 byte bursts */
176 .timeout_microsecs = 64, /* Wait at least 64usec to handle trailing */
177 .cs_control = cs8405a_cs_control, /* Use external chip select */
178};
179
180static struct spi_board_info streetracer_spi_board_info[] __initdata = {
181 {
182 .modalias = "cs8415a", /* Name of spi_driver for this device */
183 .max_speed_hz = 3686400, /* Run SSP as fast a possbile */
184 .bus_num = 2, /* Framework bus number */
185 .chip_select = 0, /* Framework chip select */
186 .platform_data = NULL; /* No spi_driver specific config */
187 .controller_data = &cs8415a_chip_info, /* Master chip config */
188 .irq = STREETRACER_APCI_IRQ, /* Slave device interrupt */
189 },
190 {
191 .modalias = "cs8405a", /* Name of spi_driver for this device */
192 .max_speed_hz = 3686400, /* Run SSP as fast a possbile */
193 .bus_num = 2, /* Framework bus number */
194 .chip_select = 1, /* Framework chip select */
195 .controller_data = &cs8405a_chip_info, /* Master chip config */
196 .irq = STREETRACER_APCI_IRQ, /* Slave device interrupt */
197 },
198};
199
200static void __init streetracer_init(void)
201{
202 spi_register_board_info(streetracer_spi_board_info,
203 ARRAY_SIZE(streetracer_spi_board_info));
204}
205
206
207DMA and PIO I/O Support
208-----------------------
209The pxa2xx_spi driver support both DMA and interrupt driven PIO message
210transfers. The driver defaults to PIO mode and DMA transfers must enabled by
211setting the "enable_dma" flag in the "pxa2xx_spi_master" structure and and
212ensuring that the "pxa2xx_spi_chip.dma_burst_size" field is non-zero. The DMA
213mode support both coherent and stream based DMA mappings.
214
215The following logic is used to determine the type of I/O to be used on
216a per "spi_transfer" basis:
217
218if !enable_dma or dma_burst_size == 0 then
219 always use PIO transfers
220
221if spi_message.is_dma_mapped and rx_dma_buf != 0 and tx_dma_buf != 0 then
222 use coherent DMA mode
223
224if rx_buf and tx_buf are aligned on 8 byte boundary then
225 use streaming DMA mode
226
227otherwise
228 use PIO transfer
229
230THANKS TO
231---------
232
233David Brownell and others for mentoring the development of this driver.
234
diff --git a/Documentation/spi/spi-summary b/Documentation/spi/spi-summary
index a5ffba33a351..068732d32276 100644
--- a/Documentation/spi/spi-summary
+++ b/Documentation/spi/spi-summary
@@ -414,7 +414,33 @@ to get the driver-private data allocated for that device.
414The driver will initialize the fields of that spi_master, including the 414The driver will initialize the fields of that spi_master, including the
415bus number (maybe the same as the platform device ID) and three methods 415bus number (maybe the same as the platform device ID) and three methods
416used to interact with the SPI core and SPI protocol drivers. It will 416used to interact with the SPI core and SPI protocol drivers. It will
417also initialize its own internal state. 417also initialize its own internal state. (See below about bus numbering
418and those methods.)
419
420After you initialize the spi_master, then use spi_register_master() to
421publish it to the rest of the system. At that time, device nodes for
422the controller and any predeclared spi devices will be made available,
423and the driver model core will take care of binding them to drivers.
424
425If you need to remove your SPI controller driver, spi_unregister_master()
426will reverse the effect of spi_register_master().
427
428
429BUS NUMBERING
430
431Bus numbering is important, since that's how Linux identifies a given
432SPI bus (shared SCK, MOSI, MISO). Valid bus numbers start at zero. On
433SOC systems, the bus numbers should match the numbers defined by the chip
434manufacturer. For example, hardware controller SPI2 would be bus number 2,
435and spi_board_info for devices connected to it would use that number.
436
437If you don't have such hardware-assigned bus number, and for some reason
438you can't just assign them, then provide a negative bus number. That will
439then be replaced by a dynamically assigned number. You'd then need to treat
440this as a non-static configuration (see above).
441
442
443SPI MASTER METHODS
418 444
419 master->setup(struct spi_device *spi) 445 master->setup(struct spi_device *spi)
420 This sets up the device clock rate, SPI mode, and word sizes. 446 This sets up the device clock rate, SPI mode, and word sizes.
@@ -431,6 +457,9 @@ also initialize its own internal state.
431 state it dynamically associates with that device. If you do that, 457 state it dynamically associates with that device. If you do that,
432 be sure to provide the cleanup() method to free that state. 458 be sure to provide the cleanup() method to free that state.
433 459
460
461SPI MESSAGE QUEUE
462
434The bulk of the driver will be managing the I/O queue fed by transfer(). 463The bulk of the driver will be managing the I/O queue fed by transfer().
435 464
436That queue could be purely conceptual. For example, a driver used only 465That queue could be purely conceptual. For example, a driver used only
@@ -440,6 +469,9 @@ But the queue will probably be very real, using message->queue, PIO,
440often DMA (especially if the root filesystem is in SPI flash), and 469often DMA (especially if the root filesystem is in SPI flash), and
441execution contexts like IRQ handlers, tasklets, or workqueues (such 470execution contexts like IRQ handlers, tasklets, or workqueues (such
442as keventd). Your driver can be as fancy, or as simple, as you need. 471as keventd). Your driver can be as fancy, or as simple, as you need.
472Such a transfer() method would normally just add the message to a
473queue, and then start some asynchronous transfer engine (unless it's
474already running).
443 475
444 476
445THANKS TO 477THANKS TO
diff --git a/Documentation/vm/hugetlbpage.txt b/Documentation/vm/hugetlbpage.txt
index 2803f63c1a27..687104bfd09a 100644
--- a/Documentation/vm/hugetlbpage.txt
+++ b/Documentation/vm/hugetlbpage.txt
@@ -32,7 +32,16 @@ The output of "cat /proc/meminfo" will have lines like:
32..... 32.....
33HugePages_Total: xxx 33HugePages_Total: xxx
34HugePages_Free: yyy 34HugePages_Free: yyy
35Hugepagesize: zzz KB 35HugePages_Rsvd: www
36Hugepagesize: zzz kB
37
38where:
39HugePages_Total is the size of the pool of hugepages.
40HugePages_Free is the number of hugepages in the pool that are not yet
41allocated.
42HugePages_Rsvd is short for "reserved," and is the number of hugepages
43for which a commitment to allocate from the pool has been made, but no
44allocation has yet been made. It's vaguely analogous to overcommit.
36 45
37/proc/filesystems should also show a filesystem of type "hugetlbfs" configured 46/proc/filesystems should also show a filesystem of type "hugetlbfs" configured
38in the kernel. 47in the kernel.
diff --git a/Documentation/watchdog/watchdog-api.txt b/Documentation/watchdog/watchdog-api.txt
index c5beb548cfc4..21ed51173662 100644
--- a/Documentation/watchdog/watchdog-api.txt
+++ b/Documentation/watchdog/watchdog-api.txt
@@ -36,6 +36,9 @@ timeout or margin. The simplest way to ping the watchdog is to write
36some data to the device. So a very simple watchdog daemon would look 36some data to the device. So a very simple watchdog daemon would look
37like this: 37like this:
38 38
39#include <stdlib.h>
40#include <fcntl.h>
41
39int main(int argc, const char *argv[]) { 42int main(int argc, const char *argv[]) {
40 int fd=open("/dev/watchdog",O_WRONLY); 43 int fd=open("/dev/watchdog",O_WRONLY);
41 if (fd==-1) { 44 if (fd==-1) {
diff --git a/MAINTAINERS b/MAINTAINERS
index db647bf8830b..07e7fd8f50cf 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -40,11 +40,20 @@ trivial patch so apply some common sense.
40 PLEASE document known bugs. If it doesn't work for everything 40 PLEASE document known bugs. If it doesn't work for everything
41 or does something very odd once a month document it. 41 or does something very odd once a month document it.
42 42
43 PLEASE remember that submissions must be made under the terms
44 of the OSDL certificate of contribution
45 (http://www.osdl.org/newsroom/press_releases/2004/2004_05_24_dco.html)
46 and should include a Signed-off-by: line.
47
436. Make sure you have the right to send any changes you make. If you 486. Make sure you have the right to send any changes you make. If you
44 do changes at work you may find your employer owns the patch 49 do changes at work you may find your employer owns the patch
45 not you. 50 not you.
46 51
477. Happy hacking. 527. When sending security related changes or reports to a maintainer
53 please Cc: security@kernel.org, especially if the maintainer
54 does not respond.
55
568. Happy hacking.
48 57
49 ----------------------------------- 58 -----------------------------------
50 59
@@ -411,6 +420,7 @@ AX.25 NETWORK LAYER
411P: Ralf Baechle 420P: Ralf Baechle
412M: ralf@linux-mips.org 421M: ralf@linux-mips.org
413L: linux-hams@vger.kernel.org 422L: linux-hams@vger.kernel.org
423W: http://www.linux-ax25.org/
414S: Maintained 424S: Maintained
415 425
416BAYCOM/HDLCDRV DRIVERS FOR AX.25 426BAYCOM/HDLCDRV DRIVERS FOR AX.25
@@ -420,6 +430,14 @@ L: linux-hams@vger.kernel.org
420W: http://www.baycom.org/~tom/ham/ham.html 430W: http://www.baycom.org/~tom/ham/ham.html
421S: Maintained 431S: Maintained
422 432
433BCM43XX WIRELESS DRIVER
434P: Michael Buesch
435M: mb@bu3sch.de
436P: Stefano Brivio
437M: st3@riseup.net
438W: http://bcm43xx.berlios.de/
439S: Maintained
440
423BEFS FILE SYSTEM 441BEFS FILE SYSTEM
424P: Sergey S. Kostyliov 442P: Sergey S. Kostyliov
425M: rathamahata@php4.ru 443M: rathamahata@php4.ru
@@ -547,7 +565,19 @@ BROADBAND PROCESSOR ARCHITECTURE
547P: Arnd Bergmann 565P: Arnd Bergmann
548M: arnd@arndb.de 566M: arnd@arndb.de
549L: linuxppc-dev@ozlabs.org 567L: linuxppc-dev@ozlabs.org
550W: http://linuxppc64.org 568W: http://www.penguinppc.org/ppc64/
569S: Supported
570
571BROADCOM BNX2 GIGABIT ETHERNET DRIVER
572P: Michael Chan
573M: mchan@broadcom.com
574L: netdev@vger.kernel.org
575S: Supported
576
577BROADCOM TG3 GIGABIT ETHERNET DRIVER
578P: Michael Chan
579M: mchan@broadcom.com
580L: netdev@vger.kernel.org
551S: Supported 581S: Supported
552 582
553BTTV VIDEO4LINUX DRIVER 583BTTV VIDEO4LINUX DRIVER
@@ -960,7 +990,7 @@ S: Maintained
960EXT3 FILE SYSTEM 990EXT3 FILE SYSTEM
961P: Stephen Tweedie, Andrew Morton 991P: Stephen Tweedie, Andrew Morton
962M: sct@redhat.com, akpm@osdl.org, adilger@clusterfs.com 992M: sct@redhat.com, akpm@osdl.org, adilger@clusterfs.com
963L: ext3-users@redhat.com 993L: ext2-devel@lists.sourceforge.net
964S: Maintained 994S: Maintained
965 995
966F71805F HARDWARE MONITORING DRIVER 996F71805F HARDWARE MONITORING DRIVER
@@ -1463,6 +1493,13 @@ M: support@pathscale.com
1463L: openib-general@openib.org 1493L: openib-general@openib.org
1464S: Supported 1494S: Supported
1465 1495
1496IPMI SUBSYSTEM
1497P: Corey Minyard
1498M: minyard@acm.org
1499L: openipmi-developer@lists.sourceforge.net
1500W: http://openipmi.sourceforge.net/
1501S: Supported
1502
1466IPX NETWORK LAYER 1503IPX NETWORK LAYER
1467P: Arnaldo Carvalho de Melo 1504P: Arnaldo Carvalho de Melo
1468M: acme@conectiva.com.br 1505M: acme@conectiva.com.br
@@ -1470,10 +1507,11 @@ L: netdev@vger.kernel.org
1470S: Maintained 1507S: Maintained
1471 1508
1472IRDA SUBSYSTEM 1509IRDA SUBSYSTEM
1473P: Jean Tourrilhes 1510P: Samuel Ortiz
1511M: samuel@sortiz.org
1474L: irda-users@lists.sourceforge.net (subscribers-only) 1512L: irda-users@lists.sourceforge.net (subscribers-only)
1475W: http://irda.sourceforge.net/ 1513W: http://irda.sourceforge.net/
1476S: Odd Fixes 1514S: Maintained
1477 1515
1478ISAPNP 1516ISAPNP
1479P: Jaroslav Kysela 1517P: Jaroslav Kysela
@@ -1519,12 +1557,28 @@ W: http://jfs.sourceforge.net/
1519T: git kernel.org:/pub/scm/linux/kernel/git/shaggy/jfs-2.6.git 1557T: git kernel.org:/pub/scm/linux/kernel/git/shaggy/jfs-2.6.git
1520S: Supported 1558S: Supported
1521 1559
1560JOURNALLING LAYER FOR BLOCK DEVICS (JBD)
1561P: Stephen Tweedie, Andrew Morton
1562M: sct@redhat.com, akpm@osdl.org
1563L: ext2-devel@lists.sourceforge.net
1564S: Maintained
1565
1522KCONFIG 1566KCONFIG
1523P: Roman Zippel 1567P: Roman Zippel
1524M: zippel@linux-m68k.org 1568M: zippel@linux-m68k.org
1525L: kbuild-devel@lists.sourceforge.net 1569L: kbuild-devel@lists.sourceforge.net
1526S: Maintained 1570S: Maintained
1527 1571
1572KDUMP
1573P: Vivek Goyal
1574M: vgoyal@in.ibm.com
1575P: Haren Myneni
1576M: hbabu@us.ibm.com
1577L: fastboot@lists.osdl.org
1578L: linux-kernel@vger.kernel.org
1579W: http://lse.sourceforge.net/kdump/
1580S: Maintained
1581
1528KERNEL AUTOMOUNTER (AUTOFS) 1582KERNEL AUTOMOUNTER (AUTOFS)
1529P: H. Peter Anvin 1583P: H. Peter Anvin
1530M: hpa@zytor.com 1584M: hpa@zytor.com
@@ -1592,6 +1646,11 @@ M: James.Bottomley@HansenPartnership.com
1592L: linux-scsi@vger.kernel.org 1646L: linux-scsi@vger.kernel.org
1593S: Maintained 1647S: Maintained
1594 1648
1649LED SUBSYSTEM
1650P: Richard Purdie
1651M: rpurdie@rpsys.net
1652S: Maintained
1653
1595LEGO USB Tower driver 1654LEGO USB Tower driver
1596P: Juergen Stuber 1655P: Juergen Stuber
1597M: starblue@users.sourceforge.net 1656M: starblue@users.sourceforge.net
@@ -1651,7 +1710,7 @@ S: Maintained
1651 1710
1652LINUX FOR POWERPC EMBEDDED PPC8XX 1711LINUX FOR POWERPC EMBEDDED PPC8XX
1653P: Marcelo Tosatti 1712P: Marcelo Tosatti
1654M: marcelo.tosatti@cyclades.com 1713M: marcelo@kvack.org
1655W: http://www.penguinppc.org/ 1714W: http://www.penguinppc.org/
1656L: linuxppc-embedded@ozlabs.org 1715L: linuxppc-embedded@ozlabs.org
1657S: Maintained 1716S: Maintained
@@ -1675,7 +1734,7 @@ M: paulus@au.ibm.com
1675P: Anton Blanchard 1734P: Anton Blanchard
1676M: anton@samba.org 1735M: anton@samba.org
1677M: anton@au.ibm.com 1736M: anton@au.ibm.com
1678W: http://linuxppc64.org 1737W: http://www.penguinppc.org/ppc64/
1679L: linuxppc-dev@ozlabs.org 1738L: linuxppc-dev@ozlabs.org
1680S: Supported 1739S: Supported
1681 1740
@@ -1836,6 +1895,11 @@ L: linux-kernel@vger.kernel.org
1836W: http://www.atnf.csiro.au/~rgooch/linux/kernel-patches.html 1895W: http://www.atnf.csiro.au/~rgooch/linux/kernel-patches.html
1837S: Maintained 1896S: Maintained
1838 1897
1898MULTIMEDIA CARD SUBSYSTEM
1899P: Russell King
1900M: rmk+mmc@arm.linux.org.uk
1901S: Maintained
1902
1839MULTISOUND SOUND DRIVER 1903MULTISOUND SOUND DRIVER
1840P: Andrew Veliath 1904P: Andrew Veliath
1841M: andrewtv@usa.net 1905M: andrewtv@usa.net
@@ -1858,6 +1922,12 @@ M: James.Bottomley@HansenPartnership.com
1858L: linux-scsi@vger.kernel.org 1922L: linux-scsi@vger.kernel.org
1859S: Maintained 1923S: Maintained
1860 1924
1925NETEM NETWORK EMULATOR
1926P: Stephen Hemminger
1927M: shemminger@osdl.org
1928L: netem@osdl.org
1929S: Maintained
1930
1861NETFILTER/IPTABLES/IPCHAINS 1931NETFILTER/IPTABLES/IPCHAINS
1862P: Rusty Russell 1932P: Rusty Russell
1863P: Marc Boucher 1933P: Marc Boucher
@@ -1875,6 +1945,7 @@ NETROM NETWORK LAYER
1875P: Ralf Baechle 1945P: Ralf Baechle
1876M: ralf@linux-mips.org 1946M: ralf@linux-mips.org
1877L: linux-hams@vger.kernel.org 1947L: linux-hams@vger.kernel.org
1948W: http://www.linux-ax25.org/
1878S: Maintained 1949S: Maintained
1879 1950
1880NETWORK BLOCK DEVICE 1951NETWORK BLOCK DEVICE
@@ -2062,8 +2133,12 @@ P: Matthew Wilcox
2062M: matthew@wil.cx 2133M: matthew@wil.cx
2063P: Grant Grundler 2134P: Grant Grundler
2064M: grundler@parisc-linux.org 2135M: grundler@parisc-linux.org
2136P: Kyle McMartin
2137M: kyle@parisc-linux.org
2065L: parisc-linux@parisc-linux.org 2138L: parisc-linux@parisc-linux.org
2066W: http://www.parisc-linux.org/ 2139W: http://www.parisc-linux.org/
2140T: git kernel.org:/pub/scm/linux/kernel/git/kyle/parisc-2.6.git
2141T: cvs cvs.parisc-linux.org:/var/cvs/linux-2.6
2067S: Maintained 2142S: Maintained
2068 2143
2069PCI ERROR RECOVERY 2144PCI ERROR RECOVERY
@@ -2266,6 +2341,7 @@ ROSE NETWORK LAYER
2266P: Ralf Baechle 2341P: Ralf Baechle
2267M: ralf@linux-mips.org 2342M: ralf@linux-mips.org
2268L: linux-hams@vger.kernel.org 2343L: linux-hams@vger.kernel.org
2344W: http://www.linux-ax25.org/
2269S: Maintained 2345S: Maintained
2270 2346
2271RISCOM8 DRIVER 2347RISCOM8 DRIVER
@@ -2496,6 +2572,12 @@ M: perex@suse.cz
2496L: alsa-devel@alsa-project.org 2572L: alsa-devel@alsa-project.org
2497S: Maintained 2573S: Maintained
2498 2574
2575SPI SUBSYSTEM
2576P: David Brownell
2577M: dbrownell@users.sourceforge.net
2578L: spi-devel-general@lists.sourceforge.net
2579S: Maintained
2580
2499TPM DEVICE DRIVER 2581TPM DEVICE DRIVER
2500P: Kylene Hall 2582P: Kylene Hall
2501M: kjhall@us.ibm.com 2583M: kjhall@us.ibm.com
diff --git a/Makefile b/Makefile
index fc8e08c419f0..a3a7baad8555 100644
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,8 @@
1VERSION = 2 1VERSION = 2
2PATCHLEVEL = 6 2PATCHLEVEL = 6
3SUBLEVEL = 17 3SUBLEVEL = 17
4EXTRAVERSION =-rc1 4EXTRAVERSION =-rc6
5NAME=Sliding Snow Leopard 5NAME=Crazed Snow-Weasel
6 6
7# *DOCUMENTATION* 7# *DOCUMENTATION*
8# To see a list of typical targets execute "make help" 8# To see a list of typical targets execute "make help"
@@ -344,16 +344,14 @@ scripts_basic:
344scripts/basic/%: scripts_basic ; 344scripts/basic/%: scripts_basic ;
345 345
346PHONY += outputmakefile 346PHONY += outputmakefile
347# outputmakefile generate a Makefile to be placed in output directory, if 347# outputmakefile generates a Makefile in the output directory, if using a
348# using a seperate output directory. This allows convinient use 348# separate output directory. This allows convenient use of make in the
349# of make in output directory 349# output directory.
350outputmakefile: 350outputmakefile:
351 $(Q)if test ! $(srctree) -ef $(objtree); then \ 351ifneq ($(KBUILD_SRC),)
352 $(CONFIG_SHELL) $(srctree)/scripts/mkmakefile \ 352 $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkmakefile \
353 $(srctree) $(objtree) $(VERSION) $(PATCHLEVEL) \ 353 $(srctree) $(objtree) $(VERSION) $(PATCHLEVEL)
354 > $(objtree)/Makefile; \ 354endif
355 echo ' GEN $(objtree)/Makefile'; \
356 fi
357 355
358# To make sure we do not include .config for any of the *config targets 356# To make sure we do not include .config for any of the *config targets
359# catch them early, and hand them over to scripts/kconfig/Makefile 357# catch them early, and hand them over to scripts/kconfig/Makefile
@@ -796,8 +794,8 @@ prepare2: prepare3 outputmakefile
796prepare1: prepare2 include/linux/version.h include/asm \ 794prepare1: prepare2 include/linux/version.h include/asm \
797 include/config/MARKER 795 include/config/MARKER
798ifneq ($(KBUILD_MODULES),) 796ifneq ($(KBUILD_MODULES),)
799 $(Q)rm -rf $(MODVERDIR)
800 $(Q)mkdir -p $(MODVERDIR) 797 $(Q)mkdir -p $(MODVERDIR)
798 $(Q)rm -f $(MODVERDIR)/*
801endif 799endif
802 800
803archprepare: prepare1 scripts_basic 801archprepare: prepare1 scripts_basic
@@ -1086,8 +1084,8 @@ else # KBUILD_EXTMOD
1086KBUILD_MODULES := 1 1084KBUILD_MODULES := 1
1087PHONY += crmodverdir 1085PHONY += crmodverdir
1088crmodverdir: 1086crmodverdir:
1089 $(Q)rm -rf $(MODVERDIR)
1090 $(Q)mkdir -p $(MODVERDIR) 1087 $(Q)mkdir -p $(MODVERDIR)
1088 $(Q)rm -f $(MODVERDIR)/*
1091 1089
1092PHONY += $(objtree)/Module.symvers 1090PHONY += $(objtree)/Module.symvers
1093$(objtree)/Module.symvers: 1091$(objtree)/Module.symvers:
diff --git a/README b/README
index 05e055530bbb..3e264723b863 100644
--- a/README
+++ b/README
@@ -165,10 +165,31 @@ CONFIGURING the kernel:
165 "make xconfig" X windows (Qt) based configuration tool. 165 "make xconfig" X windows (Qt) based configuration tool.
166 "make gconfig" X windows (Gtk) based configuration tool. 166 "make gconfig" X windows (Gtk) based configuration tool.
167 "make oldconfig" Default all questions based on the contents of 167 "make oldconfig" Default all questions based on the contents of
168 your existing ./.config file. 168 your existing ./.config file and asking about
169 new config symbols.
169 "make silentoldconfig" 170 "make silentoldconfig"
170 Like above, but avoids cluttering the screen 171 Like above, but avoids cluttering the screen
171 with questions already answered. 172 with questions already answered.
173 "make defconfig" Create a ./.config file by using the default
174 symbol values from arch/$ARCH/defconfig.
175 "make allyesconfig"
176 Create a ./.config file by setting symbol
177 values to 'y' as much as possible.
178 "make allmodconfig"
179 Create a ./.config file by setting symbol
180 values to 'm' as much as possible.
181 "make allnoconfig" Create a ./.config file by setting symbol
182 values to 'n' as much as possible.
183 "make randconfig" Create a ./.config file by setting symbol
184 values to random values.
185
186 The allyesconfig/allmodconfig/allnoconfig/randconfig variants can
187 also use the environment variable KCONFIG_ALLCONFIG to specify a
188 filename that contains config options that the user requires to be
189 set to a specific value. If KCONFIG_ALLCONFIG=filename is not used,
190 "make *config" checks for a file named "all{yes/mod/no/random}.config"
191 for symbol values that are to be forced. If this file is not found,
192 it checks for a file named "all.config" to contain forced values.
172 193
173 NOTES on "make config": 194 NOTES on "make config":
174 - having unnecessary drivers will make the kernel bigger, and can 195 - having unnecessary drivers will make the kernel bigger, and can
diff --git a/arch/alpha/kernel/alpha_ksyms.c b/arch/alpha/kernel/alpha_ksyms.c
index c645c5e14786..2b245ad731ee 100644
--- a/arch/alpha/kernel/alpha_ksyms.c
+++ b/arch/alpha/kernel/alpha_ksyms.c
@@ -182,7 +182,6 @@ EXPORT_SYMBOL(smp_num_cpus);
182EXPORT_SYMBOL(smp_call_function); 182EXPORT_SYMBOL(smp_call_function);
183EXPORT_SYMBOL(smp_call_function_on_cpu); 183EXPORT_SYMBOL(smp_call_function_on_cpu);
184EXPORT_SYMBOL(_atomic_dec_and_lock); 184EXPORT_SYMBOL(_atomic_dec_and_lock);
185EXPORT_SYMBOL(cpu_present_mask);
186#endif /* CONFIG_SMP */ 185#endif /* CONFIG_SMP */
187 186
188/* 187/*
diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c
index 9924fd07743a..c760a831fd1a 100644
--- a/arch/alpha/kernel/process.c
+++ b/arch/alpha/kernel/process.c
@@ -94,7 +94,7 @@ common_shutdown_1(void *generic_ptr)
94 if (cpuid != boot_cpuid) { 94 if (cpuid != boot_cpuid) {
95 flags |= 0x00040000UL; /* "remain halted" */ 95 flags |= 0x00040000UL; /* "remain halted" */
96 *pflags = flags; 96 *pflags = flags;
97 clear_bit(cpuid, &cpu_present_mask); 97 cpu_clear(cpuid, cpu_present_map);
98 halt(); 98 halt();
99 } 99 }
100#endif 100#endif
@@ -120,8 +120,8 @@ common_shutdown_1(void *generic_ptr)
120 120
121#ifdef CONFIG_SMP 121#ifdef CONFIG_SMP
122 /* Wait for the secondaries to halt. */ 122 /* Wait for the secondaries to halt. */
123 cpu_clear(boot_cpuid, cpu_possible_map); 123 cpu_clear(boot_cpuid, cpu_present_map);
124 while (cpus_weight(cpu_possible_map)) 124 while (cpus_weight(cpu_present_map))
125 barrier(); 125 barrier();
126#endif 126#endif
127 127
diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c
index 185255416e85..4dc273e537fd 100644
--- a/arch/alpha/kernel/smp.c
+++ b/arch/alpha/kernel/smp.c
@@ -68,7 +68,6 @@ enum ipi_message_type {
68static int smp_secondary_alive __initdata = 0; 68static int smp_secondary_alive __initdata = 0;
69 69
70/* Which cpus ids came online. */ 70/* Which cpus ids came online. */
71cpumask_t cpu_present_mask;
72cpumask_t cpu_online_map; 71cpumask_t cpu_online_map;
73 72
74EXPORT_SYMBOL(cpu_online_map); 73EXPORT_SYMBOL(cpu_online_map);
@@ -439,7 +438,7 @@ setup_smp(void)
439 if ((cpu->flags & 0x1cc) == 0x1cc) { 438 if ((cpu->flags & 0x1cc) == 0x1cc) {
440 smp_num_probed++; 439 smp_num_probed++;
441 /* Assume here that "whami" == index */ 440 /* Assume here that "whami" == index */
442 cpu_set(i, cpu_present_mask); 441 cpu_set(i, cpu_present_map);
443 cpu->pal_revision = boot_cpu_palrev; 442 cpu->pal_revision = boot_cpu_palrev;
444 } 443 }
445 444
@@ -450,11 +449,10 @@ setup_smp(void)
450 } 449 }
451 } else { 450 } else {
452 smp_num_probed = 1; 451 smp_num_probed = 1;
453 cpu_set(boot_cpuid, cpu_present_mask);
454 } 452 }
455 453
456 printk(KERN_INFO "SMP: %d CPUs probed -- cpu_present_mask = %lx\n", 454 printk(KERN_INFO "SMP: %d CPUs probed -- cpu_present_map = %lx\n",
457 smp_num_probed, cpu_possible_map.bits[0]); 455 smp_num_probed, cpu_present_map.bits[0]);
458} 456}
459 457
460/* 458/*
@@ -473,7 +471,7 @@ smp_prepare_cpus(unsigned int max_cpus)
473 471
474 /* Nothing to do on a UP box, or when told not to. */ 472 /* Nothing to do on a UP box, or when told not to. */
475 if (smp_num_probed == 1 || max_cpus == 0) { 473 if (smp_num_probed == 1 || max_cpus == 0) {
476 cpu_present_mask = cpumask_of_cpu(boot_cpuid); 474 cpu_present_map = cpumask_of_cpu(boot_cpuid);
477 printk(KERN_INFO "SMP mode deactivated.\n"); 475 printk(KERN_INFO "SMP mode deactivated.\n");
478 return; 476 return;
479 } 477 }
@@ -486,10 +484,6 @@ smp_prepare_cpus(unsigned int max_cpus)
486void __devinit 484void __devinit
487smp_prepare_boot_cpu(void) 485smp_prepare_boot_cpu(void)
488{ 486{
489 /*
490 * Mark the boot cpu (current cpu) as online
491 */
492 cpu_set(smp_processor_id(), cpu_online_map);
493} 487}
494 488
495int __devinit 489int __devinit
diff --git a/arch/alpha/kernel/sys_titan.c b/arch/alpha/kernel/sys_titan.c
index 5f84417eeb7b..2551fb49ae09 100644
--- a/arch/alpha/kernel/sys_titan.c
+++ b/arch/alpha/kernel/sys_titan.c
@@ -66,7 +66,7 @@ titan_update_irq_hw(unsigned long mask)
66 register int bcpu = boot_cpuid; 66 register int bcpu = boot_cpuid;
67 67
68#ifdef CONFIG_SMP 68#ifdef CONFIG_SMP
69 cpumask_t cpm = cpu_present_mask; 69 cpumask_t cpm = cpu_present_map;
70 volatile unsigned long *dim0, *dim1, *dim2, *dim3; 70 volatile unsigned long *dim0, *dim1, *dim2, *dim3;
71 unsigned long mask0, mask1, mask2, mask3, dummy; 71 unsigned long mask0, mask1, mask2, mask3, dummy;
72 72
diff --git a/arch/alpha/lib/strncpy.S b/arch/alpha/lib/strncpy.S
index 338551c7113c..bbdef1be5f95 100644
--- a/arch/alpha/lib/strncpy.S
+++ b/arch/alpha/lib/strncpy.S
@@ -43,8 +43,8 @@ strncpy:
43 43
44 .align 4 44 .align 4
45$multiword: 45$multiword:
46 subq $24, 1, $2 # clear the final bits in the prev word 46 subq $27, 1, $2 # clear the final bits in the prev word
47 or $2, $24, $2 47 or $2, $27, $2
48 zapnot $1, $2, $1 48 zapnot $1, $2, $1
49 subq $18, 1, $18 49 subq $18, 1, $18
50 50
@@ -70,8 +70,8 @@ $multiword:
70 bne $18, 0b 70 bne $18, 0b
71 71
721: ldq_u $1, 0($16) # clear the leading bits in the final word 721: ldq_u $1, 0($16) # clear the leading bits in the final word
73 subq $27, 1, $2 73 subq $24, 1, $2
74 or $2, $27, $2 74 or $2, $24, $2
75 75
76 zap $1, $2, $1 76 zap $1, $2, $1
77 stq_u $1, 0($16) 77 stq_u $1, 0($16)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 1dbf6ddb300d..08b7cc900cae 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -150,8 +150,6 @@ config ARCH_IOP3XX
150 150
151config ARCH_IXP4XX 151config ARCH_IXP4XX
152 bool "IXP4xx-based" 152 bool "IXP4xx-based"
153 select DMABOUNCE
154 select PCI
155 help 153 help
156 Support for Intel's IXP4XX (XScale) family of processors. 154 Support for Intel's IXP4XX (XScale) family of processors.
157 155
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index 5d3acff8c596..d22f38b957db 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -101,7 +101,7 @@ config DEBUG_S3C2410_UART
101 help 101 help
102 Choice for UART for kernel low-level using S3C2410 UARTS, 102 Choice for UART for kernel low-level using S3C2410 UARTS,
103 should be between zero and two. The port must have been 103 should be between zero and two. The port must have been
104 initalised by the boot-loader before use. 104 initialised by the boot-loader before use.
105 105
106 The uncompressor code port configuration is now handled 106 The uncompressor code port configuration is now handled
107 by CONFIG_S3C2410_LOWLEVEL_UART_PORT. 107 by CONFIG_S3C2410_LOWLEVEL_UART_PORT.
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 95a96275f88a..6f8e84c1c1f2 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -66,7 +66,7 @@ tune-$(CONFIG_CPU_XSC3) :=$(call cc-option,-mtune=xscale,-mtune=strongarm110) -
66tune-$(CONFIG_CPU_V6) :=$(call cc-option,-mtune=arm1136j-s,-mtune=strongarm) 66tune-$(CONFIG_CPU_V6) :=$(call cc-option,-mtune=arm1136j-s,-mtune=strongarm)
67 67
68ifeq ($(CONFIG_AEABI),y) 68ifeq ($(CONFIG_AEABI),y)
69CFLAGS_ABI :=-mabi=aapcs -mno-thumb-interwork 69CFLAGS_ABI :=-mabi=aapcs-linux -mno-thumb-interwork
70else 70else
71CFLAGS_ABI :=$(call cc-option,-mapcs-32,-mabi=apcs-gnu) $(call cc-option,-mno-thumb-interwork,) 71CFLAGS_ABI :=$(call cc-option,-mapcs-32,-mabi=apcs-gnu) $(call cc-option,-mno-thumb-interwork,)
72endif 72endif
diff --git a/arch/arm/boot/compressed/misc.c b/arch/arm/boot/compressed/misc.c
index 0af3772efcb7..ace3fb5835d9 100644
--- a/arch/arm/boot/compressed/misc.c
+++ b/arch/arm/boot/compressed/misc.c
@@ -38,10 +38,10 @@ static void icedcc_putc(int ch)
38 if (--i < 0) 38 if (--i < 0)
39 return; 39 return;
40 40
41 asm("mrc p14, 0, %0, c0, c0, 0" : "=r" (status)); 41 asm volatile ("mrc p14, 0, %0, c0, c0, 0" : "=r" (status));
42 } while (status & 2); 42 } while (status & 2);
43 43
44 asm("mcr p15, 0, %0, c1, c0, 0" : : "r" (ch)); 44 asm("mcr p14, 0, %0, c1, c0, 0" : : "r" (ch));
45} 45}
46 46
47#define putc(ch) icedcc_putc(ch) 47#define putc(ch) icedcc_putc(ch)
diff --git a/arch/arm/common/scoop.c b/arch/arm/common/scoop.c
index 5e830f444c6c..314ebd3a1d71 100644
--- a/arch/arm/common/scoop.c
+++ b/arch/arm/common/scoop.c
@@ -18,6 +18,18 @@
18#include <asm/io.h> 18#include <asm/io.h>
19#include <asm/hardware/scoop.h> 19#include <asm/hardware/scoop.h>
20 20
21/* PCMCIA to Scoop linkage
22
23 There is no easy way to link multiple scoop devices into one
24 single entity for the pxa2xx_pcmcia device so this structure
25 is used which is setup by the platform code.
26
27 This file is never modular so this symbol is always
28 accessile to the board support files.
29*/
30struct scoop_pcmcia_config *platform_scoop_config;
31EXPORT_SYMBOL(platform_scoop_config);
32
21#define SCOOP_REG(d,adr) (*(volatile unsigned short*)(d +(adr))) 33#define SCOOP_REG(d,adr) (*(volatile unsigned short*)(d +(adr)))
22 34
23struct scoop_dev { 35struct scoop_dev {
diff --git a/arch/arm/configs/collie_defconfig b/arch/arm/configs/collie_defconfig
index c9aa878e610a..074c47a4fb2e 100644
--- a/arch/arm/configs/collie_defconfig
+++ b/arch/arm/configs/collie_defconfig
@@ -1,21 +1,21 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.14-rc3 3# Linux kernel version: 2.6.17-rc1
4# Sun Oct 9 16:55:14 2005 4# Fri Apr 14 19:09:52 2006
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_MMU=y 7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y 8CONFIG_RWSEM_GENERIC_SPINLOCK=y
9CONFIG_GENERIC_HWEIGHT=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y 10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_ARCH_MTD_XIP=y
12CONFIG_VECTORS_BASE=0xffff0000
11 13
12# 14#
13# Code maturity level options 15# Code maturity level options
14# 16#
15CONFIG_EXPERIMENTAL=y 17CONFIG_EXPERIMENTAL=y
16CONFIG_CLEAN_COMPILE=y
17CONFIG_BROKEN_ON_SMP=y 18CONFIG_BROKEN_ON_SMP=y
18CONFIG_LOCK_KERNEL=y
19CONFIG_INIT_ENV_ARG_LIMIT=32 19CONFIG_INIT_ENV_ARG_LIMIT=32
20 20
21# 21#
@@ -23,45 +23,58 @@ CONFIG_INIT_ENV_ARG_LIMIT=32
23# 23#
24CONFIG_LOCALVERSION="" 24CONFIG_LOCALVERSION=""
25CONFIG_LOCALVERSION_AUTO=y 25CONFIG_LOCALVERSION_AUTO=y
26CONFIG_SWAP=y 26# CONFIG_SWAP is not set
27CONFIG_SYSVIPC=y 27CONFIG_SYSVIPC=y
28# CONFIG_POSIX_MQUEUE is not set 28# CONFIG_POSIX_MQUEUE is not set
29CONFIG_BSD_PROCESS_ACCT=y 29# CONFIG_BSD_PROCESS_ACCT is not set
30# CONFIG_BSD_PROCESS_ACCT_V3 is not set
31CONFIG_SYSCTL=y 30CONFIG_SYSCTL=y
32# CONFIG_AUDIT is not set 31# CONFIG_AUDIT is not set
33CONFIG_HOTPLUG=y
34CONFIG_KOBJECT_UEVENT=y
35# CONFIG_IKCONFIG is not set 32# CONFIG_IKCONFIG is not set
33# CONFIG_RELAY is not set
36CONFIG_INITRAMFS_SOURCE="" 34CONFIG_INITRAMFS_SOURCE=""
35CONFIG_UID16=y
36# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
37CONFIG_EMBEDDED=y 37CONFIG_EMBEDDED=y
38CONFIG_KALLSYMS=y 38CONFIG_KALLSYMS=y
39# CONFIG_KALLSYMS_ALL is not set 39# CONFIG_KALLSYMS_ALL is not set
40# CONFIG_KALLSYMS_EXTRA_PASS is not set 40# CONFIG_KALLSYMS_EXTRA_PASS is not set
41CONFIG_HOTPLUG=y
41CONFIG_PRINTK=y 42CONFIG_PRINTK=y
42CONFIG_BUG=y 43CONFIG_BUG=y
43CONFIG_BASE_FULL=y 44CONFIG_ELF_CORE=y
45# CONFIG_BASE_FULL is not set
44CONFIG_FUTEX=y 46CONFIG_FUTEX=y
45CONFIG_EPOLL=y 47# CONFIG_EPOLL is not set
46# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
47CONFIG_SHMEM=y 48CONFIG_SHMEM=y
48CONFIG_CC_ALIGN_FUNCTIONS=0 49# CONFIG_SLAB is not set
49CONFIG_CC_ALIGN_LABELS=0 50CONFIG_DOUBLEFAULT=y
50CONFIG_CC_ALIGN_LOOPS=0
51CONFIG_CC_ALIGN_JUMPS=0
52# CONFIG_TINY_SHMEM is not set 51# CONFIG_TINY_SHMEM is not set
53CONFIG_BASE_SMALL=0 52CONFIG_BASE_SMALL=1
53CONFIG_SLOB=y
54CONFIG_OBSOLETE_INTERMODULE=y
54 55
55# 56#
56# Loadable module support 57# Loadable module support
57# 58#
58CONFIG_MODULES=y 59# CONFIG_MODULES is not set
59CONFIG_MODULE_UNLOAD=y 60
60CONFIG_MODULE_FORCE_UNLOAD=y 61#
61CONFIG_OBSOLETE_MODPARM=y 62# Block layer
62CONFIG_MODVERSIONS=y 63#
63# CONFIG_MODULE_SRCVERSION_ALL is not set 64# CONFIG_BLK_DEV_IO_TRACE is not set
64CONFIG_KMOD=y 65
66#
67# IO Schedulers
68#
69CONFIG_IOSCHED_NOOP=y
70CONFIG_IOSCHED_AS=y
71# CONFIG_IOSCHED_DEADLINE is not set
72# CONFIG_IOSCHED_CFQ is not set
73CONFIG_DEFAULT_AS=y
74# CONFIG_DEFAULT_DEADLINE is not set
75# CONFIG_DEFAULT_CFQ is not set
76# CONFIG_DEFAULT_NOOP is not set
77CONFIG_DEFAULT_IOSCHED="anticipatory"
65 78
66# 79#
67# System Type 80# System Type
@@ -70,11 +83,13 @@ CONFIG_KMOD=y
70# CONFIG_ARCH_CLPS711X is not set 83# CONFIG_ARCH_CLPS711X is not set
71# CONFIG_ARCH_CO285 is not set 84# CONFIG_ARCH_CO285 is not set
72# CONFIG_ARCH_EBSA110 is not set 85# CONFIG_ARCH_EBSA110 is not set
86# CONFIG_ARCH_EP93XX is not set
73# CONFIG_ARCH_FOOTBRIDGE is not set 87# CONFIG_ARCH_FOOTBRIDGE is not set
74# CONFIG_ARCH_INTEGRATOR is not set 88# CONFIG_ARCH_INTEGRATOR is not set
75# CONFIG_ARCH_IOP3XX is not set 89# CONFIG_ARCH_IOP3XX is not set
76# CONFIG_ARCH_IXP4XX is not set 90# CONFIG_ARCH_IXP4XX is not set
77# CONFIG_ARCH_IXP2000 is not set 91# CONFIG_ARCH_IXP2000 is not set
92# CONFIG_ARCH_IXP23XX is not set
78# CONFIG_ARCH_L7200 is not set 93# CONFIG_ARCH_L7200 is not set
79# CONFIG_ARCH_PXA is not set 94# CONFIG_ARCH_PXA is not set
80# CONFIG_ARCH_RPC is not set 95# CONFIG_ARCH_RPC is not set
@@ -84,9 +99,11 @@ CONFIG_ARCH_SA1100=y
84# CONFIG_ARCH_LH7A40X is not set 99# CONFIG_ARCH_LH7A40X is not set
85# CONFIG_ARCH_OMAP is not set 100# CONFIG_ARCH_OMAP is not set
86# CONFIG_ARCH_VERSATILE is not set 101# CONFIG_ARCH_VERSATILE is not set
102# CONFIG_ARCH_REALVIEW is not set
87# CONFIG_ARCH_IMX is not set 103# CONFIG_ARCH_IMX is not set
88# CONFIG_ARCH_H720X is not set 104# CONFIG_ARCH_H720X is not set
89# CONFIG_ARCH_AAEC2000 is not set 105# CONFIG_ARCH_AAEC2000 is not set
106# CONFIG_ARCH_AT91RM9200 is not set
90 107
91# 108#
92# SA11x0 Implementations 109# SA11x0 Implementations
@@ -128,20 +145,32 @@ CONFIG_SHARP_SCOOP=y
128# Bus support 145# Bus support
129# 146#
130CONFIG_ISA=y 147CONFIG_ISA=y
131CONFIG_ISA_DMA_API=y
132 148
133# 149#
134# PCCARD (PCMCIA/CardBus) support 150# PCCARD (PCMCIA/CardBus) support
135# 151#
136# CONFIG_PCCARD is not set 152CONFIG_PCCARD=y
153CONFIG_PCMCIA_DEBUG=y
154CONFIG_PCMCIA=y
155CONFIG_PCMCIA_LOAD_CIS=y
156CONFIG_PCMCIA_IOCTL=y
157
158#
159# PC-card bridges
160#
161# CONFIG_I82365 is not set
162# CONFIG_TCIC is not set
163CONFIG_PCMCIA_SA1100=y
137 164
138# 165#
139# Kernel Features 166# Kernel Features
140# 167#
141# CONFIG_SMP is not set 168# CONFIG_PREEMPT is not set
142CONFIG_PREEMPT=y
143# CONFIG_NO_IDLE_HZ is not set 169# CONFIG_NO_IDLE_HZ is not set
170CONFIG_HZ=100
171# CONFIG_AEABI is not set
144CONFIG_ARCH_DISCONTIGMEM_ENABLE=y 172CONFIG_ARCH_DISCONTIGMEM_ENABLE=y
173CONFIG_NODES_SHIFT=2
145CONFIG_SELECT_MEMORY_MODEL=y 174CONFIG_SELECT_MEMORY_MODEL=y
146# CONFIG_FLATMEM_MANUAL is not set 175# CONFIG_FLATMEM_MANUAL is not set
147CONFIG_DISCONTIGMEM_MANUAL=y 176CONFIG_DISCONTIGMEM_MANUAL=y
@@ -150,6 +179,7 @@ CONFIG_DISCONTIGMEM=y
150CONFIG_FLAT_NODE_MEM_MAP=y 179CONFIG_FLAT_NODE_MEM_MAP=y
151CONFIG_NEED_MULTIPLE_NODES=y 180CONFIG_NEED_MULTIPLE_NODES=y
152# CONFIG_SPARSEMEM_STATIC is not set 181# CONFIG_SPARSEMEM_STATIC is not set
182CONFIG_SPLIT_PTLOCK_CPUS=4096
153# CONFIG_LEDS is not set 183# CONFIG_LEDS is not set
154CONFIG_ALIGNMENT_TRAP=y 184CONFIG_ALIGNMENT_TRAP=y
155 185
@@ -158,7 +188,7 @@ CONFIG_ALIGNMENT_TRAP=y
158# 188#
159CONFIG_ZBOOT_ROM_TEXT=0x0 189CONFIG_ZBOOT_ROM_TEXT=0x0
160CONFIG_ZBOOT_ROM_BSS=0x0 190CONFIG_ZBOOT_ROM_BSS=0x0
161CONFIG_CMDLINE="console=ttyS0,115200n8 console=tty1 noinitrd root=/dev/mtdblock2 rootfstype=jffs2 debug" 191CONFIG_CMDLINE="noinitrd root=/dev/mtdblock2 rootfstype=jffs2 fbcon=rotate:1"
162# CONFIG_XIP_KERNEL is not set 192# CONFIG_XIP_KERNEL is not set
163 193
164# 194#
@@ -181,14 +211,16 @@ CONFIG_FPE_NWFPE=y
181# Userspace binary formats 211# Userspace binary formats
182# 212#
183CONFIG_BINFMT_ELF=y 213CONFIG_BINFMT_ELF=y
184CONFIG_BINFMT_AOUT=m 214# CONFIG_BINFMT_AOUT is not set
185CONFIG_BINFMT_MISC=m 215# CONFIG_BINFMT_MISC is not set
186# CONFIG_ARTHUR is not set 216# CONFIG_ARTHUR is not set
187 217
188# 218#
189# Power management options 219# Power management options
190# 220#
191CONFIG_PM=y 221CONFIG_PM=y
222CONFIG_PM_LEGACY=y
223# CONFIG_PM_DEBUG is not set
192CONFIG_APM=y 224CONFIG_APM=y
193 225
194# 226#
@@ -199,6 +231,7 @@ CONFIG_NET=y
199# 231#
200# Networking options 232# Networking options
201# 233#
234# CONFIG_NETDEBUG is not set
202CONFIG_PACKET=y 235CONFIG_PACKET=y
203CONFIG_PACKET_MMAP=y 236CONFIG_PACKET_MMAP=y
204CONFIG_UNIX=y 237CONFIG_UNIX=y
@@ -211,16 +244,19 @@ CONFIG_IP_FIB_HASH=y
211# CONFIG_NET_IPIP is not set 244# CONFIG_NET_IPIP is not set
212# CONFIG_NET_IPGRE is not set 245# CONFIG_NET_IPGRE is not set
213# CONFIG_ARPD is not set 246# CONFIG_ARPD is not set
214CONFIG_SYN_COOKIES=y 247# CONFIG_SYN_COOKIES is not set
215# CONFIG_INET_AH is not set 248# CONFIG_INET_AH is not set
216# CONFIG_INET_ESP is not set 249# CONFIG_INET_ESP is not set
217# CONFIG_INET_IPCOMP is not set 250# CONFIG_INET_IPCOMP is not set
251# CONFIG_INET_XFRM_TUNNEL is not set
218# CONFIG_INET_TUNNEL is not set 252# CONFIG_INET_TUNNEL is not set
219CONFIG_INET_DIAG=y 253CONFIG_INET_DIAG=y
220CONFIG_INET_TCP_DIAG=y 254CONFIG_INET_TCP_DIAG=y
221# CONFIG_TCP_CONG_ADVANCED is not set 255# CONFIG_TCP_CONG_ADVANCED is not set
222CONFIG_TCP_CONG_BIC=y 256CONFIG_TCP_CONG_BIC=y
223# CONFIG_IPV6 is not set 257# CONFIG_IPV6 is not set
258# CONFIG_INET6_XFRM_TUNNEL is not set
259# CONFIG_INET6_TUNNEL is not set
224# CONFIG_NETFILTER is not set 260# CONFIG_NETFILTER is not set
225 261
226# 262#
@@ -232,6 +268,11 @@ CONFIG_TCP_CONG_BIC=y
232# SCTP Configuration (EXPERIMENTAL) 268# SCTP Configuration (EXPERIMENTAL)
233# 269#
234# CONFIG_IP_SCTP is not set 270# CONFIG_IP_SCTP is not set
271
272#
273# TIPC Configuration (EXPERIMENTAL)
274#
275# CONFIG_TIPC is not set
235# CONFIG_ATM is not set 276# CONFIG_ATM is not set
236# CONFIG_BRIDGE is not set 277# CONFIG_BRIDGE is not set
237# CONFIG_VLAN_8021Q is not set 278# CONFIG_VLAN_8021Q is not set
@@ -244,8 +285,11 @@ CONFIG_TCP_CONG_BIC=y
244# CONFIG_NET_DIVERT is not set 285# CONFIG_NET_DIVERT is not set
245# CONFIG_ECONET is not set 286# CONFIG_ECONET is not set
246# CONFIG_WAN_ROUTER is not set 287# CONFIG_WAN_ROUTER is not set
288
289#
290# QoS and/or fair queueing
291#
247# CONFIG_NET_SCHED is not set 292# CONFIG_NET_SCHED is not set
248# CONFIG_NET_CLS_ROUTE is not set
249 293
250# 294#
251# Network testing 295# Network testing
@@ -265,10 +309,15 @@ CONFIG_TCP_CONG_BIC=y
265# 309#
266CONFIG_STANDALONE=y 310CONFIG_STANDALONE=y
267CONFIG_PREVENT_FIRMWARE_BUILD=y 311CONFIG_PREVENT_FIRMWARE_BUILD=y
268CONFIG_FW_LOADER=m 312CONFIG_FW_LOADER=y
269# CONFIG_DEBUG_DRIVER is not set 313# CONFIG_DEBUG_DRIVER is not set
270 314
271# 315#
316# Connector - unified userspace <-> kernelspace linker
317#
318# CONFIG_CONNECTOR is not set
319
320#
272# Memory Technology Devices (MTD) 321# Memory Technology Devices (MTD)
273# 322#
274CONFIG_MTD=y 323CONFIG_MTD=y
@@ -287,32 +336,49 @@ CONFIG_MTD_BLOCK=y
287# CONFIG_FTL is not set 336# CONFIG_FTL is not set
288# CONFIG_NFTL is not set 337# CONFIG_NFTL is not set
289# CONFIG_INFTL is not set 338# CONFIG_INFTL is not set
339# CONFIG_RFD_FTL is not set
290 340
291# 341#
292# RAM/ROM/Flash chip drivers 342# RAM/ROM/Flash chip drivers
293# 343#
294# CONFIG_MTD_CFI is not set 344CONFIG_MTD_CFI=y
295# CONFIG_MTD_JEDECPROBE is not set 345CONFIG_MTD_JEDECPROBE=y
296CONFIG_MTD_MAP_BANK_WIDTH_1=y 346CONFIG_MTD_GEN_PROBE=y
297CONFIG_MTD_MAP_BANK_WIDTH_2=y 347CONFIG_MTD_CFI_ADV_OPTIONS=y
348CONFIG_MTD_CFI_NOSWAP=y
349# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
350# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
351CONFIG_MTD_CFI_GEOMETRY=y
352# CONFIG_MTD_MAP_BANK_WIDTH_1 is not set
353# CONFIG_MTD_MAP_BANK_WIDTH_2 is not set
298CONFIG_MTD_MAP_BANK_WIDTH_4=y 354CONFIG_MTD_MAP_BANK_WIDTH_4=y
299# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set 355# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
300# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set 356# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
301# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set 357# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
302CONFIG_MTD_CFI_I1=y 358# CONFIG_MTD_CFI_I1 is not set
303CONFIG_MTD_CFI_I2=y 359# CONFIG_MTD_CFI_I2 is not set
304# CONFIG_MTD_CFI_I4 is not set 360CONFIG_MTD_CFI_I4=y
305# CONFIG_MTD_CFI_I8 is not set 361# CONFIG_MTD_CFI_I8 is not set
362# CONFIG_MTD_OTP is not set
363CONFIG_MTD_CFI_INTELEXT=y
364# CONFIG_MTD_CFI_AMDSTD is not set
365# CONFIG_MTD_CFI_STAA is not set
366CONFIG_MTD_CFI_UTIL=y
306# CONFIG_MTD_RAM is not set 367# CONFIG_MTD_RAM is not set
307# CONFIG_MTD_ROM is not set 368# CONFIG_MTD_ROM is not set
308# CONFIG_MTD_ABSENT is not set 369# CONFIG_MTD_ABSENT is not set
309CONFIG_MTD_OBSOLETE_CHIPS=y 370CONFIG_MTD_OBSOLETE_CHIPS=y
310CONFIG_MTD_SHARP=y 371CONFIG_MTD_SHARP=y
372# CONFIG_MTD_XIP is not set
311 373
312# 374#
313# Mapping drivers for chip access 375# Mapping drivers for chip access
314# 376#
315# CONFIG_MTD_COMPLEX_MAPPINGS is not set 377# CONFIG_MTD_COMPLEX_MAPPINGS is not set
378# CONFIG_MTD_PHYSMAP is not set
379# CONFIG_MTD_ARM_INTEGRATOR is not set
380CONFIG_MTD_SA1100=y
381# CONFIG_MTD_IMPA7 is not set
316# CONFIG_MTD_PLATRAM is not set 382# CONFIG_MTD_PLATRAM is not set
317 383
318# 384#
@@ -321,7 +387,6 @@ CONFIG_MTD_SHARP=y
321# CONFIG_MTD_SLRAM is not set 387# CONFIG_MTD_SLRAM is not set
322# CONFIG_MTD_PHRAM is not set 388# CONFIG_MTD_PHRAM is not set
323# CONFIG_MTD_MTDRAM is not set 389# CONFIG_MTD_MTDRAM is not set
324# CONFIG_MTD_BLKMTD is not set
325# CONFIG_MTD_BLOCK2MTD is not set 390# CONFIG_MTD_BLOCK2MTD is not set
326 391
327# 392#
@@ -337,6 +402,11 @@ CONFIG_MTD_SHARP=y
337# CONFIG_MTD_NAND is not set 402# CONFIG_MTD_NAND is not set
338 403
339# 404#
405# OneNAND Flash Device Drivers
406#
407# CONFIG_MTD_ONENAND is not set
408
409#
340# Parallel port support 410# Parallel port support
341# 411#
342# CONFIG_PARPORT is not set 412# CONFIG_PARPORT is not set
@@ -349,7 +419,6 @@ CONFIG_MTD_SHARP=y
349# 419#
350# Block devices 420# Block devices
351# 421#
352# CONFIG_BLK_DEV_XD is not set
353# CONFIG_BLK_DEV_COW_COMMON is not set 422# CONFIG_BLK_DEV_COW_COMMON is not set
354CONFIG_BLK_DEV_LOOP=y 423CONFIG_BLK_DEV_LOOP=y
355# CONFIG_BLK_DEV_CRYPTOLOOP is not set 424# CONFIG_BLK_DEV_CRYPTOLOOP is not set
@@ -359,20 +428,35 @@ CONFIG_BLK_DEV_RAM_COUNT=16
359CONFIG_BLK_DEV_RAM_SIZE=1024 428CONFIG_BLK_DEV_RAM_SIZE=1024
360CONFIG_BLK_DEV_INITRD=y 429CONFIG_BLK_DEV_INITRD=y
361# CONFIG_CDROM_PKTCDVD is not set 430# CONFIG_CDROM_PKTCDVD is not set
431# CONFIG_ATA_OVER_ETH is not set
362 432
363# 433#
364# IO Schedulers 434# ATA/ATAPI/MFM/RLL support
365# 435#
366CONFIG_IOSCHED_NOOP=y 436CONFIG_IDE=y
367CONFIG_IOSCHED_AS=y 437CONFIG_BLK_DEV_IDE=y
368CONFIG_IOSCHED_DEADLINE=y
369CONFIG_IOSCHED_CFQ=y
370CONFIG_ATA_OVER_ETH=m
371 438
372# 439#
373# ATA/ATAPI/MFM/RLL support 440# Please see Documentation/ide.txt for help/info on IDE drives
441#
442# CONFIG_BLK_DEV_IDE_SATA is not set
443CONFIG_BLK_DEV_IDEDISK=y
444CONFIG_IDEDISK_MULTI_MODE=y
445CONFIG_BLK_DEV_IDECS=y
446# CONFIG_BLK_DEV_IDECD is not set
447# CONFIG_BLK_DEV_IDETAPE is not set
448# CONFIG_BLK_DEV_IDEFLOPPY is not set
449# CONFIG_IDE_TASK_IOCTL is not set
450
451#
452# IDE chipset support/bugfixes
374# 453#
375# CONFIG_IDE is not set 454CONFIG_IDE_GENERIC=y
455# CONFIG_IDE_ARM is not set
456# CONFIG_IDE_CHIPSETS is not set
457# CONFIG_BLK_DEV_IDEDMA is not set
458# CONFIG_IDEDMA_AUTO is not set
459# CONFIG_BLK_DEV_HD is not set
376 460
377# 461#
378# SCSI device support 462# SCSI device support
@@ -402,6 +486,39 @@ CONFIG_ATA_OVER_ETH=m
402# Network device support 486# Network device support
403# 487#
404# CONFIG_NETDEVICES is not set 488# CONFIG_NETDEVICES is not set
489# CONFIG_DUMMY is not set
490# CONFIG_BONDING is not set
491# CONFIG_EQUALIZER is not set
492# CONFIG_TUN is not set
493
494#
495# PHY device support
496#
497
498#
499# Ethernet (10 or 100Mbit)
500#
501# CONFIG_NET_ETHERNET is not set
502
503#
504# Ethernet (1000 Mbit)
505#
506
507#
508# Ethernet (10000 Mbit)
509#
510CONFIG_PPP=y
511# CONFIG_PPP_MULTILINK is not set
512# CONFIG_PPP_FILTER is not set
513CONFIG_PPP_ASYNC=y
514# CONFIG_PPP_SYNC_TTY is not set
515# CONFIG_PPP_DEFLATE is not set
516# CONFIG_PPP_BSDCOMP is not set
517# CONFIG_PPP_MPPE is not set
518# CONFIG_PPPOE is not set
519# CONFIG_SLIP is not set
520# CONFIG_SHAPER is not set
521# CONFIG_NETCONSOLE is not set
405# CONFIG_NETPOLL is not set 522# CONFIG_NETPOLL is not set
406# CONFIG_NET_POLL_CONTROLLER is not set 523# CONFIG_NET_POLL_CONTROLLER is not set
407 524
@@ -424,7 +541,7 @@ CONFIG_INPUT_TSDEV=y
424CONFIG_INPUT_TSDEV_SCREEN_X=240 541CONFIG_INPUT_TSDEV_SCREEN_X=240
425CONFIG_INPUT_TSDEV_SCREEN_Y=320 542CONFIG_INPUT_TSDEV_SCREEN_Y=320
426CONFIG_INPUT_EVDEV=y 543CONFIG_INPUT_EVDEV=y
427CONFIG_INPUT_EVBUG=y 544# CONFIG_INPUT_EVBUG is not set
428 545
429# 546#
430# Input Device Drivers 547# Input Device Drivers
@@ -438,7 +555,11 @@ CONFIG_KEYBOARD_LOCOMO=y
438# CONFIG_KEYBOARD_NEWTON is not set 555# CONFIG_KEYBOARD_NEWTON is not set
439# CONFIG_INPUT_MOUSE is not set 556# CONFIG_INPUT_MOUSE is not set
440# CONFIG_INPUT_JOYSTICK is not set 557# CONFIG_INPUT_JOYSTICK is not set
441# CONFIG_INPUT_TOUCHSCREEN is not set 558CONFIG_INPUT_TOUCHSCREEN=y
559# CONFIG_TOUCHSCREEN_GUNZE is not set
560# CONFIG_TOUCHSCREEN_ELO is not set
561# CONFIG_TOUCHSCREEN_MTOUCH is not set
562# CONFIG_TOUCHSCREEN_MK712 is not set
442# CONFIG_INPUT_MISC is not set 563# CONFIG_INPUT_MISC is not set
443 564
444# 565#
@@ -461,7 +582,16 @@ CONFIG_HW_CONSOLE=y
461# 582#
462# Serial drivers 583# Serial drivers
463# 584#
464# CONFIG_SERIAL_8250 is not set 585CONFIG_SERIAL_8250=y
586# CONFIG_SERIAL_8250_CONSOLE is not set
587CONFIG_SERIAL_8250_CS=y
588CONFIG_SERIAL_8250_NR_UARTS=4
589CONFIG_SERIAL_8250_RUNTIME_UARTS=4
590CONFIG_SERIAL_8250_EXTENDED=y
591# CONFIG_SERIAL_8250_MANY_PORTS is not set
592# CONFIG_SERIAL_8250_SHARE_IRQ is not set
593# CONFIG_SERIAL_8250_DETECT_IRQ is not set
594# CONFIG_SERIAL_8250_RSA is not set
465 595
466# 596#
467# Non-8250 serial port support 597# Non-8250 serial port support
@@ -483,94 +613,48 @@ CONFIG_UNIX98_PTYS=y
483# 613#
484# CONFIG_WATCHDOG is not set 614# CONFIG_WATCHDOG is not set
485# CONFIG_NVRAM is not set 615# CONFIG_NVRAM is not set
486# CONFIG_RTC is not set
487# CONFIG_DTLK is not set 616# CONFIG_DTLK is not set
488# CONFIG_R3964 is not set 617# CONFIG_R3964 is not set
489 618
490# 619#
491# Ftape, the floppy tape device driver 620# Ftape, the floppy tape device driver
492# 621#
493# CONFIG_RAW_DRIVER is not set
494 622
495# 623#
496# TPM devices 624# PCMCIA character devices
497# 625#
626# CONFIG_SYNCLINK_CS is not set
627# CONFIG_CARDMAN_4000 is not set
628# CONFIG_CARDMAN_4040 is not set
629# CONFIG_RAW_DRIVER is not set
498 630
499# 631#
500# I2C support 632# TPM devices
501# 633#
502CONFIG_I2C=m 634# CONFIG_TCG_TPM is not set
503# CONFIG_I2C_CHARDEV is not set 635# CONFIG_TELCLOCK is not set
504 636
505# 637#
506# I2C Algorithms 638# I2C support
507# 639#
508CONFIG_I2C_ALGOBIT=m 640# CONFIG_I2C is not set
509# CONFIG_I2C_ALGOPCF is not set
510# CONFIG_I2C_ALGOPCA is not set
511 641
512# 642#
513# I2C Hardware Bus support 643# SPI support
514# 644#
515# CONFIG_I2C_ELEKTOR is not set 645# CONFIG_SPI is not set
516# CONFIG_I2C_PARPORT_LIGHT is not set 646# CONFIG_SPI_MASTER is not set
517# CONFIG_I2C_STUB is not set
518# CONFIG_I2C_PCA_ISA is not set
519 647
520# 648#
521# Miscellaneous I2C Chip support 649# Dallas's 1-wire bus
522# 650#
523# CONFIG_SENSORS_DS1337 is not set 651# CONFIG_W1 is not set
524# CONFIG_SENSORS_DS1374 is not set
525# CONFIG_SENSORS_EEPROM is not set
526# CONFIG_SENSORS_PCF8574 is not set
527# CONFIG_SENSORS_PCA9539 is not set
528# CONFIG_SENSORS_PCF8591 is not set
529# CONFIG_SENSORS_RTC8564 is not set
530# CONFIG_SENSORS_MAX6875 is not set
531# CONFIG_I2C_DEBUG_CORE is not set
532# CONFIG_I2C_DEBUG_ALGO is not set
533# CONFIG_I2C_DEBUG_BUS is not set
534# CONFIG_I2C_DEBUG_CHIP is not set
535 652
536# 653#
537# Hardware Monitoring support 654# Hardware Monitoring support
538# 655#
539CONFIG_HWMON=y 656# CONFIG_HWMON is not set
540# CONFIG_HWMON_VID is not set 657# CONFIG_HWMON_VID is not set
541# CONFIG_SENSORS_ADM1021 is not set
542# CONFIG_SENSORS_ADM1025 is not set
543# CONFIG_SENSORS_ADM1026 is not set
544# CONFIG_SENSORS_ADM1031 is not set
545# CONFIG_SENSORS_ADM9240 is not set
546# CONFIG_SENSORS_ASB100 is not set
547# CONFIG_SENSORS_ATXP1 is not set
548# CONFIG_SENSORS_DS1621 is not set
549# CONFIG_SENSORS_FSCHER is not set
550# CONFIG_SENSORS_FSCPOS is not set
551# CONFIG_SENSORS_GL518SM is not set
552# CONFIG_SENSORS_GL520SM is not set
553# CONFIG_SENSORS_IT87 is not set
554# CONFIG_SENSORS_LM63 is not set
555# CONFIG_SENSORS_LM75 is not set
556# CONFIG_SENSORS_LM77 is not set
557# CONFIG_SENSORS_LM78 is not set
558# CONFIG_SENSORS_LM80 is not set
559# CONFIG_SENSORS_LM83 is not set
560# CONFIG_SENSORS_LM85 is not set
561# CONFIG_SENSORS_LM87 is not set
562# CONFIG_SENSORS_LM90 is not set
563# CONFIG_SENSORS_LM92 is not set
564# CONFIG_SENSORS_MAX1619 is not set
565# CONFIG_SENSORS_PC87360 is not set
566# CONFIG_SENSORS_SMSC47M1 is not set
567# CONFIG_SENSORS_SMSC47B397 is not set
568# CONFIG_SENSORS_W83781D is not set
569# CONFIG_SENSORS_W83792D is not set
570# CONFIG_SENSORS_W83L785TS is not set
571# CONFIG_SENSORS_W83627HF is not set
572# CONFIG_SENSORS_W83627EHF is not set
573# CONFIG_HWMON_DEBUG_CHIP is not set
574 658
575# 659#
576# Misc devices 660# Misc devices
@@ -579,42 +663,33 @@ CONFIG_HWMON=y
579# 663#
580# Multimedia Capabilities Port drivers 664# Multimedia Capabilities Port drivers
581# 665#
582# CONFIG_MCP_SA11X0 is not set 666CONFIG_MCP=y
667CONFIG_MCP_SA11X0=y
668CONFIG_MCP_UCB1200=y
669CONFIG_MCP_UCB1200_TS=y
583 670
584# 671#
585# Multimedia devices 672# LED devices
586# 673#
587CONFIG_VIDEO_DEV=m 674CONFIG_NEW_LEDS=y
675CONFIG_LEDS_CLASS=y
588 676
589# 677#
590# Video For Linux 678# LED drivers
591# 679#
680CONFIG_LEDS_LOCOMO=y
592 681
593# 682#
594# Video Adapters 683# LED Triggers
595# 684#
596# CONFIG_VIDEO_PMS is not set 685CONFIG_LEDS_TRIGGERS=y
597# CONFIG_VIDEO_CPIA is not set 686CONFIG_LEDS_TRIGGER_TIMER=y
598# CONFIG_VIDEO_SAA5246A is not set 687CONFIG_LEDS_TRIGGER_IDE_DISK=y
599# CONFIG_VIDEO_SAA5249 is not set
600# CONFIG_TUNER_3036 is not set
601# CONFIG_VIDEO_OVCAMCHIP is not set
602 688
603# 689#
604# Radio Adapters 690# Multimedia devices
605# 691#
606# CONFIG_RADIO_CADET is not set 692# CONFIG_VIDEO_DEV is not set
607# CONFIG_RADIO_RTRACK is not set
608# CONFIG_RADIO_RTRACK2 is not set
609# CONFIG_RADIO_AZTECH is not set
610# CONFIG_RADIO_GEMTEK is not set
611# CONFIG_RADIO_MAESTRO is not set
612# CONFIG_RADIO_SF16FMI is not set
613# CONFIG_RADIO_SF16FMR2 is not set
614# CONFIG_RADIO_TERRATEC is not set
615# CONFIG_RADIO_TRUST is not set
616# CONFIG_RADIO_TYPHOON is not set
617# CONFIG_RADIO_ZOLTRIX is not set
618 693
619# 694#
620# Digital Video Broadcasting Devices 695# Digital Video Broadcasting Devices
@@ -628,8 +703,8 @@ CONFIG_FB=y
628CONFIG_FB_CFB_FILLRECT=y 703CONFIG_FB_CFB_FILLRECT=y
629CONFIG_FB_CFB_COPYAREA=y 704CONFIG_FB_CFB_COPYAREA=y
630CONFIG_FB_CFB_IMAGEBLIT=y 705CONFIG_FB_CFB_IMAGEBLIT=y
631CONFIG_FB_SOFT_CURSOR=y
632# CONFIG_FB_MACMODES is not set 706# CONFIG_FB_MACMODES is not set
707# CONFIG_FB_FIRMWARE_EDID is not set
633CONFIG_FB_MODE_HELPERS=y 708CONFIG_FB_MODE_HELPERS=y
634# CONFIG_FB_TILEBLITTING is not set 709# CONFIG_FB_TILEBLITTING is not set
635CONFIG_FB_SA1100=y 710CONFIG_FB_SA1100=y
@@ -643,14 +718,15 @@ CONFIG_FB_SA1100=y
643# CONFIG_MDA_CONSOLE is not set 718# CONFIG_MDA_CONSOLE is not set
644CONFIG_DUMMY_CONSOLE=y 719CONFIG_DUMMY_CONSOLE=y
645CONFIG_FRAMEBUFFER_CONSOLE=y 720CONFIG_FRAMEBUFFER_CONSOLE=y
721CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
646CONFIG_FONTS=y 722CONFIG_FONTS=y
647CONFIG_FONT_8x8=y 723# CONFIG_FONT_8x8 is not set
648# CONFIG_FONT_8x16 is not set 724# CONFIG_FONT_8x16 is not set
649# CONFIG_FONT_6x11 is not set 725# CONFIG_FONT_6x11 is not set
650# CONFIG_FONT_7x14 is not set 726# CONFIG_FONT_7x14 is not set
651# CONFIG_FONT_PEARL_8x8 is not set 727# CONFIG_FONT_PEARL_8x8 is not set
652# CONFIG_FONT_ACORN_8x8 is not set 728# CONFIG_FONT_ACORN_8x8 is not set
653# CONFIG_FONT_MINI_4x6 is not set 729CONFIG_FONT_MINI_4x6=y
654# CONFIG_FONT_SUN8x16 is not set 730# CONFIG_FONT_SUN8x16 is not set
655# CONFIG_FONT_SUN12x22 is not set 731# CONFIG_FONT_SUN12x22 is not set
656# CONFIG_FONT_10x18 is not set 732# CONFIG_FONT_10x18 is not set
@@ -659,7 +735,11 @@ CONFIG_FONT_8x8=y
659# Logo configuration 735# Logo configuration
660# 736#
661# CONFIG_LOGO is not set 737# CONFIG_LOGO is not set
662# CONFIG_BACKLIGHT_LCD_SUPPORT is not set 738CONFIG_BACKLIGHT_LCD_SUPPORT=y
739CONFIG_BACKLIGHT_CLASS_DEVICE=y
740CONFIG_BACKLIGHT_DEVICE=y
741CONFIG_LCD_CLASS_DEVICE=y
742CONFIG_LCD_DEVICE=y
663 743
664# 744#
665# Sound 745# Sound
@@ -671,20 +751,17 @@ CONFIG_FONT_8x8=y
671# 751#
672CONFIG_USB_ARCH_HAS_HCD=y 752CONFIG_USB_ARCH_HAS_HCD=y
673# CONFIG_USB_ARCH_HAS_OHCI is not set 753# CONFIG_USB_ARCH_HAS_OHCI is not set
754# CONFIG_USB_ARCH_HAS_EHCI is not set
674# CONFIG_USB is not set 755# CONFIG_USB is not set
675 756
676# 757#
758# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
759#
760
761#
677# USB Gadget Support 762# USB Gadget Support
678# 763#
679CONFIG_USB_GADGET=y 764# CONFIG_USB_GADGET is not set
680# CONFIG_USB_GADGET_DEBUG_FILES is not set
681# CONFIG_USB_GADGET_NET2280 is not set
682# CONFIG_USB_GADGET_PXA2XX is not set
683# CONFIG_USB_GADGET_GOKU is not set
684# CONFIG_USB_GADGET_LH7A40X is not set
685# CONFIG_USB_GADGET_OMAP is not set
686# CONFIG_USB_GADGET_DUMMY_HCD is not set
687# CONFIG_USB_GADGET_DUALSPEED is not set
688 765
689# 766#
690# MMC/SD Card support 767# MMC/SD Card support
@@ -692,23 +769,24 @@ CONFIG_USB_GADGET=y
692# CONFIG_MMC is not set 769# CONFIG_MMC is not set
693 770
694# 771#
772# Real Time Clock
773#
774CONFIG_RTC_LIB=y
775# CONFIG_RTC_CLASS is not set
776
777#
695# File systems 778# File systems
696# 779#
697CONFIG_EXT2_FS=y 780# CONFIG_EXT2_FS is not set
698CONFIG_EXT2_FS_XATTR=y
699CONFIG_EXT2_FS_POSIX_ACL=y
700CONFIG_EXT2_FS_SECURITY=y
701# CONFIG_EXT2_FS_XIP is not set
702# CONFIG_EXT3_FS is not set 781# CONFIG_EXT3_FS is not set
703# CONFIG_JBD is not set
704CONFIG_FS_MBCACHE=y
705# CONFIG_REISERFS_FS is not set 782# CONFIG_REISERFS_FS is not set
706# CONFIG_JFS_FS is not set 783# CONFIG_JFS_FS is not set
707CONFIG_FS_POSIX_ACL=y 784# CONFIG_FS_POSIX_ACL is not set
708# CONFIG_XFS_FS is not set 785# CONFIG_XFS_FS is not set
786# CONFIG_OCFS2_FS is not set
709# CONFIG_MINIX_FS is not set 787# CONFIG_MINIX_FS is not set
710CONFIG_ROMFS_FS=y 788CONFIG_ROMFS_FS=y
711CONFIG_INOTIFY=y 789# CONFIG_INOTIFY is not set
712# CONFIG_QUOTA is not set 790# CONFIG_QUOTA is not set
713# CONFIG_DNOTIFY is not set 791# CONFIG_DNOTIFY is not set
714# CONFIG_AUTOFS_FS is not set 792# CONFIG_AUTOFS_FS is not set
@@ -725,7 +803,7 @@ CONFIG_INOTIFY=y
725# DOS/FAT/NT Filesystems 803# DOS/FAT/NT Filesystems
726# 804#
727CONFIG_FAT_FS=y 805CONFIG_FAT_FS=y
728CONFIG_MSDOS_FS=y 806# CONFIG_MSDOS_FS is not set
729CONFIG_VFAT_FS=y 807CONFIG_VFAT_FS=y
730CONFIG_FAT_DEFAULT_CODEPAGE=437 808CONFIG_FAT_DEFAULT_CODEPAGE=437
731CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" 809CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
@@ -739,7 +817,7 @@ CONFIG_SYSFS=y
739CONFIG_TMPFS=y 817CONFIG_TMPFS=y
740# CONFIG_HUGETLB_PAGE is not set 818# CONFIG_HUGETLB_PAGE is not set
741CONFIG_RAMFS=y 819CONFIG_RAMFS=y
742# CONFIG_RELAYFS_FS is not set 820# CONFIG_CONFIGFS_FS is not set
743 821
744# 822#
745# Miscellaneous filesystems 823# Miscellaneous filesystems
@@ -755,11 +833,12 @@ CONFIG_RAMFS=y
755CONFIG_JFFS2_FS=y 833CONFIG_JFFS2_FS=y
756CONFIG_JFFS2_FS_DEBUG=0 834CONFIG_JFFS2_FS_DEBUG=0
757CONFIG_JFFS2_FS_WRITEBUFFER=y 835CONFIG_JFFS2_FS_WRITEBUFFER=y
836# CONFIG_JFFS2_SUMMARY is not set
758# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set 837# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
759CONFIG_JFFS2_ZLIB=y 838CONFIG_JFFS2_ZLIB=y
760CONFIG_JFFS2_RTIME=y 839CONFIG_JFFS2_RTIME=y
761# CONFIG_JFFS2_RUBIN is not set 840# CONFIG_JFFS2_RUBIN is not set
762CONFIG_CRAMFS=y 841# CONFIG_CRAMFS is not set
763# CONFIG_VXFS_FS is not set 842# CONFIG_VXFS_FS is not set
764# CONFIG_HPFS_FS is not set 843# CONFIG_HPFS_FS is not set
765# CONFIG_QNX4FS_FS is not set 844# CONFIG_QNX4FS_FS is not set
@@ -789,7 +868,7 @@ CONFIG_MSDOS_PARTITION=y
789# 868#
790CONFIG_NLS=y 869CONFIG_NLS=y
791CONFIG_NLS_DEFAULT="cp437" 870CONFIG_NLS_DEFAULT="cp437"
792CONFIG_NLS_CODEPAGE_437=m 871CONFIG_NLS_CODEPAGE_437=y
793# CONFIG_NLS_CODEPAGE_737 is not set 872# CONFIG_NLS_CODEPAGE_737 is not set
794# CONFIG_NLS_CODEPAGE_775 is not set 873# CONFIG_NLS_CODEPAGE_775 is not set
795# CONFIG_NLS_CODEPAGE_850 is not set 874# CONFIG_NLS_CODEPAGE_850 is not set
@@ -813,7 +892,7 @@ CONFIG_NLS_CODEPAGE_437=m
813# CONFIG_NLS_CODEPAGE_1250 is not set 892# CONFIG_NLS_CODEPAGE_1250 is not set
814# CONFIG_NLS_CODEPAGE_1251 is not set 893# CONFIG_NLS_CODEPAGE_1251 is not set
815# CONFIG_NLS_ASCII is not set 894# CONFIG_NLS_ASCII is not set
816CONFIG_NLS_ISO8859_1=m 895CONFIG_NLS_ISO8859_1=y
817# CONFIG_NLS_ISO8859_2 is not set 896# CONFIG_NLS_ISO8859_2 is not set
818# CONFIG_NLS_ISO8859_3 is not set 897# CONFIG_NLS_ISO8859_3 is not set
819# CONFIG_NLS_ISO8859_4 is not set 898# CONFIG_NLS_ISO8859_4 is not set
@@ -826,7 +905,7 @@ CONFIG_NLS_ISO8859_1=m
826# CONFIG_NLS_ISO8859_15 is not set 905# CONFIG_NLS_ISO8859_15 is not set
827# CONFIG_NLS_KOI8_R is not set 906# CONFIG_NLS_KOI8_R is not set
828# CONFIG_NLS_KOI8_U is not set 907# CONFIG_NLS_KOI8_U is not set
829CONFIG_NLS_UTF8=m 908# CONFIG_NLS_UTF8 is not set
830 909
831# 910#
832# Profiling support 911# Profiling support
@@ -837,20 +916,23 @@ CONFIG_NLS_UTF8=m
837# Kernel hacking 916# Kernel hacking
838# 917#
839# CONFIG_PRINTK_TIME is not set 918# CONFIG_PRINTK_TIME is not set
840CONFIG_DEBUG_KERNEL=y
841CONFIG_MAGIC_SYSRQ=y 919CONFIG_MAGIC_SYSRQ=y
920CONFIG_DEBUG_KERNEL=y
842CONFIG_LOG_BUF_SHIFT=14 921CONFIG_LOG_BUF_SHIFT=14
843CONFIG_DETECT_SOFTLOCKUP=y 922# CONFIG_DETECT_SOFTLOCKUP is not set
844# CONFIG_SCHEDSTATS is not set 923# CONFIG_SCHEDSTATS is not set
845# CONFIG_DEBUG_SLAB is not set 924CONFIG_DEBUG_MUTEXES=y
846CONFIG_DEBUG_PREEMPT=y
847# CONFIG_DEBUG_SPINLOCK is not set 925# CONFIG_DEBUG_SPINLOCK is not set
848# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 926# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
849# CONFIG_DEBUG_KOBJECT is not set 927# CONFIG_DEBUG_KOBJECT is not set
850# CONFIG_DEBUG_BUGVERBOSE is not set 928# CONFIG_DEBUG_BUGVERBOSE is not set
851# CONFIG_DEBUG_INFO is not set 929# CONFIG_DEBUG_INFO is not set
852# CONFIG_DEBUG_FS is not set 930# CONFIG_DEBUG_FS is not set
931# CONFIG_DEBUG_VM is not set
853CONFIG_FRAME_POINTER=y 932CONFIG_FRAME_POINTER=y
933# CONFIG_UNWIND_INFO is not set
934CONFIG_FORCED_INLINING=y
935# CONFIG_RCU_TORTURE_TEST is not set
854# CONFIG_DEBUG_USER is not set 936# CONFIG_DEBUG_USER is not set
855# CONFIG_DEBUG_WAITQ is not set 937# CONFIG_DEBUG_WAITQ is not set
856CONFIG_DEBUG_ERRORS=y 938CONFIG_DEBUG_ERRORS=y
@@ -874,7 +956,7 @@ CONFIG_DEBUG_ERRORS=y
874# 956#
875# Library routines 957# Library routines
876# 958#
877# CONFIG_CRC_CCITT is not set 959CONFIG_CRC_CCITT=y
878# CONFIG_CRC16 is not set 960# CONFIG_CRC16 is not set
879CONFIG_CRC32=y 961CONFIG_CRC32=y
880# CONFIG_LIBCRC32C is not set 962# CONFIG_LIBCRC32C is not set
diff --git a/arch/arm/configs/ep93xx_defconfig b/arch/arm/configs/ep93xx_defconfig
index 8dcc8e8ec813..b69e88bbc909 100644
--- a/arch/arm/configs/ep93xx_defconfig
+++ b/arch/arm/configs/ep93xx_defconfig
@@ -1,12 +1,14 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16 3# Linux kernel version: 2.6.17-rc2
4# Mon Mar 20 14:54:51 2006 4# Wed Apr 19 21:21:01 2006
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_MMU=y 7CONFIG_MMU=y
8CONFIG_RWSEM_GENERIC_SPINLOCK=y 8CONFIG_RWSEM_GENERIC_SPINLOCK=y
9CONFIG_GENERIC_HWEIGHT=y
9CONFIG_GENERIC_CALIBRATE_DELAY=y 10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_VECTORS_BASE=0xffff0000
10 12
11# 13#
12# Code maturity level options 14# Code maturity level options
@@ -28,6 +30,7 @@ CONFIG_SYSCTL=y
28# CONFIG_AUDIT is not set 30# CONFIG_AUDIT is not set
29CONFIG_IKCONFIG=y 31CONFIG_IKCONFIG=y
30CONFIG_IKCONFIG_PROC=y 32CONFIG_IKCONFIG_PROC=y
33# CONFIG_RELAY is not set
31CONFIG_INITRAMFS_SOURCE="" 34CONFIG_INITRAMFS_SOURCE=""
32CONFIG_UID16=y 35CONFIG_UID16=y
33CONFIG_CC_OPTIMIZE_FOR_SIZE=y 36CONFIG_CC_OPTIMIZE_FOR_SIZE=y
@@ -43,10 +46,6 @@ CONFIG_BASE_FULL=y
43CONFIG_FUTEX=y 46CONFIG_FUTEX=y
44CONFIG_EPOLL=y 47CONFIG_EPOLL=y
45CONFIG_SHMEM=y 48CONFIG_SHMEM=y
46CONFIG_CC_ALIGN_FUNCTIONS=0
47CONFIG_CC_ALIGN_LABELS=0
48CONFIG_CC_ALIGN_LOOPS=0
49CONFIG_CC_ALIGN_JUMPS=0
50CONFIG_SLAB=y 49CONFIG_SLAB=y
51# CONFIG_TINY_SHMEM is not set 50# CONFIG_TINY_SHMEM is not set
52CONFIG_BASE_SMALL=0 51CONFIG_BASE_SMALL=0
@@ -59,7 +58,6 @@ CONFIG_OBSOLETE_INTERMODULE=y
59CONFIG_MODULES=y 58CONFIG_MODULES=y
60CONFIG_MODULE_UNLOAD=y 59CONFIG_MODULE_UNLOAD=y
61CONFIG_MODULE_FORCE_UNLOAD=y 60CONFIG_MODULE_FORCE_UNLOAD=y
62CONFIG_OBSOLETE_MODPARM=y
63# CONFIG_MODVERSIONS is not set 61# CONFIG_MODVERSIONS is not set
64# CONFIG_MODULE_SRCVERSION_ALL is not set 62# CONFIG_MODULE_SRCVERSION_ALL is not set
65CONFIG_KMOD=y 63CONFIG_KMOD=y
@@ -67,6 +65,7 @@ CONFIG_KMOD=y
67# 65#
68# Block layer 66# Block layer
69# 67#
68# CONFIG_BLK_DEV_IO_TRACE is not set
70 69
71# 70#
72# IO Schedulers 71# IO Schedulers
@@ -94,6 +93,7 @@ CONFIG_ARCH_EP93XX=y
94# CONFIG_ARCH_IOP3XX is not set 93# CONFIG_ARCH_IOP3XX is not set
95# CONFIG_ARCH_IXP4XX is not set 94# CONFIG_ARCH_IXP4XX is not set
96# CONFIG_ARCH_IXP2000 is not set 95# CONFIG_ARCH_IXP2000 is not set
96# CONFIG_ARCH_IXP23XX is not set
97# CONFIG_ARCH_L7200 is not set 97# CONFIG_ARCH_L7200 is not set
98# CONFIG_ARCH_PXA is not set 98# CONFIG_ARCH_PXA is not set
99# CONFIG_ARCH_RPC is not set 99# CONFIG_ARCH_RPC is not set
@@ -112,7 +112,6 @@ CONFIG_ARCH_EP93XX=y
112# 112#
113# Cirrus EP93xx Implementation Options 113# Cirrus EP93xx Implementation Options
114# 114#
115CONFIG_CRUNCH=y
116 115
117# 116#
118# EP93xx Platforms 117# EP93xx Platforms
@@ -232,12 +231,15 @@ CONFIG_SYN_COOKIES=y
232# CONFIG_INET_AH is not set 231# CONFIG_INET_AH is not set
233# CONFIG_INET_ESP is not set 232# CONFIG_INET_ESP is not set
234# CONFIG_INET_IPCOMP is not set 233# CONFIG_INET_IPCOMP is not set
234# CONFIG_INET_XFRM_TUNNEL is not set
235# CONFIG_INET_TUNNEL is not set 235# CONFIG_INET_TUNNEL is not set
236CONFIG_INET_DIAG=y 236CONFIG_INET_DIAG=y
237CONFIG_INET_TCP_DIAG=y 237CONFIG_INET_TCP_DIAG=y
238# CONFIG_TCP_CONG_ADVANCED is not set 238# CONFIG_TCP_CONG_ADVANCED is not set
239CONFIG_TCP_CONG_BIC=y 239CONFIG_TCP_CONG_BIC=y
240# CONFIG_IPV6 is not set 240# CONFIG_IPV6 is not set
241# CONFIG_INET6_XFRM_TUNNEL is not set
242# CONFIG_INET6_TUNNEL is not set
241# CONFIG_NETFILTER is not set 243# CONFIG_NETFILTER is not set
242 244
243# 245#
@@ -346,7 +348,6 @@ CONFIG_MTD_CFI_I2=y
346# CONFIG_MTD_OTP is not set 348# CONFIG_MTD_OTP is not set
347CONFIG_MTD_CFI_INTELEXT=y 349CONFIG_MTD_CFI_INTELEXT=y
348CONFIG_MTD_CFI_AMDSTD=y 350CONFIG_MTD_CFI_AMDSTD=y
349CONFIG_MTD_CFI_AMDSTD_RETRY=0
350CONFIG_MTD_CFI_STAA=y 351CONFIG_MTD_CFI_STAA=y
351CONFIG_MTD_CFI_UTIL=y 352CONFIG_MTD_CFI_UTIL=y
352# CONFIG_MTD_RAM is not set 353# CONFIG_MTD_RAM is not set
@@ -371,7 +372,6 @@ CONFIG_MTD_PHYSMAP_BANKWIDTH=1
371# CONFIG_MTD_SLRAM is not set 372# CONFIG_MTD_SLRAM is not set
372# CONFIG_MTD_PHRAM is not set 373# CONFIG_MTD_PHRAM is not set
373# CONFIG_MTD_MTDRAM is not set 374# CONFIG_MTD_MTDRAM is not set
374# CONFIG_MTD_BLKMTD is not set
375# CONFIG_MTD_BLOCK2MTD is not set 375# CONFIG_MTD_BLOCK2MTD is not set
376 376
377# 377#
@@ -412,7 +412,7 @@ CONFIG_MTD_NAND_IDS=y
412# CONFIG_BLK_DEV_NBD is not set 412# CONFIG_BLK_DEV_NBD is not set
413# CONFIG_BLK_DEV_UB is not set 413# CONFIG_BLK_DEV_UB is not set
414# CONFIG_BLK_DEV_RAM is not set 414# CONFIG_BLK_DEV_RAM is not set
415CONFIG_BLK_DEV_RAM_COUNT=16 415# CONFIG_BLK_DEV_INITRD is not set
416# CONFIG_CDROM_PKTCDVD is not set 416# CONFIG_CDROM_PKTCDVD is not set
417# CONFIG_ATA_OVER_ETH is not set 417# CONFIG_ATA_OVER_ETH is not set
418 418
@@ -576,13 +576,13 @@ CONFIG_WATCHDOG=y
576# Watchdog Device Drivers 576# Watchdog Device Drivers
577# 577#
578# CONFIG_SOFT_WATCHDOG is not set 578# CONFIG_SOFT_WATCHDOG is not set
579CONFIG_EP93XX_WATCHDOG=y
579 580
580# 581#
581# USB-based Watchdog Cards 582# USB-based Watchdog Cards
582# 583#
583# CONFIG_USBPCWATCHDOG is not set 584# CONFIG_USBPCWATCHDOG is not set
584# CONFIG_NVRAM is not set 585# CONFIG_NVRAM is not set
585# CONFIG_RTC is not set
586# CONFIG_DTLK is not set 586# CONFIG_DTLK is not set
587# CONFIG_R3964 is not set 587# CONFIG_R3964 is not set
588 588
@@ -626,9 +626,7 @@ CONFIG_I2C_ALGOBIT=y
626# CONFIG_SENSORS_PCF8574 is not set 626# CONFIG_SENSORS_PCF8574 is not set
627# CONFIG_SENSORS_PCA9539 is not set 627# CONFIG_SENSORS_PCA9539 is not set
628# CONFIG_SENSORS_PCF8591 is not set 628# CONFIG_SENSORS_PCF8591 is not set
629# CONFIG_SENSORS_RTC8564 is not set
630# CONFIG_SENSORS_MAX6875 is not set 629# CONFIG_SENSORS_MAX6875 is not set
631# CONFIG_RTC_X1205_I2C is not set
632CONFIG_I2C_DEBUG_CORE=y 630CONFIG_I2C_DEBUG_CORE=y
633CONFIG_I2C_DEBUG_ALGO=y 631CONFIG_I2C_DEBUG_ALGO=y
634CONFIG_I2C_DEBUG_BUS=y 632CONFIG_I2C_DEBUG_BUS=y
@@ -690,7 +688,16 @@ CONFIG_HWMON=y
690# 688#
691 689
692# 690#
693# Multimedia Capabilities Port drivers 691# LED devices
692#
693# CONFIG_NEW_LEDS is not set
694
695#
696# LED drivers
697#
698
699#
700# LED Triggers
694# 701#
695 702
696# 703#
@@ -702,6 +709,7 @@ CONFIG_HWMON=y
702# Digital Video Broadcasting Devices 709# Digital Video Broadcasting Devices
703# 710#
704# CONFIG_DVB is not set 711# CONFIG_DVB is not set
712# CONFIG_USB_DABUSB is not set
705 713
706# 714#
707# Graphics support 715# Graphics support
@@ -718,6 +726,7 @@ CONFIG_HWMON=y
718# 726#
719CONFIG_USB_ARCH_HAS_HCD=y 727CONFIG_USB_ARCH_HAS_HCD=y
720# CONFIG_USB_ARCH_HAS_OHCI is not set 728# CONFIG_USB_ARCH_HAS_OHCI is not set
729# CONFIG_USB_ARCH_HAS_EHCI is not set
721CONFIG_USB=y 730CONFIG_USB=y
722CONFIG_USB_DEBUG=y 731CONFIG_USB_DEBUG=y
723 732
@@ -776,15 +785,6 @@ CONFIG_USB_STORAGE=y
776# CONFIG_USB_MICROTEK is not set 785# CONFIG_USB_MICROTEK is not set
777 786
778# 787#
779# USB Multimedia devices
780#
781# CONFIG_USB_DABUSB is not set
782
783#
784# Video4Linux support is needed for USB Multimedia device support
785#
786
787#
788# USB Network Adapters 788# USB Network Adapters
789# 789#
790# CONFIG_USB_CATC is not set 790# CONFIG_USB_CATC is not set
@@ -813,6 +813,7 @@ CONFIG_USB_SERIAL_CONSOLE=y
813# CONFIG_USB_SERIAL_CYPRESS_M8 is not set 813# CONFIG_USB_SERIAL_CYPRESS_M8 is not set
814# CONFIG_USB_SERIAL_EMPEG is not set 814# CONFIG_USB_SERIAL_EMPEG is not set
815# CONFIG_USB_SERIAL_FTDI_SIO is not set 815# CONFIG_USB_SERIAL_FTDI_SIO is not set
816# CONFIG_USB_SERIAL_FUNSOFT is not set
816# CONFIG_USB_SERIAL_VISOR is not set 817# CONFIG_USB_SERIAL_VISOR is not set
817# CONFIG_USB_SERIAL_IPAQ is not set 818# CONFIG_USB_SERIAL_IPAQ is not set
818# CONFIG_USB_SERIAL_IR is not set 819# CONFIG_USB_SERIAL_IR is not set
@@ -825,6 +826,7 @@ CONFIG_USB_SERIAL_CONSOLE=y
825# CONFIG_USB_SERIAL_KLSI is not set 826# CONFIG_USB_SERIAL_KLSI is not set
826# CONFIG_USB_SERIAL_KOBIL_SCT is not set 827# CONFIG_USB_SERIAL_KOBIL_SCT is not set
827# CONFIG_USB_SERIAL_MCT_U232 is not set 828# CONFIG_USB_SERIAL_MCT_U232 is not set
829# CONFIG_USB_SERIAL_NAVMAN is not set
828CONFIG_USB_SERIAL_PL2303=y 830CONFIG_USB_SERIAL_PL2303=y
829# CONFIG_USB_SERIAL_HP4X is not set 831# CONFIG_USB_SERIAL_HP4X is not set
830# CONFIG_USB_SERIAL_SAFE is not set 832# CONFIG_USB_SERIAL_SAFE is not set
@@ -865,6 +867,32 @@ CONFIG_USB_SERIAL_PL2303=y
865# CONFIG_MMC is not set 867# CONFIG_MMC is not set
866 868
867# 869#
870# Real Time Clock
871#
872CONFIG_RTC_LIB=y
873CONFIG_RTC_CLASS=y
874CONFIG_RTC_HCTOSYS=y
875CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
876
877#
878# RTC interfaces
879#
880CONFIG_RTC_INTF_SYSFS=y
881CONFIG_RTC_INTF_PROC=y
882CONFIG_RTC_INTF_DEV=y
883
884#
885# RTC drivers
886#
887# CONFIG_RTC_DRV_X1205 is not set
888# CONFIG_RTC_DRV_DS1672 is not set
889# CONFIG_RTC_DRV_PCF8563 is not set
890# CONFIG_RTC_DRV_RS5C372 is not set
891CONFIG_RTC_DRV_M48T86=y
892CONFIG_RTC_DRV_EP93XX=y
893# CONFIG_RTC_DRV_TEST is not set
894
895#
868# File systems 896# File systems
869# 897#
870CONFIG_EXT2_FS=y 898CONFIG_EXT2_FS=y
@@ -912,7 +940,6 @@ CONFIG_SYSFS=y
912CONFIG_TMPFS=y 940CONFIG_TMPFS=y
913# CONFIG_HUGETLB_PAGE is not set 941# CONFIG_HUGETLB_PAGE is not set
914CONFIG_RAMFS=y 942CONFIG_RAMFS=y
915# CONFIG_RELAYFS_FS is not set
916# CONFIG_CONFIGFS_FS is not set 943# CONFIG_CONFIGFS_FS is not set
917 944
918# 945#
@@ -1044,6 +1071,7 @@ CONFIG_LOG_BUF_SHIFT=14
1044CONFIG_DETECT_SOFTLOCKUP=y 1071CONFIG_DETECT_SOFTLOCKUP=y
1045# CONFIG_SCHEDSTATS is not set 1072# CONFIG_SCHEDSTATS is not set
1046CONFIG_DEBUG_SLAB=y 1073CONFIG_DEBUG_SLAB=y
1074# CONFIG_DEBUG_SLAB_LEAK is not set
1047CONFIG_DEBUG_MUTEXES=y 1075CONFIG_DEBUG_MUTEXES=y
1048CONFIG_DEBUG_SPINLOCK=y 1076CONFIG_DEBUG_SPINLOCK=y
1049# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1077# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
@@ -1053,6 +1081,7 @@ CONFIG_DEBUG_BUGVERBOSE=y
1053# CONFIG_DEBUG_FS is not set 1081# CONFIG_DEBUG_FS is not set
1054# CONFIG_DEBUG_VM is not set 1082# CONFIG_DEBUG_VM is not set
1055CONFIG_FRAME_POINTER=y 1083CONFIG_FRAME_POINTER=y
1084# CONFIG_UNWIND_INFO is not set
1056CONFIG_FORCED_INLINING=y 1085CONFIG_FORCED_INLINING=y
1057# CONFIG_RCU_TORTURE_TEST is not set 1086# CONFIG_RCU_TORTURE_TEST is not set
1058CONFIG_DEBUG_USER=y 1087CONFIG_DEBUG_USER=y
diff --git a/arch/arm/configs/ixp2000_defconfig b/arch/arm/configs/ixp2000_defconfig
index 7b02ca04c3ee..e6f3e4873d6c 100644
--- a/arch/arm/configs/ixp2000_defconfig
+++ b/arch/arm/configs/ixp2000_defconfig
@@ -1,18 +1,19 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc2 3# Linux kernel version: 2.6.17-rc2
4# Wed Feb 8 04:49:11 2006 4# Wed Apr 19 21:12:49 2006
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_MMU=y 7CONFIG_MMU=y
8CONFIG_RWSEM_GENERIC_SPINLOCK=y 8CONFIG_RWSEM_GENERIC_SPINLOCK=y
9CONFIG_GENERIC_HWEIGHT=y
9CONFIG_GENERIC_CALIBRATE_DELAY=y 10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_VECTORS_BASE=0xffff0000
10 12
11# 13#
12# Code maturity level options 14# Code maturity level options
13# 15#
14CONFIG_EXPERIMENTAL=y 16CONFIG_EXPERIMENTAL=y
15CONFIG_CLEAN_COMPILE=y
16CONFIG_BROKEN_ON_SMP=y 17CONFIG_BROKEN_ON_SMP=y
17CONFIG_INIT_ENV_ARG_LIMIT=32 18CONFIG_INIT_ENV_ARG_LIMIT=32
18 19
@@ -29,6 +30,7 @@ CONFIG_BSD_PROCESS_ACCT=y
29CONFIG_SYSCTL=y 30CONFIG_SYSCTL=y
30# CONFIG_AUDIT is not set 31# CONFIG_AUDIT is not set
31# CONFIG_IKCONFIG is not set 32# CONFIG_IKCONFIG is not set
33# CONFIG_RELAY is not set
32CONFIG_INITRAMFS_SOURCE="" 34CONFIG_INITRAMFS_SOURCE=""
33CONFIG_UID16=y 35CONFIG_UID16=y
34CONFIG_CC_OPTIMIZE_FOR_SIZE=y 36CONFIG_CC_OPTIMIZE_FOR_SIZE=y
@@ -44,10 +46,6 @@ CONFIG_BASE_FULL=y
44CONFIG_FUTEX=y 46CONFIG_FUTEX=y
45CONFIG_EPOLL=y 47CONFIG_EPOLL=y
46CONFIG_SHMEM=y 48CONFIG_SHMEM=y
47CONFIG_CC_ALIGN_FUNCTIONS=0
48CONFIG_CC_ALIGN_LABELS=0
49CONFIG_CC_ALIGN_LOOPS=0
50CONFIG_CC_ALIGN_JUMPS=0
51CONFIG_SLAB=y 49CONFIG_SLAB=y
52# CONFIG_TINY_SHMEM is not set 50# CONFIG_TINY_SHMEM is not set
53CONFIG_BASE_SMALL=0 51CONFIG_BASE_SMALL=0
@@ -60,7 +58,6 @@ CONFIG_OBSOLETE_INTERMODULE=y
60CONFIG_MODULES=y 58CONFIG_MODULES=y
61CONFIG_MODULE_UNLOAD=y 59CONFIG_MODULE_UNLOAD=y
62# CONFIG_MODULE_FORCE_UNLOAD is not set 60# CONFIG_MODULE_FORCE_UNLOAD is not set
63CONFIG_OBSOLETE_MODPARM=y
64# CONFIG_MODVERSIONS is not set 61# CONFIG_MODVERSIONS is not set
65# CONFIG_MODULE_SRCVERSION_ALL is not set 62# CONFIG_MODULE_SRCVERSION_ALL is not set
66CONFIG_KMOD=y 63CONFIG_KMOD=y
@@ -68,6 +65,7 @@ CONFIG_KMOD=y
68# 65#
69# Block layer 66# Block layer
70# 67#
68# CONFIG_BLK_DEV_IO_TRACE is not set
71 69
72# 70#
73# IO Schedulers 71# IO Schedulers
@@ -89,11 +87,13 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
89# CONFIG_ARCH_CLPS711X is not set 87# CONFIG_ARCH_CLPS711X is not set
90# CONFIG_ARCH_CO285 is not set 88# CONFIG_ARCH_CO285 is not set
91# CONFIG_ARCH_EBSA110 is not set 89# CONFIG_ARCH_EBSA110 is not set
90# CONFIG_ARCH_EP93XX is not set
92# CONFIG_ARCH_FOOTBRIDGE is not set 91# CONFIG_ARCH_FOOTBRIDGE is not set
93# CONFIG_ARCH_INTEGRATOR is not set 92# CONFIG_ARCH_INTEGRATOR is not set
94# CONFIG_ARCH_IOP3XX is not set 93# CONFIG_ARCH_IOP3XX is not set
95# CONFIG_ARCH_IXP4XX is not set 94# CONFIG_ARCH_IXP4XX is not set
96CONFIG_ARCH_IXP2000=y 95CONFIG_ARCH_IXP2000=y
96# CONFIG_ARCH_IXP23XX is not set
97# CONFIG_ARCH_L7200 is not set 97# CONFIG_ARCH_L7200 is not set
98# CONFIG_ARCH_PXA is not set 98# CONFIG_ARCH_PXA is not set
99# CONFIG_ARCH_RPC is not set 99# CONFIG_ARCH_RPC is not set
@@ -123,6 +123,7 @@ CONFIG_ARCH_IXDP2800=y
123CONFIG_ARCH_IXDP2X00=y 123CONFIG_ARCH_IXDP2X00=y
124CONFIG_ARCH_IXDP2401=y 124CONFIG_ARCH_IXDP2401=y
125CONFIG_ARCH_IXDP2801=y 125CONFIG_ARCH_IXDP2801=y
126CONFIG_MACH_IXDP28X5=y
126CONFIG_ARCH_IXDP2X01=y 127CONFIG_ARCH_IXDP2X01=y
127# CONFIG_IXP2000_SUPPORT_BROKEN_PCI_IO is not set 128# CONFIG_IXP2000_SUPPORT_BROKEN_PCI_IO is not set
128 129
@@ -147,7 +148,6 @@ CONFIG_XSCALE_PMU=y
147# Bus support 148# Bus support
148# 149#
149CONFIG_PCI=y 150CONFIG_PCI=y
150CONFIG_PCI_LEGACY_PROC=y
151# CONFIG_PCI_DEBUG is not set 151# CONFIG_PCI_DEBUG is not set
152 152
153# 153#
@@ -160,6 +160,7 @@ CONFIG_PCI_LEGACY_PROC=y
160# 160#
161# CONFIG_PREEMPT is not set 161# CONFIG_PREEMPT is not set
162# CONFIG_NO_IDLE_HZ is not set 162# CONFIG_NO_IDLE_HZ is not set
163CONFIG_HZ=100
163# CONFIG_AEABI is not set 164# CONFIG_AEABI is not set
164# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set 165# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
165CONFIG_SELECT_MEMORY_MODEL=y 166CONFIG_SELECT_MEMORY_MODEL=y
@@ -213,6 +214,7 @@ CONFIG_NET=y
213# 214#
214# Networking options 215# Networking options
215# 216#
217# CONFIG_NETDEBUG is not set
216CONFIG_PACKET=y 218CONFIG_PACKET=y
217CONFIG_PACKET_MMAP=y 219CONFIG_PACKET_MMAP=y
218CONFIG_UNIX=y 220CONFIG_UNIX=y
@@ -232,12 +234,15 @@ CONFIG_SYN_COOKIES=y
232# CONFIG_INET_AH is not set 234# CONFIG_INET_AH is not set
233# CONFIG_INET_ESP is not set 235# CONFIG_INET_ESP is not set
234# CONFIG_INET_IPCOMP is not set 236# CONFIG_INET_IPCOMP is not set
237# CONFIG_INET_XFRM_TUNNEL is not set
235# CONFIG_INET_TUNNEL is not set 238# CONFIG_INET_TUNNEL is not set
236CONFIG_INET_DIAG=y 239CONFIG_INET_DIAG=y
237CONFIG_INET_TCP_DIAG=y 240CONFIG_INET_TCP_DIAG=y
238# CONFIG_TCP_CONG_ADVANCED is not set 241# CONFIG_TCP_CONG_ADVANCED is not set
239CONFIG_TCP_CONG_BIC=y 242CONFIG_TCP_CONG_BIC=y
240# CONFIG_IPV6 is not set 243# CONFIG_IPV6 is not set
244# CONFIG_INET6_XFRM_TUNNEL is not set
245# CONFIG_INET6_TUNNEL is not set
241# CONFIG_NETFILTER is not set 246# CONFIG_NETFILTER is not set
242 247
243# 248#
@@ -347,7 +352,6 @@ CONFIG_MTD_CFI_UTIL=y
347# CONFIG_MTD_ROM is not set 352# CONFIG_MTD_ROM is not set
348# CONFIG_MTD_ABSENT is not set 353# CONFIG_MTD_ABSENT is not set
349# CONFIG_MTD_OBSOLETE_CHIPS is not set 354# CONFIG_MTD_OBSOLETE_CHIPS is not set
350# CONFIG_MTD_XIP is not set
351 355
352# 356#
353# Mapping drivers for chip access 357# Mapping drivers for chip access
@@ -366,7 +370,6 @@ CONFIG_MTD_IXP2000=y
366# CONFIG_MTD_SLRAM is not set 370# CONFIG_MTD_SLRAM is not set
367# CONFIG_MTD_PHRAM is not set 371# CONFIG_MTD_PHRAM is not set
368# CONFIG_MTD_MTDRAM is not set 372# CONFIG_MTD_MTDRAM is not set
369# CONFIG_MTD_BLKMTD is not set
370# CONFIG_MTD_BLOCK2MTD is not set 373# CONFIG_MTD_BLOCK2MTD is not set
371 374
372# 375#
@@ -614,8 +617,9 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
614# 617#
615CONFIG_SERIAL_8250=y 618CONFIG_SERIAL_8250=y
616CONFIG_SERIAL_8250_CONSOLE=y 619CONFIG_SERIAL_8250_CONSOLE=y
620CONFIG_SERIAL_8250_PCI=y
617CONFIG_SERIAL_8250_NR_UARTS=3 621CONFIG_SERIAL_8250_NR_UARTS=3
618CONFIG_SERIAL_8250_RUNTIME_UARTS=4 622CONFIG_SERIAL_8250_RUNTIME_UARTS=3
619# CONFIG_SERIAL_8250_EXTENDED is not set 623# CONFIG_SERIAL_8250_EXTENDED is not set
620 624
621# 625#
@@ -623,6 +627,7 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=4
623# 627#
624CONFIG_SERIAL_CORE=y 628CONFIG_SERIAL_CORE=y
625CONFIG_SERIAL_CORE_CONSOLE=y 629CONFIG_SERIAL_CORE_CONSOLE=y
630# CONFIG_SERIAL_JSM is not set
626CONFIG_UNIX98_PTYS=y 631CONFIG_UNIX98_PTYS=y
627CONFIG_LEGACY_PTYS=y 632CONFIG_LEGACY_PTYS=y
628CONFIG_LEGACY_PTY_COUNT=256 633CONFIG_LEGACY_PTY_COUNT=256
@@ -650,7 +655,6 @@ CONFIG_IXP2000_WATCHDOG=y
650# CONFIG_PCIPCWATCHDOG is not set 655# CONFIG_PCIPCWATCHDOG is not set
651# CONFIG_WDTPCI is not set 656# CONFIG_WDTPCI is not set
652# CONFIG_NVRAM is not set 657# CONFIG_NVRAM is not set
653# CONFIG_RTC is not set
654# CONFIG_DTLK is not set 658# CONFIG_DTLK is not set
655# CONFIG_R3964 is not set 659# CONFIG_R3964 is not set
656# CONFIG_APPLICOM is not set 660# CONFIG_APPLICOM is not set
@@ -696,7 +700,6 @@ CONFIG_I2C_IXP2000=y
696# CONFIG_I2C_PARPORT_LIGHT is not set 700# CONFIG_I2C_PARPORT_LIGHT is not set
697# CONFIG_I2C_PROSAVAGE is not set 701# CONFIG_I2C_PROSAVAGE is not set
698# CONFIG_I2C_SAVAGE4 is not set 702# CONFIG_I2C_SAVAGE4 is not set
699# CONFIG_SCx200_ACB is not set
700# CONFIG_I2C_SIS5595 is not set 703# CONFIG_I2C_SIS5595 is not set
701# CONFIG_I2C_SIS630 is not set 704# CONFIG_I2C_SIS630 is not set
702# CONFIG_I2C_SIS96X is not set 705# CONFIG_I2C_SIS96X is not set
@@ -715,9 +718,7 @@ CONFIG_SENSORS_EEPROM=y
715# CONFIG_SENSORS_PCF8574 is not set 718# CONFIG_SENSORS_PCF8574 is not set
716# CONFIG_SENSORS_PCA9539 is not set 719# CONFIG_SENSORS_PCA9539 is not set
717# CONFIG_SENSORS_PCF8591 is not set 720# CONFIG_SENSORS_PCF8591 is not set
718# CONFIG_SENSORS_RTC8564 is not set
719# CONFIG_SENSORS_MAX6875 is not set 721# CONFIG_SENSORS_MAX6875 is not set
720# CONFIG_RTC_X1205_I2C is not set
721# CONFIG_I2C_DEBUG_CORE is not set 722# CONFIG_I2C_DEBUG_CORE is not set
722# CONFIG_I2C_DEBUG_ALGO is not set 723# CONFIG_I2C_DEBUG_ALGO is not set
723# CONFIG_I2C_DEBUG_BUS is not set 724# CONFIG_I2C_DEBUG_BUS is not set
@@ -730,6 +731,11 @@ CONFIG_SENSORS_EEPROM=y
730# CONFIG_SPI_MASTER is not set 731# CONFIG_SPI_MASTER is not set
731 732
732# 733#
734# Dallas's 1-wire bus
735#
736# CONFIG_W1 is not set
737
738#
733# Hardware Monitoring support 739# Hardware Monitoring support
734# 740#
735CONFIG_HWMON=y 741CONFIG_HWMON=y
@@ -742,6 +748,7 @@ CONFIG_HWMON=y
742# CONFIG_SENSORS_ASB100 is not set 748# CONFIG_SENSORS_ASB100 is not set
743# CONFIG_SENSORS_ATXP1 is not set 749# CONFIG_SENSORS_ATXP1 is not set
744# CONFIG_SENSORS_DS1621 is not set 750# CONFIG_SENSORS_DS1621 is not set
751# CONFIG_SENSORS_F71805F is not set
745# CONFIG_SENSORS_FSCHER is not set 752# CONFIG_SENSORS_FSCHER is not set
746# CONFIG_SENSORS_FSCPOS is not set 753# CONFIG_SENSORS_FSCPOS is not set
747# CONFIG_SENSORS_GL518SM is not set 754# CONFIG_SENSORS_GL518SM is not set
@@ -776,7 +783,16 @@ CONFIG_HWMON=y
776# 783#
777 784
778# 785#
779# Multimedia Capabilities Port drivers 786# LED devices
787#
788# CONFIG_NEW_LEDS is not set
789
790#
791# LED drivers
792#
793
794#
795# LED Triggers
780# 796#
781 797
782# 798#
@@ -804,6 +820,7 @@ CONFIG_HWMON=y
804# 820#
805CONFIG_USB_ARCH_HAS_HCD=y 821CONFIG_USB_ARCH_HAS_HCD=y
806CONFIG_USB_ARCH_HAS_OHCI=y 822CONFIG_USB_ARCH_HAS_OHCI=y
823CONFIG_USB_ARCH_HAS_EHCI=y
807# CONFIG_USB is not set 824# CONFIG_USB is not set
808 825
809# 826#
@@ -821,6 +838,12 @@ CONFIG_USB_ARCH_HAS_OHCI=y
821# CONFIG_MMC is not set 838# CONFIG_MMC is not set
822 839
823# 840#
841# Real Time Clock
842#
843CONFIG_RTC_LIB=y
844# CONFIG_RTC_CLASS is not set
845
846#
824# File systems 847# File systems
825# 848#
826CONFIG_EXT2_FS=y 849CONFIG_EXT2_FS=y
@@ -870,7 +893,6 @@ CONFIG_SYSFS=y
870CONFIG_TMPFS=y 893CONFIG_TMPFS=y
871# CONFIG_HUGETLB_PAGE is not set 894# CONFIG_HUGETLB_PAGE is not set
872CONFIG_RAMFS=y 895CONFIG_RAMFS=y
873# CONFIG_RELAYFS_FS is not set
874# CONFIG_CONFIGFS_FS is not set 896# CONFIG_CONFIGFS_FS is not set
875 897
876# 898#
@@ -972,6 +994,7 @@ CONFIG_DEBUG_BUGVERBOSE=y
972# CONFIG_DEBUG_FS is not set 994# CONFIG_DEBUG_FS is not set
973# CONFIG_DEBUG_VM is not set 995# CONFIG_DEBUG_VM is not set
974CONFIG_FRAME_POINTER=y 996CONFIG_FRAME_POINTER=y
997# CONFIG_UNWIND_INFO is not set
975CONFIG_FORCED_INLINING=y 998CONFIG_FORCED_INLINING=y
976# CONFIG_RCU_TORTURE_TEST is not set 999# CONFIG_RCU_TORTURE_TEST is not set
977CONFIG_DEBUG_USER=y 1000CONFIG_DEBUG_USER=y
diff --git a/arch/arm/configs/ixp23xx_defconfig b/arch/arm/configs/ixp23xx_defconfig
index 1a2751e9ab05..9ce898a6cf87 100644
--- a/arch/arm/configs/ixp23xx_defconfig
+++ b/arch/arm/configs/ixp23xx_defconfig
@@ -1,12 +1,14 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16 3# Linux kernel version: 2.6.17-rc2
4# Tue Mar 21 03:27:20 2006 4# Wed Apr 19 21:13:50 2006
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_MMU=y 7CONFIG_MMU=y
8CONFIG_RWSEM_GENERIC_SPINLOCK=y 8CONFIG_RWSEM_GENERIC_SPINLOCK=y
9CONFIG_GENERIC_HWEIGHT=y
9CONFIG_GENERIC_CALIBRATE_DELAY=y 10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_VECTORS_BASE=0xffff0000
10 12
11# 13#
12# Code maturity level options 14# Code maturity level options
@@ -28,6 +30,7 @@ CONFIG_BSD_PROCESS_ACCT=y
28CONFIG_SYSCTL=y 30CONFIG_SYSCTL=y
29# CONFIG_AUDIT is not set 31# CONFIG_AUDIT is not set
30# CONFIG_IKCONFIG is not set 32# CONFIG_IKCONFIG is not set
33# CONFIG_RELAY is not set
31CONFIG_INITRAMFS_SOURCE="" 34CONFIG_INITRAMFS_SOURCE=""
32CONFIG_UID16=y 35CONFIG_UID16=y
33CONFIG_CC_OPTIMIZE_FOR_SIZE=y 36CONFIG_CC_OPTIMIZE_FOR_SIZE=y
@@ -43,10 +46,6 @@ CONFIG_BASE_FULL=y
43CONFIG_FUTEX=y 46CONFIG_FUTEX=y
44CONFIG_EPOLL=y 47CONFIG_EPOLL=y
45CONFIG_SHMEM=y 48CONFIG_SHMEM=y
46CONFIG_CC_ALIGN_FUNCTIONS=0
47CONFIG_CC_ALIGN_LABELS=0
48CONFIG_CC_ALIGN_LOOPS=0
49CONFIG_CC_ALIGN_JUMPS=0
50CONFIG_SLAB=y 49CONFIG_SLAB=y
51# CONFIG_TINY_SHMEM is not set 50# CONFIG_TINY_SHMEM is not set
52CONFIG_BASE_SMALL=0 51CONFIG_BASE_SMALL=0
@@ -59,7 +58,6 @@ CONFIG_OBSOLETE_INTERMODULE=y
59CONFIG_MODULES=y 58CONFIG_MODULES=y
60CONFIG_MODULE_UNLOAD=y 59CONFIG_MODULE_UNLOAD=y
61# CONFIG_MODULE_FORCE_UNLOAD is not set 60# CONFIG_MODULE_FORCE_UNLOAD is not set
62CONFIG_OBSOLETE_MODPARM=y
63# CONFIG_MODVERSIONS is not set 61# CONFIG_MODVERSIONS is not set
64# CONFIG_MODULE_SRCVERSION_ALL is not set 62# CONFIG_MODULE_SRCVERSION_ALL is not set
65CONFIG_KMOD=y 63CONFIG_KMOD=y
@@ -67,6 +65,7 @@ CONFIG_KMOD=y
67# 65#
68# Block layer 66# Block layer
69# 67#
68# CONFIG_BLK_DEV_IO_TRACE is not set
70 69
71# 70#
72# IO Schedulers 71# IO Schedulers
@@ -143,7 +142,6 @@ CONFIG_CPU_BIG_ENDIAN=y
143# Bus support 142# Bus support
144# 143#
145CONFIG_PCI=y 144CONFIG_PCI=y
146CONFIG_PCI_LEGACY_PROC=y
147# CONFIG_PCI_DEBUG is not set 145# CONFIG_PCI_DEBUG is not set
148 146
149# 147#
@@ -230,12 +228,15 @@ CONFIG_SYN_COOKIES=y
230# CONFIG_INET_AH is not set 228# CONFIG_INET_AH is not set
231# CONFIG_INET_ESP is not set 229# CONFIG_INET_ESP is not set
232# CONFIG_INET_IPCOMP is not set 230# CONFIG_INET_IPCOMP is not set
231# CONFIG_INET_XFRM_TUNNEL is not set
233# CONFIG_INET_TUNNEL is not set 232# CONFIG_INET_TUNNEL is not set
234CONFIG_INET_DIAG=y 233CONFIG_INET_DIAG=y
235CONFIG_INET_TCP_DIAG=y 234CONFIG_INET_TCP_DIAG=y
236# CONFIG_TCP_CONG_ADVANCED is not set 235# CONFIG_TCP_CONG_ADVANCED is not set
237CONFIG_TCP_CONG_BIC=y 236CONFIG_TCP_CONG_BIC=y
238# CONFIG_IPV6 is not set 237# CONFIG_IPV6 is not set
238# CONFIG_INET6_XFRM_TUNNEL is not set
239# CONFIG_INET6_TUNNEL is not set
239# CONFIG_NETFILTER is not set 240# CONFIG_NETFILTER is not set
240 241
241# 242#
@@ -365,7 +366,6 @@ CONFIG_MTD_PHYSMAP_BANKWIDTH=1
365# CONFIG_MTD_SLRAM is not set 366# CONFIG_MTD_SLRAM is not set
366# CONFIG_MTD_PHRAM is not set 367# CONFIG_MTD_PHRAM is not set
367# CONFIG_MTD_MTDRAM is not set 368# CONFIG_MTD_MTDRAM is not set
368# CONFIG_MTD_BLKMTD is not set
369# CONFIG_MTD_BLOCK2MTD is not set 369# CONFIG_MTD_BLOCK2MTD is not set
370 370
371# 371#
@@ -527,7 +527,6 @@ CONFIG_BLK_DEV_SD=y
527# CONFIG_SCSI_INIA100 is not set 527# CONFIG_SCSI_INIA100 is not set
528# CONFIG_SCSI_SYM53C8XX_2 is not set 528# CONFIG_SCSI_SYM53C8XX_2 is not set
529# CONFIG_SCSI_IPR is not set 529# CONFIG_SCSI_IPR is not set
530# CONFIG_SCSI_QLOGIC_FC is not set
531# CONFIG_SCSI_QLOGIC_1280 is not set 530# CONFIG_SCSI_QLOGIC_1280 is not set
532# CONFIG_SCSI_QLA_FC is not set 531# CONFIG_SCSI_QLA_FC is not set
533# CONFIG_SCSI_LPFC is not set 532# CONFIG_SCSI_LPFC is not set
@@ -735,6 +734,7 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
735# 734#
736CONFIG_SERIAL_8250=y 735CONFIG_SERIAL_8250=y
737CONFIG_SERIAL_8250_CONSOLE=y 736CONFIG_SERIAL_8250_CONSOLE=y
737CONFIG_SERIAL_8250_PCI=y
738CONFIG_SERIAL_8250_NR_UARTS=4 738CONFIG_SERIAL_8250_NR_UARTS=4
739CONFIG_SERIAL_8250_RUNTIME_UARTS=4 739CONFIG_SERIAL_8250_RUNTIME_UARTS=4
740# CONFIG_SERIAL_8250_EXTENDED is not set 740# CONFIG_SERIAL_8250_EXTENDED is not set
@@ -776,7 +776,6 @@ CONFIG_WATCHDOG=y
776# 776#
777# CONFIG_USBPCWATCHDOG is not set 777# CONFIG_USBPCWATCHDOG is not set
778# CONFIG_NVRAM is not set 778# CONFIG_NVRAM is not set
779# CONFIG_RTC is not set
780# CONFIG_DTLK is not set 779# CONFIG_DTLK is not set
781# CONFIG_R3964 is not set 780# CONFIG_R3964 is not set
782# CONFIG_APPLICOM is not set 781# CONFIG_APPLICOM is not set
@@ -821,7 +820,6 @@ CONFIG_I2C_ALGOBIT=y
821# CONFIG_I2C_PARPORT_LIGHT is not set 820# CONFIG_I2C_PARPORT_LIGHT is not set
822# CONFIG_I2C_PROSAVAGE is not set 821# CONFIG_I2C_PROSAVAGE is not set
823# CONFIG_I2C_SAVAGE4 is not set 822# CONFIG_I2C_SAVAGE4 is not set
824# CONFIG_SCx200_ACB is not set
825# CONFIG_I2C_SIS5595 is not set 823# CONFIG_I2C_SIS5595 is not set
826# CONFIG_I2C_SIS630 is not set 824# CONFIG_I2C_SIS630 is not set
827# CONFIG_I2C_SIS96X is not set 825# CONFIG_I2C_SIS96X is not set
@@ -840,9 +838,7 @@ CONFIG_SENSORS_EEPROM=y
840# CONFIG_SENSORS_PCF8574 is not set 838# CONFIG_SENSORS_PCF8574 is not set
841# CONFIG_SENSORS_PCA9539 is not set 839# CONFIG_SENSORS_PCA9539 is not set
842# CONFIG_SENSORS_PCF8591 is not set 840# CONFIG_SENSORS_PCF8591 is not set
843# CONFIG_SENSORS_RTC8564 is not set
844# CONFIG_SENSORS_MAX6875 is not set 841# CONFIG_SENSORS_MAX6875 is not set
845# CONFIG_RTC_X1205_I2C is not set
846# CONFIG_I2C_DEBUG_CORE is not set 842# CONFIG_I2C_DEBUG_CORE is not set
847# CONFIG_I2C_DEBUG_ALGO is not set 843# CONFIG_I2C_DEBUG_ALGO is not set
848# CONFIG_I2C_DEBUG_BUS is not set 844# CONFIG_I2C_DEBUG_BUS is not set
@@ -907,7 +903,16 @@ CONFIG_HWMON=y
907# 903#
908 904
909# 905#
910# Multimedia Capabilities Port drivers 906# LED devices
907#
908# CONFIG_NEW_LEDS is not set
909
910#
911# LED drivers
912#
913
914#
915# LED Triggers
911# 916#
912 917
913# 918#
@@ -919,6 +924,7 @@ CONFIG_HWMON=y
919# Digital Video Broadcasting Devices 924# Digital Video Broadcasting Devices
920# 925#
921# CONFIG_DVB is not set 926# CONFIG_DVB is not set
927# CONFIG_USB_DABUSB is not set
922 928
923# 929#
924# Graphics support 930# Graphics support
@@ -935,6 +941,7 @@ CONFIG_HWMON=y
935# 941#
936CONFIG_USB_ARCH_HAS_HCD=y 942CONFIG_USB_ARCH_HAS_HCD=y
937CONFIG_USB_ARCH_HAS_OHCI=y 943CONFIG_USB_ARCH_HAS_OHCI=y
944CONFIG_USB_ARCH_HAS_EHCI=y
938CONFIG_USB=y 945CONFIG_USB=y
939# CONFIG_USB_DEBUG is not set 946# CONFIG_USB_DEBUG is not set
940 947
@@ -1000,9 +1007,7 @@ CONFIG_USB_STORAGE=y
1000# CONFIG_USB_ACECAD is not set 1007# CONFIG_USB_ACECAD is not set
1001# CONFIG_USB_KBTAB is not set 1008# CONFIG_USB_KBTAB is not set
1002# CONFIG_USB_POWERMATE is not set 1009# CONFIG_USB_POWERMATE is not set
1003# CONFIG_USB_MTOUCH is not set 1010# CONFIG_USB_TOUCHSCREEN is not set
1004# CONFIG_USB_ITMTOUCH is not set
1005# CONFIG_USB_EGALAX is not set
1006# CONFIG_USB_YEALINK is not set 1011# CONFIG_USB_YEALINK is not set
1007# CONFIG_USB_XPAD is not set 1012# CONFIG_USB_XPAD is not set
1008# CONFIG_USB_ATI_REMOTE is not set 1013# CONFIG_USB_ATI_REMOTE is not set
@@ -1017,15 +1022,6 @@ CONFIG_USB_STORAGE=y
1017# CONFIG_USB_MICROTEK is not set 1022# CONFIG_USB_MICROTEK is not set
1018 1023
1019# 1024#
1020# USB Multimedia devices
1021#
1022# CONFIG_USB_DABUSB is not set
1023
1024#
1025# Video4Linux support is needed for USB Multimedia device support
1026#
1027
1028#
1029# USB Network Adapters 1025# USB Network Adapters
1030# 1026#
1031# CONFIG_USB_CATC is not set 1027# CONFIG_USB_CATC is not set
@@ -1076,6 +1072,12 @@ CONFIG_USB_MON=y
1076# CONFIG_MMC is not set 1072# CONFIG_MMC is not set
1077 1073
1078# 1074#
1075# Real Time Clock
1076#
1077CONFIG_RTC_LIB=y
1078# CONFIG_RTC_CLASS is not set
1079
1080#
1079# File systems 1081# File systems
1080# 1082#
1081CONFIG_EXT2_FS=y 1083CONFIG_EXT2_FS=y
@@ -1127,7 +1129,6 @@ CONFIG_SYSFS=y
1127CONFIG_TMPFS=y 1129CONFIG_TMPFS=y
1128# CONFIG_HUGETLB_PAGE is not set 1130# CONFIG_HUGETLB_PAGE is not set
1129CONFIG_RAMFS=y 1131CONFIG_RAMFS=y
1130# CONFIG_RELAYFS_FS is not set
1131# CONFIG_CONFIGFS_FS is not set 1132# CONFIG_CONFIGFS_FS is not set
1132 1133
1133# 1134#
@@ -1268,6 +1269,7 @@ CONFIG_DEBUG_BUGVERBOSE=y
1268# CONFIG_DEBUG_FS is not set 1269# CONFIG_DEBUG_FS is not set
1269# CONFIG_DEBUG_VM is not set 1270# CONFIG_DEBUG_VM is not set
1270CONFIG_FRAME_POINTER=y 1271CONFIG_FRAME_POINTER=y
1272# CONFIG_UNWIND_INFO is not set
1271CONFIG_FORCED_INLINING=y 1273CONFIG_FORCED_INLINING=y
1272# CONFIG_RCU_TORTURE_TEST is not set 1274# CONFIG_RCU_TORTURE_TEST is not set
1273CONFIG_DEBUG_USER=y 1275CONFIG_DEBUG_USER=y
diff --git a/arch/arm/configs/versatile_defconfig b/arch/arm/configs/versatile_defconfig
index 2687a225aa6a..96b7a7762426 100644
--- a/arch/arm/configs/versatile_defconfig
+++ b/arch/arm/configs/versatile_defconfig
@@ -1,50 +1,55 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2 3# Linux kernel version: 2.6.17-rc3
4# Mon Mar 28 00:20:50 2005 4# Mon May 8 20:15:57 2006
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_MMU=y 7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y 8CONFIG_RWSEM_GENERIC_SPINLOCK=y
9CONFIG_GENERIC_HWEIGHT=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y 10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y 11CONFIG_VECTORS_BASE=0xffff0000
12 12
13# 13#
14# Code maturity level options 14# Code maturity level options
15# 15#
16CONFIG_EXPERIMENTAL=y 16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y 17CONFIG_BROKEN_ON_SMP=y
18CONFIG_INIT_ENV_ARG_LIMIT=32
19 19
20# 20#
21# General setup 21# General setup
22# 22#
23CONFIG_LOCALVERSION="" 23CONFIG_LOCALVERSION=""
24# CONFIG_LOCALVERSION_AUTO is not set
24CONFIG_SWAP=y 25CONFIG_SWAP=y
25CONFIG_SYSVIPC=y 26CONFIG_SYSVIPC=y
26# CONFIG_POSIX_MQUEUE is not set 27# CONFIG_POSIX_MQUEUE is not set
27# CONFIG_BSD_PROCESS_ACCT is not set 28# CONFIG_BSD_PROCESS_ACCT is not set
28CONFIG_SYSCTL=y 29CONFIG_SYSCTL=y
29# CONFIG_AUDIT is not set 30# CONFIG_AUDIT is not set
30CONFIG_HOTPLUG=y
31CONFIG_KOBJECT_UEVENT=y
32# CONFIG_IKCONFIG is not set 31# CONFIG_IKCONFIG is not set
32# CONFIG_RELAY is not set
33CONFIG_INITRAMFS_SOURCE=""
34CONFIG_UID16=y
35CONFIG_CC_OPTIMIZE_FOR_SIZE=y
33# CONFIG_EMBEDDED is not set 36# CONFIG_EMBEDDED is not set
34CONFIG_KALLSYMS=y 37CONFIG_KALLSYMS=y
35# CONFIG_KALLSYMS_ALL is not set 38# CONFIG_KALLSYMS_ALL is not set
36# CONFIG_KALLSYMS_EXTRA_PASS is not set 39# CONFIG_KALLSYMS_EXTRA_PASS is not set
40CONFIG_HOTPLUG=y
41CONFIG_PRINTK=y
42CONFIG_BUG=y
43CONFIG_ELF_CORE=y
37CONFIG_BASE_FULL=y 44CONFIG_BASE_FULL=y
38CONFIG_FUTEX=y 45CONFIG_FUTEX=y
39CONFIG_EPOLL=y 46CONFIG_EPOLL=y
40CONFIG_CC_OPTIMIZE_FOR_SIZE=y
41CONFIG_SHMEM=y 47CONFIG_SHMEM=y
42CONFIG_CC_ALIGN_FUNCTIONS=0 48CONFIG_SLAB=y
43CONFIG_CC_ALIGN_LABELS=0
44CONFIG_CC_ALIGN_LOOPS=0
45CONFIG_CC_ALIGN_JUMPS=0
46# CONFIG_TINY_SHMEM is not set 49# CONFIG_TINY_SHMEM is not set
47CONFIG_BASE_SMALL=0 50CONFIG_BASE_SMALL=0
51# CONFIG_SLOB is not set
52CONFIG_OBSOLETE_INTERMODULE=y
48 53
49# 54#
50# Loadable module support 55# Loadable module support
@@ -52,23 +57,42 @@ CONFIG_BASE_SMALL=0
52CONFIG_MODULES=y 57CONFIG_MODULES=y
53CONFIG_MODULE_UNLOAD=y 58CONFIG_MODULE_UNLOAD=y
54# CONFIG_MODULE_FORCE_UNLOAD is not set 59# CONFIG_MODULE_FORCE_UNLOAD is not set
55CONFIG_OBSOLETE_MODPARM=y
56# CONFIG_MODVERSIONS is not set 60# CONFIG_MODVERSIONS is not set
57# CONFIG_MODULE_SRCVERSION_ALL is not set 61# CONFIG_MODULE_SRCVERSION_ALL is not set
58CONFIG_KMOD=y 62CONFIG_KMOD=y
59 63
60# 64#
65# Block layer
66#
67# CONFIG_BLK_DEV_IO_TRACE is not set
68
69#
70# IO Schedulers
71#
72CONFIG_IOSCHED_NOOP=y
73CONFIG_IOSCHED_AS=y
74CONFIG_IOSCHED_DEADLINE=y
75CONFIG_IOSCHED_CFQ=y
76CONFIG_DEFAULT_AS=y
77# CONFIG_DEFAULT_DEADLINE is not set
78# CONFIG_DEFAULT_CFQ is not set
79# CONFIG_DEFAULT_NOOP is not set
80CONFIG_DEFAULT_IOSCHED="anticipatory"
81
82#
61# System Type 83# System Type
62# 84#
63# CONFIG_ARCH_CLPS7500 is not set 85# CONFIG_ARCH_CLPS7500 is not set
64# CONFIG_ARCH_CLPS711X is not set 86# CONFIG_ARCH_CLPS711X is not set
65# CONFIG_ARCH_CO285 is not set 87# CONFIG_ARCH_CO285 is not set
66# CONFIG_ARCH_EBSA110 is not set 88# CONFIG_ARCH_EBSA110 is not set
89# CONFIG_ARCH_EP93XX is not set
67# CONFIG_ARCH_FOOTBRIDGE is not set 90# CONFIG_ARCH_FOOTBRIDGE is not set
68# CONFIG_ARCH_INTEGRATOR is not set 91# CONFIG_ARCH_INTEGRATOR is not set
69# CONFIG_ARCH_IOP3XX is not set 92# CONFIG_ARCH_IOP3XX is not set
70# CONFIG_ARCH_IXP4XX is not set 93# CONFIG_ARCH_IXP4XX is not set
71# CONFIG_ARCH_IXP2000 is not set 94# CONFIG_ARCH_IXP2000 is not set
95# CONFIG_ARCH_IXP23XX is not set
72# CONFIG_ARCH_L7200 is not set 96# CONFIG_ARCH_L7200 is not set
73# CONFIG_ARCH_PXA is not set 97# CONFIG_ARCH_PXA is not set
74# CONFIG_ARCH_RPC is not set 98# CONFIG_ARCH_RPC is not set
@@ -78,14 +102,17 @@ CONFIG_KMOD=y
78# CONFIG_ARCH_LH7A40X is not set 102# CONFIG_ARCH_LH7A40X is not set
79# CONFIG_ARCH_OMAP is not set 103# CONFIG_ARCH_OMAP is not set
80CONFIG_ARCH_VERSATILE=y 104CONFIG_ARCH_VERSATILE=y
105# CONFIG_ARCH_REALVIEW is not set
81# CONFIG_ARCH_IMX is not set 106# CONFIG_ARCH_IMX is not set
82# CONFIG_ARCH_H720X is not set 107# CONFIG_ARCH_H720X is not set
108# CONFIG_ARCH_AAEC2000 is not set
109# CONFIG_ARCH_AT91RM9200 is not set
83 110
84# 111#
85# Versatile platform type 112# Versatile platform type
86# 113#
87CONFIG_ARCH_VERSATILE_PB=y 114CONFIG_ARCH_VERSATILE_PB=y
88# CONFIG_MACH_VERSATILE_AB is not set 115CONFIG_MACH_VERSATILE_AB=y
89 116
90# 117#
91# Processor Type 118# Processor Type
@@ -106,12 +133,14 @@ CONFIG_ARM_THUMB=y
106# CONFIG_CPU_DCACHE_DISABLE is not set 133# CONFIG_CPU_DCACHE_DISABLE is not set
107# CONFIG_CPU_DCACHE_WRITETHROUGH is not set 134# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
108# CONFIG_CPU_CACHE_ROUND_ROBIN is not set 135# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
136CONFIG_ARM_VIC=y
109CONFIG_ICST307=y 137CONFIG_ICST307=y
110 138
111# 139#
112# Bus support 140# Bus support
113# 141#
114CONFIG_ARM_AMBA=y 142CONFIG_ARM_AMBA=y
143# CONFIG_PCI is not set
115 144
116# 145#
117# PCCARD (PCMCIA/CardBus) support 146# PCCARD (PCMCIA/CardBus) support
@@ -122,6 +151,18 @@ CONFIG_ARM_AMBA=y
122# Kernel Features 151# Kernel Features
123# 152#
124# CONFIG_PREEMPT is not set 153# CONFIG_PREEMPT is not set
154# CONFIG_NO_IDLE_HZ is not set
155CONFIG_HZ=100
156# CONFIG_AEABI is not set
157# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
158CONFIG_SELECT_MEMORY_MODEL=y
159CONFIG_FLATMEM_MANUAL=y
160# CONFIG_DISCONTIGMEM_MANUAL is not set
161# CONFIG_SPARSEMEM_MANUAL is not set
162CONFIG_FLATMEM=y
163CONFIG_FLAT_NODE_MEM_MAP=y
164# CONFIG_SPARSEMEM_STATIC is not set
165CONFIG_SPLIT_PTLOCK_CPUS=4096
125CONFIG_LEDS=y 166CONFIG_LEDS=y
126CONFIG_LEDS_TIMER=y 167CONFIG_LEDS_TIMER=y
127CONFIG_LEDS_CPU=y 168CONFIG_LEDS_CPU=y
@@ -145,7 +186,7 @@ CONFIG_CMDLINE="root=1f03 mem=32M"
145CONFIG_FPE_NWFPE=y 186CONFIG_FPE_NWFPE=y
146# CONFIG_FPE_NWFPE_XP is not set 187# CONFIG_FPE_NWFPE_XP is not set
147# CONFIG_FPE_FASTFPE is not set 188# CONFIG_FPE_FASTFPE is not set
148# CONFIG_VFP is not set 189CONFIG_VFP=y
149 190
150# 191#
151# Userspace binary formats 192# Userspace binary formats
@@ -159,9 +200,92 @@ CONFIG_BINFMT_ELF=y
159# Power management options 200# Power management options
160# 201#
161CONFIG_PM=y 202CONFIG_PM=y
203CONFIG_PM_LEGACY=y
204# CONFIG_PM_DEBUG is not set
162# CONFIG_APM is not set 205# CONFIG_APM is not set
163 206
164# 207#
208# Networking
209#
210CONFIG_NET=y
211
212#
213# Networking options
214#
215# CONFIG_NETDEBUG is not set
216CONFIG_PACKET=y
217CONFIG_PACKET_MMAP=y
218CONFIG_UNIX=y
219# CONFIG_NET_KEY is not set
220CONFIG_INET=y
221CONFIG_IP_MULTICAST=y
222# CONFIG_IP_ADVANCED_ROUTER is not set
223CONFIG_IP_FIB_HASH=y
224CONFIG_IP_PNP=y
225# CONFIG_IP_PNP_DHCP is not set
226CONFIG_IP_PNP_BOOTP=y
227# CONFIG_IP_PNP_RARP is not set
228# CONFIG_NET_IPIP is not set
229# CONFIG_NET_IPGRE is not set
230# CONFIG_IP_MROUTE is not set
231# CONFIG_ARPD is not set
232# CONFIG_SYN_COOKIES is not set
233# CONFIG_INET_AH is not set
234# CONFIG_INET_ESP is not set
235# CONFIG_INET_IPCOMP is not set
236# CONFIG_INET_XFRM_TUNNEL is not set
237# CONFIG_INET_TUNNEL is not set
238# CONFIG_INET_DIAG is not set
239CONFIG_INET_TCP_DIAG=y
240# CONFIG_TCP_CONG_ADVANCED is not set
241CONFIG_TCP_CONG_BIC=y
242# CONFIG_IPV6 is not set
243# CONFIG_INET6_XFRM_TUNNEL is not set
244# CONFIG_INET6_TUNNEL is not set
245# CONFIG_NETFILTER is not set
246
247#
248# DCCP Configuration (EXPERIMENTAL)
249#
250# CONFIG_IP_DCCP is not set
251
252#
253# SCTP Configuration (EXPERIMENTAL)
254#
255# CONFIG_IP_SCTP is not set
256
257#
258# TIPC Configuration (EXPERIMENTAL)
259#
260# CONFIG_TIPC is not set
261# CONFIG_ATM is not set
262# CONFIG_BRIDGE is not set
263# CONFIG_VLAN_8021Q is not set
264# CONFIG_DECNET is not set
265# CONFIG_LLC2 is not set
266# CONFIG_IPX is not set
267# CONFIG_ATALK is not set
268# CONFIG_X25 is not set
269# CONFIG_LAPB is not set
270# CONFIG_NET_DIVERT is not set
271# CONFIG_ECONET is not set
272# CONFIG_WAN_ROUTER is not set
273
274#
275# QoS and/or fair queueing
276#
277# CONFIG_NET_SCHED is not set
278
279#
280# Network testing
281#
282# CONFIG_NET_PKTGEN is not set
283# CONFIG_HAMRADIO is not set
284# CONFIG_IRDA is not set
285# CONFIG_BT is not set
286# CONFIG_IEEE80211 is not set
287
288#
165# Device Drivers 289# Device Drivers
166# 290#
167 291
@@ -174,6 +298,11 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
174# CONFIG_DEBUG_DRIVER is not set 298# CONFIG_DEBUG_DRIVER is not set
175 299
176# 300#
301# Connector - unified userspace <-> kernelspace linker
302#
303# CONFIG_CONNECTOR is not set
304
305#
177# Memory Technology Devices (MTD) 306# Memory Technology Devices (MTD)
178# 307#
179CONFIG_MTD=y 308CONFIG_MTD=y
@@ -192,6 +321,7 @@ CONFIG_MTD_BLOCK=y
192# CONFIG_FTL is not set 321# CONFIG_FTL is not set
193# CONFIG_NFTL is not set 322# CONFIG_NFTL is not set
194# CONFIG_INFTL is not set 323# CONFIG_INFTL is not set
324# CONFIG_RFD_FTL is not set
195 325
196# 326#
197# RAM/ROM/Flash chip drivers 327# RAM/ROM/Flash chip drivers
@@ -214,6 +344,7 @@ CONFIG_MTD_CFI_I1=y
214CONFIG_MTD_CFI_I2=y 344CONFIG_MTD_CFI_I2=y
215# CONFIG_MTD_CFI_I4 is not set 345# CONFIG_MTD_CFI_I4 is not set
216# CONFIG_MTD_CFI_I8 is not set 346# CONFIG_MTD_CFI_I8 is not set
347# CONFIG_MTD_OTP is not set
217CONFIG_MTD_CFI_INTELEXT=y 348CONFIG_MTD_CFI_INTELEXT=y
218# CONFIG_MTD_CFI_AMDSTD is not set 349# CONFIG_MTD_CFI_AMDSTD is not set
219# CONFIG_MTD_CFI_STAA is not set 350# CONFIG_MTD_CFI_STAA is not set
@@ -221,7 +352,7 @@ CONFIG_MTD_CFI_UTIL=y
221# CONFIG_MTD_RAM is not set 352# CONFIG_MTD_RAM is not set
222# CONFIG_MTD_ROM is not set 353# CONFIG_MTD_ROM is not set
223# CONFIG_MTD_ABSENT is not set 354# CONFIG_MTD_ABSENT is not set
224# CONFIG_MTD_XIP is not set 355# CONFIG_MTD_OBSOLETE_CHIPS is not set
225 356
226# 357#
227# Mapping drivers for chip access 358# Mapping drivers for chip access
@@ -229,7 +360,7 @@ CONFIG_MTD_CFI_UTIL=y
229# CONFIG_MTD_COMPLEX_MAPPINGS is not set 360# CONFIG_MTD_COMPLEX_MAPPINGS is not set
230# CONFIG_MTD_PHYSMAP is not set 361# CONFIG_MTD_PHYSMAP is not set
231CONFIG_MTD_ARM_INTEGRATOR=y 362CONFIG_MTD_ARM_INTEGRATOR=y
232# CONFIG_MTD_EDB7312 is not set 363# CONFIG_MTD_PLATRAM is not set
233 364
234# 365#
235# Self-contained MTD device drivers 366# Self-contained MTD device drivers
@@ -237,7 +368,6 @@ CONFIG_MTD_ARM_INTEGRATOR=y
237# CONFIG_MTD_SLRAM is not set 368# CONFIG_MTD_SLRAM is not set
238# CONFIG_MTD_PHRAM is not set 369# CONFIG_MTD_PHRAM is not set
239# CONFIG_MTD_MTDRAM is not set 370# CONFIG_MTD_MTDRAM is not set
240# CONFIG_MTD_BLKMTD is not set
241# CONFIG_MTD_BLOCK2MTD is not set 371# CONFIG_MTD_BLOCK2MTD is not set
242 372
243# 373#
@@ -253,6 +383,11 @@ CONFIG_MTD_ARM_INTEGRATOR=y
253# CONFIG_MTD_NAND is not set 383# CONFIG_MTD_NAND is not set
254 384
255# 385#
386# OneNAND Flash Device Drivers
387#
388# CONFIG_MTD_ONENAND is not set
389
390#
256# Parallel port support 391# Parallel port support
257# 392#
258# CONFIG_PARPORT is not set 393# CONFIG_PARPORT is not set
@@ -264,7 +399,6 @@ CONFIG_MTD_ARM_INTEGRATOR=y
264# 399#
265# Block devices 400# Block devices
266# 401#
267# CONFIG_BLK_DEV_FD is not set
268# CONFIG_BLK_DEV_COW_COMMON is not set 402# CONFIG_BLK_DEV_COW_COMMON is not set
269# CONFIG_BLK_DEV_LOOP is not set 403# CONFIG_BLK_DEV_LOOP is not set
270# CONFIG_BLK_DEV_NBD is not set 404# CONFIG_BLK_DEV_NBD is not set
@@ -272,21 +406,13 @@ CONFIG_BLK_DEV_RAM=y
272CONFIG_BLK_DEV_RAM_COUNT=16 406CONFIG_BLK_DEV_RAM_COUNT=16
273CONFIG_BLK_DEV_RAM_SIZE=4096 407CONFIG_BLK_DEV_RAM_SIZE=4096
274CONFIG_BLK_DEV_INITRD=y 408CONFIG_BLK_DEV_INITRD=y
275CONFIG_INITRAMFS_SOURCE=""
276# CONFIG_CDROM_PKTCDVD is not set 409# CONFIG_CDROM_PKTCDVD is not set
277
278#
279# IO Schedulers
280#
281CONFIG_IOSCHED_NOOP=y
282CONFIG_IOSCHED_AS=y
283CONFIG_IOSCHED_DEADLINE=y
284CONFIG_IOSCHED_CFQ=y
285# CONFIG_ATA_OVER_ETH is not set 410# CONFIG_ATA_OVER_ETH is not set
286 411
287# 412#
288# SCSI device support 413# SCSI device support
289# 414#
415# CONFIG_RAID_ATTRS is not set
290# CONFIG_SCSI is not set 416# CONFIG_SCSI is not set
291 417
292# 418#
@@ -297,6 +423,7 @@ CONFIG_IOSCHED_CFQ=y
297# 423#
298# Fusion MPT device support 424# Fusion MPT device support
299# 425#
426# CONFIG_FUSION is not set
300 427
301# 428#
302# IEEE 1394 (FireWire) support 429# IEEE 1394 (FireWire) support
@@ -307,71 +434,8 @@ CONFIG_IOSCHED_CFQ=y
307# 434#
308 435
309# 436#
310# Networking support 437# Network device support
311#
312CONFIG_NET=y
313
314#
315# Networking options
316#
317CONFIG_PACKET=y
318CONFIG_PACKET_MMAP=y
319# CONFIG_NETLINK_DEV is not set
320CONFIG_UNIX=y
321# CONFIG_NET_KEY is not set
322CONFIG_INET=y
323CONFIG_IP_MULTICAST=y
324# CONFIG_IP_ADVANCED_ROUTER is not set
325CONFIG_IP_PNP=y
326# CONFIG_IP_PNP_DHCP is not set
327CONFIG_IP_PNP_BOOTP=y
328# CONFIG_IP_PNP_RARP is not set
329# CONFIG_NET_IPIP is not set
330# CONFIG_NET_IPGRE is not set
331# CONFIG_IP_MROUTE is not set
332# CONFIG_ARPD is not set
333# CONFIG_SYN_COOKIES is not set
334# CONFIG_INET_AH is not set
335# CONFIG_INET_ESP is not set
336# CONFIG_INET_IPCOMP is not set
337# CONFIG_INET_TUNNEL is not set
338# CONFIG_IP_TCPDIAG is not set
339# CONFIG_IP_TCPDIAG_IPV6 is not set
340# CONFIG_IPV6 is not set
341# CONFIG_NETFILTER is not set
342
343#
344# SCTP Configuration (EXPERIMENTAL)
345#
346# CONFIG_IP_SCTP is not set
347# CONFIG_ATM is not set
348# CONFIG_BRIDGE is not set
349# CONFIG_VLAN_8021Q is not set
350# CONFIG_DECNET is not set
351# CONFIG_LLC2 is not set
352# CONFIG_IPX is not set
353# CONFIG_ATALK is not set
354# CONFIG_X25 is not set
355# CONFIG_LAPB is not set
356# CONFIG_NET_DIVERT is not set
357# CONFIG_ECONET is not set
358# CONFIG_WAN_ROUTER is not set
359
360#
361# QoS and/or fair queueing
362#
363# CONFIG_NET_SCHED is not set
364# CONFIG_NET_CLS_ROUTE is not set
365
366#
367# Network testing
368# 438#
369# CONFIG_NET_PKTGEN is not set
370# CONFIG_NETPOLL is not set
371# CONFIG_NET_POLL_CONTROLLER is not set
372# CONFIG_HAMRADIO is not set
373# CONFIG_IRDA is not set
374# CONFIG_BT is not set
375CONFIG_NETDEVICES=y 439CONFIG_NETDEVICES=y
376# CONFIG_DUMMY is not set 440# CONFIG_DUMMY is not set
377# CONFIG_BONDING is not set 441# CONFIG_BONDING is not set
@@ -379,11 +443,17 @@ CONFIG_NETDEVICES=y
379# CONFIG_TUN is not set 443# CONFIG_TUN is not set
380 444
381# 445#
446# PHY device support
447#
448# CONFIG_PHYLIB is not set
449
450#
382# Ethernet (10 or 100Mbit) 451# Ethernet (10 or 100Mbit)
383# 452#
384CONFIG_NET_ETHERNET=y 453CONFIG_NET_ETHERNET=y
385CONFIG_MII=y 454CONFIG_MII=y
386CONFIG_SMC91X=y 455CONFIG_SMC91X=y
456# CONFIG_DM9000 is not set
387 457
388# 458#
389# Ethernet (1000 Mbit) 459# Ethernet (1000 Mbit)
@@ -410,6 +480,8 @@ CONFIG_SMC91X=y
410# CONFIG_SLIP is not set 480# CONFIG_SLIP is not set
411# CONFIG_SHAPER is not set 481# CONFIG_SHAPER is not set
412# CONFIG_NETCONSOLE is not set 482# CONFIG_NETCONSOLE is not set
483# CONFIG_NETPOLL is not set
484# CONFIG_NET_POLL_CONTROLLER is not set
413 485
414# 486#
415# ISDN subsystem 487# ISDN subsystem
@@ -459,7 +531,6 @@ CONFIG_SERIO_AMBAKMI=y
459CONFIG_SERIO_LIBPS2=y 531CONFIG_SERIO_LIBPS2=y
460# CONFIG_SERIO_RAW is not set 532# CONFIG_SERIO_RAW is not set
461# CONFIG_GAMEPORT is not set 533# CONFIG_GAMEPORT is not set
462CONFIG_SOUND_GAMEPORT=y
463 534
464# 535#
465# Character devices 536# Character devices
@@ -474,17 +545,16 @@ CONFIG_HW_CONSOLE=y
474# 545#
475CONFIG_SERIAL_8250=m 546CONFIG_SERIAL_8250=m
476CONFIG_SERIAL_8250_NR_UARTS=4 547CONFIG_SERIAL_8250_NR_UARTS=4
548CONFIG_SERIAL_8250_RUNTIME_UARTS=4
477CONFIG_SERIAL_8250_EXTENDED=y 549CONFIG_SERIAL_8250_EXTENDED=y
478CONFIG_SERIAL_8250_MANY_PORTS=y 550CONFIG_SERIAL_8250_MANY_PORTS=y
479CONFIG_SERIAL_8250_SHARE_IRQ=y 551CONFIG_SERIAL_8250_SHARE_IRQ=y
480# CONFIG_SERIAL_8250_DETECT_IRQ is not set 552# CONFIG_SERIAL_8250_DETECT_IRQ is not set
481CONFIG_SERIAL_8250_MULTIPORT=y
482CONFIG_SERIAL_8250_RSA=y 553CONFIG_SERIAL_8250_RSA=y
483 554
484# 555#
485# Non-8250 serial port support 556# Non-8250 serial port support
486# 557#
487# CONFIG_SERIAL_AMBA_PL010 is not set
488CONFIG_SERIAL_AMBA_PL011=y 558CONFIG_SERIAL_AMBA_PL011=y
489CONFIG_SERIAL_AMBA_PL011_CONSOLE=y 559CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
490CONFIG_SERIAL_CORE=y 560CONFIG_SERIAL_CORE=y
@@ -503,20 +573,19 @@ CONFIG_LEGACY_PTY_COUNT=16
503# 573#
504# CONFIG_WATCHDOG is not set 574# CONFIG_WATCHDOG is not set
505# CONFIG_NVRAM is not set 575# CONFIG_NVRAM is not set
506# CONFIG_RTC is not set
507# CONFIG_DTLK is not set 576# CONFIG_DTLK is not set
508# CONFIG_R3964 is not set 577# CONFIG_R3964 is not set
509 578
510# 579#
511# Ftape, the floppy tape device driver 580# Ftape, the floppy tape device driver
512# 581#
513# CONFIG_DRM is not set
514# CONFIG_RAW_DRIVER is not set 582# CONFIG_RAW_DRIVER is not set
515 583
516# 584#
517# TPM devices 585# TPM devices
518# 586#
519# CONFIG_TCG_TPM is not set 587# CONFIG_TCG_TPM is not set
588# CONFIG_TELCLOCK is not set
520 589
521# 590#
522# I2C support 591# I2C support
@@ -534,60 +603,60 @@ CONFIG_I2C_ALGOBIT=y
534# 603#
535# I2C Hardware Bus support 604# I2C Hardware Bus support
536# 605#
537# CONFIG_I2C_ISA is not set
538# CONFIG_I2C_PARPORT_LIGHT is not set 606# CONFIG_I2C_PARPORT_LIGHT is not set
539# CONFIG_I2C_STUB is not set 607# CONFIG_I2C_STUB is not set
540# CONFIG_I2C_PCA_ISA is not set 608# CONFIG_I2C_PCA_ISA is not set
541 609
542# 610#
543# Hardware Sensors Chip support 611# Miscellaneous I2C Chip support
544#
545CONFIG_I2C_SENSOR=m
546# CONFIG_SENSORS_ADM1021 is not set
547# CONFIG_SENSORS_ADM1025 is not set
548# CONFIG_SENSORS_ADM1026 is not set
549# CONFIG_SENSORS_ADM1031 is not set
550# CONFIG_SENSORS_ASB100 is not set
551# CONFIG_SENSORS_DS1621 is not set
552# CONFIG_SENSORS_FSCHER is not set
553# CONFIG_SENSORS_FSCPOS is not set
554# CONFIG_SENSORS_GL518SM is not set
555# CONFIG_SENSORS_GL520SM is not set
556# CONFIG_SENSORS_IT87 is not set
557# CONFIG_SENSORS_LM63 is not set
558# CONFIG_SENSORS_LM75 is not set
559# CONFIG_SENSORS_LM77 is not set
560# CONFIG_SENSORS_LM78 is not set
561# CONFIG_SENSORS_LM80 is not set
562# CONFIG_SENSORS_LM83 is not set
563# CONFIG_SENSORS_LM85 is not set
564# CONFIG_SENSORS_LM87 is not set
565# CONFIG_SENSORS_LM90 is not set
566# CONFIG_SENSORS_MAX1619 is not set
567# CONFIG_SENSORS_PC87360 is not set
568# CONFIG_SENSORS_SMSC47B397 is not set
569# CONFIG_SENSORS_SMSC47M1 is not set
570# CONFIG_SENSORS_W83781D is not set
571# CONFIG_SENSORS_W83L785TS is not set
572# CONFIG_SENSORS_W83627HF is not set
573
574#
575# Other I2C Chip support
576# 612#
613# CONFIG_SENSORS_DS1337 is not set
614# CONFIG_SENSORS_DS1374 is not set
577CONFIG_SENSORS_EEPROM=m 615CONFIG_SENSORS_EEPROM=m
578# CONFIG_SENSORS_PCF8574 is not set 616# CONFIG_SENSORS_PCF8574 is not set
617# CONFIG_SENSORS_PCA9539 is not set
579# CONFIG_SENSORS_PCF8591 is not set 618# CONFIG_SENSORS_PCF8591 is not set
580# CONFIG_SENSORS_RTC8564 is not set 619# CONFIG_SENSORS_MAX6875 is not set
581# CONFIG_I2C_DEBUG_CORE is not set 620# CONFIG_I2C_DEBUG_CORE is not set
582# CONFIG_I2C_DEBUG_ALGO is not set 621# CONFIG_I2C_DEBUG_ALGO is not set
583# CONFIG_I2C_DEBUG_BUS is not set 622# CONFIG_I2C_DEBUG_BUS is not set
584# CONFIG_I2C_DEBUG_CHIP is not set 623# CONFIG_I2C_DEBUG_CHIP is not set
585 624
586# 625#
626# SPI support
627#
628# CONFIG_SPI is not set
629# CONFIG_SPI_MASTER is not set
630
631#
632# Dallas's 1-wire bus
633#
634# CONFIG_W1 is not set
635
636#
637# Hardware Monitoring support
638#
639# CONFIG_HWMON is not set
640# CONFIG_HWMON_VID is not set
641
642#
587# Misc devices 643# Misc devices
588# 644#
589 645
590# 646#
647# LED devices
648#
649# CONFIG_NEW_LEDS is not set
650
651#
652# LED drivers
653#
654
655#
656# LED Triggers
657#
658
659#
591# Multimedia devices 660# Multimedia devices
592# 661#
593# CONFIG_VIDEO_DEV is not set 662# CONFIG_VIDEO_DEV is not set
@@ -604,27 +673,31 @@ CONFIG_FB=y
604CONFIG_FB_CFB_FILLRECT=y 673CONFIG_FB_CFB_FILLRECT=y
605CONFIG_FB_CFB_COPYAREA=y 674CONFIG_FB_CFB_COPYAREA=y
606CONFIG_FB_CFB_IMAGEBLIT=y 675CONFIG_FB_CFB_IMAGEBLIT=y
607CONFIG_FB_SOFT_CURSOR=y 676# CONFIG_FB_MACMODES is not set
677# CONFIG_FB_FIRMWARE_EDID is not set
608# CONFIG_FB_MODE_HELPERS is not set 678# CONFIG_FB_MODE_HELPERS is not set
609# CONFIG_FB_TILEBLITTING is not set 679# CONFIG_FB_TILEBLITTING is not set
610CONFIG_FB_ARMCLCD=y 680CONFIG_FB_ARMCLCD=y
681# CONFIG_FB_S1D13XXX is not set
611# CONFIG_FB_VIRTUAL is not set 682# CONFIG_FB_VIRTUAL is not set
612 683
613# 684#
614# Console display driver support 685# Console display driver support
615# 686#
616# CONFIG_VGA_CONSOLE is not set
617CONFIG_DUMMY_CONSOLE=y 687CONFIG_DUMMY_CONSOLE=y
618CONFIG_FRAMEBUFFER_CONSOLE=y 688CONFIG_FRAMEBUFFER_CONSOLE=y
689# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
619CONFIG_FONTS=y 690CONFIG_FONTS=y
620# CONFIG_FONT_8x8 is not set 691# CONFIG_FONT_8x8 is not set
621# CONFIG_FONT_8x16 is not set 692# CONFIG_FONT_8x16 is not set
622# CONFIG_FONT_6x11 is not set 693# CONFIG_FONT_6x11 is not set
694# CONFIG_FONT_7x14 is not set
623# CONFIG_FONT_PEARL_8x8 is not set 695# CONFIG_FONT_PEARL_8x8 is not set
624CONFIG_FONT_ACORN_8x8=y 696CONFIG_FONT_ACORN_8x8=y
625# CONFIG_FONT_MINI_4x6 is not set 697# CONFIG_FONT_MINI_4x6 is not set
626# CONFIG_FONT_SUN8x16 is not set 698# CONFIG_FONT_SUN8x16 is not set
627# CONFIG_FONT_SUN12x22 is not set 699# CONFIG_FONT_SUN12x22 is not set
700# CONFIG_FONT_10x18 is not set
628 701
629# 702#
630# Logo configuration 703# Logo configuration
@@ -647,12 +720,18 @@ CONFIG_SND_PCM=m
647CONFIG_SND_OSSEMUL=y 720CONFIG_SND_OSSEMUL=y
648CONFIG_SND_MIXER_OSS=m 721CONFIG_SND_MIXER_OSS=m
649CONFIG_SND_PCM_OSS=m 722CONFIG_SND_PCM_OSS=m
723CONFIG_SND_PCM_OSS_PLUGINS=y
724# CONFIG_SND_DYNAMIC_MINORS is not set
725CONFIG_SND_SUPPORT_OLD_API=y
726CONFIG_SND_VERBOSE_PROCFS=y
650# CONFIG_SND_VERBOSE_PRINTK is not set 727# CONFIG_SND_VERBOSE_PRINTK is not set
651# CONFIG_SND_DEBUG is not set 728# CONFIG_SND_DEBUG is not set
652 729
653# 730#
654# Generic devices 731# Generic devices
655# 732#
733CONFIG_SND_AC97_CODEC=m
734CONFIG_SND_AC97_BUS=m
656# CONFIG_SND_DUMMY is not set 735# CONFIG_SND_DUMMY is not set
657# CONFIG_SND_MTPAV is not set 736# CONFIG_SND_MTPAV is not set
658# CONFIG_SND_SERIAL_U16550 is not set 737# CONFIG_SND_SERIAL_U16550 is not set
@@ -661,6 +740,7 @@ CONFIG_SND_PCM_OSS=m
661# 740#
662# ALSA ARM devices 741# ALSA ARM devices
663# 742#
743CONFIG_SND_ARMAACI=m
664 744
665# 745#
666# Open Sound System 746# Open Sound System
@@ -672,9 +752,14 @@ CONFIG_SND_PCM_OSS=m
672# 752#
673CONFIG_USB_ARCH_HAS_HCD=y 753CONFIG_USB_ARCH_HAS_HCD=y
674# CONFIG_USB_ARCH_HAS_OHCI is not set 754# CONFIG_USB_ARCH_HAS_OHCI is not set
755# CONFIG_USB_ARCH_HAS_EHCI is not set
675# CONFIG_USB is not set 756# CONFIG_USB is not set
676 757
677# 758#
759# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
760#
761
762#
678# USB Gadget Support 763# USB Gadget Support
679# 764#
680# CONFIG_USB_GADGET is not set 765# CONFIG_USB_GADGET is not set
@@ -688,25 +773,31 @@ CONFIG_MMC_BLOCK=y
688CONFIG_MMC_ARMMMCI=m 773CONFIG_MMC_ARMMMCI=m
689 774
690# 775#
776# Real Time Clock
777#
778CONFIG_RTC_LIB=y
779# CONFIG_RTC_CLASS is not set
780
781#
691# File systems 782# File systems
692# 783#
693CONFIG_EXT2_FS=y 784CONFIG_EXT2_FS=y
694# CONFIG_EXT2_FS_XATTR is not set 785# CONFIG_EXT2_FS_XATTR is not set
786# CONFIG_EXT2_FS_XIP is not set
695# CONFIG_EXT3_FS is not set 787# CONFIG_EXT3_FS is not set
696# CONFIG_JBD is not set
697# CONFIG_REISERFS_FS is not set 788# CONFIG_REISERFS_FS is not set
698# CONFIG_JFS_FS is not set 789# CONFIG_JFS_FS is not set
699 790# CONFIG_FS_POSIX_ACL is not set
700#
701# XFS support
702#
703# CONFIG_XFS_FS is not set 791# CONFIG_XFS_FS is not set
792# CONFIG_OCFS2_FS is not set
704CONFIG_MINIX_FS=y 793CONFIG_MINIX_FS=y
705CONFIG_ROMFS_FS=y 794CONFIG_ROMFS_FS=y
795# CONFIG_INOTIFY is not set
706# CONFIG_QUOTA is not set 796# CONFIG_QUOTA is not set
707CONFIG_DNOTIFY=y 797CONFIG_DNOTIFY=y
708# CONFIG_AUTOFS_FS is not set 798# CONFIG_AUTOFS_FS is not set
709# CONFIG_AUTOFS4_FS is not set 799# CONFIG_AUTOFS4_FS is not set
800# CONFIG_FUSE_FS is not set
710 801
711# 802#
712# CD-ROM/DVD Filesystems 803# CD-ROM/DVD Filesystems
@@ -729,11 +820,10 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
729# 820#
730CONFIG_PROC_FS=y 821CONFIG_PROC_FS=y
731CONFIG_SYSFS=y 822CONFIG_SYSFS=y
732# CONFIG_DEVFS_FS is not set
733# CONFIG_DEVPTS_FS_XATTR is not set
734# CONFIG_TMPFS is not set 823# CONFIG_TMPFS is not set
735# CONFIG_HUGETLB_PAGE is not set 824# CONFIG_HUGETLB_PAGE is not set
736CONFIG_RAMFS=y 825CONFIG_RAMFS=y
826# CONFIG_CONFIGFS_FS is not set
737 827
738# 828#
739# Miscellaneous filesystems 829# Miscellaneous filesystems
@@ -748,8 +838,8 @@ CONFIG_RAMFS=y
748# CONFIG_JFFS_FS is not set 838# CONFIG_JFFS_FS is not set
749CONFIG_JFFS2_FS=y 839CONFIG_JFFS2_FS=y
750CONFIG_JFFS2_FS_DEBUG=0 840CONFIG_JFFS2_FS_DEBUG=0
751# CONFIG_JFFS2_FS_NAND is not set 841CONFIG_JFFS2_FS_WRITEBUFFER=y
752# CONFIG_JFFS2_FS_NOR_ECC is not set 842# CONFIG_JFFS2_SUMMARY is not set
753# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set 843# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
754CONFIG_JFFS2_ZLIB=y 844CONFIG_JFFS2_ZLIB=y
755CONFIG_JFFS2_RTIME=y 845CONFIG_JFFS2_RTIME=y
@@ -766,16 +856,19 @@ CONFIG_CRAMFS=y
766# 856#
767CONFIG_NFS_FS=y 857CONFIG_NFS_FS=y
768CONFIG_NFS_V3=y 858CONFIG_NFS_V3=y
859# CONFIG_NFS_V3_ACL is not set
769# CONFIG_NFS_V4 is not set 860# CONFIG_NFS_V4 is not set
770# CONFIG_NFS_DIRECTIO is not set 861# CONFIG_NFS_DIRECTIO is not set
771CONFIG_NFSD=y 862CONFIG_NFSD=y
772CONFIG_NFSD_V3=y 863CONFIG_NFSD_V3=y
864# CONFIG_NFSD_V3_ACL is not set
773# CONFIG_NFSD_V4 is not set 865# CONFIG_NFSD_V4 is not set
774# CONFIG_NFSD_TCP is not set 866# CONFIG_NFSD_TCP is not set
775CONFIG_ROOT_NFS=y 867CONFIG_ROOT_NFS=y
776CONFIG_LOCKD=y 868CONFIG_LOCKD=y
777CONFIG_LOCKD_V4=y 869CONFIG_LOCKD_V4=y
778CONFIG_EXPORTFS=y 870CONFIG_EXPORTFS=y
871CONFIG_NFS_COMMON=y
779CONFIG_SUNRPC=y 872CONFIG_SUNRPC=y
780# CONFIG_RPCSEC_GSS_KRB5 is not set 873# CONFIG_RPCSEC_GSS_KRB5 is not set
781# CONFIG_RPCSEC_GSS_SPKM3 is not set 874# CONFIG_RPCSEC_GSS_SPKM3 is not set
@@ -784,6 +877,7 @@ CONFIG_SUNRPC=y
784# CONFIG_NCP_FS is not set 877# CONFIG_NCP_FS is not set
785# CONFIG_CODA_FS is not set 878# CONFIG_CODA_FS is not set
786# CONFIG_AFS_FS is not set 879# CONFIG_AFS_FS is not set
880# CONFIG_9P_FS is not set
787 881
788# 882#
789# Partition Types 883# Partition Types
@@ -803,6 +897,7 @@ CONFIG_MSDOS_PARTITION=y
803# CONFIG_SGI_PARTITION is not set 897# CONFIG_SGI_PARTITION is not set
804# CONFIG_ULTRIX_PARTITION is not set 898# CONFIG_ULTRIX_PARTITION is not set
805# CONFIG_SUN_PARTITION is not set 899# CONFIG_SUN_PARTITION is not set
900# CONFIG_KARMA_PARTITION is not set
806# CONFIG_EFI_PARTITION is not set 901# CONFIG_EFI_PARTITION is not set
807 902
808# 903#
@@ -858,18 +953,24 @@ CONFIG_NLS_ISO8859_1=m
858# Kernel hacking 953# Kernel hacking
859# 954#
860# CONFIG_PRINTK_TIME is not set 955# CONFIG_PRINTK_TIME is not set
861CONFIG_DEBUG_KERNEL=y
862CONFIG_MAGIC_SYSRQ=y 956CONFIG_MAGIC_SYSRQ=y
957CONFIG_DEBUG_KERNEL=y
863CONFIG_LOG_BUF_SHIFT=14 958CONFIG_LOG_BUF_SHIFT=14
959CONFIG_DETECT_SOFTLOCKUP=y
864# CONFIG_SCHEDSTATS is not set 960# CONFIG_SCHEDSTATS is not set
865# CONFIG_DEBUG_SLAB is not set 961# CONFIG_DEBUG_SLAB is not set
962# CONFIG_DEBUG_MUTEXES is not set
866# CONFIG_DEBUG_SPINLOCK is not set 963# CONFIG_DEBUG_SPINLOCK is not set
867# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 964# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
868# CONFIG_DEBUG_KOBJECT is not set 965# CONFIG_DEBUG_KOBJECT is not set
869CONFIG_DEBUG_BUGVERBOSE=y 966CONFIG_DEBUG_BUGVERBOSE=y
870# CONFIG_DEBUG_INFO is not set 967# CONFIG_DEBUG_INFO is not set
871# CONFIG_DEBUG_FS is not set 968# CONFIG_DEBUG_FS is not set
969# CONFIG_DEBUG_VM is not set
872CONFIG_FRAME_POINTER=y 970CONFIG_FRAME_POINTER=y
971# CONFIG_UNWIND_INFO is not set
972CONFIG_FORCED_INLINING=y
973# CONFIG_RCU_TORTURE_TEST is not set
873CONFIG_DEBUG_USER=y 974CONFIG_DEBUG_USER=y
874# CONFIG_DEBUG_WAITQ is not set 975# CONFIG_DEBUG_WAITQ is not set
875CONFIG_DEBUG_ERRORS=y 976CONFIG_DEBUG_ERRORS=y
@@ -895,6 +996,7 @@ CONFIG_DEBUG_LL=y
895# Library routines 996# Library routines
896# 997#
897# CONFIG_CRC_CCITT is not set 998# CONFIG_CRC_CCITT is not set
999# CONFIG_CRC16 is not set
898CONFIG_CRC32=y 1000CONFIG_CRC32=y
899# CONFIG_LIBCRC32C is not set 1001# CONFIG_LIBCRC32C is not set
900CONFIG_ZLIB_INFLATE=y 1002CONFIG_ZLIB_INFLATE=y
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
index 2ce0e3a27a45..a601b8b55f35 100644
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -29,7 +29,7 @@ ifneq ($(CONFIG_ARCH_EBSA110),y)
29 obj-y += io.o 29 obj-y += io.o
30endif 30endif
31 31
32head-y := head.o 32head-y := head$(MMUEXT).o
33obj-$(CONFIG_DEBUG_LL) += debug.o 33obj-$(CONFIG_DEBUG_LL) += debug.o
34 34
35extra-y := $(head-y) init_task.o vmlinux.lds 35extra-y := $(head-y) init_task.o vmlinux.lds
diff --git a/arch/arm/kernel/asm-offsets.c b/arch/arm/kernel/asm-offsets.c
index b324dcac1c56..396efba9bacd 100644
--- a/arch/arm/kernel/asm-offsets.c
+++ b/arch/arm/kernel/asm-offsets.c
@@ -95,5 +95,13 @@ int main(void)
95 DEFINE(SYS_ERROR0, 0x9f0000); 95 DEFINE(SYS_ERROR0, 0x9f0000);
96 BLANK(); 96 BLANK();
97 DEFINE(SIZEOF_MACHINE_DESC, sizeof(struct machine_desc)); 97 DEFINE(SIZEOF_MACHINE_DESC, sizeof(struct machine_desc));
98 DEFINE(MACHINFO_TYPE, offsetof(struct machine_desc, nr));
99 DEFINE(MACHINFO_NAME, offsetof(struct machine_desc, name));
100 DEFINE(MACHINFO_PHYSIO, offsetof(struct machine_desc, phys_io));
101 DEFINE(MACHINFO_PGOFFIO, offsetof(struct machine_desc, io_pg_offst));
102 BLANK();
103 DEFINE(PROC_INFO_SZ, sizeof(struct proc_info_list));
104 DEFINE(PROCINFO_INITFUNC, offsetof(struct proc_info_list, __cpu_flush));
105 DEFINE(PROCINFO_MMUFLAGS, offsetof(struct proc_info_list, __cpu_mmu_flags));
98 return 0; 106 return 0;
99} 107}
diff --git a/arch/arm/kernel/dma-isa.c b/arch/arm/kernel/dma-isa.c
index 03532769a97f..0a3e9ad297d8 100644
--- a/arch/arm/kernel/dma-isa.c
+++ b/arch/arm/kernel/dma-isa.c
@@ -143,12 +143,23 @@ static struct dma_ops isa_dma_ops = {
143 .residue = isa_get_dma_residue, 143 .residue = isa_get_dma_residue,
144}; 144};
145 145
146static struct resource dma_resources[] = { 146static struct resource dma_resources[] = { {
147 { "dma1", 0x0000, 0x000f }, 147 .name = "dma1",
148 { "dma low page", 0x0080, 0x008f }, 148 .start = 0x0000,
149 { "dma2", 0x00c0, 0x00df }, 149 .end = 0x000f
150 { "dma high page", 0x0480, 0x048f } 150}, {
151}; 151 .name = "dma low page",
152 .start = 0x0080,
153 .end = 0x008f
154}, {
155 .name = "dma2",
156 .start = 0x00c0,
157 .end = 0x00df
158}, {
159 .name = "dma high page",
160 .start = 0x0480,
161 .end = 0x048f
162} };
152 163
153void __init isa_init_dma(dma_t *dma) 164void __init isa_init_dma(dma_t *dma)
154{ 165{
diff --git a/arch/arm/kernel/head-nommu.S b/arch/arm/kernel/head-nommu.S
index b093ab8738b5..adf62e5eaad7 100644
--- a/arch/arm/kernel/head-nommu.S
+++ b/arch/arm/kernel/head-nommu.S
@@ -20,11 +20,10 @@
20#include <asm/mach-types.h> 20#include <asm/mach-types.h>
21#include <asm/procinfo.h> 21#include <asm/procinfo.h>
22#include <asm/ptrace.h> 22#include <asm/ptrace.h>
23#include <asm/constants.h> 23#include <asm/asm-offsets.h>
24#include <asm/thread_info.h>
24#include <asm/system.h> 25#include <asm/system.h>
25 26
26#define PROCINFO_INITFUNC 12
27
28/* 27/*
29 * Kernel startup entry point. 28 * Kernel startup entry point.
30 * --------------------------- 29 * ---------------------------
@@ -79,5 +78,6 @@ __after_proc_init:
79 78
80 mov pc, r13 @ clear the BSS and jump 79 mov pc, r13 @ clear the BSS and jump
81 @ to start_kernel 80 @ to start_kernel
81 .ltorg
82 82
83#include "head-common.S" 83#include "head-common.S"
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
index 04b66a9328ef..04f7344e356a 100644
--- a/arch/arm/kernel/head.S
+++ b/arch/arm/kernel/head.S
@@ -24,14 +24,6 @@
24#include <asm/thread_info.h> 24#include <asm/thread_info.h>
25#include <asm/system.h> 25#include <asm/system.h>
26 26
27#define PROCINFO_MMUFLAGS 8
28#define PROCINFO_INITFUNC 12
29
30#define MACHINFO_TYPE 0
31#define MACHINFO_PHYSIO 4
32#define MACHINFO_PGOFFIO 8
33#define MACHINFO_NAME 12
34
35#define KERNEL_RAM_ADDR (PAGE_OFFSET + TEXT_OFFSET) 27#define KERNEL_RAM_ADDR (PAGE_OFFSET + TEXT_OFFSET)
36 28
37/* 29/*
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index 1ff75cee4b0d..7df6e1aaa323 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -264,8 +264,12 @@ void show_fpregs(struct user_fp *regs)
264/* 264/*
265 * Task structure and kernel stack allocation. 265 * Task structure and kernel stack allocation.
266 */ 266 */
267static unsigned long *thread_info_head; 267struct thread_info_list {
268static unsigned int nr_thread_info; 268 unsigned long *head;
269 unsigned int nr;
270};
271
272static DEFINE_PER_CPU(struct thread_info_list, thread_info_list) = { NULL, 0 };
269 273
270#define EXTRA_TASK_STRUCT 4 274#define EXTRA_TASK_STRUCT 4
271 275
@@ -274,12 +278,15 @@ struct thread_info *alloc_thread_info(struct task_struct *task)
274 struct thread_info *thread = NULL; 278 struct thread_info *thread = NULL;
275 279
276 if (EXTRA_TASK_STRUCT) { 280 if (EXTRA_TASK_STRUCT) {
277 unsigned long *p = thread_info_head; 281 struct thread_info_list *th = &get_cpu_var(thread_info_list);
282 unsigned long *p = th->head;
278 283
279 if (p) { 284 if (p) {
280 thread_info_head = (unsigned long *)p[0]; 285 th->head = (unsigned long *)p[0];
281 nr_thread_info -= 1; 286 th->nr -= 1;
282 } 287 }
288 put_cpu_var(thread_info_list);
289
283 thread = (struct thread_info *)p; 290 thread = (struct thread_info *)p;
284 } 291 }
285 292
@@ -300,13 +307,19 @@ struct thread_info *alloc_thread_info(struct task_struct *task)
300 307
301void free_thread_info(struct thread_info *thread) 308void free_thread_info(struct thread_info *thread)
302{ 309{
303 if (EXTRA_TASK_STRUCT && nr_thread_info < EXTRA_TASK_STRUCT) { 310 if (EXTRA_TASK_STRUCT) {
304 unsigned long *p = (unsigned long *)thread; 311 struct thread_info_list *th = &get_cpu_var(thread_info_list);
305 p[0] = (unsigned long)thread_info_head; 312 if (th->nr < EXTRA_TASK_STRUCT) {
306 thread_info_head = p; 313 unsigned long *p = (unsigned long *)thread;
307 nr_thread_info += 1; 314 p[0] = (unsigned long)th->head;
308 } else 315 th->head = p;
309 free_pages((unsigned long)thread, THREAD_SIZE_ORDER); 316 th->nr += 1;
317 put_cpu_var(thread_info_list);
318 return;
319 }
320 put_cpu_var(thread_info_list);
321 }
322 free_pages((unsigned long)thread, THREAD_SIZE_ORDER);
310} 323}
311 324
312/* 325/*
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 8cff73e668b3..9fc9af88c60c 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -407,7 +407,7 @@ static void __init early_initrd(char **p)
407} 407}
408__early_param("initrd=", early_initrd); 408__early_param("initrd=", early_initrd);
409 409
410static void __init add_memory(unsigned long start, unsigned long size) 410static void __init arm_add_memory(unsigned long start, unsigned long size)
411{ 411{
412 /* 412 /*
413 * Ensure that start/size are aligned to a page boundary. 413 * Ensure that start/size are aligned to a page boundary.
@@ -445,7 +445,7 @@ static void __init early_mem(char **p)
445 if (**p == '@') 445 if (**p == '@')
446 start = memparse(*p + 1, p); 446 start = memparse(*p + 1, p);
447 447
448 add_memory(start, size); 448 arm_add_memory(start, size);
449} 449}
450__early_param("mem=", early_mem); 450__early_param("mem=", early_mem);
451 451
@@ -587,7 +587,7 @@ static int __init parse_tag_mem32(const struct tag *tag)
587 tag->u.mem.start, tag->u.mem.size / 1024); 587 tag->u.mem.start, tag->u.mem.size / 1024);
588 return -EINVAL; 588 return -EINVAL;
589 } 589 }
590 add_memory(tag->u.mem.start, tag->u.mem.size); 590 arm_add_memory(tag->u.mem.start, tag->u.mem.size);
591 return 0; 591 return 0;
592} 592}
593 593
@@ -807,7 +807,7 @@ static int __init topology_init(void)
807{ 807{
808 int cpu; 808 int cpu;
809 809
810 for_each_cpu(cpu) 810 for_each_possible_cpu(cpu)
811 register_cpu(&per_cpu(cpu_data, cpu).cpu, cpu, NULL); 811 register_cpu(&per_cpu(cpu_data, cpu).cpu, cpu, NULL);
812 812
813 return 0; 813 return 0;
diff --git a/arch/arm/lib/backtrace.S b/arch/arm/lib/backtrace.S
index 3bdc8c6949c5..16153c86c3f8 100644
--- a/arch/arm/lib/backtrace.S
+++ b/arch/arm/lib/backtrace.S
@@ -122,7 +122,7 @@ ENTRY(c_backtrace)
122#define reg r5 122#define reg r5
123#define stack r6 123#define stack r6
124 124
125.Ldumpstm: stmfd sp!, {instr, reg, stack, r7, lr} 125.Ldumpstm: stmfd sp!, {instr, reg, stack, r7, r8, lr}
126 mov stack, r0 126 mov stack, r0
127 mov instr, r1 127 mov instr, r1
128 mov reg, #9 128 mov reg, #9
@@ -145,7 +145,7 @@ ENTRY(c_backtrace)
145 adrne r0, .Lcr 145 adrne r0, .Lcr
146 blne printk 146 blne printk
147 mov r0, stack 147 mov r0, stack
148 LOADREGS(fd, sp!, {instr, reg, stack, r7, pc}) 148 LOADREGS(fd, sp!, {instr, reg, stack, r7, r8, pc})
149 149
150.Lfp: .asciz " r%d = %08X%c" 150.Lfp: .asciz " r%d = %08X%c"
151.Lcr: .asciz "\n" 151.Lcr: .asciz "\n"
diff --git a/arch/arm/lib/div64.S b/arch/arm/lib/div64.S
index ec9a1cd6176f..58eef6607629 100644
--- a/arch/arm/lib/div64.S
+++ b/arch/arm/lib/div64.S
@@ -189,12 +189,12 @@ ENTRY(__do_div64)
189 moveq pc, lr 189 moveq pc, lr
190 190
191 @ Division by 0: 191 @ Division by 0:
192 str lr, [sp, #-4]! 192 str lr, [sp, #-8]!
193 bl __div0 193 bl __div0
194 194
195 @ as wrong as it could be... 195 @ as wrong as it could be...
196 mov yl, #0 196 mov yl, #0
197 mov yh, #0 197 mov yh, #0
198 mov xh, #0 198 mov xh, #0
199 ldr pc, [sp], #4 199 ldr pc, [sp], #8
200 200
diff --git a/arch/arm/mach-aaec2000/aaed2000.c b/arch/arm/mach-aaec2000/aaed2000.c
index dc5fa8e5ebef..83f57da3184c 100644
--- a/arch/arm/mach-aaec2000/aaed2000.c
+++ b/arch/arm/mach-aaec2000/aaed2000.c
@@ -79,7 +79,12 @@ static void __init aaed2000_init(void)
79} 79}
80 80
81static struct map_desc aaed2000_io_desc[] __initdata = { 81static struct map_desc aaed2000_io_desc[] __initdata = {
82 { EXT_GPIO_VBASE, EXT_GPIO_PBASE, EXT_GPIO_LENGTH, MT_DEVICE }, /* Ext GPIO */ 82 {
83 .virtual = EXT_GPIO_VBASE,
84 .pfn = __phys_to_pfn(EXT_GPIO_PBASE),
85 .length = EXT_GPIO_LENGTH,
86 .type = MT_DEVICE
87 },
83}; 88};
84 89
85static void __init aaed2000_map_io(void) 90static void __init aaed2000_map_io(void)
diff --git a/arch/arm/mach-aaec2000/core.c b/arch/arm/mach-aaec2000/core.c
index dce4815cf53c..65be5efd633c 100644
--- a/arch/arm/mach-aaec2000/core.c
+++ b/arch/arm/mach-aaec2000/core.c
@@ -20,7 +20,6 @@
20#include <linux/interrupt.h> 20#include <linux/interrupt.h>
21#include <linux/timex.h> 21#include <linux/timex.h>
22#include <linux/signal.h> 22#include <linux/signal.h>
23#include <linux/amba/bus.h>
24 23
25#include <asm/hardware.h> 24#include <asm/hardware.h>
26#include <asm/irq.h> 25#include <asm/irq.h>
@@ -50,12 +49,12 @@
50static struct map_desc standard_io_desc[] __initdata = { 49static struct map_desc standard_io_desc[] __initdata = {
51 { 50 {
52 .virtual = VIO_APB_BASE, 51 .virtual = VIO_APB_BASE,
53 .physical = __phys_to_pfn(PIO_APB_BASE), 52 .pfn = __phys_to_pfn(PIO_APB_BASE),
54 .length = IO_APB_LENGTH, 53 .length = IO_APB_LENGTH,
55 .type = MT_DEVICE 54 .type = MT_DEVICE
56 }, { 55 }, {
57 .virtual = VIO_AHB_BASE, 56 .virtual = VIO_AHB_BASE,
58 .physical = __phys_to_pfn(PIO_AHB_BASE), 57 .pfn = __phys_to_pfn(PIO_AHB_BASE),
59 .length = IO_AHB_LENGTH, 58 .length = IO_AHB_LENGTH,
60 .type = MT_DEVICE 59 .type = MT_DEVICE
61 } 60 }
diff --git a/arch/arm/mach-aaec2000/core.h b/arch/arm/mach-aaec2000/core.h
index b6029a95f19c..59501b573167 100644
--- a/arch/arm/mach-aaec2000/core.h
+++ b/arch/arm/mach-aaec2000/core.h
@@ -9,6 +9,7 @@
9 * 9 *
10 */ 10 */
11 11
12#include <linux/amba/bus.h>
12#include <linux/amba/clcd.h> 13#include <linux/amba/clcd.h>
13 14
14struct sys_timer; 15struct sys_timer;
diff --git a/arch/arm/mach-at91rm9200/devices.c b/arch/arm/mach-at91rm9200/devices.c
index 1781b8f342c4..bfe47bd6e50c 100644
--- a/arch/arm/mach-at91rm9200/devices.c
+++ b/arch/arm/mach-at91rm9200/devices.c
@@ -194,13 +194,23 @@ void __init at91_add_device_eth(struct at91_eth_data *data) {}
194#if defined(CONFIG_AT91_CF) || defined(CONFIG_AT91_CF_MODULE) 194#if defined(CONFIG_AT91_CF) || defined(CONFIG_AT91_CF_MODULE)
195static struct at91_cf_data cf_data; 195static struct at91_cf_data cf_data;
196 196
197static struct resource at91_cf_resources[] = {
198 [0] = {
199 .start = AT91_CF_BASE,
200 /* ties up CS4, CS5, and CS6 */
201 .end = AT91_CF_BASE + (0x30000000 - 1),
202 .flags = IORESOURCE_MEM | IORESOURCE_MEM_8AND16BIT,
203 },
204};
205
197static struct platform_device at91rm9200_cf_device = { 206static struct platform_device at91rm9200_cf_device = {
198 .name = "at91_cf", 207 .name = "at91_cf",
199 .id = -1, 208 .id = -1,
200 .dev = { 209 .dev = {
201 .platform_data = &cf_data, 210 .platform_data = &cf_data,
202 }, 211 },
203 .num_resources = 0, 212 .resource = at91_cf_resources,
213 .num_resources = ARRAY_SIZE(at91_cf_resources),
204}; 214};
205 215
206void __init at91_add_device_cf(struct at91_cf_data *data) 216void __init at91_add_device_cf(struct at91_cf_data *data)
diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index 9be01b0c3f48..e24566b88a78 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -111,21 +111,21 @@ static void __init ts72xx_map_io(void)
111 } 111 }
112} 112}
113 113
114static unsigned char ts72xx_rtc_readb(unsigned long addr) 114static unsigned char ts72xx_rtc_readbyte(unsigned long addr)
115{ 115{
116 __raw_writeb(addr, TS72XX_RTC_INDEX_VIRT_BASE); 116 __raw_writeb(addr, TS72XX_RTC_INDEX_VIRT_BASE);
117 return __raw_readb(TS72XX_RTC_DATA_VIRT_BASE); 117 return __raw_readb(TS72XX_RTC_DATA_VIRT_BASE);
118} 118}
119 119
120static void ts72xx_rtc_writeb(unsigned char value, unsigned long addr) 120static void ts72xx_rtc_writebyte(unsigned char value, unsigned long addr)
121{ 121{
122 __raw_writeb(addr, TS72XX_RTC_INDEX_VIRT_BASE); 122 __raw_writeb(addr, TS72XX_RTC_INDEX_VIRT_BASE);
123 __raw_writeb(value, TS72XX_RTC_DATA_VIRT_BASE); 123 __raw_writeb(value, TS72XX_RTC_DATA_VIRT_BASE);
124} 124}
125 125
126static struct m48t86_ops ts72xx_rtc_ops = { 126static struct m48t86_ops ts72xx_rtc_ops = {
127 .readb = ts72xx_rtc_readb, 127 .readbyte = ts72xx_rtc_readbyte,
128 .writeb = ts72xx_rtc_writeb, 128 .writebyte = ts72xx_rtc_writebyte,
129}; 129};
130 130
131static struct platform_device ts72xx_rtc_device = { 131static struct platform_device ts72xx_rtc_device = {
diff --git a/arch/arm/mach-imx/generic.c b/arch/arm/mach-imx/generic.c
index 9d8331be2b58..12ea58a3b84f 100644
--- a/arch/arm/mach-imx/generic.c
+++ b/arch/arm/mach-imx/generic.c
@@ -195,56 +195,6 @@ void __init imx_set_mmc_info(struct imxmmc_platform_data *info)
195} 195}
196EXPORT_SYMBOL(imx_set_mmc_info); 196EXPORT_SYMBOL(imx_set_mmc_info);
197 197
198static struct resource imx_uart1_resources[] = {
199 [0] = {
200 .start = 0x00206000,
201 .end = 0x002060FF,
202 .flags = IORESOURCE_MEM,
203 },
204 [1] = {
205 .start = (UART1_MINT_RX),
206 .end = (UART1_MINT_RX),
207 .flags = IORESOURCE_IRQ,
208 },
209 [2] = {
210 .start = (UART1_MINT_TX),
211 .end = (UART1_MINT_TX),
212 .flags = IORESOURCE_IRQ,
213 },
214};
215
216static struct platform_device imx_uart1_device = {
217 .name = "imx-uart",
218 .id = 0,
219 .num_resources = ARRAY_SIZE(imx_uart1_resources),
220 .resource = imx_uart1_resources,
221};
222
223static struct resource imx_uart2_resources[] = {
224 [0] = {
225 .start = 0x00207000,
226 .end = 0x002070FF,
227 .flags = IORESOURCE_MEM,
228 },
229 [1] = {
230 .start = (UART2_MINT_RX),
231 .end = (UART2_MINT_RX),
232 .flags = IORESOURCE_IRQ,
233 },
234 [2] = {
235 .start = (UART2_MINT_TX),
236 .end = (UART2_MINT_TX),
237 .flags = IORESOURCE_IRQ,
238 },
239};
240
241static struct platform_device imx_uart2_device = {
242 .name = "imx-uart",
243 .id = 1,
244 .num_resources = ARRAY_SIZE(imx_uart2_resources),
245 .resource = imx_uart2_resources,
246};
247
248static struct imxfb_mach_info imx_fb_info; 198static struct imxfb_mach_info imx_fb_info;
249 199
250void __init set_imx_fb_info(struct imxfb_mach_info *hard_imx_fb_info) 200void __init set_imx_fb_info(struct imxfb_mach_info *hard_imx_fb_info)
@@ -283,8 +233,6 @@ static struct platform_device imxfb_device = {
283static struct platform_device *devices[] __initdata = { 233static struct platform_device *devices[] __initdata = {
284 &imx_mmc_device, 234 &imx_mmc_device,
285 &imxfb_device, 235 &imxfb_device,
286 &imx_uart1_device,
287 &imx_uart2_device,
288}; 236};
289 237
290static struct map_desc imx_io_desc[] __initdata = { 238static struct map_desc imx_io_desc[] __initdata = {
diff --git a/arch/arm/mach-imx/mx1ads.c b/arch/arm/mach-imx/mx1ads.c
index e34d0df90aed..da893c80d471 100644
--- a/arch/arm/mach-imx/mx1ads.c
+++ b/arch/arm/mach-imx/mx1ads.c
@@ -26,6 +26,7 @@
26 26
27#include <asm/mach/arch.h> 27#include <asm/mach/arch.h>
28#include <asm/arch/mmc.h> 28#include <asm/arch/mmc.h>
29#include <asm/arch/imx-uart.h>
29#include <linux/interrupt.h> 30#include <linux/interrupt.h>
30#include "generic.h" 31#include "generic.h"
31 32
@@ -48,8 +49,70 @@ static struct platform_device cs89x0_device = {
48 .resource = cs89x0_resources, 49 .resource = cs89x0_resources,
49}; 50};
50 51
52static struct imxuart_platform_data uart_pdata = {
53 .flags = IMXUART_HAVE_RTSCTS,
54};
55
56static struct resource imx_uart1_resources[] = {
57 [0] = {
58 .start = 0x00206000,
59 .end = 0x002060FF,
60 .flags = IORESOURCE_MEM,
61 },
62 [1] = {
63 .start = (UART1_MINT_RX),
64 .end = (UART1_MINT_RX),
65 .flags = IORESOURCE_IRQ,
66 },
67 [2] = {
68 .start = (UART1_MINT_TX),
69 .end = (UART1_MINT_TX),
70 .flags = IORESOURCE_IRQ,
71 },
72};
73
74static struct platform_device imx_uart1_device = {
75 .name = "imx-uart",
76 .id = 0,
77 .num_resources = ARRAY_SIZE(imx_uart1_resources),
78 .resource = imx_uart1_resources,
79 .dev = {
80 .platform_data = &uart_pdata,
81 }
82};
83
84static struct resource imx_uart2_resources[] = {
85 [0] = {
86 .start = 0x00207000,
87 .end = 0x002070FF,
88 .flags = IORESOURCE_MEM,
89 },
90 [1] = {
91 .start = (UART2_MINT_RX),
92 .end = (UART2_MINT_RX),
93 .flags = IORESOURCE_IRQ,
94 },
95 [2] = {
96 .start = (UART2_MINT_TX),
97 .end = (UART2_MINT_TX),
98 .flags = IORESOURCE_IRQ,
99 },
100};
101
102static struct platform_device imx_uart2_device = {
103 .name = "imx-uart",
104 .id = 1,
105 .num_resources = ARRAY_SIZE(imx_uart2_resources),
106 .resource = imx_uart2_resources,
107 .dev = {
108 .platform_data = &uart_pdata,
109 }
110};
111
51static struct platform_device *devices[] __initdata = { 112static struct platform_device *devices[] __initdata = {
52 &cs89x0_device, 113 &cs89x0_device,
114 &imx_uart1_device,
115 &imx_uart2_device,
53}; 116};
54 117
55#ifdef CONFIG_MMC_IMX 118#ifdef CONFIG_MMC_IMX
@@ -75,6 +138,17 @@ mx1ads_init(void)
75 imx_gpio_mode(GPIO_PORTB | GPIO_GIUS | GPIO_IN | 20); 138 imx_gpio_mode(GPIO_PORTB | GPIO_GIUS | GPIO_IN | 20);
76 imx_set_mmc_info(&mx1ads_mmc_info); 139 imx_set_mmc_info(&mx1ads_mmc_info);
77#endif 140#endif
141
142 imx_gpio_mode(PC9_PF_UART1_CTS);
143 imx_gpio_mode(PC10_PF_UART1_RTS);
144 imx_gpio_mode(PC11_PF_UART1_TXD);
145 imx_gpio_mode(PC12_PF_UART1_RXD);
146
147 imx_gpio_mode(PB28_PF_UART2_CTS);
148 imx_gpio_mode(PB29_PF_UART2_RTS);
149 imx_gpio_mode(PB30_PF_UART2_TXD);
150 imx_gpio_mode(PB31_PF_UART2_RXD);
151
78 platform_add_devices(devices, ARRAY_SIZE(devices)); 152 platform_add_devices(devices, ARRAY_SIZE(devices));
79} 153}
80 154
@@ -87,7 +161,7 @@ mx1ads_map_io(void)
87MACHINE_START(MX1ADS, "Motorola MX1ADS") 161MACHINE_START(MX1ADS, "Motorola MX1ADS")
88 /* Maintainer: Sascha Hauer, Pengutronix */ 162 /* Maintainer: Sascha Hauer, Pengutronix */
89 .phys_io = 0x00200000, 163 .phys_io = 0x00200000,
90 .io_pg_offst = ((0xe0200000) >> 18) & 0xfffc, 164 .io_pg_offst = ((0xe0000000) >> 18) & 0xfffc,
91 .boot_params = 0x08000100, 165 .boot_params = 0x08000100,
92 .map_io = mx1ads_map_io, 166 .map_io = mx1ads_map_io,
93 .init_irq = imx_init_irq, 167 .init_irq = imx_init_irq,
diff --git a/arch/arm/mach-ixp23xx/core.c b/arch/arm/mach-ixp23xx/core.c
index 092ee12ced42..affd1d5d7440 100644
--- a/arch/arm/mach-ixp23xx/core.c
+++ b/arch/arm/mach-ixp23xx/core.c
@@ -178,8 +178,12 @@ static int ixp23xx_irq_set_type(unsigned int irq, unsigned int type)
178 178
179static void ixp23xx_irq_mask(unsigned int irq) 179static void ixp23xx_irq_mask(unsigned int irq)
180{ 180{
181 volatile unsigned long *intr_reg = IXP23XX_INTR_EN1 + (irq / 32); 181 volatile unsigned long *intr_reg;
182 182
183 if (irq >= 56)
184 irq += 8;
185
186 intr_reg = IXP23XX_INTR_EN1 + (irq / 32);
183 *intr_reg &= ~(1 << (irq % 32)); 187 *intr_reg &= ~(1 << (irq % 32));
184} 188}
185 189
@@ -199,17 +203,25 @@ static void ixp23xx_irq_ack(unsigned int irq)
199 */ 203 */
200static void ixp23xx_irq_level_unmask(unsigned int irq) 204static void ixp23xx_irq_level_unmask(unsigned int irq)
201{ 205{
202 volatile unsigned long *intr_reg = IXP23XX_INTR_EN1 + (irq / 32); 206 volatile unsigned long *intr_reg;
203 207
204 ixp23xx_irq_ack(irq); 208 ixp23xx_irq_ack(irq);
205 209
210 if (irq >= 56)
211 irq += 8;
212
213 intr_reg = IXP23XX_INTR_EN1 + (irq / 32);
206 *intr_reg |= (1 << (irq % 32)); 214 *intr_reg |= (1 << (irq % 32));
207} 215}
208 216
209static void ixp23xx_irq_edge_unmask(unsigned int irq) 217static void ixp23xx_irq_edge_unmask(unsigned int irq)
210{ 218{
211 volatile unsigned long *intr_reg = IXP23XX_INTR_EN1 + (irq / 32); 219 volatile unsigned long *intr_reg;
220
221 if (irq >= 56)
222 irq += 8;
212 223
224 intr_reg = IXP23XX_INTR_EN1 + (irq / 32);
213 *intr_reg |= (1 << (irq % 32)); 225 *intr_reg |= (1 << (irq % 32));
214} 226}
215 227
diff --git a/arch/arm/mach-ixp4xx/Kconfig b/arch/arm/mach-ixp4xx/Kconfig
index 5bf50a2a737d..3b23f43cb160 100644
--- a/arch/arm/mach-ixp4xx/Kconfig
+++ b/arch/arm/mach-ixp4xx/Kconfig
@@ -11,6 +11,7 @@ comment "IXP4xx Platforms"
11config MACH_NSLU2 11config MACH_NSLU2
12 bool 12 bool
13 prompt "Linksys NSLU2" 13 prompt "Linksys NSLU2"
14 select PCI
14 help 15 help
15 Say 'Y' here if you want your kernel to support Linksys's 16 Say 'Y' here if you want your kernel to support Linksys's
16 NSLU2 NAS device. For more information on this platform, 17 NSLU2 NAS device. For more information on this platform,
@@ -18,6 +19,7 @@ config MACH_NSLU2
18 19
19config ARCH_AVILA 20config ARCH_AVILA
20 bool "Avila" 21 bool "Avila"
22 select PCI
21 help 23 help
22 Say 'Y' here if you want your kernel to support the Gateworks 24 Say 'Y' here if you want your kernel to support the Gateworks
23 Avila Network Platform. For more information on this platform, 25 Avila Network Platform. For more information on this platform,
@@ -25,6 +27,7 @@ config ARCH_AVILA
25 27
26config ARCH_ADI_COYOTE 28config ARCH_ADI_COYOTE
27 bool "Coyote" 29 bool "Coyote"
30 select PCI
28 help 31 help
29 Say 'Y' here if you want your kernel to support the ADI 32 Say 'Y' here if you want your kernel to support the ADI
30 Engineering Coyote Gateway Reference Platform. For more 33 Engineering Coyote Gateway Reference Platform. For more
@@ -32,6 +35,7 @@ config ARCH_ADI_COYOTE
32 35
33config ARCH_IXDP425 36config ARCH_IXDP425
34 bool "IXDP425" 37 bool "IXDP425"
38 select PCI
35 help 39 help
36 Say 'Y' here if you want your kernel to support Intel's 40 Say 'Y' here if you want your kernel to support Intel's
37 IXDP425 Development Platform (Also known as Richfield). 41 IXDP425 Development Platform (Also known as Richfield).
@@ -39,6 +43,7 @@ config ARCH_IXDP425
39 43
40config MACH_IXDPG425 44config MACH_IXDPG425
41 bool "IXDPG425" 45 bool "IXDPG425"
46 select PCI
42 help 47 help
43 Say 'Y' here if you want your kernel to support Intel's 48 Say 'Y' here if you want your kernel to support Intel's
44 IXDPG425 Development Platform (Also known as Montajade). 49 IXDPG425 Development Platform (Also known as Montajade).
@@ -46,6 +51,7 @@ config MACH_IXDPG425
46 51
47config MACH_IXDP465 52config MACH_IXDP465
48 bool "IXDP465" 53 bool "IXDP465"
54 select PCI
49 help 55 help
50 Say 'Y' here if you want your kernel to support Intel's 56 Say 'Y' here if you want your kernel to support Intel's
51 IXDP465 Development Platform (Also known as BMP). 57 IXDP465 Development Platform (Also known as BMP).
@@ -72,6 +78,7 @@ config ARCH_PRPMC1100
72config MACH_NAS100D 78config MACH_NAS100D
73 bool 79 bool
74 prompt "NAS100D" 80 prompt "NAS100D"
81 select PCI
75 help 82 help
76 Say 'Y' here if you want your kernel to support Iomega's 83 Say 'Y' here if you want your kernel to support Iomega's
77 NAS 100d device. For more information on this platform, 84 NAS 100d device. For more information on this platform,
@@ -96,6 +103,7 @@ config CPU_IXP46X
96config MACH_GTWX5715 103config MACH_GTWX5715
97 bool "Gemtek WX5715 (Linksys WRV54G)" 104 bool "Gemtek WX5715 (Linksys WRV54G)"
98 depends on ARCH_IXP4XX 105 depends on ARCH_IXP4XX
106 select PCI
99 help 107 help
100 This board is currently inside the Linksys WRV54G Gateways. 108 This board is currently inside the Linksys WRV54G Gateways.
101 109
@@ -110,11 +118,16 @@ config MACH_GTWX5715
110 "High Speed" UART is n/c (as far as I can tell) 118 "High Speed" UART is n/c (as far as I can tell)
111 20 Pin ARM/Xscale JTAG interface on J2 119 20 Pin ARM/Xscale JTAG interface on J2
112 120
113
114comment "IXP4xx Options" 121comment "IXP4xx Options"
115 122
123config DMABOUNCE
124 bool
125 default y
126 depends on PCI
127
116config IXP4XX_INDIRECT_PCI 128config IXP4XX_INDIRECT_PCI
117 bool "Use indirect PCI memory access" 129 bool "Use indirect PCI memory access"
130 depends on PCI
118 help 131 help
119 IXP4xx provides two methods of accessing PCI memory space: 132 IXP4xx provides two methods of accessing PCI memory space:
120 133
@@ -128,7 +141,7 @@ config IXP4XX_INDIRECT_PCI
128 2) If > 64MB of memory space is required, the IXP4xx can be 141 2) If > 64MB of memory space is required, the IXP4xx can be
129 configured to use indirect registers to access PCI This allows 142 configured to use indirect registers to access PCI This allows
130 for up to 128MB (0x48000000 to 0x4fffffff) of memory on the bus. 143 for up to 128MB (0x48000000 to 0x4fffffff) of memory on the bus.
131 The disadvantadge of this is that every PCI access requires 144 The disadvantage of this is that every PCI access requires
132 three local register accesses plus a spinlock, but in some 145 three local register accesses plus a spinlock, but in some
133 cases the performance hit is acceptable. In addition, you cannot 146 cases the performance hit is acceptable. In addition, you cannot
134 mmap() PCI devices in this case due to the indirect nature 147 mmap() PCI devices in this case due to the indirect nature
diff --git a/arch/arm/mach-ixp4xx/Makefile b/arch/arm/mach-ixp4xx/Makefile
index 0471044fa179..5a4aaa0e0a09 100644
--- a/arch/arm/mach-ixp4xx/Makefile
+++ b/arch/arm/mach-ixp4xx/Makefile
@@ -2,8 +2,9 @@
2# Makefile for the linux kernel. 2# Makefile for the linux kernel.
3# 3#
4 4
5obj-y += common.o common-pci.o 5obj-y += common.o
6 6
7obj-$(CONFIG_PCI) += common-pci.o
7obj-$(CONFIG_ARCH_IXDP4XX) += ixdp425-pci.o ixdp425-setup.o 8obj-$(CONFIG_ARCH_IXDP4XX) += ixdp425-pci.o ixdp425-setup.o
8obj-$(CONFIG_MACH_IXDPG425) += ixdpg425-pci.o coyote-setup.o 9obj-$(CONFIG_MACH_IXDPG425) += ixdpg425-pci.o coyote-setup.o
9obj-$(CONFIG_ARCH_ADI_COYOTE) += coyote-pci.o coyote-setup.o 10obj-$(CONFIG_ARCH_ADI_COYOTE) += coyote-pci.o coyote-setup.o
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c
index a0888e160e3b..00b761ff0f9c 100644
--- a/arch/arm/mach-ixp4xx/common.c
+++ b/arch/arm/mach-ixp4xx/common.c
@@ -91,7 +91,7 @@ static void ixp4xx_config_irq(unsigned irq, enum ixp4xx_irq_type type);
91/* 91/*
92 * IRQ -> GPIO mapping table 92 * IRQ -> GPIO mapping table
93 */ 93 */
94static char irq2gpio[32] = { 94static signed char irq2gpio[32] = {
95 -1, -1, -1, -1, -1, -1, 0, 1, 95 -1, -1, -1, -1, -1, -1, 0, 1,
96 -1, -1, -1, -1, -1, -1, -1, -1, 96 -1, -1, -1, -1, -1, -1, -1, -1,
97 -1, -1, -1, 2, 3, 4, 5, 6, 97 -1, -1, -1, 2, 3, 4, 5, 6,
diff --git a/arch/arm/mach-pxa/corgi_ssp.c b/arch/arm/mach-pxa/corgi_ssp.c
index b371d723635f..8a25a1c8019f 100644
--- a/arch/arm/mach-pxa/corgi_ssp.c
+++ b/arch/arm/mach-pxa/corgi_ssp.c
@@ -196,12 +196,9 @@ static int __init corgi_ssp_probe(struct platform_device *dev)
196 int ret; 196 int ret;
197 197
198 /* Chip Select - Disable All */ 198 /* Chip Select - Disable All */
199 GPDR(ssp_machinfo->cs_lcdcon) |= GPIO_bit(ssp_machinfo->cs_lcdcon); /* output */ 199 pxa_gpio_mode(ssp_machinfo->cs_lcdcon | GPIO_OUT | GPIO_DFLT_HIGH);
200 GPSR(ssp_machinfo->cs_lcdcon) = GPIO_bit(ssp_machinfo->cs_lcdcon); /* High - Disable LCD Control/Timing Gen */ 200 pxa_gpio_mode(ssp_machinfo->cs_max1111 | GPIO_OUT | GPIO_DFLT_HIGH);
201 GPDR(ssp_machinfo->cs_max1111) |= GPIO_bit(ssp_machinfo->cs_max1111); /* output */ 201 pxa_gpio_mode(ssp_machinfo->cs_ads7846 | GPIO_OUT | GPIO_DFLT_HIGH);
202 GPSR(ssp_machinfo->cs_max1111) = GPIO_bit(ssp_machinfo->cs_max1111); /* High - Disable MAX1111*/
203 GPDR(ssp_machinfo->cs_ads7846) |= GPIO_bit(ssp_machinfo->cs_ads7846); /* output */
204 GPSR(ssp_machinfo->cs_ads7846) = GPIO_bit(ssp_machinfo->cs_ads7846); /* High - Disable ADS7846*/
205 202
206 ret = ssp_init(&corgi_ssp_dev, ssp_machinfo->port, 0); 203 ret = ssp_init(&corgi_ssp_dev, ssp_machinfo->port, 0);
207 204
diff --git a/arch/arm/mach-pxa/dma.c b/arch/arm/mach-pxa/dma.c
index 458112b21e25..7d8c85486c66 100644
--- a/arch/arm/mach-pxa/dma.c
+++ b/arch/arm/mach-pxa/dma.c
@@ -45,23 +45,16 @@ int pxa_request_dma (char *name, pxa_dma_prio prio,
45 45
46 local_irq_save(flags); 46 local_irq_save(flags);
47 47
48 /* try grabbing a DMA channel with the requested priority */ 48 do {
49 for (i = prio; i < prio + PXA_DMA_NBCH(prio); i++) { 49 /* try grabbing a DMA channel with the requested priority */
50 if (!dma_channels[i].name) { 50 pxa_for_each_dma_prio (i, prio) {
51 found = 1;
52 break;
53 }
54 }
55
56 if (!found) {
57 /* requested prio group is full, try hier priorities */
58 for (i = prio-1; i >= 0; i--) {
59 if (!dma_channels[i].name) { 51 if (!dma_channels[i].name) {
60 found = 1; 52 found = 1;
61 break; 53 break;
62 } 54 }
63 } 55 }
64 } 56 /* if requested prio group is full, try a hier priority */
57 } while (!found && prio--);
65 58
66 if (found) { 59 if (found) {
67 DCSR(i) = DCSR_STARTINTR|DCSR_ENDINTR|DCSR_BUSERR; 60 DCSR(i) = DCSR_STARTINTR|DCSR_ENDINTR|DCSR_BUSERR;
diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c
index 98356f810007..b307f11951df 100644
--- a/arch/arm/mach-pxa/mainstone.c
+++ b/arch/arm/mach-pxa/mainstone.c
@@ -95,7 +95,10 @@ static void __init mainstone_init_irq(void)
95 for(irq = MAINSTONE_IRQ(0); irq <= MAINSTONE_IRQ(15); irq++) { 95 for(irq = MAINSTONE_IRQ(0); irq <= MAINSTONE_IRQ(15); irq++) {
96 set_irq_chip(irq, &mainstone_irq_chip); 96 set_irq_chip(irq, &mainstone_irq_chip);
97 set_irq_handler(irq, do_level_IRQ); 97 set_irq_handler(irq, do_level_IRQ);
98 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); 98 if (irq == MAINSTONE_IRQ(10) || irq == MAINSTONE_IRQ(14))
99 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE | IRQF_NOAUTOEN);
100 else
101 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
99 } 102 }
100 set_irq_flags(MAINSTONE_IRQ(8), 0); 103 set_irq_flags(MAINSTONE_IRQ(8), 0);
101 set_irq_flags(MAINSTONE_IRQ(12), 0); 104 set_irq_flags(MAINSTONE_IRQ(12), 0);
@@ -490,6 +493,7 @@ static void __init mainstone_map_io(void)
490MACHINE_START(MAINSTONE, "Intel HCDDBBVA0 Development Platform (aka Mainstone)") 493MACHINE_START(MAINSTONE, "Intel HCDDBBVA0 Development Platform (aka Mainstone)")
491 /* Maintainer: MontaVista Software Inc. */ 494 /* Maintainer: MontaVista Software Inc. */
492 .phys_io = 0x40000000, 495 .phys_io = 0x40000000,
496 .boot_params = 0xa0000100, /* BLOB boot parameter setting */
493 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, 497 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
494 .map_io = mainstone_map_io, 498 .map_io = mainstone_map_io,
495 .init_irq = mainstone_init_irq, 499 .init_irq = mainstone_init_irq,
diff --git a/arch/arm/mach-realview/realview_eb.c b/arch/arm/mach-realview/realview_eb.c
index d4a586e38d5b..693fb1e396e0 100644
--- a/arch/arm/mach-realview/realview_eb.c
+++ b/arch/arm/mach-realview/realview_eb.c
@@ -137,8 +137,11 @@ static struct amba_device *amba_devs[] __initdata = {
137static void __init gic_init_irq(void) 137static void __init gic_init_irq(void)
138{ 138{
139#ifdef CONFIG_REALVIEW_MPCORE 139#ifdef CONFIG_REALVIEW_MPCORE
140 unsigned int pldctrl;
140 writel(0x0000a05f, __io_address(REALVIEW_SYS_LOCK)); 141 writel(0x0000a05f, __io_address(REALVIEW_SYS_LOCK));
141 writel(0x008003c0, __io_address(REALVIEW_SYS_BASE) + 0xd8); 142 pldctrl = readl(__io_address(REALVIEW_SYS_BASE) + 0xd8);
143 pldctrl |= 0x00800000; /* New irq mode */
144 writel(pldctrl, __io_address(REALVIEW_SYS_BASE) + 0xd8);
142 writel(0x00000000, __io_address(REALVIEW_SYS_LOCK)); 145 writel(0x00000000, __io_address(REALVIEW_SYS_LOCK));
143#endif 146#endif
144 gic_dist_init(__io_address(REALVIEW_GIC_DIST_BASE)); 147 gic_dist_init(__io_address(REALVIEW_GIC_DIST_BASE));
diff --git a/arch/arm/mach-s3c2410/Kconfig b/arch/arm/mach-s3c2410/Kconfig
index ce7d81000695..970f98dadffc 100644
--- a/arch/arm/mach-s3c2410/Kconfig
+++ b/arch/arm/mach-s3c2410/Kconfig
@@ -170,7 +170,7 @@ config S3C2410_PM_DEBUG
170 depends on ARCH_S3C2410 && PM 170 depends on ARCH_S3C2410 && PM
171 help 171 help
172 Say Y here if you want verbose debugging from the PM Suspend and 172 Say Y here if you want verbose debugging from the PM Suspend and
173 Resume code. See `Documentation/arm/Samsing-S3C24XX/Suspend.txt` 173 Resume code. See <file:Documentation/arm/Samsung-S3C24XX/Suspend.txt>
174 for more information. 174 for more information.
175 175
176config S3C2410_PM_CHECK 176config S3C2410_PM_CHECK
diff --git a/arch/arm/mach-s3c2410/common-smdk.c b/arch/arm/mach-s3c2410/common-smdk.c
index f372fbda124e..c940890f621f 100644
--- a/arch/arm/mach-s3c2410/common-smdk.c
+++ b/arch/arm/mach-s3c2410/common-smdk.c
@@ -50,7 +50,7 @@ static struct mtd_partition smdk_default_nand_part[] = {
50 .offset = 0, 50 .offset = 0,
51 }, 51 },
52 [1] = { 52 [1] = {
53 .name = "S3C2410 flash parition 1", 53 .name = "S3C2410 flash partition 1",
54 .offset = 0, 54 .offset = 0,
55 .size = SZ_2M, 55 .size = SZ_2M,
56 }, 56 },
diff --git a/arch/arm/mach-s3c2410/s3c2440-clock.c b/arch/arm/mach-s3c2410/s3c2440-clock.c
index 57a15974d4b5..d7a30ed6c327 100644
--- a/arch/arm/mach-s3c2410/s3c2440-clock.c
+++ b/arch/arm/mach-s3c2410/s3c2440-clock.c
@@ -139,7 +139,7 @@ static int s3c2440_clk_add(struct sys_device *sysdev)
139 139
140 clkdivn = __raw_readl(S3C2410_CLKDIVN); 140 clkdivn = __raw_readl(S3C2410_CLKDIVN);
141 clkdivn |= S3C2440_CLKDIVN_UCLK; 141 clkdivn |= S3C2440_CLKDIVN_UCLK;
142 __raw_writel(camdivn, S3C2410_CLKDIVN); 142 __raw_writel(clkdivn, S3C2410_CLKDIVN);
143 143
144 mutex_unlock(&clocks_mutex); 144 mutex_unlock(&clocks_mutex);
145 } 145 }
diff --git a/arch/arm/mach-s3c2410/sleep.S b/arch/arm/mach-s3c2410/sleep.S
index 832fb86a03b4..73de2eaca22a 100644
--- a/arch/arm/mach-s3c2410/sleep.S
+++ b/arch/arm/mach-s3c2410/sleep.S
@@ -59,8 +59,7 @@ ENTRY(s3c2410_cpu_suspend)
59 mrc p15, 0, r5, c13, c0, 0 @ PID 59 mrc p15, 0, r5, c13, c0, 0 @ PID
60 mrc p15, 0, r6, c3, c0, 0 @ Domain ID 60 mrc p15, 0, r6, c3, c0, 0 @ Domain ID
61 mrc p15, 0, r7, c2, c0, 0 @ translation table base address 61 mrc p15, 0, r7, c2, c0, 0 @ translation table base address
62 mrc p15, 0, r8, c2, c0, 0 @ auxiliary control register 62 mrc p15, 0, r8, c1, c0, 0 @ control register
63 mrc p15, 0, r9, c1, c0, 0 @ control register
64 63
65 stmia r0, { r4 - r13 } 64 stmia r0, { r4 - r13 }
66 65
@@ -165,7 +164,6 @@ ENTRY(s3c2410_cpu_resume)
165 mcr p15, 0, r5, c13, c0, 0 @ PID 164 mcr p15, 0, r5, c13, c0, 0 @ PID
166 mcr p15, 0, r6, c3, c0, 0 @ Domain ID 165 mcr p15, 0, r6, c3, c0, 0 @ Domain ID
167 mcr p15, 0, r7, c2, c0, 0 @ translation table base 166 mcr p15, 0, r7, c2, c0, 0 @ translation table base
168 mcr p15, 0, r8, c1, c1, 0 @ auxilliary control
169 167
170#ifdef CONFIG_DEBUG_RESUME 168#ifdef CONFIG_DEBUG_RESUME
171 mov r3, #'R' 169 mov r3, #'R'
@@ -173,7 +171,7 @@ ENTRY(s3c2410_cpu_resume)
173#endif 171#endif
174 172
175 ldr r2, =resume_with_mmu 173 ldr r2, =resume_with_mmu
176 mcr p15, 0, r9, c1, c0, 0 @ turn on MMU, etc 174 mcr p15, 0, r8, c1, c0, 0 @ turn on MMU, etc
177 nop @ second-to-last before mmu 175 nop @ second-to-last before mmu
178 mov pc, r2 @ go back to virtual address 176 mov pc, r2 @ go back to virtual address
179 177
diff --git a/arch/arm/mach-sa1100/irq.c b/arch/arm/mach-sa1100/irq.c
index c131a5201b5b..b3a56024182e 100644
--- a/arch/arm/mach-sa1100/irq.c
+++ b/arch/arm/mach-sa1100/irq.c
@@ -199,10 +199,26 @@ static void sa1100_unmask_irq(unsigned int irq)
199 ICMR |= (1 << irq); 199 ICMR |= (1 << irq);
200} 200}
201 201
202/*
203 * Apart form GPIOs, only the RTC alarm can be a wakeup event.
204 */
205static int sa1100_set_wake(unsigned int irq, unsigned int on)
206{
207 if (irq == IRQ_RTCAlrm) {
208 if (on)
209 PWER |= PWER_RTC;
210 else
211 PWER &= ~PWER_RTC;
212 return 0;
213 }
214 return -EINVAL;
215}
216
202static struct irqchip sa1100_normal_chip = { 217static struct irqchip sa1100_normal_chip = {
203 .ack = sa1100_mask_irq, 218 .ack = sa1100_mask_irq,
204 .mask = sa1100_mask_irq, 219 .mask = sa1100_mask_irq,
205 .unmask = sa1100_unmask_irq, 220 .unmask = sa1100_unmask_irq,
221 .set_wake = sa1100_set_wake,
206}; 222};
207 223
208static struct resource irq_resource = { 224static struct resource irq_resource = {
diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
index 25e0ca3e598c..c1f7180c7bed 100644
--- a/arch/arm/mm/ioremap.c
+++ b/arch/arm/mm/ioremap.c
@@ -141,7 +141,7 @@ __ioremap_pfn(unsigned long pfn, unsigned long offset, size_t size,
141 return NULL; 141 return NULL;
142 addr = (unsigned long)area->addr; 142 addr = (unsigned long)area->addr;
143 if (remap_area_pages(addr, pfn, size, flags)) { 143 if (remap_area_pages(addr, pfn, size, flags)) {
144 vfree((void *)addr); 144 vunmap((void *)addr);
145 return NULL; 145 return NULL;
146 } 146 }
147 return (void __iomem *) (offset + (char *)addr); 147 return (void __iomem *) (offset + (char *)addr);
@@ -173,7 +173,7 @@ EXPORT_SYMBOL(__ioremap);
173 173
174void __iounmap(void __iomem *addr) 174void __iounmap(void __iomem *addr)
175{ 175{
176 vfree((void *) (PAGE_MASK & (unsigned long) addr)); 176 vunmap((void *)(PAGE_MASK & (unsigned long)addr));
177} 177}
178EXPORT_SYMBOL(__iounmap); 178EXPORT_SYMBOL(__iounmap);
179 179
diff --git a/arch/arm/mm/mm-armv.c b/arch/arm/mm/mm-armv.c
index f14b2d0f3690..95273de4f772 100644
--- a/arch/arm/mm/mm-armv.c
+++ b/arch/arm/mm/mm-armv.c
@@ -376,7 +376,7 @@ void __init build_mem_type_table(void)
376 ecc_mask = 0; 376 ecc_mask = 0;
377 } 377 }
378 378
379 if (cpu_arch <= CPU_ARCH_ARMv5TEJ) { 379 if (cpu_arch <= CPU_ARCH_ARMv5TEJ && !cpu_is_xscale()) {
380 for (i = 0; i < ARRAY_SIZE(mem_types); i++) { 380 for (i = 0; i < ARRAY_SIZE(mem_types); i++) {
381 if (mem_types[i].prot_l1) 381 if (mem_types[i].prot_l1)
382 mem_types[i].prot_l1 |= PMD_BIT4; 382 mem_types[i].prot_l1 |= PMD_BIT4;
@@ -631,7 +631,7 @@ void setup_mm_for_reboot(char mode)
631 pgd = init_mm.pgd; 631 pgd = init_mm.pgd;
632 632
633 base_pmdval = PMD_SECT_AP_WRITE | PMD_SECT_AP_READ | PMD_TYPE_SECT; 633 base_pmdval = PMD_SECT_AP_WRITE | PMD_SECT_AP_READ | PMD_TYPE_SECT;
634 if (cpu_architecture() <= CPU_ARCH_ARMv5TEJ) 634 if (cpu_architecture() <= CPU_ARCH_ARMv5TEJ && !cpu_is_xscale())
635 base_pmdval |= PMD_BIT4; 635 base_pmdval |= PMD_BIT4;
636 636
637 for (i = 0; i < FIRST_USER_PGD_NR + USER_PTRS_PER_PGD; i++, pgd++) { 637 for (i = 0; i < FIRST_USER_PGD_NR + USER_PTRS_PER_PGD; i++, pgd++) {
diff --git a/arch/arm/mm/proc-xsc3.S b/arch/arm/mm/proc-xsc3.S
index 80873b36c3f7..8d32e21fe151 100644
--- a/arch/arm/mm/proc-xsc3.S
+++ b/arch/arm/mm/proc-xsc3.S
@@ -427,12 +427,13 @@ __xsc3_setup:
427#endif 427#endif
428 mcr p15, 0, r0, c1, c0, 1 @ set auxiliary control reg 428 mcr p15, 0, r0, c1, c0, 1 @ set auxiliary control reg
429 mrc p15, 0, r0, c1, c0, 0 @ get control register 429 mrc p15, 0, r0, c1, c0, 0 @ get control register
430 bic r0, r0, #0x0200 @ .... ..R. .... ....
431 bic r0, r0, #0x0002 @ .... .... .... ..A. 430 bic r0, r0, #0x0002 @ .... .... .... ..A.
432 orr r0, r0, #0x0005 @ .... .... .... .C.M 431 orr r0, r0, #0x0005 @ .... .... .... .C.M
433#if BTB_ENABLE 432#if BTB_ENABLE
433 bic r0, r0, #0x0200 @ .... ..R. .... ....
434 orr r0, r0, #0x3900 @ ..VI Z..S .... .... 434 orr r0, r0, #0x3900 @ ..VI Z..S .... ....
435#else 435#else
436 bic r0, r0, #0x0a00 @ .... Z.R. .... ....
436 orr r0, r0, #0x3100 @ ..VI ...S .... .... 437 orr r0, r0, #0x3100 @ ..VI ...S .... ....
437#endif 438#endif
438#if L2_CACHE_ENABLE 439#if L2_CACHE_ENABLE
diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types
index 8ab5300dcb94..6d7de9c0412f 100644
--- a/arch/arm/tools/mach-types
+++ b/arch/arm/tools/mach-types
@@ -12,7 +12,7 @@
12# 12#
13# http://www.arm.linux.org.uk/developer/machines/?action=new 13# http://www.arm.linux.org.uk/developer/machines/?action=new
14# 14#
15# Last update: Mon Feb 20 10:18:02 2006 15# Last update: Mon May 8 20:11:05 2006
16# 16#
17# machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number 17# machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number
18# 18#
@@ -566,8 +566,8 @@ switchgrass MACH_SWITCHGRASS SWITCHGRASS 549
566ens_cmu MACH_ENS_CMU ENS_CMU 550 566ens_cmu MACH_ENS_CMU ENS_CMU 550
567mm6_sdb MACH_MM6_SDB MM6_SDB 551 567mm6_sdb MACH_MM6_SDB MM6_SDB 551
568saturn MACH_SATURN SATURN 552 568saturn MACH_SATURN SATURN 552
569argonplusevb MACH_ARGONPLUSEVB ARGONPLUSEVB 553 569i30030evb MACH_ARGONPLUSEVB ARGONPLUSEVB 553
570scma11evb MACH_SCMA11EVB SCMA11EVB 554 570mxc27530evb MACH_SCMA11EVB SCMA11EVB 554
571smdk2800 MACH_SMDK2800 SMDK2800 555 571smdk2800 MACH_SMDK2800 SMDK2800 555
572mtwilson MACH_MTWILSON MTWILSON 556 572mtwilson MACH_MTWILSON MTWILSON 556
573ziti MACH_ZITI ZITI 557 573ziti MACH_ZITI ZITI 557
@@ -647,7 +647,7 @@ sendt MACH_SENDT SENDT 630
647mx2jazz MACH_MX2JAZZ MX2JAZZ 631 647mx2jazz MACH_MX2JAZZ MX2JAZZ 631
648multiio MACH_MULTIIO MULTIIO 632 648multiio MACH_MULTIIO MULTIIO 632
649hrdisplay MACH_HRDISPLAY HRDISPLAY 633 649hrdisplay MACH_HRDISPLAY HRDISPLAY 633
650scma11bb MACH_SCMA11BB SCMA11BB 634 650mxc27530ads MACH_SCMA11BB SCMA11BB 634
651trizeps3 MACH_TRIZEPS3 TRIZEPS3 635 651trizeps3 MACH_TRIZEPS3 TRIZEPS3 635
652zefeerdza MACH_ZEFEERDZA ZEFEERDZA 636 652zefeerdza MACH_ZEFEERDZA ZEFEERDZA 636
653zefeerdzb MACH_ZEFEERDZB ZEFEERDZB 637 653zefeerdzb MACH_ZEFEERDZB ZEFEERDZB 637
@@ -721,7 +721,7 @@ gp32 MACH_GP32 GP32 706
721gem MACH_GEM GEM 707 721gem MACH_GEM GEM 707
722i858 MACH_I858 I858 708 722i858 MACH_I858 I858 708
723hx2750 MACH_HX2750 HX2750 709 723hx2750 MACH_HX2750 HX2750 709
724zeusevb MACH_ZEUSEVB ZEUSEVB 710 724mxc91131evb MACH_ZEUSEVB ZEUSEVB 710
725p700 MACH_P700 P700 711 725p700 MACH_P700 P700 711
726cpe MACH_CPE CPE 712 726cpe MACH_CPE CPE 712
727spitz MACH_SPITZ SPITZ 713 727spitz MACH_SPITZ SPITZ 713
@@ -802,7 +802,7 @@ cpuat91 MACH_CPUAT91 CPUAT91 787
802rea9200 MACH_REA9200 REA9200 788 802rea9200 MACH_REA9200 REA9200 788
803acts_pune_sa1110 MACH_ACTS_PUNE_SA1110 ACTS_PUNE_SA1110 789 803acts_pune_sa1110 MACH_ACTS_PUNE_SA1110 ACTS_PUNE_SA1110 789
804ixp425 MACH_IXP425 IXP425 790 804ixp425 MACH_IXP425 IXP425 790
805argonplusodyssey MACH_ARGONPLUSODYSSEY ARGONPLUSODYSSEY 791 805i30030ads MACH_ARGONPLUSODYSSEY ARGONPLUSODYSSEY 791
806perch MACH_PERCH PERCH 792 806perch MACH_PERCH PERCH 792
807eis05r1 MACH_EIS05R1 EIS05R1 793 807eis05r1 MACH_EIS05R1 EIS05R1 793
808pepperpad MACH_PEPPERPAD PEPPERPAD 794 808pepperpad MACH_PEPPERPAD PEPPERPAD 794
@@ -827,7 +827,7 @@ micro9l MACH_MICRO9L MICRO9L 812
827uc5471dsp MACH_UC5471DSP UC5471DSP 813 827uc5471dsp MACH_UC5471DSP UC5471DSP 813
828sj5471eng MACH_SJ5471ENG SJ5471ENG 814 828sj5471eng MACH_SJ5471ENG SJ5471ENG 814
829none MACH_CMPXA26X CMPXA26X 815 829none MACH_CMPXA26X CMPXA26X 815
830nc MACH_NC NC 816 830nc1 MACH_NC NC 816
831omap_palmte MACH_OMAP_PALMTE OMAP_PALMTE 817 831omap_palmte MACH_OMAP_PALMTE OMAP_PALMTE 817
832ajax52x MACH_AJAX52X AJAX52X 818 832ajax52x MACH_AJAX52X AJAX52X 818
833siriustar MACH_SIRIUSTAR SIRIUSTAR 819 833siriustar MACH_SIRIUSTAR SIRIUSTAR 819
@@ -930,7 +930,7 @@ netclient MACH_NETCLIENT NETCLIENT 916
930xscale_palmtt5 MACH_XSCALE_PALMTT5 XSCALE_PALMTT5 917 930xscale_palmtt5 MACH_XSCALE_PALMTT5 XSCALE_PALMTT5 917
931xscale_palmtc MACH_OMAP_PALMTC OMAP_PALMTC 918 931xscale_palmtc MACH_OMAP_PALMTC OMAP_PALMTC 918
932omap_apollon MACH_OMAP_APOLLON OMAP_APOLLON 919 932omap_apollon MACH_OMAP_APOLLON OMAP_APOLLON 919
933argonlvevb MACH_ARGONLVEVB ARGONLVEVB 920 933mxc30030evb MACH_ARGONLVEVB ARGONLVEVB 920
934rea_2d MACH_REA_2D REA_2D 921 934rea_2d MACH_REA_2D REA_2D 921
935eti3e524 MACH_TI3E524 TI3E524 922 935eti3e524 MACH_TI3E524 TI3E524 922
936ateb9200 MACH_ATEB9200 ATEB9200 923 936ateb9200 MACH_ATEB9200 ATEB9200 923
@@ -965,7 +965,78 @@ sisteron MACH_SISTERON SISTERON 951
965rx1950 MACH_RX1950 RX1950 952 965rx1950 MACH_RX1950 RX1950 952
966tsc_venus MACH_TSC_VENUS TSC_VENUS 953 966tsc_venus MACH_TSC_VENUS TSC_VENUS 953
967ds101j MACH_DS101J DS101J 954 967ds101j MACH_DS101J DS101J 954
968mxc300_30ads MACH_MXC30030ADS MXC30030ADS 955 968mxc30030ads MACH_MXC30030ADS MXC30030ADS 955
969fujitsu_wimaxsoc MACH_FUJITSU_WIMAXSOC FUJITSU_WIMAXSOC 956 969fujitsu_wimaxsoc MACH_FUJITSU_WIMAXSOC FUJITSU_WIMAXSOC 956
970dualpcmodem MACH_DUALPCMODEM DUALPCMODEM 957 970dualpcmodem MACH_DUALPCMODEM DUALPCMODEM 957
971gesbc9312 MACH_GESBC9312 GESBC9312 958 971gesbc9312 MACH_GESBC9312 GESBC9312 958
972htcapache MACH_HTCAPACHE HTCAPACHE 959
973ixdp435 MACH_IXDP435 IXDP435 960
974catprovt100 MACH_CATPROVT100 CATPROVT100 961
975picotux1xx MACH_PICOTUX1XX PICOTUX1XX 962
976picotux2xx MACH_PICOTUX2XX PICOTUX2XX 963
977dsmg600 MACH_DSMG600 DSMG600 964
978empc2 MACH_EMPC2 EMPC2 965
979ventura MACH_VENTURA VENTURA 966
980phidget_sbc MACH_PHIDGET_SBC PHIDGET_SBC 967
981ij3k MACH_IJ3K IJ3K 968
982pisgah MACH_PISGAH PISGAH 969
983omap_fsample MACH_OMAP_FSAMPLE OMAP_FSAMPLE 970
984sg720 MACH_SG720 SG720 971
985redfox MACH_REDFOX REDFOX 972
986mysh_ep9315_1 MACH_MYSH_EP9315_1 MYSH_EP9315_1 973
987tpf106 MACH_TPF106 TPF106 974
988at91rm9200kg MACH_AT91RM9200KG AT91RM9200KG 975
989racemt2 MACH_SLEDB SLEDB 976
990ontrack MACH_ONTRACK ONTRACK 977
991pm1200 MACH_PM1200 PM1200 978
992ess24562 MACH_ESS24XXX ESS24XXX 979
993coremp7 MACH_COREMP7 COREMP7 980
994nexcoder_6446 MACH_NEXCODER_6446 NEXCODER_6446 981
995stvc8380 MACH_STVC8380 STVC8380 982
996teklynx MACH_TEKLYNX TEKLYNX 983
997carbonado MACH_CARBONADO CARBONADO 984
998sysmos_mp730 MACH_SYSMOS_MP730 SYSMOS_MP730 985
999snapper_cl15 MACH_SNAPPER_CL15 SNAPPER_CL15 986
1000pgigim MACH_PGIGIM PGIGIM 987
1001ptx9160p2 MACH_PTX9160P2 PTX9160P2 988
1002dcore1 MACH_DCORE1 DCORE1 989
1003victorpxa MACH_VICTORPXA VICTORPXA 990
1004mx2dtb MACH_MX2DTB MX2DTB 991
1005pxa_irex_er0100 MACH_PXA_IREX_ER0100 PXA_IREX_ER0100 992
1006omap_palmz71 MACH_OMAP_PALMZ71 OMAP_PALMZ71 993
1007bartec_deg MACH_BARTEC_DEG BARTEC_DEG 994
1008hw50251 MACH_HW50251 HW50251 995
1009ibox MACH_IBOX IBOX 996
1010atlaslh7a404 MACH_ATLASLH7A404 ATLASLH7A404 997
1011pt2026 MACH_PT2026 PT2026 998
1012htcalpine MACH_HTCALPINE HTCALPINE 999
1013bartec_vtu MACH_BARTEC_VTU BARTEC_VTU 1000
1014vcoreii MACH_VCOREII VCOREII 1001
1015pdnb3 MACH_PDNB3 PDNB3 1002
1016htcbeetles MACH_HTCBEETLES HTCBEETLES 1003
1017s3c6400 MACH_S3C6400 S3C6400 1004
1018s3c2443 MACH_S3C2443 S3C2443 1005
1019omap_ldk MACH_OMAP_LDK OMAP_LDK 1006
1020smdk2460 MACH_SMDK2460 SMDK2460 1007
1021smdk2440 MACH_SMDK2440 SMDK2440 1008
1022smdk2412 MACH_SMDK2412 SMDK2412 1009
1023webbox MACH_WEBBOX WEBBOX 1010
1024cwwndp MACH_CWWNDP CWWNDP 1011
1025dragon MACH_DRAGON DRAGON 1012
1026opendo_cpu_board MACH_OPENDO_CPU_BOARD OPENDO_CPU_BOARD 1013
1027ccm2200 MACH_CCM2200 CCM2200 1014
1028etwarm MACH_ETWARM ETWARM 1015
1029m93030 MACH_M93030 M93030 1016
1030cc7u MACH_CC7U CC7U 1017
1031mtt_ranger MACH_MTT_RANGER MTT_RANGER 1018
1032nexus MACH_NEXUS NEXUS 1019
1033desman MACH_DESMAN DESMAN 1020
1034bkde303 MACH_BKDE303 BKDE303 1021
1035smdk2413 MACH_SMDK2413 SMDK2413 1022
1036aml_m7200 MACH_AML_M7200 AML_M7200 1023
1037aml_m5900 MACH_AML_M5900 AML_M5900 1024
1038sg640 MACH_SG640 SG640 1025
1039edg79524 MACH_EDG79524 EDG79524 1026
1040ai2410 MACH_AI2410 AI2410 1027
1041ixp465 MACH_IXP465 IXP465 1028
1042balloon3 MACH_BALLOON3 BALLOON3 1029
diff --git a/arch/arm/vfp/vfpdouble.c b/arch/arm/vfp/vfpdouble.c
index febd115dba28..009038c8113e 100644
--- a/arch/arm/vfp/vfpdouble.c
+++ b/arch/arm/vfp/vfpdouble.c
@@ -197,7 +197,7 @@ u32 vfp_double_normaliseround(int dd, struct vfp_double *vd, u32 fpscr, u32 exce
197 dd, d, exceptions); 197 dd, d, exceptions);
198 vfp_put_double(dd, d); 198 vfp_put_double(dd, d);
199 } 199 }
200 return exceptions & ~VFP_NAN_FLAG; 200 return exceptions;
201} 201}
202 202
203/* 203/*
diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
index 22f3da4e0829..03486be04193 100644
--- a/arch/arm/vfp/vfpmodule.c
+++ b/arch/arm/vfp/vfpmodule.c
@@ -180,7 +180,7 @@ static u32 vfp_emulate_instruction(u32 inst, u32 fpscr, struct pt_regs *regs)
180 * emulate it. 180 * emulate it.
181 */ 181 */
182 } 182 }
183 return exceptions; 183 return exceptions & ~VFP_NAN_FLAG;
184} 184}
185 185
186/* 186/*
@@ -245,7 +245,7 @@ void VFP9_bounce(u32 trigger, u32 fpexc, struct pt_regs *regs)
245 */ 245 */
246 barrier(); 246 barrier();
247 trigger = fmrx(FPINST2); 247 trigger = fmrx(FPINST2);
248 fpscr = fmrx(FPSCR); 248 orig_fpscr = fpscr = fmrx(FPSCR);
249 249
250 emulate: 250 emulate:
251 exceptions = vfp_emulate_instruction(trigger, fpscr, regs); 251 exceptions = vfp_emulate_instruction(trigger, fpscr, regs);
diff --git a/arch/arm/vfp/vfpsingle.c b/arch/arm/vfp/vfpsingle.c
index 4ac27f193934..dae2c2f46052 100644
--- a/arch/arm/vfp/vfpsingle.c
+++ b/arch/arm/vfp/vfpsingle.c
@@ -203,7 +203,7 @@ u32 vfp_single_normaliseround(int sd, struct vfp_single *vs, u32 fpscr, u32 exce
203 vfp_put_float(sd, d); 203 vfp_put_float(sd, d);
204 } 204 }
205 205
206 return exceptions & ~VFP_NAN_FLAG; 206 return exceptions;
207} 207}
208 208
209/* 209/*
diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig
index 18ec9fe6deb6..8dfa3054f10f 100644
--- a/arch/i386/Kconfig
+++ b/arch/i386/Kconfig
@@ -467,7 +467,7 @@ endchoice
467 467
468choice 468choice
469 depends on EXPERIMENTAL && !X86_PAE 469 depends on EXPERIMENTAL && !X86_PAE
470 prompt "Memory split" 470 prompt "Memory split" if EMBEDDED
471 default VMSPLIT_3G 471 default VMSPLIT_3G
472 help 472 help
473 Select the desired split between kernel and user memory. 473 Select the desired split between kernel and user memory.
@@ -756,12 +756,12 @@ config PHYSICAL_START
756 756
757config HOTPLUG_CPU 757config HOTPLUG_CPU
758 bool "Support for hot-pluggable CPUs (EXPERIMENTAL)" 758 bool "Support for hot-pluggable CPUs (EXPERIMENTAL)"
759 depends on SMP && HOTPLUG && EXPERIMENTAL && !X86_VOYAGER && !X86_PC 759 depends on SMP && HOTPLUG && EXPERIMENTAL && !X86_VOYAGER
760 ---help--- 760 ---help---
761 Say Y here to experiment with turning CPUs off and on. CPUs 761 Say Y here to experiment with turning CPUs off and on, and to
762 can be controlled through /sys/devices/system/cpu. 762 enable suspend on SMP systems. CPUs can be controlled through
763 /sys/devices/system/cpu.
763 764
764 Say N.
765 765
766endmenu 766endmenu
767 767
diff --git a/arch/i386/Kconfig.debug b/arch/i386/Kconfig.debug
index 6e97df6979e8..c92191b1fb67 100644
--- a/arch/i386/Kconfig.debug
+++ b/arch/i386/Kconfig.debug
@@ -81,4 +81,13 @@ config X86_MPPARSE
81 depends on X86_LOCAL_APIC && !X86_VISWS 81 depends on X86_LOCAL_APIC && !X86_VISWS
82 default y 82 default y
83 83
84config DOUBLEFAULT
85 default y
86 bool "Enable doublefault exception handler" if EMBEDDED
87 help
88 This option allows trapping of rare doublefault exceptions that
89 would otherwise cause a system to silently reboot. Disabling this
90 option saves about 4k and might cause you much additional grey
91 hair.
92
84endmenu 93endmenu
diff --git a/arch/i386/kernel/Makefile b/arch/i386/kernel/Makefile
index 5b9ed21216cf..96fb8a020af2 100644
--- a/arch/i386/kernel/Makefile
+++ b/arch/i386/kernel/Makefile
@@ -6,7 +6,7 @@ extra-y := head.o init_task.o vmlinux.lds
6 6
7obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o \ 7obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o \
8 ptrace.o time.o ioport.o ldt.o setup.o i8259.o sys_i386.o \ 8 ptrace.o time.o ioport.o ldt.o setup.o i8259.o sys_i386.o \
9 pci-dma.o i386_ksyms.o i387.o dmi_scan.o bootflag.o \ 9 pci-dma.o i386_ksyms.o i387.o bootflag.o \
10 quirks.o i8237.o topology.o alternative.o 10 quirks.o i8237.o topology.o alternative.o
11 11
12obj-y += cpu/ 12obj-y += cpu/
diff --git a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c
index 030a0007a4e0..40e5aba3ad3d 100644
--- a/arch/i386/kernel/acpi/boot.c
+++ b/arch/i386/kernel/acpi/boot.c
@@ -168,7 +168,7 @@ int __init acpi_parse_mcfg(unsigned long phys_addr, unsigned long size)
168 unsigned long i; 168 unsigned long i;
169 int config_size; 169 int config_size;
170 170
171 if (!phys_addr || !size || !cpu_has_apic) 171 if (!phys_addr || !size)
172 return -EINVAL; 172 return -EINVAL;
173 173
174 mcfg = (struct acpi_table_mcfg *)__acpi_map_table(phys_addr, size); 174 mcfg = (struct acpi_table_mcfg *)__acpi_map_table(phys_addr, size);
@@ -215,7 +215,7 @@ static int __init acpi_parse_madt(unsigned long phys_addr, unsigned long size)
215{ 215{
216 struct acpi_table_madt *madt = NULL; 216 struct acpi_table_madt *madt = NULL;
217 217
218 if (!phys_addr || !size || !cpu_has_apic) 218 if (!phys_addr || !size)
219 return -EINVAL; 219 return -EINVAL;
220 220
221 madt = (struct acpi_table_madt *)__acpi_map_table(phys_addr, size); 221 madt = (struct acpi_table_madt *)__acpi_map_table(phys_addr, size);
diff --git a/arch/i386/kernel/acpi/earlyquirk.c b/arch/i386/kernel/acpi/earlyquirk.c
index 2e3b643a4dc4..1649a175a206 100644
--- a/arch/i386/kernel/acpi/earlyquirk.c
+++ b/arch/i386/kernel/acpi/earlyquirk.c
@@ -5,17 +5,34 @@
5#include <linux/init.h> 5#include <linux/init.h>
6#include <linux/kernel.h> 6#include <linux/kernel.h>
7#include <linux/pci.h> 7#include <linux/pci.h>
8#include <linux/acpi.h>
9
8#include <asm/pci-direct.h> 10#include <asm/pci-direct.h>
9#include <asm/acpi.h> 11#include <asm/acpi.h>
10#include <asm/apic.h> 12#include <asm/apic.h>
11 13
14#ifdef CONFIG_ACPI
15
16static int nvidia_hpet_detected __initdata;
17
18static int __init nvidia_hpet_check(unsigned long phys, unsigned long size)
19{
20 nvidia_hpet_detected = 1;
21 return 0;
22}
23#endif
24
12static int __init check_bridge(int vendor, int device) 25static int __init check_bridge(int vendor, int device)
13{ 26{
14#ifdef CONFIG_ACPI 27#ifdef CONFIG_ACPI
15 /* According to Nvidia all timer overrides are bogus. Just ignore 28 /* According to Nvidia all timer overrides are bogus unless HPET
16 them all. */ 29 is enabled. */
17 if (vendor == PCI_VENDOR_ID_NVIDIA) { 30 if (vendor == PCI_VENDOR_ID_NVIDIA) {
18 acpi_skip_timer_override = 1; 31 nvidia_hpet_detected = 0;
32 acpi_table_parse(ACPI_HPET, nvidia_hpet_check);
33 if (nvidia_hpet_detected == 0) {
34 acpi_skip_timer_override = 1;
35 }
19 } 36 }
20#endif 37#endif
21 if (vendor == PCI_VENDOR_ID_ATI && timer_over_8254 == 1) { 38 if (vendor == PCI_VENDOR_ID_ATI && timer_over_8254 == 1) {
diff --git a/arch/i386/kernel/apic.c b/arch/i386/kernel/apic.c
index 254cee9f0b7b..3d4b2f3d116a 100644
--- a/arch/i386/kernel/apic.c
+++ b/arch/i386/kernel/apic.c
@@ -757,10 +757,6 @@ static int __init apic_set_verbosity(char *str)
757 apic_verbosity = APIC_DEBUG; 757 apic_verbosity = APIC_DEBUG;
758 else if (strcmp("verbose", str) == 0) 758 else if (strcmp("verbose", str) == 0)
759 apic_verbosity = APIC_VERBOSE; 759 apic_verbosity = APIC_VERBOSE;
760 else
761 printk(KERN_WARNING "APIC Verbosity level %s not recognised"
762 " use apic=verbose or apic=debug\n", str);
763
764 return 1; 760 return 1;
765} 761}
766 762
@@ -1345,6 +1341,14 @@ int __init APIC_init_uniprocessor (void)
1345 1341
1346 connect_bsp_APIC(); 1342 connect_bsp_APIC();
1347 1343
1344 /*
1345 * Hack: In case of kdump, after a crash, kernel might be booting
1346 * on a cpu with non-zero lapic id. But boot_cpu_physical_apicid
1347 * might be zero if read from MP tables. Get it from LAPIC.
1348 */
1349#ifdef CONFIG_CRASH_DUMP
1350 boot_cpu_physical_apicid = GET_APIC_ID(apic_read(APIC_ID));
1351#endif
1348 phys_cpu_present_map = physid_mask_of_physid(boot_cpu_physical_apicid); 1352 phys_cpu_present_map = physid_mask_of_physid(boot_cpu_physical_apicid);
1349 1353
1350 setup_local_APIC(); 1354 setup_local_APIC();
diff --git a/arch/i386/kernel/apm.c b/arch/i386/kernel/apm.c
index da30a374dd4e..df0e1745f189 100644
--- a/arch/i386/kernel/apm.c
+++ b/arch/i386/kernel/apm.c
@@ -1079,7 +1079,7 @@ static int apm_console_blank(int blank)
1079 break; 1079 break;
1080 } 1080 }
1081 1081
1082 if (error == APM_NOT_ENGAGED && state != APM_STATE_READY) { 1082 if (error == APM_NOT_ENGAGED) {
1083 static int tried; 1083 static int tried;
1084 int eng_error; 1084 int eng_error;
1085 if (tried++ == 0) { 1085 if (tried++ == 0) {
diff --git a/arch/i386/kernel/cpu/amd.c b/arch/i386/kernel/cpu/amd.c
index ff2b2154ac1b..786d1a57048b 100644
--- a/arch/i386/kernel/cpu/amd.c
+++ b/arch/i386/kernel/cpu/amd.c
@@ -207,6 +207,8 @@ static void __init init_amd(struct cpuinfo_x86 *c)
207 set_bit(X86_FEATURE_K7, c->x86_capability); 207 set_bit(X86_FEATURE_K7, c->x86_capability);
208 break; 208 break;
209 } 209 }
210 if (c->x86 >= 6)
211 set_bit(X86_FEATURE_FXSAVE_LEAK, c->x86_capability);
210 212
211 display_cacheinfo(c); 213 display_cacheinfo(c);
212 214
diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
index 7c0e160a2145..71fffa174425 100644
--- a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
+++ b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
@@ -905,14 +905,17 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi
905{ 905{
906 cpumask_t oldmask = CPU_MASK_ALL; 906 cpumask_t oldmask = CPU_MASK_ALL;
907 struct powernow_k8_data *data = powernow_data[pol->cpu]; 907 struct powernow_k8_data *data = powernow_data[pol->cpu];
908 u32 checkfid = data->currfid; 908 u32 checkfid;
909 u32 checkvid = data->currvid; 909 u32 checkvid;
910 unsigned int newstate; 910 unsigned int newstate;
911 int ret = -EIO; 911 int ret = -EIO;
912 912
913 if (!data) 913 if (!data)
914 return -EINVAL; 914 return -EINVAL;
915 915
916 checkfid = data->currfid;
917 checkvid = data->currvid;
918
916 /* only run on specific CPU from here on */ 919 /* only run on specific CPU from here on */
917 oldmask = current->cpus_allowed; 920 oldmask = current->cpus_allowed;
918 set_cpus_allowed(current, cpumask_of_cpu(pol->cpu)); 921 set_cpus_allowed(current, cpumask_of_cpu(pol->cpu));
@@ -1109,9 +1112,6 @@ static unsigned int powernowk8_get (unsigned int cpu)
1109 if (!data) 1112 if (!data)
1110 return -EINVAL; 1113 return -EINVAL;
1111 1114
1112 if (!data)
1113 return -EINVAL;
1114
1115 set_cpus_allowed(current, cpumask_of_cpu(cpu)); 1115 set_cpus_allowed(current, cpumask_of_cpu(cpu));
1116 if (smp_processor_id() != cpu) { 1116 if (smp_processor_id() != cpu) {
1117 printk(KERN_ERR PFX "limiting to CPU %d failed in powernowk8_get\n", cpu); 1117 printk(KERN_ERR PFX "limiting to CPU %d failed in powernowk8_get\n", cpu);
diff --git a/arch/i386/kernel/cpu/intel_cacheinfo.c b/arch/i386/kernel/cpu/intel_cacheinfo.c
index 9df87b03612c..c8547a6fa7e6 100644
--- a/arch/i386/kernel/cpu/intel_cacheinfo.c
+++ b/arch/i386/kernel/cpu/intel_cacheinfo.c
@@ -642,7 +642,7 @@ static void __cpuexit cache_remove_dev(struct sys_device * sys_dev)
642 return; 642 return;
643} 643}
644 644
645static int __cpuinit cacheinfo_cpu_callback(struct notifier_block *nfb, 645static int cacheinfo_cpu_callback(struct notifier_block *nfb,
646 unsigned long action, void *hcpu) 646 unsigned long action, void *hcpu)
647{ 647{
648 unsigned int cpu = (unsigned long)hcpu; 648 unsigned int cpu = (unsigned long)hcpu;
diff --git a/arch/i386/kernel/cpuid.c b/arch/i386/kernel/cpuid.c
index 006141d1c12a..1d9a4abcdfc7 100644
--- a/arch/i386/kernel/cpuid.c
+++ b/arch/i386/kernel/cpuid.c
@@ -168,7 +168,7 @@ static int cpuid_class_device_create(int i)
168 return err; 168 return err;
169} 169}
170 170
171static int __devinit cpuid_class_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) 171static int cpuid_class_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
172{ 172{
173 unsigned int cpu = (unsigned long)hcpu; 173 unsigned int cpu = (unsigned long)hcpu;
174 174
diff --git a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c
index f8f132aa5472..d70f2ade5cde 100644
--- a/arch/i386/kernel/io_apic.c
+++ b/arch/i386/kernel/io_apic.c
@@ -2238,6 +2238,8 @@ static inline void unlock_ExtINT_logic(void)
2238 spin_unlock_irqrestore(&ioapic_lock, flags); 2238 spin_unlock_irqrestore(&ioapic_lock, flags);
2239} 2239}
2240 2240
2241int timer_uses_ioapic_pin_0;
2242
2241/* 2243/*
2242 * This code may look a bit paranoid, but it's supposed to cooperate with 2244 * This code may look a bit paranoid, but it's supposed to cooperate with
2243 * a wide range of boards and BIOS bugs. Fortunately only the timer IRQ 2245 * a wide range of boards and BIOS bugs. Fortunately only the timer IRQ
@@ -2274,6 +2276,9 @@ static inline void check_timer(void)
2274 pin2 = ioapic_i8259.pin; 2276 pin2 = ioapic_i8259.pin;
2275 apic2 = ioapic_i8259.apic; 2277 apic2 = ioapic_i8259.apic;
2276 2278
2279 if (pin1 == 0)
2280 timer_uses_ioapic_pin_0 = 1;
2281
2277 printk(KERN_INFO "..TIMER: vector=0x%02X apic1=%d pin1=%d apic2=%d pin2=%d\n", 2282 printk(KERN_INFO "..TIMER: vector=0x%02X apic1=%d pin1=%d apic2=%d pin2=%d\n",
2278 vector, apic1, pin1, apic2, pin2); 2283 vector, apic1, pin1, apic2, pin2);
2279 2284
diff --git a/arch/i386/kernel/kprobes.c b/arch/i386/kernel/kprobes.c
index f19768789e8a..38806f427849 100644
--- a/arch/i386/kernel/kprobes.c
+++ b/arch/i386/kernel/kprobes.c
@@ -43,7 +43,7 @@ DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL;
43DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); 43DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk);
44 44
45/* insert a jmp code */ 45/* insert a jmp code */
46static inline void set_jmp_op(void *from, void *to) 46static __always_inline void set_jmp_op(void *from, void *to)
47{ 47{
48 struct __arch_jmp_op { 48 struct __arch_jmp_op {
49 char op; 49 char op;
@@ -57,7 +57,7 @@ static inline void set_jmp_op(void *from, void *to)
57/* 57/*
58 * returns non-zero if opcodes can be boosted. 58 * returns non-zero if opcodes can be boosted.
59 */ 59 */
60static inline int can_boost(kprobe_opcode_t opcode) 60static __always_inline int can_boost(kprobe_opcode_t opcode)
61{ 61{
62 switch (opcode & 0xf0 ) { 62 switch (opcode & 0xf0 ) {
63 case 0x70: 63 case 0x70:
@@ -88,7 +88,7 @@ static inline int can_boost(kprobe_opcode_t opcode)
88/* 88/*
89 * returns non-zero if opcode modifies the interrupt flag. 89 * returns non-zero if opcode modifies the interrupt flag.
90 */ 90 */
91static inline int is_IF_modifier(kprobe_opcode_t opcode) 91static int __kprobes is_IF_modifier(kprobe_opcode_t opcode)
92{ 92{
93 switch (opcode) { 93 switch (opcode) {
94 case 0xfa: /* cli */ 94 case 0xfa: /* cli */
@@ -138,7 +138,7 @@ void __kprobes arch_remove_kprobe(struct kprobe *p)
138 mutex_unlock(&kprobe_mutex); 138 mutex_unlock(&kprobe_mutex);
139} 139}
140 140
141static inline void save_previous_kprobe(struct kprobe_ctlblk *kcb) 141static void __kprobes save_previous_kprobe(struct kprobe_ctlblk *kcb)
142{ 142{
143 kcb->prev_kprobe.kp = kprobe_running(); 143 kcb->prev_kprobe.kp = kprobe_running();
144 kcb->prev_kprobe.status = kcb->kprobe_status; 144 kcb->prev_kprobe.status = kcb->kprobe_status;
@@ -146,7 +146,7 @@ static inline void save_previous_kprobe(struct kprobe_ctlblk *kcb)
146 kcb->prev_kprobe.saved_eflags = kcb->kprobe_saved_eflags; 146 kcb->prev_kprobe.saved_eflags = kcb->kprobe_saved_eflags;
147} 147}
148 148
149static inline void restore_previous_kprobe(struct kprobe_ctlblk *kcb) 149static void __kprobes restore_previous_kprobe(struct kprobe_ctlblk *kcb)
150{ 150{
151 __get_cpu_var(current_kprobe) = kcb->prev_kprobe.kp; 151 __get_cpu_var(current_kprobe) = kcb->prev_kprobe.kp;
152 kcb->kprobe_status = kcb->prev_kprobe.status; 152 kcb->kprobe_status = kcb->prev_kprobe.status;
@@ -154,7 +154,7 @@ static inline void restore_previous_kprobe(struct kprobe_ctlblk *kcb)
154 kcb->kprobe_saved_eflags = kcb->prev_kprobe.saved_eflags; 154 kcb->kprobe_saved_eflags = kcb->prev_kprobe.saved_eflags;
155} 155}
156 156
157static inline void set_current_kprobe(struct kprobe *p, struct pt_regs *regs, 157static void __kprobes set_current_kprobe(struct kprobe *p, struct pt_regs *regs,
158 struct kprobe_ctlblk *kcb) 158 struct kprobe_ctlblk *kcb)
159{ 159{
160 __get_cpu_var(current_kprobe) = p; 160 __get_cpu_var(current_kprobe) = p;
@@ -164,7 +164,7 @@ static inline void set_current_kprobe(struct kprobe *p, struct pt_regs *regs,
164 kcb->kprobe_saved_eflags &= ~IF_MASK; 164 kcb->kprobe_saved_eflags &= ~IF_MASK;
165} 165}
166 166
167static inline void prepare_singlestep(struct kprobe *p, struct pt_regs *regs) 167static void __kprobes prepare_singlestep(struct kprobe *p, struct pt_regs *regs)
168{ 168{
169 regs->eflags |= TF_MASK; 169 regs->eflags |= TF_MASK;
170 regs->eflags &= ~IF_MASK; 170 regs->eflags &= ~IF_MASK;
@@ -242,10 +242,6 @@ static int __kprobes kprobe_handler(struct pt_regs *regs)
242 kcb->kprobe_status = KPROBE_REENTER; 242 kcb->kprobe_status = KPROBE_REENTER;
243 return 1; 243 return 1;
244 } else { 244 } else {
245 if (regs->eflags & VM_MASK) {
246 /* We are in virtual-8086 mode. Return 0 */
247 goto no_kprobe;
248 }
249 if (*addr != BREAKPOINT_INSTRUCTION) { 245 if (*addr != BREAKPOINT_INSTRUCTION) {
250 /* The breakpoint instruction was removed by 246 /* The breakpoint instruction was removed by
251 * another cpu right after we hit, no further 247 * another cpu right after we hit, no further
@@ -265,11 +261,6 @@ static int __kprobes kprobe_handler(struct pt_regs *regs)
265 261
266 p = get_kprobe(addr); 262 p = get_kprobe(addr);
267 if (!p) { 263 if (!p) {
268 if (regs->eflags & VM_MASK) {
269 /* We are in virtual-8086 mode. Return 0 */
270 goto no_kprobe;
271 }
272
273 if (*addr != BREAKPOINT_INSTRUCTION) { 264 if (*addr != BREAKPOINT_INSTRUCTION) {
274 /* 265 /*
275 * The breakpoint instruction was removed right 266 * The breakpoint instruction was removed right
@@ -452,10 +443,11 @@ static void __kprobes resume_execution(struct kprobe *p,
452 *tos &= ~(TF_MASK | IF_MASK); 443 *tos &= ~(TF_MASK | IF_MASK);
453 *tos |= kcb->kprobe_old_eflags; 444 *tos |= kcb->kprobe_old_eflags;
454 break; 445 break;
455 case 0xc3: /* ret/lret */ 446 case 0xc2: /* iret/ret/lret */
456 case 0xcb: 447 case 0xc3:
457 case 0xc2:
458 case 0xca: 448 case 0xca:
449 case 0xcb:
450 case 0xcf:
459 case 0xea: /* jmp absolute -- eip is correct */ 451 case 0xea: /* jmp absolute -- eip is correct */
460 /* eip is already adjusted, no more changes required */ 452 /* eip is already adjusted, no more changes required */
461 p->ainsn.boostable = 1; 453 p->ainsn.boostable = 1;
@@ -463,10 +455,13 @@ static void __kprobes resume_execution(struct kprobe *p,
463 case 0xe8: /* call relative - Fix return addr */ 455 case 0xe8: /* call relative - Fix return addr */
464 *tos = orig_eip + (*tos - copy_eip); 456 *tos = orig_eip + (*tos - copy_eip);
465 break; 457 break;
458 case 0x9a: /* call absolute -- same as call absolute, indirect */
459 *tos = orig_eip + (*tos - copy_eip);
460 goto no_change;
466 case 0xff: 461 case 0xff:
467 if ((p->ainsn.insn[1] & 0x30) == 0x10) { 462 if ((p->ainsn.insn[1] & 0x30) == 0x10) {
468 /* call absolute, indirect */
469 /* 463 /*
464 * call absolute, indirect
470 * Fix return addr; eip is correct. 465 * Fix return addr; eip is correct.
471 * But this is not boostable 466 * But this is not boostable
472 */ 467 */
@@ -507,7 +502,7 @@ no_change:
507 * Interrupts are disabled on entry as trap1 is an interrupt gate and they 502 * Interrupts are disabled on entry as trap1 is an interrupt gate and they
508 * remain disabled thoroughout this function. 503 * remain disabled thoroughout this function.
509 */ 504 */
510static inline int post_kprobe_handler(struct pt_regs *regs) 505static int __kprobes post_kprobe_handler(struct pt_regs *regs)
511{ 506{
512 struct kprobe *cur = kprobe_running(); 507 struct kprobe *cur = kprobe_running();
513 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); 508 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
@@ -543,7 +538,7 @@ out:
543 return 1; 538 return 1;
544} 539}
545 540
546static inline int kprobe_fault_handler(struct pt_regs *regs, int trapnr) 541static int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr)
547{ 542{
548 struct kprobe *cur = kprobe_running(); 543 struct kprobe *cur = kprobe_running();
549 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); 544 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
diff --git a/arch/i386/kernel/mpparse.c b/arch/i386/kernel/mpparse.c
index 34d21e21e012..6b1392d33ed5 100644
--- a/arch/i386/kernel/mpparse.c
+++ b/arch/i386/kernel/mpparse.c
@@ -1130,7 +1130,17 @@ int mp_register_gsi (u32 gsi, int triggering, int polarity)
1130 */ 1130 */
1131 int irq = gsi; 1131 int irq = gsi;
1132 if (gsi < MAX_GSI_NUM) { 1132 if (gsi < MAX_GSI_NUM) {
1133 if (gsi > 15) 1133 /*
1134 * Retain the VIA chipset work-around (gsi > 15), but
1135 * avoid a problem where the 8254 timer (IRQ0) is setup
1136 * via an override (so it's not on pin 0 of the ioapic),
1137 * and at the same time, the pin 0 interrupt is a PCI
1138 * type. The gsi > 15 test could cause these two pins
1139 * to be shared as IRQ0, and they are not shareable.
1140 * So test for this condition, and if necessary, avoid
1141 * the pin collision.
1142 */
1143 if (gsi > 15 || (gsi == 0 && !timer_uses_ioapic_pin_0))
1134 gsi = pci_irq++; 1144 gsi = pci_irq++;
1135 /* 1145 /*
1136 * Don't assign IRQ used by ACPI SCI 1146 * Don't assign IRQ used by ACPI SCI
diff --git a/arch/i386/kernel/msr.c b/arch/i386/kernel/msr.c
index 1d0a55e68760..7a328230e540 100644
--- a/arch/i386/kernel/msr.c
+++ b/arch/i386/kernel/msr.c
@@ -251,7 +251,7 @@ static int msr_class_device_create(int i)
251 return err; 251 return err;
252} 252}
253 253
254static int __devinit msr_class_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) 254static int msr_class_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
255{ 255{
256 unsigned int cpu = (unsigned long)hcpu; 256 unsigned int cpu = (unsigned long)hcpu;
257 257
diff --git a/arch/i386/kernel/ptrace.c b/arch/i386/kernel/ptrace.c
index 506462ef36a0..fd7eaf7866e0 100644
--- a/arch/i386/kernel/ptrace.c
+++ b/arch/i386/kernel/ptrace.c
@@ -671,7 +671,7 @@ int do_syscall_trace(struct pt_regs *regs, int entryexit)
671 671
672 if (unlikely(current->audit_context)) { 672 if (unlikely(current->audit_context)) {
673 if (entryexit) 673 if (entryexit)
674 audit_syscall_exit(current, AUDITSC_RESULT(regs->eax), 674 audit_syscall_exit(AUDITSC_RESULT(regs->eax),
675 regs->eax); 675 regs->eax);
676 /* Debug traps, when using PTRACE_SINGLESTEP, must be sent only 676 /* Debug traps, when using PTRACE_SINGLESTEP, must be sent only
677 * on the syscall exit path. Normally, when TIF_SYSCALL_AUDIT is 677 * on the syscall exit path. Normally, when TIF_SYSCALL_AUDIT is
@@ -720,14 +720,13 @@ int do_syscall_trace(struct pt_regs *regs, int entryexit)
720 ret = is_sysemu; 720 ret = is_sysemu;
721out: 721out:
722 if (unlikely(current->audit_context) && !entryexit) 722 if (unlikely(current->audit_context) && !entryexit)
723 audit_syscall_entry(current, AUDIT_ARCH_I386, regs->orig_eax, 723 audit_syscall_entry(AUDIT_ARCH_I386, regs->orig_eax,
724 regs->ebx, regs->ecx, regs->edx, regs->esi); 724 regs->ebx, regs->ecx, regs->edx, regs->esi);
725 if (ret == 0) 725 if (ret == 0)
726 return 0; 726 return 0;
727 727
728 regs->orig_eax = -1; /* force skip of syscall restarting */ 728 regs->orig_eax = -1; /* force skip of syscall restarting */
729 if (unlikely(current->audit_context)) 729 if (unlikely(current->audit_context))
730 audit_syscall_exit(current, AUDITSC_RESULT(regs->eax), 730 audit_syscall_exit(AUDITSC_RESULT(regs->eax), regs->eax);
731 regs->eax);
732 return 1; 731 return 1;
733} 732}
diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c
index 80cb3b2d0997..dd6b0e3386ce 100644
--- a/arch/i386/kernel/setup.c
+++ b/arch/i386/kernel/setup.c
@@ -970,8 +970,10 @@ efi_memory_present_wrapper(unsigned long start, unsigned long end, void *arg)
970 * not-overlapping, which is the case 970 * not-overlapping, which is the case
971 */ 971 */
972int __init 972int __init
973e820_all_mapped(unsigned long start, unsigned long end, unsigned type) 973e820_all_mapped(unsigned long s, unsigned long e, unsigned type)
974{ 974{
975 u64 start = s;
976 u64 end = e;
975 int i; 977 int i;
976 for (i = 0; i < e820.nr_map; i++) { 978 for (i = 0; i < e820.nr_map; i++) {
977 struct e820entry *ei = &e820.map[i]; 979 struct e820entry *ei = &e820.map[i];
@@ -1318,6 +1320,8 @@ legacy_init_iomem_resources(struct resource *code_resource, struct resource *dat
1318 probe_roms(); 1320 probe_roms();
1319 for (i = 0; i < e820.nr_map; i++) { 1321 for (i = 0; i < e820.nr_map; i++) {
1320 struct resource *res; 1322 struct resource *res;
1323 if (e820.map[i].addr + e820.map[i].size > 0x100000000ULL)
1324 continue;
1321 res = kzalloc(sizeof(struct resource), GFP_ATOMIC); 1325 res = kzalloc(sizeof(struct resource), GFP_ATOMIC);
1322 switch (e820.map[i].type) { 1326 switch (e820.map[i].type) {
1323 case E820_RAM: res->name = "System RAM"; break; 1327 case E820_RAM: res->name = "System RAM"; break;
@@ -1543,15 +1547,18 @@ void __init setup_arch(char **cmdline_p)
1543 if (efi_enabled) 1547 if (efi_enabled)
1544 efi_map_memmap(); 1548 efi_map_memmap();
1545 1549
1546#ifdef CONFIG_X86_IO_APIC
1547 check_acpi_pci(); /* Checks more than just ACPI actually */
1548#endif
1549
1550#ifdef CONFIG_ACPI 1550#ifdef CONFIG_ACPI
1551 /* 1551 /*
1552 * Parse the ACPI tables for possible boot-time SMP configuration. 1552 * Parse the ACPI tables for possible boot-time SMP configuration.
1553 */ 1553 */
1554 acpi_boot_table_init(); 1554 acpi_boot_table_init();
1555#endif
1556
1557#ifdef CONFIG_X86_IO_APIC
1558 check_acpi_pci(); /* Checks more than just ACPI actually */
1559#endif
1560
1561#ifdef CONFIG_ACPI
1555 acpi_boot_init(); 1562 acpi_boot_init();
1556 1563
1557#if defined(CONFIG_SMP) && defined(CONFIG_X86_PC) 1564#if defined(CONFIG_SMP) && defined(CONFIG_X86_PC)
diff --git a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c
index a6969903f2d6..825b2b4ca721 100644
--- a/arch/i386/kernel/smpboot.c
+++ b/arch/i386/kernel/smpboot.c
@@ -313,7 +313,9 @@ static void __init synchronize_tsc_bp (void)
313 if (tsc_values[i] < avg) 313 if (tsc_values[i] < avg)
314 realdelta = -realdelta; 314 realdelta = -realdelta;
315 315
316 printk(KERN_INFO "CPU#%d had %ld usecs TSC skew, fixed it up.\n", i, realdelta); 316 if (realdelta > 0)
317 printk(KERN_INFO "CPU#%d had %ld usecs TSC "
318 "skew, fixed it up.\n", i, realdelta);
317 } 319 }
318 320
319 sum += delta; 321 sum += delta;
diff --git a/arch/i386/kernel/syscall_table.S b/arch/i386/kernel/syscall_table.S
index 4f58b9c0efe3..af56987f69b0 100644
--- a/arch/i386/kernel/syscall_table.S
+++ b/arch/i386/kernel/syscall_table.S
@@ -314,3 +314,5 @@ ENTRY(sys_call_table)
314 .long sys_get_robust_list 314 .long sys_get_robust_list
315 .long sys_splice 315 .long sys_splice
316 .long sys_sync_file_range 316 .long sys_sync_file_range
317 .long sys_tee /* 315 */
318 .long sys_vmsplice
diff --git a/arch/i386/kernel/timers/timer_tsc.c b/arch/i386/kernel/timers/timer_tsc.c
index 5e41ee29c8cf..f1187ddb0d0f 100644
--- a/arch/i386/kernel/timers/timer_tsc.c
+++ b/arch/i386/kernel/timers/timer_tsc.c
@@ -279,7 +279,7 @@ time_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
279{ 279{
280 struct cpufreq_freqs *freq = data; 280 struct cpufreq_freqs *freq = data;
281 281
282 if (val != CPUFREQ_RESUMECHANGE) 282 if (val != CPUFREQ_RESUMECHANGE && val != CPUFREQ_SUSPENDCHANGE)
283 write_seqlock_irq(&xtime_lock); 283 write_seqlock_irq(&xtime_lock);
284 if (!ref_freq) { 284 if (!ref_freq) {
285 if (!freq->old){ 285 if (!freq->old){
@@ -312,7 +312,7 @@ time_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
312 } 312 }
313 313
314end: 314end:
315 if (val != CPUFREQ_RESUMECHANGE) 315 if (val != CPUFREQ_RESUMECHANGE && val != CPUFREQ_SUSPENDCHANGE)
316 write_sequnlock_irq(&xtime_lock); 316 write_sequnlock_irq(&xtime_lock);
317 317
318 return 0; 318 return 0;
diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c
index 2d22f5761b1d..0e498369f35e 100644
--- a/arch/i386/kernel/traps.c
+++ b/arch/i386/kernel/traps.c
@@ -130,9 +130,8 @@ static inline int print_addr_and_symbol(unsigned long addr, char *log_lvl,
130 print_symbol("%s", addr); 130 print_symbol("%s", addr);
131 131
132 printed = (printed + 1) % CONFIG_STACK_BACKTRACE_COLS; 132 printed = (printed + 1) % CONFIG_STACK_BACKTRACE_COLS;
133
134 if (printed) 133 if (printed)
135 printk(" "); 134 printk(" ");
136 else 135 else
137 printk("\n"); 136 printk("\n");
138 137
@@ -212,7 +211,6 @@ static void show_stack_log_lvl(struct task_struct *task, unsigned long *esp,
212 } 211 }
213 212
214 stack = esp; 213 stack = esp;
215 printk(log_lvl);
216 for(i = 0; i < kstack_depth_to_print; i++) { 214 for(i = 0; i < kstack_depth_to_print; i++) {
217 if (kstack_end(stack)) 215 if (kstack_end(stack))
218 break; 216 break;
diff --git a/arch/i386/kernel/vm86.c b/arch/i386/kernel/vm86.c
index aee14fafd13d..00e0118e717c 100644
--- a/arch/i386/kernel/vm86.c
+++ b/arch/i386/kernel/vm86.c
@@ -312,7 +312,7 @@ static void do_sys_vm86(struct kernel_vm86_struct *info, struct task_struct *tsk
312 312
313 /*call audit_syscall_exit since we do not exit via the normal paths */ 313 /*call audit_syscall_exit since we do not exit via the normal paths */
314 if (unlikely(current->audit_context)) 314 if (unlikely(current->audit_context))
315 audit_syscall_exit(current, AUDITSC_RESULT(eax), eax); 315 audit_syscall_exit(AUDITSC_RESULT(eax), eax);
316 316
317 __asm__ __volatile__( 317 __asm__ __volatile__(
318 "movl %0,%%esp\n\t" 318 "movl %0,%%esp\n\t"
diff --git a/arch/i386/mach-generic/probe.c b/arch/i386/mach-generic/probe.c
index cea5b3ce4b57..d55fa7b187ab 100644
--- a/arch/i386/mach-generic/probe.c
+++ b/arch/i386/mach-generic/probe.c
@@ -93,9 +93,11 @@ int __init mps_oem_check(struct mp_config_table *mpc, char *oem, char *productid
93 int i; 93 int i;
94 for (i = 0; apic_probe[i]; ++i) { 94 for (i = 0; apic_probe[i]; ++i) {
95 if (apic_probe[i]->mps_oem_check(mpc,oem,productid)) { 95 if (apic_probe[i]->mps_oem_check(mpc,oem,productid)) {
96 genapic = apic_probe[i]; 96 if (!cmdline_apic) {
97 printk(KERN_INFO "Switched to APIC driver `%s'.\n", 97 genapic = apic_probe[i];
98 genapic->name); 98 printk(KERN_INFO "Switched to APIC driver `%s'.\n",
99 genapic->name);
100 }
99 return 1; 101 return 1;
100 } 102 }
101 } 103 }
@@ -107,9 +109,11 @@ int __init acpi_madt_oem_check(char *oem_id, char *oem_table_id)
107 int i; 109 int i;
108 for (i = 0; apic_probe[i]; ++i) { 110 for (i = 0; apic_probe[i]; ++i) {
109 if (apic_probe[i]->acpi_madt_oem_check(oem_id, oem_table_id)) { 111 if (apic_probe[i]->acpi_madt_oem_check(oem_id, oem_table_id)) {
110 genapic = apic_probe[i]; 112 if (!cmdline_apic) {
111 printk(KERN_INFO "Switched to APIC driver `%s'.\n", 113 genapic = apic_probe[i];
112 genapic->name); 114 printk(KERN_INFO "Switched to APIC driver `%s'.\n",
115 genapic->name);
116 }
113 return 1; 117 return 1;
114 } 118 }
115 } 119 }
diff --git a/arch/i386/mach-voyager/voyager_cat.c b/arch/i386/mach-voyager/voyager_cat.c
index 3039539de51e..10d21df14531 100644
--- a/arch/i386/mach-voyager/voyager_cat.c
+++ b/arch/i386/mach-voyager/voyager_cat.c
@@ -120,7 +120,6 @@ static struct resource qic_res = {
120 * It writes num_bits of the data buffer in msg starting at start_bit. 120 * It writes num_bits of the data buffer in msg starting at start_bit.
121 * Note: This function assumes that any unused bit in the data stream 121 * Note: This function assumes that any unused bit in the data stream
122 * is set to zero so that the ors will work correctly */ 122 * is set to zero so that the ors will work correctly */
123#define BITS_PER_BYTE 8
124static void 123static void
125cat_pack(__u8 *msg, const __u16 start_bit, __u8 *data, const __u16 num_bits) 124cat_pack(__u8 *msg, const __u16 start_bit, __u8 *data, const __u16 num_bits)
126{ 125{
diff --git a/arch/i386/mm/init.c b/arch/i386/mm/init.c
index ae6534ad8161..3df1371d4520 100644
--- a/arch/i386/mm/init.c
+++ b/arch/i386/mm/init.c
@@ -651,7 +651,7 @@ void __init mem_init(void)
651 * Specifically, in the case of x86, we will always add 651 * Specifically, in the case of x86, we will always add
652 * memory to the highmem for now. 652 * memory to the highmem for now.
653 */ 653 */
654#ifdef CONFIG_HOTPLUG_MEMORY 654#ifdef CONFIG_MEMORY_HOTPLUG
655#ifndef CONFIG_NEED_MULTIPLE_NODES 655#ifndef CONFIG_NEED_MULTIPLE_NODES
656int add_memory(u64 start, u64 size) 656int add_memory(u64 start, u64 size)
657{ 657{
diff --git a/arch/i386/oprofile/nmi_int.c b/arch/i386/oprofile/nmi_int.c
index 1a2076ce6f6a..ec0fd3cfa774 100644
--- a/arch/i386/oprofile/nmi_int.c
+++ b/arch/i386/oprofile/nmi_int.c
@@ -332,10 +332,11 @@ static int __init ppro_init(char ** cpu_type)
332{ 332{
333 __u8 cpu_model = boot_cpu_data.x86_model; 333 __u8 cpu_model = boot_cpu_data.x86_model;
334 334
335 if (cpu_model > 0xd) 335 if (cpu_model == 14)
336 *cpu_type = "i386/core";
337 else if (cpu_model > 0xd)
336 return 0; 338 return 0;
337 339 else if (cpu_model == 9) {
338 if (cpu_model == 9) {
339 *cpu_type = "i386/p6_mobile"; 340 *cpu_type = "i386/p6_mobile";
340 } else if (cpu_model > 5) { 341 } else if (cpu_model > 5) {
341 *cpu_type = "i386/piii"; 342 *cpu_type = "i386/piii";
diff --git a/arch/i386/pci/irq.c b/arch/i386/pci/irq.c
index 3ca59cad05f3..06dab00aaadc 100644
--- a/arch/i386/pci/irq.c
+++ b/arch/i386/pci/irq.c
@@ -588,7 +588,9 @@ static __init int via_router_probe(struct irq_router *r,
588 case PCI_DEVICE_ID_VIA_82C596: 588 case PCI_DEVICE_ID_VIA_82C596:
589 case PCI_DEVICE_ID_VIA_82C686: 589 case PCI_DEVICE_ID_VIA_82C686:
590 case PCI_DEVICE_ID_VIA_8231: 590 case PCI_DEVICE_ID_VIA_8231:
591 case PCI_DEVICE_ID_VIA_8233A:
591 case PCI_DEVICE_ID_VIA_8235: 592 case PCI_DEVICE_ID_VIA_8235:
593 case PCI_DEVICE_ID_VIA_8237:
592 /* FIXME: add new ones for 8233/5 */ 594 /* FIXME: add new ones for 8233/5 */
593 r->name = "VIA"; 595 r->name = "VIA";
594 r->get = pirq_via_get; 596 r->get = pirq_via_get;
diff --git a/arch/i386/power/cpu.c b/arch/i386/power/cpu.c
index 50a0bef8c85f..79b2370c7fac 100644
--- a/arch/i386/power/cpu.c
+++ b/arch/i386/power/cpu.c
@@ -92,7 +92,7 @@ void __restore_processor_state(struct saved_context *ctxt)
92 write_cr4(ctxt->cr4); 92 write_cr4(ctxt->cr4);
93 write_cr3(ctxt->cr3); 93 write_cr3(ctxt->cr3);
94 write_cr2(ctxt->cr2); 94 write_cr2(ctxt->cr2);
95 write_cr2(ctxt->cr0); 95 write_cr0(ctxt->cr0);
96 96
97 /* 97 /*
98 * now restore the descriptor tables to their proper values 98 * now restore the descriptor tables to their proper values
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index 9f40eeff0b5c..0f3076a820c3 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -413,6 +413,8 @@ config IA64_PALINFO
413config SGI_SN 413config SGI_SN
414 def_bool y if (IA64_SGI_SN2 || IA64_GENERIC) 414 def_bool y if (IA64_SGI_SN2 || IA64_GENERIC)
415 415
416source "drivers/sn/Kconfig"
417
416source "drivers/firmware/Kconfig" 418source "drivers/firmware/Kconfig"
417 419
418source "fs/Kconfig.binfmt" 420source "fs/Kconfig.binfmt"
diff --git a/arch/ia64/configs/sn2_defconfig b/arch/ia64/configs/sn2_defconfig
index a718034d68d0..9ea35398e10d 100644
--- a/arch/ia64/configs/sn2_defconfig
+++ b/arch/ia64/configs/sn2_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc5 3# Linux kernel version: 2.6.17-rc3
4# Mon Feb 27 16:06:38 2006 4# Thu Apr 27 11:48:23 2006
5# 5#
6 6
7# 7#
@@ -24,6 +24,7 @@ CONFIG_SYSCTL=y
24# CONFIG_AUDIT is not set 24# CONFIG_AUDIT is not set
25# CONFIG_IKCONFIG is not set 25# CONFIG_IKCONFIG is not set
26CONFIG_CPUSETS=y 26CONFIG_CPUSETS=y
27CONFIG_RELAY=y
27CONFIG_INITRAMFS_SOURCE="" 28CONFIG_INITRAMFS_SOURCE=""
28CONFIG_CC_OPTIMIZE_FOR_SIZE=y 29CONFIG_CC_OPTIMIZE_FOR_SIZE=y
29# CONFIG_EMBEDDED is not set 30# CONFIG_EMBEDDED is not set
@@ -38,10 +39,6 @@ CONFIG_BASE_FULL=y
38CONFIG_FUTEX=y 39CONFIG_FUTEX=y
39CONFIG_EPOLL=y 40CONFIG_EPOLL=y
40CONFIG_SHMEM=y 41CONFIG_SHMEM=y
41CONFIG_CC_ALIGN_FUNCTIONS=0
42CONFIG_CC_ALIGN_LABELS=0
43CONFIG_CC_ALIGN_LOOPS=0
44CONFIG_CC_ALIGN_JUMPS=0
45CONFIG_SLAB=y 42CONFIG_SLAB=y
46# CONFIG_TINY_SHMEM is not set 43# CONFIG_TINY_SHMEM is not set
47CONFIG_BASE_SMALL=0 44CONFIG_BASE_SMALL=0
@@ -53,7 +50,6 @@ CONFIG_BASE_SMALL=0
53CONFIG_MODULES=y 50CONFIG_MODULES=y
54CONFIG_MODULE_UNLOAD=y 51CONFIG_MODULE_UNLOAD=y
55# CONFIG_MODULE_FORCE_UNLOAD is not set 52# CONFIG_MODULE_FORCE_UNLOAD is not set
56CONFIG_OBSOLETE_MODPARM=y
57# CONFIG_MODVERSIONS is not set 53# CONFIG_MODVERSIONS is not set
58# CONFIG_MODULE_SRCVERSION_ALL is not set 54# CONFIG_MODULE_SRCVERSION_ALL is not set
59CONFIG_KMOD=y 55CONFIG_KMOD=y
@@ -62,6 +58,7 @@ CONFIG_STOP_MACHINE=y
62# 58#
63# Block layer 59# Block layer
64# 60#
61# CONFIG_BLK_DEV_IO_TRACE is not set
65 62
66# 63#
67# IO Schedulers 64# IO Schedulers
@@ -84,8 +81,10 @@ CONFIG_64BIT=y
84CONFIG_MMU=y 81CONFIG_MMU=y
85CONFIG_SWIOTLB=y 82CONFIG_SWIOTLB=y
86CONFIG_RWSEM_XCHGADD_ALGORITHM=y 83CONFIG_RWSEM_XCHGADD_ALGORITHM=y
84CONFIG_GENERIC_FIND_NEXT_BIT=y
87CONFIG_GENERIC_CALIBRATE_DELAY=y 85CONFIG_GENERIC_CALIBRATE_DELAY=y
88CONFIG_TIME_INTERPOLATION=y 86CONFIG_TIME_INTERPOLATION=y
87CONFIG_DMI=y
89CONFIG_EFI=y 88CONFIG_EFI=y
90CONFIG_GENERIC_IOMAP=y 89CONFIG_GENERIC_IOMAP=y
91CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y 90CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
@@ -116,7 +115,6 @@ CONFIG_IA64_SGI_SN_XP=m
116CONFIG_FORCE_MAX_ZONEORDER=17 115CONFIG_FORCE_MAX_ZONEORDER=17
117CONFIG_SMP=y 116CONFIG_SMP=y
118CONFIG_NR_CPUS=1024 117CONFIG_NR_CPUS=1024
119CONFIG_IA64_NR_NODES=256
120# CONFIG_HOTPLUG_CPU is not set 118# CONFIG_HOTPLUG_CPU is not set
121CONFIG_SCHED_SMT=y 119CONFIG_SCHED_SMT=y
122CONFIG_PREEMPT=y 120CONFIG_PREEMPT=y
@@ -136,6 +134,7 @@ CONFIG_ARCH_FLATMEM_ENABLE=y
136CONFIG_ARCH_SPARSEMEM_ENABLE=y 134CONFIG_ARCH_SPARSEMEM_ENABLE=y
137CONFIG_ARCH_DISCONTIGMEM_DEFAULT=y 135CONFIG_ARCH_DISCONTIGMEM_DEFAULT=y
138CONFIG_NUMA=y 136CONFIG_NUMA=y
137CONFIG_NODES_SHIFT=10
139CONFIG_VIRTUAL_MEM_MAP=y 138CONFIG_VIRTUAL_MEM_MAP=y
140CONFIG_HOLES_IN_ZONE=y 139CONFIG_HOLES_IN_ZONE=y
141CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID=y 140CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID=y
@@ -187,7 +186,6 @@ CONFIG_ACPI_SYSTEM=y
187CONFIG_PCI=y 186CONFIG_PCI=y
188CONFIG_PCI_DOMAINS=y 187CONFIG_PCI_DOMAINS=y
189# CONFIG_PCI_MSI is not set 188# CONFIG_PCI_MSI is not set
190CONFIG_PCI_LEGACY_PROC=y
191# CONFIG_PCI_DEBUG is not set 189# CONFIG_PCI_DEBUG is not set
192 190
193# 191#
@@ -231,6 +229,7 @@ CONFIG_SYN_COOKIES=y
231# CONFIG_INET_AH is not set 229# CONFIG_INET_AH is not set
232# CONFIG_INET_ESP is not set 230# CONFIG_INET_ESP is not set
233# CONFIG_INET_IPCOMP is not set 231# CONFIG_INET_IPCOMP is not set
232# CONFIG_INET_XFRM_TUNNEL is not set
234# CONFIG_INET_TUNNEL is not set 233# CONFIG_INET_TUNNEL is not set
235CONFIG_INET_DIAG=m 234CONFIG_INET_DIAG=m
236CONFIG_INET_TCP_DIAG=m 235CONFIG_INET_TCP_DIAG=m
@@ -238,9 +237,11 @@ CONFIG_INET_TCP_DIAG=m
238CONFIG_TCP_CONG_BIC=y 237CONFIG_TCP_CONG_BIC=y
239CONFIG_IPV6=m 238CONFIG_IPV6=m
240# CONFIG_IPV6_PRIVACY is not set 239# CONFIG_IPV6_PRIVACY is not set
240# CONFIG_IPV6_ROUTER_PREF is not set
241# CONFIG_INET6_AH is not set 241# CONFIG_INET6_AH is not set
242# CONFIG_INET6_ESP is not set 242# CONFIG_INET6_ESP is not set
243# CONFIG_INET6_IPCOMP is not set 243# CONFIG_INET6_IPCOMP is not set
244# CONFIG_INET6_XFRM_TUNNEL is not set
244# CONFIG_INET6_TUNNEL is not set 245# CONFIG_INET6_TUNNEL is not set
245# CONFIG_IPV6_TUNNEL is not set 246# CONFIG_IPV6_TUNNEL is not set
246# CONFIG_NETFILTER is not set 247# CONFIG_NETFILTER is not set
@@ -468,9 +469,14 @@ CONFIG_SCSI_SATA_VITESSE=y
468# CONFIG_SCSI_INIA100 is not set 469# CONFIG_SCSI_INIA100 is not set
469# CONFIG_SCSI_SYM53C8XX_2 is not set 470# CONFIG_SCSI_SYM53C8XX_2 is not set
470# CONFIG_SCSI_IPR is not set 471# CONFIG_SCSI_IPR is not set
471# CONFIG_SCSI_QLOGIC_FC is not set
472CONFIG_SCSI_QLOGIC_1280=y 472CONFIG_SCSI_QLOGIC_1280=y
473# CONFIG_SCSI_QLA_FC is not set 473CONFIG_SCSI_QLA_FC=y
474CONFIG_SCSI_QLA2XXX_EMBEDDED_FIRMWARE=y
475# CONFIG_SCSI_QLA21XX is not set
476CONFIG_SCSI_QLA22XX=y
477CONFIG_SCSI_QLA2300=y
478CONFIG_SCSI_QLA2322=y
479# CONFIG_SCSI_QLA24XX is not set
474# CONFIG_SCSI_LPFC is not set 480# CONFIG_SCSI_LPFC is not set
475# CONFIG_SCSI_DC395x is not set 481# CONFIG_SCSI_DC395x is not set
476# CONFIG_SCSI_DC390T is not set 482# CONFIG_SCSI_DC390T is not set
@@ -486,6 +492,7 @@ CONFIG_MD_RAID0=y
486CONFIG_MD_RAID1=y 492CONFIG_MD_RAID1=y
487# CONFIG_MD_RAID10 is not set 493# CONFIG_MD_RAID10 is not set
488CONFIG_MD_RAID5=y 494CONFIG_MD_RAID5=y
495# CONFIG_MD_RAID5_RESHAPE is not set
489# CONFIG_MD_RAID6 is not set 496# CONFIG_MD_RAID6 is not set
490CONFIG_MD_MULTIPATH=y 497CONFIG_MD_MULTIPATH=y
491# CONFIG_MD_FAULTY is not set 498# CONFIG_MD_FAULTY is not set
@@ -694,6 +701,7 @@ CONFIG_EFI_RTC=y
694# Ftape, the floppy tape device driver 701# Ftape, the floppy tape device driver
695# 702#
696CONFIG_AGP=y 703CONFIG_AGP=y
704# CONFIG_AGP_VIA is not set
697CONFIG_AGP_SGI_TIOCA=y 705CONFIG_AGP_SGI_TIOCA=y
698# CONFIG_DRM is not set 706# CONFIG_DRM is not set
699CONFIG_RAW_DRIVER=m 707CONFIG_RAW_DRIVER=m
@@ -735,10 +743,6 @@ CONFIG_MMTIMER=y
735# 743#
736 744
737# 745#
738# Multimedia Capabilities Port drivers
739#
740
741#
742# Multimedia devices 746# Multimedia devices
743# 747#
744# CONFIG_VIDEO_DEV is not set 748# CONFIG_VIDEO_DEV is not set
@@ -747,6 +751,7 @@ CONFIG_MMTIMER=y
747# Digital Video Broadcasting Devices 751# Digital Video Broadcasting Devices
748# 752#
749# CONFIG_DVB is not set 753# CONFIG_DVB is not set
754# CONFIG_USB_DABUSB is not set
750 755
751# 756#
752# Graphics support 757# Graphics support
@@ -757,6 +762,7 @@ CONFIG_MMTIMER=y
757# Console display driver support 762# Console display driver support
758# 763#
759CONFIG_VGA_CONSOLE=y 764CONFIG_VGA_CONSOLE=y
765# CONFIG_VGACON_SOFT_SCROLLBACK is not set
760CONFIG_DUMMY_CONSOLE=y 766CONFIG_DUMMY_CONSOLE=y
761 767
762# 768#
@@ -769,6 +775,7 @@ CONFIG_DUMMY_CONSOLE=y
769# 775#
770CONFIG_USB_ARCH_HAS_HCD=y 776CONFIG_USB_ARCH_HAS_HCD=y
771CONFIG_USB_ARCH_HAS_OHCI=y 777CONFIG_USB_ARCH_HAS_OHCI=y
778CONFIG_USB_ARCH_HAS_EHCI=y
772CONFIG_USB=m 779CONFIG_USB=m
773# CONFIG_USB_DEBUG is not set 780# CONFIG_USB_DEBUG is not set
774 781
@@ -829,9 +836,7 @@ CONFIG_USB_HIDINPUT=y
829# CONFIG_USB_ACECAD is not set 836# CONFIG_USB_ACECAD is not set
830# CONFIG_USB_KBTAB is not set 837# CONFIG_USB_KBTAB is not set
831# CONFIG_USB_POWERMATE is not set 838# CONFIG_USB_POWERMATE is not set
832# CONFIG_USB_MTOUCH is not set 839# CONFIG_USB_TOUCHSCREEN is not set
833# CONFIG_USB_ITMTOUCH is not set
834# CONFIG_USB_EGALAX is not set
835# CONFIG_USB_YEALINK is not set 840# CONFIG_USB_YEALINK is not set
836# CONFIG_USB_XPAD is not set 841# CONFIG_USB_XPAD is not set
837# CONFIG_USB_ATI_REMOTE is not set 842# CONFIG_USB_ATI_REMOTE is not set
@@ -846,15 +851,6 @@ CONFIG_USB_HIDINPUT=y
846# CONFIG_USB_MICROTEK is not set 851# CONFIG_USB_MICROTEK is not set
847 852
848# 853#
849# USB Multimedia devices
850#
851# CONFIG_USB_DABUSB is not set
852
853#
854# Video4Linux support is needed for USB Multimedia device support
855#
856
857#
858# USB Network Adapters 854# USB Network Adapters
859# 855#
860# CONFIG_USB_CATC is not set 856# CONFIG_USB_CATC is not set
@@ -905,15 +901,29 @@ CONFIG_USB_MON=y
905# CONFIG_MMC is not set 901# CONFIG_MMC is not set
906 902
907# 903#
904# LED devices
905#
906# CONFIG_NEW_LEDS is not set
907
908#
909# LED drivers
910#
911
912#
913# LED Triggers
914#
915
916#
908# InfiniBand support 917# InfiniBand support
909# 918#
910CONFIG_INFINIBAND=m 919CONFIG_INFINIBAND=m
911# CONFIG_INFINIBAND_USER_MAD is not set 920# CONFIG_INFINIBAND_USER_MAD is not set
912CONFIG_INFINIBAND_USER_ACCESS=m 921CONFIG_INFINIBAND_USER_ACCESS=m
913CONFIG_INFINIBAND_MTHCA=m 922CONFIG_INFINIBAND_MTHCA=m
914# CONFIG_INFINIBAND_MTHCA_DEBUG is not set 923CONFIG_INFINIBAND_MTHCA_DEBUG=y
915CONFIG_INFINIBAND_IPOIB=m 924CONFIG_INFINIBAND_IPOIB=m
916# CONFIG_INFINIBAND_IPOIB_DEBUG is not set 925CONFIG_INFINIBAND_IPOIB_DEBUG=y
926# CONFIG_INFINIBAND_IPOIB_DEBUG_DATA is not set
917CONFIG_INFINIBAND_SRP=m 927CONFIG_INFINIBAND_SRP=m
918 928
919# 929#
@@ -923,8 +933,13 @@ CONFIG_SGI_IOC4=y
923CONFIG_SGI_IOC3=y 933CONFIG_SGI_IOC3=y
924 934
925# 935#
926# EDAC - error detection and reporting (RAS) 936# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
937#
938
939#
940# Real Time Clock
927# 941#
942# CONFIG_RTC_CLASS is not set
928 943
929# 944#
930# File systems 945# File systems
@@ -997,7 +1012,6 @@ CONFIG_TMPFS=y
997CONFIG_HUGETLBFS=y 1012CONFIG_HUGETLBFS=y
998CONFIG_HUGETLB_PAGE=y 1013CONFIG_HUGETLB_PAGE=y
999CONFIG_RAMFS=y 1014CONFIG_RAMFS=y
1000CONFIG_RELAYFS_FS=m
1001# CONFIG_CONFIGFS_FS is not set 1015# CONFIG_CONFIGFS_FS is not set
1002 1016
1003# 1017#
@@ -1145,7 +1159,7 @@ CONFIG_DETECT_SOFTLOCKUP=y
1145# CONFIG_SCHEDSTATS is not set 1159# CONFIG_SCHEDSTATS is not set
1146# CONFIG_DEBUG_SLAB is not set 1160# CONFIG_DEBUG_SLAB is not set
1147CONFIG_DEBUG_PREEMPT=y 1161CONFIG_DEBUG_PREEMPT=y
1148CONFIG_DEBUG_MUTEXES=y 1162# CONFIG_DEBUG_MUTEXES is not set
1149# CONFIG_DEBUG_SPINLOCK is not set 1163# CONFIG_DEBUG_SPINLOCK is not set
1150# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1164# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1151# CONFIG_DEBUG_KOBJECT is not set 1165# CONFIG_DEBUG_KOBJECT is not set
diff --git a/arch/ia64/ia32/binfmt_elf32.c b/arch/ia64/ia32/binfmt_elf32.c
index 4e7a6a1ec6c7..da03c06744f1 100644
--- a/arch/ia64/ia32/binfmt_elf32.c
+++ b/arch/ia64/ia32/binfmt_elf32.c
@@ -35,6 +35,9 @@ extern void ia64_elf32_init (struct pt_regs *regs);
35 35
36static void elf32_set_personality (void); 36static void elf32_set_personality (void);
37 37
38static unsigned long __attribute ((unused))
39randomize_stack_top(unsigned long stack_top);
40
38#define setup_arg_pages(bprm,tos,exec) ia32_setup_arg_pages(bprm,exec) 41#define setup_arg_pages(bprm,tos,exec) ia32_setup_arg_pages(bprm,exec)
39#define elf_map elf32_map 42#define elf_map elf32_map
40 43
diff --git a/arch/ia64/ia32/ia32_entry.S b/arch/ia64/ia32/ia32_entry.S
index 95fe04400f6b..a32cd59b81ed 100644
--- a/arch/ia64/ia32/ia32_entry.S
+++ b/arch/ia64/ia32/ia32_entry.S
@@ -334,7 +334,7 @@ ia32_syscall_table:
334 data8 sys_setdomainname 334 data8 sys_setdomainname
335 data8 sys32_newuname 335 data8 sys32_newuname
336 data8 sys32_modify_ldt 336 data8 sys32_modify_ldt
337 data8 sys_ni_syscall /* adjtimex */ 337 data8 compat_sys_adjtimex
338 data8 sys32_mprotect /* 125 */ 338 data8 sys32_mprotect /* 125 */
339 data8 compat_sys_sigprocmask 339 data8 compat_sys_sigprocmask
340 data8 sys_ni_syscall /* create_module */ 340 data8 sys_ni_syscall /* create_module */
diff --git a/arch/ia64/kernel/Makefile b/arch/ia64/kernel/Makefile
index 59e871dae742..09a0dbc17fb6 100644
--- a/arch/ia64/kernel/Makefile
+++ b/arch/ia64/kernel/Makefile
@@ -7,7 +7,7 @@ extra-y := head.o init_task.o vmlinux.lds
7obj-y := acpi.o entry.o efi.o efi_stub.o gate-data.o fsys.o ia64_ksyms.o irq.o irq_ia64.o \ 7obj-y := acpi.o entry.o efi.o efi_stub.o gate-data.o fsys.o ia64_ksyms.o irq.o irq_ia64.o \
8 irq_lsapic.o ivt.o machvec.o pal.o patch.o process.o perfmon.o ptrace.o sal.o \ 8 irq_lsapic.o ivt.o machvec.o pal.o patch.o process.o perfmon.o ptrace.o sal.o \
9 salinfo.o semaphore.o setup.o signal.o sys_ia64.o time.o traps.o unaligned.o \ 9 salinfo.o semaphore.o setup.o signal.o sys_ia64.o time.o traps.o unaligned.o \
10 unwind.o mca.o mca_asm.o topology.o dmi_scan.o 10 unwind.o mca.o mca_asm.o topology.o
11 11
12obj-$(CONFIG_IA64_BRL_EMU) += brl_emu.o 12obj-$(CONFIG_IA64_BRL_EMU) += brl_emu.o
13obj-$(CONFIG_IA64_GENERIC) += acpi-ext.o 13obj-$(CONFIG_IA64_GENERIC) += acpi-ext.o
@@ -30,7 +30,6 @@ obj-$(CONFIG_IA64_MCA_RECOVERY) += mca_recovery.o
30obj-$(CONFIG_KPROBES) += kprobes.o jprobes.o 30obj-$(CONFIG_KPROBES) += kprobes.o jprobes.o
31obj-$(CONFIG_IA64_UNCACHED_ALLOCATOR) += uncached.o 31obj-$(CONFIG_IA64_UNCACHED_ALLOCATOR) += uncached.o
32mca_recovery-y += mca_drv.o mca_drv_asm.o 32mca_recovery-y += mca_drv.o mca_drv_asm.o
33dmi_scan-y += ../../i386/kernel/dmi_scan.o
34 33
35# The gate DSO image is built using a special linker script. 34# The gate DSO image is built using a special linker script.
36targets += gate.so gate-syms.o 35targets += gate.so gate-syms.o
diff --git a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S
index 6e16f6b35bd3..bcb80ca5cf40 100644
--- a/arch/ia64/kernel/entry.S
+++ b/arch/ia64/kernel/entry.S
@@ -1609,5 +1609,7 @@ sys_call_table:
1609 data8 sys_set_robust_list 1609 data8 sys_set_robust_list
1610 data8 sys_get_robust_list 1610 data8 sys_get_robust_list
1611 data8 sys_sync_file_range // 1300 1611 data8 sys_sync_file_range // 1300
1612 data8 sys_tee
1613 data8 sys_vmsplice
1612 1614
1613 .org sys_call_table + 8*NR_syscalls // guard against failures to increase NR_syscalls 1615 .org sys_call_table + 8*NR_syscalls // guard against failures to increase NR_syscalls
diff --git a/arch/ia64/kernel/iosapic.c b/arch/ia64/kernel/iosapic.c
index 7956eb9058fc..d58c1c5c903a 100644
--- a/arch/ia64/kernel/iosapic.c
+++ b/arch/ia64/kernel/iosapic.c
@@ -416,7 +416,7 @@ iosapic_end_level_irq (unsigned int irq)
416 ia64_vector vec = irq_to_vector(irq); 416 ia64_vector vec = irq_to_vector(irq);
417 struct iosapic_rte_info *rte; 417 struct iosapic_rte_info *rte;
418 418
419 move_irq(irq); 419 move_native_irq(irq);
420 list_for_each_entry(rte, &iosapic_intr_info[vec].rtes, rte_list) 420 list_for_each_entry(rte, &iosapic_intr_info[vec].rtes, rte_list)
421 iosapic_eoi(rte->addr, vec); 421 iosapic_eoi(rte->addr, vec);
422} 422}
@@ -458,7 +458,7 @@ iosapic_ack_edge_irq (unsigned int irq)
458{ 458{
459 irq_desc_t *idesc = irq_descp(irq); 459 irq_desc_t *idesc = irq_descp(irq);
460 460
461 move_irq(irq); 461 move_native_irq(irq);
462 /* 462 /*
463 * Once we have recorded IRQ_PENDING already, we can mask the 463 * Once we have recorded IRQ_PENDING already, we can mask the
464 * interrupt for real. This prevents IRQ storms from unhandled 464 * interrupt for real. This prevents IRQ storms from unhandled
diff --git a/arch/ia64/kernel/irq.c b/arch/ia64/kernel/irq.c
index 5ce908ef9c95..9c72ea3f6432 100644
--- a/arch/ia64/kernel/irq.c
+++ b/arch/ia64/kernel/irq.c
@@ -101,7 +101,6 @@ void set_irq_affinity_info (unsigned int irq, int hwid, int redir)
101 101
102 if (irq < NR_IRQS) { 102 if (irq < NR_IRQS) {
103 irq_affinity[irq] = mask; 103 irq_affinity[irq] = mask;
104 set_irq_info(irq, mask);
105 irq_redir[irq] = (char) (redir & 0xff); 104 irq_redir[irq] = (char) (redir & 0xff);
106 } 105 }
107} 106}
diff --git a/arch/ia64/kernel/kprobes.c b/arch/ia64/kernel/kprobes.c
index 789881ca83d4..f9039f88d01d 100644
--- a/arch/ia64/kernel/kprobes.c
+++ b/arch/ia64/kernel/kprobes.c
@@ -251,7 +251,7 @@ static void __kprobes prepare_break_inst(uint template, uint slot,
251 update_kprobe_inst_flag(template, slot, major_opcode, kprobe_inst, p); 251 update_kprobe_inst_flag(template, slot, major_opcode, kprobe_inst, p);
252} 252}
253 253
254static inline void get_kprobe_inst(bundle_t *bundle, uint slot, 254static void __kprobes get_kprobe_inst(bundle_t *bundle, uint slot,
255 unsigned long *kprobe_inst, uint *major_opcode) 255 unsigned long *kprobe_inst, uint *major_opcode)
256{ 256{
257 unsigned long kprobe_inst_p0, kprobe_inst_p1; 257 unsigned long kprobe_inst_p0, kprobe_inst_p1;
@@ -278,7 +278,7 @@ static inline void get_kprobe_inst(bundle_t *bundle, uint slot,
278} 278}
279 279
280/* Returns non-zero if the addr is in the Interrupt Vector Table */ 280/* Returns non-zero if the addr is in the Interrupt Vector Table */
281static inline int in_ivt_functions(unsigned long addr) 281static int __kprobes in_ivt_functions(unsigned long addr)
282{ 282{
283 return (addr >= (unsigned long)__start_ivt_text 283 return (addr >= (unsigned long)__start_ivt_text
284 && addr < (unsigned long)__end_ivt_text); 284 && addr < (unsigned long)__end_ivt_text);
@@ -308,19 +308,19 @@ static int __kprobes valid_kprobe_addr(int template, int slot,
308 return 0; 308 return 0;
309} 309}
310 310
311static inline void save_previous_kprobe(struct kprobe_ctlblk *kcb) 311static void __kprobes save_previous_kprobe(struct kprobe_ctlblk *kcb)
312{ 312{
313 kcb->prev_kprobe.kp = kprobe_running(); 313 kcb->prev_kprobe.kp = kprobe_running();
314 kcb->prev_kprobe.status = kcb->kprobe_status; 314 kcb->prev_kprobe.status = kcb->kprobe_status;
315} 315}
316 316
317static inline void restore_previous_kprobe(struct kprobe_ctlblk *kcb) 317static void __kprobes restore_previous_kprobe(struct kprobe_ctlblk *kcb)
318{ 318{
319 __get_cpu_var(current_kprobe) = kcb->prev_kprobe.kp; 319 __get_cpu_var(current_kprobe) = kcb->prev_kprobe.kp;
320 kcb->kprobe_status = kcb->prev_kprobe.status; 320 kcb->kprobe_status = kcb->prev_kprobe.status;
321} 321}
322 322
323static inline void set_current_kprobe(struct kprobe *p, 323static void __kprobes set_current_kprobe(struct kprobe *p,
324 struct kprobe_ctlblk *kcb) 324 struct kprobe_ctlblk *kcb)
325{ 325{
326 __get_cpu_var(current_kprobe) = p; 326 __get_cpu_var(current_kprobe) = p;
diff --git a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c
index 5e6fdbe78bcd..6a0880639bc9 100644
--- a/arch/ia64/kernel/mca.c
+++ b/arch/ia64/kernel/mca.c
@@ -963,7 +963,7 @@ no_mod:
963 */ 963 */
964 964
965static void 965static void
966ia64_wait_for_slaves(int monarch) 966ia64_wait_for_slaves(int monarch, const char *type)
967{ 967{
968 int c, wait = 0, missing = 0; 968 int c, wait = 0, missing = 0;
969 for_each_online_cpu(c) { 969 for_each_online_cpu(c) {
@@ -989,7 +989,7 @@ ia64_wait_for_slaves(int monarch)
989 } 989 }
990 if (!missing) 990 if (!missing)
991 goto all_in; 991 goto all_in;
992 printk(KERN_INFO "OS MCA slave did not rendezvous on cpu"); 992 printk(KERN_INFO "OS %s slave did not rendezvous on cpu", type);
993 for_each_online_cpu(c) { 993 for_each_online_cpu(c) {
994 if (c == monarch) 994 if (c == monarch)
995 continue; 995 continue;
@@ -1000,7 +1000,7 @@ ia64_wait_for_slaves(int monarch)
1000 return; 1000 return;
1001 1001
1002all_in: 1002all_in:
1003 printk(KERN_INFO "All OS MCA slaves have reached rendezvous\n"); 1003 printk(KERN_INFO "All OS %s slaves have reached rendezvous\n", type);
1004 return; 1004 return;
1005} 1005}
1006 1006
@@ -1038,7 +1038,7 @@ ia64_mca_handler(struct pt_regs *regs, struct switch_stack *sw,
1038 if (notify_die(DIE_MCA_MONARCH_ENTER, "MCA", regs, (long)&nd, 0, 0) 1038 if (notify_die(DIE_MCA_MONARCH_ENTER, "MCA", regs, (long)&nd, 0, 0)
1039 == NOTIFY_STOP) 1039 == NOTIFY_STOP)
1040 ia64_mca_spin(__FUNCTION__); 1040 ia64_mca_spin(__FUNCTION__);
1041 ia64_wait_for_slaves(cpu); 1041 ia64_wait_for_slaves(cpu, "MCA");
1042 1042
1043 /* Wakeup all the processors which are spinning in the rendezvous loop. 1043 /* Wakeup all the processors which are spinning in the rendezvous loop.
1044 * They will leave SAL, then spin in the OS with interrupts disabled 1044 * They will leave SAL, then spin in the OS with interrupts disabled
@@ -1429,7 +1429,7 @@ ia64_init_handler(struct pt_regs *regs, struct switch_stack *sw,
1429 */ 1429 */
1430 printk("Delaying for 5 seconds...\n"); 1430 printk("Delaying for 5 seconds...\n");
1431 udelay(5*1000000); 1431 udelay(5*1000000);
1432 ia64_wait_for_slaves(cpu); 1432 ia64_wait_for_slaves(cpu, "INIT");
1433 /* If nobody intercepts DIE_INIT_MONARCH_PROCESS then we drop through 1433 /* If nobody intercepts DIE_INIT_MONARCH_PROCESS then we drop through
1434 * to default_monarch_init_process() above and just print all the 1434 * to default_monarch_init_process() above and just print all the
1435 * tasks. 1435 * tasks.
diff --git a/arch/ia64/kernel/mca_drv.c b/arch/ia64/kernel/mca_drv.c
index 37c88eb55873..ca6666b51ccb 100644
--- a/arch/ia64/kernel/mca_drv.c
+++ b/arch/ia64/kernel/mca_drv.c
@@ -62,6 +62,11 @@ typedef enum {
62 ISOLATE_NONE 62 ISOLATE_NONE
63} isolate_status_t; 63} isolate_status_t;
64 64
65typedef enum {
66 MCA_NOT_RECOVERED = 0,
67 MCA_RECOVERED = 1
68} recovery_status_t;
69
65/* 70/*
66 * This pool keeps pointers to the section part of SAL error record 71 * This pool keeps pointers to the section part of SAL error record
67 */ 72 */
@@ -71,6 +76,18 @@ static struct {
71 int max_idx; /* Maximum index of section pointer list pool */ 76 int max_idx; /* Maximum index of section pointer list pool */
72} slidx_pool; 77} slidx_pool;
73 78
79static int
80fatal_mca(const char *fmt, ...)
81{
82 va_list args;
83
84 va_start(args, fmt);
85 vprintk(fmt, args);
86 va_end(args);
87
88 return MCA_NOT_RECOVERED;
89}
90
74/** 91/**
75 * mca_page_isolate - isolate a poisoned page in order not to use it later 92 * mca_page_isolate - isolate a poisoned page in order not to use it later
76 * @paddr: poisoned memory location 93 * @paddr: poisoned memory location
@@ -424,7 +441,7 @@ recover_from_read_error(slidx_table_t *slidx,
424 441
425 /* Is target address valid? */ 442 /* Is target address valid? */
426 if (!pbci->tv) 443 if (!pbci->tv)
427 return 0; 444 return fatal_mca(KERN_ALERT "MCA: target address not valid\n");
428 445
429 /* 446 /*
430 * cpu read or memory-mapped io read 447 * cpu read or memory-mapped io read
@@ -442,7 +459,7 @@ recover_from_read_error(slidx_table_t *slidx,
442 459
443 /* Is minstate valid? */ 460 /* Is minstate valid? */
444 if (!peidx_bottom(peidx) || !(peidx_bottom(peidx)->valid.minstate)) 461 if (!peidx_bottom(peidx) || !(peidx_bottom(peidx)->valid.minstate))
445 return 0; 462 return fatal_mca(KERN_ALERT "MCA: minstate not valid\n");
446 psr1 =(struct ia64_psr *)&(peidx_minstate_area(peidx)->pmsa_ipsr); 463 psr1 =(struct ia64_psr *)&(peidx_minstate_area(peidx)->pmsa_ipsr);
447 psr2 =(struct ia64_psr *)&(peidx_minstate_area(peidx)->pmsa_xpsr); 464 psr2 =(struct ia64_psr *)&(peidx_minstate_area(peidx)->pmsa_xpsr);
448 465
@@ -476,12 +493,13 @@ recover_from_read_error(slidx_table_t *slidx,
476 psr2->bn = 1; 493 psr2->bn = 1;
477 psr2->i = 0; 494 psr2->i = 0;
478 495
479 return 1; 496 return MCA_RECOVERED;
480 } 497 }
481 498
482 } 499 }
483 500
484 return 0; 501 return fatal_mca(KERN_ALERT "MCA: kernel context not recovered,"
502 " iip 0x%lx\n", pmsa->pmsa_iip);
485} 503}
486 504
487/** 505/**
@@ -567,13 +585,13 @@ recover_from_processor_error(int platform, slidx_table_t *slidx,
567 * The machine check is corrected. 585 * The machine check is corrected.
568 */ 586 */
569 if (psp->cm == 1) 587 if (psp->cm == 1)
570 return 1; 588 return MCA_RECOVERED;
571 589
572 /* 590 /*
573 * The error was not contained. Software must be reset. 591 * The error was not contained. Software must be reset.
574 */ 592 */
575 if (psp->us || psp->ci == 0) 593 if (psp->us || psp->ci == 0)
576 return 0; 594 return fatal_mca(KERN_ALERT "MCA: error not contained\n");
577 595
578 /* 596 /*
579 * The cache check and bus check bits have four possible states 597 * The cache check and bus check bits have four possible states
@@ -584,20 +602,22 @@ recover_from_processor_error(int platform, slidx_table_t *slidx,
584 * 1 1 Memory error, attempt recovery 602 * 1 1 Memory error, attempt recovery
585 */ 603 */
586 if (psp->bc == 0 || pbci == NULL) 604 if (psp->bc == 0 || pbci == NULL)
587 return 0; 605 return fatal_mca(KERN_ALERT "MCA: No bus check\n");
588 606
589 /* 607 /*
590 * Sorry, we cannot handle so many. 608 * Sorry, we cannot handle so many.
591 */ 609 */
592 if (peidx_bus_check_num(peidx) > 1) 610 if (peidx_bus_check_num(peidx) > 1)
593 return 0; 611 return fatal_mca(KERN_ALERT "MCA: Too many bus checks\n");
594 /* 612 /*
595 * Well, here is only one bus error. 613 * Well, here is only one bus error.
596 */ 614 */
597 if (pbci->ib || pbci->cc) 615 if (pbci->ib)
598 return 0; 616 return fatal_mca(KERN_ALERT "MCA: Internal Bus error\n");
617 if (pbci->cc)
618 return fatal_mca(KERN_ALERT "MCA: Cache-cache error\n");
599 if (pbci->eb && pbci->bsi > 0) 619 if (pbci->eb && pbci->bsi > 0)
600 return 0; 620 return fatal_mca(KERN_ALERT "MCA: External bus check fatal status\n");
601 621
602 /* 622 /*
603 * This is a local MCA and estimated as recoverble external bus error. 623 * This is a local MCA and estimated as recoverble external bus error.
@@ -609,7 +629,7 @@ recover_from_processor_error(int platform, slidx_table_t *slidx,
609 /* 629 /*
610 * On account of strange SAL error record, we cannot recover. 630 * On account of strange SAL error record, we cannot recover.
611 */ 631 */
612 return 0; 632 return fatal_mca(KERN_ALERT "MCA: Strange SAL record\n");
613} 633}
614 634
615/** 635/**
@@ -638,12 +658,10 @@ mca_try_to_recover(void *rec, struct ia64_sal_os_state *sos)
638 658
639 /* Now, OS can recover when there is one processor error section */ 659 /* Now, OS can recover when there is one processor error section */
640 if (n_proc_err > 1) 660 if (n_proc_err > 1)
641 return 0; 661 return fatal_mca(KERN_ALERT "MCA: Too Many Errors\n");
642 else if (n_proc_err == 0) { 662 else if (n_proc_err == 0)
643 /* Weird SAL record ... We need not to recover */ 663 /* Weird SAL record ... We need not to recover */
644 664 return fatal_mca(KERN_ALERT "MCA: Weird SAL record\n");
645 return 1;
646 }
647 665
648 /* Make index of processor error section */ 666 /* Make index of processor error section */
649 mca_make_peidx((sal_log_processor_info_t*) 667 mca_make_peidx((sal_log_processor_info_t*)
@@ -654,7 +672,7 @@ mca_try_to_recover(void *rec, struct ia64_sal_os_state *sos)
654 672
655 /* Check whether MCA is global or not */ 673 /* Check whether MCA is global or not */
656 if (is_mca_global(&peidx, &pbci, sos)) 674 if (is_mca_global(&peidx, &pbci, sos))
657 return 0; 675 return fatal_mca(KERN_ALERT "MCA: global MCA\n");
658 676
659 /* Try to recover a processor error */ 677 /* Try to recover a processor error */
660 return recover_from_processor_error(platform_err, &slidx, &peidx, 678 return recover_from_processor_error(platform_err, &slidx, &peidx,
diff --git a/arch/ia64/kernel/palinfo.c b/arch/ia64/kernel/palinfo.c
index 6386f63c413e..859fb37ff49b 100644
--- a/arch/ia64/kernel/palinfo.c
+++ b/arch/ia64/kernel/palinfo.c
@@ -959,7 +959,7 @@ remove_palinfo_proc_entries(unsigned int hcpu)
959 } 959 }
960} 960}
961 961
962static int __devinit palinfo_cpu_callback(struct notifier_block *nfb, 962static int palinfo_cpu_callback(struct notifier_block *nfb,
963 unsigned long action, 963 unsigned long action,
964 void *hcpu) 964 void *hcpu)
965{ 965{
diff --git a/arch/ia64/kernel/ptrace.c b/arch/ia64/kernel/ptrace.c
index 9887c8787e7a..e61e15e28d8b 100644
--- a/arch/ia64/kernel/ptrace.c
+++ b/arch/ia64/kernel/ptrace.c
@@ -1644,7 +1644,7 @@ syscall_trace_enter (long arg0, long arg1, long arg2, long arg3,
1644 arch = AUDIT_ARCH_IA64; 1644 arch = AUDIT_ARCH_IA64;
1645 } 1645 }
1646 1646
1647 audit_syscall_entry(current, arch, syscall, arg0, arg1, arg2, arg3); 1647 audit_syscall_entry(arch, syscall, arg0, arg1, arg2, arg3);
1648 } 1648 }
1649 1649
1650} 1650}
@@ -1662,7 +1662,7 @@ syscall_trace_leave (long arg0, long arg1, long arg2, long arg3,
1662 1662
1663 if (success != AUDITSC_SUCCESS) 1663 if (success != AUDITSC_SUCCESS)
1664 result = -result; 1664 result = -result;
1665 audit_syscall_exit(current, success, result); 1665 audit_syscall_exit(success, result);
1666 } 1666 }
1667 1667
1668 if (test_thread_flag(TIF_SYSCALL_TRACE) 1668 if (test_thread_flag(TIF_SYSCALL_TRACE)
diff --git a/arch/ia64/kernel/salinfo.c b/arch/ia64/kernel/salinfo.c
index 9d5a823479a3..663a186ad194 100644
--- a/arch/ia64/kernel/salinfo.c
+++ b/arch/ia64/kernel/salinfo.c
@@ -572,7 +572,7 @@ static struct file_operations salinfo_data_fops = {
572}; 572};
573 573
574#ifdef CONFIG_HOTPLUG_CPU 574#ifdef CONFIG_HOTPLUG_CPU
575static int __devinit 575static int
576salinfo_cpu_callback(struct notifier_block *nb, unsigned long action, void *hcpu) 576salinfo_cpu_callback(struct notifier_block *nb, unsigned long action, void *hcpu)
577{ 577{
578 unsigned int i, cpu = (unsigned long)hcpu; 578 unsigned int i, cpu = (unsigned long)hcpu;
diff --git a/arch/ia64/kernel/topology.c b/arch/ia64/kernel/topology.c
index b47476d655f1..4f3a16b37f8f 100644
--- a/arch/ia64/kernel/topology.c
+++ b/arch/ia64/kernel/topology.c
@@ -305,13 +305,10 @@ static struct kobj_type cache_ktype_percpu_entry = {
305 305
306static void __cpuinit cpu_cache_sysfs_exit(unsigned int cpu) 306static void __cpuinit cpu_cache_sysfs_exit(unsigned int cpu)
307{ 307{
308 if (all_cpu_cache_info[cpu].cache_leaves) { 308 kfree(all_cpu_cache_info[cpu].cache_leaves);
309 kfree(all_cpu_cache_info[cpu].cache_leaves); 309 all_cpu_cache_info[cpu].cache_leaves = NULL;
310 all_cpu_cache_info[cpu].cache_leaves = NULL;
311 }
312 all_cpu_cache_info[cpu].num_cache_leaves = 0; 310 all_cpu_cache_info[cpu].num_cache_leaves = 0;
313 memset(&all_cpu_cache_info[cpu].kobj, 0, sizeof(struct kobject)); 311 memset(&all_cpu_cache_info[cpu].kobj, 0, sizeof(struct kobject));
314
315 return; 312 return;
316} 313}
317 314
@@ -429,7 +426,7 @@ static int __cpuinit cache_remove_dev(struct sys_device * sys_dev)
429 * When a cpu is hot-plugged, do a check and initiate 426 * When a cpu is hot-plugged, do a check and initiate
430 * cache kobject if necessary 427 * cache kobject if necessary
431 */ 428 */
432static int __cpuinit cache_cpu_callback(struct notifier_block *nfb, 429static int cache_cpu_callback(struct notifier_block *nfb,
433 unsigned long action, void *hcpu) 430 unsigned long action, void *hcpu)
434{ 431{
435 unsigned int cpu = (unsigned long)hcpu; 432 unsigned int cpu = (unsigned long)hcpu;
diff --git a/arch/ia64/lib/memcpy_mck.S b/arch/ia64/lib/memcpy_mck.S
index 46c9331e7ab5..9e534d52b1d5 100644
--- a/arch/ia64/lib/memcpy_mck.S
+++ b/arch/ia64/lib/memcpy_mck.S
@@ -6,7 +6,9 @@
6 * in1: source address 6 * in1: source address
7 * in2: number of bytes to copy 7 * in2: number of bytes to copy
8 * Output: 8 * Output:
9 * 0 if success, or number of byte NOT copied if error occurred. 9 * for memcpy: return dest
10 * for copy_user: return 0 if success,
11 * or number of byte NOT copied if error occurred.
10 * 12 *
11 * Copyright (C) 2002 Intel Corp. 13 * Copyright (C) 2002 Intel Corp.
12 * Copyright (C) 2002 Ken Chen <kenneth.w.chen@intel.com> 14 * Copyright (C) 2002 Ken Chen <kenneth.w.chen@intel.com>
@@ -73,6 +75,7 @@ GLOBAL_ENTRY(memcpy)
73 and r28=0x7,in0 75 and r28=0x7,in0
74 and r29=0x7,in1 76 and r29=0x7,in1
75 mov f6=f0 77 mov f6=f0
78 mov retval=in0
76 br.cond.sptk .common_code 79 br.cond.sptk .common_code
77 ;; 80 ;;
78END(memcpy) 81END(memcpy)
@@ -84,7 +87,7 @@ GLOBAL_ENTRY(__copy_user)
84 mov f6=f1 87 mov f6=f1
85 mov saved_in0=in0 // save dest pointer 88 mov saved_in0=in0 // save dest pointer
86 mov saved_in1=in1 // save src pointer 89 mov saved_in1=in1 // save src pointer
87 mov saved_in2=in2 // save len 90 mov retval=r0 // initialize return value
88 ;; 91 ;;
89.common_code: 92.common_code:
90 cmp.gt p15,p0=8,in2 // check for small size 93 cmp.gt p15,p0=8,in2 // check for small size
@@ -92,7 +95,7 @@ GLOBAL_ENTRY(__copy_user)
92 cmp.ne p14,p0=0,r29 // check src alignment 95 cmp.ne p14,p0=0,r29 // check src alignment
93 add src0=0,in1 96 add src0=0,in1
94 sub r30=8,r28 // for .align_dest 97 sub r30=8,r28 // for .align_dest
95 mov retval=r0 // initialize return value 98 mov saved_in2=in2 // save len
96 ;; 99 ;;
97 add dst0=0,in0 100 add dst0=0,in0
98 add dst1=1,in0 // dest odd index 101 add dst1=1,in0 // dest odd index
diff --git a/arch/ia64/mm/discontig.c b/arch/ia64/mm/discontig.c
index ec9eeb89975d..b6bcc9fa3603 100644
--- a/arch/ia64/mm/discontig.c
+++ b/arch/ia64/mm/discontig.c
@@ -519,6 +519,68 @@ void __cpuinit *per_cpu_init(void)
519} 519}
520#endif /* CONFIG_SMP */ 520#endif /* CONFIG_SMP */
521 521
522#ifdef CONFIG_VIRTUAL_MEM_MAP
523static inline int find_next_valid_pfn_for_pgdat(pg_data_t *pgdat, int i)
524{
525 unsigned long end_address, hole_next_pfn;
526 unsigned long stop_address;
527
528 end_address = (unsigned long) &vmem_map[pgdat->node_start_pfn + i];
529 end_address = PAGE_ALIGN(end_address);
530
531 stop_address = (unsigned long) &vmem_map[
532 pgdat->node_start_pfn + pgdat->node_spanned_pages];
533
534 do {
535 pgd_t *pgd;
536 pud_t *pud;
537 pmd_t *pmd;
538 pte_t *pte;
539
540 pgd = pgd_offset_k(end_address);
541 if (pgd_none(*pgd)) {
542 end_address += PGDIR_SIZE;
543 continue;
544 }
545
546 pud = pud_offset(pgd, end_address);
547 if (pud_none(*pud)) {
548 end_address += PUD_SIZE;
549 continue;
550 }
551
552 pmd = pmd_offset(pud, end_address);
553 if (pmd_none(*pmd)) {
554 end_address += PMD_SIZE;
555 continue;
556 }
557
558 pte = pte_offset_kernel(pmd, end_address);
559retry_pte:
560 if (pte_none(*pte)) {
561 end_address += PAGE_SIZE;
562 pte++;
563 if ((end_address < stop_address) &&
564 (end_address != ALIGN(end_address, 1UL << PMD_SHIFT)))
565 goto retry_pte;
566 continue;
567 }
568 /* Found next valid vmem_map page */
569 break;
570 } while (end_address < stop_address);
571
572 end_address = min(end_address, stop_address);
573 end_address = end_address - (unsigned long) vmem_map + sizeof(struct page) - 1;
574 hole_next_pfn = end_address / sizeof(struct page);
575 return hole_next_pfn - pgdat->node_start_pfn;
576}
577#else
578static inline int find_next_valid_pfn_for_pgdat(pg_data_t *pgdat, int i)
579{
580 return i + 1;
581}
582#endif
583
522/** 584/**
523 * show_mem - give short summary of memory stats 585 * show_mem - give short summary of memory stats
524 * 586 *
@@ -547,8 +609,10 @@ void show_mem(void)
547 struct page *page; 609 struct page *page;
548 if (pfn_valid(pgdat->node_start_pfn + i)) 610 if (pfn_valid(pgdat->node_start_pfn + i))
549 page = pfn_to_page(pgdat->node_start_pfn + i); 611 page = pfn_to_page(pgdat->node_start_pfn + i);
550 else 612 else {
613 i = find_next_valid_pfn_for_pgdat(pgdat, i) - 1;
551 continue; 614 continue;
615 }
552 if (PageReserved(page)) 616 if (PageReserved(page))
553 reserved++; 617 reserved++;
554 else if (PageSwapCache(page)) 618 else if (PageSwapCache(page))
diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c
index 9ba32b2d96d0..ab829a22f8a4 100644
--- a/arch/ia64/pci/pci.c
+++ b/arch/ia64/pci/pci.c
@@ -31,7 +31,6 @@
31#include <asm/irq.h> 31#include <asm/irq.h>
32#include <asm/hw_irq.h> 32#include <asm/hw_irq.h>
33 33
34
35/* 34/*
36 * Low-level SAL-based PCI configuration access functions. Note that SAL 35 * Low-level SAL-based PCI configuration access functions. Note that SAL
37 * calls are already serialized (via sal_lock), so we don't need another 36 * calls are already serialized (via sal_lock), so we don't need another
@@ -707,7 +706,7 @@ int ia64_pci_legacy_read(struct pci_bus *bus, u16 port, u32 *val, u8 size)
707 * 706 *
708 * Simply writes @size bytes of @val to @port. 707 * Simply writes @size bytes of @val to @port.
709 */ 708 */
710int ia64_pci_legacy_write(struct pci_dev *bus, u16 port, u32 val, u8 size) 709int ia64_pci_legacy_write(struct pci_bus *bus, u16 port, u32 val, u8 size)
711{ 710{
712 int ret = size; 711 int ret = size;
713 712
diff --git a/arch/ia64/sn/kernel/sn2/sn_hwperf.c b/arch/ia64/sn/kernel/sn2/sn_hwperf.c
index d917afa30b27..739c948dc504 100644
--- a/arch/ia64/sn/kernel/sn2/sn_hwperf.c
+++ b/arch/ia64/sn/kernel/sn2/sn_hwperf.c
@@ -284,6 +284,8 @@ static int sn_hwperf_get_nearest_node_objdata(struct sn_hwperf_object_info *objb
284 /* find nearest node with cpus and nearest memory */ 284 /* find nearest node with cpus and nearest memory */
285 for (router=NULL, j=0; j < op->ports; j++) { 285 for (router=NULL, j=0; j < op->ports; j++) {
286 dest = sn_hwperf_findobj_id(objbuf, nobj, ptdata[j].conn_id); 286 dest = sn_hwperf_findobj_id(objbuf, nobj, ptdata[j].conn_id);
287 if (dest && SN_HWPERF_IS_ROUTER(dest))
288 router = dest;
287 if (!dest || SN_HWPERF_FOREIGN(dest) || 289 if (!dest || SN_HWPERF_FOREIGN(dest) ||
288 !SN_HWPERF_IS_NODE(dest) || SN_HWPERF_IS_IONODE(dest)) { 290 !SN_HWPERF_IS_NODE(dest) || SN_HWPERF_IS_IONODE(dest)) {
289 continue; 291 continue;
@@ -299,8 +301,6 @@ static int sn_hwperf_get_nearest_node_objdata(struct sn_hwperf_object_info *objb
299 *near_mem_node = c; 301 *near_mem_node = c;
300 found_mem++; 302 found_mem++;
301 } 303 }
302 if (SN_HWPERF_IS_ROUTER(dest))
303 router = dest;
304 } 304 }
305 305
306 if (router && (!found_cpu || !found_mem)) { 306 if (router && (!found_cpu || !found_mem)) {
@@ -493,7 +493,7 @@ static int sn_topology_show(struct seq_file *s, void *d)
493 * numalink ports 493 * numalink ports
494 */ 494 */
495 sz = obj->ports * sizeof(struct sn_hwperf_port_info); 495 sz = obj->ports * sizeof(struct sn_hwperf_port_info);
496 if ((ptdata = vmalloc(sz)) == NULL) 496 if ((ptdata = kmalloc(sz, GFP_KERNEL)) == NULL)
497 return -ENOMEM; 497 return -ENOMEM;
498 e = ia64_sn_hwperf_op(sn_hwperf_master_nasid, 498 e = ia64_sn_hwperf_op(sn_hwperf_master_nasid,
499 SN_HWPERF_ENUM_PORTS, obj->id, sz, 499 SN_HWPERF_ENUM_PORTS, obj->id, sz,
@@ -541,7 +541,7 @@ static int sn_topology_show(struct seq_file *s, void *d)
541 (SN_HWPERF_IS_NL3ROUTER(obj) || 541 (SN_HWPERF_IS_NL3ROUTER(obj) ||
542 SN_HWPERF_IS_NL3ROUTER(p)) ? "LLP3" : "LLP4"); 542 SN_HWPERF_IS_NL3ROUTER(p)) ? "LLP3" : "LLP4");
543 } 543 }
544 vfree(ptdata); 544 kfree(ptdata);
545 } 545 }
546 546
547 return 0; 547 return 0;
diff --git a/arch/ia64/sn/kernel/xpc_partition.c b/arch/ia64/sn/kernel/xpc_partition.c
index 94211429fd0c..2a89cfce4954 100644
--- a/arch/ia64/sn/kernel/xpc_partition.c
+++ b/arch/ia64/sn/kernel/xpc_partition.c
@@ -136,9 +136,7 @@ xpc_get_rsvd_page_pa(int nasid)
136 } 136 }
137 137
138 if (L1_CACHE_ALIGN(len) > buf_len) { 138 if (L1_CACHE_ALIGN(len) > buf_len) {
139 if (buf_base != NULL) { 139 kfree(buf_base);
140 kfree(buf_base);
141 }
142 buf_len = L1_CACHE_ALIGN(len); 140 buf_len = L1_CACHE_ALIGN(len);
143 buf = (u64) xpc_kmalloc_cacheline_aligned(buf_len, 141 buf = (u64) xpc_kmalloc_cacheline_aligned(buf_len,
144 GFP_KERNEL, &buf_base); 142 GFP_KERNEL, &buf_base);
@@ -159,9 +157,7 @@ xpc_get_rsvd_page_pa(int nasid)
159 } 157 }
160 } 158 }
161 159
162 if (buf_base != NULL) { 160 kfree(buf_base);
163 kfree(buf_base);
164 }
165 161
166 if (status != SALRET_OK) { 162 if (status != SALRET_OK) {
167 rp_pa = 0; 163 rp_pa = 0;
diff --git a/arch/ia64/sn/pci/tioce_provider.c b/arch/ia64/sn/pci/tioce_provider.c
index fa073cc4b565..833295624e5d 100644
--- a/arch/ia64/sn/pci/tioce_provider.c
+++ b/arch/ia64/sn/pci/tioce_provider.c
@@ -682,9 +682,6 @@ tioce_reserve_m32(struct tioce_kernel *ce_kern, u64 base, u64 limit)
682 int ate_index, last_ate, ps; 682 int ate_index, last_ate, ps;
683 struct tioce *ce_mmr; 683 struct tioce *ce_mmr;
684 684
685 if (!TIOCE_M32_ADDR(base))
686 return;
687
688 ce_mmr = (struct tioce *)ce_kern->ce_common->ce_pcibus.bs_base; 685 ce_mmr = (struct tioce *)ce_kern->ce_common->ce_pcibus.bs_base;
689 ps = ce_kern->ce_ate3240_pagesize; 686 ps = ce_kern->ce_ate3240_pagesize;
690 ate_index = ATE_PAGE(base, ps); 687 ate_index = ATE_PAGE(base, ps);
@@ -693,6 +690,9 @@ tioce_reserve_m32(struct tioce_kernel *ce_kern, u64 base, u64 limit)
693 if (ate_index < 64) 690 if (ate_index < 64)
694 ate_index = 64; 691 ate_index = 64;
695 692
693 if (last_ate >= TIOCE_NUM_M3240_ATES)
694 last_ate = TIOCE_NUM_M3240_ATES - 1;
695
696 while (ate_index <= last_ate) { 696 while (ate_index <= last_ate) {
697 u64 ate; 697 u64 ate;
698 698
diff --git a/arch/m32r/kernel/entry.S b/arch/m32r/kernel/entry.S
index 3871b65f0c82..920bb742b7a2 100644
--- a/arch/m32r/kernel/entry.S
+++ b/arch/m32r/kernel/entry.S
@@ -20,7 +20,7 @@
20 * Stack layout in 'ret_from_system_call': 20 * Stack layout in 'ret_from_system_call':
21 * ptrace needs to have all regs on the stack. 21 * ptrace needs to have all regs on the stack.
22 * if the order here is changed, it needs to be 22 * if the order here is changed, it needs to be
23 * updated in fork.c:copy_process, signal.c:do_signal, 23 * updated in fork.c:copy_thread, signal.c:do_signal,
24 * ptrace.c and ptrace.h 24 * ptrace.c and ptrace.h
25 * 25 *
26 * M32Rx/M32R2 M32R 26 * M32Rx/M32R2 M32R
@@ -41,18 +41,17 @@
41 * @(0x38,sp) - syscall_nr ditto 41 * @(0x38,sp) - syscall_nr ditto
42 * @(0x3c,sp) - acc0h @(0x3c,sp) - acch 42 * @(0x3c,sp) - acc0h @(0x3c,sp) - acch
43 * @(0x40,sp) - acc0l @(0x40,sp) - accl 43 * @(0x40,sp) - acc0l @(0x40,sp) - accl
44 * @(0x44,sp) - acc1h @(0x44,sp) - psw 44 * @(0x44,sp) - acc1h @(0x44,sp) - dummy_acc1h
45 * @(0x48,sp) - acc1l @(0x48,sp) - bpc 45 * @(0x48,sp) - acc1l @(0x48,sp) - dummy_acc1l
46 * @(0x4c,sp) - psw @(0x4c,sp) - bbpsw 46 * @(0x4c,sp) - psw ditto
47 * @(0x50,sp) - bpc @(0x50,sp) - bbpc 47 * @(0x50,sp) - bpc ditto
48 * @(0x54,sp) - bbpsw @(0x54,sp) - spu (cr3) 48 * @(0x54,sp) - bbpsw ditto
49 * @(0x58,sp) - bbpc @(0x58,sp) - fp (r13) 49 * @(0x58,sp) - bbpc ditto
50 * @(0x5c,sp) - spu (cr3) @(0x5c,sp) - lr (r14) 50 * @(0x5c,sp) - spu (cr3) ditto
51 * @(0x60,sp) - fp (r13) @(0x60,sp) - spi (cr12) 51 * @(0x60,sp) - fp (r13) ditto
52 * @(0x64,sp) - lr (r14) @(0x64,sp) - orig_r0 52 * @(0x64,sp) - lr (r14) ditto
53 * @(0x68,sp) - spi (cr2) 53 * @(0x68,sp) - spi (cr2) ditto
54 * @(0x6c,sp) - orig_r0 54 * @(0x6c,sp) - orig_r0 ditto
55 *
56 */ 55 */
57 56
58#include <linux/config.h> 57#include <linux/config.h>
@@ -102,6 +101,12 @@
102#define ACC0L(reg) @(0x40,reg) 101#define ACC0L(reg) @(0x40,reg)
103#define ACC1H(reg) @(0x44,reg) 102#define ACC1H(reg) @(0x44,reg)
104#define ACC1L(reg) @(0x48,reg) 103#define ACC1L(reg) @(0x48,reg)
104#elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R)
105#define ACCH(reg) @(0x3C,reg)
106#define ACCL(reg) @(0x40,reg)
107#else
108#error unknown isa configuration
109#endif
105#define PSW(reg) @(0x4C,reg) 110#define PSW(reg) @(0x4C,reg)
106#define BPC(reg) @(0x50,reg) 111#define BPC(reg) @(0x50,reg)
107#define BBPSW(reg) @(0x54,reg) 112#define BBPSW(reg) @(0x54,reg)
@@ -111,21 +116,6 @@
111#define LR(reg) @(0x64,reg) 116#define LR(reg) @(0x64,reg)
112#define SP(reg) @(0x68,reg) 117#define SP(reg) @(0x68,reg)
113#define ORIG_R0(reg) @(0x6C,reg) 118#define ORIG_R0(reg) @(0x6C,reg)
114#elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R)
115#define ACCH(reg) @(0x3C,reg)
116#define ACCL(reg) @(0x40,reg)
117#define PSW(reg) @(0x44,reg)
118#define BPC(reg) @(0x48,reg)
119#define BBPSW(reg) @(0x4C,reg)
120#define BBPC(reg) @(0x50,reg)
121#define SPU(reg) @(0x54,reg)
122#define FP(reg) @(0x58,reg) /* FP = R13 */
123#define LR(reg) @(0x5C,reg)
124#define SP(reg) @(0x60,reg)
125#define ORIG_R0(reg) @(0x64,reg)
126#else
127#error unknown isa configuration
128#endif
129 119
130CF_MASK = 0x00000001 120CF_MASK = 0x00000001
131TF_MASK = 0x00000100 121TF_MASK = 0x00000100
@@ -142,7 +132,7 @@ VM_MASK = 0x00020000
142#endif 132#endif
143 133
144ENTRY(ret_from_fork) 134ENTRY(ret_from_fork)
145 ld r0, @sp+ 135 pop r0
146 bl schedule_tail 136 bl schedule_tail
147 GET_THREAD_INFO(r8) 137 GET_THREAD_INFO(r8)
148 bra syscall_exit 138 bra syscall_exit
@@ -231,7 +221,7 @@ restore_all:
231 RESTORE_ALL 221 RESTORE_ALL
232 222
233 # perform work that needs to be done immediately before resumption 223 # perform work that needs to be done immediately before resumption
234 # r9 : frags 224 # r9 : flags
235 ALIGN 225 ALIGN
236work_pending: 226work_pending:
237 and3 r4, r9, #_TIF_NEED_RESCHED 227 and3 r4, r9, #_TIF_NEED_RESCHED
@@ -320,7 +310,7 @@ ENTRY(ei_handler)
320; GET_ICU_STATUS; 310; GET_ICU_STATUS;
321 seth r0, #shigh(M32R_ICU_ISTS_ADDR) 311 seth r0, #shigh(M32R_ICU_ISTS_ADDR)
322 ld r0, @(low(M32R_ICU_ISTS_ADDR),r0) 312 ld r0, @(low(M32R_ICU_ISTS_ADDR),r0)
323 st r0, @-sp 313 push r0
324#if defined(CONFIG_SMP) 314#if defined(CONFIG_SMP)
325 /* 315 /*
326 * If IRQ == 0 --> Nothing to do, Not write IMASK 316 * If IRQ == 0 --> Nothing to do, Not write IMASK
@@ -557,7 +547,7 @@ check_end:
557#endif /* CONFIG_PLAT_M32104UT */ 547#endif /* CONFIG_PLAT_M32104UT */
558 bl do_IRQ 548 bl do_IRQ
559#endif /* CONFIG_SMP */ 549#endif /* CONFIG_SMP */
560 ld r14, @sp+ 550 pop r14
561 seth r0, #shigh(M32R_ICU_IMASK_ADDR) 551 seth r0, #shigh(M32R_ICU_IMASK_ADDR)
562 st r14, @(low(M32R_ICU_IMASK_ADDR),r0) 552 st r14, @(low(M32R_ICU_IMASK_ADDR),r0)
563#else 553#else
@@ -1015,4 +1005,3 @@ ENTRY(sys_call_table)
1015 .long sys_waitid 1005 .long sys_waitid
1016 1006
1017syscall_table_size=(.-sys_call_table) 1007syscall_table_size=(.-sys_call_table)
1018
diff --git a/arch/m32r/kernel/process.c b/arch/m32r/kernel/process.c
index 5dfc7ea45cf7..065f5e719058 100644
--- a/arch/m32r/kernel/process.c
+++ b/arch/m32r/kernel/process.c
@@ -116,6 +116,10 @@ void cpu_idle (void)
116 116
117void machine_restart(char *__unused) 117void machine_restart(char *__unused)
118{ 118{
119#if defined(CONFIG_PLAT_MAPPI3)
120 outw(1, (unsigned long)PLD_REBOOT);
121#endif
122
119 printk("Please push reset button!\n"); 123 printk("Please push reset button!\n");
120 while (1) 124 while (1)
121 cpu_relax(); 125 cpu_relax();
diff --git a/arch/m32r/kernel/signal.c b/arch/m32r/kernel/signal.c
index cb33097fefc4..6498ee70bb73 100644
--- a/arch/m32r/kernel/signal.c
+++ b/arch/m32r/kernel/signal.c
@@ -118,6 +118,8 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc,
118#elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R) 118#elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R)
119 COPY(acch); 119 COPY(acch);
120 COPY(accl); 120 COPY(accl);
121 COPY(dummy_acc1h);
122 COPY(dummy_acc1l);
121#else 123#else
122#error unknown isa configuration 124#error unknown isa configuration
123#endif 125#endif
@@ -203,6 +205,8 @@ setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs,
203#elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R) 205#elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R)
204 COPY(acch); 206 COPY(acch);
205 COPY(accl); 207 COPY(accl);
208 COPY(dummy_acc1h);
209 COPY(dummy_acc1l);
206#else 210#else
207#error unknown isa configuration 211#error unknown isa configuration
208#endif 212#endif
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 7aec60d40420..e8ff09fe73d9 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -13,7 +13,7 @@ choice
13 default SGI_IP22 13 default SGI_IP22
14 14
15config MIPS_MTX1 15config MIPS_MTX1
16 bool "Support for 4G Systems MTX-1 board" 16 bool "4G Systems MTX-1 board"
17 select DMA_NONCOHERENT 17 select DMA_NONCOHERENT
18 select HW_HAS_PCI 18 select HW_HAS_PCI
19 select SOC_AU1500 19 select SOC_AU1500
@@ -120,7 +120,7 @@ config MIPS_MIRAGE
120 select SYS_SUPPORTS_LITTLE_ENDIAN 120 select SYS_SUPPORTS_LITTLE_ENDIAN
121 121
122config MIPS_COBALT 122config MIPS_COBALT
123 bool "Support for Cobalt Server" 123 bool "Cobalt Server"
124 select DMA_NONCOHERENT 124 select DMA_NONCOHERENT
125 select HW_HAS_PCI 125 select HW_HAS_PCI
126 select I8259 126 select I8259
@@ -132,7 +132,7 @@ config MIPS_COBALT
132 select SYS_SUPPORTS_LITTLE_ENDIAN 132 select SYS_SUPPORTS_LITTLE_ENDIAN
133 133
134config MACH_DECSTATION 134config MACH_DECSTATION
135 bool "Support for DECstations" 135 bool "DECstations"
136 select BOOT_ELF32 136 select BOOT_ELF32
137 select DMA_NONCOHERENT 137 select DMA_NONCOHERENT
138 select EARLY_PRINTK 138 select EARLY_PRINTK
@@ -158,7 +158,7 @@ config MACH_DECSTATION
158 otherwise choose R3000. 158 otherwise choose R3000.
159 159
160config MIPS_EV64120 160config MIPS_EV64120
161 bool "Support for Galileo EV64120 Evaluation board (EXPERIMENTAL)" 161 bool "Galileo EV64120 Evaluation board (EXPERIMENTAL)"
162 depends on EXPERIMENTAL 162 depends on EXPERIMENTAL
163 select DMA_NONCOHERENT 163 select DMA_NONCOHERENT
164 select HW_HAS_PCI 164 select HW_HAS_PCI
@@ -175,7 +175,7 @@ config MIPS_EV64120
175 kernel for this platform. 175 kernel for this platform.
176 176
177config MIPS_EV96100 177config MIPS_EV96100
178 bool "Support for Galileo EV96100 Evaluation board (EXPERIMENTAL)" 178 bool "Galileo EV96100 Evaluation board (EXPERIMENTAL)"
179 depends on EXPERIMENTAL 179 depends on EXPERIMENTAL
180 select DMA_NONCOHERENT 180 select DMA_NONCOHERENT
181 select HW_HAS_PCI 181 select HW_HAS_PCI
@@ -195,7 +195,7 @@ config MIPS_EV96100
195 here if you wish to build a kernel for this platform. 195 here if you wish to build a kernel for this platform.
196 196
197config MIPS_IVR 197config MIPS_IVR
198 bool "Support for Globespan IVR board" 198 bool "Globespan IVR board"
199 select DMA_NONCOHERENT 199 select DMA_NONCOHERENT
200 select HW_HAS_PCI 200 select HW_HAS_PCI
201 select ITE_BOARD_GEN 201 select ITE_BOARD_GEN
@@ -211,7 +211,7 @@ config MIPS_IVR
211 build a kernel for this platform. 211 build a kernel for this platform.
212 212
213config MIPS_ITE8172 213config MIPS_ITE8172
214 bool "Support for ITE 8172G board" 214 bool "ITE 8172G board"
215 select DMA_NONCOHERENT 215 select DMA_NONCOHERENT
216 select HW_HAS_PCI 216 select HW_HAS_PCI
217 select ITE_BOARD_GEN 217 select ITE_BOARD_GEN
@@ -228,7 +228,7 @@ config MIPS_ITE8172
228 a kernel for this platform. 228 a kernel for this platform.
229 229
230config MACH_JAZZ 230config MACH_JAZZ
231 bool "Support for the Jazz family of machines" 231 bool "Jazz family of machines"
232 select ARC 232 select ARC
233 select ARC32 233 select ARC32
234 select ARCH_MAY_HAVE_PC_FDC 234 select ARCH_MAY_HAVE_PC_FDC
@@ -246,7 +246,7 @@ config MACH_JAZZ
246 Olivetti M700-10 workstations. 246 Olivetti M700-10 workstations.
247 247
248config LASAT 248config LASAT
249 bool "Support for LASAT Networks platforms" 249 bool "LASAT Networks platforms"
250 select DMA_NONCOHERENT 250 select DMA_NONCOHERENT
251 select HW_HAS_PCI 251 select HW_HAS_PCI
252 select MIPS_GT64120 252 select MIPS_GT64120
@@ -258,7 +258,7 @@ config LASAT
258 select SYS_SUPPORTS_LITTLE_ENDIAN 258 select SYS_SUPPORTS_LITTLE_ENDIAN
259 259
260config MIPS_ATLAS 260config MIPS_ATLAS
261 bool "Support for MIPS Atlas board" 261 bool "MIPS Atlas board"
262 select BOOT_ELF32 262 select BOOT_ELF32
263 select DMA_NONCOHERENT 263 select DMA_NONCOHERENT
264 select IRQ_CPU 264 select IRQ_CPU
@@ -283,7 +283,7 @@ config MIPS_ATLAS
283 board. 283 board.
284 284
285config MIPS_MALTA 285config MIPS_MALTA
286 bool "Support for MIPS Malta board" 286 bool "MIPS Malta board"
287 select ARCH_MAY_HAVE_PC_FDC 287 select ARCH_MAY_HAVE_PC_FDC
288 select BOOT_ELF32 288 select BOOT_ELF32
289 select HAVE_STD_PC_SERIAL_PORT 289 select HAVE_STD_PC_SERIAL_PORT
@@ -311,7 +311,7 @@ config MIPS_MALTA
311 board. 311 board.
312 312
313config MIPS_SEAD 313config MIPS_SEAD
314 bool "Support for MIPS SEAD board (EXPERIMENTAL)" 314 bool "MIPS SEAD board (EXPERIMENTAL)"
315 depends on EXPERIMENTAL 315 depends on EXPERIMENTAL
316 select IRQ_CPU 316 select IRQ_CPU
317 select DMA_NONCOHERENT 317 select DMA_NONCOHERENT
@@ -328,7 +328,7 @@ config MIPS_SEAD
328 board. 328 board.
329 329
330config MIPS_SIM 330config MIPS_SIM
331 bool 'Support for MIPS simulator (MIPSsim)' 331 bool 'MIPS simulator (MIPSsim)'
332 select DMA_NONCOHERENT 332 select DMA_NONCOHERENT
333 select IRQ_CPU 333 select IRQ_CPU
334 select SYS_HAS_CPU_MIPS32_R1 334 select SYS_HAS_CPU_MIPS32_R1
@@ -341,7 +341,7 @@ config MIPS_SIM
341 emulator. 341 emulator.
342 342
343config MOMENCO_JAGUAR_ATX 343config MOMENCO_JAGUAR_ATX
344 bool "Support for Momentum Jaguar board" 344 bool "Momentum Jaguar board"
345 select BOOT_ELF32 345 select BOOT_ELF32
346 select DMA_NONCOHERENT 346 select DMA_NONCOHERENT
347 select HW_HAS_PCI 347 select HW_HAS_PCI
@@ -361,7 +361,7 @@ config MOMENCO_JAGUAR_ATX
361 Momentum Computer <http://www.momenco.com/>. 361 Momentum Computer <http://www.momenco.com/>.
362 362
363config MOMENCO_OCELOT 363config MOMENCO_OCELOT
364 bool "Support for Momentum Ocelot board" 364 bool "Momentum Ocelot board"
365 select DMA_NONCOHERENT 365 select DMA_NONCOHERENT
366 select HW_HAS_PCI 366 select HW_HAS_PCI
367 select IRQ_CPU 367 select IRQ_CPU
@@ -378,7 +378,7 @@ config MOMENCO_OCELOT
378 Momentum Computer <http://www.momenco.com/>. 378 Momentum Computer <http://www.momenco.com/>.
379 379
380config MOMENCO_OCELOT_3 380config MOMENCO_OCELOT_3
381 bool "Support for Momentum Ocelot-3 board" 381 bool "Momentum Ocelot-3 board"
382 select BOOT_ELF32 382 select BOOT_ELF32
383 select DMA_NONCOHERENT 383 select DMA_NONCOHERENT
384 select HW_HAS_PCI 384 select HW_HAS_PCI
@@ -397,7 +397,7 @@ config MOMENCO_OCELOT_3
397 PMC-Sierra Rm79000 core. 397 PMC-Sierra Rm79000 core.
398 398
399config MOMENCO_OCELOT_C 399config MOMENCO_OCELOT_C
400 bool "Support for Momentum Ocelot-C board" 400 bool "Momentum Ocelot-C board"
401 select DMA_NONCOHERENT 401 select DMA_NONCOHERENT
402 select HW_HAS_PCI 402 select HW_HAS_PCI
403 select IRQ_CPU 403 select IRQ_CPU
@@ -414,7 +414,7 @@ config MOMENCO_OCELOT_C
414 Momentum Computer <http://www.momenco.com/>. 414 Momentum Computer <http://www.momenco.com/>.
415 415
416config MOMENCO_OCELOT_G 416config MOMENCO_OCELOT_G
417 bool "Support for Momentum Ocelot-G board" 417 bool "Momentum Ocelot-G board"
418 select DMA_NONCOHERENT 418 select DMA_NONCOHERENT
419 select HW_HAS_PCI 419 select HW_HAS_PCI
420 select IRQ_CPU 420 select IRQ_CPU
@@ -431,23 +431,23 @@ config MOMENCO_OCELOT_G
431 Momentum Computer <http://www.momenco.com/>. 431 Momentum Computer <http://www.momenco.com/>.
432 432
433config MIPS_XXS1500 433config MIPS_XXS1500
434 bool "Support for MyCable XXS1500 board" 434 bool "MyCable XXS1500 board"
435 select DMA_NONCOHERENT 435 select DMA_NONCOHERENT
436 select SOC_AU1500 436 select SOC_AU1500
437 select SYS_SUPPORTS_LITTLE_ENDIAN 437 select SYS_SUPPORTS_LITTLE_ENDIAN
438 438
439config PNX8550_V2PCI 439config PNX8550_V2PCI
440 bool "Support for Philips PNX8550 based Viper2-PCI board" 440 bool "Philips PNX8550 based Viper2-PCI board"
441 select PNX8550 441 select PNX8550
442 select SYS_SUPPORTS_LITTLE_ENDIAN 442 select SYS_SUPPORTS_LITTLE_ENDIAN
443 443
444config PNX8550_JBS 444config PNX8550_JBS
445 bool "Support for Philips PNX8550 based JBS board" 445 bool "Philips PNX8550 based JBS board"
446 select PNX8550 446 select PNX8550
447 select SYS_SUPPORTS_LITTLE_ENDIAN 447 select SYS_SUPPORTS_LITTLE_ENDIAN
448 448
449config DDB5074 449config DDB5074
450 bool "Support for NEC DDB Vrc-5074 (EXPERIMENTAL)" 450 bool "NEC DDB Vrc-5074 (EXPERIMENTAL)"
451 depends on EXPERIMENTAL 451 depends on EXPERIMENTAL
452 select DDB5XXX_COMMON 452 select DDB5XXX_COMMON
453 select DMA_NONCOHERENT 453 select DMA_NONCOHERENT
@@ -465,7 +465,7 @@ config DDB5074
465 evaluation board. 465 evaluation board.
466 466
467config DDB5476 467config DDB5476
468 bool "Support for NEC DDB Vrc-5476" 468 bool "NEC DDB Vrc-5476"
469 select DDB5XXX_COMMON 469 select DDB5XXX_COMMON
470 select DMA_NONCOHERENT 470 select DMA_NONCOHERENT
471 select HAVE_STD_PC_SERIAL_PORT 471 select HAVE_STD_PC_SERIAL_PORT
@@ -486,7 +486,7 @@ config DDB5476
486 IDE controller, PS2 keyboard, PS2 mouse, etc. 486 IDE controller, PS2 keyboard, PS2 mouse, etc.
487 487
488config DDB5477 488config DDB5477
489 bool "Support for NEC DDB Vrc-5477" 489 bool "NEC DDB Vrc-5477"
490 select DDB5XXX_COMMON 490 select DDB5XXX_COMMON
491 select DMA_NONCOHERENT 491 select DMA_NONCOHERENT
492 select HW_HAS_PCI 492 select HW_HAS_PCI
@@ -504,13 +504,13 @@ config DDB5477
504 ether port USB, AC97, PCI, etc. 504 ether port USB, AC97, PCI, etc.
505 505
506config MACH_VR41XX 506config MACH_VR41XX
507 bool "Support for NEC VR4100 series based machines" 507 bool "NEC VR41XX-based machines"
508 select SYS_HAS_CPU_VR41XX 508 select SYS_HAS_CPU_VR41XX
509 select SYS_SUPPORTS_32BIT_KERNEL 509 select SYS_SUPPORTS_32BIT_KERNEL
510 select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL 510 select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL
511 511
512config PMC_YOSEMITE 512config PMC_YOSEMITE
513 bool "Support for PMC-Sierra Yosemite eval board" 513 bool "PMC-Sierra Yosemite eval board"
514 select DMA_COHERENT 514 select DMA_COHERENT
515 select HW_HAS_PCI 515 select HW_HAS_PCI
516 select IRQ_CPU 516 select IRQ_CPU
@@ -527,7 +527,7 @@ config PMC_YOSEMITE
527 manufactured by PMC-Sierra. 527 manufactured by PMC-Sierra.
528 528
529config QEMU 529config QEMU
530 bool "Support for Qemu" 530 bool "Qemu"
531 select DMA_COHERENT 531 select DMA_COHERENT
532 select GENERIC_ISA_DMA 532 select GENERIC_ISA_DMA
533 select HAVE_STD_PC_SERIAL_PORT 533 select HAVE_STD_PC_SERIAL_PORT
@@ -547,7 +547,7 @@ config QEMU
547 can be found at http://www.linux-mips.org/wiki/Qemu. 547 can be found at http://www.linux-mips.org/wiki/Qemu.
548 548
549config SGI_IP22 549config SGI_IP22
550 bool "Support for SGI IP22 (Indy/Indigo2)" 550 bool "SGI IP22 (Indy/Indigo2)"
551 select ARC 551 select ARC
552 select ARC32 552 select ARC32
553 select BOOT_ELF32 553 select BOOT_ELF32
@@ -567,7 +567,7 @@ config SGI_IP22
567 that runs on these, say Y here. 567 that runs on these, say Y here.
568 568
569config SGI_IP27 569config SGI_IP27
570 bool "Support for SGI IP27 (Origin200/2000)" 570 bool "SGI IP27 (Origin200/2000)"
571 select ARC 571 select ARC
572 select ARC64 572 select ARC64
573 select BOOT_ELF64 573 select BOOT_ELF64
@@ -583,7 +583,7 @@ config SGI_IP27
583 here. 583 here.
584 584
585config SGI_IP32 585config SGI_IP32
586 bool "Support for SGI IP32 (O2) (EXPERIMENTAL)" 586 bool "SGI IP32 (O2) (EXPERIMENTAL)"
587 depends on EXPERIMENTAL 587 depends on EXPERIMENTAL
588 select ARC 588 select ARC
589 select ARC32 589 select ARC32
@@ -604,7 +604,7 @@ config SGI_IP32
604 If you want this kernel to run on SGI O2 workstation, say Y here. 604 If you want this kernel to run on SGI O2 workstation, say Y here.
605 605
606config SIBYTE_BIGSUR 606config SIBYTE_BIGSUR
607 bool "Support for Sibyte BCM91480B-BigSur" 607 bool "Sibyte BCM91480B-BigSur"
608 select BOOT_ELF32 608 select BOOT_ELF32
609 select DMA_COHERENT 609 select DMA_COHERENT
610 select PCI_DOMAINS 610 select PCI_DOMAINS
@@ -615,7 +615,7 @@ config SIBYTE_BIGSUR
615 select SYS_SUPPORTS_LITTLE_ENDIAN 615 select SYS_SUPPORTS_LITTLE_ENDIAN
616 616
617config SIBYTE_SWARM 617config SIBYTE_SWARM
618 bool "Support for Sibyte BCM91250A-SWARM" 618 bool "Sibyte BCM91250A-SWARM"
619 select BOOT_ELF32 619 select BOOT_ELF32
620 select DMA_COHERENT 620 select DMA_COHERENT
621 select SIBYTE_SB1250 621 select SIBYTE_SB1250
@@ -626,7 +626,7 @@ config SIBYTE_SWARM
626 select SYS_SUPPORTS_LITTLE_ENDIAN 626 select SYS_SUPPORTS_LITTLE_ENDIAN
627 627
628config SIBYTE_SENTOSA 628config SIBYTE_SENTOSA
629 bool "Support for Sibyte BCM91250E-Sentosa" 629 bool "Sibyte BCM91250E-Sentosa"
630 depends on EXPERIMENTAL 630 depends on EXPERIMENTAL
631 select BOOT_ELF32 631 select BOOT_ELF32
632 select DMA_COHERENT 632 select DMA_COHERENT
@@ -637,7 +637,7 @@ config SIBYTE_SENTOSA
637 select SYS_SUPPORTS_LITTLE_ENDIAN 637 select SYS_SUPPORTS_LITTLE_ENDIAN
638 638
639config SIBYTE_RHONE 639config SIBYTE_RHONE
640 bool "Support for Sibyte BCM91125E-Rhone" 640 bool "Sibyte BCM91125E-Rhone"
641 depends on EXPERIMENTAL 641 depends on EXPERIMENTAL
642 select BOOT_ELF32 642 select BOOT_ELF32
643 select DMA_COHERENT 643 select DMA_COHERENT
@@ -648,7 +648,7 @@ config SIBYTE_RHONE
648 select SYS_SUPPORTS_LITTLE_ENDIAN 648 select SYS_SUPPORTS_LITTLE_ENDIAN
649 649
650config SIBYTE_CARMEL 650config SIBYTE_CARMEL
651 bool "Support for Sibyte BCM91120x-Carmel" 651 bool "Sibyte BCM91120x-Carmel"
652 depends on EXPERIMENTAL 652 depends on EXPERIMENTAL
653 select BOOT_ELF32 653 select BOOT_ELF32
654 select DMA_COHERENT 654 select DMA_COHERENT
@@ -659,7 +659,7 @@ config SIBYTE_CARMEL
659 select SYS_SUPPORTS_LITTLE_ENDIAN 659 select SYS_SUPPORTS_LITTLE_ENDIAN
660 660
661config SIBYTE_PTSWARM 661config SIBYTE_PTSWARM
662 bool "Support for Sibyte BCM91250PT-PTSWARM" 662 bool "Sibyte BCM91250PT-PTSWARM"
663 depends on EXPERIMENTAL 663 depends on EXPERIMENTAL
664 select BOOT_ELF32 664 select BOOT_ELF32
665 select DMA_COHERENT 665 select DMA_COHERENT
@@ -671,7 +671,7 @@ config SIBYTE_PTSWARM
671 select SYS_SUPPORTS_LITTLE_ENDIAN 671 select SYS_SUPPORTS_LITTLE_ENDIAN
672 672
673config SIBYTE_LITTLESUR 673config SIBYTE_LITTLESUR
674 bool "Support for Sibyte BCM91250C2-LittleSur" 674 bool "Sibyte BCM91250C2-LittleSur"
675 depends on EXPERIMENTAL 675 depends on EXPERIMENTAL
676 select BOOT_ELF32 676 select BOOT_ELF32
677 select DMA_COHERENT 677 select DMA_COHERENT
@@ -683,7 +683,7 @@ config SIBYTE_LITTLESUR
683 select SYS_SUPPORTS_LITTLE_ENDIAN 683 select SYS_SUPPORTS_LITTLE_ENDIAN
684 684
685config SIBYTE_CRHINE 685config SIBYTE_CRHINE
686 bool "Support for Sibyte BCM91120C-CRhine" 686 bool "Sibyte BCM91120C-CRhine"
687 depends on EXPERIMENTAL 687 depends on EXPERIMENTAL
688 select BOOT_ELF32 688 select BOOT_ELF32
689 select DMA_COHERENT 689 select DMA_COHERENT
@@ -694,7 +694,7 @@ config SIBYTE_CRHINE
694 select SYS_SUPPORTS_LITTLE_ENDIAN 694 select SYS_SUPPORTS_LITTLE_ENDIAN
695 695
696config SIBYTE_CRHONE 696config SIBYTE_CRHONE
697 bool "Support for Sibyte BCM91125C-CRhone" 697 bool "Sibyte BCM91125C-CRhone"
698 depends on EXPERIMENTAL 698 depends on EXPERIMENTAL
699 select BOOT_ELF32 699 select BOOT_ELF32
700 select DMA_COHERENT 700 select DMA_COHERENT
@@ -706,7 +706,7 @@ config SIBYTE_CRHONE
706 select SYS_SUPPORTS_LITTLE_ENDIAN 706 select SYS_SUPPORTS_LITTLE_ENDIAN
707 707
708config SNI_RM200_PCI 708config SNI_RM200_PCI
709 bool "Support for SNI RM200 PCI" 709 bool "SNI RM200 PCI"
710 select ARC 710 select ARC
711 select ARC32 711 select ARC32
712 select ARCH_MAY_HAVE_PC_FDC 712 select ARCH_MAY_HAVE_PC_FDC
@@ -732,7 +732,7 @@ config SNI_RM200_PCI
732 support this machine type. 732 support this machine type.
733 733
734config TOSHIBA_JMR3927 734config TOSHIBA_JMR3927
735 bool "Support for Toshiba JMR-TX3927 board" 735 bool "Toshiba JMR-TX3927 board"
736 select DMA_NONCOHERENT 736 select DMA_NONCOHERENT
737 select HW_HAS_PCI 737 select HW_HAS_PCI
738 select MIPS_TX3927 738 select MIPS_TX3927
@@ -743,7 +743,7 @@ config TOSHIBA_JMR3927
743 select TOSHIBA_BOARDS 743 select TOSHIBA_BOARDS
744 744
745config TOSHIBA_RBTX4927 745config TOSHIBA_RBTX4927
746 bool "Support for Toshiba TBTX49[23]7 board" 746 bool "Toshiba TBTX49[23]7 board"
747 select DMA_NONCOHERENT 747 select DMA_NONCOHERENT
748 select HAS_TXX9_SERIAL 748 select HAS_TXX9_SERIAL
749 select HW_HAS_PCI 749 select HW_HAS_PCI
@@ -760,7 +760,7 @@ config TOSHIBA_RBTX4927
760 support this machine type 760 support this machine type
761 761
762config TOSHIBA_RBTX4938 762config TOSHIBA_RBTX4938
763 bool "Support for Toshiba RBTX4938 board" 763 bool "Toshiba RBTX4938 board"
764 select HAVE_STD_PC_SERIAL_PORT 764 select HAVE_STD_PC_SERIAL_PORT
765 select DMA_NONCOHERENT 765 select DMA_NONCOHERENT
766 select GENERIC_ISA_DMA 766 select GENERIC_ISA_DMA
@@ -816,6 +816,10 @@ config GENERIC_CALIBRATE_DELAY
816 bool 816 bool
817 default y 817 default y
818 818
819config SCHED_NO_NO_OMIT_FRAME_POINTER
820 bool
821 default y
822
819# 823#
820# Select some configuration options automatically based on user selections. 824# Select some configuration options automatically based on user selections.
821# 825#
@@ -1063,6 +1067,7 @@ choice
1063config CPU_MIPS32_R1 1067config CPU_MIPS32_R1
1064 bool "MIPS32 Release 1" 1068 bool "MIPS32 Release 1"
1065 depends on SYS_HAS_CPU_MIPS32_R1 1069 depends on SYS_HAS_CPU_MIPS32_R1
1070 select CPU_HAS_LLSC
1066 select CPU_HAS_PREFETCH 1071 select CPU_HAS_PREFETCH
1067 select CPU_SUPPORTS_32BIT_KERNEL 1072 select CPU_SUPPORTS_32BIT_KERNEL
1068 select CPU_SUPPORTS_HIGHMEM 1073 select CPU_SUPPORTS_HIGHMEM
@@ -1080,6 +1085,7 @@ config CPU_MIPS32_R1
1080config CPU_MIPS32_R2 1085config CPU_MIPS32_R2
1081 bool "MIPS32 Release 2" 1086 bool "MIPS32 Release 2"
1082 depends on SYS_HAS_CPU_MIPS32_R2 1087 depends on SYS_HAS_CPU_MIPS32_R2
1088 select CPU_HAS_LLSC
1083 select CPU_HAS_PREFETCH 1089 select CPU_HAS_PREFETCH
1084 select CPU_SUPPORTS_32BIT_KERNEL 1090 select CPU_SUPPORTS_32BIT_KERNEL
1085 select CPU_SUPPORTS_HIGHMEM 1091 select CPU_SUPPORTS_HIGHMEM
@@ -1093,6 +1099,7 @@ config CPU_MIPS32_R2
1093config CPU_MIPS64_R1 1099config CPU_MIPS64_R1
1094 bool "MIPS64 Release 1" 1100 bool "MIPS64 Release 1"
1095 depends on SYS_HAS_CPU_MIPS64_R1 1101 depends on SYS_HAS_CPU_MIPS64_R1
1102 select CPU_HAS_LLSC
1096 select CPU_HAS_PREFETCH 1103 select CPU_HAS_PREFETCH
1097 select CPU_SUPPORTS_32BIT_KERNEL 1104 select CPU_SUPPORTS_32BIT_KERNEL
1098 select CPU_SUPPORTS_64BIT_KERNEL 1105 select CPU_SUPPORTS_64BIT_KERNEL
@@ -1111,6 +1118,7 @@ config CPU_MIPS64_R1
1111config CPU_MIPS64_R2 1118config CPU_MIPS64_R2
1112 bool "MIPS64 Release 2" 1119 bool "MIPS64 Release 2"
1113 depends on SYS_HAS_CPU_MIPS64_R2 1120 depends on SYS_HAS_CPU_MIPS64_R2
1121 select CPU_HAS_LLSC
1114 select CPU_HAS_PREFETCH 1122 select CPU_HAS_PREFETCH
1115 select CPU_SUPPORTS_32BIT_KERNEL 1123 select CPU_SUPPORTS_32BIT_KERNEL
1116 select CPU_SUPPORTS_64BIT_KERNEL 1124 select CPU_SUPPORTS_64BIT_KERNEL
@@ -1125,6 +1133,7 @@ config CPU_MIPS64_R2
1125config CPU_R3000 1133config CPU_R3000
1126 bool "R3000" 1134 bool "R3000"
1127 depends on SYS_HAS_CPU_R3000 1135 depends on SYS_HAS_CPU_R3000
1136 select CPU_HAS_WB
1128 select CPU_SUPPORTS_32BIT_KERNEL 1137 select CPU_SUPPORTS_32BIT_KERNEL
1129 select CPU_SUPPORTS_HIGHMEM 1138 select CPU_SUPPORTS_HIGHMEM
1130 help 1139 help
@@ -1154,6 +1163,7 @@ config CPU_VR41XX
1154config CPU_R4300 1163config CPU_R4300
1155 bool "R4300" 1164 bool "R4300"
1156 depends on SYS_HAS_CPU_R4300 1165 depends on SYS_HAS_CPU_R4300
1166 select CPU_HAS_LLSC
1157 select CPU_SUPPORTS_32BIT_KERNEL 1167 select CPU_SUPPORTS_32BIT_KERNEL
1158 select CPU_SUPPORTS_64BIT_KERNEL 1168 select CPU_SUPPORTS_64BIT_KERNEL
1159 help 1169 help
@@ -1162,6 +1172,7 @@ config CPU_R4300
1162config CPU_R4X00 1172config CPU_R4X00
1163 bool "R4x00" 1173 bool "R4x00"
1164 depends on SYS_HAS_CPU_R4X00 1174 depends on SYS_HAS_CPU_R4X00
1175 select CPU_HAS_LLSC
1165 select CPU_SUPPORTS_32BIT_KERNEL 1176 select CPU_SUPPORTS_32BIT_KERNEL
1166 select CPU_SUPPORTS_64BIT_KERNEL 1177 select CPU_SUPPORTS_64BIT_KERNEL
1167 help 1178 help
@@ -1171,6 +1182,7 @@ config CPU_R4X00
1171config CPU_TX49XX 1182config CPU_TX49XX
1172 bool "R49XX" 1183 bool "R49XX"
1173 depends on SYS_HAS_CPU_TX49XX 1184 depends on SYS_HAS_CPU_TX49XX
1185 select CPU_HAS_LLSC
1174 select CPU_HAS_PREFETCH 1186 select CPU_HAS_PREFETCH
1175 select CPU_SUPPORTS_32BIT_KERNEL 1187 select CPU_SUPPORTS_32BIT_KERNEL
1176 select CPU_SUPPORTS_64BIT_KERNEL 1188 select CPU_SUPPORTS_64BIT_KERNEL
@@ -1178,6 +1190,7 @@ config CPU_TX49XX
1178config CPU_R5000 1190config CPU_R5000
1179 bool "R5000" 1191 bool "R5000"
1180 depends on SYS_HAS_CPU_R5000 1192 depends on SYS_HAS_CPU_R5000
1193 select CPU_HAS_LLSC
1181 select CPU_SUPPORTS_32BIT_KERNEL 1194 select CPU_SUPPORTS_32BIT_KERNEL
1182 select CPU_SUPPORTS_64BIT_KERNEL 1195 select CPU_SUPPORTS_64BIT_KERNEL
1183 help 1196 help
@@ -1186,12 +1199,14 @@ config CPU_R5000
1186config CPU_R5432 1199config CPU_R5432
1187 bool "R5432" 1200 bool "R5432"
1188 depends on SYS_HAS_CPU_R5432 1201 depends on SYS_HAS_CPU_R5432
1202 select CPU_HAS_LLSC
1189 select CPU_SUPPORTS_32BIT_KERNEL 1203 select CPU_SUPPORTS_32BIT_KERNEL
1190 select CPU_SUPPORTS_64BIT_KERNEL 1204 select CPU_SUPPORTS_64BIT_KERNEL
1191 1205
1192config CPU_R6000 1206config CPU_R6000
1193 bool "R6000" 1207 bool "R6000"
1194 depends on EXPERIMENTAL 1208 depends on EXPERIMENTAL
1209 select CPU_HAS_LLSC
1195 depends on SYS_HAS_CPU_R6000 1210 depends on SYS_HAS_CPU_R6000
1196 select CPU_SUPPORTS_32BIT_KERNEL 1211 select CPU_SUPPORTS_32BIT_KERNEL
1197 help 1212 help
@@ -1201,6 +1216,7 @@ config CPU_R6000
1201config CPU_NEVADA 1216config CPU_NEVADA
1202 bool "RM52xx" 1217 bool "RM52xx"
1203 depends on SYS_HAS_CPU_NEVADA 1218 depends on SYS_HAS_CPU_NEVADA
1219 select CPU_HAS_LLSC
1204 select CPU_SUPPORTS_32BIT_KERNEL 1220 select CPU_SUPPORTS_32BIT_KERNEL
1205 select CPU_SUPPORTS_64BIT_KERNEL 1221 select CPU_SUPPORTS_64BIT_KERNEL
1206 help 1222 help
@@ -1210,6 +1226,7 @@ config CPU_R8000
1210 bool "R8000" 1226 bool "R8000"
1211 depends on EXPERIMENTAL 1227 depends on EXPERIMENTAL
1212 depends on SYS_HAS_CPU_R8000 1228 depends on SYS_HAS_CPU_R8000
1229 select CPU_HAS_LLSC
1213 select CPU_HAS_PREFETCH 1230 select CPU_HAS_PREFETCH
1214 select CPU_SUPPORTS_64BIT_KERNEL 1231 select CPU_SUPPORTS_64BIT_KERNEL
1215 help 1232 help
@@ -1219,6 +1236,7 @@ config CPU_R8000
1219config CPU_R10000 1236config CPU_R10000
1220 bool "R10000" 1237 bool "R10000"
1221 depends on SYS_HAS_CPU_R10000 1238 depends on SYS_HAS_CPU_R10000
1239 select CPU_HAS_LLSC
1222 select CPU_HAS_PREFETCH 1240 select CPU_HAS_PREFETCH
1223 select CPU_SUPPORTS_32BIT_KERNEL 1241 select CPU_SUPPORTS_32BIT_KERNEL
1224 select CPU_SUPPORTS_64BIT_KERNEL 1242 select CPU_SUPPORTS_64BIT_KERNEL
@@ -1229,6 +1247,7 @@ config CPU_R10000
1229config CPU_RM7000 1247config CPU_RM7000
1230 bool "RM7000" 1248 bool "RM7000"
1231 depends on SYS_HAS_CPU_RM7000 1249 depends on SYS_HAS_CPU_RM7000
1250 select CPU_HAS_LLSC
1232 select CPU_HAS_PREFETCH 1251 select CPU_HAS_PREFETCH
1233 select CPU_SUPPORTS_32BIT_KERNEL 1252 select CPU_SUPPORTS_32BIT_KERNEL
1234 select CPU_SUPPORTS_64BIT_KERNEL 1253 select CPU_SUPPORTS_64BIT_KERNEL
@@ -1237,6 +1256,7 @@ config CPU_RM7000
1237config CPU_RM9000 1256config CPU_RM9000
1238 bool "RM9000" 1257 bool "RM9000"
1239 depends on SYS_HAS_CPU_RM9000 1258 depends on SYS_HAS_CPU_RM9000
1259 select CPU_HAS_LLSC
1240 select CPU_HAS_PREFETCH 1260 select CPU_HAS_PREFETCH
1241 select CPU_SUPPORTS_32BIT_KERNEL 1261 select CPU_SUPPORTS_32BIT_KERNEL
1242 select CPU_SUPPORTS_64BIT_KERNEL 1262 select CPU_SUPPORTS_64BIT_KERNEL
@@ -1245,6 +1265,7 @@ config CPU_RM9000
1245config CPU_SB1 1265config CPU_SB1
1246 bool "SB1" 1266 bool "SB1"
1247 depends on SYS_HAS_CPU_SB1 1267 depends on SYS_HAS_CPU_SB1
1268 select CPU_HAS_LLSC
1248 select CPU_SUPPORTS_32BIT_KERNEL 1269 select CPU_SUPPORTS_32BIT_KERNEL
1249 select CPU_SUPPORTS_64BIT_KERNEL 1270 select CPU_SUPPORTS_64BIT_KERNEL
1250 select CPU_SUPPORTS_HIGHMEM 1271 select CPU_SUPPORTS_HIGHMEM
@@ -1390,13 +1411,12 @@ config PAGE_SIZE_8KB
1390 1411
1391config PAGE_SIZE_16KB 1412config PAGE_SIZE_16KB
1392 bool "16kB" 1413 bool "16kB"
1393 depends on EXPERIMENTAL && !CPU_R3000 && !CPU_TX39XX 1414 depends on !CPU_R3000 && !CPU_TX39XX
1394 help 1415 help
1395 Using 16kB page size will result in higher performance kernel at 1416 Using 16kB page size will result in higher performance kernel at
1396 the price of higher memory consumption. This option is available on 1417 the price of higher memory consumption. This option is available on
1397 all non-R3000 family processor. Not that at the time of this 1418 all non-R3000 family processors. Note that you will need a suitable
1398 writing this option is still high experimental; there are also 1419 Linux distribution to support this.
1399 issues with compatibility of user applications.
1400 1420
1401config PAGE_SIZE_64KB 1421config PAGE_SIZE_64KB
1402 bool "64kB" 1422 bool "64kB"
@@ -1405,8 +1425,7 @@ config PAGE_SIZE_64KB
1405 Using 64kB page size will result in higher performance kernel at 1425 Using 64kB page size will result in higher performance kernel at
1406 the price of higher memory consumption. This option is available on 1426 the price of higher memory consumption. This option is available on
1407 all non-R3000 family processor. Not that at the time of this 1427 all non-R3000 family processor. Not that at the time of this
1408 writing this option is still high experimental; there are also 1428 writing this option is still high experimental.
1409 issues with compatibility of user applications.
1410 1429
1411endchoice 1430endchoice
1412 1431
@@ -1443,6 +1462,12 @@ choice
1443 prompt "MIPS MT options" 1462 prompt "MIPS MT options"
1444 depends on MIPS_MT 1463 depends on MIPS_MT
1445 1464
1465config MIPS_MT_SMTC
1466 bool "SMTC: Use all TCs on all VPEs for SMP"
1467 select CPU_MIPSR2_IRQ_VI
1468 select CPU_MIPSR2_SRS
1469 select SMP
1470
1446config MIPS_MT_SMP 1471config MIPS_MT_SMP
1447 bool "Use 1 TC on each available VPE for SMP" 1472 bool "Use 1 TC on each available VPE for SMP"
1448 select SMP 1473 select SMP
@@ -1456,6 +1481,11 @@ config MIPS_VPE_LOADER
1456 1481
1457endchoice 1482endchoice
1458 1483
1484config MIPS_MT_FPAFF
1485 bool "Dynamic FPU affinity for FP-intensive threads"
1486 depends on MIPS_MT
1487 default y
1488
1459config MIPS_VPE_LOADER_TOM 1489config MIPS_VPE_LOADER_TOM
1460 bool "Load VPE program into memory hidden from linux" 1490 bool "Load VPE program into memory hidden from linux"
1461 depends on MIPS_VPE_LOADER 1491 depends on MIPS_VPE_LOADER
@@ -1472,6 +1502,16 @@ config MIPS_VPE_APSP_API
1472 depends on MIPS_VPE_LOADER 1502 depends on MIPS_VPE_LOADER
1473 help 1503 help
1474 1504
1505config MIPS_APSP_KSPD
1506 bool "Enable KSPD"
1507 depends on MIPS_VPE_APSP_API
1508 default y
1509 help
1510 KSPD is a kernel daemon that accepts syscall requests from the SP
1511 side, actions them and returns the results. It also handles the
1512 "exit" syscall notifying other kernel modules the SP program is
1513 exiting. You probably want to say yes here.
1514
1475config SB1_PASS_1_WORKAROUNDS 1515config SB1_PASS_1_WORKAROUNDS
1476 bool 1516 bool
1477 depends on CPU_SB1_PASS_1 1517 depends on CPU_SB1_PASS_1
@@ -1491,38 +1531,15 @@ config 64BIT_PHYS_ADDR
1491 bool "Support for 64-bit physical address space" 1531 bool "Support for 64-bit physical address space"
1492 depends on (CPU_R4X00 || CPU_R5000 || CPU_RM7000 || CPU_RM9000 || CPU_R10000 || CPU_SB1 || CPU_MIPS32 || CPU_MIPS64) && 32BIT 1532 depends on (CPU_R4X00 || CPU_R5000 || CPU_RM7000 || CPU_RM9000 || CPU_R10000 || CPU_SB1 || CPU_MIPS32 || CPU_MIPS64) && 32BIT
1493 1533
1494config CPU_ADVANCED
1495 bool "Override CPU Options"
1496 depends on 32BIT
1497 help
1498 Saying yes here allows you to select support for various features
1499 your CPU may or may not have. Most people should say N here.
1500
1501config CPU_HAS_LLSC 1534config CPU_HAS_LLSC
1502 bool "ll/sc Instructions available" if CPU_ADVANCED 1535 bool
1503 default y if !CPU_ADVANCED && !CPU_R3000 && !CPU_VR41XX && !CPU_TX39XX
1504 help
1505 MIPS R4000 series and later provide the Load Linked (ll)
1506 and Store Conditional (sc) instructions. More information is
1507 available at <http://www.go-ecs.com/mips/miptek1.htm>.
1508
1509 Say Y here if your CPU has the ll and sc instructions. Say Y here
1510 for better performance, N if you don't know. You must say Y here
1511 for multiprocessor machines.
1512 1536
1513config CPU_HAS_WB 1537config CPU_HAS_WB
1514 bool "Writeback Buffer available" if CPU_ADVANCED 1538 bool
1515 default y if !CPU_ADVANCED && CPU_R3000 && MACH_DECSTATION
1516 help
1517 Say N here for slightly better performance. You must say Y here for
1518 machines which require flushing of write buffers in software. Saying
1519 Y is the safe option; N may result in kernel malfunction and crashes.
1520
1521menu "MIPSR2 Interrupt handling"
1522 depends on CPU_MIPSR2 && CPU_ADVANCED
1523 1539
1524config CPU_MIPSR2_IRQ_VI 1540config CPU_MIPSR2_IRQ_VI
1525 bool "Vectored interrupt mode" 1541 bool "Vectored interrupt mode"
1542 depends on CPU_MIPSR2
1526 help 1543 help
1527 Vectored interrupt mode allowing faster dispatching of interrupts. 1544 Vectored interrupt mode allowing faster dispatching of interrupts.
1528 The board support code needs to be written to take advantage of this 1545 The board support code needs to be written to take advantage of this
@@ -1532,6 +1549,7 @@ config CPU_MIPSR2_IRQ_VI
1532 1549
1533config CPU_MIPSR2_IRQ_EI 1550config CPU_MIPSR2_IRQ_EI
1534 bool "External interrupt controller mode" 1551 bool "External interrupt controller mode"
1552 depends on CPU_MIPSR2
1535 help 1553 help
1536 Extended interrupt mode takes advantage of an external interrupt 1554 Extended interrupt mode takes advantage of an external interrupt
1537 controller to allow fast dispatching from many possible interrupt 1555 controller to allow fast dispatching from many possible interrupt
@@ -1545,7 +1563,6 @@ config CPU_MIPSR2_SRS
1545 Allow the kernel to use shadow register sets for fast interrupts. 1563 Allow the kernel to use shadow register sets for fast interrupts.
1546 Interrupt handlers must be specially written to use shadow sets. 1564 Interrupt handlers must be specially written to use shadow sets.
1547 Say N unless you know that shadow register set upport is needed. 1565 Say N unless you know that shadow register set upport is needed.
1548endmenu
1549 1566
1550config CPU_HAS_SYNC 1567config CPU_HAS_SYNC
1551 bool 1568 bool
@@ -1599,7 +1616,7 @@ source "mm/Kconfig"
1599 1616
1600config SMP 1617config SMP
1601 bool "Multi-Processing support" 1618 bool "Multi-Processing support"
1602 depends on CPU_RM9000 || ((SIBYTE_BCM1x80 || SIBYTE_BCM1x55 || SIBYTE_SB1250 || QEMU) && !SIBYTE_STANDALONE) || SGI_IP27 || MIPS_MT_SMP 1619 depends on CPU_RM9000 || ((SIBYTE_BCM1x80 || SIBYTE_BCM1x55 || SIBYTE_SB1250 || QEMU) && !SIBYTE_STANDALONE) || SGI_IP27 || MIPS_MT_SMP || MIPS_MT_SMTC
1603 ---help--- 1620 ---help---
1604 This enables support for systems with more than one CPU. If you have 1621 This enables support for systems with more than one CPU. If you have
1605 a system with only one CPU, like most personal computers, say N. If 1622 a system with only one CPU, like most personal computers, say N. If
diff --git a/arch/mips/Kconfig.debug b/arch/mips/Kconfig.debug
index d3c5cc3b9c9d..515f9e611307 100644
--- a/arch/mips/Kconfig.debug
+++ b/arch/mips/Kconfig.debug
@@ -6,7 +6,13 @@ config CROSSCOMPILE
6 bool "Are you using a crosscompiler" 6 bool "Are you using a crosscompiler"
7 help 7 help
8 Say Y here if you are compiling the kernel on a different 8 Say Y here if you are compiling the kernel on a different
9 architecture than the one it is intended to run on. 9 architecture than the one it is intended to run on. This is just a
10 convenience option which will select the appropriate value for
11 the CROSS_COMPILE make variable which otherwise has to be passed on
12 the command line from mips-linux-, mipsel-linux-, mips64-linux- and
13 mips64el-linux- as appropriate for a particular kernel configuration.
14 You will have to pass the value for CROSS_COMPILE manually if the
15 name prefix for your tools is different.
10 16
11config CMDLINE 17config CMDLINE
12 string "Default kernel command string" 18 string "Default kernel command string"
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index 9a69e0f0ab76..133900aca992 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -105,18 +105,18 @@ cflags-$(CONFIG_CPU_R4300) += -march=r4300 -Wa,--trap
105cflags-$(CONFIG_CPU_VR41XX) += -march=r4100 -Wa,--trap 105cflags-$(CONFIG_CPU_VR41XX) += -march=r4100 -Wa,--trap
106cflags-$(CONFIG_CPU_R4X00) += -march=r4600 -Wa,--trap 106cflags-$(CONFIG_CPU_R4X00) += -march=r4600 -Wa,--trap
107cflags-$(CONFIG_CPU_TX49XX) += -march=r4600 -Wa,--trap 107cflags-$(CONFIG_CPU_TX49XX) += -march=r4600 -Wa,--trap
108cflags-$(CONFIG_CPU_MIPS32_R1) += $(call cc-option,-march=mips32,-mips2 -mtune=r4600) \ 108cflags-$(CONFIG_CPU_MIPS32_R1) += $(call cc-option,-march=mips32,-mips32 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS32) \
109 -Wa,-mips32 -Wa,--trap 109 -Wa,-mips32 -Wa,--trap
110cflags-$(CONFIG_CPU_MIPS32_R2) += $(call cc-option,-march=mips32r2,-mips2 -mtune=r4600) \ 110cflags-$(CONFIG_CPU_MIPS32_R2) += $(call cc-option,-march=mips32r2,-mips32r2 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS32) \
111 -Wa,-mips32r2 -Wa,--trap 111 -Wa,-mips32r2 -Wa,--trap
112cflags-$(CONFIG_CPU_MIPS64_R1) += $(call cc-option,-march=mips64,-mips2 -mtune=r4600) \ 112cflags-$(CONFIG_CPU_MIPS64_R1) += $(call cc-option,-march=mips64,-mips64 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS64) \
113 -Wa,-mips64 -Wa,--trap 113 -Wa,-mips64 -Wa,--trap
114cflags-$(CONFIG_CPU_MIPS64_R2) += $(call cc-option,-march=mips64r2,-mips2 -mtune=r4600 ) \ 114cflags-$(CONFIG_CPU_MIPS64_R2) += $(call cc-option,-march=mips64r2,-mips64r2 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS64) \
115 -Wa,-mips64r2 -Wa,--trap 115 -Wa,-mips64r2 -Wa,--trap
116cflags-$(CONFIG_CPU_R5000) += -march=r5000 -Wa,--trap 116cflags-$(CONFIG_CPU_R5000) += -march=r5000 -Wa,--trap
117cflags-$(CONFIG_CPU_R5432) += $(call cc-options,-march=r5400,-march=r5000) \ 117cflags-$(CONFIG_CPU_R5432) += $(call cc-option,-march=r5400,-march=r5000) \
118 -Wa,--trap 118 -Wa,--trap
119cflags-$(CONFIG_CPU_NEVADA) += $(call cc-options,-march=rm5200,-march=r5000) \ 119cflags-$(CONFIG_CPU_NEVADA) += $(call cc-option,-march=rm5200,-march=r5000) \
120 -Wa,--trap 120 -Wa,--trap
121cflags-$(CONFIG_CPU_RM7000) += $(call cc-option,-march=rm7000,-march=r5000) \ 121cflags-$(CONFIG_CPU_RM7000) += $(call cc-option,-march=rm7000,-march=r5000) \
122 -Wa,--trap 122 -Wa,--trap
@@ -615,7 +615,10 @@ LDFLAGS += -m $(ld-emul)
615ifdef CONFIG_MIPS 615ifdef CONFIG_MIPS
616CHECKFLAGS += $(shell $(CC) $(CFLAGS) -dM -E -xc /dev/null | \ 616CHECKFLAGS += $(shell $(CC) $(CFLAGS) -dM -E -xc /dev/null | \
617 egrep -vw '__GNUC_(MAJOR|MINOR|PATCHLEVEL)__' | \ 617 egrep -vw '__GNUC_(MAJOR|MINOR|PATCHLEVEL)__' | \
618 sed -e 's/^\#define /-D/' -e 's/ /="/' -e 's/$$/"/') 618 sed -e 's/^\#define /-D/' -e "s/ /='/" -e "s/$$/'/")
619ifdef CONFIG_64BIT
620CHECKFLAGS += -m64
621endif
619endif 622endif
620 623
621OBJCOPYFLAGS += --remove-section=.reginfo 624OBJCOPYFLAGS += --remove-section=.reginfo
diff --git a/arch/mips/au1000/common/Makefile b/arch/mips/au1000/common/Makefile
index a1edfd1f643c..bf682f50b859 100644
--- a/arch/mips/au1000/common/Makefile
+++ b/arch/mips/au1000/common/Makefile
@@ -6,7 +6,7 @@
6# Makefile for the Alchemy Au1000 CPU, generic files. 6# Makefile for the Alchemy Au1000 CPU, generic files.
7# 7#
8 8
9obj-y += prom.o int-handler.o irq.o puts.o time.o reset.o \ 9obj-y += prom.o irq.o puts.o time.o reset.o \
10 au1xxx_irqmap.o clocks.o platform.o power.o setup.o \ 10 au1xxx_irqmap.o clocks.o platform.o power.o setup.o \
11 sleeper.o cputable.o dma.o dbdma.o gpio.o 11 sleeper.o cputable.o dma.o dbdma.o gpio.o
12 12
diff --git a/arch/mips/au1000/common/int-handler.S b/arch/mips/au1000/common/int-handler.S
deleted file mode 100644
index 1c4ca883321e..000000000000
--- a/arch/mips/au1000/common/int-handler.S
+++ /dev/null
@@ -1,68 +0,0 @@
1/*
2 * Copyright 2001 MontaVista Software Inc.
3 * Author: ppopov@mvista.com
4 *
5 * Interrupt dispatcher for Au1000 boards.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 */
12#include <asm/asm.h>
13#include <asm/mipsregs.h>
14#include <asm/addrspace.h>
15#include <asm/regdef.h>
16#include <asm/stackframe.h>
17
18 .text
19 .set macro
20 .set noat
21 .align 5
22
23NESTED(au1000_IRQ, PT_SIZE, sp)
24 SAVE_ALL
25 CLI # Important: mark KERNEL mode !
26
27 mfc0 t0,CP0_CAUSE # get pending interrupts
28 mfc0 t1,CP0_STATUS # get enabled interrupts
29 and t0,t1 # isolate allowed ones
30
31 andi t0,0xff00 # isolate pending bits
32 beqz t0, 3f # spurious interrupt
33
34 andi a0, t0, CAUSEF_IP7
35 beq a0, zero, 1f
36 move a0, sp
37 jal mips_timer_interrupt
38 j ret_from_irq
39
401:
41 andi a0, t0, CAUSEF_IP2 # Interrupt Controller 0, Request 0
42 beq a0, zero, 2f
43 move a0,sp
44 jal intc0_req0_irqdispatch
45 j ret_from_irq
462:
47 andi a0, t0, CAUSEF_IP3 # Interrupt Controller 0, Request 1
48 beq a0, zero, 3f
49 move a0,sp
50 jal intc0_req1_irqdispatch
51 j ret_from_irq
523:
53 andi a0, t0, CAUSEF_IP4 # Interrupt Controller 1, Request 0
54 beq a0, zero, 4f
55 move a0,sp
56 jal intc1_req0_irqdispatch
57 j ret_from_irq
584:
59 andi a0, t0, CAUSEF_IP5 # Interrupt Controller 1, Request 1
60 beq a0, zero, 5f
61 move a0, sp
62 jal intc1_req1_irqdispatch
63 j ret_from_irq
64
655:
66 move a0, sp
67 j spurious_interrupt
68END(au1000_IRQ)
diff --git a/arch/mips/au1000/common/irq.c b/arch/mips/au1000/common/irq.c
index 1339a0979f66..afe05ec12c27 100644
--- a/arch/mips/au1000/common/irq.c
+++ b/arch/mips/au1000/common/irq.c
@@ -66,9 +66,9 @@
66#define EXT_INTC1_REQ1 5 /* IP 5 */ 66#define EXT_INTC1_REQ1 5 /* IP 5 */
67#define MIPS_TIMER_IP 7 /* IP 7 */ 67#define MIPS_TIMER_IP 7 /* IP 7 */
68 68
69extern asmlinkage void au1000_IRQ(void);
70extern void set_debug_traps(void); 69extern void set_debug_traps(void);
71extern irq_cpustat_t irq_stat [NR_CPUS]; 70extern irq_cpustat_t irq_stat [NR_CPUS];
71extern void mips_timer_interrupt(struct pt_regs *regs);
72 72
73static void setup_local_irq(unsigned int irq, int type, int int_req); 73static void setup_local_irq(unsigned int irq, int type, int int_req);
74static unsigned int startup_irq(unsigned int irq); 74static unsigned int startup_irq(unsigned int irq);
@@ -446,7 +446,6 @@ void __init arch_init_irq(void)
446 extern int au1xxx_ic0_nr_irqs; 446 extern int au1xxx_ic0_nr_irqs;
447 447
448 cp0_status = read_c0_status(); 448 cp0_status = read_c0_status();
449 set_except_vector(0, au1000_IRQ);
450 449
451 /* Initialize interrupt controllers to a safe state. 450 /* Initialize interrupt controllers to a safe state.
452 */ 451 */
@@ -661,3 +660,21 @@ restore_au1xxx_intctl(void)
661 au_writel(sleep_intctl_mask[0], IC0_MASKSET); au_sync(); 660 au_writel(sleep_intctl_mask[0], IC0_MASKSET); au_sync();
662} 661}
663#endif /* CONFIG_PM */ 662#endif /* CONFIG_PM */
663
664asmlinkage void plat_irq_dispatch(struct pt_regs *regs)
665{
666 unsigned int pending = read_c0_status() & read_c0_cause() & ST0_IM;
667
668 if (pending & CAUSEF_IP7)
669 mips_timer_interrupt(regs);
670 else if (pending & CAUSEF_IP2)
671 intc0_req0_irqdispatch(regs);
672 else if (pending & CAUSEF_IP3)
673 intc0_req1_irqdispatch(regs);
674 else if (pending & CAUSEF_IP4)
675 intc1_req0_irqdispatch(regs);
676 else if (pending & CAUSEF_IP5)
677 intc1_req1_irqdispatch(regs);
678 else
679 spurious_interrupt(regs);
680}
diff --git a/arch/mips/au1000/common/prom.c b/arch/mips/au1000/common/prom.c
index 9c171afd9a53..ae7d8c57bf3f 100644
--- a/arch/mips/au1000/common/prom.c
+++ b/arch/mips/au1000/common/prom.c
@@ -1,10 +1,9 @@
1/* 1/*
2 * 2 *
3 * BRIEF MODULE DESCRIPTION 3 * BRIEF MODULE DESCRIPTION
4 * PROM library initialisation code, assuming a version of 4 * PROM library initialisation code, assuming YAMON is the boot loader.
5 * pmon is the boot code.
6 * 5 *
7 * Copyright 2000,2001 MontaVista Software Inc. 6 * Copyright 2000, 2001, 2006 MontaVista Software Inc.
8 * Author: MontaVista Software, Inc. 7 * Author: MontaVista Software, Inc.
9 * ppopov@mvista.com or source@mvista.com 8 * ppopov@mvista.com or source@mvista.com
10 * 9 *
@@ -49,9 +48,9 @@ extern char **prom_argv, **prom_envp;
49 48
50typedef struct 49typedef struct
51{ 50{
52 char *name; 51 char *name;
53/* char *val; */ 52 char *val;
54}t_env_var; 53} t_env_var;
55 54
56 55
57char * prom_getcmdline(void) 56char * prom_getcmdline(void)
@@ -85,21 +84,16 @@ char *prom_getenv(char *envname)
85{ 84{
86 /* 85 /*
87 * Return a pointer to the given environment variable. 86 * Return a pointer to the given environment variable.
88 * Environment variables are stored in the form of "memsize=64".
89 */ 87 */
90 88
91 t_env_var *env = (t_env_var *)prom_envp; 89 t_env_var *env = (t_env_var *)prom_envp;
92 int i;
93
94 i = strlen(envname);
95 90
96 while(env->name) { 91 while (env->name) {
97 if(strncmp(envname, env->name, i) == 0) { 92 if (strcmp(envname, env->name) == 0)
98 return(env->name + strlen(envname) + 1); 93 return env->val;
99 }
100 env++; 94 env++;
101 } 95 }
102 return(NULL); 96 return NULL;
103} 97}
104 98
105inline unsigned char str2hexnum(unsigned char c) 99inline unsigned char str2hexnum(unsigned char c)
diff --git a/arch/mips/au1000/common/sleeper.S b/arch/mips/au1000/common/sleeper.S
index 44dac3b0df3b..683d9da84b66 100644
--- a/arch/mips/au1000/common/sleeper.S
+++ b/arch/mips/au1000/common/sleeper.S
@@ -112,6 +112,11 @@ sdsleep:
112 mtc0 k0, CP0_PAGEMASK 112 mtc0 k0, CP0_PAGEMASK
113 lw k0, 0x14(sp) 113 lw k0, 0x14(sp)
114 mtc0 k0, CP0_CONFIG 114 mtc0 k0, CP0_CONFIG
115
116 /* We need to catch the ealry Alchemy SOCs with
117 * the write-only Config[OD] bit and set it back to one...
118 */
119 jal au1x00_fixup_config_od
115 lw $1, PT_R1(sp) 120 lw $1, PT_R1(sp)
116 lw $2, PT_R2(sp) 121 lw $2, PT_R2(sp)
117 lw $3, PT_R3(sp) 122 lw $3, PT_R3(sp)
diff --git a/arch/mips/au1000/common/time.c b/arch/mips/au1000/common/time.c
index f85f1524b366..f74d66a58a21 100644
--- a/arch/mips/au1000/common/time.c
+++ b/arch/mips/au1000/common/time.c
@@ -116,6 +116,7 @@ void mips_timer_interrupt(struct pt_regs *regs)
116 116
117null: 117null:
118 ack_r4ktimer(0); 118 ack_r4ktimer(0);
119 irq_exit();
119} 120}
120 121
121#ifdef CONFIG_PM 122#ifdef CONFIG_PM
diff --git a/arch/mips/cobalt/Makefile b/arch/mips/cobalt/Makefile
index 720e757b2b64..225ac8f34ccd 100644
--- a/arch/mips/cobalt/Makefile
+++ b/arch/mips/cobalt/Makefile
@@ -2,7 +2,7 @@
2# Makefile for the Cobalt micro systems family specific parts of the kernel 2# Makefile for the Cobalt micro systems family specific parts of the kernel
3# 3#
4 4
5obj-y := irq.o int-handler.o reset.o setup.o 5obj-y := irq.o reset.o setup.o
6 6
7obj-$(CONFIG_EARLY_PRINTK) += console.o 7obj-$(CONFIG_EARLY_PRINTK) += console.o
8 8
diff --git a/arch/mips/cobalt/int-handler.S b/arch/mips/cobalt/int-handler.S
deleted file mode 100644
index e75d5e3ca868..000000000000
--- a/arch/mips/cobalt/int-handler.S
+++ /dev/null
@@ -1,25 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 1995, 1996, 1997, 2003 by Ralf Baechle
7 * Copyright (C) 2001, 2002, 2003 by Liam Davies (ldavies@agile.tv)
8 */
9#include <asm/asm.h>
10#include <asm/mipsregs.h>
11#include <asm/mach-cobalt/cobalt.h>
12#include <asm/regdef.h>
13#include <asm/stackframe.h>
14
15 .text
16 .align 5
17 NESTED(cobalt_handle_int, PT_SIZE, sp)
18 SAVE_ALL
19 CLI
20
21 PTR_LA ra, ret_from_irq
22 move a0, sp
23 j cobalt_irq
24
25 END(cobalt_handle_int)
diff --git a/arch/mips/cobalt/irq.c b/arch/mips/cobalt/irq.c
index f9a108820d6e..0b75f4fb7195 100644
--- a/arch/mips/cobalt/irq.c
+++ b/arch/mips/cobalt/irq.c
@@ -20,8 +20,6 @@
20 20
21#include <asm/mach-cobalt/cobalt.h> 21#include <asm/mach-cobalt/cobalt.h>
22 22
23extern void cobalt_handle_int(void);
24
25/* 23/*
26 * We have two types of interrupts that we handle, ones that come in through 24 * We have two types of interrupts that we handle, ones that come in through
27 * the CPU interrupt lines, and ones that come in on the via chip. The CPU 25 * the CPU interrupt lines, and ones that come in on the via chip. The CPU
@@ -79,7 +77,7 @@ static inline void via_pic_irq(struct pt_regs *regs)
79 do_IRQ(irq, regs); 77 do_IRQ(irq, regs);
80} 78}
81 79
82asmlinkage void cobalt_irq(struct pt_regs *regs) 80asmlinkage void plat_irq_dispatch(struct pt_regs *regs)
83{ 81{
84 unsigned pending; 82 unsigned pending;
85 83
@@ -122,8 +120,6 @@ void __init arch_init_irq(void)
122 */ 120 */
123 GALILEO_OUTL(0, GT_INTRMASK_OFS); 121 GALILEO_OUTL(0, GT_INTRMASK_OFS);
124 122
125 set_except_vector(0, cobalt_handle_int);
126
127 init_i8259_irqs(); /* 0 ... 15 */ 123 init_i8259_irqs(); /* 0 ... 15 */
128 mips_cpu_irq_init(COBALT_CPU_IRQ); /* 16 ... 23 */ 124 mips_cpu_irq_init(COBALT_CPU_IRQ); /* 16 ... 23 */
129 125
diff --git a/arch/mips/configs/atlas_defconfig b/arch/mips/configs/atlas_defconfig
index 9e1ae953e966..4b080bcb258f 100644
--- a/arch/mips/configs/atlas_defconfig
+++ b/arch/mips/configs/atlas_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc1 3# Linux kernel version: 2.6.17-rc2
4# Fri Jan 27 15:39:52 2006 4# Mon Apr 24 14:50:55 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -64,6 +64,8 @@ CONFIG_MIPS_ATLAS=y
64# CONFIG_TOSHIBA_RBTX4927 is not set 64# CONFIG_TOSHIBA_RBTX4927 is not set
65# CONFIG_TOSHIBA_RBTX4938 is not set 65# CONFIG_TOSHIBA_RBTX4938 is not set
66CONFIG_RWSEM_GENERIC_SPINLOCK=y 66CONFIG_RWSEM_GENERIC_SPINLOCK=y
67CONFIG_GENERIC_FIND_NEXT_BIT=y
68CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 69CONFIG_GENERIC_CALIBRATE_DELAY=y
68CONFIG_DMA_NONCOHERENT=y 70CONFIG_DMA_NONCOHERENT=y
69CONFIG_DMA_NEED_PCI_MAP_STATE=y 71CONFIG_DMA_NEED_PCI_MAP_STATE=y
@@ -127,11 +129,11 @@ CONFIG_RM7000_CPU_SCACHE=y
127CONFIG_CPU_HAS_PREFETCH=y 129CONFIG_CPU_HAS_PREFETCH=y
128# CONFIG_MIPS_MT is not set 130# CONFIG_MIPS_MT is not set
129# CONFIG_64BIT_PHYS_ADDR is not set 131# CONFIG_64BIT_PHYS_ADDR is not set
130# CONFIG_CPU_ADVANCED is not set
131CONFIG_CPU_HAS_LLSC=y 132CONFIG_CPU_HAS_LLSC=y
132CONFIG_CPU_HAS_SYNC=y 133CONFIG_CPU_HAS_SYNC=y
133CONFIG_GENERIC_HARDIRQS=y 134CONFIG_GENERIC_HARDIRQS=y
134CONFIG_GENERIC_IRQ_PROBE=y 135CONFIG_GENERIC_IRQ_PROBE=y
136CONFIG_CPU_SUPPORTS_HIGHMEM=y
135CONFIG_ARCH_FLATMEM_ENABLE=y 137CONFIG_ARCH_FLATMEM_ENABLE=y
136CONFIG_SELECT_MEMORY_MODEL=y 138CONFIG_SELECT_MEMORY_MODEL=y
137CONFIG_FLATMEM_MANUAL=y 139CONFIG_FLATMEM_MANUAL=y
@@ -149,7 +151,6 @@ CONFIG_PREEMPT_NONE=y
149# Code maturity level options 151# Code maturity level options
150# 152#
151CONFIG_EXPERIMENTAL=y 153CONFIG_EXPERIMENTAL=y
152CONFIG_CLEAN_COMPILE=y
153CONFIG_BROKEN_ON_SMP=y 154CONFIG_BROKEN_ON_SMP=y
154CONFIG_INIT_ENV_ARG_LIMIT=32 155CONFIG_INIT_ENV_ARG_LIMIT=32
155 156
@@ -165,6 +166,7 @@ CONFIG_SYSVIPC=y
165CONFIG_SYSCTL=y 166CONFIG_SYSCTL=y
166# CONFIG_AUDIT is not set 167# CONFIG_AUDIT is not set
167# CONFIG_IKCONFIG is not set 168# CONFIG_IKCONFIG is not set
169CONFIG_RELAY=y
168CONFIG_INITRAMFS_SOURCE="" 170CONFIG_INITRAMFS_SOURCE=""
169# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 171# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
170CONFIG_EMBEDDED=y 172CONFIG_EMBEDDED=y
@@ -178,10 +180,6 @@ CONFIG_BASE_FULL=y
178CONFIG_FUTEX=y 180CONFIG_FUTEX=y
179CONFIG_EPOLL=y 181CONFIG_EPOLL=y
180CONFIG_SHMEM=y 182CONFIG_SHMEM=y
181CONFIG_CC_ALIGN_FUNCTIONS=0
182CONFIG_CC_ALIGN_LABELS=0
183CONFIG_CC_ALIGN_LOOPS=0
184CONFIG_CC_ALIGN_JUMPS=0
185CONFIG_SLAB=y 183CONFIG_SLAB=y
186# CONFIG_TINY_SHMEM is not set 184# CONFIG_TINY_SHMEM is not set
187CONFIG_BASE_SMALL=0 185CONFIG_BASE_SMALL=0
@@ -193,7 +191,6 @@ CONFIG_BASE_SMALL=0
193CONFIG_MODULES=y 191CONFIG_MODULES=y
194CONFIG_MODULE_UNLOAD=y 192CONFIG_MODULE_UNLOAD=y
195# CONFIG_MODULE_FORCE_UNLOAD is not set 193# CONFIG_MODULE_FORCE_UNLOAD is not set
196CONFIG_OBSOLETE_MODPARM=y
197CONFIG_MODVERSIONS=y 194CONFIG_MODVERSIONS=y
198CONFIG_MODULE_SRCVERSION_ALL=y 195CONFIG_MODULE_SRCVERSION_ALL=y
199CONFIG_KMOD=y 196CONFIG_KMOD=y
@@ -202,6 +199,8 @@ CONFIG_KMOD=y
202# Block layer 199# Block layer
203# 200#
204# CONFIG_LBD is not set 201# CONFIG_LBD is not set
202# CONFIG_BLK_DEV_IO_TRACE is not set
203# CONFIG_LSF is not set
205 204
206# 205#
207# IO Schedulers 206# IO Schedulers
@@ -221,7 +220,6 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
221# 220#
222CONFIG_HW_HAS_PCI=y 221CONFIG_HW_HAS_PCI=y
223CONFIG_PCI=y 222CONFIG_PCI=y
224CONFIG_PCI_LEGACY_PROC=y
225CONFIG_MMU=y 223CONFIG_MMU=y
226 224
227# 225#
@@ -249,6 +247,7 @@ CONFIG_NET=y
249# 247#
250# Networking options 248# Networking options
251# 249#
250# CONFIG_NETDEBUG is not set
252CONFIG_PACKET=y 251CONFIG_PACKET=y
253CONFIG_PACKET_MMAP=y 252CONFIG_PACKET_MMAP=y
254CONFIG_UNIX=y 253CONFIG_UNIX=y
@@ -281,6 +280,7 @@ CONFIG_SYN_COOKIES=y
281CONFIG_INET_AH=m 280CONFIG_INET_AH=m
282CONFIG_INET_ESP=m 281CONFIG_INET_ESP=m
283CONFIG_INET_IPCOMP=m 282CONFIG_INET_IPCOMP=m
283CONFIG_INET_XFRM_TUNNEL=m
284CONFIG_INET_TUNNEL=m 284CONFIG_INET_TUNNEL=m
285CONFIG_INET_DIAG=y 285CONFIG_INET_DIAG=y
286CONFIG_INET_TCP_DIAG=y 286CONFIG_INET_TCP_DIAG=y
@@ -322,9 +322,12 @@ CONFIG_IP_VS_NQ=m
322CONFIG_IP_VS_FTP=m 322CONFIG_IP_VS_FTP=m
323CONFIG_IPV6=m 323CONFIG_IPV6=m
324CONFIG_IPV6_PRIVACY=y 324CONFIG_IPV6_PRIVACY=y
325CONFIG_IPV6_ROUTER_PREF=y
326CONFIG_IPV6_ROUTE_INFO=y
325CONFIG_INET6_AH=m 327CONFIG_INET6_AH=m
326CONFIG_INET6_ESP=m 328CONFIG_INET6_ESP=m
327CONFIG_INET6_IPCOMP=m 329CONFIG_INET6_IPCOMP=m
330CONFIG_INET6_XFRM_TUNNEL=m
328CONFIG_INET6_TUNNEL=m 331CONFIG_INET6_TUNNEL=m
329CONFIG_IPV6_TUNNEL=m 332CONFIG_IPV6_TUNNEL=m
330CONFIG_NETFILTER=y 333CONFIG_NETFILTER=y
@@ -348,11 +351,14 @@ CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
348CONFIG_NETFILTER_XT_MATCH_CONNMARK=m 351CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
349CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m 352CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
350CONFIG_NETFILTER_XT_MATCH_DCCP=m 353CONFIG_NETFILTER_XT_MATCH_DCCP=m
354CONFIG_NETFILTER_XT_MATCH_ESP=m
351CONFIG_NETFILTER_XT_MATCH_HELPER=m 355CONFIG_NETFILTER_XT_MATCH_HELPER=m
352CONFIG_NETFILTER_XT_MATCH_LENGTH=m 356CONFIG_NETFILTER_XT_MATCH_LENGTH=m
353CONFIG_NETFILTER_XT_MATCH_LIMIT=m 357CONFIG_NETFILTER_XT_MATCH_LIMIT=m
354CONFIG_NETFILTER_XT_MATCH_MAC=m 358CONFIG_NETFILTER_XT_MATCH_MAC=m
355CONFIG_NETFILTER_XT_MATCH_MARK=m 359CONFIG_NETFILTER_XT_MATCH_MARK=m
360CONFIG_NETFILTER_XT_MATCH_POLICY=m
361CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
356CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m 362CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m
357CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m 363CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
358CONFIG_NETFILTER_XT_MATCH_REALM=m 364CONFIG_NETFILTER_XT_MATCH_REALM=m
@@ -376,20 +382,19 @@ CONFIG_IP_NF_IRC=m
376CONFIG_IP_NF_TFTP=m 382CONFIG_IP_NF_TFTP=m
377CONFIG_IP_NF_AMANDA=m 383CONFIG_IP_NF_AMANDA=m
378CONFIG_IP_NF_PPTP=m 384CONFIG_IP_NF_PPTP=m
385CONFIG_IP_NF_H323=m
379CONFIG_IP_NF_QUEUE=m 386CONFIG_IP_NF_QUEUE=m
380CONFIG_IP_NF_IPTABLES=m 387CONFIG_IP_NF_IPTABLES=m
381CONFIG_IP_NF_MATCH_IPRANGE=m 388CONFIG_IP_NF_MATCH_IPRANGE=m
382CONFIG_IP_NF_MATCH_MULTIPORT=m
383CONFIG_IP_NF_MATCH_TOS=m 389CONFIG_IP_NF_MATCH_TOS=m
384CONFIG_IP_NF_MATCH_RECENT=m 390CONFIG_IP_NF_MATCH_RECENT=m
385CONFIG_IP_NF_MATCH_ECN=m 391CONFIG_IP_NF_MATCH_ECN=m
386CONFIG_IP_NF_MATCH_DSCP=m 392CONFIG_IP_NF_MATCH_DSCP=m
387CONFIG_IP_NF_MATCH_AH_ESP=m 393CONFIG_IP_NF_MATCH_AH=m
388CONFIG_IP_NF_MATCH_TTL=m 394CONFIG_IP_NF_MATCH_TTL=m
389CONFIG_IP_NF_MATCH_OWNER=m 395CONFIG_IP_NF_MATCH_OWNER=m
390CONFIG_IP_NF_MATCH_ADDRTYPE=m 396CONFIG_IP_NF_MATCH_ADDRTYPE=m
391CONFIG_IP_NF_MATCH_HASHLIMIT=m 397CONFIG_IP_NF_MATCH_HASHLIMIT=m
392CONFIG_IP_NF_MATCH_POLICY=m
393CONFIG_IP_NF_FILTER=m 398CONFIG_IP_NF_FILTER=m
394CONFIG_IP_NF_TARGET_REJECT=m 399CONFIG_IP_NF_TARGET_REJECT=m
395CONFIG_IP_NF_TARGET_LOG=m 400CONFIG_IP_NF_TARGET_LOG=m
@@ -407,6 +412,7 @@ CONFIG_IP_NF_NAT_FTP=m
407CONFIG_IP_NF_NAT_TFTP=m 412CONFIG_IP_NF_NAT_TFTP=m
408CONFIG_IP_NF_NAT_AMANDA=m 413CONFIG_IP_NF_NAT_AMANDA=m
409CONFIG_IP_NF_NAT_PPTP=m 414CONFIG_IP_NF_NAT_PPTP=m
415CONFIG_IP_NF_NAT_H323=m
410CONFIG_IP_NF_MANGLE=m 416CONFIG_IP_NF_MANGLE=m
411CONFIG_IP_NF_TARGET_TOS=m 417CONFIG_IP_NF_TARGET_TOS=m
412CONFIG_IP_NF_TARGET_ECN=m 418CONFIG_IP_NF_TARGET_ECN=m
@@ -427,12 +433,10 @@ CONFIG_IP6_NF_MATCH_RT=m
427CONFIG_IP6_NF_MATCH_OPTS=m 433CONFIG_IP6_NF_MATCH_OPTS=m
428CONFIG_IP6_NF_MATCH_FRAG=m 434CONFIG_IP6_NF_MATCH_FRAG=m
429CONFIG_IP6_NF_MATCH_HL=m 435CONFIG_IP6_NF_MATCH_HL=m
430CONFIG_IP6_NF_MATCH_MULTIPORT=m
431CONFIG_IP6_NF_MATCH_OWNER=m 436CONFIG_IP6_NF_MATCH_OWNER=m
432CONFIG_IP6_NF_MATCH_IPV6HEADER=m 437CONFIG_IP6_NF_MATCH_IPV6HEADER=m
433CONFIG_IP6_NF_MATCH_AHESP=m 438CONFIG_IP6_NF_MATCH_AH=m
434CONFIG_IP6_NF_MATCH_EUI64=m 439CONFIG_IP6_NF_MATCH_EUI64=m
435CONFIG_IP6_NF_MATCH_POLICY=m
436CONFIG_IP6_NF_FILTER=m 440CONFIG_IP6_NF_FILTER=m
437CONFIG_IP6_NF_TARGET_LOG=m 441CONFIG_IP6_NF_TARGET_LOG=m
438CONFIG_IP6_NF_TARGET_REJECT=m 442CONFIG_IP6_NF_TARGET_REJECT=m
@@ -478,6 +482,11 @@ CONFIG_IP_SCTP=m
478# CONFIG_SCTP_HMAC_NONE is not set 482# CONFIG_SCTP_HMAC_NONE is not set
479# CONFIG_SCTP_HMAC_SHA1 is not set 483# CONFIG_SCTP_HMAC_SHA1 is not set
480CONFIG_SCTP_HMAC_MD5=y 484CONFIG_SCTP_HMAC_MD5=y
485
486#
487# TIPC Configuration (EXPERIMENTAL)
488#
489# CONFIG_TIPC is not set
481# CONFIG_ATM is not set 490# CONFIG_ATM is not set
482CONFIG_BRIDGE=m 491CONFIG_BRIDGE=m
483CONFIG_VLAN_8021Q=m 492CONFIG_VLAN_8021Q=m
@@ -492,11 +501,6 @@ CONFIG_IPDDP_ENCAP=y
492CONFIG_IPDDP_DECAP=y 501CONFIG_IPDDP_DECAP=y
493# CONFIG_X25 is not set 502# CONFIG_X25 is not set
494# CONFIG_LAPB is not set 503# CONFIG_LAPB is not set
495
496#
497# TIPC Configuration (EXPERIMENTAL)
498#
499# CONFIG_TIPC is not set
500CONFIG_NET_DIVERT=y 504CONFIG_NET_DIVERT=y
501# CONFIG_ECONET is not set 505# CONFIG_ECONET is not set
502# CONFIG_WAN_ROUTER is not set 506# CONFIG_WAN_ROUTER is not set
@@ -556,6 +560,9 @@ CONFIG_IEEE80211=m
556# CONFIG_IEEE80211_DEBUG is not set 560# CONFIG_IEEE80211_DEBUG is not set
557CONFIG_IEEE80211_CRYPT_WEP=m 561CONFIG_IEEE80211_CRYPT_WEP=m
558CONFIG_IEEE80211_CRYPT_CCMP=m 562CONFIG_IEEE80211_CRYPT_CCMP=m
563CONFIG_IEEE80211_SOFTMAC=m
564# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
565CONFIG_WIRELESS_EXT=y
559 566
560# 567#
561# Device Drivers 568# Device Drivers
@@ -694,9 +701,8 @@ CONFIG_SCSI_SYM53C8XX_2=y
694CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0 701CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0
695CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 702CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
696CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 703CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
697# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set 704CONFIG_SCSI_SYM53C8XX_MMIO=y
698# CONFIG_SCSI_IPR is not set 705# CONFIG_SCSI_IPR is not set
699# CONFIG_SCSI_QLOGIC_FC is not set
700# CONFIG_SCSI_QLOGIC_1280 is not set 706# CONFIG_SCSI_QLOGIC_1280 is not set
701# CONFIG_SCSI_QLA_FC is not set 707# CONFIG_SCSI_QLA_FC is not set
702# CONFIG_SCSI_LPFC is not set 708# CONFIG_SCSI_LPFC is not set
@@ -715,6 +721,7 @@ CONFIG_MD_RAID0=m
715CONFIG_MD_RAID1=m 721CONFIG_MD_RAID1=m
716CONFIG_MD_RAID10=m 722CONFIG_MD_RAID10=m
717CONFIG_MD_RAID5=m 723CONFIG_MD_RAID5=m
724CONFIG_MD_RAID5_RESHAPE=y
718CONFIG_MD_RAID6=m 725CONFIG_MD_RAID6=m
719CONFIG_MD_MULTIPATH=m 726CONFIG_MD_MULTIPATH=m
720CONFIG_MD_FAULTY=m 727CONFIG_MD_FAULTY=m
@@ -921,6 +928,7 @@ CONFIG_HW_CONSOLE=y
921# 928#
922CONFIG_SERIAL_8250=y 929CONFIG_SERIAL_8250=y
923CONFIG_SERIAL_8250_CONSOLE=y 930CONFIG_SERIAL_8250_CONSOLE=y
931CONFIG_SERIAL_8250_PCI=m
924CONFIG_SERIAL_8250_NR_UARTS=4 932CONFIG_SERIAL_8250_NR_UARTS=4
925CONFIG_SERIAL_8250_RUNTIME_UARTS=4 933CONFIG_SERIAL_8250_RUNTIME_UARTS=4
926# CONFIG_SERIAL_8250_EXTENDED is not set 934# CONFIG_SERIAL_8250_EXTENDED is not set
@@ -930,6 +938,7 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=4
930# 938#
931CONFIG_SERIAL_CORE=y 939CONFIG_SERIAL_CORE=y
932CONFIG_SERIAL_CORE_CONSOLE=y 940CONFIG_SERIAL_CORE_CONSOLE=y
941# CONFIG_SERIAL_JSM is not set
933CONFIG_UNIX98_PTYS=y 942CONFIG_UNIX98_PTYS=y
934CONFIG_LEGACY_PTYS=y 943CONFIG_LEGACY_PTYS=y
935CONFIG_LEGACY_PTY_COUNT=256 944CONFIG_LEGACY_PTY_COUNT=256
@@ -988,10 +997,6 @@ CONFIG_LEGACY_PTY_COUNT=256
988# 997#
989 998
990# 999#
991# Multimedia Capabilities Port drivers
992#
993
994#
995# Multimedia devices 1000# Multimedia devices
996# 1001#
997# CONFIG_VIDEO_DEV is not set 1002# CONFIG_VIDEO_DEV is not set
@@ -1022,6 +1027,7 @@ CONFIG_DUMMY_CONSOLE=y
1022# 1027#
1023CONFIG_USB_ARCH_HAS_HCD=y 1028CONFIG_USB_ARCH_HAS_HCD=y
1024CONFIG_USB_ARCH_HAS_OHCI=y 1029CONFIG_USB_ARCH_HAS_OHCI=y
1030CONFIG_USB_ARCH_HAS_EHCI=y
1025# CONFIG_USB is not set 1031# CONFIG_USB is not set
1026 1032
1027# 1033#
@@ -1039,13 +1045,31 @@ CONFIG_USB_ARCH_HAS_OHCI=y
1039# CONFIG_MMC is not set 1045# CONFIG_MMC is not set
1040 1046
1041# 1047#
1048# LED devices
1049#
1050# CONFIG_NEW_LEDS is not set
1051
1052#
1053# LED drivers
1054#
1055
1056#
1057# LED Triggers
1058#
1059
1060#
1042# InfiniBand support 1061# InfiniBand support
1043# 1062#
1044# CONFIG_INFINIBAND is not set 1063# CONFIG_INFINIBAND is not set
1045 1064
1046# 1065#
1047# SN Devices 1066# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
1067#
1068
1069#
1070# Real Time Clock
1048# 1071#
1072# CONFIG_RTC_CLASS is not set
1049 1073
1050# 1074#
1051# File systems 1075# File systems
@@ -1120,7 +1144,6 @@ CONFIG_SYSFS=y
1120# CONFIG_TMPFS is not set 1144# CONFIG_TMPFS is not set
1121# CONFIG_HUGETLB_PAGE is not set 1145# CONFIG_HUGETLB_PAGE is not set
1122CONFIG_RAMFS=y 1146CONFIG_RAMFS=y
1123CONFIG_RELAYFS_FS=m
1124# CONFIG_CONFIGFS_FS is not set 1147# CONFIG_CONFIGFS_FS is not set
1125 1148
1126# 1149#
@@ -1140,7 +1163,6 @@ CONFIG_VXFS_FS=m
1140# CONFIG_QNX4FS_FS is not set 1163# CONFIG_QNX4FS_FS is not set
1141CONFIG_SYSV_FS=m 1164CONFIG_SYSV_FS=m
1142CONFIG_UFS_FS=m 1165CONFIG_UFS_FS=m
1143# CONFIG_UFS_FS_WRITE is not set
1144 1166
1145# 1167#
1146# Network File Systems 1168# Network File Systems
@@ -1232,6 +1254,7 @@ CONFIG_NLS_UTF8=m
1232# CONFIG_MAGIC_SYSRQ is not set 1254# CONFIG_MAGIC_SYSRQ is not set
1233# CONFIG_DEBUG_KERNEL is not set 1255# CONFIG_DEBUG_KERNEL is not set
1234CONFIG_LOG_BUF_SHIFT=14 1256CONFIG_LOG_BUF_SHIFT=14
1257# CONFIG_DEBUG_FS is not set
1235CONFIG_CROSSCOMPILE=y 1258CONFIG_CROSSCOMPILE=y
1236CONFIG_CMDLINE="" 1259CONFIG_CMDLINE=""
1237 1260
diff --git a/arch/mips/configs/bigsur_defconfig b/arch/mips/configs/bigsur_defconfig
index 32984100a75e..d85cda58d650 100644
--- a/arch/mips/configs/bigsur_defconfig
+++ b/arch/mips/configs/bigsur_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc1 3# Linux kernel version: 2.6.17-rc2
4# Fri Jan 27 15:39:53 2006 4# Mon Apr 24 14:50:55 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -80,6 +80,8 @@ CONFIG_SIBYTE_CFE=y
80# CONFIG_SIBYTE_SB1250_PROF is not set 80# CONFIG_SIBYTE_SB1250_PROF is not set
81# CONFIG_SIBYTE_TBPROF is not set 81# CONFIG_SIBYTE_TBPROF is not set
82CONFIG_RWSEM_GENERIC_SPINLOCK=y 82CONFIG_RWSEM_GENERIC_SPINLOCK=y
83CONFIG_GENERIC_FIND_NEXT_BIT=y
84CONFIG_GENERIC_HWEIGHT=y
83CONFIG_GENERIC_CALIBRATE_DELAY=y 85CONFIG_GENERIC_CALIBRATE_DELAY=y
84CONFIG_DMA_COHERENT=y 86CONFIG_DMA_COHERENT=y
85CONFIG_CPU_BIG_ENDIAN=y 87CONFIG_CPU_BIG_ENDIAN=y
@@ -154,7 +156,6 @@ CONFIG_PREEMPT_NONE=y
154# Code maturity level options 156# Code maturity level options
155# 157#
156CONFIG_EXPERIMENTAL=y 158CONFIG_EXPERIMENTAL=y
157CONFIG_CLEAN_COMPILE=y
158CONFIG_LOCK_KERNEL=y 159CONFIG_LOCK_KERNEL=y
159CONFIG_INIT_ENV_ARG_LIMIT=32 160CONFIG_INIT_ENV_ARG_LIMIT=32
160 161
@@ -172,6 +173,7 @@ CONFIG_SYSCTL=y
172CONFIG_IKCONFIG=y 173CONFIG_IKCONFIG=y
173CONFIG_IKCONFIG_PROC=y 174CONFIG_IKCONFIG_PROC=y
174# CONFIG_CPUSETS is not set 175# CONFIG_CPUSETS is not set
176# CONFIG_RELAY is not set
175CONFIG_INITRAMFS_SOURCE="" 177CONFIG_INITRAMFS_SOURCE=""
176# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 178# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
177CONFIG_EMBEDDED=y 179CONFIG_EMBEDDED=y
@@ -186,10 +188,6 @@ CONFIG_BASE_FULL=y
186CONFIG_FUTEX=y 188CONFIG_FUTEX=y
187CONFIG_EPOLL=y 189CONFIG_EPOLL=y
188CONFIG_SHMEM=y 190CONFIG_SHMEM=y
189CONFIG_CC_ALIGN_FUNCTIONS=0
190CONFIG_CC_ALIGN_LABELS=0
191CONFIG_CC_ALIGN_LOOPS=0
192CONFIG_CC_ALIGN_JUMPS=0
193CONFIG_SLAB=y 191CONFIG_SLAB=y
194# CONFIG_TINY_SHMEM is not set 192# CONFIG_TINY_SHMEM is not set
195CONFIG_BASE_SMALL=0 193CONFIG_BASE_SMALL=0
@@ -201,7 +199,6 @@ CONFIG_BASE_SMALL=0
201CONFIG_MODULES=y 199CONFIG_MODULES=y
202CONFIG_MODULE_UNLOAD=y 200CONFIG_MODULE_UNLOAD=y
203# CONFIG_MODULE_FORCE_UNLOAD is not set 201# CONFIG_MODULE_FORCE_UNLOAD is not set
204CONFIG_OBSOLETE_MODPARM=y
205CONFIG_MODVERSIONS=y 202CONFIG_MODVERSIONS=y
206CONFIG_MODULE_SRCVERSION_ALL=y 203CONFIG_MODULE_SRCVERSION_ALL=y
207CONFIG_KMOD=y 204CONFIG_KMOD=y
@@ -210,6 +207,7 @@ CONFIG_STOP_MACHINE=y
210# 207#
211# Block layer 208# Block layer
212# 209#
210# CONFIG_BLK_DEV_IO_TRACE is not set
213 211
214# 212#
215# IO Schedulers 213# IO Schedulers
@@ -230,7 +228,6 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
230CONFIG_HW_HAS_PCI=y 228CONFIG_HW_HAS_PCI=y
231CONFIG_PCI=y 229CONFIG_PCI=y
232CONFIG_PCI_DOMAINS=y 230CONFIG_PCI_DOMAINS=y
233CONFIG_PCI_LEGACY_PROC=y
234CONFIG_PCI_DEBUG=y 231CONFIG_PCI_DEBUG=y
235CONFIG_MMU=y 232CONFIG_MMU=y
236 233
@@ -249,6 +246,7 @@ CONFIG_MMU=y
249# 246#
250CONFIG_BINFMT_ELF=y 247CONFIG_BINFMT_ELF=y
251# CONFIG_BINFMT_MISC is not set 248# CONFIG_BINFMT_MISC is not set
249CONFIG_BUILD_ELF64=y
252CONFIG_MIPS32_COMPAT=y 250CONFIG_MIPS32_COMPAT=y
253CONFIG_COMPAT=y 251CONFIG_COMPAT=y
254CONFIG_MIPS32_O32=y 252CONFIG_MIPS32_O32=y
@@ -263,6 +261,7 @@ CONFIG_NET=y
263# 261#
264# Networking options 262# Networking options
265# 263#
264# CONFIG_NETDEBUG is not set
266CONFIG_PACKET=y 265CONFIG_PACKET=y
267CONFIG_PACKET_MMAP=y 266CONFIG_PACKET_MMAP=y
268CONFIG_UNIX=y 267CONFIG_UNIX=y
@@ -284,12 +283,15 @@ CONFIG_IP_PNP_BOOTP=y
284# CONFIG_INET_AH is not set 283# CONFIG_INET_AH is not set
285# CONFIG_INET_ESP is not set 284# CONFIG_INET_ESP is not set
286# CONFIG_INET_IPCOMP is not set 285# CONFIG_INET_IPCOMP is not set
287CONFIG_INET_TUNNEL=m 286# CONFIG_INET_XFRM_TUNNEL is not set
287# CONFIG_INET_TUNNEL is not set
288CONFIG_INET_DIAG=y 288CONFIG_INET_DIAG=y
289CONFIG_INET_TCP_DIAG=y 289CONFIG_INET_TCP_DIAG=y
290# CONFIG_TCP_CONG_ADVANCED is not set 290# CONFIG_TCP_CONG_ADVANCED is not set
291CONFIG_TCP_CONG_BIC=y 291CONFIG_TCP_CONG_BIC=y
292# CONFIG_IPV6 is not set 292# CONFIG_IPV6 is not set
293# CONFIG_INET6_XFRM_TUNNEL is not set
294# CONFIG_INET6_TUNNEL is not set
293# CONFIG_NETFILTER is not set 295# CONFIG_NETFILTER is not set
294 296
295# 297#
@@ -301,6 +303,11 @@ CONFIG_TCP_CONG_BIC=y
301# SCTP Configuration (EXPERIMENTAL) 303# SCTP Configuration (EXPERIMENTAL)
302# 304#
303# CONFIG_IP_SCTP is not set 305# CONFIG_IP_SCTP is not set
306
307#
308# TIPC Configuration (EXPERIMENTAL)
309#
310# CONFIG_TIPC is not set
304# CONFIG_ATM is not set 311# CONFIG_ATM is not set
305# CONFIG_BRIDGE is not set 312# CONFIG_BRIDGE is not set
306# CONFIG_VLAN_8021Q is not set 313# CONFIG_VLAN_8021Q is not set
@@ -310,11 +317,6 @@ CONFIG_TCP_CONG_BIC=y
310# CONFIG_ATALK is not set 317# CONFIG_ATALK is not set
311# CONFIG_X25 is not set 318# CONFIG_X25 is not set
312# CONFIG_LAPB is not set 319# CONFIG_LAPB is not set
313
314#
315# TIPC Configuration (EXPERIMENTAL)
316#
317# CONFIG_TIPC is not set
318# CONFIG_NET_DIVERT is not set 320# CONFIG_NET_DIVERT is not set
319# CONFIG_ECONET is not set 321# CONFIG_ECONET is not set
320# CONFIG_WAN_ROUTER is not set 322# CONFIG_WAN_ROUTER is not set
@@ -377,7 +379,7 @@ CONFIG_BLK_DEV_LOOP=m
377CONFIG_BLK_DEV_NBD=m 379CONFIG_BLK_DEV_NBD=m
378# CONFIG_BLK_DEV_SX8 is not set 380# CONFIG_BLK_DEV_SX8 is not set
379# CONFIG_BLK_DEV_RAM is not set 381# CONFIG_BLK_DEV_RAM is not set
380CONFIG_BLK_DEV_RAM_COUNT=16 382# CONFIG_BLK_DEV_INITRD is not set
381# CONFIG_CDROM_PKTCDVD is not set 383# CONFIG_CDROM_PKTCDVD is not set
382# CONFIG_ATA_OVER_ETH is not set 384# CONFIG_ATA_OVER_ETH is not set
383 385
@@ -575,6 +577,7 @@ CONFIG_SIBYTE_SB1250_DUART_CONSOLE=y
575# 577#
576# Non-8250 serial port support 578# Non-8250 serial port support
577# 579#
580# CONFIG_SERIAL_JSM is not set
578CONFIG_UNIX98_PTYS=y 581CONFIG_UNIX98_PTYS=y
579CONFIG_LEGACY_PTYS=y 582CONFIG_LEGACY_PTYS=y
580CONFIG_LEGACY_PTY_COUNT=256 583CONFIG_LEGACY_PTY_COUNT=256
@@ -637,7 +640,6 @@ CONFIG_I2C_ALGO_SIBYTE=y
637# CONFIG_I2C_PROSAVAGE is not set 640# CONFIG_I2C_PROSAVAGE is not set
638# CONFIG_I2C_SAVAGE4 is not set 641# CONFIG_I2C_SAVAGE4 is not set
639CONFIG_I2C_SIBYTE=y 642CONFIG_I2C_SIBYTE=y
640# CONFIG_SCx200_ACB is not set
641# CONFIG_I2C_SIS5595 is not set 643# CONFIG_I2C_SIS5595 is not set
642# CONFIG_I2C_SIS630 is not set 644# CONFIG_I2C_SIS630 is not set
643# CONFIG_I2C_SIS96X is not set 645# CONFIG_I2C_SIS96X is not set
@@ -656,9 +658,7 @@ CONFIG_SENSORS_EEPROM=y
656CONFIG_SENSORS_PCF8574=y 658CONFIG_SENSORS_PCF8574=y
657CONFIG_SENSORS_PCA9539=y 659CONFIG_SENSORS_PCA9539=y
658CONFIG_SENSORS_PCF8591=y 660CONFIG_SENSORS_PCF8591=y
659CONFIG_SENSORS_RTC8564=y
660CONFIG_SENSORS_MAX6875=y 661CONFIG_SENSORS_MAX6875=y
661# CONFIG_RTC_X1205_I2C is not set
662CONFIG_I2C_DEBUG_CORE=y 662CONFIG_I2C_DEBUG_CORE=y
663CONFIG_I2C_DEBUG_ALGO=y 663CONFIG_I2C_DEBUG_ALGO=y
664CONFIG_I2C_DEBUG_BUS=y 664CONFIG_I2C_DEBUG_BUS=y
@@ -686,10 +686,6 @@ CONFIG_I2C_DEBUG_CHIP=y
686# 686#
687 687
688# 688#
689# Multimedia Capabilities Port drivers
690#
691
692#
693# Multimedia devices 689# Multimedia devices
694# 690#
695# CONFIG_VIDEO_DEV is not set 691# CONFIG_VIDEO_DEV is not set
@@ -714,6 +710,7 @@ CONFIG_I2C_DEBUG_CHIP=y
714# 710#
715CONFIG_USB_ARCH_HAS_HCD=y 711CONFIG_USB_ARCH_HAS_HCD=y
716CONFIG_USB_ARCH_HAS_OHCI=y 712CONFIG_USB_ARCH_HAS_OHCI=y
713CONFIG_USB_ARCH_HAS_EHCI=y
717# CONFIG_USB is not set 714# CONFIG_USB is not set
718 715
719# 716#
@@ -731,13 +728,31 @@ CONFIG_USB_ARCH_HAS_OHCI=y
731# CONFIG_MMC is not set 728# CONFIG_MMC is not set
732 729
733# 730#
731# LED devices
732#
733# CONFIG_NEW_LEDS is not set
734
735#
736# LED drivers
737#
738
739#
740# LED Triggers
741#
742
743#
734# InfiniBand support 744# InfiniBand support
735# 745#
736# CONFIG_INFINIBAND is not set 746# CONFIG_INFINIBAND is not set
737 747
738# 748#
739# SN Devices 749# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
750#
751
752#
753# Real Time Clock
740# 754#
755# CONFIG_RTC_CLASS is not set
741 756
742# 757#
743# File systems 758# File systems
@@ -785,7 +800,6 @@ CONFIG_SYSFS=y
785# CONFIG_TMPFS is not set 800# CONFIG_TMPFS is not set
786# CONFIG_HUGETLB_PAGE is not set 801# CONFIG_HUGETLB_PAGE is not set
787CONFIG_RAMFS=y 802CONFIG_RAMFS=y
788# CONFIG_RELAYFS_FS is not set
789# CONFIG_CONFIGFS_FS is not set 803# CONFIG_CONFIGFS_FS is not set
790 804
791# 805#
diff --git a/arch/mips/configs/capcella_defconfig b/arch/mips/configs/capcella_defconfig
index 6c2961affbd6..ca0af1683a00 100644
--- a/arch/mips/configs/capcella_defconfig
+++ b/arch/mips/configs/capcella_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc1 3# Linux kernel version: 2.6.17-rc2
4# Fri Jan 27 15:39:54 2006 4# Tue Apr 25 00:08:06 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -72,6 +72,8 @@ CONFIG_ZAO_CAPCELLA=y
72CONFIG_PCI_VR41XX=y 72CONFIG_PCI_VR41XX=y
73# CONFIG_VRC4173 is not set 73# CONFIG_VRC4173 is not set
74CONFIG_RWSEM_GENERIC_SPINLOCK=y 74CONFIG_RWSEM_GENERIC_SPINLOCK=y
75CONFIG_GENERIC_FIND_NEXT_BIT=y
76CONFIG_GENERIC_HWEIGHT=y
75CONFIG_GENERIC_CALIBRATE_DELAY=y 77CONFIG_GENERIC_CALIBRATE_DELAY=y
76CONFIG_DMA_NONCOHERENT=y 78CONFIG_DMA_NONCOHERENT=y
77CONFIG_DMA_NEED_PCI_MAP_STATE=y 79CONFIG_DMA_NEED_PCI_MAP_STATE=y
@@ -90,7 +92,7 @@ CONFIG_MIPS_L1_CACHE_SHIFT=5
90# CONFIG_CPU_MIPS64_R2 is not set 92# CONFIG_CPU_MIPS64_R2 is not set
91# CONFIG_CPU_R3000 is not set 93# CONFIG_CPU_R3000 is not set
92# CONFIG_CPU_TX39XX is not set 94# CONFIG_CPU_TX39XX is not set
93# CONFIG_CPU_VR41XX is not set 95CONFIG_CPU_VR41XX=y
94# CONFIG_CPU_R4300 is not set 96# CONFIG_CPU_R4300 is not set
95# CONFIG_CPU_R4X00 is not set 97# CONFIG_CPU_R4X00 is not set
96# CONFIG_CPU_TX49XX is not set 98# CONFIG_CPU_TX49XX is not set
@@ -103,18 +105,21 @@ CONFIG_MIPS_L1_CACHE_SHIFT=5
103# CONFIG_CPU_RM7000 is not set 105# CONFIG_CPU_RM7000 is not set
104# CONFIG_CPU_RM9000 is not set 106# CONFIG_CPU_RM9000 is not set
105# CONFIG_CPU_SB1 is not set 107# CONFIG_CPU_SB1 is not set
108CONFIG_SYS_HAS_CPU_VR41XX=y
109CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
110CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
111CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
106 112
107# 113#
108# Kernel type 114# Kernel type
109# 115#
110# CONFIG_32BIT is not set 116CONFIG_32BIT=y
111# CONFIG_64BIT is not set 117# CONFIG_64BIT is not set
112CONFIG_PAGE_SIZE_4KB=y 118CONFIG_PAGE_SIZE_4KB=y
113# CONFIG_PAGE_SIZE_8KB is not set 119# CONFIG_PAGE_SIZE_8KB is not set
114# CONFIG_PAGE_SIZE_16KB is not set 120# CONFIG_PAGE_SIZE_16KB is not set
115# CONFIG_PAGE_SIZE_64KB is not set 121# CONFIG_PAGE_SIZE_64KB is not set
116# CONFIG_MIPS_MT is not set 122# CONFIG_MIPS_MT is not set
117CONFIG_CPU_HAS_LLSC=y
118CONFIG_CPU_HAS_SYNC=y 123CONFIG_CPU_HAS_SYNC=y
119CONFIG_GENERIC_HARDIRQS=y 124CONFIG_GENERIC_HARDIRQS=y
120CONFIG_GENERIC_IRQ_PROBE=y 125CONFIG_GENERIC_IRQ_PROBE=y
@@ -135,7 +140,6 @@ CONFIG_PREEMPT_NONE=y
135# Code maturity level options 140# Code maturity level options
136# 141#
137CONFIG_EXPERIMENTAL=y 142CONFIG_EXPERIMENTAL=y
138CONFIG_CLEAN_COMPILE=y
139CONFIG_BROKEN_ON_SMP=y 143CONFIG_BROKEN_ON_SMP=y
140CONFIG_INIT_ENV_ARG_LIMIT=32 144CONFIG_INIT_ENV_ARG_LIMIT=32
141 145
@@ -151,6 +155,7 @@ CONFIG_SYSVIPC=y
151CONFIG_SYSCTL=y 155CONFIG_SYSCTL=y
152# CONFIG_AUDIT is not set 156# CONFIG_AUDIT is not set
153# CONFIG_IKCONFIG is not set 157# CONFIG_IKCONFIG is not set
158# CONFIG_RELAY is not set
154CONFIG_INITRAMFS_SOURCE="" 159CONFIG_INITRAMFS_SOURCE=""
155# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 160# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
156CONFIG_EMBEDDED=y 161CONFIG_EMBEDDED=y
@@ -164,10 +169,6 @@ CONFIG_BASE_FULL=y
164CONFIG_FUTEX=y 169CONFIG_FUTEX=y
165CONFIG_EPOLL=y 170CONFIG_EPOLL=y
166CONFIG_SHMEM=y 171CONFIG_SHMEM=y
167CONFIG_CC_ALIGN_FUNCTIONS=0
168CONFIG_CC_ALIGN_LABELS=0
169CONFIG_CC_ALIGN_LOOPS=0
170CONFIG_CC_ALIGN_JUMPS=0
171CONFIG_SLAB=y 172CONFIG_SLAB=y
172# CONFIG_TINY_SHMEM is not set 173# CONFIG_TINY_SHMEM is not set
173CONFIG_BASE_SMALL=0 174CONFIG_BASE_SMALL=0
@@ -179,7 +180,6 @@ CONFIG_BASE_SMALL=0
179CONFIG_MODULES=y 180CONFIG_MODULES=y
180CONFIG_MODULE_UNLOAD=y 181CONFIG_MODULE_UNLOAD=y
181# CONFIG_MODULE_FORCE_UNLOAD is not set 182# CONFIG_MODULE_FORCE_UNLOAD is not set
182CONFIG_OBSOLETE_MODPARM=y
183CONFIG_MODVERSIONS=y 183CONFIG_MODVERSIONS=y
184CONFIG_MODULE_SRCVERSION_ALL=y 184CONFIG_MODULE_SRCVERSION_ALL=y
185CONFIG_KMOD=y 185CONFIG_KMOD=y
@@ -187,6 +187,9 @@ CONFIG_KMOD=y
187# 187#
188# Block layer 188# Block layer
189# 189#
190# CONFIG_LBD is not set
191# CONFIG_BLK_DEV_IO_TRACE is not set
192# CONFIG_LSF is not set
190 193
191# 194#
192# IO Schedulers 195# IO Schedulers
@@ -206,7 +209,6 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
206# 209#
207CONFIG_HW_HAS_PCI=y 210CONFIG_HW_HAS_PCI=y
208CONFIG_PCI=y 211CONFIG_PCI=y
209CONFIG_PCI_LEGACY_PROC=y
210CONFIG_MMU=y 212CONFIG_MMU=y
211 213
212# 214#
@@ -224,6 +226,7 @@ CONFIG_MMU=y
224# 226#
225CONFIG_BINFMT_ELF=y 227CONFIG_BINFMT_ELF=y
226# CONFIG_BINFMT_MISC is not set 228# CONFIG_BINFMT_MISC is not set
229CONFIG_TRAD_SIGNALS=y
227 230
228# 231#
229# Networking 232# Networking
@@ -233,6 +236,7 @@ CONFIG_NET=y
233# 236#
234# Networking options 237# Networking options
235# 238#
239# CONFIG_NETDEBUG is not set
236CONFIG_PACKET=y 240CONFIG_PACKET=y
237CONFIG_PACKET_MMAP=y 241CONFIG_PACKET_MMAP=y
238CONFIG_UNIX=y 242CONFIG_UNIX=y
@@ -255,12 +259,15 @@ CONFIG_IP_PNP_BOOTP=y
255# CONFIG_INET_AH is not set 259# CONFIG_INET_AH is not set
256# CONFIG_INET_ESP is not set 260# CONFIG_INET_ESP is not set
257# CONFIG_INET_IPCOMP is not set 261# CONFIG_INET_IPCOMP is not set
258CONFIG_INET_TUNNEL=m 262# CONFIG_INET_XFRM_TUNNEL is not set
263# CONFIG_INET_TUNNEL is not set
259CONFIG_INET_DIAG=y 264CONFIG_INET_DIAG=y
260CONFIG_INET_TCP_DIAG=y 265CONFIG_INET_TCP_DIAG=y
261# CONFIG_TCP_CONG_ADVANCED is not set 266# CONFIG_TCP_CONG_ADVANCED is not set
262CONFIG_TCP_CONG_BIC=y 267CONFIG_TCP_CONG_BIC=y
263# CONFIG_IPV6 is not set 268# CONFIG_IPV6 is not set
269# CONFIG_INET6_XFRM_TUNNEL is not set
270# CONFIG_INET6_TUNNEL is not set
264# CONFIG_NETFILTER is not set 271# CONFIG_NETFILTER is not set
265 272
266# 273#
@@ -272,6 +279,11 @@ CONFIG_TCP_CONG_BIC=y
272# SCTP Configuration (EXPERIMENTAL) 279# SCTP Configuration (EXPERIMENTAL)
273# 280#
274# CONFIG_IP_SCTP is not set 281# CONFIG_IP_SCTP is not set
282
283#
284# TIPC Configuration (EXPERIMENTAL)
285#
286# CONFIG_TIPC is not set
275# CONFIG_ATM is not set 287# CONFIG_ATM is not set
276# CONFIG_BRIDGE is not set 288# CONFIG_BRIDGE is not set
277# CONFIG_VLAN_8021Q is not set 289# CONFIG_VLAN_8021Q is not set
@@ -281,11 +293,6 @@ CONFIG_TCP_CONG_BIC=y
281# CONFIG_ATALK is not set 293# CONFIG_ATALK is not set
282# CONFIG_X25 is not set 294# CONFIG_X25 is not set
283# CONFIG_LAPB is not set 295# CONFIG_LAPB is not set
284
285#
286# TIPC Configuration (EXPERIMENTAL)
287#
288# CONFIG_TIPC is not set
289# CONFIG_NET_DIVERT is not set 296# CONFIG_NET_DIVERT is not set
290# CONFIG_ECONET is not set 297# CONFIG_ECONET is not set
291# CONFIG_WAN_ROUTER is not set 298# CONFIG_WAN_ROUTER is not set
@@ -302,10 +309,7 @@ CONFIG_TCP_CONG_BIC=y
302# CONFIG_HAMRADIO is not set 309# CONFIG_HAMRADIO is not set
303# CONFIG_IRDA is not set 310# CONFIG_IRDA is not set
304# CONFIG_BT is not set 311# CONFIG_BT is not set
305CONFIG_IEEE80211=m 312# CONFIG_IEEE80211 is not set
306# CONFIG_IEEE80211_DEBUG is not set
307CONFIG_IEEE80211_CRYPT_WEP=m
308CONFIG_IEEE80211_CRYPT_CCMP=m
309 313
310# 314#
311# Device Drivers 315# Device Drivers
@@ -348,10 +352,12 @@ CONFIG_CONNECTOR=m
348# CONFIG_BLK_DEV_LOOP is not set 352# CONFIG_BLK_DEV_LOOP is not set
349# CONFIG_BLK_DEV_NBD is not set 353# CONFIG_BLK_DEV_NBD is not set
350# CONFIG_BLK_DEV_SX8 is not set 354# CONFIG_BLK_DEV_SX8 is not set
351# CONFIG_BLK_DEV_RAM is not set 355CONFIG_BLK_DEV_RAM=y
352CONFIG_BLK_DEV_RAM_COUNT=16 356CONFIG_BLK_DEV_RAM_COUNT=16
357CONFIG_BLK_DEV_RAM_SIZE=4096
358# CONFIG_BLK_DEV_INITRD is not set
353# CONFIG_CDROM_PKTCDVD is not set 359# CONFIG_CDROM_PKTCDVD is not set
354CONFIG_ATA_OVER_ETH=m 360# CONFIG_ATA_OVER_ETH is not set
355 361
356# 362#
357# ATA/ATAPI/MFM/RLL support 363# ATA/ATAPI/MFM/RLL support
@@ -578,6 +584,11 @@ CONFIG_HW_CONSOLE=y
578# 584#
579# Non-8250 serial port support 585# Non-8250 serial port support
580# 586#
587CONFIG_SERIAL_CORE=y
588CONFIG_SERIAL_CORE_CONSOLE=y
589CONFIG_SERIAL_VR41XX=y
590CONFIG_SERIAL_VR41XX_CONSOLE=y
591# CONFIG_SERIAL_JSM is not set
581CONFIG_UNIX98_PTYS=y 592CONFIG_UNIX98_PTYS=y
582CONFIG_LEGACY_PTYS=y 593CONFIG_LEGACY_PTYS=y
583CONFIG_LEGACY_PTY_COUNT=256 594CONFIG_LEGACY_PTY_COUNT=256
@@ -601,6 +612,7 @@ CONFIG_LEGACY_PTY_COUNT=256
601# Ftape, the floppy tape device driver 612# Ftape, the floppy tape device driver
602# 613#
603# CONFIG_DRM is not set 614# CONFIG_DRM is not set
615CONFIG_GPIO_VR41XX=y
604# CONFIG_RAW_DRIVER is not set 616# CONFIG_RAW_DRIVER is not set
605 617
606# 618#
@@ -636,10 +648,6 @@ CONFIG_LEGACY_PTY_COUNT=256
636# 648#
637 649
638# 650#
639# Multimedia Capabilities Port drivers
640#
641
642#
643# Multimedia devices 651# Multimedia devices
644# 652#
645# CONFIG_VIDEO_DEV is not set 653# CONFIG_VIDEO_DEV is not set
@@ -670,6 +678,7 @@ CONFIG_DUMMY_CONSOLE=y
670# 678#
671CONFIG_USB_ARCH_HAS_HCD=y 679CONFIG_USB_ARCH_HAS_HCD=y
672CONFIG_USB_ARCH_HAS_OHCI=y 680CONFIG_USB_ARCH_HAS_OHCI=y
681CONFIG_USB_ARCH_HAS_EHCI=y
673# CONFIG_USB is not set 682# CONFIG_USB is not set
674 683
675# 684#
@@ -687,13 +696,48 @@ CONFIG_USB_ARCH_HAS_OHCI=y
687# CONFIG_MMC is not set 696# CONFIG_MMC is not set
688 697
689# 698#
699# LED devices
700#
701# CONFIG_NEW_LEDS is not set
702
703#
704# LED drivers
705#
706
707#
708# LED Triggers
709#
710
711#
690# InfiniBand support 712# InfiniBand support
691# 713#
692# CONFIG_INFINIBAND is not set 714# CONFIG_INFINIBAND is not set
693 715
694# 716#
695# SN Devices 717# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
718#
719
720#
721# Real Time Clock
722#
723CONFIG_RTC_LIB=y
724CONFIG_RTC_CLASS=y
725CONFIG_RTC_HCTOSYS=y
726CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
727
728#
729# RTC interfaces
730#
731CONFIG_RTC_INTF_SYSFS=y
732CONFIG_RTC_INTF_PROC=y
733CONFIG_RTC_INTF_DEV=y
734
735#
736# RTC drivers
696# 737#
738# CONFIG_RTC_DRV_M48T86 is not set
739CONFIG_RTC_DRV_VR41XX=y
740# CONFIG_RTC_DRV_TEST is not set
697 741
698# 742#
699# File systems 743# File systems
@@ -712,7 +756,7 @@ CONFIG_EXT2_FS=y
712CONFIG_INOTIFY=y 756CONFIG_INOTIFY=y
713# CONFIG_QUOTA is not set 757# CONFIG_QUOTA is not set
714CONFIG_DNOTIFY=y 758CONFIG_DNOTIFY=y
715CONFIG_AUTOFS_FS=y 759# CONFIG_AUTOFS_FS is not set
716CONFIG_AUTOFS4_FS=y 760CONFIG_AUTOFS4_FS=y
717CONFIG_FUSE_FS=m 761CONFIG_FUSE_FS=m
718 762
@@ -735,10 +779,9 @@ CONFIG_FUSE_FS=m
735CONFIG_PROC_FS=y 779CONFIG_PROC_FS=y
736CONFIG_PROC_KCORE=y 780CONFIG_PROC_KCORE=y
737CONFIG_SYSFS=y 781CONFIG_SYSFS=y
738# CONFIG_TMPFS is not set 782CONFIG_TMPFS=y
739# CONFIG_HUGETLB_PAGE is not set 783# CONFIG_HUGETLB_PAGE is not set
740CONFIG_RAMFS=y 784CONFIG_RAMFS=y
741CONFIG_RELAYFS_FS=m
742# CONFIG_CONFIGFS_FS is not set 785# CONFIG_CONFIGFS_FS is not set
743 786
744# 787#
@@ -805,44 +848,20 @@ CONFIG_MSDOS_PARTITION=y
805# CONFIG_MAGIC_SYSRQ is not set 848# CONFIG_MAGIC_SYSRQ is not set
806# CONFIG_DEBUG_KERNEL is not set 849# CONFIG_DEBUG_KERNEL is not set
807CONFIG_LOG_BUF_SHIFT=14 850CONFIG_LOG_BUF_SHIFT=14
851# CONFIG_DEBUG_FS is not set
808CONFIG_CROSSCOMPILE=y 852CONFIG_CROSSCOMPILE=y
809CONFIG_CMDLINE="mem=32M console=ttyVR0,38400" 853CONFIG_CMDLINE="mem=32M console=ttyVR0,38400"
810 854
811# 855#
812# Security options 856# Security options
813# 857#
814CONFIG_KEYS=y 858# CONFIG_KEYS is not set
815CONFIG_KEYS_DEBUG_PROC_KEYS=y
816# CONFIG_SECURITY is not set 859# CONFIG_SECURITY is not set
817 860
818# 861#
819# Cryptographic options 862# Cryptographic options
820# 863#
821CONFIG_CRYPTO=y 864# CONFIG_CRYPTO is not set
822CONFIG_CRYPTO_HMAC=y
823CONFIG_CRYPTO_NULL=m
824CONFIG_CRYPTO_MD4=m
825CONFIG_CRYPTO_MD5=m
826CONFIG_CRYPTO_SHA1=m
827CONFIG_CRYPTO_SHA256=m
828CONFIG_CRYPTO_SHA512=m
829CONFIG_CRYPTO_WP512=m
830CONFIG_CRYPTO_TGR192=m
831CONFIG_CRYPTO_DES=m
832CONFIG_CRYPTO_BLOWFISH=m
833CONFIG_CRYPTO_TWOFISH=m
834CONFIG_CRYPTO_SERPENT=m
835CONFIG_CRYPTO_AES=m
836CONFIG_CRYPTO_CAST5=m
837CONFIG_CRYPTO_CAST6=m
838CONFIG_CRYPTO_TEA=m
839CONFIG_CRYPTO_ARC4=m
840CONFIG_CRYPTO_KHAZAD=m
841CONFIG_CRYPTO_ANUBIS=m
842CONFIG_CRYPTO_DEFLATE=m
843CONFIG_CRYPTO_MICHAEL_MIC=m
844CONFIG_CRYPTO_CRC32C=m
845# CONFIG_CRYPTO_TEST is not set
846 865
847# 866#
848# Hardware crypto devices 867# Hardware crypto devices
@@ -852,8 +871,6 @@ CONFIG_CRYPTO_CRC32C=m
852# Library routines 871# Library routines
853# 872#
854# CONFIG_CRC_CCITT is not set 873# CONFIG_CRC_CCITT is not set
855CONFIG_CRC16=m 874# CONFIG_CRC16 is not set
856CONFIG_CRC32=y 875CONFIG_CRC32=y
857CONFIG_LIBCRC32C=m 876# CONFIG_LIBCRC32C is not set
858CONFIG_ZLIB_INFLATE=m
859CONFIG_ZLIB_DEFLATE=m
diff --git a/arch/mips/configs/cobalt_defconfig b/arch/mips/configs/cobalt_defconfig
index 8336b21d3db2..7d269e609282 100644
--- a/arch/mips/configs/cobalt_defconfig
+++ b/arch/mips/configs/cobalt_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc1 3# Linux kernel version: 2.6.17-rc2
4# Fri Jan 27 15:39:55 2006 4# Mon Apr 24 14:50:57 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -63,7 +63,10 @@ CONFIG_MIPS_COBALT=y
63# CONFIG_TOSHIBA_JMR3927 is not set 63# CONFIG_TOSHIBA_JMR3927 is not set
64# CONFIG_TOSHIBA_RBTX4927 is not set 64# CONFIG_TOSHIBA_RBTX4927 is not set
65# CONFIG_TOSHIBA_RBTX4938 is not set 65# CONFIG_TOSHIBA_RBTX4938 is not set
66CONFIG_EARLY_PRINTK=y
66CONFIG_RWSEM_GENERIC_SPINLOCK=y 67CONFIG_RWSEM_GENERIC_SPINLOCK=y
68CONFIG_GENERIC_FIND_NEXT_BIT=y
69CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 70CONFIG_GENERIC_CALIBRATE_DELAY=y
68CONFIG_DMA_NONCOHERENT=y 71CONFIG_DMA_NONCOHERENT=y
69CONFIG_DMA_NEED_PCI_MAP_STATE=y 72CONFIG_DMA_NEED_PCI_MAP_STATE=y
@@ -113,7 +116,6 @@ CONFIG_PAGE_SIZE_4KB=y
113# CONFIG_PAGE_SIZE_16KB is not set 116# CONFIG_PAGE_SIZE_16KB is not set
114# CONFIG_PAGE_SIZE_64KB is not set 117# CONFIG_PAGE_SIZE_64KB is not set
115# CONFIG_MIPS_MT is not set 118# CONFIG_MIPS_MT is not set
116# CONFIG_CPU_ADVANCED is not set
117CONFIG_CPU_HAS_LLSC=y 119CONFIG_CPU_HAS_LLSC=y
118CONFIG_CPU_HAS_SYNC=y 120CONFIG_CPU_HAS_SYNC=y
119CONFIG_GENERIC_HARDIRQS=y 121CONFIG_GENERIC_HARDIRQS=y
@@ -135,7 +137,6 @@ CONFIG_PREEMPT_NONE=y
135# Code maturity level options 137# Code maturity level options
136# 138#
137CONFIG_EXPERIMENTAL=y 139CONFIG_EXPERIMENTAL=y
138CONFIG_CLEAN_COMPILE=y
139CONFIG_BROKEN_ON_SMP=y 140CONFIG_BROKEN_ON_SMP=y
140CONFIG_INIT_ENV_ARG_LIMIT=32 141CONFIG_INIT_ENV_ARG_LIMIT=32
141 142
@@ -151,6 +152,7 @@ CONFIG_SYSVIPC=y
151CONFIG_SYSCTL=y 152CONFIG_SYSCTL=y
152# CONFIG_AUDIT is not set 153# CONFIG_AUDIT is not set
153# CONFIG_IKCONFIG is not set 154# CONFIG_IKCONFIG is not set
155CONFIG_RELAY=y
154CONFIG_INITRAMFS_SOURCE="" 156CONFIG_INITRAMFS_SOURCE=""
155# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 157# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
156CONFIG_EMBEDDED=y 158CONFIG_EMBEDDED=y
@@ -164,10 +166,6 @@ CONFIG_BASE_FULL=y
164CONFIG_FUTEX=y 166CONFIG_FUTEX=y
165CONFIG_EPOLL=y 167CONFIG_EPOLL=y
166CONFIG_SHMEM=y 168CONFIG_SHMEM=y
167CONFIG_CC_ALIGN_FUNCTIONS=0
168CONFIG_CC_ALIGN_LABELS=0
169CONFIG_CC_ALIGN_LOOPS=0
170CONFIG_CC_ALIGN_JUMPS=0
171CONFIG_SLAB=y 169CONFIG_SLAB=y
172# CONFIG_TINY_SHMEM is not set 170# CONFIG_TINY_SHMEM is not set
173CONFIG_BASE_SMALL=0 171CONFIG_BASE_SMALL=0
@@ -182,6 +180,8 @@ CONFIG_BASE_SMALL=0
182# Block layer 180# Block layer
183# 181#
184# CONFIG_LBD is not set 182# CONFIG_LBD is not set
183# CONFIG_BLK_DEV_IO_TRACE is not set
184# CONFIG_LSF is not set
185 185
186# 186#
187# IO Schedulers 187# IO Schedulers
@@ -201,7 +201,6 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
201# 201#
202CONFIG_HW_HAS_PCI=y 202CONFIG_HW_HAS_PCI=y
203CONFIG_PCI=y 203CONFIG_PCI=y
204CONFIG_PCI_LEGACY_PROC=y
205CONFIG_MMU=y 204CONFIG_MMU=y
206 205
207# 206#
@@ -229,6 +228,7 @@ CONFIG_NET=y
229# 228#
230# Networking options 229# Networking options
231# 230#
231# CONFIG_NETDEBUG is not set
232CONFIG_PACKET=y 232CONFIG_PACKET=y
233# CONFIG_PACKET_MMAP is not set 233# CONFIG_PACKET_MMAP is not set
234CONFIG_UNIX=y 234CONFIG_UNIX=y
@@ -247,12 +247,15 @@ CONFIG_IP_FIB_HASH=y
247# CONFIG_INET_AH is not set 247# CONFIG_INET_AH is not set
248# CONFIG_INET_ESP is not set 248# CONFIG_INET_ESP is not set
249# CONFIG_INET_IPCOMP is not set 249# CONFIG_INET_IPCOMP is not set
250CONFIG_INET_TUNNEL=y 250# CONFIG_INET_XFRM_TUNNEL is not set
251# CONFIG_INET_TUNNEL is not set
251CONFIG_INET_DIAG=y 252CONFIG_INET_DIAG=y
252CONFIG_INET_TCP_DIAG=y 253CONFIG_INET_TCP_DIAG=y
253# CONFIG_TCP_CONG_ADVANCED is not set 254# CONFIG_TCP_CONG_ADVANCED is not set
254CONFIG_TCP_CONG_BIC=y 255CONFIG_TCP_CONG_BIC=y
255# CONFIG_IPV6 is not set 256# CONFIG_IPV6 is not set
257# CONFIG_INET6_XFRM_TUNNEL is not set
258# CONFIG_INET6_TUNNEL is not set
256# CONFIG_NETFILTER is not set 259# CONFIG_NETFILTER is not set
257 260
258# 261#
@@ -264,6 +267,11 @@ CONFIG_TCP_CONG_BIC=y
264# SCTP Configuration (EXPERIMENTAL) 267# SCTP Configuration (EXPERIMENTAL)
265# 268#
266# CONFIG_IP_SCTP is not set 269# CONFIG_IP_SCTP is not set
270
271#
272# TIPC Configuration (EXPERIMENTAL)
273#
274# CONFIG_TIPC is not set
267# CONFIG_ATM is not set 275# CONFIG_ATM is not set
268# CONFIG_BRIDGE is not set 276# CONFIG_BRIDGE is not set
269# CONFIG_VLAN_8021Q is not set 277# CONFIG_VLAN_8021Q is not set
@@ -273,11 +281,6 @@ CONFIG_TCP_CONG_BIC=y
273# CONFIG_ATALK is not set 281# CONFIG_ATALK is not set
274# CONFIG_X25 is not set 282# CONFIG_X25 is not set
275# CONFIG_LAPB is not set 283# CONFIG_LAPB is not set
276
277#
278# TIPC Configuration (EXPERIMENTAL)
279#
280# CONFIG_TIPC is not set
281# CONFIG_NET_DIVERT is not set 284# CONFIG_NET_DIVERT is not set
282# CONFIG_ECONET is not set 285# CONFIG_ECONET is not set
283# CONFIG_WAN_ROUTER is not set 286# CONFIG_WAN_ROUTER is not set
@@ -298,6 +301,9 @@ CONFIG_IEEE80211=y
298# CONFIG_IEEE80211_DEBUG is not set 301# CONFIG_IEEE80211_DEBUG is not set
299CONFIG_IEEE80211_CRYPT_WEP=y 302CONFIG_IEEE80211_CRYPT_WEP=y
300CONFIG_IEEE80211_CRYPT_CCMP=y 303CONFIG_IEEE80211_CRYPT_CCMP=y
304CONFIG_IEEE80211_SOFTMAC=y
305# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
306CONFIG_WIRELESS_EXT=y
301 307
302# 308#
303# Device Drivers 309# Device Drivers
@@ -343,7 +349,7 @@ CONFIG_BLK_DEV_LOOP=y
343# CONFIG_BLK_DEV_NBD is not set 349# CONFIG_BLK_DEV_NBD is not set
344# CONFIG_BLK_DEV_SX8 is not set 350# CONFIG_BLK_DEV_SX8 is not set
345# CONFIG_BLK_DEV_RAM is not set 351# CONFIG_BLK_DEV_RAM is not set
346CONFIG_BLK_DEV_RAM_COUNT=16 352# CONFIG_BLK_DEV_INITRD is not set
347CONFIG_CDROM_PKTCDVD=y 353CONFIG_CDROM_PKTCDVD=y
348CONFIG_CDROM_PKTCDVD_BUFFERS=8 354CONFIG_CDROM_PKTCDVD_BUFFERS=8
349# CONFIG_CDROM_PKTCDVD_WCACHE is not set 355# CONFIG_CDROM_PKTCDVD_WCACHE is not set
@@ -593,6 +599,7 @@ CONFIG_HW_CONSOLE=y
593# 599#
594CONFIG_SERIAL_8250=y 600CONFIG_SERIAL_8250=y
595CONFIG_SERIAL_8250_CONSOLE=y 601CONFIG_SERIAL_8250_CONSOLE=y
602CONFIG_SERIAL_8250_PCI=y
596CONFIG_SERIAL_8250_NR_UARTS=4 603CONFIG_SERIAL_8250_NR_UARTS=4
597CONFIG_SERIAL_8250_RUNTIME_UARTS=4 604CONFIG_SERIAL_8250_RUNTIME_UARTS=4
598# CONFIG_SERIAL_8250_EXTENDED is not set 605# CONFIG_SERIAL_8250_EXTENDED is not set
@@ -602,6 +609,7 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=4
602# 609#
603CONFIG_SERIAL_CORE=y 610CONFIG_SERIAL_CORE=y
604CONFIG_SERIAL_CORE_CONSOLE=y 611CONFIG_SERIAL_CORE_CONSOLE=y
612# CONFIG_SERIAL_JSM is not set
605CONFIG_UNIX98_PTYS=y 613CONFIG_UNIX98_PTYS=y
606CONFIG_LEGACY_PTYS=y 614CONFIG_LEGACY_PTYS=y
607CONFIG_LEGACY_PTY_COUNT=256 615CONFIG_LEGACY_PTY_COUNT=256
@@ -660,10 +668,6 @@ CONFIG_COBALT_LCD=y
660# 668#
661 669
662# 670#
663# Multimedia Capabilities Port drivers
664#
665
666#
667# Multimedia devices 671# Multimedia devices
668# 672#
669# CONFIG_VIDEO_DEV is not set 673# CONFIG_VIDEO_DEV is not set
@@ -694,6 +698,7 @@ CONFIG_DUMMY_CONSOLE=y
694# 698#
695CONFIG_USB_ARCH_HAS_HCD=y 699CONFIG_USB_ARCH_HAS_HCD=y
696CONFIG_USB_ARCH_HAS_OHCI=y 700CONFIG_USB_ARCH_HAS_OHCI=y
701CONFIG_USB_ARCH_HAS_EHCI=y
697# CONFIG_USB is not set 702# CONFIG_USB is not set
698 703
699# 704#
@@ -711,13 +716,31 @@ CONFIG_USB_ARCH_HAS_OHCI=y
711# CONFIG_MMC is not set 716# CONFIG_MMC is not set
712 717
713# 718#
719# LED devices
720#
721# CONFIG_NEW_LEDS is not set
722
723#
724# LED drivers
725#
726
727#
728# LED Triggers
729#
730
731#
714# InfiniBand support 732# InfiniBand support
715# 733#
716# CONFIG_INFINIBAND is not set 734# CONFIG_INFINIBAND is not set
717 735
718# 736#
719# SN Devices 737# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
738#
739
740#
741# Real Time Clock
720# 742#
743# CONFIG_RTC_CLASS is not set
721 744
722# 745#
723# File systems 746# File systems
@@ -765,7 +788,6 @@ CONFIG_SYSFS=y
765# CONFIG_TMPFS is not set 788# CONFIG_TMPFS is not set
766# CONFIG_HUGETLB_PAGE is not set 789# CONFIG_HUGETLB_PAGE is not set
767CONFIG_RAMFS=y 790CONFIG_RAMFS=y
768CONFIG_RELAYFS_FS=y
769# CONFIG_CONFIGFS_FS is not set 791# CONFIG_CONFIGFS_FS is not set
770 792
771# 793#
@@ -828,6 +850,8 @@ CONFIG_MSDOS_PARTITION=y
828# CONFIG_MAGIC_SYSRQ is not set 850# CONFIG_MAGIC_SYSRQ is not set
829# CONFIG_DEBUG_KERNEL is not set 851# CONFIG_DEBUG_KERNEL is not set
830CONFIG_LOG_BUF_SHIFT=14 852CONFIG_LOG_BUF_SHIFT=14
853# CONFIG_DEBUG_FS is not set
854# CONFIG_UNWIND_INFO is not set
831CONFIG_CROSSCOMPILE=y 855CONFIG_CROSSCOMPILE=y
832CONFIG_CMDLINE="" 856CONFIG_CMDLINE=""
833 857
diff --git a/arch/mips/configs/db1000_defconfig b/arch/mips/configs/db1000_defconfig
index 7f071403c8e3..579b665e3339 100644
--- a/arch/mips/configs/db1000_defconfig
+++ b/arch/mips/configs/db1000_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc1 3# Linux kernel version: 2.6.17-rc2
4# Fri Jan 27 15:39:56 2006 4# Mon Apr 24 14:50:57 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -64,6 +64,8 @@ CONFIG_MIPS_DB1000=y
64# CONFIG_TOSHIBA_RBTX4927 is not set 64# CONFIG_TOSHIBA_RBTX4927 is not set
65# CONFIG_TOSHIBA_RBTX4938 is not set 65# CONFIG_TOSHIBA_RBTX4938 is not set
66CONFIG_RWSEM_GENERIC_SPINLOCK=y 66CONFIG_RWSEM_GENERIC_SPINLOCK=y
67CONFIG_GENERIC_FIND_NEXT_BIT=y
68CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 69CONFIG_GENERIC_CALIBRATE_DELAY=y
68CONFIG_DMA_NONCOHERENT=y 70CONFIG_DMA_NONCOHERENT=y
69CONFIG_DMA_NEED_PCI_MAP_STATE=y 71CONFIG_DMA_NEED_PCI_MAP_STATE=y
@@ -114,11 +116,11 @@ CONFIG_PAGE_SIZE_4KB=y
114CONFIG_CPU_HAS_PREFETCH=y 116CONFIG_CPU_HAS_PREFETCH=y
115# CONFIG_MIPS_MT is not set 117# CONFIG_MIPS_MT is not set
116CONFIG_64BIT_PHYS_ADDR=y 118CONFIG_64BIT_PHYS_ADDR=y
117# CONFIG_CPU_ADVANCED is not set
118CONFIG_CPU_HAS_LLSC=y 119CONFIG_CPU_HAS_LLSC=y
119CONFIG_CPU_HAS_SYNC=y 120CONFIG_CPU_HAS_SYNC=y
120CONFIG_GENERIC_HARDIRQS=y 121CONFIG_GENERIC_HARDIRQS=y
121CONFIG_GENERIC_IRQ_PROBE=y 122CONFIG_GENERIC_IRQ_PROBE=y
123CONFIG_CPU_SUPPORTS_HIGHMEM=y
122CONFIG_ARCH_FLATMEM_ENABLE=y 124CONFIG_ARCH_FLATMEM_ENABLE=y
123CONFIG_SELECT_MEMORY_MODEL=y 125CONFIG_SELECT_MEMORY_MODEL=y
124CONFIG_FLATMEM_MANUAL=y 126CONFIG_FLATMEM_MANUAL=y
@@ -136,7 +138,6 @@ CONFIG_PREEMPT_NONE=y
136# Code maturity level options 138# Code maturity level options
137# 139#
138CONFIG_EXPERIMENTAL=y 140CONFIG_EXPERIMENTAL=y
139CONFIG_CLEAN_COMPILE=y
140CONFIG_BROKEN_ON_SMP=y 141CONFIG_BROKEN_ON_SMP=y
141CONFIG_INIT_ENV_ARG_LIMIT=32 142CONFIG_INIT_ENV_ARG_LIMIT=32
142 143
@@ -152,6 +153,7 @@ CONFIG_SYSVIPC=y
152CONFIG_SYSCTL=y 153CONFIG_SYSCTL=y
153# CONFIG_AUDIT is not set 154# CONFIG_AUDIT is not set
154# CONFIG_IKCONFIG is not set 155# CONFIG_IKCONFIG is not set
156CONFIG_RELAY=y
155CONFIG_INITRAMFS_SOURCE="" 157CONFIG_INITRAMFS_SOURCE=""
156# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 158# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
157CONFIG_EMBEDDED=y 159CONFIG_EMBEDDED=y
@@ -165,10 +167,6 @@ CONFIG_BASE_FULL=y
165CONFIG_FUTEX=y 167CONFIG_FUTEX=y
166CONFIG_EPOLL=y 168CONFIG_EPOLL=y
167CONFIG_SHMEM=y 169CONFIG_SHMEM=y
168CONFIG_CC_ALIGN_FUNCTIONS=0
169CONFIG_CC_ALIGN_LABELS=0
170CONFIG_CC_ALIGN_LOOPS=0
171CONFIG_CC_ALIGN_JUMPS=0
172CONFIG_SLAB=y 170CONFIG_SLAB=y
173# CONFIG_TINY_SHMEM is not set 171# CONFIG_TINY_SHMEM is not set
174CONFIG_BASE_SMALL=0 172CONFIG_BASE_SMALL=0
@@ -181,7 +179,6 @@ CONFIG_OBSOLETE_INTERMODULE=y
181CONFIG_MODULES=y 179CONFIG_MODULES=y
182CONFIG_MODULE_UNLOAD=y 180CONFIG_MODULE_UNLOAD=y
183# CONFIG_MODULE_FORCE_UNLOAD is not set 181# CONFIG_MODULE_FORCE_UNLOAD is not set
184CONFIG_OBSOLETE_MODPARM=y
185CONFIG_MODVERSIONS=y 182CONFIG_MODVERSIONS=y
186CONFIG_MODULE_SRCVERSION_ALL=y 183CONFIG_MODULE_SRCVERSION_ALL=y
187CONFIG_KMOD=y 184CONFIG_KMOD=y
@@ -190,6 +187,8 @@ CONFIG_KMOD=y
190# Block layer 187# Block layer
191# 188#
192# CONFIG_LBD is not set 189# CONFIG_LBD is not set
190# CONFIG_BLK_DEV_IO_TRACE is not set
191# CONFIG_LSF is not set
193 192
194# 193#
195# IO Schedulers 194# IO Schedulers
@@ -245,6 +244,7 @@ CONFIG_NET=y
245# 244#
246# Networking options 245# Networking options
247# 246#
247# CONFIG_NETDEBUG is not set
248CONFIG_PACKET=y 248CONFIG_PACKET=y
249# CONFIG_PACKET_MMAP is not set 249# CONFIG_PACKET_MMAP is not set
250CONFIG_UNIX=y 250CONFIG_UNIX=y
@@ -267,7 +267,8 @@ CONFIG_IP_PNP_BOOTP=y
267# CONFIG_INET_AH is not set 267# CONFIG_INET_AH is not set
268# CONFIG_INET_ESP is not set 268# CONFIG_INET_ESP is not set
269# CONFIG_INET_IPCOMP is not set 269# CONFIG_INET_IPCOMP is not set
270CONFIG_INET_TUNNEL=m 270# CONFIG_INET_XFRM_TUNNEL is not set
271# CONFIG_INET_TUNNEL is not set
271CONFIG_INET_DIAG=y 272CONFIG_INET_DIAG=y
272CONFIG_INET_TCP_DIAG=y 273CONFIG_INET_TCP_DIAG=y
273# CONFIG_TCP_CONG_ADVANCED is not set 274# CONFIG_TCP_CONG_ADVANCED is not set
@@ -278,6 +279,8 @@ CONFIG_TCP_CONG_BIC=y
278# 279#
279# CONFIG_IP_VS is not set 280# CONFIG_IP_VS is not set
280# CONFIG_IPV6 is not set 281# CONFIG_IPV6 is not set
282# CONFIG_INET6_XFRM_TUNNEL is not set
283# CONFIG_INET6_TUNNEL is not set
281CONFIG_NETFILTER=y 284CONFIG_NETFILTER=y
282# CONFIG_NETFILTER_DEBUG is not set 285# CONFIG_NETFILTER_DEBUG is not set
283 286
@@ -294,10 +297,13 @@ CONFIG_NETFILTER_XT_TARGET_MARK=m
294CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m 297CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
295CONFIG_NETFILTER_XT_MATCH_COMMENT=m 298CONFIG_NETFILTER_XT_MATCH_COMMENT=m
296CONFIG_NETFILTER_XT_MATCH_DCCP=m 299CONFIG_NETFILTER_XT_MATCH_DCCP=m
300CONFIG_NETFILTER_XT_MATCH_ESP=m
297CONFIG_NETFILTER_XT_MATCH_LENGTH=m 301CONFIG_NETFILTER_XT_MATCH_LENGTH=m
298CONFIG_NETFILTER_XT_MATCH_LIMIT=m 302CONFIG_NETFILTER_XT_MATCH_LIMIT=m
299CONFIG_NETFILTER_XT_MATCH_MAC=m 303CONFIG_NETFILTER_XT_MATCH_MAC=m
300CONFIG_NETFILTER_XT_MATCH_MARK=m 304CONFIG_NETFILTER_XT_MATCH_MARK=m
305CONFIG_NETFILTER_XT_MATCH_POLICY=m
306CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
301CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m 307CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
302CONFIG_NETFILTER_XT_MATCH_REALM=m 308CONFIG_NETFILTER_XT_MATCH_REALM=m
303CONFIG_NETFILTER_XT_MATCH_SCTP=m 309CONFIG_NETFILTER_XT_MATCH_SCTP=m
@@ -321,6 +327,11 @@ CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
321# SCTP Configuration (EXPERIMENTAL) 327# SCTP Configuration (EXPERIMENTAL)
322# 328#
323# CONFIG_IP_SCTP is not set 329# CONFIG_IP_SCTP is not set
330
331#
332# TIPC Configuration (EXPERIMENTAL)
333#
334# CONFIG_TIPC is not set
324# CONFIG_ATM is not set 335# CONFIG_ATM is not set
325# CONFIG_BRIDGE is not set 336# CONFIG_BRIDGE is not set
326# CONFIG_VLAN_8021Q is not set 337# CONFIG_VLAN_8021Q is not set
@@ -330,11 +341,6 @@ CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
330# CONFIG_ATALK is not set 341# CONFIG_ATALK is not set
331# CONFIG_X25 is not set 342# CONFIG_X25 is not set
332# CONFIG_LAPB is not set 343# CONFIG_LAPB is not set
333
334#
335# TIPC Configuration (EXPERIMENTAL)
336#
337# CONFIG_TIPC is not set
338# CONFIG_NET_DIVERT is not set 344# CONFIG_NET_DIVERT is not set
339# CONFIG_ECONET is not set 345# CONFIG_ECONET is not set
340# CONFIG_WAN_ROUTER is not set 346# CONFIG_WAN_ROUTER is not set
@@ -356,6 +362,9 @@ CONFIG_IEEE80211=m
356# CONFIG_IEEE80211_DEBUG is not set 362# CONFIG_IEEE80211_DEBUG is not set
357CONFIG_IEEE80211_CRYPT_WEP=m 363CONFIG_IEEE80211_CRYPT_WEP=m
358CONFIG_IEEE80211_CRYPT_CCMP=m 364CONFIG_IEEE80211_CRYPT_CCMP=m
365CONFIG_IEEE80211_SOFTMAC=m
366# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
367CONFIG_WIRELESS_EXT=y
359 368
360# 369#
361# Device Drivers 370# Device Drivers
@@ -412,7 +421,6 @@ CONFIG_MTD_CFI_I2=y
412# CONFIG_MTD_CFI_I8 is not set 421# CONFIG_MTD_CFI_I8 is not set
413# CONFIG_MTD_CFI_INTELEXT is not set 422# CONFIG_MTD_CFI_INTELEXT is not set
414CONFIG_MTD_CFI_AMDSTD=y 423CONFIG_MTD_CFI_AMDSTD=y
415CONFIG_MTD_CFI_AMDSTD_RETRY=0
416# CONFIG_MTD_CFI_STAA is not set 424# CONFIG_MTD_CFI_STAA is not set
417CONFIG_MTD_CFI_UTIL=y 425CONFIG_MTD_CFI_UTIL=y
418# CONFIG_MTD_RAM is not set 426# CONFIG_MTD_RAM is not set
@@ -434,7 +442,6 @@ CONFIG_MTD_ALCHEMY=y
434# CONFIG_MTD_SLRAM is not set 442# CONFIG_MTD_SLRAM is not set
435# CONFIG_MTD_PHRAM is not set 443# CONFIG_MTD_PHRAM is not set
436# CONFIG_MTD_MTDRAM is not set 444# CONFIG_MTD_MTDRAM is not set
437# CONFIG_MTD_BLKMTD is not set
438# CONFIG_MTD_BLOCK2MTD is not set 445# CONFIG_MTD_BLOCK2MTD is not set
439 446
440# 447#
@@ -471,7 +478,7 @@ CONFIG_BLK_DEV_LOOP=y
471# CONFIG_BLK_DEV_CRYPTOLOOP is not set 478# CONFIG_BLK_DEV_CRYPTOLOOP is not set
472# CONFIG_BLK_DEV_NBD is not set 479# CONFIG_BLK_DEV_NBD is not set
473# CONFIG_BLK_DEV_RAM is not set 480# CONFIG_BLK_DEV_RAM is not set
474CONFIG_BLK_DEV_RAM_COUNT=16 481# CONFIG_BLK_DEV_INITRD is not set
475CONFIG_CDROM_PKTCDVD=m 482CONFIG_CDROM_PKTCDVD=m
476CONFIG_CDROM_PKTCDVD_BUFFERS=8 483CONFIG_CDROM_PKTCDVD_BUFFERS=8
477# CONFIG_CDROM_PKTCDVD_WCACHE is not set 484# CONFIG_CDROM_PKTCDVD_WCACHE is not set
@@ -722,10 +729,6 @@ CONFIG_SYNCLINK_CS=m
722# 729#
723 730
724# 731#
725# Multimedia Capabilities Port drivers
726#
727
728#
729# Multimedia devices 732# Multimedia devices
730# 733#
731# CONFIG_VIDEO_DEV is not set 734# CONFIG_VIDEO_DEV is not set
@@ -756,6 +759,7 @@ CONFIG_DUMMY_CONSOLE=y
756# 759#
757CONFIG_USB_ARCH_HAS_HCD=y 760CONFIG_USB_ARCH_HAS_HCD=y
758CONFIG_USB_ARCH_HAS_OHCI=y 761CONFIG_USB_ARCH_HAS_OHCI=y
762# CONFIG_USB_ARCH_HAS_EHCI is not set
759# CONFIG_USB is not set 763# CONFIG_USB is not set
760 764
761# 765#
@@ -773,12 +777,30 @@ CONFIG_USB_ARCH_HAS_OHCI=y
773# CONFIG_MMC is not set 777# CONFIG_MMC is not set
774 778
775# 779#
780# LED devices
781#
782# CONFIG_NEW_LEDS is not set
783
784#
785# LED drivers
786#
787
788#
789# LED Triggers
790#
791
792#
776# InfiniBand support 793# InfiniBand support
777# 794#
778 795
779# 796#
780# SN Devices 797# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
798#
799
800#
801# Real Time Clock
781# 802#
803# CONFIG_RTC_CLASS is not set
782 804
783# 805#
784# File systems 806# File systems
@@ -836,7 +858,6 @@ CONFIG_SYSFS=y
836CONFIG_TMPFS=y 858CONFIG_TMPFS=y
837# CONFIG_HUGETLB_PAGE is not set 859# CONFIG_HUGETLB_PAGE is not set
838CONFIG_RAMFS=y 860CONFIG_RAMFS=y
839CONFIG_RELAYFS_FS=m
840# CONFIG_CONFIGFS_FS is not set 861# CONFIG_CONFIGFS_FS is not set
841 862
842# 863#
@@ -945,6 +966,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
945# CONFIG_MAGIC_SYSRQ is not set 966# CONFIG_MAGIC_SYSRQ is not set
946# CONFIG_DEBUG_KERNEL is not set 967# CONFIG_DEBUG_KERNEL is not set
947CONFIG_LOG_BUF_SHIFT=14 968CONFIG_LOG_BUF_SHIFT=14
969# CONFIG_DEBUG_FS is not set
948CONFIG_CROSSCOMPILE=y 970CONFIG_CROSSCOMPILE=y
949CONFIG_CMDLINE="" 971CONFIG_CMDLINE=""
950 972
diff --git a/arch/mips/configs/db1100_defconfig b/arch/mips/configs/db1100_defconfig
index 98590cac1ec5..e5eb53867422 100644
--- a/arch/mips/configs/db1100_defconfig
+++ b/arch/mips/configs/db1100_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc1 3# Linux kernel version: 2.6.17-rc2
4# Fri Jan 27 15:39:57 2006 4# Mon Apr 24 14:50:58 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -64,6 +64,8 @@ CONFIG_MIPS_DB1100=y
64# CONFIG_TOSHIBA_RBTX4927 is not set 64# CONFIG_TOSHIBA_RBTX4927 is not set
65# CONFIG_TOSHIBA_RBTX4938 is not set 65# CONFIG_TOSHIBA_RBTX4938 is not set
66CONFIG_RWSEM_GENERIC_SPINLOCK=y 66CONFIG_RWSEM_GENERIC_SPINLOCK=y
67CONFIG_GENERIC_FIND_NEXT_BIT=y
68CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 69CONFIG_GENERIC_CALIBRATE_DELAY=y
68CONFIG_DMA_NONCOHERENT=y 70CONFIG_DMA_NONCOHERENT=y
69CONFIG_DMA_NEED_PCI_MAP_STATE=y 71CONFIG_DMA_NEED_PCI_MAP_STATE=y
@@ -114,11 +116,11 @@ CONFIG_PAGE_SIZE_4KB=y
114CONFIG_CPU_HAS_PREFETCH=y 116CONFIG_CPU_HAS_PREFETCH=y
115# CONFIG_MIPS_MT is not set 117# CONFIG_MIPS_MT is not set
116CONFIG_64BIT_PHYS_ADDR=y 118CONFIG_64BIT_PHYS_ADDR=y
117# CONFIG_CPU_ADVANCED is not set
118CONFIG_CPU_HAS_LLSC=y 119CONFIG_CPU_HAS_LLSC=y
119CONFIG_CPU_HAS_SYNC=y 120CONFIG_CPU_HAS_SYNC=y
120CONFIG_GENERIC_HARDIRQS=y 121CONFIG_GENERIC_HARDIRQS=y
121CONFIG_GENERIC_IRQ_PROBE=y 122CONFIG_GENERIC_IRQ_PROBE=y
123CONFIG_CPU_SUPPORTS_HIGHMEM=y
122CONFIG_ARCH_FLATMEM_ENABLE=y 124CONFIG_ARCH_FLATMEM_ENABLE=y
123CONFIG_SELECT_MEMORY_MODEL=y 125CONFIG_SELECT_MEMORY_MODEL=y
124CONFIG_FLATMEM_MANUAL=y 126CONFIG_FLATMEM_MANUAL=y
@@ -136,7 +138,6 @@ CONFIG_PREEMPT_NONE=y
136# Code maturity level options 138# Code maturity level options
137# 139#
138CONFIG_EXPERIMENTAL=y 140CONFIG_EXPERIMENTAL=y
139CONFIG_CLEAN_COMPILE=y
140CONFIG_BROKEN_ON_SMP=y 141CONFIG_BROKEN_ON_SMP=y
141CONFIG_INIT_ENV_ARG_LIMIT=32 142CONFIG_INIT_ENV_ARG_LIMIT=32
142 143
@@ -152,6 +153,7 @@ CONFIG_SYSVIPC=y
152CONFIG_SYSCTL=y 153CONFIG_SYSCTL=y
153# CONFIG_AUDIT is not set 154# CONFIG_AUDIT is not set
154# CONFIG_IKCONFIG is not set 155# CONFIG_IKCONFIG is not set
156CONFIG_RELAY=y
155CONFIG_INITRAMFS_SOURCE="" 157CONFIG_INITRAMFS_SOURCE=""
156# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 158# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
157CONFIG_EMBEDDED=y 159CONFIG_EMBEDDED=y
@@ -165,10 +167,6 @@ CONFIG_BASE_FULL=y
165CONFIG_FUTEX=y 167CONFIG_FUTEX=y
166CONFIG_EPOLL=y 168CONFIG_EPOLL=y
167CONFIG_SHMEM=y 169CONFIG_SHMEM=y
168CONFIG_CC_ALIGN_FUNCTIONS=0
169CONFIG_CC_ALIGN_LABELS=0
170CONFIG_CC_ALIGN_LOOPS=0
171CONFIG_CC_ALIGN_JUMPS=0
172CONFIG_SLAB=y 170CONFIG_SLAB=y
173# CONFIG_TINY_SHMEM is not set 171# CONFIG_TINY_SHMEM is not set
174CONFIG_BASE_SMALL=0 172CONFIG_BASE_SMALL=0
@@ -181,7 +179,6 @@ CONFIG_OBSOLETE_INTERMODULE=y
181CONFIG_MODULES=y 179CONFIG_MODULES=y
182CONFIG_MODULE_UNLOAD=y 180CONFIG_MODULE_UNLOAD=y
183# CONFIG_MODULE_FORCE_UNLOAD is not set 181# CONFIG_MODULE_FORCE_UNLOAD is not set
184CONFIG_OBSOLETE_MODPARM=y
185CONFIG_MODVERSIONS=y 182CONFIG_MODVERSIONS=y
186CONFIG_MODULE_SRCVERSION_ALL=y 183CONFIG_MODULE_SRCVERSION_ALL=y
187CONFIG_KMOD=y 184CONFIG_KMOD=y
@@ -190,6 +187,8 @@ CONFIG_KMOD=y
190# Block layer 187# Block layer
191# 188#
192# CONFIG_LBD is not set 189# CONFIG_LBD is not set
190# CONFIG_BLK_DEV_IO_TRACE is not set
191# CONFIG_LSF is not set
193 192
194# 193#
195# IO Schedulers 194# IO Schedulers
@@ -234,6 +233,7 @@ CONFIG_NET=y
234# 233#
235# Networking options 234# Networking options
236# 235#
236# CONFIG_NETDEBUG is not set
237CONFIG_PACKET=y 237CONFIG_PACKET=y
238# CONFIG_PACKET_MMAP is not set 238# CONFIG_PACKET_MMAP is not set
239CONFIG_UNIX=y 239CONFIG_UNIX=y
@@ -256,7 +256,8 @@ CONFIG_IP_PNP_BOOTP=y
256# CONFIG_INET_AH is not set 256# CONFIG_INET_AH is not set
257# CONFIG_INET_ESP is not set 257# CONFIG_INET_ESP is not set
258# CONFIG_INET_IPCOMP is not set 258# CONFIG_INET_IPCOMP is not set
259CONFIG_INET_TUNNEL=m 259# CONFIG_INET_XFRM_TUNNEL is not set
260# CONFIG_INET_TUNNEL is not set
260CONFIG_INET_DIAG=y 261CONFIG_INET_DIAG=y
261CONFIG_INET_TCP_DIAG=y 262CONFIG_INET_TCP_DIAG=y
262# CONFIG_TCP_CONG_ADVANCED is not set 263# CONFIG_TCP_CONG_ADVANCED is not set
@@ -267,6 +268,8 @@ CONFIG_TCP_CONG_BIC=y
267# 268#
268# CONFIG_IP_VS is not set 269# CONFIG_IP_VS is not set
269# CONFIG_IPV6 is not set 270# CONFIG_IPV6 is not set
271# CONFIG_INET6_XFRM_TUNNEL is not set
272# CONFIG_INET6_TUNNEL is not set
270CONFIG_NETFILTER=y 273CONFIG_NETFILTER=y
271# CONFIG_NETFILTER_DEBUG is not set 274# CONFIG_NETFILTER_DEBUG is not set
272 275
@@ -283,10 +286,13 @@ CONFIG_NETFILTER_XT_TARGET_MARK=m
283CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m 286CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
284CONFIG_NETFILTER_XT_MATCH_COMMENT=m 287CONFIG_NETFILTER_XT_MATCH_COMMENT=m
285CONFIG_NETFILTER_XT_MATCH_DCCP=m 288CONFIG_NETFILTER_XT_MATCH_DCCP=m
289CONFIG_NETFILTER_XT_MATCH_ESP=m
286CONFIG_NETFILTER_XT_MATCH_LENGTH=m 290CONFIG_NETFILTER_XT_MATCH_LENGTH=m
287CONFIG_NETFILTER_XT_MATCH_LIMIT=m 291CONFIG_NETFILTER_XT_MATCH_LIMIT=m
288CONFIG_NETFILTER_XT_MATCH_MAC=m 292CONFIG_NETFILTER_XT_MATCH_MAC=m
289CONFIG_NETFILTER_XT_MATCH_MARK=m 293CONFIG_NETFILTER_XT_MATCH_MARK=m
294CONFIG_NETFILTER_XT_MATCH_POLICY=m
295CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
290CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m 296CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
291CONFIG_NETFILTER_XT_MATCH_REALM=m 297CONFIG_NETFILTER_XT_MATCH_REALM=m
292CONFIG_NETFILTER_XT_MATCH_SCTP=m 298CONFIG_NETFILTER_XT_MATCH_SCTP=m
@@ -310,6 +316,11 @@ CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
310# SCTP Configuration (EXPERIMENTAL) 316# SCTP Configuration (EXPERIMENTAL)
311# 317#
312# CONFIG_IP_SCTP is not set 318# CONFIG_IP_SCTP is not set
319
320#
321# TIPC Configuration (EXPERIMENTAL)
322#
323# CONFIG_TIPC is not set
313# CONFIG_ATM is not set 324# CONFIG_ATM is not set
314# CONFIG_BRIDGE is not set 325# CONFIG_BRIDGE is not set
315# CONFIG_VLAN_8021Q is not set 326# CONFIG_VLAN_8021Q is not set
@@ -319,11 +330,6 @@ CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
319# CONFIG_ATALK is not set 330# CONFIG_ATALK is not set
320# CONFIG_X25 is not set 331# CONFIG_X25 is not set
321# CONFIG_LAPB is not set 332# CONFIG_LAPB is not set
322
323#
324# TIPC Configuration (EXPERIMENTAL)
325#
326# CONFIG_TIPC is not set
327# CONFIG_NET_DIVERT is not set 333# CONFIG_NET_DIVERT is not set
328# CONFIG_ECONET is not set 334# CONFIG_ECONET is not set
329# CONFIG_WAN_ROUTER is not set 335# CONFIG_WAN_ROUTER is not set
@@ -345,6 +351,9 @@ CONFIG_IEEE80211=m
345# CONFIG_IEEE80211_DEBUG is not set 351# CONFIG_IEEE80211_DEBUG is not set
346CONFIG_IEEE80211_CRYPT_WEP=m 352CONFIG_IEEE80211_CRYPT_WEP=m
347CONFIG_IEEE80211_CRYPT_CCMP=m 353CONFIG_IEEE80211_CRYPT_CCMP=m
354CONFIG_IEEE80211_SOFTMAC=m
355# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
356CONFIG_WIRELESS_EXT=y
348 357
349# 358#
350# Device Drivers 359# Device Drivers
@@ -401,7 +410,6 @@ CONFIG_MTD_CFI_I2=y
401# CONFIG_MTD_CFI_I8 is not set 410# CONFIG_MTD_CFI_I8 is not set
402# CONFIG_MTD_CFI_INTELEXT is not set 411# CONFIG_MTD_CFI_INTELEXT is not set
403CONFIG_MTD_CFI_AMDSTD=y 412CONFIG_MTD_CFI_AMDSTD=y
404CONFIG_MTD_CFI_AMDSTD_RETRY=0
405# CONFIG_MTD_CFI_STAA is not set 413# CONFIG_MTD_CFI_STAA is not set
406CONFIG_MTD_CFI_UTIL=y 414CONFIG_MTD_CFI_UTIL=y
407# CONFIG_MTD_RAM is not set 415# CONFIG_MTD_RAM is not set
@@ -423,7 +431,6 @@ CONFIG_MTD_ALCHEMY=y
423# CONFIG_MTD_SLRAM is not set 431# CONFIG_MTD_SLRAM is not set
424# CONFIG_MTD_PHRAM is not set 432# CONFIG_MTD_PHRAM is not set
425# CONFIG_MTD_MTDRAM is not set 433# CONFIG_MTD_MTDRAM is not set
426# CONFIG_MTD_BLKMTD is not set
427# CONFIG_MTD_BLOCK2MTD is not set 434# CONFIG_MTD_BLOCK2MTD is not set
428 435
429# 436#
@@ -460,7 +467,7 @@ CONFIG_BLK_DEV_LOOP=y
460# CONFIG_BLK_DEV_CRYPTOLOOP is not set 467# CONFIG_BLK_DEV_CRYPTOLOOP is not set
461# CONFIG_BLK_DEV_NBD is not set 468# CONFIG_BLK_DEV_NBD is not set
462# CONFIG_BLK_DEV_RAM is not set 469# CONFIG_BLK_DEV_RAM is not set
463CONFIG_BLK_DEV_RAM_COUNT=16 470# CONFIG_BLK_DEV_INITRD is not set
464CONFIG_CDROM_PKTCDVD=m 471CONFIG_CDROM_PKTCDVD=m
465CONFIG_CDROM_PKTCDVD_BUFFERS=8 472CONFIG_CDROM_PKTCDVD_BUFFERS=8
466# CONFIG_CDROM_PKTCDVD_WCACHE is not set 473# CONFIG_CDROM_PKTCDVD_WCACHE is not set
@@ -690,10 +697,6 @@ CONFIG_LEGACY_PTY_COUNT=256
690# 697#
691 698
692# 699#
693# Multimedia Capabilities Port drivers
694#
695
696#
697# Multimedia devices 700# Multimedia devices
698# 701#
699# CONFIG_VIDEO_DEV is not set 702# CONFIG_VIDEO_DEV is not set
@@ -711,6 +714,7 @@ CONFIG_FB_CFB_FILLRECT=y
711CONFIG_FB_CFB_COPYAREA=y 714CONFIG_FB_CFB_COPYAREA=y
712CONFIG_FB_CFB_IMAGEBLIT=y 715CONFIG_FB_CFB_IMAGEBLIT=y
713# CONFIG_FB_MACMODES is not set 716# CONFIG_FB_MACMODES is not set
717CONFIG_FB_FIRMWARE_EDID=y
714# CONFIG_FB_MODE_HELPERS is not set 718# CONFIG_FB_MODE_HELPERS is not set
715# CONFIG_FB_TILEBLITTING is not set 719# CONFIG_FB_TILEBLITTING is not set
716# CONFIG_FB_S1D13XXX is not set 720# CONFIG_FB_S1D13XXX is not set
@@ -755,6 +759,7 @@ CONFIG_LOGO_LINUX_CLUT224=y
755# 759#
756CONFIG_USB_ARCH_HAS_HCD=y 760CONFIG_USB_ARCH_HAS_HCD=y
757CONFIG_USB_ARCH_HAS_OHCI=y 761CONFIG_USB_ARCH_HAS_OHCI=y
762# CONFIG_USB_ARCH_HAS_EHCI is not set
758# CONFIG_USB is not set 763# CONFIG_USB is not set
759 764
760# 765#
@@ -772,12 +777,30 @@ CONFIG_USB_ARCH_HAS_OHCI=y
772# CONFIG_MMC is not set 777# CONFIG_MMC is not set
773 778
774# 779#
780# LED devices
781#
782# CONFIG_NEW_LEDS is not set
783
784#
785# LED drivers
786#
787
788#
789# LED Triggers
790#
791
792#
775# InfiniBand support 793# InfiniBand support
776# 794#
777 795
778# 796#
779# SN Devices 797# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
798#
799
800#
801# Real Time Clock
780# 802#
803# CONFIG_RTC_CLASS is not set
781 804
782# 805#
783# File systems 806# File systems
@@ -835,7 +858,6 @@ CONFIG_SYSFS=y
835CONFIG_TMPFS=y 858CONFIG_TMPFS=y
836# CONFIG_HUGETLB_PAGE is not set 859# CONFIG_HUGETLB_PAGE is not set
837CONFIG_RAMFS=y 860CONFIG_RAMFS=y
838CONFIG_RELAYFS_FS=m
839# CONFIG_CONFIGFS_FS is not set 861# CONFIG_CONFIGFS_FS is not set
840 862
841# 863#
@@ -944,6 +966,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
944# CONFIG_MAGIC_SYSRQ is not set 966# CONFIG_MAGIC_SYSRQ is not set
945# CONFIG_DEBUG_KERNEL is not set 967# CONFIG_DEBUG_KERNEL is not set
946CONFIG_LOG_BUF_SHIFT=14 968CONFIG_LOG_BUF_SHIFT=14
969# CONFIG_DEBUG_FS is not set
947CONFIG_CROSSCOMPILE=y 970CONFIG_CROSSCOMPILE=y
948CONFIG_CMDLINE="" 971CONFIG_CMDLINE=""
949 972
diff --git a/arch/mips/configs/db1200_defconfig b/arch/mips/configs/db1200_defconfig
index 92888472dca0..a43fb2329fd5 100644
--- a/arch/mips/configs/db1200_defconfig
+++ b/arch/mips/configs/db1200_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc1 3# Linux kernel version: 2.6.17-rc2
4# Fri Jan 27 15:39:58 2006 4# Mon Apr 24 14:50:58 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -64,6 +64,8 @@ CONFIG_MIPS_DB1200=y
64# CONFIG_TOSHIBA_RBTX4927 is not set 64# CONFIG_TOSHIBA_RBTX4927 is not set
65# CONFIG_TOSHIBA_RBTX4938 is not set 65# CONFIG_TOSHIBA_RBTX4938 is not set
66CONFIG_RWSEM_GENERIC_SPINLOCK=y 66CONFIG_RWSEM_GENERIC_SPINLOCK=y
67CONFIG_GENERIC_FIND_NEXT_BIT=y
68CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 69CONFIG_GENERIC_CALIBRATE_DELAY=y
68CONFIG_DMA_COHERENT=y 70CONFIG_DMA_COHERENT=y
69CONFIG_MIPS_DISABLE_OBSOLETE_IDE=y 71CONFIG_MIPS_DISABLE_OBSOLETE_IDE=y
@@ -114,11 +116,11 @@ CONFIG_PAGE_SIZE_4KB=y
114CONFIG_CPU_HAS_PREFETCH=y 116CONFIG_CPU_HAS_PREFETCH=y
115# CONFIG_MIPS_MT is not set 117# CONFIG_MIPS_MT is not set
116CONFIG_64BIT_PHYS_ADDR=y 118CONFIG_64BIT_PHYS_ADDR=y
117# CONFIG_CPU_ADVANCED is not set
118CONFIG_CPU_HAS_LLSC=y 119CONFIG_CPU_HAS_LLSC=y
119CONFIG_CPU_HAS_SYNC=y 120CONFIG_CPU_HAS_SYNC=y
120CONFIG_GENERIC_HARDIRQS=y 121CONFIG_GENERIC_HARDIRQS=y
121CONFIG_GENERIC_IRQ_PROBE=y 122CONFIG_GENERIC_IRQ_PROBE=y
123CONFIG_CPU_SUPPORTS_HIGHMEM=y
122CONFIG_ARCH_FLATMEM_ENABLE=y 124CONFIG_ARCH_FLATMEM_ENABLE=y
123CONFIG_SELECT_MEMORY_MODEL=y 125CONFIG_SELECT_MEMORY_MODEL=y
124CONFIG_FLATMEM_MANUAL=y 126CONFIG_FLATMEM_MANUAL=y
@@ -136,7 +138,6 @@ CONFIG_PREEMPT_NONE=y
136# Code maturity level options 138# Code maturity level options
137# 139#
138CONFIG_EXPERIMENTAL=y 140CONFIG_EXPERIMENTAL=y
139CONFIG_CLEAN_COMPILE=y
140CONFIG_BROKEN_ON_SMP=y 141CONFIG_BROKEN_ON_SMP=y
141CONFIG_INIT_ENV_ARG_LIMIT=32 142CONFIG_INIT_ENV_ARG_LIMIT=32
142 143
@@ -153,6 +154,7 @@ CONFIG_SYSCTL=y
153# CONFIG_AUDIT is not set 154# CONFIG_AUDIT is not set
154CONFIG_IKCONFIG=y 155CONFIG_IKCONFIG=y
155CONFIG_IKCONFIG_PROC=y 156CONFIG_IKCONFIG_PROC=y
157# CONFIG_RELAY is not set
156CONFIG_INITRAMFS_SOURCE="" 158CONFIG_INITRAMFS_SOURCE=""
157# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 159# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
158CONFIG_EMBEDDED=y 160CONFIG_EMBEDDED=y
@@ -166,10 +168,6 @@ CONFIG_BASE_FULL=y
166CONFIG_FUTEX=y 168CONFIG_FUTEX=y
167CONFIG_EPOLL=y 169CONFIG_EPOLL=y
168CONFIG_SHMEM=y 170CONFIG_SHMEM=y
169CONFIG_CC_ALIGN_FUNCTIONS=0
170CONFIG_CC_ALIGN_LABELS=0
171CONFIG_CC_ALIGN_LOOPS=0
172CONFIG_CC_ALIGN_JUMPS=0
173CONFIG_SLAB=y 171CONFIG_SLAB=y
174# CONFIG_TINY_SHMEM is not set 172# CONFIG_TINY_SHMEM is not set
175CONFIG_BASE_SMALL=0 173CONFIG_BASE_SMALL=0
@@ -182,7 +180,6 @@ CONFIG_OBSOLETE_INTERMODULE=y
182CONFIG_MODULES=y 180CONFIG_MODULES=y
183CONFIG_MODULE_UNLOAD=y 181CONFIG_MODULE_UNLOAD=y
184# CONFIG_MODULE_FORCE_UNLOAD is not set 182# CONFIG_MODULE_FORCE_UNLOAD is not set
185CONFIG_OBSOLETE_MODPARM=y
186CONFIG_MODVERSIONS=y 183CONFIG_MODVERSIONS=y
187CONFIG_MODULE_SRCVERSION_ALL=y 184CONFIG_MODULE_SRCVERSION_ALL=y
188CONFIG_KMOD=y 185CONFIG_KMOD=y
@@ -191,6 +188,8 @@ CONFIG_KMOD=y
191# Block layer 188# Block layer
192# 189#
193# CONFIG_LBD is not set 190# CONFIG_LBD is not set
191# CONFIG_BLK_DEV_IO_TRACE is not set
192# CONFIG_LSF is not set
194 193
195# 194#
196# IO Schedulers 195# IO Schedulers
@@ -244,6 +243,7 @@ CONFIG_NET=y
244# 243#
245# Networking options 244# Networking options
246# 245#
246# CONFIG_NETDEBUG is not set
247CONFIG_PACKET=y 247CONFIG_PACKET=y
248# CONFIG_PACKET_MMAP is not set 248# CONFIG_PACKET_MMAP is not set
249CONFIG_UNIX=y 249CONFIG_UNIX=y
@@ -263,7 +263,8 @@ CONFIG_IP_FIB_HASH=y
263# CONFIG_INET_AH is not set 263# CONFIG_INET_AH is not set
264# CONFIG_INET_ESP is not set 264# CONFIG_INET_ESP is not set
265# CONFIG_INET_IPCOMP is not set 265# CONFIG_INET_IPCOMP is not set
266CONFIG_INET_TUNNEL=m 266# CONFIG_INET_XFRM_TUNNEL is not set
267# CONFIG_INET_TUNNEL is not set
267CONFIG_INET_DIAG=y 268CONFIG_INET_DIAG=y
268CONFIG_INET_TCP_DIAG=y 269CONFIG_INET_TCP_DIAG=y
269# CONFIG_TCP_CONG_ADVANCED is not set 270# CONFIG_TCP_CONG_ADVANCED is not set
@@ -274,6 +275,8 @@ CONFIG_TCP_CONG_BIC=y
274# 275#
275# CONFIG_IP_VS is not set 276# CONFIG_IP_VS is not set
276# CONFIG_IPV6 is not set 277# CONFIG_IPV6 is not set
278# CONFIG_INET6_XFRM_TUNNEL is not set
279# CONFIG_INET6_TUNNEL is not set
277CONFIG_NETFILTER=y 280CONFIG_NETFILTER=y
278# CONFIG_NETFILTER_DEBUG is not set 281# CONFIG_NETFILTER_DEBUG is not set
279 282
@@ -288,10 +291,13 @@ CONFIG_NETFILTER_XT_TARGET_MARK=m
288CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m 291CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
289CONFIG_NETFILTER_XT_MATCH_COMMENT=m 292CONFIG_NETFILTER_XT_MATCH_COMMENT=m
290CONFIG_NETFILTER_XT_MATCH_DCCP=m 293CONFIG_NETFILTER_XT_MATCH_DCCP=m
294CONFIG_NETFILTER_XT_MATCH_ESP=m
291CONFIG_NETFILTER_XT_MATCH_LENGTH=m 295CONFIG_NETFILTER_XT_MATCH_LENGTH=m
292CONFIG_NETFILTER_XT_MATCH_LIMIT=m 296CONFIG_NETFILTER_XT_MATCH_LIMIT=m
293CONFIG_NETFILTER_XT_MATCH_MAC=m 297CONFIG_NETFILTER_XT_MATCH_MAC=m
294CONFIG_NETFILTER_XT_MATCH_MARK=m 298CONFIG_NETFILTER_XT_MATCH_MARK=m
299CONFIG_NETFILTER_XT_MATCH_POLICY=m
300CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
295CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m 301CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
296CONFIG_NETFILTER_XT_MATCH_REALM=m 302CONFIG_NETFILTER_XT_MATCH_REALM=m
297CONFIG_NETFILTER_XT_MATCH_SCTP=m 303CONFIG_NETFILTER_XT_MATCH_SCTP=m
@@ -315,6 +321,11 @@ CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
315# SCTP Configuration (EXPERIMENTAL) 321# SCTP Configuration (EXPERIMENTAL)
316# 322#
317# CONFIG_IP_SCTP is not set 323# CONFIG_IP_SCTP is not set
324
325#
326# TIPC Configuration (EXPERIMENTAL)
327#
328# CONFIG_TIPC is not set
318# CONFIG_ATM is not set 329# CONFIG_ATM is not set
319# CONFIG_BRIDGE is not set 330# CONFIG_BRIDGE is not set
320# CONFIG_VLAN_8021Q is not set 331# CONFIG_VLAN_8021Q is not set
@@ -324,11 +335,6 @@ CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
324# CONFIG_ATALK is not set 335# CONFIG_ATALK is not set
325# CONFIG_X25 is not set 336# CONFIG_X25 is not set
326# CONFIG_LAPB is not set 337# CONFIG_LAPB is not set
327
328#
329# TIPC Configuration (EXPERIMENTAL)
330#
331# CONFIG_TIPC is not set
332# CONFIG_NET_DIVERT is not set 338# CONFIG_NET_DIVERT is not set
333# CONFIG_ECONET is not set 339# CONFIG_ECONET is not set
334# CONFIG_WAN_ROUTER is not set 340# CONFIG_WAN_ROUTER is not set
@@ -403,7 +409,6 @@ CONFIG_MTD_CFI_I2=y
403# CONFIG_MTD_CFI_I8 is not set 409# CONFIG_MTD_CFI_I8 is not set
404# CONFIG_MTD_CFI_INTELEXT is not set 410# CONFIG_MTD_CFI_INTELEXT is not set
405CONFIG_MTD_CFI_AMDSTD=y 411CONFIG_MTD_CFI_AMDSTD=y
406CONFIG_MTD_CFI_AMDSTD_RETRY=0
407# CONFIG_MTD_CFI_STAA is not set 412# CONFIG_MTD_CFI_STAA is not set
408CONFIG_MTD_CFI_UTIL=y 413CONFIG_MTD_CFI_UTIL=y
409# CONFIG_MTD_RAM is not set 414# CONFIG_MTD_RAM is not set
@@ -425,7 +430,6 @@ CONFIG_MTD_ALCHEMY=y
425# CONFIG_MTD_SLRAM is not set 430# CONFIG_MTD_SLRAM is not set
426# CONFIG_MTD_PHRAM is not set 431# CONFIG_MTD_PHRAM is not set
427# CONFIG_MTD_MTDRAM is not set 432# CONFIG_MTD_MTDRAM is not set
428# CONFIG_MTD_BLKMTD is not set
429# CONFIG_MTD_BLOCK2MTD is not set 433# CONFIG_MTD_BLOCK2MTD is not set
430 434
431# 435#
@@ -763,10 +767,6 @@ CONFIG_LEGACY_PTY_COUNT=256
763# 767#
764 768
765# 769#
766# Multimedia Capabilities Port drivers
767#
768
769#
770# Multimedia devices 770# Multimedia devices
771# 771#
772# CONFIG_VIDEO_DEV is not set 772# CONFIG_VIDEO_DEV is not set
@@ -784,6 +784,7 @@ CONFIG_FB_CFB_FILLRECT=y
784CONFIG_FB_CFB_COPYAREA=y 784CONFIG_FB_CFB_COPYAREA=y
785CONFIG_FB_CFB_IMAGEBLIT=y 785CONFIG_FB_CFB_IMAGEBLIT=y
786# CONFIG_FB_MACMODES is not set 786# CONFIG_FB_MACMODES is not set
787CONFIG_FB_FIRMWARE_EDID=y
787# CONFIG_FB_MODE_HELPERS is not set 788# CONFIG_FB_MODE_HELPERS is not set
788# CONFIG_FB_TILEBLITTING is not set 789# CONFIG_FB_TILEBLITTING is not set
789# CONFIG_FB_S1D13XXX is not set 790# CONFIG_FB_S1D13XXX is not set
@@ -794,6 +795,7 @@ CONFIG_FB_AU1200=y
794# Console display driver support 795# Console display driver support
795# 796#
796CONFIG_VGA_CONSOLE=y 797CONFIG_VGA_CONSOLE=y
798# CONFIG_VGACON_SOFT_SCROLLBACK is not set
797CONFIG_DUMMY_CONSOLE=y 799CONFIG_DUMMY_CONSOLE=y
798# CONFIG_FRAMEBUFFER_CONSOLE is not set 800# CONFIG_FRAMEBUFFER_CONSOLE is not set
799 801
@@ -816,6 +818,7 @@ CONFIG_LOGO_LINUX_CLUT224=y
816# 818#
817CONFIG_USB_ARCH_HAS_HCD=y 819CONFIG_USB_ARCH_HAS_HCD=y
818CONFIG_USB_ARCH_HAS_OHCI=y 820CONFIG_USB_ARCH_HAS_OHCI=y
821CONFIG_USB_ARCH_HAS_EHCI=y
819# CONFIG_USB is not set 822# CONFIG_USB is not set
820 823
821# 824#
@@ -832,6 +835,7 @@ CONFIG_USB_GADGET=m
832# CONFIG_USB_GADGET_GOKU is not set 835# CONFIG_USB_GADGET_GOKU is not set
833# CONFIG_USB_GADGET_LH7A40X is not set 836# CONFIG_USB_GADGET_LH7A40X is not set
834# CONFIG_USB_GADGET_OMAP is not set 837# CONFIG_USB_GADGET_OMAP is not set
838# CONFIG_USB_GADGET_AT91 is not set
835# CONFIG_USB_GADGET_DUMMY_HCD is not set 839# CONFIG_USB_GADGET_DUMMY_HCD is not set
836# CONFIG_USB_GADGET_DUALSPEED is not set 840# CONFIG_USB_GADGET_DUALSPEED is not set
837 841
@@ -844,12 +848,30 @@ CONFIG_MMC_BLOCK=y
844CONFIG_MMC_AU1X=y 848CONFIG_MMC_AU1X=y
845 849
846# 850#
851# LED devices
852#
853# CONFIG_NEW_LEDS is not set
854
855#
856# LED drivers
857#
858
859#
860# LED Triggers
861#
862
863#
847# InfiniBand support 864# InfiniBand support
848# 865#
849 866
850# 867#
851# SN Devices 868# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
869#
870
871#
872# Real Time Clock
852# 873#
874# CONFIG_RTC_CLASS is not set
853 875
854# 876#
855# File systems 877# File systems
@@ -913,7 +935,6 @@ CONFIG_SYSFS=y
913CONFIG_TMPFS=y 935CONFIG_TMPFS=y
914# CONFIG_HUGETLB_PAGE is not set 936# CONFIG_HUGETLB_PAGE is not set
915CONFIG_RAMFS=y 937CONFIG_RAMFS=y
916# CONFIG_RELAYFS_FS is not set
917# CONFIG_CONFIGFS_FS is not set 938# CONFIG_CONFIGFS_FS is not set
918 939
919# 940#
@@ -1027,6 +1048,7 @@ CONFIG_NLS_UTF8=m
1027# CONFIG_MAGIC_SYSRQ is not set 1048# CONFIG_MAGIC_SYSRQ is not set
1028# CONFIG_DEBUG_KERNEL is not set 1049# CONFIG_DEBUG_KERNEL is not set
1029CONFIG_LOG_BUF_SHIFT=14 1050CONFIG_LOG_BUF_SHIFT=14
1051# CONFIG_DEBUG_FS is not set
1030CONFIG_CROSSCOMPILE=y 1052CONFIG_CROSSCOMPILE=y
1031CONFIG_CMDLINE="mem=48M" 1053CONFIG_CMDLINE="mem=48M"
1032 1054
diff --git a/arch/mips/configs/db1500_defconfig b/arch/mips/configs/db1500_defconfig
index 5a415b1d4af0..ad632d87c4ef 100644
--- a/arch/mips/configs/db1500_defconfig
+++ b/arch/mips/configs/db1500_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc1 3# Linux kernel version: 2.6.17-rc2
4# Fri Jan 27 15:39:59 2006 4# Mon Apr 24 14:50:59 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -64,6 +64,8 @@ CONFIG_MIPS_DB1500=y
64# CONFIG_TOSHIBA_RBTX4927 is not set 64# CONFIG_TOSHIBA_RBTX4927 is not set
65# CONFIG_TOSHIBA_RBTX4938 is not set 65# CONFIG_TOSHIBA_RBTX4938 is not set
66CONFIG_RWSEM_GENERIC_SPINLOCK=y 66CONFIG_RWSEM_GENERIC_SPINLOCK=y
67CONFIG_GENERIC_FIND_NEXT_BIT=y
68CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 69CONFIG_GENERIC_CALIBRATE_DELAY=y
68CONFIG_DMA_NONCOHERENT=y 70CONFIG_DMA_NONCOHERENT=y
69CONFIG_DMA_NEED_PCI_MAP_STATE=y 71CONFIG_DMA_NEED_PCI_MAP_STATE=y
@@ -116,11 +118,11 @@ CONFIG_PAGE_SIZE_4KB=y
116CONFIG_CPU_HAS_PREFETCH=y 118CONFIG_CPU_HAS_PREFETCH=y
117# CONFIG_MIPS_MT is not set 119# CONFIG_MIPS_MT is not set
118CONFIG_64BIT_PHYS_ADDR=y 120CONFIG_64BIT_PHYS_ADDR=y
119# CONFIG_CPU_ADVANCED is not set
120CONFIG_CPU_HAS_LLSC=y 121CONFIG_CPU_HAS_LLSC=y
121CONFIG_CPU_HAS_SYNC=y 122CONFIG_CPU_HAS_SYNC=y
122CONFIG_GENERIC_HARDIRQS=y 123CONFIG_GENERIC_HARDIRQS=y
123CONFIG_GENERIC_IRQ_PROBE=y 124CONFIG_GENERIC_IRQ_PROBE=y
125CONFIG_CPU_SUPPORTS_HIGHMEM=y
124CONFIG_ARCH_FLATMEM_ENABLE=y 126CONFIG_ARCH_FLATMEM_ENABLE=y
125CONFIG_SELECT_MEMORY_MODEL=y 127CONFIG_SELECT_MEMORY_MODEL=y
126CONFIG_FLATMEM_MANUAL=y 128CONFIG_FLATMEM_MANUAL=y
@@ -138,7 +140,6 @@ CONFIG_PREEMPT_NONE=y
138# Code maturity level options 140# Code maturity level options
139# 141#
140CONFIG_EXPERIMENTAL=y 142CONFIG_EXPERIMENTAL=y
141CONFIG_CLEAN_COMPILE=y
142CONFIG_BROKEN_ON_SMP=y 143CONFIG_BROKEN_ON_SMP=y
143CONFIG_INIT_ENV_ARG_LIMIT=32 144CONFIG_INIT_ENV_ARG_LIMIT=32
144 145
@@ -154,6 +155,7 @@ CONFIG_SYSVIPC=y
154CONFIG_SYSCTL=y 155CONFIG_SYSCTL=y
155# CONFIG_AUDIT is not set 156# CONFIG_AUDIT is not set
156# CONFIG_IKCONFIG is not set 157# CONFIG_IKCONFIG is not set
158CONFIG_RELAY=y
157CONFIG_INITRAMFS_SOURCE="" 159CONFIG_INITRAMFS_SOURCE=""
158# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 160# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
159CONFIG_EMBEDDED=y 161CONFIG_EMBEDDED=y
@@ -167,10 +169,6 @@ CONFIG_BASE_FULL=y
167CONFIG_FUTEX=y 169CONFIG_FUTEX=y
168CONFIG_EPOLL=y 170CONFIG_EPOLL=y
169CONFIG_SHMEM=y 171CONFIG_SHMEM=y
170CONFIG_CC_ALIGN_FUNCTIONS=0
171CONFIG_CC_ALIGN_LABELS=0
172CONFIG_CC_ALIGN_LOOPS=0
173CONFIG_CC_ALIGN_JUMPS=0
174CONFIG_SLAB=y 172CONFIG_SLAB=y
175# CONFIG_TINY_SHMEM is not set 173# CONFIG_TINY_SHMEM is not set
176CONFIG_BASE_SMALL=0 174CONFIG_BASE_SMALL=0
@@ -183,7 +181,6 @@ CONFIG_OBSOLETE_INTERMODULE=y
183CONFIG_MODULES=y 181CONFIG_MODULES=y
184CONFIG_MODULE_UNLOAD=y 182CONFIG_MODULE_UNLOAD=y
185# CONFIG_MODULE_FORCE_UNLOAD is not set 183# CONFIG_MODULE_FORCE_UNLOAD is not set
186CONFIG_OBSOLETE_MODPARM=y
187CONFIG_MODVERSIONS=y 184CONFIG_MODVERSIONS=y
188CONFIG_MODULE_SRCVERSION_ALL=y 185CONFIG_MODULE_SRCVERSION_ALL=y
189CONFIG_KMOD=y 186CONFIG_KMOD=y
@@ -192,6 +189,8 @@ CONFIG_KMOD=y
192# Block layer 189# Block layer
193# 190#
194# CONFIG_LBD is not set 191# CONFIG_LBD is not set
192# CONFIG_BLK_DEV_IO_TRACE is not set
193# CONFIG_LSF is not set
195 194
196# 195#
197# IO Schedulers 196# IO Schedulers
@@ -211,7 +210,6 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
211# 210#
212CONFIG_HW_HAS_PCI=y 211CONFIG_HW_HAS_PCI=y
213CONFIG_PCI=y 212CONFIG_PCI=y
214CONFIG_PCI_LEGACY_PROC=y
215CONFIG_MMU=y 213CONFIG_MMU=y
216 214
217# 215#
@@ -253,6 +251,7 @@ CONFIG_NET=y
253# 251#
254# Networking options 252# Networking options
255# 253#
254# CONFIG_NETDEBUG is not set
256CONFIG_PACKET=y 255CONFIG_PACKET=y
257# CONFIG_PACKET_MMAP is not set 256# CONFIG_PACKET_MMAP is not set
258CONFIG_UNIX=y 257CONFIG_UNIX=y
@@ -275,7 +274,8 @@ CONFIG_IP_PNP_BOOTP=y
275# CONFIG_INET_AH is not set 274# CONFIG_INET_AH is not set
276# CONFIG_INET_ESP is not set 275# CONFIG_INET_ESP is not set
277# CONFIG_INET_IPCOMP is not set 276# CONFIG_INET_IPCOMP is not set
278CONFIG_INET_TUNNEL=m 277# CONFIG_INET_XFRM_TUNNEL is not set
278# CONFIG_INET_TUNNEL is not set
279CONFIG_INET_DIAG=y 279CONFIG_INET_DIAG=y
280CONFIG_INET_TCP_DIAG=y 280CONFIG_INET_TCP_DIAG=y
281# CONFIG_TCP_CONG_ADVANCED is not set 281# CONFIG_TCP_CONG_ADVANCED is not set
@@ -286,6 +286,8 @@ CONFIG_TCP_CONG_BIC=y
286# 286#
287# CONFIG_IP_VS is not set 287# CONFIG_IP_VS is not set
288# CONFIG_IPV6 is not set 288# CONFIG_IPV6 is not set
289# CONFIG_INET6_XFRM_TUNNEL is not set
290# CONFIG_INET6_TUNNEL is not set
289CONFIG_NETFILTER=y 291CONFIG_NETFILTER=y
290# CONFIG_NETFILTER_DEBUG is not set 292# CONFIG_NETFILTER_DEBUG is not set
291 293
@@ -302,10 +304,13 @@ CONFIG_NETFILTER_XT_TARGET_MARK=m
302CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m 304CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
303CONFIG_NETFILTER_XT_MATCH_COMMENT=m 305CONFIG_NETFILTER_XT_MATCH_COMMENT=m
304CONFIG_NETFILTER_XT_MATCH_DCCP=m 306CONFIG_NETFILTER_XT_MATCH_DCCP=m
307CONFIG_NETFILTER_XT_MATCH_ESP=m
305CONFIG_NETFILTER_XT_MATCH_LENGTH=m 308CONFIG_NETFILTER_XT_MATCH_LENGTH=m
306CONFIG_NETFILTER_XT_MATCH_LIMIT=m 309CONFIG_NETFILTER_XT_MATCH_LIMIT=m
307CONFIG_NETFILTER_XT_MATCH_MAC=m 310CONFIG_NETFILTER_XT_MATCH_MAC=m
308CONFIG_NETFILTER_XT_MATCH_MARK=m 311CONFIG_NETFILTER_XT_MATCH_MARK=m
312CONFIG_NETFILTER_XT_MATCH_POLICY=m
313CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
309CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m 314CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
310CONFIG_NETFILTER_XT_MATCH_REALM=m 315CONFIG_NETFILTER_XT_MATCH_REALM=m
311CONFIG_NETFILTER_XT_MATCH_SCTP=m 316CONFIG_NETFILTER_XT_MATCH_SCTP=m
@@ -329,6 +334,11 @@ CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
329# SCTP Configuration (EXPERIMENTAL) 334# SCTP Configuration (EXPERIMENTAL)
330# 335#
331# CONFIG_IP_SCTP is not set 336# CONFIG_IP_SCTP is not set
337
338#
339# TIPC Configuration (EXPERIMENTAL)
340#
341# CONFIG_TIPC is not set
332# CONFIG_ATM is not set 342# CONFIG_ATM is not set
333# CONFIG_BRIDGE is not set 343# CONFIG_BRIDGE is not set
334# CONFIG_VLAN_8021Q is not set 344# CONFIG_VLAN_8021Q is not set
@@ -338,11 +348,6 @@ CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
338# CONFIG_ATALK is not set 348# CONFIG_ATALK is not set
339# CONFIG_X25 is not set 349# CONFIG_X25 is not set
340# CONFIG_LAPB is not set 350# CONFIG_LAPB is not set
341
342#
343# TIPC Configuration (EXPERIMENTAL)
344#
345# CONFIG_TIPC is not set
346# CONFIG_NET_DIVERT is not set 351# CONFIG_NET_DIVERT is not set
347# CONFIG_ECONET is not set 352# CONFIG_ECONET is not set
348# CONFIG_WAN_ROUTER is not set 353# CONFIG_WAN_ROUTER is not set
@@ -364,6 +369,9 @@ CONFIG_IEEE80211=m
364# CONFIG_IEEE80211_DEBUG is not set 369# CONFIG_IEEE80211_DEBUG is not set
365CONFIG_IEEE80211_CRYPT_WEP=m 370CONFIG_IEEE80211_CRYPT_WEP=m
366CONFIG_IEEE80211_CRYPT_CCMP=m 371CONFIG_IEEE80211_CRYPT_CCMP=m
372CONFIG_IEEE80211_SOFTMAC=m
373# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
374CONFIG_WIRELESS_EXT=y
367 375
368# 376#
369# Device Drivers 377# Device Drivers
@@ -420,7 +428,6 @@ CONFIG_MTD_CFI_I2=y
420# CONFIG_MTD_CFI_I8 is not set 428# CONFIG_MTD_CFI_I8 is not set
421CONFIG_MTD_CFI_INTELEXT=y 429CONFIG_MTD_CFI_INTELEXT=y
422CONFIG_MTD_CFI_AMDSTD=y 430CONFIG_MTD_CFI_AMDSTD=y
423CONFIG_MTD_CFI_AMDSTD_RETRY=0
424# CONFIG_MTD_CFI_STAA is not set 431# CONFIG_MTD_CFI_STAA is not set
425CONFIG_MTD_CFI_UTIL=y 432CONFIG_MTD_CFI_UTIL=y
426# CONFIG_MTD_RAM is not set 433# CONFIG_MTD_RAM is not set
@@ -443,7 +450,6 @@ CONFIG_MTD_ALCHEMY=y
443# CONFIG_MTD_SLRAM is not set 450# CONFIG_MTD_SLRAM is not set
444# CONFIG_MTD_PHRAM is not set 451# CONFIG_MTD_PHRAM is not set
445# CONFIG_MTD_MTDRAM is not set 452# CONFIG_MTD_MTDRAM is not set
446# CONFIG_MTD_BLKMTD is not set
447# CONFIG_MTD_BLOCK2MTD is not set 453# CONFIG_MTD_BLOCK2MTD is not set
448 454
449# 455#
@@ -486,7 +492,7 @@ CONFIG_BLK_DEV_LOOP=y
486# CONFIG_BLK_DEV_SX8 is not set 492# CONFIG_BLK_DEV_SX8 is not set
487# CONFIG_BLK_DEV_UB is not set 493# CONFIG_BLK_DEV_UB is not set
488# CONFIG_BLK_DEV_RAM is not set 494# CONFIG_BLK_DEV_RAM is not set
489CONFIG_BLK_DEV_RAM_COUNT=16 495# CONFIG_BLK_DEV_INITRD is not set
490CONFIG_CDROM_PKTCDVD=m 496CONFIG_CDROM_PKTCDVD=m
491CONFIG_CDROM_PKTCDVD_BUFFERS=8 497CONFIG_CDROM_PKTCDVD_BUFFERS=8
492# CONFIG_CDROM_PKTCDVD_WCACHE is not set 498# CONFIG_CDROM_PKTCDVD_WCACHE is not set
@@ -714,6 +720,7 @@ CONFIG_SERIO_RAW=m
714# 720#
715CONFIG_SERIAL_8250=y 721CONFIG_SERIAL_8250=y
716CONFIG_SERIAL_8250_CONSOLE=y 722CONFIG_SERIAL_8250_CONSOLE=y
723CONFIG_SERIAL_8250_PCI=y
717# CONFIG_SERIAL_8250_CS is not set 724# CONFIG_SERIAL_8250_CS is not set
718CONFIG_SERIAL_8250_NR_UARTS=4 725CONFIG_SERIAL_8250_NR_UARTS=4
719CONFIG_SERIAL_8250_RUNTIME_UARTS=4 726CONFIG_SERIAL_8250_RUNTIME_UARTS=4
@@ -725,6 +732,7 @@ CONFIG_SERIAL_8250_AU1X00=y
725# 732#
726CONFIG_SERIAL_CORE=y 733CONFIG_SERIAL_CORE=y
727CONFIG_SERIAL_CORE_CONSOLE=y 734CONFIG_SERIAL_CORE_CONSOLE=y
735# CONFIG_SERIAL_JSM is not set
728CONFIG_UNIX98_PTYS=y 736CONFIG_UNIX98_PTYS=y
729CONFIG_LEGACY_PTYS=y 737CONFIG_LEGACY_PTYS=y
730CONFIG_LEGACY_PTY_COUNT=256 738CONFIG_LEGACY_PTY_COUNT=256
@@ -790,10 +798,6 @@ CONFIG_SYNCLINK_CS=m
790# 798#
791 799
792# 800#
793# Multimedia Capabilities Port drivers
794#
795
796#
797# Multimedia devices 801# Multimedia devices
798# 802#
799# CONFIG_VIDEO_DEV is not set 803# CONFIG_VIDEO_DEV is not set
@@ -802,6 +806,7 @@ CONFIG_SYNCLINK_CS=m
802# Digital Video Broadcasting Devices 806# Digital Video Broadcasting Devices
803# 807#
804# CONFIG_DVB is not set 808# CONFIG_DVB is not set
809# CONFIG_USB_DABUSB is not set
805 810
806# 811#
807# Graphics support 812# Graphics support
@@ -825,9 +830,11 @@ CONFIG_SND_SEQ_DUMMY=m
825CONFIG_SND_OSSEMUL=y 830CONFIG_SND_OSSEMUL=y
826CONFIG_SND_MIXER_OSS=m 831CONFIG_SND_MIXER_OSS=m
827CONFIG_SND_PCM_OSS=m 832CONFIG_SND_PCM_OSS=m
833CONFIG_SND_PCM_OSS_PLUGINS=y
828CONFIG_SND_SEQUENCER_OSS=y 834CONFIG_SND_SEQUENCER_OSS=y
829# CONFIG_SND_DYNAMIC_MINORS is not set 835# CONFIG_SND_DYNAMIC_MINORS is not set
830CONFIG_SND_SUPPORT_OLD_API=y 836CONFIG_SND_SUPPORT_OLD_API=y
837CONFIG_SND_VERBOSE_PROCFS=y
831# CONFIG_SND_VERBOSE_PRINTK is not set 838# CONFIG_SND_VERBOSE_PRINTK is not set
832# CONFIG_SND_DEBUG is not set 839# CONFIG_SND_DEBUG is not set
833 840
@@ -846,6 +853,7 @@ CONFIG_SND_MTPAV=m
846# PCI devices 853# PCI devices
847# 854#
848# CONFIG_SND_AD1889 is not set 855# CONFIG_SND_AD1889 is not set
856# CONFIG_SND_ALS300 is not set
849# CONFIG_SND_ALI5451 is not set 857# CONFIG_SND_ALI5451 is not set
850# CONFIG_SND_ATIIXP is not set 858# CONFIG_SND_ATIIXP is not set
851# CONFIG_SND_ATIIXP_MODEM is not set 859# CONFIG_SND_ATIIXP_MODEM is not set
@@ -877,6 +885,7 @@ CONFIG_SND_MTPAV=m
877# CONFIG_SND_MIXART is not set 885# CONFIG_SND_MIXART is not set
878# CONFIG_SND_NM256 is not set 886# CONFIG_SND_NM256 is not set
879# CONFIG_SND_PCXHR is not set 887# CONFIG_SND_PCXHR is not set
888# CONFIG_SND_RIPTIDE is not set
880# CONFIG_SND_RME32 is not set 889# CONFIG_SND_RME32 is not set
881# CONFIG_SND_RME96 is not set 890# CONFIG_SND_RME96 is not set
882# CONFIG_SND_RME9652 is not set 891# CONFIG_SND_RME9652 is not set
@@ -905,34 +914,22 @@ CONFIG_SND_AU1X00=m
905# Open Sound System 914# Open Sound System
906# 915#
907CONFIG_SOUND_PRIME=y 916CONFIG_SOUND_PRIME=y
908CONFIG_OBSOLETE_OSS_DRIVER=y
909# CONFIG_SOUND_BT878 is not set 917# CONFIG_SOUND_BT878 is not set
910# CONFIG_SOUND_CMPCI is not set
911# CONFIG_SOUND_EMU10K1 is not set 918# CONFIG_SOUND_EMU10K1 is not set
912# CONFIG_SOUND_FUSION is not set 919# CONFIG_SOUND_FUSION is not set
913# CONFIG_SOUND_CS4281 is not set
914# CONFIG_SOUND_ES1370 is not set
915# CONFIG_SOUND_ES1371 is not set 920# CONFIG_SOUND_ES1371 is not set
916# CONFIG_SOUND_ESSSOLO1 is not set
917# CONFIG_SOUND_MAESTRO is not set
918# CONFIG_SOUND_MAESTRO3 is not set
919# CONFIG_SOUND_ICH is not set 921# CONFIG_SOUND_ICH is not set
920# CONFIG_SOUND_SONICVIBES is not set
921# CONFIG_SOUND_AU1000 is not set
922# CONFIG_SOUND_TRIDENT is not set 922# CONFIG_SOUND_TRIDENT is not set
923# CONFIG_SOUND_MSNDCLAS is not set 923# CONFIG_SOUND_MSNDCLAS is not set
924# CONFIG_SOUND_MSNDPIN is not set 924# CONFIG_SOUND_MSNDPIN is not set
925# CONFIG_SOUND_VIA82CXXX is not set 925# CONFIG_SOUND_VIA82CXXX is not set
926# CONFIG_SOUND_ALI5455 is not set
927# CONFIG_SOUND_FORTE is not set
928# CONFIG_SOUND_RME96XX is not set
929# CONFIG_SOUND_AD1980 is not set
930 926
931# 927#
932# USB support 928# USB support
933# 929#
934CONFIG_USB_ARCH_HAS_HCD=y 930CONFIG_USB_ARCH_HAS_HCD=y
935CONFIG_USB_ARCH_HAS_OHCI=y 931CONFIG_USB_ARCH_HAS_OHCI=y
932CONFIG_USB_ARCH_HAS_EHCI=y
936CONFIG_USB=y 933CONFIG_USB=y
937# CONFIG_USB_DEBUG is not set 934# CONFIG_USB_DEBUG is not set
938 935
@@ -958,7 +955,6 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y
958# 955#
959# USB Device Class drivers 956# USB Device Class drivers
960# 957#
961# CONFIG_OBSOLETE_OSS_USB_DRIVER is not set
962# CONFIG_USB_ACM is not set 958# CONFIG_USB_ACM is not set
963# CONFIG_USB_PRINTER is not set 959# CONFIG_USB_PRINTER is not set
964 960
@@ -985,9 +981,7 @@ CONFIG_USB_HIDINPUT=y
985# CONFIG_USB_ACECAD is not set 981# CONFIG_USB_ACECAD is not set
986# CONFIG_USB_KBTAB is not set 982# CONFIG_USB_KBTAB is not set
987# CONFIG_USB_POWERMATE is not set 983# CONFIG_USB_POWERMATE is not set
988# CONFIG_USB_MTOUCH is not set 984# CONFIG_USB_TOUCHSCREEN is not set
989# CONFIG_USB_ITMTOUCH is not set
990# CONFIG_USB_EGALAX is not set
991CONFIG_USB_YEALINK=m 985CONFIG_USB_YEALINK=m
992# CONFIG_USB_XPAD is not set 986# CONFIG_USB_XPAD is not set
993# CONFIG_USB_ATI_REMOTE is not set 987# CONFIG_USB_ATI_REMOTE is not set
@@ -1001,15 +995,6 @@ CONFIG_USB_YEALINK=m
1001# CONFIG_USB_MDC800 is not set 995# CONFIG_USB_MDC800 is not set
1002 996
1003# 997#
1004# USB Multimedia devices
1005#
1006# CONFIG_USB_DABUSB is not set
1007
1008#
1009# Video4Linux support is needed for USB Multimedia device support
1010#
1011
1012#
1013# USB Network Adapters 998# USB Network Adapters
1014# 999#
1015# CONFIG_USB_CATC is not set 1000# CONFIG_USB_CATC is not set
@@ -1059,13 +1044,31 @@ CONFIG_USB_LD=m
1059# CONFIG_MMC is not set 1044# CONFIG_MMC is not set
1060 1045
1061# 1046#
1047# LED devices
1048#
1049# CONFIG_NEW_LEDS is not set
1050
1051#
1052# LED drivers
1053#
1054
1055#
1056# LED Triggers
1057#
1058
1059#
1062# InfiniBand support 1060# InfiniBand support
1063# 1061#
1064# CONFIG_INFINIBAND is not set 1062# CONFIG_INFINIBAND is not set
1065 1063
1066# 1064#
1067# SN Devices 1065# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
1066#
1067
1068#
1069# Real Time Clock
1068# 1070#
1071# CONFIG_RTC_CLASS is not set
1069 1072
1070# 1073#
1071# File systems 1074# File systems
@@ -1123,7 +1126,6 @@ CONFIG_SYSFS=y
1123CONFIG_TMPFS=y 1126CONFIG_TMPFS=y
1124# CONFIG_HUGETLB_PAGE is not set 1127# CONFIG_HUGETLB_PAGE is not set
1125CONFIG_RAMFS=y 1128CONFIG_RAMFS=y
1126CONFIG_RELAYFS_FS=m
1127# CONFIG_CONFIGFS_FS is not set 1129# CONFIG_CONFIGFS_FS is not set
1128 1130
1129# 1131#
@@ -1232,6 +1234,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1232# CONFIG_MAGIC_SYSRQ is not set 1234# CONFIG_MAGIC_SYSRQ is not set
1233# CONFIG_DEBUG_KERNEL is not set 1235# CONFIG_DEBUG_KERNEL is not set
1234CONFIG_LOG_BUF_SHIFT=14 1236CONFIG_LOG_BUF_SHIFT=14
1237# CONFIG_DEBUG_FS is not set
1235CONFIG_CROSSCOMPILE=y 1238CONFIG_CROSSCOMPILE=y
1236CONFIG_CMDLINE="" 1239CONFIG_CMDLINE=""
1237 1240
diff --git a/arch/mips/configs/db1550_defconfig b/arch/mips/configs/db1550_defconfig
index 8dc1f18badfe..8130e23dc255 100644
--- a/arch/mips/configs/db1550_defconfig
+++ b/arch/mips/configs/db1550_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc1 3# Linux kernel version: 2.6.17-rc2
4# Fri Jan 27 15:40:00 2006 4# Mon Apr 24 14:51:00 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -64,6 +64,8 @@ CONFIG_MIPS_DB1550=y
64# CONFIG_TOSHIBA_RBTX4927 is not set 64# CONFIG_TOSHIBA_RBTX4927 is not set
65# CONFIG_TOSHIBA_RBTX4938 is not set 65# CONFIG_TOSHIBA_RBTX4938 is not set
66CONFIG_RWSEM_GENERIC_SPINLOCK=y 66CONFIG_RWSEM_GENERIC_SPINLOCK=y
67CONFIG_GENERIC_FIND_NEXT_BIT=y
68CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 69CONFIG_GENERIC_CALIBRATE_DELAY=y
68CONFIG_DMA_NONCOHERENT=y 70CONFIG_DMA_NONCOHERENT=y
69CONFIG_DMA_NEED_PCI_MAP_STATE=y 71CONFIG_DMA_NEED_PCI_MAP_STATE=y
@@ -115,11 +117,11 @@ CONFIG_PAGE_SIZE_4KB=y
115CONFIG_CPU_HAS_PREFETCH=y 117CONFIG_CPU_HAS_PREFETCH=y
116# CONFIG_MIPS_MT is not set 118# CONFIG_MIPS_MT is not set
117CONFIG_64BIT_PHYS_ADDR=y 119CONFIG_64BIT_PHYS_ADDR=y
118# CONFIG_CPU_ADVANCED is not set
119CONFIG_CPU_HAS_LLSC=y 120CONFIG_CPU_HAS_LLSC=y
120CONFIG_CPU_HAS_SYNC=y 121CONFIG_CPU_HAS_SYNC=y
121CONFIG_GENERIC_HARDIRQS=y 122CONFIG_GENERIC_HARDIRQS=y
122CONFIG_GENERIC_IRQ_PROBE=y 123CONFIG_GENERIC_IRQ_PROBE=y
124CONFIG_CPU_SUPPORTS_HIGHMEM=y
123CONFIG_ARCH_FLATMEM_ENABLE=y 125CONFIG_ARCH_FLATMEM_ENABLE=y
124CONFIG_SELECT_MEMORY_MODEL=y 126CONFIG_SELECT_MEMORY_MODEL=y
125CONFIG_FLATMEM_MANUAL=y 127CONFIG_FLATMEM_MANUAL=y
@@ -137,7 +139,6 @@ CONFIG_PREEMPT_NONE=y
137# Code maturity level options 139# Code maturity level options
138# 140#
139CONFIG_EXPERIMENTAL=y 141CONFIG_EXPERIMENTAL=y
140CONFIG_CLEAN_COMPILE=y
141CONFIG_BROKEN_ON_SMP=y 142CONFIG_BROKEN_ON_SMP=y
142CONFIG_INIT_ENV_ARG_LIMIT=32 143CONFIG_INIT_ENV_ARG_LIMIT=32
143 144
@@ -153,6 +154,7 @@ CONFIG_SYSVIPC=y
153CONFIG_SYSCTL=y 154CONFIG_SYSCTL=y
154# CONFIG_AUDIT is not set 155# CONFIG_AUDIT is not set
155# CONFIG_IKCONFIG is not set 156# CONFIG_IKCONFIG is not set
157CONFIG_RELAY=y
156CONFIG_INITRAMFS_SOURCE="" 158CONFIG_INITRAMFS_SOURCE=""
157# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 159# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
158CONFIG_EMBEDDED=y 160CONFIG_EMBEDDED=y
@@ -166,10 +168,6 @@ CONFIG_BASE_FULL=y
166CONFIG_FUTEX=y 168CONFIG_FUTEX=y
167CONFIG_EPOLL=y 169CONFIG_EPOLL=y
168CONFIG_SHMEM=y 170CONFIG_SHMEM=y
169CONFIG_CC_ALIGN_FUNCTIONS=0
170CONFIG_CC_ALIGN_LABELS=0
171CONFIG_CC_ALIGN_LOOPS=0
172CONFIG_CC_ALIGN_JUMPS=0
173CONFIG_SLAB=y 171CONFIG_SLAB=y
174# CONFIG_TINY_SHMEM is not set 172# CONFIG_TINY_SHMEM is not set
175CONFIG_BASE_SMALL=0 173CONFIG_BASE_SMALL=0
@@ -182,7 +180,6 @@ CONFIG_OBSOLETE_INTERMODULE=y
182CONFIG_MODULES=y 180CONFIG_MODULES=y
183CONFIG_MODULE_UNLOAD=y 181CONFIG_MODULE_UNLOAD=y
184# CONFIG_MODULE_FORCE_UNLOAD is not set 182# CONFIG_MODULE_FORCE_UNLOAD is not set
185CONFIG_OBSOLETE_MODPARM=y
186CONFIG_MODVERSIONS=y 183CONFIG_MODVERSIONS=y
187CONFIG_MODULE_SRCVERSION_ALL=y 184CONFIG_MODULE_SRCVERSION_ALL=y
188CONFIG_KMOD=y 185CONFIG_KMOD=y
@@ -191,6 +188,8 @@ CONFIG_KMOD=y
191# Block layer 188# Block layer
192# 189#
193# CONFIG_LBD is not set 190# CONFIG_LBD is not set
191# CONFIG_BLK_DEV_IO_TRACE is not set
192# CONFIG_LSF is not set
194 193
195# 194#
196# IO Schedulers 195# IO Schedulers
@@ -210,7 +209,6 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
210# 209#
211CONFIG_HW_HAS_PCI=y 210CONFIG_HW_HAS_PCI=y
212CONFIG_PCI=y 211CONFIG_PCI=y
213CONFIG_PCI_LEGACY_PROC=y
214CONFIG_MMU=y 212CONFIG_MMU=y
215 213
216# 214#
@@ -252,6 +250,7 @@ CONFIG_NET=y
252# 250#
253# Networking options 251# Networking options
254# 252#
253# CONFIG_NETDEBUG is not set
255CONFIG_PACKET=y 254CONFIG_PACKET=y
256# CONFIG_PACKET_MMAP is not set 255# CONFIG_PACKET_MMAP is not set
257CONFIG_UNIX=y 256CONFIG_UNIX=y
@@ -274,7 +273,8 @@ CONFIG_IP_PNP_BOOTP=y
274# CONFIG_INET_AH is not set 273# CONFIG_INET_AH is not set
275# CONFIG_INET_ESP is not set 274# CONFIG_INET_ESP is not set
276# CONFIG_INET_IPCOMP is not set 275# CONFIG_INET_IPCOMP is not set
277CONFIG_INET_TUNNEL=m 276# CONFIG_INET_XFRM_TUNNEL is not set
277# CONFIG_INET_TUNNEL is not set
278CONFIG_INET_DIAG=y 278CONFIG_INET_DIAG=y
279CONFIG_INET_TCP_DIAG=y 279CONFIG_INET_TCP_DIAG=y
280# CONFIG_TCP_CONG_ADVANCED is not set 280# CONFIG_TCP_CONG_ADVANCED is not set
@@ -285,6 +285,8 @@ CONFIG_TCP_CONG_BIC=y
285# 285#
286# CONFIG_IP_VS is not set 286# CONFIG_IP_VS is not set
287# CONFIG_IPV6 is not set 287# CONFIG_IPV6 is not set
288# CONFIG_INET6_XFRM_TUNNEL is not set
289# CONFIG_INET6_TUNNEL is not set
288CONFIG_NETFILTER=y 290CONFIG_NETFILTER=y
289# CONFIG_NETFILTER_DEBUG is not set 291# CONFIG_NETFILTER_DEBUG is not set
290 292
@@ -301,10 +303,13 @@ CONFIG_NETFILTER_XT_TARGET_MARK=m
301CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m 303CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
302CONFIG_NETFILTER_XT_MATCH_COMMENT=m 304CONFIG_NETFILTER_XT_MATCH_COMMENT=m
303CONFIG_NETFILTER_XT_MATCH_DCCP=m 305CONFIG_NETFILTER_XT_MATCH_DCCP=m
306CONFIG_NETFILTER_XT_MATCH_ESP=m
304CONFIG_NETFILTER_XT_MATCH_LENGTH=m 307CONFIG_NETFILTER_XT_MATCH_LENGTH=m
305CONFIG_NETFILTER_XT_MATCH_LIMIT=m 308CONFIG_NETFILTER_XT_MATCH_LIMIT=m
306CONFIG_NETFILTER_XT_MATCH_MAC=m 309CONFIG_NETFILTER_XT_MATCH_MAC=m
307CONFIG_NETFILTER_XT_MATCH_MARK=m 310CONFIG_NETFILTER_XT_MATCH_MARK=m
311CONFIG_NETFILTER_XT_MATCH_POLICY=m
312CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
308CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m 313CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
309CONFIG_NETFILTER_XT_MATCH_REALM=m 314CONFIG_NETFILTER_XT_MATCH_REALM=m
310CONFIG_NETFILTER_XT_MATCH_SCTP=m 315CONFIG_NETFILTER_XT_MATCH_SCTP=m
@@ -328,6 +333,11 @@ CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
328# SCTP Configuration (EXPERIMENTAL) 333# SCTP Configuration (EXPERIMENTAL)
329# 334#
330# CONFIG_IP_SCTP is not set 335# CONFIG_IP_SCTP is not set
336
337#
338# TIPC Configuration (EXPERIMENTAL)
339#
340# CONFIG_TIPC is not set
331# CONFIG_ATM is not set 341# CONFIG_ATM is not set
332# CONFIG_BRIDGE is not set 342# CONFIG_BRIDGE is not set
333# CONFIG_VLAN_8021Q is not set 343# CONFIG_VLAN_8021Q is not set
@@ -337,11 +347,6 @@ CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
337# CONFIG_ATALK is not set 347# CONFIG_ATALK is not set
338# CONFIG_X25 is not set 348# CONFIG_X25 is not set
339# CONFIG_LAPB is not set 349# CONFIG_LAPB is not set
340
341#
342# TIPC Configuration (EXPERIMENTAL)
343#
344# CONFIG_TIPC is not set
345# CONFIG_NET_DIVERT is not set 350# CONFIG_NET_DIVERT is not set
346# CONFIG_ECONET is not set 351# CONFIG_ECONET is not set
347# CONFIG_WAN_ROUTER is not set 352# CONFIG_WAN_ROUTER is not set
@@ -363,6 +368,9 @@ CONFIG_IEEE80211=m
363# CONFIG_IEEE80211_DEBUG is not set 368# CONFIG_IEEE80211_DEBUG is not set
364CONFIG_IEEE80211_CRYPT_WEP=m 369CONFIG_IEEE80211_CRYPT_WEP=m
365CONFIG_IEEE80211_CRYPT_CCMP=m 370CONFIG_IEEE80211_CRYPT_CCMP=m
371CONFIG_IEEE80211_SOFTMAC=m
372# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
373CONFIG_WIRELESS_EXT=y
366 374
367# 375#
368# Device Drivers 376# Device Drivers
@@ -419,7 +427,6 @@ CONFIG_MTD_CFI_I2=y
419# CONFIG_MTD_CFI_I8 is not set 427# CONFIG_MTD_CFI_I8 is not set
420# CONFIG_MTD_CFI_INTELEXT is not set 428# CONFIG_MTD_CFI_INTELEXT is not set
421CONFIG_MTD_CFI_AMDSTD=y 429CONFIG_MTD_CFI_AMDSTD=y
422CONFIG_MTD_CFI_AMDSTD_RETRY=0
423# CONFIG_MTD_CFI_STAA is not set 430# CONFIG_MTD_CFI_STAA is not set
424CONFIG_MTD_CFI_UTIL=y 431CONFIG_MTD_CFI_UTIL=y
425# CONFIG_MTD_RAM is not set 432# CONFIG_MTD_RAM is not set
@@ -442,7 +449,6 @@ CONFIG_MTD_ALCHEMY=y
442# CONFIG_MTD_SLRAM is not set 449# CONFIG_MTD_SLRAM is not set
443# CONFIG_MTD_PHRAM is not set 450# CONFIG_MTD_PHRAM is not set
444# CONFIG_MTD_MTDRAM is not set 451# CONFIG_MTD_MTDRAM is not set
445# CONFIG_MTD_BLKMTD is not set
446# CONFIG_MTD_BLOCK2MTD is not set 452# CONFIG_MTD_BLOCK2MTD is not set
447 453
448# 454#
@@ -489,7 +495,7 @@ CONFIG_BLK_DEV_LOOP=y
489# CONFIG_BLK_DEV_NBD is not set 495# CONFIG_BLK_DEV_NBD is not set
490# CONFIG_BLK_DEV_SX8 is not set 496# CONFIG_BLK_DEV_SX8 is not set
491# CONFIG_BLK_DEV_RAM is not set 497# CONFIG_BLK_DEV_RAM is not set
492CONFIG_BLK_DEV_RAM_COUNT=16 498# CONFIG_BLK_DEV_INITRD is not set
493CONFIG_CDROM_PKTCDVD=m 499CONFIG_CDROM_PKTCDVD=m
494CONFIG_CDROM_PKTCDVD_BUFFERS=8 500CONFIG_CDROM_PKTCDVD_BUFFERS=8
495# CONFIG_CDROM_PKTCDVD_WCACHE is not set 501# CONFIG_CDROM_PKTCDVD_WCACHE is not set
@@ -754,6 +760,7 @@ CONFIG_SERIO_RAW=m
754# 760#
755CONFIG_SERIAL_8250=y 761CONFIG_SERIAL_8250=y
756CONFIG_SERIAL_8250_CONSOLE=y 762CONFIG_SERIAL_8250_CONSOLE=y
763CONFIG_SERIAL_8250_PCI=y
757# CONFIG_SERIAL_8250_CS is not set 764# CONFIG_SERIAL_8250_CS is not set
758CONFIG_SERIAL_8250_NR_UARTS=4 765CONFIG_SERIAL_8250_NR_UARTS=4
759CONFIG_SERIAL_8250_RUNTIME_UARTS=4 766CONFIG_SERIAL_8250_RUNTIME_UARTS=4
@@ -765,6 +772,7 @@ CONFIG_SERIAL_8250_AU1X00=y
765# 772#
766CONFIG_SERIAL_CORE=y 773CONFIG_SERIAL_CORE=y
767CONFIG_SERIAL_CORE_CONSOLE=y 774CONFIG_SERIAL_CORE_CONSOLE=y
775# CONFIG_SERIAL_JSM is not set
768CONFIG_UNIX98_PTYS=y 776CONFIG_UNIX98_PTYS=y
769CONFIG_LEGACY_PTYS=y 777CONFIG_LEGACY_PTYS=y
770CONFIG_LEGACY_PTY_COUNT=256 778CONFIG_LEGACY_PTY_COUNT=256
@@ -830,10 +838,6 @@ CONFIG_SYNCLINK_CS=m
830# 838#
831 839
832# 840#
833# Multimedia Capabilities Port drivers
834#
835
836#
837# Multimedia devices 841# Multimedia devices
838# 842#
839# CONFIG_VIDEO_DEV is not set 843# CONFIG_VIDEO_DEV is not set
@@ -858,6 +862,7 @@ CONFIG_SYNCLINK_CS=m
858# 862#
859CONFIG_USB_ARCH_HAS_HCD=y 863CONFIG_USB_ARCH_HAS_HCD=y
860CONFIG_USB_ARCH_HAS_OHCI=y 864CONFIG_USB_ARCH_HAS_OHCI=y
865CONFIG_USB_ARCH_HAS_EHCI=y
861# CONFIG_USB is not set 866# CONFIG_USB is not set
862 867
863# 868#
@@ -875,13 +880,31 @@ CONFIG_USB_ARCH_HAS_OHCI=y
875# CONFIG_MMC is not set 880# CONFIG_MMC is not set
876 881
877# 882#
883# LED devices
884#
885# CONFIG_NEW_LEDS is not set
886
887#
888# LED drivers
889#
890
891#
892# LED Triggers
893#
894
895#
878# InfiniBand support 896# InfiniBand support
879# 897#
880# CONFIG_INFINIBAND is not set 898# CONFIG_INFINIBAND is not set
881 899
882# 900#
883# SN Devices 901# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
902#
903
904#
905# Real Time Clock
884# 906#
907# CONFIG_RTC_CLASS is not set
885 908
886# 909#
887# File systems 910# File systems
@@ -939,7 +962,6 @@ CONFIG_SYSFS=y
939CONFIG_TMPFS=y 962CONFIG_TMPFS=y
940# CONFIG_HUGETLB_PAGE is not set 963# CONFIG_HUGETLB_PAGE is not set
941CONFIG_RAMFS=y 964CONFIG_RAMFS=y
942CONFIG_RELAYFS_FS=m
943# CONFIG_CONFIGFS_FS is not set 965# CONFIG_CONFIGFS_FS is not set
944 966
945# 967#
@@ -1048,6 +1070,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1048# CONFIG_MAGIC_SYSRQ is not set 1070# CONFIG_MAGIC_SYSRQ is not set
1049# CONFIG_DEBUG_KERNEL is not set 1071# CONFIG_DEBUG_KERNEL is not set
1050CONFIG_LOG_BUF_SHIFT=14 1072CONFIG_LOG_BUF_SHIFT=14
1073# CONFIG_DEBUG_FS is not set
1051CONFIG_CROSSCOMPILE=y 1074CONFIG_CROSSCOMPILE=y
1052CONFIG_CMDLINE="" 1075CONFIG_CMDLINE=""
1053 1076
diff --git a/arch/mips/configs/ddb5476_defconfig b/arch/mips/configs/ddb5476_defconfig
index 8fae63e47e5e..8d88ac1bbfeb 100644
--- a/arch/mips/configs/ddb5476_defconfig
+++ b/arch/mips/configs/ddb5476_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc1 3# Linux kernel version: 2.6.17-rc2
4# Fri Jan 27 15:40:02 2006 4# Mon Apr 24 14:51:00 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -64,6 +64,8 @@ CONFIG_DDB5476=y
64# CONFIG_TOSHIBA_RBTX4927 is not set 64# CONFIG_TOSHIBA_RBTX4927 is not set
65# CONFIG_TOSHIBA_RBTX4938 is not set 65# CONFIG_TOSHIBA_RBTX4938 is not set
66CONFIG_RWSEM_GENERIC_SPINLOCK=y 66CONFIG_RWSEM_GENERIC_SPINLOCK=y
67CONFIG_GENERIC_FIND_NEXT_BIT=y
68CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 69CONFIG_GENERIC_CALIBRATE_DELAY=y
68CONFIG_DMA_NONCOHERENT=y 70CONFIG_DMA_NONCOHERENT=y
69CONFIG_DMA_NEED_PCI_MAP_STATE=y 71CONFIG_DMA_NEED_PCI_MAP_STATE=y
@@ -114,7 +116,6 @@ CONFIG_PAGE_SIZE_4KB=y
114# CONFIG_PAGE_SIZE_16KB is not set 116# CONFIG_PAGE_SIZE_16KB is not set
115# CONFIG_PAGE_SIZE_64KB is not set 117# CONFIG_PAGE_SIZE_64KB is not set
116# CONFIG_MIPS_MT is not set 118# CONFIG_MIPS_MT is not set
117# CONFIG_CPU_ADVANCED is not set
118CONFIG_CPU_HAS_LLSC=y 119CONFIG_CPU_HAS_LLSC=y
119CONFIG_CPU_HAS_SYNC=y 120CONFIG_CPU_HAS_SYNC=y
120CONFIG_GENERIC_HARDIRQS=y 121CONFIG_GENERIC_HARDIRQS=y
@@ -136,7 +137,6 @@ CONFIG_PREEMPT_NONE=y
136# Code maturity level options 137# Code maturity level options
137# 138#
138CONFIG_EXPERIMENTAL=y 139CONFIG_EXPERIMENTAL=y
139CONFIG_CLEAN_COMPILE=y
140CONFIG_BROKEN_ON_SMP=y 140CONFIG_BROKEN_ON_SMP=y
141CONFIG_INIT_ENV_ARG_LIMIT=32 141CONFIG_INIT_ENV_ARG_LIMIT=32
142 142
@@ -152,6 +152,7 @@ CONFIG_SYSVIPC=y
152CONFIG_SYSCTL=y 152CONFIG_SYSCTL=y
153# CONFIG_AUDIT is not set 153# CONFIG_AUDIT is not set
154# CONFIG_IKCONFIG is not set 154# CONFIG_IKCONFIG is not set
155CONFIG_RELAY=y
155CONFIG_INITRAMFS_SOURCE="" 156CONFIG_INITRAMFS_SOURCE=""
156# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 157# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
157CONFIG_EMBEDDED=y 158CONFIG_EMBEDDED=y
@@ -165,10 +166,6 @@ CONFIG_BASE_FULL=y
165CONFIG_FUTEX=y 166CONFIG_FUTEX=y
166CONFIG_EPOLL=y 167CONFIG_EPOLL=y
167CONFIG_SHMEM=y 168CONFIG_SHMEM=y
168CONFIG_CC_ALIGN_FUNCTIONS=0
169CONFIG_CC_ALIGN_LABELS=0
170CONFIG_CC_ALIGN_LOOPS=0
171CONFIG_CC_ALIGN_JUMPS=0
172CONFIG_SLAB=y 169CONFIG_SLAB=y
173# CONFIG_TINY_SHMEM is not set 170# CONFIG_TINY_SHMEM is not set
174CONFIG_BASE_SMALL=0 171CONFIG_BASE_SMALL=0
@@ -183,6 +180,8 @@ CONFIG_BASE_SMALL=0
183# Block layer 180# Block layer
184# 181#
185# CONFIG_LBD is not set 182# CONFIG_LBD is not set
183# CONFIG_BLK_DEV_IO_TRACE is not set
184# CONFIG_LSF is not set
186 185
187# 186#
188# IO Schedulers 187# IO Schedulers
@@ -202,7 +201,6 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
202# 201#
203CONFIG_HW_HAS_PCI=y 202CONFIG_HW_HAS_PCI=y
204CONFIG_PCI=y 203CONFIG_PCI=y
205CONFIG_PCI_LEGACY_PROC=y
206CONFIG_ISA=y 204CONFIG_ISA=y
207CONFIG_MMU=y 205CONFIG_MMU=y
208 206
@@ -231,6 +229,7 @@ CONFIG_NET=y
231# 229#
232# Networking options 230# Networking options
233# 231#
232# CONFIG_NETDEBUG is not set
234CONFIG_PACKET=y 233CONFIG_PACKET=y
235# CONFIG_PACKET_MMAP is not set 234# CONFIG_PACKET_MMAP is not set
236CONFIG_UNIX=y 235CONFIG_UNIX=y
@@ -252,12 +251,15 @@ CONFIG_IP_PNP_BOOTP=y
252# CONFIG_INET_AH is not set 251# CONFIG_INET_AH is not set
253# CONFIG_INET_ESP is not set 252# CONFIG_INET_ESP is not set
254# CONFIG_INET_IPCOMP is not set 253# CONFIG_INET_IPCOMP is not set
255CONFIG_INET_TUNNEL=y 254# CONFIG_INET_XFRM_TUNNEL is not set
255# CONFIG_INET_TUNNEL is not set
256CONFIG_INET_DIAG=y 256CONFIG_INET_DIAG=y
257CONFIG_INET_TCP_DIAG=y 257CONFIG_INET_TCP_DIAG=y
258# CONFIG_TCP_CONG_ADVANCED is not set 258# CONFIG_TCP_CONG_ADVANCED is not set
259CONFIG_TCP_CONG_BIC=y 259CONFIG_TCP_CONG_BIC=y
260# CONFIG_IPV6 is not set 260# CONFIG_IPV6 is not set
261# CONFIG_INET6_XFRM_TUNNEL is not set
262# CONFIG_INET6_TUNNEL is not set
261# CONFIG_NETFILTER is not set 263# CONFIG_NETFILTER is not set
262 264
263# 265#
@@ -269,6 +271,11 @@ CONFIG_TCP_CONG_BIC=y
269# SCTP Configuration (EXPERIMENTAL) 271# SCTP Configuration (EXPERIMENTAL)
270# 272#
271# CONFIG_IP_SCTP is not set 273# CONFIG_IP_SCTP is not set
274
275#
276# TIPC Configuration (EXPERIMENTAL)
277#
278# CONFIG_TIPC is not set
272# CONFIG_ATM is not set 279# CONFIG_ATM is not set
273# CONFIG_BRIDGE is not set 280# CONFIG_BRIDGE is not set
274# CONFIG_VLAN_8021Q is not set 281# CONFIG_VLAN_8021Q is not set
@@ -278,11 +285,6 @@ CONFIG_TCP_CONG_BIC=y
278# CONFIG_ATALK is not set 285# CONFIG_ATALK is not set
279# CONFIG_X25 is not set 286# CONFIG_X25 is not set
280# CONFIG_LAPB is not set 287# CONFIG_LAPB is not set
281
282#
283# TIPC Configuration (EXPERIMENTAL)
284#
285# CONFIG_TIPC is not set
286# CONFIG_NET_DIVERT is not set 288# CONFIG_NET_DIVERT is not set
287# CONFIG_ECONET is not set 289# CONFIG_ECONET is not set
288# CONFIG_WAN_ROUTER is not set 290# CONFIG_WAN_ROUTER is not set
@@ -303,6 +305,9 @@ CONFIG_IEEE80211=y
303# CONFIG_IEEE80211_DEBUG is not set 305# CONFIG_IEEE80211_DEBUG is not set
304CONFIG_IEEE80211_CRYPT_WEP=y 306CONFIG_IEEE80211_CRYPT_WEP=y
305CONFIG_IEEE80211_CRYPT_CCMP=y 307CONFIG_IEEE80211_CRYPT_CCMP=y
308CONFIG_IEEE80211_SOFTMAC=y
309# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
310CONFIG_WIRELESS_EXT=y
306 311
307# 312#
308# Device Drivers 313# Device Drivers
@@ -348,7 +353,7 @@ CONFIG_PROC_EVENTS=y
348# CONFIG_BLK_DEV_NBD is not set 353# CONFIG_BLK_DEV_NBD is not set
349# CONFIG_BLK_DEV_SX8 is not set 354# CONFIG_BLK_DEV_SX8 is not set
350# CONFIG_BLK_DEV_RAM is not set 355# CONFIG_BLK_DEV_RAM is not set
351CONFIG_BLK_DEV_RAM_COUNT=16 356# CONFIG_BLK_DEV_INITRD is not set
352CONFIG_CDROM_PKTCDVD=y 357CONFIG_CDROM_PKTCDVD=y
353CONFIG_CDROM_PKTCDVD_BUFFERS=8 358CONFIG_CDROM_PKTCDVD_BUFFERS=8
354# CONFIG_CDROM_PKTCDVD_WCACHE is not set 359# CONFIG_CDROM_PKTCDVD_WCACHE is not set
@@ -571,6 +576,7 @@ CONFIG_HW_CONSOLE=y
571# 576#
572CONFIG_SERIAL_8250=y 577CONFIG_SERIAL_8250=y
573CONFIG_SERIAL_8250_CONSOLE=y 578CONFIG_SERIAL_8250_CONSOLE=y
579CONFIG_SERIAL_8250_PCI=y
574CONFIG_SERIAL_8250_NR_UARTS=4 580CONFIG_SERIAL_8250_NR_UARTS=4
575CONFIG_SERIAL_8250_RUNTIME_UARTS=4 581CONFIG_SERIAL_8250_RUNTIME_UARTS=4
576# CONFIG_SERIAL_8250_EXTENDED is not set 582# CONFIG_SERIAL_8250_EXTENDED is not set
@@ -580,6 +586,7 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=4
580# 586#
581CONFIG_SERIAL_CORE=y 587CONFIG_SERIAL_CORE=y
582CONFIG_SERIAL_CORE_CONSOLE=y 588CONFIG_SERIAL_CORE_CONSOLE=y
589# CONFIG_SERIAL_JSM is not set
583CONFIG_UNIX98_PTYS=y 590CONFIG_UNIX98_PTYS=y
584CONFIG_LEGACY_PTYS=y 591CONFIG_LEGACY_PTYS=y
585CONFIG_LEGACY_PTY_COUNT=256 592CONFIG_LEGACY_PTY_COUNT=256
@@ -638,10 +645,6 @@ CONFIG_LEGACY_PTY_COUNT=256
638# 645#
639 646
640# 647#
641# Multimedia Capabilities Port drivers
642#
643
644#
645# Multimedia devices 648# Multimedia devices
646# 649#
647# CONFIG_VIDEO_DEV is not set 650# CONFIG_VIDEO_DEV is not set
@@ -659,6 +662,7 @@ CONFIG_FB=y
659# CONFIG_FB_CFB_COPYAREA is not set 662# CONFIG_FB_CFB_COPYAREA is not set
660# CONFIG_FB_CFB_IMAGEBLIT is not set 663# CONFIG_FB_CFB_IMAGEBLIT is not set
661# CONFIG_FB_MACMODES is not set 664# CONFIG_FB_MACMODES is not set
665CONFIG_FB_FIRMWARE_EDID=y
662# CONFIG_FB_MODE_HELPERS is not set 666# CONFIG_FB_MODE_HELPERS is not set
663# CONFIG_FB_TILEBLITTING is not set 667# CONFIG_FB_TILEBLITTING is not set
664# CONFIG_FB_CIRRUS is not set 668# CONFIG_FB_CIRRUS is not set
@@ -670,7 +674,6 @@ CONFIG_FB=y
670# CONFIG_FB_NVIDIA is not set 674# CONFIG_FB_NVIDIA is not set
671# CONFIG_FB_RIVA is not set 675# CONFIG_FB_RIVA is not set
672# CONFIG_FB_MATROX is not set 676# CONFIG_FB_MATROX is not set
673# CONFIG_FB_RADEON_OLD is not set
674# CONFIG_FB_RADEON is not set 677# CONFIG_FB_RADEON is not set
675# CONFIG_FB_ATY128 is not set 678# CONFIG_FB_ATY128 is not set
676# CONFIG_FB_ATY is not set 679# CONFIG_FB_ATY is not set
@@ -708,6 +711,7 @@ CONFIG_DUMMY_CONSOLE=y
708# 711#
709CONFIG_USB_ARCH_HAS_HCD=y 712CONFIG_USB_ARCH_HAS_HCD=y
710CONFIG_USB_ARCH_HAS_OHCI=y 713CONFIG_USB_ARCH_HAS_OHCI=y
714CONFIG_USB_ARCH_HAS_EHCI=y
711# CONFIG_USB is not set 715# CONFIG_USB is not set
712 716
713# 717#
@@ -725,13 +729,31 @@ CONFIG_USB_ARCH_HAS_OHCI=y
725# CONFIG_MMC is not set 729# CONFIG_MMC is not set
726 730
727# 731#
732# LED devices
733#
734# CONFIG_NEW_LEDS is not set
735
736#
737# LED drivers
738#
739
740#
741# LED Triggers
742#
743
744#
728# InfiniBand support 745# InfiniBand support
729# 746#
730# CONFIG_INFINIBAND is not set 747# CONFIG_INFINIBAND is not set
731 748
732# 749#
733# SN Devices 750# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
751#
752
753#
754# Real Time Clock
734# 755#
756# CONFIG_RTC_CLASS is not set
735 757
736# 758#
737# File systems 759# File systems
@@ -776,7 +798,6 @@ CONFIG_SYSFS=y
776# CONFIG_TMPFS is not set 798# CONFIG_TMPFS is not set
777# CONFIG_HUGETLB_PAGE is not set 799# CONFIG_HUGETLB_PAGE is not set
778CONFIG_RAMFS=y 800CONFIG_RAMFS=y
779CONFIG_RELAYFS_FS=y
780# CONFIG_CONFIGFS_FS is not set 801# CONFIG_CONFIGFS_FS is not set
781 802
782# 803#
@@ -840,6 +861,8 @@ CONFIG_MSDOS_PARTITION=y
840# CONFIG_MAGIC_SYSRQ is not set 861# CONFIG_MAGIC_SYSRQ is not set
841# CONFIG_DEBUG_KERNEL is not set 862# CONFIG_DEBUG_KERNEL is not set
842CONFIG_LOG_BUF_SHIFT=14 863CONFIG_LOG_BUF_SHIFT=14
864# CONFIG_DEBUG_FS is not set
865# CONFIG_UNWIND_INFO is not set
843CONFIG_CROSSCOMPILE=y 866CONFIG_CROSSCOMPILE=y
844CONFIG_CMDLINE="ip=any" 867CONFIG_CMDLINE="ip=any"
845 868
diff --git a/arch/mips/configs/ddb5477_defconfig b/arch/mips/configs/ddb5477_defconfig
index a0fcd44e7709..8c911b671415 100644
--- a/arch/mips/configs/ddb5477_defconfig
+++ b/arch/mips/configs/ddb5477_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc1 3# Linux kernel version: 2.6.17-rc2
4# Fri Jan 27 15:40:02 2006 4# Mon Apr 24 14:51:01 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -65,6 +65,8 @@ CONFIG_DDB5477=y
65# CONFIG_TOSHIBA_RBTX4938 is not set 65# CONFIG_TOSHIBA_RBTX4938 is not set
66CONFIG_DDB5477_BUS_FREQUENCY=0 66CONFIG_DDB5477_BUS_FREQUENCY=0
67CONFIG_RWSEM_GENERIC_SPINLOCK=y 67CONFIG_RWSEM_GENERIC_SPINLOCK=y
68CONFIG_GENERIC_FIND_NEXT_BIT=y
69CONFIG_GENERIC_HWEIGHT=y
68CONFIG_GENERIC_CALIBRATE_DELAY=y 70CONFIG_GENERIC_CALIBRATE_DELAY=y
69CONFIG_DMA_NONCOHERENT=y 71CONFIG_DMA_NONCOHERENT=y
70CONFIG_DMA_NEED_PCI_MAP_STATE=y 72CONFIG_DMA_NEED_PCI_MAP_STATE=y
@@ -114,7 +116,6 @@ CONFIG_PAGE_SIZE_4KB=y
114# CONFIG_PAGE_SIZE_16KB is not set 116# CONFIG_PAGE_SIZE_16KB is not set
115# CONFIG_PAGE_SIZE_64KB is not set 117# CONFIG_PAGE_SIZE_64KB is not set
116# CONFIG_MIPS_MT is not set 118# CONFIG_MIPS_MT is not set
117# CONFIG_CPU_ADVANCED is not set
118CONFIG_CPU_HAS_LLSC=y 119CONFIG_CPU_HAS_LLSC=y
119CONFIG_CPU_HAS_SYNC=y 120CONFIG_CPU_HAS_SYNC=y
120CONFIG_GENERIC_HARDIRQS=y 121CONFIG_GENERIC_HARDIRQS=y
@@ -136,7 +137,6 @@ CONFIG_PREEMPT_NONE=y
136# Code maturity level options 137# Code maturity level options
137# 138#
138CONFIG_EXPERIMENTAL=y 139CONFIG_EXPERIMENTAL=y
139CONFIG_CLEAN_COMPILE=y
140CONFIG_BROKEN_ON_SMP=y 140CONFIG_BROKEN_ON_SMP=y
141CONFIG_INIT_ENV_ARG_LIMIT=32 141CONFIG_INIT_ENV_ARG_LIMIT=32
142 142
@@ -152,6 +152,7 @@ CONFIG_SYSVIPC=y
152CONFIG_SYSCTL=y 152CONFIG_SYSCTL=y
153# CONFIG_AUDIT is not set 153# CONFIG_AUDIT is not set
154# CONFIG_IKCONFIG is not set 154# CONFIG_IKCONFIG is not set
155CONFIG_RELAY=y
155CONFIG_INITRAMFS_SOURCE="" 156CONFIG_INITRAMFS_SOURCE=""
156# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 157# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
157CONFIG_EMBEDDED=y 158CONFIG_EMBEDDED=y
@@ -165,10 +166,6 @@ CONFIG_BASE_FULL=y
165CONFIG_FUTEX=y 166CONFIG_FUTEX=y
166CONFIG_EPOLL=y 167CONFIG_EPOLL=y
167CONFIG_SHMEM=y 168CONFIG_SHMEM=y
168CONFIG_CC_ALIGN_FUNCTIONS=0
169CONFIG_CC_ALIGN_LABELS=0
170CONFIG_CC_ALIGN_LOOPS=0
171CONFIG_CC_ALIGN_JUMPS=0
172CONFIG_SLAB=y 169CONFIG_SLAB=y
173# CONFIG_TINY_SHMEM is not set 170# CONFIG_TINY_SHMEM is not set
174CONFIG_BASE_SMALL=0 171CONFIG_BASE_SMALL=0
@@ -183,6 +180,8 @@ CONFIG_BASE_SMALL=0
183# Block layer 180# Block layer
184# 181#
185# CONFIG_LBD is not set 182# CONFIG_LBD is not set
183# CONFIG_BLK_DEV_IO_TRACE is not set
184# CONFIG_LSF is not set
186 185
187# 186#
188# IO Schedulers 187# IO Schedulers
@@ -202,7 +201,6 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
202# 201#
203CONFIG_HW_HAS_PCI=y 202CONFIG_HW_HAS_PCI=y
204CONFIG_PCI=y 203CONFIG_PCI=y
205CONFIG_PCI_LEGACY_PROC=y
206CONFIG_MMU=y 204CONFIG_MMU=y
207 205
208# 206#
@@ -230,6 +228,7 @@ CONFIG_NET=y
230# 228#
231# Networking options 229# Networking options
232# 230#
231# CONFIG_NETDEBUG is not set
233CONFIG_PACKET=y 232CONFIG_PACKET=y
234# CONFIG_PACKET_MMAP is not set 233# CONFIG_PACKET_MMAP is not set
235CONFIG_UNIX=y 234CONFIG_UNIX=y
@@ -251,12 +250,15 @@ CONFIG_IP_PNP_BOOTP=y
251# CONFIG_INET_AH is not set 250# CONFIG_INET_AH is not set
252# CONFIG_INET_ESP is not set 251# CONFIG_INET_ESP is not set
253# CONFIG_INET_IPCOMP is not set 252# CONFIG_INET_IPCOMP is not set
254CONFIG_INET_TUNNEL=y 253# CONFIG_INET_XFRM_TUNNEL is not set
254# CONFIG_INET_TUNNEL is not set
255CONFIG_INET_DIAG=y 255CONFIG_INET_DIAG=y
256CONFIG_INET_TCP_DIAG=y 256CONFIG_INET_TCP_DIAG=y
257# CONFIG_TCP_CONG_ADVANCED is not set 257# CONFIG_TCP_CONG_ADVANCED is not set
258CONFIG_TCP_CONG_BIC=y 258CONFIG_TCP_CONG_BIC=y
259# CONFIG_IPV6 is not set 259# CONFIG_IPV6 is not set
260# CONFIG_INET6_XFRM_TUNNEL is not set
261# CONFIG_INET6_TUNNEL is not set
260# CONFIG_NETFILTER is not set 262# CONFIG_NETFILTER is not set
261 263
262# 264#
@@ -268,6 +270,11 @@ CONFIG_TCP_CONG_BIC=y
268# SCTP Configuration (EXPERIMENTAL) 270# SCTP Configuration (EXPERIMENTAL)
269# 271#
270# CONFIG_IP_SCTP is not set 272# CONFIG_IP_SCTP is not set
273
274#
275# TIPC Configuration (EXPERIMENTAL)
276#
277# CONFIG_TIPC is not set
271# CONFIG_ATM is not set 278# CONFIG_ATM is not set
272# CONFIG_BRIDGE is not set 279# CONFIG_BRIDGE is not set
273# CONFIG_VLAN_8021Q is not set 280# CONFIG_VLAN_8021Q is not set
@@ -277,11 +284,6 @@ CONFIG_TCP_CONG_BIC=y
277# CONFIG_ATALK is not set 284# CONFIG_ATALK is not set
278# CONFIG_X25 is not set 285# CONFIG_X25 is not set
279# CONFIG_LAPB is not set 286# CONFIG_LAPB is not set
280
281#
282# TIPC Configuration (EXPERIMENTAL)
283#
284# CONFIG_TIPC is not set
285# CONFIG_NET_DIVERT is not set 287# CONFIG_NET_DIVERT is not set
286# CONFIG_ECONET is not set 288# CONFIG_ECONET is not set
287# CONFIG_WAN_ROUTER is not set 289# CONFIG_WAN_ROUTER is not set
@@ -302,6 +304,9 @@ CONFIG_IEEE80211=y
302# CONFIG_IEEE80211_DEBUG is not set 304# CONFIG_IEEE80211_DEBUG is not set
303CONFIG_IEEE80211_CRYPT_WEP=y 305CONFIG_IEEE80211_CRYPT_WEP=y
304CONFIG_IEEE80211_CRYPT_CCMP=y 306CONFIG_IEEE80211_CRYPT_CCMP=y
307CONFIG_IEEE80211_SOFTMAC=y
308# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
309CONFIG_WIRELESS_EXT=y
305 310
306# 311#
307# Device Drivers 312# Device Drivers
@@ -346,7 +351,7 @@ CONFIG_PROC_EVENTS=y
346# CONFIG_BLK_DEV_NBD is not set 351# CONFIG_BLK_DEV_NBD is not set
347# CONFIG_BLK_DEV_SX8 is not set 352# CONFIG_BLK_DEV_SX8 is not set
348# CONFIG_BLK_DEV_RAM is not set 353# CONFIG_BLK_DEV_RAM is not set
349CONFIG_BLK_DEV_RAM_COUNT=16 354# CONFIG_BLK_DEV_INITRD is not set
350CONFIG_CDROM_PKTCDVD=y 355CONFIG_CDROM_PKTCDVD=y
351CONFIG_CDROM_PKTCDVD_BUFFERS=8 356CONFIG_CDROM_PKTCDVD_BUFFERS=8
352# CONFIG_CDROM_PKTCDVD_WCACHE is not set 357# CONFIG_CDROM_PKTCDVD_WCACHE is not set
@@ -556,6 +561,7 @@ CONFIG_HW_CONSOLE=y
556# 561#
557CONFIG_SERIAL_8250=y 562CONFIG_SERIAL_8250=y
558CONFIG_SERIAL_8250_CONSOLE=y 563CONFIG_SERIAL_8250_CONSOLE=y
564CONFIG_SERIAL_8250_PCI=y
559CONFIG_SERIAL_8250_NR_UARTS=4 565CONFIG_SERIAL_8250_NR_UARTS=4
560CONFIG_SERIAL_8250_RUNTIME_UARTS=4 566CONFIG_SERIAL_8250_RUNTIME_UARTS=4
561# CONFIG_SERIAL_8250_EXTENDED is not set 567# CONFIG_SERIAL_8250_EXTENDED is not set
@@ -565,6 +571,7 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=4
565# 571#
566CONFIG_SERIAL_CORE=y 572CONFIG_SERIAL_CORE=y
567CONFIG_SERIAL_CORE_CONSOLE=y 573CONFIG_SERIAL_CORE_CONSOLE=y
574# CONFIG_SERIAL_JSM is not set
568CONFIG_UNIX98_PTYS=y 575CONFIG_UNIX98_PTYS=y
569CONFIG_LEGACY_PTYS=y 576CONFIG_LEGACY_PTYS=y
570CONFIG_LEGACY_PTY_COUNT=256 577CONFIG_LEGACY_PTY_COUNT=256
@@ -623,10 +630,6 @@ CONFIG_LEGACY_PTY_COUNT=256
623# 630#
624 631
625# 632#
626# Multimedia Capabilities Port drivers
627#
628
629#
630# Multimedia devices 633# Multimedia devices
631# 634#
632# CONFIG_VIDEO_DEV is not set 635# CONFIG_VIDEO_DEV is not set
@@ -657,6 +660,7 @@ CONFIG_DUMMY_CONSOLE=y
657# 660#
658CONFIG_USB_ARCH_HAS_HCD=y 661CONFIG_USB_ARCH_HAS_HCD=y
659CONFIG_USB_ARCH_HAS_OHCI=y 662CONFIG_USB_ARCH_HAS_OHCI=y
663CONFIG_USB_ARCH_HAS_EHCI=y
660# CONFIG_USB is not set 664# CONFIG_USB is not set
661 665
662# 666#
@@ -674,13 +678,31 @@ CONFIG_USB_ARCH_HAS_OHCI=y
674# CONFIG_MMC is not set 678# CONFIG_MMC is not set
675 679
676# 680#
681# LED devices
682#
683# CONFIG_NEW_LEDS is not set
684
685#
686# LED drivers
687#
688
689#
690# LED Triggers
691#
692
693#
677# InfiniBand support 694# InfiniBand support
678# 695#
679# CONFIG_INFINIBAND is not set 696# CONFIG_INFINIBAND is not set
680 697
681# 698#
682# SN Devices 699# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
700#
701
702#
703# Real Time Clock
683# 704#
705# CONFIG_RTC_CLASS is not set
684 706
685# 707#
686# File systems 708# File systems
@@ -725,7 +747,6 @@ CONFIG_SYSFS=y
725# CONFIG_TMPFS is not set 747# CONFIG_TMPFS is not set
726# CONFIG_HUGETLB_PAGE is not set 748# CONFIG_HUGETLB_PAGE is not set
727CONFIG_RAMFS=y 749CONFIG_RAMFS=y
728CONFIG_RELAYFS_FS=y
729# CONFIG_CONFIGFS_FS is not set 750# CONFIG_CONFIGFS_FS is not set
730 751
731# 752#
@@ -792,6 +813,8 @@ CONFIG_MSDOS_PARTITION=y
792# CONFIG_MAGIC_SYSRQ is not set 813# CONFIG_MAGIC_SYSRQ is not set
793# CONFIG_DEBUG_KERNEL is not set 814# CONFIG_DEBUG_KERNEL is not set
794CONFIG_LOG_BUF_SHIFT=14 815CONFIG_LOG_BUF_SHIFT=14
816# CONFIG_DEBUG_FS is not set
817# CONFIG_UNWIND_INFO is not set
795CONFIG_CROSSCOMPILE=y 818CONFIG_CROSSCOMPILE=y
796CONFIG_CMDLINE="ip=any" 819CONFIG_CMDLINE="ip=any"
797 820
diff --git a/arch/mips/configs/decstation_defconfig b/arch/mips/configs/decstation_defconfig
index 5a181eadd437..d838496e114f 100644
--- a/arch/mips/configs/decstation_defconfig
+++ b/arch/mips/configs/decstation_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc1 3# Linux kernel version: 2.6.17-rc2
4# Fri Jan 27 15:40:03 2006 4# Mon Apr 24 14:51:01 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -63,11 +63,13 @@ CONFIG_MACH_DECSTATION=y
63# CONFIG_TOSHIBA_JMR3927 is not set 63# CONFIG_TOSHIBA_JMR3927 is not set
64# CONFIG_TOSHIBA_RBTX4927 is not set 64# CONFIG_TOSHIBA_RBTX4927 is not set
65# CONFIG_TOSHIBA_RBTX4938 is not set 65# CONFIG_TOSHIBA_RBTX4938 is not set
66CONFIG_EARLY_PRINTK=y
66CONFIG_RWSEM_GENERIC_SPINLOCK=y 67CONFIG_RWSEM_GENERIC_SPINLOCK=y
68CONFIG_GENERIC_FIND_NEXT_BIT=y
69CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 70CONFIG_GENERIC_CALIBRATE_DELAY=y
68CONFIG_DMA_NONCOHERENT=y 71CONFIG_DMA_NONCOHERENT=y
69CONFIG_DMA_NEED_PCI_MAP_STATE=y 72CONFIG_DMA_NEED_PCI_MAP_STATE=y
70CONFIG_EARLY_PRINTK=y
71# CONFIG_CPU_BIG_ENDIAN is not set 73# CONFIG_CPU_BIG_ENDIAN is not set
72CONFIG_CPU_LITTLE_ENDIAN=y 74CONFIG_CPU_LITTLE_ENDIAN=y
73CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y 75CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
@@ -113,7 +115,6 @@ CONFIG_PAGE_SIZE_4KB=y
113# CONFIG_PAGE_SIZE_16KB is not set 115# CONFIG_PAGE_SIZE_16KB is not set
114# CONFIG_PAGE_SIZE_64KB is not set 116# CONFIG_PAGE_SIZE_64KB is not set
115# CONFIG_MIPS_MT is not set 117# CONFIG_MIPS_MT is not set
116# CONFIG_CPU_ADVANCED is not set
117CONFIG_CPU_HAS_WB=y 118CONFIG_CPU_HAS_WB=y
118CONFIG_GENERIC_HARDIRQS=y 119CONFIG_GENERIC_HARDIRQS=y
119CONFIG_GENERIC_IRQ_PROBE=y 120CONFIG_GENERIC_IRQ_PROBE=y
@@ -135,7 +136,6 @@ CONFIG_PREEMPT_NONE=y
135# Code maturity level options 136# Code maturity level options
136# 137#
137CONFIG_EXPERIMENTAL=y 138CONFIG_EXPERIMENTAL=y
138CONFIG_CLEAN_COMPILE=y
139CONFIG_BROKEN_ON_SMP=y 139CONFIG_BROKEN_ON_SMP=y
140CONFIG_INIT_ENV_ARG_LIMIT=32 140CONFIG_INIT_ENV_ARG_LIMIT=32
141 141
@@ -151,6 +151,7 @@ CONFIG_SYSVIPC=y
151CONFIG_SYSCTL=y 151CONFIG_SYSCTL=y
152# CONFIG_AUDIT is not set 152# CONFIG_AUDIT is not set
153# CONFIG_IKCONFIG is not set 153# CONFIG_IKCONFIG is not set
154CONFIG_RELAY=y
154CONFIG_INITRAMFS_SOURCE="" 155CONFIG_INITRAMFS_SOURCE=""
155# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 156# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
156CONFIG_EMBEDDED=y 157CONFIG_EMBEDDED=y
@@ -165,10 +166,6 @@ CONFIG_BASE_FULL=y
165CONFIG_FUTEX=y 166CONFIG_FUTEX=y
166CONFIG_EPOLL=y 167CONFIG_EPOLL=y
167CONFIG_SHMEM=y 168CONFIG_SHMEM=y
168CONFIG_CC_ALIGN_FUNCTIONS=0
169CONFIG_CC_ALIGN_LABELS=0
170CONFIG_CC_ALIGN_LOOPS=0
171CONFIG_CC_ALIGN_JUMPS=0
172CONFIG_SLAB=y 169CONFIG_SLAB=y
173# CONFIG_TINY_SHMEM is not set 170# CONFIG_TINY_SHMEM is not set
174CONFIG_BASE_SMALL=0 171CONFIG_BASE_SMALL=0
@@ -180,7 +177,6 @@ CONFIG_BASE_SMALL=0
180CONFIG_MODULES=y 177CONFIG_MODULES=y
181CONFIG_MODULE_UNLOAD=y 178CONFIG_MODULE_UNLOAD=y
182# CONFIG_MODULE_FORCE_UNLOAD is not set 179# CONFIG_MODULE_FORCE_UNLOAD is not set
183CONFIG_OBSOLETE_MODPARM=y
184# CONFIG_MODVERSIONS is not set 180# CONFIG_MODVERSIONS is not set
185CONFIG_MODULE_SRCVERSION_ALL=y 181CONFIG_MODULE_SRCVERSION_ALL=y
186CONFIG_KMOD=y 182CONFIG_KMOD=y
@@ -189,6 +185,8 @@ CONFIG_KMOD=y
189# Block layer 185# Block layer
190# 186#
191# CONFIG_LBD is not set 187# CONFIG_LBD is not set
188# CONFIG_BLK_DEV_IO_TRACE is not set
189# CONFIG_LSF is not set
192 190
193# 191#
194# IO Schedulers 192# IO Schedulers
@@ -233,11 +231,10 @@ CONFIG_NET=y
233# 231#
234# Networking options 232# Networking options
235# 233#
234# CONFIG_NETDEBUG is not set
236CONFIG_PACKET=y 235CONFIG_PACKET=y
237CONFIG_PACKET_MMAP=y 236CONFIG_PACKET_MMAP=y
238CONFIG_UNIX=y 237CONFIG_UNIX=y
239CONFIG_XFRM=y
240CONFIG_XFRM_USER=m
241# CONFIG_NET_KEY is not set 238# CONFIG_NET_KEY is not set
242CONFIG_INET=y 239CONFIG_INET=y
243# CONFIG_IP_MULTICAST is not set 240# CONFIG_IP_MULTICAST is not set
@@ -254,12 +251,15 @@ CONFIG_IP_PNP_BOOTP=y
254# CONFIG_INET_AH is not set 251# CONFIG_INET_AH is not set
255# CONFIG_INET_ESP is not set 252# CONFIG_INET_ESP is not set
256# CONFIG_INET_IPCOMP is not set 253# CONFIG_INET_IPCOMP is not set
257CONFIG_INET_TUNNEL=m 254# CONFIG_INET_XFRM_TUNNEL is not set
255# CONFIG_INET_TUNNEL is not set
258CONFIG_INET_DIAG=y 256CONFIG_INET_DIAG=y
259CONFIG_INET_TCP_DIAG=y 257CONFIG_INET_TCP_DIAG=y
260# CONFIG_TCP_CONG_ADVANCED is not set 258# CONFIG_TCP_CONG_ADVANCED is not set
261CONFIG_TCP_CONG_BIC=y 259CONFIG_TCP_CONG_BIC=y
262# CONFIG_IPV6 is not set 260# CONFIG_IPV6 is not set
261# CONFIG_INET6_XFRM_TUNNEL is not set
262# CONFIG_INET6_TUNNEL is not set
263# CONFIG_NETFILTER is not set 263# CONFIG_NETFILTER is not set
264 264
265# 265#
@@ -271,6 +271,11 @@ CONFIG_TCP_CONG_BIC=y
271# SCTP Configuration (EXPERIMENTAL) 271# SCTP Configuration (EXPERIMENTAL)
272# 272#
273# CONFIG_IP_SCTP is not set 273# CONFIG_IP_SCTP is not set
274
275#
276# TIPC Configuration (EXPERIMENTAL)
277#
278# CONFIG_TIPC is not set
274# CONFIG_ATM is not set 279# CONFIG_ATM is not set
275# CONFIG_BRIDGE is not set 280# CONFIG_BRIDGE is not set
276# CONFIG_VLAN_8021Q is not set 281# CONFIG_VLAN_8021Q is not set
@@ -280,11 +285,6 @@ CONFIG_TCP_CONG_BIC=y
280# CONFIG_ATALK is not set 285# CONFIG_ATALK is not set
281# CONFIG_X25 is not set 286# CONFIG_X25 is not set
282# CONFIG_LAPB is not set 287# CONFIG_LAPB is not set
283
284#
285# TIPC Configuration (EXPERIMENTAL)
286#
287# CONFIG_TIPC is not set
288# CONFIG_NET_DIVERT is not set 288# CONFIG_NET_DIVERT is not set
289# CONFIG_ECONET is not set 289# CONFIG_ECONET is not set
290# CONFIG_WAN_ROUTER is not set 290# CONFIG_WAN_ROUTER is not set
@@ -305,6 +305,9 @@ CONFIG_IEEE80211=m
305# CONFIG_IEEE80211_DEBUG is not set 305# CONFIG_IEEE80211_DEBUG is not set
306CONFIG_IEEE80211_CRYPT_WEP=m 306CONFIG_IEEE80211_CRYPT_WEP=m
307CONFIG_IEEE80211_CRYPT_CCMP=m 307CONFIG_IEEE80211_CRYPT_CCMP=m
308CONFIG_IEEE80211_SOFTMAC=m
309# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
310CONFIG_WIRELESS_EXT=y
308 311
309# 312#
310# Device Drivers 313# Device Drivers
@@ -345,7 +348,7 @@ CONFIG_BLK_DEV_LOOP=m
345# CONFIG_BLK_DEV_CRYPTOLOOP is not set 348# CONFIG_BLK_DEV_CRYPTOLOOP is not set
346# CONFIG_BLK_DEV_NBD is not set 349# CONFIG_BLK_DEV_NBD is not set
347# CONFIG_BLK_DEV_RAM is not set 350# CONFIG_BLK_DEV_RAM is not set
348CONFIG_BLK_DEV_RAM_COUNT=16 351# CONFIG_BLK_DEV_INITRD is not set
349# CONFIG_CDROM_PKTCDVD is not set 352# CONFIG_CDROM_PKTCDVD is not set
350# CONFIG_ATA_OVER_ETH is not set 353# CONFIG_ATA_OVER_ETH is not set
351 354
@@ -567,10 +570,6 @@ CONFIG_RTC=y
567# 570#
568 571
569# 572#
570# Multimedia Capabilities Port drivers
571#
572
573#
574# Multimedia devices 573# Multimedia devices
575# 574#
576# CONFIG_VIDEO_DEV is not set 575# CONFIG_VIDEO_DEV is not set
@@ -588,6 +587,7 @@ CONFIG_FB_CFB_FILLRECT=y
588CONFIG_FB_CFB_COPYAREA=y 587CONFIG_FB_CFB_COPYAREA=y
589CONFIG_FB_CFB_IMAGEBLIT=y 588CONFIG_FB_CFB_IMAGEBLIT=y
590# CONFIG_FB_MACMODES is not set 589# CONFIG_FB_MACMODES is not set
590CONFIG_FB_FIRMWARE_EDID=y
591# CONFIG_FB_MODE_HELPERS is not set 591# CONFIG_FB_MODE_HELPERS is not set
592# CONFIG_FB_TILEBLITTING is not set 592# CONFIG_FB_TILEBLITTING is not set
593# CONFIG_FB_S1D13XXX is not set 593# CONFIG_FB_S1D13XXX is not set
@@ -617,6 +617,7 @@ CONFIG_LOGO_DEC_CLUT224=y
617# 617#
618# CONFIG_USB_ARCH_HAS_HCD is not set 618# CONFIG_USB_ARCH_HAS_HCD is not set
619# CONFIG_USB_ARCH_HAS_OHCI is not set 619# CONFIG_USB_ARCH_HAS_OHCI is not set
620# CONFIG_USB_ARCH_HAS_EHCI is not set
620 621
621# 622#
622# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 623# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
@@ -633,12 +634,30 @@ CONFIG_LOGO_DEC_CLUT224=y
633# CONFIG_MMC is not set 634# CONFIG_MMC is not set
634 635
635# 636#
637# LED devices
638#
639# CONFIG_NEW_LEDS is not set
640
641#
642# LED drivers
643#
644
645#
646# LED Triggers
647#
648
649#
636# InfiniBand support 650# InfiniBand support
637# 651#
638 652
639# 653#
640# SN Devices 654# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
655#
656
657#
658# Real Time Clock
641# 659#
660# CONFIG_RTC_CLASS is not set
642 661
643# 662#
644# File systems 663# File systems
@@ -686,7 +705,6 @@ CONFIG_SYSFS=y
686CONFIG_TMPFS=y 705CONFIG_TMPFS=y
687# CONFIG_HUGETLB_PAGE is not set 706# CONFIG_HUGETLB_PAGE is not set
688CONFIG_RAMFS=y 707CONFIG_RAMFS=y
689CONFIG_RELAYFS_FS=m
690# CONFIG_CONFIGFS_FS is not set 708# CONFIG_CONFIGFS_FS is not set
691 709
692# 710#
@@ -705,7 +723,6 @@ CONFIG_RELAYFS_FS=m
705# CONFIG_QNX4FS_FS is not set 723# CONFIG_QNX4FS_FS is not set
706# CONFIG_SYSV_FS is not set 724# CONFIG_SYSV_FS is not set
707CONFIG_UFS_FS=y 725CONFIG_UFS_FS=y
708CONFIG_UFS_FS_WRITE=y
709 726
710# 727#
711# Network File Systems 728# Network File Systems
diff --git a/arch/mips/configs/e55_defconfig b/arch/mips/configs/e55_defconfig
index 8fbfc06a6a2a..0760f4318910 100644
--- a/arch/mips/configs/e55_defconfig
+++ b/arch/mips/configs/e55_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc1 3# Linux kernel version: 2.6.17-rc2
4# Fri Jan 27 15:40:04 2006 4# Tue Apr 25 00:08:20 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -70,6 +70,8 @@ CONFIG_CASIO_E55=y
70# CONFIG_VICTOR_MPC30X is not set 70# CONFIG_VICTOR_MPC30X is not set
71# CONFIG_ZAO_CAPCELLA is not set 71# CONFIG_ZAO_CAPCELLA is not set
72CONFIG_RWSEM_GENERIC_SPINLOCK=y 72CONFIG_RWSEM_GENERIC_SPINLOCK=y
73CONFIG_GENERIC_FIND_NEXT_BIT=y
74CONFIG_GENERIC_HWEIGHT=y
73CONFIG_GENERIC_CALIBRATE_DELAY=y 75CONFIG_GENERIC_CALIBRATE_DELAY=y
74CONFIG_DMA_NONCOHERENT=y 76CONFIG_DMA_NONCOHERENT=y
75CONFIG_DMA_NEED_PCI_MAP_STATE=y 77CONFIG_DMA_NEED_PCI_MAP_STATE=y
@@ -88,7 +90,7 @@ CONFIG_MIPS_L1_CACHE_SHIFT=5
88# CONFIG_CPU_MIPS64_R2 is not set 90# CONFIG_CPU_MIPS64_R2 is not set
89# CONFIG_CPU_R3000 is not set 91# CONFIG_CPU_R3000 is not set
90# CONFIG_CPU_TX39XX is not set 92# CONFIG_CPU_TX39XX is not set
91# CONFIG_CPU_VR41XX is not set 93CONFIG_CPU_VR41XX=y
92# CONFIG_CPU_R4300 is not set 94# CONFIG_CPU_R4300 is not set
93# CONFIG_CPU_R4X00 is not set 95# CONFIG_CPU_R4X00 is not set
94# CONFIG_CPU_TX49XX is not set 96# CONFIG_CPU_TX49XX is not set
@@ -101,18 +103,21 @@ CONFIG_MIPS_L1_CACHE_SHIFT=5
101# CONFIG_CPU_RM7000 is not set 103# CONFIG_CPU_RM7000 is not set
102# CONFIG_CPU_RM9000 is not set 104# CONFIG_CPU_RM9000 is not set
103# CONFIG_CPU_SB1 is not set 105# CONFIG_CPU_SB1 is not set
106CONFIG_SYS_HAS_CPU_VR41XX=y
107CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
108CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
109CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
104 110
105# 111#
106# Kernel type 112# Kernel type
107# 113#
108# CONFIG_32BIT is not set 114CONFIG_32BIT=y
109# CONFIG_64BIT is not set 115# CONFIG_64BIT is not set
110CONFIG_PAGE_SIZE_4KB=y 116CONFIG_PAGE_SIZE_4KB=y
111# CONFIG_PAGE_SIZE_8KB is not set 117# CONFIG_PAGE_SIZE_8KB is not set
112# CONFIG_PAGE_SIZE_16KB is not set 118# CONFIG_PAGE_SIZE_16KB is not set
113# CONFIG_PAGE_SIZE_64KB is not set 119# CONFIG_PAGE_SIZE_64KB is not set
114# CONFIG_MIPS_MT is not set 120# CONFIG_MIPS_MT is not set
115CONFIG_CPU_HAS_LLSC=y
116CONFIG_CPU_HAS_SYNC=y 121CONFIG_CPU_HAS_SYNC=y
117CONFIG_GENERIC_HARDIRQS=y 122CONFIG_GENERIC_HARDIRQS=y
118CONFIG_GENERIC_IRQ_PROBE=y 123CONFIG_GENERIC_IRQ_PROBE=y
@@ -133,7 +138,6 @@ CONFIG_PREEMPT_NONE=y
133# Code maturity level options 138# Code maturity level options
134# 139#
135CONFIG_EXPERIMENTAL=y 140CONFIG_EXPERIMENTAL=y
136CONFIG_CLEAN_COMPILE=y
137CONFIG_BROKEN_ON_SMP=y 141CONFIG_BROKEN_ON_SMP=y
138CONFIG_INIT_ENV_ARG_LIMIT=32 142CONFIG_INIT_ENV_ARG_LIMIT=32
139 143
@@ -144,11 +148,10 @@ CONFIG_LOCALVERSION=""
144CONFIG_LOCALVERSION_AUTO=y 148CONFIG_LOCALVERSION_AUTO=y
145CONFIG_SWAP=y 149CONFIG_SWAP=y
146CONFIG_SYSVIPC=y 150CONFIG_SYSVIPC=y
147# CONFIG_POSIX_MQUEUE is not set
148# CONFIG_BSD_PROCESS_ACCT is not set 151# CONFIG_BSD_PROCESS_ACCT is not set
149CONFIG_SYSCTL=y 152CONFIG_SYSCTL=y
150# CONFIG_AUDIT is not set
151# CONFIG_IKCONFIG is not set 153# CONFIG_IKCONFIG is not set
154# CONFIG_RELAY is not set
152CONFIG_INITRAMFS_SOURCE="" 155CONFIG_INITRAMFS_SOURCE=""
153# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 156# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
154CONFIG_EMBEDDED=y 157CONFIG_EMBEDDED=y
@@ -162,10 +165,6 @@ CONFIG_BASE_FULL=y
162CONFIG_FUTEX=y 165CONFIG_FUTEX=y
163CONFIG_EPOLL=y 166CONFIG_EPOLL=y
164CONFIG_SHMEM=y 167CONFIG_SHMEM=y
165CONFIG_CC_ALIGN_FUNCTIONS=0
166CONFIG_CC_ALIGN_LABELS=0
167CONFIG_CC_ALIGN_LOOPS=0
168CONFIG_CC_ALIGN_JUMPS=0
169CONFIG_SLAB=y 168CONFIG_SLAB=y
170# CONFIG_TINY_SHMEM is not set 169# CONFIG_TINY_SHMEM is not set
171CONFIG_BASE_SMALL=0 170CONFIG_BASE_SMALL=0
@@ -177,7 +176,6 @@ CONFIG_BASE_SMALL=0
177CONFIG_MODULES=y 176CONFIG_MODULES=y
178CONFIG_MODULE_UNLOAD=y 177CONFIG_MODULE_UNLOAD=y
179# CONFIG_MODULE_FORCE_UNLOAD is not set 178# CONFIG_MODULE_FORCE_UNLOAD is not set
180CONFIG_OBSOLETE_MODPARM=y
181CONFIG_MODVERSIONS=y 179CONFIG_MODVERSIONS=y
182CONFIG_MODULE_SRCVERSION_ALL=y 180CONFIG_MODULE_SRCVERSION_ALL=y
183CONFIG_KMOD=y 181CONFIG_KMOD=y
@@ -185,6 +183,9 @@ CONFIG_KMOD=y
185# 183#
186# Block layer 184# Block layer
187# 185#
186# CONFIG_LBD is not set
187# CONFIG_BLK_DEV_IO_TRACE is not set
188# CONFIG_LSF is not set
188 189
189# 190#
190# IO Schedulers 191# IO Schedulers
@@ -219,85 +220,12 @@ CONFIG_MMU=y
219# 220#
220CONFIG_BINFMT_ELF=y 221CONFIG_BINFMT_ELF=y
221# CONFIG_BINFMT_MISC is not set 222# CONFIG_BINFMT_MISC is not set
223CONFIG_TRAD_SIGNALS=y
222 224
223# 225#
224# Networking 226# Networking
225# 227#
226CONFIG_NET=y 228# CONFIG_NET is not set
227
228#
229# Networking options
230#
231CONFIG_PACKET=y
232CONFIG_PACKET_MMAP=y
233CONFIG_UNIX=y
234CONFIG_XFRM=y
235CONFIG_XFRM_USER=m
236CONFIG_NET_KEY=y
237CONFIG_INET=y
238CONFIG_IP_MULTICAST=y
239# CONFIG_IP_ADVANCED_ROUTER is not set
240CONFIG_IP_FIB_HASH=y
241# CONFIG_IP_PNP is not set
242# CONFIG_NET_IPIP is not set
243# CONFIG_NET_IPGRE is not set
244# CONFIG_IP_MROUTE is not set
245# CONFIG_ARPD is not set
246# CONFIG_SYN_COOKIES is not set
247# CONFIG_INET_AH is not set
248# CONFIG_INET_ESP is not set
249# CONFIG_INET_IPCOMP is not set
250CONFIG_INET_TUNNEL=m
251CONFIG_INET_DIAG=y
252CONFIG_INET_TCP_DIAG=y
253# CONFIG_TCP_CONG_ADVANCED is not set
254CONFIG_TCP_CONG_BIC=y
255# CONFIG_IPV6 is not set
256# CONFIG_NETFILTER is not set
257
258#
259# DCCP Configuration (EXPERIMENTAL)
260#
261# CONFIG_IP_DCCP is not set
262
263#
264# SCTP Configuration (EXPERIMENTAL)
265#
266# CONFIG_IP_SCTP is not set
267# CONFIG_ATM is not set
268# CONFIG_BRIDGE is not set
269# CONFIG_VLAN_8021Q is not set
270# CONFIG_DECNET is not set
271# CONFIG_LLC2 is not set
272# CONFIG_IPX is not set
273# CONFIG_ATALK is not set
274# CONFIG_X25 is not set
275# CONFIG_LAPB is not set
276
277#
278# TIPC Configuration (EXPERIMENTAL)
279#
280# CONFIG_TIPC is not set
281# CONFIG_NET_DIVERT is not set
282# CONFIG_ECONET is not set
283# CONFIG_WAN_ROUTER is not set
284
285#
286# QoS and/or fair queueing
287#
288# CONFIG_NET_SCHED is not set
289
290#
291# Network testing
292#
293# CONFIG_NET_PKTGEN is not set
294# CONFIG_HAMRADIO is not set
295# CONFIG_IRDA is not set
296# CONFIG_BT is not set
297CONFIG_IEEE80211=m
298# CONFIG_IEEE80211_DEBUG is not set
299CONFIG_IEEE80211_CRYPT_WEP=m
300CONFIG_IEEE80211_CRYPT_CCMP=m
301 229
302# 230#
303# Device Drivers 231# Device Drivers
@@ -313,7 +241,6 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
313# 241#
314# Connector - unified userspace <-> kernelspace linker 242# Connector - unified userspace <-> kernelspace linker
315# 243#
316CONFIG_CONNECTOR=m
317 244
318# 245#
319# Memory Technology Devices (MTD) 246# Memory Technology Devices (MTD)
@@ -335,11 +262,11 @@ CONFIG_CONNECTOR=m
335# 262#
336# CONFIG_BLK_DEV_COW_COMMON is not set 263# CONFIG_BLK_DEV_COW_COMMON is not set
337# CONFIG_BLK_DEV_LOOP is not set 264# CONFIG_BLK_DEV_LOOP is not set
338# CONFIG_BLK_DEV_NBD is not set 265CONFIG_BLK_DEV_RAM=m
339# CONFIG_BLK_DEV_RAM is not set
340CONFIG_BLK_DEV_RAM_COUNT=16 266CONFIG_BLK_DEV_RAM_COUNT=16
267CONFIG_BLK_DEV_RAM_SIZE=4096
268# CONFIG_BLK_DEV_INITRD is not set
341# CONFIG_CDROM_PKTCDVD is not set 269# CONFIG_CDROM_PKTCDVD is not set
342# CONFIG_ATA_OVER_ETH is not set
343 270
344# 271#
345# ATA/ATAPI/MFM/RLL support 272# ATA/ATAPI/MFM/RLL support
@@ -398,81 +325,8 @@ CONFIG_IDE_GENERIC=y
398# 325#
399 326
400# 327#
401# Network device support
402#
403CONFIG_NETDEVICES=y
404# CONFIG_DUMMY is not set
405# CONFIG_BONDING is not set
406# CONFIG_EQUALIZER is not set
407# CONFIG_TUN is not set
408
409#
410# ARCnet devices
411#
412# CONFIG_ARCNET is not set
413
414#
415# PHY device support
416#
417CONFIG_PHYLIB=m
418
419#
420# MII PHY device drivers
421#
422CONFIG_MARVELL_PHY=m
423CONFIG_DAVICOM_PHY=m
424CONFIG_QSEMI_PHY=m
425CONFIG_LXT_PHY=m
426CONFIG_CICADA_PHY=m
427
428#
429# Ethernet (10 or 100Mbit)
430#
431CONFIG_NET_ETHERNET=y
432# CONFIG_MII is not set
433# CONFIG_NET_VENDOR_3COM is not set
434# CONFIG_NET_VENDOR_SMC is not set
435# CONFIG_DM9000 is not set
436# CONFIG_NET_VENDOR_RACAL is not set
437# CONFIG_AT1700 is not set
438# CONFIG_DEPCA is not set
439# CONFIG_HP100 is not set
440# CONFIG_NET_ISA is not set
441# CONFIG_NET_PCI is not set
442
443#
444# Ethernet (1000 Mbit)
445#
446
447#
448# Ethernet (10000 Mbit)
449#
450
451#
452# Token Ring devices
453#
454# CONFIG_TR is not set
455
456#
457# Wireless LAN (non-hamradio)
458#
459# CONFIG_NET_RADIO is not set
460
461#
462# Wan interfaces
463#
464# CONFIG_WAN is not set
465# CONFIG_PPP is not set
466# CONFIG_SLIP is not set
467# CONFIG_SHAPER is not set
468# CONFIG_NETCONSOLE is not set
469# CONFIG_NETPOLL is not set
470# CONFIG_NET_POLL_CONTROLLER is not set
471
472#
473# ISDN subsystem 328# ISDN subsystem
474# 329#
475# CONFIG_ISDN is not set
476 330
477# 331#
478# Telephony Support 332# Telephony Support
@@ -508,11 +362,7 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=240
508# 362#
509# Hardware I/O ports 363# Hardware I/O ports
510# 364#
511CONFIG_SERIO=y 365# CONFIG_SERIO is not set
512# CONFIG_SERIO_I8042 is not set
513CONFIG_SERIO_SERPORT=y
514# CONFIG_SERIO_LIBPS2 is not set
515CONFIG_SERIO_RAW=m
516# CONFIG_GAMEPORT is not set 366# CONFIG_GAMEPORT is not set
517 367
518# 368#
@@ -531,6 +381,10 @@ CONFIG_HW_CONSOLE=y
531# 381#
532# Non-8250 serial port support 382# Non-8250 serial port support
533# 383#
384CONFIG_SERIAL_CORE=y
385CONFIG_SERIAL_CORE_CONSOLE=y
386CONFIG_SERIAL_VR41XX=y
387CONFIG_SERIAL_VR41XX_CONSOLE=y
534CONFIG_UNIX98_PTYS=y 388CONFIG_UNIX98_PTYS=y
535CONFIG_LEGACY_PTYS=y 389CONFIG_LEGACY_PTYS=y
536CONFIG_LEGACY_PTY_COUNT=256 390CONFIG_LEGACY_PTY_COUNT=256
@@ -565,6 +419,7 @@ CONFIG_WATCHDOG=y
565# 419#
566# Ftape, the floppy tape device driver 420# Ftape, the floppy tape device driver
567# 421#
422CONFIG_GPIO_VR41XX=y
568# CONFIG_RAW_DRIVER is not set 423# CONFIG_RAW_DRIVER is not set
569 424
570# 425#
@@ -600,10 +455,6 @@ CONFIG_WATCHDOG=y
600# 455#
601 456
602# 457#
603# Multimedia Capabilities Port drivers
604#
605
606#
607# Multimedia devices 458# Multimedia devices
608# 459#
609# CONFIG_VIDEO_DEV is not set 460# CONFIG_VIDEO_DEV is not set
@@ -611,7 +462,6 @@ CONFIG_WATCHDOG=y
611# 462#
612# Digital Video Broadcasting Devices 463# Digital Video Broadcasting Devices
613# 464#
614# CONFIG_DVB is not set
615 465
616# 466#
617# Graphics support 467# Graphics support
@@ -635,6 +485,7 @@ CONFIG_DUMMY_CONSOLE=y
635# 485#
636# CONFIG_USB_ARCH_HAS_HCD is not set 486# CONFIG_USB_ARCH_HAS_HCD is not set
637# CONFIG_USB_ARCH_HAS_OHCI is not set 487# CONFIG_USB_ARCH_HAS_OHCI is not set
488# CONFIG_USB_ARCH_HAS_EHCI is not set
638 489
639# 490#
640# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 491# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
@@ -651,12 +502,30 @@ CONFIG_DUMMY_CONSOLE=y
651# CONFIG_MMC is not set 502# CONFIG_MMC is not set
652 503
653# 504#
505# LED devices
506#
507# CONFIG_NEW_LEDS is not set
508
509#
510# LED drivers
511#
512
513#
514# LED Triggers
515#
516
517#
654# InfiniBand support 518# InfiniBand support
655# 519#
656 520
657# 521#
658# SN Devices 522# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
523#
524
525#
526# Real Time Clock
659# 527#
528# CONFIG_RTC_CLASS is not set
660 529
661# 530#
662# File systems 531# File systems
@@ -669,13 +538,12 @@ CONFIG_EXT2_FS=y
669# CONFIG_JFS_FS is not set 538# CONFIG_JFS_FS is not set
670# CONFIG_FS_POSIX_ACL is not set 539# CONFIG_FS_POSIX_ACL is not set
671# CONFIG_XFS_FS is not set 540# CONFIG_XFS_FS is not set
672# CONFIG_OCFS2_FS is not set
673# CONFIG_MINIX_FS is not set 541# CONFIG_MINIX_FS is not set
674# CONFIG_ROMFS_FS is not set 542# CONFIG_ROMFS_FS is not set
675CONFIG_INOTIFY=y 543CONFIG_INOTIFY=y
676# CONFIG_QUOTA is not set 544# CONFIG_QUOTA is not set
677CONFIG_DNOTIFY=y 545CONFIG_DNOTIFY=y
678CONFIG_AUTOFS_FS=y 546# CONFIG_AUTOFS_FS is not set
679CONFIG_AUTOFS4_FS=y 547CONFIG_AUTOFS4_FS=y
680CONFIG_FUSE_FS=m 548CONFIG_FUSE_FS=m
681 549
@@ -698,10 +566,9 @@ CONFIG_FUSE_FS=m
698CONFIG_PROC_FS=y 566CONFIG_PROC_FS=y
699CONFIG_PROC_KCORE=y 567CONFIG_PROC_KCORE=y
700CONFIG_SYSFS=y 568CONFIG_SYSFS=y
701# CONFIG_TMPFS is not set 569CONFIG_TMPFS=y
702# CONFIG_HUGETLB_PAGE is not set 570# CONFIG_HUGETLB_PAGE is not set
703CONFIG_RAMFS=y 571CONFIG_RAMFS=y
704CONFIG_RELAYFS_FS=m
705# CONFIG_CONFIGFS_FS is not set 572# CONFIG_CONFIGFS_FS is not set
706 573
707# 574#
@@ -722,29 +589,6 @@ CONFIG_RELAYFS_FS=m
722# CONFIG_UFS_FS is not set 589# CONFIG_UFS_FS is not set
723 590
724# 591#
725# Network File Systems
726#
727CONFIG_NFS_FS=m
728# CONFIG_NFS_V3 is not set
729# CONFIG_NFS_V4 is not set
730# CONFIG_NFS_DIRECTIO is not set
731CONFIG_NFSD=m
732# CONFIG_NFSD_V3 is not set
733# CONFIG_NFSD_TCP is not set
734CONFIG_LOCKD=m
735CONFIG_EXPORTFS=m
736CONFIG_NFS_COMMON=y
737CONFIG_SUNRPC=m
738# CONFIG_RPCSEC_GSS_KRB5 is not set
739# CONFIG_RPCSEC_GSS_SPKM3 is not set
740# CONFIG_SMB_FS is not set
741# CONFIG_CIFS is not set
742# CONFIG_NCP_FS is not set
743# CONFIG_CODA_FS is not set
744# CONFIG_AFS_FS is not set
745# CONFIG_9P_FS is not set
746
747#
748# Partition Types 592# Partition Types
749# 593#
750# CONFIG_PARTITION_ADVANCED is not set 594# CONFIG_PARTITION_ADVANCED is not set
@@ -767,44 +611,20 @@ CONFIG_MSDOS_PARTITION=y
767# CONFIG_MAGIC_SYSRQ is not set 611# CONFIG_MAGIC_SYSRQ is not set
768# CONFIG_DEBUG_KERNEL is not set 612# CONFIG_DEBUG_KERNEL is not set
769CONFIG_LOG_BUF_SHIFT=14 613CONFIG_LOG_BUF_SHIFT=14
614# CONFIG_DEBUG_FS is not set
770CONFIG_CROSSCOMPILE=y 615CONFIG_CROSSCOMPILE=y
771CONFIG_CMDLINE="console=ttyVR0,19200 mem=8M" 616CONFIG_CMDLINE="console=ttyVR0,19200 mem=8M"
772 617
773# 618#
774# Security options 619# Security options
775# 620#
776CONFIG_KEYS=y 621# CONFIG_KEYS is not set
777CONFIG_KEYS_DEBUG_PROC_KEYS=y
778# CONFIG_SECURITY is not set 622# CONFIG_SECURITY is not set
779 623
780# 624#
781# Cryptographic options 625# Cryptographic options
782# 626#
783CONFIG_CRYPTO=y 627# CONFIG_CRYPTO is not set
784CONFIG_CRYPTO_HMAC=y
785CONFIG_CRYPTO_NULL=m
786CONFIG_CRYPTO_MD4=m
787CONFIG_CRYPTO_MD5=m
788CONFIG_CRYPTO_SHA1=m
789CONFIG_CRYPTO_SHA256=m
790CONFIG_CRYPTO_SHA512=m
791CONFIG_CRYPTO_WP512=m
792CONFIG_CRYPTO_TGR192=m
793CONFIG_CRYPTO_DES=m
794CONFIG_CRYPTO_BLOWFISH=m
795CONFIG_CRYPTO_TWOFISH=m
796CONFIG_CRYPTO_SERPENT=m
797CONFIG_CRYPTO_AES=m
798CONFIG_CRYPTO_CAST5=m
799CONFIG_CRYPTO_CAST6=m
800CONFIG_CRYPTO_TEA=m
801CONFIG_CRYPTO_ARC4=m
802CONFIG_CRYPTO_KHAZAD=m
803CONFIG_CRYPTO_ANUBIS=m
804CONFIG_CRYPTO_DEFLATE=m
805CONFIG_CRYPTO_MICHAEL_MIC=m
806CONFIG_CRYPTO_CRC32C=m
807# CONFIG_CRYPTO_TEST is not set
808 628
809# 629#
810# Hardware crypto devices 630# Hardware crypto devices
@@ -814,8 +634,6 @@ CONFIG_CRYPTO_CRC32C=m
814# Library routines 634# Library routines
815# 635#
816# CONFIG_CRC_CCITT is not set 636# CONFIG_CRC_CCITT is not set
817CONFIG_CRC16=m 637# CONFIG_CRC16 is not set
818CONFIG_CRC32=m 638# CONFIG_CRC32 is not set
819CONFIG_LIBCRC32C=m 639# CONFIG_LIBCRC32C is not set
820CONFIG_ZLIB_INFLATE=m
821CONFIG_ZLIB_DEFLATE=m
diff --git a/arch/mips/configs/ev64120_defconfig b/arch/mips/configs/ev64120_defconfig
index f2d43be69007..7067f608b22c 100644
--- a/arch/mips/configs/ev64120_defconfig
+++ b/arch/mips/configs/ev64120_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc1 3# Linux kernel version: 2.6.17-rc2
4# Fri Jan 27 15:40:05 2006 4# Mon Apr 24 14:51:02 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -65,6 +65,8 @@ CONFIG_MIPS_EV64120=y
65# CONFIG_TOSHIBA_RBTX4938 is not set 65# CONFIG_TOSHIBA_RBTX4938 is not set
66# CONFIG_EVB_PCI1 is not set 66# CONFIG_EVB_PCI1 is not set
67CONFIG_RWSEM_GENERIC_SPINLOCK=y 67CONFIG_RWSEM_GENERIC_SPINLOCK=y
68CONFIG_GENERIC_FIND_NEXT_BIT=y
69CONFIG_GENERIC_HWEIGHT=y
68CONFIG_GENERIC_CALIBRATE_DELAY=y 70CONFIG_GENERIC_CALIBRATE_DELAY=y
69CONFIG_DMA_NONCOHERENT=y 71CONFIG_DMA_NONCOHERENT=y
70CONFIG_DMA_NEED_PCI_MAP_STATE=y 72CONFIG_DMA_NEED_PCI_MAP_STATE=y
@@ -116,7 +118,6 @@ CONFIG_PAGE_SIZE_4KB=y
116# CONFIG_PAGE_SIZE_64KB is not set 118# CONFIG_PAGE_SIZE_64KB is not set
117# CONFIG_MIPS_MT is not set 119# CONFIG_MIPS_MT is not set
118# CONFIG_64BIT_PHYS_ADDR is not set 120# CONFIG_64BIT_PHYS_ADDR is not set
119# CONFIG_CPU_ADVANCED is not set
120CONFIG_CPU_HAS_LLSC=y 121CONFIG_CPU_HAS_LLSC=y
121CONFIG_CPU_HAS_SYNC=y 122CONFIG_CPU_HAS_SYNC=y
122CONFIG_GENERIC_HARDIRQS=y 123CONFIG_GENERIC_HARDIRQS=y
@@ -138,7 +139,6 @@ CONFIG_PREEMPT_NONE=y
138# Code maturity level options 139# Code maturity level options
139# 140#
140CONFIG_EXPERIMENTAL=y 141CONFIG_EXPERIMENTAL=y
141CONFIG_CLEAN_COMPILE=y
142CONFIG_BROKEN_ON_SMP=y 142CONFIG_BROKEN_ON_SMP=y
143CONFIG_INIT_ENV_ARG_LIMIT=32 143CONFIG_INIT_ENV_ARG_LIMIT=32
144 144
@@ -154,6 +154,7 @@ CONFIG_SYSVIPC=y
154CONFIG_SYSCTL=y 154CONFIG_SYSCTL=y
155# CONFIG_AUDIT is not set 155# CONFIG_AUDIT is not set
156# CONFIG_IKCONFIG is not set 156# CONFIG_IKCONFIG is not set
157CONFIG_RELAY=y
157CONFIG_INITRAMFS_SOURCE="" 158CONFIG_INITRAMFS_SOURCE=""
158# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 159# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
159CONFIG_EMBEDDED=y 160CONFIG_EMBEDDED=y
@@ -167,10 +168,6 @@ CONFIG_BASE_FULL=y
167CONFIG_FUTEX=y 168CONFIG_FUTEX=y
168CONFIG_EPOLL=y 169CONFIG_EPOLL=y
169CONFIG_SHMEM=y 170CONFIG_SHMEM=y
170CONFIG_CC_ALIGN_FUNCTIONS=0
171CONFIG_CC_ALIGN_LABELS=0
172CONFIG_CC_ALIGN_LOOPS=0
173CONFIG_CC_ALIGN_JUMPS=0
174CONFIG_SLAB=y 171CONFIG_SLAB=y
175# CONFIG_TINY_SHMEM is not set 172# CONFIG_TINY_SHMEM is not set
176CONFIG_BASE_SMALL=0 173CONFIG_BASE_SMALL=0
@@ -182,7 +179,6 @@ CONFIG_BASE_SMALL=0
182CONFIG_MODULES=y 179CONFIG_MODULES=y
183CONFIG_MODULE_UNLOAD=y 180CONFIG_MODULE_UNLOAD=y
184# CONFIG_MODULE_FORCE_UNLOAD is not set 181# CONFIG_MODULE_FORCE_UNLOAD is not set
185CONFIG_OBSOLETE_MODPARM=y
186CONFIG_MODVERSIONS=y 182CONFIG_MODVERSIONS=y
187CONFIG_MODULE_SRCVERSION_ALL=y 183CONFIG_MODULE_SRCVERSION_ALL=y
188# CONFIG_KMOD is not set 184# CONFIG_KMOD is not set
@@ -191,6 +187,8 @@ CONFIG_MODULE_SRCVERSION_ALL=y
191# Block layer 187# Block layer
192# 188#
193# CONFIG_LBD is not set 189# CONFIG_LBD is not set
190# CONFIG_BLK_DEV_IO_TRACE is not set
191# CONFIG_LSF is not set
194 192
195# 193#
196# IO Schedulers 194# IO Schedulers
@@ -210,7 +208,6 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
210# 208#
211CONFIG_HW_HAS_PCI=y 209CONFIG_HW_HAS_PCI=y
212CONFIG_PCI=y 210CONFIG_PCI=y
213CONFIG_PCI_LEGACY_PROC=y
214CONFIG_MMU=y 211CONFIG_MMU=y
215 212
216# 213#
@@ -238,6 +235,7 @@ CONFIG_NET=y
238# 235#
239# Networking options 236# Networking options
240# 237#
238# CONFIG_NETDEBUG is not set
241# CONFIG_PACKET is not set 239# CONFIG_PACKET is not set
242CONFIG_UNIX=y 240CONFIG_UNIX=y
243CONFIG_XFRM=y 241CONFIG_XFRM=y
@@ -258,12 +256,15 @@ CONFIG_IP_PNP=y
258# CONFIG_INET_AH is not set 256# CONFIG_INET_AH is not set
259# CONFIG_INET_ESP is not set 257# CONFIG_INET_ESP is not set
260# CONFIG_INET_IPCOMP is not set 258# CONFIG_INET_IPCOMP is not set
261CONFIG_INET_TUNNEL=m 259# CONFIG_INET_XFRM_TUNNEL is not set
260# CONFIG_INET_TUNNEL is not set
262CONFIG_INET_DIAG=y 261CONFIG_INET_DIAG=y
263CONFIG_INET_TCP_DIAG=y 262CONFIG_INET_TCP_DIAG=y
264# CONFIG_TCP_CONG_ADVANCED is not set 263# CONFIG_TCP_CONG_ADVANCED is not set
265CONFIG_TCP_CONG_BIC=y 264CONFIG_TCP_CONG_BIC=y
266# CONFIG_IPV6 is not set 265# CONFIG_IPV6 is not set
266# CONFIG_INET6_XFRM_TUNNEL is not set
267# CONFIG_INET6_TUNNEL is not set
267# CONFIG_NETFILTER is not set 268# CONFIG_NETFILTER is not set
268 269
269# 270#
@@ -275,6 +276,11 @@ CONFIG_TCP_CONG_BIC=y
275# SCTP Configuration (EXPERIMENTAL) 276# SCTP Configuration (EXPERIMENTAL)
276# 277#
277# CONFIG_IP_SCTP is not set 278# CONFIG_IP_SCTP is not set
279
280#
281# TIPC Configuration (EXPERIMENTAL)
282#
283# CONFIG_TIPC is not set
278# CONFIG_ATM is not set 284# CONFIG_ATM is not set
279# CONFIG_BRIDGE is not set 285# CONFIG_BRIDGE is not set
280# CONFIG_VLAN_8021Q is not set 286# CONFIG_VLAN_8021Q is not set
@@ -284,11 +290,6 @@ CONFIG_TCP_CONG_BIC=y
284# CONFIG_ATALK is not set 290# CONFIG_ATALK is not set
285# CONFIG_X25 is not set 291# CONFIG_X25 is not set
286# CONFIG_LAPB is not set 292# CONFIG_LAPB is not set
287
288#
289# TIPC Configuration (EXPERIMENTAL)
290#
291# CONFIG_TIPC is not set
292# CONFIG_NET_DIVERT is not set 293# CONFIG_NET_DIVERT is not set
293# CONFIG_ECONET is not set 294# CONFIG_ECONET is not set
294# CONFIG_WAN_ROUTER is not set 295# CONFIG_WAN_ROUTER is not set
@@ -309,6 +310,9 @@ CONFIG_IEEE80211=m
309# CONFIG_IEEE80211_DEBUG is not set 310# CONFIG_IEEE80211_DEBUG is not set
310CONFIG_IEEE80211_CRYPT_WEP=m 311CONFIG_IEEE80211_CRYPT_WEP=m
311CONFIG_IEEE80211_CRYPT_CCMP=m 312CONFIG_IEEE80211_CRYPT_CCMP=m
313CONFIG_IEEE80211_SOFTMAC=m
314# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
315CONFIG_WIRELESS_EXT=y
312 316
313# 317#
314# Device Drivers 318# Device Drivers
@@ -352,7 +356,7 @@ CONFIG_CONNECTOR=m
352# CONFIG_BLK_DEV_NBD is not set 356# CONFIG_BLK_DEV_NBD is not set
353# CONFIG_BLK_DEV_SX8 is not set 357# CONFIG_BLK_DEV_SX8 is not set
354# CONFIG_BLK_DEV_RAM is not set 358# CONFIG_BLK_DEV_RAM is not set
355CONFIG_BLK_DEV_RAM_COUNT=16 359# CONFIG_BLK_DEV_INITRD is not set
356CONFIG_CDROM_PKTCDVD=m 360CONFIG_CDROM_PKTCDVD=m
357CONFIG_CDROM_PKTCDVD_BUFFERS=8 361CONFIG_CDROM_PKTCDVD_BUFFERS=8
358# CONFIG_CDROM_PKTCDVD_WCACHE is not set 362# CONFIG_CDROM_PKTCDVD_WCACHE is not set
@@ -550,6 +554,7 @@ CONFIG_HW_CONSOLE=y
550# 554#
551CONFIG_SERIAL_8250=y 555CONFIG_SERIAL_8250=y
552CONFIG_SERIAL_8250_CONSOLE=y 556CONFIG_SERIAL_8250_CONSOLE=y
557CONFIG_SERIAL_8250_PCI=y
553CONFIG_SERIAL_8250_NR_UARTS=4 558CONFIG_SERIAL_8250_NR_UARTS=4
554CONFIG_SERIAL_8250_RUNTIME_UARTS=4 559CONFIG_SERIAL_8250_RUNTIME_UARTS=4
555# CONFIG_SERIAL_8250_EXTENDED is not set 560# CONFIG_SERIAL_8250_EXTENDED is not set
@@ -559,6 +564,7 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=4
559# 564#
560CONFIG_SERIAL_CORE=y 565CONFIG_SERIAL_CORE=y
561CONFIG_SERIAL_CORE_CONSOLE=y 566CONFIG_SERIAL_CORE_CONSOLE=y
567# CONFIG_SERIAL_JSM is not set
562CONFIG_UNIX98_PTYS=y 568CONFIG_UNIX98_PTYS=y
563CONFIG_LEGACY_PTYS=y 569CONFIG_LEGACY_PTYS=y
564CONFIG_LEGACY_PTY_COUNT=256 570CONFIG_LEGACY_PTY_COUNT=256
@@ -617,10 +623,6 @@ CONFIG_LEGACY_PTY_COUNT=256
617# 623#
618 624
619# 625#
620# Multimedia Capabilities Port drivers
621#
622
623#
624# Multimedia devices 626# Multimedia devices
625# 627#
626# CONFIG_VIDEO_DEV is not set 628# CONFIG_VIDEO_DEV is not set
@@ -651,6 +653,7 @@ CONFIG_DUMMY_CONSOLE=y
651# 653#
652CONFIG_USB_ARCH_HAS_HCD=y 654CONFIG_USB_ARCH_HAS_HCD=y
653CONFIG_USB_ARCH_HAS_OHCI=y 655CONFIG_USB_ARCH_HAS_OHCI=y
656CONFIG_USB_ARCH_HAS_EHCI=y
654# CONFIG_USB is not set 657# CONFIG_USB is not set
655 658
656# 659#
@@ -668,13 +671,31 @@ CONFIG_USB_ARCH_HAS_OHCI=y
668# CONFIG_MMC is not set 671# CONFIG_MMC is not set
669 672
670# 673#
674# LED devices
675#
676# CONFIG_NEW_LEDS is not set
677
678#
679# LED drivers
680#
681
682#
683# LED Triggers
684#
685
686#
671# InfiniBand support 687# InfiniBand support
672# 688#
673# CONFIG_INFINIBAND is not set 689# CONFIG_INFINIBAND is not set
674 690
675# 691#
676# SN Devices 692# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
693#
694
695#
696# Real Time Clock
677# 697#
698# CONFIG_RTC_CLASS is not set
678 699
679# 700#
680# File systems 701# File systems
@@ -719,7 +740,6 @@ CONFIG_SYSFS=y
719# CONFIG_TMPFS is not set 740# CONFIG_TMPFS is not set
720# CONFIG_HUGETLB_PAGE is not set 741# CONFIG_HUGETLB_PAGE is not set
721CONFIG_RAMFS=y 742CONFIG_RAMFS=y
722CONFIG_RELAYFS_FS=m
723# CONFIG_CONFIGFS_FS is not set 743# CONFIG_CONFIGFS_FS is not set
724 744
725# 745#
@@ -783,6 +803,7 @@ CONFIG_MSDOS_PARTITION=y
783# CONFIG_MAGIC_SYSRQ is not set 803# CONFIG_MAGIC_SYSRQ is not set
784# CONFIG_DEBUG_KERNEL is not set 804# CONFIG_DEBUG_KERNEL is not set
785CONFIG_LOG_BUF_SHIFT=14 805CONFIG_LOG_BUF_SHIFT=14
806# CONFIG_DEBUG_FS is not set
786CONFIG_CROSSCOMPILE=y 807CONFIG_CROSSCOMPILE=y
787CONFIG_CMDLINE="console=ttyS0,115200 root=/dev/nfs rw nfsroot=192.168.1.1:/mnt/disk2/fs.gal ip=192.168.1.211:192.168.1.1:::gt::" 808CONFIG_CMDLINE="console=ttyS0,115200 root=/dev/nfs rw nfsroot=192.168.1.1:/mnt/disk2/fs.gal ip=192.168.1.211:192.168.1.1:::gt::"
788 809
diff --git a/arch/mips/configs/ev96100_defconfig b/arch/mips/configs/ev96100_defconfig
index ac5841c4b698..00b56ed0e638 100644
--- a/arch/mips/configs/ev96100_defconfig
+++ b/arch/mips/configs/ev96100_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc1 3# Linux kernel version: 2.6.17-rc2
4# Fri Jan 27 15:40:06 2006 4# Mon Apr 24 14:51:03 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -64,6 +64,8 @@ CONFIG_MIPS_EV96100=y
64# CONFIG_TOSHIBA_RBTX4927 is not set 64# CONFIG_TOSHIBA_RBTX4927 is not set
65# CONFIG_TOSHIBA_RBTX4938 is not set 65# CONFIG_TOSHIBA_RBTX4938 is not set
66CONFIG_RWSEM_GENERIC_SPINLOCK=y 66CONFIG_RWSEM_GENERIC_SPINLOCK=y
67CONFIG_GENERIC_FIND_NEXT_BIT=y
68CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 69CONFIG_GENERIC_CALIBRATE_DELAY=y
68CONFIG_DMA_NONCOHERENT=y 70CONFIG_DMA_NONCOHERENT=y
69CONFIG_DMA_NEED_PCI_MAP_STATE=y 71CONFIG_DMA_NEED_PCI_MAP_STATE=y
@@ -119,7 +121,6 @@ CONFIG_RM7000_CPU_SCACHE=y
119CONFIG_CPU_HAS_PREFETCH=y 121CONFIG_CPU_HAS_PREFETCH=y
120# CONFIG_MIPS_MT is not set 122# CONFIG_MIPS_MT is not set
121# CONFIG_64BIT_PHYS_ADDR is not set 123# CONFIG_64BIT_PHYS_ADDR is not set
122# CONFIG_CPU_ADVANCED is not set
123CONFIG_CPU_HAS_LLSC=y 124CONFIG_CPU_HAS_LLSC=y
124CONFIG_CPU_HAS_SYNC=y 125CONFIG_CPU_HAS_SYNC=y
125CONFIG_GENERIC_HARDIRQS=y 126CONFIG_GENERIC_HARDIRQS=y
@@ -142,7 +143,6 @@ CONFIG_PREEMPT_NONE=y
142# Code maturity level options 143# Code maturity level options
143# 144#
144CONFIG_EXPERIMENTAL=y 145CONFIG_EXPERIMENTAL=y
145CONFIG_CLEAN_COMPILE=y
146CONFIG_BROKEN_ON_SMP=y 146CONFIG_BROKEN_ON_SMP=y
147CONFIG_INIT_ENV_ARG_LIMIT=32 147CONFIG_INIT_ENV_ARG_LIMIT=32
148 148
@@ -158,6 +158,7 @@ CONFIG_SYSVIPC=y
158CONFIG_SYSCTL=y 158CONFIG_SYSCTL=y
159# CONFIG_AUDIT is not set 159# CONFIG_AUDIT is not set
160# CONFIG_IKCONFIG is not set 160# CONFIG_IKCONFIG is not set
161CONFIG_RELAY=y
161CONFIG_INITRAMFS_SOURCE="" 162CONFIG_INITRAMFS_SOURCE=""
162# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 163# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
163CONFIG_EMBEDDED=y 164CONFIG_EMBEDDED=y
@@ -171,10 +172,6 @@ CONFIG_BASE_FULL=y
171CONFIG_FUTEX=y 172CONFIG_FUTEX=y
172CONFIG_EPOLL=y 173CONFIG_EPOLL=y
173CONFIG_SHMEM=y 174CONFIG_SHMEM=y
174CONFIG_CC_ALIGN_FUNCTIONS=0
175CONFIG_CC_ALIGN_LABELS=0
176CONFIG_CC_ALIGN_LOOPS=0
177CONFIG_CC_ALIGN_JUMPS=0
178CONFIG_SLAB=y 175CONFIG_SLAB=y
179# CONFIG_TINY_SHMEM is not set 176# CONFIG_TINY_SHMEM is not set
180CONFIG_BASE_SMALL=0 177CONFIG_BASE_SMALL=0
@@ -186,7 +183,6 @@ CONFIG_BASE_SMALL=0
186CONFIG_MODULES=y 183CONFIG_MODULES=y
187CONFIG_MODULE_UNLOAD=y 184CONFIG_MODULE_UNLOAD=y
188# CONFIG_MODULE_FORCE_UNLOAD is not set 185# CONFIG_MODULE_FORCE_UNLOAD is not set
189CONFIG_OBSOLETE_MODPARM=y
190CONFIG_MODVERSIONS=y 186CONFIG_MODVERSIONS=y
191CONFIG_MODULE_SRCVERSION_ALL=y 187CONFIG_MODULE_SRCVERSION_ALL=y
192# CONFIG_KMOD is not set 188# CONFIG_KMOD is not set
@@ -195,6 +191,8 @@ CONFIG_MODULE_SRCVERSION_ALL=y
195# Block layer 191# Block layer
196# 192#
197# CONFIG_LBD is not set 193# CONFIG_LBD is not set
194# CONFIG_BLK_DEV_IO_TRACE is not set
195# CONFIG_LSF is not set
198 196
199# 197#
200# IO Schedulers 198# IO Schedulers
@@ -240,6 +238,7 @@ CONFIG_NET=y
240# 238#
241# Networking options 239# Networking options
242# 240#
241# CONFIG_NETDEBUG is not set
243# CONFIG_PACKET is not set 242# CONFIG_PACKET is not set
244CONFIG_UNIX=y 243CONFIG_UNIX=y
245CONFIG_XFRM=y 244CONFIG_XFRM=y
@@ -260,12 +259,15 @@ CONFIG_IP_PNP_BOOTP=y
260# CONFIG_INET_AH is not set 259# CONFIG_INET_AH is not set
261# CONFIG_INET_ESP is not set 260# CONFIG_INET_ESP is not set
262# CONFIG_INET_IPCOMP is not set 261# CONFIG_INET_IPCOMP is not set
263CONFIG_INET_TUNNEL=m 262# CONFIG_INET_XFRM_TUNNEL is not set
263# CONFIG_INET_TUNNEL is not set
264CONFIG_INET_DIAG=y 264CONFIG_INET_DIAG=y
265CONFIG_INET_TCP_DIAG=y 265CONFIG_INET_TCP_DIAG=y
266# CONFIG_TCP_CONG_ADVANCED is not set 266# CONFIG_TCP_CONG_ADVANCED is not set
267CONFIG_TCP_CONG_BIC=y 267CONFIG_TCP_CONG_BIC=y
268# CONFIG_IPV6 is not set 268# CONFIG_IPV6 is not set
269# CONFIG_INET6_XFRM_TUNNEL is not set
270# CONFIG_INET6_TUNNEL is not set
269# CONFIG_NETFILTER is not set 271# CONFIG_NETFILTER is not set
270 272
271# 273#
@@ -277,6 +279,11 @@ CONFIG_TCP_CONG_BIC=y
277# SCTP Configuration (EXPERIMENTAL) 279# SCTP Configuration (EXPERIMENTAL)
278# 280#
279# CONFIG_IP_SCTP is not set 281# CONFIG_IP_SCTP is not set
282
283#
284# TIPC Configuration (EXPERIMENTAL)
285#
286# CONFIG_TIPC is not set
280# CONFIG_ATM is not set 287# CONFIG_ATM is not set
281# CONFIG_BRIDGE is not set 288# CONFIG_BRIDGE is not set
282# CONFIG_VLAN_8021Q is not set 289# CONFIG_VLAN_8021Q is not set
@@ -286,11 +293,6 @@ CONFIG_TCP_CONG_BIC=y
286# CONFIG_ATALK is not set 293# CONFIG_ATALK is not set
287# CONFIG_X25 is not set 294# CONFIG_X25 is not set
288# CONFIG_LAPB is not set 295# CONFIG_LAPB is not set
289
290#
291# TIPC Configuration (EXPERIMENTAL)
292#
293# CONFIG_TIPC is not set
294# CONFIG_NET_DIVERT is not set 296# CONFIG_NET_DIVERT is not set
295# CONFIG_ECONET is not set 297# CONFIG_ECONET is not set
296# CONFIG_WAN_ROUTER is not set 298# CONFIG_WAN_ROUTER is not set
@@ -311,6 +313,9 @@ CONFIG_IEEE80211=m
311# CONFIG_IEEE80211_DEBUG is not set 313# CONFIG_IEEE80211_DEBUG is not set
312CONFIG_IEEE80211_CRYPT_WEP=m 314CONFIG_IEEE80211_CRYPT_WEP=m
313CONFIG_IEEE80211_CRYPT_CCMP=m 315CONFIG_IEEE80211_CRYPT_CCMP=m
316CONFIG_IEEE80211_SOFTMAC=m
317# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
318CONFIG_WIRELESS_EXT=y
314 319
315# 320#
316# Device Drivers 321# Device Drivers
@@ -349,7 +354,7 @@ CONFIG_CONNECTOR=m
349# CONFIG_BLK_DEV_LOOP is not set 354# CONFIG_BLK_DEV_LOOP is not set
350# CONFIG_BLK_DEV_NBD is not set 355# CONFIG_BLK_DEV_NBD is not set
351# CONFIG_BLK_DEV_RAM is not set 356# CONFIG_BLK_DEV_RAM is not set
352CONFIG_BLK_DEV_RAM_COUNT=16 357# CONFIG_BLK_DEV_INITRD is not set
353CONFIG_CDROM_PKTCDVD=m 358CONFIG_CDROM_PKTCDVD=m
354CONFIG_CDROM_PKTCDVD_BUFFERS=8 359CONFIG_CDROM_PKTCDVD_BUFFERS=8
355# CONFIG_CDROM_PKTCDVD_WCACHE is not set 360# CONFIG_CDROM_PKTCDVD_WCACHE is not set
@@ -567,10 +572,6 @@ CONFIG_LEGACY_PTY_COUNT=256
567# 572#
568 573
569# 574#
570# Multimedia Capabilities Port drivers
571#
572
573#
574# Multimedia devices 575# Multimedia devices
575# 576#
576# CONFIG_VIDEO_DEV is not set 577# CONFIG_VIDEO_DEV is not set
@@ -601,6 +602,7 @@ CONFIG_DUMMY_CONSOLE=y
601# 602#
602# CONFIG_USB_ARCH_HAS_HCD is not set 603# CONFIG_USB_ARCH_HAS_HCD is not set
603# CONFIG_USB_ARCH_HAS_OHCI is not set 604# CONFIG_USB_ARCH_HAS_OHCI is not set
605# CONFIG_USB_ARCH_HAS_EHCI is not set
604 606
605# 607#
606# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 608# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
@@ -617,12 +619,30 @@ CONFIG_DUMMY_CONSOLE=y
617# CONFIG_MMC is not set 619# CONFIG_MMC is not set
618 620
619# 621#
622# LED devices
623#
624# CONFIG_NEW_LEDS is not set
625
626#
627# LED drivers
628#
629
630#
631# LED Triggers
632#
633
634#
620# InfiniBand support 635# InfiniBand support
621# 636#
622 637
623# 638#
624# SN Devices 639# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
640#
641
642#
643# Real Time Clock
625# 644#
645# CONFIG_RTC_CLASS is not set
626 646
627# 647#
628# File systems 648# File systems
@@ -667,7 +687,6 @@ CONFIG_SYSFS=y
667# CONFIG_TMPFS is not set 687# CONFIG_TMPFS is not set
668# CONFIG_HUGETLB_PAGE is not set 688# CONFIG_HUGETLB_PAGE is not set
669CONFIG_RAMFS=y 689CONFIG_RAMFS=y
670CONFIG_RELAYFS_FS=m
671# CONFIG_CONFIGFS_FS is not set 690# CONFIG_CONFIGFS_FS is not set
672 691
673# 692#
@@ -731,6 +750,7 @@ CONFIG_MSDOS_PARTITION=y
731# CONFIG_MAGIC_SYSRQ is not set 750# CONFIG_MAGIC_SYSRQ is not set
732# CONFIG_DEBUG_KERNEL is not set 751# CONFIG_DEBUG_KERNEL is not set
733CONFIG_LOG_BUF_SHIFT=14 752CONFIG_LOG_BUF_SHIFT=14
753# CONFIG_DEBUG_FS is not set
734CONFIG_CROSSCOMPILE=y 754CONFIG_CROSSCOMPILE=y
735CONFIG_CMDLINE="" 755CONFIG_CMDLINE=""
736 756
diff --git a/arch/mips/configs/ip22_defconfig b/arch/mips/configs/ip22_defconfig
index 42d5cd7927cb..607e2985ffe3 100644
--- a/arch/mips/configs/ip22_defconfig
+++ b/arch/mips/configs/ip22_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc1 3# Linux kernel version: 2.6.17-rc2
4# Fri Jan 27 15:39:51 2006 4# Mon Apr 24 14:50:54 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -64,6 +64,8 @@ CONFIG_SGI_IP22=y
64# CONFIG_TOSHIBA_RBTX4927 is not set 64# CONFIG_TOSHIBA_RBTX4927 is not set
65# CONFIG_TOSHIBA_RBTX4938 is not set 65# CONFIG_TOSHIBA_RBTX4938 is not set
66CONFIG_RWSEM_GENERIC_SPINLOCK=y 66CONFIG_RWSEM_GENERIC_SPINLOCK=y
67CONFIG_GENERIC_FIND_NEXT_BIT=y
68CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 69CONFIG_GENERIC_CALIBRATE_DELAY=y
68CONFIG_ARC=y 70CONFIG_ARC=y
69CONFIG_DMA_NONCOHERENT=y 71CONFIG_DMA_NONCOHERENT=y
@@ -121,7 +123,6 @@ CONFIG_BOARD_SCACHE=y
121CONFIG_IP22_CPU_SCACHE=y 123CONFIG_IP22_CPU_SCACHE=y
122# CONFIG_MIPS_MT is not set 124# CONFIG_MIPS_MT is not set
123# CONFIG_64BIT_PHYS_ADDR is not set 125# CONFIG_64BIT_PHYS_ADDR is not set
124# CONFIG_CPU_ADVANCED is not set
125CONFIG_CPU_HAS_LLSC=y 126CONFIG_CPU_HAS_LLSC=y
126CONFIG_CPU_HAS_SYNC=y 127CONFIG_CPU_HAS_SYNC=y
127CONFIG_GENERIC_HARDIRQS=y 128CONFIG_GENERIC_HARDIRQS=y
@@ -143,7 +144,6 @@ CONFIG_PREEMPT_VOLUNTARY=y
143# Code maturity level options 144# Code maturity level options
144# 145#
145CONFIG_EXPERIMENTAL=y 146CONFIG_EXPERIMENTAL=y
146CONFIG_CLEAN_COMPILE=y
147CONFIG_BROKEN_ON_SMP=y 147CONFIG_BROKEN_ON_SMP=y
148CONFIG_INIT_ENV_ARG_LIMIT=32 148CONFIG_INIT_ENV_ARG_LIMIT=32
149 149
@@ -160,6 +160,7 @@ CONFIG_SYSCTL=y
160# CONFIG_AUDIT is not set 160# CONFIG_AUDIT is not set
161CONFIG_IKCONFIG=y 161CONFIG_IKCONFIG=y
162CONFIG_IKCONFIG_PROC=y 162CONFIG_IKCONFIG_PROC=y
163CONFIG_RELAY=y
163CONFIG_INITRAMFS_SOURCE="" 164CONFIG_INITRAMFS_SOURCE=""
164# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 165# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
165CONFIG_EMBEDDED=y 166CONFIG_EMBEDDED=y
@@ -173,10 +174,6 @@ CONFIG_BASE_FULL=y
173CONFIG_FUTEX=y 174CONFIG_FUTEX=y
174CONFIG_EPOLL=y 175CONFIG_EPOLL=y
175CONFIG_SHMEM=y 176CONFIG_SHMEM=y
176CONFIG_CC_ALIGN_FUNCTIONS=0
177CONFIG_CC_ALIGN_LABELS=0
178CONFIG_CC_ALIGN_LOOPS=0
179CONFIG_CC_ALIGN_JUMPS=0
180CONFIG_SLAB=y 177CONFIG_SLAB=y
181# CONFIG_TINY_SHMEM is not set 178# CONFIG_TINY_SHMEM is not set
182CONFIG_BASE_SMALL=0 179CONFIG_BASE_SMALL=0
@@ -188,7 +185,6 @@ CONFIG_BASE_SMALL=0
188CONFIG_MODULES=y 185CONFIG_MODULES=y
189CONFIG_MODULE_UNLOAD=y 186CONFIG_MODULE_UNLOAD=y
190# CONFIG_MODULE_FORCE_UNLOAD is not set 187# CONFIG_MODULE_FORCE_UNLOAD is not set
191CONFIG_OBSOLETE_MODPARM=y
192CONFIG_MODVERSIONS=y 188CONFIG_MODVERSIONS=y
193CONFIG_MODULE_SRCVERSION_ALL=y 189CONFIG_MODULE_SRCVERSION_ALL=y
194CONFIG_KMOD=y 190CONFIG_KMOD=y
@@ -197,6 +193,8 @@ CONFIG_KMOD=y
197# Block layer 193# Block layer
198# 194#
199# CONFIG_LBD is not set 195# CONFIG_LBD is not set
196# CONFIG_BLK_DEV_IO_TRACE is not set
197# CONFIG_LSF is not set
200 198
201# 199#
202# IO Schedulers 200# IO Schedulers
@@ -242,6 +240,7 @@ CONFIG_NET=y
242# 240#
243# Networking options 241# Networking options
244# 242#
243# CONFIG_NETDEBUG is not set
245CONFIG_PACKET=y 244CONFIG_PACKET=y
246CONFIG_PACKET_MMAP=y 245CONFIG_PACKET_MMAP=y
247CONFIG_UNIX=y 246CONFIG_UNIX=y
@@ -264,6 +263,7 @@ CONFIG_IP_PNP_BOOTP=y
264CONFIG_INET_AH=m 263CONFIG_INET_AH=m
265CONFIG_INET_ESP=m 264CONFIG_INET_ESP=m
266CONFIG_INET_IPCOMP=m 265CONFIG_INET_IPCOMP=m
266CONFIG_INET_XFRM_TUNNEL=m
267CONFIG_INET_TUNNEL=m 267CONFIG_INET_TUNNEL=m
268CONFIG_INET_DIAG=y 268CONFIG_INET_DIAG=y
269CONFIG_INET_TCP_DIAG=y 269CONFIG_INET_TCP_DIAG=y
@@ -305,9 +305,12 @@ CONFIG_IP_VS_NQ=m
305CONFIG_IP_VS_FTP=m 305CONFIG_IP_VS_FTP=m
306CONFIG_IPV6=m 306CONFIG_IPV6=m
307CONFIG_IPV6_PRIVACY=y 307CONFIG_IPV6_PRIVACY=y
308CONFIG_IPV6_ROUTER_PREF=y
309CONFIG_IPV6_ROUTE_INFO=y
308CONFIG_INET6_AH=m 310CONFIG_INET6_AH=m
309CONFIG_INET6_ESP=m 311CONFIG_INET6_ESP=m
310CONFIG_INET6_IPCOMP=m 312CONFIG_INET6_IPCOMP=m
313CONFIG_INET6_XFRM_TUNNEL=m
311CONFIG_INET6_TUNNEL=m 314CONFIG_INET6_TUNNEL=m
312CONFIG_IPV6_TUNNEL=m 315CONFIG_IPV6_TUNNEL=m
313CONFIG_NETFILTER=y 316CONFIG_NETFILTER=y
@@ -330,11 +333,14 @@ CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
330CONFIG_NETFILTER_XT_MATCH_CONNMARK=m 333CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
331CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m 334CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
332CONFIG_NETFILTER_XT_MATCH_DCCP=m 335CONFIG_NETFILTER_XT_MATCH_DCCP=m
336CONFIG_NETFILTER_XT_MATCH_ESP=m
333CONFIG_NETFILTER_XT_MATCH_HELPER=m 337CONFIG_NETFILTER_XT_MATCH_HELPER=m
334CONFIG_NETFILTER_XT_MATCH_LENGTH=m 338CONFIG_NETFILTER_XT_MATCH_LENGTH=m
335CONFIG_NETFILTER_XT_MATCH_LIMIT=m 339CONFIG_NETFILTER_XT_MATCH_LIMIT=m
336CONFIG_NETFILTER_XT_MATCH_MAC=m 340CONFIG_NETFILTER_XT_MATCH_MAC=m
337CONFIG_NETFILTER_XT_MATCH_MARK=m 341CONFIG_NETFILTER_XT_MATCH_MARK=m
342CONFIG_NETFILTER_XT_MATCH_POLICY=m
343CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
338CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m 344CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
339CONFIG_NETFILTER_XT_MATCH_REALM=m 345CONFIG_NETFILTER_XT_MATCH_REALM=m
340CONFIG_NETFILTER_XT_MATCH_SCTP=m 346CONFIG_NETFILTER_XT_MATCH_SCTP=m
@@ -357,20 +363,19 @@ CONFIG_IP_NF_IRC=m
357CONFIG_IP_NF_TFTP=m 363CONFIG_IP_NF_TFTP=m
358CONFIG_IP_NF_AMANDA=m 364CONFIG_IP_NF_AMANDA=m
359CONFIG_IP_NF_PPTP=m 365CONFIG_IP_NF_PPTP=m
366CONFIG_IP_NF_H323=m
360CONFIG_IP_NF_QUEUE=m 367CONFIG_IP_NF_QUEUE=m
361CONFIG_IP_NF_IPTABLES=m 368CONFIG_IP_NF_IPTABLES=m
362CONFIG_IP_NF_MATCH_IPRANGE=m 369CONFIG_IP_NF_MATCH_IPRANGE=m
363CONFIG_IP_NF_MATCH_MULTIPORT=m
364CONFIG_IP_NF_MATCH_TOS=m 370CONFIG_IP_NF_MATCH_TOS=m
365CONFIG_IP_NF_MATCH_RECENT=m 371CONFIG_IP_NF_MATCH_RECENT=m
366CONFIG_IP_NF_MATCH_ECN=m 372CONFIG_IP_NF_MATCH_ECN=m
367CONFIG_IP_NF_MATCH_DSCP=m 373CONFIG_IP_NF_MATCH_DSCP=m
368CONFIG_IP_NF_MATCH_AH_ESP=m 374CONFIG_IP_NF_MATCH_AH=m
369CONFIG_IP_NF_MATCH_TTL=m 375CONFIG_IP_NF_MATCH_TTL=m
370CONFIG_IP_NF_MATCH_OWNER=m 376CONFIG_IP_NF_MATCH_OWNER=m
371CONFIG_IP_NF_MATCH_ADDRTYPE=m 377CONFIG_IP_NF_MATCH_ADDRTYPE=m
372CONFIG_IP_NF_MATCH_HASHLIMIT=m 378CONFIG_IP_NF_MATCH_HASHLIMIT=m
373CONFIG_IP_NF_MATCH_POLICY=m
374CONFIG_IP_NF_FILTER=m 379CONFIG_IP_NF_FILTER=m
375CONFIG_IP_NF_TARGET_REJECT=m 380CONFIG_IP_NF_TARGET_REJECT=m
376CONFIG_IP_NF_TARGET_LOG=m 381CONFIG_IP_NF_TARGET_LOG=m
@@ -388,6 +393,7 @@ CONFIG_IP_NF_NAT_FTP=m
388CONFIG_IP_NF_NAT_TFTP=m 393CONFIG_IP_NF_NAT_TFTP=m
389CONFIG_IP_NF_NAT_AMANDA=m 394CONFIG_IP_NF_NAT_AMANDA=m
390CONFIG_IP_NF_NAT_PPTP=m 395CONFIG_IP_NF_NAT_PPTP=m
396CONFIG_IP_NF_NAT_H323=m
391CONFIG_IP_NF_MANGLE=m 397CONFIG_IP_NF_MANGLE=m
392CONFIG_IP_NF_TARGET_TOS=m 398CONFIG_IP_NF_TARGET_TOS=m
393CONFIG_IP_NF_TARGET_ECN=m 399CONFIG_IP_NF_TARGET_ECN=m
@@ -408,12 +414,10 @@ CONFIG_IP6_NF_MATCH_RT=m
408CONFIG_IP6_NF_MATCH_OPTS=m 414CONFIG_IP6_NF_MATCH_OPTS=m
409CONFIG_IP6_NF_MATCH_FRAG=m 415CONFIG_IP6_NF_MATCH_FRAG=m
410CONFIG_IP6_NF_MATCH_HL=m 416CONFIG_IP6_NF_MATCH_HL=m
411CONFIG_IP6_NF_MATCH_MULTIPORT=m
412CONFIG_IP6_NF_MATCH_OWNER=m 417CONFIG_IP6_NF_MATCH_OWNER=m
413CONFIG_IP6_NF_MATCH_IPV6HEADER=m 418CONFIG_IP6_NF_MATCH_IPV6HEADER=m
414CONFIG_IP6_NF_MATCH_AHESP=m 419CONFIG_IP6_NF_MATCH_AH=m
415CONFIG_IP6_NF_MATCH_EUI64=m 420CONFIG_IP6_NF_MATCH_EUI64=m
416CONFIG_IP6_NF_MATCH_POLICY=m
417CONFIG_IP6_NF_FILTER=m 421CONFIG_IP6_NF_FILTER=m
418CONFIG_IP6_NF_TARGET_LOG=m 422CONFIG_IP6_NF_TARGET_LOG=m
419CONFIG_IP6_NF_TARGET_REJECT=m 423CONFIG_IP6_NF_TARGET_REJECT=m
@@ -435,6 +439,11 @@ CONFIG_IP_SCTP=m
435# CONFIG_SCTP_HMAC_NONE is not set 439# CONFIG_SCTP_HMAC_NONE is not set
436# CONFIG_SCTP_HMAC_SHA1 is not set 440# CONFIG_SCTP_HMAC_SHA1 is not set
437CONFIG_SCTP_HMAC_MD5=y 441CONFIG_SCTP_HMAC_MD5=y
442
443#
444# TIPC Configuration (EXPERIMENTAL)
445#
446# CONFIG_TIPC is not set
438# CONFIG_ATM is not set 447# CONFIG_ATM is not set
439# CONFIG_BRIDGE is not set 448# CONFIG_BRIDGE is not set
440# CONFIG_VLAN_8021Q is not set 449# CONFIG_VLAN_8021Q is not set
@@ -444,11 +453,6 @@ CONFIG_SCTP_HMAC_MD5=y
444# CONFIG_ATALK is not set 453# CONFIG_ATALK is not set
445# CONFIG_X25 is not set 454# CONFIG_X25 is not set
446# CONFIG_LAPB is not set 455# CONFIG_LAPB is not set
447
448#
449# TIPC Configuration (EXPERIMENTAL)
450#
451# CONFIG_TIPC is not set
452CONFIG_NET_DIVERT=y 456CONFIG_NET_DIVERT=y
453# CONFIG_ECONET is not set 457# CONFIG_ECONET is not set
454# CONFIG_WAN_ROUTER is not set 458# CONFIG_WAN_ROUTER is not set
@@ -508,6 +512,9 @@ CONFIG_IEEE80211=m
508# CONFIG_IEEE80211_DEBUG is not set 512# CONFIG_IEEE80211_DEBUG is not set
509CONFIG_IEEE80211_CRYPT_WEP=m 513CONFIG_IEEE80211_CRYPT_WEP=m
510CONFIG_IEEE80211_CRYPT_CCMP=m 514CONFIG_IEEE80211_CRYPT_CCMP=m
515CONFIG_IEEE80211_SOFTMAC=m
516# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
517CONFIG_WIRELESS_EXT=y
511 518
512# 519#
513# Device Drivers 520# Device Drivers
@@ -546,7 +553,7 @@ CONFIG_CONNECTOR=m
546# CONFIG_BLK_DEV_LOOP is not set 553# CONFIG_BLK_DEV_LOOP is not set
547# CONFIG_BLK_DEV_NBD is not set 554# CONFIG_BLK_DEV_NBD is not set
548# CONFIG_BLK_DEV_RAM is not set 555# CONFIG_BLK_DEV_RAM is not set
549CONFIG_BLK_DEV_RAM_COUNT=16 556# CONFIG_BLK_DEV_INITRD is not set
550CONFIG_CDROM_PKTCDVD=m 557CONFIG_CDROM_PKTCDVD=m
551CONFIG_CDROM_PKTCDVD_BUFFERS=8 558CONFIG_CDROM_PKTCDVD_BUFFERS=8
552# CONFIG_CDROM_PKTCDVD_WCACHE is not set 559# CONFIG_CDROM_PKTCDVD_WCACHE is not set
@@ -812,10 +819,6 @@ CONFIG_MAX_RAW_DEVS=256
812# 819#
813 820
814# 821#
815# Multimedia Capabilities Port drivers
816#
817
818#
819# Multimedia devices 822# Multimedia devices
820# 823#
821# CONFIG_VIDEO_DEV is not set 824# CONFIG_VIDEO_DEV is not set
@@ -857,6 +860,7 @@ CONFIG_LOGO_SGI_CLUT224=y
857# 860#
858# CONFIG_USB_ARCH_HAS_HCD is not set 861# CONFIG_USB_ARCH_HAS_HCD is not set
859# CONFIG_USB_ARCH_HAS_OHCI is not set 862# CONFIG_USB_ARCH_HAS_OHCI is not set
863# CONFIG_USB_ARCH_HAS_EHCI is not set
860 864
861# 865#
862# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 866# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
@@ -873,12 +877,30 @@ CONFIG_LOGO_SGI_CLUT224=y
873# CONFIG_MMC is not set 877# CONFIG_MMC is not set
874 878
875# 879#
880# LED devices
881#
882# CONFIG_NEW_LEDS is not set
883
884#
885# LED drivers
886#
887
888#
889# LED Triggers
890#
891
892#
876# InfiniBand support 893# InfiniBand support
877# 894#
878 895
879# 896#
880# SN Devices 897# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
898#
899
900#
901# Real Time Clock
881# 902#
903# CONFIG_RTC_CLASS is not set
882 904
883# 905#
884# File systems 906# File systems
@@ -944,7 +966,6 @@ CONFIG_SYSFS=y
944# CONFIG_TMPFS is not set 966# CONFIG_TMPFS is not set
945# CONFIG_HUGETLB_PAGE is not set 967# CONFIG_HUGETLB_PAGE is not set
946CONFIG_RAMFS=y 968CONFIG_RAMFS=y
947CONFIG_RELAYFS_FS=m
948# CONFIG_CONFIGFS_FS is not set 969# CONFIG_CONFIGFS_FS is not set
949 970
950# 971#
@@ -963,7 +984,6 @@ CONFIG_EFS_FS=m
963# CONFIG_QNX4FS_FS is not set 984# CONFIG_QNX4FS_FS is not set
964# CONFIG_SYSV_FS is not set 985# CONFIG_SYSV_FS is not set
965CONFIG_UFS_FS=m 986CONFIG_UFS_FS=m
966# CONFIG_UFS_FS_WRITE is not set
967 987
968# 988#
969# Network File Systems 989# Network File Systems
@@ -1078,6 +1098,7 @@ CONFIG_NLS_UTF8=m
1078# CONFIG_MAGIC_SYSRQ is not set 1098# CONFIG_MAGIC_SYSRQ is not set
1079# CONFIG_DEBUG_KERNEL is not set 1099# CONFIG_DEBUG_KERNEL is not set
1080CONFIG_LOG_BUF_SHIFT=14 1100CONFIG_LOG_BUF_SHIFT=14
1101# CONFIG_DEBUG_FS is not set
1081CONFIG_CROSSCOMPILE=y 1102CONFIG_CROSSCOMPILE=y
1082CONFIG_CMDLINE="" 1103CONFIG_CMDLINE=""
1083 1104
diff --git a/arch/mips/configs/ip27_defconfig b/arch/mips/configs/ip27_defconfig
index 8c40590737e1..f724b4b2ecf2 100644
--- a/arch/mips/configs/ip27_defconfig
+++ b/arch/mips/configs/ip27_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc4 3# Linux kernel version: 2.6.17-rc2
4# Tue Feb 21 13:44:31 2006 4# Mon Apr 24 14:51:04 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -70,6 +70,8 @@ CONFIG_NUMA=y
70# CONFIG_REPLICATE_KTEXT is not set 70# CONFIG_REPLICATE_KTEXT is not set
71# CONFIG_REPLICATE_EXHANDLERS is not set 71# CONFIG_REPLICATE_EXHANDLERS is not set
72CONFIG_RWSEM_GENERIC_SPINLOCK=y 72CONFIG_RWSEM_GENERIC_SPINLOCK=y
73CONFIG_GENERIC_FIND_NEXT_BIT=y
74CONFIG_GENERIC_HWEIGHT=y
73CONFIG_GENERIC_CALIBRATE_DELAY=y 75CONFIG_GENERIC_CALIBRATE_DELAY=y
74CONFIG_ARC=y 76CONFIG_ARC=y
75CONFIG_DMA_IP27=y 77CONFIG_DMA_IP27=y
@@ -123,6 +125,7 @@ CONFIG_CPU_HAS_SYNC=y
123CONFIG_GENERIC_HARDIRQS=y 125CONFIG_GENERIC_HARDIRQS=y
124CONFIG_GENERIC_IRQ_PROBE=y 126CONFIG_GENERIC_IRQ_PROBE=y
125CONFIG_CPU_SUPPORTS_HIGHMEM=y 127CONFIG_CPU_SUPPORTS_HIGHMEM=y
128CONFIG_NODES_SHIFT=6
126CONFIG_SELECT_MEMORY_MODEL=y 129CONFIG_SELECT_MEMORY_MODEL=y
127# CONFIG_FLATMEM_MANUAL is not set 130# CONFIG_FLATMEM_MANUAL is not set
128CONFIG_DISCONTIGMEM_MANUAL=y 131CONFIG_DISCONTIGMEM_MANUAL=y
@@ -162,6 +165,7 @@ CONFIG_SYSCTL=y
162CONFIG_IKCONFIG=y 165CONFIG_IKCONFIG=y
163CONFIG_IKCONFIG_PROC=y 166CONFIG_IKCONFIG_PROC=y
164CONFIG_CPUSETS=y 167CONFIG_CPUSETS=y
168CONFIG_RELAY=y
165CONFIG_INITRAMFS_SOURCE="" 169CONFIG_INITRAMFS_SOURCE=""
166# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 170# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
167CONFIG_EMBEDDED=y 171CONFIG_EMBEDDED=y
@@ -175,10 +179,6 @@ CONFIG_BASE_FULL=y
175CONFIG_FUTEX=y 179CONFIG_FUTEX=y
176CONFIG_EPOLL=y 180CONFIG_EPOLL=y
177CONFIG_SHMEM=y 181CONFIG_SHMEM=y
178CONFIG_CC_ALIGN_FUNCTIONS=0
179CONFIG_CC_ALIGN_LABELS=0
180CONFIG_CC_ALIGN_LOOPS=0
181CONFIG_CC_ALIGN_JUMPS=0
182CONFIG_SLAB=y 182CONFIG_SLAB=y
183# CONFIG_TINY_SHMEM is not set 183# CONFIG_TINY_SHMEM is not set
184CONFIG_BASE_SMALL=0 184CONFIG_BASE_SMALL=0
@@ -190,7 +190,6 @@ CONFIG_BASE_SMALL=0
190CONFIG_MODULES=y 190CONFIG_MODULES=y
191CONFIG_MODULE_UNLOAD=y 191CONFIG_MODULE_UNLOAD=y
192# CONFIG_MODULE_FORCE_UNLOAD is not set 192# CONFIG_MODULE_FORCE_UNLOAD is not set
193CONFIG_OBSOLETE_MODPARM=y
194# CONFIG_MODVERSIONS is not set 193# CONFIG_MODVERSIONS is not set
195CONFIG_MODULE_SRCVERSION_ALL=y 194CONFIG_MODULE_SRCVERSION_ALL=y
196CONFIG_KMOD=y 195CONFIG_KMOD=y
@@ -199,6 +198,7 @@ CONFIG_STOP_MACHINE=y
199# 198#
200# Block layer 199# Block layer
201# 200#
201# CONFIG_BLK_DEV_IO_TRACE is not set
202 202
203# 203#
204# IO Schedulers 204# IO Schedulers
@@ -219,7 +219,6 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
219CONFIG_HW_HAS_PCI=y 219CONFIG_HW_HAS_PCI=y
220CONFIG_PCI=y 220CONFIG_PCI=y
221CONFIG_PCI_DOMAINS=y 221CONFIG_PCI_DOMAINS=y
222CONFIG_PCI_LEGACY_PROC=y
223CONFIG_MMU=y 222CONFIG_MMU=y
224 223
225# 224#
@@ -237,6 +236,7 @@ CONFIG_MMU=y
237# 236#
238CONFIG_BINFMT_ELF=y 237CONFIG_BINFMT_ELF=y
239# CONFIG_BINFMT_MISC is not set 238# CONFIG_BINFMT_MISC is not set
239# CONFIG_BUILD_ELF64 is not set
240CONFIG_MIPS32_COMPAT=y 240CONFIG_MIPS32_COMPAT=y
241CONFIG_COMPAT=y 241CONFIG_COMPAT=y
242CONFIG_MIPS32_O32=y 242CONFIG_MIPS32_O32=y
@@ -274,12 +274,15 @@ CONFIG_IP_PNP=y
274# CONFIG_INET_AH is not set 274# CONFIG_INET_AH is not set
275# CONFIG_INET_ESP is not set 275# CONFIG_INET_ESP is not set
276# CONFIG_INET_IPCOMP is not set 276# CONFIG_INET_IPCOMP is not set
277CONFIG_INET_TUNNEL=m 277# CONFIG_INET_XFRM_TUNNEL is not set
278# CONFIG_INET_TUNNEL is not set
278CONFIG_INET_DIAG=y 279CONFIG_INET_DIAG=y
279CONFIG_INET_TCP_DIAG=y 280CONFIG_INET_TCP_DIAG=y
280# CONFIG_TCP_CONG_ADVANCED is not set 281# CONFIG_TCP_CONG_ADVANCED is not set
281CONFIG_TCP_CONG_BIC=y 282CONFIG_TCP_CONG_BIC=y
282# CONFIG_IPV6 is not set 283# CONFIG_IPV6 is not set
284# CONFIG_INET6_XFRM_TUNNEL is not set
285# CONFIG_INET6_TUNNEL is not set
283# CONFIG_NETFILTER is not set 286# CONFIG_NETFILTER is not set
284 287
285# 288#
@@ -363,6 +366,9 @@ CONFIG_IEEE80211=m
363# CONFIG_IEEE80211_DEBUG is not set 366# CONFIG_IEEE80211_DEBUG is not set
364CONFIG_IEEE80211_CRYPT_WEP=m 367CONFIG_IEEE80211_CRYPT_WEP=m
365CONFIG_IEEE80211_CRYPT_CCMP=m 368CONFIG_IEEE80211_CRYPT_CCMP=m
369CONFIG_IEEE80211_SOFTMAC=m
370# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
371CONFIG_WIRELESS_EXT=y
366 372
367# 373#
368# Device Drivers 374# Device Drivers
@@ -407,7 +413,7 @@ CONFIG_BLK_DEV_CRYPTOLOOP=m
407# CONFIG_BLK_DEV_NBD is not set 413# CONFIG_BLK_DEV_NBD is not set
408# CONFIG_BLK_DEV_SX8 is not set 414# CONFIG_BLK_DEV_SX8 is not set
409# CONFIG_BLK_DEV_RAM is not set 415# CONFIG_BLK_DEV_RAM is not set
410CONFIG_BLK_DEV_RAM_COUNT=16 416# CONFIG_BLK_DEV_INITRD is not set
411CONFIG_CDROM_PKTCDVD=m 417CONFIG_CDROM_PKTCDVD=m
412CONFIG_CDROM_PKTCDVD_BUFFERS=8 418CONFIG_CDROM_PKTCDVD_BUFFERS=8
413# CONFIG_CDROM_PKTCDVD_WCACHE is not set 419# CONFIG_CDROM_PKTCDVD_WCACHE is not set
@@ -473,7 +479,6 @@ CONFIG_SCSI_SAS_ATTRS=m
473# CONFIG_SCSI_INIA100 is not set 479# CONFIG_SCSI_INIA100 is not set
474# CONFIG_SCSI_SYM53C8XX_2 is not set 480# CONFIG_SCSI_SYM53C8XX_2 is not set
475# CONFIG_SCSI_IPR is not set 481# CONFIG_SCSI_IPR is not set
476# CONFIG_SCSI_QLOGIC_FC is not set
477CONFIG_SCSI_QLOGIC_1280=y 482CONFIG_SCSI_QLOGIC_1280=y
478# CONFIG_SCSI_QLA_FC is not set 483# CONFIG_SCSI_QLA_FC is not set
479# CONFIG_SCSI_LPFC is not set 484# CONFIG_SCSI_LPFC is not set
@@ -491,6 +496,7 @@ CONFIG_MD_RAID0=y
491CONFIG_MD_RAID1=y 496CONFIG_MD_RAID1=y
492CONFIG_MD_RAID10=m 497CONFIG_MD_RAID10=m
493CONFIG_MD_RAID5=y 498CONFIG_MD_RAID5=y
499CONFIG_MD_RAID5_RESHAPE=y
494CONFIG_MD_RAID6=m 500CONFIG_MD_RAID6=m
495CONFIG_MD_MULTIPATH=m 501CONFIG_MD_MULTIPATH=m
496CONFIG_MD_FAULTY=m 502CONFIG_MD_FAULTY=m
@@ -654,6 +660,7 @@ CONFIG_SERIO_RAW=m
654# 660#
655CONFIG_SERIAL_8250=y 661CONFIG_SERIAL_8250=y
656CONFIG_SERIAL_8250_CONSOLE=y 662CONFIG_SERIAL_8250_CONSOLE=y
663CONFIG_SERIAL_8250_PCI=y
657CONFIG_SERIAL_8250_NR_UARTS=4 664CONFIG_SERIAL_8250_NR_UARTS=4
658CONFIG_SERIAL_8250_RUNTIME_UARTS=4 665CONFIG_SERIAL_8250_RUNTIME_UARTS=4
659CONFIG_SERIAL_8250_EXTENDED=y 666CONFIG_SERIAL_8250_EXTENDED=y
@@ -727,10 +734,6 @@ CONFIG_SGI_IP27_RTC=y
727# 734#
728 735
729# 736#
730# Multimedia Capabilities Port drivers
731#
732
733#
734# Multimedia devices 737# Multimedia devices
735# 738#
736# CONFIG_VIDEO_DEV is not set 739# CONFIG_VIDEO_DEV is not set
@@ -755,6 +758,7 @@ CONFIG_SGI_IP27_RTC=y
755# 758#
756CONFIG_USB_ARCH_HAS_HCD=y 759CONFIG_USB_ARCH_HAS_HCD=y
757CONFIG_USB_ARCH_HAS_OHCI=y 760CONFIG_USB_ARCH_HAS_OHCI=y
761CONFIG_USB_ARCH_HAS_EHCI=y
758# CONFIG_USB is not set 762# CONFIG_USB is not set
759 763
760# 764#
@@ -772,17 +776,31 @@ CONFIG_USB_ARCH_HAS_OHCI=y
772# CONFIG_MMC is not set 776# CONFIG_MMC is not set
773 777
774# 778#
779# LED devices
780#
781# CONFIG_NEW_LEDS is not set
782
783#
784# LED drivers
785#
786
787#
788# LED Triggers
789#
790
791#
775# InfiniBand support 792# InfiniBand support
776# 793#
777# CONFIG_INFINIBAND is not set 794# CONFIG_INFINIBAND is not set
778 795
779# 796#
780# SN Devices 797# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
781# 798#
782 799
783# 800#
784# EDAC - error detection and reporting (RAS) 801# Real Time Clock
785# 802#
803# CONFIG_RTC_CLASS is not set
786 804
787# 805#
788# File systems 806# File systems
@@ -840,7 +858,6 @@ CONFIG_SYSFS=y
840# CONFIG_TMPFS is not set 858# CONFIG_TMPFS is not set
841# CONFIG_HUGETLB_PAGE is not set 859# CONFIG_HUGETLB_PAGE is not set
842CONFIG_RAMFS=y 860CONFIG_RAMFS=y
843CONFIG_RELAYFS_FS=m
844# CONFIG_CONFIGFS_FS is not set 861# CONFIG_CONFIGFS_FS is not set
845 862
846# 863#
@@ -922,6 +939,7 @@ CONFIG_SGI_PARTITION=y
922# CONFIG_MAGIC_SYSRQ is not set 939# CONFIG_MAGIC_SYSRQ is not set
923# CONFIG_DEBUG_KERNEL is not set 940# CONFIG_DEBUG_KERNEL is not set
924CONFIG_LOG_BUF_SHIFT=15 941CONFIG_LOG_BUF_SHIFT=15
942# CONFIG_DEBUG_FS is not set
925CONFIG_CROSSCOMPILE=y 943CONFIG_CROSSCOMPILE=y
926CONFIG_CMDLINE="" 944CONFIG_CMDLINE=""
927 945
diff --git a/arch/mips/configs/ip32_defconfig b/arch/mips/configs/ip32_defconfig
index 7fdcaf51face..8f11d3565b2d 100644
--- a/arch/mips/configs/ip32_defconfig
+++ b/arch/mips/configs/ip32_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc1 3# Linux kernel version: 2.6.17-rc2
4# Fri Jan 27 15:40:09 2006 4# Mon Apr 24 14:51:05 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -64,6 +64,8 @@ CONFIG_SGI_IP32=y
64# CONFIG_TOSHIBA_RBTX4927 is not set 64# CONFIG_TOSHIBA_RBTX4927 is not set
65# CONFIG_TOSHIBA_RBTX4938 is not set 65# CONFIG_TOSHIBA_RBTX4938 is not set
66CONFIG_RWSEM_GENERIC_SPINLOCK=y 66CONFIG_RWSEM_GENERIC_SPINLOCK=y
67CONFIG_GENERIC_FIND_NEXT_BIT=y
68CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 69CONFIG_GENERIC_CALIBRATE_DELAY=y
68CONFIG_ARC=y 70CONFIG_ARC=y
69CONFIG_DMA_IP32=y 71CONFIG_DMA_IP32=y
@@ -142,7 +144,6 @@ CONFIG_PREEMPT_VOLUNTARY=y
142# Code maturity level options 144# Code maturity level options
143# 145#
144CONFIG_EXPERIMENTAL=y 146CONFIG_EXPERIMENTAL=y
145CONFIG_CLEAN_COMPILE=y
146CONFIG_BROKEN_ON_SMP=y 147CONFIG_BROKEN_ON_SMP=y
147CONFIG_INIT_ENV_ARG_LIMIT=32 148CONFIG_INIT_ENV_ARG_LIMIT=32
148 149
@@ -159,6 +160,7 @@ CONFIG_BSD_PROCESS_ACCT=y
159CONFIG_SYSCTL=y 160CONFIG_SYSCTL=y
160# CONFIG_AUDIT is not set 161# CONFIG_AUDIT is not set
161# CONFIG_IKCONFIG is not set 162# CONFIG_IKCONFIG is not set
163CONFIG_RELAY=y
162CONFIG_INITRAMFS_SOURCE="" 164CONFIG_INITRAMFS_SOURCE=""
163# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 165# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
164CONFIG_EMBEDDED=y 166CONFIG_EMBEDDED=y
@@ -172,10 +174,6 @@ CONFIG_BASE_FULL=y
172CONFIG_FUTEX=y 174CONFIG_FUTEX=y
173CONFIG_EPOLL=y 175CONFIG_EPOLL=y
174CONFIG_SHMEM=y 176CONFIG_SHMEM=y
175CONFIG_CC_ALIGN_FUNCTIONS=0
176CONFIG_CC_ALIGN_LABELS=0
177CONFIG_CC_ALIGN_LOOPS=0
178CONFIG_CC_ALIGN_JUMPS=0
179CONFIG_SLAB=y 177CONFIG_SLAB=y
180# CONFIG_TINY_SHMEM is not set 178# CONFIG_TINY_SHMEM is not set
181CONFIG_BASE_SMALL=0 179CONFIG_BASE_SMALL=0
@@ -189,6 +187,7 @@ CONFIG_BASE_SMALL=0
189# 187#
190# Block layer 188# Block layer
191# 189#
190# CONFIG_BLK_DEV_IO_TRACE is not set
192 191
193# 192#
194# IO Schedulers 193# IO Schedulers
@@ -208,7 +207,6 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
208# 207#
209CONFIG_HW_HAS_PCI=y 208CONFIG_HW_HAS_PCI=y
210CONFIG_PCI=y 209CONFIG_PCI=y
211CONFIG_PCI_LEGACY_PROC=y
212CONFIG_MMU=y 210CONFIG_MMU=y
213 211
214# 212#
@@ -226,6 +224,7 @@ CONFIG_MMU=y
226# 224#
227CONFIG_BINFMT_ELF=y 225CONFIG_BINFMT_ELF=y
228CONFIG_BINFMT_MISC=y 226CONFIG_BINFMT_MISC=y
227# CONFIG_BUILD_ELF64 is not set
229CONFIG_MIPS32_COMPAT=y 228CONFIG_MIPS32_COMPAT=y
230CONFIG_COMPAT=y 229CONFIG_COMPAT=y
231CONFIG_MIPS32_O32=y 230CONFIG_MIPS32_O32=y
@@ -240,6 +239,7 @@ CONFIG_NET=y
240# 239#
241# Networking options 240# Networking options
242# 241#
242# CONFIG_NETDEBUG is not set
243CONFIG_PACKET=y 243CONFIG_PACKET=y
244CONFIG_PACKET_MMAP=y 244CONFIG_PACKET_MMAP=y
245CONFIG_UNIX=y 245CONFIG_UNIX=y
@@ -261,12 +261,15 @@ CONFIG_IP_PNP_BOOTP=y
261# CONFIG_INET_AH is not set 261# CONFIG_INET_AH is not set
262# CONFIG_INET_ESP is not set 262# CONFIG_INET_ESP is not set
263# CONFIG_INET_IPCOMP is not set 263# CONFIG_INET_IPCOMP is not set
264CONFIG_INET_TUNNEL=y 264# CONFIG_INET_XFRM_TUNNEL is not set
265# CONFIG_INET_TUNNEL is not set
265CONFIG_INET_DIAG=y 266CONFIG_INET_DIAG=y
266CONFIG_INET_TCP_DIAG=y 267CONFIG_INET_TCP_DIAG=y
267# CONFIG_TCP_CONG_ADVANCED is not set 268# CONFIG_TCP_CONG_ADVANCED is not set
268CONFIG_TCP_CONG_BIC=y 269CONFIG_TCP_CONG_BIC=y
269# CONFIG_IPV6 is not set 270# CONFIG_IPV6 is not set
271# CONFIG_INET6_XFRM_TUNNEL is not set
272# CONFIG_INET6_TUNNEL is not set
270# CONFIG_NETFILTER is not set 273# CONFIG_NETFILTER is not set
271 274
272# 275#
@@ -278,6 +281,11 @@ CONFIG_TCP_CONG_BIC=y
278# SCTP Configuration (EXPERIMENTAL) 281# SCTP Configuration (EXPERIMENTAL)
279# 282#
280# CONFIG_IP_SCTP is not set 283# CONFIG_IP_SCTP is not set
284
285#
286# TIPC Configuration (EXPERIMENTAL)
287#
288# CONFIG_TIPC is not set
281# CONFIG_ATM is not set 289# CONFIG_ATM is not set
282# CONFIG_BRIDGE is not set 290# CONFIG_BRIDGE is not set
283# CONFIG_VLAN_8021Q is not set 291# CONFIG_VLAN_8021Q is not set
@@ -287,11 +295,6 @@ CONFIG_TCP_CONG_BIC=y
287# CONFIG_ATALK is not set 295# CONFIG_ATALK is not set
288# CONFIG_X25 is not set 296# CONFIG_X25 is not set
289# CONFIG_LAPB is not set 297# CONFIG_LAPB is not set
290
291#
292# TIPC Configuration (EXPERIMENTAL)
293#
294# CONFIG_TIPC is not set
295# CONFIG_NET_DIVERT is not set 298# CONFIG_NET_DIVERT is not set
296# CONFIG_ECONET is not set 299# CONFIG_ECONET is not set
297# CONFIG_WAN_ROUTER is not set 300# CONFIG_WAN_ROUTER is not set
@@ -312,6 +315,9 @@ CONFIG_IEEE80211=y
312# CONFIG_IEEE80211_DEBUG is not set 315# CONFIG_IEEE80211_DEBUG is not set
313CONFIG_IEEE80211_CRYPT_WEP=y 316CONFIG_IEEE80211_CRYPT_WEP=y
314CONFIG_IEEE80211_CRYPT_CCMP=y 317CONFIG_IEEE80211_CRYPT_CCMP=y
318CONFIG_IEEE80211_SOFTMAC=y
319# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
320CONFIG_WIRELESS_EXT=y
315 321
316# 322#
317# Device Drivers 323# Device Drivers
@@ -357,7 +363,7 @@ CONFIG_BLK_DEV_LOOP=y
357# CONFIG_BLK_DEV_NBD is not set 363# CONFIG_BLK_DEV_NBD is not set
358# CONFIG_BLK_DEV_SX8 is not set 364# CONFIG_BLK_DEV_SX8 is not set
359# CONFIG_BLK_DEV_RAM is not set 365# CONFIG_BLK_DEV_RAM is not set
360CONFIG_BLK_DEV_RAM_COUNT=16 366# CONFIG_BLK_DEV_INITRD is not set
361CONFIG_CDROM_PKTCDVD=y 367CONFIG_CDROM_PKTCDVD=y
362CONFIG_CDROM_PKTCDVD_BUFFERS=8 368CONFIG_CDROM_PKTCDVD_BUFFERS=8
363# CONFIG_CDROM_PKTCDVD_WCACHE is not set 369# CONFIG_CDROM_PKTCDVD_WCACHE is not set
@@ -428,7 +434,6 @@ CONFIG_AIC7XXX_REG_PRETTY_PRINT=y
428# CONFIG_SCSI_INIA100 is not set 434# CONFIG_SCSI_INIA100 is not set
429# CONFIG_SCSI_SYM53C8XX_2 is not set 435# CONFIG_SCSI_SYM53C8XX_2 is not set
430# CONFIG_SCSI_IPR is not set 436# CONFIG_SCSI_IPR is not set
431# CONFIG_SCSI_QLOGIC_FC is not set
432# CONFIG_SCSI_QLOGIC_1280 is not set 437# CONFIG_SCSI_QLOGIC_1280 is not set
433# CONFIG_SCSI_QLA_FC is not set 438# CONFIG_SCSI_QLA_FC is not set
434# CONFIG_SCSI_LPFC is not set 439# CONFIG_SCSI_LPFC is not set
@@ -615,6 +620,7 @@ CONFIG_HW_CONSOLE=y
615# 620#
616CONFIG_SERIAL_8250=y 621CONFIG_SERIAL_8250=y
617CONFIG_SERIAL_8250_CONSOLE=y 622CONFIG_SERIAL_8250_CONSOLE=y
623CONFIG_SERIAL_8250_PCI=y
618CONFIG_SERIAL_8250_NR_UARTS=4 624CONFIG_SERIAL_8250_NR_UARTS=4
619CONFIG_SERIAL_8250_RUNTIME_UARTS=4 625CONFIG_SERIAL_8250_RUNTIME_UARTS=4
620# CONFIG_SERIAL_8250_EXTENDED is not set 626# CONFIG_SERIAL_8250_EXTENDED is not set
@@ -624,6 +630,7 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=4
624# 630#
625CONFIG_SERIAL_CORE=y 631CONFIG_SERIAL_CORE=y
626CONFIG_SERIAL_CORE_CONSOLE=y 632CONFIG_SERIAL_CORE_CONSOLE=y
633# CONFIG_SERIAL_JSM is not set
627CONFIG_UNIX98_PTYS=y 634CONFIG_UNIX98_PTYS=y
628CONFIG_LEGACY_PTYS=y 635CONFIG_LEGACY_PTYS=y
629CONFIG_LEGACY_PTY_COUNT=256 636CONFIG_LEGACY_PTY_COUNT=256
@@ -682,10 +689,6 @@ CONFIG_LEGACY_PTY_COUNT=256
682# 689#
683 690
684# 691#
685# Multimedia Capabilities Port drivers
686#
687
688#
689# Multimedia devices 692# Multimedia devices
690# 693#
691# CONFIG_VIDEO_DEV is not set 694# CONFIG_VIDEO_DEV is not set
@@ -716,6 +719,7 @@ CONFIG_DUMMY_CONSOLE=y
716# 719#
717CONFIG_USB_ARCH_HAS_HCD=y 720CONFIG_USB_ARCH_HAS_HCD=y
718CONFIG_USB_ARCH_HAS_OHCI=y 721CONFIG_USB_ARCH_HAS_OHCI=y
722CONFIG_USB_ARCH_HAS_EHCI=y
719# CONFIG_USB is not set 723# CONFIG_USB is not set
720 724
721# 725#
@@ -733,13 +737,31 @@ CONFIG_USB_ARCH_HAS_OHCI=y
733# CONFIG_MMC is not set 737# CONFIG_MMC is not set
734 738
735# 739#
740# LED devices
741#
742# CONFIG_NEW_LEDS is not set
743
744#
745# LED drivers
746#
747
748#
749# LED Triggers
750#
751
752#
736# InfiniBand support 753# InfiniBand support
737# 754#
738# CONFIG_INFINIBAND is not set 755# CONFIG_INFINIBAND is not set
739 756
740# 757#
741# SN Devices 758# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
759#
760
761#
762# Real Time Clock
742# 763#
764# CONFIG_RTC_CLASS is not set
743 765
744# 766#
745# File systems 767# File systems
@@ -784,7 +806,6 @@ CONFIG_SYSFS=y
784CONFIG_TMPFS=y 806CONFIG_TMPFS=y
785# CONFIG_HUGETLB_PAGE is not set 807# CONFIG_HUGETLB_PAGE is not set
786CONFIG_RAMFS=y 808CONFIG_RAMFS=y
787CONFIG_RELAYFS_FS=y
788# CONFIG_CONFIGFS_FS is not set 809# CONFIG_CONFIGFS_FS is not set
789 810
790# 811#
@@ -861,6 +882,8 @@ CONFIG_SGI_PARTITION=y
861# CONFIG_MAGIC_SYSRQ is not set 882# CONFIG_MAGIC_SYSRQ is not set
862# CONFIG_DEBUG_KERNEL is not set 883# CONFIG_DEBUG_KERNEL is not set
863CONFIG_LOG_BUF_SHIFT=14 884CONFIG_LOG_BUF_SHIFT=14
885# CONFIG_DEBUG_FS is not set
886# CONFIG_UNWIND_INFO is not set
864CONFIG_CROSSCOMPILE=y 887CONFIG_CROSSCOMPILE=y
865CONFIG_CMDLINE="" 888CONFIG_CMDLINE=""
866 889
diff --git a/arch/mips/configs/it8172_defconfig b/arch/mips/configs/it8172_defconfig
index c716996d9eca..757adf23853d 100644
--- a/arch/mips/configs/it8172_defconfig
+++ b/arch/mips/configs/it8172_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc1 3# Linux kernel version: 2.6.17-rc2
4# Fri Jan 27 15:40:10 2006 4# Mon Apr 24 14:51:05 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -65,6 +65,8 @@ CONFIG_MIPS_ITE8172=y
65# CONFIG_TOSHIBA_RBTX4938 is not set 65# CONFIG_TOSHIBA_RBTX4938 is not set
66# CONFIG_IT8172_REVC is not set 66# CONFIG_IT8172_REVC is not set
67CONFIG_RWSEM_GENERIC_SPINLOCK=y 67CONFIG_RWSEM_GENERIC_SPINLOCK=y
68CONFIG_GENERIC_FIND_NEXT_BIT=y
69CONFIG_GENERIC_HWEIGHT=y
68CONFIG_GENERIC_CALIBRATE_DELAY=y 70CONFIG_GENERIC_CALIBRATE_DELAY=y
69CONFIG_DMA_NONCOHERENT=y 71CONFIG_DMA_NONCOHERENT=y
70CONFIG_DMA_NEED_PCI_MAP_STATE=y 72CONFIG_DMA_NEED_PCI_MAP_STATE=y
@@ -115,7 +117,6 @@ CONFIG_PAGE_SIZE_4KB=y
115# CONFIG_PAGE_SIZE_16KB is not set 117# CONFIG_PAGE_SIZE_16KB is not set
116# CONFIG_PAGE_SIZE_64KB is not set 118# CONFIG_PAGE_SIZE_64KB is not set
117# CONFIG_MIPS_MT is not set 119# CONFIG_MIPS_MT is not set
118# CONFIG_CPU_ADVANCED is not set
119CONFIG_CPU_HAS_LLSC=y 120CONFIG_CPU_HAS_LLSC=y
120CONFIG_CPU_HAS_SYNC=y 121CONFIG_CPU_HAS_SYNC=y
121CONFIG_GENERIC_HARDIRQS=y 122CONFIG_GENERIC_HARDIRQS=y
@@ -137,7 +138,6 @@ CONFIG_PREEMPT_NONE=y
137# Code maturity level options 138# Code maturity level options
138# 139#
139CONFIG_EXPERIMENTAL=y 140CONFIG_EXPERIMENTAL=y
140CONFIG_CLEAN_COMPILE=y
141CONFIG_BROKEN_ON_SMP=y 141CONFIG_BROKEN_ON_SMP=y
142CONFIG_INIT_ENV_ARG_LIMIT=32 142CONFIG_INIT_ENV_ARG_LIMIT=32
143 143
@@ -154,6 +154,7 @@ CONFIG_BSD_PROCESS_ACCT=y
154CONFIG_SYSCTL=y 154CONFIG_SYSCTL=y
155# CONFIG_AUDIT is not set 155# CONFIG_AUDIT is not set
156# CONFIG_IKCONFIG is not set 156# CONFIG_IKCONFIG is not set
157CONFIG_RELAY=y
157CONFIG_INITRAMFS_SOURCE="" 158CONFIG_INITRAMFS_SOURCE=""
158# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 159# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
159CONFIG_EMBEDDED=y 160CONFIG_EMBEDDED=y
@@ -167,10 +168,6 @@ CONFIG_BASE_FULL=y
167CONFIG_FUTEX=y 168CONFIG_FUTEX=y
168CONFIG_EPOLL=y 169CONFIG_EPOLL=y
169CONFIG_SHMEM=y 170CONFIG_SHMEM=y
170CONFIG_CC_ALIGN_FUNCTIONS=0
171CONFIG_CC_ALIGN_LABELS=0
172CONFIG_CC_ALIGN_LOOPS=0
173CONFIG_CC_ALIGN_JUMPS=0
174CONFIG_SLAB=y 171CONFIG_SLAB=y
175# CONFIG_TINY_SHMEM is not set 172# CONFIG_TINY_SHMEM is not set
176CONFIG_BASE_SMALL=0 173CONFIG_BASE_SMALL=0
@@ -183,7 +180,6 @@ CONFIG_OBSOLETE_INTERMODULE=y
183CONFIG_MODULES=y 180CONFIG_MODULES=y
184CONFIG_MODULE_UNLOAD=y 181CONFIG_MODULE_UNLOAD=y
185# CONFIG_MODULE_FORCE_UNLOAD is not set 182# CONFIG_MODULE_FORCE_UNLOAD is not set
186CONFIG_OBSOLETE_MODPARM=y
187CONFIG_MODVERSIONS=y 183CONFIG_MODVERSIONS=y
188CONFIG_MODULE_SRCVERSION_ALL=y 184CONFIG_MODULE_SRCVERSION_ALL=y
189CONFIG_KMOD=y 185CONFIG_KMOD=y
@@ -192,6 +188,8 @@ CONFIG_KMOD=y
192# Block layer 188# Block layer
193# 189#
194# CONFIG_LBD is not set 190# CONFIG_LBD is not set
191# CONFIG_BLK_DEV_IO_TRACE is not set
192# CONFIG_LSF is not set
195 193
196# 194#
197# IO Schedulers 195# IO Schedulers
@@ -237,6 +235,7 @@ CONFIG_NET=y
237# 235#
238# Networking options 236# Networking options
239# 237#
238# CONFIG_NETDEBUG is not set
240CONFIG_PACKET=y 239CONFIG_PACKET=y
241CONFIG_PACKET_MMAP=y 240CONFIG_PACKET_MMAP=y
242CONFIG_UNIX=y 241CONFIG_UNIX=y
@@ -258,12 +257,15 @@ CONFIG_IP_PNP_BOOTP=y
258# CONFIG_INET_AH is not set 257# CONFIG_INET_AH is not set
259# CONFIG_INET_ESP is not set 258# CONFIG_INET_ESP is not set
260# CONFIG_INET_IPCOMP is not set 259# CONFIG_INET_IPCOMP is not set
261CONFIG_INET_TUNNEL=m 260# CONFIG_INET_XFRM_TUNNEL is not set
261# CONFIG_INET_TUNNEL is not set
262CONFIG_INET_DIAG=y 262CONFIG_INET_DIAG=y
263CONFIG_INET_TCP_DIAG=y 263CONFIG_INET_TCP_DIAG=y
264# CONFIG_TCP_CONG_ADVANCED is not set 264# CONFIG_TCP_CONG_ADVANCED is not set
265CONFIG_TCP_CONG_BIC=y 265CONFIG_TCP_CONG_BIC=y
266# CONFIG_IPV6 is not set 266# CONFIG_IPV6 is not set
267# CONFIG_INET6_XFRM_TUNNEL is not set
268# CONFIG_INET6_TUNNEL is not set
267# CONFIG_NETFILTER is not set 269# CONFIG_NETFILTER is not set
268 270
269# 271#
@@ -275,6 +277,11 @@ CONFIG_TCP_CONG_BIC=y
275# SCTP Configuration (EXPERIMENTAL) 277# SCTP Configuration (EXPERIMENTAL)
276# 278#
277# CONFIG_IP_SCTP is not set 279# CONFIG_IP_SCTP is not set
280
281#
282# TIPC Configuration (EXPERIMENTAL)
283#
284# CONFIG_TIPC is not set
278# CONFIG_ATM is not set 285# CONFIG_ATM is not set
279# CONFIG_BRIDGE is not set 286# CONFIG_BRIDGE is not set
280# CONFIG_VLAN_8021Q is not set 287# CONFIG_VLAN_8021Q is not set
@@ -284,11 +291,6 @@ CONFIG_TCP_CONG_BIC=y
284# CONFIG_ATALK is not set 291# CONFIG_ATALK is not set
285# CONFIG_X25 is not set 292# CONFIG_X25 is not set
286# CONFIG_LAPB is not set 293# CONFIG_LAPB is not set
287
288#
289# TIPC Configuration (EXPERIMENTAL)
290#
291# CONFIG_TIPC is not set
292# CONFIG_NET_DIVERT is not set 294# CONFIG_NET_DIVERT is not set
293# CONFIG_ECONET is not set 295# CONFIG_ECONET is not set
294# CONFIG_WAN_ROUTER is not set 296# CONFIG_WAN_ROUTER is not set
@@ -309,6 +311,9 @@ CONFIG_IEEE80211=m
309# CONFIG_IEEE80211_DEBUG is not set 311# CONFIG_IEEE80211_DEBUG is not set
310CONFIG_IEEE80211_CRYPT_WEP=m 312CONFIG_IEEE80211_CRYPT_WEP=m
311CONFIG_IEEE80211_CRYPT_CCMP=m 313CONFIG_IEEE80211_CRYPT_CCMP=m
314CONFIG_IEEE80211_SOFTMAC=m
315# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
316CONFIG_WIRELESS_EXT=y
312 317
313# 318#
314# Device Drivers 319# Device Drivers
@@ -387,7 +392,6 @@ CONFIG_MTD_PHYSMAP_BANKWIDTH=2
387# CONFIG_MTD_SLRAM is not set 392# CONFIG_MTD_SLRAM is not set
388# CONFIG_MTD_PHRAM is not set 393# CONFIG_MTD_PHRAM is not set
389# CONFIG_MTD_MTDRAM is not set 394# CONFIG_MTD_MTDRAM is not set
390# CONFIG_MTD_BLKMTD is not set
391# CONFIG_MTD_BLOCK2MTD is not set 395# CONFIG_MTD_BLOCK2MTD is not set
392 396
393# 397#
@@ -424,7 +428,7 @@ CONFIG_BLK_DEV_LOOP=y
424# CONFIG_BLK_DEV_CRYPTOLOOP is not set 428# CONFIG_BLK_DEV_CRYPTOLOOP is not set
425# CONFIG_BLK_DEV_NBD is not set 429# CONFIG_BLK_DEV_NBD is not set
426# CONFIG_BLK_DEV_RAM is not set 430# CONFIG_BLK_DEV_RAM is not set
427CONFIG_BLK_DEV_RAM_COUNT=16 431# CONFIG_BLK_DEV_INITRD is not set
428CONFIG_CDROM_PKTCDVD=m 432CONFIG_CDROM_PKTCDVD=m
429CONFIG_CDROM_PKTCDVD_BUFFERS=8 433CONFIG_CDROM_PKTCDVD_BUFFERS=8
430# CONFIG_CDROM_PKTCDVD_WCACHE is not set 434# CONFIG_CDROM_PKTCDVD_WCACHE is not set
@@ -666,10 +670,6 @@ CONFIG_LEGACY_PTY_COUNT=256
666# 670#
667 671
668# 672#
669# Multimedia Capabilities Port drivers
670#
671
672#
673# Multimedia devices 673# Multimedia devices
674# 674#
675# CONFIG_VIDEO_DEV is not set 675# CONFIG_VIDEO_DEV is not set
@@ -704,7 +704,6 @@ CONFIG_SOUND=y
704# Open Sound System 704# Open Sound System
705# 705#
706CONFIG_SOUND_PRIME=y 706CONFIG_SOUND_PRIME=y
707# CONFIG_OBSOLETE_OSS_DRIVER is not set
708CONFIG_SOUND_IT8172=y 707CONFIG_SOUND_IT8172=y
709# CONFIG_SOUND_MSNDCLAS is not set 708# CONFIG_SOUND_MSNDCLAS is not set
710# CONFIG_SOUND_MSNDPIN is not set 709# CONFIG_SOUND_MSNDPIN is not set
@@ -714,6 +713,7 @@ CONFIG_SOUND_IT8172=y
714# 713#
715# CONFIG_USB_ARCH_HAS_HCD is not set 714# CONFIG_USB_ARCH_HAS_HCD is not set
716# CONFIG_USB_ARCH_HAS_OHCI is not set 715# CONFIG_USB_ARCH_HAS_OHCI is not set
716# CONFIG_USB_ARCH_HAS_EHCI is not set
717 717
718# 718#
719# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 719# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
@@ -730,12 +730,30 @@ CONFIG_SOUND_IT8172=y
730# CONFIG_MMC is not set 730# CONFIG_MMC is not set
731 731
732# 732#
733# LED devices
734#
735# CONFIG_NEW_LEDS is not set
736
737#
738# LED drivers
739#
740
741#
742# LED Triggers
743#
744
745#
733# InfiniBand support 746# InfiniBand support
734# 747#
735 748
736# 749#
737# SN Devices 750# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
751#
752
753#
754# Real Time Clock
738# 755#
756# CONFIG_RTC_CLASS is not set
739 757
740# 758#
741# File systems 759# File systems
@@ -780,7 +798,6 @@ CONFIG_SYSFS=y
780# CONFIG_TMPFS is not set 798# CONFIG_TMPFS is not set
781# CONFIG_HUGETLB_PAGE is not set 799# CONFIG_HUGETLB_PAGE is not set
782CONFIG_RAMFS=y 800CONFIG_RAMFS=y
783CONFIG_RELAYFS_FS=m
784# CONFIG_CONFIGFS_FS is not set 801# CONFIG_CONFIGFS_FS is not set
785 802
786# 803#
@@ -846,6 +863,7 @@ CONFIG_MSDOS_PARTITION=y
846# CONFIG_MAGIC_SYSRQ is not set 863# CONFIG_MAGIC_SYSRQ is not set
847# CONFIG_DEBUG_KERNEL is not set 864# CONFIG_DEBUG_KERNEL is not set
848CONFIG_LOG_BUF_SHIFT=14 865CONFIG_LOG_BUF_SHIFT=14
866# CONFIG_DEBUG_FS is not set
849CONFIG_CROSSCOMPILE=y 867CONFIG_CROSSCOMPILE=y
850CONFIG_CMDLINE="" 868CONFIG_CMDLINE=""
851 869
diff --git a/arch/mips/configs/ivr_defconfig b/arch/mips/configs/ivr_defconfig
index a8376d125e11..021761a8a237 100644
--- a/arch/mips/configs/ivr_defconfig
+++ b/arch/mips/configs/ivr_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc1 3# Linux kernel version: 2.6.17-rc2
4# Fri Jan 27 15:40:11 2006 4# Mon Apr 24 14:51:06 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -64,6 +64,8 @@ CONFIG_MIPS_IVR=y
64# CONFIG_TOSHIBA_RBTX4927 is not set 64# CONFIG_TOSHIBA_RBTX4927 is not set
65# CONFIG_TOSHIBA_RBTX4938 is not set 65# CONFIG_TOSHIBA_RBTX4938 is not set
66CONFIG_RWSEM_GENERIC_SPINLOCK=y 66CONFIG_RWSEM_GENERIC_SPINLOCK=y
67CONFIG_GENERIC_FIND_NEXT_BIT=y
68CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 69CONFIG_GENERIC_CALIBRATE_DELAY=y
68CONFIG_DMA_NONCOHERENT=y 70CONFIG_DMA_NONCOHERENT=y
69CONFIG_DMA_NEED_PCI_MAP_STATE=y 71CONFIG_DMA_NEED_PCI_MAP_STATE=y
@@ -112,7 +114,6 @@ CONFIG_PAGE_SIZE_4KB=y
112# CONFIG_PAGE_SIZE_16KB is not set 114# CONFIG_PAGE_SIZE_16KB is not set
113# CONFIG_PAGE_SIZE_64KB is not set 115# CONFIG_PAGE_SIZE_64KB is not set
114# CONFIG_MIPS_MT is not set 116# CONFIG_MIPS_MT is not set
115# CONFIG_CPU_ADVANCED is not set
116CONFIG_CPU_HAS_LLSC=y 117CONFIG_CPU_HAS_LLSC=y
117CONFIG_CPU_HAS_SYNC=y 118CONFIG_CPU_HAS_SYNC=y
118CONFIG_GENERIC_HARDIRQS=y 119CONFIG_GENERIC_HARDIRQS=y
@@ -134,7 +135,6 @@ CONFIG_PREEMPT_NONE=y
134# Code maturity level options 135# Code maturity level options
135# 136#
136CONFIG_EXPERIMENTAL=y 137CONFIG_EXPERIMENTAL=y
137CONFIG_CLEAN_COMPILE=y
138CONFIG_BROKEN_ON_SMP=y 138CONFIG_BROKEN_ON_SMP=y
139CONFIG_INIT_ENV_ARG_LIMIT=32 139CONFIG_INIT_ENV_ARG_LIMIT=32
140 140
@@ -151,6 +151,7 @@ CONFIG_BSD_PROCESS_ACCT=y
151CONFIG_SYSCTL=y 151CONFIG_SYSCTL=y
152# CONFIG_AUDIT is not set 152# CONFIG_AUDIT is not set
153# CONFIG_IKCONFIG is not set 153# CONFIG_IKCONFIG is not set
154CONFIG_RELAY=y
154CONFIG_INITRAMFS_SOURCE="" 155CONFIG_INITRAMFS_SOURCE=""
155# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 156# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
156CONFIG_EMBEDDED=y 157CONFIG_EMBEDDED=y
@@ -164,10 +165,6 @@ CONFIG_BASE_FULL=y
164CONFIG_FUTEX=y 165CONFIG_FUTEX=y
165CONFIG_EPOLL=y 166CONFIG_EPOLL=y
166CONFIG_SHMEM=y 167CONFIG_SHMEM=y
167CONFIG_CC_ALIGN_FUNCTIONS=0
168CONFIG_CC_ALIGN_LABELS=0
169CONFIG_CC_ALIGN_LOOPS=0
170CONFIG_CC_ALIGN_JUMPS=0
171CONFIG_SLAB=y 168CONFIG_SLAB=y
172# CONFIG_TINY_SHMEM is not set 169# CONFIG_TINY_SHMEM is not set
173CONFIG_BASE_SMALL=0 170CONFIG_BASE_SMALL=0
@@ -179,7 +176,6 @@ CONFIG_BASE_SMALL=0
179CONFIG_MODULES=y 176CONFIG_MODULES=y
180CONFIG_MODULE_UNLOAD=y 177CONFIG_MODULE_UNLOAD=y
181# CONFIG_MODULE_FORCE_UNLOAD is not set 178# CONFIG_MODULE_FORCE_UNLOAD is not set
182CONFIG_OBSOLETE_MODPARM=y
183CONFIG_MODVERSIONS=y 179CONFIG_MODVERSIONS=y
184CONFIG_MODULE_SRCVERSION_ALL=y 180CONFIG_MODULE_SRCVERSION_ALL=y
185CONFIG_KMOD=y 181CONFIG_KMOD=y
@@ -188,6 +184,8 @@ CONFIG_KMOD=y
188# Block layer 184# Block layer
189# 185#
190# CONFIG_LBD is not set 186# CONFIG_LBD is not set
187# CONFIG_BLK_DEV_IO_TRACE is not set
188# CONFIG_LSF is not set
191 189
192# 190#
193# IO Schedulers 191# IO Schedulers
@@ -207,7 +205,6 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
207# 205#
208CONFIG_HW_HAS_PCI=y 206CONFIG_HW_HAS_PCI=y
209CONFIG_PCI=y 207CONFIG_PCI=y
210CONFIG_PCI_LEGACY_PROC=y
211CONFIG_MMU=y 208CONFIG_MMU=y
212 209
213# 210#
@@ -235,6 +232,7 @@ CONFIG_NET=y
235# 232#
236# Networking options 233# Networking options
237# 234#
235# CONFIG_NETDEBUG is not set
238CONFIG_PACKET=y 236CONFIG_PACKET=y
239CONFIG_PACKET_MMAP=y 237CONFIG_PACKET_MMAP=y
240CONFIG_UNIX=y 238CONFIG_UNIX=y
@@ -256,12 +254,15 @@ CONFIG_IP_PNP_BOOTP=y
256# CONFIG_INET_AH is not set 254# CONFIG_INET_AH is not set
257# CONFIG_INET_ESP is not set 255# CONFIG_INET_ESP is not set
258# CONFIG_INET_IPCOMP is not set 256# CONFIG_INET_IPCOMP is not set
259CONFIG_INET_TUNNEL=m 257# CONFIG_INET_XFRM_TUNNEL is not set
258# CONFIG_INET_TUNNEL is not set
260CONFIG_INET_DIAG=y 259CONFIG_INET_DIAG=y
261CONFIG_INET_TCP_DIAG=y 260CONFIG_INET_TCP_DIAG=y
262# CONFIG_TCP_CONG_ADVANCED is not set 261# CONFIG_TCP_CONG_ADVANCED is not set
263CONFIG_TCP_CONG_BIC=y 262CONFIG_TCP_CONG_BIC=y
264# CONFIG_IPV6 is not set 263# CONFIG_IPV6 is not set
264# CONFIG_INET6_XFRM_TUNNEL is not set
265# CONFIG_INET6_TUNNEL is not set
265# CONFIG_NETFILTER is not set 266# CONFIG_NETFILTER is not set
266 267
267# 268#
@@ -273,6 +274,11 @@ CONFIG_TCP_CONG_BIC=y
273# SCTP Configuration (EXPERIMENTAL) 274# SCTP Configuration (EXPERIMENTAL)
274# 275#
275# CONFIG_IP_SCTP is not set 276# CONFIG_IP_SCTP is not set
277
278#
279# TIPC Configuration (EXPERIMENTAL)
280#
281# CONFIG_TIPC is not set
276# CONFIG_ATM is not set 282# CONFIG_ATM is not set
277# CONFIG_BRIDGE is not set 283# CONFIG_BRIDGE is not set
278# CONFIG_VLAN_8021Q is not set 284# CONFIG_VLAN_8021Q is not set
@@ -282,11 +288,6 @@ CONFIG_TCP_CONG_BIC=y
282# CONFIG_ATALK is not set 288# CONFIG_ATALK is not set
283# CONFIG_X25 is not set 289# CONFIG_X25 is not set
284# CONFIG_LAPB is not set 290# CONFIG_LAPB is not set
285
286#
287# TIPC Configuration (EXPERIMENTAL)
288#
289# CONFIG_TIPC is not set
290# CONFIG_NET_DIVERT is not set 291# CONFIG_NET_DIVERT is not set
291# CONFIG_ECONET is not set 292# CONFIG_ECONET is not set
292# CONFIG_WAN_ROUTER is not set 293# CONFIG_WAN_ROUTER is not set
@@ -307,6 +308,9 @@ CONFIG_IEEE80211=m
307# CONFIG_IEEE80211_DEBUG is not set 308# CONFIG_IEEE80211_DEBUG is not set
308CONFIG_IEEE80211_CRYPT_WEP=m 309CONFIG_IEEE80211_CRYPT_WEP=m
309CONFIG_IEEE80211_CRYPT_CCMP=m 310CONFIG_IEEE80211_CRYPT_CCMP=m
311CONFIG_IEEE80211_SOFTMAC=m
312# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
313CONFIG_WIRELESS_EXT=y
310 314
311# 315#
312# Device Drivers 316# Device Drivers
@@ -350,7 +354,7 @@ CONFIG_CONNECTOR=m
350# CONFIG_BLK_DEV_NBD is not set 354# CONFIG_BLK_DEV_NBD is not set
351# CONFIG_BLK_DEV_SX8 is not set 355# CONFIG_BLK_DEV_SX8 is not set
352# CONFIG_BLK_DEV_RAM is not set 356# CONFIG_BLK_DEV_RAM is not set
353CONFIG_BLK_DEV_RAM_COUNT=16 357# CONFIG_BLK_DEV_INITRD is not set
354CONFIG_CDROM_PKTCDVD=m 358CONFIG_CDROM_PKTCDVD=m
355CONFIG_CDROM_PKTCDVD_BUFFERS=8 359CONFIG_CDROM_PKTCDVD_BUFFERS=8
356# CONFIG_CDROM_PKTCDVD_WCACHE is not set 360# CONFIG_CDROM_PKTCDVD_WCACHE is not set
@@ -565,6 +569,7 @@ CONFIG_IT8172_SCR1=y
565# 569#
566CONFIG_SERIAL_8250=y 570CONFIG_SERIAL_8250=y
567CONFIG_SERIAL_8250_CONSOLE=y 571CONFIG_SERIAL_8250_CONSOLE=y
572CONFIG_SERIAL_8250_PCI=y
568CONFIG_SERIAL_8250_NR_UARTS=4 573CONFIG_SERIAL_8250_NR_UARTS=4
569CONFIG_SERIAL_8250_RUNTIME_UARTS=4 574CONFIG_SERIAL_8250_RUNTIME_UARTS=4
570# CONFIG_SERIAL_8250_EXTENDED is not set 575# CONFIG_SERIAL_8250_EXTENDED is not set
@@ -574,6 +579,7 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=4
574# 579#
575CONFIG_SERIAL_CORE=y 580CONFIG_SERIAL_CORE=y
576CONFIG_SERIAL_CORE_CONSOLE=y 581CONFIG_SERIAL_CORE_CONSOLE=y
582# CONFIG_SERIAL_JSM is not set
577CONFIG_UNIX98_PTYS=y 583CONFIG_UNIX98_PTYS=y
578CONFIG_LEGACY_PTYS=y 584CONFIG_LEGACY_PTYS=y
579CONFIG_LEGACY_PTY_COUNT=256 585CONFIG_LEGACY_PTY_COUNT=256
@@ -631,10 +637,6 @@ CONFIG_RTC=y
631# 637#
632 638
633# 639#
634# Multimedia Capabilities Port drivers
635#
636
637#
638# Multimedia devices 640# Multimedia devices
639# 641#
640# CONFIG_VIDEO_DEV is not set 642# CONFIG_VIDEO_DEV is not set
@@ -665,6 +667,7 @@ CONFIG_DUMMY_CONSOLE=y
665# 667#
666CONFIG_USB_ARCH_HAS_HCD=y 668CONFIG_USB_ARCH_HAS_HCD=y
667CONFIG_USB_ARCH_HAS_OHCI=y 669CONFIG_USB_ARCH_HAS_OHCI=y
670CONFIG_USB_ARCH_HAS_EHCI=y
668# CONFIG_USB is not set 671# CONFIG_USB is not set
669 672
670# 673#
@@ -682,13 +685,31 @@ CONFIG_USB_ARCH_HAS_OHCI=y
682# CONFIG_MMC is not set 685# CONFIG_MMC is not set
683 686
684# 687#
688# LED devices
689#
690# CONFIG_NEW_LEDS is not set
691
692#
693# LED drivers
694#
695
696#
697# LED Triggers
698#
699
700#
685# InfiniBand support 701# InfiniBand support
686# 702#
687# CONFIG_INFINIBAND is not set 703# CONFIG_INFINIBAND is not set
688 704
689# 705#
690# SN Devices 706# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
707#
708
709#
710# Real Time Clock
691# 711#
712# CONFIG_RTC_CLASS is not set
692 713
693# 714#
694# File systems 715# File systems
@@ -733,7 +754,6 @@ CONFIG_SYSFS=y
733# CONFIG_TMPFS is not set 754# CONFIG_TMPFS is not set
734# CONFIG_HUGETLB_PAGE is not set 755# CONFIG_HUGETLB_PAGE is not set
735CONFIG_RAMFS=y 756CONFIG_RAMFS=y
736CONFIG_RELAYFS_FS=m
737# CONFIG_CONFIGFS_FS is not set 757# CONFIG_CONFIGFS_FS is not set
738 758
739# 759#
@@ -797,6 +817,7 @@ CONFIG_MSDOS_PARTITION=y
797# CONFIG_MAGIC_SYSRQ is not set 817# CONFIG_MAGIC_SYSRQ is not set
798# CONFIG_DEBUG_KERNEL is not set 818# CONFIG_DEBUG_KERNEL is not set
799CONFIG_LOG_BUF_SHIFT=14 819CONFIG_LOG_BUF_SHIFT=14
820# CONFIG_DEBUG_FS is not set
800CONFIG_CROSSCOMPILE=y 821CONFIG_CROSSCOMPILE=y
801CONFIG_CMDLINE="" 822CONFIG_CMDLINE=""
802 823
diff --git a/arch/mips/configs/jaguar-atx_defconfig b/arch/mips/configs/jaguar-atx_defconfig
index 316015379dbc..08f6c30b0abc 100644
--- a/arch/mips/configs/jaguar-atx_defconfig
+++ b/arch/mips/configs/jaguar-atx_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc1 3# Linux kernel version: 2.6.17-rc2
4# Fri Jan 27 15:40:12 2006 4# Mon Apr 24 14:51:06 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -65,6 +65,8 @@ CONFIG_MOMENCO_JAGUAR_ATX=y
65# CONFIG_TOSHIBA_RBTX4938 is not set 65# CONFIG_TOSHIBA_RBTX4938 is not set
66CONFIG_JAGUAR_DMALOW=y 66CONFIG_JAGUAR_DMALOW=y
67CONFIG_RWSEM_GENERIC_SPINLOCK=y 67CONFIG_RWSEM_GENERIC_SPINLOCK=y
68CONFIG_GENERIC_FIND_NEXT_BIT=y
69CONFIG_GENERIC_HWEIGHT=y
68CONFIG_GENERIC_CALIBRATE_DELAY=y 70CONFIG_GENERIC_CALIBRATE_DELAY=y
69CONFIG_DMA_NONCOHERENT=y 71CONFIG_DMA_NONCOHERENT=y
70CONFIG_DMA_NEED_PCI_MAP_STATE=y 72CONFIG_DMA_NEED_PCI_MAP_STATE=y
@@ -122,7 +124,6 @@ CONFIG_RM7000_CPU_SCACHE=y
122CONFIG_CPU_HAS_PREFETCH=y 124CONFIG_CPU_HAS_PREFETCH=y
123# CONFIG_MIPS_MT is not set 125# CONFIG_MIPS_MT is not set
124# CONFIG_64BIT_PHYS_ADDR is not set 126# CONFIG_64BIT_PHYS_ADDR is not set
125# CONFIG_CPU_ADVANCED is not set
126CONFIG_CPU_HAS_LLSC=y 127CONFIG_CPU_HAS_LLSC=y
127CONFIG_CPU_HAS_SYNC=y 128CONFIG_CPU_HAS_SYNC=y
128CONFIG_GENERIC_HARDIRQS=y 129CONFIG_GENERIC_HARDIRQS=y
@@ -144,7 +145,6 @@ CONFIG_PREEMPT_NONE=y
144# Code maturity level options 145# Code maturity level options
145# 146#
146# CONFIG_EXPERIMENTAL is not set 147# CONFIG_EXPERIMENTAL is not set
147CONFIG_CLEAN_COMPILE=y
148CONFIG_BROKEN_ON_SMP=y 148CONFIG_BROKEN_ON_SMP=y
149CONFIG_INIT_ENV_ARG_LIMIT=32 149CONFIG_INIT_ENV_ARG_LIMIT=32
150 150
@@ -160,6 +160,7 @@ CONFIG_SYSCTL=y
160# CONFIG_AUDIT is not set 160# CONFIG_AUDIT is not set
161CONFIG_IKCONFIG=y 161CONFIG_IKCONFIG=y
162CONFIG_IKCONFIG_PROC=y 162CONFIG_IKCONFIG_PROC=y
163CONFIG_RELAY=y
163CONFIG_INITRAMFS_SOURCE="" 164CONFIG_INITRAMFS_SOURCE=""
164CONFIG_EMBEDDED=y 165CONFIG_EMBEDDED=y
165CONFIG_KALLSYMS=y 166CONFIG_KALLSYMS=y
@@ -172,10 +173,6 @@ CONFIG_BASE_FULL=y
172CONFIG_FUTEX=y 173CONFIG_FUTEX=y
173CONFIG_EPOLL=y 174CONFIG_EPOLL=y
174CONFIG_SHMEM=y 175CONFIG_SHMEM=y
175CONFIG_CC_ALIGN_FUNCTIONS=0
176CONFIG_CC_ALIGN_LABELS=0
177CONFIG_CC_ALIGN_LOOPS=0
178CONFIG_CC_ALIGN_JUMPS=0
179CONFIG_SLAB=y 176CONFIG_SLAB=y
180# CONFIG_TINY_SHMEM is not set 177# CONFIG_TINY_SHMEM is not set
181CONFIG_BASE_SMALL=0 178CONFIG_BASE_SMALL=0
@@ -186,7 +183,6 @@ CONFIG_BASE_SMALL=0
186# 183#
187CONFIG_MODULES=y 184CONFIG_MODULES=y
188CONFIG_MODULE_UNLOAD=y 185CONFIG_MODULE_UNLOAD=y
189CONFIG_OBSOLETE_MODPARM=y
190# CONFIG_MODVERSIONS is not set 186# CONFIG_MODVERSIONS is not set
191CONFIG_MODULE_SRCVERSION_ALL=y 187CONFIG_MODULE_SRCVERSION_ALL=y
192CONFIG_KMOD=y 188CONFIG_KMOD=y
@@ -195,6 +191,8 @@ CONFIG_KMOD=y
195# Block layer 191# Block layer
196# 192#
197# CONFIG_LBD is not set 193# CONFIG_LBD is not set
194# CONFIG_BLK_DEV_IO_TRACE is not set
195# CONFIG_LSF is not set
198 196
199# 197#
200# IO Schedulers 198# IO Schedulers
@@ -214,7 +212,6 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
214# 212#
215CONFIG_HW_HAS_PCI=y 213CONFIG_HW_HAS_PCI=y
216CONFIG_PCI=y 214CONFIG_PCI=y
217CONFIG_PCI_LEGACY_PROC=y
218CONFIG_MMU=y 215CONFIG_MMU=y
219 216
220# 217#
@@ -241,6 +238,7 @@ CONFIG_NET=y
241# 238#
242# Networking options 239# Networking options
243# 240#
241# CONFIG_NETDEBUG is not set
244# CONFIG_PACKET is not set 242# CONFIG_PACKET is not set
245CONFIG_UNIX=y 243CONFIG_UNIX=y
246CONFIG_XFRM=y 244CONFIG_XFRM=y
@@ -260,16 +258,19 @@ CONFIG_IP_PNP_BOOTP=y
260# CONFIG_INET_AH is not set 258# CONFIG_INET_AH is not set
261# CONFIG_INET_ESP is not set 259# CONFIG_INET_ESP is not set
262# CONFIG_INET_IPCOMP is not set 260# CONFIG_INET_IPCOMP is not set
263CONFIG_INET_TUNNEL=m 261# CONFIG_INET_XFRM_TUNNEL is not set
262# CONFIG_INET_TUNNEL is not set
264CONFIG_INET_DIAG=y 263CONFIG_INET_DIAG=y
265CONFIG_INET_TCP_DIAG=y 264CONFIG_INET_TCP_DIAG=y
266# CONFIG_TCP_CONG_ADVANCED is not set 265# CONFIG_TCP_CONG_ADVANCED is not set
267CONFIG_TCP_CONG_BIC=y 266CONFIG_TCP_CONG_BIC=y
268CONFIG_IPV6=m 267CONFIG_IPV6=m
269CONFIG_IPV6_PRIVACY=y 268CONFIG_IPV6_PRIVACY=y
269CONFIG_IPV6_ROUTER_PREF=y
270CONFIG_INET6_AH=m 270CONFIG_INET6_AH=m
271CONFIG_INET6_ESP=m 271CONFIG_INET6_ESP=m
272CONFIG_INET6_IPCOMP=m 272CONFIG_INET6_IPCOMP=m
273CONFIG_INET6_XFRM_TUNNEL=m
273CONFIG_INET6_TUNNEL=m 274CONFIG_INET6_TUNNEL=m
274CONFIG_IPV6_TUNNEL=m 275CONFIG_IPV6_TUNNEL=m
275# CONFIG_NETFILTER is not set 276# CONFIG_NETFILTER is not set
@@ -338,10 +339,9 @@ CONFIG_CONNECTOR=m
338# CONFIG_BLK_DEV_NBD is not set 339# CONFIG_BLK_DEV_NBD is not set
339# CONFIG_BLK_DEV_SX8 is not set 340# CONFIG_BLK_DEV_SX8 is not set
340# CONFIG_BLK_DEV_RAM is not set 341# CONFIG_BLK_DEV_RAM is not set
341CONFIG_BLK_DEV_RAM_COUNT=16 342# CONFIG_BLK_DEV_INITRD is not set
342CONFIG_CDROM_PKTCDVD=m 343CONFIG_CDROM_PKTCDVD=m
343CONFIG_CDROM_PKTCDVD_BUFFERS=8 344CONFIG_CDROM_PKTCDVD_BUFFERS=8
344# CONFIG_CDROM_PKTCDVD_WCACHE is not set
345CONFIG_ATA_OVER_ETH=m 345CONFIG_ATA_OVER_ETH=m
346 346
347# 347#
@@ -423,6 +423,7 @@ CONFIG_NET_PCI=y
423# CONFIG_PCNET32 is not set 423# CONFIG_PCNET32 is not set
424# CONFIG_AMD8111_ETH is not set 424# CONFIG_AMD8111_ETH is not set
425# CONFIG_ADAPTEC_STARFIRE is not set 425# CONFIG_ADAPTEC_STARFIRE is not set
426# CONFIG_FORCEDETH is not set
426# CONFIG_DGRS is not set 427# CONFIG_DGRS is not set
427CONFIG_EEPRO100=y 428CONFIG_EEPRO100=y
428# CONFIG_E100 is not set 429# CONFIG_E100 is not set
@@ -446,6 +447,7 @@ CONFIG_EEPRO100=y
446# CONFIG_HAMACHI is not set 447# CONFIG_HAMACHI is not set
447# CONFIG_R8169 is not set 448# CONFIG_R8169 is not set
448# CONFIG_SIS190 is not set 449# CONFIG_SIS190 is not set
450# CONFIG_SKGE is not set
449# CONFIG_SK98LIN is not set 451# CONFIG_SK98LIN is not set
450# CONFIG_VIA_VELOCITY is not set 452# CONFIG_VIA_VELOCITY is not set
451# CONFIG_TIGON3 is not set 453# CONFIG_TIGON3 is not set
@@ -514,6 +516,7 @@ CONFIG_MV643XX_ETH_2=y
514# 516#
515CONFIG_SERIAL_8250=y 517CONFIG_SERIAL_8250=y
516CONFIG_SERIAL_8250_CONSOLE=y 518CONFIG_SERIAL_8250_CONSOLE=y
519CONFIG_SERIAL_8250_PCI=y
517CONFIG_SERIAL_8250_NR_UARTS=4 520CONFIG_SERIAL_8250_NR_UARTS=4
518CONFIG_SERIAL_8250_RUNTIME_UARTS=4 521CONFIG_SERIAL_8250_RUNTIME_UARTS=4
519# CONFIG_SERIAL_8250_EXTENDED is not set 522# CONFIG_SERIAL_8250_EXTENDED is not set
@@ -523,6 +526,7 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=4
523# 526#
524CONFIG_SERIAL_CORE=y 527CONFIG_SERIAL_CORE=y
525CONFIG_SERIAL_CORE_CONSOLE=y 528CONFIG_SERIAL_CORE_CONSOLE=y
529# CONFIG_SERIAL_JSM is not set
526CONFIG_UNIX98_PTYS=y 530CONFIG_UNIX98_PTYS=y
527CONFIG_LEGACY_PTYS=y 531CONFIG_LEGACY_PTYS=y
528CONFIG_LEGACY_PTY_COUNT=256 532CONFIG_LEGACY_PTY_COUNT=256
@@ -579,10 +583,6 @@ CONFIG_LEGACY_PTY_COUNT=256
579# 583#
580 584
581# 585#
582# Multimedia Capabilities Port drivers
583#
584
585#
586# Multimedia devices 586# Multimedia devices
587# 587#
588# CONFIG_VIDEO_DEV is not set 588# CONFIG_VIDEO_DEV is not set
@@ -607,6 +607,7 @@ CONFIG_LEGACY_PTY_COUNT=256
607# 607#
608CONFIG_USB_ARCH_HAS_HCD=y 608CONFIG_USB_ARCH_HAS_HCD=y
609CONFIG_USB_ARCH_HAS_OHCI=y 609CONFIG_USB_ARCH_HAS_OHCI=y
610CONFIG_USB_ARCH_HAS_EHCI=y
610# CONFIG_USB is not set 611# CONFIG_USB is not set
611 612
612# 613#
@@ -624,12 +625,29 @@ CONFIG_USB_ARCH_HAS_OHCI=y
624# CONFIG_MMC is not set 625# CONFIG_MMC is not set
625 626
626# 627#
628# LED devices
629#
630# CONFIG_NEW_LEDS is not set
631
632#
633# LED drivers
634#
635
636#
637# LED Triggers
638#
639
640#
627# InfiniBand support 641# InfiniBand support
628# 642#
629# CONFIG_INFINIBAND is not set 643# CONFIG_INFINIBAND is not set
630 644
631# 645#
632# SN Devices 646# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
647#
648
649#
650# Real Time Clock
633# 651#
634 652
635# 653#
@@ -672,7 +690,6 @@ CONFIG_SYSFS=y
672# CONFIG_TMPFS is not set 690# CONFIG_TMPFS is not set
673# CONFIG_HUGETLB_PAGE is not set 691# CONFIG_HUGETLB_PAGE is not set
674CONFIG_RAMFS=y 692CONFIG_RAMFS=y
675CONFIG_RELAYFS_FS=m
676 693
677# 694#
678# Miscellaneous filesystems 695# Miscellaneous filesystems
@@ -718,6 +735,7 @@ CONFIG_MSDOS_PARTITION=y
718# CONFIG_MAGIC_SYSRQ is not set 735# CONFIG_MAGIC_SYSRQ is not set
719# CONFIG_DEBUG_KERNEL is not set 736# CONFIG_DEBUG_KERNEL is not set
720CONFIG_LOG_BUF_SHIFT=14 737CONFIG_LOG_BUF_SHIFT=14
738# CONFIG_DEBUG_FS is not set
721CONFIG_CROSSCOMPILE=y 739CONFIG_CROSSCOMPILE=y
722CONFIG_CMDLINE="" 740CONFIG_CMDLINE=""
723 741
diff --git a/arch/mips/configs/jmr3927_defconfig b/arch/mips/configs/jmr3927_defconfig
index 53fbef1ac25d..38b1e026e10d 100644
--- a/arch/mips/configs/jmr3927_defconfig
+++ b/arch/mips/configs/jmr3927_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc1 3# Linux kernel version: 2.6.17-rc2
4# Fri Jan 27 15:40:13 2006 4# Mon Apr 24 14:51:07 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -64,6 +64,8 @@ CONFIG_TOSHIBA_JMR3927=y
64# CONFIG_TOSHIBA_RBTX4927 is not set 64# CONFIG_TOSHIBA_RBTX4927 is not set
65# CONFIG_TOSHIBA_RBTX4938 is not set 65# CONFIG_TOSHIBA_RBTX4938 is not set
66CONFIG_RWSEM_GENERIC_SPINLOCK=y 66CONFIG_RWSEM_GENERIC_SPINLOCK=y
67CONFIG_GENERIC_FIND_NEXT_BIT=y
68CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 69CONFIG_GENERIC_CALIBRATE_DELAY=y
68CONFIG_DMA_NONCOHERENT=y 70CONFIG_DMA_NONCOHERENT=y
69CONFIG_DMA_NEED_PCI_MAP_STATE=y 71CONFIG_DMA_NEED_PCI_MAP_STATE=y
@@ -111,7 +113,6 @@ CONFIG_PAGE_SIZE_4KB=y
111# CONFIG_PAGE_SIZE_16KB is not set 113# CONFIG_PAGE_SIZE_16KB is not set
112# CONFIG_PAGE_SIZE_64KB is not set 114# CONFIG_PAGE_SIZE_64KB is not set
113# CONFIG_MIPS_MT is not set 115# CONFIG_MIPS_MT is not set
114# CONFIG_CPU_ADVANCED is not set
115CONFIG_CPU_HAS_SYNC=y 116CONFIG_CPU_HAS_SYNC=y
116CONFIG_GENERIC_HARDIRQS=y 117CONFIG_GENERIC_HARDIRQS=y
117CONFIG_GENERIC_IRQ_PROBE=y 118CONFIG_GENERIC_IRQ_PROBE=y
@@ -133,7 +134,6 @@ CONFIG_RTC_DS1742=y
133# Code maturity level options 134# Code maturity level options
134# 135#
135CONFIG_EXPERIMENTAL=y 136CONFIG_EXPERIMENTAL=y
136CONFIG_CLEAN_COMPILE=y
137CONFIG_BROKEN_ON_SMP=y 137CONFIG_BROKEN_ON_SMP=y
138CONFIG_INIT_ENV_ARG_LIMIT=32 138CONFIG_INIT_ENV_ARG_LIMIT=32
139 139
@@ -149,6 +149,7 @@ CONFIG_SYSVIPC=y
149CONFIG_SYSCTL=y 149CONFIG_SYSCTL=y
150# CONFIG_AUDIT is not set 150# CONFIG_AUDIT is not set
151# CONFIG_IKCONFIG is not set 151# CONFIG_IKCONFIG is not set
152CONFIG_RELAY=y
152CONFIG_INITRAMFS_SOURCE="" 153CONFIG_INITRAMFS_SOURCE=""
153# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 154# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
154CONFIG_EMBEDDED=y 155CONFIG_EMBEDDED=y
@@ -162,10 +163,6 @@ CONFIG_BASE_FULL=y
162CONFIG_FUTEX=y 163CONFIG_FUTEX=y
163CONFIG_EPOLL=y 164CONFIG_EPOLL=y
164CONFIG_SHMEM=y 165CONFIG_SHMEM=y
165CONFIG_CC_ALIGN_FUNCTIONS=0
166CONFIG_CC_ALIGN_LABELS=0
167CONFIG_CC_ALIGN_LOOPS=0
168CONFIG_CC_ALIGN_JUMPS=0
169CONFIG_SLAB=y 166CONFIG_SLAB=y
170# CONFIG_TINY_SHMEM is not set 167# CONFIG_TINY_SHMEM is not set
171CONFIG_BASE_SMALL=0 168CONFIG_BASE_SMALL=0
@@ -180,6 +177,8 @@ CONFIG_BASE_SMALL=0
180# Block layer 177# Block layer
181# 178#
182# CONFIG_LBD is not set 179# CONFIG_LBD is not set
180# CONFIG_BLK_DEV_IO_TRACE is not set
181# CONFIG_LSF is not set
183 182
184# 183#
185# IO Schedulers 184# IO Schedulers
@@ -199,7 +198,6 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
199# 198#
200CONFIG_HW_HAS_PCI=y 199CONFIG_HW_HAS_PCI=y
201CONFIG_PCI=y 200CONFIG_PCI=y
202CONFIG_PCI_LEGACY_PROC=y
203CONFIG_MMU=y 201CONFIG_MMU=y
204 202
205# 203#
@@ -227,6 +225,7 @@ CONFIG_NET=y
227# 225#
228# Networking options 226# Networking options
229# 227#
228# CONFIG_NETDEBUG is not set
230CONFIG_PACKET=y 229CONFIG_PACKET=y
231# CONFIG_PACKET_MMAP is not set 230# CONFIG_PACKET_MMAP is not set
232CONFIG_UNIX=y 231CONFIG_UNIX=y
@@ -248,12 +247,15 @@ CONFIG_IP_PNP_BOOTP=y
248# CONFIG_INET_AH is not set 247# CONFIG_INET_AH is not set
249# CONFIG_INET_ESP is not set 248# CONFIG_INET_ESP is not set
250# CONFIG_INET_IPCOMP is not set 249# CONFIG_INET_IPCOMP is not set
251CONFIG_INET_TUNNEL=y 250# CONFIG_INET_XFRM_TUNNEL is not set
251# CONFIG_INET_TUNNEL is not set
252CONFIG_INET_DIAG=y 252CONFIG_INET_DIAG=y
253CONFIG_INET_TCP_DIAG=y 253CONFIG_INET_TCP_DIAG=y
254# CONFIG_TCP_CONG_ADVANCED is not set 254# CONFIG_TCP_CONG_ADVANCED is not set
255CONFIG_TCP_CONG_BIC=y 255CONFIG_TCP_CONG_BIC=y
256# CONFIG_IPV6 is not set 256# CONFIG_IPV6 is not set
257# CONFIG_INET6_XFRM_TUNNEL is not set
258# CONFIG_INET6_TUNNEL is not set
257# CONFIG_NETFILTER is not set 259# CONFIG_NETFILTER is not set
258 260
259# 261#
@@ -265,6 +267,11 @@ CONFIG_TCP_CONG_BIC=y
265# SCTP Configuration (EXPERIMENTAL) 267# SCTP Configuration (EXPERIMENTAL)
266# 268#
267# CONFIG_IP_SCTP is not set 269# CONFIG_IP_SCTP is not set
270
271#
272# TIPC Configuration (EXPERIMENTAL)
273#
274# CONFIG_TIPC is not set
268# CONFIG_ATM is not set 275# CONFIG_ATM is not set
269# CONFIG_BRIDGE is not set 276# CONFIG_BRIDGE is not set
270# CONFIG_VLAN_8021Q is not set 277# CONFIG_VLAN_8021Q is not set
@@ -274,11 +281,6 @@ CONFIG_TCP_CONG_BIC=y
274# CONFIG_ATALK is not set 281# CONFIG_ATALK is not set
275# CONFIG_X25 is not set 282# CONFIG_X25 is not set
276# CONFIG_LAPB is not set 283# CONFIG_LAPB is not set
277
278#
279# TIPC Configuration (EXPERIMENTAL)
280#
281# CONFIG_TIPC is not set
282# CONFIG_NET_DIVERT is not set 284# CONFIG_NET_DIVERT is not set
283# CONFIG_ECONET is not set 285# CONFIG_ECONET is not set
284# CONFIG_WAN_ROUTER is not set 286# CONFIG_WAN_ROUTER is not set
@@ -299,6 +301,9 @@ CONFIG_IEEE80211=y
299# CONFIG_IEEE80211_DEBUG is not set 301# CONFIG_IEEE80211_DEBUG is not set
300CONFIG_IEEE80211_CRYPT_WEP=y 302CONFIG_IEEE80211_CRYPT_WEP=y
301CONFIG_IEEE80211_CRYPT_CCMP=y 303CONFIG_IEEE80211_CRYPT_CCMP=y
304CONFIG_IEEE80211_SOFTMAC=y
305# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
306CONFIG_WIRELESS_EXT=y
302 307
303# 308#
304# Device Drivers 309# Device Drivers
@@ -343,7 +348,7 @@ CONFIG_PROC_EVENTS=y
343# CONFIG_BLK_DEV_NBD is not set 348# CONFIG_BLK_DEV_NBD is not set
344# CONFIG_BLK_DEV_SX8 is not set 349# CONFIG_BLK_DEV_SX8 is not set
345# CONFIG_BLK_DEV_RAM is not set 350# CONFIG_BLK_DEV_RAM is not set
346CONFIG_BLK_DEV_RAM_COUNT=16 351# CONFIG_BLK_DEV_INITRD is not set
347CONFIG_CDROM_PKTCDVD=y 352CONFIG_CDROM_PKTCDVD=y
348CONFIG_CDROM_PKTCDVD_BUFFERS=8 353CONFIG_CDROM_PKTCDVD_BUFFERS=8
349# CONFIG_CDROM_PKTCDVD_WCACHE is not set 354# CONFIG_CDROM_PKTCDVD_WCACHE is not set
@@ -551,7 +556,12 @@ CONFIG_SERIAL_NONSTANDARD=y
551# 556#
552# Non-8250 serial port support 557# Non-8250 serial port support
553# 558#
559CONFIG_SERIAL_CORE=y
560CONFIG_SERIAL_TXX9=y
554CONFIG_HAS_TXX9_SERIAL=y 561CONFIG_HAS_TXX9_SERIAL=y
562# CONFIG_SERIAL_TXX9_CONSOLE is not set
563# CONFIG_SERIAL_TXX9_STDSERIAL is not set
564# CONFIG_SERIAL_JSM is not set
555# CONFIG_UNIX98_PTYS is not set 565# CONFIG_UNIX98_PTYS is not set
556CONFIG_LEGACY_PTYS=y 566CONFIG_LEGACY_PTYS=y
557CONFIG_LEGACY_PTY_COUNT=256 567CONFIG_LEGACY_PTY_COUNT=256
@@ -610,10 +620,6 @@ CONFIG_LEGACY_PTY_COUNT=256
610# 620#
611 621
612# 622#
613# Multimedia Capabilities Port drivers
614#
615
616#
617# Multimedia devices 623# Multimedia devices
618# 624#
619# CONFIG_VIDEO_DEV is not set 625# CONFIG_VIDEO_DEV is not set
@@ -631,6 +637,7 @@ CONFIG_FB=y
631# CONFIG_FB_CFB_COPYAREA is not set 637# CONFIG_FB_CFB_COPYAREA is not set
632# CONFIG_FB_CFB_IMAGEBLIT is not set 638# CONFIG_FB_CFB_IMAGEBLIT is not set
633# CONFIG_FB_MACMODES is not set 639# CONFIG_FB_MACMODES is not set
640CONFIG_FB_FIRMWARE_EDID=y
634# CONFIG_FB_MODE_HELPERS is not set 641# CONFIG_FB_MODE_HELPERS is not set
635# CONFIG_FB_TILEBLITTING is not set 642# CONFIG_FB_TILEBLITTING is not set
636# CONFIG_FB_CIRRUS is not set 643# CONFIG_FB_CIRRUS is not set
@@ -642,7 +649,6 @@ CONFIG_FB=y
642# CONFIG_FB_NVIDIA is not set 649# CONFIG_FB_NVIDIA is not set
643# CONFIG_FB_RIVA is not set 650# CONFIG_FB_RIVA is not set
644# CONFIG_FB_MATROX is not set 651# CONFIG_FB_MATROX is not set
645# CONFIG_FB_RADEON_OLD is not set
646# CONFIG_FB_RADEON is not set 652# CONFIG_FB_RADEON is not set
647# CONFIG_FB_ATY128 is not set 653# CONFIG_FB_ATY128 is not set
648# CONFIG_FB_ATY is not set 654# CONFIG_FB_ATY is not set
@@ -679,6 +685,7 @@ CONFIG_DUMMY_CONSOLE=y
679# 685#
680CONFIG_USB_ARCH_HAS_HCD=y 686CONFIG_USB_ARCH_HAS_HCD=y
681CONFIG_USB_ARCH_HAS_OHCI=y 687CONFIG_USB_ARCH_HAS_OHCI=y
688CONFIG_USB_ARCH_HAS_EHCI=y
682# CONFIG_USB is not set 689# CONFIG_USB is not set
683 690
684# 691#
@@ -696,13 +703,31 @@ CONFIG_USB_ARCH_HAS_OHCI=y
696# CONFIG_MMC is not set 703# CONFIG_MMC is not set
697 704
698# 705#
706# LED devices
707#
708# CONFIG_NEW_LEDS is not set
709
710#
711# LED drivers
712#
713
714#
715# LED Triggers
716#
717
718#
699# InfiniBand support 719# InfiniBand support
700# 720#
701# CONFIG_INFINIBAND is not set 721# CONFIG_INFINIBAND is not set
702 722
703# 723#
704# SN Devices 724# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
725#
726
727#
728# Real Time Clock
705# 729#
730# CONFIG_RTC_CLASS is not set
706 731
707# 732#
708# File systems 733# File systems
@@ -745,7 +770,6 @@ CONFIG_SYSFS=y
745# CONFIG_TMPFS is not set 770# CONFIG_TMPFS is not set
746# CONFIG_HUGETLB_PAGE is not set 771# CONFIG_HUGETLB_PAGE is not set
747CONFIG_RAMFS=y 772CONFIG_RAMFS=y
748CONFIG_RELAYFS_FS=y
749# CONFIG_CONFIGFS_FS is not set 773# CONFIG_CONFIGFS_FS is not set
750 774
751# 775#
@@ -809,6 +833,8 @@ CONFIG_MSDOS_PARTITION=y
809# CONFIG_MAGIC_SYSRQ is not set 833# CONFIG_MAGIC_SYSRQ is not set
810# CONFIG_DEBUG_KERNEL is not set 834# CONFIG_DEBUG_KERNEL is not set
811CONFIG_LOG_BUF_SHIFT=14 835CONFIG_LOG_BUF_SHIFT=14
836# CONFIG_DEBUG_FS is not set
837# CONFIG_UNWIND_INFO is not set
812CONFIG_CROSSCOMPILE=y 838CONFIG_CROSSCOMPILE=y
813CONFIG_CMDLINE="" 839CONFIG_CMDLINE=""
814 840
diff --git a/arch/mips/configs/lasat200_defconfig b/arch/mips/configs/lasat200_defconfig
index ef0fa9fc79d6..4d25990a0a05 100644
--- a/arch/mips/configs/lasat200_defconfig
+++ b/arch/mips/configs/lasat200_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc1 3# Linux kernel version: 2.6.17-rc2
4# Fri Jan 27 15:40:14 2006 4# Mon Apr 24 14:51:07 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -68,6 +68,8 @@ CONFIG_PICVUE_PROC=y
68CONFIG_DS1603=y 68CONFIG_DS1603=y
69CONFIG_LASAT_SYSCTL=y 69CONFIG_LASAT_SYSCTL=y
70CONFIG_RWSEM_GENERIC_SPINLOCK=y 70CONFIG_RWSEM_GENERIC_SPINLOCK=y
71CONFIG_GENERIC_FIND_NEXT_BIT=y
72CONFIG_GENERIC_HWEIGHT=y
71CONFIG_GENERIC_CALIBRATE_DELAY=y 73CONFIG_GENERIC_CALIBRATE_DELAY=y
72CONFIG_DMA_NONCOHERENT=y 74CONFIG_DMA_NONCOHERENT=y
73CONFIG_DMA_NEED_PCI_MAP_STATE=y 75CONFIG_DMA_NEED_PCI_MAP_STATE=y
@@ -119,7 +121,6 @@ CONFIG_BOARD_SCACHE=y
119CONFIG_R5000_CPU_SCACHE=y 121CONFIG_R5000_CPU_SCACHE=y
120# CONFIG_MIPS_MT is not set 122# CONFIG_MIPS_MT is not set
121# CONFIG_64BIT_PHYS_ADDR is not set 123# CONFIG_64BIT_PHYS_ADDR is not set
122# CONFIG_CPU_ADVANCED is not set
123CONFIG_CPU_HAS_LLSC=y 124CONFIG_CPU_HAS_LLSC=y
124CONFIG_CPU_HAS_SYNC=y 125CONFIG_CPU_HAS_SYNC=y
125CONFIG_GENERIC_HARDIRQS=y 126CONFIG_GENERIC_HARDIRQS=y
@@ -141,7 +142,6 @@ CONFIG_PREEMPT_NONE=y
141# Code maturity level options 142# Code maturity level options
142# 143#
143CONFIG_EXPERIMENTAL=y 144CONFIG_EXPERIMENTAL=y
144CONFIG_CLEAN_COMPILE=y
145CONFIG_BROKEN_ON_SMP=y 145CONFIG_BROKEN_ON_SMP=y
146CONFIG_INIT_ENV_ARG_LIMIT=32 146CONFIG_INIT_ENV_ARG_LIMIT=32
147 147
@@ -157,6 +157,7 @@ CONFIG_SYSVIPC=y
157CONFIG_SYSCTL=y 157CONFIG_SYSCTL=y
158# CONFIG_AUDIT is not set 158# CONFIG_AUDIT is not set
159# CONFIG_IKCONFIG is not set 159# CONFIG_IKCONFIG is not set
160CONFIG_RELAY=y
160CONFIG_INITRAMFS_SOURCE="" 161CONFIG_INITRAMFS_SOURCE=""
161# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 162# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
162CONFIG_EMBEDDED=y 163CONFIG_EMBEDDED=y
@@ -170,10 +171,6 @@ CONFIG_BASE_FULL=y
170CONFIG_FUTEX=y 171CONFIG_FUTEX=y
171CONFIG_EPOLL=y 172CONFIG_EPOLL=y
172CONFIG_SHMEM=y 173CONFIG_SHMEM=y
173CONFIG_CC_ALIGN_FUNCTIONS=0
174CONFIG_CC_ALIGN_LABELS=0
175CONFIG_CC_ALIGN_LOOPS=0
176CONFIG_CC_ALIGN_JUMPS=0
177CONFIG_SLAB=y 174CONFIG_SLAB=y
178# CONFIG_TINY_SHMEM is not set 175# CONFIG_TINY_SHMEM is not set
179CONFIG_BASE_SMALL=0 176CONFIG_BASE_SMALL=0
@@ -186,7 +183,6 @@ CONFIG_OBSOLETE_INTERMODULE=y
186CONFIG_MODULES=y 183CONFIG_MODULES=y
187CONFIG_MODULE_UNLOAD=y 184CONFIG_MODULE_UNLOAD=y
188# CONFIG_MODULE_FORCE_UNLOAD is not set 185# CONFIG_MODULE_FORCE_UNLOAD is not set
189CONFIG_OBSOLETE_MODPARM=y
190CONFIG_MODVERSIONS=y 186CONFIG_MODVERSIONS=y
191CONFIG_MODULE_SRCVERSION_ALL=y 187CONFIG_MODULE_SRCVERSION_ALL=y
192CONFIG_KMOD=y 188CONFIG_KMOD=y
@@ -195,6 +191,8 @@ CONFIG_KMOD=y
195# Block layer 191# Block layer
196# 192#
197# CONFIG_LBD is not set 193# CONFIG_LBD is not set
194# CONFIG_BLK_DEV_IO_TRACE is not set
195# CONFIG_LSF is not set
198 196
199# 197#
200# IO Schedulers 198# IO Schedulers
@@ -214,7 +212,6 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
214# 212#
215CONFIG_HW_HAS_PCI=y 213CONFIG_HW_HAS_PCI=y
216CONFIG_PCI=y 214CONFIG_PCI=y
217CONFIG_PCI_LEGACY_PROC=y
218CONFIG_MMU=y 215CONFIG_MMU=y
219 216
220# 217#
@@ -242,6 +239,7 @@ CONFIG_NET=y
242# 239#
243# Networking options 240# Networking options
244# 241#
242# CONFIG_NETDEBUG is not set
245# CONFIG_PACKET is not set 243# CONFIG_PACKET is not set
246CONFIG_UNIX=y 244CONFIG_UNIX=y
247CONFIG_XFRM=y 245CONFIG_XFRM=y
@@ -259,12 +257,15 @@ CONFIG_IP_FIB_HASH=y
259# CONFIG_INET_AH is not set 257# CONFIG_INET_AH is not set
260# CONFIG_INET_ESP is not set 258# CONFIG_INET_ESP is not set
261# CONFIG_INET_IPCOMP is not set 259# CONFIG_INET_IPCOMP is not set
262CONFIG_INET_TUNNEL=m 260# CONFIG_INET_XFRM_TUNNEL is not set
261# CONFIG_INET_TUNNEL is not set
263CONFIG_INET_DIAG=y 262CONFIG_INET_DIAG=y
264CONFIG_INET_TCP_DIAG=y 263CONFIG_INET_TCP_DIAG=y
265# CONFIG_TCP_CONG_ADVANCED is not set 264# CONFIG_TCP_CONG_ADVANCED is not set
266CONFIG_TCP_CONG_BIC=y 265CONFIG_TCP_CONG_BIC=y
267# CONFIG_IPV6 is not set 266# CONFIG_IPV6 is not set
267# CONFIG_INET6_XFRM_TUNNEL is not set
268# CONFIG_INET6_TUNNEL is not set
268# CONFIG_NETFILTER is not set 269# CONFIG_NETFILTER is not set
269 270
270# 271#
@@ -276,6 +277,11 @@ CONFIG_TCP_CONG_BIC=y
276# SCTP Configuration (EXPERIMENTAL) 277# SCTP Configuration (EXPERIMENTAL)
277# 278#
278# CONFIG_IP_SCTP is not set 279# CONFIG_IP_SCTP is not set
280
281#
282# TIPC Configuration (EXPERIMENTAL)
283#
284# CONFIG_TIPC is not set
279# CONFIG_ATM is not set 285# CONFIG_ATM is not set
280# CONFIG_BRIDGE is not set 286# CONFIG_BRIDGE is not set
281# CONFIG_VLAN_8021Q is not set 287# CONFIG_VLAN_8021Q is not set
@@ -285,11 +291,6 @@ CONFIG_TCP_CONG_BIC=y
285# CONFIG_ATALK is not set 291# CONFIG_ATALK is not set
286# CONFIG_X25 is not set 292# CONFIG_X25 is not set
287# CONFIG_LAPB is not set 293# CONFIG_LAPB is not set
288
289#
290# TIPC Configuration (EXPERIMENTAL)
291#
292# CONFIG_TIPC is not set
293# CONFIG_NET_DIVERT is not set 294# CONFIG_NET_DIVERT is not set
294# CONFIG_ECONET is not set 295# CONFIG_ECONET is not set
295# CONFIG_WAN_ROUTER is not set 296# CONFIG_WAN_ROUTER is not set
@@ -310,6 +311,9 @@ CONFIG_IEEE80211=m
310# CONFIG_IEEE80211_DEBUG is not set 311# CONFIG_IEEE80211_DEBUG is not set
311CONFIG_IEEE80211_CRYPT_WEP=m 312CONFIG_IEEE80211_CRYPT_WEP=m
312CONFIG_IEEE80211_CRYPT_CCMP=m 313CONFIG_IEEE80211_CRYPT_CCMP=m
314CONFIG_IEEE80211_SOFTMAC=m
315# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
316CONFIG_WIRELESS_EXT=y
313 317
314# 318#
315# Device Drivers 319# Device Drivers
@@ -366,7 +370,6 @@ CONFIG_MTD_CFI_I2=y
366# CONFIG_MTD_CFI_I8 is not set 370# CONFIG_MTD_CFI_I8 is not set
367# CONFIG_MTD_CFI_INTELEXT is not set 371# CONFIG_MTD_CFI_INTELEXT is not set
368CONFIG_MTD_CFI_AMDSTD=y 372CONFIG_MTD_CFI_AMDSTD=y
369CONFIG_MTD_CFI_AMDSTD_RETRY=0
370# CONFIG_MTD_CFI_STAA is not set 373# CONFIG_MTD_CFI_STAA is not set
371CONFIG_MTD_CFI_UTIL=y 374CONFIG_MTD_CFI_UTIL=y
372# CONFIG_MTD_RAM is not set 375# CONFIG_MTD_RAM is not set
@@ -389,7 +392,6 @@ CONFIG_MTD_LASAT=y
389# CONFIG_MTD_SLRAM is not set 392# CONFIG_MTD_SLRAM is not set
390# CONFIG_MTD_PHRAM is not set 393# CONFIG_MTD_PHRAM is not set
391# CONFIG_MTD_MTDRAM is not set 394# CONFIG_MTD_MTDRAM is not set
392# CONFIG_MTD_BLKMTD is not set
393# CONFIG_MTD_BLOCK2MTD is not set 395# CONFIG_MTD_BLOCK2MTD is not set
394 396
395# 397#
@@ -430,7 +432,7 @@ CONFIG_MTD_LASAT=y
430# CONFIG_BLK_DEV_NBD is not set 432# CONFIG_BLK_DEV_NBD is not set
431# CONFIG_BLK_DEV_SX8 is not set 433# CONFIG_BLK_DEV_SX8 is not set
432# CONFIG_BLK_DEV_RAM is not set 434# CONFIG_BLK_DEV_RAM is not set
433CONFIG_BLK_DEV_RAM_COUNT=16 435# CONFIG_BLK_DEV_INITRD is not set
434CONFIG_CDROM_PKTCDVD=m 436CONFIG_CDROM_PKTCDVD=m
435CONFIG_CDROM_PKTCDVD_BUFFERS=8 437CONFIG_CDROM_PKTCDVD_BUFFERS=8
436# CONFIG_CDROM_PKTCDVD_WCACHE is not set 438# CONFIG_CDROM_PKTCDVD_WCACHE is not set
@@ -672,6 +674,7 @@ CONFIG_HW_CONSOLE=y
672# 674#
673CONFIG_SERIAL_8250=y 675CONFIG_SERIAL_8250=y
674CONFIG_SERIAL_8250_CONSOLE=y 676CONFIG_SERIAL_8250_CONSOLE=y
677CONFIG_SERIAL_8250_PCI=y
675CONFIG_SERIAL_8250_NR_UARTS=4 678CONFIG_SERIAL_8250_NR_UARTS=4
676CONFIG_SERIAL_8250_RUNTIME_UARTS=4 679CONFIG_SERIAL_8250_RUNTIME_UARTS=4
677# CONFIG_SERIAL_8250_EXTENDED is not set 680# CONFIG_SERIAL_8250_EXTENDED is not set
@@ -681,6 +684,7 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=4
681# 684#
682CONFIG_SERIAL_CORE=y 685CONFIG_SERIAL_CORE=y
683CONFIG_SERIAL_CORE_CONSOLE=y 686CONFIG_SERIAL_CORE_CONSOLE=y
687# CONFIG_SERIAL_JSM is not set
684CONFIG_UNIX98_PTYS=y 688CONFIG_UNIX98_PTYS=y
685CONFIG_LEGACY_PTYS=y 689CONFIG_LEGACY_PTYS=y
686CONFIG_LEGACY_PTY_COUNT=256 690CONFIG_LEGACY_PTY_COUNT=256
@@ -739,10 +743,6 @@ CONFIG_LEGACY_PTY_COUNT=256
739# 743#
740 744
741# 745#
742# Multimedia Capabilities Port drivers
743#
744
745#
746# Multimedia devices 746# Multimedia devices
747# 747#
748# CONFIG_VIDEO_DEV is not set 748# CONFIG_VIDEO_DEV is not set
@@ -773,6 +773,7 @@ CONFIG_DUMMY_CONSOLE=y
773# 773#
774CONFIG_USB_ARCH_HAS_HCD=y 774CONFIG_USB_ARCH_HAS_HCD=y
775CONFIG_USB_ARCH_HAS_OHCI=y 775CONFIG_USB_ARCH_HAS_OHCI=y
776CONFIG_USB_ARCH_HAS_EHCI=y
776# CONFIG_USB is not set 777# CONFIG_USB is not set
777 778
778# 779#
@@ -790,13 +791,31 @@ CONFIG_USB_ARCH_HAS_OHCI=y
790# CONFIG_MMC is not set 791# CONFIG_MMC is not set
791 792
792# 793#
794# LED devices
795#
796# CONFIG_NEW_LEDS is not set
797
798#
799# LED drivers
800#
801
802#
803# LED Triggers
804#
805
806#
793# InfiniBand support 807# InfiniBand support
794# 808#
795# CONFIG_INFINIBAND is not set 809# CONFIG_INFINIBAND is not set
796 810
797# 811#
798# SN Devices 812# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
813#
814
815#
816# Real Time Clock
799# 817#
818# CONFIG_RTC_CLASS is not set
800 819
801# 820#
802# File systems 821# File systems
@@ -847,7 +866,6 @@ CONFIG_SYSFS=y
847# CONFIG_TMPFS is not set 866# CONFIG_TMPFS is not set
848# CONFIG_HUGETLB_PAGE is not set 867# CONFIG_HUGETLB_PAGE is not set
849CONFIG_RAMFS=y 868CONFIG_RAMFS=y
850CONFIG_RELAYFS_FS=m
851# CONFIG_CONFIGFS_FS is not set 869# CONFIG_CONFIGFS_FS is not set
852 870
853# 871#
@@ -914,6 +932,7 @@ CONFIG_MSDOS_PARTITION=y
914# CONFIG_MAGIC_SYSRQ is not set 932# CONFIG_MAGIC_SYSRQ is not set
915# CONFIG_DEBUG_KERNEL is not set 933# CONFIG_DEBUG_KERNEL is not set
916CONFIG_LOG_BUF_SHIFT=14 934CONFIG_LOG_BUF_SHIFT=14
935# CONFIG_DEBUG_FS is not set
917CONFIG_CROSSCOMPILE=y 936CONFIG_CROSSCOMPILE=y
918CONFIG_CMDLINE="" 937CONFIG_CMDLINE=""
919 938
diff --git a/arch/mips/configs/malta_defconfig b/arch/mips/configs/malta_defconfig
index 367d279efdd9..977f52be51dc 100644
--- a/arch/mips/configs/malta_defconfig
+++ b/arch/mips/configs/malta_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc1 3# Linux kernel version: 2.6.17-rc2
4# Fri Jan 27 15:40:15 2006 4# Mon Apr 24 14:51:08 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -64,6 +64,8 @@ CONFIG_MIPS_MALTA=y
64# CONFIG_TOSHIBA_RBTX4927 is not set 64# CONFIG_TOSHIBA_RBTX4927 is not set
65# CONFIG_TOSHIBA_RBTX4938 is not set 65# CONFIG_TOSHIBA_RBTX4938 is not set
66CONFIG_RWSEM_GENERIC_SPINLOCK=y 66CONFIG_RWSEM_GENERIC_SPINLOCK=y
67CONFIG_GENERIC_FIND_NEXT_BIT=y
68CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 69CONFIG_GENERIC_CALIBRATE_DELAY=y
68CONFIG_ARCH_MAY_HAVE_PC_FDC=y 70CONFIG_ARCH_MAY_HAVE_PC_FDC=y
69CONFIG_DMA_NONCOHERENT=y 71CONFIG_DMA_NONCOHERENT=y
@@ -128,16 +130,21 @@ CONFIG_PAGE_SIZE_4KB=y
128# CONFIG_PAGE_SIZE_64KB is not set 130# CONFIG_PAGE_SIZE_64KB is not set
129CONFIG_CPU_HAS_PREFETCH=y 131CONFIG_CPU_HAS_PREFETCH=y
130CONFIG_MIPS_MT=y 132CONFIG_MIPS_MT=y
133# CONFIG_MIPS_MT_SMTC is not set
131# CONFIG_MIPS_MT_SMP is not set 134# CONFIG_MIPS_MT_SMP is not set
132CONFIG_MIPS_VPE_LOADER=y 135CONFIG_MIPS_VPE_LOADER=y
136CONFIG_MIPS_MT_FPAFF=y
133CONFIG_MIPS_VPE_LOADER_TOM=y 137CONFIG_MIPS_VPE_LOADER_TOM=y
134CONFIG_MIPS_VPE_APSP_API=y 138CONFIG_MIPS_VPE_APSP_API=y
139CONFIG_MIPS_APSP_KSPD=y
135# CONFIG_64BIT_PHYS_ADDR is not set 140# CONFIG_64BIT_PHYS_ADDR is not set
136# CONFIG_CPU_ADVANCED is not set
137CONFIG_CPU_HAS_LLSC=y 141CONFIG_CPU_HAS_LLSC=y
142# CONFIG_CPU_MIPSR2_IRQ_VI is not set
143# CONFIG_CPU_MIPSR2_IRQ_EI is not set
138CONFIG_CPU_HAS_SYNC=y 144CONFIG_CPU_HAS_SYNC=y
139CONFIG_GENERIC_HARDIRQS=y 145CONFIG_GENERIC_HARDIRQS=y
140CONFIG_GENERIC_IRQ_PROBE=y 146CONFIG_GENERIC_IRQ_PROBE=y
147CONFIG_CPU_SUPPORTS_HIGHMEM=y
141CONFIG_ARCH_FLATMEM_ENABLE=y 148CONFIG_ARCH_FLATMEM_ENABLE=y
142CONFIG_SELECT_MEMORY_MODEL=y 149CONFIG_SELECT_MEMORY_MODEL=y
143CONFIG_FLATMEM_MANUAL=y 150CONFIG_FLATMEM_MANUAL=y
@@ -155,7 +162,6 @@ CONFIG_PREEMPT_NONE=y
155# Code maturity level options 162# Code maturity level options
156# 163#
157CONFIG_EXPERIMENTAL=y 164CONFIG_EXPERIMENTAL=y
158CONFIG_CLEAN_COMPILE=y
159CONFIG_BROKEN_ON_SMP=y 165CONFIG_BROKEN_ON_SMP=y
160CONFIG_INIT_ENV_ARG_LIMIT=32 166CONFIG_INIT_ENV_ARG_LIMIT=32
161 167
@@ -171,6 +177,7 @@ CONFIG_SYSVIPC=y
171CONFIG_SYSCTL=y 177CONFIG_SYSCTL=y
172# CONFIG_AUDIT is not set 178# CONFIG_AUDIT is not set
173# CONFIG_IKCONFIG is not set 179# CONFIG_IKCONFIG is not set
180CONFIG_RELAY=y
174CONFIG_INITRAMFS_SOURCE="" 181CONFIG_INITRAMFS_SOURCE=""
175# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 182# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
176CONFIG_EMBEDDED=y 183CONFIG_EMBEDDED=y
@@ -184,10 +191,6 @@ CONFIG_BASE_FULL=y
184CONFIG_FUTEX=y 191CONFIG_FUTEX=y
185CONFIG_EPOLL=y 192CONFIG_EPOLL=y
186CONFIG_SHMEM=y 193CONFIG_SHMEM=y
187CONFIG_CC_ALIGN_FUNCTIONS=0
188CONFIG_CC_ALIGN_LABELS=0
189CONFIG_CC_ALIGN_LOOPS=0
190CONFIG_CC_ALIGN_JUMPS=0
191CONFIG_SLAB=y 194CONFIG_SLAB=y
192# CONFIG_TINY_SHMEM is not set 195# CONFIG_TINY_SHMEM is not set
193CONFIG_BASE_SMALL=0 196CONFIG_BASE_SMALL=0
@@ -199,7 +202,6 @@ CONFIG_BASE_SMALL=0
199CONFIG_MODULES=y 202CONFIG_MODULES=y
200CONFIG_MODULE_UNLOAD=y 203CONFIG_MODULE_UNLOAD=y
201# CONFIG_MODULE_FORCE_UNLOAD is not set 204# CONFIG_MODULE_FORCE_UNLOAD is not set
202CONFIG_OBSOLETE_MODPARM=y
203CONFIG_MODVERSIONS=y 205CONFIG_MODVERSIONS=y
204CONFIG_MODULE_SRCVERSION_ALL=y 206CONFIG_MODULE_SRCVERSION_ALL=y
205CONFIG_KMOD=y 207CONFIG_KMOD=y
@@ -208,6 +210,8 @@ CONFIG_KMOD=y
208# Block layer 210# Block layer
209# 211#
210# CONFIG_LBD is not set 212# CONFIG_LBD is not set
213# CONFIG_BLK_DEV_IO_TRACE is not set
214# CONFIG_LSF is not set
211 215
212# 216#
213# IO Schedulers 217# IO Schedulers
@@ -227,7 +231,6 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
227# 231#
228CONFIG_HW_HAS_PCI=y 232CONFIG_HW_HAS_PCI=y
229CONFIG_PCI=y 233CONFIG_PCI=y
230CONFIG_PCI_LEGACY_PROC=y
231CONFIG_MMU=y 234CONFIG_MMU=y
232 235
233# 236#
@@ -255,6 +258,7 @@ CONFIG_NET=y
255# 258#
256# Networking options 259# Networking options
257# 260#
261# CONFIG_NETDEBUG is not set
258CONFIG_PACKET=y 262CONFIG_PACKET=y
259CONFIG_PACKET_MMAP=y 263CONFIG_PACKET_MMAP=y
260CONFIG_UNIX=y 264CONFIG_UNIX=y
@@ -287,6 +291,7 @@ CONFIG_SYN_COOKIES=y
287CONFIG_INET_AH=m 291CONFIG_INET_AH=m
288CONFIG_INET_ESP=m 292CONFIG_INET_ESP=m
289CONFIG_INET_IPCOMP=m 293CONFIG_INET_IPCOMP=m
294CONFIG_INET_XFRM_TUNNEL=m
290CONFIG_INET_TUNNEL=m 295CONFIG_INET_TUNNEL=m
291CONFIG_INET_DIAG=y 296CONFIG_INET_DIAG=y
292CONFIG_INET_TCP_DIAG=y 297CONFIG_INET_TCP_DIAG=y
@@ -328,9 +333,12 @@ CONFIG_IP_VS_NQ=m
328CONFIG_IP_VS_FTP=m 333CONFIG_IP_VS_FTP=m
329CONFIG_IPV6=m 334CONFIG_IPV6=m
330CONFIG_IPV6_PRIVACY=y 335CONFIG_IPV6_PRIVACY=y
336CONFIG_IPV6_ROUTER_PREF=y
337CONFIG_IPV6_ROUTE_INFO=y
331CONFIG_INET6_AH=m 338CONFIG_INET6_AH=m
332CONFIG_INET6_ESP=m 339CONFIG_INET6_ESP=m
333CONFIG_INET6_IPCOMP=m 340CONFIG_INET6_IPCOMP=m
341CONFIG_INET6_XFRM_TUNNEL=m
334CONFIG_INET6_TUNNEL=m 342CONFIG_INET6_TUNNEL=m
335CONFIG_IPV6_TUNNEL=m 343CONFIG_IPV6_TUNNEL=m
336CONFIG_NETFILTER=y 344CONFIG_NETFILTER=y
@@ -354,11 +362,14 @@ CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
354CONFIG_NETFILTER_XT_MATCH_CONNMARK=m 362CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
355CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m 363CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
356CONFIG_NETFILTER_XT_MATCH_DCCP=m 364CONFIG_NETFILTER_XT_MATCH_DCCP=m
365CONFIG_NETFILTER_XT_MATCH_ESP=m
357CONFIG_NETFILTER_XT_MATCH_HELPER=m 366CONFIG_NETFILTER_XT_MATCH_HELPER=m
358CONFIG_NETFILTER_XT_MATCH_LENGTH=m 367CONFIG_NETFILTER_XT_MATCH_LENGTH=m
359CONFIG_NETFILTER_XT_MATCH_LIMIT=m 368CONFIG_NETFILTER_XT_MATCH_LIMIT=m
360CONFIG_NETFILTER_XT_MATCH_MAC=m 369CONFIG_NETFILTER_XT_MATCH_MAC=m
361CONFIG_NETFILTER_XT_MATCH_MARK=m 370CONFIG_NETFILTER_XT_MATCH_MARK=m
371CONFIG_NETFILTER_XT_MATCH_POLICY=m
372CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
362# CONFIG_NETFILTER_XT_MATCH_PHYSDEV is not set 373# CONFIG_NETFILTER_XT_MATCH_PHYSDEV is not set
363CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m 374CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
364CONFIG_NETFILTER_XT_MATCH_REALM=m 375CONFIG_NETFILTER_XT_MATCH_REALM=m
@@ -382,20 +393,19 @@ CONFIG_IP_NF_IRC=m
382CONFIG_IP_NF_TFTP=m 393CONFIG_IP_NF_TFTP=m
383CONFIG_IP_NF_AMANDA=m 394CONFIG_IP_NF_AMANDA=m
384CONFIG_IP_NF_PPTP=m 395CONFIG_IP_NF_PPTP=m
396CONFIG_IP_NF_H323=m
385CONFIG_IP_NF_QUEUE=m 397CONFIG_IP_NF_QUEUE=m
386CONFIG_IP_NF_IPTABLES=m 398CONFIG_IP_NF_IPTABLES=m
387CONFIG_IP_NF_MATCH_IPRANGE=m 399CONFIG_IP_NF_MATCH_IPRANGE=m
388CONFIG_IP_NF_MATCH_MULTIPORT=m
389CONFIG_IP_NF_MATCH_TOS=m 400CONFIG_IP_NF_MATCH_TOS=m
390CONFIG_IP_NF_MATCH_RECENT=m 401CONFIG_IP_NF_MATCH_RECENT=m
391CONFIG_IP_NF_MATCH_ECN=m 402CONFIG_IP_NF_MATCH_ECN=m
392CONFIG_IP_NF_MATCH_DSCP=m 403CONFIG_IP_NF_MATCH_DSCP=m
393CONFIG_IP_NF_MATCH_AH_ESP=m 404CONFIG_IP_NF_MATCH_AH=m
394CONFIG_IP_NF_MATCH_TTL=m 405CONFIG_IP_NF_MATCH_TTL=m
395CONFIG_IP_NF_MATCH_OWNER=m 406CONFIG_IP_NF_MATCH_OWNER=m
396CONFIG_IP_NF_MATCH_ADDRTYPE=m 407CONFIG_IP_NF_MATCH_ADDRTYPE=m
397CONFIG_IP_NF_MATCH_HASHLIMIT=m 408CONFIG_IP_NF_MATCH_HASHLIMIT=m
398CONFIG_IP_NF_MATCH_POLICY=m
399CONFIG_IP_NF_FILTER=m 409CONFIG_IP_NF_FILTER=m
400CONFIG_IP_NF_TARGET_REJECT=m 410CONFIG_IP_NF_TARGET_REJECT=m
401CONFIG_IP_NF_TARGET_LOG=m 411CONFIG_IP_NF_TARGET_LOG=m
@@ -413,6 +423,7 @@ CONFIG_IP_NF_NAT_FTP=m
413CONFIG_IP_NF_NAT_TFTP=m 423CONFIG_IP_NF_NAT_TFTP=m
414CONFIG_IP_NF_NAT_AMANDA=m 424CONFIG_IP_NF_NAT_AMANDA=m
415CONFIG_IP_NF_NAT_PPTP=m 425CONFIG_IP_NF_NAT_PPTP=m
426CONFIG_IP_NF_NAT_H323=m
416CONFIG_IP_NF_MANGLE=m 427CONFIG_IP_NF_MANGLE=m
417CONFIG_IP_NF_TARGET_TOS=m 428CONFIG_IP_NF_TARGET_TOS=m
418CONFIG_IP_NF_TARGET_ECN=m 429CONFIG_IP_NF_TARGET_ECN=m
@@ -433,12 +444,10 @@ CONFIG_IP6_NF_MATCH_RT=m
433CONFIG_IP6_NF_MATCH_OPTS=m 444CONFIG_IP6_NF_MATCH_OPTS=m
434CONFIG_IP6_NF_MATCH_FRAG=m 445CONFIG_IP6_NF_MATCH_FRAG=m
435CONFIG_IP6_NF_MATCH_HL=m 446CONFIG_IP6_NF_MATCH_HL=m
436CONFIG_IP6_NF_MATCH_MULTIPORT=m
437CONFIG_IP6_NF_MATCH_OWNER=m 447CONFIG_IP6_NF_MATCH_OWNER=m
438CONFIG_IP6_NF_MATCH_IPV6HEADER=m 448CONFIG_IP6_NF_MATCH_IPV6HEADER=m
439CONFIG_IP6_NF_MATCH_AHESP=m 449CONFIG_IP6_NF_MATCH_AH=m
440CONFIG_IP6_NF_MATCH_EUI64=m 450CONFIG_IP6_NF_MATCH_EUI64=m
441CONFIG_IP6_NF_MATCH_POLICY=m
442CONFIG_IP6_NF_FILTER=m 451CONFIG_IP6_NF_FILTER=m
443CONFIG_IP6_NF_TARGET_LOG=m 452CONFIG_IP6_NF_TARGET_LOG=m
444CONFIG_IP6_NF_TARGET_REJECT=m 453CONFIG_IP6_NF_TARGET_REJECT=m
@@ -484,6 +493,11 @@ CONFIG_IP_SCTP=m
484# CONFIG_SCTP_HMAC_NONE is not set 493# CONFIG_SCTP_HMAC_NONE is not set
485# CONFIG_SCTP_HMAC_SHA1 is not set 494# CONFIG_SCTP_HMAC_SHA1 is not set
486CONFIG_SCTP_HMAC_MD5=y 495CONFIG_SCTP_HMAC_MD5=y
496
497#
498# TIPC Configuration (EXPERIMENTAL)
499#
500# CONFIG_TIPC is not set
487# CONFIG_ATM is not set 501# CONFIG_ATM is not set
488CONFIG_BRIDGE=m 502CONFIG_BRIDGE=m
489CONFIG_VLAN_8021Q=m 503CONFIG_VLAN_8021Q=m
@@ -498,11 +512,6 @@ CONFIG_IPDDP_ENCAP=y
498CONFIG_IPDDP_DECAP=y 512CONFIG_IPDDP_DECAP=y
499# CONFIG_X25 is not set 513# CONFIG_X25 is not set
500# CONFIG_LAPB is not set 514# CONFIG_LAPB is not set
501
502#
503# TIPC Configuration (EXPERIMENTAL)
504#
505# CONFIG_TIPC is not set
506CONFIG_NET_DIVERT=y 515CONFIG_NET_DIVERT=y
507# CONFIG_ECONET is not set 516# CONFIG_ECONET is not set
508# CONFIG_WAN_ROUTER is not set 517# CONFIG_WAN_ROUTER is not set
@@ -562,6 +571,9 @@ CONFIG_IEEE80211=m
562# CONFIG_IEEE80211_DEBUG is not set 571# CONFIG_IEEE80211_DEBUG is not set
563CONFIG_IEEE80211_CRYPT_WEP=m 572CONFIG_IEEE80211_CRYPT_WEP=m
564CONFIG_IEEE80211_CRYPT_CCMP=m 573CONFIG_IEEE80211_CRYPT_CCMP=m
574CONFIG_IEEE80211_SOFTMAC=m
575# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
576CONFIG_WIRELESS_EXT=y
565 577
566# 578#
567# Device Drivers 579# Device Drivers
@@ -734,7 +746,6 @@ CONFIG_AIC7XXX_REG_PRETTY_PRINT=y
734# CONFIG_SCSI_INIA100 is not set 746# CONFIG_SCSI_INIA100 is not set
735# CONFIG_SCSI_SYM53C8XX_2 is not set 747# CONFIG_SCSI_SYM53C8XX_2 is not set
736# CONFIG_SCSI_IPR is not set 748# CONFIG_SCSI_IPR is not set
737# CONFIG_SCSI_QLOGIC_FC is not set
738# CONFIG_SCSI_QLOGIC_1280 is not set 749# CONFIG_SCSI_QLOGIC_1280 is not set
739# CONFIG_SCSI_QLA_FC is not set 750# CONFIG_SCSI_QLA_FC is not set
740# CONFIG_SCSI_LPFC is not set 751# CONFIG_SCSI_LPFC is not set
@@ -753,6 +764,7 @@ CONFIG_MD_RAID0=m
753CONFIG_MD_RAID1=m 764CONFIG_MD_RAID1=m
754CONFIG_MD_RAID10=m 765CONFIG_MD_RAID10=m
755CONFIG_MD_RAID5=m 766CONFIG_MD_RAID5=m
767CONFIG_MD_RAID5_RESHAPE=y
756CONFIG_MD_RAID6=m 768CONFIG_MD_RAID6=m
757CONFIG_MD_MULTIPATH=m 769CONFIG_MD_MULTIPATH=m
758CONFIG_MD_FAULTY=m 770CONFIG_MD_FAULTY=m
@@ -956,6 +968,7 @@ CONFIG_HW_CONSOLE=y
956# 968#
957CONFIG_SERIAL_8250=y 969CONFIG_SERIAL_8250=y
958CONFIG_SERIAL_8250_CONSOLE=y 970CONFIG_SERIAL_8250_CONSOLE=y
971CONFIG_SERIAL_8250_PCI=y
959CONFIG_SERIAL_8250_NR_UARTS=4 972CONFIG_SERIAL_8250_NR_UARTS=4
960CONFIG_SERIAL_8250_RUNTIME_UARTS=4 973CONFIG_SERIAL_8250_RUNTIME_UARTS=4
961# CONFIG_SERIAL_8250_EXTENDED is not set 974# CONFIG_SERIAL_8250_EXTENDED is not set
@@ -965,6 +978,7 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=4
965# 978#
966CONFIG_SERIAL_CORE=y 979CONFIG_SERIAL_CORE=y
967CONFIG_SERIAL_CORE_CONSOLE=y 980CONFIG_SERIAL_CORE_CONSOLE=y
981# CONFIG_SERIAL_JSM is not set
968CONFIG_UNIX98_PTYS=y 982CONFIG_UNIX98_PTYS=y
969CONFIG_LEGACY_PTYS=y 983CONFIG_LEGACY_PTYS=y
970CONFIG_LEGACY_PTY_COUNT=256 984CONFIG_LEGACY_PTY_COUNT=256
@@ -1022,10 +1036,6 @@ CONFIG_RTC=y
1022# 1036#
1023 1037
1024# 1038#
1025# Multimedia Capabilities Port drivers
1026#
1027
1028#
1029# Multimedia devices 1039# Multimedia devices
1030# 1040#
1031# CONFIG_VIDEO_DEV is not set 1041# CONFIG_VIDEO_DEV is not set
@@ -1056,6 +1066,7 @@ CONFIG_DUMMY_CONSOLE=y
1056# 1066#
1057CONFIG_USB_ARCH_HAS_HCD=y 1067CONFIG_USB_ARCH_HAS_HCD=y
1058CONFIG_USB_ARCH_HAS_OHCI=y 1068CONFIG_USB_ARCH_HAS_OHCI=y
1069CONFIG_USB_ARCH_HAS_EHCI=y
1059# CONFIG_USB is not set 1070# CONFIG_USB is not set
1060 1071
1061# 1072#
@@ -1073,13 +1084,31 @@ CONFIG_USB_ARCH_HAS_OHCI=y
1073# CONFIG_MMC is not set 1084# CONFIG_MMC is not set
1074 1085
1075# 1086#
1087# LED devices
1088#
1089# CONFIG_NEW_LEDS is not set
1090
1091#
1092# LED drivers
1093#
1094
1095#
1096# LED Triggers
1097#
1098
1099#
1076# InfiniBand support 1100# InfiniBand support
1077# 1101#
1078# CONFIG_INFINIBAND is not set 1102# CONFIG_INFINIBAND is not set
1079 1103
1080# 1104#
1081# SN Devices 1105# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
1106#
1107
1108#
1109# Real Time Clock
1082# 1110#
1111# CONFIG_RTC_CLASS is not set
1083 1112
1084# 1113#
1085# File systems 1114# File systems
@@ -1154,7 +1183,6 @@ CONFIG_SYSFS=y
1154# CONFIG_TMPFS is not set 1183# CONFIG_TMPFS is not set
1155# CONFIG_HUGETLB_PAGE is not set 1184# CONFIG_HUGETLB_PAGE is not set
1156CONFIG_RAMFS=y 1185CONFIG_RAMFS=y
1157CONFIG_RELAYFS_FS=m
1158# CONFIG_CONFIGFS_FS is not set 1186# CONFIG_CONFIGFS_FS is not set
1159 1187
1160# 1188#
@@ -1174,7 +1202,6 @@ CONFIG_VXFS_FS=m
1174# CONFIG_QNX4FS_FS is not set 1202# CONFIG_QNX4FS_FS is not set
1175CONFIG_SYSV_FS=m 1203CONFIG_SYSV_FS=m
1176CONFIG_UFS_FS=m 1204CONFIG_UFS_FS=m
1177# CONFIG_UFS_FS_WRITE is not set
1178 1205
1179# 1206#
1180# Network File Systems 1207# Network File Systems
@@ -1266,6 +1293,7 @@ CONFIG_NLS_UTF8=m
1266# CONFIG_MAGIC_SYSRQ is not set 1293# CONFIG_MAGIC_SYSRQ is not set
1267# CONFIG_DEBUG_KERNEL is not set 1294# CONFIG_DEBUG_KERNEL is not set
1268CONFIG_LOG_BUF_SHIFT=14 1295CONFIG_LOG_BUF_SHIFT=14
1296# CONFIG_DEBUG_FS is not set
1269CONFIG_CROSSCOMPILE=y 1297CONFIG_CROSSCOMPILE=y
1270CONFIG_CMDLINE="" 1298CONFIG_CMDLINE=""
1271 1299
diff --git a/arch/mips/configs/mipssim_defconfig b/arch/mips/configs/mipssim_defconfig
index fe78961762b8..00560e0143f1 100644
--- a/arch/mips/configs/mipssim_defconfig
+++ b/arch/mips/configs/mipssim_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc1 3# Linux kernel version: 2.6.17-rc2
4# Fri Jan 27 15:40:16 2006 4# Mon Apr 24 14:51:09 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -64,6 +64,8 @@ CONFIG_MIPS_SIM=y
64# CONFIG_TOSHIBA_RBTX4927 is not set 64# CONFIG_TOSHIBA_RBTX4927 is not set
65# CONFIG_TOSHIBA_RBTX4938 is not set 65# CONFIG_TOSHIBA_RBTX4938 is not set
66CONFIG_RWSEM_GENERIC_SPINLOCK=y 66CONFIG_RWSEM_GENERIC_SPINLOCK=y
67CONFIG_GENERIC_FIND_NEXT_BIT=y
68CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 69CONFIG_GENERIC_CALIBRATE_DELAY=y
68CONFIG_DMA_NONCOHERENT=y 70CONFIG_DMA_NONCOHERENT=y
69CONFIG_DMA_NEED_PCI_MAP_STATE=y 71CONFIG_DMA_NEED_PCI_MAP_STATE=y
@@ -114,16 +116,19 @@ CONFIG_PAGE_SIZE_4KB=y
114# CONFIG_PAGE_SIZE_64KB is not set 116# CONFIG_PAGE_SIZE_64KB is not set
115CONFIG_CPU_HAS_PREFETCH=y 117CONFIG_CPU_HAS_PREFETCH=y
116CONFIG_MIPS_MT=y 118CONFIG_MIPS_MT=y
119# CONFIG_MIPS_MT_SMTC is not set
117# CONFIG_MIPS_MT_SMP is not set 120# CONFIG_MIPS_MT_SMP is not set
118CONFIG_MIPS_VPE_LOADER=y 121CONFIG_MIPS_VPE_LOADER=y
122CONFIG_MIPS_MT_FPAFF=y
119CONFIG_MIPS_VPE_LOADER_TOM=y 123CONFIG_MIPS_VPE_LOADER_TOM=y
120CONFIG_MIPS_VPE_APSP_API=y 124CONFIG_MIPS_VPE_APSP_API=y
125CONFIG_MIPS_APSP_KSPD=y
121# CONFIG_64BIT_PHYS_ADDR is not set 126# CONFIG_64BIT_PHYS_ADDR is not set
122# CONFIG_CPU_ADVANCED is not set
123CONFIG_CPU_HAS_LLSC=y 127CONFIG_CPU_HAS_LLSC=y
124CONFIG_CPU_HAS_SYNC=y 128CONFIG_CPU_HAS_SYNC=y
125CONFIG_GENERIC_HARDIRQS=y 129CONFIG_GENERIC_HARDIRQS=y
126CONFIG_GENERIC_IRQ_PROBE=y 130CONFIG_GENERIC_IRQ_PROBE=y
131CONFIG_CPU_SUPPORTS_HIGHMEM=y
127CONFIG_ARCH_FLATMEM_ENABLE=y 132CONFIG_ARCH_FLATMEM_ENABLE=y
128CONFIG_SELECT_MEMORY_MODEL=y 133CONFIG_SELECT_MEMORY_MODEL=y
129CONFIG_FLATMEM_MANUAL=y 134CONFIG_FLATMEM_MANUAL=y
@@ -141,7 +146,6 @@ CONFIG_PREEMPT_NONE=y
141# Code maturity level options 146# Code maturity level options
142# 147#
143CONFIG_EXPERIMENTAL=y 148CONFIG_EXPERIMENTAL=y
144CONFIG_CLEAN_COMPILE=y
145CONFIG_BROKEN_ON_SMP=y 149CONFIG_BROKEN_ON_SMP=y
146CONFIG_INIT_ENV_ARG_LIMIT=32 150CONFIG_INIT_ENV_ARG_LIMIT=32
147 151
@@ -157,6 +161,7 @@ CONFIG_SYSVIPC=y
157CONFIG_SYSCTL=y 161CONFIG_SYSCTL=y
158# CONFIG_AUDIT is not set 162# CONFIG_AUDIT is not set
159# CONFIG_IKCONFIG is not set 163# CONFIG_IKCONFIG is not set
164# CONFIG_RELAY is not set
160CONFIG_INITRAMFS_SOURCE="" 165CONFIG_INITRAMFS_SOURCE=""
161# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 166# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
162CONFIG_EMBEDDED=y 167CONFIG_EMBEDDED=y
@@ -171,10 +176,6 @@ CONFIG_BASE_FULL=y
171CONFIG_FUTEX=y 176CONFIG_FUTEX=y
172CONFIG_EPOLL=y 177CONFIG_EPOLL=y
173CONFIG_SHMEM=y 178CONFIG_SHMEM=y
174CONFIG_CC_ALIGN_FUNCTIONS=0
175CONFIG_CC_ALIGN_LABELS=0
176CONFIG_CC_ALIGN_LOOPS=0
177CONFIG_CC_ALIGN_JUMPS=0
178CONFIG_SLAB=y 179CONFIG_SLAB=y
179# CONFIG_TINY_SHMEM is not set 180# CONFIG_TINY_SHMEM is not set
180CONFIG_BASE_SMALL=0 181CONFIG_BASE_SMALL=0
@@ -186,7 +187,6 @@ CONFIG_BASE_SMALL=0
186CONFIG_MODULES=y 187CONFIG_MODULES=y
187CONFIG_MODULE_UNLOAD=y 188CONFIG_MODULE_UNLOAD=y
188# CONFIG_MODULE_FORCE_UNLOAD is not set 189# CONFIG_MODULE_FORCE_UNLOAD is not set
189CONFIG_OBSOLETE_MODPARM=y
190CONFIG_MODVERSIONS=y 190CONFIG_MODVERSIONS=y
191CONFIG_MODULE_SRCVERSION_ALL=y 191CONFIG_MODULE_SRCVERSION_ALL=y
192CONFIG_KMOD=y 192CONFIG_KMOD=y
@@ -195,6 +195,7 @@ CONFIG_KMOD=y
195# Block layer 195# Block layer
196# 196#
197# CONFIG_LBD is not set 197# CONFIG_LBD is not set
198# CONFIG_LSF is not set
198 199
199# 200#
200# IO Schedulers 201# IO Schedulers
@@ -238,6 +239,7 @@ CONFIG_NET=y
238# 239#
239# Networking options 240# Networking options
240# 241#
242# CONFIG_NETDEBUG is not set
241CONFIG_PACKET=y 243CONFIG_PACKET=y
242CONFIG_PACKET_MMAP=y 244CONFIG_PACKET_MMAP=y
243CONFIG_UNIX=y 245CONFIG_UNIX=y
@@ -268,12 +270,15 @@ CONFIG_SYN_COOKIES=y
268# CONFIG_INET_AH is not set 270# CONFIG_INET_AH is not set
269# CONFIG_INET_ESP is not set 271# CONFIG_INET_ESP is not set
270# CONFIG_INET_IPCOMP is not set 272# CONFIG_INET_IPCOMP is not set
273# CONFIG_INET_XFRM_TUNNEL is not set
271# CONFIG_INET_TUNNEL is not set 274# CONFIG_INET_TUNNEL is not set
272CONFIG_INET_DIAG=y 275CONFIG_INET_DIAG=y
273CONFIG_INET_TCP_DIAG=y 276CONFIG_INET_TCP_DIAG=y
274# CONFIG_TCP_CONG_ADVANCED is not set 277# CONFIG_TCP_CONG_ADVANCED is not set
275CONFIG_TCP_CONG_BIC=y 278CONFIG_TCP_CONG_BIC=y
276# CONFIG_IPV6 is not set 279# CONFIG_IPV6 is not set
280# CONFIG_INET6_XFRM_TUNNEL is not set
281# CONFIG_INET6_TUNNEL is not set
277# CONFIG_NETFILTER is not set 282# CONFIG_NETFILTER is not set
278 283
279# 284#
@@ -290,6 +295,11 @@ CONFIG_IP_SCTP=m
290# CONFIG_SCTP_HMAC_NONE is not set 295# CONFIG_SCTP_HMAC_NONE is not set
291# CONFIG_SCTP_HMAC_SHA1 is not set 296# CONFIG_SCTP_HMAC_SHA1 is not set
292CONFIG_SCTP_HMAC_MD5=y 297CONFIG_SCTP_HMAC_MD5=y
298
299#
300# TIPC Configuration (EXPERIMENTAL)
301#
302# CONFIG_TIPC is not set
293# CONFIG_ATM is not set 303# CONFIG_ATM is not set
294# CONFIG_BRIDGE is not set 304# CONFIG_BRIDGE is not set
295# CONFIG_VLAN_8021Q is not set 305# CONFIG_VLAN_8021Q is not set
@@ -299,11 +309,6 @@ CONFIG_SCTP_HMAC_MD5=y
299# CONFIG_ATALK is not set 309# CONFIG_ATALK is not set
300# CONFIG_X25 is not set 310# CONFIG_X25 is not set
301# CONFIG_LAPB is not set 311# CONFIG_LAPB is not set
302
303#
304# TIPC Configuration (EXPERIMENTAL)
305#
306# CONFIG_TIPC is not set
307CONFIG_NET_DIVERT=y 312CONFIG_NET_DIVERT=y
308# CONFIG_ECONET is not set 313# CONFIG_ECONET is not set
309# CONFIG_WAN_ROUTER is not set 314# CONFIG_WAN_ROUTER is not set
@@ -397,7 +402,7 @@ CONFIG_BLK_DEV_LOOP=y
397# CONFIG_BLK_DEV_CRYPTOLOOP is not set 402# CONFIG_BLK_DEV_CRYPTOLOOP is not set
398CONFIG_BLK_DEV_NBD=y 403CONFIG_BLK_DEV_NBD=y
399# CONFIG_BLK_DEV_RAM is not set 404# CONFIG_BLK_DEV_RAM is not set
400CONFIG_BLK_DEV_RAM_COUNT=16 405# CONFIG_BLK_DEV_INITRD is not set
401# CONFIG_CDROM_PKTCDVD is not set 406# CONFIG_CDROM_PKTCDVD is not set
402# CONFIG_ATA_OVER_ETH is not set 407# CONFIG_ATA_OVER_ETH is not set
403 408
@@ -532,7 +537,7 @@ CONFIG_SERIO_SERPORT=y
532CONFIG_SERIAL_8250=y 537CONFIG_SERIAL_8250=y
533CONFIG_SERIAL_8250_CONSOLE=y 538CONFIG_SERIAL_8250_CONSOLE=y
534CONFIG_SERIAL_8250_NR_UARTS=1 539CONFIG_SERIAL_8250_NR_UARTS=1
535CONFIG_SERIAL_8250_RUNTIME_UARTS=4 540CONFIG_SERIAL_8250_RUNTIME_UARTS=1
536# CONFIG_SERIAL_8250_EXTENDED is not set 541# CONFIG_SERIAL_8250_EXTENDED is not set
537 542
538# 543#
@@ -596,10 +601,6 @@ CONFIG_LEGACY_PTY_COUNT=256
596# 601#
597 602
598# 603#
599# Multimedia Capabilities Port drivers
600#
601
602#
603# Multimedia devices 604# Multimedia devices
604# 605#
605# CONFIG_VIDEO_DEV is not set 606# CONFIG_VIDEO_DEV is not set
@@ -624,6 +625,7 @@ CONFIG_LEGACY_PTY_COUNT=256
624# 625#
625# CONFIG_USB_ARCH_HAS_HCD is not set 626# CONFIG_USB_ARCH_HAS_HCD is not set
626# CONFIG_USB_ARCH_HAS_OHCI is not set 627# CONFIG_USB_ARCH_HAS_OHCI is not set
628# CONFIG_USB_ARCH_HAS_EHCI is not set
627 629
628# 630#
629# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 631# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
@@ -640,12 +642,30 @@ CONFIG_LEGACY_PTY_COUNT=256
640# CONFIG_MMC is not set 642# CONFIG_MMC is not set
641 643
642# 644#
645# LED devices
646#
647# CONFIG_NEW_LEDS is not set
648
649#
650# LED drivers
651#
652
653#
654# LED Triggers
655#
656
657#
643# InfiniBand support 658# InfiniBand support
644# 659#
645 660
646# 661#
647# SN Devices 662# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
663#
664
665#
666# Real Time Clock
648# 667#
668# CONFIG_RTC_CLASS is not set
649 669
650# 670#
651# File systems 671# File systems
@@ -690,8 +710,6 @@ CONFIG_PROC_FS=y
690# CONFIG_TMPFS is not set 710# CONFIG_TMPFS is not set
691# CONFIG_HUGETLB_PAGE is not set 711# CONFIG_HUGETLB_PAGE is not set
692CONFIG_RAMFS=y 712CONFIG_RAMFS=y
693# CONFIG_RELAYFS_FS is not set
694# CONFIG_CONFIGFS_FS is not set
695 713
696# 714#
697# Miscellaneous filesystems 715# Miscellaneous filesystems
diff --git a/arch/mips/configs/mpc30x_defconfig b/arch/mips/configs/mpc30x_defconfig
index e4620e7f0a5e..286a018375b2 100644
--- a/arch/mips/configs/mpc30x_defconfig
+++ b/arch/mips/configs/mpc30x_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc1 3# Linux kernel version: 2.6.17-rc2
4# Fri Jan 27 15:40:17 2006 4# Mon Apr 24 14:51:09 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -72,6 +72,8 @@ CONFIG_VICTOR_MPC30X=y
72CONFIG_PCI_VR41XX=y 72CONFIG_PCI_VR41XX=y
73CONFIG_VRC4173=y 73CONFIG_VRC4173=y
74CONFIG_RWSEM_GENERIC_SPINLOCK=y 74CONFIG_RWSEM_GENERIC_SPINLOCK=y
75CONFIG_GENERIC_FIND_NEXT_BIT=y
76CONFIG_GENERIC_HWEIGHT=y
75CONFIG_GENERIC_CALIBRATE_DELAY=y 77CONFIG_GENERIC_CALIBRATE_DELAY=y
76CONFIG_DMA_NONCOHERENT=y 78CONFIG_DMA_NONCOHERENT=y
77CONFIG_DMA_NEED_PCI_MAP_STATE=y 79CONFIG_DMA_NEED_PCI_MAP_STATE=y
@@ -90,7 +92,7 @@ CONFIG_MIPS_L1_CACHE_SHIFT=5
90# CONFIG_CPU_MIPS64_R2 is not set 92# CONFIG_CPU_MIPS64_R2 is not set
91# CONFIG_CPU_R3000 is not set 93# CONFIG_CPU_R3000 is not set
92# CONFIG_CPU_TX39XX is not set 94# CONFIG_CPU_TX39XX is not set
93# CONFIG_CPU_VR41XX is not set 95CONFIG_CPU_VR41XX=y
94# CONFIG_CPU_R4300 is not set 96# CONFIG_CPU_R4300 is not set
95# CONFIG_CPU_R4X00 is not set 97# CONFIG_CPU_R4X00 is not set
96# CONFIG_CPU_TX49XX is not set 98# CONFIG_CPU_TX49XX is not set
@@ -103,18 +105,21 @@ CONFIG_MIPS_L1_CACHE_SHIFT=5
103# CONFIG_CPU_RM7000 is not set 105# CONFIG_CPU_RM7000 is not set
104# CONFIG_CPU_RM9000 is not set 106# CONFIG_CPU_RM9000 is not set
105# CONFIG_CPU_SB1 is not set 107# CONFIG_CPU_SB1 is not set
108CONFIG_SYS_HAS_CPU_VR41XX=y
109CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
110CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
111CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
106 112
107# 113#
108# Kernel type 114# Kernel type
109# 115#
110# CONFIG_32BIT is not set 116CONFIG_32BIT=y
111# CONFIG_64BIT is not set 117# CONFIG_64BIT is not set
112CONFIG_PAGE_SIZE_4KB=y 118CONFIG_PAGE_SIZE_4KB=y
113# CONFIG_PAGE_SIZE_8KB is not set 119# CONFIG_PAGE_SIZE_8KB is not set
114# CONFIG_PAGE_SIZE_16KB is not set 120# CONFIG_PAGE_SIZE_16KB is not set
115# CONFIG_PAGE_SIZE_64KB is not set 121# CONFIG_PAGE_SIZE_64KB is not set
116# CONFIG_MIPS_MT is not set 122# CONFIG_MIPS_MT is not set
117CONFIG_CPU_HAS_LLSC=y
118CONFIG_CPU_HAS_SYNC=y 123CONFIG_CPU_HAS_SYNC=y
119CONFIG_GENERIC_HARDIRQS=y 124CONFIG_GENERIC_HARDIRQS=y
120CONFIG_GENERIC_IRQ_PROBE=y 125CONFIG_GENERIC_IRQ_PROBE=y
@@ -135,7 +140,6 @@ CONFIG_PREEMPT_NONE=y
135# Code maturity level options 140# Code maturity level options
136# 141#
137CONFIG_EXPERIMENTAL=y 142CONFIG_EXPERIMENTAL=y
138CONFIG_CLEAN_COMPILE=y
139CONFIG_BROKEN_ON_SMP=y 143CONFIG_BROKEN_ON_SMP=y
140CONFIG_INIT_ENV_ARG_LIMIT=32 144CONFIG_INIT_ENV_ARG_LIMIT=32
141 145
@@ -151,6 +155,7 @@ CONFIG_SYSVIPC=y
151CONFIG_SYSCTL=y 155CONFIG_SYSCTL=y
152# CONFIG_AUDIT is not set 156# CONFIG_AUDIT is not set
153# CONFIG_IKCONFIG is not set 157# CONFIG_IKCONFIG is not set
158CONFIG_RELAY=y
154CONFIG_INITRAMFS_SOURCE="" 159CONFIG_INITRAMFS_SOURCE=""
155# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 160# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
156CONFIG_EMBEDDED=y 161CONFIG_EMBEDDED=y
@@ -164,10 +169,6 @@ CONFIG_BASE_FULL=y
164CONFIG_FUTEX=y 169CONFIG_FUTEX=y
165CONFIG_EPOLL=y 170CONFIG_EPOLL=y
166CONFIG_SHMEM=y 171CONFIG_SHMEM=y
167CONFIG_CC_ALIGN_FUNCTIONS=0
168CONFIG_CC_ALIGN_LABELS=0
169CONFIG_CC_ALIGN_LOOPS=0
170CONFIG_CC_ALIGN_JUMPS=0
171CONFIG_SLAB=y 172CONFIG_SLAB=y
172# CONFIG_TINY_SHMEM is not set 173# CONFIG_TINY_SHMEM is not set
173CONFIG_BASE_SMALL=0 174CONFIG_BASE_SMALL=0
@@ -179,7 +180,6 @@ CONFIG_BASE_SMALL=0
179CONFIG_MODULES=y 180CONFIG_MODULES=y
180CONFIG_MODULE_UNLOAD=y 181CONFIG_MODULE_UNLOAD=y
181# CONFIG_MODULE_FORCE_UNLOAD is not set 182# CONFIG_MODULE_FORCE_UNLOAD is not set
182CONFIG_OBSOLETE_MODPARM=y
183CONFIG_MODVERSIONS=y 183CONFIG_MODVERSIONS=y
184CONFIG_MODULE_SRCVERSION_ALL=y 184CONFIG_MODULE_SRCVERSION_ALL=y
185CONFIG_KMOD=y 185CONFIG_KMOD=y
@@ -187,6 +187,9 @@ CONFIG_KMOD=y
187# 187#
188# Block layer 188# Block layer
189# 189#
190# CONFIG_LBD is not set
191# CONFIG_BLK_DEV_IO_TRACE is not set
192# CONFIG_LSF is not set
190 193
191# 194#
192# IO Schedulers 195# IO Schedulers
@@ -206,7 +209,6 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
206# 209#
207CONFIG_HW_HAS_PCI=y 210CONFIG_HW_HAS_PCI=y
208CONFIG_PCI=y 211CONFIG_PCI=y
209CONFIG_PCI_LEGACY_PROC=y
210CONFIG_MMU=y 212CONFIG_MMU=y
211 213
212# 214#
@@ -225,6 +227,7 @@ CONFIG_PCMCIA_IOCTL=y
225# CONFIG_YENTA is not set 227# CONFIG_YENTA is not set
226# CONFIG_PD6729 is not set 228# CONFIG_PD6729 is not set
227# CONFIG_I82092 is not set 229# CONFIG_I82092 is not set
230# CONFIG_PCMCIA_VRC4173 is not set
228 231
229# 232#
230# PCI Hotplug Support 233# PCI Hotplug Support
@@ -236,6 +239,7 @@ CONFIG_PCMCIA_IOCTL=y
236# 239#
237CONFIG_BINFMT_ELF=y 240CONFIG_BINFMT_ELF=y
238# CONFIG_BINFMT_MISC is not set 241# CONFIG_BINFMT_MISC is not set
242CONFIG_TRAD_SIGNALS=y
239 243
240# 244#
241# Networking 245# Networking
@@ -245,6 +249,7 @@ CONFIG_NET=y
245# 249#
246# Networking options 250# Networking options
247# 251#
252# CONFIG_NETDEBUG is not set
248CONFIG_PACKET=y 253CONFIG_PACKET=y
249CONFIG_PACKET_MMAP=y 254CONFIG_PACKET_MMAP=y
250CONFIG_UNIX=y 255CONFIG_UNIX=y
@@ -264,12 +269,15 @@ CONFIG_IP_FIB_HASH=y
264# CONFIG_INET_AH is not set 269# CONFIG_INET_AH is not set
265# CONFIG_INET_ESP is not set 270# CONFIG_INET_ESP is not set
266# CONFIG_INET_IPCOMP is not set 271# CONFIG_INET_IPCOMP is not set
267CONFIG_INET_TUNNEL=m 272# CONFIG_INET_XFRM_TUNNEL is not set
273# CONFIG_INET_TUNNEL is not set
268CONFIG_INET_DIAG=y 274CONFIG_INET_DIAG=y
269CONFIG_INET_TCP_DIAG=y 275CONFIG_INET_TCP_DIAG=y
270# CONFIG_TCP_CONG_ADVANCED is not set 276# CONFIG_TCP_CONG_ADVANCED is not set
271CONFIG_TCP_CONG_BIC=y 277CONFIG_TCP_CONG_BIC=y
272# CONFIG_IPV6 is not set 278# CONFIG_IPV6 is not set
279# CONFIG_INET6_XFRM_TUNNEL is not set
280# CONFIG_INET6_TUNNEL is not set
273# CONFIG_NETFILTER is not set 281# CONFIG_NETFILTER is not set
274 282
275# 283#
@@ -281,6 +289,11 @@ CONFIG_TCP_CONG_BIC=y
281# SCTP Configuration (EXPERIMENTAL) 289# SCTP Configuration (EXPERIMENTAL)
282# 290#
283# CONFIG_IP_SCTP is not set 291# CONFIG_IP_SCTP is not set
292
293#
294# TIPC Configuration (EXPERIMENTAL)
295#
296# CONFIG_TIPC is not set
284# CONFIG_ATM is not set 297# CONFIG_ATM is not set
285# CONFIG_BRIDGE is not set 298# CONFIG_BRIDGE is not set
286# CONFIG_VLAN_8021Q is not set 299# CONFIG_VLAN_8021Q is not set
@@ -290,11 +303,6 @@ CONFIG_TCP_CONG_BIC=y
290# CONFIG_ATALK is not set 303# CONFIG_ATALK is not set
291# CONFIG_X25 is not set 304# CONFIG_X25 is not set
292# CONFIG_LAPB is not set 305# CONFIG_LAPB is not set
293
294#
295# TIPC Configuration (EXPERIMENTAL)
296#
297# CONFIG_TIPC is not set
298# CONFIG_NET_DIVERT is not set 306# CONFIG_NET_DIVERT is not set
299# CONFIG_ECONET is not set 307# CONFIG_ECONET is not set
300# CONFIG_WAN_ROUTER is not set 308# CONFIG_WAN_ROUTER is not set
@@ -316,6 +324,9 @@ CONFIG_IEEE80211=m
316CONFIG_IEEE80211_CRYPT_WEP=m 324CONFIG_IEEE80211_CRYPT_WEP=m
317CONFIG_IEEE80211_CRYPT_CCMP=m 325CONFIG_IEEE80211_CRYPT_CCMP=m
318CONFIG_IEEE80211_CRYPT_TKIP=m 326CONFIG_IEEE80211_CRYPT_TKIP=m
327CONFIG_IEEE80211_SOFTMAC=m
328# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
329CONFIG_WIRELESS_EXT=y
319 330
320# 331#
321# Device Drivers 332# Device Drivers
@@ -360,7 +371,7 @@ CONFIG_CONNECTOR=m
360# CONFIG_BLK_DEV_SX8 is not set 371# CONFIG_BLK_DEV_SX8 is not set
361# CONFIG_BLK_DEV_UB is not set 372# CONFIG_BLK_DEV_UB is not set
362# CONFIG_BLK_DEV_RAM is not set 373# CONFIG_BLK_DEV_RAM is not set
363CONFIG_BLK_DEV_RAM_COUNT=16 374# CONFIG_BLK_DEV_INITRD is not set
364# CONFIG_CDROM_PKTCDVD is not set 375# CONFIG_CDROM_PKTCDVD is not set
365CONFIG_ATA_OVER_ETH=m 376CONFIG_ATA_OVER_ETH=m
366 377
@@ -475,6 +486,7 @@ CONFIG_MII=m
475# Wireless LAN (non-hamradio) 486# Wireless LAN (non-hamradio)
476# 487#
477CONFIG_NET_RADIO=y 488CONFIG_NET_RADIO=y
489# CONFIG_NET_WIRELESS_RTNETLINK is not set
478 490
479# 491#
480# Obsolete Wireless cards support (pre-802.11) 492# Obsolete Wireless cards support (pre-802.11)
@@ -513,6 +525,7 @@ CONFIG_PCMCIA_HERMES=m
513# 525#
514# CONFIG_PRISM54 is not set 526# CONFIG_PRISM54 is not set
515# CONFIG_HOSTAP is not set 527# CONFIG_HOSTAP is not set
528# CONFIG_BCM43XX is not set
516CONFIG_NET_WIRELESS=y 529CONFIG_NET_WIRELESS=y
517 530
518# 531#
@@ -604,6 +617,8 @@ CONFIG_HW_CONSOLE=y
604# 617#
605# Non-8250 serial port support 618# Non-8250 serial port support
606# 619#
620# CONFIG_SERIAL_VR41XX is not set
621# CONFIG_SERIAL_JSM is not set
607CONFIG_UNIX98_PTYS=y 622CONFIG_UNIX98_PTYS=y
608CONFIG_LEGACY_PTYS=y 623CONFIG_LEGACY_PTYS=y
609CONFIG_LEGACY_PTY_COUNT=256 624CONFIG_LEGACY_PTY_COUNT=256
@@ -634,6 +649,7 @@ CONFIG_LEGACY_PTY_COUNT=256
634# CONFIG_SYNCLINK_CS is not set 649# CONFIG_SYNCLINK_CS is not set
635# CONFIG_CARDMAN_4000 is not set 650# CONFIG_CARDMAN_4000 is not set
636# CONFIG_CARDMAN_4040 is not set 651# CONFIG_CARDMAN_4040 is not set
652# CONFIG_GPIO_VR41XX is not set
637# CONFIG_RAW_DRIVER is not set 653# CONFIG_RAW_DRIVER is not set
638 654
639# 655#
@@ -669,10 +685,6 @@ CONFIG_LEGACY_PTY_COUNT=256
669# 685#
670 686
671# 687#
672# Multimedia Capabilities Port drivers
673#
674
675#
676# Multimedia devices 688# Multimedia devices
677# 689#
678# CONFIG_VIDEO_DEV is not set 690# CONFIG_VIDEO_DEV is not set
@@ -681,6 +693,7 @@ CONFIG_LEGACY_PTY_COUNT=256
681# Digital Video Broadcasting Devices 693# Digital Video Broadcasting Devices
682# 694#
683# CONFIG_DVB is not set 695# CONFIG_DVB is not set
696# CONFIG_USB_DABUSB is not set
684 697
685# 698#
686# Graphics support 699# Graphics support
@@ -703,6 +716,7 @@ CONFIG_DUMMY_CONSOLE=y
703# 716#
704CONFIG_USB_ARCH_HAS_HCD=y 717CONFIG_USB_ARCH_HAS_HCD=y
705CONFIG_USB_ARCH_HAS_OHCI=y 718CONFIG_USB_ARCH_HAS_OHCI=y
719CONFIG_USB_ARCH_HAS_EHCI=y
706CONFIG_USB=m 720CONFIG_USB=m
707# CONFIG_USB_DEBUG is not set 721# CONFIG_USB_DEBUG is not set
708 722
@@ -756,9 +770,7 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y
756# CONFIG_USB_ACECAD is not set 770# CONFIG_USB_ACECAD is not set
757# CONFIG_USB_KBTAB is not set 771# CONFIG_USB_KBTAB is not set
758# CONFIG_USB_POWERMATE is not set 772# CONFIG_USB_POWERMATE is not set
759# CONFIG_USB_MTOUCH is not set 773# CONFIG_USB_TOUCHSCREEN is not set
760# CONFIG_USB_ITMTOUCH is not set
761# CONFIG_USB_EGALAX is not set
762# CONFIG_USB_YEALINK is not set 774# CONFIG_USB_YEALINK is not set
763# CONFIG_USB_XPAD is not set 775# CONFIG_USB_XPAD is not set
764# CONFIG_USB_ATI_REMOTE is not set 776# CONFIG_USB_ATI_REMOTE is not set
@@ -772,15 +784,6 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y
772# CONFIG_USB_MDC800 is not set 784# CONFIG_USB_MDC800 is not set
773 785
774# 786#
775# USB Multimedia devices
776#
777# CONFIG_USB_DABUSB is not set
778
779#
780# Video4Linux support is needed for USB Multimedia device support
781#
782
783#
784# USB Network Adapters 787# USB Network Adapters
785# 788#
786# CONFIG_USB_CATC is not set 789# CONFIG_USB_CATC is not set
@@ -832,13 +835,31 @@ CONFIG_USB_PEGASUS=m
832# CONFIG_MMC is not set 835# CONFIG_MMC is not set
833 836
834# 837#
838# LED devices
839#
840# CONFIG_NEW_LEDS is not set
841
842#
843# LED drivers
844#
845
846#
847# LED Triggers
848#
849
850#
835# InfiniBand support 851# InfiniBand support
836# 852#
837# CONFIG_INFINIBAND is not set 853# CONFIG_INFINIBAND is not set
838 854
839# 855#
840# SN Devices 856# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
857#
858
859#
860# Real Time Clock
841# 861#
862# CONFIG_RTC_CLASS is not set
842 863
843# 864#
844# File systems 865# File systems
@@ -883,7 +904,6 @@ CONFIG_SYSFS=y
883# CONFIG_TMPFS is not set 904# CONFIG_TMPFS is not set
884# CONFIG_HUGETLB_PAGE is not set 905# CONFIG_HUGETLB_PAGE is not set
885CONFIG_RAMFS=y 906CONFIG_RAMFS=y
886CONFIG_RELAYFS_FS=m
887# CONFIG_CONFIGFS_FS is not set 907# CONFIG_CONFIGFS_FS is not set
888 908
889# 909#
@@ -946,6 +966,7 @@ CONFIG_MSDOS_PARTITION=y
946# CONFIG_MAGIC_SYSRQ is not set 966# CONFIG_MAGIC_SYSRQ is not set
947# CONFIG_DEBUG_KERNEL is not set 967# CONFIG_DEBUG_KERNEL is not set
948CONFIG_LOG_BUF_SHIFT=14 968CONFIG_LOG_BUF_SHIFT=14
969# CONFIG_DEBUG_FS is not set
949CONFIG_CROSSCOMPILE=y 970CONFIG_CROSSCOMPILE=y
950CONFIG_CMDLINE="mem=32M console=ttyVR0,19200" 971CONFIG_CMDLINE="mem=32M console=ttyVR0,19200"
951 972
diff --git a/arch/mips/configs/ocelot_3_defconfig b/arch/mips/configs/ocelot_3_defconfig
index 925d8adef88d..1ce4310fd92a 100644
--- a/arch/mips/configs/ocelot_3_defconfig
+++ b/arch/mips/configs/ocelot_3_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc1 3# Linux kernel version: 2.6.17-rc2
4# Fri Jan 27 15:40:18 2006 4# Mon Apr 24 14:51:10 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -64,6 +64,8 @@ CONFIG_MOMENCO_OCELOT_3=y
64# CONFIG_TOSHIBA_RBTX4927 is not set 64# CONFIG_TOSHIBA_RBTX4927 is not set
65# CONFIG_TOSHIBA_RBTX4938 is not set 65# CONFIG_TOSHIBA_RBTX4938 is not set
66CONFIG_RWSEM_GENERIC_SPINLOCK=y 66CONFIG_RWSEM_GENERIC_SPINLOCK=y
67CONFIG_GENERIC_FIND_NEXT_BIT=y
68CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 69CONFIG_GENERIC_CALIBRATE_DELAY=y
68CONFIG_DMA_NONCOHERENT=y 70CONFIG_DMA_NONCOHERENT=y
69CONFIG_DMA_NEED_PCI_MAP_STATE=y 71CONFIG_DMA_NEED_PCI_MAP_STATE=y
@@ -120,7 +122,6 @@ CONFIG_RM7000_CPU_SCACHE=y
120CONFIG_CPU_HAS_PREFETCH=y 122CONFIG_CPU_HAS_PREFETCH=y
121# CONFIG_MIPS_MT is not set 123# CONFIG_MIPS_MT is not set
122# CONFIG_64BIT_PHYS_ADDR is not set 124# CONFIG_64BIT_PHYS_ADDR is not set
123# CONFIG_CPU_ADVANCED is not set
124CONFIG_CPU_HAS_LLSC=y 125CONFIG_CPU_HAS_LLSC=y
125CONFIG_CPU_HAS_SYNC=y 126CONFIG_CPU_HAS_SYNC=y
126CONFIG_GENERIC_HARDIRQS=y 127CONFIG_GENERIC_HARDIRQS=y
@@ -144,7 +145,6 @@ CONFIG_PREEMPT_NONE=y
144# Code maturity level options 145# Code maturity level options
145# 146#
146CONFIG_EXPERIMENTAL=y 147CONFIG_EXPERIMENTAL=y
147CONFIG_CLEAN_COMPILE=y
148CONFIG_BROKEN_ON_SMP=y 148CONFIG_BROKEN_ON_SMP=y
149CONFIG_INIT_ENV_ARG_LIMIT=32 149CONFIG_INIT_ENV_ARG_LIMIT=32
150 150
@@ -161,6 +161,7 @@ CONFIG_SYSCTL=y
161# CONFIG_AUDIT is not set 161# CONFIG_AUDIT is not set
162CONFIG_IKCONFIG=y 162CONFIG_IKCONFIG=y
163CONFIG_IKCONFIG_PROC=y 163CONFIG_IKCONFIG_PROC=y
164CONFIG_RELAY=y
164CONFIG_INITRAMFS_SOURCE="" 165CONFIG_INITRAMFS_SOURCE=""
165# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 166# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
166CONFIG_EMBEDDED=y 167CONFIG_EMBEDDED=y
@@ -174,10 +175,6 @@ CONFIG_BASE_FULL=y
174CONFIG_FUTEX=y 175CONFIG_FUTEX=y
175CONFIG_EPOLL=y 176CONFIG_EPOLL=y
176CONFIG_SHMEM=y 177CONFIG_SHMEM=y
177CONFIG_CC_ALIGN_FUNCTIONS=0
178CONFIG_CC_ALIGN_LABELS=0
179CONFIG_CC_ALIGN_LOOPS=0
180CONFIG_CC_ALIGN_JUMPS=0
181CONFIG_SLAB=y 178CONFIG_SLAB=y
182# CONFIG_TINY_SHMEM is not set 179# CONFIG_TINY_SHMEM is not set
183CONFIG_BASE_SMALL=0 180CONFIG_BASE_SMALL=0
@@ -189,7 +186,6 @@ CONFIG_BASE_SMALL=0
189CONFIG_MODULES=y 186CONFIG_MODULES=y
190CONFIG_MODULE_UNLOAD=y 187CONFIG_MODULE_UNLOAD=y
191# CONFIG_MODULE_FORCE_UNLOAD is not set 188# CONFIG_MODULE_FORCE_UNLOAD is not set
192CONFIG_OBSOLETE_MODPARM=y
193CONFIG_MODVERSIONS=y 189CONFIG_MODVERSIONS=y
194# CONFIG_MODULE_SRCVERSION_ALL is not set 190# CONFIG_MODULE_SRCVERSION_ALL is not set
195CONFIG_KMOD=y 191CONFIG_KMOD=y
@@ -198,6 +194,8 @@ CONFIG_KMOD=y
198# Block layer 194# Block layer
199# 195#
200# CONFIG_LBD is not set 196# CONFIG_LBD is not set
197# CONFIG_BLK_DEV_IO_TRACE is not set
198# CONFIG_LSF is not set
201 199
202# 200#
203# IO Schedulers 201# IO Schedulers
@@ -217,7 +215,6 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
217# 215#
218CONFIG_HW_HAS_PCI=y 216CONFIG_HW_HAS_PCI=y
219CONFIG_PCI=y 217CONFIG_PCI=y
220CONFIG_PCI_LEGACY_PROC=y
221CONFIG_MMU=y 218CONFIG_MMU=y
222 219
223# 220#
@@ -245,6 +242,7 @@ CONFIG_NET=y
245# 242#
246# Networking options 243# Networking options
247# 244#
245# CONFIG_NETDEBUG is not set
248CONFIG_PACKET=y 246CONFIG_PACKET=y
249# CONFIG_PACKET_MMAP is not set 247# CONFIG_PACKET_MMAP is not set
250CONFIG_UNIX=y 248CONFIG_UNIX=y
@@ -266,6 +264,7 @@ CONFIG_IP_PNP_BOOTP=y
266# CONFIG_INET_AH is not set 264# CONFIG_INET_AH is not set
267# CONFIG_INET_ESP is not set 265# CONFIG_INET_ESP is not set
268# CONFIG_INET_IPCOMP is not set 266# CONFIG_INET_IPCOMP is not set
267# CONFIG_INET_XFRM_TUNNEL is not set
269# CONFIG_INET_TUNNEL is not set 268# CONFIG_INET_TUNNEL is not set
270CONFIG_INET_DIAG=y 269CONFIG_INET_DIAG=y
271CONFIG_INET_TCP_DIAG=y 270CONFIG_INET_TCP_DIAG=y
@@ -278,9 +277,12 @@ CONFIG_TCP_CONG_BIC=y
278# CONFIG_IP_VS is not set 277# CONFIG_IP_VS is not set
279CONFIG_IPV6=m 278CONFIG_IPV6=m
280# CONFIG_IPV6_PRIVACY is not set 279# CONFIG_IPV6_PRIVACY is not set
280CONFIG_IPV6_ROUTER_PREF=y
281CONFIG_IPV6_ROUTE_INFO=y
281# CONFIG_INET6_AH is not set 282# CONFIG_INET6_AH is not set
282# CONFIG_INET6_ESP is not set 283# CONFIG_INET6_ESP is not set
283# CONFIG_INET6_IPCOMP is not set 284# CONFIG_INET6_IPCOMP is not set
285# CONFIG_INET6_XFRM_TUNNEL is not set
284# CONFIG_INET6_TUNNEL is not set 286# CONFIG_INET6_TUNNEL is not set
285# CONFIG_IPV6_TUNNEL is not set 287# CONFIG_IPV6_TUNNEL is not set
286CONFIG_NETFILTER=y 288CONFIG_NETFILTER=y
@@ -299,10 +301,13 @@ CONFIG_NETFILTER_XT_TARGET_MARK=m
299CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m 301CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
300CONFIG_NETFILTER_XT_MATCH_COMMENT=m 302CONFIG_NETFILTER_XT_MATCH_COMMENT=m
301CONFIG_NETFILTER_XT_MATCH_DCCP=m 303CONFIG_NETFILTER_XT_MATCH_DCCP=m
304CONFIG_NETFILTER_XT_MATCH_ESP=m
302CONFIG_NETFILTER_XT_MATCH_LENGTH=m 305CONFIG_NETFILTER_XT_MATCH_LENGTH=m
303CONFIG_NETFILTER_XT_MATCH_LIMIT=m 306CONFIG_NETFILTER_XT_MATCH_LIMIT=m
304CONFIG_NETFILTER_XT_MATCH_MAC=m 307CONFIG_NETFILTER_XT_MATCH_MAC=m
305CONFIG_NETFILTER_XT_MATCH_MARK=m 308CONFIG_NETFILTER_XT_MATCH_MARK=m
309CONFIG_NETFILTER_XT_MATCH_POLICY=m
310CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
306CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m 311CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
307CONFIG_NETFILTER_XT_MATCH_REALM=m 312CONFIG_NETFILTER_XT_MATCH_REALM=m
308CONFIG_NETFILTER_XT_MATCH_SCTP=m 313CONFIG_NETFILTER_XT_MATCH_SCTP=m
@@ -332,6 +337,11 @@ CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
332# SCTP Configuration (EXPERIMENTAL) 337# SCTP Configuration (EXPERIMENTAL)
333# 338#
334# CONFIG_IP_SCTP is not set 339# CONFIG_IP_SCTP is not set
340
341#
342# TIPC Configuration (EXPERIMENTAL)
343#
344# CONFIG_TIPC is not set
335# CONFIG_ATM is not set 345# CONFIG_ATM is not set
336# CONFIG_BRIDGE is not set 346# CONFIG_BRIDGE is not set
337# CONFIG_VLAN_8021Q is not set 347# CONFIG_VLAN_8021Q is not set
@@ -341,11 +351,6 @@ CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
341# CONFIG_ATALK is not set 351# CONFIG_ATALK is not set
342# CONFIG_X25 is not set 352# CONFIG_X25 is not set
343# CONFIG_LAPB is not set 353# CONFIG_LAPB is not set
344
345#
346# TIPC Configuration (EXPERIMENTAL)
347#
348# CONFIG_TIPC is not set
349# CONFIG_NET_DIVERT is not set 354# CONFIG_NET_DIVERT is not set
350# CONFIG_ECONET is not set 355# CONFIG_ECONET is not set
351# CONFIG_WAN_ROUTER is not set 356# CONFIG_WAN_ROUTER is not set
@@ -367,6 +372,9 @@ CONFIG_IEEE80211=m
367# CONFIG_IEEE80211_DEBUG is not set 372# CONFIG_IEEE80211_DEBUG is not set
368CONFIG_IEEE80211_CRYPT_WEP=m 373CONFIG_IEEE80211_CRYPT_WEP=m
369CONFIG_IEEE80211_CRYPT_CCMP=m 374CONFIG_IEEE80211_CRYPT_CCMP=m
375CONFIG_IEEE80211_SOFTMAC=m
376# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
377CONFIG_WIRELESS_EXT=y
370 378
371# 379#
372# Device Drivers 380# Device Drivers
@@ -411,7 +419,7 @@ CONFIG_BLK_DEV_LOOP=y
411# CONFIG_BLK_DEV_NBD is not set 419# CONFIG_BLK_DEV_NBD is not set
412# CONFIG_BLK_DEV_SX8 is not set 420# CONFIG_BLK_DEV_SX8 is not set
413# CONFIG_BLK_DEV_RAM is not set 421# CONFIG_BLK_DEV_RAM is not set
414CONFIG_BLK_DEV_RAM_COUNT=16 422# CONFIG_BLK_DEV_INITRD is not set
415# CONFIG_CDROM_PKTCDVD is not set 423# CONFIG_CDROM_PKTCDVD is not set
416CONFIG_ATA_OVER_ETH=m 424CONFIG_ATA_OVER_ETH=m
417 425
@@ -475,7 +483,6 @@ CONFIG_ISCSI_TCP=m
475# CONFIG_SCSI_INIA100 is not set 483# CONFIG_SCSI_INIA100 is not set
476# CONFIG_SCSI_SYM53C8XX_2 is not set 484# CONFIG_SCSI_SYM53C8XX_2 is not set
477# CONFIG_SCSI_IPR is not set 485# CONFIG_SCSI_IPR is not set
478# CONFIG_SCSI_QLOGIC_FC is not set
479# CONFIG_SCSI_QLOGIC_1280 is not set 486# CONFIG_SCSI_QLOGIC_1280 is not set
480# CONFIG_SCSI_QLA_FC is not set 487# CONFIG_SCSI_QLA_FC is not set
481# CONFIG_SCSI_LPFC is not set 488# CONFIG_SCSI_LPFC is not set
@@ -690,6 +697,7 @@ CONFIG_HW_CONSOLE=y
690# 697#
691CONFIG_SERIAL_8250=y 698CONFIG_SERIAL_8250=y
692CONFIG_SERIAL_8250_CONSOLE=y 699CONFIG_SERIAL_8250_CONSOLE=y
700CONFIG_SERIAL_8250_PCI=y
693CONFIG_SERIAL_8250_NR_UARTS=4 701CONFIG_SERIAL_8250_NR_UARTS=4
694CONFIG_SERIAL_8250_RUNTIME_UARTS=4 702CONFIG_SERIAL_8250_RUNTIME_UARTS=4
695# CONFIG_SERIAL_8250_EXTENDED is not set 703# CONFIG_SERIAL_8250_EXTENDED is not set
@@ -699,6 +707,7 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=4
699# 707#
700CONFIG_SERIAL_CORE=y 708CONFIG_SERIAL_CORE=y
701CONFIG_SERIAL_CORE_CONSOLE=y 709CONFIG_SERIAL_CORE_CONSOLE=y
710# CONFIG_SERIAL_JSM is not set
702CONFIG_UNIX98_PTYS=y 711CONFIG_UNIX98_PTYS=y
703CONFIG_LEGACY_PTYS=y 712CONFIG_LEGACY_PTYS=y
704CONFIG_LEGACY_PTY_COUNT=256 713CONFIG_LEGACY_PTY_COUNT=256
@@ -756,10 +765,6 @@ CONFIG_RTC=y
756# 765#
757 766
758# 767#
759# Multimedia Capabilities Port drivers
760#
761
762#
763# Multimedia devices 768# Multimedia devices
764# 769#
765# CONFIG_VIDEO_DEV is not set 770# CONFIG_VIDEO_DEV is not set
@@ -777,6 +782,7 @@ CONFIG_FB=y
777# CONFIG_FB_CFB_COPYAREA is not set 782# CONFIG_FB_CFB_COPYAREA is not set
778# CONFIG_FB_CFB_IMAGEBLIT is not set 783# CONFIG_FB_CFB_IMAGEBLIT is not set
779# CONFIG_FB_MACMODES is not set 784# CONFIG_FB_MACMODES is not set
785CONFIG_FB_FIRMWARE_EDID=y
780CONFIG_FB_MODE_HELPERS=y 786CONFIG_FB_MODE_HELPERS=y
781# CONFIG_FB_TILEBLITTING is not set 787# CONFIG_FB_TILEBLITTING is not set
782# CONFIG_FB_CIRRUS is not set 788# CONFIG_FB_CIRRUS is not set
@@ -788,7 +794,6 @@ CONFIG_FB_MODE_HELPERS=y
788# CONFIG_FB_NVIDIA is not set 794# CONFIG_FB_NVIDIA is not set
789# CONFIG_FB_RIVA is not set 795# CONFIG_FB_RIVA is not set
790# CONFIG_FB_MATROX is not set 796# CONFIG_FB_MATROX is not set
791# CONFIG_FB_RADEON_OLD is not set
792# CONFIG_FB_RADEON is not set 797# CONFIG_FB_RADEON is not set
793# CONFIG_FB_ATY128 is not set 798# CONFIG_FB_ATY128 is not set
794# CONFIG_FB_ATY is not set 799# CONFIG_FB_ATY is not set
@@ -832,6 +837,7 @@ CONFIG_LOGO_LINUX_CLUT224=y
832# 837#
833CONFIG_USB_ARCH_HAS_HCD=y 838CONFIG_USB_ARCH_HAS_HCD=y
834CONFIG_USB_ARCH_HAS_OHCI=y 839CONFIG_USB_ARCH_HAS_OHCI=y
840CONFIG_USB_ARCH_HAS_EHCI=y
835# CONFIG_USB is not set 841# CONFIG_USB is not set
836 842
837# 843#
@@ -849,13 +855,31 @@ CONFIG_USB_ARCH_HAS_OHCI=y
849# CONFIG_MMC is not set 855# CONFIG_MMC is not set
850 856
851# 857#
858# LED devices
859#
860# CONFIG_NEW_LEDS is not set
861
862#
863# LED drivers
864#
865
866#
867# LED Triggers
868#
869
870#
852# InfiniBand support 871# InfiniBand support
853# 872#
854# CONFIG_INFINIBAND is not set 873# CONFIG_INFINIBAND is not set
855 874
856# 875#
857# SN Devices 876# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
877#
878
879#
880# Real Time Clock
858# 881#
882# CONFIG_RTC_CLASS is not set
859 883
860# 884#
861# File systems 885# File systems
@@ -914,7 +938,6 @@ CONFIG_SYSFS=y
914CONFIG_TMPFS=y 938CONFIG_TMPFS=y
915# CONFIG_HUGETLB_PAGE is not set 939# CONFIG_HUGETLB_PAGE is not set
916CONFIG_RAMFS=y 940CONFIG_RAMFS=y
917CONFIG_RELAYFS_FS=m
918# CONFIG_CONFIGFS_FS is not set 941# CONFIG_CONFIGFS_FS is not set
919 942
920# 943#
@@ -1025,6 +1048,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1025# CONFIG_MAGIC_SYSRQ is not set 1048# CONFIG_MAGIC_SYSRQ is not set
1026# CONFIG_DEBUG_KERNEL is not set 1049# CONFIG_DEBUG_KERNEL is not set
1027CONFIG_LOG_BUF_SHIFT=14 1050CONFIG_LOG_BUF_SHIFT=14
1051# CONFIG_DEBUG_FS is not set
1028CONFIG_CROSSCOMPILE=y 1052CONFIG_CROSSCOMPILE=y
1029CONFIG_CMDLINE="ip=any root=nfs" 1053CONFIG_CMDLINE="ip=any root=nfs"
1030 1054
diff --git a/arch/mips/configs/ocelot_c_defconfig b/arch/mips/configs/ocelot_c_defconfig
index ee1cf9b9eb9a..8a6aa5012f89 100644
--- a/arch/mips/configs/ocelot_c_defconfig
+++ b/arch/mips/configs/ocelot_c_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc1 3# Linux kernel version: 2.6.17-rc2
4# Fri Jan 27 15:40:19 2006 4# Mon Apr 24 14:51:10 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -64,6 +64,8 @@ CONFIG_MOMENCO_OCELOT_C=y
64# CONFIG_TOSHIBA_RBTX4927 is not set 64# CONFIG_TOSHIBA_RBTX4927 is not set
65# CONFIG_TOSHIBA_RBTX4938 is not set 65# CONFIG_TOSHIBA_RBTX4938 is not set
66CONFIG_RWSEM_GENERIC_SPINLOCK=y 66CONFIG_RWSEM_GENERIC_SPINLOCK=y
67CONFIG_GENERIC_FIND_NEXT_BIT=y
68CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 69CONFIG_GENERIC_CALIBRATE_DELAY=y
68CONFIG_DMA_NONCOHERENT=y 70CONFIG_DMA_NONCOHERENT=y
69CONFIG_DMA_NEED_PCI_MAP_STATE=y 71CONFIG_DMA_NEED_PCI_MAP_STATE=y
@@ -139,7 +141,6 @@ CONFIG_PREEMPT_NONE=y
139# Code maturity level options 141# Code maturity level options
140# 142#
141CONFIG_EXPERIMENTAL=y 143CONFIG_EXPERIMENTAL=y
142CONFIG_CLEAN_COMPILE=y
143CONFIG_BROKEN_ON_SMP=y 144CONFIG_BROKEN_ON_SMP=y
144CONFIG_INIT_ENV_ARG_LIMIT=32 145CONFIG_INIT_ENV_ARG_LIMIT=32
145 146
@@ -155,6 +156,7 @@ CONFIG_SYSVIPC=y
155CONFIG_SYSCTL=y 156CONFIG_SYSCTL=y
156# CONFIG_AUDIT is not set 157# CONFIG_AUDIT is not set
157# CONFIG_IKCONFIG is not set 158# CONFIG_IKCONFIG is not set
159CONFIG_RELAY=y
158CONFIG_INITRAMFS_SOURCE="" 160CONFIG_INITRAMFS_SOURCE=""
159# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 161# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
160CONFIG_EMBEDDED=y 162CONFIG_EMBEDDED=y
@@ -168,10 +170,6 @@ CONFIG_BASE_FULL=y
168CONFIG_FUTEX=y 170CONFIG_FUTEX=y
169CONFIG_EPOLL=y 171CONFIG_EPOLL=y
170CONFIG_SHMEM=y 172CONFIG_SHMEM=y
171CONFIG_CC_ALIGN_FUNCTIONS=0
172CONFIG_CC_ALIGN_LABELS=0
173CONFIG_CC_ALIGN_LOOPS=0
174CONFIG_CC_ALIGN_JUMPS=0
175CONFIG_SLAB=y 173CONFIG_SLAB=y
176# CONFIG_TINY_SHMEM is not set 174# CONFIG_TINY_SHMEM is not set
177CONFIG_BASE_SMALL=0 175CONFIG_BASE_SMALL=0
@@ -185,6 +183,7 @@ CONFIG_BASE_SMALL=0
185# 183#
186# Block layer 184# Block layer
187# 185#
186# CONFIG_BLK_DEV_IO_TRACE is not set
188 187
189# 188#
190# IO Schedulers 189# IO Schedulers
@@ -204,7 +203,6 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
204# 203#
205CONFIG_HW_HAS_PCI=y 204CONFIG_HW_HAS_PCI=y
206CONFIG_PCI=y 205CONFIG_PCI=y
207CONFIG_PCI_LEGACY_PROC=y
208CONFIG_MMU=y 206CONFIG_MMU=y
209 207
210# 208#
@@ -222,6 +220,7 @@ CONFIG_MMU=y
222# 220#
223CONFIG_BINFMT_ELF=y 221CONFIG_BINFMT_ELF=y
224# CONFIG_BINFMT_MISC is not set 222# CONFIG_BINFMT_MISC is not set
223# CONFIG_BUILD_ELF64 is not set
225CONFIG_MIPS32_COMPAT=y 224CONFIG_MIPS32_COMPAT=y
226CONFIG_COMPAT=y 225CONFIG_COMPAT=y
227CONFIG_MIPS32_O32=y 226CONFIG_MIPS32_O32=y
@@ -236,6 +235,7 @@ CONFIG_NET=y
236# 235#
237# Networking options 236# Networking options
238# 237#
238# CONFIG_NETDEBUG is not set
239# CONFIG_PACKET is not set 239# CONFIG_PACKET is not set
240CONFIG_UNIX=y 240CONFIG_UNIX=y
241CONFIG_XFRM=y 241CONFIG_XFRM=y
@@ -256,12 +256,15 @@ CONFIG_IP_PNP_DHCP=y
256# CONFIG_INET_AH is not set 256# CONFIG_INET_AH is not set
257# CONFIG_INET_ESP is not set 257# CONFIG_INET_ESP is not set
258# CONFIG_INET_IPCOMP is not set 258# CONFIG_INET_IPCOMP is not set
259CONFIG_INET_TUNNEL=y 259# CONFIG_INET_XFRM_TUNNEL is not set
260# CONFIG_INET_TUNNEL is not set
260CONFIG_INET_DIAG=y 261CONFIG_INET_DIAG=y
261CONFIG_INET_TCP_DIAG=y 262CONFIG_INET_TCP_DIAG=y
262# CONFIG_TCP_CONG_ADVANCED is not set 263# CONFIG_TCP_CONG_ADVANCED is not set
263CONFIG_TCP_CONG_BIC=y 264CONFIG_TCP_CONG_BIC=y
264# CONFIG_IPV6 is not set 265# CONFIG_IPV6 is not set
266# CONFIG_INET6_XFRM_TUNNEL is not set
267# CONFIG_INET6_TUNNEL is not set
265# CONFIG_NETFILTER is not set 268# CONFIG_NETFILTER is not set
266 269
267# 270#
@@ -273,6 +276,11 @@ CONFIG_TCP_CONG_BIC=y
273# SCTP Configuration (EXPERIMENTAL) 276# SCTP Configuration (EXPERIMENTAL)
274# 277#
275# CONFIG_IP_SCTP is not set 278# CONFIG_IP_SCTP is not set
279
280#
281# TIPC Configuration (EXPERIMENTAL)
282#
283# CONFIG_TIPC is not set
276# CONFIG_ATM is not set 284# CONFIG_ATM is not set
277# CONFIG_BRIDGE is not set 285# CONFIG_BRIDGE is not set
278# CONFIG_VLAN_8021Q is not set 286# CONFIG_VLAN_8021Q is not set
@@ -282,11 +290,6 @@ CONFIG_TCP_CONG_BIC=y
282# CONFIG_ATALK is not set 290# CONFIG_ATALK is not set
283# CONFIG_X25 is not set 291# CONFIG_X25 is not set
284# CONFIG_LAPB is not set 292# CONFIG_LAPB is not set
285
286#
287# TIPC Configuration (EXPERIMENTAL)
288#
289# CONFIG_TIPC is not set
290# CONFIG_NET_DIVERT is not set 293# CONFIG_NET_DIVERT is not set
291# CONFIG_ECONET is not set 294# CONFIG_ECONET is not set
292# CONFIG_WAN_ROUTER is not set 295# CONFIG_WAN_ROUTER is not set
@@ -307,6 +310,9 @@ CONFIG_IEEE80211=y
307# CONFIG_IEEE80211_DEBUG is not set 310# CONFIG_IEEE80211_DEBUG is not set
308CONFIG_IEEE80211_CRYPT_WEP=y 311CONFIG_IEEE80211_CRYPT_WEP=y
309CONFIG_IEEE80211_CRYPT_CCMP=y 312CONFIG_IEEE80211_CRYPT_CCMP=y
313CONFIG_IEEE80211_SOFTMAC=y
314# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
315CONFIG_WIRELESS_EXT=y
310 316
311# 317#
312# Device Drivers 318# Device Drivers
@@ -351,7 +357,7 @@ CONFIG_PROC_EVENTS=y
351# CONFIG_BLK_DEV_NBD is not set 357# CONFIG_BLK_DEV_NBD is not set
352# CONFIG_BLK_DEV_SX8 is not set 358# CONFIG_BLK_DEV_SX8 is not set
353# CONFIG_BLK_DEV_RAM is not set 359# CONFIG_BLK_DEV_RAM is not set
354CONFIG_BLK_DEV_RAM_COUNT=16 360# CONFIG_BLK_DEV_INITRD is not set
355CONFIG_CDROM_PKTCDVD=y 361CONFIG_CDROM_PKTCDVD=y
356CONFIG_CDROM_PKTCDVD_BUFFERS=8 362CONFIG_CDROM_PKTCDVD_BUFFERS=8
357# CONFIG_CDROM_PKTCDVD_WCACHE is not set 363# CONFIG_CDROM_PKTCDVD_WCACHE is not set
@@ -542,6 +548,7 @@ CONFIG_HW_CONSOLE=y
542# 548#
543CONFIG_SERIAL_8250=y 549CONFIG_SERIAL_8250=y
544CONFIG_SERIAL_8250_CONSOLE=y 550CONFIG_SERIAL_8250_CONSOLE=y
551CONFIG_SERIAL_8250_PCI=y
545CONFIG_SERIAL_8250_NR_UARTS=4 552CONFIG_SERIAL_8250_NR_UARTS=4
546CONFIG_SERIAL_8250_RUNTIME_UARTS=4 553CONFIG_SERIAL_8250_RUNTIME_UARTS=4
547# CONFIG_SERIAL_8250_EXTENDED is not set 554# CONFIG_SERIAL_8250_EXTENDED is not set
@@ -551,6 +558,7 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=4
551# 558#
552CONFIG_SERIAL_CORE=y 559CONFIG_SERIAL_CORE=y
553CONFIG_SERIAL_CORE_CONSOLE=y 560CONFIG_SERIAL_CORE_CONSOLE=y
561# CONFIG_SERIAL_JSM is not set
554CONFIG_UNIX98_PTYS=y 562CONFIG_UNIX98_PTYS=y
555CONFIG_LEGACY_PTYS=y 563CONFIG_LEGACY_PTYS=y
556CONFIG_LEGACY_PTY_COUNT=256 564CONFIG_LEGACY_PTY_COUNT=256
@@ -609,10 +617,6 @@ CONFIG_LEGACY_PTY_COUNT=256
609# 617#
610 618
611# 619#
612# Multimedia Capabilities Port drivers
613#
614
615#
616# Multimedia devices 620# Multimedia devices
617# 621#
618# CONFIG_VIDEO_DEV is not set 622# CONFIG_VIDEO_DEV is not set
@@ -643,6 +647,7 @@ CONFIG_DUMMY_CONSOLE=y
643# 647#
644CONFIG_USB_ARCH_HAS_HCD=y 648CONFIG_USB_ARCH_HAS_HCD=y
645CONFIG_USB_ARCH_HAS_OHCI=y 649CONFIG_USB_ARCH_HAS_OHCI=y
650CONFIG_USB_ARCH_HAS_EHCI=y
646# CONFIG_USB is not set 651# CONFIG_USB is not set
647 652
648# 653#
@@ -660,13 +665,31 @@ CONFIG_USB_ARCH_HAS_OHCI=y
660# CONFIG_MMC is not set 665# CONFIG_MMC is not set
661 666
662# 667#
668# LED devices
669#
670# CONFIG_NEW_LEDS is not set
671
672#
673# LED drivers
674#
675
676#
677# LED Triggers
678#
679
680#
663# InfiniBand support 681# InfiniBand support
664# 682#
665# CONFIG_INFINIBAND is not set 683# CONFIG_INFINIBAND is not set
666 684
667# 685#
668# SN Devices 686# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
687#
688
689#
690# Real Time Clock
669# 691#
692# CONFIG_RTC_CLASS is not set
670 693
671# 694#
672# File systems 695# File systems
@@ -711,7 +734,6 @@ CONFIG_SYSFS=y
711# CONFIG_TMPFS is not set 734# CONFIG_TMPFS is not set
712# CONFIG_HUGETLB_PAGE is not set 735# CONFIG_HUGETLB_PAGE is not set
713CONFIG_RAMFS=y 736CONFIG_RAMFS=y
714CONFIG_RELAYFS_FS=y
715# CONFIG_CONFIGFS_FS is not set 737# CONFIG_CONFIGFS_FS is not set
716 738
717# 739#
@@ -778,6 +800,8 @@ CONFIG_MSDOS_PARTITION=y
778# CONFIG_MAGIC_SYSRQ is not set 800# CONFIG_MAGIC_SYSRQ is not set
779# CONFIG_DEBUG_KERNEL is not set 801# CONFIG_DEBUG_KERNEL is not set
780CONFIG_LOG_BUF_SHIFT=14 802CONFIG_LOG_BUF_SHIFT=14
803# CONFIG_DEBUG_FS is not set
804# CONFIG_UNWIND_INFO is not set
781CONFIG_CROSSCOMPILE=y 805CONFIG_CROSSCOMPILE=y
782CONFIG_CMDLINE="" 806CONFIG_CMDLINE=""
783 807
diff --git a/arch/mips/configs/ocelot_defconfig b/arch/mips/configs/ocelot_defconfig
index d80ff278f2af..f9ee35eeb762 100644
--- a/arch/mips/configs/ocelot_defconfig
+++ b/arch/mips/configs/ocelot_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc1 3# Linux kernel version: 2.6.17-rc2
4# Fri Jan 27 15:40:20 2006 4# Mon Apr 24 14:51:11 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -64,6 +64,8 @@ CONFIG_MOMENCO_OCELOT=y
64# CONFIG_TOSHIBA_RBTX4927 is not set 64# CONFIG_TOSHIBA_RBTX4927 is not set
65# CONFIG_TOSHIBA_RBTX4938 is not set 65# CONFIG_TOSHIBA_RBTX4938 is not set
66CONFIG_RWSEM_GENERIC_SPINLOCK=y 66CONFIG_RWSEM_GENERIC_SPINLOCK=y
67CONFIG_GENERIC_FIND_NEXT_BIT=y
68CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 69CONFIG_GENERIC_CALIBRATE_DELAY=y
68CONFIG_DMA_NONCOHERENT=y 70CONFIG_DMA_NONCOHERENT=y
69CONFIG_DMA_NEED_PCI_MAP_STATE=y 71CONFIG_DMA_NEED_PCI_MAP_STATE=y
@@ -121,7 +123,6 @@ CONFIG_RM7000_CPU_SCACHE=y
121CONFIG_CPU_HAS_PREFETCH=y 123CONFIG_CPU_HAS_PREFETCH=y
122# CONFIG_MIPS_MT is not set 124# CONFIG_MIPS_MT is not set
123# CONFIG_64BIT_PHYS_ADDR is not set 125# CONFIG_64BIT_PHYS_ADDR is not set
124# CONFIG_CPU_ADVANCED is not set
125CONFIG_CPU_HAS_LLSC=y 126CONFIG_CPU_HAS_LLSC=y
126CONFIG_CPU_HAS_SYNC=y 127CONFIG_CPU_HAS_SYNC=y
127CONFIG_GENERIC_HARDIRQS=y 128CONFIG_GENERIC_HARDIRQS=y
@@ -144,7 +145,6 @@ CONFIG_PREEMPT_NONE=y
144# Code maturity level options 145# Code maturity level options
145# 146#
146CONFIG_EXPERIMENTAL=y 147CONFIG_EXPERIMENTAL=y
147CONFIG_CLEAN_COMPILE=y
148CONFIG_BROKEN_ON_SMP=y 148CONFIG_BROKEN_ON_SMP=y
149CONFIG_INIT_ENV_ARG_LIMIT=32 149CONFIG_INIT_ENV_ARG_LIMIT=32
150 150
@@ -160,6 +160,7 @@ CONFIG_SYSVIPC=y
160CONFIG_SYSCTL=y 160CONFIG_SYSCTL=y
161# CONFIG_AUDIT is not set 161# CONFIG_AUDIT is not set
162# CONFIG_IKCONFIG is not set 162# CONFIG_IKCONFIG is not set
163CONFIG_RELAY=y
163CONFIG_INITRAMFS_SOURCE="" 164CONFIG_INITRAMFS_SOURCE=""
164# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 165# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
165CONFIG_EMBEDDED=y 166CONFIG_EMBEDDED=y
@@ -173,10 +174,6 @@ CONFIG_BASE_FULL=y
173CONFIG_FUTEX=y 174CONFIG_FUTEX=y
174CONFIG_EPOLL=y 175CONFIG_EPOLL=y
175CONFIG_SHMEM=y 176CONFIG_SHMEM=y
176CONFIG_CC_ALIGN_FUNCTIONS=0
177CONFIG_CC_ALIGN_LABELS=0
178CONFIG_CC_ALIGN_LOOPS=0
179CONFIG_CC_ALIGN_JUMPS=0
180CONFIG_SLAB=y 177CONFIG_SLAB=y
181# CONFIG_TINY_SHMEM is not set 178# CONFIG_TINY_SHMEM is not set
182CONFIG_BASE_SMALL=0 179CONFIG_BASE_SMALL=0
@@ -191,6 +188,8 @@ CONFIG_BASE_SMALL=0
191# Block layer 188# Block layer
192# 189#
193# CONFIG_LBD is not set 190# CONFIG_LBD is not set
191# CONFIG_BLK_DEV_IO_TRACE is not set
192# CONFIG_LSF is not set
194 193
195# 194#
196# IO Schedulers 195# IO Schedulers
@@ -236,6 +235,7 @@ CONFIG_NET=y
236# 235#
237# Networking options 236# Networking options
238# 237#
238# CONFIG_NETDEBUG is not set
239# CONFIG_PACKET is not set 239# CONFIG_PACKET is not set
240CONFIG_UNIX=y 240CONFIG_UNIX=y
241CONFIG_XFRM=y 241CONFIG_XFRM=y
@@ -256,12 +256,15 @@ CONFIG_IP_PNP_BOOTP=y
256# CONFIG_INET_AH is not set 256# CONFIG_INET_AH is not set
257# CONFIG_INET_ESP is not set 257# CONFIG_INET_ESP is not set
258# CONFIG_INET_IPCOMP is not set 258# CONFIG_INET_IPCOMP is not set
259CONFIG_INET_TUNNEL=y 259# CONFIG_INET_XFRM_TUNNEL is not set
260# CONFIG_INET_TUNNEL is not set
260CONFIG_INET_DIAG=y 261CONFIG_INET_DIAG=y
261CONFIG_INET_TCP_DIAG=y 262CONFIG_INET_TCP_DIAG=y
262# CONFIG_TCP_CONG_ADVANCED is not set 263# CONFIG_TCP_CONG_ADVANCED is not set
263CONFIG_TCP_CONG_BIC=y 264CONFIG_TCP_CONG_BIC=y
264# CONFIG_IPV6 is not set 265# CONFIG_IPV6 is not set
266# CONFIG_INET6_XFRM_TUNNEL is not set
267# CONFIG_INET6_TUNNEL is not set
265# CONFIG_NETFILTER is not set 268# CONFIG_NETFILTER is not set
266 269
267# 270#
@@ -273,6 +276,11 @@ CONFIG_TCP_CONG_BIC=y
273# SCTP Configuration (EXPERIMENTAL) 276# SCTP Configuration (EXPERIMENTAL)
274# 277#
275# CONFIG_IP_SCTP is not set 278# CONFIG_IP_SCTP is not set
279
280#
281# TIPC Configuration (EXPERIMENTAL)
282#
283# CONFIG_TIPC is not set
276# CONFIG_ATM is not set 284# CONFIG_ATM is not set
277# CONFIG_BRIDGE is not set 285# CONFIG_BRIDGE is not set
278# CONFIG_VLAN_8021Q is not set 286# CONFIG_VLAN_8021Q is not set
@@ -282,11 +290,6 @@ CONFIG_TCP_CONG_BIC=y
282# CONFIG_ATALK is not set 290# CONFIG_ATALK is not set
283# CONFIG_X25 is not set 291# CONFIG_X25 is not set
284# CONFIG_LAPB is not set 292# CONFIG_LAPB is not set
285
286#
287# TIPC Configuration (EXPERIMENTAL)
288#
289# CONFIG_TIPC is not set
290# CONFIG_NET_DIVERT is not set 293# CONFIG_NET_DIVERT is not set
291# CONFIG_ECONET is not set 294# CONFIG_ECONET is not set
292# CONFIG_WAN_ROUTER is not set 295# CONFIG_WAN_ROUTER is not set
@@ -307,6 +310,9 @@ CONFIG_IEEE80211=y
307# CONFIG_IEEE80211_DEBUG is not set 310# CONFIG_IEEE80211_DEBUG is not set
308CONFIG_IEEE80211_CRYPT_WEP=y 311CONFIG_IEEE80211_CRYPT_WEP=y
309CONFIG_IEEE80211_CRYPT_CCMP=y 312CONFIG_IEEE80211_CRYPT_CCMP=y
313CONFIG_IEEE80211_SOFTMAC=y
314# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
315CONFIG_WIRELESS_EXT=y
310 316
311# 317#
312# Device Drivers 318# Device Drivers
@@ -346,7 +352,7 @@ CONFIG_PROC_EVENTS=y
346# CONFIG_BLK_DEV_LOOP is not set 352# CONFIG_BLK_DEV_LOOP is not set
347# CONFIG_BLK_DEV_NBD is not set 353# CONFIG_BLK_DEV_NBD is not set
348# CONFIG_BLK_DEV_RAM is not set 354# CONFIG_BLK_DEV_RAM is not set
349CONFIG_BLK_DEV_RAM_COUNT=16 355# CONFIG_BLK_DEV_INITRD is not set
350CONFIG_CDROM_PKTCDVD=y 356CONFIG_CDROM_PKTCDVD=y
351CONFIG_CDROM_PKTCDVD_BUFFERS=8 357CONFIG_CDROM_PKTCDVD_BUFFERS=8
352# CONFIG_CDROM_PKTCDVD_WCACHE is not set 358# CONFIG_CDROM_PKTCDVD_WCACHE is not set
@@ -563,10 +569,6 @@ CONFIG_LEGACY_PTY_COUNT=256
563# 569#
564 570
565# 571#
566# Multimedia Capabilities Port drivers
567#
568
569#
570# Multimedia devices 572# Multimedia devices
571# 573#
572# CONFIG_VIDEO_DEV is not set 574# CONFIG_VIDEO_DEV is not set
@@ -597,6 +599,7 @@ CONFIG_DUMMY_CONSOLE=y
597# 599#
598# CONFIG_USB_ARCH_HAS_HCD is not set 600# CONFIG_USB_ARCH_HAS_HCD is not set
599# CONFIG_USB_ARCH_HAS_OHCI is not set 601# CONFIG_USB_ARCH_HAS_OHCI is not set
602# CONFIG_USB_ARCH_HAS_EHCI is not set
600 603
601# 604#
602# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 605# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
@@ -613,12 +616,30 @@ CONFIG_DUMMY_CONSOLE=y
613# CONFIG_MMC is not set 616# CONFIG_MMC is not set
614 617
615# 618#
619# LED devices
620#
621# CONFIG_NEW_LEDS is not set
622
623#
624# LED drivers
625#
626
627#
628# LED Triggers
629#
630
631#
616# InfiniBand support 632# InfiniBand support
617# 633#
618 634
619# 635#
620# SN Devices 636# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
637#
638
639#
640# Real Time Clock
621# 641#
642# CONFIG_RTC_CLASS is not set
622 643
623# 644#
624# File systems 645# File systems
@@ -663,7 +684,6 @@ CONFIG_SYSFS=y
663# CONFIG_TMPFS is not set 684# CONFIG_TMPFS is not set
664# CONFIG_HUGETLB_PAGE is not set 685# CONFIG_HUGETLB_PAGE is not set
665CONFIG_RAMFS=y 686CONFIG_RAMFS=y
666CONFIG_RELAYFS_FS=y
667# CONFIG_CONFIGFS_FS is not set 687# CONFIG_CONFIGFS_FS is not set
668 688
669# 689#
@@ -730,6 +750,8 @@ CONFIG_MSDOS_PARTITION=y
730# CONFIG_MAGIC_SYSRQ is not set 750# CONFIG_MAGIC_SYSRQ is not set
731# CONFIG_DEBUG_KERNEL is not set 751# CONFIG_DEBUG_KERNEL is not set
732CONFIG_LOG_BUF_SHIFT=14 752CONFIG_LOG_BUF_SHIFT=14
753# CONFIG_DEBUG_FS is not set
754# CONFIG_UNWIND_INFO is not set
733CONFIG_CROSSCOMPILE=y 755CONFIG_CROSSCOMPILE=y
734CONFIG_CMDLINE="" 756CONFIG_CMDLINE=""
735 757
diff --git a/arch/mips/configs/ocelot_g_defconfig b/arch/mips/configs/ocelot_g_defconfig
index c0f508d180c4..b48bdee2411f 100644
--- a/arch/mips/configs/ocelot_g_defconfig
+++ b/arch/mips/configs/ocelot_g_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc1 3# Linux kernel version: 2.6.17-rc2
4# Fri Jan 27 15:40:21 2006 4# Mon Apr 24 14:51:11 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -64,6 +64,8 @@ CONFIG_MOMENCO_OCELOT_G=y
64# CONFIG_TOSHIBA_RBTX4927 is not set 64# CONFIG_TOSHIBA_RBTX4927 is not set
65# CONFIG_TOSHIBA_RBTX4938 is not set 65# CONFIG_TOSHIBA_RBTX4938 is not set
66CONFIG_RWSEM_GENERIC_SPINLOCK=y 66CONFIG_RWSEM_GENERIC_SPINLOCK=y
67CONFIG_GENERIC_FIND_NEXT_BIT=y
68CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 69CONFIG_GENERIC_CALIBRATE_DELAY=y
68CONFIG_DMA_NONCOHERENT=y 70CONFIG_DMA_NONCOHERENT=y
69CONFIG_DMA_NEED_PCI_MAP_STATE=y 71CONFIG_DMA_NEED_PCI_MAP_STATE=y
@@ -142,7 +144,6 @@ CONFIG_PREEMPT_NONE=y
142# Code maturity level options 144# Code maturity level options
143# 145#
144CONFIG_EXPERIMENTAL=y 146CONFIG_EXPERIMENTAL=y
145CONFIG_CLEAN_COMPILE=y
146CONFIG_BROKEN_ON_SMP=y 147CONFIG_BROKEN_ON_SMP=y
147CONFIG_INIT_ENV_ARG_LIMIT=32 148CONFIG_INIT_ENV_ARG_LIMIT=32
148 149
@@ -158,6 +159,7 @@ CONFIG_SYSVIPC=y
158CONFIG_SYSCTL=y 159CONFIG_SYSCTL=y
159# CONFIG_AUDIT is not set 160# CONFIG_AUDIT is not set
160# CONFIG_IKCONFIG is not set 161# CONFIG_IKCONFIG is not set
162CONFIG_RELAY=y
161CONFIG_INITRAMFS_SOURCE="" 163CONFIG_INITRAMFS_SOURCE=""
162# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 164# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
163CONFIG_EMBEDDED=y 165CONFIG_EMBEDDED=y
@@ -171,10 +173,6 @@ CONFIG_BASE_FULL=y
171CONFIG_FUTEX=y 173CONFIG_FUTEX=y
172CONFIG_EPOLL=y 174CONFIG_EPOLL=y
173CONFIG_SHMEM=y 175CONFIG_SHMEM=y
174CONFIG_CC_ALIGN_FUNCTIONS=0
175CONFIG_CC_ALIGN_LABELS=0
176CONFIG_CC_ALIGN_LOOPS=0
177CONFIG_CC_ALIGN_JUMPS=0
178CONFIG_SLAB=y 176CONFIG_SLAB=y
179# CONFIG_TINY_SHMEM is not set 177# CONFIG_TINY_SHMEM is not set
180CONFIG_BASE_SMALL=0 178CONFIG_BASE_SMALL=0
@@ -188,6 +186,7 @@ CONFIG_BASE_SMALL=0
188# 186#
189# Block layer 187# Block layer
190# 188#
189# CONFIG_BLK_DEV_IO_TRACE is not set
191 190
192# 191#
193# IO Schedulers 192# IO Schedulers
@@ -207,7 +206,6 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
207# 206#
208CONFIG_HW_HAS_PCI=y 207CONFIG_HW_HAS_PCI=y
209CONFIG_PCI=y 208CONFIG_PCI=y
210CONFIG_PCI_LEGACY_PROC=y
211CONFIG_MMU=y 209CONFIG_MMU=y
212 210
213# 211#
@@ -225,6 +223,7 @@ CONFIG_MMU=y
225# 223#
226CONFIG_BINFMT_ELF=y 224CONFIG_BINFMT_ELF=y
227# CONFIG_BINFMT_MISC is not set 225# CONFIG_BINFMT_MISC is not set
226# CONFIG_BUILD_ELF64 is not set
228CONFIG_MIPS32_COMPAT=y 227CONFIG_MIPS32_COMPAT=y
229CONFIG_COMPAT=y 228CONFIG_COMPAT=y
230CONFIG_MIPS32_O32=y 229CONFIG_MIPS32_O32=y
@@ -239,6 +238,7 @@ CONFIG_NET=y
239# 238#
240# Networking options 239# Networking options
241# 240#
241# CONFIG_NETDEBUG is not set
242# CONFIG_PACKET is not set 242# CONFIG_PACKET is not set
243CONFIG_UNIX=y 243CONFIG_UNIX=y
244CONFIG_XFRM=y 244CONFIG_XFRM=y
@@ -259,12 +259,15 @@ CONFIG_IP_PNP_DHCP=y
259# CONFIG_INET_AH is not set 259# CONFIG_INET_AH is not set
260# CONFIG_INET_ESP is not set 260# CONFIG_INET_ESP is not set
261# CONFIG_INET_IPCOMP is not set 261# CONFIG_INET_IPCOMP is not set
262CONFIG_INET_TUNNEL=y 262# CONFIG_INET_XFRM_TUNNEL is not set
263# CONFIG_INET_TUNNEL is not set
263CONFIG_INET_DIAG=y 264CONFIG_INET_DIAG=y
264CONFIG_INET_TCP_DIAG=y 265CONFIG_INET_TCP_DIAG=y
265# CONFIG_TCP_CONG_ADVANCED is not set 266# CONFIG_TCP_CONG_ADVANCED is not set
266CONFIG_TCP_CONG_BIC=y 267CONFIG_TCP_CONG_BIC=y
267# CONFIG_IPV6 is not set 268# CONFIG_IPV6 is not set
269# CONFIG_INET6_XFRM_TUNNEL is not set
270# CONFIG_INET6_TUNNEL is not set
268# CONFIG_NETFILTER is not set 271# CONFIG_NETFILTER is not set
269 272
270# 273#
@@ -276,6 +279,11 @@ CONFIG_TCP_CONG_BIC=y
276# SCTP Configuration (EXPERIMENTAL) 279# SCTP Configuration (EXPERIMENTAL)
277# 280#
278# CONFIG_IP_SCTP is not set 281# CONFIG_IP_SCTP is not set
282
283#
284# TIPC Configuration (EXPERIMENTAL)
285#
286# CONFIG_TIPC is not set
279# CONFIG_ATM is not set 287# CONFIG_ATM is not set
280# CONFIG_BRIDGE is not set 288# CONFIG_BRIDGE is not set
281# CONFIG_VLAN_8021Q is not set 289# CONFIG_VLAN_8021Q is not set
@@ -285,11 +293,6 @@ CONFIG_TCP_CONG_BIC=y
285# CONFIG_ATALK is not set 293# CONFIG_ATALK is not set
286# CONFIG_X25 is not set 294# CONFIG_X25 is not set
287# CONFIG_LAPB is not set 295# CONFIG_LAPB is not set
288
289#
290# TIPC Configuration (EXPERIMENTAL)
291#
292# CONFIG_TIPC is not set
293# CONFIG_NET_DIVERT is not set 296# CONFIG_NET_DIVERT is not set
294# CONFIG_ECONET is not set 297# CONFIG_ECONET is not set
295# CONFIG_WAN_ROUTER is not set 298# CONFIG_WAN_ROUTER is not set
@@ -310,6 +313,9 @@ CONFIG_IEEE80211=y
310# CONFIG_IEEE80211_DEBUG is not set 313# CONFIG_IEEE80211_DEBUG is not set
311CONFIG_IEEE80211_CRYPT_WEP=y 314CONFIG_IEEE80211_CRYPT_WEP=y
312CONFIG_IEEE80211_CRYPT_CCMP=y 315CONFIG_IEEE80211_CRYPT_CCMP=y
316CONFIG_IEEE80211_SOFTMAC=y
317# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
318CONFIG_WIRELESS_EXT=y
313 319
314# 320#
315# Device Drivers 321# Device Drivers
@@ -354,7 +360,7 @@ CONFIG_PROC_EVENTS=y
354# CONFIG_BLK_DEV_NBD is not set 360# CONFIG_BLK_DEV_NBD is not set
355# CONFIG_BLK_DEV_SX8 is not set 361# CONFIG_BLK_DEV_SX8 is not set
356# CONFIG_BLK_DEV_RAM is not set 362# CONFIG_BLK_DEV_RAM is not set
357CONFIG_BLK_DEV_RAM_COUNT=16 363# CONFIG_BLK_DEV_INITRD is not set
358CONFIG_CDROM_PKTCDVD=y 364CONFIG_CDROM_PKTCDVD=y
359CONFIG_CDROM_PKTCDVD_BUFFERS=8 365CONFIG_CDROM_PKTCDVD_BUFFERS=8
360# CONFIG_CDROM_PKTCDVD_WCACHE is not set 366# CONFIG_CDROM_PKTCDVD_WCACHE is not set
@@ -545,6 +551,7 @@ CONFIG_HW_CONSOLE=y
545# 551#
546CONFIG_SERIAL_8250=y 552CONFIG_SERIAL_8250=y
547CONFIG_SERIAL_8250_CONSOLE=y 553CONFIG_SERIAL_8250_CONSOLE=y
554CONFIG_SERIAL_8250_PCI=y
548CONFIG_SERIAL_8250_NR_UARTS=4 555CONFIG_SERIAL_8250_NR_UARTS=4
549CONFIG_SERIAL_8250_RUNTIME_UARTS=4 556CONFIG_SERIAL_8250_RUNTIME_UARTS=4
550# CONFIG_SERIAL_8250_EXTENDED is not set 557# CONFIG_SERIAL_8250_EXTENDED is not set
@@ -554,6 +561,7 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=4
554# 561#
555CONFIG_SERIAL_CORE=y 562CONFIG_SERIAL_CORE=y
556CONFIG_SERIAL_CORE_CONSOLE=y 563CONFIG_SERIAL_CORE_CONSOLE=y
564# CONFIG_SERIAL_JSM is not set
557CONFIG_UNIX98_PTYS=y 565CONFIG_UNIX98_PTYS=y
558CONFIG_LEGACY_PTYS=y 566CONFIG_LEGACY_PTYS=y
559CONFIG_LEGACY_PTY_COUNT=256 567CONFIG_LEGACY_PTY_COUNT=256
@@ -612,10 +620,6 @@ CONFIG_LEGACY_PTY_COUNT=256
612# 620#
613 621
614# 622#
615# Multimedia Capabilities Port drivers
616#
617
618#
619# Multimedia devices 623# Multimedia devices
620# 624#
621# CONFIG_VIDEO_DEV is not set 625# CONFIG_VIDEO_DEV is not set
@@ -646,6 +650,7 @@ CONFIG_DUMMY_CONSOLE=y
646# 650#
647CONFIG_USB_ARCH_HAS_HCD=y 651CONFIG_USB_ARCH_HAS_HCD=y
648CONFIG_USB_ARCH_HAS_OHCI=y 652CONFIG_USB_ARCH_HAS_OHCI=y
653CONFIG_USB_ARCH_HAS_EHCI=y
649# CONFIG_USB is not set 654# CONFIG_USB is not set
650 655
651# 656#
@@ -663,13 +668,31 @@ CONFIG_USB_ARCH_HAS_OHCI=y
663# CONFIG_MMC is not set 668# CONFIG_MMC is not set
664 669
665# 670#
671# LED devices
672#
673# CONFIG_NEW_LEDS is not set
674
675#
676# LED drivers
677#
678
679#
680# LED Triggers
681#
682
683#
666# InfiniBand support 684# InfiniBand support
667# 685#
668# CONFIG_INFINIBAND is not set 686# CONFIG_INFINIBAND is not set
669 687
670# 688#
671# SN Devices 689# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
690#
691
692#
693# Real Time Clock
672# 694#
695# CONFIG_RTC_CLASS is not set
673 696
674# 697#
675# File systems 698# File systems
@@ -714,7 +737,6 @@ CONFIG_SYSFS=y
714# CONFIG_TMPFS is not set 737# CONFIG_TMPFS is not set
715# CONFIG_HUGETLB_PAGE is not set 738# CONFIG_HUGETLB_PAGE is not set
716CONFIG_RAMFS=y 739CONFIG_RAMFS=y
717CONFIG_RELAYFS_FS=y
718# CONFIG_CONFIGFS_FS is not set 740# CONFIG_CONFIGFS_FS is not set
719 741
720# 742#
@@ -781,6 +803,8 @@ CONFIG_MSDOS_PARTITION=y
781# CONFIG_MAGIC_SYSRQ is not set 803# CONFIG_MAGIC_SYSRQ is not set
782# CONFIG_DEBUG_KERNEL is not set 804# CONFIG_DEBUG_KERNEL is not set
783CONFIG_LOG_BUF_SHIFT=14 805CONFIG_LOG_BUF_SHIFT=14
806# CONFIG_DEBUG_FS is not set
807# CONFIG_UNWIND_INFO is not set
784CONFIG_CROSSCOMPILE=y 808CONFIG_CROSSCOMPILE=y
785CONFIG_CMDLINE="" 809CONFIG_CMDLINE=""
786 810
diff --git a/arch/mips/configs/pb1100_defconfig b/arch/mips/configs/pb1100_defconfig
index 194b3c772bb7..01aac40634b4 100644
--- a/arch/mips/configs/pb1100_defconfig
+++ b/arch/mips/configs/pb1100_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc1 3# Linux kernel version: 2.6.17-rc2
4# Fri Jan 27 15:40:22 2006 4# Mon Apr 24 14:51:12 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -64,6 +64,8 @@ CONFIG_MIPS_PB1100=y
64# CONFIG_TOSHIBA_RBTX4927 is not set 64# CONFIG_TOSHIBA_RBTX4927 is not set
65# CONFIG_TOSHIBA_RBTX4938 is not set 65# CONFIG_TOSHIBA_RBTX4938 is not set
66CONFIG_RWSEM_GENERIC_SPINLOCK=y 66CONFIG_RWSEM_GENERIC_SPINLOCK=y
67CONFIG_GENERIC_FIND_NEXT_BIT=y
68CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 69CONFIG_GENERIC_CALIBRATE_DELAY=y
68CONFIG_DMA_NONCOHERENT=y 70CONFIG_DMA_NONCOHERENT=y
69CONFIG_DMA_NEED_PCI_MAP_STATE=y 71CONFIG_DMA_NEED_PCI_MAP_STATE=y
@@ -116,11 +118,11 @@ CONFIG_PAGE_SIZE_4KB=y
116CONFIG_CPU_HAS_PREFETCH=y 118CONFIG_CPU_HAS_PREFETCH=y
117# CONFIG_MIPS_MT is not set 119# CONFIG_MIPS_MT is not set
118CONFIG_64BIT_PHYS_ADDR=y 120CONFIG_64BIT_PHYS_ADDR=y
119# CONFIG_CPU_ADVANCED is not set
120CONFIG_CPU_HAS_LLSC=y 121CONFIG_CPU_HAS_LLSC=y
121CONFIG_CPU_HAS_SYNC=y 122CONFIG_CPU_HAS_SYNC=y
122CONFIG_GENERIC_HARDIRQS=y 123CONFIG_GENERIC_HARDIRQS=y
123CONFIG_GENERIC_IRQ_PROBE=y 124CONFIG_GENERIC_IRQ_PROBE=y
125CONFIG_CPU_SUPPORTS_HIGHMEM=y
124CONFIG_ARCH_FLATMEM_ENABLE=y 126CONFIG_ARCH_FLATMEM_ENABLE=y
125CONFIG_SELECT_MEMORY_MODEL=y 127CONFIG_SELECT_MEMORY_MODEL=y
126CONFIG_FLATMEM_MANUAL=y 128CONFIG_FLATMEM_MANUAL=y
@@ -138,7 +140,6 @@ CONFIG_PREEMPT_NONE=y
138# Code maturity level options 140# Code maturity level options
139# 141#
140CONFIG_EXPERIMENTAL=y 142CONFIG_EXPERIMENTAL=y
141CONFIG_CLEAN_COMPILE=y
142CONFIG_BROKEN_ON_SMP=y 143CONFIG_BROKEN_ON_SMP=y
143CONFIG_INIT_ENV_ARG_LIMIT=32 144CONFIG_INIT_ENV_ARG_LIMIT=32
144 145
@@ -154,6 +155,7 @@ CONFIG_SYSVIPC=y
154CONFIG_SYSCTL=y 155CONFIG_SYSCTL=y
155# CONFIG_AUDIT is not set 156# CONFIG_AUDIT is not set
156# CONFIG_IKCONFIG is not set 157# CONFIG_IKCONFIG is not set
158CONFIG_RELAY=y
157CONFIG_INITRAMFS_SOURCE="" 159CONFIG_INITRAMFS_SOURCE=""
158# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 160# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
159CONFIG_EMBEDDED=y 161CONFIG_EMBEDDED=y
@@ -167,10 +169,6 @@ CONFIG_BASE_FULL=y
167CONFIG_FUTEX=y 169CONFIG_FUTEX=y
168CONFIG_EPOLL=y 170CONFIG_EPOLL=y
169CONFIG_SHMEM=y 171CONFIG_SHMEM=y
170CONFIG_CC_ALIGN_FUNCTIONS=0
171CONFIG_CC_ALIGN_LABELS=0
172CONFIG_CC_ALIGN_LOOPS=0
173CONFIG_CC_ALIGN_JUMPS=0
174CONFIG_SLAB=y 172CONFIG_SLAB=y
175# CONFIG_TINY_SHMEM is not set 173# CONFIG_TINY_SHMEM is not set
176CONFIG_BASE_SMALL=0 174CONFIG_BASE_SMALL=0
@@ -183,7 +181,6 @@ CONFIG_OBSOLETE_INTERMODULE=y
183CONFIG_MODULES=y 181CONFIG_MODULES=y
184CONFIG_MODULE_UNLOAD=y 182CONFIG_MODULE_UNLOAD=y
185# CONFIG_MODULE_FORCE_UNLOAD is not set 183# CONFIG_MODULE_FORCE_UNLOAD is not set
186CONFIG_OBSOLETE_MODPARM=y
187CONFIG_MODVERSIONS=y 184CONFIG_MODVERSIONS=y
188CONFIG_MODULE_SRCVERSION_ALL=y 185CONFIG_MODULE_SRCVERSION_ALL=y
189CONFIG_KMOD=y 186CONFIG_KMOD=y
@@ -192,6 +189,8 @@ CONFIG_KMOD=y
192# Block layer 189# Block layer
193# 190#
194# CONFIG_LBD is not set 191# CONFIG_LBD is not set
192# CONFIG_BLK_DEV_IO_TRACE is not set
193# CONFIG_LSF is not set
195 194
196# 195#
197# IO Schedulers 196# IO Schedulers
@@ -247,6 +246,7 @@ CONFIG_NET=y
247# 246#
248# Networking options 247# Networking options
249# 248#
249# CONFIG_NETDEBUG is not set
250CONFIG_PACKET=y 250CONFIG_PACKET=y
251# CONFIG_PACKET_MMAP is not set 251# CONFIG_PACKET_MMAP is not set
252CONFIG_UNIX=y 252CONFIG_UNIX=y
@@ -269,7 +269,8 @@ CONFIG_IP_PNP_BOOTP=y
269# CONFIG_INET_AH is not set 269# CONFIG_INET_AH is not set
270# CONFIG_INET_ESP is not set 270# CONFIG_INET_ESP is not set
271# CONFIG_INET_IPCOMP is not set 271# CONFIG_INET_IPCOMP is not set
272CONFIG_INET_TUNNEL=m 272# CONFIG_INET_XFRM_TUNNEL is not set
273# CONFIG_INET_TUNNEL is not set
273CONFIG_INET_DIAG=y 274CONFIG_INET_DIAG=y
274CONFIG_INET_TCP_DIAG=y 275CONFIG_INET_TCP_DIAG=y
275# CONFIG_TCP_CONG_ADVANCED is not set 276# CONFIG_TCP_CONG_ADVANCED is not set
@@ -280,6 +281,8 @@ CONFIG_TCP_CONG_BIC=y
280# 281#
281# CONFIG_IP_VS is not set 282# CONFIG_IP_VS is not set
282# CONFIG_IPV6 is not set 283# CONFIG_IPV6 is not set
284# CONFIG_INET6_XFRM_TUNNEL is not set
285# CONFIG_INET6_TUNNEL is not set
283CONFIG_NETFILTER=y 286CONFIG_NETFILTER=y
284# CONFIG_NETFILTER_DEBUG is not set 287# CONFIG_NETFILTER_DEBUG is not set
285 288
@@ -296,10 +299,13 @@ CONFIG_NETFILTER_XT_TARGET_MARK=m
296CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m 299CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
297CONFIG_NETFILTER_XT_MATCH_COMMENT=m 300CONFIG_NETFILTER_XT_MATCH_COMMENT=m
298CONFIG_NETFILTER_XT_MATCH_DCCP=m 301CONFIG_NETFILTER_XT_MATCH_DCCP=m
302CONFIG_NETFILTER_XT_MATCH_ESP=m
299CONFIG_NETFILTER_XT_MATCH_LENGTH=m 303CONFIG_NETFILTER_XT_MATCH_LENGTH=m
300CONFIG_NETFILTER_XT_MATCH_LIMIT=m 304CONFIG_NETFILTER_XT_MATCH_LIMIT=m
301CONFIG_NETFILTER_XT_MATCH_MAC=m 305CONFIG_NETFILTER_XT_MATCH_MAC=m
302CONFIG_NETFILTER_XT_MATCH_MARK=m 306CONFIG_NETFILTER_XT_MATCH_MARK=m
307CONFIG_NETFILTER_XT_MATCH_POLICY=m
308CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
303CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m 309CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
304CONFIG_NETFILTER_XT_MATCH_REALM=m 310CONFIG_NETFILTER_XT_MATCH_REALM=m
305CONFIG_NETFILTER_XT_MATCH_SCTP=m 311CONFIG_NETFILTER_XT_MATCH_SCTP=m
@@ -323,6 +329,11 @@ CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
323# SCTP Configuration (EXPERIMENTAL) 329# SCTP Configuration (EXPERIMENTAL)
324# 330#
325# CONFIG_IP_SCTP is not set 331# CONFIG_IP_SCTP is not set
332
333#
334# TIPC Configuration (EXPERIMENTAL)
335#
336# CONFIG_TIPC is not set
326# CONFIG_ATM is not set 337# CONFIG_ATM is not set
327# CONFIG_BRIDGE is not set 338# CONFIG_BRIDGE is not set
328# CONFIG_VLAN_8021Q is not set 339# CONFIG_VLAN_8021Q is not set
@@ -332,11 +343,6 @@ CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
332# CONFIG_ATALK is not set 343# CONFIG_ATALK is not set
333# CONFIG_X25 is not set 344# CONFIG_X25 is not set
334# CONFIG_LAPB is not set 345# CONFIG_LAPB is not set
335
336#
337# TIPC Configuration (EXPERIMENTAL)
338#
339# CONFIG_TIPC is not set
340# CONFIG_NET_DIVERT is not set 346# CONFIG_NET_DIVERT is not set
341# CONFIG_ECONET is not set 347# CONFIG_ECONET is not set
342# CONFIG_WAN_ROUTER is not set 348# CONFIG_WAN_ROUTER is not set
@@ -358,6 +364,9 @@ CONFIG_IEEE80211=m
358# CONFIG_IEEE80211_DEBUG is not set 364# CONFIG_IEEE80211_DEBUG is not set
359CONFIG_IEEE80211_CRYPT_WEP=m 365CONFIG_IEEE80211_CRYPT_WEP=m
360CONFIG_IEEE80211_CRYPT_CCMP=m 366CONFIG_IEEE80211_CRYPT_CCMP=m
367CONFIG_IEEE80211_SOFTMAC=m
368# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
369CONFIG_WIRELESS_EXT=y
361 370
362# 371#
363# Device Drivers 372# Device Drivers
@@ -414,7 +423,6 @@ CONFIG_MTD_CFI_I2=y
414# CONFIG_MTD_CFI_I8 is not set 423# CONFIG_MTD_CFI_I8 is not set
415# CONFIG_MTD_CFI_INTELEXT is not set 424# CONFIG_MTD_CFI_INTELEXT is not set
416CONFIG_MTD_CFI_AMDSTD=y 425CONFIG_MTD_CFI_AMDSTD=y
417CONFIG_MTD_CFI_AMDSTD_RETRY=0
418# CONFIG_MTD_CFI_STAA is not set 426# CONFIG_MTD_CFI_STAA is not set
419CONFIG_MTD_CFI_UTIL=y 427CONFIG_MTD_CFI_UTIL=y
420# CONFIG_MTD_RAM is not set 428# CONFIG_MTD_RAM is not set
@@ -436,7 +444,6 @@ CONFIG_MTD_ALCHEMY=y
436# CONFIG_MTD_SLRAM is not set 444# CONFIG_MTD_SLRAM is not set
437# CONFIG_MTD_PHRAM is not set 445# CONFIG_MTD_PHRAM is not set
438# CONFIG_MTD_MTDRAM is not set 446# CONFIG_MTD_MTDRAM is not set
439# CONFIG_MTD_BLKMTD is not set
440# CONFIG_MTD_BLOCK2MTD is not set 447# CONFIG_MTD_BLOCK2MTD is not set
441 448
442# 449#
@@ -473,7 +480,7 @@ CONFIG_BLK_DEV_LOOP=y
473# CONFIG_BLK_DEV_CRYPTOLOOP is not set 480# CONFIG_BLK_DEV_CRYPTOLOOP is not set
474# CONFIG_BLK_DEV_NBD is not set 481# CONFIG_BLK_DEV_NBD is not set
475# CONFIG_BLK_DEV_RAM is not set 482# CONFIG_BLK_DEV_RAM is not set
476CONFIG_BLK_DEV_RAM_COUNT=16 483# CONFIG_BLK_DEV_INITRD is not set
477CONFIG_CDROM_PKTCDVD=m 484CONFIG_CDROM_PKTCDVD=m
478CONFIG_CDROM_PKTCDVD_BUFFERS=8 485CONFIG_CDROM_PKTCDVD_BUFFERS=8
479# CONFIG_CDROM_PKTCDVD_WCACHE is not set 486# CONFIG_CDROM_PKTCDVD_WCACHE is not set
@@ -716,10 +723,6 @@ CONFIG_SYNCLINK_CS=m
716# 723#
717 724
718# 725#
719# Multimedia Capabilities Port drivers
720#
721
722#
723# Multimedia devices 726# Multimedia devices
724# 727#
725# CONFIG_VIDEO_DEV is not set 728# CONFIG_VIDEO_DEV is not set
@@ -750,6 +753,7 @@ CONFIG_DUMMY_CONSOLE=y
750# 753#
751CONFIG_USB_ARCH_HAS_HCD=y 754CONFIG_USB_ARCH_HAS_HCD=y
752CONFIG_USB_ARCH_HAS_OHCI=y 755CONFIG_USB_ARCH_HAS_OHCI=y
756# CONFIG_USB_ARCH_HAS_EHCI is not set
753# CONFIG_USB is not set 757# CONFIG_USB is not set
754 758
755# 759#
@@ -767,12 +771,30 @@ CONFIG_USB_ARCH_HAS_OHCI=y
767# CONFIG_MMC is not set 771# CONFIG_MMC is not set
768 772
769# 773#
774# LED devices
775#
776# CONFIG_NEW_LEDS is not set
777
778#
779# LED drivers
780#
781
782#
783# LED Triggers
784#
785
786#
770# InfiniBand support 787# InfiniBand support
771# 788#
772 789
773# 790#
774# SN Devices 791# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
792#
793
794#
795# Real Time Clock
775# 796#
797# CONFIG_RTC_CLASS is not set
776 798
777# 799#
778# File systems 800# File systems
@@ -830,7 +852,6 @@ CONFIG_SYSFS=y
830CONFIG_TMPFS=y 852CONFIG_TMPFS=y
831# CONFIG_HUGETLB_PAGE is not set 853# CONFIG_HUGETLB_PAGE is not set
832CONFIG_RAMFS=y 854CONFIG_RAMFS=y
833CONFIG_RELAYFS_FS=m
834# CONFIG_CONFIGFS_FS is not set 855# CONFIG_CONFIGFS_FS is not set
835 856
836# 857#
@@ -939,6 +960,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
939# CONFIG_MAGIC_SYSRQ is not set 960# CONFIG_MAGIC_SYSRQ is not set
940# CONFIG_DEBUG_KERNEL is not set 961# CONFIG_DEBUG_KERNEL is not set
941CONFIG_LOG_BUF_SHIFT=14 962CONFIG_LOG_BUF_SHIFT=14
963# CONFIG_DEBUG_FS is not set
942CONFIG_CROSSCOMPILE=y 964CONFIG_CROSSCOMPILE=y
943CONFIG_CMDLINE="" 965CONFIG_CMDLINE=""
944 966
diff --git a/arch/mips/configs/pb1500_defconfig b/arch/mips/configs/pb1500_defconfig
index 8985725e6a98..398c3c265b9f 100644
--- a/arch/mips/configs/pb1500_defconfig
+++ b/arch/mips/configs/pb1500_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc1 3# Linux kernel version: 2.6.17-rc2
4# Fri Jan 27 15:40:24 2006 4# Mon Apr 24 14:51:13 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -64,6 +64,8 @@ CONFIG_MIPS_PB1500=y
64# CONFIG_TOSHIBA_RBTX4927 is not set 64# CONFIG_TOSHIBA_RBTX4927 is not set
65# CONFIG_TOSHIBA_RBTX4938 is not set 65# CONFIG_TOSHIBA_RBTX4938 is not set
66CONFIG_RWSEM_GENERIC_SPINLOCK=y 66CONFIG_RWSEM_GENERIC_SPINLOCK=y
67CONFIG_GENERIC_FIND_NEXT_BIT=y
68CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 69CONFIG_GENERIC_CALIBRATE_DELAY=y
68CONFIG_DMA_NONCOHERENT=y 70CONFIG_DMA_NONCOHERENT=y
69CONFIG_DMA_NEED_PCI_MAP_STATE=y 71CONFIG_DMA_NEED_PCI_MAP_STATE=y
@@ -115,11 +117,11 @@ CONFIG_PAGE_SIZE_4KB=y
115CONFIG_CPU_HAS_PREFETCH=y 117CONFIG_CPU_HAS_PREFETCH=y
116# CONFIG_MIPS_MT is not set 118# CONFIG_MIPS_MT is not set
117CONFIG_64BIT_PHYS_ADDR=y 119CONFIG_64BIT_PHYS_ADDR=y
118# CONFIG_CPU_ADVANCED is not set
119CONFIG_CPU_HAS_LLSC=y 120CONFIG_CPU_HAS_LLSC=y
120CONFIG_CPU_HAS_SYNC=y 121CONFIG_CPU_HAS_SYNC=y
121CONFIG_GENERIC_HARDIRQS=y 122CONFIG_GENERIC_HARDIRQS=y
122CONFIG_GENERIC_IRQ_PROBE=y 123CONFIG_GENERIC_IRQ_PROBE=y
124CONFIG_CPU_SUPPORTS_HIGHMEM=y
123CONFIG_ARCH_FLATMEM_ENABLE=y 125CONFIG_ARCH_FLATMEM_ENABLE=y
124CONFIG_SELECT_MEMORY_MODEL=y 126CONFIG_SELECT_MEMORY_MODEL=y
125CONFIG_FLATMEM_MANUAL=y 127CONFIG_FLATMEM_MANUAL=y
@@ -137,7 +139,6 @@ CONFIG_PREEMPT_NONE=y
137# Code maturity level options 139# Code maturity level options
138# 140#
139CONFIG_EXPERIMENTAL=y 141CONFIG_EXPERIMENTAL=y
140CONFIG_CLEAN_COMPILE=y
141CONFIG_BROKEN_ON_SMP=y 142CONFIG_BROKEN_ON_SMP=y
142CONFIG_INIT_ENV_ARG_LIMIT=32 143CONFIG_INIT_ENV_ARG_LIMIT=32
143 144
@@ -153,6 +154,7 @@ CONFIG_SYSVIPC=y
153CONFIG_SYSCTL=y 154CONFIG_SYSCTL=y
154# CONFIG_AUDIT is not set 155# CONFIG_AUDIT is not set
155# CONFIG_IKCONFIG is not set 156# CONFIG_IKCONFIG is not set
157CONFIG_RELAY=y
156CONFIG_INITRAMFS_SOURCE="" 158CONFIG_INITRAMFS_SOURCE=""
157# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 159# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
158CONFIG_EMBEDDED=y 160CONFIG_EMBEDDED=y
@@ -166,10 +168,6 @@ CONFIG_BASE_FULL=y
166CONFIG_FUTEX=y 168CONFIG_FUTEX=y
167CONFIG_EPOLL=y 169CONFIG_EPOLL=y
168CONFIG_SHMEM=y 170CONFIG_SHMEM=y
169CONFIG_CC_ALIGN_FUNCTIONS=0
170CONFIG_CC_ALIGN_LABELS=0
171CONFIG_CC_ALIGN_LOOPS=0
172CONFIG_CC_ALIGN_JUMPS=0
173CONFIG_SLAB=y 171CONFIG_SLAB=y
174# CONFIG_TINY_SHMEM is not set 172# CONFIG_TINY_SHMEM is not set
175CONFIG_BASE_SMALL=0 173CONFIG_BASE_SMALL=0
@@ -182,7 +180,6 @@ CONFIG_OBSOLETE_INTERMODULE=y
182CONFIG_MODULES=y 180CONFIG_MODULES=y
183CONFIG_MODULE_UNLOAD=y 181CONFIG_MODULE_UNLOAD=y
184# CONFIG_MODULE_FORCE_UNLOAD is not set 182# CONFIG_MODULE_FORCE_UNLOAD is not set
185CONFIG_OBSOLETE_MODPARM=y
186CONFIG_MODVERSIONS=y 183CONFIG_MODVERSIONS=y
187CONFIG_MODULE_SRCVERSION_ALL=y 184CONFIG_MODULE_SRCVERSION_ALL=y
188CONFIG_KMOD=y 185CONFIG_KMOD=y
@@ -191,6 +188,8 @@ CONFIG_KMOD=y
191# Block layer 188# Block layer
192# 189#
193# CONFIG_LBD is not set 190# CONFIG_LBD is not set
191# CONFIG_BLK_DEV_IO_TRACE is not set
192# CONFIG_LSF is not set
194 193
195# 194#
196# IO Schedulers 195# IO Schedulers
@@ -210,7 +209,6 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
210# 209#
211CONFIG_HW_HAS_PCI=y 210CONFIG_HW_HAS_PCI=y
212CONFIG_PCI=y 211CONFIG_PCI=y
213CONFIG_PCI_LEGACY_PROC=y
214CONFIG_MMU=y 212CONFIG_MMU=y
215 213
216# 214#
@@ -253,6 +251,7 @@ CONFIG_NET=y
253# 251#
254# Networking options 252# Networking options
255# 253#
254# CONFIG_NETDEBUG is not set
256CONFIG_PACKET=y 255CONFIG_PACKET=y
257# CONFIG_PACKET_MMAP is not set 256# CONFIG_PACKET_MMAP is not set
258CONFIG_UNIX=y 257CONFIG_UNIX=y
@@ -275,7 +274,8 @@ CONFIG_IP_PNP_BOOTP=y
275# CONFIG_INET_AH is not set 274# CONFIG_INET_AH is not set
276# CONFIG_INET_ESP is not set 275# CONFIG_INET_ESP is not set
277# CONFIG_INET_IPCOMP is not set 276# CONFIG_INET_IPCOMP is not set
278CONFIG_INET_TUNNEL=m 277# CONFIG_INET_XFRM_TUNNEL is not set
278# CONFIG_INET_TUNNEL is not set
279CONFIG_INET_DIAG=y 279CONFIG_INET_DIAG=y
280CONFIG_INET_TCP_DIAG=y 280CONFIG_INET_TCP_DIAG=y
281# CONFIG_TCP_CONG_ADVANCED is not set 281# CONFIG_TCP_CONG_ADVANCED is not set
@@ -286,6 +286,8 @@ CONFIG_TCP_CONG_BIC=y
286# 286#
287# CONFIG_IP_VS is not set 287# CONFIG_IP_VS is not set
288# CONFIG_IPV6 is not set 288# CONFIG_IPV6 is not set
289# CONFIG_INET6_XFRM_TUNNEL is not set
290# CONFIG_INET6_TUNNEL is not set
289CONFIG_NETFILTER=y 291CONFIG_NETFILTER=y
290# CONFIG_NETFILTER_DEBUG is not set 292# CONFIG_NETFILTER_DEBUG is not set
291 293
@@ -302,10 +304,13 @@ CONFIG_NETFILTER_XT_TARGET_MARK=m
302CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m 304CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
303CONFIG_NETFILTER_XT_MATCH_COMMENT=m 305CONFIG_NETFILTER_XT_MATCH_COMMENT=m
304CONFIG_NETFILTER_XT_MATCH_DCCP=m 306CONFIG_NETFILTER_XT_MATCH_DCCP=m
307CONFIG_NETFILTER_XT_MATCH_ESP=m
305CONFIG_NETFILTER_XT_MATCH_LENGTH=m 308CONFIG_NETFILTER_XT_MATCH_LENGTH=m
306CONFIG_NETFILTER_XT_MATCH_LIMIT=m 309CONFIG_NETFILTER_XT_MATCH_LIMIT=m
307CONFIG_NETFILTER_XT_MATCH_MAC=m 310CONFIG_NETFILTER_XT_MATCH_MAC=m
308CONFIG_NETFILTER_XT_MATCH_MARK=m 311CONFIG_NETFILTER_XT_MATCH_MARK=m
312CONFIG_NETFILTER_XT_MATCH_POLICY=m
313CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
309CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m 314CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
310CONFIG_NETFILTER_XT_MATCH_REALM=m 315CONFIG_NETFILTER_XT_MATCH_REALM=m
311CONFIG_NETFILTER_XT_MATCH_SCTP=m 316CONFIG_NETFILTER_XT_MATCH_SCTP=m
@@ -329,6 +334,11 @@ CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
329# SCTP Configuration (EXPERIMENTAL) 334# SCTP Configuration (EXPERIMENTAL)
330# 335#
331# CONFIG_IP_SCTP is not set 336# CONFIG_IP_SCTP is not set
337
338#
339# TIPC Configuration (EXPERIMENTAL)
340#
341# CONFIG_TIPC is not set
332# CONFIG_ATM is not set 342# CONFIG_ATM is not set
333# CONFIG_BRIDGE is not set 343# CONFIG_BRIDGE is not set
334# CONFIG_VLAN_8021Q is not set 344# CONFIG_VLAN_8021Q is not set
@@ -338,11 +348,6 @@ CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
338# CONFIG_ATALK is not set 348# CONFIG_ATALK is not set
339# CONFIG_X25 is not set 349# CONFIG_X25 is not set
340# CONFIG_LAPB is not set 350# CONFIG_LAPB is not set
341
342#
343# TIPC Configuration (EXPERIMENTAL)
344#
345# CONFIG_TIPC is not set
346# CONFIG_NET_DIVERT is not set 351# CONFIG_NET_DIVERT is not set
347# CONFIG_ECONET is not set 352# CONFIG_ECONET is not set
348# CONFIG_WAN_ROUTER is not set 353# CONFIG_WAN_ROUTER is not set
@@ -364,6 +369,9 @@ CONFIG_IEEE80211=m
364# CONFIG_IEEE80211_DEBUG is not set 369# CONFIG_IEEE80211_DEBUG is not set
365CONFIG_IEEE80211_CRYPT_WEP=m 370CONFIG_IEEE80211_CRYPT_WEP=m
366CONFIG_IEEE80211_CRYPT_CCMP=m 371CONFIG_IEEE80211_CRYPT_CCMP=m
372CONFIG_IEEE80211_SOFTMAC=m
373# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
374CONFIG_WIRELESS_EXT=y
367 375
368# 376#
369# Device Drivers 377# Device Drivers
@@ -420,7 +428,6 @@ CONFIG_MTD_CFI_I2=y
420# CONFIG_MTD_CFI_I8 is not set 428# CONFIG_MTD_CFI_I8 is not set
421# CONFIG_MTD_CFI_INTELEXT is not set 429# CONFIG_MTD_CFI_INTELEXT is not set
422CONFIG_MTD_CFI_AMDSTD=y 430CONFIG_MTD_CFI_AMDSTD=y
423CONFIG_MTD_CFI_AMDSTD_RETRY=0
424# CONFIG_MTD_CFI_STAA is not set 431# CONFIG_MTD_CFI_STAA is not set
425CONFIG_MTD_CFI_UTIL=y 432CONFIG_MTD_CFI_UTIL=y
426# CONFIG_MTD_RAM is not set 433# CONFIG_MTD_RAM is not set
@@ -443,7 +450,6 @@ CONFIG_MTD_ALCHEMY=y
443# CONFIG_MTD_SLRAM is not set 450# CONFIG_MTD_SLRAM is not set
444# CONFIG_MTD_PHRAM is not set 451# CONFIG_MTD_PHRAM is not set
445# CONFIG_MTD_MTDRAM is not set 452# CONFIG_MTD_MTDRAM is not set
446# CONFIG_MTD_BLKMTD is not set
447# CONFIG_MTD_BLOCK2MTD is not set 453# CONFIG_MTD_BLOCK2MTD is not set
448 454
449# 455#
@@ -485,7 +491,7 @@ CONFIG_BLK_DEV_LOOP=y
485# CONFIG_BLK_DEV_NBD is not set 491# CONFIG_BLK_DEV_NBD is not set
486# CONFIG_BLK_DEV_SX8 is not set 492# CONFIG_BLK_DEV_SX8 is not set
487# CONFIG_BLK_DEV_RAM is not set 493# CONFIG_BLK_DEV_RAM is not set
488CONFIG_BLK_DEV_RAM_COUNT=16 494# CONFIG_BLK_DEV_INITRD is not set
489CONFIG_CDROM_PKTCDVD=m 495CONFIG_CDROM_PKTCDVD=m
490CONFIG_CDROM_PKTCDVD_BUFFERS=8 496CONFIG_CDROM_PKTCDVD_BUFFERS=8
491# CONFIG_CDROM_PKTCDVD_WCACHE is not set 497# CONFIG_CDROM_PKTCDVD_WCACHE is not set
@@ -750,6 +756,7 @@ CONFIG_SERIO_RAW=m
750# 756#
751CONFIG_SERIAL_8250=y 757CONFIG_SERIAL_8250=y
752CONFIG_SERIAL_8250_CONSOLE=y 758CONFIG_SERIAL_8250_CONSOLE=y
759CONFIG_SERIAL_8250_PCI=y
753# CONFIG_SERIAL_8250_CS is not set 760# CONFIG_SERIAL_8250_CS is not set
754CONFIG_SERIAL_8250_NR_UARTS=4 761CONFIG_SERIAL_8250_NR_UARTS=4
755CONFIG_SERIAL_8250_RUNTIME_UARTS=4 762CONFIG_SERIAL_8250_RUNTIME_UARTS=4
@@ -761,6 +768,7 @@ CONFIG_SERIAL_8250_AU1X00=y
761# 768#
762CONFIG_SERIAL_CORE=y 769CONFIG_SERIAL_CORE=y
763CONFIG_SERIAL_CORE_CONSOLE=y 770CONFIG_SERIAL_CORE_CONSOLE=y
771# CONFIG_SERIAL_JSM is not set
764CONFIG_UNIX98_PTYS=y 772CONFIG_UNIX98_PTYS=y
765CONFIG_LEGACY_PTYS=y 773CONFIG_LEGACY_PTYS=y
766CONFIG_LEGACY_PTY_COUNT=256 774CONFIG_LEGACY_PTY_COUNT=256
@@ -826,10 +834,6 @@ CONFIG_SYNCLINK_CS=m
826# 834#
827 835
828# 836#
829# Multimedia Capabilities Port drivers
830#
831
832#
833# Multimedia devices 837# Multimedia devices
834# 838#
835# CONFIG_VIDEO_DEV is not set 839# CONFIG_VIDEO_DEV is not set
@@ -854,6 +858,7 @@ CONFIG_SYNCLINK_CS=m
854# 858#
855CONFIG_USB_ARCH_HAS_HCD=y 859CONFIG_USB_ARCH_HAS_HCD=y
856CONFIG_USB_ARCH_HAS_OHCI=y 860CONFIG_USB_ARCH_HAS_OHCI=y
861CONFIG_USB_ARCH_HAS_EHCI=y
857# CONFIG_USB is not set 862# CONFIG_USB is not set
858 863
859# 864#
@@ -871,13 +876,31 @@ CONFIG_USB_ARCH_HAS_OHCI=y
871# CONFIG_MMC is not set 876# CONFIG_MMC is not set
872 877
873# 878#
879# LED devices
880#
881# CONFIG_NEW_LEDS is not set
882
883#
884# LED drivers
885#
886
887#
888# LED Triggers
889#
890
891#
874# InfiniBand support 892# InfiniBand support
875# 893#
876# CONFIG_INFINIBAND is not set 894# CONFIG_INFINIBAND is not set
877 895
878# 896#
879# SN Devices 897# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
898#
899
900#
901# Real Time Clock
880# 902#
903# CONFIG_RTC_CLASS is not set
881 904
882# 905#
883# File systems 906# File systems
@@ -935,7 +958,6 @@ CONFIG_SYSFS=y
935CONFIG_TMPFS=y 958CONFIG_TMPFS=y
936# CONFIG_HUGETLB_PAGE is not set 959# CONFIG_HUGETLB_PAGE is not set
937CONFIG_RAMFS=y 960CONFIG_RAMFS=y
938CONFIG_RELAYFS_FS=m
939# CONFIG_CONFIGFS_FS is not set 961# CONFIG_CONFIGFS_FS is not set
940 962
941# 963#
@@ -1044,6 +1066,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1044# CONFIG_MAGIC_SYSRQ is not set 1066# CONFIG_MAGIC_SYSRQ is not set
1045# CONFIG_DEBUG_KERNEL is not set 1067# CONFIG_DEBUG_KERNEL is not set
1046CONFIG_LOG_BUF_SHIFT=14 1068CONFIG_LOG_BUF_SHIFT=14
1069# CONFIG_DEBUG_FS is not set
1047CONFIG_CROSSCOMPILE=y 1070CONFIG_CROSSCOMPILE=y
1048CONFIG_CMDLINE="" 1071CONFIG_CMDLINE=""
1049 1072
diff --git a/arch/mips/configs/pb1550_defconfig b/arch/mips/configs/pb1550_defconfig
index adbf997b540e..ea282a53bb66 100644
--- a/arch/mips/configs/pb1550_defconfig
+++ b/arch/mips/configs/pb1550_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc1 3# Linux kernel version: 2.6.17-rc2
4# Fri Jan 27 15:40:25 2006 4# Mon Apr 24 14:51:13 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -64,6 +64,8 @@ CONFIG_MIPS_PB1550=y
64# CONFIG_TOSHIBA_RBTX4927 is not set 64# CONFIG_TOSHIBA_RBTX4927 is not set
65# CONFIG_TOSHIBA_RBTX4938 is not set 65# CONFIG_TOSHIBA_RBTX4938 is not set
66CONFIG_RWSEM_GENERIC_SPINLOCK=y 66CONFIG_RWSEM_GENERIC_SPINLOCK=y
67CONFIG_GENERIC_FIND_NEXT_BIT=y
68CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 69CONFIG_GENERIC_CALIBRATE_DELAY=y
68CONFIG_DMA_NONCOHERENT=y 70CONFIG_DMA_NONCOHERENT=y
69CONFIG_DMA_NEED_PCI_MAP_STATE=y 71CONFIG_DMA_NEED_PCI_MAP_STATE=y
@@ -115,11 +117,11 @@ CONFIG_PAGE_SIZE_4KB=y
115CONFIG_CPU_HAS_PREFETCH=y 117CONFIG_CPU_HAS_PREFETCH=y
116# CONFIG_MIPS_MT is not set 118# CONFIG_MIPS_MT is not set
117CONFIG_64BIT_PHYS_ADDR=y 119CONFIG_64BIT_PHYS_ADDR=y
118# CONFIG_CPU_ADVANCED is not set
119CONFIG_CPU_HAS_LLSC=y 120CONFIG_CPU_HAS_LLSC=y
120CONFIG_CPU_HAS_SYNC=y 121CONFIG_CPU_HAS_SYNC=y
121CONFIG_GENERIC_HARDIRQS=y 122CONFIG_GENERIC_HARDIRQS=y
122CONFIG_GENERIC_IRQ_PROBE=y 123CONFIG_GENERIC_IRQ_PROBE=y
124CONFIG_CPU_SUPPORTS_HIGHMEM=y
123CONFIG_ARCH_FLATMEM_ENABLE=y 125CONFIG_ARCH_FLATMEM_ENABLE=y
124CONFIG_SELECT_MEMORY_MODEL=y 126CONFIG_SELECT_MEMORY_MODEL=y
125CONFIG_FLATMEM_MANUAL=y 127CONFIG_FLATMEM_MANUAL=y
@@ -137,7 +139,6 @@ CONFIG_PREEMPT_NONE=y
137# Code maturity level options 139# Code maturity level options
138# 140#
139CONFIG_EXPERIMENTAL=y 141CONFIG_EXPERIMENTAL=y
140CONFIG_CLEAN_COMPILE=y
141CONFIG_BROKEN_ON_SMP=y 142CONFIG_BROKEN_ON_SMP=y
142CONFIG_INIT_ENV_ARG_LIMIT=32 143CONFIG_INIT_ENV_ARG_LIMIT=32
143 144
@@ -153,6 +154,7 @@ CONFIG_SYSVIPC=y
153CONFIG_SYSCTL=y 154CONFIG_SYSCTL=y
154# CONFIG_AUDIT is not set 155# CONFIG_AUDIT is not set
155# CONFIG_IKCONFIG is not set 156# CONFIG_IKCONFIG is not set
157CONFIG_RELAY=y
156CONFIG_INITRAMFS_SOURCE="" 158CONFIG_INITRAMFS_SOURCE=""
157# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 159# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
158CONFIG_EMBEDDED=y 160CONFIG_EMBEDDED=y
@@ -166,10 +168,6 @@ CONFIG_BASE_FULL=y
166CONFIG_FUTEX=y 168CONFIG_FUTEX=y
167CONFIG_EPOLL=y 169CONFIG_EPOLL=y
168CONFIG_SHMEM=y 170CONFIG_SHMEM=y
169CONFIG_CC_ALIGN_FUNCTIONS=0
170CONFIG_CC_ALIGN_LABELS=0
171CONFIG_CC_ALIGN_LOOPS=0
172CONFIG_CC_ALIGN_JUMPS=0
173CONFIG_SLAB=y 171CONFIG_SLAB=y
174# CONFIG_TINY_SHMEM is not set 172# CONFIG_TINY_SHMEM is not set
175CONFIG_BASE_SMALL=0 173CONFIG_BASE_SMALL=0
@@ -182,7 +180,6 @@ CONFIG_OBSOLETE_INTERMODULE=y
182CONFIG_MODULES=y 180CONFIG_MODULES=y
183CONFIG_MODULE_UNLOAD=y 181CONFIG_MODULE_UNLOAD=y
184# CONFIG_MODULE_FORCE_UNLOAD is not set 182# CONFIG_MODULE_FORCE_UNLOAD is not set
185CONFIG_OBSOLETE_MODPARM=y
186CONFIG_MODVERSIONS=y 183CONFIG_MODVERSIONS=y
187CONFIG_MODULE_SRCVERSION_ALL=y 184CONFIG_MODULE_SRCVERSION_ALL=y
188CONFIG_KMOD=y 185CONFIG_KMOD=y
@@ -191,6 +188,8 @@ CONFIG_KMOD=y
191# Block layer 188# Block layer
192# 189#
193# CONFIG_LBD is not set 190# CONFIG_LBD is not set
191# CONFIG_BLK_DEV_IO_TRACE is not set
192# CONFIG_LSF is not set
194 193
195# 194#
196# IO Schedulers 195# IO Schedulers
@@ -210,7 +209,6 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
210# 209#
211CONFIG_HW_HAS_PCI=y 210CONFIG_HW_HAS_PCI=y
212CONFIG_PCI=y 211CONFIG_PCI=y
213CONFIG_PCI_LEGACY_PROC=y
214CONFIG_MMU=y 212CONFIG_MMU=y
215 213
216# 214#
@@ -253,6 +251,7 @@ CONFIG_NET=y
253# 251#
254# Networking options 252# Networking options
255# 253#
254# CONFIG_NETDEBUG is not set
256CONFIG_PACKET=y 255CONFIG_PACKET=y
257# CONFIG_PACKET_MMAP is not set 256# CONFIG_PACKET_MMAP is not set
258CONFIG_UNIX=y 257CONFIG_UNIX=y
@@ -275,7 +274,8 @@ CONFIG_IP_PNP_BOOTP=y
275# CONFIG_INET_AH is not set 274# CONFIG_INET_AH is not set
276# CONFIG_INET_ESP is not set 275# CONFIG_INET_ESP is not set
277# CONFIG_INET_IPCOMP is not set 276# CONFIG_INET_IPCOMP is not set
278CONFIG_INET_TUNNEL=m 277# CONFIG_INET_XFRM_TUNNEL is not set
278# CONFIG_INET_TUNNEL is not set
279CONFIG_INET_DIAG=y 279CONFIG_INET_DIAG=y
280CONFIG_INET_TCP_DIAG=y 280CONFIG_INET_TCP_DIAG=y
281# CONFIG_TCP_CONG_ADVANCED is not set 281# CONFIG_TCP_CONG_ADVANCED is not set
@@ -286,6 +286,8 @@ CONFIG_TCP_CONG_BIC=y
286# 286#
287# CONFIG_IP_VS is not set 287# CONFIG_IP_VS is not set
288# CONFIG_IPV6 is not set 288# CONFIG_IPV6 is not set
289# CONFIG_INET6_XFRM_TUNNEL is not set
290# CONFIG_INET6_TUNNEL is not set
289CONFIG_NETFILTER=y 291CONFIG_NETFILTER=y
290# CONFIG_NETFILTER_DEBUG is not set 292# CONFIG_NETFILTER_DEBUG is not set
291 293
@@ -302,10 +304,13 @@ CONFIG_NETFILTER_XT_TARGET_MARK=m
302CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m 304CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
303CONFIG_NETFILTER_XT_MATCH_COMMENT=m 305CONFIG_NETFILTER_XT_MATCH_COMMENT=m
304CONFIG_NETFILTER_XT_MATCH_DCCP=m 306CONFIG_NETFILTER_XT_MATCH_DCCP=m
307CONFIG_NETFILTER_XT_MATCH_ESP=m
305CONFIG_NETFILTER_XT_MATCH_LENGTH=m 308CONFIG_NETFILTER_XT_MATCH_LENGTH=m
306CONFIG_NETFILTER_XT_MATCH_LIMIT=m 309CONFIG_NETFILTER_XT_MATCH_LIMIT=m
307CONFIG_NETFILTER_XT_MATCH_MAC=m 310CONFIG_NETFILTER_XT_MATCH_MAC=m
308CONFIG_NETFILTER_XT_MATCH_MARK=m 311CONFIG_NETFILTER_XT_MATCH_MARK=m
312CONFIG_NETFILTER_XT_MATCH_POLICY=m
313CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
309CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m 314CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
310CONFIG_NETFILTER_XT_MATCH_REALM=m 315CONFIG_NETFILTER_XT_MATCH_REALM=m
311CONFIG_NETFILTER_XT_MATCH_SCTP=m 316CONFIG_NETFILTER_XT_MATCH_SCTP=m
@@ -329,6 +334,11 @@ CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
329# SCTP Configuration (EXPERIMENTAL) 334# SCTP Configuration (EXPERIMENTAL)
330# 335#
331# CONFIG_IP_SCTP is not set 336# CONFIG_IP_SCTP is not set
337
338#
339# TIPC Configuration (EXPERIMENTAL)
340#
341# CONFIG_TIPC is not set
332# CONFIG_ATM is not set 342# CONFIG_ATM is not set
333# CONFIG_BRIDGE is not set 343# CONFIG_BRIDGE is not set
334# CONFIG_VLAN_8021Q is not set 344# CONFIG_VLAN_8021Q is not set
@@ -338,11 +348,6 @@ CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
338# CONFIG_ATALK is not set 348# CONFIG_ATALK is not set
339# CONFIG_X25 is not set 349# CONFIG_X25 is not set
340# CONFIG_LAPB is not set 350# CONFIG_LAPB is not set
341
342#
343# TIPC Configuration (EXPERIMENTAL)
344#
345# CONFIG_TIPC is not set
346# CONFIG_NET_DIVERT is not set 351# CONFIG_NET_DIVERT is not set
347# CONFIG_ECONET is not set 352# CONFIG_ECONET is not set
348# CONFIG_WAN_ROUTER is not set 353# CONFIG_WAN_ROUTER is not set
@@ -364,6 +369,9 @@ CONFIG_IEEE80211=m
364# CONFIG_IEEE80211_DEBUG is not set 369# CONFIG_IEEE80211_DEBUG is not set
365CONFIG_IEEE80211_CRYPT_WEP=m 370CONFIG_IEEE80211_CRYPT_WEP=m
366CONFIG_IEEE80211_CRYPT_CCMP=m 371CONFIG_IEEE80211_CRYPT_CCMP=m
372CONFIG_IEEE80211_SOFTMAC=m
373# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
374CONFIG_WIRELESS_EXT=y
367 375
368# 376#
369# Device Drivers 377# Device Drivers
@@ -420,7 +428,6 @@ CONFIG_MTD_CFI_I2=y
420# CONFIG_MTD_CFI_I8 is not set 428# CONFIG_MTD_CFI_I8 is not set
421# CONFIG_MTD_CFI_INTELEXT is not set 429# CONFIG_MTD_CFI_INTELEXT is not set
422CONFIG_MTD_CFI_AMDSTD=y 430CONFIG_MTD_CFI_AMDSTD=y
423CONFIG_MTD_CFI_AMDSTD_RETRY=0
424# CONFIG_MTD_CFI_STAA is not set 431# CONFIG_MTD_CFI_STAA is not set
425CONFIG_MTD_CFI_UTIL=y 432CONFIG_MTD_CFI_UTIL=y
426# CONFIG_MTD_RAM is not set 433# CONFIG_MTD_RAM is not set
@@ -443,7 +450,6 @@ CONFIG_MTD_ALCHEMY=y
443# CONFIG_MTD_SLRAM is not set 450# CONFIG_MTD_SLRAM is not set
444# CONFIG_MTD_PHRAM is not set 451# CONFIG_MTD_PHRAM is not set
445# CONFIG_MTD_MTDRAM is not set 452# CONFIG_MTD_MTDRAM is not set
446# CONFIG_MTD_BLKMTD is not set
447# CONFIG_MTD_BLOCK2MTD is not set 453# CONFIG_MTD_BLOCK2MTD is not set
448 454
449# 455#
@@ -485,7 +491,7 @@ CONFIG_BLK_DEV_LOOP=y
485# CONFIG_BLK_DEV_NBD is not set 491# CONFIG_BLK_DEV_NBD is not set
486# CONFIG_BLK_DEV_SX8 is not set 492# CONFIG_BLK_DEV_SX8 is not set
487# CONFIG_BLK_DEV_RAM is not set 493# CONFIG_BLK_DEV_RAM is not set
488CONFIG_BLK_DEV_RAM_COUNT=16 494# CONFIG_BLK_DEV_INITRD is not set
489CONFIG_CDROM_PKTCDVD=m 495CONFIG_CDROM_PKTCDVD=m
490CONFIG_CDROM_PKTCDVD_BUFFERS=8 496CONFIG_CDROM_PKTCDVD_BUFFERS=8
491# CONFIG_CDROM_PKTCDVD_WCACHE is not set 497# CONFIG_CDROM_PKTCDVD_WCACHE is not set
@@ -742,6 +748,7 @@ CONFIG_SERIO_RAW=m
742# 748#
743CONFIG_SERIAL_8250=y 749CONFIG_SERIAL_8250=y
744CONFIG_SERIAL_8250_CONSOLE=y 750CONFIG_SERIAL_8250_CONSOLE=y
751CONFIG_SERIAL_8250_PCI=y
745# CONFIG_SERIAL_8250_CS is not set 752# CONFIG_SERIAL_8250_CS is not set
746CONFIG_SERIAL_8250_NR_UARTS=4 753CONFIG_SERIAL_8250_NR_UARTS=4
747CONFIG_SERIAL_8250_RUNTIME_UARTS=4 754CONFIG_SERIAL_8250_RUNTIME_UARTS=4
@@ -753,6 +760,7 @@ CONFIG_SERIAL_8250_AU1X00=y
753# 760#
754CONFIG_SERIAL_CORE=y 761CONFIG_SERIAL_CORE=y
755CONFIG_SERIAL_CORE_CONSOLE=y 762CONFIG_SERIAL_CORE_CONSOLE=y
763# CONFIG_SERIAL_JSM is not set
756CONFIG_UNIX98_PTYS=y 764CONFIG_UNIX98_PTYS=y
757CONFIG_LEGACY_PTYS=y 765CONFIG_LEGACY_PTYS=y
758CONFIG_LEGACY_PTY_COUNT=256 766CONFIG_LEGACY_PTY_COUNT=256
@@ -818,10 +826,6 @@ CONFIG_SYNCLINK_CS=m
818# 826#
819 827
820# 828#
821# Multimedia Capabilities Port drivers
822#
823
824#
825# Multimedia devices 829# Multimedia devices
826# 830#
827# CONFIG_VIDEO_DEV is not set 831# CONFIG_VIDEO_DEV is not set
@@ -846,6 +850,7 @@ CONFIG_SYNCLINK_CS=m
846# 850#
847CONFIG_USB_ARCH_HAS_HCD=y 851CONFIG_USB_ARCH_HAS_HCD=y
848CONFIG_USB_ARCH_HAS_OHCI=y 852CONFIG_USB_ARCH_HAS_OHCI=y
853CONFIG_USB_ARCH_HAS_EHCI=y
849# CONFIG_USB is not set 854# CONFIG_USB is not set
850 855
851# 856#
@@ -863,13 +868,31 @@ CONFIG_USB_ARCH_HAS_OHCI=y
863# CONFIG_MMC is not set 868# CONFIG_MMC is not set
864 869
865# 870#
871# LED devices
872#
873# CONFIG_NEW_LEDS is not set
874
875#
876# LED drivers
877#
878
879#
880# LED Triggers
881#
882
883#
866# InfiniBand support 884# InfiniBand support
867# 885#
868# CONFIG_INFINIBAND is not set 886# CONFIG_INFINIBAND is not set
869 887
870# 888#
871# SN Devices 889# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
890#
891
892#
893# Real Time Clock
872# 894#
895# CONFIG_RTC_CLASS is not set
873 896
874# 897#
875# File systems 898# File systems
@@ -927,7 +950,6 @@ CONFIG_SYSFS=y
927CONFIG_TMPFS=y 950CONFIG_TMPFS=y
928# CONFIG_HUGETLB_PAGE is not set 951# CONFIG_HUGETLB_PAGE is not set
929CONFIG_RAMFS=y 952CONFIG_RAMFS=y
930CONFIG_RELAYFS_FS=m
931# CONFIG_CONFIGFS_FS is not set 953# CONFIG_CONFIGFS_FS is not set
932 954
933# 955#
@@ -1036,6 +1058,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1036# CONFIG_MAGIC_SYSRQ is not set 1058# CONFIG_MAGIC_SYSRQ is not set
1037# CONFIG_DEBUG_KERNEL is not set 1059# CONFIG_DEBUG_KERNEL is not set
1038CONFIG_LOG_BUF_SHIFT=14 1060CONFIG_LOG_BUF_SHIFT=14
1061# CONFIG_DEBUG_FS is not set
1039CONFIG_CROSSCOMPILE=y 1062CONFIG_CROSSCOMPILE=y
1040CONFIG_CMDLINE="" 1063CONFIG_CMDLINE=""
1041 1064
diff --git a/arch/mips/configs/pnx8550-jbs_defconfig b/arch/mips/configs/pnx8550-jbs_defconfig
index b5db700450ba..4c57e564db0b 100644
--- a/arch/mips/configs/pnx8550-jbs_defconfig
+++ b/arch/mips/configs/pnx8550-jbs_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc1 3# Linux kernel version: 2.6.17-rc2
4# Fri Jan 27 15:40:26 2006 4# Mon Apr 24 14:51:14 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -64,6 +64,8 @@ CONFIG_PNX8550_JBS=y
64# CONFIG_TOSHIBA_RBTX4927 is not set 64# CONFIG_TOSHIBA_RBTX4927 is not set
65# CONFIG_TOSHIBA_RBTX4938 is not set 65# CONFIG_TOSHIBA_RBTX4938 is not set
66CONFIG_RWSEM_GENERIC_SPINLOCK=y 66CONFIG_RWSEM_GENERIC_SPINLOCK=y
67CONFIG_GENERIC_FIND_NEXT_BIT=y
68CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 69CONFIG_GENERIC_CALIBRATE_DELAY=y
68CONFIG_DMA_NONCOHERENT=y 70CONFIG_DMA_NONCOHERENT=y
69CONFIG_DMA_NEED_PCI_MAP_STATE=y 71CONFIG_DMA_NEED_PCI_MAP_STATE=y
@@ -114,11 +116,11 @@ CONFIG_PAGE_SIZE_4KB=y
114CONFIG_CPU_HAS_PREFETCH=y 116CONFIG_CPU_HAS_PREFETCH=y
115# CONFIG_MIPS_MT is not set 117# CONFIG_MIPS_MT is not set
116# CONFIG_64BIT_PHYS_ADDR is not set 118# CONFIG_64BIT_PHYS_ADDR is not set
117# CONFIG_CPU_ADVANCED is not set
118CONFIG_CPU_HAS_LLSC=y 119CONFIG_CPU_HAS_LLSC=y
119CONFIG_CPU_HAS_SYNC=y 120CONFIG_CPU_HAS_SYNC=y
120CONFIG_GENERIC_HARDIRQS=y 121CONFIG_GENERIC_HARDIRQS=y
121CONFIG_GENERIC_IRQ_PROBE=y 122CONFIG_GENERIC_IRQ_PROBE=y
123CONFIG_CPU_SUPPORTS_HIGHMEM=y
122CONFIG_ARCH_FLATMEM_ENABLE=y 124CONFIG_ARCH_FLATMEM_ENABLE=y
123CONFIG_SELECT_MEMORY_MODEL=y 125CONFIG_SELECT_MEMORY_MODEL=y
124CONFIG_FLATMEM_MANUAL=y 126CONFIG_FLATMEM_MANUAL=y
@@ -136,7 +138,6 @@ CONFIG_PREEMPT_NONE=y
136# Code maturity level options 138# Code maturity level options
137# 139#
138CONFIG_EXPERIMENTAL=y 140CONFIG_EXPERIMENTAL=y
139CONFIG_CLEAN_COMPILE=y
140CONFIG_BROKEN_ON_SMP=y 141CONFIG_BROKEN_ON_SMP=y
141CONFIG_INIT_ENV_ARG_LIMIT=32 142CONFIG_INIT_ENV_ARG_LIMIT=32
142 143
@@ -153,6 +154,7 @@ CONFIG_SYSCTL=y
153# CONFIG_AUDIT is not set 154# CONFIG_AUDIT is not set
154CONFIG_IKCONFIG=y 155CONFIG_IKCONFIG=y
155CONFIG_IKCONFIG_PROC=y 156CONFIG_IKCONFIG_PROC=y
157# CONFIG_RELAY is not set
156CONFIG_INITRAMFS_SOURCE="" 158CONFIG_INITRAMFS_SOURCE=""
157# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 159# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
158CONFIG_EMBEDDED=y 160CONFIG_EMBEDDED=y
@@ -167,10 +169,6 @@ CONFIG_BASE_FULL=y
167CONFIG_FUTEX=y 169CONFIG_FUTEX=y
168CONFIG_EPOLL=y 170CONFIG_EPOLL=y
169CONFIG_SHMEM=y 171CONFIG_SHMEM=y
170CONFIG_CC_ALIGN_FUNCTIONS=0
171CONFIG_CC_ALIGN_LABELS=0
172CONFIG_CC_ALIGN_LOOPS=0
173CONFIG_CC_ALIGN_JUMPS=0
174CONFIG_SLAB=y 172CONFIG_SLAB=y
175# CONFIG_TINY_SHMEM is not set 173# CONFIG_TINY_SHMEM is not set
176CONFIG_BASE_SMALL=0 174CONFIG_BASE_SMALL=0
@@ -181,7 +179,6 @@ CONFIG_BASE_SMALL=0
181# 179#
182CONFIG_MODULES=y 180CONFIG_MODULES=y
183# CONFIG_MODULE_UNLOAD is not set 181# CONFIG_MODULE_UNLOAD is not set
184CONFIG_OBSOLETE_MODPARM=y
185# CONFIG_MODVERSIONS is not set 182# CONFIG_MODVERSIONS is not set
186# CONFIG_MODULE_SRCVERSION_ALL is not set 183# CONFIG_MODULE_SRCVERSION_ALL is not set
187CONFIG_KMOD=y 184CONFIG_KMOD=y
@@ -190,6 +187,8 @@ CONFIG_KMOD=y
190# Block layer 187# Block layer
191# 188#
192# CONFIG_LBD is not set 189# CONFIG_LBD is not set
190# CONFIG_BLK_DEV_IO_TRACE is not set
191# CONFIG_LSF is not set
193 192
194# 193#
195# IO Schedulers 194# IO Schedulers
@@ -209,7 +208,6 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
209# 208#
210CONFIG_HW_HAS_PCI=y 209CONFIG_HW_HAS_PCI=y
211CONFIG_PCI=y 210CONFIG_PCI=y
212# CONFIG_PCI_LEGACY_PROC is not set
213# CONFIG_PCI_DEBUG is not set 211# CONFIG_PCI_DEBUG is not set
214CONFIG_MMU=y 212CONFIG_MMU=y
215 213
@@ -238,6 +236,7 @@ CONFIG_NET=y
238# 236#
239# Networking options 237# Networking options
240# 238#
239# CONFIG_NETDEBUG is not set
241CONFIG_PACKET=y 240CONFIG_PACKET=y
242# CONFIG_PACKET_MMAP is not set 241# CONFIG_PACKET_MMAP is not set
243CONFIG_UNIX=y 242CONFIG_UNIX=y
@@ -257,12 +256,15 @@ CONFIG_IP_PNP_BOOTP=y
257# CONFIG_INET_AH is not set 256# CONFIG_INET_AH is not set
258# CONFIG_INET_ESP is not set 257# CONFIG_INET_ESP is not set
259# CONFIG_INET_IPCOMP is not set 258# CONFIG_INET_IPCOMP is not set
259# CONFIG_INET_XFRM_TUNNEL is not set
260# CONFIG_INET_TUNNEL is not set 260# CONFIG_INET_TUNNEL is not set
261CONFIG_INET_DIAG=y 261CONFIG_INET_DIAG=y
262CONFIG_INET_TCP_DIAG=y 262CONFIG_INET_TCP_DIAG=y
263# CONFIG_TCP_CONG_ADVANCED is not set 263# CONFIG_TCP_CONG_ADVANCED is not set
264CONFIG_TCP_CONG_BIC=y 264CONFIG_TCP_CONG_BIC=y
265# CONFIG_IPV6 is not set 265# CONFIG_IPV6 is not set
266# CONFIG_INET6_XFRM_TUNNEL is not set
267# CONFIG_INET6_TUNNEL is not set
266# CONFIG_NETFILTER is not set 268# CONFIG_NETFILTER is not set
267 269
268# 270#
@@ -274,6 +276,11 @@ CONFIG_TCP_CONG_BIC=y
274# SCTP Configuration (EXPERIMENTAL) 276# SCTP Configuration (EXPERIMENTAL)
275# 277#
276# CONFIG_IP_SCTP is not set 278# CONFIG_IP_SCTP is not set
279
280#
281# TIPC Configuration (EXPERIMENTAL)
282#
283# CONFIG_TIPC is not set
277# CONFIG_ATM is not set 284# CONFIG_ATM is not set
278# CONFIG_BRIDGE is not set 285# CONFIG_BRIDGE is not set
279# CONFIG_VLAN_8021Q is not set 286# CONFIG_VLAN_8021Q is not set
@@ -283,11 +290,6 @@ CONFIG_TCP_CONG_BIC=y
283# CONFIG_ATALK is not set 290# CONFIG_ATALK is not set
284# CONFIG_X25 is not set 291# CONFIG_X25 is not set
285# CONFIG_LAPB is not set 292# CONFIG_LAPB is not set
286
287#
288# TIPC Configuration (EXPERIMENTAL)
289#
290# CONFIG_TIPC is not set
291# CONFIG_NET_DIVERT is not set 293# CONFIG_NET_DIVERT is not set
292# CONFIG_ECONET is not set 294# CONFIG_ECONET is not set
293# CONFIG_WAN_ROUTER is not set 295# CONFIG_WAN_ROUTER is not set
@@ -469,7 +471,6 @@ CONFIG_ISCSI_TCP=m
469# CONFIG_SCSI_INIA100 is not set 471# CONFIG_SCSI_INIA100 is not set
470# CONFIG_SCSI_SYM53C8XX_2 is not set 472# CONFIG_SCSI_SYM53C8XX_2 is not set
471# CONFIG_SCSI_IPR is not set 473# CONFIG_SCSI_IPR is not set
472# CONFIG_SCSI_QLOGIC_FC is not set
473# CONFIG_SCSI_QLOGIC_1280 is not set 474# CONFIG_SCSI_QLOGIC_1280 is not set
474# CONFIG_SCSI_QLA_FC is not set 475# CONFIG_SCSI_QLA_FC is not set
475# CONFIG_SCSI_LPFC is not set 476# CONFIG_SCSI_LPFC is not set
@@ -671,6 +672,7 @@ CONFIG_HW_CONSOLE=y
671# Non-8250 serial port support 672# Non-8250 serial port support
672# 673#
673# CONFIG_SERIAL_IP3106 is not set 674# CONFIG_SERIAL_IP3106 is not set
675# CONFIG_SERIAL_JSM is not set
674CONFIG_UNIX98_PTYS=y 676CONFIG_UNIX98_PTYS=y
675CONFIG_LEGACY_PTYS=y 677CONFIG_LEGACY_PTYS=y
676CONFIG_LEGACY_PTY_COUNT=256 678CONFIG_LEGACY_PTY_COUNT=256
@@ -723,6 +725,7 @@ CONFIG_LEGACY_PTY_COUNT=256
723# 725#
724CONFIG_HWMON=y 726CONFIG_HWMON=y
725# CONFIG_HWMON_VID is not set 727# CONFIG_HWMON_VID is not set
728# CONFIG_SENSORS_F71805F is not set
726# CONFIG_HWMON_DEBUG_CHIP is not set 729# CONFIG_HWMON_DEBUG_CHIP is not set
727 730
728# 731#
@@ -730,10 +733,6 @@ CONFIG_HWMON=y
730# 733#
731 734
732# 735#
733# Multimedia Capabilities Port drivers
734#
735
736#
737# Multimedia devices 736# Multimedia devices
738# 737#
739# CONFIG_VIDEO_DEV is not set 738# CONFIG_VIDEO_DEV is not set
@@ -742,6 +741,7 @@ CONFIG_HWMON=y
742# Digital Video Broadcasting Devices 741# Digital Video Broadcasting Devices
743# 742#
744# CONFIG_DVB is not set 743# CONFIG_DVB is not set
744# CONFIG_USB_DABUSB is not set
745 745
746# 746#
747# Graphics support 747# Graphics support
@@ -764,6 +764,7 @@ CONFIG_DUMMY_CONSOLE=y
764# 764#
765CONFIG_USB_ARCH_HAS_HCD=y 765CONFIG_USB_ARCH_HAS_HCD=y
766CONFIG_USB_ARCH_HAS_OHCI=y 766CONFIG_USB_ARCH_HAS_OHCI=y
767CONFIG_USB_ARCH_HAS_EHCI=y
767CONFIG_USB=y 768CONFIG_USB=y
768# CONFIG_USB_DEBUG is not set 769# CONFIG_USB_DEBUG is not set
769 770
@@ -827,9 +828,7 @@ CONFIG_USB_STORAGE_JUMPSHOT=y
827# CONFIG_USB_ACECAD is not set 828# CONFIG_USB_ACECAD is not set
828# CONFIG_USB_KBTAB is not set 829# CONFIG_USB_KBTAB is not set
829# CONFIG_USB_POWERMATE is not set 830# CONFIG_USB_POWERMATE is not set
830# CONFIG_USB_MTOUCH is not set 831# CONFIG_USB_TOUCHSCREEN is not set
831# CONFIG_USB_ITMTOUCH is not set
832# CONFIG_USB_EGALAX is not set
833# CONFIG_USB_YEALINK is not set 832# CONFIG_USB_YEALINK is not set
834# CONFIG_USB_XPAD is not set 833# CONFIG_USB_XPAD is not set
835# CONFIG_USB_ATI_REMOTE is not set 834# CONFIG_USB_ATI_REMOTE is not set
@@ -844,15 +843,6 @@ CONFIG_USB_STORAGE_JUMPSHOT=y
844# CONFIG_USB_MICROTEK is not set 843# CONFIG_USB_MICROTEK is not set
845 844
846# 845#
847# USB Multimedia devices
848#
849# CONFIG_USB_DABUSB is not set
850
851#
852# Video4Linux support is needed for USB Multimedia device support
853#
854
855#
856# USB Network Adapters 846# USB Network Adapters
857# 847#
858# CONFIG_USB_CATC is not set 848# CONFIG_USB_CATC is not set
@@ -902,13 +892,31 @@ CONFIG_USB_MON=y
902# CONFIG_MMC is not set 892# CONFIG_MMC is not set
903 893
904# 894#
895# LED devices
896#
897# CONFIG_NEW_LEDS is not set
898
899#
900# LED drivers
901#
902
903#
904# LED Triggers
905#
906
907#
905# InfiniBand support 908# InfiniBand support
906# 909#
907# CONFIG_INFINIBAND is not set 910# CONFIG_INFINIBAND is not set
908 911
909# 912#
910# SN Devices 913# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
914#
915
916#
917# Real Time Clock
911# 918#
919# CONFIG_RTC_CLASS is not set
912 920
913# 921#
914# File systems 922# File systems
@@ -956,7 +964,6 @@ CONFIG_SYSFS=y
956CONFIG_TMPFS=y 964CONFIG_TMPFS=y
957# CONFIG_HUGETLB_PAGE is not set 965# CONFIG_HUGETLB_PAGE is not set
958CONFIG_RAMFS=y 966CONFIG_RAMFS=y
959# CONFIG_RELAYFS_FS is not set
960# CONFIG_CONFIGFS_FS is not set 967# CONFIG_CONFIGFS_FS is not set
961 968
962# 969#
@@ -1067,6 +1074,7 @@ CONFIG_LOG_BUF_SHIFT=14
1067CONFIG_DETECT_SOFTLOCKUP=y 1074CONFIG_DETECT_SOFTLOCKUP=y
1068# CONFIG_SCHEDSTATS is not set 1075# CONFIG_SCHEDSTATS is not set
1069CONFIG_DEBUG_SLAB=y 1076CONFIG_DEBUG_SLAB=y
1077# CONFIG_DEBUG_SLAB_LEAK is not set
1070CONFIG_DEBUG_MUTEXES=y 1078CONFIG_DEBUG_MUTEXES=y
1071# CONFIG_DEBUG_SPINLOCK is not set 1079# CONFIG_DEBUG_SPINLOCK is not set
1072# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1080# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
diff --git a/arch/mips/configs/pnx8550-v2pci_defconfig b/arch/mips/configs/pnx8550-v2pci_defconfig
index 4187287f0763..3c8f35162fec 100644
--- a/arch/mips/configs/pnx8550-v2pci_defconfig
+++ b/arch/mips/configs/pnx8550-v2pci_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc1 3# Linux kernel version: 2.6.17-rc2
4# Fri Jan 27 15:40:28 2006 4# Mon Apr 24 14:51:14 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -64,6 +64,8 @@ CONFIG_PNX8550_V2PCI=y
64# CONFIG_TOSHIBA_RBTX4927 is not set 64# CONFIG_TOSHIBA_RBTX4927 is not set
65# CONFIG_TOSHIBA_RBTX4938 is not set 65# CONFIG_TOSHIBA_RBTX4938 is not set
66CONFIG_RWSEM_GENERIC_SPINLOCK=y 66CONFIG_RWSEM_GENERIC_SPINLOCK=y
67CONFIG_GENERIC_FIND_NEXT_BIT=y
68CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 69CONFIG_GENERIC_CALIBRATE_DELAY=y
68CONFIG_DMA_NONCOHERENT=y 70CONFIG_DMA_NONCOHERENT=y
69CONFIG_DMA_NEED_PCI_MAP_STATE=y 71CONFIG_DMA_NEED_PCI_MAP_STATE=y
@@ -114,12 +116,11 @@ CONFIG_PAGE_SIZE_4KB=y
114CONFIG_CPU_HAS_PREFETCH=y 116CONFIG_CPU_HAS_PREFETCH=y
115# CONFIG_MIPS_MT is not set 117# CONFIG_MIPS_MT is not set
116# CONFIG_64BIT_PHYS_ADDR is not set 118# CONFIG_64BIT_PHYS_ADDR is not set
117CONFIG_CPU_ADVANCED=y
118CONFIG_CPU_HAS_LLSC=y 119CONFIG_CPU_HAS_LLSC=y
119# CONFIG_CPU_HAS_WB is not set
120CONFIG_CPU_HAS_SYNC=y 120CONFIG_CPU_HAS_SYNC=y
121CONFIG_GENERIC_HARDIRQS=y 121CONFIG_GENERIC_HARDIRQS=y
122CONFIG_GENERIC_IRQ_PROBE=y 122CONFIG_GENERIC_IRQ_PROBE=y
123CONFIG_CPU_SUPPORTS_HIGHMEM=y
123CONFIG_ARCH_FLATMEM_ENABLE=y 124CONFIG_ARCH_FLATMEM_ENABLE=y
124CONFIG_SELECT_MEMORY_MODEL=y 125CONFIG_SELECT_MEMORY_MODEL=y
125CONFIG_FLATMEM_MANUAL=y 126CONFIG_FLATMEM_MANUAL=y
@@ -137,7 +138,6 @@ CONFIG_PREEMPT_NONE=y
137# Code maturity level options 138# Code maturity level options
138# 139#
139CONFIG_EXPERIMENTAL=y 140CONFIG_EXPERIMENTAL=y
140CONFIG_CLEAN_COMPILE=y
141CONFIG_BROKEN_ON_SMP=y 141CONFIG_BROKEN_ON_SMP=y
142CONFIG_INIT_ENV_ARG_LIMIT=32 142CONFIG_INIT_ENV_ARG_LIMIT=32
143 143
@@ -154,6 +154,7 @@ CONFIG_SYSCTL=y
154# CONFIG_AUDIT is not set 154# CONFIG_AUDIT is not set
155CONFIG_IKCONFIG=y 155CONFIG_IKCONFIG=y
156CONFIG_IKCONFIG_PROC=y 156CONFIG_IKCONFIG_PROC=y
157# CONFIG_RELAY is not set
157CONFIG_INITRAMFS_SOURCE="" 158CONFIG_INITRAMFS_SOURCE=""
158# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 159# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
159CONFIG_EMBEDDED=y 160CONFIG_EMBEDDED=y
@@ -167,10 +168,6 @@ CONFIG_BASE_FULL=y
167CONFIG_FUTEX=y 168CONFIG_FUTEX=y
168CONFIG_EPOLL=y 169CONFIG_EPOLL=y
169CONFIG_SHMEM=y 170CONFIG_SHMEM=y
170CONFIG_CC_ALIGN_FUNCTIONS=0
171CONFIG_CC_ALIGN_LABELS=0
172CONFIG_CC_ALIGN_LOOPS=0
173CONFIG_CC_ALIGN_JUMPS=0
174CONFIG_SLAB=y 171CONFIG_SLAB=y
175# CONFIG_TINY_SHMEM is not set 172# CONFIG_TINY_SHMEM is not set
176CONFIG_BASE_SMALL=0 173CONFIG_BASE_SMALL=0
@@ -181,7 +178,6 @@ CONFIG_BASE_SMALL=0
181# 178#
182CONFIG_MODULES=y 179CONFIG_MODULES=y
183# CONFIG_MODULE_UNLOAD is not set 180# CONFIG_MODULE_UNLOAD is not set
184CONFIG_OBSOLETE_MODPARM=y
185# CONFIG_MODVERSIONS is not set 181# CONFIG_MODVERSIONS is not set
186# CONFIG_MODULE_SRCVERSION_ALL is not set 182# CONFIG_MODULE_SRCVERSION_ALL is not set
187CONFIG_KMOD=y 183CONFIG_KMOD=y
@@ -190,6 +186,8 @@ CONFIG_KMOD=y
190# Block layer 186# Block layer
191# 187#
192# CONFIG_LBD is not set 188# CONFIG_LBD is not set
189# CONFIG_BLK_DEV_IO_TRACE is not set
190# CONFIG_LSF is not set
193 191
194# 192#
195# IO Schedulers 193# IO Schedulers
@@ -209,7 +207,6 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
209# 207#
210CONFIG_HW_HAS_PCI=y 208CONFIG_HW_HAS_PCI=y
211CONFIG_PCI=y 209CONFIG_PCI=y
212# CONFIG_PCI_LEGACY_PROC is not set
213CONFIG_MMU=y 210CONFIG_MMU=y
214 211
215# 212#
@@ -237,6 +234,7 @@ CONFIG_NET=y
237# 234#
238# Networking options 235# Networking options
239# 236#
237# CONFIG_NETDEBUG is not set
240CONFIG_PACKET=y 238CONFIG_PACKET=y
241# CONFIG_PACKET_MMAP is not set 239# CONFIG_PACKET_MMAP is not set
242CONFIG_UNIX=y 240CONFIG_UNIX=y
@@ -256,6 +254,7 @@ CONFIG_IP_PNP=y
256# CONFIG_INET_AH is not set 254# CONFIG_INET_AH is not set
257# CONFIG_INET_ESP is not set 255# CONFIG_INET_ESP is not set
258# CONFIG_INET_IPCOMP is not set 256# CONFIG_INET_IPCOMP is not set
257# CONFIG_INET_XFRM_TUNNEL is not set
259# CONFIG_INET_TUNNEL is not set 258# CONFIG_INET_TUNNEL is not set
260CONFIG_INET_DIAG=y 259CONFIG_INET_DIAG=y
261CONFIG_INET_TCP_DIAG=y 260CONFIG_INET_TCP_DIAG=y
@@ -268,9 +267,12 @@ CONFIG_TCP_CONG_BIC=y
268# CONFIG_IP_VS is not set 267# CONFIG_IP_VS is not set
269CONFIG_IPV6=m 268CONFIG_IPV6=m
270# CONFIG_IPV6_PRIVACY is not set 269# CONFIG_IPV6_PRIVACY is not set
270CONFIG_IPV6_ROUTER_PREF=y
271CONFIG_IPV6_ROUTE_INFO=y
271# CONFIG_INET6_AH is not set 272# CONFIG_INET6_AH is not set
272# CONFIG_INET6_ESP is not set 273# CONFIG_INET6_ESP is not set
273# CONFIG_INET6_IPCOMP is not set 274# CONFIG_INET6_IPCOMP is not set
275# CONFIG_INET6_XFRM_TUNNEL is not set
274# CONFIG_INET6_TUNNEL is not set 276# CONFIG_INET6_TUNNEL is not set
275# CONFIG_IPV6_TUNNEL is not set 277# CONFIG_IPV6_TUNNEL is not set
276CONFIG_NETFILTER=y 278CONFIG_NETFILTER=y
@@ -287,10 +289,12 @@ CONFIG_NETFILTER_XT_TARGET_MARK=m
287CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m 289CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
288CONFIG_NETFILTER_XT_MATCH_COMMENT=m 290CONFIG_NETFILTER_XT_MATCH_COMMENT=m
289CONFIG_NETFILTER_XT_MATCH_DCCP=m 291CONFIG_NETFILTER_XT_MATCH_DCCP=m
292CONFIG_NETFILTER_XT_MATCH_ESP=m
290CONFIG_NETFILTER_XT_MATCH_LENGTH=m 293CONFIG_NETFILTER_XT_MATCH_LENGTH=m
291CONFIG_NETFILTER_XT_MATCH_LIMIT=m 294CONFIG_NETFILTER_XT_MATCH_LIMIT=m
292CONFIG_NETFILTER_XT_MATCH_MAC=m 295CONFIG_NETFILTER_XT_MATCH_MAC=m
293CONFIG_NETFILTER_XT_MATCH_MARK=m 296CONFIG_NETFILTER_XT_MATCH_MARK=m
297CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
294CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m 298CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
295CONFIG_NETFILTER_XT_MATCH_REALM=m 299CONFIG_NETFILTER_XT_MATCH_REALM=m
296CONFIG_NETFILTER_XT_MATCH_SCTP=m 300CONFIG_NETFILTER_XT_MATCH_SCTP=m
@@ -320,6 +324,11 @@ CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
320# SCTP Configuration (EXPERIMENTAL) 324# SCTP Configuration (EXPERIMENTAL)
321# 325#
322# CONFIG_IP_SCTP is not set 326# CONFIG_IP_SCTP is not set
327
328#
329# TIPC Configuration (EXPERIMENTAL)
330#
331# CONFIG_TIPC is not set
323# CONFIG_ATM is not set 332# CONFIG_ATM is not set
324# CONFIG_BRIDGE is not set 333# CONFIG_BRIDGE is not set
325# CONFIG_VLAN_8021Q is not set 334# CONFIG_VLAN_8021Q is not set
@@ -329,11 +338,6 @@ CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
329# CONFIG_ATALK is not set 338# CONFIG_ATALK is not set
330# CONFIG_X25 is not set 339# CONFIG_X25 is not set
331# CONFIG_LAPB is not set 340# CONFIG_LAPB is not set
332
333#
334# TIPC Configuration (EXPERIMENTAL)
335#
336# CONFIG_TIPC is not set
337# CONFIG_NET_DIVERT is not set 341# CONFIG_NET_DIVERT is not set
338# CONFIG_ECONET is not set 342# CONFIG_ECONET is not set
339# CONFIG_WAN_ROUTER is not set 343# CONFIG_WAN_ROUTER is not set
@@ -521,7 +525,6 @@ CONFIG_AIC7XXX_DEBUG_MASK=0
521# CONFIG_SCSI_INIA100 is not set 525# CONFIG_SCSI_INIA100 is not set
522# CONFIG_SCSI_SYM53C8XX_2 is not set 526# CONFIG_SCSI_SYM53C8XX_2 is not set
523# CONFIG_SCSI_IPR is not set 527# CONFIG_SCSI_IPR is not set
524# CONFIG_SCSI_QLOGIC_FC is not set
525# CONFIG_SCSI_QLOGIC_1280 is not set 528# CONFIG_SCSI_QLOGIC_1280 is not set
526# CONFIG_SCSI_QLA_FC is not set 529# CONFIG_SCSI_QLA_FC is not set
527# CONFIG_SCSI_LPFC is not set 530# CONFIG_SCSI_LPFC is not set
@@ -757,6 +760,7 @@ CONFIG_SERIAL_NONSTANDARD=y
757# Non-8250 serial port support 760# Non-8250 serial port support
758# 761#
759# CONFIG_SERIAL_IP3106 is not set 762# CONFIG_SERIAL_IP3106 is not set
763# CONFIG_SERIAL_JSM is not set
760CONFIG_UNIX98_PTYS=y 764CONFIG_UNIX98_PTYS=y
761CONFIG_LEGACY_PTYS=y 765CONFIG_LEGACY_PTYS=y
762CONFIG_LEGACY_PTY_COUNT=256 766CONFIG_LEGACY_PTY_COUNT=256
@@ -816,7 +820,6 @@ CONFIG_I2C_ALGOBIT=m
816# CONFIG_I2C_PARPORT_LIGHT is not set 820# CONFIG_I2C_PARPORT_LIGHT is not set
817# CONFIG_I2C_PROSAVAGE is not set 821# CONFIG_I2C_PROSAVAGE is not set
818# CONFIG_I2C_SAVAGE4 is not set 822# CONFIG_I2C_SAVAGE4 is not set
819# CONFIG_SCx200_ACB is not set
820# CONFIG_I2C_SIS5595 is not set 823# CONFIG_I2C_SIS5595 is not set
821# CONFIG_I2C_SIS630 is not set 824# CONFIG_I2C_SIS630 is not set
822# CONFIG_I2C_SIS96X is not set 825# CONFIG_I2C_SIS96X is not set
@@ -835,9 +838,7 @@ CONFIG_I2C_ALGOBIT=m
835# CONFIG_SENSORS_PCF8574 is not set 838# CONFIG_SENSORS_PCF8574 is not set
836# CONFIG_SENSORS_PCA9539 is not set 839# CONFIG_SENSORS_PCA9539 is not set
837# CONFIG_SENSORS_PCF8591 is not set 840# CONFIG_SENSORS_PCF8591 is not set
838# CONFIG_SENSORS_RTC8564 is not set
839# CONFIG_SENSORS_MAX6875 is not set 841# CONFIG_SENSORS_MAX6875 is not set
840# CONFIG_RTC_X1205_I2C is not set
841# CONFIG_I2C_DEBUG_CORE is not set 842# CONFIG_I2C_DEBUG_CORE is not set
842# CONFIG_I2C_DEBUG_ALGO is not set 843# CONFIG_I2C_DEBUG_ALGO is not set
843# CONFIG_I2C_DEBUG_BUS is not set 844# CONFIG_I2C_DEBUG_BUS is not set
@@ -867,6 +868,7 @@ CONFIG_HWMON=y
867# CONFIG_SENSORS_ASB100 is not set 868# CONFIG_SENSORS_ASB100 is not set
868# CONFIG_SENSORS_ATXP1 is not set 869# CONFIG_SENSORS_ATXP1 is not set
869# CONFIG_SENSORS_DS1621 is not set 870# CONFIG_SENSORS_DS1621 is not set
871# CONFIG_SENSORS_F71805F is not set
870# CONFIG_SENSORS_FSCHER is not set 872# CONFIG_SENSORS_FSCHER is not set
871# CONFIG_SENSORS_FSCPOS is not set 873# CONFIG_SENSORS_FSCPOS is not set
872# CONFIG_SENSORS_GL518SM is not set 874# CONFIG_SENSORS_GL518SM is not set
@@ -901,10 +903,6 @@ CONFIG_HWMON=y
901# 903#
902 904
903# 905#
904# Multimedia Capabilities Port drivers
905#
906
907#
908# Multimedia devices 906# Multimedia devices
909# 907#
910# CONFIG_VIDEO_DEV is not set 908# CONFIG_VIDEO_DEV is not set
@@ -913,6 +911,7 @@ CONFIG_HWMON=y
913# Digital Video Broadcasting Devices 911# Digital Video Broadcasting Devices
914# 912#
915# CONFIG_DVB is not set 913# CONFIG_DVB is not set
914# CONFIG_USB_DABUSB is not set
916 915
917# 916#
918# Graphics support 917# Graphics support
@@ -922,6 +921,7 @@ CONFIG_FB=y
922# CONFIG_FB_CFB_COPYAREA is not set 921# CONFIG_FB_CFB_COPYAREA is not set
923# CONFIG_FB_CFB_IMAGEBLIT is not set 922# CONFIG_FB_CFB_IMAGEBLIT is not set
924# CONFIG_FB_MACMODES is not set 923# CONFIG_FB_MACMODES is not set
924CONFIG_FB_FIRMWARE_EDID=y
925# CONFIG_FB_MODE_HELPERS is not set 925# CONFIG_FB_MODE_HELPERS is not set
926# CONFIG_FB_TILEBLITTING is not set 926# CONFIG_FB_TILEBLITTING is not set
927# CONFIG_FB_CIRRUS is not set 927# CONFIG_FB_CIRRUS is not set
@@ -933,7 +933,6 @@ CONFIG_FB=y
933# CONFIG_FB_NVIDIA is not set 933# CONFIG_FB_NVIDIA is not set
934# CONFIG_FB_RIVA is not set 934# CONFIG_FB_RIVA is not set
935# CONFIG_FB_MATROX is not set 935# CONFIG_FB_MATROX is not set
936# CONFIG_FB_RADEON_OLD is not set
937# CONFIG_FB_RADEON is not set 936# CONFIG_FB_RADEON is not set
938# CONFIG_FB_ATY128 is not set 937# CONFIG_FB_ATY128 is not set
939# CONFIG_FB_ATY is not set 938# CONFIG_FB_ATY is not set
@@ -970,6 +969,7 @@ CONFIG_DUMMY_CONSOLE=y
970# 969#
971CONFIG_USB_ARCH_HAS_HCD=y 970CONFIG_USB_ARCH_HAS_HCD=y
972CONFIG_USB_ARCH_HAS_OHCI=y 971CONFIG_USB_ARCH_HAS_OHCI=y
972CONFIG_USB_ARCH_HAS_EHCI=y
973CONFIG_USB=y 973CONFIG_USB=y
974# CONFIG_USB_DEBUG is not set 974# CONFIG_USB_DEBUG is not set
975 975
@@ -1030,9 +1030,7 @@ CONFIG_USB_HIDDEV=y
1030# CONFIG_USB_ACECAD is not set 1030# CONFIG_USB_ACECAD is not set
1031# CONFIG_USB_KBTAB is not set 1031# CONFIG_USB_KBTAB is not set
1032# CONFIG_USB_POWERMATE is not set 1032# CONFIG_USB_POWERMATE is not set
1033# CONFIG_USB_MTOUCH is not set 1033# CONFIG_USB_TOUCHSCREEN is not set
1034# CONFIG_USB_ITMTOUCH is not set
1035# CONFIG_USB_EGALAX is not set
1036# CONFIG_USB_YEALINK is not set 1034# CONFIG_USB_YEALINK is not set
1037# CONFIG_USB_XPAD is not set 1035# CONFIG_USB_XPAD is not set
1038# CONFIG_USB_ATI_REMOTE is not set 1036# CONFIG_USB_ATI_REMOTE is not set
@@ -1047,15 +1045,6 @@ CONFIG_USB_HIDDEV=y
1047# CONFIG_USB_MICROTEK is not set 1045# CONFIG_USB_MICROTEK is not set
1048 1046
1049# 1047#
1050# USB Multimedia devices
1051#
1052# CONFIG_USB_DABUSB is not set
1053
1054#
1055# Video4Linux support is needed for USB Multimedia device support
1056#
1057
1058#
1059# USB Network Adapters 1048# USB Network Adapters
1060# 1049#
1061# CONFIG_USB_CATC is not set 1050# CONFIG_USB_CATC is not set
@@ -1106,13 +1095,31 @@ CONFIG_USB_MON=y
1106# CONFIG_MMC is not set 1095# CONFIG_MMC is not set
1107 1096
1108# 1097#
1098# LED devices
1099#
1100# CONFIG_NEW_LEDS is not set
1101
1102#
1103# LED drivers
1104#
1105
1106#
1107# LED Triggers
1108#
1109
1110#
1109# InfiniBand support 1111# InfiniBand support
1110# 1112#
1111# CONFIG_INFINIBAND is not set 1113# CONFIG_INFINIBAND is not set
1112 1114
1113# 1115#
1114# SN Devices 1116# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
1117#
1118
1119#
1120# Real Time Clock
1115# 1121#
1122# CONFIG_RTC_CLASS is not set
1116 1123
1117# 1124#
1118# File systems 1125# File systems
@@ -1171,7 +1178,6 @@ CONFIG_SYSFS=y
1171CONFIG_TMPFS=y 1178CONFIG_TMPFS=y
1172# CONFIG_HUGETLB_PAGE is not set 1179# CONFIG_HUGETLB_PAGE is not set
1173CONFIG_RAMFS=y 1180CONFIG_RAMFS=y
1174# CONFIG_RELAYFS_FS is not set
1175# CONFIG_CONFIGFS_FS is not set 1181# CONFIG_CONFIGFS_FS is not set
1176 1182
1177# 1183#
@@ -1280,6 +1286,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1280# CONFIG_MAGIC_SYSRQ is not set 1286# CONFIG_MAGIC_SYSRQ is not set
1281# CONFIG_DEBUG_KERNEL is not set 1287# CONFIG_DEBUG_KERNEL is not set
1282CONFIG_LOG_BUF_SHIFT=14 1288CONFIG_LOG_BUF_SHIFT=14
1289# CONFIG_DEBUG_FS is not set
1283CONFIG_CROSSCOMPILE=y 1290CONFIG_CROSSCOMPILE=y
1284CONFIG_CMDLINE="" 1291CONFIG_CMDLINE=""
1285 1292
diff --git a/arch/mips/configs/qemu_defconfig b/arch/mips/configs/qemu_defconfig
index 31f5afabafa8..4bcc01dea041 100644
--- a/arch/mips/configs/qemu_defconfig
+++ b/arch/mips/configs/qemu_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc2 3# Linux kernel version: 2.6.17-rc2
4# Sun Feb 12 19:18:55 2006 4# Mon Apr 24 14:51:15 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -64,6 +64,8 @@ CONFIG_QEMU=y
64# CONFIG_TOSHIBA_RBTX4927 is not set 64# CONFIG_TOSHIBA_RBTX4927 is not set
65# CONFIG_TOSHIBA_RBTX4938 is not set 65# CONFIG_TOSHIBA_RBTX4938 is not set
66CONFIG_RWSEM_GENERIC_SPINLOCK=y 66CONFIG_RWSEM_GENERIC_SPINLOCK=y
67CONFIG_GENERIC_FIND_NEXT_BIT=y
68CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 69CONFIG_GENERIC_CALIBRATE_DELAY=y
68CONFIG_DMA_COHERENT=y 70CONFIG_DMA_COHERENT=y
69CONFIG_GENERIC_ISA_DMA=y 71CONFIG_GENERIC_ISA_DMA=y
@@ -115,16 +117,17 @@ CONFIG_PAGE_SIZE_4KB=y
115CONFIG_CPU_HAS_PREFETCH=y 117CONFIG_CPU_HAS_PREFETCH=y
116# CONFIG_MIPS_MT is not set 118# CONFIG_MIPS_MT is not set
117# CONFIG_64BIT_PHYS_ADDR is not set 119# CONFIG_64BIT_PHYS_ADDR is not set
118# CONFIG_CPU_ADVANCED is not set
119CONFIG_CPU_HAS_LLSC=y 120CONFIG_CPU_HAS_LLSC=y
120CONFIG_CPU_HAS_SYNC=y 121CONFIG_CPU_HAS_SYNC=y
121CONFIG_GENERIC_HARDIRQS=y 122CONFIG_GENERIC_HARDIRQS=y
122CONFIG_GENERIC_IRQ_PROBE=y 123CONFIG_GENERIC_IRQ_PROBE=y
124CONFIG_CPU_SUPPORTS_HIGHMEM=y
123CONFIG_ARCH_FLATMEM_ENABLE=y 125CONFIG_ARCH_FLATMEM_ENABLE=y
124CONFIG_FLATMEM=y 126CONFIG_FLATMEM=y
125CONFIG_FLAT_NODE_MEM_MAP=y 127CONFIG_FLAT_NODE_MEM_MAP=y
126# CONFIG_SPARSEMEM_STATIC is not set 128# CONFIG_SPARSEMEM_STATIC is not set
127CONFIG_SPLIT_PTLOCK_CPUS=4 129CONFIG_SPLIT_PTLOCK_CPUS=4
130# CONFIG_SMP is not set
128CONFIG_PREEMPT_NONE=y 131CONFIG_PREEMPT_NONE=y
129# CONFIG_PREEMPT_VOLUNTARY is not set 132# CONFIG_PREEMPT_VOLUNTARY is not set
130# CONFIG_PREEMPT is not set 133# CONFIG_PREEMPT is not set
@@ -147,6 +150,7 @@ CONFIG_LOCALVERSION_AUTO=y
147CONFIG_SYSCTL=y 150CONFIG_SYSCTL=y
148# CONFIG_AUDIT is not set 151# CONFIG_AUDIT is not set
149# CONFIG_IKCONFIG is not set 152# CONFIG_IKCONFIG is not set
153CONFIG_RELAY=y
150CONFIG_INITRAMFS_SOURCE="" 154CONFIG_INITRAMFS_SOURCE=""
151CONFIG_EMBEDDED=y 155CONFIG_EMBEDDED=y
152CONFIG_KALLSYMS=y 156CONFIG_KALLSYMS=y
@@ -159,10 +163,6 @@ CONFIG_ELF_CORE=y
159# CONFIG_FUTEX is not set 163# CONFIG_FUTEX is not set
160# CONFIG_EPOLL is not set 164# CONFIG_EPOLL is not set
161# CONFIG_SHMEM is not set 165# CONFIG_SHMEM is not set
162CONFIG_CC_ALIGN_FUNCTIONS=0
163CONFIG_CC_ALIGN_LABELS=0
164CONFIG_CC_ALIGN_LOOPS=0
165CONFIG_CC_ALIGN_JUMPS=0
166CONFIG_SLAB=y 166CONFIG_SLAB=y
167CONFIG_TINY_SHMEM=y 167CONFIG_TINY_SHMEM=y
168CONFIG_BASE_SMALL=1 168CONFIG_BASE_SMALL=1
@@ -177,6 +177,8 @@ CONFIG_BASE_SMALL=1
177# Block layer 177# Block layer
178# 178#
179# CONFIG_LBD is not set 179# CONFIG_LBD is not set
180# CONFIG_BLK_DEV_IO_TRACE is not set
181# CONFIG_LSF is not set
180 182
181# 183#
182# IO Schedulers 184# IO Schedulers
@@ -196,6 +198,7 @@ CONFIG_DEFAULT_IOSCHED="noop"
196# 198#
197CONFIG_ISA=y 199CONFIG_ISA=y
198CONFIG_MMU=y 200CONFIG_MMU=y
201CONFIG_I8253=y
199 202
200# 203#
201# PCCARD (PCMCIA/CardBus) support 204# PCCARD (PCMCIA/CardBus) support
@@ -241,12 +244,15 @@ CONFIG_IP_PNP_BOOTP=y
241# CONFIG_INET_AH is not set 244# CONFIG_INET_AH is not set
242# CONFIG_INET_ESP is not set 245# CONFIG_INET_ESP is not set
243# CONFIG_INET_IPCOMP is not set 246# CONFIG_INET_IPCOMP is not set
247# CONFIG_INET_XFRM_TUNNEL is not set
244# CONFIG_INET_TUNNEL is not set 248# CONFIG_INET_TUNNEL is not set
245CONFIG_INET_DIAG=y 249CONFIG_INET_DIAG=y
246CONFIG_INET_TCP_DIAG=y 250CONFIG_INET_TCP_DIAG=y
247# CONFIG_TCP_CONG_ADVANCED is not set 251# CONFIG_TCP_CONG_ADVANCED is not set
248CONFIG_TCP_CONG_BIC=y 252CONFIG_TCP_CONG_BIC=y
249# CONFIG_IPV6 is not set 253# CONFIG_IPV6 is not set
254# CONFIG_INET6_XFRM_TUNNEL is not set
255# CONFIG_INET6_TUNNEL is not set
250# CONFIG_NETFILTER is not set 256# CONFIG_NETFILTER is not set
251# CONFIG_BRIDGE is not set 257# CONFIG_BRIDGE is not set
252# CONFIG_VLAN_8021Q is not set 258# CONFIG_VLAN_8021Q is not set
@@ -308,7 +314,7 @@ CONFIG_PROC_EVENTS=y
308# CONFIG_BLK_DEV_LOOP is not set 314# CONFIG_BLK_DEV_LOOP is not set
309# CONFIG_BLK_DEV_NBD is not set 315# CONFIG_BLK_DEV_NBD is not set
310# CONFIG_BLK_DEV_RAM is not set 316# CONFIG_BLK_DEV_RAM is not set
311CONFIG_BLK_DEV_RAM_COUNT=16 317# CONFIG_BLK_DEV_INITRD is not set
312# CONFIG_CDROM_PKTCDVD is not set 318# CONFIG_CDROM_PKTCDVD is not set
313# CONFIG_ATA_OVER_ETH is not set 319# CONFIG_ATA_OVER_ETH is not set
314 320
@@ -530,10 +536,6 @@ CONFIG_LEGACY_PTY_COUNT=256
530# 536#
531 537
532# 538#
533# Multimedia Capabilities Port drivers
534#
535
536#
537# Multimedia devices 539# Multimedia devices
538# 540#
539# CONFIG_VIDEO_DEV is not set 541# CONFIG_VIDEO_DEV is not set
@@ -552,6 +554,7 @@ CONFIG_LEGACY_PTY_COUNT=256
552# Console display driver support 554# Console display driver support
553# 555#
554CONFIG_VGA_CONSOLE=y 556CONFIG_VGA_CONSOLE=y
557# CONFIG_VGACON_SOFT_SCROLLBACK is not set
555# CONFIG_MDA_CONSOLE is not set 558# CONFIG_MDA_CONSOLE is not set
556CONFIG_DUMMY_CONSOLE=y 559CONFIG_DUMMY_CONSOLE=y
557 560
@@ -565,6 +568,7 @@ CONFIG_DUMMY_CONSOLE=y
565# 568#
566# CONFIG_USB_ARCH_HAS_HCD is not set 569# CONFIG_USB_ARCH_HAS_HCD is not set
567# CONFIG_USB_ARCH_HAS_OHCI is not set 570# CONFIG_USB_ARCH_HAS_OHCI is not set
571# CONFIG_USB_ARCH_HAS_EHCI is not set
568 572
569# 573#
570# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 574# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
@@ -581,15 +585,28 @@ CONFIG_DUMMY_CONSOLE=y
581# CONFIG_MMC is not set 585# CONFIG_MMC is not set
582 586
583# 587#
588# LED devices
589#
590# CONFIG_NEW_LEDS is not set
591
592#
593# LED drivers
594#
595
596#
597# LED Triggers
598#
599
600#
584# InfiniBand support 601# InfiniBand support
585# 602#
586 603
587# 604#
588# SN Devices 605# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
589# 606#
590 607
591# 608#
592# EDAC - error detection and reporting (RAS) 609# Real Time Clock
593# 610#
594 611
595# 612#
@@ -632,7 +649,6 @@ CONFIG_SYSFS=y
632# CONFIG_TMPFS is not set 649# CONFIG_TMPFS is not set
633# CONFIG_HUGETLB_PAGE is not set 650# CONFIG_HUGETLB_PAGE is not set
634CONFIG_RAMFS=y 651CONFIG_RAMFS=y
635CONFIG_RELAYFS_FS=y
636 652
637# 653#
638# Miscellaneous filesystems 654# Miscellaneous filesystems
@@ -680,6 +696,8 @@ CONFIG_MSDOS_PARTITION=y
680# CONFIG_MAGIC_SYSRQ is not set 696# CONFIG_MAGIC_SYSRQ is not set
681# CONFIG_DEBUG_KERNEL is not set 697# CONFIG_DEBUG_KERNEL is not set
682CONFIG_LOG_BUF_SHIFT=14 698CONFIG_LOG_BUF_SHIFT=14
699# CONFIG_DEBUG_FS is not set
700# CONFIG_UNWIND_INFO is not set
683CONFIG_CROSSCOMPILE=y 701CONFIG_CROSSCOMPILE=y
684CONFIG_CMDLINE="" 702CONFIG_CMDLINE=""
685 703
diff --git a/arch/mips/configs/rbhma4500_defconfig b/arch/mips/configs/rbhma4500_defconfig
index b126f763cf51..3d441932e43a 100644
--- a/arch/mips/configs/rbhma4500_defconfig
+++ b/arch/mips/configs/rbhma4500_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc1 3# Linux kernel version: 2.6.17-rc2
4# Fri Jan 27 15:40:30 2006 4# Mon Apr 24 14:51:16 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -71,6 +71,8 @@ CONFIG_TOSHIBA_RBTX4938_MPLEX_PIO58_61=y
71# CONFIG_TOSHIBA_RBTX4938_MPLEX_NAND is not set 71# CONFIG_TOSHIBA_RBTX4938_MPLEX_NAND is not set
72# CONFIG_TOSHIBA_RBTX4938_MPLEX_ATA is not set 72# CONFIG_TOSHIBA_RBTX4938_MPLEX_ATA is not set
73CONFIG_RWSEM_GENERIC_SPINLOCK=y 73CONFIG_RWSEM_GENERIC_SPINLOCK=y
74CONFIG_GENERIC_FIND_NEXT_BIT=y
75CONFIG_GENERIC_HWEIGHT=y
74CONFIG_GENERIC_CALIBRATE_DELAY=y 76CONFIG_GENERIC_CALIBRATE_DELAY=y
75CONFIG_DMA_NONCOHERENT=y 77CONFIG_DMA_NONCOHERENT=y
76CONFIG_DMA_NEED_PCI_MAP_STATE=y 78CONFIG_DMA_NEED_PCI_MAP_STATE=y
@@ -121,10 +123,9 @@ CONFIG_PAGE_SIZE_4KB=y
121# CONFIG_PAGE_SIZE_8KB is not set 123# CONFIG_PAGE_SIZE_8KB is not set
122# CONFIG_PAGE_SIZE_16KB is not set 124# CONFIG_PAGE_SIZE_16KB is not set
123# CONFIG_PAGE_SIZE_64KB is not set 125# CONFIG_PAGE_SIZE_64KB is not set
126CONFIG_CPU_HAS_PREFETCH=y
124# CONFIG_MIPS_MT is not set 127# CONFIG_MIPS_MT is not set
125CONFIG_CPU_ADVANCED=y
126CONFIG_CPU_HAS_LLSC=y 128CONFIG_CPU_HAS_LLSC=y
127CONFIG_CPU_HAS_WB=y
128CONFIG_CPU_HAS_SYNC=y 129CONFIG_CPU_HAS_SYNC=y
129CONFIG_GENERIC_HARDIRQS=y 130CONFIG_GENERIC_HARDIRQS=y
130CONFIG_GENERIC_IRQ_PROBE=y 131CONFIG_GENERIC_IRQ_PROBE=y
@@ -145,7 +146,6 @@ CONFIG_PREEMPT_NONE=y
145# Code maturity level options 146# Code maturity level options
146# 147#
147CONFIG_EXPERIMENTAL=y 148CONFIG_EXPERIMENTAL=y
148CONFIG_CLEAN_COMPILE=y
149CONFIG_BROKEN_ON_SMP=y 149CONFIG_BROKEN_ON_SMP=y
150CONFIG_INIT_ENV_ARG_LIMIT=32 150CONFIG_INIT_ENV_ARG_LIMIT=32
151 151
@@ -162,6 +162,7 @@ CONFIG_SYSCTL=y
162# CONFIG_AUDIT is not set 162# CONFIG_AUDIT is not set
163CONFIG_IKCONFIG=y 163CONFIG_IKCONFIG=y
164CONFIG_IKCONFIG_PROC=y 164CONFIG_IKCONFIG_PROC=y
165CONFIG_RELAY=y
165CONFIG_INITRAMFS_SOURCE="" 166CONFIG_INITRAMFS_SOURCE=""
166# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 167# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
167CONFIG_EMBEDDED=y 168CONFIG_EMBEDDED=y
@@ -175,10 +176,6 @@ CONFIG_BASE_FULL=y
175# CONFIG_FUTEX is not set 176# CONFIG_FUTEX is not set
176# CONFIG_EPOLL is not set 177# CONFIG_EPOLL is not set
177CONFIG_SHMEM=y 178CONFIG_SHMEM=y
178CONFIG_CC_ALIGN_FUNCTIONS=0
179CONFIG_CC_ALIGN_LABELS=0
180CONFIG_CC_ALIGN_LOOPS=0
181CONFIG_CC_ALIGN_JUMPS=0
182CONFIG_SLAB=y 179CONFIG_SLAB=y
183# CONFIG_TINY_SHMEM is not set 180# CONFIG_TINY_SHMEM is not set
184CONFIG_BASE_SMALL=0 181CONFIG_BASE_SMALL=0
@@ -190,7 +187,6 @@ CONFIG_OBSOLETE_INTERMODULE=y
190# 187#
191CONFIG_MODULES=y 188CONFIG_MODULES=y
192# CONFIG_MODULE_UNLOAD is not set 189# CONFIG_MODULE_UNLOAD is not set
193CONFIG_OBSOLETE_MODPARM=y
194# CONFIG_MODVERSIONS is not set 190# CONFIG_MODVERSIONS is not set
195# CONFIG_MODULE_SRCVERSION_ALL is not set 191# CONFIG_MODULE_SRCVERSION_ALL is not set
196CONFIG_KMOD=y 192CONFIG_KMOD=y
@@ -199,6 +195,8 @@ CONFIG_KMOD=y
199# Block layer 195# Block layer
200# 196#
201# CONFIG_LBD is not set 197# CONFIG_LBD is not set
198# CONFIG_BLK_DEV_IO_TRACE is not set
199# CONFIG_LSF is not set
202 200
203# 201#
204# IO Schedulers 202# IO Schedulers
@@ -218,7 +216,6 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
218# 216#
219CONFIG_HW_HAS_PCI=y 217CONFIG_HW_HAS_PCI=y
220CONFIG_PCI=y 218CONFIG_PCI=y
221# CONFIG_PCI_LEGACY_PROC is not set
222CONFIG_ISA=y 219CONFIG_ISA=y
223CONFIG_MMU=y 220CONFIG_MMU=y
224 221
@@ -247,6 +244,7 @@ CONFIG_NET=y
247# 244#
248# Networking options 245# Networking options
249# 246#
247# CONFIG_NETDEBUG is not set
250CONFIG_PACKET=y 248CONFIG_PACKET=y
251# CONFIG_PACKET_MMAP is not set 249# CONFIG_PACKET_MMAP is not set
252CONFIG_UNIX=y 250CONFIG_UNIX=y
@@ -267,6 +265,7 @@ CONFIG_IP_PNP_BOOTP=y
267# CONFIG_INET_AH is not set 265# CONFIG_INET_AH is not set
268# CONFIG_INET_ESP is not set 266# CONFIG_INET_ESP is not set
269# CONFIG_INET_IPCOMP is not set 267# CONFIG_INET_IPCOMP is not set
268# CONFIG_INET_XFRM_TUNNEL is not set
270# CONFIG_INET_TUNNEL is not set 269# CONFIG_INET_TUNNEL is not set
271CONFIG_INET_DIAG=y 270CONFIG_INET_DIAG=y
272CONFIG_INET_TCP_DIAG=y 271CONFIG_INET_TCP_DIAG=y
@@ -279,9 +278,12 @@ CONFIG_TCP_CONG_BIC=y
279# CONFIG_IP_VS is not set 278# CONFIG_IP_VS is not set
280CONFIG_IPV6=m 279CONFIG_IPV6=m
281# CONFIG_IPV6_PRIVACY is not set 280# CONFIG_IPV6_PRIVACY is not set
281CONFIG_IPV6_ROUTER_PREF=y
282CONFIG_IPV6_ROUTE_INFO=y
282# CONFIG_INET6_AH is not set 283# CONFIG_INET6_AH is not set
283# CONFIG_INET6_ESP is not set 284# CONFIG_INET6_ESP is not set
284# CONFIG_INET6_IPCOMP is not set 285# CONFIG_INET6_IPCOMP is not set
286# CONFIG_INET6_XFRM_TUNNEL is not set
285# CONFIG_INET6_TUNNEL is not set 287# CONFIG_INET6_TUNNEL is not set
286# CONFIG_IPV6_TUNNEL is not set 288# CONFIG_IPV6_TUNNEL is not set
287CONFIG_NETFILTER=y 289CONFIG_NETFILTER=y
@@ -300,10 +302,12 @@ CONFIG_NETFILTER_XT_TARGET_MARK=m
300CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m 302CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
301CONFIG_NETFILTER_XT_MATCH_COMMENT=m 303CONFIG_NETFILTER_XT_MATCH_COMMENT=m
302CONFIG_NETFILTER_XT_MATCH_DCCP=m 304CONFIG_NETFILTER_XT_MATCH_DCCP=m
305CONFIG_NETFILTER_XT_MATCH_ESP=m
303CONFIG_NETFILTER_XT_MATCH_LENGTH=m 306CONFIG_NETFILTER_XT_MATCH_LENGTH=m
304CONFIG_NETFILTER_XT_MATCH_LIMIT=m 307CONFIG_NETFILTER_XT_MATCH_LIMIT=m
305CONFIG_NETFILTER_XT_MATCH_MAC=m 308CONFIG_NETFILTER_XT_MATCH_MAC=m
306CONFIG_NETFILTER_XT_MATCH_MARK=m 309CONFIG_NETFILTER_XT_MATCH_MARK=m
310CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
307CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m 311CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
308CONFIG_NETFILTER_XT_MATCH_REALM=m 312CONFIG_NETFILTER_XT_MATCH_REALM=m
309CONFIG_NETFILTER_XT_MATCH_SCTP=m 313CONFIG_NETFILTER_XT_MATCH_SCTP=m
@@ -333,6 +337,11 @@ CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
333# SCTP Configuration (EXPERIMENTAL) 337# SCTP Configuration (EXPERIMENTAL)
334# 338#
335# CONFIG_IP_SCTP is not set 339# CONFIG_IP_SCTP is not set
340
341#
342# TIPC Configuration (EXPERIMENTAL)
343#
344# CONFIG_TIPC is not set
336# CONFIG_ATM is not set 345# CONFIG_ATM is not set
337# CONFIG_BRIDGE is not set 346# CONFIG_BRIDGE is not set
338# CONFIG_VLAN_8021Q is not set 347# CONFIG_VLAN_8021Q is not set
@@ -342,11 +351,6 @@ CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
342# CONFIG_ATALK is not set 351# CONFIG_ATALK is not set
343# CONFIG_X25 is not set 352# CONFIG_X25 is not set
344# CONFIG_LAPB is not set 353# CONFIG_LAPB is not set
345
346#
347# TIPC Configuration (EXPERIMENTAL)
348#
349# CONFIG_TIPC is not set
350# CONFIG_NET_DIVERT is not set 354# CONFIG_NET_DIVERT is not set
351# CONFIG_ECONET is not set 355# CONFIG_ECONET is not set
352# CONFIG_WAN_ROUTER is not set 356# CONFIG_WAN_ROUTER is not set
@@ -369,6 +373,9 @@ CONFIG_IEEE80211=m
369CONFIG_IEEE80211_CRYPT_WEP=m 373CONFIG_IEEE80211_CRYPT_WEP=m
370CONFIG_IEEE80211_CRYPT_CCMP=m 374CONFIG_IEEE80211_CRYPT_CCMP=m
371CONFIG_IEEE80211_CRYPT_TKIP=m 375CONFIG_IEEE80211_CRYPT_TKIP=m
376CONFIG_IEEE80211_SOFTMAC=m
377# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
378CONFIG_WIRELESS_EXT=y
372 379
373# 380#
374# Device Drivers 381# Device Drivers
@@ -425,7 +432,6 @@ CONFIG_MTD_CFI_I2=y
425# CONFIG_MTD_CFI_I8 is not set 432# CONFIG_MTD_CFI_I8 is not set
426CONFIG_MTD_CFI_INTELEXT=y 433CONFIG_MTD_CFI_INTELEXT=y
427CONFIG_MTD_CFI_AMDSTD=y 434CONFIG_MTD_CFI_AMDSTD=y
428CONFIG_MTD_CFI_AMDSTD_RETRY=0
429# CONFIG_MTD_CFI_STAA is not set 435# CONFIG_MTD_CFI_STAA is not set
430CONFIG_MTD_CFI_UTIL=y 436CONFIG_MTD_CFI_UTIL=y
431# CONFIG_MTD_RAM is not set 437# CONFIG_MTD_RAM is not set
@@ -447,7 +453,6 @@ CONFIG_MTD_CFI_UTIL=y
447# CONFIG_MTD_SLRAM is not set 453# CONFIG_MTD_SLRAM is not set
448# CONFIG_MTD_PHRAM is not set 454# CONFIG_MTD_PHRAM is not set
449# CONFIG_MTD_MTDRAM is not set 455# CONFIG_MTD_MTDRAM is not set
450# CONFIG_MTD_BLKMTD is not set
451# CONFIG_MTD_BLOCK2MTD is not set 456# CONFIG_MTD_BLOCK2MTD is not set
452 457
453# 458#
@@ -702,6 +707,7 @@ CONFIG_NET_PCI=y
702# Wireless LAN (non-hamradio) 707# Wireless LAN (non-hamradio)
703# 708#
704CONFIG_NET_RADIO=y 709CONFIG_NET_RADIO=y
710# CONFIG_NET_WIRELESS_RTNETLINK is not set
705 711
706# 712#
707# Obsolete Wireless cards support (pre-802.11) 713# Obsolete Wireless cards support (pre-802.11)
@@ -715,6 +721,8 @@ CONFIG_NET_RADIO=y
715# 721#
716# CONFIG_IPW2100 is not set 722# CONFIG_IPW2100 is not set
717CONFIG_IPW2200=m 723CONFIG_IPW2200=m
724# CONFIG_IPW2200_MONITOR is not set
725# CONFIG_IPW_QOS is not set
718# CONFIG_IPW2200_DEBUG is not set 726# CONFIG_IPW2200_DEBUG is not set
719# CONFIG_HERMES is not set 727# CONFIG_HERMES is not set
720# CONFIG_ATMEL is not set 728# CONFIG_ATMEL is not set
@@ -724,6 +732,7 @@ CONFIG_IPW2200=m
724# 732#
725# CONFIG_PRISM54 is not set 733# CONFIG_PRISM54 is not set
726# CONFIG_HOSTAP is not set 734# CONFIG_HOSTAP is not set
735# CONFIG_BCM43XX is not set
727CONFIG_NET_WIRELESS=y 736CONFIG_NET_WIRELESS=y
728 737
729# 738#
@@ -821,7 +830,12 @@ CONFIG_HW_CONSOLE=y
821# 830#
822# Non-8250 serial port support 831# Non-8250 serial port support
823# 832#
833CONFIG_SERIAL_CORE=y
834CONFIG_SERIAL_TXX9=y
824CONFIG_HAS_TXX9_SERIAL=y 835CONFIG_HAS_TXX9_SERIAL=y
836# CONFIG_SERIAL_TXX9_CONSOLE is not set
837# CONFIG_SERIAL_TXX9_STDSERIAL is not set
838# CONFIG_SERIAL_JSM is not set
825CONFIG_UNIX98_PTYS=y 839CONFIG_UNIX98_PTYS=y
826CONFIG_LEGACY_PTYS=y 840CONFIG_LEGACY_PTYS=y
827CONFIG_LEGACY_PTY_COUNT=256 841CONFIG_LEGACY_PTY_COUNT=256
@@ -874,6 +888,7 @@ CONFIG_LEGACY_PTY_COUNT=256
874# 888#
875CONFIG_HWMON=y 889CONFIG_HWMON=y
876# CONFIG_HWMON_VID is not set 890# CONFIG_HWMON_VID is not set
891# CONFIG_SENSORS_F71805F is not set
877# CONFIG_HWMON_DEBUG_CHIP is not set 892# CONFIG_HWMON_DEBUG_CHIP is not set
878 893
879# 894#
@@ -881,10 +896,6 @@ CONFIG_HWMON=y
881# 896#
882 897
883# 898#
884# Multimedia Capabilities Port drivers
885#
886
887#
888# Multimedia devices 899# Multimedia devices
889# 900#
890# CONFIG_VIDEO_DEV is not set 901# CONFIG_VIDEO_DEV is not set
@@ -893,6 +904,7 @@ CONFIG_HWMON=y
893# Digital Video Broadcasting Devices 904# Digital Video Broadcasting Devices
894# 905#
895# CONFIG_DVB is not set 906# CONFIG_DVB is not set
907# CONFIG_USB_DABUSB is not set
896 908
897# 909#
898# Graphics support 910# Graphics support
@@ -902,6 +914,7 @@ CONFIG_FB_CFB_FILLRECT=y
902CONFIG_FB_CFB_COPYAREA=y 914CONFIG_FB_CFB_COPYAREA=y
903CONFIG_FB_CFB_IMAGEBLIT=y 915CONFIG_FB_CFB_IMAGEBLIT=y
904# CONFIG_FB_MACMODES is not set 916# CONFIG_FB_MACMODES is not set
917CONFIG_FB_FIRMWARE_EDID=y
905# CONFIG_FB_MODE_HELPERS is not set 918# CONFIG_FB_MODE_HELPERS is not set
906# CONFIG_FB_TILEBLITTING is not set 919# CONFIG_FB_TILEBLITTING is not set
907# CONFIG_FB_CIRRUS is not set 920# CONFIG_FB_CIRRUS is not set
@@ -913,7 +926,6 @@ CONFIG_FB_CFB_IMAGEBLIT=y
913# CONFIG_FB_NVIDIA is not set 926# CONFIG_FB_NVIDIA is not set
914# CONFIG_FB_RIVA is not set 927# CONFIG_FB_RIVA is not set
915# CONFIG_FB_MATROX is not set 928# CONFIG_FB_MATROX is not set
916# CONFIG_FB_RADEON_OLD is not set
917# CONFIG_FB_RADEON is not set 929# CONFIG_FB_RADEON is not set
918# CONFIG_FB_ATY128 is not set 930# CONFIG_FB_ATY128 is not set
919CONFIG_FB_ATY=y 931CONFIG_FB_ATY=y
@@ -934,6 +946,7 @@ CONFIG_FB_ATY_CT=y
934# Console display driver support 946# Console display driver support
935# 947#
936CONFIG_VGA_CONSOLE=y 948CONFIG_VGA_CONSOLE=y
949# CONFIG_VGACON_SOFT_SCROLLBACK is not set
937# CONFIG_MDA_CONSOLE is not set 950# CONFIG_MDA_CONSOLE is not set
938CONFIG_DUMMY_CONSOLE=y 951CONFIG_DUMMY_CONSOLE=y
939# CONFIG_FRAMEBUFFER_CONSOLE is not set 952# CONFIG_FRAMEBUFFER_CONSOLE is not set
@@ -954,6 +967,7 @@ CONFIG_DUMMY_CONSOLE=y
954# 967#
955CONFIG_USB_ARCH_HAS_HCD=y 968CONFIG_USB_ARCH_HAS_HCD=y
956CONFIG_USB_ARCH_HAS_OHCI=y 969CONFIG_USB_ARCH_HAS_OHCI=y
970CONFIG_USB_ARCH_HAS_EHCI=y
957CONFIG_USB=y 971CONFIG_USB=y
958# CONFIG_USB_DEBUG is not set 972# CONFIG_USB_DEBUG is not set
959 973
@@ -1003,9 +1017,7 @@ CONFIG_USB_HIDDEV=y
1003# CONFIG_USB_ACECAD is not set 1017# CONFIG_USB_ACECAD is not set
1004# CONFIG_USB_KBTAB is not set 1018# CONFIG_USB_KBTAB is not set
1005# CONFIG_USB_POWERMATE is not set 1019# CONFIG_USB_POWERMATE is not set
1006# CONFIG_USB_MTOUCH is not set 1020# CONFIG_USB_TOUCHSCREEN is not set
1007# CONFIG_USB_ITMTOUCH is not set
1008# CONFIG_USB_EGALAX is not set
1009CONFIG_USB_YEALINK=m 1021CONFIG_USB_YEALINK=m
1010# CONFIG_USB_XPAD is not set 1022# CONFIG_USB_XPAD is not set
1011# CONFIG_USB_ATI_REMOTE is not set 1023# CONFIG_USB_ATI_REMOTE is not set
@@ -1019,15 +1031,6 @@ CONFIG_USB_YEALINK=m
1019# CONFIG_USB_MDC800 is not set 1031# CONFIG_USB_MDC800 is not set
1020 1032
1021# 1033#
1022# USB Multimedia devices
1023#
1024# CONFIG_USB_DABUSB is not set
1025
1026#
1027# Video4Linux support is needed for USB Multimedia device support
1028#
1029
1030#
1031# USB Network Adapters 1034# USB Network Adapters
1032# 1035#
1033# CONFIG_USB_CATC is not set 1036# CONFIG_USB_CATC is not set
@@ -1078,13 +1081,31 @@ CONFIG_USB_MON=y
1078# CONFIG_MMC is not set 1081# CONFIG_MMC is not set
1079 1082
1080# 1083#
1084# LED devices
1085#
1086# CONFIG_NEW_LEDS is not set
1087
1088#
1089# LED drivers
1090#
1091
1092#
1093# LED Triggers
1094#
1095
1096#
1081# InfiniBand support 1097# InfiniBand support
1082# 1098#
1083# CONFIG_INFINIBAND is not set 1099# CONFIG_INFINIBAND is not set
1084 1100
1085# 1101#
1086# SN Devices 1102# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
1103#
1104
1105#
1106# Real Time Clock
1087# 1107#
1108# CONFIG_RTC_CLASS is not set
1088 1109
1089# 1110#
1090# File systems 1111# File systems
@@ -1148,7 +1169,6 @@ CONFIG_SYSFS=y
1148CONFIG_TMPFS=y 1169CONFIG_TMPFS=y
1149# CONFIG_HUGETLB_PAGE is not set 1170# CONFIG_HUGETLB_PAGE is not set
1150CONFIG_RAMFS=y 1171CONFIG_RAMFS=y
1151CONFIG_RELAYFS_FS=m
1152# CONFIG_CONFIGFS_FS is not set 1172# CONFIG_CONFIGFS_FS is not set
1153 1173
1154# 1174#
@@ -1266,6 +1286,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1266# CONFIG_MAGIC_SYSRQ is not set 1286# CONFIG_MAGIC_SYSRQ is not set
1267# CONFIG_DEBUG_KERNEL is not set 1287# CONFIG_DEBUG_KERNEL is not set
1268CONFIG_LOG_BUF_SHIFT=14 1288CONFIG_LOG_BUF_SHIFT=14
1289# CONFIG_DEBUG_FS is not set
1269CONFIG_CROSSCOMPILE=y 1290CONFIG_CROSSCOMPILE=y
1270CONFIG_CMDLINE="" 1291CONFIG_CMDLINE=""
1271 1292
diff --git a/arch/mips/configs/rm200_defconfig b/arch/mips/configs/rm200_defconfig
index 463ed3dbf6ae..edfb9679a25a 100644
--- a/arch/mips/configs/rm200_defconfig
+++ b/arch/mips/configs/rm200_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc1 3# Linux kernel version: 2.6.17-rc2
4# Fri Jan 27 15:40:31 2006 4# Mon Apr 24 14:51:16 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -64,6 +64,8 @@ CONFIG_SNI_RM200_PCI=y
64# CONFIG_TOSHIBA_RBTX4927 is not set 64# CONFIG_TOSHIBA_RBTX4927 is not set
65# CONFIG_TOSHIBA_RBTX4938 is not set 65# CONFIG_TOSHIBA_RBTX4938 is not set
66CONFIG_RWSEM_GENERIC_SPINLOCK=y 66CONFIG_RWSEM_GENERIC_SPINLOCK=y
67CONFIG_GENERIC_FIND_NEXT_BIT=y
68CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 69CONFIG_GENERIC_CALIBRATE_DELAY=y
68CONFIG_ARC=y 70CONFIG_ARC=y
69CONFIG_ARCH_MAY_HAVE_PC_FDC=y 71CONFIG_ARCH_MAY_HAVE_PC_FDC=y
@@ -122,7 +124,6 @@ CONFIG_PAGE_SIZE_4KB=y
122# CONFIG_PAGE_SIZE_64KB is not set 124# CONFIG_PAGE_SIZE_64KB is not set
123# CONFIG_MIPS_MT is not set 125# CONFIG_MIPS_MT is not set
124# CONFIG_64BIT_PHYS_ADDR is not set 126# CONFIG_64BIT_PHYS_ADDR is not set
125# CONFIG_CPU_ADVANCED is not set
126CONFIG_CPU_HAS_LLSC=y 127CONFIG_CPU_HAS_LLSC=y
127CONFIG_CPU_HAS_SYNC=y 128CONFIG_CPU_HAS_SYNC=y
128CONFIG_GENERIC_HARDIRQS=y 129CONFIG_GENERIC_HARDIRQS=y
@@ -145,7 +146,6 @@ CONFIG_PREEMPT_VOLUNTARY=y
145# Code maturity level options 146# Code maturity level options
146# 147#
147CONFIG_EXPERIMENTAL=y 148CONFIG_EXPERIMENTAL=y
148CONFIG_CLEAN_COMPILE=y
149CONFIG_BROKEN_ON_SMP=y 149CONFIG_BROKEN_ON_SMP=y
150CONFIG_INIT_ENV_ARG_LIMIT=32 150CONFIG_INIT_ENV_ARG_LIMIT=32
151 151
@@ -163,6 +163,7 @@ CONFIG_SYSCTL=y
163# CONFIG_AUDIT is not set 163# CONFIG_AUDIT is not set
164CONFIG_IKCONFIG=y 164CONFIG_IKCONFIG=y
165CONFIG_IKCONFIG_PROC=y 165CONFIG_IKCONFIG_PROC=y
166CONFIG_RELAY=y
166CONFIG_INITRAMFS_SOURCE="" 167CONFIG_INITRAMFS_SOURCE=""
167# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 168# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
168CONFIG_EMBEDDED=y 169CONFIG_EMBEDDED=y
@@ -176,10 +177,6 @@ CONFIG_BASE_FULL=y
176CONFIG_FUTEX=y 177CONFIG_FUTEX=y
177CONFIG_EPOLL=y 178CONFIG_EPOLL=y
178CONFIG_SHMEM=y 179CONFIG_SHMEM=y
179CONFIG_CC_ALIGN_FUNCTIONS=0
180CONFIG_CC_ALIGN_LABELS=0
181CONFIG_CC_ALIGN_LOOPS=0
182CONFIG_CC_ALIGN_JUMPS=0
183CONFIG_SLAB=y 180CONFIG_SLAB=y
184# CONFIG_TINY_SHMEM is not set 181# CONFIG_TINY_SHMEM is not set
185CONFIG_BASE_SMALL=0 182CONFIG_BASE_SMALL=0
@@ -191,7 +188,6 @@ CONFIG_BASE_SMALL=0
191CONFIG_MODULES=y 188CONFIG_MODULES=y
192CONFIG_MODULE_UNLOAD=y 189CONFIG_MODULE_UNLOAD=y
193# CONFIG_MODULE_FORCE_UNLOAD is not set 190# CONFIG_MODULE_FORCE_UNLOAD is not set
194CONFIG_OBSOLETE_MODPARM=y
195CONFIG_MODVERSIONS=y 191CONFIG_MODVERSIONS=y
196# CONFIG_MODULE_SRCVERSION_ALL is not set 192# CONFIG_MODULE_SRCVERSION_ALL is not set
197CONFIG_KMOD=y 193CONFIG_KMOD=y
@@ -200,6 +196,8 @@ CONFIG_KMOD=y
200# Block layer 196# Block layer
201# 197#
202# CONFIG_LBD is not set 198# CONFIG_LBD is not set
199# CONFIG_BLK_DEV_IO_TRACE is not set
200# CONFIG_LSF is not set
203 201
204# 202#
205# IO Schedulers 203# IO Schedulers
@@ -220,10 +218,10 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
220CONFIG_HW_HAS_EISA=y 218CONFIG_HW_HAS_EISA=y
221CONFIG_HW_HAS_PCI=y 219CONFIG_HW_HAS_PCI=y
222CONFIG_PCI=y 220CONFIG_PCI=y
223CONFIG_PCI_LEGACY_PROC=y
224CONFIG_ISA=y 221CONFIG_ISA=y
225# CONFIG_EISA is not set 222# CONFIG_EISA is not set
226CONFIG_MMU=y 223CONFIG_MMU=y
224CONFIG_I8253=y
227 225
228# 226#
229# PCCARD (PCMCIA/CardBus) support 227# PCCARD (PCMCIA/CardBus) support
@@ -250,6 +248,7 @@ CONFIG_NET=y
250# 248#
251# Networking options 249# Networking options
252# 250#
251# CONFIG_NETDEBUG is not set
253CONFIG_PACKET=m 252CONFIG_PACKET=m
254CONFIG_PACKET_MMAP=y 253CONFIG_PACKET_MMAP=y
255CONFIG_UNIX=y 254CONFIG_UNIX=y
@@ -272,6 +271,7 @@ CONFIG_IP_PIMSM_V2=y
272# CONFIG_INET_AH is not set 271# CONFIG_INET_AH is not set
273# CONFIG_INET_ESP is not set 272# CONFIG_INET_ESP is not set
274# CONFIG_INET_IPCOMP is not set 273# CONFIG_INET_IPCOMP is not set
274# CONFIG_INET_XFRM_TUNNEL is not set
275CONFIG_INET_TUNNEL=m 275CONFIG_INET_TUNNEL=m
276CONFIG_INET_DIAG=y 276CONFIG_INET_DIAG=y
277CONFIG_INET_TCP_DIAG=y 277CONFIG_INET_TCP_DIAG=y
@@ -284,9 +284,12 @@ CONFIG_TCP_CONG_BIC=y
284# CONFIG_IP_VS is not set 284# CONFIG_IP_VS is not set
285CONFIG_IPV6=m 285CONFIG_IPV6=m
286CONFIG_IPV6_PRIVACY=y 286CONFIG_IPV6_PRIVACY=y
287CONFIG_IPV6_ROUTER_PREF=y
288CONFIG_IPV6_ROUTE_INFO=y
287CONFIG_INET6_AH=m 289CONFIG_INET6_AH=m
288CONFIG_INET6_ESP=m 290CONFIG_INET6_ESP=m
289CONFIG_INET6_IPCOMP=m 291CONFIG_INET6_IPCOMP=m
292CONFIG_INET6_XFRM_TUNNEL=m
290CONFIG_INET6_TUNNEL=m 293CONFIG_INET6_TUNNEL=m
291CONFIG_IPV6_TUNNEL=m 294CONFIG_IPV6_TUNNEL=m
292CONFIG_NETFILTER=y 295CONFIG_NETFILTER=y
@@ -309,11 +312,14 @@ CONFIG_NETFILTER_XT_MATCH_COMMENT=m
309CONFIG_NETFILTER_XT_MATCH_CONNMARK=m 312CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
310CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m 313CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
311CONFIG_NETFILTER_XT_MATCH_DCCP=m 314CONFIG_NETFILTER_XT_MATCH_DCCP=m
315CONFIG_NETFILTER_XT_MATCH_ESP=m
312CONFIG_NETFILTER_XT_MATCH_HELPER=m 316CONFIG_NETFILTER_XT_MATCH_HELPER=m
313CONFIG_NETFILTER_XT_MATCH_LENGTH=m 317CONFIG_NETFILTER_XT_MATCH_LENGTH=m
314CONFIG_NETFILTER_XT_MATCH_LIMIT=m 318CONFIG_NETFILTER_XT_MATCH_LIMIT=m
315CONFIG_NETFILTER_XT_MATCH_MAC=m 319CONFIG_NETFILTER_XT_MATCH_MAC=m
316CONFIG_NETFILTER_XT_MATCH_MARK=m 320CONFIG_NETFILTER_XT_MATCH_MARK=m
321CONFIG_NETFILTER_XT_MATCH_POLICY=m
322CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
317CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m 323CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m
318CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m 324CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
319CONFIG_NETFILTER_XT_MATCH_REALM=m 325CONFIG_NETFILTER_XT_MATCH_REALM=m
@@ -337,20 +343,19 @@ CONFIG_IP_NF_IRC=m
337CONFIG_IP_NF_TFTP=m 343CONFIG_IP_NF_TFTP=m
338CONFIG_IP_NF_AMANDA=m 344CONFIG_IP_NF_AMANDA=m
339CONFIG_IP_NF_PPTP=m 345CONFIG_IP_NF_PPTP=m
346CONFIG_IP_NF_H323=m
340CONFIG_IP_NF_QUEUE=m 347CONFIG_IP_NF_QUEUE=m
341CONFIG_IP_NF_IPTABLES=m 348CONFIG_IP_NF_IPTABLES=m
342CONFIG_IP_NF_MATCH_IPRANGE=m 349CONFIG_IP_NF_MATCH_IPRANGE=m
343CONFIG_IP_NF_MATCH_MULTIPORT=m
344CONFIG_IP_NF_MATCH_TOS=m 350CONFIG_IP_NF_MATCH_TOS=m
345CONFIG_IP_NF_MATCH_RECENT=m 351CONFIG_IP_NF_MATCH_RECENT=m
346CONFIG_IP_NF_MATCH_ECN=m 352CONFIG_IP_NF_MATCH_ECN=m
347CONFIG_IP_NF_MATCH_DSCP=m 353CONFIG_IP_NF_MATCH_DSCP=m
348CONFIG_IP_NF_MATCH_AH_ESP=m 354CONFIG_IP_NF_MATCH_AH=m
349CONFIG_IP_NF_MATCH_TTL=m 355CONFIG_IP_NF_MATCH_TTL=m
350CONFIG_IP_NF_MATCH_OWNER=m 356CONFIG_IP_NF_MATCH_OWNER=m
351CONFIG_IP_NF_MATCH_ADDRTYPE=m 357CONFIG_IP_NF_MATCH_ADDRTYPE=m
352CONFIG_IP_NF_MATCH_HASHLIMIT=m 358CONFIG_IP_NF_MATCH_HASHLIMIT=m
353CONFIG_IP_NF_MATCH_POLICY=m
354CONFIG_IP_NF_FILTER=m 359CONFIG_IP_NF_FILTER=m
355CONFIG_IP_NF_TARGET_REJECT=m 360CONFIG_IP_NF_TARGET_REJECT=m
356CONFIG_IP_NF_TARGET_LOG=m 361CONFIG_IP_NF_TARGET_LOG=m
@@ -368,6 +373,7 @@ CONFIG_IP_NF_NAT_FTP=m
368CONFIG_IP_NF_NAT_TFTP=m 373CONFIG_IP_NF_NAT_TFTP=m
369CONFIG_IP_NF_NAT_AMANDA=m 374CONFIG_IP_NF_NAT_AMANDA=m
370CONFIG_IP_NF_NAT_PPTP=m 375CONFIG_IP_NF_NAT_PPTP=m
376CONFIG_IP_NF_NAT_H323=m
371CONFIG_IP_NF_MANGLE=m 377CONFIG_IP_NF_MANGLE=m
372CONFIG_IP_NF_TARGET_TOS=m 378CONFIG_IP_NF_TARGET_TOS=m
373CONFIG_IP_NF_TARGET_ECN=m 379CONFIG_IP_NF_TARGET_ECN=m
@@ -388,12 +394,10 @@ CONFIG_IP6_NF_MATCH_RT=m
388CONFIG_IP6_NF_MATCH_OPTS=m 394CONFIG_IP6_NF_MATCH_OPTS=m
389CONFIG_IP6_NF_MATCH_FRAG=m 395CONFIG_IP6_NF_MATCH_FRAG=m
390CONFIG_IP6_NF_MATCH_HL=m 396CONFIG_IP6_NF_MATCH_HL=m
391CONFIG_IP6_NF_MATCH_MULTIPORT=m
392CONFIG_IP6_NF_MATCH_OWNER=m 397CONFIG_IP6_NF_MATCH_OWNER=m
393CONFIG_IP6_NF_MATCH_IPV6HEADER=m 398CONFIG_IP6_NF_MATCH_IPV6HEADER=m
394CONFIG_IP6_NF_MATCH_AHESP=m 399CONFIG_IP6_NF_MATCH_AH=m
395CONFIG_IP6_NF_MATCH_EUI64=m 400CONFIG_IP6_NF_MATCH_EUI64=m
396CONFIG_IP6_NF_MATCH_POLICY=m
397CONFIG_IP6_NF_FILTER=m 401CONFIG_IP6_NF_FILTER=m
398CONFIG_IP6_NF_TARGET_LOG=m 402CONFIG_IP6_NF_TARGET_LOG=m
399CONFIG_IP6_NF_TARGET_REJECT=m 403CONFIG_IP6_NF_TARGET_REJECT=m
@@ -439,21 +443,22 @@ CONFIG_BRIDGE_EBT_ULOG=m
439# SCTP Configuration (EXPERIMENTAL) 443# SCTP Configuration (EXPERIMENTAL)
440# 444#
441# CONFIG_IP_SCTP is not set 445# CONFIG_IP_SCTP is not set
446
447#
448# TIPC Configuration (EXPERIMENTAL)
449#
450# CONFIG_TIPC is not set
442# CONFIG_ATM is not set 451# CONFIG_ATM is not set
443CONFIG_BRIDGE=m 452CONFIG_BRIDGE=m
444# CONFIG_VLAN_8021Q is not set 453# CONFIG_VLAN_8021Q is not set
445CONFIG_DECNET=m 454CONFIG_DECNET=m
446# CONFIG_DECNET_ROUTER is not set 455# CONFIG_DECNET_ROUTER is not set
456CONFIG_LLC=m
447# CONFIG_LLC2 is not set 457# CONFIG_LLC2 is not set
448# CONFIG_IPX is not set 458# CONFIG_IPX is not set
449# CONFIG_ATALK is not set 459# CONFIG_ATALK is not set
450# CONFIG_X25 is not set 460# CONFIG_X25 is not set
451# CONFIG_LAPB is not set 461# CONFIG_LAPB is not set
452
453#
454# TIPC Configuration (EXPERIMENTAL)
455#
456# CONFIG_TIPC is not set
457# CONFIG_NET_DIVERT is not set 462# CONFIG_NET_DIVERT is not set
458# CONFIG_ECONET is not set 463# CONFIG_ECONET is not set
459# CONFIG_WAN_ROUTER is not set 464# CONFIG_WAN_ROUTER is not set
@@ -533,6 +538,9 @@ CONFIG_IEEE80211=m
533# CONFIG_IEEE80211_DEBUG is not set 538# CONFIG_IEEE80211_DEBUG is not set
534CONFIG_IEEE80211_CRYPT_WEP=m 539CONFIG_IEEE80211_CRYPT_WEP=m
535CONFIG_IEEE80211_CRYPT_CCMP=m 540CONFIG_IEEE80211_CRYPT_CCMP=m
541CONFIG_IEEE80211_SOFTMAC=m
542# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
543CONFIG_WIRELESS_EXT=y
536 544
537# 545#
538# Device Drivers 546# Device Drivers
@@ -620,6 +628,7 @@ CONFIG_BLK_DEV_UB=m
620CONFIG_BLK_DEV_RAM=m 628CONFIG_BLK_DEV_RAM=m
621CONFIG_BLK_DEV_RAM_COUNT=16 629CONFIG_BLK_DEV_RAM_COUNT=16
622CONFIG_BLK_DEV_RAM_SIZE=4096 630CONFIG_BLK_DEV_RAM_SIZE=4096
631# CONFIG_BLK_DEV_INITRD is not set
623CONFIG_CDROM_PKTCDVD=m 632CONFIG_CDROM_PKTCDVD=m
624CONFIG_CDROM_PKTCDVD_BUFFERS=8 633CONFIG_CDROM_PKTCDVD_BUFFERS=8
625# CONFIG_CDROM_PKTCDVD_WCACHE is not set 634# CONFIG_CDROM_PKTCDVD_WCACHE is not set
@@ -700,12 +709,11 @@ CONFIG_SCSI_SYM53C8XX_2=y
700CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1 709CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
701CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 710CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
702CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 711CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
703# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set 712CONFIG_SCSI_SYM53C8XX_MMIO=y
704# CONFIG_SCSI_IPR is not set 713# CONFIG_SCSI_IPR is not set
705# CONFIG_SCSI_PAS16 is not set 714# CONFIG_SCSI_PAS16 is not set
706# CONFIG_SCSI_PSI240I is not set 715# CONFIG_SCSI_PSI240I is not set
707# CONFIG_SCSI_QLOGIC_FAS is not set 716# CONFIG_SCSI_QLOGIC_FAS is not set
708# CONFIG_SCSI_QLOGIC_FC is not set
709# CONFIG_SCSI_QLOGIC_1280 is not set 717# CONFIG_SCSI_QLOGIC_1280 is not set
710# CONFIG_SCSI_QLA_FC is not set 718# CONFIG_SCSI_QLA_FC is not set
711# CONFIG_SCSI_LPFC is not set 719# CONFIG_SCSI_LPFC is not set
@@ -731,6 +739,7 @@ CONFIG_MD_RAID0=m
731CONFIG_MD_RAID1=m 739CONFIG_MD_RAID1=m
732CONFIG_MD_RAID10=m 740CONFIG_MD_RAID10=m
733CONFIG_MD_RAID5=m 741CONFIG_MD_RAID5=m
742CONFIG_MD_RAID5_RESHAPE=y
734# CONFIG_MD_RAID6 is not set 743# CONFIG_MD_RAID6 is not set
735CONFIG_MD_MULTIPATH=m 744CONFIG_MD_MULTIPATH=m
736CONFIG_MD_FAULTY=m 745CONFIG_MD_FAULTY=m
@@ -965,6 +974,7 @@ CONFIG_HW_CONSOLE=y
965# Serial drivers 974# Serial drivers
966# 975#
967CONFIG_SERIAL_8250=m 976CONFIG_SERIAL_8250=m
977CONFIG_SERIAL_8250_PCI=m
968CONFIG_SERIAL_8250_NR_UARTS=4 978CONFIG_SERIAL_8250_NR_UARTS=4
969CONFIG_SERIAL_8250_RUNTIME_UARTS=4 979CONFIG_SERIAL_8250_RUNTIME_UARTS=4
970CONFIG_SERIAL_8250_EXTENDED=y 980CONFIG_SERIAL_8250_EXTENDED=y
@@ -977,6 +987,7 @@ CONFIG_SERIAL_8250_RSA=y
977# Non-8250 serial port support 987# Non-8250 serial port support
978# 988#
979CONFIG_SERIAL_CORE=m 989CONFIG_SERIAL_CORE=m
990# CONFIG_SERIAL_JSM is not set
980CONFIG_UNIX98_PTYS=y 991CONFIG_UNIX98_PTYS=y
981CONFIG_LEGACY_PTYS=y 992CONFIG_LEGACY_PTYS=y
982CONFIG_LEGACY_PTY_COUNT=256 993CONFIG_LEGACY_PTY_COUNT=256
@@ -1027,12 +1038,19 @@ CONFIG_RTC=m
1027# Dallas's 1-wire bus 1038# Dallas's 1-wire bus
1028# 1039#
1029CONFIG_W1=m 1040CONFIG_W1=m
1030CONFIG_W1_MATROX=m 1041
1031CONFIG_W1_DS9490=m 1042#
1032# CONFIG_W1_DS9490_BRIDGE is not set 1043# 1-wire Bus Masters
1033CONFIG_W1_THERM=m 1044#
1034CONFIG_W1_SMEM=m 1045# CONFIG_W1_MASTER_MATROX is not set
1035# CONFIG_W1_DS2433 is not set 1046# CONFIG_W1_MASTER_DS9490 is not set
1047
1048#
1049# 1-wire Slaves
1050#
1051# CONFIG_W1_SLAVE_THERM is not set
1052# CONFIG_W1_SLAVE_SMEM is not set
1053# CONFIG_W1_SLAVE_DS2433 is not set
1036 1054
1037# 1055#
1038# Hardware Monitoring support 1056# Hardware Monitoring support
@@ -1045,10 +1063,6 @@ CONFIG_W1_SMEM=m
1045# 1063#
1046 1064
1047# 1065#
1048# Multimedia Capabilities Port drivers
1049#
1050
1051#
1052# Multimedia devices 1066# Multimedia devices
1053# 1067#
1054# CONFIG_VIDEO_DEV is not set 1068# CONFIG_VIDEO_DEV is not set
@@ -1057,6 +1071,7 @@ CONFIG_W1_SMEM=m
1057# Digital Video Broadcasting Devices 1071# Digital Video Broadcasting Devices
1058# 1072#
1059# CONFIG_DVB is not set 1073# CONFIG_DVB is not set
1074CONFIG_USB_DABUSB=m
1060 1075
1061# 1076#
1062# Graphics support 1077# Graphics support
@@ -1067,6 +1082,7 @@ CONFIG_W1_SMEM=m
1067# Console display driver support 1082# Console display driver support
1068# 1083#
1069CONFIG_VGA_CONSOLE=y 1084CONFIG_VGA_CONSOLE=y
1085# CONFIG_VGACON_SOFT_SCROLLBACK is not set
1070# CONFIG_MDA_CONSOLE is not set 1086# CONFIG_MDA_CONSOLE is not set
1071CONFIG_DUMMY_CONSOLE=y 1087CONFIG_DUMMY_CONSOLE=y
1072 1088
@@ -1080,6 +1096,7 @@ CONFIG_DUMMY_CONSOLE=y
1080# 1096#
1081CONFIG_USB_ARCH_HAS_HCD=y 1097CONFIG_USB_ARCH_HAS_HCD=y
1082CONFIG_USB_ARCH_HAS_OHCI=y 1098CONFIG_USB_ARCH_HAS_OHCI=y
1099CONFIG_USB_ARCH_HAS_EHCI=y
1083CONFIG_USB=m 1100CONFIG_USB=m
1084# CONFIG_USB_DEBUG is not set 1101# CONFIG_USB_DEBUG is not set
1085 1102
@@ -1151,9 +1168,7 @@ CONFIG_USB_WACOM=m
1151# CONFIG_USB_ACECAD is not set 1168# CONFIG_USB_ACECAD is not set
1152CONFIG_USB_KBTAB=m 1169CONFIG_USB_KBTAB=m
1153CONFIG_USB_POWERMATE=m 1170CONFIG_USB_POWERMATE=m
1154# CONFIG_USB_MTOUCH is not set 1171# CONFIG_USB_TOUCHSCREEN is not set
1155# CONFIG_USB_ITMTOUCH is not set
1156CONFIG_USB_EGALAX=m
1157CONFIG_USB_YEALINK=m 1172CONFIG_USB_YEALINK=m
1158CONFIG_USB_XPAD=m 1173CONFIG_USB_XPAD=m
1159# CONFIG_USB_ATI_REMOTE is not set 1174# CONFIG_USB_ATI_REMOTE is not set
@@ -1168,15 +1183,6 @@ CONFIG_USB_MDC800=m
1168CONFIG_USB_MICROTEK=m 1183CONFIG_USB_MICROTEK=m
1169 1184
1170# 1185#
1171# USB Multimedia devices
1172#
1173CONFIG_USB_DABUSB=m
1174
1175#
1176# Video4Linux support is needed for USB Multimedia device support
1177#
1178
1179#
1180# USB Network Adapters 1186# USB Network Adapters
1181# 1187#
1182CONFIG_USB_CATC=m 1188CONFIG_USB_CATC=m
@@ -1213,6 +1219,7 @@ CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m
1213CONFIG_USB_SERIAL_CYPRESS_M8=m 1219CONFIG_USB_SERIAL_CYPRESS_M8=m
1214CONFIG_USB_SERIAL_EMPEG=m 1220CONFIG_USB_SERIAL_EMPEG=m
1215CONFIG_USB_SERIAL_FTDI_SIO=m 1221CONFIG_USB_SERIAL_FTDI_SIO=m
1222# CONFIG_USB_SERIAL_FUNSOFT is not set
1216CONFIG_USB_SERIAL_VISOR=m 1223CONFIG_USB_SERIAL_VISOR=m
1217CONFIG_USB_SERIAL_IPAQ=m 1224CONFIG_USB_SERIAL_IPAQ=m
1218CONFIG_USB_SERIAL_IR=m 1225CONFIG_USB_SERIAL_IR=m
@@ -1237,6 +1244,7 @@ CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y
1237CONFIG_USB_SERIAL_KLSI=m 1244CONFIG_USB_SERIAL_KLSI=m
1238CONFIG_USB_SERIAL_KOBIL_SCT=m 1245CONFIG_USB_SERIAL_KOBIL_SCT=m
1239CONFIG_USB_SERIAL_MCT_U232=m 1246CONFIG_USB_SERIAL_MCT_U232=m
1247# CONFIG_USB_SERIAL_NAVMAN is not set
1240CONFIG_USB_SERIAL_PL2303=m 1248CONFIG_USB_SERIAL_PL2303=m
1241CONFIG_USB_SERIAL_HP4X=m 1249CONFIG_USB_SERIAL_HP4X=m
1242CONFIG_USB_SERIAL_SAFE=m 1250CONFIG_USB_SERIAL_SAFE=m
@@ -1281,13 +1289,31 @@ CONFIG_USB_TEST=m
1281# CONFIG_MMC is not set 1289# CONFIG_MMC is not set
1282 1290
1283# 1291#
1292# LED devices
1293#
1294# CONFIG_NEW_LEDS is not set
1295
1296#
1297# LED drivers
1298#
1299
1300#
1301# LED Triggers
1302#
1303
1304#
1284# InfiniBand support 1305# InfiniBand support
1285# 1306#
1286# CONFIG_INFINIBAND is not set 1307# CONFIG_INFINIBAND is not set
1287 1308
1288# 1309#
1289# SN Devices 1310# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
1311#
1312
1313#
1314# Real Time Clock
1290# 1315#
1316# CONFIG_RTC_CLASS is not set
1291 1317
1292# 1318#
1293# File systems 1319# File systems
@@ -1358,7 +1384,6 @@ CONFIG_SYSFS=y
1358# CONFIG_TMPFS is not set 1384# CONFIG_TMPFS is not set
1359# CONFIG_HUGETLB_PAGE is not set 1385# CONFIG_HUGETLB_PAGE is not set
1360CONFIG_RAMFS=y 1386CONFIG_RAMFS=y
1361CONFIG_RELAYFS_FS=m
1362# CONFIG_CONFIGFS_FS is not set 1387# CONFIG_CONFIGFS_FS is not set
1363 1388
1364# 1389#
@@ -1379,7 +1404,6 @@ CONFIG_HPFS_FS=m
1379CONFIG_QNX4FS_FS=m 1404CONFIG_QNX4FS_FS=m
1380CONFIG_SYSV_FS=m 1405CONFIG_SYSV_FS=m
1381CONFIG_UFS_FS=m 1406CONFIG_UFS_FS=m
1382# CONFIG_UFS_FS_WRITE is not set
1383 1407
1384# 1408#
1385# Network File Systems 1409# Network File Systems
@@ -1500,6 +1524,7 @@ CONFIG_NLS_UTF8=m
1500# CONFIG_MAGIC_SYSRQ is not set 1524# CONFIG_MAGIC_SYSRQ is not set
1501# CONFIG_DEBUG_KERNEL is not set 1525# CONFIG_DEBUG_KERNEL is not set
1502CONFIG_LOG_BUF_SHIFT=14 1526CONFIG_LOG_BUF_SHIFT=14
1527# CONFIG_DEBUG_FS is not set
1503CONFIG_CROSSCOMPILE=y 1528CONFIG_CROSSCOMPILE=y
1504CONFIG_CMDLINE="" 1529CONFIG_CMDLINE=""
1505 1530
diff --git a/arch/mips/configs/sb1250-swarm_defconfig b/arch/mips/configs/sb1250-swarm_defconfig
index da68c3f72050..e388a3dae0a9 100644
--- a/arch/mips/configs/sb1250-swarm_defconfig
+++ b/arch/mips/configs/sb1250-swarm_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc1 3# Linux kernel version: 2.6.17-rc2
4# Fri Jan 27 15:40:32 2006 4# Mon Apr 24 14:51:17 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -81,6 +81,8 @@ CONFIG_SIBYTE_CFE=y
81# CONFIG_SIBYTE_SB1250_PROF is not set 81# CONFIG_SIBYTE_SB1250_PROF is not set
82# CONFIG_SIBYTE_TBPROF is not set 82# CONFIG_SIBYTE_TBPROF is not set
83CONFIG_RWSEM_GENERIC_SPINLOCK=y 83CONFIG_RWSEM_GENERIC_SPINLOCK=y
84CONFIG_GENERIC_FIND_NEXT_BIT=y
85CONFIG_GENERIC_HWEIGHT=y
84CONFIG_GENERIC_CALIBRATE_DELAY=y 86CONFIG_GENERIC_CALIBRATE_DELAY=y
85CONFIG_DMA_COHERENT=y 87CONFIG_DMA_COHERENT=y
86CONFIG_CPU_BIG_ENDIAN=y 88CONFIG_CPU_BIG_ENDIAN=y
@@ -158,7 +160,6 @@ CONFIG_PREEMPT_BKL=y
158# Code maturity level options 160# Code maturity level options
159# 161#
160CONFIG_EXPERIMENTAL=y 162CONFIG_EXPERIMENTAL=y
161CONFIG_CLEAN_COMPILE=y
162CONFIG_LOCK_KERNEL=y 163CONFIG_LOCK_KERNEL=y
163CONFIG_INIT_ENV_ARG_LIMIT=32 164CONFIG_INIT_ENV_ARG_LIMIT=32
164 165
@@ -175,6 +176,7 @@ CONFIG_SYSCTL=y
175# CONFIG_AUDIT is not set 176# CONFIG_AUDIT is not set
176# CONFIG_IKCONFIG is not set 177# CONFIG_IKCONFIG is not set
177CONFIG_CPUSETS=y 178CONFIG_CPUSETS=y
179CONFIG_RELAY=y
178CONFIG_INITRAMFS_SOURCE="" 180CONFIG_INITRAMFS_SOURCE=""
179# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 181# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
180CONFIG_EMBEDDED=y 182CONFIG_EMBEDDED=y
@@ -188,10 +190,6 @@ CONFIG_BASE_FULL=y
188CONFIG_FUTEX=y 190CONFIG_FUTEX=y
189CONFIG_EPOLL=y 191CONFIG_EPOLL=y
190CONFIG_SHMEM=y 192CONFIG_SHMEM=y
191CONFIG_CC_ALIGN_FUNCTIONS=0
192CONFIG_CC_ALIGN_LABELS=0
193CONFIG_CC_ALIGN_LOOPS=0
194CONFIG_CC_ALIGN_JUMPS=0
195CONFIG_SLAB=y 193CONFIG_SLAB=y
196# CONFIG_TINY_SHMEM is not set 194# CONFIG_TINY_SHMEM is not set
197CONFIG_BASE_SMALL=0 195CONFIG_BASE_SMALL=0
@@ -203,7 +201,6 @@ CONFIG_BASE_SMALL=0
203CONFIG_MODULES=y 201CONFIG_MODULES=y
204CONFIG_MODULE_UNLOAD=y 202CONFIG_MODULE_UNLOAD=y
205# CONFIG_MODULE_FORCE_UNLOAD is not set 203# CONFIG_MODULE_FORCE_UNLOAD is not set
206CONFIG_OBSOLETE_MODPARM=y
207CONFIG_MODVERSIONS=y 204CONFIG_MODVERSIONS=y
208CONFIG_MODULE_SRCVERSION_ALL=y 205CONFIG_MODULE_SRCVERSION_ALL=y
209CONFIG_KMOD=y 206CONFIG_KMOD=y
@@ -212,6 +209,7 @@ CONFIG_STOP_MACHINE=y
212# 209#
213# Block layer 210# Block layer
214# 211#
212# CONFIG_BLK_DEV_IO_TRACE is not set
215 213
216# 214#
217# IO Schedulers 215# IO Schedulers
@@ -231,7 +229,6 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
231# 229#
232CONFIG_HW_HAS_PCI=y 230CONFIG_HW_HAS_PCI=y
233CONFIG_PCI=y 231CONFIG_PCI=y
234CONFIG_PCI_LEGACY_PROC=y
235CONFIG_MMU=y 232CONFIG_MMU=y
236 233
237# 234#
@@ -249,6 +246,7 @@ CONFIG_MMU=y
249# 246#
250CONFIG_BINFMT_ELF=y 247CONFIG_BINFMT_ELF=y
251# CONFIG_BINFMT_MISC is not set 248# CONFIG_BINFMT_MISC is not set
249# CONFIG_BUILD_ELF64 is not set
252CONFIG_MIPS32_COMPAT=y 250CONFIG_MIPS32_COMPAT=y
253CONFIG_COMPAT=y 251CONFIG_COMPAT=y
254CONFIG_MIPS32_O32=y 252CONFIG_MIPS32_O32=y
@@ -263,6 +261,7 @@ CONFIG_NET=y
263# 261#
264# Networking options 262# Networking options
265# 263#
264# CONFIG_NETDEBUG is not set
266CONFIG_PACKET=y 265CONFIG_PACKET=y
267CONFIG_PACKET_MMAP=y 266CONFIG_PACKET_MMAP=y
268CONFIG_UNIX=y 267CONFIG_UNIX=y
@@ -284,12 +283,15 @@ CONFIG_IP_PNP_BOOTP=y
284# CONFIG_INET_AH is not set 283# CONFIG_INET_AH is not set
285# CONFIG_INET_ESP is not set 284# CONFIG_INET_ESP is not set
286# CONFIG_INET_IPCOMP is not set 285# CONFIG_INET_IPCOMP is not set
287CONFIG_INET_TUNNEL=m 286# CONFIG_INET_XFRM_TUNNEL is not set
287# CONFIG_INET_TUNNEL is not set
288CONFIG_INET_DIAG=y 288CONFIG_INET_DIAG=y
289CONFIG_INET_TCP_DIAG=y 289CONFIG_INET_TCP_DIAG=y
290# CONFIG_TCP_CONG_ADVANCED is not set 290# CONFIG_TCP_CONG_ADVANCED is not set
291CONFIG_TCP_CONG_BIC=y 291CONFIG_TCP_CONG_BIC=y
292# CONFIG_IPV6 is not set 292# CONFIG_IPV6 is not set
293# CONFIG_INET6_XFRM_TUNNEL is not set
294# CONFIG_INET6_TUNNEL is not set
293# CONFIG_NETFILTER is not set 295# CONFIG_NETFILTER is not set
294 296
295# 297#
@@ -301,6 +303,11 @@ CONFIG_TCP_CONG_BIC=y
301# SCTP Configuration (EXPERIMENTAL) 303# SCTP Configuration (EXPERIMENTAL)
302# 304#
303# CONFIG_IP_SCTP is not set 305# CONFIG_IP_SCTP is not set
306
307#
308# TIPC Configuration (EXPERIMENTAL)
309#
310# CONFIG_TIPC is not set
304# CONFIG_ATM is not set 311# CONFIG_ATM is not set
305# CONFIG_BRIDGE is not set 312# CONFIG_BRIDGE is not set
306# CONFIG_VLAN_8021Q is not set 313# CONFIG_VLAN_8021Q is not set
@@ -310,11 +317,6 @@ CONFIG_TCP_CONG_BIC=y
310# CONFIG_ATALK is not set 317# CONFIG_ATALK is not set
311# CONFIG_X25 is not set 318# CONFIG_X25 is not set
312# CONFIG_LAPB is not set 319# CONFIG_LAPB is not set
313
314#
315# TIPC Configuration (EXPERIMENTAL)
316#
317# CONFIG_TIPC is not set
318# CONFIG_NET_DIVERT is not set 320# CONFIG_NET_DIVERT is not set
319# CONFIG_ECONET is not set 321# CONFIG_ECONET is not set
320# CONFIG_WAN_ROUTER is not set 322# CONFIG_WAN_ROUTER is not set
@@ -335,6 +337,9 @@ CONFIG_IEEE80211=m
335# CONFIG_IEEE80211_DEBUG is not set 337# CONFIG_IEEE80211_DEBUG is not set
336CONFIG_IEEE80211_CRYPT_WEP=m 338CONFIG_IEEE80211_CRYPT_WEP=m
337CONFIG_IEEE80211_CRYPT_CCMP=m 339CONFIG_IEEE80211_CRYPT_CCMP=m
340CONFIG_IEEE80211_SOFTMAC=m
341# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
342CONFIG_WIRELESS_EXT=y
338 343
339# 344#
340# Device Drivers 345# Device Drivers
@@ -589,6 +594,7 @@ CONFIG_SIBYTE_SB1250_DUART_CONSOLE=y
589# 594#
590# Non-8250 serial port support 595# Non-8250 serial port support
591# 596#
597# CONFIG_SERIAL_JSM is not set
592CONFIG_UNIX98_PTYS=y 598CONFIG_UNIX98_PTYS=y
593CONFIG_LEGACY_PTYS=y 599CONFIG_LEGACY_PTYS=y
594CONFIG_LEGACY_PTY_COUNT=256 600CONFIG_LEGACY_PTY_COUNT=256
@@ -647,10 +653,6 @@ CONFIG_LEGACY_PTY_COUNT=256
647# 653#
648 654
649# 655#
650# Multimedia Capabilities Port drivers
651#
652
653#
654# Multimedia devices 656# Multimedia devices
655# 657#
656# CONFIG_VIDEO_DEV is not set 658# CONFIG_VIDEO_DEV is not set
@@ -675,6 +677,7 @@ CONFIG_LEGACY_PTY_COUNT=256
675# 677#
676CONFIG_USB_ARCH_HAS_HCD=y 678CONFIG_USB_ARCH_HAS_HCD=y
677CONFIG_USB_ARCH_HAS_OHCI=y 679CONFIG_USB_ARCH_HAS_OHCI=y
680CONFIG_USB_ARCH_HAS_EHCI=y
678# CONFIG_USB is not set 681# CONFIG_USB is not set
679 682
680# 683#
@@ -692,13 +695,31 @@ CONFIG_USB_ARCH_HAS_OHCI=y
692# CONFIG_MMC is not set 695# CONFIG_MMC is not set
693 696
694# 697#
698# LED devices
699#
700# CONFIG_NEW_LEDS is not set
701
702#
703# LED drivers
704#
705
706#
707# LED Triggers
708#
709
710#
695# InfiniBand support 711# InfiniBand support
696# 712#
697# CONFIG_INFINIBAND is not set 713# CONFIG_INFINIBAND is not set
698 714
699# 715#
700# SN Devices 716# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
717#
718
719#
720# Real Time Clock
701# 721#
722# CONFIG_RTC_CLASS is not set
702 723
703# 724#
704# File systems 725# File systems
@@ -746,7 +767,6 @@ CONFIG_SYSFS=y
746# CONFIG_TMPFS is not set 767# CONFIG_TMPFS is not set
747# CONFIG_HUGETLB_PAGE is not set 768# CONFIG_HUGETLB_PAGE is not set
748CONFIG_RAMFS=y 769CONFIG_RAMFS=y
749CONFIG_RELAYFS_FS=m
750# CONFIG_CONFIGFS_FS is not set 770# CONFIG_CONFIGFS_FS is not set
751 771
752# 772#
@@ -812,6 +832,7 @@ CONFIG_MSDOS_PARTITION=y
812# CONFIG_MAGIC_SYSRQ is not set 832# CONFIG_MAGIC_SYSRQ is not set
813# CONFIG_DEBUG_KERNEL is not set 833# CONFIG_DEBUG_KERNEL is not set
814CONFIG_LOG_BUF_SHIFT=15 834CONFIG_LOG_BUF_SHIFT=15
835# CONFIG_DEBUG_FS is not set
815CONFIG_CROSSCOMPILE=y 836CONFIG_CROSSCOMPILE=y
816CONFIG_CMDLINE="" 837CONFIG_CMDLINE=""
817# CONFIG_SB1XXX_CORELIS is not set 838# CONFIG_SB1XXX_CORELIS is not set
diff --git a/arch/mips/configs/sead_defconfig b/arch/mips/configs/sead_defconfig
index 9a936d7b7c0c..6b8a6a416a25 100644
--- a/arch/mips/configs/sead_defconfig
+++ b/arch/mips/configs/sead_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc1 3# Linux kernel version: 2.6.17-rc2
4# Fri Jan 27 15:40:33 2006 4# Mon Apr 24 14:51:17 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -64,6 +64,8 @@ CONFIG_MIPS_SEAD=y
64# CONFIG_TOSHIBA_RBTX4927 is not set 64# CONFIG_TOSHIBA_RBTX4927 is not set
65# CONFIG_TOSHIBA_RBTX4938 is not set 65# CONFIG_TOSHIBA_RBTX4938 is not set
66CONFIG_RWSEM_GENERIC_SPINLOCK=y 66CONFIG_RWSEM_GENERIC_SPINLOCK=y
67CONFIG_GENERIC_FIND_NEXT_BIT=y
68CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 69CONFIG_GENERIC_CALIBRATE_DELAY=y
68CONFIG_DMA_NONCOHERENT=y 70CONFIG_DMA_NONCOHERENT=y
69CONFIG_DMA_NEED_PCI_MAP_STATE=y 71CONFIG_DMA_NEED_PCI_MAP_STATE=y
@@ -118,11 +120,11 @@ CONFIG_PAGE_SIZE_4KB=y
118CONFIG_CPU_HAS_PREFETCH=y 120CONFIG_CPU_HAS_PREFETCH=y
119# CONFIG_MIPS_MT is not set 121# CONFIG_MIPS_MT is not set
120# CONFIG_64BIT_PHYS_ADDR is not set 122# CONFIG_64BIT_PHYS_ADDR is not set
121# CONFIG_CPU_ADVANCED is not set
122CONFIG_CPU_HAS_LLSC=y 123CONFIG_CPU_HAS_LLSC=y
123CONFIG_CPU_HAS_SYNC=y 124CONFIG_CPU_HAS_SYNC=y
124CONFIG_GENERIC_HARDIRQS=y 125CONFIG_GENERIC_HARDIRQS=y
125CONFIG_GENERIC_IRQ_PROBE=y 126CONFIG_GENERIC_IRQ_PROBE=y
127CONFIG_CPU_SUPPORTS_HIGHMEM=y
126CONFIG_ARCH_FLATMEM_ENABLE=y 128CONFIG_ARCH_FLATMEM_ENABLE=y
127CONFIG_SELECT_MEMORY_MODEL=y 129CONFIG_SELECT_MEMORY_MODEL=y
128CONFIG_FLATMEM_MANUAL=y 130CONFIG_FLATMEM_MANUAL=y
@@ -140,7 +142,6 @@ CONFIG_PREEMPT_NONE=y
140# Code maturity level options 142# Code maturity level options
141# 143#
142CONFIG_EXPERIMENTAL=y 144CONFIG_EXPERIMENTAL=y
143CONFIG_CLEAN_COMPILE=y
144CONFIG_BROKEN_ON_SMP=y 145CONFIG_BROKEN_ON_SMP=y
145CONFIG_INIT_ENV_ARG_LIMIT=32 146CONFIG_INIT_ENV_ARG_LIMIT=32
146 147
@@ -154,6 +155,7 @@ CONFIG_SYSVIPC=y
154# CONFIG_BSD_PROCESS_ACCT is not set 155# CONFIG_BSD_PROCESS_ACCT is not set
155CONFIG_SYSCTL=y 156CONFIG_SYSCTL=y
156# CONFIG_IKCONFIG is not set 157# CONFIG_IKCONFIG is not set
158CONFIG_RELAY=y
157CONFIG_INITRAMFS_SOURCE="" 159CONFIG_INITRAMFS_SOURCE=""
158# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 160# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
159CONFIG_EMBEDDED=y 161CONFIG_EMBEDDED=y
@@ -167,10 +169,6 @@ CONFIG_BASE_FULL=y
167CONFIG_FUTEX=y 169CONFIG_FUTEX=y
168CONFIG_EPOLL=y 170CONFIG_EPOLL=y
169CONFIG_SHMEM=y 171CONFIG_SHMEM=y
170CONFIG_CC_ALIGN_FUNCTIONS=0
171CONFIG_CC_ALIGN_LABELS=0
172CONFIG_CC_ALIGN_LOOPS=0
173CONFIG_CC_ALIGN_JUMPS=0
174CONFIG_SLAB=y 172CONFIG_SLAB=y
175# CONFIG_TINY_SHMEM is not set 173# CONFIG_TINY_SHMEM is not set
176CONFIG_BASE_SMALL=0 174CONFIG_BASE_SMALL=0
@@ -185,6 +183,8 @@ CONFIG_BASE_SMALL=0
185# Block layer 183# Block layer
186# 184#
187# CONFIG_LBD is not set 185# CONFIG_LBD is not set
186# CONFIG_BLK_DEV_IO_TRACE is not set
187# CONFIG_LSF is not set
188 188
189# 189#
190# IO Schedulers 190# IO Schedulers
@@ -296,12 +296,6 @@ CONFIG_RAID_ATTRS=y
296# 296#
297 297
298# 298#
299# Network device support
300#
301# CONFIG_NETPOLL is not set
302# CONFIG_NET_POLL_CONTROLLER is not set
303
304#
305# ISDN subsystem 299# ISDN subsystem
306# 300#
307 301
@@ -397,10 +391,6 @@ CONFIG_LEGACY_PTY_COUNT=256
397# 391#
398 392
399# 393#
400# Multimedia Capabilities Port drivers
401#
402
403#
404# Multimedia devices 394# Multimedia devices
405# 395#
406# CONFIG_VIDEO_DEV is not set 396# CONFIG_VIDEO_DEV is not set
@@ -424,6 +414,7 @@ CONFIG_LEGACY_PTY_COUNT=256
424# 414#
425# CONFIG_USB_ARCH_HAS_HCD is not set 415# CONFIG_USB_ARCH_HAS_HCD is not set
426# CONFIG_USB_ARCH_HAS_OHCI is not set 416# CONFIG_USB_ARCH_HAS_OHCI is not set
417# CONFIG_USB_ARCH_HAS_EHCI is not set
427 418
428# 419#
429# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 420# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
@@ -440,12 +431,30 @@ CONFIG_LEGACY_PTY_COUNT=256
440# CONFIG_MMC is not set 431# CONFIG_MMC is not set
441 432
442# 433#
434# LED devices
435#
436# CONFIG_NEW_LEDS is not set
437
438#
439# LED drivers
440#
441
442#
443# LED Triggers
444#
445
446#
443# InfiniBand support 447# InfiniBand support
444# 448#
445 449
446# 450#
447# SN Devices 451# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
452#
453
454#
455# Real Time Clock
448# 456#
457# CONFIG_RTC_CLASS is not set
449 458
450# 459#
451# File systems 460# File systems
@@ -489,7 +498,6 @@ CONFIG_SYSFS=y
489# CONFIG_TMPFS is not set 498# CONFIG_TMPFS is not set
490# CONFIG_HUGETLB_PAGE is not set 499# CONFIG_HUGETLB_PAGE is not set
491CONFIG_RAMFS=y 500CONFIG_RAMFS=y
492CONFIG_RELAYFS_FS=y
493# CONFIG_CONFIGFS_FS is not set 501# CONFIG_CONFIGFS_FS is not set
494 502
495# 503#
@@ -543,6 +551,8 @@ CONFIG_PARTITION_ADVANCED=y
543# CONFIG_MAGIC_SYSRQ is not set 551# CONFIG_MAGIC_SYSRQ is not set
544# CONFIG_DEBUG_KERNEL is not set 552# CONFIG_DEBUG_KERNEL is not set
545CONFIG_LOG_BUF_SHIFT=14 553CONFIG_LOG_BUF_SHIFT=14
554# CONFIG_DEBUG_FS is not set
555# CONFIG_UNWIND_INFO is not set
546CONFIG_CROSSCOMPILE=y 556CONFIG_CROSSCOMPILE=y
547CONFIG_CMDLINE="" 557CONFIG_CMDLINE=""
548 558
diff --git a/arch/mips/configs/tb0226_defconfig b/arch/mips/configs/tb0226_defconfig
index c2dee0d1c72c..dba0bdcdcf29 100644
--- a/arch/mips/configs/tb0226_defconfig
+++ b/arch/mips/configs/tb0226_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc1 3# Linux kernel version: 2.6.17-rc2
4# Fri Jan 27 15:40:34 2006 4# Tue Apr 25 00:08:41 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -68,12 +68,14 @@ CONFIG_MACH_VR41XX=y
68# CONFIG_NEC_CMBVR4133 is not set 68# CONFIG_NEC_CMBVR4133 is not set
69CONFIG_TANBAC_TB022X=y 69CONFIG_TANBAC_TB022X=y
70CONFIG_TANBAC_TB0226=y 70CONFIG_TANBAC_TB0226=y
71CONFIG_TANBAC_TB0287=y 71# CONFIG_TANBAC_TB0287 is not set
72# CONFIG_VICTOR_MPC30X is not set 72# CONFIG_VICTOR_MPC30X is not set
73# CONFIG_ZAO_CAPCELLA is not set 73# CONFIG_ZAO_CAPCELLA is not set
74CONFIG_PCI_VR41XX=y 74CONFIG_PCI_VR41XX=y
75# CONFIG_VRC4173 is not set 75# CONFIG_VRC4173 is not set
76CONFIG_RWSEM_GENERIC_SPINLOCK=y 76CONFIG_RWSEM_GENERIC_SPINLOCK=y
77CONFIG_GENERIC_FIND_NEXT_BIT=y
78CONFIG_GENERIC_HWEIGHT=y
77CONFIG_GENERIC_CALIBRATE_DELAY=y 79CONFIG_GENERIC_CALIBRATE_DELAY=y
78CONFIG_DMA_NONCOHERENT=y 80CONFIG_DMA_NONCOHERENT=y
79CONFIG_DMA_NEED_PCI_MAP_STATE=y 81CONFIG_DMA_NEED_PCI_MAP_STATE=y
@@ -92,7 +94,7 @@ CONFIG_MIPS_L1_CACHE_SHIFT=5
92# CONFIG_CPU_MIPS64_R2 is not set 94# CONFIG_CPU_MIPS64_R2 is not set
93# CONFIG_CPU_R3000 is not set 95# CONFIG_CPU_R3000 is not set
94# CONFIG_CPU_TX39XX is not set 96# CONFIG_CPU_TX39XX is not set
95# CONFIG_CPU_VR41XX is not set 97CONFIG_CPU_VR41XX=y
96# CONFIG_CPU_R4300 is not set 98# CONFIG_CPU_R4300 is not set
97# CONFIG_CPU_R4X00 is not set 99# CONFIG_CPU_R4X00 is not set
98# CONFIG_CPU_TX49XX is not set 100# CONFIG_CPU_TX49XX is not set
@@ -105,18 +107,21 @@ CONFIG_MIPS_L1_CACHE_SHIFT=5
105# CONFIG_CPU_RM7000 is not set 107# CONFIG_CPU_RM7000 is not set
106# CONFIG_CPU_RM9000 is not set 108# CONFIG_CPU_RM9000 is not set
107# CONFIG_CPU_SB1 is not set 109# CONFIG_CPU_SB1 is not set
110CONFIG_SYS_HAS_CPU_VR41XX=y
111CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
112CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
113CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
108 114
109# 115#
110# Kernel type 116# Kernel type
111# 117#
112# CONFIG_32BIT is not set 118CONFIG_32BIT=y
113# CONFIG_64BIT is not set 119# CONFIG_64BIT is not set
114CONFIG_PAGE_SIZE_4KB=y 120CONFIG_PAGE_SIZE_4KB=y
115# CONFIG_PAGE_SIZE_8KB is not set 121# CONFIG_PAGE_SIZE_8KB is not set
116# CONFIG_PAGE_SIZE_16KB is not set 122# CONFIG_PAGE_SIZE_16KB is not set
117# CONFIG_PAGE_SIZE_64KB is not set 123# CONFIG_PAGE_SIZE_64KB is not set
118# CONFIG_MIPS_MT is not set 124# CONFIG_MIPS_MT is not set
119CONFIG_CPU_HAS_LLSC=y
120CONFIG_CPU_HAS_SYNC=y 125CONFIG_CPU_HAS_SYNC=y
121CONFIG_GENERIC_HARDIRQS=y 126CONFIG_GENERIC_HARDIRQS=y
122CONFIG_GENERIC_IRQ_PROBE=y 127CONFIG_GENERIC_IRQ_PROBE=y
@@ -137,7 +142,6 @@ CONFIG_PREEMPT_NONE=y
137# Code maturity level options 142# Code maturity level options
138# 143#
139CONFIG_EXPERIMENTAL=y 144CONFIG_EXPERIMENTAL=y
140CONFIG_CLEAN_COMPILE=y
141CONFIG_BROKEN_ON_SMP=y 145CONFIG_BROKEN_ON_SMP=y
142CONFIG_INIT_ENV_ARG_LIMIT=32 146CONFIG_INIT_ENV_ARG_LIMIT=32
143 147
@@ -153,6 +157,7 @@ CONFIG_SYSVIPC=y
153CONFIG_SYSCTL=y 157CONFIG_SYSCTL=y
154# CONFIG_AUDIT is not set 158# CONFIG_AUDIT is not set
155# CONFIG_IKCONFIG is not set 159# CONFIG_IKCONFIG is not set
160# CONFIG_RELAY is not set
156CONFIG_INITRAMFS_SOURCE="" 161CONFIG_INITRAMFS_SOURCE=""
157# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 162# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
158CONFIG_EMBEDDED=y 163CONFIG_EMBEDDED=y
@@ -166,10 +171,6 @@ CONFIG_BASE_FULL=y
166CONFIG_FUTEX=y 171CONFIG_FUTEX=y
167CONFIG_EPOLL=y 172CONFIG_EPOLL=y
168CONFIG_SHMEM=y 173CONFIG_SHMEM=y
169CONFIG_CC_ALIGN_FUNCTIONS=0
170CONFIG_CC_ALIGN_LABELS=0
171CONFIG_CC_ALIGN_LOOPS=0
172CONFIG_CC_ALIGN_JUMPS=0
173CONFIG_SLAB=y 174CONFIG_SLAB=y
174# CONFIG_TINY_SHMEM is not set 175# CONFIG_TINY_SHMEM is not set
175CONFIG_BASE_SMALL=0 176CONFIG_BASE_SMALL=0
@@ -181,7 +182,6 @@ CONFIG_BASE_SMALL=0
181CONFIG_MODULES=y 182CONFIG_MODULES=y
182CONFIG_MODULE_UNLOAD=y 183CONFIG_MODULE_UNLOAD=y
183# CONFIG_MODULE_FORCE_UNLOAD is not set 184# CONFIG_MODULE_FORCE_UNLOAD is not set
184CONFIG_OBSOLETE_MODPARM=y
185CONFIG_MODVERSIONS=y 185CONFIG_MODVERSIONS=y
186CONFIG_MODULE_SRCVERSION_ALL=y 186CONFIG_MODULE_SRCVERSION_ALL=y
187CONFIG_KMOD=y 187CONFIG_KMOD=y
@@ -189,6 +189,9 @@ CONFIG_KMOD=y
189# 189#
190# Block layer 190# Block layer
191# 191#
192# CONFIG_LBD is not set
193# CONFIG_BLK_DEV_IO_TRACE is not set
194# CONFIG_LSF is not set
192 195
193# 196#
194# IO Schedulers 197# IO Schedulers
@@ -208,7 +211,6 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
208# 211#
209CONFIG_HW_HAS_PCI=y 212CONFIG_HW_HAS_PCI=y
210CONFIG_PCI=y 213CONFIG_PCI=y
211# CONFIG_PCI_LEGACY_PROC is not set
212CONFIG_MMU=y 214CONFIG_MMU=y
213 215
214# 216#
@@ -226,6 +228,7 @@ CONFIG_MMU=y
226# 228#
227CONFIG_BINFMT_ELF=y 229CONFIG_BINFMT_ELF=y
228# CONFIG_BINFMT_MISC is not set 230# CONFIG_BINFMT_MISC is not set
231CONFIG_TRAD_SIGNALS=y
229 232
230# 233#
231# Networking 234# Networking
@@ -235,11 +238,10 @@ CONFIG_NET=y
235# 238#
236# Networking options 239# Networking options
237# 240#
241# CONFIG_NETDEBUG is not set
238CONFIG_PACKET=y 242CONFIG_PACKET=y
239# CONFIG_PACKET_MMAP is not set 243# CONFIG_PACKET_MMAP is not set
240CONFIG_UNIX=y 244CONFIG_UNIX=y
241CONFIG_XFRM=y
242CONFIG_XFRM_USER=m
243# CONFIG_NET_KEY is not set 245# CONFIG_NET_KEY is not set
244CONFIG_INET=y 246CONFIG_INET=y
245CONFIG_IP_MULTICAST=y 247CONFIG_IP_MULTICAST=y
@@ -263,12 +265,15 @@ CONFIG_SYN_COOKIES=y
263# CONFIG_INET_AH is not set 265# CONFIG_INET_AH is not set
264# CONFIG_INET_ESP is not set 266# CONFIG_INET_ESP is not set
265# CONFIG_INET_IPCOMP is not set 267# CONFIG_INET_IPCOMP is not set
266CONFIG_INET_TUNNEL=m 268# CONFIG_INET_XFRM_TUNNEL is not set
269# CONFIG_INET_TUNNEL is not set
267CONFIG_INET_DIAG=y 270CONFIG_INET_DIAG=y
268CONFIG_INET_TCP_DIAG=y 271CONFIG_INET_TCP_DIAG=y
269# CONFIG_TCP_CONG_ADVANCED is not set 272# CONFIG_TCP_CONG_ADVANCED is not set
270CONFIG_TCP_CONG_BIC=y 273CONFIG_TCP_CONG_BIC=y
271# CONFIG_IPV6 is not set 274# CONFIG_IPV6 is not set
275# CONFIG_INET6_XFRM_TUNNEL is not set
276# CONFIG_INET6_TUNNEL is not set
272# CONFIG_NETFILTER is not set 277# CONFIG_NETFILTER is not set
273 278
274# 279#
@@ -280,6 +285,11 @@ CONFIG_TCP_CONG_BIC=y
280# SCTP Configuration (EXPERIMENTAL) 285# SCTP Configuration (EXPERIMENTAL)
281# 286#
282# CONFIG_IP_SCTP is not set 287# CONFIG_IP_SCTP is not set
288
289#
290# TIPC Configuration (EXPERIMENTAL)
291#
292# CONFIG_TIPC is not set
283# CONFIG_ATM is not set 293# CONFIG_ATM is not set
284# CONFIG_BRIDGE is not set 294# CONFIG_BRIDGE is not set
285# CONFIG_VLAN_8021Q is not set 295# CONFIG_VLAN_8021Q is not set
@@ -289,11 +299,6 @@ CONFIG_TCP_CONG_BIC=y
289# CONFIG_ATALK is not set 299# CONFIG_ATALK is not set
290# CONFIG_X25 is not set 300# CONFIG_X25 is not set
291# CONFIG_LAPB is not set 301# CONFIG_LAPB is not set
292
293#
294# TIPC Configuration (EXPERIMENTAL)
295#
296# CONFIG_TIPC is not set
297# CONFIG_NET_DIVERT is not set 302# CONFIG_NET_DIVERT is not set
298# CONFIG_ECONET is not set 303# CONFIG_ECONET is not set
299# CONFIG_WAN_ROUTER is not set 304# CONFIG_WAN_ROUTER is not set
@@ -310,10 +315,7 @@ CONFIG_TCP_CONG_BIC=y
310# CONFIG_HAMRADIO is not set 315# CONFIG_HAMRADIO is not set
311# CONFIG_IRDA is not set 316# CONFIG_IRDA is not set
312# CONFIG_BT is not set 317# CONFIG_BT is not set
313CONFIG_IEEE80211=m 318# CONFIG_IEEE80211 is not set
314# CONFIG_IEEE80211_DEBUG is not set
315CONFIG_IEEE80211_CRYPT_WEP=m
316CONFIG_IEEE80211_CRYPT_CCMP=m
317 319
318# 320#
319# Device Drivers 321# Device Drivers
@@ -358,11 +360,12 @@ CONFIG_BLK_DEV_LOOP=m
358CONFIG_BLK_DEV_NBD=m 360CONFIG_BLK_DEV_NBD=m
359# CONFIG_BLK_DEV_SX8 is not set 361# CONFIG_BLK_DEV_SX8 is not set
360# CONFIG_BLK_DEV_UB is not set 362# CONFIG_BLK_DEV_UB is not set
361CONFIG_BLK_DEV_RAM=m 363CONFIG_BLK_DEV_RAM=y
362CONFIG_BLK_DEV_RAM_COUNT=16 364CONFIG_BLK_DEV_RAM_COUNT=16
363CONFIG_BLK_DEV_RAM_SIZE=4096 365CONFIG_BLK_DEV_RAM_SIZE=4096
366# CONFIG_BLK_DEV_INITRD is not set
364# CONFIG_CDROM_PKTCDVD is not set 367# CONFIG_CDROM_PKTCDVD is not set
365CONFIG_ATA_OVER_ETH=m 368# CONFIG_ATA_OVER_ETH is not set
366 369
367# 370#
368# ATA/ATAPI/MFM/RLL support 371# ATA/ATAPI/MFM/RLL support
@@ -397,14 +400,14 @@ CONFIG_SCSI_MULTI_LUN=y
397# SCSI Transport Attributes 400# SCSI Transport Attributes
398# 401#
399# CONFIG_SCSI_SPI_ATTRS is not set 402# CONFIG_SCSI_SPI_ATTRS is not set
400CONFIG_SCSI_FC_ATTRS=y 403# CONFIG_SCSI_FC_ATTRS is not set
401CONFIG_SCSI_ISCSI_ATTRS=m 404# CONFIG_SCSI_ISCSI_ATTRS is not set
402# CONFIG_SCSI_SAS_ATTRS is not set 405# CONFIG_SCSI_SAS_ATTRS is not set
403 406
404# 407#
405# SCSI low-level drivers 408# SCSI low-level drivers
406# 409#
407CONFIG_ISCSI_TCP=m 410# CONFIG_ISCSI_TCP is not set
408# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 411# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
409# CONFIG_SCSI_3W_9XXX is not set 412# CONFIG_SCSI_3W_9XXX is not set
410# CONFIG_SCSI_ACARD is not set 413# CONFIG_SCSI_ACARD is not set
@@ -424,7 +427,6 @@ CONFIG_ISCSI_TCP=m
424# CONFIG_SCSI_INIA100 is not set 427# CONFIG_SCSI_INIA100 is not set
425# CONFIG_SCSI_SYM53C8XX_2 is not set 428# CONFIG_SCSI_SYM53C8XX_2 is not set
426# CONFIG_SCSI_IPR is not set 429# CONFIG_SCSI_IPR is not set
427# CONFIG_SCSI_QLOGIC_FC is not set
428# CONFIG_SCSI_QLOGIC_1280 is not set 430# CONFIG_SCSI_QLOGIC_1280 is not set
429# CONFIG_SCSI_QLA_FC is not set 431# CONFIG_SCSI_QLA_FC is not set
430# CONFIG_SCSI_LPFC is not set 432# CONFIG_SCSI_LPFC is not set
@@ -507,8 +509,8 @@ CONFIG_NET_PCI=y
507# CONFIG_B44 is not set 509# CONFIG_B44 is not set
508# CONFIG_FORCEDETH is not set 510# CONFIG_FORCEDETH is not set
509# CONFIG_DGRS is not set 511# CONFIG_DGRS is not set
510CONFIG_EEPRO100=y 512# CONFIG_EEPRO100 is not set
511# CONFIG_E100 is not set 513CONFIG_E100=y
512# CONFIG_FEALNX is not set 514# CONFIG_FEALNX is not set
513# CONFIG_NATSEMI is not set 515# CONFIG_NATSEMI is not set
514# CONFIG_NE2K_PCI is not set 516# CONFIG_NE2K_PCI is not set
@@ -625,6 +627,11 @@ CONFIG_HW_CONSOLE=y
625# 627#
626# Non-8250 serial port support 628# Non-8250 serial port support
627# 629#
630CONFIG_SERIAL_CORE=y
631CONFIG_SERIAL_CORE_CONSOLE=y
632CONFIG_SERIAL_VR41XX=y
633CONFIG_SERIAL_VR41XX_CONSOLE=y
634# CONFIG_SERIAL_JSM is not set
628CONFIG_UNIX98_PTYS=y 635CONFIG_UNIX98_PTYS=y
629CONFIG_LEGACY_PTYS=y 636CONFIG_LEGACY_PTYS=y
630CONFIG_LEGACY_PTY_COUNT=256 637CONFIG_LEGACY_PTY_COUNT=256
@@ -685,10 +692,6 @@ CONFIG_GPIO_VR41XX=y
685# 692#
686 693
687# 694#
688# Multimedia Capabilities Port drivers
689#
690
691#
692# Multimedia devices 695# Multimedia devices
693# 696#
694# CONFIG_VIDEO_DEV is not set 697# CONFIG_VIDEO_DEV is not set
@@ -697,6 +700,7 @@ CONFIG_GPIO_VR41XX=y
697# Digital Video Broadcasting Devices 700# Digital Video Broadcasting Devices
698# 701#
699# CONFIG_DVB is not set 702# CONFIG_DVB is not set
703# CONFIG_USB_DABUSB is not set
700 704
701# 705#
702# Graphics support 706# Graphics support
@@ -719,6 +723,7 @@ CONFIG_DUMMY_CONSOLE=y
719# 723#
720CONFIG_USB_ARCH_HAS_HCD=y 724CONFIG_USB_ARCH_HAS_HCD=y
721CONFIG_USB_ARCH_HAS_OHCI=y 725CONFIG_USB_ARCH_HAS_OHCI=y
726CONFIG_USB_ARCH_HAS_EHCI=y
722CONFIG_USB=y 727CONFIG_USB=y
723# CONFIG_USB_DEBUG is not set 728# CONFIG_USB_DEBUG is not set
724 729
@@ -756,7 +761,7 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y
756# 761#
757# may also be needed; see USB_STORAGE Help for more information 762# may also be needed; see USB_STORAGE Help for more information
758# 763#
759CONFIG_USB_STORAGE=m 764CONFIG_USB_STORAGE=y
760# CONFIG_USB_STORAGE_DEBUG is not set 765# CONFIG_USB_STORAGE_DEBUG is not set
761# CONFIG_USB_STORAGE_DATAFAB is not set 766# CONFIG_USB_STORAGE_DATAFAB is not set
762# CONFIG_USB_STORAGE_FREECOM is not set 767# CONFIG_USB_STORAGE_FREECOM is not set
@@ -783,9 +788,7 @@ CONFIG_USB_STORAGE=m
783# CONFIG_USB_ACECAD is not set 788# CONFIG_USB_ACECAD is not set
784# CONFIG_USB_KBTAB is not set 789# CONFIG_USB_KBTAB is not set
785# CONFIG_USB_POWERMATE is not set 790# CONFIG_USB_POWERMATE is not set
786# CONFIG_USB_MTOUCH is not set 791# CONFIG_USB_TOUCHSCREEN is not set
787# CONFIG_USB_ITMTOUCH is not set
788# CONFIG_USB_EGALAX is not set
789# CONFIG_USB_YEALINK is not set 792# CONFIG_USB_YEALINK is not set
790# CONFIG_USB_XPAD is not set 793# CONFIG_USB_XPAD is not set
791# CONFIG_USB_ATI_REMOTE is not set 794# CONFIG_USB_ATI_REMOTE is not set
@@ -800,15 +803,6 @@ CONFIG_USB_STORAGE=m
800# CONFIG_USB_MICROTEK is not set 803# CONFIG_USB_MICROTEK is not set
801 804
802# 805#
803# USB Multimedia devices
804#
805# CONFIG_USB_DABUSB is not set
806
807#
808# Video4Linux support is needed for USB Multimedia device support
809#
810
811#
812# USB Network Adapters 806# USB Network Adapters
813# 807#
814# CONFIG_USB_CATC is not set 808# CONFIG_USB_CATC is not set
@@ -816,7 +810,7 @@ CONFIG_USB_STORAGE=m
816# CONFIG_USB_PEGASUS is not set 810# CONFIG_USB_PEGASUS is not set
817# CONFIG_USB_RTL8150 is not set 811# CONFIG_USB_RTL8150 is not set
818# CONFIG_USB_USBNET is not set 812# CONFIG_USB_USBNET is not set
819CONFIG_USB_MON=y 813# CONFIG_USB_MON is not set
820 814
821# 815#
822# USB port drivers 816# USB port drivers
@@ -860,13 +854,48 @@ CONFIG_USB_MON=y
860# CONFIG_MMC is not set 854# CONFIG_MMC is not set
861 855
862# 856#
857# LED devices
858#
859# CONFIG_NEW_LEDS is not set
860
861#
862# LED drivers
863#
864
865#
866# LED Triggers
867#
868
869#
863# InfiniBand support 870# InfiniBand support
864# 871#
865# CONFIG_INFINIBAND is not set 872# CONFIG_INFINIBAND is not set
866 873
867# 874#
868# SN Devices 875# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
876#
877
878#
879# Real Time Clock
880#
881CONFIG_RTC_LIB=y
882CONFIG_RTC_CLASS=y
883CONFIG_RTC_HCTOSYS=y
884CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
885
886#
887# RTC interfaces
888#
889CONFIG_RTC_INTF_SYSFS=y
890CONFIG_RTC_INTF_PROC=y
891CONFIG_RTC_INTF_DEV=y
892
893#
894# RTC drivers
869# 895#
896# CONFIG_RTC_DRV_M48T86 is not set
897CONFIG_RTC_DRV_VR41XX=y
898# CONFIG_RTC_DRV_TEST is not set
870 899
871# 900#
872# File systems 901# File systems
@@ -911,7 +940,6 @@ CONFIG_SYSFS=y
911CONFIG_TMPFS=y 940CONFIG_TMPFS=y
912# CONFIG_HUGETLB_PAGE is not set 941# CONFIG_HUGETLB_PAGE is not set
913CONFIG_RAMFS=y 942CONFIG_RAMFS=y
914CONFIG_RELAYFS_FS=m
915# CONFIG_CONFIGFS_FS is not set 943# CONFIG_CONFIGFS_FS is not set
916 944
917# 945#
@@ -952,9 +980,7 @@ CONFIG_NFS_COMMON=y
952CONFIG_SUNRPC=y 980CONFIG_SUNRPC=y
953# CONFIG_RPCSEC_GSS_KRB5 is not set 981# CONFIG_RPCSEC_GSS_KRB5 is not set
954# CONFIG_RPCSEC_GSS_SPKM3 is not set 982# CONFIG_RPCSEC_GSS_SPKM3 is not set
955CONFIG_SMB_FS=m 983# CONFIG_SMB_FS is not set
956CONFIG_SMB_NLS_DEFAULT=y
957CONFIG_SMB_NLS_REMOTE="cp932"
958# CONFIG_CIFS is not set 984# CONFIG_CIFS is not set
959# CONFIG_NCP_FS is not set 985# CONFIG_NCP_FS is not set
960# CONFIG_CODA_FS is not set 986# CONFIG_CODA_FS is not set
@@ -970,46 +996,7 @@ CONFIG_MSDOS_PARTITION=y
970# 996#
971# Native Language Support 997# Native Language Support
972# 998#
973CONFIG_NLS=y 999# CONFIG_NLS is not set
974CONFIG_NLS_DEFAULT="iso8859-1"
975CONFIG_NLS_CODEPAGE_437=m
976# CONFIG_NLS_CODEPAGE_737 is not set
977# CONFIG_NLS_CODEPAGE_775 is not set
978# CONFIG_NLS_CODEPAGE_850 is not set
979# CONFIG_NLS_CODEPAGE_852 is not set
980# CONFIG_NLS_CODEPAGE_855 is not set
981# CONFIG_NLS_CODEPAGE_857 is not set
982# CONFIG_NLS_CODEPAGE_860 is not set
983# CONFIG_NLS_CODEPAGE_861 is not set
984# CONFIG_NLS_CODEPAGE_862 is not set
985# CONFIG_NLS_CODEPAGE_863 is not set
986# CONFIG_NLS_CODEPAGE_864 is not set
987# CONFIG_NLS_CODEPAGE_865 is not set
988# CONFIG_NLS_CODEPAGE_866 is not set
989# CONFIG_NLS_CODEPAGE_869 is not set
990# CONFIG_NLS_CODEPAGE_936 is not set
991# CONFIG_NLS_CODEPAGE_950 is not set
992CONFIG_NLS_CODEPAGE_932=m
993# CONFIG_NLS_CODEPAGE_949 is not set
994# CONFIG_NLS_CODEPAGE_874 is not set
995# CONFIG_NLS_ISO8859_8 is not set
996# CONFIG_NLS_CODEPAGE_1250 is not set
997# CONFIG_NLS_CODEPAGE_1251 is not set
998# CONFIG_NLS_ASCII is not set
999CONFIG_NLS_ISO8859_1=m
1000# CONFIG_NLS_ISO8859_2 is not set
1001# CONFIG_NLS_ISO8859_3 is not set
1002# CONFIG_NLS_ISO8859_4 is not set
1003# CONFIG_NLS_ISO8859_5 is not set
1004# CONFIG_NLS_ISO8859_6 is not set
1005# CONFIG_NLS_ISO8859_7 is not set
1006# CONFIG_NLS_ISO8859_9 is not set
1007# CONFIG_NLS_ISO8859_13 is not set
1008# CONFIG_NLS_ISO8859_14 is not set
1009# CONFIG_NLS_ISO8859_15 is not set
1010# CONFIG_NLS_KOI8_R is not set
1011# CONFIG_NLS_KOI8_U is not set
1012# CONFIG_NLS_UTF8 is not set
1013 1000
1014# 1001#
1015# Profiling support 1002# Profiling support
@@ -1023,44 +1010,20 @@ CONFIG_NLS_ISO8859_1=m
1023# CONFIG_MAGIC_SYSRQ is not set 1010# CONFIG_MAGIC_SYSRQ is not set
1024# CONFIG_DEBUG_KERNEL is not set 1011# CONFIG_DEBUG_KERNEL is not set
1025CONFIG_LOG_BUF_SHIFT=14 1012CONFIG_LOG_BUF_SHIFT=14
1013# CONFIG_DEBUG_FS is not set
1026CONFIG_CROSSCOMPILE=y 1014CONFIG_CROSSCOMPILE=y
1027CONFIG_CMDLINE="mem=32M console=ttyVR0,115200" 1015CONFIG_CMDLINE="mem=32M console=ttyVR0,115200"
1028 1016
1029# 1017#
1030# Security options 1018# Security options
1031# 1019#
1032CONFIG_KEYS=y 1020# CONFIG_KEYS is not set
1033CONFIG_KEYS_DEBUG_PROC_KEYS=y
1034# CONFIG_SECURITY is not set 1021# CONFIG_SECURITY is not set
1035 1022
1036# 1023#
1037# Cryptographic options 1024# Cryptographic options
1038# 1025#
1039CONFIG_CRYPTO=y 1026# CONFIG_CRYPTO is not set
1040CONFIG_CRYPTO_HMAC=y
1041CONFIG_CRYPTO_NULL=m
1042CONFIG_CRYPTO_MD4=m
1043CONFIG_CRYPTO_MD5=m
1044CONFIG_CRYPTO_SHA1=m
1045CONFIG_CRYPTO_SHA256=m
1046CONFIG_CRYPTO_SHA512=m
1047CONFIG_CRYPTO_WP512=m
1048CONFIG_CRYPTO_TGR192=m
1049CONFIG_CRYPTO_DES=m
1050CONFIG_CRYPTO_BLOWFISH=m
1051CONFIG_CRYPTO_TWOFISH=m
1052CONFIG_CRYPTO_SERPENT=m
1053CONFIG_CRYPTO_AES=m
1054CONFIG_CRYPTO_CAST5=m
1055CONFIG_CRYPTO_CAST6=m
1056CONFIG_CRYPTO_TEA=m
1057CONFIG_CRYPTO_ARC4=m
1058CONFIG_CRYPTO_KHAZAD=m
1059CONFIG_CRYPTO_ANUBIS=m
1060CONFIG_CRYPTO_DEFLATE=m
1061CONFIG_CRYPTO_MICHAEL_MIC=m
1062CONFIG_CRYPTO_CRC32C=m
1063# CONFIG_CRYPTO_TEST is not set
1064 1027
1065# 1028#
1066# Hardware crypto devices 1029# Hardware crypto devices
@@ -1069,9 +1032,8 @@ CONFIG_CRYPTO_CRC32C=m
1069# 1032#
1070# Library routines 1033# Library routines
1071# 1034#
1072CONFIG_CRC_CCITT=m 1035# CONFIG_CRC_CCITT is not set
1073CONFIG_CRC16=m 1036# CONFIG_CRC16 is not set
1074CONFIG_CRC32=m 1037# CONFIG_CRC32 is not set
1075CONFIG_LIBCRC32C=m 1038# CONFIG_LIBCRC32C is not set
1076CONFIG_ZLIB_INFLATE=m 1039CONFIG_ZLIB_INFLATE=m
1077CONFIG_ZLIB_DEFLATE=m
diff --git a/arch/mips/configs/tb0229_defconfig b/arch/mips/configs/tb0229_defconfig
index be99261d7997..5a924c1a5803 100644
--- a/arch/mips/configs/tb0229_defconfig
+++ b/arch/mips/configs/tb0229_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc1 3# Linux kernel version: 2.6.17-rc2
4# Fri Jan 27 15:40:35 2006 4# Tue Apr 25 00:08:59 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -68,12 +68,14 @@ CONFIG_MACH_VR41XX=y
68# CONFIG_NEC_CMBVR4133 is not set 68# CONFIG_NEC_CMBVR4133 is not set
69CONFIG_TANBAC_TB022X=y 69CONFIG_TANBAC_TB022X=y
70# CONFIG_TANBAC_TB0226 is not set 70# CONFIG_TANBAC_TB0226 is not set
71CONFIG_TANBAC_TB0287=y 71# CONFIG_TANBAC_TB0287 is not set
72# CONFIG_VICTOR_MPC30X is not set 72# CONFIG_VICTOR_MPC30X is not set
73# CONFIG_ZAO_CAPCELLA is not set 73# CONFIG_ZAO_CAPCELLA is not set
74CONFIG_PCI_VR41XX=y 74CONFIG_PCI_VR41XX=y
75# CONFIG_VRC4173 is not set 75# CONFIG_VRC4173 is not set
76CONFIG_RWSEM_GENERIC_SPINLOCK=y 76CONFIG_RWSEM_GENERIC_SPINLOCK=y
77CONFIG_GENERIC_FIND_NEXT_BIT=y
78CONFIG_GENERIC_HWEIGHT=y
77CONFIG_GENERIC_CALIBRATE_DELAY=y 79CONFIG_GENERIC_CALIBRATE_DELAY=y
78CONFIG_DMA_NONCOHERENT=y 80CONFIG_DMA_NONCOHERENT=y
79CONFIG_DMA_NEED_PCI_MAP_STATE=y 81CONFIG_DMA_NEED_PCI_MAP_STATE=y
@@ -92,7 +94,7 @@ CONFIG_MIPS_L1_CACHE_SHIFT=5
92# CONFIG_CPU_MIPS64_R2 is not set 94# CONFIG_CPU_MIPS64_R2 is not set
93# CONFIG_CPU_R3000 is not set 95# CONFIG_CPU_R3000 is not set
94# CONFIG_CPU_TX39XX is not set 96# CONFIG_CPU_TX39XX is not set
95# CONFIG_CPU_VR41XX is not set 97CONFIG_CPU_VR41XX=y
96# CONFIG_CPU_R4300 is not set 98# CONFIG_CPU_R4300 is not set
97# CONFIG_CPU_R4X00 is not set 99# CONFIG_CPU_R4X00 is not set
98# CONFIG_CPU_TX49XX is not set 100# CONFIG_CPU_TX49XX is not set
@@ -105,18 +107,21 @@ CONFIG_MIPS_L1_CACHE_SHIFT=5
105# CONFIG_CPU_RM7000 is not set 107# CONFIG_CPU_RM7000 is not set
106# CONFIG_CPU_RM9000 is not set 108# CONFIG_CPU_RM9000 is not set
107# CONFIG_CPU_SB1 is not set 109# CONFIG_CPU_SB1 is not set
110CONFIG_SYS_HAS_CPU_VR41XX=y
111CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
112CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
113CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
108 114
109# 115#
110# Kernel type 116# Kernel type
111# 117#
112# CONFIG_32BIT is not set 118CONFIG_32BIT=y
113# CONFIG_64BIT is not set 119# CONFIG_64BIT is not set
114CONFIG_PAGE_SIZE_4KB=y 120CONFIG_PAGE_SIZE_4KB=y
115# CONFIG_PAGE_SIZE_8KB is not set 121# CONFIG_PAGE_SIZE_8KB is not set
116# CONFIG_PAGE_SIZE_16KB is not set 122# CONFIG_PAGE_SIZE_16KB is not set
117# CONFIG_PAGE_SIZE_64KB is not set 123# CONFIG_PAGE_SIZE_64KB is not set
118# CONFIG_MIPS_MT is not set 124# CONFIG_MIPS_MT is not set
119CONFIG_CPU_HAS_LLSC=y
120CONFIG_CPU_HAS_SYNC=y 125CONFIG_CPU_HAS_SYNC=y
121CONFIG_GENERIC_HARDIRQS=y 126CONFIG_GENERIC_HARDIRQS=y
122CONFIG_GENERIC_IRQ_PROBE=y 127CONFIG_GENERIC_IRQ_PROBE=y
@@ -137,7 +142,6 @@ CONFIG_PREEMPT_NONE=y
137# Code maturity level options 142# Code maturity level options
138# 143#
139CONFIG_EXPERIMENTAL=y 144CONFIG_EXPERIMENTAL=y
140CONFIG_CLEAN_COMPILE=y
141CONFIG_BROKEN_ON_SMP=y 145CONFIG_BROKEN_ON_SMP=y
142CONFIG_INIT_ENV_ARG_LIMIT=32 146CONFIG_INIT_ENV_ARG_LIMIT=32
143 147
@@ -153,6 +157,7 @@ CONFIG_SYSVIPC=y
153CONFIG_SYSCTL=y 157CONFIG_SYSCTL=y
154# CONFIG_AUDIT is not set 158# CONFIG_AUDIT is not set
155# CONFIG_IKCONFIG is not set 159# CONFIG_IKCONFIG is not set
160# CONFIG_RELAY is not set
156CONFIG_INITRAMFS_SOURCE="" 161CONFIG_INITRAMFS_SOURCE=""
157# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 162# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
158CONFIG_EMBEDDED=y 163CONFIG_EMBEDDED=y
@@ -166,10 +171,6 @@ CONFIG_BASE_FULL=y
166CONFIG_FUTEX=y 171CONFIG_FUTEX=y
167CONFIG_EPOLL=y 172CONFIG_EPOLL=y
168CONFIG_SHMEM=y 173CONFIG_SHMEM=y
169CONFIG_CC_ALIGN_FUNCTIONS=0
170CONFIG_CC_ALIGN_LABELS=0
171CONFIG_CC_ALIGN_LOOPS=0
172CONFIG_CC_ALIGN_JUMPS=0
173CONFIG_SLAB=y 174CONFIG_SLAB=y
174# CONFIG_TINY_SHMEM is not set 175# CONFIG_TINY_SHMEM is not set
175CONFIG_BASE_SMALL=0 176CONFIG_BASE_SMALL=0
@@ -181,7 +182,6 @@ CONFIG_BASE_SMALL=0
181CONFIG_MODULES=y 182CONFIG_MODULES=y
182CONFIG_MODULE_UNLOAD=y 183CONFIG_MODULE_UNLOAD=y
183# CONFIG_MODULE_FORCE_UNLOAD is not set 184# CONFIG_MODULE_FORCE_UNLOAD is not set
184CONFIG_OBSOLETE_MODPARM=y
185CONFIG_MODVERSIONS=y 185CONFIG_MODVERSIONS=y
186CONFIG_MODULE_SRCVERSION_ALL=y 186CONFIG_MODULE_SRCVERSION_ALL=y
187CONFIG_KMOD=y 187CONFIG_KMOD=y
@@ -189,6 +189,9 @@ CONFIG_KMOD=y
189# 189#
190# Block layer 190# Block layer
191# 191#
192# CONFIG_LBD is not set
193# CONFIG_BLK_DEV_IO_TRACE is not set
194# CONFIG_LSF is not set
192 195
193# 196#
194# IO Schedulers 197# IO Schedulers
@@ -208,7 +211,6 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
208# 211#
209CONFIG_HW_HAS_PCI=y 212CONFIG_HW_HAS_PCI=y
210CONFIG_PCI=y 213CONFIG_PCI=y
211# CONFIG_PCI_LEGACY_PROC is not set
212CONFIG_MMU=y 214CONFIG_MMU=y
213 215
214# 216#
@@ -226,6 +228,7 @@ CONFIG_MMU=y
226# 228#
227CONFIG_BINFMT_ELF=y 229CONFIG_BINFMT_ELF=y
228# CONFIG_BINFMT_MISC is not set 230# CONFIG_BINFMT_MISC is not set
231CONFIG_TRAD_SIGNALS=y
229 232
230# 233#
231# Networking 234# Networking
@@ -235,11 +238,10 @@ CONFIG_NET=y
235# 238#
236# Networking options 239# Networking options
237# 240#
241# CONFIG_NETDEBUG is not set
238CONFIG_PACKET=y 242CONFIG_PACKET=y
239# CONFIG_PACKET_MMAP is not set 243# CONFIG_PACKET_MMAP is not set
240CONFIG_UNIX=y 244CONFIG_UNIX=y
241CONFIG_XFRM=y
242CONFIG_XFRM_USER=m
243# CONFIG_NET_KEY is not set 245# CONFIG_NET_KEY is not set
244CONFIG_INET=y 246CONFIG_INET=y
245CONFIG_IP_MULTICAST=y 247CONFIG_IP_MULTICAST=y
@@ -264,12 +266,15 @@ CONFIG_SYN_COOKIES=y
264# CONFIG_INET_AH is not set 266# CONFIG_INET_AH is not set
265# CONFIG_INET_ESP is not set 267# CONFIG_INET_ESP is not set
266# CONFIG_INET_IPCOMP is not set 268# CONFIG_INET_IPCOMP is not set
269# CONFIG_INET_XFRM_TUNNEL is not set
267CONFIG_INET_TUNNEL=m 270CONFIG_INET_TUNNEL=m
268CONFIG_INET_DIAG=y 271CONFIG_INET_DIAG=y
269CONFIG_INET_TCP_DIAG=y 272CONFIG_INET_TCP_DIAG=y
270# CONFIG_TCP_CONG_ADVANCED is not set 273# CONFIG_TCP_CONG_ADVANCED is not set
271CONFIG_TCP_CONG_BIC=y 274CONFIG_TCP_CONG_BIC=y
272# CONFIG_IPV6 is not set 275# CONFIG_IPV6 is not set
276# CONFIG_INET6_XFRM_TUNNEL is not set
277# CONFIG_INET6_TUNNEL is not set
273# CONFIG_NETFILTER is not set 278# CONFIG_NETFILTER is not set
274 279
275# 280#
@@ -281,6 +286,11 @@ CONFIG_TCP_CONG_BIC=y
281# SCTP Configuration (EXPERIMENTAL) 286# SCTP Configuration (EXPERIMENTAL)
282# 287#
283# CONFIG_IP_SCTP is not set 288# CONFIG_IP_SCTP is not set
289
290#
291# TIPC Configuration (EXPERIMENTAL)
292#
293# CONFIG_TIPC is not set
284# CONFIG_ATM is not set 294# CONFIG_ATM is not set
285# CONFIG_BRIDGE is not set 295# CONFIG_BRIDGE is not set
286# CONFIG_VLAN_8021Q is not set 296# CONFIG_VLAN_8021Q is not set
@@ -290,11 +300,6 @@ CONFIG_TCP_CONG_BIC=y
290# CONFIG_ATALK is not set 300# CONFIG_ATALK is not set
291# CONFIG_X25 is not set 301# CONFIG_X25 is not set
292# CONFIG_LAPB is not set 302# CONFIG_LAPB is not set
293
294#
295# TIPC Configuration (EXPERIMENTAL)
296#
297# CONFIG_TIPC is not set
298# CONFIG_NET_DIVERT is not set 303# CONFIG_NET_DIVERT is not set
299# CONFIG_ECONET is not set 304# CONFIG_ECONET is not set
300# CONFIG_WAN_ROUTER is not set 305# CONFIG_WAN_ROUTER is not set
@@ -311,10 +316,7 @@ CONFIG_TCP_CONG_BIC=y
311# CONFIG_HAMRADIO is not set 316# CONFIG_HAMRADIO is not set
312# CONFIG_IRDA is not set 317# CONFIG_IRDA is not set
313# CONFIG_BT is not set 318# CONFIG_BT is not set
314CONFIG_IEEE80211=m 319# CONFIG_IEEE80211 is not set
315# CONFIG_IEEE80211_DEBUG is not set
316CONFIG_IEEE80211_CRYPT_WEP=m
317CONFIG_IEEE80211_CRYPT_CCMP=m
318 320
319# 321#
320# Device Drivers 322# Device Drivers
@@ -325,12 +327,12 @@ CONFIG_IEEE80211_CRYPT_CCMP=m
325# 327#
326CONFIG_STANDALONE=y 328CONFIG_STANDALONE=y
327CONFIG_PREVENT_FIRMWARE_BUILD=y 329CONFIG_PREVENT_FIRMWARE_BUILD=y
328CONFIG_FW_LOADER=m 330# CONFIG_FW_LOADER is not set
329 331
330# 332#
331# Connector - unified userspace <-> kernelspace linker 333# Connector - unified userspace <-> kernelspace linker
332# 334#
333CONFIG_CONNECTOR=m 335# CONFIG_CONNECTOR is not set
334 336
335# 337#
336# Memory Technology Devices (MTD) 338# Memory Technology Devices (MTD)
@@ -363,10 +365,8 @@ CONFIG_BLK_DEV_RAM=y
363CONFIG_BLK_DEV_RAM_COUNT=16 365CONFIG_BLK_DEV_RAM_COUNT=16
364CONFIG_BLK_DEV_RAM_SIZE=4096 366CONFIG_BLK_DEV_RAM_SIZE=4096
365# CONFIG_BLK_DEV_INITRD is not set 367# CONFIG_BLK_DEV_INITRD is not set
366CONFIG_CDROM_PKTCDVD=m 368# CONFIG_CDROM_PKTCDVD is not set
367CONFIG_CDROM_PKTCDVD_BUFFERS=8 369# CONFIG_ATA_OVER_ETH is not set
368# CONFIG_CDROM_PKTCDVD_WCACHE is not set
369CONFIG_ATA_OVER_ETH=m
370 370
371# 371#
372# ATA/ATAPI/MFM/RLL support 372# ATA/ATAPI/MFM/RLL support
@@ -443,30 +443,7 @@ CONFIG_MII=y
443# 443#
444# CONFIG_NET_TULIP is not set 444# CONFIG_NET_TULIP is not set
445# CONFIG_HP100 is not set 445# CONFIG_HP100 is not set
446CONFIG_NET_PCI=y 446# CONFIG_NET_PCI is not set
447# CONFIG_PCNET32 is not set
448# CONFIG_AMD8111_ETH is not set
449# CONFIG_ADAPTEC_STARFIRE is not set
450# CONFIG_B44 is not set
451# CONFIG_FORCEDETH is not set
452# CONFIG_DGRS is not set
453CONFIG_EEPRO100=y
454# CONFIG_E100 is not set
455# CONFIG_FEALNX is not set
456# CONFIG_NATSEMI is not set
457# CONFIG_NE2K_PCI is not set
458# CONFIG_8139CP is not set
459CONFIG_8139TOO=y
460CONFIG_8139TOO_PIO=y
461# CONFIG_8139TOO_TUNE_TWISTER is not set
462# CONFIG_8139TOO_8129 is not set
463# CONFIG_8139_OLD_RX_RESET is not set
464# CONFIG_SIS900 is not set
465# CONFIG_EPIC100 is not set
466# CONFIG_SUNDANCE is not set
467# CONFIG_TLAN is not set
468# CONFIG_VIA_RHINE is not set
469# CONFIG_LAN_SAA9730 is not set
470 447
471# 448#
472# Ethernet (1000 Mbit) 449# Ethernet (1000 Mbit)
@@ -483,7 +460,6 @@ CONFIG_R8169=y
483# CONFIG_SKGE is not set 460# CONFIG_SKGE is not set
484# CONFIG_SKY2 is not set 461# CONFIG_SKY2 is not set
485# CONFIG_SK98LIN is not set 462# CONFIG_SK98LIN is not set
486# CONFIG_VIA_VELOCITY is not set
487# CONFIG_TIGON3 is not set 463# CONFIG_TIGON3 is not set
488# CONFIG_BNX2 is not set 464# CONFIG_BNX2 is not set
489 465
@@ -510,19 +486,8 @@ CONFIG_R8169=y
510# CONFIG_WAN is not set 486# CONFIG_WAN is not set
511# CONFIG_FDDI is not set 487# CONFIG_FDDI is not set
512# CONFIG_HIPPI is not set 488# CONFIG_HIPPI is not set
513CONFIG_PPP=m 489# CONFIG_PPP is not set
514CONFIG_PPP_MULTILINK=y 490# CONFIG_SLIP is not set
515CONFIG_PPP_FILTER=y
516CONFIG_PPP_ASYNC=m
517CONFIG_PPP_SYNC_TTY=m
518CONFIG_PPP_DEFLATE=m
519CONFIG_PPP_BSDCOMP=m
520CONFIG_PPP_MPPE=m
521CONFIG_PPPOE=m
522CONFIG_SLIP=m
523CONFIG_SLIP_COMPRESSED=y
524CONFIG_SLIP_SMART=y
525CONFIG_SLIP_MODE_SLIP6=y
526# CONFIG_SHAPER is not set 491# CONFIG_SHAPER is not set
527# CONFIG_NETCONSOLE is not set 492# CONFIG_NETCONSOLE is not set
528# CONFIG_NETPOLL is not set 493# CONFIG_NETPOLL is not set
@@ -583,6 +548,11 @@ CONFIG_HW_CONSOLE=y
583# 548#
584# Non-8250 serial port support 549# Non-8250 serial port support
585# 550#
551CONFIG_SERIAL_CORE=y
552CONFIG_SERIAL_CORE_CONSOLE=y
553CONFIG_SERIAL_VR41XX=y
554CONFIG_SERIAL_VR41XX_CONSOLE=y
555# CONFIG_SERIAL_JSM is not set
586CONFIG_UNIX98_PTYS=y 556CONFIG_UNIX98_PTYS=y
587CONFIG_LEGACY_PTYS=y 557CONFIG_LEGACY_PTYS=y
588CONFIG_LEGACY_PTY_COUNT=256 558CONFIG_LEGACY_PTY_COUNT=256
@@ -607,6 +577,7 @@ CONFIG_TANBAC_TB0219=y
607# Ftape, the floppy tape device driver 577# Ftape, the floppy tape device driver
608# 578#
609# CONFIG_DRM is not set 579# CONFIG_DRM is not set
580CONFIG_GPIO_VR41XX=y
610# CONFIG_RAW_DRIVER is not set 581# CONFIG_RAW_DRIVER is not set
611 582
612# 583#
@@ -642,10 +613,6 @@ CONFIG_TANBAC_TB0219=y
642# 613#
643 614
644# 615#
645# Multimedia Capabilities Port drivers
646#
647
648#
649# Multimedia devices 616# Multimedia devices
650# 617#
651# CONFIG_VIDEO_DEV is not set 618# CONFIG_VIDEO_DEV is not set
@@ -654,6 +621,7 @@ CONFIG_TANBAC_TB0219=y
654# Digital Video Broadcasting Devices 621# Digital Video Broadcasting Devices
655# 622#
656# CONFIG_DVB is not set 623# CONFIG_DVB is not set
624# CONFIG_USB_DABUSB is not set
657 625
658# 626#
659# Graphics support 627# Graphics support
@@ -676,6 +644,7 @@ CONFIG_DUMMY_CONSOLE=y
676# 644#
677CONFIG_USB_ARCH_HAS_HCD=y 645CONFIG_USB_ARCH_HAS_HCD=y
678CONFIG_USB_ARCH_HAS_OHCI=y 646CONFIG_USB_ARCH_HAS_OHCI=y
647CONFIG_USB_ARCH_HAS_EHCI=y
679CONFIG_USB=m 648CONFIG_USB=m
680# CONFIG_USB_DEBUG is not set 649# CONFIG_USB_DEBUG is not set
681 650
@@ -731,9 +700,7 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y
731# CONFIG_USB_ACECAD is not set 700# CONFIG_USB_ACECAD is not set
732# CONFIG_USB_KBTAB is not set 701# CONFIG_USB_KBTAB is not set
733# CONFIG_USB_POWERMATE is not set 702# CONFIG_USB_POWERMATE is not set
734# CONFIG_USB_MTOUCH is not set 703# CONFIG_USB_TOUCHSCREEN is not set
735# CONFIG_USB_ITMTOUCH is not set
736# CONFIG_USB_EGALAX is not set
737# CONFIG_USB_YEALINK is not set 704# CONFIG_USB_YEALINK is not set
738# CONFIG_USB_XPAD is not set 705# CONFIG_USB_XPAD is not set
739# CONFIG_USB_ATI_REMOTE is not set 706# CONFIG_USB_ATI_REMOTE is not set
@@ -747,15 +714,6 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y
747# CONFIG_USB_MDC800 is not set 714# CONFIG_USB_MDC800 is not set
748 715
749# 716#
750# USB Multimedia devices
751#
752# CONFIG_USB_DABUSB is not set
753
754#
755# Video4Linux support is needed for USB Multimedia device support
756#
757
758#
759# USB Network Adapters 717# USB Network Adapters
760# 718#
761# CONFIG_USB_CATC is not set 719# CONFIG_USB_CATC is not set
@@ -807,13 +765,48 @@ CONFIG_USB_MON=y
807# CONFIG_MMC is not set 765# CONFIG_MMC is not set
808 766
809# 767#
768# LED devices
769#
770# CONFIG_NEW_LEDS is not set
771
772#
773# LED drivers
774#
775
776#
777# LED Triggers
778#
779
780#
810# InfiniBand support 781# InfiniBand support
811# 782#
812# CONFIG_INFINIBAND is not set 783# CONFIG_INFINIBAND is not set
813 784
814# 785#
815# SN Devices 786# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
787#
788
789#
790# Real Time Clock
791#
792CONFIG_RTC_LIB=y
793CONFIG_RTC_CLASS=y
794CONFIG_RTC_HCTOSYS=y
795CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
796
797#
798# RTC interfaces
799#
800CONFIG_RTC_INTF_SYSFS=y
801CONFIG_RTC_INTF_PROC=y
802CONFIG_RTC_INTF_DEV=y
803
804#
805# RTC drivers
816# 806#
807# CONFIG_RTC_DRV_M48T86 is not set
808CONFIG_RTC_DRV_VR41XX=y
809# CONFIG_RTC_DRV_TEST is not set
817 810
818# 811#
819# File systems 812# File systems
@@ -821,32 +814,16 @@ CONFIG_USB_MON=y
821CONFIG_EXT2_FS=y 814CONFIG_EXT2_FS=y
822# CONFIG_EXT2_FS_XATTR is not set 815# CONFIG_EXT2_FS_XATTR is not set
823# CONFIG_EXT2_FS_XIP is not set 816# CONFIG_EXT2_FS_XIP is not set
824CONFIG_EXT3_FS=m 817# CONFIG_EXT3_FS is not set
825CONFIG_EXT3_FS_XATTR=y
826# CONFIG_EXT3_FS_POSIX_ACL is not set
827CONFIG_EXT3_FS_SECURITY=y
828CONFIG_JBD=m
829# CONFIG_JBD_DEBUG is not set
830CONFIG_FS_MBCACHE=y
831# CONFIG_REISERFS_FS is not set 818# CONFIG_REISERFS_FS is not set
832CONFIG_JFS_FS=m 819# CONFIG_JFS_FS is not set
833# CONFIG_JFS_POSIX_ACL is not set
834# CONFIG_JFS_SECURITY is not set
835# CONFIG_JFS_DEBUG is not set
836# CONFIG_JFS_STATISTICS is not set
837# CONFIG_FS_POSIX_ACL is not set 820# CONFIG_FS_POSIX_ACL is not set
838CONFIG_XFS_FS=y 821# CONFIG_XFS_FS is not set
839CONFIG_XFS_EXPORT=y
840CONFIG_XFS_QUOTA=y
841# CONFIG_XFS_SECURITY is not set
842CONFIG_XFS_POSIX_ACL=y
843# CONFIG_XFS_RT is not set
844# CONFIG_OCFS2_FS is not set 822# CONFIG_OCFS2_FS is not set
845# CONFIG_MINIX_FS is not set 823# CONFIG_MINIX_FS is not set
846CONFIG_ROMFS_FS=m 824CONFIG_ROMFS_FS=m
847CONFIG_INOTIFY=y 825CONFIG_INOTIFY=y
848# CONFIG_QUOTA is not set 826# CONFIG_QUOTA is not set
849CONFIG_QUOTACTL=y
850CONFIG_DNOTIFY=y 827CONFIG_DNOTIFY=y
851# CONFIG_AUTOFS_FS is not set 828# CONFIG_AUTOFS_FS is not set
852CONFIG_AUTOFS4_FS=y 829CONFIG_AUTOFS4_FS=y
@@ -855,20 +832,14 @@ CONFIG_FUSE_FS=m
855# 832#
856# CD-ROM/DVD Filesystems 833# CD-ROM/DVD Filesystems
857# 834#
858CONFIG_ISO9660_FS=y 835# CONFIG_ISO9660_FS is not set
859CONFIG_JOLIET=y
860CONFIG_ZISOFS=y
861CONFIG_ZISOFS_FS=y
862# CONFIG_UDF_FS is not set 836# CONFIG_UDF_FS is not set
863 837
864# 838#
865# DOS/FAT/NT Filesystems 839# DOS/FAT/NT Filesystems
866# 840#
867CONFIG_FAT_FS=m 841# CONFIG_MSDOS_FS is not set
868CONFIG_MSDOS_FS=m 842# CONFIG_VFAT_FS is not set
869CONFIG_VFAT_FS=m
870CONFIG_FAT_DEFAULT_CODEPAGE=437
871CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
872# CONFIG_NTFS_FS is not set 843# CONFIG_NTFS_FS is not set
873 844
874# 845#
@@ -880,7 +851,6 @@ CONFIG_SYSFS=y
880CONFIG_TMPFS=y 851CONFIG_TMPFS=y
881# CONFIG_HUGETLB_PAGE is not set 852# CONFIG_HUGETLB_PAGE is not set
882CONFIG_RAMFS=y 853CONFIG_RAMFS=y
883CONFIG_RELAYFS_FS=m
884# CONFIG_CONFIGFS_FS is not set 854# CONFIG_CONFIGFS_FS is not set
885 855
886# 856#
@@ -921,9 +891,7 @@ CONFIG_NFS_COMMON=y
921CONFIG_SUNRPC=y 891CONFIG_SUNRPC=y
922# CONFIG_RPCSEC_GSS_KRB5 is not set 892# CONFIG_RPCSEC_GSS_KRB5 is not set
923# CONFIG_RPCSEC_GSS_SPKM3 is not set 893# CONFIG_RPCSEC_GSS_SPKM3 is not set
924CONFIG_SMB_FS=m 894# CONFIG_SMB_FS is not set
925CONFIG_SMB_NLS_DEFAULT=y
926CONFIG_SMB_NLS_REMOTE="cp932"
927# CONFIG_CIFS is not set 895# CONFIG_CIFS is not set
928# CONFIG_NCP_FS is not set 896# CONFIG_NCP_FS is not set
929# CONFIG_CODA_FS is not set 897# CONFIG_CODA_FS is not set
@@ -939,46 +907,7 @@ CONFIG_MSDOS_PARTITION=y
939# 907#
940# Native Language Support 908# Native Language Support
941# 909#
942CONFIG_NLS=y 910# CONFIG_NLS is not set
943CONFIG_NLS_DEFAULT="iso8859-1"
944CONFIG_NLS_CODEPAGE_437=m
945# CONFIG_NLS_CODEPAGE_737 is not set
946# CONFIG_NLS_CODEPAGE_775 is not set
947# CONFIG_NLS_CODEPAGE_850 is not set
948# CONFIG_NLS_CODEPAGE_852 is not set
949# CONFIG_NLS_CODEPAGE_855 is not set
950# CONFIG_NLS_CODEPAGE_857 is not set
951# CONFIG_NLS_CODEPAGE_860 is not set
952# CONFIG_NLS_CODEPAGE_861 is not set
953# CONFIG_NLS_CODEPAGE_862 is not set
954# CONFIG_NLS_CODEPAGE_863 is not set
955# CONFIG_NLS_CODEPAGE_864 is not set
956# CONFIG_NLS_CODEPAGE_865 is not set
957# CONFIG_NLS_CODEPAGE_866 is not set
958# CONFIG_NLS_CODEPAGE_869 is not set
959# CONFIG_NLS_CODEPAGE_936 is not set
960# CONFIG_NLS_CODEPAGE_950 is not set
961CONFIG_NLS_CODEPAGE_932=m
962# CONFIG_NLS_CODEPAGE_949 is not set
963# CONFIG_NLS_CODEPAGE_874 is not set
964# CONFIG_NLS_ISO8859_8 is not set
965# CONFIG_NLS_CODEPAGE_1250 is not set
966# CONFIG_NLS_CODEPAGE_1251 is not set
967# CONFIG_NLS_ASCII is not set
968CONFIG_NLS_ISO8859_1=m
969# CONFIG_NLS_ISO8859_2 is not set
970# CONFIG_NLS_ISO8859_3 is not set
971# CONFIG_NLS_ISO8859_4 is not set
972# CONFIG_NLS_ISO8859_5 is not set
973# CONFIG_NLS_ISO8859_6 is not set
974# CONFIG_NLS_ISO8859_7 is not set
975# CONFIG_NLS_ISO8859_9 is not set
976# CONFIG_NLS_ISO8859_13 is not set
977# CONFIG_NLS_ISO8859_14 is not set
978# CONFIG_NLS_ISO8859_15 is not set
979# CONFIG_NLS_KOI8_R is not set
980# CONFIG_NLS_KOI8_U is not set
981# CONFIG_NLS_UTF8 is not set
982 911
983# 912#
984# Profiling support 913# Profiling support
@@ -992,44 +921,20 @@ CONFIG_NLS_ISO8859_1=m
992# CONFIG_MAGIC_SYSRQ is not set 921# CONFIG_MAGIC_SYSRQ is not set
993# CONFIG_DEBUG_KERNEL is not set 922# CONFIG_DEBUG_KERNEL is not set
994CONFIG_LOG_BUF_SHIFT=14 923CONFIG_LOG_BUF_SHIFT=14
924# CONFIG_DEBUG_FS is not set
995CONFIG_CROSSCOMPILE=y 925CONFIG_CROSSCOMPILE=y
996CONFIG_CMDLINE="mem=64M console=ttyVR0,115200 ip=any root=/dev/nfs" 926CONFIG_CMDLINE="mem=64M console=ttyVR0,115200 ip=any root=/dev/nfs"
997 927
998# 928#
999# Security options 929# Security options
1000# 930#
1001CONFIG_KEYS=y 931# CONFIG_KEYS is not set
1002CONFIG_KEYS_DEBUG_PROC_KEYS=y
1003# CONFIG_SECURITY is not set 932# CONFIG_SECURITY is not set
1004 933
1005# 934#
1006# Cryptographic options 935# Cryptographic options
1007# 936#
1008CONFIG_CRYPTO=y 937# CONFIG_CRYPTO is not set
1009CONFIG_CRYPTO_HMAC=y
1010CONFIG_CRYPTO_NULL=m
1011CONFIG_CRYPTO_MD4=m
1012CONFIG_CRYPTO_MD5=m
1013CONFIG_CRYPTO_SHA1=m
1014CONFIG_CRYPTO_SHA256=m
1015CONFIG_CRYPTO_SHA512=m
1016CONFIG_CRYPTO_WP512=m
1017CONFIG_CRYPTO_TGR192=m
1018CONFIG_CRYPTO_DES=m
1019CONFIG_CRYPTO_BLOWFISH=m
1020CONFIG_CRYPTO_TWOFISH=m
1021CONFIG_CRYPTO_SERPENT=m
1022CONFIG_CRYPTO_AES=m
1023CONFIG_CRYPTO_CAST5=m
1024CONFIG_CRYPTO_CAST6=m
1025CONFIG_CRYPTO_TEA=m
1026CONFIG_CRYPTO_ARC4=m
1027CONFIG_CRYPTO_KHAZAD=m
1028CONFIG_CRYPTO_ANUBIS=m
1029CONFIG_CRYPTO_DEFLATE=m
1030CONFIG_CRYPTO_MICHAEL_MIC=m
1031CONFIG_CRYPTO_CRC32C=m
1032# CONFIG_CRYPTO_TEST is not set
1033 938
1034# 939#
1035# Hardware crypto devices 940# Hardware crypto devices
@@ -1038,9 +943,8 @@ CONFIG_CRYPTO_CRC32C=m
1038# 943#
1039# Library routines 944# Library routines
1040# 945#
1041CONFIG_CRC_CCITT=m 946# CONFIG_CRC_CCITT is not set
1042CONFIG_CRC16=m 947# CONFIG_CRC16 is not set
1043CONFIG_CRC32=y 948CONFIG_CRC32=y
1044CONFIG_LIBCRC32C=m 949# CONFIG_LIBCRC32C is not set
1045CONFIG_ZLIB_INFLATE=y 950CONFIG_ZLIB_INFLATE=m
1046CONFIG_ZLIB_DEFLATE=m
diff --git a/arch/mips/configs/tb0287_defconfig b/arch/mips/configs/tb0287_defconfig
new file mode 100644
index 000000000000..9f215ea350dc
--- /dev/null
+++ b/arch/mips/configs/tb0287_defconfig
@@ -0,0 +1,1132 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-rc2
4# Tue Apr 25 00:09:17 2006
5#
6CONFIG_MIPS=y
7
8#
9# Machine selection
10#
11# CONFIG_MIPS_MTX1 is not set
12# CONFIG_MIPS_BOSPORUS is not set
13# CONFIG_MIPS_PB1000 is not set
14# CONFIG_MIPS_PB1100 is not set
15# CONFIG_MIPS_PB1500 is not set
16# CONFIG_MIPS_PB1550 is not set
17# CONFIG_MIPS_PB1200 is not set
18# CONFIG_MIPS_DB1000 is not set
19# CONFIG_MIPS_DB1100 is not set
20# CONFIG_MIPS_DB1500 is not set
21# CONFIG_MIPS_DB1550 is not set
22# CONFIG_MIPS_DB1200 is not set
23# CONFIG_MIPS_MIRAGE is not set
24# CONFIG_MIPS_COBALT is not set
25# CONFIG_MACH_DECSTATION is not set
26# CONFIG_MIPS_EV64120 is not set
27# CONFIG_MIPS_EV96100 is not set
28# CONFIG_MIPS_IVR is not set
29# CONFIG_MIPS_ITE8172 is not set
30# CONFIG_MACH_JAZZ is not set
31# CONFIG_LASAT is not set
32# CONFIG_MIPS_ATLAS is not set
33# CONFIG_MIPS_MALTA is not set
34# CONFIG_MIPS_SEAD is not set
35# CONFIG_MIPS_SIM is not set
36# CONFIG_MOMENCO_JAGUAR_ATX is not set
37# CONFIG_MOMENCO_OCELOT is not set
38# CONFIG_MOMENCO_OCELOT_3 is not set
39# CONFIG_MOMENCO_OCELOT_C is not set
40# CONFIG_MOMENCO_OCELOT_G is not set
41# CONFIG_MIPS_XXS1500 is not set
42# CONFIG_PNX8550_V2PCI is not set
43# CONFIG_PNX8550_JBS is not set
44# CONFIG_DDB5074 is not set
45# CONFIG_DDB5476 is not set
46# CONFIG_DDB5477 is not set
47CONFIG_MACH_VR41XX=y
48# CONFIG_PMC_YOSEMITE is not set
49# CONFIG_QEMU is not set
50# CONFIG_SGI_IP22 is not set
51# CONFIG_SGI_IP27 is not set
52# CONFIG_SGI_IP32 is not set
53# CONFIG_SIBYTE_BIGSUR is not set
54# CONFIG_SIBYTE_SWARM is not set
55# CONFIG_SIBYTE_SENTOSA is not set
56# CONFIG_SIBYTE_RHONE is not set
57# CONFIG_SIBYTE_CARMEL is not set
58# CONFIG_SIBYTE_PTSWARM is not set
59# CONFIG_SIBYTE_LITTLESUR is not set
60# CONFIG_SIBYTE_CRHINE is not set
61# CONFIG_SIBYTE_CRHONE is not set
62# CONFIG_SNI_RM200_PCI is not set
63# CONFIG_TOSHIBA_JMR3927 is not set
64# CONFIG_TOSHIBA_RBTX4927 is not set
65# CONFIG_TOSHIBA_RBTX4938 is not set
66# CONFIG_CASIO_E55 is not set
67# CONFIG_IBM_WORKPAD is not set
68# CONFIG_NEC_CMBVR4133 is not set
69CONFIG_TANBAC_TB022X=y
70# CONFIG_TANBAC_TB0226 is not set
71CONFIG_TANBAC_TB0287=y
72# CONFIG_VICTOR_MPC30X is not set
73# CONFIG_ZAO_CAPCELLA is not set
74CONFIG_PCI_VR41XX=y
75# CONFIG_VRC4173 is not set
76CONFIG_RWSEM_GENERIC_SPINLOCK=y
77CONFIG_GENERIC_FIND_NEXT_BIT=y
78CONFIG_GENERIC_HWEIGHT=y
79CONFIG_GENERIC_CALIBRATE_DELAY=y
80CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
81CONFIG_DMA_NONCOHERENT=y
82CONFIG_DMA_NEED_PCI_MAP_STATE=y
83# CONFIG_CPU_BIG_ENDIAN is not set
84CONFIG_CPU_LITTLE_ENDIAN=y
85CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
86CONFIG_IRQ_CPU=y
87CONFIG_MIPS_L1_CACHE_SHIFT=5
88
89#
90# CPU selection
91#
92# CONFIG_CPU_MIPS32_R1 is not set
93# CONFIG_CPU_MIPS32_R2 is not set
94# CONFIG_CPU_MIPS64_R1 is not set
95# CONFIG_CPU_MIPS64_R2 is not set
96# CONFIG_CPU_R3000 is not set
97# CONFIG_CPU_TX39XX is not set
98CONFIG_CPU_VR41XX=y
99# CONFIG_CPU_R4300 is not set
100# CONFIG_CPU_R4X00 is not set
101# CONFIG_CPU_TX49XX is not set
102# CONFIG_CPU_R5000 is not set
103# CONFIG_CPU_R5432 is not set
104# CONFIG_CPU_R6000 is not set
105# CONFIG_CPU_NEVADA is not set
106# CONFIG_CPU_R8000 is not set
107# CONFIG_CPU_R10000 is not set
108# CONFIG_CPU_RM7000 is not set
109# CONFIG_CPU_RM9000 is not set
110# CONFIG_CPU_SB1 is not set
111CONFIG_SYS_HAS_CPU_VR41XX=y
112CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
113CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
114CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
115
116#
117# Kernel type
118#
119CONFIG_32BIT=y
120# CONFIG_64BIT is not set
121CONFIG_PAGE_SIZE_4KB=y
122# CONFIG_PAGE_SIZE_8KB is not set
123# CONFIG_PAGE_SIZE_16KB is not set
124# CONFIG_PAGE_SIZE_64KB is not set
125# CONFIG_MIPS_MT is not set
126CONFIG_CPU_HAS_SYNC=y
127CONFIG_GENERIC_HARDIRQS=y
128CONFIG_GENERIC_IRQ_PROBE=y
129CONFIG_ARCH_FLATMEM_ENABLE=y
130CONFIG_SELECT_MEMORY_MODEL=y
131CONFIG_FLATMEM_MANUAL=y
132# CONFIG_DISCONTIGMEM_MANUAL is not set
133# CONFIG_SPARSEMEM_MANUAL is not set
134CONFIG_FLATMEM=y
135CONFIG_FLAT_NODE_MEM_MAP=y
136# CONFIG_SPARSEMEM_STATIC is not set
137CONFIG_SPLIT_PTLOCK_CPUS=4
138CONFIG_PREEMPT_NONE=y
139# CONFIG_PREEMPT_VOLUNTARY is not set
140# CONFIG_PREEMPT is not set
141
142#
143# Code maturity level options
144#
145CONFIG_EXPERIMENTAL=y
146CONFIG_BROKEN_ON_SMP=y
147CONFIG_INIT_ENV_ARG_LIMIT=32
148
149#
150# General setup
151#
152CONFIG_LOCALVERSION=""
153CONFIG_LOCALVERSION_AUTO=y
154CONFIG_SWAP=y
155CONFIG_SYSVIPC=y
156# CONFIG_POSIX_MQUEUE is not set
157# CONFIG_BSD_PROCESS_ACCT is not set
158CONFIG_SYSCTL=y
159# CONFIG_AUDIT is not set
160# CONFIG_IKCONFIG is not set
161# CONFIG_RELAY is not set
162CONFIG_INITRAMFS_SOURCE=""
163# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
164CONFIG_EMBEDDED=y
165CONFIG_KALLSYMS=y
166# CONFIG_KALLSYMS_EXTRA_PASS is not set
167# CONFIG_HOTPLUG is not set
168CONFIG_PRINTK=y
169CONFIG_BUG=y
170CONFIG_ELF_CORE=y
171CONFIG_BASE_FULL=y
172CONFIG_FUTEX=y
173CONFIG_EPOLL=y
174CONFIG_SHMEM=y
175CONFIG_SLAB=y
176# CONFIG_TINY_SHMEM is not set
177CONFIG_BASE_SMALL=0
178# CONFIG_SLOB is not set
179
180#
181# Loadable module support
182#
183CONFIG_MODULES=y
184CONFIG_MODULE_UNLOAD=y
185# CONFIG_MODULE_FORCE_UNLOAD is not set
186CONFIG_MODVERSIONS=y
187CONFIG_MODULE_SRCVERSION_ALL=y
188CONFIG_KMOD=y
189
190#
191# Block layer
192#
193# CONFIG_LBD is not set
194# CONFIG_BLK_DEV_IO_TRACE is not set
195# CONFIG_LSF is not set
196
197#
198# IO Schedulers
199#
200CONFIG_IOSCHED_NOOP=y
201CONFIG_IOSCHED_AS=y
202CONFIG_IOSCHED_DEADLINE=y
203CONFIG_IOSCHED_CFQ=y
204CONFIG_DEFAULT_AS=y
205# CONFIG_DEFAULT_DEADLINE is not set
206# CONFIG_DEFAULT_CFQ is not set
207# CONFIG_DEFAULT_NOOP is not set
208CONFIG_DEFAULT_IOSCHED="anticipatory"
209
210#
211# Bus options (PCI, PCMCIA, EISA, ISA, TC)
212#
213CONFIG_HW_HAS_PCI=y
214CONFIG_PCI=y
215CONFIG_MMU=y
216
217#
218# PCCARD (PCMCIA/CardBus) support
219#
220# CONFIG_PCCARD is not set
221
222#
223# PCI Hotplug Support
224#
225# CONFIG_HOTPLUG_PCI is not set
226
227#
228# Executable file formats
229#
230CONFIG_BINFMT_ELF=y
231# CONFIG_BINFMT_MISC is not set
232CONFIG_TRAD_SIGNALS=y
233
234#
235# Networking
236#
237CONFIG_NET=y
238
239#
240# Networking options
241#
242# CONFIG_NETDEBUG is not set
243CONFIG_PACKET=y
244# CONFIG_PACKET_MMAP is not set
245CONFIG_UNIX=y
246# CONFIG_NET_KEY is not set
247CONFIG_INET=y
248CONFIG_IP_MULTICAST=y
249CONFIG_IP_ADVANCED_ROUTER=y
250CONFIG_ASK_IP_FIB_HASH=y
251# CONFIG_IP_FIB_TRIE is not set
252CONFIG_IP_FIB_HASH=y
253CONFIG_IP_MULTIPLE_TABLES=y
254CONFIG_IP_ROUTE_MULTIPATH=y
255# CONFIG_IP_ROUTE_MULTIPATH_CACHED is not set
256CONFIG_IP_ROUTE_VERBOSE=y
257CONFIG_IP_PNP=y
258# CONFIG_IP_PNP_DHCP is not set
259CONFIG_IP_PNP_BOOTP=y
260# CONFIG_IP_PNP_RARP is not set
261CONFIG_NET_IPIP=m
262CONFIG_NET_IPGRE=m
263# CONFIG_NET_IPGRE_BROADCAST is not set
264# CONFIG_IP_MROUTE is not set
265# CONFIG_ARPD is not set
266CONFIG_SYN_COOKIES=y
267# CONFIG_INET_AH is not set
268# CONFIG_INET_ESP is not set
269# CONFIG_INET_IPCOMP is not set
270# CONFIG_INET_XFRM_TUNNEL is not set
271CONFIG_INET_TUNNEL=m
272CONFIG_INET_DIAG=y
273CONFIG_INET_TCP_DIAG=y
274CONFIG_TCP_CONG_ADVANCED=y
275
276#
277# TCP congestion control
278#
279CONFIG_TCP_CONG_BIC=y
280CONFIG_TCP_CONG_CUBIC=m
281CONFIG_TCP_CONG_WESTWOOD=m
282CONFIG_TCP_CONG_HTCP=m
283# CONFIG_TCP_CONG_HSTCP is not set
284# CONFIG_TCP_CONG_HYBLA is not set
285# CONFIG_TCP_CONG_VEGAS is not set
286# CONFIG_TCP_CONG_SCALABLE is not set
287# CONFIG_IPV6 is not set
288# CONFIG_INET6_XFRM_TUNNEL is not set
289# CONFIG_INET6_TUNNEL is not set
290# CONFIG_NETFILTER is not set
291
292#
293# DCCP Configuration (EXPERIMENTAL)
294#
295# CONFIG_IP_DCCP is not set
296
297#
298# SCTP Configuration (EXPERIMENTAL)
299#
300# CONFIG_IP_SCTP is not set
301
302#
303# TIPC Configuration (EXPERIMENTAL)
304#
305# CONFIG_TIPC is not set
306# CONFIG_ATM is not set
307# CONFIG_BRIDGE is not set
308# CONFIG_VLAN_8021Q is not set
309# CONFIG_DECNET is not set
310# CONFIG_LLC2 is not set
311# CONFIG_IPX is not set
312# CONFIG_ATALK is not set
313# CONFIG_X25 is not set
314# CONFIG_LAPB is not set
315# CONFIG_NET_DIVERT is not set
316# CONFIG_ECONET is not set
317# CONFIG_WAN_ROUTER is not set
318
319#
320# QoS and/or fair queueing
321#
322# CONFIG_NET_SCHED is not set
323
324#
325# Network testing
326#
327# CONFIG_NET_PKTGEN is not set
328# CONFIG_HAMRADIO is not set
329# CONFIG_IRDA is not set
330# CONFIG_BT is not set
331# CONFIG_IEEE80211 is not set
332
333#
334# Device Drivers
335#
336
337#
338# Generic Driver Options
339#
340CONFIG_STANDALONE=y
341CONFIG_PREVENT_FIRMWARE_BUILD=y
342# CONFIG_FW_LOADER is not set
343
344#
345# Connector - unified userspace <-> kernelspace linker
346#
347# CONFIG_CONNECTOR is not set
348
349#
350# Memory Technology Devices (MTD)
351#
352# CONFIG_MTD is not set
353
354#
355# Parallel port support
356#
357# CONFIG_PARPORT is not set
358
359#
360# Plug and Play support
361#
362
363#
364# Block devices
365#
366# CONFIG_BLK_CPQ_DA is not set
367# CONFIG_BLK_CPQ_CISS_DA is not set
368# CONFIG_BLK_DEV_DAC960 is not set
369# CONFIG_BLK_DEV_UMEM is not set
370# CONFIG_BLK_DEV_COW_COMMON is not set
371CONFIG_BLK_DEV_LOOP=m
372# CONFIG_BLK_DEV_CRYPTOLOOP is not set
373CONFIG_BLK_DEV_NBD=m
374# CONFIG_BLK_DEV_SX8 is not set
375# CONFIG_BLK_DEV_UB is not set
376CONFIG_BLK_DEV_RAM=y
377CONFIG_BLK_DEV_RAM_COUNT=16
378CONFIG_BLK_DEV_RAM_SIZE=4096
379# CONFIG_BLK_DEV_INITRD is not set
380# CONFIG_CDROM_PKTCDVD is not set
381# CONFIG_ATA_OVER_ETH is not set
382
383#
384# ATA/ATAPI/MFM/RLL support
385#
386CONFIG_IDE=y
387CONFIG_BLK_DEV_IDE=y
388
389#
390# Please see Documentation/ide.txt for help/info on IDE drives
391#
392# CONFIG_BLK_DEV_IDE_SATA is not set
393CONFIG_BLK_DEV_IDEDISK=y
394# CONFIG_IDEDISK_MULTI_MODE is not set
395# CONFIG_BLK_DEV_IDECD is not set
396# CONFIG_BLK_DEV_IDETAPE is not set
397# CONFIG_BLK_DEV_IDEFLOPPY is not set
398# CONFIG_BLK_DEV_IDESCSI is not set
399# CONFIG_IDE_TASK_IOCTL is not set
400
401#
402# IDE chipset support/bugfixes
403#
404CONFIG_IDE_GENERIC=y
405CONFIG_BLK_DEV_IDEPCI=y
406# CONFIG_IDEPCI_SHARE_IRQ is not set
407# CONFIG_BLK_DEV_OFFBOARD is not set
408# CONFIG_BLK_DEV_GENERIC is not set
409# CONFIG_BLK_DEV_OPTI621 is not set
410CONFIG_BLK_DEV_IDEDMA_PCI=y
411# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
412# CONFIG_IDEDMA_PCI_AUTO is not set
413# CONFIG_BLK_DEV_AEC62XX is not set
414# CONFIG_BLK_DEV_ALI15X3 is not set
415# CONFIG_BLK_DEV_AMD74XX is not set
416# CONFIG_BLK_DEV_CMD64X is not set
417# CONFIG_BLK_DEV_TRIFLEX is not set
418# CONFIG_BLK_DEV_CY82C693 is not set
419# CONFIG_BLK_DEV_CS5520 is not set
420# CONFIG_BLK_DEV_CS5530 is not set
421# CONFIG_BLK_DEV_HPT34X is not set
422# CONFIG_BLK_DEV_HPT366 is not set
423# CONFIG_BLK_DEV_SC1200 is not set
424# CONFIG_BLK_DEV_PIIX is not set
425# CONFIG_BLK_DEV_IT821X is not set
426# CONFIG_BLK_DEV_NS87415 is not set
427# CONFIG_BLK_DEV_PDC202XX_OLD is not set
428# CONFIG_BLK_DEV_PDC202XX_NEW is not set
429# CONFIG_BLK_DEV_SVWKS is not set
430CONFIG_BLK_DEV_SIIMAGE=y
431# CONFIG_BLK_DEV_SLC90E66 is not set
432# CONFIG_BLK_DEV_TRM290 is not set
433# CONFIG_BLK_DEV_VIA82CXXX is not set
434# CONFIG_IDE_ARM is not set
435CONFIG_BLK_DEV_IDEDMA=y
436# CONFIG_IDEDMA_IVB is not set
437# CONFIG_IDEDMA_AUTO is not set
438# CONFIG_BLK_DEV_HD is not set
439
440#
441# SCSI device support
442#
443# CONFIG_RAID_ATTRS is not set
444CONFIG_SCSI=y
445CONFIG_SCSI_PROC_FS=y
446
447#
448# SCSI support type (disk, tape, CD-ROM)
449#
450CONFIG_BLK_DEV_SD=y
451# CONFIG_CHR_DEV_ST is not set
452# CONFIG_CHR_DEV_OSST is not set
453# CONFIG_BLK_DEV_SR is not set
454# CONFIG_CHR_DEV_SG is not set
455# CONFIG_CHR_DEV_SCH is not set
456
457#
458# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
459#
460# CONFIG_SCSI_MULTI_LUN is not set
461# CONFIG_SCSI_CONSTANTS is not set
462# CONFIG_SCSI_LOGGING is not set
463
464#
465# SCSI Transport Attributes
466#
467# CONFIG_SCSI_SPI_ATTRS is not set
468# CONFIG_SCSI_FC_ATTRS is not set
469# CONFIG_SCSI_ISCSI_ATTRS is not set
470# CONFIG_SCSI_SAS_ATTRS is not set
471
472#
473# SCSI low-level drivers
474#
475# CONFIG_ISCSI_TCP is not set
476# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
477# CONFIG_SCSI_3W_9XXX is not set
478# CONFIG_SCSI_ACARD is not set
479# CONFIG_SCSI_AACRAID is not set
480# CONFIG_SCSI_AIC7XXX is not set
481# CONFIG_SCSI_AIC7XXX_OLD is not set
482# CONFIG_SCSI_AIC79XX is not set
483# CONFIG_SCSI_DPT_I2O is not set
484# CONFIG_MEGARAID_NEWGEN is not set
485# CONFIG_MEGARAID_LEGACY is not set
486# CONFIG_MEGARAID_SAS is not set
487# CONFIG_SCSI_SATA is not set
488# CONFIG_SCSI_DMX3191D is not set
489# CONFIG_SCSI_FUTURE_DOMAIN is not set
490# CONFIG_SCSI_IPS is not set
491# CONFIG_SCSI_INITIO is not set
492# CONFIG_SCSI_INIA100 is not set
493# CONFIG_SCSI_SYM53C8XX_2 is not set
494# CONFIG_SCSI_IPR is not set
495# CONFIG_SCSI_QLOGIC_1280 is not set
496# CONFIG_SCSI_QLA_FC is not set
497# CONFIG_SCSI_LPFC is not set
498# CONFIG_SCSI_DC395x is not set
499# CONFIG_SCSI_DC390T is not set
500# CONFIG_SCSI_NSP32 is not set
501# CONFIG_SCSI_DEBUG is not set
502
503#
504# Multi-device support (RAID and LVM)
505#
506# CONFIG_MD is not set
507
508#
509# Fusion MPT device support
510#
511# CONFIG_FUSION is not set
512# CONFIG_FUSION_SPI is not set
513# CONFIG_FUSION_FC is not set
514# CONFIG_FUSION_SAS is not set
515
516#
517# IEEE 1394 (FireWire) support
518#
519CONFIG_IEEE1394=m
520
521#
522# Subsystem Options
523#
524# CONFIG_IEEE1394_VERBOSEDEBUG is not set
525# CONFIG_IEEE1394_OUI_DB is not set
526CONFIG_IEEE1394_EXTRA_CONFIG_ROMS=y
527CONFIG_IEEE1394_CONFIG_ROM_IP1394=y
528# CONFIG_IEEE1394_EXPORT_FULL_API is not set
529
530#
531# Device Drivers
532#
533
534#
535# Texas Instruments PCILynx requires I2C
536#
537CONFIG_IEEE1394_OHCI1394=m
538
539#
540# Protocol Drivers
541#
542CONFIG_IEEE1394_VIDEO1394=m
543CONFIG_IEEE1394_SBP2=m
544# CONFIG_IEEE1394_SBP2_PHYS_DMA is not set
545CONFIG_IEEE1394_ETH1394=m
546CONFIG_IEEE1394_DV1394=m
547CONFIG_IEEE1394_RAWIO=m
548
549#
550# I2O device support
551#
552# CONFIG_I2O is not set
553
554#
555# Network device support
556#
557CONFIG_NETDEVICES=y
558CONFIG_DUMMY=m
559# CONFIG_BONDING is not set
560# CONFIG_EQUALIZER is not set
561# CONFIG_TUN is not set
562
563#
564# ARCnet devices
565#
566# CONFIG_ARCNET is not set
567
568#
569# PHY device support
570#
571# CONFIG_PHYLIB is not set
572
573#
574# Ethernet (10 or 100Mbit)
575#
576CONFIG_NET_ETHERNET=y
577CONFIG_MII=y
578# CONFIG_HAPPYMEAL is not set
579# CONFIG_SUNGEM is not set
580# CONFIG_CASSINI is not set
581# CONFIG_NET_VENDOR_3COM is not set
582# CONFIG_DM9000 is not set
583
584#
585# Tulip family network device support
586#
587# CONFIG_NET_TULIP is not set
588# CONFIG_HP100 is not set
589# CONFIG_NET_PCI is not set
590
591#
592# Ethernet (1000 Mbit)
593#
594# CONFIG_ACENIC is not set
595# CONFIG_DL2K is not set
596# CONFIG_E1000 is not set
597# CONFIG_NS83820 is not set
598# CONFIG_HAMACHI is not set
599# CONFIG_YELLOWFIN is not set
600CONFIG_R8169=y
601# CONFIG_R8169_NAPI is not set
602# CONFIG_SIS190 is not set
603# CONFIG_SKGE is not set
604# CONFIG_SKY2 is not set
605# CONFIG_SK98LIN is not set
606# CONFIG_TIGON3 is not set
607# CONFIG_BNX2 is not set
608
609#
610# Ethernet (10000 Mbit)
611#
612# CONFIG_CHELSIO_T1 is not set
613# CONFIG_IXGB is not set
614# CONFIG_S2IO is not set
615
616#
617# Token Ring devices
618#
619# CONFIG_TR is not set
620
621#
622# Wireless LAN (non-hamradio)
623#
624# CONFIG_NET_RADIO is not set
625
626#
627# Wan interfaces
628#
629# CONFIG_WAN is not set
630# CONFIG_FDDI is not set
631# CONFIG_HIPPI is not set
632# CONFIG_PPP is not set
633# CONFIG_SLIP is not set
634# CONFIG_NET_FC is not set
635# CONFIG_SHAPER is not set
636# CONFIG_NETCONSOLE is not set
637# CONFIG_NETPOLL is not set
638# CONFIG_NET_POLL_CONTROLLER is not set
639
640#
641# ISDN subsystem
642#
643# CONFIG_ISDN is not set
644
645#
646# Telephony Support
647#
648# CONFIG_PHONE is not set
649
650#
651# Input device support
652#
653CONFIG_INPUT=y
654
655#
656# Userland interfaces
657#
658# CONFIG_INPUT_MOUSEDEV is not set
659# CONFIG_INPUT_JOYDEV is not set
660# CONFIG_INPUT_TSDEV is not set
661# CONFIG_INPUT_EVDEV is not set
662# CONFIG_INPUT_EVBUG is not set
663
664#
665# Input Device Drivers
666#
667# CONFIG_INPUT_KEYBOARD is not set
668# CONFIG_INPUT_MOUSE is not set
669# CONFIG_INPUT_JOYSTICK is not set
670# CONFIG_INPUT_TOUCHSCREEN is not set
671# CONFIG_INPUT_MISC is not set
672
673#
674# Hardware I/O ports
675#
676# CONFIG_SERIO is not set
677# CONFIG_GAMEPORT is not set
678
679#
680# Character devices
681#
682CONFIG_VT=y
683CONFIG_VT_CONSOLE=y
684CONFIG_HW_CONSOLE=y
685# CONFIG_SERIAL_NONSTANDARD is not set
686
687#
688# Serial drivers
689#
690# CONFIG_SERIAL_8250 is not set
691
692#
693# Non-8250 serial port support
694#
695CONFIG_SERIAL_CORE=y
696CONFIG_SERIAL_CORE_CONSOLE=y
697CONFIG_SERIAL_VR41XX=y
698CONFIG_SERIAL_VR41XX_CONSOLE=y
699# CONFIG_SERIAL_JSM is not set
700CONFIG_UNIX98_PTYS=y
701CONFIG_LEGACY_PTYS=y
702CONFIG_LEGACY_PTY_COUNT=256
703
704#
705# IPMI
706#
707# CONFIG_IPMI_HANDLER is not set
708
709#
710# Watchdog Cards
711#
712# CONFIG_WATCHDOG is not set
713# CONFIG_RTC is not set
714# CONFIG_GEN_RTC is not set
715# CONFIG_DTLK is not set
716# CONFIG_R3964 is not set
717# CONFIG_APPLICOM is not set
718# CONFIG_TANBAC_TB0219 is not set
719
720#
721# Ftape, the floppy tape device driver
722#
723# CONFIG_DRM is not set
724CONFIG_GPIO_VR41XX=y
725# CONFIG_RAW_DRIVER is not set
726
727#
728# TPM devices
729#
730# CONFIG_TCG_TPM is not set
731# CONFIG_TELCLOCK is not set
732
733#
734# I2C support
735#
736# CONFIG_I2C is not set
737
738#
739# SPI support
740#
741# CONFIG_SPI is not set
742# CONFIG_SPI_MASTER is not set
743
744#
745# Dallas's 1-wire bus
746#
747# CONFIG_W1 is not set
748
749#
750# Hardware Monitoring support
751#
752# CONFIG_HWMON is not set
753# CONFIG_HWMON_VID is not set
754
755#
756# Misc devices
757#
758
759#
760# Multimedia devices
761#
762# CONFIG_VIDEO_DEV is not set
763
764#
765# Digital Video Broadcasting Devices
766#
767# CONFIG_DVB is not set
768# CONFIG_USB_DABUSB is not set
769
770#
771# Graphics support
772#
773CONFIG_FB=y
774CONFIG_FB_CFB_FILLRECT=y
775CONFIG_FB_CFB_COPYAREA=y
776CONFIG_FB_CFB_IMAGEBLIT=y
777# CONFIG_FB_MACMODES is not set
778CONFIG_FB_FIRMWARE_EDID=y
779# CONFIG_FB_MODE_HELPERS is not set
780# CONFIG_FB_TILEBLITTING is not set
781# CONFIG_FB_CIRRUS is not set
782# CONFIG_FB_PM2 is not set
783# CONFIG_FB_CYBER2000 is not set
784# CONFIG_FB_ASILIANT is not set
785# CONFIG_FB_IMSTT is not set
786# CONFIG_FB_S1D13XXX is not set
787# CONFIG_FB_NVIDIA is not set
788# CONFIG_FB_RIVA is not set
789# CONFIG_FB_MATROX is not set
790# CONFIG_FB_RADEON is not set
791# CONFIG_FB_ATY128 is not set
792# CONFIG_FB_ATY is not set
793# CONFIG_FB_SAVAGE is not set
794# CONFIG_FB_SIS is not set
795# CONFIG_FB_NEOMAGIC is not set
796# CONFIG_FB_KYRO is not set
797# CONFIG_FB_3DFX is not set
798# CONFIG_FB_VOODOO1 is not set
799CONFIG_FB_SMIVGX=y
800# CONFIG_FB_TRIDENT is not set
801# CONFIG_FB_VIRTUAL is not set
802
803#
804# Console display driver support
805#
806# CONFIG_VGA_CONSOLE is not set
807CONFIG_DUMMY_CONSOLE=y
808# CONFIG_FRAMEBUFFER_CONSOLE is not set
809
810#
811# Logo configuration
812#
813# CONFIG_LOGO is not set
814# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
815
816#
817# Sound
818#
819# CONFIG_SOUND is not set
820
821#
822# USB support
823#
824CONFIG_USB_ARCH_HAS_HCD=y
825CONFIG_USB_ARCH_HAS_OHCI=y
826CONFIG_USB_ARCH_HAS_EHCI=y
827CONFIG_USB=m
828# CONFIG_USB_DEBUG is not set
829
830#
831# Miscellaneous USB options
832#
833# CONFIG_USB_DEVICEFS is not set
834# CONFIG_USB_BANDWIDTH is not set
835# CONFIG_USB_DYNAMIC_MINORS is not set
836# CONFIG_USB_OTG is not set
837
838#
839# USB Host Controller Drivers
840#
841CONFIG_USB_EHCI_HCD=m
842# CONFIG_USB_EHCI_SPLIT_ISO is not set
843# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
844# CONFIG_USB_ISP116X_HCD is not set
845CONFIG_USB_OHCI_HCD=m
846# CONFIG_USB_OHCI_BIG_ENDIAN is not set
847CONFIG_USB_OHCI_LITTLE_ENDIAN=y
848# CONFIG_USB_UHCI_HCD is not set
849# CONFIG_USB_SL811_HCD is not set
850
851#
852# USB Device Class drivers
853#
854# CONFIG_USB_ACM is not set
855# CONFIG_USB_PRINTER is not set
856
857#
858# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
859#
860
861#
862# may also be needed; see USB_STORAGE Help for more information
863#
864CONFIG_USB_STORAGE=m
865# CONFIG_USB_STORAGE_DEBUG is not set
866# CONFIG_USB_STORAGE_DATAFAB is not set
867# CONFIG_USB_STORAGE_FREECOM is not set
868# CONFIG_USB_STORAGE_ISD200 is not set
869# CONFIG_USB_STORAGE_DPCM is not set
870# CONFIG_USB_STORAGE_USBAT is not set
871# CONFIG_USB_STORAGE_SDDR09 is not set
872# CONFIG_USB_STORAGE_SDDR55 is not set
873# CONFIG_USB_STORAGE_JUMPSHOT is not set
874# CONFIG_USB_STORAGE_ALAUDA is not set
875# CONFIG_USB_LIBUSUAL is not set
876
877#
878# USB Input Devices
879#
880CONFIG_USB_HID=m
881CONFIG_USB_HIDINPUT=y
882# CONFIG_USB_HIDINPUT_POWERBOOK is not set
883# CONFIG_HID_FF is not set
884# CONFIG_USB_HIDDEV is not set
885
886#
887# USB HID Boot Protocol drivers
888#
889# CONFIG_USB_KBD is not set
890# CONFIG_USB_MOUSE is not set
891# CONFIG_USB_AIPTEK is not set
892# CONFIG_USB_WACOM is not set
893# CONFIG_USB_ACECAD is not set
894# CONFIG_USB_KBTAB is not set
895# CONFIG_USB_POWERMATE is not set
896# CONFIG_USB_TOUCHSCREEN is not set
897# CONFIG_USB_YEALINK is not set
898# CONFIG_USB_XPAD is not set
899# CONFIG_USB_ATI_REMOTE is not set
900# CONFIG_USB_ATI_REMOTE2 is not set
901# CONFIG_USB_KEYSPAN_REMOTE is not set
902# CONFIG_USB_APPLETOUCH is not set
903
904#
905# USB Imaging devices
906#
907# CONFIG_USB_MDC800 is not set
908# CONFIG_USB_MICROTEK is not set
909
910#
911# USB Network Adapters
912#
913# CONFIG_USB_CATC is not set
914# CONFIG_USB_KAWETH is not set
915# CONFIG_USB_PEGASUS is not set
916# CONFIG_USB_RTL8150 is not set
917# CONFIG_USB_USBNET is not set
918CONFIG_USB_MON=y
919
920#
921# USB port drivers
922#
923
924#
925# USB Serial Converter support
926#
927# CONFIG_USB_SERIAL is not set
928
929#
930# USB Miscellaneous drivers
931#
932# CONFIG_USB_EMI62 is not set
933# CONFIG_USB_EMI26 is not set
934# CONFIG_USB_AUERSWALD is not set
935# CONFIG_USB_RIO500 is not set
936# CONFIG_USB_LEGOTOWER is not set
937# CONFIG_USB_LCD is not set
938# CONFIG_USB_LED is not set
939# CONFIG_USB_CYTHERM is not set
940# CONFIG_USB_PHIDGETKIT is not set
941# CONFIG_USB_PHIDGETSERVO is not set
942# CONFIG_USB_IDMOUSE is not set
943# CONFIG_USB_SISUSBVGA is not set
944# CONFIG_USB_LD is not set
945
946#
947# USB DSL modem support
948#
949
950#
951# USB Gadget Support
952#
953# CONFIG_USB_GADGET is not set
954
955#
956# MMC/SD Card support
957#
958# CONFIG_MMC is not set
959
960#
961# LED devices
962#
963# CONFIG_NEW_LEDS is not set
964
965#
966# LED drivers
967#
968
969#
970# LED Triggers
971#
972
973#
974# InfiniBand support
975#
976# CONFIG_INFINIBAND is not set
977
978#
979# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
980#
981
982#
983# Real Time Clock
984#
985# CONFIG_RTC_CLASS is not set
986
987#
988# File systems
989#
990CONFIG_EXT2_FS=y
991# CONFIG_EXT2_FS_XATTR is not set
992# CONFIG_EXT2_FS_XIP is not set
993CONFIG_EXT3_FS=y
994CONFIG_EXT3_FS_XATTR=y
995# CONFIG_EXT3_FS_POSIX_ACL is not set
996# CONFIG_EXT3_FS_SECURITY is not set
997CONFIG_JBD=y
998# CONFIG_JBD_DEBUG is not set
999CONFIG_FS_MBCACHE=y
1000# CONFIG_REISERFS_FS is not set
1001# CONFIG_JFS_FS is not set
1002# CONFIG_FS_POSIX_ACL is not set
1003CONFIG_XFS_FS=y
1004CONFIG_XFS_QUOTA=y
1005# CONFIG_XFS_SECURITY is not set
1006CONFIG_XFS_POSIX_ACL=y
1007# CONFIG_XFS_RT is not set
1008# CONFIG_OCFS2_FS is not set
1009# CONFIG_MINIX_FS is not set
1010CONFIG_ROMFS_FS=m
1011CONFIG_INOTIFY=y
1012# CONFIG_QUOTA is not set
1013CONFIG_QUOTACTL=y
1014# CONFIG_DNOTIFY is not set
1015# CONFIG_AUTOFS_FS is not set
1016CONFIG_AUTOFS4_FS=y
1017# CONFIG_FUSE_FS is not set
1018
1019#
1020# CD-ROM/DVD Filesystems
1021#
1022# CONFIG_ISO9660_FS is not set
1023# CONFIG_UDF_FS is not set
1024
1025#
1026# DOS/FAT/NT Filesystems
1027#
1028# CONFIG_MSDOS_FS is not set
1029# CONFIG_VFAT_FS is not set
1030# CONFIG_NTFS_FS is not set
1031
1032#
1033# Pseudo filesystems
1034#
1035CONFIG_PROC_FS=y
1036CONFIG_PROC_KCORE=y
1037CONFIG_SYSFS=y
1038CONFIG_TMPFS=y
1039# CONFIG_HUGETLB_PAGE is not set
1040CONFIG_RAMFS=y
1041# CONFIG_CONFIGFS_FS is not set
1042
1043#
1044# Miscellaneous filesystems
1045#
1046# CONFIG_ADFS_FS is not set
1047# CONFIG_AFFS_FS is not set
1048# CONFIG_HFS_FS is not set
1049# CONFIG_HFSPLUS_FS is not set
1050# CONFIG_BEFS_FS is not set
1051# CONFIG_BFS_FS is not set
1052# CONFIG_EFS_FS is not set
1053CONFIG_CRAMFS=m
1054# CONFIG_VXFS_FS is not set
1055# CONFIG_HPFS_FS is not set
1056# CONFIG_QNX4FS_FS is not set
1057# CONFIG_SYSV_FS is not set
1058# CONFIG_UFS_FS is not set
1059
1060#
1061# Network File Systems
1062#
1063CONFIG_NFS_FS=y
1064CONFIG_NFS_V3=y
1065# CONFIG_NFS_V3_ACL is not set
1066# CONFIG_NFS_V4 is not set
1067# CONFIG_NFS_DIRECTIO is not set
1068# CONFIG_NFSD is not set
1069CONFIG_ROOT_NFS=y
1070CONFIG_LOCKD=y
1071CONFIG_LOCKD_V4=y
1072CONFIG_NFS_COMMON=y
1073CONFIG_SUNRPC=y
1074# CONFIG_RPCSEC_GSS_KRB5 is not set
1075# CONFIG_RPCSEC_GSS_SPKM3 is not set
1076# CONFIG_SMB_FS is not set
1077# CONFIG_CIFS is not set
1078# CONFIG_NCP_FS is not set
1079# CONFIG_CODA_FS is not set
1080# CONFIG_AFS_FS is not set
1081# CONFIG_9P_FS is not set
1082
1083#
1084# Partition Types
1085#
1086# CONFIG_PARTITION_ADVANCED is not set
1087CONFIG_MSDOS_PARTITION=y
1088
1089#
1090# Native Language Support
1091#
1092# CONFIG_NLS is not set
1093
1094#
1095# Profiling support
1096#
1097# CONFIG_PROFILING is not set
1098
1099#
1100# Kernel hacking
1101#
1102# CONFIG_PRINTK_TIME is not set
1103# CONFIG_MAGIC_SYSRQ is not set
1104# CONFIG_DEBUG_KERNEL is not set
1105CONFIG_LOG_BUF_SHIFT=14
1106# CONFIG_DEBUG_FS is not set
1107CONFIG_CROSSCOMPILE=y
1108CONFIG_CMDLINE="mem=64M console=ttyVR0,115200 ip=any root=/dev/nfs"
1109
1110#
1111# Security options
1112#
1113# CONFIG_KEYS is not set
1114# CONFIG_SECURITY is not set
1115
1116#
1117# Cryptographic options
1118#
1119# CONFIG_CRYPTO is not set
1120
1121#
1122# Hardware crypto devices
1123#
1124
1125#
1126# Library routines
1127#
1128# CONFIG_CRC_CCITT is not set
1129# CONFIG_CRC16 is not set
1130CONFIG_CRC32=y
1131# CONFIG_LIBCRC32C is not set
1132CONFIG_ZLIB_INFLATE=m
diff --git a/arch/mips/configs/workpad_defconfig b/arch/mips/configs/workpad_defconfig
index 7132e296d40a..ac7765eb8da7 100644
--- a/arch/mips/configs/workpad_defconfig
+++ b/arch/mips/configs/workpad_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc1 3# Linux kernel version: 2.6.17-rc2
4# Fri Jan 27 15:40:36 2006 4# Tue Apr 25 00:09:33 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -70,6 +70,8 @@ CONFIG_IBM_WORKPAD=y
70# CONFIG_VICTOR_MPC30X is not set 70# CONFIG_VICTOR_MPC30X is not set
71# CONFIG_ZAO_CAPCELLA is not set 71# CONFIG_ZAO_CAPCELLA is not set
72CONFIG_RWSEM_GENERIC_SPINLOCK=y 72CONFIG_RWSEM_GENERIC_SPINLOCK=y
73CONFIG_GENERIC_FIND_NEXT_BIT=y
74CONFIG_GENERIC_HWEIGHT=y
73CONFIG_GENERIC_CALIBRATE_DELAY=y 75CONFIG_GENERIC_CALIBRATE_DELAY=y
74CONFIG_DMA_NONCOHERENT=y 76CONFIG_DMA_NONCOHERENT=y
75CONFIG_DMA_NEED_PCI_MAP_STATE=y 77CONFIG_DMA_NEED_PCI_MAP_STATE=y
@@ -88,7 +90,7 @@ CONFIG_MIPS_L1_CACHE_SHIFT=5
88# CONFIG_CPU_MIPS64_R2 is not set 90# CONFIG_CPU_MIPS64_R2 is not set
89# CONFIG_CPU_R3000 is not set 91# CONFIG_CPU_R3000 is not set
90# CONFIG_CPU_TX39XX is not set 92# CONFIG_CPU_TX39XX is not set
91# CONFIG_CPU_VR41XX is not set 93CONFIG_CPU_VR41XX=y
92# CONFIG_CPU_R4300 is not set 94# CONFIG_CPU_R4300 is not set
93# CONFIG_CPU_R4X00 is not set 95# CONFIG_CPU_R4X00 is not set
94# CONFIG_CPU_TX49XX is not set 96# CONFIG_CPU_TX49XX is not set
@@ -101,18 +103,21 @@ CONFIG_MIPS_L1_CACHE_SHIFT=5
101# CONFIG_CPU_RM7000 is not set 103# CONFIG_CPU_RM7000 is not set
102# CONFIG_CPU_RM9000 is not set 104# CONFIG_CPU_RM9000 is not set
103# CONFIG_CPU_SB1 is not set 105# CONFIG_CPU_SB1 is not set
106CONFIG_SYS_HAS_CPU_VR41XX=y
107CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
108CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
109CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
104 110
105# 111#
106# Kernel type 112# Kernel type
107# 113#
108# CONFIG_32BIT is not set 114CONFIG_32BIT=y
109# CONFIG_64BIT is not set 115# CONFIG_64BIT is not set
110CONFIG_PAGE_SIZE_4KB=y 116CONFIG_PAGE_SIZE_4KB=y
111# CONFIG_PAGE_SIZE_8KB is not set 117# CONFIG_PAGE_SIZE_8KB is not set
112# CONFIG_PAGE_SIZE_16KB is not set 118# CONFIG_PAGE_SIZE_16KB is not set
113# CONFIG_PAGE_SIZE_64KB is not set 119# CONFIG_PAGE_SIZE_64KB is not set
114# CONFIG_MIPS_MT is not set 120# CONFIG_MIPS_MT is not set
115CONFIG_CPU_HAS_LLSC=y
116CONFIG_CPU_HAS_SYNC=y 121CONFIG_CPU_HAS_SYNC=y
117CONFIG_GENERIC_HARDIRQS=y 122CONFIG_GENERIC_HARDIRQS=y
118CONFIG_GENERIC_IRQ_PROBE=y 123CONFIG_GENERIC_IRQ_PROBE=y
@@ -133,7 +138,6 @@ CONFIG_PREEMPT_NONE=y
133# Code maturity level options 138# Code maturity level options
134# 139#
135CONFIG_EXPERIMENTAL=y 140CONFIG_EXPERIMENTAL=y
136CONFIG_CLEAN_COMPILE=y
137CONFIG_BROKEN_ON_SMP=y 141CONFIG_BROKEN_ON_SMP=y
138CONFIG_INIT_ENV_ARG_LIMIT=32 142CONFIG_INIT_ENV_ARG_LIMIT=32
139 143
@@ -149,6 +153,7 @@ CONFIG_SYSVIPC=y
149CONFIG_SYSCTL=y 153CONFIG_SYSCTL=y
150# CONFIG_AUDIT is not set 154# CONFIG_AUDIT is not set
151# CONFIG_IKCONFIG is not set 155# CONFIG_IKCONFIG is not set
156# CONFIG_RELAY is not set
152CONFIG_INITRAMFS_SOURCE="" 157CONFIG_INITRAMFS_SOURCE=""
153# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 158# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
154CONFIG_EMBEDDED=y 159CONFIG_EMBEDDED=y
@@ -162,10 +167,6 @@ CONFIG_BASE_FULL=y
162CONFIG_FUTEX=y 167CONFIG_FUTEX=y
163CONFIG_EPOLL=y 168CONFIG_EPOLL=y
164CONFIG_SHMEM=y 169CONFIG_SHMEM=y
165CONFIG_CC_ALIGN_FUNCTIONS=0
166CONFIG_CC_ALIGN_LABELS=0
167CONFIG_CC_ALIGN_LOOPS=0
168CONFIG_CC_ALIGN_JUMPS=0
169CONFIG_SLAB=y 170CONFIG_SLAB=y
170# CONFIG_TINY_SHMEM is not set 171# CONFIG_TINY_SHMEM is not set
171CONFIG_BASE_SMALL=0 172CONFIG_BASE_SMALL=0
@@ -177,7 +178,6 @@ CONFIG_BASE_SMALL=0
177CONFIG_MODULES=y 178CONFIG_MODULES=y
178CONFIG_MODULE_UNLOAD=y 179CONFIG_MODULE_UNLOAD=y
179# CONFIG_MODULE_FORCE_UNLOAD is not set 180# CONFIG_MODULE_FORCE_UNLOAD is not set
180CONFIG_OBSOLETE_MODPARM=y
181CONFIG_MODVERSIONS=y 181CONFIG_MODVERSIONS=y
182CONFIG_MODULE_SRCVERSION_ALL=y 182CONFIG_MODULE_SRCVERSION_ALL=y
183CONFIG_KMOD=y 183CONFIG_KMOD=y
@@ -185,6 +185,9 @@ CONFIG_KMOD=y
185# 185#
186# Block layer 186# Block layer
187# 187#
188# CONFIG_LBD is not set
189# CONFIG_BLK_DEV_IO_TRACE is not set
190# CONFIG_LSF is not set
188 191
189# 192#
190# IO Schedulers 193# IO Schedulers
@@ -220,6 +223,7 @@ CONFIG_PCMCIA_IOCTL=y
220# CONFIG_I82365 is not set 223# CONFIG_I82365 is not set
221# CONFIG_TCIC is not set 224# CONFIG_TCIC is not set
222CONFIG_PCMCIA_PROBE=y 225CONFIG_PCMCIA_PROBE=y
226CONFIG_PCMCIA_VRC4171=y
223 227
224# 228#
225# PCI Hotplug Support 229# PCI Hotplug Support
@@ -230,6 +234,7 @@ CONFIG_PCMCIA_PROBE=y
230# 234#
231CONFIG_BINFMT_ELF=y 235CONFIG_BINFMT_ELF=y
232# CONFIG_BINFMT_MISC is not set 236# CONFIG_BINFMT_MISC is not set
237CONFIG_TRAD_SIGNALS=y
233 238
234# 239#
235# Networking 240# Networking
@@ -239,6 +244,7 @@ CONFIG_NET=y
239# 244#
240# Networking options 245# Networking options
241# 246#
247# CONFIG_NETDEBUG is not set
242CONFIG_PACKET=y 248CONFIG_PACKET=y
243CONFIG_PACKET_MMAP=y 249CONFIG_PACKET_MMAP=y
244CONFIG_UNIX=y 250CONFIG_UNIX=y
@@ -258,12 +264,15 @@ CONFIG_IP_FIB_HASH=y
258# CONFIG_INET_AH is not set 264# CONFIG_INET_AH is not set
259# CONFIG_INET_ESP is not set 265# CONFIG_INET_ESP is not set
260# CONFIG_INET_IPCOMP is not set 266# CONFIG_INET_IPCOMP is not set
261CONFIG_INET_TUNNEL=m 267# CONFIG_INET_XFRM_TUNNEL is not set
268# CONFIG_INET_TUNNEL is not set
262CONFIG_INET_DIAG=y 269CONFIG_INET_DIAG=y
263CONFIG_INET_TCP_DIAG=y 270CONFIG_INET_TCP_DIAG=y
264# CONFIG_TCP_CONG_ADVANCED is not set 271# CONFIG_TCP_CONG_ADVANCED is not set
265CONFIG_TCP_CONG_BIC=y 272CONFIG_TCP_CONG_BIC=y
266# CONFIG_IPV6 is not set 273# CONFIG_IPV6 is not set
274# CONFIG_INET6_XFRM_TUNNEL is not set
275# CONFIG_INET6_TUNNEL is not set
267# CONFIG_NETFILTER is not set 276# CONFIG_NETFILTER is not set
268 277
269# 278#
@@ -275,6 +284,11 @@ CONFIG_TCP_CONG_BIC=y
275# SCTP Configuration (EXPERIMENTAL) 284# SCTP Configuration (EXPERIMENTAL)
276# 285#
277# CONFIG_IP_SCTP is not set 286# CONFIG_IP_SCTP is not set
287
288#
289# TIPC Configuration (EXPERIMENTAL)
290#
291# CONFIG_TIPC is not set
278# CONFIG_ATM is not set 292# CONFIG_ATM is not set
279# CONFIG_BRIDGE is not set 293# CONFIG_BRIDGE is not set
280# CONFIG_VLAN_8021Q is not set 294# CONFIG_VLAN_8021Q is not set
@@ -284,11 +298,6 @@ CONFIG_TCP_CONG_BIC=y
284# CONFIG_ATALK is not set 298# CONFIG_ATALK is not set
285# CONFIG_X25 is not set 299# CONFIG_X25 is not set
286# CONFIG_LAPB is not set 300# CONFIG_LAPB is not set
287
288#
289# TIPC Configuration (EXPERIMENTAL)
290#
291# CONFIG_TIPC is not set
292# CONFIG_NET_DIVERT is not set 301# CONFIG_NET_DIVERT is not set
293# CONFIG_ECONET is not set 302# CONFIG_ECONET is not set
294# CONFIG_WAN_ROUTER is not set 303# CONFIG_WAN_ROUTER is not set
@@ -305,10 +314,8 @@ CONFIG_TCP_CONG_BIC=y
305# CONFIG_HAMRADIO is not set 314# CONFIG_HAMRADIO is not set
306# CONFIG_IRDA is not set 315# CONFIG_IRDA is not set
307# CONFIG_BT is not set 316# CONFIG_BT is not set
308CONFIG_IEEE80211=m 317# CONFIG_IEEE80211 is not set
309# CONFIG_IEEE80211_DEBUG is not set 318CONFIG_WIRELESS_EXT=y
310CONFIG_IEEE80211_CRYPT_WEP=m
311CONFIG_IEEE80211_CRYPT_CCMP=m
312 319
313# 320#
314# Device Drivers 321# Device Drivers
@@ -347,10 +354,12 @@ CONFIG_CONNECTOR=m
347# CONFIG_BLK_DEV_COW_COMMON is not set 354# CONFIG_BLK_DEV_COW_COMMON is not set
348# CONFIG_BLK_DEV_LOOP is not set 355# CONFIG_BLK_DEV_LOOP is not set
349# CONFIG_BLK_DEV_NBD is not set 356# CONFIG_BLK_DEV_NBD is not set
350# CONFIG_BLK_DEV_RAM is not set 357CONFIG_BLK_DEV_RAM=m
351CONFIG_BLK_DEV_RAM_COUNT=16 358CONFIG_BLK_DEV_RAM_COUNT=16
359CONFIG_BLK_DEV_RAM_SIZE=4096
360# CONFIG_BLK_DEV_INITRD is not set
352# CONFIG_CDROM_PKTCDVD is not set 361# CONFIG_CDROM_PKTCDVD is not set
353CONFIG_ATA_OVER_ETH=m 362# CONFIG_ATA_OVER_ETH is not set
354 363
355# 364#
356# ATA/ATAPI/MFM/RLL support 365# ATA/ATAPI/MFM/RLL support
@@ -468,7 +477,38 @@ CONFIG_MII=m
468# 477#
469# Wireless LAN (non-hamradio) 478# Wireless LAN (non-hamradio)
470# 479#
471# CONFIG_NET_RADIO is not set 480CONFIG_NET_RADIO=y
481# CONFIG_NET_WIRELESS_RTNETLINK is not set
482
483#
484# Obsolete Wireless cards support (pre-802.11)
485#
486# CONFIG_STRIP is not set
487# CONFIG_ARLAN is not set
488# CONFIG_WAVELAN is not set
489# CONFIG_PCMCIA_WAVELAN is not set
490# CONFIG_PCMCIA_NETWAVE is not set
491
492#
493# Wireless 802.11 Frequency Hopping cards support
494#
495# CONFIG_PCMCIA_RAYCS is not set
496
497#
498# Wireless 802.11b ISA/PCI cards support
499#
500CONFIG_HERMES=m
501# CONFIG_ATMEL is not set
502
503#
504# Wireless 802.11b Pcmcia/Cardbus cards support
505#
506CONFIG_PCMCIA_HERMES=m
507# CONFIG_PCMCIA_SPECTRUM is not set
508# CONFIG_AIRO_CS is not set
509# CONFIG_PCMCIA_WL3501 is not set
510# CONFIG_HOSTAP is not set
511CONFIG_NET_WIRELESS=y
472 512
473# 513#
474# PCMCIA network device support 514# PCMCIA network device support
@@ -512,10 +552,7 @@ CONFIG_INPUT=y
512# 552#
513# Userland interfaces 553# Userland interfaces
514# 554#
515CONFIG_INPUT_MOUSEDEV=y 555# CONFIG_INPUT_MOUSEDEV is not set
516CONFIG_INPUT_MOUSEDEV_PSAUX=y
517CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
518CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
519# CONFIG_INPUT_JOYDEV is not set 556# CONFIG_INPUT_JOYDEV is not set
520# CONFIG_INPUT_TSDEV is not set 557# CONFIG_INPUT_TSDEV is not set
521# CONFIG_INPUT_EVDEV is not set 558# CONFIG_INPUT_EVDEV is not set
@@ -533,11 +570,7 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
533# 570#
534# Hardware I/O ports 571# Hardware I/O ports
535# 572#
536CONFIG_SERIO=y 573# CONFIG_SERIO is not set
537# CONFIG_SERIO_I8042 is not set
538CONFIG_SERIO_SERPORT=y
539# CONFIG_SERIO_LIBPS2 is not set
540CONFIG_SERIO_RAW=m
541# CONFIG_GAMEPORT is not set 574# CONFIG_GAMEPORT is not set
542 575
543# 576#
@@ -556,6 +589,10 @@ CONFIG_HW_CONSOLE=y
556# 589#
557# Non-8250 serial port support 590# Non-8250 serial port support
558# 591#
592CONFIG_SERIAL_CORE=y
593CONFIG_SERIAL_CORE_CONSOLE=y
594CONFIG_SERIAL_VR41XX=y
595CONFIG_SERIAL_VR41XX_CONSOLE=y
559CONFIG_UNIX98_PTYS=y 596CONFIG_UNIX98_PTYS=y
560CONFIG_LEGACY_PTYS=y 597CONFIG_LEGACY_PTYS=y
561CONFIG_LEGACY_PTY_COUNT=256 598CONFIG_LEGACY_PTY_COUNT=256
@@ -568,20 +605,7 @@ CONFIG_LEGACY_PTY_COUNT=256
568# 605#
569# Watchdog Cards 606# Watchdog Cards
570# 607#
571CONFIG_WATCHDOG=y 608# CONFIG_WATCHDOG is not set
572# CONFIG_WATCHDOG_NOWAYOUT is not set
573
574#
575# Watchdog Device Drivers
576#
577# CONFIG_SOFT_WATCHDOG is not set
578
579#
580# ISA-based Watchdog Cards
581#
582# CONFIG_PCWATCHDOG is not set
583# CONFIG_MIXCOMWD is not set
584# CONFIG_WDT is not set
585# CONFIG_RTC is not set 609# CONFIG_RTC is not set
586# CONFIG_GEN_RTC is not set 610# CONFIG_GEN_RTC is not set
587# CONFIG_DTLK is not set 611# CONFIG_DTLK is not set
@@ -597,6 +621,7 @@ CONFIG_WATCHDOG=y
597# CONFIG_SYNCLINK_CS is not set 621# CONFIG_SYNCLINK_CS is not set
598# CONFIG_CARDMAN_4000 is not set 622# CONFIG_CARDMAN_4000 is not set
599# CONFIG_CARDMAN_4040 is not set 623# CONFIG_CARDMAN_4040 is not set
624# CONFIG_GPIO_VR41XX is not set
600# CONFIG_RAW_DRIVER is not set 625# CONFIG_RAW_DRIVER is not set
601 626
602# 627#
@@ -632,10 +657,6 @@ CONFIG_WATCHDOG=y
632# 657#
633 658
634# 659#
635# Multimedia Capabilities Port drivers
636#
637
638#
639# Multimedia devices 660# Multimedia devices
640# 661#
641# CONFIG_VIDEO_DEV is not set 662# CONFIG_VIDEO_DEV is not set
@@ -667,6 +688,7 @@ CONFIG_DUMMY_CONSOLE=y
667# 688#
668# CONFIG_USB_ARCH_HAS_HCD is not set 689# CONFIG_USB_ARCH_HAS_HCD is not set
669# CONFIG_USB_ARCH_HAS_OHCI is not set 690# CONFIG_USB_ARCH_HAS_OHCI is not set
691# CONFIG_USB_ARCH_HAS_EHCI is not set
670 692
671# 693#
672# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 694# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
@@ -683,12 +705,30 @@ CONFIG_DUMMY_CONSOLE=y
683# CONFIG_MMC is not set 705# CONFIG_MMC is not set
684 706
685# 707#
708# LED devices
709#
710# CONFIG_NEW_LEDS is not set
711
712#
713# LED drivers
714#
715
716#
717# LED Triggers
718#
719
720#
686# InfiniBand support 721# InfiniBand support
687# 722#
688 723
689# 724#
690# SN Devices 725# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
726#
727
728#
729# Real Time Clock
691# 730#
731# CONFIG_RTC_CLASS is not set
692 732
693# 733#
694# File systems 734# File systems
@@ -710,7 +750,7 @@ CONFIG_FS_POSIX_ACL=y
710CONFIG_INOTIFY=y 750CONFIG_INOTIFY=y
711# CONFIG_QUOTA is not set 751# CONFIG_QUOTA is not set
712CONFIG_DNOTIFY=y 752CONFIG_DNOTIFY=y
713CONFIG_AUTOFS_FS=y 753# CONFIG_AUTOFS_FS is not set
714CONFIG_AUTOFS4_FS=y 754CONFIG_AUTOFS4_FS=y
715CONFIG_FUSE_FS=m 755CONFIG_FUSE_FS=m
716 756
@@ -733,10 +773,9 @@ CONFIG_FUSE_FS=m
733CONFIG_PROC_FS=y 773CONFIG_PROC_FS=y
734CONFIG_PROC_KCORE=y 774CONFIG_PROC_KCORE=y
735CONFIG_SYSFS=y 775CONFIG_SYSFS=y
736# CONFIG_TMPFS is not set 776CONFIG_TMPFS=y
737# CONFIG_HUGETLB_PAGE is not set 777# CONFIG_HUGETLB_PAGE is not set
738CONFIG_RAMFS=y 778CONFIG_RAMFS=y
739CONFIG_RELAYFS_FS=m
740# CONFIG_CONFIGFS_FS is not set 779# CONFIG_CONFIGFS_FS is not set
741 780
742# 781#
@@ -802,44 +841,20 @@ CONFIG_MSDOS_PARTITION=y
802# CONFIG_MAGIC_SYSRQ is not set 841# CONFIG_MAGIC_SYSRQ is not set
803# CONFIG_DEBUG_KERNEL is not set 842# CONFIG_DEBUG_KERNEL is not set
804CONFIG_LOG_BUF_SHIFT=14 843CONFIG_LOG_BUF_SHIFT=14
844# CONFIG_DEBUG_FS is not set
805CONFIG_CROSSCOMPILE=y 845CONFIG_CROSSCOMPILE=y
806CONFIG_CMDLINE="console=ttyVR0,19200 mem=16M" 846CONFIG_CMDLINE="console=ttyVR0,19200 mem=16M"
807 847
808# 848#
809# Security options 849# Security options
810# 850#
811CONFIG_KEYS=y 851# CONFIG_KEYS is not set
812CONFIG_KEYS_DEBUG_PROC_KEYS=y
813# CONFIG_SECURITY is not set 852# CONFIG_SECURITY is not set
814 853
815# 854#
816# Cryptographic options 855# Cryptographic options
817# 856#
818CONFIG_CRYPTO=y 857# CONFIG_CRYPTO is not set
819CONFIG_CRYPTO_HMAC=y
820CONFIG_CRYPTO_NULL=m
821CONFIG_CRYPTO_MD4=m
822CONFIG_CRYPTO_MD5=m
823CONFIG_CRYPTO_SHA1=m
824CONFIG_CRYPTO_SHA256=m
825CONFIG_CRYPTO_SHA512=m
826CONFIG_CRYPTO_WP512=m
827CONFIG_CRYPTO_TGR192=m
828CONFIG_CRYPTO_DES=m
829CONFIG_CRYPTO_BLOWFISH=m
830CONFIG_CRYPTO_TWOFISH=m
831CONFIG_CRYPTO_SERPENT=m
832CONFIG_CRYPTO_AES=m
833CONFIG_CRYPTO_CAST5=m
834CONFIG_CRYPTO_CAST6=m
835CONFIG_CRYPTO_TEA=m
836CONFIG_CRYPTO_ARC4=m
837CONFIG_CRYPTO_KHAZAD=m
838CONFIG_CRYPTO_ANUBIS=m
839CONFIG_CRYPTO_DEFLATE=m
840CONFIG_CRYPTO_MICHAEL_MIC=m
841CONFIG_CRYPTO_CRC32C=m
842# CONFIG_CRYPTO_TEST is not set
843 858
844# 859#
845# Hardware crypto devices 860# Hardware crypto devices
@@ -849,8 +864,6 @@ CONFIG_CRYPTO_CRC32C=m
849# Library routines 864# Library routines
850# 865#
851# CONFIG_CRC_CCITT is not set 866# CONFIG_CRC_CCITT is not set
852CONFIG_CRC16=m 867# CONFIG_CRC16 is not set
853CONFIG_CRC32=y 868CONFIG_CRC32=y
854CONFIG_LIBCRC32C=m 869# CONFIG_LIBCRC32C is not set
855CONFIG_ZLIB_INFLATE=m
856CONFIG_ZLIB_DEFLATE=m
diff --git a/arch/mips/configs/yosemite_defconfig b/arch/mips/configs/yosemite_defconfig
index 67457850941d..b52d709de962 100644
--- a/arch/mips/configs/yosemite_defconfig
+++ b/arch/mips/configs/yosemite_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc1 3# Linux kernel version: 2.6.17-rc2
4# Fri Jan 27 15:40:37 2006 4# Mon Apr 24 14:51:20 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -65,6 +65,8 @@ CONFIG_PMC_YOSEMITE=y
65# CONFIG_TOSHIBA_RBTX4938 is not set 65# CONFIG_TOSHIBA_RBTX4938 is not set
66# CONFIG_HYPERTRANSPORT is not set 66# CONFIG_HYPERTRANSPORT is not set
67CONFIG_RWSEM_GENERIC_SPINLOCK=y 67CONFIG_RWSEM_GENERIC_SPINLOCK=y
68CONFIG_GENERIC_FIND_NEXT_BIT=y
69CONFIG_GENERIC_HWEIGHT=y
68CONFIG_GENERIC_CALIBRATE_DELAY=y 70CONFIG_GENERIC_CALIBRATE_DELAY=y
69CONFIG_DMA_COHERENT=y 71CONFIG_DMA_COHERENT=y
70CONFIG_CPU_BIG_ENDIAN=y 72CONFIG_CPU_BIG_ENDIAN=y
@@ -116,7 +118,6 @@ CONFIG_PAGE_SIZE_4KB=y
116CONFIG_CPU_HAS_PREFETCH=y 118CONFIG_CPU_HAS_PREFETCH=y
117# CONFIG_MIPS_MT is not set 119# CONFIG_MIPS_MT is not set
118# CONFIG_64BIT_PHYS_ADDR is not set 120# CONFIG_64BIT_PHYS_ADDR is not set
119# CONFIG_CPU_ADVANCED is not set
120CONFIG_CPU_HAS_LLSC=y 121CONFIG_CPU_HAS_LLSC=y
121CONFIG_CPU_HAS_SYNC=y 122CONFIG_CPU_HAS_SYNC=y
122CONFIG_GENERIC_HARDIRQS=y 123CONFIG_GENERIC_HARDIRQS=y
@@ -140,7 +141,6 @@ CONFIG_PREEMPT_BKL=y
140# Code maturity level options 141# Code maturity level options
141# 142#
142# CONFIG_EXPERIMENTAL is not set 143# CONFIG_EXPERIMENTAL is not set
143CONFIG_CLEAN_COMPILE=y
144CONFIG_LOCK_KERNEL=y 144CONFIG_LOCK_KERNEL=y
145CONFIG_INIT_ENV_ARG_LIMIT=32 145CONFIG_INIT_ENV_ARG_LIMIT=32
146 146
@@ -157,6 +157,7 @@ CONFIG_SYSCTL=y
157CONFIG_IKCONFIG=y 157CONFIG_IKCONFIG=y
158CONFIG_IKCONFIG_PROC=y 158CONFIG_IKCONFIG_PROC=y
159# CONFIG_CPUSETS is not set 159# CONFIG_CPUSETS is not set
160CONFIG_RELAY=y
160CONFIG_INITRAMFS_SOURCE="" 161CONFIG_INITRAMFS_SOURCE=""
161CONFIG_EMBEDDED=y 162CONFIG_EMBEDDED=y
162CONFIG_KALLSYMS=y 163CONFIG_KALLSYMS=y
@@ -170,10 +171,6 @@ CONFIG_BASE_FULL=y
170CONFIG_FUTEX=y 171CONFIG_FUTEX=y
171CONFIG_EPOLL=y 172CONFIG_EPOLL=y
172CONFIG_SHMEM=y 173CONFIG_SHMEM=y
173CONFIG_CC_ALIGN_FUNCTIONS=0
174CONFIG_CC_ALIGN_LABELS=0
175CONFIG_CC_ALIGN_LOOPS=0
176CONFIG_CC_ALIGN_JUMPS=0
177CONFIG_SLAB=y 174CONFIG_SLAB=y
178# CONFIG_TINY_SHMEM is not set 175# CONFIG_TINY_SHMEM is not set
179CONFIG_BASE_SMALL=0 176CONFIG_BASE_SMALL=0
@@ -184,7 +181,6 @@ CONFIG_BASE_SMALL=0
184# 181#
185CONFIG_MODULES=y 182CONFIG_MODULES=y
186CONFIG_MODULE_UNLOAD=y 183CONFIG_MODULE_UNLOAD=y
187CONFIG_OBSOLETE_MODPARM=y
188# CONFIG_MODVERSIONS is not set 184# CONFIG_MODVERSIONS is not set
189# CONFIG_MODULE_SRCVERSION_ALL is not set 185# CONFIG_MODULE_SRCVERSION_ALL is not set
190CONFIG_KMOD=y 186CONFIG_KMOD=y
@@ -194,6 +190,8 @@ CONFIG_STOP_MACHINE=y
194# Block layer 190# Block layer
195# 191#
196# CONFIG_LBD is not set 192# CONFIG_LBD is not set
193# CONFIG_BLK_DEV_IO_TRACE is not set
194# CONFIG_LSF is not set
197 195
198# 196#
199# IO Schedulers 197# IO Schedulers
@@ -213,7 +211,6 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
213# 211#
214CONFIG_HW_HAS_PCI=y 212CONFIG_HW_HAS_PCI=y
215CONFIG_PCI=y 213CONFIG_PCI=y
216CONFIG_PCI_LEGACY_PROC=y
217# CONFIG_PCI_DEBUG is not set 214# CONFIG_PCI_DEBUG is not set
218CONFIG_MMU=y 215CONFIG_MMU=y
219 216
@@ -241,6 +238,7 @@ CONFIG_NET=y
241# 238#
242# Networking options 239# Networking options
243# 240#
241# CONFIG_NETDEBUG is not set
244CONFIG_PACKET=m 242CONFIG_PACKET=m
245CONFIG_PACKET_MMAP=y 243CONFIG_PACKET_MMAP=y
246CONFIG_UNIX=y 244CONFIG_UNIX=y
@@ -261,16 +259,19 @@ CONFIG_IP_PNP_BOOTP=y
261# CONFIG_INET_AH is not set 259# CONFIG_INET_AH is not set
262# CONFIG_INET_ESP is not set 260# CONFIG_INET_ESP is not set
263# CONFIG_INET_IPCOMP is not set 261# CONFIG_INET_IPCOMP is not set
264CONFIG_INET_TUNNEL=m 262# CONFIG_INET_XFRM_TUNNEL is not set
263# CONFIG_INET_TUNNEL is not set
265CONFIG_INET_DIAG=y 264CONFIG_INET_DIAG=y
266CONFIG_INET_TCP_DIAG=y 265CONFIG_INET_TCP_DIAG=y
267# CONFIG_TCP_CONG_ADVANCED is not set 266# CONFIG_TCP_CONG_ADVANCED is not set
268CONFIG_TCP_CONG_BIC=y 267CONFIG_TCP_CONG_BIC=y
269CONFIG_IPV6=m 268CONFIG_IPV6=m
270CONFIG_IPV6_PRIVACY=y 269CONFIG_IPV6_PRIVACY=y
270CONFIG_IPV6_ROUTER_PREF=y
271CONFIG_INET6_AH=m 271CONFIG_INET6_AH=m
272CONFIG_INET6_ESP=m 272CONFIG_INET6_ESP=m
273CONFIG_INET6_IPCOMP=m 273CONFIG_INET6_IPCOMP=m
274CONFIG_INET6_XFRM_TUNNEL=m
274CONFIG_INET6_TUNNEL=m 275CONFIG_INET6_TUNNEL=m
275CONFIG_IPV6_TUNNEL=m 276CONFIG_IPV6_TUNNEL=m
276# CONFIG_NETFILTER is not set 277# CONFIG_NETFILTER is not set
@@ -340,10 +341,9 @@ CONFIG_CONNECTOR=m
340# CONFIG_BLK_DEV_NBD is not set 341# CONFIG_BLK_DEV_NBD is not set
341# CONFIG_BLK_DEV_SX8 is not set 342# CONFIG_BLK_DEV_SX8 is not set
342# CONFIG_BLK_DEV_RAM is not set 343# CONFIG_BLK_DEV_RAM is not set
343CONFIG_BLK_DEV_RAM_COUNT=16 344# CONFIG_BLK_DEV_INITRD is not set
344CONFIG_CDROM_PKTCDVD=m 345CONFIG_CDROM_PKTCDVD=m
345CONFIG_CDROM_PKTCDVD_BUFFERS=8 346CONFIG_CDROM_PKTCDVD_BUFFERS=8
346# CONFIG_CDROM_PKTCDVD_WCACHE is not set
347CONFIG_ATA_OVER_ETH=m 347CONFIG_ATA_OVER_ETH=m
348 348
349# 349#
@@ -433,6 +433,7 @@ CONFIG_MII=y
433# CONFIG_HAMACHI is not set 433# CONFIG_HAMACHI is not set
434# CONFIG_R8169 is not set 434# CONFIG_R8169 is not set
435# CONFIG_SIS190 is not set 435# CONFIG_SIS190 is not set
436# CONFIG_SKGE is not set
436# CONFIG_SK98LIN is not set 437# CONFIG_SK98LIN is not set
437# CONFIG_TIGON3 is not set 438# CONFIG_TIGON3 is not set
438# CONFIG_BNX2 is not set 439# CONFIG_BNX2 is not set
@@ -497,6 +498,7 @@ CONFIG_TITAN_GE=y
497# 498#
498CONFIG_SERIAL_8250=y 499CONFIG_SERIAL_8250=y
499CONFIG_SERIAL_8250_CONSOLE=y 500CONFIG_SERIAL_8250_CONSOLE=y
501CONFIG_SERIAL_8250_PCI=y
500CONFIG_SERIAL_8250_NR_UARTS=4 502CONFIG_SERIAL_8250_NR_UARTS=4
501CONFIG_SERIAL_8250_RUNTIME_UARTS=4 503CONFIG_SERIAL_8250_RUNTIME_UARTS=4
502# CONFIG_SERIAL_8250_EXTENDED is not set 504# CONFIG_SERIAL_8250_EXTENDED is not set
@@ -506,6 +508,7 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=4
506# 508#
507CONFIG_SERIAL_CORE=y 509CONFIG_SERIAL_CORE=y
508CONFIG_SERIAL_CORE_CONSOLE=y 510CONFIG_SERIAL_CORE_CONSOLE=y
511# CONFIG_SERIAL_JSM is not set
509CONFIG_UNIX98_PTYS=y 512CONFIG_UNIX98_PTYS=y
510CONFIG_LEGACY_PTYS=y 513CONFIG_LEGACY_PTYS=y
511CONFIG_LEGACY_PTY_COUNT=256 514CONFIG_LEGACY_PTY_COUNT=256
@@ -563,10 +566,6 @@ CONFIG_GEN_RTC_X=y
563# 566#
564 567
565# 568#
566# Multimedia Capabilities Port drivers
567#
568
569#
570# Multimedia devices 569# Multimedia devices
571# 570#
572# CONFIG_VIDEO_DEV is not set 571# CONFIG_VIDEO_DEV is not set
@@ -591,6 +590,7 @@ CONFIG_GEN_RTC_X=y
591# 590#
592CONFIG_USB_ARCH_HAS_HCD=y 591CONFIG_USB_ARCH_HAS_HCD=y
593CONFIG_USB_ARCH_HAS_OHCI=y 592CONFIG_USB_ARCH_HAS_OHCI=y
593CONFIG_USB_ARCH_HAS_EHCI=y
594# CONFIG_USB is not set 594# CONFIG_USB is not set
595 595
596# 596#
@@ -608,12 +608,29 @@ CONFIG_USB_ARCH_HAS_OHCI=y
608# CONFIG_MMC is not set 608# CONFIG_MMC is not set
609 609
610# 610#
611# LED devices
612#
613# CONFIG_NEW_LEDS is not set
614
615#
616# LED drivers
617#
618
619#
620# LED Triggers
621#
622
623#
611# InfiniBand support 624# InfiniBand support
612# 625#
613# CONFIG_INFINIBAND is not set 626# CONFIG_INFINIBAND is not set
614 627
615# 628#
616# SN Devices 629# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
630#
631
632#
633# Real Time Clock
617# 634#
618 635
619# 636#
@@ -656,7 +673,6 @@ CONFIG_SYSFS=y
656CONFIG_TMPFS=y 673CONFIG_TMPFS=y
657# CONFIG_HUGETLB_PAGE is not set 674# CONFIG_HUGETLB_PAGE is not set
658CONFIG_RAMFS=y 675CONFIG_RAMFS=y
659CONFIG_RELAYFS_FS=m
660 676
661# 677#
662# Miscellaneous filesystems 678# Miscellaneous filesystems
diff --git a/arch/mips/ddb5xxx/ddb5074/Makefile b/arch/mips/ddb5xxx/ddb5074/Makefile
index 488206b8d94e..304c02107b46 100644
--- a/arch/mips/ddb5xxx/ddb5074/Makefile
+++ b/arch/mips/ddb5xxx/ddb5074/Makefile
@@ -3,6 +3,6 @@
3# under Linux. 3# under Linux.
4# 4#
5 5
6obj-y += setup.o irq.o int-handler.o nile4_pic.o 6obj-y += setup.o irq.o nile4_pic.o
7 7
8EXTRA_AFLAGS := $(CFLAGS) 8EXTRA_AFLAGS := $(CFLAGS)
diff --git a/arch/mips/ddb5xxx/ddb5074/int-handler.S b/arch/mips/ddb5xxx/ddb5074/int-handler.S
deleted file mode 100644
index a78644150b37..000000000000
--- a/arch/mips/ddb5xxx/ddb5074/int-handler.S
+++ /dev/null
@@ -1,120 +0,0 @@
1/*
2 * arch/mips/ddb5074/int-handler.S -- NEC DDB Vrc-5074 interrupt handler
3 *
4 * Based on arch/mips/sgi/kernel/indyIRQ.S
5 *
6 * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
7 *
8 * Copyright (C) 2000 Geert Uytterhoeven <geert@sonycom.com>
9 * Sony Software Development Center Europe (SDCE), Brussels
10 */
11#include <asm/asm.h>
12#include <asm/mipsregs.h>
13#include <asm/regdef.h>
14#include <asm/stackframe.h>
15
16/* A lot of complication here is taken away because:
17 *
18 * 1) We handle one interrupt and return, sitting in a loop and moving across
19 * all the pending IRQ bits in the cause register is _NOT_ the answer, the
20 * common case is one pending IRQ so optimize in that direction.
21 *
22 * 2) We need not check against bits in the status register IRQ mask, that
23 * would make this routine slow as hell.
24 *
25 * 3) Linux only thinks in terms of all IRQs on or all IRQs off, nothing in
26 * between like BSD spl() brain-damage.
27 *
28 * Furthermore, the IRQs on the INDY look basically (barring software IRQs
29 * which we don't use at all) like:
30 *
31 * MIPS IRQ Source
32 * -------- ------
33 * 0 Software (ignored)
34 * 1 Software (ignored)
35 * 2 Local IRQ level zero
36 * 3 Local IRQ level one
37 * 4 8254 Timer zero
38 * 5 8254 Timer one
39 * 6 Bus Error
40 * 7 R4k timer (what we use)
41 *
42 * We handle the IRQ according to _our_ priority which is:
43 *
44 * Highest ---- R4k Timer
45 * Local IRQ zero
46 * Local IRQ one
47 * Bus Error
48 * 8254 Timer zero
49 * Lowest ---- 8254 Timer one
50 *
51 * then we just return, if multiple IRQs are pending then we will just take
52 * another exception, big deal.
53 */
54
55 .text
56 .set noreorder
57 .set noat
58 .align 5
59 NESTED(ddbIRQ, PT_SIZE, sp)
60 SAVE_ALL
61 CLI
62 .set at
63 mfc0 s0, CP0_CAUSE # get irq mask
64
65#if 1
66 mfc0 t2,CP0_STATUS # get enabled interrupts
67 and s0,t2 # isolate allowed ones
68#endif
69 /* First we check for r4k counter/timer IRQ. */
70 andi a0, s0, CAUSEF_IP2 # delay slot, check local level zero
71 beq a0, zero, 1f
72 andi a0, s0, CAUSEF_IP3 # delay slot, check local level one
73
74 /* Wheee, local level zero interrupt. */
75 jal ddb_local0_irqdispatch
76 move a0, sp # delay slot
77
78 j ret_from_irq
79 nop # delay slot
80
811:
82 beq a0, zero, 1f
83 andi a0, s0, CAUSEF_IP6 # delay slot, check bus error
84
85 /* Wheee, local level one interrupt. */
86 move a0, sp
87 jal ddb_local1_irqdispatch
88 nop
89
90 j ret_from_irq
91 nop
92
931:
94 beq a0, zero, 1f
95 nop
96
97 /* Wheee, an asynchronous bus error... */
98 move a0, sp
99 jal ddb_buserror_irq
100 nop
101
102 j ret_from_irq
103 nop
104
1051:
106 /* Here by mistake? This is possible, what can happen
107 * is that by the time we take the exception the IRQ
108 * pin goes low, so just leave if this is the case.
109 */
110 andi a0, s0, (CAUSEF_IP4 | CAUSEF_IP5)
111 beq a0, zero, 1f
112
113 /* Must be one of the 8254 timers... */
114 move a0, sp
115 jal ddb_8254timer_irq
116 nop
1171:
118 j ret_from_irq
119 nop
120 END(ddbIRQ)
diff --git a/arch/mips/ddb5xxx/ddb5074/irq.c b/arch/mips/ddb5xxx/ddb5074/irq.c
index 45088a1be414..60c087b7738c 100644
--- a/arch/mips/ddb5xxx/ddb5074/irq.c
+++ b/arch/mips/ddb5xxx/ddb5074/irq.c
@@ -21,8 +21,6 @@
21#include <asm/ddb5xxx/ddb5074.h> 21#include <asm/ddb5xxx/ddb5074.h>
22 22
23 23
24extern asmlinkage void ddbIRQ(void);
25
26static struct irqaction irq_cascade = { no_action, 0, CPU_MASK_NONE, "cascade", NULL, NULL }; 24static struct irqaction irq_cascade = { no_action, 0, CPU_MASK_NONE, "cascade", NULL, NULL };
27 25
28#define M1543_PNP_CONFIG 0x03f0 /* PnP Config Port */ 26#define M1543_PNP_CONFIG 0x03f0 /* PnP Config Port */
@@ -90,7 +88,7 @@ static void m1543_irq_setup(void)
90 88
91} 89}
92 90
93void ddb_local0_irqdispatch(struct pt_regs *regs) 91static void ddb_local0_irqdispatch(struct pt_regs *regs)
94{ 92{
95 u32 mask; 93 u32 mask;
96 int nile4_irq; 94 int nile4_irq;
@@ -118,29 +116,41 @@ void ddb_local0_irqdispatch(struct pt_regs *regs)
118 } 116 }
119} 117}
120 118
121void ddb_local1_irqdispatch(void) 119static void ddb_local1_irqdispatch(void)
122{ 120{
123 printk("ddb_local1_irqdispatch called\n"); 121 printk("ddb_local1_irqdispatch called\n");
124} 122}
125 123
126void ddb_buserror_irq(void) 124static void ddb_buserror_irq(void)
127{ 125{
128 printk("ddb_buserror_irq called\n"); 126 printk("ddb_buserror_irq called\n");
129} 127}
130 128
131void ddb_8254timer_irq(void) 129static void ddb_8254timer_irq(void)
132{ 130{
133 printk("ddb_8254timer_irq called\n"); 131 printk("ddb_8254timer_irq called\n");
134} 132}
135 133
134asmlinkage void plat_irq_dispatch(struct pt_regs *regs)
135{
136 unsigned int pending = read_c0_cause() & read_c0_status();
137
138 if (pending & CAUSEF_IP2)
139 ddb_local0_irqdispatch(regs);
140 else if (pending & CAUSEF_IP3)
141 ddb_local1_irqdispatch();
142 else if (pending & CAUSEF_IP6)
143 ddb_buserror_irq();
144 else if (pending & (CAUSEF_IP4 | CAUSEF_IP5))
145 ddb_8254timer_irq();
146}
147
136void __init arch_init_irq(void) 148void __init arch_init_irq(void)
137{ 149{
138 /* setup cascade interrupts */ 150 /* setup cascade interrupts */
139 setup_irq(NILE4_IRQ_BASE + NILE4_INT_INTE, &irq_cascade); 151 setup_irq(NILE4_IRQ_BASE + NILE4_INT_INTE, &irq_cascade);
140 setup_irq(CPU_IRQ_BASE + CPU_NILE4_CASCADE, &irq_cascade); 152 setup_irq(CPU_IRQ_BASE + CPU_NILE4_CASCADE, &irq_cascade);
141 153
142 set_except_vector(0, ddbIRQ);
143
144 nile4_irq_setup(NILE4_IRQ_BASE); 154 nile4_irq_setup(NILE4_IRQ_BASE);
145 m1543_irq_setup(); 155 m1543_irq_setup();
146 init_i8259_irqs(); 156 init_i8259_irqs();
diff --git a/arch/mips/ddb5xxx/ddb5476/Makefile b/arch/mips/ddb5xxx/ddb5476/Makefile
index 61eec363cb02..ab0312cb47b4 100644
--- a/arch/mips/ddb5xxx/ddb5476/Makefile
+++ b/arch/mips/ddb5xxx/ddb5476/Makefile
@@ -3,7 +3,7 @@
3# under Linux. 3# under Linux.
4# 4#
5 5
6obj-y += setup.o irq.o int-handler.o nile4_pic.o vrc5476_irq.o 6obj-y += setup.o irq.o nile4_pic.o vrc5476_irq.o
7obj-$(CONFIG_KGDB) += dbg_io.o 7obj-$(CONFIG_KGDB) += dbg_io.o
8 8
9EXTRA_AFLAGS := $(CFLAGS) 9EXTRA_AFLAGS := $(CFLAGS)
diff --git a/arch/mips/ddb5xxx/ddb5476/dbg_io.c b/arch/mips/ddb5xxx/ddb5476/dbg_io.c
index 85e9e5013679..f2296a999953 100644
--- a/arch/mips/ddb5xxx/ddb5476/dbg_io.c
+++ b/arch/mips/ddb5xxx/ddb5476/dbg_io.c
@@ -86,7 +86,7 @@ void debugInit(uint32 baud, uint8 data, uint8 parity, uint8 stop)
86 /* disable interrupts */ 86 /* disable interrupts */
87 UART16550_WRITE(OFS_INTR_ENABLE, 0); 87 UART16550_WRITE(OFS_INTR_ENABLE, 0);
88 88
89 /* set up buad rate */ 89 /* set up baud rate */
90 { 90 {
91 uint32 divisor; 91 uint32 divisor;
92 92
diff --git a/arch/mips/ddb5xxx/ddb5476/int-handler.S b/arch/mips/ddb5xxx/ddb5476/int-handler.S
deleted file mode 100644
index 12c292e189ba..000000000000
--- a/arch/mips/ddb5xxx/ddb5476/int-handler.S
+++ /dev/null
@@ -1,112 +0,0 @@
1/*
2 * Copyright 2001 MontaVista Software Inc.
3 * Author: jsun@mvista.com or jsun@junsun.net
4 *
5 * First-level interrupt dispatcher for ddb5476
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 */
12#include <asm/asm.h>
13#include <asm/mipsregs.h>
14#include <asm/addrspace.h>
15#include <asm/regdef.h>
16#include <asm/stackframe.h>
17
18#include <asm/ddb5xxx/ddb5476.h>
19
20/*
21 * first level interrupt dispatcher for ocelot board -
22 * We check for the timer first, then check PCI ints A and D.
23 * Then check for serial IRQ and fall through.
24 */
25 .align 5
26 NESTED(ddb5476_handle_int, PT_SIZE, sp)
27 SAVE_ALL
28 CLI
29 .set at
30 .set noreorder
31 mfc0 t0, CP0_CAUSE
32 mfc0 t2, CP0_STATUS
33
34 and t0, t2
35
36 andi t1, t0, STATUSF_IP7 /* cpu timer */
37 bnez t1, ll_cpu_ip7
38 andi t1, t0, STATUSF_IP2 /* vrc5476 & i8259 */
39 bnez t1, ll_cpu_ip2
40 andi t1, t0, STATUSF_IP3
41 bnez t1, ll_cpu_ip3
42 andi t1, t0, STATUSF_IP4
43 bnez t1, ll_cpu_ip4
44 andi t1, t0, STATUSF_IP5
45 bnez t1, ll_cpu_ip5
46 andi t1, t0, STATUSF_IP6
47 bnez t1, ll_cpu_ip6
48 andi t1, t0, STATUSF_IP0 /* software int 0 */
49 bnez t1, ll_cpu_ip0
50 andi t1, t0, STATUSF_IP1 /* software int 1 */
51 bnez t1, ll_cpu_ip1
52 nop
53
54 .set reorder
55
56 /* wrong alarm or masked ... */
57 // j spurious_interrupt
58 move a0, sp
59 jal vrc5476_irq_dispatch
60 j ret_from_irq
61 nop
62
63 .align 5
64
65ll_cpu_ip0:
66 li a0, CPU_IRQ_BASE + 0
67 move a1, sp
68 jal do_IRQ
69 j ret_from_irq
70
71ll_cpu_ip1:
72 li a0, CPU_IRQ_BASE + 1
73 move a1, sp
74 jal do_IRQ
75 j ret_from_irq
76
77ll_cpu_ip2: /* jump to second-level dispatching */
78 move a0, sp
79 jal vrc5476_irq_dispatch
80 j ret_from_irq
81
82ll_cpu_ip3:
83 li a0, CPU_IRQ_BASE + 3
84 move a1, sp
85 jal do_IRQ
86 j ret_from_irq
87
88ll_cpu_ip4:
89 li a0, CPU_IRQ_BASE + 4
90 move a1, sp
91 jal do_IRQ
92 j ret_from_irq
93
94ll_cpu_ip5:
95 li a0, CPU_IRQ_BASE + 5
96 move a1, sp
97 jal do_IRQ
98 j ret_from_irq
99
100ll_cpu_ip6:
101 li a0, CPU_IRQ_BASE + 6
102 move a1, sp
103 jal do_IRQ
104 j ret_from_irq
105
106ll_cpu_ip7:
107 li a0, CPU_IRQ_BASE + 7
108 move a1, sp
109 jal do_IRQ
110 j ret_from_irq
111
112 END(ddb5476_handle_int)
diff --git a/arch/mips/ddb5xxx/ddb5476/irq.c b/arch/mips/ddb5xxx/ddb5476/irq.c
index 5388b5868c4a..7583a1f30711 100644
--- a/arch/mips/ddb5xxx/ddb5476/irq.c
+++ b/arch/mips/ddb5xxx/ddb5476/irq.c
@@ -110,11 +110,36 @@ static void nile4_irq_setup(void)
110static struct irqaction irq_cascade = { no_action, 0, CPU_MASK_NONE, "cascade", NULL, NULL }; 110static struct irqaction irq_cascade = { no_action, 0, CPU_MASK_NONE, "cascade", NULL, NULL };
111static struct irqaction irq_error = { no_action, 0, CPU_MASK_NONE, "error", NULL, NULL }; 111static struct irqaction irq_error = { no_action, 0, CPU_MASK_NONE, "error", NULL, NULL };
112 112
113extern asmlinkage void ddb5476_handle_int(void);
114extern int setup_irq(unsigned int irq, struct irqaction *irqaction); 113extern int setup_irq(unsigned int irq, struct irqaction *irqaction);
115extern void mips_cpu_irq_init(u32 irq_base); 114extern void mips_cpu_irq_init(u32 irq_base);
116extern void vrc5476_irq_init(u32 irq_base); 115extern void vrc5476_irq_init(u32 irq_base);
117 116
117extern void vrc5476_irq_dispatch(struct pt_regs *regs);
118
119asmlinkage void plat_irq_dispatch(struct pt_regs *regs)
120{
121 unsigned int pending = read_c0_cause() & read_c0_status();
122
123 if (pending & STATUSF_IP7)
124 do_IRQ(CPU_IRQ_BASE + 7, regs);
125 else if (pending & STATUSF_IP2)
126 vrc5476_irq_dispatch(regs);
127 else if (pending & STATUSF_IP3)
128 do_IRQ(CPU_IRQ_BASE + 3, regs);
129 else if (pending & STATUSF_IP4)
130 do_IRQ(CPU_IRQ_BASE + 4, regs);
131 else if (pending & STATUSF_IP5)
132 do_IRQ(CPU_IRQ_BASE + 5, regs);
133 else if (pending & STATUSF_IP6)
134 do_IRQ(CPU_IRQ_BASE + 6, regs);
135 else if (pending & STATUSF_IP0)
136 do_IRQ(CPU_IRQ_BASE, regs);
137 else if (pending & STATUSF_IP1)
138 do_IRQ(CPU_IRQ_BASE + 1, regs);
139
140 vrc5476_irq_dispatch(regs);
141}
142
118void __init arch_init_irq(void) 143void __init arch_init_irq(void)
119{ 144{
120 /* hardware initialization */ 145 /* hardware initialization */
@@ -137,7 +162,4 @@ void __init arch_init_irq(void)
137 setup_irq(VRC5476_IRQ_BASE + VRC5476_IRQ_LBRT, &irq_error); 162 setup_irq(VRC5476_IRQ_BASE + VRC5476_IRQ_LBRT, &irq_error);
138 setup_irq(VRC5476_IRQ_BASE + VRC5476_IRQ_PCIS, &irq_error); 163 setup_irq(VRC5476_IRQ_BASE + VRC5476_IRQ_PCIS, &irq_error);
139 setup_irq(VRC5476_IRQ_BASE + VRC5476_IRQ_PCI, &irq_error); 164 setup_irq(VRC5476_IRQ_BASE + VRC5476_IRQ_PCI, &irq_error);
140
141 /* setup the grandpa intr vector */
142 set_except_vector(0, ddb5476_handle_int);
143} 165}
diff --git a/arch/mips/ddb5xxx/ddb5476/vrc5476_irq.c b/arch/mips/ddb5xxx/ddb5476/vrc5476_irq.c
index f66fe5b58636..a3c5e7b18018 100644
--- a/arch/mips/ddb5xxx/ddb5476/vrc5476_irq.c
+++ b/arch/mips/ddb5xxx/ddb5476/vrc5476_irq.c
@@ -77,11 +77,9 @@ vrc5476_irq_init(u32 base)
77} 77}
78 78
79 79
80asmlinkage void 80void
81vrc5476_irq_dispatch(struct pt_regs *regs) 81vrc5476_irq_dispatch(struct pt_regs *regs)
82{ 82{
83 extern void spurious_interrupt(void);
84
85 u32 mask; 83 u32 mask;
86 int nile4_irq; 84 int nile4_irq;
87 85
@@ -107,5 +105,5 @@ vrc5476_irq_dispatch(struct pt_regs *regs)
107 return; 105 return;
108 } 106 }
109 } 107 }
110 spurious_interrupt(); 108 spurious_interrupt(regs);
111} 109}
diff --git a/arch/mips/ddb5xxx/ddb5477/Makefile b/arch/mips/ddb5xxx/ddb5477/Makefile
index b79b43c9f93b..ea68815ad17a 100644
--- a/arch/mips/ddb5xxx/ddb5477/Makefile
+++ b/arch/mips/ddb5xxx/ddb5477/Makefile
@@ -2,7 +2,7 @@
2# Makefile for NEC DDB-Vrc5477 board 2# Makefile for NEC DDB-Vrc5477 board
3# 3#
4 4
5obj-y += int-handler.o irq.o irq_5477.o setup.o lcd44780.o 5obj-y += irq.o irq_5477.o setup.o lcd44780.o
6 6
7obj-$(CONFIG_RUNTIME_DEBUG) += debug.o 7obj-$(CONFIG_RUNTIME_DEBUG) += debug.o
8obj-$(CONFIG_KGDB) += kgdb_io.o 8obj-$(CONFIG_KGDB) += kgdb_io.o
diff --git a/arch/mips/ddb5xxx/ddb5477/int-handler.S b/arch/mips/ddb5xxx/ddb5477/int-handler.S
deleted file mode 100644
index a2502a14400e..000000000000
--- a/arch/mips/ddb5xxx/ddb5477/int-handler.S
+++ /dev/null
@@ -1,75 +0,0 @@
1/*
2 * Copyright 2001 MontaVista Software Inc.
3 * Author: jsun@mvista.com or jsun@junsun.net
4 *
5 * First-level interrupt dispatcher for ddb5477
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 */
12#include <asm/asm.h>
13#include <asm/mipsregs.h>
14#include <asm/addrspace.h>
15#include <asm/regdef.h>
16#include <asm/stackframe.h>
17#include <asm/ddb5xxx/ddb5477.h>
18
19/*
20 * first level interrupt dispatcher for ocelot board -
21 * We check for the timer first, then check PCI ints A and D.
22 * Then check for serial IRQ and fall through.
23 */
24 .align 5
25 NESTED(ddb5477_handle_int, PT_SIZE, sp)
26 SAVE_ALL
27 CLI
28 .set at
29 .set noreorder
30 mfc0 t0, CP0_CAUSE
31 mfc0 t2, CP0_STATUS
32
33 and t0, t2
34
35 andi t1, t0, STATUSF_IP7 /* cpu timer */
36 bnez t1, ll_cputimer_irq
37 andi t1, t0, (STATUSF_IP2 | STATUSF_IP3 | STATUSF_IP4 | STATUSF_IP5 | STATUSF_IP6 )
38 bnez t1, ll_vrc5477_irq
39 andi t1, t0, STATUSF_IP0 /* software int 0 */
40 bnez t1, ll_cpu_ip0
41 andi t1, t0, STATUSF_IP1 /* software int 1 */
42 bnez t1, ll_cpu_ip1
43 nop
44 .set reorder
45
46 /* wrong alarm or masked ... */
47 j spurious_interrupt
48 nop
49 END(ddb5477_handle_int)
50
51 .align 5
52
53ll_vrc5477_irq:
54 move a0, sp
55 jal vrc5477_irq_dispatch
56 j ret_from_irq
57
58ll_cputimer_irq:
59 li a0, CPU_IRQ_BASE + 7
60 move a1, sp
61 jal do_IRQ
62 j ret_from_irq
63
64
65ll_cpu_ip0:
66 li a0, CPU_IRQ_BASE + 0
67 move a1, sp
68 jal do_IRQ
69 j ret_from_irq
70
71ll_cpu_ip1:
72 li a0, CPU_IRQ_BASE + 1
73 move a1, sp
74 jal do_IRQ
75 j ret_from_irq
diff --git a/arch/mips/ddb5xxx/ddb5477/irq.c b/arch/mips/ddb5xxx/ddb5477/irq.c
index 9ffe1a9142ca..de433cf9fb50 100644
--- a/arch/mips/ddb5xxx/ddb5477/irq.c
+++ b/arch/mips/ddb5xxx/ddb5477/irq.c
@@ -75,7 +75,6 @@ set_pci_int_attr(u32 pci, u32 intn, u32 active, u32 trigger)
75 75
76extern void vrc5477_irq_init(u32 base); 76extern void vrc5477_irq_init(u32 base);
77extern void mips_cpu_irq_init(u32 base); 77extern void mips_cpu_irq_init(u32 base);
78extern asmlinkage void ddb5477_handle_int(void);
79extern int setup_irq(unsigned int irq, struct irqaction *irqaction); 78extern int setup_irq(unsigned int irq, struct irqaction *irqaction);
80static struct irqaction irq_cascade = { no_action, 0, CPU_MASK_NONE, "cascade", NULL, NULL }; 79static struct irqaction irq_cascade = { no_action, 0, CPU_MASK_NONE, "cascade", NULL, NULL };
81 80
@@ -135,9 +134,6 @@ void __init arch_init_irq(void)
135 /* setup cascade interrupts */ 134 /* setup cascade interrupts */
136 setup_irq(VRC5477_IRQ_BASE + VRC5477_I8259_CASCADE, &irq_cascade); 135 setup_irq(VRC5477_IRQ_BASE + VRC5477_I8259_CASCADE, &irq_cascade);
137 setup_irq(CPU_IRQ_BASE + CPU_VRC5477_CASCADE, &irq_cascade); 136 setup_irq(CPU_IRQ_BASE + CPU_VRC5477_CASCADE, &irq_cascade);
138
139 /* hook up the first-level interrupt handler */
140 set_except_vector(0, ddb5477_handle_int);
141} 137}
142 138
143u8 i8259_interrupt_ack(void) 139u8 i8259_interrupt_ack(void)
@@ -159,7 +155,7 @@ u8 i8259_interrupt_ack(void)
159 * the first level int-handler will jump here if it is a vrc5477 irq 155 * the first level int-handler will jump here if it is a vrc5477 irq
160 */ 156 */
161#define NUM_5477_IRQS 32 157#define NUM_5477_IRQS 32
162asmlinkage void 158static void
163vrc5477_irq_dispatch(struct pt_regs *regs) 159vrc5477_irq_dispatch(struct pt_regs *regs)
164{ 160{
165 u32 intStatus; 161 u32 intStatus;
@@ -197,3 +193,21 @@ vrc5477_irq_dispatch(struct pt_regs *regs)
197 } 193 }
198 } 194 }
199} 195}
196
197#define VR5477INTS (STATUSF_IP2|STATUSF_IP3|STATUSF_IP4|STATUSF_IP5|STATUSF_IP6)
198
199asmlinkage void plat_irq_dispatch(struct pt_regs *regs)
200{
201 unsigned int pending = read_c0_cause() & read_c0_status();
202
203 if (pending & STATUSF_IP7)
204 do_IRQ(CPU_IRQ_BASE + 7, regs);
205 else if (pending & VR5477INTS)
206 vrc5477_irq_dispatch(regs);
207 else if (pending & STATUSF_IP0)
208 do_IRQ(CPU_IRQ_BASE, regs);
209 else if (pending & STATUSF_IP1)
210 do_IRQ(CPU_IRQ_BASE + 1, regs);
211 else
212 spurious_interrupt(regs);
213}
diff --git a/arch/mips/ddb5xxx/ddb5477/kgdb_io.c b/arch/mips/ddb5xxx/ddb5477/kgdb_io.c
index 1d18d590495b..385bbdb10170 100644
--- a/arch/mips/ddb5xxx/ddb5477/kgdb_io.c
+++ b/arch/mips/ddb5xxx/ddb5477/kgdb_io.c
@@ -86,7 +86,7 @@ void debugInit(uint32 baud, uint8 data, uint8 parity, uint8 stop)
86 /* disable interrupts */ 86 /* disable interrupts */
87 UART16550_WRITE(OFS_INTR_ENABLE, 0); 87 UART16550_WRITE(OFS_INTR_ENABLE, 0);
88 88
89 /* set up buad rate */ 89 /* set up baud rate */
90 { 90 {
91 uint32 divisor; 91 uint32 divisor;
92 92
diff --git a/arch/mips/dec/boot/decstation.c b/arch/mips/dec/boot/decstation.c
index 56fd4277555e..4db8bacaf22d 100644
--- a/arch/mips/dec/boot/decstation.c
+++ b/arch/mips/dec/boot/decstation.c
@@ -1,6 +1,7 @@
1/* 1/*
2 * arch/mips/dec/decstation.c 2 * arch/mips/dec/decstation.c
3 */ 3 */
4#include <asm/sections.h>
4 5
5#define RELOC 6#define RELOC
6#define INITRD 7#define INITRD
@@ -24,7 +25,7 @@
24#define INITRD_START (*(unsigned long *) (PARAM+0x218)) 25#define INITRD_START (*(unsigned long *) (PARAM+0x218))
25#define INITRD_SIZE (*(unsigned long *) (PARAM+0x21c)) 26#define INITRD_SIZE (*(unsigned long *) (PARAM+0x21c))
26 27
27extern int _ftext, _end; /* begin and end of kernel image */ 28extern int _ftext; /* begin and end of kernel image */
28extern void kernel_entry(int, char **, unsigned long, int *); 29extern void kernel_entry(int, char **, unsigned long, int *);
29 30
30void * memcpy(void * dest, const void *src, unsigned int count) 31void * memcpy(void * dest, const void *src, unsigned int count)
diff --git a/arch/mips/dec/int-handler.S b/arch/mips/dec/int-handler.S
index 41fa372007bf..e8ec93e33fe6 100644
--- a/arch/mips/dec/int-handler.S
+++ b/arch/mips/dec/int-handler.S
@@ -36,7 +36,7 @@
36 .text 36 .text
37 .set noreorder 37 .set noreorder
38/* 38/*
39 * decstation_handle_int: Interrupt handler for DECstations 39 * plat_irq_dispatch: Interrupt handler for DECstations
40 * 40 *
41 * We follow the model in the Indy interrupt code by David Miller, where he 41 * We follow the model in the Indy interrupt code by David Miller, where he
42 * says: a lot of complication here is taken away because: 42 * says: a lot of complication here is taken away because:
@@ -125,11 +125,7 @@
125 * just take another exception, big deal. 125 * just take another exception, big deal.
126 */ 126 */
127 .align 5 127 .align 5
128 NESTED(decstation_handle_int, PT_SIZE, ra) 128 NESTED(plat_irq_dispatch, PT_SIZE, ra)
129 .set noat
130 SAVE_ALL
131 CLI # TEST: interrupts should be off
132 .set at
133 .set noreorder 129 .set noreorder
134 130
135 /* 131 /*
@@ -282,9 +278,11 @@ fpu:
282#endif 278#endif
283 279
284spurious: 280spurious:
285 j spurious_interrupt 281 jal spurious_interrupt
286 nop 282 nop
287 END(decstation_handle_int) 283 j ret_from_irq
284 nop
285 END(plat_irq_dispatch)
288 286
289/* 287/*
290 * Generic unimplemented interrupt routines -- cpu_mask_nr_tbl 288 * Generic unimplemented interrupt routines -- cpu_mask_nr_tbl
diff --git a/arch/mips/dec/setup.c b/arch/mips/dec/setup.c
index 7c1ca8f6330e..ad5d436d80c1 100644
--- a/arch/mips/dec/setup.c
+++ b/arch/mips/dec/setup.c
@@ -48,8 +48,6 @@ extern void dec_machine_halt(void);
48extern void dec_machine_power_off(void); 48extern void dec_machine_power_off(void);
49extern irqreturn_t dec_intr_halt(int irq, void *dev_id, struct pt_regs *regs); 49extern irqreturn_t dec_intr_halt(int irq, void *dev_id, struct pt_regs *regs);
50 50
51extern asmlinkage void decstation_handle_int(void);
52
53unsigned long dec_kn_slot_base, dec_kn_slot_size; 51unsigned long dec_kn_slot_base, dec_kn_slot_size;
54 52
55EXPORT_SYMBOL(dec_kn_slot_base); 53EXPORT_SYMBOL(dec_kn_slot_base);
@@ -744,7 +742,6 @@ void __init arch_init_irq(void)
744 panic("Don't know how to set this up!"); 742 panic("Don't know how to set this up!");
745 break; 743 break;
746 } 744 }
747 set_except_vector(0, decstation_handle_int);
748 745
749 /* Free the FPU interrupt if the exception is present. */ 746 /* Free the FPU interrupt if the exception is present. */
750 if (!cpu_has_nofpuex) { 747 if (!cpu_has_nofpuex) {
diff --git a/arch/mips/defconfig b/arch/mips/defconfig
index 42d5cd7927cb..607e2985ffe3 100644
--- a/arch/mips/defconfig
+++ b/arch/mips/defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc1 3# Linux kernel version: 2.6.17-rc2
4# Fri Jan 27 15:39:51 2006 4# Mon Apr 24 14:50:54 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -64,6 +64,8 @@ CONFIG_SGI_IP22=y
64# CONFIG_TOSHIBA_RBTX4927 is not set 64# CONFIG_TOSHIBA_RBTX4927 is not set
65# CONFIG_TOSHIBA_RBTX4938 is not set 65# CONFIG_TOSHIBA_RBTX4938 is not set
66CONFIG_RWSEM_GENERIC_SPINLOCK=y 66CONFIG_RWSEM_GENERIC_SPINLOCK=y
67CONFIG_GENERIC_FIND_NEXT_BIT=y
68CONFIG_GENERIC_HWEIGHT=y
67CONFIG_GENERIC_CALIBRATE_DELAY=y 69CONFIG_GENERIC_CALIBRATE_DELAY=y
68CONFIG_ARC=y 70CONFIG_ARC=y
69CONFIG_DMA_NONCOHERENT=y 71CONFIG_DMA_NONCOHERENT=y
@@ -121,7 +123,6 @@ CONFIG_BOARD_SCACHE=y
121CONFIG_IP22_CPU_SCACHE=y 123CONFIG_IP22_CPU_SCACHE=y
122# CONFIG_MIPS_MT is not set 124# CONFIG_MIPS_MT is not set
123# CONFIG_64BIT_PHYS_ADDR is not set 125# CONFIG_64BIT_PHYS_ADDR is not set
124# CONFIG_CPU_ADVANCED is not set
125CONFIG_CPU_HAS_LLSC=y 126CONFIG_CPU_HAS_LLSC=y
126CONFIG_CPU_HAS_SYNC=y 127CONFIG_CPU_HAS_SYNC=y
127CONFIG_GENERIC_HARDIRQS=y 128CONFIG_GENERIC_HARDIRQS=y
@@ -143,7 +144,6 @@ CONFIG_PREEMPT_VOLUNTARY=y
143# Code maturity level options 144# Code maturity level options
144# 145#
145CONFIG_EXPERIMENTAL=y 146CONFIG_EXPERIMENTAL=y
146CONFIG_CLEAN_COMPILE=y
147CONFIG_BROKEN_ON_SMP=y 147CONFIG_BROKEN_ON_SMP=y
148CONFIG_INIT_ENV_ARG_LIMIT=32 148CONFIG_INIT_ENV_ARG_LIMIT=32
149 149
@@ -160,6 +160,7 @@ CONFIG_SYSCTL=y
160# CONFIG_AUDIT is not set 160# CONFIG_AUDIT is not set
161CONFIG_IKCONFIG=y 161CONFIG_IKCONFIG=y
162CONFIG_IKCONFIG_PROC=y 162CONFIG_IKCONFIG_PROC=y
163CONFIG_RELAY=y
163CONFIG_INITRAMFS_SOURCE="" 164CONFIG_INITRAMFS_SOURCE=""
164# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 165# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
165CONFIG_EMBEDDED=y 166CONFIG_EMBEDDED=y
@@ -173,10 +174,6 @@ CONFIG_BASE_FULL=y
173CONFIG_FUTEX=y 174CONFIG_FUTEX=y
174CONFIG_EPOLL=y 175CONFIG_EPOLL=y
175CONFIG_SHMEM=y 176CONFIG_SHMEM=y
176CONFIG_CC_ALIGN_FUNCTIONS=0
177CONFIG_CC_ALIGN_LABELS=0
178CONFIG_CC_ALIGN_LOOPS=0
179CONFIG_CC_ALIGN_JUMPS=0
180CONFIG_SLAB=y 177CONFIG_SLAB=y
181# CONFIG_TINY_SHMEM is not set 178# CONFIG_TINY_SHMEM is not set
182CONFIG_BASE_SMALL=0 179CONFIG_BASE_SMALL=0
@@ -188,7 +185,6 @@ CONFIG_BASE_SMALL=0
188CONFIG_MODULES=y 185CONFIG_MODULES=y
189CONFIG_MODULE_UNLOAD=y 186CONFIG_MODULE_UNLOAD=y
190# CONFIG_MODULE_FORCE_UNLOAD is not set 187# CONFIG_MODULE_FORCE_UNLOAD is not set
191CONFIG_OBSOLETE_MODPARM=y
192CONFIG_MODVERSIONS=y 188CONFIG_MODVERSIONS=y
193CONFIG_MODULE_SRCVERSION_ALL=y 189CONFIG_MODULE_SRCVERSION_ALL=y
194CONFIG_KMOD=y 190CONFIG_KMOD=y
@@ -197,6 +193,8 @@ CONFIG_KMOD=y
197# Block layer 193# Block layer
198# 194#
199# CONFIG_LBD is not set 195# CONFIG_LBD is not set
196# CONFIG_BLK_DEV_IO_TRACE is not set
197# CONFIG_LSF is not set
200 198
201# 199#
202# IO Schedulers 200# IO Schedulers
@@ -242,6 +240,7 @@ CONFIG_NET=y
242# 240#
243# Networking options 241# Networking options
244# 242#
243# CONFIG_NETDEBUG is not set
245CONFIG_PACKET=y 244CONFIG_PACKET=y
246CONFIG_PACKET_MMAP=y 245CONFIG_PACKET_MMAP=y
247CONFIG_UNIX=y 246CONFIG_UNIX=y
@@ -264,6 +263,7 @@ CONFIG_IP_PNP_BOOTP=y
264CONFIG_INET_AH=m 263CONFIG_INET_AH=m
265CONFIG_INET_ESP=m 264CONFIG_INET_ESP=m
266CONFIG_INET_IPCOMP=m 265CONFIG_INET_IPCOMP=m
266CONFIG_INET_XFRM_TUNNEL=m
267CONFIG_INET_TUNNEL=m 267CONFIG_INET_TUNNEL=m
268CONFIG_INET_DIAG=y 268CONFIG_INET_DIAG=y
269CONFIG_INET_TCP_DIAG=y 269CONFIG_INET_TCP_DIAG=y
@@ -305,9 +305,12 @@ CONFIG_IP_VS_NQ=m
305CONFIG_IP_VS_FTP=m 305CONFIG_IP_VS_FTP=m
306CONFIG_IPV6=m 306CONFIG_IPV6=m
307CONFIG_IPV6_PRIVACY=y 307CONFIG_IPV6_PRIVACY=y
308CONFIG_IPV6_ROUTER_PREF=y
309CONFIG_IPV6_ROUTE_INFO=y
308CONFIG_INET6_AH=m 310CONFIG_INET6_AH=m
309CONFIG_INET6_ESP=m 311CONFIG_INET6_ESP=m
310CONFIG_INET6_IPCOMP=m 312CONFIG_INET6_IPCOMP=m
313CONFIG_INET6_XFRM_TUNNEL=m
311CONFIG_INET6_TUNNEL=m 314CONFIG_INET6_TUNNEL=m
312CONFIG_IPV6_TUNNEL=m 315CONFIG_IPV6_TUNNEL=m
313CONFIG_NETFILTER=y 316CONFIG_NETFILTER=y
@@ -330,11 +333,14 @@ CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
330CONFIG_NETFILTER_XT_MATCH_CONNMARK=m 333CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
331CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m 334CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
332CONFIG_NETFILTER_XT_MATCH_DCCP=m 335CONFIG_NETFILTER_XT_MATCH_DCCP=m
336CONFIG_NETFILTER_XT_MATCH_ESP=m
333CONFIG_NETFILTER_XT_MATCH_HELPER=m 337CONFIG_NETFILTER_XT_MATCH_HELPER=m
334CONFIG_NETFILTER_XT_MATCH_LENGTH=m 338CONFIG_NETFILTER_XT_MATCH_LENGTH=m
335CONFIG_NETFILTER_XT_MATCH_LIMIT=m 339CONFIG_NETFILTER_XT_MATCH_LIMIT=m
336CONFIG_NETFILTER_XT_MATCH_MAC=m 340CONFIG_NETFILTER_XT_MATCH_MAC=m
337CONFIG_NETFILTER_XT_MATCH_MARK=m 341CONFIG_NETFILTER_XT_MATCH_MARK=m
342CONFIG_NETFILTER_XT_MATCH_POLICY=m
343CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
338CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m 344CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
339CONFIG_NETFILTER_XT_MATCH_REALM=m 345CONFIG_NETFILTER_XT_MATCH_REALM=m
340CONFIG_NETFILTER_XT_MATCH_SCTP=m 346CONFIG_NETFILTER_XT_MATCH_SCTP=m
@@ -357,20 +363,19 @@ CONFIG_IP_NF_IRC=m
357CONFIG_IP_NF_TFTP=m 363CONFIG_IP_NF_TFTP=m
358CONFIG_IP_NF_AMANDA=m 364CONFIG_IP_NF_AMANDA=m
359CONFIG_IP_NF_PPTP=m 365CONFIG_IP_NF_PPTP=m
366CONFIG_IP_NF_H323=m
360CONFIG_IP_NF_QUEUE=m 367CONFIG_IP_NF_QUEUE=m
361CONFIG_IP_NF_IPTABLES=m 368CONFIG_IP_NF_IPTABLES=m
362CONFIG_IP_NF_MATCH_IPRANGE=m 369CONFIG_IP_NF_MATCH_IPRANGE=m
363CONFIG_IP_NF_MATCH_MULTIPORT=m
364CONFIG_IP_NF_MATCH_TOS=m 370CONFIG_IP_NF_MATCH_TOS=m
365CONFIG_IP_NF_MATCH_RECENT=m 371CONFIG_IP_NF_MATCH_RECENT=m
366CONFIG_IP_NF_MATCH_ECN=m 372CONFIG_IP_NF_MATCH_ECN=m
367CONFIG_IP_NF_MATCH_DSCP=m 373CONFIG_IP_NF_MATCH_DSCP=m
368CONFIG_IP_NF_MATCH_AH_ESP=m 374CONFIG_IP_NF_MATCH_AH=m
369CONFIG_IP_NF_MATCH_TTL=m 375CONFIG_IP_NF_MATCH_TTL=m
370CONFIG_IP_NF_MATCH_OWNER=m 376CONFIG_IP_NF_MATCH_OWNER=m
371CONFIG_IP_NF_MATCH_ADDRTYPE=m 377CONFIG_IP_NF_MATCH_ADDRTYPE=m
372CONFIG_IP_NF_MATCH_HASHLIMIT=m 378CONFIG_IP_NF_MATCH_HASHLIMIT=m
373CONFIG_IP_NF_MATCH_POLICY=m
374CONFIG_IP_NF_FILTER=m 379CONFIG_IP_NF_FILTER=m
375CONFIG_IP_NF_TARGET_REJECT=m 380CONFIG_IP_NF_TARGET_REJECT=m
376CONFIG_IP_NF_TARGET_LOG=m 381CONFIG_IP_NF_TARGET_LOG=m
@@ -388,6 +393,7 @@ CONFIG_IP_NF_NAT_FTP=m
388CONFIG_IP_NF_NAT_TFTP=m 393CONFIG_IP_NF_NAT_TFTP=m
389CONFIG_IP_NF_NAT_AMANDA=m 394CONFIG_IP_NF_NAT_AMANDA=m
390CONFIG_IP_NF_NAT_PPTP=m 395CONFIG_IP_NF_NAT_PPTP=m
396CONFIG_IP_NF_NAT_H323=m
391CONFIG_IP_NF_MANGLE=m 397CONFIG_IP_NF_MANGLE=m
392CONFIG_IP_NF_TARGET_TOS=m 398CONFIG_IP_NF_TARGET_TOS=m
393CONFIG_IP_NF_TARGET_ECN=m 399CONFIG_IP_NF_TARGET_ECN=m
@@ -408,12 +414,10 @@ CONFIG_IP6_NF_MATCH_RT=m
408CONFIG_IP6_NF_MATCH_OPTS=m 414CONFIG_IP6_NF_MATCH_OPTS=m
409CONFIG_IP6_NF_MATCH_FRAG=m 415CONFIG_IP6_NF_MATCH_FRAG=m
410CONFIG_IP6_NF_MATCH_HL=m 416CONFIG_IP6_NF_MATCH_HL=m
411CONFIG_IP6_NF_MATCH_MULTIPORT=m
412CONFIG_IP6_NF_MATCH_OWNER=m 417CONFIG_IP6_NF_MATCH_OWNER=m
413CONFIG_IP6_NF_MATCH_IPV6HEADER=m 418CONFIG_IP6_NF_MATCH_IPV6HEADER=m
414CONFIG_IP6_NF_MATCH_AHESP=m 419CONFIG_IP6_NF_MATCH_AH=m
415CONFIG_IP6_NF_MATCH_EUI64=m 420CONFIG_IP6_NF_MATCH_EUI64=m
416CONFIG_IP6_NF_MATCH_POLICY=m
417CONFIG_IP6_NF_FILTER=m 421CONFIG_IP6_NF_FILTER=m
418CONFIG_IP6_NF_TARGET_LOG=m 422CONFIG_IP6_NF_TARGET_LOG=m
419CONFIG_IP6_NF_TARGET_REJECT=m 423CONFIG_IP6_NF_TARGET_REJECT=m
@@ -435,6 +439,11 @@ CONFIG_IP_SCTP=m
435# CONFIG_SCTP_HMAC_NONE is not set 439# CONFIG_SCTP_HMAC_NONE is not set
436# CONFIG_SCTP_HMAC_SHA1 is not set 440# CONFIG_SCTP_HMAC_SHA1 is not set
437CONFIG_SCTP_HMAC_MD5=y 441CONFIG_SCTP_HMAC_MD5=y
442
443#
444# TIPC Configuration (EXPERIMENTAL)
445#
446# CONFIG_TIPC is not set
438# CONFIG_ATM is not set 447# CONFIG_ATM is not set
439# CONFIG_BRIDGE is not set 448# CONFIG_BRIDGE is not set
440# CONFIG_VLAN_8021Q is not set 449# CONFIG_VLAN_8021Q is not set
@@ -444,11 +453,6 @@ CONFIG_SCTP_HMAC_MD5=y
444# CONFIG_ATALK is not set 453# CONFIG_ATALK is not set
445# CONFIG_X25 is not set 454# CONFIG_X25 is not set
446# CONFIG_LAPB is not set 455# CONFIG_LAPB is not set
447
448#
449# TIPC Configuration (EXPERIMENTAL)
450#
451# CONFIG_TIPC is not set
452CONFIG_NET_DIVERT=y 456CONFIG_NET_DIVERT=y
453# CONFIG_ECONET is not set 457# CONFIG_ECONET is not set
454# CONFIG_WAN_ROUTER is not set 458# CONFIG_WAN_ROUTER is not set
@@ -508,6 +512,9 @@ CONFIG_IEEE80211=m
508# CONFIG_IEEE80211_DEBUG is not set 512# CONFIG_IEEE80211_DEBUG is not set
509CONFIG_IEEE80211_CRYPT_WEP=m 513CONFIG_IEEE80211_CRYPT_WEP=m
510CONFIG_IEEE80211_CRYPT_CCMP=m 514CONFIG_IEEE80211_CRYPT_CCMP=m
515CONFIG_IEEE80211_SOFTMAC=m
516# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
517CONFIG_WIRELESS_EXT=y
511 518
512# 519#
513# Device Drivers 520# Device Drivers
@@ -546,7 +553,7 @@ CONFIG_CONNECTOR=m
546# CONFIG_BLK_DEV_LOOP is not set 553# CONFIG_BLK_DEV_LOOP is not set
547# CONFIG_BLK_DEV_NBD is not set 554# CONFIG_BLK_DEV_NBD is not set
548# CONFIG_BLK_DEV_RAM is not set 555# CONFIG_BLK_DEV_RAM is not set
549CONFIG_BLK_DEV_RAM_COUNT=16 556# CONFIG_BLK_DEV_INITRD is not set
550CONFIG_CDROM_PKTCDVD=m 557CONFIG_CDROM_PKTCDVD=m
551CONFIG_CDROM_PKTCDVD_BUFFERS=8 558CONFIG_CDROM_PKTCDVD_BUFFERS=8
552# CONFIG_CDROM_PKTCDVD_WCACHE is not set 559# CONFIG_CDROM_PKTCDVD_WCACHE is not set
@@ -812,10 +819,6 @@ CONFIG_MAX_RAW_DEVS=256
812# 819#
813 820
814# 821#
815# Multimedia Capabilities Port drivers
816#
817
818#
819# Multimedia devices 822# Multimedia devices
820# 823#
821# CONFIG_VIDEO_DEV is not set 824# CONFIG_VIDEO_DEV is not set
@@ -857,6 +860,7 @@ CONFIG_LOGO_SGI_CLUT224=y
857# 860#
858# CONFIG_USB_ARCH_HAS_HCD is not set 861# CONFIG_USB_ARCH_HAS_HCD is not set
859# CONFIG_USB_ARCH_HAS_OHCI is not set 862# CONFIG_USB_ARCH_HAS_OHCI is not set
863# CONFIG_USB_ARCH_HAS_EHCI is not set
860 864
861# 865#
862# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 866# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
@@ -873,12 +877,30 @@ CONFIG_LOGO_SGI_CLUT224=y
873# CONFIG_MMC is not set 877# CONFIG_MMC is not set
874 878
875# 879#
880# LED devices
881#
882# CONFIG_NEW_LEDS is not set
883
884#
885# LED drivers
886#
887
888#
889# LED Triggers
890#
891
892#
876# InfiniBand support 893# InfiniBand support
877# 894#
878 895
879# 896#
880# SN Devices 897# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
898#
899
900#
901# Real Time Clock
881# 902#
903# CONFIG_RTC_CLASS is not set
882 904
883# 905#
884# File systems 906# File systems
@@ -944,7 +966,6 @@ CONFIG_SYSFS=y
944# CONFIG_TMPFS is not set 966# CONFIG_TMPFS is not set
945# CONFIG_HUGETLB_PAGE is not set 967# CONFIG_HUGETLB_PAGE is not set
946CONFIG_RAMFS=y 968CONFIG_RAMFS=y
947CONFIG_RELAYFS_FS=m
948# CONFIG_CONFIGFS_FS is not set 969# CONFIG_CONFIGFS_FS is not set
949 970
950# 971#
@@ -963,7 +984,6 @@ CONFIG_EFS_FS=m
963# CONFIG_QNX4FS_FS is not set 984# CONFIG_QNX4FS_FS is not set
964# CONFIG_SYSV_FS is not set 985# CONFIG_SYSV_FS is not set
965CONFIG_UFS_FS=m 986CONFIG_UFS_FS=m
966# CONFIG_UFS_FS_WRITE is not set
967 987
968# 988#
969# Network File Systems 989# Network File Systems
@@ -1078,6 +1098,7 @@ CONFIG_NLS_UTF8=m
1078# CONFIG_MAGIC_SYSRQ is not set 1098# CONFIG_MAGIC_SYSRQ is not set
1079# CONFIG_DEBUG_KERNEL is not set 1099# CONFIG_DEBUG_KERNEL is not set
1080CONFIG_LOG_BUF_SHIFT=14 1100CONFIG_LOG_BUF_SHIFT=14
1101# CONFIG_DEBUG_FS is not set
1081CONFIG_CROSSCOMPILE=y 1102CONFIG_CROSSCOMPILE=y
1082CONFIG_CMDLINE="" 1103CONFIG_CMDLINE=""
1083 1104
diff --git a/arch/mips/galileo-boards/ev96100/Makefile b/arch/mips/galileo-boards/ev96100/Makefile
index 58c02f9db69d..cd868ec78cbc 100644
--- a/arch/mips/galileo-boards/ev96100/Makefile
+++ b/arch/mips/galileo-boards/ev96100/Makefile
@@ -6,4 +6,4 @@
6# Makefile for the Galileo EV96100 board. 6# Makefile for the Galileo EV96100 board.
7# 7#
8 8
9obj-y += init.o irq.o puts.o reset.o time.o int-handler.o setup.o 9obj-y += init.o irq.o puts.o reset.o time.o setup.o
diff --git a/arch/mips/galileo-boards/ev96100/int-handler.S b/arch/mips/galileo-boards/ev96100/int-handler.S
deleted file mode 100644
index ff4d10a38859..000000000000
--- a/arch/mips/galileo-boards/ev96100/int-handler.S
+++ /dev/null
@@ -1,33 +0,0 @@
1#include <asm/asm.h>
2#include <asm/mipsregs.h>
3#include <asm/regdef.h>
4#include <asm/stackframe.h>
5
6 .set noat
7 .align 5
8
9NESTED(ev96100IRQ, PT_SIZE, sp)
10 SAVE_ALL
11 CLI # Important: mark KERNEL mode !
12
13 mfc0 t0, CP0_CAUSE # get pending interrupts
14 mfc0 t1, CP0_STATUS # get enabled interrupts
15 and t0, t1 # isolate allowed ones
16
17 # FIX ME add R7000 extensions
18 andi t0,0xff00 # isolate pending bits
19 andi a0, t0, CAUSEF_IP7
20 beq a0, zero, 1f
21 move a0, sp
22 jal mips_timer_interrupt
23 j ret_from_irq
24
251: beqz t0, 3f # spurious interrupt
26
27 move a0, t0
28 move a1, sp
29 jal ev96100_cpu_irq
30 j ret_from_irq
31
323: j spurious_interrupt
33 END(ev96100IRQ)
diff --git a/arch/mips/galileo-boards/ev96100/irq.c b/arch/mips/galileo-boards/ev96100/irq.c
index 97bf094da4fe..ee5d6720f23b 100644
--- a/arch/mips/galileo-boards/ev96100/irq.c
+++ b/arch/mips/galileo-boards/ev96100/irq.c
@@ -40,8 +40,6 @@
40#include <linux/interrupt.h> 40#include <linux/interrupt.h>
41#include <asm/irq_cpu.h> 41#include <asm/irq_cpu.h>
42 42
43extern asmlinkage void ev96100IRQ(void);
44
45static inline unsigned int ffz8(unsigned int word) 43static inline unsigned int ffz8(unsigned int word)
46{ 44{
47 unsigned long k; 45 unsigned long k;
@@ -54,13 +52,26 @@ static inline unsigned int ffz8(unsigned int word)
54 return k; 52 return k;
55} 53}
56 54
57asmlinkage void ev96100_cpu_irq(unsigned int pendin) 55extern void mips_timer_interrupt(struct pt_regs *regs);
56
57asmlinkage void ev96100_cpu_irq(unsigned int pending, struct pt_regs *regs)
58{ 58{
59 do_IRQ(ffz8(pending >> 8), regs); 59 do_IRQ(ffz8(pending >> 8), regs);
60} 60}
61 61
62asmlinkage void plat_irq_dispatch(struct pt_regs *regs)
63{
64 unsigned int pending = read_c0_cause() & read_c0_status() & ST0_IM;
65
66 if (pending & CAUSEF_IP7)
67 mips_timer_interrupt(regs);
68 else if (pending)
69 ev96100_cpu_irq(pending, regs);
70 else
71 spurious_interrupt(regs);
72}
73
62void __init arch_init_irq(void) 74void __init arch_init_irq(void)
63{ 75{
64 set_except_vector(0, ev96100IRQ);
65 mips_cpu_irq_init(0); 76 mips_cpu_irq_init(0);
66} 77}
diff --git a/arch/mips/gt64120/ev64120/Makefile b/arch/mips/gt64120/ev64120/Makefile
index ebe91c57e173..b2c53a8f8718 100644
--- a/arch/mips/gt64120/ev64120/Makefile
+++ b/arch/mips/gt64120/ev64120/Makefile
@@ -6,6 +6,6 @@
6# Makefile for the Galileo EV64120 board. 6# Makefile for the Galileo EV64120 board.
7# 7#
8 8
9obj-y += int-handler.o irq.o promcon.o reset.o serialGT.o setup.o 9obj-y += irq.o promcon.o reset.o serialGT.o setup.o
10 10
11EXTRA_AFLAGS := $(CFLAGS) 11EXTRA_AFLAGS := $(CFLAGS)
diff --git a/arch/mips/gt64120/ev64120/int-handler.S b/arch/mips/gt64120/ev64120/int-handler.S
deleted file mode 100644
index 752435faf2de..000000000000
--- a/arch/mips/gt64120/ev64120/int-handler.S
+++ /dev/null
@@ -1,113 +0,0 @@
1/*
2 * int-handler.S
3 *
4 * Based on the cobalt handler.
5 */
6#include <asm/asm.h>
7#include <asm/mipsregs.h>
8#include <asm/addrspace.h>
9#include <asm/regdef.h>
10#include <asm/stackframe.h>
11
12/*
13 * galileo_handle_int -
14 * We check for the timer first, then check PCI ints A and D.
15 * Then check for serial IRQ and fall through.
16 */
17 .align 5
18 .set reorder
19 .set noat
20 NESTED(galileo_handle_int, PT_SIZE, sp)
21 SAVE_ALL
22 CLI
23 .set at
24 mfc0 t0,CP0_CAUSE
25 mfc0 t2,CP0_STATUS
26
27 and t0,t2
28
29 andi t1,t0,STATUSF_IP4 /* int2 hardware line (timer) */
30 bnez t1,ll_gt64120_irq
31 andi t1,t0,STATUSF_IP2 /* int0 hardware line */
32 bnez t1,ll_pci_intA
33 andi t1,t0,STATUSF_IP5 /* int3 hardware line */
34 bnez t1,ll_pci_intD
35 andi t1,t0,STATUSF_IP6 /* int4 hardware line */
36 bnez t1,ll_serial_irq
37 andi t1,t0,STATUSF_IP7 /* compare int */
38 bnez t1,ll_compare_irq
39 nop
40
41 /* wrong alarm or masked ... */
42 j spurious_interrupt
43 nop
44 END(galileo_handle_int)
45
46
47 .align 5
48 .set reorder
49ll_gt64120_irq:
50 li a0,4
51 move a1,sp
52 jal do_IRQ
53 nop
54 j ret_from_irq
55 nop
56
57 .align 5
58 .set reorder
59ll_compare_irq:
60 li a0,7
61 move a1,sp
62 jal do_IRQ
63 nop
64 j ret_from_irq
65 nop
66
67 .align 5
68 .set reorder
69ll_pci_intA:
70 move a0,sp
71 jal pci_intA
72 nop
73 j ret_from_irq
74 nop
75
76#if 0
77 .align 5
78 .set reorder
79ll_pci_intB:
80 move a0,sp
81 jal pci_intB
82 nop
83 j ret_from_irq
84 nop
85
86 .align 5
87 .set reorder
88ll_pci_intC:
89 move a0,sp
90 jal pci_intC
91 nop
92 j ret_from_irq
93 nop
94#endif
95
96 .align 5
97 .set reorder
98ll_pci_intD:
99 move a0,sp
100 jal pci_intD
101 nop
102 j ret_from_irq
103 nop
104
105 .align 5
106 .set reorder
107ll_serial_irq:
108 li a0,6
109 move a1,sp
110 jal do_IRQ
111 nop
112 j ret_from_irq
113 nop
diff --git a/arch/mips/gt64120/ev64120/irq.c b/arch/mips/gt64120/ev64120/irq.c
index 3b186159b21a..46c468b26b30 100644
--- a/arch/mips/gt64120/ev64120/irq.c
+++ b/arch/mips/gt64120/ev64120/irq.c
@@ -46,14 +46,22 @@
46#include <asm/system.h> 46#include <asm/system.h>
47#include <asm/gt64120.h> 47#include <asm/gt64120.h>
48 48
49asmlinkage inline void pci_intA(struct pt_regs *regs) 49asmlinkage void plat_irq_dispatch(struct pt_regs *regs)
50{ 50{
51 do_IRQ(GT_INTA, regs); 51 unsigned int pending = read_c0_status() & read_c0_cause();
52} 52
53 53 if (pending & STATUSF_IP4) /* int2 hardware line (timer) */
54asmlinkage inline void pci_intD(struct pt_regs *regs) 54 do_IRQ(4, regs);
55{ 55 else if (pending & STATUSF_IP2) /* int0 hardware line */
56 do_IRQ(GT_INTD, regs); 56 do_IRQ(GT_INTA, regs);
57 else if (pending & STATUSF_IP5) /* int3 hardware line */
58 do_IRQ(GT_INTD, regs);
59 else if (pending & STATUSF_IP6) /* int4 hardware line */
60 do_IRQ(6, regs);
61 else if (pending & STATUSF_IP7) /* compare int */
62 do_IRQ(7, regs);
63 else
64 spurious_interrupt(regs);
57} 65}
58 66
59static void disable_ev64120_irq(unsigned int irq_nr) 67static void disable_ev64120_irq(unsigned int irq_nr)
@@ -109,16 +117,11 @@ static struct hw_interrupt_type ev64120_irq_type = {
109 117
110void gt64120_irq_setup(void) 118void gt64120_irq_setup(void)
111{ 119{
112 extern asmlinkage void galileo_handle_int(void);
113
114 /* 120 /*
115 * Clear all of the interrupts while we change the able around a bit. 121 * Clear all of the interrupts while we change the able around a bit.
116 */ 122 */
117 clear_c0_status(ST0_IM); 123 clear_c0_status(ST0_IM);
118 124
119 /* Sets the exception_handler array. */
120 set_except_vector(0, galileo_handle_int);
121
122 local_irq_disable(); 125 local_irq_disable();
123 126
124 /* 127 /*
diff --git a/arch/mips/gt64120/ev64120/serialGT.c b/arch/mips/gt64120/ev64120/serialGT.c
index 16e34a546e54..8f0d835491ff 100644
--- a/arch/mips/gt64120/ev64120/serialGT.c
+++ b/arch/mips/gt64120/ev64120/serialGT.c
@@ -149,7 +149,7 @@ void serial_set(int channel, unsigned long baud)
149#else 149#else
150 /* 150 /*
151 * Note: Set baud rate, hardcoded here for rate of 115200 151 * Note: Set baud rate, hardcoded here for rate of 115200
152 * since became unsure of above "buad rate" algorithm (??). 152 * since became unsure of above "baud rate" algorithm (??).
153 */ 153 */
154 outreg(channel, LCR, 0x83); 154 outreg(channel, LCR, 0x83);
155 outreg(channel, DLM, 0x00); // See note above 155 outreg(channel, DLM, 0x00); // See note above
diff --git a/arch/mips/gt64120/momenco_ocelot/Makefile b/arch/mips/gt64120/momenco_ocelot/Makefile
index 7b59c6567c79..6f708df8373b 100644
--- a/arch/mips/gt64120/momenco_ocelot/Makefile
+++ b/arch/mips/gt64120/momenco_ocelot/Makefile
@@ -2,7 +2,7 @@
2# Makefile for Momentum's Ocelot board. 2# Makefile for Momentum's Ocelot board.
3# 3#
4 4
5obj-y += int-handler.o irq.o prom.o reset.o setup.o 5obj-y += irq.o prom.o reset.o setup.o
6 6
7obj-$(CONFIG_KGDB) += dbg_io.o 7obj-$(CONFIG_KGDB) += dbg_io.o
8 8
diff --git a/arch/mips/gt64120/momenco_ocelot/dbg_io.c b/arch/mips/gt64120/momenco_ocelot/dbg_io.c
index 8720bccfdea2..f0a6a38fcf4d 100644
--- a/arch/mips/gt64120/momenco_ocelot/dbg_io.c
+++ b/arch/mips/gt64120/momenco_ocelot/dbg_io.c
@@ -73,7 +73,7 @@ void debugInit(uint32 baud, uint8 data, uint8 parity, uint8 stop)
73 /* disable interrupts */ 73 /* disable interrupts */
74 UART16550_WRITE(OFS_INTR_ENABLE, 0); 74 UART16550_WRITE(OFS_INTR_ENABLE, 0);
75 75
76 /* set up buad rate */ 76 /* set up baud rate */
77 { 77 {
78 uint32 divisor; 78 uint32 divisor;
79 79
diff --git a/arch/mips/gt64120/momenco_ocelot/int-handler.S b/arch/mips/gt64120/momenco_ocelot/int-handler.S
deleted file mode 100644
index 808acef248cc..000000000000
--- a/arch/mips/gt64120/momenco_ocelot/int-handler.S
+++ /dev/null
@@ -1,131 +0,0 @@
1/*
2 * Copyright 2001 MontaVista Software Inc.
3 * Author: jsun@mvista.com or jsun@junsun.net
4 *
5 * First-level interrupt dispatcher for ocelot board.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 */
12#include <asm/asm.h>
13#include <asm/mipsregs.h>
14#include <asm/addrspace.h>
15#include <asm/regdef.h>
16#include <asm/stackframe.h>
17
18/*
19 * first level interrupt dispatcher for ocelot board -
20 * We check for the timer first, then check PCI ints A and D.
21 * Then check for serial IRQ and fall through.
22 */
23 .align 5
24 NESTED(ocelot_handle_int, PT_SIZE, sp)
25 SAVE_ALL
26 CLI
27 .set at
28 mfc0 t0, CP0_CAUSE
29 mfc0 t2, CP0_STATUS
30
31 and t0, t2
32
33 andi t1, t0, STATUSF_IP2 /* int0 hardware line */
34 bnez t1, ll_pri_enet_irq
35 andi t1, t0, STATUSF_IP3 /* int1 hardware line */
36 bnez t1, ll_sec_enet_irq
37 andi t1, t0, STATUSF_IP4 /* int2 hardware line */
38 bnez t1, ll_uart1_irq
39 andi t1, t0, STATUSF_IP5 /* int3 hardware line */
40 bnez t1, ll_cpci_irq
41 andi t1, t0, STATUSF_IP6 /* int4 hardware line */
42 bnez t1, ll_galileo_irq
43 andi t1, t0, STATUSF_IP7 /* cpu timer */
44 bnez t1, ll_cputimer_irq
45
46 /* now look at the extended interrupts */
47 mfc0 t0, CP0_CAUSE
48 cfc0 t1, CP0_S1_INTCONTROL
49
50 /* shift the mask 8 bits left to line up the bits */
51 sll t2, t1, 8
52
53 and t0, t2
54 srl t0, t0, 16
55
56 andi t1, t0, STATUSF_IP8 /* int6 hardware line */
57 bnez t1, ll_pmc1_irq
58 andi t1, t0, STATUSF_IP9 /* int7 hardware line */
59 bnez t1, ll_pmc2_irq
60 andi t1, t0, STATUSF_IP10 /* int8 hardware line */
61 bnez t1, ll_cpci_abcd_irq
62 andi t1, t0, STATUSF_IP11 /* int9 hardware line */
63 bnez t1, ll_uart2_irq
64
65 .set reorder
66
67 /* wrong alarm or masked ... */
68 j spurious_interrupt
69 nop
70 END(ocelot_handle_int)
71
72 .align 5
73ll_pri_enet_irq:
74 li a0, 2
75 move a1, sp
76 jal do_IRQ
77 j ret_from_irq
78
79ll_sec_enet_irq:
80 li a0, 3
81 move a1, sp
82 jal do_IRQ
83 j ret_from_irq
84
85ll_uart1_irq:
86 li a0, 4
87 move a1, sp
88 jal do_IRQ
89 j ret_from_irq
90
91ll_cpci_irq:
92 li a0, 5
93 move a1, sp
94 jal do_IRQ
95 j ret_from_irq
96
97ll_galileo_irq:
98 li a0, 6
99 move a1, sp
100 jal do_IRQ
101 j ret_from_irq
102
103ll_cputimer_irq:
104 li a0, 7
105 move a1, sp
106 jal do_IRQ
107 j ret_from_irq
108
109ll_pmc1_irq:
110 li a0, 8
111 move a1, sp
112 jal do_IRQ
113 j ret_from_irq
114
115ll_pmc2_irq:
116 li a0, 9
117 move a1, sp
118 jal do_IRQ
119 j ret_from_irq
120
121ll_cpci_abcd_irq:
122 li a0, 10
123 move a1, sp
124 jal do_IRQ
125 j ret_from_irq
126
127ll_uart2_irq:
128 li a0, 11
129 move a1, sp
130 jal do_IRQ
131 j ret_from_irq
diff --git a/arch/mips/gt64120/momenco_ocelot/irq.c b/arch/mips/gt64120/momenco_ocelot/irq.c
index 4f108da71b23..885f67f32ea3 100644
--- a/arch/mips/gt64120/momenco_ocelot/irq.c
+++ b/arch/mips/gt64120/momenco_ocelot/irq.c
@@ -48,7 +48,38 @@
48#include <asm/mipsregs.h> 48#include <asm/mipsregs.h>
49#include <asm/system.h> 49#include <asm/system.h>
50 50
51extern asmlinkage void ocelot_handle_int(void); 51asmlinkage void plat_irq_dispatch(struct pt_regs *regs)
52{
53 unsigned int pending = read_c0_status() & read_c0_cause();
54
55 if (pending & STATUSF_IP2) /* int0 hardware line */
56 do_IRQ(2, regs);
57 else if (pending & STATUSF_IP3) /* int1 hardware line */
58 do_IRQ(3, regs);
59 else if (pending & STATUSF_IP4) /* int2 hardware line */
60 do_IRQ(4, regs);
61 else if (pending & STATUSF_IP5) /* int3 hardware line */
62 do_IRQ(5, regs);
63 else if (pending & STATUSF_IP6) /* int4 hardware line */
64 do_IRQ(6, regs);
65 else if (pending & STATUSF_IP7) /* cpu timer */
66 do_IRQ(7, regs);
67 else {
68 /*
69 * Now look at the extended interrupts
70 */
71 pending = (read_c0_cause() & (read_c0_intcontrol() << 8)) >> 16;
72
73 if (pending & STATUSF_IP8) /* int6 hardware line */
74 do_IRQ(8, regs);
75 else if (pending & STATUSF_IP9) /* int7 hardware line */
76 do_IRQ(9, regs);
77 else if (pending & STATUSF_IP10) /* int8 hardware line */
78 do_IRQ(10, regs);
79 else if (pending & STATUSF_IP11) /* int9 hardware line */
80 do_IRQ(11, regs);
81 }
82}
52 83
53void __init arch_init_irq(void) 84void __init arch_init_irq(void)
54{ 85{
@@ -59,9 +90,6 @@ void __init arch_init_irq(void)
59 clear_c0_status(ST0_IM); 90 clear_c0_status(ST0_IM);
60 local_irq_disable(); 91 local_irq_disable();
61 92
62 /* Sets the first-level interrupt dispatcher. */
63 set_except_vector(0, ocelot_handle_int);
64
65 mips_cpu_irq_init(0); 93 mips_cpu_irq_init(0);
66 rm7k_cpu_irq_init(8); 94 rm7k_cpu_irq_init(8);
67} 95}
diff --git a/arch/mips/ite-boards/generic/Makefile b/arch/mips/ite-boards/generic/Makefile
index 0e7853f43983..63431538d0ec 100644
--- a/arch/mips/ite-boards/generic/Makefile
+++ b/arch/mips/ite-boards/generic/Makefile
@@ -6,7 +6,7 @@
6# Makefile for the ITE 8172 (qed-4n-s01b) board, generic files. 6# Makefile for the ITE 8172 (qed-4n-s01b) board, generic files.
7# 7#
8 8
9obj-y += it8172_setup.o irq.o int-handler.o pmon_prom.o \ 9obj-y += it8172_setup.o irq.o pmon_prom.o \
10 time.o lpc.o puts.o reset.o 10 time.o lpc.o puts.o reset.o
11 11
12obj-$(CONFIG_IT8172_CIR)+= it8172_cir.o 12obj-$(CONFIG_IT8172_CIR)+= it8172_cir.o
diff --git a/arch/mips/ite-boards/generic/dbg_io.c b/arch/mips/ite-boards/generic/dbg_io.c
index c4f8530fd07e..6a7ccaf93502 100644
--- a/arch/mips/ite-boards/generic/dbg_io.c
+++ b/arch/mips/ite-boards/generic/dbg_io.c
@@ -72,7 +72,7 @@ void debugInit(uint32 baud, uint8 data, uint8 parity, uint8 stop)
72 /* disable interrupts */ 72 /* disable interrupts */
73 UART16550_WRITE(OFS_INTR_ENABLE, 0); 73 UART16550_WRITE(OFS_INTR_ENABLE, 0);
74 74
75 /* set up buad rate */ 75 /* set up baud rate */
76 { 76 {
77 uint32 divisor; 77 uint32 divisor;
78 78
diff --git a/arch/mips/ite-boards/generic/int-handler.S b/arch/mips/ite-boards/generic/int-handler.S
deleted file mode 100644
index d190d8add9cb..000000000000
--- a/arch/mips/ite-boards/generic/int-handler.S
+++ /dev/null
@@ -1,63 +0,0 @@
1#include <asm/asm.h>
2#include <asm/mipsregs.h>
3#include <asm/regdef.h>
4#include <asm/stackframe.h>
5
6 .text
7 .set macro
8 .set noat
9 .align 5
10
11NESTED(it8172_IRQ, PT_SIZE, sp)
12 SAVE_ALL
13 CLI # Important: mark KERNEL mode !
14
15 /* We're working with 'reorder' set at this point. */
16 /*
17 * Get pending interrupts
18 */
19
20 mfc0 t0,CP0_CAUSE # get pending interrupts
21 mfc0 t1,CP0_STATUS # get enabled interrupts
22 and t0,t1 # isolate allowed ones
23
24 andi t0,0xff00 # isolate pending bits
25 beqz t0, 3f # spurious interrupt
26
27 andi a0, t0, CAUSEF_IP7
28 beq a0, zero, 1f
29
30 li a0, 127 # MIPS_CPU_TIMER_IRQ = (NR_IRQS-1)
31 move a1, sp
32 jal ll_timer_interrupt
33 j ret_from_irq
34 nop
35
361:
37 andi a0, t0, CAUSEF_IP2 # the only int we expect at this time
38 beq a0, zero, 3f
39 move a0,sp
40 jal it8172_hw0_irqdispatch
41
42 mfc0 t0,CP0_STATUS # disable interrupts
43 ori t0,1
44 xori t0,1
45 mtc0 t0,CP0_STATUS
46 nop
47 nop
48 nop
49
50 la a1, ret_from_irq
51 jr a1
52 nop
53
543:
55 move a0, sp
56 jal mips_spurious_interrupt
57 nop
58 la a1, ret_from_irq
59 jr a1
60 nop
61
62END(it8172_IRQ)
63
diff --git a/arch/mips/ite-boards/generic/irq.c b/arch/mips/ite-boards/generic/irq.c
index e67f96129491..77be7216bdd0 100644
--- a/arch/mips/ite-boards/generic/irq.c
+++ b/arch/mips/ite-boards/generic/irq.c
@@ -62,12 +62,8 @@
62 62
63#define ALLINTS_NOTIMER (IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4) 63#define ALLINTS_NOTIMER (IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4)
64 64
65void disable_it8172_irq(unsigned int irq_nr);
66void enable_it8172_irq(unsigned int irq_nr);
67
68extern void set_debug_traps(void); 65extern void set_debug_traps(void);
69extern void mips_timer_interrupt(int irq, struct pt_regs *regs); 66extern void mips_timer_interrupt(int irq, struct pt_regs *regs);
70extern asmlinkage void it8172_IRQ(void);
71 67
72struct it8172_intc_regs volatile *it8172_hw0_icregs = 68struct it8172_intc_regs volatile *it8172_hw0_icregs =
73 (struct it8172_intc_regs volatile *)(KSEG1ADDR(IT8172_PCI_IO_BASE + IT_INTC_BASE)); 69 (struct it8172_intc_regs volatile *)(KSEG1ADDR(IT8172_PCI_IO_BASE + IT_INTC_BASE));
@@ -181,8 +177,6 @@ void __init arch_init_irq(void)
181 int i; 177 int i;
182 unsigned long flags; 178 unsigned long flags;
183 179
184 set_except_vector(0, it8172_IRQ);
185
186 /* mask all interrupts */ 180 /* mask all interrupts */
187 it8172_hw0_icregs->lb_mask = 0xffff; 181 it8172_hw0_icregs->lb_mask = 0xffff;
188 it8172_hw0_icregs->lpc_mask = 0xffff; 182 it8172_hw0_icregs->lpc_mask = 0xffff;
@@ -282,6 +276,18 @@ void it8172_hw0_irqdispatch(struct pt_regs *regs)
282 do_IRQ(irq, regs); 276 do_IRQ(irq, regs);
283} 277}
284 278
279asmlinkage void plat_irq_dispatch(struct pt_regs *regs)
280{
281 unsigned int pending = read_c0_cause() & read_c0_status() & ST0_IM;
282
283 if (!pending)
284 mips_spurious_interrupt(regs);
285 else if (pending & CAUSEF_IP7)
286 ll_timer_interrupt(127, regs);
287 else if (pending & CAUSEF_IP2)
288 it8172_hw0_irqdispatch(regs);
289}
290
285void show_pending_irqs(void) 291void show_pending_irqs(void)
286{ 292{
287 fputs("intstatus: "); 293 fputs("intstatus: ");
diff --git a/arch/mips/ite-boards/generic/time.c b/arch/mips/ite-boards/generic/time.c
index b79817bb6cce..dee497a91807 100644
--- a/arch/mips/ite-boards/generic/time.c
+++ b/arch/mips/ite-boards/generic/time.c
@@ -29,6 +29,7 @@
29#include <linux/sched.h> 29#include <linux/sched.h>
30#include <linux/time.h> 30#include <linux/time.h>
31#include <linux/spinlock.h> 31#include <linux/spinlock.h>
32#include <linux/mc146818rtc.h>
32 33
33#include <asm/time.h> 34#include <asm/time.h>
34#include <asm/mipsregs.h> 35#include <asm/mipsregs.h>
diff --git a/arch/mips/ite-boards/ivr/init.c b/arch/mips/ite-boards/ivr/init.c
index b774db035b31..05cf9218c432 100644
--- a/arch/mips/ite-boards/ivr/init.c
+++ b/arch/mips/ite-boards/ivr/init.c
@@ -34,13 +34,13 @@
34#include <asm/bootinfo.h> 34#include <asm/bootinfo.h>
35#include <linux/string.h> 35#include <linux/string.h>
36#include <linux/kernel.h> 36#include <linux/kernel.h>
37#include <asm/sections.h>
37#include <asm/it8172/it8172.h> 38#include <asm/it8172/it8172.h>
38#include <asm/it8172/it8172_dbg.h> 39#include <asm/it8172/it8172_dbg.h>
39 40
40int prom_argc; 41int prom_argc;
41char **prom_argv, **prom_envp; 42char **prom_argv, **prom_envp;
42 43
43extern char _end;
44extern void __init prom_init_cmdline(void); 44extern void __init prom_init_cmdline(void);
45extern unsigned long __init prom_get_memsize(void); 45extern unsigned long __init prom_get_memsize(void);
46extern void __init it8172_init_ram_resource(unsigned long memsize); 46extern void __init it8172_init_ram_resource(unsigned long memsize);
diff --git a/arch/mips/ite-boards/qed-4n-s01b/init.c b/arch/mips/ite-boards/qed-4n-s01b/init.c
index e8ec8be66a80..ea2a754cafe5 100644
--- a/arch/mips/ite-boards/qed-4n-s01b/init.c
+++ b/arch/mips/ite-boards/qed-4n-s01b/init.c
@@ -34,13 +34,13 @@
34#include <asm/bootinfo.h> 34#include <asm/bootinfo.h>
35#include <linux/string.h> 35#include <linux/string.h>
36#include <linux/kernel.h> 36#include <linux/kernel.h>
37#include <asm/sections.h>
37#include <asm/it8172/it8172.h> 38#include <asm/it8172/it8172.h>
38#include <asm/it8172/it8172_dbg.h> 39#include <asm/it8172/it8172_dbg.h>
39 40
40int prom_argc; 41int prom_argc;
41char **prom_argv, **prom_envp; 42char **prom_argv, **prom_envp;
42 43
43extern char _end;
44extern void __init prom_init_cmdline(void); 44extern void __init prom_init_cmdline(void);
45extern unsigned long __init prom_get_memsize(void); 45extern unsigned long __init prom_get_memsize(void);
46extern void __init it8172_init_ram_resource(unsigned long memsize); 46extern void __init it8172_init_ram_resource(unsigned long memsize);
diff --git a/arch/mips/jazz/Makefile b/arch/mips/jazz/Makefile
index 85749246a671..02bd39add891 100644
--- a/arch/mips/jazz/Makefile
+++ b/arch/mips/jazz/Makefile
@@ -2,6 +2,6 @@
2# Makefile for the Jazz family specific parts of the kernel 2# Makefile for the Jazz family specific parts of the kernel
3# 3#
4 4
5obj-y := int-handler.o irq.o jazzdma.o reset.o setup.o 5obj-y := irq.o jazzdma.o reset.o setup.o
6 6
7EXTRA_AFLAGS := $(CFLAGS) 7EXTRA_AFLAGS := $(CFLAGS)
diff --git a/arch/mips/jazz/int-handler.S b/arch/mips/jazz/int-handler.S
deleted file mode 100644
index dc752c67b528..000000000000
--- a/arch/mips/jazz/int-handler.S
+++ /dev/null
@@ -1,282 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 1995, 1996, 1997, 1998 by Ralf Baechle and Andreas Busse
7 *
8 * Jazz family specific interrupt stuff
9 *
10 * To do: On Jazz machines we remap some non-ISA interrupts to ISA
11 * interrupts. These interrupts should use their own vectors.
12 * Squeeze the last cycles out of the handlers. Only a dead
13 * cycle is a good cycle.
14 */
15#include <asm/asm.h>
16#include <asm/mipsregs.h>
17#include <asm/jazz.h>
18#include <asm/regdef.h>
19#include <asm/stackframe.h>
20
21/*
22 * jazz_handle_int: Interrupt handler for the ACER Pica-61 boards
23 */
24 .set noreorder
25
26 NESTED(jazz_handle_int, PT_SIZE, ra)
27 .set noat
28 SAVE_ALL
29 CLI
30 .set at
31
32 /*
33 * Get pending interrupts
34 */
35 mfc0 t0,CP0_CAUSE # get pending interrupts
36 mfc0 t1,CP0_STATUS # get enabled interrupts
37 and t0,t1 # isolate allowed ones
38 andi t0,0xff00 # isolate pending bits
39 beqz t0,3f
40 sll t0,16 # delay slot
41
42 /*
43 * Find irq with highest priority
44 * FIXME: This is slow - use binary search
45 */
46 la t1,ll_vectors
471: bltz t0,2f # found pending irq
48 sll t0,1
49 b 1b
50 subu t1,PTRSIZE # delay slot
51
52 /*
53 * Do the low-level stuff
54 */
552: lw t0,(t1)
56 jr t0
57 nop # delay slot
58 END(jazz_handle_int)
59
60ll_sw0: li s1,~IE_SW0
61 mfc0 t0,CP0_CAUSE
62 and t0,s1
63 mtc0 t0,CP0_CAUSE
64 PANIC("Unimplemented sw0 handler")
65
66ll_sw1: li s1,~IE_SW1
67 mfc0 t0,CP0_CAUSE
68 and t0,s1
69 mtc0 t0,CP0_CAUSE
70 PANIC("Unimplemented sw1 handler")
71
72ll_local_dma: li s1,~IE_IRQ0
73 PANIC("Unimplemented local_dma handler")
74
75ll_local_dev: lbu t0,JAZZ_IO_IRQ_SOURCE
76#if PTRSIZE == 8 /* True 64 bit kernel */
77 dsll t0,1
78#endif
79 .set reorder
80 LONG_L t0,local_vector(t0)
81 jr t0
82 .set noreorder
83
84/*
85 * The braindead PICA hardware gives us no way to distinguish if we really
86 * received interrupt 7 from the (E)ISA bus or if we just received an
87 * interrupt with no findable cause. This sometimes happens with braindead
88 * cards. Oh well - for all the Jazz boxes slots are more or less just
89 * whistles and bells and we're aware of the problem.
90 */
91ll_isa_irq: lw a0, JAZZ_EISA_IRQ_ACK
92
93 jal do_IRQ
94 move a1,sp
95
96 j ret_from_irq
97 nop
98
99/*
100 * Hmm... This is not just a plain PC clone so the question is
101 * which devices on Jazz machines can generate an (E)ISA NMI?
102 * (Writing to nonexistent memory?)
103 */
104ll_isa_nmi: li s1,~IE_IRQ3
105 PANIC("Unimplemented isa_nmi handler")
106
107/*
108 * Timer IRQ - remapped to be more similar to an IBM compatible.
109 *
110 * The timer interrupt is handled specially to ensure that the jiffies
111 * variable is updated at all times. Specifically, the timer interrupt is
112 * just like the complete handlers except that it is invoked with interrupts
113 * disabled and should never re-enable them. If other interrupts were
114 * allowed to be processed while the timer interrupt is active, then the
115 * other interrupts would have to avoid using the jiffies variable for delay
116 * and interval timing operations to avoid hanging the system.
117 */
118ll_timer: lw zero,JAZZ_TIMER_REGISTER # timer irq cleared on read
119 li s1,~IE_IRQ4
120
121 li a0, JAZZ_TIMER_IRQ
122 jal do_IRQ
123 move a1,sp
124
125 mfc0 t0,CP0_STATUS # disable interrupts again
126 ori t0,1
127 xori t0,1
128 mtc0 t0,CP0_STATUS
129
130 j ret_from_irq
131 nop
132
133/*
134 * CPU count/compare IRQ (unused)
135 */
136ll_count: j ret_from_irq
137 mtc0 zero,CP0_COMPARE
138
139#if 0
140/*
141 * Call the handler for the interrupt
142 * (Currently unused)
143 */
144call_real: /*
145 * temporarily disable interrupt
146 */
147 mfc0 t2,CP0_STATUS
148 and t2,s1
149 mtc0 t2,CP0_STATUS
150 nor s1,zero,s1
151 jal do_IRQ
152
153 /*
154 * reenable interrupt
155 */
156 mfc0 t2,CP0_STATUS
157 or t2,s1
158 mtc0 t2,CP0_STATUS
159 j ret_from_irq
160#endif
161
162 .data
163 PTR ll_sw0 # SW0
164 PTR ll_sw1 # SW1
165 PTR ll_local_dma # Local DMA
166 PTR ll_local_dev # Local devices
167 PTR ll_isa_irq # ISA IRQ
168 PTR ll_isa_nmi # ISA NMI
169 PTR ll_timer # Timer
170ll_vectors: PTR ll_count # Count/Compare IRQ
171
172 /*
173 * Interrupt handlers for local devices.
174 */
175 .text
176 .set reorder
177loc_no_irq: PANIC("Unimplemented loc_no_irq handler")
178/*
179 * Parallel port IRQ
180 */
181loc_parallel: li s1,~JAZZ_IE_PARALLEL
182 li a0,JAZZ_PARALLEL_IRQ
183 b loc_call
184
185/*
186 * Floppy IRQ
187 */
188loc_floppy: li s1,~JAZZ_IE_FLOPPY
189 li a0,JAZZ_FLOPPY_IRQ
190 b loc_call
191
192/*
193 * Sound IRQ
194 */
195loc_sound: PANIC("Unimplemented loc_sound handler")
196loc_video: PANIC("Unimplemented loc_video handler")
197
198/*
199 * Ethernet interrupt handler
200 */
201loc_ethernet: li s1,~JAZZ_IE_ETHERNET
202 li a0,JAZZ_ETHERNET_IRQ
203 b loc_call
204
205/*
206 * SCSI interrupt handler
207 */
208loc_scsi: li s1,~JAZZ_IE_SCSI
209 li a0,JAZZ_SCSI_IRQ
210 b loc_call
211
212/*
213 * Keyboard interrupt handler
214 */
215loc_keyboard: li s1,~JAZZ_IE_KEYBOARD
216 li a0,JAZZ_KEYBOARD_IRQ
217 b loc_call
218
219/*
220 * Mouse interrupt handler
221 */
222loc_mouse: li s1,~JAZZ_IE_MOUSE
223 li a0,JAZZ_MOUSE_IRQ
224 b loc_call
225
226/*
227 * Serial port 1 IRQ
228 */
229loc_serial1: li s1,~JAZZ_IE_SERIAL1
230 li a0,JAZZ_SERIAL1_IRQ
231 b loc_call
232
233/*
234 * Serial port 2 IRQ
235 */
236loc_serial2: li s1,~JAZZ_IE_SERIAL2
237 li a0,JAZZ_SERIAL2_IRQ
238 b loc_call
239
240/*
241 * Call the interrupt handler for an interrupt generated by a
242 * local device.
243 */
244loc_call: /*
245 * Temporarily disable interrupt source
246 */
247 lhu t2,JAZZ_IO_IRQ_ENABLE
248 and t2,s1
249 sh t2,JAZZ_IO_IRQ_ENABLE
250
251 nor s1,zero,s1
252 jal do_IRQ
253
254 /*
255 * Reenable interrupt
256 */
257 lhu t2,JAZZ_IO_IRQ_ENABLE
258 or t2,s1
259 sh t2,JAZZ_IO_IRQ_ENABLE
260
261 j ret_from_irq
262
263/*
264 * "Jump extender" to reach spurious_interrupt
265 */
2663: j spurious_interrupt
267
268/*
269 * Vectors for interrupts generated by local devices
270 */
271 .data
272local_vector: PTR loc_no_irq
273 PTR loc_parallel
274 PTR loc_floppy
275 PTR loc_sound
276 PTR loc_video
277 PTR loc_ethernet
278 PTR loc_scsi
279 PTR loc_keyboard
280 PTR loc_mouse
281 PTR loc_serial1
282 PTR loc_serial2
diff --git a/arch/mips/jazz/irq.c b/arch/mips/jazz/irq.c
index b309b1bcf2e8..becc9accd495 100644
--- a/arch/mips/jazz/irq.c
+++ b/arch/mips/jazz/irq.c
@@ -15,8 +15,6 @@
15#include <asm/io.h> 15#include <asm/io.h>
16#include <asm/jazz.h> 16#include <asm/jazz.h>
17 17
18extern asmlinkage void jazz_handle_int(void);
19
20static DEFINE_SPINLOCK(r4030_lock); 18static DEFINE_SPINLOCK(r4030_lock);
21 19
22static void enable_r4030_irq(unsigned int irq) 20static void enable_r4030_irq(unsigned int irq)
@@ -90,10 +88,82 @@ void __init init_r4030_ints(void)
90 */ 88 */
91void __init arch_init_irq(void) 89void __init arch_init_irq(void)
92{ 90{
93 set_except_vector(0, jazz_handle_int);
94
95 init_i8259_irqs(); /* Integrated i8259 */ 91 init_i8259_irqs(); /* Integrated i8259 */
96 init_r4030_ints(); 92 init_r4030_ints();
97 93
98 change_c0_status(ST0_IM, IE_IRQ4 | IE_IRQ3 | IE_IRQ2 | IE_IRQ1); 94 change_c0_status(ST0_IM, IE_IRQ4 | IE_IRQ3 | IE_IRQ2 | IE_IRQ1);
99} 95}
96
97static void loc_call(unsigned int irq, struct pt_regs *regs, unsigned int mask)
98{
99 r4030_write_reg16(JAZZ_IO_IRQ_ENABLE,
100 r4030_read_reg16(JAZZ_IO_IRQ_ENABLE) & mask);
101 do_IRQ(irq, regs);
102 r4030_write_reg16(JAZZ_IO_IRQ_ENABLE,
103 r4030_read_reg16(JAZZ_IO_IRQ_ENABLE) | mask);
104}
105
106static void ll_local_dev(struct pt_regs *regs)
107{
108 switch (r4030_read_reg32(JAZZ_IO_IRQ_SOURCE)) {
109 case 0:
110 panic("Unimplemented loc_no_irq handler");
111 break;
112 case 4:
113 loc_call(JAZZ_PARALLEL_IRQ, regs, JAZZ_IE_PARALLEL);
114 break;
115 case 8:
116 loc_call(JAZZ_PARALLEL_IRQ, regs, JAZZ_IE_FLOPPY);
117 break;
118 case 12:
119 panic("Unimplemented loc_sound handler");
120 break;
121 case 16:
122 panic("Unimplemented loc_video handler");
123 break;
124 case 20:
125 loc_call(JAZZ_ETHERNET_IRQ, regs, JAZZ_IE_ETHERNET);
126 break;
127 case 24:
128 loc_call(JAZZ_SCSI_IRQ, regs, JAZZ_IE_SCSI);
129 break;
130 case 28:
131 loc_call(JAZZ_KEYBOARD_IRQ, regs, JAZZ_IE_KEYBOARD);
132 break;
133 case 32:
134 loc_call(JAZZ_MOUSE_IRQ, regs, JAZZ_IE_MOUSE);
135 break;
136 case 36:
137 loc_call(JAZZ_SERIAL1_IRQ, regs, JAZZ_IE_SERIAL1);
138 break;
139 case 40:
140 loc_call(JAZZ_SERIAL2_IRQ, regs, JAZZ_IE_SERIAL2);
141 break;
142 }
143}
144
145asmlinkage void plat_irq_dispatch(struct pt_regs *regs)
146{
147 unsigned int pending = read_c0_cause() & read_c0_status() & ST0_IM;
148
149 if (pending & IE_IRQ5)
150 write_c0_compare(0);
151 else if (pending & IE_IRQ4) {
152 r4030_read_reg32(JAZZ_TIMER_REGISTER);
153 do_IRQ(JAZZ_TIMER_IRQ, regs);
154 } else if (pending & IE_IRQ3)
155 panic("Unimplemented ISA NMI handler");
156 else if (pending & IE_IRQ2)
157 do_IRQ(r4030_read_reg32(JAZZ_EISA_IRQ_ACK), regs);
158 else if (pending & IE_IRQ1) {
159 ll_local_dev(regs);
160 } else if (unlikely(pending & IE_IRQ0))
161 panic("Unimplemented local_dma handler");
162 else if (pending & IE_SW1) {
163 clear_c0_cause(IE_SW1);
164 panic("Unimplemented sw1 handler");
165 } else if (pending & IE_SW0) {
166 clear_c0_cause(IE_SW0);
167 panic("Unimplemented sw0 handler");
168 }
169}
diff --git a/arch/mips/jmr3927/common/rtc_ds1742.c b/arch/mips/jmr3927/common/rtc_ds1742.c
index a6bd3f4d3049..e6561345d12a 100644
--- a/arch/mips/jmr3927/common/rtc_ds1742.c
+++ b/arch/mips/jmr3927/common/rtc_ds1742.c
@@ -60,15 +60,15 @@ rtc_ds1742_get_time(void)
60 unsigned long flags; 60 unsigned long flags;
61 61
62 spin_lock_irqsave(&rtc_lock, flags); 62 spin_lock_irqsave(&rtc_lock, flags);
63 CMOS_WRITE(RTC_READ, RTC_CONTROL); 63 rtc_write(RTC_READ, RTC_CONTROL);
64 second = BCD2BIN(CMOS_READ(RTC_SECONDS) & RTC_SECONDS_MASK); 64 second = BCD2BIN(rtc_read(RTC_SECONDS) & RTC_SECONDS_MASK);
65 minute = BCD2BIN(CMOS_READ(RTC_MINUTES)); 65 minute = BCD2BIN(rtc_read(RTC_MINUTES));
66 hour = BCD2BIN(CMOS_READ(RTC_HOURS)); 66 hour = BCD2BIN(rtc_read(RTC_HOURS));
67 day = BCD2BIN(CMOS_READ(RTC_DATE)); 67 day = BCD2BIN(rtc_read(RTC_DATE));
68 month = BCD2BIN(CMOS_READ(RTC_MONTH)); 68 month = BCD2BIN(rtc_read(RTC_MONTH));
69 year = BCD2BIN(CMOS_READ(RTC_YEAR)); 69 year = BCD2BIN(rtc_read(RTC_YEAR));
70 century = BCD2BIN(CMOS_READ(RTC_CENTURY) & RTC_CENTURY_MASK); 70 century = BCD2BIN(rtc_read(RTC_CENTURY) & RTC_CENTURY_MASK);
71 CMOS_WRITE(0, RTC_CONTROL); 71 rtc_write(0, RTC_CONTROL);
72 spin_unlock_irqrestore(&rtc_lock, flags); 72 spin_unlock_irqrestore(&rtc_lock, flags);
73 73
74 year += century * 100; 74 year += century * 100;
@@ -87,16 +87,16 @@ rtc_ds1742_set_time(unsigned long t)
87 unsigned long flags; 87 unsigned long flags;
88 88
89 spin_lock_irqsave(&rtc_lock, flags); 89 spin_lock_irqsave(&rtc_lock, flags);
90 CMOS_WRITE(RTC_READ, RTC_CONTROL); 90 rtc_write(RTC_READ, RTC_CONTROL);
91 cmos_second = (u8)(CMOS_READ(RTC_SECONDS) & RTC_SECONDS_MASK); 91 cmos_second = (u8)(rtc_read(RTC_SECONDS) & RTC_SECONDS_MASK);
92 cmos_minute = (u8)CMOS_READ(RTC_MINUTES); 92 cmos_minute = (u8)rtc_read(RTC_MINUTES);
93 cmos_hour = (u8)CMOS_READ(RTC_HOURS); 93 cmos_hour = (u8)rtc_read(RTC_HOURS);
94 cmos_day = (u8)CMOS_READ(RTC_DATE); 94 cmos_day = (u8)rtc_read(RTC_DATE);
95 cmos_month = (u8)CMOS_READ(RTC_MONTH); 95 cmos_month = (u8)rtc_read(RTC_MONTH);
96 cmos_year = (u8)CMOS_READ(RTC_YEAR); 96 cmos_year = (u8)rtc_read(RTC_YEAR);
97 cmos_century = CMOS_READ(RTC_CENTURY) & RTC_CENTURY_MASK; 97 cmos_century = rtc_read(RTC_CENTURY) & RTC_CENTURY_MASK;
98 98
99 CMOS_WRITE(RTC_WRITE, RTC_CONTROL); 99 rtc_write(RTC_WRITE, RTC_CONTROL);
100 100
101 /* convert */ 101 /* convert */
102 to_tm(t, &tm); 102 to_tm(t, &tm);
@@ -104,18 +104,18 @@ rtc_ds1742_set_time(unsigned long t)
104 /* check each field one by one */ 104 /* check each field one by one */
105 year = BIN2BCD(tm.tm_year - EPOCH); 105 year = BIN2BCD(tm.tm_year - EPOCH);
106 if (year != cmos_year) { 106 if (year != cmos_year) {
107 CMOS_WRITE(year,RTC_YEAR); 107 rtc_write(year,RTC_YEAR);
108 } 108 }
109 109
110 month = BIN2BCD(tm.tm_mon); 110 month = BIN2BCD(tm.tm_mon);
111 if (month != (cmos_month & 0x1f)) { 111 if (month != (cmos_month & 0x1f)) {
112 CMOS_WRITE((month & 0x1f) | (cmos_month & ~0x1f),RTC_MONTH); 112 rtc_write((month & 0x1f) | (cmos_month & ~0x1f),RTC_MONTH);
113 } 113 }
114 114
115 day = BIN2BCD(tm.tm_mday); 115 day = BIN2BCD(tm.tm_mday);
116 if (day != cmos_day) { 116 if (day != cmos_day) {
117 117
118 CMOS_WRITE(day, RTC_DATE); 118 rtc_write(day, RTC_DATE);
119 } 119 }
120 120
121 if (cmos_hour & 0x40) { 121 if (cmos_hour & 0x40) {
@@ -130,20 +130,20 @@ rtc_ds1742_set_time(unsigned long t)
130 /* 24 hour format */ 130 /* 24 hour format */
131 hour = BIN2BCD(tm.tm_hour) & 0x3f; 131 hour = BIN2BCD(tm.tm_hour) & 0x3f;
132 } 132 }
133 if (hour != cmos_hour) CMOS_WRITE(hour, RTC_HOURS); 133 if (hour != cmos_hour) rtc_write(hour, RTC_HOURS);
134 134
135 minute = BIN2BCD(tm.tm_min); 135 minute = BIN2BCD(tm.tm_min);
136 if (minute != cmos_minute) { 136 if (minute != cmos_minute) {
137 CMOS_WRITE(minute, RTC_MINUTES); 137 rtc_write(minute, RTC_MINUTES);
138 } 138 }
139 139
140 second = BIN2BCD(tm.tm_sec); 140 second = BIN2BCD(tm.tm_sec);
141 if (second != cmos_second) { 141 if (second != cmos_second) {
142 CMOS_WRITE(second & RTC_SECONDS_MASK,RTC_SECONDS); 142 rtc_write(second & RTC_SECONDS_MASK,RTC_SECONDS);
143 } 143 }
144 144
145 /* RTC_CENTURY and RTC_CONTROL share same address... */ 145 /* RTC_CENTURY and RTC_CONTROL share same address... */
146 CMOS_WRITE(cmos_century, RTC_CONTROL); 146 rtc_write(cmos_century, RTC_CONTROL);
147 spin_unlock_irqrestore(&rtc_lock, flags); 147 spin_unlock_irqrestore(&rtc_lock, flags);
148 148
149 return 0; 149 return 0;
@@ -163,9 +163,9 @@ rtc_ds1742_init(unsigned long base)
163 rtc_mips_set_time = rtc_ds1742_set_time; 163 rtc_mips_set_time = rtc_ds1742_set_time;
164 164
165 /* clear oscillator stop bit */ 165 /* clear oscillator stop bit */
166 CMOS_WRITE(RTC_READ, RTC_CONTROL); 166 rtc_write(RTC_READ, RTC_CONTROL);
167 cmos_second = (u8)(CMOS_READ(RTC_SECONDS) & RTC_SECONDS_MASK); 167 cmos_second = (u8)(rtc_read(RTC_SECONDS) & RTC_SECONDS_MASK);
168 CMOS_WRITE(RTC_WRITE, RTC_CONTROL); 168 rtc_write(RTC_WRITE, RTC_CONTROL);
169 CMOS_WRITE(cmos_second, RTC_SECONDS); /* clear msb */ 169 rtc_write(cmos_second, RTC_SECONDS); /* clear msb */
170 CMOS_WRITE(0, RTC_CONTROL); 170 rtc_write(0, RTC_CONTROL);
171} 171}
diff --git a/arch/mips/jmr3927/rbhma3100/Makefile b/arch/mips/jmr3927/rbhma3100/Makefile
index 75bf418b94c0..baf5077813c1 100644
--- a/arch/mips/jmr3927/rbhma3100/Makefile
+++ b/arch/mips/jmr3927/rbhma3100/Makefile
@@ -2,7 +2,7 @@
2# Makefile for TOSHIBA JMR-TX3927 board 2# Makefile for TOSHIBA JMR-TX3927 board
3# 3#
4 4
5obj-y += init.o int-handler.o irq.o setup.o 5obj-y += init.o irq.o setup.o
6obj-$(CONFIG_RUNTIME_DEBUG) += debug.o 6obj-$(CONFIG_RUNTIME_DEBUG) += debug.o
7obj-$(CONFIG_KGDB) += kgdb_io.o 7obj-$(CONFIG_KGDB) += kgdb_io.o
8 8
diff --git a/arch/mips/jmr3927/rbhma3100/int-handler.S b/arch/mips/jmr3927/rbhma3100/int-handler.S
deleted file mode 100644
index f85bbf407542..000000000000
--- a/arch/mips/jmr3927/rbhma3100/int-handler.S
+++ /dev/null
@@ -1,74 +0,0 @@
1/*
2 * Copyright 2001 MontaVista Software Inc.
3 * Author: MontaVista Software, Inc.
4 * ahennessy@mvista.com
5 *
6 * Based on arch/mips/tsdb/kernel/int-handler.S
7 *
8 * Copyright (C) 2000-2001 Toshiba Corporation
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
14 *
15 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
16 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
17 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
18 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
21 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
22 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
26 * You should have received a copy of the GNU General Public License along
27 * with this program; if not, write to the Free Software Foundation, Inc.,
28 * 675 Mass Ave, Cambridge, MA 02139, USA.
29 */
30
31#include <asm/asm.h>
32#include <asm/mipsregs.h>
33#include <asm/regdef.h>
34#include <asm/stackframe.h>
35#include <asm/jmr3927/jmr3927.h>
36
37 /* A lot of complication here is taken away because:
38 *
39 * 1) We handle one interrupt and return, sitting in a loop
40 * and moving across all the pending IRQ bits in the cause
41 * register is _NOT_ the answer, the common case is one
42 * pending IRQ so optimize in that direction.
43 *
44 * 2) We need not check against bits in the status register
45 * IRQ mask, that would make this routine slow as hell.
46 *
47 * 3) Linux only thinks in terms of all IRQs on or all IRQs
48 * off, nothing in between like BSD spl() brain-damage.
49 *
50 */
51
52/* Flush write buffer (needed?)
53 * NOTE: TX39xx performs "non-blocking load", so explicitly use the target
54 * register of LBU to flush immediately.
55 */
56#define FLUSH_WB(tmp) \
57 la tmp, JMR3927_IOC_REV_ADDR; \
58 lbu tmp, (tmp); \
59 move tmp, zero;
60
61 .text
62 .set noreorder
63 .set noat
64 .align 5
65 NESTED(jmr3927_IRQ, PT_SIZE, sp)
66 SAVE_ALL
67 CLI
68 .set at
69 jal jmr3927_irc_irqdispatch
70 move a0, sp
71 FLUSH_WB(t0)
72 j ret_from_irq
73 nop
74 END(jmr3927_IRQ)
diff --git a/arch/mips/jmr3927/rbhma3100/irq.c b/arch/mips/jmr3927/rbhma3100/irq.c
index 2810727f1d4e..11304d1354f4 100644
--- a/arch/mips/jmr3927/rbhma3100/irq.c
+++ b/arch/mips/jmr3927/rbhma3100/irq.c
@@ -77,8 +77,6 @@ static int jmr3927_gen_iack(void)
77} 77}
78#endif 78#endif
79 79
80extern asmlinkage void jmr3927_IRQ(void);
81
82#define irc_dlevel 0 80#define irc_dlevel 0
83#define irc_elevel 1 81#define irc_elevel 1
84 82
@@ -262,7 +260,7 @@ void jmr3927_spurious(struct pt_regs *regs)
262 regs->cp0_cause, regs->cp0_epc, regs->regs[31]); 260 regs->cp0_cause, regs->cp0_epc, regs->regs[31]);
263} 261}
264 262
265void jmr3927_irc_irqdispatch(struct pt_regs *regs) 263asmlinkage void plat_irq_dispatch(struct pt_regs *regs)
266{ 264{
267 int irq; 265 int irq;
268 266
@@ -398,8 +396,6 @@ void __init arch_init_irq(void)
398 396
399 jmr3927_irq_init(NR_ISA_IRQS); 397 jmr3927_irq_init(NR_ISA_IRQS);
400 398
401 set_except_vector(0, jmr3927_IRQ);
402
403 /* setup irq space */ 399 /* setup irq space */
404 add_tb_irq_space(&jmr3927_isac_irqspace); 400 add_tb_irq_space(&jmr3927_isac_irqspace);
405 add_tb_irq_space(&jmr3927_ioc_irqspace); 401 add_tb_irq_space(&jmr3927_ioc_irqspace);
diff --git a/arch/mips/kernel/Makefile b/arch/mips/kernel/Makefile
index 309d54cceda3..34e8a256765c 100644
--- a/arch/mips/kernel/Makefile
+++ b/arch/mips/kernel/Makefile
@@ -34,8 +34,11 @@ obj-$(CONFIG_CPU_R6000) += r6000_fpu.o r4k_switch.o
34 34
35obj-$(CONFIG_SMP) += smp.o 35obj-$(CONFIG_SMP) += smp.o
36 36
37obj-$(CONFIG_MIPS_MT_SMP) += smp_mt.o 37obj-$(CONFIG_MIPS_MT) += mips-mt.o
38obj-$(CONFIG_MIPS_MT_SMTC) += smtc.o smtc-asm.o smtc-proc.o
39obj-$(CONFIG_MIPS_MT_SMP) += smp-mt.o
38 40
41obj-$(CONFIG_MIPS_APSP_KSPD) += kspd.o
39obj-$(CONFIG_MIPS_VPE_LOADER) += vpe.o 42obj-$(CONFIG_MIPS_VPE_LOADER) += vpe.o
40obj-$(CONFIG_MIPS_VPE_APSP_API) += rtlx.o 43obj-$(CONFIG_MIPS_VPE_APSP_API) += rtlx.o
41 44
diff --git a/arch/mips/kernel/asm-offsets.c b/arch/mips/kernel/asm-offsets.c
index ca6b03c773be..0facfaf4e950 100644
--- a/arch/mips/kernel/asm-offsets.c
+++ b/arch/mips/kernel/asm-offsets.c
@@ -69,6 +69,9 @@ void output_ptreg_defines(void)
69 offset("#define PT_BVADDR ", struct pt_regs, cp0_badvaddr); 69 offset("#define PT_BVADDR ", struct pt_regs, cp0_badvaddr);
70 offset("#define PT_STATUS ", struct pt_regs, cp0_status); 70 offset("#define PT_STATUS ", struct pt_regs, cp0_status);
71 offset("#define PT_CAUSE ", struct pt_regs, cp0_cause); 71 offset("#define PT_CAUSE ", struct pt_regs, cp0_cause);
72#ifdef CONFIG_MIPS_MT_SMTC
73 offset("#define PT_TCSTATUS ", struct pt_regs, cp0_tcstatus);
74#endif /* CONFIG_MIPS_MT_SMTC */
72 size("#define PT_SIZE ", struct pt_regs); 75 size("#define PT_SIZE ", struct pt_regs);
73 linefeed; 76 linefeed;
74} 77}
@@ -269,8 +272,8 @@ void output_sc_defines(void)
269 text("/* Linux sigcontext offsets. */"); 272 text("/* Linux sigcontext offsets. */");
270 offset("#define SC_REGS ", struct sigcontext, sc_regs); 273 offset("#define SC_REGS ", struct sigcontext, sc_regs);
271 offset("#define SC_FPREGS ", struct sigcontext, sc_fpregs); 274 offset("#define SC_FPREGS ", struct sigcontext, sc_fpregs);
272 offset("#define SC_MDHI ", struct sigcontext, sc_hi); 275 offset("#define SC_MDHI ", struct sigcontext, sc_mdhi);
273 offset("#define SC_MDLO ", struct sigcontext, sc_lo); 276 offset("#define SC_MDLO ", struct sigcontext, sc_mdlo);
274 offset("#define SC_PC ", struct sigcontext, sc_pc); 277 offset("#define SC_PC ", struct sigcontext, sc_pc);
275 offset("#define SC_FPC_CSR ", struct sigcontext, sc_fpc_csr); 278 offset("#define SC_FPC_CSR ", struct sigcontext, sc_fpc_csr);
276 linefeed; 279 linefeed;
diff --git a/arch/mips/kernel/branch.c b/arch/mips/kernel/branch.c
index 374de839558d..b6232d9033cb 100644
--- a/arch/mips/kernel/branch.c
+++ b/arch/mips/kernel/branch.c
@@ -184,7 +184,7 @@ int __compute_return_epc(struct pt_regs *regs)
184 bit = (insn.i_format.rt >> 2); 184 bit = (insn.i_format.rt >> 2);
185 bit += (bit != 0); 185 bit += (bit != 0);
186 bit += 23; 186 bit += 23;
187 switch (insn.i_format.rt) { 187 switch (insn.i_format.rt & 3) {
188 case 0: /* bc1f */ 188 case 0: /* bc1f */
189 case 2: /* bc1fl */ 189 case 2: /* bc1fl */
190 if (~fcr31 & (1 << bit)) 190 if (~fcr31 & (1 << bit))
diff --git a/arch/mips/kernel/cpu-bugs64.c b/arch/mips/kernel/cpu-bugs64.c
index 47a087b6c11b..d268827c62bd 100644
--- a/arch/mips/kernel/cpu-bugs64.c
+++ b/arch/mips/kernel/cpu-bugs64.c
@@ -206,7 +206,7 @@ static inline void check_daddi(void)
206 "daddi %0, %1, %3\n\t" 206 "daddi %0, %1, %3\n\t"
207 ".set pop" 207 ".set pop"
208 : "=r" (v), "=&r" (tmp) 208 : "=r" (v), "=&r" (tmp)
209 : "I" (0xffffffffffffdb9a), "I" (0x1234)); 209 : "I" (0xffffffffffffdb9aUL), "I" (0x1234));
210 set_except_vector(12, handler); 210 set_except_vector(12, handler);
211 local_irq_restore(flags); 211 local_irq_restore(flags);
212 212
@@ -224,7 +224,7 @@ static inline void check_daddi(void)
224 "dsrl %1, %1, 1\n\t" 224 "dsrl %1, %1, 1\n\t"
225 "daddi %0, %1, %3" 225 "daddi %0, %1, %3"
226 : "=r" (v), "=&r" (tmp) 226 : "=r" (v), "=&r" (tmp)
227 : "I" (0xffffffffffffdb9a), "I" (0x1234)); 227 : "I" (0xffffffffffffdb9aUL), "I" (0x1234));
228 set_except_vector(12, handler); 228 set_except_vector(12, handler);
229 local_irq_restore(flags); 229 local_irq_restore(flags);
230 230
@@ -280,7 +280,7 @@ static inline void check_daddiu(void)
280 "daddu %1, %2\n\t" 280 "daddu %1, %2\n\t"
281 ".set pop" 281 ".set pop"
282 : "=&r" (v), "=&r" (w), "=&r" (tmp) 282 : "=&r" (v), "=&r" (w), "=&r" (tmp)
283 : "I" (0xffffffffffffdb9a), "I" (0x1234)); 283 : "I" (0xffffffffffffdb9aUL), "I" (0x1234));
284 284
285 if (v == w) { 285 if (v == w) {
286 printk("no.\n"); 286 printk("no.\n");
@@ -296,7 +296,7 @@ static inline void check_daddiu(void)
296 "addiu %1, $0, %4\n\t" 296 "addiu %1, $0, %4\n\t"
297 "daddu %1, %2" 297 "daddu %1, %2"
298 : "=&r" (v), "=&r" (w), "=&r" (tmp) 298 : "=&r" (v), "=&r" (w), "=&r" (tmp)
299 : "I" (0xffffffffffffdb9a), "I" (0x1234)); 299 : "I" (0xffffffffffffdb9aUL), "I" (0x1234));
300 300
301 if (v == w) { 301 if (v == w) {
302 printk("yes.\n"); 302 printk("yes.\n");
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index 58b3b14873cb..8c2c359a05f4 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -121,6 +121,7 @@ static inline void check_wait(void)
121 case CPU_24K: 121 case CPU_24K:
122 case CPU_25KF: 122 case CPU_25KF:
123 case CPU_34K: 123 case CPU_34K:
124 case CPU_74K:
124 case CPU_PR4450: 125 case CPU_PR4450:
125 cpu_wait = r4k_wait; 126 cpu_wait = r4k_wait;
126 printk(" available.\n"); 127 printk(" available.\n");
@@ -432,6 +433,15 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c)
432 MIPS_CPU_LLSC; 433 MIPS_CPU_LLSC;
433 c->tlbsize = 64; 434 c->tlbsize = 64;
434 break; 435 break;
436 case PRID_IMP_R14000:
437 c->cputype = CPU_R14000;
438 c->isa_level = MIPS_CPU_ISA_IV;
439 c->options = MIPS_CPU_TLB | MIPS_CPU_4K_CACHE | MIPS_CPU_4KEX |
440 MIPS_CPU_FPU | MIPS_CPU_32FPR |
441 MIPS_CPU_COUNTER | MIPS_CPU_WATCH |
442 MIPS_CPU_LLSC;
443 c->tlbsize = 64;
444 break;
435 } 445 }
436} 446}
437 447
@@ -593,6 +603,9 @@ static inline void cpu_probe_mips(struct cpuinfo_mips *c)
593 case PRID_IMP_34K: 603 case PRID_IMP_34K:
594 c->cputype = CPU_34K; 604 c->cputype = CPU_34K;
595 break; 605 break;
606 case PRID_IMP_74K:
607 c->cputype = CPU_74K;
608 break;
596 } 609 }
597} 610}
598 611
@@ -642,7 +655,7 @@ static inline void cpu_probe_sibyte(struct cpuinfo_mips *c)
642 case PRID_IMP_SB1: 655 case PRID_IMP_SB1:
643 c->cputype = CPU_SB1; 656 c->cputype = CPU_SB1;
644 /* FPU in pass1 is known to have issues. */ 657 /* FPU in pass1 is known to have issues. */
645 if ((c->processor_id & 0xff) < 0x20) 658 if ((c->processor_id & 0xff) < 0x02)
646 c->options &= ~(MIPS_CPU_FPU | MIPS_CPU_32FPR); 659 c->options &= ~(MIPS_CPU_FPU | MIPS_CPU_32FPR);
647 break; 660 break;
648 case PRID_IMP_SB1A: 661 case PRID_IMP_SB1A:
diff --git a/arch/mips/kernel/entry.S b/arch/mips/kernel/entry.S
index 83c87fe4ee4f..a9c6de1b9542 100644
--- a/arch/mips/kernel/entry.S
+++ b/arch/mips/kernel/entry.S
@@ -17,6 +17,9 @@
17#include <asm/isadep.h> 17#include <asm/isadep.h>
18#include <asm/thread_info.h> 18#include <asm/thread_info.h>
19#include <asm/war.h> 19#include <asm/war.h>
20#ifdef CONFIG_MIPS_MT_SMTC
21#include <asm/mipsmtregs.h>
22#endif
20 23
21#ifdef CONFIG_PREEMPT 24#ifdef CONFIG_PREEMPT
22 .macro preempt_stop 25 .macro preempt_stop
@@ -75,6 +78,37 @@ FEXPORT(syscall_exit)
75 bnez t0, syscall_exit_work 78 bnez t0, syscall_exit_work
76 79
77FEXPORT(restore_all) # restore full frame 80FEXPORT(restore_all) # restore full frame
81#ifdef CONFIG_MIPS_MT_SMTC
82/* Detect and execute deferred IPI "interrupts" */
83 move a0,sp
84 jal deferred_smtc_ipi
85/* Re-arm any temporarily masked interrupts not explicitly "acked" */
86 mfc0 v0, CP0_TCSTATUS
87 ori v1, v0, TCSTATUS_IXMT
88 mtc0 v1, CP0_TCSTATUS
89 andi v0, TCSTATUS_IXMT
90 ehb
91 mfc0 t0, CP0_TCCONTEXT
92 DMT 9 # dmt t1
93 jal mips_ihb
94 mfc0 t2, CP0_STATUS
95 andi t3, t0, 0xff00
96 or t2, t2, t3
97 mtc0 t2, CP0_STATUS
98 ehb
99 andi t1, t1, VPECONTROL_TE
100 beqz t1, 1f
101 EMT
1021:
103 mfc0 v1, CP0_TCSTATUS
104 /* We set IXMT above, XOR should clear it here */
105 xori v1, v1, TCSTATUS_IXMT
106 or v1, v0, v1
107 mtc0 v1, CP0_TCSTATUS
108 ehb
109 xor t0, t0, t3
110 mtc0 t0, CP0_TCCONTEXT
111#endif /* CONFIG_MIPS_MT_SMTC */
78 .set noat 112 .set noat
79 RESTORE_TEMP 113 RESTORE_TEMP
80 RESTORE_AT 114 RESTORE_AT
@@ -120,28 +154,17 @@ syscall_exit_work:
120 jal do_syscall_trace 154 jal do_syscall_trace
121 b resume_userspace 155 b resume_userspace
122 156
157#if defined(CONFIG_CPU_MIPSR2) || defined(CONFIG_MIPS_MT)
158
123/* 159/*
124 * Common spurious interrupt handler. 160 * MIPS32R2 Instruction Hazard Barrier - must be called
161 *
162 * For C code use the inline version named instruction_hazard().
125 */ 163 */
126LEAF(spurious_interrupt) 164LEAF(mips_ihb)
127 /* 165 .set mips32r2
128 * Someone tried to fool us by sending an interrupt but we 166 jr.hb ra
129 * couldn't find a cause for it. 167 nop
130 */ 168 END(mips_ihb)
131 PTR_LA t1, irq_err_count 169
132#ifdef CONFIG_SMP 170#endif /* CONFIG_CPU_MIPSR2 or CONFIG_MIPS_MT */
1331: ll t0, (t1)
134 addiu t0, 1
135 sc t0, (t1)
136#if R10000_LLSC_WAR
137 beqzl t0, 1b
138#else
139 beqz t0, 1b
140#endif
141#else
142 lw t0, (t1)
143 addiu t0, 1
144 sw t0, (t1)
145#endif
146 j ret_from_irq
147 END(spurious_interrupt)
diff --git a/arch/mips/kernel/gdb-low.S b/arch/mips/kernel/gdb-low.S
index 235ad9f6bd35..5fd7a8af0c62 100644
--- a/arch/mips/kernel/gdb-low.S
+++ b/arch/mips/kernel/gdb-low.S
@@ -54,9 +54,11 @@
54 */ 54 */
55 mfc0 k0, CP0_CAUSE 55 mfc0 k0, CP0_CAUSE
56 andi k0, k0, 0x7c 56 andi k0, k0, 0x7c
57 add k1, k1, k0 57#ifdef CONFIG_64BIT
58 PTR_L k0, saved_vectors(k1) 58 dsll k0, k0, 1
59 jr k0 59#endif
60 PTR_L k1, saved_vectors(k0)
61 jr k1
60 nop 62 nop
611: 631:
62 move k0, sp 64 move k0, sp
@@ -283,11 +285,33 @@
283 */ 285 */
284 286
2853: 2873:
288#ifdef CONFIG_MIPS_MT_SMTC
289 /* Read-modify write of Status must be atomic */
290 mfc0 t2, CP0_TCSTATUS
291 ori t1, t2, TCSTATUS_IXMT
292 mtc0 t1, CP0_TCSTATUS
293 andi t2, t2, TCSTATUS_IXMT
294 ehb
295 DMT 9 # dmt t1
296 jal mips_ihb
297 nop
298#endif /* CONFIG_MIPS_MT_SMTC */
286 mfc0 t0, CP0_STATUS 299 mfc0 t0, CP0_STATUS
287 ori t0, 0x1f 300 ori t0, 0x1f
288 xori t0, 0x1f 301 xori t0, 0x1f
289 mtc0 t0, CP0_STATUS 302 mtc0 t0, CP0_STATUS
290 303#ifdef CONFIG_MIPS_MT_SMTC
304 andi t1, t1, VPECONTROL_TE
305 beqz t1, 9f
306 nop
307 EMT # emt
3089:
309 mfc0 t1, CP0_TCSTATUS
310 xori t1, t1, TCSTATUS_IXMT
311 or t1, t1, t2
312 mtc0 t1, CP0_TCSTATUS
313 ehb
314#endif /* CONFIG_MIPS_MT_SMTC */
291 LONG_L v0, GDB_FR_STATUS(sp) 315 LONG_L v0, GDB_FR_STATUS(sp)
292 LONG_L v1, GDB_FR_EPC(sp) 316 LONG_L v1, GDB_FR_EPC(sp)
293 mtc0 v0, CP0_STATUS 317 mtc0 v0, CP0_STATUS
diff --git a/arch/mips/kernel/gdb-stub.c b/arch/mips/kernel/gdb-stub.c
index d4f88e0af24c..6ecbdc1fefd1 100644
--- a/arch/mips/kernel/gdb-stub.c
+++ b/arch/mips/kernel/gdb-stub.c
@@ -140,6 +140,7 @@
140#include <asm/system.h> 140#include <asm/system.h>
141#include <asm/gdb-stub.h> 141#include <asm/gdb-stub.h>
142#include <asm/inst.h> 142#include <asm/inst.h>
143#include <asm/smp.h>
143 144
144/* 145/*
145 * external low-level support routines 146 * external low-level support routines
@@ -669,6 +670,64 @@ static void kgdb_wait(void *arg)
669 local_irq_restore(flags); 670 local_irq_restore(flags);
670} 671}
671 672
673/*
674 * GDB stub needs to call kgdb_wait on all processor with interrupts
675 * disabled, so it uses it's own special variant.
676 */
677static int kgdb_smp_call_kgdb_wait(void)
678{
679#ifdef CONFIG_SMP
680 struct call_data_struct data;
681 int i, cpus = num_online_cpus() - 1;
682 int cpu = smp_processor_id();
683
684 /*
685 * Can die spectacularly if this CPU isn't yet marked online
686 */
687 BUG_ON(!cpu_online(cpu));
688
689 if (!cpus)
690 return 0;
691
692 if (spin_is_locked(&smp_call_lock)) {
693 /*
694 * Some other processor is trying to make us do something
695 * but we're not going to respond... give up
696 */
697 return -1;
698 }
699
700 /*
701 * We will continue here, accepting the fact that
702 * the kernel may deadlock if another CPU attempts
703 * to call smp_call_function now...
704 */
705
706 data.func = kgdb_wait;
707 data.info = NULL;
708 atomic_set(&data.started, 0);
709 data.wait = 0;
710
711 spin_lock(&smp_call_lock);
712 call_data = &data;
713 mb();
714
715 /* Send a message to all other CPUs and wait for them to respond */
716 for (i = 0; i < NR_CPUS; i++)
717 if (cpu_online(i) && i != cpu)
718 core_send_ipi(i, SMP_CALL_FUNCTION);
719
720 /* Wait for response */
721 /* FIXME: lock-up detection, backtrace on lock-up */
722 while (atomic_read(&data.started) != cpus)
723 barrier();
724
725 call_data = NULL;
726 spin_unlock(&smp_call_lock);
727#endif
728
729 return 0;
730}
672 731
673/* 732/*
674 * This function does all command processing for interfacing to gdb. It 733 * This function does all command processing for interfacing to gdb. It
@@ -718,7 +777,7 @@ void handle_exception (struct gdb_regs *regs)
718 /* 777 /*
719 * force other cpus to enter kgdb 778 * force other cpus to enter kgdb
720 */ 779 */
721 smp_call_function(kgdb_wait, NULL, 0, 0); 780 kgdb_smp_call_kgdb_wait();
722 781
723 /* 782 /*
724 * If we're in breakpoint() increment the PC 783 * If we're in breakpoint() increment the PC
diff --git a/arch/mips/kernel/genex.S b/arch/mips/kernel/genex.S
index 13f22d1d0e8b..ff7af369f286 100644
--- a/arch/mips/kernel/genex.S
+++ b/arch/mips/kernel/genex.S
@@ -12,6 +12,7 @@
12#include <linux/init.h> 12#include <linux/init.h>
13 13
14#include <asm/asm.h> 14#include <asm/asm.h>
15#include <asm/asmmacro.h>
15#include <asm/cacheops.h> 16#include <asm/cacheops.h>
16#include <asm/regdef.h> 17#include <asm/regdef.h>
17#include <asm/fpregdef.h> 18#include <asm/fpregdef.h>
@@ -122,6 +123,20 @@ handle_vcei:
122 .set pop 123 .set pop
123 END(except_vec3_r4000) 124 END(except_vec3_r4000)
124 125
126 __FINIT
127
128 .align 5
129NESTED(handle_int, PT_SIZE, sp)
130 SAVE_ALL
131 CLI
132
133 PTR_LA ra, ret_from_irq
134 move a0, sp
135 j plat_irq_dispatch
136 END(handle_int)
137
138 __INIT
139
125/* 140/*
126 * Special interrupt vector for MIPS64 ISA & embedded MIPS processors. 141 * Special interrupt vector for MIPS64 ISA & embedded MIPS processors.
127 * This is a dedicated interrupt exception vector which reduces the 142 * This is a dedicated interrupt exception vector which reduces the
@@ -157,6 +172,15 @@ NESTED(except_vec_vi, 0, sp)
157 SAVE_AT 172 SAVE_AT
158 .set push 173 .set push
159 .set noreorder 174 .set noreorder
175#ifdef CONFIG_MIPS_MT_SMTC
176 /*
177 * To keep from blindly blocking *all* interrupts
178 * during service by SMTC kernel, we also want to
179 * pass the IM value to be cleared.
180 */
181EXPORT(except_vec_vi_mori)
182 ori a0, $0, 0
183#endif /* CONFIG_MIPS_MT_SMTC */
160EXPORT(except_vec_vi_lui) 184EXPORT(except_vec_vi_lui)
161 lui v0, 0 /* Patched */ 185 lui v0, 0 /* Patched */
162 j except_vec_vi_handler 186 j except_vec_vi_handler
@@ -173,6 +197,25 @@ EXPORT(except_vec_vi_end)
173NESTED(except_vec_vi_handler, 0, sp) 197NESTED(except_vec_vi_handler, 0, sp)
174 SAVE_TEMP 198 SAVE_TEMP
175 SAVE_STATIC 199 SAVE_STATIC
200#ifdef CONFIG_MIPS_MT_SMTC
201 /*
202 * SMTC has an interesting problem that interrupts are level-triggered,
203 * and the CLI macro will clear EXL, potentially causing a duplicate
204 * interrupt service invocation. So we need to clear the associated
205 * IM bit of Status prior to doing CLI, and restore it after the
206 * service routine has been invoked - we must assume that the
207 * service routine will have cleared the state, and any active
208 * level represents a new or otherwised unserviced event...
209 */
210 mfc0 t1, CP0_STATUS
211 and t0, a0, t1
212 mfc0 t2, CP0_TCCONTEXT
213 or t0, t0, t2
214 mtc0 t0, CP0_TCCONTEXT
215 xor t1, t1, t0
216 mtc0 t1, CP0_STATUS
217 ehb
218#endif /* CONFIG_MIPS_MT_SMTC */
176 CLI 219 CLI
177 move a0, sp 220 move a0, sp
178 jalr v0 221 jalr v0
diff --git a/arch/mips/kernel/head.S b/arch/mips/kernel/head.S
index 2e9122a4213a..bdf6f6eff721 100644
--- a/arch/mips/kernel/head.S
+++ b/arch/mips/kernel/head.S
@@ -18,6 +18,7 @@
18#include <linux/threads.h> 18#include <linux/threads.h>
19 19
20#include <asm/asm.h> 20#include <asm/asm.h>
21#include <asm/asmmacro.h>
21#include <asm/regdef.h> 22#include <asm/regdef.h>
22#include <asm/page.h> 23#include <asm/page.h>
23#include <asm/mipsregs.h> 24#include <asm/mipsregs.h>
@@ -82,12 +83,33 @@
82 */ 83 */
83 .macro setup_c0_status set clr 84 .macro setup_c0_status set clr
84 .set push 85 .set push
86#ifdef CONFIG_MIPS_MT_SMTC
87 /*
88 * For SMTC, we need to set privilege and disable interrupts only for
89 * the current TC, using the TCStatus register.
90 */
91 mfc0 t0, CP0_TCSTATUS
92 /* Fortunately CU 0 is in the same place in both registers */
93 /* Set TCU0, TMX, TKSU (for later inversion) and IXMT */
94 li t1, ST0_CU0 | 0x08001c00
95 or t0, t1
96 /* Clear TKSU, leave IXMT */
97 xori t0, 0x00001800
98 mtc0 t0, CP0_TCSTATUS
99 ehb
100 /* We need to leave the global IE bit set, but clear EXL...*/
101 mfc0 t0, CP0_STATUS
102 or t0, ST0_CU0 | ST0_EXL | ST0_ERL | \set | \clr
103 xor t0, ST0_EXL | ST0_ERL | \clr
104 mtc0 t0, CP0_STATUS
105#else
85 mfc0 t0, CP0_STATUS 106 mfc0 t0, CP0_STATUS
86 or t0, ST0_CU0|\set|0x1f|\clr 107 or t0, ST0_CU0|\set|0x1f|\clr
87 xor t0, 0x1f|\clr 108 xor t0, 0x1f|\clr
88 mtc0 t0, CP0_STATUS 109 mtc0 t0, CP0_STATUS
89 .set noreorder 110 .set noreorder
90 sll zero,3 # ehb 111 sll zero,3 # ehb
112#endif
91 .set pop 113 .set pop
92 .endm 114 .endm
93 115
@@ -134,6 +156,24 @@ NESTED(kernel_entry, 16, sp) # kernel entry point
134 156
135 ARC64_TWIDDLE_PC 157 ARC64_TWIDDLE_PC
136 158
159#ifdef CONFIG_MIPS_MT_SMTC
160 /*
161 * In SMTC kernel, "CLI" is thread-specific, in TCStatus.
162 * We still need to enable interrupts globally in Status,
163 * and clear EXL/ERL.
164 *
165 * TCContext is used to track interrupt levels under
166 * service in SMTC kernel. Clear for boot TC before
167 * allowing any interrupts.
168 */
169 mtc0 zero, CP0_TCCONTEXT
170
171 mfc0 t0, CP0_STATUS
172 ori t0, t0, 0xff1f
173 xori t0, t0, 0x001e
174 mtc0 t0, CP0_STATUS
175#endif /* CONFIG_MIPS_MT_SMTC */
176
137 PTR_LA t0, __bss_start # clear .bss 177 PTR_LA t0, __bss_start # clear .bss
138 LONG_S zero, (t0) 178 LONG_S zero, (t0)
139 PTR_LA t1, __bss_stop - LONGSIZE 179 PTR_LA t1, __bss_stop - LONGSIZE
@@ -166,8 +206,25 @@ NESTED(kernel_entry, 16, sp) # kernel entry point
166 * function after setting up the stack and gp registers. 206 * function after setting up the stack and gp registers.
167 */ 207 */
168NESTED(smp_bootstrap, 16, sp) 208NESTED(smp_bootstrap, 16, sp)
209#ifdef CONFIG_MIPS_MT_SMTC
210 /*
211 * Read-modify-writes of Status must be atomic, and this
212 * is one case where CLI is invoked without EXL being
213 * necessarily set. The CLI and setup_c0_status will
214 * in fact be redundant for all but the first TC of
215 * each VPE being booted.
216 */
217 DMT 10 # dmt t2 /* t0, t1 are used by CLI and setup_c0_status() */
218 jal mips_ihb
219#endif /* CONFIG_MIPS_MT_SMTC */
169 setup_c0_status_sec 220 setup_c0_status_sec
170 smp_slave_setup 221 smp_slave_setup
222#ifdef CONFIG_MIPS_MT_SMTC
223 andi t2, t2, VPECONTROL_TE
224 beqz t2, 2f
225 EMT # emt
2262:
227#endif /* CONFIG_MIPS_MT_SMTC */
171 j start_secondary 228 j start_secondary
172 END(smp_bootstrap) 229 END(smp_bootstrap)
173#endif /* CONFIG_SMP */ 230#endif /* CONFIG_SMP */
diff --git a/arch/mips/kernel/i8259.c b/arch/mips/kernel/i8259.c
index b974ac9057f6..2125ba5f1d9b 100644
--- a/arch/mips/kernel/i8259.c
+++ b/arch/mips/kernel/i8259.c
@@ -187,6 +187,10 @@ handle_real_irq:
187 outb(cached_21,0x21); 187 outb(cached_21,0x21);
188 outb(0x60+irq,0x20); /* 'Specific EOI' to master */ 188 outb(0x60+irq,0x20); /* 'Specific EOI' to master */
189 } 189 }
190#ifdef CONFIG_MIPS_MT_SMTC
191 if (irq_hwmask[irq] & ST0_IM)
192 set_c0_status(irq_hwmask[irq] & ST0_IM);
193#endif /* CONFIG_MIPS_MT_SMTC */
190 spin_unlock_irqrestore(&i8259A_lock, flags); 194 spin_unlock_irqrestore(&i8259A_lock, flags);
191 return; 195 return;
192 196
diff --git a/arch/mips/kernel/irq-msc01.c b/arch/mips/kernel/irq-msc01.c
index 3f653c7cfbf3..97ebdc754b9e 100644
--- a/arch/mips/kernel/irq-msc01.c
+++ b/arch/mips/kernel/irq-msc01.c
@@ -76,6 +76,11 @@ static void level_mask_and_ack_msc_irq(unsigned int irq)
76 mask_msc_irq(irq); 76 mask_msc_irq(irq);
77 if (!cpu_has_veic) 77 if (!cpu_has_veic)
78 MSCIC_WRITE(MSC01_IC_EOI, 0); 78 MSCIC_WRITE(MSC01_IC_EOI, 0);
79#ifdef CONFIG_MIPS_MT_SMTC
80 /* This actually needs to be a call into platform code */
81 if (irq_hwmask[irq] & ST0_IM)
82 set_c0_status(irq_hwmask[irq] & ST0_IM);
83#endif /* CONFIG_MIPS_MT_SMTC */
79} 84}
80 85
81/* 86/*
@@ -92,6 +97,10 @@ static void edge_mask_and_ack_msc_irq(unsigned int irq)
92 MSCIC_WRITE(MSC01_IC_SUP+irq*8, r | ~MSC01_IC_SUP_EDGE_BIT); 97 MSCIC_WRITE(MSC01_IC_SUP+irq*8, r | ~MSC01_IC_SUP_EDGE_BIT);
93 MSCIC_WRITE(MSC01_IC_SUP+irq*8, r); 98 MSCIC_WRITE(MSC01_IC_SUP+irq*8, r);
94 } 99 }
100#ifdef CONFIG_MIPS_MT_SMTC
101 if (irq_hwmask[irq] & ST0_IM)
102 set_c0_status(irq_hwmask[irq] & ST0_IM);
103#endif /* CONFIG_MIPS_MT_SMTC */
95} 104}
96 105
97/* 106/*
diff --git a/arch/mips/kernel/irq.c b/arch/mips/kernel/irq.c
index 3dd76b3d2967..3dce742e716f 100644
--- a/arch/mips/kernel/irq.c
+++ b/arch/mips/kernel/irq.c
@@ -38,6 +38,15 @@ void ack_bad_irq(unsigned int irq)
38 38
39atomic_t irq_err_count; 39atomic_t irq_err_count;
40 40
41#ifdef CONFIG_MIPS_MT_SMTC
42/*
43 * SMTC Kernel needs to manipulate low-level CPU interrupt mask
44 * in do_IRQ. These are passed in setup_irq_smtc() and stored
45 * in this table.
46 */
47unsigned long irq_hwmask[NR_IRQS];
48#endif /* CONFIG_MIPS_MT_SMTC */
49
41#undef do_IRQ 50#undef do_IRQ
42 51
43/* 52/*
@@ -49,6 +58,7 @@ asmlinkage unsigned int do_IRQ(unsigned int irq, struct pt_regs *regs)
49{ 58{
50 irq_enter(); 59 irq_enter();
51 60
61 __DO_IRQ_SMTC_HOOK();
52 __do_IRQ(irq, regs); 62 __do_IRQ(irq, regs);
53 63
54 irq_exit(); 64 irq_exit();
@@ -101,6 +111,11 @@ skip:
101 return 0; 111 return 0;
102} 112}
103 113
114asmlinkage void spurious_interrupt(struct pt_regs *regs)
115{
116 atomic_inc(&irq_err_count);
117}
118
104#ifdef CONFIG_KGDB 119#ifdef CONFIG_KGDB
105extern void breakpoint(void); 120extern void breakpoint(void);
106extern void set_debug_traps(void); 121extern void set_debug_traps(void);
@@ -124,6 +139,9 @@ void __init init_IRQ(void)
124 irq_desc[i].depth = 1; 139 irq_desc[i].depth = 1;
125 irq_desc[i].handler = &no_irq_type; 140 irq_desc[i].handler = &no_irq_type;
126 spin_lock_init(&irq_desc[i].lock); 141 spin_lock_init(&irq_desc[i].lock);
142#ifdef CONFIG_MIPS_MT_SMTC
143 irq_hwmask[i] = 0;
144#endif /* CONFIG_MIPS_MT_SMTC */
127 } 145 }
128 146
129 arch_init_irq(); 147 arch_init_irq();
diff --git a/arch/mips/kernel/kspd.c b/arch/mips/kernel/kspd.c
new file mode 100644
index 000000000000..f06a144c7881
--- /dev/null
+++ b/arch/mips/kernel/kspd.c
@@ -0,0 +1,398 @@
1/*
2 * Copyright (C) 2005 MIPS Technologies, Inc. All rights reserved.
3 *
4 * This program is free software; you can distribute it and/or modify it
5 * under the terms of the GNU General Public License (Version 2) as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11 * for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
16 *
17 */
18#include <linux/kernel.h>
19#include <linux/module.h>
20#include <linux/unistd.h>
21#include <linux/file.h>
22#include <linux/fs.h>
23#include <linux/syscalls.h>
24#include <linux/workqueue.h>
25#include <linux/errno.h>
26#include <linux/list.h>
27
28#include <asm/vpe.h>
29#include <asm/rtlx.h>
30#include <asm/kspd.h>
31
32static struct workqueue_struct *workqueue = NULL;
33static struct work_struct work;
34
35extern unsigned long cpu_khz;
36
37struct mtsp_syscall {
38 int cmd;
39 unsigned char abi;
40 unsigned char size;
41};
42
43struct mtsp_syscall_ret {
44 int retval;
45 int errno;
46};
47
48struct mtsp_syscall_generic {
49 int arg0;
50 int arg1;
51 int arg2;
52 int arg3;
53 int arg4;
54 int arg5;
55 int arg6;
56};
57
58static struct list_head kspd_notifylist;
59static int sp_stopping = 0;
60
61/* these should match with those in the SDE kit */
62#define MTSP_SYSCALL_BASE 0
63#define MTSP_SYSCALL_EXIT (MTSP_SYSCALL_BASE + 0)
64#define MTSP_SYSCALL_OPEN (MTSP_SYSCALL_BASE + 1)
65#define MTSP_SYSCALL_READ (MTSP_SYSCALL_BASE + 2)
66#define MTSP_SYSCALL_WRITE (MTSP_SYSCALL_BASE + 3)
67#define MTSP_SYSCALL_CLOSE (MTSP_SYSCALL_BASE + 4)
68#define MTSP_SYSCALL_LSEEK32 (MTSP_SYSCALL_BASE + 5)
69#define MTSP_SYSCALL_ISATTY (MTSP_SYSCALL_BASE + 6)
70#define MTSP_SYSCALL_GETTIME (MTSP_SYSCALL_BASE + 7)
71#define MTSP_SYSCALL_PIPEFREQ (MTSP_SYSCALL_BASE + 8)
72#define MTSP_SYSCALL_GETTOD (MTSP_SYSCALL_BASE + 9)
73
74#define MTSP_O_RDONLY 0x0000
75#define MTSP_O_WRONLY 0x0001
76#define MTSP_O_RDWR 0x0002
77#define MTSP_O_NONBLOCK 0x0004
78#define MTSP_O_APPEND 0x0008
79#define MTSP_O_SHLOCK 0x0010
80#define MTSP_O_EXLOCK 0x0020
81#define MTSP_O_ASYNC 0x0040
82#define MTSP_O_FSYNC O_SYNC
83#define MTSP_O_NOFOLLOW 0x0100
84#define MTSP_O_SYNC 0x0080
85#define MTSP_O_CREAT 0x0200
86#define MTSP_O_TRUNC 0x0400
87#define MTSP_O_EXCL 0x0800
88#define MTSP_O_BINARY 0x8000
89
90#define SP_VPE 1
91
92struct apsp_table {
93 int sp;
94 int ap;
95};
96
97/* we might want to do the mode flags too */
98struct apsp_table open_flags_table[] = {
99 { MTSP_O_RDWR, O_RDWR },
100 { MTSP_O_WRONLY, O_WRONLY },
101 { MTSP_O_CREAT, O_CREAT },
102 { MTSP_O_TRUNC, O_TRUNC },
103 { MTSP_O_NONBLOCK, O_NONBLOCK },
104 { MTSP_O_APPEND, O_APPEND },
105 { MTSP_O_NOFOLLOW, O_NOFOLLOW }
106};
107
108struct apsp_table syscall_command_table[] = {
109 { MTSP_SYSCALL_OPEN, __NR_open },
110 { MTSP_SYSCALL_CLOSE, __NR_close },
111 { MTSP_SYSCALL_READ, __NR_read },
112 { MTSP_SYSCALL_WRITE, __NR_write },
113 { MTSP_SYSCALL_LSEEK32, __NR_lseek }
114};
115
116static int sp_syscall(int num, int arg0, int arg1, int arg2, int arg3)
117{
118 register long int _num __asm__ ("$2") = num;
119 register long int _arg0 __asm__ ("$4") = arg0;
120 register long int _arg1 __asm__ ("$5") = arg1;
121 register long int _arg2 __asm__ ("$6") = arg2;
122 register long int _arg3 __asm__ ("$7") = arg3;
123
124 mm_segment_t old_fs;
125
126 old_fs = get_fs();
127 set_fs(KERNEL_DS);
128
129 __asm__ __volatile__ (
130 " syscall \n"
131 : "=r" (_num), "=r" (_arg3)
132 : "r" (_num), "r" (_arg0), "r" (_arg1), "r" (_arg2), "r" (_arg3));
133
134 set_fs(old_fs);
135
136 /* $a3 is error flag */
137 if (_arg3)
138 return -_num;
139
140 return _num;
141}
142
143static int translate_syscall_command(int cmd)
144{
145 int i;
146 int ret = -1;
147
148 for (i = 0; i < ARRAY_SIZE(syscall_command_table); i++) {
149 if ((cmd == syscall_command_table[i].sp))
150 return syscall_command_table[i].ap;
151 }
152
153 return ret;
154}
155
156static unsigned int translate_open_flags(int flags)
157{
158 int i;
159 unsigned int ret = 0;
160
161 for (i = 0; i < (sizeof(open_flags_table) / sizeof(struct apsp_table));
162 i++) {
163 if( (flags & open_flags_table[i].sp) ) {
164 ret |= open_flags_table[i].ap;
165 }
166 }
167
168 return ret;
169}
170
171
172static void sp_setfsuidgid( uid_t uid, gid_t gid)
173{
174 current->fsuid = uid;
175 current->fsgid = gid;
176
177 key_fsuid_changed(current);
178 key_fsgid_changed(current);
179}
180
181/*
182 * Expects a request to be on the sysio channel. Reads it. Decides whether
183 * its a linux syscall and runs it, or whatever. Puts the return code back
184 * into the request and sends the whole thing back.
185 */
186void sp_work_handle_request(void)
187{
188 struct mtsp_syscall sc;
189 struct mtsp_syscall_generic generic;
190 struct mtsp_syscall_ret ret;
191 struct kspd_notifications *n;
192 struct timeval tv;
193 struct timezone tz;
194 int cmd;
195
196 char *vcwd;
197 mm_segment_t old_fs;
198 int size;
199
200 ret.retval = -1;
201
202 if (!rtlx_read(RTLX_CHANNEL_SYSIO, &sc, sizeof(struct mtsp_syscall), 0)) {
203 printk(KERN_ERR "Expected request but nothing to read\n");
204 return;
205 }
206
207 size = sc.size;
208
209 if (size) {
210 if (!rtlx_read(RTLX_CHANNEL_SYSIO, &generic, size, 0)) {
211 printk(KERN_ERR "Expected request but nothing to read\n");
212 return;
213 }
214 }
215
216 /* Run the syscall at the priviledge of the user who loaded the
217 SP program */
218
219 if (vpe_getuid(SP_VPE))
220 sp_setfsuidgid( vpe_getuid(SP_VPE), vpe_getgid(SP_VPE));
221
222 switch (sc.cmd) {
223 /* needs the flags argument translating from SDE kit to
224 linux */
225 case MTSP_SYSCALL_PIPEFREQ:
226 ret.retval = cpu_khz * 1000;
227 ret.errno = 0;
228 break;
229
230 case MTSP_SYSCALL_GETTOD:
231 memset(&tz, 0, sizeof(tz));
232 if ((ret.retval = sp_syscall(__NR_gettimeofday, (int)&tv,
233 (int)&tz, 0,0)) == 0)
234 ret.retval = tv.tv_sec;
235
236 ret.errno = errno;
237 break;
238
239 case MTSP_SYSCALL_EXIT:
240 list_for_each_entry(n, &kspd_notifylist, list)
241 n->kspd_sp_exit(SP_VPE);
242 sp_stopping = 1;
243
244 printk(KERN_DEBUG "KSPD got exit syscall from SP exitcode %d\n",
245 generic.arg0);
246 break;
247
248 case MTSP_SYSCALL_OPEN:
249 generic.arg1 = translate_open_flags(generic.arg1);
250
251 vcwd = vpe_getcwd(SP_VPE);
252
253 /* change to the cwd of the process that loaded the SP program */
254 old_fs = get_fs();
255 set_fs(KERNEL_DS);
256 sys_chdir(vcwd);
257 set_fs(old_fs);
258
259 sc.cmd = __NR_open;
260
261 /* fall through */
262
263 default:
264 if ((sc.cmd >= __NR_Linux) &&
265 (sc.cmd <= (__NR_Linux + __NR_Linux_syscalls)) )
266 cmd = sc.cmd;
267 else
268 cmd = translate_syscall_command(sc.cmd);
269
270 if (cmd >= 0) {
271 ret.retval = sp_syscall(cmd, generic.arg0, generic.arg1,
272 generic.arg2, generic.arg3);
273 ret.errno = errno;
274 } else
275 printk(KERN_WARNING
276 "KSPD: Unknown SP syscall number %d\n", sc.cmd);
277 break;
278 } /* switch */
279
280 if (vpe_getuid(SP_VPE))
281 sp_setfsuidgid( 0, 0);
282
283 if ((rtlx_write(RTLX_CHANNEL_SYSIO, &ret, sizeof(struct mtsp_syscall_ret), 0))
284 < sizeof(struct mtsp_syscall_ret))
285 printk("KSPD: sp_work_handle_request failed to send to SP\n");
286}
287
288static void sp_cleanup(void)
289{
290 struct files_struct *files = current->files;
291 int i, j;
292 struct fdtable *fdt;
293
294 j = 0;
295
296 /*
297 * It is safe to dereference the fd table without RCU or
298 * ->file_lock
299 */
300 fdt = files_fdtable(files);
301 for (;;) {
302 unsigned long set;
303 i = j * __NFDBITS;
304 if (i >= fdt->max_fdset || i >= fdt->max_fds)
305 break;
306 set = fdt->open_fds->fds_bits[j++];
307 while (set) {
308 if (set & 1) {
309 struct file * file = xchg(&fdt->fd[i], NULL);
310 if (file)
311 filp_close(file, files);
312 }
313 i++;
314 set >>= 1;
315 }
316 }
317}
318
319static int channel_open = 0;
320
321/* the work handler */
322static void sp_work(void *data)
323{
324 if (!channel_open) {
325 if( rtlx_open(RTLX_CHANNEL_SYSIO, 1) != 0) {
326 printk("KSPD: unable to open sp channel\n");
327 sp_stopping = 1;
328 } else {
329 channel_open++;
330 printk(KERN_DEBUG "KSPD: SP channel opened\n");
331 }
332 } else {
333 /* wait for some data, allow it to sleep */
334 rtlx_read_poll(RTLX_CHANNEL_SYSIO, 1);
335
336 /* Check we haven't been woken because we are stopping */
337 if (!sp_stopping)
338 sp_work_handle_request();
339 }
340
341 if (!sp_stopping)
342 queue_work(workqueue, &work);
343 else
344 sp_cleanup();
345}
346
347static void startwork(int vpe)
348{
349 sp_stopping = channel_open = 0;
350
351 if (workqueue == NULL) {
352 if ((workqueue = create_singlethread_workqueue("kspd")) == NULL) {
353 printk(KERN_ERR "unable to start kspd\n");
354 return;
355 }
356
357 INIT_WORK(&work, sp_work, NULL);
358 queue_work(workqueue, &work);
359 } else
360 queue_work(workqueue, &work);
361
362}
363
364static void stopwork(int vpe)
365{
366 sp_stopping = 1;
367
368 printk(KERN_DEBUG "KSPD: SP stopping\n");
369}
370
371void kspd_notify(struct kspd_notifications *notify)
372{
373 list_add(&notify->list, &kspd_notifylist);
374}
375
376static struct vpe_notifications notify;
377static int kspd_module_init(void)
378{
379 INIT_LIST_HEAD(&kspd_notifylist);
380
381 notify.start = startwork;
382 notify.stop = stopwork;
383 vpe_notify(SP_VPE, &notify);
384
385 return 0;
386}
387
388static void kspd_module_exit(void)
389{
390
391}
392
393module_init(kspd_module_init);
394module_exit(kspd_module_exit);
395
396MODULE_DESCRIPTION("MIPS KSPD");
397MODULE_AUTHOR("Elizabeth Oldham, MIPS Technologies, Inc.");
398MODULE_LICENSE("GPL");
diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c
index 3f40c37a9ee6..a7d2bb3cf835 100644
--- a/arch/mips/kernel/linux32.c
+++ b/arch/mips/kernel/linux32.c
@@ -356,73 +356,13 @@ asmlinkage int sys32_llseek(unsigned int fd, unsigned int offset_high,
356asmlinkage ssize_t sys32_pread(unsigned int fd, char __user * buf, 356asmlinkage ssize_t sys32_pread(unsigned int fd, char __user * buf,
357 size_t count, u32 unused, u64 a4, u64 a5) 357 size_t count, u32 unused, u64 a4, u64 a5)
358{ 358{
359 ssize_t ret; 359 return sys_pread64(fd, buf, count, merge_64(a4, a5));
360 struct file * file;
361 ssize_t (*read)(struct file *, char __user *, size_t, loff_t *);
362 loff_t pos;
363
364 ret = -EBADF;
365 file = fget(fd);
366 if (!file)
367 goto bad_file;
368 if (!(file->f_mode & FMODE_READ))
369 goto out;
370 pos = merge_64(a4, a5);
371 ret = rw_verify_area(READ, file, &pos, count);
372 if (ret < 0)
373 goto out;
374 ret = -EINVAL;
375 if (!file->f_op || !(read = file->f_op->read))
376 goto out;
377 if (pos < 0)
378 goto out;
379 ret = -ESPIPE;
380 if (!(file->f_mode & FMODE_PREAD))
381 goto out;
382 ret = read(file, buf, count, &pos);
383 if (ret > 0)
384 dnotify_parent(file->f_dentry, DN_ACCESS);
385out:
386 fput(file);
387bad_file:
388 return ret;
389} 360}
390 361
391asmlinkage ssize_t sys32_pwrite(unsigned int fd, const char __user * buf, 362asmlinkage ssize_t sys32_pwrite(unsigned int fd, const char __user * buf,
392 size_t count, u32 unused, u64 a4, u64 a5) 363 size_t count, u32 unused, u64 a4, u64 a5)
393{ 364{
394 ssize_t ret; 365 return sys_pwrite64(fd, buf, count, merge_64(a4, a5));
395 struct file * file;
396 ssize_t (*write)(struct file *, const char __user *, size_t, loff_t *);
397 loff_t pos;
398
399 ret = -EBADF;
400 file = fget(fd);
401 if (!file)
402 goto bad_file;
403 if (!(file->f_mode & FMODE_WRITE))
404 goto out;
405 pos = merge_64(a4, a5);
406 ret = rw_verify_area(WRITE, file, &pos, count);
407 if (ret < 0)
408 goto out;
409 ret = -EINVAL;
410 if (!file->f_op || !(write = file->f_op->write))
411 goto out;
412 if (pos < 0)
413 goto out;
414
415 ret = -ESPIPE;
416 if (!(file->f_mode & FMODE_PWRITE))
417 goto out;
418
419 ret = write(file, buf, count, &pos);
420 if (ret > 0)
421 dnotify_parent(file->f_dentry, DN_MODIFY);
422out:
423 fput(file);
424bad_file:
425 return ret;
426} 366}
427 367
428asmlinkage int sys32_sched_rr_get_interval(compat_pid_t pid, 368asmlinkage int sys32_sched_rr_get_interval(compat_pid_t pid,
@@ -1182,6 +1122,16 @@ asmlinkage ssize_t sys32_readahead(int fd, u32 pad0, u64 a2, u64 a3,
1182 return sys_readahead(fd, merge_64(a2, a3), count); 1122 return sys_readahead(fd, merge_64(a2, a3), count);
1183} 1123}
1184 1124
1125asmlinkage long sys32_sync_file_range(int fd, int __pad,
1126 unsigned long a2, unsigned long a3,
1127 unsigned long a4, unsigned long a5,
1128 int flags)
1129{
1130 return sys_sync_file_range(fd,
1131 merge_64(a2, a3), merge_64(a4, a5),
1132 flags);
1133}
1134
1185/* Argument list sizes for sys_socketcall */ 1135/* Argument list sizes for sys_socketcall */
1186#define AL(x) ((x) * sizeof(unsigned int)) 1136#define AL(x) ((x) * sizeof(unsigned int))
1187static unsigned char socketcall_nargs[18]={AL(0),AL(3),AL(3),AL(3),AL(2),AL(3), 1137static unsigned char socketcall_nargs[18]={AL(0),AL(3),AL(3),AL(3),AL(2),AL(3),
diff --git a/arch/mips/kernel/mips-mt.c b/arch/mips/kernel/mips-mt.c
new file mode 100644
index 000000000000..02237a685ec7
--- /dev/null
+++ b/arch/mips/kernel/mips-mt.c
@@ -0,0 +1,449 @@
1/*
2 * General MIPS MT support routines, usable in AP/SP, SMVP, or SMTC kernels
3 * Copyright (C) 2005 Mips Technologies, Inc
4 */
5
6#include <linux/kernel.h>
7#include <linux/sched.h>
8#include <linux/cpumask.h>
9#include <linux/interrupt.h>
10
11#include <asm/cpu.h>
12#include <asm/processor.h>
13#include <asm/atomic.h>
14#include <asm/system.h>
15#include <asm/hardirq.h>
16#include <asm/mmu_context.h>
17#include <asm/smp.h>
18#include <asm/mipsmtregs.h>
19#include <asm/r4kcache.h>
20#include <asm/cacheflush.h>
21
22/*
23 * CPU mask used to set process affinity for MT VPEs/TCs with FPUs
24 */
25
26cpumask_t mt_fpu_cpumask;
27
28#ifdef CONFIG_MIPS_MT_FPAFF
29
30#include <linux/cpu.h>
31#include <linux/delay.h>
32#include <asm/uaccess.h>
33
34unsigned long mt_fpemul_threshold = 0;
35
36/*
37 * Replacement functions for the sys_sched_setaffinity() and
38 * sys_sched_getaffinity() system calls, so that we can integrate
39 * FPU affinity with the user's requested processor affinity.
40 * This code is 98% identical with the sys_sched_setaffinity()
41 * and sys_sched_getaffinity() system calls, and should be
42 * updated when kernel/sched.c changes.
43 */
44
45/*
46 * find_process_by_pid - find a process with a matching PID value.
47 * used in sys_sched_set/getaffinity() in kernel/sched.c, so
48 * cloned here.
49 */
50static inline task_t *find_process_by_pid(pid_t pid)
51{
52 return pid ? find_task_by_pid(pid) : current;
53}
54
55
56/*
57 * mipsmt_sys_sched_setaffinity - set the cpu affinity of a process
58 */
59asmlinkage long mipsmt_sys_sched_setaffinity(pid_t pid, unsigned int len,
60 unsigned long __user *user_mask_ptr)
61{
62 cpumask_t new_mask;
63 cpumask_t effective_mask;
64 int retval;
65 task_t *p;
66
67 if (len < sizeof(new_mask))
68 return -EINVAL;
69
70 if (copy_from_user(&new_mask, user_mask_ptr, sizeof(new_mask)))
71 return -EFAULT;
72
73 lock_cpu_hotplug();
74 read_lock(&tasklist_lock);
75
76 p = find_process_by_pid(pid);
77 if (!p) {
78 read_unlock(&tasklist_lock);
79 unlock_cpu_hotplug();
80 return -ESRCH;
81 }
82
83 /*
84 * It is not safe to call set_cpus_allowed with the
85 * tasklist_lock held. We will bump the task_struct's
86 * usage count and drop tasklist_lock before invoking
87 * set_cpus_allowed.
88 */
89 get_task_struct(p);
90
91 retval = -EPERM;
92 if ((current->euid != p->euid) && (current->euid != p->uid) &&
93 !capable(CAP_SYS_NICE)) {
94 read_unlock(&tasklist_lock);
95 goto out_unlock;
96 }
97
98 /* Record new user-specified CPU set for future reference */
99 p->thread.user_cpus_allowed = new_mask;
100
101 /* Unlock the task list */
102 read_unlock(&tasklist_lock);
103
104 /* Compute new global allowed CPU set if necessary */
105 if( (p->thread.mflags & MF_FPUBOUND)
106 && cpus_intersects(new_mask, mt_fpu_cpumask)) {
107 cpus_and(effective_mask, new_mask, mt_fpu_cpumask);
108 retval = set_cpus_allowed(p, effective_mask);
109 } else {
110 p->thread.mflags &= ~MF_FPUBOUND;
111 retval = set_cpus_allowed(p, new_mask);
112 }
113
114
115out_unlock:
116 put_task_struct(p);
117 unlock_cpu_hotplug();
118 return retval;
119}
120
121/*
122 * mipsmt_sys_sched_getaffinity - get the cpu affinity of a process
123 */
124asmlinkage long mipsmt_sys_sched_getaffinity(pid_t pid, unsigned int len,
125 unsigned long __user *user_mask_ptr)
126{
127 unsigned int real_len;
128 cpumask_t mask;
129 int retval;
130 task_t *p;
131
132 real_len = sizeof(mask);
133 if (len < real_len)
134 return -EINVAL;
135
136 lock_cpu_hotplug();
137 read_lock(&tasklist_lock);
138
139 retval = -ESRCH;
140 p = find_process_by_pid(pid);
141 if (!p)
142 goto out_unlock;
143
144 retval = 0;
145
146 cpus_and(mask, p->thread.user_cpus_allowed, cpu_possible_map);
147
148out_unlock:
149 read_unlock(&tasklist_lock);
150 unlock_cpu_hotplug();
151 if (retval)
152 return retval;
153 if (copy_to_user(user_mask_ptr, &mask, real_len))
154 return -EFAULT;
155 return real_len;
156}
157
158#endif /* CONFIG_MIPS_MT_FPAFF */
159
160/*
161 * Dump new MIPS MT state for the core. Does not leave TCs halted.
162 * Takes an argument which taken to be a pre-call MVPControl value.
163 */
164
165void mips_mt_regdump(unsigned long mvpctl)
166{
167 unsigned long flags;
168 unsigned long vpflags;
169 unsigned long mvpconf0;
170 int nvpe;
171 int ntc;
172 int i;
173 int tc;
174 unsigned long haltval;
175 unsigned long tcstatval;
176#ifdef CONFIG_MIPS_MT_SMTC
177 void smtc_soft_dump(void);
178#endif /* CONFIG_MIPT_MT_SMTC */
179
180 local_irq_save(flags);
181 vpflags = dvpe();
182 printk("=== MIPS MT State Dump ===\n");
183 printk("-- Global State --\n");
184 printk(" MVPControl Passed: %08lx\n", mvpctl);
185 printk(" MVPControl Read: %08lx\n", vpflags);
186 printk(" MVPConf0 : %08lx\n", (mvpconf0 = read_c0_mvpconf0()));
187 nvpe = ((mvpconf0 & MVPCONF0_PVPE) >> MVPCONF0_PVPE_SHIFT) + 1;
188 ntc = ((mvpconf0 & MVPCONF0_PTC) >> MVPCONF0_PTC_SHIFT) + 1;
189 printk("-- per-VPE State --\n");
190 for(i = 0; i < nvpe; i++) {
191 for(tc = 0; tc < ntc; tc++) {
192 settc(tc);
193 if((read_tc_c0_tcbind() & TCBIND_CURVPE) == i) {
194 printk(" VPE %d\n", i);
195 printk(" VPEControl : %08lx\n", read_vpe_c0_vpecontrol());
196 printk(" VPEConf0 : %08lx\n", read_vpe_c0_vpeconf0());
197 printk(" VPE%d.Status : %08lx\n",
198 i, read_vpe_c0_status());
199 printk(" VPE%d.EPC : %08lx\n", i, read_vpe_c0_epc());
200 printk(" VPE%d.Cause : %08lx\n", i, read_vpe_c0_cause());
201 printk(" VPE%d.Config7 : %08lx\n",
202 i, read_vpe_c0_config7());
203 break; /* Next VPE */
204 }
205 }
206 }
207 printk("-- per-TC State --\n");
208 for(tc = 0; tc < ntc; tc++) {
209 settc(tc);
210 if(read_tc_c0_tcbind() == read_c0_tcbind()) {
211 /* Are we dumping ourself? */
212 haltval = 0; /* Then we're not halted, and mustn't be */
213 tcstatval = flags; /* And pre-dump TCStatus is flags */
214 printk(" TC %d (current TC with VPE EPC above)\n", tc);
215 } else {
216 haltval = read_tc_c0_tchalt();
217 write_tc_c0_tchalt(1);
218 tcstatval = read_tc_c0_tcstatus();
219 printk(" TC %d\n", tc);
220 }
221 printk(" TCStatus : %08lx\n", tcstatval);
222 printk(" TCBind : %08lx\n", read_tc_c0_tcbind());
223 printk(" TCRestart : %08lx\n", read_tc_c0_tcrestart());
224 printk(" TCHalt : %08lx\n", haltval);
225 printk(" TCContext : %08lx\n", read_tc_c0_tccontext());
226 if (!haltval)
227 write_tc_c0_tchalt(0);
228 }
229#ifdef CONFIG_MIPS_MT_SMTC
230 smtc_soft_dump();
231#endif /* CONFIG_MIPT_MT_SMTC */
232 printk("===========================\n");
233 evpe(vpflags);
234 local_irq_restore(flags);
235}
236
237static int mt_opt_norps = 0;
238static int mt_opt_rpsctl = -1;
239static int mt_opt_nblsu = -1;
240static int mt_opt_forceconfig7 = 0;
241static int mt_opt_config7 = -1;
242
243static int __init rps_disable(char *s)
244{
245 mt_opt_norps = 1;
246 return 1;
247}
248__setup("norps", rps_disable);
249
250static int __init rpsctl_set(char *str)
251{
252 get_option(&str, &mt_opt_rpsctl);
253 return 1;
254}
255__setup("rpsctl=", rpsctl_set);
256
257static int __init nblsu_set(char *str)
258{
259 get_option(&str, &mt_opt_nblsu);
260 return 1;
261}
262__setup("nblsu=", nblsu_set);
263
264static int __init config7_set(char *str)
265{
266 get_option(&str, &mt_opt_config7);
267 mt_opt_forceconfig7 = 1;
268 return 1;
269}
270__setup("config7=", config7_set);
271
272/* Experimental cache flush control parameters that should go away some day */
273int mt_protiflush = 0;
274int mt_protdflush = 0;
275int mt_n_iflushes = 1;
276int mt_n_dflushes = 1;
277
278static int __init set_protiflush(char *s)
279{
280 mt_protiflush = 1;
281 return 1;
282}
283__setup("protiflush", set_protiflush);
284
285static int __init set_protdflush(char *s)
286{
287 mt_protdflush = 1;
288 return 1;
289}
290__setup("protdflush", set_protdflush);
291
292static int __init niflush(char *s)
293{
294 get_option(&s, &mt_n_iflushes);
295 return 1;
296}
297__setup("niflush=", niflush);
298
299static int __init ndflush(char *s)
300{
301 get_option(&s, &mt_n_dflushes);
302 return 1;
303}
304__setup("ndflush=", ndflush);
305#ifdef CONFIG_MIPS_MT_FPAFF
306static int fpaff_threshold = -1;
307
308static int __init fpaff_thresh(char *str)
309{
310 get_option(&str, &fpaff_threshold);
311 return 1;
312}
313
314__setup("fpaff=", fpaff_thresh);
315#endif /* CONFIG_MIPS_MT_FPAFF */
316
317static unsigned int itc_base = 0;
318
319static int __init set_itc_base(char *str)
320{
321 get_option(&str, &itc_base);
322 return 1;
323}
324
325__setup("itcbase=", set_itc_base);
326
327void mips_mt_set_cpuoptions(void)
328{
329 unsigned int oconfig7 = read_c0_config7();
330 unsigned int nconfig7 = oconfig7;
331
332 if (mt_opt_norps) {
333 printk("\"norps\" option deprectated: use \"rpsctl=\"\n");
334 }
335 if (mt_opt_rpsctl >= 0) {
336 printk("34K return prediction stack override set to %d.\n",
337 mt_opt_rpsctl);
338 if (mt_opt_rpsctl)
339 nconfig7 |= (1 << 2);
340 else
341 nconfig7 &= ~(1 << 2);
342 }
343 if (mt_opt_nblsu >= 0) {
344 printk("34K ALU/LSU sync override set to %d.\n", mt_opt_nblsu);
345 if (mt_opt_nblsu)
346 nconfig7 |= (1 << 5);
347 else
348 nconfig7 &= ~(1 << 5);
349 }
350 if (mt_opt_forceconfig7) {
351 printk("CP0.Config7 forced to 0x%08x.\n", mt_opt_config7);
352 nconfig7 = mt_opt_config7;
353 }
354 if (oconfig7 != nconfig7) {
355 __asm__ __volatile("sync");
356 write_c0_config7(nconfig7);
357 ehb ();
358 printk("Config7: 0x%08x\n", read_c0_config7());
359 }
360
361 /* Report Cache management debug options */
362 if (mt_protiflush)
363 printk("I-cache flushes single-threaded\n");
364 if (mt_protdflush)
365 printk("D-cache flushes single-threaded\n");
366 if (mt_n_iflushes != 1)
367 printk("I-Cache Flushes Repeated %d times\n", mt_n_iflushes);
368 if (mt_n_dflushes != 1)
369 printk("D-Cache Flushes Repeated %d times\n", mt_n_dflushes);
370
371#ifdef CONFIG_MIPS_MT_FPAFF
372 /* FPU Use Factor empirically derived from experiments on 34K */
373#define FPUSEFACTOR 333
374
375 if (fpaff_threshold >= 0) {
376 mt_fpemul_threshold = fpaff_threshold;
377 } else {
378 mt_fpemul_threshold =
379 (FPUSEFACTOR * (loops_per_jiffy/(500000/HZ))) / HZ;
380 }
381 printk("FPU Affinity set after %ld emulations\n",
382 mt_fpemul_threshold);
383#endif /* CONFIG_MIPS_MT_FPAFF */
384
385 if (itc_base != 0) {
386 /*
387 * Configure ITC mapping. This code is very
388 * specific to the 34K core family, which uses
389 * a special mode bit ("ITC") in the ErrCtl
390 * register to enable access to ITC control
391 * registers via cache "tag" operations.
392 */
393 unsigned long ectlval;
394 unsigned long itcblkgrn;
395
396 /* ErrCtl register is known as "ecc" to Linux */
397 ectlval = read_c0_ecc();
398 write_c0_ecc(ectlval | (0x1 << 26));
399 ehb();
400#define INDEX_0 (0x80000000)
401#define INDEX_8 (0x80000008)
402 /* Read "cache tag" for Dcache pseudo-index 8 */
403 cache_op(Index_Load_Tag_D, INDEX_8);
404 ehb();
405 itcblkgrn = read_c0_dtaglo();
406 itcblkgrn &= 0xfffe0000;
407 /* Set for 128 byte pitch of ITC cells */
408 itcblkgrn |= 0x00000c00;
409 /* Stage in Tag register */
410 write_c0_dtaglo(itcblkgrn);
411 ehb();
412 /* Write out to ITU with CACHE op */
413 cache_op(Index_Store_Tag_D, INDEX_8);
414 /* Now set base address, and turn ITC on with 0x1 bit */
415 write_c0_dtaglo((itc_base & 0xfffffc00) | 0x1 );
416 ehb();
417 /* Write out to ITU with CACHE op */
418 cache_op(Index_Store_Tag_D, INDEX_0);
419 write_c0_ecc(ectlval);
420 ehb();
421 printk("Mapped %ld ITC cells starting at 0x%08x\n",
422 ((itcblkgrn & 0x7fe00000) >> 20), itc_base);
423 }
424}
425
426/*
427 * Function to protect cache flushes from concurrent execution
428 * depends on MP software model chosen.
429 */
430
431void mt_cflush_lockdown(void)
432{
433#ifdef CONFIG_MIPS_MT_SMTC
434 void smtc_cflush_lockdown(void);
435
436 smtc_cflush_lockdown();
437#endif /* CONFIG_MIPS_MT_SMTC */
438 /* FILL IN VSMP and AP/SP VERSIONS HERE */
439}
440
441void mt_cflush_release(void)
442{
443#ifdef CONFIG_MIPS_MT_SMTC
444 void smtc_cflush_release(void);
445
446 smtc_cflush_release();
447#endif /* CONFIG_MIPS_MT_SMTC */
448 /* FILL IN VSMP and AP/SP VERSIONS HERE */
449}
diff --git a/arch/mips/kernel/mips_ksyms.c b/arch/mips/kernel/mips_ksyms.c
index e042f9d2ba31..0a71a4c33716 100644
--- a/arch/mips/kernel/mips_ksyms.c
+++ b/arch/mips/kernel/mips_ksyms.c
@@ -28,21 +28,9 @@ extern long __strnlen_user_asm(const char *s);
28/* 28/*
29 * String functions 29 * String functions
30 */ 30 */
31EXPORT_SYMBOL(memchr);
32EXPORT_SYMBOL(memcmp);
33EXPORT_SYMBOL(memset); 31EXPORT_SYMBOL(memset);
34EXPORT_SYMBOL(memcpy); 32EXPORT_SYMBOL(memcpy);
35EXPORT_SYMBOL(memmove); 33EXPORT_SYMBOL(memmove);
36EXPORT_SYMBOL(strcat);
37EXPORT_SYMBOL(strchr);
38#ifdef CONFIG_64BIT
39EXPORT_SYMBOL(strncmp);
40#endif
41EXPORT_SYMBOL(strlen);
42EXPORT_SYMBOL(strncat);
43EXPORT_SYMBOL(strnlen);
44EXPORT_SYMBOL(strrchr);
45EXPORT_SYMBOL(strstr);
46 34
47EXPORT_SYMBOL(kernel_thread); 35EXPORT_SYMBOL(kernel_thread);
48 36
@@ -61,6 +49,3 @@ EXPORT_SYMBOL(__strnlen_user_asm);
61EXPORT_SYMBOL(csum_partial); 49EXPORT_SYMBOL(csum_partial);
62 50
63EXPORT_SYMBOL(invalid_pte_table); 51EXPORT_SYMBOL(invalid_pte_table);
64#ifdef CONFIG_GENERIC_IRQ_PROBE
65EXPORT_SYMBOL(probe_irq_mask);
66#endif
diff --git a/arch/mips/kernel/module.c b/arch/mips/kernel/module.c
index e54a7f442f8a..d7bf0215bc1d 100644
--- a/arch/mips/kernel/module.c
+++ b/arch/mips/kernel/module.c
@@ -288,6 +288,9 @@ int apply_relocate(Elf_Shdr *sechdrs, const char *strtab,
288 sym = (Elf_Sym *)sechdrs[symindex].sh_addr 288 sym = (Elf_Sym *)sechdrs[symindex].sh_addr
289 + ELF_MIPS_R_SYM(rel[i]); 289 + ELF_MIPS_R_SYM(rel[i]);
290 if (!sym->st_value) { 290 if (!sym->st_value) {
291 /* Ignore unresolved weak symbol */
292 if (ELF_ST_BIND(sym->st_info) == STB_WEAK)
293 continue;
291 printk(KERN_WARNING "%s: Unknown symbol %s\n", 294 printk(KERN_WARNING "%s: Unknown symbol %s\n",
292 me->name, strtab + sym->st_name); 295 me->name, strtab + sym->st_name);
293 return -ENOENT; 296 return -ENOENT;
@@ -325,6 +328,9 @@ int apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab,
325 sym = (Elf_Sym *)sechdrs[symindex].sh_addr 328 sym = (Elf_Sym *)sechdrs[symindex].sh_addr
326 + ELF_MIPS_R_SYM(rel[i]); 329 + ELF_MIPS_R_SYM(rel[i]);
327 if (!sym->st_value) { 330 if (!sym->st_value) {
331 /* Ignore unresolved weak symbol */
332 if (ELF_ST_BIND(sym->st_info) == STB_WEAK)
333 continue;
328 printk(KERN_WARNING "%s: Unknown symbol %s\n", 334 printk(KERN_WARNING "%s: Unknown symbol %s\n",
329 me->name, strtab + sym->st_name); 335 me->name, strtab + sym->st_name);
330 return -ENOENT; 336 return -ENOENT;
diff --git a/arch/mips/kernel/proc.c b/arch/mips/kernel/proc.c
index 84ab959f924a..9def554f335b 100644
--- a/arch/mips/kernel/proc.c
+++ b/arch/mips/kernel/proc.c
@@ -42,6 +42,7 @@ static const char *cpu_name[] = {
42 [CPU_R8000] = "R8000", 42 [CPU_R8000] = "R8000",
43 [CPU_R10000] = "R10000", 43 [CPU_R10000] = "R10000",
44 [CPU_R12000] = "R12000", 44 [CPU_R12000] = "R12000",
45 [CPU_R14000] = "R14000",
45 [CPU_R4300] = "R4300", 46 [CPU_R4300] = "R4300",
46 [CPU_R4650] = "R4650", 47 [CPU_R4650] = "R4650",
47 [CPU_R4700] = "R4700", 48 [CPU_R4700] = "R4700",
@@ -74,6 +75,7 @@ static const char *cpu_name[] = {
74 [CPU_24K] = "MIPS 24K", 75 [CPU_24K] = "MIPS 24K",
75 [CPU_25KF] = "MIPS 25Kf", 76 [CPU_25KF] = "MIPS 25Kf",
76 [CPU_34K] = "MIPS 34K", 77 [CPU_34K] = "MIPS 34K",
78 [CPU_74K] = "MIPS 74K",
77 [CPU_VR4111] = "NEC VR4111", 79 [CPU_VR4111] = "NEC VR4111",
78 [CPU_VR4121] = "NEC VR4121", 80 [CPU_VR4121] = "NEC VR4121",
79 [CPU_VR4122] = "NEC VR4122", 81 [CPU_VR4122] = "NEC VR4122",
diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
index c66db5e5ab62..199a06e873c6 100644
--- a/arch/mips/kernel/process.c
+++ b/arch/mips/kernel/process.c
@@ -41,6 +41,10 @@
41#include <asm/elf.h> 41#include <asm/elf.h>
42#include <asm/isadep.h> 42#include <asm/isadep.h>
43#include <asm/inst.h> 43#include <asm/inst.h>
44#ifdef CONFIG_MIPS_MT_SMTC
45#include <asm/mipsmtregs.h>
46extern void smtc_idle_loop_hook(void);
47#endif /* CONFIG_MIPS_MT_SMTC */
44 48
45/* 49/*
46 * The idle thread. There's no useful work to be done, so just try to conserve 50 * The idle thread. There's no useful work to be done, so just try to conserve
@@ -51,9 +55,13 @@ ATTRIB_NORET void cpu_idle(void)
51{ 55{
52 /* endless idle loop with no priority at all */ 56 /* endless idle loop with no priority at all */
53 while (1) { 57 while (1) {
54 while (!need_resched()) 58 while (!need_resched()) {
59#ifdef CONFIG_MIPS_MT_SMTC
60 smtc_idle_loop_hook();
61#endif /* CONFIG_MIPS_MT_SMTC */
55 if (cpu_wait) 62 if (cpu_wait)
56 (*cpu_wait)(); 63 (*cpu_wait)();
64 }
57 preempt_enable_no_resched(); 65 preempt_enable_no_resched();
58 schedule(); 66 schedule();
59 preempt_disable(); 67 preempt_disable();
@@ -177,6 +185,17 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
177 childregs->cp0_status &= ~(ST0_CU2|ST0_CU1); 185 childregs->cp0_status &= ~(ST0_CU2|ST0_CU1);
178 clear_tsk_thread_flag(p, TIF_USEDFPU); 186 clear_tsk_thread_flag(p, TIF_USEDFPU);
179 187
188#ifdef CONFIG_MIPS_MT_FPAFF
189 /*
190 * FPU affinity support is cleaner if we track the
191 * user-visible CPU affinity from the very beginning.
192 * The generic cpus_allowed mask will already have
193 * been copied from the parent before copy_thread
194 * is invoked.
195 */
196 p->thread.user_cpus_allowed = p->cpus_allowed;
197#endif /* CONFIG_MIPS_MT_FPAFF */
198
180 if (clone_flags & CLONE_SETTLS) 199 if (clone_flags & CLONE_SETTLS)
181 ti->tp_value = regs->regs[7]; 200 ti->tp_value = regs->regs[7];
182 201
diff --git a/arch/mips/kernel/ptrace.c b/arch/mips/kernel/ptrace.c
index f838b36cc765..9b4733c12395 100644
--- a/arch/mips/kernel/ptrace.c
+++ b/arch/mips/kernel/ptrace.c
@@ -248,10 +248,20 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
248 break; 248 break;
249 case FPC_EIR: { /* implementation / version register */ 249 case FPC_EIR: { /* implementation / version register */
250 unsigned int flags; 250 unsigned int flags;
251#ifdef CONFIG_MIPS_MT_SMTC
252 unsigned int irqflags;
253 unsigned int mtflags;
254#endif /* CONFIG_MIPS_MT_SMTC */
251 255
252 if (!cpu_has_fpu) 256 if (!cpu_has_fpu)
253 break; 257 break;
254 258
259#ifdef CONFIG_MIPS_MT_SMTC
260 /* Read-modify-write of Status must be atomic */
261 local_irq_save(irqflags);
262 mtflags = dmt();
263#endif /* CONFIG_MIPS_MT_SMTC */
264
255 preempt_disable(); 265 preempt_disable();
256 if (cpu_has_mipsmt) { 266 if (cpu_has_mipsmt) {
257 unsigned int vpflags = dvpe(); 267 unsigned int vpflags = dvpe();
@@ -266,6 +276,10 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
266 __asm__ __volatile__("cfc1\t%0,$0": "=r" (tmp)); 276 __asm__ __volatile__("cfc1\t%0,$0": "=r" (tmp));
267 write_c0_status(flags); 277 write_c0_status(flags);
268 } 278 }
279#ifdef CONFIG_MIPS_MT_SMTC
280 emt(mtflags);
281 local_irq_restore(irqflags);
282#endif /* CONFIG_MIPS_MT_SMTC */
269 preempt_enable(); 283 preempt_enable();
270 break; 284 break;
271 } 285 }
@@ -469,7 +483,7 @@ static inline int audit_arch(void)
469asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit) 483asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit)
470{ 484{
471 if (unlikely(current->audit_context) && entryexit) 485 if (unlikely(current->audit_context) && entryexit)
472 audit_syscall_exit(current, AUDITSC_RESULT(regs->regs[2]), 486 audit_syscall_exit(AUDITSC_RESULT(regs->regs[2]),
473 regs->regs[2]); 487 regs->regs[2]);
474 488
475 if (!(current->ptrace & PT_PTRACED)) 489 if (!(current->ptrace & PT_PTRACED))
@@ -493,7 +507,7 @@ asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit)
493 } 507 }
494 out: 508 out:
495 if (unlikely(current->audit_context) && !entryexit) 509 if (unlikely(current->audit_context) && !entryexit)
496 audit_syscall_entry(current, audit_arch(), regs->regs[2], 510 audit_syscall_entry(audit_arch(), regs->regs[2],
497 regs->regs[4], regs->regs[5], 511 regs->regs[4], regs->regs[5],
498 regs->regs[6], regs->regs[7]); 512 regs->regs[6], regs->regs[7]);
499} 513}
diff --git a/arch/mips/kernel/ptrace32.c b/arch/mips/kernel/ptrace32.c
index 0d5cf97af727..8704dc0496ea 100644
--- a/arch/mips/kernel/ptrace32.c
+++ b/arch/mips/kernel/ptrace32.c
@@ -173,12 +173,22 @@ asmlinkage int sys32_ptrace(int request, int pid, int addr, int data)
173 break; 173 break;
174 case FPC_EIR: { /* implementation / version register */ 174 case FPC_EIR: { /* implementation / version register */
175 unsigned int flags; 175 unsigned int flags;
176#ifdef CONFIG_MIPS_MT_SMTC
177 unsigned int irqflags;
178 unsigned int mtflags;
179#endif /* CONFIG_MIPS_MT_SMTC */
176 180
177 if (!cpu_has_fpu) { 181 if (!cpu_has_fpu) {
178 tmp = 0; 182 tmp = 0;
179 break; 183 break;
180 } 184 }
181 185
186#ifdef CONFIG_MIPS_MT_SMTC
187 /* Read-modify-write of Status must be atomic */
188 local_irq_save(irqflags);
189 mtflags = dmt();
190#endif /* CONFIG_MIPS_MT_SMTC */
191
182 preempt_disable(); 192 preempt_disable();
183 if (cpu_has_mipsmt) { 193 if (cpu_has_mipsmt) {
184 unsigned int vpflags = dvpe(); 194 unsigned int vpflags = dvpe();
@@ -193,6 +203,10 @@ asmlinkage int sys32_ptrace(int request, int pid, int addr, int data)
193 __asm__ __volatile__("cfc1\t%0,$0": "=r" (tmp)); 203 __asm__ __volatile__("cfc1\t%0,$0": "=r" (tmp));
194 write_c0_status(flags); 204 write_c0_status(flags);
195 } 205 }
206#ifdef CONFIG_MIPS_MT_SMTC
207 emt(mtflags);
208 local_irq_restore(irqflags);
209#endif /* CONFIG_MIPS_MT_SMTC */
196 preempt_enable(); 210 preempt_enable();
197 break; 211 break;
198 } 212 }
diff --git a/arch/mips/kernel/r4k_switch.S b/arch/mips/kernel/r4k_switch.S
index d2afbd19a9c8..0b1b54acee9f 100644
--- a/arch/mips/kernel/r4k_switch.S
+++ b/arch/mips/kernel/r4k_switch.S
@@ -88,7 +88,18 @@
88 88
89 PTR_ADDIU t0, $28, _THREAD_SIZE - 32 89 PTR_ADDIU t0, $28, _THREAD_SIZE - 32
90 set_saved_sp t0, t1, t2 90 set_saved_sp t0, t1, t2
91 91#ifdef CONFIG_MIPS_MT_SMTC
92 /* Read-modify-writes of Status must be atomic on a VPE */
93 mfc0 t2, CP0_TCSTATUS
94 ori t1, t2, TCSTATUS_IXMT
95 mtc0 t1, CP0_TCSTATUS
96 andi t2, t2, TCSTATUS_IXMT
97 ehb
98 DMT 8 # dmt t0
99 move t1,ra
100 jal mips_ihb
101 move ra,t1
102#endif /* CONFIG_MIPS_MT_SMTC */
92 mfc0 t1, CP0_STATUS /* Do we really need this? */ 103 mfc0 t1, CP0_STATUS /* Do we really need this? */
93 li a3, 0xff01 104 li a3, 0xff01
94 and t1, a3 105 and t1, a3
@@ -97,6 +108,18 @@
97 and a2, a3 108 and a2, a3
98 or a2, t1 109 or a2, t1
99 mtc0 a2, CP0_STATUS 110 mtc0 a2, CP0_STATUS
111#ifdef CONFIG_MIPS_MT_SMTC
112 ehb
113 andi t0, t0, VPECONTROL_TE
114 beqz t0, 1f
115 emt
1161:
117 mfc0 t1, CP0_TCSTATUS
118 xori t1, t1, TCSTATUS_IXMT
119 or t1, t1, t2
120 mtc0 t1, CP0_TCSTATUS
121 ehb
122#endif /* CONFIG_MIPS_MT_SMTC */
100 move v0, a0 123 move v0, a0
101 jr ra 124 jr ra
102 END(resume) 125 END(resume)
@@ -131,10 +154,19 @@ LEAF(_restore_fp)
131#define FPU_DEFAULT 0x00000000 154#define FPU_DEFAULT 0x00000000
132 155
133LEAF(_init_fpu) 156LEAF(_init_fpu)
157#ifdef CONFIG_MIPS_MT_SMTC
158 /* Rather than manipulate per-VPE Status, set per-TC bit in TCStatus */
159 mfc0 t0, CP0_TCSTATUS
160 /* Bit position is the same for Status, TCStatus */
161 li t1, ST0_CU1
162 or t0, t1
163 mtc0 t0, CP0_TCSTATUS
164#else /* Normal MIPS CU1 enable */
134 mfc0 t0, CP0_STATUS 165 mfc0 t0, CP0_STATUS
135 li t1, ST0_CU1 166 li t1, ST0_CU1
136 or t0, t1 167 or t0, t1
137 mtc0 t0, CP0_STATUS 168 mtc0 t0, CP0_STATUS
169#endif /* CONFIG_MIPS_MT_SMTC */
138 fpu_enable_hazard 170 fpu_enable_hazard
139 171
140 li t1, FPU_DEFAULT 172 li t1, FPU_DEFAULT
diff --git a/arch/mips/kernel/rtlx.c b/arch/mips/kernel/rtlx.c
index 986a9cf23067..caf777f83289 100644
--- a/arch/mips/kernel/rtlx.c
+++ b/arch/mips/kernel/rtlx.c
@@ -21,45 +21,44 @@
21#include <linux/module.h> 21#include <linux/module.h>
22#include <linux/fs.h> 22#include <linux/fs.h>
23#include <linux/init.h> 23#include <linux/init.h>
24#include <asm/uaccess.h>
25#include <linux/slab.h>
26#include <linux/list.h>
27#include <linux/vmalloc.h>
28#include <linux/elf.h>
29#include <linux/seq_file.h>
30#include <linux/syscalls.h>
31#include <linux/moduleloader.h>
24#include <linux/interrupt.h> 32#include <linux/interrupt.h>
25#include <linux/irq.h>
26#include <linux/poll.h> 33#include <linux/poll.h>
27#include <linux/sched.h> 34#include <linux/sched.h>
28#include <linux/wait.h> 35#include <linux/wait.h>
29
30#include <asm/mipsmtregs.h> 36#include <asm/mipsmtregs.h>
31#include <asm/bitops.h> 37#include <asm/cacheflush.h>
38#include <asm/atomic.h>
32#include <asm/cpu.h> 39#include <asm/cpu.h>
33#include <asm/processor.h> 40#include <asm/processor.h>
41#include <asm/system.h>
42#include <asm/vpe.h>
34#include <asm/rtlx.h> 43#include <asm/rtlx.h>
35#include <asm/uaccess.h>
36 44
37#define RTLX_TARG_VPE 1 45#define RTLX_TARG_VPE 1
38 46
39static struct rtlx_info *rtlx; 47static struct rtlx_info *rtlx;
40static int major; 48static int major;
41static char module_name[] = "rtlx"; 49static char module_name[] = "rtlx";
42static struct irqaction irq;
43static int irq_num;
44
45static inline int spacefree(int read, int write, int size)
46{
47 if (read == write) {
48 /*
49 * never fill the buffer completely, so indexes are always
50 * equal if empty and only empty, or !equal if data available
51 */
52 return size - 1;
53 }
54
55 return ((read + size - write) % size) - 1;
56}
57 50
58static struct chan_waitqueues { 51static struct chan_waitqueues {
59 wait_queue_head_t rt_queue; 52 wait_queue_head_t rt_queue;
60 wait_queue_head_t lx_queue; 53 wait_queue_head_t lx_queue;
54 int in_open;
61} channel_wqs[RTLX_CHANNELS]; 55} channel_wqs[RTLX_CHANNELS];
62 56
57static struct irqaction irq;
58static int irq_num;
59static struct vpe_notifications notify;
60static int sp_stopping = 0;
61
63extern void *vpe_get_shared(int index); 62extern void *vpe_get_shared(int index);
64 63
65static void rtlx_dispatch(struct pt_regs *regs) 64static void rtlx_dispatch(struct pt_regs *regs)
@@ -67,174 +66,298 @@ static void rtlx_dispatch(struct pt_regs *regs)
67 do_IRQ(MIPSCPU_INT_BASE + MIPS_CPU_RTLX_IRQ, regs); 66 do_IRQ(MIPSCPU_INT_BASE + MIPS_CPU_RTLX_IRQ, regs);
68} 67}
69 68
69
70/* Interrupt handler may be called before rtlx_init has otherwise had
71 a chance to run.
72*/
70static irqreturn_t rtlx_interrupt(int irq, void *dev_id, struct pt_regs *regs) 73static irqreturn_t rtlx_interrupt(int irq, void *dev_id, struct pt_regs *regs)
71{ 74{
72 int i; 75 int i;
73 76
74 for (i = 0; i < RTLX_CHANNELS; i++) { 77 for (i = 0; i < RTLX_CHANNELS; i++) {
75 struct rtlx_channel *chan = &rtlx->channel[i]; 78 wake_up(&channel_wqs[i].lx_queue);
76 79 wake_up(&channel_wqs[i].rt_queue);
77 if (chan->lx_read != chan->lx_write)
78 wake_up_interruptible(&channel_wqs[i].lx_queue);
79 } 80 }
80 81
81 return IRQ_HANDLED; 82 return IRQ_HANDLED;
82} 83}
83 84
84/* call when we have the address of the shared structure from the SP side. */ 85static __attribute_used__ void dump_rtlx(void)
85static int rtlx_init(struct rtlx_info *rtlxi)
86{ 86{
87 int i; 87 int i;
88 88
89 if (rtlxi->id != RTLX_ID) { 89 printk("id 0x%lx state %d\n", rtlx->id, rtlx->state);
90 printk(KERN_WARNING "no valid RTLX id at 0x%p\n", rtlxi);
91 return -ENOEXEC;
92 }
93 90
94 /* initialise the wait queues */
95 for (i = 0; i < RTLX_CHANNELS; i++) { 91 for (i = 0; i < RTLX_CHANNELS; i++) {
96 init_waitqueue_head(&channel_wqs[i].rt_queue); 92 struct rtlx_channel *chan = &rtlx->channel[i];
97 init_waitqueue_head(&channel_wqs[i].lx_queue);
98 }
99 93
100 /* set up for interrupt handling */ 94 printk(" rt_state %d lx_state %d buffer_size %d\n",
101 memset(&irq, 0, sizeof(struct irqaction)); 95 chan->rt_state, chan->lx_state, chan->buffer_size);
102 96
103 if (cpu_has_vint) 97 printk(" rt_read %d rt_write %d\n",
104 set_vi_handler(MIPS_CPU_RTLX_IRQ, rtlx_dispatch); 98 chan->rt_read, chan->rt_write);
99
100 printk(" lx_read %d lx_write %d\n",
101 chan->lx_read, chan->lx_write);
105 102
106 irq_num = MIPSCPU_INT_BASE + MIPS_CPU_RTLX_IRQ; 103 printk(" rt_buffer <%s>\n", chan->rt_buffer);
107 irq.handler = rtlx_interrupt; 104 printk(" lx_buffer <%s>\n", chan->lx_buffer);
108 irq.flags = SA_INTERRUPT; 105 }
109 irq.name = "RTLX"; 106}
110 irq.dev_id = rtlx; 107
111 setup_irq(irq_num, &irq); 108/* call when we have the address of the shared structure from the SP side. */
109static int rtlx_init(struct rtlx_info *rtlxi)
110{
111 if (rtlxi->id != RTLX_ID) {
112 printk(KERN_ERR "no valid RTLX id at 0x%p 0x%x\n", rtlxi, rtlxi->id);
113 return -ENOEXEC;
114 }
112 115
113 rtlx = rtlxi; 116 rtlx = rtlxi;
114 117
115 return 0; 118 return 0;
116} 119}
117 120
118/* only allow one open process at a time to open each channel */ 121/* notifications */
119static int rtlx_open(struct inode *inode, struct file *filp) 122static void starting(int vpe)
123{
124 int i;
125 sp_stopping = 0;
126
127 /* force a reload of rtlx */
128 rtlx=NULL;
129
130 /* wake up any sleeping rtlx_open's */
131 for (i = 0; i < RTLX_CHANNELS; i++)
132 wake_up_interruptible(&channel_wqs[i].lx_queue);
133}
134
135static void stopping(int vpe)
120{ 136{
121 int minor, ret; 137 int i;
138
139 sp_stopping = 1;
140 for (i = 0; i < RTLX_CHANNELS; i++)
141 wake_up_interruptible(&channel_wqs[i].lx_queue);
142}
143
144
145int rtlx_open(int index, int can_sleep)
146{
147 int ret;
122 struct rtlx_channel *chan; 148 struct rtlx_channel *chan;
149 volatile struct rtlx_info **p;
123 150
124 /* assume only 1 device at the mo. */ 151 if (index >= RTLX_CHANNELS) {
125 minor = MINOR(inode->i_rdev); 152 printk(KERN_DEBUG "rtlx_open index out of range\n");
153 return -ENOSYS;
154 }
155
156 if (channel_wqs[index].in_open) {
157 printk(KERN_DEBUG "rtlx_open channel %d already opened\n", index);
158 return -EBUSY;
159 }
160
161 channel_wqs[index].in_open++;
126 162
127 if (rtlx == NULL) { 163 if (rtlx == NULL) {
128 struct rtlx_info **p;
129 if( (p = vpe_get_shared(RTLX_TARG_VPE)) == NULL) { 164 if( (p = vpe_get_shared(RTLX_TARG_VPE)) == NULL) {
130 printk(KERN_ERR "vpe_get_shared is NULL. " 165 if (can_sleep) {
131 "Has an SP program been loaded?\n"); 166 DECLARE_WAITQUEUE(wait, current);
132 return -EFAULT; 167
168 /* go to sleep */
169 add_wait_queue(&channel_wqs[index].lx_queue, &wait);
170
171 set_current_state(TASK_INTERRUPTIBLE);
172 while ((p = vpe_get_shared(RTLX_TARG_VPE)) == NULL) {
173 schedule();
174 set_current_state(TASK_INTERRUPTIBLE);
175 }
176
177 set_current_state(TASK_RUNNING);
178 remove_wait_queue(&channel_wqs[index].lx_queue, &wait);
179
180 /* back running */
181 } else {
182 printk( KERN_DEBUG "No SP program loaded, and device "
183 "opened with O_NONBLOCK\n");
184 channel_wqs[index].in_open = 0;
185 return -ENOSYS;
186 }
133 } 187 }
134 188
135 if (*p == NULL) { 189 if (*p == NULL) {
136 printk(KERN_ERR "vpe_shared %p %p\n", p, *p); 190 if (can_sleep) {
137 return -EFAULT; 191 DECLARE_WAITQUEUE(wait, current);
192
193 /* go to sleep */
194 add_wait_queue(&channel_wqs[index].lx_queue, &wait);
195
196 set_current_state(TASK_INTERRUPTIBLE);
197 while (*p == NULL) {
198 schedule();
199
200 /* reset task state to interruptable otherwise
201 we'll whizz round here like a very fast loopy
202 thing. schedule() appears to return with state
203 set to TASK_RUNNING.
204
205 If the loaded SP program, for whatever reason,
206 doesn't set up the shared structure *p will never
207 become true. So whoever connected to either /dev/rt?
208 or if it was kspd, will then take up rather a lot of
209 processor cycles.
210 */
211
212 set_current_state(TASK_INTERRUPTIBLE);
213 }
214
215 set_current_state(TASK_RUNNING);
216 remove_wait_queue(&channel_wqs[index].lx_queue, &wait);
217
218 /* back running */
219 }
220 else {
221 printk(" *vpe_get_shared is NULL. "
222 "Has an SP program been loaded?\n");
223 channel_wqs[index].in_open = 0;
224 return -ENOSYS;
225 }
138 } 226 }
139 227
140 if ((ret = rtlx_init(*p)) < 0) 228 if ((unsigned int)*p < KSEG0) {
141 return ret; 229 printk(KERN_WARNING "vpe_get_shared returned an invalid pointer "
230 "maybe an error code %d\n", (int)*p);
231 channel_wqs[index].in_open = 0;
232 return -ENOSYS;
233 }
234
235 if ((ret = rtlx_init(*p)) < 0) {
236 channel_wqs[index].in_open = 0;
237 return ret;
238 }
142 } 239 }
143 240
144 chan = &rtlx->channel[minor]; 241 chan = &rtlx->channel[index];
145 242
146 if (test_and_set_bit(RTLX_STATE_OPENED, &chan->lx_state)) 243 if (chan->lx_state == RTLX_STATE_OPENED) {
147 return -EBUSY; 244 channel_wqs[index].in_open = 0;
245 return -EBUSY;
246 }
148 247
248 chan->lx_state = RTLX_STATE_OPENED;
249 channel_wqs[index].in_open = 0;
149 return 0; 250 return 0;
150} 251}
151 252
152static int rtlx_release(struct inode *inode, struct file *filp) 253int rtlx_release(int index)
153{ 254{
154 int minor = MINOR(inode->i_rdev); 255 rtlx->channel[index].lx_state = RTLX_STATE_UNUSED;
155
156 clear_bit(RTLX_STATE_OPENED, &rtlx->channel[minor].lx_state);
157 smp_mb__after_clear_bit();
158
159 return 0; 256 return 0;
160} 257}
161 258
162static unsigned int rtlx_poll(struct file *file, poll_table * wait) 259unsigned int rtlx_read_poll(int index, int can_sleep)
163{ 260{
164 int minor; 261 struct rtlx_channel *chan;
165 unsigned int mask = 0;
166 struct rtlx_channel *chan;
167 262
168 minor = MINOR(file->f_dentry->d_inode->i_rdev); 263 if (rtlx == NULL)
169 chan = &rtlx->channel[minor]; 264 return 0;
170 265
171 poll_wait(file, &channel_wqs[minor].rt_queue, wait); 266 chan = &rtlx->channel[index];
172 poll_wait(file, &channel_wqs[minor].lx_queue, wait);
173 267
174 /* data available to read? */ 268 /* data available to read? */
175 if (chan->lx_read != chan->lx_write) 269 if (chan->lx_read == chan->lx_write) {
176 mask |= POLLIN | POLLRDNORM; 270 if (can_sleep) {
271 DECLARE_WAITQUEUE(wait, current);
177 272
178 /* space to write */ 273 /* go to sleep */
179 if (spacefree(chan->rt_read, chan->rt_write, chan->buffer_size)) 274 add_wait_queue(&channel_wqs[index].lx_queue, &wait);
180 mask |= POLLOUT | POLLWRNORM;
181 275
182 return mask; 276 set_current_state(TASK_INTERRUPTIBLE);
277 while (chan->lx_read == chan->lx_write) {
278 schedule();
279
280 set_current_state(TASK_INTERRUPTIBLE);
281
282 if (sp_stopping) {
283 set_current_state(TASK_RUNNING);
284 remove_wait_queue(&channel_wqs[index].lx_queue, &wait);
285 return 0;
286 }
287 }
288
289 set_current_state(TASK_RUNNING);
290 remove_wait_queue(&channel_wqs[index].lx_queue, &wait);
291
292 /* back running */
293 }
294 else
295 return 0;
296 }
297
298 return (chan->lx_write + chan->buffer_size - chan->lx_read)
299 % chan->buffer_size;
183} 300}
184 301
185static ssize_t rtlx_read(struct file *file, char __user * buffer, size_t count, 302static inline int write_spacefree(int read, int write, int size)
186 loff_t * ppos)
187{ 303{
188 unsigned long failed; 304 if (read == write) {
189 size_t fl = 0L; 305 /*
190 int minor; 306 * Never fill the buffer completely, so indexes are always
191 struct rtlx_channel *lx; 307 * equal if empty and only empty, or !equal if data available
192 DECLARE_WAITQUEUE(wait, current); 308 */
309 return size - 1;
310 }
193 311
194 minor = MINOR(file->f_dentry->d_inode->i_rdev); 312 return ((read + size - write) % size) - 1;
195 lx = &rtlx->channel[minor]; 313}
196 314
197 /* data available? */ 315unsigned int rtlx_write_poll(int index)
198 if (lx->lx_write == lx->lx_read) { 316{
199 if (file->f_flags & O_NONBLOCK) 317 struct rtlx_channel *chan = &rtlx->channel[index];
200 return 0; /* -EAGAIN makes cat whinge */ 318 return write_spacefree(chan->rt_read, chan->rt_write, chan->buffer_size);
319}
201 320
202 /* go to sleep */ 321static inline void copy_to(void *dst, void *src, size_t count, int user)
203 add_wait_queue(&channel_wqs[minor].lx_queue, &wait); 322{
204 set_current_state(TASK_INTERRUPTIBLE); 323 if (user)
324 copy_to_user(dst, src, count);
325 else
326 memcpy(dst, src, count);
327}
205 328
206 while (lx->lx_write == lx->lx_read) 329static inline void copy_from(void *dst, void *src, size_t count, int user)
207 schedule(); 330{
331 if (user)
332 copy_from_user(dst, src, count);
333 else
334 memcpy(dst, src, count);
335}
208 336
209 set_current_state(TASK_RUNNING); 337ssize_t rtlx_read(int index, void *buff, size_t count, int user)
210 remove_wait_queue(&channel_wqs[minor].lx_queue, &wait); 338{
339 size_t fl = 0L;
340 struct rtlx_channel *lx;
211 341
212 /* back running */ 342 if (rtlx == NULL)
213 } 343 return -ENOSYS;
344
345 lx = &rtlx->channel[index];
214 346
215 /* find out how much in total */ 347 /* find out how much in total */
216 count = min(count, 348 count = min(count,
217 (size_t)(lx->lx_write + lx->buffer_size - lx->lx_read) % lx->buffer_size); 349 (size_t)(lx->lx_write + lx->buffer_size - lx->lx_read)
350 % lx->buffer_size);
218 351
219 /* then how much from the read pointer onwards */ 352 /* then how much from the read pointer onwards */
220 fl = min(count, (size_t)lx->buffer_size - lx->lx_read); 353 fl = min( count, (size_t)lx->buffer_size - lx->lx_read);
221 354
222 failed = copy_to_user (buffer, &lx->lx_buffer[lx->lx_read], fl); 355 copy_to(buff, &lx->lx_buffer[lx->lx_read], fl, user);
223 if (failed) {
224 count = fl - failed;
225 goto out;
226 }
227 356
228 /* and if there is anything left at the beginning of the buffer */ 357 /* and if there is anything left at the beginning of the buffer */
229 if (count - fl) { 358 if ( count - fl )
230 failed = copy_to_user (buffer + fl, lx->lx_buffer, count - fl); 359 copy_to (buff + fl, lx->lx_buffer, count - fl, user);
231 if (failed) {
232 count -= failed;
233 goto out;
234 }
235 }
236 360
237out:
238 /* update the index */ 361 /* update the index */
239 lx->lx_read += count; 362 lx->lx_read += count;
240 lx->lx_read %= lx->buffer_size; 363 lx->lx_read %= lx->buffer_size;
@@ -242,20 +365,100 @@ out:
242 return count; 365 return count;
243} 366}
244 367
245static ssize_t rtlx_write(struct file *file, const char __user * buffer, 368ssize_t rtlx_write(int index, void *buffer, size_t count, int user)
369{
370 struct rtlx_channel *rt;
371 size_t fl;
372
373 if (rtlx == NULL)
374 return(-ENOSYS);
375
376 rt = &rtlx->channel[index];
377
378 /* total number of bytes to copy */
379 count = min(count,
380 (size_t)write_spacefree(rt->rt_read, rt->rt_write,
381 rt->buffer_size));
382
383 /* first bit from write pointer to the end of the buffer, or count */
384 fl = min(count, (size_t) rt->buffer_size - rt->rt_write);
385
386 copy_from (&rt->rt_buffer[rt->rt_write], buffer, fl, user);
387
388 /* if there's any left copy to the beginning of the buffer */
389 if( count - fl )
390 copy_from (rt->rt_buffer, buffer + fl, count - fl, user);
391
392 rt->rt_write += count;
393 rt->rt_write %= rt->buffer_size;
394
395 return(count);
396}
397
398
399static int file_open(struct inode *inode, struct file *filp)
400{
401 int minor = iminor(inode);
402
403 return rtlx_open(minor, (filp->f_flags & O_NONBLOCK) ? 0 : 1);
404}
405
406static int file_release(struct inode *inode, struct file *filp)
407{
408 int minor = iminor(inode);
409
410 return rtlx_release(minor);
411}
412
413static unsigned int file_poll(struct file *file, poll_table * wait)
414{
415 int minor;
416 unsigned int mask = 0;
417
418 minor = iminor(file->f_dentry->d_inode);
419
420 poll_wait(file, &channel_wqs[minor].rt_queue, wait);
421 poll_wait(file, &channel_wqs[minor].lx_queue, wait);
422
423 if (rtlx == NULL)
424 return 0;
425
426 /* data available to read? */
427 if (rtlx_read_poll(minor, 0))
428 mask |= POLLIN | POLLRDNORM;
429
430 /* space to write */
431 if (rtlx_write_poll(minor))
432 mask |= POLLOUT | POLLWRNORM;
433
434 return mask;
435}
436
437static ssize_t file_read(struct file *file, char __user * buffer, size_t count,
438 loff_t * ppos)
439{
440 int minor = iminor(file->f_dentry->d_inode);
441
442 /* data available? */
443 if (!rtlx_read_poll(minor, (file->f_flags & O_NONBLOCK) ? 0 : 1)) {
444 return 0; // -EAGAIN makes cat whinge
445 }
446
447 return rtlx_read(minor, buffer, count, 1);
448}
449
450static ssize_t file_write(struct file *file, const char __user * buffer,
246 size_t count, loff_t * ppos) 451 size_t count, loff_t * ppos)
247{ 452{
248 unsigned long failed;
249 int minor; 453 int minor;
250 struct rtlx_channel *rt; 454 struct rtlx_channel *rt;
251 size_t fl;
252 DECLARE_WAITQUEUE(wait, current); 455 DECLARE_WAITQUEUE(wait, current);
253 456
254 minor = MINOR(file->f_dentry->d_inode->i_rdev); 457 minor = iminor(file->f_dentry->d_inode);
255 rt = &rtlx->channel[minor]; 458 rt = &rtlx->channel[minor];
256 459
257 /* any space left... */ 460 /* any space left... */
258 if (!spacefree(rt->rt_read, rt->rt_write, rt->buffer_size)) { 461 if (!rtlx_write_poll(minor)) {
259 462
260 if (file->f_flags & O_NONBLOCK) 463 if (file->f_flags & O_NONBLOCK)
261 return -EAGAIN; 464 return -EAGAIN;
@@ -263,61 +466,64 @@ static ssize_t rtlx_write(struct file *file, const char __user * buffer,
263 add_wait_queue(&channel_wqs[minor].rt_queue, &wait); 466 add_wait_queue(&channel_wqs[minor].rt_queue, &wait);
264 set_current_state(TASK_INTERRUPTIBLE); 467 set_current_state(TASK_INTERRUPTIBLE);
265 468
266 while (!spacefree(rt->rt_read, rt->rt_write, rt->buffer_size)) 469 while (!rtlx_write_poll(minor))
267 schedule(); 470 schedule();
268 471
269 set_current_state(TASK_RUNNING); 472 set_current_state(TASK_RUNNING);
270 remove_wait_queue(&channel_wqs[minor].rt_queue, &wait); 473 remove_wait_queue(&channel_wqs[minor].rt_queue, &wait);
271 } 474 }
272 475
273 /* total number of bytes to copy */ 476 return rtlx_write(minor, (void *)buffer, count, 1);
274 count = min(count, (size_t)spacefree(rt->rt_read, rt->rt_write, rt->buffer_size) );
275
276 /* first bit from write pointer to the end of the buffer, or count */
277 fl = min(count, (size_t) rt->buffer_size - rt->rt_write);
278
279 failed = copy_from_user(&rt->rt_buffer[rt->rt_write], buffer, fl);
280 if (failed) {
281 count = fl - failed;
282 goto out;
283 }
284
285 /* if there's any left copy to the beginning of the buffer */
286 if (count - fl) {
287 failed = copy_from_user(rt->rt_buffer, buffer + fl, count - fl);
288 if (failed) {
289 count -= failed;
290 goto out;
291 }
292 }
293
294out:
295 rt->rt_write += count;
296 rt->rt_write %= rt->buffer_size;
297
298 return count;
299} 477}
300 478
301static struct file_operations rtlx_fops = { 479static struct file_operations rtlx_fops = {
302 .owner = THIS_MODULE, 480 .owner = THIS_MODULE,
303 .open = rtlx_open, 481 .open = file_open,
304 .release = rtlx_release, 482 .release = file_release,
305 .write = rtlx_write, 483 .write = file_write,
306 .read = rtlx_read, 484 .read = file_read,
307 .poll = rtlx_poll 485 .poll = file_poll
486};
487
488static struct irqaction rtlx_irq = {
489 .handler = rtlx_interrupt,
490 .flags = SA_INTERRUPT,
491 .name = "RTLX",
308}; 492};
309 493
494static int rtlx_irq_num = MIPSCPU_INT_BASE + MIPS_CPU_RTLX_IRQ;
495
310static char register_chrdev_failed[] __initdata = 496static char register_chrdev_failed[] __initdata =
311 KERN_ERR "rtlx_module_init: unable to register device\n"; 497 KERN_ERR "rtlx_module_init: unable to register device\n";
312 498
313static int __init rtlx_module_init(void) 499static int rtlx_module_init(void)
314{ 500{
501 int i;
502
315 major = register_chrdev(0, module_name, &rtlx_fops); 503 major = register_chrdev(0, module_name, &rtlx_fops);
316 if (major < 0) { 504 if (major < 0) {
317 printk(register_chrdev_failed); 505 printk(register_chrdev_failed);
318 return major; 506 return major;
319 } 507 }
320 508
509 /* initialise the wait queues */
510 for (i = 0; i < RTLX_CHANNELS; i++) {
511 init_waitqueue_head(&channel_wqs[i].rt_queue);
512 init_waitqueue_head(&channel_wqs[i].lx_queue);
513 channel_wqs[i].in_open = 0;
514 }
515
516 /* set up notifiers */
517 notify.start = starting;
518 notify.stop = stopping;
519 vpe_notify(RTLX_TARG_VPE, &notify);
520
521 if (cpu_has_vint)
522 set_vi_handler(MIPS_CPU_RTLX_IRQ, rtlx_dispatch);
523
524 rtlx_irq.dev_id = rtlx;
525 setup_irq(rtlx_irq_num, &rtlx_irq);
526
321 return 0; 527 return 0;
322} 528}
323 529
@@ -330,5 +536,5 @@ module_init(rtlx_module_init);
330module_exit(rtlx_module_exit); 536module_exit(rtlx_module_exit);
331 537
332MODULE_DESCRIPTION("MIPS RTLX"); 538MODULE_DESCRIPTION("MIPS RTLX");
333MODULE_AUTHOR("Elizabeth Clarke, MIPS Technologies, Inc."); 539MODULE_AUTHOR("Elizabeth Oldham, MIPS Technologies, Inc.");
334MODULE_LICENSE("GPL"); 540MODULE_LICENSE("GPL");
diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S
index 2f2dc54b2e26..a0ac0e5f61ad 100644
--- a/arch/mips/kernel/scall32-o32.S
+++ b/arch/mips/kernel/scall32-o32.S
@@ -569,8 +569,19 @@ einval: li v0, -EINVAL
569 sys sys_tkill 2 569 sys sys_tkill 2
570 sys sys_sendfile64 5 570 sys sys_sendfile64 5
571 sys sys_futex 6 571 sys sys_futex 6
572#ifdef CONFIG_MIPS_MT_FPAFF
573 /*
574 * For FPU affinity scheduling on MIPS MT processors, we need to
575 * intercept sys_sched_xxxaffinity() calls until we get a proper hook
576 * in kernel/sched.c. Considered only temporary we only support these
577 * hooks for the 32-bit kernel - there is no MIPS64 MT processor atm.
578 */
579 sys mipsmt_sys_sched_setaffinity 3
580 sys mipsmt_sys_sched_getaffinity 3
581#else
572 sys sys_sched_setaffinity 3 582 sys sys_sched_setaffinity 3
573 sys sys_sched_getaffinity 3 /* 4240 */ 583 sys sys_sched_getaffinity 3 /* 4240 */
584#endif /* CONFIG_MIPS_MT_FPAFF */
574 sys sys_io_setup 2 585 sys sys_io_setup 2
575 sys sys_io_destroy 1 586 sys sys_io_destroy 1
576 sys sys_io_getevents 5 587 sys sys_io_getevents 5
@@ -634,6 +645,8 @@ einval: li v0, -EINVAL
634 sys sys_pselect6 6 645 sys sys_pselect6 6
635 sys sys_ppoll 5 646 sys sys_ppoll 5
636 sys sys_unshare 1 647 sys sys_unshare 1
648 sys sys_splice 4
649 sys sys_sync_file_range 7 /* 4305 */
637 .endm 650 .endm
638 651
639 /* We pre-compute the number of _instruction_ bytes needed to 652 /* We pre-compute the number of _instruction_ bytes needed to
diff --git a/arch/mips/kernel/scall64-64.S b/arch/mips/kernel/scall64-64.S
index 98bf25df56f3..9ba750887377 100644
--- a/arch/mips/kernel/scall64-64.S
+++ b/arch/mips/kernel/scall64-64.S
@@ -460,3 +460,5 @@ sys_call_table:
460 PTR sys_pselect6 /* 5260 */ 460 PTR sys_pselect6 /* 5260 */
461 PTR sys_ppoll 461 PTR sys_ppoll
462 PTR sys_unshare 462 PTR sys_unshare
463 PTR sys_splice
464 PTR sys_sync_file_range
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S
index 05a2c0567dae..942aca26f9c4 100644
--- a/arch/mips/kernel/scall64-n32.S
+++ b/arch/mips/kernel/scall64-n32.S
@@ -386,3 +386,5 @@ EXPORT(sysn32_call_table)
386 PTR sys_pselect6 386 PTR sys_pselect6
387 PTR sys_ppoll /* 6265 */ 387 PTR sys_ppoll /* 6265 */
388 PTR sys_unshare 388 PTR sys_unshare
389 PTR sys_splice
390 PTR sys_sync_file_range
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S
index 19c4ca481b02..8efb23a84131 100644
--- a/arch/mips/kernel/scall64-o32.S
+++ b/arch/mips/kernel/scall64-o32.S
@@ -209,7 +209,7 @@ sys_call_table:
209 PTR sys_fork 209 PTR sys_fork
210 PTR sys_read 210 PTR sys_read
211 PTR sys_write 211 PTR sys_write
212 PTR sys_open /* 4005 */ 212 PTR compat_sys_open /* 4005 */
213 PTR sys_close 213 PTR sys_close
214 PTR sys_waitpid 214 PTR sys_waitpid
215 PTR sys_creat 215 PTR sys_creat
@@ -508,4 +508,6 @@ sys_call_table:
508 PTR sys_pselect6 508 PTR sys_pselect6
509 PTR sys_ppoll 509 PTR sys_ppoll
510 PTR sys_unshare 510 PTR sys_unshare
511 PTR sys_splice
512 PTR sys32_sync_file_range /* 4305 */
511 .size sys_call_table,.-sys_call_table 513 .size sys_call_table,.-sys_call_table
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index dcbfd27071f0..397a70e651b5 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -246,7 +246,7 @@ static inline int parse_rd_cmdline(unsigned long* rd_start, unsigned long* rd_en
246#ifdef CONFIG_64BIT 246#ifdef CONFIG_64BIT
247 /* HACK: Guess if the sign extension was forgotten */ 247 /* HACK: Guess if the sign extension was forgotten */
248 if (start > 0x0000000080000000 && start < 0x00000000ffffffff) 248 if (start > 0x0000000080000000 && start < 0x00000000ffffffff)
249 start |= 0xffffffff00000000; 249 start |= 0xffffffff00000000UL;
250#endif 250#endif
251 251
252 end = start + size; 252 end = start + size;
@@ -355,8 +355,6 @@ static inline void bootmem_init(void)
355 } 355 }
356#endif 356#endif
357 357
358 memory_present(0, first_usable_pfn, max_low_pfn);
359
360 /* Initialize the boot-time allocator with low memory only. */ 358 /* Initialize the boot-time allocator with low memory only. */
361 bootmap_size = init_bootmem(first_usable_pfn, max_low_pfn); 359 bootmap_size = init_bootmem(first_usable_pfn, max_low_pfn);
362 360
@@ -410,6 +408,7 @@ static inline void bootmem_init(void)
410 408
411 /* Register lowmem ranges */ 409 /* Register lowmem ranges */
412 free_bootmem(PFN_PHYS(curr_pfn), PFN_PHYS(size)); 410 free_bootmem(PFN_PHYS(curr_pfn), PFN_PHYS(size));
411 memory_present(0, curr_pfn, curr_pfn + size - 1);
413 } 412 }
414 413
415 /* Reserve the bootmap memory. */ 414 /* Reserve the bootmap memory. */
@@ -419,17 +418,20 @@ static inline void bootmem_init(void)
419#ifdef CONFIG_BLK_DEV_INITRD 418#ifdef CONFIG_BLK_DEV_INITRD
420 initrd_below_start_ok = 1; 419 initrd_below_start_ok = 1;
421 if (initrd_start) { 420 if (initrd_start) {
422 unsigned long initrd_size = ((unsigned char *)initrd_end) - ((unsigned char *)initrd_start); 421 unsigned long initrd_size = ((unsigned char *)initrd_end) -
422 ((unsigned char *)initrd_start);
423 const int width = sizeof(long) * 2;
424
423 printk("Initial ramdisk at: 0x%p (%lu bytes)\n", 425 printk("Initial ramdisk at: 0x%p (%lu bytes)\n",
424 (void *)initrd_start, initrd_size); 426 (void *)initrd_start, initrd_size);
425 427
426 if (CPHYSADDR(initrd_end) > PFN_PHYS(max_low_pfn)) { 428 if (CPHYSADDR(initrd_end) > PFN_PHYS(max_low_pfn)) {
427 printk("initrd extends beyond end of memory " 429 printk("initrd extends beyond end of memory "
428 "(0x%0*Lx > 0x%0*Lx)\ndisabling initrd\n", 430 "(0x%0*Lx > 0x%0*Lx)\ndisabling initrd\n",
429 sizeof(long) * 2, 431 width,
430 (unsigned long long)CPHYSADDR(initrd_end), 432 (unsigned long long) CPHYSADDR(initrd_end),
431 sizeof(long) * 2, 433 width,
432 (unsigned long long)PFN_PHYS(max_low_pfn)); 434 (unsigned long long) PFN_PHYS(max_low_pfn));
433 initrd_start = initrd_end = 0; 435 initrd_start = initrd_end = 0;
434 initrd_reserve_bootmem = 0; 436 initrd_reserve_bootmem = 0;
435 } 437 }
@@ -529,7 +531,10 @@ void __init setup_arch(char **cmdline_p)
529 531
530int __init fpu_disable(char *s) 532int __init fpu_disable(char *s)
531{ 533{
532 cpu_data[0].options &= ~MIPS_CPU_FPU; 534 int i;
535
536 for (i = 0; i < NR_CPUS; i++)
537 cpu_data[i].options &= ~MIPS_CPU_FPU;
533 538
534 return 1; 539 return 1;
535} 540}
diff --git a/arch/mips/kernel/signal-common.h b/arch/mips/kernel/signal-common.h
index 3ca786215d48..ce6cb915c0a7 100644
--- a/arch/mips/kernel/signal-common.h
+++ b/arch/mips/kernel/signal-common.h
@@ -31,7 +31,6 @@ setup_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc)
31 save_gp_reg(31); 31 save_gp_reg(31);
32#undef save_gp_reg 32#undef save_gp_reg
33 33
34#ifdef CONFIG_32BIT
35 err |= __put_user(regs->hi, &sc->sc_mdhi); 34 err |= __put_user(regs->hi, &sc->sc_mdhi);
36 err |= __put_user(regs->lo, &sc->sc_mdlo); 35 err |= __put_user(regs->lo, &sc->sc_mdlo);
37 if (cpu_has_dsp) { 36 if (cpu_has_dsp) {
@@ -43,20 +42,6 @@ setup_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc)
43 err |= __put_user(mflo3(), &sc->sc_lo3); 42 err |= __put_user(mflo3(), &sc->sc_lo3);
44 err |= __put_user(rddsp(DSP_MASK), &sc->sc_dsp); 43 err |= __put_user(rddsp(DSP_MASK), &sc->sc_dsp);
45 } 44 }
46#endif
47#ifdef CONFIG_64BIT
48 err |= __put_user(regs->hi, &sc->sc_hi[0]);
49 err |= __put_user(regs->lo, &sc->sc_lo[0]);
50 if (cpu_has_dsp) {
51 err |= __put_user(mfhi1(), &sc->sc_hi[1]);
52 err |= __put_user(mflo1(), &sc->sc_lo[1]);
53 err |= __put_user(mfhi2(), &sc->sc_hi[2]);
54 err |= __put_user(mflo2(), &sc->sc_lo[2]);
55 err |= __put_user(mfhi3(), &sc->sc_hi[3]);
56 err |= __put_user(mflo3(), &sc->sc_lo[3]);
57 err |= __put_user(rddsp(DSP_MASK), &sc->sc_dsp);
58 }
59#endif
60 45
61 err |= __put_user(!!used_math(), &sc->sc_used_math); 46 err |= __put_user(!!used_math(), &sc->sc_used_math);
62 47
@@ -92,7 +77,6 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc)
92 current_thread_info()->restart_block.fn = do_no_restart_syscall; 77 current_thread_info()->restart_block.fn = do_no_restart_syscall;
93 78
94 err |= __get_user(regs->cp0_epc, &sc->sc_pc); 79 err |= __get_user(regs->cp0_epc, &sc->sc_pc);
95#ifdef CONFIG_32BIT
96 err |= __get_user(regs->hi, &sc->sc_mdhi); 80 err |= __get_user(regs->hi, &sc->sc_mdhi);
97 err |= __get_user(regs->lo, &sc->sc_mdlo); 81 err |= __get_user(regs->lo, &sc->sc_mdlo);
98 if (cpu_has_dsp) { 82 if (cpu_has_dsp) {
@@ -104,20 +88,6 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc)
104 err |= __get_user(treg, &sc->sc_lo3); mtlo3(treg); 88 err |= __get_user(treg, &sc->sc_lo3); mtlo3(treg);
105 err |= __get_user(treg, &sc->sc_dsp); wrdsp(treg, DSP_MASK); 89 err |= __get_user(treg, &sc->sc_dsp); wrdsp(treg, DSP_MASK);
106 } 90 }
107#endif
108#ifdef CONFIG_64BIT
109 err |= __get_user(regs->hi, &sc->sc_hi[0]);
110 err |= __get_user(regs->lo, &sc->sc_lo[0]);
111 if (cpu_has_dsp) {
112 err |= __get_user(treg, &sc->sc_hi[1]); mthi1(treg);
113 err |= __get_user(treg, &sc->sc_lo[1]); mthi1(treg);
114 err |= __get_user(treg, &sc->sc_hi[2]); mthi2(treg);
115 err |= __get_user(treg, &sc->sc_lo[2]); mthi2(treg);
116 err |= __get_user(treg, &sc->sc_hi[3]); mthi3(treg);
117 err |= __get_user(treg, &sc->sc_lo[3]); mthi3(treg);
118 err |= __get_user(treg, &sc->sc_dsp); wrdsp(treg, DSP_MASK);
119 }
120#endif
121 91
122#define restore_gp_reg(i) do { \ 92#define restore_gp_reg(i) do { \
123 err |= __get_user(regs->regs[i], &sc->sc_regs[i]); \ 93 err |= __get_user(regs->regs[i], &sc->sc_regs[i]); \
diff --git a/arch/mips/kernel/smp_mt.c b/arch/mips/kernel/smp-mt.c
index 993b8bf56aaf..57770902b9ae 100644
--- a/arch/mips/kernel/smp_mt.c
+++ b/arch/mips/kernel/smp-mt.c
@@ -1,8 +1,4 @@
1/* 1/*
2 * Copyright (C) 2004, 2005 MIPS Technologies, Inc. All rights reserved.
3 *
4 * Elizabeth Clarke (beth@mips.com)
5 *
6 * This program is free software; you can distribute it and/or modify it 2 * This program is free software; you can distribute it and/or modify it
7 * under the terms of the GNU General Public License (Version 2) as 3 * under the terms of the GNU General Public License (Version 2) as
8 * published by the Free Software Foundation. 4 * published by the Free Software Foundation.
@@ -16,6 +12,10 @@
16 * with this program; if not, write to the Free Software Foundation, Inc., 12 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. 13 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
18 * 14 *
15 * Copyright (C) 2004, 05, 06 MIPS Technologies, Inc.
16 * Elizabeth Clarke (beth@mips.com)
17 * Ralf Baechle (ralf@linux-mips.org)
18 * Copyright (C) 2006 Ralf Baechle (ralf@linux-mips.org)
19 */ 19 */
20#include <linux/kernel.h> 20#include <linux/kernel.h>
21#include <linux/sched.h> 21#include <linux/sched.h>
@@ -24,6 +24,7 @@
24#include <linux/compiler.h> 24#include <linux/compiler.h>
25 25
26#include <asm/atomic.h> 26#include <asm/atomic.h>
27#include <asm/cacheflush.h>
27#include <asm/cpu.h> 28#include <asm/cpu.h>
28#include <asm/processor.h> 29#include <asm/processor.h>
29#include <asm/system.h> 30#include <asm/system.h>
@@ -33,8 +34,8 @@
33#include <asm/time.h> 34#include <asm/time.h>
34#include <asm/mipsregs.h> 35#include <asm/mipsregs.h>
35#include <asm/mipsmtregs.h> 36#include <asm/mipsmtregs.h>
36#include <asm/cacheflush.h> 37#include <asm/mips_mt.h>
37#include <asm/mips-boards/maltaint.h> 38#include <asm/mips-boards/maltaint.h> /* This is f*cking wrong */
38 39
39#define MIPS_CPU_IPI_RESCHED_IRQ 0 40#define MIPS_CPU_IPI_RESCHED_IRQ 0
40#define MIPS_CPU_IPI_CALL_IRQ 1 41#define MIPS_CPU_IPI_CALL_IRQ 1
@@ -66,6 +67,7 @@ void __init sanitize_tlb_entries(void)
66 if (!cpu_has_mipsmt) 67 if (!cpu_has_mipsmt)
67 return; 68 return;
68 69
70 /* Enable VPC */
69 set_c0_mvpcontrol(MVPCONTROL_VPC); 71 set_c0_mvpcontrol(MVPCONTROL_VPC);
70 72
71 back_to_back_c0_hazard(); 73 back_to_back_c0_hazard();
@@ -106,12 +108,12 @@ void __init sanitize_tlb_entries(void)
106 108
107static void ipi_resched_dispatch (struct pt_regs *regs) 109static void ipi_resched_dispatch (struct pt_regs *regs)
108{ 110{
109 do_IRQ(MIPS_CPU_IPI_RESCHED_IRQ, regs); 111 do_IRQ(MIPSCPU_INT_BASE + MIPS_CPU_IPI_RESCHED_IRQ, regs);
110} 112}
111 113
112static void ipi_call_dispatch (struct pt_regs *regs) 114static void ipi_call_dispatch (struct pt_regs *regs)
113{ 115{
114 do_IRQ(MIPS_CPU_IPI_CALL_IRQ, regs); 116 do_IRQ(MIPSCPU_INT_BASE + MIPS_CPU_IPI_CALL_IRQ, regs);
115} 117}
116 118
117irqreturn_t ipi_resched_interrupt(int irq, void *dev_id, struct pt_regs *regs) 119irqreturn_t ipi_resched_interrupt(int irq, void *dev_id, struct pt_regs *regs)
@@ -148,6 +150,11 @@ void plat_smp_setup(void)
148 unsigned long val; 150 unsigned long val;
149 int i, num; 151 int i, num;
150 152
153#ifdef CONFIG_MIPS_MT_FPAFF
154 /* If we have an FPU, enroll ourselves in the FPU-full mask */
155 if (cpu_has_fpu)
156 cpu_set(0, mt_fpu_cpumask);
157#endif /* CONFIG_MIPS_MT_FPAFF */
151 if (!cpu_has_mipsmt) 158 if (!cpu_has_mipsmt)
152 return; 159 return;
153 160
@@ -155,6 +162,8 @@ void plat_smp_setup(void)
155 dvpe(); 162 dvpe();
156 dmt(); 163 dmt();
157 164
165 mips_mt_set_cpuoptions();
166
158 /* Put MVPE's into 'configuration state' */ 167 /* Put MVPE's into 'configuration state' */
159 set_c0_mvpcontrol(MVPCONTROL_VPC); 168 set_c0_mvpcontrol(MVPCONTROL_VPC);
160 169
@@ -189,11 +198,13 @@ void plat_smp_setup(void)
189 198
190 if (i != 0) { 199 if (i != 0) {
191 write_vpe_c0_status((read_c0_status() & ~(ST0_IM | ST0_IE | ST0_KSU)) | ST0_CU0); 200 write_vpe_c0_status((read_c0_status() & ~(ST0_IM | ST0_IE | ST0_KSU)) | ST0_CU0);
192 write_vpe_c0_cause(read_vpe_c0_cause() & ~CAUSEF_IP);
193 201
194 /* set config to be the same as vpe0, particularly kseg0 coherency alg */ 202 /* set config to be the same as vpe0, particularly kseg0 coherency alg */
195 write_vpe_c0_config( read_c0_config()); 203 write_vpe_c0_config( read_c0_config());
196 204
205 /* make sure there are no software interrupts pending */
206 write_vpe_c0_cause(read_vpe_c0_cause() & ~(C_SW1|C_SW0));
207
197 /* Propagate Config7 */ 208 /* Propagate Config7 */
198 write_vpe_c0_config7(read_c0_config7()); 209 write_vpe_c0_config7(read_c0_config7());
199 } 210 }
@@ -233,16 +244,16 @@ void plat_smp_setup(void)
233 /* We'll wait until starting the secondaries before starting MVPE */ 244 /* We'll wait until starting the secondaries before starting MVPE */
234 245
235 printk(KERN_INFO "Detected %i available secondary CPU(s)\n", num); 246 printk(KERN_INFO "Detected %i available secondary CPU(s)\n", num);
247}
236 248
249void __init plat_prepare_cpus(unsigned int max_cpus)
250{
237 /* set up ipi interrupts */ 251 /* set up ipi interrupts */
238 if (cpu_has_vint) { 252 if (cpu_has_vint) {
239 set_vi_handler (MIPS_CPU_IPI_RESCHED_IRQ, ipi_resched_dispatch); 253 set_vi_handler (MIPS_CPU_IPI_RESCHED_IRQ, ipi_resched_dispatch);
240 set_vi_handler (MIPS_CPU_IPI_CALL_IRQ, ipi_call_dispatch); 254 set_vi_handler (MIPS_CPU_IPI_CALL_IRQ, ipi_call_dispatch);
241 } 255 }
242}
243 256
244void __init plat_prepare_cpus(unsigned int max_cpus)
245{
246 cpu_ipi_resched_irq = MIPSCPU_INT_BASE + MIPS_CPU_IPI_RESCHED_IRQ; 257 cpu_ipi_resched_irq = MIPSCPU_INT_BASE + MIPS_CPU_IPI_RESCHED_IRQ;
247 cpu_ipi_call_irq = MIPSCPU_INT_BASE + MIPS_CPU_IPI_CALL_IRQ; 258 cpu_ipi_call_irq = MIPSCPU_INT_BASE + MIPS_CPU_IPI_CALL_IRQ;
248 259
@@ -287,7 +298,8 @@ void prom_boot_secondary(int cpu, struct task_struct *idle)
287 /* global pointer */ 298 /* global pointer */
288 write_tc_gpr_gp((unsigned long)gp); 299 write_tc_gpr_gp((unsigned long)gp);
289 300
290 flush_icache_range((unsigned long)gp, (unsigned long)(gp + 1)); 301 flush_icache_range((unsigned long)gp,
302 (unsigned long)(gp + sizeof(struct thread_info)));
291 303
292 /* finally out of configuration and into chaos */ 304 /* finally out of configuration and into chaos */
293 clear_c0_mvpcontrol(MVPCONTROL_VPC); 305 clear_c0_mvpcontrol(MVPCONTROL_VPC);
@@ -305,6 +317,12 @@ void prom_smp_finish(void)
305{ 317{
306 write_c0_compare(read_c0_count() + (8* mips_hpt_frequency/HZ)); 318 write_c0_compare(read_c0_count() + (8* mips_hpt_frequency/HZ));
307 319
320#ifdef CONFIG_MIPS_MT_FPAFF
321 /* If we have an FPU, enroll ourselves in the FPU-full mask */
322 if (cpu_has_fpu)
323 cpu_set(smp_processor_id(), mt_fpu_cpumask);
324#endif /* CONFIG_MIPS_MT_FPAFF */
325
308 local_irq_enable(); 326 local_irq_enable();
309} 327}
310 328
diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c
index 78d171bfa331..298f82fe8440 100644
--- a/arch/mips/kernel/smp.c
+++ b/arch/mips/kernel/smp.c
@@ -38,6 +38,10 @@
38#include <asm/mmu_context.h> 38#include <asm/mmu_context.h>
39#include <asm/smp.h> 39#include <asm/smp.h>
40 40
41#ifdef CONFIG_MIPS_MT_SMTC
42#include <asm/mipsmtregs.h>
43#endif /* CONFIG_MIPS_MT_SMTC */
44
41cpumask_t phys_cpu_present_map; /* Bitmask of available CPUs */ 45cpumask_t phys_cpu_present_map; /* Bitmask of available CPUs */
42volatile cpumask_t cpu_callin_map; /* Bitmask of started secondaries */ 46volatile cpumask_t cpu_callin_map; /* Bitmask of started secondaries */
43cpumask_t cpu_online_map; /* Bitmask of currently online CPUs */ 47cpumask_t cpu_online_map; /* Bitmask of currently online CPUs */
@@ -85,6 +89,10 @@ asmlinkage void start_secondary(void)
85{ 89{
86 unsigned int cpu; 90 unsigned int cpu;
87 91
92#ifdef CONFIG_MIPS_MT_SMTC
93 /* Only do cpu_probe for first TC of CPU */
94 if ((read_c0_tcbind() & TCBIND_CURTC) == 0)
95#endif /* CONFIG_MIPS_MT_SMTC */
88 cpu_probe(); 96 cpu_probe();
89 cpu_report(); 97 cpu_report();
90 per_cpu_trap_init(); 98 per_cpu_trap_init();
@@ -179,11 +187,13 @@ int smp_call_function (void (*func) (void *info), void *info, int retry,
179 if (wait) 187 if (wait)
180 while (atomic_read(&data.finished) != cpus) 188 while (atomic_read(&data.finished) != cpus)
181 barrier(); 189 barrier();
190 call_data = NULL;
182 spin_unlock(&smp_call_lock); 191 spin_unlock(&smp_call_lock);
183 192
184 return 0; 193 return 0;
185} 194}
186 195
196
187void smp_call_function_interrupt(void) 197void smp_call_function_interrupt(void)
188{ 198{
189 void (*func) (void *info) = call_data->func; 199 void (*func) (void *info) = call_data->func;
@@ -237,6 +247,9 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
237 current_thread_info()->cpu = 0; 247 current_thread_info()->cpu = 0;
238 smp_tune_scheduling(); 248 smp_tune_scheduling();
239 plat_prepare_cpus(max_cpus); 249 plat_prepare_cpus(max_cpus);
250#ifndef CONFIG_HOTPLUG_CPU
251 cpu_present_map = cpu_possible_map;
252#endif
240} 253}
241 254
242/* preload SMP state for boot cpu */ 255/* preload SMP state for boot cpu */
@@ -432,7 +445,7 @@ static int __init topology_init(void)
432 int cpu; 445 int cpu;
433 int ret; 446 int ret;
434 447
435 for_each_cpu(cpu) { 448 for_each_present_cpu(cpu) {
436 ret = register_cpu(&per_cpu(cpu_devices, cpu), cpu, NULL); 449 ret = register_cpu(&per_cpu(cpu_devices, cpu), cpu, NULL);
437 if (ret) 450 if (ret)
438 printk(KERN_WARNING "topology_init: register_cpu %d " 451 printk(KERN_WARNING "topology_init: register_cpu %d "
@@ -446,5 +459,3 @@ subsys_initcall(topology_init);
446 459
447EXPORT_SYMBOL(flush_tlb_page); 460EXPORT_SYMBOL(flush_tlb_page);
448EXPORT_SYMBOL(flush_tlb_one); 461EXPORT_SYMBOL(flush_tlb_one);
449EXPORT_SYMBOL(cpu_data);
450EXPORT_SYMBOL(synchronize_irq);
diff --git a/arch/mips/kernel/smtc-asm.S b/arch/mips/kernel/smtc-asm.S
new file mode 100644
index 000000000000..c9d65196d917
--- /dev/null
+++ b/arch/mips/kernel/smtc-asm.S
@@ -0,0 +1,130 @@
1/*
2 * Assembly Language Functions for MIPS MT SMTC support
3 */
4
5/*
6 * This file should be built into the kernel only if CONFIG_MIPS_MT_SMTC is set. */
7
8#include <asm/regdef.h>
9#include <asm/asmmacro.h>
10#include <asm/stackframe.h>
11#include <asm/stackframe.h>
12
13/*
14 * "Software Interrupt" linkage.
15 *
16 * This is invoked when an "Interrupt" is sent from one TC to another,
17 * where the TC to be interrupted is halted, has it's Restart address
18 * and Status values saved by the "remote control" thread, then modified
19 * to cause execution to begin here, in kenel mode. This code then
20 * disguises the TC state as that of an exception and transfers
21 * control to the general exception or vectored interrupt handler.
22 */
23 .set noreorder
24
25/*
26The __smtc_ipi_vector would use k0 and k1 as temporaries and
271) Set EXL (this is per-VPE, so this can't be done by proxy!)
282) Restore the K/CU and IXMT bits to the pre "exception" state
29 (EXL means no interrupts and access to the kernel map).
303) Set EPC to be the saved value of TCRestart.
314) Jump to the exception handler entry point passed by the sender.
32
33CAN WE PROVE THAT WE WON'T DO THIS IF INTS DISABLED??
34*/
35
36/*
37 * Reviled and slandered vision: Set EXL and restore K/CU/IXMT
38 * state of pre-halt thread, then save everything and call
39 * thought some function pointer to imaginary_exception, which
40 * will parse a register value or memory message queue to
41 * deliver things like interprocessor interrupts. On return
42 * from that function, jump to the global ret_from_irq code
43 * to invoke the scheduler and return as appropriate.
44 */
45
46#define PT_PADSLOT4 (PT_R0-8)
47#define PT_PADSLOT5 (PT_R0-4)
48
49 .text
50 .align 5
51FEXPORT(__smtc_ipi_vector)
52 .set noat
53 /* Disable thread scheduling to make Status update atomic */
54 DMT 27 # dmt k1
55 ehb
56 /* Set EXL */
57 mfc0 k0,CP0_STATUS
58 ori k0,k0,ST0_EXL
59 mtc0 k0,CP0_STATUS
60 ehb
61 /* Thread scheduling now inhibited by EXL. Restore TE state. */
62 andi k1,k1,VPECONTROL_TE
63 beqz k1,1f
64 emt
651:
66 /*
67 * The IPI sender has put some information on the anticipated
68 * kernel stack frame. If we were in user mode, this will be
69 * built above the saved kernel SP. If we were already in the
70 * kernel, it will be built above the current CPU SP.
71 *
72 * Were we in kernel mode, as indicated by CU0?
73 */
74 sll k1,k0,3
75 .set noreorder
76 bltz k1,2f
77 move k1,sp
78 .set reorder
79 /*
80 * If previously in user mode, set CU0 and use kernel stack.
81 */
82 li k1,ST0_CU0
83 or k1,k1,k0
84 mtc0 k1,CP0_STATUS
85 ehb
86 get_saved_sp
87 /* Interrupting TC will have pre-set values in slots in the new frame */
882: subu k1,k1,PT_SIZE
89 /* Load TCStatus Value */
90 lw k0,PT_TCSTATUS(k1)
91 /* Write it to TCStatus to restore CU/KSU/IXMT state */
92 mtc0 k0,$2,1
93 ehb
94 lw k0,PT_EPC(k1)
95 mtc0 k0,CP0_EPC
96 /* Save all will redundantly recompute the SP, but use it for now */
97 SAVE_ALL
98 CLI
99 move a0,sp
100 /* Function to be invoked passed stack pad slot 5 */
101 lw t0,PT_PADSLOT5(sp)
102 /* Argument from sender passed in stack pad slot 4 */
103 lw a1,PT_PADSLOT4(sp)
104 jalr t0
105 nop
106 j ret_from_irq
107 nop
108
109/*
110 * Called from idle loop to provoke processing of queued IPIs
111 * First IPI message in queue passed as argument.
112 */
113
114LEAF(self_ipi)
115 /* Before anything else, block interrupts */
116 mfc0 t0,CP0_TCSTATUS
117 ori t1,t0,TCSTATUS_IXMT
118 mtc0 t1,CP0_TCSTATUS
119 ehb
120 /* We know we're in kernel mode, so prepare stack frame */
121 subu t1,sp,PT_SIZE
122 sw ra,PT_EPC(t1)
123 sw a0,PT_PADSLOT4(t1)
124 la t2,ipi_decode
125 sw t2,PT_PADSLOT5(t1)
126 /* Save pre-disable value of TCStatus */
127 sw t0,PT_TCSTATUS(t1)
128 j __smtc_ipi_vector
129 nop
130END(self_ipi)
diff --git a/arch/mips/kernel/smtc-proc.c b/arch/mips/kernel/smtc-proc.c
new file mode 100644
index 000000000000..6f3709996172
--- /dev/null
+++ b/arch/mips/kernel/smtc-proc.c
@@ -0,0 +1,93 @@
1/*
2 * /proc hooks for SMTC kernel
3 * Copyright (C) 2005 Mips Technologies, Inc
4 */
5
6#include <linux/kernel.h>
7#include <linux/sched.h>
8#include <linux/cpumask.h>
9#include <linux/interrupt.h>
10
11#include <asm/cpu.h>
12#include <asm/processor.h>
13#include <asm/atomic.h>
14#include <asm/system.h>
15#include <asm/hardirq.h>
16#include <asm/mmu_context.h>
17#include <asm/smp.h>
18#include <asm/mipsregs.h>
19#include <asm/cacheflush.h>
20#include <linux/proc_fs.h>
21
22#include <asm/smtc_proc.h>
23
24/*
25 * /proc diagnostic and statistics hooks
26 */
27
28/*
29 * Statistics gathered
30 */
31unsigned long selfipis[NR_CPUS];
32
33struct smtc_cpu_proc smtc_cpu_stats[NR_CPUS];
34
35static struct proc_dir_entry *smtc_stats;
36
37atomic_t smtc_fpu_recoveries;
38
39static int proc_read_smtc(char *page, char **start, off_t off,
40 int count, int *eof, void *data)
41{
42 int totalen = 0;
43 int len;
44 int i;
45 extern unsigned long ebase;
46
47 len = sprintf(page, "SMTC Status Word: 0x%08x\n", smtc_status);
48 totalen += len;
49 page += len;
50 len = sprintf(page, "Config7: 0x%08x\n", read_c0_config7());
51 totalen += len;
52 page += len;
53 len = sprintf(page, "EBASE: 0x%08lx\n", ebase);
54 totalen += len;
55 page += len;
56 len = sprintf(page, "Counter Interrupts taken per CPU (TC)\n");
57 totalen += len;
58 page += len;
59 for (i=0; i < NR_CPUS; i++) {
60 len = sprintf(page, "%d: %ld\n", i, smtc_cpu_stats[i].timerints);
61 totalen += len;
62 page += len;
63 }
64 len = sprintf(page, "Self-IPIs by CPU:\n");
65 totalen += len;
66 page += len;
67 for(i = 0; i < NR_CPUS; i++) {
68 len = sprintf(page, "%d: %ld\n", i, smtc_cpu_stats[i].selfipis);
69 totalen += len;
70 page += len;
71 }
72 len = sprintf(page, "%d Recoveries of \"stolen\" FPU\n",
73 atomic_read(&smtc_fpu_recoveries));
74 totalen += len;
75 page += len;
76
77 return totalen;
78}
79
80void init_smtc_stats(void)
81{
82 int i;
83
84 for (i=0; i<NR_CPUS; i++) {
85 smtc_cpu_stats[i].timerints = 0;
86 smtc_cpu_stats[i].selfipis = 0;
87 }
88
89 atomic_set(&smtc_fpu_recoveries, 0);
90
91 smtc_stats = create_proc_read_entry("smtc", 0444, NULL,
92 proc_read_smtc, NULL);
93}
diff --git a/arch/mips/kernel/smtc.c b/arch/mips/kernel/smtc.c
new file mode 100644
index 000000000000..2e8e52c135e6
--- /dev/null
+++ b/arch/mips/kernel/smtc.c
@@ -0,0 +1,1322 @@
1/* Copyright (C) 2004 Mips Technologies, Inc */
2
3#include <linux/kernel.h>
4#include <linux/sched.h>
5#include <linux/cpumask.h>
6#include <linux/interrupt.h>
7
8#include <asm/cpu.h>
9#include <asm/processor.h>
10#include <asm/atomic.h>
11#include <asm/system.h>
12#include <asm/hardirq.h>
13#include <asm/hazards.h>
14#include <asm/mmu_context.h>
15#include <asm/smp.h>
16#include <asm/mipsregs.h>
17#include <asm/cacheflush.h>
18#include <asm/time.h>
19#include <asm/addrspace.h>
20#include <asm/smtc.h>
21#include <asm/smtc_ipi.h>
22#include <asm/smtc_proc.h>
23
24/*
25 * This file should be built into the kernel only if CONFIG_MIPS_MT_SMTC is set.
26 */
27
28/*
29 * MIPSCPU_INT_BASE is identically defined in both
30 * asm-mips/mips-boards/maltaint.h and asm-mips/mips-boards/simint.h,
31 * but as yet there's no properly organized include structure that
32 * will ensure that the right *int.h file will be included for a
33 * given platform build.
34 */
35
36#define MIPSCPU_INT_BASE 16
37
38#define MIPS_CPU_IPI_IRQ 1
39
40#define LOCK_MT_PRA() \
41 local_irq_save(flags); \
42 mtflags = dmt()
43
44#define UNLOCK_MT_PRA() \
45 emt(mtflags); \
46 local_irq_restore(flags)
47
48#define LOCK_CORE_PRA() \
49 local_irq_save(flags); \
50 mtflags = dvpe()
51
52#define UNLOCK_CORE_PRA() \
53 evpe(mtflags); \
54 local_irq_restore(flags)
55
56/*
57 * Data structures purely associated with SMTC parallelism
58 */
59
60
61/*
62 * Table for tracking ASIDs whose lifetime is prolonged.
63 */
64
65asiduse smtc_live_asid[MAX_SMTC_TLBS][MAX_SMTC_ASIDS];
66
67/*
68 * Clock interrupt "latch" buffers, per "CPU"
69 */
70
71unsigned int ipi_timer_latch[NR_CPUS];
72
73/*
74 * Number of InterProcessor Interupt (IPI) message buffers to allocate
75 */
76
77#define IPIBUF_PER_CPU 4
78
79struct smtc_ipi_q IPIQ[NR_CPUS];
80struct smtc_ipi_q freeIPIq;
81
82
83/* Forward declarations */
84
85void ipi_decode(struct pt_regs *, struct smtc_ipi *);
86void post_direct_ipi(int cpu, struct smtc_ipi *pipi);
87void setup_cross_vpe_interrupts(void);
88void init_smtc_stats(void);
89
90/* Global SMTC Status */
91
92unsigned int smtc_status = 0;
93
94/* Boot command line configuration overrides */
95
96static int vpelimit = 0;
97static int tclimit = 0;
98static int ipibuffers = 0;
99static int nostlb = 0;
100static int asidmask = 0;
101unsigned long smtc_asid_mask = 0xff;
102
103static int __init maxvpes(char *str)
104{
105 get_option(&str, &vpelimit);
106 return 1;
107}
108
109static int __init maxtcs(char *str)
110{
111 get_option(&str, &tclimit);
112 return 1;
113}
114
115static int __init ipibufs(char *str)
116{
117 get_option(&str, &ipibuffers);
118 return 1;
119}
120
121static int __init stlb_disable(char *s)
122{
123 nostlb = 1;
124 return 1;
125}
126
127static int __init asidmask_set(char *str)
128{
129 get_option(&str, &asidmask);
130 switch(asidmask) {
131 case 0x1:
132 case 0x3:
133 case 0x7:
134 case 0xf:
135 case 0x1f:
136 case 0x3f:
137 case 0x7f:
138 case 0xff:
139 smtc_asid_mask = (unsigned long)asidmask;
140 break;
141 default:
142 printk("ILLEGAL ASID mask 0x%x from command line\n", asidmask);
143 }
144 return 1;
145}
146
147__setup("maxvpes=", maxvpes);
148__setup("maxtcs=", maxtcs);
149__setup("ipibufs=", ipibufs);
150__setup("nostlb", stlb_disable);
151__setup("asidmask=", asidmask_set);
152
153/* Enable additional debug checks before going into CPU idle loop */
154#define SMTC_IDLE_HOOK_DEBUG
155
156#ifdef SMTC_IDLE_HOOK_DEBUG
157
158static int hang_trig = 0;
159
160static int __init hangtrig_enable(char *s)
161{
162 hang_trig = 1;
163 return 1;
164}
165
166
167__setup("hangtrig", hangtrig_enable);
168
169#define DEFAULT_BLOCKED_IPI_LIMIT 32
170
171static int timerq_limit = DEFAULT_BLOCKED_IPI_LIMIT;
172
173static int __init tintq(char *str)
174{
175 get_option(&str, &timerq_limit);
176 return 1;
177}
178
179__setup("tintq=", tintq);
180
181int imstuckcount[2][8];
182/* vpemask represents IM/IE bits of per-VPE Status registers, low-to-high */
183int vpemask[2][8] = {{0,1,1,0,0,0,0,1},{0,1,0,0,0,0,0,1}};
184int tcnoprog[NR_CPUS];
185static atomic_t idle_hook_initialized = {0};
186static int clock_hang_reported[NR_CPUS];
187
188#endif /* SMTC_IDLE_HOOK_DEBUG */
189
190/* Initialize shared TLB - the should probably migrate to smtc_setup_cpus() */
191
192void __init sanitize_tlb_entries(void)
193{
194 printk("Deprecated sanitize_tlb_entries() invoked\n");
195}
196
197
198/*
199 * Configure shared TLB - VPC configuration bit must be set by caller
200 */
201
202void smtc_configure_tlb(void)
203{
204 int i,tlbsiz,vpes;
205 unsigned long mvpconf0;
206 unsigned long config1val;
207
208 /* Set up ASID preservation table */
209 for (vpes=0; vpes<MAX_SMTC_TLBS; vpes++) {
210 for(i = 0; i < MAX_SMTC_ASIDS; i++) {
211 smtc_live_asid[vpes][i] = 0;
212 }
213 }
214 mvpconf0 = read_c0_mvpconf0();
215
216 if ((vpes = ((mvpconf0 & MVPCONF0_PVPE)
217 >> MVPCONF0_PVPE_SHIFT) + 1) > 1) {
218 /* If we have multiple VPEs, try to share the TLB */
219 if ((mvpconf0 & MVPCONF0_TLBS) && !nostlb) {
220 /*
221 * If TLB sizing is programmable, shared TLB
222 * size is the total available complement.
223 * Otherwise, we have to take the sum of all
224 * static VPE TLB entries.
225 */
226 if ((tlbsiz = ((mvpconf0 & MVPCONF0_PTLBE)
227 >> MVPCONF0_PTLBE_SHIFT)) == 0) {
228 /*
229 * If there's more than one VPE, there had better
230 * be more than one TC, because we need one to bind
231 * to each VPE in turn to be able to read
232 * its configuration state!
233 */
234 settc(1);
235 /* Stop the TC from doing anything foolish */
236 write_tc_c0_tchalt(TCHALT_H);
237 mips_ihb();
238 /* No need to un-Halt - that happens later anyway */
239 for (i=0; i < vpes; i++) {
240 write_tc_c0_tcbind(i);
241 /*
242 * To be 100% sure we're really getting the right
243 * information, we exit the configuration state
244 * and do an IHB after each rebinding.
245 */
246 write_c0_mvpcontrol(
247 read_c0_mvpcontrol() & ~ MVPCONTROL_VPC );
248 mips_ihb();
249 /*
250 * Only count if the MMU Type indicated is TLB
251 */
252 if(((read_vpe_c0_config() & MIPS_CONF_MT) >> 7) == 1) {
253 config1val = read_vpe_c0_config1();
254 tlbsiz += ((config1val >> 25) & 0x3f) + 1;
255 }
256
257 /* Put core back in configuration state */
258 write_c0_mvpcontrol(
259 read_c0_mvpcontrol() | MVPCONTROL_VPC );
260 mips_ihb();
261 }
262 }
263 write_c0_mvpcontrol(read_c0_mvpcontrol() | MVPCONTROL_STLB);
264
265 /*
266 * Setup kernel data structures to use software total,
267 * rather than read the per-VPE Config1 value. The values
268 * for "CPU 0" gets copied to all the other CPUs as part
269 * of their initialization in smtc_cpu_setup().
270 */
271
272 tlbsiz = tlbsiz & 0x3f; /* MIPS32 limits TLB indices to 64 */
273 cpu_data[0].tlbsize = tlbsiz;
274 smtc_status |= SMTC_TLB_SHARED;
275
276 printk("TLB of %d entry pairs shared by %d VPEs\n",
277 tlbsiz, vpes);
278 } else {
279 printk("WARNING: TLB Not Sharable on SMTC Boot!\n");
280 }
281 }
282}
283
284
285/*
286 * Incrementally build the CPU map out of constituent MIPS MT cores,
287 * using the specified available VPEs and TCs. Plaform code needs
288 * to ensure that each MIPS MT core invokes this routine on reset,
289 * one at a time(!).
290 *
291 * This version of the build_cpu_map and prepare_cpus routines assumes
292 * that *all* TCs of a MIPS MT core will be used for Linux, and that
293 * they will be spread across *all* available VPEs (to minimise the
294 * loss of efficiency due to exception service serialization).
295 * An improved version would pick up configuration information and
296 * possibly leave some TCs/VPEs as "slave" processors.
297 *
298 * Use c0_MVPConf0 to find out how many TCs are available, setting up
299 * phys_cpu_present_map and the logical/physical mappings.
300 */
301
302int __init mipsmt_build_cpu_map(int start_cpu_slot)
303{
304 int i, ntcs;
305
306 /*
307 * The CPU map isn't actually used for anything at this point,
308 * so it's not clear what else we should do apart from set
309 * everything up so that "logical" = "physical".
310 */
311 ntcs = ((read_c0_mvpconf0() & MVPCONF0_PTC) >> MVPCONF0_PTC_SHIFT) + 1;
312 for (i=start_cpu_slot; i<NR_CPUS && i<ntcs; i++) {
313 cpu_set(i, phys_cpu_present_map);
314 __cpu_number_map[i] = i;
315 __cpu_logical_map[i] = i;
316 }
317 /* Initialize map of CPUs with FPUs */
318 cpus_clear(mt_fpu_cpumask);
319
320 /* One of those TC's is the one booting, and not a secondary... */
321 printk("%i available secondary CPU TC(s)\n", i - 1);
322
323 return i;
324}
325
326/*
327 * Common setup before any secondaries are started
328 * Make sure all CPU's are in a sensible state before we boot any of the
329 * secondaries.
330 *
331 * For MIPS MT "SMTC" operation, we set up all TCs, spread as evenly
332 * as possible across the available VPEs.
333 */
334
335static void smtc_tc_setup(int vpe, int tc, int cpu)
336{
337 settc(tc);
338 write_tc_c0_tchalt(TCHALT_H);
339 mips_ihb();
340 write_tc_c0_tcstatus((read_tc_c0_tcstatus()
341 & ~(TCSTATUS_TKSU | TCSTATUS_DA | TCSTATUS_IXMT))
342 | TCSTATUS_A);
343 write_tc_c0_tccontext(0);
344 /* Bind tc to vpe */
345 write_tc_c0_tcbind(vpe);
346 /* In general, all TCs should have the same cpu_data indications */
347 memcpy(&cpu_data[cpu], &cpu_data[0], sizeof(struct cpuinfo_mips));
348 /* For 34Kf, start with TC/CPU 0 as sole owner of single FPU context */
349 if (cpu_data[0].cputype == CPU_34K)
350 cpu_data[cpu].options &= ~MIPS_CPU_FPU;
351 cpu_data[cpu].vpe_id = vpe;
352 cpu_data[cpu].tc_id = tc;
353}
354
355
356void mipsmt_prepare_cpus(void)
357{
358 int i, vpe, tc, ntc, nvpe, tcpervpe, slop, cpu;
359 unsigned long flags;
360 unsigned long val;
361 int nipi;
362 struct smtc_ipi *pipi;
363
364 /* disable interrupts so we can disable MT */
365 local_irq_save(flags);
366 /* disable MT so we can configure */
367 dvpe();
368 dmt();
369
370 freeIPIq.lock = SPIN_LOCK_UNLOCKED;
371
372 /*
373 * We probably don't have as many VPEs as we do SMP "CPUs",
374 * but it's possible - and in any case we'll never use more!
375 */
376 for (i=0; i<NR_CPUS; i++) {
377 IPIQ[i].head = IPIQ[i].tail = NULL;
378 IPIQ[i].lock = SPIN_LOCK_UNLOCKED;
379 IPIQ[i].depth = 0;
380 ipi_timer_latch[i] = 0;
381 }
382
383 /* cpu_data index starts at zero */
384 cpu = 0;
385 cpu_data[cpu].vpe_id = 0;
386 cpu_data[cpu].tc_id = 0;
387 cpu++;
388
389 /* Report on boot-time options */
390 mips_mt_set_cpuoptions ();
391 if (vpelimit > 0)
392 printk("Limit of %d VPEs set\n", vpelimit);
393 if (tclimit > 0)
394 printk("Limit of %d TCs set\n", tclimit);
395 if (nostlb) {
396 printk("Shared TLB Use Inhibited - UNSAFE for Multi-VPE Operation\n");
397 }
398 if (asidmask)
399 printk("ASID mask value override to 0x%x\n", asidmask);
400
401 /* Temporary */
402#ifdef SMTC_IDLE_HOOK_DEBUG
403 if (hang_trig)
404 printk("Logic Analyser Trigger on suspected TC hang\n");
405#endif /* SMTC_IDLE_HOOK_DEBUG */
406
407 /* Put MVPE's into 'configuration state' */
408 write_c0_mvpcontrol( read_c0_mvpcontrol() | MVPCONTROL_VPC );
409
410 val = read_c0_mvpconf0();
411 nvpe = ((val & MVPCONF0_PVPE) >> MVPCONF0_PVPE_SHIFT) + 1;
412 if (vpelimit > 0 && nvpe > vpelimit)
413 nvpe = vpelimit;
414 ntc = ((val & MVPCONF0_PTC) >> MVPCONF0_PTC_SHIFT) + 1;
415 if (ntc > NR_CPUS)
416 ntc = NR_CPUS;
417 if (tclimit > 0 && ntc > tclimit)
418 ntc = tclimit;
419 tcpervpe = ntc / nvpe;
420 slop = ntc % nvpe; /* Residual TCs, < NVPE */
421
422 /* Set up shared TLB */
423 smtc_configure_tlb();
424
425 for (tc = 0, vpe = 0 ; (vpe < nvpe) && (tc < ntc) ; vpe++) {
426 /*
427 * Set the MVP bits.
428 */
429 settc(tc);
430 write_vpe_c0_vpeconf0(read_vpe_c0_vpeconf0() | VPECONF0_MVP);
431 if (vpe != 0)
432 printk(", ");
433 printk("VPE %d: TC", vpe);
434 for (i = 0; i < tcpervpe; i++) {
435 /*
436 * TC 0 is bound to VPE 0 at reset,
437 * and is presumably executing this
438 * code. Leave it alone!
439 */
440 if (tc != 0) {
441 smtc_tc_setup(vpe,tc, cpu);
442 cpu++;
443 }
444 printk(" %d", tc);
445 tc++;
446 }
447 if (slop) {
448 if (tc != 0) {
449 smtc_tc_setup(vpe,tc, cpu);
450 cpu++;
451 }
452 printk(" %d", tc);
453 tc++;
454 slop--;
455 }
456 if (vpe != 0) {
457 /*
458 * Clear any stale software interrupts from VPE's Cause
459 */
460 write_vpe_c0_cause(0);
461
462 /*
463 * Clear ERL/EXL of VPEs other than 0
464 * and set restricted interrupt enable/mask.
465 */
466 write_vpe_c0_status((read_vpe_c0_status()
467 & ~(ST0_BEV | ST0_ERL | ST0_EXL | ST0_IM))
468 | (STATUSF_IP0 | STATUSF_IP1 | STATUSF_IP7
469 | ST0_IE));
470 /*
471 * set config to be the same as vpe0,
472 * particularly kseg0 coherency alg
473 */
474 write_vpe_c0_config(read_c0_config());
475 /* Clear any pending timer interrupt */
476 write_vpe_c0_compare(0);
477 /* Propagate Config7 */
478 write_vpe_c0_config7(read_c0_config7());
479 }
480 /* enable multi-threading within VPE */
481 write_vpe_c0_vpecontrol(read_vpe_c0_vpecontrol() | VPECONTROL_TE);
482 /* enable the VPE */
483 write_vpe_c0_vpeconf0(read_vpe_c0_vpeconf0() | VPECONF0_VPA);
484 }
485
486 /*
487 * Pull any physically present but unused TCs out of circulation.
488 */
489 while (tc < (((val & MVPCONF0_PTC) >> MVPCONF0_PTC_SHIFT) + 1)) {
490 cpu_clear(tc, phys_cpu_present_map);
491 cpu_clear(tc, cpu_present_map);
492 tc++;
493 }
494
495 /* release config state */
496 write_c0_mvpcontrol( read_c0_mvpcontrol() & ~ MVPCONTROL_VPC );
497
498 printk("\n");
499
500 /* Set up coprocessor affinity CPU mask(s) */
501
502 for (tc = 0; tc < ntc; tc++) {
503 if(cpu_data[tc].options & MIPS_CPU_FPU)
504 cpu_set(tc, mt_fpu_cpumask);
505 }
506
507 /* set up ipi interrupts... */
508
509 /* If we have multiple VPEs running, set up the cross-VPE interrupt */
510
511 if (nvpe > 1)
512 setup_cross_vpe_interrupts();
513
514 /* Set up queue of free IPI "messages". */
515 nipi = NR_CPUS * IPIBUF_PER_CPU;
516 if (ipibuffers > 0)
517 nipi = ipibuffers;
518
519 pipi = kmalloc(nipi *sizeof(struct smtc_ipi), GFP_KERNEL);
520 if (pipi == NULL)
521 panic("kmalloc of IPI message buffers failed\n");
522 else
523 printk("IPI buffer pool of %d buffers\n", nipi);
524 for (i = 0; i < nipi; i++) {
525 smtc_ipi_nq(&freeIPIq, pipi);
526 pipi++;
527 }
528
529 /* Arm multithreading and enable other VPEs - but all TCs are Halted */
530 emt(EMT_ENABLE);
531 evpe(EVPE_ENABLE);
532 local_irq_restore(flags);
533 /* Initialize SMTC /proc statistics/diagnostics */
534 init_smtc_stats();
535}
536
537
538/*
539 * Setup the PC, SP, and GP of a secondary processor and start it
540 * running!
541 * smp_bootstrap is the place to resume from
542 * __KSTK_TOS(idle) is apparently the stack pointer
543 * (unsigned long)idle->thread_info the gp
544 *
545 */
546void smtc_boot_secondary(int cpu, struct task_struct *idle)
547{
548 extern u32 kernelsp[NR_CPUS];
549 long flags;
550 int mtflags;
551
552 LOCK_MT_PRA();
553 if (cpu_data[cpu].vpe_id != cpu_data[smp_processor_id()].vpe_id) {
554 dvpe();
555 }
556 settc(cpu_data[cpu].tc_id);
557
558 /* pc */
559 write_tc_c0_tcrestart((unsigned long)&smp_bootstrap);
560
561 /* stack pointer */
562 kernelsp[cpu] = __KSTK_TOS(idle);
563 write_tc_gpr_sp(__KSTK_TOS(idle));
564
565 /* global pointer */
566 write_tc_gpr_gp((unsigned long)idle->thread_info);
567
568 smtc_status |= SMTC_MTC_ACTIVE;
569 write_tc_c0_tchalt(0);
570 if (cpu_data[cpu].vpe_id != cpu_data[smp_processor_id()].vpe_id) {
571 evpe(EVPE_ENABLE);
572 }
573 UNLOCK_MT_PRA();
574}
575
576void smtc_init_secondary(void)
577{
578 /*
579 * Start timer on secondary VPEs if necessary.
580 * mips_timer_setup should already have been invoked by init/main
581 * on "boot" TC. Like per_cpu_trap_init() hack, this assumes that
582 * SMTC init code assigns TCs consdecutively and in ascending order
583 * to across available VPEs.
584 */
585 if(((read_c0_tcbind() & TCBIND_CURTC) != 0)
586 && ((read_c0_tcbind() & TCBIND_CURVPE)
587 != cpu_data[smp_processor_id() - 1].vpe_id)){
588 write_c0_compare (read_c0_count() + mips_hpt_frequency/HZ);
589 }
590
591 local_irq_enable();
592}
593
594void smtc_smp_finish(void)
595{
596 printk("TC %d going on-line as CPU %d\n",
597 cpu_data[smp_processor_id()].tc_id, smp_processor_id());
598}
599
600void smtc_cpus_done(void)
601{
602}
603
604/*
605 * Support for SMTC-optimized driver IRQ registration
606 */
607
608/*
609 * SMTC Kernel needs to manipulate low-level CPU interrupt mask
610 * in do_IRQ. These are passed in setup_irq_smtc() and stored
611 * in this table.
612 */
613
614int setup_irq_smtc(unsigned int irq, struct irqaction * new,
615 unsigned long hwmask)
616{
617 irq_hwmask[irq] = hwmask;
618
619 return setup_irq(irq, new);
620}
621
622/*
623 * IPI model for SMTC is tricky, because interrupts aren't TC-specific.
624 * Within a VPE one TC can interrupt another by different approaches.
625 * The easiest to get right would probably be to make all TCs except
626 * the target IXMT and set a software interrupt, but an IXMT-based
627 * scheme requires that a handler must run before a new IPI could
628 * be sent, which would break the "broadcast" loops in MIPS MT.
629 * A more gonzo approach within a VPE is to halt the TC, extract
630 * its Restart, Status, and a couple of GPRs, and program the Restart
631 * address to emulate an interrupt.
632 *
633 * Within a VPE, one can be confident that the target TC isn't in
634 * a critical EXL state when halted, since the write to the Halt
635 * register could not have issued on the writing thread if the
636 * halting thread had EXL set. So k0 and k1 of the target TC
637 * can be used by the injection code. Across VPEs, one can't
638 * be certain that the target TC isn't in a critical exception
639 * state. So we try a two-step process of sending a software
640 * interrupt to the target VPE, which either handles the event
641 * itself (if it was the target) or injects the event within
642 * the VPE.
643 */
644
645void smtc_ipi_qdump(void)
646{
647 int i;
648
649 for (i = 0; i < NR_CPUS ;i++) {
650 printk("IPIQ[%d]: head = 0x%x, tail = 0x%x, depth = %d\n",
651 i, (unsigned)IPIQ[i].head, (unsigned)IPIQ[i].tail,
652 IPIQ[i].depth);
653 }
654}
655
656/*
657 * The standard atomic.h primitives don't quite do what we want
658 * here: We need an atomic add-and-return-previous-value (which
659 * could be done with atomic_add_return and a decrement) and an
660 * atomic set/zero-and-return-previous-value (which can't really
661 * be done with the atomic.h primitives). And since this is
662 * MIPS MT, we can assume that we have LL/SC.
663 */
664static __inline__ int atomic_postincrement(unsigned int *pv)
665{
666 unsigned long result;
667
668 unsigned long temp;
669
670 __asm__ __volatile__(
671 "1: ll %0, %2 \n"
672 " addu %1, %0, 1 \n"
673 " sc %1, %2 \n"
674 " beqz %1, 1b \n"
675 " sync \n"
676 : "=&r" (result), "=&r" (temp), "=m" (*pv)
677 : "m" (*pv)
678 : "memory");
679
680 return result;
681}
682
683/* No longer used in IPI dispatch, but retained for future recycling */
684
685static __inline__ int atomic_postclear(unsigned int *pv)
686{
687 unsigned long result;
688
689 unsigned long temp;
690
691 __asm__ __volatile__(
692 "1: ll %0, %2 \n"
693 " or %1, $0, $0 \n"
694 " sc %1, %2 \n"
695 " beqz %1, 1b \n"
696 " sync \n"
697 : "=&r" (result), "=&r" (temp), "=m" (*pv)
698 : "m" (*pv)
699 : "memory");
700
701 return result;
702}
703
704
705void smtc_send_ipi(int cpu, int type, unsigned int action)
706{
707 int tcstatus;
708 struct smtc_ipi *pipi;
709 long flags;
710 int mtflags;
711
712 if (cpu == smp_processor_id()) {
713 printk("Cannot Send IPI to self!\n");
714 return;
715 }
716 /* Set up a descriptor, to be delivered either promptly or queued */
717 pipi = smtc_ipi_dq(&freeIPIq);
718 if (pipi == NULL) {
719 bust_spinlocks(1);
720 mips_mt_regdump(dvpe());
721 panic("IPI Msg. Buffers Depleted\n");
722 }
723 pipi->type = type;
724 pipi->arg = (void *)action;
725 pipi->dest = cpu;
726 if (cpu_data[cpu].vpe_id != cpu_data[smp_processor_id()].vpe_id) {
727 /* If not on same VPE, enqueue and send cross-VPE interupt */
728 smtc_ipi_nq(&IPIQ[cpu], pipi);
729 LOCK_CORE_PRA();
730 settc(cpu_data[cpu].tc_id);
731 write_vpe_c0_cause(read_vpe_c0_cause() | C_SW1);
732 UNLOCK_CORE_PRA();
733 } else {
734 /*
735 * Not sufficient to do a LOCK_MT_PRA (dmt) here,
736 * since ASID shootdown on the other VPE may
737 * collide with this operation.
738 */
739 LOCK_CORE_PRA();
740 settc(cpu_data[cpu].tc_id);
741 /* Halt the targeted TC */
742 write_tc_c0_tchalt(TCHALT_H);
743 mips_ihb();
744
745 /*
746 * Inspect TCStatus - if IXMT is set, we have to queue
747 * a message. Otherwise, we set up the "interrupt"
748 * of the other TC
749 */
750 tcstatus = read_tc_c0_tcstatus();
751
752 if ((tcstatus & TCSTATUS_IXMT) != 0) {
753 /*
754 * Spin-waiting here can deadlock,
755 * so we queue the message for the target TC.
756 */
757 write_tc_c0_tchalt(0);
758 UNLOCK_CORE_PRA();
759 /* Try to reduce redundant timer interrupt messages */
760 if(type == SMTC_CLOCK_TICK) {
761 if(atomic_postincrement(&ipi_timer_latch[cpu])!=0) {
762 smtc_ipi_nq(&freeIPIq, pipi);
763 return;
764 }
765 }
766 smtc_ipi_nq(&IPIQ[cpu], pipi);
767 } else {
768 post_direct_ipi(cpu, pipi);
769 write_tc_c0_tchalt(0);
770 UNLOCK_CORE_PRA();
771 }
772 }
773}
774
775/*
776 * Send IPI message to Halted TC, TargTC/TargVPE already having been set
777 */
778void post_direct_ipi(int cpu, struct smtc_ipi *pipi)
779{
780 struct pt_regs *kstack;
781 unsigned long tcstatus;
782 unsigned long tcrestart;
783 extern u32 kernelsp[NR_CPUS];
784 extern void __smtc_ipi_vector(void);
785
786 /* Extract Status, EPC from halted TC */
787 tcstatus = read_tc_c0_tcstatus();
788 tcrestart = read_tc_c0_tcrestart();
789 /* If TCRestart indicates a WAIT instruction, advance the PC */
790 if ((tcrestart & 0x80000000)
791 && ((*(unsigned int *)tcrestart & 0xfe00003f) == 0x42000020)) {
792 tcrestart += 4;
793 }
794 /*
795 * Save on TC's future kernel stack
796 *
797 * CU bit of Status is indicator that TC was
798 * already running on a kernel stack...
799 */
800 if(tcstatus & ST0_CU0) {
801 /* Note that this "- 1" is pointer arithmetic */
802 kstack = ((struct pt_regs *)read_tc_gpr_sp()) - 1;
803 } else {
804 kstack = ((struct pt_regs *)kernelsp[cpu]) - 1;
805 }
806
807 kstack->cp0_epc = (long)tcrestart;
808 /* Save TCStatus */
809 kstack->cp0_tcstatus = tcstatus;
810 /* Pass token of operation to be performed kernel stack pad area */
811 kstack->pad0[4] = (unsigned long)pipi;
812 /* Pass address of function to be called likewise */
813 kstack->pad0[5] = (unsigned long)&ipi_decode;
814 /* Set interrupt exempt and kernel mode */
815 tcstatus |= TCSTATUS_IXMT;
816 tcstatus &= ~TCSTATUS_TKSU;
817 write_tc_c0_tcstatus(tcstatus);
818 ehb();
819 /* Set TC Restart address to be SMTC IPI vector */
820 write_tc_c0_tcrestart(__smtc_ipi_vector);
821}
822
823void ipi_resched_interrupt(struct pt_regs *regs)
824{
825 /* Return from interrupt should be enough to cause scheduler check */
826}
827
828
829void ipi_call_interrupt(struct pt_regs *regs)
830{
831 /* Invoke generic function invocation code in smp.c */
832 smp_call_function_interrupt();
833}
834
835void ipi_decode(struct pt_regs *regs, struct smtc_ipi *pipi)
836{
837 void *arg_copy = pipi->arg;
838 int type_copy = pipi->type;
839 int dest_copy = pipi->dest;
840
841 smtc_ipi_nq(&freeIPIq, pipi);
842 switch (type_copy) {
843 case SMTC_CLOCK_TICK:
844 /* Invoke Clock "Interrupt" */
845 ipi_timer_latch[dest_copy] = 0;
846#ifdef SMTC_IDLE_HOOK_DEBUG
847 clock_hang_reported[dest_copy] = 0;
848#endif /* SMTC_IDLE_HOOK_DEBUG */
849 local_timer_interrupt(0, NULL, regs);
850 break;
851 case LINUX_SMP_IPI:
852 switch ((int)arg_copy) {
853 case SMP_RESCHEDULE_YOURSELF:
854 ipi_resched_interrupt(regs);
855 break;
856 case SMP_CALL_FUNCTION:
857 ipi_call_interrupt(regs);
858 break;
859 default:
860 printk("Impossible SMTC IPI Argument 0x%x\n",
861 (int)arg_copy);
862 break;
863 }
864 break;
865 default:
866 printk("Impossible SMTC IPI Type 0x%x\n", type_copy);
867 break;
868 }
869}
870
871void deferred_smtc_ipi(struct pt_regs *regs)
872{
873 struct smtc_ipi *pipi;
874 unsigned long flags;
875/* DEBUG */
876 int q = smp_processor_id();
877
878 /*
879 * Test is not atomic, but much faster than a dequeue,
880 * and the vast majority of invocations will have a null queue.
881 */
882 if(IPIQ[q].head != NULL) {
883 while((pipi = smtc_ipi_dq(&IPIQ[q])) != NULL) {
884 /* ipi_decode() should be called with interrupts off */
885 local_irq_save(flags);
886 ipi_decode(regs, pipi);
887 local_irq_restore(flags);
888 }
889 }
890}
891
892/*
893 * Send clock tick to all TCs except the one executing the funtion
894 */
895
896void smtc_timer_broadcast(int vpe)
897{
898 int cpu;
899 int myTC = cpu_data[smp_processor_id()].tc_id;
900 int myVPE = cpu_data[smp_processor_id()].vpe_id;
901
902 smtc_cpu_stats[smp_processor_id()].timerints++;
903
904 for_each_online_cpu(cpu) {
905 if (cpu_data[cpu].vpe_id == myVPE &&
906 cpu_data[cpu].tc_id != myTC)
907 smtc_send_ipi(cpu, SMTC_CLOCK_TICK, 0);
908 }
909}
910
911/*
912 * Cross-VPE interrupts in the SMTC prototype use "software interrupts"
913 * set via cross-VPE MTTR manipulation of the Cause register. It would be
914 * in some regards preferable to have external logic for "doorbell" hardware
915 * interrupts.
916 */
917
918static int cpu_ipi_irq = MIPSCPU_INT_BASE + MIPS_CPU_IPI_IRQ;
919
920static irqreturn_t ipi_interrupt(int irq, void *dev_idm, struct pt_regs *regs)
921{
922 int my_vpe = cpu_data[smp_processor_id()].vpe_id;
923 int my_tc = cpu_data[smp_processor_id()].tc_id;
924 int cpu;
925 struct smtc_ipi *pipi;
926 unsigned long tcstatus;
927 int sent;
928 long flags;
929 unsigned int mtflags;
930 unsigned int vpflags;
931
932 /*
933 * So long as cross-VPE interrupts are done via
934 * MFTR/MTTR read-modify-writes of Cause, we need
935 * to stop other VPEs whenever the local VPE does
936 * anything similar.
937 */
938 local_irq_save(flags);
939 vpflags = dvpe();
940 clear_c0_cause(0x100 << MIPS_CPU_IPI_IRQ);
941 set_c0_status(0x100 << MIPS_CPU_IPI_IRQ);
942 irq_enable_hazard();
943 evpe(vpflags);
944 local_irq_restore(flags);
945
946 /*
947 * Cross-VPE Interrupt handler: Try to directly deliver IPIs
948 * queued for TCs on this VPE other than the current one.
949 * Return-from-interrupt should cause us to drain the queue
950 * for the current TC, so we ought not to have to do it explicitly here.
951 */
952
953 for_each_online_cpu(cpu) {
954 if (cpu_data[cpu].vpe_id != my_vpe)
955 continue;
956
957 pipi = smtc_ipi_dq(&IPIQ[cpu]);
958 if (pipi != NULL) {
959 if (cpu_data[cpu].tc_id != my_tc) {
960 sent = 0;
961 LOCK_MT_PRA();
962 settc(cpu_data[cpu].tc_id);
963 write_tc_c0_tchalt(TCHALT_H);
964 mips_ihb();
965 tcstatus = read_tc_c0_tcstatus();
966 if ((tcstatus & TCSTATUS_IXMT) == 0) {
967 post_direct_ipi(cpu, pipi);
968 sent = 1;
969 }
970 write_tc_c0_tchalt(0);
971 UNLOCK_MT_PRA();
972 if (!sent) {
973 smtc_ipi_req(&IPIQ[cpu], pipi);
974 }
975 } else {
976 /*
977 * ipi_decode() should be called
978 * with interrupts off
979 */
980 local_irq_save(flags);
981 ipi_decode(regs, pipi);
982 local_irq_restore(flags);
983 }
984 }
985 }
986
987 return IRQ_HANDLED;
988}
989
990static void ipi_irq_dispatch(struct pt_regs *regs)
991{
992 do_IRQ(cpu_ipi_irq, regs);
993}
994
995static struct irqaction irq_ipi;
996
997void setup_cross_vpe_interrupts(void)
998{
999 if (!cpu_has_vint)
1000 panic("SMTC Kernel requires Vectored Interupt support");
1001
1002 set_vi_handler(MIPS_CPU_IPI_IRQ, ipi_irq_dispatch);
1003
1004 irq_ipi.handler = ipi_interrupt;
1005 irq_ipi.flags = SA_INTERRUPT;
1006 irq_ipi.name = "SMTC_IPI";
1007
1008 setup_irq_smtc(cpu_ipi_irq, &irq_ipi, (0x100 << MIPS_CPU_IPI_IRQ));
1009
1010 irq_desc[cpu_ipi_irq].status |= IRQ_PER_CPU;
1011}
1012
1013/*
1014 * SMTC-specific hacks invoked from elsewhere in the kernel.
1015 */
1016
1017void smtc_idle_loop_hook(void)
1018{
1019#ifdef SMTC_IDLE_HOOK_DEBUG
1020 int im;
1021 int flags;
1022 int mtflags;
1023 int bit;
1024 int vpe;
1025 int tc;
1026 int hook_ntcs;
1027 /*
1028 * printk within DMT-protected regions can deadlock,
1029 * so buffer diagnostic messages for later output.
1030 */
1031 char *pdb_msg;
1032 char id_ho_db_msg[768]; /* worst-case use should be less than 700 */
1033
1034 if (atomic_read(&idle_hook_initialized) == 0) { /* fast test */
1035 if (atomic_add_return(1, &idle_hook_initialized) == 1) {
1036 int mvpconf0;
1037 /* Tedious stuff to just do once */
1038 mvpconf0 = read_c0_mvpconf0();
1039 hook_ntcs = ((mvpconf0 & MVPCONF0_PTC) >> MVPCONF0_PTC_SHIFT) + 1;
1040 if (hook_ntcs > NR_CPUS)
1041 hook_ntcs = NR_CPUS;
1042 for (tc = 0; tc < hook_ntcs; tc++) {
1043 tcnoprog[tc] = 0;
1044 clock_hang_reported[tc] = 0;
1045 }
1046 for (vpe = 0; vpe < 2; vpe++)
1047 for (im = 0; im < 8; im++)
1048 imstuckcount[vpe][im] = 0;
1049 printk("Idle loop test hook initialized for %d TCs\n", hook_ntcs);
1050 atomic_set(&idle_hook_initialized, 1000);
1051 } else {
1052 /* Someone else is initializing in parallel - let 'em finish */
1053 while (atomic_read(&idle_hook_initialized) < 1000)
1054 ;
1055 }
1056 }
1057
1058 /* Have we stupidly left IXMT set somewhere? */
1059 if (read_c0_tcstatus() & 0x400) {
1060 write_c0_tcstatus(read_c0_tcstatus() & ~0x400);
1061 ehb();
1062 printk("Dangling IXMT in cpu_idle()\n");
1063 }
1064
1065 /* Have we stupidly left an IM bit turned off? */
1066#define IM_LIMIT 2000
1067 local_irq_save(flags);
1068 mtflags = dmt();
1069 pdb_msg = &id_ho_db_msg[0];
1070 im = read_c0_status();
1071 vpe = cpu_data[smp_processor_id()].vpe_id;
1072 for (bit = 0; bit < 8; bit++) {
1073 /*
1074 * In current prototype, I/O interrupts
1075 * are masked for VPE > 0
1076 */
1077 if (vpemask[vpe][bit]) {
1078 if (!(im & (0x100 << bit)))
1079 imstuckcount[vpe][bit]++;
1080 else
1081 imstuckcount[vpe][bit] = 0;
1082 if (imstuckcount[vpe][bit] > IM_LIMIT) {
1083 set_c0_status(0x100 << bit);
1084 ehb();
1085 imstuckcount[vpe][bit] = 0;
1086 pdb_msg += sprintf(pdb_msg,
1087 "Dangling IM %d fixed for VPE %d\n", bit,
1088 vpe);
1089 }
1090 }
1091 }
1092
1093 /*
1094 * Now that we limit outstanding timer IPIs, check for hung TC
1095 */
1096 for (tc = 0; tc < NR_CPUS; tc++) {
1097 /* Don't check ourself - we'll dequeue IPIs just below */
1098 if ((tc != smp_processor_id()) &&
1099 ipi_timer_latch[tc] > timerq_limit) {
1100 if (clock_hang_reported[tc] == 0) {
1101 pdb_msg += sprintf(pdb_msg,
1102 "TC %d looks hung with timer latch at %d\n",
1103 tc, ipi_timer_latch[tc]);
1104 clock_hang_reported[tc]++;
1105 }
1106 }
1107 }
1108 emt(mtflags);
1109 local_irq_restore(flags);
1110 if (pdb_msg != &id_ho_db_msg[0])
1111 printk("CPU%d: %s", smp_processor_id(), id_ho_db_msg);
1112#endif /* SMTC_IDLE_HOOK_DEBUG */
1113 /*
1114 * To the extent that we've ever turned interrupts off,
1115 * we may have accumulated deferred IPIs. This is subtle.
1116 * If we use the smtc_ipi_qdepth() macro, we'll get an
1117 * exact number - but we'll also disable interrupts
1118 * and create a window of failure where a new IPI gets
1119 * queued after we test the depth but before we re-enable
1120 * interrupts. So long as IXMT never gets set, however,
1121 * we should be OK: If we pick up something and dispatch
1122 * it here, that's great. If we see nothing, but concurrent
1123 * with this operation, another TC sends us an IPI, IXMT
1124 * is clear, and we'll handle it as a real pseudo-interrupt
1125 * and not a pseudo-pseudo interrupt.
1126 */
1127 if (IPIQ[smp_processor_id()].depth > 0) {
1128 struct smtc_ipi *pipi;
1129 extern void self_ipi(struct smtc_ipi *);
1130
1131 if ((pipi = smtc_ipi_dq(&IPIQ[smp_processor_id()])) != NULL) {
1132 self_ipi(pipi);
1133 smtc_cpu_stats[smp_processor_id()].selfipis++;
1134 }
1135 }
1136}
1137
1138void smtc_soft_dump(void)
1139{
1140 int i;
1141
1142 printk("Counter Interrupts taken per CPU (TC)\n");
1143 for (i=0; i < NR_CPUS; i++) {
1144 printk("%d: %ld\n", i, smtc_cpu_stats[i].timerints);
1145 }
1146 printk("Self-IPI invocations:\n");
1147 for (i=0; i < NR_CPUS; i++) {
1148 printk("%d: %ld\n", i, smtc_cpu_stats[i].selfipis);
1149 }
1150 smtc_ipi_qdump();
1151 printk("Timer IPI Backlogs:\n");
1152 for (i=0; i < NR_CPUS; i++) {
1153 printk("%d: %d\n", i, ipi_timer_latch[i]);
1154 }
1155 printk("%d Recoveries of \"stolen\" FPU\n",
1156 atomic_read(&smtc_fpu_recoveries));
1157}
1158
1159
1160/*
1161 * TLB management routines special to SMTC
1162 */
1163
1164void smtc_get_new_mmu_context(struct mm_struct *mm, unsigned long cpu)
1165{
1166 unsigned long flags, mtflags, tcstat, prevhalt, asid;
1167 int tlb, i;
1168
1169 /*
1170 * It would be nice to be able to use a spinlock here,
1171 * but this is invoked from within TLB flush routines
1172 * that protect themselves with DVPE, so if a lock is
1173 * held by another TC, it'll never be freed.
1174 *
1175 * DVPE/DMT must not be done with interrupts enabled,
1176 * so even so most callers will already have disabled
1177 * them, let's be really careful...
1178 */
1179
1180 local_irq_save(flags);
1181 if (smtc_status & SMTC_TLB_SHARED) {
1182 mtflags = dvpe();
1183 tlb = 0;
1184 } else {
1185 mtflags = dmt();
1186 tlb = cpu_data[cpu].vpe_id;
1187 }
1188 asid = asid_cache(cpu);
1189
1190 do {
1191 if (!((asid += ASID_INC) & ASID_MASK) ) {
1192 if (cpu_has_vtag_icache)
1193 flush_icache_all();
1194 /* Traverse all online CPUs (hack requires contigous range) */
1195 for (i = 0; i < num_online_cpus(); i++) {
1196 /*
1197 * We don't need to worry about our own CPU, nor those of
1198 * CPUs who don't share our TLB.
1199 */
1200 if ((i != smp_processor_id()) &&
1201 ((smtc_status & SMTC_TLB_SHARED) ||
1202 (cpu_data[i].vpe_id == cpu_data[cpu].vpe_id))) {
1203 settc(cpu_data[i].tc_id);
1204 prevhalt = read_tc_c0_tchalt() & TCHALT_H;
1205 if (!prevhalt) {
1206 write_tc_c0_tchalt(TCHALT_H);
1207 mips_ihb();
1208 }
1209 tcstat = read_tc_c0_tcstatus();
1210 smtc_live_asid[tlb][(tcstat & ASID_MASK)] |= (asiduse)(0x1 << i);
1211 if (!prevhalt)
1212 write_tc_c0_tchalt(0);
1213 }
1214 }
1215 if (!asid) /* fix version if needed */
1216 asid = ASID_FIRST_VERSION;
1217 local_flush_tlb_all(); /* start new asid cycle */
1218 }
1219 } while (smtc_live_asid[tlb][(asid & ASID_MASK)]);
1220
1221 /*
1222 * SMTC shares the TLB within VPEs and possibly across all VPEs.
1223 */
1224 for (i = 0; i < num_online_cpus(); i++) {
1225 if ((smtc_status & SMTC_TLB_SHARED) ||
1226 (cpu_data[i].vpe_id == cpu_data[cpu].vpe_id))
1227 cpu_context(i, mm) = asid_cache(i) = asid;
1228 }
1229
1230 if (smtc_status & SMTC_TLB_SHARED)
1231 evpe(mtflags);
1232 else
1233 emt(mtflags);
1234 local_irq_restore(flags);
1235}
1236
1237/*
1238 * Invoked from macros defined in mmu_context.h
1239 * which must already have disabled interrupts
1240 * and done a DVPE or DMT as appropriate.
1241 */
1242
1243void smtc_flush_tlb_asid(unsigned long asid)
1244{
1245 int entry;
1246 unsigned long ehi;
1247
1248 entry = read_c0_wired();
1249
1250 /* Traverse all non-wired entries */
1251 while (entry < current_cpu_data.tlbsize) {
1252 write_c0_index(entry);
1253 ehb();
1254 tlb_read();
1255 ehb();
1256 ehi = read_c0_entryhi();
1257 if((ehi & ASID_MASK) == asid) {
1258 /*
1259 * Invalidate only entries with specified ASID,
1260 * makiing sure all entries differ.
1261 */
1262 write_c0_entryhi(CKSEG0 + (entry << (PAGE_SHIFT + 1)));
1263 write_c0_entrylo0(0);
1264 write_c0_entrylo1(0);
1265 mtc0_tlbw_hazard();
1266 tlb_write_indexed();
1267 }
1268 entry++;
1269 }
1270 write_c0_index(PARKED_INDEX);
1271 tlbw_use_hazard();
1272}
1273
1274/*
1275 * Support for single-threading cache flush operations.
1276 */
1277
1278int halt_state_save[NR_CPUS];
1279
1280/*
1281 * To really, really be sure that nothing is being done
1282 * by other TCs, halt them all. This code assumes that
1283 * a DVPE has already been done, so while their Halted
1284 * state is theoretically architecturally unstable, in
1285 * practice, it's not going to change while we're looking
1286 * at it.
1287 */
1288
1289void smtc_cflush_lockdown(void)
1290{
1291 int cpu;
1292
1293 for_each_online_cpu(cpu) {
1294 if (cpu != smp_processor_id()) {
1295 settc(cpu_data[cpu].tc_id);
1296 halt_state_save[cpu] = read_tc_c0_tchalt();
1297 write_tc_c0_tchalt(TCHALT_H);
1298 }
1299 }
1300 mips_ihb();
1301}
1302
1303/* It would be cheating to change the cpu_online states during a flush! */
1304
1305void smtc_cflush_release(void)
1306{
1307 int cpu;
1308
1309 /*
1310 * Start with a hazard barrier to ensure
1311 * that all CACHE ops have played through.
1312 */
1313 mips_ihb();
1314
1315 for_each_online_cpu(cpu) {
1316 if (cpu != smp_processor_id()) {
1317 settc(cpu_data[cpu].tc_id);
1318 write_tc_c0_tchalt(halt_state_save[cpu]);
1319 }
1320 }
1321 mips_ihb();
1322}
diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c
index 2aeaa2fd4b32..5e8a18a8e2bd 100644
--- a/arch/mips/kernel/syscall.c
+++ b/arch/mips/kernel/syscall.c
@@ -276,31 +276,9 @@ void sys_set_thread_area(unsigned long addr)
276 276
277asmlinkage int _sys_sysmips(int cmd, long arg1, int arg2, int arg3) 277asmlinkage int _sys_sysmips(int cmd, long arg1, int arg2, int arg3)
278{ 278{
279 int tmp, len; 279 int tmp;
280 char __user *name;
281 280
282 switch(cmd) { 281 switch(cmd) {
283 case SETNAME: {
284 char nodename[__NEW_UTS_LEN + 1];
285
286 if (!capable(CAP_SYS_ADMIN))
287 return -EPERM;
288
289 name = (char __user *) arg1;
290
291 len = strncpy_from_user(nodename, name, __NEW_UTS_LEN);
292 if (len < 0)
293 return -EFAULT;
294
295 down_write(&uts_sem);
296 strncpy(system_utsname.nodename, nodename, len);
297 nodename[__NEW_UTS_LEN] = '\0';
298 strlcpy(system_utsname.nodename, nodename,
299 sizeof(system_utsname.nodename));
300 up_write(&uts_sem);
301 return 0;
302 }
303
304 case MIPS_ATOMIC_SET: 282 case MIPS_ATOMIC_SET:
305 printk(KERN_CRIT "How did I get here?\n"); 283 printk(KERN_CRIT "How did I get here?\n");
306 return -EINVAL; 284 return -EINVAL;
@@ -313,9 +291,6 @@ asmlinkage int _sys_sysmips(int cmd, long arg1, int arg2, int arg3)
313 case FLUSH_CACHE: 291 case FLUSH_CACHE:
314 __flush_cache_all(); 292 __flush_cache_all();
315 return 0; 293 return 0;
316
317 case MIPS_RDNVRAM:
318 return -EIO;
319 } 294 }
320 295
321 return -EINVAL; 296 return -EINVAL;
diff --git a/arch/mips/kernel/time.c b/arch/mips/kernel/time.c
index 5e51a2d8f3f0..13ff4da598cd 100644
--- a/arch/mips/kernel/time.c
+++ b/arch/mips/kernel/time.c
@@ -116,8 +116,7 @@ static void c0_timer_ack(void)
116 write_c0_compare(expirelo); 116 write_c0_compare(expirelo);
117 117
118 /* Check to see if we have missed any timer interrupts. */ 118 /* Check to see if we have missed any timer interrupts. */
119 count = read_c0_count(); 119 while (((count = read_c0_count()) - expirelo) < 0x7fffffff) {
120 if ((count - expirelo) < 0x7fffffff) {
121 /* missed_timer_count++; */ 120 /* missed_timer_count++; */
122 expirelo = count + cycles_per_jiffy; 121 expirelo = count + cycles_per_jiffy;
123 write_c0_compare(expirelo); 122 write_c0_compare(expirelo);
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index bed0eb6cf55d..a7564b08eb4d 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -42,6 +42,7 @@
42#include <asm/watch.h> 42#include <asm/watch.h>
43#include <asm/types.h> 43#include <asm/types.h>
44 44
45extern asmlinkage void handle_int(void);
45extern asmlinkage void handle_tlbm(void); 46extern asmlinkage void handle_tlbm(void);
46extern asmlinkage void handle_tlbl(void); 47extern asmlinkage void handle_tlbl(void);
47extern asmlinkage void handle_tlbs(void); 48extern asmlinkage void handle_tlbs(void);
@@ -279,9 +280,16 @@ static DEFINE_SPINLOCK(die_lock);
279NORET_TYPE void ATTRIB_NORET die(const char * str, struct pt_regs * regs) 280NORET_TYPE void ATTRIB_NORET die(const char * str, struct pt_regs * regs)
280{ 281{
281 static int die_counter; 282 static int die_counter;
283#ifdef CONFIG_MIPS_MT_SMTC
284 unsigned long dvpret = dvpe();
285#endif /* CONFIG_MIPS_MT_SMTC */
282 286
283 console_verbose(); 287 console_verbose();
284 spin_lock_irq(&die_lock); 288 spin_lock_irq(&die_lock);
289 bust_spinlocks(1);
290#ifdef CONFIG_MIPS_MT_SMTC
291 mips_mt_regdump(dvpret);
292#endif /* CONFIG_MIPS_MT_SMTC */
285 printk("%s[#%d]:\n", str, ++die_counter); 293 printk("%s[#%d]:\n", str, ++die_counter);
286 show_registers(regs); 294 show_registers(regs);
287 spin_unlock_irq(&die_lock); 295 spin_unlock_irq(&die_lock);
@@ -750,12 +758,43 @@ asmlinkage void do_cpu(struct pt_regs *regs)
750 &current->thread.fpu.soft); 758 &current->thread.fpu.soft);
751 if (sig) 759 if (sig)
752 force_sig(sig, current); 760 force_sig(sig, current);
761#ifdef CONFIG_MIPS_MT_FPAFF
762 else {
763 /*
764 * MIPS MT processors may have fewer FPU contexts
765 * than CPU threads. If we've emulated more than
766 * some threshold number of instructions, force
767 * migration to a "CPU" that has FP support.
768 */
769 if(mt_fpemul_threshold > 0
770 && ((current->thread.emulated_fp++
771 > mt_fpemul_threshold))) {
772 /*
773 * If there's no FPU present, or if the
774 * application has already restricted
775 * the allowed set to exclude any CPUs
776 * with FPUs, we'll skip the procedure.
777 */
778 if (cpus_intersects(current->cpus_allowed,
779 mt_fpu_cpumask)) {
780 cpumask_t tmask;
781
782 cpus_and(tmask,
783 current->thread.user_cpus_allowed,
784 mt_fpu_cpumask);
785 set_cpus_allowed(current, tmask);
786 current->thread.mflags |= MF_FPUBOUND;
787 }
788 }
789 }
790#endif /* CONFIG_MIPS_MT_FPAFF */
753 } 791 }
754 792
755 return; 793 return;
756 794
757 case 2: 795 case 2:
758 case 3: 796 case 3:
797 die_if_kernel("do_cpu invoked from kernel context!", regs);
759 break; 798 break;
760 } 799 }
761 800
@@ -780,19 +819,64 @@ asmlinkage void do_watch(struct pt_regs *regs)
780 819
781asmlinkage void do_mcheck(struct pt_regs *regs) 820asmlinkage void do_mcheck(struct pt_regs *regs)
782{ 821{
822 const int field = 2 * sizeof(unsigned long);
823 int multi_match = regs->cp0_status & ST0_TS;
824
783 show_regs(regs); 825 show_regs(regs);
784 dump_tlb_all(); 826
827 if (multi_match) {
828 printk("Index : %0x\n", read_c0_index());
829 printk("Pagemask: %0x\n", read_c0_pagemask());
830 printk("EntryHi : %0*lx\n", field, read_c0_entryhi());
831 printk("EntryLo0: %0*lx\n", field, read_c0_entrylo0());
832 printk("EntryLo1: %0*lx\n", field, read_c0_entrylo1());
833 printk("\n");
834 dump_tlb_all();
835 }
836
837 show_code((unsigned int *) regs->cp0_epc);
838
785 /* 839 /*
786 * Some chips may have other causes of machine check (e.g. SB1 840 * Some chips may have other causes of machine check (e.g. SB1
787 * graduation timer) 841 * graduation timer)
788 */ 842 */
789 panic("Caught Machine Check exception - %scaused by multiple " 843 panic("Caught Machine Check exception - %scaused by multiple "
790 "matching entries in the TLB.", 844 "matching entries in the TLB.",
791 (regs->cp0_status & ST0_TS) ? "" : "not "); 845 (multi_match) ? "" : "not ");
792} 846}
793 847
794asmlinkage void do_mt(struct pt_regs *regs) 848asmlinkage void do_mt(struct pt_regs *regs)
795{ 849{
850 int subcode;
851
852 die_if_kernel("MIPS MT Thread exception in kernel", regs);
853
854 subcode = (read_vpe_c0_vpecontrol() & VPECONTROL_EXCPT)
855 >> VPECONTROL_EXCPT_SHIFT;
856 switch (subcode) {
857 case 0:
858 printk(KERN_ERR "Thread Underflow\n");
859 break;
860 case 1:
861 printk(KERN_ERR "Thread Overflow\n");
862 break;
863 case 2:
864 printk(KERN_ERR "Invalid YIELD Qualifier\n");
865 break;
866 case 3:
867 printk(KERN_ERR "Gating Storage Exception\n");
868 break;
869 case 4:
870 printk(KERN_ERR "YIELD Scheduler Exception\n");
871 break;
872 case 5:
873 printk(KERN_ERR "Gating Storage Schedulier Exception\n");
874 break;
875 default:
876 printk(KERN_ERR "*** UNKNOWN THREAD EXCEPTION %d ***\n",
877 subcode);
878 break;
879 }
796 die_if_kernel("MIPS MT Thread exception in kernel", regs); 880 die_if_kernel("MIPS MT Thread exception in kernel", regs);
797 881
798 force_sig(SIGILL, current); 882 force_sig(SIGILL, current);
@@ -833,6 +917,7 @@ static inline void parity_protection_init(void)
833{ 917{
834 switch (current_cpu_data.cputype) { 918 switch (current_cpu_data.cputype) {
835 case CPU_24K: 919 case CPU_24K:
920 case CPU_34K:
836 case CPU_5KC: 921 case CPU_5KC:
837 write_c0_ecc(0x80000000); 922 write_c0_ecc(0x80000000);
838 back_to_back_c0_hazard(); 923 back_to_back_c0_hazard();
@@ -928,7 +1013,15 @@ void ejtag_exception_handler(struct pt_regs *regs)
928 */ 1013 */
929void nmi_exception_handler(struct pt_regs *regs) 1014void nmi_exception_handler(struct pt_regs *regs)
930{ 1015{
1016#ifdef CONFIG_MIPS_MT_SMTC
1017 unsigned long dvpret = dvpe();
1018 bust_spinlocks(1);
931 printk("NMI taken!!!!\n"); 1019 printk("NMI taken!!!!\n");
1020 mips_mt_regdump(dvpret);
1021#else
1022 bust_spinlocks(1);
1023 printk("NMI taken!!!!\n");
1024#endif /* CONFIG_MIPS_MT_SMTC */
932 die("NMI", regs); 1025 die("NMI", regs);
933 while(1) ; 1026 while(1) ;
934} 1027}
@@ -960,27 +1053,29 @@ void *set_except_vector(int n, void *addr)
960 1053
961#ifdef CONFIG_CPU_MIPSR2 1054#ifdef CONFIG_CPU_MIPSR2
962/* 1055/*
963 * Shadow register allocation 1056 * MIPSR2 shadow register set allocation
964 * FIXME: SMP... 1057 * FIXME: SMP...
965 */ 1058 */
966 1059
967/* MIPSR2 shadow register sets */ 1060static struct shadow_registers {
968struct shadow_registers { 1061 /*
969 spinlock_t sr_lock; /* */ 1062 * Number of shadow register sets supported
970 int sr_supported; /* Number of shadow register sets supported */ 1063 */
971 int sr_allocated; /* Bitmap of allocated shadow registers */ 1064 unsigned long sr_supported;
1065 /*
1066 * Bitmap of allocated shadow registers
1067 */
1068 unsigned long sr_allocated;
972} shadow_registers; 1069} shadow_registers;
973 1070
974void mips_srs_init(void) 1071static void mips_srs_init(void)
975{ 1072{
976#ifdef CONFIG_CPU_MIPSR2_SRS 1073#ifdef CONFIG_CPU_MIPSR2_SRS
977 shadow_registers.sr_supported = ((read_c0_srsctl() >> 26) & 0x0f) + 1; 1074 shadow_registers.sr_supported = ((read_c0_srsctl() >> 26) & 0x0f) + 1;
978 printk ("%d MIPSR2 register sets available\n", shadow_registers.sr_supported); 1075 printk(KERN_INFO "%d MIPSR2 register sets available\n",
979#else 1076 shadow_registers.sr_supported);
980 shadow_registers.sr_supported = 1;
981#endif 1077#endif
982 shadow_registers.sr_allocated = 1; /* Set 0 used by kernel */ 1078 shadow_registers.sr_allocated = 1; /* Set 0 used by kernel */
983 spin_lock_init(&shadow_registers.sr_lock);
984} 1079}
985 1080
986int mips_srs_max(void) 1081int mips_srs_max(void)
@@ -988,38 +1083,30 @@ int mips_srs_max(void)
988 return shadow_registers.sr_supported; 1083 return shadow_registers.sr_supported;
989} 1084}
990 1085
991int mips_srs_alloc (void) 1086int mips_srs_alloc(void)
992{ 1087{
993 struct shadow_registers *sr = &shadow_registers; 1088 struct shadow_registers *sr = &shadow_registers;
994 unsigned long flags;
995 int set; 1089 int set;
996 1090
997 spin_lock_irqsave(&sr->sr_lock, flags); 1091again:
1092 set = find_first_zero_bit(&sr->sr_allocated, sr->sr_supported);
1093 if (set >= sr->sr_supported)
1094 return -1;
998 1095
999 for (set = 0; set < sr->sr_supported; set++) { 1096 if (test_and_set_bit(set, &sr->sr_allocated))
1000 if ((sr->sr_allocated & (1 << set)) == 0) { 1097 goto again;
1001 sr->sr_allocated |= 1 << set;
1002 spin_unlock_irqrestore(&sr->sr_lock, flags);
1003 return set;
1004 }
1005 }
1006 1098
1007 /* None available */ 1099 return set;
1008 spin_unlock_irqrestore(&sr->sr_lock, flags);
1009 return -1;
1010} 1100}
1011 1101
1012void mips_srs_free (int set) 1102void mips_srs_free(int set)
1013{ 1103{
1014 struct shadow_registers *sr = &shadow_registers; 1104 struct shadow_registers *sr = &shadow_registers;
1015 unsigned long flags;
1016 1105
1017 spin_lock_irqsave(&sr->sr_lock, flags); 1106 clear_bit(set, &sr->sr_allocated);
1018 sr->sr_allocated &= ~(1 << set);
1019 spin_unlock_irqrestore(&sr->sr_lock, flags);
1020} 1107}
1021 1108
1022void *set_vi_srs_handler (int n, void *addr, int srs) 1109static void *set_vi_srs_handler(int n, void *addr, int srs)
1023{ 1110{
1024 unsigned long handler; 1111 unsigned long handler;
1025 unsigned long old_handler = vi_handlers[n]; 1112 unsigned long old_handler = vi_handlers[n];
@@ -1032,8 +1119,7 @@ void *set_vi_srs_handler (int n, void *addr, int srs)
1032 if (addr == NULL) { 1119 if (addr == NULL) {
1033 handler = (unsigned long) do_default_vi; 1120 handler = (unsigned long) do_default_vi;
1034 srs = 0; 1121 srs = 0;
1035 } 1122 } else
1036 else
1037 handler = (unsigned long) addr; 1123 handler = (unsigned long) addr;
1038 vi_handlers[n] = (unsigned long) addr; 1124 vi_handlers[n] = (unsigned long) addr;
1039 1125
@@ -1045,8 +1131,7 @@ void *set_vi_srs_handler (int n, void *addr, int srs)
1045 if (cpu_has_veic) { 1131 if (cpu_has_veic) {
1046 if (board_bind_eic_interrupt) 1132 if (board_bind_eic_interrupt)
1047 board_bind_eic_interrupt (n, srs); 1133 board_bind_eic_interrupt (n, srs);
1048 } 1134 } else if (cpu_has_vint) {
1049 else if (cpu_has_vint) {
1050 /* SRSMap is only defined if shadow sets are implemented */ 1135 /* SRSMap is only defined if shadow sets are implemented */
1051 if (mips_srs_max() > 1) 1136 if (mips_srs_max() > 1)
1052 change_c0_srsmap (0xf << n*4, srs << n*4); 1137 change_c0_srsmap (0xf << n*4, srs << n*4);
@@ -1060,6 +1145,15 @@ void *set_vi_srs_handler (int n, void *addr, int srs)
1060 1145
1061 extern char except_vec_vi, except_vec_vi_lui; 1146 extern char except_vec_vi, except_vec_vi_lui;
1062 extern char except_vec_vi_ori, except_vec_vi_end; 1147 extern char except_vec_vi_ori, except_vec_vi_end;
1148#ifdef CONFIG_MIPS_MT_SMTC
1149 /*
1150 * We need to provide the SMTC vectored interrupt handler
1151 * not only with the address of the handler, but with the
1152 * Status.IM bit to be masked before going there.
1153 */
1154 extern char except_vec_vi_mori;
1155 const int mori_offset = &except_vec_vi_mori - &except_vec_vi;
1156#endif /* CONFIG_MIPS_MT_SMTC */
1063 const int handler_len = &except_vec_vi_end - &except_vec_vi; 1157 const int handler_len = &except_vec_vi_end - &except_vec_vi;
1064 const int lui_offset = &except_vec_vi_lui - &except_vec_vi; 1158 const int lui_offset = &except_vec_vi_lui - &except_vec_vi;
1065 const int ori_offset = &except_vec_vi_ori - &except_vec_vi; 1159 const int ori_offset = &except_vec_vi_ori - &except_vec_vi;
@@ -1073,6 +1167,12 @@ void *set_vi_srs_handler (int n, void *addr, int srs)
1073 } 1167 }
1074 1168
1075 memcpy (b, &except_vec_vi, handler_len); 1169 memcpy (b, &except_vec_vi, handler_len);
1170#ifdef CONFIG_MIPS_MT_SMTC
1171 if (n > 7)
1172 printk("Vector index %d exceeds SMTC maximum\n", n);
1173 w = (u32 *)(b + mori_offset);
1174 *w = (*w & 0xffff0000) | (0x100 << n);
1175#endif /* CONFIG_MIPS_MT_SMTC */
1076 w = (u32 *)(b + lui_offset); 1176 w = (u32 *)(b + lui_offset);
1077 *w = (*w & 0xffff0000) | (((u32)handler >> 16) & 0xffff); 1177 *w = (*w & 0xffff0000) | (((u32)handler >> 16) & 0xffff);
1078 w = (u32 *)(b + ori_offset); 1178 w = (u32 *)(b + ori_offset);
@@ -1095,9 +1195,9 @@ void *set_vi_srs_handler (int n, void *addr, int srs)
1095 return (void *)old_handler; 1195 return (void *)old_handler;
1096} 1196}
1097 1197
1098void *set_vi_handler (int n, void *addr) 1198void *set_vi_handler(int n, void *addr)
1099{ 1199{
1100 return set_vi_srs_handler (n, addr, 0); 1200 return set_vi_srs_handler(n, addr, 0);
1101} 1201}
1102#endif 1202#endif
1103 1203
@@ -1113,8 +1213,29 @@ extern asmlinkage int _restore_fp_context(struct sigcontext *sc);
1113extern asmlinkage int fpu_emulator_save_context(struct sigcontext *sc); 1213extern asmlinkage int fpu_emulator_save_context(struct sigcontext *sc);
1114extern asmlinkage int fpu_emulator_restore_context(struct sigcontext *sc); 1214extern asmlinkage int fpu_emulator_restore_context(struct sigcontext *sc);
1115 1215
1216#ifdef CONFIG_SMP
1217static int smp_save_fp_context(struct sigcontext *sc)
1218{
1219 return cpu_has_fpu
1220 ? _save_fp_context(sc)
1221 : fpu_emulator_save_context(sc);
1222}
1223
1224static int smp_restore_fp_context(struct sigcontext *sc)
1225{
1226 return cpu_has_fpu
1227 ? _restore_fp_context(sc)
1228 : fpu_emulator_restore_context(sc);
1229}
1230#endif
1231
1116static inline void signal_init(void) 1232static inline void signal_init(void)
1117{ 1233{
1234#ifdef CONFIG_SMP
1235 /* For now just do the cpu_has_fpu check when the functions are invoked */
1236 save_fp_context = smp_save_fp_context;
1237 restore_fp_context = smp_restore_fp_context;
1238#else
1118 if (cpu_has_fpu) { 1239 if (cpu_has_fpu) {
1119 save_fp_context = _save_fp_context; 1240 save_fp_context = _save_fp_context;
1120 restore_fp_context = _restore_fp_context; 1241 restore_fp_context = _restore_fp_context;
@@ -1122,6 +1243,7 @@ static inline void signal_init(void)
1122 save_fp_context = fpu_emulator_save_context; 1243 save_fp_context = fpu_emulator_save_context;
1123 restore_fp_context = fpu_emulator_restore_context; 1244 restore_fp_context = fpu_emulator_restore_context;
1124 } 1245 }
1246#endif
1125} 1247}
1126 1248
1127#ifdef CONFIG_MIPS32_COMPAT 1249#ifdef CONFIG_MIPS32_COMPAT
@@ -1158,6 +1280,20 @@ void __init per_cpu_trap_init(void)
1158{ 1280{
1159 unsigned int cpu = smp_processor_id(); 1281 unsigned int cpu = smp_processor_id();
1160 unsigned int status_set = ST0_CU0; 1282 unsigned int status_set = ST0_CU0;
1283#ifdef CONFIG_MIPS_MT_SMTC
1284 int secondaryTC = 0;
1285 int bootTC = (cpu == 0);
1286
1287 /*
1288 * Only do per_cpu_trap_init() for first TC of Each VPE.
1289 * Note that this hack assumes that the SMTC init code
1290 * assigns TCs consecutively and in ascending order.
1291 */
1292
1293 if (((read_c0_tcbind() & TCBIND_CURTC) != 0) &&
1294 ((read_c0_tcbind() & TCBIND_CURVPE) == cpu_data[cpu - 1].vpe_id))
1295 secondaryTC = 1;
1296#endif /* CONFIG_MIPS_MT_SMTC */
1161 1297
1162 /* 1298 /*
1163 * Disable coprocessors and select 32-bit or 64-bit addressing 1299 * Disable coprocessors and select 32-bit or 64-bit addressing
@@ -1180,6 +1316,10 @@ void __init per_cpu_trap_init(void)
1180 write_c0_hwrena (0x0000000f); /* Allow rdhwr to all registers */ 1316 write_c0_hwrena (0x0000000f); /* Allow rdhwr to all registers */
1181#endif 1317#endif
1182 1318
1319#ifdef CONFIG_MIPS_MT_SMTC
1320 if (!secondaryTC) {
1321#endif /* CONFIG_MIPS_MT_SMTC */
1322
1183 /* 1323 /*
1184 * Interrupt handling. 1324 * Interrupt handling.
1185 */ 1325 */
@@ -1196,6 +1336,9 @@ void __init per_cpu_trap_init(void)
1196 } else 1336 } else
1197 set_c0_cause(CAUSEF_IV); 1337 set_c0_cause(CAUSEF_IV);
1198 } 1338 }
1339#ifdef CONFIG_MIPS_MT_SMTC
1340 }
1341#endif /* CONFIG_MIPS_MT_SMTC */
1199 1342
1200 cpu_data[cpu].asid_cache = ASID_FIRST_VERSION; 1343 cpu_data[cpu].asid_cache = ASID_FIRST_VERSION;
1201 TLBMISS_HANDLER_SETUP(); 1344 TLBMISS_HANDLER_SETUP();
@@ -1205,8 +1348,14 @@ void __init per_cpu_trap_init(void)
1205 BUG_ON(current->mm); 1348 BUG_ON(current->mm);
1206 enter_lazy_tlb(&init_mm, current); 1349 enter_lazy_tlb(&init_mm, current);
1207 1350
1208 cpu_cache_init(); 1351#ifdef CONFIG_MIPS_MT_SMTC
1209 tlb_init(); 1352 if (bootTC) {
1353#endif /* CONFIG_MIPS_MT_SMTC */
1354 cpu_cache_init();
1355 tlb_init();
1356#ifdef CONFIG_MIPS_MT_SMTC
1357 }
1358#endif /* CONFIG_MIPS_MT_SMTC */
1210} 1359}
1211 1360
1212/* Install CPU exception handler */ 1361/* Install CPU exception handler */
@@ -1278,7 +1427,7 @@ void __init trap_init(void)
1278 if (cpu_has_veic || cpu_has_vint) { 1427 if (cpu_has_veic || cpu_has_vint) {
1279 int nvec = cpu_has_veic ? 64 : 8; 1428 int nvec = cpu_has_veic ? 64 : 8;
1280 for (i = 0; i < nvec; i++) 1429 for (i = 0; i < nvec; i++)
1281 set_vi_handler (i, NULL); 1430 set_vi_handler(i, NULL);
1282 } 1431 }
1283 else if (cpu_has_divec) 1432 else if (cpu_has_divec)
1284 set_handler(0x200, &except_vec4, 0x8); 1433 set_handler(0x200, &except_vec4, 0x8);
@@ -1297,6 +1446,7 @@ void __init trap_init(void)
1297 if (board_be_init) 1446 if (board_be_init)
1298 board_be_init(); 1447 board_be_init();
1299 1448
1449 set_except_vector(0, handle_int);
1300 set_except_vector(1, handle_tlbm); 1450 set_except_vector(1, handle_tlbm);
1301 set_except_vector(2, handle_tlbl); 1451 set_except_vector(2, handle_tlbl);
1302 set_except_vector(3, handle_tlbs); 1452 set_except_vector(3, handle_tlbs);
diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S
index 2ad0cedf29fe..b84d1f9ce28e 100644
--- a/arch/mips/kernel/vmlinux.lds.S
+++ b/arch/mips/kernel/vmlinux.lds.S
@@ -2,7 +2,7 @@
2#include <asm/asm-offsets.h> 2#include <asm/asm-offsets.h>
3#include <asm-generic/vmlinux.lds.h> 3#include <asm-generic/vmlinux.lds.h>
4 4
5#undef mips /* CPP really sucks for this job */ 5#undef mips
6#define mips mips 6#define mips mips
7OUTPUT_ARCH(mips) 7OUTPUT_ARCH(mips)
8ENTRY(kernel_entry) 8ENTRY(kernel_entry)
@@ -151,23 +151,13 @@ SECTIONS
151 151
152 /* This is the MIPS specific mdebug section. */ 152 /* This is the MIPS specific mdebug section. */
153 .mdebug : { *(.mdebug) } 153 .mdebug : { *(.mdebug) }
154 /* These are needed for ELF backends which have not yet been 154
155 converted to the new style linker. */ 155 STABS_DEBUG
156 .stab 0 : { *(.stab) } 156
157 .stabstr 0 : { *(.stabstr) } 157 DWARF_DEBUG
158 /* DWARF debug sections. 158
159 Symbols in the .debug DWARF section are relative to the beginning of the
160 section so we begin .debug at 0. It's not clear yet what needs to happen
161 for the others. */
162 .debug 0 : { *(.debug) }
163 .debug_srcinfo 0 : { *(.debug_srcinfo) }
164 .debug_aranges 0 : { *(.debug_aranges) }
165 .debug_pubnames 0 : { *(.debug_pubnames) }
166 .debug_sfnames 0 : { *(.debug_sfnames) }
167 .line 0 : { *(.line) }
168 /* These must appear regardless of . */ 159 /* These must appear regardless of . */
169 .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) } 160 .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
170 .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) } 161 .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
171 .comment : { *(.comment) }
172 .note : { *(.note) } 162 .note : { *(.note) }
173} 163}
diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c
index ae83b755cf4a..85d7df7b18e1 100644
--- a/arch/mips/kernel/vpe.c
+++ b/arch/mips/kernel/vpe.c
@@ -13,7 +13,6 @@
13 * You should have received a copy of the GNU General Public License along 13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc., 14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. 15 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
16 *
17 */ 16 */
18 17
19/* 18/*
@@ -27,11 +26,8 @@
27 * 26 *
28 * To load and run, simply cat a SP 'program file' to /dev/vpe1. 27 * To load and run, simply cat a SP 'program file' to /dev/vpe1.
29 * i.e cat spapp >/dev/vpe1. 28 * i.e cat spapp >/dev/vpe1.
30 *
31 * You'll need to have the following device files.
32 * mknod /dev/vpe0 c 63 0
33 * mknod /dev/vpe1 c 63 1
34 */ 29 */
30
35#include <linux/config.h> 31#include <linux/config.h>
36#include <linux/kernel.h> 32#include <linux/kernel.h>
37#include <linux/module.h> 33#include <linux/module.h>
@@ -55,6 +51,8 @@
55#include <asm/cpu.h> 51#include <asm/cpu.h>
56#include <asm/processor.h> 52#include <asm/processor.h>
57#include <asm/system.h> 53#include <asm/system.h>
54#include <asm/vpe.h>
55#include <asm/kspd.h>
58 56
59typedef void *vpe_handle; 57typedef void *vpe_handle;
60 58
@@ -68,6 +66,11 @@ typedef void *vpe_handle;
68static char module_name[] = "vpe"; 66static char module_name[] = "vpe";
69static int major; 67static int major;
70 68
69#ifdef CONFIG_MIPS_APSP_KSPD
70 static struct kspd_notifications kspd_events;
71static int kspd_events_reqd = 0;
72#endif
73
71/* grab the likely amount of memory we will need. */ 74/* grab the likely amount of memory we will need. */
72#ifdef CONFIG_MIPS_VPE_LOADER_TOM 75#ifdef CONFIG_MIPS_VPE_LOADER_TOM
73#define P_SIZE (2 * 1024 * 1024) 76#define P_SIZE (2 * 1024 * 1024)
@@ -76,7 +79,10 @@ static int major;
76#define P_SIZE (256 * 1024) 79#define P_SIZE (256 * 1024)
77#endif 80#endif
78 81
82extern unsigned long physical_memsize;
83
79#define MAX_VPES 16 84#define MAX_VPES 16
85#define VPE_PATH_MAX 256
80 86
81enum vpe_state { 87enum vpe_state {
82 VPE_STATE_UNUSED = 0, 88 VPE_STATE_UNUSED = 0,
@@ -102,6 +108,8 @@ struct vpe {
102 unsigned long len; 108 unsigned long len;
103 char *pbuffer; 109 char *pbuffer;
104 unsigned long plen; 110 unsigned long plen;
111 unsigned int uid, gid;
112 char cwd[VPE_PATH_MAX];
105 113
106 unsigned long __start; 114 unsigned long __start;
107 115
@@ -113,6 +121,9 @@ struct vpe {
113 121
114 /* shared symbol address */ 122 /* shared symbol address */
115 void *shared_ptr; 123 void *shared_ptr;
124
125 /* the list of who wants to know when something major happens */
126 struct list_head notify;
116}; 127};
117 128
118struct tc { 129struct tc {
@@ -138,7 +149,7 @@ struct vpecontrol_ {
138} vpecontrol; 149} vpecontrol;
139 150
140static void release_progmem(void *ptr); 151static void release_progmem(void *ptr);
141static void dump_vpe(struct vpe * v); 152/* static __attribute_used__ void dump_vpe(struct vpe * v); */
142extern void save_gp_address(unsigned int secbase, unsigned int rel); 153extern void save_gp_address(unsigned int secbase, unsigned int rel);
143 154
144/* get the vpe associated with this minor */ 155/* get the vpe associated with this minor */
@@ -146,12 +157,14 @@ struct vpe *get_vpe(int minor)
146{ 157{
147 struct vpe *v; 158 struct vpe *v;
148 159
160 if (!cpu_has_mipsmt)
161 return NULL;
162
149 list_for_each_entry(v, &vpecontrol.vpe_list, list) { 163 list_for_each_entry(v, &vpecontrol.vpe_list, list) {
150 if (v->minor == minor) 164 if (v->minor == minor)
151 return v; 165 return v;
152 } 166 }
153 167
154 printk(KERN_DEBUG "VPE: get_vpe minor %d not found\n", minor);
155 return NULL; 168 return NULL;
156} 169}
157 170
@@ -165,8 +178,6 @@ struct tc *get_tc(int index)
165 return t; 178 return t;
166 } 179 }
167 180
168 printk(KERN_DEBUG "VPE: get_tc index %d not found\n", index);
169
170 return NULL; 181 return NULL;
171} 182}
172 183
@@ -179,8 +190,6 @@ struct tc *get_tc_unused(void)
179 return t; 190 return t;
180 } 191 }
181 192
182 printk(KERN_DEBUG "VPE: All TC's are in use\n");
183
184 return NULL; 193 return NULL;
185} 194}
186 195
@@ -190,13 +199,13 @@ struct vpe *alloc_vpe(int minor)
190 struct vpe *v; 199 struct vpe *v;
191 200
192 if ((v = kzalloc(sizeof(struct vpe), GFP_KERNEL)) == NULL) { 201 if ((v = kzalloc(sizeof(struct vpe), GFP_KERNEL)) == NULL) {
193 printk(KERN_WARNING "VPE: alloc_vpe no mem\n");
194 return NULL; 202 return NULL;
195 } 203 }
196 204
197 INIT_LIST_HEAD(&v->tc); 205 INIT_LIST_HEAD(&v->tc);
198 list_add_tail(&v->list, &vpecontrol.vpe_list); 206 list_add_tail(&v->list, &vpecontrol.vpe_list);
199 207
208 INIT_LIST_HEAD(&v->notify);
200 v->minor = minor; 209 v->minor = minor;
201 return v; 210 return v;
202} 211}
@@ -207,7 +216,6 @@ struct tc *alloc_tc(int index)
207 struct tc *t; 216 struct tc *t;
208 217
209 if ((t = kzalloc(sizeof(struct tc), GFP_KERNEL)) == NULL) { 218 if ((t = kzalloc(sizeof(struct tc), GFP_KERNEL)) == NULL) {
210 printk(KERN_WARNING "VPE: alloc_tc no mem\n");
211 return NULL; 219 return NULL;
212 } 220 }
213 221
@@ -236,20 +244,16 @@ void dump_mtregs(void)
236 printk("config3 0x%lx MT %ld\n", val, 244 printk("config3 0x%lx MT %ld\n", val,
237 (val & CONFIG3_MT) >> CONFIG3_MT_SHIFT); 245 (val & CONFIG3_MT) >> CONFIG3_MT_SHIFT);
238 246
239 val = read_c0_mvpconf0();
240 printk("mvpconf0 0x%lx, PVPE %ld PTC %ld M %ld\n", val,
241 (val & MVPCONF0_PVPE) >> MVPCONF0_PVPE_SHIFT,
242 val & MVPCONF0_PTC, (val & MVPCONF0_M) >> MVPCONF0_M_SHIFT);
243
244 val = read_c0_mvpcontrol(); 247 val = read_c0_mvpcontrol();
245 printk("MVPControl 0x%lx, STLB %ld VPC %ld EVP %ld\n", val, 248 printk("MVPControl 0x%lx, STLB %ld VPC %ld EVP %ld\n", val,
246 (val & MVPCONTROL_STLB) >> MVPCONTROL_STLB_SHIFT, 249 (val & MVPCONTROL_STLB) >> MVPCONTROL_STLB_SHIFT,
247 (val & MVPCONTROL_VPC) >> MVPCONTROL_VPC_SHIFT, 250 (val & MVPCONTROL_VPC) >> MVPCONTROL_VPC_SHIFT,
248 (val & MVPCONTROL_EVP)); 251 (val & MVPCONTROL_EVP));
249 252
250 val = read_c0_vpeconf0(); 253 val = read_c0_mvpconf0();
251 printk("VPEConf0 0x%lx MVP %ld\n", val, 254 printk("mvpconf0 0x%lx, PVPE %ld PTC %ld M %ld\n", val,
252 (val & VPECONF0_MVP) >> VPECONF0_MVP_SHIFT); 255 (val & MVPCONF0_PVPE) >> MVPCONF0_PVPE_SHIFT,
256 val & MVPCONF0_PTC, (val & MVPCONF0_M) >> MVPCONF0_M_SHIFT);
253} 257}
254 258
255/* Find some VPE program space */ 259/* Find some VPE program space */
@@ -354,9 +358,9 @@ static int apply_r_mips_gprel16(struct module *me, uint32_t *location,
354 } 358 }
355 359
356 if( (rel > 32768) || (rel < -32768) ) { 360 if( (rel > 32768) || (rel < -32768) ) {
357 printk(KERN_ERR 361 printk(KERN_DEBUG "VPE loader: apply_r_mips_gprel16: "
358 "apply_r_mips_gprel16: relative address out of range 0x%x %d\n", 362 "relative address 0x%x out of range of gp register\n",
359 rel, rel); 363 rel);
360 return -ENOEXEC; 364 return -ENOEXEC;
361 } 365 }
362 366
@@ -374,8 +378,8 @@ static int apply_r_mips_pc16(struct module *me, uint32_t *location,
374 rel -= 1; // and one instruction less due to the branch delay slot. 378 rel -= 1; // and one instruction less due to the branch delay slot.
375 379
376 if( (rel > 32768) || (rel < -32768) ) { 380 if( (rel > 32768) || (rel < -32768) ) {
377 printk(KERN_ERR 381 printk(KERN_DEBUG "VPE loader: "
378 "apply_r_mips_pc16: relative address out of range 0x%x\n", rel); 382 "apply_r_mips_pc16: relative address out of range 0x%x\n", rel);
379 return -ENOEXEC; 383 return -ENOEXEC;
380 } 384 }
381 385
@@ -396,7 +400,8 @@ static int apply_r_mips_26(struct module *me, uint32_t *location,
396 Elf32_Addr v) 400 Elf32_Addr v)
397{ 401{
398 if (v % 4) { 402 if (v % 4) {
399 printk(KERN_ERR "module %s: dangerous relocation mod4\n", me->name); 403 printk(KERN_DEBUG "VPE loader: apply_r_mips_26 "
404 " unaligned relocation\n");
400 return -ENOEXEC; 405 return -ENOEXEC;
401 } 406 }
402 407
@@ -459,12 +464,13 @@ static int apply_r_mips_lo16(struct module *me, uint32_t *location,
459 /* 464 /*
460 * The value for the HI16 had best be the same. 465 * The value for the HI16 had best be the same.
461 */ 466 */
462 if (v != l->value) { 467 if (v != l->value) {
463 printk("%d != %d\n", v, l->value); 468 printk(KERN_DEBUG "VPE loader: "
464 goto out_danger; 469 "apply_r_mips_lo16/hi16: "
470 "inconsistent value information\n");
471 return -ENOEXEC;
465 } 472 }
466 473
467
468 /* 474 /*
469 * Do the HI16 relocation. Note that we actually don't 475 * Do the HI16 relocation. Note that we actually don't
470 * need to know anything about the LO16 itself, except 476 * need to know anything about the LO16 itself, except
@@ -500,11 +506,6 @@ static int apply_r_mips_lo16(struct module *me, uint32_t *location,
500 *location = insnlo; 506 *location = insnlo;
501 507
502 return 0; 508 return 0;
503
504out_danger:
505 printk(KERN_ERR "module %s: dangerous " "relocation\n", me->name);
506
507 return -ENOEXEC;
508} 509}
509 510
510static int (*reloc_handlers[]) (struct module *me, uint32_t *location, 511static int (*reloc_handlers[]) (struct module *me, uint32_t *location,
@@ -518,6 +519,15 @@ static int (*reloc_handlers[]) (struct module *me, uint32_t *location,
518 [R_MIPS_PC16] = apply_r_mips_pc16 519 [R_MIPS_PC16] = apply_r_mips_pc16
519}; 520};
520 521
522static char *rstrs[] = {
523 [R_MIPS_NONE] = "MIPS_NONE",
524 [R_MIPS_32] = "MIPS_32",
525 [R_MIPS_26] = "MIPS_26",
526 [R_MIPS_HI16] = "MIPS_HI16",
527 [R_MIPS_LO16] = "MIPS_LO16",
528 [R_MIPS_GPREL16] = "MIPS_GPREL16",
529 [R_MIPS_PC16] = "MIPS_PC16"
530};
521 531
522int apply_relocations(Elf32_Shdr *sechdrs, 532int apply_relocations(Elf32_Shdr *sechdrs,
523 const char *strtab, 533 const char *strtab,
@@ -552,15 +562,13 @@ int apply_relocations(Elf32_Shdr *sechdrs,
552 562
553 res = reloc_handlers[ELF32_R_TYPE(r_info)](me, location, v); 563 res = reloc_handlers[ELF32_R_TYPE(r_info)](me, location, v);
554 if( res ) { 564 if( res ) {
555 printk(KERN_DEBUG 565 char *r = rstrs[ELF32_R_TYPE(r_info)];
556 "relocation error 0x%x sym refer <%s> value 0x%x " 566 printk(KERN_WARNING "VPE loader: .text+0x%x "
557 "type 0x%x r_info 0x%x\n", 567 "relocation type %s for symbol \"%s\" failed\n",
558 (unsigned int)location, strtab + sym->st_name, v, 568 rel[i].r_offset, r ? r : "UNKNOWN",
559 r_info, ELF32_R_TYPE(r_info)); 569 strtab + sym->st_name);
560 }
561
562 if (res)
563 return res; 570 return res;
571 }
564 } 572 }
565 573
566 return 0; 574 return 0;
@@ -576,7 +584,7 @@ void save_gp_address(unsigned int secbase, unsigned int rel)
576 584
577 585
578/* Change all symbols so that sh_value encodes the pointer directly. */ 586/* Change all symbols so that sh_value encodes the pointer directly. */
579static int simplify_symbols(Elf_Shdr * sechdrs, 587static void simplify_symbols(Elf_Shdr * sechdrs,
580 unsigned int symindex, 588 unsigned int symindex,
581 const char *strtab, 589 const char *strtab,
582 const char *secstrings, 590 const char *secstrings,
@@ -585,18 +593,21 @@ static int simplify_symbols(Elf_Shdr * sechdrs,
585 Elf_Sym *sym = (void *)sechdrs[symindex].sh_addr; 593 Elf_Sym *sym = (void *)sechdrs[symindex].sh_addr;
586 unsigned long secbase, bssbase = 0; 594 unsigned long secbase, bssbase = 0;
587 unsigned int i, n = sechdrs[symindex].sh_size / sizeof(Elf_Sym); 595 unsigned int i, n = sechdrs[symindex].sh_size / sizeof(Elf_Sym);
588 int ret = 0, size; 596 int size;
589 597
590 /* find the .bss section for COMMON symbols */ 598 /* find the .bss section for COMMON symbols */
591 for (i = 0; i < nsecs; i++) { 599 for (i = 0; i < nsecs; i++) {
592 if (strncmp(secstrings + sechdrs[i].sh_name, ".bss", 4) == 0) 600 if (strncmp(secstrings + sechdrs[i].sh_name, ".bss", 4) == 0) {
593 bssbase = sechdrs[i].sh_addr; 601 bssbase = sechdrs[i].sh_addr;
602 break;
603 }
594 } 604 }
595 605
596 for (i = 1; i < n; i++) { 606 for (i = 1; i < n; i++) {
597 switch (sym[i].st_shndx) { 607 switch (sym[i].st_shndx) {
598 case SHN_COMMON: 608 case SHN_COMMON:
599 /* Allocate space for the symbol in the .bss section. st_value is currently size. 609 /* Allocate space for the symbol in the .bss section.
610 st_value is currently size.
600 We want it to have the address of the symbol. */ 611 We want it to have the address of the symbol. */
601 612
602 size = sym[i].st_value; 613 size = sym[i].st_value;
@@ -614,11 +625,9 @@ static int simplify_symbols(Elf_Shdr * sechdrs,
614 break; 625 break;
615 626
616 case SHN_MIPS_SCOMMON: 627 case SHN_MIPS_SCOMMON:
617 628 printk(KERN_DEBUG "simplify_symbols: ignoring SHN_MIPS_SCOMMON"
618 printk(KERN_DEBUG 629 "symbol <%s> st_shndx %d\n", strtab + sym[i].st_name,
619 "simplify_symbols: ignoring SHN_MIPS_SCOMMON symbol <%s> st_shndx %d\n", 630 sym[i].st_shndx);
620 strtab + sym[i].st_name, sym[i].st_shndx);
621
622 // .sbss section 631 // .sbss section
623 break; 632 break;
624 633
@@ -632,10 +641,7 @@ static int simplify_symbols(Elf_Shdr * sechdrs,
632 sym[i].st_value += secbase; 641 sym[i].st_value += secbase;
633 break; 642 break;
634 } 643 }
635
636 } 644 }
637
638 return ret;
639} 645}
640 646
641#ifdef DEBUG_ELFLOADER 647#ifdef DEBUG_ELFLOADER
@@ -655,9 +661,26 @@ static void dump_elfsymbols(Elf_Shdr * sechdrs, unsigned int symindex,
655 661
656static void dump_tc(struct tc *t) 662static void dump_tc(struct tc *t)
657{ 663{
658 printk(KERN_WARNING "VPE: TC index %d TCStatus 0x%lx halt 0x%lx\n", 664 unsigned long val;
659 t->index, read_tc_c0_tcstatus(), read_tc_c0_tchalt()); 665
660 printk(KERN_WARNING "VPE: tcrestart 0x%lx\n", read_tc_c0_tcrestart()); 666 settc(t->index);
667 printk(KERN_DEBUG "VPE loader: TC index %d targtc %ld "
668 "TCStatus 0x%lx halt 0x%lx\n",
669 t->index, read_c0_vpecontrol() & VPECONTROL_TARGTC,
670 read_tc_c0_tcstatus(), read_tc_c0_tchalt());
671
672 printk(KERN_DEBUG " tcrestart 0x%lx\n", read_tc_c0_tcrestart());
673 printk(KERN_DEBUG " tcbind 0x%lx\n", read_tc_c0_tcbind());
674
675 val = read_c0_vpeconf0();
676 printk(KERN_DEBUG " VPEConf0 0x%lx MVP %ld\n", val,
677 (val & VPECONF0_MVP) >> VPECONF0_MVP_SHIFT);
678
679 printk(KERN_DEBUG " c0 status 0x%lx\n", read_vpe_c0_status());
680 printk(KERN_DEBUG " c0 cause 0x%lx\n", read_vpe_c0_cause());
681
682 printk(KERN_DEBUG " c0 badvaddr 0x%lx\n", read_vpe_c0_badvaddr());
683 printk(KERN_DEBUG " c0 epc 0x%lx\n", read_vpe_c0_epc());
661} 684}
662 685
663static void dump_tclist(void) 686static void dump_tclist(void)
@@ -672,96 +695,108 @@ static void dump_tclist(void)
672/* We are prepared so configure and start the VPE... */ 695/* We are prepared so configure and start the VPE... */
673int vpe_run(struct vpe * v) 696int vpe_run(struct vpe * v)
674{ 697{
675 unsigned long val; 698 struct vpe_notifications *n;
699 unsigned long val, dmt_flag;
676 struct tc *t; 700 struct tc *t;
677 701
678 /* check we are the Master VPE */ 702 /* check we are the Master VPE */
679 val = read_c0_vpeconf0(); 703 val = read_c0_vpeconf0();
680 if (!(val & VPECONF0_MVP)) { 704 if (!(val & VPECONF0_MVP)) {
681 printk(KERN_WARNING 705 printk(KERN_WARNING
682 "VPE: only Master VPE's are allowed to configure MT\n"); 706 "VPE loader: only Master VPE's are allowed to configure MT\n");
683 return -1; 707 return -1;
684 } 708 }
685 709
686 /* disable MT (using dvpe) */ 710 /* disable MT (using dvpe) */
687 dvpe(); 711 dvpe();
688 712
713 if (!list_empty(&v->tc)) {
714 if ((t = list_entry(v->tc.next, struct tc, tc)) == NULL) {
715 printk(KERN_WARNING "VPE loader: TC %d is already in use.\n",
716 t->index);
717 return -ENOEXEC;
718 }
719 } else {
720 printk(KERN_WARNING "VPE loader: No TC's associated with VPE %d\n",
721 v->minor);
722 return -ENOEXEC;
723 }
724
689 /* Put MVPE's into 'configuration state' */ 725 /* Put MVPE's into 'configuration state' */
690 set_c0_mvpcontrol(MVPCONTROL_VPC); 726 set_c0_mvpcontrol(MVPCONTROL_VPC);
691 727
692 if (!list_empty(&v->tc)) {
693 if ((t = list_entry(v->tc.next, struct tc, tc)) == NULL) {
694 printk(KERN_WARNING "VPE: TC %d is already in use.\n",
695 t->index);
696 return -ENOEXEC;
697 }
698 } else {
699 printk(KERN_WARNING "VPE: No TC's associated with VPE %d\n",
700 v->minor);
701 return -ENOEXEC;
702 }
703
704 settc(t->index); 728 settc(t->index);
705 729
706 val = read_vpe_c0_vpeconf0();
707
708 /* should check it is halted, and not activated */ 730 /* should check it is halted, and not activated */
709 if ((read_tc_c0_tcstatus() & TCSTATUS_A) || !(read_tc_c0_tchalt() & TCHALT_H)) { 731 if ((read_tc_c0_tcstatus() & TCSTATUS_A) || !(read_tc_c0_tchalt() & TCHALT_H)) {
710 printk(KERN_WARNING "VPE: TC %d is already doing something!\n", 732 printk(KERN_WARNING "VPE loader: TC %d is already doing something!\n",
711 t->index); 733 t->index);
712
713 dump_tclist(); 734 dump_tclist();
714 return -ENOEXEC; 735 return -ENOEXEC;
715 } 736 }
716 737
738 /*
739 * Disable multi-threaded execution whilst we activate, clear the
740 * halt bit and bound the tc to the other VPE...
741 */
742 dmt_flag = dmt();
743
717 /* Write the address we want it to start running from in the TCPC register. */ 744 /* Write the address we want it to start running from in the TCPC register. */
718 write_tc_c0_tcrestart((unsigned long)v->__start); 745 write_tc_c0_tcrestart((unsigned long)v->__start);
719
720 /* write the sivc_info address to tccontext */
721 write_tc_c0_tccontext((unsigned long)0); 746 write_tc_c0_tccontext((unsigned long)0);
722 747 /*
723 /* Set up the XTC bit in vpeconf0 to point at our tc */ 748 * Mark the TC as activated, not interrupt exempt and not dynamically
724 write_vpe_c0_vpeconf0(read_vpe_c0_vpeconf0() | (t->index << VPECONF0_XTC_SHIFT)); 749 * allocatable
725 750 */
726 /* mark the TC as activated, not interrupt exempt and not dynamically allocatable */
727 val = read_tc_c0_tcstatus(); 751 val = read_tc_c0_tcstatus();
728 val = (val & ~(TCSTATUS_DA | TCSTATUS_IXMT)) | TCSTATUS_A; 752 val = (val & ~(TCSTATUS_DA | TCSTATUS_IXMT)) | TCSTATUS_A;
729 write_tc_c0_tcstatus(val); 753 write_tc_c0_tcstatus(val);
730 754
731 write_tc_c0_tchalt(read_tc_c0_tchalt() & ~TCHALT_H); 755 write_tc_c0_tchalt(read_tc_c0_tchalt() & ~TCHALT_H);
732 756
733 /* set up VPE1 */
734 write_vpe_c0_vpecontrol(read_vpe_c0_vpecontrol() & ~VPECONTROL_TE); // no multiple TC's
735 write_vpe_c0_vpeconf0(read_vpe_c0_vpeconf0() | VPECONF0_VPA); // enable this VPE
736
737 /* 757 /*
738 * The sde-kit passes 'memsize' to __start in $a3, so set something 758 * The sde-kit passes 'memsize' to __start in $a3, so set something
739 * here... 759 * here... Or set $a3 to zero and define DFLT_STACK_SIZE and
740 * Or set $a3 (register 7) to zero and define DFLT_STACK_SIZE and
741 * DFLT_HEAP_SIZE when you compile your program 760 * DFLT_HEAP_SIZE when you compile your program
742 */ 761 */
762 mttgpr(7, physical_memsize);
763
764
765 /* set up VPE1 */
766 /*
767 * bind the TC to VPE 1 as late as possible so we only have the final
768 * VPE registers to set up, and so an EJTAG probe can trigger on it
769 */
770 write_tc_c0_tcbind((read_tc_c0_tcbind() & ~TCBIND_CURVPE) | v->minor);
743 771
744 mttgpr(7, 0); 772 /* Set up the XTC bit in vpeconf0 to point at our tc */
773 write_vpe_c0_vpeconf0( (read_vpe_c0_vpeconf0() & ~(VPECONF0_XTC))
774 | (t->index << VPECONF0_XTC_SHIFT));
745 775
746 /* set config to be the same as vpe0, particularly kseg0 coherency alg */ 776 /* enable this VPE */
747 write_vpe_c0_config(read_c0_config()); 777 write_vpe_c0_vpeconf0(read_vpe_c0_vpeconf0() | VPECONF0_VPA);
748 778
749 /* clear out any left overs from a previous program */ 779 /* clear out any left overs from a previous program */
780 write_vpe_c0_status(0);
750 write_vpe_c0_cause(0); 781 write_vpe_c0_cause(0);
751 782
752 /* take system out of configuration state */ 783 /* take system out of configuration state */
753 clear_c0_mvpcontrol(MVPCONTROL_VPC); 784 clear_c0_mvpcontrol(MVPCONTROL_VPC);
754 785
755 /* clear interrupts enabled IE, ERL, EXL, and KSU from c0 status */ 786 /* now safe to re-enable multi-threading */
756 write_vpe_c0_status(read_vpe_c0_status() & ~(ST0_ERL | ST0_KSU | ST0_IE | ST0_EXL)); 787 emt(dmt_flag);
757 788
758 /* set it running */ 789 /* set it running */
759 evpe(EVPE_ENABLE); 790 evpe(EVPE_ENABLE);
760 791
792 list_for_each_entry(n, &v->notify, list) {
793 n->start(v->minor);
794 }
795
761 return 0; 796 return 0;
762} 797}
763 798
764static unsigned long find_vpe_symbols(struct vpe * v, Elf_Shdr * sechdrs, 799static int find_vpe_symbols(struct vpe * v, Elf_Shdr * sechdrs,
765 unsigned int symindex, const char *strtab, 800 unsigned int symindex, const char *strtab,
766 struct module *mod) 801 struct module *mod)
767{ 802{
@@ -778,26 +813,28 @@ static unsigned long find_vpe_symbols(struct vpe * v, Elf_Shdr * sechdrs,
778 } 813 }
779 } 814 }
780 815
816 if ( (v->__start == 0) || (v->shared_ptr == NULL))
817 return -1;
818
781 return 0; 819 return 0;
782} 820}
783 821
784/* 822/*
785 * Allocates a VPE with some program code space(the load address), copies 823 * Allocates a VPE with some program code space(the load address), copies the
786 * the contents of the program (p)buffer performing relocatations/etc, 824 * contents of the program (p)buffer performing relocatations/etc, free's it
787 * free's it when finished. 825 * when finished.
788*/ 826 */
789int vpe_elfload(struct vpe * v) 827int vpe_elfload(struct vpe * v)
790{ 828{
791 Elf_Ehdr *hdr; 829 Elf_Ehdr *hdr;
792 Elf_Shdr *sechdrs; 830 Elf_Shdr *sechdrs;
793 long err = 0; 831 long err = 0;
794 char *secstrings, *strtab = NULL; 832 char *secstrings, *strtab = NULL;
795 unsigned int len, i, symindex = 0, strindex = 0; 833 unsigned int len, i, symindex = 0, strindex = 0, relocate = 0;
796
797 struct module mod; // so we can re-use the relocations code 834 struct module mod; // so we can re-use the relocations code
798 835
799 memset(&mod, 0, sizeof(struct module)); 836 memset(&mod, 0, sizeof(struct module));
800 strcpy(mod.name, "VPE dummy prog module"); 837 strcpy(mod.name, "VPE loader");
801 838
802 hdr = (Elf_Ehdr *) v->pbuffer; 839 hdr = (Elf_Ehdr *) v->pbuffer;
803 len = v->plen; 840 len = v->plen;
@@ -805,16 +842,22 @@ int vpe_elfload(struct vpe * v)
805 /* Sanity checks against insmoding binaries or wrong arch, 842 /* Sanity checks against insmoding binaries or wrong arch,
806 weird elf version */ 843 weird elf version */
807 if (memcmp(hdr->e_ident, ELFMAG, 4) != 0 844 if (memcmp(hdr->e_ident, ELFMAG, 4) != 0
808 || hdr->e_type != ET_REL || !elf_check_arch(hdr) 845 || (hdr->e_type != ET_REL && hdr->e_type != ET_EXEC)
846 || !elf_check_arch(hdr)
809 || hdr->e_shentsize != sizeof(*sechdrs)) { 847 || hdr->e_shentsize != sizeof(*sechdrs)) {
810 printk(KERN_WARNING 848 printk(KERN_WARNING
811 "VPE program, wrong arch or weird elf version\n"); 849 "VPE loader: program wrong arch or weird elf version\n");
812 850
813 return -ENOEXEC; 851 return -ENOEXEC;
814 } 852 }
815 853
854 if (hdr->e_type == ET_REL)
855 relocate = 1;
856
816 if (len < hdr->e_shoff + hdr->e_shnum * sizeof(Elf_Shdr)) { 857 if (len < hdr->e_shoff + hdr->e_shnum * sizeof(Elf_Shdr)) {
817 printk(KERN_ERR "VPE program length %u truncated\n", len); 858 printk(KERN_ERR "VPE loader: program length %u truncated\n",
859 len);
860
818 return -ENOEXEC; 861 return -ENOEXEC;
819 } 862 }
820 863
@@ -826,82 +869,126 @@ int vpe_elfload(struct vpe * v)
826 /* And these should exist, but gcc whinges if we don't init them */ 869 /* And these should exist, but gcc whinges if we don't init them */
827 symindex = strindex = 0; 870 symindex = strindex = 0;
828 871
829 for (i = 1; i < hdr->e_shnum; i++) { 872 if (relocate) {
830 873 for (i = 1; i < hdr->e_shnum; i++) {
831 if (sechdrs[i].sh_type != SHT_NOBITS 874 if (sechdrs[i].sh_type != SHT_NOBITS
832 && len < sechdrs[i].sh_offset + sechdrs[i].sh_size) { 875 && len < sechdrs[i].sh_offset + sechdrs[i].sh_size) {
833 printk(KERN_ERR "VPE program length %u truncated\n", 876 printk(KERN_ERR "VPE program length %u truncated\n",
834 len); 877 len);
835 return -ENOEXEC; 878 return -ENOEXEC;
836 } 879 }
837 880
838 /* Mark all sections sh_addr with their address in the 881 /* Mark all sections sh_addr with their address in the
839 temporary image. */ 882 temporary image. */
840 sechdrs[i].sh_addr = (size_t) hdr + sechdrs[i].sh_offset; 883 sechdrs[i].sh_addr = (size_t) hdr + sechdrs[i].sh_offset;
841 884
842 /* Internal symbols and strings. */ 885 /* Internal symbols and strings. */
843 if (sechdrs[i].sh_type == SHT_SYMTAB) { 886 if (sechdrs[i].sh_type == SHT_SYMTAB) {
844 symindex = i; 887 symindex = i;
845 strindex = sechdrs[i].sh_link; 888 strindex = sechdrs[i].sh_link;
846 strtab = (char *)hdr + sechdrs[strindex].sh_offset; 889 strtab = (char *)hdr + sechdrs[strindex].sh_offset;
890 }
847 } 891 }
892 layout_sections(&mod, hdr, sechdrs, secstrings);
848 } 893 }
849 894
850 layout_sections(&mod, hdr, sechdrs, secstrings);
851
852 v->load_addr = alloc_progmem(mod.core_size); 895 v->load_addr = alloc_progmem(mod.core_size);
853 memset(v->load_addr, 0, mod.core_size); 896 memset(v->load_addr, 0, mod.core_size);
854 897
855 printk("VPE elf_loader: loading to %p\n", v->load_addr); 898 printk("VPE loader: loading to %p\n", v->load_addr);
856 899
857 for (i = 0; i < hdr->e_shnum; i++) { 900 if (relocate) {
858 void *dest; 901 for (i = 0; i < hdr->e_shnum; i++) {
902 void *dest;
859 903
860 if (!(sechdrs[i].sh_flags & SHF_ALLOC)) 904 if (!(sechdrs[i].sh_flags & SHF_ALLOC))
861 continue; 905 continue;
862 906
863 dest = v->load_addr + sechdrs[i].sh_entsize; 907 dest = v->load_addr + sechdrs[i].sh_entsize;
864 908
865 if (sechdrs[i].sh_type != SHT_NOBITS) 909 if (sechdrs[i].sh_type != SHT_NOBITS)
866 memcpy(dest, (void *)sechdrs[i].sh_addr, 910 memcpy(dest, (void *)sechdrs[i].sh_addr,
867 sechdrs[i].sh_size); 911 sechdrs[i].sh_size);
868 /* Update sh_addr to point to copy in image. */ 912 /* Update sh_addr to point to copy in image. */
869 sechdrs[i].sh_addr = (unsigned long)dest; 913 sechdrs[i].sh_addr = (unsigned long)dest;
870 }
871 914
872 /* Fix up syms, so that st_value is a pointer to location. */ 915 printk(KERN_DEBUG " section sh_name %s sh_addr 0x%x\n",
873 err = 916 secstrings + sechdrs[i].sh_name, sechdrs[i].sh_addr);
874 simplify_symbols(sechdrs, symindex, strtab, secstrings, 917 }
875 hdr->e_shnum, &mod);
876 if (err < 0) {
877 printk(KERN_WARNING "VPE: unable to simplify symbols\n");
878 goto cleanup;
879 }
880 918
881 /* Now do relocations. */ 919 /* Fix up syms, so that st_value is a pointer to location. */
882 for (i = 1; i < hdr->e_shnum; i++) { 920 simplify_symbols(sechdrs, symindex, strtab, secstrings,
883 const char *strtab = (char *)sechdrs[strindex].sh_addr; 921 hdr->e_shnum, &mod);
884 unsigned int info = sechdrs[i].sh_info; 922
885 923 /* Now do relocations. */
886 /* Not a valid relocation section? */ 924 for (i = 1; i < hdr->e_shnum; i++) {
887 if (info >= hdr->e_shnum) 925 const char *strtab = (char *)sechdrs[strindex].sh_addr;
888 continue; 926 unsigned int info = sechdrs[i].sh_info;
889 927
890 /* Don't bother with non-allocated sections */ 928 /* Not a valid relocation section? */
891 if (!(sechdrs[info].sh_flags & SHF_ALLOC)) 929 if (info >= hdr->e_shnum)
892 continue; 930 continue;
893 931
894 if (sechdrs[i].sh_type == SHT_REL) 932 /* Don't bother with non-allocated sections */
895 err = 933 if (!(sechdrs[info].sh_flags & SHF_ALLOC))
896 apply_relocations(sechdrs, strtab, symindex, i, &mod); 934 continue;
897 else if (sechdrs[i].sh_type == SHT_RELA) 935
898 err = apply_relocate_add(sechdrs, strtab, symindex, i, 936 if (sechdrs[i].sh_type == SHT_REL)
899 &mod); 937 err = apply_relocations(sechdrs, strtab, symindex, i,
900 if (err < 0) { 938 &mod);
901 printk(KERN_WARNING 939 else if (sechdrs[i].sh_type == SHT_RELA)
902 "vpe_elfload: error in relocations err %ld\n", 940 err = apply_relocate_add(sechdrs, strtab, symindex, i,
903 err); 941 &mod);
904 goto cleanup; 942 if (err < 0)
943 return err;
944
945 }
946 } else {
947 for (i = 0; i < hdr->e_shnum; i++) {
948
949 /* Internal symbols and strings. */
950 if (sechdrs[i].sh_type == SHT_SYMTAB) {
951 symindex = i;
952 strindex = sechdrs[i].sh_link;
953 strtab = (char *)hdr + sechdrs[strindex].sh_offset;
954
955 /* mark the symtab's address for when we try to find the
956 magic symbols */
957 sechdrs[i].sh_addr = (size_t) hdr + sechdrs[i].sh_offset;
958 }
959
960 /* filter sections we dont want in the final image */
961 if (!(sechdrs[i].sh_flags & SHF_ALLOC) ||
962 (sechdrs[i].sh_type == SHT_MIPS_REGINFO)) {
963 printk( KERN_DEBUG " ignoring section, "
964 "name %s type %x address 0x%x \n",
965 secstrings + sechdrs[i].sh_name,
966 sechdrs[i].sh_type, sechdrs[i].sh_addr);
967 continue;
968 }
969
970 if (sechdrs[i].sh_addr < (unsigned int)v->load_addr) {
971 printk( KERN_WARNING "VPE loader: "
972 "fully linked image has invalid section, "
973 "name %s type %x address 0x%x, before load "
974 "address of 0x%x\n",
975 secstrings + sechdrs[i].sh_name,
976 sechdrs[i].sh_type, sechdrs[i].sh_addr,
977 (unsigned int)v->load_addr);
978 return -ENOEXEC;
979 }
980
981 printk(KERN_DEBUG " copying section sh_name %s, sh_addr 0x%x "
982 "size 0x%x0 from x%p\n",
983 secstrings + sechdrs[i].sh_name, sechdrs[i].sh_addr,
984 sechdrs[i].sh_size, hdr + sechdrs[i].sh_offset);
985
986 if (sechdrs[i].sh_type != SHT_NOBITS)
987 memcpy((void *)sechdrs[i].sh_addr,
988 (char *)hdr + sechdrs[i].sh_offset,
989 sechdrs[i].sh_size);
990 else
991 memset((void *)sechdrs[i].sh_addr, 0, sechdrs[i].sh_size);
905 } 992 }
906 } 993 }
907 994
@@ -910,71 +997,104 @@ int vpe_elfload(struct vpe * v)
910 (unsigned long)v->load_addr + v->len); 997 (unsigned long)v->load_addr + v->len);
911 998
912 if ((find_vpe_symbols(v, sechdrs, symindex, strtab, &mod)) < 0) { 999 if ((find_vpe_symbols(v, sechdrs, symindex, strtab, &mod)) < 0) {
1000 if (v->__start == 0) {
1001 printk(KERN_WARNING "VPE loader: program does not contain "
1002 "a __start symbol\n");
1003 return -ENOEXEC;
1004 }
913 1005
914 printk(KERN_WARNING 1006 if (v->shared_ptr == NULL)
915 "VPE: program doesn't contain __start or vpe_shared symbols\n"); 1007 printk(KERN_WARNING "VPE loader: "
916 err = -ENOEXEC; 1008 "program does not contain vpe_shared symbol.\n"
1009 " Unable to use AMVP (AP/SP) facilities.\n");
917 } 1010 }
918 1011
919 printk(" elf loaded\n"); 1012 printk(" elf loaded\n");
920 1013 return 0;
921cleanup:
922 return err;
923} 1014}
924 1015
925static void dump_vpe(struct vpe * v) 1016__attribute_used__ void dump_vpe(struct vpe * v)
926{ 1017{
927 struct tc *t; 1018 struct tc *t;
928 1019
1020 settc(v->minor);
1021
929 printk(KERN_DEBUG "VPEControl 0x%lx\n", read_vpe_c0_vpecontrol()); 1022 printk(KERN_DEBUG "VPEControl 0x%lx\n", read_vpe_c0_vpecontrol());
930 printk(KERN_DEBUG "VPEConf0 0x%lx\n", read_vpe_c0_vpeconf0()); 1023 printk(KERN_DEBUG "VPEConf0 0x%lx\n", read_vpe_c0_vpeconf0());
931 1024
932 list_for_each_entry(t, &vpecontrol.tc_list, list) { 1025 list_for_each_entry(t, &vpecontrol.tc_list, list)
933 dump_tc(t); 1026 dump_tc(t);
934 }
935} 1027}
936 1028
937/* checks for VPE is unused and gets ready to load program */ 1029static void cleanup_tc(struct tc *tc)
1030{
1031 int tmp;
1032
1033 /* Put MVPE's into 'configuration state' */
1034 set_c0_mvpcontrol(MVPCONTROL_VPC);
1035
1036 settc(tc->index);
1037 tmp = read_tc_c0_tcstatus();
1038
1039 /* mark not allocated and not dynamically allocatable */
1040 tmp &= ~(TCSTATUS_A | TCSTATUS_DA);
1041 tmp |= TCSTATUS_IXMT; /* interrupt exempt */
1042 write_tc_c0_tcstatus(tmp);
1043
1044 write_tc_c0_tchalt(TCHALT_H);
1045
1046 /* bind it to anything other than VPE1 */
1047 write_tc_c0_tcbind(read_tc_c0_tcbind() & ~TCBIND_CURVPE); // | TCBIND_CURVPE
1048
1049 clear_c0_mvpcontrol(MVPCONTROL_VPC);
1050}
1051
1052static int getcwd(char *buff, int size)
1053{
1054 mm_segment_t old_fs;
1055 int ret;
1056
1057 old_fs = get_fs();
1058 set_fs(KERNEL_DS);
1059
1060 ret = sys_getcwd(buff,size);
1061
1062 set_fs(old_fs);
1063
1064 return ret;
1065}
1066
1067/* checks VPE is unused and gets ready to load program */
938static int vpe_open(struct inode *inode, struct file *filp) 1068static int vpe_open(struct inode *inode, struct file *filp)
939{ 1069{
940 int minor; 1070 int minor, ret;
941 struct vpe *v; 1071 struct vpe *v;
1072 struct vpe_notifications *not;
942 1073
943 /* assume only 1 device at the mo. */ 1074 /* assume only 1 device at the mo. */
944 if ((minor = MINOR(inode->i_rdev)) != 1) { 1075 if ((minor = iminor(inode)) != 1) {
945 printk(KERN_WARNING "VPE: only vpe1 is supported\n"); 1076 printk(KERN_WARNING "VPE loader: only vpe1 is supported\n");
946 return -ENODEV; 1077 return -ENODEV;
947 } 1078 }
948 1079
949 if ((v = get_vpe(minor)) == NULL) { 1080 if ((v = get_vpe(minor)) == NULL) {
950 printk(KERN_WARNING "VPE: unable to get vpe\n"); 1081 printk(KERN_WARNING "VPE loader: unable to get vpe\n");
951 return -ENODEV; 1082 return -ENODEV;
952 } 1083 }
953 1084
954 if (v->state != VPE_STATE_UNUSED) { 1085 if (v->state != VPE_STATE_UNUSED) {
955 unsigned long tmp;
956 struct tc *t;
957
958 printk(KERN_WARNING "VPE: device %d already in use\n", minor);
959
960 dvpe(); 1086 dvpe();
961 dump_vpe(v);
962
963 printk(KERN_WARNING "VPE: re-initialising %d\n", minor);
964
965 release_progmem(v->load_addr);
966 1087
967 t = get_tc(minor); 1088 printk(KERN_DEBUG "VPE loader: tc in use dumping regs\n");
968 settc(minor);
969 tmp = read_tc_c0_tcstatus();
970 1089
971 /* mark not allocated and not dynamically allocatable */ 1090 dump_tc(get_tc(minor));
972 tmp &= ~(TCSTATUS_A | TCSTATUS_DA);
973 tmp |= TCSTATUS_IXMT; /* interrupt exempt */
974 write_tc_c0_tcstatus(tmp);
975 1091
976 write_tc_c0_tchalt(TCHALT_H); 1092 list_for_each_entry(not, &v->notify, list) {
1093 not->stop(minor);
1094 }
977 1095
1096 release_progmem(v->load_addr);
1097 cleanup_tc(get_tc(minor));
978 } 1098 }
979 1099
980 // allocate it so when we get write ops we know it's expected. 1100 // allocate it so when we get write ops we know it's expected.
@@ -986,6 +1106,24 @@ static int vpe_open(struct inode *inode, struct file *filp)
986 v->load_addr = NULL; 1106 v->load_addr = NULL;
987 v->len = 0; 1107 v->len = 0;
988 1108
1109 v->uid = filp->f_uid;
1110 v->gid = filp->f_gid;
1111
1112#ifdef CONFIG_MIPS_APSP_KSPD
1113 /* get kspd to tell us when a syscall_exit happens */
1114 if (!kspd_events_reqd) {
1115 kspd_notify(&kspd_events);
1116 kspd_events_reqd++;
1117 }
1118#endif
1119
1120 v->cwd[0] = 0;
1121 ret = getcwd(v->cwd, VPE_PATH_MAX);
1122 if (ret < 0)
1123 printk(KERN_WARNING "VPE loader: open, getcwd returned %d\n", ret);
1124
1125 v->shared_ptr = NULL;
1126 v->__start = 0;
989 return 0; 1127 return 0;
990} 1128}
991 1129
@@ -995,7 +1133,7 @@ static int vpe_release(struct inode *inode, struct file *filp)
995 struct vpe *v; 1133 struct vpe *v;
996 Elf_Ehdr *hdr; 1134 Elf_Ehdr *hdr;
997 1135
998 minor = MINOR(inode->i_rdev); 1136 minor = iminor(inode);
999 if ((v = get_vpe(minor)) == NULL) 1137 if ((v = get_vpe(minor)) == NULL)
1000 return -ENODEV; 1138 return -ENODEV;
1001 1139
@@ -1006,14 +1144,22 @@ static int vpe_release(struct inode *inode, struct file *filp)
1006 if (vpe_elfload(v) >= 0) 1144 if (vpe_elfload(v) >= 0)
1007 vpe_run(v); 1145 vpe_run(v);
1008 else { 1146 else {
1009 printk(KERN_WARNING "VPE: ELF load failed.\n"); 1147 printk(KERN_WARNING "VPE loader: ELF load failed.\n");
1010 ret = -ENOEXEC; 1148 ret = -ENOEXEC;
1011 } 1149 }
1012 } else { 1150 } else {
1013 printk(KERN_WARNING "VPE: only elf files are supported\n"); 1151 printk(KERN_WARNING "VPE loader: only elf files are supported\n");
1014 ret = -ENOEXEC; 1152 ret = -ENOEXEC;
1015 } 1153 }
1016 1154
1155 /* It's good to be able to run the SP and if it chokes have a look at
1156 the /dev/rt?. But if we reset the pointer to the shared struct we
1157 loose what has happened. So perhaps if garbage is sent to the vpe
1158 device, use it as a trigger for the reset. Hopefully a nice
1159 executable will be along shortly. */
1160 if (ret < 0)
1161 v->shared_ptr = NULL;
1162
1017 // cleanup any temp buffers 1163 // cleanup any temp buffers
1018 if (v->pbuffer) 1164 if (v->pbuffer)
1019 vfree(v->pbuffer); 1165 vfree(v->pbuffer);
@@ -1028,26 +1174,24 @@ static ssize_t vpe_write(struct file *file, const char __user * buffer,
1028 size_t ret = count; 1174 size_t ret = count;
1029 struct vpe *v; 1175 struct vpe *v;
1030 1176
1031 minor = MINOR(file->f_dentry->d_inode->i_rdev); 1177 minor = iminor(file->f_dentry->d_inode);
1032 if ((v = get_vpe(minor)) == NULL) 1178 if ((v = get_vpe(minor)) == NULL)
1033 return -ENODEV; 1179 return -ENODEV;
1034 1180
1035 if (v->pbuffer == NULL) { 1181 if (v->pbuffer == NULL) {
1036 printk(KERN_ERR "vpe_write: no pbuffer\n"); 1182 printk(KERN_ERR "VPE loader: no buffer for program\n");
1037 return -ENOMEM; 1183 return -ENOMEM;
1038 } 1184 }
1039 1185
1040 if ((count + v->len) > v->plen) { 1186 if ((count + v->len) > v->plen) {
1041 printk(KERN_WARNING 1187 printk(KERN_WARNING
1042 "VPE Loader: elf size too big. Perhaps strip uneeded symbols\n"); 1188 "VPE loader: elf size too big. Perhaps strip uneeded symbols\n");
1043 return -ENOMEM; 1189 return -ENOMEM;
1044 } 1190 }
1045 1191
1046 count -= copy_from_user(v->pbuffer + v->len, buffer, count); 1192 count -= copy_from_user(v->pbuffer + v->len, buffer, count);
1047 if (!count) { 1193 if (!count)
1048 printk("vpe_write: copy_to_user failed\n");
1049 return -EFAULT; 1194 return -EFAULT;
1050 }
1051 1195
1052 v->len += count; 1196 v->len += count;
1053 return ret; 1197 return ret;
@@ -1149,16 +1293,70 @@ void *vpe_get_shared(int index)
1149{ 1293{
1150 struct vpe *v; 1294 struct vpe *v;
1151 1295
1152 if ((v = get_vpe(index)) == NULL) { 1296 if ((v = get_vpe(index)) == NULL)
1153 printk(KERN_WARNING "vpe: invalid vpe index %d\n", index);
1154 return NULL; 1297 return NULL;
1155 }
1156 1298
1157 return v->shared_ptr; 1299 return v->shared_ptr;
1158} 1300}
1159 1301
1160EXPORT_SYMBOL(vpe_get_shared); 1302EXPORT_SYMBOL(vpe_get_shared);
1161 1303
1304int vpe_getuid(int index)
1305{
1306 struct vpe *v;
1307
1308 if ((v = get_vpe(index)) == NULL)
1309 return -1;
1310
1311 return v->uid;
1312}
1313
1314EXPORT_SYMBOL(vpe_getuid);
1315
1316int vpe_getgid(int index)
1317{
1318 struct vpe *v;
1319
1320 if ((v = get_vpe(index)) == NULL)
1321 return -1;
1322
1323 return v->gid;
1324}
1325
1326EXPORT_SYMBOL(vpe_getgid);
1327
1328int vpe_notify(int index, struct vpe_notifications *notify)
1329{
1330 struct vpe *v;
1331
1332 if ((v = get_vpe(index)) == NULL)
1333 return -1;
1334
1335 list_add(&notify->list, &v->notify);
1336 return 0;
1337}
1338
1339EXPORT_SYMBOL(vpe_notify);
1340
1341char *vpe_getcwd(int index)
1342{
1343 struct vpe *v;
1344
1345 if ((v = get_vpe(index)) == NULL)
1346 return NULL;
1347
1348 return v->cwd;
1349}
1350
1351EXPORT_SYMBOL(vpe_getcwd);
1352
1353#ifdef CONFIG_MIPS_APSP_KSPD
1354static void kspd_sp_exit( int sp_id)
1355{
1356 cleanup_tc(get_tc(sp_id));
1357}
1358#endif
1359
1162static int __init vpe_module_init(void) 1360static int __init vpe_module_init(void)
1163{ 1361{
1164 struct vpe *v = NULL; 1362 struct vpe *v = NULL;
@@ -1201,7 +1399,8 @@ static int __init vpe_module_init(void)
1201 return -ENODEV; 1399 return -ENODEV;
1202 } 1400 }
1203 1401
1204 list_add(&t->tc, &v->tc); /* add the tc to the list of this vpe's tc's. */ 1402 /* add the tc to the list of this vpe's tc's. */
1403 list_add(&t->tc, &v->tc);
1205 1404
1206 /* deactivate all but vpe0 */ 1405 /* deactivate all but vpe0 */
1207 if (i != 0) { 1406 if (i != 0) {
@@ -1222,10 +1421,12 @@ static int __init vpe_module_init(void)
1222 ~(ST0_IM | ST0_IE | ST0_KSU)) 1421 ~(ST0_IM | ST0_IE | ST0_KSU))
1223 | ST0_CU0); 1422 | ST0_CU0);
1224 1423
1225 /* set config to be the same as vpe0, particularly kseg0 coherency alg */ 1424 /*
1425 * Set config to be the same as vpe0,
1426 * particularly kseg0 coherency alg
1427 */
1226 write_vpe_c0_config(read_c0_config()); 1428 write_vpe_c0_config(read_c0_config());
1227 } 1429 }
1228
1229 } 1430 }
1230 1431
1231 /* TC's */ 1432 /* TC's */
@@ -1234,23 +1435,28 @@ static int __init vpe_module_init(void)
1234 if (i != 0) { 1435 if (i != 0) {
1235 unsigned long tmp; 1436 unsigned long tmp;
1236 1437
1237 /* tc 0 will of course be running.... */
1238 if (i == 0)
1239 t->state = TC_STATE_RUNNING;
1240
1241 settc(i); 1438 settc(i);
1242 1439
1243 /* bind a TC to each VPE, May as well put all excess TC's 1440 /* Any TC that is bound to VPE0 gets left as is - in case
1244 on the last VPE */ 1441 we are running SMTC on VPE0. A TC that is bound to any
1245 if (i >= (((val & MVPCONF0_PVPE) >> MVPCONF0_PVPE_SHIFT) + 1)) 1442 other VPE gets bound to VPE0, ideally I'd like to make
1246 write_tc_c0_tcbind(read_tc_c0_tcbind() | 1443 it homeless but it doesn't appear to let me bind a TC
1247 ((val & MVPCONF0_PVPE) >> MVPCONF0_PVPE_SHIFT)); 1444 to a non-existent VPE. Which is perfectly reasonable.
1248 else 1445
1249 write_tc_c0_tcbind(read_tc_c0_tcbind() | i); 1446 The (un)bound state is visible to an EJTAG probe so may
1447 notify GDB...
1448 */
1449
1450 if (((tmp = read_tc_c0_tcbind()) & TCBIND_CURVPE)) {
1451 /* tc is bound >vpe0 */
1452 write_tc_c0_tcbind(tmp & ~TCBIND_CURVPE);
1453
1454 t->pvpe = get_vpe(0); /* set the parent vpe */
1455 }
1250 1456
1251 tmp = read_tc_c0_tcstatus(); 1457 tmp = read_tc_c0_tcstatus();
1252 1458
1253 /* mark not allocated and not dynamically allocatable */ 1459 /* mark not activated and not dynamically allocatable */
1254 tmp &= ~(TCSTATUS_A | TCSTATUS_DA); 1460 tmp &= ~(TCSTATUS_A | TCSTATUS_DA);
1255 tmp |= TCSTATUS_IXMT; /* interrupt exempt */ 1461 tmp |= TCSTATUS_IXMT; /* interrupt exempt */
1256 write_tc_c0_tcstatus(tmp); 1462 write_tc_c0_tcstatus(tmp);
@@ -1262,6 +1468,9 @@ static int __init vpe_module_init(void)
1262 /* release config state */ 1468 /* release config state */
1263 clear_c0_mvpcontrol(MVPCONTROL_VPC); 1469 clear_c0_mvpcontrol(MVPCONTROL_VPC);
1264 1470
1471#ifdef CONFIG_MIPS_APSP_KSPD
1472 kspd_events.kspd_sp_exit = kspd_sp_exit;
1473#endif
1265 return 0; 1474 return 0;
1266} 1475}
1267 1476
@@ -1281,5 +1490,5 @@ static void __exit vpe_module_exit(void)
1281module_init(vpe_module_init); 1490module_init(vpe_module_init);
1282module_exit(vpe_module_exit); 1491module_exit(vpe_module_exit);
1283MODULE_DESCRIPTION("MIPS VPE Loader"); 1492MODULE_DESCRIPTION("MIPS VPE Loader");
1284MODULE_AUTHOR("Elizabeth Clarke, MIPS Technologies, Inc"); 1493MODULE_AUTHOR("Elizabeth Oldham, MIPS Technologies, Inc.");
1285MODULE_LICENSE("GPL"); 1494MODULE_LICENSE("GPL");
diff --git a/arch/mips/lasat/Makefile b/arch/mips/lasat/Makefile
index 0d5aec436725..99f5046fdf49 100644
--- a/arch/mips/lasat/Makefile
+++ b/arch/mips/lasat/Makefile
@@ -3,7 +3,7 @@
3# 3#
4 4
5obj-y += reset.o setup.o prom.o lasat_board.o \ 5obj-y += reset.o setup.o prom.o lasat_board.o \
6 at93c.o interrupt.o lasatIRQ.o 6 at93c.o interrupt.o
7 7
8obj-$(CONFIG_LASAT_SYSCTL) += sysctl.o 8obj-$(CONFIG_LASAT_SYSCTL) += sysctl.o
9obj-$(CONFIG_DS1603) += ds1603.o 9obj-$(CONFIG_DS1603) += ds1603.o
diff --git a/arch/mips/lasat/interrupt.c b/arch/mips/lasat/interrupt.c
index 852a41901a5e..2d3472b21ebb 100644
--- a/arch/mips/lasat/interrupt.c
+++ b/arch/mips/lasat/interrupt.c
@@ -27,14 +27,13 @@
27#include <asm/bootinfo.h> 27#include <asm/bootinfo.h>
28#include <asm/irq.h> 28#include <asm/irq.h>
29#include <asm/lasat/lasatint.h> 29#include <asm/lasat/lasatint.h>
30#include <asm/time.h>
30#include <asm/gdb-stub.h> 31#include <asm/gdb-stub.h>
31 32
32static volatile int *lasat_int_status = NULL; 33static volatile int *lasat_int_status = NULL;
33static volatile int *lasat_int_mask = NULL; 34static volatile int *lasat_int_mask = NULL;
34static volatile int lasat_int_mask_shift; 35static volatile int lasat_int_mask_shift;
35 36
36extern asmlinkage void lasatIRQ(void);
37
38void disable_lasat_irq(unsigned int irq_nr) 37void disable_lasat_irq(unsigned int irq_nr)
39{ 38{
40 unsigned long flags; 39 unsigned long flags;
@@ -109,11 +108,17 @@ static unsigned long get_int_status_200(void)
109 return int_status; 108 return int_status;
110} 109}
111 110
112void lasat_hw0_irqdispatch(struct pt_regs *regs) 111asmlinkage void plat_irq_dispatch(struct pt_regs *regs)
113{ 112{
114 unsigned long int_status; 113 unsigned long int_status;
114 unsigned int cause = read_c0_cause();
115 int irq; 115 int irq;
116 116
117 if (cause & CAUSEF_IP7) { /* R4000 count / compare IRQ */
118 ll_timer_interrupt(7, regs);
119 return;
120 }
121
117 int_status = get_int_status(); 122 int_status = get_int_status();
118 123
119 /* if int_status == 0, then the interrupt has already been cleared */ 124 /* if int_status == 0, then the interrupt has already been cleared */
@@ -147,9 +152,6 @@ void __init arch_init_irq(void)
147 panic("arch_init_irq: mips_machtype incorrect"); 152 panic("arch_init_irq: mips_machtype incorrect");
148 } 153 }
149 154
150 /* Now safe to set the exception vector. */
151 set_except_vector(0, lasatIRQ);
152
153 for (i = 0; i <= LASATINT_END; i++) { 155 for (i = 0; i <= LASATINT_END; i++) {
154 irq_desc[i].status = IRQ_DISABLED; 156 irq_desc[i].status = IRQ_DISABLED;
155 irq_desc[i].action = 0; 157 irq_desc[i].action = 0;
diff --git a/arch/mips/lasat/lasatIRQ.S b/arch/mips/lasat/lasatIRQ.S
deleted file mode 100644
index 2a2b0d056561..000000000000
--- a/arch/mips/lasat/lasatIRQ.S
+++ /dev/null
@@ -1,69 +0,0 @@
1/*
2 * Carsten Langgaard, carstenl@mips.com
3 * Copyright (C) 1999, 2000 MIPS Technologies, Inc. All rights reserved.
4 *
5 * This program is free software; you can distribute it and/or modify it
6 * under the terms of the GNU General Public License (Version 2) as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
17 *
18 * Interrupt exception dispatch code.
19 */
20#include <asm/asm.h>
21#include <asm/mipsregs.h>
22#include <asm/regdef.h>
23#include <asm/stackframe.h>
24
25 .text
26 .set noreorder
27 .align 5
28 NESTED(lasatIRQ, PT_SIZE, sp)
29 .set noat
30 SAVE_ALL
31 CLI
32 .set at
33 .set noreorder
34
35 mfc0 s0, CP0_CAUSE # get irq mask
36
37 /* First we check for r4k counter/timer IRQ. */
38 andi a0, s0, CAUSEF_IP7
39 beq a0, zero, 1f
40 andi a0, s0, CAUSEF_IP2 # delay slot, check hw0 interrupt
41
42 /* Wheee, a timer interrupt. */
43 li a0, 7
44 jal ll_timer_interrupt
45 move a1, sp
46
47 j ret_from_irq
48 nop
49
501:
51 /* Wheee, combined hardware level zero interrupt. */
52 jal lasat_hw0_irqdispatch
53 move a0, sp # delay slot
54
55 j ret_from_irq
56 nop # delay slot
57
581:
59 /*
60 * Here by mistake? This is possible, what can happen is that by the
61 * time we take the exception the IRQ pin goes low, so just leave if
62 * this is the case.
63 */
64 move a1,s0
65 mfc0 a1, CP0_EPC
66
67 j ret_from_irq
68 nop
69 END(lasatIRQ)
diff --git a/arch/mips/math-emu/dp_fint.c b/arch/mips/math-emu/dp_fint.c
index a1962eb460f8..39a71de16f47 100644
--- a/arch/mips/math-emu/dp_fint.c
+++ b/arch/mips/math-emu/dp_fint.c
@@ -29,7 +29,9 @@
29 29
30ieee754dp ieee754dp_fint(int x) 30ieee754dp ieee754dp_fint(int x)
31{ 31{
32 COMPXDP; 32 u64 xm;
33 int xe;
34 int xs;
33 35
34 CLEARCX; 36 CLEARCX;
35 37
diff --git a/arch/mips/math-emu/dp_flong.c b/arch/mips/math-emu/dp_flong.c
index eae90a866aa1..f08f223e488a 100644
--- a/arch/mips/math-emu/dp_flong.c
+++ b/arch/mips/math-emu/dp_flong.c
@@ -29,7 +29,9 @@
29 29
30ieee754dp ieee754dp_flong(s64 x) 30ieee754dp ieee754dp_flong(s64 x)
31{ 31{
32 COMPXDP; 32 u64 xm;
33 int xe;
34 int xs;
33 35
34 CLEARCX; 36 CLEARCX;
35 37
diff --git a/arch/mips/math-emu/sp_fint.c b/arch/mips/math-emu/sp_fint.c
index 7aac13afb09a..e88e125e01c2 100644
--- a/arch/mips/math-emu/sp_fint.c
+++ b/arch/mips/math-emu/sp_fint.c
@@ -29,7 +29,9 @@
29 29
30ieee754sp ieee754sp_fint(int x) 30ieee754sp ieee754sp_fint(int x)
31{ 31{
32 COMPXSP; 32 unsigned xm;
33 int xe;
34 int xs;
33 35
34 CLEARCX; 36 CLEARCX;
35 37
diff --git a/arch/mips/math-emu/sp_flong.c b/arch/mips/math-emu/sp_flong.c
index 3d6c1d11c178..26d6919a269a 100644
--- a/arch/mips/math-emu/sp_flong.c
+++ b/arch/mips/math-emu/sp_flong.c
@@ -29,7 +29,9 @@
29 29
30ieee754sp ieee754sp_flong(s64 x) 30ieee754sp ieee754sp_flong(s64 x)
31{ 31{
32 COMPXDP; /* <--- need 64-bit mantissa temp */ 32 u64 xm; /* <--- need 64-bit mantissa temp */
33 int xe;
34 int xs;
33 35
34 CLEARCX; 36 CLEARCX;
35 37
diff --git a/arch/mips/mips-boards/atlas/atlas_int.c b/arch/mips/mips-boards/atlas/atlas_int.c
index bc0ebc69bfb3..db53950b7cfb 100644
--- a/arch/mips/mips-boards/atlas/atlas_int.c
+++ b/arch/mips/mips-boards/atlas/atlas_int.c
@@ -39,8 +39,6 @@
39 39
40static struct atlas_ictrl_regs *atlas_hw0_icregs; 40static struct atlas_ictrl_regs *atlas_hw0_icregs;
41 41
42extern asmlinkage void mipsIRQ(void);
43
44#if 0 42#if 0
45#define DEBUG_INT(x...) printk(x) 43#define DEBUG_INT(x...) printk(x)
46#else 44#else
@@ -98,7 +96,7 @@ static inline int ls1bit32(unsigned int x)
98 return b; 96 return b;
99} 97}
100 98
101void atlas_hw0_irqdispatch(struct pt_regs *regs) 99static inline void atlas_hw0_irqdispatch(struct pt_regs *regs)
102{ 100{
103 unsigned long int_status; 101 unsigned long int_status;
104 int irq; 102 int irq;
@@ -116,6 +114,91 @@ void atlas_hw0_irqdispatch(struct pt_regs *regs)
116 do_IRQ(irq, regs); 114 do_IRQ(irq, regs);
117} 115}
118 116
117static inline int clz(unsigned long x)
118{
119 __asm__ (
120 " .set push \n"
121 " .set mips32 \n"
122 " clz %0, %1 \n"
123 " .set pop \n"
124 : "=r" (x)
125 : "r" (x));
126
127 return x;
128}
129
130/*
131 * Version of ffs that only looks at bits 12..15.
132 */
133static inline unsigned int irq_ffs(unsigned int pending)
134{
135#if defined(CONFIG_CPU_MIPS32) || defined(CONFIG_CPU_MIPS64)
136 return -clz(pending) + 31 - CAUSEB_IP;
137#else
138 unsigned int a0 = 7;
139 unsigned int t0;
140
141 t0 = s0 & 0xf000;
142 t0 = t0 < 1;
143 t0 = t0 << 2;
144 a0 = a0 - t0;
145 s0 = s0 << t0;
146
147 t0 = s0 & 0xc000;
148 t0 = t0 < 1;
149 t0 = t0 << 1;
150 a0 = a0 - t0;
151 s0 = s0 << t0;
152
153 t0 = s0 & 0x8000;
154 t0 = t0 < 1;
155 //t0 = t0 << 2;
156 a0 = a0 - t0;
157 //s0 = s0 << t0;
158
159 return a0;
160#endif
161}
162
163/*
164 * IRQs on the Atlas board look basically (barring software IRQs which we
165 * don't use at all and all external interrupt sources are combined together
166 * on hardware interrupt 0 (MIPS IRQ 2)) like:
167 *
168 * MIPS IRQ Source
169 * -------- ------
170 * 0 Software (ignored)
171 * 1 Software (ignored)
172 * 2 Combined hardware interrupt (hw0)
173 * 3 Hardware (ignored)
174 * 4 Hardware (ignored)
175 * 5 Hardware (ignored)
176 * 6 Hardware (ignored)
177 * 7 R4k timer (what we use)
178 *
179 * We handle the IRQ according to _our_ priority which is:
180 *
181 * Highest ---- R4k Timer
182 * Lowest ---- Combined hardware interrupt
183 *
184 * then we just return, if multiple IRQs are pending then we will just take
185 * another exception, big deal.
186 */
187asmlinkage void plat_irq_dispatch(struct pt_regs *regs)
188{
189 unsigned int pending = read_c0_cause() & read_c0_status() & ST0_IM;
190 int irq;
191
192 irq = irq_ffs(pending);
193
194 if (irq == MIPSCPU_INT_ATLAS)
195 atlas_hw0_irqdispatch(regs);
196 else if (irq > 0)
197 do_IRQ(MIPSCPU_INT_BASE + irq, regs);
198 else
199 spurious_interrupt(regs);
200}
201
119void __init arch_init_irq(void) 202void __init arch_init_irq(void)
120{ 203{
121 int i; 204 int i;
@@ -128,9 +211,6 @@ void __init arch_init_irq(void)
128 */ 211 */
129 atlas_hw0_icregs->intrsten = 0xffffffff; 212 atlas_hw0_icregs->intrsten = 0xffffffff;
130 213
131 /* Now safe to set the exception vector. */
132 set_except_vector(0, mipsIRQ);
133
134 for (i = ATLASINT_BASE; i <= ATLASINT_END; i++) { 214 for (i = ATLASINT_BASE; i <= ATLASINT_END; i++) {
135 irq_desc[i].status = IRQ_DISABLED; 215 irq_desc[i].status = IRQ_DISABLED;
136 irq_desc[i].action = 0; 216 irq_desc[i].action = 0;
diff --git a/arch/mips/mips-boards/generic/Makefile b/arch/mips/mips-boards/generic/Makefile
index b21bc6887fa8..be47c1c2bc80 100644
--- a/arch/mips/mips-boards/generic/Makefile
+++ b/arch/mips/mips-boards/generic/Makefile
@@ -18,8 +18,8 @@
18# Makefile for the MIPS boards generic routines under Linux. 18# Makefile for the MIPS boards generic routines under Linux.
19# 19#
20 20
21obj-y := mipsIRQ.o reset.o display.o init.o memory.o \ 21obj-y := reset.o display.o init.o memory.o printf.o \
22 printf.o cmdline.o time.o 22 cmdline.o time.o
23obj-$(CONFIG_PCI) += pci.o 23obj-$(CONFIG_PCI) += pci.o
24obj-$(CONFIG_KGDB) += gdb_hook.o 24obj-$(CONFIG_KGDB) += gdb_hook.o
25 25
diff --git a/arch/mips/mips-boards/generic/gdb_hook.c b/arch/mips/mips-boards/generic/gdb_hook.c
index 91a2ccbe3730..6a1854de4579 100644
--- a/arch/mips/mips-boards/generic/gdb_hook.c
+++ b/arch/mips/mips-boards/generic/gdb_hook.c
@@ -25,7 +25,7 @@
25#include <asm/serial.h> 25#include <asm/serial.h>
26#include <asm/io.h> 26#include <asm/io.h>
27 27
28static struct serial_state rs_table[RS_TABLE_SIZE] = { 28static struct serial_state rs_table[] = {
29 SERIAL_PORT_DFNS /* Defined in serial.h */ 29 SERIAL_PORT_DFNS /* Defined in serial.h */
30}; 30};
31 31
diff --git a/arch/mips/mips-boards/generic/init.c b/arch/mips/mips-boards/generic/init.c
index eab5a705e989..df4e94735604 100644
--- a/arch/mips/mips-boards/generic/init.c
+++ b/arch/mips/mips-boards/generic/init.c
@@ -220,7 +220,6 @@ void __init kgdb_config (void)
220 generic_putDebugChar (*s++); 220 generic_putDebugChar (*s++);
221 } 221 }
222 222
223 kgdb_enabled = 1;
224 /* Breakpoint is invoked after interrupts are initialised */ 223 /* Breakpoint is invoked after interrupts are initialised */
225 } 224 }
226} 225}
@@ -338,6 +337,7 @@ void __init prom_init(void)
338 case MIPS_REVISION_CORID_CORE_MSC: 337 case MIPS_REVISION_CORID_CORE_MSC:
339 case MIPS_REVISION_CORID_CORE_FPGA2: 338 case MIPS_REVISION_CORID_CORE_FPGA2:
340 case MIPS_REVISION_CORID_CORE_FPGA3: 339 case MIPS_REVISION_CORID_CORE_FPGA3:
340 case MIPS_REVISION_CORID_CORE_24K:
341 case MIPS_REVISION_CORID_CORE_EMUL_MSC: 341 case MIPS_REVISION_CORID_CORE_EMUL_MSC:
342 _pcictrl_msc = (unsigned long)ioremap(MIPS_MSC01_PCI_REG_BASE, 0x2000); 342 _pcictrl_msc = (unsigned long)ioremap(MIPS_MSC01_PCI_REG_BASE, 0x2000);
343 343
diff --git a/arch/mips/mips-boards/generic/memory.c b/arch/mips/mips-boards/generic/memory.c
index 32c9210373ac..bc4d093685bb 100644
--- a/arch/mips/mips-boards/generic/memory.c
+++ b/arch/mips/mips-boards/generic/memory.c
@@ -22,10 +22,12 @@
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/mm.h> 23#include <linux/mm.h>
24#include <linux/bootmem.h> 24#include <linux/bootmem.h>
25#include <linux/pfn.h>
25#include <linux/string.h> 26#include <linux/string.h>
26 27
27#include <asm/bootinfo.h> 28#include <asm/bootinfo.h>
28#include <asm/page.h> 29#include <asm/page.h>
30#include <asm/sections.h>
29 31
30#include <asm/mips-boards/prom.h> 32#include <asm/mips-boards/prom.h>
31 33
@@ -46,9 +48,6 @@ static char *mtypes[3] = {
46}; 48};
47#endif 49#endif
48 50
49/* References to section boundaries */
50extern char _end;
51
52struct prom_pmemblock * __init prom_getmdesc(void) 51struct prom_pmemblock * __init prom_getmdesc(void)
53{ 52{
54 char *memsize_str; 53 char *memsize_str;
@@ -106,10 +105,10 @@ struct prom_pmemblock * __init prom_getmdesc(void)
106 105
107 mdesc[3].type = yamon_dontuse; 106 mdesc[3].type = yamon_dontuse;
108 mdesc[3].base = 0x00100000; 107 mdesc[3].base = 0x00100000;
109 mdesc[3].size = CPHYSADDR(PAGE_ALIGN(&_end)) - mdesc[3].base; 108 mdesc[3].size = CPHYSADDR(PFN_ALIGN((unsigned long)&_end)) - mdesc[3].base;
110 109
111 mdesc[4].type = yamon_free; 110 mdesc[4].type = yamon_free;
112 mdesc[4].base = CPHYSADDR(PAGE_ALIGN(&_end)); 111 mdesc[4].base = CPHYSADDR(PFN_ALIGN(&_end));
113 mdesc[4].size = memsize - mdesc[4].base; 112 mdesc[4].size = memsize - mdesc[4].base;
114 113
115 return &mdesc[0]; 114 return &mdesc[0];
diff --git a/arch/mips/mips-boards/generic/mipsIRQ.S b/arch/mips/mips-boards/generic/mipsIRQ.S
deleted file mode 100644
index ddd5c73a2971..000000000000
--- a/arch/mips/mips-boards/generic/mipsIRQ.S
+++ /dev/null
@@ -1,155 +0,0 @@
1/*
2 * Carsten Langgaard, carstenl@mips.com
3 * Copyright (C) 1999, 2000 MIPS Technologies, Inc. All rights reserved.
4 *
5 * ########################################################################
6 *
7 * This program is free software; you can distribute it and/or modify it
8 * under the terms of the GNU General Public License (Version 2) as
9 * published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
19 *
20 * ########################################################################
21 *
22 * Interrupt exception dispatch code.
23 *
24 */
25#include <linux/config.h>
26
27#include <asm/asm.h>
28#include <asm/mipsregs.h>
29#include <asm/regdef.h>
30#include <asm/stackframe.h>
31
32#ifdef CONFIG_MIPS_ATLAS
33#include <asm/mips-boards/atlasint.h>
34#define CASCADE_IRQ MIPSCPU_INT_ATLAS
35#define CASCADE_DISPATCH atlas_hw0_irqdispatch
36#endif
37#ifdef CONFIG_MIPS_MALTA
38#include <asm/mips-boards/maltaint.h>
39#define CASCADE_IRQ MIPSCPU_INT_I8259A
40#define CASCADE_DISPATCH malta_hw0_irqdispatch
41#endif
42#ifdef CONFIG_MIPS_SEAD
43#include <asm/mips-boards/seadint.h>
44#endif
45
46/* A lot of complication here is taken away because:
47 *
48 * 1) We handle one interrupt and return, sitting in a loop and moving across
49 * all the pending IRQ bits in the cause register is _NOT_ the answer, the
50 * common case is one pending IRQ so optimize in that direction.
51 *
52 * 2) We need not check against bits in the status register IRQ mask, that
53 * would make this routine slow as hell.
54 *
55 * 3) Linux only thinks in terms of all IRQs on or all IRQs off, nothing in
56 * between like BSD spl() brain-damage.
57 *
58 * Furthermore, the IRQs on the MIPS board look basically (barring software
59 * IRQs which we don't use at all and all external interrupt sources are
60 * combined together on hardware interrupt 0 (MIPS IRQ 2)) like:
61 *
62 * MIPS IRQ Source
63 * -------- ------
64 * 0 Software (ignored)
65 * 1 Software (ignored)
66 * 2 Combined hardware interrupt (hw0)
67 * 3 Hardware (ignored)
68 * 4 Hardware (ignored)
69 * 5 Hardware (ignored)
70 * 6 Hardware (ignored)
71 * 7 R4k timer (what we use)
72 *
73 * Note: On the SEAD board thing are a little bit different.
74 * Here IRQ 2 (hw0) is wired to the UART0 and IRQ 3 (hw1) is wired
75 * wired to UART1.
76 *
77 * We handle the IRQ according to _our_ priority which is:
78 *
79 * Highest ---- R4k Timer
80 * Lowest ---- Combined hardware interrupt
81 *
82 * then we just return, if multiple IRQs are pending then we will just take
83 * another exception, big deal.
84 */
85
86 .text
87 .set noreorder
88 .set noat
89 .align 5
90 NESTED(mipsIRQ, PT_SIZE, sp)
91 SAVE_ALL
92 CLI
93 .set at
94
95 mfc0 s0, CP0_CAUSE # get irq bits
96 mfc0 s1, CP0_STATUS # get irq mask
97 andi s0, ST0_IM # CAUSE.CE may be non-zero!
98 and s0, s1
99
100#if defined(CONFIG_CPU_MIPS32) || defined(CONFIG_CPU_MIPS64)
101 .set mips32
102 clz a0, s0
103 .set mips0
104 negu a0
105 addu a0, 31-CAUSEB_IP
106 bltz a0, spurious
107#else
108 beqz s0, spurious
109 li a0, 7
110
111 and t0, s0, 0xf000
112 sltiu t0, t0, 1
113 sll t0, 2
114 subu a0, t0
115 sll s0, t0
116
117 and t0, s0, 0xc000
118 sltiu t0, t0, 1
119 sll t0, 1
120 subu a0, t0
121 sll s0, t0
122
123 and t0, s0, 0x8000
124 sltiu t0, t0, 1
125 # sll t0, 0
126 subu a0, t0
127 # sll s0, t0
128#endif
129
130#ifdef CASCADE_IRQ
131 li a1, CASCADE_IRQ
132 bne a0, a1, 1f
133 addu a0, MIPSCPU_INT_BASE
134
135 jal CASCADE_DISPATCH
136 move a0, sp
137
138 j ret_from_irq
139 nop
1401:
141#else
142 addu a0, MIPSCPU_INT_BASE
143#endif
144
145 jal do_IRQ
146 move a1, sp
147
148 j ret_from_irq
149 nop
150
151
152spurious:
153 j spurious_interrupt
154 nop
155 END(mipsIRQ)
diff --git a/arch/mips/mips-boards/generic/pci.c b/arch/mips/mips-boards/generic/pci.c
index 1f6f9df74ab2..9337f6c8873a 100644
--- a/arch/mips/mips-boards/generic/pci.c
+++ b/arch/mips/mips-boards/generic/pci.c
@@ -198,6 +198,7 @@ void __init mips_pcibios_init(void)
198 case MIPS_REVISION_CORID_CORE_MSC: 198 case MIPS_REVISION_CORID_CORE_MSC:
199 case MIPS_REVISION_CORID_CORE_FPGA2: 199 case MIPS_REVISION_CORID_CORE_FPGA2:
200 case MIPS_REVISION_CORID_CORE_FPGA3: 200 case MIPS_REVISION_CORID_CORE_FPGA3:
201 case MIPS_REVISION_CORID_CORE_24K:
201 case MIPS_REVISION_CORID_CORE_EMUL_MSC: 202 case MIPS_REVISION_CORID_CORE_EMUL_MSC:
202 /* Set up resource ranges from the controller's registers. */ 203 /* Set up resource ranges from the controller's registers. */
203 MSC_READ(MSC01_PCI_SC2PMBASL, start); 204 MSC_READ(MSC01_PCI_SC2PMBASL, start);
diff --git a/arch/mips/mips-boards/generic/time.c b/arch/mips/mips-boards/generic/time.c
index 93f3bf2c2b22..a9f6124b3a22 100644
--- a/arch/mips/mips-boards/generic/time.c
+++ b/arch/mips/mips-boards/generic/time.c
@@ -30,6 +30,7 @@
30#include <linux/mc146818rtc.h> 30#include <linux/mc146818rtc.h>
31 31
32#include <asm/mipsregs.h> 32#include <asm/mipsregs.h>
33#include <asm/mipsmtregs.h>
33#include <asm/ptrace.h> 34#include <asm/ptrace.h>
34#include <asm/hardirq.h> 35#include <asm/hardirq.h>
35#include <asm/irq.h> 36#include <asm/irq.h>
@@ -50,16 +51,23 @@ unsigned long cpu_khz;
50static char display_string[] = " LINUX ON ATLAS "; 51static char display_string[] = " LINUX ON ATLAS ";
51#endif 52#endif
52#if defined(CONFIG_MIPS_MALTA) 53#if defined(CONFIG_MIPS_MALTA)
54#if defined(CONFIG_MIPS_MT_SMTC)
55static char display_string[] = " SMTC LINUX ON MALTA ";
56#else
53static char display_string[] = " LINUX ON MALTA "; 57static char display_string[] = " LINUX ON MALTA ";
58#endif /* CONFIG_MIPS_MT_SMTC */
54#endif 59#endif
55#if defined(CONFIG_MIPS_SEAD) 60#if defined(CONFIG_MIPS_SEAD)
56static char display_string[] = " LINUX ON SEAD "; 61static char display_string[] = " LINUX ON SEAD ";
57#endif 62#endif
58static unsigned int display_count = 0; 63static unsigned int display_count;
59#define MAX_DISPLAY_COUNT (sizeof(display_string) - 8) 64#define MAX_DISPLAY_COUNT (sizeof(display_string) - 8)
60 65
61static unsigned int timer_tick_count=0; 66#define CPUCTR_IMASKBIT (0x100 << MIPSCPU_INT_CPUCTR)
67
68static unsigned int timer_tick_count;
62static int mips_cpu_timer_irq; 69static int mips_cpu_timer_irq;
70extern void smtc_timer_broadcast(int);
63 71
64static inline void scroll_display_message(void) 72static inline void scroll_display_message(void)
65{ 73{
@@ -75,15 +83,55 @@ static void mips_timer_dispatch (struct pt_regs *regs)
75 do_IRQ (mips_cpu_timer_irq, regs); 83 do_IRQ (mips_cpu_timer_irq, regs);
76} 84}
77 85
86/*
87 * Redeclare until I get around mopping the timer code insanity on MIPS.
88 */
78extern int null_perf_irq(struct pt_regs *regs); 89extern int null_perf_irq(struct pt_regs *regs);
79 90
80extern int (*perf_irq)(struct pt_regs *regs); 91extern int (*perf_irq)(struct pt_regs *regs);
81 92
82irqreturn_t mips_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) 93irqreturn_t mips_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
83{ 94{
84 int r2 = cpu_has_mips_r2;
85 int cpu = smp_processor_id(); 95 int cpu = smp_processor_id();
96 int r2 = cpu_has_mips_r2;
97
98#ifdef CONFIG_MIPS_MT_SMTC
99 /*
100 * In an SMTC system, one Count/Compare set exists per VPE.
101 * Which TC within a VPE gets the interrupt is essentially
102 * random - we only know that it shouldn't be one with
103 * IXMT set. Whichever TC gets the interrupt needs to
104 * send special interprocessor interrupts to the other
105 * TCs to make sure that they schedule, etc.
106 *
107 * That code is specific to the SMTC kernel, not to
108 * the a particular platform, so it's invoked from
109 * the general MIPS timer_interrupt routine.
110 */
111
112 /*
113 * DVPE is necessary so long as cross-VPE interrupts
114 * are done via read-modify-write of Cause register.
115 */
116 int vpflags = dvpe();
117 write_c0_compare (read_c0_count() - 1);
118 clear_c0_cause(CPUCTR_IMASKBIT);
119 evpe(vpflags);
120
121 if (cpu_data[cpu].vpe_id == 0) {
122 timer_interrupt(irq, dev_id, regs);
123 scroll_display_message();
124 } else
125 write_c0_compare (read_c0_count() + ( mips_hpt_frequency/HZ));
126 smtc_timer_broadcast(cpu_data[cpu].vpe_id);
86 127
128 if (cpu != 0)
129 /*
130 * Other CPUs should do profiling and process accounting
131 */
132 local_timer_interrupt(irq, dev_id, regs);
133
134#else /* CONFIG_MIPS_MT_SMTC */
87 if (cpu == 0) { 135 if (cpu == 0) {
88 /* 136 /*
89 * CPU 0 handles the global timer interrupt job and process 137 * CPU 0 handles the global timer interrupt job and process
@@ -107,12 +155,14 @@ irqreturn_t mips_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
107 * More support needs to be added to kernel/time for 155 * More support needs to be added to kernel/time for
108 * counter/timer interrupts on multiple CPU's 156 * counter/timer interrupts on multiple CPU's
109 */ 157 */
110 write_c0_compare (read_c0_count() + (mips_hpt_frequency/HZ)); 158 write_c0_compare(read_c0_count() + (mips_hpt_frequency/HZ));
159
111 /* 160 /*
112 * other CPUs should do profiling and process accounting 161 * Other CPUs should do profiling and process accounting
113 */ 162 */
114 local_timer_interrupt (irq, dev_id, regs); 163 local_timer_interrupt(irq, dev_id, regs);
115 } 164 }
165#endif /* CONFIG_MIPS_MT_SMTC */
116 166
117out: 167out:
118 return IRQ_HANDLED; 168 return IRQ_HANDLED;
@@ -126,7 +176,7 @@ static unsigned int __init estimate_cpu_frequency(void)
126 unsigned int prid = read_c0_prid() & 0xffff00; 176 unsigned int prid = read_c0_prid() & 0xffff00;
127 unsigned int count; 177 unsigned int count;
128 178
129#ifdef CONFIG_MIPS_SEAD 179#if defined(CONFIG_MIPS_SEAD) || defined(CONFIG_MIPS_SIM)
130 /* 180 /*
131 * The SEAD board doesn't have a real time clock, so we can't 181 * The SEAD board doesn't have a real time clock, so we can't
132 * really calculate the timer frequency 182 * really calculate the timer frequency
@@ -211,7 +261,11 @@ void __init mips_timer_setup(struct irqaction *irq)
211 261
212 /* we are using the cpu counter for timer interrupts */ 262 /* we are using the cpu counter for timer interrupts */
213 irq->handler = mips_timer_interrupt; /* we use our own handler */ 263 irq->handler = mips_timer_interrupt; /* we use our own handler */
264#ifdef CONFIG_MIPS_MT_SMTC
265 setup_irq_smtc(mips_cpu_timer_irq, irq, CPUCTR_IMASKBIT);
266#else
214 setup_irq(mips_cpu_timer_irq, irq); 267 setup_irq(mips_cpu_timer_irq, irq);
268#endif /* CONFIG_MIPS_MT_SMTC */
215 269
216#ifdef CONFIG_SMP 270#ifdef CONFIG_SMP
217 /* irq_desc(riptor) is a global resource, when the interrupt overlaps 271 /* irq_desc(riptor) is a global resource, when the interrupt overlaps
diff --git a/arch/mips/mips-boards/malta/Makefile b/arch/mips/mips-boards/malta/Makefile
index fd4c143c0e2f..77ee5c6d33c1 100644
--- a/arch/mips/mips-boards/malta/Makefile
+++ b/arch/mips/mips-boards/malta/Makefile
@@ -20,3 +20,4 @@
20# 20#
21 21
22obj-y := malta_int.o malta_setup.o 22obj-y := malta_int.o malta_setup.o
23obj-$(CONFIG_SMP) += malta_smp.o
diff --git a/arch/mips/mips-boards/malta/malta_int.c b/arch/mips/mips-boards/malta/malta_int.c
index d06dc5ad6c9e..7cc0ba4f553a 100644
--- a/arch/mips/mips-boards/malta/malta_int.c
+++ b/arch/mips/mips-boards/malta/malta_int.c
@@ -40,7 +40,6 @@
40#include <asm/mips-boards/msc01_pci.h> 40#include <asm/mips-boards/msc01_pci.h>
41#include <asm/msc01_ic.h> 41#include <asm/msc01_ic.h>
42 42
43extern asmlinkage void mipsIRQ(void);
44extern void mips_timer_interrupt(void); 43extern void mips_timer_interrupt(void);
45 44
46static DEFINE_SPINLOCK(mips_irq_lock); 45static DEFINE_SPINLOCK(mips_irq_lock);
@@ -58,6 +57,7 @@ static inline int mips_pcibios_iack(void)
58 case MIPS_REVISION_CORID_CORE_MSC: 57 case MIPS_REVISION_CORID_CORE_MSC:
59 case MIPS_REVISION_CORID_CORE_FPGA2: 58 case MIPS_REVISION_CORID_CORE_FPGA2:
60 case MIPS_REVISION_CORID_CORE_FPGA3: 59 case MIPS_REVISION_CORID_CORE_FPGA3:
60 case MIPS_REVISION_CORID_CORE_24K:
61 case MIPS_REVISION_CORID_CORE_EMUL_MSC: 61 case MIPS_REVISION_CORID_CORE_EMUL_MSC:
62 MSC_READ(MSC01_PCI_IACK, irq); 62 MSC_READ(MSC01_PCI_IACK, irq);
63 irq &= 0xff; 63 irq &= 0xff;
@@ -114,13 +114,14 @@ static inline int get_int(void)
114 return irq; 114 return irq;
115} 115}
116 116
117void malta_hw0_irqdispatch(struct pt_regs *regs) 117static void malta_hw0_irqdispatch(struct pt_regs *regs)
118{ 118{
119 int irq; 119 int irq;
120 120
121 irq = get_int(); 121 irq = get_int();
122 if (irq < 0) 122 if (irq < 0) {
123 return; /* interrupt has already been cleared */ 123 return; /* interrupt has already been cleared */
124 }
124 125
125 do_IRQ(MALTA_INT_BASE+irq, regs); 126 do_IRQ(MALTA_INT_BASE+irq, regs);
126} 127}
@@ -143,6 +144,7 @@ void corehi_irqdispatch(struct pt_regs *regs)
143 case MIPS_REVISION_CORID_CORE_MSC: 144 case MIPS_REVISION_CORID_CORE_MSC:
144 case MIPS_REVISION_CORID_CORE_FPGA2: 145 case MIPS_REVISION_CORID_CORE_FPGA2:
145 case MIPS_REVISION_CORID_CORE_FPGA3: 146 case MIPS_REVISION_CORID_CORE_FPGA3:
147 case MIPS_REVISION_CORID_CORE_24K:
146 case MIPS_REVISION_CORID_CORE_EMUL_MSC: 148 case MIPS_REVISION_CORID_CORE_EMUL_MSC:
147 ll_msc_irq(regs); 149 ll_msc_irq(regs);
148 break; 150 break;
@@ -182,6 +184,92 @@ void corehi_irqdispatch(struct pt_regs *regs)
182 die("CoreHi interrupt", regs); 184 die("CoreHi interrupt", regs);
183} 185}
184 186
187static inline int clz(unsigned long x)
188{
189 __asm__ (
190 " .set push \n"
191 " .set mips32 \n"
192 " clz %0, %1 \n"
193 " .set pop \n"
194 : "=r" (x)
195 : "r" (x));
196
197 return x;
198}
199
200/*
201 * Version of ffs that only looks at bits 12..15.
202 */
203static inline unsigned int irq_ffs(unsigned int pending)
204{
205#if defined(CONFIG_CPU_MIPS32) || defined(CONFIG_CPU_MIPS64)
206 return -clz(pending) + 31 - CAUSEB_IP;
207#else
208 unsigned int a0 = 7;
209 unsigned int t0;
210
211 t0 = s0 & 0xf000;
212 t0 = t0 < 1;
213 t0 = t0 << 2;
214 a0 = a0 - t0;
215 s0 = s0 << t0;
216
217 t0 = s0 & 0xc000;
218 t0 = t0 < 1;
219 t0 = t0 << 1;
220 a0 = a0 - t0;
221 s0 = s0 << t0;
222
223 t0 = s0 & 0x8000;
224 t0 = t0 < 1;
225 //t0 = t0 << 2;
226 a0 = a0 - t0;
227 //s0 = s0 << t0;
228
229 return a0;
230#endif
231}
232
233/*
234 * IRQs on the Malta board look basically (barring software IRQs which we
235 * don't use at all and all external interrupt sources are combined together
236 * on hardware interrupt 0 (MIPS IRQ 2)) like:
237 *
238 * MIPS IRQ Source
239 * -------- ------
240 * 0 Software (ignored)
241 * 1 Software (ignored)
242 * 2 Combined hardware interrupt (hw0)
243 * 3 Hardware (ignored)
244 * 4 Hardware (ignored)
245 * 5 Hardware (ignored)
246 * 6 Hardware (ignored)
247 * 7 R4k timer (what we use)
248 *
249 * We handle the IRQ according to _our_ priority which is:
250 *
251 * Highest ---- R4k Timer
252 * Lowest ---- Combined hardware interrupt
253 *
254 * then we just return, if multiple IRQs are pending then we will just take
255 * another exception, big deal.
256 */
257
258asmlinkage void plat_irq_dispatch(struct pt_regs *regs)
259{
260 unsigned int pending = read_c0_cause() & read_c0_status() & ST0_IM;
261 int irq;
262
263 irq = irq_ffs(pending);
264
265 if (irq == MIPSCPU_INT_I8259A)
266 malta_hw0_irqdispatch(regs);
267 else if (irq > 0)
268 do_IRQ(MIPSCPU_INT_BASE + irq, regs);
269 else
270 spurious_interrupt(regs);
271}
272
185static struct irqaction i8259irq = { 273static struct irqaction i8259irq = {
186 .handler = no_action, 274 .handler = no_action,
187 .name = "XT-PIC cascade" 275 .name = "XT-PIC cascade"
@@ -214,7 +302,6 @@ int __initdata msc_nr_eicirqs = sizeof(msc_eicirqmap)/sizeof(msc_irqmap_t);
214 302
215void __init arch_init_irq(void) 303void __init arch_init_irq(void)
216{ 304{
217 set_except_vector(0, mipsIRQ);
218 init_i8259_irqs(); 305 init_i8259_irqs();
219 306
220 if (!cpu_has_veic) 307 if (!cpu_has_veic)
@@ -224,6 +311,7 @@ void __init arch_init_irq(void)
224 case MIPS_REVISION_CORID_CORE_MSC: 311 case MIPS_REVISION_CORID_CORE_MSC:
225 case MIPS_REVISION_CORID_CORE_FPGA2: 312 case MIPS_REVISION_CORID_CORE_FPGA2:
226 case MIPS_REVISION_CORID_CORE_FPGA3: 313 case MIPS_REVISION_CORID_CORE_FPGA3:
314 case MIPS_REVISION_CORID_CORE_24K:
227 case MIPS_REVISION_CORID_CORE_EMUL_MSC: 315 case MIPS_REVISION_CORID_CORE_EMUL_MSC:
228 if (cpu_has_veic) 316 if (cpu_has_veic)
229 init_msc_irqs (MSC01E_INT_BASE, msc_eicirqmap, msc_nr_eicirqs); 317 init_msc_irqs (MSC01E_INT_BASE, msc_eicirqmap, msc_nr_eicirqs);
@@ -240,12 +328,17 @@ void __init arch_init_irq(void)
240 else if (cpu_has_vint) { 328 else if (cpu_has_vint) {
241 set_vi_handler (MIPSCPU_INT_I8259A, malta_hw0_irqdispatch); 329 set_vi_handler (MIPSCPU_INT_I8259A, malta_hw0_irqdispatch);
242 set_vi_handler (MIPSCPU_INT_COREHI, corehi_irqdispatch); 330 set_vi_handler (MIPSCPU_INT_COREHI, corehi_irqdispatch);
243 331#ifdef CONFIG_MIPS_MT_SMTC
332 setup_irq_smtc (MIPSCPU_INT_BASE+MIPSCPU_INT_I8259A, &i8259irq,
333 (0x100 << MIPSCPU_INT_I8259A));
334 setup_irq_smtc (MIPSCPU_INT_BASE+MIPSCPU_INT_COREHI,
335 &corehi_irqaction, (0x100 << MIPSCPU_INT_COREHI));
336#else /* Not SMTC */
244 setup_irq (MIPSCPU_INT_BASE+MIPSCPU_INT_I8259A, &i8259irq); 337 setup_irq (MIPSCPU_INT_BASE+MIPSCPU_INT_I8259A, &i8259irq);
245 setup_irq (MIPSCPU_INT_BASE+MIPSCPU_INT_COREHI, &corehi_irqaction); 338 setup_irq (MIPSCPU_INT_BASE+MIPSCPU_INT_COREHI, &corehi_irqaction);
339#endif /* CONFIG_MIPS_MT_SMTC */
246 } 340 }
247 else { 341 else {
248 set_except_vector(0, mipsIRQ);
249 setup_irq (MIPSCPU_INT_BASE+MIPSCPU_INT_I8259A, &i8259irq); 342 setup_irq (MIPSCPU_INT_BASE+MIPSCPU_INT_I8259A, &i8259irq);
250 setup_irq (MIPSCPU_INT_BASE+MIPSCPU_INT_COREHI, &corehi_irqaction); 343 setup_irq (MIPSCPU_INT_BASE+MIPSCPU_INT_COREHI, &corehi_irqaction);
251 } 344 }
diff --git a/arch/mips/mips-boards/malta/malta_smp.c b/arch/mips/mips-boards/malta/malta_smp.c
new file mode 100644
index 000000000000..6c6c8eeedbce
--- /dev/null
+++ b/arch/mips/mips-boards/malta/malta_smp.c
@@ -0,0 +1,128 @@
1/*
2 * Malta Platform-specific hooks for SMP operation
3 */
4
5#include <linux/kernel.h>
6#include <linux/sched.h>
7#include <linux/cpumask.h>
8#include <linux/interrupt.h>
9
10#include <asm/atomic.h>
11#include <asm/cpu.h>
12#include <asm/processor.h>
13#include <asm/system.h>
14#include <asm/hardirq.h>
15#include <asm/mmu_context.h>
16#include <asm/smp.h>
17#ifdef CONFIG_MIPS_MT_SMTC
18#include <asm/smtc_ipi.h>
19#endif /* CONFIG_MIPS_MT_SMTC */
20
21/* VPE/SMP Prototype implements platform interfaces directly */
22#if !defined(CONFIG_MIPS_MT_SMP)
23
24/*
25 * Cause the specified action to be performed on a targeted "CPU"
26 */
27
28void core_send_ipi(int cpu, unsigned int action)
29{
30/* "CPU" may be TC of same VPE, VPE of same CPU, or different CPU */
31#ifdef CONFIG_MIPS_MT_SMTC
32 smtc_send_ipi(cpu, LINUX_SMP_IPI, action);
33#endif /* CONFIG_MIPS_MT_SMTC */
34}
35
36/*
37 * Detect available CPUs/VPEs/TCs and populate phys_cpu_present_map
38 */
39
40void __init prom_build_cpu_map(void)
41{
42 int nextslot;
43
44 /*
45 * As of November, 2004, MIPSsim only simulates one core
46 * at a time. However, that core may be a MIPS MT core
47 * with multiple virtual processors and thread contexts.
48 */
49
50 if (read_c0_config3() & (1<<2)) {
51 nextslot = mipsmt_build_cpu_map(1);
52 }
53}
54
55/*
56 * Platform "CPU" startup hook
57 */
58
59void prom_boot_secondary(int cpu, struct task_struct *idle)
60{
61#ifdef CONFIG_MIPS_MT_SMTC
62 smtc_boot_secondary(cpu, idle);
63#endif /* CONFIG_MIPS_MT_SMTC */
64}
65
66/*
67 * Post-config but pre-boot cleanup entry point
68 */
69
70void prom_init_secondary(void)
71{
72#ifdef CONFIG_MIPS_MT_SMTC
73 void smtc_init_secondary(void);
74 int myvpe;
75
76 /* Don't enable Malta I/O interrupts (IP2) for secondary VPEs */
77 myvpe = read_c0_tcbind() & TCBIND_CURVPE;
78 if (myvpe != 0) {
79 /* Ideally, this should be done only once per VPE, but... */
80 clear_c0_status(STATUSF_IP2);
81 set_c0_status(STATUSF_IP0 | STATUSF_IP1 | STATUSF_IP3
82 | STATUSF_IP4 | STATUSF_IP5 | STATUSF_IP6
83 | STATUSF_IP7);
84 }
85
86 smtc_init_secondary();
87#endif /* CONFIG_MIPS_MT_SMTC */
88}
89
90/*
91 * Platform SMP pre-initialization
92 *
93 * As noted above, we can assume a single CPU for now
94 * but it may be multithreaded.
95 */
96
97void plat_smp_setup(void)
98{
99 if (read_c0_config3() & (1<<2))
100 mipsmt_build_cpu_map(0);
101}
102
103void __init plat_prepare_cpus(unsigned int max_cpus)
104{
105 if (read_c0_config3() & (1<<2))
106 mipsmt_prepare_cpus();
107}
108
109/*
110 * SMP initialization finalization entry point
111 */
112
113void prom_smp_finish(void)
114{
115#ifdef CONFIG_MIPS_MT_SMTC
116 smtc_smp_finish();
117#endif /* CONFIG_MIPS_MT_SMTC */
118}
119
120/*
121 * Hook for after all CPUs are online
122 */
123
124void prom_cpus_done(void)
125{
126}
127
128#endif /* CONFIG_MIPS32R2_MT_SMP */
diff --git a/arch/mips/mips-boards/sead/sead_int.c b/arch/mips/mips-boards/sead/sead_int.c
index 90fda0d9915f..9168d934c661 100644
--- a/arch/mips/mips-boards/sead/sead_int.c
+++ b/arch/mips/mips-boards/sead/sead_int.c
@@ -24,16 +24,94 @@
24#include <linux/irq.h> 24#include <linux/irq.h>
25 25
26#include <asm/irq_cpu.h> 26#include <asm/irq_cpu.h>
27#include <asm/mipsregs.h>
27#include <asm/system.h> 28#include <asm/system.h>
28 29
29#include <asm/mips-boards/seadint.h> 30#include <asm/mips-boards/seadint.h>
30 31
31extern asmlinkage void mipsIRQ(void); 32static inline int clz(unsigned long x)
33{
34 __asm__ (
35 " .set push \n"
36 " .set mips32 \n"
37 " clz %0, %1 \n"
38 " .set pop \n"
39 : "=r" (x)
40 : "r" (x));
41
42 return x;
43}
44
45/*
46 * Version of ffs that only looks at bits 12..15.
47 */
48static inline unsigned int irq_ffs(unsigned int pending)
49{
50#if defined(CONFIG_CPU_MIPS32) || defined(CONFIG_CPU_MIPS64)
51 return -clz(pending) + 31 - CAUSEB_IP;
52#else
53 unsigned int a0 = 7;
54 unsigned int t0;
55
56 t0 = s0 & 0xf000;
57 t0 = t0 < 1;
58 t0 = t0 << 2;
59 a0 = a0 - t0;
60 s0 = s0 << t0;
61
62 t0 = s0 & 0xc000;
63 t0 = t0 < 1;
64 t0 = t0 << 1;
65 a0 = a0 - t0;
66 s0 = s0 << t0;
67
68 t0 = s0 & 0x8000;
69 t0 = t0 < 1;
70 //t0 = t0 << 2;
71 a0 = a0 - t0;
72 //s0 = s0 << t0;
73
74 return a0;
75#endif
76}
77
78/*
79 * IRQs on the SEAD board look basically are combined together on hardware
80 * interrupt 0 (MIPS IRQ 2)) like:
81 *
82 * MIPS IRQ Source
83 * -------- ------
84 * 0 Software (ignored)
85 * 1 Software (ignored)
86 * 2 UART0 (hw0)
87 * 3 UART1 (hw1)
88 * 4 Hardware (ignored)
89 * 5 Hardware (ignored)
90 * 6 Hardware (ignored)
91 * 7 R4k timer (what we use)
92 *
93 * We handle the IRQ according to _our_ priority which is:
94 *
95 * Highest ---- R4k Timer
96 * Lowest ---- Combined hardware interrupt
97 *
98 * then we just return, if multiple IRQs are pending then we will just take
99 * another exception, big deal.
100 */
101asmlinkage void plat_irq_dispatch(struct pt_regs *regs)
102{
103 unsigned int pending = read_c0_cause() & read_c0_status() & ST0_IM;
104 int irq;
105
106 irq = irq_ffs(pending);
107
108 if (irq >= 0)
109 do_IRQ(MIPSCPU_INT_BASE + irq, regs);
110 else
111 spurious_interrupt(regs);
112}
32 113
33void __init arch_init_irq(void) 114void __init arch_init_irq(void)
34{ 115{
35 mips_cpu_irq_init(MIPSCPU_INT_BASE); 116 mips_cpu_irq_init(MIPSCPU_INT_BASE);
36
37 /* Now safe to set the exception vector. */
38 set_except_vector(0, mipsIRQ);
39} 117}
diff --git a/arch/mips/mips-boards/sim/cmdline.c b/arch/mips/mips-boards/sim/cmdline.c
deleted file mode 100644
index fef9fbd8e710..000000000000
--- a/arch/mips/mips-boards/sim/cmdline.c
+++ /dev/null
@@ -1,59 +0,0 @@
1/*
2 * Carsten Langgaard, carstenl@mips.com
3 * Copyright (C) 1999,2000 MIPS Technologies, Inc. All rights reserved.
4 *
5 * This program is free software; you can distribute it and/or modify it
6 * under the terms of the GNU General Public License (Version 2) as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
17 *
18 * Kernel command line creation using the prom monitor (YAMON) argc/argv.
19 */
20#include <linux/init.h>
21#include <linux/string.h>
22
23#include <asm/bootinfo.h>
24
25extern int prom_argc;
26extern int *_prom_argv;
27
28/*
29 * YAMON (32-bit PROM) pass arguments and environment as 32-bit pointer.
30 * This macro take care of sign extension.
31 */
32#define prom_argv(index) ((char *)(((int *)(int)_prom_argv)[(index)]))
33
34char arcs_cmdline[CL_SIZE];
35
36char * __init prom_getcmdline(void)
37{
38 return &(arcs_cmdline[0]);
39}
40
41
42void __init prom_init_cmdline(void)
43{
44 char *cp;
45 int actr;
46
47 actr = 1; /* Always ignore argv[0] */
48
49 cp = &(arcs_cmdline[0]);
50 while(actr < prom_argc) {
51 strcpy(cp, prom_argv(actr));
52 cp += strlen(prom_argv(actr));
53 *cp++ = ' ';
54 actr++;
55 }
56 if (cp != &(arcs_cmdline[0])) /* get rid of trailing space */
57 --cp;
58 *cp = '\0';
59}
diff --git a/arch/mips/mips-boards/sim/sim_cmdline.c b/arch/mips/mips-boards/sim/sim_cmdline.c
index 9df37c6fca36..c63021a5dc6c 100644
--- a/arch/mips/mips-boards/sim/sim_cmdline.c
+++ b/arch/mips/mips-boards/sim/sim_cmdline.c
@@ -26,8 +26,10 @@ char * __init prom_getcmdline(void)
26 return arcs_cmdline; 26 return arcs_cmdline;
27} 27}
28 28
29
30void __init prom_init_cmdline(void) 29void __init prom_init_cmdline(void)
31{ 30{
32 /* nothing to do */ 31 char *cp;
32 cp = arcs_cmdline;
33 /* Get boot line from environment? */
34 *cp = '\0';
33} 35}
diff --git a/arch/mips/mips-boards/sim/sim_int.c b/arch/mips/mips-boards/sim/sim_int.c
index a4d0a2c05031..2c15c8efec4e 100644
--- a/arch/mips/mips-boards/sim/sim_int.c
+++ b/arch/mips/mips-boards/sim/sim_int.c
@@ -25,17 +25,71 @@
25 25
26extern void mips_cpu_irq_init(int); 26extern void mips_cpu_irq_init(int);
27 27
28extern asmlinkage void simIRQ(void); 28static inline int clz(unsigned long x)
29{
30 __asm__ (
31 " .set push \n"
32 " .set mips32 \n"
33 " clz %0, %1 \n"
34 " .set pop \n"
35 : "=r" (x)
36 : "r" (x));
37
38 return x;
39}
40
41/*
42 * Version of ffs that only looks at bits 12..15.
43 */
44static inline unsigned int irq_ffs(unsigned int pending)
45{
46#if defined(CONFIG_CPU_MIPS32) || defined(CONFIG_CPU_MIPS64)
47 return -clz(pending) + 31 - CAUSEB_IP;
48#else
49 unsigned int a0 = 7;
50 unsigned int t0;
51
52 t0 = s0 & 0xf000;
53 t0 = t0 < 1;
54 t0 = t0 << 2;
55 a0 = a0 - t0;
56 s0 = s0 << t0;
57
58 t0 = s0 & 0xc000;
59 t0 = t0 < 1;
60 t0 = t0 << 1;
61 a0 = a0 - t0;
62 s0 = s0 << t0;
29 63
30asmlinkage void sim_hw0_irqdispatch(struct pt_regs *regs) 64 t0 = s0 & 0x8000;
65 t0 = t0 < 1;
66 //t0 = t0 << 2;
67 a0 = a0 - t0;
68 //s0 = s0 << t0;
69
70 return a0;
71#endif
72}
73
74static inline void sim_hw0_irqdispatch(struct pt_regs *regs)
31{ 75{
32 do_IRQ(2, regs); 76 do_IRQ(2, regs);
33} 77}
34 78
35void __init arch_init_irq(void) 79asmlinkage void plat_irq_dispatch(struct pt_regs *regs)
36{ 80{
37 /* Now safe to set the exception vector. */ 81 unsigned int pending = read_c0_cause() & read_c0_status() & ST0_IM;
38 set_except_vector(0, simIRQ); 82 int irq;
83
84 irq = irq_ffs(pending);
39 85
86 if (irq > 0)
87 do_IRQ(MIPSCPU_INT_BASE + irq, regs);
88 else
89 spurious_interrupt(regs);
90}
91
92void __init arch_init_irq(void)
93{
40 mips_cpu_irq_init(MIPSCPU_INT_BASE); 94 mips_cpu_irq_init(MIPSCPU_INT_BASE);
41} 95}
diff --git a/arch/mips/mips-boards/sim/sim_irq.S b/arch/mips/mips-boards/sim/sim_irq.S
index da52297a2216..d16cf3822076 100644
--- a/arch/mips/mips-boards/sim/sim_irq.S
+++ b/arch/mips/mips-boards/sim/sim_irq.S
@@ -94,6 +94,8 @@
94 94
95 95
96spurious: 96spurious:
97 j spurious_interrupt 97 jal spurious_interrupt
98 nop
99 j ret_from_irq
98 nop 100 nop
99 END(simIRQ) 101 END(simIRQ)
diff --git a/arch/mips/mips-boards/sim/sim_mem.c b/arch/mips/mips-boards/sim/sim_mem.c
index e57f737bab10..f7ce76983328 100644
--- a/arch/mips/mips-boards/sim/sim_mem.c
+++ b/arch/mips/mips-boards/sim/sim_mem.c
@@ -18,9 +18,11 @@
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/mm.h> 19#include <linux/mm.h>
20#include <linux/bootmem.h> 20#include <linux/bootmem.h>
21#include <linux/pfn.h>
21 22
22#include <asm/bootinfo.h> 23#include <asm/bootinfo.h>
23#include <asm/page.h> 24#include <asm/page.h>
25#include <asm/sections.h>
24 26
25#include <asm/mips-boards/prom.h> 27#include <asm/mips-boards/prom.h>
26 28
@@ -39,9 +41,6 @@ static char *mtypes[3] = {
39}; 41};
40#endif 42#endif
41 43
42/* References to section boundaries */
43extern char _end;
44
45struct prom_pmemblock * __init prom_getmdesc(void) 44struct prom_pmemblock * __init prom_getmdesc(void)
46{ 45{
47 unsigned int memsize; 46 unsigned int memsize;
@@ -61,10 +60,10 @@ struct prom_pmemblock * __init prom_getmdesc(void)
61 60
62 mdesc[2].type = simmem_reserved; 61 mdesc[2].type = simmem_reserved;
63 mdesc[2].base = 0x00100000; 62 mdesc[2].base = 0x00100000;
64 mdesc[2].size = CPHYSADDR(PAGE_ALIGN(&_end)) - mdesc[2].base; 63 mdesc[2].size = CPHYSADDR(PFN_ALIGN(&_end)) - mdesc[2].base;
65 64
66 mdesc[3].type = simmem_free; 65 mdesc[3].type = simmem_free;
67 mdesc[3].base = CPHYSADDR(PAGE_ALIGN(&_end)); 66 mdesc[3].base = CPHYSADDR(PFN_ALIGN(&_end));
68 mdesc[3].size = memsize - mdesc[3].base; 67 mdesc[3].size = memsize - mdesc[3].base;
69 68
70 return &mdesc[0]; 69 return &mdesc[0];
diff --git a/arch/mips/mips-boards/sim/sim_smp.c b/arch/mips/mips-boards/sim/sim_smp.c
index a9f0c2bfe4ad..b7084e7c4bf9 100644
--- a/arch/mips/mips-boards/sim/sim_smp.c
+++ b/arch/mips/mips-boards/sim/sim_smp.c
@@ -44,8 +44,6 @@
44void core_send_ipi(int cpu, unsigned int action) 44void core_send_ipi(int cpu, unsigned int action)
45{ 45{
46#ifdef CONFIG_MIPS_MT_SMTC 46#ifdef CONFIG_MIPS_MT_SMTC
47 void smtc_send_ipi(int, int, unsigned int);
48
49 smtc_send_ipi(cpu, LINUX_SMP_IPI, action); 47 smtc_send_ipi(cpu, LINUX_SMP_IPI, action);
50#endif /* CONFIG_MIPS_MT_SMTC */ 48#endif /* CONFIG_MIPS_MT_SMTC */
51/* "CPU" may be TC of same VPE, VPE of same CPU, or different CPU */ 49/* "CPU" may be TC of same VPE, VPE of same CPU, or different CPU */
@@ -59,15 +57,8 @@ void core_send_ipi(int cpu, unsigned int action)
59void __init prom_build_cpu_map(void) 57void __init prom_build_cpu_map(void)
60{ 58{
61#ifdef CONFIG_MIPS_MT_SMTC 59#ifdef CONFIG_MIPS_MT_SMTC
62 extern int mipsmt_build_cpu_map(int startslot);
63 int nextslot; 60 int nextslot;
64 61
65 cpus_clear(phys_cpu_present_map);
66
67 /* Register the boot CPU */
68
69 smp_prepare_boot_cpu();
70
71 /* 62 /*
72 * As of November, 2004, MIPSsim only simulates one core 63 * As of November, 2004, MIPSsim only simulates one core
73 * at a time. However, that core may be a MIPS MT core 64 * at a time. However, that core may be a MIPS MT core
@@ -87,8 +78,6 @@ void __init prom_build_cpu_map(void)
87void prom_boot_secondary(int cpu, struct task_struct *idle) 78void prom_boot_secondary(int cpu, struct task_struct *idle)
88{ 79{
89#ifdef CONFIG_MIPS_MT_SMTC 80#ifdef CONFIG_MIPS_MT_SMTC
90 extern void smtc_boot_secondary(int cpu, struct task_struct *t);
91
92 smtc_boot_secondary(cpu, idle); 81 smtc_boot_secondary(cpu, idle);
93#endif /* CONFIG_MIPS_MT_SMTC */ 82#endif /* CONFIG_MIPS_MT_SMTC */
94} 83}
@@ -113,7 +102,6 @@ void prom_init_secondary(void)
113void prom_prepare_cpus(unsigned int max_cpus) 102void prom_prepare_cpus(unsigned int max_cpus)
114{ 103{
115#ifdef CONFIG_MIPS_MT_SMTC 104#ifdef CONFIG_MIPS_MT_SMTC
116 void mipsmt_prepare_cpus(int c);
117 /* 105 /*
118 * As noted above, we can assume a single CPU for now 106 * As noted above, we can assume a single CPU for now
119 * but it may be multithreaded. 107 * but it may be multithreaded.
@@ -132,8 +120,6 @@ void prom_prepare_cpus(unsigned int max_cpus)
132void prom_smp_finish(void) 120void prom_smp_finish(void)
133{ 121{
134#ifdef CONFIG_MIPS_MT_SMTC 122#ifdef CONFIG_MIPS_MT_SMTC
135 void smtc_smp_finish(void);
136
137 smtc_smp_finish(); 123 smtc_smp_finish();
138#endif /* CONFIG_MIPS_MT_SMTC */ 124#endif /* CONFIG_MIPS_MT_SMTC */
139} 125}
diff --git a/arch/mips/mm/c-r3k.c b/arch/mips/mm/c-r3k.c
index 9dd1352d5748..bb041a22f20a 100644
--- a/arch/mips/mm/c-r3k.c
+++ b/arch/mips/mm/c-r3k.c
@@ -260,6 +260,10 @@ static void r3k_flush_cache_page(struct vm_area_struct *vma, unsigned long page,
260{ 260{
261} 261}
262 262
263static void local_r3k_flush_data_cache_page(unsigned long addr)
264{
265}
266
263static void r3k_flush_data_cache_page(unsigned long addr) 267static void r3k_flush_data_cache_page(unsigned long addr)
264{ 268{
265} 269}
@@ -335,6 +339,7 @@ void __init r3k_cache_init(void)
335 flush_icache_range = r3k_flush_icache_range; 339 flush_icache_range = r3k_flush_icache_range;
336 340
337 flush_cache_sigtramp = r3k_flush_cache_sigtramp; 341 flush_cache_sigtramp = r3k_flush_cache_sigtramp;
342 local_flush_data_cache_page = local_r3k_flush_data_cache_page;
338 flush_data_cache_page = r3k_flush_data_cache_page; 343 flush_data_cache_page = r3k_flush_data_cache_page;
339 344
340 _dma_cache_wback_inv = r3k_dma_cache_wback_inv; 345 _dma_cache_wback_inv = r3k_dma_cache_wback_inv;
diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c
index 32b7f6aeb983..4a43924cd4fc 100644
--- a/arch/mips/mm/c-r4k.c
+++ b/arch/mips/mm/c-r4k.c
@@ -29,6 +29,27 @@
29#include <asm/war.h> 29#include <asm/war.h>
30#include <asm/cacheflush.h> /* for run_uncached() */ 30#include <asm/cacheflush.h> /* for run_uncached() */
31 31
32
33/*
34 * Special Variant of smp_call_function for use by cache functions:
35 *
36 * o No return value
37 * o collapses to normal function call on UP kernels
38 * o collapses to normal function call on systems with a single shared
39 * primary cache.
40 */
41static inline void r4k_on_each_cpu(void (*func) (void *info), void *info,
42 int retry, int wait)
43{
44 preempt_disable();
45
46#if !defined(CONFIG_MIPS_MT_SMP) && !defined(CONFIG_MIPS_MT_SMTC)
47 smp_call_function(func, info, retry, wait);
48#endif
49 func(info);
50 preempt_enable();
51}
52
32/* 53/*
33 * Must die. 54 * Must die.
34 */ 55 */
@@ -154,7 +175,8 @@ static inline void blast_icache32_r4600_v1_page_indexed(unsigned long page)
154 175
155static inline void tx49_blast_icache32_page_indexed(unsigned long page) 176static inline void tx49_blast_icache32_page_indexed(unsigned long page)
156{ 177{
157 unsigned long start = page; 178 unsigned long indexmask = current_cpu_data.icache.waysize - 1;
179 unsigned long start = INDEX_BASE + (page & indexmask);
158 unsigned long end = start + PAGE_SIZE; 180 unsigned long end = start + PAGE_SIZE;
159 unsigned long ws_inc = 1UL << current_cpu_data.icache.waybit; 181 unsigned long ws_inc = 1UL << current_cpu_data.icache.waybit;
160 unsigned long ws_end = current_cpu_data.icache.ways << 182 unsigned long ws_end = current_cpu_data.icache.ways <<
@@ -298,7 +320,7 @@ static void r4k_flush_cache_all(void)
298 if (!cpu_has_dc_aliases) 320 if (!cpu_has_dc_aliases)
299 return; 321 return;
300 322
301 on_each_cpu(local_r4k_flush_cache_all, NULL, 1, 1); 323 r4k_on_each_cpu(local_r4k_flush_cache_all, NULL, 1, 1);
302} 324}
303 325
304static inline void local_r4k___flush_cache_all(void * args) 326static inline void local_r4k___flush_cache_all(void * args)
@@ -313,13 +335,14 @@ static inline void local_r4k___flush_cache_all(void * args)
313 case CPU_R4400MC: 335 case CPU_R4400MC:
314 case CPU_R10000: 336 case CPU_R10000:
315 case CPU_R12000: 337 case CPU_R12000:
338 case CPU_R14000:
316 r4k_blast_scache(); 339 r4k_blast_scache();
317 } 340 }
318} 341}
319 342
320static void r4k___flush_cache_all(void) 343static void r4k___flush_cache_all(void)
321{ 344{
322 on_each_cpu(local_r4k___flush_cache_all, NULL, 1, 1); 345 r4k_on_each_cpu(local_r4k___flush_cache_all, NULL, 1, 1);
323} 346}
324 347
325static inline void local_r4k_flush_cache_range(void * args) 348static inline void local_r4k_flush_cache_range(void * args)
@@ -340,7 +363,7 @@ static inline void local_r4k_flush_cache_range(void * args)
340static void r4k_flush_cache_range(struct vm_area_struct *vma, 363static void r4k_flush_cache_range(struct vm_area_struct *vma,
341 unsigned long start, unsigned long end) 364 unsigned long start, unsigned long end)
342{ 365{
343 on_each_cpu(local_r4k_flush_cache_range, vma, 1, 1); 366 r4k_on_each_cpu(local_r4k_flush_cache_range, vma, 1, 1);
344} 367}
345 368
346static inline void local_r4k_flush_cache_mm(void * args) 369static inline void local_r4k_flush_cache_mm(void * args)
@@ -369,7 +392,7 @@ static void r4k_flush_cache_mm(struct mm_struct *mm)
369 if (!cpu_has_dc_aliases) 392 if (!cpu_has_dc_aliases)
370 return; 393 return;
371 394
372 on_each_cpu(local_r4k_flush_cache_mm, mm, 1, 1); 395 r4k_on_each_cpu(local_r4k_flush_cache_mm, mm, 1, 1);
373} 396}
374 397
375struct flush_cache_page_args { 398struct flush_cache_page_args {
@@ -460,7 +483,7 @@ static void r4k_flush_cache_page(struct vm_area_struct *vma,
460 args.addr = addr; 483 args.addr = addr;
461 args.pfn = pfn; 484 args.pfn = pfn;
462 485
463 on_each_cpu(local_r4k_flush_cache_page, &args, 1, 1); 486 r4k_on_each_cpu(local_r4k_flush_cache_page, &args, 1, 1);
464} 487}
465 488
466static inline void local_r4k_flush_data_cache_page(void * addr) 489static inline void local_r4k_flush_data_cache_page(void * addr)
@@ -470,7 +493,7 @@ static inline void local_r4k_flush_data_cache_page(void * addr)
470 493
471static void r4k_flush_data_cache_page(unsigned long addr) 494static void r4k_flush_data_cache_page(unsigned long addr)
472{ 495{
473 on_each_cpu(local_r4k_flush_data_cache_page, (void *) addr, 1, 1); 496 r4k_on_each_cpu(local_r4k_flush_data_cache_page, (void *) addr, 1, 1);
474} 497}
475 498
476struct flush_icache_range_args { 499struct flush_icache_range_args {
@@ -513,7 +536,7 @@ static void r4k_flush_icache_range(unsigned long start, unsigned long end)
513 args.start = start; 536 args.start = start;
514 args.end = end; 537 args.end = end;
515 538
516 on_each_cpu(local_r4k_flush_icache_range, &args, 1, 1); 539 r4k_on_each_cpu(local_r4k_flush_icache_range, &args, 1, 1);
517 instruction_hazard(); 540 instruction_hazard();
518} 541}
519 542
@@ -589,7 +612,7 @@ static void r4k_flush_icache_page(struct vm_area_struct *vma,
589 args.vma = vma; 612 args.vma = vma;
590 args.page = page; 613 args.page = page;
591 614
592 on_each_cpu(local_r4k_flush_icache_page, &args, 1, 1); 615 r4k_on_each_cpu(local_r4k_flush_icache_page, &args, 1, 1);
593} 616}
594 617
595 618
@@ -688,7 +711,7 @@ static void local_r4k_flush_cache_sigtramp(void * arg)
688 711
689static void r4k_flush_cache_sigtramp(unsigned long addr) 712static void r4k_flush_cache_sigtramp(unsigned long addr)
690{ 713{
691 on_each_cpu(local_r4k_flush_cache_sigtramp, (void *) addr, 1, 1); 714 r4k_on_each_cpu(local_r4k_flush_cache_sigtramp, (void *) addr, 1, 1);
692} 715}
693 716
694static void r4k_flush_icache_all(void) 717static void r4k_flush_icache_all(void)
@@ -749,12 +772,12 @@ static void __init probe_pcache(void)
749 icache_size = 1 << (12 + ((config & CONF_IC) >> 9)); 772 icache_size = 1 << (12 + ((config & CONF_IC) >> 9));
750 c->icache.linesz = 16 << ((config & CONF_IB) >> 5); 773 c->icache.linesz = 16 << ((config & CONF_IB) >> 5);
751 c->icache.ways = 2; 774 c->icache.ways = 2;
752 c->icache.waybit = ffs(icache_size/2) - 1; 775 c->icache.waybit = __ffs(icache_size/2);
753 776
754 dcache_size = 1 << (12 + ((config & CONF_DC) >> 6)); 777 dcache_size = 1 << (12 + ((config & CONF_DC) >> 6));
755 c->dcache.linesz = 16 << ((config & CONF_DB) >> 4); 778 c->dcache.linesz = 16 << ((config & CONF_DB) >> 4);
756 c->dcache.ways = 2; 779 c->dcache.ways = 2;
757 c->dcache.waybit= ffs(dcache_size/2) - 1; 780 c->dcache.waybit= __ffs(dcache_size/2);
758 781
759 c->options |= MIPS_CPU_CACHE_CDEX_P; 782 c->options |= MIPS_CPU_CACHE_CDEX_P;
760 break; 783 break;
@@ -811,6 +834,7 @@ static void __init probe_pcache(void)
811 834
812 case CPU_R10000: 835 case CPU_R10000:
813 case CPU_R12000: 836 case CPU_R12000:
837 case CPU_R14000:
814 icache_size = 1 << (12 + ((config & R10K_CONF_IC) >> 29)); 838 icache_size = 1 << (12 + ((config & R10K_CONF_IC) >> 29));
815 c->icache.linesz = 64; 839 c->icache.linesz = 64;
816 c->icache.ways = 2; 840 c->icache.ways = 2;
@@ -837,12 +861,12 @@ static void __init probe_pcache(void)
837 icache_size = 1 << (10 + ((config & CONF_IC) >> 9)); 861 icache_size = 1 << (10 + ((config & CONF_IC) >> 9));
838 c->icache.linesz = 16 << ((config & CONF_IB) >> 5); 862 c->icache.linesz = 16 << ((config & CONF_IB) >> 5);
839 c->icache.ways = 2; 863 c->icache.ways = 2;
840 c->icache.waybit = ffs(icache_size/2) - 1; 864 c->icache.waybit = __ffs(icache_size/2);
841 865
842 dcache_size = 1 << (10 + ((config & CONF_DC) >> 6)); 866 dcache_size = 1 << (10 + ((config & CONF_DC) >> 6));
843 c->dcache.linesz = 16 << ((config & CONF_DB) >> 4); 867 c->dcache.linesz = 16 << ((config & CONF_DB) >> 4);
844 c->dcache.ways = 2; 868 c->dcache.ways = 2;
845 c->dcache.waybit = ffs(dcache_size/2) - 1; 869 c->dcache.waybit = __ffs(dcache_size/2);
846 870
847 c->options |= MIPS_CPU_CACHE_CDEX_P; 871 c->options |= MIPS_CPU_CACHE_CDEX_P;
848 break; 872 break;
@@ -873,12 +897,12 @@ static void __init probe_pcache(void)
873 icache_size = 1 << (12 + ((config & CONF_IC) >> 9)); 897 icache_size = 1 << (12 + ((config & CONF_IC) >> 9));
874 c->icache.linesz = 16 << ((config & CONF_IB) >> 5); 898 c->icache.linesz = 16 << ((config & CONF_IB) >> 5);
875 c->icache.ways = 4; 899 c->icache.ways = 4;
876 c->icache.waybit = ffs(icache_size / c->icache.ways) - 1; 900 c->icache.waybit = __ffs(icache_size / c->icache.ways);
877 901
878 dcache_size = 1 << (12 + ((config & CONF_DC) >> 6)); 902 dcache_size = 1 << (12 + ((config & CONF_DC) >> 6));
879 c->dcache.linesz = 16 << ((config & CONF_DB) >> 4); 903 c->dcache.linesz = 16 << ((config & CONF_DB) >> 4);
880 c->dcache.ways = 4; 904 c->dcache.ways = 4;
881 c->dcache.waybit = ffs(dcache_size / c->dcache.ways) - 1; 905 c->dcache.waybit = __ffs(dcache_size / c->dcache.ways);
882 906
883#if !defined(CONFIG_SMP) || !defined(RM9000_CDEX_SMP_WAR) 907#if !defined(CONFIG_SMP) || !defined(RM9000_CDEX_SMP_WAR)
884 c->options |= MIPS_CPU_CACHE_CDEX_P; 908 c->options |= MIPS_CPU_CACHE_CDEX_P;
@@ -906,7 +930,7 @@ static void __init probe_pcache(void)
906 icache_size = c->icache.sets * 930 icache_size = c->icache.sets *
907 c->icache.ways * 931 c->icache.ways *
908 c->icache.linesz; 932 c->icache.linesz;
909 c->icache.waybit = ffs(icache_size/c->icache.ways) - 1; 933 c->icache.waybit = __ffs(icache_size/c->icache.ways);
910 934
911 if (config & 0x8) /* VI bit */ 935 if (config & 0x8) /* VI bit */
912 c->icache.flags |= MIPS_CACHE_VTAG; 936 c->icache.flags |= MIPS_CACHE_VTAG;
@@ -926,7 +950,7 @@ static void __init probe_pcache(void)
926 dcache_size = c->dcache.sets * 950 dcache_size = c->dcache.sets *
927 c->dcache.ways * 951 c->dcache.ways *
928 c->dcache.linesz; 952 c->dcache.linesz;
929 c->dcache.waybit = ffs(dcache_size/c->dcache.ways) - 1; 953 c->dcache.waybit = __ffs(dcache_size/c->dcache.ways);
930 954
931 c->options |= MIPS_CPU_PREFETCH; 955 c->options |= MIPS_CPU_PREFETCH;
932 break; 956 break;
@@ -964,9 +988,11 @@ static void __init probe_pcache(void)
964 c->dcache.flags |= MIPS_CACHE_PINDEX; 988 c->dcache.flags |= MIPS_CACHE_PINDEX;
965 case CPU_R10000: 989 case CPU_R10000:
966 case CPU_R12000: 990 case CPU_R12000:
991 case CPU_R14000:
967 case CPU_SB1: 992 case CPU_SB1:
968 break; 993 break;
969 case CPU_24K: 994 case CPU_24K:
995 case CPU_34K:
970 if (!(read_c0_config7() & (1 << 16))) 996 if (!(read_c0_config7() & (1 << 16)))
971 default: 997 default:
972 if (c->dcache.waysize > PAGE_SIZE) 998 if (c->dcache.waysize > PAGE_SIZE)
@@ -1090,6 +1116,7 @@ static void __init setup_scache(void)
1090 1116
1091 case CPU_R10000: 1117 case CPU_R10000:
1092 case CPU_R12000: 1118 case CPU_R12000:
1119 case CPU_R14000:
1093 scache_size = 0x80000 << ((config & R10K_CONF_SS) >> 16); 1120 scache_size = 0x80000 << ((config & R10K_CONF_SS) >> 16);
1094 c->scache.linesz = 64 << ((config >> 13) & 1); 1121 c->scache.linesz = 64 << ((config >> 13) & 1);
1095 c->scache.ways = 2; 1122 c->scache.ways = 2;
@@ -1134,6 +1161,31 @@ static void __init setup_scache(void)
1134 c->options |= MIPS_CPU_SUBSET_CACHES; 1161 c->options |= MIPS_CPU_SUBSET_CACHES;
1135} 1162}
1136 1163
1164void au1x00_fixup_config_od(void)
1165{
1166 /*
1167 * c0_config.od (bit 19) was write only (and read as 0)
1168 * on the early revisions of Alchemy SOCs. It disables the bus
1169 * transaction overlapping and needs to be set to fix various errata.
1170 */
1171 switch (read_c0_prid()) {
1172 case 0x00030100: /* Au1000 DA */
1173 case 0x00030201: /* Au1000 HA */
1174 case 0x00030202: /* Au1000 HB */
1175 case 0x01030200: /* Au1500 AB */
1176 /*
1177 * Au1100 errata actually keeps silence about this bit, so we set it
1178 * just in case for those revisions that require it to be set according
1179 * to arch/mips/au1000/common/cputable.c
1180 */
1181 case 0x02030200: /* Au1100 AB */
1182 case 0x02030201: /* Au1100 BA */
1183 case 0x02030202: /* Au1100 BC */
1184 set_c0_config(1 << 19);
1185 break;
1186 }
1187}
1188
1137static inline void coherency_setup(void) 1189static inline void coherency_setup(void)
1138{ 1190{
1139 change_c0_config(CONF_CM_CMASK, CONF_CM_DEFAULT); 1191 change_c0_config(CONF_CM_CMASK, CONF_CM_DEFAULT);
@@ -1154,6 +1206,15 @@ static inline void coherency_setup(void)
1154 case CPU_R4400MC: 1206 case CPU_R4400MC:
1155 clear_c0_config(CONF_CU); 1207 clear_c0_config(CONF_CU);
1156 break; 1208 break;
1209 /*
1210 * We need to catch the ealry Alchemy SOCs with
1211 * the write-only co_config.od bit and set it back to one...
1212 */
1213 case CPU_AU1000: /* rev. DA, HA, HB */
1214 case CPU_AU1100: /* rev. AB, BA, BC ?? */
1215 case CPU_AU1500: /* rev. AB */
1216 au1x00_fixup_config_od();
1217 break;
1157 } 1218 }
1158} 1219}
1159 1220
@@ -1198,6 +1259,7 @@ void __init r4k_cache_init(void)
1198 1259
1199 flush_cache_sigtramp = r4k_flush_cache_sigtramp; 1260 flush_cache_sigtramp = r4k_flush_cache_sigtramp;
1200 flush_icache_all = r4k_flush_icache_all; 1261 flush_icache_all = r4k_flush_icache_all;
1262 local_flush_data_cache_page = local_r4k_flush_data_cache_page;
1201 flush_data_cache_page = r4k_flush_data_cache_page; 1263 flush_data_cache_page = r4k_flush_data_cache_page;
1202 flush_icache_range = r4k_flush_icache_range; 1264 flush_icache_range = r4k_flush_icache_range;
1203 1265
diff --git a/arch/mips/mm/c-sb1.c b/arch/mips/mm/c-sb1.c
index 2f08b535f20e..f9b129491b1e 100644
--- a/arch/mips/mm/c-sb1.c
+++ b/arch/mips/mm/c-sb1.c
@@ -528,6 +528,7 @@ void sb1_cache_init(void)
528 flush_cache_page = sb1_flush_cache_page; 528 flush_cache_page = sb1_flush_cache_page;
529 529
530 flush_cache_sigtramp = sb1_flush_cache_sigtramp; 530 flush_cache_sigtramp = sb1_flush_cache_sigtramp;
531 local_flush_data_cache_page = (void *) sb1_nop;
531 flush_data_cache_page = (void *) sb1_nop; 532 flush_data_cache_page = (void *) sb1_nop;
532 533
533 /* Full flush */ 534 /* Full flush */
diff --git a/arch/mips/mm/c-tx39.c b/arch/mips/mm/c-tx39.c
index fe232e3988e3..5dfc9b1901f6 100644
--- a/arch/mips/mm/c-tx39.c
+++ b/arch/mips/mm/c-tx39.c
@@ -216,6 +216,11 @@ static void tx39_flush_cache_page(struct vm_area_struct *vma, unsigned long page
216 tx39_blast_icache_page_indexed(page); 216 tx39_blast_icache_page_indexed(page);
217} 217}
218 218
219static void local_tx39_flush_data_cache_page(void * addr)
220{
221 tx39_blast_dcache_page(addr);
222}
223
219static void tx39_flush_data_cache_page(unsigned long addr) 224static void tx39_flush_data_cache_page(unsigned long addr)
220{ 225{
221 tx39_blast_dcache_page(addr); 226 tx39_blast_dcache_page(addr);
@@ -381,6 +386,7 @@ void __init tx39_cache_init(void)
381 flush_icache_range = (void *) tx39h_flush_icache_all; 386 flush_icache_range = (void *) tx39h_flush_icache_all;
382 387
383 flush_cache_sigtramp = (void *) tx39h_flush_icache_all; 388 flush_cache_sigtramp = (void *) tx39h_flush_icache_all;
389 local_flush_data_cache_page = (void *) tx39h_flush_icache_all;
384 flush_data_cache_page = (void *) tx39h_flush_icache_all; 390 flush_data_cache_page = (void *) tx39h_flush_icache_all;
385 391
386 _dma_cache_wback_inv = tx39h_dma_cache_wback_inv; 392 _dma_cache_wback_inv = tx39h_dma_cache_wback_inv;
@@ -406,6 +412,7 @@ void __init tx39_cache_init(void)
406 flush_icache_range = tx39_flush_icache_range; 412 flush_icache_range = tx39_flush_icache_range;
407 413
408 flush_cache_sigtramp = tx39_flush_cache_sigtramp; 414 flush_cache_sigtramp = tx39_flush_cache_sigtramp;
415 local_flush_data_cache_page = local_tx39_flush_data_cache_page;
409 flush_data_cache_page = tx39_flush_data_cache_page; 416 flush_data_cache_page = tx39_flush_data_cache_page;
410 417
411 _dma_cache_wback_inv = tx39_dma_cache_wback_inv; 418 _dma_cache_wback_inv = tx39_dma_cache_wback_inv;
diff --git a/arch/mips/mm/cache.c b/arch/mips/mm/cache.c
index 591c22b080e4..83a56296be86 100644
--- a/arch/mips/mm/cache.c
+++ b/arch/mips/mm/cache.c
@@ -30,6 +30,7 @@ void (*flush_icache_page)(struct vm_area_struct *vma, struct page *page);
30 30
31/* MIPS specific cache operations */ 31/* MIPS specific cache operations */
32void (*flush_cache_sigtramp)(unsigned long addr); 32void (*flush_cache_sigtramp)(unsigned long addr);
33void (*local_flush_data_cache_page)(void * addr);
33void (*flush_data_cache_page)(unsigned long addr); 34void (*flush_data_cache_page)(unsigned long addr);
34void (*flush_icache_all)(void); 35void (*flush_icache_all)(void);
35 36
diff --git a/arch/mips/mm/fault.c b/arch/mips/mm/fault.c
index 2d9624fd10ec..e3a617224868 100644
--- a/arch/mips/mm/fault.c
+++ b/arch/mips/mm/fault.c
@@ -157,7 +157,6 @@ no_context:
157 * Oops. The kernel tried to access some bad page. We'll have to 157 * Oops. The kernel tried to access some bad page. We'll have to
158 * terminate things with extreme prejudice. 158 * terminate things with extreme prejudice.
159 */ 159 */
160
161 bust_spinlocks(1); 160 bust_spinlocks(1);
162 161
163 printk(KERN_ALERT "CPU %d Unable to handle kernel paging request at " 162 printk(KERN_ALERT "CPU %d Unable to handle kernel paging request at "
@@ -188,11 +187,20 @@ do_sigbus:
188 /* Kernel mode? Handle exceptions or die */ 187 /* Kernel mode? Handle exceptions or die */
189 if (!user_mode(regs)) 188 if (!user_mode(regs))
190 goto no_context; 189 goto no_context;
191 190 else
192 /* 191 /*
193 * Send a sigbus, regardless of whether we were in kernel 192 * Send a sigbus, regardless of whether we were in kernel
194 * or user mode. 193 * or user mode.
195 */ 194 */
195#if 0
196 printk("do_page_fault() #3: sending SIGBUS to %s for "
197 "invalid %s\n%0*lx (epc == %0*lx, ra == %0*lx)\n",
198 tsk->comm,
199 write ? "write access to" : "read access from",
200 field, address,
201 field, (unsigned long) regs->cp0_epc,
202 field, (unsigned long) regs->regs[31]);
203#endif
196 tsk->thread.cp0_badvaddr = address; 204 tsk->thread.cp0_badvaddr = address;
197 info.si_signo = SIGBUS; 205 info.si_signo = SIGBUS;
198 info.si_errno = 0; 206 info.si_errno = 0;
@@ -201,7 +209,6 @@ do_sigbus:
201 force_sig_info(SIGBUS, &info, tsk); 209 force_sig_info(SIGBUS, &info, tsk);
202 210
203 return; 211 return;
204
205vmalloc_fault: 212vmalloc_fault:
206 { 213 {
207 /* 214 /*
diff --git a/arch/mips/mm/highmem.c b/arch/mips/mm/highmem.c
index 1f7b37b38f5c..0c544375b856 100644
--- a/arch/mips/mm/highmem.c
+++ b/arch/mips/mm/highmem.c
@@ -83,6 +83,7 @@ void __kunmap_atomic(void *kvaddr, enum km_type type)
83 preempt_check_resched(); 83 preempt_check_resched();
84} 84}
85 85
86#ifndef CONFIG_LIMITED_DMA
86/* 87/*
87 * This is the same as kmap_atomic() but can map memory that doesn't 88 * This is the same as kmap_atomic() but can map memory that doesn't
88 * have a struct page associated with it. 89 * have a struct page associated with it.
@@ -101,6 +102,7 @@ void *kmap_atomic_pfn(unsigned long pfn, enum km_type type)
101 102
102 return (void*) vaddr; 103 return (void*) vaddr;
103} 104}
105#endif /* CONFIG_LIMITED_DMA */
104 106
105struct page *__kmap_atomic_to_page(void *ptr) 107struct page *__kmap_atomic_to_page(void *ptr)
106{ 108{
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
index ad89c442f299..33f6e1cdfd5b 100644
--- a/arch/mips/mm/init.c
+++ b/arch/mips/mm/init.c
@@ -227,7 +227,7 @@ void __init mem_init(void)
227 for (tmp = 0; tmp < max_low_pfn; tmp++) 227 for (tmp = 0; tmp < max_low_pfn; tmp++)
228 if (page_is_ram(tmp)) { 228 if (page_is_ram(tmp)) {
229 ram++; 229 ram++;
230 if (PageReserved(mem_map+tmp)) 230 if (PageReserved(pfn_to_page(tmp)))
231 reservedpages++; 231 reservedpages++;
232 } 232 }
233 233
@@ -276,6 +276,20 @@ void __init mem_init(void)
276} 276}
277#endif /* !CONFIG_NEED_MULTIPLE_NODES */ 277#endif /* !CONFIG_NEED_MULTIPLE_NODES */
278 278
279void free_init_pages(char *what, unsigned long begin, unsigned long end)
280{
281 unsigned long addr;
282
283 for (addr = begin; addr < end; addr += PAGE_SIZE) {
284 ClearPageReserved(virt_to_page(addr));
285 init_page_count(virt_to_page(addr));
286 memset((void *)addr, 0xcc, PAGE_SIZE);
287 free_page(addr);
288 totalram_pages++;
289 }
290 printk(KERN_INFO "Freeing %s: %ldk freed\n", what, (end - begin) >> 10);
291}
292
279#ifdef CONFIG_BLK_DEV_INITRD 293#ifdef CONFIG_BLK_DEV_INITRD
280void free_initrd_mem(unsigned long start, unsigned long end) 294void free_initrd_mem(unsigned long start, unsigned long end)
281{ 295{
@@ -284,16 +298,7 @@ void free_initrd_mem(unsigned long start, unsigned long end)
284 start = (unsigned long)phys_to_virt(CPHYSADDR(start)); 298 start = (unsigned long)phys_to_virt(CPHYSADDR(start));
285 end = (unsigned long)phys_to_virt(CPHYSADDR(end)); 299 end = (unsigned long)phys_to_virt(CPHYSADDR(end));
286#endif 300#endif
287 if (start < end) 301 free_init_pages("initrd memory", start, end);
288 printk(KERN_INFO "Freeing initrd memory: %ldk freed\n",
289 (end - start) >> 10);
290
291 for (; start < end; start += PAGE_SIZE) {
292 ClearPageReserved(virt_to_page(start));
293 init_page_count(virt_to_page(start));
294 free_page(start);
295 totalram_pages++;
296 }
297} 302}
298#endif 303#endif
299 304
@@ -301,24 +306,17 @@ extern unsigned long prom_free_prom_memory(void);
301 306
302void free_initmem(void) 307void free_initmem(void)
303{ 308{
304 unsigned long addr, page, freed; 309 unsigned long start, end, freed;
305 310
306 freed = prom_free_prom_memory(); 311 freed = prom_free_prom_memory();
312 if (freed)
313 printk(KERN_INFO "Freeing firmware memory: %ldk freed\n",freed);
307 314
308 addr = (unsigned long) &__init_begin; 315 start = (unsigned long)(&__init_begin);
309 while (addr < (unsigned long) &__init_end) { 316 end = (unsigned long)(&__init_end);
310#ifdef CONFIG_64BIT 317#ifdef CONFIG_64BIT
311 page = PAGE_OFFSET | CPHYSADDR(addr); 318 start = PAGE_OFFSET | CPHYSADDR(start);
312#else 319 end = PAGE_OFFSET | CPHYSADDR(end);
313 page = addr;
314#endif 320#endif
315 ClearPageReserved(virt_to_page(page)); 321 free_init_pages("unused kernel memory", start, end);
316 init_page_count(virt_to_page(page));
317 free_page(page);
318 totalram_pages++;
319 freed += PAGE_SIZE;
320 addr += PAGE_SIZE;
321 }
322 printk(KERN_INFO "Freeing unused kernel memory: %ldk freed\n",
323 freed >> 10);
324} 322}
diff --git a/arch/mips/mm/pg-r4k.c b/arch/mips/mm/pg-r4k.c
index e4390dc3eb48..b7c749232ffe 100644
--- a/arch/mips/mm/pg-r4k.c
+++ b/arch/mips/mm/pg-r4k.c
@@ -357,6 +357,7 @@ void __init build_clear_page(void)
357 357
358 case CPU_R10000: 358 case CPU_R10000:
359 case CPU_R12000: 359 case CPU_R12000:
360 case CPU_R14000:
360 pref_src_mode = Pref_LoadStreamed; 361 pref_src_mode = Pref_LoadStreamed;
361 pref_dst_mode = Pref_StoreStreamed; 362 pref_dst_mode = Pref_StoreStreamed;
362 break; 363 break;
diff --git a/arch/mips/mm/sc-rm7k.c b/arch/mips/mm/sc-rm7k.c
index 3b6cc9ba1b05..31ec73052423 100644
--- a/arch/mips/mm/sc-rm7k.c
+++ b/arch/mips/mm/sc-rm7k.c
@@ -138,7 +138,7 @@ void __init rm7k_sc_init(void)
138 138
139 c->scache.linesz = sc_lsize; 139 c->scache.linesz = sc_lsize;
140 c->scache.ways = 4; 140 c->scache.ways = 4;
141 c->scache.waybit= ffs(scache_size / c->scache.ways) - 1; 141 c->scache.waybit= __ffs(scache_size / c->scache.ways);
142 c->scache.waysize = scache_size / c->scache.ways; 142 c->scache.waysize = scache_size / c->scache.ways;
143 c->scache.sets = scache_size / (c->scache.linesz * c->scache.ways); 143 c->scache.sets = scache_size / (c->scache.linesz * c->scache.ways);
144 printk(KERN_INFO "Secondary cache size %dK, linesize %d bytes.\n", 144 printk(KERN_INFO "Secondary cache size %dK, linesize %d bytes.\n",
diff --git a/arch/mips/mm/tlb-r4k.c b/arch/mips/mm/tlb-r4k.c
index a865f2394cb0..9dca099ba16b 100644
--- a/arch/mips/mm/tlb-r4k.c
+++ b/arch/mips/mm/tlb-r4k.c
@@ -32,13 +32,35 @@ extern void build_tlb_refill_handler(void);
32 "nop; nop; nop; nop; nop; nop;\n\t" \ 32 "nop; nop; nop; nop; nop; nop;\n\t" \
33 ".set reorder\n\t") 33 ".set reorder\n\t")
34 34
35/* Atomicity and interruptability */
36#ifdef CONFIG_MIPS_MT_SMTC
37
38#include <asm/smtc.h>
39#include <asm/mipsmtregs.h>
40
41#define ENTER_CRITICAL(flags) \
42 { \
43 unsigned int mvpflags; \
44 local_irq_save(flags);\
45 mvpflags = dvpe()
46#define EXIT_CRITICAL(flags) \
47 evpe(mvpflags); \
48 local_irq_restore(flags); \
49 }
50#else
51
52#define ENTER_CRITICAL(flags) local_irq_save(flags)
53#define EXIT_CRITICAL(flags) local_irq_restore(flags)
54
55#endif /* CONFIG_MIPS_MT_SMTC */
56
35void local_flush_tlb_all(void) 57void local_flush_tlb_all(void)
36{ 58{
37 unsigned long flags; 59 unsigned long flags;
38 unsigned long old_ctx; 60 unsigned long old_ctx;
39 int entry; 61 int entry;
40 62
41 local_irq_save(flags); 63 ENTER_CRITICAL(flags);
42 /* Save old context and create impossible VPN2 value */ 64 /* Save old context and create impossible VPN2 value */
43 old_ctx = read_c0_entryhi(); 65 old_ctx = read_c0_entryhi();
44 write_c0_entrylo0(0); 66 write_c0_entrylo0(0);
@@ -57,7 +79,7 @@ void local_flush_tlb_all(void)
57 } 79 }
58 tlbw_use_hazard(); 80 tlbw_use_hazard();
59 write_c0_entryhi(old_ctx); 81 write_c0_entryhi(old_ctx);
60 local_irq_restore(flags); 82 EXIT_CRITICAL(flags);
61} 83}
62 84
63/* All entries common to a mm share an asid. To effectively flush 85/* All entries common to a mm share an asid. To effectively flush
@@ -87,6 +109,7 @@ void local_flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
87 unsigned long flags; 109 unsigned long flags;
88 int size; 110 int size;
89 111
112 ENTER_CRITICAL(flags);
90 size = (end - start + (PAGE_SIZE - 1)) >> PAGE_SHIFT; 113 size = (end - start + (PAGE_SIZE - 1)) >> PAGE_SHIFT;
91 size = (size + 1) >> 1; 114 size = (size + 1) >> 1;
92 local_irq_save(flags); 115 local_irq_save(flags);
@@ -120,7 +143,7 @@ void local_flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
120 } else { 143 } else {
121 drop_mmu_context(mm, cpu); 144 drop_mmu_context(mm, cpu);
122 } 145 }
123 local_irq_restore(flags); 146 EXIT_CRITICAL(flags);
124 } 147 }
125} 148}
126 149
@@ -129,9 +152,9 @@ void local_flush_tlb_kernel_range(unsigned long start, unsigned long end)
129 unsigned long flags; 152 unsigned long flags;
130 int size; 153 int size;
131 154
155 ENTER_CRITICAL(flags);
132 size = (end - start + (PAGE_SIZE - 1)) >> PAGE_SHIFT; 156 size = (end - start + (PAGE_SIZE - 1)) >> PAGE_SHIFT;
133 size = (size + 1) >> 1; 157 size = (size + 1) >> 1;
134 local_irq_save(flags);
135 if (size <= current_cpu_data.tlbsize / 2) { 158 if (size <= current_cpu_data.tlbsize / 2) {
136 int pid = read_c0_entryhi(); 159 int pid = read_c0_entryhi();
137 160
@@ -162,7 +185,7 @@ void local_flush_tlb_kernel_range(unsigned long start, unsigned long end)
162 } else { 185 } else {
163 local_flush_tlb_all(); 186 local_flush_tlb_all();
164 } 187 }
165 local_irq_restore(flags); 188 EXIT_CRITICAL(flags);
166} 189}
167 190
168void local_flush_tlb_page(struct vm_area_struct *vma, unsigned long page) 191void local_flush_tlb_page(struct vm_area_struct *vma, unsigned long page)
@@ -175,7 +198,7 @@ void local_flush_tlb_page(struct vm_area_struct *vma, unsigned long page)
175 198
176 newpid = cpu_asid(cpu, vma->vm_mm); 199 newpid = cpu_asid(cpu, vma->vm_mm);
177 page &= (PAGE_MASK << 1); 200 page &= (PAGE_MASK << 1);
178 local_irq_save(flags); 201 ENTER_CRITICAL(flags);
179 oldpid = read_c0_entryhi(); 202 oldpid = read_c0_entryhi();
180 write_c0_entryhi(page | newpid); 203 write_c0_entryhi(page | newpid);
181 mtc0_tlbw_hazard(); 204 mtc0_tlbw_hazard();
@@ -194,7 +217,7 @@ void local_flush_tlb_page(struct vm_area_struct *vma, unsigned long page)
194 217
195 finish: 218 finish:
196 write_c0_entryhi(oldpid); 219 write_c0_entryhi(oldpid);
197 local_irq_restore(flags); 220 EXIT_CRITICAL(flags);
198 } 221 }
199} 222}
200 223
@@ -207,7 +230,7 @@ void local_flush_tlb_one(unsigned long page)
207 unsigned long flags; 230 unsigned long flags;
208 int oldpid, idx; 231 int oldpid, idx;
209 232
210 local_irq_save(flags); 233 ENTER_CRITICAL(flags);
211 oldpid = read_c0_entryhi(); 234 oldpid = read_c0_entryhi();
212 page &= (PAGE_MASK << 1); 235 page &= (PAGE_MASK << 1);
213 write_c0_entryhi(page); 236 write_c0_entryhi(page);
@@ -226,7 +249,7 @@ void local_flush_tlb_one(unsigned long page)
226 } 249 }
227 write_c0_entryhi(oldpid); 250 write_c0_entryhi(oldpid);
228 251
229 local_irq_restore(flags); 252 EXIT_CRITICAL(flags);
230} 253}
231 254
232/* 255/*
@@ -249,7 +272,7 @@ void __update_tlb(struct vm_area_struct * vma, unsigned long address, pte_t pte)
249 if (current->active_mm != vma->vm_mm) 272 if (current->active_mm != vma->vm_mm)
250 return; 273 return;
251 274
252 local_irq_save(flags); 275 ENTER_CRITICAL(flags);
253 276
254 pid = read_c0_entryhi() & ASID_MASK; 277 pid = read_c0_entryhi() & ASID_MASK;
255 address &= (PAGE_MASK << 1); 278 address &= (PAGE_MASK << 1);
@@ -277,7 +300,7 @@ void __update_tlb(struct vm_area_struct * vma, unsigned long address, pte_t pte)
277 else 300 else
278 tlb_write_indexed(); 301 tlb_write_indexed();
279 tlbw_use_hazard(); 302 tlbw_use_hazard();
280 local_irq_restore(flags); 303 EXIT_CRITICAL(flags);
281} 304}
282 305
283#if 0 306#if 0
@@ -291,7 +314,7 @@ static void r4k_update_mmu_cache_hwbug(struct vm_area_struct * vma,
291 pte_t *ptep; 314 pte_t *ptep;
292 int idx; 315 int idx;
293 316
294 local_irq_save(flags); 317 ENTER_CRITICAL(flags);
295 address &= (PAGE_MASK << 1); 318 address &= (PAGE_MASK << 1);
296 asid = read_c0_entryhi() & ASID_MASK; 319 asid = read_c0_entryhi() & ASID_MASK;
297 write_c0_entryhi(address | asid); 320 write_c0_entryhi(address | asid);
@@ -310,7 +333,7 @@ static void r4k_update_mmu_cache_hwbug(struct vm_area_struct * vma,
310 else 333 else
311 tlb_write_indexed(); 334 tlb_write_indexed();
312 tlbw_use_hazard(); 335 tlbw_use_hazard();
313 local_irq_restore(flags); 336 EXIT_CRITICAL(flags);
314} 337}
315#endif 338#endif
316 339
@@ -322,7 +345,7 @@ void __init add_wired_entry(unsigned long entrylo0, unsigned long entrylo1,
322 unsigned long old_pagemask; 345 unsigned long old_pagemask;
323 unsigned long old_ctx; 346 unsigned long old_ctx;
324 347
325 local_irq_save(flags); 348 ENTER_CRITICAL(flags);
326 /* Save old context and create impossible VPN2 value */ 349 /* Save old context and create impossible VPN2 value */
327 old_ctx = read_c0_entryhi(); 350 old_ctx = read_c0_entryhi();
328 old_pagemask = read_c0_pagemask(); 351 old_pagemask = read_c0_pagemask();
@@ -342,7 +365,7 @@ void __init add_wired_entry(unsigned long entrylo0, unsigned long entrylo1,
342 BARRIER; 365 BARRIER;
343 write_c0_pagemask(old_pagemask); 366 write_c0_pagemask(old_pagemask);
344 local_flush_tlb_all(); 367 local_flush_tlb_all();
345 local_irq_restore(flags); 368 EXIT_CRITICAL(flags);
346} 369}
347 370
348/* 371/*
@@ -362,7 +385,7 @@ __init int add_temporary_entry(unsigned long entrylo0, unsigned long entrylo1,
362 unsigned long old_pagemask; 385 unsigned long old_pagemask;
363 unsigned long old_ctx; 386 unsigned long old_ctx;
364 387
365 local_irq_save(flags); 388 ENTER_CRITICAL(flags);
366 /* Save old context and create impossible VPN2 value */ 389 /* Save old context and create impossible VPN2 value */
367 old_ctx = read_c0_entryhi(); 390 old_ctx = read_c0_entryhi();
368 old_pagemask = read_c0_pagemask(); 391 old_pagemask = read_c0_pagemask();
@@ -386,10 +409,11 @@ __init int add_temporary_entry(unsigned long entrylo0, unsigned long entrylo1,
386 write_c0_entryhi(old_ctx); 409 write_c0_entryhi(old_ctx);
387 write_c0_pagemask(old_pagemask); 410 write_c0_pagemask(old_pagemask);
388out: 411out:
389 local_irq_restore(flags); 412 EXIT_CRITICAL(flags);
390 return ret; 413 return ret;
391} 414}
392 415
416extern void __init sanitize_tlb_entries(void);
393static void __init probe_tlb(unsigned long config) 417static void __init probe_tlb(unsigned long config)
394{ 418{
395 struct cpuinfo_mips *c = &current_cpu_data; 419 struct cpuinfo_mips *c = &current_cpu_data;
@@ -402,6 +426,14 @@ static void __init probe_tlb(unsigned long config)
402 */ 426 */
403 if ((c->processor_id & 0xff0000) == PRID_COMP_LEGACY) 427 if ((c->processor_id & 0xff0000) == PRID_COMP_LEGACY)
404 return; 428 return;
429#ifdef CONFIG_MIPS_MT_SMTC
430 /*
431 * If TLB is shared in SMTC system, total size already
432 * has been calculated and written into cpu_data tlbsize
433 */
434 if((smtc_status & SMTC_TLB_SHARED) == SMTC_TLB_SHARED)
435 return;
436#endif /* CONFIG_MIPS_MT_SMTC */
405 437
406 reg = read_c0_config1(); 438 reg = read_c0_config1();
407 if (!((config >> 7) & 3)) 439 if (!((config >> 7) & 3))
@@ -410,6 +442,15 @@ static void __init probe_tlb(unsigned long config)
410 c->tlbsize = ((reg >> 25) & 0x3f) + 1; 442 c->tlbsize = ((reg >> 25) & 0x3f) + 1;
411} 443}
412 444
445static int __initdata ntlb = 0;
446static int __init set_ntlb(char *str)
447{
448 get_option(&str, &ntlb);
449 return 1;
450}
451
452__setup("ntlb=", set_ntlb);
453
413void __init tlb_init(void) 454void __init tlb_init(void)
414{ 455{
415 unsigned int config = read_c0_config(); 456 unsigned int config = read_c0_config();
@@ -432,5 +473,15 @@ void __init tlb_init(void)
432 473
433 /* Did I tell you that ARC SUCKS? */ 474 /* Did I tell you that ARC SUCKS? */
434 475
476 if (ntlb) {
477 if (ntlb > 1 && ntlb <= current_cpu_data.tlbsize) {
478 int wired = current_cpu_data.tlbsize - ntlb;
479 write_c0_wired(wired);
480 write_c0_index(wired-1);
481 printk ("Restricting TLB to %d entries\n", ntlb);
482 } else
483 printk("Ignoring invalid argument ntlb=%d\n", ntlb);
484 }
485
435 build_tlb_refill_handler(); 486 build_tlb_refill_handler();
436} 487}
diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
index 599b3c297186..54507be2ab5b 100644
--- a/arch/mips/mm/tlbex.c
+++ b/arch/mips/mm/tlbex.c
@@ -7,6 +7,16 @@
7 * 7 *
8 * Copyright (C) 2004,2005 by Thiemo Seufer 8 * Copyright (C) 2004,2005 by Thiemo Seufer
9 * Copyright (C) 2005 Maciej W. Rozycki 9 * Copyright (C) 2005 Maciej W. Rozycki
10 * Copyright (C) 2006 Ralf Baechle (ralf@linux-mips.org)
11 *
12 * ... and the days got worse and worse and now you see
13 * I've gone completly out of my mind.
14 *
15 * They're coming to take me a away haha
16 * they're coming to take me a away hoho hihi haha
17 * to the funny farm where code is beautiful all the time ...
18 *
19 * (Condolences to Napoleon XIV)
10 */ 20 */
11 21
12#include <stdarg.h> 22#include <stdarg.h>
@@ -68,6 +78,7 @@ enum fields
68 BIMM = 0x040, 78 BIMM = 0x040,
69 JIMM = 0x080, 79 JIMM = 0x080,
70 FUNC = 0x100, 80 FUNC = 0x100,
81 SET = 0x200
71}; 82};
72 83
73#define OP_MASK 0x2f 84#define OP_MASK 0x2f
@@ -86,6 +97,8 @@ enum fields
86#define JIMM_SH 0 97#define JIMM_SH 0
87#define FUNC_MASK 0x2f 98#define FUNC_MASK 0x2f
88#define FUNC_SH 0 99#define FUNC_SH 0
100#define SET_MASK 0x7
101#define SET_SH 0
89 102
90enum opcode { 103enum opcode {
91 insn_invalid, 104 insn_invalid,
@@ -129,8 +142,8 @@ static __initdata struct insn insn_table[] = {
129 { insn_bne, M(bne_op,0,0,0,0,0), RS | RT | BIMM }, 142 { insn_bne, M(bne_op,0,0,0,0,0), RS | RT | BIMM },
130 { insn_daddiu, M(daddiu_op,0,0,0,0,0), RS | RT | SIMM }, 143 { insn_daddiu, M(daddiu_op,0,0,0,0,0), RS | RT | SIMM },
131 { insn_daddu, M(spec_op,0,0,0,0,daddu_op), RS | RT | RD }, 144 { insn_daddu, M(spec_op,0,0,0,0,daddu_op), RS | RT | RD },
132 { insn_dmfc0, M(cop0_op,dmfc_op,0,0,0,0), RT | RD }, 145 { insn_dmfc0, M(cop0_op,dmfc_op,0,0,0,0), RT | RD | SET},
133 { insn_dmtc0, M(cop0_op,dmtc_op,0,0,0,0), RT | RD }, 146 { insn_dmtc0, M(cop0_op,dmtc_op,0,0,0,0), RT | RD | SET},
134 { insn_dsll, M(spec_op,0,0,0,0,dsll_op), RT | RD | RE }, 147 { insn_dsll, M(spec_op,0,0,0,0,dsll_op), RT | RD | RE },
135 { insn_dsll32, M(spec_op,0,0,0,0,dsll32_op), RT | RD | RE }, 148 { insn_dsll32, M(spec_op,0,0,0,0,dsll32_op), RT | RD | RE },
136 { insn_dsra, M(spec_op,0,0,0,0,dsra_op), RT | RD | RE }, 149 { insn_dsra, M(spec_op,0,0,0,0,dsra_op), RT | RD | RE },
@@ -145,8 +158,8 @@ static __initdata struct insn insn_table[] = {
145 { insn_lld, M(lld_op,0,0,0,0,0), RS | RT | SIMM }, 158 { insn_lld, M(lld_op,0,0,0,0,0), RS | RT | SIMM },
146 { insn_lui, M(lui_op,0,0,0,0,0), RT | SIMM }, 159 { insn_lui, M(lui_op,0,0,0,0,0), RT | SIMM },
147 { insn_lw, M(lw_op,0,0,0,0,0), RS | RT | SIMM }, 160 { insn_lw, M(lw_op,0,0,0,0,0), RS | RT | SIMM },
148 { insn_mfc0, M(cop0_op,mfc_op,0,0,0,0), RT | RD }, 161 { insn_mfc0, M(cop0_op,mfc_op,0,0,0,0), RT | RD | SET},
149 { insn_mtc0, M(cop0_op,mtc_op,0,0,0,0), RT | RD }, 162 { insn_mtc0, M(cop0_op,mtc_op,0,0,0,0), RT | RD | SET},
150 { insn_ori, M(ori_op,0,0,0,0,0), RS | RT | UIMM }, 163 { insn_ori, M(ori_op,0,0,0,0,0), RS | RT | UIMM },
151 { insn_rfe, M(cop0_op,cop_op,0,0,0,rfe_op), 0 }, 164 { insn_rfe, M(cop0_op,cop_op,0,0,0,rfe_op), 0 },
152 { insn_sc, M(sc_op,0,0,0,0,0), RS | RT | SIMM }, 165 { insn_sc, M(sc_op,0,0,0,0,0), RS | RT | SIMM },
@@ -242,6 +255,14 @@ static __init u32 build_func(u32 arg)
242 return arg & FUNC_MASK; 255 return arg & FUNC_MASK;
243} 256}
244 257
258static __init u32 build_set(u32 arg)
259{
260 if (arg & ~SET_MASK)
261 printk(KERN_WARNING "TLB synthesizer field overflow\n");
262
263 return arg & SET_MASK;
264}
265
245/* 266/*
246 * The order of opcode arguments is implicitly left to right, 267 * The order of opcode arguments is implicitly left to right,
247 * starting with RS and ending with FUNC or IMM. 268 * starting with RS and ending with FUNC or IMM.
@@ -273,6 +294,7 @@ static void __init build_insn(u32 **buf, enum opcode opc, ...)
273 if (ip->fields & BIMM) op |= build_bimm(va_arg(ap, s32)); 294 if (ip->fields & BIMM) op |= build_bimm(va_arg(ap, s32));
274 if (ip->fields & JIMM) op |= build_jimm(va_arg(ap, u32)); 295 if (ip->fields & JIMM) op |= build_jimm(va_arg(ap, u32));
275 if (ip->fields & FUNC) op |= build_func(va_arg(ap, u32)); 296 if (ip->fields & FUNC) op |= build_func(va_arg(ap, u32));
297 if (ip->fields & SET) op |= build_set(va_arg(ap, u32));
276 va_end(ap); 298 va_end(ap);
277 299
278 **buf = op; 300 **buf = op;
@@ -358,8 +380,8 @@ I_u1s2(_bgezl);
358I_u1s2(_bltz); 380I_u1s2(_bltz);
359I_u1s2(_bltzl); 381I_u1s2(_bltzl);
360I_u1u2s3(_bne); 382I_u1u2s3(_bne);
361I_u1u2(_dmfc0); 383I_u1u2u3(_dmfc0);
362I_u1u2(_dmtc0); 384I_u1u2u3(_dmtc0);
363I_u2u1s3(_daddiu); 385I_u2u1s3(_daddiu);
364I_u3u1u2(_daddu); 386I_u3u1u2(_daddu);
365I_u2u1u3(_dsll); 387I_u2u1u3(_dsll);
@@ -376,8 +398,8 @@ I_u2s3u1(_ll);
376I_u2s3u1(_lld); 398I_u2s3u1(_lld);
377I_u1s2(_lui); 399I_u1s2(_lui);
378I_u2s3u1(_lw); 400I_u2s3u1(_lw);
379I_u1u2(_mfc0); 401I_u1u2u3(_mfc0);
380I_u1u2(_mtc0); 402I_u1u2u3(_mtc0);
381I_u2u1u3(_ori); 403I_u2u1u3(_ori);
382I_0(_rfe); 404I_0(_rfe);
383I_u2s3u1(_sc); 405I_u2s3u1(_sc);
@@ -451,8 +473,8 @@ L_LA(_r3000_write_probe_fail)
451# define i_SLL(buf, rs, rt, sh) i_dsll(buf, rs, rt, sh) 473# define i_SLL(buf, rs, rt, sh) i_dsll(buf, rs, rt, sh)
452# define i_SRA(buf, rs, rt, sh) i_dsra(buf, rs, rt, sh) 474# define i_SRA(buf, rs, rt, sh) i_dsra(buf, rs, rt, sh)
453# define i_SRL(buf, rs, rt, sh) i_dsrl(buf, rs, rt, sh) 475# define i_SRL(buf, rs, rt, sh) i_dsrl(buf, rs, rt, sh)
454# define i_MFC0(buf, rt, rd) i_dmfc0(buf, rt, rd) 476# define i_MFC0(buf, rt, rd...) i_dmfc0(buf, rt, rd)
455# define i_MTC0(buf, rt, rd) i_dmtc0(buf, rt, rd) 477# define i_MTC0(buf, rt, rd...) i_dmtc0(buf, rt, rd)
456# define i_ADDIU(buf, rs, rt, val) i_daddiu(buf, rs, rt, val) 478# define i_ADDIU(buf, rs, rt, val) i_daddiu(buf, rs, rt, val)
457# define i_ADDU(buf, rs, rt, rd) i_daddu(buf, rs, rt, rd) 479# define i_ADDU(buf, rs, rt, rd) i_daddu(buf, rs, rt, rd)
458# define i_SUBU(buf, rs, rt, rd) i_dsubu(buf, rs, rt, rd) 480# define i_SUBU(buf, rs, rt, rd) i_dsubu(buf, rs, rt, rd)
@@ -464,8 +486,8 @@ L_LA(_r3000_write_probe_fail)
464# define i_SLL(buf, rs, rt, sh) i_sll(buf, rs, rt, sh) 486# define i_SLL(buf, rs, rt, sh) i_sll(buf, rs, rt, sh)
465# define i_SRA(buf, rs, rt, sh) i_sra(buf, rs, rt, sh) 487# define i_SRA(buf, rs, rt, sh) i_sra(buf, rs, rt, sh)
466# define i_SRL(buf, rs, rt, sh) i_srl(buf, rs, rt, sh) 488# define i_SRL(buf, rs, rt, sh) i_srl(buf, rs, rt, sh)
467# define i_MFC0(buf, rt, rd) i_mfc0(buf, rt, rd) 489# define i_MFC0(buf, rt, rd...) i_mfc0(buf, rt, rd)
468# define i_MTC0(buf, rt, rd) i_mtc0(buf, rt, rd) 490# define i_MTC0(buf, rt, rd...) i_mtc0(buf, rt, rd)
469# define i_ADDIU(buf, rs, rt, val) i_addiu(buf, rs, rt, val) 491# define i_ADDIU(buf, rs, rt, val) i_addiu(buf, rs, rt, val)
470# define i_ADDU(buf, rs, rt, rd) i_addu(buf, rs, rt, rd) 492# define i_ADDU(buf, rs, rt, rd) i_addu(buf, rs, rt, rd)
471# define i_SUBU(buf, rs, rt, rd) i_subu(buf, rs, rt, rd) 493# define i_SUBU(buf, rs, rt, rd) i_subu(buf, rs, rt, rd)
@@ -670,14 +692,15 @@ static void __init il_bgezl(u32 **p, struct reloc **r, unsigned int reg,
670#define K1 27 692#define K1 27
671 693
672/* Some CP0 registers */ 694/* Some CP0 registers */
673#define C0_INDEX 0 695#define C0_INDEX 0, 0
674#define C0_ENTRYLO0 2 696#define C0_ENTRYLO0 2, 0
675#define C0_ENTRYLO1 3 697#define C0_TCBIND 2, 2
676#define C0_CONTEXT 4 698#define C0_ENTRYLO1 3, 0
677#define C0_BADVADDR 8 699#define C0_CONTEXT 4, 0
678#define C0_ENTRYHI 10 700#define C0_BADVADDR 8, 0
679#define C0_EPC 14 701#define C0_ENTRYHI 10, 0
680#define C0_XCONTEXT 20 702#define C0_EPC 14, 0
703#define C0_XCONTEXT 20, 0
681 704
682#ifdef CONFIG_64BIT 705#ifdef CONFIG_64BIT
683# define GET_CONTEXT(buf, reg) i_MFC0(buf, reg, C0_XCONTEXT) 706# define GET_CONTEXT(buf, reg) i_MFC0(buf, reg, C0_XCONTEXT)
@@ -742,7 +765,7 @@ static void __init build_r3000_tlb_refill_handler(void)
742 } 765 }
743#endif 766#endif
744 767
745 memcpy((void *)CAC_BASE, tlb_handler, 0x80); 768 memcpy((void *)ebase, tlb_handler, 0x80);
746} 769}
747 770
748/* 771/*
@@ -852,6 +875,7 @@ static __init void build_tlb_write_entry(u32 **p, struct label **l,
852 875
853 case CPU_R10000: 876 case CPU_R10000:
854 case CPU_R12000: 877 case CPU_R12000:
878 case CPU_R14000:
855 case CPU_4KC: 879 case CPU_4KC:
856 case CPU_SB1: 880 case CPU_SB1:
857 case CPU_SB1A: 881 case CPU_SB1A:
@@ -883,6 +907,7 @@ static __init void build_tlb_write_entry(u32 **p, struct label **l,
883 case CPU_4KEC: 907 case CPU_4KEC:
884 case CPU_24K: 908 case CPU_24K:
885 case CPU_34K: 909 case CPU_34K:
910 case CPU_74K:
886 i_ehb(p); 911 i_ehb(p);
887 tlbw(p); 912 tlbw(p);
888 break; 913 break;
@@ -951,12 +976,20 @@ build_get_pmde64(u32 **p, struct label **l, struct reloc **r,
951 /* No i_nop needed here, since the next insn doesn't touch TMP. */ 976 /* No i_nop needed here, since the next insn doesn't touch TMP. */
952 977
953#ifdef CONFIG_SMP 978#ifdef CONFIG_SMP
979# ifdef CONFIG_MIPS_MT_SMTC
980 /*
981 * SMTC uses TCBind value as "CPU" index
982 */
983 i_mfc0(p, ptr, C0_TCBIND);
984 i_dsrl(p, ptr, ptr, 19);
985# else
954 /* 986 /*
955 * 64 bit SMP running in XKPHYS has smp_processor_id() << 3 987 * 64 bit SMP running in XKPHYS has smp_processor_id() << 3
956 * stored in CONTEXT. 988 * stored in CONTEXT.
957 */ 989 */
958 i_dmfc0(p, ptr, C0_CONTEXT); 990 i_dmfc0(p, ptr, C0_CONTEXT);
959 i_dsrl(p, ptr, ptr, 23); 991 i_dsrl(p, ptr, ptr, 23);
992#endif
960 i_LA_mostly(p, tmp, pgdc); 993 i_LA_mostly(p, tmp, pgdc);
961 i_daddu(p, ptr, ptr, tmp); 994 i_daddu(p, ptr, ptr, tmp);
962 i_dmfc0(p, tmp, C0_BADVADDR); 995 i_dmfc0(p, tmp, C0_BADVADDR);
@@ -1014,9 +1047,21 @@ build_get_pgde32(u32 **p, unsigned int tmp, unsigned int ptr)
1014 1047
1015 /* 32 bit SMP has smp_processor_id() stored in CONTEXT. */ 1048 /* 32 bit SMP has smp_processor_id() stored in CONTEXT. */
1016#ifdef CONFIG_SMP 1049#ifdef CONFIG_SMP
1050#ifdef CONFIG_MIPS_MT_SMTC
1051 /*
1052 * SMTC uses TCBind value as "CPU" index
1053 */
1054 i_mfc0(p, ptr, C0_TCBIND);
1055 i_LA_mostly(p, tmp, pgdc);
1056 i_srl(p, ptr, ptr, 19);
1057#else
1058 /*
1059 * smp_processor_id() << 3 is stored in CONTEXT.
1060 */
1017 i_mfc0(p, ptr, C0_CONTEXT); 1061 i_mfc0(p, ptr, C0_CONTEXT);
1018 i_LA_mostly(p, tmp, pgdc); 1062 i_LA_mostly(p, tmp, pgdc);
1019 i_srl(p, ptr, ptr, 23); 1063 i_srl(p, ptr, ptr, 23);
1064#endif
1020 i_addu(p, ptr, tmp, ptr); 1065 i_addu(p, ptr, tmp, ptr);
1021#else 1066#else
1022 i_LA_mostly(p, ptr, pgdc); 1067 i_LA_mostly(p, ptr, pgdc);
@@ -1247,7 +1292,7 @@ static void __init build_r4000_tlb_refill_handler(void)
1247 } 1292 }
1248#endif 1293#endif
1249 1294
1250 memcpy((void *)CAC_BASE, final_handler, 0x100); 1295 memcpy((void *)ebase, final_handler, 0x100);
1251} 1296}
1252 1297
1253/* 1298/*
diff --git a/arch/mips/momentum/jaguar_atx/Makefile b/arch/mips/momentum/jaguar_atx/Makefile
index 20bbd3ea44a8..67372f3f9654 100644
--- a/arch/mips/momentum/jaguar_atx/Makefile
+++ b/arch/mips/momentum/jaguar_atx/Makefile
@@ -6,7 +6,7 @@
6# unless it's something special (ie not a .c file). 6# unless it's something special (ie not a .c file).
7# 7#
8 8
9obj-y += int-handler.o irq.o prom.o reset.o setup.o 9obj-y += irq.o prom.o reset.o setup.o
10 10
11obj-$(CONFIG_SERIAL_8250_CONSOLE) += ja-console.o 11obj-$(CONFIG_SERIAL_8250_CONSOLE) += ja-console.o
12obj-$(CONFIG_REMOTE_DEBUG) += dbg_io.o 12obj-$(CONFIG_REMOTE_DEBUG) += dbg_io.o
diff --git a/arch/mips/momentum/jaguar_atx/dbg_io.c b/arch/mips/momentum/jaguar_atx/dbg_io.c
index 542eac82b63c..d7dea0a136aa 100644
--- a/arch/mips/momentum/jaguar_atx/dbg_io.c
+++ b/arch/mips/momentum/jaguar_atx/dbg_io.c
@@ -73,7 +73,7 @@ void debugInit(uint32 baud, uint8 data, uint8 parity, uint8 stop)
73 /* disable interrupts */ 73 /* disable interrupts */
74 UART16550_WRITE(OFS_INTR_ENABLE, 0); 74 UART16550_WRITE(OFS_INTR_ENABLE, 0);
75 75
76 /* set up buad rate */ 76 /* set up baud rate */
77 { 77 {
78 uint32 divisor; 78 uint32 divisor;
79 79
diff --git a/arch/mips/momentum/jaguar_atx/int-handler.S b/arch/mips/momentum/jaguar_atx/int-handler.S
deleted file mode 100644
index 55bc789733f2..000000000000
--- a/arch/mips/momentum/jaguar_atx/int-handler.S
+++ /dev/null
@@ -1,128 +0,0 @@
1/*
2 * Copyright 2002 Momentum Computer Inc.
3 * Author: Matthew Dharm <mdharm@momenco.com>
4 *
5 * Based on work:
6 * Copyright 2001 MontaVista Software Inc.
7 * Author: jsun@mvista.com or jsun@junsun.net
8 *
9 * First-level interrupt dispatcher for Jaguar-ATX board.
10 *
11 * This program is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU General Public License as published by the
13 * Free Software Foundation; either version 2 of the License, or (at your
14 * option) any later version.
15 */
16#include <asm/asm.h>
17#include <asm/mipsregs.h>
18#include <asm/addrspace.h>
19#include <asm/regdef.h>
20#include <asm/stackframe.h>
21
22/*
23 * First level interrupt dispatcher for Ocelot-CS board
24 */
25 .align 5
26 NESTED(jaguar_handle_int, PT_SIZE, sp)
27 SAVE_ALL
28 CLI
29 .set at
30 mfc0 t0, CP0_CAUSE
31 mfc0 t2, CP0_STATUS
32
33 and t0, t2
34
35 andi t1, t0, STATUSF_IP0 /* sw0 software interrupt */
36 bnez t1, ll_sw0_irq
37 andi t1, t0, STATUSF_IP1 /* sw1 software interrupt */
38 bnez t1, ll_sw1_irq
39 andi t1, t0, STATUSF_IP2 /* int0 hardware line */
40 bnez t1, ll_pcixa_irq
41 andi t1, t0, STATUSF_IP3 /* int1 hardware line */
42 bnez t1, ll_pcixb_irq
43 andi t1, t0, STATUSF_IP4 /* int2 hardware line */
44 bnez t1, ll_pcia_irq
45 andi t1, t0, STATUSF_IP5 /* int3 hardware line */
46 bnez t1, ll_pcib_irq
47 andi t1, t0, STATUSF_IP6 /* int4 hardware line */
48 bnez t1, ll_uart_irq
49 andi t1, t0, STATUSF_IP7 /* cpu timer */
50 bnez t1, ll_cputimer_irq
51
52 nop
53 nop
54
55 /* now look at extended interrupts */
56 mfc0 t0, CP0_CAUSE
57 cfc0 t1, CP0_S1_INTCONTROL
58
59 /* shift the mask 8 bits left to line up the bits */
60 sll t2, t1, 8
61
62 and t0, t2
63 srl t0, t0, 16
64
65 andi t1, t0, STATUSF_IP8 /* int6 hardware line */
66 bnez t1, ll_mv64340_decode_irq
67
68 nop
69 nop
70
71 .set reorder
72
73 /* wrong alarm or masked ... */
74 j spurious_interrupt
75 nop
76 END(jaguar_handle_int)
77
78 .align 5
79ll_sw0_irq:
80 li a0, 0
81 move a1, sp
82 jal do_IRQ
83 j ret_from_irq
84ll_sw1_irq:
85 li a0, 1
86 move a1, sp
87 jal do_IRQ
88 j ret_from_irq
89ll_pcixa_irq:
90 li a0, 2
91 move a1, sp
92 jal do_IRQ
93 j ret_from_irq
94
95ll_pcixb_irq:
96 li a0, 3
97 move a1, sp
98 jal do_IRQ
99 j ret_from_irq
100
101ll_pcia_irq:
102 li a0, 4
103 move a1, sp
104 jal do_IRQ
105 j ret_from_irq
106
107ll_pcib_irq:
108 li a0, 5
109 move a1, sp
110 jal do_IRQ
111 j ret_from_irq
112
113ll_uart_irq:
114 li a0, 6
115 move a1, sp
116 jal do_IRQ
117 j ret_from_irq
118
119ll_cputimer_irq:
120 li a0, 7
121 move a1, sp
122 jal ll_timer_interrupt
123 j ret_from_irq
124
125ll_mv64340_decode_irq:
126 move a0, sp
127 jal ll_mv64340_irq
128 j ret_from_irq
diff --git a/arch/mips/momentum/jaguar_atx/irq.c b/arch/mips/momentum/jaguar_atx/irq.c
index 15588f91ace2..ec4032b38f19 100644
--- a/arch/mips/momentum/jaguar_atx/irq.c
+++ b/arch/mips/momentum/jaguar_atx/irq.c
@@ -10,7 +10,7 @@
10 * Copyright 2001 MontaVista Software Inc. 10 * Copyright 2001 MontaVista Software Inc.
11 * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net 11 * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
12 * 12 *
13 * Copyright (C) 2000, 2001 Ralf Baechle (ralf@gnu.org) 13 * Copyright (C) 2000, 01, 06 Ralf Baechle (ralf@linux-mips.org)
14 * 14 *
15 * This program is free software; you can redistribute it and/or modify it 15 * This program is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by the 16 * under the terms of the GNU General Public License as published by the
@@ -38,8 +38,37 @@
38#include <linux/types.h> 38#include <linux/types.h>
39#include <asm/irq_cpu.h> 39#include <asm/irq_cpu.h>
40#include <asm/mipsregs.h> 40#include <asm/mipsregs.h>
41#include <asm/time.h>
41 42
42extern asmlinkage void jaguar_handle_int(void); 43asmlinkage void plat_irq_dispatch(struct pt_regs *regs)
44{
45 unsigned int pending = read_c0_cause() & read_c0_status();
46
47 if (pending & STATUSF_IP0)
48 do_IRQ(0, regs);
49 else if (pending & STATUSF_IP1)
50 do_IRQ(1, regs);
51 else if (pending & STATUSF_IP2)
52 do_IRQ(2, regs);
53 else if (pending & STATUSF_IP3)
54 do_IRQ(3, regs);
55 else if (pending & STATUSF_IP4)
56 do_IRQ(4, regs);
57 else if (pending & STATUSF_IP5)
58 do_IRQ(5, regs);
59 else if (pending & STATUSF_IP6)
60 do_IRQ(6, regs);
61 else if (pending & STATUSF_IP7)
62 ll_timer_interrupt(7, regs);
63 else {
64 /*
65 * Now look at the extended interrupts
66 */
67 pending = (read_c0_cause() & (read_c0_intcontrol() << 8)) >> 16;
68 if (pending & STATUSF_IP8)
69 ll_mv64340_irq(regs);
70 }
71}
43 72
44static struct irqaction cascade_mv64340 = { 73static struct irqaction cascade_mv64340 = {
45 no_action, SA_INTERRUPT, CPU_MASK_NONE, "MV64340-Cascade", NULL, NULL 74 no_action, SA_INTERRUPT, CPU_MASK_NONE, "MV64340-Cascade", NULL, NULL
@@ -53,8 +82,6 @@ void __init arch_init_irq(void)
53 */ 82 */
54 clear_c0_status(ST0_IM); 83 clear_c0_status(ST0_IM);
55 84
56 /* Sets the first-level interrupt dispatcher. */
57 set_except_vector(0, jaguar_handle_int);
58 mips_cpu_irq_init(0); 85 mips_cpu_irq_init(0);
59 rm7k_cpu_irq_init(8); 86 rm7k_cpu_irq_init(8);
60 87
diff --git a/arch/mips/momentum/jaguar_atx/setup.c b/arch/mips/momentum/jaguar_atx/setup.c
index 91d9637143d7..1379c76845dc 100644
--- a/arch/mips/momentum/jaguar_atx/setup.c
+++ b/arch/mips/momentum/jaguar_atx/setup.c
@@ -381,24 +381,24 @@ void __init plat_setup(void)
381 * shut down ethernet ports, just to be sure our memory doesn't get 381 * shut down ethernet ports, just to be sure our memory doesn't get
382 * corrupted by random ethernet traffic. 382 * corrupted by random ethernet traffic.
383 */ 383 */
384 MV_WRITE(MV64340_ETH_TRANSMIT_QUEUE_COMMAND_REG(0), 0xff << 8); 384 MV_WRITE(MV643XX_ETH_TRANSMIT_QUEUE_COMMAND_REG(0), 0xff << 8);
385 MV_WRITE(MV64340_ETH_TRANSMIT_QUEUE_COMMAND_REG(1), 0xff << 8); 385 MV_WRITE(MV643XX_ETH_TRANSMIT_QUEUE_COMMAND_REG(1), 0xff << 8);
386 MV_WRITE(MV64340_ETH_TRANSMIT_QUEUE_COMMAND_REG(2), 0xff << 8); 386 MV_WRITE(MV643XX_ETH_TRANSMIT_QUEUE_COMMAND_REG(2), 0xff << 8);
387 MV_WRITE(MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG(0), 0xff << 8); 387 MV_WRITE(MV643XX_ETH_RECEIVE_QUEUE_COMMAND_REG(0), 0xff << 8);
388 MV_WRITE(MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG(1), 0xff << 8); 388 MV_WRITE(MV643XX_ETH_RECEIVE_QUEUE_COMMAND_REG(1), 0xff << 8);
389 MV_WRITE(MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG(2), 0xff << 8); 389 MV_WRITE(MV643XX_ETH_RECEIVE_QUEUE_COMMAND_REG(2), 0xff << 8);
390 while (MV_READ(MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG(0)) & 0xff); 390 while (MV_READ(MV643XX_ETH_RECEIVE_QUEUE_COMMAND_REG(0)) & 0xff);
391 while (MV_READ(MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG(1)) & 0xff); 391 while (MV_READ(MV643XX_ETH_RECEIVE_QUEUE_COMMAND_REG(1)) & 0xff);
392 while (MV_READ(MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG(2)) & 0xff); 392 while (MV_READ(MV643XX_ETH_RECEIVE_QUEUE_COMMAND_REG(2)) & 0xff);
393 while (MV_READ(MV64340_ETH_TRANSMIT_QUEUE_COMMAND_REG(0)) & 0xff); 393 while (MV_READ(MV643XX_ETH_TRANSMIT_QUEUE_COMMAND_REG(0)) & 0xff);
394 while (MV_READ(MV64340_ETH_TRANSMIT_QUEUE_COMMAND_REG(1)) & 0xff); 394 while (MV_READ(MV643XX_ETH_TRANSMIT_QUEUE_COMMAND_REG(1)) & 0xff);
395 while (MV_READ(MV64340_ETH_TRANSMIT_QUEUE_COMMAND_REG(2)) & 0xff); 395 while (MV_READ(MV643XX_ETH_TRANSMIT_QUEUE_COMMAND_REG(2)) & 0xff);
396 MV_WRITE(MV64340_ETH_PORT_SERIAL_CONTROL_REG(0), 396 MV_WRITE(MV643XX_ETH_PORT_SERIAL_CONTROL_REG(0),
397 MV_READ(MV64340_ETH_PORT_SERIAL_CONTROL_REG(0)) & ~1); 397 MV_READ(MV643XX_ETH_PORT_SERIAL_CONTROL_REG(0)) & ~1);
398 MV_WRITE(MV64340_ETH_PORT_SERIAL_CONTROL_REG(1), 398 MV_WRITE(MV643XX_ETH_PORT_SERIAL_CONTROL_REG(1),
399 MV_READ(MV64340_ETH_PORT_SERIAL_CONTROL_REG(1)) & ~1); 399 MV_READ(MV643XX_ETH_PORT_SERIAL_CONTROL_REG(1)) & ~1);
400 MV_WRITE(MV64340_ETH_PORT_SERIAL_CONTROL_REG(2), 400 MV_WRITE(MV643XX_ETH_PORT_SERIAL_CONTROL_REG(2),
401 MV_READ(MV64340_ETH_PORT_SERIAL_CONTROL_REG(2)) & ~1); 401 MV_READ(MV643XX_ETH_PORT_SERIAL_CONTROL_REG(2)) & ~1);
402 402
403 /* Turn off the Bit-Error LED */ 403 /* Turn off the Bit-Error LED */
404 JAGUAR_FPGA_WRITE(0x80, CLR); 404 JAGUAR_FPGA_WRITE(0x80, CLR);
diff --git a/arch/mips/momentum/ocelot_3/Makefile b/arch/mips/momentum/ocelot_3/Makefile
index aab8fd89f830..8bcea64dd27b 100644
--- a/arch/mips/momentum/ocelot_3/Makefile
+++ b/arch/mips/momentum/ocelot_3/Makefile
@@ -5,4 +5,4 @@
5# removes any old dependencies. DON'T put your own dependencies here 5# removes any old dependencies. DON'T put your own dependencies here
6# unless it's something special (ie not a .c file). 6# unless it's something special (ie not a .c file).
7# 7#
8obj-y += int-handler.o irq.o prom.o reset.o setup.o 8obj-y += irq.o prom.o reset.o setup.o
diff --git a/arch/mips/momentum/ocelot_3/int-handler.S b/arch/mips/momentum/ocelot_3/int-handler.S
deleted file mode 100644
index 4522f09ed769..000000000000
--- a/arch/mips/momentum/ocelot_3/int-handler.S
+++ /dev/null
@@ -1,137 +0,0 @@
1/*
2 * Copyright 2002 Momentum Computer Inc.
3 * Author: Matthew Dharm <mdharm@momenco.com>
4 *
5 * Copyright 2001 MontaVista Software Inc.
6 * Author: jsun@mvista.com or jsun@junsun.net
7 *
8 * Copyright 2004 PMC-Sierra
9 * Author: Manish Lachwani (lachwani@pmc-sierra.com)
10 *
11 * Copyright (C) 2004 MontaVista Software Inc.
12 * Author: Manish Lachwani, mlachwani@mvista.com
13 *
14 * First-level interrupt dispatcher for Ocelot-3 board.
15 *
16 * This program is free software; you can redistribute it and/or modify it
17 * under the terms of the GNU General Public License as published by the
18 * Free Software Foundation; either version 2 of the License, or (at your
19 * option) any later version.
20 */
21#include <asm/asm.h>
22#include <asm/mipsregs.h>
23#include <asm/addrspace.h>
24#include <asm/regdef.h>
25#include <asm/stackframe.h>
26
27/*
28 * First level interrupt dispatcher for Ocelot-3 board
29 */
30 .align 5
31 NESTED(ocelot3_handle_int, PT_SIZE, sp)
32 SAVE_ALL
33 CLI
34 .set at
35
36 mfc0 t0, CP0_CAUSE
37 mfc0 t2, CP0_STATUS
38
39 and t0, t2
40
41 andi t1, t0, STATUSF_IP0 /* sw0 software interrupt (IRQ0) */
42 bnez t1, ll_sw0_irq
43
44 andi t1, t0, STATUSF_IP1 /* sw1 software interrupt (IRQ1) */
45 bnez t1, ll_sw1_irq
46
47 andi t1, t0, STATUSF_IP2 /* int0 hardware line (IRQ2) */
48 bnez t1, ll_pci0slot1_irq
49
50 andi t1, t0, STATUSF_IP3 /* int1 hardware line (IRQ3) */
51 bnez t1, ll_pci0slot2_irq
52
53 andi t1, t0, STATUSF_IP4 /* int2 hardware line (IRQ4) */
54 bnez t1, ll_pci1slot1_irq
55
56 andi t1, t0, STATUSF_IP5 /* int3 hardware line (IRQ5) */
57 bnez t1, ll_pci1slot2_irq
58
59 andi t1, t0, STATUSF_IP6 /* int4 hardware line (IRQ6) */
60 bnez t1, ll_uart_irq
61
62 andi t1, t0, STATUSF_IP7 /* cpu timer (IRQ7) */
63 bnez t1, ll_cputimer_irq
64
65 /* now look at extended interrupts */
66 mfc0 t0, CP0_CAUSE
67 cfc0 t1, CP0_S1_INTCONTROL
68
69 /* shift the mask 8 bits left to line up the bits */
70 sll t2, t1, 8
71
72 and t0, t2
73 srl t0, t0, 16
74
75 andi t1, t0, STATUSF_IP8 /* int6 hardware line (IRQ9) */
76 bnez t1, ll_mv64340_decode_irq
77
78 .set reorder
79
80 /* wrong alarm or masked ... */
81 j spurious_interrupt
82 nop
83 END(ocelot3_handle_int)
84
85 .align 5
86ll_sw0_irq:
87 li a0, 0 /* IRQ 1 */
88 move a1, sp
89 jal do_IRQ
90 j ret_from_irq
91ll_sw1_irq:
92 li a0, 1 /* IRQ 2 */
93 move a1, sp
94 jal do_IRQ
95 j ret_from_irq
96
97ll_pci0slot1_irq:
98 li a0, 2 /* IRQ 3 */
99 move a1, sp
100 jal do_IRQ
101 j ret_from_irq
102
103ll_pci0slot2_irq:
104 li a0, 3 /* IRQ 4 */
105 move a1, sp
106 jal do_IRQ
107 j ret_from_irq
108
109ll_pci1slot1_irq:
110 li a0, 4 /* IRQ 5 */
111 move a1, sp
112 jal do_IRQ
113 j ret_from_irq
114
115ll_pci1slot2_irq:
116 li a0, 5 /* IRQ 6 */
117 move a1, sp
118 jal do_IRQ
119 j ret_from_irq
120
121ll_uart_irq:
122 li a0, 6 /* IRQ 7 */
123 move a1, sp
124 jal do_IRQ
125 j ret_from_irq
126
127ll_cputimer_irq:
128 li a0, 7 /* IRQ 8 */
129 move a1, sp
130 jal do_IRQ
131 j ret_from_irq
132
133ll_mv64340_decode_irq:
134 move a0, sp
135 jal ll_mv64340_irq
136 j ret_from_irq
137
diff --git a/arch/mips/momentum/ocelot_3/irq.c b/arch/mips/momentum/ocelot_3/irq.c
index 42464dbd4ad2..87c63c340ae3 100644
--- a/arch/mips/momentum/ocelot_3/irq.c
+++ b/arch/mips/momentum/ocelot_3/irq.c
@@ -53,8 +53,6 @@
53#include <asm/mipsregs.h> 53#include <asm/mipsregs.h>
54#include <asm/system.h> 54#include <asm/system.h>
55 55
56extern asmlinkage void ocelot3_handle_int(void);
57
58static struct irqaction cascade_mv64340 = { 56static struct irqaction cascade_mv64340 = {
59 no_action, SA_INTERRUPT, CPU_MASK_NONE, "MV64340-Cascade", NULL, NULL 57 no_action, SA_INTERRUPT, CPU_MASK_NONE, "MV64340-Cascade", NULL, NULL
60}; 58};
@@ -67,9 +65,6 @@ void __init arch_init_irq(void)
67 */ 65 */
68 clear_c0_status(ST0_IM | ST0_BEV); 66 clear_c0_status(ST0_IM | ST0_BEV);
69 67
70 /* Sets the first-level interrupt dispatcher. */
71 set_except_vector(0, ocelot3_handle_int);
72 mips_cpu_irq_init(0);
73 rm7k_cpu_irq_init(8); 68 rm7k_cpu_irq_init(8);
74 69
75 /* set up the cascading interrupts */ 70 /* set up the cascading interrupts */
@@ -79,3 +74,36 @@ void __init arch_init_irq(void)
79 set_c0_status(ST0_IM); /* IE in the status register */ 74 set_c0_status(ST0_IM); /* IE in the status register */
80 75
81} 76}
77
78asmlinkage void plat_irq_dispatch(struct pt_regs *regs)
79{
80 unsigned int pending = read_c0_cause() & read_c0_status();
81
82 if (pending & STATUSF_IP0)
83 do_IRQ(0, regs);
84 else if (pending & STATUSF_IP1)
85 do_IRQ(1, regs);
86 else if (pending & STATUSF_IP2)
87 do_IRQ(2, regs);
88 else if (pending & STATUSF_IP3)
89 do_IRQ(3, regs);
90 else if (pending & STATUSF_IP4)
91 do_IRQ(4, regs);
92 else if (pending & STATUSF_IP5)
93 do_IRQ(5, regs);
94 else if (pending & STATUSF_IP6)
95 do_IRQ(6, regs);
96 else if (pending & STATUSF_IP7)
97 do_IRQ(7, regs);
98 else {
99 /*
100 * Now look at the extended interrupts
101 */
102 pending = (read_c0_cause() & (read_c0_intcontrol() << 8)) >> 16;
103
104 if (pending & STATUSF_IP8)
105 ll_mv64340_irq(regs);
106 else
107 spurious_interrupt(regs);
108 }
109}
diff --git a/arch/mips/momentum/ocelot_3/setup.c b/arch/mips/momentum/ocelot_3/setup.c
index 370e75d0e75c..c69195234309 100644
--- a/arch/mips/momentum/ocelot_3/setup.c
+++ b/arch/mips/momentum/ocelot_3/setup.c
@@ -329,22 +329,22 @@ void __init plat_setup(void)
329 /* shut down ethernet ports, just to be sure our memory doesn't get 329 /* shut down ethernet ports, just to be sure our memory doesn't get
330 * corrupted by random ethernet traffic. 330 * corrupted by random ethernet traffic.
331 */ 331 */
332 MV_WRITE(MV64340_ETH_TRANSMIT_QUEUE_COMMAND_REG(0), 0xff << 8); 332 MV_WRITE(MV643XX_ETH_TRANSMIT_QUEUE_COMMAND_REG(0), 0xff << 8);
333 MV_WRITE(MV64340_ETH_TRANSMIT_QUEUE_COMMAND_REG(1), 0xff << 8); 333 MV_WRITE(MV643XX_ETH_TRANSMIT_QUEUE_COMMAND_REG(1), 0xff << 8);
334 MV_WRITE(MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG(0), 0xff << 8); 334 MV_WRITE(MV643XX_ETH_RECEIVE_QUEUE_COMMAND_REG(0), 0xff << 8);
335 MV_WRITE(MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG(1), 0xff << 8); 335 MV_WRITE(MV643XX_ETH_RECEIVE_QUEUE_COMMAND_REG(1), 0xff << 8);
336 do {} 336 do {}
337 while (MV_READ(MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG(0)) & 0xff); 337 while (MV_READ(MV643XX_ETH_RECEIVE_QUEUE_COMMAND_REG(0)) & 0xff);
338 do {} 338 do {}
339 while (MV_READ(MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG(1)) & 0xff); 339 while (MV_READ(MV643XX_ETH_RECEIVE_QUEUE_COMMAND_REG(1)) & 0xff);
340 do {} 340 do {}
341 while (MV_READ(MV64340_ETH_TRANSMIT_QUEUE_COMMAND_REG(0)) & 0xff); 341 while (MV_READ(MV643XX_ETH_TRANSMIT_QUEUE_COMMAND_REG(0)) & 0xff);
342 do {} 342 do {}
343 while (MV_READ(MV64340_ETH_TRANSMIT_QUEUE_COMMAND_REG(1)) & 0xff); 343 while (MV_READ(MV643XX_ETH_TRANSMIT_QUEUE_COMMAND_REG(1)) & 0xff);
344 MV_WRITE(MV64340_ETH_PORT_SERIAL_CONTROL_REG(0), 344 MV_WRITE(MV643XX_ETH_PORT_SERIAL_CONTROL_REG(0),
345 MV_READ(MV64340_ETH_PORT_SERIAL_CONTROL_REG(0)) & ~1); 345 MV_READ(MV643XX_ETH_PORT_SERIAL_CONTROL_REG(0)) & ~1);
346 MV_WRITE(MV64340_ETH_PORT_SERIAL_CONTROL_REG(1), 346 MV_WRITE(MV643XX_ETH_PORT_SERIAL_CONTROL_REG(1),
347 MV_READ(MV64340_ETH_PORT_SERIAL_CONTROL_REG(1)) & ~1); 347 MV_READ(MV643XX_ETH_PORT_SERIAL_CONTROL_REG(1)) & ~1);
348 348
349 /* Turn off the Bit-Error LED */ 349 /* Turn off the Bit-Error LED */
350 OCELOT_FPGA_WRITE(0x80, CLR); 350 OCELOT_FPGA_WRITE(0x80, CLR);
diff --git a/arch/mips/momentum/ocelot_c/Makefile b/arch/mips/momentum/ocelot_c/Makefile
index 91240777f978..94802b4db472 100644
--- a/arch/mips/momentum/ocelot_c/Makefile
+++ b/arch/mips/momentum/ocelot_c/Makefile
@@ -2,7 +2,7 @@
2# Makefile for Momentum Computer's Ocelot-C and -CS boards. 2# Makefile for Momentum Computer's Ocelot-C and -CS boards.
3# 3#
4 4
5obj-y += cpci-irq.o int-handler.o irq.o prom.o reset.o \ 5obj-y += cpci-irq.o irq.o prom.o reset.o \
6 setup.o uart-irq.o 6 setup.o uart-irq.o
7 7
8obj-$(CONFIG_KGDB) += dbg_io.o 8obj-$(CONFIG_KGDB) += dbg_io.o
diff --git a/arch/mips/momentum/ocelot_c/dbg_io.c b/arch/mips/momentum/ocelot_c/dbg_io.c
index 8720bccfdea2..f0a6a38fcf4d 100644
--- a/arch/mips/momentum/ocelot_c/dbg_io.c
+++ b/arch/mips/momentum/ocelot_c/dbg_io.c
@@ -73,7 +73,7 @@ void debugInit(uint32 baud, uint8 data, uint8 parity, uint8 stop)
73 /* disable interrupts */ 73 /* disable interrupts */
74 UART16550_WRITE(OFS_INTR_ENABLE, 0); 74 UART16550_WRITE(OFS_INTR_ENABLE, 0);
75 75
76 /* set up buad rate */ 76 /* set up baud rate */
77 { 77 {
78 uint32 divisor; 78 uint32 divisor;
79 79
diff --git a/arch/mips/momentum/ocelot_c/int-handler.S b/arch/mips/momentum/ocelot_c/int-handler.S
deleted file mode 100644
index 52349d9bf1be..000000000000
--- a/arch/mips/momentum/ocelot_c/int-handler.S
+++ /dev/null
@@ -1,102 +0,0 @@
1/*
2 * Copyright 2002 Momentum Computer Inc.
3 * Author: Matthew Dharm <mdharm@momenco.com>
4 *
5 * Copyright 2001 MontaVista Software Inc.
6 * Author: jsun@mvista.com or jsun@junsun.net
7 *
8 * First-level interrupt dispatcher for Ocelot-CS board.
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
14 */
15#include <asm/asm.h>
16#include <asm/mipsregs.h>
17#include <asm/addrspace.h>
18#include <asm/regdef.h>
19#include <asm/stackframe.h>
20#include "ocelot_c_fpga.h"
21
22/*
23 * First level interrupt dispatcher for Ocelot-CS board
24 */
25 .align 5
26 NESTED(ocelot_handle_int, PT_SIZE, sp)
27 SAVE_ALL
28 CLI
29 .set at
30 mfc0 t0, CP0_CAUSE
31 mfc0 t2, CP0_STATUS
32
33 and t0, t2
34
35 andi t1, t0, STATUSF_IP0 /* sw0 software interrupt */
36 bnez t1, ll_sw0_irq
37 andi t1, t0, STATUSF_IP1 /* sw1 software interrupt */
38 bnez t1, ll_sw1_irq
39 andi t1, t0, STATUSF_IP2 /* int0 hardware line */
40 bnez t1, ll_scsi_irq
41 andi t1, t0, STATUSF_IP3 /* int1 hardware line */
42 bnez t1, ll_uart_decode_irq
43 andi t1, t0, STATUSF_IP4 /* int2 hardware line */
44 bnez t1, ll_pmc_irq
45 andi t1, t0, STATUSF_IP5 /* int3 hardware line */
46 bnez t1, ll_cpci_decode_irq
47 andi t1, t0, STATUSF_IP6 /* int4 hardware line */
48 bnez t1, ll_mv64340_decode_irq
49 andi t1, t0, STATUSF_IP7 /* cpu timer */
50 bnez t1, ll_cputimer_irq
51
52 .set reorder
53
54 /* wrong alarm or masked ... */
55 j spurious_interrupt
56 nop
57 END(ocelot_handle_int)
58
59 .align 5
60ll_sw0_irq:
61 li a0, 0
62 move a1, sp
63 jal do_IRQ
64 j ret_from_irq
65ll_sw1_irq:
66 li a0, 1
67 move a1, sp
68 jal do_IRQ
69 j ret_from_irq
70ll_scsi_irq:
71 li a0, 2
72 move a1, sp
73 jal do_IRQ
74 j ret_from_irq
75
76ll_uart_decode_irq:
77 move a0, sp
78 jal ll_uart_irq
79 j ret_from_irq
80
81ll_pmc_irq:
82 li a0, 4
83 move a1, sp
84 jal do_IRQ
85 j ret_from_irq
86
87ll_cpci_decode_irq:
88 move a0, sp
89 jal ll_cpci_irq
90 j ret_from_irq
91
92ll_mv64340_decode_irq:
93 move a0, sp
94 jal ll_mv64340_irq
95 j ret_from_irq
96
97ll_cputimer_irq:
98 li a0, 7
99 move a1, sp
100 jal do_IRQ
101 j ret_from_irq
102
diff --git a/arch/mips/momentum/ocelot_c/irq.c b/arch/mips/momentum/ocelot_c/irq.c
index a5764bc20e36..86f61ce59e53 100644
--- a/arch/mips/momentum/ocelot_c/irq.c
+++ b/arch/mips/momentum/ocelot_c/irq.c
@@ -48,7 +48,6 @@
48#include <asm/mipsregs.h> 48#include <asm/mipsregs.h>
49#include <asm/system.h> 49#include <asm/system.h>
50 50
51extern asmlinkage void ocelot_handle_int(void);
52extern void uart_irq_init(void); 51extern void uart_irq_init(void);
53extern void cpci_irq_init(void); 52extern void cpci_irq_init(void);
54 53
@@ -60,6 +59,33 @@ static struct irqaction cascade_mv64340 = {
60 no_action, SA_INTERRUPT, CPU_MASK_NONE, "cascade via MV64340", NULL, NULL 59 no_action, SA_INTERRUPT, CPU_MASK_NONE, "cascade via MV64340", NULL, NULL
61}; 60};
62 61
62extern void ll_uart_irq(struct pt_regs *regs);
63extern void ll_cpci_irq(struct pt_regs *regs);
64
65asmlinkage void plat_irq_dispatch(struct pt_regs *regs)
66{
67 unsigned int pending = read_c0_cause() & read_c0_status();
68
69 if (pending & STATUSF_IP0)
70 do_IRQ(0, regs);
71 else if (pending & STATUSF_IP1)
72 do_IRQ(1, regs);
73 else if (pending & STATUSF_IP2)
74 do_IRQ(2, regs);
75 else if (pending & STATUSF_IP3)
76 ll_uart_irq(regs);
77 else if (pending & STATUSF_IP4)
78 do_IRQ(4, regs);
79 else if (pending & STATUSF_IP5)
80 ll_cpci_irq(regs);
81 else if (pending & STATUSF_IP6)
82 ll_mv64340_irq(regs);
83 else if (pending & STATUSF_IP7)
84 do_IRQ(7, regs);
85 else
86 spurious_interrupt(regs);
87}
88
63void __init arch_init_irq(void) 89void __init arch_init_irq(void)
64{ 90{
65 /* 91 /*
@@ -68,8 +94,6 @@ void __init arch_init_irq(void)
68 */ 94 */
69 clear_c0_status(ST0_IM); 95 clear_c0_status(ST0_IM);
70 96
71 /* Sets the first-level interrupt dispatcher. */
72 set_except_vector(0, ocelot_handle_int);
73 mips_cpu_irq_init(0); 97 mips_cpu_irq_init(0);
74 98
75 /* set up the cascading interrupts */ 99 /* set up the cascading interrupts */
diff --git a/arch/mips/momentum/ocelot_g/Makefile b/arch/mips/momentum/ocelot_g/Makefile
index e5f1cb086973..adb5665d40a9 100644
--- a/arch/mips/momentum/ocelot_g/Makefile
+++ b/arch/mips/momentum/ocelot_g/Makefile
@@ -2,7 +2,7 @@
2# Makefile for Momentum Computer's Ocelot-G board. 2# Makefile for Momentum Computer's Ocelot-G board.
3# 3#
4 4
5obj-y += int-handler.o irq.o gt-irq.o prom.o reset.o setup.o 5obj-y += irq.o gt-irq.o prom.o reset.o setup.o
6obj-$(CONFIG_KGDB) += dbg_io.o 6obj-$(CONFIG_KGDB) += dbg_io.o
7 7
8EXTRA_AFLAGS := $(CFLAGS) 8EXTRA_AFLAGS := $(CFLAGS)
diff --git a/arch/mips/momentum/ocelot_g/dbg_io.c b/arch/mips/momentum/ocelot_g/dbg_io.c
index 8720bccfdea2..f0a6a38fcf4d 100644
--- a/arch/mips/momentum/ocelot_g/dbg_io.c
+++ b/arch/mips/momentum/ocelot_g/dbg_io.c
@@ -73,7 +73,7 @@ void debugInit(uint32 baud, uint8 data, uint8 parity, uint8 stop)
73 /* disable interrupts */ 73 /* disable interrupts */
74 UART16550_WRITE(OFS_INTR_ENABLE, 0); 74 UART16550_WRITE(OFS_INTR_ENABLE, 0);
75 75
76 /* set up buad rate */ 76 /* set up baud rate */
77 { 77 {
78 uint32 divisor; 78 uint32 divisor;
79 79
diff --git a/arch/mips/momentum/ocelot_g/int-handler.S b/arch/mips/momentum/ocelot_g/int-handler.S
deleted file mode 100644
index 772e8f713176..000000000000
--- a/arch/mips/momentum/ocelot_g/int-handler.S
+++ /dev/null
@@ -1,131 +0,0 @@
1/*
2 * Copyright 2001 MontaVista Software Inc.
3 * Author: jsun@mvista.com or jsun@junsun.net
4 *
5 * First-level interrupt dispatcher for ocelot board.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 */
12#include <asm/asm.h>
13#include <asm/mipsregs.h>
14#include <asm/addrspace.h>
15#include <asm/regdef.h>
16#include <asm/stackframe.h>
17
18/*
19 * first level interrupt dispatcher for ocelot board -
20 * We check for the timer first, then check PCI ints A and D.
21 * Then check for serial IRQ and fall through.
22 */
23 .align 5
24 NESTED(ocelot_handle_int, PT_SIZE, sp)
25 SAVE_ALL
26 CLI
27 .set at
28 mfc0 t0, CP0_CAUSE
29 mfc0 t2, CP0_STATUS
30
31 and t0, t2
32
33 andi t1, t0, STATUSF_IP2 /* int0 hardware line */
34 bnez t1, ll_pri_enet_irq
35 andi t1, t0, STATUSF_IP3 /* int1 hardware line */
36 bnez t1, ll_sec_enet_irq
37 andi t1, t0, STATUSF_IP4 /* int2 hardware line */
38 bnez t1, ll_uart_irq
39 andi t1, t0, STATUSF_IP5 /* int3 hardware line */
40 bnez t1, ll_cpci_irq
41 andi t1, t0, STATUSF_IP6 /* int4 hardware line */
42 bnez t1, ll_galileo_p0_irq
43 andi t1, t0, STATUSF_IP7 /* cpu timer */
44 bnez t1, ll_cputimer_irq
45
46 /* now look at the extended interrupts */
47 mfc0 t0, CP0_CAUSE
48 cfc0 t1, CP0_S1_INTCONTROL
49
50 /* shift the mask 8 bits left to line up the bits */
51 sll t2, t1, 8
52
53 and t0, t2
54 srl t0, t0, 16
55
56 andi t1, t0, STATUSF_IP8 /* int6 hardware line */
57 bnez t1, ll_galileo_p1_irq
58 andi t1, t0, STATUSF_IP9 /* int7 hardware line */
59 bnez t1, ll_pmc_irq
60 andi t1, t0, STATUSF_IP10 /* int8 hardware line */
61 bnez t1, ll_cpci_abcd_irq
62 andi t1, t0, STATUSF_IP11 /* int9 hardware line */
63 bnez t1, ll_testpoint_irq
64
65 .set reorder
66
67 /* wrong alarm or masked ... */
68 j spurious_interrupt
69 nop
70 END(ocelot_handle_int)
71
72 .align 5
73ll_pri_enet_irq:
74 li a0, 2
75 move a1, sp
76 jal do_IRQ
77 j ret_from_irq
78
79ll_sec_enet_irq:
80 li a0, 3
81 move a1, sp
82 jal do_IRQ
83 j ret_from_irq
84
85ll_uart_irq:
86 li a0, 4
87 move a1, sp
88 jal do_IRQ
89 j ret_from_irq
90
91ll_cpci_irq:
92 li a0, 5
93 move a1, sp
94 jal do_IRQ
95 j ret_from_irq
96
97ll_galileo_p0_irq:
98 li a0, 6
99 move a1, sp
100 jal do_IRQ
101 j ret_from_irq
102
103ll_cputimer_irq:
104 li a0, 7
105 move a1, sp
106 jal do_IRQ
107 j ret_from_irq
108
109ll_galileo_p1_irq:
110 li a0, 8
111 move a1, sp
112 jal do_IRQ
113 j ret_from_irq
114
115ll_pmc_irq:
116 li a0, 9
117 move a1, sp
118 jal do_IRQ
119 j ret_from_irq
120
121ll_cpci_abcd_irq:
122 li a0, 10
123 move a1, sp
124 jal do_IRQ
125 j ret_from_irq
126
127ll_testpoint_irq:
128 li a0, 11
129 move a1, sp
130 jal do_IRQ
131 j ret_from_irq
diff --git a/arch/mips/momentum/ocelot_g/irq.c b/arch/mips/momentum/ocelot_g/irq.c
index 5eb85b164205..7a4a419804f1 100644
--- a/arch/mips/momentum/ocelot_g/irq.c
+++ b/arch/mips/momentum/ocelot_g/irq.c
@@ -48,7 +48,41 @@
48#include <asm/mipsregs.h> 48#include <asm/mipsregs.h>
49#include <asm/system.h> 49#include <asm/system.h>
50 50
51extern asmlinkage void ocelot_handle_int(void); 51asmlinkage void plat_irq_dispatch(struct pt_regs *regs)
52{
53 unsigned int pending = read_c0_cause() & read_c0_status();
54
55 if (pending & STATUSF_IP2)
56 do_IRQ(2, regs);
57 else if (pending & STATUSF_IP3)
58 do_IRQ(3, regs);
59 else if (pending & STATUSF_IP4)
60 do_IRQ(4, regs);
61 else if (pending & STATUSF_IP5)
62 do_IRQ(5, regs);
63 else if (pending & STATUSF_IP6)
64 do_IRQ(6, regs);
65 else if (pending & STATUSF_IP7)
66 do_IRQ(7, regs);
67 else {
68 /*
69 * Now look at the extended interrupts
70 */
71 pending = (read_c0_cause() & (read_c0_intcontrol() << 8)) >> 16;
72
73 if (pending & STATUSF_IP8)
74 do_IRQ(8, regs);
75 else if (pending & STATUSF_IP9)
76 do_IRQ(9, regs);
77 else if (pending & STATUSF_IP10)
78 do_IRQ(10, regs);
79 else if (pending & STATUSF_IP11)
80 do_IRQ(11, regs);
81 else
82 spurious_interrupt(regs);
83 }
84}
85
52extern void gt64240_irq_init(void); 86extern void gt64240_irq_init(void);
53 87
54void __init arch_init_irq(void) 88void __init arch_init_irq(void)
@@ -60,8 +94,6 @@ void __init arch_init_irq(void)
60 clear_c0_status(ST0_IM); 94 clear_c0_status(ST0_IM);
61 local_irq_disable(); 95 local_irq_disable();
62 96
63 /* Sets the first-level interrupt dispatcher. */
64 set_except_vector(0, ocelot_handle_int);
65 mips_cpu_irq_init(0); 97 mips_cpu_irq_init(0);
66 rm7k_cpu_irq_init(8); 98 rm7k_cpu_irq_init(8);
67 99
diff --git a/arch/mips/oprofile/common.c b/arch/mips/oprofile/common.c
index 935dd851f480..c31e4cff64e0 100644
--- a/arch/mips/oprofile/common.c
+++ b/arch/mips/oprofile/common.c
@@ -14,8 +14,8 @@
14 14
15#include "op_impl.h" 15#include "op_impl.h"
16 16
17extern struct op_mips_model op_model_mipsxx __attribute__((weak)); 17extern struct op_mips_model op_model_mipsxx_ops __attribute__((weak));
18extern struct op_mips_model op_model_rm9000 __attribute__((weak)); 18extern struct op_mips_model op_model_rm9000_ops __attribute__((weak));
19 19
20static struct op_mips_model *model; 20static struct op_mips_model *model;
21 21
@@ -27,7 +27,7 @@ static int op_mips_setup(void)
27 model->reg_setup(ctr); 27 model->reg_setup(ctr);
28 28
29 /* Configure the registers on all cpus. */ 29 /* Configure the registers on all cpus. */
30 on_each_cpu(model->cpu_setup, 0, 0, 1); 30 on_each_cpu(model->cpu_setup, NULL, 0, 1);
31 31
32 return 0; 32 return 0;
33} 33}
@@ -80,13 +80,14 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
80 case CPU_24K: 80 case CPU_24K:
81 case CPU_25KF: 81 case CPU_25KF:
82 case CPU_34K: 82 case CPU_34K:
83 case CPU_74K:
83 case CPU_SB1: 84 case CPU_SB1:
84 case CPU_SB1A: 85 case CPU_SB1A:
85 lmodel = &op_model_mipsxx; 86 lmodel = &op_model_mipsxx_ops;
86 break; 87 break;
87 88
88 case CPU_RM9000: 89 case CPU_RM9000:
89 lmodel = &op_model_rm9000; 90 lmodel = &op_model_rm9000_ops;
90 break; 91 break;
91 }; 92 };
92 93
@@ -114,5 +115,6 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
114 115
115void oprofile_arch_exit(void) 116void oprofile_arch_exit(void)
116{ 117{
117 model->exit(); 118 if (model)
119 model->exit();
118} 120}
diff --git a/arch/mips/oprofile/op_model_mipsxx.c b/arch/mips/oprofile/op_model_mipsxx.c
index 95d488ca0754..f26a00e13204 100644
--- a/arch/mips/oprofile/op_model_mipsxx.c
+++ b/arch/mips/oprofile/op_model_mipsxx.c
@@ -23,7 +23,7 @@
23 23
24#define M_COUNTER_OVERFLOW (1UL << 31) 24#define M_COUNTER_OVERFLOW (1UL << 31)
25 25
26struct op_mips_model op_model_mipsxx; 26struct op_mips_model op_model_mipsxx_ops;
27 27
28static struct mipsxx_register_config { 28static struct mipsxx_register_config {
29 unsigned int control[4]; 29 unsigned int control[4];
@@ -34,7 +34,7 @@ static struct mipsxx_register_config {
34 34
35static void mipsxx_reg_setup(struct op_counter_config *ctr) 35static void mipsxx_reg_setup(struct op_counter_config *ctr)
36{ 36{
37 unsigned int counters = op_model_mipsxx.num_counters; 37 unsigned int counters = op_model_mipsxx_ops.num_counters;
38 int i; 38 int i;
39 39
40 /* Compute the performance counter control word. */ 40 /* Compute the performance counter control word. */
@@ -62,7 +62,7 @@ static void mipsxx_reg_setup(struct op_counter_config *ctr)
62 62
63static void mipsxx_cpu_setup (void *args) 63static void mipsxx_cpu_setup (void *args)
64{ 64{
65 unsigned int counters = op_model_mipsxx.num_counters; 65 unsigned int counters = op_model_mipsxx_ops.num_counters;
66 66
67 switch (counters) { 67 switch (counters) {
68 case 4: 68 case 4:
@@ -83,7 +83,7 @@ static void mipsxx_cpu_setup (void *args)
83/* Start all counters on current CPU */ 83/* Start all counters on current CPU */
84static void mipsxx_cpu_start(void *args) 84static void mipsxx_cpu_start(void *args)
85{ 85{
86 unsigned int counters = op_model_mipsxx.num_counters; 86 unsigned int counters = op_model_mipsxx_ops.num_counters;
87 87
88 switch (counters) { 88 switch (counters) {
89 case 4: 89 case 4:
@@ -100,7 +100,7 @@ static void mipsxx_cpu_start(void *args)
100/* Stop all counters on current CPU */ 100/* Stop all counters on current CPU */
101static void mipsxx_cpu_stop(void *args) 101static void mipsxx_cpu_stop(void *args)
102{ 102{
103 unsigned int counters = op_model_mipsxx.num_counters; 103 unsigned int counters = op_model_mipsxx_ops.num_counters;
104 104
105 switch (counters) { 105 switch (counters) {
106 case 4: 106 case 4:
@@ -116,7 +116,7 @@ static void mipsxx_cpu_stop(void *args)
116 116
117static int mipsxx_perfcount_handler(struct pt_regs *regs) 117static int mipsxx_perfcount_handler(struct pt_regs *regs)
118{ 118{
119 unsigned int counters = op_model_mipsxx.num_counters; 119 unsigned int counters = op_model_mipsxx_ops.num_counters;
120 unsigned int control; 120 unsigned int control;
121 unsigned int counter; 121 unsigned int counter;
122 int handled = 0; 122 int handled = 0;
@@ -187,33 +187,37 @@ static int __init mipsxx_init(void)
187 187
188 reset_counters(counters); 188 reset_counters(counters);
189 189
190 op_model_mipsxx.num_counters = counters; 190 op_model_mipsxx_ops.num_counters = counters;
191 switch (current_cpu_data.cputype) { 191 switch (current_cpu_data.cputype) {
192 case CPU_20KC: 192 case CPU_20KC:
193 op_model_mipsxx.cpu_type = "mips/20K"; 193 op_model_mipsxx_ops.cpu_type = "mips/20K";
194 break; 194 break;
195 195
196 case CPU_24K: 196 case CPU_24K:
197 op_model_mipsxx.cpu_type = "mips/24K"; 197 op_model_mipsxx_ops.cpu_type = "mips/24K";
198 break; 198 break;
199 199
200 case CPU_25KF: 200 case CPU_25KF:
201 op_model_mipsxx.cpu_type = "mips/25K"; 201 op_model_mipsxx_ops.cpu_type = "mips/25K";
202 break; 202 break;
203 203
204#ifndef CONFIG_SMP 204#ifndef CONFIG_SMP
205 case CPU_34K: 205 case CPU_34K:
206 op_model_mipsxx.cpu_type = "mips/34K"; 206 op_model_mipsxx_ops.cpu_type = "mips/34K";
207 break;
208
209 case CPU_74K:
210 op_model_mipsxx_ops.cpu_type = "mips/74K";
207 break; 211 break;
208#endif 212#endif
209 213
210 case CPU_5KC: 214 case CPU_5KC:
211 op_model_mipsxx.cpu_type = "mips/5K"; 215 op_model_mipsxx_ops.cpu_type = "mips/5K";
212 break; 216 break;
213 217
214 case CPU_SB1: 218 case CPU_SB1:
215 case CPU_SB1A: 219 case CPU_SB1A:
216 op_model_mipsxx.cpu_type = "mips/sb1"; 220 op_model_mipsxx_ops.cpu_type = "mips/sb1";
217 break; 221 break;
218 222
219 default: 223 default:
@@ -229,12 +233,12 @@ static int __init mipsxx_init(void)
229 233
230static void mipsxx_exit(void) 234static void mipsxx_exit(void)
231{ 235{
232 reset_counters(op_model_mipsxx.num_counters); 236 reset_counters(op_model_mipsxx_ops.num_counters);
233 237
234 perf_irq = null_perf_irq; 238 perf_irq = null_perf_irq;
235} 239}
236 240
237struct op_mips_model op_model_mipsxx = { 241struct op_mips_model op_model_mipsxx_ops = {
238 .reg_setup = mipsxx_reg_setup, 242 .reg_setup = mipsxx_reg_setup,
239 .cpu_setup = mipsxx_cpu_setup, 243 .cpu_setup = mipsxx_cpu_setup,
240 .init = mipsxx_init, 244 .init = mipsxx_init,
diff --git a/arch/mips/oprofile/op_model_rm9000.c b/arch/mips/oprofile/op_model_rm9000.c
index 9b75e41c78ef..b7063fefa65b 100644
--- a/arch/mips/oprofile/op_model_rm9000.c
+++ b/arch/mips/oprofile/op_model_rm9000.c
@@ -126,7 +126,7 @@ static void rm9000_exit(void)
126 free_irq(rm9000_perfcount_irq, NULL); 126 free_irq(rm9000_perfcount_irq, NULL);
127} 127}
128 128
129struct op_mips_model op_model_rm9000 = { 129struct op_mips_model op_model_rm9000_ops = {
130 .reg_setup = rm9000_reg_setup, 130 .reg_setup = rm9000_reg_setup,
131 .cpu_setup = rm9000_cpu_setup, 131 .cpu_setup = rm9000_cpu_setup,
132 .init = rm9000_init, 132 .init = rm9000_init,
diff --git a/arch/mips/philips/pnx8550/common/Makefile b/arch/mips/philips/pnx8550/common/Makefile
index 6e38f3bc443c..b7c638166e9f 100644
--- a/arch/mips/philips/pnx8550/common/Makefile
+++ b/arch/mips/philips/pnx8550/common/Makefile
@@ -22,6 +22,6 @@
22# under Linux. 22# under Linux.
23# 23#
24 24
25obj-y := setup.o prom.o mipsIRQ.o int.o reset.o time.o proc.o platform.o 25obj-y := setup.o prom.o int.o reset.o time.o proc.o platform.o
26obj-$(CONFIG_PCI) += pci.o 26obj-$(CONFIG_PCI) += pci.o
27obj-$(CONFIG_KGDB) += gdb_hook.o 27obj-$(CONFIG_KGDB) += gdb_hook.o
diff --git a/arch/mips/philips/pnx8550/common/int.c b/arch/mips/philips/pnx8550/common/int.c
index c500e2d41f2c..39ee6314f627 100644
--- a/arch/mips/philips/pnx8550/common/int.c
+++ b/arch/mips/philips/pnx8550/common/int.c
@@ -38,8 +38,6 @@
38#include <int.h> 38#include <int.h>
39#include <uart.h> 39#include <uart.h>
40 40
41extern asmlinkage void cp0_irqdispatch(void);
42
43static DEFINE_SPINLOCK(irq_lock); 41static DEFINE_SPINLOCK(irq_lock);
44 42
45/* default prio for interrupts */ 43/* default prio for interrupts */
@@ -55,7 +53,7 @@ static char gic_prio[PNX8550_INT_GIC_TOTINT] = {
55 1 // 70 53 1 // 70
56}; 54};
57 55
58void hw0_irqdispatch(int irq, struct pt_regs *regs) 56static void hw0_irqdispatch(int irq, struct pt_regs *regs)
59{ 57{
60 /* find out which interrupt */ 58 /* find out which interrupt */
61 irq = PNX8550_GIC_VECTOR_0 >> 3; 59 irq = PNX8550_GIC_VECTOR_0 >> 3;
@@ -68,7 +66,7 @@ void hw0_irqdispatch(int irq, struct pt_regs *regs)
68} 66}
69 67
70 68
71void timer_irqdispatch(int irq, struct pt_regs *regs) 69static void timer_irqdispatch(int irq, struct pt_regs *regs)
72{ 70{
73 irq = (0x01c0 & read_c0_config7()) >> 6; 71 irq = (0x01c0 & read_c0_config7()) >> 6;
74 72
@@ -88,6 +86,20 @@ void timer_irqdispatch(int irq, struct pt_regs *regs)
88 } 86 }
89} 87}
90 88
89asmlinkage void plat_irq_dispatch(struct pt_regs *regs)
90{
91 unsigned int pending = read_c0_status() & read_c0_cause();
92
93 if (pending & STATUSF_IP2)
94 do_IRQ(2, regs);
95 else if (pending & STATUSF_IP7) {
96 if (read_c0_config7() & 0x01c0)
97 timer_irqdispatch(7, regs);
98 }
99
100 spurious_interrupt(regs);
101}
102
91static inline void modify_cp0_intmask(unsigned clr_mask, unsigned set_mask) 103static inline void modify_cp0_intmask(unsigned clr_mask, unsigned set_mask)
92{ 104{
93 unsigned long status = read_c0_status(); 105 unsigned long status = read_c0_status();
@@ -223,9 +235,6 @@ void __init arch_init_irq(void)
223 int i; 235 int i;
224 int configPR; 236 int configPR;
225 237
226 /* init of cp0 interrupts */
227 set_except_vector(0, cp0_irqdispatch);
228
229 for (i = 0; i < PNX8550_INT_CP0_TOTINT; i++) { 238 for (i = 0; i < PNX8550_INT_CP0_TOTINT; i++) {
230 irq_desc[i].handler = &level_irq_type; 239 irq_desc[i].handler = &level_irq_type;
231 pnx8550_ack(i); /* mask the irq just in case */ 240 pnx8550_ack(i); /* mask the irq just in case */
diff --git a/arch/mips/philips/pnx8550/common/mipsIRQ.S b/arch/mips/philips/pnx8550/common/mipsIRQ.S
deleted file mode 100644
index 338bffda3fab..000000000000
--- a/arch/mips/philips/pnx8550/common/mipsIRQ.S
+++ /dev/null
@@ -1,76 +0,0 @@
1/*
2 * Copyright (c) 2002 Philips, Inc. All rights.
3 * Copyright (c) 2002 Red Hat, Inc. All rights.
4 *
5 * This software may be freely redistributed under the terms of the
6 * GNU General Public License.
7 *
8 * You should have received a copy of the GNU General Public License
9 * along with this program; if not, write to the Free Software
10 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
11 *
12 * Based upon arch/mips/galileo-boards/ev64240/int-handler.S
13 *
14 */
15#include <asm/asm.h>
16#include <asm/mipsregs.h>
17#include <asm/addrspace.h>
18#include <asm/regdef.h>
19#include <asm/stackframe.h>
20
21/*
22 * cp0_irqdispatch
23 *
24 * Code to handle in-core interrupt exception.
25 */
26
27 .align 5
28 .set reorder
29 .set noat
30 NESTED(cp0_irqdispatch, PT_SIZE, sp)
31 SAVE_ALL
32 CLI
33 .set at
34 mfc0 t0,CP0_CAUSE
35 mfc0 t2,CP0_STATUS
36
37 and t0,t2
38
39 andi t1,t0,STATUSF_IP2 /* int0 hardware line */
40 bnez t1,ll_hw0_irq
41 nop
42
43 andi t1,t0,STATUSF_IP7 /* int5 hardware line */
44 bnez t1,ll_timer_irq
45 nop
46
47 /* wrong alarm or masked ... */
48
49 j spurious_interrupt
50 nop
51 END(cp0_irqdispatch)
52
53 .align 5
54 .set reorder
55ll_hw0_irq:
56 li a0,2
57 move a1,sp
58 jal hw0_irqdispatch
59 nop
60 j ret_from_irq
61 nop
62
63 .align 5
64 .set reorder
65ll_timer_irq:
66 mfc0 t3,CP0_CONFIG,7
67 andi t4,t3,0x01c0
68 beqz t4,ll_timer_out
69 nop
70 li a0,7
71 move a1,sp
72 jal timer_irqdispatch
73 nop
74
75ll_timer_out: j ret_from_irq
76 nop
diff --git a/arch/mips/philips/pnx8550/common/platform.c b/arch/mips/philips/pnx8550/common/platform.c
index a592260fd673..5436b4b97455 100644
--- a/arch/mips/philips/pnx8550/common/platform.c
+++ b/arch/mips/philips/pnx8550/common/platform.c
@@ -18,6 +18,7 @@
18#include <linux/resource.h> 18#include <linux/resource.h>
19#include <linux/serial.h> 19#include <linux/serial.h>
20#include <linux/serial_ip3106.h> 20#include <linux/serial_ip3106.h>
21#include <linux/platform_device.h>
21 22
22#include <int.h> 23#include <int.h>
23#include <usb.h> 24#include <usb.h>
diff --git a/arch/mips/pmc-sierra/yosemite/Makefile b/arch/mips/pmc-sierra/yosemite/Makefile
index ae96a71a3089..e931e0d44229 100644
--- a/arch/mips/pmc-sierra/yosemite/Makefile
+++ b/arch/mips/pmc-sierra/yosemite/Makefile
@@ -2,7 +2,7 @@
2# Makefile for the PMC-Sierra Titan 2# Makefile for the PMC-Sierra Titan
3# 3#
4 4
5obj-y += irq-handler.o irq.o i2c-yosemite.o prom.o py-console.o setup.o 5obj-y += irq.o i2c-yosemite.o prom.o py-console.o setup.o
6 6
7obj-$(CONFIG_KGDB) += dbg_io.o 7obj-$(CONFIG_KGDB) += dbg_io.o
8obj-$(CONFIG_SMP) += smp.o 8obj-$(CONFIG_SMP) += smp.o
diff --git a/arch/mips/pmc-sierra/yosemite/irq-handler.S b/arch/mips/pmc-sierra/yosemite/irq-handler.S
deleted file mode 100644
index 33b9c40d4f5c..000000000000
--- a/arch/mips/pmc-sierra/yosemite/irq-handler.S
+++ /dev/null
@@ -1,93 +0,0 @@
1/*
2 * Copyright 2003, 04 PMC-Sierra Inc.
3 * Author: Manish Lachwani (lachwani@pmc-sierra.com
4 * Copyright 2004 Ralf Baechle (ralf@linux-mips.org)
5 *
6 * First-level interrupt router for the PMC-Sierra Titan board
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 *
13 * Titan supports Hypertransport or PCI but not both. Hence, one interrupt
14 * line is shared between the PCI slot A and Hypertransport. This is the
15 * Processor INTB #0.
16 */
17
18#include <linux/config.h>
19#include <asm/asm.h>
20#include <asm/mipsregs.h>
21#include <asm/addrspace.h>
22#include <asm/regdef.h>
23#include <asm/stackframe.h>
24
25 .align 5
26 NESTED(titan_handle_int, PT_SIZE, sp)
27 SAVE_ALL
28 CLI
29 .set at
30 .set noreorder
31 la ra, ret_from_irq
32 mfc0 t0, CP0_CAUSE
33 mfc0 t2, CP0_STATUS
34
35 and t0, t2
36
37 andi t2, t0, STATUSF_IP7 /* INTB5 hardware line */
38 bnez t2, ll_timer_irq /* Timer */
39 andi t1, t0, STATUSF_IP2 /* INTB0 hardware line */
40 bnez t1, ll_pcia_irq /* 64-bit PCI */
41 andi t2, t0, STATUSF_IP3 /* INTB1 hardware line */
42 bnez t2, ll_pcib_irq /* second 64-bit PCI slot */
43 andi t1, t0, STATUSF_IP4 /* INTB2 hardware line */
44 bnez t1, ll_duart_irq /* UART */
45 andi t2, t0, STATUSF_IP5 /* SMP inter-core interrupts */
46 bnez t2, ll_smp_irq
47 andi t1, t0, STATUSF_IP6
48 bnez t1, ll_ht_irq /* Hypertransport */
49
50 move a0, sp
51 j do_extended_irq
52 END(titan_handle_int)
53
54 .set reorder
55 .align 5
56
57ll_pcia_irq:
58 li a0, 2
59 move a1, sp
60#ifdef CONFIG_HYPERTRANSPORT
61 j ll_ht_smp_irq_handler
62#else
63 j do_IRQ
64#endif
65
66ll_pcib_irq:
67 li a0, 3
68 move a1, sp
69 j do_IRQ
70
71ll_duart_irq:
72 li a0, 4
73 move a1, sp
74 j do_IRQ
75
76ll_smp_irq:
77 li a0, 5
78 move a1, sp
79#ifdef CONFIG_SMP
80 j titan_mailbox_irq
81#else
82 j do_IRQ
83#endif
84
85ll_ht_irq:
86 li a0, 6
87 move a1, sp
88 j ll_ht_smp_irq_handler
89
90ll_timer_irq:
91 li a0, 7
92 move a1, sp
93 j do_IRQ
diff --git a/arch/mips/pmc-sierra/yosemite/irq.c b/arch/mips/pmc-sierra/yosemite/irq.c
index f4e2897d9bf7..a1f524fc4c10 100644
--- a/arch/mips/pmc-sierra/yosemite/irq.c
+++ b/arch/mips/pmc-sierra/yosemite/irq.c
@@ -2,6 +2,8 @@
2 * Copyright (C) 2003 PMC-Sierra Inc. 2 * Copyright (C) 2003 PMC-Sierra Inc.
3 * Author: Manish Lachwani (lachwani@pmc-sierra.com) 3 * Author: Manish Lachwani (lachwani@pmc-sierra.com)
4 * 4 *
5 * Copyright (C) 2006 Ralf Baechle (ralf@linux-mips.org)
6 *
5 * This program is free software; you can redistribute it and/or modify it 7 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the 8 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your 9 * Free Software Foundation; either version 2 of the License, or (at your
@@ -55,7 +57,6 @@
55#define HYPERTRANSPORT_INTC 0x7a /* INTC# */ 57#define HYPERTRANSPORT_INTC 0x7a /* INTC# */
56#define HYPERTRANSPORT_INTD 0x7b /* INTD# */ 58#define HYPERTRANSPORT_INTD 0x7b /* INTD# */
57 59
58extern asmlinkage void titan_handle_int(void);
59extern void jaguar_mailbox_irq(struct pt_regs *); 60extern void jaguar_mailbox_irq(struct pt_regs *);
60 61
61/* 62/*
@@ -125,6 +126,35 @@ asmlinkage void do_extended_irq(struct pt_regs *regs)
125 126
126} 127}
127 128
129asmlinkage void plat_irq_dispatch(struct pt_regs *regs)
130{
131 unsigned int cause = read_c0_cause();
132 unsigned int status = read_c0_status();
133 unsigned int pending = cause & status;
134
135 if (pending & STATUSF_IP7) {
136 do_IRQ(7, regs);
137 } else if (pending & STATUSF_IP2) {
138#ifdef CONFIG_HYPERTRANSPORT
139 ll_ht_smp_irq_handler(2, regs);
140#else
141 do_IRQ(2, regs);
142#endif
143 } else if (pending & STATUSF_IP3) {
144 do_IRQ(3, regs);
145 } else if (pending & STATUSF_IP4) {
146 do_IRQ(4, regs);
147 } else if (pending & STATUSF_IP5) {
148#ifdef CONFIG_SMP
149 titan_mailbox_irq(regs);
150#else
151 do_IRQ(5, regs);
152#endif
153 } else if (pending & STATUSF_IP6) {
154 do_IRQ(4, regs);
155 }
156}
157
128#ifdef CONFIG_KGDB 158#ifdef CONFIG_KGDB
129extern void init_second_port(void); 159extern void init_second_port(void);
130#endif 160#endif
@@ -136,7 +166,6 @@ void __init arch_init_irq(void)
136{ 166{
137 clear_c0_status(ST0_IM); 167 clear_c0_status(ST0_IM);
138 168
139 set_except_vector(0, titan_handle_int);
140 mips_cpu_irq_init(0); 169 mips_cpu_irq_init(0);
141 rm7k_cpu_irq_init(8); 170 rm7k_cpu_irq_init(8);
142 rm9k_cpu_irq_init(12); 171 rm9k_cpu_irq_init(12);
diff --git a/arch/mips/qemu/Makefile b/arch/mips/qemu/Makefile
index 6a8e8bcef552..730f459f3e99 100644
--- a/arch/mips/qemu/Makefile
+++ b/arch/mips/qemu/Makefile
@@ -2,6 +2,6 @@
2# Makefile for Qemu specific kernel interface routines under Linux. 2# Makefile for Qemu specific kernel interface routines under Linux.
3# 3#
4 4
5obj-y = q-firmware.o q-int.o q-irq.o q-mem.o q-setup.o 5obj-y = q-firmware.o q-irq.o q-mem.o q-setup.o
6 6
7obj-$(CONFIG_SMP) += q-smp.o 7obj-$(CONFIG_SMP) += q-smp.o
diff --git a/arch/mips/qemu/q-int.S b/arch/mips/qemu/q-int.S
deleted file mode 100644
index 6e3dfe5eb14b..000000000000
--- a/arch/mips/qemu/q-int.S
+++ /dev/null
@@ -1,17 +0,0 @@
1/*
2 * Qemu interrupt handler code.
3 *
4 * Copyright (C) 2005 by Ralf Baechle
5 */
6#include <asm/asm.h>
7#include <asm/regdef.h>
8#include <asm/stackframe.h>
9
10 .align 5
11 NESTED(qemu_handle_int, PT_SIZE, sp)
12 SAVE_ALL
13 CLI
14 move a0, sp
15 PTR_LA ra, ret_from_irq
16 j do_qemu_int
17 END(qemu_handle_int)
diff --git a/arch/mips/qemu/q-irq.c b/arch/mips/qemu/q-irq.c
index 2c4e0704ff10..3352374c4c7d 100644
--- a/arch/mips/qemu/q-irq.c
+++ b/arch/mips/qemu/q-irq.c
@@ -9,7 +9,7 @@
9 9
10extern asmlinkage void qemu_handle_int(void); 10extern asmlinkage void qemu_handle_int(void);
11 11
12asmlinkage void do_qemu_int(struct pt_regs *regs) 12asmlinkage void plat_irq_dispatch(struct pt_regs *regs)
13{ 13{
14 unsigned int pending = read_c0_status() & read_c0_cause(); 14 unsigned int pending = read_c0_status() & read_c0_cause();
15 15
@@ -29,7 +29,6 @@ asmlinkage void do_qemu_int(struct pt_regs *regs)
29 29
30void __init arch_init_irq(void) 30void __init arch_init_irq(void)
31{ 31{
32 set_except_vector(0, qemu_handle_int);
33 mips_hpt_frequency = QEMU_C0_COUNTER_CLOCK; /* 100MHz */ 32 mips_hpt_frequency = QEMU_C0_COUNTER_CLOCK; /* 100MHz */
34 33
35 init_i8259_irqs(); 34 init_i8259_irqs();
diff --git a/arch/mips/sgi-ip22/Makefile b/arch/mips/sgi-ip22/Makefile
index eb0820fe50bd..6aa4c0cd169c 100644
--- a/arch/mips/sgi-ip22/Makefile
+++ b/arch/mips/sgi-ip22/Makefile
@@ -3,7 +3,7 @@
3# under Linux. 3# under Linux.
4# 4#
5 5
6obj-y += ip22-mc.o ip22-hpc.o ip22-int.o ip22-irq.o ip22-berr.o \ 6obj-y += ip22-mc.o ip22-hpc.o ip22-int.o ip22-berr.o \
7 ip22-time.o ip22-nvram.o ip22-reset.o ip22-setup.o 7 ip22-time.o ip22-nvram.o ip22-reset.o ip22-setup.o
8 8
9obj-$(CONFIG_EISA) += ip22-eisa.o 9obj-$(CONFIG_EISA) += ip22-eisa.o
diff --git a/arch/mips/sgi-ip22/ip22-int.c b/arch/mips/sgi-ip22/ip22-int.c
index d16fb43b1a93..fc6a7e2b189c 100644
--- a/arch/mips/sgi-ip22/ip22-int.c
+++ b/arch/mips/sgi-ip22/ip22-int.c
@@ -37,7 +37,6 @@ static char lc1msk_to_irqnr[256];
37static char lc2msk_to_irqnr[256]; 37static char lc2msk_to_irqnr[256];
38static char lc3msk_to_irqnr[256]; 38static char lc3msk_to_irqnr[256];
39 39
40extern asmlinkage void indyIRQ(void);
41extern int ip22_eisa_init(void); 40extern int ip22_eisa_init(void);
42 41
43static void enable_local0_irq(unsigned int irq) 42static void enable_local0_irq(unsigned int irq)
@@ -224,7 +223,7 @@ static struct hw_interrupt_type ip22_local3_irq_type = {
224 .end = end_local3_irq, 223 .end = end_local3_irq,
225}; 224};
226 225
227void indy_local0_irqdispatch(struct pt_regs *regs) 226static void indy_local0_irqdispatch(struct pt_regs *regs)
228{ 227{
229 u8 mask = sgint->istat0 & sgint->imask0; 228 u8 mask = sgint->istat0 & sgint->imask0;
230 u8 mask2; 229 u8 mask2;
@@ -242,7 +241,7 @@ void indy_local0_irqdispatch(struct pt_regs *regs)
242 return; 241 return;
243} 242}
244 243
245void indy_local1_irqdispatch(struct pt_regs *regs) 244static void indy_local1_irqdispatch(struct pt_regs *regs)
246{ 245{
247 u8 mask = sgint->istat1 & sgint->imask1; 246 u8 mask = sgint->istat1 & sgint->imask1;
248 u8 mask2; 247 u8 mask2;
@@ -262,7 +261,7 @@ void indy_local1_irqdispatch(struct pt_regs *regs)
262 261
263extern void ip22_be_interrupt(int irq, struct pt_regs *regs); 262extern void ip22_be_interrupt(int irq, struct pt_regs *regs);
264 263
265void indy_buserror_irq(struct pt_regs *regs) 264static void indy_buserror_irq(struct pt_regs *regs)
266{ 265{
267 int irq = SGI_BUSERR_IRQ; 266 int irq = SGI_BUSERR_IRQ;
268 267
@@ -307,6 +306,56 @@ static struct irqaction map1_cascade = {
307#define SGI_INTERRUPTS SGINT_LOCAL3 306#define SGI_INTERRUPTS SGINT_LOCAL3
308#endif 307#endif
309 308
309extern void indy_r4k_timer_interrupt(struct pt_regs *regs);
310extern void indy_8254timer_irq(struct pt_regs *regs);
311
312/*
313 * IRQs on the INDY look basically (barring software IRQs which we don't use
314 * at all) like:
315 *
316 * MIPS IRQ Source
317 * -------- ------
318 * 0 Software (ignored)
319 * 1 Software (ignored)
320 * 2 Local IRQ level zero
321 * 3 Local IRQ level one
322 * 4 8254 Timer zero
323 * 5 8254 Timer one
324 * 6 Bus Error
325 * 7 R4k timer (what we use)
326 *
327 * We handle the IRQ according to _our_ priority which is:
328 *
329 * Highest ---- R4k Timer
330 * Local IRQ zero
331 * Local IRQ one
332 * Bus Error
333 * 8254 Timer zero
334 * Lowest ---- 8254 Timer one
335 *
336 * then we just return, if multiple IRQs are pending then we will just take
337 * another exception, big deal.
338 */
339
340asmlinkage void plat_irq_dispatch(struct pt_regs *regs)
341{
342 unsigned int pending = read_c0_cause();
343
344 /*
345 * First we check for r4k counter/timer IRQ.
346 */
347 if (pending & CAUSEF_IP7)
348 indy_r4k_timer_interrupt(regs);
349 else if (pending & CAUSEF_IP2)
350 indy_local0_irqdispatch(regs);
351 else if (pending & CAUSEF_IP3)
352 indy_local1_irqdispatch(regs);
353 else if (pending & CAUSEF_IP6)
354 indy_buserror_irq(regs);
355 else if (pending & (CAUSEF_IP4 | CAUSEF_IP5))
356 indy_8254timer_irq(regs);
357}
358
310extern void mips_cpu_irq_init(unsigned int irq_base); 359extern void mips_cpu_irq_init(unsigned int irq_base);
311 360
312void __init arch_init_irq(void) 361void __init arch_init_irq(void)
@@ -369,8 +418,6 @@ void __init arch_init_irq(void)
369 sgint->cmeimask0 = 0; 418 sgint->cmeimask0 = 0;
370 sgint->cmeimask1 = 0; 419 sgint->cmeimask1 = 0;
371 420
372 set_except_vector(0, indyIRQ);
373
374 /* init CPU irqs */ 421 /* init CPU irqs */
375 mips_cpu_irq_init(SGINT_CPU); 422 mips_cpu_irq_init(SGINT_CPU);
376 423
diff --git a/arch/mips/sgi-ip22/ip22-irq.S b/arch/mips/sgi-ip22/ip22-irq.S
deleted file mode 100644
index 6ccbd9e1d967..000000000000
--- a/arch/mips/sgi-ip22/ip22-irq.S
+++ /dev/null
@@ -1,118 +0,0 @@
1/*
2 * ip22-irq.S: Interrupt exception dispatch code for FullHouse and
3 * Guiness.
4 *
5 * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
6 */
7
8#include <asm/asm.h>
9#include <asm/mipsregs.h>
10#include <asm/regdef.h>
11#include <asm/stackframe.h>
12
13/* A lot of complication here is taken away because:
14 *
15 * 1) We handle one interrupt and return, sitting in a loop and moving across
16 * all the pending IRQ bits in the cause register is _NOT_ the answer, the
17 * common case is one pending IRQ so optimize in that direction.
18 *
19 * 2) We need not check against bits in the status register IRQ mask, that
20 * would make this routine slow as hell.
21 *
22 * 3) Linux only thinks in terms of all IRQs on or all IRQs off, nothing in
23 * between like BSD spl() brain-damage.
24 *
25 * Furthermore, the IRQs on the INDY look basically (barring software IRQs
26 * which we don't use at all) like:
27 *
28 * MIPS IRQ Source
29 * -------- ------
30 * 0 Software (ignored)
31 * 1 Software (ignored)
32 * 2 Local IRQ level zero
33 * 3 Local IRQ level one
34 * 4 8254 Timer zero
35 * 5 8254 Timer one
36 * 6 Bus Error
37 * 7 R4k timer (what we use)
38 *
39 * We handle the IRQ according to _our_ priority which is:
40 *
41 * Highest ---- R4k Timer
42 * Local IRQ zero
43 * Local IRQ one
44 * Bus Error
45 * 8254 Timer zero
46 * Lowest ---- 8254 Timer one
47 *
48 * then we just return, if multiple IRQs are pending then we will just take
49 * another exception, big deal.
50 */
51
52 .text
53 .set noreorder
54 .set noat
55 .align 5
56 NESTED(indyIRQ, PT_SIZE, sp)
57 SAVE_ALL
58 CLI
59 .set at
60 mfc0 s0, CP0_CAUSE # get irq mask
61
62 /* First we check for r4k counter/timer IRQ. */
63 andi a0, s0, CAUSEF_IP7
64 beq a0, zero, 1f
65 andi a0, s0, CAUSEF_IP2 # delay slot, check local level zero
66
67 /* Wheee, a timer interrupt. */
68 jal indy_r4k_timer_interrupt
69 move a0, sp # delay slot
70 j ret_from_irq
71 nop # delay slot
72
731:
74 beq a0, zero, 1f
75 andi a0, s0, CAUSEF_IP3 # delay slot, check local level one
76
77 /* Wheee, local level zero interrupt. */
78 jal indy_local0_irqdispatch
79 move a0, sp # delay slot
80
81 j ret_from_irq
82 nop # delay slot
83
841:
85 beq a0, zero, 1f
86 andi a0, s0, CAUSEF_IP6 # delay slot, check bus error
87
88 /* Wheee, local level one interrupt. */
89 jal indy_local1_irqdispatch
90 move a0, sp # delay slot
91 j ret_from_irq
92 nop # delay slot
93
941:
95 beq a0, zero, 1f
96 andi a0, s0, (CAUSEF_IP4 | CAUSEF_IP5) # delay slot
97
98 /* Wheee, an asynchronous bus error... */
99 jal indy_buserror_irq
100 move a0, sp # delay slot
101 j ret_from_irq
102 nop # delay slot
103
1041:
105 /* Here by mistake? It is possible, that by the time we take
106 * the exception the IRQ pin goes low, so just leave if this
107 * is the case.
108 */
109 beq a0, zero, 1f
110 nop # delay slot
111
112 /* Must be one of the 8254 timers... */
113 jal indy_8254timer_irq
114 move a0, sp # delay slot
1151:
116 j ret_from_irq
117 nop # delay slot
118 END(indyIRQ)
diff --git a/arch/mips/sgi-ip27/Makefile b/arch/mips/sgi-ip27/Makefile
index 4ba340780c35..686ba14e2882 100644
--- a/arch/mips/sgi-ip27/Makefile
+++ b/arch/mips/sgi-ip27/Makefile
@@ -2,7 +2,7 @@
2# Makefile for the IP27 specific kernel interface routines under Linux. 2# Makefile for the IP27 specific kernel interface routines under Linux.
3# 3#
4 4
5obj-y := ip27-berr.o ip27-console.o ip27-irq.o ip27-init.o ip27-irq-glue.o \ 5obj-y := ip27-berr.o ip27-console.o ip27-irq.o ip27-init.o \
6 ip27-klconfig.o ip27-klnuma.o ip27-memory.o ip27-nmi.o ip27-reset.o \ 6 ip27-klconfig.o ip27-klnuma.o ip27-memory.o ip27-nmi.o ip27-reset.o \
7 ip27-timer.o ip27-hubio.o ip27-xtalk.o 7 ip27-timer.o ip27-hubio.o ip27-xtalk.o
8 8
diff --git a/arch/mips/sgi-ip27/TODO b/arch/mips/sgi-ip27/TODO
index 32106131b0d0..19f1512c8f2e 100644
--- a/arch/mips/sgi-ip27/TODO
+++ b/arch/mips/sgi-ip27/TODO
@@ -9,10 +9,6 @@ ip27-init.c:find_lbaord_real. DONE
9in irix? 9in irix?
106. Investigate why things do not work without the setup_test() call 106. Investigate why things do not work without the setup_test() call
11being invoked on all nodes in ip27-memory.c. 11being invoked on all nodes in ip27-memory.c.
127. Too many CLIs in the locore handlers :
13For the low level handlers set up by set_except_vector(),
14__tlb_refill_debug_tramp, __xtlb_refill_debug_tramp and cacheerror,
15investigate whether the code should do CLI, STI or KMODE.
168. Too many do_page_faults invoked - investigate. 128. Too many do_page_faults invoked - investigate.
179. start_thread must turn off UX64 ... and define tlb_refill_debug. 139. start_thread must turn off UX64 ... and define tlb_refill_debug.
1810. Need a bad pmd table, bad pte table. __bad_pmd_table/__bad_pagetable 1410. Need a bad pmd table, bad pte table. __bad_pmd_table/__bad_pagetable
diff --git a/arch/mips/sgi-ip27/ip27-irq-glue.S b/arch/mips/sgi-ip27/ip27-irq-glue.S
deleted file mode 100644
index c304df715e0a..000000000000
--- a/arch/mips/sgi-ip27/ip27-irq-glue.S
+++ /dev/null
@@ -1,45 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 1999 Ralf Baechle
7 * Copyright (C) 1999 Silicon Graphics, Inc.
8 */
9#include <asm/asm.h>
10#include <asm/mipsregs.h>
11#include <asm/regdef.h>
12#include <asm/stackframe.h>
13
14 .text
15 .align 5
16NESTED(ip27_irq, PT_SIZE, sp)
17 SAVE_ALL
18 CLI
19
20 mfc0 s0, CP0_CAUSE
21 mfc0 t0, CP0_STATUS
22 and s0, t0
23 move a0, sp
24 PTR_LA ra, ret_from_irq
25
26 /* First check for RT interrupt. */
27 andi t0, s0, CAUSEF_IP4
28 bnez t0, ip4
29 andi t0, s0, CAUSEF_IP2
30 bnez t0, ip2
31 andi t0, s0, CAUSEF_IP3
32 bnez t0, ip3
33 andi t0, s0, CAUSEF_IP5
34 bnez t0, ip5
35 andi t0, s0, CAUSEF_IP6
36 bnez t0, ip6
37 j ra
38
39ip2: j ip27_do_irq_mask0 # PI_INT_PEND_0 or CC_PEND_{A|B}
40ip3: j ip27_do_irq_mask1 # PI_INT_PEND_1
41ip4: j ip27_rt_timer_interrupt
42ip5: j ip27_prof_timer
43ip6: j ip27_hub_error
44
45 END(ip27_irq)
diff --git a/arch/mips/sgi-ip27/ip27-irq.c b/arch/mips/sgi-ip27/ip27-irq.c
index 2854ac4c9be1..2e643d2f51cb 100644
--- a/arch/mips/sgi-ip27/ip27-irq.c
+++ b/arch/mips/sgi-ip27/ip27-irq.c
@@ -130,7 +130,7 @@ static int ms1bit(unsigned long x)
130 * Kanoj 05.13.00 130 * Kanoj 05.13.00
131 */ 131 */
132 132
133void ip27_do_irq_mask0(struct pt_regs *regs) 133static void ip27_do_irq_mask0(struct pt_regs *regs)
134{ 134{
135 int irq, swlevel; 135 int irq, swlevel;
136 hubreg_t pend0, mask0; 136 hubreg_t pend0, mask0;
@@ -171,7 +171,7 @@ void ip27_do_irq_mask0(struct pt_regs *regs)
171 LOCAL_HUB_L(PI_INT_PEND0); 171 LOCAL_HUB_L(PI_INT_PEND0);
172} 172}
173 173
174void ip27_do_irq_mask1(struct pt_regs *regs) 174static void ip27_do_irq_mask1(struct pt_regs *regs)
175{ 175{
176 int irq, swlevel; 176 int irq, swlevel;
177 hubreg_t pend1, mask1; 177 hubreg_t pend1, mask1;
@@ -196,12 +196,12 @@ void ip27_do_irq_mask1(struct pt_regs *regs)
196 LOCAL_HUB_L(PI_INT_PEND1); 196 LOCAL_HUB_L(PI_INT_PEND1);
197} 197}
198 198
199void ip27_prof_timer(struct pt_regs *regs) 199static void ip27_prof_timer(struct pt_regs *regs)
200{ 200{
201 panic("CPU %d got a profiling interrupt", smp_processor_id()); 201 panic("CPU %d got a profiling interrupt", smp_processor_id());
202} 202}
203 203
204void ip27_hub_error(struct pt_regs *regs) 204static void ip27_hub_error(struct pt_regs *regs)
205{ 205{
206 panic("CPU %d got a hub error interrupt", smp_processor_id()); 206 panic("CPU %d got a hub error interrupt", smp_processor_id());
207} 207}
@@ -421,9 +421,26 @@ int __devinit request_bridge_irq(struct bridge_controller *bc)
421 return irq; 421 return irq;
422} 422}
423 423
424extern void ip27_rt_timer_interrupt(struct pt_regs *regs);
425
426asmlinkage void plat_irq_dispatch(struct pt_regs *regs)
427{
428 unsigned long pending = read_c0_cause() & read_c0_status();
429
430 if (pending & CAUSEF_IP4)
431 ip27_rt_timer_interrupt(regs);
432 else if (pending & CAUSEF_IP2) /* PI_INT_PEND_0 or CC_PEND_{A|B} */
433 ip27_do_irq_mask0(regs);
434 else if (pending & CAUSEF_IP3) /* PI_INT_PEND_1 */
435 ip27_do_irq_mask1(regs);
436 else if (pending & CAUSEF_IP5)
437 ip27_prof_timer(regs);
438 else if (pending & CAUSEF_IP6)
439 ip27_hub_error(regs);
440}
441
424void __init arch_init_irq(void) 442void __init arch_init_irq(void)
425{ 443{
426 set_except_vector(0, ip27_irq);
427} 444}
428 445
429void install_ipi(void) 446void install_ipi(void)
diff --git a/arch/mips/sgi-ip27/ip27-timer.c b/arch/mips/sgi-ip27/ip27-timer.c
index cddf1cedf007..36b662e27b6e 100644
--- a/arch/mips/sgi-ip27/ip27-timer.c
+++ b/arch/mips/sgi-ip27/ip27-timer.c
@@ -122,7 +122,7 @@ again:
122 xtime.tv_sec > last_rtc_update + 660 && 122 xtime.tv_sec > last_rtc_update + 660 &&
123 (xtime.tv_nsec / 1000) >= 500000 - ((unsigned) TICK_SIZE) / 2 && 123 (xtime.tv_nsec / 1000) >= 500000 - ((unsigned) TICK_SIZE) / 2 &&
124 (xtime.tv_nsec / 1000) <= 500000 + ((unsigned) TICK_SIZE) / 2) { 124 (xtime.tv_nsec / 1000) <= 500000 + ((unsigned) TICK_SIZE) / 2) {
125 if (rtc_set_time(xtime.tv_sec) == 0) { 125 if (rtc_mips_set_time(xtime.tv_sec) == 0) {
126 last_rtc_update = xtime.tv_sec; 126 last_rtc_update = xtime.tv_sec;
127 } else { 127 } else {
128 last_rtc_update = xtime.tv_sec - 600; 128 last_rtc_update = xtime.tv_sec - 600;
diff --git a/arch/mips/sgi-ip32/Makefile b/arch/mips/sgi-ip32/Makefile
index 470898f4afe1..530bf848c3d0 100644
--- a/arch/mips/sgi-ip32/Makefile
+++ b/arch/mips/sgi-ip32/Makefile
@@ -3,7 +3,7 @@
3# under Linux. 3# under Linux.
4# 4#
5 5
6obj-y += ip32-berr.o ip32-irq.o ip32-irq-glue.o ip32-setup.o ip32-reset.o \ 6obj-y += ip32-berr.o ip32-irq.o ip32-setup.o ip32-reset.o \
7 crime.o ip32-memory.o 7 crime.o ip32-memory.o
8 8
9EXTRA_AFLAGS := $(CFLAGS) 9EXTRA_AFLAGS := $(CFLAGS)
diff --git a/arch/mips/sgi-ip32/ip32-irq-glue.S b/arch/mips/sgi-ip32/ip32-irq-glue.S
deleted file mode 100644
index 200924e1c4f5..000000000000
--- a/arch/mips/sgi-ip32/ip32-irq-glue.S
+++ /dev/null
@@ -1,86 +0,0 @@
1/*
2 * Low level interrupt handler for the SGI O2 aka IP32 aka Moosehead
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2000 Harald Koerfgen
9 * Copyright (C) 2001 Keith M Wesolowski
10 */
11#include <asm/asm.h>
12#include <asm/regdef.h>
13#include <asm/mipsregs.h>
14#include <asm/stackframe.h>
15#include <asm/addrspace.h>
16
17 .text
18 .set noreorder
19 .set noat
20 .align 5
21 NESTED(ip32_handle_int, PT_SIZE, ra)
22 .set noat
23 SAVE_ALL
24 CLI # TEST: interrupts should be off
25 .set at
26 .set noreorder
27
28 mfc0 s0,CP0_CAUSE
29
30 andi t1, s0, IE_IRQ0
31 bnez t1, handle_irq0
32 andi t1, s0, IE_IRQ1
33 bnez t1, handle_irq1
34 andi t1, s0, IE_IRQ2
35 bnez t1, handle_irq2
36 andi t1, s0, IE_IRQ3
37 bnez t1, handle_irq3
38 andi t1, s0, IE_IRQ4
39 bnez t1, handle_irq4
40 andi t1, s0, IE_IRQ5
41 bnez t1, handle_irq5
42 nop
43
44 /* Either someone has triggered the "software interrupts"
45 * or we lost an interrupt somehow. Ignore it.
46 */
47 j ret_from_irq
48 nop
49
50handle_irq0:
51 jal ip32_irq0
52 move a0, sp
53 j ret_from_irq
54 nop
55
56handle_irq1:
57 jal ip32_irq1
58 move a0, sp
59 j ret_from_irq
60 nop
61
62handle_irq2:
63 jal ip32_irq2
64 move a0, sp
65 j ret_from_irq
66 nop
67
68handle_irq3:
69 jal ip32_irq3
70 move a0, sp
71 j ret_from_irq
72 nop
73
74handle_irq4:
75 jal ip32_irq4
76 move a0, sp
77 j ret_from_irq
78 nop
79
80handle_irq5:
81 jal ip32_irq5
82 move a0, sp
83 j ret_from_irq
84 nop
85
86 END(ip32_handle_int)
diff --git a/arch/mips/sgi-ip32/ip32-irq.c b/arch/mips/sgi-ip32/ip32-irq.c
index 2eb22d692ed9..8ba08047d164 100644
--- a/arch/mips/sgi-ip32/ip32-irq.c
+++ b/arch/mips/sgi-ip32/ip32-irq.c
@@ -31,12 +31,12 @@
31/* issue a PIO read to make sure no PIO writes are pending */ 31/* issue a PIO read to make sure no PIO writes are pending */
32static void inline flush_crime_bus(void) 32static void inline flush_crime_bus(void)
33{ 33{
34 volatile unsigned long junk = crime->control; 34 crime->control;
35} 35}
36 36
37static void inline flush_mace_bus(void) 37static void inline flush_mace_bus(void)
38{ 38{
39 volatile unsigned long junk = mace->perif.ctrl.misc; 39 mace->perif.ctrl.misc;
40} 40}
41 41
42#undef DEBUG_IRQ 42#undef DEBUG_IRQ
@@ -130,8 +130,6 @@ struct irqaction memerr_irq = { crime_memerr_intr, SA_INTERRUPT,
130struct irqaction cpuerr_irq = { crime_cpuerr_intr, SA_INTERRUPT, 130struct irqaction cpuerr_irq = { crime_cpuerr_intr, SA_INTERRUPT,
131 CPU_MASK_NONE, "CRIME CPU error", NULL, NULL }; 131 CPU_MASK_NONE, "CRIME CPU error", NULL, NULL };
132 132
133extern void ip32_handle_int(void);
134
135/* 133/*
136 * For interrupts wired from a single device to the CPU. Only the clock 134 * For interrupts wired from a single device to the CPU. Only the clock
137 * uses this it seems, which is IRQ 0 and IP7. 135 * uses this it seems, which is IRQ 0 and IP7.
@@ -503,48 +501,67 @@ static void ip32_unknown_interrupt(struct pt_regs *regs)
503 501
504/* CRIME 1.1 appears to deliver all interrupts to this one pin. */ 502/* CRIME 1.1 appears to deliver all interrupts to this one pin. */
505/* change this to loop over all edge-triggered irqs, exception masked out ones */ 503/* change this to loop over all edge-triggered irqs, exception masked out ones */
506void ip32_irq0(struct pt_regs *regs) 504static void ip32_irq0(struct pt_regs *regs)
507{ 505{
508 uint64_t crime_int; 506 uint64_t crime_int;
509 int irq = 0; 507 int irq = 0;
510 508
511 crime_int = crime->istat & crime_mask; 509 crime_int = crime->istat & crime_mask;
512 irq = ffs(crime_int); 510 irq = __ffs(crime_int);
513 crime_int = 1 << (irq - 1); 511 crime_int = 1 << irq;
514 512
515 if (crime_int & CRIME_MACEISA_INT_MASK) { 513 if (crime_int & CRIME_MACEISA_INT_MASK) {
516 unsigned long mace_int = mace->perif.ctrl.istat; 514 unsigned long mace_int = mace->perif.ctrl.istat;
517 irq = ffs(mace_int & maceisa_mask) + 32; 515 irq = __ffs(mace_int & maceisa_mask) + 32;
518 } 516 }
517 irq++;
519 DBG("*irq %u*\n", irq); 518 DBG("*irq %u*\n", irq);
520 do_IRQ(irq, regs); 519 do_IRQ(irq, regs);
521} 520}
522 521
523void ip32_irq1(struct pt_regs *regs) 522static void ip32_irq1(struct pt_regs *regs)
524{ 523{
525 ip32_unknown_interrupt(regs); 524 ip32_unknown_interrupt(regs);
526} 525}
527 526
528void ip32_irq2(struct pt_regs *regs) 527static void ip32_irq2(struct pt_regs *regs)
529{ 528{
530 ip32_unknown_interrupt(regs); 529 ip32_unknown_interrupt(regs);
531} 530}
532 531
533void ip32_irq3(struct pt_regs *regs) 532static void ip32_irq3(struct pt_regs *regs)
534{ 533{
535 ip32_unknown_interrupt(regs); 534 ip32_unknown_interrupt(regs);
536} 535}
537 536
538void ip32_irq4(struct pt_regs *regs) 537static void ip32_irq4(struct pt_regs *regs)
539{ 538{
540 ip32_unknown_interrupt(regs); 539 ip32_unknown_interrupt(regs);
541} 540}
542 541
543void ip32_irq5(struct pt_regs *regs) 542static void ip32_irq5(struct pt_regs *regs)
544{ 543{
545 ll_timer_interrupt(IP32_R4K_TIMER_IRQ, regs); 544 ll_timer_interrupt(IP32_R4K_TIMER_IRQ, regs);
546} 545}
547 546
547asmlinkage void plat_irq_dispatch(struct pt_regs *regs)
548{
549 unsigned int pending = read_c0_cause();
550
551 if (likely(pending & IE_IRQ0))
552 ip32_irq0(regs);
553 else if (unlikely(pending & IE_IRQ1))
554 ip32_irq1(regs);
555 else if (unlikely(pending & IE_IRQ2))
556 ip32_irq2(regs);
557 else if (unlikely(pending & IE_IRQ3))
558 ip32_irq3(regs);
559 else if (unlikely(pending & IE_IRQ4))
560 ip32_irq4(regs);
561 else if (likely(pending & IE_IRQ5))
562 ip32_irq5(regs);
563}
564
548void __init arch_init_irq(void) 565void __init arch_init_irq(void)
549{ 566{
550 unsigned int irq; 567 unsigned int irq;
@@ -556,7 +573,6 @@ void __init arch_init_irq(void)
556 crime->soft_int = 0; 573 crime->soft_int = 0;
557 mace->perif.ctrl.istat = 0; 574 mace->perif.ctrl.istat = 0;
558 mace->perif.ctrl.imask = 0; 575 mace->perif.ctrl.imask = 0;
559 set_except_vector(0, ip32_handle_int);
560 576
561 for (irq = 0; irq <= IP32_IRQ_MAX; irq++) { 577 for (irq = 0; irq <= IP32_IRQ_MAX; irq++) {
562 hw_irq_controller *controller; 578 hw_irq_controller *controller;
diff --git a/arch/mips/sibyte/bcm1480/Makefile b/arch/mips/sibyte/bcm1480/Makefile
index 538d5a51ae94..7b36ff3873b7 100644
--- a/arch/mips/sibyte/bcm1480/Makefile
+++ b/arch/mips/sibyte/bcm1480/Makefile
@@ -1,4 +1,4 @@
1obj-y := setup.o irq.o irq_handler.o time.o 1obj-y := setup.o irq.o time.o
2 2
3obj-$(CONFIG_SMP) += smp.o 3obj-$(CONFIG_SMP) += smp.o
4 4
diff --git a/arch/mips/sibyte/bcm1480/irq.c b/arch/mips/sibyte/bcm1480/irq.c
index 9cf7d713b13c..e61760b14d99 100644
--- a/arch/mips/sibyte/bcm1480/irq.c
+++ b/arch/mips/sibyte/bcm1480/irq.c
@@ -187,9 +187,6 @@ static void bcm1480_set_affinity(unsigned int irq, cpumask_t mask)
187#endif 187#endif
188 188
189 189
190/* Defined in arch/mips/sibyte/bcm1480/irq_handler.S */
191extern void bcm1480_irq_handler(void);
192
193/*****************************************************************************/ 190/*****************************************************************************/
194 191
195static unsigned int startup_bcm1480_irq(unsigned int irq) 192static unsigned int startup_bcm1480_irq(unsigned int irq)
@@ -422,7 +419,6 @@ void __init arch_init_irq(void)
422#endif 419#endif
423 /* Enable necessary IPs, disable the rest */ 420 /* Enable necessary IPs, disable the rest */
424 change_c0_status(ST0_IM, imask); 421 change_c0_status(ST0_IM, imask);
425 set_except_vector(0, bcm1480_irq_handler);
426 422
427#ifdef CONFIG_KGDB 423#ifdef CONFIG_KGDB
428 if (kgdb_flag) { 424 if (kgdb_flag) {
@@ -473,3 +469,76 @@ void bcm1480_kgdb_interrupt(struct pt_regs *regs)
473} 469}
474 470
475#endif /* CONFIG_KGDB */ 471#endif /* CONFIG_KGDB */
472
473static inline int dclz(unsigned long long x)
474{
475 int lz;
476
477 __asm__ (
478 " .set push \n"
479 " .set mips64 \n"
480 " dclz %0, %1 \n"
481 " .set pop \n"
482 : "=r" (lz)
483 : "r" (x));
484
485 return lz;
486}
487
488extern void bcm1480_timer_interrupt(struct pt_regs *regs);
489extern void bcm1480_mailbox_interrupt(struct pt_regs *regs);
490extern void bcm1480_kgdb_interrupt(struct pt_regs *regs);
491
492asmlinkage void plat_irq_dispatch(struct pt_regs *regs)
493{
494 unsigned int pending;
495
496#ifdef CONFIG_SIBYTE_BCM1480_PROF
497 /* Set compare to count to silence count/compare timer interrupts */
498 write_c0_compare(read_c0_count());
499#endif
500
501 pending = read_c0_cause();
502
503#ifdef CONFIG_SIBYTE_BCM1480_PROF
504 if (pending & CAUSEF_IP7) /* Cpu performance counter interrupt */
505 sbprof_cpu_intr(exception_epc(regs));
506#endif
507
508 if (pending & CAUSEF_IP4)
509 bcm1480_timer_interrupt(regs);
510
511#ifdef CONFIG_SMP
512 if (pending & CAUSEF_IP3)
513 bcm1480_mailbox_interrupt(regs);
514#endif
515
516#ifdef CONFIG_KGDB
517 if (pending & CAUSEF_IP6)
518 bcm1480_kgdb_interrupt(regs); /* KGDB (uart 1) */
519#endif
520
521 if (pending & CAUSEF_IP2) {
522 unsigned long long mask_h, mask_l;
523 unsigned long base;
524
525 /*
526 * Default...we've hit an IP[2] interrupt, which means we've
527 * got to check the 1480 interrupt registers to figure out what
528 * to do. Need to detect which CPU we're on, now that
529 * smp_affinity is supported.
530 */
531 base = A_BCM1480_IMR_MAPPER(smp_processor_id());
532 mask_h = __raw_readq(
533 IOADDR(base + R_BCM1480_IMR_INTERRUPT_STATUS_BASE_H));
534 mask_l = __raw_readq(
535 IOADDR(base + R_BCM1480_IMR_INTERRUPT_STATUS_BASE_L));
536
537 if (!mask_h) {
538 if (mask_h ^ 1)
539 do_IRQ(63 - dclz(mask_h), regs);
540 else
541 do_IRQ(127 - dclz(mask_l), regs);
542 }
543 }
544}
diff --git a/arch/mips/sibyte/bcm1480/irq_handler.S b/arch/mips/sibyte/bcm1480/irq_handler.S
deleted file mode 100644
index 408db88d050f..000000000000
--- a/arch/mips/sibyte/bcm1480/irq_handler.S
+++ /dev/null
@@ -1,165 +0,0 @@
1/*
2 * Copyright (C) 2000,2001,2002,2003,2004 Broadcom Corporation
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 */
18
19/*
20 * bcm1480_irq_handler() is the routine that is actually called when an
21 * interrupt occurs. It is installed as the exception vector handler in
22 * init_IRQ() in arch/mips/sibyte/bcm1480/irq.c
23 *
24 * In the handle we figure out which interrupts need handling, and use that
25 * to call the dispatcher, which will take care of actually calling
26 * registered handlers
27 *
28 * Note that we take care of all raised interrupts in one go at the handler.
29 * This is more BSDish than the Indy code, and also, IMHO, more sane.
30 */
31#include <linux/config.h>
32
33#include <asm/addrspace.h>
34#include <asm/asm.h>
35#include <asm/mipsregs.h>
36#include <asm/regdef.h>
37#include <asm/stackframe.h>
38#include <asm/sibyte/sb1250_defs.h>
39#include <asm/sibyte/bcm1480_regs.h>
40#include <asm/sibyte/bcm1480_int.h>
41
42/*
43 * What a pain. We have to be really careful saving the upper 32 bits of any
44 * register across function calls if we don't want them trashed--since were
45 * running in -o32, the calling routing never saves the full 64 bits of a
46 * register across a function call. Being the interrupt handler, we're
47 * guaranteed that interrupts are disabled during this code so we don't have
48 * to worry about random interrupts blasting the high 32 bits.
49 */
50
51 .text
52 .set push
53 .set noreorder
54 .set noat
55 .set mips64
56 #.set mips4
57 .align 5
58 NESTED(bcm1480_irq_handler, PT_SIZE, sp)
59 SAVE_ALL
60 CLI
61
62#ifdef CONFIG_SIBYTE_BCM1480_PROF
63 /* Set compare to count to silence count/compare timer interrupts */
64 mfc0 t1, CP0_COUNT
65 mtc0 t1, CP0_COMPARE /* pause to clear IP[7] bit of cause ? */
66#endif
67 /* Read cause */
68 mfc0 s0, CP0_CAUSE
69
70#ifdef CONFIG_SIBYTE_BCM1480_PROF
71 /* Cpu performance counter interrupt is routed to IP[7] */
72 andi t1, s0, CAUSEF_IP7
73 beqz t1, 0f
74 srl t1, s0, (CAUSEB_BD-2) /* Shift BD bit to bit 2 */
75 and t1, t1, 0x4 /* mask to get just BD bit */
76#ifdef CONFIG_MIPS64
77 dmfc0 a0, CP0_EPC
78 daddu a0, a0, t1 /* a0 = EPC + (BD ? 4 : 0) */
79#else
80 mfc0 a0, CP0_EPC
81 addu a0, a0, t1 /* a0 = EPC + (BD ? 4 : 0) */
82#endif
83 jal sbprof_cpu_intr
84 nop
85 j ret_from_irq
86 nop
870:
88#endif
89
90 /* Timer interrupt is routed to IP[4] */
91 andi t1, s0, CAUSEF_IP4
92 beqz t1, 1f
93 nop
94 jal bcm1480_timer_interrupt
95 move a0, sp /* Pass the registers along */
96 j ret_from_irq
97 nop /* delay slot */
981:
99
100#ifdef CONFIG_SMP
101 /* Mailbox interrupt is routed to IP[3] */
102 andi t1, s0, CAUSEF_IP3
103 beqz t1, 2f
104 nop
105 jal bcm1480_mailbox_interrupt
106 move a0, sp
107 j ret_from_irq
108 nop /* delay slot */
1092:
110#endif
111
112#ifdef CONFIG_KGDB
113 /* KGDB (uart 1) interrupt is routed to IP[6] */
114 andi t1, s0, CAUSEF_IP6
115 beqz t1, 3f
116 nop /* delay slot */
117 jal bcm1480_kgdb_interrupt
118 move a0, sp
119 j ret_from_irq
120 nop /* delay slot */
1213:
122#endif
123
124 and t1, s0, CAUSEF_IP2
125 beqz t1, 9f
126 nop
127
128 /*
129 * Default...we've hit an IP[2] interrupt, which means we've got
130 * to check the 1480 interrupt registers to figure out what to do
131 * Need to detect which CPU we're on, now that smp_affinity is
132 * supported.
133 */
134 PTR_LA v0, CKSEG1 + A_BCM1480_IMR_CPU0_BASE
135#ifdef CONFIG_SMP
136 lw t1, TI_CPU($28)
137 sll t1, t1, BCM1480_IMR_REGISTER_SPACING_SHIFT
138 addu v0, v0, t1
139#endif
140
141 /* Read IP[2] status (get both high and low halves of status) */
142 ld s0, R_BCM1480_IMR_INTERRUPT_STATUS_BASE_H(v0)
143 ld s1, R_BCM1480_IMR_INTERRUPT_STATUS_BASE_L(v0)
144
145 move s2, zero /* intr number */
146 li s3, 64
147
148 beqz s0, 9f /* No interrupts. Return. */
149 move a1, sp
150
151 xori s4, s0, 1 /* if s0 (_H) == 1, it's a low intr, so... */
152 movz s2, s3, s4 /* start the intr number at 64, and */
153 movz s0, s1, s4 /* look at the low status value. */
154
155 dclz s1, s0 /* Find the next interrupt. */
156 dsubu a0, zero, s1
157 daddiu a0, a0, 63
158 jal do_IRQ
159 daddu a0, a0, s2
160
1619: j ret_from_irq
162 nop
163
164 .set pop
165 END(bcm1480_irq_handler)
diff --git a/arch/mips/sibyte/sb1250/Makefile b/arch/mips/sibyte/sb1250/Makefile
index a8af84697588..a2fdbd62f8ac 100644
--- a/arch/mips/sibyte/sb1250/Makefile
+++ b/arch/mips/sibyte/sb1250/Makefile
@@ -1,4 +1,4 @@
1obj-y := setup.o irq.o irq_handler.o time.o 1obj-y := setup.o irq.o time.o
2 2
3obj-$(CONFIG_SMP) += smp.o 3obj-$(CONFIG_SMP) += smp.o
4obj-$(CONFIG_SIBYTE_TBPROF) += bcm1250_tbprof.o 4obj-$(CONFIG_SIBYTE_TBPROF) += bcm1250_tbprof.o
diff --git a/arch/mips/sibyte/sb1250/irq.c b/arch/mips/sibyte/sb1250/irq.c
index 589537bfcc3d..0f6e54db4888 100644
--- a/arch/mips/sibyte/sb1250/irq.c
+++ b/arch/mips/sibyte/sb1250/irq.c
@@ -163,10 +163,6 @@ static void sb1250_set_affinity(unsigned int irq, cpumask_t mask)
163} 163}
164#endif 164#endif
165 165
166
167/* Defined in arch/mips/sibyte/sb1250/irq_handler.S */
168extern void sb1250_irq_handler(void);
169
170/*****************************************************************************/ 166/*****************************************************************************/
171 167
172static unsigned int startup_sb1250_irq(unsigned int irq) 168static unsigned int startup_sb1250_irq(unsigned int irq)
@@ -379,7 +375,6 @@ void __init arch_init_irq(void)
379#endif 375#endif
380 /* Enable necessary IPs, disable the rest */ 376 /* Enable necessary IPs, disable the rest */
381 change_c0_status(ST0_IM, imask); 377 change_c0_status(ST0_IM, imask);
382 set_except_vector(0, sb1250_irq_handler);
383 378
384#ifdef CONFIG_KGDB 379#ifdef CONFIG_KGDB
385 if (kgdb_flag) { 380 if (kgdb_flag) {
@@ -409,7 +404,7 @@ void __init arch_init_irq(void)
409#define duart_out(reg, val) csr_out32(val, IOADDR(A_DUART_CHANREG(kgdb_port,reg))) 404#define duart_out(reg, val) csr_out32(val, IOADDR(A_DUART_CHANREG(kgdb_port,reg)))
410#define duart_in(reg) csr_in32(IOADDR(A_DUART_CHANREG(kgdb_port,reg))) 405#define duart_in(reg) csr_in32(IOADDR(A_DUART_CHANREG(kgdb_port,reg)))
411 406
412void sb1250_kgdb_interrupt(struct pt_regs *regs) 407static void sb1250_kgdb_interrupt(struct pt_regs *regs)
413{ 408{
414 /* 409 /*
415 * Clear break-change status (allow some time for the remote 410 * Clear break-change status (allow some time for the remote
@@ -424,3 +419,74 @@ void sb1250_kgdb_interrupt(struct pt_regs *regs)
424} 419}
425 420
426#endif /* CONFIG_KGDB */ 421#endif /* CONFIG_KGDB */
422
423static inline int dclz(unsigned long long x)
424{
425 int lz;
426
427 __asm__ (
428 " .set push \n"
429 " .set mips64 \n"
430 " dclz %0, %1 \n"
431 " .set pop \n"
432 : "=r" (lz)
433 : "r" (x));
434
435 return lz;
436}
437
438asmlinkage void plat_irq_dispatch(struct pt_regs *regs)
439{
440 unsigned int pending;
441
442#ifdef CONFIG_SIBYTE_SB1250_PROF
443 /* Set compare to count to silence count/compare timer interrupts */
444 write_c0_count(read_c0_count());
445#endif
446
447 /*
448 * What a pain. We have to be really careful saving the upper 32 bits
449 * of any * register across function calls if we don't want them
450 * trashed--since were running in -o32, the calling routing never saves
451 * the full 64 bits of a register across a function call. Being the
452 * interrupt handler, we're guaranteed that interrupts are disabled
453 * during this code so we don't have to worry about random interrupts
454 * blasting the high 32 bits.
455 */
456
457 pending = read_c0_cause();
458
459#ifdef CONFIG_SIBYTE_SB1250_PROF
460 if (pending & CAUSEF_IP7) { /* Cpu performance counter interrupt */
461 sbprof_cpu_intr(exception_epc(regs));
462 }
463#endif
464
465 if (pending & CAUSEF_IP4)
466 sb1250_timer_interrupt(regs);
467
468#ifdef CONFIG_SMP
469 if (pending & CAUSEF_IP3)
470 sb1250_mailbox_interrupt(regs);
471#endif
472
473#ifdef CONFIG_KGDB
474 if (pending & CAUSEF_IP6) /* KGDB (uart 1) */
475 sb1250_kgdb_interrupt(regs);
476#endif
477
478 if (pending & CAUSEF_IP2) {
479 unsigned long long mask;
480
481 /*
482 * Default...we've hit an IP[2] interrupt, which means we've
483 * got to check the 1250 interrupt registers to figure out what
484 * to do. Need to detect which CPU we're on, now that
485 ~ smp_affinity is supported.
486 */
487 mask = __raw_readq(IOADDR(A_IMR_REGISTER(smp_processor_id(),
488 R_IMR_INTERRUPT_STATUS_BASE)));
489 if (mask)
490 do_IRQ(63 - dclz(mask), regs);
491 }
492}
diff --git a/arch/mips/sibyte/sb1250/irq_handler.S b/arch/mips/sibyte/sb1250/irq_handler.S
deleted file mode 100644
index 60edc8fb302b..000000000000
--- a/arch/mips/sibyte/sb1250/irq_handler.S
+++ /dev/null
@@ -1,147 +0,0 @@
1/*
2 * Copyright (C) 2000, 2001, 2002, 2003 Broadcom Corporation
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 */
18
19/*
20 * sb1250_handle_int() is the routine that is actually called when an interrupt
21 * occurs. It is installed as the exception vector handler in arch_init_irq()
22 * in arch/mips/sibyte/sb1250/irq.c
23 *
24 * In the handle we figure out which interrupts need handling, and use that to
25 * call the dispatcher, which will take care of actually calling registered
26 * handlers
27 *
28 * Note that we take care of all raised interrupts in one go at the handler.
29 * This is more BSDish than the Indy code, and also, IMHO, more sane.
30 */
31#include <linux/config.h>
32
33#include <asm/addrspace.h>
34#include <asm/asm.h>
35#include <asm/mipsregs.h>
36#include <asm/regdef.h>
37#include <asm/stackframe.h>
38#include <asm/sibyte/sb1250_defs.h>
39#include <asm/sibyte/sb1250_regs.h>
40#include <asm/sibyte/sb1250_int.h>
41
42/*
43 * What a pain. We have to be really careful saving the upper 32 bits of any
44 * register across function calls if we don't want them trashed--since were
45 * running in -o32, the calling routing never saves the full 64 bits of a
46 * register across a function call. Being the interrupt handler, we're
47 * guaranteed that interrupts are disabled during this code so we don't have
48 * to worry about random interrupts blasting the high 32 bits.
49 */
50
51 .text
52 .set push
53 .set noreorder
54 .set noat
55 .set mips64
56 .align 5
57 NESTED(sb1250_irq_handler, PT_SIZE, sp)
58 SAVE_ALL
59 CLI
60
61#ifdef CONFIG_SIBYTE_SB1250_PROF
62 /* Set compare to count to silence count/compare timer interrupts */
63 mfc0 t1, CP0_COUNT
64 mtc0 t1, CP0_COMPARE /* pause to clear IP[7] bit of cause ? */
65#endif
66 /* Read cause */
67 mfc0 s0, CP0_CAUSE
68
69#ifdef CONFIG_SIBYTE_SB1250_PROF
70 /* Cpu performance counter interrupt is routed to IP[7] */
71 andi t1, s0, CAUSEF_IP7
72 beqz t1, 0f
73 srl t1, s0, (CAUSEB_BD-2) /* Shift BD bit to bit 2 */
74 and t1, t1, 0x4 /* mask to get just BD bit */
75 mfc0 a0, CP0_EPC
76 jal sbprof_cpu_intr
77 addu a0, a0, t1 /* a0 = EPC + (BD ? 4 : 0) */
78 j ret_from_irq
79 nop
800:
81#endif
82
83 /* Timer interrupt is routed to IP[4] */
84 andi t1, s0, CAUSEF_IP4
85 beqz t1, 1f
86 nop
87 jal sb1250_timer_interrupt
88 move a0, sp /* Pass the registers along */
89 j ret_from_irq
90 nop # delay slot
911:
92
93#ifdef CONFIG_SMP
94 /* Mailbox interrupt is routed to IP[3] */
95 andi t1, s0, CAUSEF_IP3
96 beqz t1, 2f
97 nop
98 jal sb1250_mailbox_interrupt
99 move a0, sp
100 j ret_from_irq
101 nop # delay slot
1022:
103#endif
104
105#ifdef CONFIG_KGDB
106 /* KGDB (uart 1) interrupt is routed to IP[6] */
107 andi t1, s0, CAUSEF_IP6
108 beqz t1, 1f
109 nop # delay slot
110 jal sb1250_kgdb_interrupt
111 move a0, sp
112 j ret_from_irq
113 nop # delay slot
1141:
115#endif
116
117 and t1, s0, CAUSEF_IP2
118 beqz t1, 4f
119 nop
120
121 /*
122 * Default...we've hit an IP[2] interrupt, which means we've got to
123 * check the 1250 interrupt registers to figure out what to do
124 * Need to detect which CPU we're on, now that smp_affinity is supported.
125 */
126 PTR_LA v0, CKSEG1 + A_IMR_CPU0_BASE
127#ifdef CONFIG_SMP
128 lw t1, TI_CPU($28)
129 sll t1, IMR_REGISTER_SPACING_SHIFT
130 addu v0, t1
131#endif
132 ld s0, R_IMR_INTERRUPT_STATUS_BASE(v0) /* read IP[2] status */
133
134 beqz s0, 4f /* No interrupts. Return */
135 move a1, sp
136
1373: dclz s1, s0 /* Find the next interrupt */
138 dsubu a0, zero, s1
139 daddiu a0, a0, 63
140 jal do_IRQ
141 nop
142
1434: j ret_from_irq
144 nop
145
146 .set pop
147 END(sb1250_irq_handler)
diff --git a/arch/mips/sni/Makefile b/arch/mips/sni/Makefile
index 1e5676e4be86..9c7eaa5fb210 100644
--- a/arch/mips/sni/Makefile
+++ b/arch/mips/sni/Makefile
@@ -2,6 +2,6 @@
2# Makefile for the SNI specific part of the kernel 2# Makefile for the SNI specific part of the kernel
3# 3#
4 4
5obj-y += int-handler.o irq.o pcimt_scache.o reset.o setup.o 5obj-y += irq.o pcimt_scache.o reset.o setup.o
6 6
7EXTRA_AFLAGS := $(CFLAGS) 7EXTRA_AFLAGS := $(CFLAGS)
diff --git a/arch/mips/sni/int-handler.S b/arch/mips/sni/int-handler.S
deleted file mode 100644
index 2cdc09f55f18..000000000000
--- a/arch/mips/sni/int-handler.S
+++ /dev/null
@@ -1,106 +0,0 @@
1/*
2 * SNI RM200 PCI specific interrupt handler code.
3 *
4 * Copyright (C) 1994, 95, 96, 97, 98, 1999, 2000, 01 by Ralf Baechle
5 */
6#include <asm/asm.h>
7#include <asm/mipsregs.h>
8#include <asm/regdef.h>
9#include <asm/sni.h>
10#include <asm/stackframe.h>
11
12/*
13 * The PCI ASIC has the nasty property that it may delay writes if it is busy.
14 * As a consequence from writes that have not graduated when we exit from the
15 * interrupt handler we might catch a spurious interrupt. To avoid this we
16 * force the PCI ASIC to graduate all writes by executing a read from the
17 * PCI bus.
18 */
19 .set noreorder
20 .set noat
21 .align 5
22 NESTED(sni_rm200_pci_handle_int, PT_SIZE, sp)
23 SAVE_ALL
24 CLI
25 .set at
26
27 /* Blinken light ... */
28 lb t0, led_cache
29 addiu t0, 1
30 sb t0, led_cache
31 sb t0, PCIMT_CSLED # write only register
32 .data
33led_cache: .byte 0
34 .text
35
36 mfc0 t0, CP0_STATUS
37 mfc0 t1, CP0_CAUSE
38 and t0, t1
39
40 andi t1, t0, 0x0800 # hardware interrupt 1
41 bnez t1, _hwint1
42 andi t1, t0, 0x4000 # hardware interrupt 4
43 bnez t1, _hwint4
44 andi t1, t0, 0x2000 # hardware interrupt 3
45 bnez t1, _hwint3
46 andi t1, t0, 0x1000 # hardware interrupt 2
47 bnez t1, _hwint2
48 andi t1, t0, 0x8000 # hardware interrupt 5
49 bnez t1, _hwint5
50 andi t1, t0, 0x0400 # hardware interrupt 0
51 bnez t1, _hwint0
52 nop
53
54 j restore_all # spurious interrupt
55 nop
56
57 ##############################################################################
58
59/* hwint0 should deal with MP agent, ASIC PCI, EISA NMI and debug
60 button interrupts. */
61_hwint0: jal pciasic_hwint0
62 move a0, sp
63 j ret_from_irq
64 nop
65
66/*
67 * hwint 1 deals with EISA and SCSI interrupts
68 */
69_hwint1: jal pciasic_hwint1
70 move a0, sp
71 j ret_from_irq
72 nop
73
74
75/*
76 * This interrupt was used for the com1 console on the first prototypes;
77 * it's unsed otherwise
78 */
79_hwint2: jal pciasic_hwint2
80 move a0, sp
81 j ret_from_irq
82 nop
83
84/*
85 * hwint 3 are the PCI interrupts A - D
86 */
87_hwint3: jal pciasic_hwint3
88 move a0, sp
89 j ret_from_irq
90 nop
91
92/*
93 * hwint 4 is used for only the onboard PCnet 32.
94 */
95_hwint4: jal pciasic_hwint4
96 move a0, sp
97 j ret_from_irq
98 nop
99
100/* hwint5 is the r4k count / compare interrupt */
101_hwint5: jal pciasic_hwint5
102 move a0, sp
103 j ret_from_irq
104 nop
105
106 END(sni_rm200_pci_handle_int)
diff --git a/arch/mips/sni/irq.c b/arch/mips/sni/irq.c
index 952038aa4b90..7365b4853ddb 100644
--- a/arch/mips/sni/irq.c
+++ b/arch/mips/sni/irq.c
@@ -19,8 +19,6 @@
19 19
20DEFINE_SPINLOCK(pciasic_lock); 20DEFINE_SPINLOCK(pciasic_lock);
21 21
22extern asmlinkage void sni_rm200_pci_handle_int(void);
23
24static void enable_pciasic_irq(unsigned int irq) 22static void enable_pciasic_irq(unsigned int irq)
25{ 23{
26 unsigned int mask = 1 << (irq - PCIMT_IRQ_INT2); 24 unsigned int mask = 1 << (irq - PCIMT_IRQ_INT2);
@@ -71,20 +69,20 @@ static struct hw_interrupt_type pciasic_irq_type = {
71 * hwint0 should deal with MP agent, ASIC PCI, EISA NMI and debug 69 * hwint0 should deal with MP agent, ASIC PCI, EISA NMI and debug
72 * button interrupts. Later ... 70 * button interrupts. Later ...
73 */ 71 */
74void pciasic_hwint0(struct pt_regs *regs) 72static void pciasic_hwint0(struct pt_regs *regs)
75{ 73{
76 panic("Received int0 but no handler yet ..."); 74 panic("Received int0 but no handler yet ...");
77} 75}
78 76
79/* This interrupt was used for the com1 console on the first prototypes. */ 77/* This interrupt was used for the com1 console on the first prototypes. */
80void pciasic_hwint2(struct pt_regs *regs) 78static void pciasic_hwint2(struct pt_regs *regs)
81{ 79{
82 /* I think this shouldn't happen on production machines. */ 80 /* I think this shouldn't happen on production machines. */
83 panic("hwint2 and no handler yet"); 81 panic("hwint2 and no handler yet");
84} 82}
85 83
86/* hwint5 is the r4k count / compare interrupt */ 84/* hwint5 is the r4k count / compare interrupt */
87void pciasic_hwint5(struct pt_regs *regs) 85static void pciasic_hwint5(struct pt_regs *regs)
88{ 86{
89 panic("hwint5 and no handler yet"); 87 panic("hwint5 and no handler yet");
90} 88}
@@ -105,7 +103,7 @@ static unsigned int ls1bit8(unsigned int x)
105 * 103 *
106 * The EISA_INT bit in CSITPEND is high active, all others are low active. 104 * The EISA_INT bit in CSITPEND is high active, all others are low active.
107 */ 105 */
108void pciasic_hwint1(struct pt_regs *regs) 106static void pciasic_hwint1(struct pt_regs *regs)
109{ 107{
110 u8 pend = *(volatile char *)PCIMT_CSITPEND; 108 u8 pend = *(volatile char *)PCIMT_CSITPEND;
111 unsigned long flags; 109 unsigned long flags;
@@ -135,7 +133,7 @@ void pciasic_hwint1(struct pt_regs *regs)
135/* 133/*
136 * hwint 3 should deal with the PCI A - D interrupts, 134 * hwint 3 should deal with the PCI A - D interrupts,
137 */ 135 */
138void pciasic_hwint3(struct pt_regs *regs) 136static void pciasic_hwint3(struct pt_regs *regs)
139{ 137{
140 u8 pend = *(volatile char *)PCIMT_CSITPEND; 138 u8 pend = *(volatile char *)PCIMT_CSITPEND;
141 int irq; 139 int irq;
@@ -150,13 +148,34 @@ void pciasic_hwint3(struct pt_regs *regs)
150/* 148/*
151 * hwint 4 is used for only the onboard PCnet 32. 149 * hwint 4 is used for only the onboard PCnet 32.
152 */ 150 */
153void pciasic_hwint4(struct pt_regs *regs) 151static void pciasic_hwint4(struct pt_regs *regs)
154{ 152{
155 clear_c0_status(IE_IRQ4); 153 clear_c0_status(IE_IRQ4);
156 do_IRQ(PCIMT_IRQ_ETHERNET, regs); 154 do_IRQ(PCIMT_IRQ_ETHERNET, regs);
157 set_c0_status(IE_IRQ4); 155 set_c0_status(IE_IRQ4);
158} 156}
159 157
158asmlinkage void plat_irq_dispatch(struct pt_regs *regs)
159{
160 unsigned int pending = read_c0_status() & read_c0_cause();
161 static unsigned char led_cache;
162
163 *(volatile unsigned char *) PCIMT_CSLED = ++led_cache;
164
165 if (pending & 0x0800)
166 pciasic_hwint1(regs);
167 else if (pending & 0x4000)
168 pciasic_hwint4(regs);
169 else if (pending & 0x2000)
170 pciasic_hwint3(regs);
171 else if (pending & 0x1000)
172 pciasic_hwint2(regs);
173 else if (pending & 0x8000)
174 pciasic_hwint5(regs);
175 else if (pending & 0x0400)
176 pciasic_hwint0(regs);
177}
178
160void __init init_pciasic(void) 179void __init init_pciasic(void)
161{ 180{
162 unsigned long flags; 181 unsigned long flags;
@@ -176,8 +195,6 @@ void __init arch_init_irq(void)
176{ 195{
177 int i; 196 int i;
178 197
179 set_except_vector(0, sni_rm200_pci_handle_int);
180
181 init_i8259_irqs(); /* Integrated i8259 */ 198 init_i8259_irqs(); /* Integrated i8259 */
182 init_pciasic(); 199 init_pciasic();
183 200
diff --git a/arch/mips/tx4927/common/Makefile b/arch/mips/tx4927/common/Makefile
index 8fa126b296e1..9cb9535ebacb 100644
--- a/arch/mips/tx4927/common/Makefile
+++ b/arch/mips/tx4927/common/Makefile
@@ -6,7 +6,7 @@
6# unless it's something special (ie not a .c file). 6# unless it's something special (ie not a .c file).
7# 7#
8 8
9obj-y += tx4927_prom.o tx4927_setup.o tx4927_irq.o tx4927_irq_handler.o 9obj-y += tx4927_prom.o tx4927_setup.o tx4927_irq.o
10 10
11obj-$(CONFIG_TOSHIBA_FPCIB0) += smsc_fdc37m81x.o 11obj-$(CONFIG_TOSHIBA_FPCIB0) += smsc_fdc37m81x.o
12obj-$(CONFIG_KGDB) += tx4927_dbgio.o 12obj-$(CONFIG_KGDB) += tx4927_dbgio.o
diff --git a/arch/mips/tx4927/common/tx4927_irq.c b/arch/mips/tx4927/common/tx4927_irq.c
index 5ab2e2b76018..8ca68015cf40 100644
--- a/arch/mips/tx4927/common/tx4927_irq.c
+++ b/arch/mips/tx4927/common/tx4927_irq.c
@@ -525,8 +525,6 @@ static void tx4927_irq_pic_end(unsigned int irq)
525 */ 525 */
526void __init tx4927_irq_init(void) 526void __init tx4927_irq_init(void)
527{ 527{
528 extern asmlinkage void tx4927_irq_handler(void);
529
530 TX4927_IRQ_DPRINTK(TX4927_IRQ_INIT, "-\n"); 528 TX4927_IRQ_DPRINTK(TX4927_IRQ_INIT, "-\n");
531 529
532 TX4927_IRQ_DPRINTK(TX4927_IRQ_INIT, "=Calling tx4927_irq_cp0_init()\n"); 530 TX4927_IRQ_DPRINTK(TX4927_IRQ_INIT, "=Calling tx4927_irq_cp0_init()\n");
@@ -535,16 +533,12 @@ void __init tx4927_irq_init(void)
535 TX4927_IRQ_DPRINTK(TX4927_IRQ_INIT, "=Calling tx4927_irq_pic_init()\n"); 533 TX4927_IRQ_DPRINTK(TX4927_IRQ_INIT, "=Calling tx4927_irq_pic_init()\n");
536 tx4927_irq_pic_init(); 534 tx4927_irq_pic_init();
537 535
538 TX4927_IRQ_DPRINTK(TX4927_IRQ_INIT,
539 "=Calling set_except_vector(tx4927_irq_handler)\n");
540 set_except_vector(0, tx4927_irq_handler);
541
542 TX4927_IRQ_DPRINTK(TX4927_IRQ_INIT, "+\n"); 536 TX4927_IRQ_DPRINTK(TX4927_IRQ_INIT, "+\n");
543 537
544 return; 538 return;
545} 539}
546 540
547int tx4927_irq_nested(void) 541static int tx4927_irq_nested(void)
548{ 542{
549 int sw_irq = 0; 543 int sw_irq = 0;
550 u32 level2; 544 u32 level2;
@@ -582,3 +576,25 @@ int tx4927_irq_nested(void)
582 576
583 return (sw_irq); 577 return (sw_irq);
584} 578}
579
580asmlinkage void plat_irq_dispatch(struct pt_regs *regs)
581{
582 unsigned int pending = read_c0_status() & read_c0_cause();
583
584 if (pending & STATUSF_IP7) /* cpu timer */
585 do_IRQ(TX4927_IRQ_CPU_TIMER, regs);
586 else if (pending & STATUSF_IP2) { /* tx4927 pic */
587 unsigned int irq = tx4927_irq_nested();
588
589 if (unlikely(irq == 0)) {
590 spurious_interrupt(regs);
591 return;
592 }
593 do_IRQ(irq, regs);
594 } else if (pending & STATUSF_IP0) /* user line 0 */
595 do_IRQ(TX4927_IRQ_USER0, regs);
596 else if (pending & STATUSF_IP1) /* user line 1 */
597 do_IRQ(TX4927_IRQ_USER1, regs);
598 else
599 spurious_interrupt(regs);
600}
diff --git a/arch/mips/tx4927/common/tx4927_irq_handler.S b/arch/mips/tx4927/common/tx4927_irq_handler.S
deleted file mode 100644
index dd3ceda9d712..000000000000
--- a/arch/mips/tx4927/common/tx4927_irq_handler.S
+++ /dev/null
@@ -1,103 +0,0 @@
1/*
2 * linux/arch/mips/tx4927/common/tx4927_irq_handler.S
3 *
4 * Primary interrupt handler for tx4927 based systems
5 *
6 * Author: MontaVista Software, Inc.
7 * Author: jsun@mvista.com or jsun@junsun.net
8 * source@mvista.com
9 *
10 * Copyright 2001-2002 MontaVista Software Inc.
11 *
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version.
16 *
17 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
18 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
22 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
23 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
25 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
26 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * You should have received a copy of the GNU General Public License along
29 * with this program; if not, write to the Free Software Foundation, Inc.,
30 * 675 Mass Ave, Cambridge, MA 02139, USA.
31 */
32#include <asm/asm.h>
33#include <asm/mipsregs.h>
34#include <asm/addrspace.h>
35#include <asm/regdef.h>
36#include <asm/stackframe.h>
37#include <asm/tx4927/tx4927.h>
38
39 .align 5
40 NESTED(tx4927_irq_handler, PT_SIZE, sp)
41 SAVE_ALL
42 CLI
43 .set at
44
45 mfc0 t0, CP0_CAUSE
46 mfc0 t1, CP0_STATUS
47 and t0, t1
48
49 andi t1, t0, STATUSF_IP7 /* cpu timer */
50 bnez t1, ll_ip7
51
52 /* IP6..IP3 multiplexed -- do not use */
53
54 andi t1, t0, STATUSF_IP2 /* tx4927 pic */
55 bnez t1, ll_ip2
56
57 andi t1, t0, STATUSF_IP0 /* user line 0 */
58 bnez t1, ll_ip0
59
60 andi t1, t0, STATUSF_IP1 /* user line 1 */
61 bnez t1, ll_ip1
62
63 .set reorder
64
65 /* wrong alarm or masked ... */
66 j spurious_interrupt
67 nop
68 END(tx4927_irq_handler)
69
70 .align 5
71
72
73ll_ip7:
74 li a0, TX4927_IRQ_CPU_TIMER
75 move a1, sp
76 jal do_IRQ
77 j ret_from_irq
78
79ll_ip2:
80 jal tx4927_irq_nested
81 nop
82 beqz v0, goto_spurious_interrupt
83 nop
84 move a0, v0
85 move a1, sp
86 jal do_IRQ
87 j ret_from_irq
88
89goto_spurious_interrupt:
90 j spurious_interrupt
91 nop
92
93ll_ip1:
94 li a0, TX4927_IRQ_USER1
95 move a1, sp
96 jal do_IRQ
97 j ret_from_irq
98
99ll_ip0:
100 li a0, TX4927_IRQ_USER0
101 move a1, sp
102 jal do_IRQ
103 j ret_from_irq
diff --git a/arch/mips/tx4938/common/Makefile b/arch/mips/tx4938/common/Makefile
index 74c95c5bcdbf..2033ae77f632 100644
--- a/arch/mips/tx4938/common/Makefile
+++ b/arch/mips/tx4938/common/Makefile
@@ -6,6 +6,6 @@
6# unless it's something special (ie not a .c file). 6# unless it's something special (ie not a .c file).
7# 7#
8 8
9obj-y += prom.o setup.o irq.o irq_handler.o rtc_rx5c348.o 9obj-y += prom.o setup.o irq.o rtc_rx5c348.o
10obj-$(CONFIG_KGDB) += dbgio.o 10obj-$(CONFIG_KGDB) += dbgio.o
11 11
diff --git a/arch/mips/tx4938/common/irq.c b/arch/mips/tx4938/common/irq.c
index 4f90d7faf634..873805178d8e 100644
--- a/arch/mips/tx4938/common/irq.c
+++ b/arch/mips/tx4938/common/irq.c
@@ -392,11 +392,8 @@ tx4938_irq_pic_end(unsigned int irq)
392void __init 392void __init
393tx4938_irq_init(void) 393tx4938_irq_init(void)
394{ 394{
395 extern asmlinkage void tx4938_irq_handler(void);
396
397 tx4938_irq_cp0_init(); 395 tx4938_irq_cp0_init();
398 tx4938_irq_pic_init(); 396 tx4938_irq_pic_init();
399 set_except_vector(0, tx4938_irq_handler);
400 397
401 return; 398 return;
402} 399}
@@ -422,3 +419,21 @@ tx4938_irq_nested(void)
422 wbflush(); 419 wbflush();
423 return (sw_irq); 420 return (sw_irq);
424} 421}
422
423asmlinkage void plat_irq_dispatch(struct pt_regs *regs)
424{
425 unsigned int pending = read_c0_cause() & read_c0_status();
426
427 if (pending & STATUSF_IP7)
428 do_IRQ(TX4938_IRQ_CPU_TIMER, regs);
429 else if (pending & STATUSF_IP2) {
430 int irq = tx4938_irq_nested();
431 if (irq)
432 do_IRQ(irq, regs);
433 else
434 spurious_interrupt(regs);
435 } else if (pending & STATUSF_IP1)
436 do_IRQ(TX4938_IRQ_USER1, regs);
437 else if (pending & STATUSF_IP0)
438 do_IRQ(TX4938_IRQ_USER0, regs);
439}
diff --git a/arch/mips/tx4938/common/irq_handler.S b/arch/mips/tx4938/common/irq_handler.S
deleted file mode 100644
index 1b2f72bac42d..000000000000
--- a/arch/mips/tx4938/common/irq_handler.S
+++ /dev/null
@@ -1,84 +0,0 @@
1/*
2 * linux/arch/mips/tx4938/common/handler.S
3 *
4 * Primary interrupt handler for tx4938 based systems
5 * Copyright (C) 2000-2001 Toshiba Corporation
6 *
7 * 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the
8 * terms of the GNU General Public License version 2. This program is
9 * licensed "as is" without any warranty of any kind, whether express
10 * or implied.
11 *
12 * Support for TX4938 in 2.6 - Manish Lachwani (mlachwani@mvista.com)
13 */
14#include <asm/asm.h>
15#include <asm/mipsregs.h>
16#include <asm/addrspace.h>
17#include <asm/regdef.h>
18#include <asm/stackframe.h>
19#include <asm/tx4938/rbtx4938.h>
20
21
22 .align 5
23 NESTED(tx4938_irq_handler, PT_SIZE, sp)
24 SAVE_ALL
25 CLI
26 .set at
27
28 mfc0 t0, CP0_CAUSE
29 mfc0 t1, CP0_STATUS
30 and t0, t1
31
32 andi t1, t0, STATUSF_IP7 /* cpu timer */
33 bnez t1, ll_ip7
34
35 /* IP6..IP3 multiplexed -- do not use */
36
37 andi t1, t0, STATUSF_IP2 /* tx4938 pic */
38 bnez t1, ll_ip2
39
40 andi t1, t0, STATUSF_IP1 /* user line 1 */
41 bnez t1, ll_ip1
42
43 andi t1, t0, STATUSF_IP0 /* user line 0 */
44 bnez t1, ll_ip0
45
46 .set reorder
47
48 nop
49 END(tx4938_irq_handler)
50
51 .align 5
52
53
54ll_ip7:
55 li a0, TX4938_IRQ_CPU_TIMER
56 move a1, sp
57 jal do_IRQ
58 j ret_from_irq
59
60
61ll_ip2:
62 jal tx4938_irq_nested
63 nop
64 beqz v0, goto_spurious_interrupt
65 nop
66 move a0, v0
67 move a1, sp
68 jal do_IRQ
69 j ret_from_irq
70
71goto_spurious_interrupt:
72 j ret_from_irq
73
74ll_ip1:
75 li a0, TX4938_IRQ_USER1
76 move a1, sp
77 jal do_IRQ
78 j ret_from_irq
79
80ll_ip0:
81 li a0, TX4938_IRQ_USER0
82 move a1, sp
83 jal do_IRQ
84 j ret_from_irq
diff --git a/arch/mips/vr41xx/Kconfig b/arch/mips/vr41xx/Kconfig
index a7add16c9aa4..055a2cdfc841 100644
--- a/arch/mips/vr41xx/Kconfig
+++ b/arch/mips/vr41xx/Kconfig
@@ -4,6 +4,8 @@ config CASIO_E55
4 select DMA_NONCOHERENT 4 select DMA_NONCOHERENT
5 select IRQ_CPU 5 select IRQ_CPU
6 select ISA 6 select ISA
7 select SYS_HAS_CPU_VR41XX
8 select SYS_SUPPORTS_32BIT_KERNEL
7 select SYS_SUPPORTS_LITTLE_ENDIAN 9 select SYS_SUPPORTS_LITTLE_ENDIAN
8 10
9config IBM_WORKPAD 11config IBM_WORKPAD
@@ -12,6 +14,8 @@ config IBM_WORKPAD
12 select DMA_NONCOHERENT 14 select DMA_NONCOHERENT
13 select IRQ_CPU 15 select IRQ_CPU
14 select ISA 16 select ISA
17 select SYS_HAS_CPU_VR41XX
18 select SYS_SUPPORTS_32BIT_KERNEL
15 select SYS_SUPPORTS_LITTLE_ENDIAN 19 select SYS_SUPPORTS_LITTLE_ENDIAN
16 20
17config NEC_CMBVR4133 21config NEC_CMBVR4133
@@ -21,6 +25,9 @@ config NEC_CMBVR4133
21 select DMA_NONCOHERENT 25 select DMA_NONCOHERENT
22 select IRQ_CPU 26 select IRQ_CPU
23 select HW_HAS_PCI 27 select HW_HAS_PCI
28 select SYS_HAS_CPU_VR41XX
29 select SYS_SUPPORTS_32BIT_KERNEL
30 select SYS_SUPPORTS_LITTLE_ENDIAN
24 31
25config ROCKHOPPER 32config ROCKHOPPER
26 bool "Support for Rockhopper baseboard" 33 bool "Support for Rockhopper baseboard"
@@ -34,6 +41,8 @@ config TANBAC_TB022X
34 select DMA_NONCOHERENT 41 select DMA_NONCOHERENT
35 select HW_HAS_PCI 42 select HW_HAS_PCI
36 select IRQ_CPU 43 select IRQ_CPU
44 select SYS_HAS_CPU_VR41XX
45 select SYS_SUPPORTS_32BIT_KERNEL
37 select SYS_SUPPORTS_LITTLE_ENDIAN 46 select SYS_SUPPORTS_LITTLE_ENDIAN
38 help 47 help
39 The TANBAC VR4131 multichip module(TB0225) and 48 The TANBAC VR4131 multichip module(TB0225) and
@@ -65,6 +74,8 @@ config VICTOR_MPC30X
65 select DMA_NONCOHERENT 74 select DMA_NONCOHERENT
66 select HW_HAS_PCI 75 select HW_HAS_PCI
67 select IRQ_CPU 76 select IRQ_CPU
77 select SYS_HAS_CPU_VR41XX
78 select SYS_SUPPORTS_32BIT_KERNEL
68 select SYS_SUPPORTS_LITTLE_ENDIAN 79 select SYS_SUPPORTS_LITTLE_ENDIAN
69 80
70config ZAO_CAPCELLA 81config ZAO_CAPCELLA
@@ -73,6 +84,8 @@ config ZAO_CAPCELLA
73 select DMA_NONCOHERENT 84 select DMA_NONCOHERENT
74 select HW_HAS_PCI 85 select HW_HAS_PCI
75 select IRQ_CPU 86 select IRQ_CPU
87 select SYS_HAS_CPU_VR41XX
88 select SYS_SUPPORTS_32BIT_KERNEL
76 select SYS_SUPPORTS_LITTLE_ENDIAN 89 select SYS_SUPPORTS_LITTLE_ENDIAN
77 90
78config PCI_VR41XX 91config PCI_VR41XX
diff --git a/arch/mips/vr41xx/common/Makefile b/arch/mips/vr41xx/common/Makefile
index 9096302a7ecc..aa373974c80f 100644
--- a/arch/mips/vr41xx/common/Makefile
+++ b/arch/mips/vr41xx/common/Makefile
@@ -2,7 +2,7 @@
2# Makefile for common code of the NEC VR4100 series. 2# Makefile for common code of the NEC VR4100 series.
3# 3#
4 4
5obj-y += bcu.o cmu.o icu.o init.o int-handler.o irq.o pmu.o type.o 5obj-y += bcu.o cmu.o icu.o init.o irq.o pmu.o type.o
6obj-$(CONFIG_VRC4173) += vrc4173.o 6obj-$(CONFIG_VRC4173) += vrc4173.o
7 7
8EXTRA_AFLAGS := $(CFLAGS) 8EXTRA_AFLAGS := $(CFLAGS)
diff --git a/arch/mips/vr41xx/common/int-handler.S b/arch/mips/vr41xx/common/int-handler.S
deleted file mode 100644
index 2b6043f16d09..000000000000
--- a/arch/mips/vr41xx/common/int-handler.S
+++ /dev/null
@@ -1,114 +0,0 @@
1/*
2 * FILE NAME
3 * arch/mips/vr41xx/common/int-handler.S
4 *
5 * BRIEF MODULE DESCRIPTION
6 * Interrupt dispatcher for the NEC VR4100 series.
7 *
8 * Author: Yoichi Yuasa
9 * yyuasa@mvista.com or source@mvista.com
10 *
11 * Copyright 2001 MontaVista Software Inc.
12 *
13 * This program is free software; you can redistribute it and/or modify it
14 * under the terms of the GNU General Public License as published by the
15 * Free Software Foundation; either version 2 of the License, or (at your
16 * option) any later version.
17 *
18 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
19 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
20 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
24 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
26 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
27 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 *
29 * You should have received a copy of the GNU General Public License along
30 * with this program; if not, write to the Free Software Foundation, Inc.,
31 * 675 Mass Ave, Cambridge, MA 02139, USA.
32 */
33/*
34 * Changes:
35 * MontaVista Software Inc. <yyuasa@mvista.com> or <source@mvista.com>
36 * - New creation, NEC VR4100 series are supported.
37 *
38 * Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
39 * - Coped with INTASSIGN of NEC VR4133.
40 */
41#include <asm/asm.h>
42#include <asm/regdef.h>
43#include <asm/mipsregs.h>
44#include <asm/stackframe.h>
45
46 .text
47 .set noreorder
48
49 .align 5
50 NESTED(vr41xx_handle_interrupt, PT_SIZE, ra)
51 .set noat
52 SAVE_ALL
53 CLI
54 .set at
55 .set noreorder
56
57 /*
58 * Get the pending interrupts
59 */
60 mfc0 t0, CP0_CAUSE
61 mfc0 t1, CP0_STATUS
62 andi t0, 0xff00
63 and t0, t0, t1
64
65 andi t1, t0, CAUSEF_IP7 # MIPS timer interrupt
66 bnez t1, handle_irq
67 li a0, 7
68
69 andi t1, t0, 0x7800 # check for Int1-4
70 beqz t1, 1f
71
72 andi t1, t0, CAUSEF_IP3 # check for Int1
73 bnez t1, handle_int
74 li a0, 3
75
76 andi t1, t0, CAUSEF_IP4 # check for Int2
77 bnez t1, handle_int
78 li a0, 4
79
80 andi t1, t0, CAUSEF_IP5 # check for Int3
81 bnez t1, handle_int
82 li a0, 5
83
84 andi t1, t0, CAUSEF_IP6 # check for Int4
85 bnez t1, handle_int
86 li a0, 6
87
881:
89 andi t1, t0, CAUSEF_IP2 # check for Int0
90 bnez t1, handle_int
91 li a0, 2
92
93 andi t1, t0, CAUSEF_IP0 # check for IP0
94 bnez t1, handle_irq
95 li a0, 0
96
97 andi t1, t0, CAUSEF_IP1 # check for IP1
98 bnez t1, handle_irq
99 li a0, 1
100
101 j spurious_interrupt
102 nop
103
104handle_int:
105 jal irq_dispatch
106 move a1, sp
107 j ret_from_irq
108 nop
109
110handle_irq:
111 jal do_IRQ
112 move a1, sp
113 j ret_from_irq
114 END(vr41xx_handle_interrupt)
diff --git a/arch/mips/vr41xx/common/irq.c b/arch/mips/vr41xx/common/irq.c
index 61aa264275ff..86796bb63c3c 100644
--- a/arch/mips/vr41xx/common/irq.c
+++ b/arch/mips/vr41xx/common/irq.c
@@ -59,7 +59,7 @@ int cascade_irq(unsigned int irq, int (*get_irq)(unsigned int, struct pt_regs *)
59 59
60EXPORT_SYMBOL_GPL(cascade_irq); 60EXPORT_SYMBOL_GPL(cascade_irq);
61 61
62asmlinkage void irq_dispatch(unsigned int irq, struct pt_regs *regs) 62static void irq_dispatch(unsigned int irq, struct pt_regs *regs)
63{ 63{
64 irq_cascade_t *cascade; 64 irq_cascade_t *cascade;
65 irq_desc_t *desc; 65 irq_desc_t *desc;
@@ -84,11 +84,32 @@ asmlinkage void irq_dispatch(unsigned int irq, struct pt_regs *regs)
84 do_IRQ(irq, regs); 84 do_IRQ(irq, regs);
85} 85}
86 86
87extern asmlinkage void vr41xx_handle_interrupt(void); 87asmlinkage void plat_irq_dispatch(struct pt_regs *regs)
88{
89 unsigned int pending = read_c0_cause() & read_c0_status() & ST0_IM;
90
91 if (pending & CAUSEF_IP7)
92 do_IRQ(7, regs);
93 else if (pending & 0x7800) {
94 if (pending & CAUSEF_IP3)
95 irq_dispatch(3, regs);
96 else if (pending & CAUSEF_IP4)
97 irq_dispatch(4, regs);
98 else if (pending & CAUSEF_IP5)
99 irq_dispatch(5, regs);
100 else if (pending & CAUSEF_IP6)
101 irq_dispatch(6, regs);
102 } else if (pending & CAUSEF_IP2)
103 irq_dispatch(2, regs);
104 else if (pending & CAUSEF_IP0)
105 do_IRQ(0, regs);
106 else if (pending & CAUSEF_IP1)
107 do_IRQ(1, regs);
108 else
109 spurious_interrupt(regs);
110}
88 111
89void __init arch_init_irq(void) 112void __init arch_init_irq(void)
90{ 113{
91 mips_cpu_irq_init(MIPS_CPU_IRQ_BASE); 114 mips_cpu_irq_init(MIPS_CPU_IRQ_BASE);
92
93 set_except_vector(0, vr41xx_handle_interrupt);
94} 115}
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
index 19f911c5dd58..910fb3afc0b5 100644
--- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -138,6 +138,37 @@ config 64BIT
138 enable this option otherwise. The 64bit kernel is significantly bigger 138 enable this option otherwise. The 64bit kernel is significantly bigger
139 and slower than the 32bit one. 139 and slower than the 32bit one.
140 140
141choice
142 prompt "Kernel page size"
143 default PARISC_PAGE_SIZE_4KB if !64BIT
144 default PARISC_PAGE_SIZE_4KB if 64BIT
145# default PARISC_PAGE_SIZE_16KB if 64BIT
146
147config PARISC_PAGE_SIZE_4KB
148 bool "4KB"
149 help
150 This lets you select the page size of the kernel. For best
151 performance, a page size of 16KB is recommended. For best
152 compatibility with 32bit applications, a page size of 4KB should be
153 selected (the vast majority of 32bit binaries work perfectly fine
154 with a larger page size).
155
156 4KB For best 32bit compatibility
157 16KB For best performance
158 64KB For best performance, might give more overhead.
159
160 If you don't know what to do, choose 4KB.
161
162config PARISC_PAGE_SIZE_16KB
163 bool "16KB (EXPERIMENTAL)"
164 depends on PA8X00 && EXPERIMENTAL
165
166config PARISC_PAGE_SIZE_64KB
167 bool "64KB (EXPERIMENTAL)"
168 depends on PA8X00 && EXPERIMENTAL
169
170endchoice
171
141config SMP 172config SMP
142 bool "Symmetric multi-processing support" 173 bool "Symmetric multi-processing support"
143 ---help--- 174 ---help---
diff --git a/arch/parisc/defconfig b/arch/parisc/defconfig
index 59f7bc38e72e..b38b58eb9dc2 100644
--- a/arch/parisc/defconfig
+++ b/arch/parisc/defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-pa6 3# Linux kernel version: 2.6.16-pa10
4# Sun Mar 26 19:50:07 2006 4# Sun Apr 2 15:26:38 2006
5# 5#
6CONFIG_PARISC=y 6CONFIG_PARISC=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -25,7 +25,7 @@ CONFIG_LOCALVERSION=""
25# CONFIG_LOCALVERSION_AUTO is not set 25# CONFIG_LOCALVERSION_AUTO is not set
26CONFIG_SWAP=y 26CONFIG_SWAP=y
27CONFIG_SYSVIPC=y 27CONFIG_SYSVIPC=y
28# CONFIG_POSIX_MQUEUE is not set 28CONFIG_POSIX_MQUEUE=y
29# CONFIG_BSD_PROCESS_ACCT is not set 29# CONFIG_BSD_PROCESS_ACCT is not set
30CONFIG_SYSCTL=y 30CONFIG_SYSCTL=y
31# CONFIG_AUDIT is not set 31# CONFIG_AUDIT is not set
@@ -35,7 +35,7 @@ CONFIG_INITRAMFS_SOURCE=""
35CONFIG_CC_OPTIMIZE_FOR_SIZE=y 35CONFIG_CC_OPTIMIZE_FOR_SIZE=y
36# CONFIG_EMBEDDED is not set 36# CONFIG_EMBEDDED is not set
37CONFIG_KALLSYMS=y 37CONFIG_KALLSYMS=y
38# CONFIG_KALLSYMS_ALL is not set 38CONFIG_KALLSYMS_ALL=y
39# CONFIG_KALLSYMS_EXTRA_PASS is not set 39# CONFIG_KALLSYMS_EXTRA_PASS is not set
40CONFIG_HOTPLUG=y 40CONFIG_HOTPLUG=y
41CONFIG_PRINTK=y 41CONFIG_PRINTK=y
@@ -57,7 +57,13 @@ CONFIG_BASE_SMALL=0
57# 57#
58# Loadable module support 58# Loadable module support
59# 59#
60# CONFIG_MODULES is not set 60CONFIG_MODULES=y
61CONFIG_MODULE_UNLOAD=y
62CONFIG_MODULE_FORCE_UNLOAD=y
63CONFIG_OBSOLETE_MODPARM=y
64# CONFIG_MODVERSIONS is not set
65# CONFIG_MODULE_SRCVERSION_ALL is not set
66CONFIG_KMOD=y
61 67
62# 68#
63# Block layer 69# Block layer
@@ -79,16 +85,19 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
79# 85#
80# Processor type and features 86# Processor type and features
81# 87#
82CONFIG_PA7000=y 88# CONFIG_PA7000 is not set
83# CONFIG_PA7100LC is not set 89CONFIG_PA7100LC=y
84# CONFIG_PA7200 is not set 90# CONFIG_PA7200 is not set
85# CONFIG_PA7300LC is not set 91# CONFIG_PA7300LC is not set
86# CONFIG_PA8X00 is not set 92# CONFIG_PA8X00 is not set
87CONFIG_PA11=y 93CONFIG_PA11=y
94CONFIG_PARISC_PAGE_SIZE_4KB=y
95# CONFIG_PARISC_PAGE_SIZE_16KB is not set
96# CONFIG_PARISC_PAGE_SIZE_64KB is not set
88# CONFIG_SMP is not set 97# CONFIG_SMP is not set
89CONFIG_ARCH_FLATMEM_ENABLE=y 98CONFIG_ARCH_FLATMEM_ENABLE=y
90CONFIG_PREEMPT_NONE=y 99# CONFIG_PREEMPT_NONE is not set
91# CONFIG_PREEMPT_VOLUNTARY is not set 100CONFIG_PREEMPT_VOLUNTARY=y
92# CONFIG_PREEMPT is not set 101# CONFIG_PREEMPT is not set
93# CONFIG_HZ_100 is not set 102# CONFIG_HZ_100 is not set
94CONFIG_HZ_250=y 103CONFIG_HZ_250=y
@@ -108,7 +117,7 @@ CONFIG_SPLIT_PTLOCK_CPUS=4096
108# Bus options (PCI, PCMCIA, EISA, GSC, ISA) 117# Bus options (PCI, PCMCIA, EISA, GSC, ISA)
109# 118#
110CONFIG_GSC=y 119CONFIG_GSC=y
111CONFIG_HPPB=y 120# CONFIG_HPPB is not set
112CONFIG_IOMMU_CCIO=y 121CONFIG_IOMMU_CCIO=y
113CONFIG_GSC_LASI=y 122CONFIG_GSC_LASI=y
114CONFIG_GSC_WAX=y 123CONFIG_GSC_WAX=y
@@ -126,7 +135,25 @@ CONFIG_IOMMU_SBA=y
126# 135#
127# PCCARD (PCMCIA/CardBus) support 136# PCCARD (PCMCIA/CardBus) support
128# 137#
129# CONFIG_PCCARD is not set 138CONFIG_PCCARD=y
139# CONFIG_PCMCIA_DEBUG is not set
140CONFIG_PCMCIA=y
141CONFIG_PCMCIA_LOAD_CIS=y
142CONFIG_PCMCIA_IOCTL=y
143CONFIG_CARDBUS=y
144
145#
146# PC-card bridges
147#
148CONFIG_YENTA=y
149CONFIG_YENTA_O2=y
150CONFIG_YENTA_RICOH=y
151CONFIG_YENTA_TI=y
152CONFIG_YENTA_ENE_TUNE=y
153CONFIG_YENTA_TOSHIBA=y
154CONFIG_PD6729=y
155CONFIG_I82092=y
156CONFIG_PCCARD_NONSTATIC=y
130 157
131# 158#
132# PCI Hotplug Support 159# PCI Hotplug Support
@@ -145,7 +172,7 @@ CONFIG_PDC_STABLE=y
145# Executable file formats 172# Executable file formats
146# 173#
147CONFIG_BINFMT_ELF=y 174CONFIG_BINFMT_ELF=y
148# CONFIG_BINFMT_MISC is not set 175CONFIG_BINFMT_MISC=m
149 176
150# 177#
151# Networking 178# Networking
@@ -159,13 +186,15 @@ CONFIG_NET=y
159CONFIG_PACKET=y 186CONFIG_PACKET=y
160CONFIG_PACKET_MMAP=y 187CONFIG_PACKET_MMAP=y
161CONFIG_UNIX=y 188CONFIG_UNIX=y
162# CONFIG_NET_KEY is not set 189CONFIG_XFRM=y
190CONFIG_XFRM_USER=m
191CONFIG_NET_KEY=m
163CONFIG_INET=y 192CONFIG_INET=y
164CONFIG_IP_MULTICAST=y 193CONFIG_IP_MULTICAST=y
165# CONFIG_IP_ADVANCED_ROUTER is not set 194# CONFIG_IP_ADVANCED_ROUTER is not set
166CONFIG_IP_FIB_HASH=y 195CONFIG_IP_FIB_HASH=y
167CONFIG_IP_PNP=y 196CONFIG_IP_PNP=y
168# CONFIG_IP_PNP_DHCP is not set 197CONFIG_IP_PNP_DHCP=y
169CONFIG_IP_PNP_BOOTP=y 198CONFIG_IP_PNP_BOOTP=y
170# CONFIG_IP_PNP_RARP is not set 199# CONFIG_IP_PNP_RARP is not set
171# CONFIG_NET_IPIP is not set 200# CONFIG_NET_IPIP is not set
@@ -173,19 +202,20 @@ CONFIG_IP_PNP_BOOTP=y
173# CONFIG_IP_MROUTE is not set 202# CONFIG_IP_MROUTE is not set
174# CONFIG_ARPD is not set 203# CONFIG_ARPD is not set
175# CONFIG_SYN_COOKIES is not set 204# CONFIG_SYN_COOKIES is not set
176# CONFIG_INET_AH is not set 205CONFIG_INET_AH=m
177# CONFIG_INET_ESP is not set 206CONFIG_INET_ESP=m
178# CONFIG_INET_IPCOMP is not set 207# CONFIG_INET_IPCOMP is not set
179# CONFIG_INET_TUNNEL is not set 208CONFIG_INET_TUNNEL=m
180# CONFIG_INET_DIAG is not set 209CONFIG_INET_DIAG=m
210CONFIG_INET_TCP_DIAG=m
181# CONFIG_TCP_CONG_ADVANCED is not set 211# CONFIG_TCP_CONG_ADVANCED is not set
182CONFIG_TCP_CONG_BIC=y 212CONFIG_TCP_CONG_BIC=y
183CONFIG_IPV6=y 213CONFIG_IPV6=y
184# CONFIG_IPV6_PRIVACY is not set 214# CONFIG_IPV6_PRIVACY is not set
185# CONFIG_INET6_AH is not set 215CONFIG_INET6_AH=y
186# CONFIG_INET6_ESP is not set 216CONFIG_INET6_ESP=y
187# CONFIG_INET6_IPCOMP is not set 217CONFIG_INET6_IPCOMP=y
188# CONFIG_INET6_TUNNEL is not set 218CONFIG_INET6_TUNNEL=y
189# CONFIG_IPV6_TUNNEL is not set 219# CONFIG_IPV6_TUNNEL is not set
190# CONFIG_NETFILTER is not set 220# CONFIG_NETFILTER is not set
191 221
@@ -207,7 +237,8 @@ CONFIG_IPV6=y
207# CONFIG_BRIDGE is not set 237# CONFIG_BRIDGE is not set
208# CONFIG_VLAN_8021Q is not set 238# CONFIG_VLAN_8021Q is not set
209# CONFIG_DECNET is not set 239# CONFIG_DECNET is not set
210# CONFIG_LLC2 is not set 240CONFIG_LLC=m
241CONFIG_LLC2=m
211# CONFIG_IPX is not set 242# CONFIG_IPX is not set
212# CONFIG_ATALK is not set 243# CONFIG_ATALK is not set
213# CONFIG_X25 is not set 244# CONFIG_X25 is not set
@@ -237,9 +268,9 @@ CONFIG_IPV6=y
237# 268#
238# Generic Driver Options 269# Generic Driver Options
239# 270#
240CONFIG_STANDALONE=y 271# CONFIG_STANDALONE is not set
241CONFIG_PREVENT_FIRMWARE_BUILD=y 272# CONFIG_PREVENT_FIRMWARE_BUILD is not set
242# CONFIG_FW_LOADER is not set 273CONFIG_FW_LOADER=y
243# CONFIG_DEBUG_DRIVER is not set 274# CONFIG_DEBUG_DRIVER is not set
244 275
245# 276#
@@ -256,13 +287,14 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
256# Parallel port support 287# Parallel port support
257# 288#
258CONFIG_PARPORT=y 289CONFIG_PARPORT=y
259CONFIG_PARPORT_PC=y 290CONFIG_PARPORT_PC=m
260# CONFIG_PARPORT_SERIAL is not set 291# CONFIG_PARPORT_SERIAL is not set
261# CONFIG_PARPORT_PC_FIFO is not set 292# CONFIG_PARPORT_PC_FIFO is not set
262# CONFIG_PARPORT_PC_SUPERIO is not set 293# CONFIG_PARPORT_PC_SUPERIO is not set
294CONFIG_PARPORT_PC_PCMCIA=m
263CONFIG_PARPORT_NOT_PC=y 295CONFIG_PARPORT_NOT_PC=y
264CONFIG_PARPORT_GSC=y 296CONFIG_PARPORT_GSC=y
265# CONFIG_PARPORT_1284 is not set 297CONFIG_PARPORT_1284=y
266 298
267# 299#
268# Plug and Play support 300# Plug and Play support
@@ -284,7 +316,7 @@ CONFIG_BLK_DEV_CRYPTOLOOP=y
284# CONFIG_BLK_DEV_UB is not set 316# CONFIG_BLK_DEV_UB is not set
285CONFIG_BLK_DEV_RAM=y 317CONFIG_BLK_DEV_RAM=y
286CONFIG_BLK_DEV_RAM_COUNT=16 318CONFIG_BLK_DEV_RAM_COUNT=16
287CONFIG_BLK_DEV_RAM_SIZE=4096 319CONFIG_BLK_DEV_RAM_SIZE=6144
288CONFIG_BLK_DEV_INITRD=y 320CONFIG_BLK_DEV_INITRD=y
289# CONFIG_CDROM_PKTCDVD is not set 321# CONFIG_CDROM_PKTCDVD is not set
290# CONFIG_ATA_OVER_ETH is not set 322# CONFIG_ATA_OVER_ETH is not set
@@ -292,7 +324,60 @@ CONFIG_BLK_DEV_INITRD=y
292# 324#
293# ATA/ATAPI/MFM/RLL support 325# ATA/ATAPI/MFM/RLL support
294# 326#
295# CONFIG_IDE is not set 327CONFIG_IDE=y
328CONFIG_BLK_DEV_IDE=y
329
330#
331# Please see Documentation/ide.txt for help/info on IDE drives
332#
333# CONFIG_BLK_DEV_IDE_SATA is not set
334CONFIG_BLK_DEV_IDEDISK=y
335CONFIG_IDEDISK_MULTI_MODE=y
336CONFIG_BLK_DEV_IDECS=y
337CONFIG_BLK_DEV_IDECD=y
338# CONFIG_BLK_DEV_IDETAPE is not set
339# CONFIG_BLK_DEV_IDEFLOPPY is not set
340CONFIG_BLK_DEV_IDESCSI=y
341# CONFIG_IDE_TASK_IOCTL is not set
342
343#
344# IDE chipset support/bugfixes
345#
346CONFIG_IDE_GENERIC=y
347CONFIG_BLK_DEV_IDEPCI=y
348CONFIG_IDEPCI_SHARE_IRQ=y
349# CONFIG_BLK_DEV_OFFBOARD is not set
350CONFIG_BLK_DEV_GENERIC=y
351# CONFIG_BLK_DEV_OPTI621 is not set
352CONFIG_BLK_DEV_IDEDMA_PCI=y
353# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
354# CONFIG_IDEDMA_PCI_AUTO is not set
355# CONFIG_BLK_DEV_AEC62XX is not set
356# CONFIG_BLK_DEV_ALI15X3 is not set
357# CONFIG_BLK_DEV_AMD74XX is not set
358# CONFIG_BLK_DEV_CMD64X is not set
359# CONFIG_BLK_DEV_TRIFLEX is not set
360# CONFIG_BLK_DEV_CY82C693 is not set
361# CONFIG_BLK_DEV_CS5520 is not set
362# CONFIG_BLK_DEV_CS5530 is not set
363# CONFIG_BLK_DEV_HPT34X is not set
364# CONFIG_BLK_DEV_HPT366 is not set
365# CONFIG_BLK_DEV_SC1200 is not set
366# CONFIG_BLK_DEV_PIIX is not set
367# CONFIG_BLK_DEV_IT821X is not set
368CONFIG_BLK_DEV_NS87415=y
369# CONFIG_BLK_DEV_PDC202XX_OLD is not set
370# CONFIG_BLK_DEV_PDC202XX_NEW is not set
371# CONFIG_BLK_DEV_SVWKS is not set
372# CONFIG_BLK_DEV_SIIMAGE is not set
373# CONFIG_BLK_DEV_SLC90E66 is not set
374# CONFIG_BLK_DEV_TRM290 is not set
375# CONFIG_BLK_DEV_VIA82CXXX is not set
376# CONFIG_IDE_ARM is not set
377CONFIG_BLK_DEV_IDEDMA=y
378# CONFIG_IDEDMA_IVB is not set
379# CONFIG_IDEDMA_AUTO is not set
380# CONFIG_BLK_DEV_HD is not set
296 381
297# 382#
298# SCSI device support 383# SCSI device support
@@ -375,6 +460,15 @@ CONFIG_SCSI_NCR53C8XX_SYNC=20
375# CONFIG_SCSI_DEBUG is not set 460# CONFIG_SCSI_DEBUG is not set
376 461
377# 462#
463# PCMCIA SCSI adapter support
464#
465# CONFIG_PCMCIA_AHA152X is not set
466# CONFIG_PCMCIA_FDOMAIN is not set
467# CONFIG_PCMCIA_NINJA_SCSI is not set
468# CONFIG_PCMCIA_QLOGIC is not set
469# CONFIG_PCMCIA_SYM53C500 is not set
470
471#
378# Multi-device support (RAID and LVM) 472# Multi-device support (RAID and LVM)
379# 473#
380CONFIG_MD=y 474CONFIG_MD=y
@@ -382,12 +476,17 @@ CONFIG_BLK_DEV_MD=y
382CONFIG_MD_LINEAR=y 476CONFIG_MD_LINEAR=y
383CONFIG_MD_RAID0=y 477CONFIG_MD_RAID0=y
384CONFIG_MD_RAID1=y 478CONFIG_MD_RAID1=y
385# CONFIG_MD_RAID10 is not set 479CONFIG_MD_RAID10=y
386CONFIG_MD_RAID5=y 480CONFIG_MD_RAID5=y
387# CONFIG_MD_RAID6 is not set 481CONFIG_MD_RAID6=y
388# CONFIG_MD_MULTIPATH is not set 482# CONFIG_MD_MULTIPATH is not set
389# CONFIG_MD_FAULTY is not set 483# CONFIG_MD_FAULTY is not set
390# CONFIG_BLK_DEV_DM is not set 484CONFIG_BLK_DEV_DM=y
485# CONFIG_DM_CRYPT is not set
486# CONFIG_DM_SNAPSHOT is not set
487# CONFIG_DM_MIRROR is not set
488# CONFIG_DM_ZERO is not set
489# CONFIG_DM_MULTIPATH is not set
391 490
392# 491#
393# Fusion MPT device support 492# Fusion MPT device support
@@ -411,10 +510,10 @@ CONFIG_MD_RAID5=y
411# Network device support 510# Network device support
412# 511#
413CONFIG_NETDEVICES=y 512CONFIG_NETDEVICES=y
414# CONFIG_DUMMY is not set 513CONFIG_DUMMY=m
415# CONFIG_BONDING is not set 514CONFIG_BONDING=m
416# CONFIG_EQUALIZER is not set 515# CONFIG_EQUALIZER is not set
417# CONFIG_TUN is not set 516CONFIG_TUN=m
418 517
419# 518#
420# ARCnet devices 519# ARCnet devices
@@ -430,7 +529,7 @@ CONFIG_NETDEVICES=y
430# Ethernet (10 or 100Mbit) 529# Ethernet (10 or 100Mbit)
431# 530#
432CONFIG_NET_ETHERNET=y 531CONFIG_NET_ETHERNET=y
433# CONFIG_MII is not set 532CONFIG_MII=m
434CONFIG_LASI_82596=y 533CONFIG_LASI_82596=y
435# CONFIG_HAPPYMEAL is not set 534# CONFIG_HAPPYMEAL is not set
436# CONFIG_SUNGEM is not set 535# CONFIG_SUNGEM is not set
@@ -451,6 +550,8 @@ CONFIG_TULIP=y
451# CONFIG_WINBOND_840 is not set 550# CONFIG_WINBOND_840 is not set
452# CONFIG_DM9102 is not set 551# CONFIG_DM9102 is not set
453# CONFIG_ULI526X is not set 552# CONFIG_ULI526X is not set
553# CONFIG_PCMCIA_XIRCOM is not set
554# CONFIG_PCMCIA_XIRTULIP is not set
454# CONFIG_DEPCA is not set 555# CONFIG_DEPCA is not set
455# CONFIG_HP100 is not set 556# CONFIG_HP100 is not set
456CONFIG_NET_PCI=y 557CONFIG_NET_PCI=y
@@ -518,14 +619,33 @@ CONFIG_NET_RADIO=y
518# Obsolete Wireless cards support (pre-802.11) 619# Obsolete Wireless cards support (pre-802.11)
519# 620#
520# CONFIG_STRIP is not set 621# CONFIG_STRIP is not set
622# CONFIG_PCMCIA_WAVELAN is not set
623# CONFIG_PCMCIA_NETWAVE is not set
624
625#
626# Wireless 802.11 Frequency Hopping cards support
627#
628# CONFIG_PCMCIA_RAYCS is not set
521 629
522# 630#
523# Wireless 802.11b ISA/PCI cards support 631# Wireless 802.11b ISA/PCI cards support
524# 632#
525# CONFIG_HERMES is not set 633CONFIG_HERMES=y
634# CONFIG_PLX_HERMES is not set
635# CONFIG_TMD_HERMES is not set
636# CONFIG_NORTEL_HERMES is not set
637# CONFIG_PCI_HERMES is not set
526# CONFIG_ATMEL is not set 638# CONFIG_ATMEL is not set
527 639
528# 640#
641# Wireless 802.11b Pcmcia/Cardbus cards support
642#
643CONFIG_PCMCIA_HERMES=y
644CONFIG_PCMCIA_SPECTRUM=y
645# CONFIG_AIRO_CS is not set
646# CONFIG_PCMCIA_WL3501 is not set
647
648#
529# Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support 649# Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support
530# 650#
531# CONFIG_PRISM54 is not set 651# CONFIG_PRISM54 is not set
@@ -533,13 +653,34 @@ CONFIG_NET_RADIO=y
533CONFIG_NET_WIRELESS=y 653CONFIG_NET_WIRELESS=y
534 654
535# 655#
656# PCMCIA network device support
657#
658CONFIG_NET_PCMCIA=y
659# CONFIG_PCMCIA_3C589 is not set
660# CONFIG_PCMCIA_3C574 is not set
661# CONFIG_PCMCIA_FMVJ18X is not set
662# CONFIG_PCMCIA_PCNET is not set
663# CONFIG_PCMCIA_NMCLAN is not set
664# CONFIG_PCMCIA_SMC91C92 is not set
665# CONFIG_PCMCIA_XIRC2PS is not set
666# CONFIG_PCMCIA_AXNET is not set
667
668#
536# Wan interfaces 669# Wan interfaces
537# 670#
538# CONFIG_WAN is not set 671# CONFIG_WAN is not set
539# CONFIG_FDDI is not set 672# CONFIG_FDDI is not set
540# CONFIG_HIPPI is not set 673# CONFIG_HIPPI is not set
541# CONFIG_PLIP is not set 674# CONFIG_PLIP is not set
542# CONFIG_PPP is not set 675CONFIG_PPP=m
676# CONFIG_PPP_MULTILINK is not set
677# CONFIG_PPP_FILTER is not set
678CONFIG_PPP_ASYNC=m
679CONFIG_PPP_SYNC_TTY=m
680CONFIG_PPP_DEFLATE=m
681CONFIG_PPP_BSDCOMP=m
682# CONFIG_PPP_MPPE is not set
683CONFIG_PPPOE=m
543# CONFIG_SLIP is not set 684# CONFIG_SLIP is not set
544# CONFIG_NET_FC is not set 685# CONFIG_NET_FC is not set
545# CONFIG_SHAPER is not set 686# CONFIG_SHAPER is not set
@@ -571,14 +712,16 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
571CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 712CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
572# CONFIG_INPUT_JOYDEV is not set 713# CONFIG_INPUT_JOYDEV is not set
573# CONFIG_INPUT_TSDEV is not set 714# CONFIG_INPUT_TSDEV is not set
574CONFIG_INPUT_EVDEV=y 715# CONFIG_INPUT_EVDEV is not set
575# CONFIG_INPUT_EVBUG is not set 716# CONFIG_INPUT_EVBUG is not set
576 717
577# 718#
578# Input Device Drivers 719# Input Device Drivers
579# 720#
580CONFIG_INPUT_KEYBOARD=y 721CONFIG_INPUT_KEYBOARD=y
581# CONFIG_KEYBOARD_ATKBD is not set 722CONFIG_KEYBOARD_ATKBD=y
723CONFIG_KEYBOARD_ATKBD_HP_KEYCODES=y
724# CONFIG_KEYBOARD_ATKBD_RDI_KEYCODES is not set
582# CONFIG_KEYBOARD_SUNKBD is not set 725# CONFIG_KEYBOARD_SUNKBD is not set
583# CONFIG_KEYBOARD_LKKBD is not set 726# CONFIG_KEYBOARD_LKKBD is not set
584# CONFIG_KEYBOARD_XTKBD is not set 727# CONFIG_KEYBOARD_XTKBD is not set
@@ -586,52 +729,25 @@ CONFIG_INPUT_KEYBOARD=y
586# CONFIG_KEYBOARD_HIL_OLD is not set 729# CONFIG_KEYBOARD_HIL_OLD is not set
587CONFIG_KEYBOARD_HIL=y 730CONFIG_KEYBOARD_HIL=y
588CONFIG_INPUT_MOUSE=y 731CONFIG_INPUT_MOUSE=y
589# CONFIG_MOUSE_PS2 is not set 732CONFIG_MOUSE_PS2=y
590# CONFIG_MOUSE_SERIAL is not set 733CONFIG_MOUSE_SERIAL=y
591# CONFIG_MOUSE_VSXXXAA is not set 734# CONFIG_MOUSE_VSXXXAA is not set
592CONFIG_MOUSE_HIL=y 735CONFIG_MOUSE_HIL=y
593CONFIG_INPUT_JOYSTICK=y 736# CONFIG_INPUT_JOYSTICK is not set
594# CONFIG_JOYSTICK_ANALOG is not set 737# CONFIG_INPUT_TOUCHSCREEN is not set
595# CONFIG_JOYSTICK_A3D is not set 738# CONFIG_INPUT_MISC is not set
596# CONFIG_JOYSTICK_ADI is not set
597# CONFIG_JOYSTICK_COBRA is not set
598# CONFIG_JOYSTICK_GF2K is not set
599# CONFIG_JOYSTICK_GRIP is not set
600# CONFIG_JOYSTICK_GRIP_MP is not set
601# CONFIG_JOYSTICK_GUILLEMOT is not set
602# CONFIG_JOYSTICK_INTERACT is not set
603# CONFIG_JOYSTICK_SIDEWINDER is not set
604# CONFIG_JOYSTICK_TMDC is not set
605# CONFIG_JOYSTICK_IFORCE is not set
606# CONFIG_JOYSTICK_WARRIOR is not set
607# CONFIG_JOYSTICK_MAGELLAN is not set
608# CONFIG_JOYSTICK_SPACEORB is not set
609# CONFIG_JOYSTICK_SPACEBALL is not set
610# CONFIG_JOYSTICK_STINGER is not set
611# CONFIG_JOYSTICK_TWIDJOY is not set
612# CONFIG_JOYSTICK_DB9 is not set
613# CONFIG_JOYSTICK_GAMECON is not set
614# CONFIG_JOYSTICK_TURBOGRAFX is not set
615# CONFIG_JOYSTICK_JOYDUMP is not set
616CONFIG_INPUT_TOUCHSCREEN=y
617# CONFIG_TOUCHSCREEN_GUNZE is not set
618# CONFIG_TOUCHSCREEN_ELO is not set
619# CONFIG_TOUCHSCREEN_MTOUCH is not set
620# CONFIG_TOUCHSCREEN_MK712 is not set
621CONFIG_INPUT_MISC=y
622# CONFIG_INPUT_UINPUT is not set
623CONFIG_HP_SDC_RTC=y
624 739
625# 740#
626# Hardware I/O ports 741# Hardware I/O ports
627# 742#
628CONFIG_SERIO=y 743CONFIG_SERIO=y
629# CONFIG_SERIO_SERPORT is not set 744CONFIG_SERIO_SERPORT=y
630# CONFIG_SERIO_PARKBD is not set 745# CONFIG_SERIO_PARKBD is not set
631CONFIG_SERIO_GSCPS2=y 746CONFIG_SERIO_GSCPS2=y
632CONFIG_HP_SDC=y 747CONFIG_HP_SDC=y
633CONFIG_HIL_MLC=y 748CONFIG_HIL_MLC=y
634# CONFIG_SERIO_PCIPS2 is not set 749# CONFIG_SERIO_PCIPS2 is not set
750CONFIG_SERIO_LIBPS2=y
635# CONFIG_SERIO_RAW is not set 751# CONFIG_SERIO_RAW is not set
636# CONFIG_GAMEPORT is not set 752# CONFIG_GAMEPORT is not set
637 753
@@ -648,7 +764,8 @@ CONFIG_HW_CONSOLE=y
648# 764#
649CONFIG_SERIAL_8250=y 765CONFIG_SERIAL_8250=y
650CONFIG_SERIAL_8250_CONSOLE=y 766CONFIG_SERIAL_8250_CONSOLE=y
651CONFIG_SERIAL_8250_NR_UARTS=13 767CONFIG_SERIAL_8250_CS=y
768CONFIG_SERIAL_8250_NR_UARTS=17
652CONFIG_SERIAL_8250_RUNTIME_UARTS=4 769CONFIG_SERIAL_8250_RUNTIME_UARTS=4
653CONFIG_SERIAL_8250_EXTENDED=y 770CONFIG_SERIAL_8250_EXTENDED=y
654CONFIG_SERIAL_8250_MANY_PORTS=y 771CONFIG_SERIAL_8250_MANY_PORTS=y
@@ -666,10 +783,10 @@ CONFIG_SERIAL_CORE_CONSOLE=y
666# CONFIG_SERIAL_JSM is not set 783# CONFIG_SERIAL_JSM is not set
667CONFIG_UNIX98_PTYS=y 784CONFIG_UNIX98_PTYS=y
668CONFIG_LEGACY_PTYS=y 785CONFIG_LEGACY_PTYS=y
669CONFIG_LEGACY_PTY_COUNT=256 786CONFIG_LEGACY_PTY_COUNT=64
670CONFIG_PRINTER=y 787CONFIG_PRINTER=m
671# CONFIG_LP_CONSOLE is not set 788# CONFIG_LP_CONSOLE is not set
672# CONFIG_PPDEV is not set 789CONFIG_PPDEV=m
673# CONFIG_TIPAR is not set 790# CONFIG_TIPAR is not set
674 791
675# 792#
@@ -682,7 +799,7 @@ CONFIG_PRINTER=y
682# 799#
683# CONFIG_WATCHDOG is not set 800# CONFIG_WATCHDOG is not set
684CONFIG_GEN_RTC=y 801CONFIG_GEN_RTC=y
685# CONFIG_GEN_RTC_X is not set 802CONFIG_GEN_RTC_X=y
686# CONFIG_DTLK is not set 803# CONFIG_DTLK is not set
687# CONFIG_R3964 is not set 804# CONFIG_R3964 is not set
688# CONFIG_APPLICOM is not set 805# CONFIG_APPLICOM is not set
@@ -691,6 +808,13 @@ CONFIG_GEN_RTC=y
691# Ftape, the floppy tape device driver 808# Ftape, the floppy tape device driver
692# 809#
693# CONFIG_DRM is not set 810# CONFIG_DRM is not set
811
812#
813# PCMCIA character devices
814#
815# CONFIG_SYNCLINK_CS is not set
816# CONFIG_CARDMAN_4000 is not set
817# CONFIG_CARDMAN_4040 is not set
694# CONFIG_RAW_DRIVER is not set 818# CONFIG_RAW_DRIVER is not set
695 819
696# 820#
@@ -718,10 +842,8 @@ CONFIG_GEN_RTC=y
718# 842#
719# Hardware Monitoring support 843# Hardware Monitoring support
720# 844#
721CONFIG_HWMON=y 845# CONFIG_HWMON is not set
722# CONFIG_HWMON_VID is not set 846# CONFIG_HWMON_VID is not set
723# CONFIG_SENSORS_F71805F is not set
724# CONFIG_HWMON_DEBUG_CHIP is not set
725 847
726# 848#
727# Misc devices 849# Misc devices
@@ -749,8 +871,8 @@ CONFIG_FB_CFB_FILLRECT=y
749CONFIG_FB_CFB_COPYAREA=y 871CONFIG_FB_CFB_COPYAREA=y
750CONFIG_FB_CFB_IMAGEBLIT=y 872CONFIG_FB_CFB_IMAGEBLIT=y
751# CONFIG_FB_MACMODES is not set 873# CONFIG_FB_MACMODES is not set
752# CONFIG_FB_MODE_HELPERS is not set 874CONFIG_FB_MODE_HELPERS=y
753# CONFIG_FB_TILEBLITTING is not set 875CONFIG_FB_TILEBLITTING=y
754# CONFIG_FB_CIRRUS is not set 876# CONFIG_FB_CIRRUS is not set
755# CONFIG_FB_PM2 is not set 877# CONFIG_FB_PM2 is not set
756# CONFIG_FB_CYBER2000 is not set 878# CONFIG_FB_CYBER2000 is not set
@@ -778,8 +900,8 @@ CONFIG_FB_STI=y
778# Console display driver support 900# Console display driver support
779# 901#
780CONFIG_DUMMY_CONSOLE=y 902CONFIG_DUMMY_CONSOLE=y
781CONFIG_DUMMY_CONSOLE_COLUMNS=160 903CONFIG_DUMMY_CONSOLE_COLUMNS=128
782CONFIG_DUMMY_CONSOLE_ROWS=64 904CONFIG_DUMMY_CONSOLE_ROWS=48
783CONFIG_FRAMEBUFFER_CONSOLE=y 905CONFIG_FRAMEBUFFER_CONSOLE=y
784# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set 906# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
785CONFIG_STI_CONSOLE=y 907CONFIG_STI_CONSOLE=y
@@ -816,13 +938,14 @@ CONFIG_SOUND=y
816CONFIG_SND=y 938CONFIG_SND=y
817CONFIG_SND_TIMER=y 939CONFIG_SND_TIMER=y
818CONFIG_SND_PCM=y 940CONFIG_SND_PCM=y
941CONFIG_SND_HWDEP=y
819CONFIG_SND_SEQUENCER=y 942CONFIG_SND_SEQUENCER=y
820# CONFIG_SND_SEQ_DUMMY is not set 943# CONFIG_SND_SEQ_DUMMY is not set
821CONFIG_SND_OSSEMUL=y 944CONFIG_SND_OSSEMUL=y
822CONFIG_SND_MIXER_OSS=y 945CONFIG_SND_MIXER_OSS=y
823CONFIG_SND_PCM_OSS=y 946CONFIG_SND_PCM_OSS=y
824CONFIG_SND_SEQUENCER_OSS=y 947CONFIG_SND_SEQUENCER_OSS=y
825# CONFIG_SND_DYNAMIC_MINORS is not set 948CONFIG_SND_DYNAMIC_MINORS=y
826CONFIG_SND_SUPPORT_OLD_API=y 949CONFIG_SND_SUPPORT_OLD_API=y
827# CONFIG_SND_VERBOSE_PRINTK is not set 950# CONFIG_SND_VERBOSE_PRINTK is not set
828# CONFIG_SND_DEBUG is not set 951# CONFIG_SND_DEBUG is not set
@@ -830,6 +953,7 @@ CONFIG_SND_SUPPORT_OLD_API=y
830# 953#
831# Generic devices 954# Generic devices
832# 955#
956CONFIG_SND_OPL3_LIB=y
833CONFIG_SND_AC97_CODEC=y 957CONFIG_SND_AC97_CODEC=y
834CONFIG_SND_AC97_BUS=y 958CONFIG_SND_AC97_BUS=y
835# CONFIG_SND_DUMMY is not set 959# CONFIG_SND_DUMMY is not set
@@ -842,7 +966,7 @@ CONFIG_SND_AC97_BUS=y
842# PCI devices 966# PCI devices
843# 967#
844CONFIG_SND_AD1889=y 968CONFIG_SND_AD1889=y
845# CONFIG_SND_AD1889_OPL3 is not set 969CONFIG_SND_AD1889_OPL3=y
846# CONFIG_SND_ALI5451 is not set 970# CONFIG_SND_ALI5451 is not set
847# CONFIG_SND_ATIIXP is not set 971# CONFIG_SND_ATIIXP is not set
848# CONFIG_SND_ATIIXP_MODEM is not set 972# CONFIG_SND_ATIIXP_MODEM is not set
@@ -890,6 +1014,10 @@ CONFIG_SND_AD1889=y
890# CONFIG_SND_USB_AUDIO is not set 1014# CONFIG_SND_USB_AUDIO is not set
891 1015
892# 1016#
1017# PCMCIA devices
1018#
1019
1020#
893# GSC devices 1021# GSC devices
894# 1022#
895CONFIG_SND_HARMONY=y 1023CONFIG_SND_HARMONY=y
@@ -905,12 +1033,12 @@ CONFIG_SND_HARMONY=y
905CONFIG_USB_ARCH_HAS_HCD=y 1033CONFIG_USB_ARCH_HAS_HCD=y
906CONFIG_USB_ARCH_HAS_OHCI=y 1034CONFIG_USB_ARCH_HAS_OHCI=y
907CONFIG_USB=y 1035CONFIG_USB=y
908CONFIG_USB_DEBUG=y 1036# CONFIG_USB_DEBUG is not set
909 1037
910# 1038#
911# Miscellaneous USB options 1039# Miscellaneous USB options
912# 1040#
913# CONFIG_USB_DEVICEFS is not set 1041CONFIG_USB_DEVICEFS=y
914# CONFIG_USB_BANDWIDTH is not set 1042# CONFIG_USB_BANDWIDTH is not set
915# CONFIG_USB_DYNAMIC_MINORS is not set 1043# CONFIG_USB_DYNAMIC_MINORS is not set
916# CONFIG_USB_OTG is not set 1044# CONFIG_USB_OTG is not set
@@ -918,14 +1046,12 @@ CONFIG_USB_DEBUG=y
918# 1046#
919# USB Host Controller Drivers 1047# USB Host Controller Drivers
920# 1048#
921CONFIG_USB_EHCI_HCD=y 1049# CONFIG_USB_EHCI_HCD is not set
922# CONFIG_USB_EHCI_SPLIT_ISO is not set
923# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
924# CONFIG_USB_ISP116X_HCD is not set 1050# CONFIG_USB_ISP116X_HCD is not set
925CONFIG_USB_OHCI_HCD=y 1051CONFIG_USB_OHCI_HCD=y
926# CONFIG_USB_OHCI_BIG_ENDIAN is not set 1052# CONFIG_USB_OHCI_BIG_ENDIAN is not set
927CONFIG_USB_OHCI_LITTLE_ENDIAN=y 1053CONFIG_USB_OHCI_LITTLE_ENDIAN=y
928# CONFIG_USB_UHCI_HCD is not set 1054CONFIG_USB_UHCI_HCD=y
929# CONFIG_USB_SL811_HCD is not set 1055# CONFIG_USB_SL811_HCD is not set
930 1056
931# 1057#
@@ -948,13 +1074,11 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y
948# 1074#
949# USB Input Devices 1075# USB Input Devices
950# 1076#
951# CONFIG_USB_HID is not set 1077CONFIG_USB_HID=y
952 1078CONFIG_USB_HIDINPUT=y
953# 1079# CONFIG_USB_HIDINPUT_POWERBOOK is not set
954# USB HID Boot Protocol drivers 1080# CONFIG_HID_FF is not set
955# 1081# CONFIG_USB_HIDDEV is not set
956# CONFIG_USB_KBD is not set
957# CONFIG_USB_MOUSE is not set
958# CONFIG_USB_AIPTEK is not set 1082# CONFIG_USB_AIPTEK is not set
959# CONFIG_USB_WACOM is not set 1083# CONFIG_USB_WACOM is not set
960# CONFIG_USB_ACECAD is not set 1084# CONFIG_USB_ACECAD is not set
@@ -1020,8 +1144,8 @@ CONFIG_USB_MON=y
1020# CONFIG_USB_PHIDGETKIT is not set 1144# CONFIG_USB_PHIDGETKIT is not set
1021# CONFIG_USB_PHIDGETSERVO is not set 1145# CONFIG_USB_PHIDGETSERVO is not set
1022# CONFIG_USB_IDMOUSE is not set 1146# CONFIG_USB_IDMOUSE is not set
1023# CONFIG_USB_SISUSBVGA is not set
1024# CONFIG_USB_LD is not set 1147# CONFIG_USB_LD is not set
1148# CONFIG_USB_TEST is not set
1025 1149
1026# 1150#
1027# USB DSL modem support 1151# USB DSL modem support
@@ -1058,7 +1182,7 @@ CONFIG_JBD=y
1058# CONFIG_JBD_DEBUG is not set 1182# CONFIG_JBD_DEBUG is not set
1059# CONFIG_REISERFS_FS is not set 1183# CONFIG_REISERFS_FS is not set
1060# CONFIG_JFS_FS is not set 1184# CONFIG_JFS_FS is not set
1061# CONFIG_FS_POSIX_ACL is not set 1185CONFIG_FS_POSIX_ACL=y
1062# CONFIG_XFS_FS is not set 1186# CONFIG_XFS_FS is not set
1063# CONFIG_OCFS2_FS is not set 1187# CONFIG_OCFS2_FS is not set
1064# CONFIG_MINIX_FS is not set 1188# CONFIG_MINIX_FS is not set
@@ -1066,7 +1190,7 @@ CONFIG_JBD=y
1066CONFIG_INOTIFY=y 1190CONFIG_INOTIFY=y
1067# CONFIG_QUOTA is not set 1191# CONFIG_QUOTA is not set
1068CONFIG_DNOTIFY=y 1192CONFIG_DNOTIFY=y
1069# CONFIG_AUTOFS_FS is not set 1193CONFIG_AUTOFS_FS=y
1070# CONFIG_AUTOFS4_FS is not set 1194# CONFIG_AUTOFS4_FS is not set
1071# CONFIG_FUSE_FS is not set 1195# CONFIG_FUSE_FS is not set
1072 1196
@@ -1081,8 +1205,11 @@ CONFIG_JOLIET=y
1081# 1205#
1082# DOS/FAT/NT Filesystems 1206# DOS/FAT/NT Filesystems
1083# 1207#
1208CONFIG_FAT_FS=y
1084# CONFIG_MSDOS_FS is not set 1209# CONFIG_MSDOS_FS is not set
1085# CONFIG_VFAT_FS is not set 1210CONFIG_VFAT_FS=y
1211CONFIG_FAT_DEFAULT_CODEPAGE=437
1212CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1086# CONFIG_NTFS_FS is not set 1213# CONFIG_NTFS_FS is not set
1087 1214
1088# 1215#
@@ -1125,7 +1252,7 @@ CONFIG_NFS_V3=y
1125CONFIG_NFSD=y 1252CONFIG_NFSD=y
1126CONFIG_NFSD_V3=y 1253CONFIG_NFSD_V3=y
1127# CONFIG_NFSD_V3_ACL is not set 1254# CONFIG_NFSD_V3_ACL is not set
1128# CONFIG_NFSD_V4 is not set 1255CONFIG_NFSD_V4=y
1129CONFIG_NFSD_TCP=y 1256CONFIG_NFSD_TCP=y
1130CONFIG_ROOT_NFS=y 1257CONFIG_ROOT_NFS=y
1131CONFIG_LOCKD=y 1258CONFIG_LOCKD=y
@@ -1133,10 +1260,16 @@ CONFIG_LOCKD_V4=y
1133CONFIG_EXPORTFS=y 1260CONFIG_EXPORTFS=y
1134CONFIG_NFS_COMMON=y 1261CONFIG_NFS_COMMON=y
1135CONFIG_SUNRPC=y 1262CONFIG_SUNRPC=y
1136# CONFIG_RPCSEC_GSS_KRB5 is not set 1263CONFIG_SUNRPC_GSS=y
1137# CONFIG_RPCSEC_GSS_SPKM3 is not set 1264CONFIG_RPCSEC_GSS_KRB5=y
1138# CONFIG_SMB_FS is not set 1265CONFIG_RPCSEC_GSS_SPKM3=m
1139# CONFIG_CIFS is not set 1266CONFIG_SMB_FS=m
1267CONFIG_SMB_NLS_DEFAULT=y
1268CONFIG_SMB_NLS_REMOTE="cp437"
1269CONFIG_CIFS=m
1270# CONFIG_CIFS_STATS is not set
1271# CONFIG_CIFS_XATTR is not set
1272# CONFIG_CIFS_EXPERIMENTAL is not set
1140# CONFIG_NCP_FS is not set 1273# CONFIG_NCP_FS is not set
1141# CONFIG_CODA_FS is not set 1274# CONFIG_CODA_FS is not set
1142# CONFIG_AFS_FS is not set 1275# CONFIG_AFS_FS is not set
@@ -1153,50 +1286,50 @@ CONFIG_MSDOS_PARTITION=y
1153# 1286#
1154CONFIG_NLS=y 1287CONFIG_NLS=y
1155CONFIG_NLS_DEFAULT="iso8859-1" 1288CONFIG_NLS_DEFAULT="iso8859-1"
1156# CONFIG_NLS_CODEPAGE_437 is not set 1289CONFIG_NLS_CODEPAGE_437=y
1157# CONFIG_NLS_CODEPAGE_737 is not set 1290CONFIG_NLS_CODEPAGE_737=m
1158# CONFIG_NLS_CODEPAGE_775 is not set 1291CONFIG_NLS_CODEPAGE_775=m
1159# CONFIG_NLS_CODEPAGE_850 is not set 1292CONFIG_NLS_CODEPAGE_850=m
1160# CONFIG_NLS_CODEPAGE_852 is not set 1293CONFIG_NLS_CODEPAGE_852=m
1161# CONFIG_NLS_CODEPAGE_855 is not set 1294CONFIG_NLS_CODEPAGE_855=m
1162# CONFIG_NLS_CODEPAGE_857 is not set 1295CONFIG_NLS_CODEPAGE_857=m
1163# CONFIG_NLS_CODEPAGE_860 is not set 1296CONFIG_NLS_CODEPAGE_860=m
1164# CONFIG_NLS_CODEPAGE_861 is not set 1297CONFIG_NLS_CODEPAGE_861=m
1165# CONFIG_NLS_CODEPAGE_862 is not set 1298CONFIG_NLS_CODEPAGE_862=m
1166# CONFIG_NLS_CODEPAGE_863 is not set 1299CONFIG_NLS_CODEPAGE_863=m
1167# CONFIG_NLS_CODEPAGE_864 is not set 1300CONFIG_NLS_CODEPAGE_864=m
1168# CONFIG_NLS_CODEPAGE_865 is not set 1301CONFIG_NLS_CODEPAGE_865=m
1169# CONFIG_NLS_CODEPAGE_866 is not set 1302CONFIG_NLS_CODEPAGE_866=m
1170# CONFIG_NLS_CODEPAGE_869 is not set 1303CONFIG_NLS_CODEPAGE_869=m
1171# CONFIG_NLS_CODEPAGE_936 is not set 1304CONFIG_NLS_CODEPAGE_936=m
1172# CONFIG_NLS_CODEPAGE_950 is not set 1305CONFIG_NLS_CODEPAGE_950=m
1173# CONFIG_NLS_CODEPAGE_932 is not set 1306CONFIG_NLS_CODEPAGE_932=m
1174# CONFIG_NLS_CODEPAGE_949 is not set 1307CONFIG_NLS_CODEPAGE_949=m
1175# CONFIG_NLS_CODEPAGE_874 is not set 1308CONFIG_NLS_CODEPAGE_874=m
1176# CONFIG_NLS_ISO8859_8 is not set 1309CONFIG_NLS_ISO8859_8=m
1177# CONFIG_NLS_CODEPAGE_1250 is not set 1310CONFIG_NLS_CODEPAGE_1250=y
1178# CONFIG_NLS_CODEPAGE_1251 is not set 1311CONFIG_NLS_CODEPAGE_1251=m
1179# CONFIG_NLS_ASCII is not set 1312CONFIG_NLS_ASCII=m
1180# CONFIG_NLS_ISO8859_1 is not set 1313CONFIG_NLS_ISO8859_1=y
1181# CONFIG_NLS_ISO8859_2 is not set 1314CONFIG_NLS_ISO8859_2=m
1182# CONFIG_NLS_ISO8859_3 is not set 1315CONFIG_NLS_ISO8859_3=m
1183# CONFIG_NLS_ISO8859_4 is not set 1316CONFIG_NLS_ISO8859_4=m
1184# CONFIG_NLS_ISO8859_5 is not set 1317CONFIG_NLS_ISO8859_5=m
1185# CONFIG_NLS_ISO8859_6 is not set 1318CONFIG_NLS_ISO8859_6=m
1186# CONFIG_NLS_ISO8859_7 is not set 1319CONFIG_NLS_ISO8859_7=m
1187# CONFIG_NLS_ISO8859_9 is not set 1320CONFIG_NLS_ISO8859_9=m
1188# CONFIG_NLS_ISO8859_13 is not set 1321CONFIG_NLS_ISO8859_13=m
1189# CONFIG_NLS_ISO8859_14 is not set 1322CONFIG_NLS_ISO8859_14=m
1190# CONFIG_NLS_ISO8859_15 is not set 1323CONFIG_NLS_ISO8859_15=m
1191# CONFIG_NLS_KOI8_R is not set 1324CONFIG_NLS_KOI8_R=m
1192# CONFIG_NLS_KOI8_U is not set 1325CONFIG_NLS_KOI8_U=m
1193# CONFIG_NLS_UTF8 is not set 1326CONFIG_NLS_UTF8=y
1194 1327
1195# 1328#
1196# Profiling support 1329# Profiling support
1197# 1330#
1198CONFIG_PROFILING=y 1331CONFIG_PROFILING=y
1199CONFIG_OPROFILE=y 1332CONFIG_OPROFILE=m
1200 1333
1201# 1334#
1202# Kernel hacking 1335# Kernel hacking
@@ -1204,7 +1337,7 @@ CONFIG_OPROFILE=y
1204# CONFIG_PRINTK_TIME is not set 1337# CONFIG_PRINTK_TIME is not set
1205CONFIG_MAGIC_SYSRQ=y 1338CONFIG_MAGIC_SYSRQ=y
1206CONFIG_DEBUG_KERNEL=y 1339CONFIG_DEBUG_KERNEL=y
1207CONFIG_LOG_BUF_SHIFT=15 1340CONFIG_LOG_BUF_SHIFT=16
1208CONFIG_DETECT_SOFTLOCKUP=y 1341CONFIG_DETECT_SOFTLOCKUP=y
1209# CONFIG_SCHEDSTATS is not set 1342# CONFIG_SCHEDSTATS is not set
1210# CONFIG_DEBUG_SLAB is not set 1343# CONFIG_DEBUG_SLAB is not set
@@ -1217,42 +1350,43 @@ CONFIG_DEBUG_MUTEXES=y
1217# CONFIG_DEBUG_VM is not set 1350# CONFIG_DEBUG_VM is not set
1218CONFIG_FORCED_INLINING=y 1351CONFIG_FORCED_INLINING=y
1219# CONFIG_RCU_TORTURE_TEST is not set 1352# CONFIG_RCU_TORTURE_TEST is not set
1220CONFIG_DEBUG_RODATA=y 1353# CONFIG_DEBUG_RODATA is not set
1221 1354
1222# 1355#
1223# Security options 1356# Security options
1224# 1357#
1225# CONFIG_KEYS is not set 1358CONFIG_KEYS=y
1359CONFIG_KEYS_DEBUG_PROC_KEYS=y
1226# CONFIG_SECURITY is not set 1360# CONFIG_SECURITY is not set
1227 1361
1228# 1362#
1229# Cryptographic options 1363# Cryptographic options
1230# 1364#
1231CONFIG_CRYPTO=y 1365CONFIG_CRYPTO=y
1232# CONFIG_CRYPTO_HMAC is not set 1366CONFIG_CRYPTO_HMAC=y
1233# CONFIG_CRYPTO_NULL is not set 1367CONFIG_CRYPTO_NULL=m
1234# CONFIG_CRYPTO_MD4 is not set 1368CONFIG_CRYPTO_MD4=m
1235# CONFIG_CRYPTO_MD5 is not set 1369CONFIG_CRYPTO_MD5=y
1236# CONFIG_CRYPTO_SHA1 is not set 1370CONFIG_CRYPTO_SHA1=y
1237# CONFIG_CRYPTO_SHA256 is not set 1371CONFIG_CRYPTO_SHA256=m
1238# CONFIG_CRYPTO_SHA512 is not set 1372CONFIG_CRYPTO_SHA512=m
1239# CONFIG_CRYPTO_WP512 is not set 1373CONFIG_CRYPTO_WP512=m
1240# CONFIG_CRYPTO_TGR192 is not set 1374CONFIG_CRYPTO_TGR192=m
1241# CONFIG_CRYPTO_DES is not set 1375CONFIG_CRYPTO_DES=y
1242# CONFIG_CRYPTO_BLOWFISH is not set 1376CONFIG_CRYPTO_BLOWFISH=m
1243# CONFIG_CRYPTO_TWOFISH is not set 1377CONFIG_CRYPTO_TWOFISH=m
1244# CONFIG_CRYPTO_SERPENT is not set 1378CONFIG_CRYPTO_SERPENT=m
1245# CONFIG_CRYPTO_AES is not set 1379CONFIG_CRYPTO_AES=m
1246# CONFIG_CRYPTO_CAST5 is not set 1380CONFIG_CRYPTO_CAST5=m
1247# CONFIG_CRYPTO_CAST6 is not set 1381CONFIG_CRYPTO_CAST6=m
1248# CONFIG_CRYPTO_TEA is not set 1382CONFIG_CRYPTO_TEA=m
1249# CONFIG_CRYPTO_ARC4 is not set 1383CONFIG_CRYPTO_ARC4=m
1250# CONFIG_CRYPTO_KHAZAD is not set 1384CONFIG_CRYPTO_KHAZAD=m
1251# CONFIG_CRYPTO_ANUBIS is not set 1385CONFIG_CRYPTO_ANUBIS=m
1252# CONFIG_CRYPTO_DEFLATE is not set 1386CONFIG_CRYPTO_DEFLATE=y
1253# CONFIG_CRYPTO_MICHAEL_MIC is not set 1387CONFIG_CRYPTO_MICHAEL_MIC=m
1254# CONFIG_CRYPTO_CRC32C is not set 1388CONFIG_CRYPTO_CRC32C=m
1255# CONFIG_CRYPTO_TEST is not set 1389CONFIG_CRYPTO_TEST=m
1256 1390
1257# 1391#
1258# Hardware crypto devices 1392# Hardware crypto devices
@@ -1261,7 +1395,9 @@ CONFIG_CRYPTO=y
1261# 1395#
1262# Library routines 1396# Library routines
1263# 1397#
1264# CONFIG_CRC_CCITT is not set 1398CONFIG_CRC_CCITT=m
1265# CONFIG_CRC16 is not set 1399# CONFIG_CRC16 is not set
1266CONFIG_CRC32=y 1400CONFIG_CRC32=y
1267# CONFIG_LIBCRC32C is not set 1401CONFIG_LIBCRC32C=m
1402CONFIG_ZLIB_INFLATE=y
1403CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/parisc/kernel/asm-offsets.c b/arch/parisc/kernel/asm-offsets.c
index e23c4e1e3a25..c11a5bc7c067 100644
--- a/arch/parisc/kernel/asm-offsets.c
+++ b/arch/parisc/kernel/asm-offsets.c
@@ -288,8 +288,11 @@ int main(void)
288 DEFINE(ASM_PGD_ENTRY_SIZE, PGD_ENTRY_SIZE); 288 DEFINE(ASM_PGD_ENTRY_SIZE, PGD_ENTRY_SIZE);
289 DEFINE(ASM_PMD_ENTRY_SIZE, PMD_ENTRY_SIZE); 289 DEFINE(ASM_PMD_ENTRY_SIZE, PMD_ENTRY_SIZE);
290 DEFINE(ASM_PTE_ENTRY_SIZE, PTE_ENTRY_SIZE); 290 DEFINE(ASM_PTE_ENTRY_SIZE, PTE_ENTRY_SIZE);
291 DEFINE(ASM_PFN_PTE_SHIFT, PFN_PTE_SHIFT);
291 DEFINE(ASM_PT_INITIAL, PT_INITIAL); 292 DEFINE(ASM_PT_INITIAL, PT_INITIAL);
292 DEFINE(ASM_PAGE_SIZE, PAGE_SIZE); 293 DEFINE(ASM_PAGE_SIZE, PAGE_SIZE);
294 DEFINE(ASM_PAGE_SIZE_DIV64, PAGE_SIZE/64);
295 DEFINE(ASM_PAGE_SIZE_DIV128, PAGE_SIZE/128);
293 BLANK(); 296 BLANK();
294 DEFINE(EXCDATA_IP, offsetof(struct exception_data, fault_ip)); 297 DEFINE(EXCDATA_IP, offsetof(struct exception_data, fault_ip));
295 DEFINE(EXCDATA_SPACE, offsetof(struct exception_data, fault_space)); 298 DEFINE(EXCDATA_SPACE, offsetof(struct exception_data, fault_space));
diff --git a/arch/parisc/kernel/cache.c b/arch/parisc/kernel/cache.c
index 360b7391cb8c..c057ad7605ba 100644
--- a/arch/parisc/kernel/cache.c
+++ b/arch/parisc/kernel/cache.c
@@ -4,7 +4,7 @@
4 * License. See the file "COPYING" in the main directory of this archive 4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details. 5 * for more details.
6 * 6 *
7 * Copyright (C) 1999 Helge Deller (07-13-1999) 7 * Copyright (C) 1999-2006 Helge Deller <deller@gmx.de> (07-13-1999)
8 * Copyright (C) 1999 SuSE GmbH Nuernberg 8 * Copyright (C) 1999 SuSE GmbH Nuernberg
9 * Copyright (C) 2000 Philipp Rumpf (prumpf@tux.org) 9 * Copyright (C) 2000 Philipp Rumpf (prumpf@tux.org)
10 * 10 *
@@ -358,5 +358,5 @@ void parisc_setup_cache_timing(void)
358 if (!parisc_cache_flush_threshold) 358 if (!parisc_cache_flush_threshold)
359 parisc_cache_flush_threshold = FLUSH_THRESHOLD; 359 parisc_cache_flush_threshold = FLUSH_THRESHOLD;
360 360
361 printk("Setting cache flush threshold to %x (%d CPUs online)\n", parisc_cache_flush_threshold, num_online_cpus()); 361 printk(KERN_INFO "Setting cache flush threshold to %x (%d CPUs online)\n", parisc_cache_flush_threshold, num_online_cpus());
362} 362}
diff --git a/arch/parisc/kernel/entry.S b/arch/parisc/kernel/entry.S
index 7c95d7663c29..d9e53cf0372b 100644
--- a/arch/parisc/kernel/entry.S
+++ b/arch/parisc/kernel/entry.S
@@ -502,18 +502,20 @@
502 * all ILP32 processes and all the kernel for machines with 502 * all ILP32 processes and all the kernel for machines with
503 * under 4GB of memory) */ 503 * under 4GB of memory) */
504 .macro L3_ptep pgd,pte,index,va,fault 504 .macro L3_ptep pgd,pte,index,va,fault
505#if PT_NLEVELS == 3 /* we might have a 2-Level scheme, e.g. with 16kb page size */
505 extrd,u \va,63-ASM_PGDIR_SHIFT,ASM_BITS_PER_PGD,\index 506 extrd,u \va,63-ASM_PGDIR_SHIFT,ASM_BITS_PER_PGD,\index
506 copy %r0,\pte 507 copy %r0,\pte
507 extrd,u,*= \va,31,32,%r0 508 extrd,u,*= \va,63-ASM_PGDIR_SHIFT,64-ASM_PGDIR_SHIFT,%r0
508 ldw,s \index(\pgd),\pgd 509 ldw,s \index(\pgd),\pgd
509 extrd,u,*= \va,31,32,%r0 510 extrd,u,*= \va,63-ASM_PGDIR_SHIFT,64-ASM_PGDIR_SHIFT,%r0
510 bb,>=,n \pgd,_PxD_PRESENT_BIT,\fault 511 bb,>=,n \pgd,_PxD_PRESENT_BIT,\fault
511 extrd,u,*= \va,31,32,%r0 512 extrd,u,*= \va,63-ASM_PGDIR_SHIFT,64-ASM_PGDIR_SHIFT,%r0
512 shld \pgd,PxD_VALUE_SHIFT,\index 513 shld \pgd,PxD_VALUE_SHIFT,\index
513 extrd,u,*= \va,31,32,%r0 514 extrd,u,*= \va,63-ASM_PGDIR_SHIFT,64-ASM_PGDIR_SHIFT,%r0
514 copy \index,\pgd 515 copy \index,\pgd
515 extrd,u,*<> \va,31,32,%r0 516 extrd,u,*<> \va,63-ASM_PGDIR_SHIFT,64-ASM_PGDIR_SHIFT,%r0
516 ldo ASM_PGD_PMD_OFFSET(\pgd),\pgd 517 ldo ASM_PGD_PMD_OFFSET(\pgd),\pgd
518#endif
517 L2_ptep \pgd,\pte,\index,\va,\fault 519 L2_ptep \pgd,\pte,\index,\va,\fault
518 .endm 520 .endm
519 521
@@ -563,10 +565,18 @@
563 extrd,u,*= \pte,_PAGE_GATEWAY_BIT+32,1,%r0 565 extrd,u,*= \pte,_PAGE_GATEWAY_BIT+32,1,%r0
564 depd %r0,11,2,\prot /* If Gateway, Set PL2 to 0 */ 566 depd %r0,11,2,\prot /* If Gateway, Set PL2 to 0 */
565 567
566 /* Get rid of prot bits and convert to page addr for iitlbt and idtlbt */ 568 /* Enforce uncacheable pages.
569 * This should ONLY be use for MMIO on PA 2.0 machines.
570 * Memory/DMA is cache coherent on all PA2.0 machines we support
571 * (that means T-class is NOT supported) and the memory controllers
572 * on most of those machines only handles cache transactions.
573 */
574 extrd,u,*= \pte,_PAGE_NO_CACHE_BIT+32,1,%r0
575 depi 1,12,1,\prot
567 576
568 depd %r0,63,PAGE_SHIFT,\pte 577 /* Drop prot bits and convert to page addr for iitlbt and idtlbt */
569 extrd,s \pte,(63-PAGE_SHIFT)+(63-58),64-PAGE_SHIFT,\pte 578 extrd,u \pte,(63-ASM_PFN_PTE_SHIFT)+(63-58),64-PAGE_SHIFT,\pte
579 depdi _PAGE_SIZE_ENCODING_DEFAULT,63,63-58,\pte
570 .endm 580 .endm
571 581
572 /* Identical macro to make_insert_tlb above, except it 582 /* Identical macro to make_insert_tlb above, except it
@@ -584,9 +594,8 @@
584 594
585 /* Get rid of prot bits and convert to page addr for iitlba */ 595 /* Get rid of prot bits and convert to page addr for iitlba */
586 596
587 depi 0,31,PAGE_SHIFT,\pte 597 depi _PAGE_SIZE_ENCODING_DEFAULT,31,ASM_PFN_PTE_SHIFT,\pte
588 extru \pte,24,25,\pte 598 extru \pte,24,25,\pte
589
590 .endm 599 .endm
591 600
592 /* This is for ILP32 PA2.0 only. The TLB insertion needs 601 /* This is for ILP32 PA2.0 only. The TLB insertion needs
@@ -1201,10 +1210,9 @@ intr_save:
1201 */ 1210 */
1202 1211
1203 /* adjust isr/ior. */ 1212 /* adjust isr/ior. */
1204 1213 extrd,u %r16,63,SPACEID_SHIFT,%r1 /* get high bits from isr for ior */
1205 extrd,u %r16,63,7,%r1 /* get high bits from isr for ior */ 1214 depd %r1,31,SPACEID_SHIFT,%r17 /* deposit them into ior */
1206 depd %r1,31,7,%r17 /* deposit them into ior */ 1215 depdi 0,63,SPACEID_SHIFT,%r16 /* clear them from isr */
1207 depdi 0,63,7,%r16 /* clear them from isr */
1208#endif 1216#endif
1209 STREG %r16, PT_ISR(%r29) 1217 STREG %r16, PT_ISR(%r29)
1210 STREG %r17, PT_IOR(%r29) 1218 STREG %r17, PT_IOR(%r29)
diff --git a/arch/parisc/kernel/head.S b/arch/parisc/kernel/head.S
index 0b47afc20690..3e79e62f7b0b 100644
--- a/arch/parisc/kernel/head.S
+++ b/arch/parisc/kernel/head.S
@@ -76,16 +76,16 @@ $bss_loop:
76 mtctl %r4,%cr24 /* Initialize kernel root pointer */ 76 mtctl %r4,%cr24 /* Initialize kernel root pointer */
77 mtctl %r4,%cr25 /* Initialize user root pointer */ 77 mtctl %r4,%cr25 /* Initialize user root pointer */
78 78
79#ifdef CONFIG_64BIT 79#if PT_NLEVELS == 3
80 /* Set pmd in pgd */ 80 /* Set pmd in pgd */
81 load32 PA(pmd0),%r5 81 load32 PA(pmd0),%r5
82 shrd %r5,PxD_VALUE_SHIFT,%r3 82 shrd %r5,PxD_VALUE_SHIFT,%r3
83 ldo (PxD_FLAG_PRESENT+PxD_FLAG_VALID)(%r3),%r3 83 ldo (PxD_FLAG_PRESENT+PxD_FLAG_VALID)(%r3),%r3
84 stw %r3,ASM_PGD_ENTRY*ASM_PGD_ENTRY_SIZE(%r4) 84 stw %r3,ASM_PGD_ENTRY*ASM_PGD_ENTRY_SIZE(%r4)
85 ldo ASM_PMD_ENTRY*ASM_PMD_ENTRY_SIZE(%r5),%r4 85 ldo ASM_PMD_ENTRY*ASM_PMD_ENTRY_SIZE(%r5),%r4
86#else 86#else
87 /* 2-level page table, so pmd == pgd */ 87 /* 2-level page table, so pmd == pgd */
88 ldo ASM_PGD_ENTRY*ASM_PGD_ENTRY_SIZE(%r4),%r4 88 ldo ASM_PGD_ENTRY*ASM_PGD_ENTRY_SIZE(%r4),%r4
89#endif 89#endif
90 90
91 /* Fill in pmd with enough pte directories */ 91 /* Fill in pmd with enough pte directories */
@@ -99,7 +99,7 @@ $bss_loop:
99 stw %r3,0(%r4) 99 stw %r3,0(%r4)
100 ldo (ASM_PAGE_SIZE >> PxD_VALUE_SHIFT)(%r3),%r3 100 ldo (ASM_PAGE_SIZE >> PxD_VALUE_SHIFT)(%r3),%r3
101 addib,> -1,%r1,1b 101 addib,> -1,%r1,1b
102#ifdef CONFIG_64BIT 102#if PT_NLEVELS == 3
103 ldo ASM_PMD_ENTRY_SIZE(%r4),%r4 103 ldo ASM_PMD_ENTRY_SIZE(%r4),%r4
104#else 104#else
105 ldo ASM_PGD_ENTRY_SIZE(%r4),%r4 105 ldo ASM_PGD_ENTRY_SIZE(%r4),%r4
@@ -107,13 +107,14 @@ $bss_loop:
107 107
108 108
109 /* Now initialize the PTEs themselves */ 109 /* Now initialize the PTEs themselves */
110 ldo _PAGE_KERNEL(%r0),%r3 /* Hardwired 0 phys addr start */ 110 ldo 0+_PAGE_KERNEL(%r0),%r3 /* Hardwired 0 phys addr start */
111 ldi (1<<(KERNEL_INITIAL_ORDER-PAGE_SHIFT)),%r11 /* PFN count */
111 load32 PA(pg0),%r1 112 load32 PA(pg0),%r1
112 113
113$pgt_fill_loop: 114$pgt_fill_loop:
114 STREGM %r3,ASM_PTE_ENTRY_SIZE(%r1) 115 STREGM %r3,ASM_PTE_ENTRY_SIZE(%r1)
115 ldo ASM_PAGE_SIZE(%r3),%r3 116 ldo (1<<PFN_PTE_SHIFT)(%r3),%r3 /* add one PFN */
116 bb,>= %r3,31-KERNEL_INITIAL_ORDER,$pgt_fill_loop 117 addib,> -1,%r11,$pgt_fill_loop
117 nop 118 nop
118 119
119 /* Load the return address...er...crash 'n burn */ 120 /* Load the return address...er...crash 'n burn */
diff --git a/arch/parisc/kernel/init_task.c b/arch/parisc/kernel/init_task.c
index 7e898fd64415..8384bf9cecd2 100644
--- a/arch/parisc/kernel/init_task.c
+++ b/arch/parisc/kernel/init_task.c
@@ -53,17 +53,17 @@ union thread_union init_thread_union
53 __attribute__((aligned(128))) __attribute__((__section__(".data.init_task"))) = 53 __attribute__((aligned(128))) __attribute__((__section__(".data.init_task"))) =
54 { INIT_THREAD_INFO(init_task) }; 54 { INIT_THREAD_INFO(init_task) };
55 55
56#ifdef __LP64__ 56#if PT_NLEVELS == 3
57/* NOTE: This layout exactly conforms to the hybrid L2/L3 page table layout 57/* NOTE: This layout exactly conforms to the hybrid L2/L3 page table layout
58 * with the first pmd adjacent to the pgd and below it. gcc doesn't actually 58 * with the first pmd adjacent to the pgd and below it. gcc doesn't actually
59 * guarantee that global objects will be laid out in memory in the same order 59 * guarantee that global objects will be laid out in memory in the same order
60 * as the order of declaration, so put these in different sections and use 60 * as the order of declaration, so put these in different sections and use
61 * the linker script to order them. */ 61 * the linker script to order them. */
62pmd_t pmd0[PTRS_PER_PMD] __attribute__ ((aligned(PAGE_SIZE))) __attribute__ ((__section__ (".data.vm0.pmd"))) = { {0}, }; 62pmd_t pmd0[PTRS_PER_PMD] __attribute__ ((__section__ (".data.vm0.pmd"), aligned(PAGE_SIZE)));
63
64#endif 63#endif
65pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__ ((aligned(PAGE_SIZE))) __attribute__ ((__section__ (".data.vm0.pgd"))) = { {0}, }; 64
66pte_t pg0[PT_INITIAL * PTRS_PER_PTE] __attribute__ ((aligned(PAGE_SIZE))) __attribute__ ((__section__ (".data.vm0.pte"))) = { {0}, }; 65pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__ ((__section__ (".data.vm0.pgd"), aligned(PAGE_SIZE)));
66pte_t pg0[PT_INITIAL * PTRS_PER_PTE] __attribute__ ((__section__ (".data.vm0.pte"), aligned(PAGE_SIZE)));
67 67
68/* 68/*
69 * Initial task structure. 69 * Initial task structure.
diff --git a/arch/parisc/kernel/pacache.S b/arch/parisc/kernel/pacache.S
index 7a4f07e8d3c3..f600556414d1 100644
--- a/arch/parisc/kernel/pacache.S
+++ b/arch/parisc/kernel/pacache.S
@@ -65,7 +65,7 @@ flush_tlb_all_local:
65 */ 65 */
66 66
67 /* pcxt_ssm_bug - relied upon translation! PA 2.0 Arch. F-4 and F-5 */ 67 /* pcxt_ssm_bug - relied upon translation! PA 2.0 Arch. F-4 and F-5 */
68 rsm PSW_SM_I, %r19 /* save I-bit state */ 68 rsm PSW_SM_I, %r19 /* save I-bit state */
69 load32 PA(1f), %r1 69 load32 PA(1f), %r1
70 nop 70 nop
71 nop 71 nop
@@ -84,8 +84,7 @@ flush_tlb_all_local:
84 rfi 84 rfi
85 nop 85 nop
86 86
871: ldil L%PA(cache_info), %r1 871: load32 PA(cache_info), %r1
88 ldo R%PA(cache_info)(%r1), %r1
89 88
90 /* Flush Instruction Tlb */ 89 /* Flush Instruction Tlb */
91 90
@@ -212,8 +211,7 @@ flush_instruction_cache_local:
212 .entry 211 .entry
213 212
214 mtsp %r0, %sr1 213 mtsp %r0, %sr1
215 ldil L%cache_info, %r1 214 load32 cache_info, %r1
216 ldo R%cache_info(%r1), %r1
217 215
218 /* Flush Instruction Cache */ 216 /* Flush Instruction Cache */
219 217
@@ -254,8 +252,7 @@ flush_data_cache_local:
254 .entry 252 .entry
255 253
256 mtsp %r0, %sr1 254 mtsp %r0, %sr1
257 ldil L%cache_info, %r1 255 load32 cache_info, %r1
258 ldo R%cache_info(%r1), %r1
259 256
260 /* Flush Data Cache */ 257 /* Flush Data Cache */
261 258
@@ -303,7 +300,8 @@ copy_user_page_asm:
303 */ 300 */
304 301
305 ldd 0(%r25), %r19 302 ldd 0(%r25), %r19
306 ldi 32, %r1 /* PAGE_SIZE/128 == 32 */ 303 ldi ASM_PAGE_SIZE_DIV128, %r1
304
307 ldw 64(%r25), %r0 /* prefetch 1 cacheline ahead */ 305 ldw 64(%r25), %r0 /* prefetch 1 cacheline ahead */
308 ldw 128(%r25), %r0 /* prefetch 2 */ 306 ldw 128(%r25), %r0 /* prefetch 2 */
309 307
@@ -368,7 +366,7 @@ copy_user_page_asm:
368 * use ldd/std on a 32 bit kernel. 366 * use ldd/std on a 32 bit kernel.
369 */ 367 */
370 ldw 0(%r25), %r19 368 ldw 0(%r25), %r19
371 ldi 64, %r1 /* PAGE_SIZE/64 == 64 */ 369 ldi ASM_PAGE_SIZE_DIV64, %r1
372 370
3731: 3711:
374 ldw 4(%r25), %r20 372 ldw 4(%r25), %r20
@@ -461,6 +459,7 @@ copy_user_page_asm:
461 sub %r25, %r1, %r23 /* move physical addr into non shadowed reg */ 459 sub %r25, %r1, %r23 /* move physical addr into non shadowed reg */
462 460
463 ldil L%(TMPALIAS_MAP_START), %r28 461 ldil L%(TMPALIAS_MAP_START), %r28
462 /* FIXME for different page sizes != 4k */
464#ifdef CONFIG_64BIT 463#ifdef CONFIG_64BIT
465 extrd,u %r26,56,32, %r26 /* convert phys addr to tlb insert format */ 464 extrd,u %r26,56,32, %r26 /* convert phys addr to tlb insert format */
466 extrd,u %r23,56,32, %r23 /* convert phys addr to tlb insert format */ 465 extrd,u %r23,56,32, %r23 /* convert phys addr to tlb insert format */
@@ -551,6 +550,7 @@ __clear_user_page_asm:
551#ifdef CONFIG_64BIT 550#ifdef CONFIG_64BIT
552#if (TMPALIAS_MAP_START >= 0x80000000) 551#if (TMPALIAS_MAP_START >= 0x80000000)
553 depdi 0, 31,32, %r28 /* clear any sign extension */ 552 depdi 0, 31,32, %r28 /* clear any sign extension */
553 /* FIXME: page size dependend */
554#endif 554#endif
555 extrd,u %r26, 56,32, %r26 /* convert phys addr to tlb insert format */ 555 extrd,u %r26, 56,32, %r26 /* convert phys addr to tlb insert format */
556 depd %r25, 63,22, %r28 /* Form aliased virtual address 'to' */ 556 depd %r25, 63,22, %r28 /* Form aliased virtual address 'to' */
@@ -566,10 +566,10 @@ __clear_user_page_asm:
566 pdtlb 0(%r28) 566 pdtlb 0(%r28)
567 567
568#ifdef CONFIG_64BIT 568#ifdef CONFIG_64BIT
569 ldi 32, %r1 /* PAGE_SIZE/128 == 32 */ 569 ldi ASM_PAGE_SIZE_DIV128, %r1
570 570
571 /* PREFETCH (Write) has not (yet) been proven to help here */ 571 /* PREFETCH (Write) has not (yet) been proven to help here */
572/* #define PREFETCHW_OP ldd 256(%0), %r0 */ 572 /* #define PREFETCHW_OP ldd 256(%0), %r0 */
573 573
5741: std %r0, 0(%r28) 5741: std %r0, 0(%r28)
575 std %r0, 8(%r28) 575 std %r0, 8(%r28)
@@ -591,8 +591,7 @@ __clear_user_page_asm:
591 ldo 128(%r28), %r28 591 ldo 128(%r28), %r28
592 592
593#else /* ! CONFIG_64BIT */ 593#else /* ! CONFIG_64BIT */
594 594 ldi ASM_PAGE_SIZE_DIV64, %r1
595 ldi 64, %r1 /* PAGE_SIZE/64 == 64 */
596 595
5971: 5961:
598 stw %r0, 0(%r28) 597 stw %r0, 0(%r28)
diff --git a/arch/parisc/kernel/sys_parisc.c b/arch/parisc/kernel/sys_parisc.c
index d15a1d53e101..8b5df98e2b31 100644
--- a/arch/parisc/kernel/sys_parisc.c
+++ b/arch/parisc/kernel/sys_parisc.c
@@ -231,6 +231,14 @@ asmlinkage long parisc_fadvise64_64(int fd,
231 (loff_t)high_len << 32 | low_len, advice); 231 (loff_t)high_len << 32 | low_len, advice);
232} 232}
233 233
234asmlinkage long parisc_sync_file_range(int fd,
235 u32 hi_off, u32 lo_off, u32 hi_nbytes, u32 lo_nbytes,
236 unsigned int flags)
237{
238 return sys_sync_file_range(fd, (loff_t)hi_off << 32 | lo_off,
239 (loff_t)hi_nbytes << 32 | lo_nbytes, flags);
240}
241
234asmlinkage unsigned long sys_alloc_hugepages(int key, unsigned long addr, unsigned long len, int prot, int flag) 242asmlinkage unsigned long sys_alloc_hugepages(int key, unsigned long addr, unsigned long len, int prot, int flag)
235{ 243{
236 return -ENOMEM; 244 return -ENOMEM;
diff --git a/arch/parisc/kernel/syscall.S b/arch/parisc/kernel/syscall.S
index af88afef41bd..479d9a017cd1 100644
--- a/arch/parisc/kernel/syscall.S
+++ b/arch/parisc/kernel/syscall.S
@@ -55,7 +55,7 @@
55 * pointers. 55 * pointers.
56 */ 56 */
57 57
58 .align 4096 58 .align ASM_PAGE_SIZE
59linux_gateway_page: 59linux_gateway_page:
60 60
61 /* ADDRESS 0x00 to 0xb0 = 176 bytes / 4 bytes per insn = 44 insns */ 61 /* ADDRESS 0x00 to 0xb0 = 176 bytes / 4 bytes per insn = 44 insns */
@@ -632,7 +632,7 @@ cas_action:
632end_compare_and_swap: 632end_compare_and_swap:
633 633
634 /* Make sure nothing else is placed on this page */ 634 /* Make sure nothing else is placed on this page */
635 .align 4096 635 .align ASM_PAGE_SIZE
636 .export end_linux_gateway_page 636 .export end_linux_gateway_page
637end_linux_gateway_page: 637end_linux_gateway_page:
638 638
@@ -652,7 +652,7 @@ end_linux_gateway_page:
652 652
653 .section .rodata,"a" 653 .section .rodata,"a"
654 654
655 .align 4096 655 .align ASM_PAGE_SIZE
656 /* Light-weight-syscall table */ 656 /* Light-weight-syscall table */
657 /* Start of lws table. */ 657 /* Start of lws table. */
658 .export lws_table 658 .export lws_table
@@ -662,14 +662,14 @@ lws_table:
662 LWS_ENTRY(compare_and_swap64) /* 1 - ELF64 Atomic compare and swap */ 662 LWS_ENTRY(compare_and_swap64) /* 1 - ELF64 Atomic compare and swap */
663 /* End of lws table */ 663 /* End of lws table */
664 664
665 .align 4096 665 .align ASM_PAGE_SIZE
666 .export sys_call_table 666 .export sys_call_table
667.Lsys_call_table: 667.Lsys_call_table:
668sys_call_table: 668sys_call_table:
669#include "syscall_table.S" 669#include "syscall_table.S"
670 670
671#ifdef CONFIG_64BIT 671#ifdef CONFIG_64BIT
672 .align 4096 672 .align ASM_PAGE_SIZE
673 .export sys_call_table64 673 .export sys_call_table64
674.Lsys_call_table64: 674.Lsys_call_table64:
675sys_call_table64: 675sys_call_table64:
diff --git a/arch/parisc/kernel/syscall_table.S b/arch/parisc/kernel/syscall_table.S
index bbeeb614cfab..e27b432f90a8 100644
--- a/arch/parisc/kernel/syscall_table.S
+++ b/arch/parisc/kernel/syscall_table.S
@@ -13,7 +13,7 @@
13 * Copyright (C) 2001 Helge Deller <deller at parisc-linux.org> 13 * Copyright (C) 2001 Helge Deller <deller at parisc-linux.org>
14 * Copyright (C) 2000-2001 Thomas Bogendoerfer <tsbogend at parisc-linux.org> 14 * Copyright (C) 2000-2001 Thomas Bogendoerfer <tsbogend at parisc-linux.org>
15 * Copyright (C) 2002 Randolph Chung <tausq with parisc-linux.org> 15 * Copyright (C) 2002 Randolph Chung <tausq with parisc-linux.org>
16 * 16 * Copyright (C) 2005-2006 Kyle McMartin <kyle at parisc-linux.org>
17 * 17 *
18 * This program is free software; you can redistribute it and/or modify 18 * This program is free software; you can redistribute it and/or modify
19 * it under the terms of the GNU General Public License as published by 19 * it under the terms of the GNU General Public License as published by
@@ -393,5 +393,11 @@
393 ENTRY_SAME(readlinkat) /* 285 */ 393 ENTRY_SAME(readlinkat) /* 285 */
394 ENTRY_SAME(fchmodat) 394 ENTRY_SAME(fchmodat)
395 ENTRY_SAME(faccessat) 395 ENTRY_SAME(faccessat)
396 ENTRY_SAME(unshare)
397 ENTRY_COMP(set_robust_list)
398 ENTRY_COMP(get_robust_list) /* 290 */
399 ENTRY_SAME(splice)
400 ENTRY_OURS(sync_file_range)
401 ENTRY_SAME(tee)
396 /* Nothing yet */ 402 /* Nothing yet */
397 403
diff --git a/arch/parisc/kernel/vmlinux.lds.S b/arch/parisc/kernel/vmlinux.lds.S
index 6d6436a6b624..94dcc03a28ed 100644
--- a/arch/parisc/kernel/vmlinux.lds.S
+++ b/arch/parisc/kernel/vmlinux.lds.S
@@ -6,6 +6,7 @@
6 * Copyright (C) 2000 Michael Ang <mang with subcarrier.org> 6 * Copyright (C) 2000 Michael Ang <mang with subcarrier.org>
7 * Copyright (C) 2002 Randolph Chung <tausq with parisc-linux.org> 7 * Copyright (C) 2002 Randolph Chung <tausq with parisc-linux.org>
8 * Copyright (C) 2003 James Bottomley <jejb with parisc-linux.org> 8 * Copyright (C) 2003 James Bottomley <jejb with parisc-linux.org>
9 * Copyright (C) 2006 Helge Deller <deller@gmx.de>
9 * 10 *
10 * 11 *
11 * This program is free software; you can redistribute it and/or modify 12 * This program is free software; you can redistribute it and/or modify
@@ -27,6 +28,7 @@
27/* needed for the processor specific cache alignment size */ 28/* needed for the processor specific cache alignment size */
28#include <asm/cache.h> 29#include <asm/cache.h>
29#include <asm/page.h> 30#include <asm/page.h>
31#include <asm/asm-offsets.h>
30 32
31/* ld script to make hppa Linux kernel */ 33/* ld script to make hppa Linux kernel */
32#ifndef CONFIG_64BIT 34#ifndef CONFIG_64BIT
@@ -68,7 +70,7 @@ SECTIONS
68 RODATA 70 RODATA
69 71
70 /* writeable */ 72 /* writeable */
71 . = ALIGN(4096); /* Make sure this is page aligned so 73 . = ALIGN(ASM_PAGE_SIZE); /* Make sure this is page aligned so
72 that we can properly leave these 74 that we can properly leave these
73 as writable */ 75 as writable */
74 data_start = .; 76 data_start = .;
@@ -81,23 +83,17 @@ SECTIONS
81 __start___unwind = .; /* unwind info */ 83 __start___unwind = .; /* unwind info */
82 .PARISC.unwind : { *(.PARISC.unwind) } 84 .PARISC.unwind : { *(.PARISC.unwind) }
83 __stop___unwind = .; 85 __stop___unwind = .;
84 86
87 /* rarely changed data like cpu maps */
88 . = ALIGN(16);
89 .data.read_mostly : { *(.data.read_mostly) }
90
91 . = ALIGN(L1_CACHE_BYTES);
85 .data : { /* Data */ 92 .data : { /* Data */
86 *(.data) 93 *(.data)
87 *(.data.vm0.pmd)
88 *(.data.vm0.pgd)
89 *(.data.vm0.pte)
90 CONSTRUCTORS 94 CONSTRUCTORS
91 } 95 }
92 96
93 . = ALIGN(4096);
94 /* nosave data is really only used for software suspend...it's here
95 * just in case we ever implement it */
96 __nosave_begin = .;
97 .data_nosave : { *(.data.nosave) }
98 . = ALIGN(4096);
99 __nosave_end = .;
100
101 . = ALIGN(L1_CACHE_BYTES); 97 . = ALIGN(L1_CACHE_BYTES);
102 .data.cacheline_aligned : { *(.data.cacheline_aligned) } 98 .data.cacheline_aligned : { *(.data.cacheline_aligned) }
103 99
@@ -105,12 +101,29 @@ SECTIONS
105 . = ALIGN(16); 101 . = ALIGN(16);
106 .data.lock_aligned : { *(.data.lock_aligned) } 102 .data.lock_aligned : { *(.data.lock_aligned) }
107 103
108 /* rarely changed data like cpu maps */ 104 . = ALIGN(ASM_PAGE_SIZE);
109 . = ALIGN(16); 105 /* nosave data is really only used for software suspend...it's here
110 .data.read_mostly : { *(.data.read_mostly) } 106 * just in case we ever implement it */
107 __nosave_begin = .;
108 .data_nosave : { *(.data.nosave) }
109 . = ALIGN(ASM_PAGE_SIZE);
110 __nosave_end = .;
111 111
112 _edata = .; /* End of data section */ 112 _edata = .; /* End of data section */
113 113
114 __bss_start = .; /* BSS */
115 /* page table entries need to be PAGE_SIZE aligned */
116 . = ALIGN(ASM_PAGE_SIZE);
117 .data.vmpages : {
118 *(.data.vm0.pmd)
119 *(.data.vm0.pgd)
120 *(.data.vm0.pte)
121 }
122 .bss : { *(.bss) *(COMMON) }
123 __bss_stop = .;
124
125
126 /* assembler code expects init_task to be 16k aligned */
114 . = ALIGN(16384); /* init_task */ 127 . = ALIGN(16384); /* init_task */
115 .data.init_task : { *(.data.init_task) } 128 .data.init_task : { *(.data.init_task) }
116 129
@@ -126,6 +139,7 @@ SECTIONS
126 .dlt : { *(.dlt) } 139 .dlt : { *(.dlt) }
127#endif 140#endif
128 141
142 /* reserve space for interrupt stack by aligning __init* to 16k */
129 . = ALIGN(16384); 143 . = ALIGN(16384);
130 __init_begin = .; 144 __init_begin = .;
131 .init.text : { 145 .init.text : {
@@ -166,7 +180,7 @@ SECTIONS
166 from .altinstructions and .eh_frame */ 180 from .altinstructions and .eh_frame */
167 .exit.text : { *(.exit.text) } 181 .exit.text : { *(.exit.text) }
168 .exit.data : { *(.exit.data) } 182 .exit.data : { *(.exit.data) }
169 . = ALIGN(4096); 183 . = ALIGN(ASM_PAGE_SIZE);
170 __initramfs_start = .; 184 __initramfs_start = .;
171 .init.ramfs : { *(.init.ramfs) } 185 .init.ramfs : { *(.init.ramfs) }
172 __initramfs_end = .; 186 __initramfs_end = .;
@@ -174,14 +188,10 @@ SECTIONS
174 __per_cpu_start = .; 188 __per_cpu_start = .;
175 .data.percpu : { *(.data.percpu) } 189 .data.percpu : { *(.data.percpu) }
176 __per_cpu_end = .; 190 __per_cpu_end = .;
177 . = ALIGN(4096); 191 . = ALIGN(ASM_PAGE_SIZE);
178 __init_end = .; 192 __init_end = .;
179 /* freed after init ends here */ 193 /* freed after init ends here */
180 194
181 __bss_start = .; /* BSS */
182 .bss : { *(.bss) *(COMMON) }
183 __bss_stop = .;
184
185 _end = . ; 195 _end = . ;
186 196
187 /* Sections to be discarded */ 197 /* Sections to be discarded */
diff --git a/arch/parisc/mm/fault.c b/arch/parisc/mm/fault.c
index 0ad945d4c0a4..64785e46f93b 100644
--- a/arch/parisc/mm/fault.c
+++ b/arch/parisc/mm/fault.c
@@ -186,7 +186,7 @@ good_area:
186 break; 186 break;
187 case VM_FAULT_SIGBUS: 187 case VM_FAULT_SIGBUS:
188 /* 188 /*
189 * We hit a hared mapping outside of the file, or some 189 * We hit a shared mapping outside of the file, or some
190 * other thing happened to us that made us unable to 190 * other thing happened to us that made us unable to
191 * handle the page fault gracefully. 191 * handle the page fault gracefully.
192 */ 192 */
diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c
index 3796be67cd53..631712562656 100644
--- a/arch/parisc/mm/init.c
+++ b/arch/parisc/mm/init.c
@@ -6,6 +6,7 @@
6 * changed by Philipp Rumpf 6 * changed by Philipp Rumpf
7 * Copyright 1999 Philipp Rumpf (prumpf@tux.org) 7 * Copyright 1999 Philipp Rumpf (prumpf@tux.org)
8 * Copyright 2004 Randolph Chung (tausq@debian.org) 8 * Copyright 2004 Randolph Chung (tausq@debian.org)
9 * Copyright 2006 Helge Deller (deller@gmx.de)
9 * 10 *
10 */ 11 */
11 12
@@ -371,8 +372,8 @@ static void __init setup_bootmem(void)
371 372
372void free_initmem(void) 373void free_initmem(void)
373{ 374{
374 unsigned long addr; 375 unsigned long addr, init_begin, init_end;
375 376
376 printk(KERN_INFO "Freeing unused kernel memory: "); 377 printk(KERN_INFO "Freeing unused kernel memory: ");
377 378
378#ifdef CONFIG_DEBUG_KERNEL 379#ifdef CONFIG_DEBUG_KERNEL
@@ -395,8 +396,11 @@ void free_initmem(void)
395 local_irq_enable(); 396 local_irq_enable();
396#endif 397#endif
397 398
398 addr = (unsigned long)(&__init_begin); 399 /* align __init_begin and __init_end to page size,
399 for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) { 400 ignoring linker script where we might have tried to save RAM */
401 init_begin = PAGE_ALIGN((unsigned long)(&__init_begin));
402 init_end = PAGE_ALIGN((unsigned long)(&__init_end));
403 for (addr = init_begin; addr < init_end; addr += PAGE_SIZE) {
400 ClearPageReserved(virt_to_page(addr)); 404 ClearPageReserved(virt_to_page(addr));
401 init_page_count(virt_to_page(addr)); 405 init_page_count(virt_to_page(addr));
402 free_page(addr); 406 free_page(addr);
@@ -407,7 +411,7 @@ void free_initmem(void)
407 /* set up a new led state on systems shipped LED State panel */ 411 /* set up a new led state on systems shipped LED State panel */
408 pdc_chassis_send_status(PDC_CHASSIS_DIRECT_BCOMPLETE); 412 pdc_chassis_send_status(PDC_CHASSIS_DIRECT_BCOMPLETE);
409 413
410 printk("%luk freed\n", (unsigned long)(&__init_end - &__init_begin) >> 10); 414 printk("%luk freed\n", (init_end - init_begin) >> 10);
411} 415}
412 416
413 417
@@ -639,11 +643,13 @@ static void __init map_pages(unsigned long start_vaddr, unsigned long start_padd
639 * Map the fault vector writable so we can 643 * Map the fault vector writable so we can
640 * write the HPMC checksum. 644 * write the HPMC checksum.
641 */ 645 */
646#if defined(CONFIG_PARISC_PAGE_SIZE_4KB)
642 if (address >= ro_start && address < ro_end 647 if (address >= ro_start && address < ro_end
643 && address != fv_addr 648 && address != fv_addr
644 && address != gw_addr) 649 && address != gw_addr)
645 pte = __mk_pte(address, PAGE_KERNEL_RO); 650 pte = __mk_pte(address, PAGE_KERNEL_RO);
646 else 651 else
652#endif
647 pte = __mk_pte(address, pgprot); 653 pte = __mk_pte(address, pgprot);
648 654
649 if (address >= end_paddr) 655 if (address >= end_paddr)
@@ -874,8 +880,7 @@ unsigned long alloc_sid(void)
874 flush_tlb_all(); /* flush_tlb_all() calls recycle_sids() */ 880 flush_tlb_all(); /* flush_tlb_all() calls recycle_sids() */
875 spin_lock(&sid_lock); 881 spin_lock(&sid_lock);
876 } 882 }
877 if (free_space_ids == 0) 883 BUG_ON(free_space_ids == 0);
878 BUG();
879 } 884 }
880 885
881 free_space_ids--; 886 free_space_ids--;
@@ -899,8 +904,7 @@ void free_sid(unsigned long spaceid)
899 904
900 spin_lock(&sid_lock); 905 spin_lock(&sid_lock);
901 906
902 if (*dirty_space_offset & (1L << index)) 907 BUG_ON(*dirty_space_offset & (1L << index)); /* attempt to free space id twice */
903 BUG(); /* attempt to free space id twice */
904 908
905 *dirty_space_offset |= (1L << index); 909 *dirty_space_offset |= (1L << index);
906 dirty_space_ids++; 910 dirty_space_ids++;
@@ -975,7 +979,7 @@ static void recycle_sids(void)
975 979
976static unsigned long recycle_ndirty; 980static unsigned long recycle_ndirty;
977static unsigned long recycle_dirty_array[SID_ARRAY_SIZE]; 981static unsigned long recycle_dirty_array[SID_ARRAY_SIZE];
978static unsigned int recycle_inuse = 0; 982static unsigned int recycle_inuse;
979 983
980void flush_tlb_all(void) 984void flush_tlb_all(void)
981{ 985{
@@ -984,9 +988,7 @@ void flush_tlb_all(void)
984 do_recycle = 0; 988 do_recycle = 0;
985 spin_lock(&sid_lock); 989 spin_lock(&sid_lock);
986 if (dirty_space_ids > RECYCLE_THRESHOLD) { 990 if (dirty_space_ids > RECYCLE_THRESHOLD) {
987 if (recycle_inuse) { 991 BUG_ON(recycle_inuse); /* FIXME: Use a semaphore/wait queue here */
988 BUG(); /* FIXME: Use a semaphore/wait queue here */
989 }
990 get_dirty_sids(&recycle_ndirty,recycle_dirty_array); 992 get_dirty_sids(&recycle_ndirty,recycle_dirty_array);
991 recycle_inuse++; 993 recycle_inuse++;
992 do_recycle++; 994 do_recycle++;
diff --git a/arch/parisc/mm/ioremap.c b/arch/parisc/mm/ioremap.c
index 0db12818d7bc..27384567a1d0 100644
--- a/arch/parisc/mm/ioremap.c
+++ b/arch/parisc/mm/ioremap.c
@@ -2,7 +2,7 @@
2 * arch/parisc/mm/ioremap.c 2 * arch/parisc/mm/ioremap.c
3 * 3 *
4 * (C) Copyright 1995 1996 Linus Torvalds 4 * (C) Copyright 1995 1996 Linus Torvalds
5 * (C) Copyright 2001 Helge Deller <deller@gmx.de> 5 * (C) Copyright 2001-2006 Helge Deller <deller@gmx.de>
6 * (C) Copyright 2005 Kyle McMartin <kyle@parisc-linux.org> 6 * (C) Copyright 2005 Kyle McMartin <kyle@parisc-linux.org>
7 */ 7 */
8 8
@@ -138,6 +138,7 @@ void __iomem * __ioremap(unsigned long phys_addr, unsigned long size, unsigned l
138 if ((phys_addr >= 0x00080000 && end < 0x000fffff) || 138 if ((phys_addr >= 0x00080000 && end < 0x000fffff) ||
139 (phys_addr >= 0x00500000 && end < 0x03bfffff)) { 139 (phys_addr >= 0x00500000 && end < 0x03bfffff)) {
140 phys_addr |= F_EXTEND(0xfc000000); 140 phys_addr |= F_EXTEND(0xfc000000);
141 flags |= _PAGE_NO_CACHE;
141 } 142 }
142#endif 143#endif
143 144
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 167e70e95556..6729c98b66f9 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -366,6 +366,7 @@ config PPC_PMAC64
366 select U3_DART 366 select U3_DART
367 select MPIC_BROKEN_U3 367 select MPIC_BROKEN_U3
368 select GENERIC_TBSYNC 368 select GENERIC_TBSYNC
369 select PPC_970_NAP
369 default y 370 default y
370 371
371config PPC_PREP 372config PPC_PREP
@@ -383,6 +384,7 @@ config PPC_MAPLE
383 select MPIC_BROKEN_U3 384 select MPIC_BROKEN_U3
384 select GENERIC_TBSYNC 385 select GENERIC_TBSYNC
385 select PPC_UDBG_16550 386 select PPC_UDBG_16550
387 select PPC_970_NAP
386 default n 388 default n
387 help 389 help
388 This option enables support for the Maple 970FX Evaluation Board. 390 This option enables support for the Maple 970FX Evaluation Board.
@@ -457,6 +459,10 @@ config PPC_MPC106
457 bool 459 bool
458 default n 460 default n
459 461
462config PPC_970_NAP
463 bool
464 default n
465
460source "drivers/cpufreq/Kconfig" 466source "drivers/cpufreq/Kconfig"
461 467
462config CPU_FREQ_PMAC 468config CPU_FREQ_PMAC
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 6ec84d37a337..ed5b26aa8be3 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -104,6 +104,10 @@ ifndef CONFIG_FSL_BOOKE
104CFLAGS += -mstring 104CFLAGS += -mstring
105endif 105endif
106 106
107ifeq ($(CONFIG_6xx),y)
108CFLAGS += -mcpu=powerpc
109endif
110
107cpu-as-$(CONFIG_PPC64BRIDGE) += -Wa,-mppc64bridge 111cpu-as-$(CONFIG_PPC64BRIDGE) += -Wa,-mppc64bridge
108cpu-as-$(CONFIG_4xx) += -Wa,-m405 112cpu-as-$(CONFIG_4xx) += -Wa,-m405
109cpu-as-$(CONFIG_6xx) += -Wa,-maltivec 113cpu-as-$(CONFIG_6xx) += -Wa,-maltivec
diff --git a/arch/powerpc/configs/cell_defconfig b/arch/powerpc/configs/cell_defconfig
index fe22e54ab2b0..dbe421dc3c11 100644
--- a/arch/powerpc/configs/cell_defconfig
+++ b/arch/powerpc/configs/cell_defconfig
@@ -9,6 +9,7 @@ CONFIG_PPC_MERGE=y
9CONFIG_MMU=y 9CONFIG_MMU=y
10CONFIG_GENERIC_HARDIRQS=y 10CONFIG_GENERIC_HARDIRQS=y
11CONFIG_RWSEM_XCHGADD_ALGORITHM=y 11CONFIG_RWSEM_XCHGADD_ALGORITHM=y
12CONFIG_GENERIC_HWEIGHT=y
12CONFIG_GENERIC_CALIBRATE_DELAY=y 13CONFIG_GENERIC_CALIBRATE_DELAY=y
13CONFIG_PPC=y 14CONFIG_PPC=y
14CONFIG_EARLY_PRINTK=y 15CONFIG_EARLY_PRINTK=y
@@ -55,6 +56,7 @@ CONFIG_SYSCTL=y
55CONFIG_IKCONFIG=y 56CONFIG_IKCONFIG=y
56CONFIG_IKCONFIG_PROC=y 57CONFIG_IKCONFIG_PROC=y
57# CONFIG_CPUSETS is not set 58# CONFIG_CPUSETS is not set
59# CONFIG_RELAY is not set
58CONFIG_INITRAMFS_SOURCE="" 60CONFIG_INITRAMFS_SOURCE=""
59CONFIG_CC_OPTIMIZE_FOR_SIZE=y 61CONFIG_CC_OPTIMIZE_FOR_SIZE=y
60# CONFIG_EMBEDDED is not set 62# CONFIG_EMBEDDED is not set
@@ -69,10 +71,6 @@ CONFIG_BASE_FULL=y
69CONFIG_FUTEX=y 71CONFIG_FUTEX=y
70CONFIG_EPOLL=y 72CONFIG_EPOLL=y
71CONFIG_SHMEM=y 73CONFIG_SHMEM=y
72CONFIG_CC_ALIGN_FUNCTIONS=0
73CONFIG_CC_ALIGN_LABELS=0
74CONFIG_CC_ALIGN_LOOPS=0
75CONFIG_CC_ALIGN_JUMPS=0
76CONFIG_SLAB=y 74CONFIG_SLAB=y
77# CONFIG_TINY_SHMEM is not set 75# CONFIG_TINY_SHMEM is not set
78CONFIG_BASE_SMALL=0 76CONFIG_BASE_SMALL=0
@@ -84,7 +82,6 @@ CONFIG_BASE_SMALL=0
84CONFIG_MODULES=y 82CONFIG_MODULES=y
85CONFIG_MODULE_UNLOAD=y 83CONFIG_MODULE_UNLOAD=y
86# CONFIG_MODULE_FORCE_UNLOAD is not set 84# CONFIG_MODULE_FORCE_UNLOAD is not set
87CONFIG_OBSOLETE_MODPARM=y
88# CONFIG_MODVERSIONS is not set 85# CONFIG_MODVERSIONS is not set
89# CONFIG_MODULE_SRCVERSION_ALL is not set 86# CONFIG_MODULE_SRCVERSION_ALL is not set
90CONFIG_KMOD=y 87CONFIG_KMOD=y
@@ -93,6 +90,7 @@ CONFIG_STOP_MACHINE=y
93# 90#
94# Block layer 91# Block layer
95# 92#
93# CONFIG_BLK_DEV_IO_TRACE is not set
96 94
97# 95#
98# IO Schedulers 96# IO Schedulers
@@ -126,6 +124,7 @@ CONFIG_RTAS_FLASH=y
126CONFIG_MMIO_NVRAM=y 124CONFIG_MMIO_NVRAM=y
127CONFIG_CELL_IIC=y 125CONFIG_CELL_IIC=y
128# CONFIG_PPC_MPC106 is not set 126# CONFIG_PPC_MPC106 is not set
127# CONFIG_PPC_970_NAP is not set
129# CONFIG_CPU_FREQ is not set 128# CONFIG_CPU_FREQ is not set
130# CONFIG_WANT_EARLY_SERIAL is not set 129# CONFIG_WANT_EARLY_SERIAL is not set
131 130
@@ -167,7 +166,6 @@ CONFIG_HAVE_MEMORY_PRESENT=y
167CONFIG_SPARSEMEM_EXTREME=y 166CONFIG_SPARSEMEM_EXTREME=y
168# CONFIG_MEMORY_HOTPLUG is not set 167# CONFIG_MEMORY_HOTPLUG is not set
169CONFIG_SPLIT_PTLOCK_CPUS=4 168CONFIG_SPLIT_PTLOCK_CPUS=4
170CONFIG_MIGRATION=y
171# CONFIG_PPC_64K_PAGES is not set 169# CONFIG_PPC_64K_PAGES is not set
172CONFIG_SCHED_SMT=y 170CONFIG_SCHED_SMT=y
173CONFIG_PROC_DEVICETREE=y 171CONFIG_PROC_DEVICETREE=y
@@ -184,7 +182,6 @@ CONFIG_GENERIC_ISA_DMA=y
184# CONFIG_PPC_INDIRECT_PCI is not set 182# CONFIG_PPC_INDIRECT_PCI is not set
185CONFIG_PCI=y 183CONFIG_PCI=y
186CONFIG_PCI_DOMAINS=y 184CONFIG_PCI_DOMAINS=y
187CONFIG_PCI_LEGACY_PROC=y
188# CONFIG_PCI_DEBUG is not set 185# CONFIG_PCI_DEBUG is not set
189 186
190# 187#
@@ -226,6 +223,7 @@ CONFIG_SYN_COOKIES=y
226# CONFIG_INET_AH is not set 223# CONFIG_INET_AH is not set
227# CONFIG_INET_ESP is not set 224# CONFIG_INET_ESP is not set
228# CONFIG_INET_IPCOMP is not set 225# CONFIG_INET_IPCOMP is not set
226# CONFIG_INET_XFRM_TUNNEL is not set
229CONFIG_INET_TUNNEL=y 227CONFIG_INET_TUNNEL=y
230CONFIG_INET_DIAG=y 228CONFIG_INET_DIAG=y
231CONFIG_INET_TCP_DIAG=y 229CONFIG_INET_TCP_DIAG=y
@@ -242,6 +240,7 @@ CONFIG_IPV6=y
242CONFIG_INET6_AH=m 240CONFIG_INET6_AH=m
243CONFIG_INET6_ESP=m 241CONFIG_INET6_ESP=m
244CONFIG_INET6_IPCOMP=m 242CONFIG_INET6_IPCOMP=m
243CONFIG_INET6_XFRM_TUNNEL=m
245CONFIG_INET6_TUNNEL=m 244CONFIG_INET6_TUNNEL=m
246CONFIG_IPV6_TUNNEL=m 245CONFIG_IPV6_TUNNEL=m
247CONFIG_NETFILTER=y 246CONFIG_NETFILTER=y
@@ -632,6 +631,7 @@ CONFIG_SERIAL_NONSTANDARD=y
632# 631#
633CONFIG_SERIAL_8250=y 632CONFIG_SERIAL_8250=y
634CONFIG_SERIAL_8250_CONSOLE=y 633CONFIG_SERIAL_8250_CONSOLE=y
634CONFIG_SERIAL_8250_PCI=y
635CONFIG_SERIAL_8250_NR_UARTS=4 635CONFIG_SERIAL_8250_NR_UARTS=4
636CONFIG_SERIAL_8250_RUNTIME_UARTS=4 636CONFIG_SERIAL_8250_RUNTIME_UARTS=4
637# CONFIG_SERIAL_8250_EXTENDED is not set 637# CONFIG_SERIAL_8250_EXTENDED is not set
@@ -717,7 +717,6 @@ CONFIG_I2C_ALGOBIT=y
717# CONFIG_I2C_PARPORT_LIGHT is not set 717# CONFIG_I2C_PARPORT_LIGHT is not set
718# CONFIG_I2C_PROSAVAGE is not set 718# CONFIG_I2C_PROSAVAGE is not set
719# CONFIG_I2C_SAVAGE4 is not set 719# CONFIG_I2C_SAVAGE4 is not set
720# CONFIG_SCx200_ACB is not set
721# CONFIG_I2C_SIS5595 is not set 720# CONFIG_I2C_SIS5595 is not set
722# CONFIG_I2C_SIS630 is not set 721# CONFIG_I2C_SIS630 is not set
723# CONFIG_I2C_SIS96X is not set 722# CONFIG_I2C_SIS96X is not set
@@ -736,9 +735,7 @@ CONFIG_I2C_ALGOBIT=y
736# CONFIG_SENSORS_PCF8574 is not set 735# CONFIG_SENSORS_PCF8574 is not set
737# CONFIG_SENSORS_PCA9539 is not set 736# CONFIG_SENSORS_PCA9539 is not set
738# CONFIG_SENSORS_PCF8591 is not set 737# CONFIG_SENSORS_PCF8591 is not set
739# CONFIG_SENSORS_RTC8564 is not set
740# CONFIG_SENSORS_MAX6875 is not set 738# CONFIG_SENSORS_MAX6875 is not set
741# CONFIG_RTC_X1205_I2C is not set
742# CONFIG_I2C_DEBUG_CORE is not set 739# CONFIG_I2C_DEBUG_CORE is not set
743# CONFIG_I2C_DEBUG_ALGO is not set 740# CONFIG_I2C_DEBUG_ALGO is not set
744# CONFIG_I2C_DEBUG_BUS is not set 741# CONFIG_I2C_DEBUG_BUS is not set
@@ -766,10 +763,6 @@ CONFIG_I2C_ALGOBIT=y
766# 763#
767 764
768# 765#
769# Multimedia Capabilities Port drivers
770#
771
772#
773# Multimedia devices 766# Multimedia devices
774# 767#
775# CONFIG_VIDEO_DEV is not set 768# CONFIG_VIDEO_DEV is not set
@@ -818,6 +811,19 @@ CONFIG_USB_ARCH_HAS_EHCI=y
818# CONFIG_MMC is not set 811# CONFIG_MMC is not set
819 812
820# 813#
814# LED devices
815#
816# CONFIG_NEW_LEDS is not set
817
818#
819# LED drivers
820#
821
822#
823# LED Triggers
824#
825
826#
821# InfiniBand support 827# InfiniBand support
822# 828#
823CONFIG_INFINIBAND=y 829CONFIG_INFINIBAND=y
@@ -834,6 +840,11 @@ CONFIG_INFINIBAND_IPOIB_DEBUG_DATA=y
834# 840#
835 841
836# 842#
843# Real Time Clock
844#
845# CONFIG_RTC_CLASS is not set
846
847#
837# File systems 848# File systems
838# 849#
839CONFIG_EXT2_FS=y 850CONFIG_EXT2_FS=y
@@ -889,7 +900,6 @@ CONFIG_TMPFS=y
889CONFIG_HUGETLBFS=y 900CONFIG_HUGETLBFS=y
890CONFIG_HUGETLB_PAGE=y 901CONFIG_HUGETLB_PAGE=y
891CONFIG_RAMFS=y 902CONFIG_RAMFS=y
892# CONFIG_RELAYFS_FS is not set
893# CONFIG_CONFIGFS_FS is not set 903# CONFIG_CONFIGFS_FS is not set
894 904
895# 905#
diff --git a/arch/powerpc/configs/g5_defconfig b/arch/powerpc/configs/g5_defconfig
index 2c3fd2007676..a45627547d03 100644
--- a/arch/powerpc/configs/g5_defconfig
+++ b/arch/powerpc/configs/g5_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc2 3# Linux kernel version: 2.6.17-rc1
4# Fri Feb 10 17:33:08 2006 4# Wed Apr 19 13:24:37 2006
5# 5#
6CONFIG_PPC64=y 6CONFIG_PPC64=y
7CONFIG_64BIT=y 7CONFIG_64BIT=y
@@ -9,6 +9,7 @@ CONFIG_PPC_MERGE=y
9CONFIG_MMU=y 9CONFIG_MMU=y
10CONFIG_GENERIC_HARDIRQS=y 10CONFIG_GENERIC_HARDIRQS=y
11CONFIG_RWSEM_XCHGADD_ALGORITHM=y 11CONFIG_RWSEM_XCHGADD_ALGORITHM=y
12CONFIG_GENERIC_HWEIGHT=y
12CONFIG_GENERIC_CALIBRATE_DELAY=y 13CONFIG_GENERIC_CALIBRATE_DELAY=y
13CONFIG_PPC=y 14CONFIG_PPC=y
14CONFIG_EARLY_PRINTK=y 15CONFIG_EARLY_PRINTK=y
@@ -29,6 +30,7 @@ CONFIG_POWER4=y
29CONFIG_PPC_FPU=y 30CONFIG_PPC_FPU=y
30CONFIG_ALTIVEC=y 31CONFIG_ALTIVEC=y
31CONFIG_PPC_STD_MMU=y 32CONFIG_PPC_STD_MMU=y
33CONFIG_VIRT_CPU_ACCOUNTING=y
32CONFIG_SMP=y 34CONFIG_SMP=y
33CONFIG_NR_CPUS=4 35CONFIG_NR_CPUS=4
34 36
@@ -53,6 +55,7 @@ CONFIG_SYSCTL=y
53CONFIG_IKCONFIG=y 55CONFIG_IKCONFIG=y
54CONFIG_IKCONFIG_PROC=y 56CONFIG_IKCONFIG_PROC=y
55# CONFIG_CPUSETS is not set 57# CONFIG_CPUSETS is not set
58# CONFIG_RELAY is not set
56CONFIG_INITRAMFS_SOURCE="" 59CONFIG_INITRAMFS_SOURCE=""
57CONFIG_CC_OPTIMIZE_FOR_SIZE=y 60CONFIG_CC_OPTIMIZE_FOR_SIZE=y
58# CONFIG_EMBEDDED is not set 61# CONFIG_EMBEDDED is not set
@@ -67,10 +70,6 @@ CONFIG_BASE_FULL=y
67CONFIG_FUTEX=y 70CONFIG_FUTEX=y
68CONFIG_EPOLL=y 71CONFIG_EPOLL=y
69CONFIG_SHMEM=y 72CONFIG_SHMEM=y
70CONFIG_CC_ALIGN_FUNCTIONS=0
71CONFIG_CC_ALIGN_LABELS=0
72CONFIG_CC_ALIGN_LOOPS=0
73CONFIG_CC_ALIGN_JUMPS=0
74CONFIG_SLAB=y 73CONFIG_SLAB=y
75# CONFIG_TINY_SHMEM is not set 74# CONFIG_TINY_SHMEM is not set
76CONFIG_BASE_SMALL=0 75CONFIG_BASE_SMALL=0
@@ -82,7 +81,6 @@ CONFIG_BASE_SMALL=0
82CONFIG_MODULES=y 81CONFIG_MODULES=y
83CONFIG_MODULE_UNLOAD=y 82CONFIG_MODULE_UNLOAD=y
84# CONFIG_MODULE_FORCE_UNLOAD is not set 83# CONFIG_MODULE_FORCE_UNLOAD is not set
85CONFIG_OBSOLETE_MODPARM=y
86CONFIG_MODVERSIONS=y 84CONFIG_MODVERSIONS=y
87CONFIG_MODULE_SRCVERSION_ALL=y 85CONFIG_MODULE_SRCVERSION_ALL=y
88CONFIG_KMOD=y 86CONFIG_KMOD=y
@@ -91,6 +89,7 @@ CONFIG_STOP_MACHINE=y
91# 89#
92# Block layer 90# Block layer
93# 91#
92# CONFIG_BLK_DEV_IO_TRACE is not set
94 93
95# 94#
96# IO Schedulers 95# IO Schedulers
@@ -185,7 +184,6 @@ CONFIG_GENERIC_ISA_DMA=y
185# CONFIG_PPC_INDIRECT_PCI is not set 184# CONFIG_PPC_INDIRECT_PCI is not set
186CONFIG_PCI=y 185CONFIG_PCI=y
187CONFIG_PCI_DOMAINS=y 186CONFIG_PCI_DOMAINS=y
188CONFIG_PCI_LEGACY_PROC=y
189# CONFIG_PCI_DEBUG is not set 187# CONFIG_PCI_DEBUG is not set
190 188
191# 189#
@@ -227,6 +225,7 @@ CONFIG_SYN_COOKIES=y
227CONFIG_INET_AH=m 225CONFIG_INET_AH=m
228CONFIG_INET_ESP=m 226CONFIG_INET_ESP=m
229CONFIG_INET_IPCOMP=m 227CONFIG_INET_IPCOMP=m
228CONFIG_INET_XFRM_TUNNEL=m
230CONFIG_INET_TUNNEL=y 229CONFIG_INET_TUNNEL=y
231CONFIG_INET_DIAG=y 230CONFIG_INET_DIAG=y
232CONFIG_INET_TCP_DIAG=y 231CONFIG_INET_TCP_DIAG=y
@@ -238,6 +237,8 @@ CONFIG_TCP_CONG_BIC=y
238# 237#
239# CONFIG_IP_VS is not set 238# CONFIG_IP_VS is not set
240# CONFIG_IPV6 is not set 239# CONFIG_IPV6 is not set
240# CONFIG_INET6_XFRM_TUNNEL is not set
241# CONFIG_INET6_TUNNEL is not set
241CONFIG_NETFILTER=y 242CONFIG_NETFILTER=y
242# CONFIG_NETFILTER_DEBUG is not set 243# CONFIG_NETFILTER_DEBUG is not set
243 244
@@ -261,6 +262,7 @@ CONFIG_IP_NF_IRC=m
261CONFIG_IP_NF_TFTP=m 262CONFIG_IP_NF_TFTP=m
262CONFIG_IP_NF_AMANDA=m 263CONFIG_IP_NF_AMANDA=m
263# CONFIG_IP_NF_PPTP is not set 264# CONFIG_IP_NF_PPTP is not set
265# CONFIG_IP_NF_H323 is not set
264CONFIG_IP_NF_QUEUE=m 266CONFIG_IP_NF_QUEUE=m
265 267
266# 268#
@@ -513,6 +515,7 @@ CONFIG_MD_RAID0=y
513CONFIG_MD_RAID1=y 515CONFIG_MD_RAID1=y
514CONFIG_MD_RAID10=m 516CONFIG_MD_RAID10=m
515CONFIG_MD_RAID5=y 517CONFIG_MD_RAID5=y
518# CONFIG_MD_RAID5_RESHAPE is not set
516CONFIG_MD_RAID6=m 519CONFIG_MD_RAID6=m
517CONFIG_MD_MULTIPATH=m 520CONFIG_MD_MULTIPATH=m
518CONFIG_MD_FAULTY=m 521CONFIG_MD_FAULTY=m
@@ -761,7 +764,6 @@ CONFIG_LEGACY_PTY_COUNT=256
761# Watchdog Cards 764# Watchdog Cards
762# 765#
763# CONFIG_WATCHDOG is not set 766# CONFIG_WATCHDOG is not set
764# CONFIG_RTC is not set
765CONFIG_GEN_RTC=y 767CONFIG_GEN_RTC=y
766# CONFIG_GEN_RTC_X is not set 768# CONFIG_GEN_RTC_X is not set
767# CONFIG_DTLK is not set 769# CONFIG_DTLK is not set
@@ -772,6 +774,7 @@ CONFIG_GEN_RTC=y
772# Ftape, the floppy tape device driver 774# Ftape, the floppy tape device driver
773# 775#
774CONFIG_AGP=m 776CONFIG_AGP=m
777# CONFIG_AGP_VIA is not set
775CONFIG_AGP_UNINORTH=m 778CONFIG_AGP_UNINORTH=m
776# CONFIG_DRM is not set 779# CONFIG_DRM is not set
777CONFIG_RAW_DRIVER=y 780CONFIG_RAW_DRIVER=y
@@ -813,7 +816,6 @@ CONFIG_I2C_POWERMAC=y
813# CONFIG_I2C_PARPORT_LIGHT is not set 816# CONFIG_I2C_PARPORT_LIGHT is not set
814# CONFIG_I2C_PROSAVAGE is not set 817# CONFIG_I2C_PROSAVAGE is not set
815# CONFIG_I2C_SAVAGE4 is not set 818# CONFIG_I2C_SAVAGE4 is not set
816# CONFIG_SCx200_ACB is not set
817# CONFIG_I2C_SIS5595 is not set 819# CONFIG_I2C_SIS5595 is not set
818# CONFIG_I2C_SIS630 is not set 820# CONFIG_I2C_SIS630 is not set
819# CONFIG_I2C_SIS96X is not set 821# CONFIG_I2C_SIS96X is not set
@@ -832,9 +834,7 @@ CONFIG_I2C_POWERMAC=y
832# CONFIG_SENSORS_PCF8574 is not set 834# CONFIG_SENSORS_PCF8574 is not set
833# CONFIG_SENSORS_PCA9539 is not set 835# CONFIG_SENSORS_PCA9539 is not set
834# CONFIG_SENSORS_PCF8591 is not set 836# CONFIG_SENSORS_PCF8591 is not set
835# CONFIG_SENSORS_RTC8564 is not set
836# CONFIG_SENSORS_MAX6875 is not set 837# CONFIG_SENSORS_MAX6875 is not set
837# CONFIG_RTC_X1205_I2C is not set
838# CONFIG_I2C_DEBUG_CORE is not set 838# CONFIG_I2C_DEBUG_CORE is not set
839# CONFIG_I2C_DEBUG_ALGO is not set 839# CONFIG_I2C_DEBUG_ALGO is not set
840# CONFIG_I2C_DEBUG_BUS is not set 840# CONFIG_I2C_DEBUG_BUS is not set
@@ -862,10 +862,6 @@ CONFIG_I2C_POWERMAC=y
862# 862#
863 863
864# 864#
865# Multimedia Capabilities Port drivers
866#
867
868#
869# Multimedia devices 865# Multimedia devices
870# 866#
871# CONFIG_VIDEO_DEV is not set 867# CONFIG_VIDEO_DEV is not set
@@ -874,6 +870,7 @@ CONFIG_I2C_POWERMAC=y
874# Digital Video Broadcasting Devices 870# Digital Video Broadcasting Devices
875# 871#
876# CONFIG_DVB is not set 872# CONFIG_DVB is not set
873# CONFIG_USB_DABUSB is not set
877 874
878# 875#
879# Graphics support 876# Graphics support
@@ -883,6 +880,7 @@ CONFIG_FB_CFB_FILLRECT=y
883CONFIG_FB_CFB_COPYAREA=y 880CONFIG_FB_CFB_COPYAREA=y
884CONFIG_FB_CFB_IMAGEBLIT=y 881CONFIG_FB_CFB_IMAGEBLIT=y
885CONFIG_FB_MACMODES=y 882CONFIG_FB_MACMODES=y
883CONFIG_FB_FIRMWARE_EDID=y
886CONFIG_FB_MODE_HELPERS=y 884CONFIG_FB_MODE_HELPERS=y
887CONFIG_FB_TILEBLITTING=y 885CONFIG_FB_TILEBLITTING=y
888# CONFIG_FB_CIRRUS is not set 886# CONFIG_FB_CIRRUS is not set
@@ -901,7 +899,6 @@ CONFIG_FB_NVIDIA=y
901CONFIG_FB_NVIDIA_I2C=y 899CONFIG_FB_NVIDIA_I2C=y
902# CONFIG_FB_RIVA is not set 900# CONFIG_FB_RIVA is not set
903# CONFIG_FB_MATROX is not set 901# CONFIG_FB_MATROX is not set
904# CONFIG_FB_RADEON_OLD is not set
905CONFIG_FB_RADEON=y 902CONFIG_FB_RADEON=y
906CONFIG_FB_RADEON_I2C=y 903CONFIG_FB_RADEON_I2C=y
907# CONFIG_FB_RADEON_DEBUG is not set 904# CONFIG_FB_RADEON_DEBUG is not set
@@ -958,9 +955,11 @@ CONFIG_SND_SEQUENCER=m
958CONFIG_SND_OSSEMUL=y 955CONFIG_SND_OSSEMUL=y
959CONFIG_SND_MIXER_OSS=m 956CONFIG_SND_MIXER_OSS=m
960CONFIG_SND_PCM_OSS=m 957CONFIG_SND_PCM_OSS=m
958CONFIG_SND_PCM_OSS_PLUGINS=y
961CONFIG_SND_SEQUENCER_OSS=y 959CONFIG_SND_SEQUENCER_OSS=y
962# CONFIG_SND_DYNAMIC_MINORS is not set 960# CONFIG_SND_DYNAMIC_MINORS is not set
963CONFIG_SND_SUPPORT_OLD_API=y 961CONFIG_SND_SUPPORT_OLD_API=y
962CONFIG_SND_VERBOSE_PROCFS=y
964# CONFIG_SND_VERBOSE_PRINTK is not set 963# CONFIG_SND_VERBOSE_PRINTK is not set
965# CONFIG_SND_DEBUG is not set 964# CONFIG_SND_DEBUG is not set
966 965
@@ -977,6 +976,7 @@ CONFIG_SND_SUPPORT_OLD_API=y
977# PCI devices 976# PCI devices
978# 977#
979# CONFIG_SND_AD1889 is not set 978# CONFIG_SND_AD1889 is not set
979# CONFIG_SND_ALS300 is not set
980# CONFIG_SND_ALS4000 is not set 980# CONFIG_SND_ALS4000 is not set
981# CONFIG_SND_ALI5451 is not set 981# CONFIG_SND_ALI5451 is not set
982# CONFIG_SND_ATIIXP is not set 982# CONFIG_SND_ATIIXP is not set
@@ -1009,6 +1009,7 @@ CONFIG_SND_SUPPORT_OLD_API=y
1009# CONFIG_SND_MIXART is not set 1009# CONFIG_SND_MIXART is not set
1010# CONFIG_SND_NM256 is not set 1010# CONFIG_SND_NM256 is not set
1011# CONFIG_SND_PCXHR is not set 1011# CONFIG_SND_PCXHR is not set
1012# CONFIG_SND_RIPTIDE is not set
1012# CONFIG_SND_RME32 is not set 1013# CONFIG_SND_RME32 is not set
1013# CONFIG_SND_RME96 is not set 1014# CONFIG_SND_RME96 is not set
1014# CONFIG_SND_RME9652 is not set 1015# CONFIG_SND_RME9652 is not set
@@ -1041,6 +1042,7 @@ CONFIG_SND_USB_AUDIO=m
1041# 1042#
1042CONFIG_USB_ARCH_HAS_HCD=y 1043CONFIG_USB_ARCH_HAS_HCD=y
1043CONFIG_USB_ARCH_HAS_OHCI=y 1044CONFIG_USB_ARCH_HAS_OHCI=y
1045CONFIG_USB_ARCH_HAS_EHCI=y
1044CONFIG_USB=y 1046CONFIG_USB=y
1045# CONFIG_USB_DEBUG is not set 1047# CONFIG_USB_DEBUG is not set
1046 1048
@@ -1068,7 +1070,6 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y
1068# 1070#
1069# USB Device Class drivers 1071# USB Device Class drivers
1070# 1072#
1071# CONFIG_OBSOLETE_OSS_USB_DRIVER is not set
1072CONFIG_USB_ACM=m 1073CONFIG_USB_ACM=m
1073CONFIG_USB_PRINTER=y 1074CONFIG_USB_PRINTER=y
1074 1075
@@ -1126,15 +1127,6 @@ CONFIG_USB_HIDDEV=y
1126# CONFIG_USB_MICROTEK is not set 1127# CONFIG_USB_MICROTEK is not set
1127 1128
1128# 1129#
1129# USB Multimedia devices
1130#
1131# CONFIG_USB_DABUSB is not set
1132
1133#
1134# Video4Linux support is needed for USB Multimedia device support
1135#
1136
1137#
1138# USB Network Adapters 1130# USB Network Adapters
1139# 1131#
1140CONFIG_USB_CATC=m 1132CONFIG_USB_CATC=m
@@ -1194,6 +1186,7 @@ CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y
1194CONFIG_USB_SERIAL_KLSI=m 1186CONFIG_USB_SERIAL_KLSI=m
1195CONFIG_USB_SERIAL_KOBIL_SCT=m 1187CONFIG_USB_SERIAL_KOBIL_SCT=m
1196CONFIG_USB_SERIAL_MCT_U232=m 1188CONFIG_USB_SERIAL_MCT_U232=m
1189# CONFIG_USB_SERIAL_NAVMAN is not set
1197CONFIG_USB_SERIAL_PL2303=m 1190CONFIG_USB_SERIAL_PL2303=m
1198# CONFIG_USB_SERIAL_HP4X is not set 1191# CONFIG_USB_SERIAL_HP4X is not set
1199CONFIG_USB_SERIAL_SAFE=m 1192CONFIG_USB_SERIAL_SAFE=m
@@ -1237,17 +1230,23 @@ CONFIG_USB_EZUSB=y
1237# CONFIG_MMC is not set 1230# CONFIG_MMC is not set
1238 1231
1239# 1232#
1233# LED devices
1234#
1235# CONFIG_NEW_LEDS is not set
1236
1237#
1240# InfiniBand support 1238# InfiniBand support
1241# 1239#
1242# CONFIG_INFINIBAND is not set 1240# CONFIG_INFINIBAND is not set
1243 1241
1244# 1242#
1245# SN Devices 1243# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
1246# 1244#
1247 1245
1248# 1246#
1249# EDAC - error detection and reporting (RAS) 1247# Real Time Clock
1250# 1248#
1249# CONFIG_RTC_CLASS is not set
1251 1250
1252# 1251#
1253# File systems 1252# File systems
@@ -1319,7 +1318,6 @@ CONFIG_TMPFS=y
1319CONFIG_HUGETLBFS=y 1318CONFIG_HUGETLBFS=y
1320CONFIG_HUGETLB_PAGE=y 1319CONFIG_HUGETLB_PAGE=y
1321CONFIG_RAMFS=y 1320CONFIG_RAMFS=y
1322# CONFIG_RELAYFS_FS is not set
1323# CONFIG_CONFIGFS_FS is not set 1321# CONFIG_CONFIGFS_FS is not set
1324 1322
1325# 1323#
diff --git a/arch/powerpc/configs/iseries_defconfig b/arch/powerpc/configs/iseries_defconfig
index 1816a46742f6..a95e455a1944 100644
--- a/arch/powerpc/configs/iseries_defconfig
+++ b/arch/powerpc/configs/iseries_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc6 3# Linux kernel version: 2.6.17-rc1
4# Wed Mar 15 16:19:52 2006 4# Wed Apr 19 11:46:44 2006
5# 5#
6CONFIG_PPC64=y 6CONFIG_PPC64=y
7CONFIG_64BIT=y 7CONFIG_64BIT=y
@@ -9,6 +9,7 @@ CONFIG_PPC_MERGE=y
9CONFIG_MMU=y 9CONFIG_MMU=y
10CONFIG_GENERIC_HARDIRQS=y 10CONFIG_GENERIC_HARDIRQS=y
11CONFIG_RWSEM_XCHGADD_ALGORITHM=y 11CONFIG_RWSEM_XCHGADD_ALGORITHM=y
12CONFIG_GENERIC_HWEIGHT=y
12CONFIG_GENERIC_CALIBRATE_DELAY=y 13CONFIG_GENERIC_CALIBRATE_DELAY=y
13CONFIG_PPC=y 14CONFIG_PPC=y
14CONFIG_EARLY_PRINTK=y 15CONFIG_EARLY_PRINTK=y
@@ -30,6 +31,7 @@ CONFIG_POWER4=y
30CONFIG_PPC_FPU=y 31CONFIG_PPC_FPU=y
31# CONFIG_ALTIVEC is not set 32# CONFIG_ALTIVEC is not set
32CONFIG_PPC_STD_MMU=y 33CONFIG_PPC_STD_MMU=y
34CONFIG_VIRT_CPU_ACCOUNTING=y
33CONFIG_SMP=y 35CONFIG_SMP=y
34CONFIG_NR_CPUS=32 36CONFIG_NR_CPUS=32
35 37
@@ -55,6 +57,7 @@ CONFIG_AUDITSYSCALL=y
55CONFIG_IKCONFIG=y 57CONFIG_IKCONFIG=y
56CONFIG_IKCONFIG_PROC=y 58CONFIG_IKCONFIG_PROC=y
57# CONFIG_CPUSETS is not set 59# CONFIG_CPUSETS is not set
60# CONFIG_RELAY is not set
58CONFIG_INITRAMFS_SOURCE="" 61CONFIG_INITRAMFS_SOURCE=""
59CONFIG_CC_OPTIMIZE_FOR_SIZE=y 62CONFIG_CC_OPTIMIZE_FOR_SIZE=y
60# CONFIG_EMBEDDED is not set 63# CONFIG_EMBEDDED is not set
@@ -69,10 +72,6 @@ CONFIG_BASE_FULL=y
69CONFIG_FUTEX=y 72CONFIG_FUTEX=y
70CONFIG_EPOLL=y 73CONFIG_EPOLL=y
71CONFIG_SHMEM=y 74CONFIG_SHMEM=y
72CONFIG_CC_ALIGN_FUNCTIONS=0
73CONFIG_CC_ALIGN_LABELS=0
74CONFIG_CC_ALIGN_LOOPS=0
75CONFIG_CC_ALIGN_JUMPS=0
76CONFIG_SLAB=y 75CONFIG_SLAB=y
77# CONFIG_TINY_SHMEM is not set 76# CONFIG_TINY_SHMEM is not set
78CONFIG_BASE_SMALL=0 77CONFIG_BASE_SMALL=0
@@ -84,7 +83,6 @@ CONFIG_BASE_SMALL=0
84CONFIG_MODULES=y 83CONFIG_MODULES=y
85CONFIG_MODULE_UNLOAD=y 84CONFIG_MODULE_UNLOAD=y
86# CONFIG_MODULE_FORCE_UNLOAD is not set 85# CONFIG_MODULE_FORCE_UNLOAD is not set
87CONFIG_OBSOLETE_MODPARM=y
88CONFIG_MODVERSIONS=y 86CONFIG_MODVERSIONS=y
89CONFIG_MODULE_SRCVERSION_ALL=y 87CONFIG_MODULE_SRCVERSION_ALL=y
90CONFIG_KMOD=y 88CONFIG_KMOD=y
@@ -93,6 +91,7 @@ CONFIG_STOP_MACHINE=y
93# 91#
94# Block layer 92# Block layer
95# 93#
94# CONFIG_BLK_DEV_IO_TRACE is not set
96 95
97# 96#
98# IO Schedulers 97# IO Schedulers
@@ -165,7 +164,6 @@ CONFIG_GENERIC_ISA_DMA=y
165# CONFIG_PPC_INDIRECT_PCI is not set 164# CONFIG_PPC_INDIRECT_PCI is not set
166CONFIG_PCI=y 165CONFIG_PCI=y
167CONFIG_PCI_DOMAINS=y 166CONFIG_PCI_DOMAINS=y
168CONFIG_PCI_LEGACY_PROC=y
169# CONFIG_PCI_DEBUG is not set 167# CONFIG_PCI_DEBUG is not set
170 168
171# 169#
@@ -207,6 +205,7 @@ CONFIG_SYN_COOKIES=y
207CONFIG_INET_AH=m 205CONFIG_INET_AH=m
208CONFIG_INET_ESP=m 206CONFIG_INET_ESP=m
209CONFIG_INET_IPCOMP=m 207CONFIG_INET_IPCOMP=m
208CONFIG_INET_XFRM_TUNNEL=m
210CONFIG_INET_TUNNEL=y 209CONFIG_INET_TUNNEL=y
211CONFIG_INET_DIAG=y 210CONFIG_INET_DIAG=y
212CONFIG_INET_TCP_DIAG=y 211CONFIG_INET_TCP_DIAG=y
@@ -218,6 +217,8 @@ CONFIG_TCP_CONG_BIC=y
218# 217#
219# CONFIG_IP_VS is not set 218# CONFIG_IP_VS is not set
220# CONFIG_IPV6 is not set 219# CONFIG_IPV6 is not set
220# CONFIG_INET6_XFRM_TUNNEL is not set
221# CONFIG_INET6_TUNNEL is not set
221CONFIG_NETFILTER=y 222CONFIG_NETFILTER=y
222# CONFIG_NETFILTER_DEBUG is not set 223# CONFIG_NETFILTER_DEBUG is not set
223 224
@@ -236,11 +237,14 @@ CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
236CONFIG_NETFILTER_XT_MATCH_CONNMARK=m 237CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
237CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m 238CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
238# CONFIG_NETFILTER_XT_MATCH_DCCP is not set 239# CONFIG_NETFILTER_XT_MATCH_DCCP is not set
240# CONFIG_NETFILTER_XT_MATCH_ESP is not set
239CONFIG_NETFILTER_XT_MATCH_HELPER=m 241CONFIG_NETFILTER_XT_MATCH_HELPER=m
240CONFIG_NETFILTER_XT_MATCH_LENGTH=m 242CONFIG_NETFILTER_XT_MATCH_LENGTH=m
241CONFIG_NETFILTER_XT_MATCH_LIMIT=m 243CONFIG_NETFILTER_XT_MATCH_LIMIT=m
242CONFIG_NETFILTER_XT_MATCH_MAC=m 244CONFIG_NETFILTER_XT_MATCH_MAC=m
243CONFIG_NETFILTER_XT_MATCH_MARK=m 245CONFIG_NETFILTER_XT_MATCH_MARK=m
246# CONFIG_NETFILTER_XT_MATCH_POLICY is not set
247# CONFIG_NETFILTER_XT_MATCH_MULTIPORT is not set
244CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m 248CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
245CONFIG_NETFILTER_XT_MATCH_REALM=m 249CONFIG_NETFILTER_XT_MATCH_REALM=m
246CONFIG_NETFILTER_XT_MATCH_SCTP=m 250CONFIG_NETFILTER_XT_MATCH_SCTP=m
@@ -262,20 +266,19 @@ CONFIG_IP_NF_IRC=m
262CONFIG_IP_NF_TFTP=m 266CONFIG_IP_NF_TFTP=m
263CONFIG_IP_NF_AMANDA=m 267CONFIG_IP_NF_AMANDA=m
264# CONFIG_IP_NF_PPTP is not set 268# CONFIG_IP_NF_PPTP is not set
269# CONFIG_IP_NF_H323 is not set
265CONFIG_IP_NF_QUEUE=m 270CONFIG_IP_NF_QUEUE=m
266CONFIG_IP_NF_IPTABLES=m 271CONFIG_IP_NF_IPTABLES=m
267CONFIG_IP_NF_MATCH_IPRANGE=m 272CONFIG_IP_NF_MATCH_IPRANGE=m
268CONFIG_IP_NF_MATCH_MULTIPORT=m
269CONFIG_IP_NF_MATCH_TOS=m 273CONFIG_IP_NF_MATCH_TOS=m
270CONFIG_IP_NF_MATCH_RECENT=m 274CONFIG_IP_NF_MATCH_RECENT=m
271CONFIG_IP_NF_MATCH_ECN=m 275CONFIG_IP_NF_MATCH_ECN=m
272CONFIG_IP_NF_MATCH_DSCP=m 276CONFIG_IP_NF_MATCH_DSCP=m
273CONFIG_IP_NF_MATCH_AH_ESP=m 277# CONFIG_IP_NF_MATCH_AH is not set
274CONFIG_IP_NF_MATCH_TTL=m 278CONFIG_IP_NF_MATCH_TTL=m
275CONFIG_IP_NF_MATCH_OWNER=m 279CONFIG_IP_NF_MATCH_OWNER=m
276CONFIG_IP_NF_MATCH_ADDRTYPE=m 280CONFIG_IP_NF_MATCH_ADDRTYPE=m
277CONFIG_IP_NF_MATCH_HASHLIMIT=m 281CONFIG_IP_NF_MATCH_HASHLIMIT=m
278CONFIG_IP_NF_MATCH_POLICY=m
279CONFIG_IP_NF_FILTER=m 282CONFIG_IP_NF_FILTER=m
280CONFIG_IP_NF_TARGET_REJECT=m 283CONFIG_IP_NF_TARGET_REJECT=m
281CONFIG_IP_NF_TARGET_LOG=m 284CONFIG_IP_NF_TARGET_LOG=m
@@ -479,6 +482,7 @@ CONFIG_MD_RAID0=y
479CONFIG_MD_RAID1=y 482CONFIG_MD_RAID1=y
480CONFIG_MD_RAID10=m 483CONFIG_MD_RAID10=m
481CONFIG_MD_RAID5=y 484CONFIG_MD_RAID5=y
485# CONFIG_MD_RAID5_RESHAPE is not set
482CONFIG_MD_RAID6=m 486CONFIG_MD_RAID6=m
483CONFIG_MD_MULTIPATH=m 487CONFIG_MD_MULTIPATH=m
484CONFIG_MD_FAULTY=m 488CONFIG_MD_FAULTY=m
@@ -702,7 +706,6 @@ CONFIG_LEGACY_PTY_COUNT=256
702# Watchdog Cards 706# Watchdog Cards
703# 707#
704# CONFIG_WATCHDOG is not set 708# CONFIG_WATCHDOG is not set
705# CONFIG_RTC is not set
706CONFIG_GEN_RTC=y 709CONFIG_GEN_RTC=y
707# CONFIG_GEN_RTC_X is not set 710# CONFIG_GEN_RTC_X is not set
708# CONFIG_DTLK is not set 711# CONFIG_DTLK is not set
@@ -751,10 +754,6 @@ CONFIG_MAX_RAW_DEVS=256
751# 754#
752 755
753# 756#
754# Multimedia Capabilities Port drivers
755#
756
757#
758# Multimedia devices 757# Multimedia devices
759# 758#
760# CONFIG_VIDEO_DEV is not set 759# CONFIG_VIDEO_DEV is not set
@@ -779,6 +778,7 @@ CONFIG_MAX_RAW_DEVS=256
779# 778#
780CONFIG_USB_ARCH_HAS_HCD=y 779CONFIG_USB_ARCH_HAS_HCD=y
781CONFIG_USB_ARCH_HAS_OHCI=y 780CONFIG_USB_ARCH_HAS_OHCI=y
781CONFIG_USB_ARCH_HAS_EHCI=y
782# CONFIG_USB is not set 782# CONFIG_USB is not set
783 783
784# 784#
@@ -796,6 +796,11 @@ CONFIG_USB_ARCH_HAS_OHCI=y
796# CONFIG_MMC is not set 796# CONFIG_MMC is not set
797 797
798# 798#
799# LED devices
800#
801# CONFIG_NEW_LEDS is not set
802
803#
799# InfiniBand support 804# InfiniBand support
800# 805#
801# CONFIG_INFINIBAND is not set 806# CONFIG_INFINIBAND is not set
@@ -805,6 +810,11 @@ CONFIG_USB_ARCH_HAS_OHCI=y
805# 810#
806 811
807# 812#
813# Real Time Clock
814#
815# CONFIG_RTC_CLASS is not set
816
817#
808# File systems 818# File systems
809# 819#
810CONFIG_EXT2_FS=y 820CONFIG_EXT2_FS=y
@@ -878,7 +888,6 @@ CONFIG_TMPFS=y
878# CONFIG_HUGETLBFS is not set 888# CONFIG_HUGETLBFS is not set
879# CONFIG_HUGETLB_PAGE is not set 889# CONFIG_HUGETLB_PAGE is not set
880CONFIG_RAMFS=y 890CONFIG_RAMFS=y
881# CONFIG_RELAYFS_FS is not set
882# CONFIG_CONFIGFS_FS is not set 891# CONFIG_CONFIGFS_FS is not set
883 892
884# 893#
diff --git a/arch/powerpc/configs/pseries_defconfig b/arch/powerpc/configs/pseries_defconfig
index daaf038a1faa..58e68ce09b0f 100644
--- a/arch/powerpc/configs/pseries_defconfig
+++ b/arch/powerpc/configs/pseries_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc2 3# Linux kernel version: 2.6.17-rc1
4# Fri Feb 10 17:33:32 2006 4# Wed Apr 19 11:48:00 2006
5# 5#
6CONFIG_PPC64=y 6CONFIG_PPC64=y
7CONFIG_64BIT=y 7CONFIG_64BIT=y
@@ -9,6 +9,7 @@ CONFIG_PPC_MERGE=y
9CONFIG_MMU=y 9CONFIG_MMU=y
10CONFIG_GENERIC_HARDIRQS=y 10CONFIG_GENERIC_HARDIRQS=y
11CONFIG_RWSEM_XCHGADD_ALGORITHM=y 11CONFIG_RWSEM_XCHGADD_ALGORITHM=y
12CONFIG_GENERIC_HWEIGHT=y
12CONFIG_GENERIC_CALIBRATE_DELAY=y 13CONFIG_GENERIC_CALIBRATE_DELAY=y
13CONFIG_PPC=y 14CONFIG_PPC=y
14CONFIG_EARLY_PRINTK=y 15CONFIG_EARLY_PRINTK=y
@@ -30,6 +31,7 @@ CONFIG_POWER4=y
30CONFIG_PPC_FPU=y 31CONFIG_PPC_FPU=y
31CONFIG_ALTIVEC=y 32CONFIG_ALTIVEC=y
32CONFIG_PPC_STD_MMU=y 33CONFIG_PPC_STD_MMU=y
34CONFIG_VIRT_CPU_ACCOUNTING=y
33CONFIG_SMP=y 35CONFIG_SMP=y
34CONFIG_NR_CPUS=128 36CONFIG_NR_CPUS=128
35 37
@@ -55,6 +57,7 @@ CONFIG_AUDITSYSCALL=y
55CONFIG_IKCONFIG=y 57CONFIG_IKCONFIG=y
56CONFIG_IKCONFIG_PROC=y 58CONFIG_IKCONFIG_PROC=y
57CONFIG_CPUSETS=y 59CONFIG_CPUSETS=y
60# CONFIG_RELAY is not set
58CONFIG_INITRAMFS_SOURCE="" 61CONFIG_INITRAMFS_SOURCE=""
59CONFIG_CC_OPTIMIZE_FOR_SIZE=y 62CONFIG_CC_OPTIMIZE_FOR_SIZE=y
60# CONFIG_EMBEDDED is not set 63# CONFIG_EMBEDDED is not set
@@ -69,10 +72,6 @@ CONFIG_BASE_FULL=y
69CONFIG_FUTEX=y 72CONFIG_FUTEX=y
70CONFIG_EPOLL=y 73CONFIG_EPOLL=y
71CONFIG_SHMEM=y 74CONFIG_SHMEM=y
72CONFIG_CC_ALIGN_FUNCTIONS=0
73CONFIG_CC_ALIGN_LABELS=0
74CONFIG_CC_ALIGN_LOOPS=0
75CONFIG_CC_ALIGN_JUMPS=0
76CONFIG_SLAB=y 75CONFIG_SLAB=y
77# CONFIG_TINY_SHMEM is not set 76# CONFIG_TINY_SHMEM is not set
78CONFIG_BASE_SMALL=0 77CONFIG_BASE_SMALL=0
@@ -84,7 +83,6 @@ CONFIG_BASE_SMALL=0
84CONFIG_MODULES=y 83CONFIG_MODULES=y
85CONFIG_MODULE_UNLOAD=y 84CONFIG_MODULE_UNLOAD=y
86# CONFIG_MODULE_FORCE_UNLOAD is not set 85# CONFIG_MODULE_FORCE_UNLOAD is not set
87CONFIG_OBSOLETE_MODPARM=y
88CONFIG_MODVERSIONS=y 86CONFIG_MODVERSIONS=y
89CONFIG_MODULE_SRCVERSION_ALL=y 87CONFIG_MODULE_SRCVERSION_ALL=y
90CONFIG_KMOD=y 88CONFIG_KMOD=y
@@ -93,6 +91,7 @@ CONFIG_STOP_MACHINE=y
93# 91#
94# Block layer 92# Block layer
95# 93#
94# CONFIG_BLK_DEV_IO_TRACE is not set
96 95
97# 96#
98# IO Schedulers 97# IO Schedulers
@@ -188,7 +187,6 @@ CONFIG_PPC_I8259=y
188# CONFIG_PPC_INDIRECT_PCI is not set 187# CONFIG_PPC_INDIRECT_PCI is not set
189CONFIG_PCI=y 188CONFIG_PCI=y
190CONFIG_PCI_DOMAINS=y 189CONFIG_PCI_DOMAINS=y
191CONFIG_PCI_LEGACY_PROC=y
192# CONFIG_PCI_DEBUG is not set 190# CONFIG_PCI_DEBUG is not set
193 191
194# 192#
@@ -235,6 +233,7 @@ CONFIG_SYN_COOKIES=y
235CONFIG_INET_AH=m 233CONFIG_INET_AH=m
236CONFIG_INET_ESP=m 234CONFIG_INET_ESP=m
237CONFIG_INET_IPCOMP=m 235CONFIG_INET_IPCOMP=m
236CONFIG_INET_XFRM_TUNNEL=m
238CONFIG_INET_TUNNEL=y 237CONFIG_INET_TUNNEL=y
239CONFIG_INET_DIAG=y 238CONFIG_INET_DIAG=y
240CONFIG_INET_TCP_DIAG=y 239CONFIG_INET_TCP_DIAG=y
@@ -246,6 +245,8 @@ CONFIG_TCP_CONG_BIC=y
246# 245#
247# CONFIG_IP_VS is not set 246# CONFIG_IP_VS is not set
248# CONFIG_IPV6 is not set 247# CONFIG_IPV6 is not set
248# CONFIG_INET6_XFRM_TUNNEL is not set
249# CONFIG_INET6_TUNNEL is not set
249CONFIG_NETFILTER=y 250CONFIG_NETFILTER=y
250# CONFIG_NETFILTER_DEBUG is not set 251# CONFIG_NETFILTER_DEBUG is not set
251 252
@@ -272,6 +273,7 @@ CONFIG_IP_NF_IRC=m
272CONFIG_IP_NF_TFTP=m 273CONFIG_IP_NF_TFTP=m
273CONFIG_IP_NF_AMANDA=m 274CONFIG_IP_NF_AMANDA=m
274# CONFIG_IP_NF_PPTP is not set 275# CONFIG_IP_NF_PPTP is not set
276# CONFIG_IP_NF_H323 is not set
275CONFIG_IP_NF_QUEUE=m 277CONFIG_IP_NF_QUEUE=m
276 278
277# 279#
@@ -519,6 +521,7 @@ CONFIG_MD_RAID0=y
519CONFIG_MD_RAID1=y 521CONFIG_MD_RAID1=y
520CONFIG_MD_RAID10=m 522CONFIG_MD_RAID10=m
521CONFIG_MD_RAID5=y 523CONFIG_MD_RAID5=y
524# CONFIG_MD_RAID5_RESHAPE is not set
522CONFIG_MD_RAID6=m 525CONFIG_MD_RAID6=m
523CONFIG_MD_MULTIPATH=m 526CONFIG_MD_MULTIPATH=m
524CONFIG_MD_FAULTY=m 527CONFIG_MD_FAULTY=m
@@ -750,6 +753,7 @@ CONFIG_HW_CONSOLE=y
750# 753#
751CONFIG_SERIAL_8250=y 754CONFIG_SERIAL_8250=y
752CONFIG_SERIAL_8250_CONSOLE=y 755CONFIG_SERIAL_8250_CONSOLE=y
756CONFIG_SERIAL_8250_PCI=y
753CONFIG_SERIAL_8250_NR_UARTS=4 757CONFIG_SERIAL_8250_NR_UARTS=4
754CONFIG_SERIAL_8250_RUNTIME_UARTS=4 758CONFIG_SERIAL_8250_RUNTIME_UARTS=4
755# CONFIG_SERIAL_8250_EXTENDED is not set 759# CONFIG_SERIAL_8250_EXTENDED is not set
@@ -767,7 +771,9 @@ CONFIG_LEGACY_PTY_COUNT=256
767# CONFIG_PRINTER is not set 771# CONFIG_PRINTER is not set
768# CONFIG_PPDEV is not set 772# CONFIG_PPDEV is not set
769# CONFIG_TIPAR is not set 773# CONFIG_TIPAR is not set
774CONFIG_HVC_DRIVER=y
770CONFIG_HVC_CONSOLE=y 775CONFIG_HVC_CONSOLE=y
776# CONFIG_HVC_RTAS is not set
771CONFIG_HVCS=m 777CONFIG_HVCS=m
772 778
773# 779#
@@ -779,7 +785,6 @@ CONFIG_HVCS=m
779# Watchdog Cards 785# Watchdog Cards
780# 786#
781# CONFIG_WATCHDOG is not set 787# CONFIG_WATCHDOG is not set
782# CONFIG_RTC is not set
783CONFIG_GEN_RTC=y 788CONFIG_GEN_RTC=y
784# CONFIG_GEN_RTC_X is not set 789# CONFIG_GEN_RTC_X is not set
785# CONFIG_DTLK is not set 790# CONFIG_DTLK is not set
@@ -830,7 +835,6 @@ CONFIG_I2C_ALGOBIT=y
830# CONFIG_I2C_PARPORT_LIGHT is not set 835# CONFIG_I2C_PARPORT_LIGHT is not set
831# CONFIG_I2C_PROSAVAGE is not set 836# CONFIG_I2C_PROSAVAGE is not set
832# CONFIG_I2C_SAVAGE4 is not set 837# CONFIG_I2C_SAVAGE4 is not set
833# CONFIG_SCx200_ACB is not set
834# CONFIG_I2C_SIS5595 is not set 838# CONFIG_I2C_SIS5595 is not set
835# CONFIG_I2C_SIS630 is not set 839# CONFIG_I2C_SIS630 is not set
836# CONFIG_I2C_SIS96X is not set 840# CONFIG_I2C_SIS96X is not set
@@ -849,9 +853,7 @@ CONFIG_I2C_ALGOBIT=y
849# CONFIG_SENSORS_PCF8574 is not set 853# CONFIG_SENSORS_PCF8574 is not set
850# CONFIG_SENSORS_PCA9539 is not set 854# CONFIG_SENSORS_PCA9539 is not set
851# CONFIG_SENSORS_PCF8591 is not set 855# CONFIG_SENSORS_PCF8591 is not set
852# CONFIG_SENSORS_RTC8564 is not set
853# CONFIG_SENSORS_MAX6875 is not set 856# CONFIG_SENSORS_MAX6875 is not set
854# CONFIG_RTC_X1205_I2C is not set
855# CONFIG_I2C_DEBUG_CORE is not set 857# CONFIG_I2C_DEBUG_CORE is not set
856# CONFIG_I2C_DEBUG_ALGO is not set 858# CONFIG_I2C_DEBUG_ALGO is not set
857# CONFIG_I2C_DEBUG_BUS is not set 859# CONFIG_I2C_DEBUG_BUS is not set
@@ -879,10 +881,6 @@ CONFIG_I2C_ALGOBIT=y
879# 881#
880 882
881# 883#
882# Multimedia Capabilities Port drivers
883#
884
885#
886# Multimedia devices 884# Multimedia devices
887# 885#
888# CONFIG_VIDEO_DEV is not set 886# CONFIG_VIDEO_DEV is not set
@@ -891,6 +889,7 @@ CONFIG_I2C_ALGOBIT=y
891# Digital Video Broadcasting Devices 889# Digital Video Broadcasting Devices
892# 890#
893# CONFIG_DVB is not set 891# CONFIG_DVB is not set
892# CONFIG_USB_DABUSB is not set
894 893
895# 894#
896# Graphics support 895# Graphics support
@@ -900,6 +899,7 @@ CONFIG_FB_CFB_FILLRECT=y
900CONFIG_FB_CFB_COPYAREA=y 899CONFIG_FB_CFB_COPYAREA=y
901CONFIG_FB_CFB_IMAGEBLIT=y 900CONFIG_FB_CFB_IMAGEBLIT=y
902CONFIG_FB_MACMODES=y 901CONFIG_FB_MACMODES=y
902CONFIG_FB_FIRMWARE_EDID=y
903CONFIG_FB_MODE_HELPERS=y 903CONFIG_FB_MODE_HELPERS=y
904CONFIG_FB_TILEBLITTING=y 904CONFIG_FB_TILEBLITTING=y
905# CONFIG_FB_CIRRUS is not set 905# CONFIG_FB_CIRRUS is not set
@@ -919,7 +919,6 @@ CONFIG_FB_MATROX_MYSTIQUE=y
919CONFIG_FB_MATROX_G=y 919CONFIG_FB_MATROX_G=y
920# CONFIG_FB_MATROX_I2C is not set 920# CONFIG_FB_MATROX_I2C is not set
921CONFIG_FB_MATROX_MULTIHEAD=y 921CONFIG_FB_MATROX_MULTIHEAD=y
922# CONFIG_FB_RADEON_OLD is not set
923CONFIG_FB_RADEON=y 922CONFIG_FB_RADEON=y
924CONFIG_FB_RADEON_I2C=y 923CONFIG_FB_RADEON_I2C=y
925# CONFIG_FB_RADEON_DEBUG is not set 924# CONFIG_FB_RADEON_DEBUG is not set
@@ -968,6 +967,7 @@ CONFIG_LCD_DEVICE=y
968# 967#
969CONFIG_USB_ARCH_HAS_HCD=y 968CONFIG_USB_ARCH_HAS_HCD=y
970CONFIG_USB_ARCH_HAS_OHCI=y 969CONFIG_USB_ARCH_HAS_OHCI=y
970CONFIG_USB_ARCH_HAS_EHCI=y
971CONFIG_USB=y 971CONFIG_USB=y
972# CONFIG_USB_DEBUG is not set 972# CONFIG_USB_DEBUG is not set
973 973
@@ -1048,15 +1048,6 @@ CONFIG_USB_HIDDEV=y
1048# CONFIG_USB_MICROTEK is not set 1048# CONFIG_USB_MICROTEK is not set
1049 1049
1050# 1050#
1051# USB Multimedia devices
1052#
1053# CONFIG_USB_DABUSB is not set
1054
1055#
1056# Video4Linux support is needed for USB Multimedia device support
1057#
1058
1059#
1060# USB Network Adapters 1051# USB Network Adapters
1061# 1052#
1062# CONFIG_USB_CATC is not set 1053# CONFIG_USB_CATC is not set
@@ -1109,6 +1100,11 @@ CONFIG_USB_MON=y
1109# CONFIG_MMC is not set 1100# CONFIG_MMC is not set
1110 1101
1111# 1102#
1103# LED devices
1104#
1105# CONFIG_NEW_LEDS is not set
1106
1107#
1112# InfiniBand support 1108# InfiniBand support
1113# 1109#
1114CONFIG_INFINIBAND=m 1110CONFIG_INFINIBAND=m
@@ -1121,12 +1117,13 @@ CONFIG_INFINIBAND_IPOIB=m
1121# CONFIG_INFINIBAND_SRP is not set 1117# CONFIG_INFINIBAND_SRP is not set
1122 1118
1123# 1119#
1124# SN Devices 1120# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
1125# 1121#
1126 1122
1127# 1123#
1128# EDAC - error detection and reporting (RAS) 1124# Real Time Clock
1129# 1125#
1126# CONFIG_RTC_CLASS is not set
1130 1127
1131# 1128#
1132# File systems 1129# File systems
@@ -1202,7 +1199,6 @@ CONFIG_TMPFS=y
1202CONFIG_HUGETLBFS=y 1199CONFIG_HUGETLBFS=y
1203CONFIG_HUGETLB_PAGE=y 1200CONFIG_HUGETLB_PAGE=y
1204CONFIG_RAMFS=y 1201CONFIG_RAMFS=y
1205# CONFIG_RELAYFS_FS is not set
1206# CONFIG_CONFIGFS_FS is not set 1202# CONFIG_CONFIGFS_FS is not set
1207 1203
1208# 1204#
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
index 0cc0995b81b0..803858e86160 100644
--- a/arch/powerpc/kernel/Makefile
+++ b/arch/powerpc/kernel/Makefile
@@ -20,7 +20,7 @@ obj-$(CONFIG_PPC64) += setup_64.o binfmt_elf32.o sys_ppc32.o \
20 firmware.o sysfs.o 20 firmware.o sysfs.o
21obj-$(CONFIG_PPC64) += vdso64/ 21obj-$(CONFIG_PPC64) += vdso64/
22obj-$(CONFIG_ALTIVEC) += vecemu.o vector.o 22obj-$(CONFIG_ALTIVEC) += vecemu.o vector.o
23obj-$(CONFIG_POWER4) += idle_power4.o 23obj-$(CONFIG_PPC_970_NAP) += idle_power4.o
24obj-$(CONFIG_PPC_OF) += of_device.o prom_parse.o 24obj-$(CONFIG_PPC_OF) += of_device.o prom_parse.o
25procfs-$(CONFIG_PPC64) := proc_ppc64.o 25procfs-$(CONFIG_PPC64) := proc_ppc64.o
26obj-$(CONFIG_PROC_FS) += $(procfs-y) 26obj-$(CONFIG_PROC_FS) += $(procfs-y)
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c
index 54b48f330051..8f85c5e8a55a 100644
--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -91,6 +91,7 @@ int main(void)
91#endif /* CONFIG_PPC64 */ 91#endif /* CONFIG_PPC64 */
92 92
93 DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); 93 DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
94 DEFINE(TI_LOCAL_FLAGS, offsetof(struct thread_info, local_flags));
94 DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count)); 95 DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count));
95 DEFINE(TI_TASK, offsetof(struct thread_info, task)); 96 DEFINE(TI_TASK, offsetof(struct thread_info, task));
96#ifdef CONFIG_PPC32 97#ifdef CONFIG_PPC32
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index 39e348a3ade2..3f7182db9ed5 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -57,6 +57,8 @@ extern void __setup_cpu_ppc970(unsigned long offset, struct cpu_spec* spec);
57 PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP) 57 PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP)
58#define COMMON_USER_POWER5_PLUS (COMMON_USER_PPC64 | PPC_FEATURE_POWER5_PLUS|\ 58#define COMMON_USER_POWER5_PLUS (COMMON_USER_PPC64 | PPC_FEATURE_POWER5_PLUS|\
59 PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP) 59 PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP)
60#define COMMON_USER_POWER6 (COMMON_USER_PPC64 | PPC_FEATURE_ARCH_2_05 |\
61 PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP)
60#define COMMON_USER_BOOKE (PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | \ 62#define COMMON_USER_BOOKE (PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | \
61 PPC_FEATURE_BOOKE) 63 PPC_FEATURE_BOOKE)
62 64
@@ -263,6 +265,20 @@ struct cpu_spec cpu_specs[] = {
263 .oprofile_type = PPC_OPROFILE_POWER4, 265 .oprofile_type = PPC_OPROFILE_POWER4,
264 .platform = "power5+", 266 .platform = "power5+",
265 }, 267 },
268 { /* Power6 */
269 .pvr_mask = 0xffff0000,
270 .pvr_value = 0x003e0000,
271 .cpu_name = "POWER6",
272 .cpu_features = CPU_FTRS_POWER6,
273 .cpu_user_features = COMMON_USER_POWER6,
274 .icache_bsize = 128,
275 .dcache_bsize = 128,
276 .num_pmcs = 6,
277 .cpu_setup = __setup_cpu_power4,
278 .oprofile_cpu_type = "ppc64/power6",
279 .oprofile_type = PPC_OPROFILE_POWER4,
280 .platform = "power6",
281 },
266 { /* Cell Broadband Engine */ 282 { /* Cell Broadband Engine */
267 .pvr_mask = 0xffff0000, 283 .pvr_mask = 0xffff0000,
268 .pvr_value = 0x00700000, 284 .pvr_value = 0x00700000,
diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S
index b3a979467225..8866fd26c6b9 100644
--- a/arch/powerpc/kernel/entry_32.S
+++ b/arch/powerpc/kernel/entry_32.S
@@ -128,37 +128,36 @@ transfer_to_handler:
128 stw r12,4(r11) 128 stw r12,4(r11)
129#endif 129#endif
130 b 3f 130 b 3f
131
1312: /* if from kernel, check interrupted DOZE/NAP mode and 1322: /* if from kernel, check interrupted DOZE/NAP mode and
132 * check for stack overflow 133 * check for stack overflow
133 */ 134 */
135 lwz r9,THREAD_INFO-THREAD(r12)
136 cmplw r1,r9 /* if r1 <= current->thread_info */
137 ble- stack_ovf /* then the kernel stack overflowed */
1385:
134#ifdef CONFIG_6xx 139#ifdef CONFIG_6xx
135 mfspr r11,SPRN_HID0 140 tophys(r9,r9) /* check local flags */
136 mtcr r11 141 lwz r12,TI_LOCAL_FLAGS(r9)
137BEGIN_FTR_SECTION 142 mtcrf 0x01,r12
138 bt- 8,4f /* Check DOZE */ 143 bt- 31-TLF_NAPPING,4f
139END_FTR_SECTION_IFSET(CPU_FTR_CAN_DOZE)
140BEGIN_FTR_SECTION
141 bt- 9,4f /* Check NAP */
142END_FTR_SECTION_IFSET(CPU_FTR_CAN_NAP)
143#endif /* CONFIG_6xx */ 144#endif /* CONFIG_6xx */
144 .globl transfer_to_handler_cont 145 .globl transfer_to_handler_cont
145transfer_to_handler_cont: 146transfer_to_handler_cont:
146 lwz r11,THREAD_INFO-THREAD(r12)
147 cmplw r1,r11 /* if r1 <= current->thread_info */
148 ble- stack_ovf /* then the kernel stack overflowed */
1493: 1473:
150 mflr r9 148 mflr r9
151 lwz r11,0(r9) /* virtual address of handler */ 149 lwz r11,0(r9) /* virtual address of handler */
152 lwz r9,4(r9) /* where to go when done */ 150 lwz r9,4(r9) /* where to go when done */
153 FIX_SRR1(r10,r12)
154 mtspr SPRN_SRR0,r11 151 mtspr SPRN_SRR0,r11
155 mtspr SPRN_SRR1,r10 152 mtspr SPRN_SRR1,r10
156 mtlr r9 153 mtlr r9
157 SYNC 154 SYNC
158 RFI /* jump to handler, enable MMU */ 155 RFI /* jump to handler, enable MMU */
159 156
160#ifdef CONFIG_6xx 157#ifdef CONFIG_6xx
1614: b power_save_6xx_restore 1584: rlwinm r12,r12,0,~_TLF_NAPPING
159 stw r12,TI_LOCAL_FLAGS(r9)
160 b power_save_6xx_restore
162#endif 161#endif
163 162
164/* 163/*
@@ -167,10 +166,10 @@ transfer_to_handler_cont:
167 */ 166 */
168stack_ovf: 167stack_ovf:
169 /* sometimes we use a statically-allocated stack, which is OK. */ 168 /* sometimes we use a statically-allocated stack, which is OK. */
170 lis r11,_end@h 169 lis r12,_end@h
171 ori r11,r11,_end@l 170 ori r12,r12,_end@l
172 cmplw r1,r11 171 cmplw r1,r12
173 ble 3b /* r1 <= &_end is OK */ 172 ble 5b /* r1 <= &_end is OK */
174 SAVE_NVGPRS(r11) 173 SAVE_NVGPRS(r11)
175 addi r3,r1,STACK_FRAME_OVERHEAD 174 addi r3,r1,STACK_FRAME_OVERHEAD
176 lis r1,init_thread_union@ha 175 lis r1,init_thread_union@ha
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
index a5ae04a57c78..b7d140430a41 100644
--- a/arch/powerpc/kernel/head_64.S
+++ b/arch/powerpc/kernel/head_64.S
@@ -376,11 +376,28 @@ label##_common: \
376 bl hdlr; \ 376 bl hdlr; \
377 b .ret_from_except 377 b .ret_from_except
378 378
379/*
380 * Like STD_EXCEPTION_COMMON, but for exceptions that can occur
381 * in the idle task and therefore need the special idle handling.
382 */
383#define STD_EXCEPTION_COMMON_IDLE(trap, label, hdlr) \
384 .align 7; \
385 .globl label##_common; \
386label##_common: \
387 EXCEPTION_PROLOG_COMMON(trap, PACA_EXGEN); \
388 FINISH_NAP; \
389 DISABLE_INTS; \
390 bl .save_nvgprs; \
391 addi r3,r1,STACK_FRAME_OVERHEAD; \
392 bl hdlr; \
393 b .ret_from_except
394
379#define STD_EXCEPTION_COMMON_LITE(trap, label, hdlr) \ 395#define STD_EXCEPTION_COMMON_LITE(trap, label, hdlr) \
380 .align 7; \ 396 .align 7; \
381 .globl label##_common; \ 397 .globl label##_common; \
382label##_common: \ 398label##_common: \
383 EXCEPTION_PROLOG_COMMON(trap, PACA_EXGEN); \ 399 EXCEPTION_PROLOG_COMMON(trap, PACA_EXGEN); \
400 FINISH_NAP; \
384 DISABLE_INTS; \ 401 DISABLE_INTS; \
385 bl .ppc64_runlatch_on; \ 402 bl .ppc64_runlatch_on; \
386 addi r3,r1,STACK_FRAME_OVERHEAD; \ 403 addi r3,r1,STACK_FRAME_OVERHEAD; \
@@ -388,6 +405,25 @@ label##_common: \
388 b .ret_from_except_lite 405 b .ret_from_except_lite
389 406
390/* 407/*
408 * When the idle code in power4_idle puts the CPU into NAP mode,
409 * it has to do so in a loop, and relies on the external interrupt
410 * and decrementer interrupt entry code to get it out of the loop.
411 * It sets the _TLF_NAPPING bit in current_thread_info()->local_flags
412 * to signal that it is in the loop and needs help to get out.
413 */
414#ifdef CONFIG_PPC_970_NAP
415#define FINISH_NAP \
416BEGIN_FTR_SECTION \
417 clrrdi r11,r1,THREAD_SHIFT; \
418 ld r9,TI_LOCAL_FLAGS(r11); \
419 andi. r10,r9,_TLF_NAPPING; \
420 bnel power4_fixup_nap; \
421END_FTR_SECTION_IFSET(CPU_FTR_CAN_NAP)
422#else
423#define FINISH_NAP
424#endif
425
426/*
391 * Start of pSeries system interrupt routines 427 * Start of pSeries system interrupt routines
392 */ 428 */
393 . = 0x100 429 . = 0x100
@@ -772,6 +808,7 @@ hardware_interrupt_iSeries_masked:
772 .globl machine_check_common 808 .globl machine_check_common
773machine_check_common: 809machine_check_common:
774 EXCEPTION_PROLOG_COMMON(0x200, PACA_EXMC) 810 EXCEPTION_PROLOG_COMMON(0x200, PACA_EXMC)
811 FINISH_NAP
775 DISABLE_INTS 812 DISABLE_INTS
776 bl .save_nvgprs 813 bl .save_nvgprs
777 addi r3,r1,STACK_FRAME_OVERHEAD 814 addi r3,r1,STACK_FRAME_OVERHEAD
@@ -783,7 +820,7 @@ machine_check_common:
783 STD_EXCEPTION_COMMON(0xb00, trap_0b, .unknown_exception) 820 STD_EXCEPTION_COMMON(0xb00, trap_0b, .unknown_exception)
784 STD_EXCEPTION_COMMON(0xd00, single_step, .single_step_exception) 821 STD_EXCEPTION_COMMON(0xd00, single_step, .single_step_exception)
785 STD_EXCEPTION_COMMON(0xe00, trap_0e, .unknown_exception) 822 STD_EXCEPTION_COMMON(0xe00, trap_0e, .unknown_exception)
786 STD_EXCEPTION_COMMON(0xf00, performance_monitor, .performance_monitor_exception) 823 STD_EXCEPTION_COMMON_IDLE(0xf00, performance_monitor, .performance_monitor_exception)
787 STD_EXCEPTION_COMMON(0x1300, instruction_breakpoint, .instruction_breakpoint_exception) 824 STD_EXCEPTION_COMMON(0x1300, instruction_breakpoint, .instruction_breakpoint_exception)
788#ifdef CONFIG_ALTIVEC 825#ifdef CONFIG_ALTIVEC
789 STD_EXCEPTION_COMMON(0x1700, altivec_assist, .altivec_assist_exception) 826 STD_EXCEPTION_COMMON(0x1700, altivec_assist, .altivec_assist_exception)
@@ -1034,6 +1071,7 @@ unrecov_slb:
1034 .globl hardware_interrupt_entry 1071 .globl hardware_interrupt_entry
1035hardware_interrupt_common: 1072hardware_interrupt_common:
1036 EXCEPTION_PROLOG_COMMON(0x500, PACA_EXGEN) 1073 EXCEPTION_PROLOG_COMMON(0x500, PACA_EXGEN)
1074 FINISH_NAP
1037hardware_interrupt_entry: 1075hardware_interrupt_entry:
1038 DISABLE_INTS 1076 DISABLE_INTS
1039 bl .ppc64_runlatch_on 1077 bl .ppc64_runlatch_on
@@ -1041,6 +1079,15 @@ hardware_interrupt_entry:
1041 bl .do_IRQ 1079 bl .do_IRQ
1042 b .ret_from_except_lite 1080 b .ret_from_except_lite
1043 1081
1082#ifdef CONFIG_PPC_970_NAP
1083power4_fixup_nap:
1084 andc r9,r9,r10
1085 std r9,TI_LOCAL_FLAGS(r11)
1086 ld r10,_LINK(r1) /* make idle task do the */
1087 std r10,_NIP(r1) /* equivalent of a blr */
1088 blr
1089#endif
1090
1044 .align 7 1091 .align 7
1045 .globl alignment_common 1092 .globl alignment_common
1046alignment_common: 1093alignment_common:
diff --git a/arch/powerpc/kernel/idle.c b/arch/powerpc/kernel/idle.c
index e9f321d74d85..d491052c8e0c 100644
--- a/arch/powerpc/kernel/idle.c
+++ b/arch/powerpc/kernel/idle.c
@@ -50,9 +50,9 @@ void cpu_idle(void)
50 50
51 set_thread_flag(TIF_POLLING_NRFLAG); 51 set_thread_flag(TIF_POLLING_NRFLAG);
52 while (1) { 52 while (1) {
53 ppc64_runlatch_off();
54
55 while (!need_resched() && !cpu_should_die()) { 53 while (!need_resched() && !cpu_should_die()) {
54 ppc64_runlatch_off();
55
56 if (ppc_md.power_save) { 56 if (ppc_md.power_save) {
57 clear_thread_flag(TIF_POLLING_NRFLAG); 57 clear_thread_flag(TIF_POLLING_NRFLAG);
58 /* 58 /*
diff --git a/arch/powerpc/kernel/idle_6xx.S b/arch/powerpc/kernel/idle_6xx.S
index 12a4efbaa08f..b45fa0e37212 100644
--- a/arch/powerpc/kernel/idle_6xx.S
+++ b/arch/powerpc/kernel/idle_6xx.S
@@ -22,8 +22,6 @@
22#include <asm/ppc_asm.h> 22#include <asm/ppc_asm.h>
23#include <asm/asm-offsets.h> 23#include <asm/asm-offsets.h>
24 24
25#undef DEBUG
26
27 .text 25 .text
28 26
29/* 27/*
@@ -109,12 +107,6 @@ BEGIN_FTR_SECTION
109 dcbf 0,r4 107 dcbf 0,r4
110 dcbf 0,r4 108 dcbf 0,r4
111END_FTR_SECTION_IFSET(CPU_FTR_NAP_DISABLE_L2_PR) 109END_FTR_SECTION_IFSET(CPU_FTR_NAP_DISABLE_L2_PR)
112#ifdef DEBUG
113 lis r6,nap_enter_count@ha
114 lwz r4,nap_enter_count@l(r6)
115 addi r4,r4,1
116 stw r4,nap_enter_count@l(r6)
117#endif
1182: 1102:
119BEGIN_FTR_SECTION 111BEGIN_FTR_SECTION
120 /* Go to low speed mode on some 750FX */ 112 /* Go to low speed mode on some 750FX */
@@ -144,48 +136,42 @@ BEGIN_FTR_SECTION
144 DSSALL 136 DSSALL
145 sync 137 sync
146END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC) 138END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
139 rlwinm r9,r1,0,0,31-THREAD_SHIFT /* current thread_info */
140 lwz r8,TI_LOCAL_FLAGS(r9) /* set napping bit */
141 ori r8,r8,_TLF_NAPPING /* so when we take an exception */
142 stw r8,TI_LOCAL_FLAGS(r9) /* it will return to our caller */
147 mfmsr r7 143 mfmsr r7
148 ori r7,r7,MSR_EE 144 ori r7,r7,MSR_EE
149 oris r7,r7,MSR_POW@h 145 oris r7,r7,MSR_POW@h
150 sync 1461: sync
151 isync
152 mtmsr r7 147 mtmsr r7
153 isync 148 isync
154 sync 149 b 1b
155 blr 150
156
157/* 151/*
158 * Return from NAP/DOZE mode, restore some CPU specific registers, 152 * Return from NAP/DOZE mode, restore some CPU specific registers,
159 * we are called with DR/IR still off and r2 containing physical 153 * we are called with DR/IR still off and r2 containing physical
160 * address of current. 154 * address of current. R11 points to the exception frame (physical
155 * address). We have to preserve r10.
161 */ 156 */
162_GLOBAL(power_save_6xx_restore) 157_GLOBAL(power_save_6xx_restore)
163 mfspr r11,SPRN_HID0 158 lwz r9,_LINK(r11) /* interrupted in ppc6xx_idle: */
164 rlwinm. r11,r11,0,10,8 /* Clear NAP & copy NAP bit !state to cr1 EQ */ 159 stw r9,_NIP(r11) /* make it do a blr */
165 cror 4*cr1+eq,4*cr0+eq,4*cr0+eq
166BEGIN_FTR_SECTION
167 rlwinm r11,r11,0,9,7 /* Clear DOZE */
168END_FTR_SECTION_IFSET(CPU_FTR_CAN_DOZE)
169 mtspr SPRN_HID0, r11
170 160
171#ifdef DEBUG 161#ifdef CONFIG_SMP
172 beq cr1,1f 162 mfspr r12,SPRN_SPRG3
173 lis r11,(nap_return_count-KERNELBASE)@ha 163 lwz r11,TI_CPU(r12) /* get cpu number * 4 */
174 lwz r9,nap_return_count@l(r11)
175 addi r9,r9,1
176 stw r9,nap_return_count@l(r11)
1771:
178#endif
179
180 rlwinm r9,r1,0,0,18
181 tophys(r9,r9)
182 lwz r11,TI_CPU(r9)
183 slwi r11,r11,2 164 slwi r11,r11,2
165#else
166 li r11,0
167#endif
184 /* Todo make sure all these are in the same page 168 /* Todo make sure all these are in the same page
185 * and load r22 (@ha part + CPU offset) only once 169 * and load r11 (@ha part + CPU offset) only once
186 */ 170 */
187BEGIN_FTR_SECTION 171BEGIN_FTR_SECTION
188 beq cr1,1f 172 mfspr r9,SPRN_HID0
173 andis. r9,r9,HID0_NAP@h
174 beq 1f
189 addis r9,r11,(nap_save_msscr0-KERNELBASE)@ha 175 addis r9,r11,(nap_save_msscr0-KERNELBASE)@ha
190 lwz r9,nap_save_msscr0@l(r9) 176 lwz r9,nap_save_msscr0@l(r9)
191 mtspr SPRN_MSSCR0, r9 177 mtspr SPRN_MSSCR0, r9
@@ -210,10 +196,3 @@ _GLOBAL(nap_save_hid1)
210 196
211_GLOBAL(powersave_lowspeed) 197_GLOBAL(powersave_lowspeed)
212 .long 0 198 .long 0
213
214#ifdef DEBUG
215_GLOBAL(nap_enter_count)
216 .space 4
217_GLOBAL(nap_return_count)
218 .space 4
219#endif
diff --git a/arch/powerpc/kernel/idle_power4.S b/arch/powerpc/kernel/idle_power4.S
index 6dad1c02496e..d85c7c938eed 100644
--- a/arch/powerpc/kernel/idle_power4.S
+++ b/arch/powerpc/kernel/idle_power4.S
@@ -35,12 +35,16 @@ BEGIN_FTR_SECTION
35 DSSALL 35 DSSALL
36 sync 36 sync
37END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC) 37END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
38 clrrdi r9,r1,THREAD_SHIFT /* current thread_info */
39 ld r8,TI_LOCAL_FLAGS(r9) /* set napping bit */
40 ori r8,r8,_TLF_NAPPING /* so when we take an exception */
41 std r8,TI_LOCAL_FLAGS(r9) /* it will return to our caller */
38 mfmsr r7 42 mfmsr r7
39 ori r7,r7,MSR_EE 43 ori r7,r7,MSR_EE
40 oris r7,r7,MSR_POW@h 44 oris r7,r7,MSR_POW@h
41 sync 451: sync
42 isync 46 isync
43 mtmsrd r7 47 mtmsrd r7
44 isync 48 isync
45 sync 49 b 1b
46 blr 50
diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c
index d9a7fdef59b9..4eba60a32890 100644
--- a/arch/powerpc/kernel/iommu.c
+++ b/arch/powerpc/kernel/iommu.c
@@ -61,6 +61,7 @@ __setup("iommu=", setup_iommu);
61static unsigned long iommu_range_alloc(struct iommu_table *tbl, 61static unsigned long iommu_range_alloc(struct iommu_table *tbl,
62 unsigned long npages, 62 unsigned long npages,
63 unsigned long *handle, 63 unsigned long *handle,
64 unsigned long mask,
64 unsigned int align_order) 65 unsigned int align_order)
65{ 66{
66 unsigned long n, end, i, start; 67 unsigned long n, end, i, start;
@@ -97,9 +98,21 @@ static unsigned long iommu_range_alloc(struct iommu_table *tbl,
97 */ 98 */
98 if (start >= limit) 99 if (start >= limit)
99 start = largealloc ? tbl->it_largehint : tbl->it_hint; 100 start = largealloc ? tbl->it_largehint : tbl->it_hint;
100 101
101 again: 102 again:
102 103
104 if (limit + tbl->it_offset > mask) {
105 limit = mask - tbl->it_offset + 1;
106 /* If we're constrained on address range, first try
107 * at the masked hint to avoid O(n) search complexity,
108 * but on second pass, start at 0.
109 */
110 if ((start & mask) >= limit || pass > 0)
111 start = 0;
112 else
113 start &= mask;
114 }
115
103 n = find_next_zero_bit(tbl->it_map, limit, start); 116 n = find_next_zero_bit(tbl->it_map, limit, start);
104 117
105 /* Align allocation */ 118 /* Align allocation */
@@ -150,14 +163,14 @@ static unsigned long iommu_range_alloc(struct iommu_table *tbl,
150 163
151static dma_addr_t iommu_alloc(struct iommu_table *tbl, void *page, 164static dma_addr_t iommu_alloc(struct iommu_table *tbl, void *page,
152 unsigned int npages, enum dma_data_direction direction, 165 unsigned int npages, enum dma_data_direction direction,
153 unsigned int align_order) 166 unsigned long mask, unsigned int align_order)
154{ 167{
155 unsigned long entry, flags; 168 unsigned long entry, flags;
156 dma_addr_t ret = DMA_ERROR_CODE; 169 dma_addr_t ret = DMA_ERROR_CODE;
157 170
158 spin_lock_irqsave(&(tbl->it_lock), flags); 171 spin_lock_irqsave(&(tbl->it_lock), flags);
159 172
160 entry = iommu_range_alloc(tbl, npages, NULL, align_order); 173 entry = iommu_range_alloc(tbl, npages, NULL, mask, align_order);
161 174
162 if (unlikely(entry == DMA_ERROR_CODE)) { 175 if (unlikely(entry == DMA_ERROR_CODE)) {
163 spin_unlock_irqrestore(&(tbl->it_lock), flags); 176 spin_unlock_irqrestore(&(tbl->it_lock), flags);
@@ -236,7 +249,7 @@ static void iommu_free(struct iommu_table *tbl, dma_addr_t dma_addr,
236 249
237int iommu_map_sg(struct device *dev, struct iommu_table *tbl, 250int iommu_map_sg(struct device *dev, struct iommu_table *tbl,
238 struct scatterlist *sglist, int nelems, 251 struct scatterlist *sglist, int nelems,
239 enum dma_data_direction direction) 252 unsigned long mask, enum dma_data_direction direction)
240{ 253{
241 dma_addr_t dma_next = 0, dma_addr; 254 dma_addr_t dma_next = 0, dma_addr;
242 unsigned long flags; 255 unsigned long flags;
@@ -274,7 +287,7 @@ int iommu_map_sg(struct device *dev, struct iommu_table *tbl,
274 vaddr = (unsigned long)page_address(s->page) + s->offset; 287 vaddr = (unsigned long)page_address(s->page) + s->offset;
275 npages = PAGE_ALIGN(vaddr + slen) - (vaddr & PAGE_MASK); 288 npages = PAGE_ALIGN(vaddr + slen) - (vaddr & PAGE_MASK);
276 npages >>= PAGE_SHIFT; 289 npages >>= PAGE_SHIFT;
277 entry = iommu_range_alloc(tbl, npages, &handle, 0); 290 entry = iommu_range_alloc(tbl, npages, &handle, mask >> PAGE_SHIFT, 0);
278 291
279 DBG(" - vaddr: %lx, size: %lx\n", vaddr, slen); 292 DBG(" - vaddr: %lx, size: %lx\n", vaddr, slen);
280 293
@@ -479,7 +492,8 @@ void iommu_free_table(struct device_node *dn)
479 * byte within the page as vaddr. 492 * byte within the page as vaddr.
480 */ 493 */
481dma_addr_t iommu_map_single(struct iommu_table *tbl, void *vaddr, 494dma_addr_t iommu_map_single(struct iommu_table *tbl, void *vaddr,
482 size_t size, enum dma_data_direction direction) 495 size_t size, unsigned long mask,
496 enum dma_data_direction direction)
483{ 497{
484 dma_addr_t dma_handle = DMA_ERROR_CODE; 498 dma_addr_t dma_handle = DMA_ERROR_CODE;
485 unsigned long uaddr; 499 unsigned long uaddr;
@@ -492,7 +506,8 @@ dma_addr_t iommu_map_single(struct iommu_table *tbl, void *vaddr,
492 npages >>= PAGE_SHIFT; 506 npages >>= PAGE_SHIFT;
493 507
494 if (tbl) { 508 if (tbl) {
495 dma_handle = iommu_alloc(tbl, vaddr, npages, direction, 0); 509 dma_handle = iommu_alloc(tbl, vaddr, npages, direction,
510 mask >> PAGE_SHIFT, 0);
496 if (dma_handle == DMA_ERROR_CODE) { 511 if (dma_handle == DMA_ERROR_CODE) {
497 if (printk_ratelimit()) { 512 if (printk_ratelimit()) {
498 printk(KERN_INFO "iommu_alloc failed, " 513 printk(KERN_INFO "iommu_alloc failed, "
@@ -521,7 +536,7 @@ void iommu_unmap_single(struct iommu_table *tbl, dma_addr_t dma_handle,
521 * to the dma address (mapping) of the first page. 536 * to the dma address (mapping) of the first page.
522 */ 537 */
523void *iommu_alloc_coherent(struct iommu_table *tbl, size_t size, 538void *iommu_alloc_coherent(struct iommu_table *tbl, size_t size,
524 dma_addr_t *dma_handle, gfp_t flag) 539 dma_addr_t *dma_handle, unsigned long mask, gfp_t flag)
525{ 540{
526 void *ret = NULL; 541 void *ret = NULL;
527 dma_addr_t mapping; 542 dma_addr_t mapping;
@@ -551,7 +566,8 @@ void *iommu_alloc_coherent(struct iommu_table *tbl, size_t size,
551 memset(ret, 0, size); 566 memset(ret, 0, size);
552 567
553 /* Set up tces to cover the allocated range */ 568 /* Set up tces to cover the allocated range */
554 mapping = iommu_alloc(tbl, ret, npages, DMA_BIDIRECTIONAL, order); 569 mapping = iommu_alloc(tbl, ret, npages, DMA_BIDIRECTIONAL,
570 mask >> PAGE_SHIFT, order);
555 if (mapping == DMA_ERROR_CODE) { 571 if (mapping == DMA_ERROR_CODE) {
556 free_pages((unsigned long)ret, order); 572 free_pages((unsigned long)ret, order);
557 ret = NULL; 573 ret = NULL;
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index bb5c9501234c..57d560c68897 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -272,18 +272,26 @@ unsigned int virt_irq_to_real_map[NR_IRQS];
272 * Don't use virtual irqs 0, 1, 2 for devices. 272 * Don't use virtual irqs 0, 1, 2 for devices.
273 * The pcnet32 driver considers interrupt numbers < 2 to be invalid, 273 * The pcnet32 driver considers interrupt numbers < 2 to be invalid,
274 * and 2 is the XICS IPI interrupt. 274 * and 2 is the XICS IPI interrupt.
275 * We limit virtual irqs to 17 less than NR_IRQS so that when we 275 * We limit virtual irqs to __irq_offet_value less than virt_irq_max so
276 * offset them by 16 (to reserve the first 16 for ISA interrupts) 276 * that when we offset them we don't end up with an interrupt
277 * we don't end up with an interrupt number >= NR_IRQS. 277 * number >= virt_irq_max.
278 */ 278 */
279#define MIN_VIRT_IRQ 3 279#define MIN_VIRT_IRQ 3
280#define MAX_VIRT_IRQ (NR_IRQS - NUM_ISA_INTERRUPTS - 1) 280
281#define NR_VIRT_IRQS (MAX_VIRT_IRQ - MIN_VIRT_IRQ + 1) 281unsigned int virt_irq_max;
282static unsigned int max_virt_irq;
283static unsigned int nr_virt_irqs;
282 284
283void 285void
284virt_irq_init(void) 286virt_irq_init(void)
285{ 287{
286 int i; 288 int i;
289
290 if ((virt_irq_max == 0) || (virt_irq_max > (NR_IRQS - 1)))
291 virt_irq_max = NR_IRQS - 1;
292 max_virt_irq = virt_irq_max - __irq_offset_value;
293 nr_virt_irqs = max_virt_irq - MIN_VIRT_IRQ + 1;
294
287 for (i = 0; i < NR_IRQS; i++) 295 for (i = 0; i < NR_IRQS; i++)
288 virt_irq_to_real_map[i] = UNDEFINED_IRQ; 296 virt_irq_to_real_map[i] = UNDEFINED_IRQ;
289} 297}
@@ -308,17 +316,17 @@ int virt_irq_create_mapping(unsigned int real_irq)
308 return real_irq; 316 return real_irq;
309 } 317 }
310 318
311 /* map to a number between MIN_VIRT_IRQ and MAX_VIRT_IRQ */ 319 /* map to a number between MIN_VIRT_IRQ and max_virt_irq */
312 virq = real_irq; 320 virq = real_irq;
313 if (virq > MAX_VIRT_IRQ) 321 if (virq > max_virt_irq)
314 virq = (virq % NR_VIRT_IRQS) + MIN_VIRT_IRQ; 322 virq = (virq % nr_virt_irqs) + MIN_VIRT_IRQ;
315 323
316 /* search for this number or a free slot */ 324 /* search for this number or a free slot */
317 first_virq = virq; 325 first_virq = virq;
318 while (virt_irq_to_real_map[virq] != UNDEFINED_IRQ) { 326 while (virt_irq_to_real_map[virq] != UNDEFINED_IRQ) {
319 if (virt_irq_to_real_map[virq] == real_irq) 327 if (virt_irq_to_real_map[virq] == real_irq)
320 return virq; 328 return virq;
321 if (++virq > MAX_VIRT_IRQ) 329 if (++virq > max_virt_irq)
322 virq = MIN_VIRT_IRQ; 330 virq = MIN_VIRT_IRQ;
323 if (virq == first_virq) 331 if (virq == first_virq)
324 goto nospace; /* oops, no free slots */ 332 goto nospace; /* oops, no free slots */
@@ -330,8 +338,8 @@ int virt_irq_create_mapping(unsigned int real_irq)
330 nospace: 338 nospace:
331 if (!warned) { 339 if (!warned) {
332 printk(KERN_CRIT "Interrupt table is full\n"); 340 printk(KERN_CRIT "Interrupt table is full\n");
333 printk(KERN_CRIT "Increase NR_IRQS (currently %d) " 341 printk(KERN_CRIT "Increase virt_irq_max (currently %d) "
334 "in your kernel sources and rebuild.\n", NR_IRQS); 342 "in your kernel sources and rebuild.\n", virt_irq_max);
335 warned = 1; 343 warned = 1;
336 } 344 }
337 return NO_IRQ; 345 return NO_IRQ;
@@ -349,8 +357,8 @@ unsigned int real_irq_to_virt_slowpath(unsigned int real_irq)
349 357
350 virq = real_irq; 358 virq = real_irq;
351 359
352 if (virq > MAX_VIRT_IRQ) 360 if (virq > max_virt_irq)
353 virq = (virq % NR_VIRT_IRQS) + MIN_VIRT_IRQ; 361 virq = (virq % nr_virt_irqs) + MIN_VIRT_IRQ;
354 362
355 first_virq = virq; 363 first_virq = virq;
356 364
@@ -360,7 +368,7 @@ unsigned int real_irq_to_virt_slowpath(unsigned int real_irq)
360 368
361 virq++; 369 virq++;
362 370
363 if (virq >= MAX_VIRT_IRQ) 371 if (virq >= max_virt_irq)
364 virq = 0; 372 virq = 0;
365 373
366 } while (first_virq != virq); 374 } while (first_virq != virq);
diff --git a/arch/powerpc/kernel/kprobes.c b/arch/powerpc/kernel/kprobes.c
index ad7a90212204..f78866367b70 100644
--- a/arch/powerpc/kernel/kprobes.c
+++ b/arch/powerpc/kernel/kprobes.c
@@ -88,34 +88,34 @@ void __kprobes arch_remove_kprobe(struct kprobe *p)
88 mutex_unlock(&kprobe_mutex); 88 mutex_unlock(&kprobe_mutex);
89} 89}
90 90
91static inline void prepare_singlestep(struct kprobe *p, struct pt_regs *regs) 91static void __kprobes prepare_singlestep(struct kprobe *p, struct pt_regs *regs)
92{ 92{
93 kprobe_opcode_t insn = *p->ainsn.insn;
94
95 regs->msr |= MSR_SE; 93 regs->msr |= MSR_SE;
96 94
97 /* single step inline if it is a trap variant */ 95 /*
98 if (is_trap(insn)) 96 * On powerpc we should single step on the original
99 regs->nip = (unsigned long)p->addr; 97 * instruction even if the probed insn is a trap
100 else 98 * variant as values in regs could play a part in
101 regs->nip = (unsigned long)p->ainsn.insn; 99 * if the trap is taken or not
100 */
101 regs->nip = (unsigned long)p->ainsn.insn;
102} 102}
103 103
104static inline void save_previous_kprobe(struct kprobe_ctlblk *kcb) 104static void __kprobes save_previous_kprobe(struct kprobe_ctlblk *kcb)
105{ 105{
106 kcb->prev_kprobe.kp = kprobe_running(); 106 kcb->prev_kprobe.kp = kprobe_running();
107 kcb->prev_kprobe.status = kcb->kprobe_status; 107 kcb->prev_kprobe.status = kcb->kprobe_status;
108 kcb->prev_kprobe.saved_msr = kcb->kprobe_saved_msr; 108 kcb->prev_kprobe.saved_msr = kcb->kprobe_saved_msr;
109} 109}
110 110
111static inline void restore_previous_kprobe(struct kprobe_ctlblk *kcb) 111static void __kprobes restore_previous_kprobe(struct kprobe_ctlblk *kcb)
112{ 112{
113 __get_cpu_var(current_kprobe) = kcb->prev_kprobe.kp; 113 __get_cpu_var(current_kprobe) = kcb->prev_kprobe.kp;
114 kcb->kprobe_status = kcb->prev_kprobe.status; 114 kcb->kprobe_status = kcb->prev_kprobe.status;
115 kcb->kprobe_saved_msr = kcb->prev_kprobe.saved_msr; 115 kcb->kprobe_saved_msr = kcb->prev_kprobe.saved_msr;
116} 116}
117 117
118static inline void set_current_kprobe(struct kprobe *p, struct pt_regs *regs, 118static void __kprobes set_current_kprobe(struct kprobe *p, struct pt_regs *regs,
119 struct kprobe_ctlblk *kcb) 119 struct kprobe_ctlblk *kcb)
120{ 120{
121 __get_cpu_var(current_kprobe) = p; 121 __get_cpu_var(current_kprobe) = p;
@@ -141,7 +141,7 @@ void __kprobes arch_prepare_kretprobe(struct kretprobe *rp,
141 } 141 }
142} 142}
143 143
144static inline int kprobe_handler(struct pt_regs *regs) 144static int __kprobes kprobe_handler(struct pt_regs *regs)
145{ 145{
146 struct kprobe *p; 146 struct kprobe *p;
147 int ret = 0; 147 int ret = 0;
@@ -334,7 +334,7 @@ static void __kprobes resume_execution(struct kprobe *p, struct pt_regs *regs)
334 regs->nip = (unsigned long)p->addr + 4; 334 regs->nip = (unsigned long)p->addr + 4;
335} 335}
336 336
337static inline int post_kprobe_handler(struct pt_regs *regs) 337static int __kprobes post_kprobe_handler(struct pt_regs *regs)
338{ 338{
339 struct kprobe *cur = kprobe_running(); 339 struct kprobe *cur = kprobe_running();
340 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); 340 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
@@ -370,7 +370,7 @@ out:
370 return 1; 370 return 1;
371} 371}
372 372
373static inline int kprobe_fault_handler(struct pt_regs *regs, int trapnr) 373static int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr)
374{ 374{
375 struct kprobe *cur = kprobe_running(); 375 struct kprobe *cur = kprobe_running();
376 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); 376 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
diff --git a/arch/powerpc/kernel/module_64.c b/arch/powerpc/kernel/module_64.c
index 928b8581fcb0..ba34001fca8e 100644
--- a/arch/powerpc/kernel/module_64.c
+++ b/arch/powerpc/kernel/module_64.c
@@ -191,11 +191,19 @@ int module_frob_arch_sections(Elf64_Ehdr *hdr,
191 (void *)hdr 191 (void *)hdr
192 + sechdrs[sechdrs[i].sh_link].sh_offset); 192 + sechdrs[sechdrs[i].sh_link].sh_offset);
193 } 193 }
194 if (!me->arch.stubs_section || !me->arch.toc_section) { 194
195 printk("%s: doesn't contain .toc or .stubs.\n", me->name); 195 if (!me->arch.stubs_section) {
196 printk("%s: doesn't contain .stubs.\n", me->name);
196 return -ENOEXEC; 197 return -ENOEXEC;
197 } 198 }
198 199
200 /* If we don't have a .toc, just use .stubs. We need to set r2
201 to some reasonable value in case the module calls out to
202 other functions via a stub, or if a function pointer escapes
203 the module by some means. */
204 if (!me->arch.toc_section)
205 me->arch.toc_section = me->arch.stubs_section;
206
199 /* Override the stubs size */ 207 /* Override the stubs size */
200 sechdrs[me->arch.stubs_section].sh_size = get_stubs_size(hdr, sechdrs); 208 sechdrs[me->arch.stubs_section].sh_size = get_stubs_size(hdr, sechdrs);
201 return 0; 209 return 0;
@@ -342,7 +350,7 @@ int apply_relocate_add(Elf64_Shdr *sechdrs,
342 break; 350 break;
343 351
344 case R_PPC64_TOC16: 352 case R_PPC64_TOC16:
345 /* Subtact TOC pointer */ 353 /* Subtract TOC pointer */
346 value -= my_r2(sechdrs, me); 354 value -= my_r2(sechdrs, me);
347 if (value + 0x8000 > 0xffff) { 355 if (value + 0x8000 > 0xffff) {
348 printk("%s: bad TOC16 relocation (%lu)\n", 356 printk("%s: bad TOC16 relocation (%lu)\n",
@@ -355,7 +363,7 @@ int apply_relocate_add(Elf64_Shdr *sechdrs,
355 break; 363 break;
356 364
357 case R_PPC64_TOC16_DS: 365 case R_PPC64_TOC16_DS:
358 /* Subtact TOC pointer */ 366 /* Subtract TOC pointer */
359 value -= my_r2(sechdrs, me); 367 value -= my_r2(sechdrs, me);
360 if ((value & 3) != 0 || value + 0x8000 > 0xffff) { 368 if ((value & 3) != 0 || value + 0x8000 > 0xffff) {
361 printk("%s: bad TOC16_DS relocation (%lu)\n", 369 printk("%s: bad TOC16_DS relocation (%lu)\n",
diff --git a/arch/powerpc/kernel/pci_iommu.c b/arch/powerpc/kernel/pci_iommu.c
index c336f3e31cff..c1d95e14bbed 100644
--- a/arch/powerpc/kernel/pci_iommu.c
+++ b/arch/powerpc/kernel/pci_iommu.c
@@ -59,6 +59,25 @@ static inline struct iommu_table *devnode_table(struct device *dev)
59} 59}
60 60
61 61
62static inline unsigned long device_to_mask(struct device *hwdev)
63{
64 struct pci_dev *pdev;
65
66 if (!hwdev) {
67 pdev = ppc64_isabridge_dev;
68 if (!pdev) /* This is the best guess we can do */
69 return 0xfffffffful;
70 } else
71 pdev = to_pci_dev(hwdev);
72
73 if (pdev->dma_mask)
74 return pdev->dma_mask;
75
76 /* Assume devices without mask can take 32 bit addresses */
77 return 0xfffffffful;
78}
79
80
62/* Allocates a contiguous real buffer and creates mappings over it. 81/* Allocates a contiguous real buffer and creates mappings over it.
63 * Returns the virtual address of the buffer and sets dma_handle 82 * Returns the virtual address of the buffer and sets dma_handle
64 * to the dma address (mapping) of the first page. 83 * to the dma address (mapping) of the first page.
@@ -67,7 +86,7 @@ static void *pci_iommu_alloc_coherent(struct device *hwdev, size_t size,
67 dma_addr_t *dma_handle, gfp_t flag) 86 dma_addr_t *dma_handle, gfp_t flag)
68{ 87{
69 return iommu_alloc_coherent(devnode_table(hwdev), size, dma_handle, 88 return iommu_alloc_coherent(devnode_table(hwdev), size, dma_handle,
70 flag); 89 device_to_mask(hwdev), flag);
71} 90}
72 91
73static void pci_iommu_free_coherent(struct device *hwdev, size_t size, 92static void pci_iommu_free_coherent(struct device *hwdev, size_t size,
@@ -85,7 +104,8 @@ static void pci_iommu_free_coherent(struct device *hwdev, size_t size,
85static dma_addr_t pci_iommu_map_single(struct device *hwdev, void *vaddr, 104static dma_addr_t pci_iommu_map_single(struct device *hwdev, void *vaddr,
86 size_t size, enum dma_data_direction direction) 105 size_t size, enum dma_data_direction direction)
87{ 106{
88 return iommu_map_single(devnode_table(hwdev), vaddr, size, direction); 107 return iommu_map_single(devnode_table(hwdev), vaddr, size,
108 device_to_mask(hwdev), direction);
89} 109}
90 110
91 111
@@ -100,7 +120,7 @@ static int pci_iommu_map_sg(struct device *pdev, struct scatterlist *sglist,
100 int nelems, enum dma_data_direction direction) 120 int nelems, enum dma_data_direction direction)
101{ 121{
102 return iommu_map_sg(pdev, devnode_table(pdev), sglist, 122 return iommu_map_sg(pdev, devnode_table(pdev), sglist,
103 nelems, direction); 123 nelems, device_to_mask(pdev), direction);
104} 124}
105 125
106static void pci_iommu_unmap_sg(struct device *pdev, struct scatterlist *sglist, 126static void pci_iommu_unmap_sg(struct device *pdev, struct scatterlist *sglist,
@@ -112,7 +132,19 @@ static void pci_iommu_unmap_sg(struct device *pdev, struct scatterlist *sglist,
112/* We support DMA to/from any memory page via the iommu */ 132/* We support DMA to/from any memory page via the iommu */
113static int pci_iommu_dma_supported(struct device *dev, u64 mask) 133static int pci_iommu_dma_supported(struct device *dev, u64 mask)
114{ 134{
115 return 1; 135 struct iommu_table *tbl = devnode_table(dev);
136
137 if (!tbl || tbl->it_offset > mask) {
138 printk(KERN_INFO "Warning: IOMMU table offset too big for device mask\n");
139 if (tbl)
140 printk(KERN_INFO "mask: 0x%08lx, table offset: 0x%08lx\n",
141 mask, tbl->it_offset);
142 else
143 printk(KERN_INFO "mask: 0x%08lx, table unavailable\n",
144 mask);
145 return 0;
146 } else
147 return 1;
116} 148}
117 149
118void pci_iommu_init(void) 150void pci_iommu_init(void)
diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c
index dfa5398ab3c8..4b052ae5dc34 100644
--- a/arch/powerpc/kernel/ppc_ksyms.c
+++ b/arch/powerpc/kernel/ppc_ksyms.c
@@ -81,6 +81,7 @@ EXPORT_SYMBOL(strcat);
81EXPORT_SYMBOL(strlen); 81EXPORT_SYMBOL(strlen);
82EXPORT_SYMBOL(strcmp); 82EXPORT_SYMBOL(strcmp);
83EXPORT_SYMBOL(strcasecmp); 83EXPORT_SYMBOL(strcasecmp);
84EXPORT_SYMBOL(strncasecmp);
84 85
85EXPORT_SYMBOL(csum_partial); 86EXPORT_SYMBOL(csum_partial);
86EXPORT_SYMBOL(csum_partial_copy_generic); 87EXPORT_SYMBOL(csum_partial_copy_generic);
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 4336390bcf34..9a07f97f0712 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -62,7 +62,7 @@ static int __initdata dt_root_addr_cells;
62static int __initdata dt_root_size_cells; 62static int __initdata dt_root_size_cells;
63 63
64#ifdef CONFIG_PPC64 64#ifdef CONFIG_PPC64
65static int __initdata iommu_is_off; 65int __initdata iommu_is_off;
66int __initdata iommu_force_on; 66int __initdata iommu_force_on;
67unsigned long tce_alloc_start, tce_alloc_end; 67unsigned long tce_alloc_start, tce_alloc_end;
68#endif 68#endif
@@ -885,6 +885,74 @@ void __init unflatten_device_tree(void)
885 DBG(" <- unflatten_device_tree()\n"); 885 DBG(" <- unflatten_device_tree()\n");
886} 886}
887 887
888/*
889 * ibm,pa-features is a per-cpu property that contains a string of
890 * attribute descriptors, each of which has a 2 byte header plus up
891 * to 254 bytes worth of processor attribute bits. First header
892 * byte specifies the number of bytes following the header.
893 * Second header byte is an "attribute-specifier" type, of which
894 * zero is the only currently-defined value.
895 * Implementation: Pass in the byte and bit offset for the feature
896 * that we are interested in. The function will return -1 if the
897 * pa-features property is missing, or a 1/0 to indicate if the feature
898 * is supported/not supported. Note that the bit numbers are
899 * big-endian to match the definition in PAPR.
900 */
901static struct ibm_pa_feature {
902 unsigned long cpu_features; /* CPU_FTR_xxx bit */
903 unsigned int cpu_user_ftrs; /* PPC_FEATURE_xxx bit */
904 unsigned char pabyte; /* byte number in ibm,pa-features */
905 unsigned char pabit; /* bit number (big-endian) */
906 unsigned char invert; /* if 1, pa bit set => clear feature */
907} ibm_pa_features[] __initdata = {
908 {0, PPC_FEATURE_HAS_MMU, 0, 0, 0},
909 {0, PPC_FEATURE_HAS_FPU, 0, 1, 0},
910 {CPU_FTR_SLB, 0, 0, 2, 0},
911 {CPU_FTR_CTRL, 0, 0, 3, 0},
912 {CPU_FTR_NOEXECUTE, 0, 0, 6, 0},
913 {CPU_FTR_NODSISRALIGN, 0, 1, 1, 1},
914 {CPU_FTR_CI_LARGE_PAGE, 0, 1, 2, 0},
915};
916
917static void __init check_cpu_pa_features(unsigned long node)
918{
919 unsigned char *pa_ftrs;
920 unsigned long len, tablelen, i, bit;
921
922 pa_ftrs = of_get_flat_dt_prop(node, "ibm,pa-features", &tablelen);
923 if (pa_ftrs == NULL)
924 return;
925
926 /* find descriptor with type == 0 */
927 for (;;) {
928 if (tablelen < 3)
929 return;
930 len = 2 + pa_ftrs[0];
931 if (tablelen < len)
932 return; /* descriptor 0 not found */
933 if (pa_ftrs[1] == 0)
934 break;
935 tablelen -= len;
936 pa_ftrs += len;
937 }
938
939 /* loop over bits we know about */
940 for (i = 0; i < ARRAY_SIZE(ibm_pa_features); ++i) {
941 struct ibm_pa_feature *fp = &ibm_pa_features[i];
942
943 if (fp->pabyte >= pa_ftrs[0])
944 continue;
945 bit = (pa_ftrs[2 + fp->pabyte] >> (7 - fp->pabit)) & 1;
946 if (bit ^ fp->invert) {
947 cur_cpu_spec->cpu_features |= fp->cpu_features;
948 cur_cpu_spec->cpu_user_features |= fp->cpu_user_ftrs;
949 } else {
950 cur_cpu_spec->cpu_features &= ~fp->cpu_features;
951 cur_cpu_spec->cpu_user_features &= ~fp->cpu_user_ftrs;
952 }
953 }
954}
955
888static int __init early_init_dt_scan_cpus(unsigned long node, 956static int __init early_init_dt_scan_cpus(unsigned long node,
889 const char *uname, int depth, 957 const char *uname, int depth,
890 void *data) 958 void *data)
@@ -969,6 +1037,8 @@ static int __init early_init_dt_scan_cpus(unsigned long node,
969 } 1037 }
970#endif /* CONFIG_ALTIVEC */ 1038#endif /* CONFIG_ALTIVEC */
971 1039
1040 check_cpu_pa_features(node);
1041
972#ifdef CONFIG_PPC_PSERIES 1042#ifdef CONFIG_PPC_PSERIES
973 if (nthreads > 1) 1043 if (nthreads > 1)
974 cur_cpu_spec->cpu_features |= CPU_FTR_SMT; 1044 cur_cpu_spec->cpu_features |= CPU_FTR_SMT;
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index d66c5e77fcff..41e9ab40cd54 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -636,10 +636,96 @@ static void __init early_cmdline_parse(void)
636 636
637#ifdef CONFIG_PPC_PSERIES 637#ifdef CONFIG_PPC_PSERIES
638/* 638/*
639 * To tell the firmware what our capabilities are, we have to pass 639 * There are two methods for telling firmware what our capabilities are.
640 * it a fake 32-bit ELF header containing a couple of PT_NOTE sections 640 * Newer machines have an "ibm,client-architecture-support" method on the
641 * that contain structures that contain the actual values. 641 * root node. For older machines, we have to call the "process-elf-header"
642 * method in the /packages/elf-loader node, passing it a fake 32-bit
643 * ELF header containing a couple of PT_NOTE sections that contain
644 * structures that contain various information.
642 */ 645 */
646
647/*
648 * New method - extensible architecture description vector.
649 *
650 * Because the description vector contains a mix of byte and word
651 * values, we declare it as an unsigned char array, and use this
652 * macro to put word values in.
653 */
654#define W(x) ((x) >> 24) & 0xff, ((x) >> 16) & 0xff, \
655 ((x) >> 8) & 0xff, (x) & 0xff
656
657/* Option vector bits - generic bits in byte 1 */
658#define OV_IGNORE 0x80 /* ignore this vector */
659#define OV_CESSATION_POLICY 0x40 /* halt if unsupported option present*/
660
661/* Option vector 1: processor architectures supported */
662#define OV1_PPC_2_00 0x80 /* set if we support PowerPC 2.00 */
663#define OV1_PPC_2_01 0x40 /* set if we support PowerPC 2.01 */
664#define OV1_PPC_2_02 0x20 /* set if we support PowerPC 2.02 */
665#define OV1_PPC_2_03 0x10 /* set if we support PowerPC 2.03 */
666#define OV1_PPC_2_04 0x08 /* set if we support PowerPC 2.04 */
667#define OV1_PPC_2_05 0x04 /* set if we support PowerPC 2.05 */
668
669/* Option vector 2: Open Firmware options supported */
670#define OV2_REAL_MODE 0x20 /* set if we want OF in real mode */
671
672/* Option vector 3: processor options supported */
673#define OV3_FP 0x80 /* floating point */
674#define OV3_VMX 0x40 /* VMX/Altivec */
675
676/* Option vector 5: PAPR/OF options supported */
677#define OV5_LPAR 0x80 /* logical partitioning supported */
678#define OV5_SPLPAR 0x40 /* shared-processor LPAR supported */
679/* ibm,dynamic-reconfiguration-memory property supported */
680#define OV5_DRCONF_MEMORY 0x20
681#define OV5_LARGE_PAGES 0x10 /* large pages supported */
682
683/*
684 * The architecture vector has an array of PVR mask/value pairs,
685 * followed by # option vectors - 1, followed by the option vectors.
686 */
687static unsigned char ibm_architecture_vec[] = {
688 W(0xfffe0000), W(0x003a0000), /* POWER5/POWER5+ */
689 W(0xffff0000), W(0x003e0000), /* POWER6 */
690 W(0xfffffffe), W(0x0f000001), /* all 2.04-compliant and earlier */
691 5 - 1, /* 5 option vectors */
692
693 /* option vector 1: processor architectures supported */
694 3 - 1, /* length */
695 0, /* don't ignore, don't halt */
696 OV1_PPC_2_00 | OV1_PPC_2_01 | OV1_PPC_2_02 | OV1_PPC_2_03 |
697 OV1_PPC_2_04 | OV1_PPC_2_05,
698
699 /* option vector 2: Open Firmware options supported */
700 34 - 1, /* length */
701 OV2_REAL_MODE,
702 0, 0,
703 W(0xffffffff), /* real_base */
704 W(0xffffffff), /* real_size */
705 W(0xffffffff), /* virt_base */
706 W(0xffffffff), /* virt_size */
707 W(0xffffffff), /* load_base */
708 W(64), /* 128MB min RMA */
709 W(0xffffffff), /* full client load */
710 0, /* min RMA percentage of total RAM */
711 48, /* max log_2(hash table size) */
712
713 /* option vector 3: processor options supported */
714 3 - 1, /* length */
715 0, /* don't ignore, don't halt */
716 OV3_FP | OV3_VMX,
717
718 /* option vector 4: IBM PAPR implementation */
719 2 - 1, /* length */
720 0, /* don't halt */
721
722 /* option vector 5: PAPR/OF options */
723 3 - 1, /* length */
724 0, /* don't ignore, don't halt */
725 OV5_LPAR | OV5_SPLPAR | OV5_LARGE_PAGES,
726};
727
728/* Old method - ELF header with PT_NOTE sections */
643static struct fake_elf { 729static struct fake_elf {
644 Elf32_Ehdr elfhdr; 730 Elf32_Ehdr elfhdr;
645 Elf32_Phdr phdr[2]; 731 Elf32_Phdr phdr[2];
@@ -728,8 +814,26 @@ static struct fake_elf {
728 814
729static void __init prom_send_capabilities(void) 815static void __init prom_send_capabilities(void)
730{ 816{
731 ihandle elfloader; 817 ihandle elfloader, root;
818 prom_arg_t ret;
819
820 root = call_prom("open", 1, 1, ADDR("/"));
821 if (root != 0) {
822 /* try calling the ibm,client-architecture-support method */
823 if (call_prom_ret("call-method", 3, 2, &ret,
824 ADDR("ibm,client-architecture-support"),
825 ADDR(ibm_architecture_vec)) == 0) {
826 /* the call exists... */
827 if (ret)
828 prom_printf("WARNING: ibm,client-architecture"
829 "-support call FAILED!\n");
830 call_prom("close", 1, 0, root);
831 return;
832 }
833 call_prom("close", 1, 0, root);
834 }
732 835
836 /* no ibm,client-architecture-support call, try the old way */
733 elfloader = call_prom("open", 1, 1, ADDR("/packages/elf-loader")); 837 elfloader = call_prom("open", 1, 1, ADDR("/packages/elf-loader"));
734 if (elfloader == 0) { 838 if (elfloader == 0) {
735 prom_printf("couldn't open /packages/elf-loader\n"); 839 prom_printf("couldn't open /packages/elf-loader\n");
@@ -1528,12 +1632,11 @@ static int __init prom_find_machine_type(void)
1528 * non-IBM designs ! 1632 * non-IBM designs !
1529 * - it has /rtas 1633 * - it has /rtas
1530 */ 1634 */
1531 len = prom_getprop(_prom->root, "model", 1635 len = prom_getprop(_prom->root, "device_type",
1532 compat, sizeof(compat)-1); 1636 compat, sizeof(compat)-1);
1533 if (len <= 0) 1637 if (len <= 0)
1534 return PLATFORM_GENERIC; 1638 return PLATFORM_GENERIC;
1535 compat[len] = 0; 1639 if (strcmp(compat, RELOC("chrp")))
1536 if (strcmp(compat, "chrp"))
1537 return PLATFORM_GENERIC; 1640 return PLATFORM_GENERIC;
1538 1641
1539 /* Default to pSeries. We need to know if we are running LPAR */ 1642 /* Default to pSeries. We need to know if we are running LPAR */
@@ -1954,10 +2057,45 @@ static void __init flatten_device_tree(void)
1954 2057
1955} 2058}
1956 2059
1957 2060#ifdef CONFIG_PPC_MAPLE
1958static void __init fixup_device_tree(void) 2061/* PIBS Version 1.05.0000 04/26/2005 has an incorrect /ht/isa/ranges property.
2062 * The values are bad, and it doesn't even have the right number of cells. */
2063static void __init fixup_device_tree_maple(void)
1959{ 2064{
2065 phandle isa;
2066 u32 isa_ranges[6];
2067
2068 isa = call_prom("finddevice", 1, 1, ADDR("/ht@0/isa@4"));
2069 if (!PHANDLE_VALID(isa))
2070 return;
2071
2072 if (prom_getprop(isa, "ranges", isa_ranges, sizeof(isa_ranges))
2073 == PROM_ERROR)
2074 return;
2075
2076 if (isa_ranges[0] != 0x1 ||
2077 isa_ranges[1] != 0xf4000000 ||
2078 isa_ranges[2] != 0x00010000)
2079 return;
2080
2081 prom_printf("fixing up bogus ISA range on Maple...\n");
2082
2083 isa_ranges[0] = 0x1;
2084 isa_ranges[1] = 0x0;
2085 isa_ranges[2] = 0x01002000; /* IO space; PCI device = 4 */
2086 isa_ranges[3] = 0x0;
2087 isa_ranges[4] = 0x0;
2088 isa_ranges[5] = 0x00010000;
2089 prom_setprop(isa, "/ht@0/isa@4", "ranges",
2090 isa_ranges, sizeof(isa_ranges));
2091}
2092#else
2093#define fixup_device_tree_maple()
2094#endif
2095
1960#if defined(CONFIG_PPC64) && defined(CONFIG_PPC_PMAC) 2096#if defined(CONFIG_PPC64) && defined(CONFIG_PPC_PMAC)
2097static void __init fixup_device_tree_pmac(void)
2098{
1961 phandle u3, i2c, mpic; 2099 phandle u3, i2c, mpic;
1962 u32 u3_rev; 2100 u32 u3_rev;
1963 u32 interrupts[2]; 2101 u32 interrupts[2];
@@ -1994,9 +2132,16 @@ static void __init fixup_device_tree(void)
1994 parent = (u32)mpic; 2132 parent = (u32)mpic;
1995 prom_setprop(i2c, "/u3@0,f8000000/i2c@f8001000", "interrupt-parent", 2133 prom_setprop(i2c, "/u3@0,f8000000/i2c@f8001000", "interrupt-parent",
1996 &parent, sizeof(parent)); 2134 &parent, sizeof(parent));
1997#endif
1998} 2135}
2136#else
2137#define fixup_device_tree_pmac()
2138#endif
1999 2139
2140static void __init fixup_device_tree(void)
2141{
2142 fixup_device_tree_maple();
2143 fixup_device_tree_pmac();
2144}
2000 2145
2001static void __init prom_find_boot_cpu(void) 2146static void __init prom_find_boot_cpu(void)
2002{ 2147{
diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c
index bcb83574335b..4a677d1bd4ef 100644
--- a/arch/powerpc/kernel/ptrace.c
+++ b/arch/powerpc/kernel/ptrace.c
@@ -538,7 +538,7 @@ void do_syscall_trace_enter(struct pt_regs *regs)
538 do_syscall_trace(); 538 do_syscall_trace();
539 539
540 if (unlikely(current->audit_context)) 540 if (unlikely(current->audit_context))
541 audit_syscall_entry(current, 541 audit_syscall_entry(
542#ifdef CONFIG_PPC32 542#ifdef CONFIG_PPC32
543 AUDIT_ARCH_PPC, 543 AUDIT_ARCH_PPC,
544#else 544#else
@@ -556,8 +556,7 @@ void do_syscall_trace_leave(struct pt_regs *regs)
556#endif 556#endif
557 557
558 if (unlikely(current->audit_context)) 558 if (unlikely(current->audit_context))
559 audit_syscall_exit(current, 559 audit_syscall_exit((regs->ccr&0x1000)?AUDITSC_FAILURE:AUDITSC_SUCCESS,
560 (regs->ccr&0x1000)?AUDITSC_FAILURE:AUDITSC_SUCCESS,
561 regs->result); 560 regs->result);
562 561
563 if ((test_thread_flag(TIF_SYSCALL_TRACE) 562 if ((test_thread_flag(TIF_SYSCALL_TRACE)
diff --git a/arch/powerpc/kernel/rtas-proc.c b/arch/powerpc/kernel/rtas-proc.c
index 456286cf1d14..9c9ad1fa9cce 100644
--- a/arch/powerpc/kernel/rtas-proc.c
+++ b/arch/powerpc/kernel/rtas-proc.c
@@ -258,11 +258,11 @@ static int __init proc_rtas_init(void)
258 struct proc_dir_entry *entry; 258 struct proc_dir_entry *entry;
259 259
260 if (!machine_is(pseries)) 260 if (!machine_is(pseries))
261 return 1; 261 return -ENODEV;
262 262
263 rtas_node = of_find_node_by_name(NULL, "rtas"); 263 rtas_node = of_find_node_by_name(NULL, "rtas");
264 if (rtas_node == NULL) 264 if (rtas_node == NULL)
265 return 1; 265 return -ENODEV;
266 266
267 entry = create_proc_entry("ppc64/rtas/progress", S_IRUGO|S_IWUSR, NULL); 267 entry = create_proc_entry("ppc64/rtas/progress", S_IRUGO|S_IWUSR, NULL);
268 if (entry) 268 if (entry)
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index 1d93e73a7003..684ab1d49c65 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -516,3 +516,11 @@ void probe_machine(void)
516 516
517 printk(KERN_INFO "Using %s machine description\n", ppc_md.name); 517 printk(KERN_INFO "Using %s machine description\n", ppc_md.name);
518} 518}
519
520int check_legacy_ioport(unsigned long base_port)
521{
522 if (ppc_md.check_legacy_ioport == NULL)
523 return 0;
524 return ppc_md.check_legacy_ioport(base_port);
525}
526EXPORT_SYMBOL(check_legacy_ioport);
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 13e91c4d70a8..4467c49903b6 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -594,14 +594,6 @@ void ppc64_terminate_msg(unsigned int src, const char *msg)
594 printk("[terminate]%04x %s\n", src, msg); 594 printk("[terminate]%04x %s\n", src, msg);
595} 595}
596 596
597int check_legacy_ioport(unsigned long base_port)
598{
599 if (ppc_md.check_legacy_ioport == NULL)
600 return 0;
601 return ppc_md.check_legacy_ioport(base_port);
602}
603EXPORT_SYMBOL(check_legacy_ioport);
604
605void cpu_die(void) 597void cpu_die(void)
606{ 598{
607 if (ppc_md.cpu_die) 599 if (ppc_md.cpu_die)
diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c
index 73560ef6f802..5bc2585c8036 100644
--- a/arch/powerpc/kernel/sysfs.c
+++ b/arch/powerpc/kernel/sysfs.c
@@ -279,7 +279,7 @@ static void unregister_cpu_online(unsigned int cpu)
279} 279}
280#endif /* CONFIG_HOTPLUG_CPU */ 280#endif /* CONFIG_HOTPLUG_CPU */
281 281
282static int __devinit sysfs_cpu_notify(struct notifier_block *self, 282static int sysfs_cpu_notify(struct notifier_block *self,
283 unsigned long action, void *hcpu) 283 unsigned long action, void *hcpu)
284{ 284{
285 unsigned int cpu = (unsigned int)(long)hcpu; 285 unsigned int cpu = (unsigned int)(long)hcpu;
@@ -297,7 +297,7 @@ static int __devinit sysfs_cpu_notify(struct notifier_block *self,
297 return NOTIFY_OK; 297 return NOTIFY_OK;
298} 298}
299 299
300static struct notifier_block __devinitdata sysfs_cpu_nb = { 300static struct notifier_block sysfs_cpu_nb = {
301 .notifier_call = sysfs_cpu_notify, 301 .notifier_call = sysfs_cpu_notify,
302}; 302};
303 303
@@ -322,13 +322,31 @@ static void register_nodes(void)
322 } 322 }
323 } 323 }
324} 324}
325
326int sysfs_add_device_to_node(struct sys_device *dev, int nid)
327{
328 struct node *node = &node_devices[nid];
329 return sysfs_create_link(&node->sysdev.kobj, &dev->kobj,
330 kobject_name(&dev->kobj));
331}
332
333void sysfs_remove_device_from_node(struct sys_device *dev, int nid)
334{
335 struct node *node = &node_devices[nid];
336 sysfs_remove_link(&node->sysdev.kobj, kobject_name(&dev->kobj));
337}
338
325#else 339#else
326static void register_nodes(void) 340static void register_nodes(void)
327{ 341{
328 return; 342 return;
329} 343}
344
330#endif 345#endif
331 346
347EXPORT_SYMBOL_GPL(sysfs_add_device_to_node);
348EXPORT_SYMBOL_GPL(sysfs_remove_device_from_node);
349
332/* Only valid if CPU is present. */ 350/* Only valid if CPU is present. */
333static ssize_t show_physical_id(struct sys_device *dev, char *buf) 351static ssize_t show_physical_id(struct sys_device *dev, char *buf)
334{ 352{
diff --git a/arch/powerpc/kernel/systbl.S b/arch/powerpc/kernel/systbl.S
index 1424eab450ee..26ed1f5ef16e 100644
--- a/arch/powerpc/kernel/systbl.S
+++ b/arch/powerpc/kernel/systbl.S
@@ -323,3 +323,25 @@ COMPAT_SYS(pselect6)
323COMPAT_SYS(ppoll) 323COMPAT_SYS(ppoll)
324SYSCALL(unshare) 324SYSCALL(unshare)
325SYSCALL(splice) 325SYSCALL(splice)
326SYSCALL(tee)
327SYSCALL(vmsplice)
328COMPAT_SYS(openat)
329SYSCALL(mkdirat)
330SYSCALL(mknodat)
331SYSCALL(fchownat)
332COMPAT_SYS(futimesat)
333SYSX(sys_newfstatat, sys_fstatat64, sys_fstatat64)
334SYSCALL(unlinkat)
335SYSCALL(renameat)
336SYSCALL(linkat)
337SYSCALL(symlinkat)
338SYSCALL(readlinkat)
339SYSCALL(fchmodat)
340SYSCALL(faccessat)
341COMPAT_SYS(get_robust_list)
342COMPAT_SYS(set_robust_list)
343
344/*
345 * please add new calls to arch/powerpc/platforms/cell/spu_callbacks.c
346 * as well when appropriate.
347 */
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c
index 13c655ba2841..971020cf3f7d 100644
--- a/arch/powerpc/kernel/vio.c
+++ b/arch/powerpc/kernel/vio.c
@@ -202,7 +202,7 @@ static dma_addr_t vio_map_single(struct device *dev, void *vaddr,
202 size_t size, enum dma_data_direction direction) 202 size_t size, enum dma_data_direction direction)
203{ 203{
204 return iommu_map_single(to_vio_dev(dev)->iommu_table, vaddr, size, 204 return iommu_map_single(to_vio_dev(dev)->iommu_table, vaddr, size,
205 direction); 205 ~0ul, direction);
206} 206}
207 207
208static void vio_unmap_single(struct device *dev, dma_addr_t dma_handle, 208static void vio_unmap_single(struct device *dev, dma_addr_t dma_handle,
@@ -216,7 +216,7 @@ static int vio_map_sg(struct device *dev, struct scatterlist *sglist,
216 int nelems, enum dma_data_direction direction) 216 int nelems, enum dma_data_direction direction)
217{ 217{
218 return iommu_map_sg(dev, to_vio_dev(dev)->iommu_table, sglist, 218 return iommu_map_sg(dev, to_vio_dev(dev)->iommu_table, sglist,
219 nelems, direction); 219 nelems, ~0ul, direction);
220} 220}
221 221
222static void vio_unmap_sg(struct device *dev, struct scatterlist *sglist, 222static void vio_unmap_sg(struct device *dev, struct scatterlist *sglist,
@@ -229,7 +229,7 @@ static void *vio_alloc_coherent(struct device *dev, size_t size,
229 dma_addr_t *dma_handle, gfp_t flag) 229 dma_addr_t *dma_handle, gfp_t flag)
230{ 230{
231 return iommu_alloc_coherent(to_vio_dev(dev)->iommu_table, size, 231 return iommu_alloc_coherent(to_vio_dev(dev)->iommu_table, size,
232 dma_handle, flag); 232 dma_handle, ~0ul, flag);
233} 233}
234 234
235static void vio_free_coherent(struct device *dev, size_t size, 235static void vio_free_coherent(struct device *dev, size_t size,
diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
index 7370f9f33e29..266b8b2ceac9 100644
--- a/arch/powerpc/mm/hugetlbpage.c
+++ b/arch/powerpc/mm/hugetlbpage.c
@@ -30,13 +30,66 @@
30#define NUM_LOW_AREAS (0x100000000UL >> SID_SHIFT) 30#define NUM_LOW_AREAS (0x100000000UL >> SID_SHIFT)
31#define NUM_HIGH_AREAS (PGTABLE_RANGE >> HTLB_AREA_SHIFT) 31#define NUM_HIGH_AREAS (PGTABLE_RANGE >> HTLB_AREA_SHIFT)
32 32
33#ifdef CONFIG_PPC_64K_PAGES
34#define HUGEPTE_INDEX_SIZE (PMD_SHIFT-HPAGE_SHIFT)
35#else
36#define HUGEPTE_INDEX_SIZE (PUD_SHIFT-HPAGE_SHIFT)
37#endif
38#define PTRS_PER_HUGEPTE (1 << HUGEPTE_INDEX_SIZE)
39#define HUGEPTE_TABLE_SIZE (sizeof(pte_t) << HUGEPTE_INDEX_SIZE)
40
41#define HUGEPD_SHIFT (HPAGE_SHIFT + HUGEPTE_INDEX_SIZE)
42#define HUGEPD_SIZE (1UL << HUGEPD_SHIFT)
43#define HUGEPD_MASK (~(HUGEPD_SIZE-1))
44
45#define huge_pgtable_cache (pgtable_cache[HUGEPTE_CACHE_NUM])
46
47/* Flag to mark huge PD pointers. This means pmd_bad() and pud_bad()
48 * will choke on pointers to hugepte tables, which is handy for
49 * catching screwups early. */
50#define HUGEPD_OK 0x1
51
52typedef struct { unsigned long pd; } hugepd_t;
53
54#define hugepd_none(hpd) ((hpd).pd == 0)
55
56static inline pte_t *hugepd_page(hugepd_t hpd)
57{
58 BUG_ON(!(hpd.pd & HUGEPD_OK));
59 return (pte_t *)(hpd.pd & ~HUGEPD_OK);
60}
61
62static inline pte_t *hugepte_offset(hugepd_t *hpdp, unsigned long addr)
63{
64 unsigned long idx = ((addr >> HPAGE_SHIFT) & (PTRS_PER_HUGEPTE-1));
65 pte_t *dir = hugepd_page(*hpdp);
66
67 return dir + idx;
68}
69
70static int __hugepte_alloc(struct mm_struct *mm, hugepd_t *hpdp,
71 unsigned long address)
72{
73 pte_t *new = kmem_cache_alloc(huge_pgtable_cache,
74 GFP_KERNEL|__GFP_REPEAT);
75
76 if (! new)
77 return -ENOMEM;
78
79 spin_lock(&mm->page_table_lock);
80 if (!hugepd_none(*hpdp))
81 kmem_cache_free(huge_pgtable_cache, new);
82 else
83 hpdp->pd = (unsigned long)new | HUGEPD_OK;
84 spin_unlock(&mm->page_table_lock);
85 return 0;
86}
87
33/* Modelled after find_linux_pte() */ 88/* Modelled after find_linux_pte() */
34pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr) 89pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr)
35{ 90{
36 pgd_t *pg; 91 pgd_t *pg;
37 pud_t *pu; 92 pud_t *pu;
38 pmd_t *pm;
39 pte_t *pt;
40 93
41 BUG_ON(! in_hugepage_area(mm->context, addr)); 94 BUG_ON(! in_hugepage_area(mm->context, addr));
42 95
@@ -46,26 +99,14 @@ pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr)
46 if (!pgd_none(*pg)) { 99 if (!pgd_none(*pg)) {
47 pu = pud_offset(pg, addr); 100 pu = pud_offset(pg, addr);
48 if (!pud_none(*pu)) { 101 if (!pud_none(*pu)) {
49 pm = pmd_offset(pu, addr);
50#ifdef CONFIG_PPC_64K_PAGES 102#ifdef CONFIG_PPC_64K_PAGES
51 /* Currently, we use the normal PTE offset within full 103 pmd_t *pm;
52 * size PTE pages, thus our huge PTEs are scattered in 104 pm = pmd_offset(pu, addr);
53 * the PTE page and we do waste some. We may change 105 if (!pmd_none(*pm))
54 * that in the future, but the current mecanism keeps 106 return hugepte_offset((hugepd_t *)pm, addr);
55 * things much simpler 107#else
56 */ 108 return hugepte_offset((hugepd_t *)pu, addr);
57 if (!pmd_none(*pm)) { 109#endif
58 /* Note: pte_offset_* are all equivalent on
59 * ppc64 as we don't have HIGHMEM
60 */
61 pt = pte_offset_kernel(pm, addr);
62 return pt;
63 }
64#else /* CONFIG_PPC_64K_PAGES */
65 /* On 4k pages, we put huge PTEs in the PMD page */
66 pt = (pte_t *)pm;
67 return pt;
68#endif /* CONFIG_PPC_64K_PAGES */
69 } 110 }
70 } 111 }
71 112
@@ -76,8 +117,7 @@ pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr)
76{ 117{
77 pgd_t *pg; 118 pgd_t *pg;
78 pud_t *pu; 119 pud_t *pu;
79 pmd_t *pm; 120 hugepd_t *hpdp = NULL;
80 pte_t *pt;
81 121
82 BUG_ON(! in_hugepage_area(mm->context, addr)); 122 BUG_ON(! in_hugepage_area(mm->context, addr));
83 123
@@ -87,23 +127,182 @@ pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr)
87 pu = pud_alloc(mm, pg, addr); 127 pu = pud_alloc(mm, pg, addr);
88 128
89 if (pu) { 129 if (pu) {
130#ifdef CONFIG_PPC_64K_PAGES
131 pmd_t *pm;
90 pm = pmd_alloc(mm, pu, addr); 132 pm = pmd_alloc(mm, pu, addr);
91 if (pm) { 133 if (pm)
134 hpdp = (hugepd_t *)pm;
135#else
136 hpdp = (hugepd_t *)pu;
137#endif
138 }
139
140 if (! hpdp)
141 return NULL;
142
143 if (hugepd_none(*hpdp) && __hugepte_alloc(mm, hpdp, addr))
144 return NULL;
145
146 return hugepte_offset(hpdp, addr);
147}
148
149static void free_hugepte_range(struct mmu_gather *tlb, hugepd_t *hpdp)
150{
151 pte_t *hugepte = hugepd_page(*hpdp);
152
153 hpdp->pd = 0;
154 tlb->need_flush = 1;
155 pgtable_free_tlb(tlb, pgtable_free_cache(hugepte, HUGEPTE_CACHE_NUM,
156 HUGEPTE_TABLE_SIZE-1));
157}
158
92#ifdef CONFIG_PPC_64K_PAGES 159#ifdef CONFIG_PPC_64K_PAGES
93 /* See comment in huge_pte_offset. Note that if we ever 160static void hugetlb_free_pmd_range(struct mmu_gather *tlb, pud_t *pud,
94 * want to put the page size in the PMD, we would have 161 unsigned long addr, unsigned long end,
95 * to open code our own pte_alloc* function in order 162 unsigned long floor, unsigned long ceiling)
96 * to populate and set the size atomically 163{
97 */ 164 pmd_t *pmd;
98 pt = pte_alloc_map(mm, pm, addr); 165 unsigned long next;
99#else /* CONFIG_PPC_64K_PAGES */ 166 unsigned long start;
100 pt = (pte_t *)pm; 167
101#endif /* CONFIG_PPC_64K_PAGES */ 168 start = addr;
102 return pt; 169 pmd = pmd_offset(pud, addr);
103 } 170 do {
171 next = pmd_addr_end(addr, end);
172 if (pmd_none(*pmd))
173 continue;
174 free_hugepte_range(tlb, (hugepd_t *)pmd);
175 } while (pmd++, addr = next, addr != end);
176
177 start &= PUD_MASK;
178 if (start < floor)
179 return;
180 if (ceiling) {
181 ceiling &= PUD_MASK;
182 if (!ceiling)
183 return;
104 } 184 }
185 if (end - 1 > ceiling - 1)
186 return;
105 187
106 return NULL; 188 pmd = pmd_offset(pud, start);
189 pud_clear(pud);
190 pmd_free_tlb(tlb, pmd);
191}
192#endif
193
194static void hugetlb_free_pud_range(struct mmu_gather *tlb, pgd_t *pgd,
195 unsigned long addr, unsigned long end,
196 unsigned long floor, unsigned long ceiling)
197{
198 pud_t *pud;
199 unsigned long next;
200 unsigned long start;
201
202 start = addr;
203 pud = pud_offset(pgd, addr);
204 do {
205 next = pud_addr_end(addr, end);
206#ifdef CONFIG_PPC_64K_PAGES
207 if (pud_none_or_clear_bad(pud))
208 continue;
209 hugetlb_free_pmd_range(tlb, pud, addr, next, floor, ceiling);
210#else
211 if (pud_none(*pud))
212 continue;
213 free_hugepte_range(tlb, (hugepd_t *)pud);
214#endif
215 } while (pud++, addr = next, addr != end);
216
217 start &= PGDIR_MASK;
218 if (start < floor)
219 return;
220 if (ceiling) {
221 ceiling &= PGDIR_MASK;
222 if (!ceiling)
223 return;
224 }
225 if (end - 1 > ceiling - 1)
226 return;
227
228 pud = pud_offset(pgd, start);
229 pgd_clear(pgd);
230 pud_free_tlb(tlb, pud);
231}
232
233/*
234 * This function frees user-level page tables of a process.
235 *
236 * Must be called with pagetable lock held.
237 */
238void hugetlb_free_pgd_range(struct mmu_gather **tlb,
239 unsigned long addr, unsigned long end,
240 unsigned long floor, unsigned long ceiling)
241{
242 pgd_t *pgd;
243 unsigned long next;
244 unsigned long start;
245
246 /*
247 * Comments below take from the normal free_pgd_range(). They
248 * apply here too. The tests against HUGEPD_MASK below are
249 * essential, because we *don't* test for this at the bottom
250 * level. Without them we'll attempt to free a hugepte table
251 * when we unmap just part of it, even if there are other
252 * active mappings using it.
253 *
254 * The next few lines have given us lots of grief...
255 *
256 * Why are we testing HUGEPD* at this top level? Because
257 * often there will be no work to do at all, and we'd prefer
258 * not to go all the way down to the bottom just to discover
259 * that.
260 *
261 * Why all these "- 1"s? Because 0 represents both the bottom
262 * of the address space and the top of it (using -1 for the
263 * top wouldn't help much: the masks would do the wrong thing).
264 * The rule is that addr 0 and floor 0 refer to the bottom of
265 * the address space, but end 0 and ceiling 0 refer to the top
266 * Comparisons need to use "end - 1" and "ceiling - 1" (though
267 * that end 0 case should be mythical).
268 *
269 * Wherever addr is brought up or ceiling brought down, we
270 * must be careful to reject "the opposite 0" before it
271 * confuses the subsequent tests. But what about where end is
272 * brought down by HUGEPD_SIZE below? no, end can't go down to
273 * 0 there.
274 *
275 * Whereas we round start (addr) and ceiling down, by different
276 * masks at different levels, in order to test whether a table
277 * now has no other vmas using it, so can be freed, we don't
278 * bother to round floor or end up - the tests don't need that.
279 */
280
281 addr &= HUGEPD_MASK;
282 if (addr < floor) {
283 addr += HUGEPD_SIZE;
284 if (!addr)
285 return;
286 }
287 if (ceiling) {
288 ceiling &= HUGEPD_MASK;
289 if (!ceiling)
290 return;
291 }
292 if (end - 1 > ceiling - 1)
293 end -= HUGEPD_SIZE;
294 if (addr > end - 1)
295 return;
296
297 start = addr;
298 pgd = pgd_offset((*tlb)->mm, addr);
299 do {
300 BUG_ON(! in_hugepage_area((*tlb)->mm->context, addr));
301 next = pgd_addr_end(addr, end);
302 if (pgd_none_or_clear_bad(pgd))
303 continue;
304 hugetlb_free_pud_range(*tlb, pgd, addr, next, floor, ceiling);
305 } while (pgd++, addr = next, addr != end);
107} 306}
108 307
109void set_huge_pte_at(struct mm_struct *mm, unsigned long addr, 308void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
@@ -841,3 +1040,27 @@ repeat:
841 out: 1040 out:
842 return err; 1041 return err;
843} 1042}
1043
1044static void zero_ctor(void *addr, kmem_cache_t *cache, unsigned long flags)
1045{
1046 memset(addr, 0, kmem_cache_size(cache));
1047}
1048
1049static int __init hugetlbpage_init(void)
1050{
1051 if (!cpu_has_feature(CPU_FTR_16M_PAGE))
1052 return -ENODEV;
1053
1054 huge_pgtable_cache = kmem_cache_create("hugepte_cache",
1055 HUGEPTE_TABLE_SIZE,
1056 HUGEPTE_TABLE_SIZE,
1057 SLAB_HWCACHE_ALIGN |
1058 SLAB_MUST_HWCACHE_ALIGN,
1059 zero_ctor, NULL);
1060 if (! huge_pgtable_cache)
1061 panic("hugetlbpage_init(): could not create hugepte cache\n");
1062
1063 return 0;
1064}
1065
1066module_init(hugetlbpage_init);
diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c
index babebd15bdc4..9e30f968c184 100644
--- a/arch/powerpc/mm/init_64.c
+++ b/arch/powerpc/mm/init_64.c
@@ -162,7 +162,14 @@ static const char *pgtable_cache_name[ARRAY_SIZE(pgtable_cache_size)] = {
162}; 162};
163#endif /* CONFIG_PPC_64K_PAGES */ 163#endif /* CONFIG_PPC_64K_PAGES */
164 164
165#ifdef CONFIG_HUGETLB_PAGE
166/* Hugepages need one extra cache, initialized in hugetlbpage.c. We
167 * can't put into the tables above, because HPAGE_SHIFT is not compile
168 * time constant. */
169kmem_cache_t *pgtable_cache[ARRAY_SIZE(pgtable_cache_size)+1];
170#else
165kmem_cache_t *pgtable_cache[ARRAY_SIZE(pgtable_cache_size)]; 171kmem_cache_t *pgtable_cache[ARRAY_SIZE(pgtable_cache_size)];
172#endif
166 173
167void pgtable_cache_init(void) 174void pgtable_cache_init(void)
168{ 175{
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index 0a335f34974c..092355f37399 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -194,7 +194,7 @@ static int *of_get_associativity(struct device_node *dev)
194/* Returns nid in the range [0..MAX_NUMNODES-1], or -1 if no useful numa 194/* Returns nid in the range [0..MAX_NUMNODES-1], or -1 if no useful numa
195 * info is found. 195 * info is found.
196 */ 196 */
197static int of_node_to_nid(struct device_node *device) 197static int of_node_to_nid_single(struct device_node *device)
198{ 198{
199 int nid = -1; 199 int nid = -1;
200 unsigned int *tmp; 200 unsigned int *tmp;
@@ -216,6 +216,28 @@ out:
216 return nid; 216 return nid;
217} 217}
218 218
219/* Walk the device tree upwards, looking for an associativity id */
220int of_node_to_nid(struct device_node *device)
221{
222 struct device_node *tmp;
223 int nid = -1;
224
225 of_node_get(device);
226 while (device) {
227 nid = of_node_to_nid_single(device);
228 if (nid != -1)
229 break;
230
231 tmp = device;
232 device = of_get_parent(tmp);
233 of_node_put(tmp);
234 }
235 of_node_put(device);
236
237 return nid;
238}
239EXPORT_SYMBOL_GPL(of_node_to_nid);
240
219/* 241/*
220 * In theory, the "ibm,associativity" property may contain multiple 242 * In theory, the "ibm,associativity" property may contain multiple
221 * associativity lists because a resource may be multiply connected 243 * associativity lists because a resource may be multiply connected
@@ -300,7 +322,7 @@ static int __cpuinit numa_setup_cpu(unsigned long lcpu)
300 goto out; 322 goto out;
301 } 323 }
302 324
303 nid = of_node_to_nid(cpu); 325 nid = of_node_to_nid_single(cpu);
304 326
305 if (nid < 0 || !node_online(nid)) 327 if (nid < 0 || !node_online(nid))
306 nid = any_online_node(NODE_MASK_ALL); 328 nid = any_online_node(NODE_MASK_ALL);
@@ -393,7 +415,7 @@ static int __init parse_numa_properties(void)
393 415
394 cpu = find_cpu_node(i); 416 cpu = find_cpu_node(i);
395 BUG_ON(!cpu); 417 BUG_ON(!cpu);
396 nid = of_node_to_nid(cpu); 418 nid = of_node_to_nid_single(cpu);
397 of_node_put(cpu); 419 of_node_put(cpu);
398 420
399 /* 421 /*
@@ -437,7 +459,7 @@ new_range:
437 * have associativity properties. If none, then 459 * have associativity properties. If none, then
438 * everything goes to default_nid. 460 * everything goes to default_nid.
439 */ 461 */
440 nid = of_node_to_nid(memory); 462 nid = of_node_to_nid_single(memory);
441 if (nid < 0) 463 if (nid < 0)
442 nid = default_nid; 464 nid = default_nid;
443 node_set_online(nid); 465 node_set_online(nid);
@@ -776,7 +798,7 @@ int hot_add_scn_to_nid(unsigned long scn_addr)
776ha_new_range: 798ha_new_range:
777 start = read_n_cells(n_mem_addr_cells, &memcell_buf); 799 start = read_n_cells(n_mem_addr_cells, &memcell_buf);
778 size = read_n_cells(n_mem_size_cells, &memcell_buf); 800 size = read_n_cells(n_mem_size_cells, &memcell_buf);
779 nid = of_node_to_nid(memory); 801 nid = of_node_to_nid_single(memory);
780 802
781 /* Domains not present at boot default to 0 */ 803 /* Domains not present at boot default to 0 */
782 if (nid < 0 || !node_online(nid)) 804 if (nid < 0 || !node_online(nid))
diff --git a/arch/powerpc/platforms/cell/Kconfig b/arch/powerpc/platforms/cell/Kconfig
index c2a3db8edb0c..6a02d51086c8 100644
--- a/arch/powerpc/platforms/cell/Kconfig
+++ b/arch/powerpc/platforms/cell/Kconfig
@@ -12,7 +12,8 @@ config SPU_FS
12 12
13config SPUFS_MMAP 13config SPUFS_MMAP
14 bool 14 bool
15 depends on SPU_FS && SPARSEMEM && !PPC_64K_PAGES 15 depends on SPU_FS && SPARSEMEM
16 select MEMORY_HOTPLUG
16 default y 17 default y
17 18
18endmenu 19endmenu
diff --git a/arch/powerpc/platforms/cell/setup.c b/arch/powerpc/platforms/cell/setup.c
index dac5d0365fde..6574b22b3cf3 100644
--- a/arch/powerpc/platforms/cell/setup.c
+++ b/arch/powerpc/platforms/cell/setup.c
@@ -29,6 +29,8 @@
29#include <linux/seq_file.h> 29#include <linux/seq_file.h>
30#include <linux/root_dev.h> 30#include <linux/root_dev.h>
31#include <linux/console.h> 31#include <linux/console.h>
32#include <linux/mutex.h>
33#include <linux/memory_hotplug.h>
32 34
33#include <asm/mmu.h> 35#include <asm/mmu.h>
34#include <asm/processor.h> 36#include <asm/processor.h>
@@ -46,6 +48,7 @@
46#include <asm/cputable.h> 48#include <asm/cputable.h>
47#include <asm/ppc-pci.h> 49#include <asm/ppc-pci.h>
48#include <asm/irq.h> 50#include <asm/irq.h>
51#include <asm/spu.h>
49 52
50#include "interrupt.h" 53#include "interrupt.h"
51#include "iommu.h" 54#include "iommu.h"
@@ -69,77 +72,6 @@ static void cell_show_cpuinfo(struct seq_file *m)
69 of_node_put(root); 72 of_node_put(root);
70} 73}
71 74
72#ifdef CONFIG_SPARSEMEM
73static int __init find_spu_node_id(struct device_node *spe)
74{
75 unsigned int *id;
76#ifdef CONFIG_NUMA
77 struct device_node *cpu;
78 cpu = spe->parent->parent;
79 id = (unsigned int *)get_property(cpu, "node-id", NULL);
80#else
81 id = NULL;
82#endif
83 return id ? *id : 0;
84}
85
86static void __init cell_spuprop_present(struct device_node *spe,
87 const char *prop, int early)
88{
89 struct address_prop {
90 unsigned long address;
91 unsigned int len;
92 } __attribute__((packed)) *p;
93 int proplen;
94
95 unsigned long start_pfn, end_pfn, pfn;
96 int node_id;
97
98 p = (void*)get_property(spe, prop, &proplen);
99 WARN_ON(proplen != sizeof (*p));
100
101 node_id = find_spu_node_id(spe);
102
103 start_pfn = p->address >> PAGE_SHIFT;
104 end_pfn = (p->address + p->len + PAGE_SIZE - 1) >> PAGE_SHIFT;
105
106 /* We need to call memory_present *before* the call to sparse_init,
107 but we can initialize the page structs only *after* that call.
108 Thus, we're being called twice. */
109 if (early)
110 memory_present(node_id, start_pfn, end_pfn);
111 else {
112 /* As the pages backing SPU LS and I/O are outside the range
113 of regular memory, their page structs were not initialized
114 by free_area_init. Do it here instead. */
115 for (pfn = start_pfn; pfn < end_pfn; pfn++) {
116 struct page *page = pfn_to_page(pfn);
117 set_page_links(page, ZONE_DMA, node_id, pfn);
118 init_page_count(page);
119 reset_page_mapcount(page);
120 SetPageReserved(page);
121 INIT_LIST_HEAD(&page->lru);
122 }
123 }
124}
125
126static void __init cell_spumem_init(int early)
127{
128 struct device_node *node;
129 for (node = of_find_node_by_type(NULL, "spe");
130 node; node = of_find_node_by_type(node, "spe")) {
131 cell_spuprop_present(node, "local-store", early);
132 cell_spuprop_present(node, "problem", early);
133 cell_spuprop_present(node, "priv1", early);
134 cell_spuprop_present(node, "priv2", early);
135 }
136}
137#else
138static void __init cell_spumem_init(int early)
139{
140}
141#endif
142
143static void cell_progress(char *s, unsigned short hex) 75static void cell_progress(char *s, unsigned short hex)
144{ 76{
145 printk("*** %04x : %s\n", hex, s ? s : ""); 77 printk("*** %04x : %s\n", hex, s ? s : "");
@@ -172,8 +104,6 @@ static void __init cell_setup_arch(void)
172#endif 104#endif
173 105
174 mmio_nvram_init(); 106 mmio_nvram_init();
175
176 cell_spumem_init(0);
177} 107}
178 108
179/* 109/*
@@ -189,8 +119,6 @@ static void __init cell_init_early(void)
189 119
190 ppc64_interrupt_controller = IC_CELL_PIC; 120 ppc64_interrupt_controller = IC_CELL_PIC;
191 121
192 cell_spumem_init(1);
193
194 DBG(" <- cell_init_early()\n"); 122 DBG(" <- cell_init_early()\n");
195} 123}
196 124
diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c
index 269dda4fd0b4..ad141fe8d52d 100644
--- a/arch/powerpc/platforms/cell/spu_base.c
+++ b/arch/powerpc/platforms/cell/spu_base.c
@@ -306,19 +306,19 @@ spu_request_irqs(struct spu *spu)
306 306
307 snprintf(spu->irq_c0, sizeof (spu->irq_c0), "spe%02d.0", spu->number); 307 snprintf(spu->irq_c0, sizeof (spu->irq_c0), "spe%02d.0", spu->number);
308 ret = request_irq(irq_base + spu->isrc, 308 ret = request_irq(irq_base + spu->isrc,
309 spu_irq_class_0, 0, spu->irq_c0, spu); 309 spu_irq_class_0, SA_INTERRUPT, spu->irq_c0, spu);
310 if (ret) 310 if (ret)
311 goto out; 311 goto out;
312 312
313 snprintf(spu->irq_c1, sizeof (spu->irq_c1), "spe%02d.1", spu->number); 313 snprintf(spu->irq_c1, sizeof (spu->irq_c1), "spe%02d.1", spu->number);
314 ret = request_irq(irq_base + IIC_CLASS_STRIDE + spu->isrc, 314 ret = request_irq(irq_base + IIC_CLASS_STRIDE + spu->isrc,
315 spu_irq_class_1, 0, spu->irq_c1, spu); 315 spu_irq_class_1, SA_INTERRUPT, spu->irq_c1, spu);
316 if (ret) 316 if (ret)
317 goto out1; 317 goto out1;
318 318
319 snprintf(spu->irq_c2, sizeof (spu->irq_c2), "spe%02d.2", spu->number); 319 snprintf(spu->irq_c2, sizeof (spu->irq_c2), "spe%02d.2", spu->number);
320 ret = request_irq(irq_base + 2*IIC_CLASS_STRIDE + spu->isrc, 320 ret = request_irq(irq_base + 2*IIC_CLASS_STRIDE + spu->isrc,
321 spu_irq_class_2, 0, spu->irq_c2, spu); 321 spu_irq_class_2, SA_INTERRUPT, spu->irq_c2, spu);
322 if (ret) 322 if (ret)
323 goto out2; 323 goto out2;
324 goto out; 324 goto out;
@@ -487,10 +487,14 @@ int spu_irq_class_1_bottom(struct spu *spu)
487 ea = spu->dar; 487 ea = spu->dar;
488 dsisr = spu->dsisr; 488 dsisr = spu->dsisr;
489 if (dsisr & (MFC_DSISR_PTE_NOT_FOUND | MFC_DSISR_ACCESS_DENIED)) { 489 if (dsisr & (MFC_DSISR_PTE_NOT_FOUND | MFC_DSISR_ACCESS_DENIED)) {
490 u64 flags;
491
490 access = (_PAGE_PRESENT | _PAGE_USER); 492 access = (_PAGE_PRESENT | _PAGE_USER);
491 access |= (dsisr & MFC_DSISR_ACCESS_PUT) ? _PAGE_RW : 0UL; 493 access |= (dsisr & MFC_DSISR_ACCESS_PUT) ? _PAGE_RW : 0UL;
494 local_irq_save(flags);
492 if (hash_page(ea, access, 0x300) != 0) 495 if (hash_page(ea, access, 0x300) != 0)
493 error |= CLASS1_ENABLE_STORAGE_FAULT_INTR; 496 error |= CLASS1_ENABLE_STORAGE_FAULT_INTR;
497 local_irq_restore(flags);
494 } 498 }
495 if (error & CLASS1_ENABLE_STORAGE_FAULT_INTR) { 499 if (error & CLASS1_ENABLE_STORAGE_FAULT_INTR) {
496 if ((ret = spu_handle_mm_fault(spu)) != 0) 500 if ((ret = spu_handle_mm_fault(spu)) != 0)
@@ -516,8 +520,50 @@ void spu_irq_setaffinity(struct spu *spu, int cpu)
516} 520}
517EXPORT_SYMBOL_GPL(spu_irq_setaffinity); 521EXPORT_SYMBOL_GPL(spu_irq_setaffinity);
518 522
519static void __iomem * __init map_spe_prop(struct device_node *n, 523static int __init find_spu_node_id(struct device_node *spe)
520 const char *name) 524{
525 unsigned int *id;
526 struct device_node *cpu;
527 cpu = spe->parent->parent;
528 id = (unsigned int *)get_property(cpu, "node-id", NULL);
529 return id ? *id : 0;
530}
531
532static int __init cell_spuprop_present(struct spu *spu, struct device_node *spe,
533 const char *prop)
534{
535 static DEFINE_MUTEX(add_spumem_mutex);
536
537 struct address_prop {
538 unsigned long address;
539 unsigned int len;
540 } __attribute__((packed)) *p;
541 int proplen;
542
543 unsigned long start_pfn, nr_pages;
544 struct pglist_data *pgdata;
545 struct zone *zone;
546 int ret;
547
548 p = (void*)get_property(spe, prop, &proplen);
549 WARN_ON(proplen != sizeof (*p));
550
551 start_pfn = p->address >> PAGE_SHIFT;
552 nr_pages = ((unsigned long)p->len + PAGE_SIZE - 1) >> PAGE_SHIFT;
553
554 pgdata = NODE_DATA(spu->nid);
555 zone = pgdata->node_zones;
556
557 /* XXX rethink locking here */
558 mutex_lock(&add_spumem_mutex);
559 ret = __add_pages(zone, start_pfn, nr_pages);
560 mutex_unlock(&add_spumem_mutex);
561
562 return ret;
563}
564
565static void __iomem * __init map_spe_prop(struct spu *spu,
566 struct device_node *n, const char *name)
521{ 567{
522 struct address_prop { 568 struct address_prop {
523 unsigned long address; 569 unsigned long address;
@@ -526,6 +572,8 @@ static void __iomem * __init map_spe_prop(struct device_node *n,
526 572
527 void *p; 573 void *p;
528 int proplen; 574 int proplen;
575 void* ret = NULL;
576 int err = 0;
529 577
530 p = get_property(n, name, &proplen); 578 p = get_property(n, name, &proplen);
531 if (proplen != sizeof (struct address_prop)) 579 if (proplen != sizeof (struct address_prop))
@@ -533,7 +581,14 @@ static void __iomem * __init map_spe_prop(struct device_node *n,
533 581
534 prop = p; 582 prop = p;
535 583
536 return ioremap(prop->address, prop->len); 584 err = cell_spuprop_present(spu, n, name);
585 if (err && (err != -EEXIST))
586 goto out;
587
588 ret = ioremap(prop->address, prop->len);
589
590 out:
591 return ret;
537} 592}
538 593
539static void spu_unmap(struct spu *spu) 594static void spu_unmap(struct spu *spu)
@@ -544,44 +599,45 @@ static void spu_unmap(struct spu *spu)
544 iounmap((u8 __iomem *)spu->local_store); 599 iounmap((u8 __iomem *)spu->local_store);
545} 600}
546 601
547static int __init spu_map_device(struct spu *spu, struct device_node *spe) 602static int __init spu_map_device(struct spu *spu, struct device_node *node)
548{ 603{
549 char *prop; 604 char *prop;
550 int ret; 605 int ret;
551 606
552 ret = -ENODEV; 607 ret = -ENODEV;
553 prop = get_property(spe, "isrc", NULL); 608 prop = get_property(node, "isrc", NULL);
554 if (!prop) 609 if (!prop)
555 goto out; 610 goto out;
556 spu->isrc = *(unsigned int *)prop; 611 spu->isrc = *(unsigned int *)prop;
557 612
558 spu->name = get_property(spe, "name", NULL); 613 spu->name = get_property(node, "name", NULL);
559 if (!spu->name) 614 if (!spu->name)
560 goto out; 615 goto out;
561 616
562 prop = get_property(spe, "local-store", NULL); 617 prop = get_property(node, "local-store", NULL);
563 if (!prop) 618 if (!prop)
564 goto out; 619 goto out;
565 spu->local_store_phys = *(unsigned long *)prop; 620 spu->local_store_phys = *(unsigned long *)prop;
566 621
567 /* we use local store as ram, not io memory */ 622 /* we use local store as ram, not io memory */
568 spu->local_store = (void __force *)map_spe_prop(spe, "local-store"); 623 spu->local_store = (void __force *)
624 map_spe_prop(spu, node, "local-store");
569 if (!spu->local_store) 625 if (!spu->local_store)
570 goto out; 626 goto out;
571 627
572 prop = get_property(spe, "problem", NULL); 628 prop = get_property(node, "problem", NULL);
573 if (!prop) 629 if (!prop)
574 goto out_unmap; 630 goto out_unmap;
575 spu->problem_phys = *(unsigned long *)prop; 631 spu->problem_phys = *(unsigned long *)prop;
576 632
577 spu->problem= map_spe_prop(spe, "problem"); 633 spu->problem= map_spe_prop(spu, node, "problem");
578 if (!spu->problem) 634 if (!spu->problem)
579 goto out_unmap; 635 goto out_unmap;
580 636
581 spu->priv1= map_spe_prop(spe, "priv1"); 637 spu->priv1= map_spe_prop(spu, node, "priv1");
582 /* priv1 is not available on a hypervisor */ 638 /* priv1 is not available on a hypervisor */
583 639
584 spu->priv2= map_spe_prop(spe, "priv2"); 640 spu->priv2= map_spe_prop(spu, node, "priv2");
585 if (!spu->priv2) 641 if (!spu->priv2)
586 goto out_unmap; 642 goto out_unmap;
587 ret = 0; 643 ret = 0;
@@ -593,17 +649,6 @@ out:
593 return ret; 649 return ret;
594} 650}
595 651
596static int __init find_spu_node_id(struct device_node *spe)
597{
598 unsigned int *id;
599 struct device_node *cpu;
600
601 cpu = spe->parent->parent;
602 id = (unsigned int *)get_property(cpu, "node-id", NULL);
603
604 return id ? *id : 0;
605}
606
607static int __init create_spu(struct device_node *spe) 652static int __init create_spu(struct device_node *spe)
608{ 653{
609 struct spu *spu; 654 struct spu *spu;
@@ -620,6 +665,10 @@ static int __init create_spu(struct device_node *spe)
620 goto out_free; 665 goto out_free;
621 666
622 spu->node = find_spu_node_id(spe); 667 spu->node = find_spu_node_id(spe);
668 spu->nid = of_node_to_nid(spe);
669 if (spu->nid == -1)
670 spu->nid = 0;
671
623 spu->stop_code = 0; 672 spu->stop_code = 0;
624 spu->slb_replace = 0; 673 spu->slb_replace = 0;
625 spu->mm = NULL; 674 spu->mm = NULL;
diff --git a/arch/powerpc/platforms/cell/spu_callbacks.c b/arch/powerpc/platforms/cell/spu_callbacks.c
index 6594bec73882..b47fcc5ddb78 100644
--- a/arch/powerpc/platforms/cell/spu_callbacks.c
+++ b/arch/powerpc/platforms/cell/spu_callbacks.c
@@ -258,6 +258,7 @@ void *spu_syscall_table[] = {
258 [__NR_futex] sys_futex, 258 [__NR_futex] sys_futex,
259 [__NR_sched_setaffinity] sys_sched_setaffinity, 259 [__NR_sched_setaffinity] sys_sched_setaffinity,
260 [__NR_sched_getaffinity] sys_sched_getaffinity, 260 [__NR_sched_getaffinity] sys_sched_getaffinity,
261 [224] sys_ni_syscall,
261 [__NR_tuxcall] sys_ni_syscall, 262 [__NR_tuxcall] sys_ni_syscall,
262 [226] sys_ni_syscall, 263 [226] sys_ni_syscall,
263 [__NR_io_setup] sys_io_setup, 264 [__NR_io_setup] sys_io_setup,
@@ -317,21 +318,36 @@ void *spu_syscall_table[] = {
317 [__NR_ppoll] sys_ni_syscall, /* sys_ppoll */ 318 [__NR_ppoll] sys_ni_syscall, /* sys_ppoll */
318 [__NR_unshare] sys_unshare, 319 [__NR_unshare] sys_unshare,
319 [__NR_splice] sys_splice, 320 [__NR_splice] sys_splice,
321 [__NR_tee] sys_tee,
322 [__NR_vmsplice] sys_vmsplice,
323 [__NR_openat] sys_openat,
324 [__NR_mkdirat] sys_mkdirat,
325 [__NR_mknodat] sys_mknodat,
326 [__NR_fchownat] sys_fchownat,
327 [__NR_futimesat] sys_futimesat,
328 [__NR_newfstatat] sys_newfstatat,
329 [__NR_unlinkat] sys_unlinkat,
330 [__NR_renameat] sys_renameat,
331 [__NR_linkat] sys_linkat,
332 [__NR_symlinkat] sys_symlinkat,
333 [__NR_readlinkat] sys_readlinkat,
334 [__NR_fchmodat] sys_fchmodat,
335 [__NR_faccessat] sys_faccessat,
336 [__NR_get_robust_list] sys_get_robust_list,
337 [__NR_set_robust_list] sys_set_robust_list,
320}; 338};
321 339
322long spu_sys_callback(struct spu_syscall_block *s) 340long spu_sys_callback(struct spu_syscall_block *s)
323{ 341{
324 long (*syscall)(u64 a1, u64 a2, u64 a3, u64 a4, u64 a5, u64 a6); 342 long (*syscall)(u64 a1, u64 a2, u64 a3, u64 a4, u64 a5, u64 a6);
325 343
326 BUILD_BUG_ON(ARRAY_SIZE(spu_syscall_table) != __NR_syscalls); 344 if (s->nr_ret >= ARRAY_SIZE(spu_syscall_table)) {
327
328 syscall = spu_syscall_table[s->nr_ret];
329
330 if (s->nr_ret >= __NR_syscalls) {
331 pr_debug("%s: invalid syscall #%ld", __FUNCTION__, s->nr_ret); 345 pr_debug("%s: invalid syscall #%ld", __FUNCTION__, s->nr_ret);
332 return -ENOSYS; 346 return -ENOSYS;
333 } 347 }
334 348
349 syscall = spu_syscall_table[s->nr_ret];
350
335#ifdef DEBUG 351#ifdef DEBUG
336 print_symbol(KERN_DEBUG "SPU-syscall %s:", (unsigned long)syscall); 352 print_symbol(KERN_DEBUG "SPU-syscall %s:", (unsigned long)syscall);
337 printk("syscall%ld(%lx, %lx, %lx, %lx, %lx, %lx)\n", 353 printk("syscall%ld(%lx, %lx, %lx, %lx, %lx, %lx)\n",
diff --git a/arch/powerpc/platforms/cell/spufs/switch.c b/arch/powerpc/platforms/cell/spufs/switch.c
index 97898d5d34e5..1726bfe38ee0 100644
--- a/arch/powerpc/platforms/cell/spufs/switch.c
+++ b/arch/powerpc/platforms/cell/spufs/switch.c
@@ -1297,7 +1297,7 @@ static inline void setup_decr(struct spu_state *csa, struct spu *spu)
1297 cycles_t resume_time = get_cycles(); 1297 cycles_t resume_time = get_cycles();
1298 cycles_t delta_time = resume_time - csa->suspend_time; 1298 cycles_t delta_time = resume_time - csa->suspend_time;
1299 1299
1300 csa->lscsa->decr.slot[0] = delta_time; 1300 csa->lscsa->decr.slot[0] -= delta_time;
1301 } 1301 }
1302} 1302}
1303 1303
diff --git a/arch/powerpc/platforms/chrp/chrp.h b/arch/powerpc/platforms/chrp/chrp.h
index 63f0aee4c158..996c28744e96 100644
--- a/arch/powerpc/platforms/chrp/chrp.h
+++ b/arch/powerpc/platforms/chrp/chrp.h
@@ -9,3 +9,4 @@ extern long chrp_time_init(void);
9 9
10extern void chrp_find_bridges(void); 10extern void chrp_find_bridges(void);
11extern void chrp_event_scan(unsigned long); 11extern void chrp_event_scan(unsigned long);
12extern void chrp_pcibios_fixup(void);
diff --git a/arch/powerpc/platforms/chrp/pci.c b/arch/powerpc/platforms/chrp/pci.c
index 8ef279ad36ad..ac224876ce59 100644
--- a/arch/powerpc/platforms/chrp/pci.c
+++ b/arch/powerpc/platforms/chrp/pci.c
@@ -23,6 +23,8 @@
23#include <asm/grackle.h> 23#include <asm/grackle.h>
24#include <asm/rtas.h> 24#include <asm/rtas.h>
25 25
26#include "chrp.h"
27
26/* LongTrail */ 28/* LongTrail */
27void __iomem *gg2_pci_config_base; 29void __iomem *gg2_pci_config_base;
28 30
@@ -314,6 +316,6 @@ chrp_find_bridges(void)
314 } 316 }
315 317
316 /* Do not fixup interrupts from OF tree on pegasos */ 318 /* Do not fixup interrupts from OF tree on pegasos */
317 if (is_pegasos == 0) 319 if (is_pegasos)
318 ppc_md.pcibios_fixup = chrp_pcibios_fixup; 320 ppc_md.pcibios_fixup = NULL;
319} 321}
diff --git a/arch/powerpc/platforms/chrp/setup.c b/arch/powerpc/platforms/chrp/setup.c
index 23a201718704..18d89f38796b 100644
--- a/arch/powerpc/platforms/chrp/setup.c
+++ b/arch/powerpc/platforms/chrp/setup.c
@@ -440,8 +440,6 @@ void __init chrp_init_IRQ(void)
440 440
441 if (_chrp_type == _CHRP_Pegasos) 441 if (_chrp_type == _CHRP_Pegasos)
442 ppc_md.get_irq = i8259_irq; 442 ppc_md.get_irq = i8259_irq;
443 else
444 ppc_md.get_irq = mpic_get_irq;
445 443
446#if defined(CONFIG_VT) && defined(CONFIG_INPUT_ADBHID) && defined(XMON) 444#if defined(CONFIG_VT) && defined(CONFIG_INPUT_ADBHID) && defined(XMON)
447 /* see if there is a keyboard in the device tree 445 /* see if there is a keyboard in the device tree
@@ -528,26 +526,24 @@ static int __init chrp_probe(void)
528 /* Assume we have an 8259... */ 526 /* Assume we have an 8259... */
529 __irq_offset_value = NUM_ISA_INTERRUPTS; 527 __irq_offset_value = NUM_ISA_INTERRUPTS;
530 528
531 ppc_md.setup_arch = chrp_setup_arch; 529 return 1;
532 ppc_md.show_cpuinfo = chrp_show_cpuinfo;
533
534 ppc_md.init_IRQ = chrp_init_IRQ;
535 ppc_md.init = chrp_init2;
536
537 ppc_md.phys_mem_access_prot = pci_phys_mem_access_prot;
538
539 ppc_md.restart = rtas_restart;
540 ppc_md.power_off = rtas_power_off;
541 ppc_md.halt = rtas_halt;
542
543 ppc_md.time_init = chrp_time_init;
544 ppc_md.calibrate_decr = generic_calibrate_decr;
545
546 /* this may get overridden with rtas routines later... */
547 ppc_md.set_rtc_time = chrp_set_rtc_time;
548 ppc_md.get_rtc_time = chrp_get_rtc_time;
549
550#ifdef CONFIG_SMP
551 smp_ops = &chrp_smp_ops;
552#endif /* CONFIG_SMP */
553} 530}
531
532define_machine(chrp) {
533 .name = "CHRP",
534 .probe = chrp_probe,
535 .setup_arch = chrp_setup_arch,
536 .init = chrp_init2,
537 .show_cpuinfo = chrp_show_cpuinfo,
538 .init_IRQ = chrp_init_IRQ,
539 .get_irq = mpic_get_irq,
540 .pcibios_fixup = chrp_pcibios_fixup,
541 .restart = rtas_restart,
542 .power_off = rtas_power_off,
543 .halt = rtas_halt,
544 .time_init = chrp_time_init,
545 .set_rtc_time = chrp_set_rtc_time,
546 .get_rtc_time = chrp_get_rtc_time,
547 .calibrate_decr = generic_calibrate_decr,
548 .phys_mem_access_prot = pci_phys_mem_access_prot,
549};
diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c
index 6ce8a404ba6b..a6fd9bedb074 100644
--- a/arch/powerpc/platforms/iseries/setup.c
+++ b/arch/powerpc/platforms/iseries/setup.c
@@ -54,6 +54,7 @@
54#include <asm/iseries/hv_lp_event.h> 54#include <asm/iseries/hv_lp_event.h>
55#include <asm/iseries/lpar_map.h> 55#include <asm/iseries/lpar_map.h>
56#include <asm/udbg.h> 56#include <asm/udbg.h>
57#include <asm/irq.h>
57 58
58#include "naca.h" 59#include "naca.h"
59#include "setup.h" 60#include "setup.h"
@@ -684,6 +685,12 @@ static int __init iseries_probe(void)
684 powerpc_firmware_features |= FW_FEATURE_ISERIES; 685 powerpc_firmware_features |= FW_FEATURE_ISERIES;
685 powerpc_firmware_features |= FW_FEATURE_LPAR; 686 powerpc_firmware_features |= FW_FEATURE_LPAR;
686 687
688 /*
689 * The Hypervisor only allows us up to 256 interrupt
690 * sources (the irq number is passed in a u8).
691 */
692 virt_irq_max = 255;
693
687 return 1; 694 return 1;
688} 695}
689 696
diff --git a/arch/powerpc/platforms/powermac/low_i2c.c b/arch/powerpc/platforms/powermac/low_i2c.c
index e14f9ac55cf4..c896ce83d412 100644
--- a/arch/powerpc/platforms/powermac/low_i2c.c
+++ b/arch/powerpc/platforms/powermac/low_i2c.c
@@ -231,6 +231,14 @@ static u8 kw_i2c_wait_interrupt(struct pmac_i2c_host_kw *host)
231 return isr; 231 return isr;
232} 232}
233 233
234static void kw_i2c_do_stop(struct pmac_i2c_host_kw *host, int result)
235{
236 kw_write_reg(reg_control, KW_I2C_CTL_STOP);
237 host->state = state_stop;
238 host->result = result;
239}
240
241
234static void kw_i2c_handle_interrupt(struct pmac_i2c_host_kw *host, u8 isr) 242static void kw_i2c_handle_interrupt(struct pmac_i2c_host_kw *host, u8 isr)
235{ 243{
236 u8 ack; 244 u8 ack;
@@ -246,42 +254,36 @@ static void kw_i2c_handle_interrupt(struct pmac_i2c_host_kw *host, u8 isr)
246 } 254 }
247 255
248 if (isr == 0) { 256 if (isr == 0) {
257 printk(KERN_WARNING "low_i2c: Timeout in i2c transfer"
258 " on keywest !\n");
249 if (host->state != state_stop) { 259 if (host->state != state_stop) {
250 DBG_LOW("KW: Timeout !\n"); 260 kw_i2c_do_stop(host, -EIO);
251 host->result = -EIO; 261 return;
252 goto stop;
253 }
254 if (host->state == state_stop) {
255 ack = kw_read_reg(reg_status);
256 if (ack & KW_I2C_STAT_BUSY)
257 kw_write_reg(reg_status, 0);
258 host->state = state_idle;
259 kw_write_reg(reg_ier, 0x00);
260 if (!host->polled)
261 complete(&host->complete);
262 } 262 }
263 ack = kw_read_reg(reg_status);
264 if (ack & KW_I2C_STAT_BUSY)
265 kw_write_reg(reg_status, 0);
266 host->state = state_idle;
267 kw_write_reg(reg_ier, 0x00);
268 if (!host->polled)
269 complete(&host->complete);
263 return; 270 return;
264 } 271 }
265 272
266 if (isr & KW_I2C_IRQ_ADDR) { 273 if (isr & KW_I2C_IRQ_ADDR) {
267 ack = kw_read_reg(reg_status); 274 ack = kw_read_reg(reg_status);
268 if (host->state != state_addr) { 275 if (host->state != state_addr) {
269 kw_write_reg(reg_isr, KW_I2C_IRQ_ADDR);
270 WRONG_STATE("KW_I2C_IRQ_ADDR"); 276 WRONG_STATE("KW_I2C_IRQ_ADDR");
271 host->result = -EIO; 277 kw_i2c_do_stop(host, -EIO);
272 goto stop;
273 } 278 }
274 if ((ack & KW_I2C_STAT_LAST_AAK) == 0) { 279 if ((ack & KW_I2C_STAT_LAST_AAK) == 0) {
275 host->result = -ENODEV; 280 host->result = -ENXIO;
276 DBG_LOW("KW: NAK on address\n");
277 host->state = state_stop; 281 host->state = state_stop;
278 return; 282 DBG_LOW("KW: NAK on address\n");
279 } else { 283 } else {
280 if (host->len == 0) { 284 if (host->len == 0)
281 kw_write_reg(reg_isr, KW_I2C_IRQ_ADDR); 285 kw_i2c_do_stop(host, 0);
282 goto stop; 286 else if (host->rw) {
283 }
284 if (host->rw) {
285 host->state = state_read; 287 host->state = state_read;
286 if (host->len > 1) 288 if (host->len > 1)
287 kw_write_reg(reg_control, 289 kw_write_reg(reg_control,
@@ -308,25 +310,19 @@ static void kw_i2c_handle_interrupt(struct pmac_i2c_host_kw *host, u8 isr)
308 ack = kw_read_reg(reg_status); 310 ack = kw_read_reg(reg_status);
309 if ((ack & KW_I2C_STAT_LAST_AAK) == 0) { 311 if ((ack & KW_I2C_STAT_LAST_AAK) == 0) {
310 DBG_LOW("KW: nack on data write\n"); 312 DBG_LOW("KW: nack on data write\n");
311 host->result = -EIO; 313 host->result = -EFBIG;
312 goto stop; 314 host->state = state_stop;
313 } else if (host->len) { 315 } else if (host->len) {
314 kw_write_reg(reg_data, *(host->data++)); 316 kw_write_reg(reg_data, *(host->data++));
315 host->len--; 317 host->len--;
316 } else { 318 } else
317 kw_write_reg(reg_control, KW_I2C_CTL_STOP); 319 kw_i2c_do_stop(host, 0);
318 host->state = state_stop;
319 host->result = 0;
320 }
321 kw_write_reg(reg_isr, KW_I2C_IRQ_DATA);
322 } else { 320 } else {
323 kw_write_reg(reg_isr, KW_I2C_IRQ_DATA);
324 WRONG_STATE("KW_I2C_IRQ_DATA"); 321 WRONG_STATE("KW_I2C_IRQ_DATA");
325 if (host->state != state_stop) { 322 if (host->state != state_stop)
326 host->result = -EIO; 323 kw_i2c_do_stop(host, -EIO);
327 goto stop;
328 }
329 } 324 }
325 kw_write_reg(reg_isr, KW_I2C_IRQ_DATA);
330 } 326 }
331 327
332 if (isr & KW_I2C_IRQ_STOP) { 328 if (isr & KW_I2C_IRQ_STOP) {
@@ -340,14 +336,10 @@ static void kw_i2c_handle_interrupt(struct pmac_i2c_host_kw *host, u8 isr)
340 complete(&host->complete); 336 complete(&host->complete);
341 } 337 }
342 338
339 /* Below should only happen in manual mode which we don't use ... */
343 if (isr & KW_I2C_IRQ_START) 340 if (isr & KW_I2C_IRQ_START)
344 kw_write_reg(reg_isr, KW_I2C_IRQ_START); 341 kw_write_reg(reg_isr, KW_I2C_IRQ_START);
345 342
346 return;
347 stop:
348 kw_write_reg(reg_control, KW_I2C_CTL_STOP);
349 host->state = state_stop;
350 return;
351} 343}
352 344
353/* Interrupt handler */ 345/* Interrupt handler */
@@ -544,11 +536,11 @@ static struct pmac_i2c_host_kw *__init kw_i2c_host_init(struct device_node *np)
544 return NULL; 536 return NULL;
545 } 537 }
546 538
547 /* Make sure IRA is disabled */ 539 /* Make sure IRQ is disabled */
548 kw_write_reg(reg_ier, 0); 540 kw_write_reg(reg_ier, 0);
549 541
550 /* Request chip interrupt */ 542 /* Request chip interrupt */
551 if (request_irq(host->irq, kw_i2c_irq, SA_SHIRQ, "keywest i2c", host)) 543 if (request_irq(host->irq, kw_i2c_irq, 0, "keywest i2c", host))
552 host->irq = NO_IRQ; 544 host->irq = NO_IRQ;
553 545
554 printk(KERN_INFO "KeyWest i2c @0x%08x irq %d %s\n", 546 printk(KERN_INFO "KeyWest i2c @0x%08x irq %d %s\n",
@@ -1165,6 +1157,7 @@ EXPORT_SYMBOL_GPL(pmac_i2c_xfer);
1165/* some quirks for platform function decoding */ 1157/* some quirks for platform function decoding */
1166enum { 1158enum {
1167 pmac_i2c_quirk_invmask = 0x00000001u, 1159 pmac_i2c_quirk_invmask = 0x00000001u,
1160 pmac_i2c_quirk_skip = 0x00000002u,
1168}; 1161};
1169 1162
1170static void pmac_i2c_devscan(void (*callback)(struct device_node *dev, 1163static void pmac_i2c_devscan(void (*callback)(struct device_node *dev,
@@ -1180,6 +1173,15 @@ static void pmac_i2c_devscan(void (*callback)(struct device_node *dev,
1180 /* XXX Study device-tree's & apple drivers are get the quirks 1173 /* XXX Study device-tree's & apple drivers are get the quirks
1181 * right ! 1174 * right !
1182 */ 1175 */
1176 /* Workaround: It seems that running the clockspreading
1177 * properties on the eMac will cause lockups during boot.
1178 * The machine seems to work fine without that. So for now,
1179 * let's make sure i2c-hwclock doesn't match about "imic"
1180 * clocks and we'll figure out if we really need to do
1181 * something special about those later.
1182 */
1183 { "i2c-hwclock", "imic5002", pmac_i2c_quirk_skip },
1184 { "i2c-hwclock", "imic5003", pmac_i2c_quirk_skip },
1183 { "i2c-hwclock", NULL, pmac_i2c_quirk_invmask }, 1185 { "i2c-hwclock", NULL, pmac_i2c_quirk_invmask },
1184 { "i2c-cpu-voltage", NULL, 0}, 1186 { "i2c-cpu-voltage", NULL, 0},
1185 { "temp-monitor", NULL, 0 }, 1187 { "temp-monitor", NULL, 0 },
@@ -1206,6 +1208,8 @@ static void pmac_i2c_devscan(void (*callback)(struct device_node *dev,
1206 if (p->compatible && 1208 if (p->compatible &&
1207 !device_is_compatible(np, p->compatible)) 1209 !device_is_compatible(np, p->compatible))
1208 continue; 1210 continue;
1211 if (p->quirks & pmac_i2c_quirk_skip)
1212 break;
1209 callback(np, p->quirks); 1213 callback(np, p->quirks);
1210 break; 1214 break;
1211 } 1215 }
diff --git a/arch/powerpc/platforms/powermac/pci.c b/arch/powerpc/platforms/powermac/pci.c
index f5d8d15d74fa..ea179afea632 100644
--- a/arch/powerpc/platforms/powermac/pci.c
+++ b/arch/powerpc/platforms/powermac/pci.c
@@ -1097,7 +1097,7 @@ pmac_pci_enable_device_hook(struct pci_dev *dev, int initial)
1097 * (iBook second controller) 1097 * (iBook second controller)
1098 */ 1098 */
1099 if (dev->vendor == PCI_VENDOR_ID_APPLE 1099 if (dev->vendor == PCI_VENDOR_ID_APPLE
1100 && (dev->class == ((PCI_CLASS_SERIAL_USB << 8) | 0x10)) 1100 && dev->class == PCI_CLASS_SERIAL_USB_OHCI
1101 && !node) { 1101 && !node) {
1102 printk(KERN_INFO "Apple USB OHCI %s disabled by firmware\n", 1102 printk(KERN_INFO "Apple USB OHCI %s disabled by firmware\n",
1103 pci_name(dev)); 1103 pci_name(dev));
diff --git a/arch/powerpc/platforms/powermac/pfunc_core.c b/arch/powerpc/platforms/powermac/pfunc_core.c
index 4baa75b1d36f..f08173b0f065 100644
--- a/arch/powerpc/platforms/powermac/pfunc_core.c
+++ b/arch/powerpc/platforms/powermac/pfunc_core.c
@@ -11,6 +11,7 @@
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/spinlock.h> 12#include <linux/spinlock.h>
13#include <linux/module.h> 13#include <linux/module.h>
14#include <linux/mutex.h>
14 15
15#include <asm/semaphore.h> 16#include <asm/semaphore.h>
16#include <asm/prom.h> 17#include <asm/prom.h>
@@ -546,6 +547,7 @@ struct pmf_device {
546 547
547static LIST_HEAD(pmf_devices); 548static LIST_HEAD(pmf_devices);
548static spinlock_t pmf_lock = SPIN_LOCK_UNLOCKED; 549static spinlock_t pmf_lock = SPIN_LOCK_UNLOCKED;
550static DEFINE_MUTEX(pmf_irq_mutex);
549 551
550static void pmf_release_device(struct kref *kref) 552static void pmf_release_device(struct kref *kref)
551{ 553{
@@ -864,15 +866,17 @@ int pmf_register_irq_client(struct device_node *target,
864 866
865 spin_lock_irqsave(&pmf_lock, flags); 867 spin_lock_irqsave(&pmf_lock, flags);
866 func = __pmf_find_function(target, name, PMF_FLAGS_INT_GEN); 868 func = __pmf_find_function(target, name, PMF_FLAGS_INT_GEN);
867 if (func == NULL) { 869 if (func)
868 spin_unlock_irqrestore(&pmf_lock, flags); 870 func = pmf_get_function(func);
871 spin_unlock_irqrestore(&pmf_lock, flags);
872 if (func == NULL)
869 return -ENODEV; 873 return -ENODEV;
870 } 874 mutex_lock(&pmf_irq_mutex);
871 if (list_empty(&func->irq_clients)) 875 if (list_empty(&func->irq_clients))
872 func->dev->handlers->irq_enable(func); 876 func->dev->handlers->irq_enable(func);
873 list_add(&client->link, &func->irq_clients); 877 list_add(&client->link, &func->irq_clients);
874 client->func = func; 878 client->func = func;
875 spin_unlock_irqrestore(&pmf_lock, flags); 879 mutex_unlock(&pmf_irq_mutex);
876 880
877 return 0; 881 return 0;
878} 882}
@@ -881,16 +885,16 @@ EXPORT_SYMBOL_GPL(pmf_register_irq_client);
881void pmf_unregister_irq_client(struct pmf_irq_client *client) 885void pmf_unregister_irq_client(struct pmf_irq_client *client)
882{ 886{
883 struct pmf_function *func = client->func; 887 struct pmf_function *func = client->func;
884 unsigned long flags;
885 888
886 BUG_ON(func == NULL); 889 BUG_ON(func == NULL);
887 890
888 spin_lock_irqsave(&pmf_lock, flags); 891 mutex_lock(&pmf_irq_mutex);
889 client->func = NULL; 892 client->func = NULL;
890 list_del(&client->link); 893 list_del(&client->link);
891 if (list_empty(&func->irq_clients)) 894 if (list_empty(&func->irq_clients))
892 func->dev->handlers->irq_disable(func); 895 func->dev->handlers->irq_disable(func);
893 spin_unlock_irqrestore(&pmf_lock, flags); 896 mutex_unlock(&pmf_irq_mutex);
897 pmf_put_function(func);
894} 898}
895EXPORT_SYMBOL_GPL(pmf_unregister_irq_client); 899EXPORT_SYMBOL_GPL(pmf_unregister_irq_client);
896 900
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c
index 4d15e396655c..b9200fb07815 100644
--- a/arch/powerpc/platforms/powermac/setup.c
+++ b/arch/powerpc/platforms/powermac/setup.c
@@ -463,11 +463,23 @@ static int pmac_pm_finish(suspend_state_t state)
463 return 0; 463 return 0;
464} 464}
465 465
466static int pmac_pm_valid(suspend_state_t state)
467{
468 switch (state) {
469 case PM_SUSPEND_DISK:
470 return 1;
471 /* can't do any other states via generic mechanism yet */
472 default:
473 return 0;
474 }
475}
476
466static struct pm_ops pmac_pm_ops = { 477static struct pm_ops pmac_pm_ops = {
467 .pm_disk_mode = PM_DISK_SHUTDOWN, 478 .pm_disk_mode = PM_DISK_SHUTDOWN,
468 .prepare = pmac_pm_prepare, 479 .prepare = pmac_pm_prepare,
469 .enter = pmac_pm_enter, 480 .enter = pmac_pm_enter,
470 .finish = pmac_pm_finish, 481 .finish = pmac_pm_finish,
482 .valid = pmac_pm_valid,
471}; 483};
472 484
473#endif /* CONFIG_SOFTWARE_SUSPEND */ 485#endif /* CONFIG_SOFTWARE_SUSPEND */
diff --git a/arch/powerpc/platforms/pseries/eeh.c b/arch/powerpc/platforms/pseries/eeh.c
index 780fb27a0099..32eaddfa5470 100644
--- a/arch/powerpc/platforms/pseries/eeh.c
+++ b/arch/powerpc/platforms/pseries/eeh.c
@@ -957,8 +957,10 @@ static void eeh_remove_device(struct pci_dev *dev)
957 pci_addr_cache_remove_device(dev); 957 pci_addr_cache_remove_device(dev);
958 958
959 dn = pci_device_to_OF_node(dev); 959 dn = pci_device_to_OF_node(dev);
960 PCI_DN(dn)->pcidev = NULL; 960 if (PCI_DN(dn)->pcidev) {
961 pci_dev_put (dev); 961 PCI_DN(dn)->pcidev = NULL;
962 pci_dev_put (dev);
963 }
962} 964}
963 965
964void eeh_remove_bus_device(struct pci_dev *dev) 966void eeh_remove_bus_device(struct pci_dev *dev)
diff --git a/arch/powerpc/platforms/pseries/eeh_event.c b/arch/powerpc/platforms/pseries/eeh_event.c
index a1bda6f96fd1..40020c65c89e 100644
--- a/arch/powerpc/platforms/pseries/eeh_event.c
+++ b/arch/powerpc/platforms/pseries/eeh_event.c
@@ -118,7 +118,15 @@ int eeh_send_failure_event (struct device_node *dn,
118{ 118{
119 unsigned long flags; 119 unsigned long flags;
120 struct eeh_event *event; 120 struct eeh_event *event;
121 char *location;
121 122
123 if (!mem_init_done) {
124 printk(KERN_ERR "EEH: event during early boot not handled\n");
125 location = (char *) get_property(dn, "ibm,loc-code", NULL);
126 printk(KERN_ERR "EEH: device node = %s\n", dn->full_name);
127 printk(KERN_ERR "EEH: PCI location = %s\n", location);
128 return 1;
129 }
122 event = kmalloc(sizeof(*event), GFP_ATOMIC); 130 event = kmalloc(sizeof(*event), GFP_ATOMIC);
123 if (event == NULL) { 131 if (event == NULL) {
124 printk (KERN_ERR "EEH: out of memory, event not handled\n"); 132 printk (KERN_ERR "EEH: out of memory, event not handled\n");
diff --git a/arch/powerpc/platforms/pseries/rtasd.c b/arch/powerpc/platforms/pseries/rtasd.c
index fcc4d561a236..e0000ce769e5 100644
--- a/arch/powerpc/platforms/pseries/rtasd.c
+++ b/arch/powerpc/platforms/pseries/rtasd.c
@@ -488,7 +488,7 @@ static int __init rtas_init(void)
488 /* No RTAS */ 488 /* No RTAS */
489 if (rtas_token("event-scan") == RTAS_UNKNOWN_SERVICE) { 489 if (rtas_token("event-scan") == RTAS_UNKNOWN_SERVICE) {
490 printk(KERN_INFO "rtasd: no event-scan on system\n"); 490 printk(KERN_INFO "rtasd: no event-scan on system\n");
491 return 1; 491 return -ENODEV;
492 } 492 }
493 493
494 entry = create_proc_entry("ppc64/rtas/error_log", S_IRUSR, NULL); 494 entry = create_proc_entry("ppc64/rtas/error_log", S_IRUSR, NULL);
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index 5eb55ef1c91c..5f79f01c44f2 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -255,7 +255,7 @@ static int __init pSeries_init_panel(void)
255{ 255{
256 /* Manually leave the kernel version on the panel. */ 256 /* Manually leave the kernel version on the panel. */
257 ppc_md.progress("Linux ppc64\n", 0); 257 ppc_md.progress("Linux ppc64\n", 0);
258 ppc_md.progress(system_utsname.version, 0); 258 ppc_md.progress(system_utsname.release, 0);
259 259
260 return 0; 260 return 0;
261} 261}
diff --git a/arch/powerpc/sysdev/dart_iommu.c b/arch/powerpc/sysdev/dart_iommu.c
index 61d317428610..38087bd6e3cf 100644
--- a/arch/powerpc/sysdev/dart_iommu.c
+++ b/arch/powerpc/sysdev/dart_iommu.c
@@ -49,6 +49,7 @@
49 49
50#include "dart.h" 50#include "dart.h"
51 51
52extern int iommu_is_off;
52extern int iommu_force_on; 53extern int iommu_force_on;
53 54
54/* Physical base address and size of the DART table */ 55/* Physical base address and size of the DART table */
@@ -329,10 +330,17 @@ void iommu_init_early_dart(void)
329 330
330void __init alloc_dart_table(void) 331void __init alloc_dart_table(void)
331{ 332{
332 /* Only reserve DART space if machine has more than 2GB of RAM 333 /* Only reserve DART space if machine has more than 1GB of RAM
333 * or if requested with iommu=on on cmdline. 334 * or if requested with iommu=on on cmdline.
335 *
336 * 1GB of RAM is picked as limit because some default devices
337 * (i.e. Airport Extreme) have 30 bit address range limits.
334 */ 338 */
335 if (lmb_end_of_DRAM() <= 0x80000000ull && !iommu_force_on) 339
340 if (iommu_is_off)
341 return;
342
343 if (!iommu_force_on && lmb_end_of_DRAM() <= 0x40000000ull)
336 return; 344 return;
337 345
338 /* 512 pages (2MB) is max DART tablesize. */ 346 /* 512 pages (2MB) is max DART tablesize. */
diff --git a/arch/ppc/kernel/asm-offsets.c b/arch/ppc/kernel/asm-offsets.c
index 77e4dc780f8c..2f5c5e157617 100644
--- a/arch/ppc/kernel/asm-offsets.c
+++ b/arch/ppc/kernel/asm-offsets.c
@@ -134,6 +134,7 @@ main(void)
134 DEFINE(TI_TASK, offsetof(struct thread_info, task)); 134 DEFINE(TI_TASK, offsetof(struct thread_info, task));
135 DEFINE(TI_EXECDOMAIN, offsetof(struct thread_info, exec_domain)); 135 DEFINE(TI_EXECDOMAIN, offsetof(struct thread_info, exec_domain));
136 DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); 136 DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
137 DEFINE(TI_LOCAL_FLAGS, offsetof(struct thread_info, local_flags));
137 DEFINE(TI_CPU, offsetof(struct thread_info, cpu)); 138 DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
138 DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count)); 139 DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count));
139 140
diff --git a/arch/ppc/kernel/entry.S b/arch/ppc/kernel/entry.S
index 5891ecbdc703..1adc9145516f 100644
--- a/arch/ppc/kernel/entry.S
+++ b/arch/ppc/kernel/entry.S
@@ -128,29 +128,26 @@ transfer_to_handler:
128 stw r12,4(r11) 128 stw r12,4(r11)
129#endif 129#endif
130 b 3f 130 b 3f
131
1312: /* if from kernel, check interrupted DOZE/NAP mode and 1322: /* if from kernel, check interrupted DOZE/NAP mode and
132 * check for stack overflow 133 * check for stack overflow
133 */ 134 */
135 lwz r9,THREAD_INFO-THREAD(r12)
136 cmplw r1,r9 /* if r1 <= current->thread_info */
137 ble- stack_ovf /* then the kernel stack overflowed */
1385:
134#ifdef CONFIG_6xx 139#ifdef CONFIG_6xx
135 mfspr r11,SPRN_HID0 140 tophys(r9,r9) /* check local flags */
136 mtcr r11 141 lwz r12,TI_LOCAL_FLAGS(r9)
137BEGIN_FTR_SECTION 142 mtcrf 0x01,r12
138 bt- 8,4f /* Check DOZE */ 143 bt- 31-TLF_NAPPING,4f
139END_FTR_SECTION_IFSET(CPU_FTR_CAN_DOZE)
140BEGIN_FTR_SECTION
141 bt- 9,4f /* Check NAP */
142END_FTR_SECTION_IFSET(CPU_FTR_CAN_NAP)
143#endif /* CONFIG_6xx */ 144#endif /* CONFIG_6xx */
144 .globl transfer_to_handler_cont 145 .globl transfer_to_handler_cont
145transfer_to_handler_cont: 146transfer_to_handler_cont:
146 lwz r11,THREAD_INFO-THREAD(r12)
147 cmplw r1,r11 /* if r1 <= current->thread_info */
148 ble- stack_ovf /* then the kernel stack overflowed */
1493: 1473:
150 mflr r9 148 mflr r9
151 lwz r11,0(r9) /* virtual address of handler */ 149 lwz r11,0(r9) /* virtual address of handler */
152 lwz r9,4(r9) /* where to go when done */ 150 lwz r9,4(r9) /* where to go when done */
153 FIX_SRR1(r10,r12)
154 mtspr SPRN_SRR0,r11 151 mtspr SPRN_SRR0,r11
155 mtspr SPRN_SRR1,r10 152 mtspr SPRN_SRR1,r10
156 mtlr r9 153 mtlr r9
@@ -158,7 +155,9 @@ transfer_to_handler_cont:
158 RFI /* jump to handler, enable MMU */ 155 RFI /* jump to handler, enable MMU */
159 156
160#ifdef CONFIG_6xx 157#ifdef CONFIG_6xx
1614: b power_save_6xx_restore 1584: rlwinm r12,r12,0,~_TLF_NAPPING
159 stw r12,TI_LOCAL_FLAGS(r9)
160 b power_save_6xx_restore
162#endif 161#endif
163 162
164/* 163/*
@@ -167,10 +166,10 @@ transfer_to_handler_cont:
167 */ 166 */
168stack_ovf: 167stack_ovf:
169 /* sometimes we use a statically-allocated stack, which is OK. */ 168 /* sometimes we use a statically-allocated stack, which is OK. */
170 lis r11,_end@h 169 lis r12,_end@h
171 ori r11,r11,_end@l 170 ori r12,r12,_end@l
172 cmplw r1,r11 171 cmplw r1,r12
173 ble 3b /* r1 <= &_end is OK */ 172 ble 5b /* r1 <= &_end is OK */
174 SAVE_NVGPRS(r11) 173 SAVE_NVGPRS(r11)
175 addi r3,r1,STACK_FRAME_OVERHEAD 174 addi r3,r1,STACK_FRAME_OVERHEAD
176 lis r1,init_thread_union@ha 175 lis r1,init_thread_union@ha
diff --git a/arch/ppc/kernel/head_8xx.S b/arch/ppc/kernel/head_8xx.S
index ec53c7d65f2b..7a2f20583be4 100644
--- a/arch/ppc/kernel/head_8xx.S
+++ b/arch/ppc/kernel/head_8xx.S
@@ -355,9 +355,7 @@ InstructionTLBMiss:
355 355
356 . = 0x1200 356 . = 0x1200
357DataStoreTLBMiss: 357DataStoreTLBMiss:
358#ifdef CONFIG_8xx_CPU6
359 stw r3, 8(r0) 358 stw r3, 8(r0)
360#endif
361 DO_8xx_CPU6(0x3f80, r3) 359 DO_8xx_CPU6(0x3f80, r3)
362 mtspr SPRN_M_TW, r10 /* Save a couple of working registers */ 360 mtspr SPRN_M_TW, r10 /* Save a couple of working registers */
363 mfcr r10 361 mfcr r10
@@ -417,9 +415,7 @@ DataStoreTLBMiss:
417 lwz r11, 0(r0) 415 lwz r11, 0(r0)
418 mtcr r11 416 mtcr r11
419 lwz r11, 4(r0) 417 lwz r11, 4(r0)
420#ifdef CONFIG_8xx_CPU6
421 lwz r3, 8(r0) 418 lwz r3, 8(r0)
422#endif
423 rfi 419 rfi
424 420
425/* This is an instruction TLB error on the MPC8xx. This could be due 421/* This is an instruction TLB error on the MPC8xx. This could be due
diff --git a/arch/ppc/kernel/ppc_ksyms.c b/arch/ppc/kernel/ppc_ksyms.c
index 865ba74991a9..b250b1b539b6 100644
--- a/arch/ppc/kernel/ppc_ksyms.c
+++ b/arch/ppc/kernel/ppc_ksyms.c
@@ -94,6 +94,7 @@ EXPORT_SYMBOL(strcat);
94EXPORT_SYMBOL(strlen); 94EXPORT_SYMBOL(strlen);
95EXPORT_SYMBOL(strcmp); 95EXPORT_SYMBOL(strcmp);
96EXPORT_SYMBOL(strcasecmp); 96EXPORT_SYMBOL(strcasecmp);
97EXPORT_SYMBOL(strncasecmp);
97EXPORT_SYMBOL(__div64_32); 98EXPORT_SYMBOL(__div64_32);
98 99
99EXPORT_SYMBOL(csum_partial); 100EXPORT_SYMBOL(csum_partial);
diff --git a/arch/ppc/platforms/4xx/ocotea.c b/arch/ppc/platforms/4xx/ocotea.c
index f841972f1fa9..554776d4b8ac 100644
--- a/arch/ppc/platforms/4xx/ocotea.c
+++ b/arch/ppc/platforms/4xx/ocotea.c
@@ -331,7 +331,7 @@ static void __init ocotea_init(void)
331void __init platform_init(unsigned long r3, unsigned long r4, 331void __init platform_init(unsigned long r3, unsigned long r4,
332 unsigned long r5, unsigned long r6, unsigned long r7) 332 unsigned long r5, unsigned long r6, unsigned long r7)
333{ 333{
334 ibm44x_platform_init(r3, r4, r5, r6, r7); 334 ibm440gx_platform_init(r3, r4, r5, r6, r7);
335 335
336 ppc_md.setup_arch = ocotea_setup_arch; 336 ppc_md.setup_arch = ocotea_setup_arch;
337 ppc_md.show_cpuinfo = ocotea_show_cpuinfo; 337 ppc_md.show_cpuinfo = ocotea_show_cpuinfo;
diff --git a/arch/ppc/platforms/mpc8272ads_setup.c b/arch/ppc/platforms/mpc8272ads_setup.c
index bc9b94f77e39..abb7154de2c7 100644
--- a/arch/ppc/platforms/mpc8272ads_setup.c
+++ b/arch/ppc/platforms/mpc8272ads_setup.c
@@ -26,11 +26,35 @@
26#include <asm/irq.h> 26#include <asm/irq.h>
27#include <asm/ppc_sys.h> 27#include <asm/ppc_sys.h>
28#include <asm/ppcboot.h> 28#include <asm/ppcboot.h>
29#include <linux/fs_uart_pd.h>
29 30
30#include "pq2ads_pd.h" 31#include "pq2ads_pd.h"
31 32
32static void init_fcc1_ioports(void); 33static void init_fcc1_ioports(void);
33static void init_fcc2_ioports(void); 34static void init_fcc2_ioports(void);
35static void init_scc1_uart_ioports(void);
36static void init_scc4_uart_ioports(void);
37
38static struct fs_uart_platform_info mpc8272_uart_pdata[] = {
39 [fsid_scc1_uart] = {
40 .init_ioports = init_scc1_uart_ioports,
41 .fs_no = fsid_scc1_uart,
42 .brg = 1,
43 .tx_num_fifo = 4,
44 .tx_buf_size = 32,
45 .rx_num_fifo = 4,
46 .rx_buf_size = 32,
47 },
48 [fsid_scc4_uart] = {
49 .init_ioports = init_scc4_uart_ioports,
50 .fs_no = fsid_scc4_uart,
51 .brg = 4,
52 .tx_num_fifo = 4,
53 .tx_buf_size = 32,
54 .rx_num_fifo = 4,
55 .rx_buf_size = 32,
56 },
57};
34 58
35static struct fs_mii_bus_info mii_bus_info = { 59static struct fs_mii_bus_info mii_bus_info = {
36 .method = fsmii_bitbang, 60 .method = fsmii_bitbang,
@@ -201,12 +225,65 @@ static void __init mpc8272ads_fixup_enet_pdata(struct platform_device *pdev,
201 } 225 }
202} 226}
203 227
228static void mpc8272ads_fixup_uart_pdata(struct platform_device *pdev,
229 int idx)
230{
231 bd_t *bd = (bd_t *) __res;
232 struct fs_uart_platform_info *pinfo;
233 int num = ARRAY_SIZE(mpc8272_uart_pdata);
234 int id = fs_uart_id_scc2fsid(idx);
235
236 /* no need to alter anything if console */
237 if ((id <= num) && (!pdev->dev.platform_data)) {
238 pinfo = &mpc8272_uart_pdata[id];
239 pinfo->uart_clk = bd->bi_intfreq;
240 pdev->dev.platform_data = pinfo;
241 }
242}
243
244static void init_scc1_uart_ioports(void)
245{
246 cpm2_map_t* immap = ioremap(CPM_MAP_ADDR, sizeof(cpm2_map_t));
247
248 /* SCC1 is only on port D */
249 setbits32(&immap->im_ioport.iop_ppard,0x00000003);
250 clrbits32(&immap->im_ioport.iop_psord,0x00000001);
251 setbits32(&immap->im_ioport.iop_psord,0x00000002);
252 clrbits32(&immap->im_ioport.iop_pdird,0x00000001);
253 setbits32(&immap->im_ioport.iop_pdird,0x00000002);
254
255 /* Wire BRG1 to SCC1 */
256 clrbits32(&immap->im_cpmux.cmx_scr,0x00ffffff);
257
258 iounmap(immap);
259}
260
261static void init_scc4_uart_ioports(void)
262{
263 cpm2_map_t* immap = ioremap(CPM_MAP_ADDR, sizeof(cpm2_map_t));
264
265 setbits32(&immap->im_ioport.iop_ppard,0x00000600);
266 clrbits32(&immap->im_ioport.iop_psord,0x00000600);
267 clrbits32(&immap->im_ioport.iop_pdird,0x00000200);
268 setbits32(&immap->im_ioport.iop_pdird,0x00000400);
269
270 /* Wire BRG4 to SCC4 */
271 clrbits32(&immap->im_cpmux.cmx_scr,0x000000ff);
272 setbits32(&immap->im_cpmux.cmx_scr,0x0000001b);
273
274 iounmap(immap);
275}
276
204static int mpc8272ads_platform_notify(struct device *dev) 277static int mpc8272ads_platform_notify(struct device *dev)
205{ 278{
206 static const struct platform_notify_dev_map dev_map[] = { 279 static const struct platform_notify_dev_map dev_map[] = {
207 { 280 {
208 .bus_id = "fsl-cpm-fcc", 281 .bus_id = "fsl-cpm-fcc",
209 .rtn = mpc8272ads_fixup_enet_pdata 282 .rtn = mpc8272ads_fixup_enet_pdata,
283 },
284 {
285 .bus_id = "fsl-cpm-scc:uart",
286 .rtn = mpc8272ads_fixup_uart_pdata,
210 }, 287 },
211 { 288 {
212 .bus_id = NULL 289 .bus_id = NULL
@@ -230,7 +307,44 @@ int __init mpc8272ads_init(void)
230 ppc_sys_device_enable(MPC82xx_CPM_FCC1); 307 ppc_sys_device_enable(MPC82xx_CPM_FCC1);
231 ppc_sys_device_enable(MPC82xx_CPM_FCC2); 308 ppc_sys_device_enable(MPC82xx_CPM_FCC2);
232 309
310 /* to be ready for console, let's attach pdata here */
311#ifdef CONFIG_SERIAL_CPM_SCC1
312 ppc_sys_device_setfunc(MPC82xx_CPM_SCC1, PPC_SYS_FUNC_UART);
313 ppc_sys_device_enable(MPC82xx_CPM_SCC1);
314
315#endif
316
317#ifdef CONFIG_SERIAL_CPM_SCC4
318 ppc_sys_device_setfunc(MPC82xx_CPM_SCC4, PPC_SYS_FUNC_UART);
319 ppc_sys_device_enable(MPC82xx_CPM_SCC4);
320#endif
321
322
233 return 0; 323 return 0;
234} 324}
235 325
326/*
327 To prevent confusion, console selection is gross:
328 by 0 assumed SCC1 and by 1 assumed SCC4
329 */
330struct platform_device* early_uart_get_pdev(int index)
331{
332 bd_t *bd = (bd_t *) __res;
333 struct fs_uart_platform_info *pinfo;
334
335 struct platform_device* pdev = NULL;
336 if(index) { /*assume SCC4 here*/
337 pdev = &ppc_sys_platform_devices[MPC82xx_CPM_SCC4];
338 pinfo = &mpc8272_uart_pdata[fsid_scc4_uart];
339 } else { /*over SCC1*/
340 pdev = &ppc_sys_platform_devices[MPC82xx_CPM_SCC1];
341 pinfo = &mpc8272_uart_pdata[fsid_scc1_uart];
342 }
343
344 pinfo->uart_clk = bd->bi_intfreq;
345 pdev->dev.platform_data = pinfo;
346 ppc_sys_fixup_mem_resource(pdev, CPM_MAP_ADDR);
347 return NULL;
348}
349
236arch_initcall(mpc8272ads_init); 350arch_initcall(mpc8272ads_init);
diff --git a/arch/ppc/platforms/mpc866ads_setup.c b/arch/ppc/platforms/mpc866ads_setup.c
index ac8fcc68afeb..d919dab61347 100644
--- a/arch/ppc/platforms/mpc866ads_setup.c
+++ b/arch/ppc/platforms/mpc866ads_setup.c
@@ -20,6 +20,7 @@
20#include <linux/device.h> 20#include <linux/device.h>
21 21
22#include <linux/fs_enet_pd.h> 22#include <linux/fs_enet_pd.h>
23#include <linux/fs_uart_pd.h>
23#include <linux/mii.h> 24#include <linux/mii.h>
24 25
25#include <asm/delay.h> 26#include <asm/delay.h>
@@ -37,6 +38,11 @@
37 38
38extern unsigned char __res[]; 39extern unsigned char __res[];
39 40
41static void setup_fec1_ioports(void);
42static void setup_scc1_ioports(void);
43static void setup_smc1_ioports(void);
44static void setup_smc2_ioports(void);
45
40static struct fs_mii_bus_info fec_mii_bus_info = { 46static struct fs_mii_bus_info fec_mii_bus_info = {
41 .method = fsmii_fec, 47 .method = fsmii_fec,
42 .id = 0, 48 .id = 0,
@@ -79,6 +85,28 @@ static struct fs_platform_info mpc8xx_scc_pdata = {
79 .phy_irq = -1, 85 .phy_irq = -1,
80 86
81 .bus_info = &scc_mii_bus_info, 87 .bus_info = &scc_mii_bus_info,
88
89};
90
91static struct fs_uart_platform_info mpc866_uart_pdata[] = {
92 [fsid_smc1_uart] = {
93 .brg = 1,
94 .fs_no = fsid_smc1_uart,
95 .init_ioports = setup_smc1_ioports,
96 .tx_num_fifo = 4,
97 .tx_buf_size = 32,
98 .rx_num_fifo = 4,
99 .rx_buf_size = 32,
100 },
101 [fsid_smc2_uart] = {
102 .brg = 2,
103 .fs_no = fsid_smc2_uart,
104 .init_ioports = setup_smc2_ioports,
105 .tx_num_fifo = 4,
106 .tx_buf_size = 32,
107 .rx_num_fifo = 4,
108 .rx_buf_size = 32,
109 },
82}; 110};
83 111
84void __init board_init(void) 112void __init board_init(void)
@@ -92,9 +120,12 @@ void __init board_init(void)
92 printk(KERN_CRIT "Could not remap BCSR1\n"); 120 printk(KERN_CRIT "Could not remap BCSR1\n");
93 return; 121 return;
94 } 122 }
123
95#ifdef CONFIG_SERIAL_CPM_SMC1 124#ifdef CONFIG_SERIAL_CPM_SMC1
96 cp->cp_simode &= ~(0xe0000000 >> 17); /* brg1 */ 125 cp->cp_simode &= ~(0xe0000000 >> 17); /* brg1 */
97 clrbits32(bcsr_io,(0x80000000 >> 7)); 126 clrbits32(bcsr_io,(0x80000000 >> 7));
127 cp->cp_smc[0].smc_smcm |= (SMCM_RX | SMCM_TX);
128 cp->cp_smc[0].smc_smcmr &= ~(SMCMR_REN | SMCMR_TEN);
98#else 129#else
99 setbits32(bcsr_io,(0x80000000 >> 7)); 130 setbits32(bcsr_io,(0x80000000 >> 7));
100 131
@@ -108,6 +139,8 @@ void __init board_init(void)
108 cp->cp_simode &= ~(0xe0000000 >> 1); 139 cp->cp_simode &= ~(0xe0000000 >> 1);
109 cp->cp_simode |= (0x20000000 >> 1); /* brg2 */ 140 cp->cp_simode |= (0x20000000 >> 1); /* brg2 */
110 clrbits32(bcsr_io,(0x80000000 >> 13)); 141 clrbits32(bcsr_io,(0x80000000 >> 13));
142 cp->cp_smc[1].smc_smcm |= (SMCM_RX | SMCM_TX);
143 cp->cp_smc[1].smc_smcmr &= ~(SMCMR_REN | SMCMR_TEN);
111#else 144#else
112 clrbits32(bcsr_io,(0x80000000 >> 13)); 145 clrbits32(bcsr_io,(0x80000000 >> 13));
113 cp->cp_pbpar &= ~(0x00000c00); 146 cp->cp_pbpar &= ~(0x00000c00);
@@ -232,6 +265,74 @@ static void mpc866ads_fixup_scc_enet_pdata(struct platform_device *pdev,
232 mpc866ads_fixup_enet_pdata(pdev, fsid_scc1 + pdev->id - 1); 265 mpc866ads_fixup_enet_pdata(pdev, fsid_scc1 + pdev->id - 1);
233} 266}
234 267
268static void setup_smc1_ioports(void)
269{
270 immap_t *immap = (immap_t *) IMAP_ADDR;
271 unsigned *bcsr_io;
272 unsigned int iobits = 0x000000c0;
273
274 bcsr_io = ioremap(BCSR1, sizeof(unsigned long));
275
276 if (bcsr_io == NULL) {
277 printk(KERN_CRIT "Could not remap BCSR1\n");
278 return;
279 }
280
281 clrbits32(bcsr_io,BCSR1_RS232EN_1);
282 iounmap(bcsr_io);
283
284 setbits32(&immap->im_cpm.cp_pbpar, iobits);
285 clrbits32(&immap->im_cpm.cp_pbdir, iobits);
286 clrbits16(&immap->im_cpm.cp_pbodr, iobits);
287
288}
289
290static void setup_smc2_ioports(void)
291{
292 immap_t *immap = (immap_t *) IMAP_ADDR;
293 unsigned *bcsr_io;
294 unsigned int iobits = 0x00000c00;
295
296 bcsr_io = ioremap(BCSR1, sizeof(unsigned long));
297
298 if (bcsr_io == NULL) {
299 printk(KERN_CRIT "Could not remap BCSR1\n");
300 return;
301 }
302
303 clrbits32(bcsr_io,BCSR1_RS232EN_2);
304
305 iounmap(bcsr_io);
306
307#ifndef CONFIG_SERIAL_CPM_ALT_SMC2
308 setbits32(&immap->im_cpm.cp_pbpar, iobits);
309 clrbits32(&immap->im_cpm.cp_pbdir, iobits);
310 clrbits16(&immap->im_cpm.cp_pbodr, iobits);
311#else
312 setbits16(&immap->im_ioport.iop_papar, iobits);
313 clrbits16(&immap->im_ioport.iop_padir, iobits);
314 clrbits16(&immap->im_ioport.iop_paodr, iobits);
315#endif
316
317}
318
319static void __init mpc866ads_fixup_uart_pdata(struct platform_device *pdev,
320 int idx)
321{
322 bd_t *bd = (bd_t *) __res;
323 struct fs_uart_platform_info *pinfo;
324 int num = ARRAY_SIZE(mpc866_uart_pdata);
325
326 int id = fs_uart_id_smc2fsid(idx);
327
328 /* no need to alter anything if console */
329 if ((id <= num) && (!pdev->dev.platform_data)) {
330 pinfo = &mpc866_uart_pdata[id];
331 pinfo->uart_clk = bd->bi_intfreq;
332 pdev->dev.platform_data = pinfo;
333 }
334}
335
235static int mpc866ads_platform_notify(struct device *dev) 336static int mpc866ads_platform_notify(struct device *dev)
236{ 337{
237 static const struct platform_notify_dev_map dev_map[] = { 338 static const struct platform_notify_dev_map dev_map[] = {
@@ -244,6 +345,10 @@ static int mpc866ads_platform_notify(struct device *dev)
244 .rtn = mpc866ads_fixup_scc_enet_pdata, 345 .rtn = mpc866ads_fixup_scc_enet_pdata,
245 }, 346 },
246 { 347 {
348 .bus_id = "fsl-cpm-smc:uart",
349 .rtn = mpc866ads_fixup_uart_pdata
350 },
351 {
247 .bus_id = NULL 352 .bus_id = NULL
248 } 353 }
249 }; 354 };
@@ -267,7 +372,42 @@ int __init mpc866ads_init(void)
267#endif 372#endif
268 ppc_sys_device_enable(MPC8xx_CPM_FEC1); 373 ppc_sys_device_enable(MPC8xx_CPM_FEC1);
269 374
375/* Since either of the uarts could be used as console, they need to ready */
376#ifdef CONFIG_SERIAL_CPM_SMC1
377 ppc_sys_device_enable(MPC8xx_CPM_SMC1);
378 ppc_sys_device_setfunc(MPC8xx_CPM_SMC1, PPC_SYS_FUNC_UART);
379#endif
380
381#ifdef CONFIG_SERIAL_CPM_SMC
382 ppc_sys_device_enable(MPC8xx_CPM_SMC2);
383 ppc_sys_device_setfunc(MPC8xx_CPM_SMC2, PPC_SYS_FUNC_UART);
384#endif
385
270 return 0; 386 return 0;
271} 387}
272 388
389/*
390 To prevent confusion, console selection is gross:
391 by 0 assumed SMC1 and by 1 assumed SMC2
392 */
393struct platform_device* early_uart_get_pdev(int index)
394{
395 bd_t *bd = (bd_t *) __res;
396 struct fs_uart_platform_info *pinfo;
397
398 struct platform_device* pdev = NULL;
399 if(index) { /*assume SMC2 here*/
400 pdev = &ppc_sys_platform_devices[MPC8xx_CPM_SMC2];
401 pinfo = &mpc866_uart_pdata[1];
402 } else { /*over SMC1*/
403 pdev = &ppc_sys_platform_devices[MPC8xx_CPM_SMC1];
404 pinfo = &mpc866_uart_pdata[0];
405 }
406
407 pinfo->uart_clk = bd->bi_intfreq;
408 pdev->dev.platform_data = pinfo;
409 ppc_sys_fixup_mem_resource(pdev, IMAP_ADDR);
410 return NULL;
411}
412
273arch_initcall(mpc866ads_init); 413arch_initcall(mpc866ads_init);
diff --git a/arch/ppc/platforms/mpc885ads_setup.c b/arch/ppc/platforms/mpc885ads_setup.c
index 50a99e5f7c68..4b88679cd31c 100644
--- a/arch/ppc/platforms/mpc885ads_setup.c
+++ b/arch/ppc/platforms/mpc885ads_setup.c
@@ -20,6 +20,7 @@
20#include <linux/device.h> 20#include <linux/device.h>
21 21
22#include <linux/fs_enet_pd.h> 22#include <linux/fs_enet_pd.h>
23#include <linux/fs_uart_pd.h>
23#include <linux/mii.h> 24#include <linux/mii.h>
24 25
25#include <asm/delay.h> 26#include <asm/delay.h>
@@ -35,9 +36,32 @@
35#include <asm/ppc_sys.h> 36#include <asm/ppc_sys.h>
36 37
37extern unsigned char __res[]; 38extern unsigned char __res[];
39static void setup_smc1_ioports(void);
40static void setup_smc2_ioports(void);
38 41
39static void __init mpc885ads_scc_phy_init(char); 42static void __init mpc885ads_scc_phy_init(char);
40 43
44static struct fs_uart_platform_info mpc885_uart_pdata[] = {
45 [fsid_smc1_uart] = {
46 .brg = 1,
47 .fs_no = fsid_smc1_uart,
48 .init_ioports = setup_smc1_ioports,
49 .tx_num_fifo = 4,
50 .tx_buf_size = 32,
51 .rx_num_fifo = 4,
52 .rx_buf_size = 32,
53 },
54 [fsid_smc2_uart] = {
55 .brg = 2,
56 .fs_no = fsid_smc2_uart,
57 .init_ioports = setup_smc2_ioports,
58 .tx_num_fifo = 4,
59 .tx_buf_size = 32,
60 .rx_num_fifo = 4,
61 .rx_buf_size = 32,
62 },
63};
64
41static struct fs_mii_bus_info fec_mii_bus_info = { 65static struct fs_mii_bus_info fec_mii_bus_info = {
42 .method = fsmii_fec, 66 .method = fsmii_fec,
43 .id = 0, 67 .id = 0,
@@ -116,6 +140,8 @@ void __init board_init(void)
116#ifdef CONFIG_SERIAL_CPM_SMC1 140#ifdef CONFIG_SERIAL_CPM_SMC1
117 cp->cp_simode &= ~(0xe0000000 >> 17); /* brg1 */ 141 cp->cp_simode &= ~(0xe0000000 >> 17); /* brg1 */
118 clrbits32(bcsr_io, BCSR1_RS232EN_1); 142 clrbits32(bcsr_io, BCSR1_RS232EN_1);
143 cp->cp_smc[0].smc_smcm |= (SMCM_RX | SMCM_TX);
144 cp->cp_smc[0].smc_smcmr &= ~(SMCMR_REN | SMCMR_TEN);
119#else 145#else
120 setbits32(bcsr_io,BCSR1_RS232EN_1); 146 setbits32(bcsr_io,BCSR1_RS232EN_1);
121 cp->cp_smc[0].smc_smcmr = 0; 147 cp->cp_smc[0].smc_smcmr = 0;
@@ -126,6 +152,8 @@ void __init board_init(void)
126 cp->cp_simode &= ~(0xe0000000 >> 1); 152 cp->cp_simode &= ~(0xe0000000 >> 1);
127 cp->cp_simode |= (0x20000000 >> 1); /* brg2 */ 153 cp->cp_simode |= (0x20000000 >> 1); /* brg2 */
128 clrbits32(bcsr_io,BCSR1_RS232EN_2); 154 clrbits32(bcsr_io,BCSR1_RS232EN_2);
155 cp->cp_smc[1].smc_smcm |= (SMCM_RX | SMCM_TX);
156 cp->cp_smc[1].smc_smcmr &= ~(SMCMR_REN | SMCMR_TEN);
129#else 157#else
130 setbits32(bcsr_io,BCSR1_RS232EN_2); 158 setbits32(bcsr_io,BCSR1_RS232EN_2);
131 cp->cp_smc[1].smc_smcmr = 0; 159 cp->cp_smc[1].smc_smcmr = 0;
@@ -343,6 +371,70 @@ static void mpc885ads_scc_phy_init(char phy_addr)
343 out_be32(&fecp->fec_mii_speed, 0); 371 out_be32(&fecp->fec_mii_speed, 0);
344} 372}
345 373
374static void setup_smc1_ioports(void)
375{
376 immap_t *immap = (immap_t *) IMAP_ADDR;
377 unsigned *bcsr_io;
378 unsigned int iobits = 0x000000c0;
379
380 bcsr_io = ioremap(BCSR1, sizeof(unsigned long));
381
382 if (bcsr_io == NULL) {
383 printk(KERN_CRIT "Could not remap BCSR1\n");
384 return;
385 }
386 clrbits32(bcsr_io,BCSR1_RS232EN_1);
387 iounmap(bcsr_io);
388
389 setbits32(&immap->im_cpm.cp_pbpar, iobits);
390 clrbits32(&immap->im_cpm.cp_pbdir, iobits);
391 clrbits16(&immap->im_cpm.cp_pbodr, iobits);
392}
393
394static void setup_smc2_ioports(void)
395{
396 immap_t *immap = (immap_t *) IMAP_ADDR;
397 unsigned *bcsr_io;
398 unsigned int iobits = 0x00000c00;
399
400 bcsr_io = ioremap(BCSR1, sizeof(unsigned long));
401
402 if (bcsr_io == NULL) {
403 printk(KERN_CRIT "Could not remap BCSR1\n");
404 return;
405 }
406 clrbits32(bcsr_io,BCSR1_RS232EN_2);
407 iounmap(bcsr_io);
408
409#ifndef CONFIG_SERIAL_CPM_ALT_SMC2
410 setbits32(&immap->im_cpm.cp_pbpar, iobits);
411 clrbits32(&immap->im_cpm.cp_pbdir, iobits);
412 clrbits16(&immap->im_cpm.cp_pbodr, iobits);
413#else
414 setbits16(&immap->im_ioport.iop_papar, iobits);
415 clrbits16(&immap->im_ioport.iop_padir, iobits);
416 clrbits16(&immap->im_ioport.iop_paodr, iobits);
417#endif
418}
419
420static void __init mpc885ads_fixup_uart_pdata(struct platform_device *pdev,
421 int idx)
422{
423 bd_t *bd = (bd_t *) __res;
424 struct fs_uart_platform_info *pinfo;
425 int num = ARRAY_SIZE(mpc885_uart_pdata);
426
427 int id = fs_uart_id_smc2fsid(idx);
428
429 /* no need to alter anything if console */
430 if ((id <= num) && (!pdev->dev.platform_data)) {
431 pinfo = &mpc885_uart_pdata[id];
432 pinfo->uart_clk = bd->bi_intfreq;
433 pdev->dev.platform_data = pinfo;
434 }
435}
436
437
346static int mpc885ads_platform_notify(struct device *dev) 438static int mpc885ads_platform_notify(struct device *dev)
347{ 439{
348 440
@@ -356,12 +448,17 @@ static int mpc885ads_platform_notify(struct device *dev)
356 .rtn = mpc885ads_fixup_scc_enet_pdata, 448 .rtn = mpc885ads_fixup_scc_enet_pdata,
357 }, 449 },
358 { 450 {
451 .bus_id = "fsl-cpm-smc:uart",
452 .rtn = mpc885ads_fixup_uart_pdata
453 },
454 {
359 .bus_id = NULL 455 .bus_id = NULL
360 } 456 }
361 }; 457 };
362 458
363 platform_notify_map(dev_map,dev); 459 platform_notify_map(dev_map,dev);
364 460
461 return 0;
365} 462}
366 463
367int __init mpc885ads_init(void) 464int __init mpc885ads_init(void)
@@ -383,7 +480,41 @@ int __init mpc885ads_init(void)
383 ppc_sys_device_enable(MPC8xx_CPM_FEC2); 480 ppc_sys_device_enable(MPC8xx_CPM_FEC2);
384#endif 481#endif
385 482
483#ifdef CONFIG_SERIAL_CPM_SMC1
484 ppc_sys_device_enable(MPC8xx_CPM_SMC1);
485 ppc_sys_device_setfunc(MPC8xx_CPM_SMC1, PPC_SYS_FUNC_UART);
486#endif
487
488#ifdef CONFIG_SERIAL_CPM_SMC2
489 ppc_sys_device_enable(MPC8xx_CPM_SMC2);
490 ppc_sys_device_setfunc(MPC8xx_CPM_SMC2, PPC_SYS_FUNC_UART);
491#endif
386 return 0; 492 return 0;
387} 493}
388 494
389arch_initcall(mpc885ads_init); 495arch_initcall(mpc885ads_init);
496
497/*
498 To prevent confusion, console selection is gross:
499 by 0 assumed SMC1 and by 1 assumed SMC2
500 */
501struct platform_device* early_uart_get_pdev(int index)
502{
503 bd_t *bd = (bd_t *) __res;
504 struct fs_uart_platform_info *pinfo;
505
506 struct platform_device* pdev = NULL;
507 if(index) { /*assume SMC2 here*/
508 pdev = &ppc_sys_platform_devices[MPC8xx_CPM_SMC2];
509 pinfo = &mpc885_uart_pdata[1];
510 } else { /*over SMC1*/
511 pdev = &ppc_sys_platform_devices[MPC8xx_CPM_SMC1];
512 pinfo = &mpc885_uart_pdata[0];
513 }
514
515 pinfo->uart_clk = bd->bi_intfreq;
516 pdev->dev.platform_data = pinfo;
517 ppc_sys_fixup_mem_resource(pdev, IMAP_ADDR);
518 return NULL;
519}
520
diff --git a/arch/ppc/platforms/pq2ads.c b/arch/ppc/platforms/pq2ads.c
index 3365fd788a7a..7fc2e02f5246 100644
--- a/arch/ppc/platforms/pq2ads.c
+++ b/arch/ppc/platforms/pq2ads.c
@@ -14,11 +14,40 @@
14 14
15#include <linux/init.h> 15#include <linux/init.h>
16 16
17#include <asm/io.h>
17#include <asm/mpc8260.h> 18#include <asm/mpc8260.h>
19#include <asm/cpm2.h>
20#include <asm/immap_cpm2.h>
18 21
19void __init 22void __init
20m82xx_board_setup(void) 23m82xx_board_setup(void)
21{ 24{
25 cpm2_map_t* immap = ioremap(CPM_MAP_ADDR, sizeof(cpm2_map_t));
26 u32 *bcsr = ioremap(BCSR_ADDR+4, sizeof(u32));
27
22 /* Enable the 2nd UART port */ 28 /* Enable the 2nd UART port */
23 *(volatile uint *)(BCSR_ADDR + 4) &= ~BCSR1_RS232_EN2; 29 clrbits32(bcsr, BCSR1_RS232_EN2);
30
31#ifdef CONFIG_SERIAL_CPM_SCC1
32 clrbits32((u32*)&immap->im_scc[0].scc_sccm, UART_SCCM_TX | UART_SCCM_RX);
33 clrbits32((u32*)&immap->im_scc[0].scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);
34#endif
35
36#ifdef CONFIG_SERIAL_CPM_SCC2
37 clrbits32((u32*)&immap->im_scc[1].scc_sccm, UART_SCCM_TX | UART_SCCM_RX);
38 clrbits32((u32*)&immap->im_scc[1].scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);
39#endif
40
41#ifdef CONFIG_SERIAL_CPM_SCC3
42 clrbits32((u32*)&immap->im_scc[2].scc_sccm, UART_SCCM_TX | UART_SCCM_RX);
43 clrbits32((u32*)&immap->im_scc[2].scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);
44#endif
45
46#ifdef CONFIG_SERIAL_CPM_SCC4
47 clrbits32((u32*)&immap->im_scc[3].scc_sccm, UART_SCCM_TX | UART_SCCM_RX);
48 clrbits32((u32*)&immap->im_scc[3].scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);
49#endif
50
51 iounmap(bcsr);
52 iounmap(immap);
24} 53}
diff --git a/arch/ppc/syslib/ibm440gx_common.c b/arch/ppc/syslib/ibm440gx_common.c
index a7dd55f1c63e..f6cc16888527 100644
--- a/arch/ppc/syslib/ibm440gx_common.c
+++ b/arch/ppc/syslib/ibm440gx_common.c
@@ -2,7 +2,7 @@
2 * PPC440GX system library 2 * PPC440GX system library
3 * 3 *
4 * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net> 4 * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
5 * Copyright (c) 2003, 2004 Zultys Technologies 5 * Copyright (c) 2003 - 2006 Zultys Technologies
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify it 7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the 8 * under the terms of the GNU General Public License as published by the
@@ -282,3 +282,14 @@ int ibm440gx_show_cpuinfo(struct seq_file *m){
282 return 0; 282 return 0;
283} 283}
284 284
285void __init ibm440gx_platform_init(unsigned long r3, unsigned long r4,
286 unsigned long r5, unsigned long r6,
287 unsigned long r7)
288{
289 /* Erratum 440_43 workaround, disable L1 cache parity checking */
290 if (!strcmp(cur_cpu_spec->cpu_name, "440GX Rev. C") ||
291 !strcmp(cur_cpu_spec->cpu_name, "440GX Rev. F"))
292 mtspr(SPRN_CCR1, mfspr(SPRN_CCR1) | CCR1_DPC);
293
294 ibm44x_platform_init(r3, r4, r5, r6, r7);
295}
diff --git a/arch/ppc/syslib/ibm440gx_common.h b/arch/ppc/syslib/ibm440gx_common.h
index a2ab9fab8e34..a03ec6022e8f 100644
--- a/arch/ppc/syslib/ibm440gx_common.h
+++ b/arch/ppc/syslib/ibm440gx_common.h
@@ -29,6 +29,10 @@
29void ibm440gx_get_clocks(struct ibm44x_clocks*, unsigned int sys_clk, 29void ibm440gx_get_clocks(struct ibm44x_clocks*, unsigned int sys_clk,
30 unsigned int ser_clk) __init; 30 unsigned int ser_clk) __init;
31 31
32/* common 440GX platform init */
33void ibm440gx_platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
34 unsigned long r6, unsigned long r7) __init;
35
32/* Enable L2 cache */ 36/* Enable L2 cache */
33void ibm440gx_l2c_enable(void) __init; 37void ibm440gx_l2c_enable(void) __init;
34 38
diff --git a/arch/ppc/syslib/mpc8xx_devices.c b/arch/ppc/syslib/mpc8xx_devices.c
index bd41ed83beb3..6f536383866e 100644
--- a/arch/ppc/syslib/mpc8xx_devices.c
+++ b/arch/ppc/syslib/mpc8xx_devices.c
@@ -170,12 +170,18 @@ struct platform_device ppc_sys_platform_devices[] = {
170 [MPC8xx_CPM_SMC1] = { 170 [MPC8xx_CPM_SMC1] = {
171 .name = "fsl-cpm-smc", 171 .name = "fsl-cpm-smc",
172 .id = 1, 172 .id = 1,
173 .num_resources = 2, 173 .num_resources = 3,
174 .resource = (struct resource[]) { 174 .resource = (struct resource[]) {
175 { 175 {
176 .name = "regs", 176 .name = "regs",
177 .start = 0xa82, 177 .start = 0xa80,
178 .end = 0xa91, 178 .end = 0xa8f,
179 .flags = IORESOURCE_MEM,
180 },
181 {
182 .name = "pram",
183 .start = 0x3e80,
184 .end = 0x3ebf,
179 .flags = IORESOURCE_MEM, 185 .flags = IORESOURCE_MEM,
180 }, 186 },
181 { 187 {
@@ -189,15 +195,22 @@ struct platform_device ppc_sys_platform_devices[] = {
189 [MPC8xx_CPM_SMC2] = { 195 [MPC8xx_CPM_SMC2] = {
190 .name = "fsl-cpm-smc", 196 .name = "fsl-cpm-smc",
191 .id = 2, 197 .id = 2,
192 .num_resources = 2, 198 .num_resources = 3,
193 .resource = (struct resource[]) { 199 .resource = (struct resource[]) {
194 { 200 {
195 .name = "regs", 201 .name = "regs",
196 .start = 0xa92, 202 .start = 0xa90,
197 .end = 0xaa1, 203 .end = 0xa9f,
198 .flags = IORESOURCE_MEM, 204 .flags = IORESOURCE_MEM,
199 }, 205 },
200 { 206 {
207 .name = "pram",
208 .start = 0x3f80,
209 .end = 0x3fbf,
210 .flags = IORESOURCE_MEM,
211
212 },
213 {
201 .name = "interrupt", 214 .name = "interrupt",
202 .start = MPC8xx_INT_SMC2, 215 .start = MPC8xx_INT_SMC2,
203 .end = MPC8xx_INT_SMC2, 216 .end = MPC8xx_INT_SMC2,
diff --git a/arch/ppc/syslib/ppc_sys.c b/arch/ppc/syslib/ppc_sys.c
index 60c724e11584..2d48018b71d9 100644
--- a/arch/ppc/syslib/ppc_sys.c
+++ b/arch/ppc/syslib/ppc_sys.c
@@ -109,9 +109,11 @@ ppc_sys_fixup_mem_resource(struct platform_device *pdev, phys_addr_t paddr)
109 int i; 109 int i;
110 for (i = 0; i < pdev->num_resources; i++) { 110 for (i = 0; i < pdev->num_resources; i++) {
111 struct resource *r = &pdev->resource[i]; 111 struct resource *r = &pdev->resource[i];
112 if ((r->flags & IORESOURCE_MEM) == IORESOURCE_MEM) { 112 if (((r->flags & IORESOURCE_MEM) == IORESOURCE_MEM) &&
113 ((r->flags & PPC_SYS_IORESOURCE_FIXUPPED) != PPC_SYS_IORESOURCE_FIXUPPED)) {
113 r->start += paddr; 114 r->start += paddr;
114 r->end += paddr; 115 r->end += paddr;
116 r->flags |= PPC_SYS_IORESOURCE_FIXUPPED;
115 } 117 }
116 } 118 }
117} 119}
@@ -156,12 +158,13 @@ void platform_notify_map(const struct platform_notify_dev_map *map,
156 while (map->bus_id != NULL) { 158 while (map->bus_id != NULL) {
157 idx = -1; 159 idx = -1;
158 s = strrchr(dev->bus_id, '.'); 160 s = strrchr(dev->bus_id, '.');
159 if (s != NULL) 161 if (s != NULL) {
160 idx = (int)simple_strtol(s + 1, NULL, 10); 162 idx = (int)simple_strtol(s + 1, NULL, 10);
161 else 163 len = s - dev->bus_id;
164 } else {
162 s = dev->bus_id; 165 s = dev->bus_id;
163 166 len = strlen(dev->bus_id);
164 len = s - dev->bus_id; 167 }
165 168
166 if (!strncmp(dev->bus_id, map->bus_id, len)) { 169 if (!strncmp(dev->bus_id, map->bus_id, len)) {
167 pdev = container_of(dev, struct platform_device, dev); 170 pdev = container_of(dev, struct platform_device, dev);
diff --git a/arch/ppc/syslib/pq2_devices.c b/arch/ppc/syslib/pq2_devices.c
index 0636aed7b827..8692d00c08c4 100644
--- a/arch/ppc/syslib/pq2_devices.c
+++ b/arch/ppc/syslib/pq2_devices.c
@@ -121,13 +121,13 @@ struct platform_device ppc_sys_platform_devices[] = {
121 .num_resources = 3, 121 .num_resources = 3,
122 .resource = (struct resource[]) { 122 .resource = (struct resource[]) {
123 { 123 {
124 .name = "scc_mem", 124 .name = "regs",
125 .start = 0x11A00, 125 .start = 0x11A00,
126 .end = 0x11A1F, 126 .end = 0x11A1F,
127 .flags = IORESOURCE_MEM, 127 .flags = IORESOURCE_MEM,
128 }, 128 },
129 { 129 {
130 .name = "scc_pram", 130 .name = "pram",
131 .start = 0x8000, 131 .start = 0x8000,
132 .end = 0x80ff, 132 .end = 0x80ff,
133 .flags = IORESOURCE_MEM, 133 .flags = IORESOURCE_MEM,
@@ -145,13 +145,13 @@ struct platform_device ppc_sys_platform_devices[] = {
145 .num_resources = 3, 145 .num_resources = 3,
146 .resource = (struct resource[]) { 146 .resource = (struct resource[]) {
147 { 147 {
148 .name = "scc_mem", 148 .name = "regs",
149 .start = 0x11A20, 149 .start = 0x11A20,
150 .end = 0x11A3F, 150 .end = 0x11A3F,
151 .flags = IORESOURCE_MEM, 151 .flags = IORESOURCE_MEM,
152 }, 152 },
153 { 153 {
154 .name = "scc_pram", 154 .name = "pram",
155 .start = 0x8100, 155 .start = 0x8100,
156 .end = 0x81ff, 156 .end = 0x81ff,
157 .flags = IORESOURCE_MEM, 157 .flags = IORESOURCE_MEM,
@@ -169,13 +169,13 @@ struct platform_device ppc_sys_platform_devices[] = {
169 .num_resources = 3, 169 .num_resources = 3,
170 .resource = (struct resource[]) { 170 .resource = (struct resource[]) {
171 { 171 {
172 .name = "scc_mem", 172 .name = "regs",
173 .start = 0x11A40, 173 .start = 0x11A40,
174 .end = 0x11A5F, 174 .end = 0x11A5F,
175 .flags = IORESOURCE_MEM, 175 .flags = IORESOURCE_MEM,
176 }, 176 },
177 { 177 {
178 .name = "scc_pram", 178 .name = "pram",
179 .start = 0x8200, 179 .start = 0x8200,
180 .end = 0x82ff, 180 .end = 0x82ff,
181 .flags = IORESOURCE_MEM, 181 .flags = IORESOURCE_MEM,
@@ -193,13 +193,13 @@ struct platform_device ppc_sys_platform_devices[] = {
193 .num_resources = 3, 193 .num_resources = 3,
194 .resource = (struct resource[]) { 194 .resource = (struct resource[]) {
195 { 195 {
196 .name = "scc_mem", 196 .name = "regs",
197 .start = 0x11A60, 197 .start = 0x11A60,
198 .end = 0x11A7F, 198 .end = 0x11A7F,
199 .flags = IORESOURCE_MEM, 199 .flags = IORESOURCE_MEM,
200 }, 200 },
201 { 201 {
202 .name = "scc_pram", 202 .name = "pram",
203 .start = 0x8300, 203 .start = 0x8300,
204 .end = 0x83ff, 204 .end = 0x83ff,
205 .flags = IORESOURCE_MEM, 205 .flags = IORESOURCE_MEM,
diff --git a/arch/ppc/syslib/pq2_sys.c b/arch/ppc/syslib/pq2_sys.c
index 75e64f1c144d..fee8948162b9 100644
--- a/arch/ppc/syslib/pq2_sys.c
+++ b/arch/ppc/syslib/pq2_sys.c
@@ -113,13 +113,13 @@ struct ppc_sys_spec ppc_sys_specs[] = {
113 .ppc_sys_name = "8248", 113 .ppc_sys_name = "8248",
114 .mask = 0x0000ff00, 114 .mask = 0x0000ff00,
115 .value = 0x00000c00, 115 .value = 0x00000c00,
116 .num_devices = 11, 116 .num_devices = 12,
117 .device_list = (enum ppc_sys_devices[]) 117 .device_list = (enum ppc_sys_devices[])
118 { 118 {
119 MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_SCC1, 119 MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_SCC1,
120 MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3, MPC82xx_CPM_SMC1, 120 MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3, MPC82xx_CPM_SCC4,
121 MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C, 121 MPC82xx_CPM_SMC1, MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI,
122 MPC82xx_CPM_USB, MPC82xx_SEC1, 122 MPC82xx_CPM_I2C, MPC82xx_CPM_USB, MPC82xx_SEC1,
123 }, 123 },
124 }, 124 },
125 { 125 {
@@ -139,13 +139,13 @@ struct ppc_sys_spec ppc_sys_specs[] = {
139 .ppc_sys_name = "8272", 139 .ppc_sys_name = "8272",
140 .mask = 0x0000ff00, 140 .mask = 0x0000ff00,
141 .value = 0x00000c00, 141 .value = 0x00000c00,
142 .num_devices = 11, 142 .num_devices = 12,
143 .device_list = (enum ppc_sys_devices[]) 143 .device_list = (enum ppc_sys_devices[])
144 { 144 {
145 MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_SCC1, 145 MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_SCC1,
146 MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3, MPC82xx_CPM_SMC1, 146 MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3, MPC82xx_CPM_SCC4,
147 MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C, 147 MPC82xx_CPM_SMC1, MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI,
148 MPC82xx_CPM_USB, MPC82xx_SEC1, 148 MPC82xx_CPM_I2C, MPC82xx_CPM_USB, MPC82xx_SEC1,
149 }, 149 },
150 }, 150 },
151 /* below is a list of the 8280 family of processors */ 151 /* below is a list of the 8280 family of processors */
diff --git a/arch/s390/appldata/appldata_base.c b/arch/s390/appldata/appldata_base.c
index 54d35c130907..9a22434a580c 100644
--- a/arch/s390/appldata/appldata_base.c
+++ b/arch/s390/appldata/appldata_base.c
@@ -652,7 +652,7 @@ appldata_cpu_notify(struct notifier_block *self,
652 return NOTIFY_OK; 652 return NOTIFY_OK;
653} 653}
654 654
655static struct notifier_block __devinitdata appldata_nb = { 655static struct notifier_block appldata_nb = {
656 .notifier_call = appldata_cpu_notify, 656 .notifier_call = appldata_cpu_notify,
657}; 657};
658 658
diff --git a/arch/s390/kernel/compat_signal.c b/arch/s390/kernel/compat_signal.c
index 5291b5f8788d..b4c815d8ef75 100644
--- a/arch/s390/kernel/compat_signal.c
+++ b/arch/s390/kernel/compat_signal.c
@@ -430,7 +430,7 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs * regs, size_t frame_size)
430 430
431 /* This is the X/Open sanctioned signal stack switching. */ 431 /* This is the X/Open sanctioned signal stack switching. */
432 if (ka->sa.sa_flags & SA_ONSTACK) { 432 if (ka->sa.sa_flags & SA_ONSTACK) {
433 if (! on_sig_stack(sp)) 433 if (! sas_ss_flags(sp))
434 sp = current->sas_ss_sp + current->sas_ss_size; 434 sp = current->sas_ss_sp + current->sas_ss_size;
435 } 435 }
436 436
diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S
index 199da68bd7be..4d53b2739357 100644
--- a/arch/s390/kernel/compat_wrapper.S
+++ b/arch/s390/kernel/compat_wrapper.S
@@ -1608,3 +1608,53 @@ compat_sys_ppoll_wrapper:
1608sys_unshare_wrapper: 1608sys_unshare_wrapper:
1609 llgfr %r2,%r2 # unsigned long 1609 llgfr %r2,%r2 # unsigned long
1610 jg sys_unshare 1610 jg sys_unshare
1611
1612 .globl compat_sys_set_robust_list_wrapper
1613compat_sys_set_robust_list_wrapper:
1614 llgtr %r2,%r2 # struct compat_robust_list_head *
1615 llgfr %r3,%r3 # size_t
1616 jg compat_sys_set_robust_list
1617
1618 .globl compat_sys_get_robust_list_wrapper
1619compat_sys_get_robust_list_wrapper:
1620 lgfr %r2,%r2 # int
1621 llgtr %r3,%r3 # compat_uptr_t_t *
1622 llgtr %r4,%r4 # compat_size_t *
1623 jg compat_sys_get_robust_list
1624
1625 .globl sys_splice_wrapper
1626sys_splice_wrapper:
1627 lgfr %r2,%r2 # int
1628 llgtr %r3,%r3 # loff_t *
1629 lgfr %r4,%r4 # int
1630 llgtr %r5,%r5 # loff_t *
1631 llgfr %r6,%r6 # size_t
1632 llgf %r0,164(%r15) # unsigned int
1633 stg %r0,160(%r15)
1634 jg sys_splice
1635
1636 .globl sys_sync_file_range_wrapper
1637sys_sync_file_range_wrapper:
1638 lgfr %r2,%r2 # int
1639 sllg %r3,%r3,32 # get high word of 64bit loff_t
1640 or %r3,%r4 # get low word of 64bit loff_t
1641 sllg %r4,%r5,32 # get high word of 64bit loff_t
1642 or %r4,%r6 # get low word of 64bit loff_t
1643 llgf %r5,164(%r15) # unsigned int
1644 jg sys_sync_file_range
1645
1646 .globl sys_tee_wrapper
1647sys_tee_wrapper:
1648 lgfr %r2,%r2 # int
1649 lgfr %r3,%r3 # int
1650 llgfr %r4,%r4 # size_t
1651 llgfr %r5,%r5 # unsigned int
1652 jg sys_tee
1653
1654 .globl compat_sys_vmsplice_wrapper
1655compat_sys_vmsplice_wrapper:
1656 lgfr %r2,%r2 # int
1657 llgtr %r3,%r3 # compat_iovec *
1658 llgfr %r4,%r4 # unsigned int
1659 llgfr %r5,%r5 # unsigned int
1660 jg compat_sys_vmsplice
diff --git a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c
index 37dfe33dab73..8f36504075ed 100644
--- a/arch/s390/kernel/ptrace.c
+++ b/arch/s390/kernel/ptrace.c
@@ -734,7 +734,7 @@ asmlinkage void
734syscall_trace(struct pt_regs *regs, int entryexit) 734syscall_trace(struct pt_regs *regs, int entryexit)
735{ 735{
736 if (unlikely(current->audit_context) && entryexit) 736 if (unlikely(current->audit_context) && entryexit)
737 audit_syscall_exit(current, AUDITSC_RESULT(regs->gprs[2]), regs->gprs[2]); 737 audit_syscall_exit(AUDITSC_RESULT(regs->gprs[2]), regs->gprs[2]);
738 738
739 if (!test_thread_flag(TIF_SYSCALL_TRACE)) 739 if (!test_thread_flag(TIF_SYSCALL_TRACE))
740 goto out; 740 goto out;
@@ -761,8 +761,7 @@ syscall_trace(struct pt_regs *regs, int entryexit)
761 } 761 }
762 out: 762 out:
763 if (unlikely(current->audit_context) && !entryexit) 763 if (unlikely(current->audit_context) && !entryexit)
764 audit_syscall_entry(current, 764 audit_syscall_entry(test_thread_flag(TIF_31BIT)?AUDIT_ARCH_S390:AUDIT_ARCH_S390X,
765 test_thread_flag(TIF_31BIT)?AUDIT_ARCH_S390:AUDIT_ARCH_S390X,
766 regs->gprs[2], regs->orig_gpr2, regs->gprs[3], 765 regs->gprs[2], regs->orig_gpr2, regs->gprs[3],
767 regs->gprs[4], regs->gprs[5]); 766 regs->gprs[4], regs->gprs[5]);
768} 767}
diff --git a/arch/s390/kernel/signal.c b/arch/s390/kernel/signal.c
index ae1927e48cfb..d48cfc726b68 100644
--- a/arch/s390/kernel/signal.c
+++ b/arch/s390/kernel/signal.c
@@ -358,8 +358,9 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
358 } else { 358 } else {
359 regs->gprs[14] = (unsigned long) 359 regs->gprs[14] = (unsigned long)
360 frame->retcode | PSW_ADDR_AMODE; 360 frame->retcode | PSW_ADDR_AMODE;
361 err |= __put_user(S390_SYSCALL_OPCODE | __NR_rt_sigreturn, 361 if (__put_user(S390_SYSCALL_OPCODE | __NR_rt_sigreturn,
362 (u16 __user *)(frame->retcode)); 362 (u16 __user *)(frame->retcode)))
363 goto give_sigsegv;
363 } 364 }
364 365
365 /* Set up backchain. */ 366 /* Set up backchain. */
diff --git a/arch/s390/kernel/syscalls.S b/arch/s390/kernel/syscalls.S
index 2f56654da821..93be1d56c036 100644
--- a/arch/s390/kernel/syscalls.S
+++ b/arch/s390/kernel/syscalls.S
@@ -312,3 +312,9 @@ SYSCALL(sys_faccessat,sys_faccessat,sys_faccessat_wrapper) /* 300 */
312SYSCALL(sys_pselect6,sys_pselect6,compat_sys_pselect6_wrapper) 312SYSCALL(sys_pselect6,sys_pselect6,compat_sys_pselect6_wrapper)
313SYSCALL(sys_ppoll,sys_ppoll,compat_sys_ppoll_wrapper) 313SYSCALL(sys_ppoll,sys_ppoll,compat_sys_ppoll_wrapper)
314SYSCALL(sys_unshare,sys_unshare,sys_unshare_wrapper) 314SYSCALL(sys_unshare,sys_unshare,sys_unshare_wrapper)
315SYSCALL(sys_set_robust_list,sys_set_robust_list,compat_sys_set_robust_list_wrapper)
316SYSCALL(sys_get_robust_list,sys_get_robust_list,compat_sys_get_robust_list_wrapper)
317SYSCALL(sys_splice,sys_splice,sys_splice_wrapper)
318SYSCALL(sys_sync_file_range,sys_sync_file_range,sys_sync_file_range_wrapper)
319SYSCALL(sys_tee,sys_tee,sys_tee_wrapper)
320SYSCALL(sys_vmsplice,sys_vmsplice,compat_sys_vmsplice_wrapper)
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c
index fea043b69b91..2a6c6efb6865 100644
--- a/arch/s390/kernel/time.c
+++ b/arch/s390/kernel/time.c
@@ -249,18 +249,19 @@ static inline void stop_hz_timer(void)
249 unsigned long flags; 249 unsigned long flags;
250 unsigned long seq, next; 250 unsigned long seq, next;
251 __u64 timer, todval; 251 __u64 timer, todval;
252 int cpu = smp_processor_id();
252 253
253 if (sysctl_hz_timer != 0) 254 if (sysctl_hz_timer != 0)
254 return; 255 return;
255 256
256 cpu_set(smp_processor_id(), nohz_cpu_mask); 257 cpu_set(cpu, nohz_cpu_mask);
257 258
258 /* 259 /*
259 * Leave the clock comparator set up for the next timer 260 * Leave the clock comparator set up for the next timer
260 * tick if either rcu or a softirq is pending. 261 * tick if either rcu or a softirq is pending.
261 */ 262 */
262 if (rcu_pending(smp_processor_id()) || local_softirq_pending()) { 263 if (rcu_needs_cpu(cpu) || local_softirq_pending()) {
263 cpu_clear(smp_processor_id(), nohz_cpu_mask); 264 cpu_clear(cpu, nohz_cpu_mask);
264 return; 265 return;
265 } 266 }
266 267
@@ -271,7 +272,7 @@ static inline void stop_hz_timer(void)
271 next = next_timer_interrupt(); 272 next = next_timer_interrupt();
272 do { 273 do {
273 seq = read_seqbegin_irqsave(&xtime_lock, flags); 274 seq = read_seqbegin_irqsave(&xtime_lock, flags);
274 timer = (__u64)(next - jiffies) + jiffies_64; 275 timer = ((__u64) next) - ((__u64) jiffies) + jiffies_64;
275 } while (read_seqretry_irqrestore(&xtime_lock, seq, flags)); 276 } while (read_seqretry_irqrestore(&xtime_lock, seq, flags));
276 todval = -1ULL; 277 todval = -1ULL;
277 /* Be careful about overflows. */ 278 /* Be careful about overflows. */
diff --git a/arch/s390/kernel/vmlinux.lds.S b/arch/s390/kernel/vmlinux.lds.S
index 9289face3027..9f34bb54c051 100644
--- a/arch/s390/kernel/vmlinux.lds.S
+++ b/arch/s390/kernel/vmlinux.lds.S
@@ -58,9 +58,11 @@ SECTIONS
58 . = ALIGN(4096); 58 . = ALIGN(4096);
59 .data.page_aligned : { *(.data.idt) } 59 .data.page_aligned : { *(.data.idt) }
60 60
61 . = ALIGN(32); 61 . = ALIGN(256);
62 .data.cacheline_aligned : { *(.data.cacheline_aligned) } 62 .data.cacheline_aligned : { *(.data.cacheline_aligned) }
63 63
64 . = ALIGN(256);
65 .data.read_mostly : { *(.data.read_mostly) }
64 _edata = .; /* End of data section */ 66 _edata = .; /* End of data section */
65 67
66 . = ALIGN(8192); /* init_task */ 68 . = ALIGN(8192); /* init_task */
diff --git a/arch/s390/mm/extmem.c b/arch/s390/mm/extmem.c
index a9566bcab682..9b11e3e20903 100644
--- a/arch/s390/mm/extmem.c
+++ b/arch/s390/mm/extmem.c
@@ -192,6 +192,7 @@ query_segment_type (struct dcss_segment *seg)
192 diag_cc = dcss_diag (DCSS_SEGEXT, qin, &dummy, &vmrc); 192 diag_cc = dcss_diag (DCSS_SEGEXT, qin, &dummy, &vmrc);
193 193
194 if (diag_cc > 1) { 194 if (diag_cc > 1) {
195 PRINT_WARN ("segment_type: diag returned error %ld\n", vmrc);
195 rc = dcss_diag_translate_rc (vmrc); 196 rc = dcss_diag_translate_rc (vmrc);
196 goto out_free; 197 goto out_free;
197 } 198 }
@@ -553,7 +554,7 @@ segment_save(char *name)
553 int endpfn = 0; 554 int endpfn = 0;
554 char cmd1[160]; 555 char cmd1[160];
555 char cmd2[80]; 556 char cmd2[80];
556 int i; 557 int i, response;
557 558
558 if (!MACHINE_IS_VM) 559 if (!MACHINE_IS_VM)
559 return; 560 return;
@@ -576,8 +577,20 @@ segment_save(char *name)
576 segtype_string[seg->range[i].start & 0xff]); 577 segtype_string[seg->range[i].start & 0xff]);
577 } 578 }
578 sprintf(cmd2, "SAVESEG %s", name); 579 sprintf(cmd2, "SAVESEG %s", name);
579 cpcmd(cmd1, NULL, 0, NULL); 580 response = 0;
580 cpcmd(cmd2, NULL, 0, NULL); 581 cpcmd(cmd1, NULL, 0, &response);
582 if (response) {
583 PRINT_ERR("segment_save: DEFSEG failed with response code %i\n",
584 response);
585 goto out;
586 }
587 cpcmd(cmd2, NULL, 0, &response);
588 if (response) {
589 PRINT_ERR("segment_save: SAVESEG failed with response code %i\n",
590 response);
591 goto out;
592 }
593out:
581 spin_unlock(&dcss_lock); 594 spin_unlock(&dcss_lock);
582} 595}
583 596
diff --git a/arch/sparc/kernel/ioport.c b/arch/sparc/kernel/ioport.c
index 460f72e640e6..f9ff29734848 100644
--- a/arch/sparc/kernel/ioport.c
+++ b/arch/sparc/kernel/ioport.c
@@ -274,6 +274,11 @@ void *sbus_alloc_consistent(struct sbus_dev *sdev, long len, u32 *dma_addrp)
274 if (mmu_map_dma_area(dma_addrp, va, res->start, len_total) != 0) 274 if (mmu_map_dma_area(dma_addrp, va, res->start, len_total) != 0)
275 goto err_noiommu; 275 goto err_noiommu;
276 276
277 /* Set the resource name, if known. */
278 if (sdev) {
279 res->name = sdev->prom_name;
280 }
281
277 return (void *)res->start; 282 return (void *)res->start;
278 283
279err_noiommu: 284err_noiommu:
diff --git a/arch/sparc/kernel/module.c b/arch/sparc/kernel/module.c
index 787d5f1347ec..598682f31ebf 100644
--- a/arch/sparc/kernel/module.c
+++ b/arch/sparc/kernel/module.c
@@ -113,6 +113,7 @@ int apply_relocate_add(Elf32_Shdr *sechdrs,
113 113
114 switch (ELF32_R_TYPE(rel[i].r_info)) { 114 switch (ELF32_R_TYPE(rel[i].r_info)) {
115 case R_SPARC_32: 115 case R_SPARC_32:
116 case R_SPARC_UA32:
116 location[0] = v >> 24; 117 location[0] = v >> 24;
117 location[1] = v >> 16; 118 location[1] = v >> 16;
118 location[2] = v >> 8; 119 location[2] = v >> 8;
diff --git a/arch/sparc/kernel/sparc_ksyms.c b/arch/sparc/kernel/sparc_ksyms.c
index ec1c9687d679..4b376fae752c 100644
--- a/arch/sparc/kernel/sparc_ksyms.c
+++ b/arch/sparc/kernel/sparc_ksyms.c
@@ -251,19 +251,9 @@ EXPORT_SYMBOL(__prom_getchild);
251EXPORT_SYMBOL(__prom_getsibling); 251EXPORT_SYMBOL(__prom_getsibling);
252 252
253/* sparc library symbols */ 253/* sparc library symbols */
254EXPORT_SYMBOL(memchr);
255EXPORT_SYMBOL(memscan); 254EXPORT_SYMBOL(memscan);
256EXPORT_SYMBOL(strlen); 255EXPORT_SYMBOL(strlen);
257EXPORT_SYMBOL(strnlen);
258EXPORT_SYMBOL(strcpy);
259EXPORT_SYMBOL(strncpy);
260EXPORT_SYMBOL(strcat);
261EXPORT_SYMBOL(strncat);
262EXPORT_SYMBOL(strcmp);
263EXPORT_SYMBOL(strncmp); 256EXPORT_SYMBOL(strncmp);
264EXPORT_SYMBOL(strchr);
265EXPORT_SYMBOL(strrchr);
266EXPORT_SYMBOL(strstr);
267EXPORT_SYMBOL(page_kernel); 257EXPORT_SYMBOL(page_kernel);
268 258
269/* Special internal versions of library functions. */ 259/* Special internal versions of library functions. */
@@ -317,6 +307,3 @@ EXPORT_SYMBOL(do_BUG);
317 307
318/* Sun Power Management Idle Handler */ 308/* Sun Power Management Idle Handler */
319EXPORT_SYMBOL(pm_idle); 309EXPORT_SYMBOL(pm_idle);
320
321/* Binfmt_misc needs this */
322EXPORT_SYMBOL(sys_close);
diff --git a/arch/sparc/kernel/systbls.S b/arch/sparc/kernel/systbls.S
index fbbec5e761c6..2856551bddf1 100644
--- a/arch/sparc/kernel/systbls.S
+++ b/arch/sparc/kernel/systbls.S
@@ -23,7 +23,7 @@ sys_call_table:
23/*10*/ .long sys_unlink, sunos_execv, sys_chdir, sys_chown16, sys_mknod 23/*10*/ .long sys_unlink, sunos_execv, sys_chdir, sys_chown16, sys_mknod
24/*15*/ .long sys_chmod, sys_lchown16, sparc_brk, sys_nis_syscall, sys_lseek 24/*15*/ .long sys_chmod, sys_lchown16, sparc_brk, sys_nis_syscall, sys_lseek
25/*20*/ .long sys_getpid, sys_capget, sys_capset, sys_setuid16, sys_getuid16 25/*20*/ .long sys_getpid, sys_capget, sys_capset, sys_setuid16, sys_getuid16
26/*25*/ .long sys_time, sys_ptrace, sys_alarm, sys_sigaltstack, sys_pause 26/*25*/ .long sys_vmsplice, sys_ptrace, sys_alarm, sys_sigaltstack, sys_pause
27/*30*/ .long sys_utime, sys_lchown, sys_fchown, sys_access, sys_nice 27/*30*/ .long sys_utime, sys_lchown, sys_fchown, sys_access, sys_nice
28/*35*/ .long sys_chown, sys_sync, sys_kill, sys_newstat, sys_sendfile 28/*35*/ .long sys_chown, sys_sync, sys_kill, sys_newstat, sys_sendfile
29/*40*/ .long sys_newlstat, sys_dup, sys_pipe, sys_times, sys_getuid 29/*40*/ .long sys_newlstat, sys_dup, sys_pipe, sys_times, sys_getuid
@@ -75,10 +75,11 @@ sys_call_table:
75/*265*/ .long sys_timer_delete, sys_timer_create, sys_nis_syscall, sys_io_setup, sys_io_destroy 75/*265*/ .long sys_timer_delete, sys_timer_create, sys_nis_syscall, sys_io_setup, sys_io_destroy
76/*270*/ .long sys_io_submit, sys_io_cancel, sys_io_getevents, sys_mq_open, sys_mq_unlink 76/*270*/ .long sys_io_submit, sys_io_cancel, sys_io_getevents, sys_mq_open, sys_mq_unlink
77/*275*/ .long sys_mq_timedsend, sys_mq_timedreceive, sys_mq_notify, sys_mq_getsetattr, sys_waitid 77/*275*/ .long sys_mq_timedsend, sys_mq_timedreceive, sys_mq_notify, sys_mq_getsetattr, sys_waitid
78/*280*/ .long sys_ni_syscall, sys_add_key, sys_request_key, sys_keyctl, sys_openat 78/*280*/ .long sys_tee, sys_add_key, sys_request_key, sys_keyctl, sys_openat
79/*285*/ .long sys_mkdirat, sys_mknodat, sys_fchownat, sys_futimesat, sys_fstatat64 79/*285*/ .long sys_mkdirat, sys_mknodat, sys_fchownat, sys_futimesat, sys_fstatat64
80/*290*/ .long sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat 80/*290*/ .long sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat
81/*295*/ .long sys_fchmodat, sys_faccessat, sys_pselect6, sys_ppoll, sys_unshare 81/*295*/ .long sys_fchmodat, sys_faccessat, sys_pselect6, sys_ppoll, sys_unshare
82/*300*/ .long sys_set_robust_list, sys_get_robust_list
82 83
83#ifdef CONFIG_SUNOS_EMUL 84#ifdef CONFIG_SUNOS_EMUL
84 /* Now the SunOS syscall table. */ 85 /* Now the SunOS syscall table. */
@@ -190,6 +191,6 @@ sunos_sys_table:
190/*290*/ .long sunos_nosys, sunos_nosys, sunos_nosys 191/*290*/ .long sunos_nosys, sunos_nosys, sunos_nosys
191 .long sunos_nosys, sunos_nosys, sunos_nosys 192 .long sunos_nosys, sunos_nosys, sunos_nosys
192 .long sunos_nosys, sunos_nosys, sunos_nosys 193 .long sunos_nosys, sunos_nosys, sunos_nosys
193 .long sunos_nosys 194 .long sunos_nosys, sunos_nosys, sunos_nosys
194 195
195#endif 196#endif
diff --git a/arch/sparc64/Kconfig b/arch/sparc64/Kconfig
index 648047a0bce3..43a66f5407f4 100644
--- a/arch/sparc64/Kconfig
+++ b/arch/sparc64/Kconfig
@@ -187,7 +187,7 @@ config HUGETLB_PAGE_SIZE_512K
187 bool "512K" 187 bool "512K"
188 188
189config HUGETLB_PAGE_SIZE_64K 189config HUGETLB_PAGE_SIZE_64K
190 depends on !SPARC64_PAGE_SIZE_4MB && !SPARC64_PAGE_SIZE_512KB && !SPARC64_PAGE_SIZE_64K 190 depends on !SPARC64_PAGE_SIZE_4MB && !SPARC64_PAGE_SIZE_512KB && !SPARC64_PAGE_SIZE_64KB
191 bool "64K" 191 bool "64K"
192 192
193endchoice 193endchoice
diff --git a/arch/sparc64/defconfig b/arch/sparc64/defconfig
index 1317380fa937..f09a70b8aabd 100644
--- a/arch/sparc64/defconfig
+++ b/arch/sparc64/defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16 3# Linux kernel version: 2.6.17-rc3
4# Sun Apr 2 19:31:04 2006 4# Fri May 12 12:43:49 2006
5# 5#
6CONFIG_SPARC=y 6CONFIG_SPARC=y
7CONFIG_SPARC64=y 7CONFIG_SPARC64=y
@@ -114,6 +114,7 @@ CONFIG_GENERIC_CALIBRATE_DELAY=y
114CONFIG_HUGETLB_PAGE_SIZE_4MB=y 114CONFIG_HUGETLB_PAGE_SIZE_4MB=y
115# CONFIG_HUGETLB_PAGE_SIZE_512K is not set 115# CONFIG_HUGETLB_PAGE_SIZE_512K is not set
116# CONFIG_HUGETLB_PAGE_SIZE_64K is not set 116# CONFIG_HUGETLB_PAGE_SIZE_64K is not set
117CONFIG_ARCH_SELECT_MEMORY_MODEL=y
117CONFIG_ARCH_SPARSEMEM_ENABLE=y 118CONFIG_ARCH_SPARSEMEM_ENABLE=y
118CONFIG_ARCH_SPARSEMEM_DEFAULT=y 119CONFIG_ARCH_SPARSEMEM_DEFAULT=y
119CONFIG_LARGE_ALLOCS=y 120CONFIG_LARGE_ALLOCS=y
@@ -430,7 +431,6 @@ CONFIG_ISCSI_TCP=m
430# CONFIG_SCSI_INIA100 is not set 431# CONFIG_SCSI_INIA100 is not set
431# CONFIG_SCSI_SYM53C8XX_2 is not set 432# CONFIG_SCSI_SYM53C8XX_2 is not set
432# CONFIG_SCSI_IPR is not set 433# CONFIG_SCSI_IPR is not set
433# CONFIG_SCSI_QLOGIC_FC is not set
434# CONFIG_SCSI_QLOGIC_1280 is not set 434# CONFIG_SCSI_QLOGIC_1280 is not set
435# CONFIG_SCSI_QLOGICPTI is not set 435# CONFIG_SCSI_QLOGICPTI is not set
436# CONFIG_SCSI_QLA_FC is not set 436# CONFIG_SCSI_QLA_FC is not set
@@ -1042,9 +1042,7 @@ CONFIG_USB_HIDDEV=y
1042# CONFIG_USB_ACECAD is not set 1042# CONFIG_USB_ACECAD is not set
1043# CONFIG_USB_KBTAB is not set 1043# CONFIG_USB_KBTAB is not set
1044# CONFIG_USB_POWERMATE is not set 1044# CONFIG_USB_POWERMATE is not set
1045# CONFIG_USB_MTOUCH is not set 1045# CONFIG_USB_TOUCHSCREEN is not set
1046# CONFIG_USB_ITMTOUCH is not set
1047# CONFIG_USB_EGALAX is not set
1048# CONFIG_USB_YEALINK is not set 1046# CONFIG_USB_YEALINK is not set
1049# CONFIG_USB_XPAD is not set 1047# CONFIG_USB_XPAD is not set
1050# CONFIG_USB_ATI_REMOTE is not set 1048# CONFIG_USB_ATI_REMOTE is not set
@@ -1115,6 +1113,14 @@ CONFIG_USB_HIDDEV=y
1115# CONFIG_NEW_LEDS is not set 1113# CONFIG_NEW_LEDS is not set
1116 1114
1117# 1115#
1116# LED drivers
1117#
1118
1119#
1120# LED Triggers
1121#
1122
1123#
1118# InfiniBand support 1124# InfiniBand support
1119# 1125#
1120# CONFIG_INFINIBAND is not set 1126# CONFIG_INFINIBAND is not set
@@ -1303,6 +1309,7 @@ CONFIG_DEBUG_BUGVERBOSE=y
1303# CONFIG_DEBUG_INFO is not set 1309# CONFIG_DEBUG_INFO is not set
1304CONFIG_DEBUG_FS=y 1310CONFIG_DEBUG_FS=y
1305# CONFIG_DEBUG_VM is not set 1311# CONFIG_DEBUG_VM is not set
1312# CONFIG_UNWIND_INFO is not set
1306CONFIG_FORCED_INLINING=y 1313CONFIG_FORCED_INLINING=y
1307# CONFIG_RCU_TORTURE_TEST is not set 1314# CONFIG_RCU_TORTURE_TEST is not set
1308# CONFIG_DEBUG_STACK_USAGE is not set 1315# CONFIG_DEBUG_STACK_USAGE is not set
diff --git a/arch/sparc64/kernel/head.S b/arch/sparc64/kernel/head.S
index 3eadac5e171e..31c5892f5acc 100644
--- a/arch/sparc64/kernel/head.S
+++ b/arch/sparc64/kernel/head.S
@@ -10,6 +10,7 @@
10#include <linux/config.h> 10#include <linux/config.h>
11#include <linux/version.h> 11#include <linux/version.h>
12#include <linux/errno.h> 12#include <linux/errno.h>
13#include <linux/threads.h>
13#include <asm/thread_info.h> 14#include <asm/thread_info.h>
14#include <asm/asi.h> 15#include <asm/asi.h>
15#include <asm/pstate.h> 16#include <asm/pstate.h>
@@ -493,6 +494,35 @@ tlb_fixup_done:
493 call prom_init 494 call prom_init
494 mov %l7, %o0 ! OpenPROM cif handler 495 mov %l7, %o0 ! OpenPROM cif handler
495 496
497 /* Initialize current_thread_info()->cpu as early as possible.
498 * In order to do that accurately we have to patch up the get_cpuid()
499 * assembler sequences. And that, in turn, requires that we know
500 * if we are on a Starfire box or not. While we're here, patch up
501 * the sun4v sequences as well.
502 */
503 call check_if_starfire
504 nop
505 call per_cpu_patch
506 nop
507 call sun4v_patch
508 nop
509
510#ifdef CONFIG_SMP
511 call hard_smp_processor_id
512 nop
513 cmp %o0, NR_CPUS
514 blu,pt %xcc, 1f
515 nop
516 call boot_cpu_id_too_large
517 nop
518 /* Not reached... */
519
5201:
521#else
522 mov 0, %o0
523#endif
524 stb %o0, [%g6 + TI_CPU]
525
496 /* Off we go.... */ 526 /* Off we go.... */
497 call start_kernel 527 call start_kernel
498 nop 528 nop
diff --git a/arch/sparc64/kernel/kprobes.c b/arch/sparc64/kernel/kprobes.c
index ffc7309e9f22..2e1c824c1cc9 100644
--- a/arch/sparc64/kernel/kprobes.c
+++ b/arch/sparc64/kernel/kprobes.c
@@ -63,7 +63,7 @@ void __kprobes arch_disarm_kprobe(struct kprobe *p)
63 flushi(p->addr); 63 flushi(p->addr);
64} 64}
65 65
66static inline void save_previous_kprobe(struct kprobe_ctlblk *kcb) 66static void __kprobes save_previous_kprobe(struct kprobe_ctlblk *kcb)
67{ 67{
68 kcb->prev_kprobe.kp = kprobe_running(); 68 kcb->prev_kprobe.kp = kprobe_running();
69 kcb->prev_kprobe.status = kcb->kprobe_status; 69 kcb->prev_kprobe.status = kcb->kprobe_status;
@@ -71,7 +71,7 @@ static inline void save_previous_kprobe(struct kprobe_ctlblk *kcb)
71 kcb->prev_kprobe.orig_tstate_pil = kcb->kprobe_orig_tstate_pil; 71 kcb->prev_kprobe.orig_tstate_pil = kcb->kprobe_orig_tstate_pil;
72} 72}
73 73
74static inline void restore_previous_kprobe(struct kprobe_ctlblk *kcb) 74static void __kprobes restore_previous_kprobe(struct kprobe_ctlblk *kcb)
75{ 75{
76 __get_cpu_var(current_kprobe) = kcb->prev_kprobe.kp; 76 __get_cpu_var(current_kprobe) = kcb->prev_kprobe.kp;
77 kcb->kprobe_status = kcb->prev_kprobe.status; 77 kcb->kprobe_status = kcb->prev_kprobe.status;
@@ -79,7 +79,7 @@ static inline void restore_previous_kprobe(struct kprobe_ctlblk *kcb)
79 kcb->kprobe_orig_tstate_pil = kcb->prev_kprobe.orig_tstate_pil; 79 kcb->kprobe_orig_tstate_pil = kcb->prev_kprobe.orig_tstate_pil;
80} 80}
81 81
82static inline void set_current_kprobe(struct kprobe *p, struct pt_regs *regs, 82static void __kprobes set_current_kprobe(struct kprobe *p, struct pt_regs *regs,
83 struct kprobe_ctlblk *kcb) 83 struct kprobe_ctlblk *kcb)
84{ 84{
85 __get_cpu_var(current_kprobe) = p; 85 __get_cpu_var(current_kprobe) = p;
@@ -87,7 +87,7 @@ static inline void set_current_kprobe(struct kprobe *p, struct pt_regs *regs,
87 kcb->kprobe_orig_tstate_pil = (regs->tstate & TSTATE_PIL); 87 kcb->kprobe_orig_tstate_pil = (regs->tstate & TSTATE_PIL);
88} 88}
89 89
90static inline void prepare_singlestep(struct kprobe *p, struct pt_regs *regs, 90static void __kprobes prepare_singlestep(struct kprobe *p, struct pt_regs *regs,
91 struct kprobe_ctlblk *kcb) 91 struct kprobe_ctlblk *kcb)
92{ 92{
93 regs->tstate |= TSTATE_PIL; 93 regs->tstate |= TSTATE_PIL;
@@ -273,7 +273,7 @@ static void __kprobes resume_execution(struct kprobe *p,
273 kcb->kprobe_orig_tstate_pil); 273 kcb->kprobe_orig_tstate_pil);
274} 274}
275 275
276static inline int post_kprobe_handler(struct pt_regs *regs) 276static int __kprobes post_kprobe_handler(struct pt_regs *regs)
277{ 277{
278 struct kprobe *cur = kprobe_running(); 278 struct kprobe *cur = kprobe_running();
279 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); 279 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
@@ -300,7 +300,7 @@ out:
300 return 1; 300 return 1;
301} 301}
302 302
303static inline int kprobe_fault_handler(struct pt_regs *regs, int trapnr) 303static int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr)
304{ 304{
305 struct kprobe *cur = kprobe_running(); 305 struct kprobe *cur = kprobe_running();
306 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); 306 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
diff --git a/arch/sparc64/kernel/module.c b/arch/sparc64/kernel/module.c
index 6c83e372f75d..579871527699 100644
--- a/arch/sparc64/kernel/module.c
+++ b/arch/sparc64/kernel/module.c
@@ -143,6 +143,11 @@ int apply_relocate_add(Elf64_Shdr *sechdrs,
143 location[3] = v >> 0; 143 location[3] = v >> 0;
144 break; 144 break;
145 145
146 case R_SPARC_DISP32:
147 v -= (Elf64_Addr) location;
148 *loc32 = v;
149 break;
150
146 case R_SPARC_WDISP30: 151 case R_SPARC_WDISP30:
147 v -= (Elf64_Addr) location; 152 v -= (Elf64_Addr) location;
148 *loc32 = (*loc32 & ~0x3fffffff) | 153 *loc32 = (*loc32 & ~0x3fffffff) |
diff --git a/arch/sparc64/kernel/pci.c b/arch/sparc64/kernel/pci.c
index dfccff29e182..f97ddeb105ac 100644
--- a/arch/sparc64/kernel/pci.c
+++ b/arch/sparc64/kernel/pci.c
@@ -419,6 +419,7 @@ void pcibios_resource_to_bus(struct pci_dev *pdev, struct pci_bus_region *region
419 region->start = res->start - zero_res.start; 419 region->start = res->start - zero_res.start;
420 region->end = res->end - zero_res.start; 420 region->end = res->end - zero_res.start;
421} 421}
422EXPORT_SYMBOL(pcibios_resource_to_bus);
422 423
423void pcibios_bus_to_resource(struct pci_dev *pdev, struct resource *res, 424void pcibios_bus_to_resource(struct pci_dev *pdev, struct resource *res,
424 struct pci_bus_region *region) 425 struct pci_bus_region *region)
diff --git a/arch/sparc64/kernel/pci_iommu.c b/arch/sparc64/kernel/pci_iommu.c
index 8efbc139769d..82e5455134c6 100644
--- a/arch/sparc64/kernel/pci_iommu.c
+++ b/arch/sparc64/kernel/pci_iommu.c
@@ -218,7 +218,7 @@ static inline void iommu_free_ctx(struct pci_iommu *iommu, int ctx)
218 * DMA for PCI device PDEV. Return non-NULL cpu-side address if 218 * DMA for PCI device PDEV. Return non-NULL cpu-side address if
219 * successful and set *DMA_ADDRP to the PCI side dma address. 219 * successful and set *DMA_ADDRP to the PCI side dma address.
220 */ 220 */
221static void *pci_4u_alloc_consistent(struct pci_dev *pdev, size_t size, dma_addr_t *dma_addrp) 221static void *pci_4u_alloc_consistent(struct pci_dev *pdev, size_t size, dma_addr_t *dma_addrp, gfp_t gfp)
222{ 222{
223 struct pcidev_cookie *pcp; 223 struct pcidev_cookie *pcp;
224 struct pci_iommu *iommu; 224 struct pci_iommu *iommu;
@@ -232,7 +232,7 @@ static void *pci_4u_alloc_consistent(struct pci_dev *pdev, size_t size, dma_addr
232 if (order >= 10) 232 if (order >= 10)
233 return NULL; 233 return NULL;
234 234
235 first_page = __get_free_pages(GFP_ATOMIC, order); 235 first_page = __get_free_pages(gfp, order);
236 if (first_page == 0UL) 236 if (first_page == 0UL)
237 return NULL; 237 return NULL;
238 memset((char *)first_page, 0, PAGE_SIZE << order); 238 memset((char *)first_page, 0, PAGE_SIZE << order);
diff --git a/arch/sparc64/kernel/pci_sun4v.c b/arch/sparc64/kernel/pci_sun4v.c
index 9e94db2573a2..2b7a1f316a93 100644
--- a/arch/sparc64/kernel/pci_sun4v.c
+++ b/arch/sparc64/kernel/pci_sun4v.c
@@ -154,7 +154,7 @@ static void pci_arena_free(struct pci_iommu_arena *arena, unsigned long base, un
154 __clear_bit(i, arena->map); 154 __clear_bit(i, arena->map);
155} 155}
156 156
157static void *pci_4v_alloc_consistent(struct pci_dev *pdev, size_t size, dma_addr_t *dma_addrp) 157static void *pci_4v_alloc_consistent(struct pci_dev *pdev, size_t size, dma_addr_t *dma_addrp, gfp_t gfp)
158{ 158{
159 struct pcidev_cookie *pcp; 159 struct pcidev_cookie *pcp;
160 struct pci_iommu *iommu; 160 struct pci_iommu *iommu;
@@ -169,7 +169,7 @@ static void *pci_4v_alloc_consistent(struct pci_dev *pdev, size_t size, dma_addr
169 169
170 npages = size >> IO_PAGE_SHIFT; 170 npages = size >> IO_PAGE_SHIFT;
171 171
172 first_page = __get_free_pages(GFP_ATOMIC, order); 172 first_page = __get_free_pages(gfp, order);
173 if (unlikely(first_page == 0UL)) 173 if (unlikely(first_page == 0UL))
174 return NULL; 174 return NULL;
175 175
diff --git a/arch/sparc64/kernel/ptrace.c b/arch/sparc64/kernel/ptrace.c
index 49e6dedd027d..d31975e6d6f6 100644
--- a/arch/sparc64/kernel/ptrace.c
+++ b/arch/sparc64/kernel/ptrace.c
@@ -653,7 +653,7 @@ asmlinkage void syscall_trace(struct pt_regs *regs, int syscall_exit_p)
653 if (unlikely(tstate & (TSTATE_XCARRY | TSTATE_ICARRY))) 653 if (unlikely(tstate & (TSTATE_XCARRY | TSTATE_ICARRY)))
654 result = AUDITSC_FAILURE; 654 result = AUDITSC_FAILURE;
655 655
656 audit_syscall_exit(current, result, regs->u_regs[UREG_I0]); 656 audit_syscall_exit(result, regs->u_regs[UREG_I0]);
657 } 657 }
658 658
659 if (!(current->ptrace & PT_PTRACED)) 659 if (!(current->ptrace & PT_PTRACED))
@@ -677,8 +677,7 @@ asmlinkage void syscall_trace(struct pt_regs *regs, int syscall_exit_p)
677 677
678out: 678out:
679 if (unlikely(current->audit_context) && !syscall_exit_p) 679 if (unlikely(current->audit_context) && !syscall_exit_p)
680 audit_syscall_entry(current, 680 audit_syscall_entry((test_thread_flag(TIF_32BIT) ?
681 (test_thread_flag(TIF_32BIT) ?
682 AUDIT_ARCH_SPARC : 681 AUDIT_ARCH_SPARC :
683 AUDIT_ARCH_SPARC64), 682 AUDIT_ARCH_SPARC64),
684 regs->u_regs[UREG_G1], 683 regs->u_regs[UREG_G1],
diff --git a/arch/sparc64/kernel/setup.c b/arch/sparc64/kernel/setup.c
index 005167f82419..9cf1c88cd774 100644
--- a/arch/sparc64/kernel/setup.c
+++ b/arch/sparc64/kernel/setup.c
@@ -220,7 +220,7 @@ char reboot_command[COMMAND_LINE_SIZE];
220 220
221static struct pt_regs fake_swapper_regs = { { 0, }, 0, 0, 0, 0 }; 221static struct pt_regs fake_swapper_regs = { { 0, }, 0, 0, 0, 0 };
222 222
223static void __init per_cpu_patch(void) 223void __init per_cpu_patch(void)
224{ 224{
225 struct cpuid_patch_entry *p; 225 struct cpuid_patch_entry *p;
226 unsigned long ver; 226 unsigned long ver;
@@ -280,7 +280,7 @@ static void __init per_cpu_patch(void)
280 } 280 }
281} 281}
282 282
283static void __init sun4v_patch(void) 283void __init sun4v_patch(void)
284{ 284{
285 struct sun4v_1insn_patch_entry *p1; 285 struct sun4v_1insn_patch_entry *p1;
286 struct sun4v_2insn_patch_entry *p2; 286 struct sun4v_2insn_patch_entry *p2;
@@ -315,6 +315,15 @@ static void __init sun4v_patch(void)
315 } 315 }
316} 316}
317 317
318#ifdef CONFIG_SMP
319void __init boot_cpu_id_too_large(int cpu)
320{
321 prom_printf("Serious problem, boot cpu id (%d) >= NR_CPUS (%d)\n",
322 cpu, NR_CPUS);
323 prom_halt();
324}
325#endif
326
318void __init setup_arch(char **cmdline_p) 327void __init setup_arch(char **cmdline_p)
319{ 328{
320 /* Initialize PROM console and command line. */ 329 /* Initialize PROM console and command line. */
@@ -332,16 +341,6 @@ void __init setup_arch(char **cmdline_p)
332 conswitchp = &prom_con; 341 conswitchp = &prom_con;
333#endif 342#endif
334 343
335 /* Work out if we are starfire early on */
336 check_if_starfire();
337
338 /* Now we know enough to patch the get_cpuid sequences
339 * used by trap code.
340 */
341 per_cpu_patch();
342
343 sun4v_patch();
344
345 boot_flags_init(*cmdline_p); 344 boot_flags_init(*cmdline_p);
346 345
347 idprom_init(); 346 idprom_init();
diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c
index 90eaca3ec9a6..4e8cd79156e0 100644
--- a/arch/sparc64/kernel/smp.c
+++ b/arch/sparc64/kernel/smp.c
@@ -1264,7 +1264,6 @@ void __init smp_tick_init(void)
1264 boot_cpu_id = hard_smp_processor_id(); 1264 boot_cpu_id = hard_smp_processor_id();
1265 current_tick_offset = timer_tick_offset; 1265 current_tick_offset = timer_tick_offset;
1266 1266
1267 cpu_set(boot_cpu_id, cpu_online_map);
1268 prof_counter(boot_cpu_id) = prof_multiplier(boot_cpu_id) = 1; 1267 prof_counter(boot_cpu_id) = prof_multiplier(boot_cpu_id) = 1;
1269} 1268}
1270 1269
@@ -1345,18 +1344,6 @@ void __init smp_setup_cpu_possible_map(void)
1345 1344
1346void __devinit smp_prepare_boot_cpu(void) 1345void __devinit smp_prepare_boot_cpu(void)
1347{ 1346{
1348 int cpu = hard_smp_processor_id();
1349
1350 if (cpu >= NR_CPUS) {
1351 prom_printf("Serious problem, boot cpu id >= NR_CPUS\n");
1352 prom_halt();
1353 }
1354
1355 current_thread_info()->cpu = cpu;
1356 __local_per_cpu_offset = __per_cpu_offset(cpu);
1357
1358 cpu_set(smp_processor_id(), cpu_online_map);
1359 cpu_set(smp_processor_id(), phys_cpu_present_map);
1360} 1347}
1361 1348
1362int __devinit __cpu_up(unsigned int cpu) 1349int __devinit __cpu_up(unsigned int cpu)
@@ -1433,4 +1420,7 @@ void __init setup_per_cpu_areas(void)
1433 1420
1434 for (i = 0; i < NR_CPUS; i++, ptr += size) 1421 for (i = 0; i < NR_CPUS; i++, ptr += size)
1435 memcpy(ptr, __per_cpu_start, __per_cpu_end - __per_cpu_start); 1422 memcpy(ptr, __per_cpu_start, __per_cpu_end - __per_cpu_start);
1423
1424 /* Setup %g5 for the boot cpu. */
1425 __local_per_cpu_offset = __per_cpu_offset(smp_processor_id());
1436} 1426}
diff --git a/arch/sparc64/kernel/sys32.S b/arch/sparc64/kernel/sys32.S
index 86dd5cb81e09..bdf1f4d02e3f 100644
--- a/arch/sparc64/kernel/sys32.S
+++ b/arch/sparc64/kernel/sys32.S
@@ -138,6 +138,8 @@ SIGN2(sys32_ioprio_get, sys_ioprio_get, %o0, %o1)
138SIGN3(sys32_ioprio_set, sys_ioprio_set, %o0, %o1, %o2) 138SIGN3(sys32_ioprio_set, sys_ioprio_set, %o0, %o1, %o2)
139SIGN2(sys32_splice, sys_splice, %o0, %o1) 139SIGN2(sys32_splice, sys_splice, %o0, %o1)
140SIGN2(sys32_sync_file_range, compat_sync_file_range, %o0, %o5) 140SIGN2(sys32_sync_file_range, compat_sync_file_range, %o0, %o5)
141SIGN2(sys32_tee, sys_tee, %o0, %o1)
142SIGN1(sys32_vmsplice, compat_sys_vmsplice, %o0)
141 143
142 .globl sys32_mmap2 144 .globl sys32_mmap2
143sys32_mmap2: 145sys32_mmap2:
diff --git a/arch/sparc64/kernel/systbls.S b/arch/sparc64/kernel/systbls.S
index 857b82c82875..1136fc465e37 100644
--- a/arch/sparc64/kernel/systbls.S
+++ b/arch/sparc64/kernel/systbls.S
@@ -25,7 +25,7 @@ sys_call_table32:
25/*10*/ .word sys_unlink, sunos_execv, sys_chdir, sys32_chown16, sys32_mknod 25/*10*/ .word sys_unlink, sunos_execv, sys_chdir, sys32_chown16, sys32_mknod
26/*15*/ .word sys_chmod, sys32_lchown16, sparc_brk, sys32_perfctr, sys32_lseek 26/*15*/ .word sys_chmod, sys32_lchown16, sparc_brk, sys32_perfctr, sys32_lseek
27/*20*/ .word sys_getpid, sys_capget, sys_capset, sys32_setuid16, sys32_getuid16 27/*20*/ .word sys_getpid, sys_capget, sys_capset, sys32_setuid16, sys32_getuid16
28/*25*/ .word compat_sys_time, sys_ptrace, sys_alarm, sys32_sigaltstack, sys32_pause 28/*25*/ .word sys32_vmsplice, sys_ptrace, sys_alarm, sys32_sigaltstack, sys32_pause
29/*30*/ .word compat_sys_utime, sys_lchown, sys_fchown, sys32_access, sys32_nice 29/*30*/ .word compat_sys_utime, sys_lchown, sys_fchown, sys32_access, sys32_nice
30 .word sys_chown, sys_sync, sys32_kill, compat_sys_newstat, sys32_sendfile 30 .word sys_chown, sys_sync, sys32_kill, compat_sys_newstat, sys32_sendfile
31/*40*/ .word compat_sys_newlstat, sys_dup, sys_pipe, compat_sys_times, sys_getuid 31/*40*/ .word compat_sys_newlstat, sys_dup, sys_pipe, compat_sys_times, sys_getuid
@@ -76,10 +76,11 @@ sys_call_table32:
76 .word sys_timer_delete, compat_sys_timer_create, sys_ni_syscall, compat_sys_io_setup, sys_io_destroy 76 .word sys_timer_delete, compat_sys_timer_create, sys_ni_syscall, compat_sys_io_setup, sys_io_destroy
77/*270*/ .word sys32_io_submit, sys_io_cancel, compat_sys_io_getevents, sys32_mq_open, sys_mq_unlink 77/*270*/ .word sys32_io_submit, sys_io_cancel, compat_sys_io_getevents, sys32_mq_open, sys_mq_unlink
78 .word compat_sys_mq_timedsend, compat_sys_mq_timedreceive, compat_sys_mq_notify, compat_sys_mq_getsetattr, compat_sys_waitid 78 .word compat_sys_mq_timedsend, compat_sys_mq_timedreceive, compat_sys_mq_notify, compat_sys_mq_getsetattr, compat_sys_waitid
79/*280*/ .word sys_ni_syscall, sys_add_key, sys_request_key, sys_keyctl, compat_sys_openat 79/*280*/ .word sys32_tee, sys_add_key, sys_request_key, sys_keyctl, compat_sys_openat
80 .word sys_mkdirat, sys_mknodat, sys_fchownat, compat_sys_futimesat, compat_sys_fstatat64 80 .word sys_mkdirat, sys_mknodat, sys_fchownat, compat_sys_futimesat, compat_sys_fstatat64
81/*285*/ .word sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat 81/*290*/ .word sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat
82 .word sys_fchmodat, sys_faccessat, compat_sys_pselect6, compat_sys_ppoll, sys_unshare 82 .word sys_fchmodat, sys_faccessat, compat_sys_pselect6, compat_sys_ppoll, sys_unshare
83/*300*/ .word compat_sys_set_robust_list, compat_sys_get_robust_list
83 84
84#endif /* CONFIG_COMPAT */ 85#endif /* CONFIG_COMPAT */
85 86
@@ -94,7 +95,7 @@ sys_call_table:
94/*10*/ .word sys_unlink, sys_nis_syscall, sys_chdir, sys_chown, sys_mknod 95/*10*/ .word sys_unlink, sys_nis_syscall, sys_chdir, sys_chown, sys_mknod
95/*15*/ .word sys_chmod, sys_lchown, sparc_brk, sys_perfctr, sys_lseek 96/*15*/ .word sys_chmod, sys_lchown, sparc_brk, sys_perfctr, sys_lseek
96/*20*/ .word sys_getpid, sys_capget, sys_capset, sys_setuid, sys_getuid 97/*20*/ .word sys_getpid, sys_capget, sys_capset, sys_setuid, sys_getuid
97/*25*/ .word sys_nis_syscall, sys_ptrace, sys_alarm, sys_sigaltstack, sys_nis_syscall 98/*25*/ .word sys_vmsplice, sys_ptrace, sys_alarm, sys_sigaltstack, sys_nis_syscall
98/*30*/ .word sys_utime, sys_nis_syscall, sys_nis_syscall, sys_access, sys_nice 99/*30*/ .word sys_utime, sys_nis_syscall, sys_nis_syscall, sys_access, sys_nice
99 .word sys_nis_syscall, sys_sync, sys_kill, sys_newstat, sys_sendfile64 100 .word sys_nis_syscall, sys_sync, sys_kill, sys_newstat, sys_sendfile64
100/*40*/ .word sys_newlstat, sys_dup, sys_pipe, sys_times, sys_nis_syscall 101/*40*/ .word sys_newlstat, sys_dup, sys_pipe, sys_times, sys_nis_syscall
@@ -145,10 +146,11 @@ sys_call_table:
145 .word sys_timer_delete, sys_timer_create, sys_ni_syscall, sys_io_setup, sys_io_destroy 146 .word sys_timer_delete, sys_timer_create, sys_ni_syscall, sys_io_setup, sys_io_destroy
146/*270*/ .word sys_io_submit, sys_io_cancel, sys_io_getevents, sys_mq_open, sys_mq_unlink 147/*270*/ .word sys_io_submit, sys_io_cancel, sys_io_getevents, sys_mq_open, sys_mq_unlink
147 .word sys_mq_timedsend, sys_mq_timedreceive, sys_mq_notify, sys_mq_getsetattr, sys_waitid 148 .word sys_mq_timedsend, sys_mq_timedreceive, sys_mq_notify, sys_mq_getsetattr, sys_waitid
148/*280*/ .word sys_nis_syscall, sys_add_key, sys_request_key, sys_keyctl, sys_openat 149/*280*/ .word sys_tee, sys_add_key, sys_request_key, sys_keyctl, sys_openat
149 .word sys_mkdirat, sys_mknodat, sys_fchownat, sys_futimesat, sys_fstatat64 150 .word sys_mkdirat, sys_mknodat, sys_fchownat, sys_futimesat, sys_fstatat64
150/*285*/ .word sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat 151/*290*/ .word sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat
151 .word sys_fchmodat, sys_faccessat, sys_pselect6, sys_ppoll, sys_unshare 152 .word sys_fchmodat, sys_faccessat, sys_pselect6, sys_ppoll, sys_unshare
153/*300*/ .word sys_set_robust_list, sys_get_robust_list
152 154
153#if defined(CONFIG_SUNOS_EMUL) || defined(CONFIG_SOLARIS_EMUL) || \ 155#if defined(CONFIG_SUNOS_EMUL) || defined(CONFIG_SOLARIS_EMUL) || \
154 defined(CONFIG_SOLARIS_EMUL_MODULE) 156 defined(CONFIG_SOLARIS_EMUL_MODULE)
@@ -261,5 +263,5 @@ sunos_sys_table:
261/*290*/ .word sunos_nosys, sunos_nosys, sunos_nosys 263/*290*/ .word sunos_nosys, sunos_nosys, sunos_nosys
262 .word sunos_nosys, sunos_nosys, sunos_nosys 264 .word sunos_nosys, sunos_nosys, sunos_nosys
263 .word sunos_nosys, sunos_nosys, sunos_nosys 265 .word sunos_nosys, sunos_nosys, sunos_nosys
264 .word sunos_nosys 266 .word sunos_nosys, sunos_nosys, sunos_nosys
265#endif 267#endif
diff --git a/arch/sparc64/lib/checksum.S b/arch/sparc64/lib/checksum.S
index ba9cd3ccc2b2..1d230f693dc4 100644
--- a/arch/sparc64/lib/checksum.S
+++ b/arch/sparc64/lib/checksum.S
@@ -165,8 +165,9 @@ csum_partial_end_cruft:
165 sll %g1, 8, %g1 165 sll %g1, 8, %g1
166 or %o5, %g1, %o4 166 or %o5, %g1, %o4
167 167
1681: add %o2, %o4, %o2 1681: addcc %o2, %o4, %o2
169 addc %g0, %o2, %o2
169 170
170csum_partial_finish: 171csum_partial_finish:
171 retl 172 retl
172 mov %o2, %o0 173 srl %o2, 0, %o0
diff --git a/arch/sparc64/lib/csum_copy.S b/arch/sparc64/lib/csum_copy.S
index 71af48839064..e566c770a0f6 100644
--- a/arch/sparc64/lib/csum_copy.S
+++ b/arch/sparc64/lib/csum_copy.S
@@ -221,11 +221,12 @@ FUNC_NAME: /* %o0=src, %o1=dst, %o2=len, %o3=sum */
221 sll %g1, 8, %g1 221 sll %g1, 8, %g1
222 or %o5, %g1, %o4 222 or %o5, %g1, %o4
223 223
2241: add %o3, %o4, %o3 2241: addcc %o3, %o4, %o3
225 addc %g0, %o3, %o3
225 226
22670: 22770:
227 retl 228 retl
228 mov %o3, %o0 229 srl %o3, 0, %o0
229 230
23095: mov 0, GLOBAL_SPARE 23195: mov 0, GLOBAL_SPARE
231 brlez,pn %o2, 4f 232 brlez,pn %o2, 4f
diff --git a/arch/sparc64/mm/tlb.c b/arch/sparc64/mm/tlb.c
index a079cf42505e..3f10fc921b00 100644
--- a/arch/sparc64/mm/tlb.c
+++ b/arch/sparc64/mm/tlb.c
@@ -8,6 +8,7 @@
8#include <linux/percpu.h> 8#include <linux/percpu.h>
9#include <linux/mm.h> 9#include <linux/mm.h>
10#include <linux/swap.h> 10#include <linux/swap.h>
11#include <linux/preempt.h>
11 12
12#include <asm/pgtable.h> 13#include <asm/pgtable.h>
13#include <asm/pgalloc.h> 14#include <asm/pgalloc.h>
@@ -24,6 +25,8 @@ void flush_tlb_pending(void)
24{ 25{
25 struct mmu_gather *mp = &__get_cpu_var(mmu_gathers); 26 struct mmu_gather *mp = &__get_cpu_var(mmu_gathers);
26 27
28 preempt_disable();
29
27 if (mp->tlb_nr) { 30 if (mp->tlb_nr) {
28 flush_tsb_user(mp); 31 flush_tsb_user(mp);
29 32
@@ -38,6 +41,8 @@ void flush_tlb_pending(void)
38 } 41 }
39 mp->tlb_nr = 0; 42 mp->tlb_nr = 0;
40 } 43 }
44
45 preempt_enable();
41} 46}
42 47
43void tlb_batch_add(struct mm_struct *mm, unsigned long vaddr, pte_t *ptep, pte_t orig) 48void tlb_batch_add(struct mm_struct *mm, unsigned long vaddr, pte_t *ptep, pte_t orig)
diff --git a/arch/um/Kconfig b/arch/um/Kconfig
index 05fbb20636cb..76e85bbaea55 100644
--- a/arch/um/Kconfig
+++ b/arch/um/Kconfig
@@ -57,20 +57,6 @@ config STATIC_LINK
57 chroot, and you disable CONFIG_MODE_TT, you probably want to say Y 57 chroot, and you disable CONFIG_MODE_TT, you probably want to say Y
58 here. 58 here.
59 59
60config HOST_2G_2G
61 bool "2G/2G host address space split"
62 default n
63 depends on MODE_TT
64 help
65 This is needed when the host on which you run has a 2G/2G memory
66 split, instead of the customary 3G/1G.
67
68 Note that to enable such a host
69 configuration, which makes sense only in some cases, you need special
70 host patches.
71
72 So, if you do not know what to do here, say 'N'.
73
74config KERNEL_HALF_GIGS 60config KERNEL_HALF_GIGS
75 int "Kernel address space size (in .5G units)" 61 int "Kernel address space size (in .5G units)"
76 default "1" 62 default "1"
diff --git a/arch/um/Kconfig.i386 b/arch/um/Kconfig.i386
index 85e6a55b3b59..f6eb72d117b9 100644
--- a/arch/um/Kconfig.i386
+++ b/arch/um/Kconfig.i386
@@ -16,6 +16,19 @@ config SEMAPHORE_SLEEPERS
16 bool 16 bool
17 default y 17 default y
18 18
19config HOST_2G_2G
20 bool "2G/2G host address space split"
21 default n
22 help
23 This is needed when the host on which you run has a 2G/2G memory
24 split, instead of the customary 3G/1G.
25
26 Note that to enable such a host
27 configuration, which makes sense only in some cases, you need special
28 host patches.
29
30 So, if you do not know what to do here, say 'N'.
31
19config TOP_ADDR 32config TOP_ADDR
20 hex 33 hex
21 default 0xc0000000 if !HOST_2G_2G 34 default 0xc0000000 if !HOST_2G_2G
@@ -35,11 +48,13 @@ config 3_LEVEL_PGTABLES
35 48
36config STUB_CODE 49config STUB_CODE
37 hex 50 hex
38 default 0xbfffe000 51 default 0xbfffe000 if !HOST_2G_2G
52 default 0x7fffe000 if HOST_2G_2G
39 53
40config STUB_DATA 54config STUB_DATA
41 hex 55 hex
42 default 0xbffff000 56 default 0xbffff000 if !HOST_2G_2G
57 default 0x7ffff000 if HOST_2G_2G
43 58
44config STUB_START 59config STUB_START
45 hex 60 hex
diff --git a/arch/um/Makefile b/arch/um/Makefile
index a508e7a02891..f6ad832faf13 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -96,7 +96,8 @@ PHONY += linux
96all: linux 96all: linux
97 97
98linux: vmlinux 98linux: vmlinux
99 ln -f $< $@ 99 @echo ' LINK $@'
100 $(Q)ln -f $< $@
100 101
101define archhelp 102define archhelp
102 echo '* linux - Binary kernel image (./linux) - for backward' 103 echo '* linux - Binary kernel image (./linux) - for backward'
@@ -117,6 +118,10 @@ prepare: $(ARCH_DIR)/include/kern_constants.h
117LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static 118LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static
118LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib 119LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib
119 120
121CFLAGS_NO_HARDENING := $(call cc-option, -fno-PIC,) $(call cc-option, -fno-pic,) \
122 $(call cc-option, -fno-stack-protector,) \
123 $(call cc-option, -fno-stack-protector-all,)
124
120CPP_MODE-$(CONFIG_MODE_TT) := -DMODE_TT 125CPP_MODE-$(CONFIG_MODE_TT) := -DMODE_TT
121CONFIG_KERNEL_STACK_ORDER ?= 2 126CONFIG_KERNEL_STACK_ORDER ?= 2
122STACK_SIZE := $(shell echo $$[ 4096 * (1 << $(CONFIG_KERNEL_STACK_ORDER)) ] ) 127STACK_SIZE := $(shell echo $$[ 4096 * (1 << $(CONFIG_KERNEL_STACK_ORDER)) ] )
@@ -203,8 +208,8 @@ endef
203$(ARCH_DIR)/include/uml-config.h : include/linux/autoconf.h 208$(ARCH_DIR)/include/uml-config.h : include/linux/autoconf.h
204 $(call filechk,umlconfig) 209 $(call filechk,umlconfig)
205 210
206$(ARCH_DIR)/user-offsets.s: $(ARCH_DIR)/sys-$(SUBARCH)/user-offsets.c 211$(ARCH_DIR)/sys-$(SUBARCH)/user-offsets.s: FORCE
207 $(CC) $(USER_CFLAGS) -S -o $@ $< 212 $(Q)$(MAKE) $(build)=$(ARCH_DIR)/sys-$(SUBARCH) $@
208 213
209define filechk_gen-asm-offsets 214define filechk_gen-asm-offsets
210 (set -e; \ 215 (set -e; \
@@ -219,13 +224,11 @@ define filechk_gen-asm-offsets
219 echo ""; ) 224 echo ""; )
220endef 225endef
221 226
222$(ARCH_DIR)/include/user_constants.h: $(ARCH_DIR)/user-offsets.s 227$(ARCH_DIR)/include/user_constants.h: $(ARCH_DIR)/sys-$(SUBARCH)/user-offsets.s
223 $(call filechk,gen-asm-offsets) 228 $(call filechk,gen-asm-offsets)
224 229
225CLEAN_FILES += $(ARCH_DIR)/user-offsets.s
226
227$(ARCH_DIR)/include/kern_constants.h: $(objtree)/$(ARCH_DIR)/include 230$(ARCH_DIR)/include/kern_constants.h: $(objtree)/$(ARCH_DIR)/include
228 @echo ' SYMLINK $@' 231 @echo ' SYMLINK $@'
229 $(Q) ln -sf ../../../include/asm-um/asm-offsets.h $@ 232 $(Q)ln -sf ../../../include/asm-um/asm-offsets.h $@
230 233
231export SUBARCH USER_CFLAGS OS 234export SUBARCH USER_CFLAGS CFLAGS_NO_HARDENING OS
diff --git a/arch/um/Makefile-i386 b/arch/um/Makefile-i386
index 7a0e04e34bf9..b65ca115ef77 100644
--- a/arch/um/Makefile-i386
+++ b/arch/um/Makefile-i386
@@ -33,5 +33,9 @@ include $(srctree)/arch/i386/Makefile.cpu
33# prevent gcc from keeping the stack 16 byte aligned. Taken from i386. 33# prevent gcc from keeping the stack 16 byte aligned. Taken from i386.
34cflags-y += $(call cc-option,-mpreferred-stack-boundary=2) 34cflags-y += $(call cc-option,-mpreferred-stack-boundary=2)
35 35
36# Prevent sprintf in nfsd from being converted to strcpy and resulting in
37# an unresolved reference.
38cflags-y += -ffreestanding
39
36CFLAGS += $(cflags-y) 40CFLAGS += $(cflags-y)
37USER_CFLAGS += $(cflags-y) 41USER_CFLAGS += $(cflags-y)
diff --git a/arch/um/defconfig b/arch/um/defconfig
index 80d30d19d750..402a74dc5026 100644
--- a/arch/um/defconfig
+++ b/arch/um/defconfig
@@ -1,14 +1,13 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc6-mm1 3# Linux kernel version: 2.6.17-rc3
4# Tue Jun 14 18:22:21 2005 4# Fri Apr 28 09:31:20 2006
5# 5#
6CONFIG_GENERIC_HARDIRQS=y 6CONFIG_GENERIC_HARDIRQS=y
7CONFIG_UML=y 7CONFIG_UML=y
8CONFIG_MMU=y 8CONFIG_MMU=y
9CONFIG_UID16=y
10CONFIG_RWSEM_GENERIC_SPINLOCK=y
11CONFIG_GENERIC_CALIBRATE_DELAY=y 9CONFIG_GENERIC_CALIBRATE_DELAY=y
10CONFIG_IRQ_RELEASE_METHOD=y
12 11
13# 12#
14# UML-specific options 13# UML-specific options
@@ -16,8 +15,50 @@ CONFIG_GENERIC_CALIBRATE_DELAY=y
16# CONFIG_MODE_TT is not set 15# CONFIG_MODE_TT is not set
17# CONFIG_STATIC_LINK is not set 16# CONFIG_STATIC_LINK is not set
18CONFIG_MODE_SKAS=y 17CONFIG_MODE_SKAS=y
18
19#
20# Host processor type and features
21#
22# CONFIG_M386 is not set
23# CONFIG_M486 is not set
24# CONFIG_M586 is not set
25# CONFIG_M586TSC is not set
26# CONFIG_M586MMX is not set
27CONFIG_M686=y
28# CONFIG_MPENTIUMII is not set
29# CONFIG_MPENTIUMIII is not set
30# CONFIG_MPENTIUMM is not set
31# CONFIG_MPENTIUM4 is not set
32# CONFIG_MK6 is not set
33# CONFIG_MK7 is not set
34# CONFIG_MK8 is not set
35# CONFIG_MCRUSOE is not set
36# CONFIG_MEFFICEON is not set
37# CONFIG_MWINCHIPC6 is not set
38# CONFIG_MWINCHIP2 is not set
39# CONFIG_MWINCHIP3D is not set
40# CONFIG_MGEODEGX1 is not set
41# CONFIG_MGEODE_LX is not set
42# CONFIG_MCYRIXIII is not set
43# CONFIG_MVIAC3_2 is not set
44# CONFIG_X86_GENERIC is not set
45CONFIG_X86_CMPXCHG=y
46CONFIG_X86_XADD=y
47CONFIG_X86_L1_CACHE_SHIFT=5
48CONFIG_RWSEM_XCHGADD_ALGORITHM=y
49CONFIG_X86_PPRO_FENCE=y
50CONFIG_X86_WP_WORKS_OK=y
51CONFIG_X86_INVLPG=y
52CONFIG_X86_BSWAP=y
53CONFIG_X86_POPAD_OK=y
54CONFIG_X86_CMPXCHG64=y
55CONFIG_X86_GOOD_APIC=y
56CONFIG_X86_USE_PPRO_CHECKSUM=y
57CONFIG_X86_TSC=y
19CONFIG_UML_X86=y 58CONFIG_UML_X86=y
20# CONFIG_64BIT is not set 59# CONFIG_64BIT is not set
60CONFIG_SEMAPHORE_SLEEPERS=y
61# CONFIG_HOST_2G_2G is not set
21CONFIG_TOP_ADDR=0xc0000000 62CONFIG_TOP_ADDR=0xc0000000
22# CONFIG_3_LEVEL_PGTABLES is not set 63# CONFIG_3_LEVEL_PGTABLES is not set
23CONFIG_STUB_CODE=0xbfffe000 64CONFIG_STUB_CODE=0xbfffe000
@@ -25,22 +66,24 @@ CONFIG_STUB_DATA=0xbffff000
25CONFIG_STUB_START=0xbfffe000 66CONFIG_STUB_START=0xbfffe000
26CONFIG_ARCH_HAS_SC_SIGNALS=y 67CONFIG_ARCH_HAS_SC_SIGNALS=y
27CONFIG_ARCH_REUSE_HOST_VSYSCALL_AREA=y 68CONFIG_ARCH_REUSE_HOST_VSYSCALL_AREA=y
69CONFIG_GENERIC_HWEIGHT=y
28CONFIG_SELECT_MEMORY_MODEL=y 70CONFIG_SELECT_MEMORY_MODEL=y
29CONFIG_FLATMEM_MANUAL=y 71CONFIG_FLATMEM_MANUAL=y
30# CONFIG_DISCONTIGMEM_MANUAL is not set 72# CONFIG_DISCONTIGMEM_MANUAL is not set
31# CONFIG_SPARSEMEM_MANUAL is not set 73# CONFIG_SPARSEMEM_MANUAL is not set
32CONFIG_FLATMEM=y 74CONFIG_FLATMEM=y
33CONFIG_FLAT_NODE_MEM_MAP=y 75CONFIG_FLAT_NODE_MEM_MAP=y
76# CONFIG_SPARSEMEM_STATIC is not set
77CONFIG_SPLIT_PTLOCK_CPUS=4
34CONFIG_LD_SCRIPT_DYN=y 78CONFIG_LD_SCRIPT_DYN=y
35CONFIG_NET=y 79CONFIG_NET=y
36CONFIG_BINFMT_ELF=y 80CONFIG_BINFMT_ELF=y
37CONFIG_BINFMT_MISC=m 81CONFIG_BINFMT_MISC=m
38# CONFIG_HOSTFS is not set 82# CONFIG_HOSTFS is not set
83# CONFIG_HPPFS is not set
39CONFIG_MCONSOLE=y 84CONFIG_MCONSOLE=y
40# CONFIG_MAGIC_SYSRQ is not set 85# CONFIG_MAGIC_SYSRQ is not set
41# CONFIG_HOST_2G_2G is not set
42CONFIG_NEST_LEVEL=0 86CONFIG_NEST_LEVEL=0
43CONFIG_KERNEL_HALF_GIGS=1
44# CONFIG_HIGHMEM is not set 87# CONFIG_HIGHMEM is not set
45CONFIG_KERNEL_STACK_ORDER=2 88CONFIG_KERNEL_STACK_ORDER=2
46CONFIG_UML_REAL_TIME_CLOCK=y 89CONFIG_UML_REAL_TIME_CLOCK=y
@@ -49,7 +92,6 @@ CONFIG_UML_REAL_TIME_CLOCK=y
49# Code maturity level options 92# Code maturity level options
50# 93#
51CONFIG_EXPERIMENTAL=y 94CONFIG_EXPERIMENTAL=y
52CONFIG_CLEAN_COMPILE=y
53CONFIG_BROKEN_ON_SMP=y 95CONFIG_BROKEN_ON_SMP=y
54CONFIG_INIT_ENV_ARG_LIMIT=32 96CONFIG_INIT_ENV_ARG_LIMIT=32
55 97
@@ -57,6 +99,7 @@ CONFIG_INIT_ENV_ARG_LIMIT=32
57# General setup 99# General setup
58# 100#
59CONFIG_LOCALVERSION="" 101CONFIG_LOCALVERSION=""
102CONFIG_LOCALVERSION_AUTO=y
60CONFIG_SWAP=y 103CONFIG_SWAP=y
61CONFIG_SYSVIPC=y 104CONFIG_SYSVIPC=y
62CONFIG_POSIX_MQUEUE=y 105CONFIG_POSIX_MQUEUE=y
@@ -64,26 +107,28 @@ CONFIG_BSD_PROCESS_ACCT=y
64# CONFIG_BSD_PROCESS_ACCT_V3 is not set 107# CONFIG_BSD_PROCESS_ACCT_V3 is not set
65CONFIG_SYSCTL=y 108CONFIG_SYSCTL=y
66# CONFIG_AUDIT is not set 109# CONFIG_AUDIT is not set
67# CONFIG_HOTPLUG is not set
68CONFIG_KOBJECT_UEVENT=y
69CONFIG_IKCONFIG=y 110CONFIG_IKCONFIG=y
70CONFIG_IKCONFIG_PROC=y 111CONFIG_IKCONFIG_PROC=y
112# CONFIG_RELAY is not set
113CONFIG_INITRAMFS_SOURCE=""
114CONFIG_UID16=y
115CONFIG_CC_OPTIMIZE_FOR_SIZE=y
71# CONFIG_EMBEDDED is not set 116# CONFIG_EMBEDDED is not set
72CONFIG_KALLSYMS=y 117CONFIG_KALLSYMS=y
73# CONFIG_KALLSYMS_ALL is not set 118# CONFIG_KALLSYMS_ALL is not set
74CONFIG_KALLSYMS_EXTRA_PASS=y 119CONFIG_KALLSYMS_EXTRA_PASS=y
120CONFIG_HOTPLUG=y
75CONFIG_PRINTK=y 121CONFIG_PRINTK=y
76CONFIG_BUG=y 122CONFIG_BUG=y
123CONFIG_ELF_CORE=y
77CONFIG_BASE_FULL=y 124CONFIG_BASE_FULL=y
78CONFIG_FUTEX=y 125CONFIG_FUTEX=y
79CONFIG_EPOLL=y 126CONFIG_EPOLL=y
80CONFIG_SHMEM=y 127CONFIG_SHMEM=y
81CONFIG_CC_ALIGN_FUNCTIONS=0 128CONFIG_SLAB=y
82CONFIG_CC_ALIGN_LABELS=0
83CONFIG_CC_ALIGN_LOOPS=0
84CONFIG_CC_ALIGN_JUMPS=0
85# CONFIG_TINY_SHMEM is not set 129# CONFIG_TINY_SHMEM is not set
86CONFIG_BASE_SMALL=0 130CONFIG_BASE_SMALL=0
131# CONFIG_SLOB is not set
87 132
88# 133#
89# Loadable module support 134# Loadable module support
@@ -91,18 +136,43 @@ CONFIG_BASE_SMALL=0
91CONFIG_MODULES=y 136CONFIG_MODULES=y
92CONFIG_MODULE_UNLOAD=y 137CONFIG_MODULE_UNLOAD=y
93# CONFIG_MODULE_FORCE_UNLOAD is not set 138# CONFIG_MODULE_FORCE_UNLOAD is not set
94CONFIG_OBSOLETE_MODPARM=y
95# CONFIG_MODVERSIONS is not set 139# CONFIG_MODVERSIONS is not set
96# CONFIG_MODULE_SRCVERSION_ALL is not set 140# CONFIG_MODULE_SRCVERSION_ALL is not set
97CONFIG_KMOD=y 141CONFIG_KMOD=y
98 142
99# 143#
100# Generic Driver Options 144# Block layer
101# 145#
102CONFIG_STANDALONE=y 146# CONFIG_LBD is not set
103CONFIG_PREVENT_FIRMWARE_BUILD=y 147# CONFIG_BLK_DEV_IO_TRACE is not set
104# CONFIG_FW_LOADER is not set 148# CONFIG_LSF is not set
105# CONFIG_DEBUG_DRIVER is not set 149
150#
151# IO Schedulers
152#
153CONFIG_IOSCHED_NOOP=y
154CONFIG_IOSCHED_AS=y
155CONFIG_IOSCHED_DEADLINE=y
156CONFIG_IOSCHED_CFQ=y
157CONFIG_DEFAULT_AS=y
158# CONFIG_DEFAULT_DEADLINE is not set
159# CONFIG_DEFAULT_CFQ is not set
160# CONFIG_DEFAULT_NOOP is not set
161CONFIG_DEFAULT_IOSCHED="anticipatory"
162
163#
164# Block devices
165#
166CONFIG_BLK_DEV_UBD=y
167# CONFIG_BLK_DEV_UBD_SYNC is not set
168CONFIG_BLK_DEV_COW_COMMON=y
169# CONFIG_MMAPPER is not set
170CONFIG_BLK_DEV_LOOP=m
171# CONFIG_BLK_DEV_CRYPTOLOOP is not set
172CONFIG_BLK_DEV_NBD=m
173# CONFIG_BLK_DEV_RAM is not set
174# CONFIG_BLK_DEV_INITRD is not set
175# CONFIG_ATA_OVER_ETH is not set
106 176
107# 177#
108# Character Devices 178# Character Devices
@@ -127,50 +197,23 @@ CONFIG_UML_SOUND=m
127CONFIG_SOUND=m 197CONFIG_SOUND=m
128CONFIG_HOSTAUDIO=m 198CONFIG_HOSTAUDIO=m
129CONFIG_UML_RANDOM=y 199CONFIG_UML_RANDOM=y
130# CONFIG_MMAPPER is not set
131
132#
133# Block devices
134#
135CONFIG_BLK_DEV_UBD=y
136CONFIG_BLK_DEV_UBD_SYNC=y
137CONFIG_BLK_DEV_COW_COMMON=y
138CONFIG_BLK_DEV_LOOP=m
139# CONFIG_BLK_DEV_CRYPTOLOOP is not set
140CONFIG_BLK_DEV_NBD=m
141# CONFIG_BLK_DEV_RAM is not set
142CONFIG_BLK_DEV_RAM_COUNT=16
143CONFIG_INITRAMFS_SOURCE=""
144# CONFIG_LBD is not set
145
146#
147# IO Schedulers
148#
149CONFIG_IOSCHED_NOOP=y
150CONFIG_IOSCHED_AS=y
151CONFIG_IOSCHED_DEADLINE=y
152CONFIG_IOSCHED_CFQ=y
153# CONFIG_ATA_OVER_ETH is not set
154CONFIG_NETDEVICES=y
155 200
156# 201#
157# UML Network Devices 202# Generic Driver Options
158# 203#
159CONFIG_UML_NET=y 204CONFIG_STANDALONE=y
160CONFIG_UML_NET_ETHERTAP=y 205CONFIG_PREVENT_FIRMWARE_BUILD=y
161CONFIG_UML_NET_TUNTAP=y 206# CONFIG_FW_LOADER is not set
162CONFIG_UML_NET_SLIP=y 207# CONFIG_DEBUG_DRIVER is not set
163CONFIG_UML_NET_DAEMON=y
164CONFIG_UML_NET_MCAST=y
165CONFIG_UML_NET_SLIRP=y
166 208
167# 209#
168# Networking support 210# Networking
169# 211#
170 212
171# 213#
172# Networking options 214# Networking options
173# 215#
216# CONFIG_NETDEBUG is not set
174CONFIG_PACKET=y 217CONFIG_PACKET=y
175CONFIG_PACKET_MMAP=y 218CONFIG_PACKET_MMAP=y
176CONFIG_UNIX=y 219CONFIG_UNIX=y
@@ -178,6 +221,7 @@ CONFIG_UNIX=y
178CONFIG_INET=y 221CONFIG_INET=y
179# CONFIG_IP_MULTICAST is not set 222# CONFIG_IP_MULTICAST is not set
180# CONFIG_IP_ADVANCED_ROUTER is not set 223# CONFIG_IP_ADVANCED_ROUTER is not set
224CONFIG_IP_FIB_HASH=y
181# CONFIG_IP_PNP is not set 225# CONFIG_IP_PNP is not set
182# CONFIG_NET_IPIP is not set 226# CONFIG_NET_IPIP is not set
183# CONFIG_NET_IPGRE is not set 227# CONFIG_NET_IPGRE is not set
@@ -186,27 +230,31 @@ CONFIG_INET=y
186# CONFIG_INET_AH is not set 230# CONFIG_INET_AH is not set
187# CONFIG_INET_ESP is not set 231# CONFIG_INET_ESP is not set
188# CONFIG_INET_IPCOMP is not set 232# CONFIG_INET_IPCOMP is not set
233# CONFIG_INET_XFRM_TUNNEL is not set
189# CONFIG_INET_TUNNEL is not set 234# CONFIG_INET_TUNNEL is not set
190CONFIG_IP_TCPDIAG=y 235CONFIG_INET_DIAG=y
191# CONFIG_IP_TCPDIAG_IPV6 is not set 236CONFIG_INET_TCP_DIAG=y
192 237# CONFIG_TCP_CONG_ADVANCED is not set
193#
194# TCP congestion control
195#
196CONFIG_TCP_CONG_BIC=y 238CONFIG_TCP_CONG_BIC=y
197CONFIG_TCP_CONG_WESTWOOD=y
198CONFIG_TCP_CONG_HTCP=y
199# CONFIG_TCP_CONG_HSTCP is not set
200# CONFIG_TCP_CONG_HYBLA is not set
201# CONFIG_TCP_CONG_VEGAS is not set
202# CONFIG_TCP_CONG_SCALABLE is not set
203# CONFIG_IPV6 is not set 239# CONFIG_IPV6 is not set
240# CONFIG_INET6_XFRM_TUNNEL is not set
241# CONFIG_INET6_TUNNEL is not set
204# CONFIG_NETFILTER is not set 242# CONFIG_NETFILTER is not set
205 243
206# 244#
245# DCCP Configuration (EXPERIMENTAL)
246#
247# CONFIG_IP_DCCP is not set
248
249#
207# SCTP Configuration (EXPERIMENTAL) 250# SCTP Configuration (EXPERIMENTAL)
208# 251#
209# CONFIG_IP_SCTP is not set 252# CONFIG_IP_SCTP is not set
253
254#
255# TIPC Configuration (EXPERIMENTAL)
256#
257# CONFIG_TIPC is not set
210# CONFIG_ATM is not set 258# CONFIG_ATM is not set
211# CONFIG_BRIDGE is not set 259# CONFIG_BRIDGE is not set
212# CONFIG_VLAN_8021Q is not set 260# CONFIG_VLAN_8021Q is not set
@@ -224,27 +272,47 @@ CONFIG_TCP_CONG_HTCP=y
224# QoS and/or fair queueing 272# QoS and/or fair queueing
225# 273#
226# CONFIG_NET_SCHED is not set 274# CONFIG_NET_SCHED is not set
227# CONFIG_NET_CLS_ROUTE is not set
228 275
229# 276#
230# Network testing 277# Network testing
231# 278#
232# CONFIG_NET_PKTGEN is not set 279# CONFIG_NET_PKTGEN is not set
233# CONFIG_KGDBOE is not set
234# CONFIG_NETPOLL is not set
235# CONFIG_NETPOLL_RX is not set
236# CONFIG_NETPOLL_TRAP is not set
237# CONFIG_NET_POLL_CONTROLLER is not set
238# CONFIG_HAMRADIO is not set 280# CONFIG_HAMRADIO is not set
239# CONFIG_IRDA is not set 281# CONFIG_IRDA is not set
240# CONFIG_BT is not set 282# CONFIG_BT is not set
241# CONFIG_IEEE80211 is not set 283# CONFIG_IEEE80211 is not set
284
285#
286# UML Network Devices
287#
288CONFIG_UML_NET=y
289CONFIG_UML_NET_ETHERTAP=y
290CONFIG_UML_NET_TUNTAP=y
291CONFIG_UML_NET_SLIP=y
292CONFIG_UML_NET_DAEMON=y
293CONFIG_UML_NET_MCAST=y
294# CONFIG_UML_NET_PCAP is not set
295CONFIG_UML_NET_SLIRP=y
296
297#
298# Network device support
299#
300CONFIG_NETDEVICES=y
242CONFIG_DUMMY=m 301CONFIG_DUMMY=m
243# CONFIG_BONDING is not set 302# CONFIG_BONDING is not set
244# CONFIG_EQUALIZER is not set 303# CONFIG_EQUALIZER is not set
245CONFIG_TUN=m 304CONFIG_TUN=m
246 305
247# 306#
307# PHY device support
308#
309
310#
311# Wireless LAN (non-hamradio)
312#
313# CONFIG_NET_RADIO is not set
314
315#
248# Wan interfaces 316# Wan interfaces
249# 317#
250# CONFIG_WAN is not set 318# CONFIG_WAN is not set
@@ -263,6 +331,13 @@ CONFIG_SLIP=m
263# CONFIG_SLIP_MODE_SLIP6 is not set 331# CONFIG_SLIP_MODE_SLIP6 is not set
264# CONFIG_SHAPER is not set 332# CONFIG_SHAPER is not set
265# CONFIG_NETCONSOLE is not set 333# CONFIG_NETCONSOLE is not set
334# CONFIG_NETPOLL is not set
335# CONFIG_NET_POLL_CONTROLLER is not set
336
337#
338# Connector - unified userspace <-> kernelspace linker
339#
340# CONFIG_CONNECTOR is not set
266 341
267# 342#
268# File systems 343# File systems
@@ -274,17 +349,14 @@ CONFIG_EXT3_FS=y
274# CONFIG_EXT3_FS_XATTR is not set 349# CONFIG_EXT3_FS_XATTR is not set
275CONFIG_JBD=y 350CONFIG_JBD=y
276# CONFIG_JBD_DEBUG is not set 351# CONFIG_JBD_DEBUG is not set
277# CONFIG_REISER4_FS is not set
278CONFIG_REISERFS_FS=y 352CONFIG_REISERFS_FS=y
279# CONFIG_REISERFS_CHECK is not set 353# CONFIG_REISERFS_CHECK is not set
280# CONFIG_REISERFS_PROC_INFO is not set 354# CONFIG_REISERFS_PROC_INFO is not set
281# CONFIG_REISERFS_FS_XATTR is not set 355# CONFIG_REISERFS_FS_XATTR is not set
282# CONFIG_JFS_FS is not set 356# CONFIG_JFS_FS is not set
283 357# CONFIG_FS_POSIX_ACL is not set
284#
285# XFS support
286#
287# CONFIG_XFS_FS is not set 358# CONFIG_XFS_FS is not set
359# CONFIG_OCFS2_FS is not set
288# CONFIG_MINIX_FS is not set 360# CONFIG_MINIX_FS is not set
289# CONFIG_ROMFS_FS is not set 361# CONFIG_ROMFS_FS is not set
290CONFIG_INOTIFY=y 362CONFIG_INOTIFY=y
@@ -295,11 +367,6 @@ CONFIG_QUOTACTL=y
295CONFIG_DNOTIFY=y 367CONFIG_DNOTIFY=y
296CONFIG_AUTOFS_FS=m 368CONFIG_AUTOFS_FS=m
297CONFIG_AUTOFS4_FS=m 369CONFIG_AUTOFS4_FS=m
298
299#
300# Caches
301#
302# CONFIG_FSCACHE is not set
303# CONFIG_FUSE_FS is not set 370# CONFIG_FUSE_FS is not set
304 371
305# 372#
@@ -323,14 +390,10 @@ CONFIG_JOLIET=y
323CONFIG_PROC_FS=y 390CONFIG_PROC_FS=y
324CONFIG_PROC_KCORE=y 391CONFIG_PROC_KCORE=y
325CONFIG_SYSFS=y 392CONFIG_SYSFS=y
326# CONFIG_DEVFS_FS is not set
327# CONFIG_DEVPTS_FS_XATTR is not set
328CONFIG_TMPFS=y 393CONFIG_TMPFS=y
329# CONFIG_TMPFS_XATTR is not set
330# CONFIG_HUGETLB_PAGE is not set 394# CONFIG_HUGETLB_PAGE is not set
331CONFIG_RAMFS=y 395CONFIG_RAMFS=y
332# CONFIG_CONFIGFS_FS is not set 396# CONFIG_CONFIGFS_FS is not set
333# CONFIG_RELAYFS_FS is not set
334 397
335# 398#
336# Miscellaneous filesystems 399# Miscellaneous filesystems
@@ -430,6 +493,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
430# Library routines 493# Library routines
431# 494#
432# CONFIG_CRC_CCITT is not set 495# CONFIG_CRC_CCITT is not set
496# CONFIG_CRC16 is not set
433CONFIG_CRC32=m 497CONFIG_CRC32=m
434# CONFIG_LIBCRC32C is not set 498# CONFIG_LIBCRC32C is not set
435 499
@@ -448,12 +512,18 @@ CONFIG_LOG_BUF_SHIFT=14
448CONFIG_DETECT_SOFTLOCKUP=y 512CONFIG_DETECT_SOFTLOCKUP=y
449# CONFIG_SCHEDSTATS is not set 513# CONFIG_SCHEDSTATS is not set
450CONFIG_DEBUG_SLAB=y 514CONFIG_DEBUG_SLAB=y
515# CONFIG_DEBUG_SLAB_LEAK is not set
516# CONFIG_DEBUG_MUTEXES is not set
451# CONFIG_DEBUG_SPINLOCK is not set 517# CONFIG_DEBUG_SPINLOCK is not set
452# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 518# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
453# CONFIG_DEBUG_KOBJECT is not set 519# CONFIG_DEBUG_KOBJECT is not set
454CONFIG_DEBUG_INFO=y 520CONFIG_DEBUG_INFO=y
455# CONFIG_DEBUG_FS is not set 521# CONFIG_DEBUG_FS is not set
522# CONFIG_DEBUG_VM is not set
456CONFIG_FRAME_POINTER=y 523CONFIG_FRAME_POINTER=y
524# CONFIG_UNWIND_INFO is not set
525CONFIG_FORCED_INLINING=y
526# CONFIG_RCU_TORTURE_TEST is not set
457# CONFIG_GPROF is not set 527# CONFIG_GPROF is not set
458# CONFIG_GCOV is not set 528# CONFIG_GCOV is not set
459# CONFIG_SYSCALL_DEBUG is not set 529# CONFIG_SYSCALL_DEBUG is not set
diff --git a/arch/um/include/kern_util.h b/arch/um/include/kern_util.h
index efa3d33c0be6..310980b32173 100644
--- a/arch/um/include/kern_util.h
+++ b/arch/um/include/kern_util.h
@@ -120,20 +120,11 @@ extern int is_syscall(unsigned long addr);
120extern void free_irq(unsigned int, void *); 120extern void free_irq(unsigned int, void *);
121extern int cpu(void); 121extern int cpu(void);
122 122
123extern void time_init_kern(void);
124
123/* Are we disallowed to sleep? Used to choose between GFP_KERNEL and GFP_ATOMIC. */ 125/* Are we disallowed to sleep? Used to choose between GFP_KERNEL and GFP_ATOMIC. */
124extern int __cant_sleep(void); 126extern int __cant_sleep(void);
125extern void segv_handler(int sig, union uml_pt_regs *regs); 127extern void segv_handler(int sig, union uml_pt_regs *regs);
126extern void sigio_handler(int sig, union uml_pt_regs *regs); 128extern void sigio_handler(int sig, union uml_pt_regs *regs);
127 129
128#endif 130#endif
129
130/*
131 * Overrides for Emacs so that we follow Linus's tabbing style.
132 * Emacs will notice this stuff at the end of the file and automatically
133 * adjust the settings for this buffer only. This must remain at the end
134 * of the file.
135 * ---------------------------------------------------------------------------
136 * Local variables:
137 * c-file-style: "linux"
138 * End:
139 */
diff --git a/arch/um/include/longjmp.h b/arch/um/include/longjmp.h
index 018b3819ab0b..8e7053013f7b 100644
--- a/arch/um/include/longjmp.h
+++ b/arch/um/include/longjmp.h
@@ -4,11 +4,11 @@
4#include <setjmp.h> 4#include <setjmp.h>
5#include "os.h" 5#include "os.h"
6 6
7#define UML_SIGLONGJMP(buf, val) do { \ 7#define UML_LONGJMP(buf, val) do { \
8 longjmp(*buf, val); \ 8 longjmp(*buf, val); \
9} while(0) 9} while(0)
10 10
11#define UML_SIGSETJMP(buf, enable) ({ \ 11#define UML_SETJMP(buf, enable) ({ \
12 int n; \ 12 int n; \
13 enable = get_signals(); \ 13 enable = get_signals(); \
14 n = setjmp(*buf); \ 14 n = setjmp(*buf); \
diff --git a/arch/um/include/sysdep-i386/kernel-offsets.h b/arch/um/include/sysdep-i386/kernel-offsets.h
index 82f96c574144..2c13de321f2f 100644
--- a/arch/um/include/sysdep-i386/kernel-offsets.h
+++ b/arch/um/include/sysdep-i386/kernel-offsets.h
@@ -1,6 +1,7 @@
1#include <linux/stddef.h> 1#include <linux/stddef.h>
2#include <linux/sched.h> 2#include <linux/sched.h>
3#include <linux/elf.h> 3#include <linux/elf.h>
4#include <asm/mman.h>
4 5
5#define DEFINE(sym, val) \ 6#define DEFINE(sym, val) \
6 asm volatile("\n->" #sym " %0 " #val : : "i" (val)) 7 asm volatile("\n->" #sym " %0 " #val : : "i" (val))
@@ -16,6 +17,7 @@
16void foo(void) 17void foo(void)
17{ 18{
18 OFFSET(HOST_TASK_DEBUGREGS, task_struct, thread.arch.debugregs); 19 OFFSET(HOST_TASK_DEBUGREGS, task_struct, thread.arch.debugregs);
20 DEFINE(KERNEL_MADV_REMOVE, MADV_REMOVE);
19#ifdef CONFIG_MODE_TT 21#ifdef CONFIG_MODE_TT
20 OFFSET(HOST_TASK_EXTERN_PID, task_struct, thread.mode.tt.extern_pid); 22 OFFSET(HOST_TASK_EXTERN_PID, task_struct, thread.mode.tt.extern_pid);
21#endif 23#endif
diff --git a/arch/um/include/sysdep-x86_64/kernel-offsets.h b/arch/um/include/sysdep-x86_64/kernel-offsets.h
index 5ce93abd0b54..939cc475757a 100644
--- a/arch/um/include/sysdep-x86_64/kernel-offsets.h
+++ b/arch/um/include/sysdep-x86_64/kernel-offsets.h
@@ -4,6 +4,7 @@
4#include <linux/time.h> 4#include <linux/time.h>
5#include <linux/elf.h> 5#include <linux/elf.h>
6#include <asm/page.h> 6#include <asm/page.h>
7#include <asm/mman.h>
7 8
8#define DEFINE(sym, val) \ 9#define DEFINE(sym, val) \
9 asm volatile("\n->" #sym " %0 " #val : : "i" (val)) 10 asm volatile("\n->" #sym " %0 " #val : : "i" (val))
@@ -18,6 +19,7 @@
18 19
19void foo(void) 20void foo(void)
20{ 21{
22 DEFINE(KERNEL_MADV_REMOVE, MADV_REMOVE);
21#ifdef CONFIG_MODE_TT 23#ifdef CONFIG_MODE_TT
22 OFFSET(HOST_TASK_EXTERN_PID, task_struct, thread.mode.tt.extern_pid); 24 OFFSET(HOST_TASK_EXTERN_PID, task_struct, thread.mode.tt.extern_pid);
23#endif 25#endif
diff --git a/arch/um/kernel/irq.c b/arch/um/kernel/irq.c
index c39ea3abeda4..2ffda012385e 100644
--- a/arch/um/kernel/irq.c
+++ b/arch/um/kernel/irq.c
@@ -89,16 +89,18 @@ void sigio_handler(int sig, union uml_pt_regs *regs)
89 struct irq_fd *irq_fd; 89 struct irq_fd *irq_fd;
90 int n; 90 int n;
91 91
92 if(smp_sigio_handler()) return; 92 if (smp_sigio_handler())
93 while(1){ 93 return;
94
95 while (1) {
94 n = os_waiting_for_events(active_fds); 96 n = os_waiting_for_events(active_fds);
95 if (n <= 0) { 97 if (n <= 0) {
96 if(n == -EINTR) continue; 98 if(n == -EINTR) continue;
97 else break; 99 else break;
98 } 100 }
99 101
100 for(irq_fd = active_fds; irq_fd != NULL; irq_fd = irq_fd->next){ 102 for (irq_fd = active_fds; irq_fd != NULL; irq_fd = irq_fd->next) {
101 if(irq_fd->current_events != 0){ 103 if (irq_fd->current_events != 0) {
102 irq_fd->current_events = 0; 104 irq_fd->current_events = 0;
103 do_IRQ(irq_fd->irq, regs); 105 do_IRQ(irq_fd->irq, regs);
104 } 106 }
@@ -110,19 +112,17 @@ void sigio_handler(int sig, union uml_pt_regs *regs)
110 112
111static void maybe_sigio_broken(int fd, int type) 113static void maybe_sigio_broken(int fd, int type)
112{ 114{
113 if(os_isatty(fd)){ 115 if (os_isatty(fd)) {
114 if((type == IRQ_WRITE) && !pty_output_sigio){ 116 if ((type == IRQ_WRITE) && !pty_output_sigio) {
115 write_sigio_workaround(); 117 write_sigio_workaround();
116 add_sigio_fd(fd, 0); 118 add_sigio_fd(fd, 0);
117 } 119 } else if ((type == IRQ_READ) && !pty_close_sigio) {
118 else if((type == IRQ_READ) && !pty_close_sigio){
119 write_sigio_workaround(); 120 write_sigio_workaround();
120 add_sigio_fd(fd, 1); 121 add_sigio_fd(fd, 1);
121 } 122 }
122 } 123 }
123} 124}
124 125
125
126int activate_fd(int irq, int fd, int type, void *dev_id) 126int activate_fd(int irq, int fd, int type, void *dev_id)
127{ 127{
128 struct pollfd *tmp_pfd; 128 struct pollfd *tmp_pfd;
@@ -132,16 +132,18 @@ int activate_fd(int irq, int fd, int type, void *dev_id)
132 132
133 pid = os_getpid(); 133 pid = os_getpid();
134 err = os_set_fd_async(fd, pid); 134 err = os_set_fd_async(fd, pid);
135 if(err < 0) 135 if (err < 0)
136 goto out; 136 goto out;
137 137
138 new_fd = um_kmalloc(sizeof(*new_fd)); 138 new_fd = um_kmalloc(sizeof(*new_fd));
139 err = -ENOMEM; 139 err = -ENOMEM;
140 if(new_fd == NULL) 140 if (new_fd == NULL)
141 goto out; 141 goto out;
142 142
143 if(type == IRQ_READ) events = UM_POLLIN | UM_POLLPRI; 143 if (type == IRQ_READ)
144 else events = UM_POLLOUT; 144 events = UM_POLLIN | UM_POLLPRI;
145 else
146 events = UM_POLLOUT;
145 *new_fd = ((struct irq_fd) { .next = NULL, 147 *new_fd = ((struct irq_fd) { .next = NULL,
146 .id = dev_id, 148 .id = dev_id,
147 .fd = fd, 149 .fd = fd,
@@ -165,8 +167,8 @@ int activate_fd(int irq, int fd, int type, void *dev_id)
165 * a semaphore. 167 * a semaphore.
166 */ 168 */
167 flags = irq_lock(); 169 flags = irq_lock();
168 for(irq_fd = active_fds; irq_fd != NULL; irq_fd = irq_fd->next){ 170 for (irq_fd = active_fds; irq_fd != NULL; irq_fd = irq_fd->next) {
169 if((irq_fd->fd == fd) && (irq_fd->type == type)){ 171 if ((irq_fd->fd == fd) && (irq_fd->type == type)) {
170 printk("Registering fd %d twice\n", fd); 172 printk("Registering fd %d twice\n", fd);
171 printk("Irqs : %d, %d\n", irq_fd->irq, irq); 173 printk("Irqs : %d, %d\n", irq_fd->irq, irq);
172 printk("Ids : 0x%p, 0x%p\n", irq_fd->id, dev_id); 174 printk("Ids : 0x%p, 0x%p\n", irq_fd->id, dev_id);
@@ -175,13 +177,13 @@ int activate_fd(int irq, int fd, int type, void *dev_id)
175 } 177 }
176 178
177 /*-------------*/ 179 /*-------------*/
178 if(type == IRQ_WRITE) 180 if (type == IRQ_WRITE)
179 fd = -1; 181 fd = -1;
180 182
181 tmp_pfd = NULL; 183 tmp_pfd = NULL;
182 n = 0; 184 n = 0;
183 185
184 while(1){ 186 while (1) {
185 n = os_create_pollfd(fd, events, tmp_pfd, n); 187 n = os_create_pollfd(fd, events, tmp_pfd, n);
186 if (n == 0) 188 if (n == 0)
187 break; 189 break;
@@ -198,10 +200,8 @@ int activate_fd(int irq, int fd, int type, void *dev_id)
198 * then we free the buffer tmp_fds and try again. 200 * then we free the buffer tmp_fds and try again.
199 */ 201 */
200 irq_unlock(flags); 202 irq_unlock(flags);
201 if (tmp_pfd != NULL) { 203 kfree(tmp_pfd);
202 kfree(tmp_pfd); 204 tmp_pfd = NULL;
203 tmp_pfd = NULL;
204 }
205 205
206 tmp_pfd = um_kmalloc(n); 206 tmp_pfd = um_kmalloc(n);
207 if (tmp_pfd == NULL) 207 if (tmp_pfd == NULL)
@@ -249,7 +249,7 @@ static int same_irq_and_dev(struct irq_fd *irq, void *d)
249{ 249{
250 struct irq_and_dev *data = d; 250 struct irq_and_dev *data = d;
251 251
252 return((irq->irq == data->irq) && (irq->id == data->dev)); 252 return ((irq->irq == data->irq) && (irq->id == data->dev));
253} 253}
254 254
255void free_irq_by_irq_and_dev(unsigned int irq, void *dev) 255void free_irq_by_irq_and_dev(unsigned int irq, void *dev)
@@ -262,7 +262,7 @@ void free_irq_by_irq_and_dev(unsigned int irq, void *dev)
262 262
263static int same_fd(struct irq_fd *irq, void *fd) 263static int same_fd(struct irq_fd *irq, void *fd)
264{ 264{
265 return(irq->fd == *((int *) fd)); 265 return (irq->fd == *((int *)fd));
266} 266}
267 267
268void free_irq_by_fd(int fd) 268void free_irq_by_fd(int fd)
@@ -276,16 +276,17 @@ static struct irq_fd *find_irq_by_fd(int fd, int irqnum, int *index_out)
276 int i = 0; 276 int i = 0;
277 int fdi; 277 int fdi;
278 278
279 for(irq=active_fds; irq != NULL; irq = irq->next){ 279 for (irq = active_fds; irq != NULL; irq = irq->next) {
280 if((irq->fd == fd) && (irq->irq == irqnum)) break; 280 if ((irq->fd == fd) && (irq->irq == irqnum))
281 break;
281 i++; 282 i++;
282 } 283 }
283 if(irq == NULL){ 284 if (irq == NULL) {
284 printk("find_irq_by_fd doesn't have descriptor %d\n", fd); 285 printk("find_irq_by_fd doesn't have descriptor %d\n", fd);
285 goto out; 286 goto out;
286 } 287 }
287 fdi = os_get_pollfd(i); 288 fdi = os_get_pollfd(i);
288 if((fdi != -1) && (fdi != fd)){ 289 if ((fdi != -1) && (fdi != fd)) {
289 printk("find_irq_by_fd - mismatch between active_fds and " 290 printk("find_irq_by_fd - mismatch between active_fds and "
290 "pollfds, fd %d vs %d, need %d\n", irq->fd, 291 "pollfds, fd %d vs %d, need %d\n", irq->fd,
291 fdi, fd); 292 fdi, fd);
@@ -294,7 +295,7 @@ static struct irq_fd *find_irq_by_fd(int fd, int irqnum, int *index_out)
294 } 295 }
295 *index_out = i; 296 *index_out = i;
296 out: 297 out:
297 return(irq); 298 return irq;
298} 299}
299 300
300void reactivate_fd(int fd, int irqnum) 301void reactivate_fd(int fd, int irqnum)
@@ -305,7 +306,7 @@ void reactivate_fd(int fd, int irqnum)
305 306
306 flags = irq_lock(); 307 flags = irq_lock();
307 irq = find_irq_by_fd(fd, irqnum, &i); 308 irq = find_irq_by_fd(fd, irqnum, &i);
308 if(irq == NULL){ 309 if (irq == NULL) {
309 irq_unlock(flags); 310 irq_unlock(flags);
310 return; 311 return;
311 } 312 }
@@ -326,7 +327,7 @@ void deactivate_fd(int fd, int irqnum)
326 327
327 flags = irq_lock(); 328 flags = irq_lock();
328 irq = find_irq_by_fd(fd, irqnum, &i); 329 irq = find_irq_by_fd(fd, irqnum, &i);
329 if(irq == NULL) 330 if (irq == NULL)
330 goto out; 331 goto out;
331 os_set_pollfd(i, -1); 332 os_set_pollfd(i, -1);
332 out: 333 out:
@@ -338,15 +339,15 @@ int deactivate_all_fds(void)
338 struct irq_fd *irq; 339 struct irq_fd *irq;
339 int err; 340 int err;
340 341
341 for(irq=active_fds;irq != NULL;irq = irq->next){ 342 for (irq = active_fds; irq != NULL; irq = irq->next) {
342 err = os_clear_fd_async(irq->fd); 343 err = os_clear_fd_async(irq->fd);
343 if(err) 344 if (err)
344 return(err); 345 return err;
345 } 346 }
346 /* If there is a signal already queued, after unblocking ignore it */ 347 /* If there is a signal already queued, after unblocking ignore it */
347 os_set_ioignore(); 348 os_set_ioignore();
348 349
349 return(0); 350 return 0;
350} 351}
351 352
352void forward_interrupts(int pid) 353void forward_interrupts(int pid)
@@ -356,9 +357,9 @@ void forward_interrupts(int pid)
356 int err; 357 int err;
357 358
358 flags = irq_lock(); 359 flags = irq_lock();
359 for(irq=active_fds;irq != NULL;irq = irq->next){ 360 for (irq = active_fds; irq != NULL; irq = irq->next) {
360 err = os_set_owner(irq->fd, pid); 361 err = os_set_owner(irq->fd, pid);
361 if(err < 0){ 362 if (err < 0) {
362 /* XXX Just remove the irq rather than 363 /* XXX Just remove the irq rather than
363 * print out an infinite stream of these 364 * print out an infinite stream of these
364 */ 365 */
@@ -379,7 +380,7 @@ void forward_interrupts(int pid)
379unsigned int do_IRQ(int irq, union uml_pt_regs *regs) 380unsigned int do_IRQ(int irq, union uml_pt_regs *regs)
380{ 381{
381 irq_enter(); 382 irq_enter();
382 __do_IRQ(irq, (struct pt_regs *) regs); 383 __do_IRQ(irq, (struct pt_regs *)regs);
383 irq_exit(); 384 irq_exit();
384 return 1; 385 return 1;
385} 386}
@@ -392,12 +393,12 @@ int um_request_irq(unsigned int irq, int fd, int type,
392 int err; 393 int err;
393 394
394 err = request_irq(irq, handler, irqflags, devname, dev_id); 395 err = request_irq(irq, handler, irqflags, devname, dev_id);
395 if(err) 396 if (err)
396 return(err); 397 return err;
397 398
398 if(fd != -1) 399 if (fd != -1)
399 err = activate_fd(irq, fd, type, dev_id); 400 err = activate_fd(irq, fd, type, dev_id);
400 return(err); 401 return err;
401} 402}
402EXPORT_SYMBOL(um_request_irq); 403EXPORT_SYMBOL(um_request_irq);
403EXPORT_SYMBOL(reactivate_fd); 404EXPORT_SYMBOL(reactivate_fd);
@@ -409,7 +410,7 @@ unsigned long irq_lock(void)
409 unsigned long flags; 410 unsigned long flags;
410 411
411 spin_lock_irqsave(&irq_spinlock, flags); 412 spin_lock_irqsave(&irq_spinlock, flags);
412 return(flags); 413 return flags;
413} 414}
414 415
415void irq_unlock(unsigned long flags) 416void irq_unlock(unsigned long flags)
@@ -452,7 +453,7 @@ void __init init_IRQ(void)
452 irq_desc[TIMER_IRQ].depth = 1; 453 irq_desc[TIMER_IRQ].depth = 1;
453 irq_desc[TIMER_IRQ].handler = &SIGVTALRM_irq_type; 454 irq_desc[TIMER_IRQ].handler = &SIGVTALRM_irq_type;
454 enable_irq(TIMER_IRQ); 455 enable_irq(TIMER_IRQ);
455 for(i=1;i<NR_IRQS;i++){ 456 for (i = 1; i < NR_IRQS; i++) {
456 irq_desc[i].status = IRQ_DISABLED; 457 irq_desc[i].status = IRQ_DISABLED;
457 irq_desc[i].action = NULL; 458 irq_desc[i].action = NULL;
458 irq_desc[i].depth = 1; 459 irq_desc[i].depth = 1;
@@ -467,7 +468,7 @@ int init_aio_irq(int irq, char *name, irqreturn_t (*handler)(int, void *,
467 int fds[2], err; 468 int fds[2], err;
468 469
469 err = os_pipe(fds, 1, 1); 470 err = os_pipe(fds, 1, 1);
470 if(err){ 471 if (err) {
471 printk("init_aio_irq - os_pipe failed, err = %d\n", -err); 472 printk("init_aio_irq - os_pipe failed, err = %d\n", -err);
472 goto out; 473 goto out;
473 } 474 }
@@ -475,7 +476,7 @@ int init_aio_irq(int irq, char *name, irqreturn_t (*handler)(int, void *,
475 err = um_request_irq(irq, fds[0], IRQ_READ, handler, 476 err = um_request_irq(irq, fds[0], IRQ_READ, handler,
476 SA_INTERRUPT | SA_SAMPLE_RANDOM, name, 477 SA_INTERRUPT | SA_SAMPLE_RANDOM, name,
477 (void *) (long) fds[0]); 478 (void *) (long) fds[0]);
478 if(err){ 479 if (err) {
479 printk("init_aio_irq - : um_request_irq failed, err = %d\n", 480 printk("init_aio_irq - : um_request_irq failed, err = %d\n",
480 err); 481 err);
481 goto out_close; 482 goto out_close;
@@ -488,5 +489,5 @@ int init_aio_irq(int irq, char *name, irqreturn_t (*handler)(int, void *,
488 os_close_file(fds[0]); 489 os_close_file(fds[0]);
489 os_close_file(fds[1]); 490 os_close_file(fds[1]);
490 out: 491 out:
491 return(err); 492 return err;
492} 493}
diff --git a/arch/um/kernel/physmem.c b/arch/um/kernel/physmem.c
index 0500800df1c1..fc0f0b085ca7 100644
--- a/arch/um/kernel/physmem.c
+++ b/arch/um/kernel/physmem.c
@@ -407,6 +407,8 @@ unsigned long find_iomem(char *driver, unsigned long *len_out)
407 *len_out = region->size; 407 *len_out = region->size;
408 return(region->virt); 408 return(region->virt);
409 } 409 }
410
411 region = region->next;
410 } 412 }
411 413
412 return(0); 414 return(0);
diff --git a/arch/um/kernel/ptrace.c b/arch/um/kernel/ptrace.c
index 60d2eda995c1..9a77fb3c269d 100644
--- a/arch/um/kernel/ptrace.c
+++ b/arch/um/kernel/ptrace.c
@@ -275,15 +275,13 @@ void syscall_trace(union uml_pt_regs *regs, int entryexit)
275 275
276 if (unlikely(current->audit_context)) { 276 if (unlikely(current->audit_context)) {
277 if (!entryexit) 277 if (!entryexit)
278 audit_syscall_entry(current, 278 audit_syscall_entry(HOST_AUDIT_ARCH,
279 HOST_AUDIT_ARCH,
280 UPT_SYSCALL_NR(regs), 279 UPT_SYSCALL_NR(regs),
281 UPT_SYSCALL_ARG1(regs), 280 UPT_SYSCALL_ARG1(regs),
282 UPT_SYSCALL_ARG2(regs), 281 UPT_SYSCALL_ARG2(regs),
283 UPT_SYSCALL_ARG3(regs), 282 UPT_SYSCALL_ARG3(regs),
284 UPT_SYSCALL_ARG4(regs)); 283 UPT_SYSCALL_ARG4(regs));
285 else audit_syscall_exit(current, 284 else audit_syscall_exit(AUDITSC_RESULT(UPT_SYSCALL_RET(regs)),
286 AUDITSC_RESULT(UPT_SYSCALL_RET(regs)),
287 UPT_SYSCALL_RET(regs)); 285 UPT_SYSCALL_RET(regs));
288 } 286 }
289 287
diff --git a/arch/um/kernel/skas/Makefile b/arch/um/kernel/skas/Makefile
index 57181a920d48..ea3a8e409a6e 100644
--- a/arch/um/kernel/skas/Makefile
+++ b/arch/um/kernel/skas/Makefile
@@ -6,9 +6,11 @@
6obj-y := clone.o exec_kern.o mem.o mmu.o process_kern.o \ 6obj-y := clone.o exec_kern.o mem.o mmu.o process_kern.o \
7 syscall.o tlb.o uaccess.o 7 syscall.o tlb.o uaccess.o
8 8
9USER_OBJS := clone.o 9# clone.o is in the stub, so it can't be built with profiling
10# GCC hardened also auto-enables -fpic, but we need %ebx so it can't work ->
11# disable it
10 12
11include arch/um/scripts/Makefile.rules 13CFLAGS_clone.o := $(CFLAGS_NO_HARDENING)
14UNPROFILE_OBJS := clone.o
12 15
13# clone.o is in the stub, so it can't be built with profiling 16include arch/um/scripts/Makefile.rules
14$(obj)/clone.o : c_flags = -Wp,-MD,$(depfile) $(call unprofile,$(USER_CFLAGS))
diff --git a/arch/um/kernel/time_kern.c b/arch/um/kernel/time_kern.c
index 3c7626cdba4b..86f51d04c98d 100644
--- a/arch/um/kernel/time_kern.c
+++ b/arch/um/kernel/time_kern.c
@@ -84,6 +84,16 @@ void timer_irq(union uml_pt_regs *regs)
84 } 84 }
85} 85}
86 86
87
88void time_init_kern(void)
89{
90 unsigned long long nsecs;
91
92 nsecs = os_nsecs();
93 set_normalized_timespec(&wall_to_monotonic, -nsecs / BILLION,
94 -nsecs % BILLION);
95}
96
87void do_boot_timer_handler(struct sigcontext * sc) 97void do_boot_timer_handler(struct sigcontext * sc)
88{ 98{
89 struct pt_regs regs; 99 struct pt_regs regs;
@@ -209,4 +219,4 @@ int __init timer_init(void)
209 return(0); 219 return(0);
210} 220}
211 221
212__initcall(timer_init); 222arch_initcall(timer_init);
diff --git a/arch/um/os-Linux/file.c b/arch/um/os-Linux/file.c
index 3bd10deea280..09251338d99e 100644
--- a/arch/um/os-Linux/file.c
+++ b/arch/um/os-Linux/file.c
@@ -171,7 +171,7 @@ int os_sigio_async(int master, int slave)
171 171
172 flags = fcntl(master, F_GETFL); 172 flags = fcntl(master, F_GETFL);
173 if(flags < 0) 173 if(flags < 0)
174 return errno; 174 return -errno;
175 175
176 if((fcntl(master, F_SETFL, flags | O_NONBLOCK | O_ASYNC) < 0) || 176 if((fcntl(master, F_SETFL, flags | O_NONBLOCK | O_ASYNC) < 0) ||
177 (fcntl(master, F_SETOWN, os_getpid()) < 0)) 177 (fcntl(master, F_SETOWN, os_getpid()) < 0))
diff --git a/arch/um/os-Linux/irq.c b/arch/um/os-Linux/irq.c
index e599be423da1..3788d4568d33 100644
--- a/arch/um/os-Linux/irq.c
+++ b/arch/um/os-Linux/irq.c
@@ -29,21 +29,21 @@ int os_waiting_for_events(struct irq_fd *active_fds)
29 int i, n, err; 29 int i, n, err;
30 30
31 n = poll(pollfds, pollfds_num, 0); 31 n = poll(pollfds, pollfds_num, 0);
32 if(n < 0){ 32 if (n < 0) {
33 err = -errno; 33 err = -errno;
34 if(errno != EINTR) 34 if (errno != EINTR)
35 printk("sigio_handler: os_waiting_for_events:" 35 printk("sigio_handler: os_waiting_for_events:"
36 " poll returned %d, errno = %d\n", n, errno); 36 " poll returned %d, errno = %d\n", n, errno);
37 return err; 37 return err;
38 } 38 }
39 39
40 if(n == 0) 40 if (n == 0)
41 return 0; 41 return 0;
42 42
43 irq_fd = active_fds; 43 irq_fd = active_fds;
44 44
45 for(i = 0; i < pollfds_num; i++){ 45 for (i = 0; i < pollfds_num; i++) {
46 if(pollfds[i].revents != 0){ 46 if (pollfds[i].revents != 0) {
47 irq_fd->current_events = pollfds[i].revents; 47 irq_fd->current_events = pollfds[i].revents;
48 pollfds[i].fd = -1; 48 pollfds[i].fd = -1;
49 } 49 }
@@ -54,7 +54,7 @@ int os_waiting_for_events(struct irq_fd *active_fds)
54 54
55int os_isatty(int fd) 55int os_isatty(int fd)
56{ 56{
57 return(isatty(fd)); 57 return isatty(fd);
58} 58}
59 59
60int os_create_pollfd(int fd, int events, void *tmp_pfd, int size_tmpfds) 60int os_create_pollfd(int fd, int events, void *tmp_pfd, int size_tmpfds)
@@ -65,7 +65,7 @@ int os_create_pollfd(int fd, int events, void *tmp_pfd, int size_tmpfds)
65 return((pollfds_size + 1) * sizeof(pollfds[0])); 65 return((pollfds_size + 1) * sizeof(pollfds[0]));
66 } 66 }
67 67
68 if(pollfds != NULL){ 68 if (pollfds != NULL) {
69 memcpy(tmp_pfd, pollfds, 69 memcpy(tmp_pfd, pollfds,
70 sizeof(pollfds[0]) * pollfds_size); 70 sizeof(pollfds[0]) * pollfds_size);
71 /* remove old pollfds */ 71 /* remove old pollfds */
@@ -73,18 +73,15 @@ int os_create_pollfd(int fd, int events, void *tmp_pfd, int size_tmpfds)
73 } 73 }
74 pollfds = tmp_pfd; 74 pollfds = tmp_pfd;
75 pollfds_size++; 75 pollfds_size++;
76 } else { 76 } else
77 /* remove not used tmp_pfd */ 77 kfree(tmp_pfd); /* remove not used tmp_pfd */
78 if (tmp_pfd != NULL)
79 kfree(tmp_pfd);
80 }
81 78
82 pollfds[pollfds_num] = ((struct pollfd) { .fd = fd, 79 pollfds[pollfds_num] = ((struct pollfd) { .fd = fd,
83 .events = events, 80 .events = events,
84 .revents = 0 }); 81 .revents = 0 });
85 pollfds_num++; 82 pollfds_num++;
86 83
87 return(0); 84 return 0;
88} 85}
89 86
90void os_free_irq_by_cb(int (*test)(struct irq_fd *, void *), void *arg, 87void os_free_irq_by_cb(int (*test)(struct irq_fd *, void *), void *arg,
@@ -94,11 +91,11 @@ void os_free_irq_by_cb(int (*test)(struct irq_fd *, void *), void *arg,
94 int i = 0; 91 int i = 0;
95 92
96 prev = &active_fds; 93 prev = &active_fds;
97 while(*prev != NULL){ 94 while (*prev != NULL) {
98 if((*test)(*prev, arg)){ 95 if ((*test)(*prev, arg)) {
99 struct irq_fd *old_fd = *prev; 96 struct irq_fd *old_fd = *prev;
100 if((pollfds[i].fd != -1) && 97 if ((pollfds[i].fd != -1) &&
101 (pollfds[i].fd != (*prev)->fd)){ 98 (pollfds[i].fd != (*prev)->fd)) {
102 printk("os_free_irq_by_cb - mismatch between " 99 printk("os_free_irq_by_cb - mismatch between "
103 "active_fds and pollfds, fd %d vs %d\n", 100 "active_fds and pollfds, fd %d vs %d\n",
104 (*prev)->fd, pollfds[i].fd); 101 (*prev)->fd, pollfds[i].fd);
@@ -110,7 +107,6 @@ void os_free_irq_by_cb(int (*test)(struct irq_fd *, void *), void *arg,
110 /* This moves the *whole* array after pollfds[i] 107 /* This moves the *whole* array after pollfds[i]
111 * (though it doesn't spot as such)! 108 * (though it doesn't spot as such)!
112 */ 109 */
113
114 memmove(&pollfds[i], &pollfds[i + 1], 110 memmove(&pollfds[i], &pollfds[i + 1],
115 (pollfds_num - i) * sizeof(pollfds[0])); 111 (pollfds_num - i) * sizeof(pollfds[0]));
116 if(*last_irq_ptr2 == &old_fd->next) 112 if(*last_irq_ptr2 == &old_fd->next)
@@ -129,10 +125,9 @@ void os_free_irq_by_cb(int (*test)(struct irq_fd *, void *), void *arg,
129 return; 125 return;
130} 126}
131 127
132
133int os_get_pollfd(int i) 128int os_get_pollfd(int i)
134{ 129{
135 return(pollfds[i].fd); 130 return pollfds[i].fd;
136} 131}
137 132
138void os_set_pollfd(int i, int fd) 133void os_set_pollfd(int i, int fd)
@@ -151,8 +146,10 @@ void init_irq_signals(int on_sigstack)
151 int flags; 146 int flags;
152 147
153 flags = on_sigstack ? SA_ONSTACK : 0; 148 flags = on_sigstack ? SA_ONSTACK : 0;
154 if(timer_irq_inited) h = (__sighandler_t) alarm_handler; 149 if (timer_irq_inited)
155 else h = boot_timer_handler; 150 h = (__sighandler_t)alarm_handler;
151 else
152 h = boot_timer_handler;
156 153
157 set_handler(SIGVTALRM, h, flags | SA_RESTART, 154 set_handler(SIGVTALRM, h, flags | SA_RESTART,
158 SIGUSR1, SIGIO, SIGWINCH, SIGALRM, -1); 155 SIGUSR1, SIGIO, SIGWINCH, SIGALRM, -1);
diff --git a/arch/um/os-Linux/main.c b/arch/um/os-Linux/main.c
index 2878e89a674f..90912aaca7aa 100644
--- a/arch/um/os-Linux/main.c
+++ b/arch/um/os-Linux/main.c
@@ -59,7 +59,7 @@ static __init void do_uml_initcalls(void)
59 initcall_t *call; 59 initcall_t *call;
60 60
61 call = &__uml_initcall_start; 61 call = &__uml_initcall_start;
62 while (call < &__uml_initcall_end){; 62 while (call < &__uml_initcall_end){
63 (*call)(); 63 (*call)();
64 call++; 64 call++;
65 } 65 }
@@ -74,6 +74,34 @@ static void last_ditch_exit(int sig)
74 exit(1); 74 exit(1);
75} 75}
76 76
77#define UML_LIB_PATH ":/usr/lib/uml"
78
79static void setup_env_path(void)
80{
81 char *new_path = NULL;
82 char *old_path = NULL;
83 int path_len = 0;
84
85 old_path = getenv("PATH");
86 /* if no PATH variable is set or it has an empty value
87 * just use the default + /usr/lib/uml
88 */
89 if (!old_path || (path_len = strlen(old_path)) == 0) {
90 putenv("PATH=:/bin:/usr/bin/" UML_LIB_PATH);
91 return;
92 }
93
94 /* append /usr/lib/uml to the existing path */
95 path_len += strlen("PATH=" UML_LIB_PATH) + 1;
96 new_path = malloc(path_len);
97 if (!new_path) {
98 perror("coudn't malloc to set a new PATH");
99 return;
100 }
101 snprintf(new_path, path_len, "PATH=%s" UML_LIB_PATH, old_path);
102 putenv(new_path);
103}
104
77extern int uml_exitcode; 105extern int uml_exitcode;
78 106
79extern void scan_elf_aux( char **envp); 107extern void scan_elf_aux( char **envp);
@@ -114,6 +142,8 @@ int main(int argc, char **argv, char **envp)
114 142
115 set_stklim(); 143 set_stklim();
116 144
145 setup_env_path();
146
117 new_argv = malloc((argc + 1) * sizeof(char *)); 147 new_argv = malloc((argc + 1) * sizeof(char *));
118 if(new_argv == NULL){ 148 if(new_argv == NULL){
119 perror("Mallocing argv"); 149 perror("Mallocing argv");
diff --git a/arch/um/os-Linux/mem.c b/arch/um/os-Linux/mem.c
index 71bb90a7606d..c6432e729241 100644
--- a/arch/um/os-Linux/mem.c
+++ b/arch/um/os-Linux/mem.c
@@ -8,6 +8,7 @@
8#include <fcntl.h> 8#include <fcntl.h>
9#include <sys/types.h> 9#include <sys/types.h>
10#include <sys/mman.h> 10#include <sys/mman.h>
11#include <sys/statfs.h>
11#include "kern_util.h" 12#include "kern_util.h"
12#include "user.h" 13#include "user.h"
13#include "user_util.h" 14#include "user_util.h"
@@ -19,6 +20,7 @@
19 20
20#include <sys/param.h> 21#include <sys/param.h>
21 22
23static char *default_tmpdir = "/tmp";
22static char *tempdir = NULL; 24static char *tempdir = NULL;
23 25
24static void __init find_tempdir(void) 26static void __init find_tempdir(void)
@@ -34,7 +36,7 @@ static void __init find_tempdir(void)
34 break; 36 break;
35 } 37 }
36 if((dir == NULL) || (*dir == '\0')) 38 if((dir == NULL) || (*dir == '\0'))
37 dir = "/tmp"; 39 dir = default_tmpdir;
38 40
39 tempdir = malloc(strlen(dir) + 2); 41 tempdir = malloc(strlen(dir) + 2);
40 if(tempdir == NULL){ 42 if(tempdir == NULL){
@@ -46,6 +48,96 @@ static void __init find_tempdir(void)
46 strcat(tempdir, "/"); 48 strcat(tempdir, "/");
47} 49}
48 50
51/* This will return 1, with the first character in buf being the
52 * character following the next instance of c in the file. This will
53 * read the file as needed. If there's an error, -errno is returned;
54 * if the end of the file is reached, 0 is returned.
55 */
56static int next(int fd, char *buf, int size, char c)
57{
58 int n;
59 char *ptr;
60
61 while((ptr = strchr(buf, c)) == NULL){
62 n = read(fd, buf, size - 1);
63 if(n == 0)
64 return 0;
65 else if(n < 0)
66 return -errno;
67
68 buf[n] = '\0';
69 }
70
71 ptr++;
72 memmove(buf, ptr, strlen(ptr) + 1);
73 return 1;
74}
75
76static int checked_tmpdir = 0;
77
78/* Look for a tmpfs mounted at /dev/shm. I couldn't find a cleaner
79 * way to do this than to parse /proc/mounts. statfs will return the
80 * same filesystem magic number and fs id for both /dev and /dev/shm
81 * when they are both tmpfs, so you can't tell if they are different
82 * filesystems. Also, there seems to be no other way of finding the
83 * mount point of a filesystem from within it.
84 *
85 * If a /dev/shm tmpfs entry is found, then we switch to using it.
86 * Otherwise, we stay with the default /tmp.
87 */
88static void which_tmpdir(void)
89{
90 int fd, found;
91 char buf[128] = { '\0' };
92
93 if(checked_tmpdir)
94 return;
95
96 checked_tmpdir = 1;
97
98 printf("Checking for tmpfs mount on /dev/shm...");
99
100 fd = open("/proc/mounts", O_RDONLY);
101 if(fd < 0){
102 printf("failed to open /proc/mounts, errno = %d\n", errno);
103 return;
104 }
105
106 while(1){
107 found = next(fd, buf, sizeof(buf) / sizeof(buf[0]), ' ');
108 if(found != 1)
109 break;
110
111 if(!strncmp(buf, "/dev/shm", strlen("/dev/shm")))
112 goto found;
113
114 found = next(fd, buf, sizeof(buf) / sizeof(buf[0]), '\n');
115 if(found != 1)
116 break;
117 }
118
119err:
120 if(found == 0)
121 printf("nothing mounted on /dev/shm\n");
122 else if(found < 0)
123 printf("read returned errno %d\n", -found);
124
125 return;
126
127found:
128 found = next(fd, buf, sizeof(buf) / sizeof(buf[0]), ' ');
129 if(found != 1)
130 goto err;
131
132 if(strncmp(buf, "tmpfs", strlen("tmpfs"))){
133 printf("not tmpfs\n");
134 return;
135 }
136
137 printf("OK\n");
138 default_tmpdir = "/dev/shm";
139}
140
49/* 141/*
50 * This proc still used in tt-mode 142 * This proc still used in tt-mode
51 * (file: kernel/tt/ptproxy/proxy.c, proc: start_debugger). 143 * (file: kernel/tt/ptproxy/proxy.c, proc: start_debugger).
@@ -56,6 +148,7 @@ int make_tempfile(const char *template, char **out_tempname, int do_unlink)
56 char *tempname; 148 char *tempname;
57 int fd; 149 int fd;
58 150
151 which_tmpdir();
59 tempname = malloc(MAXPATHLEN); 152 tempname = malloc(MAXPATHLEN);
60 153
61 find_tempdir(); 154 find_tempdir();
@@ -137,3 +230,26 @@ int create_mem_file(unsigned long long len)
137 } 230 }
138 return(fd); 231 return(fd);
139} 232}
233
234
235void check_tmpexec(void)
236{
237 void *addr;
238 int err, fd = create_tmp_file(UM_KERN_PAGE_SIZE);
239
240 addr = mmap(NULL, UM_KERN_PAGE_SIZE,
241 PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE, fd, 0);
242 printf("Checking PROT_EXEC mmap in %s...",tempdir);
243 fflush(stdout);
244 if(addr == MAP_FAILED){
245 err = errno;
246 perror("failed");
247 if(err == EPERM)
248 printf("%s must be not mounted noexec\n",tempdir);
249 exit(1);
250 }
251 printf("OK\n");
252 munmap(addr, UM_KERN_PAGE_SIZE);
253
254 close(fd);
255}
diff --git a/arch/um/os-Linux/process.c b/arch/um/os-Linux/process.c
index 8176b0b52047..233be2f4f8cb 100644
--- a/arch/um/os-Linux/process.c
+++ b/arch/um/os-Linux/process.c
@@ -190,7 +190,7 @@ int os_unmap_memory(void *addr, int len)
190} 190}
191 191
192#ifndef MADV_REMOVE 192#ifndef MADV_REMOVE
193#define MADV_REMOVE 0x5 /* remove these pages & resources */ 193#define MADV_REMOVE KERNEL_MADV_REMOVE
194#endif 194#endif
195 195
196int os_drop_memory(void *addr, int length) 196int os_drop_memory(void *addr, int length)
@@ -206,29 +206,36 @@ int os_drop_memory(void *addr, int length)
206int can_drop_memory(void) 206int can_drop_memory(void)
207{ 207{
208 void *addr; 208 void *addr;
209 int fd; 209 int fd, ok = 0;
210 210
211 printk("Checking host MADV_REMOVE support..."); 211 printk("Checking host MADV_REMOVE support...");
212 fd = create_mem_file(UM_KERN_PAGE_SIZE); 212 fd = create_mem_file(UM_KERN_PAGE_SIZE);
213 if(fd < 0){ 213 if(fd < 0){
214 printk("Creating test memory file failed, err = %d\n", -fd); 214 printk("Creating test memory file failed, err = %d\n", -fd);
215 return 0; 215 goto out;
216 } 216 }
217 217
218 addr = mmap64(NULL, UM_KERN_PAGE_SIZE, PROT_READ | PROT_WRITE, 218 addr = mmap64(NULL, UM_KERN_PAGE_SIZE, PROT_READ | PROT_WRITE,
219 MAP_PRIVATE, fd, 0); 219 MAP_SHARED, fd, 0);
220 if(addr == MAP_FAILED){ 220 if(addr == MAP_FAILED){
221 printk("Mapping test memory file failed, err = %d\n", -errno); 221 printk("Mapping test memory file failed, err = %d\n", -errno);
222 return 0; 222 goto out_close;
223 } 223 }
224 224
225 if(madvise(addr, UM_KERN_PAGE_SIZE, MADV_REMOVE) != 0){ 225 if(madvise(addr, UM_KERN_PAGE_SIZE, MADV_REMOVE) != 0){
226 printk("MADV_REMOVE failed, err = %d\n", -errno); 226 printk("MADV_REMOVE failed, err = %d\n", -errno);
227 return 0; 227 goto out_unmap;
228 } 228 }
229 229
230 printk("OK\n"); 230 printk("OK\n");
231 return 1; 231 ok = 1;
232
233out_unmap:
234 munmap(addr, UM_KERN_PAGE_SIZE);
235out_close:
236 close(fd);
237out:
238 return ok;
232} 239}
233 240
234void init_new_thread_stack(void *sig_stack, void (*usr1_handler)(int)) 241void init_new_thread_stack(void *sig_stack, void (*usr1_handler)(int))
@@ -266,11 +273,11 @@ void init_new_thread_signals(int altstack)
266 273
267int run_kernel_thread(int (*fn)(void *), void *arg, void **jmp_ptr) 274int run_kernel_thread(int (*fn)(void *), void *arg, void **jmp_ptr)
268{ 275{
269 sigjmp_buf buf; 276 jmp_buf buf;
270 int n, enable; 277 int n, enable;
271 278
272 *jmp_ptr = &buf; 279 *jmp_ptr = &buf;
273 n = UML_SIGSETJMP(&buf, enable); 280 n = UML_SETJMP(&buf, enable);
274 if(n != 0) 281 if(n != 0)
275 return(n); 282 return(n);
276 (*fn)(arg); 283 (*fn)(arg);
diff --git a/arch/um/os-Linux/skas/process.c b/arch/um/os-Linux/skas/process.c
index 045ae0037456..bd89c6b99d5d 100644
--- a/arch/um/os-Linux/skas/process.c
+++ b/arch/um/os-Linux/skas/process.c
@@ -344,12 +344,12 @@ int copy_context_skas0(unsigned long new_stack, int pid)
344 err = ptrace_setregs(pid, regs); 344 err = ptrace_setregs(pid, regs);
345 if(err < 0) 345 if(err < 0)
346 panic("copy_context_skas0 : PTRACE_SETREGS failed, " 346 panic("copy_context_skas0 : PTRACE_SETREGS failed, "
347 "pid = %d, errno = %d\n", pid, errno); 347 "pid = %d, errno = %d\n", pid, -err);
348 348
349 err = ptrace_setfpregs(pid, fp_regs); 349 err = ptrace_setfpregs(pid, fp_regs);
350 if(err < 0) 350 if(err < 0)
351 panic("copy_context_skas0 : PTRACE_SETFPREGS failed, " 351 panic("copy_context_skas0 : PTRACE_SETFPREGS failed, "
352 "pid = %d, errno = %d\n", pid, errno); 352 "pid = %d, errno = %d\n", pid, -err);
353 353
354 /* set a well known return code for detection of child write failure */ 354 /* set a well known return code for detection of child write failure */
355 child_data->err = 12345678; 355 child_data->err = 12345678;
@@ -362,7 +362,7 @@ int copy_context_skas0(unsigned long new_stack, int pid)
362 pid = data->err; 362 pid = data->err;
363 if(pid < 0) 363 if(pid < 0)
364 panic("copy_context_skas0 - stub-parent reports error %d\n", 364 panic("copy_context_skas0 - stub-parent reports error %d\n",
365 pid); 365 -pid);
366 366
367 /* Wait, until child has finished too: read child's result from 367 /* Wait, until child has finished too: read child's result from
368 * child's stack and check it. 368 * child's stack and check it.
@@ -434,7 +434,7 @@ void new_thread(void *stack, void **switch_buf_ptr, void **fork_buf_ptr,
434 void (*handler)(int)) 434 void (*handler)(int))
435{ 435{
436 unsigned long flags; 436 unsigned long flags;
437 sigjmp_buf switch_buf, fork_buf; 437 jmp_buf switch_buf, fork_buf;
438 int enable; 438 int enable;
439 439
440 *switch_buf_ptr = &switch_buf; 440 *switch_buf_ptr = &switch_buf;
@@ -450,7 +450,7 @@ void new_thread(void *stack, void **switch_buf_ptr, void **fork_buf_ptr,
450 */ 450 */
451 flags = get_signals(); 451 flags = get_signals();
452 block_signals(); 452 block_signals();
453 if(UML_SIGSETJMP(&fork_buf, enable) == 0) 453 if(UML_SETJMP(&fork_buf, enable) == 0)
454 new_thread_proc(stack, handler); 454 new_thread_proc(stack, handler);
455 455
456 remove_sigstack(); 456 remove_sigstack();
@@ -466,35 +466,35 @@ void new_thread(void *stack, void **switch_buf_ptr, void **fork_buf_ptr,
466 466
467void thread_wait(void *sw, void *fb) 467void thread_wait(void *sw, void *fb)
468{ 468{
469 sigjmp_buf buf, **switch_buf = sw, *fork_buf; 469 jmp_buf buf, **switch_buf = sw, *fork_buf;
470 int enable; 470 int enable;
471 471
472 *switch_buf = &buf; 472 *switch_buf = &buf;
473 fork_buf = fb; 473 fork_buf = fb;
474 if(UML_SIGSETJMP(&buf, enable) == 0) 474 if(UML_SETJMP(&buf, enable) == 0)
475 siglongjmp(*fork_buf, INIT_JMP_REMOVE_SIGSTACK); 475 siglongjmp(*fork_buf, INIT_JMP_REMOVE_SIGSTACK);
476} 476}
477 477
478void switch_threads(void *me, void *next) 478void switch_threads(void *me, void *next)
479{ 479{
480 sigjmp_buf my_buf, **me_ptr = me, *next_buf = next; 480 jmp_buf my_buf, **me_ptr = me, *next_buf = next;
481 int enable; 481 int enable;
482 482
483 *me_ptr = &my_buf; 483 *me_ptr = &my_buf;
484 if(UML_SIGSETJMP(&my_buf, enable) == 0) 484 if(UML_SETJMP(&my_buf, enable) == 0)
485 UML_SIGLONGJMP(next_buf, 1); 485 UML_LONGJMP(next_buf, 1);
486} 486}
487 487
488static sigjmp_buf initial_jmpbuf; 488static jmp_buf initial_jmpbuf;
489 489
490/* XXX Make these percpu */ 490/* XXX Make these percpu */
491static void (*cb_proc)(void *arg); 491static void (*cb_proc)(void *arg);
492static void *cb_arg; 492static void *cb_arg;
493static sigjmp_buf *cb_back; 493static jmp_buf *cb_back;
494 494
495int start_idle_thread(void *stack, void *switch_buf_ptr, void **fork_buf_ptr) 495int start_idle_thread(void *stack, void *switch_buf_ptr, void **fork_buf_ptr)
496{ 496{
497 sigjmp_buf **switch_buf = switch_buf_ptr; 497 jmp_buf **switch_buf = switch_buf_ptr;
498 int n, enable; 498 int n, enable;
499 499
500 set_handler(SIGWINCH, (__sighandler_t) sig_handler, 500 set_handler(SIGWINCH, (__sighandler_t) sig_handler,
@@ -502,7 +502,7 @@ int start_idle_thread(void *stack, void *switch_buf_ptr, void **fork_buf_ptr)
502 SIGVTALRM, -1); 502 SIGVTALRM, -1);
503 503
504 *fork_buf_ptr = &initial_jmpbuf; 504 *fork_buf_ptr = &initial_jmpbuf;
505 n = UML_SIGSETJMP(&initial_jmpbuf, enable); 505 n = UML_SETJMP(&initial_jmpbuf, enable);
506 switch(n){ 506 switch(n){
507 case INIT_JMP_NEW_THREAD: 507 case INIT_JMP_NEW_THREAD:
508 new_thread_proc((void *) stack, new_thread_handler); 508 new_thread_proc((void *) stack, new_thread_handler);
@@ -512,7 +512,7 @@ int start_idle_thread(void *stack, void *switch_buf_ptr, void **fork_buf_ptr)
512 break; 512 break;
513 case INIT_JMP_CALLBACK: 513 case INIT_JMP_CALLBACK:
514 (*cb_proc)(cb_arg); 514 (*cb_proc)(cb_arg);
515 UML_SIGLONGJMP(cb_back, 1); 515 UML_LONGJMP(cb_back, 1);
516 break; 516 break;
517 case INIT_JMP_HALT: 517 case INIT_JMP_HALT:
518 kmalloc_ok = 0; 518 kmalloc_ok = 0;
@@ -523,12 +523,12 @@ int start_idle_thread(void *stack, void *switch_buf_ptr, void **fork_buf_ptr)
523 default: 523 default:
524 panic("Bad sigsetjmp return in start_idle_thread - %d\n", n); 524 panic("Bad sigsetjmp return in start_idle_thread - %d\n", n);
525 } 525 }
526 UML_SIGLONGJMP(*switch_buf, 1); 526 UML_LONGJMP(*switch_buf, 1);
527} 527}
528 528
529void initial_thread_cb_skas(void (*proc)(void *), void *arg) 529void initial_thread_cb_skas(void (*proc)(void *), void *arg)
530{ 530{
531 sigjmp_buf here; 531 jmp_buf here;
532 int enable; 532 int enable;
533 533
534 cb_proc = proc; 534 cb_proc = proc;
@@ -536,8 +536,8 @@ void initial_thread_cb_skas(void (*proc)(void *), void *arg)
536 cb_back = &here; 536 cb_back = &here;
537 537
538 block_signals(); 538 block_signals();
539 if(UML_SIGSETJMP(&here, enable) == 0) 539 if(UML_SETJMP(&here, enable) == 0)
540 UML_SIGLONGJMP(&initial_jmpbuf, INIT_JMP_CALLBACK); 540 UML_LONGJMP(&initial_jmpbuf, INIT_JMP_CALLBACK);
541 unblock_signals(); 541 unblock_signals();
542 542
543 cb_proc = NULL; 543 cb_proc = NULL;
@@ -548,13 +548,13 @@ void initial_thread_cb_skas(void (*proc)(void *), void *arg)
548void halt_skas(void) 548void halt_skas(void)
549{ 549{
550 block_signals(); 550 block_signals();
551 UML_SIGLONGJMP(&initial_jmpbuf, INIT_JMP_HALT); 551 UML_LONGJMP(&initial_jmpbuf, INIT_JMP_HALT);
552} 552}
553 553
554void reboot_skas(void) 554void reboot_skas(void)
555{ 555{
556 block_signals(); 556 block_signals();
557 UML_SIGLONGJMP(&initial_jmpbuf, INIT_JMP_REBOOT); 557 UML_LONGJMP(&initial_jmpbuf, INIT_JMP_REBOOT);
558} 558}
559 559
560void switch_mm_skas(struct mm_id *mm_idp) 560void switch_mm_skas(struct mm_id *mm_idp)
diff --git a/arch/um/os-Linux/start_up.c b/arch/um/os-Linux/start_up.c
index 387e26af301a..503148504009 100644
--- a/arch/um/os-Linux/start_up.c
+++ b/arch/um/os-Linux/start_up.c
@@ -296,29 +296,7 @@ static void __init check_ptrace(void)
296 check_sysemu(); 296 check_sysemu();
297} 297}
298 298
299extern int create_tmp_file(unsigned long long len); 299extern void check_tmpexec(void);
300
301static void check_tmpexec(void)
302{
303 void *addr;
304 int err, fd = create_tmp_file(UM_KERN_PAGE_SIZE);
305
306 addr = mmap(NULL, UM_KERN_PAGE_SIZE,
307 PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE, fd, 0);
308 printf("Checking PROT_EXEC mmap in /tmp...");
309 fflush(stdout);
310 if(addr == MAP_FAILED){
311 err = errno;
312 perror("failed");
313 if(err == EPERM)
314 printf("/tmp must be not mounted noexec\n");
315 exit(1);
316 }
317 printf("OK\n");
318 munmap(addr, UM_KERN_PAGE_SIZE);
319
320 close(fd);
321}
322 300
323void os_early_checks(void) 301void os_early_checks(void)
324{ 302{
diff --git a/arch/um/os-Linux/sys-i386/registers.c b/arch/um/os-Linux/sys-i386/registers.c
index 7a6f6b99ceff..516f66dd87e3 100644
--- a/arch/um/os-Linux/sys-i386/registers.c
+++ b/arch/um/os-Linux/sys-i386/registers.c
@@ -104,7 +104,7 @@ void init_registers(int pid)
104 err = ptrace(PTRACE_GETREGS, pid, 0, exec_regs); 104 err = ptrace(PTRACE_GETREGS, pid, 0, exec_regs);
105 if(err) 105 if(err)
106 panic("check_ptrace : PTRACE_GETREGS failed, errno = %d", 106 panic("check_ptrace : PTRACE_GETREGS failed, errno = %d",
107 err); 107 errno);
108 108
109 errno = 0; 109 errno = 0;
110 err = ptrace(PTRACE_GETFPXREGS, pid, 0, exec_fpx_regs); 110 err = ptrace(PTRACE_GETFPXREGS, pid, 0, exec_fpx_regs);
@@ -119,7 +119,7 @@ void init_registers(int pid)
119 err = ptrace(PTRACE_GETFPREGS, pid, 0, exec_fp_regs); 119 err = ptrace(PTRACE_GETFPREGS, pid, 0, exec_fp_regs);
120 if(err) 120 if(err)
121 panic("check_ptrace : PTRACE_GETFPREGS failed, errno = %d", 121 panic("check_ptrace : PTRACE_GETFPREGS failed, errno = %d",
122 err); 122 errno);
123} 123}
124 124
125void get_safe_registers(unsigned long *regs, unsigned long *fp_regs) 125void get_safe_registers(unsigned long *regs, unsigned long *fp_regs)
diff --git a/arch/um/os-Linux/sys-x86_64/registers.c b/arch/um/os-Linux/sys-x86_64/registers.c
index 001941fa1a1e..becd898d9398 100644
--- a/arch/um/os-Linux/sys-x86_64/registers.c
+++ b/arch/um/os-Linux/sys-x86_64/registers.c
@@ -62,12 +62,12 @@ void init_registers(int pid)
62 err = ptrace(PTRACE_GETREGS, pid, 0, exec_regs); 62 err = ptrace(PTRACE_GETREGS, pid, 0, exec_regs);
63 if(err) 63 if(err)
64 panic("check_ptrace : PTRACE_GETREGS failed, errno = %d", 64 panic("check_ptrace : PTRACE_GETREGS failed, errno = %d",
65 err); 65 errno);
66 66
67 err = ptrace(PTRACE_GETFPREGS, pid, 0, exec_fp_regs); 67 err = ptrace(PTRACE_GETFPREGS, pid, 0, exec_fp_regs);
68 if(err) 68 if(err)
69 panic("check_ptrace : PTRACE_GETFPREGS failed, errno = %d", 69 panic("check_ptrace : PTRACE_GETFPREGS failed, errno = %d",
70 err); 70 errno);
71} 71}
72 72
73void get_safe_registers(unsigned long *regs, unsigned long *fp_regs) 73void get_safe_registers(unsigned long *regs, unsigned long *fp_regs)
diff --git a/arch/um/os-Linux/time.c b/arch/um/os-Linux/time.c
index 6f7626775acb..280c4fb9b585 100644
--- a/arch/um/os-Linux/time.c
+++ b/arch/um/os-Linux/time.c
@@ -81,20 +81,12 @@ void uml_idle_timer(void)
81 set_interval(ITIMER_REAL); 81 set_interval(ITIMER_REAL);
82} 82}
83 83
84extern void ktime_get_ts(struct timespec *ts);
85#define do_posix_clock_monotonic_gettime(ts) ktime_get_ts(ts)
86
87void time_init(void) 84void time_init(void)
88{ 85{
89 struct timespec now;
90
91 if(signal(SIGVTALRM, boot_timer_handler) == SIG_ERR) 86 if(signal(SIGVTALRM, boot_timer_handler) == SIG_ERR)
92 panic("Couldn't set SIGVTALRM handler"); 87 panic("Couldn't set SIGVTALRM handler");
93 set_interval(ITIMER_VIRTUAL); 88 set_interval(ITIMER_VIRTUAL);
94 89 time_init_kern();
95 do_posix_clock_monotonic_gettime(&now);
96 wall_to_monotonic.tv_sec = -now.tv_sec;
97 wall_to_monotonic.tv_nsec = -now.tv_nsec;
98} 90}
99 91
100unsigned long long os_nsecs(void) 92unsigned long long os_nsecs(void)
diff --git a/arch/um/os-Linux/trap.c b/arch/um/os-Linux/trap.c
index a9f6b26f9828..90b29ae9af46 100644
--- a/arch/um/os-Linux/trap.c
+++ b/arch/um/os-Linux/trap.c
@@ -35,7 +35,7 @@ void os_fill_handlinfo(struct kern_handlers h)
35 35
36void do_longjmp(void *b, int val) 36void do_longjmp(void *b, int val)
37{ 37{
38 sigjmp_buf *buf = b; 38 jmp_buf *buf = b;
39 39
40 UML_SIGLONGJMP(buf, val); 40 UML_LONGJMP(buf, val);
41} 41}
diff --git a/arch/um/os-Linux/uaccess.c b/arch/um/os-Linux/uaccess.c
index 166fb66995df..e523719330b2 100644
--- a/arch/um/os-Linux/uaccess.c
+++ b/arch/um/os-Linux/uaccess.c
@@ -16,9 +16,9 @@ unsigned long __do_user_copy(void *to, const void *from, int n,
16 unsigned long *faddrp = (unsigned long *) fault_addr, ret; 16 unsigned long *faddrp = (unsigned long *) fault_addr, ret;
17 int enable; 17 int enable;
18 18
19 sigjmp_buf jbuf; 19 jmp_buf jbuf;
20 *fault_catcher = &jbuf; 20 *fault_catcher = &jbuf;
21 if(UML_SIGSETJMP(&jbuf, enable) == 0){ 21 if(UML_SETJMP(&jbuf, enable) == 0){
22 (*op)(to, from, n); 22 (*op)(to, from, n);
23 ret = 0; 23 ret = 0;
24 *faulted_out = 0; 24 *faulted_out = 0;
diff --git a/arch/um/os-Linux/umid.c b/arch/um/os-Linux/umid.c
index 34bfc1bb9e38..362db059fe30 100644
--- a/arch/um/os-Linux/umid.c
+++ b/arch/um/os-Linux/umid.c
@@ -178,14 +178,14 @@ static void __init create_pid_file(void)
178 fd = open(file, O_RDWR | O_CREAT | O_EXCL, 0644); 178 fd = open(file, O_RDWR | O_CREAT | O_EXCL, 0644);
179 if(fd < 0){ 179 if(fd < 0){
180 printk("Open of machine pid file \"%s\" failed: %s\n", 180 printk("Open of machine pid file \"%s\" failed: %s\n",
181 file, strerror(-fd)); 181 file, strerror(errno));
182 return; 182 return;
183 } 183 }
184 184
185 snprintf(pid, sizeof(pid), "%d\n", getpid()); 185 snprintf(pid, sizeof(pid), "%d\n", getpid());
186 n = write(fd, pid, strlen(pid)); 186 n = write(fd, pid, strlen(pid));
187 if(n != strlen(pid)) 187 if(n != strlen(pid))
188 printk("Write of pid file failed - err = %d\n", -n); 188 printk("Write of pid file failed - err = %d\n", errno);
189 189
190 close(fd); 190 close(fd);
191} 191}
diff --git a/arch/um/os-Linux/user_syms.c b/arch/um/os-Linux/user_syms.c
index 2598158e1f53..3f33165ada68 100644
--- a/arch/um/os-Linux/user_syms.c
+++ b/arch/um/os-Linux/user_syms.c
@@ -96,6 +96,13 @@ EXPORT_SYMBOL_PROTO(getuid);
96EXPORT_SYMBOL_PROTO(fsync); 96EXPORT_SYMBOL_PROTO(fsync);
97EXPORT_SYMBOL_PROTO(fdatasync); 97EXPORT_SYMBOL_PROTO(fdatasync);
98 98
99/* Export symbols used by GCC for the stack protector. */
100extern void __stack_smash_handler(void *) __attribute__((weak));
101EXPORT_SYMBOL(__stack_smash_handler);
102
103extern long __guard __attribute__((weak));
104EXPORT_SYMBOL(__guard);
105
99/* 106/*
100 * Overrides for Emacs so that we follow Linus's tabbing style. 107 * Overrides for Emacs so that we follow Linus's tabbing style.
101 * Emacs will notice this stuff at the end of the file and automatically 108 * Emacs will notice this stuff at the end of the file and automatically
diff --git a/arch/um/os-Linux/util.c b/arch/um/os-Linux/util.c
index e32065e2fdc8..c47a2a7ce70e 100644
--- a/arch/um/os-Linux/util.c
+++ b/arch/um/os-Linux/util.c
@@ -104,7 +104,7 @@ void setup_hostinfo(void)
104int setjmp_wrapper(void (*proc)(void *, void *), ...) 104int setjmp_wrapper(void (*proc)(void *, void *), ...)
105{ 105{
106 va_list args; 106 va_list args;
107 sigjmp_buf buf; 107 jmp_buf buf;
108 int n; 108 int n;
109 109
110 n = sigsetjmp(buf, 1); 110 n = sigsetjmp(buf, 1);
diff --git a/arch/um/scripts/Makefile.rules b/arch/um/scripts/Makefile.rules
index 5e7a9c310aa5..1347dc6d5218 100644
--- a/arch/um/scripts/Makefile.rules
+++ b/arch/um/scripts/Makefile.rules
@@ -7,11 +7,19 @@ USER_SINGLE_OBJS := \
7USER_OBJS += $(filter %_user.o,$(obj-y) $(obj-m) $(USER_SINGLE_OBJS)) 7USER_OBJS += $(filter %_user.o,$(obj-y) $(obj-m) $(USER_SINGLE_OBJS))
8USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file)) 8USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file))
9 9
10$(USER_OBJS) $(USER_OBJS:.o=.i) $(USER_OBJS:.o=.s) $(USER_OBJS:.o=.lst): \ 10$(USER_OBJS:.o=.%): \
11 c_flags = -Wp,-MD,$(depfile) $(USER_CFLAGS) $(CFLAGS_$(notdir $@)) 11 c_flags = -Wp,-MD,$(depfile) $(USER_CFLAGS) $(CFLAGS_$(*F).o)
12$(USER_OBJS) : CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ \ 12$(USER_OBJS) : CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ \
13 -Dunix -D__unix__ -D__$(SUBARCH)__ 13 -Dunix -D__unix__ -D__$(SUBARCH)__
14 14
15# These are like USER_OBJS but filter USER_CFLAGS through unprofile instead of
16# using it directly.
17UNPROFILE_OBJS := $(foreach file,$(UNPROFILE_OBJS),$(obj)/$(file))
18
19$(UNPROFILE_OBJS:.o=.%): \
20 c_flags = -Wp,-MD,$(depfile) $(call unprofile,$(USER_CFLAGS)) $(CFLAGS_$(*F).o)
21$(UNPROFILE_OBJS) : CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ \
22 -Dunix -D__unix__ -D__$(SUBARCH)__
15 23
16# The stubs and unmap.o can't try to call mcount or update basic block data 24# The stubs and unmap.o can't try to call mcount or update basic block data
17define unprofile 25define unprofile
diff --git a/arch/um/sys-i386/Makefile b/arch/um/sys-i386/Makefile
index 98b20b7bba4f..374d61a19439 100644
--- a/arch/um/sys-i386/Makefile
+++ b/arch/um/sys-i386/Makefile
@@ -8,11 +8,16 @@ subarch-obj-y = lib/bitops.o kernel/semaphore.o
8subarch-obj-$(CONFIG_HIGHMEM) += mm/highmem.o 8subarch-obj-$(CONFIG_HIGHMEM) += mm/highmem.o
9subarch-obj-$(CONFIG_MODULES) += kernel/module.o 9subarch-obj-$(CONFIG_MODULES) += kernel/module.o
10 10
11USER_OBJS := bugs.o ptrace_user.o sigcontext.o fault.o stub_segv.o 11USER_OBJS := bugs.o ptrace_user.o sigcontext.o fault.o
12 12
13include arch/um/scripts/Makefile.rules 13USER_OBJS += user-offsets.s
14extra-y += user-offsets.s
14 15
15extra-$(CONFIG_MODE_TT) += unmap.o 16extra-$(CONFIG_MODE_TT) += unmap.o
16 17
17$(obj)/stub_segv.o $(obj)/unmap.o: \ 18UNPROFILE_OBJS := stub_segv.o
18 _c_flags = $(call unprofile,$(CFLAGS)) 19CFLAGS_stub_segv.o := $(CFLAGS_NO_HARDENING)
20
21include arch/um/scripts/Makefile.rules
22
23$(obj)/unmap.%: _c_flags = $(call unprofile,$(CFLAGS))
diff --git a/arch/um/sys-i386/signal.c b/arch/um/sys-i386/signal.c
index 618fd8594643..0709fc6670c2 100644
--- a/arch/um/sys-i386/signal.c
+++ b/arch/um/sys-i386/signal.c
@@ -57,7 +57,7 @@ static int copy_sc_from_user_skas(struct pt_regs *regs,
57 return(0); 57 return(0);
58} 58}
59 59
60int copy_sc_to_user_skas(struct sigcontext *to, struct _fpstate __user *to_fp, 60int copy_sc_to_user_skas(struct sigcontext __user *to, struct _fpstate __user *to_fp,
61 struct pt_regs *regs, unsigned long sp) 61 struct pt_regs *regs, unsigned long sp)
62{ 62{
63 struct sigcontext sc; 63 struct sigcontext sc;
@@ -132,7 +132,7 @@ int copy_sc_from_user_tt(struct sigcontext *to, struct sigcontext __user *from,
132 return(err); 132 return(err);
133} 133}
134 134
135int copy_sc_to_user_tt(struct sigcontext *to, struct _fpstate __user *fp, 135int copy_sc_to_user_tt(struct sigcontext __user *to, struct _fpstate __user *fp,
136 struct sigcontext *from, int fpsize, unsigned long sp) 136 struct sigcontext *from, int fpsize, unsigned long sp)
137{ 137{
138 struct _fpstate __user *to_fp; 138 struct _fpstate __user *to_fp;
@@ -167,7 +167,7 @@ static int copy_sc_from_user(struct pt_regs *to, void __user *from)
167 return(ret); 167 return(ret);
168} 168}
169 169
170static int copy_sc_to_user(struct sigcontext *to, struct _fpstate __user *fp, 170static int copy_sc_to_user(struct sigcontext __user *to, struct _fpstate __user *fp,
171 struct pt_regs *from, unsigned long sp) 171 struct pt_regs *from, unsigned long sp)
172{ 172{
173 return(CHOOSE_MODE(copy_sc_to_user_tt(to, fp, UPT_SC(&from->regs), 173 return(CHOOSE_MODE(copy_sc_to_user_tt(to, fp, UPT_SC(&from->regs),
diff --git a/arch/um/sys-i386/stub_segv.c b/arch/um/sys-i386/stub_segv.c
index a37f672ec964..2355dc19c46c 100644
--- a/arch/um/sys-i386/stub_segv.c
+++ b/arch/um/sys-i386/stub_segv.c
@@ -27,6 +27,6 @@ stub_segv_handler(int sig)
27 * the stack in its original form when we do the sigreturn here, by 27 * the stack in its original form when we do the sigreturn here, by
28 * hand. 28 * hand.
29 */ 29 */
30 __asm__("mov %0,%%esp ; movl %1, %%eax ; " 30 __asm__ __volatile__("mov %0,%%esp ; movl %1, %%eax ; "
31 "int $0x80" : : "a" (sc), "g" (__NR_sigreturn)); 31 "int $0x80" : : "a" (sc), "g" (__NR_sigreturn));
32} 32}
diff --git a/arch/um/sys-i386/syscalls.c b/arch/um/sys-i386/syscalls.c
index 749dd1bfe60f..710d5fb807e1 100644
--- a/arch/um/sys-i386/syscalls.c
+++ b/arch/um/sys-i386/syscalls.c
@@ -99,11 +99,12 @@ long sys_ipc (uint call, int first, int second,
99 99
100 switch (call) { 100 switch (call) {
101 case SEMOP: 101 case SEMOP:
102 return sys_semtimedop(first, (struct sembuf *) ptr, second, 102 return sys_semtimedop(first, (struct sembuf __user *) ptr,
103 NULL); 103 second, NULL);
104 case SEMTIMEDOP: 104 case SEMTIMEDOP:
105 return sys_semtimedop(first, (struct sembuf *) ptr, second, 105 return sys_semtimedop(first, (struct sembuf __user *) ptr,
106 (const struct timespec *) fifth); 106 second,
107 (const struct timespec __user *) fifth);
107 case SEMGET: 108 case SEMGET:
108 return sys_semget (first, second, third); 109 return sys_semget (first, second, third);
109 case SEMCTL: { 110 case SEMCTL: {
diff --git a/arch/um/sys-x86_64/Makefile b/arch/um/sys-x86_64/Makefile
index b5fc22babddf..c19794d435d6 100644
--- a/arch/um/sys-x86_64/Makefile
+++ b/arch/um/sys-x86_64/Makefile
@@ -16,11 +16,16 @@ subarch-obj-$(CONFIG_MODULES) += kernel/module.o
16 16
17ldt-y = ../sys-i386/ldt.o 17ldt-y = ../sys-i386/ldt.o
18 18
19USER_OBJS := ptrace_user.o sigcontext.o stub_segv.o 19USER_OBJS := ptrace_user.o sigcontext.o
20 20
21include arch/um/scripts/Makefile.rules 21USER_OBJS += user-offsets.s
22extra-y += user-offsets.s
22 23
23extra-$(CONFIG_MODE_TT) += unmap.o 24extra-$(CONFIG_MODE_TT) += unmap.o
24 25
25$(obj)/stub_segv.o $(obj)/unmap.o: \ 26UNPROFILE_OBJS := stub_segv.o
26 _c_flags = $(call unprofile,$(CFLAGS)) 27CFLAGS_stub_segv.o := $(CFLAGS_NO_HARDENING)
28
29include arch/um/scripts/Makefile.rules
30
31$(obj)/unmap.%: _c_flags = $(call unprofile,$(CFLAGS))
diff --git a/arch/um/sys-x86_64/signal.c b/arch/um/sys-x86_64/signal.c
index a4c46a8af008..9edf114faf79 100644
--- a/arch/um/sys-x86_64/signal.c
+++ b/arch/um/sys-x86_64/signal.c
@@ -21,7 +21,7 @@
21#include "skas.h" 21#include "skas.h"
22 22
23static int copy_sc_from_user_skas(struct pt_regs *regs, 23static int copy_sc_from_user_skas(struct pt_regs *regs,
24 struct sigcontext *from) 24 struct sigcontext __user *from)
25{ 25{
26 int err = 0; 26 int err = 0;
27 27
@@ -54,7 +54,8 @@ static int copy_sc_from_user_skas(struct pt_regs *regs,
54 return(err); 54 return(err);
55} 55}
56 56
57int copy_sc_to_user_skas(struct sigcontext *to, struct _fpstate *to_fp, 57int copy_sc_to_user_skas(struct sigcontext __user *to,
58 struct _fpstate __user *to_fp,
58 struct pt_regs *regs, unsigned long mask, 59 struct pt_regs *regs, unsigned long mask,
59 unsigned long sp) 60 unsigned long sp)
60{ 61{
@@ -106,10 +107,11 @@ int copy_sc_to_user_skas(struct sigcontext *to, struct _fpstate *to_fp,
106#endif 107#endif
107 108
108#ifdef CONFIG_MODE_TT 109#ifdef CONFIG_MODE_TT
109int copy_sc_from_user_tt(struct sigcontext *to, struct sigcontext *from, 110int copy_sc_from_user_tt(struct sigcontext *to, struct sigcontext __user *from,
110 int fpsize) 111 int fpsize)
111{ 112{
112 struct _fpstate *to_fp, *from_fp; 113 struct _fpstate *to_fp;
114 struct _fpstate __user *from_fp;
113 unsigned long sigs; 115 unsigned long sigs;
114 int err; 116 int err;
115 117
@@ -124,13 +126,14 @@ int copy_sc_from_user_tt(struct sigcontext *to, struct sigcontext *from,
124 return(err); 126 return(err);
125} 127}
126 128
127int copy_sc_to_user_tt(struct sigcontext *to, struct _fpstate *fp, 129int copy_sc_to_user_tt(struct sigcontext __user *to, struct _fpstate __user *fp,
128 struct sigcontext *from, int fpsize, unsigned long sp) 130 struct sigcontext *from, int fpsize, unsigned long sp)
129{ 131{
130 struct _fpstate *to_fp, *from_fp; 132 struct _fpstate __user *to_fp;
133 struct _fpstate *from_fp;
131 int err; 134 int err;
132 135
133 to_fp = (fp ? fp : (struct _fpstate *) (to + 1)); 136 to_fp = (fp ? fp : (struct _fpstate __user *) (to + 1));
134 from_fp = from->fpstate; 137 from_fp = from->fpstate;
135 err = copy_to_user(to, from, sizeof(*to)); 138 err = copy_to_user(to, from, sizeof(*to));
136 /* The SP in the sigcontext is the updated one for the signal 139 /* The SP in the sigcontext is the updated one for the signal
@@ -158,7 +161,8 @@ static int copy_sc_from_user(struct pt_regs *to, void __user *from)
158 return(ret); 161 return(ret);
159} 162}
160 163
161static int copy_sc_to_user(struct sigcontext *to, struct _fpstate *fp, 164static int copy_sc_to_user(struct sigcontext __user *to,
165 struct _fpstate __user *fp,
162 struct pt_regs *from, unsigned long mask, 166 struct pt_regs *from, unsigned long mask,
163 unsigned long sp) 167 unsigned long sp)
164{ 168{
@@ -169,7 +173,7 @@ static int copy_sc_to_user(struct sigcontext *to, struct _fpstate *fp,
169 173
170struct rt_sigframe 174struct rt_sigframe
171{ 175{
172 char *pretcode; 176 char __user *pretcode;
173 struct ucontext uc; 177 struct ucontext uc;
174 struct siginfo info; 178 struct siginfo info;
175}; 179};
@@ -188,7 +192,7 @@ int setup_signal_stack_si(unsigned long stack_top, int sig,
188 192
189 frame = (struct rt_sigframe __user *) 193 frame = (struct rt_sigframe __user *)
190 round_down(stack_top - sizeof(struct rt_sigframe), 16) - 8; 194 round_down(stack_top - sizeof(struct rt_sigframe), 16) - 8;
191 frame = (struct rt_sigframe *) ((unsigned long) frame - 128); 195 frame = (struct rt_sigframe __user *) ((unsigned long) frame - 128);
192 196
193 if (!access_ok(VERIFY_WRITE, fp, sizeof(struct _fpstate))) 197 if (!access_ok(VERIFY_WRITE, fp, sizeof(struct _fpstate)))
194 goto out; 198 goto out;
diff --git a/arch/um/sys-x86_64/stub_segv.c b/arch/um/sys-x86_64/stub_segv.c
index a27099533198..1c967026c957 100644
--- a/arch/um/sys-x86_64/stub_segv.c
+++ b/arch/um/sys-x86_64/stub_segv.c
@@ -33,7 +33,7 @@ stub_segv_handler(int sig)
33 struct ucontext *uc; 33 struct ucontext *uc;
34 int pid; 34 int pid;
35 35
36 __asm__("movq %%rdx, %0" : "=g" (uc) :); 36 __asm__ __volatile__("movq %%rdx, %0" : "=g" (uc) :);
37 GET_FAULTINFO_FROM_SC(*((struct faultinfo *) UML_CONFIG_STUB_DATA), 37 GET_FAULTINFO_FROM_SC(*((struct faultinfo *) UML_CONFIG_STUB_DATA),
38 &uc->uc_mcontext); 38 &uc->uc_mcontext);
39 39
@@ -44,8 +44,8 @@ stub_segv_handler(int sig)
44 * the signal frame. So, we use the ucontext pointer, which we know 44 * the signal frame. So, we use the ucontext pointer, which we know
45 * already, to get the signal frame pointer, and add 8 to that. 45 * already, to get the signal frame pointer, and add 8 to that.
46 */ 46 */
47 __asm__("movq %0, %%rsp; movq %1, %%rax ; syscall": : 47 __asm__ __volatile__("movq %0, %%rsp; movq %1, %%rax ; syscall": :
48 "g" ((unsigned long) container_of(uc, struct rt_sigframe, 48 "g" ((unsigned long)
49 uc) + 8), 49 container_of(uc, struct rt_sigframe, uc) + 8),
50 "g" (__NR_rt_sigreturn)); 50 "g" (__NR_rt_sigreturn));
51} 51}
diff --git a/arch/um/sys-x86_64/syscalls.c b/arch/um/sys-x86_64/syscalls.c
index 6acee5c4ada6..6fce9f45dfdc 100644
--- a/arch/um/sys-x86_64/syscalls.c
+++ b/arch/um/sys-x86_64/syscalls.c
@@ -45,7 +45,7 @@ static long arch_prctl_tt(int code, unsigned long addr)
45 case ARCH_GET_GS: 45 case ARCH_GET_GS:
46 ret = arch_prctl(code, (unsigned long) &tmp); 46 ret = arch_prctl(code, (unsigned long) &tmp);
47 if(!ret) 47 if(!ret)
48 ret = put_user(tmp, &addr); 48 ret = put_user(tmp, (long __user *)addr);
49 break; 49 break;
50 default: 50 default:
51 ret = -EINVAL; 51 ret = -EINVAL;
diff --git a/arch/x86_64/defconfig b/arch/x86_64/defconfig
index 3c45ec22b3fe..69db0c0721d1 100644
--- a/arch/x86_64/defconfig
+++ b/arch/x86_64/defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.17-rc1 3# Linux kernel version: 2.6.17-rc1-git11
4# Mon Apr 3 16:11:14 2006 4# Sun Apr 16 07:22:36 2006
5# 5#
6CONFIG_X86_64=y 6CONFIG_X86_64=y
7CONFIG_64BIT=y 7CONFIG_64BIT=y
@@ -57,6 +57,7 @@ CONFIG_FUTEX=y
57CONFIG_EPOLL=y 57CONFIG_EPOLL=y
58CONFIG_SHMEM=y 58CONFIG_SHMEM=y
59CONFIG_SLAB=y 59CONFIG_SLAB=y
60CONFIG_DOUBLEFAULT=y
60# CONFIG_TINY_SHMEM is not set 61# CONFIG_TINY_SHMEM is not set
61CONFIG_BASE_SMALL=0 62CONFIG_BASE_SMALL=0
62# CONFIG_SLOB is not set 63# CONFIG_SLOB is not set
@@ -121,6 +122,7 @@ CONFIG_PREEMPT_VOLUNTARY=y
121CONFIG_PREEMPT_BKL=y 122CONFIG_PREEMPT_BKL=y
122CONFIG_NUMA=y 123CONFIG_NUMA=y
123CONFIG_K8_NUMA=y 124CONFIG_K8_NUMA=y
125CONFIG_NODES_SHIFT=6
124CONFIG_X86_64_ACPI_NUMA=y 126CONFIG_X86_64_ACPI_NUMA=y
125CONFIG_NUMA_EMU=y 127CONFIG_NUMA_EMU=y
126CONFIG_ARCH_DISCONTIGMEM_ENABLE=y 128CONFIG_ARCH_DISCONTIGMEM_ENABLE=y
@@ -544,7 +546,6 @@ CONFIG_SCSI_SATA_INTEL_COMBINED=y
544# CONFIG_SCSI_INIA100 is not set 546# CONFIG_SCSI_INIA100 is not set
545# CONFIG_SCSI_SYM53C8XX_2 is not set 547# CONFIG_SCSI_SYM53C8XX_2 is not set
546# CONFIG_SCSI_IPR is not set 548# CONFIG_SCSI_IPR is not set
547# CONFIG_SCSI_QLOGIC_FC is not set
548# CONFIG_SCSI_QLOGIC_1280 is not set 549# CONFIG_SCSI_QLOGIC_1280 is not set
549# CONFIG_SCSI_QLA_FC is not set 550# CONFIG_SCSI_QLA_FC is not set
550# CONFIG_SCSI_LPFC is not set 551# CONFIG_SCSI_LPFC is not set
@@ -1045,9 +1046,7 @@ CONFIG_USB_HIDINPUT=y
1045# CONFIG_USB_ACECAD is not set 1046# CONFIG_USB_ACECAD is not set
1046# CONFIG_USB_KBTAB is not set 1047# CONFIG_USB_KBTAB is not set
1047# CONFIG_USB_POWERMATE is not set 1048# CONFIG_USB_POWERMATE is not set
1048# CONFIG_USB_MTOUCH is not set 1049# CONFIG_USB_TOUCHSCREEN is not set
1049# CONFIG_USB_ITMTOUCH is not set
1050# CONFIG_USB_EGALAX is not set
1051# CONFIG_USB_YEALINK is not set 1050# CONFIG_USB_YEALINK is not set
1052# CONFIG_USB_XPAD is not set 1051# CONFIG_USB_XPAD is not set
1053# CONFIG_USB_ATI_REMOTE is not set 1052# CONFIG_USB_ATI_REMOTE is not set
@@ -1118,6 +1117,14 @@ CONFIG_USB_MON=y
1118# CONFIG_NEW_LEDS is not set 1117# CONFIG_NEW_LEDS is not set
1119 1118
1120# 1119#
1120# LED drivers
1121#
1122
1123#
1124# LED Triggers
1125#
1126
1127#
1121# InfiniBand support 1128# InfiniBand support
1122# 1129#
1123# CONFIG_INFINIBAND is not set 1130# CONFIG_INFINIBAND is not set
diff --git a/arch/x86_64/ia32/Makefile b/arch/x86_64/ia32/Makefile
index 929e6b0771f8..e9263b4975e0 100644
--- a/arch/x86_64/ia32/Makefile
+++ b/arch/x86_64/ia32/Makefile
@@ -27,5 +27,5 @@ $(obj)/vsyscall-sysenter.so $(obj)/vsyscall-syscall.so: \
27$(obj)/vsyscall-%.so: $(src)/vsyscall.lds $(obj)/vsyscall-%.o FORCE 27$(obj)/vsyscall-%.so: $(src)/vsyscall.lds $(obj)/vsyscall-%.o FORCE
28 $(call if_changed,syscall) 28 $(call if_changed,syscall)
29 29
30AFLAGS_vsyscall-sysenter.o = -m32 30AFLAGS_vsyscall-sysenter.o = -m32 -Wa,-32
31AFLAGS_vsyscall-syscall.o = -m32 31AFLAGS_vsyscall-syscall.o = -m32 -Wa,-32
diff --git a/arch/x86_64/ia32/ia32_binfmt.c b/arch/x86_64/ia32/ia32_binfmt.c
index e776139afb20..926c4743d13b 100644
--- a/arch/x86_64/ia32/ia32_binfmt.c
+++ b/arch/x86_64/ia32/ia32_binfmt.c
@@ -339,7 +339,7 @@ int ia32_setup_arg_pages(struct linux_binprm *bprm, unsigned long stack_top,
339 struct mm_struct *mm = current->mm; 339 struct mm_struct *mm = current->mm;
340 int i, ret; 340 int i, ret;
341 341
342 stack_base = IA32_STACK_TOP - MAX_ARG_PAGES * PAGE_SIZE; 342 stack_base = stack_top - MAX_ARG_PAGES * PAGE_SIZE;
343 mm->arg_start = bprm->p + stack_base; 343 mm->arg_start = bprm->p + stack_base;
344 344
345 bprm->p += stack_base; 345 bprm->p += stack_base;
@@ -357,7 +357,7 @@ int ia32_setup_arg_pages(struct linux_binprm *bprm, unsigned long stack_top,
357 { 357 {
358 mpnt->vm_mm = mm; 358 mpnt->vm_mm = mm;
359 mpnt->vm_start = PAGE_MASK & (unsigned long) bprm->p; 359 mpnt->vm_start = PAGE_MASK & (unsigned long) bprm->p;
360 mpnt->vm_end = IA32_STACK_TOP; 360 mpnt->vm_end = stack_top;
361 if (executable_stack == EXSTACK_ENABLE_X) 361 if (executable_stack == EXSTACK_ENABLE_X)
362 mpnt->vm_flags = VM_STACK_FLAGS | VM_EXEC; 362 mpnt->vm_flags = VM_STACK_FLAGS | VM_EXEC;
363 else if (executable_stack == EXSTACK_DISABLE_X) 363 else if (executable_stack == EXSTACK_DISABLE_X)
diff --git a/arch/x86_64/ia32/ia32entry.S b/arch/x86_64/ia32/ia32entry.S
index 5a9802676689..5a92fed2d1d5 100644
--- a/arch/x86_64/ia32/ia32entry.S
+++ b/arch/x86_64/ia32/ia32entry.S
@@ -694,4 +694,6 @@ ia32_sys_call_table:
694 .quad compat_sys_get_robust_list 694 .quad compat_sys_get_robust_list
695 .quad sys_splice 695 .quad sys_splice
696 .quad sys_sync_file_range 696 .quad sys_sync_file_range
697 .quad sys_tee
698 .quad compat_sys_vmsplice
697ia32_syscall_end: 699ia32_syscall_end:
diff --git a/arch/x86_64/kernel/Makefile b/arch/x86_64/kernel/Makefile
index a098a11e7755..059c88313f4e 100644
--- a/arch/x86_64/kernel/Makefile
+++ b/arch/x86_64/kernel/Makefile
@@ -8,7 +8,7 @@ obj-y := process.o signal.o entry.o traps.o irq.o \
8 ptrace.o time.o ioport.o ldt.o setup.o i8259.o sys_x86_64.o \ 8 ptrace.o time.o ioport.o ldt.o setup.o i8259.o sys_x86_64.o \
9 x8664_ksyms.o i387.o syscall.o vsyscall.o \ 9 x8664_ksyms.o i387.o syscall.o vsyscall.o \
10 setup64.o bootflag.o e820.o reboot.o quirks.o i8237.o \ 10 setup64.o bootflag.o e820.o reboot.o quirks.o i8237.o \
11 dmi_scan.o pci-dma.o pci-nommu.o 11 pci-dma.o pci-nommu.o
12 12
13obj-$(CONFIG_X86_MCE) += mce.o 13obj-$(CONFIG_X86_MCE) += mce.o
14obj-$(CONFIG_X86_MCE_INTEL) += mce_intel.o 14obj-$(CONFIG_X86_MCE_INTEL) += mce_intel.o
@@ -49,5 +49,3 @@ intel_cacheinfo-y += ../../i386/kernel/cpu/intel_cacheinfo.o
49quirks-y += ../../i386/kernel/quirks.o 49quirks-y += ../../i386/kernel/quirks.o
50i8237-y += ../../i386/kernel/i8237.o 50i8237-y += ../../i386/kernel/i8237.o
51msr-$(subst m,y,$(CONFIG_X86_MSR)) += ../../i386/kernel/msr.o 51msr-$(subst m,y,$(CONFIG_X86_MSR)) += ../../i386/kernel/msr.o
52dmi_scan-y += ../../i386/kernel/dmi_scan.o
53
diff --git a/arch/x86_64/kernel/e820.c b/arch/x86_64/kernel/e820.c
index 62776c07cff1..1ef6028f721e 100644
--- a/arch/x86_64/kernel/e820.c
+++ b/arch/x86_64/kernel/e820.c
@@ -76,6 +76,12 @@ static inline int bad_addr(unsigned long *addrp, unsigned long size)
76 *addrp = __pa_symbol(&_end); 76 *addrp = __pa_symbol(&_end);
77 return 1; 77 return 1;
78 } 78 }
79
80 if (last >= ebda_addr && addr < ebda_addr + ebda_size) {
81 *addrp = ebda_addr + ebda_size;
82 return 1;
83 }
84
79 /* XXX ramdisk image here? */ 85 /* XXX ramdisk image here? */
80 return 0; 86 return 0;
81} 87}
@@ -143,7 +149,7 @@ unsigned long __init find_e820_area(unsigned long start, unsigned long end, unsi
143 addr = start; 149 addr = start;
144 if (addr > ei->addr + ei->size) 150 if (addr > ei->addr + ei->size)
145 continue; 151 continue;
146 while (bad_addr(&addr, size) && addr+size < ei->addr + ei->size) 152 while (bad_addr(&addr, size) && addr+size <= ei->addr+ei->size)
147 ; 153 ;
148 last = addr + size; 154 last = addr + size;
149 if (last > ei->addr + ei->size) 155 if (last > ei->addr + ei->size)
diff --git a/arch/x86_64/kernel/entry.S b/arch/x86_64/kernel/entry.S
index c946e4fe67a7..586b34c00c48 100644
--- a/arch/x86_64/kernel/entry.S
+++ b/arch/x86_64/kernel/entry.S
@@ -281,12 +281,7 @@ tracesys:
281 ja 1f 281 ja 1f
282 movq %r10,%rcx /* fixup for C */ 282 movq %r10,%rcx /* fixup for C */
283 call *sys_call_table(,%rax,8) 283 call *sys_call_table(,%rax,8)
284 movq %rax,RAX-ARGOFFSET(%rsp) 2841: movq %rax,RAX-ARGOFFSET(%rsp)
2851: SAVE_REST
286 movq %rsp,%rdi
287 call syscall_trace_leave
288 RESTORE_TOP_OF_STACK %rbx
289 RESTORE_REST
290 /* Use IRET because user could have changed frame */ 285 /* Use IRET because user could have changed frame */
291 jmp int_ret_from_sys_call 286 jmp int_ret_from_sys_call
292 CFI_ENDPROC 287 CFI_ENDPROC
diff --git a/arch/x86_64/kernel/io_apic.c b/arch/x86_64/kernel/io_apic.c
index 77b4c608cca0..9cc7031b7151 100644
--- a/arch/x86_64/kernel/io_apic.c
+++ b/arch/x86_64/kernel/io_apic.c
@@ -271,6 +271,18 @@ __setup("enable_8254_timer", setup_enable_8254_timer);
271#include <linux/pci_ids.h> 271#include <linux/pci_ids.h>
272#include <linux/pci.h> 272#include <linux/pci.h>
273 273
274
275#ifdef CONFIG_ACPI
276
277static int nvidia_hpet_detected __initdata;
278
279static int __init nvidia_hpet_check(unsigned long phys, unsigned long size)
280{
281 nvidia_hpet_detected = 1;
282 return 0;
283}
284#endif
285
274/* Temporary Hack. Nvidia and VIA boards currently only work with IO-APIC 286/* Temporary Hack. Nvidia and VIA boards currently only work with IO-APIC
275 off. Check for an Nvidia or VIA PCI bridge and turn it off. 287 off. Check for an Nvidia or VIA PCI bridge and turn it off.
276 Use pci direct infrastructure because this runs before the PCI subsystem. 288 Use pci direct infrastructure because this runs before the PCI subsystem.
@@ -317,11 +329,19 @@ void __init check_ioapic(void)
317 return; 329 return;
318 case PCI_VENDOR_ID_NVIDIA: 330 case PCI_VENDOR_ID_NVIDIA:
319#ifdef CONFIG_ACPI 331#ifdef CONFIG_ACPI
320 /* All timer overrides on Nvidia 332 /*
321 seem to be wrong. Skip them. */ 333 * All timer overrides on Nvidia are
322 acpi_skip_timer_override = 1; 334 * wrong unless HPET is enabled.
323 printk(KERN_INFO 335 */
324 "Nvidia board detected. Ignoring ACPI timer override.\n"); 336 nvidia_hpet_detected = 0;
337 acpi_table_parse(ACPI_HPET,
338 nvidia_hpet_check);
339 if (nvidia_hpet_detected == 0) {
340 acpi_skip_timer_override = 1;
341 printk(KERN_INFO "Nvidia board "
342 "detected. Ignoring ACPI "
343 "timer override.\n");
344 }
325#endif 345#endif
326 /* RED-PEN skip them on mptables too? */ 346 /* RED-PEN skip them on mptables too? */
327 return; 347 return;
@@ -1777,6 +1797,8 @@ static inline void unlock_ExtINT_logic(void)
1777 spin_unlock_irqrestore(&ioapic_lock, flags); 1797 spin_unlock_irqrestore(&ioapic_lock, flags);
1778} 1798}
1779 1799
1800int timer_uses_ioapic_pin_0;
1801
1780/* 1802/*
1781 * This code may look a bit paranoid, but it's supposed to cooperate with 1803 * This code may look a bit paranoid, but it's supposed to cooperate with
1782 * a wide range of boards and BIOS bugs. Fortunately only the timer IRQ 1804 * a wide range of boards and BIOS bugs. Fortunately only the timer IRQ
@@ -1814,6 +1836,9 @@ static inline void check_timer(void)
1814 pin2 = ioapic_i8259.pin; 1836 pin2 = ioapic_i8259.pin;
1815 apic2 = ioapic_i8259.apic; 1837 apic2 = ioapic_i8259.apic;
1816 1838
1839 if (pin1 == 0)
1840 timer_uses_ioapic_pin_0 = 1;
1841
1817 apic_printk(APIC_VERBOSE,KERN_INFO "..TIMER: vector=0x%02X apic1=%d pin1=%d apic2=%d pin2=%d\n", 1842 apic_printk(APIC_VERBOSE,KERN_INFO "..TIMER: vector=0x%02X apic1=%d pin1=%d apic2=%d pin2=%d\n",
1818 vector, apic1, pin1, apic2, pin2); 1843 vector, apic1, pin1, apic2, pin2);
1819 1844
diff --git a/arch/x86_64/kernel/kprobes.c b/arch/x86_64/kernel/kprobes.c
index accbff3fec49..fa1d19ca700a 100644
--- a/arch/x86_64/kernel/kprobes.c
+++ b/arch/x86_64/kernel/kprobes.c
@@ -53,7 +53,7 @@ DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk);
53/* 53/*
54 * returns non-zero if opcode modifies the interrupt flag. 54 * returns non-zero if opcode modifies the interrupt flag.
55 */ 55 */
56static inline int is_IF_modifier(kprobe_opcode_t *insn) 56static __always_inline int is_IF_modifier(kprobe_opcode_t *insn)
57{ 57{
58 switch (*insn) { 58 switch (*insn) {
59 case 0xfa: /* cli */ 59 case 0xfa: /* cli */
@@ -84,7 +84,7 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
84 * If it does, return the address of the 32-bit displacement word. 84 * If it does, return the address of the 32-bit displacement word.
85 * If not, return null. 85 * If not, return null.
86 */ 86 */
87static inline s32 *is_riprel(u8 *insn) 87static s32 __kprobes *is_riprel(u8 *insn)
88{ 88{
89#define W(row,b0,b1,b2,b3,b4,b5,b6,b7,b8,b9,ba,bb,bc,bd,be,bf) \ 89#define W(row,b0,b1,b2,b3,b4,b5,b6,b7,b8,b9,ba,bb,bc,bd,be,bf) \
90 (((b0##UL << 0x0)|(b1##UL << 0x1)|(b2##UL << 0x2)|(b3##UL << 0x3) | \ 90 (((b0##UL << 0x0)|(b1##UL << 0x1)|(b2##UL << 0x2)|(b3##UL << 0x3) | \
@@ -229,7 +229,7 @@ void __kprobes arch_remove_kprobe(struct kprobe *p)
229 mutex_unlock(&kprobe_mutex); 229 mutex_unlock(&kprobe_mutex);
230} 230}
231 231
232static inline void save_previous_kprobe(struct kprobe_ctlblk *kcb) 232static void __kprobes save_previous_kprobe(struct kprobe_ctlblk *kcb)
233{ 233{
234 kcb->prev_kprobe.kp = kprobe_running(); 234 kcb->prev_kprobe.kp = kprobe_running();
235 kcb->prev_kprobe.status = kcb->kprobe_status; 235 kcb->prev_kprobe.status = kcb->kprobe_status;
@@ -237,7 +237,7 @@ static inline void save_previous_kprobe(struct kprobe_ctlblk *kcb)
237 kcb->prev_kprobe.saved_rflags = kcb->kprobe_saved_rflags; 237 kcb->prev_kprobe.saved_rflags = kcb->kprobe_saved_rflags;
238} 238}
239 239
240static inline void restore_previous_kprobe(struct kprobe_ctlblk *kcb) 240static void __kprobes restore_previous_kprobe(struct kprobe_ctlblk *kcb)
241{ 241{
242 __get_cpu_var(current_kprobe) = kcb->prev_kprobe.kp; 242 __get_cpu_var(current_kprobe) = kcb->prev_kprobe.kp;
243 kcb->kprobe_status = kcb->prev_kprobe.status; 243 kcb->kprobe_status = kcb->prev_kprobe.status;
@@ -245,7 +245,7 @@ static inline void restore_previous_kprobe(struct kprobe_ctlblk *kcb)
245 kcb->kprobe_saved_rflags = kcb->prev_kprobe.saved_rflags; 245 kcb->kprobe_saved_rflags = kcb->prev_kprobe.saved_rflags;
246} 246}
247 247
248static inline void set_current_kprobe(struct kprobe *p, struct pt_regs *regs, 248static void __kprobes set_current_kprobe(struct kprobe *p, struct pt_regs *regs,
249 struct kprobe_ctlblk *kcb) 249 struct kprobe_ctlblk *kcb)
250{ 250{
251 __get_cpu_var(current_kprobe) = p; 251 __get_cpu_var(current_kprobe) = p;
@@ -514,13 +514,13 @@ static void __kprobes resume_execution(struct kprobe *p,
514 *tos = orig_rip + (*tos - copy_rip); 514 *tos = orig_rip + (*tos - copy_rip);
515 break; 515 break;
516 case 0xff: 516 case 0xff:
517 if ((*insn & 0x30) == 0x10) { 517 if ((insn[1] & 0x30) == 0x10) {
518 /* call absolute, indirect */ 518 /* call absolute, indirect */
519 /* Fix return addr; rip is correct. */ 519 /* Fix return addr; rip is correct. */
520 next_rip = regs->rip; 520 next_rip = regs->rip;
521 *tos = orig_rip + (*tos - copy_rip); 521 *tos = orig_rip + (*tos - copy_rip);
522 } else if (((*insn & 0x31) == 0x20) || /* jmp near, absolute indirect */ 522 } else if (((insn[1] & 0x31) == 0x20) || /* jmp near, absolute indirect */
523 ((*insn & 0x31) == 0x21)) { /* jmp far, absolute indirect */ 523 ((insn[1] & 0x31) == 0x21)) { /* jmp far, absolute indirect */
524 /* rip is correct. */ 524 /* rip is correct. */
525 next_rip = regs->rip; 525 next_rip = regs->rip;
526 } 526 }
diff --git a/arch/x86_64/kernel/mce.c b/arch/x86_64/kernel/mce.c
index 6f0790e8b6d3..c69fc43cee7b 100644
--- a/arch/x86_64/kernel/mce.c
+++ b/arch/x86_64/kernel/mce.c
@@ -629,7 +629,7 @@ static __cpuinit void mce_remove_device(unsigned int cpu)
629#endif 629#endif
630 630
631/* Get notified when a cpu comes on/off. Be hotplug friendly. */ 631/* Get notified when a cpu comes on/off. Be hotplug friendly. */
632static __cpuinit int 632static int
633mce_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) 633mce_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
634{ 634{
635 unsigned int cpu = (unsigned long)hcpu; 635 unsigned int cpu = (unsigned long)hcpu;
diff --git a/arch/x86_64/kernel/mce_amd.c b/arch/x86_64/kernel/mce_amd.c
index d3ad7d81266d..d13b241ad094 100644
--- a/arch/x86_64/kernel/mce_amd.c
+++ b/arch/x86_64/kernel/mce_amd.c
@@ -482,7 +482,7 @@ static void threshold_remove_device(unsigned int cpu)
482#endif 482#endif
483 483
484/* get notified when a cpu comes on/off */ 484/* get notified when a cpu comes on/off */
485static __cpuinit int threshold_cpu_callback(struct notifier_block *nfb, 485static int threshold_cpu_callback(struct notifier_block *nfb,
486 unsigned long action, void *hcpu) 486 unsigned long action, void *hcpu)
487{ 487{
488 /* cpu was unsigned int to begin with */ 488 /* cpu was unsigned int to begin with */
diff --git a/arch/x86_64/kernel/mpparse.c b/arch/x86_64/kernel/mpparse.c
index b17cf3eba359..083da7e606b1 100644
--- a/arch/x86_64/kernel/mpparse.c
+++ b/arch/x86_64/kernel/mpparse.c
@@ -968,7 +968,17 @@ int mp_register_gsi(u32 gsi, int triggering, int polarity)
968 */ 968 */
969 int irq = gsi; 969 int irq = gsi;
970 if (gsi < MAX_GSI_NUM) { 970 if (gsi < MAX_GSI_NUM) {
971 if (gsi > 15) 971 /*
972 * Retain the VIA chipset work-around (gsi > 15), but
973 * avoid a problem where the 8254 timer (IRQ0) is setup
974 * via an override (so it's not on pin 0 of the ioapic),
975 * and at the same time, the pin 0 interrupt is a PCI
976 * type. The gsi > 15 test could cause these two pins
977 * to be shared as IRQ0, and they are not shareable.
978 * So test for this condition, and if necessary, avoid
979 * the pin collision.
980 */
981 if (gsi > 15 || (gsi == 0 && !timer_uses_ioapic_pin_0))
972 gsi = pci_irq++; 982 gsi = pci_irq++;
973 /* 983 /*
974 * Don't assign IRQ used by ACPI SCI 984 * Don't assign IRQ used by ACPI SCI
diff --git a/arch/x86_64/kernel/pci-dma.c b/arch/x86_64/kernel/pci-dma.c
index af035ede70cd..a9275c9557cf 100644
--- a/arch/x86_64/kernel/pci-dma.c
+++ b/arch/x86_64/kernel/pci-dma.c
@@ -54,6 +54,10 @@ dma_alloc_pages(struct device *dev, gfp_t gfp, unsigned order)
54 else 54 else
55#endif 55#endif
56 node = numa_node_id(); 56 node = numa_node_id();
57
58 if (node < first_node(node_online_map))
59 node = first_node(node_online_map);
60
57 page = alloc_pages_node(node, gfp, order); 61 page = alloc_pages_node(node, gfp, order);
58 return page ? page_address(page) : NULL; 62 return page ? page_address(page) : NULL;
59} 63}
diff --git a/arch/x86_64/kernel/pci-gart.c b/arch/x86_64/kernel/pci-gart.c
index a6c01e121266..82a7c9bfdfa0 100644
--- a/arch/x86_64/kernel/pci-gart.c
+++ b/arch/x86_64/kernel/pci-gart.c
@@ -112,10 +112,6 @@ static unsigned long alloc_iommu(int size)
112static void free_iommu(unsigned long offset, int size) 112static void free_iommu(unsigned long offset, int size)
113{ 113{
114 unsigned long flags; 114 unsigned long flags;
115 if (size == 1) {
116 clear_bit(offset, iommu_gart_bitmap);
117 return;
118 }
119 spin_lock_irqsave(&iommu_bitmap_lock, flags); 115 spin_lock_irqsave(&iommu_bitmap_lock, flags);
120 __clear_bit_string(iommu_gart_bitmap, offset, size); 116 __clear_bit_string(iommu_gart_bitmap, offset, size);
121 spin_unlock_irqrestore(&iommu_bitmap_lock, flags); 117 spin_unlock_irqrestore(&iommu_bitmap_lock, flags);
@@ -635,14 +631,20 @@ static int __init pci_iommu_init(void)
635 printk(KERN_INFO "PCI-DMA: Disabling IOMMU.\n"); 631 printk(KERN_INFO "PCI-DMA: Disabling IOMMU.\n");
636 if (end_pfn > MAX_DMA32_PFN) { 632 if (end_pfn > MAX_DMA32_PFN) {
637 printk(KERN_ERR "WARNING more than 4GB of memory " 633 printk(KERN_ERR "WARNING more than 4GB of memory "
638 "but IOMMU not compiled in.\n" 634 "but IOMMU not available.\n"
639 KERN_ERR "WARNING 32bit PCI may malfunction.\n" 635 KERN_ERR "WARNING 32bit PCI may malfunction.\n");
640 KERN_ERR "You might want to enable "
641 "CONFIG_GART_IOMMU\n");
642 } 636 }
643 return -1; 637 return -1;
644 } 638 }
645 639
640 i = 0;
641 for_all_nb(dev)
642 i++;
643 if (i > MAX_NB) {
644 printk(KERN_ERR "PCI-GART: Too many northbridges (%ld). Disabled\n", i);
645 return -1;
646 }
647
646 printk(KERN_INFO "PCI-DMA: using GART IOMMU.\n"); 648 printk(KERN_INFO "PCI-DMA: using GART IOMMU.\n");
647 aper_size = info.aper_size * 1024 * 1024; 649 aper_size = info.aper_size * 1024 * 1024;
648 iommu_size = check_iommu_size(info.aper_base, aper_size); 650 iommu_size = check_iommu_size(info.aper_base, aper_size);
diff --git a/arch/x86_64/kernel/pci-nommu.c b/arch/x86_64/kernel/pci-nommu.c
index 44adcc2d5e5b..1f6ecc62061d 100644
--- a/arch/x86_64/kernel/pci-nommu.c
+++ b/arch/x86_64/kernel/pci-nommu.c
@@ -12,9 +12,10 @@ static int
12check_addr(char *name, struct device *hwdev, dma_addr_t bus, size_t size) 12check_addr(char *name, struct device *hwdev, dma_addr_t bus, size_t size)
13{ 13{
14 if (hwdev && bus + size > *hwdev->dma_mask) { 14 if (hwdev && bus + size > *hwdev->dma_mask) {
15 printk(KERN_ERR 15 if (*hwdev->dma_mask >= 0xffffffffULL)
16 "nommu_%s: overflow %Lx+%lu of device mask %Lx\n", 16 printk(KERN_ERR
17 name, (long long)bus, size, (long long)*hwdev->dma_mask); 17 "nommu_%s: overflow %Lx+%lu of device mask %Lx\n",
18 name, (long long)bus, size, (long long)*hwdev->dma_mask);
18 return 0; 19 return 0;
19 } 20 }
20 return 1; 21 return 1;
diff --git a/arch/x86_64/kernel/pmtimer.c b/arch/x86_64/kernel/pmtimer.c
index b0444a415bd6..bf421ed26808 100644
--- a/arch/x86_64/kernel/pmtimer.c
+++ b/arch/x86_64/kernel/pmtimer.c
@@ -68,7 +68,7 @@ int pmtimer_mark_offset(void)
68 offset_delay = delta % (USEC_PER_SEC / HZ); 68 offset_delay = delta % (USEC_PER_SEC / HZ);
69 69
70 rdtscll(tsc); 70 rdtscll(tsc);
71 vxtime.last_tsc = tsc - offset_delay * cpu_khz; 71 vxtime.last_tsc = tsc - offset_delay * (u64)cpu_khz / 1000;
72 72
73 /* don't calculate delay for first run, 73 /* don't calculate delay for first run,
74 or if we've got less then a tick */ 74 or if we've got less then a tick */
diff --git a/arch/x86_64/kernel/process.c b/arch/x86_64/kernel/process.c
index 1c44b53cb15b..fb903e65e079 100644
--- a/arch/x86_64/kernel/process.c
+++ b/arch/x86_64/kernel/process.c
@@ -575,8 +575,10 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
575 prev->userrsp = read_pda(oldrsp); 575 prev->userrsp = read_pda(oldrsp);
576 write_pda(oldrsp, next->userrsp); 576 write_pda(oldrsp, next->userrsp);
577 write_pda(pcurrent, next_p); 577 write_pda(pcurrent, next_p);
578
578 /* This must be here to ensure both math_state_restore() and 579 /* This must be here to ensure both math_state_restore() and
579 kernel_fpu_begin() work consistently. */ 580 kernel_fpu_begin() work consistently.
581 And the AMD workaround requires it to be after DS reload. */
580 unlazy_fpu(prev_p); 582 unlazy_fpu(prev_p);
581 write_pda(kernelstack, 583 write_pda(kernelstack,
582 task_stack_page(next_p) + THREAD_SIZE - PDA_STACKOFFSET); 584 task_stack_page(next_p) + THREAD_SIZE - PDA_STACKOFFSET);
diff --git a/arch/x86_64/kernel/ptrace.c b/arch/x86_64/kernel/ptrace.c
index da8e7903d817..2d50024c9f30 100644
--- a/arch/x86_64/kernel/ptrace.c
+++ b/arch/x86_64/kernel/ptrace.c
@@ -600,12 +600,12 @@ asmlinkage void syscall_trace_enter(struct pt_regs *regs)
600 600
601 if (unlikely(current->audit_context)) { 601 if (unlikely(current->audit_context)) {
602 if (test_thread_flag(TIF_IA32)) { 602 if (test_thread_flag(TIF_IA32)) {
603 audit_syscall_entry(current, AUDIT_ARCH_I386, 603 audit_syscall_entry(AUDIT_ARCH_I386,
604 regs->orig_rax, 604 regs->orig_rax,
605 regs->rbx, regs->rcx, 605 regs->rbx, regs->rcx,
606 regs->rdx, regs->rsi); 606 regs->rdx, regs->rsi);
607 } else { 607 } else {
608 audit_syscall_entry(current, AUDIT_ARCH_X86_64, 608 audit_syscall_entry(AUDIT_ARCH_X86_64,
609 regs->orig_rax, 609 regs->orig_rax,
610 regs->rdi, regs->rsi, 610 regs->rdi, regs->rsi,
611 regs->rdx, regs->r10); 611 regs->rdx, regs->r10);
@@ -616,7 +616,7 @@ asmlinkage void syscall_trace_enter(struct pt_regs *regs)
616asmlinkage void syscall_trace_leave(struct pt_regs *regs) 616asmlinkage void syscall_trace_leave(struct pt_regs *regs)
617{ 617{
618 if (unlikely(current->audit_context)) 618 if (unlikely(current->audit_context))
619 audit_syscall_exit(current, AUDITSC_RESULT(regs->rax), regs->rax); 619 audit_syscall_exit(AUDITSC_RESULT(regs->rax), regs->rax);
620 620
621 if ((test_thread_flag(TIF_SYSCALL_TRACE) 621 if ((test_thread_flag(TIF_SYSCALL_TRACE)
622 || test_thread_flag(TIF_SINGLESTEP)) 622 || test_thread_flag(TIF_SINGLESTEP))
diff --git a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c
index c50b06765a80..655b9192eeb3 100644
--- a/arch/x86_64/kernel/setup.c
+++ b/arch/x86_64/kernel/setup.c
@@ -571,17 +571,28 @@ static inline void copy_edd(void)
571#endif 571#endif
572 572
573#define EBDA_ADDR_POINTER 0x40E 573#define EBDA_ADDR_POINTER 0x40E
574static void __init reserve_ebda_region(void) 574
575unsigned __initdata ebda_addr;
576unsigned __initdata ebda_size;
577
578static void discover_ebda(void)
575{ 579{
576 unsigned int addr; 580 /*
577 /**
578 * there is a real-mode segmented pointer pointing to the 581 * there is a real-mode segmented pointer pointing to the
579 * 4K EBDA area at 0x40E 582 * 4K EBDA area at 0x40E
580 */ 583 */
581 addr = *(unsigned short *)phys_to_virt(EBDA_ADDR_POINTER); 584 ebda_addr = *(unsigned short *)EBDA_ADDR_POINTER;
582 addr <<= 4; 585 ebda_addr <<= 4;
583 if (addr) 586
584 reserve_bootmem_generic(addr, PAGE_SIZE); 587 ebda_size = *(unsigned short *)(unsigned long)ebda_addr;
588
589 /* Round EBDA up to pages */
590 if (ebda_size == 0)
591 ebda_size = 1;
592 ebda_size <<= 10;
593 ebda_size = round_up(ebda_size + (ebda_addr & ~PAGE_MASK), PAGE_SIZE);
594 if (ebda_size > 64*1024)
595 ebda_size = 64*1024;
585} 596}
586 597
587void __init setup_arch(char **cmdline_p) 598void __init setup_arch(char **cmdline_p)
@@ -627,6 +638,8 @@ void __init setup_arch(char **cmdline_p)
627 638
628 check_efer(); 639 check_efer();
629 640
641 discover_ebda();
642
630 init_memory_mapping(0, (end_pfn_map << PAGE_SHIFT)); 643 init_memory_mapping(0, (end_pfn_map << PAGE_SHIFT));
631 644
632 dmi_scan_machine(); 645 dmi_scan_machine();
@@ -669,7 +682,8 @@ void __init setup_arch(char **cmdline_p)
669 reserve_bootmem_generic(0, PAGE_SIZE); 682 reserve_bootmem_generic(0, PAGE_SIZE);
670 683
671 /* reserve ebda region */ 684 /* reserve ebda region */
672 reserve_ebda_region(); 685 if (ebda_addr)
686 reserve_bootmem_generic(ebda_addr, ebda_size);
673 687
674#ifdef CONFIG_SMP 688#ifdef CONFIG_SMP
675 /* 689 /*
@@ -930,6 +944,10 @@ static int __init init_amd(struct cpuinfo_x86 *c)
930 if (c->x86 == 15 && ((level >= 0x0f48 && level < 0x0f50) || level >= 0x0f58)) 944 if (c->x86 == 15 && ((level >= 0x0f48 && level < 0x0f50) || level >= 0x0f58))
931 set_bit(X86_FEATURE_REP_GOOD, &c->x86_capability); 945 set_bit(X86_FEATURE_REP_GOOD, &c->x86_capability);
932 946
947 /* Enable workaround for FXSAVE leak */
948 if (c->x86 >= 6)
949 set_bit(X86_FEATURE_FXSAVE_LEAK, &c->x86_capability);
950
933 r = get_model_name(c); 951 r = get_model_name(c);
934 if (!r) { 952 if (!r) {
935 switch (c->x86) { 953 switch (c->x86) {
@@ -1033,7 +1051,7 @@ static void srat_detect_node(void)
1033 for now. */ 1051 for now. */
1034 node = apicid_to_node[hard_smp_processor_id()]; 1052 node = apicid_to_node[hard_smp_processor_id()];
1035 if (node == NUMA_NO_NODE) 1053 if (node == NUMA_NO_NODE)
1036 node = 0; 1054 node = first_node(node_online_map);
1037 numa_set_node(cpu, node); 1055 numa_set_node(cpu, node);
1038 1056
1039 if (acpi_numa > 0) 1057 if (acpi_numa > 0)
@@ -1422,3 +1440,22 @@ struct seq_operations cpuinfo_op = {
1422 .show = show_cpuinfo, 1440 .show = show_cpuinfo,
1423}; 1441};
1424 1442
1443#ifdef CONFIG_INPUT_PCSPKR
1444#include <linux/platform_device.h>
1445static __init int add_pcspkr(void)
1446{
1447 struct platform_device *pd;
1448 int ret;
1449
1450 pd = platform_device_alloc("pcspkr", -1);
1451 if (!pd)
1452 return -ENOMEM;
1453
1454 ret = platform_device_add(pd);
1455 if (ret)
1456 platform_device_put(pd);
1457
1458 return ret;
1459}
1460device_initcall(add_pcspkr);
1461#endif
diff --git a/arch/x86_64/kernel/traps.c b/arch/x86_64/kernel/traps.c
index 6bda322d3caf..cea335e8746c 100644
--- a/arch/x86_64/kernel/traps.c
+++ b/arch/x86_64/kernel/traps.c
@@ -30,6 +30,7 @@
30#include <linux/moduleparam.h> 30#include <linux/moduleparam.h>
31#include <linux/nmi.h> 31#include <linux/nmi.h>
32#include <linux/kprobes.h> 32#include <linux/kprobes.h>
33#include <linux/kexec.h>
33 34
34#include <asm/system.h> 35#include <asm/system.h>
35#include <asm/uaccess.h> 36#include <asm/uaccess.h>
@@ -101,6 +102,8 @@ static inline void preempt_conditional_cli(struct pt_regs *regs)
101{ 102{
102 if (regs->eflags & X86_EFLAGS_IF) 103 if (regs->eflags & X86_EFLAGS_IF)
103 local_irq_disable(); 104 local_irq_disable();
105 /* Make sure to not schedule here because we could be running
106 on an exception stack. */
104 preempt_enable_no_resched(); 107 preempt_enable_no_resched();
105} 108}
106 109
@@ -384,6 +387,7 @@ void out_of_line_bug(void)
384 387
385static DEFINE_SPINLOCK(die_lock); 388static DEFINE_SPINLOCK(die_lock);
386static int die_owner = -1; 389static int die_owner = -1;
390static unsigned int die_nest_count;
387 391
388unsigned __kprobes long oops_begin(void) 392unsigned __kprobes long oops_begin(void)
389{ 393{
@@ -398,6 +402,7 @@ unsigned __kprobes long oops_begin(void)
398 else 402 else
399 spin_lock(&die_lock); 403 spin_lock(&die_lock);
400 } 404 }
405 die_nest_count++;
401 die_owner = cpu; 406 die_owner = cpu;
402 console_verbose(); 407 console_verbose();
403 bust_spinlocks(1); 408 bust_spinlocks(1);
@@ -408,7 +413,13 @@ void __kprobes oops_end(unsigned long flags)
408{ 413{
409 die_owner = -1; 414 die_owner = -1;
410 bust_spinlocks(0); 415 bust_spinlocks(0);
411 spin_unlock_irqrestore(&die_lock, flags); 416 die_nest_count--;
417 if (die_nest_count)
418 /* We still own the lock */
419 local_irq_restore(flags);
420 else
421 /* Nest count reaches zero, release the lock. */
422 spin_unlock_irqrestore(&die_lock, flags);
412 if (panic_on_oops) 423 if (panic_on_oops)
413 panic("Oops"); 424 panic("Oops");
414} 425}
@@ -433,6 +444,8 @@ void __kprobes __die(const char * str, struct pt_regs * regs, long err)
433 printk(KERN_ALERT "RIP "); 444 printk(KERN_ALERT "RIP ");
434 printk_address(regs->rip); 445 printk_address(regs->rip);
435 printk(" RSP <%016lx>\n", regs->rsp); 446 printk(" RSP <%016lx>\n", regs->rsp);
447 if (kexec_should_crash(current))
448 crash_kexec(regs);
436} 449}
437 450
438void die(const char * str, struct pt_regs * regs, long err) 451void die(const char * str, struct pt_regs * regs, long err)
@@ -455,10 +468,14 @@ void __kprobes die_nmi(char *str, struct pt_regs *regs)
455 */ 468 */
456 printk(str, safe_smp_processor_id()); 469 printk(str, safe_smp_processor_id());
457 show_registers(regs); 470 show_registers(regs);
471 if (kexec_should_crash(current))
472 crash_kexec(regs);
458 if (panic_on_timeout || panic_on_oops) 473 if (panic_on_timeout || panic_on_oops)
459 panic("nmi watchdog"); 474 panic("nmi watchdog");
460 printk("console shuts up ...\n"); 475 printk("console shuts up ...\n");
461 oops_end(flags); 476 oops_end(flags);
477 nmi_exit();
478 local_irq_enable();
462 do_exit(SIGSEGV); 479 do_exit(SIGSEGV);
463} 480}
464 481
@@ -468,8 +485,6 @@ static void __kprobes do_trap(int trapnr, int signr, char *str,
468{ 485{
469 struct task_struct *tsk = current; 486 struct task_struct *tsk = current;
470 487
471 conditional_sti(regs);
472
473 tsk->thread.error_code = error_code; 488 tsk->thread.error_code = error_code;
474 tsk->thread.trap_no = trapnr; 489 tsk->thread.trap_no = trapnr;
475 490
@@ -506,6 +521,7 @@ asmlinkage void do_##name(struct pt_regs * regs, long error_code) \
506 if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \ 521 if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \
507 == NOTIFY_STOP) \ 522 == NOTIFY_STOP) \
508 return; \ 523 return; \
524 conditional_sti(regs); \
509 do_trap(trapnr, signr, str, regs, error_code, NULL); \ 525 do_trap(trapnr, signr, str, regs, error_code, NULL); \
510} 526}
511 527
@@ -520,6 +536,7 @@ asmlinkage void do_##name(struct pt_regs * regs, long error_code) \
520 if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \ 536 if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \
521 == NOTIFY_STOP) \ 537 == NOTIFY_STOP) \
522 return; \ 538 return; \
539 conditional_sti(regs); \
523 do_trap(trapnr, signr, str, regs, error_code, &info); \ 540 do_trap(trapnr, signr, str, regs, error_code, &info); \
524} 541}
525 542
@@ -533,7 +550,17 @@ DO_ERROR(10, SIGSEGV, "invalid TSS", invalid_TSS)
533DO_ERROR(11, SIGBUS, "segment not present", segment_not_present) 550DO_ERROR(11, SIGBUS, "segment not present", segment_not_present)
534DO_ERROR_INFO(17, SIGBUS, "alignment check", alignment_check, BUS_ADRALN, 0) 551DO_ERROR_INFO(17, SIGBUS, "alignment check", alignment_check, BUS_ADRALN, 0)
535DO_ERROR(18, SIGSEGV, "reserved", reserved) 552DO_ERROR(18, SIGSEGV, "reserved", reserved)
536DO_ERROR(12, SIGBUS, "stack segment", stack_segment) 553
554/* Runs on IST stack */
555asmlinkage void do_stack_segment(struct pt_regs *regs, long error_code)
556{
557 if (notify_die(DIE_TRAP, "stack segment", regs, error_code,
558 12, SIGBUS) == NOTIFY_STOP)
559 return;
560 preempt_conditional_sti(regs);
561 do_trap(12, SIGBUS, "stack segment", regs, error_code, NULL);
562 preempt_conditional_cli(regs);
563}
537 564
538asmlinkage void do_double_fault(struct pt_regs * regs, long error_code) 565asmlinkage void do_double_fault(struct pt_regs * regs, long error_code)
539{ 566{
@@ -667,8 +694,9 @@ asmlinkage void __kprobes do_int3(struct pt_regs * regs, long error_code)
667 if (notify_die(DIE_INT3, "int3", regs, error_code, 3, SIGTRAP) == NOTIFY_STOP) { 694 if (notify_die(DIE_INT3, "int3", regs, error_code, 3, SIGTRAP) == NOTIFY_STOP) {
668 return; 695 return;
669 } 696 }
697 preempt_conditional_sti(regs);
670 do_trap(3, SIGTRAP, "int3", regs, error_code, NULL); 698 do_trap(3, SIGTRAP, "int3", regs, error_code, NULL);
671 return; 699 preempt_conditional_cli(regs);
672} 700}
673 701
674/* Help handler running on IST stack to switch back to user stack 702/* Help handler running on IST stack to switch back to user stack
diff --git a/arch/x86_64/mm/numa.c b/arch/x86_64/mm/numa.c
index cc02573a3271..b2fac14baac0 100644
--- a/arch/x86_64/mm/numa.c
+++ b/arch/x86_64/mm/numa.c
@@ -188,11 +188,13 @@ void __init setup_node_zones(int nodeid)
188 memory. */ 188 memory. */
189 memmapsize = sizeof(struct page) * (end_pfn-start_pfn); 189 memmapsize = sizeof(struct page) * (end_pfn-start_pfn);
190 limit = end_pfn << PAGE_SHIFT; 190 limit = end_pfn << PAGE_SHIFT;
191#ifdef CONFIG_FLAT_NODE_MEM_MAP
191 NODE_DATA(nodeid)->node_mem_map = 192 NODE_DATA(nodeid)->node_mem_map =
192 __alloc_bootmem_core(NODE_DATA(nodeid)->bdata, 193 __alloc_bootmem_core(NODE_DATA(nodeid)->bdata,
193 memmapsize, SMP_CACHE_BYTES, 194 memmapsize, SMP_CACHE_BYTES,
194 round_down(limit - memmapsize, PAGE_SIZE), 195 round_down(limit - memmapsize, PAGE_SIZE),
195 limit); 196 limit);
197#endif
196 198
197 size_zones(zones, holes, start_pfn, end_pfn); 199 size_zones(zones, holes, start_pfn, end_pfn);
198 free_area_init_node(nodeid, NODE_DATA(nodeid), zones, 200 free_area_init_node(nodeid, NODE_DATA(nodeid), zones,
diff --git a/arch/x86_64/mm/srat.c b/arch/x86_64/mm/srat.c
index 15ae9fcd65a7..474df22c6ed2 100644
--- a/arch/x86_64/mm/srat.c
+++ b/arch/x86_64/mm/srat.c
@@ -34,7 +34,10 @@ static nodemask_t nodes_found __initdata;
34static struct bootnode nodes[MAX_NUMNODES] __initdata; 34static struct bootnode nodes[MAX_NUMNODES] __initdata;
35static struct bootnode nodes_add[MAX_NUMNODES] __initdata; 35static struct bootnode nodes_add[MAX_NUMNODES] __initdata;
36static int found_add_area __initdata; 36static int found_add_area __initdata;
37int hotadd_percent __initdata = 10; 37int hotadd_percent __initdata = 0;
38#ifndef RESERVE_HOTADD
39#define hotadd_percent 0 /* Ignore all settings */
40#endif
38static u8 pxm2node[256] = { [0 ... 255] = 0xff }; 41static u8 pxm2node[256] = { [0 ... 255] = 0xff };
39 42
40/* Too small nodes confuse the VM badly. Usually they result 43/* Too small nodes confuse the VM badly. Usually they result
@@ -103,6 +106,7 @@ static __init void bad_srat(void)
103 int i; 106 int i;
104 printk(KERN_ERR "SRAT: SRAT not used.\n"); 107 printk(KERN_ERR "SRAT: SRAT not used.\n");
105 acpi_numa = -1; 108 acpi_numa = -1;
109 found_add_area = 0;
106 for (i = 0; i < MAX_LOCAL_APIC; i++) 110 for (i = 0; i < MAX_LOCAL_APIC; i++)
107 apicid_to_node[i] = NUMA_NO_NODE; 111 apicid_to_node[i] = NUMA_NO_NODE;
108 for (i = 0; i < MAX_NUMNODES; i++) 112 for (i = 0; i < MAX_NUMNODES; i++)
@@ -154,7 +158,8 @@ acpi_numa_processor_affinity_init(struct acpi_table_processor_affinity *pa)
154 int pxm, node; 158 int pxm, node;
155 if (srat_disabled()) 159 if (srat_disabled())
156 return; 160 return;
157 if (pa->header.length != sizeof(struct acpi_table_processor_affinity)) { bad_srat(); 161 if (pa->header.length != sizeof(struct acpi_table_processor_affinity)) {
162 bad_srat();
158 return; 163 return;
159 } 164 }
160 if (pa->flags.enabled == 0) 165 if (pa->flags.enabled == 0)
@@ -191,15 +196,17 @@ static int hotadd_enough_memory(struct bootnode *nd)
191 allowed = (end_pfn - e820_hole_size(0, end_pfn)) * PAGE_SIZE; 196 allowed = (end_pfn - e820_hole_size(0, end_pfn)) * PAGE_SIZE;
192 allowed = (allowed / 100) * hotadd_percent; 197 allowed = (allowed / 100) * hotadd_percent;
193 if (allocated + mem > allowed) { 198 if (allocated + mem > allowed) {
199 unsigned long range;
194 /* Give them at least part of their hotadd memory upto hotadd_percent 200 /* Give them at least part of their hotadd memory upto hotadd_percent
195 It would be better to spread the limit out 201 It would be better to spread the limit out
196 over multiple hotplug areas, but that is too complicated 202 over multiple hotplug areas, but that is too complicated
197 right now */ 203 right now */
198 if (allocated >= allowed) 204 if (allocated >= allowed)
199 return 0; 205 return 0;
200 pages = (allowed - allocated + mem) / sizeof(struct page); 206 range = allowed - allocated;
207 pages = (range / PAGE_SIZE);
201 mem = pages * sizeof(struct page); 208 mem = pages * sizeof(struct page);
202 nd->end = nd->start + pages*PAGE_SIZE; 209 nd->end = nd->start + range;
203 } 210 }
204 /* Not completely fool proof, but a good sanity check */ 211 /* Not completely fool proof, but a good sanity check */
205 addr = find_e820_area(last_area_end, end_pfn<<PAGE_SHIFT, mem); 212 addr = find_e820_area(last_area_end, end_pfn<<PAGE_SHIFT, mem);
@@ -392,8 +399,10 @@ int __init acpi_scan_nodes(unsigned long start, unsigned long end)
392 /* First clean up the node list */ 399 /* First clean up the node list */
393 for (i = 0; i < MAX_NUMNODES; i++) { 400 for (i = 0; i < MAX_NUMNODES; i++) {
394 cutoff_node(i, start, end); 401 cutoff_node(i, start, end);
395 if ((nodes[i].end - nodes[i].start) < NODE_MIN_SIZE) 402 if ((nodes[i].end - nodes[i].start) < NODE_MIN_SIZE) {
396 unparse_node(i); 403 unparse_node(i);
404 node_set_offline(i);
405 }
397 } 406 }
398 407
399 if (acpi_numa <= 0) 408 if (acpi_numa <= 0)
diff --git a/block/as-iosched.c b/block/as-iosched.c
index 296708ceceb2..a7caf35ca0c2 100644
--- a/block/as-iosched.c
+++ b/block/as-iosched.c
@@ -1648,17 +1648,17 @@ static void as_exit_queue(elevator_t *e)
1648 * initialize elevator private data (as_data), and alloc a arq for 1648 * initialize elevator private data (as_data), and alloc a arq for
1649 * each request on the free lists 1649 * each request on the free lists
1650 */ 1650 */
1651static int as_init_queue(request_queue_t *q, elevator_t *e) 1651static void *as_init_queue(request_queue_t *q, elevator_t *e)
1652{ 1652{
1653 struct as_data *ad; 1653 struct as_data *ad;
1654 int i; 1654 int i;
1655 1655
1656 if (!arq_pool) 1656 if (!arq_pool)
1657 return -ENOMEM; 1657 return NULL;
1658 1658
1659 ad = kmalloc_node(sizeof(*ad), GFP_KERNEL, q->node); 1659 ad = kmalloc_node(sizeof(*ad), GFP_KERNEL, q->node);
1660 if (!ad) 1660 if (!ad)
1661 return -ENOMEM; 1661 return NULL;
1662 memset(ad, 0, sizeof(*ad)); 1662 memset(ad, 0, sizeof(*ad));
1663 1663
1664 ad->q = q; /* Identify what queue the data belongs to */ 1664 ad->q = q; /* Identify what queue the data belongs to */
@@ -1667,7 +1667,7 @@ static int as_init_queue(request_queue_t *q, elevator_t *e)
1667 GFP_KERNEL, q->node); 1667 GFP_KERNEL, q->node);
1668 if (!ad->hash) { 1668 if (!ad->hash) {
1669 kfree(ad); 1669 kfree(ad);
1670 return -ENOMEM; 1670 return NULL;
1671 } 1671 }
1672 1672
1673 ad->arq_pool = mempool_create_node(BLKDEV_MIN_RQ, mempool_alloc_slab, 1673 ad->arq_pool = mempool_create_node(BLKDEV_MIN_RQ, mempool_alloc_slab,
@@ -1675,7 +1675,7 @@ static int as_init_queue(request_queue_t *q, elevator_t *e)
1675 if (!ad->arq_pool) { 1675 if (!ad->arq_pool) {
1676 kfree(ad->hash); 1676 kfree(ad->hash);
1677 kfree(ad); 1677 kfree(ad);
1678 return -ENOMEM; 1678 return NULL;
1679 } 1679 }
1680 1680
1681 /* anticipatory scheduling helpers */ 1681 /* anticipatory scheduling helpers */
@@ -1696,14 +1696,13 @@ static int as_init_queue(request_queue_t *q, elevator_t *e)
1696 ad->antic_expire = default_antic_expire; 1696 ad->antic_expire = default_antic_expire;
1697 ad->batch_expire[REQ_SYNC] = default_read_batch_expire; 1697 ad->batch_expire[REQ_SYNC] = default_read_batch_expire;
1698 ad->batch_expire[REQ_ASYNC] = default_write_batch_expire; 1698 ad->batch_expire[REQ_ASYNC] = default_write_batch_expire;
1699 e->elevator_data = ad;
1700 1699
1701 ad->current_batch_expires = jiffies + ad->batch_expire[REQ_SYNC]; 1700 ad->current_batch_expires = jiffies + ad->batch_expire[REQ_SYNC];
1702 ad->write_batch_count = ad->batch_expire[REQ_ASYNC] / 10; 1701 ad->write_batch_count = ad->batch_expire[REQ_ASYNC] / 10;
1703 if (ad->write_batch_count < 2) 1702 if (ad->write_batch_count < 2)
1704 ad->write_batch_count = 2; 1703 ad->write_batch_count = 2;
1705 1704
1706 return 0; 1705 return ad;
1707} 1706}
1708 1707
1709/* 1708/*
@@ -1844,9 +1843,10 @@ static void __exit as_exit(void)
1844 DECLARE_COMPLETION(all_gone); 1843 DECLARE_COMPLETION(all_gone);
1845 elv_unregister(&iosched_as); 1844 elv_unregister(&iosched_as);
1846 ioc_gone = &all_gone; 1845 ioc_gone = &all_gone;
1847 barrier(); 1846 /* ioc_gone's update must be visible before reading ioc_count */
1847 smp_wmb();
1848 if (atomic_read(&ioc_count)) 1848 if (atomic_read(&ioc_count))
1849 complete(ioc_gone); 1849 wait_for_completion(ioc_gone);
1850 synchronize_rcu(); 1850 synchronize_rcu();
1851 kmem_cache_destroy(arq_pool); 1851 kmem_cache_destroy(arq_pool);
1852} 1852}
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 67d446de0227..a46d030e092a 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -33,7 +33,7 @@ static int cfq_slice_idle = HZ / 70;
33 33
34#define CFQ_KEY_ASYNC (0) 34#define CFQ_KEY_ASYNC (0)
35 35
36static DEFINE_RWLOCK(cfq_exit_lock); 36static DEFINE_SPINLOCK(cfq_exit_lock);
37 37
38/* 38/*
39 * for the hash of cfqq inside the cfqd 39 * for the hash of cfqq inside the cfqd
@@ -133,6 +133,7 @@ struct cfq_data {
133 mempool_t *crq_pool; 133 mempool_t *crq_pool;
134 134
135 int rq_in_driver; 135 int rq_in_driver;
136 int hw_tag;
136 137
137 /* 138 /*
138 * schedule slice state info 139 * schedule slice state info
@@ -500,10 +501,13 @@ static void cfq_resort_rr_list(struct cfq_queue *cfqq, int preempted)
500 501
501 /* 502 /*
502 * if queue was preempted, just add to front to be fair. busy_rr 503 * if queue was preempted, just add to front to be fair. busy_rr
503 * isn't sorted. 504 * isn't sorted, but insert at the back for fairness.
504 */ 505 */
505 if (preempted || list == &cfqd->busy_rr) { 506 if (preempted || list == &cfqd->busy_rr) {
506 list_add(&cfqq->cfq_list, list); 507 if (preempted)
508 list = list->prev;
509
510 list_add_tail(&cfqq->cfq_list, list);
507 return; 511 return;
508 } 512 }
509 513
@@ -664,6 +668,15 @@ static void cfq_activate_request(request_queue_t *q, struct request *rq)
664 struct cfq_data *cfqd = q->elevator->elevator_data; 668 struct cfq_data *cfqd = q->elevator->elevator_data;
665 669
666 cfqd->rq_in_driver++; 670 cfqd->rq_in_driver++;
671
672 /*
673 * If the depth is larger 1, it really could be queueing. But lets
674 * make the mark a little higher - idling could still be good for
675 * low queueing, and a low queueing number could also just indicate
676 * a SCSI mid layer like behaviour where limit+1 is often seen.
677 */
678 if (!cfqd->hw_tag && cfqd->rq_in_driver > 4)
679 cfqd->hw_tag = 1;
667} 680}
668 681
669static void cfq_deactivate_request(request_queue_t *q, struct request *rq) 682static void cfq_deactivate_request(request_queue_t *q, struct request *rq)
@@ -879,6 +892,13 @@ static struct cfq_queue *cfq_set_active_queue(struct cfq_data *cfqd)
879 cfqq = list_entry_cfqq(cfqd->cur_rr.next); 892 cfqq = list_entry_cfqq(cfqd->cur_rr.next);
880 893
881 /* 894 /*
895 * If no new queues are available, check if the busy list has some
896 * before falling back to idle io.
897 */
898 if (!cfqq && !list_empty(&cfqd->busy_rr))
899 cfqq = list_entry_cfqq(cfqd->busy_rr.next);
900
901 /*
882 * if we have idle queues and no rt or be queues had pending 902 * if we have idle queues and no rt or be queues had pending
883 * requests, either allow immediate service if the grace period 903 * requests, either allow immediate service if the grace period
884 * has passed or arm the idle grace timer 904 * has passed or arm the idle grace timer
@@ -1284,7 +1304,7 @@ static void cfq_exit_io_context(struct io_context *ioc)
1284 /* 1304 /*
1285 * put the reference this task is holding to the various queues 1305 * put the reference this task is holding to the various queues
1286 */ 1306 */
1287 read_lock_irqsave(&cfq_exit_lock, flags); 1307 spin_lock_irqsave(&cfq_exit_lock, flags);
1288 1308
1289 n = rb_first(&ioc->cic_root); 1309 n = rb_first(&ioc->cic_root);
1290 while (n != NULL) { 1310 while (n != NULL) {
@@ -1294,7 +1314,7 @@ static void cfq_exit_io_context(struct io_context *ioc)
1294 n = rb_next(n); 1314 n = rb_next(n);
1295 } 1315 }
1296 1316
1297 read_unlock_irqrestore(&cfq_exit_lock, flags); 1317 spin_unlock_irqrestore(&cfq_exit_lock, flags);
1298} 1318}
1299 1319
1300static struct cfq_io_context * 1320static struct cfq_io_context *
@@ -1400,17 +1420,17 @@ static int cfq_ioc_set_ioprio(struct io_context *ioc, unsigned int ioprio)
1400 struct cfq_io_context *cic; 1420 struct cfq_io_context *cic;
1401 struct rb_node *n; 1421 struct rb_node *n;
1402 1422
1403 write_lock(&cfq_exit_lock); 1423 spin_lock(&cfq_exit_lock);
1404 1424
1405 n = rb_first(&ioc->cic_root); 1425 n = rb_first(&ioc->cic_root);
1406 while (n != NULL) { 1426 while (n != NULL) {
1407 cic = rb_entry(n, struct cfq_io_context, rb_node); 1427 cic = rb_entry(n, struct cfq_io_context, rb_node);
1408 1428
1409 changed_ioprio(cic); 1429 changed_ioprio(cic);
1410 n = rb_next(n); 1430 n = rb_next(n);
1411 } 1431 }
1412 1432
1413 write_unlock(&cfq_exit_lock); 1433 spin_unlock(&cfq_exit_lock);
1414 1434
1415 return 0; 1435 return 0;
1416} 1436}
@@ -1458,7 +1478,8 @@ retry:
1458 * set ->slice_left to allow preemption for a new process 1478 * set ->slice_left to allow preemption for a new process
1459 */ 1479 */
1460 cfqq->slice_left = 2 * cfqd->cfq_slice_idle; 1480 cfqq->slice_left = 2 * cfqd->cfq_slice_idle;
1461 cfq_mark_cfqq_idle_window(cfqq); 1481 if (!cfqd->hw_tag)
1482 cfq_mark_cfqq_idle_window(cfqq);
1462 cfq_mark_cfqq_prio_changed(cfqq); 1483 cfq_mark_cfqq_prio_changed(cfqq);
1463 cfq_init_prio_data(cfqq); 1484 cfq_init_prio_data(cfqq);
1464 } 1485 }
@@ -1472,19 +1493,38 @@ out:
1472 return cfqq; 1493 return cfqq;
1473} 1494}
1474 1495
1496static void
1497cfq_drop_dead_cic(struct io_context *ioc, struct cfq_io_context *cic)
1498{
1499 spin_lock(&cfq_exit_lock);
1500 rb_erase(&cic->rb_node, &ioc->cic_root);
1501 list_del_init(&cic->queue_list);
1502 spin_unlock(&cfq_exit_lock);
1503 kmem_cache_free(cfq_ioc_pool, cic);
1504 atomic_dec(&ioc_count);
1505}
1506
1475static struct cfq_io_context * 1507static struct cfq_io_context *
1476cfq_cic_rb_lookup(struct cfq_data *cfqd, struct io_context *ioc) 1508cfq_cic_rb_lookup(struct cfq_data *cfqd, struct io_context *ioc)
1477{ 1509{
1478 struct rb_node *n = ioc->cic_root.rb_node; 1510 struct rb_node *n;
1479 struct cfq_io_context *cic; 1511 struct cfq_io_context *cic;
1480 void *key = cfqd; 1512 void *k, *key = cfqd;
1481 1513
1514restart:
1515 n = ioc->cic_root.rb_node;
1482 while (n) { 1516 while (n) {
1483 cic = rb_entry(n, struct cfq_io_context, rb_node); 1517 cic = rb_entry(n, struct cfq_io_context, rb_node);
1518 /* ->key must be copied to avoid race with cfq_exit_queue() */
1519 k = cic->key;
1520 if (unlikely(!k)) {
1521 cfq_drop_dead_cic(ioc, cic);
1522 goto restart;
1523 }
1484 1524
1485 if (key < cic->key) 1525 if (key < k)
1486 n = n->rb_left; 1526 n = n->rb_left;
1487 else if (key > cic->key) 1527 else if (key > k)
1488 n = n->rb_right; 1528 n = n->rb_right;
1489 else 1529 else
1490 return cic; 1530 return cic;
@@ -1497,33 +1537,41 @@ static inline void
1497cfq_cic_link(struct cfq_data *cfqd, struct io_context *ioc, 1537cfq_cic_link(struct cfq_data *cfqd, struct io_context *ioc,
1498 struct cfq_io_context *cic) 1538 struct cfq_io_context *cic)
1499{ 1539{
1500 struct rb_node **p = &ioc->cic_root.rb_node; 1540 struct rb_node **p;
1501 struct rb_node *parent = NULL; 1541 struct rb_node *parent;
1502 struct cfq_io_context *__cic; 1542 struct cfq_io_context *__cic;
1503 1543 void *k;
1504 read_lock(&cfq_exit_lock);
1505 1544
1506 cic->ioc = ioc; 1545 cic->ioc = ioc;
1507 cic->key = cfqd; 1546 cic->key = cfqd;
1508 1547
1509 ioc->set_ioprio = cfq_ioc_set_ioprio; 1548 ioc->set_ioprio = cfq_ioc_set_ioprio;
1510 1549restart:
1550 parent = NULL;
1551 p = &ioc->cic_root.rb_node;
1511 while (*p) { 1552 while (*p) {
1512 parent = *p; 1553 parent = *p;
1513 __cic = rb_entry(parent, struct cfq_io_context, rb_node); 1554 __cic = rb_entry(parent, struct cfq_io_context, rb_node);
1555 /* ->key must be copied to avoid race with cfq_exit_queue() */
1556 k = __cic->key;
1557 if (unlikely(!k)) {
1558 cfq_drop_dead_cic(ioc, cic);
1559 goto restart;
1560 }
1514 1561
1515 if (cic->key < __cic->key) 1562 if (cic->key < k)
1516 p = &(*p)->rb_left; 1563 p = &(*p)->rb_left;
1517 else if (cic->key > __cic->key) 1564 else if (cic->key > k)
1518 p = &(*p)->rb_right; 1565 p = &(*p)->rb_right;
1519 else 1566 else
1520 BUG(); 1567 BUG();
1521 } 1568 }
1522 1569
1570 spin_lock(&cfq_exit_lock);
1523 rb_link_node(&cic->rb_node, parent, p); 1571 rb_link_node(&cic->rb_node, parent, p);
1524 rb_insert_color(&cic->rb_node, &ioc->cic_root); 1572 rb_insert_color(&cic->rb_node, &ioc->cic_root);
1525 list_add(&cic->queue_list, &cfqd->cic_list); 1573 list_add(&cic->queue_list, &cfqd->cic_list);
1526 read_unlock(&cfq_exit_lock); 1574 spin_unlock(&cfq_exit_lock);
1527} 1575}
1528 1576
1529/* 1577/*
@@ -1622,7 +1670,7 @@ cfq_update_idle_window(struct cfq_data *cfqd, struct cfq_queue *cfqq,
1622{ 1670{
1623 int enable_idle = cfq_cfqq_idle_window(cfqq); 1671 int enable_idle = cfq_cfqq_idle_window(cfqq);
1624 1672
1625 if (!cic->ioc->task || !cfqd->cfq_slice_idle) 1673 if (!cic->ioc->task || !cfqd->cfq_slice_idle || cfqd->hw_tag)
1626 enable_idle = 0; 1674 enable_idle = 0;
1627 else if (sample_valid(cic->ttime_samples)) { 1675 else if (sample_valid(cic->ttime_samples)) {
1628 if (cic->ttime_mean > cfqd->cfq_slice_idle) 1676 if (cic->ttime_mean > cfqd->cfq_slice_idle)
@@ -1713,14 +1761,24 @@ cfq_crq_enqueued(struct cfq_data *cfqd, struct cfq_queue *cfqq,
1713 1761
1714 cfqq->next_crq = cfq_choose_req(cfqd, cfqq->next_crq, crq); 1762 cfqq->next_crq = cfq_choose_req(cfqd, cfqq->next_crq, crq);
1715 1763
1764 cic = crq->io_context;
1765
1716 /* 1766 /*
1717 * we never wait for an async request and we don't allow preemption 1767 * we never wait for an async request and we don't allow preemption
1718 * of an async request. so just return early 1768 * of an async request. so just return early
1719 */ 1769 */
1720 if (!cfq_crq_is_sync(crq)) 1770 if (!cfq_crq_is_sync(crq)) {
1771 /*
1772 * sync process issued an async request, if it's waiting
1773 * then expire it and kick rq handling.
1774 */
1775 if (cic == cfqd->active_cic &&
1776 del_timer(&cfqd->idle_slice_timer)) {
1777 cfq_slice_expired(cfqd, 0);
1778 cfq_start_queueing(cfqd, cfqq);
1779 }
1721 return; 1780 return;
1722 1781 }
1723 cic = crq->io_context;
1724 1782
1725 cfq_update_io_thinktime(cfqd, cic); 1783 cfq_update_io_thinktime(cfqd, cic);
1726 cfq_update_io_seektime(cfqd, cic, crq); 1784 cfq_update_io_seektime(cfqd, cic, crq);
@@ -2138,10 +2196,9 @@ static void cfq_idle_class_timer(unsigned long data)
2138 * race with a non-idle queue, reset timer 2196 * race with a non-idle queue, reset timer
2139 */ 2197 */
2140 end = cfqd->last_end_request + CFQ_IDLE_GRACE; 2198 end = cfqd->last_end_request + CFQ_IDLE_GRACE;
2141 if (!time_after_eq(jiffies, end)) { 2199 if (!time_after_eq(jiffies, end))
2142 cfqd->idle_class_timer.expires = end; 2200 mod_timer(&cfqd->idle_class_timer, end);
2143 add_timer(&cfqd->idle_class_timer); 2201 else
2144 } else
2145 cfq_schedule_dispatch(cfqd); 2202 cfq_schedule_dispatch(cfqd);
2146 2203
2147 spin_unlock_irqrestore(cfqd->queue->queue_lock, flags); 2204 spin_unlock_irqrestore(cfqd->queue->queue_lock, flags);
@@ -2161,7 +2218,7 @@ static void cfq_exit_queue(elevator_t *e)
2161 2218
2162 cfq_shutdown_timer_wq(cfqd); 2219 cfq_shutdown_timer_wq(cfqd);
2163 2220
2164 write_lock(&cfq_exit_lock); 2221 spin_lock(&cfq_exit_lock);
2165 spin_lock_irq(q->queue_lock); 2222 spin_lock_irq(q->queue_lock);
2166 2223
2167 if (cfqd->active_queue) 2224 if (cfqd->active_queue)
@@ -2184,7 +2241,7 @@ static void cfq_exit_queue(elevator_t *e)
2184 } 2241 }
2185 2242
2186 spin_unlock_irq(q->queue_lock); 2243 spin_unlock_irq(q->queue_lock);
2187 write_unlock(&cfq_exit_lock); 2244 spin_unlock(&cfq_exit_lock);
2188 2245
2189 cfq_shutdown_timer_wq(cfqd); 2246 cfq_shutdown_timer_wq(cfqd);
2190 2247
@@ -2194,14 +2251,14 @@ static void cfq_exit_queue(elevator_t *e)
2194 kfree(cfqd); 2251 kfree(cfqd);
2195} 2252}
2196 2253
2197static int cfq_init_queue(request_queue_t *q, elevator_t *e) 2254static void *cfq_init_queue(request_queue_t *q, elevator_t *e)
2198{ 2255{
2199 struct cfq_data *cfqd; 2256 struct cfq_data *cfqd;
2200 int i; 2257 int i;
2201 2258
2202 cfqd = kmalloc(sizeof(*cfqd), GFP_KERNEL); 2259 cfqd = kmalloc(sizeof(*cfqd), GFP_KERNEL);
2203 if (!cfqd) 2260 if (!cfqd)
2204 return -ENOMEM; 2261 return NULL;
2205 2262
2206 memset(cfqd, 0, sizeof(*cfqd)); 2263 memset(cfqd, 0, sizeof(*cfqd));
2207 2264
@@ -2231,8 +2288,6 @@ static int cfq_init_queue(request_queue_t *q, elevator_t *e)
2231 for (i = 0; i < CFQ_QHASH_ENTRIES; i++) 2288 for (i = 0; i < CFQ_QHASH_ENTRIES; i++)
2232 INIT_HLIST_HEAD(&cfqd->cfq_hash[i]); 2289 INIT_HLIST_HEAD(&cfqd->cfq_hash[i]);
2233 2290
2234 e->elevator_data = cfqd;
2235
2236 cfqd->queue = q; 2291 cfqd->queue = q;
2237 2292
2238 cfqd->max_queued = q->nr_requests / 4; 2293 cfqd->max_queued = q->nr_requests / 4;
@@ -2259,14 +2314,14 @@ static int cfq_init_queue(request_queue_t *q, elevator_t *e)
2259 cfqd->cfq_slice_async_rq = cfq_slice_async_rq; 2314 cfqd->cfq_slice_async_rq = cfq_slice_async_rq;
2260 cfqd->cfq_slice_idle = cfq_slice_idle; 2315 cfqd->cfq_slice_idle = cfq_slice_idle;
2261 2316
2262 return 0; 2317 return cfqd;
2263out_crqpool: 2318out_crqpool:
2264 kfree(cfqd->cfq_hash); 2319 kfree(cfqd->cfq_hash);
2265out_cfqhash: 2320out_cfqhash:
2266 kfree(cfqd->crq_hash); 2321 kfree(cfqd->crq_hash);
2267out_crqhash: 2322out_crqhash:
2268 kfree(cfqd); 2323 kfree(cfqd);
2269 return -ENOMEM; 2324 return NULL;
2270} 2325}
2271 2326
2272static void cfq_slab_kill(void) 2327static void cfq_slab_kill(void)
@@ -2439,9 +2494,10 @@ static void __exit cfq_exit(void)
2439 DECLARE_COMPLETION(all_gone); 2494 DECLARE_COMPLETION(all_gone);
2440 elv_unregister(&iosched_cfq); 2495 elv_unregister(&iosched_cfq);
2441 ioc_gone = &all_gone; 2496 ioc_gone = &all_gone;
2442 barrier(); 2497 /* ioc_gone's update must be visible before reading ioc_count */
2498 smp_wmb();
2443 if (atomic_read(&ioc_count)) 2499 if (atomic_read(&ioc_count))
2444 complete(ioc_gone); 2500 wait_for_completion(ioc_gone);
2445 synchronize_rcu(); 2501 synchronize_rcu();
2446 cfq_slab_kill(); 2502 cfq_slab_kill();
2447} 2503}
diff --git a/block/deadline-iosched.c b/block/deadline-iosched.c
index 399fa1e60e1f..3bd0415a9828 100644
--- a/block/deadline-iosched.c
+++ b/block/deadline-iosched.c
@@ -613,24 +613,24 @@ static void deadline_exit_queue(elevator_t *e)
613 * initialize elevator private data (deadline_data), and alloc a drq for 613 * initialize elevator private data (deadline_data), and alloc a drq for
614 * each request on the free lists 614 * each request on the free lists
615 */ 615 */
616static int deadline_init_queue(request_queue_t *q, elevator_t *e) 616static void *deadline_init_queue(request_queue_t *q, elevator_t *e)
617{ 617{
618 struct deadline_data *dd; 618 struct deadline_data *dd;
619 int i; 619 int i;
620 620
621 if (!drq_pool) 621 if (!drq_pool)
622 return -ENOMEM; 622 return NULL;
623 623
624 dd = kmalloc_node(sizeof(*dd), GFP_KERNEL, q->node); 624 dd = kmalloc_node(sizeof(*dd), GFP_KERNEL, q->node);
625 if (!dd) 625 if (!dd)
626 return -ENOMEM; 626 return NULL;
627 memset(dd, 0, sizeof(*dd)); 627 memset(dd, 0, sizeof(*dd));
628 628
629 dd->hash = kmalloc_node(sizeof(struct list_head)*DL_HASH_ENTRIES, 629 dd->hash = kmalloc_node(sizeof(struct list_head)*DL_HASH_ENTRIES,
630 GFP_KERNEL, q->node); 630 GFP_KERNEL, q->node);
631 if (!dd->hash) { 631 if (!dd->hash) {
632 kfree(dd); 632 kfree(dd);
633 return -ENOMEM; 633 return NULL;
634 } 634 }
635 635
636 dd->drq_pool = mempool_create_node(BLKDEV_MIN_RQ, mempool_alloc_slab, 636 dd->drq_pool = mempool_create_node(BLKDEV_MIN_RQ, mempool_alloc_slab,
@@ -638,7 +638,7 @@ static int deadline_init_queue(request_queue_t *q, elevator_t *e)
638 if (!dd->drq_pool) { 638 if (!dd->drq_pool) {
639 kfree(dd->hash); 639 kfree(dd->hash);
640 kfree(dd); 640 kfree(dd);
641 return -ENOMEM; 641 return NULL;
642 } 642 }
643 643
644 for (i = 0; i < DL_HASH_ENTRIES; i++) 644 for (i = 0; i < DL_HASH_ENTRIES; i++)
@@ -653,8 +653,7 @@ static int deadline_init_queue(request_queue_t *q, elevator_t *e)
653 dd->writes_starved = writes_starved; 653 dd->writes_starved = writes_starved;
654 dd->front_merges = 1; 654 dd->front_merges = 1;
655 dd->fifo_batch = fifo_batch; 655 dd->fifo_batch = fifo_batch;
656 e->elevator_data = dd; 656 return dd;
657 return 0;
658} 657}
659 658
660static void deadline_put_request(request_queue_t *q, struct request *rq) 659static void deadline_put_request(request_queue_t *q, struct request *rq)
diff --git a/block/elevator.c b/block/elevator.c
index 0d6be03d929e..a0afdd317cef 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -121,16 +121,16 @@ static struct elevator_type *elevator_get(const char *name)
121 return e; 121 return e;
122} 122}
123 123
124static int elevator_attach(request_queue_t *q, struct elevator_queue *eq) 124static void *elevator_init_queue(request_queue_t *q, struct elevator_queue *eq)
125{ 125{
126 int ret = 0; 126 return eq->ops->elevator_init_fn(q, eq);
127}
127 128
129static void elevator_attach(request_queue_t *q, struct elevator_queue *eq,
130 void *data)
131{
128 q->elevator = eq; 132 q->elevator = eq;
129 133 eq->elevator_data = data;
130 if (eq->ops->elevator_init_fn)
131 ret = eq->ops->elevator_init_fn(q, eq);
132
133 return ret;
134} 134}
135 135
136static char chosen_elevator[16]; 136static char chosen_elevator[16];
@@ -181,6 +181,7 @@ int elevator_init(request_queue_t *q, char *name)
181 struct elevator_type *e = NULL; 181 struct elevator_type *e = NULL;
182 struct elevator_queue *eq; 182 struct elevator_queue *eq;
183 int ret = 0; 183 int ret = 0;
184 void *data;
184 185
185 INIT_LIST_HEAD(&q->queue_head); 186 INIT_LIST_HEAD(&q->queue_head);
186 q->last_merge = NULL; 187 q->last_merge = NULL;
@@ -202,10 +203,13 @@ int elevator_init(request_queue_t *q, char *name)
202 if (!eq) 203 if (!eq)
203 return -ENOMEM; 204 return -ENOMEM;
204 205
205 ret = elevator_attach(q, eq); 206 data = elevator_init_queue(q, eq);
206 if (ret) 207 if (!data) {
207 kobject_put(&eq->kobj); 208 kobject_put(&eq->kobj);
209 return -ENOMEM;
210 }
208 211
212 elevator_attach(q, eq, data);
209 return ret; 213 return ret;
210} 214}
211 215
@@ -333,6 +337,7 @@ void elv_insert(request_queue_t *q, struct request *rq, int where)
333{ 337{
334 struct list_head *pos; 338 struct list_head *pos;
335 unsigned ordseq; 339 unsigned ordseq;
340 int unplug_it = 1;
336 341
337 blk_add_trace_rq(q, rq, BLK_TA_INSERT); 342 blk_add_trace_rq(q, rq, BLK_TA_INSERT);
338 343
@@ -399,6 +404,11 @@ void elv_insert(request_queue_t *q, struct request *rq, int where)
399 } 404 }
400 405
401 list_add_tail(&rq->queuelist, pos); 406 list_add_tail(&rq->queuelist, pos);
407 /*
408 * most requeues happen because of a busy condition, don't
409 * force unplug of the queue for that case.
410 */
411 unplug_it = 0;
402 break; 412 break;
403 413
404 default: 414 default:
@@ -407,7 +417,7 @@ void elv_insert(request_queue_t *q, struct request *rq, int where)
407 BUG(); 417 BUG();
408 } 418 }
409 419
410 if (blk_queue_plugged(q)) { 420 if (unplug_it && blk_queue_plugged(q)) {
411 int nrq = q->rq.count[READ] + q->rq.count[WRITE] 421 int nrq = q->rq.count[READ] + q->rq.count[WRITE]
412 - q->in_flight; 422 - q->in_flight;
413 423
@@ -716,13 +726,16 @@ int elv_register_queue(struct request_queue *q)
716 return error; 726 return error;
717} 727}
718 728
729static void __elv_unregister_queue(elevator_t *e)
730{
731 kobject_uevent(&e->kobj, KOBJ_REMOVE);
732 kobject_del(&e->kobj);
733}
734
719void elv_unregister_queue(struct request_queue *q) 735void elv_unregister_queue(struct request_queue *q)
720{ 736{
721 if (q) { 737 if (q)
722 elevator_t *e = q->elevator; 738 __elv_unregister_queue(q->elevator);
723 kobject_uevent(&e->kobj, KOBJ_REMOVE);
724 kobject_del(&e->kobj);
725 }
726} 739}
727 740
728int elv_register(struct elevator_type *e) 741int elv_register(struct elevator_type *e)
@@ -774,6 +787,7 @@ EXPORT_SYMBOL_GPL(elv_unregister);
774static int elevator_switch(request_queue_t *q, struct elevator_type *new_e) 787static int elevator_switch(request_queue_t *q, struct elevator_type *new_e)
775{ 788{
776 elevator_t *old_elevator, *e; 789 elevator_t *old_elevator, *e;
790 void *data;
777 791
778 /* 792 /*
779 * Allocate new elevator 793 * Allocate new elevator
@@ -782,6 +796,12 @@ static int elevator_switch(request_queue_t *q, struct elevator_type *new_e)
782 if (!e) 796 if (!e)
783 return 0; 797 return 0;
784 798
799 data = elevator_init_queue(q, e);
800 if (!data) {
801 kobject_put(&e->kobj);
802 return 0;
803 }
804
785 /* 805 /*
786 * Turn on BYPASS and drain all requests w/ elevator private data 806 * Turn on BYPASS and drain all requests w/ elevator private data
787 */ 807 */
@@ -800,19 +820,19 @@ static int elevator_switch(request_queue_t *q, struct elevator_type *new_e)
800 elv_drain_elevator(q); 820 elv_drain_elevator(q);
801 } 821 }
802 822
803 spin_unlock_irq(q->queue_lock);
804
805 /* 823 /*
806 * unregister old elevator data 824 * Remember old elevator.
807 */ 825 */
808 elv_unregister_queue(q);
809 old_elevator = q->elevator; 826 old_elevator = q->elevator;
810 827
811 /* 828 /*
812 * attach and start new elevator 829 * attach and start new elevator
813 */ 830 */
814 if (elevator_attach(q, e)) 831 elevator_attach(q, e, data);
815 goto fail; 832
833 spin_unlock_irq(q->queue_lock);
834
835 __elv_unregister_queue(old_elevator);
816 836
817 if (elv_register_queue(q)) 837 if (elv_register_queue(q))
818 goto fail_register; 838 goto fail_register;
@@ -831,7 +851,6 @@ fail_register:
831 */ 851 */
832 elevator_exit(e); 852 elevator_exit(e);
833 e = NULL; 853 e = NULL;
834fail:
835 q->elevator = old_elevator; 854 q->elevator = old_elevator;
836 elv_register_queue(q); 855 elv_register_queue(q);
837 clear_bit(QUEUE_FLAG_ELVSWITCH, &q->queue_flags); 856 clear_bit(QUEUE_FLAG_ELVSWITCH, &q->queue_flags);
@@ -895,10 +914,8 @@ ssize_t elv_iosched_show(request_queue_t *q, char *name)
895EXPORT_SYMBOL(elv_dispatch_sort); 914EXPORT_SYMBOL(elv_dispatch_sort);
896EXPORT_SYMBOL(elv_add_request); 915EXPORT_SYMBOL(elv_add_request);
897EXPORT_SYMBOL(__elv_add_request); 916EXPORT_SYMBOL(__elv_add_request);
898EXPORT_SYMBOL(elv_requeue_request);
899EXPORT_SYMBOL(elv_next_request); 917EXPORT_SYMBOL(elv_next_request);
900EXPORT_SYMBOL(elv_dequeue_request); 918EXPORT_SYMBOL(elv_dequeue_request);
901EXPORT_SYMBOL(elv_queue_empty); 919EXPORT_SYMBOL(elv_queue_empty);
902EXPORT_SYMBOL(elv_completed_request);
903EXPORT_SYMBOL(elevator_exit); 920EXPORT_SYMBOL(elevator_exit);
904EXPORT_SYMBOL(elevator_init); 921EXPORT_SYMBOL(elevator_init);
diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c
index e112d1a5dab6..7eb36c53f4b7 100644
--- a/block/ll_rw_blk.c
+++ b/block/ll_rw_blk.c
@@ -1554,7 +1554,7 @@ void blk_plug_device(request_queue_t *q)
1554 * don't plug a stopped queue, it must be paired with blk_start_queue() 1554 * don't plug a stopped queue, it must be paired with blk_start_queue()
1555 * which will restart the queueing 1555 * which will restart the queueing
1556 */ 1556 */
1557 if (test_bit(QUEUE_FLAG_STOPPED, &q->queue_flags)) 1557 if (blk_queue_stopped(q))
1558 return; 1558 return;
1559 1559
1560 if (!test_and_set_bit(QUEUE_FLAG_PLUGGED, &q->queue_flags)) { 1560 if (!test_and_set_bit(QUEUE_FLAG_PLUGGED, &q->queue_flags)) {
@@ -1587,7 +1587,7 @@ EXPORT_SYMBOL(blk_remove_plug);
1587 */ 1587 */
1588void __generic_unplug_device(request_queue_t *q) 1588void __generic_unplug_device(request_queue_t *q)
1589{ 1589{
1590 if (unlikely(test_bit(QUEUE_FLAG_STOPPED, &q->queue_flags))) 1590 if (unlikely(blk_queue_stopped(q)))
1591 return; 1591 return;
1592 1592
1593 if (!blk_remove_plug(q)) 1593 if (!blk_remove_plug(q))
@@ -1732,8 +1732,21 @@ void blk_run_queue(struct request_queue *q)
1732 1732
1733 spin_lock_irqsave(q->queue_lock, flags); 1733 spin_lock_irqsave(q->queue_lock, flags);
1734 blk_remove_plug(q); 1734 blk_remove_plug(q);
1735 if (!elv_queue_empty(q)) 1735
1736 q->request_fn(q); 1736 /*
1737 * Only recurse once to avoid overrunning the stack, let the unplug
1738 * handling reinvoke the handler shortly if we already got there.
1739 */
1740 if (!elv_queue_empty(q)) {
1741 if (!test_and_set_bit(QUEUE_FLAG_REENTER, &q->queue_flags)) {
1742 q->request_fn(q);
1743 clear_bit(QUEUE_FLAG_REENTER, &q->queue_flags);
1744 } else {
1745 blk_plug_device(q);
1746 kblockd_schedule_work(&q->unplug_work);
1747 }
1748 }
1749
1737 spin_unlock_irqrestore(q->queue_lock, flags); 1750 spin_unlock_irqrestore(q->queue_lock, flags);
1738} 1751}
1739EXPORT_SYMBOL(blk_run_queue); 1752EXPORT_SYMBOL(blk_run_queue);
@@ -3385,7 +3398,7 @@ static int blk_cpu_notify(struct notifier_block *self, unsigned long action,
3385} 3398}
3386 3399
3387 3400
3388static struct notifier_block __devinitdata blk_cpu_notifier = { 3401static struct notifier_block blk_cpu_notifier = {
3389 .notifier_call = blk_cpu_notify, 3402 .notifier_call = blk_cpu_notify,
3390}; 3403};
3391 3404
@@ -3439,7 +3452,12 @@ void end_that_request_last(struct request *req, int uptodate)
3439 if (unlikely(laptop_mode) && blk_fs_request(req)) 3452 if (unlikely(laptop_mode) && blk_fs_request(req))
3440 laptop_io_completion(); 3453 laptop_io_completion();
3441 3454
3442 if (disk && blk_fs_request(req)) { 3455 /*
3456 * Account IO completion. bar_rq isn't accounted as a normal
3457 * IO on queueing nor completion. Accounting the containing
3458 * request is enough.
3459 */
3460 if (disk && blk_fs_request(req) && req != &req->q->bar_rq) {
3443 unsigned long duration = jiffies - req->start_time; 3461 unsigned long duration = jiffies - req->start_time;
3444 const int rw = rq_data_dir(req); 3462 const int rw = rq_data_dir(req);
3445 3463
diff --git a/block/noop-iosched.c b/block/noop-iosched.c
index f370e4a7fe6d..56a7c620574f 100644
--- a/block/noop-iosched.c
+++ b/block/noop-iosched.c
@@ -65,16 +65,15 @@ noop_latter_request(request_queue_t *q, struct request *rq)
65 return list_entry(rq->queuelist.next, struct request, queuelist); 65 return list_entry(rq->queuelist.next, struct request, queuelist);
66} 66}
67 67
68static int noop_init_queue(request_queue_t *q, elevator_t *e) 68static void *noop_init_queue(request_queue_t *q, elevator_t *e)
69{ 69{
70 struct noop_data *nd; 70 struct noop_data *nd;
71 71
72 nd = kmalloc(sizeof(*nd), GFP_KERNEL); 72 nd = kmalloc(sizeof(*nd), GFP_KERNEL);
73 if (!nd) 73 if (!nd)
74 return -ENOMEM; 74 return NULL;
75 INIT_LIST_HEAD(&nd->queue); 75 INIT_LIST_HEAD(&nd->queue);
76 e->elevator_data = nd; 76 return nd;
77 return 0;
78} 77}
79 78
80static void noop_exit_queue(elevator_t *e) 79static void noop_exit_queue(elevator_t *e)
diff --git a/drivers/Kconfig b/drivers/Kconfig
index 5c91d6afb117..aeb5ab2391e4 100644
--- a/drivers/Kconfig
+++ b/drivers/Kconfig
@@ -68,8 +68,6 @@ source "drivers/leds/Kconfig"
68 68
69source "drivers/infiniband/Kconfig" 69source "drivers/infiniband/Kconfig"
70 70
71source "drivers/sn/Kconfig"
72
73source "drivers/edac/Kconfig" 71source "drivers/edac/Kconfig"
74 72
75source "drivers/rtc/Kconfig" 73source "drivers/rtc/Kconfig"
diff --git a/drivers/base/bus.c b/drivers/base/bus.c
index 48718b7f4fa0..76656acd00d4 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -188,6 +188,11 @@ static ssize_t driver_bind(struct device_driver *drv,
188 up(&dev->sem); 188 up(&dev->sem);
189 if (dev->parent) 189 if (dev->parent)
190 up(&dev->parent->sem); 190 up(&dev->parent->sem);
191
192 if (err > 0) /* success */
193 err = count;
194 else if (err == 0) /* driver didn't accept device */
195 err = -ENODEV;
191 } 196 }
192 put_device(dev); 197 put_device(dev);
193 put_bus(bus); 198 put_bus(bus);
diff --git a/drivers/base/class.c b/drivers/base/class.c
index df7fdabd0730..b1ea4df85c7d 100644
--- a/drivers/base/class.c
+++ b/drivers/base/class.c
@@ -456,6 +456,35 @@ static void class_device_remove_attrs(struct class_device * cd)
456 } 456 }
457} 457}
458 458
459static int class_device_add_groups(struct class_device * cd)
460{
461 int i;
462 int error = 0;
463
464 if (cd->groups) {
465 for (i = 0; cd->groups[i]; i++) {
466 error = sysfs_create_group(&cd->kobj, cd->groups[i]);
467 if (error) {
468 while (--i >= 0)
469 sysfs_remove_group(&cd->kobj, cd->groups[i]);
470 goto out;
471 }
472 }
473 }
474out:
475 return error;
476}
477
478static void class_device_remove_groups(struct class_device * cd)
479{
480 int i;
481 if (cd->groups) {
482 for (i = 0; cd->groups[i]; i++) {
483 sysfs_remove_group(&cd->kobj, cd->groups[i]);
484 }
485 }
486}
487
459static ssize_t show_dev(struct class_device *class_dev, char *buf) 488static ssize_t show_dev(struct class_device *class_dev, char *buf)
460{ 489{
461 return print_dev_t(buf, class_dev->devt); 490 return print_dev_t(buf, class_dev->devt);
@@ -559,17 +588,18 @@ int class_device_add(struct class_device *class_dev)
559 class_name); 588 class_name);
560 } 589 }
561 590
591 class_device_add_groups(class_dev);
592
562 kobject_uevent(&class_dev->kobj, KOBJ_ADD); 593 kobject_uevent(&class_dev->kobj, KOBJ_ADD);
563 594
564 /* notify any interfaces this device is now here */ 595 /* notify any interfaces this device is now here */
565 if (parent_class) { 596 down(&parent_class->sem);
566 down(&parent_class->sem); 597 list_add_tail(&class_dev->node, &parent_class->children);
567 list_add_tail(&class_dev->node, &parent_class->children); 598 list_for_each_entry(class_intf, &parent_class->interfaces, node) {
568 list_for_each_entry(class_intf, &parent_class->interfaces, node) 599 if (class_intf->add)
569 if (class_intf->add) 600 class_intf->add(class_dev, class_intf);
570 class_intf->add(class_dev, class_intf);
571 up(&parent_class->sem);
572 } 601 }
602 up(&parent_class->sem);
573 603
574 register_done: 604 register_done:
575 if (error) { 605 if (error) {
@@ -673,6 +703,7 @@ void class_device_del(struct class_device *class_dev)
673 if (class_dev->devt_attr) 703 if (class_dev->devt_attr)
674 class_device_remove_file(class_dev, class_dev->devt_attr); 704 class_device_remove_file(class_dev, class_dev->devt_attr);
675 class_device_remove_attrs(class_dev); 705 class_device_remove_attrs(class_dev);
706 class_device_remove_groups(class_dev);
676 707
677 kobject_uevent(&class_dev->kobj, KOBJ_REMOVE); 708 kobject_uevent(&class_dev->kobj, KOBJ_REMOVE);
678 kobject_del(&class_dev->kobj); 709 kobject_del(&class_dev->kobj);
diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index 730a9ce0a14a..889c71111239 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -209,7 +209,7 @@ static void __device_release_driver(struct device * dev)
209 sysfs_remove_link(&dev->kobj, "driver"); 209 sysfs_remove_link(&dev->kobj, "driver");
210 klist_remove(&dev->knode_driver); 210 klist_remove(&dev->knode_driver);
211 211
212 if (dev->bus->remove) 212 if (dev->bus && dev->bus->remove)
213 dev->bus->remove(dev); 213 dev->bus->remove(dev);
214 else if (drv->remove) 214 else if (drv->remove)
215 drv->remove(dev); 215 drv->remove(dev);
diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index 472318205236..0c99ae6a3407 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -86,18 +86,9 @@ firmware_timeout_store(struct class *class, const char *buf, size_t count)
86static CLASS_ATTR(timeout, 0644, firmware_timeout_show, firmware_timeout_store); 86static CLASS_ATTR(timeout, 0644, firmware_timeout_show, firmware_timeout_store);
87 87
88static void fw_class_dev_release(struct class_device *class_dev); 88static void fw_class_dev_release(struct class_device *class_dev);
89int firmware_class_uevent(struct class_device *dev, char **envp,
90 int num_envp, char *buffer, int buffer_size);
91 89
92static struct class firmware_class = { 90static int firmware_class_uevent(struct class_device *class_dev, char **envp,
93 .name = "firmware", 91 int num_envp, char *buffer, int buffer_size)
94 .uevent = firmware_class_uevent,
95 .release = fw_class_dev_release,
96};
97
98int
99firmware_class_uevent(struct class_device *class_dev, char **envp,
100 int num_envp, char *buffer, int buffer_size)
101{ 92{
102 struct firmware_priv *fw_priv = class_get_devdata(class_dev); 93 struct firmware_priv *fw_priv = class_get_devdata(class_dev);
103 int i = 0, len = 0; 94 int i = 0, len = 0;
@@ -116,6 +107,12 @@ firmware_class_uevent(struct class_device *class_dev, char **envp,
116 return 0; 107 return 0;
117} 108}
118 109
110static struct class firmware_class = {
111 .name = "firmware",
112 .uevent = firmware_class_uevent,
113 .release = fw_class_dev_release,
114};
115
119static ssize_t 116static ssize_t
120firmware_loading_show(struct class_device *class_dev, char *buf) 117firmware_loading_show(struct class_device *class_dev, char *buf)
121{ 118{
@@ -493,25 +490,6 @@ release_firmware(const struct firmware *fw)
493 } 490 }
494} 491}
495 492
496/**
497 * register_firmware: - provide a firmware image for later usage
498 * @name: name of firmware image file
499 * @data: buffer pointer for the firmware image
500 * @size: size of the data buffer area
501 *
502 * Make sure that @data will be available by requesting firmware @name.
503 *
504 * Note: This will not be possible until some kind of persistence
505 * is available.
506 **/
507void
508register_firmware(const char *name, const u8 *data, size_t size)
509{
510 /* This is meaningless without firmware caching, so until we
511 * decide if firmware caching is reasonable just leave it as a
512 * noop */
513}
514
515/* Async support */ 493/* Async support */
516struct firmware_work { 494struct firmware_work {
517 struct work_struct work; 495 struct work_struct work;
@@ -630,4 +608,3 @@ module_exit(firmware_class_exit);
630EXPORT_SYMBOL(release_firmware); 608EXPORT_SYMBOL(release_firmware);
631EXPORT_SYMBOL(request_firmware); 609EXPORT_SYMBOL(request_firmware);
632EXPORT_SYMBOL(request_firmware_nowait); 610EXPORT_SYMBOL(request_firmware_nowait);
633EXPORT_SYMBOL(register_firmware);
diff --git a/drivers/base/power/suspend.c b/drivers/base/power/suspend.c
index bdb60663f2ef..2a769cc6f5f9 100644
--- a/drivers/base/power/suspend.c
+++ b/drivers/base/power/suspend.c
@@ -8,8 +8,9 @@
8 * 8 *
9 */ 9 */
10 10
11#include <linux/vt_kern.h>
12#include <linux/device.h> 11#include <linux/device.h>
12#include <linux/kallsyms.h>
13#include <linux/pm.h>
13#include "../base.h" 14#include "../base.h"
14#include "power.h" 15#include "power.h"
15 16
@@ -58,11 +59,13 @@ int suspend_device(struct device * dev, pm_message_t state)
58 if (dev->bus && dev->bus->suspend && !dev->power.power_state.event) { 59 if (dev->bus && dev->bus->suspend && !dev->power.power_state.event) {
59 dev_dbg(dev, "suspending\n"); 60 dev_dbg(dev, "suspending\n");
60 error = dev->bus->suspend(dev, state); 61 error = dev->bus->suspend(dev, state);
62 suspend_report_result(dev->bus->suspend, error);
61 } 63 }
62 up(&dev->sem); 64 up(&dev->sem);
63 return error; 65 return error;
64} 66}
65 67
68
66/** 69/**
67 * device_suspend - Save state and stop all devices in system. 70 * device_suspend - Save state and stop all devices in system.
68 * @state: Power state to put each device in. 71 * @state: Power state to put each device in.
@@ -82,9 +85,6 @@ int device_suspend(pm_message_t state)
82{ 85{
83 int error = 0; 86 int error = 0;
84 87
85 if (!is_console_suspend_safe())
86 return -EINVAL;
87
88 down(&dpm_sem); 88 down(&dpm_sem);
89 down(&dpm_list_sem); 89 down(&dpm_list_sem);
90 while (!list_empty(&dpm_active) && error == 0) { 90 while (!list_empty(&dpm_active) && error == 0) {
@@ -169,3 +169,12 @@ int device_power_down(pm_message_t state)
169 169
170EXPORT_SYMBOL_GPL(device_power_down); 170EXPORT_SYMBOL_GPL(device_power_down);
171 171
172void __suspend_report_result(const char *function, void *fn, int ret)
173{
174 if (ret) {
175 printk(KERN_ERR "%s(): ", function);
176 print_fn_descriptor_symbol("%s() returns ", (unsigned long)fn);
177 printk("%d\n", ret);
178 }
179}
180EXPORT_SYMBOL_GPL(__suspend_report_result);
diff --git a/drivers/base/topology.c b/drivers/base/topology.c
index 915810f6237e..8c52421cbc54 100644
--- a/drivers/base/topology.c
+++ b/drivers/base/topology.c
@@ -107,7 +107,7 @@ static int __cpuinit topology_remove_dev(struct sys_device * sys_dev)
107 return 0; 107 return 0;
108} 108}
109 109
110static int __cpuinit topology_cpu_callback(struct notifier_block *nfb, 110static int topology_cpu_callback(struct notifier_block *nfb,
111 unsigned long action, void *hcpu) 111 unsigned long action, void *hcpu)
112{ 112{
113 unsigned int cpu = (unsigned long)hcpu; 113 unsigned int cpu = (unsigned long)hcpu;
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 1b0fd31c57c3..1319d8f20640 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -1180,6 +1180,53 @@ static int revalidate_allvol(ctlr_info_t *host)
1180 return 0; 1180 return 0;
1181} 1181}
1182 1182
1183static inline void complete_buffers(struct bio *bio, int status)
1184{
1185 while (bio) {
1186 struct bio *xbh = bio->bi_next;
1187 int nr_sectors = bio_sectors(bio);
1188
1189 bio->bi_next = NULL;
1190 blk_finished_io(len);
1191 bio_endio(bio, nr_sectors << 9, status ? 0 : -EIO);
1192 bio = xbh;
1193 }
1194
1195}
1196
1197static void cciss_softirq_done(struct request *rq)
1198{
1199 CommandList_struct *cmd = rq->completion_data;
1200 ctlr_info_t *h = hba[cmd->ctlr];
1201 unsigned long flags;
1202 u64bit temp64;
1203 int i, ddir;
1204
1205 if (cmd->Request.Type.Direction == XFER_READ)
1206 ddir = PCI_DMA_FROMDEVICE;
1207 else
1208 ddir = PCI_DMA_TODEVICE;
1209
1210 /* command did not need to be retried */
1211 /* unmap the DMA mapping for all the scatter gather elements */
1212 for(i=0; i<cmd->Header.SGList; i++) {
1213 temp64.val32.lower = cmd->SG[i].Addr.lower;
1214 temp64.val32.upper = cmd->SG[i].Addr.upper;
1215 pci_unmap_page(h->pdev, temp64.val, cmd->SG[i].Len, ddir);
1216 }
1217
1218 complete_buffers(rq->bio, rq->errors);
1219
1220#ifdef CCISS_DEBUG
1221 printk("Done with %p\n", rq);
1222#endif /* CCISS_DEBUG */
1223
1224 spin_lock_irqsave(&h->lock, flags);
1225 end_that_request_last(rq, rq->errors);
1226 cmd_free(h, cmd,1);
1227 spin_unlock_irqrestore(&h->lock, flags);
1228}
1229
1183/* This function will check the usage_count of the drive to be updated/added. 1230/* This function will check the usage_count of the drive to be updated/added.
1184 * If the usage_count is zero then the drive information will be updated and 1231 * If the usage_count is zero then the drive information will be updated and
1185 * the disk will be re-registered with the kernel. If not then it will be 1232 * the disk will be re-registered with the kernel. If not then it will be
@@ -1248,6 +1295,8 @@ static void cciss_update_drive_info(int ctlr, int drv_index)
1248 1295
1249 blk_queue_max_sectors(disk->queue, 512); 1296 blk_queue_max_sectors(disk->queue, 512);
1250 1297
1298 blk_queue_softirq_done(disk->queue, cciss_softirq_done);
1299
1251 disk->queue->queuedata = hba[ctlr]; 1300 disk->queue->queuedata = hba[ctlr];
1252 1301
1253 blk_queue_hardsect_size(disk->queue, 1302 blk_queue_hardsect_size(disk->queue,
@@ -2147,20 +2196,6 @@ static void start_io( ctlr_info_t *h)
2147 addQ (&(h->cmpQ), c); 2196 addQ (&(h->cmpQ), c);
2148 } 2197 }
2149} 2198}
2150
2151static inline void complete_buffers(struct bio *bio, int status)
2152{
2153 while (bio) {
2154 struct bio *xbh = bio->bi_next;
2155 int nr_sectors = bio_sectors(bio);
2156
2157 bio->bi_next = NULL;
2158 blk_finished_io(len);
2159 bio_endio(bio, nr_sectors << 9, status ? 0 : -EIO);
2160 bio = xbh;
2161 }
2162
2163}
2164/* Assumes that CCISS_LOCK(h->ctlr) is held. */ 2199/* Assumes that CCISS_LOCK(h->ctlr) is held. */
2165/* Zeros out the error record and then resends the command back */ 2200/* Zeros out the error record and then resends the command back */
2166/* to the controller */ 2201/* to the controller */
@@ -2178,39 +2213,6 @@ static inline void resend_cciss_cmd( ctlr_info_t *h, CommandList_struct *c)
2178 start_io(h); 2213 start_io(h);
2179} 2214}
2180 2215
2181static void cciss_softirq_done(struct request *rq)
2182{
2183 CommandList_struct *cmd = rq->completion_data;
2184 ctlr_info_t *h = hba[cmd->ctlr];
2185 unsigned long flags;
2186 u64bit temp64;
2187 int i, ddir;
2188
2189 if (cmd->Request.Type.Direction == XFER_READ)
2190 ddir = PCI_DMA_FROMDEVICE;
2191 else
2192 ddir = PCI_DMA_TODEVICE;
2193
2194 /* command did not need to be retried */
2195 /* unmap the DMA mapping for all the scatter gather elements */
2196 for(i=0; i<cmd->Header.SGList; i++) {
2197 temp64.val32.lower = cmd->SG[i].Addr.lower;
2198 temp64.val32.upper = cmd->SG[i].Addr.upper;
2199 pci_unmap_page(h->pdev, temp64.val, cmd->SG[i].Len, ddir);
2200 }
2201
2202 complete_buffers(rq->bio, rq->errors);
2203
2204#ifdef CCISS_DEBUG
2205 printk("Done with %p\n", rq);
2206#endif /* CCISS_DEBUG */
2207
2208 spin_lock_irqsave(&h->lock, flags);
2209 end_that_request_last(rq, rq->errors);
2210 cmd_free(h, cmd,1);
2211 spin_unlock_irqrestore(&h->lock, flags);
2212}
2213
2214/* checks the status of the job and calls complete buffers to mark all 2216/* checks the status of the job and calls complete buffers to mark all
2215 * buffers for the completed job. Note that this function does not need 2217 * buffers for the completed job. Note that this function does not need
2216 * to hold the hba/queue lock. 2218 * to hold the hba/queue lock.
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index bedb689b051f..dff1e67b1dd4 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -4301,7 +4301,7 @@ static int __init floppy_init(void)
4301 } 4301 }
4302 4302
4303 use_virtual_dma = can_use_virtual_dma & 1; 4303 use_virtual_dma = can_use_virtual_dma & 1;
4304#if defined(CONFIG_PPC64) 4304#if defined(CONFIG_PPC_MERGE)
4305 if (check_legacy_ioport(FDC1)) { 4305 if (check_legacy_ioport(FDC1)) {
4306 del_timer(&fd_timeout); 4306 del_timer(&fd_timeout);
4307 err = -ENODEV; 4307 err = -ENODEV;
diff --git a/drivers/block/ub.c b/drivers/block/ub.c
index f73446f580df..c688c25992e4 100644
--- a/drivers/block/ub.c
+++ b/drivers/block/ub.c
@@ -536,6 +536,9 @@ static void ub_cleanup(struct ub_dev *sc)
536 kfree(lun); 536 kfree(lun);
537 } 537 }
538 538
539 usb_set_intfdata(sc->intf, NULL);
540 usb_put_intf(sc->intf);
541 usb_put_dev(sc->dev);
539 kfree(sc); 542 kfree(sc);
540} 543}
541 544
@@ -2221,7 +2224,12 @@ static int ub_probe(struct usb_interface *intf,
2221 // sc->ifnum = intf->cur_altsetting->desc.bInterfaceNumber; 2224 // sc->ifnum = intf->cur_altsetting->desc.bInterfaceNumber;
2222 usb_set_intfdata(intf, sc); 2225 usb_set_intfdata(intf, sc);
2223 usb_get_dev(sc->dev); 2226 usb_get_dev(sc->dev);
2224 // usb_get_intf(sc->intf); /* Do we need this? */ 2227 /*
2228 * Since we give the interface struct to the block level through
2229 * disk->driverfs_dev, we have to pin it. Otherwise, block_uevent
2230 * oopses on close after a disconnect (kernels 2.6.16 and up).
2231 */
2232 usb_get_intf(sc->intf);
2225 2233
2226 snprintf(sc->name, 12, DRV_NAME "(%d.%d)", 2234 snprintf(sc->name, 12, DRV_NAME "(%d.%d)",
2227 sc->dev->bus->busnum, sc->dev->devnum); 2235 sc->dev->bus->busnum, sc->dev->devnum);
@@ -2286,7 +2294,7 @@ static int ub_probe(struct usb_interface *intf,
2286 2294
2287err_dev_desc: 2295err_dev_desc:
2288 usb_set_intfdata(intf, NULL); 2296 usb_set_intfdata(intf, NULL);
2289 // usb_put_intf(sc->intf); 2297 usb_put_intf(sc->intf);
2290 usb_put_dev(sc->dev); 2298 usb_put_dev(sc->dev);
2291 kfree(sc); 2299 kfree(sc);
2292err_core: 2300err_core:
@@ -2461,12 +2469,6 @@ static void ub_disconnect(struct usb_interface *intf)
2461 * and no URBs left in transit. 2469 * and no URBs left in transit.
2462 */ 2470 */
2463 2471
2464 usb_set_intfdata(intf, NULL);
2465 // usb_put_intf(sc->intf);
2466 sc->intf = NULL;
2467 usb_put_dev(sc->dev);
2468 sc->dev = NULL;
2469
2470 ub_put(sc); 2472 ub_put(sc);
2471} 2473}
2472 2474
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
index 402296670d3a..78d928f9d9f1 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -291,7 +291,7 @@ config SX
291 291
292config RIO 292config RIO
293 tristate "Specialix RIO system support" 293 tristate "Specialix RIO system support"
294 depends on SERIAL_NONSTANDARD && !64BIT 294 depends on SERIAL_NONSTANDARD
295 help 295 help
296 This is a driver for the Specialix RIO, a smart serial card which 296 This is a driver for the Specialix RIO, a smart serial card which
297 drives an outboard box that can support up to 128 ports. Product 297 drives an outboard box that can support up to 128 ports. Product
diff --git a/drivers/char/agp/Kconfig b/drivers/char/agp/Kconfig
index 0b9cf9c59a21..7c88c060a9e6 100644
--- a/drivers/char/agp/Kconfig
+++ b/drivers/char/agp/Kconfig
@@ -86,7 +86,7 @@ config AGP_NVIDIA
86 86
87config AGP_SIS 87config AGP_SIS
88 tristate "SiS chipset support" 88 tristate "SiS chipset support"
89 depends on AGP && X86_32 89 depends on AGP
90 help 90 help
91 This option gives you AGP support for the GLX component of 91 This option gives you AGP support for the GLX component of
92 X on Silicon Integrated Systems [SiS] chipsets. 92 X on Silicon Integrated Systems [SiS] chipsets.
diff --git a/drivers/char/agp/amd64-agp.c b/drivers/char/agp/amd64-agp.c
index 36517d4d1ad9..ac3c33a2e37d 100644
--- a/drivers/char/agp/amd64-agp.c
+++ b/drivers/char/agp/amd64-agp.c
@@ -617,6 +617,9 @@ static int agp_amd64_resume(struct pci_dev *pdev)
617 pci_set_power_state(pdev, PCI_D0); 617 pci_set_power_state(pdev, PCI_D0);
618 pci_restore_state(pdev); 618 pci_restore_state(pdev);
619 619
620 if (pdev->vendor == PCI_VENDOR_ID_NVIDIA)
621 nforce3_agp_init(pdev);
622
620 return amd_8151_configure(); 623 return amd_8151_configure();
621} 624}
622 625
diff --git a/drivers/char/agp/efficeon-agp.c b/drivers/char/agp/efficeon-agp.c
index fed0a87448d8..86a966b65236 100644
--- a/drivers/char/agp/efficeon-agp.c
+++ b/drivers/char/agp/efficeon-agp.c
@@ -64,6 +64,12 @@ static struct gatt_mask efficeon_generic_masks[] =
64 {.mask = 0x00000001, .type = 0} 64 {.mask = 0x00000001, .type = 0}
65}; 65};
66 66
67/* This function does the same thing as mask_memory() for this chipset... */
68static inline unsigned long efficeon_mask_memory(unsigned long addr)
69{
70 return addr | 0x00000001;
71}
72
67static struct aper_size_info_lvl2 efficeon_generic_sizes[4] = 73static struct aper_size_info_lvl2 efficeon_generic_sizes[4] =
68{ 74{
69 {256, 65536, 0}, 75 {256, 65536, 0},
@@ -251,7 +257,7 @@ static int efficeon_insert_memory(struct agp_memory * mem, off_t pg_start, int t
251 last_page = NULL; 257 last_page = NULL;
252 for (i = 0; i < count; i++) { 258 for (i = 0; i < count; i++) {
253 int index = pg_start + i; 259 int index = pg_start + i;
254 unsigned long insert = mem->memory[i]; 260 unsigned long insert = efficeon_mask_memory(mem->memory[i]);
255 261
256 page = (unsigned int *) efficeon_private.l1_table[index >> 10]; 262 page = (unsigned int *) efficeon_private.l1_table[index >> 10];
257 263
diff --git a/drivers/char/agp/via-agp.c b/drivers/char/agp/via-agp.c
index 97b0a890ba7f..b8ec25d17478 100644
--- a/drivers/char/agp/via-agp.c
+++ b/drivers/char/agp/via-agp.c
@@ -345,6 +345,12 @@ static struct agp_device_ids via_agp_device_ids[] __devinitdata =
345 .chipset_name = "PT880", 345 .chipset_name = "PT880",
346 }, 346 },
347 347
348 /* PT880 Ultra */
349 {
350 .device_id = PCI_DEVICE_ID_VIA_PT880ULTRA,
351 .chipset_name = "PT880 Ultra",
352 },
353
348 /* PT890 */ 354 /* PT890 */
349 { 355 {
350 .device_id = PCI_DEVICE_ID_VIA_8783_0, 356 .device_id = PCI_DEVICE_ID_VIA_8783_0,
@@ -511,6 +517,7 @@ static struct pci_device_id agp_via_pci_table[] = {
511 ID(PCI_DEVICE_ID_VIA_8763_0), 517 ID(PCI_DEVICE_ID_VIA_8763_0),
512 ID(PCI_DEVICE_ID_VIA_8378_0), 518 ID(PCI_DEVICE_ID_VIA_8378_0),
513 ID(PCI_DEVICE_ID_VIA_PT880), 519 ID(PCI_DEVICE_ID_VIA_PT880),
520 ID(PCI_DEVICE_ID_VIA_PT880ULTRA),
514 ID(PCI_DEVICE_ID_VIA_8783_0), 521 ID(PCI_DEVICE_ID_VIA_8783_0),
515 ID(PCI_DEVICE_ID_VIA_PX8X0_0), 522 ID(PCI_DEVICE_ID_VIA_PX8X0_0),
516 ID(PCI_DEVICE_ID_VIA_3269_0), 523 ID(PCI_DEVICE_ID_VIA_3269_0),
diff --git a/drivers/char/cs5535_gpio.c b/drivers/char/cs5535_gpio.c
index 5d72f50de1ac..46d66037b917 100644
--- a/drivers/char/cs5535_gpio.c
+++ b/drivers/char/cs5535_gpio.c
@@ -241,9 +241,10 @@ static int __init cs5535_gpio_init(void)
241static void __exit cs5535_gpio_cleanup(void) 241static void __exit cs5535_gpio_cleanup(void)
242{ 242{
243 dev_t dev_id = MKDEV(major, 0); 243 dev_t dev_id = MKDEV(major, 0);
244
245 cdev_del(&cs5535_gpio_cdev);
244 unregister_chrdev_region(dev_id, CS5535_GPIO_COUNT); 246 unregister_chrdev_region(dev_id, CS5535_GPIO_COUNT);
245 if (gpio_base != 0) 247 release_region(gpio_base, CS5535_GPIO_SIZE);
246 release_region(gpio_base, CS5535_GPIO_SIZE);
247} 248}
248 249
249module_init(cs5535_gpio_init); 250module_init(cs5535_gpio_init);
diff --git a/drivers/char/drm/drmP.h b/drivers/char/drm/drmP.h
index edc72a6348a7..cb76e5ca9a23 100644
--- a/drivers/char/drm/drmP.h
+++ b/drivers/char/drm/drmP.h
@@ -815,8 +815,6 @@ extern int drm_mem_info(char *buf, char **start, off_t offset,
815extern void *drm_realloc(void *oldpt, size_t oldsize, size_t size, int area); 815extern void *drm_realloc(void *oldpt, size_t oldsize, size_t size, int area);
816extern void *drm_ioremap(unsigned long offset, unsigned long size, 816extern void *drm_ioremap(unsigned long offset, unsigned long size,
817 drm_device_t * dev); 817 drm_device_t * dev);
818extern void *drm_ioremap_nocache(unsigned long offset, unsigned long size,
819 drm_device_t * dev);
820extern void drm_ioremapfree(void *pt, unsigned long size, drm_device_t * dev); 818extern void drm_ioremapfree(void *pt, unsigned long size, drm_device_t * dev);
821 819
822extern DRM_AGP_MEM *drm_alloc_agp(drm_device_t * dev, int pages, u32 type); 820extern DRM_AGP_MEM *drm_alloc_agp(drm_device_t * dev, int pages, u32 type);
@@ -891,7 +889,6 @@ extern int drm_lock_free(drm_device_t * dev,
891 /* Buffer management support (drm_bufs.h) */ 889 /* Buffer management support (drm_bufs.h) */
892extern int drm_addbufs_agp(drm_device_t * dev, drm_buf_desc_t * request); 890extern int drm_addbufs_agp(drm_device_t * dev, drm_buf_desc_t * request);
893extern int drm_addbufs_pci(drm_device_t * dev, drm_buf_desc_t * request); 891extern int drm_addbufs_pci(drm_device_t * dev, drm_buf_desc_t * request);
894extern int drm_addbufs_fb(drm_device_t *dev, drm_buf_desc_t *request);
895extern int drm_addmap(drm_device_t * dev, unsigned int offset, 892extern int drm_addmap(drm_device_t * dev, unsigned int offset,
896 unsigned int size, drm_map_type_t type, 893 unsigned int size, drm_map_type_t type,
897 drm_map_flags_t flags, drm_local_map_t ** map_ptr); 894 drm_map_flags_t flags, drm_local_map_t ** map_ptr);
@@ -1022,11 +1019,13 @@ static __inline__ void drm_core_ioremap(struct drm_map *map,
1022 map->handle = drm_ioremap(map->offset, map->size, dev); 1019 map->handle = drm_ioremap(map->offset, map->size, dev);
1023} 1020}
1024 1021
1022#if 0
1025static __inline__ void drm_core_ioremap_nocache(struct drm_map *map, 1023static __inline__ void drm_core_ioremap_nocache(struct drm_map *map,
1026 struct drm_device *dev) 1024 struct drm_device *dev)
1027{ 1025{
1028 map->handle = drm_ioremap_nocache(map->offset, map->size, dev); 1026 map->handle = drm_ioremap_nocache(map->offset, map->size, dev);
1029} 1027}
1028#endif /* 0 */
1030 1029
1031static __inline__ void drm_core_ioremapfree(struct drm_map *map, 1030static __inline__ void drm_core_ioremapfree(struct drm_map *map,
1032 struct drm_device *dev) 1031 struct drm_device *dev)
diff --git a/drivers/char/drm/drm_agpsupport.c b/drivers/char/drm/drm_agpsupport.c
index fabc930c67a2..40bfd9b01e39 100644
--- a/drivers/char/drm/drm_agpsupport.c
+++ b/drivers/char/drm/drm_agpsupport.c
@@ -503,8 +503,6 @@ int drm_agp_bind_memory(DRM_AGP_MEM * handle, off_t start)
503 return agp_bind_memory(handle, start); 503 return agp_bind_memory(handle, start);
504} 504}
505 505
506EXPORT_SYMBOL(drm_agp_bind_memory);
507
508/** Calls agp_unbind_memory() */ 506/** Calls agp_unbind_memory() */
509int drm_agp_unbind_memory(DRM_AGP_MEM * handle) 507int drm_agp_unbind_memory(DRM_AGP_MEM * handle)
510{ 508{
diff --git a/drivers/char/drm/drm_bufs.c b/drivers/char/drm/drm_bufs.c
index 8a9cf12e6183..006b06d29727 100644
--- a/drivers/char/drm/drm_bufs.c
+++ b/drivers/char/drm/drm_bufs.c
@@ -386,7 +386,6 @@ int drm_rmmap_locked(drm_device_t *dev, drm_local_map_t *map)
386 386
387 return 0; 387 return 0;
388} 388}
389EXPORT_SYMBOL(drm_rmmap_locked);
390 389
391int drm_rmmap(drm_device_t *dev, drm_local_map_t *map) 390int drm_rmmap(drm_device_t *dev, drm_local_map_t *map)
392{ 391{
@@ -398,7 +397,6 @@ int drm_rmmap(drm_device_t *dev, drm_local_map_t *map)
398 397
399 return ret; 398 return ret;
400} 399}
401EXPORT_SYMBOL(drm_rmmap);
402 400
403/* The rmmap ioctl appears to be unnecessary. All mappings are torn down on 401/* The rmmap ioctl appears to be unnecessary. All mappings are torn down on
404 * the last close of the device, and this is necessary for cleanup when things 402 * the last close of the device, and this is necessary for cleanup when things
@@ -1053,7 +1051,7 @@ static int drm_addbufs_sg(drm_device_t * dev, drm_buf_desc_t * request)
1053 return 0; 1051 return 0;
1054} 1052}
1055 1053
1056int drm_addbufs_fb(drm_device_t * dev, drm_buf_desc_t * request) 1054static int drm_addbufs_fb(drm_device_t * dev, drm_buf_desc_t * request)
1057{ 1055{
1058 drm_device_dma_t *dma = dev->dma; 1056 drm_device_dma_t *dma = dev->dma;
1059 drm_buf_entry_t *entry; 1057 drm_buf_entry_t *entry;
@@ -1212,7 +1210,6 @@ int drm_addbufs_fb(drm_device_t * dev, drm_buf_desc_t * request)
1212 atomic_dec(&dev->buf_alloc); 1210 atomic_dec(&dev->buf_alloc);
1213 return 0; 1211 return 0;
1214} 1212}
1215EXPORT_SYMBOL(drm_addbufs_fb);
1216 1213
1217 1214
1218/** 1215/**
diff --git a/drivers/char/drm/drm_drv.c b/drivers/char/drm/drm_drv.c
index dc6bbe8a18dc..3c0b882a8e72 100644
--- a/drivers/char/drm/drm_drv.c
+++ b/drivers/char/drm/drm_drv.c
@@ -75,8 +75,8 @@ static drm_ioctl_desc_t drm_ioctls[] = {
75 [DRM_IOCTL_NR(DRM_IOCTL_SET_SAREA_CTX)] = {drm_setsareactx, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY}, 75 [DRM_IOCTL_NR(DRM_IOCTL_SET_SAREA_CTX)] = {drm_setsareactx, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY},
76 [DRM_IOCTL_NR(DRM_IOCTL_GET_SAREA_CTX)] = {drm_getsareactx, DRM_AUTH}, 76 [DRM_IOCTL_NR(DRM_IOCTL_GET_SAREA_CTX)] = {drm_getsareactx, DRM_AUTH},
77 77
78 [DRM_IOCTL_NR(DRM_IOCTL_ADD_CTX)] = {drm_addctx, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY}, 78 [DRM_IOCTL_NR(DRM_IOCTL_ADD_CTX)] = {drm_addctx, DRM_AUTH|DRM_ROOT_ONLY},
79 [DRM_IOCTL_NR(DRM_IOCTL_RM_CTX)] = {drm_rmctx, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY}, 79 [DRM_IOCTL_NR(DRM_IOCTL_RM_CTX)] = {drm_rmctx, DRM_AUTH|DRM_ROOT_ONLY},
80 [DRM_IOCTL_NR(DRM_IOCTL_MOD_CTX)] = {drm_modctx, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY}, 80 [DRM_IOCTL_NR(DRM_IOCTL_MOD_CTX)] = {drm_modctx, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY},
81 [DRM_IOCTL_NR(DRM_IOCTL_GET_CTX)] = {drm_getctx, DRM_AUTH}, 81 [DRM_IOCTL_NR(DRM_IOCTL_GET_CTX)] = {drm_getctx, DRM_AUTH},
82 [DRM_IOCTL_NR(DRM_IOCTL_SWITCH_CTX)] = {drm_switchctx, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY}, 82 [DRM_IOCTL_NR(DRM_IOCTL_SWITCH_CTX)] = {drm_switchctx, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY},
diff --git a/drivers/char/drm/drm_memory.c b/drivers/char/drm/drm_memory.c
index dddf8de66143..7e3318e1d1c6 100644
--- a/drivers/char/drm/drm_memory.c
+++ b/drivers/char/drm/drm_memory.c
@@ -80,6 +80,71 @@ void *drm_realloc(void *oldpt, size_t oldsize, size_t size, int area)
80} 80}
81 81
82#if __OS_HAS_AGP 82#if __OS_HAS_AGP
83/*
84 * Find the drm_map that covers the range [offset, offset+size).
85 */
86static drm_map_t *drm_lookup_map(unsigned long offset,
87 unsigned long size, drm_device_t * dev)
88{
89 struct list_head *list;
90 drm_map_list_t *r_list;
91 drm_map_t *map;
92
93 list_for_each(list, &dev->maplist->head) {
94 r_list = (drm_map_list_t *) list;
95 map = r_list->map;
96 if (!map)
97 continue;
98 if (map->offset <= offset
99 && (offset + size) <= (map->offset + map->size))
100 return map;
101 }
102 return NULL;
103}
104
105static void *agp_remap(unsigned long offset, unsigned long size,
106 drm_device_t * dev)
107{
108 unsigned long *phys_addr_map, i, num_pages =
109 PAGE_ALIGN(size) / PAGE_SIZE;
110 struct drm_agp_mem *agpmem;
111 struct page **page_map;
112 void *addr;
113
114 size = PAGE_ALIGN(size);
115
116#ifdef __alpha__
117 offset -= dev->hose->mem_space->start;
118#endif
119
120 for (agpmem = dev->agp->memory; agpmem; agpmem = agpmem->next)
121 if (agpmem->bound <= offset
122 && (agpmem->bound + (agpmem->pages << PAGE_SHIFT)) >=
123 (offset + size))
124 break;
125 if (!agpmem)
126 return NULL;
127
128 /*
129 * OK, we're mapping AGP space on a chipset/platform on which memory accesses by
130 * the CPU do not get remapped by the GART. We fix this by using the kernel's
131 * page-table instead (that's probably faster anyhow...).
132 */
133 /* note: use vmalloc() because num_pages could be large... */
134 page_map = vmalloc(num_pages * sizeof(struct page *));
135 if (!page_map)
136 return NULL;
137
138 phys_addr_map =
139 agpmem->memory->memory + (offset - agpmem->bound) / PAGE_SIZE;
140 for (i = 0; i < num_pages; ++i)
141 page_map[i] = pfn_to_page(phys_addr_map[i] >> PAGE_SHIFT);
142 addr = vmap(page_map, num_pages, VM_IOREMAP, PAGE_AGP);
143 vfree(page_map);
144
145 return addr;
146}
147
83/** Wrapper around agp_allocate_memory() */ 148/** Wrapper around agp_allocate_memory() */
84DRM_AGP_MEM *drm_alloc_agp(drm_device_t * dev, int pages, u32 type) 149DRM_AGP_MEM *drm_alloc_agp(drm_device_t * dev, int pages, u32 type)
85{ 150{
@@ -103,5 +168,74 @@ int drm_unbind_agp(DRM_AGP_MEM * handle)
103{ 168{
104 return drm_agp_unbind_memory(handle); 169 return drm_agp_unbind_memory(handle);
105} 170}
171
172#else /* __OS_HAS_AGP */
173
174static inline drm_map_t *drm_lookup_map(unsigned long offset,
175 unsigned long size, drm_device_t * dev)
176{
177 return NULL;
178}
179
180static inline void *agp_remap(unsigned long offset, unsigned long size,
181 drm_device_t * dev)
182{
183 return NULL;
184}
185
106#endif /* agp */ 186#endif /* agp */
187
188void *drm_ioremap(unsigned long offset, unsigned long size,
189 drm_device_t * dev)
190{
191 if (drm_core_has_AGP(dev) && dev->agp && dev->agp->cant_use_aperture) {
192 drm_map_t *map = drm_lookup_map(offset, size, dev);
193
194 if (map && map->type == _DRM_AGP)
195 return agp_remap(offset, size, dev);
196 }
197 return ioremap(offset, size);
198}
199EXPORT_SYMBOL(drm_ioremap);
200
201#if 0
202void *drm_ioremap_nocache(unsigned long offset,
203 unsigned long size, drm_device_t * dev)
204{
205 if (drm_core_has_AGP(dev) && dev->agp && dev->agp->cant_use_aperture) {
206 drm_map_t *map = drm_lookup_map(offset, size, dev);
207
208 if (map && map->type == _DRM_AGP)
209 return agp_remap(offset, size, dev);
210 }
211 return ioremap_nocache(offset, size);
212}
213#endif /* 0 */
214
215void drm_ioremapfree(void *pt, unsigned long size,
216 drm_device_t * dev)
217{
218 /*
219 * This is a bit ugly. It would be much cleaner if the DRM API would use separate
220 * routines for handling mappings in the AGP space. Hopefully this can be done in
221 * a future revision of the interface...
222 */
223 if (drm_core_has_AGP(dev) && dev->agp && dev->agp->cant_use_aperture
224 && ((unsigned long)pt >= VMALLOC_START
225 && (unsigned long)pt < VMALLOC_END)) {
226 unsigned long offset;
227 drm_map_t *map;
228
229 offset = drm_follow_page(pt) | ((unsigned long)pt & ~PAGE_MASK);
230 map = drm_lookup_map(offset, size, dev);
231 if (map && map->type == _DRM_AGP) {
232 vunmap(pt);
233 return;
234 }
235 }
236
237 iounmap(pt);
238}
239EXPORT_SYMBOL(drm_ioremapfree);
240
107#endif /* debug_memory */ 241#endif /* debug_memory */
diff --git a/drivers/char/drm/drm_memory.h b/drivers/char/drm/drm_memory.h
index 3732a61c3762..714d9aedcff5 100644
--- a/drivers/char/drm/drm_memory.h
+++ b/drivers/char/drm/drm_memory.h
@@ -57,71 +57,6 @@
57# endif 57# endif
58#endif 58#endif
59 59
60/*
61 * Find the drm_map that covers the range [offset, offset+size).
62 */
63static inline drm_map_t *drm_lookup_map(unsigned long offset,
64 unsigned long size, drm_device_t * dev)
65{
66 struct list_head *list;
67 drm_map_list_t *r_list;
68 drm_map_t *map;
69
70 list_for_each(list, &dev->maplist->head) {
71 r_list = (drm_map_list_t *) list;
72 map = r_list->map;
73 if (!map)
74 continue;
75 if (map->offset <= offset
76 && (offset + size) <= (map->offset + map->size))
77 return map;
78 }
79 return NULL;
80}
81
82static inline void *agp_remap(unsigned long offset, unsigned long size,
83 drm_device_t * dev)
84{
85 unsigned long *phys_addr_map, i, num_pages =
86 PAGE_ALIGN(size) / PAGE_SIZE;
87 struct drm_agp_mem *agpmem;
88 struct page **page_map;
89 void *addr;
90
91 size = PAGE_ALIGN(size);
92
93#ifdef __alpha__
94 offset -= dev->hose->mem_space->start;
95#endif
96
97 for (agpmem = dev->agp->memory; agpmem; agpmem = agpmem->next)
98 if (agpmem->bound <= offset
99 && (agpmem->bound + (agpmem->pages << PAGE_SHIFT)) >=
100 (offset + size))
101 break;
102 if (!agpmem)
103 return NULL;
104
105 /*
106 * OK, we're mapping AGP space on a chipset/platform on which memory accesses by
107 * the CPU do not get remapped by the GART. We fix this by using the kernel's
108 * page-table instead (that's probably faster anyhow...).
109 */
110 /* note: use vmalloc() because num_pages could be large... */
111 page_map = vmalloc(num_pages * sizeof(struct page *));
112 if (!page_map)
113 return NULL;
114
115 phys_addr_map =
116 agpmem->memory->memory + (offset - agpmem->bound) / PAGE_SIZE;
117 for (i = 0; i < num_pages; ++i)
118 page_map[i] = pfn_to_page(phys_addr_map[i] >> PAGE_SHIFT);
119 addr = vmap(page_map, num_pages, VM_IOREMAP, PAGE_AGP);
120 vfree(page_map);
121
122 return addr;
123}
124
125static inline unsigned long drm_follow_page(void *vaddr) 60static inline unsigned long drm_follow_page(void *vaddr)
126{ 61{
127 pgd_t *pgd = pgd_offset_k((unsigned long)vaddr); 62 pgd_t *pgd = pgd_offset_k((unsigned long)vaddr);
@@ -133,18 +68,6 @@ static inline unsigned long drm_follow_page(void *vaddr)
133 68
134#else /* __OS_HAS_AGP */ 69#else /* __OS_HAS_AGP */
135 70
136static inline drm_map_t *drm_lookup_map(unsigned long offset,
137 unsigned long size, drm_device_t * dev)
138{
139 return NULL;
140}
141
142static inline void *agp_remap(unsigned long offset, unsigned long size,
143 drm_device_t * dev)
144{
145 return NULL;
146}
147
148static inline unsigned long drm_follow_page(void *vaddr) 71static inline unsigned long drm_follow_page(void *vaddr)
149{ 72{
150 return 0; 73 return 0;
@@ -152,51 +75,8 @@ static inline unsigned long drm_follow_page(void *vaddr)
152 75
153#endif 76#endif
154 77
155static inline void *drm_ioremap(unsigned long offset, unsigned long size, 78void *drm_ioremap(unsigned long offset, unsigned long size,
156 drm_device_t * dev) 79 drm_device_t * dev);
157{
158 if (drm_core_has_AGP(dev) && dev->agp && dev->agp->cant_use_aperture) {
159 drm_map_t *map = drm_lookup_map(offset, size, dev);
160
161 if (map && map->type == _DRM_AGP)
162 return agp_remap(offset, size, dev);
163 }
164 return ioremap(offset, size);
165}
166
167static inline void *drm_ioremap_nocache(unsigned long offset,
168 unsigned long size, drm_device_t * dev)
169{
170 if (drm_core_has_AGP(dev) && dev->agp && dev->agp->cant_use_aperture) {
171 drm_map_t *map = drm_lookup_map(offset, size, dev);
172
173 if (map && map->type == _DRM_AGP)
174 return agp_remap(offset, size, dev);
175 }
176 return ioremap_nocache(offset, size);
177}
178
179static inline void drm_ioremapfree(void *pt, unsigned long size,
180 drm_device_t * dev)
181{
182 /*
183 * This is a bit ugly. It would be much cleaner if the DRM API would use separate
184 * routines for handling mappings in the AGP space. Hopefully this can be done in
185 * a future revision of the interface...
186 */
187 if (drm_core_has_AGP(dev) && dev->agp && dev->agp->cant_use_aperture
188 && ((unsigned long)pt >= VMALLOC_START
189 && (unsigned long)pt < VMALLOC_END)) {
190 unsigned long offset;
191 drm_map_t *map;
192
193 offset = drm_follow_page(pt) | ((unsigned long)pt & ~PAGE_MASK);
194 map = drm_lookup_map(offset, size, dev);
195 if (map && map->type == _DRM_AGP) {
196 vunmap(pt);
197 return;
198 }
199 }
200 80
201 iounmap(pt); 81void drm_ioremapfree(void *pt, unsigned long size,
202} 82 drm_device_t * dev);
diff --git a/drivers/char/drm/drm_memory_debug.h b/drivers/char/drm/drm_memory_debug.h
index 7868341817da..6543b9a14c42 100644
--- a/drivers/char/drm/drm_memory_debug.h
+++ b/drivers/char/drm/drm_memory_debug.h
@@ -229,6 +229,7 @@ void *drm_ioremap (unsigned long offset, unsigned long size,
229 return pt; 229 return pt;
230} 230}
231 231
232#if 0
232void *drm_ioremap_nocache (unsigned long offset, unsigned long size, 233void *drm_ioremap_nocache (unsigned long offset, unsigned long size,
233 drm_device_t * dev) { 234 drm_device_t * dev) {
234 void *pt; 235 void *pt;
@@ -251,6 +252,7 @@ void *drm_ioremap_nocache (unsigned long offset, unsigned long size,
251 spin_unlock(&drm_mem_lock); 252 spin_unlock(&drm_mem_lock);
252 return pt; 253 return pt;
253} 254}
255#endif /* 0 */
254 256
255void drm_ioremapfree (void *pt, unsigned long size, drm_device_t * dev) { 257void drm_ioremapfree (void *pt, unsigned long size, drm_device_t * dev) {
256 int alloc_count; 258 int alloc_count;
diff --git a/drivers/char/drm/drm_pci.c b/drivers/char/drm/drm_pci.c
index b28ca9cea8a2..86a0f1c22091 100644
--- a/drivers/char/drm/drm_pci.c
+++ b/drivers/char/drm/drm_pci.c
@@ -37,6 +37,7 @@
37 */ 37 */
38 38
39#include <linux/pci.h> 39#include <linux/pci.h>
40#include <linux/dma-mapping.h>
40#include "drmP.h" 41#include "drmP.h"
41 42
42/**********************************************************************/ 43/**********************************************************************/
diff --git a/drivers/char/drm/drm_stub.c b/drivers/char/drm/drm_stub.c
index 68073e14fdec..9a842a36bb27 100644
--- a/drivers/char/drm/drm_stub.c
+++ b/drivers/char/drm/drm_stub.c
@@ -229,8 +229,6 @@ int drm_get_dev(struct pci_dev *pdev, const struct pci_device_id *ent,
229 return ret; 229 return ret;
230} 230}
231 231
232EXPORT_SYMBOL(drm_get_dev);
233
234/** 232/**
235 * Put a device minor number. 233 * Put a device minor number.
236 * 234 *
diff --git a/drivers/char/drm/r300_cmdbuf.c b/drivers/char/drm/r300_cmdbuf.c
index b108c7f913b2..26bdf2ca59d7 100644
--- a/drivers/char/drm/r300_cmdbuf.c
+++ b/drivers/char/drm/r300_cmdbuf.c
@@ -723,7 +723,7 @@ static int r300_scratch(drm_radeon_private_t *dev_priv,
723 723
724 dev_priv->scratch_ages[header.scratch.reg]++; 724 dev_priv->scratch_ages[header.scratch.reg]++;
725 725
726 ref_age_base = *(u32 **)cmdbuf->buf; 726 ref_age_base = (u32 *)(unsigned long)*((uint64_t *)cmdbuf->buf);
727 727
728 cmdbuf->buf += sizeof(u64); 728 cmdbuf->buf += sizeof(u64);
729 cmdbuf->bufsz -= sizeof(u64); 729 cmdbuf->bufsz -= sizeof(u64);
diff --git a/drivers/char/drm/via_irq.c b/drivers/char/drm/via_irq.c
index 6152415644e9..c33d068cde19 100644
--- a/drivers/char/drm/via_irq.c
+++ b/drivers/char/drm/via_irq.c
@@ -196,9 +196,9 @@ via_driver_irq_wait(drm_device_t * dev, unsigned int irq, int force_sequence,
196{ 196{
197 drm_via_private_t *dev_priv = (drm_via_private_t *) dev->dev_private; 197 drm_via_private_t *dev_priv = (drm_via_private_t *) dev->dev_private;
198 unsigned int cur_irq_sequence; 198 unsigned int cur_irq_sequence;
199 drm_via_irq_t *cur_irq = dev_priv->via_irqs; 199 drm_via_irq_t *cur_irq;
200 int ret = 0; 200 int ret = 0;
201 maskarray_t *masks = dev_priv->irq_masks; 201 maskarray_t *masks;
202 int real_irq; 202 int real_irq;
203 203
204 DRM_DEBUG("%s\n", __FUNCTION__); 204 DRM_DEBUG("%s\n", __FUNCTION__);
@@ -221,8 +221,9 @@ via_driver_irq_wait(drm_device_t * dev, unsigned int irq, int force_sequence,
221 __FUNCTION__, irq); 221 __FUNCTION__, irq);
222 return DRM_ERR(EINVAL); 222 return DRM_ERR(EINVAL);
223 } 223 }
224 224
225 cur_irq += real_irq; 225 masks = dev_priv->irq_masks;
226 cur_irq = dev_priv->via_irqs + real_irq;
226 227
227 if (masks[real_irq][2] && !force_sequence) { 228 if (masks[real_irq][2] && !force_sequence) {
228 DRM_WAIT_ON(ret, cur_irq->irq_queue, 3 * DRM_HZ, 229 DRM_WAIT_ON(ret, cur_irq->irq_queue, 3 * DRM_HZ,
@@ -247,11 +248,12 @@ void via_driver_irq_preinstall(drm_device_t * dev)
247{ 248{
248 drm_via_private_t *dev_priv = (drm_via_private_t *) dev->dev_private; 249 drm_via_private_t *dev_priv = (drm_via_private_t *) dev->dev_private;
249 u32 status; 250 u32 status;
250 drm_via_irq_t *cur_irq = dev_priv->via_irqs; 251 drm_via_irq_t *cur_irq;
251 int i; 252 int i;
252 253
253 DRM_DEBUG("driver_irq_preinstall: dev_priv: %p\n", dev_priv); 254 DRM_DEBUG("driver_irq_preinstall: dev_priv: %p\n", dev_priv);
254 if (dev_priv) { 255 if (dev_priv) {
256 cur_irq = dev_priv->via_irqs;
255 257
256 dev_priv->irq_enable_mask = VIA_IRQ_VBLANK_ENABLE; 258 dev_priv->irq_enable_mask = VIA_IRQ_VBLANK_ENABLE;
257 dev_priv->irq_pending_mask = VIA_IRQ_VBLANK_PENDING; 259 dev_priv->irq_pending_mask = VIA_IRQ_VBLANK_PENDING;
diff --git a/drivers/char/genrtc.c b/drivers/char/genrtc.c
index d3a2bc36129b..588fca542a98 100644
--- a/drivers/char/genrtc.c
+++ b/drivers/char/genrtc.c
@@ -200,13 +200,13 @@ static ssize_t gen_rtc_read(struct file *file, char __user *buf,
200 /* first test allows optimizer to nuke this case for 32-bit machines */ 200 /* first test allows optimizer to nuke this case for 32-bit machines */
201 if (sizeof (int) != sizeof (long) && count == sizeof (unsigned int)) { 201 if (sizeof (int) != sizeof (long) && count == sizeof (unsigned int)) {
202 unsigned int uidata = data; 202 unsigned int uidata = data;
203 retval = put_user(uidata, (unsigned long __user *)buf); 203 retval = put_user(uidata, (unsigned int __user *)buf) ?:
204 sizeof(unsigned int);
204 } 205 }
205 else { 206 else {
206 retval = put_user(data, (unsigned long __user *)buf); 207 retval = put_user(data, (unsigned long __user *)buf) ?:
208 sizeof(unsigned long);
207 } 209 }
208 if (!retval)
209 retval = sizeof(unsigned long);
210 out: 210 out:
211 current->state = TASK_RUNNING; 211 current->state = TASK_RUNNING;
212 remove_wait_queue(&gen_rtc_wait, &wait); 212 remove_wait_queue(&gen_rtc_wait, &wait);
diff --git a/drivers/char/ipmi/ipmi_bt_sm.c b/drivers/char/ipmi/ipmi_bt_sm.c
index 58dcdee1cd71..0030cd8e2e95 100644
--- a/drivers/char/ipmi/ipmi_bt_sm.c
+++ b/drivers/char/ipmi/ipmi_bt_sm.c
@@ -165,7 +165,7 @@ static int bt_start_transaction(struct si_sm_data *bt,
165{ 165{
166 unsigned int i; 166 unsigned int i;
167 167
168 if ((size < 2) || (size > IPMI_MAX_MSG_LENGTH)) 168 if ((size < 2) || (size > (IPMI_MAX_MSG_LENGTH - 2)))
169 return -1; 169 return -1;
170 170
171 if ((bt->state != BT_STATE_IDLE) && (bt->state != BT_STATE_HOSED)) 171 if ((bt->state != BT_STATE_IDLE) && (bt->state != BT_STATE_HOSED))
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index a86c0f29953e..02a7dd7a8a55 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -1184,20 +1184,20 @@ static void port_outl(struct si_sm_io *io, unsigned int offset,
1184static void port_cleanup(struct smi_info *info) 1184static void port_cleanup(struct smi_info *info)
1185{ 1185{
1186 unsigned int addr = info->io.addr_data; 1186 unsigned int addr = info->io.addr_data;
1187 int mapsize; 1187 int idx;
1188 1188
1189 if (addr) { 1189 if (addr) {
1190 mapsize = ((info->io_size * info->io.regspacing) 1190 for (idx = 0; idx < info->io_size; idx++) {
1191 - (info->io.regspacing - info->io.regsize)); 1191 release_region(addr + idx * info->io.regspacing,
1192 1192 info->io.regsize);
1193 release_region (addr, mapsize); 1193 }
1194 } 1194 }
1195} 1195}
1196 1196
1197static int port_setup(struct smi_info *info) 1197static int port_setup(struct smi_info *info)
1198{ 1198{
1199 unsigned int addr = info->io.addr_data; 1199 unsigned int addr = info->io.addr_data;
1200 int mapsize; 1200 int idx;
1201 1201
1202 if (!addr) 1202 if (!addr)
1203 return -ENODEV; 1203 return -ENODEV;
@@ -1225,16 +1225,22 @@ static int port_setup(struct smi_info *info)
1225 return -EINVAL; 1225 return -EINVAL;
1226 } 1226 }
1227 1227
1228 /* Calculate the total amount of memory to claim. This is an 1228 /* Some BIOSes reserve disjoint I/O regions in their ACPI
1229 * unusual looking calculation, but it avoids claiming any 1229 * tables. This causes problems when trying to register the
1230 * more memory than it has to. It will claim everything 1230 * entire I/O region. Therefore we must register each I/O
1231 * between the first address to the end of the last full 1231 * port separately.
1232 * register. */ 1232 */
1233 mapsize = ((info->io_size * info->io.regspacing) 1233 for (idx = 0; idx < info->io_size; idx++) {
1234 - (info->io.regspacing - info->io.regsize)); 1234 if (request_region(addr + idx * info->io.regspacing,
1235 1235 info->io.regsize, DEVICE_NAME) == NULL) {
1236 if (request_region(addr, mapsize, DEVICE_NAME) == NULL) 1236 /* Undo allocations */
1237 return -EIO; 1237 while (idx--) {
1238 release_region(addr + idx * info->io.regspacing,
1239 info->io.regsize);
1240 }
1241 return -EIO;
1242 }
1243 }
1238 return 0; 1244 return 0;
1239} 1245}
1240 1246
@@ -2198,11 +2204,11 @@ static inline void wait_for_timer_and_thread(struct smi_info *smi_info)
2198 } 2204 }
2199} 2205}
2200 2206
2201static struct ipmi_default_vals 2207static __devinitdata struct ipmi_default_vals
2202{ 2208{
2203 int type; 2209 int type;
2204 int port; 2210 int port;
2205} __devinit ipmi_defaults[] = 2211} ipmi_defaults[] =
2206{ 2212{
2207 { .type = SI_KCS, .port = 0xca2 }, 2213 { .type = SI_KCS, .port = 0xca2 },
2208 { .type = SI_SMIC, .port = 0xca9 }, 2214 { .type = SI_SMIC, .port = 0xca9 },
diff --git a/drivers/char/keyboard.c b/drivers/char/keyboard.c
index 935670a3cd98..5755b7e5f187 100644
--- a/drivers/char/keyboard.c
+++ b/drivers/char/keyboard.c
@@ -860,9 +860,32 @@ static void k_slock(struct vc_data *vc, unsigned char value, char up_flag, struc
860} 860}
861 861
862/* by default, 300ms interval for combination release */ 862/* by default, 300ms interval for combination release */
863static long brl_timeout = 300; 863static unsigned brl_timeout = 300;
864MODULE_PARM_DESC(brl_timeout, "Braille keys release delay in ms (0 for combination on first release, < 0 for dead characters)"); 864MODULE_PARM_DESC(brl_timeout, "Braille keys release delay in ms (0 for commit on first key release)");
865module_param(brl_timeout, long, 0644); 865module_param(brl_timeout, uint, 0644);
866
867static unsigned brl_nbchords = 1;
868MODULE_PARM_DESC(brl_nbchords, "Number of chords that produce a braille pattern (0 for dead chords)");
869module_param(brl_nbchords, uint, 0644);
870
871static void k_brlcommit(struct vc_data *vc, unsigned int pattern, char up_flag, struct pt_regs *regs)
872{
873 static unsigned long chords;
874 static unsigned committed;
875
876 if (!brl_nbchords)
877 k_deadunicode(vc, BRL_UC_ROW | pattern, up_flag, regs);
878 else {
879 committed |= pattern;
880 chords++;
881 if (chords == brl_nbchords) {
882 k_unicode(vc, BRL_UC_ROW | committed, up_flag, regs);
883 chords = 0;
884 committed = 0;
885 }
886 }
887}
888
866static void k_brl(struct vc_data *vc, unsigned char value, char up_flag, struct pt_regs *regs) 889static void k_brl(struct vc_data *vc, unsigned char value, char up_flag, struct pt_regs *regs)
867{ 890{
868 static unsigned pressed,committing; 891 static unsigned pressed,committing;
@@ -882,11 +905,6 @@ static void k_brl(struct vc_data *vc, unsigned char value, char up_flag, struct
882 if (value > 8) 905 if (value > 8)
883 return; 906 return;
884 907
885 if (brl_timeout < 0) {
886 k_deadunicode(vc, BRL_UC_ROW | (1 << (value - 1)), up_flag, regs);
887 return;
888 }
889
890 if (up_flag) { 908 if (up_flag) {
891 if (brl_timeout) { 909 if (brl_timeout) {
892 if (!committing || 910 if (!committing ||
@@ -897,13 +915,13 @@ static void k_brl(struct vc_data *vc, unsigned char value, char up_flag, struct
897 pressed &= ~(1 << (value - 1)); 915 pressed &= ~(1 << (value - 1));
898 if (!pressed) { 916 if (!pressed) {
899 if (committing) { 917 if (committing) {
900 k_unicode(vc, BRL_UC_ROW | committing, 0, regs); 918 k_brlcommit(vc, committing, 0, regs);
901 committing = 0; 919 committing = 0;
902 } 920 }
903 } 921 }
904 } else { 922 } else {
905 if (committing) { 923 if (committing) {
906 k_unicode(vc, BRL_UC_ROW | committing, 0, regs); 924 k_brlcommit(vc, committing, 0, regs);
907 committing = 0; 925 committing = 0;
908 } 926 }
909 pressed &= ~(1 << (value - 1)); 927 pressed &= ~(1 << (value - 1));
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
index 66719f9d294c..1fa9fa157c12 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -27,6 +27,7 @@
27#include <linux/crash_dump.h> 27#include <linux/crash_dump.h>
28#include <linux/backing-dev.h> 28#include <linux/backing-dev.h>
29#include <linux/bootmem.h> 29#include <linux/bootmem.h>
30#include <linux/pipe_fs_i.h>
30 31
31#include <asm/uaccess.h> 32#include <asm/uaccess.h>
32#include <asm/io.h> 33#include <asm/io.h>
@@ -578,6 +579,18 @@ static ssize_t write_null(struct file * file, const char __user * buf,
578 return count; 579 return count;
579} 580}
580 581
582static int pipe_to_null(struct pipe_inode_info *info, struct pipe_buffer *buf,
583 struct splice_desc *sd)
584{
585 return sd->len;
586}
587
588static ssize_t splice_write_null(struct pipe_inode_info *pipe,struct file *out,
589 loff_t *ppos, size_t len, unsigned int flags)
590{
591 return splice_from_pipe(pipe, out, ppos, len, flags, pipe_to_null);
592}
593
581#ifdef CONFIG_MMU 594#ifdef CONFIG_MMU
582/* 595/*
583 * For fun, we are using the MMU for this. 596 * For fun, we are using the MMU for this.
@@ -785,6 +798,7 @@ static struct file_operations null_fops = {
785 .llseek = null_lseek, 798 .llseek = null_lseek,
786 .read = read_null, 799 .read = read_null,
787 .write = write_null, 800 .write = write_null,
801 .splice_write = splice_write_null,
788}; 802};
789 803
790#if defined(CONFIG_ISA) || !defined(__mc68000__) 804#if defined(CONFIG_ISA) || !defined(__mc68000__)
diff --git a/drivers/char/mwave/mwavedd.c b/drivers/char/mwave/mwavedd.c
index 8666171e187b..d3ba2f860ef0 100644
--- a/drivers/char/mwave/mwavedd.c
+++ b/drivers/char/mwave/mwavedd.c
@@ -271,7 +271,7 @@ static int mwave_ioctl(struct inode *inode, struct file *file,
271 ipcnum, 271 ipcnum,
272 pDrvData->IPCs[ipcnum].usIntCount); 272 pDrvData->IPCs[ipcnum].usIntCount);
273 273
274 if (ipcnum > ARRAY_SIZE(pDrvData->IPCs)) { 274 if (ipcnum >= ARRAY_SIZE(pDrvData->IPCs)) {
275 PRINTK_ERROR(KERN_ERR_MWAVE 275 PRINTK_ERROR(KERN_ERR_MWAVE
276 "mwavedd::mwave_ioctl:" 276 "mwavedd::mwave_ioctl:"
277 " IOCTL_MW_REGISTER_IPC:" 277 " IOCTL_MW_REGISTER_IPC:"
diff --git a/drivers/char/pcmcia/cm4000_cs.c b/drivers/char/pcmcia/cm4000_cs.c
index 02114a0bd0d9..eab5394da666 100644
--- a/drivers/char/pcmcia/cm4000_cs.c
+++ b/drivers/char/pcmcia/cm4000_cs.c
@@ -149,7 +149,7 @@ struct cm4000_dev {
149#define ZERO_DEV(dev) \ 149#define ZERO_DEV(dev) \
150 memset(&dev->atr_csum,0, \ 150 memset(&dev->atr_csum,0, \
151 sizeof(struct cm4000_dev) - \ 151 sizeof(struct cm4000_dev) - \
152 /*link*/ sizeof(struct pcmcia_device) - \ 152 /*link*/ sizeof(struct pcmcia_device *) - \
153 /*node*/ sizeof(dev_node_t) - \ 153 /*node*/ sizeof(dev_node_t) - \
154 /*atr*/ MAX_ATR*sizeof(char) - \ 154 /*atr*/ MAX_ATR*sizeof(char) - \
155 /*rbuf*/ 512*sizeof(char) - \ 155 /*rbuf*/ 512*sizeof(char) - \
@@ -1981,10 +1981,6 @@ static int __init cmm_init(void)
1981 if (!cmm_class) 1981 if (!cmm_class)
1982 return -1; 1982 return -1;
1983 1983
1984 rc = pcmcia_register_driver(&cm4000_driver);
1985 if (rc < 0)
1986 return rc;
1987
1988 major = register_chrdev(0, DEVICE_NAME, &cm4000_fops); 1984 major = register_chrdev(0, DEVICE_NAME, &cm4000_fops);
1989 if (major < 0) { 1985 if (major < 0) {
1990 printk(KERN_WARNING MODULE_NAME 1986 printk(KERN_WARNING MODULE_NAME
@@ -1992,6 +1988,12 @@ static int __init cmm_init(void)
1992 return -1; 1988 return -1;
1993 } 1989 }
1994 1990
1991 rc = pcmcia_register_driver(&cm4000_driver);
1992 if (rc < 0) {
1993 unregister_chrdev(major, DEVICE_NAME);
1994 return rc;
1995 }
1996
1995 return 0; 1997 return 0;
1996} 1998}
1997 1999
diff --git a/drivers/char/pcmcia/cm4040_cs.c b/drivers/char/pcmcia/cm4040_cs.c
index 29efa64580a8..47a8465bf95b 100644
--- a/drivers/char/pcmcia/cm4040_cs.c
+++ b/drivers/char/pcmcia/cm4040_cs.c
@@ -724,16 +724,19 @@ static int __init cm4040_init(void)
724 if (!cmx_class) 724 if (!cmx_class)
725 return -1; 725 return -1;
726 726
727 rc = pcmcia_register_driver(&reader_driver);
728 if (rc < 0)
729 return rc;
730
731 major = register_chrdev(0, DEVICE_NAME, &reader_fops); 727 major = register_chrdev(0, DEVICE_NAME, &reader_fops);
732 if (major < 0) { 728 if (major < 0) {
733 printk(KERN_WARNING MODULE_NAME 729 printk(KERN_WARNING MODULE_NAME
734 ": could not get major number\n"); 730 ": could not get major number\n");
735 return -1; 731 return -1;
736 } 732 }
733
734 rc = pcmcia_register_driver(&reader_driver);
735 if (rc < 0) {
736 unregister_chrdev(major, DEVICE_NAME);
737 return rc;
738 }
739
737 return 0; 740 return 0;
738} 741}
739 742
diff --git a/drivers/char/rio/host.h b/drivers/char/rio/host.h
index 3ec73d1a279a..179cdbea712b 100644
--- a/drivers/char/rio/host.h
+++ b/drivers/char/rio/host.h
@@ -33,12 +33,6 @@
33#ifndef __rio_host_h__ 33#ifndef __rio_host_h__
34#define __rio_host_h__ 34#define __rio_host_h__
35 35
36#ifdef SCCS_LABELS
37#ifndef lint
38static char *_host_h_sccs_ = "@(#)host.h 1.2";
39#endif
40#endif
41
42/* 36/*
43** the host structure - one per host card in the system. 37** the host structure - one per host card in the system.
44*/ 38*/
@@ -77,9 +71,6 @@ struct Host {
77#define RC_STARTUP 1 71#define RC_STARTUP 1
78#define RC_RUNNING 2 72#define RC_RUNNING 2
79#define RC_STUFFED 3 73#define RC_STUFFED 3
80#define RC_SOMETHING 4
81#define RC_SOMETHING_NEW 5
82#define RC_SOMETHING_ELSE 6
83#define RC_READY 7 74#define RC_READY 7
84#define RUN_STATE 7 75#define RUN_STATE 7
85/* 76/*
diff --git a/drivers/char/rio/rioboot.c b/drivers/char/rio/rioboot.c
index acda9326c2ef..290143addd34 100644
--- a/drivers/char/rio/rioboot.c
+++ b/drivers/char/rio/rioboot.c
@@ -34,6 +34,7 @@
34#include <linux/slab.h> 34#include <linux/slab.h>
35#include <linux/termios.h> 35#include <linux/termios.h>
36#include <linux/serial.h> 36#include <linux/serial.h>
37#include <linux/vmalloc.h>
37#include <asm/semaphore.h> 38#include <asm/semaphore.h>
38#include <linux/generic_serial.h> 39#include <linux/generic_serial.h>
39#include <linux/errno.h> 40#include <linux/errno.h>
diff --git a/drivers/char/rio/rioctrl.c b/drivers/char/rio/rioctrl.c
index d31aba62bb7f..75b2557c37ec 100644
--- a/drivers/char/rio/rioctrl.c
+++ b/drivers/char/rio/rioctrl.c
@@ -1394,14 +1394,17 @@ int RIOPreemptiveCmd(struct rio_info *p, struct Port *PortP, u8 Cmd)
1394 return RIO_FAIL; 1394 return RIO_FAIL;
1395 } 1395 }
1396 1396
1397 if (((int) ((char) PortP->InUse) == -1) || !(CmdBlkP = RIOGetCmdBlk())) { 1397 if ((PortP->InUse == (typeof(PortP->InUse))-1) ||
1398 rio_dprintk(RIO_DEBUG_CTRL, "Cannot allocate command block for command %d on port %d\n", Cmd, PortP->PortNum); 1398 !(CmdBlkP = RIOGetCmdBlk())) {
1399 rio_dprintk(RIO_DEBUG_CTRL, "Cannot allocate command block "
1400 "for command %d on port %d\n", Cmd, PortP->PortNum);
1399 return RIO_FAIL; 1401 return RIO_FAIL;
1400 } 1402 }
1401 1403
1402 rio_dprintk(RIO_DEBUG_CTRL, "Command blk %p - InUse now %d\n", CmdBlkP, PortP->InUse); 1404 rio_dprintk(RIO_DEBUG_CTRL, "Command blk %p - InUse now %d\n",
1405 CmdBlkP, PortP->InUse);
1403 1406
1404 PktCmdP = (struct PktCmd_M *) &CmdBlkP->Packet.data[0]; 1407 PktCmdP = (struct PktCmd_M *)&CmdBlkP->Packet.data[0];
1405 1408
1406 CmdBlkP->Packet.src_unit = 0; 1409 CmdBlkP->Packet.src_unit = 0;
1407 if (PortP->SecondBlock) 1410 if (PortP->SecondBlock)
@@ -1425,38 +1428,46 @@ int RIOPreemptiveCmd(struct rio_info *p, struct Port *PortP, u8 Cmd)
1425 1428
1426 switch (Cmd) { 1429 switch (Cmd) {
1427 case MEMDUMP: 1430 case MEMDUMP:
1428 rio_dprintk(RIO_DEBUG_CTRL, "Queue MEMDUMP command blk %p (addr 0x%x)\n", CmdBlkP, (int) SubCmd.Addr); 1431 rio_dprintk(RIO_DEBUG_CTRL, "Queue MEMDUMP command blk %p "
1432 "(addr 0x%x)\n", CmdBlkP, (int) SubCmd.Addr);
1429 PktCmdP->SubCommand = MEMDUMP; 1433 PktCmdP->SubCommand = MEMDUMP;
1430 PktCmdP->SubAddr = SubCmd.Addr; 1434 PktCmdP->SubAddr = SubCmd.Addr;
1431 break; 1435 break;
1432 case FCLOSE: 1436 case FCLOSE:
1433 rio_dprintk(RIO_DEBUG_CTRL, "Queue FCLOSE command blk %p\n", CmdBlkP); 1437 rio_dprintk(RIO_DEBUG_CTRL, "Queue FCLOSE command blk %p\n",
1438 CmdBlkP);
1434 break; 1439 break;
1435 case READ_REGISTER: 1440 case READ_REGISTER:
1436 rio_dprintk(RIO_DEBUG_CTRL, "Queue READ_REGISTER (0x%x) command blk %p\n", (int) SubCmd.Addr, CmdBlkP); 1441 rio_dprintk(RIO_DEBUG_CTRL, "Queue READ_REGISTER (0x%x) "
1442 "command blk %p\n", (int) SubCmd.Addr, CmdBlkP);
1437 PktCmdP->SubCommand = READ_REGISTER; 1443 PktCmdP->SubCommand = READ_REGISTER;
1438 PktCmdP->SubAddr = SubCmd.Addr; 1444 PktCmdP->SubAddr = SubCmd.Addr;
1439 break; 1445 break;
1440 case RESUME: 1446 case RESUME:
1441 rio_dprintk(RIO_DEBUG_CTRL, "Queue RESUME command blk %p\n", CmdBlkP); 1447 rio_dprintk(RIO_DEBUG_CTRL, "Queue RESUME command blk %p\n",
1448 CmdBlkP);
1442 break; 1449 break;
1443 case RFLUSH: 1450 case RFLUSH:
1444 rio_dprintk(RIO_DEBUG_CTRL, "Queue RFLUSH command blk %p\n", CmdBlkP); 1451 rio_dprintk(RIO_DEBUG_CTRL, "Queue RFLUSH command blk %p\n",
1452 CmdBlkP);
1445 CmdBlkP->PostFuncP = RIORFlushEnable; 1453 CmdBlkP->PostFuncP = RIORFlushEnable;
1446 break; 1454 break;
1447 case SUSPEND: 1455 case SUSPEND:
1448 rio_dprintk(RIO_DEBUG_CTRL, "Queue SUSPEND command blk %p\n", CmdBlkP); 1456 rio_dprintk(RIO_DEBUG_CTRL, "Queue SUSPEND command blk %p\n",
1457 CmdBlkP);
1449 break; 1458 break;
1450 1459
1451 case MGET: 1460 case MGET:
1452 rio_dprintk(RIO_DEBUG_CTRL, "Queue MGET command blk %p\n", CmdBlkP); 1461 rio_dprintk(RIO_DEBUG_CTRL, "Queue MGET command blk %p\n",
1462 CmdBlkP);
1453 break; 1463 break;
1454 1464
1455 case MSET: 1465 case MSET:
1456 case MBIC: 1466 case MBIC:
1457 case MBIS: 1467 case MBIS:
1458 CmdBlkP->Packet.data[4] = (char) PortP->ModemLines; 1468 CmdBlkP->Packet.data[4] = (char) PortP->ModemLines;
1459 rio_dprintk(RIO_DEBUG_CTRL, "Queue MSET/MBIC/MBIS command blk %p\n", CmdBlkP); 1469 rio_dprintk(RIO_DEBUG_CTRL, "Queue MSET/MBIC/MBIS command "
1470 "blk %p\n", CmdBlkP);
1460 break; 1471 break;
1461 1472
1462 case WFLUSH: 1473 case WFLUSH:
@@ -1465,12 +1476,14 @@ int RIOPreemptiveCmd(struct rio_info *p, struct Port *PortP, u8 Cmd)
1465 ** allowed then we should not bother sending any more to the 1476 ** allowed then we should not bother sending any more to the
1466 ** RTA. 1477 ** RTA.
1467 */ 1478 */
1468 if ((int) ((char) PortP->WflushFlag) == (int) -1) { 1479 if (PortP->WflushFlag == (typeof(PortP->WflushFlag))-1) {
1469 rio_dprintk(RIO_DEBUG_CTRL, "Trashed WFLUSH, WflushFlag about to wrap!"); 1480 rio_dprintk(RIO_DEBUG_CTRL, "Trashed WFLUSH, "
1481 "WflushFlag about to wrap!");
1470 RIOFreeCmdBlk(CmdBlkP); 1482 RIOFreeCmdBlk(CmdBlkP);
1471 return (RIO_FAIL); 1483 return (RIO_FAIL);
1472 } else { 1484 } else {
1473 rio_dprintk(RIO_DEBUG_CTRL, "Queue WFLUSH command blk %p\n", CmdBlkP); 1485 rio_dprintk(RIO_DEBUG_CTRL, "Queue WFLUSH command "
1486 "blk %p\n", CmdBlkP);
1474 CmdBlkP->PostFuncP = RIOWFlushMark; 1487 CmdBlkP->PostFuncP = RIOWFlushMark;
1475 } 1488 }
1476 break; 1489 break;
diff --git a/drivers/char/rio/rioioctl.h b/drivers/char/rio/rioioctl.h
index 14b83fae75c8..e8af5b30519e 100644
--- a/drivers/char/rio/rioioctl.h
+++ b/drivers/char/rio/rioioctl.h
@@ -33,10 +33,6 @@
33#ifndef __rioioctl_h__ 33#ifndef __rioioctl_h__
34#define __rioioctl_h__ 34#define __rioioctl_h__
35 35
36#ifdef SCCS_LABELS
37static char *_rioioctl_h_sccs_ = "@(#)rioioctl.h 1.2";
38#endif
39
40/* 36/*
41** RIO device driver - user ioctls and associated structures. 37** RIO device driver - user ioctls and associated structures.
42*/ 38*/
@@ -44,55 +40,13 @@ static char *_rioioctl_h_sccs_ = "@(#)rioioctl.h 1.2";
44struct portStats { 40struct portStats {
45 int port; 41 int port;
46 int gather; 42 int gather;
47 ulong txchars; 43 unsigned long txchars;
48 ulong rxchars; 44 unsigned long rxchars;
49 ulong opens; 45 unsigned long opens;
50 ulong closes; 46 unsigned long closes;
51 ulong ioctls; 47 unsigned long ioctls;
52}; 48};
53 49
54
55#define rIOC ('r'<<8)
56#define TCRIOSTATE (rIOC | 1)
57#define TCRIOXPON (rIOC | 2)
58#define TCRIOXPOFF (rIOC | 3)
59#define TCRIOXPCPS (rIOC | 4)
60#define TCRIOXPRINT (rIOC | 5)
61#define TCRIOIXANYON (rIOC | 6)
62#define TCRIOIXANYOFF (rIOC | 7)
63#define TCRIOIXONON (rIOC | 8)
64#define TCRIOIXONOFF (rIOC | 9)
65#define TCRIOMBIS (rIOC | 10)
66#define TCRIOMBIC (rIOC | 11)
67#define TCRIOTRIAD (rIOC | 12)
68#define TCRIOTSTATE (rIOC | 13)
69
70/*
71** 15.10.1998 ARG - ESIL 0761 part fix
72** Add RIO ioctls for manipulating RTS and CTS flow control, (as LynxOS
73** appears to not support hardware flow control).
74*/
75#define TCRIOCTSFLOWEN (rIOC | 14) /* enable CTS flow control */
76#define TCRIOCTSFLOWDIS (rIOC | 15) /* disable CTS flow control */
77#define TCRIORTSFLOWEN (rIOC | 16) /* enable RTS flow control */
78#define TCRIORTSFLOWDIS (rIOC | 17) /* disable RTS flow control */
79
80/*
81** 09.12.1998 ARG - ESIL 0776 part fix
82** Definition for 'RIOC' also appears in daemon.h, so we'd better do a
83** #ifndef here first.
84** 'RIO_QUICK_CHECK' also #define'd here as this ioctl is now
85** allowed to be used by customers.
86**
87** 05.02.1999 ARG -
88** This is what I've decied to do with ioctls etc., which are intended to be
89** invoked from users applications :
90** Anything that needs to be defined here will be removed from daemon.h, that
91** way it won't end up having to be defined/maintained in two places. The only
92** consequence of this is that this file should now be #include'd by daemon.h
93**
94** 'stats' ioctls now #define'd here as they are to be used by customers.
95*/
96#define RIOC ('R'<<8)|('i'<<16)|('o'<<24) 50#define RIOC ('R'<<8)|('i'<<16)|('o'<<24)
97 51
98#define RIO_QUICK_CHECK (RIOC | 105) 52#define RIO_QUICK_CHECK (RIOC | 105)
diff --git a/drivers/char/snsc.c b/drivers/char/snsc.c
index b543821d8cb4..56c8243cdb73 100644
--- a/drivers/char/snsc.c
+++ b/drivers/char/snsc.c
@@ -390,7 +390,8 @@ scdrv_init(void)
390 format_module_id(devnamep, geo_module(geoid), 390 format_module_id(devnamep, geo_module(geoid),
391 MODULE_FORMAT_BRIEF); 391 MODULE_FORMAT_BRIEF);
392 devnamep = devname + strlen(devname); 392 devnamep = devname + strlen(devname);
393 sprintf(devnamep, "#%d", geo_slab(geoid)); 393 sprintf(devnamep, "^%d#%d", geo_slot(geoid),
394 geo_slab(geoid));
394 395
395 /* allocate sysctl device data */ 396 /* allocate sysctl device data */
396 scd = kzalloc(sizeof (struct sysctl_data_s), 397 scd = kzalloc(sizeof (struct sysctl_data_s),
diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c
index f8dd8527c6aa..a90f5d97df35 100644
--- a/drivers/char/sonypi.c
+++ b/drivers/char/sonypi.c
@@ -1341,6 +1341,9 @@ static int __devinit sonypi_probe(struct platform_device *dev)
1341 else if ((pcidev = pci_get_device(PCI_VENDOR_ID_INTEL, 1341 else if ((pcidev = pci_get_device(PCI_VENDOR_ID_INTEL,
1342 PCI_DEVICE_ID_INTEL_ICH6_1, NULL))) 1342 PCI_DEVICE_ID_INTEL_ICH6_1, NULL)))
1343 sonypi_device.model = SONYPI_DEVICE_MODEL_TYPE3; 1343 sonypi_device.model = SONYPI_DEVICE_MODEL_TYPE3;
1344 else if ((pcidev = pci_get_device(PCI_VENDOR_ID_INTEL,
1345 PCI_DEVICE_ID_INTEL_ICH7_1, NULL)))
1346 sonypi_device.model = SONYPI_DEVICE_MODEL_TYPE3;
1344 else 1347 else
1345 sonypi_device.model = SONYPI_DEVICE_MODEL_TYPE2; 1348 sonypi_device.model = SONYPI_DEVICE_MODEL_TYPE2;
1346 1349
diff --git a/drivers/char/tipar.c b/drivers/char/tipar.c
index eb2eb3e12d6a..079db5a935a1 100644
--- a/drivers/char/tipar.c
+++ b/drivers/char/tipar.c
@@ -515,7 +515,7 @@ tipar_init_module(void)
515 err = PTR_ERR(tipar_class); 515 err = PTR_ERR(tipar_class);
516 goto out_chrdev; 516 goto out_chrdev;
517 } 517 }
518 if (parport_register_driver(&tipar_driver) || tp_count == 0) { 518 if (parport_register_driver(&tipar_driver)) {
519 printk(KERN_ERR "tipar: unable to register with parport\n"); 519 printk(KERN_ERR "tipar: unable to register with parport\n");
520 err = -EIO; 520 err = -EIO;
521 goto out_class; 521 goto out_class;
diff --git a/drivers/char/tpm/Kconfig b/drivers/char/tpm/Kconfig
index a6873bf89ffa..fe00c7dfb649 100644
--- a/drivers/char/tpm/Kconfig
+++ b/drivers/char/tpm/Kconfig
@@ -20,9 +20,18 @@ config TCG_TPM
20 Note: For more TPM drivers enable CONFIG_PNP, CONFIG_ACPI 20 Note: For more TPM drivers enable CONFIG_PNP, CONFIG_ACPI
21 and CONFIG_PNPACPI. 21 and CONFIG_PNPACPI.
22 22
23config TCG_TIS
24 tristate "TPM Interface Specification 1.2 Interface"
25 depends on TCG_TPM && PNPACPI
26 ---help---
27 If you have a TPM security chip that is compliant with the
28 TCG TIS 1.2 TPM specification say Yes and it will be accessible
29 from within Linux. To compile this driver as a module, choose
30 M here; the module will be called tpm_tis.
31
23config TCG_NSC 32config TCG_NSC
24 tristate "National Semiconductor TPM Interface" 33 tristate "National Semiconductor TPM Interface"
25 depends on TCG_TPM 34 depends on TCG_TPM && PNPACPI
26 ---help--- 35 ---help---
27 If you have a TPM security chip from National Semicondutor 36 If you have a TPM security chip from National Semicondutor
28 say Yes and it will be accessible from within Linux. To 37 say Yes and it will be accessible from within Linux. To
diff --git a/drivers/char/tpm/Makefile b/drivers/char/tpm/Makefile
index ba4582d160fd..ea3a1e02a824 100644
--- a/drivers/char/tpm/Makefile
+++ b/drivers/char/tpm/Makefile
@@ -5,6 +5,7 @@ obj-$(CONFIG_TCG_TPM) += tpm.o
5ifdef CONFIG_ACPI 5ifdef CONFIG_ACPI
6 obj-$(CONFIG_TCG_TPM) += tpm_bios.o 6 obj-$(CONFIG_TCG_TPM) += tpm_bios.o
7endif 7endif
8obj-$(CONFIG_TCG_TIS) += tpm_tis.o
8obj-$(CONFIG_TCG_NSC) += tpm_nsc.o 9obj-$(CONFIG_TCG_NSC) += tpm_nsc.o
9obj-$(CONFIG_TCG_ATMEL) += tpm_atmel.o 10obj-$(CONFIG_TCG_ATMEL) += tpm_atmel.o
10obj-$(CONFIG_TCG_INFINEON) += tpm_infineon.o 11obj-$(CONFIG_TCG_INFINEON) += tpm_infineon.o
diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c
index 5a3870477ef1..6889e7db3aff 100644
--- a/drivers/char/tpm/tpm.c
+++ b/drivers/char/tpm/tpm.c
@@ -32,12 +32,291 @@ enum tpm_const {
32 TPM_MINOR = 224, /* officially assigned */ 32 TPM_MINOR = 224, /* officially assigned */
33 TPM_BUFSIZE = 2048, 33 TPM_BUFSIZE = 2048,
34 TPM_NUM_DEVICES = 256, 34 TPM_NUM_DEVICES = 256,
35 TPM_NUM_MASK_ENTRIES = TPM_NUM_DEVICES / (8 * sizeof(int))
36}; 35};
37 36
37enum tpm_duration {
38 TPM_SHORT = 0,
39 TPM_MEDIUM = 1,
40 TPM_LONG = 2,
41 TPM_UNDEFINED,
42};
43
44#define TPM_MAX_ORDINAL 243
45#define TPM_MAX_PROTECTED_ORDINAL 12
46#define TPM_PROTECTED_ORDINAL_MASK 0xFF
47
38static LIST_HEAD(tpm_chip_list); 48static LIST_HEAD(tpm_chip_list);
39static DEFINE_SPINLOCK(driver_lock); 49static DEFINE_SPINLOCK(driver_lock);
40static int dev_mask[TPM_NUM_MASK_ENTRIES]; 50static DECLARE_BITMAP(dev_mask, TPM_NUM_DEVICES);
51
52/*
53 * Array with one entry per ordinal defining the maximum amount
54 * of time the chip could take to return the result. The ordinal
55 * designation of short, medium or long is defined in a table in
56 * TCG Specification TPM Main Part 2 TPM Structures Section 17. The
57 * values of the SHORT, MEDIUM, and LONG durations are retrieved
58 * from the chip during initialization with a call to tpm_get_timeouts.
59 */
60static const u8 tpm_protected_ordinal_duration[TPM_MAX_PROTECTED_ORDINAL] = {
61 TPM_UNDEFINED, /* 0 */
62 TPM_UNDEFINED,
63 TPM_UNDEFINED,
64 TPM_UNDEFINED,
65 TPM_UNDEFINED,
66 TPM_UNDEFINED, /* 5 */
67 TPM_UNDEFINED,
68 TPM_UNDEFINED,
69 TPM_UNDEFINED,
70 TPM_UNDEFINED,
71 TPM_SHORT, /* 10 */
72 TPM_SHORT,
73};
74
75static const u8 tpm_ordinal_duration[TPM_MAX_ORDINAL] = {
76 TPM_UNDEFINED, /* 0 */
77 TPM_UNDEFINED,
78 TPM_UNDEFINED,
79 TPM_UNDEFINED,
80 TPM_UNDEFINED,
81 TPM_UNDEFINED, /* 5 */
82 TPM_UNDEFINED,
83 TPM_UNDEFINED,
84 TPM_UNDEFINED,
85 TPM_UNDEFINED,
86 TPM_SHORT, /* 10 */
87 TPM_SHORT,
88 TPM_MEDIUM,
89 TPM_LONG,
90 TPM_LONG,
91 TPM_MEDIUM, /* 15 */
92 TPM_SHORT,
93 TPM_SHORT,
94 TPM_MEDIUM,
95 TPM_LONG,
96 TPM_SHORT, /* 20 */
97 TPM_SHORT,
98 TPM_MEDIUM,
99 TPM_MEDIUM,
100 TPM_MEDIUM,
101 TPM_SHORT, /* 25 */
102 TPM_SHORT,
103 TPM_MEDIUM,
104 TPM_SHORT,
105 TPM_SHORT,
106 TPM_MEDIUM, /* 30 */
107 TPM_LONG,
108 TPM_MEDIUM,
109 TPM_SHORT,
110 TPM_SHORT,
111 TPM_SHORT, /* 35 */
112 TPM_MEDIUM,
113 TPM_MEDIUM,
114 TPM_UNDEFINED,
115 TPM_UNDEFINED,
116 TPM_MEDIUM, /* 40 */
117 TPM_LONG,
118 TPM_MEDIUM,
119 TPM_SHORT,
120 TPM_SHORT,
121 TPM_SHORT, /* 45 */
122 TPM_SHORT,
123 TPM_SHORT,
124 TPM_SHORT,
125 TPM_LONG,
126 TPM_MEDIUM, /* 50 */
127 TPM_MEDIUM,
128 TPM_UNDEFINED,
129 TPM_UNDEFINED,
130 TPM_UNDEFINED,
131 TPM_UNDEFINED, /* 55 */
132 TPM_UNDEFINED,
133 TPM_UNDEFINED,
134 TPM_UNDEFINED,
135 TPM_UNDEFINED,
136 TPM_MEDIUM, /* 60 */
137 TPM_MEDIUM,
138 TPM_MEDIUM,
139 TPM_SHORT,
140 TPM_SHORT,
141 TPM_MEDIUM, /* 65 */
142 TPM_UNDEFINED,
143 TPM_UNDEFINED,
144 TPM_UNDEFINED,
145 TPM_UNDEFINED,
146 TPM_SHORT, /* 70 */
147 TPM_SHORT,
148 TPM_UNDEFINED,
149 TPM_UNDEFINED,
150 TPM_UNDEFINED,
151 TPM_UNDEFINED, /* 75 */
152 TPM_UNDEFINED,
153 TPM_UNDEFINED,
154 TPM_UNDEFINED,
155 TPM_UNDEFINED,
156 TPM_LONG, /* 80 */
157 TPM_UNDEFINED,
158 TPM_MEDIUM,
159 TPM_LONG,
160 TPM_SHORT,
161 TPM_UNDEFINED, /* 85 */
162 TPM_UNDEFINED,
163 TPM_UNDEFINED,
164 TPM_UNDEFINED,
165 TPM_UNDEFINED,
166 TPM_SHORT, /* 90 */
167 TPM_SHORT,
168 TPM_SHORT,
169 TPM_SHORT,
170 TPM_SHORT,
171 TPM_UNDEFINED, /* 95 */
172 TPM_UNDEFINED,
173 TPM_UNDEFINED,
174 TPM_UNDEFINED,
175 TPM_UNDEFINED,
176 TPM_MEDIUM, /* 100 */
177 TPM_SHORT,
178 TPM_SHORT,
179 TPM_UNDEFINED,
180 TPM_UNDEFINED,
181 TPM_UNDEFINED, /* 105 */
182 TPM_UNDEFINED,
183 TPM_UNDEFINED,
184 TPM_UNDEFINED,
185 TPM_UNDEFINED,
186 TPM_SHORT, /* 110 */
187 TPM_SHORT,
188 TPM_SHORT,
189 TPM_SHORT,
190 TPM_SHORT,
191 TPM_SHORT, /* 115 */
192 TPM_SHORT,
193 TPM_SHORT,
194 TPM_UNDEFINED,
195 TPM_UNDEFINED,
196 TPM_LONG, /* 120 */
197 TPM_LONG,
198 TPM_MEDIUM,
199 TPM_UNDEFINED,
200 TPM_SHORT,
201 TPM_SHORT, /* 125 */
202 TPM_SHORT,
203 TPM_LONG,
204 TPM_SHORT,
205 TPM_SHORT,
206 TPM_SHORT, /* 130 */
207 TPM_MEDIUM,
208 TPM_UNDEFINED,
209 TPM_SHORT,
210 TPM_MEDIUM,
211 TPM_UNDEFINED, /* 135 */
212 TPM_UNDEFINED,
213 TPM_UNDEFINED,
214 TPM_UNDEFINED,
215 TPM_UNDEFINED,
216 TPM_SHORT, /* 140 */
217 TPM_SHORT,
218 TPM_UNDEFINED,
219 TPM_UNDEFINED,
220 TPM_UNDEFINED,
221 TPM_UNDEFINED, /* 145 */
222 TPM_UNDEFINED,
223 TPM_UNDEFINED,
224 TPM_UNDEFINED,
225 TPM_UNDEFINED,
226 TPM_SHORT, /* 150 */
227 TPM_MEDIUM,
228 TPM_MEDIUM,
229 TPM_SHORT,
230 TPM_SHORT,
231 TPM_UNDEFINED, /* 155 */
232 TPM_UNDEFINED,
233 TPM_UNDEFINED,
234 TPM_UNDEFINED,
235 TPM_UNDEFINED,
236 TPM_SHORT, /* 160 */
237 TPM_SHORT,
238 TPM_SHORT,
239 TPM_SHORT,
240 TPM_UNDEFINED,
241 TPM_UNDEFINED, /* 165 */
242 TPM_UNDEFINED,
243 TPM_UNDEFINED,
244 TPM_UNDEFINED,
245 TPM_UNDEFINED,
246 TPM_LONG, /* 170 */
247 TPM_UNDEFINED,
248 TPM_UNDEFINED,
249 TPM_UNDEFINED,
250 TPM_UNDEFINED,
251 TPM_UNDEFINED, /* 175 */
252 TPM_UNDEFINED,
253 TPM_UNDEFINED,
254 TPM_UNDEFINED,
255 TPM_UNDEFINED,
256 TPM_MEDIUM, /* 180 */
257 TPM_SHORT,
258 TPM_MEDIUM,
259 TPM_MEDIUM,
260 TPM_MEDIUM,
261 TPM_MEDIUM, /* 185 */
262 TPM_SHORT,
263 TPM_UNDEFINED,
264 TPM_UNDEFINED,
265 TPM_UNDEFINED,
266 TPM_UNDEFINED, /* 190 */
267 TPM_UNDEFINED,
268 TPM_UNDEFINED,
269 TPM_UNDEFINED,
270 TPM_UNDEFINED,
271 TPM_UNDEFINED, /* 195 */
272 TPM_UNDEFINED,
273 TPM_UNDEFINED,
274 TPM_UNDEFINED,
275 TPM_UNDEFINED,
276 TPM_SHORT, /* 200 */
277 TPM_UNDEFINED,
278 TPM_UNDEFINED,
279 TPM_UNDEFINED,
280 TPM_SHORT,
281 TPM_SHORT, /* 205 */
282 TPM_SHORT,
283 TPM_SHORT,
284 TPM_SHORT,
285 TPM_SHORT,
286 TPM_MEDIUM, /* 210 */
287 TPM_UNDEFINED,
288 TPM_MEDIUM,
289 TPM_MEDIUM,
290 TPM_MEDIUM,
291 TPM_UNDEFINED, /* 215 */
292 TPM_MEDIUM,
293 TPM_UNDEFINED,
294 TPM_UNDEFINED,
295 TPM_SHORT,
296 TPM_SHORT, /* 220 */
297 TPM_SHORT,
298 TPM_SHORT,
299 TPM_SHORT,
300 TPM_SHORT,
301 TPM_UNDEFINED, /* 225 */
302 TPM_UNDEFINED,
303 TPM_UNDEFINED,
304 TPM_UNDEFINED,
305 TPM_UNDEFINED,
306 TPM_SHORT, /* 230 */
307 TPM_LONG,
308 TPM_MEDIUM,
309 TPM_UNDEFINED,
310 TPM_UNDEFINED,
311 TPM_UNDEFINED, /* 235 */
312 TPM_UNDEFINED,
313 TPM_UNDEFINED,
314 TPM_UNDEFINED,
315 TPM_UNDEFINED,
316 TPM_SHORT, /* 240 */
317 TPM_UNDEFINED,
318 TPM_MEDIUM,
319};
41 320
42static void user_reader_timeout(unsigned long ptr) 321static void user_reader_timeout(unsigned long ptr)
43{ 322{
@@ -46,7 +325,7 @@ static void user_reader_timeout(unsigned long ptr)
46 schedule_work(&chip->work); 325 schedule_work(&chip->work);
47} 326}
48 327
49static void timeout_work(void * ptr) 328static void timeout_work(void *ptr)
50{ 329{
51 struct tpm_chip *chip = ptr; 330 struct tpm_chip *chip = ptr;
52 331
@@ -57,17 +336,43 @@ static void timeout_work(void * ptr)
57} 336}
58 337
59/* 338/*
339 * Returns max number of jiffies to wait
340 */
341unsigned long tpm_calc_ordinal_duration(struct tpm_chip *chip,
342 u32 ordinal)
343{
344 int duration_idx = TPM_UNDEFINED;
345 int duration = 0;
346
347 if (ordinal < TPM_MAX_ORDINAL)
348 duration_idx = tpm_ordinal_duration[ordinal];
349 else if ((ordinal & TPM_PROTECTED_ORDINAL_MASK) <
350 TPM_MAX_PROTECTED_ORDINAL)
351 duration_idx =
352 tpm_protected_ordinal_duration[ordinal &
353 TPM_PROTECTED_ORDINAL_MASK];
354
355 if (duration_idx != TPM_UNDEFINED)
356 duration = chip->vendor.duration[duration_idx];
357 if (duration <= 0)
358 return 2 * 60 * HZ;
359 else
360 return duration;
361}
362EXPORT_SYMBOL_GPL(tpm_calc_ordinal_duration);
363
364/*
60 * Internal kernel interface to transmit TPM commands 365 * Internal kernel interface to transmit TPM commands
61 */ 366 */
62static ssize_t tpm_transmit(struct tpm_chip *chip, const char *buf, 367static ssize_t tpm_transmit(struct tpm_chip *chip, const char *buf,
63 size_t bufsiz) 368 size_t bufsiz)
64{ 369{
65 ssize_t rc; 370 ssize_t rc;
66 u32 count; 371 u32 count, ordinal;
67 unsigned long stop; 372 unsigned long stop;
68 373
69 count = be32_to_cpu(*((__be32 *) (buf + 2))); 374 count = be32_to_cpu(*((__be32 *) (buf + 2)));
70 375 ordinal = be32_to_cpu(*((__be32 *) (buf + 6)));
71 if (count == 0) 376 if (count == 0)
72 return -ENODATA; 377 return -ENODATA;
73 if (count > bufsiz) { 378 if (count > bufsiz) {
@@ -78,21 +383,23 @@ static ssize_t tpm_transmit(struct tpm_chip *chip, const char *buf,
78 383
79 down(&chip->tpm_mutex); 384 down(&chip->tpm_mutex);
80 385
81 if ((rc = chip->vendor->send(chip, (u8 *) buf, count)) < 0) { 386 if ((rc = chip->vendor.send(chip, (u8 *) buf, count)) < 0) {
82 dev_err(chip->dev, 387 dev_err(chip->dev,
83 "tpm_transmit: tpm_send: error %zd\n", rc); 388 "tpm_transmit: tpm_send: error %zd\n", rc);
84 goto out; 389 goto out;
85 } 390 }
86 391
87 stop = jiffies + 2 * 60 * HZ; 392 if (chip->vendor.irq)
393 goto out_recv;
394
395 stop = jiffies + tpm_calc_ordinal_duration(chip, ordinal);
88 do { 396 do {
89 u8 status = chip->vendor->status(chip); 397 u8 status = chip->vendor.status(chip);
90 if ((status & chip->vendor->req_complete_mask) == 398 if ((status & chip->vendor.req_complete_mask) ==
91 chip->vendor->req_complete_val) { 399 chip->vendor.req_complete_val)
92 goto out_recv; 400 goto out_recv;
93 }
94 401
95 if ((status == chip->vendor->req_canceled)) { 402 if ((status == chip->vendor.req_canceled)) {
96 dev_err(chip->dev, "Operation Canceled\n"); 403 dev_err(chip->dev, "Operation Canceled\n");
97 rc = -ECANCELED; 404 rc = -ECANCELED;
98 goto out; 405 goto out;
@@ -102,14 +409,13 @@ static ssize_t tpm_transmit(struct tpm_chip *chip, const char *buf,
102 rmb(); 409 rmb();
103 } while (time_before(jiffies, stop)); 410 } while (time_before(jiffies, stop));
104 411
105 412 chip->vendor.cancel(chip);
106 chip->vendor->cancel(chip);
107 dev_err(chip->dev, "Operation Timed out\n"); 413 dev_err(chip->dev, "Operation Timed out\n");
108 rc = -ETIME; 414 rc = -ETIME;
109 goto out; 415 goto out;
110 416
111out_recv: 417out_recv:
112 rc = chip->vendor->recv(chip, (u8 *) buf, bufsiz); 418 rc = chip->vendor.recv(chip, (u8 *) buf, bufsiz);
113 if (rc < 0) 419 if (rc < 0)
114 dev_err(chip->dev, 420 dev_err(chip->dev,
115 "tpm_transmit: tpm_recv: error %zd\n", rc); 421 "tpm_transmit: tpm_recv: error %zd\n", rc);
@@ -119,17 +425,247 @@ out:
119} 425}
120 426
121#define TPM_DIGEST_SIZE 20 427#define TPM_DIGEST_SIZE 20
122#define CAP_PCR_RESULT_SIZE 18 428#define TPM_ERROR_SIZE 10
123static const u8 cap_pcr[] = { 429#define TPM_RET_CODE_IDX 6
430#define TPM_GET_CAP_RET_SIZE_IDX 10
431#define TPM_GET_CAP_RET_UINT32_1_IDX 14
432#define TPM_GET_CAP_RET_UINT32_2_IDX 18
433#define TPM_GET_CAP_RET_UINT32_3_IDX 22
434#define TPM_GET_CAP_RET_UINT32_4_IDX 26
435#define TPM_GET_CAP_PERM_DISABLE_IDX 16
436#define TPM_GET_CAP_PERM_INACTIVE_IDX 18
437#define TPM_GET_CAP_RET_BOOL_1_IDX 14
438#define TPM_GET_CAP_TEMP_INACTIVE_IDX 16
439
440#define TPM_CAP_IDX 13
441#define TPM_CAP_SUBCAP_IDX 21
442
443enum tpm_capabilities {
444 TPM_CAP_FLAG = 4,
445 TPM_CAP_PROP = 5,
446};
447
448enum tpm_sub_capabilities {
449 TPM_CAP_PROP_PCR = 0x1,
450 TPM_CAP_PROP_MANUFACTURER = 0x3,
451 TPM_CAP_FLAG_PERM = 0x8,
452 TPM_CAP_FLAG_VOL = 0x9,
453 TPM_CAP_PROP_OWNER = 0x11,
454 TPM_CAP_PROP_TIS_TIMEOUT = 0x15,
455 TPM_CAP_PROP_TIS_DURATION = 0x20,
456};
457
458/*
459 * This is a semi generic GetCapability command for use
460 * with the capability type TPM_CAP_PROP or TPM_CAP_FLAG
461 * and their associated sub_capabilities.
462 */
463
464static const u8 tpm_cap[] = {
124 0, 193, /* TPM_TAG_RQU_COMMAND */ 465 0, 193, /* TPM_TAG_RQU_COMMAND */
125 0, 0, 0, 22, /* length */ 466 0, 0, 0, 22, /* length */
126 0, 0, 0, 101, /* TPM_ORD_GetCapability */ 467 0, 0, 0, 101, /* TPM_ORD_GetCapability */
127 0, 0, 0, 5, 468 0, 0, 0, 0, /* TPM_CAP_<TYPE> */
128 0, 0, 0, 4, 469 0, 0, 0, 4, /* TPM_CAP_SUB_<TYPE> size */
129 0, 0, 1, 1 470 0, 0, 1, 0 /* TPM_CAP_SUB_<TYPE> */
130}; 471};
131 472
132#define READ_PCR_RESULT_SIZE 30 473static ssize_t transmit_cmd(struct tpm_chip *chip, u8 *data, int len,
474 char *desc)
475{
476 int err;
477
478 len = tpm_transmit(chip, data, len);
479 if (len < 0)
480 return len;
481 if (len == TPM_ERROR_SIZE) {
482 err = be32_to_cpu(*((__be32 *) (data + TPM_RET_CODE_IDX)));
483 dev_dbg(chip->dev, "A TPM error (%d) occurred %s\n", err, desc);
484 return err;
485 }
486 return 0;
487}
488
489void tpm_gen_interrupt(struct tpm_chip *chip)
490{
491 u8 data[max_t(int, ARRAY_SIZE(tpm_cap), 30)];
492 ssize_t rc;
493
494 memcpy(data, tpm_cap, sizeof(tpm_cap));
495 data[TPM_CAP_IDX] = TPM_CAP_PROP;
496 data[TPM_CAP_SUBCAP_IDX] = TPM_CAP_PROP_TIS_TIMEOUT;
497
498 rc = transmit_cmd(chip, data, sizeof(data),
499 "attempting to determine the timeouts");
500}
501EXPORT_SYMBOL_GPL(tpm_gen_interrupt);
502
503void tpm_get_timeouts(struct tpm_chip *chip)
504{
505 u8 data[max_t(int, ARRAY_SIZE(tpm_cap), 30)];
506 ssize_t rc;
507 u32 timeout;
508
509 memcpy(data, tpm_cap, sizeof(tpm_cap));
510 data[TPM_CAP_IDX] = TPM_CAP_PROP;
511 data[TPM_CAP_SUBCAP_IDX] = TPM_CAP_PROP_TIS_TIMEOUT;
512
513 rc = transmit_cmd(chip, data, sizeof(data),
514 "attempting to determine the timeouts");
515 if (rc)
516 goto duration;
517
518 if (be32_to_cpu(*((__be32 *) (data + TPM_GET_CAP_RET_SIZE_IDX)))
519 != 4 * sizeof(u32))
520 goto duration;
521
522 /* Don't overwrite default if value is 0 */
523 timeout =
524 be32_to_cpu(*((__be32 *) (data + TPM_GET_CAP_RET_UINT32_1_IDX)));
525 if (timeout)
526 chip->vendor.timeout_a = msecs_to_jiffies(timeout);
527 timeout =
528 be32_to_cpu(*((__be32 *) (data + TPM_GET_CAP_RET_UINT32_2_IDX)));
529 if (timeout)
530 chip->vendor.timeout_b = msecs_to_jiffies(timeout);
531 timeout =
532 be32_to_cpu(*((__be32 *) (data + TPM_GET_CAP_RET_UINT32_3_IDX)));
533 if (timeout)
534 chip->vendor.timeout_c = msecs_to_jiffies(timeout);
535 timeout =
536 be32_to_cpu(*((__be32 *) (data + TPM_GET_CAP_RET_UINT32_4_IDX)));
537 if (timeout)
538 chip->vendor.timeout_d = msecs_to_jiffies(timeout);
539
540duration:
541 memcpy(data, tpm_cap, sizeof(tpm_cap));
542 data[TPM_CAP_IDX] = TPM_CAP_PROP;
543 data[TPM_CAP_SUBCAP_IDX] = TPM_CAP_PROP_TIS_DURATION;
544
545 rc = transmit_cmd(chip, data, sizeof(data),
546 "attempting to determine the durations");
547 if (rc)
548 return;
549
550 if (be32_to_cpu(*((__be32 *) (data + TPM_GET_CAP_RET_SIZE_IDX)))
551 != 3 * sizeof(u32))
552 return;
553
554 chip->vendor.duration[TPM_SHORT] =
555 msecs_to_jiffies(be32_to_cpu
556 (*((__be32 *) (data +
557 TPM_GET_CAP_RET_UINT32_1_IDX))));
558 chip->vendor.duration[TPM_MEDIUM] =
559 msecs_to_jiffies(be32_to_cpu
560 (*((__be32 *) (data +
561 TPM_GET_CAP_RET_UINT32_2_IDX))));
562 chip->vendor.duration[TPM_LONG] =
563 msecs_to_jiffies(be32_to_cpu
564 (*((__be32 *) (data +
565 TPM_GET_CAP_RET_UINT32_3_IDX))));
566}
567EXPORT_SYMBOL_GPL(tpm_get_timeouts);
568
569void tpm_continue_selftest(struct tpm_chip *chip)
570{
571 u8 data[] = {
572 0, 193, /* TPM_TAG_RQU_COMMAND */
573 0, 0, 0, 10, /* length */
574 0, 0, 0, 83, /* TPM_ORD_GetCapability */
575 };
576
577 tpm_transmit(chip, data, sizeof(data));
578}
579EXPORT_SYMBOL_GPL(tpm_continue_selftest);
580
581ssize_t tpm_show_enabled(struct device * dev, struct device_attribute * attr,
582 char *buf)
583{
584 u8 data[max_t(int, ARRAY_SIZE(tpm_cap), 35)];
585 ssize_t rc;
586
587 struct tpm_chip *chip = dev_get_drvdata(dev);
588 if (chip == NULL)
589 return -ENODEV;
590
591 memcpy(data, tpm_cap, sizeof(tpm_cap));
592 data[TPM_CAP_IDX] = TPM_CAP_FLAG;
593 data[TPM_CAP_SUBCAP_IDX] = TPM_CAP_FLAG_PERM;
594
595 rc = transmit_cmd(chip, data, sizeof(data),
596 "attemtping to determine the permanent state");
597 if (rc)
598 return 0;
599 return sprintf(buf, "%d\n", !data[TPM_GET_CAP_PERM_DISABLE_IDX]);
600}
601EXPORT_SYMBOL_GPL(tpm_show_enabled);
602
603ssize_t tpm_show_active(struct device * dev, struct device_attribute * attr,
604 char *buf)
605{
606 u8 data[max_t(int, ARRAY_SIZE(tpm_cap), 35)];
607 ssize_t rc;
608
609 struct tpm_chip *chip = dev_get_drvdata(dev);
610 if (chip == NULL)
611 return -ENODEV;
612
613 memcpy(data, tpm_cap, sizeof(tpm_cap));
614 data[TPM_CAP_IDX] = TPM_CAP_FLAG;
615 data[TPM_CAP_SUBCAP_IDX] = TPM_CAP_FLAG_PERM;
616
617 rc = transmit_cmd(chip, data, sizeof(data),
618 "attemtping to determine the permanent state");
619 if (rc)
620 return 0;
621 return sprintf(buf, "%d\n", !data[TPM_GET_CAP_PERM_INACTIVE_IDX]);
622}
623EXPORT_SYMBOL_GPL(tpm_show_active);
624
625ssize_t tpm_show_owned(struct device * dev, struct device_attribute * attr,
626 char *buf)
627{
628 u8 data[sizeof(tpm_cap)];
629 ssize_t rc;
630
631 struct tpm_chip *chip = dev_get_drvdata(dev);
632 if (chip == NULL)
633 return -ENODEV;
634
635 memcpy(data, tpm_cap, sizeof(tpm_cap));
636 data[TPM_CAP_IDX] = TPM_CAP_PROP;
637 data[TPM_CAP_SUBCAP_IDX] = TPM_CAP_PROP_OWNER;
638
639 rc = transmit_cmd(chip, data, sizeof(data),
640 "attempting to determine the owner state");
641 if (rc)
642 return 0;
643 return sprintf(buf, "%d\n", data[TPM_GET_CAP_RET_BOOL_1_IDX]);
644}
645EXPORT_SYMBOL_GPL(tpm_show_owned);
646
647ssize_t tpm_show_temp_deactivated(struct device * dev,
648 struct device_attribute * attr, char *buf)
649{
650 u8 data[sizeof(tpm_cap)];
651 ssize_t rc;
652
653 struct tpm_chip *chip = dev_get_drvdata(dev);
654 if (chip == NULL)
655 return -ENODEV;
656
657 memcpy(data, tpm_cap, sizeof(tpm_cap));
658 data[TPM_CAP_IDX] = TPM_CAP_FLAG;
659 data[TPM_CAP_SUBCAP_IDX] = TPM_CAP_FLAG_VOL;
660
661 rc = transmit_cmd(chip, data, sizeof(data),
662 "attempting to determine the temporary state");
663 if (rc)
664 return 0;
665 return sprintf(buf, "%d\n", data[TPM_GET_CAP_TEMP_INACTIVE_IDX]);
666}
667EXPORT_SYMBOL_GPL(tpm_show_temp_deactivated);
668
133static const u8 pcrread[] = { 669static const u8 pcrread[] = {
134 0, 193, /* TPM_TAG_RQU_COMMAND */ 670 0, 193, /* TPM_TAG_RQU_COMMAND */
135 0, 0, 0, 14, /* length */ 671 0, 0, 0, 14, /* length */
@@ -140,8 +676,8 @@ static const u8 pcrread[] = {
140ssize_t tpm_show_pcrs(struct device *dev, struct device_attribute *attr, 676ssize_t tpm_show_pcrs(struct device *dev, struct device_attribute *attr,
141 char *buf) 677 char *buf)
142{ 678{
143 u8 data[READ_PCR_RESULT_SIZE]; 679 u8 data[max_t(int, max(ARRAY_SIZE(tpm_cap), ARRAY_SIZE(pcrread)), 30)];
144 ssize_t len; 680 ssize_t rc;
145 int i, j, num_pcrs; 681 int i, j, num_pcrs;
146 __be32 index; 682 __be32 index;
147 char *str = buf; 683 char *str = buf;
@@ -150,29 +686,24 @@ ssize_t tpm_show_pcrs(struct device *dev, struct device_attribute *attr,
150 if (chip == NULL) 686 if (chip == NULL)
151 return -ENODEV; 687 return -ENODEV;
152 688
153 memcpy(data, cap_pcr, sizeof(cap_pcr)); 689 memcpy(data, tpm_cap, sizeof(tpm_cap));
154 if ((len = tpm_transmit(chip, data, sizeof(data))) 690 data[TPM_CAP_IDX] = TPM_CAP_PROP;
155 < CAP_PCR_RESULT_SIZE) { 691 data[TPM_CAP_SUBCAP_IDX] = TPM_CAP_PROP_PCR;
156 dev_dbg(chip->dev, "A TPM error (%d) occurred " 692
157 "attempting to determine the number of PCRS\n", 693 rc = transmit_cmd(chip, data, sizeof(data),
158 be32_to_cpu(*((__be32 *) (data + 6)))); 694 "attempting to determine the number of PCRS");
695 if (rc)
159 return 0; 696 return 0;
160 }
161 697
162 num_pcrs = be32_to_cpu(*((__be32 *) (data + 14))); 698 num_pcrs = be32_to_cpu(*((__be32 *) (data + 14)));
163
164 for (i = 0; i < num_pcrs; i++) { 699 for (i = 0; i < num_pcrs; i++) {
165 memcpy(data, pcrread, sizeof(pcrread)); 700 memcpy(data, pcrread, sizeof(pcrread));
166 index = cpu_to_be32(i); 701 index = cpu_to_be32(i);
167 memcpy(data + 10, &index, 4); 702 memcpy(data + 10, &index, 4);
168 if ((len = tpm_transmit(chip, data, sizeof(data))) 703 rc = transmit_cmd(chip, data, sizeof(data),
169 < READ_PCR_RESULT_SIZE){ 704 "attempting to read a PCR");
170 dev_dbg(chip->dev, "A TPM error (%d) occurred" 705 if (rc)
171 " attempting to read PCR %d of %d\n",
172 be32_to_cpu(*((__be32 *) (data + 6))),
173 i, num_pcrs);
174 goto out; 706 goto out;
175 }
176 str += sprintf(str, "PCR-%02d: ", i); 707 str += sprintf(str, "PCR-%02d: ", i);
177 for (j = 0; j < TPM_DIGEST_SIZE; j++) 708 for (j = 0; j < TPM_DIGEST_SIZE; j++)
178 str += sprintf(str, "%02X ", *(data + 10 + j)); 709 str += sprintf(str, "%02X ", *(data + 10 + j));
@@ -194,7 +725,7 @@ ssize_t tpm_show_pubek(struct device *dev, struct device_attribute *attr,
194 char *buf) 725 char *buf)
195{ 726{
196 u8 *data; 727 u8 *data;
197 ssize_t len; 728 ssize_t err;
198 int i, rc; 729 int i, rc;
199 char *str = buf; 730 char *str = buf;
200 731
@@ -208,14 +739,10 @@ ssize_t tpm_show_pubek(struct device *dev, struct device_attribute *attr,
208 739
209 memcpy(data, readpubek, sizeof(readpubek)); 740 memcpy(data, readpubek, sizeof(readpubek));
210 741
211 if ((len = tpm_transmit(chip, data, READ_PUBEK_RESULT_SIZE)) < 742 err = transmit_cmd(chip, data, READ_PUBEK_RESULT_SIZE,
212 READ_PUBEK_RESULT_SIZE) { 743 "attempting to read the PUBEK");
213 dev_dbg(chip->dev, "A TPM error (%d) occurred " 744 if (err)
214 "attempting to read the PUBEK\n",
215 be32_to_cpu(*((__be32 *) (data + 6))));
216 rc = 0;
217 goto out; 745 goto out;
218 }
219 746
220 /* 747 /*
221 ignore header 10 bytes 748 ignore header 10 bytes
@@ -245,67 +772,110 @@ ssize_t tpm_show_pubek(struct device *dev, struct device_attribute *attr,
245 if ((i + 1) % 16 == 0) 772 if ((i + 1) % 16 == 0)
246 str += sprintf(str, "\n"); 773 str += sprintf(str, "\n");
247 } 774 }
248 rc = str - buf;
249out: 775out:
776 rc = str - buf;
250 kfree(data); 777 kfree(data);
251 return rc; 778 return rc;
252} 779}
253EXPORT_SYMBOL_GPL(tpm_show_pubek); 780EXPORT_SYMBOL_GPL(tpm_show_pubek);
254 781
255#define CAP_VER_RESULT_SIZE 18 782#define CAP_VERSION_1_1 6
783#define CAP_VERSION_1_2 0x1A
784#define CAP_VERSION_IDX 13
256static const u8 cap_version[] = { 785static const u8 cap_version[] = {
257 0, 193, /* TPM_TAG_RQU_COMMAND */ 786 0, 193, /* TPM_TAG_RQU_COMMAND */
258 0, 0, 0, 18, /* length */ 787 0, 0, 0, 18, /* length */
259 0, 0, 0, 101, /* TPM_ORD_GetCapability */ 788 0, 0, 0, 101, /* TPM_ORD_GetCapability */
260 0, 0, 0, 6, 789 0, 0, 0, 0,
261 0, 0, 0, 0 790 0, 0, 0, 0
262}; 791};
263 792
264#define CAP_MANUFACTURER_RESULT_SIZE 18
265static const u8 cap_manufacturer[] = {
266 0, 193, /* TPM_TAG_RQU_COMMAND */
267 0, 0, 0, 22, /* length */
268 0, 0, 0, 101, /* TPM_ORD_GetCapability */
269 0, 0, 0, 5,
270 0, 0, 0, 4,
271 0, 0, 1, 3
272};
273
274ssize_t tpm_show_caps(struct device *dev, struct device_attribute *attr, 793ssize_t tpm_show_caps(struct device *dev, struct device_attribute *attr,
275 char *buf) 794 char *buf)
276{ 795{
277 u8 data[sizeof(cap_manufacturer)]; 796 u8 data[max_t(int, max(ARRAY_SIZE(tpm_cap), ARRAY_SIZE(cap_version)), 30)];
278 ssize_t len; 797 ssize_t rc;
279 char *str = buf; 798 char *str = buf;
280 799
281 struct tpm_chip *chip = dev_get_drvdata(dev); 800 struct tpm_chip *chip = dev_get_drvdata(dev);
282 if (chip == NULL) 801 if (chip == NULL)
283 return -ENODEV; 802 return -ENODEV;
284 803
285 memcpy(data, cap_manufacturer, sizeof(cap_manufacturer)); 804 memcpy(data, tpm_cap, sizeof(tpm_cap));
805 data[TPM_CAP_IDX] = TPM_CAP_PROP;
806 data[TPM_CAP_SUBCAP_IDX] = TPM_CAP_PROP_MANUFACTURER;
286 807
287 if ((len = tpm_transmit(chip, data, sizeof(data))) < 808 rc = transmit_cmd(chip, data, sizeof(data),
288 CAP_MANUFACTURER_RESULT_SIZE) 809 "attempting to determine the manufacturer");
289 return len; 810 if (rc)
811 return 0;
290 812
291 str += sprintf(str, "Manufacturer: 0x%x\n", 813 str += sprintf(str, "Manufacturer: 0x%x\n",
292 be32_to_cpu(*((__be32 *) (data + 14)))); 814 be32_to_cpu(*((__be32 *) (data + TPM_GET_CAP_RET_UINT32_1_IDX))));
293 815
294 memcpy(data, cap_version, sizeof(cap_version)); 816 memcpy(data, cap_version, sizeof(cap_version));
817 data[CAP_VERSION_IDX] = CAP_VERSION_1_1;
818 rc = transmit_cmd(chip, data, sizeof(data),
819 "attempting to determine the 1.1 version");
820 if (rc)
821 goto out;
295 822
296 if ((len = tpm_transmit(chip, data, sizeof(data))) < 823 str += sprintf(str,
297 CAP_VER_RESULT_SIZE) 824 "TCG version: %d.%d\nFirmware version: %d.%d\n",
298 return len; 825 (int) data[14], (int) data[15], (int) data[16],
299 826 (int) data[17]);
300 str +=
301 sprintf(str, "TCG version: %d.%d\nFirmware version: %d.%d\n",
302 (int) data[14], (int) data[15], (int) data[16],
303 (int) data[17]);
304 827
828out:
305 return str - buf; 829 return str - buf;
306} 830}
307EXPORT_SYMBOL_GPL(tpm_show_caps); 831EXPORT_SYMBOL_GPL(tpm_show_caps);
308 832
833ssize_t tpm_show_caps_1_2(struct device * dev,
834 struct device_attribute * attr, char *buf)
835{
836 u8 data[max_t(int, max(ARRAY_SIZE(tpm_cap), ARRAY_SIZE(cap_version)), 30)];
837 ssize_t len;
838 char *str = buf;
839
840 struct tpm_chip *chip = dev_get_drvdata(dev);
841 if (chip == NULL)
842 return -ENODEV;
843
844 memcpy(data, tpm_cap, sizeof(tpm_cap));
845 data[TPM_CAP_IDX] = TPM_CAP_PROP;
846 data[TPM_CAP_SUBCAP_IDX] = TPM_CAP_PROP_MANUFACTURER;
847
848 if ((len = tpm_transmit(chip, data, sizeof(data))) <=
849 TPM_ERROR_SIZE) {
850 dev_dbg(chip->dev, "A TPM error (%d) occurred "
851 "attempting to determine the manufacturer\n",
852 be32_to_cpu(*((__be32 *) (data + TPM_RET_CODE_IDX))));
853 return 0;
854 }
855
856 str += sprintf(str, "Manufacturer: 0x%x\n",
857 be32_to_cpu(*((__be32 *) (data + TPM_GET_CAP_RET_UINT32_1_IDX))));
858
859 memcpy(data, cap_version, sizeof(cap_version));
860 data[CAP_VERSION_IDX] = CAP_VERSION_1_2;
861
862 if ((len = tpm_transmit(chip, data, sizeof(data))) <=
863 TPM_ERROR_SIZE) {
864 dev_err(chip->dev, "A TPM error (%d) occurred "
865 "attempting to determine the 1.2 version\n",
866 be32_to_cpu(*((__be32 *) (data + TPM_RET_CODE_IDX))));
867 goto out;
868 }
869 str += sprintf(str,
870 "TCG version: %d.%d\nFirmware version: %d.%d\n",
871 (int) data[16], (int) data[17], (int) data[18],
872 (int) data[19]);
873
874out:
875 return str - buf;
876}
877EXPORT_SYMBOL_GPL(tpm_show_caps_1_2);
878
309ssize_t tpm_store_cancel(struct device *dev, struct device_attribute *attr, 879ssize_t tpm_store_cancel(struct device *dev, struct device_attribute *attr,
310 const char *buf, size_t count) 880 const char *buf, size_t count)
311{ 881{
@@ -313,7 +883,7 @@ ssize_t tpm_store_cancel(struct device *dev, struct device_attribute *attr,
313 if (chip == NULL) 883 if (chip == NULL)
314 return 0; 884 return 0;
315 885
316 chip->vendor->cancel(chip); 886 chip->vendor.cancel(chip);
317 return count; 887 return count;
318} 888}
319EXPORT_SYMBOL_GPL(tpm_store_cancel); 889EXPORT_SYMBOL_GPL(tpm_store_cancel);
@@ -329,7 +899,7 @@ int tpm_open(struct inode *inode, struct file *file)
329 spin_lock(&driver_lock); 899 spin_lock(&driver_lock);
330 900
331 list_for_each_entry(pos, &tpm_chip_list, list) { 901 list_for_each_entry(pos, &tpm_chip_list, list) {
332 if (pos->vendor->miscdev.minor == minor) { 902 if (pos->vendor.miscdev.minor == minor) {
333 chip = pos; 903 chip = pos;
334 break; 904 break;
335 } 905 }
@@ -387,7 +957,7 @@ int tpm_release(struct inode *inode, struct file *file)
387EXPORT_SYMBOL_GPL(tpm_release); 957EXPORT_SYMBOL_GPL(tpm_release);
388 958
389ssize_t tpm_write(struct file *file, const char __user *buf, 959ssize_t tpm_write(struct file *file, const char __user *buf,
390 size_t size, loff_t * off) 960 size_t size, loff_t *off)
391{ 961{
392 struct tpm_chip *chip = file->private_data; 962 struct tpm_chip *chip = file->private_data;
393 int in_size = size, out_size; 963 int in_size = size, out_size;
@@ -419,11 +989,10 @@ ssize_t tpm_write(struct file *file, const char __user *buf,
419 989
420 return in_size; 990 return in_size;
421} 991}
422
423EXPORT_SYMBOL_GPL(tpm_write); 992EXPORT_SYMBOL_GPL(tpm_write);
424 993
425ssize_t tpm_read(struct file * file, char __user *buf, 994ssize_t tpm_read(struct file *file, char __user *buf,
426 size_t size, loff_t * off) 995 size_t size, loff_t *off)
427{ 996{
428 struct tpm_chip *chip = file->private_data; 997 struct tpm_chip *chip = file->private_data;
429 int ret_size; 998 int ret_size;
@@ -462,14 +1031,13 @@ void tpm_remove_hardware(struct device *dev)
462 spin_unlock(&driver_lock); 1031 spin_unlock(&driver_lock);
463 1032
464 dev_set_drvdata(dev, NULL); 1033 dev_set_drvdata(dev, NULL);
465 misc_deregister(&chip->vendor->miscdev); 1034 misc_deregister(&chip->vendor.miscdev);
466 kfree(chip->vendor->miscdev.name); 1035 kfree(chip->vendor.miscdev.name);
467 1036
468 sysfs_remove_group(&dev->kobj, chip->vendor->attr_group); 1037 sysfs_remove_group(&dev->kobj, chip->vendor.attr_group);
469 tpm_bios_log_teardown(chip->bios_dir); 1038 tpm_bios_log_teardown(chip->bios_dir);
470 1039
471 dev_mask[chip->dev_num / TPM_NUM_MASK_ENTRIES ] &= 1040 clear_bit(chip->dev_num, dev_mask);
472 ~(1 << (chip->dev_num % TPM_NUM_MASK_ENTRIES));
473 1041
474 kfree(chip); 1042 kfree(chip);
475 1043
@@ -520,18 +1088,18 @@ EXPORT_SYMBOL_GPL(tpm_pm_resume);
520 * upon errant exit from this function specific probe function should call 1088 * upon errant exit from this function specific probe function should call
521 * pci_disable_device 1089 * pci_disable_device
522 */ 1090 */
523int tpm_register_hardware(struct device *dev, struct tpm_vendor_specific *entry) 1091struct tpm_chip *tpm_register_hardware(struct device *dev, const struct tpm_vendor_specific
1092 *entry)
524{ 1093{
525#define DEVNAME_SIZE 7 1094#define DEVNAME_SIZE 7
526 1095
527 char *devname; 1096 char *devname;
528 struct tpm_chip *chip; 1097 struct tpm_chip *chip;
529 int i, j;
530 1098
531 /* Driver specific per-device data */ 1099 /* Driver specific per-device data */
532 chip = kzalloc(sizeof(*chip), GFP_KERNEL); 1100 chip = kzalloc(sizeof(*chip), GFP_KERNEL);
533 if (chip == NULL) 1101 if (chip == NULL)
534 return -ENOMEM; 1102 return NULL;
535 1103
536 init_MUTEX(&chip->buffer_mutex); 1104 init_MUTEX(&chip->buffer_mutex);
537 init_MUTEX(&chip->tpm_mutex); 1105 init_MUTEX(&chip->tpm_mutex);
@@ -543,45 +1111,37 @@ int tpm_register_hardware(struct device *dev, struct tpm_vendor_specific *entry)
543 chip->user_read_timer.function = user_reader_timeout; 1111 chip->user_read_timer.function = user_reader_timeout;
544 chip->user_read_timer.data = (unsigned long) chip; 1112 chip->user_read_timer.data = (unsigned long) chip;
545 1113
546 chip->vendor = entry; 1114 memcpy(&chip->vendor, entry, sizeof(struct tpm_vendor_specific));
547
548 chip->dev_num = -1;
549 1115
550 for (i = 0; i < TPM_NUM_MASK_ENTRIES; i++) 1116 chip->dev_num = find_first_zero_bit(dev_mask, TPM_NUM_DEVICES);
551 for (j = 0; j < 8 * sizeof(int); j++)
552 if ((dev_mask[i] & (1 << j)) == 0) {
553 chip->dev_num =
554 i * TPM_NUM_MASK_ENTRIES + j;
555 dev_mask[i] |= 1 << j;
556 goto dev_num_search_complete;
557 }
558 1117
559dev_num_search_complete: 1118 if (chip->dev_num >= TPM_NUM_DEVICES) {
560 if (chip->dev_num < 0) {
561 dev_err(dev, "No available tpm device numbers\n"); 1119 dev_err(dev, "No available tpm device numbers\n");
562 kfree(chip); 1120 kfree(chip);
563 return -ENODEV; 1121 return NULL;
564 } else if (chip->dev_num == 0) 1122 } else if (chip->dev_num == 0)
565 chip->vendor->miscdev.minor = TPM_MINOR; 1123 chip->vendor.miscdev.minor = TPM_MINOR;
566 else 1124 else
567 chip->vendor->miscdev.minor = MISC_DYNAMIC_MINOR; 1125 chip->vendor.miscdev.minor = MISC_DYNAMIC_MINOR;
1126
1127 set_bit(chip->dev_num, dev_mask);
568 1128
569 devname = kmalloc(DEVNAME_SIZE, GFP_KERNEL); 1129 devname = kmalloc(DEVNAME_SIZE, GFP_KERNEL);
570 scnprintf(devname, DEVNAME_SIZE, "%s%d", "tpm", chip->dev_num); 1130 scnprintf(devname, DEVNAME_SIZE, "%s%d", "tpm", chip->dev_num);
571 chip->vendor->miscdev.name = devname; 1131 chip->vendor.miscdev.name = devname;
572 1132
573 chip->vendor->miscdev.dev = dev; 1133 chip->vendor.miscdev.dev = dev;
574 chip->dev = get_device(dev); 1134 chip->dev = get_device(dev);
575 1135
576 if (misc_register(&chip->vendor->miscdev)) { 1136 if (misc_register(&chip->vendor.miscdev)) {
577 dev_err(chip->dev, 1137 dev_err(chip->dev,
578 "unable to misc_register %s, minor %d\n", 1138 "unable to misc_register %s, minor %d\n",
579 chip->vendor->miscdev.name, 1139 chip->vendor.miscdev.name,
580 chip->vendor->miscdev.minor); 1140 chip->vendor.miscdev.minor);
581 put_device(dev); 1141 put_device(dev);
1142 clear_bit(chip->dev_num, dev_mask);
582 kfree(chip); 1143 kfree(chip);
583 dev_mask[i] &= !(1 << j); 1144 return NULL;
584 return -ENODEV;
585 } 1145 }
586 1146
587 spin_lock(&driver_lock); 1147 spin_lock(&driver_lock);
@@ -592,11 +1152,11 @@ dev_num_search_complete:
592 1152
593 spin_unlock(&driver_lock); 1153 spin_unlock(&driver_lock);
594 1154
595 sysfs_create_group(&dev->kobj, chip->vendor->attr_group); 1155 sysfs_create_group(&dev->kobj, chip->vendor.attr_group);
596 1156
597 chip->bios_dir = tpm_bios_log_setup(devname); 1157 chip->bios_dir = tpm_bios_log_setup(devname);
598 1158
599 return 0; 1159 return chip;
600} 1160}
601EXPORT_SYMBOL_GPL(tpm_register_hardware); 1161EXPORT_SYMBOL_GPL(tpm_register_hardware);
602 1162
diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
index dec0224b4478..050ced247f68 100644
--- a/drivers/char/tpm/tpm.h
+++ b/drivers/char/tpm/tpm.h
@@ -42,18 +42,30 @@ extern ssize_t tpm_show_pcrs(struct device *, struct device_attribute *attr,
42 char *); 42 char *);
43extern ssize_t tpm_show_caps(struct device *, struct device_attribute *attr, 43extern ssize_t tpm_show_caps(struct device *, struct device_attribute *attr,
44 char *); 44 char *);
45extern ssize_t tpm_show_caps_1_2(struct device *, struct device_attribute *attr,
46 char *);
45extern ssize_t tpm_store_cancel(struct device *, struct device_attribute *attr, 47extern ssize_t tpm_store_cancel(struct device *, struct device_attribute *attr,
46 const char *, size_t); 48 const char *, size_t);
49extern ssize_t tpm_show_enabled(struct device *, struct device_attribute *attr,
50 char *);
51extern ssize_t tpm_show_active(struct device *, struct device_attribute *attr,
52 char *);
53extern ssize_t tpm_show_owned(struct device *, struct device_attribute *attr,
54 char *);
55extern ssize_t tpm_show_temp_deactivated(struct device *,
56 struct device_attribute *attr, char *);
47 57
48struct tpm_chip; 58struct tpm_chip;
49 59
50struct tpm_vendor_specific { 60struct tpm_vendor_specific {
51 u8 req_complete_mask; 61 const u8 req_complete_mask;
52 u8 req_complete_val; 62 const u8 req_complete_val;
53 u8 req_canceled; 63 const u8 req_canceled;
54 void __iomem *iobase; /* ioremapped address */ 64 void __iomem *iobase; /* ioremapped address */
55 unsigned long base; /* TPM base address */ 65 unsigned long base; /* TPM base address */
56 66
67 int irq;
68
57 int region_size; 69 int region_size;
58 int have_region; 70 int have_region;
59 71
@@ -63,6 +75,13 @@ struct tpm_vendor_specific {
63 u8 (*status) (struct tpm_chip *); 75 u8 (*status) (struct tpm_chip *);
64 struct miscdevice miscdev; 76 struct miscdevice miscdev;
65 struct attribute_group *attr_group; 77 struct attribute_group *attr_group;
78 struct list_head list;
79 int locality;
80 unsigned long timeout_a, timeout_b, timeout_c, timeout_d; /* jiffies */
81 unsigned long duration[3]; /* jiffies */
82
83 wait_queue_head_t read_queue;
84 wait_queue_head_t int_queue;
66}; 85};
67 86
68struct tpm_chip { 87struct tpm_chip {
@@ -81,13 +100,15 @@ struct tpm_chip {
81 struct work_struct work; 100 struct work_struct work;
82 struct semaphore tpm_mutex; /* tpm is processing */ 101 struct semaphore tpm_mutex; /* tpm is processing */
83 102
84 struct tpm_vendor_specific *vendor; 103 struct tpm_vendor_specific vendor;
85 104
86 struct dentry **bios_dir; 105 struct dentry **bios_dir;
87 106
88 struct list_head list; 107 struct list_head list;
89}; 108};
90 109
110#define to_tpm_chip(n) container_of(n, struct tpm_chip, vendor)
111
91static inline int tpm_read_index(int base, int index) 112static inline int tpm_read_index(int base, int index)
92{ 113{
93 outb(index, base); 114 outb(index, base);
@@ -100,8 +121,12 @@ static inline void tpm_write_index(int base, int index, int value)
100 outb(value & 0xFF, base+1); 121 outb(value & 0xFF, base+1);
101} 122}
102 123
103extern int tpm_register_hardware(struct device *, 124extern void tpm_get_timeouts(struct tpm_chip *);
104 struct tpm_vendor_specific *); 125extern void tpm_gen_interrupt(struct tpm_chip *);
126extern void tpm_continue_selftest(struct tpm_chip *);
127extern unsigned long tpm_calc_ordinal_duration(struct tpm_chip *, u32);
128extern struct tpm_chip* tpm_register_hardware(struct device *,
129 const struct tpm_vendor_specific *);
105extern int tpm_open(struct inode *, struct file *); 130extern int tpm_open(struct inode *, struct file *);
106extern int tpm_release(struct inode *, struct file *); 131extern int tpm_release(struct inode *, struct file *);
107extern ssize_t tpm_write(struct file *, const char __user *, size_t, 132extern ssize_t tpm_write(struct file *, const char __user *, size_t,
@@ -115,7 +140,7 @@ extern int tpm_pm_resume(struct device *);
115extern struct dentry ** tpm_bios_log_setup(char *); 140extern struct dentry ** tpm_bios_log_setup(char *);
116extern void tpm_bios_log_teardown(struct dentry **); 141extern void tpm_bios_log_teardown(struct dentry **);
117#else 142#else
118static inline struct dentry* tpm_bios_log_setup(char *name) 143static inline struct dentry ** tpm_bios_log_setup(char *name)
119{ 144{
120 return NULL; 145 return NULL;
121} 146}
diff --git a/drivers/char/tpm/tpm_atmel.c b/drivers/char/tpm/tpm_atmel.c
index ff3654964fe3..58a258cec153 100644
--- a/drivers/char/tpm/tpm_atmel.c
+++ b/drivers/char/tpm/tpm_atmel.c
@@ -47,12 +47,12 @@ static int tpm_atml_recv(struct tpm_chip *chip, u8 *buf, size_t count)
47 return -EIO; 47 return -EIO;
48 48
49 for (i = 0; i < 6; i++) { 49 for (i = 0; i < 6; i++) {
50 status = ioread8(chip->vendor->iobase + 1); 50 status = ioread8(chip->vendor.iobase + 1);
51 if ((status & ATML_STATUS_DATA_AVAIL) == 0) { 51 if ((status & ATML_STATUS_DATA_AVAIL) == 0) {
52 dev_err(chip->dev, "error reading header\n"); 52 dev_err(chip->dev, "error reading header\n");
53 return -EIO; 53 return -EIO;
54 } 54 }
55 *buf++ = ioread8(chip->vendor->iobase); 55 *buf++ = ioread8(chip->vendor.iobase);
56 } 56 }
57 57
58 /* size of the data received */ 58 /* size of the data received */
@@ -63,7 +63,7 @@ static int tpm_atml_recv(struct tpm_chip *chip, u8 *buf, size_t count)
63 dev_err(chip->dev, 63 dev_err(chip->dev,
64 "Recv size(%d) less than available space\n", size); 64 "Recv size(%d) less than available space\n", size);
65 for (; i < size; i++) { /* clear the waiting data anyway */ 65 for (; i < size; i++) { /* clear the waiting data anyway */
66 status = ioread8(chip->vendor->iobase + 1); 66 status = ioread8(chip->vendor.iobase + 1);
67 if ((status & ATML_STATUS_DATA_AVAIL) == 0) { 67 if ((status & ATML_STATUS_DATA_AVAIL) == 0) {
68 dev_err(chip->dev, "error reading data\n"); 68 dev_err(chip->dev, "error reading data\n");
69 return -EIO; 69 return -EIO;
@@ -74,16 +74,16 @@ static int tpm_atml_recv(struct tpm_chip *chip, u8 *buf, size_t count)
74 74
75 /* read all the data available */ 75 /* read all the data available */
76 for (; i < size; i++) { 76 for (; i < size; i++) {
77 status = ioread8(chip->vendor->iobase + 1); 77 status = ioread8(chip->vendor.iobase + 1);
78 if ((status & ATML_STATUS_DATA_AVAIL) == 0) { 78 if ((status & ATML_STATUS_DATA_AVAIL) == 0) {
79 dev_err(chip->dev, "error reading data\n"); 79 dev_err(chip->dev, "error reading data\n");
80 return -EIO; 80 return -EIO;
81 } 81 }
82 *buf++ = ioread8(chip->vendor->iobase); 82 *buf++ = ioread8(chip->vendor.iobase);
83 } 83 }
84 84
85 /* make sure data available is gone */ 85 /* make sure data available is gone */
86 status = ioread8(chip->vendor->iobase + 1); 86 status = ioread8(chip->vendor.iobase + 1);
87 87
88 if (status & ATML_STATUS_DATA_AVAIL) { 88 if (status & ATML_STATUS_DATA_AVAIL) {
89 dev_err(chip->dev, "data available is stuck\n"); 89 dev_err(chip->dev, "data available is stuck\n");
@@ -100,7 +100,7 @@ static int tpm_atml_send(struct tpm_chip *chip, u8 *buf, size_t count)
100 dev_dbg(chip->dev, "tpm_atml_send:\n"); 100 dev_dbg(chip->dev, "tpm_atml_send:\n");
101 for (i = 0; i < count; i++) { 101 for (i = 0; i < count; i++) {
102 dev_dbg(chip->dev, "%d 0x%x(%d)\n", i, buf[i], buf[i]); 102 dev_dbg(chip->dev, "%d 0x%x(%d)\n", i, buf[i], buf[i]);
103 iowrite8(buf[i], chip->vendor->iobase); 103 iowrite8(buf[i], chip->vendor.iobase);
104 } 104 }
105 105
106 return count; 106 return count;
@@ -108,12 +108,12 @@ static int tpm_atml_send(struct tpm_chip *chip, u8 *buf, size_t count)
108 108
109static void tpm_atml_cancel(struct tpm_chip *chip) 109static void tpm_atml_cancel(struct tpm_chip *chip)
110{ 110{
111 iowrite8(ATML_STATUS_ABORT, chip->vendor->iobase + 1); 111 iowrite8(ATML_STATUS_ABORT, chip->vendor.iobase + 1);
112} 112}
113 113
114static u8 tpm_atml_status(struct tpm_chip *chip) 114static u8 tpm_atml_status(struct tpm_chip *chip)
115{ 115{
116 return ioread8(chip->vendor->iobase + 1); 116 return ioread8(chip->vendor.iobase + 1);
117} 117}
118 118
119static struct file_operations atmel_ops = { 119static struct file_operations atmel_ops = {
@@ -140,7 +140,7 @@ static struct attribute* atmel_attrs[] = {
140 140
141static struct attribute_group atmel_attr_grp = { .attrs = atmel_attrs }; 141static struct attribute_group atmel_attr_grp = { .attrs = atmel_attrs };
142 142
143static struct tpm_vendor_specific tpm_atmel = { 143static const struct tpm_vendor_specific tpm_atmel = {
144 .recv = tpm_atml_recv, 144 .recv = tpm_atml_recv,
145 .send = tpm_atml_send, 145 .send = tpm_atml_send,
146 .cancel = tpm_atml_cancel, 146 .cancel = tpm_atml_cancel,
@@ -159,10 +159,10 @@ static void atml_plat_remove(void)
159 struct tpm_chip *chip = dev_get_drvdata(&pdev->dev); 159 struct tpm_chip *chip = dev_get_drvdata(&pdev->dev);
160 160
161 if (chip) { 161 if (chip) {
162 if (chip->vendor->have_region) 162 if (chip->vendor.have_region)
163 atmel_release_region(chip->vendor->base, 163 atmel_release_region(chip->vendor.base,
164 chip->vendor->region_size); 164 chip->vendor.region_size);
165 atmel_put_base_addr(chip->vendor); 165 atmel_put_base_addr(chip->vendor.iobase);
166 tpm_remove_hardware(chip->dev); 166 tpm_remove_hardware(chip->dev);
167 platform_device_unregister(pdev); 167 platform_device_unregister(pdev);
168 } 168 }
@@ -179,18 +179,22 @@ static struct device_driver atml_drv = {
179static int __init init_atmel(void) 179static int __init init_atmel(void)
180{ 180{
181 int rc = 0; 181 int rc = 0;
182 void __iomem *iobase = NULL;
183 int have_region, region_size;
184 unsigned long base;
185 struct tpm_chip *chip;
182 186
183 driver_register(&atml_drv); 187 driver_register(&atml_drv);
184 188
185 if ((tpm_atmel.iobase = atmel_get_base_addr(&tpm_atmel)) == NULL) { 189 if ((iobase = atmel_get_base_addr(&base, &region_size)) == NULL) {
186 rc = -ENODEV; 190 rc = -ENODEV;
187 goto err_unreg_drv; 191 goto err_unreg_drv;
188 } 192 }
189 193
190 tpm_atmel.have_region = 194 have_region =
191 (atmel_request_region 195 (atmel_request_region
192 (tpm_atmel.base, tpm_atmel.region_size, 196 (tpm_atmel.base, region_size, "tpm_atmel0") == NULL) ? 0 : 1;
193 "tpm_atmel0") == NULL) ? 0 : 1; 197
194 198
195 if (IS_ERR 199 if (IS_ERR
196 (pdev = 200 (pdev =
@@ -199,17 +203,25 @@ static int __init init_atmel(void)
199 goto err_rel_reg; 203 goto err_rel_reg;
200 } 204 }
201 205
202 if ((rc = tpm_register_hardware(&pdev->dev, &tpm_atmel)) < 0) 206 if (!(chip = tpm_register_hardware(&pdev->dev, &tpm_atmel))) {
207 rc = -ENODEV;
203 goto err_unreg_dev; 208 goto err_unreg_dev;
209 }
210
211 chip->vendor.iobase = iobase;
212 chip->vendor.base = base;
213 chip->vendor.have_region = have_region;
214 chip->vendor.region_size = region_size;
215
204 return 0; 216 return 0;
205 217
206err_unreg_dev: 218err_unreg_dev:
207 platform_device_unregister(pdev); 219 platform_device_unregister(pdev);
208err_rel_reg: 220err_rel_reg:
209 atmel_put_base_addr(&tpm_atmel); 221 atmel_put_base_addr(iobase);
210 if (tpm_atmel.have_region) 222 if (have_region)
211 atmel_release_region(tpm_atmel.base, 223 atmel_release_region(base,
212 tpm_atmel.region_size); 224 region_size);
213err_unreg_drv: 225err_unreg_drv:
214 driver_unregister(&atml_drv); 226 driver_unregister(&atml_drv);
215 return rc; 227 return rc;
diff --git a/drivers/char/tpm/tpm_atmel.h b/drivers/char/tpm/tpm_atmel.h
index d3478aaadd77..2e68eeb8a2cd 100644
--- a/drivers/char/tpm/tpm_atmel.h
+++ b/drivers/char/tpm/tpm_atmel.h
@@ -28,13 +28,12 @@
28#define atmel_request_region request_mem_region 28#define atmel_request_region request_mem_region
29#define atmel_release_region release_mem_region 29#define atmel_release_region release_mem_region
30 30
31static inline void atmel_put_base_addr(struct tpm_vendor_specific 31static inline void atmel_put_base_addr(void __iomem *iobase)
32 *vendor)
33{ 32{
34 iounmap(vendor->iobase); 33 iounmap(iobase);
35} 34}
36 35
37static void __iomem * atmel_get_base_addr(struct tpm_vendor_specific *vendor) 36static void __iomem * atmel_get_base_addr(unsigned long *base, int *region_size)
38{ 37{
39 struct device_node *dn; 38 struct device_node *dn;
40 unsigned long address, size; 39 unsigned long address, size;
@@ -71,9 +70,9 @@ static void __iomem * atmel_get_base_addr(struct tpm_vendor_specific *vendor)
71 else 70 else
72 size = reg[naddrc]; 71 size = reg[naddrc];
73 72
74 vendor->base = address; 73 *base = address;
75 vendor->region_size = size; 74 *region_size = size;
76 return ioremap(vendor->base, vendor->region_size); 75 return ioremap(*base, *region_size);
77} 76}
78#else 77#else
79#define atmel_getb(chip, offset) inb(chip->vendor->base + offset) 78#define atmel_getb(chip, offset) inb(chip->vendor->base + offset)
@@ -106,14 +105,12 @@ static int atmel_verify_tpm11(void)
106 return 0; 105 return 0;
107} 106}
108 107
109static inline void atmel_put_base_addr(struct tpm_vendor_specific 108static inline void atmel_put_base_addr(void __iomem *iobase)
110 *vendor)
111{ 109{
112} 110}
113 111
114/* Determine where to talk to device */ 112/* Determine where to talk to device */
115static void __iomem * atmel_get_base_addr(struct tpm_vendor_specific 113static void __iomem * atmel_get_base_addr(unsigned long *base, int *region_size)
116 *vendor)
117{ 114{
118 int lo, hi; 115 int lo, hi;
119 116
@@ -123,9 +120,9 @@ static void __iomem * atmel_get_base_addr(struct tpm_vendor_specific
123 lo = tpm_read_index(TPM_ADDR, TPM_ATMEL_BASE_ADDR_LO); 120 lo = tpm_read_index(TPM_ADDR, TPM_ATMEL_BASE_ADDR_LO);
124 hi = tpm_read_index(TPM_ADDR, TPM_ATMEL_BASE_ADDR_HI); 121 hi = tpm_read_index(TPM_ADDR, TPM_ATMEL_BASE_ADDR_HI);
125 122
126 vendor->base = (hi << 8) | lo; 123 *base = (hi << 8) | lo;
127 vendor->region_size = 2; 124 *region_size = 2;
128 125
129 return ioport_map(vendor->base, vendor->region_size); 126 return ioport_map(*base, *region_size);
130} 127}
131#endif 128#endif
diff --git a/drivers/char/tpm/tpm_bios.c b/drivers/char/tpm/tpm_bios.c
index 537aa45d8c67..a611972024e6 100644
--- a/drivers/char/tpm/tpm_bios.c
+++ b/drivers/char/tpm/tpm_bios.c
@@ -29,6 +29,11 @@
29#define MAX_TEXT_EVENT 1000 /* Max event string length */ 29#define MAX_TEXT_EVENT 1000 /* Max event string length */
30#define ACPI_TCPA_SIG "TCPA" /* 0x41504354 /'TCPA' */ 30#define ACPI_TCPA_SIG "TCPA" /* 0x41504354 /'TCPA' */
31 31
32enum bios_platform_class {
33 BIOS_CLIENT = 0x00,
34 BIOS_SERVER = 0x01,
35};
36
32struct tpm_bios_log { 37struct tpm_bios_log {
33 void *bios_event_log; 38 void *bios_event_log;
34 void *bios_event_log_end; 39 void *bios_event_log_end;
@@ -36,9 +41,18 @@ struct tpm_bios_log {
36 41
37struct acpi_tcpa { 42struct acpi_tcpa {
38 struct acpi_table_header hdr; 43 struct acpi_table_header hdr;
39 u16 reserved; 44 u16 platform_class;
40 u32 log_max_len __attribute__ ((packed)); 45 union {
41 u32 log_start_addr __attribute__ ((packed)); 46 struct client_hdr {
47 u32 log_max_len __attribute__ ((packed));
48 u64 log_start_addr __attribute__ ((packed));
49 } client;
50 struct server_hdr {
51 u16 reserved;
52 u64 log_max_len __attribute__ ((packed));
53 u64 log_start_addr __attribute__ ((packed));
54 } server;
55 };
42}; 56};
43 57
44struct tcpa_event { 58struct tcpa_event {
@@ -91,6 +105,12 @@ static const char* tcpa_event_type_strings[] = {
91 "Non-Host Info" 105 "Non-Host Info"
92}; 106};
93 107
108struct tcpa_pc_event {
109 u32 event_id;
110 u32 event_size;
111 u8 event_data[0];
112};
113
94enum tcpa_pc_event_ids { 114enum tcpa_pc_event_ids {
95 SMBIOS = 1, 115 SMBIOS = 1,
96 BIS_CERT, 116 BIS_CERT,
@@ -100,14 +120,15 @@ enum tcpa_pc_event_ids {
100 NVRAM, 120 NVRAM,
101 OPTION_ROM_EXEC, 121 OPTION_ROM_EXEC,
102 OPTION_ROM_CONFIG, 122 OPTION_ROM_CONFIG,
103 OPTION_ROM_MICROCODE, 123 OPTION_ROM_MICROCODE = 10,
104 S_CRTM_VERSION, 124 S_CRTM_VERSION,
105 S_CRTM_CONTENTS, 125 S_CRTM_CONTENTS,
106 POST_CONTENTS, 126 POST_CONTENTS,
127 HOST_TABLE_OF_DEVICES,
107}; 128};
108 129
109static const char* tcpa_pc_event_id_strings[] = { 130static const char* tcpa_pc_event_id_strings[] = {
110 "" 131 "",
111 "SMBIOS", 132 "SMBIOS",
112 "BIS Certificate", 133 "BIS Certificate",
113 "POST BIOS ", 134 "POST BIOS ",
@@ -116,10 +137,12 @@ static const char* tcpa_pc_event_id_strings[] = {
116 "NVRAM", 137 "NVRAM",
117 "Option ROM", 138 "Option ROM",
118 "Option ROM config", 139 "Option ROM config",
119 "Option ROM microcode", 140 "",
141 "Option ROM microcode ",
120 "S-CRTM Version", 142 "S-CRTM Version",
121 "S-CRTM Contents", 143 "S-CRTM Contents ",
122 "S-CRTM POST Contents", 144 "POST Contents ",
145 "Table of Devices",
123}; 146};
124 147
125/* returns pointer to start of pos. entry of tcg log */ 148/* returns pointer to start of pos. entry of tcg log */
@@ -191,7 +214,7 @@ static int get_event_name(char *dest, struct tcpa_event *event,
191 const char *name = ""; 214 const char *name = "";
192 char data[40] = ""; 215 char data[40] = "";
193 int i, n_len = 0, d_len = 0; 216 int i, n_len = 0, d_len = 0;
194 u32 event_id; 217 struct tcpa_pc_event *pc_event;
195 218
196 switch(event->event_type) { 219 switch(event->event_type) {
197 case PREBOOT: 220 case PREBOOT:
@@ -220,31 +243,32 @@ static int get_event_name(char *dest, struct tcpa_event *event,
220 } 243 }
221 break; 244 break;
222 case EVENT_TAG: 245 case EVENT_TAG:
223 event_id = be32_to_cpu(*((u32 *)event_entry)); 246 pc_event = (struct tcpa_pc_event *)event_entry;
224 247
225 /* ToDo Row data -> Base64 */ 248 /* ToDo Row data -> Base64 */
226 249
227 switch (event_id) { 250 switch (pc_event->event_id) {
228 case SMBIOS: 251 case SMBIOS:
229 case BIS_CERT: 252 case BIS_CERT:
230 case CMOS: 253 case CMOS:
231 case NVRAM: 254 case NVRAM:
232 case OPTION_ROM_EXEC: 255 case OPTION_ROM_EXEC:
233 case OPTION_ROM_CONFIG: 256 case OPTION_ROM_CONFIG:
234 case OPTION_ROM_MICROCODE:
235 case S_CRTM_VERSION: 257 case S_CRTM_VERSION:
236 case S_CRTM_CONTENTS: 258 name = tcpa_pc_event_id_strings[pc_event->event_id];
237 case POST_CONTENTS:
238 name = tcpa_pc_event_id_strings[event_id];
239 n_len = strlen(name); 259 n_len = strlen(name);
240 break; 260 break;
261 /* hash data */
241 case POST_BIOS_ROM: 262 case POST_BIOS_ROM:
242 case ESCD: 263 case ESCD:
243 name = tcpa_pc_event_id_strings[event_id]; 264 case OPTION_ROM_MICROCODE:
265 case S_CRTM_CONTENTS:
266 case POST_CONTENTS:
267 name = tcpa_pc_event_id_strings[pc_event->event_id];
244 n_len = strlen(name); 268 n_len = strlen(name);
245 for (i = 0; i < 20; i++) 269 for (i = 0; i < 20; i++)
246 d_len += sprintf(data, "%02x", 270 d_len += sprintf(&data[2*i], "%02x",
247 event_entry[8 + i]); 271 pc_event->event_data[i]);
248 break; 272 break;
249 default: 273 default:
250 break; 274 break;
@@ -260,52 +284,13 @@ static int get_event_name(char *dest, struct tcpa_event *event,
260 284
261static int tpm_binary_bios_measurements_show(struct seq_file *m, void *v) 285static int tpm_binary_bios_measurements_show(struct seq_file *m, void *v)
262{ 286{
287 struct tcpa_event *event = v;
288 char *data = v;
289 int i;
263 290
264 char *eventname; 291 for (i = 0; i < sizeof(struct tcpa_event) + event->event_size; i++)
265 char data[4];
266 u32 help;
267 int i, len;
268 struct tcpa_event *event = (struct tcpa_event *) v;
269 unsigned char *event_entry =
270 (unsigned char *) (v + sizeof(struct tcpa_event));
271
272 eventname = kmalloc(MAX_TEXT_EVENT, GFP_KERNEL);
273 if (!eventname) {
274 printk(KERN_ERR "%s: ERROR - No Memory for event name\n ",
275 __func__);
276 return -ENOMEM;
277 }
278
279 /* 1st: PCR used is in little-endian format (4 bytes) */
280 help = le32_to_cpu(event->pcr_index);
281 memcpy(data, &help, 4);
282 for (i = 0; i < 4; i++)
283 seq_putc(m, data[i]);
284
285 /* 2nd: SHA1 (20 bytes) */
286 for (i = 0; i < 20; i++)
287 seq_putc(m, event->pcr_value[i]);
288
289 /* 3rd: event type identifier (4 bytes) */
290 help = le32_to_cpu(event->event_type);
291 memcpy(data, &help, 4);
292 for (i = 0; i < 4; i++)
293 seq_putc(m, data[i]); 292 seq_putc(m, data[i]);
294 293
295 len = 0;
296
297 len += get_event_name(eventname, event, event_entry);
298
299 /* 4th: filename <= 255 + \'0' delimiter */
300 if (len > TCG_EVENT_NAME_LEN_MAX)
301 len = TCG_EVENT_NAME_LEN_MAX;
302
303 for (i = 0; i < len; i++)
304 seq_putc(m, eventname[i]);
305
306 /* 5th: delimiter */
307 seq_putc(m, '\0');
308
309 return 0; 294 return 0;
310} 295}
311 296
@@ -353,6 +338,7 @@ static int tpm_ascii_bios_measurements_show(struct seq_file *m, void *v)
353 /* 4th: eventname <= max + \'0' delimiter */ 338 /* 4th: eventname <= max + \'0' delimiter */
354 seq_printf(m, " %s\n", eventname); 339 seq_printf(m, " %s\n", eventname);
355 340
341 kfree(eventname);
356 return 0; 342 return 0;
357} 343}
358 344
@@ -376,6 +362,7 @@ static int read_log(struct tpm_bios_log *log)
376 struct acpi_tcpa *buff; 362 struct acpi_tcpa *buff;
377 acpi_status status; 363 acpi_status status;
378 struct acpi_table_header *virt; 364 struct acpi_table_header *virt;
365 u64 len, start;
379 366
380 if (log->bios_event_log != NULL) { 367 if (log->bios_event_log != NULL) {
381 printk(KERN_ERR 368 printk(KERN_ERR
@@ -396,27 +383,37 @@ static int read_log(struct tpm_bios_log *log)
396 return -EIO; 383 return -EIO;
397 } 384 }
398 385
399 if (buff->log_max_len == 0) { 386 switch(buff->platform_class) {
387 case BIOS_SERVER:
388 len = buff->server.log_max_len;
389 start = buff->server.log_start_addr;
390 break;
391 case BIOS_CLIENT:
392 default:
393 len = buff->client.log_max_len;
394 start = buff->client.log_start_addr;
395 break;
396 }
397 if (!len) {
400 printk(KERN_ERR "%s: ERROR - TCPA log area empty\n", __func__); 398 printk(KERN_ERR "%s: ERROR - TCPA log area empty\n", __func__);
401 return -EIO; 399 return -EIO;
402 } 400 }
403 401
404 /* malloc EventLog space */ 402 /* malloc EventLog space */
405 log->bios_event_log = kmalloc(buff->log_max_len, GFP_KERNEL); 403 log->bios_event_log = kmalloc(len, GFP_KERNEL);
406 if (!log->bios_event_log) { 404 if (!log->bios_event_log) {
407 printk 405 printk("%s: ERROR - Not enough Memory for BIOS measurements\n",
408 ("%s: ERROR - Not enough Memory for BIOS measurements\n", 406 __func__);
409 __func__);
410 return -ENOMEM; 407 return -ENOMEM;
411 } 408 }
412 409
413 log->bios_event_log_end = log->bios_event_log + buff->log_max_len; 410 log->bios_event_log_end = log->bios_event_log + len;
414 411
415 acpi_os_map_memory(buff->log_start_addr, buff->log_max_len, (void *) &virt); 412 acpi_os_map_memory(start, len, (void *) &virt);
416 413
417 memcpy(log->bios_event_log, virt, buff->log_max_len); 414 memcpy(log->bios_event_log, virt, len);
418 415
419 acpi_os_unmap_memory(virt, buff->log_max_len); 416 acpi_os_unmap_memory(virt, len);
420 return 0; 417 return 0;
421} 418}
422 419
diff --git a/drivers/char/tpm/tpm_infineon.c b/drivers/char/tpm/tpm_infineon.c
index 24095f6ee6da..adfff21beb21 100644
--- a/drivers/char/tpm/tpm_infineon.c
+++ b/drivers/char/tpm/tpm_infineon.c
@@ -15,6 +15,7 @@
15 * License. 15 * License.
16 */ 16 */
17 17
18#include <linux/init.h>
18#include <linux/pnp.h> 19#include <linux/pnp.h>
19#include "tpm.h" 20#include "tpm.h"
20 21
@@ -104,7 +105,7 @@ static int empty_fifo(struct tpm_chip *chip, int clear_wrfifo)
104 105
105 if (clear_wrfifo) { 106 if (clear_wrfifo) {
106 for (i = 0; i < 4096; i++) { 107 for (i = 0; i < 4096; i++) {
107 status = inb(chip->vendor->base + WRFIFO); 108 status = inb(chip->vendor.base + WRFIFO);
108 if (status == 0xff) { 109 if (status == 0xff) {
109 if (check == 5) 110 if (check == 5)
110 break; 111 break;
@@ -124,8 +125,8 @@ static int empty_fifo(struct tpm_chip *chip, int clear_wrfifo)
124 */ 125 */
125 i = 0; 126 i = 0;
126 do { 127 do {
127 status = inb(chip->vendor->base + RDFIFO); 128 status = inb(chip->vendor.base + RDFIFO);
128 status = inb(chip->vendor->base + STAT); 129 status = inb(chip->vendor.base + STAT);
129 i++; 130 i++;
130 if (i == TPM_MAX_TRIES) 131 if (i == TPM_MAX_TRIES)
131 return -EIO; 132 return -EIO;
@@ -138,7 +139,7 @@ static int wait(struct tpm_chip *chip, int wait_for_bit)
138 int status; 139 int status;
139 int i; 140 int i;
140 for (i = 0; i < TPM_MAX_TRIES; i++) { 141 for (i = 0; i < TPM_MAX_TRIES; i++) {
141 status = inb(chip->vendor->base + STAT); 142 status = inb(chip->vendor.base + STAT);
142 /* check the status-register if wait_for_bit is set */ 143 /* check the status-register if wait_for_bit is set */
143 if (status & 1 << wait_for_bit) 144 if (status & 1 << wait_for_bit)
144 break; 145 break;
@@ -157,7 +158,7 @@ static int wait(struct tpm_chip *chip, int wait_for_bit)
157static void wait_and_send(struct tpm_chip *chip, u8 sendbyte) 158static void wait_and_send(struct tpm_chip *chip, u8 sendbyte)
158{ 159{
159 wait(chip, STAT_XFE); 160 wait(chip, STAT_XFE);
160 outb(sendbyte, chip->vendor->base + WRFIFO); 161 outb(sendbyte, chip->vendor.base + WRFIFO);
161} 162}
162 163
163 /* Note: WTX means Waiting-Time-Extension. Whenever the TPM needs more 164 /* Note: WTX means Waiting-Time-Extension. Whenever the TPM needs more
@@ -204,7 +205,7 @@ recv_begin:
204 ret = wait(chip, STAT_RDA); 205 ret = wait(chip, STAT_RDA);
205 if (ret) 206 if (ret)
206 return -EIO; 207 return -EIO;
207 buf[i] = inb(chip->vendor->base + RDFIFO); 208 buf[i] = inb(chip->vendor.base + RDFIFO);
208 } 209 }
209 210
210 if (buf[0] != TPM_VL_VER) { 211 if (buf[0] != TPM_VL_VER) {
@@ -219,7 +220,7 @@ recv_begin:
219 220
220 for (i = 0; i < size; i++) { 221 for (i = 0; i < size; i++) {
221 wait(chip, STAT_RDA); 222 wait(chip, STAT_RDA);
222 buf[i] = inb(chip->vendor->base + RDFIFO); 223 buf[i] = inb(chip->vendor.base + RDFIFO);
223 } 224 }
224 225
225 if ((size == 0x6D00) && (buf[1] == 0x80)) { 226 if ((size == 0x6D00) && (buf[1] == 0x80)) {
@@ -268,7 +269,7 @@ static int tpm_inf_send(struct tpm_chip *chip, u8 * buf, size_t count)
268 u8 count_high, count_low, count_4, count_3, count_2, count_1; 269 u8 count_high, count_low, count_4, count_3, count_2, count_1;
269 270
270 /* Disabling Reset, LP and IRQC */ 271 /* Disabling Reset, LP and IRQC */
271 outb(RESET_LP_IRQC_DISABLE, chip->vendor->base + CMD); 272 outb(RESET_LP_IRQC_DISABLE, chip->vendor.base + CMD);
272 273
273 ret = empty_fifo(chip, 1); 274 ret = empty_fifo(chip, 1);
274 if (ret) { 275 if (ret) {
@@ -319,7 +320,7 @@ static void tpm_inf_cancel(struct tpm_chip *chip)
319 320
320static u8 tpm_inf_status(struct tpm_chip *chip) 321static u8 tpm_inf_status(struct tpm_chip *chip)
321{ 322{
322 return inb(chip->vendor->base + STAT); 323 return inb(chip->vendor.base + STAT);
323} 324}
324 325
325static DEVICE_ATTR(pubek, S_IRUGO, tpm_show_pubek, NULL); 326static DEVICE_ATTR(pubek, S_IRUGO, tpm_show_pubek, NULL);
@@ -346,7 +347,7 @@ static struct file_operations inf_ops = {
346 .release = tpm_release, 347 .release = tpm_release,
347}; 348};
348 349
349static struct tpm_vendor_specific tpm_inf = { 350static const struct tpm_vendor_specific tpm_inf = {
350 .recv = tpm_inf_recv, 351 .recv = tpm_inf_recv,
351 .send = tpm_inf_send, 352 .send = tpm_inf_send,
352 .cancel = tpm_inf_cancel, 353 .cancel = tpm_inf_cancel,
@@ -375,6 +376,7 @@ static int __devinit tpm_inf_pnp_probe(struct pnp_dev *dev,
375 int version[2]; 376 int version[2];
376 int productid[2]; 377 int productid[2];
377 char chipname[20]; 378 char chipname[20];
379 struct tpm_chip *chip;
378 380
379 /* read IO-ports through PnP */ 381 /* read IO-ports through PnP */
380 if (pnp_port_valid(dev, 0) && pnp_port_valid(dev, 1) && 382 if (pnp_port_valid(dev, 0) && pnp_port_valid(dev, 1) &&
@@ -395,14 +397,13 @@ static int __devinit tpm_inf_pnp_probe(struct pnp_dev *dev,
395 goto err_last; 397 goto err_last;
396 } 398 }
397 /* publish my base address and request region */ 399 /* publish my base address and request region */
398 tpm_inf.base = TPM_INF_BASE;
399 if (request_region 400 if (request_region
400 (tpm_inf.base, TPM_INF_PORT_LEN, "tpm_infineon0") == NULL) { 401 (TPM_INF_BASE, TPM_INF_PORT_LEN, "tpm_infineon0") == NULL) {
401 rc = -EINVAL; 402 rc = -EINVAL;
402 goto err_last; 403 goto err_last;
403 } 404 }
404 if (request_region(TPM_INF_ADDR, TPM_INF_ADDR_LEN, 405 if (request_region
405 "tpm_infineon0") == NULL) { 406 (TPM_INF_ADDR, TPM_INF_ADDR_LEN, "tpm_infineon0") == NULL) {
406 rc = -EINVAL; 407 rc = -EINVAL;
407 goto err_last; 408 goto err_last;
408 } 409 }
@@ -442,9 +443,9 @@ static int __devinit tpm_inf_pnp_probe(struct pnp_dev *dev,
442 443
443 /* configure TPM with IO-ports */ 444 /* configure TPM with IO-ports */
444 outb(IOLIMH, TPM_INF_ADDR); 445 outb(IOLIMH, TPM_INF_ADDR);
445 outb(((tpm_inf.base >> 8) & 0xff), TPM_INF_DATA); 446 outb(((TPM_INF_BASE >> 8) & 0xff), TPM_INF_DATA);
446 outb(IOLIML, TPM_INF_ADDR); 447 outb(IOLIML, TPM_INF_ADDR);
447 outb((tpm_inf.base & 0xff), TPM_INF_DATA); 448 outb((TPM_INF_BASE & 0xff), TPM_INF_DATA);
448 449
449 /* control if IO-ports are set correctly */ 450 /* control if IO-ports are set correctly */
450 outb(IOLIMH, TPM_INF_ADDR); 451 outb(IOLIMH, TPM_INF_ADDR);
@@ -452,10 +453,10 @@ static int __devinit tpm_inf_pnp_probe(struct pnp_dev *dev,
452 outb(IOLIML, TPM_INF_ADDR); 453 outb(IOLIML, TPM_INF_ADDR);
453 iol = inb(TPM_INF_DATA); 454 iol = inb(TPM_INF_DATA);
454 455
455 if ((ioh << 8 | iol) != tpm_inf.base) { 456 if ((ioh << 8 | iol) != TPM_INF_BASE) {
456 dev_err(&dev->dev, 457 dev_err(&dev->dev,
457 "Could not set IO-ports to 0x%lx\n", 458 "Could not set IO-ports to 0x%x\n",
458 tpm_inf.base); 459 TPM_INF_BASE);
459 rc = -EIO; 460 rc = -EIO;
460 goto err_release_region; 461 goto err_release_region;
461 } 462 }
@@ -466,15 +467,15 @@ static int __devinit tpm_inf_pnp_probe(struct pnp_dev *dev,
466 outb(DISABLE_REGISTER_PAIR, TPM_INF_ADDR); 467 outb(DISABLE_REGISTER_PAIR, TPM_INF_ADDR);
467 468
468 /* disable RESET, LP and IRQC */ 469 /* disable RESET, LP and IRQC */
469 outb(RESET_LP_IRQC_DISABLE, tpm_inf.base + CMD); 470 outb(RESET_LP_IRQC_DISABLE, TPM_INF_BASE + CMD);
470 471
471 /* Finally, we're done, print some infos */ 472 /* Finally, we're done, print some infos */
472 dev_info(&dev->dev, "TPM found: " 473 dev_info(&dev->dev, "TPM found: "
473 "config base 0x%x, " 474 "config base 0x%x, "
474 "io base 0x%x, " 475 "io base 0x%x, "
475 "chip version %02x%02x, " 476 "chip version 0x%02x%02x, "
476 "vendor id %x%x (Infineon), " 477 "vendor id 0x%x%x (Infineon), "
477 "product id %02x%02x" 478 "product id 0x%02x%02x"
478 "%s\n", 479 "%s\n",
479 TPM_INF_ADDR, 480 TPM_INF_ADDR,
480 TPM_INF_BASE, 481 TPM_INF_BASE,
@@ -482,11 +483,10 @@ static int __devinit tpm_inf_pnp_probe(struct pnp_dev *dev,
482 vendorid[0], vendorid[1], 483 vendorid[0], vendorid[1],
483 productid[0], productid[1], chipname); 484 productid[0], productid[1], chipname);
484 485
485 rc = tpm_register_hardware(&dev->dev, &tpm_inf); 486 if (!(chip = tpm_register_hardware(&dev->dev, &tpm_inf))) {
486 if (rc < 0) {
487 rc = -ENODEV;
488 goto err_release_region; 487 goto err_release_region;
489 } 488 }
489 chip->vendor.base = TPM_INF_BASE;
490 return 0; 490 return 0;
491 } else { 491 } else {
492 rc = -ENODEV; 492 rc = -ENODEV;
@@ -494,7 +494,7 @@ static int __devinit tpm_inf_pnp_probe(struct pnp_dev *dev,
494 } 494 }
495 495
496err_release_region: 496err_release_region:
497 release_region(tpm_inf.base, TPM_INF_PORT_LEN); 497 release_region(TPM_INF_BASE, TPM_INF_PORT_LEN);
498 release_region(TPM_INF_ADDR, TPM_INF_ADDR_LEN); 498 release_region(TPM_INF_ADDR, TPM_INF_ADDR_LEN);
499 499
500err_last: 500err_last:
@@ -506,7 +506,8 @@ static __devexit void tpm_inf_pnp_remove(struct pnp_dev *dev)
506 struct tpm_chip *chip = pnp_get_drvdata(dev); 506 struct tpm_chip *chip = pnp_get_drvdata(dev);
507 507
508 if (chip) { 508 if (chip) {
509 release_region(chip->vendor->base, TPM_INF_PORT_LEN); 509 release_region(TPM_INF_BASE, TPM_INF_PORT_LEN);
510 release_region(TPM_INF_ADDR, TPM_INF_ADDR_LEN);
510 tpm_remove_hardware(chip->dev); 511 tpm_remove_hardware(chip->dev);
511 } 512 }
512} 513}
@@ -520,7 +521,7 @@ static struct pnp_driver tpm_inf_pnp = {
520 }, 521 },
521 .id_table = tpm_pnp_tbl, 522 .id_table = tpm_pnp_tbl,
522 .probe = tpm_inf_pnp_probe, 523 .probe = tpm_inf_pnp_probe,
523 .remove = tpm_inf_pnp_remove, 524 .remove = __devexit_p(tpm_inf_pnp_remove),
524}; 525};
525 526
526static int __init init_inf(void) 527static int __init init_inf(void)
@@ -538,5 +539,5 @@ module_exit(cleanup_inf);
538 539
539MODULE_AUTHOR("Marcel Selhorst <selhorst@crypto.rub.de>"); 540MODULE_AUTHOR("Marcel Selhorst <selhorst@crypto.rub.de>");
540MODULE_DESCRIPTION("Driver for Infineon TPM SLD 9630 TT 1.1 / SLB 9635 TT 1.2"); 541MODULE_DESCRIPTION("Driver for Infineon TPM SLD 9630 TT 1.1 / SLB 9635 TT 1.2");
541MODULE_VERSION("1.7"); 542MODULE_VERSION("1.8");
542MODULE_LICENSE("GPL"); 543MODULE_LICENSE("GPL");
diff --git a/drivers/char/tpm/tpm_nsc.c b/drivers/char/tpm/tpm_nsc.c
index 680a8e331887..4c8bc06c7d95 100644
--- a/drivers/char/tpm/tpm_nsc.c
+++ b/drivers/char/tpm/tpm_nsc.c
@@ -71,7 +71,7 @@ static int wait_for_stat(struct tpm_chip *chip, u8 mask, u8 val, u8 * data)
71 unsigned long stop; 71 unsigned long stop;
72 72
73 /* status immediately available check */ 73 /* status immediately available check */
74 *data = inb(chip->vendor->base + NSC_STATUS); 74 *data = inb(chip->vendor.base + NSC_STATUS);
75 if ((*data & mask) == val) 75 if ((*data & mask) == val)
76 return 0; 76 return 0;
77 77
@@ -79,7 +79,7 @@ static int wait_for_stat(struct tpm_chip *chip, u8 mask, u8 val, u8 * data)
79 stop = jiffies + 10 * HZ; 79 stop = jiffies + 10 * HZ;
80 do { 80 do {
81 msleep(TPM_TIMEOUT); 81 msleep(TPM_TIMEOUT);
82 *data = inb(chip->vendor->base + 1); 82 *data = inb(chip->vendor.base + 1);
83 if ((*data & mask) == val) 83 if ((*data & mask) == val)
84 return 0; 84 return 0;
85 } 85 }
@@ -94,9 +94,9 @@ static int nsc_wait_for_ready(struct tpm_chip *chip)
94 unsigned long stop; 94 unsigned long stop;
95 95
96 /* status immediately available check */ 96 /* status immediately available check */
97 status = inb(chip->vendor->base + NSC_STATUS); 97 status = inb(chip->vendor.base + NSC_STATUS);
98 if (status & NSC_STATUS_OBF) 98 if (status & NSC_STATUS_OBF)
99 status = inb(chip->vendor->base + NSC_DATA); 99 status = inb(chip->vendor.base + NSC_DATA);
100 if (status & NSC_STATUS_RDY) 100 if (status & NSC_STATUS_RDY)
101 return 0; 101 return 0;
102 102
@@ -104,9 +104,9 @@ static int nsc_wait_for_ready(struct tpm_chip *chip)
104 stop = jiffies + 100; 104 stop = jiffies + 100;
105 do { 105 do {
106 msleep(TPM_TIMEOUT); 106 msleep(TPM_TIMEOUT);
107 status = inb(chip->vendor->base + NSC_STATUS); 107 status = inb(chip->vendor.base + NSC_STATUS);
108 if (status & NSC_STATUS_OBF) 108 if (status & NSC_STATUS_OBF)
109 status = inb(chip->vendor->base + NSC_DATA); 109 status = inb(chip->vendor.base + NSC_DATA);
110 if (status & NSC_STATUS_RDY) 110 if (status & NSC_STATUS_RDY)
111 return 0; 111 return 0;
112 } 112 }
@@ -132,7 +132,7 @@ static int tpm_nsc_recv(struct tpm_chip *chip, u8 * buf, size_t count)
132 return -EIO; 132 return -EIO;
133 } 133 }
134 if ((data = 134 if ((data =
135 inb(chip->vendor->base + NSC_DATA)) != NSC_COMMAND_NORMAL) { 135 inb(chip->vendor.base + NSC_DATA)) != NSC_COMMAND_NORMAL) {
136 dev_err(chip->dev, "not in normal mode (0x%x)\n", 136 dev_err(chip->dev, "not in normal mode (0x%x)\n",
137 data); 137 data);
138 return -EIO; 138 return -EIO;
@@ -148,7 +148,7 @@ static int tpm_nsc_recv(struct tpm_chip *chip, u8 * buf, size_t count)
148 } 148 }
149 if (data & NSC_STATUS_F0) 149 if (data & NSC_STATUS_F0)
150 break; 150 break;
151 *p = inb(chip->vendor->base + NSC_DATA); 151 *p = inb(chip->vendor.base + NSC_DATA);
152 } 152 }
153 153
154 if ((data & NSC_STATUS_F0) == 0 && 154 if ((data & NSC_STATUS_F0) == 0 &&
@@ -156,7 +156,7 @@ static int tpm_nsc_recv(struct tpm_chip *chip, u8 * buf, size_t count)
156 dev_err(chip->dev, "F0 not set\n"); 156 dev_err(chip->dev, "F0 not set\n");
157 return -EIO; 157 return -EIO;
158 } 158 }
159 if ((data = inb(chip->vendor->base + NSC_DATA)) != NSC_COMMAND_EOC) { 159 if ((data = inb(chip->vendor.base + NSC_DATA)) != NSC_COMMAND_EOC) {
160 dev_err(chip->dev, 160 dev_err(chip->dev,
161 "expected end of command(0x%x)\n", data); 161 "expected end of command(0x%x)\n", data);
162 return -EIO; 162 return -EIO;
@@ -182,7 +182,7 @@ static int tpm_nsc_send(struct tpm_chip *chip, u8 * buf, size_t count)
182 * fix it. Not sure why this is needed, we followed the flow 182 * fix it. Not sure why this is needed, we followed the flow
183 * chart in the manual to the letter. 183 * chart in the manual to the letter.
184 */ 184 */
185 outb(NSC_COMMAND_CANCEL, chip->vendor->base + NSC_COMMAND); 185 outb(NSC_COMMAND_CANCEL, chip->vendor.base + NSC_COMMAND);
186 186
187 if (nsc_wait_for_ready(chip) != 0) 187 if (nsc_wait_for_ready(chip) != 0)
188 return -EIO; 188 return -EIO;
@@ -192,7 +192,7 @@ static int tpm_nsc_send(struct tpm_chip *chip, u8 * buf, size_t count)
192 return -EIO; 192 return -EIO;
193 } 193 }
194 194
195 outb(NSC_COMMAND_NORMAL, chip->vendor->base + NSC_COMMAND); 195 outb(NSC_COMMAND_NORMAL, chip->vendor.base + NSC_COMMAND);
196 if (wait_for_stat(chip, NSC_STATUS_IBR, NSC_STATUS_IBR, &data) < 0) { 196 if (wait_for_stat(chip, NSC_STATUS_IBR, NSC_STATUS_IBR, &data) < 0) {
197 dev_err(chip->dev, "IBR timeout\n"); 197 dev_err(chip->dev, "IBR timeout\n");
198 return -EIO; 198 return -EIO;
@@ -204,26 +204,26 @@ static int tpm_nsc_send(struct tpm_chip *chip, u8 * buf, size_t count)
204 "IBF timeout (while writing data)\n"); 204 "IBF timeout (while writing data)\n");
205 return -EIO; 205 return -EIO;
206 } 206 }
207 outb(buf[i], chip->vendor->base + NSC_DATA); 207 outb(buf[i], chip->vendor.base + NSC_DATA);
208 } 208 }
209 209
210 if (wait_for_stat(chip, NSC_STATUS_IBF, 0, &data) < 0) { 210 if (wait_for_stat(chip, NSC_STATUS_IBF, 0, &data) < 0) {
211 dev_err(chip->dev, "IBF timeout\n"); 211 dev_err(chip->dev, "IBF timeout\n");
212 return -EIO; 212 return -EIO;
213 } 213 }
214 outb(NSC_COMMAND_EOC, chip->vendor->base + NSC_COMMAND); 214 outb(NSC_COMMAND_EOC, chip->vendor.base + NSC_COMMAND);
215 215
216 return count; 216 return count;
217} 217}
218 218
219static void tpm_nsc_cancel(struct tpm_chip *chip) 219static void tpm_nsc_cancel(struct tpm_chip *chip)
220{ 220{
221 outb(NSC_COMMAND_CANCEL, chip->vendor->base + NSC_COMMAND); 221 outb(NSC_COMMAND_CANCEL, chip->vendor.base + NSC_COMMAND);
222} 222}
223 223
224static u8 tpm_nsc_status(struct tpm_chip *chip) 224static u8 tpm_nsc_status(struct tpm_chip *chip)
225{ 225{
226 return inb(chip->vendor->base + NSC_STATUS); 226 return inb(chip->vendor.base + NSC_STATUS);
227} 227}
228 228
229static struct file_operations nsc_ops = { 229static struct file_operations nsc_ops = {
@@ -250,7 +250,7 @@ static struct attribute * nsc_attrs[] = {
250 250
251static struct attribute_group nsc_attr_grp = { .attrs = nsc_attrs }; 251static struct attribute_group nsc_attr_grp = { .attrs = nsc_attrs };
252 252
253static struct tpm_vendor_specific tpm_nsc = { 253static const struct tpm_vendor_specific tpm_nsc = {
254 .recv = tpm_nsc_recv, 254 .recv = tpm_nsc_recv,
255 .send = tpm_nsc_send, 255 .send = tpm_nsc_send,
256 .cancel = tpm_nsc_cancel, 256 .cancel = tpm_nsc_cancel,
@@ -268,7 +268,7 @@ static void __devexit tpm_nsc_remove(struct device *dev)
268{ 268{
269 struct tpm_chip *chip = dev_get_drvdata(dev); 269 struct tpm_chip *chip = dev_get_drvdata(dev);
270 if ( chip ) { 270 if ( chip ) {
271 release_region(chip->vendor->base, 2); 271 release_region(chip->vendor.base, 2);
272 tpm_remove_hardware(chip->dev); 272 tpm_remove_hardware(chip->dev);
273 } 273 }
274} 274}
@@ -286,7 +286,8 @@ static int __init init_nsc(void)
286 int rc = 0; 286 int rc = 0;
287 int lo, hi; 287 int lo, hi;
288 int nscAddrBase = TPM_ADDR; 288 int nscAddrBase = TPM_ADDR;
289 289 struct tpm_chip *chip;
290 unsigned long base;
290 291
291 /* verify that it is a National part (SID) */ 292 /* verify that it is a National part (SID) */
292 if (tpm_read_index(TPM_ADDR, NSC_SID_INDEX) != 0xEF) { 293 if (tpm_read_index(TPM_ADDR, NSC_SID_INDEX) != 0xEF) {
@@ -300,7 +301,7 @@ static int __init init_nsc(void)
300 301
301 hi = tpm_read_index(nscAddrBase, TPM_NSC_BASE0_HI); 302 hi = tpm_read_index(nscAddrBase, TPM_NSC_BASE0_HI);
302 lo = tpm_read_index(nscAddrBase, TPM_NSC_BASE0_LO); 303 lo = tpm_read_index(nscAddrBase, TPM_NSC_BASE0_LO);
303 tpm_nsc.base = (hi<<8) | lo; 304 base = (hi<<8) | lo;
304 305
305 /* enable the DPM module */ 306 /* enable the DPM module */
306 tpm_write_index(nscAddrBase, NSC_LDC_INDEX, 0x01); 307 tpm_write_index(nscAddrBase, NSC_LDC_INDEX, 0x01);
@@ -320,13 +321,15 @@ static int __init init_nsc(void)
320 if ((rc = platform_device_register(pdev)) < 0) 321 if ((rc = platform_device_register(pdev)) < 0)
321 goto err_free_dev; 322 goto err_free_dev;
322 323
323 if (request_region(tpm_nsc.base, 2, "tpm_nsc0") == NULL ) { 324 if (request_region(base, 2, "tpm_nsc0") == NULL ) {
324 rc = -EBUSY; 325 rc = -EBUSY;
325 goto err_unreg_dev; 326 goto err_unreg_dev;
326 } 327 }
327 328
328 if ((rc = tpm_register_hardware(&pdev->dev, &tpm_nsc)) < 0) 329 if (!(chip = tpm_register_hardware(&pdev->dev, &tpm_nsc))) {
330 rc = -ENODEV;
329 goto err_rel_reg; 331 goto err_rel_reg;
332 }
330 333
331 dev_dbg(&pdev->dev, "NSC TPM detected\n"); 334 dev_dbg(&pdev->dev, "NSC TPM detected\n");
332 dev_dbg(&pdev->dev, 335 dev_dbg(&pdev->dev,
@@ -361,10 +364,12 @@ static int __init init_nsc(void)
361 "NSC TPM revision %d\n", 364 "NSC TPM revision %d\n",
362 tpm_read_index(nscAddrBase, 0x27) & 0x1F); 365 tpm_read_index(nscAddrBase, 0x27) & 0x1F);
363 366
367 chip->vendor.base = base;
368
364 return 0; 369 return 0;
365 370
366err_rel_reg: 371err_rel_reg:
367 release_region(tpm_nsc.base, 2); 372 release_region(base, 2);
368err_unreg_dev: 373err_unreg_dev:
369 platform_device_unregister(pdev); 374 platform_device_unregister(pdev);
370err_free_dev: 375err_free_dev:
diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
new file mode 100644
index 000000000000..8ea70625f7ea
--- /dev/null
+++ b/drivers/char/tpm/tpm_tis.c
@@ -0,0 +1,665 @@
1/*
2 * Copyright (C) 2005, 2006 IBM Corporation
3 *
4 * Authors:
5 * Leendert van Doorn <leendert@watson.ibm.com>
6 * Kylene Hall <kjhall@us.ibm.com>
7 *
8 * Device driver for TCG/TCPA TPM (trusted platform module).
9 * Specifications at www.trustedcomputinggroup.org
10 *
11 * This device driver implements the TPM interface as defined in
12 * the TCG TPM Interface Spec version 1.2, revision 1.0.
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License as
16 * published by the Free Software Foundation, version 2 of the
17 * License.
18 */
19#include <linux/init.h>
20#include <linux/module.h>
21#include <linux/moduleparam.h>
22#include <linux/pnp.h>
23#include <linux/interrupt.h>
24#include <linux/wait.h>
25#include "tpm.h"
26
27#define TPM_HEADER_SIZE 10
28
29enum tis_access {
30 TPM_ACCESS_VALID = 0x80,
31 TPM_ACCESS_ACTIVE_LOCALITY = 0x20,
32 TPM_ACCESS_REQUEST_PENDING = 0x04,
33 TPM_ACCESS_REQUEST_USE = 0x02,
34};
35
36enum tis_status {
37 TPM_STS_VALID = 0x80,
38 TPM_STS_COMMAND_READY = 0x40,
39 TPM_STS_GO = 0x20,
40 TPM_STS_DATA_AVAIL = 0x10,
41 TPM_STS_DATA_EXPECT = 0x08,
42};
43
44enum tis_int_flags {
45 TPM_GLOBAL_INT_ENABLE = 0x80000000,
46 TPM_INTF_BURST_COUNT_STATIC = 0x100,
47 TPM_INTF_CMD_READY_INT = 0x080,
48 TPM_INTF_INT_EDGE_FALLING = 0x040,
49 TPM_INTF_INT_EDGE_RISING = 0x020,
50 TPM_INTF_INT_LEVEL_LOW = 0x010,
51 TPM_INTF_INT_LEVEL_HIGH = 0x008,
52 TPM_INTF_LOCALITY_CHANGE_INT = 0x004,
53 TPM_INTF_STS_VALID_INT = 0x002,
54 TPM_INTF_DATA_AVAIL_INT = 0x001,
55};
56
57enum tis_defaults {
58 TIS_MEM_BASE = 0xFED40000,
59 TIS_MEM_LEN = 0x5000,
60 TIS_SHORT_TIMEOUT = 750, /* ms */
61 TIS_LONG_TIMEOUT = 2000, /* 2 sec */
62};
63
64#define TPM_ACCESS(l) (0x0000 | ((l) << 12))
65#define TPM_INT_ENABLE(l) (0x0008 | ((l) << 12))
66#define TPM_INT_VECTOR(l) (0x000C | ((l) << 12))
67#define TPM_INT_STATUS(l) (0x0010 | ((l) << 12))
68#define TPM_INTF_CAPS(l) (0x0014 | ((l) << 12))
69#define TPM_STS(l) (0x0018 | ((l) << 12))
70#define TPM_DATA_FIFO(l) (0x0024 | ((l) << 12))
71
72#define TPM_DID_VID(l) (0x0F00 | ((l) << 12))
73#define TPM_RID(l) (0x0F04 | ((l) << 12))
74
75static LIST_HEAD(tis_chips);
76static DEFINE_SPINLOCK(tis_lock);
77
78static int check_locality(struct tpm_chip *chip, int l)
79{
80 if ((ioread8(chip->vendor.iobase + TPM_ACCESS(l)) &
81 (TPM_ACCESS_ACTIVE_LOCALITY | TPM_ACCESS_VALID)) ==
82 (TPM_ACCESS_ACTIVE_LOCALITY | TPM_ACCESS_VALID))
83 return chip->vendor.locality = l;
84
85 return -1;
86}
87
88static void release_locality(struct tpm_chip *chip, int l, int force)
89{
90 if (force || (ioread8(chip->vendor.iobase + TPM_ACCESS(l)) &
91 (TPM_ACCESS_REQUEST_PENDING | TPM_ACCESS_VALID)) ==
92 (TPM_ACCESS_REQUEST_PENDING | TPM_ACCESS_VALID))
93 iowrite8(TPM_ACCESS_ACTIVE_LOCALITY,
94 chip->vendor.iobase + TPM_ACCESS(l));
95}
96
97static int request_locality(struct tpm_chip *chip, int l)
98{
99 unsigned long stop;
100 long rc;
101
102 if (check_locality(chip, l) >= 0)
103 return l;
104
105 iowrite8(TPM_ACCESS_REQUEST_USE,
106 chip->vendor.iobase + TPM_ACCESS(l));
107
108 if (chip->vendor.irq) {
109 rc = wait_event_interruptible_timeout(chip->vendor.int_queue,
110 (check_locality
111 (chip, l) >= 0),
112 chip->vendor.timeout_a);
113 if (rc > 0)
114 return l;
115
116 } else {
117 /* wait for burstcount */
118 stop = jiffies + chip->vendor.timeout_a;
119 do {
120 if (check_locality(chip, l) >= 0)
121 return l;
122 msleep(TPM_TIMEOUT);
123 }
124 while (time_before(jiffies, stop));
125 }
126 return -1;
127}
128
129static u8 tpm_tis_status(struct tpm_chip *chip)
130{
131 return ioread8(chip->vendor.iobase +
132 TPM_STS(chip->vendor.locality));
133}
134
135static void tpm_tis_ready(struct tpm_chip *chip)
136{
137 /* this causes the current command to be aborted */
138 iowrite8(TPM_STS_COMMAND_READY,
139 chip->vendor.iobase + TPM_STS(chip->vendor.locality));
140}
141
142static int get_burstcount(struct tpm_chip *chip)
143{
144 unsigned long stop;
145 int burstcnt;
146
147 /* wait for burstcount */
148 /* which timeout value, spec has 2 answers (c & d) */
149 stop = jiffies + chip->vendor.timeout_d;
150 do {
151 burstcnt = ioread8(chip->vendor.iobase +
152 TPM_STS(chip->vendor.locality) + 1);
153 burstcnt += ioread8(chip->vendor.iobase +
154 TPM_STS(chip->vendor.locality) +
155 2) << 8;
156 if (burstcnt)
157 return burstcnt;
158 msleep(TPM_TIMEOUT);
159 } while (time_before(jiffies, stop));
160 return -EBUSY;
161}
162
163static int wait_for_stat(struct tpm_chip *chip, u8 mask, unsigned long timeout,
164 wait_queue_head_t *queue)
165{
166 unsigned long stop;
167 long rc;
168 u8 status;
169
170 /* check current status */
171 status = tpm_tis_status(chip);
172 if ((status & mask) == mask)
173 return 0;
174
175 if (chip->vendor.irq) {
176 rc = wait_event_interruptible_timeout(*queue,
177 ((tpm_tis_status
178 (chip) & mask) ==
179 mask), timeout);
180 if (rc > 0)
181 return 0;
182 } else {
183 stop = jiffies + timeout;
184 do {
185 msleep(TPM_TIMEOUT);
186 status = tpm_tis_status(chip);
187 if ((status & mask) == mask)
188 return 0;
189 } while (time_before(jiffies, stop));
190 }
191 return -ETIME;
192}
193
194static int recv_data(struct tpm_chip *chip, u8 *buf, size_t count)
195{
196 int size = 0, burstcnt;
197 while (size < count &&
198 wait_for_stat(chip,
199 TPM_STS_DATA_AVAIL | TPM_STS_VALID,
200 chip->vendor.timeout_c,
201 &chip->vendor.read_queue)
202 == 0) {
203 burstcnt = get_burstcount(chip);
204 for (; burstcnt > 0 && size < count; burstcnt--)
205 buf[size++] = ioread8(chip->vendor.iobase +
206 TPM_DATA_FIFO(chip->vendor.
207 locality));
208 }
209 return size;
210}
211
212static int tpm_tis_recv(struct tpm_chip *chip, u8 *buf, size_t count)
213{
214 int size = 0;
215 int expected, status;
216
217 if (count < TPM_HEADER_SIZE) {
218 size = -EIO;
219 goto out;
220 }
221
222 /* read first 10 bytes, including tag, paramsize, and result */
223 if ((size =
224 recv_data(chip, buf, TPM_HEADER_SIZE)) < TPM_HEADER_SIZE) {
225 dev_err(chip->dev, "Unable to read header\n");
226 goto out;
227 }
228
229 expected = be32_to_cpu(*(__be32 *) (buf + 2));
230 if (expected > count) {
231 size = -EIO;
232 goto out;
233 }
234
235 if ((size +=
236 recv_data(chip, &buf[TPM_HEADER_SIZE],
237 expected - TPM_HEADER_SIZE)) < expected) {
238 dev_err(chip->dev, "Unable to read remainder of result\n");
239 size = -ETIME;
240 goto out;
241 }
242
243 wait_for_stat(chip, TPM_STS_VALID, chip->vendor.timeout_c,
244 &chip->vendor.int_queue);
245 status = tpm_tis_status(chip);
246 if (status & TPM_STS_DATA_AVAIL) { /* retry? */
247 dev_err(chip->dev, "Error left over data\n");
248 size = -EIO;
249 goto out;
250 }
251
252out:
253 tpm_tis_ready(chip);
254 release_locality(chip, chip->vendor.locality, 0);
255 return size;
256}
257
258/*
259 * If interrupts are used (signaled by an irq set in the vendor structure)
260 * tpm.c can skip polling for the data to be available as the interrupt is
261 * waited for here
262 */
263static int tpm_tis_send(struct tpm_chip *chip, u8 *buf, size_t len)
264{
265 int rc, status, burstcnt;
266 size_t count = 0;
267 u32 ordinal;
268
269 if (request_locality(chip, 0) < 0)
270 return -EBUSY;
271
272 status = tpm_tis_status(chip);
273 if ((status & TPM_STS_COMMAND_READY) == 0) {
274 tpm_tis_ready(chip);
275 if (wait_for_stat
276 (chip, TPM_STS_COMMAND_READY, chip->vendor.timeout_b,
277 &chip->vendor.int_queue) < 0) {
278 rc = -ETIME;
279 goto out_err;
280 }
281 }
282
283 while (count < len - 1) {
284 burstcnt = get_burstcount(chip);
285 for (; burstcnt > 0 && count < len - 1; burstcnt--) {
286 iowrite8(buf[count], chip->vendor.iobase +
287 TPM_DATA_FIFO(chip->vendor.locality));
288 count++;
289 }
290
291 wait_for_stat(chip, TPM_STS_VALID, chip->vendor.timeout_c,
292 &chip->vendor.int_queue);
293 status = tpm_tis_status(chip);
294 if ((status & TPM_STS_DATA_EXPECT) == 0) {
295 rc = -EIO;
296 goto out_err;
297 }
298 }
299
300 /* write last byte */
301 iowrite8(buf[count],
302 chip->vendor.iobase +
303 TPM_DATA_FIFO(chip->vendor.locality));
304 wait_for_stat(chip, TPM_STS_VALID, chip->vendor.timeout_c,
305 &chip->vendor.int_queue);
306 status = tpm_tis_status(chip);
307 if ((status & TPM_STS_DATA_EXPECT) != 0) {
308 rc = -EIO;
309 goto out_err;
310 }
311
312 /* go and do it */
313 iowrite8(TPM_STS_GO,
314 chip->vendor.iobase + TPM_STS(chip->vendor.locality));
315
316 if (chip->vendor.irq) {
317 ordinal = be32_to_cpu(*((__be32 *) (buf + 6)));
318 if (wait_for_stat
319 (chip, TPM_STS_DATA_AVAIL | TPM_STS_VALID,
320 tpm_calc_ordinal_duration(chip, ordinal),
321 &chip->vendor.read_queue) < 0) {
322 rc = -ETIME;
323 goto out_err;
324 }
325 }
326 return len;
327out_err:
328 tpm_tis_ready(chip);
329 release_locality(chip, chip->vendor.locality, 0);
330 return rc;
331}
332
333static struct file_operations tis_ops = {
334 .owner = THIS_MODULE,
335 .llseek = no_llseek,
336 .open = tpm_open,
337 .read = tpm_read,
338 .write = tpm_write,
339 .release = tpm_release,
340};
341
342static DEVICE_ATTR(pubek, S_IRUGO, tpm_show_pubek, NULL);
343static DEVICE_ATTR(pcrs, S_IRUGO, tpm_show_pcrs, NULL);
344static DEVICE_ATTR(enabled, S_IRUGO, tpm_show_enabled, NULL);
345static DEVICE_ATTR(active, S_IRUGO, tpm_show_active, NULL);
346static DEVICE_ATTR(owned, S_IRUGO, tpm_show_owned, NULL);
347static DEVICE_ATTR(temp_deactivated, S_IRUGO, tpm_show_temp_deactivated,
348 NULL);
349static DEVICE_ATTR(caps, S_IRUGO, tpm_show_caps_1_2, NULL);
350static DEVICE_ATTR(cancel, S_IWUSR | S_IWGRP, NULL, tpm_store_cancel);
351
352static struct attribute *tis_attrs[] = {
353 &dev_attr_pubek.attr,
354 &dev_attr_pcrs.attr,
355 &dev_attr_enabled.attr,
356 &dev_attr_active.attr,
357 &dev_attr_owned.attr,
358 &dev_attr_temp_deactivated.attr,
359 &dev_attr_caps.attr,
360 &dev_attr_cancel.attr, NULL,
361};
362
363static struct attribute_group tis_attr_grp = {
364 .attrs = tis_attrs
365};
366
367static struct tpm_vendor_specific tpm_tis = {
368 .status = tpm_tis_status,
369 .recv = tpm_tis_recv,
370 .send = tpm_tis_send,
371 .cancel = tpm_tis_ready,
372 .req_complete_mask = TPM_STS_DATA_AVAIL | TPM_STS_VALID,
373 .req_complete_val = TPM_STS_DATA_AVAIL | TPM_STS_VALID,
374 .req_canceled = TPM_STS_COMMAND_READY,
375 .attr_group = &tis_attr_grp,
376 .miscdev = {
377 .fops = &tis_ops,},
378};
379
380static irqreturn_t tis_int_probe(int irq, void *dev_id, struct pt_regs *regs)
381{
382 struct tpm_chip *chip = (struct tpm_chip *) dev_id;
383 u32 interrupt;
384
385 interrupt = ioread32(chip->vendor.iobase +
386 TPM_INT_STATUS(chip->vendor.locality));
387
388 if (interrupt == 0)
389 return IRQ_NONE;
390
391 chip->vendor.irq = irq;
392
393 /* Clear interrupts handled with TPM_EOI */
394 iowrite32(interrupt,
395 chip->vendor.iobase +
396 TPM_INT_STATUS(chip->vendor.locality));
397 return IRQ_HANDLED;
398}
399
400static irqreturn_t tis_int_handler(int irq, void *dev_id, struct pt_regs *regs)
401{
402 struct tpm_chip *chip = (struct tpm_chip *) dev_id;
403 u32 interrupt;
404 int i;
405
406 interrupt = ioread32(chip->vendor.iobase +
407 TPM_INT_STATUS(chip->vendor.locality));
408
409 if (interrupt == 0)
410 return IRQ_NONE;
411
412 if (interrupt & TPM_INTF_DATA_AVAIL_INT)
413 wake_up_interruptible(&chip->vendor.read_queue);
414 if (interrupt & TPM_INTF_LOCALITY_CHANGE_INT)
415 for (i = 0; i < 5; i++)
416 if (check_locality(chip, i) >= 0)
417 break;
418 if (interrupt &
419 (TPM_INTF_LOCALITY_CHANGE_INT | TPM_INTF_STS_VALID_INT |
420 TPM_INTF_CMD_READY_INT))
421 wake_up_interruptible(&chip->vendor.int_queue);
422
423 /* Clear interrupts handled with TPM_EOI */
424 iowrite32(interrupt,
425 chip->vendor.iobase +
426 TPM_INT_STATUS(chip->vendor.locality));
427 return IRQ_HANDLED;
428}
429
430static int interrupts = 1;
431module_param(interrupts, bool, 0444);
432MODULE_PARM_DESC(interrupts, "Enable interrupts");
433
434static int __devinit tpm_tis_pnp_init(struct pnp_dev *pnp_dev,
435 const struct pnp_device_id *pnp_id)
436{
437 u32 vendor, intfcaps, intmask;
438 int rc, i;
439 unsigned long start, len;
440 struct tpm_chip *chip;
441
442 start = pnp_mem_start(pnp_dev, 0);
443 len = pnp_mem_len(pnp_dev, 0);
444
445 if (!start)
446 start = TIS_MEM_BASE;
447 if (!len)
448 len = TIS_MEM_LEN;
449
450 if (!(chip = tpm_register_hardware(&pnp_dev->dev, &tpm_tis)))
451 return -ENODEV;
452
453 chip->vendor.iobase = ioremap(start, len);
454 if (!chip->vendor.iobase) {
455 rc = -EIO;
456 goto out_err;
457 }
458
459 vendor = ioread32(chip->vendor.iobase + TPM_DID_VID(0));
460
461 /* Default timeouts */
462 chip->vendor.timeout_a = msecs_to_jiffies(TIS_SHORT_TIMEOUT);
463 chip->vendor.timeout_b = msecs_to_jiffies(TIS_LONG_TIMEOUT);
464 chip->vendor.timeout_c = msecs_to_jiffies(TIS_SHORT_TIMEOUT);
465 chip->vendor.timeout_d = msecs_to_jiffies(TIS_SHORT_TIMEOUT);
466
467 dev_info(&pnp_dev->dev,
468 "1.2 TPM (device-id 0x%X, rev-id %d)\n",
469 vendor >> 16, ioread8(chip->vendor.iobase + TPM_RID(0)));
470
471 /* Figure out the capabilities */
472 intfcaps =
473 ioread32(chip->vendor.iobase +
474 TPM_INTF_CAPS(chip->vendor.locality));
475 dev_dbg(&pnp_dev->dev, "TPM interface capabilities (0x%x):\n",
476 intfcaps);
477 if (intfcaps & TPM_INTF_BURST_COUNT_STATIC)
478 dev_dbg(&pnp_dev->dev, "\tBurst Count Static\n");
479 if (intfcaps & TPM_INTF_CMD_READY_INT)
480 dev_dbg(&pnp_dev->dev, "\tCommand Ready Int Support\n");
481 if (intfcaps & TPM_INTF_INT_EDGE_FALLING)
482 dev_dbg(&pnp_dev->dev, "\tInterrupt Edge Falling\n");
483 if (intfcaps & TPM_INTF_INT_EDGE_RISING)
484 dev_dbg(&pnp_dev->dev, "\tInterrupt Edge Rising\n");
485 if (intfcaps & TPM_INTF_INT_LEVEL_LOW)
486 dev_dbg(&pnp_dev->dev, "\tInterrupt Level Low\n");
487 if (intfcaps & TPM_INTF_INT_LEVEL_HIGH)
488 dev_dbg(&pnp_dev->dev, "\tInterrupt Level High\n");
489 if (intfcaps & TPM_INTF_LOCALITY_CHANGE_INT)
490 dev_dbg(&pnp_dev->dev, "\tLocality Change Int Support\n");
491 if (intfcaps & TPM_INTF_STS_VALID_INT)
492 dev_dbg(&pnp_dev->dev, "\tSts Valid Int Support\n");
493 if (intfcaps & TPM_INTF_DATA_AVAIL_INT)
494 dev_dbg(&pnp_dev->dev, "\tData Avail Int Support\n");
495
496 if (request_locality(chip, 0) != 0) {
497 rc = -ENODEV;
498 goto out_err;
499 }
500
501 /* INTERRUPT Setup */
502 init_waitqueue_head(&chip->vendor.read_queue);
503 init_waitqueue_head(&chip->vendor.int_queue);
504
505 intmask =
506 ioread32(chip->vendor.iobase +
507 TPM_INT_ENABLE(chip->vendor.locality));
508
509 intmask |= TPM_INTF_CMD_READY_INT
510 | TPM_INTF_LOCALITY_CHANGE_INT | TPM_INTF_DATA_AVAIL_INT
511 | TPM_INTF_STS_VALID_INT;
512
513 iowrite32(intmask,
514 chip->vendor.iobase +
515 TPM_INT_ENABLE(chip->vendor.locality));
516 if (interrupts) {
517 chip->vendor.irq =
518 ioread8(chip->vendor.iobase +
519 TPM_INT_VECTOR(chip->vendor.locality));
520
521 for (i = 3; i < 16 && chip->vendor.irq == 0; i++) {
522 iowrite8(i, chip->vendor.iobase +
523 TPM_INT_VECTOR(chip->vendor.locality));
524 if (request_irq
525 (i, tis_int_probe, SA_SHIRQ,
526 chip->vendor.miscdev.name, chip) != 0) {
527 dev_info(chip->dev,
528 "Unable to request irq: %d for probe\n",
529 i);
530 continue;
531 }
532
533 /* Clear all existing */
534 iowrite32(ioread32
535 (chip->vendor.iobase +
536 TPM_INT_STATUS(chip->vendor.locality)),
537 chip->vendor.iobase +
538 TPM_INT_STATUS(chip->vendor.locality));
539
540 /* Turn on */
541 iowrite32(intmask | TPM_GLOBAL_INT_ENABLE,
542 chip->vendor.iobase +
543 TPM_INT_ENABLE(chip->vendor.locality));
544
545 /* Generate Interrupts */
546 tpm_gen_interrupt(chip);
547
548 /* Turn off */
549 iowrite32(intmask,
550 chip->vendor.iobase +
551 TPM_INT_ENABLE(chip->vendor.locality));
552 free_irq(i, chip);
553 }
554 }
555 if (chip->vendor.irq) {
556 iowrite8(chip->vendor.irq,
557 chip->vendor.iobase +
558 TPM_INT_VECTOR(chip->vendor.locality));
559 if (request_irq
560 (chip->vendor.irq, tis_int_handler, SA_SHIRQ,
561 chip->vendor.miscdev.name, chip) != 0) {
562 dev_info(chip->dev,
563 "Unable to request irq: %d for use\n",
564 chip->vendor.irq);
565 chip->vendor.irq = 0;
566 } else {
567 /* Clear all existing */
568 iowrite32(ioread32
569 (chip->vendor.iobase +
570 TPM_INT_STATUS(chip->vendor.locality)),
571 chip->vendor.iobase +
572 TPM_INT_STATUS(chip->vendor.locality));
573
574 /* Turn on */
575 iowrite32(intmask | TPM_GLOBAL_INT_ENABLE,
576 chip->vendor.iobase +
577 TPM_INT_ENABLE(chip->vendor.locality));
578 }
579 }
580
581 INIT_LIST_HEAD(&chip->vendor.list);
582 spin_lock(&tis_lock);
583 list_add(&chip->vendor.list, &tis_chips);
584 spin_unlock(&tis_lock);
585
586 tpm_get_timeouts(chip);
587 tpm_continue_selftest(chip);
588
589 return 0;
590out_err:
591 if (chip->vendor.iobase)
592 iounmap(chip->vendor.iobase);
593 tpm_remove_hardware(chip->dev);
594 return rc;
595}
596
597static int tpm_tis_pnp_suspend(struct pnp_dev *dev, pm_message_t msg)
598{
599 return tpm_pm_suspend(&dev->dev, msg);
600}
601
602static int tpm_tis_pnp_resume(struct pnp_dev *dev)
603{
604 return tpm_pm_resume(&dev->dev);
605}
606
607static struct pnp_device_id tpm_pnp_tbl[] __devinitdata = {
608 {"PNP0C31", 0}, /* TPM */
609 {"ATM1200", 0}, /* Atmel */
610 {"IFX0102", 0}, /* Infineon */
611 {"BCM0101", 0}, /* Broadcom */
612 {"NSC1200", 0}, /* National */
613 /* Add new here */
614 {"", 0}, /* User Specified */
615 {"", 0} /* Terminator */
616};
617
618static struct pnp_driver tis_pnp_driver = {
619 .name = "tpm_tis",
620 .id_table = tpm_pnp_tbl,
621 .probe = tpm_tis_pnp_init,
622 .suspend = tpm_tis_pnp_suspend,
623 .resume = tpm_tis_pnp_resume,
624};
625
626#define TIS_HID_USR_IDX sizeof(tpm_pnp_tbl)/sizeof(struct pnp_device_id) -2
627module_param_string(hid, tpm_pnp_tbl[TIS_HID_USR_IDX].id,
628 sizeof(tpm_pnp_tbl[TIS_HID_USR_IDX].id), 0444);
629MODULE_PARM_DESC(hid, "Set additional specific HID for this driver to probe");
630
631static int __init init_tis(void)
632{
633 return pnp_register_driver(&tis_pnp_driver);
634}
635
636static void __exit cleanup_tis(void)
637{
638 struct tpm_vendor_specific *i, *j;
639 struct tpm_chip *chip;
640 spin_lock(&tis_lock);
641 list_for_each_entry_safe(i, j, &tis_chips, list) {
642 chip = to_tpm_chip(i);
643 iowrite32(~TPM_GLOBAL_INT_ENABLE &
644 ioread32(chip->vendor.iobase +
645 TPM_INT_ENABLE(chip->vendor.
646 locality)),
647 chip->vendor.iobase +
648 TPM_INT_ENABLE(chip->vendor.locality));
649 release_locality(chip, chip->vendor.locality, 1);
650 if (chip->vendor.irq)
651 free_irq(chip->vendor.irq, chip);
652 iounmap(i->iobase);
653 list_del(&i->list);
654 tpm_remove_hardware(chip->dev);
655 }
656 spin_unlock(&tis_lock);
657 pnp_unregister_driver(&tis_pnp_driver);
658}
659
660module_init(init_tis);
661module_exit(cleanup_tis);
662MODULE_AUTHOR("Leendert van Doorn (leendert@watson.ibm.com)");
663MODULE_DESCRIPTION("TPM Driver");
664MODULE_VERSION("2.0");
665MODULE_LICENSE("GPL");
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index f70a47eadb52..a88b94a82b14 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -398,7 +398,7 @@ int tty_insert_flip_string_flags(struct tty_struct *tty,
398 while (unlikely(size > copied)); 398 while (unlikely(size > copied));
399 return copied; 399 return copied;
400} 400}
401EXPORT_SYMBOL_GPL(tty_insert_flip_string_flags); 401EXPORT_SYMBOL(tty_insert_flip_string_flags);
402 402
403void tty_schedule_flip(struct tty_struct *tty) 403void tty_schedule_flip(struct tty_struct *tty)
404{ 404{
@@ -2723,7 +2723,11 @@ static void __do_SAK(void *arg)
2723 } 2723 }
2724 task_lock(p); 2724 task_lock(p);
2725 if (p->files) { 2725 if (p->files) {
2726 rcu_read_lock(); 2726 /*
2727 * We don't take a ref to the file, so we must
2728 * hold ->file_lock instead.
2729 */
2730 spin_lock(&p->files->file_lock);
2727 fdt = files_fdtable(p->files); 2731 fdt = files_fdtable(p->files);
2728 for (i=0; i < fdt->max_fds; i++) { 2732 for (i=0; i < fdt->max_fds; i++) {
2729 filp = fcheck_files(p->files, i); 2733 filp = fcheck_files(p->files, i);
@@ -2734,11 +2738,11 @@ static void __do_SAK(void *arg)
2734 printk(KERN_NOTICE "SAK: killed process %d" 2738 printk(KERN_NOTICE "SAK: killed process %d"
2735 " (%s): fd#%d opened to the tty\n", 2739 " (%s): fd#%d opened to the tty\n",
2736 p->pid, p->comm, i); 2740 p->pid, p->comm, i);
2737 send_sig(SIGKILL, p, 1); 2741 force_sig(SIGKILL, p);
2738 break; 2742 break;
2739 } 2743 }
2740 } 2744 }
2741 rcu_read_unlock(); 2745 spin_unlock(&p->files->file_lock);
2742 } 2746 }
2743 task_unlock(p); 2747 task_unlock(p);
2744 } while_each_thread(g, p); 2748 } while_each_thread(g, p);
diff --git a/drivers/char/vt.c b/drivers/char/vt.c
index acc5d47844eb..6c94879e0b99 100644
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -3238,14 +3238,6 @@ void vcs_scr_writew(struct vc_data *vc, u16 val, u16 *org)
3238 } 3238 }
3239} 3239}
3240 3240
3241int is_console_suspend_safe(void)
3242{
3243 /* It is unsafe to suspend devices while X has control of the
3244 * hardware. Make sure we are running on a kernel-controlled console.
3245 */
3246 return vc_cons[fg_console].d->vc_mode == KD_TEXT;
3247}
3248
3249/* 3241/*
3250 * Visible symbols for modules 3242 * Visible symbols for modules
3251 */ 3243 */
diff --git a/drivers/char/watchdog/i8xx_tco.c b/drivers/char/watchdog/i8xx_tco.c
index a13395e2c372..fa2ba9ebe42a 100644
--- a/drivers/char/watchdog/i8xx_tco.c
+++ b/drivers/char/watchdog/i8xx_tco.c
@@ -33,11 +33,6 @@
33 * 82801E (C-ICH) : document number 273599-001, 273645-002, 33 * 82801E (C-ICH) : document number 273599-001, 273645-002,
34 * 82801EB (ICH5) : document number 252516-001, 252517-003, 34 * 82801EB (ICH5) : document number 252516-001, 252517-003,
35 * 82801ER (ICH5R) : document number 252516-001, 252517-003, 35 * 82801ER (ICH5R) : document number 252516-001, 252517-003,
36 * 82801FB (ICH6) : document number 301473-002, 301474-007,
37 * 82801FR (ICH6R) : document number 301473-002, 301474-007,
38 * 82801FBM (ICH6-M) : document number 301473-002, 301474-007,
39 * 82801FW (ICH6W) : document number 301473-001, 301474-007,
40 * 82801FRW (ICH6RW) : document number 301473-001, 301474-007
41 * 36 *
42 * 20000710 Nils Faerber 37 * 20000710 Nils Faerber
43 * Initial Version 0.01 38 * Initial Version 0.01
@@ -66,6 +61,10 @@
66 * 20050807 Wim Van Sebroeck <wim@iguana.be> 61 * 20050807 Wim Van Sebroeck <wim@iguana.be>
67 * 0.08 Make sure that the watchdog is only "armed" when started. 62 * 0.08 Make sure that the watchdog is only "armed" when started.
68 * (Kernel Bug 4251) 63 * (Kernel Bug 4251)
64 * 20060416 Wim Van Sebroeck <wim@iguana.be>
65 * 0.09 Remove support for the ICH6, ICH6R, ICH6-M, ICH6W and ICH6RW and
66 * ICH7 chipsets. (See Kernel Bug 6031 - other code will support these
67 * chipsets)
69 */ 68 */
70 69
71/* 70/*
@@ -90,7 +89,7 @@
90#include "i8xx_tco.h" 89#include "i8xx_tco.h"
91 90
92/* Module and version information */ 91/* Module and version information */
93#define TCO_VERSION "0.08" 92#define TCO_VERSION "0.09"
94#define TCO_MODULE_NAME "i8xx TCO timer" 93#define TCO_MODULE_NAME "i8xx TCO timer"
95#define TCO_DRIVER_NAME TCO_MODULE_NAME ", v" TCO_VERSION 94#define TCO_DRIVER_NAME TCO_MODULE_NAME ", v" TCO_VERSION
96#define PFX TCO_MODULE_NAME ": " 95#define PFX TCO_MODULE_NAME ": "
@@ -391,11 +390,6 @@ static struct pci_device_id i8xx_tco_pci_tbl[] = {
391 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_12, PCI_ANY_ID, PCI_ANY_ID, }, 390 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_12, PCI_ANY_ID, PCI_ANY_ID, },
392 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801E_0, PCI_ANY_ID, PCI_ANY_ID, }, 391 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801E_0, PCI_ANY_ID, PCI_ANY_ID, },
393 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_0, PCI_ANY_ID, PCI_ANY_ID, }, 392 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_0, PCI_ANY_ID, PCI_ANY_ID, },
394 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_0, PCI_ANY_ID, PCI_ANY_ID, },
395 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_1, PCI_ANY_ID, PCI_ANY_ID, },
396 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_2, PCI_ANY_ID, PCI_ANY_ID, },
397 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_0, PCI_ANY_ID, PCI_ANY_ID, },
398 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_1, PCI_ANY_ID, PCI_ANY_ID, },
399 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ESB_1, PCI_ANY_ID, PCI_ANY_ID, }, 393 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ESB_1, PCI_ANY_ID, PCI_ANY_ID, },
400 { 0, }, /* End of list */ 394 { 0, }, /* End of list */
401}; 395};
diff --git a/drivers/char/watchdog/s3c2410_wdt.c b/drivers/char/watchdog/s3c2410_wdt.c
index 9dc54736e4eb..1ea04e9b2b0b 100644
--- a/drivers/char/watchdog/s3c2410_wdt.c
+++ b/drivers/char/watchdog/s3c2410_wdt.c
@@ -423,6 +423,12 @@ static int s3c2410wdt_probe(struct platform_device *pdev)
423 if (tmr_atboot && started == 0) { 423 if (tmr_atboot && started == 0) {
424 printk(KERN_INFO PFX "Starting Watchdog Timer\n"); 424 printk(KERN_INFO PFX "Starting Watchdog Timer\n");
425 s3c2410wdt_start(); 425 s3c2410wdt_start();
426 } else if (!tmr_atboot) {
427 /* if we're not enabling the watchdog, then ensure it is
428 * disabled if it has been left running from the bootloader
429 * or other source */
430
431 s3c2410wdt_stop();
426 } 432 }
427 433
428 return 0; 434 return 0;
diff --git a/drivers/char/watchdog/sc1200wdt.c b/drivers/char/watchdog/sc1200wdt.c
index 515ce7572049..20b88f9b7be2 100644
--- a/drivers/char/watchdog/sc1200wdt.c
+++ b/drivers/char/watchdog/sc1200wdt.c
@@ -377,7 +377,7 @@ static int __init sc1200wdt_init(void)
377{ 377{
378 int ret; 378 int ret;
379 379
380 printk(banner); 380 printk("%s\n", banner);
381 381
382 spin_lock_init(&sc1200wdt_lock); 382 spin_lock_init(&sc1200wdt_lock);
383 sema_init(&open_sem, 1); 383 sema_init(&open_sem, 1);
diff --git a/drivers/cpufreq/Kconfig b/drivers/cpufreq/Kconfig
index 60c9be99c6d9..2cc71b66231e 100644
--- a/drivers/cpufreq/Kconfig
+++ b/drivers/cpufreq/Kconfig
@@ -99,7 +99,7 @@ config CPU_FREQ_GOV_USERSPACE
99 Enable this cpufreq governor when you either want to set the 99 Enable this cpufreq governor when you either want to set the
100 CPU frequency manually or when an userspace program shall 100 CPU frequency manually or when an userspace program shall
101 be able to set the CPU dynamically, like on LART 101 be able to set the CPU dynamically, like on LART
102 <http://www.lart.tudelft.nl/> 102 <http://www.lartmaker.nl/>.
103 103
104 For details, take a look at <file:Documentation/cpu-freq/>. 104 For details, take a look at <file:Documentation/cpu-freq/>.
105 105
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 9b6ae7dc8b8a..29b2fa5534ae 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -319,7 +319,6 @@ out:
319 } 319 }
320 return -EINVAL; 320 return -EINVAL;
321} 321}
322EXPORT_SYMBOL_GPL(cpufreq_parse_governor);
323 322
324 323
325/* drivers/base/cpu.c */ 324/* drivers/base/cpu.c */
@@ -346,6 +345,8 @@ show_one(scaling_min_freq, min);
346show_one(scaling_max_freq, max); 345show_one(scaling_max_freq, max);
347show_one(scaling_cur_freq, cur); 346show_one(scaling_cur_freq, cur);
348 347
348static int __cpufreq_set_policy(struct cpufreq_policy *data, struct cpufreq_policy *policy);
349
349/** 350/**
350 * cpufreq_per_cpu_attr_write() / store_##file_name() - sysfs write access 351 * cpufreq_per_cpu_attr_write() / store_##file_name() - sysfs write access
351 */ 352 */
@@ -364,7 +365,10 @@ static ssize_t store_##file_name \
364 if (ret != 1) \ 365 if (ret != 1) \
365 return -EINVAL; \ 366 return -EINVAL; \
366 \ 367 \
367 ret = cpufreq_set_policy(&new_policy); \ 368 mutex_lock(&policy->lock); \
369 ret = __cpufreq_set_policy(policy, &new_policy); \
370 policy->user_policy.object = policy->object; \
371 mutex_unlock(&policy->lock); \
368 \ 372 \
369 return ret ? ret : count; \ 373 return ret ? ret : count; \
370} 374}
@@ -420,7 +424,15 @@ static ssize_t store_scaling_governor (struct cpufreq_policy * policy,
420 if (cpufreq_parse_governor(str_governor, &new_policy.policy, &new_policy.governor)) 424 if (cpufreq_parse_governor(str_governor, &new_policy.policy, &new_policy.governor))
421 return -EINVAL; 425 return -EINVAL;
422 426
423 ret = cpufreq_set_policy(&new_policy); 427 /* Do not use cpufreq_set_policy here or the user_policy.max
428 will be wrongly overridden */
429 mutex_lock(&policy->lock);
430 ret = __cpufreq_set_policy(policy, &new_policy);
431
432 policy->user_policy.policy = policy->policy;
433 policy->user_policy.governor = policy->governor;
434 mutex_unlock(&policy->lock);
435
424 return ret ? ret : count; 436 return ret ? ret : count;
425} 437}
426 438
@@ -685,7 +697,7 @@ static int cpufreq_add_dev (struct sys_device * sys_dev)
685 if (!cpu_online(j)) 697 if (!cpu_online(j))
686 continue; 698 continue;
687 699
688 dprintk("CPU already managed, adding link\n"); 700 dprintk("CPU %u already managed, adding link\n", j);
689 cpufreq_cpu_get(cpu); 701 cpufreq_cpu_get(cpu);
690 cpu_sys_dev = get_cpu_sysdev(j); 702 cpu_sys_dev = get_cpu_sysdev(j);
691 sysfs_create_link(&cpu_sys_dev->kobj, &policy->kobj, 703 sysfs_create_link(&cpu_sys_dev->kobj, &policy->kobj,
@@ -695,9 +707,8 @@ static int cpufreq_add_dev (struct sys_device * sys_dev)
695 policy->governor = NULL; /* to assure that the starting sequence is 707 policy->governor = NULL; /* to assure that the starting sequence is
696 * run in cpufreq_set_policy */ 708 * run in cpufreq_set_policy */
697 mutex_unlock(&policy->lock); 709 mutex_unlock(&policy->lock);
698 710
699 /* set default policy */ 711 /* set default policy */
700
701 ret = cpufreq_set_policy(&new_policy); 712 ret = cpufreq_set_policy(&new_policy);
702 if (ret) { 713 if (ret) {
703 dprintk("setting policy failed\n"); 714 dprintk("setting policy failed\n");
@@ -707,7 +718,7 @@ static int cpufreq_add_dev (struct sys_device * sys_dev)
707 module_put(cpufreq_driver->owner); 718 module_put(cpufreq_driver->owner);
708 dprintk("initialization complete\n"); 719 dprintk("initialization complete\n");
709 cpufreq_debug_enable_ratelimit(); 720 cpufreq_debug_enable_ratelimit();
710 721
711 return 0; 722 return 0;
712 723
713 724
@@ -1486,7 +1497,7 @@ int cpufreq_update_policy(unsigned int cpu)
1486} 1497}
1487EXPORT_SYMBOL(cpufreq_update_policy); 1498EXPORT_SYMBOL(cpufreq_update_policy);
1488 1499
1489static int __cpuinit cpufreq_cpu_callback(struct notifier_block *nfb, 1500static int cpufreq_cpu_callback(struct notifier_block *nfb,
1490 unsigned long action, void *hcpu) 1501 unsigned long action, void *hcpu)
1491{ 1502{
1492 unsigned int cpu = (unsigned long)hcpu; 1503 unsigned int cpu = (unsigned long)hcpu;
diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c
index 037f6bf4543c..e07a35487bde 100644
--- a/drivers/cpufreq/cpufreq_conservative.c
+++ b/drivers/cpufreq/cpufreq_conservative.c
@@ -176,8 +176,7 @@ static ssize_t store_up_threshold(struct cpufreq_policy *unused,
176 ret = sscanf (buf, "%u", &input); 176 ret = sscanf (buf, "%u", &input);
177 177
178 mutex_lock(&dbs_mutex); 178 mutex_lock(&dbs_mutex);
179 if (ret != 1 || input > 100 || input < 0 || 179 if (ret != 1 || input > 100 || input <= dbs_tuners_ins.down_threshold) {
180 input <= dbs_tuners_ins.down_threshold) {
181 mutex_unlock(&dbs_mutex); 180 mutex_unlock(&dbs_mutex);
182 return -EINVAL; 181 return -EINVAL;
183 } 182 }
@@ -196,8 +195,7 @@ static ssize_t store_down_threshold(struct cpufreq_policy *unused,
196 ret = sscanf (buf, "%u", &input); 195 ret = sscanf (buf, "%u", &input);
197 196
198 mutex_lock(&dbs_mutex); 197 mutex_lock(&dbs_mutex);
199 if (ret != 1 || input > 100 || input < 0 || 198 if (ret != 1 || input > 100 || input >= dbs_tuners_ins.up_threshold) {
200 input >= dbs_tuners_ins.up_threshold) {
201 mutex_unlock(&dbs_mutex); 199 mutex_unlock(&dbs_mutex);
202 return -EINVAL; 200 return -EINVAL;
203 } 201 }
diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c
index 956d121cb161..3e6ffcaa5af4 100644
--- a/drivers/cpufreq/cpufreq_ondemand.c
+++ b/drivers/cpufreq/cpufreq_ondemand.c
@@ -74,6 +74,8 @@ static unsigned int dbs_enable; /* number of CPUs using this policy */
74static DEFINE_MUTEX (dbs_mutex); 74static DEFINE_MUTEX (dbs_mutex);
75static DECLARE_WORK (dbs_work, do_dbs_timer, NULL); 75static DECLARE_WORK (dbs_work, do_dbs_timer, NULL);
76 76
77static struct workqueue_struct *dbs_workq;
78
77struct dbs_tuners { 79struct dbs_tuners {
78 unsigned int sampling_rate; 80 unsigned int sampling_rate;
79 unsigned int sampling_down_factor; 81 unsigned int sampling_down_factor;
@@ -364,23 +366,29 @@ static void do_dbs_timer(void *data)
364 mutex_lock(&dbs_mutex); 366 mutex_lock(&dbs_mutex);
365 for_each_online_cpu(i) 367 for_each_online_cpu(i)
366 dbs_check_cpu(i); 368 dbs_check_cpu(i);
367 schedule_delayed_work(&dbs_work, 369 queue_delayed_work(dbs_workq, &dbs_work,
368 usecs_to_jiffies(dbs_tuners_ins.sampling_rate)); 370 usecs_to_jiffies(dbs_tuners_ins.sampling_rate));
369 mutex_unlock(&dbs_mutex); 371 mutex_unlock(&dbs_mutex);
370} 372}
371 373
372static inline void dbs_timer_init(void) 374static inline void dbs_timer_init(void)
373{ 375{
374 INIT_WORK(&dbs_work, do_dbs_timer, NULL); 376 INIT_WORK(&dbs_work, do_dbs_timer, NULL);
375 schedule_delayed_work(&dbs_work, 377 if (!dbs_workq)
376 usecs_to_jiffies(dbs_tuners_ins.sampling_rate)); 378 dbs_workq = create_singlethread_workqueue("ondemand");
379 if (!dbs_workq) {
380 printk(KERN_ERR "ondemand: Cannot initialize kernel thread\n");
381 return;
382 }
383 queue_delayed_work(dbs_workq, &dbs_work,
384 usecs_to_jiffies(dbs_tuners_ins.sampling_rate));
377 return; 385 return;
378} 386}
379 387
380static inline void dbs_timer_exit(void) 388static inline void dbs_timer_exit(void)
381{ 389{
382 cancel_delayed_work(&dbs_work); 390 if (dbs_workq)
383 return; 391 cancel_rearming_delayed_workqueue(dbs_workq, &dbs_work);
384} 392}
385 393
386static int cpufreq_governor_dbs(struct cpufreq_policy *policy, 394static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
@@ -489,8 +497,12 @@ static int __init cpufreq_gov_dbs_init(void)
489 497
490static void __exit cpufreq_gov_dbs_exit(void) 498static void __exit cpufreq_gov_dbs_exit(void)
491{ 499{
492 /* Make sure that the scheduled work is indeed not running */ 500 /* Make sure that the scheduled work is indeed not running.
493 flush_scheduled_work(); 501 Assumes the timer has been cancelled first. */
502 if (dbs_workq) {
503 flush_workqueue(dbs_workq);
504 destroy_workqueue(dbs_workq);
505 }
494 506
495 cpufreq_unregister_governor(&cpufreq_gov_dbs); 507 cpufreq_unregister_governor(&cpufreq_gov_dbs);
496} 508}
diff --git a/drivers/edac/e752x_edac.c b/drivers/edac/e752x_edac.c
index 66572c5323ad..fce31936e6d7 100644
--- a/drivers/edac/e752x_edac.c
+++ b/drivers/edac/e752x_edac.c
@@ -25,6 +25,8 @@
25#include <linux/slab.h> 25#include <linux/slab.h>
26#include "edac_mc.h" 26#include "edac_mc.h"
27 27
28static int force_function_unhide;
29
28#define e752x_printk(level, fmt, arg...) \ 30#define e752x_printk(level, fmt, arg...) \
29 edac_printk(level, "e752x", fmt, ##arg) 31 edac_printk(level, "e752x", fmt, ##arg)
30 32
@@ -782,8 +784,16 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx)
782 debugf0("%s(): mci\n", __func__); 784 debugf0("%s(): mci\n", __func__);
783 debugf0("Starting Probe1\n"); 785 debugf0("Starting Probe1\n");
784 786
785 /* enable device 0 function 1 */ 787 /* check to see if device 0 function 1 is enabled; if it isn't, we
788 * assume the BIOS has reserved it for a reason and is expecting
789 * exclusive access, we take care not to violate that assumption and
790 * fail the probe. */
786 pci_read_config_byte(pdev, E752X_DEVPRES1, &stat8); 791 pci_read_config_byte(pdev, E752X_DEVPRES1, &stat8);
792 if (!force_function_unhide && !(stat8 & (1 << 5))) {
793 printk(KERN_INFO "Contact your BIOS vendor to see if the "
794 "E752x error registers can be safely un-hidden\n");
795 goto fail;
796 }
787 stat8 |= (1 << 5); 797 stat8 |= (1 << 5);
788 pci_write_config_byte(pdev, E752X_DEVPRES1, stat8); 798 pci_write_config_byte(pdev, E752X_DEVPRES1, stat8);
789 799
@@ -1063,3 +1073,8 @@ module_exit(e752x_exit);
1063MODULE_LICENSE("GPL"); 1073MODULE_LICENSE("GPL");
1064MODULE_AUTHOR("Linux Networx (http://lnxi.com) Tom Zimmerman\n"); 1074MODULE_AUTHOR("Linux Networx (http://lnxi.com) Tom Zimmerman\n");
1065MODULE_DESCRIPTION("MC support for Intel e752x memory controllers"); 1075MODULE_DESCRIPTION("MC support for Intel e752x memory controllers");
1076
1077module_param(force_function_unhide, int, 0444);
1078MODULE_PARM_DESC(force_function_unhide, "if BIOS sets Dev0:Fun1 up as hidden:"
1079" 1=force unhide and hope BIOS doesn't fight driver for Dev0:Fun1 access");
1080
diff --git a/drivers/firmware/Makefile b/drivers/firmware/Makefile
index 85429979d0db..98e395f4bb29 100644
--- a/drivers/firmware/Makefile
+++ b/drivers/firmware/Makefile
@@ -1,7 +1,8 @@
1# 1#
2# Makefile for the linux kernel. 2# Makefile for the linux kernel.
3# 3#
4obj-$(CONFIG_EDD) += edd.o 4obj-$(CONFIG_DMI) += dmi_scan.o
5obj-$(CONFIG_EDD) += edd.o
5obj-$(CONFIG_EFI_VARS) += efivars.o 6obj-$(CONFIG_EFI_VARS) += efivars.o
6obj-$(CONFIG_EFI_PCDP) += pcdp.o 7obj-$(CONFIG_EFI_PCDP) += pcdp.o
7obj-$(CONFIG_DELL_RBU) += dell_rbu.o 8obj-$(CONFIG_DELL_RBU) += dell_rbu.o
diff --git a/arch/i386/kernel/dmi_scan.c b/drivers/firmware/dmi_scan.c
index 5efceebc48dc..948bd7e1445a 100644
--- a/arch/i386/kernel/dmi_scan.c
+++ b/drivers/firmware/dmi_scan.c
@@ -27,7 +27,7 @@ static char * __init dmi_string(struct dmi_header *dm, u8 s)
27 else 27 else
28 printk(KERN_ERR "dmi_string: out of memory.\n"); 28 printk(KERN_ERR "dmi_string: out of memory.\n");
29 } 29 }
30 } 30 }
31 31
32 return str; 32 return str;
33} 33}
@@ -41,7 +41,7 @@ static int __init dmi_table(u32 base, int len, int num,
41{ 41{
42 u8 *buf, *data; 42 u8 *buf, *data;
43 int i = 0; 43 int i = 0;
44 44
45 buf = dmi_ioremap(base, len); 45 buf = dmi_ioremap(base, len);
46 if (buf == NULL) 46 if (buf == NULL)
47 return -1; 47 return -1;
@@ -49,9 +49,9 @@ static int __init dmi_table(u32 base, int len, int num,
49 data = buf; 49 data = buf;
50 50
51 /* 51 /*
52 * Stop when we see all the items the table claimed to have 52 * Stop when we see all the items the table claimed to have
53 * OR we run off the end of the table (also happens) 53 * OR we run off the end of the table (also happens)
54 */ 54 */
55 while ((i < num) && (data - buf + sizeof(struct dmi_header)) <= len) { 55 while ((i < num) && (data - buf + sizeof(struct dmi_header)) <= len) {
56 struct dmi_header *dm = (struct dmi_header *)data; 56 struct dmi_header *dm = (struct dmi_header *)data;
57 /* 57 /*
@@ -75,7 +75,7 @@ static int __init dmi_checksum(u8 *buf)
75{ 75{
76 u8 sum = 0; 76 u8 sum = 0;
77 int a; 77 int a;
78 78
79 for (a = 0; a < 15; a++) 79 for (a = 0; a < 15; a++)
80 sum += buf[a]; 80 sum += buf[a];
81 81
diff --git a/drivers/hwmon/w83792d.c b/drivers/hwmon/w83792d.c
index 6865c64d8a51..958602e28412 100644
--- a/drivers/hwmon/w83792d.c
+++ b/drivers/hwmon/w83792d.c
@@ -1161,7 +1161,7 @@ w83792d_detect(struct i2c_adapter *adapter, int address, int kind)
1161 bank. */ 1161 bank. */
1162 if (kind < 0) { 1162 if (kind < 0) {
1163 if (w83792d_read_value(client, W83792D_REG_CONFIG) & 0x80) { 1163 if (w83792d_read_value(client, W83792D_REG_CONFIG) & 0x80) {
1164 dev_warn(dev, "Detection failed at step 3\n"); 1164 dev_dbg(dev, "Detection failed at step 1\n");
1165 goto ERROR1; 1165 goto ERROR1;
1166 } 1166 }
1167 val1 = w83792d_read_value(client, W83792D_REG_BANK); 1167 val1 = w83792d_read_value(client, W83792D_REG_BANK);
@@ -1170,6 +1170,7 @@ w83792d_detect(struct i2c_adapter *adapter, int address, int kind)
1170 if (!(val1 & 0x07)) { /* is Bank0 */ 1170 if (!(val1 & 0x07)) { /* is Bank0 */
1171 if (((!(val1 & 0x80)) && (val2 != 0xa3)) || 1171 if (((!(val1 & 0x80)) && (val2 != 0xa3)) ||
1172 ((val1 & 0x80) && (val2 != 0x5c))) { 1172 ((val1 & 0x80) && (val2 != 0x5c))) {
1173 dev_dbg(dev, "Detection failed at step 2\n");
1173 goto ERROR1; 1174 goto ERROR1;
1174 } 1175 }
1175 } 1176 }
@@ -1177,7 +1178,7 @@ w83792d_detect(struct i2c_adapter *adapter, int address, int kind)
1177 should match */ 1178 should match */
1178 if (w83792d_read_value(client, 1179 if (w83792d_read_value(client,
1179 W83792D_REG_I2C_ADDR) != address) { 1180 W83792D_REG_I2C_ADDR) != address) {
1180 dev_warn(dev, "Detection failed at step 5\n"); 1181 dev_dbg(dev, "Detection failed at step 3\n");
1181 goto ERROR1; 1182 goto ERROR1;
1182 } 1183 }
1183 } 1184 }
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index 089c6f5b24de..d6d44946a283 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -286,7 +286,10 @@ config I2C_PARPORT
286 This driver is a replacement for (and was inspired by) an older 286 This driver is a replacement for (and was inspired by) an older
287 driver named i2c-philips-par. The new driver supports more devices, 287 driver named i2c-philips-par. The new driver supports more devices,
288 and makes it easier to add support for new devices. 288 and makes it easier to add support for new devices.
289 289
290 An adapter type parameter is now mandatory. Please read the file
291 Documentation/i2c/busses/i2c-parport for details.
292
290 Another driver exists, named i2c-parport-light, which doesn't depend 293 Another driver exists, named i2c-parport-light, which doesn't depend
291 on the parport driver. This is meant for embedded systems. Don't say 294 on the parport driver. This is meant for embedded systems. Don't say
292 Y here if you intend to say Y or M there. 295 Y here if you intend to say Y or M there.
diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
index 8e0f3158215f..dfca74933625 100644
--- a/drivers/i2c/busses/i2c-i801.c
+++ b/drivers/i2c/busses/i2c-i801.c
@@ -478,6 +478,11 @@ static s32 i801_access(struct i2c_adapter * adap, u16 addr,
478 ret = i801_transaction(); 478 ret = i801_transaction();
479 } 479 }
480 480
481 /* Some BIOSes don't like it when PEC is enabled at reboot or resume
482 time, so we forcibly disable it after every transaction. */
483 if (hwpec)
484 outb_p(0, SMBAUXCTL);
485
481 if(block) 486 if(block)
482 return ret; 487 return ret;
483 if(ret) 488 if(ret)
diff --git a/drivers/i2c/busses/i2c-parport-light.c b/drivers/i2c/busses/i2c-parport-light.c
index c63025a4c861..e09ebbb2f9f0 100644
--- a/drivers/i2c/busses/i2c-parport-light.c
+++ b/drivers/i2c/busses/i2c-parport-light.c
@@ -121,9 +121,14 @@ static struct i2c_adapter parport_adapter = {
121 121
122static int __init i2c_parport_init(void) 122static int __init i2c_parport_init(void)
123{ 123{
124 if (type < 0 || type >= ARRAY_SIZE(adapter_parm)) { 124 if (type < 0) {
125 printk(KERN_WARNING "i2c-parport: adapter type unspecified\n");
126 return -ENODEV;
127 }
128
129 if (type >= ARRAY_SIZE(adapter_parm)) {
125 printk(KERN_WARNING "i2c-parport: invalid type (%d)\n", type); 130 printk(KERN_WARNING "i2c-parport: invalid type (%d)\n", type);
126 type = 0; 131 return -ENODEV;
127 } 132 }
128 133
129 if (base == 0) { 134 if (base == 0) {
diff --git a/drivers/i2c/busses/i2c-parport.c b/drivers/i2c/busses/i2c-parport.c
index 7e2e8cd1c14a..934bd55bae15 100644
--- a/drivers/i2c/busses/i2c-parport.c
+++ b/drivers/i2c/busses/i2c-parport.c
@@ -241,9 +241,14 @@ static struct parport_driver i2c_parport_driver = {
241 241
242static int __init i2c_parport_init(void) 242static int __init i2c_parport_init(void)
243{ 243{
244 if (type < 0 || type >= ARRAY_SIZE(adapter_parm)) { 244 if (type < 0) {
245 printk(KERN_WARNING "i2c-parport: adapter type unspecified\n");
246 return -ENODEV;
247 }
248
249 if (type >= ARRAY_SIZE(adapter_parm)) {
245 printk(KERN_WARNING "i2c-parport: invalid type (%d)\n", type); 250 printk(KERN_WARNING "i2c-parport: invalid type (%d)\n", type);
246 type = 0; 251 return -ENODEV;
247 } 252 }
248 253
249 return parport_register_driver(&i2c_parport_driver); 254 return parport_register_driver(&i2c_parport_driver);
diff --git a/drivers/i2c/busses/i2c-parport.h b/drivers/i2c/busses/i2c-parport.h
index d702e5e0388d..9ddd816d5d0f 100644
--- a/drivers/i2c/busses/i2c-parport.h
+++ b/drivers/i2c/busses/i2c-parport.h
@@ -90,7 +90,7 @@ static struct adapter_parm adapter_parm[] = {
90 }, 90 },
91}; 91};
92 92
93static int type; 93static int type = -1;
94module_param(type, int, 0); 94module_param(type, int, 0);
95MODULE_PARM_DESC(type, 95MODULE_PARM_DESC(type,
96 "Type of adapter:\n" 96 "Type of adapter:\n"
diff --git a/drivers/i2c/busses/i2c-sis96x.c b/drivers/i2c/busses/i2c-sis96x.c
index 3024907cdafe..1a73c0532fc7 100644
--- a/drivers/i2c/busses/i2c-sis96x.c
+++ b/drivers/i2c/busses/i2c-sis96x.c
@@ -43,13 +43,6 @@
43#include <linux/init.h> 43#include <linux/init.h>
44#include <asm/io.h> 44#include <asm/io.h>
45 45
46/*
47 HISTORY:
48 2003-05-11 1.0.0 Updated from lm_sensors project for kernel 2.5
49 (was i2c-sis645.c from lm_sensors 2.7.0)
50*/
51#define SIS96x_VERSION "1.0.0"
52
53/* base address register in PCI config space */ 46/* base address register in PCI config space */
54#define SIS96x_BAR 0x04 47#define SIS96x_BAR 0x04
55 48
@@ -337,7 +330,6 @@ static struct pci_driver sis96x_driver = {
337 330
338static int __init i2c_sis96x_init(void) 331static int __init i2c_sis96x_init(void)
339{ 332{
340 printk(KERN_INFO "i2c-sis96x version %s\n", SIS96x_VERSION);
341 return pci_register_driver(&sis96x_driver); 333 return pci_register_driver(&sis96x_driver);
342} 334}
343 335
diff --git a/drivers/i2c/busses/scx200_acb.c b/drivers/i2c/busses/scx200_acb.c
index 8bd305e47f0d..766cc969c4d0 100644
--- a/drivers/i2c/busses/scx200_acb.c
+++ b/drivers/i2c/busses/scx200_acb.c
@@ -133,6 +133,9 @@ static void scx200_acb_machine(struct scx200_acb_iface *iface, u8 status)
133 133
134 outb(inb(ACBCTL1) | ACBCTL1_STOP, ACBCTL1); 134 outb(inb(ACBCTL1) | ACBCTL1_STOP, ACBCTL1);
135 outb(ACBST_STASTR | ACBST_NEGACK, ACBST); 135 outb(ACBST_STASTR | ACBST_NEGACK, ACBST);
136
137 /* Reset the status register */
138 outb(0, ACBST);
136 return; 139 return;
137 } 140 }
138 141
@@ -228,6 +231,10 @@ static void scx200_acb_poll(struct scx200_acb_iface *iface)
228 timeout = jiffies + POLL_TIMEOUT; 231 timeout = jiffies + POLL_TIMEOUT;
229 while (time_before(jiffies, timeout)) { 232 while (time_before(jiffies, timeout)) {
230 status = inb(ACBST); 233 status = inb(ACBST);
234
235 /* Reset the status register to avoid the hang */
236 outb(0, ACBST);
237
231 if ((status & (ACBST_SDAST|ACBST_BER|ACBST_NEGACK)) != 0) { 238 if ((status & (ACBST_SDAST|ACBST_BER|ACBST_NEGACK)) != 0) {
232 scx200_acb_machine(iface, status); 239 scx200_acb_machine(iface, status);
233 return; 240 return;
@@ -415,7 +422,6 @@ static int __init scx200_acb_create(const char *text, int base, int index)
415 struct scx200_acb_iface *iface; 422 struct scx200_acb_iface *iface;
416 struct i2c_adapter *adapter; 423 struct i2c_adapter *adapter;
417 int rc; 424 int rc;
418 char description[64];
419 425
420 iface = kzalloc(sizeof(*iface), GFP_KERNEL); 426 iface = kzalloc(sizeof(*iface), GFP_KERNEL);
421 if (!iface) { 427 if (!iface) {
@@ -434,10 +440,7 @@ static int __init scx200_acb_create(const char *text, int base, int index)
434 440
435 mutex_init(&iface->mutex); 441 mutex_init(&iface->mutex);
436 442
437 snprintf(description, sizeof(description), "%s ACCESS.bus [%s]", 443 if (!request_region(base, 8, adapter->name)) {
438 text, adapter->name);
439
440 if (request_region(base, 8, description) == 0) {
441 printk(KERN_ERR NAME ": can't allocate io 0x%x-0x%x\n", 444 printk(KERN_ERR NAME ": can't allocate io 0x%x-0x%x\n",
442 base, base + 8-1); 445 base, base + 8-1);
443 rc = -EBUSY; 446 rc = -EBUSY;
@@ -488,7 +491,7 @@ static struct pci_device_id divil_pci[] = {
488 491
489#define MSR_LBAR_SMB 0x5140000B 492#define MSR_LBAR_SMB 0x5140000B
490 493
491static int scx200_add_cs553x(void) 494static __init int scx200_add_cs553x(void)
492{ 495{
493 u32 low, hi; 496 u32 low, hi;
494 u32 smb_base; 497 u32 smb_base;
@@ -524,6 +527,9 @@ static int __init scx200_acb_init(void)
524 } else if (pci_dev_present(divil_pci)) 527 } else if (pci_dev_present(divil_pci))
525 rc = scx200_add_cs553x(); 528 rc = scx200_add_cs553x();
526 529
530 /* If at least one bus was created, init must succeed */
531 if (scx200_acb_list)
532 return 0;
527 return rc; 533 return rc;
528} 534}
529 535
diff --git a/drivers/i2c/chips/ds1374.c b/drivers/i2c/chips/ds1374.c
index 03d09ed5ec2c..4630f1969a09 100644
--- a/drivers/i2c/chips/ds1374.c
+++ b/drivers/i2c/chips/ds1374.c
@@ -27,6 +27,7 @@
27#include <linux/rtc.h> 27#include <linux/rtc.h>
28#include <linux/bcd.h> 28#include <linux/bcd.h>
29#include <linux/mutex.h> 29#include <linux/mutex.h>
30#include <linux/workqueue.h>
30 31
31#define DS1374_REG_TOD0 0x00 32#define DS1374_REG_TOD0 0x00
32#define DS1374_REG_TOD1 0x01 33#define DS1374_REG_TOD1 0x01
@@ -139,7 +140,7 @@ ulong ds1374_get_rtc_time(void)
139 return t1; 140 return t1;
140} 141}
141 142
142static void ds1374_set_tlet(ulong arg) 143static void ds1374_set_work(void *arg)
143{ 144{
144 ulong t1, t2; 145 ulong t1, t2;
145 int limit = 10; /* arbitrary retry limit */ 146 int limit = 10; /* arbitrary retry limit */
@@ -168,17 +169,18 @@ static void ds1374_set_tlet(ulong arg)
168 169
169static ulong new_time; 170static ulong new_time;
170 171
171static DECLARE_TASKLET_DISABLED(ds1374_tasklet, ds1374_set_tlet, 172static struct workqueue_struct *ds1374_workqueue;
172 (ulong) & new_time); 173
174static DECLARE_WORK(ds1374_work, ds1374_set_work, &new_time);
173 175
174int ds1374_set_rtc_time(ulong nowtime) 176int ds1374_set_rtc_time(ulong nowtime)
175{ 177{
176 new_time = nowtime; 178 new_time = nowtime;
177 179
178 if (in_interrupt()) 180 if (in_interrupt())
179 tasklet_schedule(&ds1374_tasklet); 181 queue_work(ds1374_workqueue, &ds1374_work);
180 else 182 else
181 ds1374_set_tlet((ulong) & new_time); 183 ds1374_set_work(&new_time);
182 184
183 return 0; 185 return 0;
184} 186}
@@ -204,6 +206,8 @@ static int ds1374_probe(struct i2c_adapter *adap, int addr, int kind)
204 client->adapter = adap; 206 client->adapter = adap;
205 client->driver = &ds1374_driver; 207 client->driver = &ds1374_driver;
206 208
209 ds1374_workqueue = create_singlethread_workqueue("ds1374");
210
207 if ((rc = i2c_attach_client(client)) != 0) { 211 if ((rc = i2c_attach_client(client)) != 0) {
208 kfree(client); 212 kfree(client);
209 return rc; 213 return rc;
@@ -227,7 +231,7 @@ static int ds1374_detach(struct i2c_client *client)
227 231
228 if ((rc = i2c_detach_client(client)) == 0) { 232 if ((rc = i2c_detach_client(client)) == 0) {
229 kfree(i2c_get_clientdata(client)); 233 kfree(i2c_get_clientdata(client));
230 tasklet_kill(&ds1374_tasklet); 234 destroy_workqueue(ds1374_workqueue);
231 } 235 }
232 return rc; 236 return rc;
233} 237}
diff --git a/drivers/i2c/chips/m41t00.c b/drivers/i2c/chips/m41t00.c
index b5aabe7cf792..99ab4ec34390 100644
--- a/drivers/i2c/chips/m41t00.c
+++ b/drivers/i2c/chips/m41t00.c
@@ -25,6 +25,7 @@
25#include <linux/rtc.h> 25#include <linux/rtc.h>
26#include <linux/bcd.h> 26#include <linux/bcd.h>
27#include <linux/mutex.h> 27#include <linux/mutex.h>
28#include <linux/workqueue.h>
28 29
29#include <asm/time.h> 30#include <asm/time.h>
30#include <asm/rtc.h> 31#include <asm/rtc.h>
@@ -111,7 +112,7 @@ m41t00_get_rtc_time(void)
111} 112}
112 113
113static void 114static void
114m41t00_set_tlet(ulong arg) 115m41t00_set(void *arg)
115{ 116{
116 struct rtc_time tm; 117 struct rtc_time tm;
117 ulong nowtime = *(ulong *)arg; 118 ulong nowtime = *(ulong *)arg;
@@ -130,13 +131,13 @@ m41t00_set_tlet(ulong arg)
130 if ((i2c_smbus_write_byte_data(save_client, 0, tm.tm_sec & 0x7f) < 0) 131 if ((i2c_smbus_write_byte_data(save_client, 0, tm.tm_sec & 0x7f) < 0)
131 || (i2c_smbus_write_byte_data(save_client, 1, tm.tm_min & 0x7f) 132 || (i2c_smbus_write_byte_data(save_client, 1, tm.tm_min & 0x7f)
132 < 0) 133 < 0)
133 || (i2c_smbus_write_byte_data(save_client, 2, tm.tm_hour & 0x7f) 134 || (i2c_smbus_write_byte_data(save_client, 2, tm.tm_hour & 0x3f)
134 < 0) 135 < 0)
135 || (i2c_smbus_write_byte_data(save_client, 4, tm.tm_mday & 0x7f) 136 || (i2c_smbus_write_byte_data(save_client, 4, tm.tm_mday & 0x3f)
136 < 0) 137 < 0)
137 || (i2c_smbus_write_byte_data(save_client, 5, tm.tm_mon & 0x7f) 138 || (i2c_smbus_write_byte_data(save_client, 5, tm.tm_mon & 0x1f)
138 < 0) 139 < 0)
139 || (i2c_smbus_write_byte_data(save_client, 6, tm.tm_year & 0x7f) 140 || (i2c_smbus_write_byte_data(save_client, 6, tm.tm_year & 0xff)
140 < 0)) 141 < 0))
141 142
142 dev_warn(&save_client->dev,"m41t00: can't write to rtc chip\n"); 143 dev_warn(&save_client->dev,"m41t00: can't write to rtc chip\n");
@@ -145,9 +146,9 @@ m41t00_set_tlet(ulong arg)
145 return; 146 return;
146} 147}
147 148
148static ulong new_time; 149static ulong new_time;
149 150static struct workqueue_struct *m41t00_wq;
150DECLARE_TASKLET_DISABLED(m41t00_tasklet, m41t00_set_tlet, (ulong)&new_time); 151static DECLARE_WORK(m41t00_work, m41t00_set, &new_time);
151 152
152int 153int
153m41t00_set_rtc_time(ulong nowtime) 154m41t00_set_rtc_time(ulong nowtime)
@@ -155,9 +156,9 @@ m41t00_set_rtc_time(ulong nowtime)
155 new_time = nowtime; 156 new_time = nowtime;
156 157
157 if (in_interrupt()) 158 if (in_interrupt())
158 tasklet_schedule(&m41t00_tasklet); 159 queue_work(m41t00_wq, &m41t00_work);
159 else 160 else
160 m41t00_set_tlet((ulong)&new_time); 161 m41t00_set(&new_time);
161 162
162 return 0; 163 return 0;
163} 164}
@@ -189,6 +190,7 @@ m41t00_probe(struct i2c_adapter *adap, int addr, int kind)
189 return rc; 190 return rc;
190 } 191 }
191 192
193 m41t00_wq = create_singlethread_workqueue("m41t00");
192 save_client = client; 194 save_client = client;
193 return 0; 195 return 0;
194} 196}
@@ -206,7 +208,7 @@ m41t00_detach(struct i2c_client *client)
206 208
207 if ((rc = i2c_detach_client(client)) == 0) { 209 if ((rc = i2c_detach_client(client)) == 0) {
208 kfree(client); 210 kfree(client);
209 tasklet_kill(&m41t00_tasklet); 211 destroy_workqueue(m41t00_wq);
210 } 212 }
211 return rc; 213 return rc;
212} 214}
diff --git a/drivers/ide/legacy/ide-cs.c b/drivers/ide/legacy/ide-cs.c
index 4961f1e764a7..602797a44208 100644
--- a/drivers/ide/legacy/ide-cs.c
+++ b/drivers/ide/legacy/ide-cs.c
@@ -392,6 +392,7 @@ static struct pcmcia_device_id ide_ids[] = {
392 PCMCIA_DEVICE_PROD_ID12("FREECOM", "PCCARD-IDE", 0x5714cbf7, 0x48e0ab8e), 392 PCMCIA_DEVICE_PROD_ID12("FREECOM", "PCCARD-IDE", 0x5714cbf7, 0x48e0ab8e),
393 PCMCIA_DEVICE_PROD_ID12("HITACHI", "FLASH", 0xf4f43949, 0x9eb86aae), 393 PCMCIA_DEVICE_PROD_ID12("HITACHI", "FLASH", 0xf4f43949, 0x9eb86aae),
394 PCMCIA_DEVICE_PROD_ID12("HITACHI", "microdrive", 0xf4f43949, 0xa6d76178), 394 PCMCIA_DEVICE_PROD_ID12("HITACHI", "microdrive", 0xf4f43949, 0xa6d76178),
395 PCMCIA_DEVICE_PROD_ID12("IBM", "microdrive", 0xb569a6e5, 0xa6d76178),
395 PCMCIA_DEVICE_PROD_ID12("IBM", "IBM17JSSFP20", 0xb569a6e5, 0xf2508753), 396 PCMCIA_DEVICE_PROD_ID12("IBM", "IBM17JSSFP20", 0xb569a6e5, 0xf2508753),
396 PCMCIA_DEVICE_PROD_ID12("IO DATA", "CBIDE2 ", 0x547e66dc, 0x8671043b), 397 PCMCIA_DEVICE_PROD_ID12("IO DATA", "CBIDE2 ", 0x547e66dc, 0x8671043b),
397 PCMCIA_DEVICE_PROD_ID12("IO DATA", "PCIDE", 0x547e66dc, 0x5c5ab149), 398 PCMCIA_DEVICE_PROD_ID12("IO DATA", "PCIDE", 0x547e66dc, 0x5c5ab149),
diff --git a/drivers/ide/pci/alim15x3.c b/drivers/ide/pci/alim15x3.c
index cf84350efc55..8b24b4f2a839 100644
--- a/drivers/ide/pci/alim15x3.c
+++ b/drivers/ide/pci/alim15x3.c
@@ -731,6 +731,8 @@ static unsigned int __devinit ata66_ali15x3 (ide_hwif_t *hwif)
731 731
732 if(m5229_revision <= 0x20) 732 if(m5229_revision <= 0x20)
733 tmpbyte = (tmpbyte & (~0x02)) | 0x01; 733 tmpbyte = (tmpbyte & (~0x02)) | 0x01;
734 else if (m5229_revision == 0xc7)
735 tmpbyte |= 0x03;
734 else 736 else
735 tmpbyte |= 0x01; 737 tmpbyte |= 0x01;
736 738
diff --git a/drivers/ide/pci/atiixp.c b/drivers/ide/pci/atiixp.c
index df9ee9a78435..900efd1da587 100644
--- a/drivers/ide/pci/atiixp.c
+++ b/drivers/ide/pci/atiixp.c
@@ -348,6 +348,7 @@ static struct pci_device_id atiixp_pci_tbl[] = {
348 { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP200_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 348 { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP200_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
349 { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP300_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 349 { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP300_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
350 { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP400_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 350 { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP400_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
351 { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
351 { 0, }, 352 { 0, },
352}; 353};
353MODULE_DEVICE_TABLE(pci, atiixp_pci_tbl); 354MODULE_DEVICE_TABLE(pci, atiixp_pci_tbl);
diff --git a/drivers/ide/pci/pdc202xx_old.c b/drivers/ide/pci/pdc202xx_old.c
index 6f8f8645b02c..7ce5bf783688 100644
--- a/drivers/ide/pci/pdc202xx_old.c
+++ b/drivers/ide/pci/pdc202xx_old.c
@@ -798,7 +798,6 @@ static ide_pci_device_t pdc202xx_chipsets[] __devinitdata = {
798 .autodma = AUTODMA, 798 .autodma = AUTODMA,
799 .bootable = OFF_BOARD, 799 .bootable = OFF_BOARD,
800 .extra = 48, 800 .extra = 48,
801 .flags = IDEPCI_FLAG_FORCE_PDC,
802 },{ /* 2 */ 801 },{ /* 2 */
803 .name = "PDC20263", 802 .name = "PDC20263",
804 .init_setup = init_setup_pdc202ata4, 803 .init_setup = init_setup_pdc202ata4,
@@ -819,7 +818,6 @@ static ide_pci_device_t pdc202xx_chipsets[] __devinitdata = {
819 .autodma = AUTODMA, 818 .autodma = AUTODMA,
820 .bootable = OFF_BOARD, 819 .bootable = OFF_BOARD,
821 .extra = 48, 820 .extra = 48,
822 .flags = IDEPCI_FLAG_FORCE_PDC,
823 },{ /* 4 */ 821 },{ /* 4 */
824 .name = "PDC20267", 822 .name = "PDC20267",
825 .init_setup = init_setup_pdc202xx, 823 .init_setup = init_setup_pdc202xx,
diff --git a/drivers/ide/pci/sgiioc4.c b/drivers/ide/pci/sgiioc4.c
index 43b96e298363..27c9eb989a9a 100644
--- a/drivers/ide/pci/sgiioc4.c
+++ b/drivers/ide/pci/sgiioc4.c
@@ -345,17 +345,17 @@ sgiioc4_resetproc(ide_drive_t * drive)
345static u8 345static u8
346sgiioc4_INB(unsigned long port) 346sgiioc4_INB(unsigned long port)
347{ 347{
348 u8 reg = (u8) inb(port); 348 u8 reg = (u8) readb((void __iomem *) port);
349 349
350 if ((port & 0xFFF) == 0x11C) { /* Status register of IOC4 */ 350 if ((port & 0xFFF) == 0x11C) { /* Status register of IOC4 */
351 if (reg & 0x51) { /* Not busy...check for interrupt */ 351 if (reg & 0x51) { /* Not busy...check for interrupt */
352 unsigned long other_ir = port - 0x110; 352 unsigned long other_ir = port - 0x110;
353 unsigned int intr_reg = (u32) inl(other_ir); 353 unsigned int intr_reg = (u32) readl((void __iomem *) other_ir);
354 354
355 /* Clear the Interrupt, Error bits on the IOC4 */ 355 /* Clear the Interrupt, Error bits on the IOC4 */
356 if (intr_reg & 0x03) { 356 if (intr_reg & 0x03) {
357 outl(0x03, other_ir); 357 writel(0x03, (void __iomem *) other_ir);
358 intr_reg = (u32) inl(other_ir); 358 intr_reg = (u32) readl((void __iomem *) other_ir);
359 } 359 }
360 } 360 }
361 } 361 }
@@ -606,6 +606,12 @@ ide_init_sgiioc4(ide_hwif_t * hwif)
606 hwif->ide_dma_host_off = &sgiioc4_ide_dma_host_off; 606 hwif->ide_dma_host_off = &sgiioc4_ide_dma_host_off;
607 hwif->ide_dma_lostirq = &sgiioc4_ide_dma_lostirq; 607 hwif->ide_dma_lostirq = &sgiioc4_ide_dma_lostirq;
608 hwif->ide_dma_timeout = &__ide_dma_timeout; 608 hwif->ide_dma_timeout = &__ide_dma_timeout;
609
610 /*
611 * The IOC4 uses MMIO rather than Port IO.
612 * It also needs special workarounds for INB.
613 */
614 default_hwif_mmiops(hwif);
609 hwif->INB = &sgiioc4_INB; 615 hwif->INB = &sgiioc4_INB;
610} 616}
611 617
@@ -743,6 +749,6 @@ ioc4_ide_exit(void)
743module_init(ioc4_ide_init); 749module_init(ioc4_ide_init);
744module_exit(ioc4_ide_exit); 750module_exit(ioc4_ide_exit);
745 751
746MODULE_AUTHOR("Aniket Malatpure - Silicon Graphics Inc. (SGI)"); 752MODULE_AUTHOR("Aniket Malatpure/Jeremy Higdon");
747MODULE_DESCRIPTION("IDE PCI driver module for SGI IOC4 Base-IO Card"); 753MODULE_DESCRIPTION("IDE PCI driver module for SGI IOC4 Base-IO Card");
748MODULE_LICENSE("GPL"); 754MODULE_LICENSE("GPL");
diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c
index 78e30f803671..ffca8b63ee79 100644
--- a/drivers/ide/ppc/pmac.c
+++ b/drivers/ide/ppc/pmac.c
@@ -553,6 +553,8 @@ pmac_ide_init_hwif_ports(hw_regs_t *hw,
553 553
554 if (irq != NULL) 554 if (irq != NULL)
555 *irq = pmac_ide[ix].irq; 555 *irq = pmac_ide[ix].irq;
556
557 hw->dev = &pmac_ide[ix].mdev->ofdev.dev;
556} 558}
557 559
558#define PMAC_IDE_REG(x) ((void __iomem *)(IDE_DATA_REG+(x))) 560#define PMAC_IDE_REG(x) ((void __iomem *)(IDE_DATA_REG+(x)))
diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c
index 7ebf992e8c2f..462ed3006c30 100644
--- a/drivers/ide/setup-pci.c
+++ b/drivers/ide/setup-pci.c
@@ -580,7 +580,6 @@ void ide_pci_setup_ports(struct pci_dev *dev, ide_pci_device_t *d, int pciirq, a
580 int port; 580 int port;
581 int at_least_one_hwif_enabled = 0; 581 int at_least_one_hwif_enabled = 0;
582 ide_hwif_t *hwif, *mate = NULL; 582 ide_hwif_t *hwif, *mate = NULL;
583 static int secondpdc = 0;
584 u8 tmp; 583 u8 tmp;
585 584
586 index->all = 0xf0f0; 585 index->all = 0xf0f0;
@@ -592,21 +591,9 @@ void ide_pci_setup_ports(struct pci_dev *dev, ide_pci_device_t *d, int pciirq, a
592 for (port = 0; port <= 1; ++port) { 591 for (port = 0; port <= 1; ++port) {
593 ide_pci_enablebit_t *e = &(d->enablebits[port]); 592 ide_pci_enablebit_t *e = &(d->enablebits[port]);
594 593
595 /*
596 * If this is a Promise FakeRaid controller,
597 * the 2nd controller will be marked as
598 * disabled while it is actually there and enabled
599 * by the bios for raid purposes.
600 * Skip the normal "is it enabled" test for those.
601 */
602 if ((d->flags & IDEPCI_FLAG_FORCE_PDC) &&
603 (secondpdc++==1) && (port==1))
604 goto controller_ok;
605
606 if (e->reg && (pci_read_config_byte(dev, e->reg, &tmp) || 594 if (e->reg && (pci_read_config_byte(dev, e->reg, &tmp) ||
607 (tmp & e->mask) != e->val)) 595 (tmp & e->mask) != e->val))
608 continue; /* port not enabled */ 596 continue; /* port not enabled */
609controller_ok:
610 597
611 if (d->channels <= port) 598 if (d->channels <= port)
612 break; 599 break;
diff --git a/drivers/ieee1394/ohci1394.c b/drivers/ieee1394/ohci1394.c
index 19222878aae9..11f13778f139 100644
--- a/drivers/ieee1394/ohci1394.c
+++ b/drivers/ieee1394/ohci1394.c
@@ -553,7 +553,7 @@ static void ohci_initialize(struct ti_ohci *ohci)
553 * register content. 553 * register content.
554 * To actually enable physical responses is the job of our interrupt 554 * To actually enable physical responses is the job of our interrupt
555 * handler which programs the physical request filter. */ 555 * handler which programs the physical request filter. */
556 reg_write(ohci, OHCI1394_PhyUpperBound, 0xffff0000); 556 reg_write(ohci, OHCI1394_PhyUpperBound, 0x01000000);
557 557
558 DBGMSG("physUpperBoundOffset=%08x", 558 DBGMSG("physUpperBoundOffset=%08x",
559 reg_read(ohci, OHCI1394_PhyUpperBound)); 559 reg_read(ohci, OHCI1394_PhyUpperBound));
diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c
index f4206604db03..5413dc43b9f1 100644
--- a/drivers/ieee1394/sbp2.c
+++ b/drivers/ieee1394/sbp2.c
@@ -42,6 +42,7 @@
42#include <linux/kernel.h> 42#include <linux/kernel.h>
43#include <linux/list.h> 43#include <linux/list.h>
44#include <linux/string.h> 44#include <linux/string.h>
45#include <linux/stringify.h>
45#include <linux/slab.h> 46#include <linux/slab.h>
46#include <linux/interrupt.h> 47#include <linux/interrupt.h>
47#include <linux/fs.h> 48#include <linux/fs.h>
@@ -117,7 +118,8 @@ MODULE_PARM_DESC(serialize_io, "Serialize I/O coming from scsi drivers (default
117 */ 118 */
118static int max_sectors = SBP2_MAX_SECTORS; 119static int max_sectors = SBP2_MAX_SECTORS;
119module_param(max_sectors, int, 0444); 120module_param(max_sectors, int, 0444);
120MODULE_PARM_DESC(max_sectors, "Change max sectors per I/O supported (default = 255)"); 121MODULE_PARM_DESC(max_sectors, "Change max sectors per I/O supported (default = "
122 __stringify(SBP2_MAX_SECTORS) ")");
121 123
122/* 124/*
123 * Exclusive login to sbp2 device? In most cases, the sbp2 driver should 125 * Exclusive login to sbp2 device? In most cases, the sbp2 driver should
@@ -135,18 +137,45 @@ module_param(exclusive_login, int, 0644);
135MODULE_PARM_DESC(exclusive_login, "Exclusive login to sbp2 device (default = 1)"); 137MODULE_PARM_DESC(exclusive_login, "Exclusive login to sbp2 device (default = 1)");
136 138
137/* 139/*
138 * SCSI inquiry hack for really badly behaved sbp2 devices. Turn this on 140 * If any of the following workarounds is required for your device to work,
139 * if your sbp2 device is not properly handling the SCSI inquiry command. 141 * please submit the kernel messages logged by sbp2 to the linux1394-devel
140 * This hack makes the inquiry look more like a typical MS Windows inquiry 142 * mailing list.
141 * by enforcing 36 byte inquiry and avoiding access to mode_sense page 8.
142 * 143 *
143 * If force_inquiry_hack=1 is required for your device to work, 144 * - 128kB max transfer
144 * please submit the logged sbp2_firmware_revision value of this device to 145 * Limit transfer size. Necessary for some old bridges.
145 * the linux1394-devel mailing list. 146 *
147 * - 36 byte inquiry
148 * When scsi_mod probes the device, let the inquiry command look like that
149 * from MS Windows.
150 *
151 * - skip mode page 8
152 * Suppress sending of mode_sense for mode page 8 if the device pretends to
153 * support the SCSI Primary Block commands instead of Reduced Block Commands.
154 *
155 * - fix capacity
156 * Tell sd_mod to correct the last sector number reported by read_capacity.
157 * Avoids access beyond actual disk limits on devices with an off-by-one bug.
158 * Don't use this with devices which don't have this bug.
159 *
160 * - override internal blacklist
161 * Instead of adding to the built-in blacklist, use only the workarounds
162 * specified in the module load parameter.
163 * Useful if a blacklist entry interfered with a non-broken device.
146 */ 164 */
165static int sbp2_default_workarounds;
166module_param_named(workarounds, sbp2_default_workarounds, int, 0644);
167MODULE_PARM_DESC(workarounds, "Work around device bugs (default = 0"
168 ", 128kB max transfer = " __stringify(SBP2_WORKAROUND_128K_MAX_TRANS)
169 ", 36 byte inquiry = " __stringify(SBP2_WORKAROUND_INQUIRY_36)
170 ", skip mode page 8 = " __stringify(SBP2_WORKAROUND_MODE_SENSE_8)
171 ", fix capacity = " __stringify(SBP2_WORKAROUND_FIX_CAPACITY)
172 ", override internal blacklist = " __stringify(SBP2_WORKAROUND_OVERRIDE)
173 ", or a combination)");
174
175/* legacy parameter */
147static int force_inquiry_hack; 176static int force_inquiry_hack;
148module_param(force_inquiry_hack, int, 0644); 177module_param(force_inquiry_hack, int, 0644);
149MODULE_PARM_DESC(force_inquiry_hack, "Force SCSI inquiry hack (default = 0)"); 178MODULE_PARM_DESC(force_inquiry_hack, "Deprecated, use 'workarounds'");
150 179
151/* 180/*
152 * Export information about protocols/devices supported by this driver. 181 * Export information about protocols/devices supported by this driver.
@@ -266,14 +295,55 @@ static struct hpsb_protocol_driver sbp2_driver = {
266}; 295};
267 296
268/* 297/*
269 * List of device firmwares that require the inquiry hack. 298 * List of devices with known bugs.
270 * Yields a few false positives but did not break other devices so far. 299 *
300 * The firmware_revision field, masked with 0xffff00, is the best indicator
301 * for the type of bridge chip of a device. It yields a few false positives
302 * but this did not break correctly behaving devices so far.
271 */ 303 */
272static u32 sbp2_broken_inquiry_list[] = { 304static const struct {
273 0x00002800, /* Stefan Richter <stefanr@s5r6.in-berlin.de> */ 305 u32 firmware_revision;
274 /* DViCO Momobay CX-1 */ 306 u32 model_id;
275 0x00000200 /* Andreas Plesch <plesch@fas.harvard.edu> */ 307 unsigned workarounds;
276 /* QPS Fire DVDBurner */ 308} sbp2_workarounds_table[] = {
309 /* TSB42AA9 */ {
310 .firmware_revision = 0x002800,
311 .workarounds = SBP2_WORKAROUND_INQUIRY_36 |
312 SBP2_WORKAROUND_MODE_SENSE_8,
313 },
314 /* Initio bridges, actually only needed for some older ones */ {
315 .firmware_revision = 0x000200,
316 .workarounds = SBP2_WORKAROUND_INQUIRY_36,
317 },
318 /* Symbios bridge */ {
319 .firmware_revision = 0xa0b800,
320 .workarounds = SBP2_WORKAROUND_128K_MAX_TRANS,
321 },
322 /*
323 * Note about the following Apple iPod blacklist entries:
324 *
325 * There are iPods (2nd gen, 3rd gen) with model_id==0. Since our
326 * matching logic treats 0 as a wildcard, we cannot match this ID
327 * without rewriting the matching routine. Fortunately these iPods
328 * do not feature the read_capacity bug according to one report.
329 * Read_capacity behaviour as well as model_id could change due to
330 * Apple-supplied firmware updates though.
331 */
332 /* iPod 4th generation */ {
333 .firmware_revision = 0x0a2700,
334 .model_id = 0x000021,
335 .workarounds = SBP2_WORKAROUND_FIX_CAPACITY,
336 },
337 /* iPod mini */ {
338 .firmware_revision = 0x0a2700,
339 .model_id = 0x000023,
340 .workarounds = SBP2_WORKAROUND_FIX_CAPACITY,
341 },
342 /* iPod Photo */ {
343 .firmware_revision = 0x0a2700,
344 .model_id = 0x00007e,
345 .workarounds = SBP2_WORKAROUND_FIX_CAPACITY,
346 }
277}; 347};
278 348
279/************************************** 349/**************************************
@@ -765,12 +835,17 @@ static struct scsi_id_instance_data *sbp2_alloc_device(struct unit_directory *ud
765 835
766 /* Register the status FIFO address range. We could use the same FIFO 836 /* Register the status FIFO address range. We could use the same FIFO
767 * for targets at different nodes. However we need different FIFOs per 837 * for targets at different nodes. However we need different FIFOs per
768 * target in order to support multi-unit devices. */ 838 * target in order to support multi-unit devices.
839 * The FIFO is located out of the local host controller's physical range
840 * but, if possible, within the posted write area. Status writes will
841 * then be performed as unified transactions. This slightly reduces
842 * bandwidth usage, and some Prolific based devices seem to require it.
843 */
769 scsi_id->status_fifo_addr = hpsb_allocate_and_register_addrspace( 844 scsi_id->status_fifo_addr = hpsb_allocate_and_register_addrspace(
770 &sbp2_highlevel, ud->ne->host, &sbp2_ops, 845 &sbp2_highlevel, ud->ne->host, &sbp2_ops,
771 sizeof(struct sbp2_status_block), sizeof(quadlet_t), 846 sizeof(struct sbp2_status_block), sizeof(quadlet_t),
772 ~0ULL, ~0ULL); 847 0x010000000000ULL, CSR1212_ALL_SPACE_END);
773 if (!scsi_id->status_fifo_addr) { 848 if (scsi_id->status_fifo_addr == ~0ULL) {
774 SBP2_ERR("failed to allocate status FIFO address range"); 849 SBP2_ERR("failed to allocate status FIFO address range");
775 goto failed_alloc; 850 goto failed_alloc;
776 } 851 }
@@ -1450,7 +1525,8 @@ static void sbp2_parse_unit_directory(struct scsi_id_instance_data *scsi_id,
1450 struct csr1212_dentry *dentry; 1525 struct csr1212_dentry *dentry;
1451 u64 management_agent_addr; 1526 u64 management_agent_addr;
1452 u32 command_set_spec_id, command_set, unit_characteristics, 1527 u32 command_set_spec_id, command_set, unit_characteristics,
1453 firmware_revision, workarounds; 1528 firmware_revision;
1529 unsigned workarounds;
1454 int i; 1530 int i;
1455 1531
1456 SBP2_DEBUG_ENTER(); 1532 SBP2_DEBUG_ENTER();
@@ -1506,12 +1582,8 @@ static void sbp2_parse_unit_directory(struct scsi_id_instance_data *scsi_id,
1506 case SBP2_FIRMWARE_REVISION_KEY: 1582 case SBP2_FIRMWARE_REVISION_KEY:
1507 /* Firmware revision */ 1583 /* Firmware revision */
1508 firmware_revision = kv->value.immediate; 1584 firmware_revision = kv->value.immediate;
1509 if (force_inquiry_hack) 1585 SBP2_DEBUG("sbp2_firmware_revision = %x",
1510 SBP2_INFO("sbp2_firmware_revision = %x", 1586 (unsigned int)firmware_revision);
1511 (unsigned int)firmware_revision);
1512 else
1513 SBP2_DEBUG("sbp2_firmware_revision = %x",
1514 (unsigned int)firmware_revision);
1515 break; 1587 break;
1516 1588
1517 default: 1589 default:
@@ -1519,41 +1591,44 @@ static void sbp2_parse_unit_directory(struct scsi_id_instance_data *scsi_id,
1519 } 1591 }
1520 } 1592 }
1521 1593
1522 /* This is the start of our broken device checking. We try to hack 1594 workarounds = sbp2_default_workarounds;
1523 * around oddities and known defects. */ 1595 if (force_inquiry_hack) {
1524 workarounds = 0x0; 1596 SBP2_WARN("force_inquiry_hack is deprecated. "
1597 "Use parameter 'workarounds' instead.");
1598 workarounds |= SBP2_WORKAROUND_INQUIRY_36;
1599 }
1525 1600
1526 /* If the vendor id is 0xa0b8 (Symbios vendor id), then we have a 1601 if (!(workarounds & SBP2_WORKAROUND_OVERRIDE))
1527 * bridge with 128KB max transfer size limitation. For sanity, we 1602 for (i = 0; i < ARRAY_SIZE(sbp2_workarounds_table); i++) {
1528 * only voice this when the current max_sectors setting 1603 if (sbp2_workarounds_table[i].firmware_revision &&
1529 * exceeds the 128k limit. By default, that is not the case. 1604 sbp2_workarounds_table[i].firmware_revision !=
1530 * 1605 (firmware_revision & 0xffff00))
1531 * It would be really nice if we could detect this before the scsi 1606 continue;
1532 * host gets initialized. That way we can down-force the 1607 if (sbp2_workarounds_table[i].model_id &&
1533 * max_sectors to account for it. That is not currently 1608 sbp2_workarounds_table[i].model_id != ud->model_id)
1534 * possible. */ 1609 continue;
1535 if ((firmware_revision & 0xffff00) == 1610 workarounds |= sbp2_workarounds_table[i].workarounds;
1536 SBP2_128KB_BROKEN_FIRMWARE && 1611 break;
1537 (max_sectors * 512) > (128*1024)) {
1538 SBP2_WARN("Node " NODE_BUS_FMT ": Bridge only supports 128KB max transfer size.",
1539 NODE_BUS_ARGS(ud->ne->host, ud->ne->nodeid));
1540 SBP2_WARN("WARNING: Current max_sectors setting is larger than 128KB (%d sectors)!",
1541 max_sectors);
1542 workarounds |= SBP2_BREAKAGE_128K_MAX_TRANSFER;
1543 }
1544
1545 /* Check for a blacklisted set of devices that require us to force
1546 * a 36 byte host inquiry. This can be overriden as a module param
1547 * (to force all hosts). */
1548 for (i = 0; i < ARRAY_SIZE(sbp2_broken_inquiry_list); i++) {
1549 if ((firmware_revision & 0xffff00) ==
1550 sbp2_broken_inquiry_list[i]) {
1551 SBP2_WARN("Node " NODE_BUS_FMT ": Using 36byte inquiry workaround",
1552 NODE_BUS_ARGS(ud->ne->host, ud->ne->nodeid));
1553 workarounds |= SBP2_BREAKAGE_INQUIRY_HACK;
1554 break; /* No need to continue. */
1555 } 1612 }
1556 } 1613
1614 if (workarounds)
1615 SBP2_INFO("Workarounds for node " NODE_BUS_FMT ": 0x%x "
1616 "(firmware_revision 0x%06x, vendor_id 0x%06x,"
1617 " model_id 0x%06x)",
1618 NODE_BUS_ARGS(ud->ne->host, ud->ne->nodeid),
1619 workarounds, firmware_revision,
1620 ud->vendor_id ? ud->vendor_id : ud->ne->vendor_id,
1621 ud->model_id);
1622
1623 /* We would need one SCSI host template for each target to adjust
1624 * max_sectors on the fly, therefore warn only. */
1625 if (workarounds & SBP2_WORKAROUND_128K_MAX_TRANS &&
1626 (max_sectors * 512) > (128 * 1024))
1627 SBP2_WARN("Node " NODE_BUS_FMT ": Bridge only supports 128KB "
1628 "max transfer size. WARNING: Current max_sectors "
1629 "setting is larger than 128KB (%d sectors)",
1630 NODE_BUS_ARGS(ud->ne->host, ud->ne->nodeid),
1631 max_sectors);
1557 1632
1558 /* If this is a logical unit directory entry, process the parent 1633 /* If this is a logical unit directory entry, process the parent
1559 * to get the values. */ 1634 * to get the values. */
@@ -2447,19 +2522,25 @@ static int sbp2scsi_slave_alloc(struct scsi_device *sdev)
2447 2522
2448 scsi_id->sdev = sdev; 2523 scsi_id->sdev = sdev;
2449 2524
2450 if (force_inquiry_hack || 2525 if (scsi_id->workarounds & SBP2_WORKAROUND_INQUIRY_36)
2451 scsi_id->workarounds & SBP2_BREAKAGE_INQUIRY_HACK) {
2452 sdev->inquiry_len = 36; 2526 sdev->inquiry_len = 36;
2453 sdev->skip_ms_page_8 = 1;
2454 }
2455 return 0; 2527 return 0;
2456} 2528}
2457 2529
2458static int sbp2scsi_slave_configure(struct scsi_device *sdev) 2530static int sbp2scsi_slave_configure(struct scsi_device *sdev)
2459{ 2531{
2532 struct scsi_id_instance_data *scsi_id =
2533 (struct scsi_id_instance_data *)sdev->host->hostdata[0];
2534
2460 blk_queue_dma_alignment(sdev->request_queue, (512 - 1)); 2535 blk_queue_dma_alignment(sdev->request_queue, (512 - 1));
2461 sdev->use_10_for_rw = 1; 2536 sdev->use_10_for_rw = 1;
2462 sdev->use_10_for_ms = 1; 2537 sdev->use_10_for_ms = 1;
2538
2539 if (sdev->type == TYPE_DISK &&
2540 scsi_id->workarounds & SBP2_WORKAROUND_MODE_SENSE_8)
2541 sdev->skip_ms_page_8 = 1;
2542 if (scsi_id->workarounds & SBP2_WORKAROUND_FIX_CAPACITY)
2543 sdev->fix_capacity = 1;
2463 return 0; 2544 return 0;
2464} 2545}
2465 2546
@@ -2603,7 +2684,9 @@ static int sbp2_module_init(void)
2603 scsi_driver_template.cmd_per_lun = 1; 2684 scsi_driver_template.cmd_per_lun = 1;
2604 } 2685 }
2605 2686
2606 /* Set max sectors (module load option). Default is 255 sectors. */ 2687 if (sbp2_default_workarounds & SBP2_WORKAROUND_128K_MAX_TRANS &&
2688 (max_sectors * 512) > (128 * 1024))
2689 max_sectors = 128 * 1024 / 512;
2607 scsi_driver_template.max_sectors = max_sectors; 2690 scsi_driver_template.max_sectors = max_sectors;
2608 2691
2609 /* Register our high level driver with 1394 stack */ 2692 /* Register our high level driver with 1394 stack */
diff --git a/drivers/ieee1394/sbp2.h b/drivers/ieee1394/sbp2.h
index e2d357a9ea3a..f4ccc9d0fba4 100644
--- a/drivers/ieee1394/sbp2.h
+++ b/drivers/ieee1394/sbp2.h
@@ -227,11 +227,6 @@ struct sbp2_status_block {
227#define SBP2_SW_VERSION_ENTRY 0x00010483 227#define SBP2_SW_VERSION_ENTRY 0x00010483
228 228
229/* 229/*
230 * Other misc defines
231 */
232#define SBP2_128KB_BROKEN_FIRMWARE 0xa0b800
233
234/*
235 * SCSI specific stuff 230 * SCSI specific stuff
236 */ 231 */
237 232
@@ -239,6 +234,13 @@ struct sbp2_status_block {
239#define SBP2_MAX_SECTORS 255 /* Max sectors supported */ 234#define SBP2_MAX_SECTORS 255 /* Max sectors supported */
240#define SBP2_MAX_CMDS 8 /* This should be safe */ 235#define SBP2_MAX_CMDS 8 /* This should be safe */
241 236
237/* Flags for detected oddities and brokeness */
238#define SBP2_WORKAROUND_128K_MAX_TRANS 0x1
239#define SBP2_WORKAROUND_INQUIRY_36 0x2
240#define SBP2_WORKAROUND_MODE_SENSE_8 0x4
241#define SBP2_WORKAROUND_FIX_CAPACITY 0x8
242#define SBP2_WORKAROUND_OVERRIDE 0x100
243
242/* This is the two dma types we use for cmd_dma below */ 244/* This is the two dma types we use for cmd_dma below */
243enum cmd_dma_types { 245enum cmd_dma_types {
244 CMD_DMA_NONE, 246 CMD_DMA_NONE,
@@ -268,10 +270,6 @@ struct sbp2_command_info {
268 270
269}; 271};
270 272
271/* A list of flags for detected oddities and brokeness. */
272#define SBP2_BREAKAGE_128K_MAX_TRANSFER 0x1
273#define SBP2_BREAKAGE_INQUIRY_HACK 0x2
274
275struct sbp2scsi_host_info; 273struct sbp2scsi_host_info;
276 274
277/* 275/*
@@ -345,7 +343,7 @@ struct scsi_id_instance_data {
345 struct Scsi_Host *scsi_host; 343 struct Scsi_Host *scsi_host;
346 344
347 /* Device specific workarounds/brokeness */ 345 /* Device specific workarounds/brokeness */
348 u32 workarounds; 346 unsigned workarounds;
349}; 347};
350 348
351/* Sbp2 host data structure (one per IEEE1394 host) */ 349/* Sbp2 host data structure (one per IEEE1394 host) */
diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
index 7cfedb8d9bcd..86fee43502cd 100644
--- a/drivers/infiniband/core/cm.c
+++ b/drivers/infiniband/core/cm.c
@@ -34,6 +34,8 @@
34 * 34 *
35 * $Id: cm.c 2821 2005-07-08 17:07:28Z sean.hefty $ 35 * $Id: cm.c 2821 2005-07-08 17:07:28Z sean.hefty $
36 */ 36 */
37
38#include <linux/completion.h>
37#include <linux/dma-mapping.h> 39#include <linux/dma-mapping.h>
38#include <linux/err.h> 40#include <linux/err.h>
39#include <linux/idr.h> 41#include <linux/idr.h>
@@ -122,7 +124,7 @@ struct cm_id_private {
122 struct rb_node service_node; 124 struct rb_node service_node;
123 struct rb_node sidr_id_node; 125 struct rb_node sidr_id_node;
124 spinlock_t lock; /* Do not acquire inside cm.lock */ 126 spinlock_t lock; /* Do not acquire inside cm.lock */
125 wait_queue_head_t wait; 127 struct completion comp;
126 atomic_t refcount; 128 atomic_t refcount;
127 129
128 struct ib_mad_send_buf *msg; 130 struct ib_mad_send_buf *msg;
@@ -159,7 +161,7 @@ static void cm_work_handler(void *data);
159static inline void cm_deref_id(struct cm_id_private *cm_id_priv) 161static inline void cm_deref_id(struct cm_id_private *cm_id_priv)
160{ 162{
161 if (atomic_dec_and_test(&cm_id_priv->refcount)) 163 if (atomic_dec_and_test(&cm_id_priv->refcount))
162 wake_up(&cm_id_priv->wait); 164 complete(&cm_id_priv->comp);
163} 165}
164 166
165static int cm_alloc_msg(struct cm_id_private *cm_id_priv, 167static int cm_alloc_msg(struct cm_id_private *cm_id_priv,
@@ -559,7 +561,7 @@ struct ib_cm_id *ib_create_cm_id(struct ib_device *device,
559 goto error; 561 goto error;
560 562
561 spin_lock_init(&cm_id_priv->lock); 563 spin_lock_init(&cm_id_priv->lock);
562 init_waitqueue_head(&cm_id_priv->wait); 564 init_completion(&cm_id_priv->comp);
563 INIT_LIST_HEAD(&cm_id_priv->work_list); 565 INIT_LIST_HEAD(&cm_id_priv->work_list);
564 atomic_set(&cm_id_priv->work_count, -1); 566 atomic_set(&cm_id_priv->work_count, -1);
565 atomic_set(&cm_id_priv->refcount, 1); 567 atomic_set(&cm_id_priv->refcount, 1);
@@ -724,8 +726,8 @@ retest:
724 } 726 }
725 727
726 cm_free_id(cm_id->local_id); 728 cm_free_id(cm_id->local_id);
727 atomic_dec(&cm_id_priv->refcount); 729 cm_deref_id(cm_id_priv);
728 wait_event(cm_id_priv->wait, !atomic_read(&cm_id_priv->refcount)); 730 wait_for_completion(&cm_id_priv->comp);
729 while ((work = cm_dequeue_work(cm_id_priv)) != NULL) 731 while ((work = cm_dequeue_work(cm_id_priv)) != NULL)
730 cm_free_work(work); 732 cm_free_work(work);
731 if (cm_id_priv->private_data && cm_id_priv->private_data_len) 733 if (cm_id_priv->private_data && cm_id_priv->private_data_len)
diff --git a/drivers/infiniband/core/mad.c b/drivers/infiniband/core/mad.c
index 3a702da83e41..5ad41a64314c 100644
--- a/drivers/infiniband/core/mad.c
+++ b/drivers/infiniband/core/mad.c
@@ -228,10 +228,7 @@ struct ib_mad_agent *ib_register_mad_agent(struct ib_device *device,
228 goto error1; 228 goto error1;
229 } 229 }
230 /* Make sure class supplied is consistent with RMPP */ 230 /* Make sure class supplied is consistent with RMPP */
231 if (ib_is_mad_class_rmpp(mad_reg_req->mgmt_class)) { 231 if (!ib_is_mad_class_rmpp(mad_reg_req->mgmt_class)) {
232 if (!rmpp_version)
233 goto error1;
234 } else {
235 if (rmpp_version) 232 if (rmpp_version)
236 goto error1; 233 goto error1;
237 } 234 }
@@ -355,7 +352,7 @@ struct ib_mad_agent *ib_register_mad_agent(struct ib_device *device,
355 INIT_WORK(&mad_agent_priv->local_work, local_completions, 352 INIT_WORK(&mad_agent_priv->local_work, local_completions,
356 mad_agent_priv); 353 mad_agent_priv);
357 atomic_set(&mad_agent_priv->refcount, 1); 354 atomic_set(&mad_agent_priv->refcount, 1);
358 init_waitqueue_head(&mad_agent_priv->wait); 355 init_completion(&mad_agent_priv->comp);
359 356
360 return &mad_agent_priv->agent; 357 return &mad_agent_priv->agent;
361 358
@@ -470,7 +467,7 @@ struct ib_mad_agent *ib_register_mad_snoop(struct ib_device *device,
470 mad_snoop_priv->agent.qp = port_priv->qp_info[qpn].qp; 467 mad_snoop_priv->agent.qp = port_priv->qp_info[qpn].qp;
471 mad_snoop_priv->agent.port_num = port_num; 468 mad_snoop_priv->agent.port_num = port_num;
472 mad_snoop_priv->mad_snoop_flags = mad_snoop_flags; 469 mad_snoop_priv->mad_snoop_flags = mad_snoop_flags;
473 init_waitqueue_head(&mad_snoop_priv->wait); 470 init_completion(&mad_snoop_priv->comp);
474 mad_snoop_priv->snoop_index = register_snoop_agent( 471 mad_snoop_priv->snoop_index = register_snoop_agent(
475 &port_priv->qp_info[qpn], 472 &port_priv->qp_info[qpn],
476 mad_snoop_priv); 473 mad_snoop_priv);
@@ -489,6 +486,18 @@ error1:
489} 486}
490EXPORT_SYMBOL(ib_register_mad_snoop); 487EXPORT_SYMBOL(ib_register_mad_snoop);
491 488
489static inline void deref_mad_agent(struct ib_mad_agent_private *mad_agent_priv)
490{
491 if (atomic_dec_and_test(&mad_agent_priv->refcount))
492 complete(&mad_agent_priv->comp);
493}
494
495static inline void deref_snoop_agent(struct ib_mad_snoop_private *mad_snoop_priv)
496{
497 if (atomic_dec_and_test(&mad_snoop_priv->refcount))
498 complete(&mad_snoop_priv->comp);
499}
500
492static void unregister_mad_agent(struct ib_mad_agent_private *mad_agent_priv) 501static void unregister_mad_agent(struct ib_mad_agent_private *mad_agent_priv)
493{ 502{
494 struct ib_mad_port_private *port_priv; 503 struct ib_mad_port_private *port_priv;
@@ -512,9 +521,8 @@ static void unregister_mad_agent(struct ib_mad_agent_private *mad_agent_priv)
512 flush_workqueue(port_priv->wq); 521 flush_workqueue(port_priv->wq);
513 ib_cancel_rmpp_recvs(mad_agent_priv); 522 ib_cancel_rmpp_recvs(mad_agent_priv);
514 523
515 atomic_dec(&mad_agent_priv->refcount); 524 deref_mad_agent(mad_agent_priv);
516 wait_event(mad_agent_priv->wait, 525 wait_for_completion(&mad_agent_priv->comp);
517 !atomic_read(&mad_agent_priv->refcount));
518 526
519 kfree(mad_agent_priv->reg_req); 527 kfree(mad_agent_priv->reg_req);
520 ib_dereg_mr(mad_agent_priv->agent.mr); 528 ib_dereg_mr(mad_agent_priv->agent.mr);
@@ -532,9 +540,8 @@ static void unregister_mad_snoop(struct ib_mad_snoop_private *mad_snoop_priv)
532 atomic_dec(&qp_info->snoop_count); 540 atomic_dec(&qp_info->snoop_count);
533 spin_unlock_irqrestore(&qp_info->snoop_lock, flags); 541 spin_unlock_irqrestore(&qp_info->snoop_lock, flags);
534 542
535 atomic_dec(&mad_snoop_priv->refcount); 543 deref_snoop_agent(mad_snoop_priv);
536 wait_event(mad_snoop_priv->wait, 544 wait_for_completion(&mad_snoop_priv->comp);
537 !atomic_read(&mad_snoop_priv->refcount));
538 545
539 kfree(mad_snoop_priv); 546 kfree(mad_snoop_priv);
540} 547}
@@ -603,8 +610,7 @@ static void snoop_send(struct ib_mad_qp_info *qp_info,
603 spin_unlock_irqrestore(&qp_info->snoop_lock, flags); 610 spin_unlock_irqrestore(&qp_info->snoop_lock, flags);
604 mad_snoop_priv->agent.snoop_handler(&mad_snoop_priv->agent, 611 mad_snoop_priv->agent.snoop_handler(&mad_snoop_priv->agent,
605 send_buf, mad_send_wc); 612 send_buf, mad_send_wc);
606 if (atomic_dec_and_test(&mad_snoop_priv->refcount)) 613 deref_snoop_agent(mad_snoop_priv);
607 wake_up(&mad_snoop_priv->wait);
608 spin_lock_irqsave(&qp_info->snoop_lock, flags); 614 spin_lock_irqsave(&qp_info->snoop_lock, flags);
609 } 615 }
610 spin_unlock_irqrestore(&qp_info->snoop_lock, flags); 616 spin_unlock_irqrestore(&qp_info->snoop_lock, flags);
@@ -629,8 +635,7 @@ static void snoop_recv(struct ib_mad_qp_info *qp_info,
629 spin_unlock_irqrestore(&qp_info->snoop_lock, flags); 635 spin_unlock_irqrestore(&qp_info->snoop_lock, flags);
630 mad_snoop_priv->agent.recv_handler(&mad_snoop_priv->agent, 636 mad_snoop_priv->agent.recv_handler(&mad_snoop_priv->agent,
631 mad_recv_wc); 637 mad_recv_wc);
632 if (atomic_dec_and_test(&mad_snoop_priv->refcount)) 638 deref_snoop_agent(mad_snoop_priv);
633 wake_up(&mad_snoop_priv->wait);
634 spin_lock_irqsave(&qp_info->snoop_lock, flags); 639 spin_lock_irqsave(&qp_info->snoop_lock, flags);
635 } 640 }
636 spin_unlock_irqrestore(&qp_info->snoop_lock, flags); 641 spin_unlock_irqrestore(&qp_info->snoop_lock, flags);
@@ -971,8 +976,7 @@ void ib_free_send_mad(struct ib_mad_send_buf *send_buf)
971 976
972 free_send_rmpp_list(mad_send_wr); 977 free_send_rmpp_list(mad_send_wr);
973 kfree(send_buf->mad); 978 kfree(send_buf->mad);
974 if (atomic_dec_and_test(&mad_agent_priv->refcount)) 979 deref_mad_agent(mad_agent_priv);
975 wake_up(&mad_agent_priv->wait);
976} 980}
977EXPORT_SYMBOL(ib_free_send_mad); 981EXPORT_SYMBOL(ib_free_send_mad);
978 982
@@ -1760,8 +1764,7 @@ static void ib_mad_complete_recv(struct ib_mad_agent_private *mad_agent_priv,
1760 mad_recv_wc = ib_process_rmpp_recv_wc(mad_agent_priv, 1764 mad_recv_wc = ib_process_rmpp_recv_wc(mad_agent_priv,
1761 mad_recv_wc); 1765 mad_recv_wc);
1762 if (!mad_recv_wc) { 1766 if (!mad_recv_wc) {
1763 if (atomic_dec_and_test(&mad_agent_priv->refcount)) 1767 deref_mad_agent(mad_agent_priv);
1764 wake_up(&mad_agent_priv->wait);
1765 return; 1768 return;
1766 } 1769 }
1767 } 1770 }
@@ -1773,8 +1776,7 @@ static void ib_mad_complete_recv(struct ib_mad_agent_private *mad_agent_priv,
1773 if (!mad_send_wr) { 1776 if (!mad_send_wr) {
1774 spin_unlock_irqrestore(&mad_agent_priv->lock, flags); 1777 spin_unlock_irqrestore(&mad_agent_priv->lock, flags);
1775 ib_free_recv_mad(mad_recv_wc); 1778 ib_free_recv_mad(mad_recv_wc);
1776 if (atomic_dec_and_test(&mad_agent_priv->refcount)) 1779 deref_mad_agent(mad_agent_priv);
1777 wake_up(&mad_agent_priv->wait);
1778 return; 1780 return;
1779 } 1781 }
1780 ib_mark_mad_done(mad_send_wr); 1782 ib_mark_mad_done(mad_send_wr);
@@ -1793,8 +1795,7 @@ static void ib_mad_complete_recv(struct ib_mad_agent_private *mad_agent_priv,
1793 } else { 1795 } else {
1794 mad_agent_priv->agent.recv_handler(&mad_agent_priv->agent, 1796 mad_agent_priv->agent.recv_handler(&mad_agent_priv->agent,
1795 mad_recv_wc); 1797 mad_recv_wc);
1796 if (atomic_dec_and_test(&mad_agent_priv->refcount)) 1798 deref_mad_agent(mad_agent_priv);
1797 wake_up(&mad_agent_priv->wait);
1798 } 1799 }
1799} 1800}
1800 1801
@@ -2024,8 +2025,7 @@ void ib_mad_complete_send_wr(struct ib_mad_send_wr_private *mad_send_wr,
2024 mad_send_wc); 2025 mad_send_wc);
2025 2026
2026 /* Release reference on agent taken when sending */ 2027 /* Release reference on agent taken when sending */
2027 if (atomic_dec_and_test(&mad_agent_priv->refcount)) 2028 deref_mad_agent(mad_agent_priv);
2028 wake_up(&mad_agent_priv->wait);
2029 return; 2029 return;
2030done: 2030done:
2031 spin_unlock_irqrestore(&mad_agent_priv->lock, flags); 2031 spin_unlock_irqrestore(&mad_agent_priv->lock, flags);
diff --git a/drivers/infiniband/core/mad_priv.h b/drivers/infiniband/core/mad_priv.h
index 6c9c133d71ef..b4fa28d3160f 100644
--- a/drivers/infiniband/core/mad_priv.h
+++ b/drivers/infiniband/core/mad_priv.h
@@ -37,6 +37,7 @@
37#ifndef __IB_MAD_PRIV_H__ 37#ifndef __IB_MAD_PRIV_H__
38#define __IB_MAD_PRIV_H__ 38#define __IB_MAD_PRIV_H__
39 39
40#include <linux/completion.h>
40#include <linux/pci.h> 41#include <linux/pci.h>
41#include <linux/kthread.h> 42#include <linux/kthread.h>
42#include <linux/workqueue.h> 43#include <linux/workqueue.h>
@@ -108,7 +109,7 @@ struct ib_mad_agent_private {
108 struct list_head rmpp_list; 109 struct list_head rmpp_list;
109 110
110 atomic_t refcount; 111 atomic_t refcount;
111 wait_queue_head_t wait; 112 struct completion comp;
112}; 113};
113 114
114struct ib_mad_snoop_private { 115struct ib_mad_snoop_private {
@@ -117,7 +118,7 @@ struct ib_mad_snoop_private {
117 int snoop_index; 118 int snoop_index;
118 int mad_snoop_flags; 119 int mad_snoop_flags;
119 atomic_t refcount; 120 atomic_t refcount;
120 wait_queue_head_t wait; 121 struct completion comp;
121}; 122};
122 123
123struct ib_mad_send_wr_private { 124struct ib_mad_send_wr_private {
diff --git a/drivers/infiniband/core/mad_rmpp.c b/drivers/infiniband/core/mad_rmpp.c
index dfd4e588ce03..d4704e054e30 100644
--- a/drivers/infiniband/core/mad_rmpp.c
+++ b/drivers/infiniband/core/mad_rmpp.c
@@ -49,7 +49,7 @@ struct mad_rmpp_recv {
49 struct list_head list; 49 struct list_head list;
50 struct work_struct timeout_work; 50 struct work_struct timeout_work;
51 struct work_struct cleanup_work; 51 struct work_struct cleanup_work;
52 wait_queue_head_t wait; 52 struct completion comp;
53 enum rmpp_state state; 53 enum rmpp_state state;
54 spinlock_t lock; 54 spinlock_t lock;
55 atomic_t refcount; 55 atomic_t refcount;
@@ -69,10 +69,16 @@ struct mad_rmpp_recv {
69 u8 method; 69 u8 method;
70}; 70};
71 71
72static inline void deref_rmpp_recv(struct mad_rmpp_recv *rmpp_recv)
73{
74 if (atomic_dec_and_test(&rmpp_recv->refcount))
75 complete(&rmpp_recv->comp);
76}
77
72static void destroy_rmpp_recv(struct mad_rmpp_recv *rmpp_recv) 78static void destroy_rmpp_recv(struct mad_rmpp_recv *rmpp_recv)
73{ 79{
74 atomic_dec(&rmpp_recv->refcount); 80 deref_rmpp_recv(rmpp_recv);
75 wait_event(rmpp_recv->wait, !atomic_read(&rmpp_recv->refcount)); 81 wait_for_completion(&rmpp_recv->comp);
76 ib_destroy_ah(rmpp_recv->ah); 82 ib_destroy_ah(rmpp_recv->ah);
77 kfree(rmpp_recv); 83 kfree(rmpp_recv);
78} 84}
@@ -253,7 +259,7 @@ create_rmpp_recv(struct ib_mad_agent_private *agent,
253 goto error; 259 goto error;
254 260
255 rmpp_recv->agent = agent; 261 rmpp_recv->agent = agent;
256 init_waitqueue_head(&rmpp_recv->wait); 262 init_completion(&rmpp_recv->comp);
257 INIT_WORK(&rmpp_recv->timeout_work, recv_timeout_handler, rmpp_recv); 263 INIT_WORK(&rmpp_recv->timeout_work, recv_timeout_handler, rmpp_recv);
258 INIT_WORK(&rmpp_recv->cleanup_work, recv_cleanup_handler, rmpp_recv); 264 INIT_WORK(&rmpp_recv->cleanup_work, recv_cleanup_handler, rmpp_recv);
259 spin_lock_init(&rmpp_recv->lock); 265 spin_lock_init(&rmpp_recv->lock);
@@ -279,12 +285,6 @@ error: kfree(rmpp_recv);
279 return NULL; 285 return NULL;
280} 286}
281 287
282static inline void deref_rmpp_recv(struct mad_rmpp_recv *rmpp_recv)
283{
284 if (atomic_dec_and_test(&rmpp_recv->refcount))
285 wake_up(&rmpp_recv->wait);
286}
287
288static struct mad_rmpp_recv * 288static struct mad_rmpp_recv *
289find_rmpp_recv(struct ib_mad_agent_private *agent, 289find_rmpp_recv(struct ib_mad_agent_private *agent,
290 struct ib_mad_recv_wc *mad_recv_wc) 290 struct ib_mad_recv_wc *mad_recv_wc)
diff --git a/drivers/infiniband/core/sysfs.c b/drivers/infiniband/core/sysfs.c
index 15121cb5a1f6..21f9282c1b25 100644
--- a/drivers/infiniband/core/sysfs.c
+++ b/drivers/infiniband/core/sysfs.c
@@ -336,7 +336,7 @@ static ssize_t show_pma_counter(struct ib_port *p, struct port_attribute *attr,
336 switch (width) { 336 switch (width) {
337 case 4: 337 case 4:
338 ret = sprintf(buf, "%u\n", (out_mad->data[40 + offset / 8] >> 338 ret = sprintf(buf, "%u\n", (out_mad->data[40 + offset / 8] >>
339 (offset % 4)) & 0xf); 339 (4 - (offset % 8))) & 0xf);
340 break; 340 break;
341 case 8: 341 case 8:
342 ret = sprintf(buf, "%u\n", out_mad->data[40 + offset / 8]); 342 ret = sprintf(buf, "%u\n", out_mad->data[40 + offset / 8]);
diff --git a/drivers/infiniband/core/ucm.c b/drivers/infiniband/core/ucm.c
index f6a05965a4e8..9164a09b6ccd 100644
--- a/drivers/infiniband/core/ucm.c
+++ b/drivers/infiniband/core/ucm.c
@@ -32,6 +32,8 @@
32 * 32 *
33 * $Id: ucm.c 2594 2005-06-13 19:46:02Z libor $ 33 * $Id: ucm.c 2594 2005-06-13 19:46:02Z libor $
34 */ 34 */
35
36#include <linux/completion.h>
35#include <linux/init.h> 37#include <linux/init.h>
36#include <linux/fs.h> 38#include <linux/fs.h>
37#include <linux/module.h> 39#include <linux/module.h>
@@ -72,7 +74,7 @@ struct ib_ucm_file {
72 74
73struct ib_ucm_context { 75struct ib_ucm_context {
74 int id; 76 int id;
75 wait_queue_head_t wait; 77 struct completion comp;
76 atomic_t ref; 78 atomic_t ref;
77 int events_reported; 79 int events_reported;
78 80
@@ -138,7 +140,7 @@ static struct ib_ucm_context *ib_ucm_ctx_get(struct ib_ucm_file *file, int id)
138static void ib_ucm_ctx_put(struct ib_ucm_context *ctx) 140static void ib_ucm_ctx_put(struct ib_ucm_context *ctx)
139{ 141{
140 if (atomic_dec_and_test(&ctx->ref)) 142 if (atomic_dec_and_test(&ctx->ref))
141 wake_up(&ctx->wait); 143 complete(&ctx->comp);
142} 144}
143 145
144static inline int ib_ucm_new_cm_id(int event) 146static inline int ib_ucm_new_cm_id(int event)
@@ -178,7 +180,7 @@ static struct ib_ucm_context *ib_ucm_ctx_alloc(struct ib_ucm_file *file)
178 return NULL; 180 return NULL;
179 181
180 atomic_set(&ctx->ref, 1); 182 atomic_set(&ctx->ref, 1);
181 init_waitqueue_head(&ctx->wait); 183 init_completion(&ctx->comp);
182 ctx->file = file; 184 ctx->file = file;
183 INIT_LIST_HEAD(&ctx->events); 185 INIT_LIST_HEAD(&ctx->events);
184 186
@@ -586,8 +588,8 @@ static ssize_t ib_ucm_destroy_id(struct ib_ucm_file *file,
586 if (IS_ERR(ctx)) 588 if (IS_ERR(ctx))
587 return PTR_ERR(ctx); 589 return PTR_ERR(ctx);
588 590
589 atomic_dec(&ctx->ref); 591 ib_ucm_ctx_put(ctx);
590 wait_event(ctx->wait, !atomic_read(&ctx->ref)); 592 wait_for_completion(&ctx->comp);
591 593
592 /* No new events will be generated after destroying the cm_id. */ 594 /* No new events will be generated after destroying the cm_id. */
593 ib_destroy_cm_id(ctx->cm_id); 595 ib_destroy_cm_id(ctx->cm_id);
diff --git a/drivers/infiniband/core/uverbs_mem.c b/drivers/infiniband/core/uverbs_mem.c
index 36a32c315668..efe147dbeb42 100644
--- a/drivers/infiniband/core/uverbs_mem.c
+++ b/drivers/infiniband/core/uverbs_mem.c
@@ -211,8 +211,10 @@ void ib_umem_release_on_close(struct ib_device *dev, struct ib_umem *umem)
211 */ 211 */
212 212
213 work = kmalloc(sizeof *work, GFP_KERNEL); 213 work = kmalloc(sizeof *work, GFP_KERNEL);
214 if (!work) 214 if (!work) {
215 mmput(mm);
215 return; 216 return;
217 }
216 218
217 INIT_WORK(&work->work, ib_umem_account, work); 219 INIT_WORK(&work->work, ib_umem_account, work);
218 work->mm = mm; 220 work->mm = mm;
diff --git a/drivers/infiniband/hw/ipath/ipath_debug.h b/drivers/infiniband/hw/ipath/ipath_debug.h
index 593e28969c69..46762387f5f8 100644
--- a/drivers/infiniband/hw/ipath/ipath_debug.h
+++ b/drivers/infiniband/hw/ipath/ipath_debug.h
@@ -60,11 +60,11 @@
60#define __IPATH_KERNEL_SEND 0x2000 /* use kernel mode send */ 60#define __IPATH_KERNEL_SEND 0x2000 /* use kernel mode send */
61#define __IPATH_EPKTDBG 0x4000 /* print ethernet packet data */ 61#define __IPATH_EPKTDBG 0x4000 /* print ethernet packet data */
62#define __IPATH_SMADBG 0x8000 /* sma packet debug */ 62#define __IPATH_SMADBG 0x8000 /* sma packet debug */
63#define __IPATH_IPATHDBG 0x10000 /* Ethernet (IPATH) general debug on */ 63#define __IPATH_IPATHDBG 0x10000 /* Ethernet (IPATH) gen debug */
64#define __IPATH_IPATHWARN 0x20000 /* Ethernet (IPATH) warnings on */ 64#define __IPATH_IPATHWARN 0x20000 /* Ethernet (IPATH) warnings */
65#define __IPATH_IPATHERR 0x40000 /* Ethernet (IPATH) errors on */ 65#define __IPATH_IPATHERR 0x40000 /* Ethernet (IPATH) errors */
66#define __IPATH_IPATHPD 0x80000 /* Ethernet (IPATH) packet dump on */ 66#define __IPATH_IPATHPD 0x80000 /* Ethernet (IPATH) packet dump */
67#define __IPATH_IPATHTABLE 0x100000 /* Ethernet (IPATH) table dump on */ 67#define __IPATH_IPATHTABLE 0x100000 /* Ethernet (IPATH) table dump */
68 68
69#else /* _IPATH_DEBUGGING */ 69#else /* _IPATH_DEBUGGING */
70 70
@@ -79,11 +79,12 @@
79#define __IPATH_TRSAMPLE 0x0 /* generate trace buffer sample entries */ 79#define __IPATH_TRSAMPLE 0x0 /* generate trace buffer sample entries */
80#define __IPATH_VERBDBG 0x0 /* very verbose debug */ 80#define __IPATH_VERBDBG 0x0 /* very verbose debug */
81#define __IPATH_PKTDBG 0x0 /* print packet data */ 81#define __IPATH_PKTDBG 0x0 /* print packet data */
82#define __IPATH_PROCDBG 0x0 /* print process startup (init)/exit messages */ 82#define __IPATH_PROCDBG 0x0 /* process startup (init)/exit messages */
83/* print mmap/nopage stuff, not using VDBG any more */ 83/* print mmap/nopage stuff, not using VDBG any more */
84#define __IPATH_MMDBG 0x0 84#define __IPATH_MMDBG 0x0
85#define __IPATH_EPKTDBG 0x0 /* print ethernet packet data */ 85#define __IPATH_EPKTDBG 0x0 /* print ethernet packet data */
86#define __IPATH_SMADBG 0x0 /* print process startup (init)/exit messages */#define __IPATH_IPATHDBG 0x0 /* Ethernet (IPATH) table dump on */ 86#define __IPATH_SMADBG 0x0 /* process startup (init)/exit messages */
87#define __IPATH_IPATHDBG 0x0 /* Ethernet (IPATH) table dump on */
87#define __IPATH_IPATHWARN 0x0 /* Ethernet (IPATH) warnings on */ 88#define __IPATH_IPATHWARN 0x0 /* Ethernet (IPATH) warnings on */
88#define __IPATH_IPATHERR 0x0 /* Ethernet (IPATH) errors on */ 89#define __IPATH_IPATHERR 0x0 /* Ethernet (IPATH) errors on */
89#define __IPATH_IPATHPD 0x0 /* Ethernet (IPATH) packet dump on */ 90#define __IPATH_IPATHPD 0x0 /* Ethernet (IPATH) packet dump on */
diff --git a/drivers/infiniband/hw/ipath/ipath_diag.c b/drivers/infiniband/hw/ipath/ipath_diag.c
index cd533cf951c2..28ddceb260e8 100644
--- a/drivers/infiniband/hw/ipath/ipath_diag.c
+++ b/drivers/infiniband/hw/ipath/ipath_diag.c
@@ -277,13 +277,14 @@ static int ipath_diag_open(struct inode *in, struct file *fp)
277 277
278bail: 278bail:
279 spin_unlock_irqrestore(&ipath_devs_lock, flags); 279 spin_unlock_irqrestore(&ipath_devs_lock, flags);
280 mutex_unlock(&ipath_mutex);
281 280
282 /* Only expose a way to reset the device if we 281 /* Only expose a way to reset the device if we
283 make it into diag mode. */ 282 make it into diag mode. */
284 if (ret == 0) 283 if (ret == 0)
285 ipath_expose_reset(&dd->pcidev->dev); 284 ipath_expose_reset(&dd->pcidev->dev);
286 285
286 mutex_unlock(&ipath_mutex);
287
287 return ret; 288 return ret;
288} 289}
289 290
@@ -365,15 +366,3 @@ static ssize_t ipath_diag_write(struct file *fp, const char __user *data,
365bail: 366bail:
366 return ret; 367 return ret;
367} 368}
368
369void ipath_diag_bringup_link(struct ipath_devdata *dd)
370{
371 if (diag_set_link || (dd->ipath_flags & IPATH_LINKACTIVE))
372 return;
373
374 diag_set_link = 1;
375 ipath_cdbg(VERBOSE, "Trying to set to set link active for "
376 "diag pkt\n");
377 ipath_layer_set_linkstate(dd, IPATH_IB_LINKARM);
378 ipath_layer_set_linkstate(dd, IPATH_IB_LINKACTIVE);
379}
diff --git a/drivers/infiniband/hw/ipath/ipath_driver.c b/drivers/infiniband/hw/ipath/ipath_driver.c
index 58a94efb0070..dddcdae736ac 100644
--- a/drivers/infiniband/hw/ipath/ipath_driver.c
+++ b/drivers/infiniband/hw/ipath/ipath_driver.c
@@ -116,10 +116,9 @@ static int __devinit ipath_init_one(struct pci_dev *,
116#define PCI_DEVICE_ID_INFINIPATH_PE800 0x10 116#define PCI_DEVICE_ID_INFINIPATH_PE800 0x10
117 117
118static const struct pci_device_id ipath_pci_tbl[] = { 118static const struct pci_device_id ipath_pci_tbl[] = {
119 {PCI_DEVICE(PCI_VENDOR_ID_PATHSCALE, 119 { PCI_DEVICE(PCI_VENDOR_ID_PATHSCALE, PCI_DEVICE_ID_INFINIPATH_HT) },
120 PCI_DEVICE_ID_INFINIPATH_HT)}, 120 { PCI_DEVICE(PCI_VENDOR_ID_PATHSCALE, PCI_DEVICE_ID_INFINIPATH_PE800) },
121 {PCI_DEVICE(PCI_VENDOR_ID_PATHSCALE, 121 { 0, }
122 PCI_DEVICE_ID_INFINIPATH_PE800)},
123}; 122};
124 123
125MODULE_DEVICE_TABLE(pci, ipath_pci_tbl); 124MODULE_DEVICE_TABLE(pci, ipath_pci_tbl);
@@ -418,9 +417,19 @@ static int __devinit ipath_init_one(struct pci_dev *pdev,
418 417
419 ret = pci_set_dma_mask(pdev, DMA_64BIT_MASK); 418 ret = pci_set_dma_mask(pdev, DMA_64BIT_MASK);
420 if (ret) { 419 if (ret) {
421 dev_info(&pdev->dev, "pci_set_dma_mask unit %u " 420 /*
422 "fails: %d\n", dd->ipath_unit, ret); 421 * if the 64 bit setup fails, try 32 bit. Some systems
423 goto bail_regions; 422 * do not setup 64 bit maps on systems with 2GB or less
423 * memory installed.
424 */
425 ret = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
426 if (ret) {
427 dev_info(&pdev->dev, "pci_set_dma_mask unit %u "
428 "fails: %d\n", dd->ipath_unit, ret);
429 goto bail_regions;
430 }
431 else
432 ipath_dbg("No 64bit DMA mask, used 32 bit mask\n");
424 } 433 }
425 434
426 pci_set_master(pdev); 435 pci_set_master(pdev);
@@ -1729,7 +1738,7 @@ void ipath_free_pddata(struct ipath_devdata *dd, u32 port, int freehdrq)
1729 } 1738 }
1730} 1739}
1731 1740
1732int __init infinipath_init(void) 1741static int __init infinipath_init(void)
1733{ 1742{
1734 int ret; 1743 int ret;
1735 1744
@@ -1896,19 +1905,19 @@ static void __exit infinipath_cleanup(void)
1896 } else 1905 } else
1897 ipath_dbg("irq is 0, not doing free_irq " 1906 ipath_dbg("irq is 0, not doing free_irq "
1898 "for unit %u\n", dd->ipath_unit); 1907 "for unit %u\n", dd->ipath_unit);
1899 dd->pcidev = NULL;
1900 }
1901 1908
1902 /* 1909 /*
1903 * we check for NULL here, because it's outside the kregbase 1910 * we check for NULL here, because it's outside
1904 * check, and we need to call it after the free_irq. Thus 1911 * the kregbase check, and we need to call it
1905 * it's possible that the function pointers were never 1912 * after the free_irq. Thus it's possible that
1906 * initialized. 1913 * the function pointers were never initialized.
1907 */ 1914 */
1908 if (dd->ipath_f_cleanup) 1915 if (dd->ipath_f_cleanup)
1909 /* clean up chip-specific stuff */ 1916 /* clean up chip-specific stuff */
1910 dd->ipath_f_cleanup(dd); 1917 dd->ipath_f_cleanup(dd);
1911 1918
1919 dd->pcidev = NULL;
1920 }
1912 spin_lock_irqsave(&ipath_devs_lock, flags); 1921 spin_lock_irqsave(&ipath_devs_lock, flags);
1913 } 1922 }
1914 1923
@@ -1949,7 +1958,7 @@ int ipath_reset_device(int unit)
1949 } 1958 }
1950 1959
1951 if (dd->ipath_pd) 1960 if (dd->ipath_pd)
1952 for (i = 1; i < dd->ipath_portcnt; i++) { 1961 for (i = 1; i < dd->ipath_cfgports; i++) {
1953 if (dd->ipath_pd[i] && dd->ipath_pd[i]->port_cnt) { 1962 if (dd->ipath_pd[i] && dd->ipath_pd[i]->port_cnt) {
1954 ipath_dbg("unit %u port %d is in use " 1963 ipath_dbg("unit %u port %d is in use "
1955 "(PID %u cmd %s), can't reset\n", 1964 "(PID %u cmd %s), can't reset\n",
diff --git a/drivers/infiniband/hw/ipath/ipath_eeprom.c b/drivers/infiniband/hw/ipath/ipath_eeprom.c
index f11a900e8cd7..a2f1ceafcca9 100644
--- a/drivers/infiniband/hw/ipath/ipath_eeprom.c
+++ b/drivers/infiniband/hw/ipath/ipath_eeprom.c
@@ -505,11 +505,10 @@ static u8 flash_csum(struct ipath_flash *ifp, int adjust)
505 * ipath_get_guid - get the GUID from the i2c device 505 * ipath_get_guid - get the GUID from the i2c device
506 * @dd: the infinipath device 506 * @dd: the infinipath device
507 * 507 *
508 * When we add the multi-chip support, we will probably have to add 508 * We have the capability to use the ipath_nguid field, and get
509 * the ability to use the number of guids field, and get the guid from 509 * the guid from the first chip's flash, to use for all of them.
510 * the first chip's flash, to use for all of them.
511 */ 510 */
512void ipath_get_guid(struct ipath_devdata *dd) 511void ipath_get_eeprom_info(struct ipath_devdata *dd)
513{ 512{
514 void *buf; 513 void *buf;
515 struct ipath_flash *ifp; 514 struct ipath_flash *ifp;
diff --git a/drivers/infiniband/hw/ipath/ipath_file_ops.c b/drivers/infiniband/hw/ipath/ipath_file_ops.c
index c347191f02bf..ada267e41f6c 100644
--- a/drivers/infiniband/hw/ipath/ipath_file_ops.c
+++ b/drivers/infiniband/hw/ipath/ipath_file_ops.c
@@ -139,7 +139,7 @@ static int ipath_get_base_info(struct ipath_portdata *pd,
139 kinfo->spi_piosize = dd->ipath_ibmaxlen; 139 kinfo->spi_piosize = dd->ipath_ibmaxlen;
140 kinfo->spi_mtu = dd->ipath_ibmaxlen; /* maxlen, not ibmtu */ 140 kinfo->spi_mtu = dd->ipath_ibmaxlen; /* maxlen, not ibmtu */
141 kinfo->spi_port = pd->port_port; 141 kinfo->spi_port = pd->port_port;
142 kinfo->spi_sw_version = IPATH_USER_SWVERSION; 142 kinfo->spi_sw_version = IPATH_KERN_SWVERSION;
143 kinfo->spi_hw_version = dd->ipath_revision; 143 kinfo->spi_hw_version = dd->ipath_revision;
144 144
145 if (copy_to_user(ubase, kinfo, sizeof(*kinfo))) 145 if (copy_to_user(ubase, kinfo, sizeof(*kinfo)))
@@ -1224,6 +1224,10 @@ static unsigned int ipath_poll(struct file *fp,
1224 1224
1225 if (tail == head) { 1225 if (tail == head) {
1226 set_bit(IPATH_PORT_WAITING_RCV, &pd->port_flag); 1226 set_bit(IPATH_PORT_WAITING_RCV, &pd->port_flag);
1227 if(dd->ipath_rhdrhead_intr_off) /* arm rcv interrupt */
1228 (void)ipath_write_ureg(dd, ur_rcvhdrhead,
1229 dd->ipath_rhdrhead_intr_off
1230 | head, pd->port_port);
1227 poll_wait(fp, &pd->port_wait, pt); 1231 poll_wait(fp, &pd->port_wait, pt);
1228 1232
1229 if (test_bit(IPATH_PORT_WAITING_RCV, &pd->port_flag)) { 1233 if (test_bit(IPATH_PORT_WAITING_RCV, &pd->port_flag)) {
diff --git a/drivers/infiniband/hw/ipath/ipath_ht400.c b/drivers/infiniband/hw/ipath/ipath_ht400.c
index 4652435998f3..fac0a2b74de2 100644
--- a/drivers/infiniband/hw/ipath/ipath_ht400.c
+++ b/drivers/infiniband/hw/ipath/ipath_ht400.c
@@ -607,7 +607,12 @@ static int ipath_ht_boardname(struct ipath_devdata *dd, char *name,
607 case 4: /* Ponderosa is one of the bringup boards */ 607 case 4: /* Ponderosa is one of the bringup boards */
608 n = "Ponderosa"; 608 n = "Ponderosa";
609 break; 609 break;
610 case 5: /* HT-460 original production board */ 610 case 5:
611 /*
612 * HT-460 original production board; two production levels, with
613 * different serial number ranges. See ipath_ht_early_init() for
614 * case where we enable IPATH_GPIO_INTR for later serial # range.
615 */
611 n = "InfiniPath_HT-460"; 616 n = "InfiniPath_HT-460";
612 break; 617 break;
613 case 6: 618 case 6:
@@ -642,7 +647,7 @@ static int ipath_ht_boardname(struct ipath_devdata *dd, char *name,
642 if (n) 647 if (n)
643 snprintf(name, namelen, "%s", n); 648 snprintf(name, namelen, "%s", n);
644 649
645 if (dd->ipath_majrev != 3 || dd->ipath_minrev != 2) { 650 if (dd->ipath_majrev != 3 || (dd->ipath_minrev < 2 || dd->ipath_minrev > 3)) {
646 /* 651 /*
647 * This version of the driver only supports the HT-400 652 * This version of the driver only supports the HT-400
648 * Rev 3.2 653 * Rev 3.2
@@ -1520,6 +1525,18 @@ static int ipath_ht_early_init(struct ipath_devdata *dd)
1520 */ 1525 */
1521 ipath_write_kreg(dd, dd->ipath_kregs->kr_sendctrl, 1526 ipath_write_kreg(dd, dd->ipath_kregs->kr_sendctrl,
1522 INFINIPATH_S_ABORT); 1527 INFINIPATH_S_ABORT);
1528
1529 ipath_get_eeprom_info(dd);
1530 if(dd->ipath_boardrev == 5 && dd->ipath_serial[0] == '1' &&
1531 dd->ipath_serial[1] == '2' && dd->ipath_serial[2] == '8') {
1532 /*
1533 * Later production HT-460 has same changes as HT-465, so
1534 * can use GPIO interrupts. They have serial #'s starting
1535 * with 128, rather than 112.
1536 */
1537 dd->ipath_flags |= IPATH_GPIO_INTR;
1538 dd->ipath_flags &= ~IPATH_POLL_RX_INTR;
1539 }
1523 return 0; 1540 return 0;
1524} 1541}
1525 1542
diff --git a/drivers/infiniband/hw/ipath/ipath_init_chip.c b/drivers/infiniband/hw/ipath/ipath_init_chip.c
index 2823ff9c0c62..dc83250d26a6 100644
--- a/drivers/infiniband/hw/ipath/ipath_init_chip.c
+++ b/drivers/infiniband/hw/ipath/ipath_init_chip.c
@@ -53,13 +53,19 @@ MODULE_PARM_DESC(cfgports, "Set max number of ports to use");
53 53
54/* 54/*
55 * Number of buffers reserved for driver (layered drivers and SMA 55 * Number of buffers reserved for driver (layered drivers and SMA
56 * send). Reserved at end of buffer list. 56 * send). Reserved at end of buffer list. Initialized based on
57 * number of PIO buffers if not set via module interface.
58 * The problem with this is that it's global, but we'll use different
59 * numbers for different chip types. So the default value is not
60 * very useful. I've redefined it for the 1.3 release so that it's
61 * zero unless set by the user to something else, in which case we
62 * try to respect it.
57 */ 63 */
58static ushort ipath_kpiobufs = 32; 64static ushort ipath_kpiobufs;
59 65
60static int ipath_set_kpiobufs(const char *val, struct kernel_param *kp); 66static int ipath_set_kpiobufs(const char *val, struct kernel_param *kp);
61 67
62module_param_call(kpiobufs, ipath_set_kpiobufs, param_get_uint, 68module_param_call(kpiobufs, ipath_set_kpiobufs, param_get_ushort,
63 &ipath_kpiobufs, S_IWUSR | S_IRUGO); 69 &ipath_kpiobufs, S_IWUSR | S_IRUGO);
64MODULE_PARM_DESC(kpiobufs, "Set number of PIO buffers for driver"); 70MODULE_PARM_DESC(kpiobufs, "Set number of PIO buffers for driver");
65 71
@@ -531,8 +537,11 @@ static int init_housekeeping(struct ipath_devdata *dd,
531 * Don't clear ipath_flags as 8bit mode was set before 537 * Don't clear ipath_flags as 8bit mode was set before
532 * entering this func. However, we do set the linkstate to 538 * entering this func. However, we do set the linkstate to
533 * unknown, so we can watch for a transition. 539 * unknown, so we can watch for a transition.
540 * PRESENT is set because we want register reads to work,
541 * and the kernel infrastructure saw it in config space;
542 * We clear it if we have failures.
534 */ 543 */
535 dd->ipath_flags |= IPATH_LINKUNK; 544 dd->ipath_flags |= IPATH_LINKUNK | IPATH_PRESENT;
536 dd->ipath_flags &= ~(IPATH_LINKACTIVE | IPATH_LINKARMED | 545 dd->ipath_flags &= ~(IPATH_LINKACTIVE | IPATH_LINKARMED |
537 IPATH_LINKDOWN | IPATH_LINKINIT); 546 IPATH_LINKDOWN | IPATH_LINKINIT);
538 547
@@ -560,6 +569,7 @@ static int init_housekeeping(struct ipath_devdata *dd,
560 || (dd->ipath_uregbase & 0xffffffff) == 0xffffffff) { 569 || (dd->ipath_uregbase & 0xffffffff) == 0xffffffff) {
561 ipath_dev_err(dd, "Register read failures from chip, " 570 ipath_dev_err(dd, "Register read failures from chip, "
562 "giving up initialization\n"); 571 "giving up initialization\n");
572 dd->ipath_flags &= ~IPATH_PRESENT;
563 ret = -ENODEV; 573 ret = -ENODEV;
564 goto done; 574 goto done;
565 } 575 }
@@ -682,16 +692,14 @@ int ipath_init_chip(struct ipath_devdata *dd, int reinit)
682 */ 692 */
683 dd->ipath_pioavregs = ALIGN(val, sizeof(u64) * BITS_PER_BYTE / 2) 693 dd->ipath_pioavregs = ALIGN(val, sizeof(u64) * BITS_PER_BYTE / 2)
684 / (sizeof(u64) * BITS_PER_BYTE / 2); 694 / (sizeof(u64) * BITS_PER_BYTE / 2);
685 if (!ipath_kpiobufs) /* have to have at least 1, for SMA */ 695 if (ipath_kpiobufs == 0) {
686 kpiobufs = ipath_kpiobufs = 1; 696 /* not set by user, or set explictly to default */
687 else if ((dd->ipath_piobcnt2k + dd->ipath_piobcnt4k) < 697 if ((dd->ipath_piobcnt2k + dd->ipath_piobcnt4k) > 128)
688 (dd->ipath_cfgports * IPATH_MIN_USER_PORT_BUFCNT)) { 698 kpiobufs = 32;
689 dev_info(&dd->pcidev->dev, "Too few PIO buffers (%u) " 699 else
690 "for %u ports to have %u each!\n", 700 kpiobufs = 16;
691 dd->ipath_piobcnt2k + dd->ipath_piobcnt4k, 701 }
692 dd->ipath_cfgports, IPATH_MIN_USER_PORT_BUFCNT); 702 else
693 kpiobufs = 1; /* reserve just the minimum for SMA/ether */
694 } else
695 kpiobufs = ipath_kpiobufs; 703 kpiobufs = ipath_kpiobufs;
696 704
697 if (kpiobufs > 705 if (kpiobufs >
@@ -871,7 +879,6 @@ int ipath_init_chip(struct ipath_devdata *dd, int reinit)
871 879
872done: 880done:
873 if (!ret) { 881 if (!ret) {
874 ipath_get_guid(dd);
875 *dd->ipath_statusp |= IPATH_STATUS_CHIP_PRESENT; 882 *dd->ipath_statusp |= IPATH_STATUS_CHIP_PRESENT;
876 if (!dd->ipath_f_intrsetup(dd)) { 883 if (!dd->ipath_f_intrsetup(dd)) {
877 /* now we can enable all interrupts from the chip */ 884 /* now we can enable all interrupts from the chip */
diff --git a/drivers/infiniband/hw/ipath/ipath_intr.c b/drivers/infiniband/hw/ipath/ipath_intr.c
index 60f5f4108069..3e72a1fe3d73 100644
--- a/drivers/infiniband/hw/ipath/ipath_intr.c
+++ b/drivers/infiniband/hw/ipath/ipath_intr.c
@@ -172,8 +172,8 @@ static void handle_e_ibstatuschanged(struct ipath_devdata *dd,
172 "was %s\n", dd->ipath_unit, 172 "was %s\n", dd->ipath_unit,
173 ib_linkstate(lstate), 173 ib_linkstate(lstate),
174 ib_linkstate((unsigned) 174 ib_linkstate((unsigned)
175 dd->ipath_lastibcstat 175 dd->ipath_lastibcstat
176 & IPATH_IBSTATE_MASK)); 176 & IPATH_IBSTATE_MASK));
177 } 177 }
178 else { 178 else {
179 lstate = dd->ipath_lastibcstat & IPATH_IBSTATE_MASK; 179 lstate = dd->ipath_lastibcstat & IPATH_IBSTATE_MASK;
@@ -665,14 +665,14 @@ static void handle_layer_pioavail(struct ipath_devdata *dd)
665 665
666 ret = __ipath_layer_intr(dd, IPATH_LAYER_INT_SEND_CONTINUE); 666 ret = __ipath_layer_intr(dd, IPATH_LAYER_INT_SEND_CONTINUE);
667 if (ret > 0) 667 if (ret > 0)
668 goto clear; 668 goto set;
669 669
670 ret = __ipath_verbs_piobufavail(dd); 670 ret = __ipath_verbs_piobufavail(dd);
671 if (ret > 0) 671 if (ret > 0)
672 goto clear; 672 goto set;
673 673
674 return; 674 return;
675clear: 675set:
676 set_bit(IPATH_S_PIOINTBUFAVAIL, &dd->ipath_sendctrl); 676 set_bit(IPATH_S_PIOINTBUFAVAIL, &dd->ipath_sendctrl);
677 ipath_write_kreg(dd, dd->ipath_kregs->kr_sendctrl, 677 ipath_write_kreg(dd, dd->ipath_kregs->kr_sendctrl,
678 dd->ipath_sendctrl); 678 dd->ipath_sendctrl);
@@ -719,11 +719,24 @@ static void handle_rcv(struct ipath_devdata *dd, u32 istat)
719irqreturn_t ipath_intr(int irq, void *data, struct pt_regs *regs) 719irqreturn_t ipath_intr(int irq, void *data, struct pt_regs *regs)
720{ 720{
721 struct ipath_devdata *dd = data; 721 struct ipath_devdata *dd = data;
722 u32 istat = ipath_read_kreg32(dd, dd->ipath_kregs->kr_intstatus); 722 u32 istat;
723 ipath_err_t estat = 0; 723 ipath_err_t estat = 0;
724 static unsigned unexpected = 0; 724 static unsigned unexpected = 0;
725 irqreturn_t ret; 725 irqreturn_t ret;
726 726
727 if(!(dd->ipath_flags & IPATH_PRESENT)) {
728 /* this is mostly so we don't try to touch the chip while
729 * it is being reset */
730 /*
731 * This return value is perhaps odd, but we do not want the
732 * interrupt core code to remove our interrupt handler
733 * because we don't appear to be handling an interrupt
734 * during a chip reset.
735 */
736 return IRQ_HANDLED;
737 }
738
739 istat = ipath_read_kreg32(dd, dd->ipath_kregs->kr_intstatus);
727 if (unlikely(!istat)) { 740 if (unlikely(!istat)) {
728 ipath_stats.sps_nullintr++; 741 ipath_stats.sps_nullintr++;
729 ret = IRQ_NONE; /* not our interrupt, or already handled */ 742 ret = IRQ_NONE; /* not our interrupt, or already handled */
diff --git a/drivers/infiniband/hw/ipath/ipath_kernel.h b/drivers/infiniband/hw/ipath/ipath_kernel.h
index 159d0aed31a5..5d92d57b6f54 100644
--- a/drivers/infiniband/hw/ipath/ipath_kernel.h
+++ b/drivers/infiniband/hw/ipath/ipath_kernel.h
@@ -528,7 +528,6 @@ extern spinlock_t ipath_devs_lock;
528extern struct ipath_devdata *ipath_lookup(int unit); 528extern struct ipath_devdata *ipath_lookup(int unit);
529 529
530extern u16 ipath_layer_rcv_opcode; 530extern u16 ipath_layer_rcv_opcode;
531extern int ipath_verbs_registered;
532extern int __ipath_layer_intr(struct ipath_devdata *, u32); 531extern int __ipath_layer_intr(struct ipath_devdata *, u32);
533extern int ipath_layer_intr(struct ipath_devdata *, u32); 532extern int ipath_layer_intr(struct ipath_devdata *, u32);
534extern int __ipath_layer_rcv(struct ipath_devdata *, void *, 533extern int __ipath_layer_rcv(struct ipath_devdata *, void *,
@@ -651,7 +650,7 @@ u32 __iomem *ipath_getpiobuf(struct ipath_devdata *, u32 *);
651void ipath_init_pe800_funcs(struct ipath_devdata *); 650void ipath_init_pe800_funcs(struct ipath_devdata *);
652/* init HT-400-specific func */ 651/* init HT-400-specific func */
653void ipath_init_ht400_funcs(struct ipath_devdata *); 652void ipath_init_ht400_funcs(struct ipath_devdata *);
654void ipath_get_guid(struct ipath_devdata *); 653void ipath_get_eeprom_info(struct ipath_devdata *);
655u64 ipath_snap_cntr(struct ipath_devdata *, ipath_creg); 654u64 ipath_snap_cntr(struct ipath_devdata *, ipath_creg);
656 655
657/* 656/*
@@ -732,7 +731,7 @@ u64 ipath_read_kreg64_port(const struct ipath_devdata *, ipath_kreg,
732static inline u32 ipath_read_ureg32(const struct ipath_devdata *dd, 731static inline u32 ipath_read_ureg32(const struct ipath_devdata *dd,
733 ipath_ureg regno, int port) 732 ipath_ureg regno, int port)
734{ 733{
735 if (!dd->ipath_kregbase) 734 if (!dd->ipath_kregbase || !(dd->ipath_flags & IPATH_PRESENT))
736 return 0; 735 return 0;
737 736
738 return readl(regno + (u64 __iomem *) 737 return readl(regno + (u64 __iomem *)
@@ -763,7 +762,7 @@ static inline void ipath_write_ureg(const struct ipath_devdata *dd,
763static inline u32 ipath_read_kreg32(const struct ipath_devdata *dd, 762static inline u32 ipath_read_kreg32(const struct ipath_devdata *dd,
764 ipath_kreg regno) 763 ipath_kreg regno)
765{ 764{
766 if (!dd->ipath_kregbase) 765 if (!dd->ipath_kregbase || !(dd->ipath_flags & IPATH_PRESENT))
767 return -1; 766 return -1;
768 return readl((u32 __iomem *) & dd->ipath_kregbase[regno]); 767 return readl((u32 __iomem *) & dd->ipath_kregbase[regno]);
769} 768}
@@ -771,7 +770,7 @@ static inline u32 ipath_read_kreg32(const struct ipath_devdata *dd,
771static inline u64 ipath_read_kreg64(const struct ipath_devdata *dd, 770static inline u64 ipath_read_kreg64(const struct ipath_devdata *dd,
772 ipath_kreg regno) 771 ipath_kreg regno)
773{ 772{
774 if (!dd->ipath_kregbase) 773 if (!dd->ipath_kregbase || !(dd->ipath_flags & IPATH_PRESENT))
775 return -1; 774 return -1;
776 775
777 return readq(&dd->ipath_kregbase[regno]); 776 return readq(&dd->ipath_kregbase[regno]);
@@ -787,7 +786,7 @@ static inline void ipath_write_kreg(const struct ipath_devdata *dd,
787static inline u64 ipath_read_creg(const struct ipath_devdata *dd, 786static inline u64 ipath_read_creg(const struct ipath_devdata *dd,
788 ipath_sreg regno) 787 ipath_sreg regno)
789{ 788{
790 if (!dd->ipath_kregbase) 789 if (!dd->ipath_kregbase || !(dd->ipath_flags & IPATH_PRESENT))
791 return 0; 790 return 0;
792 791
793 return readq(regno + (u64 __iomem *) 792 return readq(regno + (u64 __iomem *)
@@ -798,7 +797,7 @@ static inline u64 ipath_read_creg(const struct ipath_devdata *dd,
798static inline u32 ipath_read_creg32(const struct ipath_devdata *dd, 797static inline u32 ipath_read_creg32(const struct ipath_devdata *dd,
799 ipath_sreg regno) 798 ipath_sreg regno)
800{ 799{
801 if (!dd->ipath_kregbase) 800 if (!dd->ipath_kregbase || !(dd->ipath_flags & IPATH_PRESENT))
802 return 0; 801 return 0;
803 return readl(regno + (u64 __iomem *) 802 return readl(regno + (u64 __iomem *)
804 (dd->ipath_cregbase + 803 (dd->ipath_cregbase +
diff --git a/drivers/infiniband/hw/ipath/ipath_keys.c b/drivers/infiniband/hw/ipath/ipath_keys.c
index aa33b0e9f2f6..5ae8761f9dd2 100644
--- a/drivers/infiniband/hw/ipath/ipath_keys.c
+++ b/drivers/infiniband/hw/ipath/ipath_keys.c
@@ -136,9 +136,7 @@ int ipath_lkey_ok(struct ipath_lkey_table *rkt, struct ipath_sge *isge,
136 ret = 1; 136 ret = 1;
137 goto bail; 137 goto bail;
138 } 138 }
139 spin_lock(&rkt->lock);
140 mr = rkt->table[(sge->lkey >> (32 - ib_ipath_lkey_table_size))]; 139 mr = rkt->table[(sge->lkey >> (32 - ib_ipath_lkey_table_size))];
141 spin_unlock(&rkt->lock);
142 if (unlikely(mr == NULL || mr->lkey != sge->lkey)) { 140 if (unlikely(mr == NULL || mr->lkey != sge->lkey)) {
143 ret = 0; 141 ret = 0;
144 goto bail; 142 goto bail;
@@ -184,8 +182,6 @@ bail:
184 * @acc: access flags 182 * @acc: access flags
185 * 183 *
186 * Return 1 if successful, otherwise 0. 184 * Return 1 if successful, otherwise 0.
187 *
188 * The QP r_rq.lock should be held.
189 */ 185 */
190int ipath_rkey_ok(struct ipath_ibdev *dev, struct ipath_sge_state *ss, 186int ipath_rkey_ok(struct ipath_ibdev *dev, struct ipath_sge_state *ss,
191 u32 len, u64 vaddr, u32 rkey, int acc) 187 u32 len, u64 vaddr, u32 rkey, int acc)
@@ -196,9 +192,7 @@ int ipath_rkey_ok(struct ipath_ibdev *dev, struct ipath_sge_state *ss,
196 size_t off; 192 size_t off;
197 int ret; 193 int ret;
198 194
199 spin_lock(&rkt->lock);
200 mr = rkt->table[(rkey >> (32 - ib_ipath_lkey_table_size))]; 195 mr = rkt->table[(rkey >> (32 - ib_ipath_lkey_table_size))];
201 spin_unlock(&rkt->lock);
202 if (unlikely(mr == NULL || mr->lkey != rkey)) { 196 if (unlikely(mr == NULL || mr->lkey != rkey)) {
203 ret = 0; 197 ret = 0;
204 goto bail; 198 goto bail;
diff --git a/drivers/infiniband/hw/ipath/ipath_layer.c b/drivers/infiniband/hw/ipath/ipath_layer.c
index 2cabf6340572..9ec4ac77b87f 100644
--- a/drivers/infiniband/hw/ipath/ipath_layer.c
+++ b/drivers/infiniband/hw/ipath/ipath_layer.c
@@ -46,13 +46,15 @@
46/* Acquire before ipath_devs_lock. */ 46/* Acquire before ipath_devs_lock. */
47static DEFINE_MUTEX(ipath_layer_mutex); 47static DEFINE_MUTEX(ipath_layer_mutex);
48 48
49static int ipath_verbs_registered;
50
49u16 ipath_layer_rcv_opcode; 51u16 ipath_layer_rcv_opcode;
52
50static int (*layer_intr)(void *, u32); 53static int (*layer_intr)(void *, u32);
51static int (*layer_rcv)(void *, void *, struct sk_buff *); 54static int (*layer_rcv)(void *, void *, struct sk_buff *);
52static int (*layer_rcv_lid)(void *, void *); 55static int (*layer_rcv_lid)(void *, void *);
53static int (*verbs_piobufavail)(void *); 56static int (*verbs_piobufavail)(void *);
54static void (*verbs_rcv)(void *, void *, void *, u32); 57static void (*verbs_rcv)(void *, void *, void *, u32);
55int ipath_verbs_registered;
56 58
57static void *(*layer_add_one)(int, struct ipath_devdata *); 59static void *(*layer_add_one)(int, struct ipath_devdata *);
58static void (*layer_remove_one)(void *); 60static void (*layer_remove_one)(void *);
@@ -586,6 +588,8 @@ void ipath_verbs_unregister(void)
586 verbs_rcv = NULL; 588 verbs_rcv = NULL;
587 verbs_timer_cb = NULL; 589 verbs_timer_cb = NULL;
588 590
591 ipath_verbs_registered = 0;
592
589 mutex_unlock(&ipath_layer_mutex); 593 mutex_unlock(&ipath_layer_mutex);
590} 594}
591 595
@@ -868,12 +872,13 @@ static void copy_io(u32 __iomem *piobuf, struct ipath_sge_state *ss,
868 update_sge(ss, len); 872 update_sge(ss, len);
869 length -= len; 873 length -= len;
870 } 874 }
875 /* Update address before sending packet. */
876 update_sge(ss, length);
871 /* must flush early everything before trigger word */ 877 /* must flush early everything before trigger word */
872 ipath_flush_wc(); 878 ipath_flush_wc();
873 __raw_writel(last, piobuf); 879 __raw_writel(last, piobuf);
874 /* be sure trigger word is written */ 880 /* be sure trigger word is written */
875 ipath_flush_wc(); 881 ipath_flush_wc();
876 update_sge(ss, length);
877} 882}
878 883
879/** 884/**
@@ -939,17 +944,18 @@ int ipath_verbs_send(struct ipath_devdata *dd, u32 hdrwords,
939 if (likely(ss->num_sge == 1 && len <= ss->sge.length && 944 if (likely(ss->num_sge == 1 && len <= ss->sge.length &&
940 !((unsigned long)ss->sge.vaddr & (sizeof(u32) - 1)))) { 945 !((unsigned long)ss->sge.vaddr & (sizeof(u32) - 1)))) {
941 u32 w; 946 u32 w;
947 u32 *addr = (u32 *) ss->sge.vaddr;
942 948
949 /* Update address before sending packet. */
950 update_sge(ss, len);
943 /* Need to round up for the last dword in the packet. */ 951 /* Need to round up for the last dword in the packet. */
944 w = (len + 3) >> 2; 952 w = (len + 3) >> 2;
945 __iowrite32_copy(piobuf, ss->sge.vaddr, w - 1); 953 __iowrite32_copy(piobuf, addr, w - 1);
946 /* must flush early everything before trigger word */ 954 /* must flush early everything before trigger word */
947 ipath_flush_wc(); 955 ipath_flush_wc();
948 __raw_writel(((u32 *) ss->sge.vaddr)[w - 1], 956 __raw_writel(addr[w - 1], piobuf + w - 1);
949 piobuf + w - 1);
950 /* be sure trigger word is written */ 957 /* be sure trigger word is written */
951 ipath_flush_wc(); 958 ipath_flush_wc();
952 update_sge(ss, len);
953 ret = 0; 959 ret = 0;
954 goto bail; 960 goto bail;
955 } 961 }
diff --git a/drivers/infiniband/hw/ipath/ipath_pe800.c b/drivers/infiniband/hw/ipath/ipath_pe800.c
index e693a7a82667..02e8c75b24f6 100644
--- a/drivers/infiniband/hw/ipath/ipath_pe800.c
+++ b/drivers/infiniband/hw/ipath/ipath_pe800.c
@@ -305,8 +305,8 @@ static const struct ipath_cregs ipath_pe_cregs = {
305 * we'll print them and continue. We reuse the same message buffer as 305 * we'll print them and continue. We reuse the same message buffer as
306 * ipath_handle_errors() to avoid excessive stack usage. 306 * ipath_handle_errors() to avoid excessive stack usage.
307 */ 307 */
308void ipath_pe_handle_hwerrors(struct ipath_devdata *dd, char *msg, 308static void ipath_pe_handle_hwerrors(struct ipath_devdata *dd, char *msg,
309 size_t msgl) 309 size_t msgl)
310{ 310{
311 ipath_err_t hwerrs; 311 ipath_err_t hwerrs;
312 u32 bits, ctrl; 312 u32 bits, ctrl;
@@ -552,7 +552,7 @@ static int ipath_pe_boardname(struct ipath_devdata *dd, char *name,
552 * freeze mode), and enable hardware errors as errors (along with 552 * freeze mode), and enable hardware errors as errors (along with
553 * everything else) in errormask 553 * everything else) in errormask
554 */ 554 */
555void ipath_pe_init_hwerrors(struct ipath_devdata *dd) 555static void ipath_pe_init_hwerrors(struct ipath_devdata *dd)
556{ 556{
557 ipath_err_t val; 557 ipath_err_t val;
558 u64 extsval; 558 u64 extsval;
@@ -577,7 +577,7 @@ void ipath_pe_init_hwerrors(struct ipath_devdata *dd)
577 * ipath_pe_bringup_serdes - bring up the serdes 577 * ipath_pe_bringup_serdes - bring up the serdes
578 * @dd: the infinipath device 578 * @dd: the infinipath device
579 */ 579 */
580int ipath_pe_bringup_serdes(struct ipath_devdata *dd) 580static int ipath_pe_bringup_serdes(struct ipath_devdata *dd)
581{ 581{
582 u64 val, tmp, config1; 582 u64 val, tmp, config1;
583 int ret = 0, change = 0; 583 int ret = 0, change = 0;
@@ -694,7 +694,7 @@ int ipath_pe_bringup_serdes(struct ipath_devdata *dd)
694 * @dd: the infinipath device 694 * @dd: the infinipath device
695 * Called when driver is being unloaded 695 * Called when driver is being unloaded
696 */ 696 */
697void ipath_pe_quiet_serdes(struct ipath_devdata *dd) 697static void ipath_pe_quiet_serdes(struct ipath_devdata *dd)
698{ 698{
699 u64 val = ipath_read_kreg64(dd, dd->ipath_kregs->kr_serdesconfig0); 699 u64 val = ipath_read_kreg64(dd, dd->ipath_kregs->kr_serdesconfig0);
700 700
@@ -972,6 +972,8 @@ static int ipath_setup_pe_reset(struct ipath_devdata *dd)
972 /* Use ERROR so it shows up in logs, etc. */ 972 /* Use ERROR so it shows up in logs, etc. */
973 ipath_dev_err(dd, "Resetting PE-800 unit %u\n", 973 ipath_dev_err(dd, "Resetting PE-800 unit %u\n",
974 dd->ipath_unit); 974 dd->ipath_unit);
975 /* keep chip from being accessed in a few places */
976 dd->ipath_flags &= ~(IPATH_INITTED|IPATH_PRESENT);
975 val = dd->ipath_control | INFINIPATH_C_RESET; 977 val = dd->ipath_control | INFINIPATH_C_RESET;
976 ipath_write_kreg(dd, dd->ipath_kregs->kr_control, val); 978 ipath_write_kreg(dd, dd->ipath_kregs->kr_control, val);
977 mb(); 979 mb();
@@ -997,6 +999,8 @@ static int ipath_setup_pe_reset(struct ipath_devdata *dd)
997 if ((r = pci_enable_device(dd->pcidev))) 999 if ((r = pci_enable_device(dd->pcidev)))
998 ipath_dev_err(dd, "pci_enable_device failed after " 1000 ipath_dev_err(dd, "pci_enable_device failed after "
999 "reset: %d\n", r); 1001 "reset: %d\n", r);
1002 /* whether it worked or not, mark as present, again */
1003 dd->ipath_flags |= IPATH_PRESENT;
1000 val = ipath_read_kreg64(dd, dd->ipath_kregs->kr_revision); 1004 val = ipath_read_kreg64(dd, dd->ipath_kregs->kr_revision);
1001 if (val == dd->ipath_revision) { 1005 if (val == dd->ipath_revision) {
1002 ipath_cdbg(VERBOSE, "Got matching revision " 1006 ipath_cdbg(VERBOSE, "Got matching revision "
@@ -1176,6 +1180,8 @@ static int ipath_pe_early_init(struct ipath_devdata *dd)
1176 */ 1180 */
1177 dd->ipath_rhdrhead_intr_off = 1ULL<<32; 1181 dd->ipath_rhdrhead_intr_off = 1ULL<<32;
1178 1182
1183 ipath_get_eeprom_info(dd);
1184
1179 return 0; 1185 return 0;
1180} 1186}
1181 1187
diff --git a/drivers/infiniband/hw/ipath/ipath_qp.c b/drivers/infiniband/hw/ipath/ipath_qp.c
index 6058d70d7577..9f8855d970c8 100644
--- a/drivers/infiniband/hw/ipath/ipath_qp.c
+++ b/drivers/infiniband/hw/ipath/ipath_qp.c
@@ -188,8 +188,8 @@ static void free_qpn(struct ipath_qp_table *qpt, u32 qpn)
188 * Allocate the next available QPN and put the QP into the hash table. 188 * Allocate the next available QPN and put the QP into the hash table.
189 * The hash table holds a reference to the QP. 189 * The hash table holds a reference to the QP.
190 */ 190 */
191int ipath_alloc_qpn(struct ipath_qp_table *qpt, struct ipath_qp *qp, 191static int ipath_alloc_qpn(struct ipath_qp_table *qpt, struct ipath_qp *qp,
192 enum ib_qp_type type) 192 enum ib_qp_type type)
193{ 193{
194 unsigned long flags; 194 unsigned long flags;
195 u32 qpn; 195 u32 qpn;
@@ -232,7 +232,7 @@ bail:
232 * Remove the QP from the table so it can't be found asynchronously by 232 * Remove the QP from the table so it can't be found asynchronously by
233 * the receive interrupt routine. 233 * the receive interrupt routine.
234 */ 234 */
235void ipath_free_qp(struct ipath_qp_table *qpt, struct ipath_qp *qp) 235static void ipath_free_qp(struct ipath_qp_table *qpt, struct ipath_qp *qp)
236{ 236{
237 struct ipath_qp *q, **qpp; 237 struct ipath_qp *q, **qpp;
238 unsigned long flags; 238 unsigned long flags;
@@ -358,6 +358,65 @@ static void ipath_reset_qp(struct ipath_qp *qp)
358} 358}
359 359
360/** 360/**
361 * ipath_error_qp - put a QP into an error state
362 * @qp: the QP to put into an error state
363 *
364 * Flushes both send and receive work queues.
365 * QP r_rq.lock and s_lock should be held.
366 */
367
368static void ipath_error_qp(struct ipath_qp *qp)
369{
370 struct ipath_ibdev *dev = to_idev(qp->ibqp.device);
371 struct ib_wc wc;
372
373 _VERBS_INFO("QP%d/%d in error state\n",
374 qp->ibqp.qp_num, qp->remote_qpn);
375
376 spin_lock(&dev->pending_lock);
377 /* XXX What if its already removed by the timeout code? */
378 if (!list_empty(&qp->timerwait))
379 list_del_init(&qp->timerwait);
380 if (!list_empty(&qp->piowait))
381 list_del_init(&qp->piowait);
382 spin_unlock(&dev->pending_lock);
383
384 wc.status = IB_WC_WR_FLUSH_ERR;
385 wc.vendor_err = 0;
386 wc.byte_len = 0;
387 wc.imm_data = 0;
388 wc.qp_num = qp->ibqp.qp_num;
389 wc.src_qp = 0;
390 wc.wc_flags = 0;
391 wc.pkey_index = 0;
392 wc.slid = 0;
393 wc.sl = 0;
394 wc.dlid_path_bits = 0;
395 wc.port_num = 0;
396
397 while (qp->s_last != qp->s_head) {
398 struct ipath_swqe *wqe = get_swqe_ptr(qp, qp->s_last);
399
400 wc.wr_id = wqe->wr.wr_id;
401 wc.opcode = ib_ipath_wc_opcode[wqe->wr.opcode];
402 if (++qp->s_last >= qp->s_size)
403 qp->s_last = 0;
404 ipath_cq_enter(to_icq(qp->ibqp.send_cq), &wc, 1);
405 }
406 qp->s_cur = qp->s_tail = qp->s_head;
407 qp->s_hdrwords = 0;
408 qp->s_ack_state = IB_OPCODE_RC_ACKNOWLEDGE;
409
410 wc.opcode = IB_WC_RECV;
411 while (qp->r_rq.tail != qp->r_rq.head) {
412 wc.wr_id = get_rwqe_ptr(&qp->r_rq, qp->r_rq.tail)->wr_id;
413 if (++qp->r_rq.tail >= qp->r_rq.size)
414 qp->r_rq.tail = 0;
415 ipath_cq_enter(to_icq(qp->ibqp.recv_cq), &wc, 1);
416 }
417}
418
419/**
361 * ipath_modify_qp - modify the attributes of a queue pair 420 * ipath_modify_qp - modify the attributes of a queue pair
362 * @ibqp: the queue pair who's attributes we're modifying 421 * @ibqp: the queue pair who's attributes we're modifying
363 * @attr: the new attributes 422 * @attr: the new attributes
@@ -368,6 +427,7 @@ static void ipath_reset_qp(struct ipath_qp *qp)
368int ipath_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, 427int ipath_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
369 int attr_mask) 428 int attr_mask)
370{ 429{
430 struct ipath_ibdev *dev = to_idev(ibqp->device);
371 struct ipath_qp *qp = to_iqp(ibqp); 431 struct ipath_qp *qp = to_iqp(ibqp);
372 enum ib_qp_state cur_state, new_state; 432 enum ib_qp_state cur_state, new_state;
373 unsigned long flags; 433 unsigned long flags;
@@ -384,6 +444,19 @@ int ipath_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
384 attr_mask)) 444 attr_mask))
385 goto inval; 445 goto inval;
386 446
447 if (attr_mask & IB_QP_AV)
448 if (attr->ah_attr.dlid == 0 ||
449 attr->ah_attr.dlid >= IPS_MULTICAST_LID_BASE)
450 goto inval;
451
452 if (attr_mask & IB_QP_PKEY_INDEX)
453 if (attr->pkey_index >= ipath_layer_get_npkeys(dev->dd))
454 goto inval;
455
456 if (attr_mask & IB_QP_MIN_RNR_TIMER)
457 if (attr->min_rnr_timer > 31)
458 goto inval;
459
387 switch (new_state) { 460 switch (new_state) {
388 case IB_QPS_RESET: 461 case IB_QPS_RESET:
389 ipath_reset_qp(qp); 462 ipath_reset_qp(qp);
@@ -398,13 +471,8 @@ int ipath_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
398 471
399 } 472 }
400 473
401 if (attr_mask & IB_QP_PKEY_INDEX) { 474 if (attr_mask & IB_QP_PKEY_INDEX)
402 struct ipath_ibdev *dev = to_idev(ibqp->device);
403
404 if (attr->pkey_index >= ipath_layer_get_npkeys(dev->dd))
405 goto inval;
406 qp->s_pkey_index = attr->pkey_index; 475 qp->s_pkey_index = attr->pkey_index;
407 }
408 476
409 if (attr_mask & IB_QP_DEST_QPN) 477 if (attr_mask & IB_QP_DEST_QPN)
410 qp->remote_qpn = attr->dest_qp_num; 478 qp->remote_qpn = attr->dest_qp_num;
@@ -420,12 +488,8 @@ int ipath_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
420 if (attr_mask & IB_QP_ACCESS_FLAGS) 488 if (attr_mask & IB_QP_ACCESS_FLAGS)
421 qp->qp_access_flags = attr->qp_access_flags; 489 qp->qp_access_flags = attr->qp_access_flags;
422 490
423 if (attr_mask & IB_QP_AV) { 491 if (attr_mask & IB_QP_AV)
424 if (attr->ah_attr.dlid == 0 ||
425 attr->ah_attr.dlid >= IPS_MULTICAST_LID_BASE)
426 goto inval;
427 qp->remote_ah_attr = attr->ah_attr; 492 qp->remote_ah_attr = attr->ah_attr;
428 }
429 493
430 if (attr_mask & IB_QP_PATH_MTU) 494 if (attr_mask & IB_QP_PATH_MTU)
431 qp->path_mtu = attr->path_mtu; 495 qp->path_mtu = attr->path_mtu;
@@ -440,11 +504,8 @@ int ipath_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
440 qp->s_rnr_retry_cnt = qp->s_rnr_retry; 504 qp->s_rnr_retry_cnt = qp->s_rnr_retry;
441 } 505 }
442 506
443 if (attr_mask & IB_QP_MIN_RNR_TIMER) { 507 if (attr_mask & IB_QP_MIN_RNR_TIMER)
444 if (attr->min_rnr_timer > 31)
445 goto inval;
446 qp->s_min_rnr_timer = attr->min_rnr_timer; 508 qp->s_min_rnr_timer = attr->min_rnr_timer;
447 }
448 509
449 if (attr_mask & IB_QP_QKEY) 510 if (attr_mask & IB_QP_QKEY)
450 qp->qkey = attr->qkey; 511 qp->qkey = attr->qkey;
@@ -651,10 +712,8 @@ struct ib_qp *ipath_create_qp(struct ib_pd *ibpd,
651 init_attr->qp_type == IB_QPT_RC ? 712 init_attr->qp_type == IB_QPT_RC ?
652 ipath_do_rc_send : ipath_do_uc_send, 713 ipath_do_rc_send : ipath_do_uc_send,
653 (unsigned long)qp); 714 (unsigned long)qp);
654 qp->piowait.next = LIST_POISON1; 715 INIT_LIST_HEAD(&qp->piowait);
655 qp->piowait.prev = LIST_POISON2; 716 INIT_LIST_HEAD(&qp->timerwait);
656 qp->timerwait.next = LIST_POISON1;
657 qp->timerwait.prev = LIST_POISON2;
658 qp->state = IB_QPS_RESET; 717 qp->state = IB_QPS_RESET;
659 qp->s_wq = swq; 718 qp->s_wq = swq;
660 qp->s_size = init_attr->cap.max_send_wr + 1; 719 qp->s_size = init_attr->cap.max_send_wr + 1;
@@ -675,7 +734,7 @@ struct ib_qp *ipath_create_qp(struct ib_pd *ibpd,
675 ipath_reset_qp(qp); 734 ipath_reset_qp(qp);
676 735
677 /* Tell the core driver that the kernel SMA is present. */ 736 /* Tell the core driver that the kernel SMA is present. */
678 if (qp->ibqp.qp_type == IB_QPT_SMI) 737 if (init_attr->qp_type == IB_QPT_SMI)
679 ipath_layer_set_verbs_flags(dev->dd, 738 ipath_layer_set_verbs_flags(dev->dd,
680 IPATH_VERBS_KERNEL_SMA); 739 IPATH_VERBS_KERNEL_SMA);
681 break; 740 break;
@@ -724,10 +783,10 @@ int ipath_destroy_qp(struct ib_qp *ibqp)
724 783
725 /* Make sure the QP isn't on the timeout list. */ 784 /* Make sure the QP isn't on the timeout list. */
726 spin_lock_irqsave(&dev->pending_lock, flags); 785 spin_lock_irqsave(&dev->pending_lock, flags);
727 if (qp->timerwait.next != LIST_POISON1) 786 if (!list_empty(&qp->timerwait))
728 list_del(&qp->timerwait); 787 list_del_init(&qp->timerwait);
729 if (qp->piowait.next != LIST_POISON1) 788 if (!list_empty(&qp->piowait))
730 list_del(&qp->piowait); 789 list_del_init(&qp->piowait);
731 spin_unlock_irqrestore(&dev->pending_lock, flags); 790 spin_unlock_irqrestore(&dev->pending_lock, flags);
732 791
733 /* 792 /*
@@ -796,10 +855,10 @@ void ipath_sqerror_qp(struct ipath_qp *qp, struct ib_wc *wc)
796 855
797 spin_lock(&dev->pending_lock); 856 spin_lock(&dev->pending_lock);
798 /* XXX What if its already removed by the timeout code? */ 857 /* XXX What if its already removed by the timeout code? */
799 if (qp->timerwait.next != LIST_POISON1) 858 if (!list_empty(&qp->timerwait))
800 list_del(&qp->timerwait); 859 list_del_init(&qp->timerwait);
801 if (qp->piowait.next != LIST_POISON1) 860 if (!list_empty(&qp->piowait))
802 list_del(&qp->piowait); 861 list_del_init(&qp->piowait);
803 spin_unlock(&dev->pending_lock); 862 spin_unlock(&dev->pending_lock);
804 863
805 ipath_cq_enter(to_icq(qp->ibqp.send_cq), wc, 1); 864 ipath_cq_enter(to_icq(qp->ibqp.send_cq), wc, 1);
@@ -821,65 +880,6 @@ void ipath_sqerror_qp(struct ipath_qp *qp, struct ib_wc *wc)
821} 880}
822 881
823/** 882/**
824 * ipath_error_qp - put a QP into an error state
825 * @qp: the QP to put into an error state
826 *
827 * Flushes both send and receive work queues.
828 * QP r_rq.lock and s_lock should be held.
829 */
830
831void ipath_error_qp(struct ipath_qp *qp)
832{
833 struct ipath_ibdev *dev = to_idev(qp->ibqp.device);
834 struct ib_wc wc;
835
836 _VERBS_INFO("QP%d/%d in error state\n",
837 qp->ibqp.qp_num, qp->remote_qpn);
838
839 spin_lock(&dev->pending_lock);
840 /* XXX What if its already removed by the timeout code? */
841 if (qp->timerwait.next != LIST_POISON1)
842 list_del(&qp->timerwait);
843 if (qp->piowait.next != LIST_POISON1)
844 list_del(&qp->piowait);
845 spin_unlock(&dev->pending_lock);
846
847 wc.status = IB_WC_WR_FLUSH_ERR;
848 wc.vendor_err = 0;
849 wc.byte_len = 0;
850 wc.imm_data = 0;
851 wc.qp_num = qp->ibqp.qp_num;
852 wc.src_qp = 0;
853 wc.wc_flags = 0;
854 wc.pkey_index = 0;
855 wc.slid = 0;
856 wc.sl = 0;
857 wc.dlid_path_bits = 0;
858 wc.port_num = 0;
859
860 while (qp->s_last != qp->s_head) {
861 struct ipath_swqe *wqe = get_swqe_ptr(qp, qp->s_last);
862
863 wc.wr_id = wqe->wr.wr_id;
864 wc.opcode = ib_ipath_wc_opcode[wqe->wr.opcode];
865 if (++qp->s_last >= qp->s_size)
866 qp->s_last = 0;
867 ipath_cq_enter(to_icq(qp->ibqp.send_cq), &wc, 1);
868 }
869 qp->s_cur = qp->s_tail = qp->s_head;
870 qp->s_hdrwords = 0;
871 qp->s_ack_state = IB_OPCODE_RC_ACKNOWLEDGE;
872
873 wc.opcode = IB_WC_RECV;
874 while (qp->r_rq.tail != qp->r_rq.head) {
875 wc.wr_id = get_rwqe_ptr(&qp->r_rq, qp->r_rq.tail)->wr_id;
876 if (++qp->r_rq.tail >= qp->r_rq.size)
877 qp->r_rq.tail = 0;
878 ipath_cq_enter(to_icq(qp->ibqp.recv_cq), &wc, 1);
879 }
880}
881
882/**
883 * ipath_get_credit - flush the send work queue of a QP 883 * ipath_get_credit - flush the send work queue of a QP
884 * @qp: the qp who's send work queue to flush 884 * @qp: the qp who's send work queue to flush
885 * @aeth: the Acknowledge Extended Transport Header 885 * @aeth: the Acknowledge Extended Transport Header
diff --git a/drivers/infiniband/hw/ipath/ipath_rc.c b/drivers/infiniband/hw/ipath/ipath_rc.c
index a4055ca00614..493b1821a934 100644
--- a/drivers/infiniband/hw/ipath/ipath_rc.c
+++ b/drivers/infiniband/hw/ipath/ipath_rc.c
@@ -57,7 +57,7 @@ static void ipath_init_restart(struct ipath_qp *qp, struct ipath_swqe *wqe)
57 qp->s_len = wqe->length - len; 57 qp->s_len = wqe->length - len;
58 dev = to_idev(qp->ibqp.device); 58 dev = to_idev(qp->ibqp.device);
59 spin_lock(&dev->pending_lock); 59 spin_lock(&dev->pending_lock);
60 if (qp->timerwait.next == LIST_POISON1) 60 if (list_empty(&qp->timerwait))
61 list_add_tail(&qp->timerwait, 61 list_add_tail(&qp->timerwait,
62 &dev->pending[dev->pending_index]); 62 &dev->pending[dev->pending_index]);
63 spin_unlock(&dev->pending_lock); 63 spin_unlock(&dev->pending_lock);
@@ -356,7 +356,7 @@ static inline int ipath_make_rc_req(struct ipath_qp *qp,
356 if ((int)(qp->s_psn - qp->s_next_psn) > 0) 356 if ((int)(qp->s_psn - qp->s_next_psn) > 0)
357 qp->s_next_psn = qp->s_psn; 357 qp->s_next_psn = qp->s_psn;
358 spin_lock(&dev->pending_lock); 358 spin_lock(&dev->pending_lock);
359 if (qp->timerwait.next == LIST_POISON1) 359 if (list_empty(&qp->timerwait))
360 list_add_tail(&qp->timerwait, 360 list_add_tail(&qp->timerwait,
361 &dev->pending[dev->pending_index]); 361 &dev->pending[dev->pending_index]);
362 spin_unlock(&dev->pending_lock); 362 spin_unlock(&dev->pending_lock);
@@ -726,8 +726,8 @@ void ipath_restart_rc(struct ipath_qp *qp, u32 psn, struct ib_wc *wc)
726 */ 726 */
727 dev = to_idev(qp->ibqp.device); 727 dev = to_idev(qp->ibqp.device);
728 spin_lock(&dev->pending_lock); 728 spin_lock(&dev->pending_lock);
729 if (qp->timerwait.next != LIST_POISON1) 729 if (!list_empty(&qp->timerwait))
730 list_del(&qp->timerwait); 730 list_del_init(&qp->timerwait);
731 spin_unlock(&dev->pending_lock); 731 spin_unlock(&dev->pending_lock);
732 732
733 if (wqe->wr.opcode == IB_WR_RDMA_READ) 733 if (wqe->wr.opcode == IB_WR_RDMA_READ)
@@ -886,8 +886,8 @@ static int do_rc_ack(struct ipath_qp *qp, u32 aeth, u32 psn, int opcode)
886 * just won't find anything to restart if we ACK everything. 886 * just won't find anything to restart if we ACK everything.
887 */ 887 */
888 spin_lock(&dev->pending_lock); 888 spin_lock(&dev->pending_lock);
889 if (qp->timerwait.next != LIST_POISON1) 889 if (!list_empty(&qp->timerwait))
890 list_del(&qp->timerwait); 890 list_del_init(&qp->timerwait);
891 spin_unlock(&dev->pending_lock); 891 spin_unlock(&dev->pending_lock);
892 892
893 /* 893 /*
@@ -1194,8 +1194,7 @@ static inline void ipath_rc_rcv_resp(struct ipath_ibdev *dev,
1194 IB_WR_RDMA_READ)) 1194 IB_WR_RDMA_READ))
1195 goto ack_done; 1195 goto ack_done;
1196 spin_lock(&dev->pending_lock); 1196 spin_lock(&dev->pending_lock);
1197 if (qp->s_rnr_timeout == 0 && 1197 if (qp->s_rnr_timeout == 0 && !list_empty(&qp->timerwait))
1198 qp->timerwait.next != LIST_POISON1)
1199 list_move_tail(&qp->timerwait, 1198 list_move_tail(&qp->timerwait,
1200 &dev->pending[dev->pending_index]); 1199 &dev->pending[dev->pending_index]);
1201 spin_unlock(&dev->pending_lock); 1200 spin_unlock(&dev->pending_lock);
diff --git a/drivers/infiniband/hw/ipath/ipath_registers.h b/drivers/infiniband/hw/ipath/ipath_registers.h
index 1e59750c5f63..402126eb79c9 100644
--- a/drivers/infiniband/hw/ipath/ipath_registers.h
+++ b/drivers/infiniband/hw/ipath/ipath_registers.h
@@ -34,8 +34,9 @@
34#define _IPATH_REGISTERS_H 34#define _IPATH_REGISTERS_H
35 35
36/* 36/*
37 * This file should only be included by kernel source, and by the diags. 37 * This file should only be included by kernel source, and by the diags. It
38 * It defines the registers, and their contents, for the InfiniPath HT-400 chip 38 * defines the registers, and their contents, for the InfiniPath HT-400
39 * chip.
39 */ 40 */
40 41
41/* 42/*
@@ -156,8 +157,10 @@
156#define INFINIPATH_IBCC_FLOWCTRLWATERMARK_SHIFT 8 157#define INFINIPATH_IBCC_FLOWCTRLWATERMARK_SHIFT 8
157#define INFINIPATH_IBCC_LINKINITCMD_MASK 0x3ULL 158#define INFINIPATH_IBCC_LINKINITCMD_MASK 0x3ULL
158#define INFINIPATH_IBCC_LINKINITCMD_DISABLE 1 159#define INFINIPATH_IBCC_LINKINITCMD_DISABLE 1
159#define INFINIPATH_IBCC_LINKINITCMD_POLL 2 /* cycle through TS1/TS2 till OK */ 160/* cycle through TS1/TS2 till OK */
160#define INFINIPATH_IBCC_LINKINITCMD_SLEEP 3 /* wait for TS1, then go on */ 161#define INFINIPATH_IBCC_LINKINITCMD_POLL 2
162/* wait for TS1, then go on */
163#define INFINIPATH_IBCC_LINKINITCMD_SLEEP 3
161#define INFINIPATH_IBCC_LINKINITCMD_SHIFT 16 164#define INFINIPATH_IBCC_LINKINITCMD_SHIFT 16
162#define INFINIPATH_IBCC_LINKCMD_MASK 0x3ULL 165#define INFINIPATH_IBCC_LINKCMD_MASK 0x3ULL
163#define INFINIPATH_IBCC_LINKCMD_INIT 1 /* move to 0x11 */ 166#define INFINIPATH_IBCC_LINKCMD_INIT 1 /* move to 0x11 */
@@ -182,7 +185,8 @@
182#define INFINIPATH_IBCS_LINKSTATE_SHIFT 4 185#define INFINIPATH_IBCS_LINKSTATE_SHIFT 4
183#define INFINIPATH_IBCS_TXREADY 0x40000000 186#define INFINIPATH_IBCS_TXREADY 0x40000000
184#define INFINIPATH_IBCS_TXCREDITOK 0x80000000 187#define INFINIPATH_IBCS_TXCREDITOK 0x80000000
185/* link training states (shift by INFINIPATH_IBCS_LINKTRAININGSTATE_SHIFT) */ 188/* link training states (shift by
189 INFINIPATH_IBCS_LINKTRAININGSTATE_SHIFT) */
186#define INFINIPATH_IBCS_LT_STATE_DISABLED 0x00 190#define INFINIPATH_IBCS_LT_STATE_DISABLED 0x00
187#define INFINIPATH_IBCS_LT_STATE_LINKUP 0x01 191#define INFINIPATH_IBCS_LT_STATE_LINKUP 0x01
188#define INFINIPATH_IBCS_LT_STATE_POLLACTIVE 0x02 192#define INFINIPATH_IBCS_LT_STATE_POLLACTIVE 0x02
@@ -267,10 +271,12 @@
267/* kr_serdesconfig0 bits */ 271/* kr_serdesconfig0 bits */
268#define INFINIPATH_SERDC0_RESET_MASK 0xfULL /* overal reset bits */ 272#define INFINIPATH_SERDC0_RESET_MASK 0xfULL /* overal reset bits */
269#define INFINIPATH_SERDC0_RESET_PLL 0x10000000ULL /* pll reset */ 273#define INFINIPATH_SERDC0_RESET_PLL 0x10000000ULL /* pll reset */
270#define INFINIPATH_SERDC0_TXIDLE 0xF000ULL /* tx idle enables (per lane) */ 274/* tx idle enables (per lane) */
271#define INFINIPATH_SERDC0_RXDETECT_EN 0xF0000ULL /* rx detect enables (per lane) */ 275#define INFINIPATH_SERDC0_TXIDLE 0xF000ULL
272#define INFINIPATH_SERDC0_L1PWR_DN 0xF0ULL /* L1 Power down; use with RXDETECT, 276/* rx detect enables (per lane) */
273 Otherwise not used on IB side */ 277#define INFINIPATH_SERDC0_RXDETECT_EN 0xF0000ULL
278/* L1 Power down; use with RXDETECT, Otherwise not used on IB side */
279#define INFINIPATH_SERDC0_L1PWR_DN 0xF0ULL
274 280
275/* kr_xgxsconfig bits */ 281/* kr_xgxsconfig bits */
276#define INFINIPATH_XGXS_RESET 0x7ULL 282#define INFINIPATH_XGXS_RESET 0x7ULL
@@ -390,12 +396,13 @@ struct ipath_kregs {
390 ipath_kreg kr_txintmemsize; 396 ipath_kreg kr_txintmemsize;
391 ipath_kreg kr_xgxsconfig; 397 ipath_kreg kr_xgxsconfig;
392 ipath_kreg kr_ibpllcfg; 398 ipath_kreg kr_ibpllcfg;
393 /* use these two (and the following N ports) only with ipath_k*_kreg64_port(); 399 /* use these two (and the following N ports) only with
394 * not *kreg64() */ 400 * ipath_k*_kreg64_port(); not *kreg64() */
395 ipath_kreg kr_rcvhdraddr; 401 ipath_kreg kr_rcvhdraddr;
396 ipath_kreg kr_rcvhdrtailaddr; 402 ipath_kreg kr_rcvhdrtailaddr;
397 403
398 /* remaining registers are not present on all types of infinipath chips */ 404 /* remaining registers are not present on all types of infinipath
405 chips */
399 ipath_kreg kr_rcvpktledcnt; 406 ipath_kreg kr_rcvpktledcnt;
400 ipath_kreg kr_pcierbuftestreg0; 407 ipath_kreg kr_pcierbuftestreg0;
401 ipath_kreg kr_pcierbuftestreg1; 408 ipath_kreg kr_pcierbuftestreg1;
diff --git a/drivers/infiniband/hw/ipath/ipath_ruc.c b/drivers/infiniband/hw/ipath/ipath_ruc.c
index f232e77b78ee..d38f4f3cfd1d 100644
--- a/drivers/infiniband/hw/ipath/ipath_ruc.c
+++ b/drivers/infiniband/hw/ipath/ipath_ruc.c
@@ -435,7 +435,7 @@ void ipath_no_bufs_available(struct ipath_qp *qp, struct ipath_ibdev *dev)
435 unsigned long flags; 435 unsigned long flags;
436 436
437 spin_lock_irqsave(&dev->pending_lock, flags); 437 spin_lock_irqsave(&dev->pending_lock, flags);
438 if (qp->piowait.next == LIST_POISON1) 438 if (list_empty(&qp->piowait))
439 list_add_tail(&qp->piowait, &dev->piowait); 439 list_add_tail(&qp->piowait, &dev->piowait);
440 spin_unlock_irqrestore(&dev->pending_lock, flags); 440 spin_unlock_irqrestore(&dev->pending_lock, flags);
441 /* 441 /*
@@ -531,19 +531,12 @@ int ipath_post_rc_send(struct ipath_qp *qp, struct ib_send_wr *wr)
531 } 531 }
532 wqe->wr.num_sge = j; 532 wqe->wr.num_sge = j;
533 qp->s_head = next; 533 qp->s_head = next;
534 /*
535 * Wake up the send tasklet if the QP is not waiting
536 * for an RNR timeout.
537 */
538 next = qp->s_rnr_timeout;
539 spin_unlock_irqrestore(&qp->s_lock, flags); 534 spin_unlock_irqrestore(&qp->s_lock, flags);
540 535
541 if (next == 0) { 536 if (qp->ibqp.qp_type == IB_QPT_UC)
542 if (qp->ibqp.qp_type == IB_QPT_UC) 537 ipath_do_uc_send((unsigned long) qp);
543 ipath_do_uc_send((unsigned long) qp); 538 else
544 else 539 ipath_do_rc_send((unsigned long) qp);
545 ipath_do_rc_send((unsigned long) qp);
546 }
547 540
548 ret = 0; 541 ret = 0;
549 542
diff --git a/drivers/infiniband/hw/ipath/ipath_sysfs.c b/drivers/infiniband/hw/ipath/ipath_sysfs.c
index 32acd8048b49..f323791cc495 100644
--- a/drivers/infiniband/hw/ipath/ipath_sysfs.c
+++ b/drivers/infiniband/hw/ipath/ipath_sysfs.c
@@ -711,10 +711,22 @@ static struct attribute_group dev_attr_group = {
711 * enters diag mode. A device reset is quite likely to crash the 711 * enters diag mode. A device reset is quite likely to crash the
712 * machine entirely, so we don't want to normally make it 712 * machine entirely, so we don't want to normally make it
713 * available. 713 * available.
714 *
715 * Called with ipath_mutex held.
714 */ 716 */
715int ipath_expose_reset(struct device *dev) 717int ipath_expose_reset(struct device *dev)
716{ 718{
717 return device_create_file(dev, &dev_attr_reset); 719 static int exposed;
720 int ret;
721
722 if (!exposed) {
723 ret = device_create_file(dev, &dev_attr_reset);
724 exposed = 1;
725 }
726 else
727 ret = 0;
728
729 return ret;
718} 730}
719 731
720int ipath_driver_create_group(struct device_driver *drv) 732int ipath_driver_create_group(struct device_driver *drv)
diff --git a/drivers/infiniband/hw/ipath/ipath_ud.c b/drivers/infiniband/hw/ipath/ipath_ud.c
index 5ff3de6128b2..e606daf83210 100644
--- a/drivers/infiniband/hw/ipath/ipath_ud.c
+++ b/drivers/infiniband/hw/ipath/ipath_ud.c
@@ -46,8 +46,10 @@
46 * This is called from ipath_post_ud_send() to forward a WQE addressed 46 * This is called from ipath_post_ud_send() to forward a WQE addressed
47 * to the same HCA. 47 * to the same HCA.
48 */ 48 */
49void ipath_ud_loopback(struct ipath_qp *sqp, struct ipath_sge_state *ss, 49static void ipath_ud_loopback(struct ipath_qp *sqp,
50 u32 length, struct ib_send_wr *wr, struct ib_wc *wc) 50 struct ipath_sge_state *ss,
51 u32 length, struct ib_send_wr *wr,
52 struct ib_wc *wc)
51{ 53{
52 struct ipath_ibdev *dev = to_idev(sqp->ibqp.device); 54 struct ipath_ibdev *dev = to_idev(sqp->ibqp.device);
53 struct ipath_qp *qp; 55 struct ipath_qp *qp;
diff --git a/drivers/infiniband/hw/ipath/ipath_verbs.c b/drivers/infiniband/hw/ipath/ipath_verbs.c
index 9f27fd35cdbb..28fdbdaa789d 100644
--- a/drivers/infiniband/hw/ipath/ipath_verbs.c
+++ b/drivers/infiniband/hw/ipath/ipath_verbs.c
@@ -41,7 +41,7 @@
41/* Not static, because we don't want the compiler removing it */ 41/* Not static, because we don't want the compiler removing it */
42const char ipath_verbs_version[] = "ipath_verbs " IPATH_IDSTR; 42const char ipath_verbs_version[] = "ipath_verbs " IPATH_IDSTR;
43 43
44unsigned int ib_ipath_qp_table_size = 251; 44static unsigned int ib_ipath_qp_table_size = 251;
45module_param_named(qp_table_size, ib_ipath_qp_table_size, uint, S_IRUGO); 45module_param_named(qp_table_size, ib_ipath_qp_table_size, uint, S_IRUGO);
46MODULE_PARM_DESC(qp_table_size, "QP table size"); 46MODULE_PARM_DESC(qp_table_size, "QP table size");
47 47
@@ -87,7 +87,7 @@ const enum ib_wc_opcode ib_ipath_wc_opcode[] = {
87/* 87/*
88 * System image GUID. 88 * System image GUID.
89 */ 89 */
90__be64 sys_image_guid; 90static __be64 sys_image_guid;
91 91
92/** 92/**
93 * ipath_copy_sge - copy data to SGE memory 93 * ipath_copy_sge - copy data to SGE memory
@@ -449,7 +449,6 @@ static void ipath_ib_timer(void *arg)
449{ 449{
450 struct ipath_ibdev *dev = (struct ipath_ibdev *) arg; 450 struct ipath_ibdev *dev = (struct ipath_ibdev *) arg;
451 struct ipath_qp *resend = NULL; 451 struct ipath_qp *resend = NULL;
452 struct ipath_qp *rnr = NULL;
453 struct list_head *last; 452 struct list_head *last;
454 struct ipath_qp *qp; 453 struct ipath_qp *qp;
455 unsigned long flags; 454 unsigned long flags;
@@ -465,32 +464,18 @@ static void ipath_ib_timer(void *arg)
465 last = &dev->pending[dev->pending_index]; 464 last = &dev->pending[dev->pending_index];
466 while (!list_empty(last)) { 465 while (!list_empty(last)) {
467 qp = list_entry(last->next, struct ipath_qp, timerwait); 466 qp = list_entry(last->next, struct ipath_qp, timerwait);
468 if (last->next == LIST_POISON1 || 467 list_del_init(&qp->timerwait);
469 last->next != &qp->timerwait || 468 qp->timer_next = resend;
470 qp->timerwait.prev != last) { 469 resend = qp;
471 INIT_LIST_HEAD(last); 470 atomic_inc(&qp->refcount);
472 } else {
473 list_del(&qp->timerwait);
474 qp->timerwait.prev = (struct list_head *) resend;
475 resend = qp;
476 atomic_inc(&qp->refcount);
477 }
478 } 471 }
479 last = &dev->rnrwait; 472 last = &dev->rnrwait;
480 if (!list_empty(last)) { 473 if (!list_empty(last)) {
481 qp = list_entry(last->next, struct ipath_qp, timerwait); 474 qp = list_entry(last->next, struct ipath_qp, timerwait);
482 if (--qp->s_rnr_timeout == 0) { 475 if (--qp->s_rnr_timeout == 0) {
483 do { 476 do {
484 if (last->next == LIST_POISON1 || 477 list_del_init(&qp->timerwait);
485 last->next != &qp->timerwait || 478 tasklet_hi_schedule(&qp->s_task);
486 qp->timerwait.prev != last) {
487 INIT_LIST_HEAD(last);
488 break;
489 }
490 list_del(&qp->timerwait);
491 qp->timerwait.prev =
492 (struct list_head *) rnr;
493 rnr = qp;
494 if (list_empty(last)) 479 if (list_empty(last))
495 break; 480 break;
496 qp = list_entry(last->next, struct ipath_qp, 481 qp = list_entry(last->next, struct ipath_qp,
@@ -530,8 +515,7 @@ static void ipath_ib_timer(void *arg)
530 spin_unlock_irqrestore(&dev->pending_lock, flags); 515 spin_unlock_irqrestore(&dev->pending_lock, flags);
531 516
532 /* XXX What if timer fires again while this is running? */ 517 /* XXX What if timer fires again while this is running? */
533 for (qp = resend; qp != NULL; 518 for (qp = resend; qp != NULL; qp = qp->timer_next) {
534 qp = (struct ipath_qp *) qp->timerwait.prev) {
535 struct ib_wc wc; 519 struct ib_wc wc;
536 520
537 spin_lock_irqsave(&qp->s_lock, flags); 521 spin_lock_irqsave(&qp->s_lock, flags);
@@ -545,9 +529,6 @@ static void ipath_ib_timer(void *arg)
545 if (atomic_dec_and_test(&qp->refcount)) 529 if (atomic_dec_and_test(&qp->refcount))
546 wake_up(&qp->wait); 530 wake_up(&qp->wait);
547 } 531 }
548 for (qp = rnr; qp != NULL;
549 qp = (struct ipath_qp *) qp->timerwait.prev)
550 tasklet_hi_schedule(&qp->s_task);
551} 532}
552 533
553/** 534/**
@@ -556,9 +537,9 @@ static void ipath_ib_timer(void *arg)
556 * 537 *
557 * This is called from ipath_intr() at interrupt level when a PIO buffer is 538 * This is called from ipath_intr() at interrupt level when a PIO buffer is
558 * available after ipath_verbs_send() returned an error that no buffers were 539 * available after ipath_verbs_send() returned an error that no buffers were
559 * available. Return 0 if we consumed all the PIO buffers and we still have 540 * available. Return 1 if we consumed all the PIO buffers and we still have
560 * QPs waiting for buffers (for now, just do a tasklet_hi_schedule and 541 * QPs waiting for buffers (for now, just do a tasklet_hi_schedule and
561 * return one). 542 * return zero).
562 */ 543 */
563static int ipath_ib_piobufavail(void *arg) 544static int ipath_ib_piobufavail(void *arg)
564{ 545{
@@ -573,13 +554,13 @@ static int ipath_ib_piobufavail(void *arg)
573 while (!list_empty(&dev->piowait)) { 554 while (!list_empty(&dev->piowait)) {
574 qp = list_entry(dev->piowait.next, struct ipath_qp, 555 qp = list_entry(dev->piowait.next, struct ipath_qp,
575 piowait); 556 piowait);
576 list_del(&qp->piowait); 557 list_del_init(&qp->piowait);
577 tasklet_hi_schedule(&qp->s_task); 558 tasklet_hi_schedule(&qp->s_task);
578 } 559 }
579 spin_unlock_irqrestore(&dev->pending_lock, flags); 560 spin_unlock_irqrestore(&dev->pending_lock, flags);
580 561
581bail: 562bail:
582 return 1; 563 return 0;
583} 564}
584 565
585static int ipath_query_device(struct ib_device *ibdev, 566static int ipath_query_device(struct ib_device *ibdev,
@@ -970,6 +951,7 @@ static void *ipath_register_ib_device(int unit, struct ipath_devdata *dd)
970 idev->dd = dd; 951 idev->dd = dd;
971 952
972 strlcpy(dev->name, "ipath%d", IB_DEVICE_NAME_MAX); 953 strlcpy(dev->name, "ipath%d", IB_DEVICE_NAME_MAX);
954 dev->owner = THIS_MODULE;
973 dev->node_guid = ipath_layer_get_guid(dd); 955 dev->node_guid = ipath_layer_get_guid(dd);
974 dev->uverbs_abi_ver = IPATH_UVERBS_ABI_VERSION; 956 dev->uverbs_abi_ver = IPATH_UVERBS_ABI_VERSION;
975 dev->uverbs_cmd_mask = 957 dev->uverbs_cmd_mask =
@@ -1110,7 +1092,7 @@ static void ipath_unregister_ib_device(void *arg)
1110 ib_dealloc_device(ibdev); 1092 ib_dealloc_device(ibdev);
1111} 1093}
1112 1094
1113int __init ipath_verbs_init(void) 1095static int __init ipath_verbs_init(void)
1114{ 1096{
1115 return ipath_verbs_register(ipath_register_ib_device, 1097 return ipath_verbs_register(ipath_register_ib_device,
1116 ipath_unregister_ib_device, 1098 ipath_unregister_ib_device,
@@ -1118,33 +1100,33 @@ int __init ipath_verbs_init(void)
1118 ipath_ib_timer); 1100 ipath_ib_timer);
1119} 1101}
1120 1102
1121void __exit ipath_verbs_cleanup(void) 1103static void __exit ipath_verbs_cleanup(void)
1122{ 1104{
1123 ipath_verbs_unregister(); 1105 ipath_verbs_unregister();
1124} 1106}
1125 1107
1126static ssize_t show_rev(struct class_device *cdev, char *buf) 1108static ssize_t show_rev(struct class_device *cdev, char *buf)
1127{ 1109{
1128 struct ipath_ibdev *dev = 1110 struct ipath_ibdev *dev =
1129 container_of(cdev, struct ipath_ibdev, ibdev.class_dev); 1111 container_of(cdev, struct ipath_ibdev, ibdev.class_dev);
1130 int vendor, boardrev, majrev, minrev; 1112 int vendor, boardrev, majrev, minrev;
1131 1113
1132 ipath_layer_query_device(dev->dd, &vendor, &boardrev, 1114 ipath_layer_query_device(dev->dd, &vendor, &boardrev,
1133 &majrev, &minrev); 1115 &majrev, &minrev);
1134 return sprintf(buf, "%d.%d\n", majrev, minrev); 1116 return sprintf(buf, "%d.%d\n", majrev, minrev);
1135} 1117}
1136 1118
1137static ssize_t show_hca(struct class_device *cdev, char *buf) 1119static ssize_t show_hca(struct class_device *cdev, char *buf)
1138{ 1120{
1139 struct ipath_ibdev *dev = 1121 struct ipath_ibdev *dev =
1140 container_of(cdev, struct ipath_ibdev, ibdev.class_dev); 1122 container_of(cdev, struct ipath_ibdev, ibdev.class_dev);
1141 int ret; 1123 int ret;
1142 1124
1143 ret = ipath_layer_get_boardname(dev->dd, buf, 128); 1125 ret = ipath_layer_get_boardname(dev->dd, buf, 128);
1144 if (ret < 0) 1126 if (ret < 0)
1145 goto bail; 1127 goto bail;
1146 strcat(buf, "\n"); 1128 strcat(buf, "\n");
1147 ret = strlen(buf); 1129 ret = strlen(buf);
1148 1130
1149bail: 1131bail:
1150 return ret; 1132 return ret;
@@ -1152,40 +1134,40 @@ bail:
1152 1134
1153static ssize_t show_stats(struct class_device *cdev, char *buf) 1135static ssize_t show_stats(struct class_device *cdev, char *buf)
1154{ 1136{
1155 struct ipath_ibdev *dev = 1137 struct ipath_ibdev *dev =
1156 container_of(cdev, struct ipath_ibdev, ibdev.class_dev); 1138 container_of(cdev, struct ipath_ibdev, ibdev.class_dev);
1157 int i; 1139 int i;
1158 int len; 1140 int len;
1159 1141
1160 len = sprintf(buf, 1142 len = sprintf(buf,
1161 "RC resends %d\n" 1143 "RC resends %d\n"
1162 "RC QACKs %d\n" 1144 "RC no QACK %d\n"
1163 "RC ACKs %d\n" 1145 "RC ACKs %d\n"
1164 "RC SEQ NAKs %d\n" 1146 "RC SEQ NAKs %d\n"
1165 "RC RDMA seq %d\n" 1147 "RC RDMA seq %d\n"
1166 "RC RNR NAKs %d\n" 1148 "RC RNR NAKs %d\n"
1167 "RC OTH NAKs %d\n" 1149 "RC OTH NAKs %d\n"
1168 "RC timeouts %d\n" 1150 "RC timeouts %d\n"
1169 "RC RDMA dup %d\n" 1151 "RC RDMA dup %d\n"
1170 "piobuf wait %d\n" 1152 "piobuf wait %d\n"
1171 "no piobuf %d\n" 1153 "no piobuf %d\n"
1172 "PKT drops %d\n" 1154 "PKT drops %d\n"
1173 "WQE errs %d\n", 1155 "WQE errs %d\n",
1174 dev->n_rc_resends, dev->n_rc_qacks, dev->n_rc_acks, 1156 dev->n_rc_resends, dev->n_rc_qacks, dev->n_rc_acks,
1175 dev->n_seq_naks, dev->n_rdma_seq, dev->n_rnr_naks, 1157 dev->n_seq_naks, dev->n_rdma_seq, dev->n_rnr_naks,
1176 dev->n_other_naks, dev->n_timeouts, 1158 dev->n_other_naks, dev->n_timeouts,
1177 dev->n_rdma_dup_busy, dev->n_piowait, 1159 dev->n_rdma_dup_busy, dev->n_piowait,
1178 dev->n_no_piobuf, dev->n_pkt_drops, dev->n_wqe_errs); 1160 dev->n_no_piobuf, dev->n_pkt_drops, dev->n_wqe_errs);
1179 for (i = 0; i < ARRAY_SIZE(dev->opstats); i++) { 1161 for (i = 0; i < ARRAY_SIZE(dev->opstats); i++) {
1180 const struct ipath_opcode_stats *si = &dev->opstats[i]; 1162 const struct ipath_opcode_stats *si = &dev->opstats[i];
1181 1163
1182 if (!si->n_packets && !si->n_bytes) 1164 if (!si->n_packets && !si->n_bytes)
1183 continue; 1165 continue;
1184 len += sprintf(buf + len, "%02x %llu/%llu\n", i, 1166 len += sprintf(buf + len, "%02x %llu/%llu\n", i,
1185 (unsigned long long) si->n_packets, 1167 (unsigned long long) si->n_packets,
1186 (unsigned long long) si->n_bytes); 1168 (unsigned long long) si->n_bytes);
1187 } 1169 }
1188 return len; 1170 return len;
1189} 1171}
1190 1172
1191static CLASS_DEVICE_ATTR(hw_rev, S_IRUGO, show_rev, NULL); 1173static CLASS_DEVICE_ATTR(hw_rev, S_IRUGO, show_rev, NULL);
@@ -1194,25 +1176,25 @@ static CLASS_DEVICE_ATTR(board_id, S_IRUGO, show_hca, NULL);
1194static CLASS_DEVICE_ATTR(stats, S_IRUGO, show_stats, NULL); 1176static CLASS_DEVICE_ATTR(stats, S_IRUGO, show_stats, NULL);
1195 1177
1196static struct class_device_attribute *ipath_class_attributes[] = { 1178static struct class_device_attribute *ipath_class_attributes[] = {
1197 &class_device_attr_hw_rev, 1179 &class_device_attr_hw_rev,
1198 &class_device_attr_hca_type, 1180 &class_device_attr_hca_type,
1199 &class_device_attr_board_id, 1181 &class_device_attr_board_id,
1200 &class_device_attr_stats 1182 &class_device_attr_stats
1201}; 1183};
1202 1184
1203static int ipath_verbs_register_sysfs(struct ib_device *dev) 1185static int ipath_verbs_register_sysfs(struct ib_device *dev)
1204{ 1186{
1205 int i; 1187 int i;
1206 int ret; 1188 int ret;
1207 1189
1208 for (i = 0; i < ARRAY_SIZE(ipath_class_attributes); ++i) 1190 for (i = 0; i < ARRAY_SIZE(ipath_class_attributes); ++i)
1209 if (class_device_create_file(&dev->class_dev, 1191 if (class_device_create_file(&dev->class_dev,
1210 ipath_class_attributes[i])) { 1192 ipath_class_attributes[i])) {
1211 ret = 1; 1193 ret = 1;
1212 goto bail; 1194 goto bail;
1213 } 1195 }
1214 1196
1215 ret = 0; 1197 ret = 0;
1216 1198
1217bail: 1199bail:
1218 return ret; 1200 return ret;
diff --git a/drivers/infiniband/hw/ipath/ipath_verbs.h b/drivers/infiniband/hw/ipath/ipath_verbs.h
index b824632b2a8c..4f8d59300e9b 100644
--- a/drivers/infiniband/hw/ipath/ipath_verbs.h
+++ b/drivers/infiniband/hw/ipath/ipath_verbs.h
@@ -282,7 +282,8 @@ struct ipath_srq {
282 */ 282 */
283struct ipath_qp { 283struct ipath_qp {
284 struct ib_qp ibqp; 284 struct ib_qp ibqp;
285 struct ipath_qp *next; /* link list for QPN hash table */ 285 struct ipath_qp *next; /* link list for QPN hash table */
286 struct ipath_qp *timer_next; /* link list for ipath_ib_timer() */
286 struct list_head piowait; /* link for wait PIO buf */ 287 struct list_head piowait; /* link for wait PIO buf */
287 struct list_head timerwait; /* link for waiting for timeouts */ 288 struct list_head timerwait; /* link for waiting for timeouts */
288 struct ib_ah_attr remote_ah_attr; 289 struct ib_ah_attr remote_ah_attr;
@@ -577,8 +578,6 @@ int ipath_init_qp_table(struct ipath_ibdev *idev, int size);
577 578
578void ipath_sqerror_qp(struct ipath_qp *qp, struct ib_wc *wc); 579void ipath_sqerror_qp(struct ipath_qp *qp, struct ib_wc *wc);
579 580
580void ipath_error_qp(struct ipath_qp *qp);
581
582void ipath_get_credit(struct ipath_qp *qp, u32 aeth); 581void ipath_get_credit(struct ipath_qp *qp, u32 aeth);
583 582
584void ipath_do_rc_send(unsigned long data); 583void ipath_do_rc_send(unsigned long data);
@@ -607,9 +606,6 @@ void ipath_rc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr,
607 606
608void ipath_restart_rc(struct ipath_qp *qp, u32 psn, struct ib_wc *wc); 607void ipath_restart_rc(struct ipath_qp *qp, u32 psn, struct ib_wc *wc);
609 608
610void ipath_ud_loopback(struct ipath_qp *sqp, struct ipath_sge_state *ss,
611 u32 length, struct ib_send_wr *wr, struct ib_wc *wc);
612
613int ipath_post_ud_send(struct ipath_qp *qp, struct ib_send_wr *wr); 609int ipath_post_ud_send(struct ipath_qp *qp, struct ib_send_wr *wr);
614 610
615void ipath_ud_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr, 611void ipath_ud_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr,
diff --git a/drivers/infiniband/hw/ipath/ips_common.h b/drivers/infiniband/hw/ipath/ips_common.h
index 410a764dfcef..ab7cbbbfd03a 100644
--- a/drivers/infiniband/hw/ipath/ips_common.h
+++ b/drivers/infiniband/hw/ipath/ips_common.h
@@ -95,7 +95,7 @@ struct ether_header {
95 __u8 seq_num; 95 __u8 seq_num;
96 __le32 len; 96 __le32 len;
97 /* MUST be of word size due to PIO write requirements */ 97 /* MUST be of word size due to PIO write requirements */
98 __u32 csum; 98 __le32 csum;
99 __le16 csum_offset; 99 __le16 csum_offset;
100 __le16 flags; 100 __le16 flags;
101 __u16 first_2_bytes; 101 __u16 first_2_bytes;
diff --git a/drivers/infiniband/hw/mthca/mthca_cmd.c b/drivers/infiniband/hw/mthca/mthca_cmd.c
index 1985b5dfa481..798e13e14faf 100644
--- a/drivers/infiniband/hw/mthca/mthca_cmd.c
+++ b/drivers/infiniband/hw/mthca/mthca_cmd.c
@@ -182,7 +182,7 @@ struct mthca_cmd_context {
182 u8 status; 182 u8 status;
183}; 183};
184 184
185static int fw_cmd_doorbell = 1; 185static int fw_cmd_doorbell = 0;
186module_param(fw_cmd_doorbell, int, 0644); 186module_param(fw_cmd_doorbell, int, 0644);
187MODULE_PARM_DESC(fw_cmd_doorbell, "post FW commands through doorbell page if nonzero " 187MODULE_PARM_DESC(fw_cmd_doorbell, "post FW commands through doorbell page if nonzero "
188 "(and supported by FW)"); 188 "(and supported by FW)");
diff --git a/drivers/infiniband/hw/mthca/mthca_cq.c b/drivers/infiniband/hw/mthca/mthca_cq.c
index 312cf90731ea..205854e9c662 100644
--- a/drivers/infiniband/hw/mthca/mthca_cq.c
+++ b/drivers/infiniband/hw/mthca/mthca_cq.c
@@ -238,9 +238,9 @@ void mthca_cq_event(struct mthca_dev *dev, u32 cqn,
238 spin_lock(&dev->cq_table.lock); 238 spin_lock(&dev->cq_table.lock);
239 239
240 cq = mthca_array_get(&dev->cq_table.cq, cqn & (dev->limits.num_cqs - 1)); 240 cq = mthca_array_get(&dev->cq_table.cq, cqn & (dev->limits.num_cqs - 1));
241
242 if (cq) 241 if (cq)
243 atomic_inc(&cq->refcount); 242 ++cq->refcount;
243
244 spin_unlock(&dev->cq_table.lock); 244 spin_unlock(&dev->cq_table.lock);
245 245
246 if (!cq) { 246 if (!cq) {
@@ -254,8 +254,10 @@ void mthca_cq_event(struct mthca_dev *dev, u32 cqn,
254 if (cq->ibcq.event_handler) 254 if (cq->ibcq.event_handler)
255 cq->ibcq.event_handler(&event, cq->ibcq.cq_context); 255 cq->ibcq.event_handler(&event, cq->ibcq.cq_context);
256 256
257 if (atomic_dec_and_test(&cq->refcount)) 257 spin_lock(&dev->cq_table.lock);
258 if (!--cq->refcount)
258 wake_up(&cq->wait); 259 wake_up(&cq->wait);
260 spin_unlock(&dev->cq_table.lock);
259} 261}
260 262
261static inline int is_recv_cqe(struct mthca_cqe *cqe) 263static inline int is_recv_cqe(struct mthca_cqe *cqe)
@@ -267,23 +269,13 @@ static inline int is_recv_cqe(struct mthca_cqe *cqe)
267 return !(cqe->is_send & 0x80); 269 return !(cqe->is_send & 0x80);
268} 270}
269 271
270void mthca_cq_clean(struct mthca_dev *dev, u32 cqn, u32 qpn, 272void mthca_cq_clean(struct mthca_dev *dev, struct mthca_cq *cq, u32 qpn,
271 struct mthca_srq *srq) 273 struct mthca_srq *srq)
272{ 274{
273 struct mthca_cq *cq;
274 struct mthca_cqe *cqe; 275 struct mthca_cqe *cqe;
275 u32 prod_index; 276 u32 prod_index;
276 int nfreed = 0; 277 int nfreed = 0;
277 278
278 spin_lock_irq(&dev->cq_table.lock);
279 cq = mthca_array_get(&dev->cq_table.cq, cqn & (dev->limits.num_cqs - 1));
280 if (cq)
281 atomic_inc(&cq->refcount);
282 spin_unlock_irq(&dev->cq_table.lock);
283
284 if (!cq)
285 return;
286
287 spin_lock_irq(&cq->lock); 279 spin_lock_irq(&cq->lock);
288 280
289 /* 281 /*
@@ -301,7 +293,7 @@ void mthca_cq_clean(struct mthca_dev *dev, u32 cqn, u32 qpn,
301 293
302 if (0) 294 if (0)
303 mthca_dbg(dev, "Cleaning QPN %06x from CQN %06x; ci %d, pi %d\n", 295 mthca_dbg(dev, "Cleaning QPN %06x from CQN %06x; ci %d, pi %d\n",
304 qpn, cqn, cq->cons_index, prod_index); 296 qpn, cq->cqn, cq->cons_index, prod_index);
305 297
306 /* 298 /*
307 * Now sweep backwards through the CQ, removing CQ entries 299 * Now sweep backwards through the CQ, removing CQ entries
@@ -325,8 +317,6 @@ void mthca_cq_clean(struct mthca_dev *dev, u32 cqn, u32 qpn,
325 } 317 }
326 318
327 spin_unlock_irq(&cq->lock); 319 spin_unlock_irq(&cq->lock);
328 if (atomic_dec_and_test(&cq->refcount))
329 wake_up(&cq->wait);
330} 320}
331 321
332void mthca_cq_resize_copy_cqes(struct mthca_cq *cq) 322void mthca_cq_resize_copy_cqes(struct mthca_cq *cq)
@@ -821,7 +811,7 @@ int mthca_init_cq(struct mthca_dev *dev, int nent,
821 } 811 }
822 812
823 spin_lock_init(&cq->lock); 813 spin_lock_init(&cq->lock);
824 atomic_set(&cq->refcount, 1); 814 cq->refcount = 1;
825 init_waitqueue_head(&cq->wait); 815 init_waitqueue_head(&cq->wait);
826 816
827 memset(cq_context, 0, sizeof *cq_context); 817 memset(cq_context, 0, sizeof *cq_context);
@@ -896,6 +886,17 @@ err_out:
896 return err; 886 return err;
897} 887}
898 888
889static inline int get_cq_refcount(struct mthca_dev *dev, struct mthca_cq *cq)
890{
891 int c;
892
893 spin_lock_irq(&dev->cq_table.lock);
894 c = cq->refcount;
895 spin_unlock_irq(&dev->cq_table.lock);
896
897 return c;
898}
899
899void mthca_free_cq(struct mthca_dev *dev, 900void mthca_free_cq(struct mthca_dev *dev,
900 struct mthca_cq *cq) 901 struct mthca_cq *cq)
901{ 902{
@@ -929,6 +930,7 @@ void mthca_free_cq(struct mthca_dev *dev,
929 spin_lock_irq(&dev->cq_table.lock); 930 spin_lock_irq(&dev->cq_table.lock);
930 mthca_array_clear(&dev->cq_table.cq, 931 mthca_array_clear(&dev->cq_table.cq,
931 cq->cqn & (dev->limits.num_cqs - 1)); 932 cq->cqn & (dev->limits.num_cqs - 1));
933 --cq->refcount;
932 spin_unlock_irq(&dev->cq_table.lock); 934 spin_unlock_irq(&dev->cq_table.lock);
933 935
934 if (dev->mthca_flags & MTHCA_FLAG_MSI_X) 936 if (dev->mthca_flags & MTHCA_FLAG_MSI_X)
@@ -936,8 +938,7 @@ void mthca_free_cq(struct mthca_dev *dev,
936 else 938 else
937 synchronize_irq(dev->pdev->irq); 939 synchronize_irq(dev->pdev->irq);
938 940
939 atomic_dec(&cq->refcount); 941 wait_event(cq->wait, !get_cq_refcount(dev, cq));
940 wait_event(cq->wait, !atomic_read(&cq->refcount));
941 942
942 if (cq->is_kernel) { 943 if (cq->is_kernel) {
943 mthca_free_cq_buf(dev, &cq->buf, cq->ibcq.cqe); 944 mthca_free_cq_buf(dev, &cq->buf, cq->ibcq.cqe);
diff --git a/drivers/infiniband/hw/mthca/mthca_dev.h b/drivers/infiniband/hw/mthca/mthca_dev.h
index 4c1dcb4c1822..f8160b8de090 100644
--- a/drivers/infiniband/hw/mthca/mthca_dev.h
+++ b/drivers/infiniband/hw/mthca/mthca_dev.h
@@ -496,7 +496,7 @@ void mthca_free_cq(struct mthca_dev *dev,
496void mthca_cq_completion(struct mthca_dev *dev, u32 cqn); 496void mthca_cq_completion(struct mthca_dev *dev, u32 cqn);
497void mthca_cq_event(struct mthca_dev *dev, u32 cqn, 497void mthca_cq_event(struct mthca_dev *dev, u32 cqn,
498 enum ib_event_type event_type); 498 enum ib_event_type event_type);
499void mthca_cq_clean(struct mthca_dev *dev, u32 cqn, u32 qpn, 499void mthca_cq_clean(struct mthca_dev *dev, struct mthca_cq *cq, u32 qpn,
500 struct mthca_srq *srq); 500 struct mthca_srq *srq);
501void mthca_cq_resize_copy_cqes(struct mthca_cq *cq); 501void mthca_cq_resize_copy_cqes(struct mthca_cq *cq);
502int mthca_alloc_cq_buf(struct mthca_dev *dev, struct mthca_cq_buf *buf, int nent); 502int mthca_alloc_cq_buf(struct mthca_dev *dev, struct mthca_cq_buf *buf, int nent);
diff --git a/drivers/infiniband/hw/mthca/mthca_mad.c b/drivers/infiniband/hw/mthca/mthca_mad.c
index f235c7ea42f0..4730863ece9a 100644
--- a/drivers/infiniband/hw/mthca/mthca_mad.c
+++ b/drivers/infiniband/hw/mthca/mthca_mad.c
@@ -49,7 +49,7 @@ enum {
49 MTHCA_VENDOR_CLASS2 = 0xa 49 MTHCA_VENDOR_CLASS2 = 0xa
50}; 50};
51 51
52int mthca_update_rate(struct mthca_dev *dev, u8 port_num) 52static int mthca_update_rate(struct mthca_dev *dev, u8 port_num)
53{ 53{
54 struct ib_port_attr *tprops = NULL; 54 struct ib_port_attr *tprops = NULL;
55 int ret; 55 int ret;
diff --git a/drivers/infiniband/hw/mthca/mthca_mr.c b/drivers/infiniband/hw/mthca/mthca_mr.c
index 25e1c1db9a40..a486dec1707e 100644
--- a/drivers/infiniband/hw/mthca/mthca_mr.c
+++ b/drivers/infiniband/hw/mthca/mthca_mr.c
@@ -761,6 +761,7 @@ void mthca_arbel_fmr_unmap(struct mthca_dev *dev, struct mthca_fmr *fmr)
761 761
762int __devinit mthca_init_mr_table(struct mthca_dev *dev) 762int __devinit mthca_init_mr_table(struct mthca_dev *dev)
763{ 763{
764 unsigned long addr;
764 int err, i; 765 int err, i;
765 766
766 err = mthca_alloc_init(&dev->mr_table.mpt_alloc, 767 err = mthca_alloc_init(&dev->mr_table.mpt_alloc,
@@ -796,9 +797,12 @@ int __devinit mthca_init_mr_table(struct mthca_dev *dev)
796 goto err_fmr_mpt; 797 goto err_fmr_mpt;
797 } 798 }
798 799
800 addr = pci_resource_start(dev->pdev, 4) +
801 ((pci_resource_len(dev->pdev, 4) - 1) &
802 dev->mr_table.mpt_base);
803
799 dev->mr_table.tavor_fmr.mpt_base = 804 dev->mr_table.tavor_fmr.mpt_base =
800 ioremap(dev->mr_table.mpt_base, 805 ioremap(addr, (1 << i) * sizeof(struct mthca_mpt_entry));
801 (1 << i) * sizeof (struct mthca_mpt_entry));
802 806
803 if (!dev->mr_table.tavor_fmr.mpt_base) { 807 if (!dev->mr_table.tavor_fmr.mpt_base) {
804 mthca_warn(dev, "MPT ioremap for FMR failed.\n"); 808 mthca_warn(dev, "MPT ioremap for FMR failed.\n");
@@ -806,9 +810,12 @@ int __devinit mthca_init_mr_table(struct mthca_dev *dev)
806 goto err_fmr_mpt; 810 goto err_fmr_mpt;
807 } 811 }
808 812
813 addr = pci_resource_start(dev->pdev, 4) +
814 ((pci_resource_len(dev->pdev, 4) - 1) &
815 dev->mr_table.mtt_base);
816
809 dev->mr_table.tavor_fmr.mtt_base = 817 dev->mr_table.tavor_fmr.mtt_base =
810 ioremap(dev->mr_table.mtt_base, 818 ioremap(addr, (1 << i) * MTHCA_MTT_SEG_SIZE);
811 (1 << i) * MTHCA_MTT_SEG_SIZE);
812 if (!dev->mr_table.tavor_fmr.mtt_base) { 819 if (!dev->mr_table.tavor_fmr.mtt_base) {
813 mthca_warn(dev, "MTT ioremap for FMR failed.\n"); 820 mthca_warn(dev, "MTT ioremap for FMR failed.\n");
814 err = -ENOMEM; 821 err = -ENOMEM;
diff --git a/drivers/infiniband/hw/mthca/mthca_provider.c b/drivers/infiniband/hw/mthca/mthca_provider.c
index 565a24b1756f..a2eae8a30167 100644
--- a/drivers/infiniband/hw/mthca/mthca_provider.c
+++ b/drivers/infiniband/hw/mthca/mthca_provider.c
@@ -306,7 +306,7 @@ static int mthca_query_gid(struct ib_device *ibdev, u8 port,
306 goto out; 306 goto out;
307 } 307 }
308 308
309 memcpy(gid->raw + 8, out_mad->data + (index % 8) * 16, 8); 309 memcpy(gid->raw + 8, out_mad->data + (index % 8) * 8, 8);
310 310
311 out: 311 out:
312 kfree(in_mad); 312 kfree(in_mad);
diff --git a/drivers/infiniband/hw/mthca/mthca_provider.h b/drivers/infiniband/hw/mthca/mthca_provider.h
index 6676a786d690..179a8f610d0f 100644
--- a/drivers/infiniband/hw/mthca/mthca_provider.h
+++ b/drivers/infiniband/hw/mthca/mthca_provider.h
@@ -139,11 +139,12 @@ struct mthca_ah {
139 * a qp may be locked, with the send cq locked first. No other 139 * a qp may be locked, with the send cq locked first. No other
140 * nesting should be done. 140 * nesting should be done.
141 * 141 *
142 * Each struct mthca_cq/qp also has an atomic_t ref count. The 142 * Each struct mthca_cq/qp also has an ref count, protected by the
143 * pointer from the cq/qp_table to the struct counts as one reference. 143 * corresponding table lock. The pointer from the cq/qp_table to the
144 * This reference also is good for access through the consumer API, so 144 * struct counts as one reference. This reference also is good for
145 * modifying the CQ/QP etc doesn't need to take another reference. 145 * access through the consumer API, so modifying the CQ/QP etc doesn't
146 * Access because of a completion being polled does need a reference. 146 * need to take another reference. Access to a QP because of a
147 * completion being polled does not need a reference either.
147 * 148 *
148 * Finally, each struct mthca_cq/qp has a wait_queue_head_t for the 149 * Finally, each struct mthca_cq/qp has a wait_queue_head_t for the
149 * destroy function to sleep on. 150 * destroy function to sleep on.
@@ -159,8 +160,9 @@ struct mthca_ah {
159 * - decrement ref count; if zero, wake up waiters 160 * - decrement ref count; if zero, wake up waiters
160 * 161 *
161 * To destroy a CQ/QP, we can do the following: 162 * To destroy a CQ/QP, we can do the following:
162 * - lock cq/qp_table, remove pointer, unlock cq/qp_table lock 163 * - lock cq/qp_table
163 * - decrement ref count 164 * - remove pointer and decrement ref count
165 * - unlock cq/qp_table lock
164 * - wait_event until ref count is zero 166 * - wait_event until ref count is zero
165 * 167 *
166 * It is the consumer's responsibilty to make sure that no QP 168 * It is the consumer's responsibilty to make sure that no QP
@@ -197,7 +199,7 @@ struct mthca_cq_resize {
197struct mthca_cq { 199struct mthca_cq {
198 struct ib_cq ibcq; 200 struct ib_cq ibcq;
199 spinlock_t lock; 201 spinlock_t lock;
200 atomic_t refcount; 202 int refcount;
201 int cqn; 203 int cqn;
202 u32 cons_index; 204 u32 cons_index;
203 struct mthca_cq_buf buf; 205 struct mthca_cq_buf buf;
@@ -217,7 +219,7 @@ struct mthca_cq {
217struct mthca_srq { 219struct mthca_srq {
218 struct ib_srq ibsrq; 220 struct ib_srq ibsrq;
219 spinlock_t lock; 221 spinlock_t lock;
220 atomic_t refcount; 222 int refcount;
221 int srqn; 223 int srqn;
222 int max; 224 int max;
223 int max_gs; 225 int max_gs;
@@ -254,7 +256,7 @@ struct mthca_wq {
254 256
255struct mthca_qp { 257struct mthca_qp {
256 struct ib_qp ibqp; 258 struct ib_qp ibqp;
257 atomic_t refcount; 259 int refcount;
258 u32 qpn; 260 u32 qpn;
259 int is_direct; 261 int is_direct;
260 u8 port; /* for SQP and memfree use only */ 262 u8 port; /* for SQP and memfree use only */
diff --git a/drivers/infiniband/hw/mthca/mthca_qp.c b/drivers/infiniband/hw/mthca/mthca_qp.c
index f37b0e367323..07c13be07a4a 100644
--- a/drivers/infiniband/hw/mthca/mthca_qp.c
+++ b/drivers/infiniband/hw/mthca/mthca_qp.c
@@ -240,7 +240,7 @@ void mthca_qp_event(struct mthca_dev *dev, u32 qpn,
240 spin_lock(&dev->qp_table.lock); 240 spin_lock(&dev->qp_table.lock);
241 qp = mthca_array_get(&dev->qp_table.qp, qpn & (dev->limits.num_qps - 1)); 241 qp = mthca_array_get(&dev->qp_table.qp, qpn & (dev->limits.num_qps - 1));
242 if (qp) 242 if (qp)
243 atomic_inc(&qp->refcount); 243 ++qp->refcount;
244 spin_unlock(&dev->qp_table.lock); 244 spin_unlock(&dev->qp_table.lock);
245 245
246 if (!qp) { 246 if (!qp) {
@@ -257,8 +257,10 @@ void mthca_qp_event(struct mthca_dev *dev, u32 qpn,
257 if (qp->ibqp.event_handler) 257 if (qp->ibqp.event_handler)
258 qp->ibqp.event_handler(&event, qp->ibqp.qp_context); 258 qp->ibqp.event_handler(&event, qp->ibqp.qp_context);
259 259
260 if (atomic_dec_and_test(&qp->refcount)) 260 spin_lock(&dev->qp_table.lock);
261 if (!--qp->refcount)
261 wake_up(&qp->wait); 262 wake_up(&qp->wait);
263 spin_unlock(&dev->qp_table.lock);
262} 264}
263 265
264static int to_mthca_state(enum ib_qp_state ib_state) 266static int to_mthca_state(enum ib_qp_state ib_state)
@@ -833,10 +835,10 @@ int mthca_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask)
833 * entries and reinitialize the QP. 835 * entries and reinitialize the QP.
834 */ 836 */
835 if (new_state == IB_QPS_RESET && !qp->ibqp.uobject) { 837 if (new_state == IB_QPS_RESET && !qp->ibqp.uobject) {
836 mthca_cq_clean(dev, to_mcq(qp->ibqp.send_cq)->cqn, qp->qpn, 838 mthca_cq_clean(dev, to_mcq(qp->ibqp.send_cq), qp->qpn,
837 qp->ibqp.srq ? to_msrq(qp->ibqp.srq) : NULL); 839 qp->ibqp.srq ? to_msrq(qp->ibqp.srq) : NULL);
838 if (qp->ibqp.send_cq != qp->ibqp.recv_cq) 840 if (qp->ibqp.send_cq != qp->ibqp.recv_cq)
839 mthca_cq_clean(dev, to_mcq(qp->ibqp.recv_cq)->cqn, qp->qpn, 841 mthca_cq_clean(dev, to_mcq(qp->ibqp.recv_cq), qp->qpn,
840 qp->ibqp.srq ? to_msrq(qp->ibqp.srq) : NULL); 842 qp->ibqp.srq ? to_msrq(qp->ibqp.srq) : NULL);
841 843
842 mthca_wq_init(&qp->sq); 844 mthca_wq_init(&qp->sq);
@@ -1096,7 +1098,7 @@ static int mthca_alloc_qp_common(struct mthca_dev *dev,
1096 int ret; 1098 int ret;
1097 int i; 1099 int i;
1098 1100
1099 atomic_set(&qp->refcount, 1); 1101 qp->refcount = 1;
1100 init_waitqueue_head(&qp->wait); 1102 init_waitqueue_head(&qp->wait);
1101 qp->state = IB_QPS_RESET; 1103 qp->state = IB_QPS_RESET;
1102 qp->atomic_rd_en = 0; 1104 qp->atomic_rd_en = 0;
@@ -1318,6 +1320,17 @@ int mthca_alloc_sqp(struct mthca_dev *dev,
1318 return err; 1320 return err;
1319} 1321}
1320 1322
1323static inline int get_qp_refcount(struct mthca_dev *dev, struct mthca_qp *qp)
1324{
1325 int c;
1326
1327 spin_lock_irq(&dev->qp_table.lock);
1328 c = qp->refcount;
1329 spin_unlock_irq(&dev->qp_table.lock);
1330
1331 return c;
1332}
1333
1321void mthca_free_qp(struct mthca_dev *dev, 1334void mthca_free_qp(struct mthca_dev *dev,
1322 struct mthca_qp *qp) 1335 struct mthca_qp *qp)
1323{ 1336{
@@ -1339,14 +1352,14 @@ void mthca_free_qp(struct mthca_dev *dev,
1339 spin_lock(&dev->qp_table.lock); 1352 spin_lock(&dev->qp_table.lock);
1340 mthca_array_clear(&dev->qp_table.qp, 1353 mthca_array_clear(&dev->qp_table.qp,
1341 qp->qpn & (dev->limits.num_qps - 1)); 1354 qp->qpn & (dev->limits.num_qps - 1));
1355 --qp->refcount;
1342 spin_unlock(&dev->qp_table.lock); 1356 spin_unlock(&dev->qp_table.lock);
1343 1357
1344 if (send_cq != recv_cq) 1358 if (send_cq != recv_cq)
1345 spin_unlock(&recv_cq->lock); 1359 spin_unlock(&recv_cq->lock);
1346 spin_unlock_irq(&send_cq->lock); 1360 spin_unlock_irq(&send_cq->lock);
1347 1361
1348 atomic_dec(&qp->refcount); 1362 wait_event(qp->wait, !get_qp_refcount(dev, qp));
1349 wait_event(qp->wait, !atomic_read(&qp->refcount));
1350 1363
1351 if (qp->state != IB_QPS_RESET) 1364 if (qp->state != IB_QPS_RESET)
1352 mthca_MODIFY_QP(dev, qp->state, IB_QPS_RESET, qp->qpn, 0, 1365 mthca_MODIFY_QP(dev, qp->state, IB_QPS_RESET, qp->qpn, 0,
@@ -1358,10 +1371,10 @@ void mthca_free_qp(struct mthca_dev *dev,
1358 * unref the mem-free tables and free the QPN in our table. 1371 * unref the mem-free tables and free the QPN in our table.
1359 */ 1372 */
1360 if (!qp->ibqp.uobject) { 1373 if (!qp->ibqp.uobject) {
1361 mthca_cq_clean(dev, to_mcq(qp->ibqp.send_cq)->cqn, qp->qpn, 1374 mthca_cq_clean(dev, to_mcq(qp->ibqp.send_cq), qp->qpn,
1362 qp->ibqp.srq ? to_msrq(qp->ibqp.srq) : NULL); 1375 qp->ibqp.srq ? to_msrq(qp->ibqp.srq) : NULL);
1363 if (qp->ibqp.send_cq != qp->ibqp.recv_cq) 1376 if (qp->ibqp.send_cq != qp->ibqp.recv_cq)
1364 mthca_cq_clean(dev, to_mcq(qp->ibqp.recv_cq)->cqn, qp->qpn, 1377 mthca_cq_clean(dev, to_mcq(qp->ibqp.recv_cq), qp->qpn,
1365 qp->ibqp.srq ? to_msrq(qp->ibqp.srq) : NULL); 1378 qp->ibqp.srq ? to_msrq(qp->ibqp.srq) : NULL);
1366 1379
1367 mthca_free_memfree(dev, qp); 1380 mthca_free_memfree(dev, qp);
@@ -1714,23 +1727,7 @@ int mthca_tavor_post_receive(struct ib_qp *ibqp, struct ib_recv_wr *wr,
1714 1727
1715 ind = qp->rq.next_ind; 1728 ind = qp->rq.next_ind;
1716 1729
1717 for (nreq = 0; wr; ++nreq, wr = wr->next) { 1730 for (nreq = 0; wr; wr = wr->next) {
1718 if (unlikely(nreq == MTHCA_TAVOR_MAX_WQES_PER_RECV_DB)) {
1719 nreq = 0;
1720
1721 doorbell[0] = cpu_to_be32((qp->rq.next_ind << qp->rq.wqe_shift) | size0);
1722 doorbell[1] = cpu_to_be32(qp->qpn << 8);
1723
1724 wmb();
1725
1726 mthca_write64(doorbell,
1727 dev->kar + MTHCA_RECEIVE_DOORBELL,
1728 MTHCA_GET_DOORBELL_LOCK(&dev->doorbell_lock));
1729
1730 qp->rq.head += MTHCA_TAVOR_MAX_WQES_PER_RECV_DB;
1731 size0 = 0;
1732 }
1733
1734 if (mthca_wq_overflow(&qp->rq, nreq, qp->ibqp.recv_cq)) { 1731 if (mthca_wq_overflow(&qp->rq, nreq, qp->ibqp.recv_cq)) {
1735 mthca_err(dev, "RQ %06x full (%u head, %u tail," 1732 mthca_err(dev, "RQ %06x full (%u head, %u tail,"
1736 " %d max, %d nreq)\n", qp->qpn, 1733 " %d max, %d nreq)\n", qp->qpn,
@@ -1784,6 +1781,23 @@ int mthca_tavor_post_receive(struct ib_qp *ibqp, struct ib_recv_wr *wr,
1784 ++ind; 1781 ++ind;
1785 if (unlikely(ind >= qp->rq.max)) 1782 if (unlikely(ind >= qp->rq.max))
1786 ind -= qp->rq.max; 1783 ind -= qp->rq.max;
1784
1785 ++nreq;
1786 if (unlikely(nreq == MTHCA_TAVOR_MAX_WQES_PER_RECV_DB)) {
1787 nreq = 0;
1788
1789 doorbell[0] = cpu_to_be32((qp->rq.next_ind << qp->rq.wqe_shift) | size0);
1790 doorbell[1] = cpu_to_be32(qp->qpn << 8);
1791
1792 wmb();
1793
1794 mthca_write64(doorbell,
1795 dev->kar + MTHCA_RECEIVE_DOORBELL,
1796 MTHCA_GET_DOORBELL_LOCK(&dev->doorbell_lock));
1797
1798 qp->rq.head += MTHCA_TAVOR_MAX_WQES_PER_RECV_DB;
1799 size0 = 0;
1800 }
1787 } 1801 }
1788 1802
1789out: 1803out:
diff --git a/drivers/infiniband/hw/mthca/mthca_srq.c b/drivers/infiniband/hw/mthca/mthca_srq.c
index adcaf85355ae..b292fefa3b41 100644
--- a/drivers/infiniband/hw/mthca/mthca_srq.c
+++ b/drivers/infiniband/hw/mthca/mthca_srq.c
@@ -241,7 +241,7 @@ int mthca_alloc_srq(struct mthca_dev *dev, struct mthca_pd *pd,
241 goto err_out_mailbox; 241 goto err_out_mailbox;
242 242
243 spin_lock_init(&srq->lock); 243 spin_lock_init(&srq->lock);
244 atomic_set(&srq->refcount, 1); 244 srq->refcount = 1;
245 init_waitqueue_head(&srq->wait); 245 init_waitqueue_head(&srq->wait);
246 246
247 if (mthca_is_memfree(dev)) 247 if (mthca_is_memfree(dev))
@@ -308,6 +308,17 @@ err_out:
308 return err; 308 return err;
309} 309}
310 310
311static inline int get_srq_refcount(struct mthca_dev *dev, struct mthca_srq *srq)
312{
313 int c;
314
315 spin_lock_irq(&dev->srq_table.lock);
316 c = srq->refcount;
317 spin_unlock_irq(&dev->srq_table.lock);
318
319 return c;
320}
321
311void mthca_free_srq(struct mthca_dev *dev, struct mthca_srq *srq) 322void mthca_free_srq(struct mthca_dev *dev, struct mthca_srq *srq)
312{ 323{
313 struct mthca_mailbox *mailbox; 324 struct mthca_mailbox *mailbox;
@@ -329,10 +340,10 @@ void mthca_free_srq(struct mthca_dev *dev, struct mthca_srq *srq)
329 spin_lock_irq(&dev->srq_table.lock); 340 spin_lock_irq(&dev->srq_table.lock);
330 mthca_array_clear(&dev->srq_table.srq, 341 mthca_array_clear(&dev->srq_table.srq,
331 srq->srqn & (dev->limits.num_srqs - 1)); 342 srq->srqn & (dev->limits.num_srqs - 1));
343 --srq->refcount;
332 spin_unlock_irq(&dev->srq_table.lock); 344 spin_unlock_irq(&dev->srq_table.lock);
333 345
334 atomic_dec(&srq->refcount); 346 wait_event(srq->wait, !get_srq_refcount(dev, srq));
335 wait_event(srq->wait, !atomic_read(&srq->refcount));
336 347
337 if (!srq->ibsrq.uobject) { 348 if (!srq->ibsrq.uobject) {
338 mthca_free_srq_buf(dev, srq); 349 mthca_free_srq_buf(dev, srq);
@@ -414,7 +425,7 @@ void mthca_srq_event(struct mthca_dev *dev, u32 srqn,
414 spin_lock(&dev->srq_table.lock); 425 spin_lock(&dev->srq_table.lock);
415 srq = mthca_array_get(&dev->srq_table.srq, srqn & (dev->limits.num_srqs - 1)); 426 srq = mthca_array_get(&dev->srq_table.srq, srqn & (dev->limits.num_srqs - 1));
416 if (srq) 427 if (srq)
417 atomic_inc(&srq->refcount); 428 ++srq->refcount;
418 spin_unlock(&dev->srq_table.lock); 429 spin_unlock(&dev->srq_table.lock);
419 430
420 if (!srq) { 431 if (!srq) {
@@ -431,8 +442,10 @@ void mthca_srq_event(struct mthca_dev *dev, u32 srqn,
431 srq->ibsrq.event_handler(&event, srq->ibsrq.srq_context); 442 srq->ibsrq.event_handler(&event, srq->ibsrq.srq_context);
432 443
433out: 444out:
434 if (atomic_dec_and_test(&srq->refcount)) 445 spin_lock(&dev->srq_table.lock);
446 if (!--srq->refcount)
435 wake_up(&srq->wait); 447 wake_up(&srq->wait);
448 spin_unlock(&dev->srq_table.lock);
436} 449}
437 450
438/* 451/*
@@ -477,26 +490,7 @@ int mthca_tavor_post_srq_recv(struct ib_srq *ibsrq, struct ib_recv_wr *wr,
477 490
478 first_ind = srq->first_free; 491 first_ind = srq->first_free;
479 492
480 for (nreq = 0; wr; ++nreq, wr = wr->next) { 493 for (nreq = 0; wr; wr = wr->next) {
481 if (unlikely(nreq == MTHCA_TAVOR_MAX_WQES_PER_RECV_DB)) {
482 nreq = 0;
483
484 doorbell[0] = cpu_to_be32(first_ind << srq->wqe_shift);
485 doorbell[1] = cpu_to_be32(srq->srqn << 8);
486
487 /*
488 * Make sure that descriptors are written
489 * before doorbell is rung.
490 */
491 wmb();
492
493 mthca_write64(doorbell,
494 dev->kar + MTHCA_RECEIVE_DOORBELL,
495 MTHCA_GET_DOORBELL_LOCK(&dev->doorbell_lock));
496
497 first_ind = srq->first_free;
498 }
499
500 ind = srq->first_free; 494 ind = srq->first_free;
501 495
502 if (ind < 0) { 496 if (ind < 0) {
@@ -556,6 +550,26 @@ int mthca_tavor_post_srq_recv(struct ib_srq *ibsrq, struct ib_recv_wr *wr,
556 550
557 srq->wrid[ind] = wr->wr_id; 551 srq->wrid[ind] = wr->wr_id;
558 srq->first_free = next_ind; 552 srq->first_free = next_ind;
553
554 ++nreq;
555 if (unlikely(nreq == MTHCA_TAVOR_MAX_WQES_PER_RECV_DB)) {
556 nreq = 0;
557
558 doorbell[0] = cpu_to_be32(first_ind << srq->wqe_shift);
559 doorbell[1] = cpu_to_be32(srq->srqn << 8);
560
561 /*
562 * Make sure that descriptors are written
563 * before doorbell is rung.
564 */
565 wmb();
566
567 mthca_write64(doorbell,
568 dev->kar + MTHCA_RECEIVE_DOORBELL,
569 MTHCA_GET_DOORBELL_LOCK(&dev->doorbell_lock));
570
571 first_ind = srq->first_free;
572 }
559 } 573 }
560 574
561 if (likely(nreq)) { 575 if (likely(nreq)) {
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
index a54da42849ae..8406839b91cf 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
@@ -275,6 +275,7 @@ static void ipoib_ib_handle_wc(struct net_device *dev,
275 spin_lock_irqsave(&priv->tx_lock, flags); 275 spin_lock_irqsave(&priv->tx_lock, flags);
276 ++priv->tx_tail; 276 ++priv->tx_tail;
277 if (netif_queue_stopped(dev) && 277 if (netif_queue_stopped(dev) &&
278 test_bit(IPOIB_FLAG_ADMIN_UP, &priv->flags) &&
278 priv->tx_head - priv->tx_tail <= ipoib_sendq_size >> 1) 279 priv->tx_head - priv->tx_tail <= ipoib_sendq_size >> 1)
279 netif_wake_queue(dev); 280 netif_wake_queue(dev);
280 spin_unlock_irqrestore(&priv->tx_lock, flags); 281 spin_unlock_irqrestore(&priv->tx_lock, flags);
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_vlan.c b/drivers/infiniband/ulp/ipoib/ipoib_vlan.c
index 4ca175553f9f..f887780e8093 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_vlan.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_vlan.c
@@ -158,10 +158,8 @@ int ipoib_vlan_delete(struct net_device *pdev, unsigned short pkey)
158 if (priv->pkey == pkey) { 158 if (priv->pkey == pkey) {
159 unregister_netdev(priv->dev); 159 unregister_netdev(priv->dev);
160 ipoib_dev_cleanup(priv->dev); 160 ipoib_dev_cleanup(priv->dev);
161
162 list_del(&priv->list); 161 list_del(&priv->list);
163 162 free_netdev(priv->dev);
164 kfree(priv);
165 163
166 ret = 0; 164 ret = 0;
167 break; 165 break;
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
index 5f2b3f6e4c47..9cbdffa08dc2 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -340,7 +340,10 @@ static void srp_disconnect_target(struct srp_target_port *target)
340 /* XXX should send SRP_I_LOGOUT request */ 340 /* XXX should send SRP_I_LOGOUT request */
341 341
342 init_completion(&target->done); 342 init_completion(&target->done);
343 ib_send_cm_dreq(target->cm_id, NULL, 0); 343 if (ib_send_cm_dreq(target->cm_id, NULL, 0)) {
344 printk(KERN_DEBUG PFX "Sending CM DREQ failed\n");
345 return;
346 }
344 wait_for_completion(&target->done); 347 wait_for_completion(&target->done);
345} 348}
346 349
@@ -351,7 +354,6 @@ static void srp_remove_work(void *target_ptr)
351 spin_lock_irq(target->scsi_host->host_lock); 354 spin_lock_irq(target->scsi_host->host_lock);
352 if (target->state != SRP_TARGET_DEAD) { 355 if (target->state != SRP_TARGET_DEAD) {
353 spin_unlock_irq(target->scsi_host->host_lock); 356 spin_unlock_irq(target->scsi_host->host_lock);
354 scsi_host_put(target->scsi_host);
355 return; 357 return;
356 } 358 }
357 target->state = SRP_TARGET_REMOVED; 359 target->state = SRP_TARGET_REMOVED;
@@ -365,8 +367,6 @@ static void srp_remove_work(void *target_ptr)
365 ib_destroy_cm_id(target->cm_id); 367 ib_destroy_cm_id(target->cm_id);
366 srp_free_target_ib(target); 368 srp_free_target_ib(target);
367 scsi_host_put(target->scsi_host); 369 scsi_host_put(target->scsi_host);
368 /* And another put to really free the target port... */
369 scsi_host_put(target->scsi_host);
370} 370}
371 371
372static int srp_connect_target(struct srp_target_port *target) 372static int srp_connect_target(struct srp_target_port *target)
@@ -409,6 +409,34 @@ static int srp_connect_target(struct srp_target_port *target)
409 } 409 }
410} 410}
411 411
412static void srp_unmap_data(struct scsi_cmnd *scmnd,
413 struct srp_target_port *target,
414 struct srp_request *req)
415{
416 struct scatterlist *scat;
417 int nents;
418
419 if (!scmnd->request_buffer ||
420 (scmnd->sc_data_direction != DMA_TO_DEVICE &&
421 scmnd->sc_data_direction != DMA_FROM_DEVICE))
422 return;
423
424 /*
425 * This handling of non-SG commands can be killed when the
426 * SCSI midlayer no longer generates non-SG commands.
427 */
428 if (likely(scmnd->use_sg)) {
429 nents = scmnd->use_sg;
430 scat = scmnd->request_buffer;
431 } else {
432 nents = 1;
433 scat = &req->fake_sg;
434 }
435
436 dma_unmap_sg(target->srp_host->dev->dma_device, scat, nents,
437 scmnd->sc_data_direction);
438}
439
412static int srp_reconnect_target(struct srp_target_port *target) 440static int srp_reconnect_target(struct srp_target_port *target)
413{ 441{
414 struct ib_cm_id *new_cm_id; 442 struct ib_cm_id *new_cm_id;
@@ -455,16 +483,16 @@ static int srp_reconnect_target(struct srp_target_port *target)
455 list_for_each_entry(req, &target->req_queue, list) { 483 list_for_each_entry(req, &target->req_queue, list) {
456 req->scmnd->result = DID_RESET << 16; 484 req->scmnd->result = DID_RESET << 16;
457 req->scmnd->scsi_done(req->scmnd); 485 req->scmnd->scsi_done(req->scmnd);
486 srp_unmap_data(req->scmnd, target, req);
458 } 487 }
459 488
460 target->rx_head = 0; 489 target->rx_head = 0;
461 target->tx_head = 0; 490 target->tx_head = 0;
462 target->tx_tail = 0; 491 target->tx_tail = 0;
463 target->req_head = 0; 492 INIT_LIST_HEAD(&target->free_reqs);
464 for (i = 0; i < SRP_SQ_SIZE - 1; ++i)
465 target->req_ring[i].next = i + 1;
466 target->req_ring[SRP_SQ_SIZE - 1].next = -1;
467 INIT_LIST_HEAD(&target->req_queue); 493 INIT_LIST_HEAD(&target->req_queue);
494 for (i = 0; i < SRP_SQ_SIZE; ++i)
495 list_add_tail(&target->req_ring[i].list, &target->free_reqs);
468 496
469 ret = srp_connect_target(target); 497 ret = srp_connect_target(target);
470 if (ret) 498 if (ret)
@@ -589,32 +617,10 @@ static int srp_map_data(struct scsi_cmnd *scmnd, struct srp_target_port *target,
589 return len; 617 return len;
590} 618}
591 619
592static void srp_unmap_data(struct scsi_cmnd *scmnd, 620static void srp_remove_req(struct srp_target_port *target, struct srp_request *req)
593 struct srp_target_port *target,
594 struct srp_request *req)
595{ 621{
596 struct scatterlist *scat; 622 srp_unmap_data(req->scmnd, target, req);
597 int nents; 623 list_move_tail(&req->list, &target->free_reqs);
598
599 if (!scmnd->request_buffer ||
600 (scmnd->sc_data_direction != DMA_TO_DEVICE &&
601 scmnd->sc_data_direction != DMA_FROM_DEVICE))
602 return;
603
604 /*
605 * This handling of non-SG commands can be killed when the
606 * SCSI midlayer no longer generates non-SG commands.
607 */
608 if (likely(scmnd->use_sg)) {
609 nents = scmnd->use_sg;
610 scat = scmnd->request_buffer;
611 } else {
612 nents = 1;
613 scat = &req->fake_sg;
614 }
615
616 dma_unmap_sg(target->srp_host->dev->dma_device, scat, nents,
617 scmnd->sc_data_direction);
618} 624}
619 625
620static void srp_process_rsp(struct srp_target_port *target, struct srp_rsp *rsp) 626static void srp_process_rsp(struct srp_target_port *target, struct srp_rsp *rsp)
@@ -639,7 +645,7 @@ static void srp_process_rsp(struct srp_target_port *target, struct srp_rsp *rsp)
639 req->tsk_status = rsp->data[3]; 645 req->tsk_status = rsp->data[3];
640 complete(&req->done); 646 complete(&req->done);
641 } else { 647 } else {
642 scmnd = req->scmnd; 648 scmnd = req->scmnd;
643 if (!scmnd) 649 if (!scmnd)
644 printk(KERN_ERR "Null scmnd for RSP w/tag %016llx\n", 650 printk(KERN_ERR "Null scmnd for RSP w/tag %016llx\n",
645 (unsigned long long) rsp->tag); 651 (unsigned long long) rsp->tag);
@@ -657,16 +663,11 @@ static void srp_process_rsp(struct srp_target_port *target, struct srp_rsp *rsp)
657 else if (rsp->flags & (SRP_RSP_FLAG_DIOVER | SRP_RSP_FLAG_DIUNDER)) 663 else if (rsp->flags & (SRP_RSP_FLAG_DIOVER | SRP_RSP_FLAG_DIUNDER))
658 scmnd->resid = be32_to_cpu(rsp->data_in_res_cnt); 664 scmnd->resid = be32_to_cpu(rsp->data_in_res_cnt);
659 665
660 srp_unmap_data(scmnd, target, req);
661
662 if (!req->tsk_mgmt) { 666 if (!req->tsk_mgmt) {
663 req->scmnd = NULL;
664 scmnd->host_scribble = (void *) -1L; 667 scmnd->host_scribble = (void *) -1L;
665 scmnd->scsi_done(scmnd); 668 scmnd->scsi_done(scmnd);
666 669
667 list_del(&req->list); 670 srp_remove_req(target, req);
668 req->next = target->req_head;
669 target->req_head = rsp->tag & ~SRP_TAG_TSK_MGMT;
670 } else 671 } else
671 req->cmd_done = 1; 672 req->cmd_done = 1;
672 } 673 }
@@ -853,7 +854,6 @@ static int srp_queuecommand(struct scsi_cmnd *scmnd,
853 struct srp_request *req; 854 struct srp_request *req;
854 struct srp_iu *iu; 855 struct srp_iu *iu;
855 struct srp_cmd *cmd; 856 struct srp_cmd *cmd;
856 long req_index;
857 int len; 857 int len;
858 858
859 if (target->state == SRP_TARGET_CONNECTING) 859 if (target->state == SRP_TARGET_CONNECTING)
@@ -873,22 +873,20 @@ static int srp_queuecommand(struct scsi_cmnd *scmnd,
873 dma_sync_single_for_cpu(target->srp_host->dev->dma_device, iu->dma, 873 dma_sync_single_for_cpu(target->srp_host->dev->dma_device, iu->dma,
874 SRP_MAX_IU_LEN, DMA_TO_DEVICE); 874 SRP_MAX_IU_LEN, DMA_TO_DEVICE);
875 875
876 req_index = target->req_head; 876 req = list_entry(target->free_reqs.next, struct srp_request, list);
877 877
878 scmnd->scsi_done = done; 878 scmnd->scsi_done = done;
879 scmnd->result = 0; 879 scmnd->result = 0;
880 scmnd->host_scribble = (void *) req_index; 880 scmnd->host_scribble = (void *) (long) req->index;
881 881
882 cmd = iu->buf; 882 cmd = iu->buf;
883 memset(cmd, 0, sizeof *cmd); 883 memset(cmd, 0, sizeof *cmd);
884 884
885 cmd->opcode = SRP_CMD; 885 cmd->opcode = SRP_CMD;
886 cmd->lun = cpu_to_be64((u64) scmnd->device->lun << 48); 886 cmd->lun = cpu_to_be64((u64) scmnd->device->lun << 48);
887 cmd->tag = req_index; 887 cmd->tag = req->index;
888 memcpy(cmd->cdb, scmnd->cmnd, scmnd->cmd_len); 888 memcpy(cmd->cdb, scmnd->cmnd, scmnd->cmd_len);
889 889
890 req = &target->req_ring[req_index];
891
892 req->scmnd = scmnd; 890 req->scmnd = scmnd;
893 req->cmd = iu; 891 req->cmd = iu;
894 req->cmd_done = 0; 892 req->cmd_done = 0;
@@ -913,8 +911,7 @@ static int srp_queuecommand(struct scsi_cmnd *scmnd,
913 goto err_unmap; 911 goto err_unmap;
914 } 912 }
915 913
916 target->req_head = req->next; 914 list_move_tail(&req->list, &target->req_queue);
917 list_add_tail(&req->list, &target->req_queue);
918 915
919 return 0; 916 return 0;
920 917
@@ -1137,30 +1134,20 @@ static int srp_cm_handler(struct ib_cm_id *cm_id, struct ib_cm_event *event)
1137 return 0; 1134 return 0;
1138} 1135}
1139 1136
1140static int srp_send_tsk_mgmt(struct scsi_cmnd *scmnd, u8 func) 1137static int srp_send_tsk_mgmt(struct srp_target_port *target,
1138 struct srp_request *req, u8 func)
1141{ 1139{
1142 struct srp_target_port *target = host_to_target(scmnd->device->host);
1143 struct srp_request *req;
1144 struct srp_iu *iu; 1140 struct srp_iu *iu;
1145 struct srp_tsk_mgmt *tsk_mgmt; 1141 struct srp_tsk_mgmt *tsk_mgmt;
1146 int req_index;
1147 int ret = FAILED;
1148 1142
1149 spin_lock_irq(target->scsi_host->host_lock); 1143 spin_lock_irq(target->scsi_host->host_lock);
1150 1144
1151 if (target->state == SRP_TARGET_DEAD || 1145 if (target->state == SRP_TARGET_DEAD ||
1152 target->state == SRP_TARGET_REMOVED) { 1146 target->state == SRP_TARGET_REMOVED) {
1153 scmnd->result = DID_BAD_TARGET << 16; 1147 req->scmnd->result = DID_BAD_TARGET << 16;
1154 goto out; 1148 goto out;
1155 } 1149 }
1156 1150
1157 if (scmnd->host_scribble == (void *) -1L)
1158 goto out;
1159
1160 req_index = (long) scmnd->host_scribble;
1161 printk(KERN_ERR "Abort for req_index %d\n", req_index);
1162
1163 req = &target->req_ring[req_index];
1164 init_completion(&req->done); 1151 init_completion(&req->done);
1165 1152
1166 iu = __srp_get_tx_iu(target); 1153 iu = __srp_get_tx_iu(target);
@@ -1171,10 +1158,10 @@ static int srp_send_tsk_mgmt(struct scsi_cmnd *scmnd, u8 func)
1171 memset(tsk_mgmt, 0, sizeof *tsk_mgmt); 1158 memset(tsk_mgmt, 0, sizeof *tsk_mgmt);
1172 1159
1173 tsk_mgmt->opcode = SRP_TSK_MGMT; 1160 tsk_mgmt->opcode = SRP_TSK_MGMT;
1174 tsk_mgmt->lun = cpu_to_be64((u64) scmnd->device->lun << 48); 1161 tsk_mgmt->lun = cpu_to_be64((u64) req->scmnd->device->lun << 48);
1175 tsk_mgmt->tag = req_index | SRP_TAG_TSK_MGMT; 1162 tsk_mgmt->tag = req->index | SRP_TAG_TSK_MGMT;
1176 tsk_mgmt->tsk_mgmt_func = func; 1163 tsk_mgmt->tsk_mgmt_func = func;
1177 tsk_mgmt->task_tag = req_index; 1164 tsk_mgmt->task_tag = req->index;
1178 1165
1179 if (__srp_post_send(target, iu, sizeof *tsk_mgmt)) 1166 if (__srp_post_send(target, iu, sizeof *tsk_mgmt))
1180 goto out; 1167 goto out;
@@ -1182,39 +1169,85 @@ static int srp_send_tsk_mgmt(struct scsi_cmnd *scmnd, u8 func)
1182 req->tsk_mgmt = iu; 1169 req->tsk_mgmt = iu;
1183 1170
1184 spin_unlock_irq(target->scsi_host->host_lock); 1171 spin_unlock_irq(target->scsi_host->host_lock);
1172
1185 if (!wait_for_completion_timeout(&req->done, 1173 if (!wait_for_completion_timeout(&req->done,
1186 msecs_to_jiffies(SRP_ABORT_TIMEOUT_MS))) 1174 msecs_to_jiffies(SRP_ABORT_TIMEOUT_MS)))
1187 return FAILED; 1175 return -1;
1188 spin_lock_irq(target->scsi_host->host_lock);
1189 1176
1190 if (req->cmd_done) { 1177 return 0;
1191 list_del(&req->list);
1192 req->next = target->req_head;
1193 target->req_head = req_index;
1194
1195 scmnd->scsi_done(scmnd);
1196 } else if (!req->tsk_status) {
1197 scmnd->result = DID_ABORT << 16;
1198 ret = SUCCESS;
1199 }
1200 1178
1201out: 1179out:
1202 spin_unlock_irq(target->scsi_host->host_lock); 1180 spin_unlock_irq(target->scsi_host->host_lock);
1203 return ret; 1181 return -1;
1182}
1183
1184static int srp_find_req(struct srp_target_port *target,
1185 struct scsi_cmnd *scmnd,
1186 struct srp_request **req)
1187{
1188 if (scmnd->host_scribble == (void *) -1L)
1189 return -1;
1190
1191 *req = &target->req_ring[(long) scmnd->host_scribble];
1192
1193 return 0;
1204} 1194}
1205 1195
1206static int srp_abort(struct scsi_cmnd *scmnd) 1196static int srp_abort(struct scsi_cmnd *scmnd)
1207{ 1197{
1198 struct srp_target_port *target = host_to_target(scmnd->device->host);
1199 struct srp_request *req;
1200 int ret = SUCCESS;
1201
1208 printk(KERN_ERR "SRP abort called\n"); 1202 printk(KERN_ERR "SRP abort called\n");
1209 1203
1210 return srp_send_tsk_mgmt(scmnd, SRP_TSK_ABORT_TASK); 1204 if (srp_find_req(target, scmnd, &req))
1205 return FAILED;
1206 if (srp_send_tsk_mgmt(target, req, SRP_TSK_ABORT_TASK))
1207 return FAILED;
1208
1209 spin_lock_irq(target->scsi_host->host_lock);
1210
1211 if (req->cmd_done) {
1212 srp_remove_req(target, req);
1213 scmnd->scsi_done(scmnd);
1214 } else if (!req->tsk_status) {
1215 srp_remove_req(target, req);
1216 scmnd->result = DID_ABORT << 16;
1217 } else
1218 ret = FAILED;
1219
1220 spin_unlock_irq(target->scsi_host->host_lock);
1221
1222 return ret;
1211} 1223}
1212 1224
1213static int srp_reset_device(struct scsi_cmnd *scmnd) 1225static int srp_reset_device(struct scsi_cmnd *scmnd)
1214{ 1226{
1227 struct srp_target_port *target = host_to_target(scmnd->device->host);
1228 struct srp_request *req, *tmp;
1229
1215 printk(KERN_ERR "SRP reset_device called\n"); 1230 printk(KERN_ERR "SRP reset_device called\n");
1216 1231
1217 return srp_send_tsk_mgmt(scmnd, SRP_TSK_LUN_RESET); 1232 if (srp_find_req(target, scmnd, &req))
1233 return FAILED;
1234 if (srp_send_tsk_mgmt(target, req, SRP_TSK_LUN_RESET))
1235 return FAILED;
1236 if (req->tsk_status)
1237 return FAILED;
1238
1239 spin_lock_irq(target->scsi_host->host_lock);
1240
1241 list_for_each_entry_safe(req, tmp, &target->req_queue, list)
1242 if (req->scmnd->device == scmnd->device) {
1243 req->scmnd->result = DID_RESET << 16;
1244 req->scmnd->scsi_done(req->scmnd);
1245 srp_remove_req(target, req);
1246 }
1247
1248 spin_unlock_irq(target->scsi_host->host_lock);
1249
1250 return SUCCESS;
1218} 1251}
1219 1252
1220static int srp_reset_host(struct scsi_cmnd *scmnd) 1253static int srp_reset_host(struct scsi_cmnd *scmnd)
@@ -1514,10 +1547,12 @@ static ssize_t srp_create_target(struct class_device *class_dev,
1514 1547
1515 INIT_WORK(&target->work, srp_reconnect_work, target); 1548 INIT_WORK(&target->work, srp_reconnect_work, target);
1516 1549
1517 for (i = 0; i < SRP_SQ_SIZE - 1; ++i) 1550 INIT_LIST_HEAD(&target->free_reqs);
1518 target->req_ring[i].next = i + 1;
1519 target->req_ring[SRP_SQ_SIZE - 1].next = -1;
1520 INIT_LIST_HEAD(&target->req_queue); 1551 INIT_LIST_HEAD(&target->req_queue);
1552 for (i = 0; i < SRP_SQ_SIZE; ++i) {
1553 target->req_ring[i].index = i;
1554 list_add_tail(&target->req_ring[i].list, &target->free_reqs);
1555 }
1521 1556
1522 ret = srp_parse_options(buf, target); 1557 ret = srp_parse_options(buf, target);
1523 if (ret) 1558 if (ret)
diff --git a/drivers/infiniband/ulp/srp/ib_srp.h b/drivers/infiniband/ulp/srp/ib_srp.h
index bd7f7c3115de..c5cd43aae860 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.h
+++ b/drivers/infiniband/ulp/srp/ib_srp.h
@@ -101,7 +101,7 @@ struct srp_request {
101 */ 101 */
102 struct scatterlist fake_sg; 102 struct scatterlist fake_sg;
103 struct completion done; 103 struct completion done;
104 short next; 104 short index;
105 u8 cmd_done; 105 u8 cmd_done;
106 u8 tsk_status; 106 u8 tsk_status;
107}; 107};
@@ -133,7 +133,7 @@ struct srp_target_port {
133 unsigned tx_tail; 133 unsigned tx_tail;
134 struct srp_iu *tx_ring[SRP_SQ_SIZE + 1]; 134 struct srp_iu *tx_ring[SRP_SQ_SIZE + 1];
135 135
136 int req_head; 136 struct list_head free_reqs;
137 struct list_head req_queue; 137 struct list_head req_queue;
138 struct srp_request req_ring[SRP_SQ_SIZE]; 138 struct srp_request req_ring[SRP_SQ_SIZE];
139 139
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
index a34e3d91d9ed..ba325f16d077 100644
--- a/drivers/input/evdev.c
+++ b/drivers/input/evdev.c
@@ -403,6 +403,27 @@ static long evdev_ioctl_handler(struct file *file, unsigned int cmd,
403 case EVIOCGID: 403 case EVIOCGID:
404 if (copy_to_user(p, &dev->id, sizeof(struct input_id))) 404 if (copy_to_user(p, &dev->id, sizeof(struct input_id)))
405 return -EFAULT; 405 return -EFAULT;
406 return 0;
407
408 case EVIOCGREP:
409 if (!test_bit(EV_REP, dev->evbit))
410 return -ENOSYS;
411 if (put_user(dev->rep[REP_DELAY], ip))
412 return -EFAULT;
413 if (put_user(dev->rep[REP_PERIOD], ip + 1))
414 return -EFAULT;
415 return 0;
416
417 case EVIOCSREP:
418 if (!test_bit(EV_REP, dev->evbit))
419 return -ENOSYS;
420 if (get_user(u, ip))
421 return -EFAULT;
422 if (get_user(v, ip + 1))
423 return -EFAULT;
424
425 input_event(dev, EV_REP, REP_DELAY, u);
426 input_event(dev, EV_REP, REP_PERIOD, v);
406 427
407 return 0; 428 return 0;
408 429
diff --git a/drivers/input/input.c b/drivers/input/input.c
index a935abeffffc..3038c268917d 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -155,6 +155,9 @@ void input_event(struct input_dev *dev, unsigned int type, unsigned int code, in
155 if (code > SND_MAX || !test_bit(code, dev->sndbit)) 155 if (code > SND_MAX || !test_bit(code, dev->sndbit))
156 return; 156 return;
157 157
158 if (!!test_bit(code, dev->snd) != !!value)
159 change_bit(code, dev->snd);
160
158 if (dev->event) dev->event(dev, type, code, value); 161 if (dev->event) dev->event(dev, type, code, value);
159 162
160 break; 163 break;
@@ -286,19 +289,19 @@ static struct input_device_id *input_match_device(struct input_device_id *id, st
286 for (; id->flags || id->driver_info; id++) { 289 for (; id->flags || id->driver_info; id++) {
287 290
288 if (id->flags & INPUT_DEVICE_ID_MATCH_BUS) 291 if (id->flags & INPUT_DEVICE_ID_MATCH_BUS)
289 if (id->id.bustype != dev->id.bustype) 292 if (id->bustype != dev->id.bustype)
290 continue; 293 continue;
291 294
292 if (id->flags & INPUT_DEVICE_ID_MATCH_VENDOR) 295 if (id->flags & INPUT_DEVICE_ID_MATCH_VENDOR)
293 if (id->id.vendor != dev->id.vendor) 296 if (id->vendor != dev->id.vendor)
294 continue; 297 continue;
295 298
296 if (id->flags & INPUT_DEVICE_ID_MATCH_PRODUCT) 299 if (id->flags & INPUT_DEVICE_ID_MATCH_PRODUCT)
297 if (id->id.product != dev->id.product) 300 if (id->product != dev->id.product)
298 continue; 301 continue;
299 302
300 if (id->flags & INPUT_DEVICE_ID_MATCH_VERSION) 303 if (id->flags & INPUT_DEVICE_ID_MATCH_VERSION)
301 if (id->id.version != dev->id.version) 304 if (id->version != dev->id.version)
302 continue; 305 continue;
303 306
304 MATCH_BIT(evbit, EV_MAX); 307 MATCH_BIT(evbit, EV_MAX);
diff --git a/drivers/input/joystick/sidewinder.c b/drivers/input/joystick/sidewinder.c
index 2b2ec1057dee..95c0de7964a0 100644
--- a/drivers/input/joystick/sidewinder.c
+++ b/drivers/input/joystick/sidewinder.c
@@ -589,7 +589,7 @@ static int sw_connect(struct gameport *gameport, struct gameport_driver *drv)
589 struct sw *sw; 589 struct sw *sw;
590 struct input_dev *input_dev; 590 struct input_dev *input_dev;
591 int i, j, k, l; 591 int i, j, k, l;
592 int err; 592 int err = 0;
593 unsigned char *buf = NULL; /* [SW_LENGTH] */ 593 unsigned char *buf = NULL; /* [SW_LENGTH] */
594 unsigned char *idbuf = NULL; /* [SW_LENGTH] */ 594 unsigned char *idbuf = NULL; /* [SW_LENGTH] */
595 unsigned char m = 1; 595 unsigned char m = 1;
@@ -776,7 +776,10 @@ static int sw_connect(struct gameport *gameport, struct gameport_driver *drv)
776 goto fail4; 776 goto fail4;
777 } 777 }
778 778
779 return 0; 779 out: kfree(buf);
780 kfree(idbuf);
781
782 return err;
780 783
781 fail4: input_free_device(sw->dev[i]); 784 fail4: input_free_device(sw->dev[i]);
782 fail3: while (--i >= 0) 785 fail3: while (--i >= 0)
@@ -784,9 +787,7 @@ static int sw_connect(struct gameport *gameport, struct gameport_driver *drv)
784 fail2: gameport_close(gameport); 787 fail2: gameport_close(gameport);
785 fail1: gameport_set_drvdata(gameport, NULL); 788 fail1: gameport_set_drvdata(gameport, NULL);
786 kfree(sw); 789 kfree(sw);
787 kfree(buf); 790 goto out;
788 kfree(idbuf);
789 return err;
790} 791}
791 792
792static void sw_disconnect(struct gameport *gameport) 793static void sw_disconnect(struct gameport *gameport)
diff --git a/drivers/input/keyboard/corgikbd.c b/drivers/input/keyboard/corgikbd.c
index 96c6bf77248a..1f0e720267d7 100644
--- a/drivers/input/keyboard/corgikbd.c
+++ b/drivers/input/keyboard/corgikbd.c
@@ -245,9 +245,9 @@ static void corgikbd_hinge_timer(unsigned long data)
245 if (hinge_count >= HINGE_STABLE_COUNT) { 245 if (hinge_count >= HINGE_STABLE_COUNT) {
246 spin_lock_irqsave(&corgikbd_data->lock, flags); 246 spin_lock_irqsave(&corgikbd_data->lock, flags);
247 247
248 input_report_switch(corgikbd_data->input, SW_0, ((sharpsl_hinge_state & CORGI_SCP_SWA) != 0)); 248 input_report_switch(corgikbd_data->input, SW_LID, ((sharpsl_hinge_state & CORGI_SCP_SWA) != 0));
249 input_report_switch(corgikbd_data->input, SW_1, ((sharpsl_hinge_state & CORGI_SCP_SWB) != 0)); 249 input_report_switch(corgikbd_data->input, SW_TABLET_MODE, ((sharpsl_hinge_state & CORGI_SCP_SWB) != 0));
250 input_report_switch(corgikbd_data->input, SW_2, (READ_GPIO_BIT(CORGI_GPIO_AK_INT) != 0)); 250 input_report_switch(corgikbd_data->input, SW_HEADPHONE_INSERT, (READ_GPIO_BIT(CORGI_GPIO_AK_INT) != 0));
251 input_sync(corgikbd_data->input); 251 input_sync(corgikbd_data->input);
252 252
253 spin_unlock_irqrestore(&corgikbd_data->lock, flags); 253 spin_unlock_irqrestore(&corgikbd_data->lock, flags);
@@ -340,9 +340,9 @@ static int __init corgikbd_probe(struct platform_device *pdev)
340 for (i = 0; i < ARRAY_SIZE(corgikbd_keycode); i++) 340 for (i = 0; i < ARRAY_SIZE(corgikbd_keycode); i++)
341 set_bit(corgikbd->keycode[i], input_dev->keybit); 341 set_bit(corgikbd->keycode[i], input_dev->keybit);
342 clear_bit(0, input_dev->keybit); 342 clear_bit(0, input_dev->keybit);
343 set_bit(SW_0, input_dev->swbit); 343 set_bit(SW_LID, input_dev->swbit);
344 set_bit(SW_1, input_dev->swbit); 344 set_bit(SW_TABLET_MODE, input_dev->swbit);
345 set_bit(SW_2, input_dev->swbit); 345 set_bit(SW_HEADPHONE_INSERT, input_dev->swbit);
346 346
347 input_register_device(corgikbd->input); 347 input_register_device(corgikbd->input);
348 348
diff --git a/drivers/input/keyboard/hil_kbd.c b/drivers/input/keyboard/hil_kbd.c
index 1dca3cf42a54..2e4abdc26367 100644
--- a/drivers/input/keyboard/hil_kbd.c
+++ b/drivers/input/keyboard/hil_kbd.c
@@ -350,11 +350,11 @@ static int hil_kbd_connect(struct serio *serio, struct serio_driver *drv)
350 return 0; 350 return 0;
351 bail2: 351 bail2:
352 serio_close(serio); 352 serio_close(serio);
353 serio_set_drvdata(serio, NULL);
353 bail1: 354 bail1:
354 input_free_device(kbd->dev); 355 input_free_device(kbd->dev);
355 bail0: 356 bail0:
356 kfree(kbd); 357 kfree(kbd);
357 serio_set_drvdata(serio, NULL);
358 return -EIO; 358 return -EIO;
359} 359}
360 360
diff --git a/drivers/input/keyboard/spitzkbd.c b/drivers/input/keyboard/spitzkbd.c
index bc61cf8cfc65..c5d03fb77bcb 100644
--- a/drivers/input/keyboard/spitzkbd.c
+++ b/drivers/input/keyboard/spitzkbd.c
@@ -53,8 +53,8 @@ static unsigned char spitzkbd_keycode[NR_SCANCODES] = {
53 KEY_LEFTCTRL, KEY_1, KEY_3, KEY_5, KEY_6, KEY_7, KEY_9, KEY_0, KEY_BACKSPACE, SPITZ_KEY_EXOK, SPITZ_KEY_EXCANCEL, 0, 0, 0, 0, 0, /* 1-16 */ 53 KEY_LEFTCTRL, KEY_1, KEY_3, KEY_5, KEY_6, KEY_7, KEY_9, KEY_0, KEY_BACKSPACE, SPITZ_KEY_EXOK, SPITZ_KEY_EXCANCEL, 0, 0, 0, 0, 0, /* 1-16 */
54 0, KEY_2, KEY_4, KEY_R, KEY_Y, KEY_8, KEY_I, KEY_O, KEY_P, SPITZ_KEY_EXJOGDOWN, SPITZ_KEY_EXJOGUP, 0, 0, 0, 0, 0, /* 17-32 */ 54 0, KEY_2, KEY_4, KEY_R, KEY_Y, KEY_8, KEY_I, KEY_O, KEY_P, SPITZ_KEY_EXJOGDOWN, SPITZ_KEY_EXJOGUP, 0, 0, 0, 0, 0, /* 17-32 */
55 KEY_TAB, KEY_Q, KEY_E, KEY_T, KEY_G, KEY_U, KEY_J, KEY_K, 0, 0, 0, 0, 0, 0, 0, 0, /* 33-48 */ 55 KEY_TAB, KEY_Q, KEY_E, KEY_T, KEY_G, KEY_U, KEY_J, KEY_K, 0, 0, 0, 0, 0, 0, 0, 0, /* 33-48 */
56 SPITZ_KEY_CALENDER, KEY_W, KEY_S, KEY_F, KEY_V, KEY_H, KEY_M, KEY_L, 0, KEY_RIGHTSHIFT, 0, 0, 0, 0, 0, 0, /* 49-64 */ 56 SPITZ_KEY_ADDRESS, KEY_W, KEY_S, KEY_F, KEY_V, KEY_H, KEY_M, KEY_L, 0, KEY_RIGHTSHIFT, 0, 0, 0, 0, 0, 0, /* 49-64 */
57 SPITZ_KEY_ADDRESS, KEY_A, KEY_D, KEY_C, KEY_B, KEY_N, KEY_DOT, 0, KEY_ENTER, KEY_LEFTSHIFT, 0, 0, 0, 0, 0, 0, /* 65-80 */ 57 SPITZ_KEY_CALENDER, KEY_A, KEY_D, KEY_C, KEY_B, KEY_N, KEY_DOT, 0, KEY_ENTER, KEY_LEFTSHIFT, 0, 0, 0, 0, 0, 0, /* 65-80 */
58 SPITZ_KEY_MAIL, KEY_Z, KEY_X, KEY_MINUS, KEY_SPACE, KEY_COMMA, 0, KEY_UP, 0, 0, SPITZ_KEY_FN, 0, 0, 0, 0, 0, /* 81-96 */ 58 SPITZ_KEY_MAIL, KEY_Z, KEY_X, KEY_MINUS, KEY_SPACE, KEY_COMMA, 0, KEY_UP, 0, 0, SPITZ_KEY_FN, 0, 0, 0, 0, 0, /* 81-96 */
59 KEY_SYSRQ, SPITZ_KEY_JAP1, SPITZ_KEY_JAP2, SPITZ_KEY_CANCEL, SPITZ_KEY_OK, SPITZ_KEY_MENU, KEY_LEFT, KEY_DOWN, KEY_RIGHT, 0, 0, 0, 0, 0, 0, 0 /* 97-112 */ 59 KEY_SYSRQ, SPITZ_KEY_JAP1, SPITZ_KEY_JAP2, SPITZ_KEY_CANCEL, SPITZ_KEY_OK, SPITZ_KEY_MENU, KEY_LEFT, KEY_DOWN, KEY_RIGHT, 0, 0, 0, 0, 0, 0, 0 /* 97-112 */
60}; 60};
@@ -299,9 +299,9 @@ static void spitzkbd_hinge_timer(unsigned long data)
299 if (hinge_count >= HINGE_STABLE_COUNT) { 299 if (hinge_count >= HINGE_STABLE_COUNT) {
300 spin_lock_irqsave(&spitzkbd_data->lock, flags); 300 spin_lock_irqsave(&spitzkbd_data->lock, flags);
301 301
302 input_report_switch(spitzkbd_data->input, SW_0, ((GPLR(SPITZ_GPIO_SWA) & GPIO_bit(SPITZ_GPIO_SWA)) != 0)); 302 input_report_switch(spitzkbd_data->input, SW_LID, ((GPLR(SPITZ_GPIO_SWA) & GPIO_bit(SPITZ_GPIO_SWA)) != 0));
303 input_report_switch(spitzkbd_data->input, SW_1, ((GPLR(SPITZ_GPIO_SWB) & GPIO_bit(SPITZ_GPIO_SWB)) != 0)); 303 input_report_switch(spitzkbd_data->input, SW_TABLET_MODE, ((GPLR(SPITZ_GPIO_SWB) & GPIO_bit(SPITZ_GPIO_SWB)) != 0));
304 input_report_switch(spitzkbd_data->input, SW_2, ((GPLR(SPITZ_GPIO_AK_INT) & GPIO_bit(SPITZ_GPIO_AK_INT)) != 0)); 304 input_report_switch(spitzkbd_data->input, SW_HEADPHONE_INSERT, ((GPLR(SPITZ_GPIO_AK_INT) & GPIO_bit(SPITZ_GPIO_AK_INT)) != 0));
305 input_sync(spitzkbd_data->input); 305 input_sync(spitzkbd_data->input);
306 306
307 spin_unlock_irqrestore(&spitzkbd_data->lock, flags); 307 spin_unlock_irqrestore(&spitzkbd_data->lock, flags);
@@ -398,9 +398,9 @@ static int __init spitzkbd_probe(struct platform_device *dev)
398 for (i = 0; i < ARRAY_SIZE(spitzkbd_keycode); i++) 398 for (i = 0; i < ARRAY_SIZE(spitzkbd_keycode); i++)
399 set_bit(spitzkbd->keycode[i], input_dev->keybit); 399 set_bit(spitzkbd->keycode[i], input_dev->keybit);
400 clear_bit(0, input_dev->keybit); 400 clear_bit(0, input_dev->keybit);
401 set_bit(SW_0, input_dev->swbit); 401 set_bit(SW_LID, input_dev->swbit);
402 set_bit(SW_1, input_dev->swbit); 402 set_bit(SW_TABLET_MODE, input_dev->swbit);
403 set_bit(SW_2, input_dev->swbit); 403 set_bit(SW_HEADPHONE_INSERT, input_dev->swbit);
404 404
405 input_register_device(input_dev); 405 input_register_device(input_dev);
406 406
diff --git a/drivers/input/misc/wistron_btns.c b/drivers/input/misc/wistron_btns.c
index 4b415d9b0123..e4e5be111c96 100644
--- a/drivers/input/misc/wistron_btns.c
+++ b/drivers/input/misc/wistron_btns.c
@@ -273,6 +273,18 @@ static struct key_entry keymap_fs_amilo_pro_v2000[] = {
273 { KE_END, 0 } 273 { KE_END, 0 }
274}; 274};
275 275
276static struct key_entry keymap_fujitsu_n3510[] = {
277 { KE_KEY, 0x11, KEY_PROG1 },
278 { KE_KEY, 0x12, KEY_PROG2 },
279 { KE_KEY, 0x36, KEY_WWW },
280 { KE_KEY, 0x31, KEY_MAIL },
281 { KE_KEY, 0x71, KEY_STOPCD },
282 { KE_KEY, 0x72, KEY_PLAYPAUSE },
283 { KE_KEY, 0x74, KEY_REWIND },
284 { KE_KEY, 0x78, KEY_FORWARD },
285 { KE_END, 0 }
286};
287
276static struct key_entry keymap_wistron_ms2141[] = { 288static struct key_entry keymap_wistron_ms2141[] = {
277 { KE_KEY, 0x11, KEY_PROG1 }, 289 { KE_KEY, 0x11, KEY_PROG1 },
278 { KE_KEY, 0x12, KEY_PROG2 }, 290 { KE_KEY, 0x12, KEY_PROG2 },
@@ -306,6 +318,16 @@ static struct key_entry keymap_acer_travelmate_240[] = {
306 { KE_END, 0 } 318 { KE_END, 0 }
307}; 319};
308 320
321static struct key_entry keymap_aopen_1559as[] = {
322 { KE_KEY, 0x01, KEY_HELP },
323 { KE_KEY, 0x06, KEY_PROG3 },
324 { KE_KEY, 0x11, KEY_PROG1 },
325 { KE_KEY, 0x12, KEY_PROG2 },
326 { KE_WIFI, 0x30, 0 },
327 { KE_KEY, 0x31, KEY_MAIL },
328 { KE_KEY, 0x36, KEY_WWW },
329};
330
309/* 331/*
310 * If your machine is not here (which is currently rather likely), please send 332 * If your machine is not here (which is currently rather likely), please send
311 * a list of buttons and their key codes (reported when loading this module 333 * a list of buttons and their key codes (reported when loading this module
@@ -323,6 +345,24 @@ static struct dmi_system_id dmi_ids[] = {
323 }, 345 },
324 { 346 {
325 .callback = dmi_matched, 347 .callback = dmi_matched,
348 .ident = "Fujitsu-Siemens Amilo M7400",
349 .matches = {
350 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
351 DMI_MATCH(DMI_PRODUCT_NAME, "AMILO M "),
352 },
353 .driver_data = keymap_fs_amilo_pro_v2000
354 },
355 {
356 .callback = dmi_matched,
357 .ident = "Fujitsu N3510",
358 .matches = {
359 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
360 DMI_MATCH(DMI_PRODUCT_NAME, "N3510"),
361 },
362 .driver_data = keymap_fujitsu_n3510
363 },
364 {
365 .callback = dmi_matched,
326 .ident = "Acer Aspire 1500", 366 .ident = "Acer Aspire 1500",
327 .matches = { 367 .matches = {
328 DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 368 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
@@ -339,6 +379,15 @@ static struct dmi_system_id dmi_ids[] = {
339 }, 379 },
340 .driver_data = keymap_acer_travelmate_240 380 .driver_data = keymap_acer_travelmate_240
341 }, 381 },
382 {
383 .callback = dmi_matched,
384 .ident = "AOpen 1559AS",
385 .matches = {
386 DMI_MATCH(DMI_PRODUCT_NAME, "E2U"),
387 DMI_MATCH(DMI_BOARD_NAME, "E2U"),
388 },
389 .driver_data = keymap_aopen_1559as
390 },
342 { NULL, } 391 { NULL, }
343}; 392};
344 393
diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
index 2141501e9f2e..a0e2e797c6d5 100644
--- a/drivers/input/mouse/alps.c
+++ b/drivers/input/mouse/alps.c
@@ -100,8 +100,8 @@ static void alps_process_packet(struct psmouse *psmouse, struct pt_regs *regs)
100 } 100 }
101 101
102 if (priv->i->flags & ALPS_OLDPROTO) { 102 if (priv->i->flags & ALPS_OLDPROTO) {
103 left = packet[2] & 0x08; 103 left = packet[2] & 0x10;
104 right = packet[2] & 0x10; 104 right = packet[2] & 0x08;
105 middle = 0; 105 middle = 0;
106 x = packet[1] | ((packet[0] & 0x07) << 7); 106 x = packet[1] | ((packet[0] & 0x07) << 7);
107 y = packet[4] | ((packet[3] & 0x07) << 7); 107 y = packet[4] | ((packet[3] & 0x07) << 7);
diff --git a/drivers/input/mouse/lifebook.c b/drivers/input/mouse/lifebook.c
index 5ccc3ef3b89e..c14395ba7980 100644
--- a/drivers/input/mouse/lifebook.c
+++ b/drivers/input/mouse/lifebook.c
@@ -22,12 +22,36 @@
22 22
23static struct dmi_system_id lifebook_dmi_table[] = { 23static struct dmi_system_id lifebook_dmi_table[] = {
24 { 24 {
25 .ident = "LifeBook B",
26 .matches = {
27 DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook B Series"),
28 },
29 },
30 {
25 .ident = "Lifebook B", 31 .ident = "Lifebook B",
26 .matches = { 32 .matches = {
27 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK B Series"), 33 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK B Series"),
28 }, 34 },
29 }, 35 },
30 { 36 {
37 .ident = "Lifebook B213x/B2150",
38 .matches = {
39 DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook B2131/B2133/B2150"),
40 },
41 },
42 {
43 .ident = "Zephyr",
44 .matches = {
45 DMI_MATCH(DMI_PRODUCT_NAME, "ZEPHYR"),
46 },
47 },
48 {
49 .ident = "CF-18",
50 .matches = {
51 DMI_MATCH(DMI_PRODUCT_NAME, "CF-18"),
52 },
53 },
54 {
31 .ident = "Lifebook B142", 55 .ident = "Lifebook B142",
32 .matches = { 56 .matches = {
33 DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook B142"), 57 DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook B142"),
diff --git a/drivers/input/mouse/logips2pp.c b/drivers/input/mouse/logips2pp.c
index 40333d61093c..2f0d28840810 100644
--- a/drivers/input/mouse/logips2pp.c
+++ b/drivers/input/mouse/logips2pp.c
@@ -19,6 +19,7 @@
19#define PS2PP_KIND_WHEEL 1 19#define PS2PP_KIND_WHEEL 1
20#define PS2PP_KIND_MX 2 20#define PS2PP_KIND_MX 2
21#define PS2PP_KIND_TP3 3 21#define PS2PP_KIND_TP3 3
22#define PS2PP_KIND_TRACKMAN 4
22 23
23/* Logitech mouse features */ 24/* Logitech mouse features */
24#define PS2PP_WHEEL 0x01 25#define PS2PP_WHEEL 0x01
@@ -223,6 +224,7 @@ static struct ps2pp_info *get_model_info(unsigned char model)
223 { 73, 0, PS2PP_SIDE_BTN }, 224 { 73, 0, PS2PP_SIDE_BTN },
224 { 75, PS2PP_KIND_WHEEL, PS2PP_WHEEL }, 225 { 75, PS2PP_KIND_WHEEL, PS2PP_WHEEL },
225 { 76, PS2PP_KIND_WHEEL, PS2PP_WHEEL }, 226 { 76, PS2PP_KIND_WHEEL, PS2PP_WHEEL },
227 { 79, PS2PP_KIND_TRACKMAN, PS2PP_WHEEL }, /* TrackMan with wheel */
226 { 80, PS2PP_KIND_WHEEL, PS2PP_SIDE_BTN | PS2PP_WHEEL }, 228 { 80, PS2PP_KIND_WHEEL, PS2PP_SIDE_BTN | PS2PP_WHEEL },
227 { 81, PS2PP_KIND_WHEEL, PS2PP_WHEEL }, 229 { 81, PS2PP_KIND_WHEEL, PS2PP_WHEEL },
228 { 83, PS2PP_KIND_WHEEL, PS2PP_WHEEL }, 230 { 83, PS2PP_KIND_WHEEL, PS2PP_WHEEL },
@@ -298,6 +300,10 @@ static void ps2pp_set_model_properties(struct psmouse *psmouse, struct ps2pp_inf
298 psmouse->name = "TouchPad 3"; 300 psmouse->name = "TouchPad 3";
299 break; 301 break;
300 302
303 case PS2PP_KIND_TRACKMAN:
304 psmouse->name = "TrackMan";
305 break;
306
301 default: 307 default:
302 /* 308 /*
303 * Set name to "Mouse" only when using PS2++, 309 * Set name to "Mouse" only when using PS2++,
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c
index 32d70ed8f41d..136321a2cfdb 100644
--- a/drivers/input/mouse/psmouse-base.c
+++ b/drivers/input/mouse/psmouse-base.c
@@ -302,8 +302,10 @@ static irqreturn_t psmouse_interrupt(struct serio *serio,
302 * Check if this is a new device announcement (0xAA 0x00) 302 * Check if this is a new device announcement (0xAA 0x00)
303 */ 303 */
304 if (unlikely(psmouse->packet[0] == PSMOUSE_RET_BAT && psmouse->pktcnt <= 2)) { 304 if (unlikely(psmouse->packet[0] == PSMOUSE_RET_BAT && psmouse->pktcnt <= 2)) {
305 if (psmouse->pktcnt == 1) 305 if (psmouse->pktcnt == 1) {
306 psmouse->last = jiffies;
306 goto out; 307 goto out;
308 }
307 309
308 if (psmouse->packet[1] == PSMOUSE_RET_ID) { 310 if (psmouse->packet[1] == PSMOUSE_RET_ID) {
309 __psmouse_set_state(psmouse, PSMOUSE_IGNORE); 311 __psmouse_set_state(psmouse, PSMOUSE_IGNORE);
diff --git a/drivers/input/serio/i8042-io.h b/drivers/input/serio/i8042-io.h
index 9a9221644250..cc21914fbc72 100644
--- a/drivers/input/serio/i8042-io.h
+++ b/drivers/input/serio/i8042-io.h
@@ -67,14 +67,14 @@ static inline int i8042_platform_init(void)
67 * On some platforms touching the i8042 data register region can do really 67 * On some platforms touching the i8042 data register region can do really
68 * bad things. Because of this the region is always reserved on such boxes. 68 * bad things. Because of this the region is always reserved on such boxes.
69 */ 69 */
70#if !defined(__sh__) && !defined(__alpha__) && !defined(__mips__) && !defined(CONFIG_PPC64) 70#if !defined(__sh__) && !defined(__alpha__) && !defined(__mips__) && !defined(CONFIG_PPC_MERGE)
71 if (!request_region(I8042_DATA_REG, 16, "i8042")) 71 if (!request_region(I8042_DATA_REG, 16, "i8042"))
72 return -EBUSY; 72 return -EBUSY;
73#endif 73#endif
74 74
75 i8042_reset = 1; 75 i8042_reset = 1;
76 76
77#if defined(CONFIG_PPC64) 77#if defined(CONFIG_PPC_MERGE)
78 if (check_legacy_ioport(I8042_DATA_REG)) 78 if (check_legacy_ioport(I8042_DATA_REG))
79 return -EBUSY; 79 return -EBUSY;
80 if (!request_region(I8042_DATA_REG, 16, "i8042")) 80 if (!request_region(I8042_DATA_REG, 16, "i8042"))
diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
index 46d1fec2cfd8..161afddd0f44 100644
--- a/drivers/input/touchscreen/ads7846.c
+++ b/drivers/input/touchscreen/ads7846.c
@@ -2,6 +2,8 @@
2 * ADS7846 based touchscreen and sensor driver 2 * ADS7846 based touchscreen and sensor driver
3 * 3 *
4 * Copyright (c) 2005 David Brownell 4 * Copyright (c) 2005 David Brownell
5 * Copyright (c) 2006 Nokia Corporation
6 * Various changes: Imre Deak <imre.deak@nokia.com>
5 * 7 *
6 * Using code from: 8 * Using code from:
7 * - corgi_ts.c 9 * - corgi_ts.c
@@ -34,17 +36,22 @@
34 36
35 37
36/* 38/*
37 * This code has been lightly tested on an ads7846. 39 * This code has been heavily tested on a Nokia 770, and lightly
40 * tested on other ads7846 devices (OSK/Mistral, Lubbock).
38 * Support for ads7843 and ads7845 has only been stubbed in. 41 * Support for ads7843 and ads7845 has only been stubbed in.
39 * 42 *
40 * Not yet done: investigate the values reported. Are x/y/pressure 43 * IRQ handling needs a workaround because of a shortcoming in handling
41 * event values sane enough for X11? How accurate are the temperature 44 * edge triggered IRQs on some platforms like the OMAP1/2. These
42 * and voltage readings? (System-specific calibration should support 45 * platforms don't handle the ARM lazy IRQ disabling properly, thus we
43 * accuracy of 0.3 degrees C; otherwise it's 2.0 degrees.) 46 * have to maintain our own SW IRQ disabled status. This should be
47 * removed as soon as the affected platform's IRQ handling is fixed.
44 * 48 *
45 * app note sbaa036 talks in more detail about accurate sampling... 49 * app note sbaa036 talks in more detail about accurate sampling...
46 * that ought to help in situations like LCDs inducing noise (which 50 * that ought to help in situations like LCDs inducing noise (which
47 * can also be helped by using synch signals) and more generally. 51 * can also be helped by using synch signals) and more generally.
52 * This driver tries to utilize the measures described in the app
53 * note. The strength of filtering can be set in the board-* specific
54 * files.
48 */ 55 */
49 56
50#define TS_POLL_PERIOD msecs_to_jiffies(10) 57#define TS_POLL_PERIOD msecs_to_jiffies(10)
@@ -61,6 +68,7 @@ struct ts_event {
61 __be16 x; 68 __be16 x;
62 __be16 y; 69 __be16 y;
63 __be16 z1, z2; 70 __be16 z1, z2;
71 int ignore;
64}; 72};
65 73
66struct ads7846 { 74struct ads7846 {
@@ -71,12 +79,23 @@ struct ads7846 {
71 u16 model; 79 u16 model;
72 u16 vref_delay_usecs; 80 u16 vref_delay_usecs;
73 u16 x_plate_ohms; 81 u16 x_plate_ohms;
82 u16 pressure_max;
74 83
75 u8 read_x, read_y, read_z1, read_z2; 84 u8 read_x, read_y, read_z1, read_z2, pwrdown;
85 u16 dummy; /* for the pwrdown read */
76 struct ts_event tc; 86 struct ts_event tc;
77 87
78 struct spi_transfer xfer[8]; 88 struct spi_transfer xfer[10];
79 struct spi_message msg; 89 struct spi_message msg[5];
90 struct spi_message *last_msg;
91 int msg_idx;
92 int read_cnt;
93 int read_rep;
94 int last_read;
95
96 u16 debounce_max;
97 u16 debounce_tol;
98 u16 debounce_rep;
80 99
81 spinlock_t lock; 100 spinlock_t lock;
82 struct timer_list timer; /* P: lock */ 101 struct timer_list timer; /* P: lock */
@@ -84,6 +103,9 @@ struct ads7846 {
84 unsigned pending:1; /* P: lock */ 103 unsigned pending:1; /* P: lock */
85// FIXME remove "irq_disabled" 104// FIXME remove "irq_disabled"
86 unsigned irq_disabled:1; /* P: lock */ 105 unsigned irq_disabled:1; /* P: lock */
106 unsigned disabled:1;
107
108 int (*get_pendown_state)(void);
87}; 109};
88 110
89/* leave chip selected when we're done, for quicker re-select? */ 111/* leave chip selected when we're done, for quicker re-select? */
@@ -125,7 +147,9 @@ struct ads7846 {
125#define READ_Y (READ_12BIT_DFR(y) | ADS_PD10_ADC_ON) 147#define READ_Y (READ_12BIT_DFR(y) | ADS_PD10_ADC_ON)
126#define READ_Z1 (READ_12BIT_DFR(z1) | ADS_PD10_ADC_ON) 148#define READ_Z1 (READ_12BIT_DFR(z1) | ADS_PD10_ADC_ON)
127#define READ_Z2 (READ_12BIT_DFR(z2) | ADS_PD10_ADC_ON) 149#define READ_Z2 (READ_12BIT_DFR(z2) | ADS_PD10_ADC_ON)
128#define READ_X (READ_12BIT_DFR(x) | ADS_PD10_PDOWN) /* LAST */ 150
151#define READ_X (READ_12BIT_DFR(x) | ADS_PD10_ADC_ON)
152#define PWRDOWN (READ_12BIT_DFR(y) | ADS_PD10_PDOWN) /* LAST */
129 153
130/* single-ended samples need to first power up reference voltage; 154/* single-ended samples need to first power up reference voltage;
131 * we leave both ADC and VREF powered 155 * we leave both ADC and VREF powered
@@ -152,6 +176,15 @@ struct ser_req {
152 struct spi_transfer xfer[6]; 176 struct spi_transfer xfer[6];
153}; 177};
154 178
179static void ads7846_enable(struct ads7846 *ts);
180static void ads7846_disable(struct ads7846 *ts);
181
182static int device_suspended(struct device *dev)
183{
184 struct ads7846 *ts = dev_get_drvdata(dev);
185 return dev->power.power_state.event != PM_EVENT_ON || ts->disabled;
186}
187
155static int ads7846_read12_ser(struct device *dev, unsigned command) 188static int ads7846_read12_ser(struct device *dev, unsigned command)
156{ 189{
157 struct spi_device *spi = to_spi_device(dev); 190 struct spi_device *spi = to_spi_device(dev);
@@ -164,7 +197,7 @@ static int ads7846_read12_ser(struct device *dev, unsigned command)
164 if (!req) 197 if (!req)
165 return -ENOMEM; 198 return -ENOMEM;
166 199
167 INIT_LIST_HEAD(&req->msg.transfers); 200 spi_message_init(&req->msg);
168 201
169 /* activate reference, so it has time to settle; */ 202 /* activate reference, so it has time to settle; */
170 req->ref_on = REF_ON; 203 req->ref_on = REF_ON;
@@ -204,16 +237,21 @@ static int ads7846_read12_ser(struct device *dev, unsigned command)
204 for (i = 0; i < 6; i++) 237 for (i = 0; i < 6; i++)
205 spi_message_add_tail(&req->xfer[i], &req->msg); 238 spi_message_add_tail(&req->xfer[i], &req->msg);
206 239
240 ts->irq_disabled = 1;
207 disable_irq(spi->irq); 241 disable_irq(spi->irq);
208 status = spi_sync(spi, &req->msg); 242 status = spi_sync(spi, &req->msg);
243 ts->irq_disabled = 0;
209 enable_irq(spi->irq); 244 enable_irq(spi->irq);
210 245
211 if (req->msg.status) 246 if (req->msg.status)
212 status = req->msg.status; 247 status = req->msg.status;
248
249 /* on-wire is a must-ignore bit, a BE12 value, then padding */
213 sample = be16_to_cpu(req->sample); 250 sample = be16_to_cpu(req->sample);
214 sample = sample >> 4; 251 sample = sample >> 3;
215 kfree(req); 252 sample &= 0x0fff;
216 253
254 kfree(req);
217 return status ? status : sample; 255 return status ? status : sample;
218} 256}
219 257
@@ -233,6 +271,52 @@ SHOW(temp1)
233SHOW(vaux) 271SHOW(vaux)
234SHOW(vbatt) 272SHOW(vbatt)
235 273
274static int is_pen_down(struct device *dev)
275{
276 struct ads7846 *ts = dev_get_drvdata(dev);
277
278 return ts->pendown;
279}
280
281static ssize_t ads7846_pen_down_show(struct device *dev,
282 struct device_attribute *attr, char *buf)
283{
284 return sprintf(buf, "%u\n", is_pen_down(dev));
285}
286
287static DEVICE_ATTR(pen_down, S_IRUGO, ads7846_pen_down_show, NULL);
288
289static ssize_t ads7846_disable_show(struct device *dev,
290 struct device_attribute *attr, char *buf)
291{
292 struct ads7846 *ts = dev_get_drvdata(dev);
293
294 return sprintf(buf, "%u\n", ts->disabled);
295}
296
297static ssize_t ads7846_disable_store(struct device *dev,
298 struct device_attribute *attr,
299 const char *buf, size_t count)
300{
301 struct ads7846 *ts = dev_get_drvdata(dev);
302 char *endp;
303 int i;
304
305 i = simple_strtoul(buf, &endp, 10);
306 spin_lock_irq(&ts->lock);
307
308 if (i)
309 ads7846_disable(ts);
310 else
311 ads7846_enable(ts);
312
313 spin_unlock_irq(&ts->lock);
314
315 return count;
316}
317
318static DEVICE_ATTR(disable, 0664, ads7846_disable_show, ads7846_disable_store);
319
236/*--------------------------------------------------------------------------*/ 320/*--------------------------------------------------------------------------*/
237 321
238/* 322/*
@@ -252,19 +336,19 @@ static void ads7846_rx(void *ads)
252 u16 x, y, z1, z2; 336 u16 x, y, z1, z2;
253 unsigned long flags; 337 unsigned long flags;
254 338
255 /* adjust: 12 bit samples (left aligned), built from 339 /* adjust: on-wire is a must-ignore bit, a BE12 value, then padding;
256 * two 8 bit values writen msb-first. 340 * built from two 8 bit values written msb-first.
257 */ 341 */
258 x = be16_to_cpu(ts->tc.x) >> 4; 342 x = (be16_to_cpu(ts->tc.x) >> 3) & 0x0fff;
259 y = be16_to_cpu(ts->tc.y) >> 4; 343 y = (be16_to_cpu(ts->tc.y) >> 3) & 0x0fff;
260 z1 = be16_to_cpu(ts->tc.z1) >> 4; 344 z1 = (be16_to_cpu(ts->tc.z1) >> 3) & 0x0fff;
261 z2 = be16_to_cpu(ts->tc.z2) >> 4; 345 z2 = (be16_to_cpu(ts->tc.z2) >> 3) & 0x0fff;
262 346
263 /* range filtering */ 347 /* range filtering */
264 if (x == MAX_12BIT) 348 if (x == MAX_12BIT)
265 x = 0; 349 x = 0;
266 350
267 if (x && z1 && ts->spi->dev.power.power_state.event == PM_EVENT_ON) { 351 if (likely(x && z1 && !device_suspended(&ts->spi->dev))) {
268 /* compute touch pressure resistance using equation #2 */ 352 /* compute touch pressure resistance using equation #2 */
269 Rt = z2; 353 Rt = z2;
270 Rt -= z1; 354 Rt -= z1;
@@ -275,6 +359,14 @@ static void ads7846_rx(void *ads)
275 } else 359 } else
276 Rt = 0; 360 Rt = 0;
277 361
362 /* Sample found inconsistent by debouncing or pressure is beyond
363 * the maximum. Don't report it to user space, repeat at least
364 * once more the measurement */
365 if (ts->tc.ignore || Rt > ts->pressure_max) {
366 mod_timer(&ts->timer, jiffies + TS_POLL_PERIOD);
367 return;
368 }
369
278 /* NOTE: "pendown" is inferred from pressure; we don't rely on 370 /* NOTE: "pendown" is inferred from pressure; we don't rely on
279 * being able to check nPENIRQ status, or "friendly" trigger modes 371 * being able to check nPENIRQ status, or "friendly" trigger modes
280 * (both-edges is much better than just-falling or low-level). 372 * (both-edges is much better than just-falling or low-level).
@@ -296,11 +388,13 @@ static void ads7846_rx(void *ads)
296 if (Rt) { 388 if (Rt) {
297 input_report_abs(input_dev, ABS_X, x); 389 input_report_abs(input_dev, ABS_X, x);
298 input_report_abs(input_dev, ABS_Y, y); 390 input_report_abs(input_dev, ABS_Y, y);
299 input_report_abs(input_dev, ABS_PRESSURE, Rt);
300 sync = 1; 391 sync = 1;
301 } 392 }
302 if (sync) 393
394 if (sync) {
395 input_report_abs(input_dev, ABS_PRESSURE, Rt);
303 input_sync(input_dev); 396 input_sync(input_dev);
397 }
304 398
305#ifdef VERBOSE 399#ifdef VERBOSE
306 if (Rt || ts->pendown) 400 if (Rt || ts->pendown)
@@ -308,80 +402,137 @@ static void ads7846_rx(void *ads)
308 x, y, Rt, Rt ? "" : " UP"); 402 x, y, Rt, Rt ? "" : " UP");
309#endif 403#endif
310 404
311 /* don't retrigger while we're suspended */
312 spin_lock_irqsave(&ts->lock, flags); 405 spin_lock_irqsave(&ts->lock, flags);
313 406
314 ts->pendown = (Rt != 0); 407 ts->pendown = (Rt != 0);
315 ts->pending = 0; 408 mod_timer(&ts->timer, jiffies + TS_POLL_PERIOD);
316 409
317 if (ts->spi->dev.power.power_state.event == PM_EVENT_ON) { 410 spin_unlock_irqrestore(&ts->lock, flags);
318 if (ts->pendown) 411}
319 mod_timer(&ts->timer, jiffies + TS_POLL_PERIOD); 412
320 else if (ts->irq_disabled) { 413static void ads7846_debounce(void *ads)
321 ts->irq_disabled = 0; 414{
322 enable_irq(ts->spi->irq); 415 struct ads7846 *ts = ads;
416 struct spi_message *m;
417 struct spi_transfer *t;
418 int val;
419 int status;
420
421 m = &ts->msg[ts->msg_idx];
422 t = list_entry(m->transfers.prev, struct spi_transfer, transfer_list);
423 val = (be16_to_cpu(*(__be16 *)t->rx_buf) >> 3) & 0x0fff;
424 if (!ts->read_cnt || (abs(ts->last_read - val) > ts->debounce_tol)) {
425 /* Repeat it, if this was the first read or the read
426 * wasn't consistent enough. */
427 if (ts->read_cnt < ts->debounce_max) {
428 ts->last_read = val;
429 ts->read_cnt++;
430 } else {
431 /* Maximum number of debouncing reached and still
432 * not enough number of consistent readings. Abort
433 * the whole sample, repeat it in the next sampling
434 * period.
435 */
436 ts->tc.ignore = 1;
437 ts->read_cnt = 0;
438 /* Last message will contain ads7846_rx() as the
439 * completion function.
440 */
441 m = ts->last_msg;
323 } 442 }
443 /* Start over collecting consistent readings. */
444 ts->read_rep = 0;
445 } else {
446 if (++ts->read_rep > ts->debounce_rep) {
447 /* Got a good reading for this coordinate,
448 * go for the next one. */
449 ts->tc.ignore = 0;
450 ts->msg_idx++;
451 ts->read_cnt = 0;
452 ts->read_rep = 0;
453 m++;
454 } else
455 /* Read more values that are consistent. */
456 ts->read_cnt++;
324 } 457 }
325 458 status = spi_async(ts->spi, m);
326 spin_unlock_irqrestore(&ts->lock, flags); 459 if (status)
460 dev_err(&ts->spi->dev, "spi_async --> %d\n",
461 status);
327} 462}
328 463
329static void ads7846_timer(unsigned long handle) 464static void ads7846_timer(unsigned long handle)
330{ 465{
331 struct ads7846 *ts = (void *)handle; 466 struct ads7846 *ts = (void *)handle;
332 int status = 0; 467 int status = 0;
333 unsigned long flags; 468
469 spin_lock_irq(&ts->lock);
470
471 if (unlikely(ts->msg_idx && !ts->pendown)) {
472 /* measurement cycle ended */
473 if (!device_suspended(&ts->spi->dev)) {
474 ts->irq_disabled = 0;
475 enable_irq(ts->spi->irq);
476 }
477 ts->pending = 0;
478 ts->msg_idx = 0;
479 } else {
480 /* pen is still down, continue with the measurement */
481 ts->msg_idx = 0;
482 status = spi_async(ts->spi, &ts->msg[0]);
483 if (status)
484 dev_err(&ts->spi->dev, "spi_async --> %d\n", status);
485 }
486
487 spin_unlock_irq(&ts->lock);
488}
489
490static irqreturn_t ads7846_irq(int irq, void *handle, struct pt_regs *regs)
491{
492 struct ads7846 *ts = handle;
493 unsigned long flags;
334 494
335 spin_lock_irqsave(&ts->lock, flags); 495 spin_lock_irqsave(&ts->lock, flags);
336 if (!ts->pending) { 496 if (likely(ts->get_pendown_state())) {
337 ts->pending = 1;
338 if (!ts->irq_disabled) { 497 if (!ts->irq_disabled) {
498 /* The ARM do_simple_IRQ() dispatcher doesn't act
499 * like the other dispatchers: it will report IRQs
500 * even after they've been disabled. We work around
501 * that here. (The "generic irq" framework may help...)
502 */
339 ts->irq_disabled = 1; 503 ts->irq_disabled = 1;
340 disable_irq(ts->spi->irq); 504 disable_irq(ts->spi->irq);
505 ts->pending = 1;
506 mod_timer(&ts->timer, jiffies);
341 } 507 }
342 status = spi_async(ts->spi, &ts->msg);
343 if (status)
344 dev_err(&ts->spi->dev, "spi_async --> %d\n",
345 status);
346 } 508 }
347 spin_unlock_irqrestore(&ts->lock, flags); 509 spin_unlock_irqrestore(&ts->lock, flags);
348}
349 510
350static irqreturn_t ads7846_irq(int irq, void *handle, struct pt_regs *regs)
351{
352 ads7846_timer((unsigned long) handle);
353 return IRQ_HANDLED; 511 return IRQ_HANDLED;
354} 512}
355 513
356/*--------------------------------------------------------------------------*/ 514/*--------------------------------------------------------------------------*/
357 515
358static int 516/* Must be called with ts->lock held */
359ads7846_suspend(struct spi_device *spi, pm_message_t message) 517static void ads7846_disable(struct ads7846 *ts)
360{ 518{
361 struct ads7846 *ts = dev_get_drvdata(&spi->dev); 519 if (ts->disabled)
362 unsigned long flags; 520 return;
363 521
364 spin_lock_irqsave(&ts->lock, flags); 522 ts->disabled = 1;
365
366 spi->dev.power.power_state = message;
367 523
368 /* are we waiting for IRQ, or polling? */ 524 /* are we waiting for IRQ, or polling? */
369 if (!ts->pendown) { 525 if (!ts->pending) {
370 if (!ts->irq_disabled) { 526 ts->irq_disabled = 1;
371 ts->irq_disabled = 1; 527 disable_irq(ts->spi->irq);
372 disable_irq(ts->spi->irq);
373 }
374 } else { 528 } else {
375 /* polling; force a final SPI completion; 529 /* the timer will run at least once more, and
376 * that will clean things up neatly 530 * leave everything in a clean state, IRQ disabled
377 */ 531 */
378 if (!ts->pending) 532 while (ts->pending) {
379 mod_timer(&ts->timer, jiffies); 533 spin_unlock_irq(&ts->lock);
380 534 msleep(1);
381 while (ts->pendown || ts->pending) { 535 spin_lock_irq(&ts->lock);
382 spin_unlock_irqrestore(&ts->lock, flags);
383 udelay(10);
384 spin_lock_irqsave(&ts->lock, flags);
385 } 536 }
386 } 537 }
387 538
@@ -389,17 +540,45 @@ ads7846_suspend(struct spi_device *spi, pm_message_t message)
389 * leave it that way after every request 540 * leave it that way after every request
390 */ 541 */
391 542
392 spin_unlock_irqrestore(&ts->lock, flags); 543}
544
545/* Must be called with ts->lock held */
546static void ads7846_enable(struct ads7846 *ts)
547{
548 if (!ts->disabled)
549 return;
550
551 ts->disabled = 0;
552 ts->irq_disabled = 0;
553 enable_irq(ts->spi->irq);
554}
555
556static int ads7846_suspend(struct spi_device *spi, pm_message_t message)
557{
558 struct ads7846 *ts = dev_get_drvdata(&spi->dev);
559
560 spin_lock_irq(&ts->lock);
561
562 spi->dev.power.power_state = message;
563 ads7846_disable(ts);
564
565 spin_unlock_irq(&ts->lock);
566
393 return 0; 567 return 0;
568
394} 569}
395 570
396static int ads7846_resume(struct spi_device *spi) 571static int ads7846_resume(struct spi_device *spi)
397{ 572{
398 struct ads7846 *ts = dev_get_drvdata(&spi->dev); 573 struct ads7846 *ts = dev_get_drvdata(&spi->dev);
399 574
400 ts->irq_disabled = 0; 575 spin_lock_irq(&ts->lock);
401 enable_irq(ts->spi->irq); 576
402 spi->dev.power.power_state = PMSG_ON; 577 spi->dev.power.power_state = PMSG_ON;
578 ads7846_enable(ts);
579
580 spin_unlock_irq(&ts->lock);
581
403 return 0; 582 return 0;
404} 583}
405 584
@@ -408,6 +587,7 @@ static int __devinit ads7846_probe(struct spi_device *spi)
408 struct ads7846 *ts; 587 struct ads7846 *ts;
409 struct input_dev *input_dev; 588 struct input_dev *input_dev;
410 struct ads7846_platform_data *pdata = spi->dev.platform_data; 589 struct ads7846_platform_data *pdata = spi->dev.platform_data;
590 struct spi_message *m;
411 struct spi_transfer *x; 591 struct spi_transfer *x;
412 int err; 592 int err;
413 593
@@ -428,11 +608,20 @@ static int __devinit ads7846_probe(struct spi_device *spi)
428 return -EINVAL; 608 return -EINVAL;
429 } 609 }
430 610
431 /* We'd set the wordsize to 12 bits ... except that some controllers 611 /* REVISIT when the irq can be triggered active-low, or if for some
432 * will then treat the 8 bit command words as 12 bits (and drop the 612 * reason the touchscreen isn't hooked up, we don't need to access
433 * four MSBs of the 12 bit result). Result: inputs must be shifted 613 * the pendown state.
434 * to discard the four garbage LSBs.
435 */ 614 */
615 if (pdata->get_pendown_state == NULL) {
616 dev_dbg(&spi->dev, "no get_pendown_state function?\n");
617 return -EINVAL;
618 }
619
620 /* We'd set TX wordsize 8 bits and RX wordsize to 13 bits ... except
621 * that even if the hardware can do that, the SPI controller driver
622 * may not. So we stick to very-portable 8 bit words, both RX and TX.
623 */
624 spi->bits_per_word = 8;
436 625
437 ts = kzalloc(sizeof(struct ads7846), GFP_KERNEL); 626 ts = kzalloc(sizeof(struct ads7846), GFP_KERNEL);
438 input_dev = input_allocate_device(); 627 input_dev = input_allocate_device();
@@ -451,9 +640,21 @@ static int __devinit ads7846_probe(struct spi_device *spi)
451 ts->timer.data = (unsigned long) ts; 640 ts->timer.data = (unsigned long) ts;
452 ts->timer.function = ads7846_timer; 641 ts->timer.function = ads7846_timer;
453 642
643 spin_lock_init(&ts->lock);
644
454 ts->model = pdata->model ? : 7846; 645 ts->model = pdata->model ? : 7846;
455 ts->vref_delay_usecs = pdata->vref_delay_usecs ? : 100; 646 ts->vref_delay_usecs = pdata->vref_delay_usecs ? : 100;
456 ts->x_plate_ohms = pdata->x_plate_ohms ? : 400; 647 ts->x_plate_ohms = pdata->x_plate_ohms ? : 400;
648 ts->pressure_max = pdata->pressure_max ? : ~0;
649 if (pdata->debounce_max) {
650 ts->debounce_max = pdata->debounce_max;
651 ts->debounce_tol = pdata->debounce_tol;
652 ts->debounce_rep = pdata->debounce_rep;
653 if (ts->debounce_rep > ts->debounce_max + 1)
654 ts->debounce_rep = ts->debounce_max - 1;
655 } else
656 ts->debounce_tol = ~0;
657 ts->get_pendown_state = pdata->get_pendown_state;
457 658
458 snprintf(ts->phys, sizeof(ts->phys), "%s/input0", spi->dev.bus_id); 659 snprintf(ts->phys, sizeof(ts->phys), "%s/input0", spi->dev.bus_id);
459 660
@@ -477,64 +678,104 @@ static int __devinit ads7846_probe(struct spi_device *spi)
477 /* set up the transfers to read touchscreen state; this assumes we 678 /* set up the transfers to read touchscreen state; this assumes we
478 * use formula #2 for pressure, not #3. 679 * use formula #2 for pressure, not #3.
479 */ 680 */
480 INIT_LIST_HEAD(&ts->msg.transfers); 681 m = &ts->msg[0];
481 x = ts->xfer; 682 x = ts->xfer;
482 683
684 spi_message_init(m);
685
483 /* y- still on; turn on only y+ (and ADC) */ 686 /* y- still on; turn on only y+ (and ADC) */
484 ts->read_y = READ_Y; 687 ts->read_y = READ_Y;
485 x->tx_buf = &ts->read_y; 688 x->tx_buf = &ts->read_y;
486 x->len = 1; 689 x->len = 1;
487 spi_message_add_tail(x, &ts->msg); 690 spi_message_add_tail(x, m);
488 691
489 x++; 692 x++;
490 x->rx_buf = &ts->tc.y; 693 x->rx_buf = &ts->tc.y;
491 x->len = 2; 694 x->len = 2;
492 spi_message_add_tail(x, &ts->msg); 695 spi_message_add_tail(x, m);
696
697 m->complete = ads7846_debounce;
698 m->context = ts;
699
700 m++;
701 spi_message_init(m);
702
703 /* turn y- off, x+ on, then leave in lowpower */
704 x++;
705 ts->read_x = READ_X;
706 x->tx_buf = &ts->read_x;
707 x->len = 1;
708 spi_message_add_tail(x, m);
709
710 x++;
711 x->rx_buf = &ts->tc.x;
712 x->len = 2;
713 spi_message_add_tail(x, m);
714
715 m->complete = ads7846_debounce;
716 m->context = ts;
493 717
494 /* turn y+ off, x- on; we'll use formula #2 */ 718 /* turn y+ off, x- on; we'll use formula #2 */
495 if (ts->model == 7846) { 719 if (ts->model == 7846) {
720 m++;
721 spi_message_init(m);
722
496 x++; 723 x++;
497 ts->read_z1 = READ_Z1; 724 ts->read_z1 = READ_Z1;
498 x->tx_buf = &ts->read_z1; 725 x->tx_buf = &ts->read_z1;
499 x->len = 1; 726 x->len = 1;
500 spi_message_add_tail(x, &ts->msg); 727 spi_message_add_tail(x, m);
501 728
502 x++; 729 x++;
503 x->rx_buf = &ts->tc.z1; 730 x->rx_buf = &ts->tc.z1;
504 x->len = 2; 731 x->len = 2;
505 spi_message_add_tail(x, &ts->msg); 732 spi_message_add_tail(x, m);
733
734 m->complete = ads7846_debounce;
735 m->context = ts;
736
737 m++;
738 spi_message_init(m);
506 739
507 x++; 740 x++;
508 ts->read_z2 = READ_Z2; 741 ts->read_z2 = READ_Z2;
509 x->tx_buf = &ts->read_z2; 742 x->tx_buf = &ts->read_z2;
510 x->len = 1; 743 x->len = 1;
511 spi_message_add_tail(x, &ts->msg); 744 spi_message_add_tail(x, m);
512 745
513 x++; 746 x++;
514 x->rx_buf = &ts->tc.z2; 747 x->rx_buf = &ts->tc.z2;
515 x->len = 2; 748 x->len = 2;
516 spi_message_add_tail(x, &ts->msg); 749 spi_message_add_tail(x, m);
750
751 m->complete = ads7846_debounce;
752 m->context = ts;
517 } 753 }
518 754
519 /* turn y- off, x+ on, then leave in lowpower */ 755 /* power down */
756 m++;
757 spi_message_init(m);
758
520 x++; 759 x++;
521 ts->read_x = READ_X; 760 ts->pwrdown = PWRDOWN;
522 x->tx_buf = &ts->read_x; 761 x->tx_buf = &ts->pwrdown;
523 x->len = 1; 762 x->len = 1;
524 spi_message_add_tail(x, &ts->msg); 763 spi_message_add_tail(x, m);
525 764
526 x++; 765 x++;
527 x->rx_buf = &ts->tc.x; 766 x->rx_buf = &ts->dummy;
528 x->len = 2; 767 x->len = 2;
529 CS_CHANGE(*x); 768 CS_CHANGE(*x);
530 spi_message_add_tail(x, &ts->msg); 769 spi_message_add_tail(x, m);
770
771 m->complete = ads7846_rx;
772 m->context = ts;
531 773
532 ts->msg.complete = ads7846_rx; 774 ts->last_msg = m;
533 ts->msg.context = ts;
534 775
535 if (request_irq(spi->irq, ads7846_irq, 776 if (request_irq(spi->irq, ads7846_irq,
536 SA_SAMPLE_RANDOM | SA_TRIGGER_FALLING, 777 SA_SAMPLE_RANDOM | SA_TRIGGER_FALLING,
537 spi->dev.bus_id, ts)) { 778 spi->dev.driver->name, ts)) {
538 dev_dbg(&spi->dev, "irq %d busy?\n", spi->irq); 779 dev_dbg(&spi->dev, "irq %d busy?\n", spi->irq);
539 err = -EBUSY; 780 err = -EBUSY;
540 goto err_free_mem; 781 goto err_free_mem;
@@ -559,13 +800,27 @@ static int __devinit ads7846_probe(struct spi_device *spi)
559 device_create_file(&spi->dev, &dev_attr_vbatt); 800 device_create_file(&spi->dev, &dev_attr_vbatt);
560 device_create_file(&spi->dev, &dev_attr_vaux); 801 device_create_file(&spi->dev, &dev_attr_vaux);
561 802
803 device_create_file(&spi->dev, &dev_attr_pen_down);
804
805 device_create_file(&spi->dev, &dev_attr_disable);
806
562 err = input_register_device(input_dev); 807 err = input_register_device(input_dev);
563 if (err) 808 if (err)
564 goto err_free_irq; 809 goto err_remove_attr;
565 810
566 return 0; 811 return 0;
567 812
568 err_free_irq: 813 err_remove_attr:
814 device_remove_file(&spi->dev, &dev_attr_disable);
815 device_remove_file(&spi->dev, &dev_attr_pen_down);
816 if (ts->model == 7846) {
817 device_remove_file(&spi->dev, &dev_attr_temp1);
818 device_remove_file(&spi->dev, &dev_attr_temp0);
819 }
820 if (ts->model != 7845)
821 device_remove_file(&spi->dev, &dev_attr_vbatt);
822 device_remove_file(&spi->dev, &dev_attr_vaux);
823
569 free_irq(spi->irq, ts); 824 free_irq(spi->irq, ts);
570 err_free_mem: 825 err_free_mem:
571 input_free_device(input_dev); 826 input_free_device(input_dev);
@@ -577,20 +832,24 @@ static int __devexit ads7846_remove(struct spi_device *spi)
577{ 832{
578 struct ads7846 *ts = dev_get_drvdata(&spi->dev); 833 struct ads7846 *ts = dev_get_drvdata(&spi->dev);
579 834
835 input_unregister_device(ts->input);
836
580 ads7846_suspend(spi, PMSG_SUSPEND); 837 ads7846_suspend(spi, PMSG_SUSPEND);
581 free_irq(ts->spi->irq, ts);
582 if (ts->irq_disabled)
583 enable_irq(ts->spi->irq);
584 838
839 device_remove_file(&spi->dev, &dev_attr_disable);
840 device_remove_file(&spi->dev, &dev_attr_pen_down);
585 if (ts->model == 7846) { 841 if (ts->model == 7846) {
586 device_remove_file(&spi->dev, &dev_attr_temp0);
587 device_remove_file(&spi->dev, &dev_attr_temp1); 842 device_remove_file(&spi->dev, &dev_attr_temp1);
843 device_remove_file(&spi->dev, &dev_attr_temp0);
588 } 844 }
589 if (ts->model != 7845) 845 if (ts->model != 7845)
590 device_remove_file(&spi->dev, &dev_attr_vbatt); 846 device_remove_file(&spi->dev, &dev_attr_vbatt);
591 device_remove_file(&spi->dev, &dev_attr_vaux); 847 device_remove_file(&spi->dev, &dev_attr_vaux);
592 848
593 input_unregister_device(ts->input); 849 free_irq(ts->spi->irq, ts);
850 /* suspend left the IRQ disabled */
851 enable_irq(ts->spi->irq);
852
594 kfree(ts); 853 kfree(ts);
595 854
596 dev_dbg(&spi->dev, "unregistered touchscreen\n"); 855 dev_dbg(&spi->dev, "unregistered touchscreen\n");
diff --git a/drivers/input/touchscreen/corgi_ts.c b/drivers/input/touchscreen/corgi_ts.c
index 1042987856f7..5013703db0e6 100644
--- a/drivers/input/touchscreen/corgi_ts.c
+++ b/drivers/input/touchscreen/corgi_ts.c
@@ -17,7 +17,7 @@
17#include <linux/interrupt.h> 17#include <linux/interrupt.h>
18#include <linux/module.h> 18#include <linux/module.h>
19#include <linux/slab.h> 19#include <linux/slab.h>
20#include <asm/irq.h> 20//#include <asm/irq.h>
21 21
22#include <asm/arch/sharpsl.h> 22#include <asm/arch/sharpsl.h>
23#include <asm/arch/hardware.h> 23#include <asm/arch/hardware.h>
diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c
index 9b493f0becc4..173c899a1fb4 100644
--- a/drivers/isdn/capi/capi.c
+++ b/drivers/isdn/capi/capi.c
@@ -1499,7 +1499,6 @@ static int __init capi_init(void)
1499 printk(KERN_ERR "capi20: unable to get major %d\n", capi_major); 1499 printk(KERN_ERR "capi20: unable to get major %d\n", capi_major);
1500 return major_ret; 1500 return major_ret;
1501 } 1501 }
1502 capi_major = major_ret;
1503 capi_class = class_create(THIS_MODULE, "capi"); 1502 capi_class = class_create(THIS_MODULE, "capi");
1504 if (IS_ERR(capi_class)) { 1503 if (IS_ERR(capi_class)) {
1505 unregister_chrdev(capi_major, "capi20"); 1504 unregister_chrdev(capi_major, "capi20");
diff --git a/drivers/isdn/gigaset/bas-gigaset.c b/drivers/isdn/gigaset/bas-gigaset.c
index f86ed6af3aa2..eb41aba3ddef 100644
--- a/drivers/isdn/gigaset/bas-gigaset.c
+++ b/drivers/isdn/gigaset/bas-gigaset.c
@@ -5,8 +5,6 @@
5 * Tilman Schmidt <tilman@imap.cc>, 5 * Tilman Schmidt <tilman@imap.cc>,
6 * Stefan Eilers. 6 * Stefan Eilers.
7 * 7 *
8 * Based on usb-gigaset.c.
9 *
10 * ===================================================================== 8 * =====================================================================
11 * This program is free software; you can redistribute it and/or 9 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License as 10 * modify it under the terms of the GNU General Public License as
@@ -46,19 +44,20 @@ MODULE_PARM_DESC(cidmode, "Call-ID mode");
46#define GIGASET_DEVFSNAME "gig/bas/" 44#define GIGASET_DEVFSNAME "gig/bas/"
47#define GIGASET_DEVNAME "ttyGB" 45#define GIGASET_DEVNAME "ttyGB"
48 46
49#define IF_WRITEBUF 256 //FIXME 47/* length limit according to Siemens 3070usb-protokoll.doc ch. 2.1 */
48#define IF_WRITEBUF 264
50 49
51/* Values for the Gigaset 307x */ 50/* Values for the Gigaset 307x */
52#define USB_GIGA_VENDOR_ID 0x0681 51#define USB_GIGA_VENDOR_ID 0x0681
53#define USB_GIGA_PRODUCT_ID 0x0001 52#define USB_3070_PRODUCT_ID 0x0001
54#define USB_4175_PRODUCT_ID 0x0002 53#define USB_3075_PRODUCT_ID 0x0002
55#define USB_SX303_PRODUCT_ID 0x0021 54#define USB_SX303_PRODUCT_ID 0x0021
56#define USB_SX353_PRODUCT_ID 0x0022 55#define USB_SX353_PRODUCT_ID 0x0022
57 56
58/* table of devices that work with this driver */ 57/* table of devices that work with this driver */
59static struct usb_device_id gigaset_table [] = { 58static struct usb_device_id gigaset_table [] = {
60 { USB_DEVICE(USB_GIGA_VENDOR_ID, USB_GIGA_PRODUCT_ID) }, 59 { USB_DEVICE(USB_GIGA_VENDOR_ID, USB_3070_PRODUCT_ID) },
61 { USB_DEVICE(USB_GIGA_VENDOR_ID, USB_4175_PRODUCT_ID) }, 60 { USB_DEVICE(USB_GIGA_VENDOR_ID, USB_3075_PRODUCT_ID) },
62 { USB_DEVICE(USB_GIGA_VENDOR_ID, USB_SX303_PRODUCT_ID) }, 61 { USB_DEVICE(USB_GIGA_VENDOR_ID, USB_SX303_PRODUCT_ID) },
63 { USB_DEVICE(USB_GIGA_VENDOR_ID, USB_SX353_PRODUCT_ID) }, 62 { USB_DEVICE(USB_GIGA_VENDOR_ID, USB_SX353_PRODUCT_ID) },
64 { } /* Terminating entry */ 63 { } /* Terminating entry */
@@ -77,6 +76,10 @@ static int gigaset_probe(struct usb_interface *interface,
77/* Function will be called if the device is unplugged */ 76/* Function will be called if the device is unplugged */
78static void gigaset_disconnect(struct usb_interface *interface); 77static void gigaset_disconnect(struct usb_interface *interface);
79 78
79static void read_ctrl_callback(struct urb *, struct pt_regs *);
80static void stopurbs(struct bas_bc_state *);
81static int atwrite_submit(struct cardstate *, unsigned char *, int);
82static int start_cbsend(struct cardstate *);
80 83
81/*==============================================================================*/ 84/*==============================================================================*/
82 85
@@ -111,12 +114,14 @@ struct bas_cardstate {
111}; 114};
112 115
113/* status of direct USB connection to 307x base (bits in basstate) */ 116/* status of direct USB connection to 307x base (bits in basstate) */
114#define BS_ATOPEN 0x001 117#define BS_ATOPEN 0x001 /* AT channel open */
115#define BS_B1OPEN 0x002 118#define BS_B1OPEN 0x002 /* B channel 1 open */
116#define BS_B2OPEN 0x004 119#define BS_B2OPEN 0x004 /* B channel 2 open */
117#define BS_ATREADY 0x008 120#define BS_ATREADY 0x008 /* base ready for AT command */
118#define BS_INIT 0x010 121#define BS_INIT 0x010 /* base has signalled INIT_OK */
119#define BS_ATTIMER 0x020 122#define BS_ATTIMER 0x020 /* waiting for HD_READY_SEND_ATDATA */
123#define BS_ATRDPEND 0x040 /* urb_cmd_in in use */
124#define BS_ATWRPEND 0x080 /* urb_cmd_out in use */
120 125
121 126
122static struct gigaset_driver *driver = NULL; 127static struct gigaset_driver *driver = NULL;
@@ -130,6 +135,47 @@ static struct usb_driver gigaset_usb_driver = {
130 .id_table = gigaset_table, 135 .id_table = gigaset_table,
131}; 136};
132 137
138/* get message text for usb_submit_urb return code
139 */
140static char *get_usb_rcmsg(int rc)
141{
142 static char unkmsg[28];
143
144 switch (rc) {
145 case 0:
146 return "success";
147 case -ENOMEM:
148 return "out of memory";
149 case -ENODEV:
150 return "device not present";
151 case -ENOENT:
152 return "endpoint not present";
153 case -ENXIO:
154 return "URB type not supported";
155 case -EINVAL:
156 return "invalid argument";
157 case -EAGAIN:
158 return "start frame too early or too much scheduled";
159 case -EFBIG:
160 return "too many isochronous frames requested";
161 case -EPIPE:
162 return "endpoint stalled";
163 case -EMSGSIZE:
164 return "invalid packet size";
165 case -ENOSPC:
166 return "would overcommit USB bandwidth";
167 case -ESHUTDOWN:
168 return "device shut down";
169 case -EPERM:
170 return "reject flag set";
171 case -EHOSTUNREACH:
172 return "device suspended";
173 default:
174 snprintf(unkmsg, sizeof(unkmsg), "unknown error %d", rc);
175 return unkmsg;
176 }
177}
178
133/* get message text for USB status code 179/* get message text for USB status code
134 */ 180 */
135static char *get_usb_statmsg(int status) 181static char *get_usb_statmsg(int status)
@@ -140,43 +186,37 @@ static char *get_usb_statmsg(int status)
140 case 0: 186 case 0:
141 return "success"; 187 return "success";
142 case -ENOENT: 188 case -ENOENT:
143 return "canceled"; 189 return "unlinked (sync)";
144 case -ECONNRESET:
145 return "canceled (async)";
146 case -EINPROGRESS: 190 case -EINPROGRESS:
147 return "pending"; 191 return "pending";
148 case -EPROTO: 192 case -EPROTO:
149 return "bit stuffing or unknown USB error"; 193 return "bit stuffing error, timeout, or unknown USB error";
150 case -EILSEQ: 194 case -EILSEQ:
151 return "Illegal byte sequence (CRC mismatch)"; 195 return "CRC mismatch, timeout, or unknown USB error";
152 case -EPIPE:
153 return "babble detect or endpoint stalled";
154 case -ENOSR:
155 return "buffer error";
156 case -ETIMEDOUT: 196 case -ETIMEDOUT:
157 return "timed out"; 197 return "timed out";
158 case -ENODEV: 198 case -EPIPE:
159 return "device not present"; 199 return "endpoint stalled";
200 case -ECOMM:
201 return "IN buffer overrun";
202 case -ENOSR:
203 return "OUT buffer underrun";
204 case -EOVERFLOW:
205 return "too much data";
160 case -EREMOTEIO: 206 case -EREMOTEIO:
161 return "short packet detected"; 207 return "short packet detected";
208 case -ENODEV:
209 return "device removed";
162 case -EXDEV: 210 case -EXDEV:
163 return "partial isochronous transfer"; 211 return "partial isochronous transfer";
164 case -EINVAL: 212 case -EINVAL:
165 return "invalid argument"; 213 return "invalid argument";
166 case -ENXIO: 214 case -ECONNRESET:
167 return "URB already queued"; 215 return "unlinked (async)";
168 case -EAGAIN:
169 return "isochronous start frame too early or too much scheduled";
170 case -EFBIG:
171 return "too many isochronous frames requested";
172 case -EMSGSIZE:
173 return "endpoint message size zero";
174 case -ESHUTDOWN: 216 case -ESHUTDOWN:
175 return "endpoint shutdown"; 217 return "device shut down";
176 case -EBUSY:
177 return "another request pending";
178 default: 218 default:
179 snprintf(unkmsg, sizeof(unkmsg), "unknown error %d", status); 219 snprintf(unkmsg, sizeof(unkmsg), "unknown status %d", status);
180 return unkmsg; 220 return unkmsg;
181 } 221 }
182} 222}
@@ -277,18 +317,17 @@ static inline void error_hangup(struct bc_state *bcs)
277 gig_dbg(DEBUG_ANY, "%s: scheduling HUP for channel %d", 317 gig_dbg(DEBUG_ANY, "%s: scheduling HUP for channel %d",
278 __func__, bcs->channel); 318 __func__, bcs->channel);
279 319
280 if (!gigaset_add_event(cs, &bcs->at_state, EV_HUP, NULL, 0, NULL)) { 320 if (!gigaset_add_event(cs, &bcs->at_state, EV_HUP, NULL, 0, NULL))
281 //FIXME what should we do? 321 dev_err(cs->dev, "event queue full\n");
282 return;
283 }
284 322
285 gigaset_schedule_event(cs); 323 gigaset_schedule_event(cs);
286} 324}
287 325
288/* error_reset 326/* error_reset
289 * reset Gigaset device because of an unrecoverable error 327 * reset Gigaset device because of an unrecoverable error
290 * This function may be called from any context and takes care of scheduling 328 * This function may be called from any context, and should take care of
291 * the necessary actions for execution outside of interrupt context. 329 * scheduling the necessary actions for execution outside of interrupt context.
330 * Right now, it just generates a kernel message calling for help.
292 * argument: 331 * argument:
293 * controller state structure 332 * controller state structure
294 */ 333 */
@@ -364,36 +403,38 @@ static void cmd_in_timeout(unsigned long data)
364{ 403{
365 struct cardstate *cs = (struct cardstate *) data; 404 struct cardstate *cs = (struct cardstate *) data;
366 struct bas_cardstate *ucs = cs->hw.bas; 405 struct bas_cardstate *ucs = cs->hw.bas;
367 unsigned long flags;
368 406
369 spin_lock_irqsave(&cs->lock, flags);
370 if (unlikely(!cs->connected)) {
371 gig_dbg(DEBUG_USBREQ, "%s: disconnected", __func__);
372 spin_unlock_irqrestore(&cs->lock, flags);
373 return;
374 }
375 if (!ucs->rcvbuf_size) { 407 if (!ucs->rcvbuf_size) {
376 gig_dbg(DEBUG_USBREQ, "%s: no receive in progress", __func__); 408 gig_dbg(DEBUG_USBREQ, "%s: no receive in progress", __func__);
377 spin_unlock_irqrestore(&cs->lock, flags);
378 return; 409 return;
379 } 410 }
380 spin_unlock_irqrestore(&cs->lock, flags);
381 411
382 dev_err(cs->dev, "timeout reading AT response\n"); 412 dev_err(cs->dev, "timeout reading AT response\n");
383 error_reset(cs); //FIXME retry? 413 error_reset(cs); //FIXME retry?
384} 414}
385 415
416/* set/clear bits in base connection state, return previous state
417 */
418inline static int update_basstate(struct bas_cardstate *ucs,
419 int set, int clear)
420{
421 unsigned long flags;
422 int state;
386 423
387static void read_ctrl_callback(struct urb *urb, struct pt_regs *regs); 424 spin_lock_irqsave(&ucs->lock, flags);
425 state = atomic_read(&ucs->basstate);
426 atomic_set(&ucs->basstate, (state & ~clear) | set);
427 spin_unlock_irqrestore(&ucs->lock, flags);
428 return state;
429}
388 430
389/* atread_submit 431/* atread_submit
390 * submit an HD_READ_ATMESSAGE command URB 432 * submit an HD_READ_ATMESSAGE command URB and optionally start a timeout
391 * parameters: 433 * parameters:
392 * cs controller state structure 434 * cs controller state structure
393 * timeout timeout in 1/10 sec., 0: none 435 * timeout timeout in 1/10 sec., 0: none
394 * return value: 436 * return value:
395 * 0 on success 437 * 0 on success
396 * -EINVAL if a NULL pointer is encountered somewhere
397 * -EBUSY if another request is pending 438 * -EBUSY if another request is pending
398 * any URB submission error code 439 * any URB submission error code
399 */ 440 */
@@ -405,7 +446,7 @@ static int atread_submit(struct cardstate *cs, int timeout)
405 gig_dbg(DEBUG_USBREQ, "-------> HD_READ_ATMESSAGE (%d)", 446 gig_dbg(DEBUG_USBREQ, "-------> HD_READ_ATMESSAGE (%d)",
406 ucs->rcvbuf_size); 447 ucs->rcvbuf_size);
407 448
408 if (ucs->urb_cmd_in->status == -EINPROGRESS) { 449 if (update_basstate(ucs, BS_ATRDPEND, 0) & BS_ATRDPEND) {
409 dev_err(cs->dev, 450 dev_err(cs->dev,
410 "could not submit HD_READ_ATMESSAGE: URB busy\n"); 451 "could not submit HD_READ_ATMESSAGE: URB busy\n");
411 return -EBUSY; 452 return -EBUSY;
@@ -423,6 +464,7 @@ static int atread_submit(struct cardstate *cs, int timeout)
423 read_ctrl_callback, cs->inbuf); 464 read_ctrl_callback, cs->inbuf);
424 465
425 if ((ret = usb_submit_urb(ucs->urb_cmd_in, SLAB_ATOMIC)) != 0) { 466 if ((ret = usb_submit_urb(ucs->urb_cmd_in, SLAB_ATOMIC)) != 0) {
467 update_basstate(ucs, 0, BS_ATRDPEND);
426 dev_err(cs->dev, "could not submit HD_READ_ATMESSAGE: %s\n", 468 dev_err(cs->dev, "could not submit HD_READ_ATMESSAGE: %s\n",
427 get_usb_statmsg(ret)); 469 get_usb_statmsg(ret));
428 return ret; 470 return ret;
@@ -438,26 +480,6 @@ static int atread_submit(struct cardstate *cs, int timeout)
438 return 0; 480 return 0;
439} 481}
440 482
441static void stopurbs(struct bas_bc_state *);
442static int start_cbsend(struct cardstate *);
443
444/* set/clear bits in base connection state
445 */
446inline static void update_basstate(struct bas_cardstate *ucs,
447 int set, int clear)
448{
449 unsigned long flags;
450 int state;
451
452 spin_lock_irqsave(&ucs->lock, flags);
453 state = atomic_read(&ucs->basstate);
454 state &= ~clear;
455 state |= set;
456 atomic_set(&ucs->basstate, state);
457 spin_unlock_irqrestore(&ucs->lock, flags);
458}
459
460
461/* read_int_callback 483/* read_int_callback
462 * USB completion handler for interrupt pipe input 484 * USB completion handler for interrupt pipe input
463 * called by the USB subsystem in interrupt context 485 * called by the USB subsystem in interrupt context
@@ -471,20 +493,25 @@ static void read_int_callback(struct urb *urb, struct pt_regs *regs)
471 struct bas_cardstate *ucs = cs->hw.bas; 493 struct bas_cardstate *ucs = cs->hw.bas;
472 struct bc_state *bcs; 494 struct bc_state *bcs;
473 unsigned long flags; 495 unsigned long flags;
474 int status; 496 int rc;
475 unsigned l; 497 unsigned l;
476 int channel; 498 int channel;
477 499
478 switch (urb->status) { 500 switch (urb->status) {
479 case 0: /* success */ 501 case 0: /* success */
480 break; 502 break;
481 case -ENOENT: /* canceled */ 503 case -ENOENT: /* cancelled */
482 case -ECONNRESET: /* canceled (async) */ 504 case -ECONNRESET: /* cancelled (async) */
483 case -EINPROGRESS: /* pending */ 505 case -EINPROGRESS: /* pending */
484 /* ignore silently */ 506 /* ignore silently */
485 gig_dbg(DEBUG_USBREQ, "%s: %s", 507 gig_dbg(DEBUG_USBREQ, "%s: %s",
486 __func__, get_usb_statmsg(urb->status)); 508 __func__, get_usb_statmsg(urb->status));
487 return; 509 return;
510 case -ENODEV: /* device removed */
511 case -ESHUTDOWN: /* device shut down */
512 //FIXME use this as disconnect indicator?
513 gig_dbg(DEBUG_USBREQ, "%s: device disconnected", __func__);
514 return;
488 default: /* severe trouble */ 515 default: /* severe trouble */
489 dev_warn(cs->dev, "interrupt read: %s\n", 516 dev_warn(cs->dev, "interrupt read: %s\n",
490 get_usb_statmsg(urb->status)); 517 get_usb_statmsg(urb->status));
@@ -492,6 +519,13 @@ static void read_int_callback(struct urb *urb, struct pt_regs *regs)
492 goto resubmit; 519 goto resubmit;
493 } 520 }
494 521
522 /* drop incomplete packets even if the missing bytes wouldn't matter */
523 if (unlikely(urb->actual_length < 3)) {
524 dev_warn(cs->dev, "incomplete interrupt packet (%d bytes)\n",
525 urb->actual_length);
526 goto resubmit;
527 }
528
495 l = (unsigned) ucs->int_in_buf[1] + 529 l = (unsigned) ucs->int_in_buf[1] +
496 (((unsigned) ucs->int_in_buf[2]) << 8); 530 (((unsigned) ucs->int_in_buf[2]) << 8);
497 531
@@ -558,25 +592,28 @@ static void read_int_callback(struct urb *urb, struct pt_regs *regs)
558 } 592 }
559 spin_lock_irqsave(&cs->lock, flags); 593 spin_lock_irqsave(&cs->lock, flags);
560 if (ucs->rcvbuf_size) { 594 if (ucs->rcvbuf_size) {
561 spin_unlock_irqrestore(&cs->lock, flags); 595 /* throw away previous buffer - we have no queue */
562 dev_err(cs->dev, 596 dev_err(cs->dev,
563 "receive AT data overrun, %d bytes lost\n", l); 597 "receive AT data overrun, %d bytes lost\n",
564 error_reset(cs); //FIXME reschedule 598 ucs->rcvbuf_size);
565 break; 599 kfree(ucs->rcvbuf);
600 ucs->rcvbuf_size = 0;
566 } 601 }
567 if ((ucs->rcvbuf = kmalloc(l, GFP_ATOMIC)) == NULL) { 602 if ((ucs->rcvbuf = kmalloc(l, GFP_ATOMIC)) == NULL) {
568 spin_unlock_irqrestore(&cs->lock, flags); 603 spin_unlock_irqrestore(&cs->lock, flags);
569 dev_err(cs->dev, "out of memory, %d bytes lost\n", l); 604 dev_err(cs->dev, "out of memory receiving AT data\n");
570 error_reset(cs); //FIXME reschedule 605 error_reset(cs);
571 break; 606 break;
572 } 607 }
573 ucs->rcvbuf_size = l; 608 ucs->rcvbuf_size = l;
574 ucs->retry_cmd_in = 0; 609 ucs->retry_cmd_in = 0;
575 if ((status = atread_submit(cs, BAS_TIMEOUT)) < 0) { 610 if ((rc = atread_submit(cs, BAS_TIMEOUT)) < 0) {
576 kfree(ucs->rcvbuf); 611 kfree(ucs->rcvbuf);
577 ucs->rcvbuf = NULL; 612 ucs->rcvbuf = NULL;
578 ucs->rcvbuf_size = 0; 613 ucs->rcvbuf_size = 0;
579 error_reset(cs); //FIXME reschedule 614 if (rc != -ENODEV)
615 //FIXME corrective action?
616 error_reset(cs);
580 } 617 }
581 spin_unlock_irqrestore(&cs->lock, flags); 618 spin_unlock_irqrestore(&cs->lock, flags);
582 break; 619 break;
@@ -598,12 +635,10 @@ static void read_int_callback(struct urb *urb, struct pt_regs *regs)
598 check_pending(ucs); 635 check_pending(ucs);
599 636
600resubmit: 637resubmit:
601 spin_lock_irqsave(&cs->lock, flags); 638 rc = usb_submit_urb(urb, SLAB_ATOMIC);
602 status = cs->connected ? usb_submit_urb(urb, SLAB_ATOMIC) : -ENODEV; 639 if (unlikely(rc != 0 && rc != -ENODEV)) {
603 spin_unlock_irqrestore(&cs->lock, flags);
604 if (unlikely(status)) {
605 dev_err(cs->dev, "could not resubmit interrupt URB: %s\n", 640 dev_err(cs->dev, "could not resubmit interrupt URB: %s\n",
606 get_usb_statmsg(status)); 641 get_usb_rcmsg(rc));
607 error_reset(cs); 642 error_reset(cs);
608 } 643 }
609} 644}
@@ -622,18 +657,12 @@ static void read_ctrl_callback(struct urb *urb, struct pt_regs *regs)
622 struct bas_cardstate *ucs = cs->hw.bas; 657 struct bas_cardstate *ucs = cs->hw.bas;
623 int have_data = 0; 658 int have_data = 0;
624 unsigned numbytes; 659 unsigned numbytes;
625 unsigned long flags; 660 int rc;
626 661
627 spin_lock_irqsave(&cs->lock, flags); 662 update_basstate(ucs, 0, BS_ATRDPEND);
628 if (unlikely(!cs->connected)) {
629 warn("%s: disconnected", __func__);
630 spin_unlock_irqrestore(&cs->lock, flags);
631 return;
632 }
633 663
634 if (!ucs->rcvbuf_size) { 664 if (!ucs->rcvbuf_size) {
635 dev_warn(cs->dev, "%s: no receive in progress\n", __func__); 665 dev_warn(cs->dev, "%s: no receive in progress\n", __func__);
636 spin_unlock_irqrestore(&cs->lock, flags);
637 return; 666 return;
638 } 667 }
639 668
@@ -666,9 +695,11 @@ static void read_ctrl_callback(struct urb *urb, struct pt_regs *regs)
666 } 695 }
667 break; 696 break;
668 697
669 case -ENOENT: /* canceled */ 698 case -ENOENT: /* cancelled */
670 case -ECONNRESET: /* canceled (async) */ 699 case -ECONNRESET: /* cancelled (async) */
671 case -EINPROGRESS: /* pending */ 700 case -EINPROGRESS: /* pending */
701 case -ENODEV: /* device removed */
702 case -ESHUTDOWN: /* device shut down */
672 /* no action necessary */ 703 /* no action necessary */
673 gig_dbg(DEBUG_USBREQ, "%s: %s", 704 gig_dbg(DEBUG_USBREQ, "%s: %s",
674 __func__, get_usb_statmsg(urb->status)); 705 __func__, get_usb_statmsg(urb->status));
@@ -681,11 +712,11 @@ static void read_ctrl_callback(struct urb *urb, struct pt_regs *regs)
681 if (ucs->retry_cmd_in++ < BAS_RETRY) { 712 if (ucs->retry_cmd_in++ < BAS_RETRY) {
682 dev_notice(cs->dev, "control read: retry %d\n", 713 dev_notice(cs->dev, "control read: retry %d\n",
683 ucs->retry_cmd_in); 714 ucs->retry_cmd_in);
684 if (atread_submit(cs, BAS_TIMEOUT) >= 0) { 715 rc = atread_submit(cs, BAS_TIMEOUT);
685 /* resubmitted - bypass regular exit block */ 716 if (rc >= 0 || rc == -ENODEV)
686 spin_unlock_irqrestore(&cs->lock, flags); 717 /* resubmitted or disconnected */
718 /* - bypass regular exit block */
687 return; 719 return;
688 }
689 } else { 720 } else {
690 dev_err(cs->dev, 721 dev_err(cs->dev,
691 "control read: giving up after %d tries\n", 722 "control read: giving up after %d tries\n",
@@ -697,7 +728,6 @@ static void read_ctrl_callback(struct urb *urb, struct pt_regs *regs)
697 kfree(ucs->rcvbuf); 728 kfree(ucs->rcvbuf);
698 ucs->rcvbuf = NULL; 729 ucs->rcvbuf = NULL;
699 ucs->rcvbuf_size = 0; 730 ucs->rcvbuf_size = 0;
700 spin_unlock_irqrestore(&cs->lock, flags);
701 if (have_data) { 731 if (have_data) {
702 gig_dbg(DEBUG_INTR, "%s-->BH", __func__); 732 gig_dbg(DEBUG_INTR, "%s-->BH", __func__);
703 gigaset_schedule_event(cs); 733 gigaset_schedule_event(cs);
@@ -719,8 +749,11 @@ static void read_iso_callback(struct urb *urb, struct pt_regs *regs)
719 int i, rc; 749 int i, rc;
720 750
721 /* status codes not worth bothering the tasklet with */ 751 /* status codes not worth bothering the tasklet with */
722 if (unlikely(urb->status == -ENOENT || urb->status == -ECONNRESET || 752 if (unlikely(urb->status == -ENOENT ||
723 urb->status == -EINPROGRESS)) { 753 urb->status == -ECONNRESET ||
754 urb->status == -EINPROGRESS ||
755 urb->status == -ENODEV ||
756 urb->status == -ESHUTDOWN)) {
724 gig_dbg(DEBUG_ISO, "%s: %s", 757 gig_dbg(DEBUG_ISO, "%s: %s",
725 __func__, get_usb_statmsg(urb->status)); 758 __func__, get_usb_statmsg(urb->status));
726 return; 759 return;
@@ -740,9 +773,9 @@ static void read_iso_callback(struct urb *urb, struct pt_regs *regs)
740 for (i = 0; i < BAS_NUMFRAMES; i++) { 773 for (i = 0; i < BAS_NUMFRAMES; i++) {
741 ubc->isoinlost += urb->iso_frame_desc[i].actual_length; 774 ubc->isoinlost += urb->iso_frame_desc[i].actual_length;
742 if (unlikely(urb->iso_frame_desc[i].status != 0 && 775 if (unlikely(urb->iso_frame_desc[i].status != 0 &&
743 urb->iso_frame_desc[i].status != -EINPROGRESS)) { 776 urb->iso_frame_desc[i].status !=
777 -EINPROGRESS))
744 ubc->loststatus = urb->iso_frame_desc[i].status; 778 ubc->loststatus = urb->iso_frame_desc[i].status;
745 }
746 urb->iso_frame_desc[i].status = 0; 779 urb->iso_frame_desc[i].status = 0;
747 urb->iso_frame_desc[i].actual_length = 0; 780 urb->iso_frame_desc[i].actual_length = 0;
748 } 781 }
@@ -754,10 +787,10 @@ static void read_iso_callback(struct urb *urb, struct pt_regs *regs)
754 gig_dbg(DEBUG_ISO, "%s: isoc read overrun/resubmit", 787 gig_dbg(DEBUG_ISO, "%s: isoc read overrun/resubmit",
755 __func__); 788 __func__);
756 rc = usb_submit_urb(urb, SLAB_ATOMIC); 789 rc = usb_submit_urb(urb, SLAB_ATOMIC);
757 if (unlikely(rc != 0)) { 790 if (unlikely(rc != 0 && rc != -ENODEV)) {
758 dev_err(bcs->cs->dev, 791 dev_err(bcs->cs->dev,
759 "could not resubmit isochronous read " 792 "could not resubmit isochronous read "
760 "URB: %s\n", get_usb_statmsg(rc)); 793 "URB: %s\n", get_usb_rcmsg(rc));
761 dump_urb(DEBUG_ISO, "isoc read", urb); 794 dump_urb(DEBUG_ISO, "isoc read", urb);
762 error_hangup(bcs); 795 error_hangup(bcs);
763 } 796 }
@@ -780,8 +813,11 @@ static void write_iso_callback(struct urb *urb, struct pt_regs *regs)
780 unsigned long flags; 813 unsigned long flags;
781 814
782 /* status codes not worth bothering the tasklet with */ 815 /* status codes not worth bothering the tasklet with */
783 if (unlikely(urb->status == -ENOENT || urb->status == -ECONNRESET || 816 if (unlikely(urb->status == -ENOENT ||
784 urb->status == -EINPROGRESS)) { 817 urb->status == -ECONNRESET ||
818 urb->status == -EINPROGRESS ||
819 urb->status == -ENODEV ||
820 urb->status == -ESHUTDOWN)) {
785 gig_dbg(DEBUG_ISO, "%s: %s", 821 gig_dbg(DEBUG_ISO, "%s: %s",
786 __func__, get_usb_statmsg(urb->status)); 822 __func__, get_usb_statmsg(urb->status));
787 return; 823 return;
@@ -822,7 +858,6 @@ static int starturbs(struct bc_state *bcs)
822 for (k = 0; k < BAS_INURBS; k++) { 858 for (k = 0; k < BAS_INURBS; k++) {
823 urb = ubc->isoinurbs[k]; 859 urb = ubc->isoinurbs[k];
824 if (!urb) { 860 if (!urb) {
825 dev_err(bcs->cs->dev, "isoinurbs[%d]==NULL\n", k);
826 rc = -EFAULT; 861 rc = -EFAULT;
827 goto error; 862 goto error;
828 } 863 }
@@ -844,12 +879,8 @@ static int starturbs(struct bc_state *bcs)
844 } 879 }
845 880
846 dump_urb(DEBUG_ISO, "Initial isoc read", urb); 881 dump_urb(DEBUG_ISO, "Initial isoc read", urb);
847 if ((rc = usb_submit_urb(urb, SLAB_ATOMIC)) != 0) { 882 if ((rc = usb_submit_urb(urb, SLAB_ATOMIC)) != 0)
848 dev_err(bcs->cs->dev,
849 "could not submit isochronous read URB %d: %s\n",
850 k, get_usb_statmsg(rc));
851 goto error; 883 goto error;
852 }
853 } 884 }
854 885
855 /* initialize L2 transmission */ 886 /* initialize L2 transmission */
@@ -859,7 +890,6 @@ static int starturbs(struct bc_state *bcs)
859 for (k = 0; k < BAS_OUTURBS; ++k) { 890 for (k = 0; k < BAS_OUTURBS; ++k) {
860 urb = ubc->isoouturbs[k].urb; 891 urb = ubc->isoouturbs[k].urb;
861 if (!urb) { 892 if (!urb) {
862 dev_err(bcs->cs->dev, "isoouturbs[%d].urb==NULL\n", k);
863 rc = -EFAULT; 893 rc = -EFAULT;
864 goto error; 894 goto error;
865 } 895 }
@@ -885,12 +915,8 @@ static int starturbs(struct bc_state *bcs)
885 for (k = 0; k < 2; ++k) { 915 for (k = 0; k < 2; ++k) {
886 dump_urb(DEBUG_ISO, "Initial isoc write", urb); 916 dump_urb(DEBUG_ISO, "Initial isoc write", urb);
887 rc = usb_submit_urb(ubc->isoouturbs[k].urb, SLAB_ATOMIC); 917 rc = usb_submit_urb(ubc->isoouturbs[k].urb, SLAB_ATOMIC);
888 if (rc != 0) { 918 if (rc != 0)
889 dev_err(bcs->cs->dev,
890 "could not submit isochronous write URB %d: %s\n",
891 k, get_usb_statmsg(rc));
892 goto error; 919 goto error;
893 }
894 } 920 }
895 dump_urb(DEBUG_ISO, "Initial isoc write (free)", urb); 921 dump_urb(DEBUG_ISO, "Initial isoc write (free)", urb);
896 ubc->isooutfree = &ubc->isoouturbs[2]; 922 ubc->isooutfree = &ubc->isoouturbs[2];
@@ -916,15 +942,15 @@ static void stopurbs(struct bas_bc_state *ubc)
916 for (k = 0; k < BAS_INURBS; ++k) { 942 for (k = 0; k < BAS_INURBS; ++k) {
917 rc = usb_unlink_urb(ubc->isoinurbs[k]); 943 rc = usb_unlink_urb(ubc->isoinurbs[k]);
918 gig_dbg(DEBUG_ISO, 944 gig_dbg(DEBUG_ISO,
919 "%s: isoc input URB %d unlinked, result = %d", 945 "%s: isoc input URB %d unlinked, result = %s",
920 __func__, k, rc); 946 __func__, k, get_usb_rcmsg(rc));
921 } 947 }
922 948
923 for (k = 0; k < BAS_OUTURBS; ++k) { 949 for (k = 0; k < BAS_OUTURBS; ++k) {
924 rc = usb_unlink_urb(ubc->isoouturbs[k].urb); 950 rc = usb_unlink_urb(ubc->isoouturbs[k].urb);
925 gig_dbg(DEBUG_ISO, 951 gig_dbg(DEBUG_ISO,
926 "%s: isoc output URB %d unlinked, result = %d", 952 "%s: isoc output URB %d unlinked, result = %s",
927 __func__, k, rc); 953 __func__, k, get_usb_rcmsg(rc));
928 } 954 }
929} 955}
930 956
@@ -934,7 +960,7 @@ static void stopurbs(struct bas_bc_state *ubc)
934/* submit_iso_write_urb 960/* submit_iso_write_urb
935 * fill and submit the next isochronous write URB 961 * fill and submit the next isochronous write URB
936 * parameters: 962 * parameters:
937 * bcs B channel state structure 963 * ucx context structure containing URB
938 * return value: 964 * return value:
939 * number of frames submitted in URB 965 * number of frames submitted in URB
940 * 0 if URB not submitted because no data available (isooutbuf busy) 966 * 0 if URB not submitted because no data available (isooutbuf busy)
@@ -946,7 +972,6 @@ static int submit_iso_write_urb(struct isow_urbctx_t *ucx)
946 struct bas_bc_state *ubc = ucx->bcs->hw.bas; 972 struct bas_bc_state *ubc = ucx->bcs->hw.bas;
947 struct usb_iso_packet_descriptor *ifd; 973 struct usb_iso_packet_descriptor *ifd;
948 int corrbytes, nframe, rc; 974 int corrbytes, nframe, rc;
949 unsigned long flags;
950 975
951 /* urb->dev is clobbered by USB subsystem */ 976 /* urb->dev is clobbered by USB subsystem */
952 urb->dev = ucx->bcs->cs->hw.bas->udev; 977 urb->dev = ucx->bcs->cs->hw.bas->udev;
@@ -992,20 +1017,22 @@ static int submit_iso_write_urb(struct isow_urbctx_t *ucx)
992 ifd->status = 0; 1017 ifd->status = 0;
993 ifd->actual_length = 0; 1018 ifd->actual_length = 0;
994 } 1019 }
995 if ((urb->number_of_packets = nframe) > 0) { 1020 if (unlikely(nframe == 0))
996 spin_lock_irqsave(&ucx->bcs->cs->lock, flags); 1021 return 0; /* no data to send */
997 rc = ucx->bcs->cs->connected ? usb_submit_urb(urb, SLAB_ATOMIC) : -ENODEV; 1022 urb->number_of_packets = nframe;
998 spin_unlock_irqrestore(&ucx->bcs->cs->lock, flags);
999 1023
1000 if (rc) { 1024 rc = usb_submit_urb(urb, SLAB_ATOMIC);
1025 if (unlikely(rc)) {
1026 if (rc == -ENODEV)
1027 /* device removed - give up silently */
1028 gig_dbg(DEBUG_ISO, "%s: disconnected", __func__);
1029 else
1001 dev_err(ucx->bcs->cs->dev, 1030 dev_err(ucx->bcs->cs->dev,
1002 "could not submit isochronous write URB: %s\n", 1031 "could not submit isochronous write URB: %s\n",
1003 get_usb_statmsg(rc)); 1032 get_usb_rcmsg(rc));
1004 dump_urb(DEBUG_ISO, "isoc write", urb); 1033 return rc;
1005 return rc;
1006 }
1007 ++ubc->numsub;
1008 } 1034 }
1035 ++ubc->numsub;
1009 return nframe; 1036 return nframe;
1010} 1037}
1011 1038
@@ -1028,6 +1055,7 @@ static void write_iso_tasklet(unsigned long data)
1028 int i; 1055 int i;
1029 struct sk_buff *skb; 1056 struct sk_buff *skb;
1030 int len; 1057 int len;
1058 int rc;
1031 1059
1032 /* loop while completed URBs arrive in time */ 1060 /* loop while completed URBs arrive in time */
1033 for (;;) { 1061 for (;;) {
@@ -1057,7 +1085,8 @@ static void write_iso_tasklet(unsigned long data)
1057 ubc->isooutfree = NULL; 1085 ubc->isooutfree = NULL;
1058 spin_unlock_irqrestore(&ubc->isooutlock, flags); 1086 spin_unlock_irqrestore(&ubc->isooutlock, flags);
1059 if (next) { 1087 if (next) {
1060 if (submit_iso_write_urb(next) <= 0) { 1088 rc = submit_iso_write_urb(next);
1089 if (unlikely(rc <= 0 && rc != -ENODEV)) {
1061 /* could not submit URB, put it back */ 1090 /* could not submit URB, put it back */
1062 spin_lock_irqsave(&ubc->isooutlock, flags); 1091 spin_lock_irqsave(&ubc->isooutlock, flags);
1063 if (ubc->isooutfree == NULL) { 1092 if (ubc->isooutfree == NULL) {
@@ -1077,17 +1106,18 @@ static void write_iso_tasklet(unsigned long data)
1077 /* process completed URB */ 1106 /* process completed URB */
1078 urb = done->urb; 1107 urb = done->urb;
1079 switch (urb->status) { 1108 switch (urb->status) {
1109 case -EXDEV: /* partial completion */
1110 gig_dbg(DEBUG_ISO, "%s: URB partially completed",
1111 __func__);
1112 /* fall through - what's the difference anyway? */
1080 case 0: /* normal completion */ 1113 case 0: /* normal completion */
1081 break; 1114 /* inspect individual frames
1082 case -EXDEV: /* inspect individual frames */ 1115 * assumptions (for lack of documentation):
1083 /* assumptions (for lack of documentation): 1116 * - actual_length bytes of first frame in error are
1084 * - actual_length bytes of the frame in error are
1085 * successfully sent 1117 * successfully sent
1086 * - all following frames are not sent at all 1118 * - all following frames are not sent at all
1087 */ 1119 */
1088 gig_dbg(DEBUG_ISO, "%s: URB partially completed", 1120 offset = done->limit; /* default (no error) */
1089 __func__);
1090 offset = done->limit; /* just in case */
1091 for (i = 0; i < BAS_NUMFRAMES; i++) { 1121 for (i = 0; i < BAS_NUMFRAMES; i++) {
1092 ifd = &urb->iso_frame_desc[i]; 1122 ifd = &urb->iso_frame_desc[i];
1093 if (ifd->status || 1123 if (ifd->status ||
@@ -1122,7 +1152,7 @@ static void write_iso_tasklet(unsigned long data)
1122 } 1152 }
1123#endif 1153#endif
1124 break; 1154 break;
1125 case -EPIPE: //FIXME is this the code for "underrun"? 1155 case -EPIPE: /* stall - probably underrun */
1126 dev_err(cs->dev, "isochronous write stalled\n"); 1156 dev_err(cs->dev, "isochronous write stalled\n");
1127 error_hangup(bcs); 1157 error_hangup(bcs);
1128 break; 1158 break;
@@ -1142,7 +1172,8 @@ static void write_iso_tasklet(unsigned long data)
1142 spin_unlock_irqrestore(&ubc->isooutlock, flags); 1172 spin_unlock_irqrestore(&ubc->isooutlock, flags);
1143 if (next) { 1173 if (next) {
1144 /* only one URB still active - resubmit one */ 1174 /* only one URB still active - resubmit one */
1145 if (submit_iso_write_urb(next) <= 0) { 1175 rc = submit_iso_write_urb(next);
1176 if (unlikely(rc <= 0 && rc != -ENODEV)) {
1146 /* couldn't submit */ 1177 /* couldn't submit */
1147 error_hangup(bcs); 1178 error_hangup(bcs);
1148 } 1179 }
@@ -1222,10 +1253,9 @@ static void read_iso_tasklet(unsigned long data)
1222 break; 1253 break;
1223 case -ENOENT: 1254 case -ENOENT:
1224 case -ECONNRESET: 1255 case -ECONNRESET:
1225 gig_dbg(DEBUG_ISO, "%s: URB canceled", __func__); 1256 case -EINPROGRESS:
1226 continue; /* -> skip */ 1257 gig_dbg(DEBUG_ISO, "%s: %s",
1227 case -EINPROGRESS: /* huh? */ 1258 __func__, get_usb_statmsg(urb->status));
1228 gig_dbg(DEBUG_ISO, "%s: URB still pending", __func__);
1229 continue; /* -> skip */ 1259 continue; /* -> skip */
1230 case -EPIPE: 1260 case -EPIPE:
1231 dev_err(cs->dev, "isochronous read stalled\n"); 1261 dev_err(cs->dev, "isochronous read stalled\n");
@@ -1290,13 +1320,11 @@ static void read_iso_tasklet(unsigned long data)
1290 urb->dev = bcs->cs->hw.bas->udev; 1320 urb->dev = bcs->cs->hw.bas->udev;
1291 urb->transfer_flags = URB_ISO_ASAP; 1321 urb->transfer_flags = URB_ISO_ASAP;
1292 urb->number_of_packets = BAS_NUMFRAMES; 1322 urb->number_of_packets = BAS_NUMFRAMES;
1293 spin_lock_irqsave(&cs->lock, flags); 1323 rc = usb_submit_urb(urb, SLAB_ATOMIC);
1294 rc = cs->connected ? usb_submit_urb(urb, SLAB_ATOMIC) : -ENODEV; 1324 if (unlikely(rc != 0 && rc != -ENODEV)) {
1295 spin_unlock_irqrestore(&cs->lock, flags);
1296 if (rc) {
1297 dev_err(cs->dev, 1325 dev_err(cs->dev,
1298 "could not resubmit isochronous read URB: %s\n", 1326 "could not resubmit isochronous read URB: %s\n",
1299 get_usb_statmsg(rc)); 1327 get_usb_rcmsg(rc));
1300 dump_urb(DEBUG_ISO, "resubmit iso read", urb); 1328 dump_urb(DEBUG_ISO, "resubmit iso read", urb);
1301 error_hangup(bcs); 1329 error_hangup(bcs);
1302 } 1330 }
@@ -1397,7 +1425,6 @@ static void write_ctrl_callback(struct urb *urb, struct pt_regs *regs)
1397 * timeout timeout in seconds (0: no timeout) 1425 * timeout timeout in seconds (0: no timeout)
1398 * return value: 1426 * return value:
1399 * 0 on success 1427 * 0 on success
1400 * -EINVAL if a NULL pointer is encountered somewhere
1401 * -EBUSY if another request is pending 1428 * -EBUSY if another request is pending
1402 * any URB submission error code 1429 * any URB submission error code
1403 */ 1430 */
@@ -1418,12 +1445,6 @@ static int req_submit(struct bc_state *bcs, int req, int val, int timeout)
1418 req, ucs->pending); 1445 req, ucs->pending);
1419 return -EBUSY; 1446 return -EBUSY;
1420 } 1447 }
1421 if (ucs->urb_ctrl->status == -EINPROGRESS) {
1422 spin_unlock_irqrestore(&ucs->lock, flags);
1423 dev_err(bcs->cs->dev,
1424 "could not submit request 0x%02x: URB busy\n", req);
1425 return -EBUSY;
1426 }
1427 1448
1428 ucs->dr_ctrl.bRequestType = OUT_VENDOR_REQ; 1449 ucs->dr_ctrl.bRequestType = OUT_VENDOR_REQ;
1429 ucs->dr_ctrl.bRequest = req; 1450 ucs->dr_ctrl.bRequest = req;
@@ -1465,22 +1486,36 @@ static int req_submit(struct bc_state *bcs, int req, int val, int timeout)
1465static int gigaset_init_bchannel(struct bc_state *bcs) 1486static int gigaset_init_bchannel(struct bc_state *bcs)
1466{ 1487{
1467 int req, ret; 1488 int req, ret;
1489 unsigned long flags;
1490
1491 spin_lock_irqsave(&bcs->cs->lock, flags);
1492 if (unlikely(!bcs->cs->connected)) {
1493 gig_dbg(DEBUG_USBREQ, "%s: not connected", __func__);
1494 spin_unlock_irqrestore(&bcs->cs->lock, flags);
1495 return -ENODEV;
1496 }
1468 1497
1469 if ((ret = starturbs(bcs)) < 0) { 1498 if ((ret = starturbs(bcs)) < 0) {
1470 dev_err(bcs->cs->dev, 1499 dev_err(bcs->cs->dev,
1471 "could not start isochronous I/O for channel %d\n", 1500 "could not start isochronous I/O for channel B%d: %s\n",
1472 bcs->channel + 1); 1501 bcs->channel + 1,
1473 error_hangup(bcs); 1502 ret == -EFAULT ? "null URB" : get_usb_rcmsg(ret));
1503 if (ret != -ENODEV)
1504 error_hangup(bcs);
1505 spin_unlock_irqrestore(&bcs->cs->lock, flags);
1474 return ret; 1506 return ret;
1475 } 1507 }
1476 1508
1477 req = bcs->channel ? HD_OPEN_B2CHANNEL : HD_OPEN_B1CHANNEL; 1509 req = bcs->channel ? HD_OPEN_B2CHANNEL : HD_OPEN_B1CHANNEL;
1478 if ((ret = req_submit(bcs, req, 0, BAS_TIMEOUT)) < 0) { 1510 if ((ret = req_submit(bcs, req, 0, BAS_TIMEOUT)) < 0) {
1479 dev_err(bcs->cs->dev, "could not open channel %d: %s\n", 1511 dev_err(bcs->cs->dev, "could not open channel B%d\n",
1480 bcs->channel + 1, get_usb_statmsg(ret)); 1512 bcs->channel + 1);
1481 stopurbs(bcs->hw.bas); 1513 stopurbs(bcs->hw.bas);
1482 error_hangup(bcs); 1514 if (ret != -ENODEV)
1515 error_hangup(bcs);
1483 } 1516 }
1517
1518 spin_unlock_irqrestore(&bcs->cs->lock, flags);
1484 return ret; 1519 return ret;
1485} 1520}
1486 1521
@@ -1497,19 +1532,30 @@ static int gigaset_init_bchannel(struct bc_state *bcs)
1497static int gigaset_close_bchannel(struct bc_state *bcs) 1532static int gigaset_close_bchannel(struct bc_state *bcs)
1498{ 1533{
1499 int req, ret; 1534 int req, ret;
1535 unsigned long flags;
1536
1537 spin_lock_irqsave(&bcs->cs->lock, flags);
1538 if (unlikely(!bcs->cs->connected)) {
1539 spin_unlock_irqrestore(&bcs->cs->lock, flags);
1540 gig_dbg(DEBUG_USBREQ, "%s: not connected", __func__);
1541 return -ENODEV;
1542 }
1500 1543
1501 if (!(atomic_read(&bcs->cs->hw.bas->basstate) & 1544 if (!(atomic_read(&bcs->cs->hw.bas->basstate) &
1502 (bcs->channel ? BS_B2OPEN : BS_B1OPEN))) { 1545 (bcs->channel ? BS_B2OPEN : BS_B1OPEN))) {
1503 /* channel not running: just signal common.c */ 1546 /* channel not running: just signal common.c */
1547 spin_unlock_irqrestore(&bcs->cs->lock, flags);
1504 gigaset_bchannel_down(bcs); 1548 gigaset_bchannel_down(bcs);
1505 return 0; 1549 return 0;
1506 } 1550 }
1507 1551
1552 /* channel running: tell device to close it */
1508 req = bcs->channel ? HD_CLOSE_B2CHANNEL : HD_CLOSE_B1CHANNEL; 1553 req = bcs->channel ? HD_CLOSE_B2CHANNEL : HD_CLOSE_B1CHANNEL;
1509 if ((ret = req_submit(bcs, req, 0, BAS_TIMEOUT)) < 0) 1554 if ((ret = req_submit(bcs, req, 0, BAS_TIMEOUT)) < 0)
1510 dev_err(bcs->cs->dev, 1555 dev_err(bcs->cs->dev, "closing channel B%d failed\n",
1511 "could not submit HD_CLOSE_BxCHANNEL request: %s\n", 1556 bcs->channel + 1);
1512 get_usb_statmsg(ret)); 1557
1558 spin_unlock_irqrestore(&bcs->cs->lock, flags);
1513 return ret; 1559 return ret;
1514} 1560}
1515 1561
@@ -1545,8 +1591,6 @@ static void complete_cb(struct cardstate *cs)
1545 kfree(cb); 1591 kfree(cb);
1546} 1592}
1547 1593
1548static int atwrite_submit(struct cardstate *cs, unsigned char *buf, int len);
1549
1550/* write_command_callback 1594/* write_command_callback
1551 * USB completion handler for AT command transmission 1595 * USB completion handler for AT command transmission
1552 * called by the USB subsystem in interrupt context 1596 * called by the USB subsystem in interrupt context
@@ -1560,13 +1604,17 @@ static void write_command_callback(struct urb *urb, struct pt_regs *regs)
1560 struct bas_cardstate *ucs = cs->hw.bas; 1604 struct bas_cardstate *ucs = cs->hw.bas;
1561 unsigned long flags; 1605 unsigned long flags;
1562 1606
1607 update_basstate(ucs, 0, BS_ATWRPEND);
1608
1563 /* check status */ 1609 /* check status */
1564 switch (urb->status) { 1610 switch (urb->status) {
1565 case 0: /* normal completion */ 1611 case 0: /* normal completion */
1566 break; 1612 break;
1567 case -ENOENT: /* canceled */ 1613 case -ENOENT: /* cancelled */
1568 case -ECONNRESET: /* canceled (async) */ 1614 case -ECONNRESET: /* cancelled (async) */
1569 case -EINPROGRESS: /* pending */ 1615 case -EINPROGRESS: /* pending */
1616 case -ENODEV: /* device removed */
1617 case -ESHUTDOWN: /* device shut down */
1570 /* ignore silently */ 1618 /* ignore silently */
1571 gig_dbg(DEBUG_USBREQ, "%s: %s", 1619 gig_dbg(DEBUG_USBREQ, "%s: %s",
1572 __func__, get_usb_statmsg(urb->status)); 1620 __func__, get_usb_statmsg(urb->status));
@@ -1627,19 +1675,17 @@ static void atrdy_timeout(unsigned long data)
1627 * len length of command to send 1675 * len length of command to send
1628 * return value: 1676 * return value:
1629 * 0 on success 1677 * 0 on success
1630 * -EFAULT if a NULL pointer is encountered somewhere
1631 * -EBUSY if another request is pending 1678 * -EBUSY if another request is pending
1632 * any URB submission error code 1679 * any URB submission error code
1633 */ 1680 */
1634static int atwrite_submit(struct cardstate *cs, unsigned char *buf, int len) 1681static int atwrite_submit(struct cardstate *cs, unsigned char *buf, int len)
1635{ 1682{
1636 struct bas_cardstate *ucs = cs->hw.bas; 1683 struct bas_cardstate *ucs = cs->hw.bas;
1637 unsigned long flags; 1684 int rc;
1638 int ret;
1639 1685
1640 gig_dbg(DEBUG_USBREQ, "-------> HD_WRITE_ATMESSAGE (%d)", len); 1686 gig_dbg(DEBUG_USBREQ, "-------> HD_WRITE_ATMESSAGE (%d)", len);
1641 1687
1642 if (ucs->urb_cmd_out->status == -EINPROGRESS) { 1688 if (update_basstate(ucs, BS_ATWRPEND, 0) & BS_ATWRPEND) {
1643 dev_err(cs->dev, 1689 dev_err(cs->dev,
1644 "could not submit HD_WRITE_ATMESSAGE: URB busy\n"); 1690 "could not submit HD_WRITE_ATMESSAGE: URB busy\n");
1645 return -EBUSY; 1691 return -EBUSY;
@@ -1654,29 +1700,22 @@ static int atwrite_submit(struct cardstate *cs, unsigned char *buf, int len)
1654 usb_sndctrlpipe(ucs->udev, 0), 1700 usb_sndctrlpipe(ucs->udev, 0),
1655 (unsigned char*) &ucs->dr_cmd_out, buf, len, 1701 (unsigned char*) &ucs->dr_cmd_out, buf, len,
1656 write_command_callback, cs); 1702 write_command_callback, cs);
1657 1703 rc = usb_submit_urb(ucs->urb_cmd_out, SLAB_ATOMIC);
1658 spin_lock_irqsave(&cs->lock, flags); 1704 if (unlikely(rc)) {
1659 ret = cs->connected ? usb_submit_urb(ucs->urb_cmd_out, SLAB_ATOMIC) : -ENODEV; 1705 update_basstate(ucs, 0, BS_ATWRPEND);
1660 spin_unlock_irqrestore(&cs->lock, flags);
1661
1662 if (ret) {
1663 dev_err(cs->dev, "could not submit HD_WRITE_ATMESSAGE: %s\n", 1706 dev_err(cs->dev, "could not submit HD_WRITE_ATMESSAGE: %s\n",
1664 get_usb_statmsg(ret)); 1707 get_usb_rcmsg(rc));
1665 return ret; 1708 return rc;
1666 } 1709 }
1667 1710
1668 /* submitted successfully */ 1711 /* submitted successfully, start timeout if necessary */
1669 update_basstate(ucs, 0, BS_ATREADY); 1712 if (!(update_basstate(ucs, BS_ATTIMER, BS_ATREADY) & BS_ATTIMER)) {
1670
1671 /* start timeout if necessary */
1672 if (!(atomic_read(&ucs->basstate) & BS_ATTIMER)) {
1673 gig_dbg(DEBUG_OUTPUT, "setting ATREADY timeout of %d/10 secs", 1713 gig_dbg(DEBUG_OUTPUT, "setting ATREADY timeout of %d/10 secs",
1674 ATRDY_TIMEOUT); 1714 ATRDY_TIMEOUT);
1675 ucs->timer_atrdy.expires = jiffies + ATRDY_TIMEOUT * HZ / 10; 1715 ucs->timer_atrdy.expires = jiffies + ATRDY_TIMEOUT * HZ / 10;
1676 ucs->timer_atrdy.data = (unsigned long) cs; 1716 ucs->timer_atrdy.data = (unsigned long) cs;
1677 ucs->timer_atrdy.function = atrdy_timeout; 1717 ucs->timer_atrdy.function = atrdy_timeout;
1678 add_timer(&ucs->timer_atrdy); 1718 add_timer(&ucs->timer_atrdy);
1679 update_basstate(ucs, BS_ATTIMER, 0);
1680 } 1719 }
1681 return 0; 1720 return 0;
1682} 1721}
@@ -1702,7 +1741,6 @@ static int start_cbsend(struct cardstate *cs)
1702 gig_dbg(DEBUG_TRANSCMD|DEBUG_LOCKCMD, "AT channel not open"); 1741 gig_dbg(DEBUG_TRANSCMD|DEBUG_LOCKCMD, "AT channel not open");
1703 rc = req_submit(cs->bcs, HD_OPEN_ATCHANNEL, 0, BAS_TIMEOUT); 1742 rc = req_submit(cs->bcs, HD_OPEN_ATCHANNEL, 0, BAS_TIMEOUT);
1704 if (rc < 0) { 1743 if (rc < 0) {
1705 dev_err(cs->dev, "could not open AT channel\n");
1706 /* flush command queue */ 1744 /* flush command queue */
1707 spin_lock_irqsave(&cs->cmdlock, flags); 1745 spin_lock_irqsave(&cs->cmdlock, flags);
1708 while (cs->cmdbuf != NULL) 1746 while (cs->cmdbuf != NULL)
@@ -1786,8 +1824,14 @@ static int gigaset_write_cmd(struct cardstate *cs,
1786 cs->lastcmdbuf = cb; 1824 cs->lastcmdbuf = cb;
1787 spin_unlock_irqrestore(&cs->cmdlock, flags); 1825 spin_unlock_irqrestore(&cs->cmdlock, flags);
1788 1826
1827 spin_lock_irqsave(&cs->lock, flags);
1828 if (unlikely(!cs->connected)) {
1829 spin_unlock_irqrestore(&cs->lock, flags);
1830 gig_dbg(DEBUG_USBREQ, "%s: not connected", __func__);
1831 return -ENODEV;
1832 }
1789 status = start_cbsend(cs); 1833 status = start_cbsend(cs);
1790 1834 spin_unlock_irqrestore(&cs->lock, flags);
1791 return status < 0 ? status : len; 1835 return status < 0 ? status : len;
1792} 1836}
1793 1837
@@ -1849,12 +1893,32 @@ static int gigaset_brkchars(struct cardstate *cs, const unsigned char buf[6])
1849 */ 1893 */
1850static int gigaset_freebcshw(struct bc_state *bcs) 1894static int gigaset_freebcshw(struct bc_state *bcs)
1851{ 1895{
1852 if (!bcs->hw.bas) 1896 struct bas_bc_state *ubc = bcs->hw.bas;
1897 int i;
1898
1899 if (!ubc)
1853 return 0; 1900 return 0;
1854 1901
1855 if (bcs->hw.bas->isooutbuf) 1902 /* kill URBs and tasklets before freeing - better safe than sorry */
1856 kfree(bcs->hw.bas->isooutbuf); 1903 atomic_set(&ubc->running, 0);
1857 kfree(bcs->hw.bas); 1904 for (i = 0; i < BAS_OUTURBS; ++i)
1905 if (ubc->isoouturbs[i].urb) {
1906 gig_dbg(DEBUG_INIT, "%s: killing iso out URB %d",
1907 __func__, i);
1908 usb_kill_urb(ubc->isoouturbs[i].urb);
1909 usb_free_urb(ubc->isoouturbs[i].urb);
1910 }
1911 for (i = 0; i < BAS_INURBS; ++i)
1912 if (ubc->isoinurbs[i]) {
1913 gig_dbg(DEBUG_INIT, "%s: killing iso in URB %d",
1914 __func__, i);
1915 usb_kill_urb(ubc->isoinurbs[i]);
1916 usb_free_urb(ubc->isoinurbs[i]);
1917 }
1918 tasklet_kill(&ubc->sent_tasklet);
1919 tasklet_kill(&ubc->rcvd_tasklet);
1920 kfree(ubc->isooutbuf);
1921 kfree(ubc);
1858 bcs->hw.bas = NULL; 1922 bcs->hw.bas = NULL;
1859 return 1; 1923 return 1;
1860} 1924}
@@ -1931,13 +1995,9 @@ static void gigaset_reinitbcshw(struct bc_state *bcs)
1931 1995
1932static void gigaset_freecshw(struct cardstate *cs) 1996static void gigaset_freecshw(struct cardstate *cs)
1933{ 1997{
1934 struct bas_cardstate *ucs = cs->hw.bas; 1998 /* timers, URBs and rcvbuf are disposed of in disconnect */
1935
1936 del_timer(&ucs->timer_ctrl);
1937 del_timer(&ucs->timer_atrdy);
1938 del_timer(&ucs->timer_cmd_in);
1939
1940 kfree(cs->hw.bas); 1999 kfree(cs->hw.bas);
2000 cs->hw.bas = NULL;
1941} 2001}
1942 2002
1943static int gigaset_initcshw(struct cardstate *cs) 2003static int gigaset_initcshw(struct cardstate *cs)
@@ -2041,23 +2101,13 @@ static int gigaset_probe(struct usb_interface *interface,
2041 struct bas_bc_state *ubc; 2101 struct bas_bc_state *ubc;
2042 struct usb_endpoint_descriptor *endpoint; 2102 struct usb_endpoint_descriptor *endpoint;
2043 int i, j; 2103 int i, j;
2044 int ret; 2104 int rc;
2045 2105
2046 gig_dbg(DEBUG_ANY, 2106 gig_dbg(DEBUG_ANY,
2047 "%s: Check if device matches .. (Vendor: 0x%x, Product: 0x%x)", 2107 "%s: Check if device matches .. (Vendor: 0x%x, Product: 0x%x)",
2048 __func__, le16_to_cpu(udev->descriptor.idVendor), 2108 __func__, le16_to_cpu(udev->descriptor.idVendor),
2049 le16_to_cpu(udev->descriptor.idProduct)); 2109 le16_to_cpu(udev->descriptor.idProduct));
2050 2110
2051 /* See if the device offered us matches what we can accept */
2052 if ((le16_to_cpu(udev->descriptor.idVendor) != USB_GIGA_VENDOR_ID) ||
2053 (le16_to_cpu(udev->descriptor.idProduct) != USB_GIGA_PRODUCT_ID &&
2054 le16_to_cpu(udev->descriptor.idProduct) != USB_4175_PRODUCT_ID &&
2055 le16_to_cpu(udev->descriptor.idProduct) != USB_SX303_PRODUCT_ID &&
2056 le16_to_cpu(udev->descriptor.idProduct) != USB_SX353_PRODUCT_ID)) {
2057 gig_dbg(DEBUG_ANY, "%s: unmatched ID - exiting", __func__);
2058 return -ENODEV;
2059 }
2060
2061 /* set required alternate setting */ 2111 /* set required alternate setting */
2062 hostif = interface->cur_altsetting; 2112 hostif = interface->cur_altsetting;
2063 if (hostif->desc.bAlternateSetting != 3) { 2113 if (hostif->desc.bAlternateSetting != 3) {
@@ -2105,45 +2155,22 @@ static int gigaset_probe(struct usb_interface *interface,
2105 * - three for the different uses of the default control pipe 2155 * - three for the different uses of the default control pipe
2106 * - three for each isochronous pipe 2156 * - three for each isochronous pipe
2107 */ 2157 */
2108 ucs->urb_int_in = usb_alloc_urb(0, SLAB_KERNEL); 2158 if (!(ucs->urb_int_in = usb_alloc_urb(0, SLAB_KERNEL)) ||
2109 if (!ucs->urb_int_in) { 2159 !(ucs->urb_cmd_in = usb_alloc_urb(0, SLAB_KERNEL)) ||
2110 dev_err(cs->dev, "no free urbs available\n"); 2160 !(ucs->urb_cmd_out = usb_alloc_urb(0, SLAB_KERNEL)) ||
2111 goto error; 2161 !(ucs->urb_ctrl = usb_alloc_urb(0, SLAB_KERNEL)))
2112 } 2162 goto allocerr;
2113 ucs->urb_cmd_in = usb_alloc_urb(0, SLAB_KERNEL);
2114 if (!ucs->urb_cmd_in) {
2115 dev_err(cs->dev, "no free urbs available\n");
2116 goto error;
2117 }
2118 ucs->urb_cmd_out = usb_alloc_urb(0, SLAB_KERNEL);
2119 if (!ucs->urb_cmd_out) {
2120 dev_err(cs->dev, "no free urbs available\n");
2121 goto error;
2122 }
2123 ucs->urb_ctrl = usb_alloc_urb(0, SLAB_KERNEL);
2124 if (!ucs->urb_ctrl) {
2125 dev_err(cs->dev, "no free urbs available\n");
2126 goto error;
2127 }
2128 2163
2129 for (j = 0; j < 2; ++j) { 2164 for (j = 0; j < 2; ++j) {
2130 ubc = cs->bcs[j].hw.bas; 2165 ubc = cs->bcs[j].hw.bas;
2131 for (i = 0; i < BAS_OUTURBS; ++i) { 2166 for (i = 0; i < BAS_OUTURBS; ++i)
2132 ubc->isoouturbs[i].urb = 2167 if (!(ubc->isoouturbs[i].urb =
2133 usb_alloc_urb(BAS_NUMFRAMES, SLAB_KERNEL); 2168 usb_alloc_urb(BAS_NUMFRAMES, SLAB_KERNEL)))
2134 if (!ubc->isoouturbs[i].urb) { 2169 goto allocerr;
2135 dev_err(cs->dev, "no free urbs available\n"); 2170 for (i = 0; i < BAS_INURBS; ++i)
2136 goto error; 2171 if (!(ubc->isoinurbs[i] =
2137 } 2172 usb_alloc_urb(BAS_NUMFRAMES, SLAB_KERNEL)))
2138 } 2173 goto allocerr;
2139 for (i = 0; i < BAS_INURBS; ++i) {
2140 ubc->isoinurbs[i] =
2141 usb_alloc_urb(BAS_NUMFRAMES, SLAB_KERNEL);
2142 if (!ubc->isoinurbs[i]) {
2143 dev_err(cs->dev, "no free urbs available\n");
2144 goto error;
2145 }
2146 }
2147 } 2174 }
2148 2175
2149 ucs->rcvbuf = NULL; 2176 ucs->rcvbuf = NULL;
@@ -2156,15 +2183,14 @@ static int gigaset_probe(struct usb_interface *interface,
2156 (endpoint->bEndpointAddress) & 0x0f), 2183 (endpoint->bEndpointAddress) & 0x0f),
2157 ucs->int_in_buf, 3, read_int_callback, cs, 2184 ucs->int_in_buf, 3, read_int_callback, cs,
2158 endpoint->bInterval); 2185 endpoint->bInterval);
2159 ret = usb_submit_urb(ucs->urb_int_in, SLAB_KERNEL); 2186 if ((rc = usb_submit_urb(ucs->urb_int_in, SLAB_KERNEL)) != 0) {
2160 if (ret) {
2161 dev_err(cs->dev, "could not submit interrupt URB: %s\n", 2187 dev_err(cs->dev, "could not submit interrupt URB: %s\n",
2162 get_usb_statmsg(ret)); 2188 get_usb_rcmsg(rc));
2163 goto error; 2189 goto error;
2164 } 2190 }
2165 2191
2166 /* tell the device that the driver is ready */ 2192 /* tell the device that the driver is ready */
2167 if ((ret = req_submit(cs->bcs, HD_DEVICE_INIT_ACK, 0, 0)) != 0) 2193 if ((rc = req_submit(cs->bcs, HD_DEVICE_INIT_ACK, 0, 0)) != 0)
2168 goto error; 2194 goto error;
2169 2195
2170 /* tell common part that the device is ready */ 2196 /* tell common part that the device is ready */
@@ -2179,6 +2205,8 @@ static int gigaset_probe(struct usb_interface *interface,
2179 2205
2180 return 0; 2206 return 0;
2181 2207
2208allocerr:
2209 dev_err(cs->dev, "could not allocate URBs\n");
2182error: 2210error:
2183 freeurbs(cs); 2211 freeurbs(cs);
2184 usb_set_intfdata(interface, NULL); 2212 usb_set_intfdata(interface, NULL);
@@ -2193,19 +2221,34 @@ static void gigaset_disconnect(struct usb_interface *interface)
2193{ 2221{
2194 struct cardstate *cs; 2222 struct cardstate *cs;
2195 struct bas_cardstate *ucs; 2223 struct bas_cardstate *ucs;
2224 int j;
2196 2225
2197 cs = usb_get_intfdata(interface); 2226 cs = usb_get_intfdata(interface);
2198 2227
2199 ucs = cs->hw.bas; 2228 ucs = cs->hw.bas;
2200 2229
2201 dev_info(cs->dev, "disconnecting Gigaset base\n"); 2230 dev_info(cs->dev, "disconnecting Gigaset base\n");
2231
2232 /* mark base as not ready, all channels disconnected */
2233 atomic_set(&ucs->basstate, 0);
2234
2235 /* tell LL all channels are down */
2236 //FIXME shouldn't gigaset_stop() do this?
2237 for (j = 0; j < 2; ++j)
2238 gigaset_bchannel_down(cs->bcs + j);
2239
2240 /* stop driver (common part) */
2202 gigaset_stop(cs); 2241 gigaset_stop(cs);
2242
2243 /* stop timers and URBs, free ressources */
2244 del_timer_sync(&ucs->timer_ctrl);
2245 del_timer_sync(&ucs->timer_atrdy);
2246 del_timer_sync(&ucs->timer_cmd_in);
2203 freeurbs(cs); 2247 freeurbs(cs);
2204 usb_set_intfdata(interface, NULL); 2248 usb_set_intfdata(interface, NULL);
2205 kfree(ucs->rcvbuf); 2249 kfree(ucs->rcvbuf);
2206 ucs->rcvbuf = NULL; 2250 ucs->rcvbuf = NULL;
2207 ucs->rcvbuf_size = 0; 2251 ucs->rcvbuf_size = 0;
2208 atomic_set(&ucs->basstate, 0);
2209 usb_put_dev(ucs->udev); 2252 usb_put_dev(ucs->udev);
2210 ucs->interface = NULL; 2253 ucs->interface = NULL;
2211 ucs->udev = NULL; 2254 ucs->udev = NULL;
@@ -2277,6 +2320,8 @@ error: if (cardstate)
2277 */ 2320 */
2278static void __exit bas_gigaset_exit(void) 2321static void __exit bas_gigaset_exit(void)
2279{ 2322{
2323 struct bas_cardstate *ucs = cardstate->hw.bas;
2324
2280 gigaset_blockdriver(driver); /* => probe will fail 2325 gigaset_blockdriver(driver); /* => probe will fail
2281 * => no gigaset_start any more 2326 * => no gigaset_start any more
2282 */ 2327 */
@@ -2284,14 +2329,26 @@ static void __exit bas_gigaset_exit(void)
2284 gigaset_shutdown(cardstate); 2329 gigaset_shutdown(cardstate);
2285 /* from now on, no isdn callback should be possible */ 2330 /* from now on, no isdn callback should be possible */
2286 2331
2287 if (atomic_read(&cardstate->hw.bas->basstate) & BS_ATOPEN) { 2332 /* close all still open channels */
2288 gig_dbg(DEBUG_ANY, "closing AT channel"); 2333 if (atomic_read(&ucs->basstate) & BS_B1OPEN) {
2289 if (req_submit(cardstate->bcs, 2334 gig_dbg(DEBUG_INIT, "closing B1 channel");
2290 HD_CLOSE_ATCHANNEL, 0, BAS_TIMEOUT) >= 0) { 2335 usb_control_msg(ucs->udev, usb_sndctrlpipe(ucs->udev, 0),
2291 /* successfully submitted */ 2336 HD_CLOSE_B1CHANNEL, OUT_VENDOR_REQ, 0, 0,
2292 //FIXME wait for completion? 2337 NULL, 0, BAS_TIMEOUT);
2293 } 2338 }
2339 if (atomic_read(&ucs->basstate) & BS_B2OPEN) {
2340 gig_dbg(DEBUG_INIT, "closing B2 channel");
2341 usb_control_msg(ucs->udev, usb_sndctrlpipe(ucs->udev, 0),
2342 HD_CLOSE_B2CHANNEL, OUT_VENDOR_REQ, 0, 0,
2343 NULL, 0, BAS_TIMEOUT);
2344 }
2345 if (atomic_read(&ucs->basstate) & BS_ATOPEN) {
2346 gig_dbg(DEBUG_INIT, "closing AT channel");
2347 usb_control_msg(ucs->udev, usb_sndctrlpipe(ucs->udev, 0),
2348 HD_CLOSE_ATCHANNEL, OUT_VENDOR_REQ, 0, 0,
2349 NULL, 0, BAS_TIMEOUT);
2294 } 2350 }
2351 atomic_set(&ucs->basstate, 0);
2295 2352
2296 /* deregister this driver with the USB subsystem */ 2353 /* deregister this driver with the USB subsystem */
2297 usb_deregister(&gigaset_usb_driver); 2354 usb_deregister(&gigaset_usb_driver);
diff --git a/drivers/isdn/gigaset/common.c b/drivers/isdn/gigaset/common.c
index 749b3da1236e..e55767b2ccd3 100644
--- a/drivers/isdn/gigaset/common.c
+++ b/drivers/isdn/gigaset/common.c
@@ -781,8 +781,7 @@ error: if (cs)
781} 781}
782EXPORT_SYMBOL_GPL(gigaset_initcs); 782EXPORT_SYMBOL_GPL(gigaset_initcs);
783 783
784/* ReInitialize the b-channel structure */ 784/* ReInitialize the b-channel structure on hangup */
785/* e.g. called on hangup, disconnect */
786void gigaset_bcs_reinit(struct bc_state *bcs) 785void gigaset_bcs_reinit(struct bc_state *bcs)
787{ 786{
788 struct sk_buff *skb; 787 struct sk_buff *skb;
diff --git a/drivers/isdn/gigaset/ev-layer.c b/drivers/isdn/gigaset/ev-layer.c
index 1ba3424a286b..18e05c09b71c 100644
--- a/drivers/isdn/gigaset/ev-layer.c
+++ b/drivers/isdn/gigaset/ev-layer.c
@@ -373,6 +373,9 @@ struct reply_t gigaset_tab_cid_m10x[] = /* for M10x */
373 373
374 {EV_TIMEOUT, 750,750, -1, 0, 0, {ACT_CONNTIMEOUT}}, 374 {EV_TIMEOUT, 750,750, -1, 0, 0, {ACT_CONNTIMEOUT}},
375 375
376 /* B channel closed (general case) */
377 {EV_BC_CLOSED, -1, -1, -1, -1,-1, {ACT_NOTIFY_BC_DOWN}}, //FIXME
378
376 /* misc. */ 379 /* misc. */
377 {EV_PROTO_L2, -1, -1, -1, -1,-1, {ACT_PROTO_L2}}, //FIXME 380 {EV_PROTO_L2, -1, -1, -1, -1,-1, {ACT_PROTO_L2}}, //FIXME
378 381
diff --git a/drivers/isdn/gigaset/gigaset.h b/drivers/isdn/gigaset/gigaset.h
index 9d21ba8757b0..22b9693f7c0a 100644
--- a/drivers/isdn/gigaset/gigaset.h
+++ b/drivers/isdn/gigaset/gigaset.h
@@ -75,7 +75,7 @@ extern int gigaset_debuglevel; /* "needs" cast to (enum debuglevel) */
75 * e.g. 'insmod usb_gigaset.o debug=0x2c' will set DEBUG_OPEN, DEBUG_CMD and 75 * e.g. 'insmod usb_gigaset.o debug=0x2c' will set DEBUG_OPEN, DEBUG_CMD and
76 * DEBUG_INTR. 76 * DEBUG_INTR.
77 */ 77 */
78enum debuglevel { /* up to 24 bits (atomic_t) */ 78enum debuglevel {
79 DEBUG_REG = 0x0002, /* serial port I/O register operations */ 79 DEBUG_REG = 0x0002, /* serial port I/O register operations */
80 DEBUG_OPEN = 0x0004, /* open/close serial port */ 80 DEBUG_OPEN = 0x0004, /* open/close serial port */
81 DEBUG_INTR = 0x0008, /* interrupt processing */ 81 DEBUG_INTR = 0x0008, /* interrupt processing */
@@ -141,7 +141,7 @@ enum debuglevel { /* up to 24 bits (atomic_t) */
141 printk(KERN_DEBUG KBUILD_MODNAME ": " format "\n", \ 141 printk(KERN_DEBUG KBUILD_MODNAME ": " format "\n", \
142 ## arg); \ 142 ## arg); \
143 } while (0) 143 } while (0)
144#define DEBUG_DEFAULT (DEBUG_INIT | DEBUG_TRANSCMD | DEBUG_CMD | DEBUG_USBREQ) 144#define DEBUG_DEFAULT (DEBUG_TRANSCMD | DEBUG_CMD | DEBUG_USBREQ)
145 145
146#else 146#else
147 147
@@ -627,8 +627,7 @@ struct gigaset_ops {
627 /* Called by gigaset_freecs() for freeing bcs->hw.xxx */ 627 /* Called by gigaset_freecs() for freeing bcs->hw.xxx */
628 int (*freebcshw)(struct bc_state *bcs); 628 int (*freebcshw)(struct bc_state *bcs);
629 629
630 /* Called by gigaset_stop() or gigaset_bchannel_down() for resetting 630 /* Called by gigaset_bchannel_down() for resetting bcs->hw.xxx */
631 bcs->hw.xxx */
632 void (*reinitbcshw)(struct bc_state *bcs); 631 void (*reinitbcshw)(struct bc_state *bcs);
633 632
634 /* Called by gigaset_initcs() for setting up cs->hw.xxx */ 633 /* Called by gigaset_initcs() for setting up cs->hw.xxx */
diff --git a/drivers/isdn/gigaset/i4l.c b/drivers/isdn/gigaset/i4l.c
index 0815dbfb8291..1654fa413575 100644
--- a/drivers/isdn/gigaset/i4l.c
+++ b/drivers/isdn/gigaset/i4l.c
@@ -73,7 +73,7 @@ static int writebuf_from_LL(int driverID, int channel, int ack,
73 len, skblen, (unsigned) skb->head[0], (unsigned) skb->head[1]); 73 len, skblen, (unsigned) skb->head[0], (unsigned) skb->head[1]);
74 74
75 /* pass to device-specific module */ 75 /* pass to device-specific module */
76 return cs->ops->send_skb(bcs, skb); //FIXME cs->ops->send_skb() must handle !cs->connected correctly 76 return cs->ops->send_skb(bcs, skb);
77} 77}
78 78
79void gigaset_skb_sent(struct bc_state *bcs, struct sk_buff *skb) 79void gigaset_skb_sent(struct bc_state *bcs, struct sk_buff *skb)
diff --git a/drivers/isdn/gigaset/isocdata.c b/drivers/isdn/gigaset/isocdata.c
index 45f017ed6e8c..8667daaa1a82 100644
--- a/drivers/isdn/gigaset/isocdata.c
+++ b/drivers/isdn/gigaset/isocdata.c
@@ -992,14 +992,18 @@ int gigaset_isoc_send_skb(struct bc_state *bcs, struct sk_buff *skb)
992 int len = skb->len; 992 int len = skb->len;
993 unsigned long flags; 993 unsigned long flags;
994 994
995 spin_lock_irqsave(&bcs->cs->lock, flags);
996 if (!bcs->cs->connected) {
997 spin_unlock_irqrestore(&bcs->cs->lock, flags);
998 return -ENODEV;
999 }
1000
995 skb_queue_tail(&bcs->squeue, skb); 1001 skb_queue_tail(&bcs->squeue, skb);
996 gig_dbg(DEBUG_ISO, "%s: skb queued, qlen=%d", 1002 gig_dbg(DEBUG_ISO, "%s: skb queued, qlen=%d",
997 __func__, skb_queue_len(&bcs->squeue)); 1003 __func__, skb_queue_len(&bcs->squeue));
998 1004
999 /* tasklet submits URB if necessary */ 1005 /* tasklet submits URB if necessary */
1000 spin_lock_irqsave(&bcs->cs->lock, flags); 1006 tasklet_schedule(&bcs->hw.bas->sent_tasklet);
1001 if (bcs->cs->connected)
1002 tasklet_schedule(&bcs->hw.bas->sent_tasklet);
1003 spin_unlock_irqrestore(&bcs->cs->lock, flags); 1007 spin_unlock_irqrestore(&bcs->cs->lock, flags);
1004 1008
1005 return len; /* ok so far */ 1009 return len; /* ok so far */
diff --git a/drivers/isdn/gigaset/usb-gigaset.c b/drivers/isdn/gigaset/usb-gigaset.c
index bfb73fd5077e..d86ab68114b0 100644
--- a/drivers/isdn/gigaset/usb-gigaset.c
+++ b/drivers/isdn/gigaset/usb-gigaset.c
@@ -710,8 +710,8 @@ static int gigaset_probe(struct usb_interface *interface,
710 retval = -ENODEV; //FIXME 710 retval = -ENODEV; //FIXME
711 711
712 /* See if the device offered us matches what we can accept */ 712 /* See if the device offered us matches what we can accept */
713 if ((le16_to_cpu(udev->descriptor.idVendor != USB_M105_VENDOR_ID)) || 713 if ((le16_to_cpu(udev->descriptor.idVendor) != USB_M105_VENDOR_ID) ||
714 (le16_to_cpu(udev->descriptor.idProduct != USB_M105_PRODUCT_ID))) 714 (le16_to_cpu(udev->descriptor.idProduct) != USB_M105_PRODUCT_ID))
715 return -ENODEV; 715 return -ENODEV;
716 716
717 /* this starts to become ascii art... */ 717 /* this starts to become ascii art... */
diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c
index 3585fb1f3344..2ac90242d263 100644
--- a/drivers/isdn/i4l/isdn_tty.c
+++ b/drivers/isdn/i4l/isdn_tty.c
@@ -2880,7 +2880,7 @@ isdn_tty_cmd_ATand(char **p, modem_info * info)
2880 p[0]++; 2880 p[0]++;
2881 i = 0; 2881 i = 0;
2882 while (*p[0] && (strchr("0123456789,-*[]?;", *p[0])) && 2882 while (*p[0] && (strchr("0123456789,-*[]?;", *p[0])) &&
2883 (i < ISDN_LMSNLEN)) 2883 (i < ISDN_LMSNLEN - 1))
2884 m->lmsn[i++] = *p[0]++; 2884 m->lmsn[i++] = *p[0]++;
2885 m->lmsn[i] = '\0'; 2885 m->lmsn[i] = '\0';
2886 break; 2886 break;
diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
index 3f5b64794542..626506234b76 100644
--- a/drivers/leds/Kconfig
+++ b/drivers/leds/Kconfig
@@ -4,8 +4,11 @@ menu "LED devices"
4config NEW_LEDS 4config NEW_LEDS
5 bool "LED Support" 5 bool "LED Support"
6 help 6 help
7 Say Y to enable Linux LED support. This is not related to standard 7 Say Y to enable Linux LED support. This allows control of supported
8 keyboard LEDs which are controlled via the input system. 8 LEDs from both userspace and optionally, by kernel events (triggers).
9
10 This is not related to standard keyboard LEDs which are controlled
11 via the input system.
9 12
10config LEDS_CLASS 13config LEDS_CLASS
11 tristate "LED Class Support" 14 tristate "LED Class Support"
diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c
index b0b5d05fadd6..c75d0ef1609c 100644
--- a/drivers/leds/led-class.c
+++ b/drivers/leds/led-class.c
@@ -19,6 +19,7 @@
19#include <linux/sysdev.h> 19#include <linux/sysdev.h>
20#include <linux/timer.h> 20#include <linux/timer.h>
21#include <linux/err.h> 21#include <linux/err.h>
22#include <linux/ctype.h>
22#include <linux/leds.h> 23#include <linux/leds.h>
23#include "leds.h" 24#include "leds.h"
24 25
@@ -43,9 +44,13 @@ static ssize_t led_brightness_store(struct class_device *dev,
43 ssize_t ret = -EINVAL; 44 ssize_t ret = -EINVAL;
44 char *after; 45 char *after;
45 unsigned long state = simple_strtoul(buf, &after, 10); 46 unsigned long state = simple_strtoul(buf, &after, 10);
47 size_t count = after - buf;
46 48
47 if (after - buf > 0) { 49 if (*after && isspace(*after))
48 ret = after - buf; 50 count++;
51
52 if (count == size) {
53 ret = count;
49 led_set_brightness(led_cdev, state); 54 led_set_brightness(led_cdev, state);
50 } 55 }
51 56
diff --git a/drivers/leds/ledtrig-timer.c b/drivers/leds/ledtrig-timer.c
index f484b5d6dbf8..fbf141ef46ec 100644
--- a/drivers/leds/ledtrig-timer.c
+++ b/drivers/leds/ledtrig-timer.c
@@ -20,6 +20,7 @@
20#include <linux/device.h> 20#include <linux/device.h>
21#include <linux/sysdev.h> 21#include <linux/sysdev.h>
22#include <linux/timer.h> 22#include <linux/timer.h>
23#include <linux/ctype.h>
23#include <linux/leds.h> 24#include <linux/leds.h>
24#include "leds.h" 25#include "leds.h"
25 26
@@ -69,11 +70,15 @@ static ssize_t led_delay_on_store(struct class_device *dev, const char *buf,
69 int ret = -EINVAL; 70 int ret = -EINVAL;
70 char *after; 71 char *after;
71 unsigned long state = simple_strtoul(buf, &after, 10); 72 unsigned long state = simple_strtoul(buf, &after, 10);
73 size_t count = after - buf;
72 74
73 if (after - buf > 0) { 75 if (*after && isspace(*after))
76 count++;
77
78 if (count == size) {
74 timer_data->delay_on = state; 79 timer_data->delay_on = state;
75 mod_timer(&timer_data->timer, jiffies + 1); 80 mod_timer(&timer_data->timer, jiffies + 1);
76 ret = after - buf; 81 ret = count;
77 } 82 }
78 83
79 return ret; 84 return ret;
@@ -97,11 +102,15 @@ static ssize_t led_delay_off_store(struct class_device *dev, const char *buf,
97 int ret = -EINVAL; 102 int ret = -EINVAL;
98 char *after; 103 char *after;
99 unsigned long state = simple_strtoul(buf, &after, 10); 104 unsigned long state = simple_strtoul(buf, &after, 10);
105 size_t count = after - buf;
106
107 if (*after && isspace(*after))
108 count++;
100 109
101 if (after - buf > 0) { 110 if (count == size) {
102 timer_data->delay_off = state; 111 timer_data->delay_off = state;
103 mod_timer(&timer_data->timer, jiffies + 1); 112 mod_timer(&timer_data->timer, jiffies + 1);
104 ret = after - buf; 113 ret = count;
105 } 114 }
106 115
107 return ret; 116 return ret;
diff --git a/drivers/macintosh/therm_adt746x.c b/drivers/macintosh/therm_adt746x.c
index 5ebfd1d138da..5282fec17075 100644
--- a/drivers/macintosh/therm_adt746x.c
+++ b/drivers/macintosh/therm_adt746x.c
@@ -627,8 +627,8 @@ thermostat_init(void)
627 if(therm_type == ADT7460) 627 if(therm_type == ADT7460)
628 device_create_file(&of_dev->dev, &dev_attr_sensor2_fan_speed); 628 device_create_file(&of_dev->dev, &dev_attr_sensor2_fan_speed);
629 629
630#ifndef CONFIG_I2C_KEYWEST 630#ifndef CONFIG_I2C_POWERMAC
631 request_module("i2c-keywest"); 631 request_module("i2c-powermac");
632#endif 632#endif
633 633
634 return i2c_add_driver(&thermostat_driver); 634 return i2c_add_driver(&thermostat_driver);
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 1ed5152db450..f19b874753a9 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -163,9 +163,19 @@ void md_new_event(mddev_t *mddev)
163{ 163{
164 atomic_inc(&md_event_count); 164 atomic_inc(&md_event_count);
165 wake_up(&md_event_waiters); 165 wake_up(&md_event_waiters);
166 sysfs_notify(&mddev->kobj, NULL, "sync_action");
166} 167}
167EXPORT_SYMBOL_GPL(md_new_event); 168EXPORT_SYMBOL_GPL(md_new_event);
168 169
170/* Alternate version that can be called from interrupts
171 * when calling sysfs_notify isn't needed.
172 */
173void md_new_event_inintr(mddev_t *mddev)
174{
175 atomic_inc(&md_event_count);
176 wake_up(&md_event_waiters);
177}
178
169/* 179/*
170 * Enables to iterate over all existing md arrays 180 * Enables to iterate over all existing md arrays
171 * all_mddevs_lock protects this list. 181 * all_mddevs_lock protects this list.
@@ -278,11 +288,6 @@ static inline int mddev_lock(mddev_t * mddev)
278 return mutex_lock_interruptible(&mddev->reconfig_mutex); 288 return mutex_lock_interruptible(&mddev->reconfig_mutex);
279} 289}
280 290
281static inline void mddev_lock_uninterruptible(mddev_t * mddev)
282{
283 mutex_lock(&mddev->reconfig_mutex);
284}
285
286static inline int mddev_trylock(mddev_t * mddev) 291static inline int mddev_trylock(mddev_t * mddev)
287{ 292{
288 return mutex_trylock(&mddev->reconfig_mutex); 293 return mutex_trylock(&mddev->reconfig_mutex);
@@ -2256,7 +2261,7 @@ action_store(mddev_t *mddev, const char *page, size_t len)
2256 } else { 2261 } else {
2257 if (cmd_match(page, "check")) 2262 if (cmd_match(page, "check"))
2258 set_bit(MD_RECOVERY_CHECK, &mddev->recovery); 2263 set_bit(MD_RECOVERY_CHECK, &mddev->recovery);
2259 else if (cmd_match(page, "repair")) 2264 else if (!cmd_match(page, "repair"))
2260 return -EINVAL; 2265 return -EINVAL;
2261 set_bit(MD_RECOVERY_REQUESTED, &mddev->recovery); 2266 set_bit(MD_RECOVERY_REQUESTED, &mddev->recovery);
2262 set_bit(MD_RECOVERY_SYNC, &mddev->recovery); 2267 set_bit(MD_RECOVERY_SYNC, &mddev->recovery);
@@ -2457,9 +2462,11 @@ md_attr_show(struct kobject *kobj, struct attribute *attr, char *page)
2457 2462
2458 if (!entry->show) 2463 if (!entry->show)
2459 return -EIO; 2464 return -EIO;
2460 mddev_lock(mddev); 2465 rv = mddev_lock(mddev);
2461 rv = entry->show(mddev, page); 2466 if (!rv) {
2462 mddev_unlock(mddev); 2467 rv = entry->show(mddev, page);
2468 mddev_unlock(mddev);
2469 }
2463 return rv; 2470 return rv;
2464} 2471}
2465 2472
@@ -2473,9 +2480,11 @@ md_attr_store(struct kobject *kobj, struct attribute *attr,
2473 2480
2474 if (!entry->store) 2481 if (!entry->store)
2475 return -EIO; 2482 return -EIO;
2476 mddev_lock(mddev); 2483 rv = mddev_lock(mddev);
2477 rv = entry->store(mddev, page, length); 2484 if (!rv) {
2478 mddev_unlock(mddev); 2485 rv = entry->store(mddev, page, length);
2486 mddev_unlock(mddev);
2487 }
2479 return rv; 2488 return rv;
2480} 2489}
2481 2490
@@ -4149,7 +4158,7 @@ void md_error(mddev_t *mddev, mdk_rdev_t *rdev)
4149 set_bit(MD_RECOVERY_INTR, &mddev->recovery); 4158 set_bit(MD_RECOVERY_INTR, &mddev->recovery);
4150 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); 4159 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
4151 md_wakeup_thread(mddev->thread); 4160 md_wakeup_thread(mddev->thread);
4152 md_new_event(mddev); 4161 md_new_event_inintr(mddev);
4153} 4162}
4154 4163
4155/* seq_file implementation /proc/mdstat */ 4164/* seq_file implementation /proc/mdstat */
@@ -4340,8 +4349,9 @@ static int md_seq_show(struct seq_file *seq, void *v)
4340 return 0; 4349 return 0;
4341 } 4350 }
4342 4351
4343 if (mddev_lock(mddev)!=0) 4352 if (mddev_lock(mddev) < 0)
4344 return -EINTR; 4353 return -EINTR;
4354
4345 if (mddev->pers || mddev->raid_disks || !list_empty(&mddev->disks)) { 4355 if (mddev->pers || mddev->raid_disks || !list_empty(&mddev->disks)) {
4346 seq_printf(seq, "%s : %sactive", mdname(mddev), 4356 seq_printf(seq, "%s : %sactive", mdname(mddev),
4347 mddev->pers ? "" : "in"); 4357 mddev->pers ? "" : "in");
@@ -5027,8 +5037,10 @@ static int md_notify_reboot(struct notifier_block *this,
5027 printk(KERN_INFO "md: stopping all md devices.\n"); 5037 printk(KERN_INFO "md: stopping all md devices.\n");
5028 5038
5029 ITERATE_MDDEV(mddev,tmp) 5039 ITERATE_MDDEV(mddev,tmp)
5030 if (mddev_trylock(mddev)) 5040 if (mddev_trylock(mddev)) {
5031 do_md_stop (mddev, 1); 5041 do_md_stop (mddev, 1);
5042 mddev_unlock(mddev);
5043 }
5032 /* 5044 /*
5033 * certain more exotic SCSI devices are known to be 5045 * certain more exotic SCSI devices are known to be
5034 * volatile wrt too early system reboots. While the 5046 * volatile wrt too early system reboots. While the
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c
index 678f4dbbea1d..cb8c6317e4e5 100644
--- a/drivers/md/raid0.c
+++ b/drivers/md/raid0.c
@@ -331,13 +331,14 @@ static int raid0_run (mddev_t *mddev)
331 goto out_free_conf; 331 goto out_free_conf;
332 size = conf->strip_zone[cur].size; 332 size = conf->strip_zone[cur].size;
333 333
334 for (i=0; i< nb_zone; i++) { 334 conf->hash_table[0] = conf->strip_zone + cur;
335 conf->hash_table[i] = conf->strip_zone + cur; 335 for (i=1; i< nb_zone; i++) {
336 while (size <= conf->hash_spacing) { 336 while (size <= conf->hash_spacing) {
337 cur++; 337 cur++;
338 size += conf->strip_zone[cur].size; 338 size += conf->strip_zone[cur].size;
339 } 339 }
340 size -= conf->hash_spacing; 340 size -= conf->hash_spacing;
341 conf->hash_table[i] = conf->strip_zone + cur;
341 } 342 }
342 if (conf->preshift) { 343 if (conf->preshift) {
343 conf->hash_spacing >>= conf->preshift; 344 conf->hash_spacing >>= conf->preshift;
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 6081941de1b3..4070eff6f0f8 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -315,10 +315,11 @@ static int raid1_end_write_request(struct bio *bio, unsigned int bytes_done, int
315 if (r1_bio->bios[mirror] == bio) 315 if (r1_bio->bios[mirror] == bio)
316 break; 316 break;
317 317
318 if (error == -ENOTSUPP && test_bit(R1BIO_Barrier, &r1_bio->state)) { 318 if (error == -EOPNOTSUPP && test_bit(R1BIO_Barrier, &r1_bio->state)) {
319 set_bit(BarriersNotsupp, &conf->mirrors[mirror].rdev->flags); 319 set_bit(BarriersNotsupp, &conf->mirrors[mirror].rdev->flags);
320 set_bit(R1BIO_BarrierRetry, &r1_bio->state); 320 set_bit(R1BIO_BarrierRetry, &r1_bio->state);
321 r1_bio->mddev->barriers_work = 0; 321 r1_bio->mddev->barriers_work = 0;
322 /* Don't rdev_dec_pending in this branch - keep it for the retry */
322 } else { 323 } else {
323 /* 324 /*
324 * this branch is our 'one mirror IO has finished' event handler: 325 * this branch is our 'one mirror IO has finished' event handler:
@@ -365,6 +366,7 @@ static int raid1_end_write_request(struct bio *bio, unsigned int bytes_done, int
365 } 366 }
366 } 367 }
367 } 368 }
369 rdev_dec_pending(conf->mirrors[mirror].rdev, conf->mddev);
368 } 370 }
369 /* 371 /*
370 * 372 *
@@ -374,11 +376,9 @@ static int raid1_end_write_request(struct bio *bio, unsigned int bytes_done, int
374 if (atomic_dec_and_test(&r1_bio->remaining)) { 376 if (atomic_dec_and_test(&r1_bio->remaining)) {
375 if (test_bit(R1BIO_BarrierRetry, &r1_bio->state)) { 377 if (test_bit(R1BIO_BarrierRetry, &r1_bio->state)) {
376 reschedule_retry(r1_bio); 378 reschedule_retry(r1_bio);
377 /* Don't dec_pending yet, we want to hold
378 * the reference over the retry
379 */
380 goto out; 379 goto out;
381 } 380 }
381 /* it really is the end of this request */
382 if (test_bit(R1BIO_BehindIO, &r1_bio->state)) { 382 if (test_bit(R1BIO_BehindIO, &r1_bio->state)) {
383 /* free extra copy of the data pages */ 383 /* free extra copy of the data pages */
384 int i = bio->bi_vcnt; 384 int i = bio->bi_vcnt;
@@ -393,8 +393,6 @@ static int raid1_end_write_request(struct bio *bio, unsigned int bytes_done, int
393 md_write_end(r1_bio->mddev); 393 md_write_end(r1_bio->mddev);
394 raid_end_bio_io(r1_bio); 394 raid_end_bio_io(r1_bio);
395 } 395 }
396
397 rdev_dec_pending(conf->mirrors[mirror].rdev, conf->mddev);
398 out: 396 out:
399 if (to_put) 397 if (to_put)
400 bio_put(to_put); 398 bio_put(to_put);
@@ -753,18 +751,24 @@ static int make_request(request_queue_t *q, struct bio * bio)
753 const int rw = bio_data_dir(bio); 751 const int rw = bio_data_dir(bio);
754 int do_barriers; 752 int do_barriers;
755 753
756 if (unlikely(!mddev->barriers_work && bio_barrier(bio))) {
757 bio_endio(bio, bio->bi_size, -EOPNOTSUPP);
758 return 0;
759 }
760
761 /* 754 /*
762 * Register the new request and wait if the reconstruction 755 * Register the new request and wait if the reconstruction
763 * thread has put up a bar for new requests. 756 * thread has put up a bar for new requests.
764 * Continue immediately if no resync is active currently. 757 * Continue immediately if no resync is active currently.
758 * We test barriers_work *after* md_write_start as md_write_start
759 * may cause the first superblock write, and that will check out
760 * if barriers work.
765 */ 761 */
762
766 md_write_start(mddev, bio); /* wait on superblock update early */ 763 md_write_start(mddev, bio); /* wait on superblock update early */
767 764
765 if (unlikely(!mddev->barriers_work && bio_barrier(bio))) {
766 if (rw == WRITE)
767 md_write_end(mddev);
768 bio_endio(bio, bio->bi_size, -EOPNOTSUPP);
769 return 0;
770 }
771
768 wait_barrier(conf); 772 wait_barrier(conf);
769 773
770 disk_stat_inc(mddev->gendisk, ios[rw]); 774 disk_stat_inc(mddev->gendisk, ios[rw]);
@@ -1404,10 +1408,11 @@ static void raid1d(mddev_t *mddev)
1404 unplug = 1; 1408 unplug = 1;
1405 } else if (test_bit(R1BIO_BarrierRetry, &r1_bio->state)) { 1409 } else if (test_bit(R1BIO_BarrierRetry, &r1_bio->state)) {
1406 /* some requests in the r1bio were BIO_RW_BARRIER 1410 /* some requests in the r1bio were BIO_RW_BARRIER
1407 * requests which failed with -ENOTSUPP. Hohumm.. 1411 * requests which failed with -EOPNOTSUPP. Hohumm..
1408 * Better resubmit without the barrier. 1412 * Better resubmit without the barrier.
1409 * We know which devices to resubmit for, because 1413 * We know which devices to resubmit for, because
1410 * all others have had their bios[] entry cleared. 1414 * all others have had their bios[] entry cleared.
1415 * We already have a nr_pending reference on these rdevs.
1411 */ 1416 */
1412 int i; 1417 int i;
1413 clear_bit(R1BIO_BarrierRetry, &r1_bio->state); 1418 clear_bit(R1BIO_BarrierRetry, &r1_bio->state);
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 617012bc107a..1440935414e6 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -1407,43 +1407,54 @@ static void raid10d(mddev_t *mddev)
1407 if (s > (PAGE_SIZE>>9)) 1407 if (s > (PAGE_SIZE>>9))
1408 s = PAGE_SIZE >> 9; 1408 s = PAGE_SIZE >> 9;
1409 1409
1410 rcu_read_lock();
1410 do { 1411 do {
1411 int d = r10_bio->devs[sl].devnum; 1412 int d = r10_bio->devs[sl].devnum;
1412 rdev = conf->mirrors[d].rdev; 1413 rdev = rcu_dereference(conf->mirrors[d].rdev);
1413 if (rdev && 1414 if (rdev &&
1414 test_bit(In_sync, &rdev->flags) && 1415 test_bit(In_sync, &rdev->flags)) {
1415 sync_page_io(rdev->bdev, 1416 atomic_inc(&rdev->nr_pending);
1416 r10_bio->devs[sl].addr + 1417 rcu_read_unlock();
1417 sect + rdev->data_offset, 1418 success = sync_page_io(rdev->bdev,
1418 s<<9, 1419 r10_bio->devs[sl].addr +
1419 conf->tmppage, READ)) 1420 sect + rdev->data_offset,
1420 success = 1; 1421 s<<9,
1421 else { 1422 conf->tmppage, READ);
1422 sl++; 1423 rdev_dec_pending(rdev, mddev);
1423 if (sl == conf->copies) 1424 rcu_read_lock();
1424 sl = 0; 1425 if (success)
1426 break;
1425 } 1427 }
1428 sl++;
1429 if (sl == conf->copies)
1430 sl = 0;
1426 } while (!success && sl != r10_bio->read_slot); 1431 } while (!success && sl != r10_bio->read_slot);
1432 rcu_read_unlock();
1427 1433
1428 if (success) { 1434 if (success) {
1429 int start = sl; 1435 int start = sl;
1430 /* write it back and re-read */ 1436 /* write it back and re-read */
1437 rcu_read_lock();
1431 while (sl != r10_bio->read_slot) { 1438 while (sl != r10_bio->read_slot) {
1432 int d; 1439 int d;
1433 if (sl==0) 1440 if (sl==0)
1434 sl = conf->copies; 1441 sl = conf->copies;
1435 sl--; 1442 sl--;
1436 d = r10_bio->devs[sl].devnum; 1443 d = r10_bio->devs[sl].devnum;
1437 rdev = conf->mirrors[d].rdev; 1444 rdev = rcu_dereference(conf->mirrors[d].rdev);
1438 atomic_add(s, &rdev->corrected_errors);
1439 if (rdev && 1445 if (rdev &&
1440 test_bit(In_sync, &rdev->flags)) { 1446 test_bit(In_sync, &rdev->flags)) {
1447 atomic_inc(&rdev->nr_pending);
1448 rcu_read_unlock();
1449 atomic_add(s, &rdev->corrected_errors);
1441 if (sync_page_io(rdev->bdev, 1450 if (sync_page_io(rdev->bdev,
1442 r10_bio->devs[sl].addr + 1451 r10_bio->devs[sl].addr +
1443 sect + rdev->data_offset, 1452 sect + rdev->data_offset,
1444 s<<9, conf->tmppage, WRITE) == 0) 1453 s<<9, conf->tmppage, WRITE) == 0)
1445 /* Well, this device is dead */ 1454 /* Well, this device is dead */
1446 md_error(mddev, rdev); 1455 md_error(mddev, rdev);
1456 rdev_dec_pending(rdev, mddev);
1457 rcu_read_lock();
1447 } 1458 }
1448 } 1459 }
1449 sl = start; 1460 sl = start;
@@ -1453,17 +1464,22 @@ static void raid10d(mddev_t *mddev)
1453 sl = conf->copies; 1464 sl = conf->copies;
1454 sl--; 1465 sl--;
1455 d = r10_bio->devs[sl].devnum; 1466 d = r10_bio->devs[sl].devnum;
1456 rdev = conf->mirrors[d].rdev; 1467 rdev = rcu_dereference(conf->mirrors[d].rdev);
1457 if (rdev && 1468 if (rdev &&
1458 test_bit(In_sync, &rdev->flags)) { 1469 test_bit(In_sync, &rdev->flags)) {
1470 atomic_inc(&rdev->nr_pending);
1471 rcu_read_unlock();
1459 if (sync_page_io(rdev->bdev, 1472 if (sync_page_io(rdev->bdev,
1460 r10_bio->devs[sl].addr + 1473 r10_bio->devs[sl].addr +
1461 sect + rdev->data_offset, 1474 sect + rdev->data_offset,
1462 s<<9, conf->tmppage, READ) == 0) 1475 s<<9, conf->tmppage, READ) == 0)
1463 /* Well, this device is dead */ 1476 /* Well, this device is dead */
1464 md_error(mddev, rdev); 1477 md_error(mddev, rdev);
1478 rdev_dec_pending(rdev, mddev);
1479 rcu_read_lock();
1465 } 1480 }
1466 } 1481 }
1482 rcu_read_unlock();
1467 } else { 1483 } else {
1468 /* Cannot read from anywhere -- bye bye array */ 1484 /* Cannot read from anywhere -- bye bye array */
1469 md_error(mddev, conf->mirrors[r10_bio->devs[r10_bio->read_slot].devnum].rdev); 1485 md_error(mddev, conf->mirrors[r10_bio->devs[r10_bio->read_slot].devnum].rdev);
diff --git a/drivers/media/Kconfig b/drivers/media/Kconfig
index fffc711c260c..344d83aae3ec 100644
--- a/drivers/media/Kconfig
+++ b/drivers/media/Kconfig
@@ -8,22 +8,54 @@ config VIDEO_DEV
8 tristate "Video For Linux" 8 tristate "Video For Linux"
9 ---help--- 9 ---help---
10 Support for audio/video capture and overlay devices and FM radio 10 Support for audio/video capture and overlay devices and FM radio
11 cards. The exact capabilities of each device vary. User tools for 11 cards. The exact capabilities of each device vary.
12 this are available from
13 <ftp://ftp.uk.linux.org/pub/linux/video4linux/>.
14 12
15 This kernel includes support for the new Video for Linux Two API, 13 This kernel includes support for the new Video for Linux Two API,
16 (V4L2) as well as the original system. Drivers and applications 14 (V4L2) as well as the original system. Drivers and applications
17 need to be rewritten to use V4L2, but drivers for popular cards 15 need to be rewritten to use V4L2, but drivers for popular cards
18 and applications for most video capture functions already exist. 16 and applications for most video capture functions already exist.
19 17
20 Documentation for the original API is included in the file 18 Additional info and docs are available on the web at
21 <file:Documentation/video4linux/API.html>. Documentation for V4L2 is 19 <http://linuxtv.org>
22 available on the web at <http://bytesex.org/v4l/>. 20
21 Documentation for V4L2 is also available on the web at
22 <http://bytesex.org/v4l/>.
23 23
24 To compile this driver as a module, choose M here: the 24 To compile this driver as a module, choose M here: the
25 module will be called videodev. 25 module will be called videodev.
26 26
27config VIDEO_V4L1
28 boolean "Enable Video For Linux API 1 (DEPRECATED)"
29 depends on VIDEO_DEV
30 select VIDEO_V4L1_COMPAT
31 default y
32 ---help---
33 Enables a compatibility API used by most V4L2 devices to allow
34 its usage with legacy applications that supports only V4L1 api.
35
36 If you are unsure as to whether this is required, answer Y.
37
38config VIDEO_V4L1_COMPAT
39 boolean "Enable Video For Linux API 1 compatible Layer"
40 depends on VIDEO_DEV
41 default y
42 ---help---
43 This api were developed to be used at Kernel 2.2 and 2.4, but
44 lacks support for several video standards. There are several
45 drivers at kernel that still depends on it.
46
47 Documentation for the original API is included in the file
48 <Documentation/video4linux/API.html>.
49
50 User tools for this are available from
51 <ftp://ftp.uk.linux.org/pub/linux/video4linux/>.
52
53 If you are unsure as to whether this is required, answer Y.
54
55config VIDEO_V4L2
56 tristate
57 default y
58
27source "drivers/media/video/Kconfig" 59source "drivers/media/video/Kconfig"
28 60
29source "drivers/media/radio/Kconfig" 61source "drivers/media/radio/Kconfig"
@@ -65,4 +97,3 @@ config USB_DABUSB
65 module will be called dabusb. 97 module will be called dabusb.
66 98
67endmenu 99endmenu
68
diff --git a/drivers/media/common/Kconfig b/drivers/media/common/Kconfig
index 6a901a0268e1..1a04db4552da 100644
--- a/drivers/media/common/Kconfig
+++ b/drivers/media/common/Kconfig
@@ -1,9 +1,10 @@
1config VIDEO_SAA7146 1config VIDEO_SAA7146
2 tristate 2 tristate
3 select I2C 3 depends on I2C
4 4
5config VIDEO_SAA7146_VV 5config VIDEO_SAA7146_VV
6 tristate 6 tristate
7 select VIDEO_V4L2
7 select VIDEO_BUF 8 select VIDEO_BUF
8 select VIDEO_VIDEOBUF 9 select VIDEO_VIDEOBUF
9 select VIDEO_SAA7146 10 select VIDEO_SAA7146
diff --git a/drivers/media/dvb/Kconfig b/drivers/media/dvb/Kconfig
index 3f0ec6be03ae..a97c8f5e9a5d 100644
--- a/drivers/media/dvb/Kconfig
+++ b/drivers/media/dvb/Kconfig
@@ -22,26 +22,26 @@ config DVB
22source "drivers/media/dvb/dvb-core/Kconfig" 22source "drivers/media/dvb/dvb-core/Kconfig"
23 23
24comment "Supported SAA7146 based PCI Adapters" 24comment "Supported SAA7146 based PCI Adapters"
25 depends on DVB_CORE && PCI 25 depends on DVB_CORE && PCI && I2C
26source "drivers/media/dvb/ttpci/Kconfig" 26source "drivers/media/dvb/ttpci/Kconfig"
27 27
28comment "Supported USB Adapters" 28comment "Supported USB Adapters"
29 depends on DVB_CORE && USB 29 depends on DVB_CORE && USB && I2C
30source "drivers/media/dvb/dvb-usb/Kconfig" 30source "drivers/media/dvb/dvb-usb/Kconfig"
31source "drivers/media/dvb/ttusb-budget/Kconfig" 31source "drivers/media/dvb/ttusb-budget/Kconfig"
32source "drivers/media/dvb/ttusb-dec/Kconfig" 32source "drivers/media/dvb/ttusb-dec/Kconfig"
33source "drivers/media/dvb/cinergyT2/Kconfig" 33source "drivers/media/dvb/cinergyT2/Kconfig"
34 34
35comment "Supported FlexCopII (B2C2) Adapters" 35comment "Supported FlexCopII (B2C2) Adapters"
36 depends on DVB_CORE && (PCI || USB) 36 depends on DVB_CORE && (PCI || USB) && I2C
37source "drivers/media/dvb/b2c2/Kconfig" 37source "drivers/media/dvb/b2c2/Kconfig"
38 38
39comment "Supported BT878 Adapters" 39comment "Supported BT878 Adapters"
40 depends on DVB_CORE && PCI 40 depends on DVB_CORE && PCI && I2C
41source "drivers/media/dvb/bt8xx/Kconfig" 41source "drivers/media/dvb/bt8xx/Kconfig"
42 42
43comment "Supported Pluto2 Adapters" 43comment "Supported Pluto2 Adapters"
44 depends on DVB_CORE && PCI 44 depends on DVB_CORE && PCI && I2C
45source "drivers/media/dvb/pluto2/Kconfig" 45source "drivers/media/dvb/pluto2/Kconfig"
46 46
47comment "Supported DVB Frontends" 47comment "Supported DVB Frontends"
diff --git a/drivers/media/dvb/b2c2/Kconfig b/drivers/media/dvb/b2c2/Kconfig
index 2963605c0ecc..d7f1fd5b7b02 100644
--- a/drivers/media/dvb/b2c2/Kconfig
+++ b/drivers/media/dvb/b2c2/Kconfig
@@ -1,6 +1,6 @@
1config DVB_B2C2_FLEXCOP 1config DVB_B2C2_FLEXCOP
2 tristate "Technisat/B2C2 FlexCopII(b) and FlexCopIII adapters" 2 tristate "Technisat/B2C2 FlexCopII(b) and FlexCopIII adapters"
3 depends on DVB_CORE 3 depends on DVB_CORE && I2C
4 select DVB_STV0299 4 select DVB_STV0299
5 select DVB_MT352 5 select DVB_MT352
6 select DVB_MT312 6 select DVB_MT312
@@ -16,7 +16,7 @@ config DVB_B2C2_FLEXCOP
16 16
17config DVB_B2C2_FLEXCOP_PCI 17config DVB_B2C2_FLEXCOP_PCI
18 tristate "Technisat/B2C2 Air/Sky/Cable2PC PCI" 18 tristate "Technisat/B2C2 Air/Sky/Cable2PC PCI"
19 depends on DVB_B2C2_FLEXCOP && PCI 19 depends on DVB_B2C2_FLEXCOP && PCI && I2C
20 help 20 help
21 Support for the Air/Sky/CableStar2 PCI card (DVB/ATSC) by Technisat/B2C2. 21 Support for the Air/Sky/CableStar2 PCI card (DVB/ATSC) by Technisat/B2C2.
22 22
@@ -24,7 +24,7 @@ config DVB_B2C2_FLEXCOP_PCI
24 24
25config DVB_B2C2_FLEXCOP_USB 25config DVB_B2C2_FLEXCOP_USB
26 tristate "Technisat/B2C2 Air/Sky/Cable2PC USB" 26 tristate "Technisat/B2C2 Air/Sky/Cable2PC USB"
27 depends on DVB_B2C2_FLEXCOP && USB 27 depends on DVB_B2C2_FLEXCOP && USB && I2C
28 help 28 help
29 Support for the Air/Sky/Cable2PC USB1.1 box (DVB/ATSC) by Technisat/B2C2, 29 Support for the Air/Sky/Cable2PC USB1.1 box (DVB/ATSC) by Technisat/B2C2,
30 30
diff --git a/drivers/media/dvb/bt8xx/Kconfig b/drivers/media/dvb/bt8xx/Kconfig
index 376ca48f1d1d..f394002118f8 100644
--- a/drivers/media/dvb/bt8xx/Kconfig
+++ b/drivers/media/dvb/bt8xx/Kconfig
@@ -1,12 +1,13 @@
1config DVB_BT8XX 1config DVB_BT8XX
2 tristate "BT8xx based PCI cards" 2 tristate "BT8xx based PCI cards"
3 depends on DVB_CORE && PCI && VIDEO_BT848 3 depends on DVB_CORE && PCI && I2C && VIDEO_BT848
4 select DVB_MT352 4 select DVB_MT352
5 select DVB_SP887X 5 select DVB_SP887X
6 select DVB_NXT6000 6 select DVB_NXT6000
7 select DVB_CX24110 7 select DVB_CX24110
8 select DVB_OR51211 8 select DVB_OR51211
9 select DVB_LGDT330X 9 select DVB_LGDT330X
10 select DVB_ZL10353
10 select FW_LOADER 11 select FW_LOADER
11 help 12 help
12 Support for PCI cards based on the Bt8xx PCI bridge. Examples are 13 Support for PCI cards based on the Bt8xx PCI bridge. Examples are
diff --git a/drivers/media/dvb/bt8xx/dvb-bt8xx.c b/drivers/media/dvb/bt8xx/dvb-bt8xx.c
index baa8227ef87c..ccc7b2eb4a2d 100644
--- a/drivers/media/dvb/bt8xx/dvb-bt8xx.c
+++ b/drivers/media/dvb/bt8xx/dvb-bt8xx.c
@@ -115,7 +115,7 @@ static int is_pci_slot_eq(struct pci_dev* adev, struct pci_dev* bdev)
115 return 0; 115 return 0;
116} 116}
117 117
118static struct bt878 __init *dvb_bt8xx_878_match(unsigned int bttv_nr, struct pci_dev* bttv_pci_dev) 118static struct bt878 __devinit *dvb_bt8xx_878_match(unsigned int bttv_nr, struct pci_dev* bttv_pci_dev)
119{ 119{
120 unsigned int card_nr; 120 unsigned int card_nr;
121 121
@@ -709,7 +709,7 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type)
709 } 709 }
710} 710}
711 711
712static int __init dvb_bt8xx_load_card(struct dvb_bt8xx_card *card, u32 type) 712static int __devinit dvb_bt8xx_load_card(struct dvb_bt8xx_card *card, u32 type)
713{ 713{
714 int result; 714 int result;
715 715
@@ -794,7 +794,7 @@ static int __init dvb_bt8xx_load_card(struct dvb_bt8xx_card *card, u32 type)
794 return 0; 794 return 0;
795} 795}
796 796
797static int dvb_bt8xx_probe(struct bttv_sub_device *sub) 797static int __devinit dvb_bt8xx_probe(struct bttv_sub_device *sub)
798{ 798{
799 struct dvb_bt8xx_card *card; 799 struct dvb_bt8xx_card *card;
800 struct pci_dev* bttv_pci_dev; 800 struct pci_dev* bttv_pci_dev;
diff --git a/drivers/media/dvb/cinergyT2/cinergyT2.c b/drivers/media/dvb/cinergyT2/cinergyT2.c
index 71b575dc22bd..9325d039ea65 100644
--- a/drivers/media/dvb/cinergyT2/cinergyT2.c
+++ b/drivers/media/dvb/cinergyT2/cinergyT2.c
@@ -902,7 +902,10 @@ static int cinergyt2_probe (struct usb_interface *intf,
902 return -ENOMEM; 902 return -ENOMEM;
903 } 903 }
904 904
905 dvb_register_adapter(&cinergyt2->adapter, DRIVER_NAME, THIS_MODULE); 905 if ((err = dvb_register_adapter(&cinergyt2->adapter, DRIVER_NAME, THIS_MODULE)) < 0) {
906 kfree(cinergyt2);
907 return err;
908 }
906 909
907 cinergyt2->demux.priv = cinergyt2; 910 cinergyt2->demux.priv = cinergyt2;
908 cinergyt2->demux.filternum = 256; 911 cinergyt2->demux.filternum = 256;
diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c
index 4f8f257e6795..a051790161b0 100644
--- a/drivers/media/dvb/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb/dvb-core/dvb_frontend.c
@@ -106,6 +106,8 @@ struct dvb_frontend_private {
106 unsigned long tune_mode_flags; 106 unsigned long tune_mode_flags;
107 unsigned int delay; 107 unsigned int delay;
108 unsigned int reinitialise; 108 unsigned int reinitialise;
109 int tone;
110 int voltage;
109 111
110 /* swzigzag values */ 112 /* swzigzag values */
111 unsigned int state; 113 unsigned int state;
@@ -537,6 +539,12 @@ static int dvb_frontend_thread(void *data)
537 539
538 if (fepriv->reinitialise) { 540 if (fepriv->reinitialise) {
539 dvb_frontend_init(fe); 541 dvb_frontend_init(fe);
542 if (fepriv->tone != -1) {
543 fe->ops->set_tone(fe, fepriv->tone);
544 }
545 if (fepriv->voltage != -1) {
546 fe->ops->set_voltage(fe, fepriv->voltage);
547 }
540 fepriv->reinitialise = 0; 548 fepriv->reinitialise = 0;
541 } 549 }
542 550
@@ -788,6 +796,7 @@ static int dvb_frontend_ioctl(struct inode *inode, struct file *file,
788 case FE_SET_TONE: 796 case FE_SET_TONE:
789 if (fe->ops->set_tone) { 797 if (fe->ops->set_tone) {
790 err = fe->ops->set_tone(fe, (fe_sec_tone_mode_t) parg); 798 err = fe->ops->set_tone(fe, (fe_sec_tone_mode_t) parg);
799 fepriv->tone = (fe_sec_tone_mode_t) parg;
791 fepriv->state = FESTATE_DISEQC; 800 fepriv->state = FESTATE_DISEQC;
792 fepriv->status = 0; 801 fepriv->status = 0;
793 } 802 }
@@ -796,6 +805,7 @@ static int dvb_frontend_ioctl(struct inode *inode, struct file *file,
796 case FE_SET_VOLTAGE: 805 case FE_SET_VOLTAGE:
797 if (fe->ops->set_voltage) { 806 if (fe->ops->set_voltage) {
798 err = fe->ops->set_voltage(fe, (fe_sec_voltage_t) parg); 807 err = fe->ops->set_voltage(fe, (fe_sec_voltage_t) parg);
808 fepriv->voltage = (fe_sec_voltage_t) parg;
799 fepriv->state = FESTATE_DISEQC; 809 fepriv->state = FESTATE_DISEQC;
800 fepriv->status = 0; 810 fepriv->status = 0;
801 } 811 }
@@ -995,6 +1005,8 @@ static int dvb_frontend_open(struct inode *inode, struct file *file)
995 1005
996 /* normal tune mode when opened R/W */ 1006 /* normal tune mode when opened R/W */
997 fepriv->tune_mode_flags &= ~FE_TUNE_MODE_ONESHOT; 1007 fepriv->tune_mode_flags &= ~FE_TUNE_MODE_ONESHOT;
1008 fepriv->tone = -1;
1009 fepriv->voltage = -1;
998 } 1010 }
999 1011
1000 return ret; 1012 return ret;
diff --git a/drivers/media/dvb/dvb-core/dvbdev.c b/drivers/media/dvb/dvb-core/dvbdev.c
index 96fe0ecae250..3852430d0260 100644
--- a/drivers/media/dvb/dvb-core/dvbdev.c
+++ b/drivers/media/dvb/dvb-core/dvbdev.c
@@ -219,8 +219,6 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev,
219 return -ENOMEM; 219 return -ENOMEM;
220 } 220 }
221 221
222 mutex_unlock(&dvbdev_register_lock);
223
224 memcpy(dvbdev, template, sizeof(struct dvb_device)); 222 memcpy(dvbdev, template, sizeof(struct dvb_device));
225 dvbdev->type = type; 223 dvbdev->type = type;
226 dvbdev->id = id; 224 dvbdev->id = id;
@@ -231,6 +229,8 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev,
231 229
232 list_add_tail (&dvbdev->list_head, &adap->device_list); 230 list_add_tail (&dvbdev->list_head, &adap->device_list);
233 231
232 mutex_unlock(&dvbdev_register_lock);
233
234 devfs_mk_cdev(MKDEV(DVB_MAJOR, nums2minor(adap->num, type, id)), 234 devfs_mk_cdev(MKDEV(DVB_MAJOR, nums2minor(adap->num, type, id)),
235 S_IFCHR | S_IRUSR | S_IWUSR, 235 S_IFCHR | S_IRUSR | S_IWUSR,
236 "dvb/adapter%d/%s%d", adap->num, dnames[type], id); 236 "dvb/adapter%d/%s%d", adap->num, dnames[type], id);
diff --git a/drivers/media/dvb/dvb-usb/Kconfig b/drivers/media/dvb/dvb-usb/Kconfig
index d3df12039b06..e388fb1567d6 100644
--- a/drivers/media/dvb/dvb-usb/Kconfig
+++ b/drivers/media/dvb/dvb-usb/Kconfig
@@ -1,6 +1,6 @@
1config DVB_USB 1config DVB_USB
2 tristate "Support for various USB DVB devices" 2 tristate "Support for various USB DVB devices"
3 depends on DVB_CORE && USB 3 depends on DVB_CORE && USB && I2C
4 select FW_LOADER 4 select FW_LOADER
5 help 5 help
6 By enabling this you will be able to choose the various supported 6 By enabling this you will be able to choose the various supported
diff --git a/drivers/media/dvb/dvb-usb/cxusb.c b/drivers/media/dvb/dvb-usb/cxusb.c
index 7edd6362b9cc..1f0d3e995c8d 100644
--- a/drivers/media/dvb/dvb-usb/cxusb.c
+++ b/drivers/media/dvb/dvb-usb/cxusb.c
@@ -150,6 +150,15 @@ static int cxusb_power_ctrl(struct dvb_usb_device *d, int onoff)
150 return cxusb_ctrl_msg(d, CMD_POWER_OFF, &b, 1, NULL, 0); 150 return cxusb_ctrl_msg(d, CMD_POWER_OFF, &b, 1, NULL, 0);
151} 151}
152 152
153static int cxusb_bluebird_power_ctrl(struct dvb_usb_device *d, int onoff)
154{
155 u8 b = 0;
156 if (onoff)
157 return cxusb_ctrl_msg(d, CMD_POWER_ON, &b, 1, NULL, 0);
158 else
159 return 0;
160}
161
153static int cxusb_streaming_ctrl(struct dvb_usb_device *d, int onoff) 162static int cxusb_streaming_ctrl(struct dvb_usb_device *d, int onoff)
154{ 163{
155 u8 buf[2] = { 0x03, 0x00 }; 164 u8 buf[2] = { 0x03, 0x00 };
@@ -544,7 +553,7 @@ static struct dvb_usb_properties cxusb_bluebird_lgh064f_properties = {
544 .size_of_priv = sizeof(struct cxusb_state), 553 .size_of_priv = sizeof(struct cxusb_state),
545 554
546 .streaming_ctrl = cxusb_streaming_ctrl, 555 .streaming_ctrl = cxusb_streaming_ctrl,
547 .power_ctrl = cxusb_power_ctrl, 556 .power_ctrl = cxusb_bluebird_power_ctrl,
548 .frontend_attach = cxusb_lgdt3303_frontend_attach, 557 .frontend_attach = cxusb_lgdt3303_frontend_attach,
549 .tuner_attach = cxusb_lgh064f_tuner_attach, 558 .tuner_attach = cxusb_lgh064f_tuner_attach,
550 559
@@ -589,7 +598,7 @@ static struct dvb_usb_properties cxusb_bluebird_dee1601_properties = {
589 .size_of_priv = sizeof(struct cxusb_state), 598 .size_of_priv = sizeof(struct cxusb_state),
590 599
591 .streaming_ctrl = cxusb_streaming_ctrl, 600 .streaming_ctrl = cxusb_streaming_ctrl,
592 .power_ctrl = cxusb_power_ctrl, 601 .power_ctrl = cxusb_bluebird_power_ctrl,
593 .frontend_attach = cxusb_dee1601_frontend_attach, 602 .frontend_attach = cxusb_dee1601_frontend_attach,
594 .tuner_attach = cxusb_dee1601_tuner_attach, 603 .tuner_attach = cxusb_dee1601_tuner_attach,
595 604
@@ -638,7 +647,7 @@ static struct dvb_usb_properties cxusb_bluebird_lgz201_properties = {
638 .size_of_priv = sizeof(struct cxusb_state), 647 .size_of_priv = sizeof(struct cxusb_state),
639 648
640 .streaming_ctrl = cxusb_streaming_ctrl, 649 .streaming_ctrl = cxusb_streaming_ctrl,
641 .power_ctrl = cxusb_power_ctrl, 650 .power_ctrl = cxusb_bluebird_power_ctrl,
642 .frontend_attach = cxusb_mt352_frontend_attach, 651 .frontend_attach = cxusb_mt352_frontend_attach,
643 .tuner_attach = cxusb_lgz201_tuner_attach, 652 .tuner_attach = cxusb_lgz201_tuner_attach,
644 653
@@ -683,7 +692,7 @@ static struct dvb_usb_properties cxusb_bluebird_dtt7579_properties = {
683 .size_of_priv = sizeof(struct cxusb_state), 692 .size_of_priv = sizeof(struct cxusb_state),
684 693
685 .streaming_ctrl = cxusb_streaming_ctrl, 694 .streaming_ctrl = cxusb_streaming_ctrl,
686 .power_ctrl = cxusb_power_ctrl, 695 .power_ctrl = cxusb_bluebird_power_ctrl,
687 .frontend_attach = cxusb_mt352_frontend_attach, 696 .frontend_attach = cxusb_mt352_frontend_attach,
688 .tuner_attach = cxusb_dtt7579_tuner_attach, 697 .tuner_attach = cxusb_dtt7579_tuner_attach,
689 698
diff --git a/drivers/media/dvb/frontends/cx24123.c b/drivers/media/dvb/frontends/cx24123.c
index d661c6f9cbe5..691dc840dcc0 100644
--- a/drivers/media/dvb/frontends/cx24123.c
+++ b/drivers/media/dvb/frontends/cx24123.c
@@ -29,6 +29,9 @@
29#include "dvb_frontend.h" 29#include "dvb_frontend.h"
30#include "cx24123.h" 30#include "cx24123.h"
31 31
32#define XTAL 10111000
33
34static int force_band;
32static int debug; 35static int debug;
33#define dprintk(args...) \ 36#define dprintk(args...) \
34 do { \ 37 do { \
@@ -52,6 +55,7 @@ struct cx24123_state
52 u32 VGAarg; 55 u32 VGAarg;
53 u32 bandselectarg; 56 u32 bandselectarg;
54 u32 pllarg; 57 u32 pllarg;
58 u32 FILTune;
55 59
56 /* The Demod/Tuner can't easily provide these, we cache them */ 60 /* The Demod/Tuner can't easily provide these, we cache them */
57 u32 currentfreq; 61 u32 currentfreq;
@@ -63,43 +67,33 @@ static struct
63{ 67{
64 u32 symbolrate_low; 68 u32 symbolrate_low;
65 u32 symbolrate_high; 69 u32 symbolrate_high;
66 u32 VCAslope;
67 u32 VCAoffset;
68 u32 VGA1offset;
69 u32 VGA2offset;
70 u32 VCAprogdata; 70 u32 VCAprogdata;
71 u32 VGAprogdata; 71 u32 VGAprogdata;
72 u32 FILTune;
72} cx24123_AGC_vals[] = 73} cx24123_AGC_vals[] =
73{ 74{
74 { 75 {
75 .symbolrate_low = 1000000, 76 .symbolrate_low = 1000000,
76 .symbolrate_high = 4999999, 77 .symbolrate_high = 4999999,
77 .VCAslope = 0x07, 78 /* the specs recommend other values for VGA offsets,
78 .VCAoffset = 0x0f, 79 but tests show they are wrong */
79 .VGA1offset = 0x1f8, 80 .VGAprogdata = (1 << 19) | (0x180 << 9) | 0x1e0,
80 .VGA2offset = 0x1f8, 81 .VCAprogdata = (2 << 19) | (0x07 << 9) | 0x07,
81 .VGAprogdata = (2 << 18) | (0x1f8 << 9) | 0x1f8, 82 .FILTune = 0x27f /* 0.41 V */
82 .VCAprogdata = (4 << 18) | (0x07 << 9) | 0x07,
83 }, 83 },
84 { 84 {
85 .symbolrate_low = 5000000, 85 .symbolrate_low = 5000000,
86 .symbolrate_high = 14999999, 86 .symbolrate_high = 14999999,
87 .VCAslope = 0x1f, 87 .VGAprogdata = (1 << 19) | (0x180 << 9) | 0x1e0,
88 .VCAoffset = 0x1f, 88 .VCAprogdata = (2 << 19) | (0x07 << 9) | 0x1f,
89 .VGA1offset = 0x1e0, 89 .FILTune = 0x317 /* 0.90 V */
90 .VGA2offset = 0x180,
91 .VGAprogdata = (2 << 18) | (0x180 << 9) | 0x1e0,
92 .VCAprogdata = (4 << 18) | (0x07 << 9) | 0x1f,
93 }, 90 },
94 { 91 {
95 .symbolrate_low = 15000000, 92 .symbolrate_low = 15000000,
96 .symbolrate_high = 45000000, 93 .symbolrate_high = 45000000,
97 .VCAslope = 0x3f, 94 .VGAprogdata = (1 << 19) | (0x100 << 9) | 0x180,
98 .VCAoffset = 0x3f, 95 .VCAprogdata = (2 << 19) | (0x07 << 9) | 0x3f,
99 .VGA1offset = 0x180, 96 .FILTune = 0x145 /* 2.70 V */
100 .VGA2offset = 0x100,
101 .VGAprogdata = (2 << 18) | (0x100 << 9) | 0x180,
102 .VCAprogdata = (4 << 18) | (0x07 << 9) | 0x3f,
103 }, 97 },
104}; 98};
105 99
@@ -112,91 +106,80 @@ static struct
112{ 106{
113 u32 freq_low; 107 u32 freq_low;
114 u32 freq_high; 108 u32 freq_high;
115 u32 bandselect;
116 u32 VCOdivider; 109 u32 VCOdivider;
117 u32 VCOnumber;
118 u32 progdata; 110 u32 progdata;
119} cx24123_bandselect_vals[] = 111} cx24123_bandselect_vals[] =
120{ 112{
113 /* band 1 */
121 { 114 {
122 .freq_low = 950000, 115 .freq_low = 950000,
123 .freq_high = 1018999,
124 .bandselect = 0x40,
125 .VCOdivider = 4,
126 .VCOnumber = 7,
127 .progdata = (0 << 18) | (0 << 9) | 0x40,
128 },
129 {
130 .freq_low = 1019000,
131 .freq_high = 1074999, 116 .freq_high = 1074999,
132 .bandselect = 0x80,
133 .VCOdivider = 4, 117 .VCOdivider = 4,
134 .VCOnumber = 8, 118 .progdata = (0 << 19) | (0 << 9) | 0x40,
135 .progdata = (0 << 18) | (0 << 9) | 0x80,
136 }, 119 },
120
121 /* band 2 */
137 { 122 {
138 .freq_low = 1075000, 123 .freq_low = 1075000,
139 .freq_high = 1227999, 124 .freq_high = 1177999,
140 .bandselect = 0x01, 125 .VCOdivider = 4,
141 .VCOdivider = 2, 126 .progdata = (0 << 19) | (0 << 9) | 0x80,
142 .VCOnumber = 1,
143 .progdata = (0 << 18) | (1 << 9) | 0x01,
144 }, 127 },
128
129 /* band 3 */
145 { 130 {
146 .freq_low = 1228000, 131 .freq_low = 1178000,
147 .freq_high = 1349999, 132 .freq_high = 1295999,
148 .bandselect = 0x02,
149 .VCOdivider = 2, 133 .VCOdivider = 2,
150 .VCOnumber = 2, 134 .progdata = (0 << 19) | (1 << 9) | 0x01,
151 .progdata = (0 << 18) | (1 << 9) | 0x02,
152 }, 135 },
136
137 /* band 4 */
153 { 138 {
154 .freq_low = 1350000, 139 .freq_low = 1296000,
155 .freq_high = 1481999, 140 .freq_high = 1431999,
156 .bandselect = 0x04,
157 .VCOdivider = 2, 141 .VCOdivider = 2,
158 .VCOnumber = 3, 142 .progdata = (0 << 19) | (1 << 9) | 0x02,
159 .progdata = (0 << 18) | (1 << 9) | 0x04,
160 }, 143 },
144
145 /* band 5 */
161 { 146 {
162 .freq_low = 1482000, 147 .freq_low = 1432000,
163 .freq_high = 1595999, 148 .freq_high = 1575999,
164 .bandselect = 0x08,
165 .VCOdivider = 2, 149 .VCOdivider = 2,
166 .VCOnumber = 4, 150 .progdata = (0 << 19) | (1 << 9) | 0x04,
167 .progdata = (0 << 18) | (1 << 9) | 0x08,
168 }, 151 },
152
153 /* band 6 */
169 { 154 {
170 .freq_low = 1596000, 155 .freq_low = 1576000,
171 .freq_high = 1717999, 156 .freq_high = 1717999,
172 .bandselect = 0x10,
173 .VCOdivider = 2, 157 .VCOdivider = 2,
174 .VCOnumber = 5, 158 .progdata = (0 << 19) | (1 << 9) | 0x08,
175 .progdata = (0 << 18) | (1 << 9) | 0x10,
176 }, 159 },
160
161 /* band 7 */
177 { 162 {
178 .freq_low = 1718000, 163 .freq_low = 1718000,
179 .freq_high = 1855999, 164 .freq_high = 1855999,
180 .bandselect = 0x20,
181 .VCOdivider = 2, 165 .VCOdivider = 2,
182 .VCOnumber = 6, 166 .progdata = (0 << 19) | (1 << 9) | 0x10,
183 .progdata = (0 << 18) | (1 << 9) | 0x20,
184 }, 167 },
168
169 /* band 8 */
185 { 170 {
186 .freq_low = 1856000, 171 .freq_low = 1856000,
187 .freq_high = 2035999, 172 .freq_high = 2035999,
188 .bandselect = 0x40,
189 .VCOdivider = 2, 173 .VCOdivider = 2,
190 .VCOnumber = 7, 174 .progdata = (0 << 19) | (1 << 9) | 0x20,
191 .progdata = (0 << 18) | (1 << 9) | 0x40,
192 }, 175 },
176
177 /* band 9 */
193 { 178 {
194 .freq_low = 2036000, 179 .freq_low = 2036000,
195 .freq_high = 2149999, 180 .freq_high = 2150000,
196 .bandselect = 0x80,
197 .VCOdivider = 2, 181 .VCOdivider = 2,
198 .VCOnumber = 8, 182 .progdata = (0 << 19) | (1 << 9) | 0x40,
199 .progdata = (0 << 18) | (1 << 9) | 0x80,
200 }, 183 },
201}; 184};
202 185
@@ -207,49 +190,44 @@ static struct {
207{ 190{
208 {0x00, 0x03}, /* Reset system */ 191 {0x00, 0x03}, /* Reset system */
209 {0x00, 0x00}, /* Clear reset */ 192 {0x00, 0x00}, /* Clear reset */
210 {0x01, 0x3b}, /* Apply sensible defaults, from an i2c sniffer */ 193 {0x03, 0x07}, /* QPSK, DVB, Auto Acquisition (default) */
211 {0x03, 0x07}, 194 {0x04, 0x10}, /* MPEG */
212 {0x04, 0x10}, 195 {0x05, 0x04}, /* MPEG */
213 {0x05, 0x04}, 196 {0x06, 0x31}, /* MPEG (default) */
214 {0x06, 0x31}, 197 {0x0b, 0x00}, /* Freq search start point (default) */
215 {0x0d, 0x02}, 198 {0x0c, 0x00}, /* Demodulator sample gain (default) */
216 {0x0e, 0x03}, 199 {0x0d, 0x02}, /* Frequency search range = Fsymbol / 4 (default) */
217 {0x0f, 0xfe}, 200 {0x0e, 0x03}, /* Default non-inverted, FEC 3/4 (default) */
218 {0x10, 0x01}, 201 {0x0f, 0xfe}, /* FEC search mask (all supported codes) */
219 {0x14, 0x01}, 202 {0x10, 0x01}, /* Default search inversion, no repeat (default) */
220 {0x15, 0x98}, 203 {0x16, 0x00}, /* Enable reading of frequency */
221 {0x16, 0x00}, 204 {0x17, 0x01}, /* Enable EsNO Ready Counter */
222 {0x17, 0x01}, 205 {0x1c, 0x80}, /* Enable error counter */
223 {0x1b, 0x05}, 206 {0x20, 0x00}, /* Tuner burst clock rate = 500KHz */
224 {0x1c, 0x80}, 207 {0x21, 0x15}, /* Tuner burst mode, word length = 0x15 */
225 {0x1d, 0x00}, 208 {0x28, 0x00}, /* Enable FILTERV with positive pol., DiSEqC 2.x off */
226 {0x1e, 0x00}, 209 {0x29, 0x00}, /* DiSEqC LNB_DC off */
227 {0x20, 0x41}, 210 {0x2a, 0xb0}, /* DiSEqC Parameters (default) */
228 {0x21, 0x15}, 211 {0x2b, 0x73}, /* DiSEqC Tone Frequency (default) */
229 {0x27, 0x14}, 212 {0x2c, 0x00}, /* DiSEqC Message (0x2c - 0x31) */
230 {0x28, 0x46},
231 {0x29, 0x00},
232 {0x2a, 0xb0},
233 {0x2b, 0x73},
234 {0x2c, 0x00},
235 {0x2d, 0x00}, 213 {0x2d, 0x00},
236 {0x2e, 0x00}, 214 {0x2e, 0x00},
237 {0x2f, 0x00}, 215 {0x2f, 0x00},
238 {0x30, 0x00}, 216 {0x30, 0x00},
239 {0x31, 0x00}, 217 {0x31, 0x00},
240 {0x32, 0x8c}, 218 {0x32, 0x8c}, /* DiSEqC Parameters (default) */
241 {0x33, 0x00}, 219 {0x33, 0x00}, /* Interrupts off (0x33 - 0x34) */
242 {0x34, 0x00}, 220 {0x34, 0x00},
243 {0x35, 0x03}, 221 {0x35, 0x03}, /* DiSEqC Tone Amplitude (default) */
244 {0x36, 0x02}, 222 {0x36, 0x02}, /* DiSEqC Parameters (default) */
245 {0x37, 0x3a}, 223 {0x37, 0x3a}, /* DiSEqC Parameters (default) */
246 {0x3a, 0x00}, /* Enable AGC accumulator */ 224 {0x3a, 0x00}, /* Enable AGC accumulator (for signal strength) */
247 {0x44, 0x00}, 225 {0x44, 0x00}, /* Constellation (default) */
248 {0x45, 0x00}, 226 {0x45, 0x00}, /* Symbol count (default) */
249 {0x46, 0x05}, 227 {0x46, 0x0d}, /* Symbol rate estimator on (default) */
250 {0x56, 0x41}, 228 {0x56, 0x41}, /* Various (default) */
251 {0x57, 0xff}, 229 {0x57, 0xff}, /* Error Counter Window (default) */
252 {0x67, 0x83}, 230 {0x67, 0x83}, /* Non-DCII symbol clock */
253}; 231};
254 232
255static int cx24123_writereg(struct cx24123_state* state, int reg, int data) 233static int cx24123_writereg(struct cx24123_state* state, int reg, int data)
@@ -258,6 +236,10 @@ static int cx24123_writereg(struct cx24123_state* state, int reg, int data)
258 struct i2c_msg msg = { .addr = state->config->demod_address, .flags = 0, .buf = buf, .len = 2 }; 236 struct i2c_msg msg = { .addr = state->config->demod_address, .flags = 0, .buf = buf, .len = 2 };
259 int err; 237 int err;
260 238
239 if (debug>1)
240 printk("cx24123: %s: write reg 0x%02x, value 0x%02x\n",
241 __FUNCTION__,reg, data);
242
261 if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) { 243 if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) {
262 printk("%s: writereg error(err == %i, reg == 0x%02x," 244 printk("%s: writereg error(err == %i, reg == 0x%02x,"
263 " data == 0x%02x)\n", __FUNCTION__, err, reg, data); 245 " data == 0x%02x)\n", __FUNCTION__, err, reg, data);
@@ -274,6 +256,10 @@ static int cx24123_writelnbreg(struct cx24123_state* state, int reg, int data)
274 struct i2c_msg msg = { .addr = 0x08, .flags = 0, .buf = buf, .len = 2 }; 256 struct i2c_msg msg = { .addr = 0x08, .flags = 0, .buf = buf, .len = 2 };
275 int err; 257 int err;
276 258
259 if (debug>1)
260 printk("cx24123: %s: writeln addr=0x08, reg 0x%02x, value 0x%02x\n",
261 __FUNCTION__,reg, data);
262
277 if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) { 263 if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) {
278 printk("%s: writelnbreg error (err == %i, reg == 0x%02x," 264 printk("%s: writelnbreg error (err == %i, reg == 0x%02x,"
279 " data == 0x%02x)\n", __FUNCTION__, err, reg, data); 265 " data == 0x%02x)\n", __FUNCTION__, err, reg, data);
@@ -303,6 +289,9 @@ static int cx24123_readreg(struct cx24123_state* state, u8 reg)
303 return ret; 289 return ret;
304 } 290 }
305 291
292 if (debug>1)
293 printk("cx24123: read reg 0x%02x, value 0x%02x\n",reg, ret);
294
306 return b1[0]; 295 return b1[0];
307} 296}
308 297
@@ -313,17 +302,23 @@ static int cx24123_readlnbreg(struct cx24123_state* state, u8 reg)
313 302
314static int cx24123_set_inversion(struct cx24123_state* state, fe_spectral_inversion_t inversion) 303static int cx24123_set_inversion(struct cx24123_state* state, fe_spectral_inversion_t inversion)
315{ 304{
305 u8 nom_reg = cx24123_readreg(state, 0x0e);
306 u8 auto_reg = cx24123_readreg(state, 0x10);
307
316 switch (inversion) { 308 switch (inversion) {
317 case INVERSION_OFF: 309 case INVERSION_OFF:
318 cx24123_writereg(state, 0x0e, cx24123_readreg(state, 0x0e) & 0x7f); 310 dprintk("%s: inversion off\n",__FUNCTION__);
319 cx24123_writereg(state, 0x10, cx24123_readreg(state, 0x10) | 0x80); 311 cx24123_writereg(state, 0x0e, nom_reg & ~0x80);
312 cx24123_writereg(state, 0x10, auto_reg | 0x80);
320 break; 313 break;
321 case INVERSION_ON: 314 case INVERSION_ON:
322 cx24123_writereg(state, 0x0e, cx24123_readreg(state, 0x0e) | 0x80); 315 dprintk("%s: inversion on\n",__FUNCTION__);
323 cx24123_writereg(state, 0x10, cx24123_readreg(state, 0x10) | 0x80); 316 cx24123_writereg(state, 0x0e, nom_reg | 0x80);
317 cx24123_writereg(state, 0x10, auto_reg | 0x80);
324 break; 318 break;
325 case INVERSION_AUTO: 319 case INVERSION_AUTO:
326 cx24123_writereg(state, 0x10, cx24123_readreg(state, 0x10) & 0x7f); 320 dprintk("%s: inversion auto\n",__FUNCTION__);
321 cx24123_writereg(state, 0x10, auto_reg & ~0x80);
327 break; 322 break;
328 default: 323 default:
329 return -EINVAL; 324 return -EINVAL;
@@ -338,92 +333,191 @@ static int cx24123_get_inversion(struct cx24123_state* state, fe_spectral_invers
338 333
339 val = cx24123_readreg(state, 0x1b) >> 7; 334 val = cx24123_readreg(state, 0x1b) >> 7;
340 335
341 if (val == 0) 336 if (val == 0) {
337 dprintk("%s: read inversion off\n",__FUNCTION__);
342 *inversion = INVERSION_OFF; 338 *inversion = INVERSION_OFF;
343 else 339 } else {
340 dprintk("%s: read inversion on\n",__FUNCTION__);
344 *inversion = INVERSION_ON; 341 *inversion = INVERSION_ON;
342 }
345 343
346 return 0; 344 return 0;
347} 345}
348 346
349static int cx24123_set_fec(struct cx24123_state* state, fe_code_rate_t fec) 347static int cx24123_set_fec(struct cx24123_state* state, fe_code_rate_t fec)
350{ 348{
349 u8 nom_reg = cx24123_readreg(state, 0x0e) & ~0x07;
350
351 if ( (fec < FEC_NONE) || (fec > FEC_AUTO) ) 351 if ( (fec < FEC_NONE) || (fec > FEC_AUTO) )
352 fec = FEC_AUTO; 352 fec = FEC_AUTO;
353 353
354 /* Hardware has 5/11 and 3/5 but are never unused */
355 switch (fec) { 354 switch (fec) {
356 case FEC_NONE:
357 return cx24123_writereg(state, 0x0f, 0x01);
358 case FEC_1_2: 355 case FEC_1_2:
359 return cx24123_writereg(state, 0x0f, 0x02); 356 dprintk("%s: set FEC to 1/2\n",__FUNCTION__);
357 cx24123_writereg(state, 0x0e, nom_reg | 0x01);
358 cx24123_writereg(state, 0x0f, 0x02);
359 break;
360 case FEC_2_3: 360 case FEC_2_3:
361 return cx24123_writereg(state, 0x0f, 0x04); 361 dprintk("%s: set FEC to 2/3\n",__FUNCTION__);
362 cx24123_writereg(state, 0x0e, nom_reg | 0x02);
363 cx24123_writereg(state, 0x0f, 0x04);
364 break;
362 case FEC_3_4: 365 case FEC_3_4:
363 return cx24123_writereg(state, 0x0f, 0x08); 366 dprintk("%s: set FEC to 3/4\n",__FUNCTION__);
367 cx24123_writereg(state, 0x0e, nom_reg | 0x03);
368 cx24123_writereg(state, 0x0f, 0x08);
369 break;
370 case FEC_4_5:
371 dprintk("%s: set FEC to 4/5\n",__FUNCTION__);
372 cx24123_writereg(state, 0x0e, nom_reg | 0x04);
373 cx24123_writereg(state, 0x0f, 0x10);
374 break;
364 case FEC_5_6: 375 case FEC_5_6:
365 return cx24123_writereg(state, 0x0f, 0x20); 376 dprintk("%s: set FEC to 5/6\n",__FUNCTION__);
377 cx24123_writereg(state, 0x0e, nom_reg | 0x05);
378 cx24123_writereg(state, 0x0f, 0x20);
379 break;
380 case FEC_6_7:
381 dprintk("%s: set FEC to 6/7\n",__FUNCTION__);
382 cx24123_writereg(state, 0x0e, nom_reg | 0x06);
383 cx24123_writereg(state, 0x0f, 0x40);
384 break;
366 case FEC_7_8: 385 case FEC_7_8:
367 return cx24123_writereg(state, 0x0f, 0x80); 386 dprintk("%s: set FEC to 7/8\n",__FUNCTION__);
387 cx24123_writereg(state, 0x0e, nom_reg | 0x07);
388 cx24123_writereg(state, 0x0f, 0x80);
389 break;
368 case FEC_AUTO: 390 case FEC_AUTO:
369 return cx24123_writereg(state, 0x0f, 0xae); 391 dprintk("%s: set FEC to auto\n",__FUNCTION__);
392 cx24123_writereg(state, 0x0f, 0xfe);
393 break;
370 default: 394 default:
371 return -EOPNOTSUPP; 395 return -EOPNOTSUPP;
372 } 396 }
397
398 return 0;
373} 399}
374 400
375static int cx24123_get_fec(struct cx24123_state* state, fe_code_rate_t *fec) 401static int cx24123_get_fec(struct cx24123_state* state, fe_code_rate_t *fec)
376{ 402{
377 int ret; 403 int ret;
378 u8 val;
379 404
380 ret = cx24123_readreg (state, 0x1b); 405 ret = cx24123_readreg (state, 0x1b);
381 if (ret < 0) 406 if (ret < 0)
382 return ret; 407 return ret;
383 val = ret & 0x07; 408 ret = ret & 0x07;
384 switch (val) { 409
410 switch (ret) {
385 case 1: 411 case 1:
386 *fec = FEC_1_2; 412 *fec = FEC_1_2;
387 break; 413 break;
388 case 3: 414 case 2:
389 *fec = FEC_2_3; 415 *fec = FEC_2_3;
390 break; 416 break;
391 case 4: 417 case 3:
392 *fec = FEC_3_4; 418 *fec = FEC_3_4;
393 break; 419 break;
394 case 5: 420 case 4:
395 *fec = FEC_4_5; 421 *fec = FEC_4_5;
396 break; 422 break;
397 case 6: 423 case 5:
398 *fec = FEC_5_6; 424 *fec = FEC_5_6;
399 break; 425 break;
426 case 6:
427 *fec = FEC_6_7;
428 break;
400 case 7: 429 case 7:
401 *fec = FEC_7_8; 430 *fec = FEC_7_8;
402 break; 431 break;
403 case 2: /* *fec = FEC_3_5; break; */
404 case 0: /* *fec = FEC_5_11; break; */
405 *fec = FEC_AUTO;
406 break;
407 default: 432 default:
408 *fec = FEC_NONE; // can't happen 433 /* this can happen when there's no lock */
434 *fec = FEC_NONE;
409 } 435 }
410 436
411 return 0; 437 return 0;
412} 438}
413 439
414/* fixme: Symbol rates < 3MSps may not work because of precision loss */ 440/* Approximation of closest integer of log2(a/b). It actually gives the
441 lowest integer i such that 2^i >= round(a/b) */
442static u32 cx24123_int_log2(u32 a, u32 b)
443{
444 u32 exp, nearest = 0;
445 u32 div = a / b;
446 if(a % b >= b / 2) ++div;
447 if(div < (1 << 31))
448 {
449 for(exp = 1; div > exp; nearest++)
450 exp += exp;
451 }
452 return nearest;
453}
454
415static int cx24123_set_symbolrate(struct cx24123_state* state, u32 srate) 455static int cx24123_set_symbolrate(struct cx24123_state* state, u32 srate)
416{ 456{
417 u32 val; 457 u32 tmp, sample_rate, ratio, sample_gain;
458 u8 pll_mult;
459
460 /* check if symbol rate is within limits */
461 if ((srate > state->ops.info.symbol_rate_max) ||
462 (srate < state->ops.info.symbol_rate_min))
463 return -EOPNOTSUPP;;
464
465 /* choose the sampling rate high enough for the required operation,
466 while optimizing the power consumed by the demodulator */
467 if (srate < (XTAL*2)/2)
468 pll_mult = 2;
469 else if (srate < (XTAL*3)/2)
470 pll_mult = 3;
471 else if (srate < (XTAL*4)/2)
472 pll_mult = 4;
473 else if (srate < (XTAL*5)/2)
474 pll_mult = 5;
475 else if (srate < (XTAL*6)/2)
476 pll_mult = 6;
477 else if (srate < (XTAL*7)/2)
478 pll_mult = 7;
479 else if (srate < (XTAL*8)/2)
480 pll_mult = 8;
481 else
482 pll_mult = 9;
483
484
485 sample_rate = pll_mult * XTAL;
486
487 /*
488 SYSSymbolRate[21:0] = (srate << 23) / sample_rate
489
490 We have to use 32 bit unsigned arithmetic without precision loss.
491 The maximum srate is 45000000 or 0x02AEA540. This number has
492 only 6 clear bits on top, hence we can shift it left only 6 bits
493 at a time. Borrowed from cx24110.c
494 */
495
496 tmp = srate << 6;
497 ratio = tmp / sample_rate;
498
499 tmp = (tmp % sample_rate) << 6;
500 ratio = (ratio << 6) + (tmp / sample_rate);
501
502 tmp = (tmp % sample_rate) << 6;
503 ratio = (ratio << 6) + (tmp / sample_rate);
504
505 tmp = (tmp % sample_rate) << 5;
506 ratio = (ratio << 5) + (tmp / sample_rate);
507
508
509 cx24123_writereg(state, 0x01, pll_mult * 6);
418 510
419 val = (srate / 1185) * 100; 511 cx24123_writereg(state, 0x08, (ratio >> 16) & 0x3f );
512 cx24123_writereg(state, 0x09, (ratio >> 8) & 0xff );
513 cx24123_writereg(state, 0x0a, (ratio ) & 0xff );
420 514
421 /* Compensate for scaling up, by removing 17 symbols per 1Msps */ 515 /* also set the demodulator sample gain */
422 val = val - (17 * (srate / 1000000)); 516 sample_gain = cx24123_int_log2(sample_rate, srate);
517 tmp = cx24123_readreg(state, 0x0c) & ~0xe0;
518 cx24123_writereg(state, 0x0c, tmp | sample_gain << 5);
423 519
424 cx24123_writereg(state, 0x08, (val >> 16) & 0xff ); 520 dprintk("%s: srate=%d, ratio=0x%08x, sample_rate=%i sample_gain=%d\n", __FUNCTION__, srate, ratio, sample_rate, sample_gain);
425 cx24123_writereg(state, 0x09, (val >> 8) & 0xff );
426 cx24123_writereg(state, 0x0a, (val ) & 0xff );
427 521
428 return 0; 522 return 0;
429} 523}
@@ -437,6 +531,9 @@ static int cx24123_pll_calculate(struct dvb_frontend* fe, struct dvb_frontend_pa
437 struct cx24123_state *state = fe->demodulator_priv; 531 struct cx24123_state *state = fe->demodulator_priv;
438 u32 ndiv = 0, adiv = 0, vco_div = 0; 532 u32 ndiv = 0, adiv = 0, vco_div = 0;
439 int i = 0; 533 int i = 0;
534 int pump = 2;
535 int band = 0;
536 int num_bands = sizeof(cx24123_bandselect_vals) / sizeof(cx24123_bandselect_vals[0]);
440 537
441 /* Defaults for low freq, low rate */ 538 /* Defaults for low freq, low rate */
442 state->VCAarg = cx24123_AGC_vals[0].VCAprogdata; 539 state->VCAarg = cx24123_AGC_vals[0].VCAprogdata;
@@ -444,38 +541,49 @@ static int cx24123_pll_calculate(struct dvb_frontend* fe, struct dvb_frontend_pa
444 state->bandselectarg = cx24123_bandselect_vals[0].progdata; 541 state->bandselectarg = cx24123_bandselect_vals[0].progdata;
445 vco_div = cx24123_bandselect_vals[0].VCOdivider; 542 vco_div = cx24123_bandselect_vals[0].VCOdivider;
446 543
447 /* For the given symbolerate, determine the VCA and VGA programming bits */ 544 /* For the given symbol rate, determine the VCA, VGA and FILTUNE programming bits */
448 for (i = 0; i < sizeof(cx24123_AGC_vals) / sizeof(cx24123_AGC_vals[0]); i++) 545 for (i = 0; i < sizeof(cx24123_AGC_vals) / sizeof(cx24123_AGC_vals[0]); i++)
449 { 546 {
450 if ((cx24123_AGC_vals[i].symbolrate_low <= p->u.qpsk.symbol_rate) && 547 if ((cx24123_AGC_vals[i].symbolrate_low <= p->u.qpsk.symbol_rate) &&
451 (cx24123_AGC_vals[i].symbolrate_high >= p->u.qpsk.symbol_rate) ) { 548 (cx24123_AGC_vals[i].symbolrate_high >= p->u.qpsk.symbol_rate) ) {
452 state->VCAarg = cx24123_AGC_vals[i].VCAprogdata; 549 state->VCAarg = cx24123_AGC_vals[i].VCAprogdata;
453 state->VGAarg = cx24123_AGC_vals[i].VGAprogdata; 550 state->VGAarg = cx24123_AGC_vals[i].VGAprogdata;
551 state->FILTune = cx24123_AGC_vals[i].FILTune;
454 } 552 }
455 } 553 }
456 554
457 /* For the given frequency, determine the bandselect programming bits */ 555 /* determine the band to use */
458 for (i = 0; i < sizeof(cx24123_bandselect_vals) / sizeof(cx24123_bandselect_vals[0]); i++) 556 if(force_band < 1 || force_band > num_bands)
459 { 557 {
460 if ((cx24123_bandselect_vals[i].freq_low <= p->frequency) && 558 for (i = 0; i < num_bands; i++)
461 (cx24123_bandselect_vals[i].freq_high >= p->frequency) ) { 559 {
462 state->bandselectarg = cx24123_bandselect_vals[i].progdata; 560 if ((cx24123_bandselect_vals[i].freq_low <= p->frequency) &&
463 vco_div = cx24123_bandselect_vals[i].VCOdivider; 561 (cx24123_bandselect_vals[i].freq_high >= p->frequency) )
562 band = i;
464 } 563 }
465 } 564 }
565 else
566 band = force_band - 1;
567
568 state->bandselectarg = cx24123_bandselect_vals[band].progdata;
569 vco_div = cx24123_bandselect_vals[band].VCOdivider;
570
571 /* determine the charge pump current */
572 if ( p->frequency < (cx24123_bandselect_vals[band].freq_low + cx24123_bandselect_vals[band].freq_high)/2 )
573 pump = 0x01;
574 else
575 pump = 0x02;
466 576
467 /* Determine the N/A dividers for the requested lband freq (in kHz). */ 577 /* Determine the N/A dividers for the requested lband freq (in kHz). */
468 /* Note: 10111 (kHz) is the Crystal Freq and divider of 10. */ 578 /* Note: the reference divider R=10, frequency is in KHz, XTAL is in Hz */
469 ndiv = ( ((p->frequency * vco_div) / (10111 / 10) / 2) / 32) & 0x1ff; 579 ndiv = ( ((p->frequency * vco_div * 10) / (2 * XTAL / 1000)) / 32) & 0x1ff;
470 adiv = ( ((p->frequency * vco_div) / (10111 / 10) / 2) % 32) & 0x1f; 580 adiv = ( ((p->frequency * vco_div * 10) / (2 * XTAL / 1000)) % 32) & 0x1f;
471 581
472 if (adiv == 0) 582 if (adiv == 0)
473 adiv++; 583 ndiv++;
474 584
475 /* determine the correct pll frequency values. */ 585 /* control bits 11, refdiv 11, charge pump polarity 1, charge pump current, ndiv, adiv */
476 /* Command 11, refdiv 11, cpump polarity 1, cpump current 3mA 10. */ 586 state->pllarg = (3 << 19) | (3 << 17) | (1 << 16) | (pump << 14) | (ndiv << 5) | adiv;
477 state->pllarg = (3 << 19) | (3 << 17) | (1 << 16) | (2 << 14);
478 state->pllarg |= (ndiv << 5) | adiv;
479 587
480 return 0; 588 return 0;
481} 589}
@@ -489,6 +597,8 @@ static int cx24123_pll_writereg(struct dvb_frontend* fe, struct dvb_frontend_par
489 struct cx24123_state *state = fe->demodulator_priv; 597 struct cx24123_state *state = fe->demodulator_priv;
490 unsigned long timeout; 598 unsigned long timeout;
491 599
600 dprintk("%s: pll writereg called, data=0x%08x\n",__FUNCTION__,data);
601
492 /* align the 21 bytes into to bit23 boundary */ 602 /* align the 21 bytes into to bit23 boundary */
493 data = data << 3; 603 data = data << 3;
494 604
@@ -538,6 +648,9 @@ static int cx24123_pll_writereg(struct dvb_frontend* fe, struct dvb_frontend_par
538static int cx24123_pll_tune(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) 648static int cx24123_pll_tune(struct dvb_frontend* fe, struct dvb_frontend_parameters *p)
539{ 649{
540 struct cx24123_state *state = fe->demodulator_priv; 650 struct cx24123_state *state = fe->demodulator_priv;
651 u8 val;
652
653 dprintk("frequency=%i\n", p->frequency);
541 654
542 if (cx24123_pll_calculate(fe, p) != 0) { 655 if (cx24123_pll_calculate(fe, p) != 0) {
543 printk("%s: cx24123_pll_calcutate failed\n",__FUNCTION__); 656 printk("%s: cx24123_pll_calcutate failed\n",__FUNCTION__);
@@ -552,6 +665,14 @@ static int cx24123_pll_tune(struct dvb_frontend* fe, struct dvb_frontend_paramet
552 cx24123_pll_writereg(fe, p, state->bandselectarg); 665 cx24123_pll_writereg(fe, p, state->bandselectarg);
553 cx24123_pll_writereg(fe, p, state->pllarg); 666 cx24123_pll_writereg(fe, p, state->pllarg);
554 667
668 /* set the FILTUNE voltage */
669 val = cx24123_readreg(state, 0x28) & ~0x3;
670 cx24123_writereg(state, 0x27, state->FILTune >> 2);
671 cx24123_writereg(state, 0x28, val | (state->FILTune & 0x3));
672
673 dprintk("%s: pll tune VCA=%d, band=%d, pll=%d\n",__FUNCTION__,state->VCAarg,
674 state->bandselectarg,state->pllarg);
675
555 return 0; 676 return 0;
556} 677}
557 678
@@ -560,6 +681,8 @@ static int cx24123_initfe(struct dvb_frontend* fe)
560 struct cx24123_state *state = fe->demodulator_priv; 681 struct cx24123_state *state = fe->demodulator_priv;
561 int i; 682 int i;
562 683
684 dprintk("%s: init frontend\n",__FUNCTION__);
685
563 /* Configure the demod to a good set of defaults */ 686 /* Configure the demod to a good set of defaults */
564 for (i = 0; i < sizeof(cx24123_regdata) / sizeof(cx24123_regdata[0]); i++) 687 for (i = 0; i < sizeof(cx24123_regdata) / sizeof(cx24123_regdata[0]); i++)
565 cx24123_writereg(state, cx24123_regdata[i].reg, cx24123_regdata[i].data); 688 cx24123_writereg(state, cx24123_regdata[i].reg, cx24123_regdata[i].data);
@@ -587,10 +710,13 @@ static int cx24123_set_voltage(struct dvb_frontend* fe, fe_sec_voltage_t voltage
587 710
588 switch (voltage) { 711 switch (voltage) {
589 case SEC_VOLTAGE_13: 712 case SEC_VOLTAGE_13:
713 dprintk("%s: isl6421 voltage = 13V\n",__FUNCTION__);
590 return cx24123_writelnbreg(state, 0x0, val & 0x32); /* V 13v */ 714 return cx24123_writelnbreg(state, 0x0, val & 0x32); /* V 13v */
591 case SEC_VOLTAGE_18: 715 case SEC_VOLTAGE_18:
716 dprintk("%s: isl6421 voltage = 18V\n",__FUNCTION__);
592 return cx24123_writelnbreg(state, 0x0, val | 0x04); /* H 18v */ 717 return cx24123_writelnbreg(state, 0x0, val | 0x04); /* H 18v */
593 case SEC_VOLTAGE_OFF: 718 case SEC_VOLTAGE_OFF:
719 dprintk("%s: isl5421 voltage off\n",__FUNCTION__);
594 return cx24123_writelnbreg(state, 0x0, val & 0x30); 720 return cx24123_writelnbreg(state, 0x0, val & 0x30);
595 default: 721 default:
596 return -EINVAL; 722 return -EINVAL;
@@ -624,13 +750,93 @@ static int cx24123_set_voltage(struct dvb_frontend* fe, fe_sec_voltage_t voltage
624 return 0; 750 return 0;
625} 751}
626 752
627static int cx24123_send_diseqc_msg(struct dvb_frontend* fe, 753/* wait for diseqc queue to become ready (or timeout) */
628 struct dvb_diseqc_master_cmd *cmd) 754static void cx24123_wait_for_diseqc(struct cx24123_state *state)
755{
756 unsigned long timeout = jiffies + msecs_to_jiffies(200);
757 while (!(cx24123_readreg(state, 0x29) & 0x40)) {
758 if(time_after(jiffies, timeout)) {
759 printk("%s: diseqc queue not ready, command may be lost.\n", __FUNCTION__);
760 break;
761 }
762 msleep(10);
763 }
764}
765
766static int cx24123_send_diseqc_msg(struct dvb_frontend* fe, struct dvb_diseqc_master_cmd *cmd)
629{ 767{
630 /* fixme: Implement diseqc */ 768 struct cx24123_state *state = fe->demodulator_priv;
631 printk("%s: No support yet\n",__FUNCTION__); 769 int i, val;
770
771 dprintk("%s:\n",__FUNCTION__);
772
773 /* check if continuous tone has been stopped */
774 if (state->config->use_isl6421)
775 val = cx24123_readlnbreg(state, 0x00) & 0x10;
776 else
777 val = cx24123_readreg(state, 0x29) & 0x10;
632 778
633 return -ENOTSUPP; 779
780 if (val) {
781 printk("%s: ERROR: attempt to send diseqc command before tone is off\n", __FUNCTION__);
782 return -ENOTSUPP;
783 }
784
785 /* wait for diseqc queue ready */
786 cx24123_wait_for_diseqc(state);
787
788 /* select tone mode */
789 cx24123_writereg(state, 0x2a, cx24123_readreg(state, 0x2a) & 0xf8);
790
791 for (i = 0; i < cmd->msg_len; i++)
792 cx24123_writereg(state, 0x2C + i, cmd->msg[i]);
793
794 val = cx24123_readreg(state, 0x29);
795 cx24123_writereg(state, 0x29, ((val & 0x90) | 0x40) | ((cmd->msg_len-3) & 3));
796
797 /* wait for diseqc message to finish sending */
798 cx24123_wait_for_diseqc(state);
799
800 return 0;
801}
802
803static int cx24123_diseqc_send_burst(struct dvb_frontend* fe, fe_sec_mini_cmd_t burst)
804{
805 struct cx24123_state *state = fe->demodulator_priv;
806 int val;
807
808 dprintk("%s:\n", __FUNCTION__);
809
810 /* check if continuous tone has been stoped */
811 if (state->config->use_isl6421)
812 val = cx24123_readlnbreg(state, 0x00) & 0x10;
813 else
814 val = cx24123_readreg(state, 0x29) & 0x10;
815
816
817 if (val) {
818 printk("%s: ERROR: attempt to send diseqc command before tone is off\n", __FUNCTION__);
819 return -ENOTSUPP;
820 }
821
822 cx24123_wait_for_diseqc(state);
823
824 /* select tone mode */
825 val = cx24123_readreg(state, 0x2a) & 0xf8;
826 cx24123_writereg(state, 0x2a, val | 0x04);
827
828 val = cx24123_readreg(state, 0x29);
829
830 if (burst == SEC_MINI_A)
831 cx24123_writereg(state, 0x29, ((val & 0x90) | 0x40 | 0x00));
832 else if (burst == SEC_MINI_B)
833 cx24123_writereg(state, 0x29, ((val & 0x90) | 0x40 | 0x08));
834 else
835 return -EINVAL;
836
837 cx24123_wait_for_diseqc(state);
838
839 return 0;
634} 840}
635 841
636static int cx24123_read_status(struct dvb_frontend* fe, fe_status_t* status) 842static int cx24123_read_status(struct dvb_frontend* fe, fe_status_t* status)
@@ -642,13 +848,15 @@ static int cx24123_read_status(struct dvb_frontend* fe, fe_status_t* status)
642 848
643 *status = 0; 849 *status = 0;
644 if (lock & 0x01) 850 if (lock & 0x01)
645 *status |= FE_HAS_CARRIER | FE_HAS_SIGNAL; 851 *status |= FE_HAS_SIGNAL;
852 if (sync & 0x02)
853 *status |= FE_HAS_CARRIER;
646 if (sync & 0x04) 854 if (sync & 0x04)
647 *status |= FE_HAS_VITERBI; 855 *status |= FE_HAS_VITERBI;
648 if (sync & 0x08) 856 if (sync & 0x08)
649 *status |= FE_HAS_CARRIER; 857 *status |= FE_HAS_SYNC;
650 if (sync & 0x80) 858 if (sync & 0x80)
651 *status |= FE_HAS_SYNC | FE_HAS_LOCK; 859 *status |= FE_HAS_LOCK;
652 860
653 return 0; 861 return 0;
654} 862}
@@ -681,6 +889,8 @@ static int cx24123_read_ber(struct dvb_frontend* fe, u32* ber)
681 else 889 else
682 state->snr = 0; 890 state->snr = 0;
683 891
892 dprintk("%s: BER = %d, S/N index = %d\n",__FUNCTION__,state->lastber, state->snr);
893
684 *ber = state->lastber; 894 *ber = state->lastber;
685 895
686 return 0; 896 return 0;
@@ -691,6 +901,8 @@ static int cx24123_read_signal_strength(struct dvb_frontend* fe, u16* signal_str
691 struct cx24123_state *state = fe->demodulator_priv; 901 struct cx24123_state *state = fe->demodulator_priv;
692 *signal_strength = cx24123_readreg(state, 0x3b) << 8; /* larger = better */ 902 *signal_strength = cx24123_readreg(state, 0x3b) << 8; /* larger = better */
693 903
904 dprintk("%s: Signal strength = %d\n",__FUNCTION__,*signal_strength);
905
694 return 0; 906 return 0;
695} 907}
696 908
@@ -699,6 +911,8 @@ static int cx24123_read_snr(struct dvb_frontend* fe, u16* snr)
699 struct cx24123_state *state = fe->demodulator_priv; 911 struct cx24123_state *state = fe->demodulator_priv;
700 *snr = state->snr; 912 *snr = state->snr;
701 913
914 dprintk("%s: read S/N index = %d\n",__FUNCTION__,*snr);
915
702 return 0; 916 return 0;
703} 917}
704 918
@@ -707,6 +921,8 @@ static int cx24123_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks)
707 struct cx24123_state *state = fe->demodulator_priv; 921 struct cx24123_state *state = fe->demodulator_priv;
708 *ucblocks = state->lastber; 922 *ucblocks = state->lastber;
709 923
924 dprintk("%s: ucblocks (ber) = %d\n",__FUNCTION__,*ucblocks);
925
710 return 0; 926 return 0;
711} 927}
712 928
@@ -714,6 +930,8 @@ static int cx24123_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_par
714{ 930{
715 struct cx24123_state *state = fe->demodulator_priv; 931 struct cx24123_state *state = fe->demodulator_priv;
716 932
933 dprintk("%s: set_frontend\n",__FUNCTION__);
934
717 if (state->config->set_ts_params) 935 if (state->config->set_ts_params)
718 state->config->set_ts_params(fe, 0); 936 state->config->set_ts_params(fe, 0);
719 937
@@ -737,6 +955,8 @@ static int cx24123_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_par
737{ 955{
738 struct cx24123_state *state = fe->demodulator_priv; 956 struct cx24123_state *state = fe->demodulator_priv;
739 957
958 dprintk("%s: get_frontend\n",__FUNCTION__);
959
740 if (cx24123_get_inversion(state, &p->inversion) != 0) { 960 if (cx24123_get_inversion(state, &p->inversion) != 0) {
741 printk("%s: Failed to get inversion status\n",__FUNCTION__); 961 printk("%s: Failed to get inversion status\n",__FUNCTION__);
742 return -EREMOTEIO; 962 return -EREMOTEIO;
@@ -763,8 +983,10 @@ static int cx24123_set_tone(struct dvb_frontend* fe, fe_sec_tone_mode_t tone)
763 983
764 switch (tone) { 984 switch (tone) {
765 case SEC_TONE_ON: 985 case SEC_TONE_ON:
986 dprintk("%s: isl6421 sec tone on\n",__FUNCTION__);
766 return cx24123_writelnbreg(state, 0x0, val | 0x10); 987 return cx24123_writelnbreg(state, 0x0, val | 0x10);
767 case SEC_TONE_OFF: 988 case SEC_TONE_OFF:
989 dprintk("%s: isl6421 sec tone off\n",__FUNCTION__);
768 return cx24123_writelnbreg(state, 0x0, val & 0x2f); 990 return cx24123_writelnbreg(state, 0x0, val & 0x2f);
769 default: 991 default:
770 printk("%s: CASE reached default with tone=%d\n", __FUNCTION__, tone); 992 printk("%s: CASE reached default with tone=%d\n", __FUNCTION__, tone);
@@ -855,12 +1077,13 @@ static struct dvb_frontend_ops cx24123_ops = {
855 .frequency_min = 950000, 1077 .frequency_min = 950000,
856 .frequency_max = 2150000, 1078 .frequency_max = 2150000,
857 .frequency_stepsize = 1011, /* kHz for QPSK frontends */ 1079 .frequency_stepsize = 1011, /* kHz for QPSK frontends */
858 .frequency_tolerance = 29500, 1080 .frequency_tolerance = 5000,
859 .symbol_rate_min = 1000000, 1081 .symbol_rate_min = 1000000,
860 .symbol_rate_max = 45000000, 1082 .symbol_rate_max = 45000000,
861 .caps = FE_CAN_INVERSION_AUTO | 1083 .caps = FE_CAN_INVERSION_AUTO |
862 FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 | 1084 FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 |
863 FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO | 1085 FE_CAN_FEC_4_5 | FE_CAN_FEC_5_6 | FE_CAN_FEC_6_7 |
1086 FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO |
864 FE_CAN_QPSK | FE_CAN_RECOVER 1087 FE_CAN_QPSK | FE_CAN_RECOVER
865 }, 1088 },
866 1089
@@ -875,12 +1098,16 @@ static struct dvb_frontend_ops cx24123_ops = {
875 .read_snr = cx24123_read_snr, 1098 .read_snr = cx24123_read_snr,
876 .read_ucblocks = cx24123_read_ucblocks, 1099 .read_ucblocks = cx24123_read_ucblocks,
877 .diseqc_send_master_cmd = cx24123_send_diseqc_msg, 1100 .diseqc_send_master_cmd = cx24123_send_diseqc_msg,
1101 .diseqc_send_burst = cx24123_diseqc_send_burst,
878 .set_tone = cx24123_set_tone, 1102 .set_tone = cx24123_set_tone,
879 .set_voltage = cx24123_set_voltage, 1103 .set_voltage = cx24123_set_voltage,
880}; 1104};
881 1105
882module_param(debug, int, 0644); 1106module_param(debug, int, 0644);
883MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off)."); 1107MODULE_PARM_DESC(debug, "Activates frontend debugging (default:0)");
1108
1109module_param(force_band, int, 0644);
1110MODULE_PARM_DESC(force_band, "Force a specific band select (1-9, default:off).");
884 1111
885MODULE_DESCRIPTION("DVB Frontend module for Conexant cx24123/cx24109 hardware"); 1112MODULE_DESCRIPTION("DVB Frontend module for Conexant cx24123/cx24109 hardware");
886MODULE_AUTHOR("Steven Toth"); 1113MODULE_AUTHOR("Steven Toth");
diff --git a/drivers/media/dvb/frontends/dvb-pll.c b/drivers/media/dvb/frontends/dvb-pll.c
index b6e2c387a04c..791706ec1da3 100644
--- a/drivers/media/dvb/frontends/dvb-pll.c
+++ b/drivers/media/dvb/frontends/dvb-pll.c
@@ -235,8 +235,8 @@ struct dvb_pll_desc dvb_pll_tdvs_tua6034 = {
235 .max = 863000000, 235 .max = 863000000,
236 .count = 3, 236 .count = 3,
237 .entries = { 237 .entries = {
238 { 160000000, 44000000, 62500, 0xce, 0x01 }, 238 { 165000000, 44000000, 62500, 0xce, 0x01 },
239 { 455000000, 44000000, 62500, 0xce, 0x02 }, 239 { 450000000, 44000000, 62500, 0xce, 0x02 },
240 { 999999999, 44000000, 62500, 0xce, 0x04 }, 240 { 999999999, 44000000, 62500, 0xce, 0x04 },
241 }, 241 },
242}; 242};
diff --git a/drivers/media/dvb/pluto2/Kconfig b/drivers/media/dvb/pluto2/Kconfig
index 84f8f9f52869..7d8e6e87bdbb 100644
--- a/drivers/media/dvb/pluto2/Kconfig
+++ b/drivers/media/dvb/pluto2/Kconfig
@@ -1,7 +1,6 @@
1config DVB_PLUTO2 1config DVB_PLUTO2
2 tristate "Pluto2 cards" 2 tristate "Pluto2 cards"
3 depends on DVB_CORE && PCI 3 depends on DVB_CORE && PCI && I2C
4 select I2C
5 select I2C_ALGOBIT 4 select I2C_ALGOBIT
6 select DVB_TDA1004X 5 select DVB_TDA1004X
7 help 6 help
diff --git a/drivers/media/dvb/pluto2/Makefile b/drivers/media/dvb/pluto2/Makefile
index 86ca84b2be6e..ce6a9aaf937e 100644
--- a/drivers/media/dvb/pluto2/Makefile
+++ b/drivers/media/dvb/pluto2/Makefile
@@ -1,3 +1,3 @@
1obj-$(CONFIG_DVB_PLUTO2) = pluto2.o 1obj-$(CONFIG_DVB_PLUTO2) += pluto2.o
2 2
3EXTRA_CFLAGS = -Idrivers/media/dvb/dvb-core/ -Idrivers/media/dvb/frontends/ 3EXTRA_CFLAGS = -Idrivers/media/dvb/dvb-core/ -Idrivers/media/dvb/frontends/
diff --git a/drivers/media/dvb/ttpci/Kconfig b/drivers/media/dvb/ttpci/Kconfig
index 5b2aadb8385c..b5ac7dfde52f 100644
--- a/drivers/media/dvb/ttpci/Kconfig
+++ b/drivers/media/dvb/ttpci/Kconfig
@@ -1,8 +1,7 @@
1config DVB_AV7110 1config DVB_AV7110
2 tristate "AV7110 cards" 2 tristate "AV7110 cards"
3 depends on DVB_CORE && PCI 3 depends on DVB_CORE && PCI && I2C && VIDEO_V4L1
4 select FW_LOADER 4 select FW_LOADER
5 select VIDEO_DEV
6 select VIDEO_SAA7146_VV 5 select VIDEO_SAA7146_VV
7 select DVB_VES1820 6 select DVB_VES1820
8 select DVB_VES1X93 7 select DVB_VES1X93
@@ -59,7 +58,7 @@ config DVB_AV7110_OSD
59 58
60config DVB_BUDGET 59config DVB_BUDGET
61 tristate "Budget cards" 60 tristate "Budget cards"
62 depends on DVB_CORE && PCI 61 depends on DVB_CORE && PCI && I2C && VIDEO_V4L1
63 select VIDEO_SAA7146 62 select VIDEO_SAA7146
64 select DVB_STV0299 63 select DVB_STV0299
65 select DVB_VES1X93 64 select DVB_VES1X93
@@ -80,7 +79,7 @@ config DVB_BUDGET
80 79
81config DVB_BUDGET_CI 80config DVB_BUDGET_CI
82 tristate "Budget cards with onboard CI connector" 81 tristate "Budget cards with onboard CI connector"
83 depends on DVB_CORE && PCI 82 depends on DVB_CORE && PCI && I2C && VIDEO_V4L1
84 select VIDEO_SAA7146 83 select VIDEO_SAA7146
85 select DVB_STV0297 84 select DVB_STV0297
86 select DVB_STV0299 85 select DVB_STV0299
@@ -100,8 +99,7 @@ config DVB_BUDGET_CI
100 99
101config DVB_BUDGET_AV 100config DVB_BUDGET_AV
102 tristate "Budget cards with analog video inputs" 101 tristate "Budget cards with analog video inputs"
103 depends on DVB_CORE && PCI 102 depends on DVB_CORE && PCI && I2C && VIDEO_V4L1
104 select VIDEO_DEV
105 select VIDEO_SAA7146_VV 103 select VIDEO_SAA7146_VV
106 select DVB_STV0299 104 select DVB_STV0299
107 select DVB_TDA1004X 105 select DVB_TDA1004X
@@ -119,7 +117,7 @@ config DVB_BUDGET_AV
119 117
120config DVB_BUDGET_PATCH 118config DVB_BUDGET_PATCH
121 tristate "AV7110 cards with Budget Patch" 119 tristate "AV7110 cards with Budget Patch"
122 depends on DVB_CORE && DVB_BUDGET 120 depends on DVB_CORE && DVB_BUDGET && VIDEO_V4L1
123 select DVB_AV7110 121 select DVB_AV7110
124 select DVB_STV0299 122 select DVB_STV0299
125 select DVB_VES1X93 123 select DVB_VES1X93
diff --git a/drivers/media/dvb/ttpci/budget-av.c b/drivers/media/dvb/ttpci/budget-av.c
index 8efe3ce5f66c..8a7cd7d505cf 100644
--- a/drivers/media/dvb/ttpci/budget-av.c
+++ b/drivers/media/dvb/ttpci/budget-av.c
@@ -1190,8 +1190,6 @@ static int budget_av_attach(struct saa7146_dev *dev, struct saa7146_pci_extensio
1190 SAA7146_HPS_SYNC_PORT_A); 1190 SAA7146_HPS_SYNC_PORT_A);
1191 1191
1192 saa7113_setinput(budget_av, 0); 1192 saa7113_setinput(budget_av, 0);
1193 } else {
1194 ciintf_init(budget_av);
1195 } 1193 }
1196 1194
1197 /* fixme: find some sane values here... */ 1195 /* fixme: find some sane values here... */
@@ -1211,6 +1209,10 @@ static int budget_av_attach(struct saa7146_dev *dev, struct saa7146_pci_extensio
1211 budget_av->budget.dvb_adapter.priv = budget_av; 1209 budget_av->budget.dvb_adapter.priv = budget_av;
1212 frontend_init(budget_av); 1210 frontend_init(budget_av);
1213 1211
1212 if (!budget_av->has_saa7113) {
1213 ciintf_init(budget_av);
1214 }
1215
1214 return 0; 1216 return 0;
1215} 1217}
1216 1218
diff --git a/drivers/media/dvb/ttpci/budget-ci.c b/drivers/media/dvb/ttpci/budget-ci.c
index 5f91036f5b87..e64a609cf4ff 100644
--- a/drivers/media/dvb/ttpci/budget-ci.c
+++ b/drivers/media/dvb/ttpci/budget-ci.c
@@ -71,6 +71,7 @@ struct budget_ci {
71 struct tasklet_struct msp430_irq_tasklet; 71 struct tasklet_struct msp430_irq_tasklet;
72 struct tasklet_struct ciintf_irq_tasklet; 72 struct tasklet_struct ciintf_irq_tasklet;
73 int slot_status; 73 int slot_status;
74 int ci_irq;
74 struct dvb_ca_en50221 ca; 75 struct dvb_ca_en50221 ca;
75 char ir_dev_name[50]; 76 char ir_dev_name[50];
76 u8 tuner_pll_address; /* used for philips_tdm1316l configs */ 77 u8 tuner_pll_address; /* used for philips_tdm1316l configs */
@@ -276,8 +277,10 @@ static int ciintf_slot_reset(struct dvb_ca_en50221 *ca, int slot)
276 if (slot != 0) 277 if (slot != 0)
277 return -EINVAL; 278 return -EINVAL;
278 279
279 // trigger on RISING edge during reset so we know when READY is re-asserted 280 if (budget_ci->ci_irq) {
280 saa7146_setgpio(saa, 0, SAA7146_GPIO_IRQHI); 281 // trigger on RISING edge during reset so we know when READY is re-asserted
282 saa7146_setgpio(saa, 0, SAA7146_GPIO_IRQHI);
283 }
281 budget_ci->slot_status = SLOTSTATUS_RESET; 284 budget_ci->slot_status = SLOTSTATUS_RESET;
282 ttpci_budget_debiwrite(&budget_ci->budget, DEBICICTL, DEBIADDR_CICONTROL, 1, 0, 1, 0); 285 ttpci_budget_debiwrite(&budget_ci->budget, DEBICICTL, DEBIADDR_CICONTROL, 1, 0, 1, 0);
283 msleep(1); 286 msleep(1);
@@ -370,11 +373,50 @@ static void ciintf_interrupt(unsigned long data)
370 } 373 }
371} 374}
372 375
376static int ciintf_poll_slot_status(struct dvb_ca_en50221 *ca, int slot, int open)
377{
378 struct budget_ci *budget_ci = (struct budget_ci *) ca->data;
379 unsigned int flags;
380
381 // ensure we don't get spurious IRQs during initialisation
382 if (!budget_ci->budget.ci_present)
383 return -EINVAL;
384
385 // read the CAM status
386 flags = ttpci_budget_debiread(&budget_ci->budget, DEBICICTL, DEBIADDR_CICONTROL, 1, 1, 0);
387 if (flags & CICONTROL_CAMDETECT) {
388 // mark it as present if it wasn't before
389 if (budget_ci->slot_status & SLOTSTATUS_NONE) {
390 budget_ci->slot_status = SLOTSTATUS_PRESENT;
391 }
392
393 // during a RESET, we check if we can read from IO memory to see when CAM is ready
394 if (budget_ci->slot_status & SLOTSTATUS_RESET) {
395 if (ciintf_read_attribute_mem(ca, slot, 0) == 0x1d) {
396 budget_ci->slot_status = SLOTSTATUS_READY;
397 }
398 }
399 } else {
400 budget_ci->slot_status = SLOTSTATUS_NONE;
401 }
402
403 if (budget_ci->slot_status != SLOTSTATUS_NONE) {
404 if (budget_ci->slot_status & SLOTSTATUS_READY) {
405 return DVB_CA_EN50221_POLL_CAM_PRESENT | DVB_CA_EN50221_POLL_CAM_READY;
406 }
407 return DVB_CA_EN50221_POLL_CAM_PRESENT;
408 }
409
410 return 0;
411}
412
373static int ciintf_init(struct budget_ci *budget_ci) 413static int ciintf_init(struct budget_ci *budget_ci)
374{ 414{
375 struct saa7146_dev *saa = budget_ci->budget.dev; 415 struct saa7146_dev *saa = budget_ci->budget.dev;
376 int flags; 416 int flags;
377 int result; 417 int result;
418 int ci_version;
419 int ca_flags;
378 420
379 memset(&budget_ci->ca, 0, sizeof(struct dvb_ca_en50221)); 421 memset(&budget_ci->ca, 0, sizeof(struct dvb_ca_en50221));
380 422
@@ -382,16 +424,29 @@ static int ciintf_init(struct budget_ci *budget_ci)
382 saa7146_write(saa, MC1, saa7146_read(saa, MC1) | (0x800 << 16) | 0x800); 424 saa7146_write(saa, MC1, saa7146_read(saa, MC1) | (0x800 << 16) | 0x800);
383 425
384 // test if it is there 426 // test if it is there
385 if ((ttpci_budget_debiread(&budget_ci->budget, DEBICICTL, DEBIADDR_CIVERSION, 1, 1, 0) & 0xa0) != 0xa0) { 427 ci_version = ttpci_budget_debiread(&budget_ci->budget, DEBICICTL, DEBIADDR_CIVERSION, 1, 1, 0);
428 if ((ci_version & 0xa0) != 0xa0) {
386 result = -ENODEV; 429 result = -ENODEV;
387 goto error; 430 goto error;
388 } 431 }
432
389 // determine whether a CAM is present or not 433 // determine whether a CAM is present or not
390 flags = ttpci_budget_debiread(&budget_ci->budget, DEBICICTL, DEBIADDR_CICONTROL, 1, 1, 0); 434 flags = ttpci_budget_debiread(&budget_ci->budget, DEBICICTL, DEBIADDR_CICONTROL, 1, 1, 0);
391 budget_ci->slot_status = SLOTSTATUS_NONE; 435 budget_ci->slot_status = SLOTSTATUS_NONE;
392 if (flags & CICONTROL_CAMDETECT) 436 if (flags & CICONTROL_CAMDETECT)
393 budget_ci->slot_status = SLOTSTATUS_PRESENT; 437 budget_ci->slot_status = SLOTSTATUS_PRESENT;
394 438
439 // version 0xa2 of the CI firmware doesn't generate interrupts
440 if (ci_version == 0xa2) {
441 ca_flags = 0;
442 budget_ci->ci_irq = 0;
443 } else {
444 ca_flags = DVB_CA_EN50221_FLAG_IRQ_CAMCHANGE |
445 DVB_CA_EN50221_FLAG_IRQ_FR |
446 DVB_CA_EN50221_FLAG_IRQ_DA;
447 budget_ci->ci_irq = 1;
448 }
449
395 // register CI interface 450 // register CI interface
396 budget_ci->ca.owner = THIS_MODULE; 451 budget_ci->ca.owner = THIS_MODULE;
397 budget_ci->ca.read_attribute_mem = ciintf_read_attribute_mem; 452 budget_ci->ca.read_attribute_mem = ciintf_read_attribute_mem;
@@ -401,23 +456,27 @@ static int ciintf_init(struct budget_ci *budget_ci)
401 budget_ci->ca.slot_reset = ciintf_slot_reset; 456 budget_ci->ca.slot_reset = ciintf_slot_reset;
402 budget_ci->ca.slot_shutdown = ciintf_slot_shutdown; 457 budget_ci->ca.slot_shutdown = ciintf_slot_shutdown;
403 budget_ci->ca.slot_ts_enable = ciintf_slot_ts_enable; 458 budget_ci->ca.slot_ts_enable = ciintf_slot_ts_enable;
459 budget_ci->ca.poll_slot_status = ciintf_poll_slot_status;
404 budget_ci->ca.data = budget_ci; 460 budget_ci->ca.data = budget_ci;
405 if ((result = dvb_ca_en50221_init(&budget_ci->budget.dvb_adapter, 461 if ((result = dvb_ca_en50221_init(&budget_ci->budget.dvb_adapter,
406 &budget_ci->ca, 462 &budget_ci->ca,
407 DVB_CA_EN50221_FLAG_IRQ_CAMCHANGE | 463 ca_flags, 1)) != 0) {
408 DVB_CA_EN50221_FLAG_IRQ_FR |
409 DVB_CA_EN50221_FLAG_IRQ_DA, 1)) != 0) {
410 printk("budget_ci: CI interface detected, but initialisation failed.\n"); 464 printk("budget_ci: CI interface detected, but initialisation failed.\n");
411 goto error; 465 goto error;
412 } 466 }
467
413 // Setup CI slot IRQ 468 // Setup CI slot IRQ
414 tasklet_init(&budget_ci->ciintf_irq_tasklet, ciintf_interrupt, (unsigned long) budget_ci); 469 if (budget_ci->ci_irq) {
415 if (budget_ci->slot_status != SLOTSTATUS_NONE) { 470 tasklet_init(&budget_ci->ciintf_irq_tasklet, ciintf_interrupt, (unsigned long) budget_ci);
416 saa7146_setgpio(saa, 0, SAA7146_GPIO_IRQLO); 471 if (budget_ci->slot_status != SLOTSTATUS_NONE) {
417 } else { 472 saa7146_setgpio(saa, 0, SAA7146_GPIO_IRQLO);
418 saa7146_setgpio(saa, 0, SAA7146_GPIO_IRQHI); 473 } else {
474 saa7146_setgpio(saa, 0, SAA7146_GPIO_IRQHI);
475 }
476 saa7146_write(saa, IER, saa7146_read(saa, IER) | MASK_03);
419 } 477 }
420 saa7146_write(saa, IER, saa7146_read(saa, IER) | MASK_03); 478
479 // enable interface
421 ttpci_budget_debiwrite(&budget_ci->budget, DEBICICTL, DEBIADDR_CICONTROL, 1, 480 ttpci_budget_debiwrite(&budget_ci->budget, DEBICICTL, DEBIADDR_CICONTROL, 1,
422 CICONTROL_RESET, 1, 0); 481 CICONTROL_RESET, 1, 0);
423 482
@@ -426,10 +485,12 @@ static int ciintf_init(struct budget_ci *budget_ci)
426 budget_ci->budget.ci_present = 1; 485 budget_ci->budget.ci_present = 1;
427 486
428 // forge a fake CI IRQ so the CAM state is setup correctly 487 // forge a fake CI IRQ so the CAM state is setup correctly
429 flags = DVB_CA_EN50221_CAMCHANGE_REMOVED; 488 if (budget_ci->ci_irq) {
430 if (budget_ci->slot_status != SLOTSTATUS_NONE) 489 flags = DVB_CA_EN50221_CAMCHANGE_REMOVED;
431 flags = DVB_CA_EN50221_CAMCHANGE_INSERTED; 490 if (budget_ci->slot_status != SLOTSTATUS_NONE)
432 dvb_ca_en50221_camchange_irq(&budget_ci->ca, 0, flags); 491 flags = DVB_CA_EN50221_CAMCHANGE_INSERTED;
492 dvb_ca_en50221_camchange_irq(&budget_ci->ca, 0, flags);
493 }
433 494
434 return 0; 495 return 0;
435 496
@@ -443,9 +504,13 @@ static void ciintf_deinit(struct budget_ci *budget_ci)
443 struct saa7146_dev *saa = budget_ci->budget.dev; 504 struct saa7146_dev *saa = budget_ci->budget.dev;
444 505
445 // disable CI interrupts 506 // disable CI interrupts
446 saa7146_write(saa, IER, saa7146_read(saa, IER) & ~MASK_03); 507 if (budget_ci->ci_irq) {
447 saa7146_setgpio(saa, 0, SAA7146_GPIO_INPUT); 508 saa7146_write(saa, IER, saa7146_read(saa, IER) & ~MASK_03);
448 tasklet_kill(&budget_ci->ciintf_irq_tasklet); 509 saa7146_setgpio(saa, 0, SAA7146_GPIO_INPUT);
510 tasklet_kill(&budget_ci->ciintf_irq_tasklet);
511 }
512
513 // reset interface
449 ttpci_budget_debiwrite(&budget_ci->budget, DEBICICTL, DEBIADDR_CICONTROL, 1, 0, 1, 0); 514 ttpci_budget_debiwrite(&budget_ci->budget, DEBICICTL, DEBIADDR_CICONTROL, 1, 0, 1, 0);
450 msleep(1); 515 msleep(1);
451 ttpci_budget_debiwrite(&budget_ci->budget, DEBICICTL, DEBIADDR_CICONTROL, 1, 516 ttpci_budget_debiwrite(&budget_ci->budget, DEBICICTL, DEBIADDR_CICONTROL, 1,
@@ -473,7 +538,7 @@ static void budget_ci_irq(struct saa7146_dev *dev, u32 * isr)
473 if (*isr & MASK_10) 538 if (*isr & MASK_10)
474 ttpci_budget_irq10_handler(dev, isr); 539 ttpci_budget_irq10_handler(dev, isr);
475 540
476 if ((*isr & MASK_03) && (budget_ci->budget.ci_present)) 541 if ((*isr & MASK_03) && (budget_ci->budget.ci_present) && (budget_ci->ci_irq))
477 tasklet_schedule(&budget_ci->ciintf_irq_tasklet); 542 tasklet_schedule(&budget_ci->ciintf_irq_tasklet);
478} 543}
479 544
diff --git a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
index 248fdc7accfb..6ceae38125c7 100644
--- a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
+++ b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
@@ -1507,7 +1507,11 @@ static int ttusb_probe(struct usb_interface *intf, const struct usb_device_id *i
1507 1507
1508 mutex_unlock(&ttusb->semi2c); 1508 mutex_unlock(&ttusb->semi2c);
1509 1509
1510 dvb_register_adapter(&ttusb->adapter, "Technotrend/Hauppauge Nova-USB", THIS_MODULE); 1510 if ((result = dvb_register_adapter(&ttusb->adapter, "Technotrend/Hauppauge Nova-USB", THIS_MODULE)) < 0) {
1511 ttusb_free_iso_urbs(ttusb);
1512 kfree(ttusb);
1513 return result;
1514 }
1511 ttusb->adapter.priv = ttusb; 1515 ttusb->adapter.priv = ttusb;
1512 1516
1513 /* i2c */ 1517 /* i2c */
diff --git a/drivers/media/radio/Kconfig b/drivers/media/radio/Kconfig
index d318be383de6..3fff75763693 100644
--- a/drivers/media/radio/Kconfig
+++ b/drivers/media/radio/Kconfig
@@ -7,7 +7,7 @@ menu "Radio Adapters"
7 7
8config RADIO_CADET 8config RADIO_CADET
9 tristate "ADS Cadet AM/FM Tuner" 9 tristate "ADS Cadet AM/FM Tuner"
10 depends on ISA && VIDEO_DEV 10 depends on ISA && VIDEO_V4L1
11 ---help--- 11 ---help---
12 Choose Y here if you have one of these AM/FM radio cards, and then 12 Choose Y here if you have one of these AM/FM radio cards, and then
13 fill in the port address below. 13 fill in the port address below.
@@ -25,7 +25,7 @@ config RADIO_CADET
25 25
26config RADIO_RTRACK 26config RADIO_RTRACK
27 tristate "AIMSlab RadioTrack (aka RadioReveal) support" 27 tristate "AIMSlab RadioTrack (aka RadioReveal) support"
28 depends on ISA && VIDEO_DEV 28 depends on ISA && VIDEO_V4L1
29 ---help--- 29 ---help---
30 Choose Y here if you have one of these FM radio cards, and then fill 30 Choose Y here if you have one of these FM radio cards, and then fill
31 in the port address below. 31 in the port address below.
@@ -59,7 +59,7 @@ config RADIO_RTRACK_PORT
59 59
60config RADIO_RTRACK2 60config RADIO_RTRACK2
61 tristate "AIMSlab RadioTrack II support" 61 tristate "AIMSlab RadioTrack II support"
62 depends on ISA && VIDEO_DEV 62 depends on ISA && VIDEO_V4L1
63 ---help--- 63 ---help---
64 Choose Y here if you have this FM radio card, and then fill in the 64 Choose Y here if you have this FM radio card, and then fill in the
65 port address below. 65 port address below.
@@ -82,7 +82,7 @@ config RADIO_RTRACK2_PORT
82 82
83config RADIO_AZTECH 83config RADIO_AZTECH
84 tristate "Aztech/Packard Bell Radio" 84 tristate "Aztech/Packard Bell Radio"
85 depends on ISA && VIDEO_DEV 85 depends on ISA && VIDEO_V4L1
86 ---help--- 86 ---help---
87 Choose Y here if you have one of these FM radio cards, and then fill 87 Choose Y here if you have one of these FM radio cards, and then fill
88 in the port address below. 88 in the port address below.
@@ -106,7 +106,7 @@ config RADIO_AZTECH_PORT
106 106
107config RADIO_GEMTEK 107config RADIO_GEMTEK
108 tristate "GemTek Radio Card support" 108 tristate "GemTek Radio Card support"
109 depends on ISA && VIDEO_DEV 109 depends on ISA && VIDEO_V4L1
110 ---help--- 110 ---help---
111 Choose Y here if you have this FM radio card, and then fill in the 111 Choose Y here if you have this FM radio card, and then fill in the
112 port address below. 112 port address below.
@@ -131,7 +131,7 @@ config RADIO_GEMTEK_PORT
131 131
132config RADIO_GEMTEK_PCI 132config RADIO_GEMTEK_PCI
133 tristate "GemTek PCI Radio Card support" 133 tristate "GemTek PCI Radio Card support"
134 depends on VIDEO_DEV && PCI 134 depends on VIDEO_V4L1 && PCI
135 ---help--- 135 ---help---
136 Choose Y here if you have this PCI FM radio card. 136 Choose Y here if you have this PCI FM radio card.
137 137
@@ -145,7 +145,7 @@ config RADIO_GEMTEK_PCI
145 145
146config RADIO_MAXIRADIO 146config RADIO_MAXIRADIO
147 tristate "Guillemot MAXI Radio FM 2000 radio" 147 tristate "Guillemot MAXI Radio FM 2000 radio"
148 depends on VIDEO_DEV && PCI 148 depends on VIDEO_V4L1 && PCI
149 ---help--- 149 ---help---
150 Choose Y here if you have this radio card. This card may also be 150 Choose Y here if you have this radio card. This card may also be
151 found as Gemtek PCI FM. 151 found as Gemtek PCI FM.
@@ -160,7 +160,7 @@ config RADIO_MAXIRADIO
160 160
161config RADIO_MAESTRO 161config RADIO_MAESTRO
162 tristate "Maestro on board radio" 162 tristate "Maestro on board radio"
163 depends on VIDEO_DEV 163 depends on VIDEO_V4L1
164 ---help--- 164 ---help---
165 Say Y here to directly support the on-board radio tuner on the 165 Say Y here to directly support the on-board radio tuner on the
166 Maestro 2 or 2E sound card. 166 Maestro 2 or 2E sound card.
@@ -175,7 +175,7 @@ config RADIO_MAESTRO
175 175
176config RADIO_MIROPCM20 176config RADIO_MIROPCM20
177 tristate "miroSOUND PCM20 radio" 177 tristate "miroSOUND PCM20 radio"
178 depends on ISA && VIDEO_DEV && SOUND_ACI_MIXER 178 depends on ISA && VIDEO_V4L1 && SOUND_ACI_MIXER
179 ---help--- 179 ---help---
180 Choose Y here if you have this FM radio card. You also need to say Y 180 Choose Y here if you have this FM radio card. You also need to say Y
181 to "ACI mixer (miroSOUND PCM1-pro/PCM12/PCM20 radio)" (in "Sound") 181 to "ACI mixer (miroSOUND PCM1-pro/PCM12/PCM20 radio)" (in "Sound")
@@ -208,7 +208,7 @@ config RADIO_MIROPCM20_RDS
208 208
209config RADIO_SF16FMI 209config RADIO_SF16FMI
210 tristate "SF16FMI Radio" 210 tristate "SF16FMI Radio"
211 depends on ISA && VIDEO_DEV 211 depends on ISA && VIDEO_V4L1
212 ---help--- 212 ---help---
213 Choose Y here if you have one of these FM radio cards. If you 213 Choose Y here if you have one of these FM radio cards. If you
214 compile the driver into the kernel and your card is not PnP one, you 214 compile the driver into the kernel and your card is not PnP one, you
@@ -225,7 +225,7 @@ config RADIO_SF16FMI
225 225
226config RADIO_SF16FMR2 226config RADIO_SF16FMR2
227 tristate "SF16FMR2 Radio" 227 tristate "SF16FMR2 Radio"
228 depends on ISA && VIDEO_DEV 228 depends on ISA && VIDEO_V4L1
229 ---help--- 229 ---help---
230 Choose Y here if you have one of these FM radio cards. 230 Choose Y here if you have one of these FM radio cards.
231 231
@@ -239,7 +239,7 @@ config RADIO_SF16FMR2
239 239
240config RADIO_TERRATEC 240config RADIO_TERRATEC
241 tristate "TerraTec ActiveRadio ISA Standalone" 241 tristate "TerraTec ActiveRadio ISA Standalone"
242 depends on ISA && VIDEO_DEV 242 depends on ISA && VIDEO_V4L1
243 ---help--- 243 ---help---
244 Choose Y here if you have this FM radio card, and then fill in the 244 Choose Y here if you have this FM radio card, and then fill in the
245 port address below. (TODO) 245 port address below. (TODO)
@@ -268,7 +268,7 @@ config RADIO_TERRATEC_PORT
268 268
269config RADIO_TRUST 269config RADIO_TRUST
270 tristate "Trust FM radio card" 270 tristate "Trust FM radio card"
271 depends on ISA && VIDEO_DEV 271 depends on ISA && VIDEO_V4L1
272 help 272 help
273 This is a driver for the Trust FM radio cards. Say Y if you have 273 This is a driver for the Trust FM radio cards. Say Y if you have
274 such a card and want to use it under Linux. 274 such a card and want to use it under Linux.
@@ -286,7 +286,7 @@ config RADIO_TRUST_PORT
286 286
287config RADIO_TYPHOON 287config RADIO_TYPHOON
288 tristate "Typhoon Radio (a.k.a. EcoRadio)" 288 tristate "Typhoon Radio (a.k.a. EcoRadio)"
289 depends on ISA && VIDEO_DEV 289 depends on ISA && VIDEO_V4L1
290 ---help--- 290 ---help---
291 Choose Y here if you have one of these FM radio cards, and then fill 291 Choose Y here if you have one of these FM radio cards, and then fill
292 in the port address and the frequency used for muting below. 292 in the port address and the frequency used for muting below.
@@ -330,7 +330,7 @@ config RADIO_TYPHOON_MUTEFREQ
330 330
331config RADIO_ZOLTRIX 331config RADIO_ZOLTRIX
332 tristate "Zoltrix Radio" 332 tristate "Zoltrix Radio"
333 depends on ISA && VIDEO_DEV 333 depends on ISA && VIDEO_V4L1
334 ---help--- 334 ---help---
335 Choose Y here if you have one of these FM radio cards, and then fill 335 Choose Y here if you have one of these FM radio cards, and then fill
336 in the port address below. 336 in the port address below.
diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig
index 85888a8a93c9..6b4197018561 100644
--- a/drivers/media/video/Kconfig
+++ b/drivers/media/video/Kconfig
@@ -2,10 +2,10 @@
2# Multimedia Video device configuration 2# Multimedia Video device configuration
3# 3#
4 4
5menu "Video For Linux" 5menu "Video Capture Adapters"
6 depends on VIDEO_DEV 6 depends on VIDEO_DEV
7 7
8comment "Video Adapters" 8comment "Video Capture Adapters"
9 9
10config VIDEO_ADV_DEBUG 10config VIDEO_ADV_DEBUG
11 bool "Enable advanced debug functionality" 11 bool "Enable advanced debug functionality"
@@ -16,11 +16,23 @@ config VIDEO_ADV_DEBUG
16 V4L devices. 16 V4L devices.
17 In doubt, say N. 17 In doubt, say N.
18 18
19config VIDEO_VIVI
20 tristate "Virtual Video Driver"
21 depends on VIDEO_V4L2 && !SPARC32 && !SPARC64
22 select VIDEO_BUF
23 default n
24 ---help---
25 Enables a virtual video driver. This device shows a color bar
26 and a timestamp, as a real device would generate by using V4L2
27 api.
28 Say Y here if you want to test video apps or debug V4L devices.
29 In doubt, say N.
30
19source "drivers/media/video/bt8xx/Kconfig" 31source "drivers/media/video/bt8xx/Kconfig"
20 32
21config VIDEO_SAA6588 33config VIDEO_SAA6588
22 tristate "SAA6588 Radio Chip RDS decoder support on BT848 cards" 34 tristate "SAA6588 Radio Chip RDS decoder support on BT848 cards"
23 depends on VIDEO_DEV && I2C && VIDEO_BT848 35 depends on I2C && VIDEO_BT848
24 36
25 help 37 help
26 Support for Radio Data System (RDS) decoder. This allows seeing 38 Support for Radio Data System (RDS) decoder. This allows seeing
@@ -32,7 +44,7 @@ config VIDEO_SAA6588
32 44
33config VIDEO_PMS 45config VIDEO_PMS
34 tristate "Mediavision Pro Movie Studio Video For Linux" 46 tristate "Mediavision Pro Movie Studio Video For Linux"
35 depends on VIDEO_DEV && ISA 47 depends on ISA && VIDEO_V4L1
36 help 48 help
37 Say Y if you have such a thing. 49 Say Y if you have such a thing.
38 50
@@ -41,7 +53,7 @@ config VIDEO_PMS
41 53
42config VIDEO_PLANB 54config VIDEO_PLANB
43 tristate "PlanB Video-In on PowerMac" 55 tristate "PlanB Video-In on PowerMac"
44 depends on PPC_PMAC && VIDEO_DEV && BROKEN 56 depends on PPC_PMAC && VIDEO_V4L1 && BROKEN
45 help 57 help
46 PlanB is the V4L driver for the PowerMac 7x00/8x00 series video 58 PlanB is the V4L driver for the PowerMac 7x00/8x00 series video
47 input hardware. If you want to experiment with this, say Y. 59 input hardware. If you want to experiment with this, say Y.
@@ -52,7 +64,7 @@ config VIDEO_PLANB
52 64
53config VIDEO_BWQCAM 65config VIDEO_BWQCAM
54 tristate "Quickcam BW Video For Linux" 66 tristate "Quickcam BW Video For Linux"
55 depends on VIDEO_DEV && PARPORT 67 depends on PARPORT && VIDEO_V4L1
56 help 68 help
57 Say Y have if you the black and white version of the QuickCam 69 Say Y have if you the black and white version of the QuickCam
58 camera. See the next option for the color version. 70 camera. See the next option for the color version.
@@ -62,7 +74,7 @@ config VIDEO_BWQCAM
62 74
63config VIDEO_CQCAM 75config VIDEO_CQCAM
64 tristate "QuickCam Colour Video For Linux (EXPERIMENTAL)" 76 tristate "QuickCam Colour Video For Linux (EXPERIMENTAL)"
65 depends on EXPERIMENTAL && VIDEO_DEV && PARPORT 77 depends on EXPERIMENTAL && PARPORT && VIDEO_V4L1
66 help 78 help
67 This is the video4linux driver for the colour version of the 79 This is the video4linux driver for the colour version of the
68 Connectix QuickCam. If you have one of these cameras, say Y here, 80 Connectix QuickCam. If you have one of these cameras, say Y here,
@@ -73,7 +85,7 @@ config VIDEO_CQCAM
73 85
74config VIDEO_W9966 86config VIDEO_W9966
75 tristate "W9966CF Webcam (FlyCam Supra and others) Video For Linux" 87 tristate "W9966CF Webcam (FlyCam Supra and others) Video For Linux"
76 depends on PARPORT_1284 && VIDEO_DEV && PARPORT 88 depends on PARPORT_1284 && PARPORT && VIDEO_V4L1
77 help 89 help
78 Video4linux driver for Winbond's w9966 based Webcams. 90 Video4linux driver for Winbond's w9966 based Webcams.
79 Currently tested with the LifeView FlyCam Supra. 91 Currently tested with the LifeView FlyCam Supra.
@@ -86,7 +98,7 @@ config VIDEO_W9966
86 98
87config VIDEO_CPIA 99config VIDEO_CPIA
88 tristate "CPiA Video For Linux" 100 tristate "CPiA Video For Linux"
89 depends on VIDEO_DEV 101 depends on VIDEO_V4L1
90 ---help--- 102 ---help---
91 This is the video4linux driver for cameras based on Vision's CPiA 103 This is the video4linux driver for cameras based on Vision's CPiA
92 (Colour Processor Interface ASIC), such as the Creative Labs Video 104 (Colour Processor Interface ASIC), such as the Creative Labs Video
@@ -123,7 +135,7 @@ source "drivers/media/video/cpia2/Kconfig"
123 135
124config VIDEO_SAA5246A 136config VIDEO_SAA5246A
125 tristate "SAA5246A, SAA5281 Teletext processor" 137 tristate "SAA5246A, SAA5281 Teletext processor"
126 depends on VIDEO_DEV && I2C 138 depends on I2C && VIDEO_V4L1
127 help 139 help
128 Support for I2C bus based teletext using the SAA5246A or SAA5281 140 Support for I2C bus based teletext using the SAA5246A or SAA5281
129 chip. Useful only if you live in Europe. 141 chip. Useful only if you live in Europe.
@@ -150,7 +162,7 @@ config TUNER_3036
150 162
151config VIDEO_VINO 163config VIDEO_VINO
152 tristate "SGI Vino Video For Linux (EXPERIMENTAL)" 164 tristate "SGI Vino Video For Linux (EXPERIMENTAL)"
153 depends on VIDEO_DEV && I2C && SGI_IP22 && EXPERIMENTAL 165 depends on I2C && SGI_IP22 && EXPERIMENTAL && VIDEO_V4L1
154 select I2C_ALGO_SGI 166 select I2C_ALGO_SGI
155 help 167 help
156 Say Y here to build in support for the Vino video input system found 168 Say Y here to build in support for the Vino video input system found
@@ -158,7 +170,7 @@ config VIDEO_VINO
158 170
159config VIDEO_STRADIS 171config VIDEO_STRADIS
160 tristate "Stradis 4:2:2 MPEG-2 video driver (EXPERIMENTAL)" 172 tristate "Stradis 4:2:2 MPEG-2 video driver (EXPERIMENTAL)"
161 depends on EXPERIMENTAL && VIDEO_DEV && PCI 173 depends on EXPERIMENTAL && PCI && VIDEO_V4L1 && !PPC64
162 help 174 help
163 Say Y here to enable support for the Stradis 4:2:2 MPEG-2 video 175 Say Y here to enable support for the Stradis 4:2:2 MPEG-2 video
164 driver for PCI. There is a product page at 176 driver for PCI. There is a product page at
@@ -166,7 +178,7 @@ config VIDEO_STRADIS
166 178
167config VIDEO_ZORAN 179config VIDEO_ZORAN
168 tristate "Zoran ZR36057/36067 Video For Linux" 180 tristate "Zoran ZR36057/36067 Video For Linux"
169 depends on VIDEO_DEV && PCI && I2C_ALGOBIT 181 depends on PCI && I2C_ALGOBIT && VIDEO_V4L1 && !PPC64
170 help 182 help
171 Say Y for support for MJPEG capture cards based on the Zoran 183 Say Y for support for MJPEG capture cards based on the Zoran
172 36057/36067 PCI controller chipset. This includes the Iomega 184 36057/36067 PCI controller chipset. This includes the Iomega
@@ -214,7 +226,7 @@ config VIDEO_ZORAN_LML33R10
214 226
215config VIDEO_ZR36120 227config VIDEO_ZR36120
216 tristate "Zoran ZR36120/36125 Video For Linux" 228 tristate "Zoran ZR36120/36125 Video For Linux"
217 depends on VIDEO_DEV && PCI && I2C && BROKEN 229 depends on PCI && I2C && VIDEO_V4L1 && BROKEN
218 help 230 help
219 Support for ZR36120/ZR36125 based frame grabber/overlay boards. 231 Support for ZR36120/ZR36125 based frame grabber/overlay boards.
220 This includes the Victor II, WaveWatcher, Video Wonder, Maxi-TV, 232 This includes the Victor II, WaveWatcher, Video Wonder, Maxi-TV,
@@ -226,7 +238,7 @@ config VIDEO_ZR36120
226 238
227config VIDEO_MEYE 239config VIDEO_MEYE
228 tristate "Sony Vaio Picturebook Motion Eye Video For Linux" 240 tristate "Sony Vaio Picturebook Motion Eye Video For Linux"
229 depends on VIDEO_DEV && PCI && SONYPI 241 depends on PCI && SONYPI && VIDEO_V4L1
230 ---help--- 242 ---help---
231 This is the video4linux driver for the Motion Eye camera found 243 This is the video4linux driver for the Motion Eye camera found
232 in the Vaio Picturebook laptops. Please read the material in 244 in the Vaio Picturebook laptops. Please read the material in
@@ -242,7 +254,7 @@ source "drivers/media/video/saa7134/Kconfig"
242 254
243config VIDEO_MXB 255config VIDEO_MXB
244 tristate "Siemens-Nixdorf 'Multimedia eXtension Board'" 256 tristate "Siemens-Nixdorf 'Multimedia eXtension Board'"
245 depends on VIDEO_DEV && PCI 257 depends on PCI && VIDEO_V4L1
246 select VIDEO_SAA7146_VV 258 select VIDEO_SAA7146_VV
247 select VIDEO_TUNER 259 select VIDEO_TUNER
248 ---help--- 260 ---help---
@@ -254,8 +266,9 @@ config VIDEO_MXB
254 266
255config VIDEO_DPC 267config VIDEO_DPC
256 tristate "Philips-Semiconductors 'dpc7146 demonstration board'" 268 tristate "Philips-Semiconductors 'dpc7146 demonstration board'"
257 depends on VIDEO_DEV && PCI 269 depends on PCI && VIDEO_V4L1
258 select VIDEO_SAA7146_VV 270 select VIDEO_SAA7146_VV
271 select VIDEO_V4L2
259 ---help--- 272 ---help---
260 This is a video4linux driver for the 'dpc7146 demonstration 273 This is a video4linux driver for the 'dpc7146 demonstration
261 board' by Philips-Semiconductors. It's the reference design 274 board' by Philips-Semiconductors. It's the reference design
@@ -268,8 +281,9 @@ config VIDEO_DPC
268 281
269config VIDEO_HEXIUM_ORION 282config VIDEO_HEXIUM_ORION
270 tristate "Hexium HV-PCI6 and Orion frame grabber" 283 tristate "Hexium HV-PCI6 and Orion frame grabber"
271 depends on VIDEO_DEV && PCI 284 depends on PCI && VIDEO_V4L1
272 select VIDEO_SAA7146_VV 285 select VIDEO_SAA7146_VV
286 select VIDEO_V4L2
273 ---help--- 287 ---help---
274 This is a video4linux driver for the Hexium HV-PCI6 and 288 This is a video4linux driver for the Hexium HV-PCI6 and
275 Orion frame grabber cards by Hexium. 289 Orion frame grabber cards by Hexium.
@@ -279,8 +293,9 @@ config VIDEO_HEXIUM_ORION
279 293
280config VIDEO_HEXIUM_GEMINI 294config VIDEO_HEXIUM_GEMINI
281 tristate "Hexium Gemini frame grabber" 295 tristate "Hexium Gemini frame grabber"
282 depends on VIDEO_DEV && PCI 296 depends on PCI && VIDEO_V4L1
283 select VIDEO_SAA7146_VV 297 select VIDEO_SAA7146_VV
298 select VIDEO_V4L2
284 ---help--- 299 ---help---
285 This is a video4linux driver for the Hexium Gemini frame 300 This is a video4linux driver for the Hexium Gemini frame
286 grabber card by Hexium. Please note that the Gemini Dual 301 grabber card by Hexium. Please note that the Gemini Dual
@@ -293,7 +308,7 @@ source "drivers/media/video/cx88/Kconfig"
293 308
294config VIDEO_OVCAMCHIP 309config VIDEO_OVCAMCHIP
295 tristate "OmniVision Camera Chip support" 310 tristate "OmniVision Camera Chip support"
296 depends on VIDEO_DEV && I2C 311 depends on I2C && VIDEO_V4L1
297 ---help--- 312 ---help---
298 Support for the OmniVision OV6xxx and OV7xxx series of camera chips. 313 Support for the OmniVision OV6xxx and OV7xxx series of camera chips.
299 This driver is intended to be used with the ov511 and w9968cf USB 314 This driver is intended to be used with the ov511 and w9968cf USB
@@ -304,7 +319,7 @@ config VIDEO_OVCAMCHIP
304 319
305config VIDEO_M32R_AR 320config VIDEO_M32R_AR
306 tristate "AR devices" 321 tristate "AR devices"
307 depends on M32R 322 depends on M32R && VIDEO_V4L1
308 ---help--- 323 ---help---
309 This is a video4linux driver for the Renesas AR (Artificial Retina) 324 This is a video4linux driver for the Renesas AR (Artificial Retina)
310 camera module. 325 camera module.
@@ -365,17 +380,17 @@ config VIDEO_WM8739
365source "drivers/media/video/cx25840/Kconfig" 380source "drivers/media/video/cx25840/Kconfig"
366 381
367config VIDEO_SAA711X 382config VIDEO_SAA711X
368 tristate "Philips SAA7113/4/5 video decoders" 383 tristate "Philips SAA7113/4/5 video decoders (OBSOLETED)"
369 depends on VIDEO_DEV && I2C && EXPERIMENTAL 384 depends on VIDEO_V4L1 && I2C && EXPERIMENTAL
370 ---help--- 385 ---help---
371 Support for the Philips SAA7113/4/5 video decoders. 386 Old support for the Philips SAA7113/4 video decoders.
372 387
373 To compile this driver as a module, choose M here: the 388 To compile this driver as a module, choose M here: the
374 module will be called saa7115. 389 module will be called saa7115.
375 390
376config VIDEO_SAA7127 391config VIDEO_SAA7127
377 tristate "Philips SAA7127/9 digital video encoders" 392 tristate "Philips SAA7127/9 digital video encoders"
378 depends on VIDEO_DEV && I2C && EXPERIMENTAL 393 depends on VIDEO_V4L2 && I2C && EXPERIMENTAL
379 ---help--- 394 ---help---
380 Support for the Philips SAA7127/9 digital video encoders. 395 Support for the Philips SAA7127/9 digital video encoders.
381 396
@@ -384,7 +399,7 @@ config VIDEO_SAA7127
384 399
385config VIDEO_UPD64031A 400config VIDEO_UPD64031A
386 tristate "NEC Electronics uPD64031A Ghost Reduction" 401 tristate "NEC Electronics uPD64031A Ghost Reduction"
387 depends on VIDEO_DEV && I2C && EXPERIMENTAL 402 depends on VIDEO_V4L2 && I2C && EXPERIMENTAL
388 ---help--- 403 ---help---
389 Support for the NEC Electronics uPD64031A Ghost Reduction 404 Support for the NEC Electronics uPD64031A Ghost Reduction
390 video chip. It is most often found in NTSC TV cards made for 405 video chip. It is most often found in NTSC TV cards made for
@@ -396,7 +411,7 @@ config VIDEO_UPD64031A
396 411
397config VIDEO_UPD64083 412config VIDEO_UPD64083
398 tristate "NEC Electronics uPD64083 3-Dimensional Y/C separation" 413 tristate "NEC Electronics uPD64083 3-Dimensional Y/C separation"
399 depends on VIDEO_DEV && I2C && EXPERIMENTAL 414 depends on VIDEO_V4L2 && I2C && EXPERIMENTAL
400 ---help--- 415 ---help---
401 Support for the NEC Electronics uPD64083 3-Dimensional Y/C 416 Support for the NEC Electronics uPD64083 3-Dimensional Y/C
402 separation video chip. It is used to improve the quality of 417 separation video chip. It is used to improve the quality of
@@ -418,7 +433,7 @@ source "drivers/media/video/em28xx/Kconfig"
418 433
419config USB_DSBR 434config USB_DSBR
420 tristate "D-Link USB FM radio support (EXPERIMENTAL)" 435 tristate "D-Link USB FM radio support (EXPERIMENTAL)"
421 depends on USB && VIDEO_DEV && EXPERIMENTAL 436 depends on USB && VIDEO_V4L1 && EXPERIMENTAL
422 ---help--- 437 ---help---
423 Say Y here if you want to connect this type of radio to your 438 Say Y here if you want to connect this type of radio to your
424 computer's USB port. Note that the audio is not digital, and 439 computer's USB port. Note that the audio is not digital, and
@@ -434,7 +449,7 @@ source "drivers/media/video/et61x251/Kconfig"
434 449
435config USB_OV511 450config USB_OV511
436 tristate "USB OV511 Camera support" 451 tristate "USB OV511 Camera support"
437 depends on USB && VIDEO_DEV 452 depends on USB && VIDEO_V4L1
438 ---help--- 453 ---help---
439 Say Y here if you want to connect this type of camera to your 454 Say Y here if you want to connect this type of camera to your
440 computer's USB port. See <file:Documentation/video4linux/ov511.txt> 455 computer's USB port. See <file:Documentation/video4linux/ov511.txt>
@@ -445,7 +460,7 @@ config USB_OV511
445 460
446config USB_SE401 461config USB_SE401
447 tristate "USB SE401 Camera support" 462 tristate "USB SE401 Camera support"
448 depends on USB && VIDEO_DEV 463 depends on USB && VIDEO_V4L1
449 ---help--- 464 ---help---
450 Say Y here if you want to connect this type of camera to your 465 Say Y here if you want to connect this type of camera to your
451 computer's USB port. See <file:Documentation/video4linux/se401.txt> 466 computer's USB port. See <file:Documentation/video4linux/se401.txt>
@@ -458,7 +473,7 @@ source "drivers/media/video/sn9c102/Kconfig"
458 473
459config USB_STV680 474config USB_STV680
460 tristate "USB STV680 (Pencam) Camera support" 475 tristate "USB STV680 (Pencam) Camera support"
461 depends on USB && VIDEO_DEV 476 depends on USB && VIDEO_V4L1
462 ---help--- 477 ---help---
463 Say Y here if you want to connect this type of camera to your 478 Say Y here if you want to connect this type of camera to your
464 computer's USB port. This includes the Pencam line of cameras. 479 computer's USB port. This includes the Pencam line of cameras.
@@ -470,7 +485,7 @@ config USB_STV680
470 485
471config USB_W9968CF 486config USB_W9968CF
472 tristate "USB W996[87]CF JPEG Dual Mode Camera support" 487 tristate "USB W996[87]CF JPEG Dual Mode Camera support"
473 depends on USB && VIDEO_DEV && I2C 488 depends on USB && VIDEO_V4L1 && I2C
474 select VIDEO_OVCAMCHIP 489 select VIDEO_OVCAMCHIP
475 ---help--- 490 ---help---
476 Say Y here if you want support for cameras based on OV681 or 491 Say Y here if you want support for cameras based on OV681 or
diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile
index b3ea2d63db9b..e5bf2687b76d 100644
--- a/drivers/media/video/Makefile
+++ b/drivers/media/video/Makefile
@@ -10,7 +10,11 @@ tuner-objs := tuner-core.o tuner-types.o tuner-simple.o \
10 10
11msp3400-objs := msp3400-driver.o msp3400-kthreads.o 11msp3400-objs := msp3400-driver.o msp3400-kthreads.o
12 12
13obj-$(CONFIG_VIDEO_DEV) += videodev.o v4l2-common.o v4l1-compat.o compat_ioctl32.o 13obj-$(CONFIG_VIDEO_DEV) += videodev.o v4l2-common.o compat_ioctl32.o
14
15ifeq ($(CONFIG_VIDEO_V4L1_COMPAT),y)
16 obj-$(CONFIG_VIDEO_DEV) += v4l1-compat.o
17endif
14 18
15obj-$(CONFIG_VIDEO_BT848) += bt8xx/ 19obj-$(CONFIG_VIDEO_BT848) += bt8xx/
16obj-$(CONFIG_VIDEO_BT848) += tvaudio.o tda7432.o tda9875.o ir-kbd-i2c.o 20obj-$(CONFIG_VIDEO_BT848) += tvaudio.o tda7432.o tda9875.o ir-kbd-i2c.o
@@ -84,4 +88,8 @@ obj-$(CONFIG_USB_IBMCAM) += usbvideo/
84obj-$(CONFIG_USB_KONICAWC) += usbvideo/ 88obj-$(CONFIG_USB_KONICAWC) += usbvideo/
85obj-$(CONFIG_USB_VICAM) += usbvideo/ 89obj-$(CONFIG_USB_VICAM) += usbvideo/
86 90
91obj-$(CONFIG_VIDEO_VIVI) += vivi.o
92
87EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core 93EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core
94extra-cflags-$(CONFIG_VIDEO_V4L1_COMPAT) += -DCONFIG_VIDEO_V4L1_COMPAT
95
diff --git a/drivers/media/video/bt8xx/Kconfig b/drivers/media/video/bt8xx/Kconfig
index 085477c12612..153f6a4a96c9 100644
--- a/drivers/media/video/bt8xx/Kconfig
+++ b/drivers/media/video/bt8xx/Kconfig
@@ -1,6 +1,6 @@
1config VIDEO_BT848 1config VIDEO_BT848
2 tristate "BT848 Video For Linux" 2 tristate "BT848 Video For Linux"
3 depends on VIDEO_DEV && PCI && I2C 3 depends on VIDEO_DEV && PCI && I2C && VIDEO_V4L2
4 select I2C_ALGOBIT 4 select I2C_ALGOBIT
5 select FW_LOADER 5 select FW_LOADER
6 select VIDEO_BTCX 6 select VIDEO_BTCX
diff --git a/drivers/media/video/bt8xx/Makefile b/drivers/media/video/bt8xx/Makefile
index db641a36b197..a096a03418aa 100644
--- a/drivers/media/video/bt8xx/Makefile
+++ b/drivers/media/video/bt8xx/Makefile
@@ -8,5 +8,5 @@ bttv-objs := bttv-driver.o bttv-cards.o bttv-if.o \
8 8
9obj-$(CONFIG_VIDEO_BT848) += bttv.o 9obj-$(CONFIG_VIDEO_BT848) += bttv.o
10 10
11EXTRA_CFLAGS += -I$(src)/.. 11EXTRA_CFLAGS += -Idrivers/media/video
12EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core 12EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core
diff --git a/drivers/media/video/bt8xx/bttv-cards.c b/drivers/media/video/bt8xx/bttv-cards.c
index f209a7492051..2b64aa835b42 100644
--- a/drivers/media/video/bt8xx/bttv-cards.c
+++ b/drivers/media/video/bt8xx/bttv-cards.c
@@ -2991,13 +2991,13 @@ void __devinit bttv_idcard(struct bttv *btv)
2991 2991
2992 if (UNSET != audiomux[0]) { 2992 if (UNSET != audiomux[0]) {
2993 gpiobits = 0; 2993 gpiobits = 0;
2994 for (i = 0; i < 5; i++) { 2994 for (i = 0; i < 4; i++) {
2995 bttv_tvcards[btv->c.type].gpiomux[i] = audiomux[i]; 2995 bttv_tvcards[btv->c.type].gpiomux[i] = audiomux[i];
2996 gpiobits |= audiomux[i]; 2996 gpiobits |= audiomux[i];
2997 } 2997 }
2998 } else { 2998 } else {
2999 gpiobits = audioall; 2999 gpiobits = audioall;
3000 for (i = 0; i < 5; i++) { 3000 for (i = 0; i < 4; i++) {
3001 bttv_tvcards[btv->c.type].gpiomux[i] = audioall; 3001 bttv_tvcards[btv->c.type].gpiomux[i] = audioall;
3002 } 3002 }
3003 } 3003 }
diff --git a/drivers/media/video/bt8xx/bttv-risc.c b/drivers/media/video/bt8xx/bttv-risc.c
index 16323a5d68ac..afcfe71e3792 100644
--- a/drivers/media/video/bt8xx/bttv-risc.c
+++ b/drivers/media/video/bt8xx/bttv-risc.c
@@ -233,7 +233,7 @@ bttv_risc_overlay(struct bttv *btv, struct btcx_riscmem *risc,
233 const struct bttv_format *fmt, struct bttv_overlay *ov, 233 const struct bttv_format *fmt, struct bttv_overlay *ov,
234 int skip_even, int skip_odd) 234 int skip_even, int skip_odd)
235{ 235{
236 int instructions,rc,line,maxy,start,end,skip,nskips; 236 int dwords,rc,line,maxy,start,end,skip,nskips;
237 struct btcx_skiplist *skips; 237 struct btcx_skiplist *skips;
238 u32 *rp,ri,ra; 238 u32 *rp,ri,ra;
239 u32 addr; 239 u32 addr;
@@ -242,12 +242,12 @@ bttv_risc_overlay(struct bttv *btv, struct btcx_riscmem *risc,
242 if (NULL == (skips = kmalloc(sizeof(*skips) * ov->nclips,GFP_KERNEL))) 242 if (NULL == (skips = kmalloc(sizeof(*skips) * ov->nclips,GFP_KERNEL)))
243 return -ENOMEM; 243 return -ENOMEM;
244 244
245 /* estimate risc mem: worst case is (clip+1) * lines instructions 245 /* estimate risc mem: worst case is (1.5*clip+1) * lines instructions
246 + sync + jump (all 2 dwords) */ 246 + sync + jump (all 2 dwords) */
247 instructions = (ov->nclips + 1) * 247 dwords = (3 * ov->nclips + 2) *
248 ((skip_even || skip_odd) ? ov->w.height>>1 : ov->w.height); 248 ((skip_even || skip_odd) ? (ov->w.height+1)>>1 : ov->w.height);
249 instructions += 2; 249 dwords += 4;
250 if ((rc = btcx_riscmem_alloc(btv->c.pci,risc,instructions*8)) < 0) { 250 if ((rc = btcx_riscmem_alloc(btv->c.pci,risc,dwords*4)) < 0) {
251 kfree(skips); 251 kfree(skips);
252 return rc; 252 return rc;
253 } 253 }
@@ -276,8 +276,6 @@ bttv_risc_overlay(struct bttv *btv, struct btcx_riscmem *risc,
276 if (line > maxy) 276 if (line > maxy)
277 btcx_calc_skips(line, ov->w.width, &maxy, 277 btcx_calc_skips(line, ov->w.width, &maxy,
278 skips, &nskips, ov->clips, ov->nclips); 278 skips, &nskips, ov->clips, ov->nclips);
279 else
280 nskips = 0;
281 279
282 /* write out risc code */ 280 /* write out risc code */
283 for (start = 0, skip = 0; start < ov->w.width; start = end) { 281 for (start = 0, skip = 0; start < ov->w.width; start = end) {
diff --git a/drivers/media/video/cx25840/cx25840-firmware.c b/drivers/media/video/cx25840/cx25840-firmware.c
index f59ced181c55..1958d4016ea1 100644
--- a/drivers/media/video/cx25840/cx25840-firmware.c
+++ b/drivers/media/video/cx25840/cx25840-firmware.c
@@ -39,29 +39,12 @@
39 39
40#define FWDEV(x) &((x)->adapter->dev) 40#define FWDEV(x) &((x)->adapter->dev)
41 41
42static int fastfw = 1;
43static char *firmware = FWFILE; 42static char *firmware = FWFILE;
44 43
45module_param(fastfw, bool, 0444);
46module_param(firmware, charp, 0444); 44module_param(firmware, charp, 0444);
47 45
48MODULE_PARM_DESC(fastfw, "Load firmware fast [0=100MHz 1=333MHz (default)]");
49MODULE_PARM_DESC(firmware, "Firmware image [default: " FWFILE "]"); 46MODULE_PARM_DESC(firmware, "Firmware image [default: " FWFILE "]");
50 47
51static void set_i2c_delay(struct i2c_client *client, int delay)
52{
53 struct i2c_algo_bit_data *algod = client->adapter->algo_data;
54
55 /* We aren't guaranteed to be using algo_bit,
56 * so avoid the null pointer dereference
57 * and disable the 'fast firmware load' */
58 if (algod) {
59 algod->udelay = delay;
60 } else {
61 fastfw = 0;
62 }
63}
64
65static void start_fw_load(struct i2c_client *client) 48static void start_fw_load(struct i2c_client *client)
66{ 49{
67 /* DL_ADDR_LB=0 DL_ADDR_HB=0 */ 50 /* DL_ADDR_LB=0 DL_ADDR_HB=0 */
@@ -71,16 +54,10 @@ static void start_fw_load(struct i2c_client *client)
71 cx25840_write(client, 0x803, 0x0b); 54 cx25840_write(client, 0x803, 0x0b);
72 /* AUTO_INC_DIS=1 */ 55 /* AUTO_INC_DIS=1 */
73 cx25840_write(client, 0x000, 0x20); 56 cx25840_write(client, 0x000, 0x20);
74
75 if (fastfw)
76 set_i2c_delay(client, 3);
77} 57}
78 58
79static void end_fw_load(struct i2c_client *client) 59static void end_fw_load(struct i2c_client *client)
80{ 60{
81 if (fastfw)
82 set_i2c_delay(client, 10);
83
84 /* AUTO_INC_DIS=0 */ 61 /* AUTO_INC_DIS=0 */
85 cx25840_write(client, 0x000, 0x00); 62 cx25840_write(client, 0x000, 0x00);
86 /* DL_ENABLE=0 */ 63 /* DL_ENABLE=0 */
@@ -107,30 +84,8 @@ static int fw_write(struct i2c_client *client, u8 * data, int size)
107 int sent; 84 int sent;
108 85
109 if ((sent = i2c_master_send(client, data, size)) < size) { 86 if ((sent = i2c_master_send(client, data, size)) < size) {
110 87 v4l_err(client, "firmware load i2c failure\n");
111 if (fastfw) { 88 return -ENOSYS;
112 v4l_err(client, "333MHz i2c firmware load failed\n");
113 fastfw = 0;
114 set_i2c_delay(client, 10);
115
116 if (sent > 2) {
117 u16 dl_addr = cx25840_read(client, 0x801) << 8;
118 dl_addr |= cx25840_read(client, 0x800);
119 dl_addr -= sent - 2;
120 cx25840_write(client, 0x801, dl_addr >> 8);
121 cx25840_write(client, 0x800, dl_addr & 0xff);
122 }
123
124 if (i2c_master_send(client, data, size) < size) {
125 v4l_err(client, "100MHz i2c firmware load failed\n");
126 return -ENOSYS;
127 }
128
129 } else {
130 v4l_err(client, "firmware load i2c failure\n");
131 return -ENOSYS;
132 }
133
134 } 89 }
135 90
136 return 0; 91 return 0;
diff --git a/drivers/media/video/cx88/cx88-alsa.c b/drivers/media/video/cx88/cx88-alsa.c
index f9d87b86492c..320b3d9384ba 100644
--- a/drivers/media/video/cx88/cx88-alsa.c
+++ b/drivers/media/video/cx88/cx88-alsa.c
@@ -616,7 +616,7 @@ static struct snd_kcontrol_new snd_cx88_capture_volume = {
616 * Only boards with eeprom and byte 1 at eeprom=1 have it 616 * Only boards with eeprom and byte 1 at eeprom=1 have it
617 */ 617 */
618 618
619static struct pci_device_id cx88_audio_pci_tbl[] = { 619static struct pci_device_id cx88_audio_pci_tbl[] __devinitdata = {
620 {0x14f1,0x8801,PCI_ANY_ID,PCI_ANY_ID,0,0,0}, 620 {0x14f1,0x8801,PCI_ANY_ID,PCI_ANY_ID,0,0,0},
621 {0x14f1,0x8811,PCI_ANY_ID,PCI_ANY_ID,0,0,0}, 621 {0x14f1,0x8811,PCI_ANY_ID,PCI_ANY_ID,0,0,0},
622 {0, } 622 {0, }
diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c
index c7042cf41231..f80154b87d22 100644
--- a/drivers/media/video/cx88/cx88-cards.c
+++ b/drivers/media/video/cx88/cx88-cards.c
@@ -564,7 +564,7 @@ struct cx88_board cx88_boards[] = {
564 }, 564 },
565 [CX88_BOARD_PCHDTV_HD3000] = { 565 [CX88_BOARD_PCHDTV_HD3000] = {
566 .name = "pcHDTV HD3000 HDTV", 566 .name = "pcHDTV HD3000 HDTV",
567 .tuner_type = TUNER_THOMSON_DTT7610, 567 .tuner_type = TUNER_THOMSON_DTT761X,
568 .radio_type = UNSET, 568 .radio_type = UNSET,
569 .tuner_addr = ADDR_UNSET, 569 .tuner_addr = ADDR_UNSET,
570 .radio_addr = ADDR_UNSET, 570 .radio_addr = ADDR_UNSET,
diff --git a/drivers/media/video/cx88/cx88-core.c b/drivers/media/video/cx88/cx88-core.c
index 2c3d9f1999be..e1092d5d4628 100644
--- a/drivers/media/video/cx88/cx88-core.c
+++ b/drivers/media/video/cx88/cx88-core.c
@@ -146,9 +146,11 @@ int cx88_risc_buffer(struct pci_dev *pci, struct btcx_riscmem *risc,
146 fields++; 146 fields++;
147 147
148 /* estimate risc mem: worst case is one write per page border + 148 /* estimate risc mem: worst case is one write per page border +
149 one write per scan line + syncs + jump (all 2 dwords) */ 149 one write per scan line + syncs + jump (all 2 dwords). Padding
150 instructions = (bpl * lines * fields) / PAGE_SIZE + lines * fields; 150 can cause next bpl to start close to a page border. First DMA
151 instructions += 3 + 4; 151 region may be smaller than PAGE_SIZE */
152 instructions = fields * (1 + ((bpl + padding) * lines) / PAGE_SIZE + lines);
153 instructions += 2;
152 if ((rc = btcx_riscmem_alloc(pci,risc,instructions*8)) < 0) 154 if ((rc = btcx_riscmem_alloc(pci,risc,instructions*8)) < 0)
153 return rc; 155 return rc;
154 156
@@ -176,9 +178,11 @@ int cx88_risc_databuffer(struct pci_dev *pci, struct btcx_riscmem *risc,
176 int rc; 178 int rc;
177 179
178 /* estimate risc mem: worst case is one write per page border + 180 /* estimate risc mem: worst case is one write per page border +
179 one write per scan line + syncs + jump (all 2 dwords) */ 181 one write per scan line + syncs + jump (all 2 dwords). Here
180 instructions = (bpl * lines) / PAGE_SIZE + lines; 182 there is no padding and no sync. First DMA region may be smaller
181 instructions += 3 + 4; 183 than PAGE_SIZE */
184 instructions = 1 + (bpl * lines) / PAGE_SIZE + lines;
185 instructions += 1;
182 if ((rc = btcx_riscmem_alloc(pci,risc,instructions*8)) < 0) 186 if ((rc = btcx_riscmem_alloc(pci,risc,instructions*8)) < 0)
183 return rc; 187 return rc;
184 188
diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c
index f0ea9b5cdbc2..3619a449aefd 100644
--- a/drivers/media/video/cx88/cx88-dvb.c
+++ b/drivers/media/video/cx88/cx88-dvb.c
@@ -372,7 +372,7 @@ static int or51132_set_ts_param(struct dvb_frontend* fe,
372static struct or51132_config pchdtv_hd3000 = { 372static struct or51132_config pchdtv_hd3000 = {
373 .demod_address = 0x15, 373 .demod_address = 0x15,
374 .pll_address = 0x61, 374 .pll_address = 0x61,
375 .pll_desc = &dvb_pll_thomson_dtt7610, 375 .pll_desc = &dvb_pll_thomson_dtt761x,
376 .set_ts_params = or51132_set_ts_param, 376 .set_ts_params = or51132_set_ts_param,
377}; 377};
378#endif 378#endif
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c
index 72a417b31745..694d1d80ff3f 100644
--- a/drivers/media/video/cx88/cx88-video.c
+++ b/drivers/media/video/cx88/cx88-video.c
@@ -35,8 +35,10 @@
35#include "cx88.h" 35#include "cx88.h"
36#include <media/v4l2-common.h> 36#include <media/v4l2-common.h>
37 37
38#ifdef CONFIG_VIDEO_V4L1_COMPAT
38/* Include V4L1 specific functions. Should be removed soon */ 39/* Include V4L1 specific functions. Should be removed soon */
39#include <linux/videodev.h> 40#include <linux/videodev.h>
41#endif
40 42
41MODULE_DESCRIPTION("v4l2 driver module for cx2388x based TV cards"); 43MODULE_DESCRIPTION("v4l2 driver module for cx2388x based TV cards");
42MODULE_AUTHOR("Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]"); 44MODULE_AUTHOR("Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]");
diff --git a/drivers/media/video/em28xx/Kconfig b/drivers/media/video/em28xx/Kconfig
index 5a793ae7cc23..dfb15bfb83dc 100644
--- a/drivers/media/video/em28xx/Kconfig
+++ b/drivers/media/video/em28xx/Kconfig
@@ -1,6 +1,6 @@
1config VIDEO_EM28XX 1config VIDEO_EM28XX
2 tristate "Empia EM2800/2820/2840 USB video capture support" 2 tristate "Empia EM2800/2820/2840 USB video capture support"
3 depends on VIDEO_DEV && USB && I2C 3 depends on VIDEO_V4L1 && USB && I2C
4 select VIDEO_BUF 4 select VIDEO_BUF
5 select VIDEO_TUNER 5 select VIDEO_TUNER
6 select VIDEO_TVEEPROM 6 select VIDEO_TVEEPROM
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c
index ddc92cbb5276..cf7cdf9ef617 100644
--- a/drivers/media/video/em28xx/em28xx-video.c
+++ b/drivers/media/video/em28xx/em28xx-video.c
@@ -1576,8 +1576,8 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev,
1576 errCode = em28xx_config(dev); 1576 errCode = em28xx_config(dev);
1577 if (errCode) { 1577 if (errCode) {
1578 em28xx_errdev("error configuring device\n"); 1578 em28xx_errdev("error configuring device\n");
1579 kfree(dev);
1580 em28xx_devused&=~(1<<dev->devno); 1579 em28xx_devused&=~(1<<dev->devno);
1580 kfree(dev);
1581 return -ENOMEM; 1581 return -ENOMEM;
1582 } 1582 }
1583 1583
@@ -1603,8 +1603,8 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev,
1603 dev->vdev = video_device_alloc(); 1603 dev->vdev = video_device_alloc();
1604 if (NULL == dev->vdev) { 1604 if (NULL == dev->vdev) {
1605 em28xx_errdev("cannot allocate video_device.\n"); 1605 em28xx_errdev("cannot allocate video_device.\n");
1606 kfree(dev);
1607 em28xx_devused&=~(1<<dev->devno); 1606 em28xx_devused&=~(1<<dev->devno);
1607 kfree(dev);
1608 return -ENOMEM; 1608 return -ENOMEM;
1609 } 1609 }
1610 1610
@@ -1612,8 +1612,8 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev,
1612 if (NULL == dev->vbi_dev) { 1612 if (NULL == dev->vbi_dev) {
1613 em28xx_errdev("cannot allocate video_device.\n"); 1613 em28xx_errdev("cannot allocate video_device.\n");
1614 kfree(dev->vdev); 1614 kfree(dev->vdev);
1615 kfree(dev);
1616 em28xx_devused&=~(1<<dev->devno); 1615 em28xx_devused&=~(1<<dev->devno);
1616 kfree(dev);
1617 return -ENOMEM; 1617 return -ENOMEM;
1618 } 1618 }
1619 1619
@@ -1650,8 +1650,8 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev,
1650 mutex_unlock(&dev->lock); 1650 mutex_unlock(&dev->lock);
1651 list_del(&dev->devlist); 1651 list_del(&dev->devlist);
1652 video_device_release(dev->vdev); 1652 video_device_release(dev->vdev);
1653 kfree(dev);
1654 em28xx_devused&=~(1<<dev->devno); 1653 em28xx_devused&=~(1<<dev->devno);
1654 kfree(dev);
1655 return -ENODEV; 1655 return -ENODEV;
1656 } 1656 }
1657 1657
@@ -1662,8 +1662,8 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev,
1662 list_del(&dev->devlist); 1662 list_del(&dev->devlist);
1663 video_device_release(dev->vbi_dev); 1663 video_device_release(dev->vbi_dev);
1664 video_device_release(dev->vdev); 1664 video_device_release(dev->vdev);
1665 kfree(dev);
1666 em28xx_devused&=~(1<<dev->devno); 1665 em28xx_devused&=~(1<<dev->devno);
1666 kfree(dev);
1667 return -ENODEV; 1667 return -ENODEV;
1668 } else { 1668 } else {
1669 printk("registered VBI\n"); 1669 printk("registered VBI\n");
diff --git a/drivers/media/video/et61x251/Kconfig b/drivers/media/video/et61x251/Kconfig
index 6c43a90c6569..c6bff705688d 100644
--- a/drivers/media/video/et61x251/Kconfig
+++ b/drivers/media/video/et61x251/Kconfig
@@ -1,6 +1,6 @@
1config USB_ET61X251 1config USB_ET61X251
2 tristate "USB ET61X[12]51 PC Camera Controller support" 2 tristate "USB ET61X[12]51 PC Camera Controller support"
3 depends on USB && VIDEO_DEV 3 depends on USB && VIDEO_V4L1
4 ---help--- 4 ---help---
5 Say Y here if you want support for cameras based on Etoms ET61X151 5 Say Y here if you want support for cameras based on Etoms ET61X151
6 or ET61X251 PC Camera Controllers. 6 or ET61X251 PC Camera Controllers.
diff --git a/drivers/media/video/pwc/Kconfig b/drivers/media/video/pwc/Kconfig
index 86376556f108..53cbc950f95c 100644
--- a/drivers/media/video/pwc/Kconfig
+++ b/drivers/media/video/pwc/Kconfig
@@ -1,6 +1,6 @@
1config USB_PWC 1config USB_PWC
2 tristate "USB Philips Cameras" 2 tristate "USB Philips Cameras"
3 depends on USB && VIDEO_DEV 3 depends on USB && VIDEO_V4L1
4 ---help--- 4 ---help---
5 Say Y or M here if you want to use one of these Philips & OEM 5 Say Y or M here if you want to use one of these Philips & OEM
6 webcams: 6 webcams:
diff --git a/drivers/media/video/pwc/Makefile b/drivers/media/video/pwc/Makefile
index 8326684f49f3..33d60126c024 100644
--- a/drivers/media/video/pwc/Makefile
+++ b/drivers/media/video/pwc/Makefile
@@ -1,20 +1,3 @@
1ifneq ($(KERNELRELEASE),)
2
3pwc-objs := pwc-if.o pwc-misc.o pwc-ctrl.o pwc-uncompress.o pwc-timon.o pwc-kiara.o 1pwc-objs := pwc-if.o pwc-misc.o pwc-ctrl.o pwc-uncompress.o pwc-timon.o pwc-kiara.o
4 2
5obj-$(CONFIG_USB_PWC) += pwc.o 3obj-$(CONFIG_USB_PWC) += pwc.o
6
7else
8
9KDIR := /lib/modules/$(shell uname -r)/build
10PWD := $(shell pwd)
11
12default:
13 $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
14
15endif
16
17clean:
18 rm -f *.[oas] .*.flags *.ko .*.cmd .*.d .*.tmp *.mod.c
19 rm -rf .tmp_versions
20
diff --git a/drivers/media/video/saa7127.c b/drivers/media/video/saa7127.c
index 133f9e5252fe..c271e2e14105 100644
--- a/drivers/media/video/saa7127.c
+++ b/drivers/media/video/saa7127.c
@@ -142,6 +142,7 @@ struct i2c_reg_value {
142static const struct i2c_reg_value saa7129_init_config_extra[] = { 142static const struct i2c_reg_value saa7129_init_config_extra[] = {
143 { SAA7127_REG_OUTPUT_PORT_CONTROL, 0x38 }, 143 { SAA7127_REG_OUTPUT_PORT_CONTROL, 0x38 },
144 { SAA7127_REG_VTRIG, 0xfa }, 144 { SAA7127_REG_VTRIG, 0xfa },
145 { 0, 0 }
145}; 146};
146 147
147static const struct i2c_reg_value saa7127_init_config_common[] = { 148static const struct i2c_reg_value saa7127_init_config_common[] = {
diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c
index e666a4465ca4..86eae3528330 100644
--- a/drivers/media/video/saa7134/saa7134-cards.c
+++ b/drivers/media/video/saa7134/saa7134-cards.c
@@ -3504,6 +3504,7 @@ int saa7134_board_init1(struct saa7134_dev *dev)
3504 /* power-up tuner chip */ 3504 /* power-up tuner chip */
3505 saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, 0x00040000, 0x00040000); 3505 saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, 0x00040000, 0x00040000);
3506 saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x00040000, 0x00000000); 3506 saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x00040000, 0x00000000);
3507 break;
3507 case SAA7134_BOARD_PINNACLE_300I_DVBT_PAL: 3508 case SAA7134_BOARD_PINNACLE_300I_DVBT_PAL:
3508 /* this turns the remote control chip off to work around a bug in it */ 3509 /* this turns the remote control chip off to work around a bug in it */
3509 saa_writeb(SAA7134_GPIO_GPMODE1, 0x80); 3510 saa_writeb(SAA7134_GPIO_GPMODE1, 0x80);
diff --git a/drivers/media/video/saa7134/saa7134-core.c b/drivers/media/video/saa7134/saa7134-core.c
index 13de05532e0a..f0c2111f14ad 100644
--- a/drivers/media/video/saa7134/saa7134-core.c
+++ b/drivers/media/video/saa7134/saa7134-core.c
@@ -548,6 +548,8 @@ static irqreturn_t saa7134_irq(int irq, void *dev_id, struct pt_regs *regs)
548 if (report & SAA7134_IRQ_REPORT_GPIO16) { 548 if (report & SAA7134_IRQ_REPORT_GPIO16) {
549 switch (dev->has_remote) { 549 switch (dev->has_remote) {
550 case SAA7134_REMOTE_GPIO: 550 case SAA7134_REMOTE_GPIO:
551 if (!dev->remote)
552 break;
551 if (dev->remote->mask_keydown & 0x10000) { 553 if (dev->remote->mask_keydown & 0x10000) {
552 saa7134_input_irq(dev); 554 saa7134_input_irq(dev);
553 } 555 }
@@ -564,6 +566,8 @@ static irqreturn_t saa7134_irq(int irq, void *dev_id, struct pt_regs *regs)
564 if (report & SAA7134_IRQ_REPORT_GPIO18) { 566 if (report & SAA7134_IRQ_REPORT_GPIO18) {
565 switch (dev->has_remote) { 567 switch (dev->has_remote) {
566 case SAA7134_REMOTE_GPIO: 568 case SAA7134_REMOTE_GPIO:
569 if (!dev->remote)
570 break;
567 if ((dev->remote->mask_keydown & 0x40000) || 571 if ((dev->remote->mask_keydown & 0x40000) ||
568 (dev->remote->mask_keyup & 0x40000)) { 572 (dev->remote->mask_keyup & 0x40000)) {
569 saa7134_input_irq(dev); 573 saa7134_input_irq(dev);
@@ -676,7 +680,7 @@ static int saa7134_hwinit2(struct saa7134_dev *dev)
676 SAA7134_IRQ2_INTE_PE | 680 SAA7134_IRQ2_INTE_PE |
677 SAA7134_IRQ2_INTE_AR; 681 SAA7134_IRQ2_INTE_AR;
678 682
679 if (dev->has_remote == SAA7134_REMOTE_GPIO) { 683 if (dev->has_remote == SAA7134_REMOTE_GPIO && dev->remote) {
680 if (dev->remote->mask_keydown & 0x10000) 684 if (dev->remote->mask_keydown & 0x10000)
681 irq2_mask |= SAA7134_IRQ2_INTE_GPIO16; 685 irq2_mask |= SAA7134_IRQ2_INTE_GPIO16;
682 else if (dev->remote->mask_keydown & 0x40000) 686 else if (dev->remote->mask_keydown & 0x40000)
diff --git a/drivers/media/video/saa7134/saa7134-video.c b/drivers/media/video/saa7134/saa7134-video.c
index aeef80f88a6b..e4156ec9c6d7 100644
--- a/drivers/media/video/saa7134/saa7134-video.c
+++ b/drivers/media/video/saa7134/saa7134-video.c
@@ -31,8 +31,10 @@
31#include "saa7134.h" 31#include "saa7134.h"
32#include <media/v4l2-common.h> 32#include <media/v4l2-common.h>
33 33
34#ifdef CONFIG_VIDEO_V4L1_COMPAT
34/* Include V4L1 specific functions. Should be removed soon */ 35/* Include V4L1 specific functions. Should be removed soon */
35#include <linux/videodev.h> 36#include <linux/videodev.h>
37#endif
36 38
37/* ------------------------------------------------------------------ */ 39/* ------------------------------------------------------------------ */
38 40
diff --git a/drivers/media/video/sn9c102/Kconfig b/drivers/media/video/sn9c102/Kconfig
index 55f2bc11964b..cf552e6b8ecf 100644
--- a/drivers/media/video/sn9c102/Kconfig
+++ b/drivers/media/video/sn9c102/Kconfig
@@ -1,6 +1,6 @@
1config USB_SN9C102 1config USB_SN9C102
2 tristate "USB SN9C10x PC Camera Controller support" 2 tristate "USB SN9C10x PC Camera Controller support"
3 depends on USB && VIDEO_DEV 3 depends on USB && VIDEO_V4L1
4 ---help--- 4 ---help---
5 Say Y here if you want support for cameras based on SONiX SN9C101, 5 Say Y here if you want support for cameras based on SONiX SN9C101,
6 SN9C102 or SN9C103 PC Camera Controllers. 6 SN9C102 or SN9C103 PC Camera Controllers.
diff --git a/drivers/media/video/tuner-types.c b/drivers/media/video/tuner-types.c
index 72e0f01db563..a1ae036b44ec 100644
--- a/drivers/media/video/tuner-types.c
+++ b/drivers/media/video/tuner-types.c
@@ -877,8 +877,8 @@ static struct tuner_params tuner_philips_fmd1216me_mk3_params[] = {
877/* ------------ TUNER_LG_TDVS_H062F - INFINEON ATSC ------------ */ 877/* ------------ TUNER_LG_TDVS_H062F - INFINEON ATSC ------------ */
878 878
879static struct tuner_range tuner_tua6034_ntsc_ranges[] = { 879static struct tuner_range tuner_tua6034_ntsc_ranges[] = {
880 { 16 * 160.00 /*MHz*/, 0x8e, 0x01 }, 880 { 16 * 165.00 /*MHz*/, 0x8e, 0x01 },
881 { 16 * 455.00 /*MHz*/, 0x8e, 0x02 }, 881 { 16 * 450.00 /*MHz*/, 0x8e, 0x02 },
882 { 16 * 999.99 , 0x8e, 0x04 }, 882 { 16 * 999.99 , 0x8e, 0x04 },
883}; 883};
884 884
diff --git a/drivers/media/video/tveeprom.c b/drivers/media/video/tveeprom.c
index 431c3e2f6c42..b463e996961a 100644
--- a/drivers/media/video/tveeprom.c
+++ b/drivers/media/video/tveeprom.c
@@ -218,7 +218,7 @@ hauppauge_tuner[] =
218 /* 110-119 */ 218 /* 110-119 */
219 { TUNER_ABSENT, "Thompson DTT75105"}, 219 { TUNER_ABSENT, "Thompson DTT75105"},
220 { TUNER_ABSENT, "Conexant_CX24109"}, 220 { TUNER_ABSENT, "Conexant_CX24109"},
221 { TUNER_ABSENT, "TCL M2523_5N_E"}, 221 { TUNER_TCL_2002N, "TCL M2523_5N_E"},
222 { TUNER_ABSENT, "TCL M2523_3DB_E"}, 222 { TUNER_ABSENT, "TCL M2523_3DB_E"},
223 { TUNER_ABSENT, "Philips 8275A"}, 223 { TUNER_ABSENT, "Philips 8275A"},
224 { TUNER_ABSENT, "Microtune MT2060"}, 224 { TUNER_ABSENT, "Microtune MT2060"},
diff --git a/drivers/media/video/usbvideo/Kconfig b/drivers/media/video/usbvideo/Kconfig
index 08a5d20bb2c0..39269a2c5635 100644
--- a/drivers/media/video/usbvideo/Kconfig
+++ b/drivers/media/video/usbvideo/Kconfig
@@ -3,7 +3,7 @@ config VIDEO_USBVIDEO
3 3
4config USB_VICAM 4config USB_VICAM
5 tristate "USB 3com HomeConnect (aka vicam) support (EXPERIMENTAL)" 5 tristate "USB 3com HomeConnect (aka vicam) support (EXPERIMENTAL)"
6 depends on USB && VIDEO_DEV && EXPERIMENTAL 6 depends on USB && VIDEO_V4L1 && EXPERIMENTAL
7 select VIDEO_USBVIDEO 7 select VIDEO_USBVIDEO
8 ---help--- 8 ---help---
9 Say Y here if you have 3com homeconnect camera (vicam). 9 Say Y here if you have 3com homeconnect camera (vicam).
@@ -13,7 +13,7 @@ config USB_VICAM
13 13
14config USB_IBMCAM 14config USB_IBMCAM
15 tristate "USB IBM (Xirlink) C-it Camera support" 15 tristate "USB IBM (Xirlink) C-it Camera support"
16 depends on USB && VIDEO_DEV 16 depends on USB && VIDEO_V4L1
17 select VIDEO_USBVIDEO 17 select VIDEO_USBVIDEO
18 ---help--- 18 ---help---
19 Say Y here if you want to connect a IBM "C-It" camera, also known as 19 Say Y here if you want to connect a IBM "C-It" camera, also known as
@@ -28,7 +28,7 @@ config USB_IBMCAM
28 28
29config USB_KONICAWC 29config USB_KONICAWC
30 tristate "USB Konica Webcam support" 30 tristate "USB Konica Webcam support"
31 depends on USB && VIDEO_DEV 31 depends on USB && VIDEO_V4L1
32 select VIDEO_USBVIDEO 32 select VIDEO_USBVIDEO
33 ---help--- 33 ---help---
34 Say Y here if you want support for webcams based on a Konica 34 Say Y here if you want support for webcams based on a Konica
diff --git a/drivers/media/video/vivi.c b/drivers/media/video/vivi.c
index 5e813404d068..779db26771c0 100644
--- a/drivers/media/video/vivi.c
+++ b/drivers/media/video/vivi.c
@@ -26,6 +26,11 @@
26#include <linux/random.h> 26#include <linux/random.h>
27#include <linux/version.h> 27#include <linux/version.h>
28#include <linux/videodev2.h> 28#include <linux/videodev2.h>
29#include <linux/dma-mapping.h>
30#ifdef CONFIG_VIDEO_V4L1_COMPAT
31/* Include V4L1 specific functions. Should be removed soon */
32#include <linux/videodev.h>
33#endif
29#include <linux/interrupt.h> 34#include <linux/interrupt.h>
30#include <media/video-buf.h> 35#include <media/video-buf.h>
31#include <media/v4l2-common.h> 36#include <media/v4l2-common.h>
diff --git a/drivers/media/video/zc0301/Kconfig b/drivers/media/video/zc0301/Kconfig
index c3bf886b80cd..115833e4f4dd 100644
--- a/drivers/media/video/zc0301/Kconfig
+++ b/drivers/media/video/zc0301/Kconfig
@@ -1,6 +1,6 @@
1config USB_ZC0301 1config USB_ZC0301
2 tristate "USB ZC0301 Image Processor and Control Chip support" 2 tristate "USB ZC0301 Image Processor and Control Chip support"
3 depends on USB && VIDEO_DEV 3 depends on USB && VIDEO_V4L1
4 ---help--- 4 ---help---
5 Say Y here if you want support for cameras based on the ZC0301 5 Say Y here if you want support for cameras based on the ZC0301
6 Image Processor and Control Chip. 6 Image Processor and Control Chip.
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
index bb7ad4d0678a..164375eea896 100644
--- a/drivers/message/fusion/mptbase.c
+++ b/drivers/message/fusion/mptbase.c
@@ -1189,7 +1189,6 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
1189 ioc->diagPending = 0; 1189 ioc->diagPending = 0;
1190 spin_lock_init(&ioc->diagLock); 1190 spin_lock_init(&ioc->diagLock);
1191 spin_lock_init(&ioc->fc_rescan_work_lock); 1191 spin_lock_init(&ioc->fc_rescan_work_lock);
1192 spin_lock_init(&ioc->fc_rport_lock);
1193 spin_lock_init(&ioc->initializing_hba_lock); 1192 spin_lock_init(&ioc->initializing_hba_lock);
1194 1193
1195 /* Initialize the event logging. 1194 /* Initialize the event logging.
@@ -1569,6 +1568,21 @@ mpt_resume(struct pci_dev *pdev)
1569} 1568}
1570#endif 1569#endif
1571 1570
1571static int
1572mpt_signal_reset(int index, MPT_ADAPTER *ioc, int reset_phase)
1573{
1574 if ((MptDriverClass[index] == MPTSPI_DRIVER &&
1575 ioc->bus_type != SPI) ||
1576 (MptDriverClass[index] == MPTFC_DRIVER &&
1577 ioc->bus_type != FC) ||
1578 (MptDriverClass[index] == MPTSAS_DRIVER &&
1579 ioc->bus_type != SAS))
1580 /* make sure we only call the relevant reset handler
1581 * for the bus */
1582 return 0;
1583 return (MptResetHandlers[index])(ioc, reset_phase);
1584}
1585
1572/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 1586/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
1573/* 1587/*
1574 * mpt_do_ioc_recovery - Initialize or recover MPT adapter. 1588 * mpt_do_ioc_recovery - Initialize or recover MPT adapter.
@@ -1892,14 +1906,14 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
1892 if ((ret == 0) && MptResetHandlers[ii]) { 1906 if ((ret == 0) && MptResetHandlers[ii]) {
1893 dprintk((MYIOC_s_INFO_FMT "Calling IOC post_reset handler #%d\n", 1907 dprintk((MYIOC_s_INFO_FMT "Calling IOC post_reset handler #%d\n",
1894 ioc->name, ii)); 1908 ioc->name, ii));
1895 rc += (*(MptResetHandlers[ii]))(ioc, MPT_IOC_POST_RESET); 1909 rc += mpt_signal_reset(ii, ioc, MPT_IOC_POST_RESET);
1896 handlers++; 1910 handlers++;
1897 } 1911 }
1898 1912
1899 if (alt_ioc_ready && MptResetHandlers[ii]) { 1913 if (alt_ioc_ready && MptResetHandlers[ii]) {
1900 drsprintk((MYIOC_s_INFO_FMT "Calling alt-%s post_reset handler #%d\n", 1914 drsprintk((MYIOC_s_INFO_FMT "Calling alt-%s post_reset handler #%d\n",
1901 ioc->name, ioc->alt_ioc->name, ii)); 1915 ioc->name, ioc->alt_ioc->name, ii));
1902 rc += (*(MptResetHandlers[ii]))(ioc->alt_ioc, MPT_IOC_POST_RESET); 1916 rc += mpt_signal_reset(ii, ioc->alt_ioc, MPT_IOC_POST_RESET);
1903 handlers++; 1917 handlers++;
1904 } 1918 }
1905 } 1919 }
@@ -3280,11 +3294,11 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag)
3280 if (MptResetHandlers[ii]) { 3294 if (MptResetHandlers[ii]) {
3281 dprintk((MYIOC_s_INFO_FMT "Calling IOC pre_reset handler #%d\n", 3295 dprintk((MYIOC_s_INFO_FMT "Calling IOC pre_reset handler #%d\n",
3282 ioc->name, ii)); 3296 ioc->name, ii));
3283 r += (*(MptResetHandlers[ii]))(ioc, MPT_IOC_PRE_RESET); 3297 r += mpt_signal_reset(ii, ioc, MPT_IOC_PRE_RESET);
3284 if (ioc->alt_ioc) { 3298 if (ioc->alt_ioc) {
3285 dprintk((MYIOC_s_INFO_FMT "Calling alt-%s pre_reset handler #%d\n", 3299 dprintk((MYIOC_s_INFO_FMT "Calling alt-%s pre_reset handler #%d\n",
3286 ioc->name, ioc->alt_ioc->name, ii)); 3300 ioc->name, ioc->alt_ioc->name, ii));
3287 r += (*(MptResetHandlers[ii]))(ioc->alt_ioc, MPT_IOC_PRE_RESET); 3301 r += mpt_signal_reset(ii, ioc->alt_ioc, MPT_IOC_PRE_RESET);
3288 } 3302 }
3289 } 3303 }
3290 } 3304 }
@@ -5719,11 +5733,11 @@ mpt_HardResetHandler(MPT_ADAPTER *ioc, int sleepFlag)
5719 if (MptResetHandlers[ii]) { 5733 if (MptResetHandlers[ii]) {
5720 dtmprintk((MYIOC_s_INFO_FMT "Calling IOC reset_setup handler #%d\n", 5734 dtmprintk((MYIOC_s_INFO_FMT "Calling IOC reset_setup handler #%d\n",
5721 ioc->name, ii)); 5735 ioc->name, ii));
5722 r += (*(MptResetHandlers[ii]))(ioc, MPT_IOC_SETUP_RESET); 5736 r += mpt_signal_reset(ii, ioc, MPT_IOC_SETUP_RESET);
5723 if (ioc->alt_ioc) { 5737 if (ioc->alt_ioc) {
5724 dtmprintk((MYIOC_s_INFO_FMT "Calling alt-%s setup reset handler #%d\n", 5738 dtmprintk((MYIOC_s_INFO_FMT "Calling alt-%s setup reset handler #%d\n",
5725 ioc->name, ioc->alt_ioc->name, ii)); 5739 ioc->name, ioc->alt_ioc->name, ii));
5726 r += (*(MptResetHandlers[ii]))(ioc->alt_ioc, MPT_IOC_SETUP_RESET); 5740 r += mpt_signal_reset(ii, ioc->alt_ioc, MPT_IOC_SETUP_RESET);
5727 } 5741 }
5728 } 5742 }
5729 } 5743 }
@@ -5748,11 +5762,13 @@ mpt_HardResetHandler(MPT_ADAPTER *ioc, int sleepFlag)
5748 return rc; 5762 return rc;
5749} 5763}
5750 5764
5765# define EVENT_DESCR_STR_SZ 100
5766
5751/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 5767/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
5752static void 5768static void
5753EventDescriptionStr(u8 event, u32 evData0, char *evStr) 5769EventDescriptionStr(u8 event, u32 evData0, char *evStr)
5754{ 5770{
5755 char *ds; 5771 char *ds = NULL;
5756 5772
5757 switch(event) { 5773 switch(event) {
5758 case MPI_EVENT_NONE: 5774 case MPI_EVENT_NONE:
@@ -5789,9 +5805,9 @@ EventDescriptionStr(u8 event, u32 evData0, char *evStr)
5789 if (evData0 == MPI_EVENT_LOOP_STATE_CHANGE_LIP) 5805 if (evData0 == MPI_EVENT_LOOP_STATE_CHANGE_LIP)
5790 ds = "Loop State(LIP) Change"; 5806 ds = "Loop State(LIP) Change";
5791 else if (evData0 == MPI_EVENT_LOOP_STATE_CHANGE_LPE) 5807 else if (evData0 == MPI_EVENT_LOOP_STATE_CHANGE_LPE)
5792 ds = "Loop State(LPE) Change"; /* ??? */ 5808 ds = "Loop State(LPE) Change"; /* ??? */
5793 else 5809 else
5794 ds = "Loop State(LPB) Change"; /* ??? */ 5810 ds = "Loop State(LPB) Change"; /* ??? */
5795 break; 5811 break;
5796 case MPI_EVENT_LOGOUT: 5812 case MPI_EVENT_LOGOUT:
5797 ds = "Logout"; 5813 ds = "Logout";
@@ -5853,27 +5869,32 @@ EventDescriptionStr(u8 event, u32 evData0, char *evStr)
5853 break; 5869 break;
5854 case MPI_EVENT_SAS_DEVICE_STATUS_CHANGE: 5870 case MPI_EVENT_SAS_DEVICE_STATUS_CHANGE:
5855 { 5871 {
5856 char buf[50];
5857 u8 id = (u8)(evData0); 5872 u8 id = (u8)(evData0);
5858 u8 ReasonCode = (u8)(evData0 >> 16); 5873 u8 ReasonCode = (u8)(evData0 >> 16);
5859 switch (ReasonCode) { 5874 switch (ReasonCode) {
5860 case MPI_EVENT_SAS_DEV_STAT_RC_ADDED: 5875 case MPI_EVENT_SAS_DEV_STAT_RC_ADDED:
5861 sprintf(buf,"SAS Device Status Change: Added: id=%d", id); 5876 snprintf(evStr, EVENT_DESCR_STR_SZ,
5877 "SAS Device Status Change: Added: id=%d", id);
5862 break; 5878 break;
5863 case MPI_EVENT_SAS_DEV_STAT_RC_NOT_RESPONDING: 5879 case MPI_EVENT_SAS_DEV_STAT_RC_NOT_RESPONDING:
5864 sprintf(buf,"SAS Device Status Change: Deleted: id=%d", id); 5880 snprintf(evStr, EVENT_DESCR_STR_SZ,
5881 "SAS Device Status Change: Deleted: id=%d", id);
5865 break; 5882 break;
5866 case MPI_EVENT_SAS_DEV_STAT_RC_SMART_DATA: 5883 case MPI_EVENT_SAS_DEV_STAT_RC_SMART_DATA:
5867 sprintf(buf,"SAS Device Status Change: SMART Data: id=%d", id); 5884 snprintf(evStr, EVENT_DESCR_STR_SZ,
5885 "SAS Device Status Change: SMART Data: id=%d",
5886 id);
5868 break; 5887 break;
5869 case MPI_EVENT_SAS_DEV_STAT_RC_NO_PERSIST_ADDED: 5888 case MPI_EVENT_SAS_DEV_STAT_RC_NO_PERSIST_ADDED:
5870 sprintf(buf,"SAS Device Status Change: No Persistancy Added: id=%d", id); 5889 snprintf(evStr, EVENT_DESCR_STR_SZ,
5890 "SAS Device Status Change: No Persistancy "
5891 "Added: id=%d", id);
5871 break; 5892 break;
5872 default: 5893 default:
5873 sprintf(buf,"SAS Device Status Change: Unknown: id=%d", id); 5894 snprintf(evStr, EVENT_DESCR_STR_SZ,
5874 break; 5895 "SAS Device Status Change: Unknown: id=%d", id);
5896 break;
5875 } 5897 }
5876 ds = buf;
5877 break; 5898 break;
5878 } 5899 }
5879 case MPI_EVENT_ON_BUS_TIMER_EXPIRED: 5900 case MPI_EVENT_ON_BUS_TIMER_EXPIRED:
@@ -5890,41 +5911,46 @@ EventDescriptionStr(u8 event, u32 evData0, char *evStr)
5890 break; 5911 break;
5891 case MPI_EVENT_SAS_PHY_LINK_STATUS: 5912 case MPI_EVENT_SAS_PHY_LINK_STATUS:
5892 { 5913 {
5893 char buf[50];
5894 u8 LinkRates = (u8)(evData0 >> 8); 5914 u8 LinkRates = (u8)(evData0 >> 8);
5895 u8 PhyNumber = (u8)(evData0); 5915 u8 PhyNumber = (u8)(evData0);
5896 LinkRates = (LinkRates & MPI_EVENT_SAS_PLS_LR_CURRENT_MASK) >> 5916 LinkRates = (LinkRates & MPI_EVENT_SAS_PLS_LR_CURRENT_MASK) >>
5897 MPI_EVENT_SAS_PLS_LR_CURRENT_SHIFT; 5917 MPI_EVENT_SAS_PLS_LR_CURRENT_SHIFT;
5898 switch (LinkRates) { 5918 switch (LinkRates) {
5899 case MPI_EVENT_SAS_PLS_LR_RATE_UNKNOWN: 5919 case MPI_EVENT_SAS_PLS_LR_RATE_UNKNOWN:
5900 sprintf(buf,"SAS PHY Link Status: Phy=%d:" 5920 snprintf(evStr, EVENT_DESCR_STR_SZ,
5921 "SAS PHY Link Status: Phy=%d:"
5901 " Rate Unknown",PhyNumber); 5922 " Rate Unknown",PhyNumber);
5902 break; 5923 break;
5903 case MPI_EVENT_SAS_PLS_LR_RATE_PHY_DISABLED: 5924 case MPI_EVENT_SAS_PLS_LR_RATE_PHY_DISABLED:
5904 sprintf(buf,"SAS PHY Link Status: Phy=%d:" 5925 snprintf(evStr, EVENT_DESCR_STR_SZ,
5926 "SAS PHY Link Status: Phy=%d:"
5905 " Phy Disabled",PhyNumber); 5927 " Phy Disabled",PhyNumber);
5906 break; 5928 break;
5907 case MPI_EVENT_SAS_PLS_LR_RATE_FAILED_SPEED_NEGOTIATION: 5929 case MPI_EVENT_SAS_PLS_LR_RATE_FAILED_SPEED_NEGOTIATION:
5908 sprintf(buf,"SAS PHY Link Status: Phy=%d:" 5930 snprintf(evStr, EVENT_DESCR_STR_SZ,
5931 "SAS PHY Link Status: Phy=%d:"
5909 " Failed Speed Nego",PhyNumber); 5932 " Failed Speed Nego",PhyNumber);
5910 break; 5933 break;
5911 case MPI_EVENT_SAS_PLS_LR_RATE_SATA_OOB_COMPLETE: 5934 case MPI_EVENT_SAS_PLS_LR_RATE_SATA_OOB_COMPLETE:
5912 sprintf(buf,"SAS PHY Link Status: Phy=%d:" 5935 snprintf(evStr, EVENT_DESCR_STR_SZ,
5936 "SAS PHY Link Status: Phy=%d:"
5913 " Sata OOB Completed",PhyNumber); 5937 " Sata OOB Completed",PhyNumber);
5914 break; 5938 break;
5915 case MPI_EVENT_SAS_PLS_LR_RATE_1_5: 5939 case MPI_EVENT_SAS_PLS_LR_RATE_1_5:
5916 sprintf(buf,"SAS PHY Link Status: Phy=%d:" 5940 snprintf(evStr, EVENT_DESCR_STR_SZ,
5941 "SAS PHY Link Status: Phy=%d:"
5917 " Rate 1.5 Gbps",PhyNumber); 5942 " Rate 1.5 Gbps",PhyNumber);
5918 break; 5943 break;
5919 case MPI_EVENT_SAS_PLS_LR_RATE_3_0: 5944 case MPI_EVENT_SAS_PLS_LR_RATE_3_0:
5920 sprintf(buf,"SAS PHY Link Status: Phy=%d:" 5945 snprintf(evStr, EVENT_DESCR_STR_SZ,
5946 "SAS PHY Link Status: Phy=%d:"
5921 " Rate 3.0 Gpbs",PhyNumber); 5947 " Rate 3.0 Gpbs",PhyNumber);
5922 break; 5948 break;
5923 default: 5949 default:
5924 sprintf(buf,"SAS PHY Link Status: Phy=%d", PhyNumber); 5950 snprintf(evStr, EVENT_DESCR_STR_SZ,
5951 "SAS PHY Link Status: Phy=%d", PhyNumber);
5925 break; 5952 break;
5926 } 5953 }
5927 ds = buf;
5928 break; 5954 break;
5929 } 5955 }
5930 case MPI_EVENT_SAS_DISCOVERY_ERROR: 5956 case MPI_EVENT_SAS_DISCOVERY_ERROR:
@@ -5933,9 +5959,8 @@ EventDescriptionStr(u8 event, u32 evData0, char *evStr)
5933 case MPI_EVENT_IR_RESYNC_UPDATE: 5959 case MPI_EVENT_IR_RESYNC_UPDATE:
5934 { 5960 {
5935 u8 resync_complete = (u8)(evData0 >> 16); 5961 u8 resync_complete = (u8)(evData0 >> 16);
5936 char buf[40]; 5962 snprintf(evStr, EVENT_DESCR_STR_SZ,
5937 sprintf(buf,"IR Resync Update: Complete = %d:",resync_complete); 5963 "IR Resync Update: Complete = %d:",resync_complete);
5938 ds = buf;
5939 break; 5964 break;
5940 } 5965 }
5941 case MPI_EVENT_IR2: 5966 case MPI_EVENT_IR2:
@@ -5988,7 +6013,8 @@ EventDescriptionStr(u8 event, u32 evData0, char *evStr)
5988 ds = "Unknown"; 6013 ds = "Unknown";
5989 break; 6014 break;
5990 } 6015 }
5991 strcpy(evStr,ds); 6016 if (ds)
6017 strncpy(evStr, ds, EVENT_DESCR_STR_SZ);
5992} 6018}
5993 6019
5994/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 6020/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
@@ -6010,7 +6036,7 @@ ProcessEventNotification(MPT_ADAPTER *ioc, EventNotificationReply_t *pEventReply
6010 int ii; 6036 int ii;
6011 int r = 0; 6037 int r = 0;
6012 int handlers = 0; 6038 int handlers = 0;
6013 char evStr[100]; 6039 char evStr[EVENT_DESCR_STR_SZ];
6014 u8 event; 6040 u8 event;
6015 6041
6016 /* 6042 /*
diff --git a/drivers/message/fusion/mptbase.h b/drivers/message/fusion/mptbase.h
index be7e8501b53c..f673cca507e1 100644
--- a/drivers/message/fusion/mptbase.h
+++ b/drivers/message/fusion/mptbase.h
@@ -76,8 +76,8 @@
76#define COPYRIGHT "Copyright (c) 1999-2005 " MODULEAUTHOR 76#define COPYRIGHT "Copyright (c) 1999-2005 " MODULEAUTHOR
77#endif 77#endif
78 78
79#define MPT_LINUX_VERSION_COMMON "3.03.08" 79#define MPT_LINUX_VERSION_COMMON "3.03.09"
80#define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-3.03.08" 80#define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-3.03.09"
81#define WHAT_MAGIC_STRING "@" "(" "#" ")" 81#define WHAT_MAGIC_STRING "@" "(" "#" ")"
82 82
83#define show_mptmod_ver(s,ver) \ 83#define show_mptmod_ver(s,ver) \
@@ -489,7 +489,6 @@ typedef struct _RaidCfgData {
489 489
490#define MPT_RPORT_INFO_FLAGS_REGISTERED 0x01 /* rport registered */ 490#define MPT_RPORT_INFO_FLAGS_REGISTERED 0x01 /* rport registered */
491#define MPT_RPORT_INFO_FLAGS_MISSING 0x02 /* missing from DevPage0 scan */ 491#define MPT_RPORT_INFO_FLAGS_MISSING 0x02 /* missing from DevPage0 scan */
492#define MPT_RPORT_INFO_FLAGS_MAPPED_VDEV 0x04 /* target mapped in vdev */
493 492
494/* 493/*
495 * data allocated for each fc rport device 494 * data allocated for each fc rport device
@@ -501,7 +500,6 @@ struct mptfc_rport_info
501 struct scsi_target *starget; 500 struct scsi_target *starget;
502 FCDevicePage0_t pg0; 501 FCDevicePage0_t pg0;
503 u8 flags; 502 u8 flags;
504 u8 remap_needed;
505}; 503};
506 504
507/* 505/*
@@ -628,11 +626,11 @@ typedef struct _MPT_ADAPTER
628 struct work_struct mptscsih_persistTask; 626 struct work_struct mptscsih_persistTask;
629 627
630 struct list_head fc_rports; 628 struct list_head fc_rports;
631 spinlock_t fc_rport_lock; /* list and ri flags */
632 spinlock_t fc_rescan_work_lock; 629 spinlock_t fc_rescan_work_lock;
633 int fc_rescan_work_count; 630 int fc_rescan_work_count;
634 struct work_struct fc_rescan_work; 631 struct work_struct fc_rescan_work;
635 632 char fc_rescan_work_q_name[KOBJ_NAME_LEN];
633 struct workqueue_struct *fc_rescan_work_q;
636} MPT_ADAPTER; 634} MPT_ADAPTER;
637 635
638/* 636/*
diff --git a/drivers/message/fusion/mptfc.c b/drivers/message/fusion/mptfc.c
index b343f2a68b1c..856487741ef4 100644
--- a/drivers/message/fusion/mptfc.c
+++ b/drivers/message/fusion/mptfc.c
@@ -341,9 +341,6 @@ mptfc_generate_rport_ids(FCDevicePage0_t *pg0, struct fc_rport_identifiers *rid)
341 rid->port_name = ((u64)pg0->WWPN.High) << 32 | (u64)pg0->WWPN.Low; 341 rid->port_name = ((u64)pg0->WWPN.High) << 32 | (u64)pg0->WWPN.Low;
342 rid->port_id = pg0->PortIdentifier; 342 rid->port_id = pg0->PortIdentifier;
343 rid->roles = FC_RPORT_ROLE_UNKNOWN; 343 rid->roles = FC_RPORT_ROLE_UNKNOWN;
344 rid->roles |= FC_RPORT_ROLE_FCP_TARGET;
345 if (pg0->Protocol & MPI_FC_DEVICE_PAGE0_PROT_FCP_INITIATOR)
346 rid->roles |= FC_RPORT_ROLE_FCP_INITIATOR;
347 344
348 return 0; 345 return 0;
349} 346}
@@ -355,15 +352,18 @@ mptfc_register_dev(MPT_ADAPTER *ioc, int channel, FCDevicePage0_t *pg0)
355 struct fc_rport *rport; 352 struct fc_rport *rport;
356 struct mptfc_rport_info *ri; 353 struct mptfc_rport_info *ri;
357 int new_ri = 1; 354 int new_ri = 1;
358 u64 pn; 355 u64 pn, nn;
359 unsigned long flags;
360 VirtTarget *vtarget; 356 VirtTarget *vtarget;
357 u32 roles = FC_RPORT_ROLE_UNKNOWN;
361 358
362 if (mptfc_generate_rport_ids(pg0, &rport_ids) < 0) 359 if (mptfc_generate_rport_ids(pg0, &rport_ids) < 0)
363 return; 360 return;
364 361
362 roles |= FC_RPORT_ROLE_FCP_TARGET;
363 if (pg0->Protocol & MPI_FC_DEVICE_PAGE0_PROT_FCP_INITIATOR)
364 roles |= FC_RPORT_ROLE_FCP_INITIATOR;
365
365 /* scan list looking for a match */ 366 /* scan list looking for a match */
366 spin_lock_irqsave(&ioc->fc_rport_lock, flags);
367 list_for_each_entry(ri, &ioc->fc_rports, list) { 367 list_for_each_entry(ri, &ioc->fc_rports, list) {
368 pn = (u64)ri->pg0.WWPN.High << 32 | (u64)ri->pg0.WWPN.Low; 368 pn = (u64)ri->pg0.WWPN.High << 32 | (u64)ri->pg0.WWPN.Low;
369 if (pn == rport_ids.port_name) { /* match */ 369 if (pn == rport_ids.port_name) { /* match */
@@ -373,11 +373,9 @@ mptfc_register_dev(MPT_ADAPTER *ioc, int channel, FCDevicePage0_t *pg0)
373 } 373 }
374 } 374 }
375 if (new_ri) { /* allocate one */ 375 if (new_ri) { /* allocate one */
376 spin_unlock_irqrestore(&ioc->fc_rport_lock, flags);
377 ri = kzalloc(sizeof(struct mptfc_rport_info), GFP_KERNEL); 376 ri = kzalloc(sizeof(struct mptfc_rport_info), GFP_KERNEL);
378 if (!ri) 377 if (!ri)
379 return; 378 return;
380 spin_lock_irqsave(&ioc->fc_rport_lock, flags);
381 list_add_tail(&ri->list, &ioc->fc_rports); 379 list_add_tail(&ri->list, &ioc->fc_rports);
382 } 380 }
383 381
@@ -387,14 +385,11 @@ mptfc_register_dev(MPT_ADAPTER *ioc, int channel, FCDevicePage0_t *pg0)
387 /* MPT_RPORT_INFO_FLAGS_REGISTERED - rport not previously deleted */ 385 /* MPT_RPORT_INFO_FLAGS_REGISTERED - rport not previously deleted */
388 if (!(ri->flags & MPT_RPORT_INFO_FLAGS_REGISTERED)) { 386 if (!(ri->flags & MPT_RPORT_INFO_FLAGS_REGISTERED)) {
389 ri->flags |= MPT_RPORT_INFO_FLAGS_REGISTERED; 387 ri->flags |= MPT_RPORT_INFO_FLAGS_REGISTERED;
390 spin_unlock_irqrestore(&ioc->fc_rport_lock, flags);
391 rport = fc_remote_port_add(ioc->sh, channel, &rport_ids); 388 rport = fc_remote_port_add(ioc->sh, channel, &rport_ids);
392 spin_lock_irqsave(&ioc->fc_rport_lock, flags);
393 if (rport) { 389 if (rport) {
394 ri->rport = rport; 390 ri->rport = rport;
395 if (new_ri) /* may have been reset by user */ 391 if (new_ri) /* may have been reset by user */
396 rport->dev_loss_tmo = mptfc_dev_loss_tmo; 392 rport->dev_loss_tmo = mptfc_dev_loss_tmo;
397 *((struct mptfc_rport_info **)rport->dd_data) = ri;
398 /* 393 /*
399 * if already mapped, remap here. If not mapped, 394 * if already mapped, remap here. If not mapped,
400 * target_alloc will allocate vtarget and map, 395 * target_alloc will allocate vtarget and map,
@@ -406,16 +401,21 @@ mptfc_register_dev(MPT_ADAPTER *ioc, int channel, FCDevicePage0_t *pg0)
406 vtarget->target_id = pg0->CurrentTargetID; 401 vtarget->target_id = pg0->CurrentTargetID;
407 vtarget->bus_id = pg0->CurrentBus; 402 vtarget->bus_id = pg0->CurrentBus;
408 } 403 }
409 ri->remap_needed = 0;
410 } 404 }
405 *((struct mptfc_rport_info **)rport->dd_data) = ri;
406 /* scan will be scheduled once rport becomes a target */
407 fc_remote_port_rolechg(rport,roles);
408
409 pn = (u64)ri->pg0.WWPN.High << 32 | (u64)ri->pg0.WWPN.Low;
410 nn = (u64)ri->pg0.WWNN.High << 32 | (u64)ri->pg0.WWNN.Low;
411 dfcprintk ((MYIOC_s_INFO_FMT 411 dfcprintk ((MYIOC_s_INFO_FMT
412 "mptfc_reg_dev.%d: %x, %llx / %llx, tid %d, " 412 "mptfc_reg_dev.%d: %x, %llx / %llx, tid %d, "
413 "rport tid %d, tmo %d\n", 413 "rport tid %d, tmo %d\n",
414 ioc->name, 414 ioc->name,
415 ioc->sh->host_no, 415 ioc->sh->host_no,
416 pg0->PortIdentifier, 416 pg0->PortIdentifier,
417 pg0->WWNN, 417 (unsigned long long)nn,
418 pg0->WWPN, 418 (unsigned long long)pn,
419 pg0->CurrentTargetID, 419 pg0->CurrentTargetID,
420 ri->rport->scsi_target_id, 420 ri->rport->scsi_target_id,
421 ri->rport->dev_loss_tmo)); 421 ri->rport->dev_loss_tmo));
@@ -425,8 +425,6 @@ mptfc_register_dev(MPT_ADAPTER *ioc, int channel, FCDevicePage0_t *pg0)
425 ri = NULL; 425 ri = NULL;
426 } 426 }
427 } 427 }
428 spin_unlock_irqrestore(&ioc->fc_rport_lock,flags);
429
430} 428}
431 429
432/* 430/*
@@ -476,7 +474,6 @@ mptfc_target_alloc(struct scsi_target *starget)
476 vtarget->target_id = ri->pg0.CurrentTargetID; 474 vtarget->target_id = ri->pg0.CurrentTargetID;
477 vtarget->bus_id = ri->pg0.CurrentBus; 475 vtarget->bus_id = ri->pg0.CurrentBus;
478 ri->starget = starget; 476 ri->starget = starget;
479 ri->remap_needed = 0;
480 rc = 0; 477 rc = 0;
481 } 478 }
482 } 479 }
@@ -502,10 +499,10 @@ mptfc_slave_alloc(struct scsi_device *sdev)
502 VirtDevice *vdev; 499 VirtDevice *vdev;
503 struct scsi_target *starget; 500 struct scsi_target *starget;
504 struct fc_rport *rport; 501 struct fc_rport *rport;
505 unsigned long flags;
506 502
507 503
508 rport = starget_to_rport(scsi_target(sdev)); 504 starget = scsi_target(sdev);
505 rport = starget_to_rport(starget);
509 506
510 if (!rport || fc_remote_port_chkready(rport)) 507 if (!rport || fc_remote_port_chkready(rport))
511 return -ENXIO; 508 return -ENXIO;
@@ -519,10 +516,8 @@ mptfc_slave_alloc(struct scsi_device *sdev)
519 return -ENOMEM; 516 return -ENOMEM;
520 } 517 }
521 518
522 spin_lock_irqsave(&hd->ioc->fc_rport_lock,flags);
523 519
524 sdev->hostdata = vdev; 520 sdev->hostdata = vdev;
525 starget = scsi_target(sdev);
526 vtarget = starget->hostdata; 521 vtarget = starget->hostdata;
527 522
528 if (vtarget->num_luns == 0) { 523 if (vtarget->num_luns == 0) {
@@ -535,14 +530,16 @@ mptfc_slave_alloc(struct scsi_device *sdev)
535 vdev->vtarget = vtarget; 530 vdev->vtarget = vtarget;
536 vdev->lun = sdev->lun; 531 vdev->lun = sdev->lun;
537 532
538 spin_unlock_irqrestore(&hd->ioc->fc_rport_lock,flags);
539
540 vtarget->num_luns++; 533 vtarget->num_luns++;
541 534
535
542#ifdef DMPT_DEBUG_FC 536#ifdef DMPT_DEBUG_FC
543 { 537 {
538 u64 nn, pn;
544 struct mptfc_rport_info *ri; 539 struct mptfc_rport_info *ri;
545 ri = *((struct mptfc_rport_info **)rport->dd_data); 540 ri = *((struct mptfc_rport_info **)rport->dd_data);
541 pn = (u64)ri->pg0.WWPN.High << 32 | (u64)ri->pg0.WWPN.Low;
542 nn = (u64)ri->pg0.WWNN.High << 32 | (u64)ri->pg0.WWNN.Low;
546 dfcprintk ((MYIOC_s_INFO_FMT 543 dfcprintk ((MYIOC_s_INFO_FMT
547 "mptfc_slv_alloc.%d: num_luns %d, sdev.id %d, " 544 "mptfc_slv_alloc.%d: num_luns %d, sdev.id %d, "
548 "CurrentTargetID %d, %x %llx %llx\n", 545 "CurrentTargetID %d, %x %llx %llx\n",
@@ -550,7 +547,9 @@ mptfc_slave_alloc(struct scsi_device *sdev)
550 sdev->host->host_no, 547 sdev->host->host_no,
551 vtarget->num_luns, 548 vtarget->num_luns,
552 sdev->id, ri->pg0.CurrentTargetID, 549 sdev->id, ri->pg0.CurrentTargetID,
553 ri->pg0.PortIdentifier, ri->pg0.WWPN, ri->pg0.WWNN)); 550 ri->pg0.PortIdentifier,
551 (unsigned long long)pn,
552 (unsigned long long)nn));
554 } 553 }
555#endif 554#endif
556 555
@@ -570,11 +569,31 @@ mptfc_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
570 done(SCpnt); 569 done(SCpnt);
571 return 0; 570 return 0;
572 } 571 }
572
573 /* dd_data is null until finished adding target */
573 ri = *((struct mptfc_rport_info **)rport->dd_data); 574 ri = *((struct mptfc_rport_info **)rport->dd_data);
574 if (unlikely(ri->remap_needed)) 575 if (unlikely(!ri)) {
575 return SCSI_MLQUEUE_HOST_BUSY; 576 dfcprintk ((MYIOC_s_INFO_FMT
577 "mptfc_qcmd.%d: %d:%d, dd_data is null.\n",
578 ((MPT_SCSI_HOST *) SCpnt->device->host->hostdata)->ioc->name,
579 ((MPT_SCSI_HOST *) SCpnt->device->host->hostdata)->ioc->sh->host_no,
580 SCpnt->device->id,SCpnt->device->lun));
581 SCpnt->result = DID_IMM_RETRY << 16;
582 done(SCpnt);
583 return 0;
584 }
576 585
577 return mptscsih_qcmd(SCpnt,done); 586 err = mptscsih_qcmd(SCpnt,done);
587#ifdef DMPT_DEBUG_FC
588 if (unlikely(err)) {
589 dfcprintk ((MYIOC_s_INFO_FMT
590 "mptfc_qcmd.%d: %d:%d, mptscsih_qcmd returns non-zero.\n",
591 ((MPT_SCSI_HOST *) SCpnt->device->host->hostdata)->ioc->name,
592 ((MPT_SCSI_HOST *) SCpnt->device->host->hostdata)->ioc->sh->host_no,
593 SCpnt->device->id,SCpnt->device->lun));
594 }
595#endif
596 return err;
578} 597}
579 598
580static void 599static void
@@ -615,18 +634,17 @@ mptfc_rescan_devices(void *arg)
615 MPT_ADAPTER *ioc = (MPT_ADAPTER *)arg; 634 MPT_ADAPTER *ioc = (MPT_ADAPTER *)arg;
616 int ii; 635 int ii;
617 int work_to_do; 636 int work_to_do;
637 u64 pn;
618 unsigned long flags; 638 unsigned long flags;
619 struct mptfc_rport_info *ri; 639 struct mptfc_rport_info *ri;
620 640
621 do { 641 do {
622 /* start by tagging all ports as missing */ 642 /* start by tagging all ports as missing */
623 spin_lock_irqsave(&ioc->fc_rport_lock,flags);
624 list_for_each_entry(ri, &ioc->fc_rports, list) { 643 list_for_each_entry(ri, &ioc->fc_rports, list) {
625 if (ri->flags & MPT_RPORT_INFO_FLAGS_REGISTERED) { 644 if (ri->flags & MPT_RPORT_INFO_FLAGS_REGISTERED) {
626 ri->flags |= MPT_RPORT_INFO_FLAGS_MISSING; 645 ri->flags |= MPT_RPORT_INFO_FLAGS_MISSING;
627 } 646 }
628 } 647 }
629 spin_unlock_irqrestore(&ioc->fc_rport_lock,flags);
630 648
631 /* 649 /*
632 * now rescan devices known to adapter, 650 * now rescan devices known to adapter,
@@ -639,33 +657,24 @@ mptfc_rescan_devices(void *arg)
639 } 657 }
640 658
641 /* delete devices still missing */ 659 /* delete devices still missing */
642 spin_lock_irqsave(&ioc->fc_rport_lock, flags);
643 list_for_each_entry(ri, &ioc->fc_rports, list) { 660 list_for_each_entry(ri, &ioc->fc_rports, list) {
644 /* if newly missing, delete it */ 661 /* if newly missing, delete it */
645 if ((ri->flags & (MPT_RPORT_INFO_FLAGS_REGISTERED | 662 if (ri->flags & MPT_RPORT_INFO_FLAGS_MISSING) {
646 MPT_RPORT_INFO_FLAGS_MISSING))
647 == (MPT_RPORT_INFO_FLAGS_REGISTERED |
648 MPT_RPORT_INFO_FLAGS_MISSING)) {
649 663
650 ri->flags &= ~(MPT_RPORT_INFO_FLAGS_REGISTERED| 664 ri->flags &= ~(MPT_RPORT_INFO_FLAGS_REGISTERED|
651 MPT_RPORT_INFO_FLAGS_MISSING); 665 MPT_RPORT_INFO_FLAGS_MISSING);
652 ri->remap_needed = 1; 666 fc_remote_port_delete(ri->rport); /* won't sleep */
653 fc_remote_port_delete(ri->rport);
654 /*
655 * remote port not really deleted 'cause
656 * binding is by WWPN and driver only
657 * registers FCP_TARGETs but cannot trust
658 * data structures.
659 */
660 ri->rport = NULL; 667 ri->rport = NULL;
668
669 pn = (u64)ri->pg0.WWPN.High << 32 |
670 (u64)ri->pg0.WWPN.Low;
661 dfcprintk ((MYIOC_s_INFO_FMT 671 dfcprintk ((MYIOC_s_INFO_FMT
662 "mptfc_rescan.%d: %llx deleted\n", 672 "mptfc_rescan.%d: %llx deleted\n",
663 ioc->name, 673 ioc->name,
664 ioc->sh->host_no, 674 ioc->sh->host_no,
665 ri->pg0.WWPN)); 675 (unsigned long long)pn));
666 } 676 }
667 } 677 }
668 spin_unlock_irqrestore(&ioc->fc_rport_lock,flags);
669 678
670 /* 679 /*
671 * allow multiple passes as target state 680 * allow multiple passes as target state
@@ -870,10 +879,23 @@ mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id)
870 goto out_mptfc_probe; 879 goto out_mptfc_probe;
871 } 880 }
872 881
873 for (ii=0; ii < ioc->facts.NumberOfPorts; ii++) { 882 /* initialize workqueue */
874 mptfc_init_host_attr(ioc,ii); 883
875 mptfc_GetFcDevPage0(ioc,ii,mptfc_register_dev); 884 snprintf(ioc->fc_rescan_work_q_name, KOBJ_NAME_LEN, "mptfc_wq_%d",
876 } 885 sh->host_no);
886 ioc->fc_rescan_work_q =
887 create_singlethread_workqueue(ioc->fc_rescan_work_q_name);
888 if (!ioc->fc_rescan_work_q)
889 goto out_mptfc_probe;
890
891 /*
892 * scan for rports -
893 * by doing it via the workqueue, some locking is eliminated
894 */
895
896 ioc->fc_rescan_work_count = 1;
897 queue_work(ioc->fc_rescan_work_q, &ioc->fc_rescan_work);
898 flush_workqueue(ioc->fc_rescan_work_q);
877 899
878 return 0; 900 return 0;
879 901
@@ -949,8 +971,18 @@ mptfc_init(void)
949static void __devexit 971static void __devexit
950mptfc_remove(struct pci_dev *pdev) 972mptfc_remove(struct pci_dev *pdev)
951{ 973{
952 MPT_ADAPTER *ioc = pci_get_drvdata(pdev); 974 MPT_ADAPTER *ioc = pci_get_drvdata(pdev);
953 struct mptfc_rport_info *p, *n; 975 struct mptfc_rport_info *p, *n;
976 struct workqueue_struct *work_q;
977 unsigned long flags;
978
979 /* destroy workqueue */
980 if ((work_q=ioc->fc_rescan_work_q)) {
981 spin_lock_irqsave(&ioc->fc_rescan_work_lock, flags);
982 ioc->fc_rescan_work_q = NULL;
983 spin_unlock_irqrestore(&ioc->fc_rescan_work_lock, flags);
984 destroy_workqueue(work_q);
985 }
954 986
955 fc_remove_host(ioc->sh); 987 fc_remove_host(ioc->sh);
956 988
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c
index e9716b10acea..af6ec553ff7c 100644
--- a/drivers/message/fusion/mptsas.c
+++ b/drivers/message/fusion/mptsas.c
@@ -91,6 +91,7 @@ enum mptsas_hotplug_action {
91 MPTSAS_DEL_DEVICE, 91 MPTSAS_DEL_DEVICE,
92 MPTSAS_ADD_RAID, 92 MPTSAS_ADD_RAID,
93 MPTSAS_DEL_RAID, 93 MPTSAS_DEL_RAID,
94 MPTSAS_IGNORE_EVENT,
94}; 95};
95 96
96struct mptsas_hotplug_event { 97struct mptsas_hotplug_event {
@@ -298,6 +299,26 @@ mptsas_find_portinfo_by_handle(MPT_ADAPTER *ioc, u16 handle)
298 return rc; 299 return rc;
299} 300}
300 301
302/*
303 * Returns true if there is a scsi end device
304 */
305static inline int
306mptsas_is_end_device(struct mptsas_devinfo * attached)
307{
308 if ((attached->handle) &&
309 (attached->device_info &
310 MPI_SAS_DEVICE_INFO_END_DEVICE) &&
311 ((attached->device_info &
312 MPI_SAS_DEVICE_INFO_SSP_TARGET) |
313 (attached->device_info &
314 MPI_SAS_DEVICE_INFO_STP_TARGET) |
315 (attached->device_info &
316 MPI_SAS_DEVICE_INFO_SATA_DEVICE)))
317 return 1;
318 else
319 return 0;
320}
321
301static int 322static int
302mptsas_sas_enclosure_pg0(MPT_ADAPTER *ioc, struct mptsas_enclosure *enclosure, 323mptsas_sas_enclosure_pg0(MPT_ADAPTER *ioc, struct mptsas_enclosure *enclosure,
303 u32 form, u32 form_specific) 324 u32 form, u32 form_specific)
@@ -872,7 +893,11 @@ mptsas_sas_device_pg0(MPT_ADAPTER *ioc, struct mptsas_devinfo *device_info,
872 SasDevicePage0_t *buffer; 893 SasDevicePage0_t *buffer;
873 dma_addr_t dma_handle; 894 dma_addr_t dma_handle;
874 __le64 sas_address; 895 __le64 sas_address;
875 int error; 896 int error=0;
897
898 if (ioc->sas_discovery_runtime &&
899 mptsas_is_end_device(device_info))
900 goto out;
876 901
877 hdr.PageVersion = MPI_SASDEVICE0_PAGEVERSION; 902 hdr.PageVersion = MPI_SASDEVICE0_PAGEVERSION;
878 hdr.ExtPageLength = 0; 903 hdr.ExtPageLength = 0;
@@ -1009,7 +1034,11 @@ mptsas_sas_expander_pg1(MPT_ADAPTER *ioc, struct mptsas_phyinfo *phy_info,
1009 CONFIGPARMS cfg; 1034 CONFIGPARMS cfg;
1010 SasExpanderPage1_t *buffer; 1035 SasExpanderPage1_t *buffer;
1011 dma_addr_t dma_handle; 1036 dma_addr_t dma_handle;
1012 int error; 1037 int error=0;
1038
1039 if (ioc->sas_discovery_runtime &&
1040 mptsas_is_end_device(&phy_info->attached))
1041 goto out;
1013 1042
1014 hdr.PageVersion = MPI_SASEXPANDER0_PAGEVERSION; 1043 hdr.PageVersion = MPI_SASEXPANDER0_PAGEVERSION;
1015 hdr.ExtPageLength = 0; 1044 hdr.ExtPageLength = 0;
@@ -1068,26 +1097,6 @@ mptsas_sas_expander_pg1(MPT_ADAPTER *ioc, struct mptsas_phyinfo *phy_info,
1068 return error; 1097 return error;
1069} 1098}
1070 1099
1071/*
1072 * Returns true if there is a scsi end device
1073 */
1074static inline int
1075mptsas_is_end_device(struct mptsas_devinfo * attached)
1076{
1077 if ((attached->handle) &&
1078 (attached->device_info &
1079 MPI_SAS_DEVICE_INFO_END_DEVICE) &&
1080 ((attached->device_info &
1081 MPI_SAS_DEVICE_INFO_SSP_TARGET) |
1082 (attached->device_info &
1083 MPI_SAS_DEVICE_INFO_STP_TARGET) |
1084 (attached->device_info &
1085 MPI_SAS_DEVICE_INFO_SATA_DEVICE)))
1086 return 1;
1087 else
1088 return 0;
1089}
1090
1091static void 1100static void
1092mptsas_parse_device_info(struct sas_identify *identify, 1101mptsas_parse_device_info(struct sas_identify *identify,
1093 struct mptsas_devinfo *device_info) 1102 struct mptsas_devinfo *device_info)
@@ -1737,6 +1746,9 @@ mptsas_hotplug_work(void *arg)
1737 break; 1746 break;
1738 case MPTSAS_ADD_DEVICE: 1747 case MPTSAS_ADD_DEVICE:
1739 1748
1749 if (ev->phys_disk_num_valid)
1750 mpt_findImVolumes(ioc);
1751
1740 /* 1752 /*
1741 * Refresh sas device pg0 data 1753 * Refresh sas device pg0 data
1742 */ 1754 */
@@ -1868,6 +1880,9 @@ mptsas_hotplug_work(void *arg)
1868 scsi_device_put(sdev); 1880 scsi_device_put(sdev);
1869 mpt_findImVolumes(ioc); 1881 mpt_findImVolumes(ioc);
1870 break; 1882 break;
1883 case MPTSAS_IGNORE_EVENT:
1884 default:
1885 break;
1871 } 1886 }
1872 1887
1873 kfree(ev); 1888 kfree(ev);
@@ -1940,7 +1955,8 @@ mptscsih_send_raid_event(MPT_ADAPTER *ioc,
1940 EVENT_DATA_RAID *raid_event_data) 1955 EVENT_DATA_RAID *raid_event_data)
1941{ 1956{
1942 struct mptsas_hotplug_event *ev; 1957 struct mptsas_hotplug_event *ev;
1943 RAID_VOL0_STATUS * volumeStatus; 1958 int status = le32_to_cpu(raid_event_data->SettingsStatus);
1959 int state = (status >> 8) & 0xff;
1944 1960
1945 if (ioc->bus_type != SAS) 1961 if (ioc->bus_type != SAS)
1946 return; 1962 return;
@@ -1955,6 +1971,7 @@ mptscsih_send_raid_event(MPT_ADAPTER *ioc,
1955 INIT_WORK(&ev->work, mptsas_hotplug_work, ev); 1971 INIT_WORK(&ev->work, mptsas_hotplug_work, ev);
1956 ev->ioc = ioc; 1972 ev->ioc = ioc;
1957 ev->id = raid_event_data->VolumeID; 1973 ev->id = raid_event_data->VolumeID;
1974 ev->event_type = MPTSAS_IGNORE_EVENT;
1958 1975
1959 switch (raid_event_data->ReasonCode) { 1976 switch (raid_event_data->ReasonCode) {
1960 case MPI_EVENT_RAID_RC_PHYSDISK_DELETED: 1977 case MPI_EVENT_RAID_RC_PHYSDISK_DELETED:
@@ -1966,6 +1983,25 @@ mptscsih_send_raid_event(MPT_ADAPTER *ioc,
1966 ev->phys_disk_num = raid_event_data->PhysDiskNum; 1983 ev->phys_disk_num = raid_event_data->PhysDiskNum;
1967 ev->event_type = MPTSAS_DEL_DEVICE; 1984 ev->event_type = MPTSAS_DEL_DEVICE;
1968 break; 1985 break;
1986 case MPI_EVENT_RAID_RC_PHYSDISK_STATUS_CHANGED:
1987 switch (state) {
1988 case MPI_PD_STATE_ONLINE:
1989 ioc->raid_data.isRaid = 1;
1990 ev->phys_disk_num_valid = 1;
1991 ev->phys_disk_num = raid_event_data->PhysDiskNum;
1992 ev->event_type = MPTSAS_ADD_DEVICE;
1993 break;
1994 case MPI_PD_STATE_MISSING:
1995 case MPI_PD_STATE_NOT_COMPATIBLE:
1996 case MPI_PD_STATE_OFFLINE_AT_HOST_REQUEST:
1997 case MPI_PD_STATE_FAILED_AT_HOST_REQUEST:
1998 case MPI_PD_STATE_OFFLINE_FOR_ANOTHER_REASON:
1999 ev->event_type = MPTSAS_DEL_DEVICE;
2000 break;
2001 default:
2002 break;
2003 }
2004 break;
1969 case MPI_EVENT_RAID_RC_VOLUME_DELETED: 2005 case MPI_EVENT_RAID_RC_VOLUME_DELETED:
1970 ev->event_type = MPTSAS_DEL_RAID; 2006 ev->event_type = MPTSAS_DEL_RAID;
1971 break; 2007 break;
@@ -1973,11 +2009,18 @@ mptscsih_send_raid_event(MPT_ADAPTER *ioc,
1973 ev->event_type = MPTSAS_ADD_RAID; 2009 ev->event_type = MPTSAS_ADD_RAID;
1974 break; 2010 break;
1975 case MPI_EVENT_RAID_RC_VOLUME_STATUS_CHANGED: 2011 case MPI_EVENT_RAID_RC_VOLUME_STATUS_CHANGED:
1976 volumeStatus = (RAID_VOL0_STATUS *) & 2012 switch (state) {
1977 raid_event_data->SettingsStatus; 2013 case MPI_RAIDVOL0_STATUS_STATE_FAILED:
1978 ev->event_type = (volumeStatus->State == 2014 case MPI_RAIDVOL0_STATUS_STATE_MISSING:
1979 MPI_RAIDVOL0_STATUS_STATE_FAILED) ? 2015 ev->event_type = MPTSAS_DEL_RAID;
1980 MPTSAS_DEL_RAID : MPTSAS_ADD_RAID; 2016 break;
2017 case MPI_RAIDVOL0_STATUS_STATE_OPTIMAL:
2018 case MPI_RAIDVOL0_STATUS_STATE_DEGRADED:
2019 ev->event_type = MPTSAS_ADD_RAID;
2020 break;
2021 default:
2022 break;
2023 }
1981 break; 2024 break;
1982 default: 2025 default:
1983 break; 2026 break;
diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c
index 3729062db317..84fa271eb8f4 100644
--- a/drivers/message/fusion/mptscsih.c
+++ b/drivers/message/fusion/mptscsih.c
@@ -632,7 +632,11 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
632 632
633 case MPI_IOCSTATUS_SCSI_DEVICE_NOT_THERE: /* 0x0043 */ 633 case MPI_IOCSTATUS_SCSI_DEVICE_NOT_THERE: /* 0x0043 */
634 /* Spoof to SCSI Selection Timeout! */ 634 /* Spoof to SCSI Selection Timeout! */
635 sc->result = DID_NO_CONNECT << 16; 635 if (ioc->bus_type != FC)
636 sc->result = DID_NO_CONNECT << 16;
637 /* else fibre, just stall until rescan event */
638 else
639 sc->result = DID_REQUEUE << 16;
636 640
637 if (hd->sel_timeout[pScsiReq->TargetID] < 0xFFFF) 641 if (hd->sel_timeout[pScsiReq->TargetID] < 0xFFFF)
638 hd->sel_timeout[pScsiReq->TargetID]++; 642 hd->sel_timeout[pScsiReq->TargetID]++;
@@ -877,7 +881,7 @@ mptscsih_search_running_cmds(MPT_SCSI_HOST *hd, VirtDevice *vdevice)
877 struct scsi_cmnd *sc; 881 struct scsi_cmnd *sc;
878 882
879 dsprintk((KERN_INFO MYNAM ": search_running target %d lun %d max %d\n", 883 dsprintk((KERN_INFO MYNAM ": search_running target %d lun %d max %d\n",
880 vdevice->target_id, vdevice->lun, max)); 884 vdevice->vtarget->target_id, vdevice->lun, max));
881 885
882 for (ii=0; ii < max; ii++) { 886 for (ii=0; ii < max; ii++) {
883 if ((sc = hd->ScsiLookup[ii]) != NULL) { 887 if ((sc = hd->ScsiLookup[ii]) != NULL) {
@@ -1645,7 +1649,6 @@ int
1645mptscsih_abort(struct scsi_cmnd * SCpnt) 1649mptscsih_abort(struct scsi_cmnd * SCpnt)
1646{ 1650{
1647 MPT_SCSI_HOST *hd; 1651 MPT_SCSI_HOST *hd;
1648 MPT_ADAPTER *ioc;
1649 MPT_FRAME_HDR *mf; 1652 MPT_FRAME_HDR *mf;
1650 u32 ctx2abort; 1653 u32 ctx2abort;
1651 int scpnt_idx; 1654 int scpnt_idx;
@@ -1663,14 +1666,6 @@ mptscsih_abort(struct scsi_cmnd * SCpnt)
1663 return FAILED; 1666 return FAILED;
1664 } 1667 }
1665 1668
1666 ioc = hd->ioc;
1667 if (hd->resetPending) {
1668 return FAILED;
1669 }
1670
1671 if (hd->timeouts < -1)
1672 hd->timeouts++;
1673
1674 /* Find this command 1669 /* Find this command
1675 */ 1670 */
1676 if ((scpnt_idx = SCPNT_TO_LOOKUP_IDX(SCpnt)) < 0) { 1671 if ((scpnt_idx = SCPNT_TO_LOOKUP_IDX(SCpnt)) < 0) {
@@ -1684,6 +1679,13 @@ mptscsih_abort(struct scsi_cmnd * SCpnt)
1684 return SUCCESS; 1679 return SUCCESS;
1685 } 1680 }
1686 1681
1682 if (hd->resetPending) {
1683 return FAILED;
1684 }
1685
1686 if (hd->timeouts < -1)
1687 hd->timeouts++;
1688
1687 printk(KERN_WARNING MYNAM ": %s: attempting task abort! (sc=%p)\n", 1689 printk(KERN_WARNING MYNAM ": %s: attempting task abort! (sc=%p)\n",
1688 hd->ioc->name, SCpnt); 1690 hd->ioc->name, SCpnt);
1689 scsi_print_command(SCpnt); 1691 scsi_print_command(SCpnt);
@@ -1703,7 +1705,7 @@ mptscsih_abort(struct scsi_cmnd * SCpnt)
1703 vdev = SCpnt->device->hostdata; 1705 vdev = SCpnt->device->hostdata;
1704 retval = mptscsih_TMHandler(hd, MPI_SCSITASKMGMT_TASKTYPE_ABORT_TASK, 1706 retval = mptscsih_TMHandler(hd, MPI_SCSITASKMGMT_TASKTYPE_ABORT_TASK,
1705 vdev->vtarget->bus_id, vdev->vtarget->target_id, vdev->lun, 1707 vdev->vtarget->bus_id, vdev->vtarget->target_id, vdev->lun,
1706 ctx2abort, mptscsih_get_tm_timeout(ioc)); 1708 ctx2abort, mptscsih_get_tm_timeout(hd->ioc));
1707 1709
1708 printk (KERN_WARNING MYNAM ": %s: task abort: %s (sc=%p)\n", 1710 printk (KERN_WARNING MYNAM ": %s: task abort: %s (sc=%p)\n",
1709 hd->ioc->name, 1711 hd->ioc->name,
@@ -2521,15 +2523,15 @@ mptscsih_ioc_reset(MPT_ADAPTER *ioc, int reset_phase)
2521 2523
2522 /* 7. FC: Rescan for blocked rports which might have returned. 2524 /* 7. FC: Rescan for blocked rports which might have returned.
2523 */ 2525 */
2524 else if (ioc->bus_type == FC) { 2526 if (ioc->bus_type == FC) {
2525 int work_count;
2526 unsigned long flags;
2527
2528 spin_lock_irqsave(&ioc->fc_rescan_work_lock, flags); 2527 spin_lock_irqsave(&ioc->fc_rescan_work_lock, flags);
2529 work_count = ++ioc->fc_rescan_work_count; 2528 if (ioc->fc_rescan_work_q) {
2529 if (ioc->fc_rescan_work_count++ == 0) {
2530 queue_work(ioc->fc_rescan_work_q,
2531 &ioc->fc_rescan_work);
2532 }
2533 }
2530 spin_unlock_irqrestore(&ioc->fc_rescan_work_lock, flags); 2534 spin_unlock_irqrestore(&ioc->fc_rescan_work_lock, flags);
2531 if (work_count == 1)
2532 schedule_work(&ioc->fc_rescan_work);
2533 } 2535 }
2534 dtmprintk((MYIOC_s_WARN_FMT "Post-Reset complete.\n", ioc->name)); 2536 dtmprintk((MYIOC_s_WARN_FMT "Post-Reset complete.\n", ioc->name));
2535 2537
@@ -2544,7 +2546,6 @@ mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply)
2544{ 2546{
2545 MPT_SCSI_HOST *hd; 2547 MPT_SCSI_HOST *hd;
2546 u8 event = le32_to_cpu(pEvReply->Event) & 0xFF; 2548 u8 event = le32_to_cpu(pEvReply->Event) & 0xFF;
2547 int work_count;
2548 unsigned long flags; 2549 unsigned long flags;
2549 2550
2550 devtverboseprintk((MYIOC_s_INFO_FMT "MPT event (=%02Xh) routed to SCSI host driver!\n", 2551 devtverboseprintk((MYIOC_s_INFO_FMT "MPT event (=%02Xh) routed to SCSI host driver!\n",
@@ -2569,10 +2570,13 @@ mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply)
2569 2570
2570 case MPI_EVENT_RESCAN: /* 06 */ 2571 case MPI_EVENT_RESCAN: /* 06 */
2571 spin_lock_irqsave(&ioc->fc_rescan_work_lock, flags); 2572 spin_lock_irqsave(&ioc->fc_rescan_work_lock, flags);
2572 work_count = ++ioc->fc_rescan_work_count; 2573 if (ioc->fc_rescan_work_q) {
2574 if (ioc->fc_rescan_work_count++ == 0) {
2575 queue_work(ioc->fc_rescan_work_q,
2576 &ioc->fc_rescan_work);
2577 }
2578 }
2573 spin_unlock_irqrestore(&ioc->fc_rescan_work_lock, flags); 2579 spin_unlock_irqrestore(&ioc->fc_rescan_work_lock, flags);
2574 if (work_count == 1)
2575 schedule_work(&ioc->fc_rescan_work);
2576 break; 2580 break;
2577 2581
2578 /* 2582 /*
diff --git a/drivers/message/fusion/mptspi.c b/drivers/message/fusion/mptspi.c
index 09c745b19cc8..f2a4d382ea19 100644
--- a/drivers/message/fusion/mptspi.c
+++ b/drivers/message/fusion/mptspi.c
@@ -783,6 +783,70 @@ static struct pci_device_id mptspi_pci_table[] = {
783}; 783};
784MODULE_DEVICE_TABLE(pci, mptspi_pci_table); 784MODULE_DEVICE_TABLE(pci, mptspi_pci_table);
785 785
786
787/*
788 * renegotiate for a given target
789 */
790static void
791mptspi_dv_renegotiate_work(void *data)
792{
793 struct work_queue_wrapper *wqw = (struct work_queue_wrapper *)data;
794 struct _MPT_SCSI_HOST *hd = wqw->hd;
795 struct scsi_device *sdev;
796
797 kfree(wqw);
798
799 shost_for_each_device(sdev, hd->ioc->sh)
800 mptspi_dv_device(hd, sdev);
801}
802
803static void
804mptspi_dv_renegotiate(struct _MPT_SCSI_HOST *hd)
805{
806 struct work_queue_wrapper *wqw = kmalloc(sizeof(*wqw), GFP_ATOMIC);
807
808 if (!wqw)
809 return;
810
811 INIT_WORK(&wqw->work, mptspi_dv_renegotiate_work, wqw);
812 wqw->hd = hd;
813
814 schedule_work(&wqw->work);
815}
816
817/*
818 * spi module reset handler
819 */
820static int
821mptspi_ioc_reset(MPT_ADAPTER *ioc, int reset_phase)
822{
823 struct _MPT_SCSI_HOST *hd = (struct _MPT_SCSI_HOST *)ioc->sh->hostdata;
824 int rc;
825
826 rc = mptscsih_ioc_reset(ioc, reset_phase);
827
828 if (reset_phase == MPT_IOC_POST_RESET)
829 mptspi_dv_renegotiate(hd);
830
831 return rc;
832}
833
834/*
835 * spi module resume handler
836 */
837static int
838mptspi_resume(struct pci_dev *pdev)
839{
840 MPT_ADAPTER *ioc = pci_get_drvdata(pdev);
841 struct _MPT_SCSI_HOST *hd = (struct _MPT_SCSI_HOST *)ioc->sh->hostdata;
842 int rc;
843
844 rc = mptscsih_resume(pdev);
845 mptspi_dv_renegotiate(hd);
846
847 return rc;
848}
849
786/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 850/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
787/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 851/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
788/* 852/*
@@ -1032,7 +1096,7 @@ static struct pci_driver mptspi_driver = {
1032 .shutdown = mptscsih_shutdown, 1096 .shutdown = mptscsih_shutdown,
1033#ifdef CONFIG_PM 1097#ifdef CONFIG_PM
1034 .suspend = mptscsih_suspend, 1098 .suspend = mptscsih_suspend,
1035 .resume = mptscsih_resume, 1099 .resume = mptspi_resume,
1036#endif 1100#endif
1037}; 1101};
1038 1102
@@ -1061,7 +1125,7 @@ mptspi_init(void)
1061 ": Registered for IOC event notifications\n")); 1125 ": Registered for IOC event notifications\n"));
1062 } 1126 }
1063 1127
1064 if (mpt_reset_register(mptspiDoneCtx, mptscsih_ioc_reset) == 0) { 1128 if (mpt_reset_register(mptspiDoneCtx, mptspi_ioc_reset) == 0) {
1065 dprintk((KERN_INFO MYNAM 1129 dprintk((KERN_INFO MYNAM
1066 ": Registered for IOC reset notifications\n")); 1130 ": Registered for IOC reset notifications\n"));
1067 } 1131 }
diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig
index 003b077c2324..45bcf098e762 100644
--- a/drivers/mmc/Kconfig
+++ b/drivers/mmc/Kconfig
@@ -84,7 +84,7 @@ config MMC_WBSD
84 84
85config MMC_AU1X 85config MMC_AU1X
86 tristate "Alchemy AU1XX0 MMC Card Interface support" 86 tristate "Alchemy AU1XX0 MMC Card Interface support"
87 depends on SOC_AU1X00 && MMC 87 depends on MMC && SOC_AU1200
88 help 88 help
89 This selects the AMD Alchemy(R) Multimedia card interface. 89 This selects the AMD Alchemy(R) Multimedia card interface.
90 If you have a Alchemy platform with a MMC slot, say Y or M here. 90 If you have a Alchemy platform with a MMC slot, say Y or M here.
diff --git a/drivers/mmc/at91_mci.c b/drivers/mmc/at91_mci.c
index 6061c2d101a0..88f0eef9cf33 100644
--- a/drivers/mmc/at91_mci.c
+++ b/drivers/mmc/at91_mci.c
@@ -621,9 +621,6 @@ static void at91_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
621 struct at91mci_host *host = mmc_priv(mmc); 621 struct at91mci_host *host = mmc_priv(mmc);
622 unsigned long at91_master_clock = clk_get_rate(mci_clk); 622 unsigned long at91_master_clock = clk_get_rate(mci_clk);
623 623
624 DBG("Clock %uHz, busmode %u, powermode %u, Vdd %u\n",
625 ios->clock, ios->bus_mode, ios->power_mode, ios->vdd);
626
627 if (host) 624 if (host)
628 host->bus_mode = ios->bus_mode; 625 host->bus_mode = ios->bus_mode;
629 else 626 else
diff --git a/drivers/mmc/au1xmmc.c b/drivers/mmc/au1xmmc.c
index c0326bbc5f28..5dc4bee7abeb 100644
--- a/drivers/mmc/au1xmmc.c
+++ b/drivers/mmc/au1xmmc.c
@@ -310,7 +310,7 @@ static void au1xmmc_data_complete(struct au1xmmc_host *host, u32 status)
310 } 310 }
311 else 311 else
312 data->bytes_xfered = 312 data->bytes_xfered =
313 (data->blocks * (1 << data->blksz_bits)) - 313 (data->blocks * data->blksz) -
314 host->pio.len; 314 host->pio.len;
315 } 315 }
316 316
@@ -575,7 +575,7 @@ static int
575au1xmmc_prepare_data(struct au1xmmc_host *host, struct mmc_data *data) 575au1xmmc_prepare_data(struct au1xmmc_host *host, struct mmc_data *data)
576{ 576{
577 577
578 int datalen = data->blocks * (1 << data->blksz_bits); 578 int datalen = data->blocks * data->blksz;
579 579
580 if (dma != 0) 580 if (dma != 0)
581 host->flags |= HOST_F_DMA; 581 host->flags |= HOST_F_DMA;
@@ -596,7 +596,7 @@ au1xmmc_prepare_data(struct au1xmmc_host *host, struct mmc_data *data)
596 if (host->dma.len == 0) 596 if (host->dma.len == 0)
597 return MMC_ERR_TIMEOUT; 597 return MMC_ERR_TIMEOUT;
598 598
599 au_writel((1 << data->blksz_bits) - 1, HOST_BLKSIZE(host)); 599 au_writel(data->blksz - 1, HOST_BLKSIZE(host));
600 600
601 if (host->flags & HOST_F_DMA) { 601 if (host->flags & HOST_F_DMA) {
602 int i; 602 int i;
@@ -720,10 +720,6 @@ static void au1xmmc_set_ios(struct mmc_host* mmc, struct mmc_ios* ios)
720{ 720{
721 struct au1xmmc_host *host = mmc_priv(mmc); 721 struct au1xmmc_host *host = mmc_priv(mmc);
722 722
723 DBG("set_ios (power=%u, clock=%uHz, vdd=%u, mode=%u)\n",
724 host->id, ios->power_mode, ios->clock, ios->vdd,
725 ios->bus_mode);
726
727 if (ios->power_mode == MMC_POWER_OFF) 723 if (ios->power_mode == MMC_POWER_OFF)
728 au1xmmc_set_power(host, 0); 724 au1xmmc_set_power(host, 0);
729 else if (ios->power_mode == MMC_POWER_ON) { 725 else if (ios->power_mode == MMC_POWER_ON) {
diff --git a/drivers/mmc/imxmmc.c b/drivers/mmc/imxmmc.c
index ffb7f55d3467..a4eb1d0e7a71 100644
--- a/drivers/mmc/imxmmc.c
+++ b/drivers/mmc/imxmmc.c
@@ -102,6 +102,7 @@ struct imxmci_host {
102#define IMXMCI_PEND_CPU_DATA_b 5 102#define IMXMCI_PEND_CPU_DATA_b 5
103#define IMXMCI_PEND_CARD_XCHG_b 6 103#define IMXMCI_PEND_CARD_XCHG_b 6
104#define IMXMCI_PEND_SET_INIT_b 7 104#define IMXMCI_PEND_SET_INIT_b 7
105#define IMXMCI_PEND_STARTED_b 8
105 106
106#define IMXMCI_PEND_IRQ_m (1 << IMXMCI_PEND_IRQ_b) 107#define IMXMCI_PEND_IRQ_m (1 << IMXMCI_PEND_IRQ_b)
107#define IMXMCI_PEND_DMA_END_m (1 << IMXMCI_PEND_DMA_END_b) 108#define IMXMCI_PEND_DMA_END_m (1 << IMXMCI_PEND_DMA_END_b)
@@ -111,6 +112,7 @@ struct imxmci_host {
111#define IMXMCI_PEND_CPU_DATA_m (1 << IMXMCI_PEND_CPU_DATA_b) 112#define IMXMCI_PEND_CPU_DATA_m (1 << IMXMCI_PEND_CPU_DATA_b)
112#define IMXMCI_PEND_CARD_XCHG_m (1 << IMXMCI_PEND_CARD_XCHG_b) 113#define IMXMCI_PEND_CARD_XCHG_m (1 << IMXMCI_PEND_CARD_XCHG_b)
113#define IMXMCI_PEND_SET_INIT_m (1 << IMXMCI_PEND_SET_INIT_b) 114#define IMXMCI_PEND_SET_INIT_m (1 << IMXMCI_PEND_SET_INIT_b)
115#define IMXMCI_PEND_STARTED_m (1 << IMXMCI_PEND_STARTED_b)
114 116
115static void imxmci_stop_clock(struct imxmci_host *host) 117static void imxmci_stop_clock(struct imxmci_host *host)
116{ 118{
@@ -131,23 +133,52 @@ static void imxmci_stop_clock(struct imxmci_host *host)
131 dev_dbg(mmc_dev(host->mmc), "imxmci_stop_clock blocked, no luck\n"); 133 dev_dbg(mmc_dev(host->mmc), "imxmci_stop_clock blocked, no luck\n");
132} 134}
133 135
134static void imxmci_start_clock(struct imxmci_host *host) 136static int imxmci_start_clock(struct imxmci_host *host)
135{ 137{
136 int i = 0; 138 unsigned int trials = 0;
139 unsigned int delay_limit = 128;
140 unsigned long flags;
141
137 MMC_STR_STP_CLK &= ~STR_STP_CLK_STOP_CLK; 142 MMC_STR_STP_CLK &= ~STR_STP_CLK_STOP_CLK;
138 while(i < 0x1000) {
139 if(!(i & 0x7f))
140 MMC_STR_STP_CLK |= STR_STP_CLK_START_CLK;
141 143
142 if(MMC_STATUS & STATUS_CARD_BUS_CLK_RUN) { 144 clear_bit(IMXMCI_PEND_STARTED_b, &host->pending_events);
143 /* Check twice before cut */ 145
146 /*
147 * Command start of the clock, this usually succeeds in less
148 * then 6 delay loops, but during card detection (low clockrate)
149 * it takes up to 5000 delay loops and sometimes fails for the first time
150 */
151 MMC_STR_STP_CLK |= STR_STP_CLK_START_CLK;
152
153 do {
154 unsigned int delay = delay_limit;
155
156 while(delay--){
144 if(MMC_STATUS & STATUS_CARD_BUS_CLK_RUN) 157 if(MMC_STATUS & STATUS_CARD_BUS_CLK_RUN)
145 return; 158 /* Check twice before cut */
159 if(MMC_STATUS & STATUS_CARD_BUS_CLK_RUN)
160 return 0;
161
162 if(test_bit(IMXMCI_PEND_STARTED_b, &host->pending_events))
163 return 0;
146 } 164 }
147 165
148 i++; 166 local_irq_save(flags);
149 } 167 /*
150 dev_dbg(mmc_dev(host->mmc), "imxmci_start_clock blocked, no luck\n"); 168 * Ensure, that request is not doubled under all possible circumstances.
169 * It is possible, that cock running state is missed, because some other
170 * IRQ or schedule delays this function execution and the clocks has
171 * been already stopped by other means (response processing, SDHC HW)
172 */
173 if(!test_bit(IMXMCI_PEND_STARTED_b, &host->pending_events))
174 MMC_STR_STP_CLK |= STR_STP_CLK_START_CLK;
175 local_irq_restore(flags);
176
177 } while(++trials<256);
178
179 dev_err(mmc_dev(host->mmc), "imxmci_start_clock blocked, no luck\n");
180
181 return -1;
151} 182}
152 183
153static void imxmci_softreset(void) 184static void imxmci_softreset(void)
@@ -187,8 +218,10 @@ static int imxmci_busy_wait_for_status(struct imxmci_host *host,
187 if(!loops) 218 if(!loops)
188 return 0; 219 return 0;
189 220
190 dev_info(mmc_dev(host->mmc), "busy wait for %d usec in %s, STATUS = 0x%x (0x%x)\n", 221 /* The busy-wait is expected there for clock <8MHz due to SDHC hardware flaws */
191 loops, where, *pstat, stat_mask); 222 if(!(stat_mask & STATUS_END_CMD_RESP) || (host->mmc->ios.clock>=8000000))
223 dev_info(mmc_dev(host->mmc), "busy wait for %d usec in %s, STATUS = 0x%x (0x%x)\n",
224 loops, where, *pstat, stat_mask);
192 return loops; 225 return loops;
193} 226}
194 227
@@ -302,6 +335,9 @@ static void imxmci_start_cmd(struct imxmci_host *host, struct mmc_command *cmd,
302 WARN_ON(host->cmd != NULL); 335 WARN_ON(host->cmd != NULL);
303 host->cmd = cmd; 336 host->cmd = cmd;
304 337
338 /* Ensure, that clock are stopped else command programming and start fails */
339 imxmci_stop_clock(host);
340
305 if (cmd->flags & MMC_RSP_BUSY) 341 if (cmd->flags & MMC_RSP_BUSY)
306 cmdat |= CMD_DAT_CONT_BUSY; 342 cmdat |= CMD_DAT_CONT_BUSY;
307 343
@@ -498,7 +534,7 @@ static int imxmci_data_done(struct imxmci_host *host, unsigned int stat)
498 534
499 data_error = imxmci_finish_data(host, stat); 535 data_error = imxmci_finish_data(host, stat);
500 536
501 if (host->req->stop && (data_error == MMC_ERR_NONE)) { 537 if (host->req->stop) {
502 imxmci_stop_clock(host); 538 imxmci_stop_clock(host);
503 imxmci_start_cmd(host, host->req->stop, 0); 539 imxmci_start_cmd(host, host->req->stop, 0);
504 } else { 540 } else {
@@ -522,7 +558,7 @@ static int imxmci_cpu_driven_data(struct imxmci_host *host, unsigned int *pstat)
522 int trans_done = 0; 558 int trans_done = 0;
523 unsigned int stat = *pstat; 559 unsigned int stat = *pstat;
524 560
525 if(host->actual_bus_width == MMC_BUS_WIDTH_4) 561 if(host->actual_bus_width != MMC_BUS_WIDTH_4)
526 burst_len = 16; 562 burst_len = 16;
527 else 563 else
528 burst_len = 64; 564 burst_len = 64;
@@ -560,8 +596,7 @@ static int imxmci_cpu_driven_data(struct imxmci_host *host, unsigned int *pstat)
560 stat = MMC_STATUS; 596 stat = MMC_STATUS;
561 597
562 /* Flush extra bytes from FIFO */ 598 /* Flush extra bytes from FIFO */
563 while(flush_len >= 2){ 599 while(flush_len && !(stat & STATUS_DATA_TRANS_DONE)){
564 flush_len -= 2;
565 i = MMC_BUFFER_ACCESS; 600 i = MMC_BUFFER_ACCESS;
566 stat = MMC_STATUS; 601 stat = MMC_STATUS;
567 stat &= ~STATUS_CRC_READ_ERR; /* Stupid but required there */ 602 stat &= ~STATUS_CRC_READ_ERR; /* Stupid but required there */
@@ -622,6 +657,7 @@ static irqreturn_t imxmci_irq(int irq, void *devid, struct pt_regs *regs)
622 atomic_set(&host->stuck_timeout, 0); 657 atomic_set(&host->stuck_timeout, 0);
623 host->status_reg = stat; 658 host->status_reg = stat;
624 set_bit(IMXMCI_PEND_IRQ_b, &host->pending_events); 659 set_bit(IMXMCI_PEND_IRQ_b, &host->pending_events);
660 set_bit(IMXMCI_PEND_STARTED_b, &host->pending_events);
625 tasklet_schedule(&host->tasklet); 661 tasklet_schedule(&host->tasklet);
626 662
627 return IRQ_RETVAL(handled);; 663 return IRQ_RETVAL(handled);;
@@ -714,10 +750,6 @@ static void imxmci_tasklet_fnc(unsigned long data)
714 data_dir_mask = STATUS_DATA_TRANS_DONE; 750 data_dir_mask = STATUS_DATA_TRANS_DONE;
715 } 751 }
716 752
717 imxmci_busy_wait_for_status(host, &stat,
718 data_dir_mask,
719 50, "imxmci_tasklet_fnc data");
720
721 if(stat & data_dir_mask) { 753 if(stat & data_dir_mask) {
722 clear_bit(IMXMCI_PEND_DMA_END_b, &host->pending_events); 754 clear_bit(IMXMCI_PEND_DMA_END_b, &host->pending_events);
723 imxmci_data_done(host, stat); 755 imxmci_data_done(host, stat);
@@ -775,10 +807,6 @@ static void imxmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
775 struct imxmci_host *host = mmc_priv(mmc); 807 struct imxmci_host *host = mmc_priv(mmc);
776 int prescaler; 808 int prescaler;
777 809
778 dev_dbg(mmc_dev(host->mmc), "clock %u power %u vdd %u width %u\n",
779 ios->clock, ios->power_mode, ios->vdd,
780 (ios->bus_width==MMC_BUS_WIDTH_4)?4:1);
781
782 if( ios->bus_width==MMC_BUS_WIDTH_4 ) { 810 if( ios->bus_width==MMC_BUS_WIDTH_4 ) {
783 host->actual_bus_width = MMC_BUS_WIDTH_4; 811 host->actual_bus_width = MMC_BUS_WIDTH_4;
784 imx_gpio_mode(PB11_PF_SD_DAT3); 812 imx_gpio_mode(PB11_PF_SD_DAT3);
@@ -837,7 +865,11 @@ static void imxmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
837 865
838 imxmci_stop_clock(host); 866 imxmci_stop_clock(host);
839 MMC_CLK_RATE = (prescaler<<3) | clk; 867 MMC_CLK_RATE = (prescaler<<3) | clk;
840 imxmci_start_clock(host); 868 /*
869 * Under my understanding, clock should not be started there, because it would
870 * initiate SDHC sequencer and send last or random command into card
871 */
872 /*imxmci_start_clock(host);*/
841 873
842 dev_dbg(mmc_dev(host->mmc), "MMC_CLK_RATE: 0x%08x\n", MMC_CLK_RATE); 874 dev_dbg(mmc_dev(host->mmc), "MMC_CLK_RATE: 0x%08x\n", MMC_CLK_RATE);
843 } else { 875 } else {
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index da6ddd910fc5..6201f3086a02 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -59,21 +59,23 @@ static const unsigned int tacc_mant[] = {
59 59
60 60
61/** 61/**
62 * mmc_request_done - finish processing an MMC command 62 * mmc_request_done - finish processing an MMC request
63 * @host: MMC host which completed command 63 * @host: MMC host which completed request
64 * @mrq: MMC request which completed 64 * @mrq: MMC request which request
65 * 65 *
66 * MMC drivers should call this function when they have completed 66 * MMC drivers should call this function when they have completed
67 * their processing of a command. This should be called before the 67 * their processing of a request.
68 * data part of the command has completed.
69 */ 68 */
70void mmc_request_done(struct mmc_host *host, struct mmc_request *mrq) 69void mmc_request_done(struct mmc_host *host, struct mmc_request *mrq)
71{ 70{
72 struct mmc_command *cmd = mrq->cmd; 71 struct mmc_command *cmd = mrq->cmd;
73 int err = mrq->cmd->error; 72 int err = cmd->error;
74 pr_debug("MMC: req done (%02x): %d: %08x %08x %08x %08x\n", 73
75 cmd->opcode, err, cmd->resp[0], cmd->resp[1], 74 pr_debug("%s: req done (CMD%u): %d/%d/%d: %08x %08x %08x %08x\n",
76 cmd->resp[2], cmd->resp[3]); 75 mmc_hostname(host), cmd->opcode, err,
76 mrq->data ? mrq->data->error : 0,
77 mrq->stop ? mrq->stop->error : 0,
78 cmd->resp[0], cmd->resp[1], cmd->resp[2], cmd->resp[3]);
77 79
78 if (err && cmd->retries) { 80 if (err && cmd->retries) {
79 cmd->retries--; 81 cmd->retries--;
@@ -97,8 +99,9 @@ EXPORT_SYMBOL(mmc_request_done);
97void 99void
98mmc_start_request(struct mmc_host *host, struct mmc_request *mrq) 100mmc_start_request(struct mmc_host *host, struct mmc_request *mrq)
99{ 101{
100 pr_debug("MMC: starting cmd %02x arg %08x flags %08x\n", 102 pr_debug("%s: starting CMD%u arg %08x flags %08x\n",
101 mrq->cmd->opcode, mrq->cmd->arg, mrq->cmd->flags); 103 mmc_hostname(host), mrq->cmd->opcode,
104 mrq->cmd->arg, mrq->cmd->flags);
102 105
103 WARN_ON(host->card_busy == NULL); 106 WARN_ON(host->card_busy == NULL);
104 107
@@ -312,6 +315,18 @@ void mmc_release_host(struct mmc_host *host)
312 315
313EXPORT_SYMBOL(mmc_release_host); 316EXPORT_SYMBOL(mmc_release_host);
314 317
318static inline void mmc_set_ios(struct mmc_host *host)
319{
320 struct mmc_ios *ios = &host->ios;
321
322 pr_debug("%s: clock %uHz busmode %u powermode %u cs %u Vdd %u width %u\n",
323 mmc_hostname(host), ios->clock, ios->bus_mode,
324 ios->power_mode, ios->chip_select, ios->vdd,
325 ios->bus_width);
326
327 host->ops->set_ios(host, ios);
328}
329
315static int mmc_select_card(struct mmc_host *host, struct mmc_card *card) 330static int mmc_select_card(struct mmc_host *host, struct mmc_card *card)
316{ 331{
317 int err; 332 int err;
@@ -364,7 +379,7 @@ static int mmc_select_card(struct mmc_host *host, struct mmc_card *card)
364 } 379 }
365 } 380 }
366 381
367 host->ops->set_ios(host, &host->ios); 382 mmc_set_ios(host);
368 383
369 return MMC_ERR_NONE; 384 return MMC_ERR_NONE;
370} 385}
@@ -415,7 +430,7 @@ static u32 mmc_select_voltage(struct mmc_host *host, u32 ocr)
415 ocr = 3 << bit; 430 ocr = 3 << bit;
416 431
417 host->ios.vdd = bit; 432 host->ios.vdd = bit;
418 host->ops->set_ios(host, &host->ios); 433 mmc_set_ios(host);
419 } else { 434 } else {
420 ocr = 0; 435 ocr = 0;
421 } 436 }
@@ -549,6 +564,7 @@ static void mmc_decode_csd(struct mmc_card *card)
549 csd->read_partial = UNSTUFF_BITS(resp, 79, 1); 564 csd->read_partial = UNSTUFF_BITS(resp, 79, 1);
550 csd->write_misalign = UNSTUFF_BITS(resp, 78, 1); 565 csd->write_misalign = UNSTUFF_BITS(resp, 78, 1);
551 csd->read_misalign = UNSTUFF_BITS(resp, 77, 1); 566 csd->read_misalign = UNSTUFF_BITS(resp, 77, 1);
567 csd->r2w_factor = UNSTUFF_BITS(resp, 26, 3);
552 csd->write_blkbits = UNSTUFF_BITS(resp, 22, 4); 568 csd->write_blkbits = UNSTUFF_BITS(resp, 22, 4);
553 csd->write_partial = UNSTUFF_BITS(resp, 21, 1); 569 csd->write_partial = UNSTUFF_BITS(resp, 21, 1);
554 } else { 570 } else {
@@ -583,6 +599,7 @@ static void mmc_decode_csd(struct mmc_card *card)
583 csd->read_partial = UNSTUFF_BITS(resp, 79, 1); 599 csd->read_partial = UNSTUFF_BITS(resp, 79, 1);
584 csd->write_misalign = UNSTUFF_BITS(resp, 78, 1); 600 csd->write_misalign = UNSTUFF_BITS(resp, 78, 1);
585 csd->read_misalign = UNSTUFF_BITS(resp, 77, 1); 601 csd->read_misalign = UNSTUFF_BITS(resp, 77, 1);
602 csd->r2w_factor = UNSTUFF_BITS(resp, 26, 3);
586 csd->write_blkbits = UNSTUFF_BITS(resp, 22, 4); 603 csd->write_blkbits = UNSTUFF_BITS(resp, 22, 4);
587 csd->write_partial = UNSTUFF_BITS(resp, 21, 1); 604 csd->write_partial = UNSTUFF_BITS(resp, 21, 1);
588 } 605 }
@@ -666,7 +683,7 @@ static void mmc_idle_cards(struct mmc_host *host)
666 struct mmc_command cmd; 683 struct mmc_command cmd;
667 684
668 host->ios.chip_select = MMC_CS_HIGH; 685 host->ios.chip_select = MMC_CS_HIGH;
669 host->ops->set_ios(host, &host->ios); 686 mmc_set_ios(host);
670 687
671 mmc_delay(1); 688 mmc_delay(1);
672 689
@@ -679,7 +696,7 @@ static void mmc_idle_cards(struct mmc_host *host)
679 mmc_delay(1); 696 mmc_delay(1);
680 697
681 host->ios.chip_select = MMC_CS_DONTCARE; 698 host->ios.chip_select = MMC_CS_DONTCARE;
682 host->ops->set_ios(host, &host->ios); 699 mmc_set_ios(host);
683 700
684 mmc_delay(1); 701 mmc_delay(1);
685} 702}
@@ -704,13 +721,13 @@ static void mmc_power_up(struct mmc_host *host)
704 host->ios.chip_select = MMC_CS_DONTCARE; 721 host->ios.chip_select = MMC_CS_DONTCARE;
705 host->ios.power_mode = MMC_POWER_UP; 722 host->ios.power_mode = MMC_POWER_UP;
706 host->ios.bus_width = MMC_BUS_WIDTH_1; 723 host->ios.bus_width = MMC_BUS_WIDTH_1;
707 host->ops->set_ios(host, &host->ios); 724 mmc_set_ios(host);
708 725
709 mmc_delay(1); 726 mmc_delay(1);
710 727
711 host->ios.clock = host->f_min; 728 host->ios.clock = host->f_min;
712 host->ios.power_mode = MMC_POWER_ON; 729 host->ios.power_mode = MMC_POWER_ON;
713 host->ops->set_ios(host, &host->ios); 730 mmc_set_ios(host);
714 731
715 mmc_delay(2); 732 mmc_delay(2);
716} 733}
@@ -723,7 +740,7 @@ static void mmc_power_off(struct mmc_host *host)
723 host->ios.chip_select = MMC_CS_DONTCARE; 740 host->ios.chip_select = MMC_CS_DONTCARE;
724 host->ios.power_mode = MMC_POWER_OFF; 741 host->ios.power_mode = MMC_POWER_OFF;
725 host->ios.bus_width = MMC_BUS_WIDTH_1; 742 host->ios.bus_width = MMC_BUS_WIDTH_1;
726 host->ops->set_ios(host, &host->ios); 743 mmc_set_ios(host);
727} 744}
728 745
729static int mmc_send_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr) 746static int mmc_send_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr)
@@ -934,6 +951,7 @@ static void mmc_read_scrs(struct mmc_host *host)
934 data.timeout_ns = card->csd.tacc_ns * 10; 951 data.timeout_ns = card->csd.tacc_ns * 10;
935 data.timeout_clks = card->csd.tacc_clks * 10; 952 data.timeout_clks = card->csd.tacc_clks * 10;
936 data.blksz_bits = 3; 953 data.blksz_bits = 3;
954 data.blksz = 1 << 3;
937 data.blocks = 1; 955 data.blocks = 1;
938 data.flags = MMC_DATA_READ; 956 data.flags = MMC_DATA_READ;
939 data.sg = &sg; 957 data.sg = &sg;
@@ -971,7 +989,8 @@ static unsigned int mmc_calculate_clock(struct mmc_host *host)
971 if (!mmc_card_dead(card) && max_dtr > card->csd.max_dtr) 989 if (!mmc_card_dead(card) && max_dtr > card->csd.max_dtr)
972 max_dtr = card->csd.max_dtr; 990 max_dtr = card->csd.max_dtr;
973 991
974 pr_debug("MMC: selected %d.%03dMHz transfer rate\n", 992 pr_debug("%s: selected %d.%03dMHz transfer rate\n",
993 mmc_hostname(host),
975 max_dtr / 1000000, (max_dtr / 1000) % 1000); 994 max_dtr / 1000000, (max_dtr / 1000) % 1000);
976 995
977 return max_dtr; 996 return max_dtr;
@@ -1046,7 +1065,7 @@ static void mmc_setup(struct mmc_host *host)
1046 } else { 1065 } else {
1047 host->ios.bus_mode = MMC_BUSMODE_OPENDRAIN; 1066 host->ios.bus_mode = MMC_BUSMODE_OPENDRAIN;
1048 host->ios.clock = host->f_min; 1067 host->ios.clock = host->f_min;
1049 host->ops->set_ios(host, &host->ios); 1068 mmc_set_ios(host);
1050 1069
1051 /* 1070 /*
1052 * We should remember the OCR mask from the existing 1071 * We should remember the OCR mask from the existing
@@ -1082,7 +1101,7 @@ static void mmc_setup(struct mmc_host *host)
1082 * Ok, now switch to push-pull mode. 1101 * Ok, now switch to push-pull mode.
1083 */ 1102 */
1084 host->ios.bus_mode = MMC_BUSMODE_PUSHPULL; 1103 host->ios.bus_mode = MMC_BUSMODE_PUSHPULL;
1085 host->ops->set_ios(host, &host->ios); 1104 mmc_set_ios(host);
1086 1105
1087 mmc_read_csds(host); 1106 mmc_read_csds(host);
1088 1107
@@ -1128,7 +1147,7 @@ static void mmc_rescan(void *data)
1128 * attached cards and the host support. 1147 * attached cards and the host support.
1129 */ 1148 */
1130 host->ios.clock = mmc_calculate_clock(host); 1149 host->ios.clock = mmc_calculate_clock(host);
1131 host->ops->set_ios(host, &host->ios); 1150 mmc_set_ios(host);
1132 } 1151 }
1133 1152
1134 mmc_release_host(host); 1153 mmc_release_host(host);
diff --git a/drivers/mmc/mmc_block.c b/drivers/mmc/mmc_block.c
index 8eb2a2ede64b..587458b370b9 100644
--- a/drivers/mmc/mmc_block.c
+++ b/drivers/mmc/mmc_block.c
@@ -175,6 +175,7 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
175 brq.data.timeout_ns = card->csd.tacc_ns * 10; 175 brq.data.timeout_ns = card->csd.tacc_ns * 10;
176 brq.data.timeout_clks = card->csd.tacc_clks * 10; 176 brq.data.timeout_clks = card->csd.tacc_clks * 10;
177 brq.data.blksz_bits = md->block_bits; 177 brq.data.blksz_bits = md->block_bits;
178 brq.data.blksz = 1 << md->block_bits;
178 brq.data.blocks = req->nr_sectors >> (md->block_bits - 9); 179 brq.data.blocks = req->nr_sectors >> (md->block_bits - 9);
179 brq.stop.opcode = MMC_STOP_TRANSMISSION; 180 brq.stop.opcode = MMC_STOP_TRANSMISSION;
180 brq.stop.arg = 0; 181 brq.stop.arg = 0;
@@ -187,6 +188,12 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
187 brq.cmd.opcode = MMC_WRITE_BLOCK; 188 brq.cmd.opcode = MMC_WRITE_BLOCK;
188 brq.data.flags |= MMC_DATA_WRITE; 189 brq.data.flags |= MMC_DATA_WRITE;
189 brq.data.blocks = 1; 190 brq.data.blocks = 1;
191
192 /*
193 * Scale up the timeout by the r2w factor
194 */
195 brq.data.timeout_ns <<= card->csd.r2w_factor;
196 brq.data.timeout_clks <<= card->csd.r2w_factor;
190 } 197 }
191 198
192 if (brq.data.blocks > 1) { 199 if (brq.data.blocks > 1) {
@@ -346,7 +353,7 @@ static struct mmc_blk_data *mmc_blk_alloc(struct mmc_card *card)
346 */ 353 */
347 printk(KERN_ERR "%s: unable to select block size for " 354 printk(KERN_ERR "%s: unable to select block size for "
348 "writing (rb%u wb%u rp%u wp%u)\n", 355 "writing (rb%u wb%u rp%u wp%u)\n",
349 md->disk->disk_name, 356 mmc_card_id(card),
350 1 << card->csd.read_blkbits, 357 1 << card->csd.read_blkbits,
351 1 << card->csd.write_blkbits, 358 1 << card->csd.write_blkbits,
352 card->csd.read_partial, 359 card->csd.read_partial,
diff --git a/drivers/mmc/mmci.c b/drivers/mmc/mmci.c
index df7e861e2fc7..da8e4d7339cc 100644
--- a/drivers/mmc/mmci.c
+++ b/drivers/mmc/mmci.c
@@ -402,9 +402,6 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
402 struct mmci_host *host = mmc_priv(mmc); 402 struct mmci_host *host = mmc_priv(mmc);
403 u32 clk = 0, pwr = 0; 403 u32 clk = 0, pwr = 0;
404 404
405 DBG(host, "clock %uHz busmode %u powermode %u Vdd %u\n",
406 ios->clock, ios->bus_mode, ios->power_mode, ios->vdd);
407
408 if (ios->clock) { 405 if (ios->clock) {
409 if (ios->clock >= host->mclk) { 406 if (ios->clock >= host->mclk) {
410 clk = MCI_CLK_BYPASS; 407 clk = MCI_CLK_BYPASS;
diff --git a/drivers/mmc/pxamci.c b/drivers/mmc/pxamci.c
index eb9a8826e9b5..b49368fd96b8 100644
--- a/drivers/mmc/pxamci.c
+++ b/drivers/mmc/pxamci.c
@@ -65,11 +65,6 @@ struct pxamci_host {
65 unsigned int dma_dir; 65 unsigned int dma_dir;
66}; 66};
67 67
68static inline unsigned int ns_to_clocks(unsigned int ns)
69{
70 return (ns * (CLOCKRATE / 1000000) + 999) / 1000;
71}
72
73static void pxamci_stop_clock(struct pxamci_host *host) 68static void pxamci_stop_clock(struct pxamci_host *host)
74{ 69{
75 if (readl(host->base + MMC_STAT) & STAT_CLK_EN) { 70 if (readl(host->base + MMC_STAT) & STAT_CLK_EN) {
@@ -113,6 +108,7 @@ static void pxamci_disable_irq(struct pxamci_host *host, unsigned int mask)
113static void pxamci_setup_data(struct pxamci_host *host, struct mmc_data *data) 108static void pxamci_setup_data(struct pxamci_host *host, struct mmc_data *data)
114{ 109{
115 unsigned int nob = data->blocks; 110 unsigned int nob = data->blocks;
111 unsigned long long clks;
116 unsigned int timeout; 112 unsigned int timeout;
117 u32 dcmd; 113 u32 dcmd;
118 int i; 114 int i;
@@ -123,9 +119,11 @@ static void pxamci_setup_data(struct pxamci_host *host, struct mmc_data *data)
123 nob = 0xffff; 119 nob = 0xffff;
124 120
125 writel(nob, host->base + MMC_NOB); 121 writel(nob, host->base + MMC_NOB);
126 writel(1 << data->blksz_bits, host->base + MMC_BLKLEN); 122 writel(data->blksz, host->base + MMC_BLKLEN);
127 123
128 timeout = ns_to_clocks(data->timeout_ns) + data->timeout_clks; 124 clks = (unsigned long long)data->timeout_ns * CLOCKRATE;
125 do_div(clks, 1000000000UL);
126 timeout = (unsigned int)clks + (data->timeout_clks << host->clkrt);
129 writel((timeout + 255) / 256, host->base + MMC_RDTO); 127 writel((timeout + 255) / 256, host->base + MMC_RDTO);
130 128
131 if (data->flags & MMC_DATA_READ) { 129 if (data->flags & MMC_DATA_READ) {
@@ -200,7 +198,6 @@ static void pxamci_start_cmd(struct pxamci_host *host, struct mmc_command *cmd,
200 198
201static void pxamci_finish_request(struct pxamci_host *host, struct mmc_request *mrq) 199static void pxamci_finish_request(struct pxamci_host *host, struct mmc_request *mrq)
202{ 200{
203 pr_debug("PXAMCI: request done\n");
204 host->mrq = NULL; 201 host->mrq = NULL;
205 host->cmd = NULL; 202 host->cmd = NULL;
206 host->data = NULL; 203 host->data = NULL;
@@ -286,14 +283,14 @@ static int pxamci_data_done(struct pxamci_host *host, unsigned int stat)
286 * data blocks as being in error. 283 * data blocks as being in error.
287 */ 284 */
288 if (data->error == MMC_ERR_NONE) 285 if (data->error == MMC_ERR_NONE)
289 data->bytes_xfered = data->blocks << data->blksz_bits; 286 data->bytes_xfered = data->blocks * data->blksz;
290 else 287 else
291 data->bytes_xfered = 0; 288 data->bytes_xfered = 0;
292 289
293 pxamci_disable_irq(host, DATA_TRAN_DONE); 290 pxamci_disable_irq(host, DATA_TRAN_DONE);
294 291
295 host->data = NULL; 292 host->data = NULL;
296 if (host->mrq->stop && data->error == MMC_ERR_NONE) { 293 if (host->mrq->stop) {
297 pxamci_stop_clock(host); 294 pxamci_stop_clock(host);
298 pxamci_start_cmd(host, host->mrq->stop, 0); 295 pxamci_start_cmd(host, host->mrq->stop, 0);
299 } else { 296 } else {
@@ -311,12 +308,10 @@ static irqreturn_t pxamci_irq(int irq, void *devid, struct pt_regs *regs)
311 308
312 ireg = readl(host->base + MMC_I_REG); 309 ireg = readl(host->base + MMC_I_REG);
313 310
314 pr_debug("PXAMCI: irq %08x\n", ireg);
315
316 if (ireg) { 311 if (ireg) {
317 unsigned stat = readl(host->base + MMC_STAT); 312 unsigned stat = readl(host->base + MMC_STAT);
318 313
319 pr_debug("PXAMCI: stat %08x\n", stat); 314 pr_debug("PXAMCI: irq %08x stat %08x\n", ireg, stat);
320 315
321 if (ireg & END_CMD_RES) 316 if (ireg & END_CMD_RES)
322 handled |= pxamci_cmd_done(host, stat); 317 handled |= pxamci_cmd_done(host, stat);
@@ -370,10 +365,6 @@ static void pxamci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
370{ 365{
371 struct pxamci_host *host = mmc_priv(mmc); 366 struct pxamci_host *host = mmc_priv(mmc);
372 367
373 pr_debug("pxamci_set_ios: clock %u power %u vdd %u.%02u\n",
374 ios->clock, ios->power_mode, ios->vdd / 100,
375 ios->vdd % 100);
376
377 if (ios->clock) { 368 if (ios->clock) {
378 unsigned int clk = CLOCKRATE / ios->clock; 369 unsigned int clk = CLOCKRATE / ios->clock;
379 if (CLOCKRATE / clk > ios->clock) 370 if (CLOCKRATE / clk > ios->clock)
@@ -399,7 +390,7 @@ static void pxamci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
399 host->cmdat |= CMDAT_INIT; 390 host->cmdat |= CMDAT_INIT;
400 } 391 }
401 392
402 pr_debug("pxamci_set_ios: clkrt = %x cmdat = %x\n", 393 pr_debug("PXAMCI: clkrt = %x cmdat = %x\n",
403 host->clkrt, host->cmdat); 394 host->clkrt, host->cmdat);
404} 395}
405 396
diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index bdbfca050029..b0053280ff2d 100644
--- a/drivers/mmc/sdhci.c
+++ b/drivers/mmc/sdhci.c
@@ -570,10 +570,6 @@ static void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
570 570
571 spin_lock_irqsave(&host->lock, flags); 571 spin_lock_irqsave(&host->lock, flags);
572 572
573 DBG("clock %uHz busmode %u powermode %u cs %u Vdd %u width %u\n",
574 ios->clock, ios->bus_mode, ios->power_mode, ios->chip_select,
575 ios->vdd, ios->bus_width);
576
577 /* 573 /*
578 * Reset the chip on each power off. 574 * Reset the chip on each power off.
579 * Should clear out any weird states. 575 * Should clear out any weird states.
diff --git a/drivers/mmc/wbsd.c b/drivers/mmc/wbsd.c
index 511f7b0b31d2..8167332d4013 100644
--- a/drivers/mmc/wbsd.c
+++ b/drivers/mmc/wbsd.c
@@ -662,14 +662,14 @@ static void wbsd_prepare_data(struct wbsd_host *host, struct mmc_data *data)
662 unsigned long dmaflags; 662 unsigned long dmaflags;
663 663
664 DBGF("blksz %04x blks %04x flags %08x\n", 664 DBGF("blksz %04x blks %04x flags %08x\n",
665 1 << data->blksz_bits, data->blocks, data->flags); 665 data->blksz, data->blocks, data->flags);
666 DBGF("tsac %d ms nsac %d clk\n", 666 DBGF("tsac %d ms nsac %d clk\n",
667 data->timeout_ns / 1000000, data->timeout_clks); 667 data->timeout_ns / 1000000, data->timeout_clks);
668 668
669 /* 669 /*
670 * Calculate size. 670 * Calculate size.
671 */ 671 */
672 host->size = data->blocks << data->blksz_bits; 672 host->size = data->blocks * data->blksz;
673 673
674 /* 674 /*
675 * Check timeout values for overflow. 675 * Check timeout values for overflow.
@@ -696,12 +696,12 @@ static void wbsd_prepare_data(struct wbsd_host *host, struct mmc_data *data)
696 * Two bytes are needed for each data line. 696 * Two bytes are needed for each data line.
697 */ 697 */
698 if (host->bus_width == MMC_BUS_WIDTH_1) { 698 if (host->bus_width == MMC_BUS_WIDTH_1) {
699 blksize = (1 << data->blksz_bits) + 2; 699 blksize = data->blksz + 2;
700 700
701 wbsd_write_index(host, WBSD_IDX_PBSMSB, (blksize >> 4) & 0xF0); 701 wbsd_write_index(host, WBSD_IDX_PBSMSB, (blksize >> 4) & 0xF0);
702 wbsd_write_index(host, WBSD_IDX_PBSLSB, blksize & 0xFF); 702 wbsd_write_index(host, WBSD_IDX_PBSLSB, blksize & 0xFF);
703 } else if (host->bus_width == MMC_BUS_WIDTH_4) { 703 } else if (host->bus_width == MMC_BUS_WIDTH_4) {
704 blksize = (1 << data->blksz_bits) + 2 * 4; 704 blksize = data->blksz + 2 * 4;
705 705
706 wbsd_write_index(host, WBSD_IDX_PBSMSB, 706 wbsd_write_index(host, WBSD_IDX_PBSMSB,
707 ((blksize >> 4) & 0xF0) | WBSD_DATA_WIDTH); 707 ((blksize >> 4) & 0xF0) | WBSD_DATA_WIDTH);
@@ -931,10 +931,6 @@ static void wbsd_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
931 struct wbsd_host *host = mmc_priv(mmc); 931 struct wbsd_host *host = mmc_priv(mmc);
932 u8 clk, setup, pwr; 932 u8 clk, setup, pwr;
933 933
934 DBGF("clock %uHz busmode %u powermode %u cs %u Vdd %u width %u\n",
935 ios->clock, ios->bus_mode, ios->power_mode, ios->chip_select,
936 ios->vdd, ios->bus_width);
937
938 spin_lock_bh(&host->lock); 934 spin_lock_bh(&host->lock);
939 935
940 /* 936 /*
diff --git a/drivers/net/au1000_eth.c b/drivers/net/au1000_eth.c
index 1363083b4d83..14dbad14afb6 100644
--- a/drivers/net/au1000_eth.c
+++ b/drivers/net/au1000_eth.c
@@ -52,6 +52,7 @@
52#include <linux/mii.h> 52#include <linux/mii.h>
53#include <linux/skbuff.h> 53#include <linux/skbuff.h>
54#include <linux/delay.h> 54#include <linux/delay.h>
55#include <linux/crc32.h>
55#include <asm/mipsregs.h> 56#include <asm/mipsregs.h>
56#include <asm/irq.h> 57#include <asm/irq.h>
57#include <asm/io.h> 58#include <asm/io.h>
@@ -2070,23 +2071,6 @@ static void au1000_tx_timeout(struct net_device *dev)
2070 netif_wake_queue(dev); 2071 netif_wake_queue(dev);
2071} 2072}
2072 2073
2073
2074static unsigned const ethernet_polynomial = 0x04c11db7U;
2075static inline u32 ether_crc(int length, unsigned char *data)
2076{
2077 int crc = -1;
2078
2079 while(--length >= 0) {
2080 unsigned char current_octet = *data++;
2081 int bit;
2082 for (bit = 0; bit < 8; bit++, current_octet >>= 1)
2083 crc = (crc << 1) ^
2084 ((crc < 0) ^ (current_octet & 1) ?
2085 ethernet_polynomial : 0);
2086 }
2087 return crc;
2088}
2089
2090static void set_rx_mode(struct net_device *dev) 2074static void set_rx_mode(struct net_device *dev)
2091{ 2075{
2092 struct au1000_private *aup = (struct au1000_private *) dev->priv; 2076 struct au1000_private *aup = (struct au1000_private *) dev->priv;
diff --git a/drivers/net/b44.c b/drivers/net/b44.c
index 3d306681919e..d8233e0b7899 100644
--- a/drivers/net/b44.c
+++ b/drivers/net/b44.c
@@ -650,9 +650,11 @@ static int b44_alloc_rx_skb(struct b44 *bp, int src_idx, u32 dest_idx_unmasked)
650 650
651 /* Hardware bug work-around, the chip is unable to do PCI DMA 651 /* Hardware bug work-around, the chip is unable to do PCI DMA
652 to/from anything above 1GB :-( */ 652 to/from anything above 1GB :-( */
653 if (mapping + RX_PKT_BUF_SZ > B44_DMA_MASK) { 653 if (dma_mapping_error(mapping) ||
654 mapping + RX_PKT_BUF_SZ > B44_DMA_MASK) {
654 /* Sigh... */ 655 /* Sigh... */
655 pci_unmap_single(bp->pdev, mapping, RX_PKT_BUF_SZ,PCI_DMA_FROMDEVICE); 656 if (!dma_mapping_error(mapping))
657 pci_unmap_single(bp->pdev, mapping, RX_PKT_BUF_SZ,PCI_DMA_FROMDEVICE);
656 dev_kfree_skb_any(skb); 658 dev_kfree_skb_any(skb);
657 skb = __dev_alloc_skb(RX_PKT_BUF_SZ,GFP_DMA); 659 skb = __dev_alloc_skb(RX_PKT_BUF_SZ,GFP_DMA);
658 if (skb == NULL) 660 if (skb == NULL)
@@ -660,8 +662,10 @@ static int b44_alloc_rx_skb(struct b44 *bp, int src_idx, u32 dest_idx_unmasked)
660 mapping = pci_map_single(bp->pdev, skb->data, 662 mapping = pci_map_single(bp->pdev, skb->data,
661 RX_PKT_BUF_SZ, 663 RX_PKT_BUF_SZ,
662 PCI_DMA_FROMDEVICE); 664 PCI_DMA_FROMDEVICE);
663 if (mapping + RX_PKT_BUF_SZ > B44_DMA_MASK) { 665 if (dma_mapping_error(mapping) ||
664 pci_unmap_single(bp->pdev, mapping, RX_PKT_BUF_SZ,PCI_DMA_FROMDEVICE); 666 mapping + RX_PKT_BUF_SZ > B44_DMA_MASK) {
667 if (!dma_mapping_error(mapping))
668 pci_unmap_single(bp->pdev, mapping, RX_PKT_BUF_SZ,PCI_DMA_FROMDEVICE);
665 dev_kfree_skb_any(skb); 669 dev_kfree_skb_any(skb);
666 return -ENOMEM; 670 return -ENOMEM;
667 } 671 }
@@ -967,9 +971,10 @@ static int b44_start_xmit(struct sk_buff *skb, struct net_device *dev)
967 } 971 }
968 972
969 mapping = pci_map_single(bp->pdev, skb->data, len, PCI_DMA_TODEVICE); 973 mapping = pci_map_single(bp->pdev, skb->data, len, PCI_DMA_TODEVICE);
970 if (mapping + len > B44_DMA_MASK) { 974 if (dma_mapping_error(mapping) || mapping + len > B44_DMA_MASK) {
971 /* Chip can't handle DMA to/from >1GB, use bounce buffer */ 975 /* Chip can't handle DMA to/from >1GB, use bounce buffer */
972 pci_unmap_single(bp->pdev, mapping, len, PCI_DMA_TODEVICE); 976 if (!dma_mapping_error(mapping))
977 pci_unmap_single(bp->pdev, mapping, len, PCI_DMA_TODEVICE);
973 978
974 bounce_skb = __dev_alloc_skb(TX_PKT_BUF_SZ, 979 bounce_skb = __dev_alloc_skb(TX_PKT_BUF_SZ,
975 GFP_ATOMIC|GFP_DMA); 980 GFP_ATOMIC|GFP_DMA);
@@ -978,8 +983,9 @@ static int b44_start_xmit(struct sk_buff *skb, struct net_device *dev)
978 983
979 mapping = pci_map_single(bp->pdev, bounce_skb->data, 984 mapping = pci_map_single(bp->pdev, bounce_skb->data,
980 len, PCI_DMA_TODEVICE); 985 len, PCI_DMA_TODEVICE);
981 if (mapping + len > B44_DMA_MASK) { 986 if (dma_mapping_error(mapping) || mapping + len > B44_DMA_MASK) {
982 pci_unmap_single(bp->pdev, mapping, 987 if (!dma_mapping_error(mapping))
988 pci_unmap_single(bp->pdev, mapping,
983 len, PCI_DMA_TODEVICE); 989 len, PCI_DMA_TODEVICE);
984 dev_kfree_skb_any(bounce_skb); 990 dev_kfree_skb_any(bounce_skb);
985 goto err_out; 991 goto err_out;
@@ -1203,7 +1209,8 @@ static int b44_alloc_consistent(struct b44 *bp)
1203 DMA_TABLE_BYTES, 1209 DMA_TABLE_BYTES,
1204 DMA_BIDIRECTIONAL); 1210 DMA_BIDIRECTIONAL);
1205 1211
1206 if (rx_ring_dma + size > B44_DMA_MASK) { 1212 if (dma_mapping_error(rx_ring_dma) ||
1213 rx_ring_dma + size > B44_DMA_MASK) {
1207 kfree(rx_ring); 1214 kfree(rx_ring);
1208 goto out_err; 1215 goto out_err;
1209 } 1216 }
@@ -1229,7 +1236,8 @@ static int b44_alloc_consistent(struct b44 *bp)
1229 DMA_TABLE_BYTES, 1236 DMA_TABLE_BYTES,
1230 DMA_TO_DEVICE); 1237 DMA_TO_DEVICE);
1231 1238
1232 if (tx_ring_dma + size > B44_DMA_MASK) { 1239 if (dma_mapping_error(tx_ring_dma) ||
1240 tx_ring_dma + size > B44_DMA_MASK) {
1233 kfree(tx_ring); 1241 kfree(tx_ring);
1234 goto out_err; 1242 goto out_err;
1235 } 1243 }
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 5ca99e26660a..54161aef3cac 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -55,8 +55,8 @@
55 55
56#define DRV_MODULE_NAME "bnx2" 56#define DRV_MODULE_NAME "bnx2"
57#define PFX DRV_MODULE_NAME ": " 57#define PFX DRV_MODULE_NAME ": "
58#define DRV_MODULE_VERSION "1.4.39" 58#define DRV_MODULE_VERSION "1.4.40"
59#define DRV_MODULE_RELDATE "March 22, 2006" 59#define DRV_MODULE_RELDATE "May 22, 2006"
60 60
61#define RUN_AT(x) (jiffies + (x)) 61#define RUN_AT(x) (jiffies + (x))
62 62
@@ -2945,7 +2945,7 @@ bnx2_nvram_write(struct bnx2 *bp, u32 offset, u8 *data_buf,
2945 int buf_size) 2945 int buf_size)
2946{ 2946{
2947 u32 written, offset32, len32; 2947 u32 written, offset32, len32;
2948 u8 *buf, start[4], end[4]; 2948 u8 *buf, start[4], end[4], *flash_buffer = NULL;
2949 int rc = 0; 2949 int rc = 0;
2950 int align_start, align_end; 2950 int align_start, align_end;
2951 2951
@@ -2985,12 +2985,19 @@ bnx2_nvram_write(struct bnx2 *bp, u32 offset, u8 *data_buf,
2985 memcpy(buf + align_start, data_buf, buf_size); 2985 memcpy(buf + align_start, data_buf, buf_size);
2986 } 2986 }
2987 2987
2988 if (bp->flash_info->buffered == 0) {
2989 flash_buffer = kmalloc(264, GFP_KERNEL);
2990 if (flash_buffer == NULL) {
2991 rc = -ENOMEM;
2992 goto nvram_write_end;
2993 }
2994 }
2995
2988 written = 0; 2996 written = 0;
2989 while ((written < len32) && (rc == 0)) { 2997 while ((written < len32) && (rc == 0)) {
2990 u32 page_start, page_end, data_start, data_end; 2998 u32 page_start, page_end, data_start, data_end;
2991 u32 addr, cmd_flags; 2999 u32 addr, cmd_flags;
2992 int i; 3000 int i;
2993 u8 flash_buffer[264];
2994 3001
2995 /* Find the page_start addr */ 3002 /* Find the page_start addr */
2996 page_start = offset32 + written; 3003 page_start = offset32 + written;
@@ -3061,7 +3068,7 @@ bnx2_nvram_write(struct bnx2 *bp, u32 offset, u8 *data_buf,
3061 } 3068 }
3062 3069
3063 /* Loop to write the new data from data_start to data_end */ 3070 /* Loop to write the new data from data_start to data_end */
3064 for (addr = data_start; addr < data_end; addr += 4, i++) { 3071 for (addr = data_start; addr < data_end; addr += 4, i += 4) {
3065 if ((addr == page_end - 4) || 3072 if ((addr == page_end - 4) ||
3066 ((bp->flash_info->buffered) && 3073 ((bp->flash_info->buffered) &&
3067 (addr == data_end - 4))) { 3074 (addr == data_end - 4))) {
@@ -3109,6 +3116,9 @@ bnx2_nvram_write(struct bnx2 *bp, u32 offset, u8 *data_buf,
3109 } 3116 }
3110 3117
3111nvram_write_end: 3118nvram_write_end:
3119 if (bp->flash_info->buffered == 0)
3120 kfree(flash_buffer);
3121
3112 if (align_start || align_end) 3122 if (align_start || align_end)
3113 kfree(buf); 3123 kfree(buf);
3114 return rc; 3124 return rc;
diff --git a/drivers/net/dl2k.c b/drivers/net/dl2k.c
index 1f3627470c95..038447fb5c5e 100644
--- a/drivers/net/dl2k.c
+++ b/drivers/net/dl2k.c
@@ -53,6 +53,7 @@
53#define DRV_VERSION "v1.17b" 53#define DRV_VERSION "v1.17b"
54#define DRV_RELDATE "2006/03/10" 54#define DRV_RELDATE "2006/03/10"
55#include "dl2k.h" 55#include "dl2k.h"
56#include <linux/dma-mapping.h>
56 57
57static char version[] __devinitdata = 58static char version[] __devinitdata =
58 KERN_INFO DRV_NAME " " DRV_VERSION " " DRV_RELDATE "\n"; 59 KERN_INFO DRV_NAME " " DRV_VERSION " " DRV_RELDATE "\n";
@@ -765,7 +766,7 @@ rio_free_tx (struct net_device *dev, int irq)
765 break; 766 break;
766 skb = np->tx_skbuff[entry]; 767 skb = np->tx_skbuff[entry];
767 pci_unmap_single (np->pdev, 768 pci_unmap_single (np->pdev,
768 np->tx_ring[entry].fraginfo & 0xffffffffffff, 769 np->tx_ring[entry].fraginfo & DMA_48BIT_MASK,
769 skb->len, PCI_DMA_TODEVICE); 770 skb->len, PCI_DMA_TODEVICE);
770 if (irq) 771 if (irq)
771 dev_kfree_skb_irq (skb); 772 dev_kfree_skb_irq (skb);
@@ -893,7 +894,7 @@ receive_packet (struct net_device *dev)
893 /* Small skbuffs for short packets */ 894 /* Small skbuffs for short packets */
894 if (pkt_len > copy_thresh) { 895 if (pkt_len > copy_thresh) {
895 pci_unmap_single (np->pdev, 896 pci_unmap_single (np->pdev,
896 desc->fraginfo & 0xffffffffffff, 897 desc->fraginfo & DMA_48BIT_MASK,
897 np->rx_buf_sz, 898 np->rx_buf_sz,
898 PCI_DMA_FROMDEVICE); 899 PCI_DMA_FROMDEVICE);
899 skb_put (skb = np->rx_skbuff[entry], pkt_len); 900 skb_put (skb = np->rx_skbuff[entry], pkt_len);
@@ -901,7 +902,7 @@ receive_packet (struct net_device *dev)
901 } else if ((skb = dev_alloc_skb (pkt_len + 2)) != NULL) { 902 } else if ((skb = dev_alloc_skb (pkt_len + 2)) != NULL) {
902 pci_dma_sync_single_for_cpu(np->pdev, 903 pci_dma_sync_single_for_cpu(np->pdev,
903 desc->fraginfo & 904 desc->fraginfo &
904 0xffffffffffff, 905 DMA_48BIT_MASK,
905 np->rx_buf_sz, 906 np->rx_buf_sz,
906 PCI_DMA_FROMDEVICE); 907 PCI_DMA_FROMDEVICE);
907 skb->dev = dev; 908 skb->dev = dev;
@@ -913,7 +914,7 @@ receive_packet (struct net_device *dev)
913 skb_put (skb, pkt_len); 914 skb_put (skb, pkt_len);
914 pci_dma_sync_single_for_device(np->pdev, 915 pci_dma_sync_single_for_device(np->pdev,
915 desc->fraginfo & 916 desc->fraginfo &
916 0xffffffffffff, 917 DMA_48BIT_MASK,
917 np->rx_buf_sz, 918 np->rx_buf_sz,
918 PCI_DMA_FROMDEVICE); 919 PCI_DMA_FROMDEVICE);
919 } 920 }
@@ -1800,7 +1801,7 @@ rio_close (struct net_device *dev)
1800 skb = np->rx_skbuff[i]; 1801 skb = np->rx_skbuff[i];
1801 if (skb) { 1802 if (skb) {
1802 pci_unmap_single(np->pdev, 1803 pci_unmap_single(np->pdev,
1803 np->rx_ring[i].fraginfo & 0xffffffffffff, 1804 np->rx_ring[i].fraginfo & DMA_48BIT_MASK,
1804 skb->len, PCI_DMA_FROMDEVICE); 1805 skb->len, PCI_DMA_FROMDEVICE);
1805 dev_kfree_skb (skb); 1806 dev_kfree_skb (skb);
1806 np->rx_skbuff[i] = NULL; 1807 np->rx_skbuff[i] = NULL;
@@ -1810,7 +1811,7 @@ rio_close (struct net_device *dev)
1810 skb = np->tx_skbuff[i]; 1811 skb = np->tx_skbuff[i];
1811 if (skb) { 1812 if (skb) {
1812 pci_unmap_single(np->pdev, 1813 pci_unmap_single(np->pdev,
1813 np->tx_ring[i].fraginfo & 0xffffffffffff, 1814 np->tx_ring[i].fraginfo & DMA_48BIT_MASK,
1814 skb->len, PCI_DMA_TODEVICE); 1815 skb->len, PCI_DMA_TODEVICE);
1815 dev_kfree_skb (skb); 1816 dev_kfree_skb (skb);
1816 np->tx_skbuff[i] = NULL; 1817 np->tx_skbuff[i] = NULL;
diff --git a/drivers/net/e1000/e1000_ethtool.c b/drivers/net/e1000/e1000_ethtool.c
index ecccca35c6f4..d1c705b412c2 100644
--- a/drivers/net/e1000/e1000_ethtool.c
+++ b/drivers/net/e1000/e1000_ethtool.c
@@ -870,13 +870,16 @@ e1000_intr_test(struct e1000_adapter *adapter, uint64_t *data)
870 *data = 0; 870 *data = 0;
871 871
872 /* Hook up test interrupt handler just for this test */ 872 /* Hook up test interrupt handler just for this test */
873 if (!request_irq(irq, &e1000_test_intr, 0, netdev->name, netdev)) { 873 if (!request_irq(irq, &e1000_test_intr, SA_PROBEIRQ, netdev->name,
874 netdev)) {
874 shared_int = FALSE; 875 shared_int = FALSE;
875 } else if (request_irq(irq, &e1000_test_intr, SA_SHIRQ, 876 } else if (request_irq(irq, &e1000_test_intr, SA_SHIRQ,
876 netdev->name, netdev)){ 877 netdev->name, netdev)){
877 *data = 1; 878 *data = 1;
878 return -1; 879 return -1;
879 } 880 }
881 DPRINTK(PROBE,INFO, "testing %s interrupt\n",
882 (shared_int ? "shared" : "unshared"));
880 883
881 /* Disable all the interrupts */ 884 /* Disable all the interrupts */
882 E1000_WRITE_REG(&adapter->hw, IMC, 0xFFFFFFFF); 885 E1000_WRITE_REG(&adapter->hw, IMC, 0xFFFFFFFF);
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index add8dc4aa7b0..97e71a4fe8eb 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -220,6 +220,7 @@ static void e1000_restore_vlan(struct e1000_adapter *adapter);
220static int e1000_suspend(struct pci_dev *pdev, pm_message_t state); 220static int e1000_suspend(struct pci_dev *pdev, pm_message_t state);
221static int e1000_resume(struct pci_dev *pdev); 221static int e1000_resume(struct pci_dev *pdev);
222#endif 222#endif
223static void e1000_shutdown(struct pci_dev *pdev);
223 224
224#ifdef CONFIG_NET_POLL_CONTROLLER 225#ifdef CONFIG_NET_POLL_CONTROLLER
225/* for netdump / net console */ 226/* for netdump / net console */
@@ -235,8 +236,9 @@ static struct pci_driver e1000_driver = {
235 /* Power Managment Hooks */ 236 /* Power Managment Hooks */
236#ifdef CONFIG_PM 237#ifdef CONFIG_PM
237 .suspend = e1000_suspend, 238 .suspend = e1000_suspend,
238 .resume = e1000_resume 239 .resume = e1000_resume,
239#endif 240#endif
241 .shutdown = e1000_shutdown
240}; 242};
241 243
242MODULE_AUTHOR("Intel Corporation, <linux.nics@intel.com>"); 244MODULE_AUTHOR("Intel Corporation, <linux.nics@intel.com>");
@@ -3517,7 +3519,7 @@ e1000_clean_rx_irq(struct e1000_adapter *adapter,
3517 buffer_info = &rx_ring->buffer_info[i]; 3519 buffer_info = &rx_ring->buffer_info[i];
3518 3520
3519 while (rx_desc->status & E1000_RXD_STAT_DD) { 3521 while (rx_desc->status & E1000_RXD_STAT_DD) {
3520 struct sk_buff *skb, *next_skb; 3522 struct sk_buff *skb;
3521 u8 status; 3523 u8 status;
3522#ifdef CONFIG_E1000_NAPI 3524#ifdef CONFIG_E1000_NAPI
3523 if (*work_done >= work_to_do) 3525 if (*work_done >= work_to_do)
@@ -3535,8 +3537,6 @@ e1000_clean_rx_irq(struct e1000_adapter *adapter,
3535 prefetch(next_rxd); 3537 prefetch(next_rxd);
3536 3538
3537 next_buffer = &rx_ring->buffer_info[i]; 3539 next_buffer = &rx_ring->buffer_info[i];
3538 next_skb = next_buffer->skb;
3539 prefetch(next_skb->data - NET_IP_ALIGN);
3540 3540
3541 cleaned = TRUE; 3541 cleaned = TRUE;
3542 cleaned_count++; 3542 cleaned_count++;
@@ -3666,7 +3666,7 @@ e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
3666 struct e1000_buffer *buffer_info, *next_buffer; 3666 struct e1000_buffer *buffer_info, *next_buffer;
3667 struct e1000_ps_page *ps_page; 3667 struct e1000_ps_page *ps_page;
3668 struct e1000_ps_page_dma *ps_page_dma; 3668 struct e1000_ps_page_dma *ps_page_dma;
3669 struct sk_buff *skb, *next_skb; 3669 struct sk_buff *skb;
3670 unsigned int i, j; 3670 unsigned int i, j;
3671 uint32_t length, staterr; 3671 uint32_t length, staterr;
3672 int cleaned_count = 0; 3672 int cleaned_count = 0;
@@ -3695,8 +3695,6 @@ e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
3695 prefetch(next_rxd); 3695 prefetch(next_rxd);
3696 3696
3697 next_buffer = &rx_ring->buffer_info[i]; 3697 next_buffer = &rx_ring->buffer_info[i];
3698 next_skb = next_buffer->skb;
3699 prefetch(next_skb->data - NET_IP_ALIGN);
3700 3698
3701 cleaned = TRUE; 3699 cleaned = TRUE;
3702 cleaned_count++; 3700 cleaned_count++;
@@ -3768,6 +3766,7 @@ e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
3768 ps_page->ps_page[j] = NULL; 3766 ps_page->ps_page[j] = NULL;
3769 skb->len += length; 3767 skb->len += length;
3770 skb->data_len += length; 3768 skb->data_len += length;
3769 skb->truesize += length;
3771 } 3770 }
3772 3771
3773copydone: 3772copydone:
@@ -4610,6 +4609,12 @@ e1000_resume(struct pci_dev *pdev)
4610 return 0; 4609 return 0;
4611} 4610}
4612#endif 4611#endif
4612
4613static void e1000_shutdown(struct pci_dev *pdev)
4614{
4615 e1000_suspend(pdev, PMSG_SUSPEND);
4616}
4617
4613#ifdef CONFIG_NET_POLL_CONTROLLER 4618#ifdef CONFIG_NET_POLL_CONTROLLER
4614/* 4619/*
4615 * Polling 'interrupt' - used by things like netconsole to send skbs 4620 * Polling 'interrupt' - used by things like netconsole to send skbs
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index 7627a75f4f7c..feb5b223cd60 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -105,6 +105,8 @@
105 * 0.50: 20 Jan 2006: Add 8021pq tagging support. 105 * 0.50: 20 Jan 2006: Add 8021pq tagging support.
106 * 0.51: 20 Jan 2006: Add 64bit consistent memory allocation for rings. 106 * 0.51: 20 Jan 2006: Add 64bit consistent memory allocation for rings.
107 * 0.52: 20 Jan 2006: Add MSI/MSIX support. 107 * 0.52: 20 Jan 2006: Add MSI/MSIX support.
108 * 0.53: 19 Mar 2006: Fix init from low power mode and add hw reset.
109 * 0.54: 21 Mar 2006: Fix spin locks for multi irqs and cleanup.
108 * 110 *
109 * Known bugs: 111 * Known bugs:
110 * We suspect that on some hardware no TX done interrupts are generated. 112 * We suspect that on some hardware no TX done interrupts are generated.
@@ -116,7 +118,7 @@
116 * DEV_NEED_TIMERIRQ will not harm you on sane hardware, only generating a few 118 * DEV_NEED_TIMERIRQ will not harm you on sane hardware, only generating a few
117 * superfluous timer interrupts from the nic. 119 * superfluous timer interrupts from the nic.
118 */ 120 */
119#define FORCEDETH_VERSION "0.52" 121#define FORCEDETH_VERSION "0.54"
120#define DRV_NAME "forcedeth" 122#define DRV_NAME "forcedeth"
121 123
122#include <linux/module.h> 124#include <linux/module.h>
@@ -160,6 +162,7 @@
160#define DEV_HAS_VLAN 0x0020 /* device supports vlan tagging and striping */ 162#define DEV_HAS_VLAN 0x0020 /* device supports vlan tagging and striping */
161#define DEV_HAS_MSI 0x0040 /* device supports MSI */ 163#define DEV_HAS_MSI 0x0040 /* device supports MSI */
162#define DEV_HAS_MSI_X 0x0080 /* device supports MSI-X */ 164#define DEV_HAS_MSI_X 0x0080 /* device supports MSI-X */
165#define DEV_HAS_POWER_CNTRL 0x0100 /* device supports power savings */
163 166
164enum { 167enum {
165 NvRegIrqStatus = 0x000, 168 NvRegIrqStatus = 0x000,
@@ -203,6 +206,8 @@ enum {
203#define NVREG_MISC1_HD 0x02 206#define NVREG_MISC1_HD 0x02
204#define NVREG_MISC1_FORCE 0x3b0f3c 207#define NVREG_MISC1_FORCE 0x3b0f3c
205 208
209 NvRegMacReset = 0x3c,
210#define NVREG_MAC_RESET_ASSERT 0x0F3
206 NvRegTransmitterControl = 0x084, 211 NvRegTransmitterControl = 0x084,
207#define NVREG_XMITCTL_START 0x01 212#define NVREG_XMITCTL_START 0x01
208 NvRegTransmitterStatus = 0x088, 213 NvRegTransmitterStatus = 0x088,
@@ -326,6 +331,10 @@ enum {
326 NvRegMSIXMap0 = 0x3e0, 331 NvRegMSIXMap0 = 0x3e0,
327 NvRegMSIXMap1 = 0x3e4, 332 NvRegMSIXMap1 = 0x3e4,
328 NvRegMSIXIrqStatus = 0x3f0, 333 NvRegMSIXIrqStatus = 0x3f0,
334
335 NvRegPowerState2 = 0x600,
336#define NVREG_POWERSTATE2_POWERUP_MASK 0x0F11
337#define NVREG_POWERSTATE2_POWERUP_REV_A3 0x0001
329}; 338};
330 339
331/* Big endian: should work, but is untested */ 340/* Big endian: should work, but is untested */
@@ -414,7 +423,8 @@ typedef union _ring_type {
414#define NV_RX3_VLAN_TAG_MASK (0x0000FFFF) 423#define NV_RX3_VLAN_TAG_MASK (0x0000FFFF)
415 424
416/* Miscelaneous hardware related defines: */ 425/* Miscelaneous hardware related defines: */
417#define NV_PCI_REGSZ 0x270 426#define NV_PCI_REGSZ_VER1 0x270
427#define NV_PCI_REGSZ_VER2 0x604
418 428
419/* various timeout delays: all in usec */ 429/* various timeout delays: all in usec */
420#define NV_TXRX_RESET_DELAY 4 430#define NV_TXRX_RESET_DELAY 4
@@ -431,6 +441,7 @@ typedef union _ring_type {
431#define NV_MIIBUSY_DELAY 50 441#define NV_MIIBUSY_DELAY 50
432#define NV_MIIPHY_DELAY 10 442#define NV_MIIPHY_DELAY 10
433#define NV_MIIPHY_DELAYMAX 10000 443#define NV_MIIPHY_DELAYMAX 10000
444#define NV_MAC_RESET_DELAY 64
434 445
435#define NV_WAKEUPPATTERNS 5 446#define NV_WAKEUPPATTERNS 5
436#define NV_WAKEUPMASKENTRIES 4 447#define NV_WAKEUPMASKENTRIES 4
@@ -552,6 +563,8 @@ struct fe_priv {
552 u32 desc_ver; 563 u32 desc_ver;
553 u32 txrxctl_bits; 564 u32 txrxctl_bits;
554 u32 vlanctl_bits; 565 u32 vlanctl_bits;
566 u32 driver_data;
567 u32 register_size;
555 568
556 void __iomem *base; 569 void __iomem *base;
557 570
@@ -698,6 +711,72 @@ static void setup_hw_rings(struct net_device *dev, int rxtx_flags)
698 } 711 }
699} 712}
700 713
714static int using_multi_irqs(struct net_device *dev)
715{
716 struct fe_priv *np = get_nvpriv(dev);
717
718 if (!(np->msi_flags & NV_MSI_X_ENABLED) ||
719 ((np->msi_flags & NV_MSI_X_ENABLED) &&
720 ((np->msi_flags & NV_MSI_X_VECTORS_MASK) == 0x1)))
721 return 0;
722 else
723 return 1;
724}
725
726static void nv_enable_irq(struct net_device *dev)
727{
728 struct fe_priv *np = get_nvpriv(dev);
729
730 if (!using_multi_irqs(dev)) {
731 if (np->msi_flags & NV_MSI_X_ENABLED)
732 enable_irq(np->msi_x_entry[NV_MSI_X_VECTOR_ALL].vector);
733 else
734 enable_irq(dev->irq);
735 } else {
736 enable_irq(np->msi_x_entry[NV_MSI_X_VECTOR_RX].vector);
737 enable_irq(np->msi_x_entry[NV_MSI_X_VECTOR_TX].vector);
738 enable_irq(np->msi_x_entry[NV_MSI_X_VECTOR_OTHER].vector);
739 }
740}
741
742static void nv_disable_irq(struct net_device *dev)
743{
744 struct fe_priv *np = get_nvpriv(dev);
745
746 if (!using_multi_irqs(dev)) {
747 if (np->msi_flags & NV_MSI_X_ENABLED)
748 disable_irq(np->msi_x_entry[NV_MSI_X_VECTOR_ALL].vector);
749 else
750 disable_irq(dev->irq);
751 } else {
752 disable_irq(np->msi_x_entry[NV_MSI_X_VECTOR_RX].vector);
753 disable_irq(np->msi_x_entry[NV_MSI_X_VECTOR_TX].vector);
754 disable_irq(np->msi_x_entry[NV_MSI_X_VECTOR_OTHER].vector);
755 }
756}
757
758/* In MSIX mode, a write to irqmask behaves as XOR */
759static void nv_enable_hw_interrupts(struct net_device *dev, u32 mask)
760{
761 u8 __iomem *base = get_hwbase(dev);
762
763 writel(mask, base + NvRegIrqMask);
764}
765
766static void nv_disable_hw_interrupts(struct net_device *dev, u32 mask)
767{
768 struct fe_priv *np = get_nvpriv(dev);
769 u8 __iomem *base = get_hwbase(dev);
770
771 if (np->msi_flags & NV_MSI_X_ENABLED) {
772 writel(mask, base + NvRegIrqMask);
773 } else {
774 if (np->msi_flags & NV_MSI_ENABLED)
775 writel(0, base + NvRegMSIIrqMask);
776 writel(0, base + NvRegIrqMask);
777 }
778}
779
701#define MII_READ (-1) 780#define MII_READ (-1)
702/* mii_rw: read/write a register on the PHY. 781/* mii_rw: read/write a register on the PHY.
703 * 782 *
@@ -919,6 +998,24 @@ static void nv_txrx_reset(struct net_device *dev)
919 pci_push(base); 998 pci_push(base);
920} 999}
921 1000
1001static void nv_mac_reset(struct net_device *dev)
1002{
1003 struct fe_priv *np = netdev_priv(dev);
1004 u8 __iomem *base = get_hwbase(dev);
1005
1006 dprintk(KERN_DEBUG "%s: nv_mac_reset\n", dev->name);
1007 writel(NVREG_TXRXCTL_BIT2 | NVREG_TXRXCTL_RESET | np->txrxctl_bits, base + NvRegTxRxControl);
1008 pci_push(base);
1009 writel(NVREG_MAC_RESET_ASSERT, base + NvRegMacReset);
1010 pci_push(base);
1011 udelay(NV_MAC_RESET_DELAY);
1012 writel(0, base + NvRegMacReset);
1013 pci_push(base);
1014 udelay(NV_MAC_RESET_DELAY);
1015 writel(NVREG_TXRXCTL_BIT2 | np->txrxctl_bits, base + NvRegTxRxControl);
1016 pci_push(base);
1017}
1018
922/* 1019/*
923 * nv_get_stats: dev->get_stats function 1020 * nv_get_stats: dev->get_stats function
924 * Get latest stats value from the nic. 1021 * Get latest stats value from the nic.
@@ -989,24 +1086,25 @@ static void nv_do_rx_refill(unsigned long data)
989 struct net_device *dev = (struct net_device *) data; 1086 struct net_device *dev = (struct net_device *) data;
990 struct fe_priv *np = netdev_priv(dev); 1087 struct fe_priv *np = netdev_priv(dev);
991 1088
992 1089 if (!using_multi_irqs(dev)) {
993 if (!(np->msi_flags & NV_MSI_X_ENABLED) || 1090 if (np->msi_flags & NV_MSI_X_ENABLED)
994 ((np->msi_flags & NV_MSI_X_ENABLED) && 1091 disable_irq(np->msi_x_entry[NV_MSI_X_VECTOR_ALL].vector);
995 ((np->msi_flags & NV_MSI_X_VECTORS_MASK) == 0x1))) { 1092 else
996 disable_irq(dev->irq); 1093 disable_irq(dev->irq);
997 } else { 1094 } else {
998 disable_irq(np->msi_x_entry[NV_MSI_X_VECTOR_RX].vector); 1095 disable_irq(np->msi_x_entry[NV_MSI_X_VECTOR_RX].vector);
999 } 1096 }
1000 if (nv_alloc_rx(dev)) { 1097 if (nv_alloc_rx(dev)) {
1001 spin_lock(&np->lock); 1098 spin_lock_irq(&np->lock);
1002 if (!np->in_shutdown) 1099 if (!np->in_shutdown)
1003 mod_timer(&np->oom_kick, jiffies + OOM_REFILL); 1100 mod_timer(&np->oom_kick, jiffies + OOM_REFILL);
1004 spin_unlock(&np->lock); 1101 spin_unlock_irq(&np->lock);
1005 } 1102 }
1006 if (!(np->msi_flags & NV_MSI_X_ENABLED) || 1103 if (!using_multi_irqs(dev)) {
1007 ((np->msi_flags & NV_MSI_X_ENABLED) && 1104 if (np->msi_flags & NV_MSI_X_ENABLED)
1008 ((np->msi_flags & NV_MSI_X_VECTORS_MASK) == 0x1))) { 1105 enable_irq(np->msi_x_entry[NV_MSI_X_VECTOR_ALL].vector);
1009 enable_irq(dev->irq); 1106 else
1107 enable_irq(dev->irq);
1010 } else { 1108 } else {
1011 enable_irq(np->msi_x_entry[NV_MSI_X_VECTOR_RX].vector); 1109 enable_irq(np->msi_x_entry[NV_MSI_X_VECTOR_RX].vector);
1012 } 1110 }
@@ -1331,7 +1429,7 @@ static void nv_tx_timeout(struct net_device *dev)
1331 dev->name, (unsigned long)np->ring_addr, 1429 dev->name, (unsigned long)np->ring_addr,
1332 np->next_tx, np->nic_tx); 1430 np->next_tx, np->nic_tx);
1333 printk(KERN_INFO "%s: Dumping tx registers\n", dev->name); 1431 printk(KERN_INFO "%s: Dumping tx registers\n", dev->name);
1334 for (i=0;i<0x400;i+= 32) { 1432 for (i=0;i<=np->register_size;i+= 32) {
1335 printk(KERN_INFO "%3x: %08x %08x %08x %08x %08x %08x %08x %08x\n", 1433 printk(KERN_INFO "%3x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
1336 i, 1434 i,
1337 readl(base + i + 0), readl(base + i + 4), 1435 readl(base + i + 0), readl(base + i + 4),
@@ -1638,15 +1736,7 @@ static int nv_change_mtu(struct net_device *dev, int new_mtu)
1638 * guessed, there is probably a simpler approach. 1736 * guessed, there is probably a simpler approach.
1639 * Changing the MTU is a rare event, it shouldn't matter. 1737 * Changing the MTU is a rare event, it shouldn't matter.
1640 */ 1738 */
1641 if (!(np->msi_flags & NV_MSI_X_ENABLED) || 1739 nv_disable_irq(dev);
1642 ((np->msi_flags & NV_MSI_X_ENABLED) &&
1643 ((np->msi_flags & NV_MSI_X_VECTORS_MASK) == 0x1))) {
1644 disable_irq(dev->irq);
1645 } else {
1646 disable_irq(np->msi_x_entry[NV_MSI_X_VECTOR_RX].vector);
1647 disable_irq(np->msi_x_entry[NV_MSI_X_VECTOR_TX].vector);
1648 disable_irq(np->msi_x_entry[NV_MSI_X_VECTOR_OTHER].vector);
1649 }
1650 spin_lock_bh(&dev->xmit_lock); 1740 spin_lock_bh(&dev->xmit_lock);
1651 spin_lock(&np->lock); 1741 spin_lock(&np->lock);
1652 /* stop engines */ 1742 /* stop engines */
@@ -1679,15 +1769,7 @@ static int nv_change_mtu(struct net_device *dev, int new_mtu)
1679 nv_start_tx(dev); 1769 nv_start_tx(dev);
1680 spin_unlock(&np->lock); 1770 spin_unlock(&np->lock);
1681 spin_unlock_bh(&dev->xmit_lock); 1771 spin_unlock_bh(&dev->xmit_lock);
1682 if (!(np->msi_flags & NV_MSI_X_ENABLED) || 1772 nv_enable_irq(dev);
1683 ((np->msi_flags & NV_MSI_X_ENABLED) &&
1684 ((np->msi_flags & NV_MSI_X_VECTORS_MASK) == 0x1))) {
1685 enable_irq(dev->irq);
1686 } else {
1687 enable_irq(np->msi_x_entry[NV_MSI_X_VECTOR_RX].vector);
1688 enable_irq(np->msi_x_entry[NV_MSI_X_VECTOR_TX].vector);
1689 enable_irq(np->msi_x_entry[NV_MSI_X_VECTOR_OTHER].vector);
1690 }
1691 } 1773 }
1692 return 0; 1774 return 0;
1693} 1775}
@@ -2078,16 +2160,16 @@ static irqreturn_t nv_nic_irq_tx(int foo, void *data, struct pt_regs *regs)
2078 if (!(events & np->irqmask)) 2160 if (!(events & np->irqmask))
2079 break; 2161 break;
2080 2162
2081 spin_lock(&np->lock); 2163 spin_lock_irq(&np->lock);
2082 nv_tx_done(dev); 2164 nv_tx_done(dev);
2083 spin_unlock(&np->lock); 2165 spin_unlock_irq(&np->lock);
2084 2166
2085 if (events & (NVREG_IRQ_TX_ERR)) { 2167 if (events & (NVREG_IRQ_TX_ERR)) {
2086 dprintk(KERN_DEBUG "%s: received irq with events 0x%x. Probably TX fail.\n", 2168 dprintk(KERN_DEBUG "%s: received irq with events 0x%x. Probably TX fail.\n",
2087 dev->name, events); 2169 dev->name, events);
2088 } 2170 }
2089 if (i > max_interrupt_work) { 2171 if (i > max_interrupt_work) {
2090 spin_lock(&np->lock); 2172 spin_lock_irq(&np->lock);
2091 /* disable interrupts on the nic */ 2173 /* disable interrupts on the nic */
2092 writel(NVREG_IRQ_TX_ALL, base + NvRegIrqMask); 2174 writel(NVREG_IRQ_TX_ALL, base + NvRegIrqMask);
2093 pci_push(base); 2175 pci_push(base);
@@ -2097,7 +2179,7 @@ static irqreturn_t nv_nic_irq_tx(int foo, void *data, struct pt_regs *regs)
2097 mod_timer(&np->nic_poll, jiffies + POLL_WAIT); 2179 mod_timer(&np->nic_poll, jiffies + POLL_WAIT);
2098 } 2180 }
2099 printk(KERN_DEBUG "%s: too many iterations (%d) in nv_nic_irq_tx.\n", dev->name, i); 2181 printk(KERN_DEBUG "%s: too many iterations (%d) in nv_nic_irq_tx.\n", dev->name, i);
2100 spin_unlock(&np->lock); 2182 spin_unlock_irq(&np->lock);
2101 break; 2183 break;
2102 } 2184 }
2103 2185
@@ -2127,14 +2209,14 @@ static irqreturn_t nv_nic_irq_rx(int foo, void *data, struct pt_regs *regs)
2127 2209
2128 nv_rx_process(dev); 2210 nv_rx_process(dev);
2129 if (nv_alloc_rx(dev)) { 2211 if (nv_alloc_rx(dev)) {
2130 spin_lock(&np->lock); 2212 spin_lock_irq(&np->lock);
2131 if (!np->in_shutdown) 2213 if (!np->in_shutdown)
2132 mod_timer(&np->oom_kick, jiffies + OOM_REFILL); 2214 mod_timer(&np->oom_kick, jiffies + OOM_REFILL);
2133 spin_unlock(&np->lock); 2215 spin_unlock_irq(&np->lock);
2134 } 2216 }
2135 2217
2136 if (i > max_interrupt_work) { 2218 if (i > max_interrupt_work) {
2137 spin_lock(&np->lock); 2219 spin_lock_irq(&np->lock);
2138 /* disable interrupts on the nic */ 2220 /* disable interrupts on the nic */
2139 writel(NVREG_IRQ_RX_ALL, base + NvRegIrqMask); 2221 writel(NVREG_IRQ_RX_ALL, base + NvRegIrqMask);
2140 pci_push(base); 2222 pci_push(base);
@@ -2144,7 +2226,7 @@ static irqreturn_t nv_nic_irq_rx(int foo, void *data, struct pt_regs *regs)
2144 mod_timer(&np->nic_poll, jiffies + POLL_WAIT); 2226 mod_timer(&np->nic_poll, jiffies + POLL_WAIT);
2145 } 2227 }
2146 printk(KERN_DEBUG "%s: too many iterations (%d) in nv_nic_irq_rx.\n", dev->name, i); 2228 printk(KERN_DEBUG "%s: too many iterations (%d) in nv_nic_irq_rx.\n", dev->name, i);
2147 spin_unlock(&np->lock); 2229 spin_unlock_irq(&np->lock);
2148 break; 2230 break;
2149 } 2231 }
2150 2232
@@ -2173,14 +2255,14 @@ static irqreturn_t nv_nic_irq_other(int foo, void *data, struct pt_regs *regs)
2173 break; 2255 break;
2174 2256
2175 if (events & NVREG_IRQ_LINK) { 2257 if (events & NVREG_IRQ_LINK) {
2176 spin_lock(&np->lock); 2258 spin_lock_irq(&np->lock);
2177 nv_link_irq(dev); 2259 nv_link_irq(dev);
2178 spin_unlock(&np->lock); 2260 spin_unlock_irq(&np->lock);
2179 } 2261 }
2180 if (np->need_linktimer && time_after(jiffies, np->link_timeout)) { 2262 if (np->need_linktimer && time_after(jiffies, np->link_timeout)) {
2181 spin_lock(&np->lock); 2263 spin_lock_irq(&np->lock);
2182 nv_linkchange(dev); 2264 nv_linkchange(dev);
2183 spin_unlock(&np->lock); 2265 spin_unlock_irq(&np->lock);
2184 np->link_timeout = jiffies + LINK_TIMEOUT; 2266 np->link_timeout = jiffies + LINK_TIMEOUT;
2185 } 2267 }
2186 if (events & (NVREG_IRQ_UNKNOWN)) { 2268 if (events & (NVREG_IRQ_UNKNOWN)) {
@@ -2188,7 +2270,7 @@ static irqreturn_t nv_nic_irq_other(int foo, void *data, struct pt_regs *regs)
2188 dev->name, events); 2270 dev->name, events);
2189 } 2271 }
2190 if (i > max_interrupt_work) { 2272 if (i > max_interrupt_work) {
2191 spin_lock(&np->lock); 2273 spin_lock_irq(&np->lock);
2192 /* disable interrupts on the nic */ 2274 /* disable interrupts on the nic */
2193 writel(NVREG_IRQ_OTHER, base + NvRegIrqMask); 2275 writel(NVREG_IRQ_OTHER, base + NvRegIrqMask);
2194 pci_push(base); 2276 pci_push(base);
@@ -2198,7 +2280,7 @@ static irqreturn_t nv_nic_irq_other(int foo, void *data, struct pt_regs *regs)
2198 mod_timer(&np->nic_poll, jiffies + POLL_WAIT); 2280 mod_timer(&np->nic_poll, jiffies + POLL_WAIT);
2199 } 2281 }
2200 printk(KERN_DEBUG "%s: too many iterations (%d) in nv_nic_irq_other.\n", dev->name, i); 2282 printk(KERN_DEBUG "%s: too many iterations (%d) in nv_nic_irq_other.\n", dev->name, i);
2201 spin_unlock(&np->lock); 2283 spin_unlock_irq(&np->lock);
2202 break; 2284 break;
2203 } 2285 }
2204 2286
@@ -2221,10 +2303,11 @@ static void nv_do_nic_poll(unsigned long data)
2221 * nv_nic_irq because that may decide to do otherwise 2303 * nv_nic_irq because that may decide to do otherwise
2222 */ 2304 */
2223 2305
2224 if (!(np->msi_flags & NV_MSI_X_ENABLED) || 2306 if (!using_multi_irqs(dev)) {
2225 ((np->msi_flags & NV_MSI_X_ENABLED) && 2307 if (np->msi_flags & NV_MSI_X_ENABLED)
2226 ((np->msi_flags & NV_MSI_X_VECTORS_MASK) == 0x1))) { 2308 disable_irq(np->msi_x_entry[NV_MSI_X_VECTOR_ALL].vector);
2227 disable_irq(dev->irq); 2309 else
2310 disable_irq(dev->irq);
2228 mask = np->irqmask; 2311 mask = np->irqmask;
2229 } else { 2312 } else {
2230 if (np->nic_poll_irq & NVREG_IRQ_RX_ALL) { 2313 if (np->nic_poll_irq & NVREG_IRQ_RX_ALL) {
@@ -2247,11 +2330,12 @@ static void nv_do_nic_poll(unsigned long data)
2247 writel(mask, base + NvRegIrqMask); 2330 writel(mask, base + NvRegIrqMask);
2248 pci_push(base); 2331 pci_push(base);
2249 2332
2250 if (!(np->msi_flags & NV_MSI_X_ENABLED) || 2333 if (!using_multi_irqs(dev)) {
2251 ((np->msi_flags & NV_MSI_X_ENABLED) &&
2252 ((np->msi_flags & NV_MSI_X_VECTORS_MASK) == 0x1))) {
2253 nv_nic_irq((int) 0, (void *) data, (struct pt_regs *) NULL); 2334 nv_nic_irq((int) 0, (void *) data, (struct pt_regs *) NULL);
2254 enable_irq(dev->irq); 2335 if (np->msi_flags & NV_MSI_X_ENABLED)
2336 enable_irq(np->msi_x_entry[NV_MSI_X_VECTOR_ALL].vector);
2337 else
2338 enable_irq(dev->irq);
2255 } else { 2339 } else {
2256 if (np->nic_poll_irq & NVREG_IRQ_RX_ALL) { 2340 if (np->nic_poll_irq & NVREG_IRQ_RX_ALL) {
2257 nv_nic_irq_rx((int) 0, (void *) data, (struct pt_regs *) NULL); 2341 nv_nic_irq_rx((int) 0, (void *) data, (struct pt_regs *) NULL);
@@ -2488,11 +2572,11 @@ static int nv_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
2488} 2572}
2489 2573
2490#define FORCEDETH_REGS_VER 1 2574#define FORCEDETH_REGS_VER 1
2491#define FORCEDETH_REGS_SIZE 0x400 /* 256 32-bit registers */
2492 2575
2493static int nv_get_regs_len(struct net_device *dev) 2576static int nv_get_regs_len(struct net_device *dev)
2494{ 2577{
2495 return FORCEDETH_REGS_SIZE; 2578 struct fe_priv *np = netdev_priv(dev);
2579 return np->register_size;
2496} 2580}
2497 2581
2498static void nv_get_regs(struct net_device *dev, struct ethtool_regs *regs, void *buf) 2582static void nv_get_regs(struct net_device *dev, struct ethtool_regs *regs, void *buf)
@@ -2504,7 +2588,7 @@ static void nv_get_regs(struct net_device *dev, struct ethtool_regs *regs, void
2504 2588
2505 regs->version = FORCEDETH_REGS_VER; 2589 regs->version = FORCEDETH_REGS_VER;
2506 spin_lock_irq(&np->lock); 2590 spin_lock_irq(&np->lock);
2507 for (i=0;i<FORCEDETH_REGS_SIZE/sizeof(u32);i++) 2591 for (i = 0;i <= np->register_size/sizeof(u32); i++)
2508 rbuf[i] = readl(base + i*sizeof(u32)); 2592 rbuf[i] = readl(base + i*sizeof(u32));
2509 spin_unlock_irq(&np->lock); 2593 spin_unlock_irq(&np->lock);
2510} 2594}
@@ -2531,6 +2615,18 @@ static int nv_nway_reset(struct net_device *dev)
2531 return ret; 2615 return ret;
2532} 2616}
2533 2617
2618#ifdef NETIF_F_TSO
2619static int nv_set_tso(struct net_device *dev, u32 value)
2620{
2621 struct fe_priv *np = netdev_priv(dev);
2622
2623 if ((np->driver_data & DEV_HAS_CHECKSUM))
2624 return ethtool_op_set_tso(dev, value);
2625 else
2626 return value ? -EOPNOTSUPP : 0;
2627}
2628#endif
2629
2534static struct ethtool_ops ops = { 2630static struct ethtool_ops ops = {
2535 .get_drvinfo = nv_get_drvinfo, 2631 .get_drvinfo = nv_get_drvinfo,
2536 .get_link = ethtool_op_get_link, 2632 .get_link = ethtool_op_get_link,
@@ -2542,6 +2638,10 @@ static struct ethtool_ops ops = {
2542 .get_regs = nv_get_regs, 2638 .get_regs = nv_get_regs,
2543 .nway_reset = nv_nway_reset, 2639 .nway_reset = nv_nway_reset,
2544 .get_perm_addr = ethtool_op_get_perm_addr, 2640 .get_perm_addr = ethtool_op_get_perm_addr,
2641#ifdef NETIF_F_TSO
2642 .get_tso = ethtool_op_get_tso,
2643 .set_tso = nv_set_tso
2644#endif
2545}; 2645};
2546 2646
2547static void nv_vlan_rx_register(struct net_device *dev, struct vlan_group *grp) 2647static void nv_vlan_rx_register(struct net_device *dev, struct vlan_group *grp)
@@ -2598,6 +2698,113 @@ static void set_msix_vector_map(struct net_device *dev, u32 vector, u32 irqmask)
2598 writel(readl(base + NvRegMSIXMap1) | msixmap, base + NvRegMSIXMap1); 2698 writel(readl(base + NvRegMSIXMap1) | msixmap, base + NvRegMSIXMap1);
2599} 2699}
2600 2700
2701static int nv_request_irq(struct net_device *dev)
2702{
2703 struct fe_priv *np = get_nvpriv(dev);
2704 u8 __iomem *base = get_hwbase(dev);
2705 int ret = 1;
2706 int i;
2707
2708 if (np->msi_flags & NV_MSI_X_CAPABLE) {
2709 for (i = 0; i < (np->msi_flags & NV_MSI_X_VECTORS_MASK); i++) {
2710 np->msi_x_entry[i].entry = i;
2711 }
2712 if ((ret = pci_enable_msix(np->pci_dev, np->msi_x_entry, (np->msi_flags & NV_MSI_X_VECTORS_MASK))) == 0) {
2713 np->msi_flags |= NV_MSI_X_ENABLED;
2714 if (optimization_mode == NV_OPTIMIZATION_MODE_THROUGHPUT) {
2715 /* Request irq for rx handling */
2716 if (request_irq(np->msi_x_entry[NV_MSI_X_VECTOR_RX].vector, &nv_nic_irq_rx, SA_SHIRQ, dev->name, dev) != 0) {
2717 printk(KERN_INFO "forcedeth: request_irq failed for rx %d\n", ret);
2718 pci_disable_msix(np->pci_dev);
2719 np->msi_flags &= ~NV_MSI_X_ENABLED;
2720 goto out_err;
2721 }
2722 /* Request irq for tx handling */
2723 if (request_irq(np->msi_x_entry[NV_MSI_X_VECTOR_TX].vector, &nv_nic_irq_tx, SA_SHIRQ, dev->name, dev) != 0) {
2724 printk(KERN_INFO "forcedeth: request_irq failed for tx %d\n", ret);
2725 pci_disable_msix(np->pci_dev);
2726 np->msi_flags &= ~NV_MSI_X_ENABLED;
2727 goto out_free_rx;
2728 }
2729 /* Request irq for link and timer handling */
2730 if (request_irq(np->msi_x_entry[NV_MSI_X_VECTOR_OTHER].vector, &nv_nic_irq_other, SA_SHIRQ, dev->name, dev) != 0) {
2731 printk(KERN_INFO "forcedeth: request_irq failed for link %d\n", ret);
2732 pci_disable_msix(np->pci_dev);
2733 np->msi_flags &= ~NV_MSI_X_ENABLED;
2734 goto out_free_tx;
2735 }
2736 /* map interrupts to their respective vector */
2737 writel(0, base + NvRegMSIXMap0);
2738 writel(0, base + NvRegMSIXMap1);
2739 set_msix_vector_map(dev, NV_MSI_X_VECTOR_RX, NVREG_IRQ_RX_ALL);
2740 set_msix_vector_map(dev, NV_MSI_X_VECTOR_TX, NVREG_IRQ_TX_ALL);
2741 set_msix_vector_map(dev, NV_MSI_X_VECTOR_OTHER, NVREG_IRQ_OTHER);
2742 } else {
2743 /* Request irq for all interrupts */
2744 if (request_irq(np->msi_x_entry[NV_MSI_X_VECTOR_ALL].vector, &nv_nic_irq, SA_SHIRQ, dev->name, dev) != 0) {
2745 printk(KERN_INFO "forcedeth: request_irq failed %d\n", ret);
2746 pci_disable_msix(np->pci_dev);
2747 np->msi_flags &= ~NV_MSI_X_ENABLED;
2748 goto out_err;
2749 }
2750
2751 /* map interrupts to vector 0 */
2752 writel(0, base + NvRegMSIXMap0);
2753 writel(0, base + NvRegMSIXMap1);
2754 }
2755 }
2756 }
2757 if (ret != 0 && np->msi_flags & NV_MSI_CAPABLE) {
2758 if ((ret = pci_enable_msi(np->pci_dev)) == 0) {
2759 np->msi_flags |= NV_MSI_ENABLED;
2760 if (request_irq(np->pci_dev->irq, &nv_nic_irq, SA_SHIRQ, dev->name, dev) != 0) {
2761 printk(KERN_INFO "forcedeth: request_irq failed %d\n", ret);
2762 pci_disable_msi(np->pci_dev);
2763 np->msi_flags &= ~NV_MSI_ENABLED;
2764 goto out_err;
2765 }
2766
2767 /* map interrupts to vector 0 */
2768 writel(0, base + NvRegMSIMap0);
2769 writel(0, base + NvRegMSIMap1);
2770 /* enable msi vector 0 */
2771 writel(NVREG_MSI_VECTOR_0_ENABLED, base + NvRegMSIIrqMask);
2772 }
2773 }
2774 if (ret != 0) {
2775 if (request_irq(np->pci_dev->irq, &nv_nic_irq, SA_SHIRQ, dev->name, dev) != 0)
2776 goto out_err;
2777 }
2778
2779 return 0;
2780out_free_tx:
2781 free_irq(np->msi_x_entry[NV_MSI_X_VECTOR_TX].vector, dev);
2782out_free_rx:
2783 free_irq(np->msi_x_entry[NV_MSI_X_VECTOR_RX].vector, dev);
2784out_err:
2785 return 1;
2786}
2787
2788static void nv_free_irq(struct net_device *dev)
2789{
2790 struct fe_priv *np = get_nvpriv(dev);
2791 int i;
2792
2793 if (np->msi_flags & NV_MSI_X_ENABLED) {
2794 for (i = 0; i < (np->msi_flags & NV_MSI_X_VECTORS_MASK); i++) {
2795 free_irq(np->msi_x_entry[i].vector, dev);
2796 }
2797 pci_disable_msix(np->pci_dev);
2798 np->msi_flags &= ~NV_MSI_X_ENABLED;
2799 } else {
2800 free_irq(np->pci_dev->irq, dev);
2801 if (np->msi_flags & NV_MSI_ENABLED) {
2802 pci_disable_msi(np->pci_dev);
2803 np->msi_flags &= ~NV_MSI_ENABLED;
2804 }
2805 }
2806}
2807
2601static int nv_open(struct net_device *dev) 2808static int nv_open(struct net_device *dev)
2602{ 2809{
2603 struct fe_priv *np = netdev_priv(dev); 2810 struct fe_priv *np = netdev_priv(dev);
@@ -2608,6 +2815,8 @@ static int nv_open(struct net_device *dev)
2608 dprintk(KERN_DEBUG "nv_open: begin\n"); 2815 dprintk(KERN_DEBUG "nv_open: begin\n");
2609 2816
2610 /* 1) erase previous misconfiguration */ 2817 /* 1) erase previous misconfiguration */
2818 if (np->driver_data & DEV_HAS_POWER_CNTRL)
2819 nv_mac_reset(dev);
2611 /* 4.1-1: stop adapter: ignored, 4.3 seems to be overkill */ 2820 /* 4.1-1: stop adapter: ignored, 4.3 seems to be overkill */
2612 writel(NVREG_MCASTADDRA_FORCE, base + NvRegMulticastAddrA); 2821 writel(NVREG_MCASTADDRA_FORCE, base + NvRegMulticastAddrA);
2613 writel(0, base + NvRegMulticastAddrB); 2822 writel(0, base + NvRegMulticastAddrB);
@@ -2688,86 +2897,18 @@ static int nv_open(struct net_device *dev)
2688 udelay(10); 2897 udelay(10);
2689 writel(readl(base + NvRegPowerState) | NVREG_POWERSTATE_VALID, base + NvRegPowerState); 2898 writel(readl(base + NvRegPowerState) | NVREG_POWERSTATE_VALID, base + NvRegPowerState);
2690 2899
2691 writel(0, base + NvRegIrqMask); 2900 nv_disable_hw_interrupts(dev, np->irqmask);
2692 pci_push(base); 2901 pci_push(base);
2693 writel(NVREG_MIISTAT_MASK2, base + NvRegMIIStatus); 2902 writel(NVREG_MIISTAT_MASK2, base + NvRegMIIStatus);
2694 writel(NVREG_IRQSTAT_MASK, base + NvRegIrqStatus); 2903 writel(NVREG_IRQSTAT_MASK, base + NvRegIrqStatus);
2695 pci_push(base); 2904 pci_push(base);
2696 2905
2697 if (np->msi_flags & NV_MSI_X_CAPABLE) { 2906 if (nv_request_irq(dev)) {
2698 for (i = 0; i < (np->msi_flags & NV_MSI_X_VECTORS_MASK); i++) { 2907 goto out_drain;
2699 np->msi_x_entry[i].entry = i;
2700 }
2701 if ((ret = pci_enable_msix(np->pci_dev, np->msi_x_entry, (np->msi_flags & NV_MSI_X_VECTORS_MASK))) == 0) {
2702 np->msi_flags |= NV_MSI_X_ENABLED;
2703 if (optimization_mode == NV_OPTIMIZATION_MODE_THROUGHPUT) {
2704 /* Request irq for rx handling */
2705 if (request_irq(np->msi_x_entry[NV_MSI_X_VECTOR_RX].vector, &nv_nic_irq_rx, SA_SHIRQ, dev->name, dev) != 0) {
2706 printk(KERN_INFO "forcedeth: request_irq failed for rx %d\n", ret);
2707 pci_disable_msix(np->pci_dev);
2708 np->msi_flags &= ~NV_MSI_X_ENABLED;
2709 goto out_drain;
2710 }
2711 /* Request irq for tx handling */
2712 if (request_irq(np->msi_x_entry[NV_MSI_X_VECTOR_TX].vector, &nv_nic_irq_tx, SA_SHIRQ, dev->name, dev) != 0) {
2713 printk(KERN_INFO "forcedeth: request_irq failed for tx %d\n", ret);
2714 pci_disable_msix(np->pci_dev);
2715 np->msi_flags &= ~NV_MSI_X_ENABLED;
2716 goto out_drain;
2717 }
2718 /* Request irq for link and timer handling */
2719 if (request_irq(np->msi_x_entry[NV_MSI_X_VECTOR_OTHER].vector, &nv_nic_irq_other, SA_SHIRQ, dev->name, dev) != 0) {
2720 printk(KERN_INFO "forcedeth: request_irq failed for link %d\n", ret);
2721 pci_disable_msix(np->pci_dev);
2722 np->msi_flags &= ~NV_MSI_X_ENABLED;
2723 goto out_drain;
2724 }
2725
2726 /* map interrupts to their respective vector */
2727 writel(0, base + NvRegMSIXMap0);
2728 writel(0, base + NvRegMSIXMap1);
2729 set_msix_vector_map(dev, NV_MSI_X_VECTOR_RX, NVREG_IRQ_RX_ALL);
2730 set_msix_vector_map(dev, NV_MSI_X_VECTOR_TX, NVREG_IRQ_TX_ALL);
2731 set_msix_vector_map(dev, NV_MSI_X_VECTOR_OTHER, NVREG_IRQ_OTHER);
2732 } else {
2733 /* Request irq for all interrupts */
2734 if (request_irq(np->msi_x_entry[NV_MSI_X_VECTOR_ALL].vector, &nv_nic_irq, SA_SHIRQ, dev->name, dev) != 0) {
2735 printk(KERN_INFO "forcedeth: request_irq failed %d\n", ret);
2736 pci_disable_msix(np->pci_dev);
2737 np->msi_flags &= ~NV_MSI_X_ENABLED;
2738 goto out_drain;
2739 }
2740
2741 /* map interrupts to vector 0 */
2742 writel(0, base + NvRegMSIXMap0);
2743 writel(0, base + NvRegMSIXMap1);
2744 }
2745 }
2746 }
2747 if (ret != 0 && np->msi_flags & NV_MSI_CAPABLE) {
2748 if ((ret = pci_enable_msi(np->pci_dev)) == 0) {
2749 np->msi_flags |= NV_MSI_ENABLED;
2750 if (request_irq(np->pci_dev->irq, &nv_nic_irq, SA_SHIRQ, dev->name, dev) != 0) {
2751 printk(KERN_INFO "forcedeth: request_irq failed %d\n", ret);
2752 pci_disable_msi(np->pci_dev);
2753 np->msi_flags &= ~NV_MSI_ENABLED;
2754 goto out_drain;
2755 }
2756
2757 /* map interrupts to vector 0 */
2758 writel(0, base + NvRegMSIMap0);
2759 writel(0, base + NvRegMSIMap1);
2760 /* enable msi vector 0 */
2761 writel(NVREG_MSI_VECTOR_0_ENABLED, base + NvRegMSIIrqMask);
2762 }
2763 }
2764 if (ret != 0) {
2765 if (request_irq(np->pci_dev->irq, &nv_nic_irq, SA_SHIRQ, dev->name, dev) != 0)
2766 goto out_drain;
2767 } 2908 }
2768 2909
2769 /* ask for interrupts */ 2910 /* ask for interrupts */
2770 writel(np->irqmask, base + NvRegIrqMask); 2911 nv_enable_hw_interrupts(dev, np->irqmask);
2771 2912
2772 spin_lock_irq(&np->lock); 2913 spin_lock_irq(&np->lock);
2773 writel(NVREG_MCASTADDRA_FORCE, base + NvRegMulticastAddrA); 2914 writel(NVREG_MCASTADDRA_FORCE, base + NvRegMulticastAddrA);
@@ -2811,7 +2952,6 @@ static int nv_close(struct net_device *dev)
2811{ 2952{
2812 struct fe_priv *np = netdev_priv(dev); 2953 struct fe_priv *np = netdev_priv(dev);
2813 u8 __iomem *base; 2954 u8 __iomem *base;
2814 int i;
2815 2955
2816 spin_lock_irq(&np->lock); 2956 spin_lock_irq(&np->lock);
2817 np->in_shutdown = 1; 2957 np->in_shutdown = 1;
@@ -2829,31 +2969,13 @@ static int nv_close(struct net_device *dev)
2829 2969
2830 /* disable interrupts on the nic or we will lock up */ 2970 /* disable interrupts on the nic or we will lock up */
2831 base = get_hwbase(dev); 2971 base = get_hwbase(dev);
2832 if (np->msi_flags & NV_MSI_X_ENABLED) { 2972 nv_disable_hw_interrupts(dev, np->irqmask);
2833 writel(np->irqmask, base + NvRegIrqMask);
2834 } else {
2835 if (np->msi_flags & NV_MSI_ENABLED)
2836 writel(0, base + NvRegMSIIrqMask);
2837 writel(0, base + NvRegIrqMask);
2838 }
2839 pci_push(base); 2973 pci_push(base);
2840 dprintk(KERN_INFO "%s: Irqmask is zero again\n", dev->name); 2974 dprintk(KERN_INFO "%s: Irqmask is zero again\n", dev->name);
2841 2975
2842 spin_unlock_irq(&np->lock); 2976 spin_unlock_irq(&np->lock);
2843 2977
2844 if (np->msi_flags & NV_MSI_X_ENABLED) { 2978 nv_free_irq(dev);
2845 for (i = 0; i < (np->msi_flags & NV_MSI_X_VECTORS_MASK); i++) {
2846 free_irq(np->msi_x_entry[i].vector, dev);
2847 }
2848 pci_disable_msix(np->pci_dev);
2849 np->msi_flags &= ~NV_MSI_X_ENABLED;
2850 } else {
2851 free_irq(np->pci_dev->irq, dev);
2852 if (np->msi_flags & NV_MSI_ENABLED) {
2853 pci_disable_msi(np->pci_dev);
2854 np->msi_flags &= ~NV_MSI_ENABLED;
2855 }
2856 }
2857 2979
2858 drain_ring(dev); 2980 drain_ring(dev);
2859 2981
@@ -2878,6 +3000,7 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
2878 unsigned long addr; 3000 unsigned long addr;
2879 u8 __iomem *base; 3001 u8 __iomem *base;
2880 int err, i; 3002 int err, i;
3003 u32 powerstate;
2881 3004
2882 dev = alloc_etherdev(sizeof(struct fe_priv)); 3005 dev = alloc_etherdev(sizeof(struct fe_priv));
2883 err = -ENOMEM; 3006 err = -ENOMEM;
@@ -2910,6 +3033,11 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
2910 if (err < 0) 3033 if (err < 0)
2911 goto out_disable; 3034 goto out_disable;
2912 3035
3036 if (id->driver_data & (DEV_HAS_VLAN|DEV_HAS_MSI_X|DEV_HAS_POWER_CNTRL))
3037 np->register_size = NV_PCI_REGSZ_VER2;
3038 else
3039 np->register_size = NV_PCI_REGSZ_VER1;
3040
2913 err = -EINVAL; 3041 err = -EINVAL;
2914 addr = 0; 3042 addr = 0;
2915 for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) { 3043 for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
@@ -2918,7 +3046,7 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
2918 pci_resource_len(pci_dev, i), 3046 pci_resource_len(pci_dev, i),
2919 pci_resource_flags(pci_dev, i)); 3047 pci_resource_flags(pci_dev, i));
2920 if (pci_resource_flags(pci_dev, i) & IORESOURCE_MEM && 3048 if (pci_resource_flags(pci_dev, i) & IORESOURCE_MEM &&
2921 pci_resource_len(pci_dev, i) >= NV_PCI_REGSZ) { 3049 pci_resource_len(pci_dev, i) >= np->register_size) {
2922 addr = pci_resource_start(pci_dev, i); 3050 addr = pci_resource_start(pci_dev, i);
2923 break; 3051 break;
2924 } 3052 }
@@ -2929,24 +3057,25 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
2929 goto out_relreg; 3057 goto out_relreg;
2930 } 3058 }
2931 3059
3060 /* copy of driver data */
3061 np->driver_data = id->driver_data;
3062
2932 /* handle different descriptor versions */ 3063 /* handle different descriptor versions */
2933 if (id->driver_data & DEV_HAS_HIGH_DMA) { 3064 if (id->driver_data & DEV_HAS_HIGH_DMA) {
2934 /* packet format 3: supports 40-bit addressing */ 3065 /* packet format 3: supports 40-bit addressing */
2935 np->desc_ver = DESC_VER_3; 3066 np->desc_ver = DESC_VER_3;
3067 np->txrxctl_bits = NVREG_TXRXCTL_DESC_3;
2936 if (pci_set_dma_mask(pci_dev, DMA_39BIT_MASK)) { 3068 if (pci_set_dma_mask(pci_dev, DMA_39BIT_MASK)) {
2937 printk(KERN_INFO "forcedeth: 64-bit DMA failed, using 32-bit addressing for device %s.\n", 3069 printk(KERN_INFO "forcedeth: 64-bit DMA failed, using 32-bit addressing for device %s.\n",
2938 pci_name(pci_dev)); 3070 pci_name(pci_dev));
2939 } else { 3071 } else {
2940 if (pci_set_consistent_dma_mask(pci_dev, 0x0000007fffffffffULL)) { 3072 dev->features |= NETIF_F_HIGHDMA;
2941 printk(KERN_INFO "forcedeth: 64-bit DMA (consistent) failed for device %s.\n", 3073 printk(KERN_INFO "forcedeth: using HIGHDMA\n");
2942 pci_name(pci_dev)); 3074 }
2943 goto out_relreg; 3075 if (pci_set_consistent_dma_mask(pci_dev, 0x0000007fffffffffULL)) {
2944 } else { 3076 printk(KERN_INFO "forcedeth: 64-bit DMA (consistent) failed for device %s.\n",
2945 dev->features |= NETIF_F_HIGHDMA; 3077 pci_name(pci_dev));
2946 printk(KERN_INFO "forcedeth: using HIGHDMA\n");
2947 }
2948 } 3078 }
2949 np->txrxctl_bits = NVREG_TXRXCTL_DESC_3;
2950 } else if (id->driver_data & DEV_HAS_LARGEDESC) { 3079 } else if (id->driver_data & DEV_HAS_LARGEDESC) {
2951 /* packet format 2: supports jumbo frames */ 3080 /* packet format 2: supports jumbo frames */
2952 np->desc_ver = DESC_VER_2; 3081 np->desc_ver = DESC_VER_2;
@@ -2986,7 +3115,7 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
2986 } 3115 }
2987 3116
2988 err = -ENOMEM; 3117 err = -ENOMEM;
2989 np->base = ioremap(addr, NV_PCI_REGSZ); 3118 np->base = ioremap(addr, np->register_size);
2990 if (!np->base) 3119 if (!np->base)
2991 goto out_relreg; 3120 goto out_relreg;
2992 dev->base_addr = (unsigned long)np->base; 3121 dev->base_addr = (unsigned long)np->base;
@@ -3062,6 +3191,20 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
3062 writel(0, base + NvRegWakeUpFlags); 3191 writel(0, base + NvRegWakeUpFlags);
3063 np->wolenabled = 0; 3192 np->wolenabled = 0;
3064 3193
3194 if (id->driver_data & DEV_HAS_POWER_CNTRL) {
3195 u8 revision_id;
3196 pci_read_config_byte(pci_dev, PCI_REVISION_ID, &revision_id);
3197
3198 /* take phy and nic out of low power mode */
3199 powerstate = readl(base + NvRegPowerState2);
3200 powerstate &= ~NVREG_POWERSTATE2_POWERUP_MASK;
3201 if ((id->device == PCI_DEVICE_ID_NVIDIA_NVENET_12 ||
3202 id->device == PCI_DEVICE_ID_NVIDIA_NVENET_13) &&
3203 revision_id >= 0xA3)
3204 powerstate |= NVREG_POWERSTATE2_POWERUP_REV_A3;
3205 writel(powerstate, base + NvRegPowerState2);
3206 }
3207
3065 if (np->desc_ver == DESC_VER_1) { 3208 if (np->desc_ver == DESC_VER_1) {
3066 np->tx_flags = NV_TX_VALID; 3209 np->tx_flags = NV_TX_VALID;
3067 } else { 3210 } else {
@@ -3223,19 +3366,19 @@ static struct pci_device_id pci_tbl[] = {
3223 }, 3366 },
3224 { /* MCP51 Ethernet Controller */ 3367 { /* MCP51 Ethernet Controller */
3225 PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_12), 3368 PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_12),
3226 .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_HIGH_DMA, 3369 .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_HIGH_DMA|DEV_HAS_POWER_CNTRL,
3227 }, 3370 },
3228 { /* MCP51 Ethernet Controller */ 3371 { /* MCP51 Ethernet Controller */
3229 PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_13), 3372 PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_13),
3230 .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_HIGH_DMA, 3373 .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_HIGH_DMA|DEV_HAS_POWER_CNTRL,
3231 }, 3374 },
3232 { /* MCP55 Ethernet Controller */ 3375 { /* MCP55 Ethernet Controller */
3233 PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_14), 3376 PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_14),
3234 .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_VLAN|DEV_HAS_MSI|DEV_HAS_MSI_X, 3377 .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_VLAN|DEV_HAS_MSI|DEV_HAS_MSI_X|DEV_HAS_POWER_CNTRL,
3235 }, 3378 },
3236 { /* MCP55 Ethernet Controller */ 3379 { /* MCP55 Ethernet Controller */
3237 PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_15), 3380 PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_15),
3238 .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_VLAN|DEV_HAS_MSI|DEV_HAS_MSI_X, 3381 .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_VLAN|DEV_HAS_MSI|DEV_HAS_MSI_X|DEV_HAS_POWER_CNTRL,
3239 }, 3382 },
3240 {0,}, 3383 {0,},
3241}; 3384};
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index 771e25d8c417..218d31764c52 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -210,7 +210,8 @@ static int gfar_probe(struct platform_device *pdev)
210 goto regs_fail; 210 goto regs_fail;
211 } 211 }
212 212
213 spin_lock_init(&priv->lock); 213 spin_lock_init(&priv->txlock);
214 spin_lock_init(&priv->rxlock);
214 215
215 platform_set_drvdata(pdev, dev); 216 platform_set_drvdata(pdev, dev);
216 217
@@ -515,11 +516,13 @@ void stop_gfar(struct net_device *dev)
515 phy_stop(priv->phydev); 516 phy_stop(priv->phydev);
516 517
517 /* Lock it down */ 518 /* Lock it down */
518 spin_lock_irqsave(&priv->lock, flags); 519 spin_lock_irqsave(&priv->txlock, flags);
520 spin_lock(&priv->rxlock);
519 521
520 gfar_halt(dev); 522 gfar_halt(dev);
521 523
522 spin_unlock_irqrestore(&priv->lock, flags); 524 spin_unlock(&priv->rxlock);
525 spin_unlock_irqrestore(&priv->txlock, flags);
523 526
524 /* Free the IRQs */ 527 /* Free the IRQs */
525 if (priv->einfo->device_flags & FSL_GIANFAR_DEV_HAS_MULTI_INTR) { 528 if (priv->einfo->device_flags & FSL_GIANFAR_DEV_HAS_MULTI_INTR) {
@@ -605,14 +608,15 @@ void gfar_start(struct net_device *dev)
605 tempval |= DMACTRL_INIT_SETTINGS; 608 tempval |= DMACTRL_INIT_SETTINGS;
606 gfar_write(&priv->regs->dmactrl, tempval); 609 gfar_write(&priv->regs->dmactrl, tempval);
607 610
608 /* Clear THLT, so that the DMA starts polling now */
609 gfar_write(&regs->tstat, TSTAT_CLEAR_THALT);
610
611 /* Make sure we aren't stopped */ 611 /* Make sure we aren't stopped */
612 tempval = gfar_read(&priv->regs->dmactrl); 612 tempval = gfar_read(&priv->regs->dmactrl);
613 tempval &= ~(DMACTRL_GRS | DMACTRL_GTS); 613 tempval &= ~(DMACTRL_GRS | DMACTRL_GTS);
614 gfar_write(&priv->regs->dmactrl, tempval); 614 gfar_write(&priv->regs->dmactrl, tempval);
615 615
616 /* Clear THLT/RHLT, so that the DMA starts polling now */
617 gfar_write(&regs->tstat, TSTAT_CLEAR_THALT);
618 gfar_write(&regs->rstat, RSTAT_CLEAR_RHALT);
619
616 /* Unmask the interrupts we look for */ 620 /* Unmask the interrupts we look for */
617 gfar_write(&regs->imask, IMASK_DEFAULT); 621 gfar_write(&regs->imask, IMASK_DEFAULT);
618} 622}
@@ -928,12 +932,13 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev)
928 struct txfcb *fcb = NULL; 932 struct txfcb *fcb = NULL;
929 struct txbd8 *txbdp; 933 struct txbd8 *txbdp;
930 u16 status; 934 u16 status;
935 unsigned long flags;
931 936
932 /* Update transmit stats */ 937 /* Update transmit stats */
933 priv->stats.tx_bytes += skb->len; 938 priv->stats.tx_bytes += skb->len;
934 939
935 /* Lock priv now */ 940 /* Lock priv now */
936 spin_lock_irq(&priv->lock); 941 spin_lock_irqsave(&priv->txlock, flags);
937 942
938 /* Point at the first free tx descriptor */ 943 /* Point at the first free tx descriptor */
939 txbdp = priv->cur_tx; 944 txbdp = priv->cur_tx;
@@ -1004,7 +1009,7 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev)
1004 gfar_write(&priv->regs->tstat, TSTAT_CLEAR_THALT); 1009 gfar_write(&priv->regs->tstat, TSTAT_CLEAR_THALT);
1005 1010
1006 /* Unlock priv */ 1011 /* Unlock priv */
1007 spin_unlock_irq(&priv->lock); 1012 spin_unlock_irqrestore(&priv->txlock, flags);
1008 1013
1009 return 0; 1014 return 0;
1010} 1015}
@@ -1049,7 +1054,7 @@ static void gfar_vlan_rx_register(struct net_device *dev,
1049 unsigned long flags; 1054 unsigned long flags;
1050 u32 tempval; 1055 u32 tempval;
1051 1056
1052 spin_lock_irqsave(&priv->lock, flags); 1057 spin_lock_irqsave(&priv->rxlock, flags);
1053 1058
1054 priv->vlgrp = grp; 1059 priv->vlgrp = grp;
1055 1060
@@ -1076,7 +1081,7 @@ static void gfar_vlan_rx_register(struct net_device *dev,
1076 gfar_write(&priv->regs->rctrl, tempval); 1081 gfar_write(&priv->regs->rctrl, tempval);
1077 } 1082 }
1078 1083
1079 spin_unlock_irqrestore(&priv->lock, flags); 1084 spin_unlock_irqrestore(&priv->rxlock, flags);
1080} 1085}
1081 1086
1082 1087
@@ -1085,12 +1090,12 @@ static void gfar_vlan_rx_kill_vid(struct net_device *dev, uint16_t vid)
1085 struct gfar_private *priv = netdev_priv(dev); 1090 struct gfar_private *priv = netdev_priv(dev);
1086 unsigned long flags; 1091 unsigned long flags;
1087 1092
1088 spin_lock_irqsave(&priv->lock, flags); 1093 spin_lock_irqsave(&priv->rxlock, flags);
1089 1094
1090 if (priv->vlgrp) 1095 if (priv->vlgrp)
1091 priv->vlgrp->vlan_devices[vid] = NULL; 1096 priv->vlgrp->vlan_devices[vid] = NULL;
1092 1097
1093 spin_unlock_irqrestore(&priv->lock, flags); 1098 spin_unlock_irqrestore(&priv->rxlock, flags);
1094} 1099}
1095 1100
1096 1101
@@ -1179,7 +1184,7 @@ static irqreturn_t gfar_transmit(int irq, void *dev_id, struct pt_regs *regs)
1179 gfar_write(&priv->regs->ievent, IEVENT_TX_MASK); 1184 gfar_write(&priv->regs->ievent, IEVENT_TX_MASK);
1180 1185
1181 /* Lock priv */ 1186 /* Lock priv */
1182 spin_lock(&priv->lock); 1187 spin_lock(&priv->txlock);
1183 bdp = priv->dirty_tx; 1188 bdp = priv->dirty_tx;
1184 while ((bdp->status & TXBD_READY) == 0) { 1189 while ((bdp->status & TXBD_READY) == 0) {
1185 /* If dirty_tx and cur_tx are the same, then either the */ 1190 /* If dirty_tx and cur_tx are the same, then either the */
@@ -1224,7 +1229,7 @@ static irqreturn_t gfar_transmit(int irq, void *dev_id, struct pt_regs *regs)
1224 else 1229 else
1225 gfar_write(&priv->regs->txic, 0); 1230 gfar_write(&priv->regs->txic, 0);
1226 1231
1227 spin_unlock(&priv->lock); 1232 spin_unlock(&priv->txlock);
1228 1233
1229 return IRQ_HANDLED; 1234 return IRQ_HANDLED;
1230} 1235}
@@ -1305,9 +1310,10 @@ irqreturn_t gfar_receive(int irq, void *dev_id, struct pt_regs *regs)
1305{ 1310{
1306 struct net_device *dev = (struct net_device *) dev_id; 1311 struct net_device *dev = (struct net_device *) dev_id;
1307 struct gfar_private *priv = netdev_priv(dev); 1312 struct gfar_private *priv = netdev_priv(dev);
1308
1309#ifdef CONFIG_GFAR_NAPI 1313#ifdef CONFIG_GFAR_NAPI
1310 u32 tempval; 1314 u32 tempval;
1315#else
1316 unsigned long flags;
1311#endif 1317#endif
1312 1318
1313 /* Clear IEVENT, so rx interrupt isn't called again 1319 /* Clear IEVENT, so rx interrupt isn't called again
@@ -1330,7 +1336,7 @@ irqreturn_t gfar_receive(int irq, void *dev_id, struct pt_regs *regs)
1330 } 1336 }
1331#else 1337#else
1332 1338
1333 spin_lock(&priv->lock); 1339 spin_lock_irqsave(&priv->rxlock, flags);
1334 gfar_clean_rx_ring(dev, priv->rx_ring_size); 1340 gfar_clean_rx_ring(dev, priv->rx_ring_size);
1335 1341
1336 /* If we are coalescing interrupts, update the timer */ 1342 /* If we are coalescing interrupts, update the timer */
@@ -1341,7 +1347,7 @@ irqreturn_t gfar_receive(int irq, void *dev_id, struct pt_regs *regs)
1341 else 1347 else
1342 gfar_write(&priv->regs->rxic, 0); 1348 gfar_write(&priv->regs->rxic, 0);
1343 1349
1344 spin_unlock(&priv->lock); 1350 spin_unlock_irqrestore(&priv->rxlock, flags);
1345#endif 1351#endif
1346 1352
1347 return IRQ_HANDLED; 1353 return IRQ_HANDLED;
@@ -1490,13 +1496,6 @@ int gfar_clean_rx_ring(struct net_device *dev, int rx_work_limit)
1490 /* Update the current rxbd pointer to be the next one */ 1496 /* Update the current rxbd pointer to be the next one */
1491 priv->cur_rx = bdp; 1497 priv->cur_rx = bdp;
1492 1498
1493 /* If no packets have arrived since the
1494 * last one we processed, clear the IEVENT RX and
1495 * BSY bits so that another interrupt won't be
1496 * generated when we set IMASK */
1497 if (bdp->status & RXBD_EMPTY)
1498 gfar_write(&priv->regs->ievent, IEVENT_RX_MASK);
1499
1500 return howmany; 1499 return howmany;
1501} 1500}
1502 1501
@@ -1516,7 +1515,7 @@ static int gfar_poll(struct net_device *dev, int *budget)
1516 rx_work_limit -= howmany; 1515 rx_work_limit -= howmany;
1517 *budget -= howmany; 1516 *budget -= howmany;
1518 1517
1519 if (rx_work_limit >= 0) { 1518 if (rx_work_limit > 0) {
1520 netif_rx_complete(dev); 1519 netif_rx_complete(dev);
1521 1520
1522 /* Clear the halt bit in RSTAT */ 1521 /* Clear the halt bit in RSTAT */
@@ -1533,7 +1532,8 @@ static int gfar_poll(struct net_device *dev, int *budget)
1533 gfar_write(&priv->regs->rxic, 0); 1532 gfar_write(&priv->regs->rxic, 0);
1534 } 1533 }
1535 1534
1536 return (rx_work_limit < 0) ? 1 : 0; 1535 /* Return 1 if there's more work to do */
1536 return (rx_work_limit > 0) ? 0 : 1;
1537} 1537}
1538#endif 1538#endif
1539 1539
@@ -1629,7 +1629,7 @@ static void adjust_link(struct net_device *dev)
1629 struct phy_device *phydev = priv->phydev; 1629 struct phy_device *phydev = priv->phydev;
1630 int new_state = 0; 1630 int new_state = 0;
1631 1631
1632 spin_lock_irqsave(&priv->lock, flags); 1632 spin_lock_irqsave(&priv->txlock, flags);
1633 if (phydev->link) { 1633 if (phydev->link) {
1634 u32 tempval = gfar_read(&regs->maccfg2); 1634 u32 tempval = gfar_read(&regs->maccfg2);
1635 u32 ecntrl = gfar_read(&regs->ecntrl); 1635 u32 ecntrl = gfar_read(&regs->ecntrl);
@@ -1694,7 +1694,7 @@ static void adjust_link(struct net_device *dev)
1694 if (new_state && netif_msg_link(priv)) 1694 if (new_state && netif_msg_link(priv))
1695 phy_print_status(phydev); 1695 phy_print_status(phydev);
1696 1696
1697 spin_unlock_irqrestore(&priv->lock, flags); 1697 spin_unlock_irqrestore(&priv->txlock, flags);
1698} 1698}
1699 1699
1700/* Update the hash table based on the current list of multicast 1700/* Update the hash table based on the current list of multicast
diff --git a/drivers/net/gianfar.h b/drivers/net/gianfar.h
index d37d5401be6e..127c98cf3336 100644
--- a/drivers/net/gianfar.h
+++ b/drivers/net/gianfar.h
@@ -656,43 +656,62 @@ struct gfar {
656 * the buffer descriptor determines the actual condition. 656 * the buffer descriptor determines the actual condition.
657 */ 657 */
658struct gfar_private { 658struct gfar_private {
659 /* pointers to arrays of skbuffs for tx and rx */ 659 /* Fields controlled by TX lock */
660 spinlock_t txlock;
661
662 /* Pointer to the array of skbuffs */
660 struct sk_buff ** tx_skbuff; 663 struct sk_buff ** tx_skbuff;
661 struct sk_buff ** rx_skbuff;
662 664
663 /* indices pointing to the next free sbk in skb arrays */ 665 /* next free skb in the array */
664 u16 skb_curtx; 666 u16 skb_curtx;
665 u16 skb_currx;
666 667
667 /* index of the first skb which hasn't been transmitted 668 /* First skb in line to be transmitted */
668 * yet. */
669 u16 skb_dirtytx; 669 u16 skb_dirtytx;
670 670
671 /* Configuration info for the coalescing features */ 671 /* Configuration info for the coalescing features */
672 unsigned char txcoalescing; 672 unsigned char txcoalescing;
673 unsigned short txcount; 673 unsigned short txcount;
674 unsigned short txtime; 674 unsigned short txtime;
675
676 /* Buffer descriptor pointers */
677 struct txbd8 *tx_bd_base; /* First tx buffer descriptor */
678 struct txbd8 *cur_tx; /* Next free ring entry */
679 struct txbd8 *dirty_tx; /* First buffer in line
680 to be transmitted */
681 unsigned int tx_ring_size;
682
683 /* RX Locked fields */
684 spinlock_t rxlock;
685
686 /* skb array and index */
687 struct sk_buff ** rx_skbuff;
688 u16 skb_currx;
689
690 /* RX Coalescing values */
675 unsigned char rxcoalescing; 691 unsigned char rxcoalescing;
676 unsigned short rxcount; 692 unsigned short rxcount;
677 unsigned short rxtime; 693 unsigned short rxtime;
678 694
679 /* GFAR addresses */ 695 struct rxbd8 *rx_bd_base; /* First Rx buffers */
680 struct rxbd8 *rx_bd_base; /* Base addresses of Rx and Tx Buffers */
681 struct txbd8 *tx_bd_base;
682 struct rxbd8 *cur_rx; /* Next free rx ring entry */ 696 struct rxbd8 *cur_rx; /* Next free rx ring entry */
683 struct txbd8 *cur_tx; /* Next free ring entry */ 697
684 struct txbd8 *dirty_tx; /* The Ring entry to be freed. */ 698 /* RX parameters */
685 struct gfar __iomem *regs; /* Pointer to the GFAR memory mapped Registers */ 699 unsigned int rx_ring_size;
686 u32 __iomem *hash_regs[16];
687 int hash_width;
688 struct net_device_stats stats; /* linux network statistics */
689 struct gfar_extra_stats extra_stats;
690 spinlock_t lock;
691 unsigned int rx_buffer_size; 700 unsigned int rx_buffer_size;
692 unsigned int rx_stash_size; 701 unsigned int rx_stash_size;
693 unsigned int rx_stash_index; 702 unsigned int rx_stash_index;
694 unsigned int tx_ring_size; 703
695 unsigned int rx_ring_size; 704 struct vlan_group *vlgrp;
705
706 /* Unprotected fields */
707 /* Pointer to the GFAR memory mapped Registers */
708 struct gfar __iomem *regs;
709
710 /* Hash registers and their width */
711 u32 __iomem *hash_regs[16];
712 int hash_width;
713
714 /* global parameters */
696 unsigned int fifo_threshold; 715 unsigned int fifo_threshold;
697 unsigned int fifo_starve; 716 unsigned int fifo_starve;
698 unsigned int fifo_starve_off; 717 unsigned int fifo_starve_off;
@@ -702,13 +721,15 @@ struct gfar_private {
702 extended_hash:1, 721 extended_hash:1,
703 bd_stash_en:1; 722 bd_stash_en:1;
704 unsigned short padding; 723 unsigned short padding;
705 struct vlan_group *vlgrp; 724
706 /* Info structure initialized by board setup code */
707 unsigned int interruptTransmit; 725 unsigned int interruptTransmit;
708 unsigned int interruptReceive; 726 unsigned int interruptReceive;
709 unsigned int interruptError; 727 unsigned int interruptError;
728
729 /* info structure initialized by platform code */
710 struct gianfar_platform_data *einfo; 730 struct gianfar_platform_data *einfo;
711 731
732 /* PHY stuff */
712 struct phy_device *phydev; 733 struct phy_device *phydev;
713 struct mii_bus *mii_bus; 734 struct mii_bus *mii_bus;
714 int oldspeed; 735 int oldspeed;
@@ -716,6 +737,10 @@ struct gfar_private {
716 int oldlink; 737 int oldlink;
717 738
718 uint32_t msg_enable; 739 uint32_t msg_enable;
740
741 /* Network Statistics */
742 struct net_device_stats stats;
743 struct gfar_extra_stats extra_stats;
719}; 744};
720 745
721static inline u32 gfar_read(volatile unsigned __iomem *addr) 746static inline u32 gfar_read(volatile unsigned __iomem *addr)
diff --git a/drivers/net/gianfar_ethtool.c b/drivers/net/gianfar_ethtool.c
index 5de7b2e259dc..d69698c695ef 100644
--- a/drivers/net/gianfar_ethtool.c
+++ b/drivers/net/gianfar_ethtool.c
@@ -455,10 +455,14 @@ static int gfar_sringparam(struct net_device *dev, struct ethtool_ringparam *rva
455 455
456 /* Halt TX and RX, and process the frames which 456 /* Halt TX and RX, and process the frames which
457 * have already been received */ 457 * have already been received */
458 spin_lock_irqsave(&priv->lock, flags); 458 spin_lock_irqsave(&priv->txlock, flags);
459 spin_lock(&priv->rxlock);
460
459 gfar_halt(dev); 461 gfar_halt(dev);
460 gfar_clean_rx_ring(dev, priv->rx_ring_size); 462 gfar_clean_rx_ring(dev, priv->rx_ring_size);
461 spin_unlock_irqrestore(&priv->lock, flags); 463
464 spin_unlock(&priv->rxlock);
465 spin_unlock_irqrestore(&priv->txlock, flags);
462 466
463 /* Now we take down the rings to rebuild them */ 467 /* Now we take down the rings to rebuild them */
464 stop_gfar(dev); 468 stop_gfar(dev);
@@ -488,10 +492,14 @@ static int gfar_set_rx_csum(struct net_device *dev, uint32_t data)
488 492
489 /* Halt TX and RX, and process the frames which 493 /* Halt TX and RX, and process the frames which
490 * have already been received */ 494 * have already been received */
491 spin_lock_irqsave(&priv->lock, flags); 495 spin_lock_irqsave(&priv->txlock, flags);
496 spin_lock(&priv->rxlock);
497
492 gfar_halt(dev); 498 gfar_halt(dev);
493 gfar_clean_rx_ring(dev, priv->rx_ring_size); 499 gfar_clean_rx_ring(dev, priv->rx_ring_size);
494 spin_unlock_irqrestore(&priv->lock, flags); 500
501 spin_unlock(&priv->rxlock);
502 spin_unlock_irqrestore(&priv->txlock, flags);
495 503
496 /* Now we take down the rings to rebuild them */ 504 /* Now we take down the rings to rebuild them */
497 stop_gfar(dev); 505 stop_gfar(dev);
@@ -523,7 +531,7 @@ static int gfar_set_tx_csum(struct net_device *dev, uint32_t data)
523 if (!(priv->einfo->device_flags & FSL_GIANFAR_DEV_HAS_CSUM)) 531 if (!(priv->einfo->device_flags & FSL_GIANFAR_DEV_HAS_CSUM))
524 return -EOPNOTSUPP; 532 return -EOPNOTSUPP;
525 533
526 spin_lock_irqsave(&priv->lock, flags); 534 spin_lock_irqsave(&priv->txlock, flags);
527 gfar_halt(dev); 535 gfar_halt(dev);
528 536
529 if (data) 537 if (data)
@@ -532,7 +540,7 @@ static int gfar_set_tx_csum(struct net_device *dev, uint32_t data)
532 dev->features &= ~NETIF_F_IP_CSUM; 540 dev->features &= ~NETIF_F_IP_CSUM;
533 541
534 gfar_start(dev); 542 gfar_start(dev);
535 spin_unlock_irqrestore(&priv->lock, flags); 543 spin_unlock_irqrestore(&priv->txlock, flags);
536 544
537 return 0; 545 return 0;
538} 546}
diff --git a/drivers/net/gianfar_sysfs.c b/drivers/net/gianfar_sysfs.c
index 51ef181b1368..a6d5c43199cb 100644
--- a/drivers/net/gianfar_sysfs.c
+++ b/drivers/net/gianfar_sysfs.c
@@ -82,7 +82,7 @@ static ssize_t gfar_set_bd_stash(struct class_device *cdev,
82 else 82 else
83 return count; 83 return count;
84 84
85 spin_lock_irqsave(&priv->lock, flags); 85 spin_lock_irqsave(&priv->rxlock, flags);
86 86
87 /* Set the new stashing value */ 87 /* Set the new stashing value */
88 priv->bd_stash_en = new_setting; 88 priv->bd_stash_en = new_setting;
@@ -96,7 +96,7 @@ static ssize_t gfar_set_bd_stash(struct class_device *cdev,
96 96
97 gfar_write(&priv->regs->attr, temp); 97 gfar_write(&priv->regs->attr, temp);
98 98
99 spin_unlock_irqrestore(&priv->lock, flags); 99 spin_unlock_irqrestore(&priv->rxlock, flags);
100 100
101 return count; 101 return count;
102} 102}
@@ -118,7 +118,7 @@ static ssize_t gfar_set_rx_stash_size(struct class_device *cdev,
118 u32 temp; 118 u32 temp;
119 unsigned long flags; 119 unsigned long flags;
120 120
121 spin_lock_irqsave(&priv->lock, flags); 121 spin_lock_irqsave(&priv->rxlock, flags);
122 if (length > priv->rx_buffer_size) 122 if (length > priv->rx_buffer_size)
123 return count; 123 return count;
124 124
@@ -142,7 +142,7 @@ static ssize_t gfar_set_rx_stash_size(struct class_device *cdev,
142 142
143 gfar_write(&priv->regs->attr, temp); 143 gfar_write(&priv->regs->attr, temp);
144 144
145 spin_unlock_irqrestore(&priv->lock, flags); 145 spin_unlock_irqrestore(&priv->rxlock, flags);
146 146
147 return count; 147 return count;
148} 148}
@@ -166,7 +166,7 @@ static ssize_t gfar_set_rx_stash_index(struct class_device *cdev,
166 u32 temp; 166 u32 temp;
167 unsigned long flags; 167 unsigned long flags;
168 168
169 spin_lock_irqsave(&priv->lock, flags); 169 spin_lock_irqsave(&priv->rxlock, flags);
170 if (index > priv->rx_stash_size) 170 if (index > priv->rx_stash_size)
171 return count; 171 return count;
172 172
@@ -180,7 +180,7 @@ static ssize_t gfar_set_rx_stash_index(struct class_device *cdev,
180 temp |= ATTRELI_EI(index); 180 temp |= ATTRELI_EI(index);
181 gfar_write(&priv->regs->attreli, flags); 181 gfar_write(&priv->regs->attreli, flags);
182 182
183 spin_unlock_irqrestore(&priv->lock, flags); 183 spin_unlock_irqrestore(&priv->rxlock, flags);
184 184
185 return count; 185 return count;
186} 186}
@@ -205,7 +205,7 @@ static ssize_t gfar_set_fifo_threshold(struct class_device *cdev,
205 if (length > GFAR_MAX_FIFO_THRESHOLD) 205 if (length > GFAR_MAX_FIFO_THRESHOLD)
206 return count; 206 return count;
207 207
208 spin_lock_irqsave(&priv->lock, flags); 208 spin_lock_irqsave(&priv->txlock, flags);
209 209
210 priv->fifo_threshold = length; 210 priv->fifo_threshold = length;
211 211
@@ -214,7 +214,7 @@ static ssize_t gfar_set_fifo_threshold(struct class_device *cdev,
214 temp |= length; 214 temp |= length;
215 gfar_write(&priv->regs->fifo_tx_thr, temp); 215 gfar_write(&priv->regs->fifo_tx_thr, temp);
216 216
217 spin_unlock_irqrestore(&priv->lock, flags); 217 spin_unlock_irqrestore(&priv->txlock, flags);
218 218
219 return count; 219 return count;
220} 220}
@@ -240,7 +240,7 @@ static ssize_t gfar_set_fifo_starve(struct class_device *cdev,
240 if (num > GFAR_MAX_FIFO_STARVE) 240 if (num > GFAR_MAX_FIFO_STARVE)
241 return count; 241 return count;
242 242
243 spin_lock_irqsave(&priv->lock, flags); 243 spin_lock_irqsave(&priv->txlock, flags);
244 244
245 priv->fifo_starve = num; 245 priv->fifo_starve = num;
246 246
@@ -249,7 +249,7 @@ static ssize_t gfar_set_fifo_starve(struct class_device *cdev,
249 temp |= num; 249 temp |= num;
250 gfar_write(&priv->regs->fifo_tx_starve, temp); 250 gfar_write(&priv->regs->fifo_tx_starve, temp);
251 251
252 spin_unlock_irqrestore(&priv->lock, flags); 252 spin_unlock_irqrestore(&priv->txlock, flags);
253 253
254 return count; 254 return count;
255} 255}
@@ -274,7 +274,7 @@ static ssize_t gfar_set_fifo_starve_off(struct class_device *cdev,
274 if (num > GFAR_MAX_FIFO_STARVE_OFF) 274 if (num > GFAR_MAX_FIFO_STARVE_OFF)
275 return count; 275 return count;
276 276
277 spin_lock_irqsave(&priv->lock, flags); 277 spin_lock_irqsave(&priv->txlock, flags);
278 278
279 priv->fifo_starve_off = num; 279 priv->fifo_starve_off = num;
280 280
@@ -283,7 +283,7 @@ static ssize_t gfar_set_fifo_starve_off(struct class_device *cdev,
283 temp |= num; 283 temp |= num;
284 gfar_write(&priv->regs->fifo_tx_starve_shutoff, temp); 284 gfar_write(&priv->regs->fifo_tx_starve_shutoff, temp);
285 285
286 spin_unlock_irqrestore(&priv->lock, flags); 286 spin_unlock_irqrestore(&priv->txlock, flags);
287 287
288 return count; 288 return count;
289} 289}
diff --git a/drivers/net/hamradio/dmascc.c b/drivers/net/hamradio/dmascc.c
index 79a8fbcf5f93..0d5fccc984bb 100644
--- a/drivers/net/hamradio/dmascc.c
+++ b/drivers/net/hamradio/dmascc.c
@@ -582,7 +582,6 @@ static int __init setup_adapter(int card_base, int type, int n)
582 INIT_WORK(&priv->rx_work, rx_bh, priv); 582 INIT_WORK(&priv->rx_work, rx_bh, priv);
583 dev->priv = priv; 583 dev->priv = priv;
584 sprintf(dev->name, "dmascc%i", 2 * n + i); 584 sprintf(dev->name, "dmascc%i", 2 * n + i);
585 SET_MODULE_OWNER(dev);
586 dev->base_addr = card_base; 585 dev->base_addr = card_base;
587 dev->irq = irq; 586 dev->irq = irq;
588 dev->open = scc_open; 587 dev->open = scc_open;
diff --git a/drivers/net/hamradio/scc.c b/drivers/net/hamradio/scc.c
index 6ace0e914fd1..5927784df3f9 100644
--- a/drivers/net/hamradio/scc.c
+++ b/drivers/net/hamradio/scc.c
@@ -1550,7 +1550,6 @@ static unsigned char ax25_nocall[AX25_ADDR_LEN] =
1550 1550
1551static void scc_net_setup(struct net_device *dev) 1551static void scc_net_setup(struct net_device *dev)
1552{ 1552{
1553 SET_MODULE_OWNER(dev);
1554 dev->tx_queue_len = 16; /* should be enough... */ 1553 dev->tx_queue_len = 16; /* should be enough... */
1555 1554
1556 dev->open = scc_net_open; 1555 dev->open = scc_net_open;
diff --git a/drivers/net/hamradio/yam.c b/drivers/net/hamradio/yam.c
index fe22479eb202..b49884048caa 100644
--- a/drivers/net/hamradio/yam.c
+++ b/drivers/net/hamradio/yam.c
@@ -1098,7 +1098,6 @@ static void yam_setup(struct net_device *dev)
1098 1098
1099 dev->base_addr = yp->iobase; 1099 dev->base_addr = yp->iobase;
1100 dev->irq = yp->irq; 1100 dev->irq = yp->irq;
1101 SET_MODULE_OWNER(dev);
1102 1101
1103 dev->open = yam_open; 1102 dev->open = yam_open;
1104 dev->stop = yam_close; 1103 dev->stop = yam_close;
diff --git a/drivers/net/irda/Kconfig b/drivers/net/irda/Kconfig
index 5e6d00752990..cff8598aa800 100644
--- a/drivers/net/irda/Kconfig
+++ b/drivers/net/irda/Kconfig
@@ -33,7 +33,7 @@ config DONGLE
33 33
34config ESI_DONGLE 34config ESI_DONGLE
35 tristate "ESI JetEye PC dongle" 35 tristate "ESI JetEye PC dongle"
36 depends on DONGLE && IRDA 36 depends on IRTTY_SIR && DONGLE && IRDA
37 help 37 help
38 Say Y here if you want to build support for the Extended Systems 38 Say Y here if you want to build support for the Extended Systems
39 JetEye PC dongle. To compile it as a module, choose M here. The ESI 39 JetEye PC dongle. To compile it as a module, choose M here. The ESI
@@ -44,7 +44,7 @@ config ESI_DONGLE
44 44
45config ACTISYS_DONGLE 45config ACTISYS_DONGLE
46 tristate "ACTiSYS IR-220L and IR220L+ dongle" 46 tristate "ACTiSYS IR-220L and IR220L+ dongle"
47 depends on DONGLE && IRDA 47 depends on IRTTY_SIR && DONGLE && IRDA
48 help 48 help
49 Say Y here if you want to build support for the ACTiSYS IR-220L and 49 Say Y here if you want to build support for the ACTiSYS IR-220L and
50 IR220L+ dongles. To compile it as a module, choose M here. The 50 IR220L+ dongles. To compile it as a module, choose M here. The
@@ -55,7 +55,7 @@ config ACTISYS_DONGLE
55 55
56config TEKRAM_DONGLE 56config TEKRAM_DONGLE
57 tristate "Tekram IrMate 210B dongle" 57 tristate "Tekram IrMate 210B dongle"
58 depends on DONGLE && IRDA 58 depends on IRTTY_SIR && DONGLE && IRDA
59 help 59 help
60 Say Y here if you want to build support for the Tekram IrMate 210B 60 Say Y here if you want to build support for the Tekram IrMate 210B
61 dongle. To compile it as a module, choose M here. The Tekram dongle 61 dongle. To compile it as a module, choose M here. The Tekram dongle
@@ -66,7 +66,7 @@ config TEKRAM_DONGLE
66 66
67config TOIM3232_DONGLE 67config TOIM3232_DONGLE
68 tristate "TOIM3232 IrDa dongle" 68 tristate "TOIM3232 IrDa dongle"
69 depends on DONGLE && IRDA 69 depends on IRTTY_SIR && DONGLE && IRDA
70 help 70 help
71 Say Y here if you want to build support for the Vishay/Temic 71 Say Y here if you want to build support for the Vishay/Temic
72 TOIM3232 and TOIM4232 based dongles. 72 TOIM3232 and TOIM4232 based dongles.
@@ -74,7 +74,7 @@ config TOIM3232_DONGLE
74 74
75config LITELINK_DONGLE 75config LITELINK_DONGLE
76 tristate "Parallax LiteLink dongle" 76 tristate "Parallax LiteLink dongle"
77 depends on DONGLE && IRDA 77 depends on IRTTY_SIR && DONGLE && IRDA
78 help 78 help
79 Say Y here if you want to build support for the Parallax Litelink 79 Say Y here if you want to build support for the Parallax Litelink
80 dongle. To compile it as a module, choose M here. The Parallax 80 dongle. To compile it as a module, choose M here. The Parallax
@@ -85,7 +85,7 @@ config LITELINK_DONGLE
85 85
86config MA600_DONGLE 86config MA600_DONGLE
87 tristate "Mobile Action MA600 dongle" 87 tristate "Mobile Action MA600 dongle"
88 depends on DONGLE && IRDA && EXPERIMENTAL 88 depends on IRTTY_SIR && DONGLE && IRDA && EXPERIMENTAL
89 help 89 help
90 Say Y here if you want to build support for the Mobile Action MA600 90 Say Y here if you want to build support for the Mobile Action MA600
91 dongle. To compile it as a module, choose M here. The MA600 dongle 91 dongle. To compile it as a module, choose M here. The MA600 dongle
@@ -98,7 +98,7 @@ config MA600_DONGLE
98 98
99config GIRBIL_DONGLE 99config GIRBIL_DONGLE
100 tristate "Greenwich GIrBIL dongle" 100 tristate "Greenwich GIrBIL dongle"
101 depends on DONGLE && IRDA && EXPERIMENTAL 101 depends on IRTTY_SIR && DONGLE && IRDA && EXPERIMENTAL
102 help 102 help
103 Say Y here if you want to build support for the Greenwich GIrBIL 103 Say Y here if you want to build support for the Greenwich GIrBIL
104 dongle. If you want to compile it as a module, choose M here. 104 dongle. If you want to compile it as a module, choose M here.
@@ -109,7 +109,7 @@ config GIRBIL_DONGLE
109 109
110config MCP2120_DONGLE 110config MCP2120_DONGLE
111 tristate "Microchip MCP2120" 111 tristate "Microchip MCP2120"
112 depends on DONGLE && IRDA && EXPERIMENTAL 112 depends on IRTTY_SIR && DONGLE && IRDA && EXPERIMENTAL
113 help 113 help
114 Say Y here if you want to build support for the Microchip MCP2120 114 Say Y here if you want to build support for the Microchip MCP2120
115 dongle. If you want to compile it as a module, choose M here. 115 dongle. If you want to compile it as a module, choose M here.
@@ -123,7 +123,7 @@ config MCP2120_DONGLE
123 123
124config OLD_BELKIN_DONGLE 124config OLD_BELKIN_DONGLE
125 tristate "Old Belkin dongle" 125 tristate "Old Belkin dongle"
126 depends on DONGLE && IRDA && EXPERIMENTAL 126 depends on IRTTY_SIR && DONGLE && IRDA && EXPERIMENTAL
127 help 127 help
128 Say Y here if you want to build support for the Adaptec Airport 1000 128 Say Y here if you want to build support for the Adaptec Airport 1000
129 and 2000 dongles. If you want to compile it as a module, choose 129 and 2000 dongles. If you want to compile it as a module, choose
@@ -132,7 +132,7 @@ config OLD_BELKIN_DONGLE
132 132
133config ACT200L_DONGLE 133config ACT200L_DONGLE
134 tristate "ACTiSYS IR-200L dongle" 134 tristate "ACTiSYS IR-200L dongle"
135 depends on DONGLE && IRDA && EXPERIMENTAL 135 depends on IRTTY_SIR && DONGLE && IRDA && EXPERIMENTAL
136 help 136 help
137 Say Y here if you want to build support for the ACTiSYS IR-200L 137 Say Y here if you want to build support for the ACTiSYS IR-200L
138 dongle. If you want to compile it as a module, choose M here. 138 dongle. If you want to compile it as a module, choose M here.
diff --git a/drivers/net/irda/Makefile b/drivers/net/irda/Makefile
index 27ab75f20799..c1ce2398efea 100644
--- a/drivers/net/irda/Makefile
+++ b/drivers/net/irda/Makefile
@@ -46,4 +46,4 @@ obj-$(CONFIG_MA600_DONGLE) += ma600-sir.o
46obj-$(CONFIG_TOIM3232_DONGLE) += toim3232-sir.o 46obj-$(CONFIG_TOIM3232_DONGLE) += toim3232-sir.o
47 47
48# The SIR helper module 48# The SIR helper module
49sir-dev-objs := sir_dev.o sir_dongle.o sir_kthread.o 49sir-dev-objs := sir_dev.o sir_dongle.o
diff --git a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c
index 606243d11793..cd87593e4e8a 100644
--- a/drivers/net/irda/irda-usb.c
+++ b/drivers/net/irda/irda-usb.c
@@ -1778,7 +1778,7 @@ static int irda_usb_probe(struct usb_interface *intf,
1778 1778
1779 if (self->needspatch) { 1779 if (self->needspatch) {
1780 ret = usb_control_msg (self->usbdev, usb_sndctrlpipe (self->usbdev, 0), 1780 ret = usb_control_msg (self->usbdev, usb_sndctrlpipe (self->usbdev, 0),
1781 0x02, 0x40, 0, 0, 0, 0, msecs_to_jiffies(500)); 1781 0x02, 0x40, 0, 0, NULL, 0, 500);
1782 if (ret < 0) { 1782 if (ret < 0) {
1783 IRDA_DEBUG (0, "usb_control_msg failed %d\n", ret); 1783 IRDA_DEBUG (0, "usb_control_msg failed %d\n", ret);
1784 goto err_out_3; 1784 goto err_out_3;
@@ -1815,14 +1815,14 @@ static int irda_usb_probe(struct usb_interface *intf,
1815 self->needspatch = (ret < 0); 1815 self->needspatch = (ret < 0);
1816 if (ret < 0) { 1816 if (ret < 0) {
1817 printk("patch_device failed\n"); 1817 printk("patch_device failed\n");
1818 goto err_out_4; 1818 goto err_out_5;
1819 } 1819 }
1820 1820
1821 /* replace IrDA class descriptor with what patched device is now reporting */ 1821 /* replace IrDA class descriptor with what patched device is now reporting */
1822 irda_desc = irda_usb_find_class_desc (self->usbintf); 1822 irda_desc = irda_usb_find_class_desc (self->usbintf);
1823 if (irda_desc == NULL) { 1823 if (irda_desc == NULL) {
1824 ret = -ENODEV; 1824 ret = -ENODEV;
1825 goto err_out_4; 1825 goto err_out_5;
1826 } 1826 }
1827 if (self->irda_desc) 1827 if (self->irda_desc)
1828 kfree (self->irda_desc); 1828 kfree (self->irda_desc);
@@ -1832,6 +1832,8 @@ static int irda_usb_probe(struct usb_interface *intf,
1832 1832
1833 return 0; 1833 return 0;
1834 1834
1835err_out_5:
1836 unregister_netdev(self->netdev);
1835err_out_4: 1837err_out_4:
1836 kfree(self->speed_buff); 1838 kfree(self->speed_buff);
1837err_out_3: 1839err_out_3:
diff --git a/drivers/net/irda/sir-dev.h b/drivers/net/irda/sir-dev.h
index f69fb4cec76f..9fa294a546d6 100644
--- a/drivers/net/irda/sir-dev.h
+++ b/drivers/net/irda/sir-dev.h
@@ -15,23 +15,14 @@
15#define IRDA_SIR_H 15#define IRDA_SIR_H
16 16
17#include <linux/netdevice.h> 17#include <linux/netdevice.h>
18#include <linux/workqueue.h>
18 19
19#include <net/irda/irda.h> 20#include <net/irda/irda.h>
20#include <net/irda/irda_device.h> // iobuff_t 21#include <net/irda/irda_device.h> // iobuff_t
21 22
22/* FIXME: unify irda_request with sir_fsm! */
23
24struct irda_request {
25 struct list_head lh_request;
26 unsigned long pending;
27 void (*func)(void *);
28 void *data;
29 struct timer_list timer;
30};
31
32struct sir_fsm { 23struct sir_fsm {
33 struct semaphore sem; 24 struct semaphore sem;
34 struct irda_request rq; 25 struct work_struct work;
35 unsigned state, substate; 26 unsigned state, substate;
36 int param; 27 int param;
37 int result; 28 int result;
diff --git a/drivers/net/irda/sir_dev.c b/drivers/net/irda/sir_dev.c
index ea7c9464d46a..3b5854d10c17 100644
--- a/drivers/net/irda/sir_dev.c
+++ b/drivers/net/irda/sir_dev.c
@@ -23,6 +23,298 @@
23 23
24#include "sir-dev.h" 24#include "sir-dev.h"
25 25
26
27static struct workqueue_struct *irda_sir_wq;
28
29/* STATE MACHINE */
30
31/* substate handler of the config-fsm to handle the cases where we want
32 * to wait for transmit completion before changing the port configuration
33 */
34
35static int sirdev_tx_complete_fsm(struct sir_dev *dev)
36{
37 struct sir_fsm *fsm = &dev->fsm;
38 unsigned next_state, delay;
39 unsigned bytes_left;
40
41 do {
42 next_state = fsm->substate; /* default: stay in current substate */
43 delay = 0;
44
45 switch(fsm->substate) {
46
47 case SIRDEV_STATE_WAIT_XMIT:
48 if (dev->drv->chars_in_buffer)
49 bytes_left = dev->drv->chars_in_buffer(dev);
50 else
51 bytes_left = 0;
52 if (!bytes_left) {
53 next_state = SIRDEV_STATE_WAIT_UNTIL_SENT;
54 break;
55 }
56
57 if (dev->speed > 115200)
58 delay = (bytes_left*8*10000) / (dev->speed/100);
59 else if (dev->speed > 0)
60 delay = (bytes_left*10*10000) / (dev->speed/100);
61 else
62 delay = 0;
63 /* expected delay (usec) until remaining bytes are sent */
64 if (delay < 100) {
65 udelay(delay);
66 delay = 0;
67 break;
68 }
69 /* sleep some longer delay (msec) */
70 delay = (delay+999) / 1000;
71 break;
72
73 case SIRDEV_STATE_WAIT_UNTIL_SENT:
74 /* block until underlaying hardware buffer are empty */
75 if (dev->drv->wait_until_sent)
76 dev->drv->wait_until_sent(dev);
77 next_state = SIRDEV_STATE_TX_DONE;
78 break;
79
80 case SIRDEV_STATE_TX_DONE:
81 return 0;
82
83 default:
84 IRDA_ERROR("%s - undefined state\n", __FUNCTION__);
85 return -EINVAL;
86 }
87 fsm->substate = next_state;
88 } while (delay == 0);
89 return delay;
90}
91
92/*
93 * Function sirdev_config_fsm
94 *
95 * State machine to handle the configuration of the device (and attached dongle, if any).
96 * This handler is scheduled for execution in kIrDAd context, so we can sleep.
97 * however, kIrDAd is shared by all sir_dev devices so we better don't sleep there too
98 * long. Instead, for longer delays we start a timer to reschedule us later.
99 * On entry, fsm->sem is always locked and the netdev xmit queue stopped.
100 * Both must be unlocked/restarted on completion - but only on final exit.
101 */
102
103static void sirdev_config_fsm(void *data)
104{
105 struct sir_dev *dev = data;
106 struct sir_fsm *fsm = &dev->fsm;
107 int next_state;
108 int ret = -1;
109 unsigned delay;
110
111 IRDA_DEBUG(2, "%s(), <%ld>\n", __FUNCTION__, jiffies);
112
113 do {
114 IRDA_DEBUG(3, "%s - state=0x%04x / substate=0x%04x\n",
115 __FUNCTION__, fsm->state, fsm->substate);
116
117 next_state = fsm->state;
118 delay = 0;
119
120 switch(fsm->state) {
121
122 case SIRDEV_STATE_DONGLE_OPEN:
123 if (dev->dongle_drv != NULL) {
124 ret = sirdev_put_dongle(dev);
125 if (ret) {
126 fsm->result = -EINVAL;
127 next_state = SIRDEV_STATE_ERROR;
128 break;
129 }
130 }
131
132 /* Initialize dongle */
133 ret = sirdev_get_dongle(dev, fsm->param);
134 if (ret) {
135 fsm->result = ret;
136 next_state = SIRDEV_STATE_ERROR;
137 break;
138 }
139
140 /* Dongles are powered through the modem control lines which
141 * were just set during open. Before resetting, let's wait for
142 * the power to stabilize. This is what some dongle drivers did
143 * in open before, while others didn't - should be safe anyway.
144 */
145
146 delay = 50;
147 fsm->substate = SIRDEV_STATE_DONGLE_RESET;
148 next_state = SIRDEV_STATE_DONGLE_RESET;
149
150 fsm->param = 9600;
151
152 break;
153
154 case SIRDEV_STATE_DONGLE_CLOSE:
155 /* shouldn't we just treat this as success=? */
156 if (dev->dongle_drv == NULL) {
157 fsm->result = -EINVAL;
158 next_state = SIRDEV_STATE_ERROR;
159 break;
160 }
161
162 ret = sirdev_put_dongle(dev);
163 if (ret) {
164 fsm->result = ret;
165 next_state = SIRDEV_STATE_ERROR;
166 break;
167 }
168 next_state = SIRDEV_STATE_DONE;
169 break;
170
171 case SIRDEV_STATE_SET_DTR_RTS:
172 ret = sirdev_set_dtr_rts(dev,
173 (fsm->param&0x02) ? TRUE : FALSE,
174 (fsm->param&0x01) ? TRUE : FALSE);
175 next_state = SIRDEV_STATE_DONE;
176 break;
177
178 case SIRDEV_STATE_SET_SPEED:
179 fsm->substate = SIRDEV_STATE_WAIT_XMIT;
180 next_state = SIRDEV_STATE_DONGLE_CHECK;
181 break;
182
183 case SIRDEV_STATE_DONGLE_CHECK:
184 ret = sirdev_tx_complete_fsm(dev);
185 if (ret < 0) {
186 fsm->result = ret;
187 next_state = SIRDEV_STATE_ERROR;
188 break;
189 }
190 if ((delay=ret) != 0)
191 break;
192
193 if (dev->dongle_drv) {
194 fsm->substate = SIRDEV_STATE_DONGLE_RESET;
195 next_state = SIRDEV_STATE_DONGLE_RESET;
196 }
197 else {
198 dev->speed = fsm->param;
199 next_state = SIRDEV_STATE_PORT_SPEED;
200 }
201 break;
202
203 case SIRDEV_STATE_DONGLE_RESET:
204 if (dev->dongle_drv->reset) {
205 ret = dev->dongle_drv->reset(dev);
206 if (ret < 0) {
207 fsm->result = ret;
208 next_state = SIRDEV_STATE_ERROR;
209 break;
210 }
211 }
212 else
213 ret = 0;
214 if ((delay=ret) == 0) {
215 /* set serial port according to dongle default speed */
216 if (dev->drv->set_speed)
217 dev->drv->set_speed(dev, dev->speed);
218 fsm->substate = SIRDEV_STATE_DONGLE_SPEED;
219 next_state = SIRDEV_STATE_DONGLE_SPEED;
220 }
221 break;
222
223 case SIRDEV_STATE_DONGLE_SPEED:
224 if (dev->dongle_drv->reset) {
225 ret = dev->dongle_drv->set_speed(dev, fsm->param);
226 if (ret < 0) {
227 fsm->result = ret;
228 next_state = SIRDEV_STATE_ERROR;
229 break;
230 }
231 }
232 else
233 ret = 0;
234 if ((delay=ret) == 0)
235 next_state = SIRDEV_STATE_PORT_SPEED;
236 break;
237
238 case SIRDEV_STATE_PORT_SPEED:
239 /* Finally we are ready to change the serial port speed */
240 if (dev->drv->set_speed)
241 dev->drv->set_speed(dev, dev->speed);
242 dev->new_speed = 0;
243 next_state = SIRDEV_STATE_DONE;
244 break;
245
246 case SIRDEV_STATE_DONE:
247 /* Signal network layer so it can send more frames */
248 netif_wake_queue(dev->netdev);
249 next_state = SIRDEV_STATE_COMPLETE;
250 break;
251
252 default:
253 IRDA_ERROR("%s - undefined state\n", __FUNCTION__);
254 fsm->result = -EINVAL;
255 /* fall thru */
256
257 case SIRDEV_STATE_ERROR:
258 IRDA_ERROR("%s - error: %d\n", __FUNCTION__, fsm->result);
259
260#if 0 /* don't enable this before we have netdev->tx_timeout to recover */
261 netif_stop_queue(dev->netdev);
262#else
263 netif_wake_queue(dev->netdev);
264#endif
265 /* fall thru */
266
267 case SIRDEV_STATE_COMPLETE:
268 /* config change finished, so we are not busy any longer */
269 sirdev_enable_rx(dev);
270 up(&fsm->sem);
271 return;
272 }
273 fsm->state = next_state;
274 } while(!delay);
275
276 queue_delayed_work(irda_sir_wq, &fsm->work, msecs_to_jiffies(delay));
277}
278
279/* schedule some device configuration task for execution by kIrDAd
280 * on behalf of the above state machine.
281 * can be called from process or interrupt/tasklet context.
282 */
283
284int sirdev_schedule_request(struct sir_dev *dev, int initial_state, unsigned param)
285{
286 struct sir_fsm *fsm = &dev->fsm;
287
288 IRDA_DEBUG(2, "%s - state=0x%04x / param=%u\n", __FUNCTION__, initial_state, param);
289
290 if (down_trylock(&fsm->sem)) {
291 if (in_interrupt() || in_atomic() || irqs_disabled()) {
292 IRDA_DEBUG(1, "%s(), state machine busy!\n", __FUNCTION__);
293 return -EWOULDBLOCK;
294 } else
295 down(&fsm->sem);
296 }
297
298 if (fsm->state == SIRDEV_STATE_DEAD) {
299 /* race with sirdev_close should never happen */
300 IRDA_ERROR("%s(), instance staled!\n", __FUNCTION__);
301 up(&fsm->sem);
302 return -ESTALE; /* or better EPIPE? */
303 }
304
305 netif_stop_queue(dev->netdev);
306 atomic_set(&dev->enable_rx, 0);
307
308 fsm->state = initial_state;
309 fsm->param = param;
310 fsm->result = 0;
311
312 INIT_WORK(&fsm->work, sirdev_config_fsm, dev);
313 queue_work(irda_sir_wq, &fsm->work);
314 return 0;
315}
316
317
26/***************************************************************************/ 318/***************************************************************************/
27 319
28void sirdev_enable_rx(struct sir_dev *dev) 320void sirdev_enable_rx(struct sir_dev *dev)
@@ -619,10 +911,6 @@ struct sir_dev * sirdev_get_instance(const struct sir_driver *drv, const char *n
619 spin_lock_init(&dev->tx_lock); 911 spin_lock_init(&dev->tx_lock);
620 init_MUTEX(&dev->fsm.sem); 912 init_MUTEX(&dev->fsm.sem);
621 913
622 INIT_LIST_HEAD(&dev->fsm.rq.lh_request);
623 dev->fsm.rq.pending = 0;
624 init_timer(&dev->fsm.rq.timer);
625
626 dev->drv = drv; 914 dev->drv = drv;
627 dev->netdev = ndev; 915 dev->netdev = ndev;
628 916
@@ -682,3 +970,22 @@ int sirdev_put_instance(struct sir_dev *dev)
682} 970}
683EXPORT_SYMBOL(sirdev_put_instance); 971EXPORT_SYMBOL(sirdev_put_instance);
684 972
973static int __init sir_wq_init(void)
974{
975 irda_sir_wq = create_singlethread_workqueue("irda_sir_wq");
976 if (!irda_sir_wq)
977 return -ENOMEM;
978 return 0;
979}
980
981static void __exit sir_wq_exit(void)
982{
983 destroy_workqueue(irda_sir_wq);
984}
985
986module_init(sir_wq_init);
987module_exit(sir_wq_exit);
988
989MODULE_AUTHOR("Martin Diehl <info@mdiehl.de>");
990MODULE_DESCRIPTION("IrDA SIR core");
991MODULE_LICENSE("GPL");
diff --git a/drivers/net/irda/sir_kthread.c b/drivers/net/irda/sir_kthread.c
deleted file mode 100644
index e3904d6bfecd..000000000000
--- a/drivers/net/irda/sir_kthread.c
+++ /dev/null
@@ -1,508 +0,0 @@
1/*********************************************************************
2 *
3 * sir_kthread.c: dedicated thread to process scheduled
4 * sir device setup requests
5 *
6 * Copyright (c) 2002 Martin Diehl
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
12 *
13 ********************************************************************/
14
15#include <linux/module.h>
16#include <linux/kernel.h>
17#include <linux/version.h>
18#include <linux/init.h>
19#include <linux/smp_lock.h>
20#include <linux/completion.h>
21#include <linux/delay.h>
22
23#include <net/irda/irda.h>
24
25#include "sir-dev.h"
26
27/**************************************************************************
28 *
29 * kIrDAd kernel thread and config state machine
30 *
31 */
32
33struct irda_request_queue {
34 struct list_head request_list;
35 spinlock_t lock;
36 task_t *thread;
37 struct completion exit;
38 wait_queue_head_t kick, done;
39 atomic_t num_pending;
40};
41
42static struct irda_request_queue irda_rq_queue;
43
44static int irda_queue_request(struct irda_request *rq)
45{
46 int ret = 0;
47 unsigned long flags;
48
49 if (!test_and_set_bit(0, &rq->pending)) {
50 spin_lock_irqsave(&irda_rq_queue.lock, flags);
51 list_add_tail(&rq->lh_request, &irda_rq_queue.request_list);
52 wake_up(&irda_rq_queue.kick);
53 atomic_inc(&irda_rq_queue.num_pending);
54 spin_unlock_irqrestore(&irda_rq_queue.lock, flags);
55 ret = 1;
56 }
57 return ret;
58}
59
60static void irda_request_timer(unsigned long data)
61{
62 struct irda_request *rq = (struct irda_request *)data;
63 unsigned long flags;
64
65 spin_lock_irqsave(&irda_rq_queue.lock, flags);
66 list_add_tail(&rq->lh_request, &irda_rq_queue.request_list);
67 wake_up(&irda_rq_queue.kick);
68 spin_unlock_irqrestore(&irda_rq_queue.lock, flags);
69}
70
71static int irda_queue_delayed_request(struct irda_request *rq, unsigned long delay)
72{
73 int ret = 0;
74 struct timer_list *timer = &rq->timer;
75
76 if (!test_and_set_bit(0, &rq->pending)) {
77 timer->expires = jiffies + delay;
78 timer->function = irda_request_timer;
79 timer->data = (unsigned long)rq;
80 atomic_inc(&irda_rq_queue.num_pending);
81 add_timer(timer);
82 ret = 1;
83 }
84 return ret;
85}
86
87static void run_irda_queue(void)
88{
89 unsigned long flags;
90 struct list_head *entry, *tmp;
91 struct irda_request *rq;
92
93 spin_lock_irqsave(&irda_rq_queue.lock, flags);
94 list_for_each_safe(entry, tmp, &irda_rq_queue.request_list) {
95 rq = list_entry(entry, struct irda_request, lh_request);
96 list_del_init(entry);
97 spin_unlock_irqrestore(&irda_rq_queue.lock, flags);
98
99 clear_bit(0, &rq->pending);
100 rq->func(rq->data);
101
102 if (atomic_dec_and_test(&irda_rq_queue.num_pending))
103 wake_up(&irda_rq_queue.done);
104
105 spin_lock_irqsave(&irda_rq_queue.lock, flags);
106 }
107 spin_unlock_irqrestore(&irda_rq_queue.lock, flags);
108}
109
110static int irda_thread(void *startup)
111{
112 DECLARE_WAITQUEUE(wait, current);
113
114 daemonize("kIrDAd");
115
116 irda_rq_queue.thread = current;
117
118 complete((struct completion *)startup);
119
120 while (irda_rq_queue.thread != NULL) {
121
122 /* We use TASK_INTERRUPTIBLE, rather than
123 * TASK_UNINTERRUPTIBLE. Andrew Morton made this
124 * change ; he told me that it is safe, because "signal
125 * blocking is now handled in daemonize()", he added
126 * that the problem is that "uninterruptible sleep
127 * contributes to load average", making user worry.
128 * Jean II */
129 set_task_state(current, TASK_INTERRUPTIBLE);
130 add_wait_queue(&irda_rq_queue.kick, &wait);
131 if (list_empty(&irda_rq_queue.request_list))
132 schedule();
133 else
134 __set_task_state(current, TASK_RUNNING);
135 remove_wait_queue(&irda_rq_queue.kick, &wait);
136
137 /* make swsusp happy with our thread */
138 try_to_freeze();
139
140 run_irda_queue();
141 }
142
143#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,35)
144 reparent_to_init();
145#endif
146 complete_and_exit(&irda_rq_queue.exit, 0);
147 /* never reached */
148 return 0;
149}
150
151
152static void flush_irda_queue(void)
153{
154 if (atomic_read(&irda_rq_queue.num_pending)) {
155
156 DECLARE_WAITQUEUE(wait, current);
157
158 if (!list_empty(&irda_rq_queue.request_list))
159 run_irda_queue();
160
161 set_task_state(current, TASK_UNINTERRUPTIBLE);
162 add_wait_queue(&irda_rq_queue.done, &wait);
163 if (atomic_read(&irda_rq_queue.num_pending))
164 schedule();
165 else
166 __set_task_state(current, TASK_RUNNING);
167 remove_wait_queue(&irda_rq_queue.done, &wait);
168 }
169}
170
171/* substate handler of the config-fsm to handle the cases where we want
172 * to wait for transmit completion before changing the port configuration
173 */
174
175static int irda_tx_complete_fsm(struct sir_dev *dev)
176{
177 struct sir_fsm *fsm = &dev->fsm;
178 unsigned next_state, delay;
179 unsigned bytes_left;
180
181 do {
182 next_state = fsm->substate; /* default: stay in current substate */
183 delay = 0;
184
185 switch(fsm->substate) {
186
187 case SIRDEV_STATE_WAIT_XMIT:
188 if (dev->drv->chars_in_buffer)
189 bytes_left = dev->drv->chars_in_buffer(dev);
190 else
191 bytes_left = 0;
192 if (!bytes_left) {
193 next_state = SIRDEV_STATE_WAIT_UNTIL_SENT;
194 break;
195 }
196
197 if (dev->speed > 115200)
198 delay = (bytes_left*8*10000) / (dev->speed/100);
199 else if (dev->speed > 0)
200 delay = (bytes_left*10*10000) / (dev->speed/100);
201 else
202 delay = 0;
203 /* expected delay (usec) until remaining bytes are sent */
204 if (delay < 100) {
205 udelay(delay);
206 delay = 0;
207 break;
208 }
209 /* sleep some longer delay (msec) */
210 delay = (delay+999) / 1000;
211 break;
212
213 case SIRDEV_STATE_WAIT_UNTIL_SENT:
214 /* block until underlaying hardware buffer are empty */
215 if (dev->drv->wait_until_sent)
216 dev->drv->wait_until_sent(dev);
217 next_state = SIRDEV_STATE_TX_DONE;
218 break;
219
220 case SIRDEV_STATE_TX_DONE:
221 return 0;
222
223 default:
224 IRDA_ERROR("%s - undefined state\n", __FUNCTION__);
225 return -EINVAL;
226 }
227 fsm->substate = next_state;
228 } while (delay == 0);
229 return delay;
230}
231
232/*
233 * Function irda_config_fsm
234 *
235 * State machine to handle the configuration of the device (and attached dongle, if any).
236 * This handler is scheduled for execution in kIrDAd context, so we can sleep.
237 * however, kIrDAd is shared by all sir_dev devices so we better don't sleep there too
238 * long. Instead, for longer delays we start a timer to reschedule us later.
239 * On entry, fsm->sem is always locked and the netdev xmit queue stopped.
240 * Both must be unlocked/restarted on completion - but only on final exit.
241 */
242
243static void irda_config_fsm(void *data)
244{
245 struct sir_dev *dev = data;
246 struct sir_fsm *fsm = &dev->fsm;
247 int next_state;
248 int ret = -1;
249 unsigned delay;
250
251 IRDA_DEBUG(2, "%s(), <%ld>\n", __FUNCTION__, jiffies);
252
253 do {
254 IRDA_DEBUG(3, "%s - state=0x%04x / substate=0x%04x\n",
255 __FUNCTION__, fsm->state, fsm->substate);
256
257 next_state = fsm->state;
258 delay = 0;
259
260 switch(fsm->state) {
261
262 case SIRDEV_STATE_DONGLE_OPEN:
263 if (dev->dongle_drv != NULL) {
264 ret = sirdev_put_dongle(dev);
265 if (ret) {
266 fsm->result = -EINVAL;
267 next_state = SIRDEV_STATE_ERROR;
268 break;
269 }
270 }
271
272 /* Initialize dongle */
273 ret = sirdev_get_dongle(dev, fsm->param);
274 if (ret) {
275 fsm->result = ret;
276 next_state = SIRDEV_STATE_ERROR;
277 break;
278 }
279
280 /* Dongles are powered through the modem control lines which
281 * were just set during open. Before resetting, let's wait for
282 * the power to stabilize. This is what some dongle drivers did
283 * in open before, while others didn't - should be safe anyway.
284 */
285
286 delay = 50;
287 fsm->substate = SIRDEV_STATE_DONGLE_RESET;
288 next_state = SIRDEV_STATE_DONGLE_RESET;
289
290 fsm->param = 9600;
291
292 break;
293
294 case SIRDEV_STATE_DONGLE_CLOSE:
295 /* shouldn't we just treat this as success=? */
296 if (dev->dongle_drv == NULL) {
297 fsm->result = -EINVAL;
298 next_state = SIRDEV_STATE_ERROR;
299 break;
300 }
301
302 ret = sirdev_put_dongle(dev);
303 if (ret) {
304 fsm->result = ret;
305 next_state = SIRDEV_STATE_ERROR;
306 break;
307 }
308 next_state = SIRDEV_STATE_DONE;
309 break;
310
311 case SIRDEV_STATE_SET_DTR_RTS:
312 ret = sirdev_set_dtr_rts(dev,
313 (fsm->param&0x02) ? TRUE : FALSE,
314 (fsm->param&0x01) ? TRUE : FALSE);
315 next_state = SIRDEV_STATE_DONE;
316 break;
317
318 case SIRDEV_STATE_SET_SPEED:
319 fsm->substate = SIRDEV_STATE_WAIT_XMIT;
320 next_state = SIRDEV_STATE_DONGLE_CHECK;
321 break;
322
323 case SIRDEV_STATE_DONGLE_CHECK:
324 ret = irda_tx_complete_fsm(dev);
325 if (ret < 0) {
326 fsm->result = ret;
327 next_state = SIRDEV_STATE_ERROR;
328 break;
329 }
330 if ((delay=ret) != 0)
331 break;
332
333 if (dev->dongle_drv) {
334 fsm->substate = SIRDEV_STATE_DONGLE_RESET;
335 next_state = SIRDEV_STATE_DONGLE_RESET;
336 }
337 else {
338 dev->speed = fsm->param;
339 next_state = SIRDEV_STATE_PORT_SPEED;
340 }
341 break;
342
343 case SIRDEV_STATE_DONGLE_RESET:
344 if (dev->dongle_drv->reset) {
345 ret = dev->dongle_drv->reset(dev);
346 if (ret < 0) {
347 fsm->result = ret;
348 next_state = SIRDEV_STATE_ERROR;
349 break;
350 }
351 }
352 else
353 ret = 0;
354 if ((delay=ret) == 0) {
355 /* set serial port according to dongle default speed */
356 if (dev->drv->set_speed)
357 dev->drv->set_speed(dev, dev->speed);
358 fsm->substate = SIRDEV_STATE_DONGLE_SPEED;
359 next_state = SIRDEV_STATE_DONGLE_SPEED;
360 }
361 break;
362
363 case SIRDEV_STATE_DONGLE_SPEED:
364 if (dev->dongle_drv->reset) {
365 ret = dev->dongle_drv->set_speed(dev, fsm->param);
366 if (ret < 0) {
367 fsm->result = ret;
368 next_state = SIRDEV_STATE_ERROR;
369 break;
370 }
371 }
372 else
373 ret = 0;
374 if ((delay=ret) == 0)
375 next_state = SIRDEV_STATE_PORT_SPEED;
376 break;
377
378 case SIRDEV_STATE_PORT_SPEED:
379 /* Finally we are ready to change the serial port speed */
380 if (dev->drv->set_speed)
381 dev->drv->set_speed(dev, dev->speed);
382 dev->new_speed = 0;
383 next_state = SIRDEV_STATE_DONE;
384 break;
385
386 case SIRDEV_STATE_DONE:
387 /* Signal network layer so it can send more frames */
388 netif_wake_queue(dev->netdev);
389 next_state = SIRDEV_STATE_COMPLETE;
390 break;
391
392 default:
393 IRDA_ERROR("%s - undefined state\n", __FUNCTION__);
394 fsm->result = -EINVAL;
395 /* fall thru */
396
397 case SIRDEV_STATE_ERROR:
398 IRDA_ERROR("%s - error: %d\n", __FUNCTION__, fsm->result);
399
400#if 0 /* don't enable this before we have netdev->tx_timeout to recover */
401 netif_stop_queue(dev->netdev);
402#else
403 netif_wake_queue(dev->netdev);
404#endif
405 /* fall thru */
406
407 case SIRDEV_STATE_COMPLETE:
408 /* config change finished, so we are not busy any longer */
409 sirdev_enable_rx(dev);
410 up(&fsm->sem);
411 return;
412 }
413 fsm->state = next_state;
414 } while(!delay);
415
416 irda_queue_delayed_request(&fsm->rq, msecs_to_jiffies(delay));
417}
418
419/* schedule some device configuration task for execution by kIrDAd
420 * on behalf of the above state machine.
421 * can be called from process or interrupt/tasklet context.
422 */
423
424int sirdev_schedule_request(struct sir_dev *dev, int initial_state, unsigned param)
425{
426 struct sir_fsm *fsm = &dev->fsm;
427 int xmit_was_down;
428
429 IRDA_DEBUG(2, "%s - state=0x%04x / param=%u\n", __FUNCTION__, initial_state, param);
430
431 if (down_trylock(&fsm->sem)) {
432 if (in_interrupt() || in_atomic() || irqs_disabled()) {
433 IRDA_DEBUG(1, "%s(), state machine busy!\n", __FUNCTION__);
434 return -EWOULDBLOCK;
435 } else
436 down(&fsm->sem);
437 }
438
439 if (fsm->state == SIRDEV_STATE_DEAD) {
440 /* race with sirdev_close should never happen */
441 IRDA_ERROR("%s(), instance staled!\n", __FUNCTION__);
442 up(&fsm->sem);
443 return -ESTALE; /* or better EPIPE? */
444 }
445
446 xmit_was_down = netif_queue_stopped(dev->netdev);
447 netif_stop_queue(dev->netdev);
448 atomic_set(&dev->enable_rx, 0);
449
450 fsm->state = initial_state;
451 fsm->param = param;
452 fsm->result = 0;
453
454 INIT_LIST_HEAD(&fsm->rq.lh_request);
455 fsm->rq.pending = 0;
456 fsm->rq.func = irda_config_fsm;
457 fsm->rq.data = dev;
458
459 if (!irda_queue_request(&fsm->rq)) { /* returns 0 on error! */
460 atomic_set(&dev->enable_rx, 1);
461 if (!xmit_was_down)
462 netif_wake_queue(dev->netdev);
463 up(&fsm->sem);
464 return -EAGAIN;
465 }
466 return 0;
467}
468
469static int __init irda_thread_create(void)
470{
471 struct completion startup;
472 int pid;
473
474 spin_lock_init(&irda_rq_queue.lock);
475 irda_rq_queue.thread = NULL;
476 INIT_LIST_HEAD(&irda_rq_queue.request_list);
477 init_waitqueue_head(&irda_rq_queue.kick);
478 init_waitqueue_head(&irda_rq_queue.done);
479 atomic_set(&irda_rq_queue.num_pending, 0);
480
481 init_completion(&startup);
482 pid = kernel_thread(irda_thread, &startup, CLONE_FS|CLONE_FILES);
483 if (pid <= 0)
484 return -EAGAIN;
485 else
486 wait_for_completion(&startup);
487
488 return 0;
489}
490
491static void __exit irda_thread_join(void)
492{
493 if (irda_rq_queue.thread) {
494 flush_irda_queue();
495 init_completion(&irda_rq_queue.exit);
496 irda_rq_queue.thread = NULL;
497 wake_up(&irda_rq_queue.kick);
498 wait_for_completion(&irda_rq_queue.exit);
499 }
500}
501
502module_init(irda_thread_create);
503module_exit(irda_thread_join);
504
505MODULE_AUTHOR("Martin Diehl <info@mdiehl.de>");
506MODULE_DESCRIPTION("IrDA SIR core");
507MODULE_LICENSE("GPL");
508
diff --git a/drivers/net/irda/smsc-ircc2.c b/drivers/net/irda/smsc-ircc2.c
index bbcfc8ec35a1..a4674044bd6f 100644
--- a/drivers/net/irda/smsc-ircc2.c
+++ b/drivers/net/irda/smsc-ircc2.c
@@ -54,6 +54,7 @@
54#include <linux/rtnetlink.h> 54#include <linux/rtnetlink.h>
55#include <linux/serial_reg.h> 55#include <linux/serial_reg.h>
56#include <linux/dma-mapping.h> 56#include <linux/dma-mapping.h>
57#include <linux/pnp.h>
57#include <linux/platform_device.h> 58#include <linux/platform_device.h>
58 59
59#include <asm/io.h> 60#include <asm/io.h>
@@ -225,6 +226,8 @@ static int __init smsc_superio_lpc(unsigned short cfg_base);
225#ifdef CONFIG_PCI 226#ifdef CONFIG_PCI
226static int __init preconfigure_smsc_chip(struct smsc_ircc_subsystem_configuration *conf); 227static int __init preconfigure_smsc_chip(struct smsc_ircc_subsystem_configuration *conf);
227static int __init preconfigure_through_82801(struct pci_dev *dev, struct smsc_ircc_subsystem_configuration *conf); 228static int __init preconfigure_through_82801(struct pci_dev *dev, struct smsc_ircc_subsystem_configuration *conf);
229static void __init preconfigure_ali_port(struct pci_dev *dev,
230 unsigned short port);
228static int __init preconfigure_through_ali(struct pci_dev *dev, struct smsc_ircc_subsystem_configuration *conf); 231static int __init preconfigure_through_ali(struct pci_dev *dev, struct smsc_ircc_subsystem_configuration *conf);
229static int __init smsc_ircc_preconfigure_subsystems(unsigned short ircc_cfg, 232static int __init smsc_ircc_preconfigure_subsystems(unsigned short ircc_cfg,
230 unsigned short ircc_fir, 233 unsigned short ircc_fir,
@@ -356,6 +359,16 @@ static inline void register_bank(int iobase, int bank)
356 iobase + IRCC_MASTER); 359 iobase + IRCC_MASTER);
357} 360}
358 361
362#ifdef CONFIG_PNP
363/* PNP hotplug support */
364static const struct pnp_device_id smsc_ircc_pnp_table[] = {
365 { .id = "SMCf010", .driver_data = 0 },
366 /* and presumably others */
367 { }
368};
369MODULE_DEVICE_TABLE(pnp, smsc_ircc_pnp_table);
370#endif
371
359 372
360/******************************************************************************* 373/*******************************************************************************
361 * 374 *
@@ -2070,7 +2083,8 @@ static void smsc_ircc_sir_wait_hw_transmitter_finish(struct smsc_ircc_cb *self)
2070 2083
2071/* PROBING 2084/* PROBING
2072 * 2085 *
2073 * 2086 * REVISIT we can be told about the device by PNP, and should use that info
2087 * instead of probing hardware and creating a platform_device ...
2074 */ 2088 */
2075 2089
2076static int __init smsc_ircc_look_for_chips(void) 2090static int __init smsc_ircc_look_for_chips(void)
@@ -2327,9 +2341,14 @@ static int __init smsc_superio_lpc(unsigned short cfg_base)
2327 * pre-configuration not properly done by the BIOS (especially laptops) 2341 * pre-configuration not properly done by the BIOS (especially laptops)
2328 * This code is based in part on smcinit.c, tosh1800-smcinit.c 2342 * This code is based in part on smcinit.c, tosh1800-smcinit.c
2329 * and tosh2450-smcinit.c. The table lists the device entries 2343 * and tosh2450-smcinit.c. The table lists the device entries
2330 * for ISA bridges with an LPC (Local Peripheral Configurator) 2344 * for ISA bridges with an LPC (Low Pin Count) controller which
2331 * that are in turn used to configure the SMSC device with default 2345 * handles the communication with the SMSC device. After the LPC
2332 * SIR and FIR I/O ports, DMA and IRQ. 2346 * controller is initialized through PCI, the SMSC device is initialized
2347 * through a dedicated port in the ISA port-mapped I/O area, this latter
2348 * area is used to configure the SMSC device with default
2349 * SIR and FIR I/O ports, DMA and IRQ. Different vendors have
2350 * used different sets of parameters and different control port
2351 * addresses making a subsystem device table necessary.
2333 */ 2352 */
2334#ifdef CONFIG_PCI 2353#ifdef CONFIG_PCI
2335#define PCIID_VENDOR_INTEL 0x8086 2354#define PCIID_VENDOR_INTEL 0x8086
@@ -2340,9 +2359,10 @@ static struct smsc_ircc_subsystem_configuration subsystem_configurations[] __dev
2340 .device = 0x24cc, 2359 .device = 0x24cc,
2341 .subvendor = 0x103c, 2360 .subvendor = 0x103c,
2342 .subdevice = 0x088c, 2361 .subdevice = 0x088c,
2343 .sir_io = 0x02f8, /* Quite certain these are the same for nc8000 as for nc6000 */ 2362 /* Quite certain these are the same for nc8000 as for nc6000 */
2363 .sir_io = 0x02f8,
2344 .fir_io = 0x0130, 2364 .fir_io = 0x0130,
2345 .fir_irq = 0x09, 2365 .fir_irq = 0x05,
2346 .fir_dma = 0x03, 2366 .fir_dma = 0x03,
2347 .cfg_base = 0x004e, 2367 .cfg_base = 0x004e,
2348 .preconfigure = preconfigure_through_82801, 2368 .preconfigure = preconfigure_through_82801,
@@ -2355,60 +2375,79 @@ static struct smsc_ircc_subsystem_configuration subsystem_configurations[] __dev
2355 .subdevice = 0x0890, 2375 .subdevice = 0x0890,
2356 .sir_io = 0x02f8, 2376 .sir_io = 0x02f8,
2357 .fir_io = 0x0130, 2377 .fir_io = 0x0130,
2358 .fir_irq = 0x09, 2378 .fir_irq = 0x05,
2359 .fir_dma = 0x03, 2379 .fir_dma = 0x03,
2360 .cfg_base = 0x004e, 2380 .cfg_base = 0x004e,
2361 .preconfigure = preconfigure_through_82801, 2381 .preconfigure = preconfigure_through_82801,
2362 .name = "HP nc6000", 2382 .name = "HP nc6000",
2363 }, 2383 },
2364 { 2384 {
2365 .vendor = PCIID_VENDOR_INTEL, /* Intel 82801DB/DBL (ICH4/ICH4-L) LPC Interface Bridge */ 2385 /* Intel 82801DB/DBL (ICH4/ICH4-L) LPC Interface Bridge */
2386 .vendor = PCIID_VENDOR_INTEL,
2366 .device = 0x24c0, 2387 .device = 0x24c0,
2367 .subvendor = 0x1179, 2388 .subvendor = 0x1179,
2368 .subdevice = 0xffff, /* 0xffff is "any", Not sure, 0x0001 or 0x0002 */ 2389 .subdevice = 0xffff, /* 0xffff is "any" */
2369 .sir_io = 0x03f8, 2390 .sir_io = 0x03f8,
2370 .fir_io = 0x0130, 2391 .fir_io = 0x0130,
2371 .fir_irq = 0x07, 2392 .fir_irq = 0x07,
2372 .fir_dma = 0x01, 2393 .fir_dma = 0x01,
2373 .cfg_base = 0x002e, 2394 .cfg_base = 0x002e,
2374 .preconfigure = preconfigure_through_82801, 2395 .preconfigure = preconfigure_through_82801,
2375 .name = "Toshiba Satellite 2450", 2396 .name = "Toshiba laptop with Intel 82801DB/DBL LPC bridge",
2376 }, 2397 },
2377 { 2398 {
2378 .vendor = PCIID_VENDOR_INTEL, /* Intel 82801CAM ISA bridge */ 2399 .vendor = PCIID_VENDOR_INTEL, /* Intel 82801CAM ISA bridge */
2379 .device = 0x248c, /* Some use 24cc? */ 2400 .device = 0x248c,
2401 .subvendor = 0x1179,
2402 .subdevice = 0xffff, /* 0xffff is "any" */
2403 .sir_io = 0x03f8,
2404 .fir_io = 0x0130,
2405 .fir_irq = 0x03,
2406 .fir_dma = 0x03,
2407 .cfg_base = 0x002e,
2408 .preconfigure = preconfigure_through_82801,
2409 .name = "Toshiba laptop with Intel 82801CAM ISA bridge",
2410 },
2411 {
2412 /* 82801DBM (ICH4-M) LPC Interface Bridge */
2413 .vendor = PCIID_VENDOR_INTEL,
2414 .device = 0x24cc,
2380 .subvendor = 0x1179, 2415 .subvendor = 0x1179,
2381 .subdevice = 0xffff, /* 0xffff is "any", Not sure, 0x0001 or 0x0002 */ 2416 .subdevice = 0xffff, /* 0xffff is "any" */
2382 .sir_io = 0x03f8, 2417 .sir_io = 0x03f8,
2383 .fir_io = 0x0130, 2418 .fir_io = 0x0130,
2384 .fir_irq = 0x03, 2419 .fir_irq = 0x03,
2385 .fir_dma = 0x03, 2420 .fir_dma = 0x03,
2386 .cfg_base = 0x002e, 2421 .cfg_base = 0x002e,
2387 .preconfigure = preconfigure_through_82801, 2422 .preconfigure = preconfigure_through_82801,
2388 .name = "Toshiba Satellite 5100/5200, Tecra 9100", 2423 .name = "Toshiba laptop with Intel 8281DBM LPC bridge",
2389 }, 2424 },
2390 { 2425 {
2391 .vendor = PCIID_VENDOR_ALI, /* ALi M1533/M1535 PCI to ISA Bridge [Aladdin IV/V/V+] */ 2426 /* ALi M1533/M1535 PCI to ISA Bridge [Aladdin IV/V/V+] */
2427 .vendor = PCIID_VENDOR_ALI,
2392 .device = 0x1533, 2428 .device = 0x1533,
2393 .subvendor = 0x1179, 2429 .subvendor = 0x1179,
2394 .subdevice = 0xffff, /* 0xffff is "any", Not sure, 0x0001 or 0x0002 */ 2430 .subdevice = 0xffff, /* 0xffff is "any" */
2395 .sir_io = 0x02e8, 2431 .sir_io = 0x02e8,
2396 .fir_io = 0x02f8, 2432 .fir_io = 0x02f8,
2397 .fir_irq = 0x07, 2433 .fir_irq = 0x07,
2398 .fir_dma = 0x03, 2434 .fir_dma = 0x03,
2399 .cfg_base = 0x002e, 2435 .cfg_base = 0x002e,
2400 .preconfigure = preconfigure_through_ali, 2436 .preconfigure = preconfigure_through_ali,
2401 .name = "Toshiba Satellite 1800", 2437 .name = "Toshiba laptop with ALi ISA bridge",
2402 }, 2438 },
2403 { } // Terminator 2439 { } // Terminator
2404}; 2440};
2405 2441
2406 2442
2407/* 2443/*
2408 * This sets up the basic SMSC parameters (FIR port, SIR port, FIR DMA, FIR IRQ) 2444 * This sets up the basic SMSC parameters
2445 * (FIR port, SIR port, FIR DMA, FIR IRQ)
2409 * through the chip configuration port. 2446 * through the chip configuration port.
2410 */ 2447 */
2411static int __init preconfigure_smsc_chip(struct smsc_ircc_subsystem_configuration *conf) 2448static int __init preconfigure_smsc_chip(struct
2449 smsc_ircc_subsystem_configuration
2450 *conf)
2412{ 2451{
2413 unsigned short iobase = conf->cfg_base; 2452 unsigned short iobase = conf->cfg_base;
2414 unsigned char tmpbyte; 2453 unsigned char tmpbyte;
@@ -2416,7 +2455,9 @@ static int __init preconfigure_smsc_chip(struct smsc_ircc_subsystem_configuratio
2416 outb(LPC47N227_CFGACCESSKEY, iobase); // enter configuration state 2455 outb(LPC47N227_CFGACCESSKEY, iobase); // enter configuration state
2417 outb(SMSCSIOFLAT_DEVICEID_REG, iobase); // set for device ID 2456 outb(SMSCSIOFLAT_DEVICEID_REG, iobase); // set for device ID
2418 tmpbyte = inb(iobase +1); // Read device ID 2457 tmpbyte = inb(iobase +1); // Read device ID
2419 IRDA_DEBUG(0, "Detected Chip id: 0x%02x, setting up registers...\n",tmpbyte); 2458 IRDA_DEBUG(0,
2459 "Detected Chip id: 0x%02x, setting up registers...\n",
2460 tmpbyte);
2420 2461
2421 /* Disable UART1 and set up SIR I/O port */ 2462 /* Disable UART1 and set up SIR I/O port */
2422 outb(0x24, iobase); // select CR24 - UART1 base addr 2463 outb(0x24, iobase); // select CR24 - UART1 base addr
@@ -2426,6 +2467,7 @@ static int __init preconfigure_smsc_chip(struct smsc_ircc_subsystem_configuratio
2426 tmpbyte = inb(iobase + 1); 2467 tmpbyte = inb(iobase + 1);
2427 if (tmpbyte != (conf->sir_io >> 2) ) { 2468 if (tmpbyte != (conf->sir_io >> 2) ) {
2428 IRDA_WARNING("ERROR: could not configure SIR ioport.\n"); 2469 IRDA_WARNING("ERROR: could not configure SIR ioport.\n");
2470 IRDA_WARNING("Try to supply ircc_cfg argument.\n");
2429 return -ENXIO; 2471 return -ENXIO;
2430 } 2472 }
2431 2473
@@ -2461,7 +2503,8 @@ static int __init preconfigure_smsc_chip(struct smsc_ircc_subsystem_configuratio
2461 2503
2462 outb(SMSCSIOFLAT_UARTMODE0C_REG, iobase); // CR0C - UART mode 2504 outb(SMSCSIOFLAT_UARTMODE0C_REG, iobase); // CR0C - UART mode
2463 tmpbyte = inb(iobase + 1); 2505 tmpbyte = inb(iobase + 1);
2464 tmpbyte &= ~SMSCSIOFLAT_UART2MODE_MASK | SMSCSIOFLAT_UART2MODE_VAL_IRDA; 2506 tmpbyte &= ~SMSCSIOFLAT_UART2MODE_MASK |
2507 SMSCSIOFLAT_UART2MODE_VAL_IRDA;
2465 outb(tmpbyte, iobase + 1); // enable IrDA (HPSIR) mode, high speed 2508 outb(tmpbyte, iobase + 1); // enable IrDA (HPSIR) mode, high speed
2466 2509
2467 outb(LPC47N227_APMBOOTDRIVE_REG, iobase); // CR07 - Auto Pwr Mgt/boot drive sel 2510 outb(LPC47N227_APMBOOTDRIVE_REG, iobase); // CR07 - Auto Pwr Mgt/boot drive sel
@@ -2486,53 +2529,226 @@ static int __init preconfigure_smsc_chip(struct smsc_ircc_subsystem_configuratio
2486 return 0; 2529 return 0;
2487} 2530}
2488 2531
2489/* 82801CAM registers */ 2532/* 82801CAM generic registers */
2490#define VID 0x00 2533#define VID 0x00
2491#define DID 0x02 2534#define DID 0x02
2492#define PIRQA_ROUT 0x60 2535#define PIRQ_A_D_ROUT 0x60
2536#define SIRQ_CNTL 0x64
2537#define PIRQ_E_H_ROUT 0x68
2493#define PCI_DMA_C 0x90 2538#define PCI_DMA_C 0x90
2539/* LPC-specific registers */
2494#define COM_DEC 0xe0 2540#define COM_DEC 0xe0
2541#define GEN1_DEC 0xe4
2495#define LPC_EN 0xe6 2542#define LPC_EN 0xe6
2496#define GEN2_DEC 0xec 2543#define GEN2_DEC 0xec
2497/* 2544/*
2498 * Sets up the I/O range using the 82801CAM ISA bridge, 82801DBM LPC bridge or 2545 * Sets up the I/O range using the 82801CAM ISA bridge, 82801DBM LPC bridge
2499 * Intel 82801DB/DBL (ICH4/ICH4-L) LPC Interface Bridge. They all work the same way! 2546 * or Intel 82801DB/DBL (ICH4/ICH4-L) LPC Interface Bridge.
2547 * They all work the same way!
2500 */ 2548 */
2501static int __init preconfigure_through_82801(struct pci_dev *dev, 2549static int __init preconfigure_through_82801(struct pci_dev *dev,
2502 struct smsc_ircc_subsystem_configuration *conf) 2550 struct
2551 smsc_ircc_subsystem_configuration
2552 *conf)
2503{ 2553{
2504 unsigned short tmpword; 2554 unsigned short tmpword;
2505 int ret; 2555 unsigned char tmpbyte;
2506 2556
2507 IRDA_MESSAGE("Setting up the SMSC device via the 82801 controller.\n"); 2557 IRDA_MESSAGE("Setting up Intel 82801 controller and SMSC device\n");
2508 pci_write_config_byte(dev, COM_DEC, 0x10); 2558 /*
2559 * Select the range for the COMA COM port (SIR)
2560 * Register COM_DEC:
2561 * Bit 7: reserved
2562 * Bit 6-4, COMB decode range
2563 * Bit 3: reserved
2564 * Bit 2-0, COMA decode range
2565 *
2566 * Decode ranges:
2567 * 000 = 0x3f8-0x3ff (COM1)
2568 * 001 = 0x2f8-0x2ff (COM2)
2569 * 010 = 0x220-0x227
2570 * 011 = 0x228-0x22f
2571 * 100 = 0x238-0x23f
2572 * 101 = 0x2e8-0x2ef (COM4)
2573 * 110 = 0x338-0x33f
2574 * 111 = 0x3e8-0x3ef (COM3)
2575 */
2576 pci_read_config_byte(dev, COM_DEC, &tmpbyte);
2577 tmpbyte &= 0xf8; /* mask COMA bits */
2578 switch(conf->sir_io) {
2579 case 0x3f8:
2580 tmpbyte |= 0x00;
2581 break;
2582 case 0x2f8:
2583 tmpbyte |= 0x01;
2584 break;
2585 case 0x220:
2586 tmpbyte |= 0x02;
2587 break;
2588 case 0x228:
2589 tmpbyte |= 0x03;
2590 break;
2591 case 0x238:
2592 tmpbyte |= 0x04;
2593 break;
2594 case 0x2e8:
2595 tmpbyte |= 0x05;
2596 break;
2597 case 0x338:
2598 tmpbyte |= 0x06;
2599 break;
2600 case 0x3e8:
2601 tmpbyte |= 0x07;
2602 break;
2603 default:
2604 tmpbyte |= 0x01; /* COM2 default */
2605 }
2606 IRDA_DEBUG(1, "COM_DEC (write): 0x%02x\n", tmpbyte);
2607 pci_write_config_byte(dev, COM_DEC, tmpbyte);
2509 2608
2510 /* Enable LPC */ 2609 /* Enable Low Pin Count interface */
2511 pci_read_config_word(dev, LPC_EN, &tmpword); /* LPC_EN register */ 2610 pci_read_config_word(dev, LPC_EN, &tmpword);
2512 tmpword &= 0xfffd; /* mask bit 1 */ 2611 /* These seem to be set up at all times,
2513 tmpword |= 0x0001; /* set bit 0 : COMA addr range enable */ 2612 * just make sure it is properly set.
2613 */
2614 switch(conf->cfg_base) {
2615 case 0x04e:
2616 tmpword |= 0x2000;
2617 break;
2618 case 0x02e:
2619 tmpword |= 0x1000;
2620 break;
2621 case 0x062:
2622 tmpword |= 0x0800;
2623 break;
2624 case 0x060:
2625 tmpword |= 0x0400;
2626 break;
2627 default:
2628 IRDA_WARNING("Uncommon I/O base address: 0x%04x\n",
2629 conf->cfg_base);
2630 break;
2631 }
2632 tmpword &= 0xfffd; /* disable LPC COMB */
2633 tmpword |= 0x0001; /* set bit 0 : enable LPC COMA addr range (GEN2) */
2634 IRDA_DEBUG(1, "LPC_EN (write): 0x%04x\n", tmpword);
2514 pci_write_config_word(dev, LPC_EN, tmpword); 2635 pci_write_config_word(dev, LPC_EN, tmpword);
2515 2636
2516 /* Setup DMA */ 2637 /*
2517 pci_write_config_word(dev, PCI_DMA_C, 0xc0c0); /* LPC I/F DMA on, channel 3 -- rtm (?? PCI DMA ?) */ 2638 * Configure LPC DMA channel
2518 pci_write_config_word(dev, GEN2_DEC, 0x131); /* LPC I/F 2nd decode range */ 2639 * PCI_DMA_C bits:
2640 * Bit 15-14: DMA channel 7 select
2641 * Bit 13-12: DMA channel 6 select
2642 * Bit 11-10: DMA channel 5 select
2643 * Bit 9-8: Reserved
2644 * Bit 7-6: DMA channel 3 select
2645 * Bit 5-4: DMA channel 2 select
2646 * Bit 3-2: DMA channel 1 select
2647 * Bit 1-0: DMA channel 0 select
2648 * 00 = Reserved value
2649 * 01 = PC/PCI DMA
2650 * 10 = Reserved value
2651 * 11 = LPC I/F DMA
2652 */
2653 pci_read_config_word(dev, PCI_DMA_C, &tmpword);
2654 switch(conf->fir_dma) {
2655 case 0x07:
2656 tmpword |= 0xc000;
2657 break;
2658 case 0x06:
2659 tmpword |= 0x3000;
2660 break;
2661 case 0x05:
2662 tmpword |= 0x0c00;
2663 break;
2664 case 0x03:
2665 tmpword |= 0x00c0;
2666 break;
2667 case 0x02:
2668 tmpword |= 0x0030;
2669 break;
2670 case 0x01:
2671 tmpword |= 0x000c;
2672 break;
2673 case 0x00:
2674 tmpword |= 0x0003;
2675 break;
2676 default:
2677 break; /* do not change settings */
2678 }
2679 IRDA_DEBUG(1, "PCI_DMA_C (write): 0x%04x\n", tmpword);
2680 pci_write_config_word(dev, PCI_DMA_C, tmpword);
2681
2682 /*
2683 * GEN2_DEC bits:
2684 * Bit 15-4: Generic I/O range
2685 * Bit 3-1: reserved (read as 0)
2686 * Bit 0: enable GEN2 range on LPC I/F
2687 */
2688 tmpword = conf->fir_io & 0xfff8;
2689 tmpword |= 0x0001;
2690 IRDA_DEBUG(1, "GEN2_DEC (write): 0x%04x\n", tmpword);
2691 pci_write_config_word(dev, GEN2_DEC, tmpword);
2519 2692
2520 /* Pre-configure chip */ 2693 /* Pre-configure chip */
2521 ret = preconfigure_smsc_chip(conf); 2694 return preconfigure_smsc_chip(conf);
2695}
2522 2696
2523 /* Disable LPC */ 2697/*
2524 pci_read_config_word(dev, LPC_EN, &tmpword); /* LPC_EN register */ 2698 * Pre-configure a certain port on the ALi 1533 bridge.
2525 tmpword &= 0xfffc; /* mask bit 1 and bit 0, COMA addr range disable */ 2699 * This is based on reverse-engineering since ALi does not
2526 pci_write_config_word(dev, LPC_EN, tmpword); 2700 * provide any data sheet for the 1533 chip.
2527 return ret; 2701 */
2702static void __init preconfigure_ali_port(struct pci_dev *dev,
2703 unsigned short port)
2704{
2705 unsigned char reg;
2706 /* These bits obviously control the different ports */
2707 unsigned char mask;
2708 unsigned char tmpbyte;
2709
2710 switch(port) {
2711 case 0x0130:
2712 case 0x0178:
2713 reg = 0xb0;
2714 mask = 0x80;
2715 break;
2716 case 0x03f8:
2717 reg = 0xb4;
2718 mask = 0x80;
2719 break;
2720 case 0x02f8:
2721 reg = 0xb4;
2722 mask = 0x30;
2723 break;
2724 case 0x02e8:
2725 reg = 0xb4;
2726 mask = 0x08;
2727 break;
2728 default:
2729 IRDA_ERROR("Failed to configure unsupported port on ALi 1533 bridge: 0x%04x\n", port);
2730 return;
2731 }
2732
2733 pci_read_config_byte(dev, reg, &tmpbyte);
2734 /* Turn on the right bits */
2735 tmpbyte |= mask;
2736 pci_write_config_byte(dev, reg, tmpbyte);
2737 IRDA_MESSAGE("Activated ALi 1533 ISA bridge port 0x%04x.\n", port);
2738 return;
2528} 2739}
2529 2740
2530static int __init preconfigure_through_ali(struct pci_dev *dev, 2741static int __init preconfigure_through_ali(struct pci_dev *dev,
2531 struct smsc_ircc_subsystem_configuration *conf) 2742 struct
2743 smsc_ircc_subsystem_configuration
2744 *conf)
2532{ 2745{
2533 /* TODO: put in ALi 1533 configuration here. */ 2746 /* Configure the two ports on the ALi 1533 */
2534 IRDA_MESSAGE("SORRY: %s has an unsupported bridge controller (ALi): not pre-configured.\n", conf->name); 2747 preconfigure_ali_port(dev, conf->sir_io);
2535 return -ENODEV; 2748 preconfigure_ali_port(dev, conf->fir_io);
2749
2750 /* Pre-configure chip */
2751 return preconfigure_smsc_chip(conf);
2536} 2752}
2537 2753
2538static int __init smsc_ircc_preconfigure_subsystems(unsigned short ircc_cfg, 2754static int __init smsc_ircc_preconfigure_subsystems(unsigned short ircc_cfg,
@@ -2552,9 +2768,10 @@ static int __init smsc_ircc_preconfigure_subsystems(unsigned short ircc_cfg,
2552 struct smsc_ircc_subsystem_configuration *conf; 2768 struct smsc_ircc_subsystem_configuration *conf;
2553 2769
2554 /* 2770 /*
2555 * Cache the subsystem vendor/device: some manufacturers fail to set 2771 * Cache the subsystem vendor/device:
2556 * this for all components, so we save it in case there is just 2772 * some manufacturers fail to set this for all components,
2557 * 0x0000 0x0000 on the device we want to check. 2773 * so we save it in case there is just 0x0000 0x0000 on the
2774 * device we want to check.
2558 */ 2775 */
2559 if (dev->subsystem_vendor != 0x0000U) { 2776 if (dev->subsystem_vendor != 0x0000U) {
2560 ss_vendor = dev->subsystem_vendor; 2777 ss_vendor = dev->subsystem_vendor;
@@ -2564,13 +2781,20 @@ static int __init smsc_ircc_preconfigure_subsystems(unsigned short ircc_cfg,
2564 for( ; conf->subvendor; conf++) { 2781 for( ; conf->subvendor; conf++) {
2565 if(conf->vendor == dev->vendor && 2782 if(conf->vendor == dev->vendor &&
2566 conf->device == dev->device && 2783 conf->device == dev->device &&
2567 conf->subvendor == ss_vendor && /* Sometimes these are cached values */ 2784 conf->subvendor == ss_vendor &&
2568 (conf->subdevice == ss_device || conf->subdevice == 0xffff)) { 2785 /* Sometimes these are cached values */
2569 struct smsc_ircc_subsystem_configuration tmpconf; 2786 (conf->subdevice == ss_device ||
2787 conf->subdevice == 0xffff)) {
2788 struct smsc_ircc_subsystem_configuration
2789 tmpconf;
2570 2790
2571 memcpy(&tmpconf, conf, sizeof(struct smsc_ircc_subsystem_configuration)); 2791 memcpy(&tmpconf, conf,
2792 sizeof(struct smsc_ircc_subsystem_configuration));
2572 2793
2573 /* Override the default values with anything passed in as parameter */ 2794 /*
2795 * Override the default values with anything
2796 * passed in as parameter
2797 */
2574 if (ircc_cfg != 0) 2798 if (ircc_cfg != 0)
2575 tmpconf.cfg_base = ircc_cfg; 2799 tmpconf.cfg_base = ircc_cfg;
2576 if (ircc_fir != 0) 2800 if (ircc_fir != 0)
diff --git a/drivers/net/ixp2000/enp2611.c b/drivers/net/ixp2000/enp2611.c
index 6f7dce8eba51..b67f586d7392 100644
--- a/drivers/net/ixp2000/enp2611.c
+++ b/drivers/net/ixp2000/enp2611.c
@@ -149,6 +149,8 @@ static void enp2611_check_link_status(unsigned long __dummy)
149 int status; 149 int status;
150 150
151 dev = nds[i]; 151 dev = nds[i];
152 if (dev == NULL)
153 continue;
152 154
153 status = pm3386_is_link_up(i); 155 status = pm3386_is_link_up(i);
154 if (status && !netif_carrier_ok(dev)) { 156 if (status && !netif_carrier_ok(dev)) {
@@ -191,6 +193,7 @@ static void enp2611_set_port_admin_status(int port, int up)
191 193
192static int __init enp2611_init_module(void) 194static int __init enp2611_init_module(void)
193{ 195{
196 int ports;
194 int i; 197 int i;
195 198
196 if (!machine_is_enp2611()) 199 if (!machine_is_enp2611())
@@ -199,7 +202,8 @@ static int __init enp2611_init_module(void)
199 caleb_reset(); 202 caleb_reset();
200 pm3386_reset(); 203 pm3386_reset();
201 204
202 for (i = 0; i < 3; i++) { 205 ports = pm3386_port_count();
206 for (i = 0; i < ports; i++) {
203 nds[i] = ixpdev_alloc(i, sizeof(struct enp2611_ixpdev_priv)); 207 nds[i] = ixpdev_alloc(i, sizeof(struct enp2611_ixpdev_priv));
204 if (nds[i] == NULL) { 208 if (nds[i] == NULL) {
205 while (--i >= 0) 209 while (--i >= 0)
@@ -215,9 +219,10 @@ static int __init enp2611_init_module(void)
215 219
216 ixp2400_msf_init(&enp2611_msf_parameters); 220 ixp2400_msf_init(&enp2611_msf_parameters);
217 221
218 if (ixpdev_init(3, nds, enp2611_set_port_admin_status)) { 222 if (ixpdev_init(ports, nds, enp2611_set_port_admin_status)) {
219 for (i = 0; i < 3; i++) 223 for (i = 0; i < ports; i++)
220 free_netdev(nds[i]); 224 if (nds[i])
225 free_netdev(nds[i]);
221 return -EINVAL; 226 return -EINVAL;
222 } 227 }
223 228
diff --git a/drivers/net/ixp2000/pm3386.c b/drivers/net/ixp2000/pm3386.c
index 5c7ab7564053..5224651c9aac 100644
--- a/drivers/net/ixp2000/pm3386.c
+++ b/drivers/net/ixp2000/pm3386.c
@@ -86,40 +86,53 @@ static void pm3386_port_reg_write(int port, int _reg, int spacing, u16 value)
86 pm3386_reg_write(port >> 1, reg, value); 86 pm3386_reg_write(port >> 1, reg, value);
87} 87}
88 88
89int pm3386_secondary_present(void)
90{
91 return pm3386_reg_read(1, 0) == 0x3386;
92}
89 93
90void pm3386_reset(void) 94void pm3386_reset(void)
91{ 95{
92 u8 mac[3][6]; 96 u8 mac[3][6];
97 int secondary;
98
99 secondary = pm3386_secondary_present();
93 100
94 /* Save programmed MAC addresses. */ 101 /* Save programmed MAC addresses. */
95 pm3386_get_mac(0, mac[0]); 102 pm3386_get_mac(0, mac[0]);
96 pm3386_get_mac(1, mac[1]); 103 pm3386_get_mac(1, mac[1]);
97 pm3386_get_mac(2, mac[2]); 104 if (secondary)
105 pm3386_get_mac(2, mac[2]);
98 106
99 /* Assert analog and digital reset. */ 107 /* Assert analog and digital reset. */
100 pm3386_reg_write(0, 0x002, 0x0060); 108 pm3386_reg_write(0, 0x002, 0x0060);
101 pm3386_reg_write(1, 0x002, 0x0060); 109 if (secondary)
110 pm3386_reg_write(1, 0x002, 0x0060);
102 mdelay(1); 111 mdelay(1);
103 112
104 /* Deassert analog reset. */ 113 /* Deassert analog reset. */
105 pm3386_reg_write(0, 0x002, 0x0062); 114 pm3386_reg_write(0, 0x002, 0x0062);
106 pm3386_reg_write(1, 0x002, 0x0062); 115 if (secondary)
116 pm3386_reg_write(1, 0x002, 0x0062);
107 mdelay(10); 117 mdelay(10);
108 118
109 /* Deassert digital reset. */ 119 /* Deassert digital reset. */
110 pm3386_reg_write(0, 0x002, 0x0063); 120 pm3386_reg_write(0, 0x002, 0x0063);
111 pm3386_reg_write(1, 0x002, 0x0063); 121 if (secondary)
122 pm3386_reg_write(1, 0x002, 0x0063);
112 mdelay(10); 123 mdelay(10);
113 124
114 /* Restore programmed MAC addresses. */ 125 /* Restore programmed MAC addresses. */
115 pm3386_set_mac(0, mac[0]); 126 pm3386_set_mac(0, mac[0]);
116 pm3386_set_mac(1, mac[1]); 127 pm3386_set_mac(1, mac[1]);
117 pm3386_set_mac(2, mac[2]); 128 if (secondary)
129 pm3386_set_mac(2, mac[2]);
118 130
119 /* Disable carrier on all ports. */ 131 /* Disable carrier on all ports. */
120 pm3386_set_carrier(0, 0); 132 pm3386_set_carrier(0, 0);
121 pm3386_set_carrier(1, 0); 133 pm3386_set_carrier(1, 0);
122 pm3386_set_carrier(2, 0); 134 if (secondary)
135 pm3386_set_carrier(2, 0);
123} 136}
124 137
125static u16 swaph(u16 x) 138static u16 swaph(u16 x)
@@ -127,6 +140,11 @@ static u16 swaph(u16 x)
127 return ((x << 8) | (x >> 8)) & 0xffff; 140 return ((x << 8) | (x >> 8)) & 0xffff;
128} 141}
129 142
143int pm3386_port_count(void)
144{
145 return 2 + pm3386_secondary_present();
146}
147
130void pm3386_init_port(int port) 148void pm3386_init_port(int port)
131{ 149{
132 int pm = port >> 1; 150 int pm = port >> 1;
diff --git a/drivers/net/ixp2000/pm3386.h b/drivers/net/ixp2000/pm3386.h
index fe92bb056ac4..cc4183dca911 100644
--- a/drivers/net/ixp2000/pm3386.h
+++ b/drivers/net/ixp2000/pm3386.h
@@ -13,6 +13,7 @@
13#define __PM3386_H 13#define __PM3386_H
14 14
15void pm3386_reset(void); 15void pm3386_reset(void);
16int pm3386_port_count(void);
16void pm3386_init_port(int port); 17void pm3386_init_port(int port);
17void pm3386_get_mac(int port, u8 *mac); 18void pm3386_get_mac(int port, u8 *mac);
18void pm3386_set_mac(int port, u8 *mac); 19void pm3386_set_mac(int port, u8 *mac);
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c
index ea62a3e7d586..411f4d809c47 100644
--- a/drivers/net/mv643xx_eth.c
+++ b/drivers/net/mv643xx_eth.c
@@ -1419,6 +1419,8 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
1419 mv643xx_eth_update_pscr(dev, &cmd); 1419 mv643xx_eth_update_pscr(dev, &cmd);
1420 mv643xx_set_settings(dev, &cmd); 1420 mv643xx_set_settings(dev, &cmd);
1421 1421
1422 SET_MODULE_OWNER(dev);
1423 SET_NETDEV_DEV(dev, &pdev->dev);
1422 err = register_netdev(dev); 1424 err = register_netdev(dev);
1423 if (err) 1425 if (err)
1424 goto out; 1426 goto out;
diff --git a/drivers/net/ne.c b/drivers/net/ne.c
index 08b218c5bfbc..b32765215f75 100644
--- a/drivers/net/ne.c
+++ b/drivers/net/ne.c
@@ -139,8 +139,9 @@ bad_clone_list[] __initdata = {
139 139
140#if defined(CONFIG_PLAT_MAPPI) 140#if defined(CONFIG_PLAT_MAPPI)
141# define DCR_VAL 0x4b 141# define DCR_VAL 0x4b
142#elif defined(CONFIG_PLAT_OAKS32R) 142#elif defined(CONFIG_PLAT_OAKS32R) || \
143# define DCR_VAL 0x48 143 defined(CONFIG_TOSHIBA_RBTX4927) || defined(CONFIG_TOSHIBA_RBTX4938)
144# define DCR_VAL 0x48 /* 8-bit mode */
144#else 145#else
145# define DCR_VAL 0x49 146# define DCR_VAL 0x49
146#endif 147#endif
@@ -226,7 +227,7 @@ struct net_device * __init ne_probe(int unit)
226 netdev_boot_setup_check(dev); 227 netdev_boot_setup_check(dev);
227 228
228#ifdef CONFIG_TOSHIBA_RBTX4938 229#ifdef CONFIG_TOSHIBA_RBTX4938
229 dev->base_addr = 0x07f20280; 230 dev->base_addr = RBTX4938_RTL_8019_BASE;
230 dev->irq = RBTX4938_RTL_8019_IRQ; 231 dev->irq = RBTX4938_RTL_8019_IRQ;
231#endif 232#endif
232 err = do_ne_probe(dev); 233 err = do_ne_probe(dev);
@@ -396,10 +397,22 @@ static int __init ne_probe1(struct net_device *dev, int ioaddr)
396 /* We must set the 8390 for word mode. */ 397 /* We must set the 8390 for word mode. */
397 outb_p(DCR_VAL, ioaddr + EN0_DCFG); 398 outb_p(DCR_VAL, ioaddr + EN0_DCFG);
398 start_page = NESM_START_PG; 399 start_page = NESM_START_PG;
399 stop_page = NESM_STOP_PG; 400
401 /*
402 * Realtek RTL8019AS datasheet says that the PSTOP register
403 * shouldn't exceed 0x60 in 8-bit mode.
404 * This chip can be identified by reading the signature from
405 * the remote byte count registers (otherwise write-only)...
406 */
407 if ((DCR_VAL & 0x01) == 0 && /* 8-bit mode */
408 inb(ioaddr + EN0_RCNTLO) == 0x50 &&
409 inb(ioaddr + EN0_RCNTHI) == 0x70)
410 stop_page = 0x60;
411 else
412 stop_page = NESM_STOP_PG;
400 } else { 413 } else {
401 start_page = NE1SM_START_PG; 414 start_page = NE1SM_START_PG;
402 stop_page = NE1SM_STOP_PG; 415 stop_page = NE1SM_STOP_PG;
403 } 416 }
404 417
405#if defined(CONFIG_PLAT_MAPPI) || defined(CONFIG_PLAT_OAKS32R) 418#if defined(CONFIG_PLAT_MAPPI) || defined(CONFIG_PLAT_OAKS32R)
@@ -509,15 +522,9 @@ static int __init ne_probe1(struct net_device *dev, int ioaddr)
509 ei_status.name = name; 522 ei_status.name = name;
510 ei_status.tx_start_page = start_page; 523 ei_status.tx_start_page = start_page;
511 ei_status.stop_page = stop_page; 524 ei_status.stop_page = stop_page;
512#if defined(CONFIG_TOSHIBA_RBTX4927) || defined(CONFIG_TOSHIBA_RBTX4938)
513 wordlength = 1;
514#endif
515 525
516#ifdef CONFIG_PLAT_OAKS32R 526 /* Use 16-bit mode only if this wasn't overridden by DCR_VAL */
517 ei_status.word16 = 0; 527 ei_status.word16 = (wordlength == 2 && (DCR_VAL & 0x01));
518#else
519 ei_status.word16 = (wordlength == 2);
520#endif
521 528
522 ei_status.rx_start_page = start_page + TX_PAGES; 529 ei_status.rx_start_page = start_page + TX_PAGES;
523#ifdef PACKETBUF_MEMSIZE 530#ifdef PACKETBUF_MEMSIZE
diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
index 66e74f740261..bf58db29e2ed 100644
--- a/drivers/net/netconsole.c
+++ b/drivers/net/netconsole.c
@@ -107,7 +107,7 @@ static int init_netconsole(void)
107 107
108 if(!configured) { 108 if(!configured) {
109 printk("netconsole: not configured, aborting\n"); 109 printk("netconsole: not configured, aborting\n");
110 return -EINVAL; 110 return 0;
111 } 111 }
112 112
113 if(netpoll_setup(&np)) 113 if(netpoll_setup(&np))
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c
index 448a09488529..2ea66aca648b 100644
--- a/drivers/net/pcmcia/axnet_cs.c
+++ b/drivers/net/pcmcia/axnet_cs.c
@@ -1691,17 +1691,6 @@ static void do_set_multicast_list(struct net_device *dev)
1691 memset(ei_local->mcfilter, 0xFF, 8); 1691 memset(ei_local->mcfilter, 0xFF, 8);
1692 } 1692 }
1693 1693
1694 /*
1695 * DP8390 manuals don't specify any magic sequence for altering
1696 * the multicast regs on an already running card. To be safe, we
1697 * ensure multicast mode is off prior to loading up the new hash
1698 * table. If this proves to be not enough, we can always resort
1699 * to stopping the NIC, loading the table and then restarting.
1700 */
1701
1702 if (netif_running(dev))
1703 outb_p(E8390_RXCONFIG, e8390_base + EN0_RXCR);
1704
1705 outb_p(E8390_NODMA + E8390_PAGE1, e8390_base + E8390_CMD); 1694 outb_p(E8390_NODMA + E8390_PAGE1, e8390_base + E8390_CMD);
1706 for(i = 0; i < 8; i++) 1695 for(i = 0; i < 8; i++)
1707 { 1696 {
@@ -1715,6 +1704,8 @@ static void do_set_multicast_list(struct net_device *dev)
1715 outb_p(E8390_RXCONFIG | 0x48, e8390_base + EN0_RXCR); 1704 outb_p(E8390_RXCONFIG | 0x48, e8390_base + EN0_RXCR);
1716 else 1705 else
1717 outb_p(E8390_RXCONFIG | 0x40, e8390_base + EN0_RXCR); 1706 outb_p(E8390_RXCONFIG | 0x40, e8390_base + EN0_RXCR);
1707
1708 outb_p(E8390_NODMA+E8390_PAGE0+E8390_START, e8390_base+E8390_CMD);
1718} 1709}
1719 1710
1720/* 1711/*
diff --git a/drivers/net/pcmcia/nmclan_cs.c b/drivers/net/pcmcia/nmclan_cs.c
index 4260c2128f47..a8f6bfc96fd2 100644
--- a/drivers/net/pcmcia/nmclan_cs.c
+++ b/drivers/net/pcmcia/nmclan_cs.c
@@ -1204,7 +1204,7 @@ static int mace_rx(struct net_device *dev, unsigned char RxCnt)
1204 1204
1205 dev->last_rx = jiffies; 1205 dev->last_rx = jiffies;
1206 lp->linux_stats.rx_packets++; 1206 lp->linux_stats.rx_packets++;
1207 lp->linux_stats.rx_bytes += skb->len; 1207 lp->linux_stats.rx_bytes += pkt_len;
1208 outb(0xFF, ioaddr + AM2150_RCV_NEXT); /* skip to next frame */ 1208 outb(0xFF, ioaddr + AM2150_RCV_NEXT); /* skip to next frame */
1209 continue; 1209 continue;
1210 } else { 1210 } else {
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c
index 506e777c5f06..d090df413049 100644
--- a/drivers/net/pcmcia/pcnet_cs.c
+++ b/drivers/net/pcmcia/pcnet_cs.c
@@ -1639,6 +1639,7 @@ static struct pcmcia_device_id pcnet_ids[] = {
1639 PCMCIA_DEVICE_PROD_ID12("CONTEC", "C-NET(PC)C-10L", 0x21cab552, 0xf6f90722), 1639 PCMCIA_DEVICE_PROD_ID12("CONTEC", "C-NET(PC)C-10L", 0x21cab552, 0xf6f90722),
1640 PCMCIA_DEVICE_PROD_ID12("corega", "FEther PCC-TXF", 0x0a21501a, 0xa51564a2), 1640 PCMCIA_DEVICE_PROD_ID12("corega", "FEther PCC-TXF", 0x0a21501a, 0xa51564a2),
1641 PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega EtherII PCC-T", 0x5261440f, 0xfa9d85bd), 1641 PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega EtherII PCC-T", 0x5261440f, 0xfa9d85bd),
1642 PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega EtherII PCC-TD", 0x5261440f, 0xc49bd73d),
1642 PCMCIA_DEVICE_PROD_ID12("Corega K.K.", "corega EtherII PCC-TD", 0xd4fdcbd8, 0xc49bd73d), 1643 PCMCIA_DEVICE_PROD_ID12("Corega K.K.", "corega EtherII PCC-TD", 0xd4fdcbd8, 0xc49bd73d),
1643 PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega Ether PCC-T", 0x5261440f, 0x6705fcaa), 1644 PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega Ether PCC-T", 0x5261440f, 0x6705fcaa),
1644 PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega FastEther PCC-TX", 0x5261440f, 0x485e85d9), 1645 PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega FastEther PCC-TX", 0x5261440f, 0x485e85d9),
diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c
index 07c31f19c6ba..fc08c4af506c 100644
--- a/drivers/net/pcnet32.c
+++ b/drivers/net/pcnet32.c
@@ -1774,8 +1774,6 @@ static int pcnet32_open(struct net_device *dev)
1774 lp->rx_dma_addr[i] = 0; 1774 lp->rx_dma_addr[i] = 0;
1775 } 1775 }
1776 1776
1777 pcnet32_free_ring(dev);
1778
1779 /* 1777 /*
1780 * Switch back to 16bit mode to avoid problems with dumb 1778 * Switch back to 16bit mode to avoid problems with dumb
1781 * DOS packet driver after a warm reboot 1779 * DOS packet driver after a warm reboot
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
index 459443b572ce..1b236bdf6b92 100644
--- a/drivers/net/phy/mdio_bus.c
+++ b/drivers/net/phy/mdio_bus.c
@@ -60,8 +60,10 @@ int mdiobus_register(struct mii_bus *bus)
60 for (i = 0; i < PHY_MAX_ADDR; i++) { 60 for (i = 0; i < PHY_MAX_ADDR; i++) {
61 struct phy_device *phydev; 61 struct phy_device *phydev;
62 62
63 if (bus->phy_mask & (1 << i)) 63 if (bus->phy_mask & (1 << i)) {
64 bus->phy_map[i] = NULL;
64 continue; 65 continue;
66 }
65 67
66 phydev = get_phy_device(bus, i); 68 phydev = get_phy_device(bus, i);
67 69
diff --git a/drivers/net/pppoe.c b/drivers/net/pppoe.c
index 475dc930380f..0d101a18026a 100644
--- a/drivers/net/pppoe.c
+++ b/drivers/net/pppoe.c
@@ -861,6 +861,9 @@ static int __pppoe_xmit(struct sock *sk, struct sk_buff *skb)
861 * give dev_queue_xmit something it can free. 861 * give dev_queue_xmit something it can free.
862 */ 862 */
863 skb2 = skb_clone(skb, GFP_ATOMIC); 863 skb2 = skb_clone(skb, GFP_ATOMIC);
864
865 if (skb2 == NULL)
866 goto abort;
864 } 867 }
865 868
866 ph = (struct pppoe_hdr *) skb_push(skb2, sizeof(struct pppoe_hdr)); 869 ph = (struct pppoe_hdr *) skb_push(skb2, sizeof(struct pppoe_hdr));
diff --git a/drivers/net/sis900.c b/drivers/net/sis900.c
index b82191d2bee1..f5a3bf4d959a 100644
--- a/drivers/net/sis900.c
+++ b/drivers/net/sis900.c
@@ -127,6 +127,7 @@ static const struct mii_chip_info {
127} mii_chip_table[] = { 127} mii_chip_table[] = {
128 { "SiS 900 Internal MII PHY", 0x001d, 0x8000, LAN }, 128 { "SiS 900 Internal MII PHY", 0x001d, 0x8000, LAN },
129 { "SiS 7014 Physical Layer Solution", 0x0016, 0xf830, LAN }, 129 { "SiS 7014 Physical Layer Solution", 0x0016, 0xf830, LAN },
130 { "SiS 900 on Foxconn 661 7MI", 0x0143, 0xBC70, LAN },
130 { "Altimata AC101LF PHY", 0x0022, 0x5520, LAN }, 131 { "Altimata AC101LF PHY", 0x0022, 0x5520, LAN },
131 { "ADM 7001 LAN PHY", 0x002e, 0xcc60, LAN }, 132 { "ADM 7001 LAN PHY", 0x002e, 0xcc60, LAN },
132 { "AMD 79C901 10BASE-T PHY", 0x0000, 0x6B70, LAN }, 133 { "AMD 79C901 10BASE-T PHY", 0x0000, 0x6B70, LAN },
diff --git a/drivers/net/skge.c b/drivers/net/skge.c
index a70c2b0cc104..5ca5a1b546a1 100644
--- a/drivers/net/skge.c
+++ b/drivers/net/skge.c
@@ -78,8 +78,7 @@ static const struct pci_device_id skge_id_table[] = {
78 { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_GE) }, 78 { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_GE) },
79 { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_YU) }, 79 { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_YU) },
80 { PCI_DEVICE(PCI_VENDOR_ID_DLINK, PCI_DEVICE_ID_DLINK_DGE510T), }, 80 { PCI_DEVICE(PCI_VENDOR_ID_DLINK, PCI_DEVICE_ID_DLINK_DGE510T), },
81 { PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x4b00) }, 81 { PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x4b01) }, /* DGE-530T */
82 { PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x4b01) },
83 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4320) }, 82 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4320) },
84 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x5005) }, /* Belkin */ 83 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x5005) }, /* Belkin */
85 { PCI_DEVICE(PCI_VENDOR_ID_CNET, PCI_DEVICE_ID_CNET_GIGACARD) }, 84 { PCI_DEVICE(PCI_VENDOR_ID_CNET, PCI_DEVICE_ID_CNET_GIGACARD) },
@@ -402,7 +401,7 @@ static int skge_set_ring_param(struct net_device *dev,
402 int err; 401 int err;
403 402
404 if (p->rx_pending == 0 || p->rx_pending > MAX_RX_RING_SIZE || 403 if (p->rx_pending == 0 || p->rx_pending > MAX_RX_RING_SIZE ||
405 p->tx_pending == 0 || p->tx_pending > MAX_TX_RING_SIZE) 404 p->tx_pending < MAX_SKB_FRAGS+1 || p->tx_pending > MAX_TX_RING_SIZE)
406 return -EINVAL; 405 return -EINVAL;
407 406
408 skge->rx_ring.count = p->rx_pending; 407 skge->rx_ring.count = p->rx_pending;
@@ -2717,8 +2716,7 @@ static int skge_poll(struct net_device *dev, int *budget)
2717 if (control & BMU_OWN) 2716 if (control & BMU_OWN)
2718 break; 2717 break;
2719 2718
2720 skb = skge_rx_get(skge, e, control, rd->status, 2719 skb = skge_rx_get(skge, e, control, rd->status, rd->csum2);
2721 le16_to_cpu(rd->csum2));
2722 if (likely(skb)) { 2720 if (likely(skb)) {
2723 dev->last_rx = jiffies; 2721 dev->last_rx = jiffies;
2724 netif_receive_skb(skb); 2722 netif_receive_skb(skb);
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 67b0eab16589..959109609d85 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -51,7 +51,7 @@
51#include "sky2.h" 51#include "sky2.h"
52 52
53#define DRV_NAME "sky2" 53#define DRV_NAME "sky2"
54#define DRV_VERSION "1.1" 54#define DRV_VERSION "1.4"
55#define PFX DRV_NAME " " 55#define PFX DRV_NAME " "
56 56
57/* 57/*
@@ -79,6 +79,8 @@
79#define NAPI_WEIGHT 64 79#define NAPI_WEIGHT 64
80#define PHY_RETRIES 1000 80#define PHY_RETRIES 1000
81 81
82#define RING_NEXT(x,s) (((x)+1) & ((s)-1))
83
82static const u32 default_msg = 84static const u32 default_msg =
83 NETIF_MSG_DRV | NETIF_MSG_PROBE | NETIF_MSG_LINK 85 NETIF_MSG_DRV | NETIF_MSG_PROBE | NETIF_MSG_LINK
84 | NETIF_MSG_TIMER | NETIF_MSG_TX_ERR | NETIF_MSG_RX_ERR 86 | NETIF_MSG_TIMER | NETIF_MSG_TX_ERR | NETIF_MSG_RX_ERR
@@ -96,9 +98,14 @@ static int disable_msi = 0;
96module_param(disable_msi, int, 0); 98module_param(disable_msi, int, 0);
97MODULE_PARM_DESC(disable_msi, "Disable Message Signaled Interrupt (MSI)"); 99MODULE_PARM_DESC(disable_msi, "Disable Message Signaled Interrupt (MSI)");
98 100
101static int idle_timeout = 100;
102module_param(idle_timeout, int, 0);
103MODULE_PARM_DESC(idle_timeout, "Idle timeout workaround for lost interrupts (ms)");
104
99static const struct pci_device_id sky2_id_table[] = { 105static const struct pci_device_id sky2_id_table[] = {
100 { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9000) }, 106 { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9000) },
101 { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9E00) }, 107 { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9E00) },
108 { PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x4b00) }, /* DGE-560T */
102 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4340) }, 109 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4340) },
103 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4341) }, 110 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4341) },
104 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4342) }, 111 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4342) },
@@ -122,6 +129,7 @@ MODULE_DEVICE_TABLE(pci, sky2_id_table);
122/* Avoid conditionals by using array */ 129/* Avoid conditionals by using array */
123static const unsigned txqaddr[] = { Q_XA1, Q_XA2 }; 130static const unsigned txqaddr[] = { Q_XA1, Q_XA2 };
124static const unsigned rxqaddr[] = { Q_R1, Q_R2 }; 131static const unsigned rxqaddr[] = { Q_R1, Q_R2 };
132static const u32 portirq_msk[] = { Y2_IS_PORT_1, Y2_IS_PORT_2 };
125 133
126/* This driver supports yukon2 chipset only */ 134/* This driver supports yukon2 chipset only */
127static const char *yukon2_name[] = { 135static const char *yukon2_name[] = {
@@ -228,6 +236,7 @@ static int sky2_set_power_state(struct sky2_hw *hw, pci_power_t state)
228 } 236 }
229 237
230 if (hw->chip_id == CHIP_ID_YUKON_EC_U) { 238 if (hw->chip_id == CHIP_ID_YUKON_EC_U) {
239 sky2_write16(hw, B0_CTST, Y2_HW_WOL_ON);
231 sky2_pci_write32(hw, PCI_DEV_REG3, 0); 240 sky2_pci_write32(hw, PCI_DEV_REG3, 0);
232 reg1 = sky2_pci_read32(hw, PCI_DEV_REG4); 241 reg1 = sky2_pci_read32(hw, PCI_DEV_REG4);
233 reg1 &= P_ASPM_CONTROL_MSK; 242 reg1 &= P_ASPM_CONTROL_MSK;
@@ -298,7 +307,8 @@ static void sky2_phy_init(struct sky2_hw *hw, unsigned port)
298 struct sky2_port *sky2 = netdev_priv(hw->dev[port]); 307 struct sky2_port *sky2 = netdev_priv(hw->dev[port]);
299 u16 ctrl, ct1000, adv, pg, ledctrl, ledover; 308 u16 ctrl, ct1000, adv, pg, ledctrl, ledover;
300 309
301 if (sky2->autoneg == AUTONEG_ENABLE && hw->chip_id != CHIP_ID_YUKON_XL) { 310 if (sky2->autoneg == AUTONEG_ENABLE &&
311 !(hw->chip_id == CHIP_ID_YUKON_XL || hw->chip_id == CHIP_ID_YUKON_EC_U)) {
302 u16 ectrl = gm_phy_read(hw, port, PHY_MARV_EXT_CTRL); 312 u16 ectrl = gm_phy_read(hw, port, PHY_MARV_EXT_CTRL);
303 313
304 ectrl &= ~(PHY_M_EC_M_DSC_MSK | PHY_M_EC_S_DSC_MSK | 314 ectrl &= ~(PHY_M_EC_M_DSC_MSK | PHY_M_EC_S_DSC_MSK |
@@ -326,7 +336,7 @@ static void sky2_phy_init(struct sky2_hw *hw, unsigned port)
326 ctrl |= PHY_M_PC_MDI_XMODE(PHY_M_PC_ENA_AUTO); 336 ctrl |= PHY_M_PC_MDI_XMODE(PHY_M_PC_ENA_AUTO);
327 337
328 if (sky2->autoneg == AUTONEG_ENABLE && 338 if (sky2->autoneg == AUTONEG_ENABLE &&
329 hw->chip_id == CHIP_ID_YUKON_XL) { 339 (hw->chip_id == CHIP_ID_YUKON_XL || hw->chip_id == CHIP_ID_YUKON_EC_U)) {
330 ctrl &= ~PHY_M_PC_DSC_MSK; 340 ctrl &= ~PHY_M_PC_DSC_MSK;
331 ctrl |= PHY_M_PC_DSC(2) | PHY_M_PC_DOWN_S_ENA; 341 ctrl |= PHY_M_PC_DSC(2) | PHY_M_PC_DOWN_S_ENA;
332 } 342 }
@@ -442,10 +452,11 @@ static void sky2_phy_init(struct sky2_hw *hw, unsigned port)
442 gm_phy_write(hw, port, PHY_MARV_EXT_ADR, 3); 452 gm_phy_write(hw, port, PHY_MARV_EXT_ADR, 3);
443 453
444 /* set LED Function Control register */ 454 /* set LED Function Control register */
445 gm_phy_write(hw, port, PHY_MARV_PHY_CTRL, (PHY_M_LEDC_LOS_CTRL(1) | /* LINK/ACT */ 455 gm_phy_write(hw, port, PHY_MARV_PHY_CTRL,
446 PHY_M_LEDC_INIT_CTRL(7) | /* 10 Mbps */ 456 (PHY_M_LEDC_LOS_CTRL(1) | /* LINK/ACT */
447 PHY_M_LEDC_STA1_CTRL(7) | /* 100 Mbps */ 457 PHY_M_LEDC_INIT_CTRL(7) | /* 10 Mbps */
448 PHY_M_LEDC_STA0_CTRL(7))); /* 1000 Mbps */ 458 PHY_M_LEDC_STA1_CTRL(7) | /* 100 Mbps */
459 PHY_M_LEDC_STA0_CTRL(7))); /* 1000 Mbps */
449 460
450 /* set Polarity Control register */ 461 /* set Polarity Control register */
451 gm_phy_write(hw, port, PHY_MARV_PHY_STAT, 462 gm_phy_write(hw, port, PHY_MARV_PHY_STAT,
@@ -459,6 +470,25 @@ static void sky2_phy_init(struct sky2_hw *hw, unsigned port)
459 /* restore page register */ 470 /* restore page register */
460 gm_phy_write(hw, port, PHY_MARV_EXT_ADR, pg); 471 gm_phy_write(hw, port, PHY_MARV_EXT_ADR, pg);
461 break; 472 break;
473 case CHIP_ID_YUKON_EC_U:
474 pg = gm_phy_read(hw, port, PHY_MARV_EXT_ADR);
475
476 /* select page 3 to access LED control register */
477 gm_phy_write(hw, port, PHY_MARV_EXT_ADR, 3);
478
479 /* set LED Function Control register */
480 gm_phy_write(hw, port, PHY_MARV_PHY_CTRL,
481 (PHY_M_LEDC_LOS_CTRL(1) | /* LINK/ACT */
482 PHY_M_LEDC_INIT_CTRL(8) | /* 10 Mbps */
483 PHY_M_LEDC_STA1_CTRL(7) | /* 100 Mbps */
484 PHY_M_LEDC_STA0_CTRL(7)));/* 1000 Mbps */
485
486 /* set Blink Rate in LED Timer Control Register */
487 gm_phy_write(hw, port, PHY_MARV_INT_MASK,
488 ledctrl | PHY_M_LED_BLINK_RT(BLINK_84MS));
489 /* restore page register */
490 gm_phy_write(hw, port, PHY_MARV_EXT_ADR, pg);
491 break;
462 492
463 default: 493 default:
464 /* set Tx LED (LED_TX) to blink mode on Rx OR Tx activity */ 494 /* set Tx LED (LED_TX) to blink mode on Rx OR Tx activity */
@@ -467,19 +497,21 @@ static void sky2_phy_init(struct sky2_hw *hw, unsigned port)
467 ledover |= PHY_M_LED_MO_RX(MO_LED_OFF); 497 ledover |= PHY_M_LED_MO_RX(MO_LED_OFF);
468 } 498 }
469 499
470 if (hw->chip_id == CHIP_ID_YUKON_EC_U && hw->chip_rev >= 2) { 500 if (hw->chip_id == CHIP_ID_YUKON_EC_U && hw->chip_rev == CHIP_REV_YU_EC_A1) {
471 /* apply fixes in PHY AFE */ 501 /* apply fixes in PHY AFE */
472 gm_phy_write(hw, port, 22, 255); 502 pg = gm_phy_read(hw, port, PHY_MARV_EXT_ADR);
503 gm_phy_write(hw, port, PHY_MARV_EXT_ADR, 255);
504
473 /* increase differential signal amplitude in 10BASE-T */ 505 /* increase differential signal amplitude in 10BASE-T */
474 gm_phy_write(hw, port, 24, 0xaa99); 506 gm_phy_write(hw, port, 0x18, 0xaa99);
475 gm_phy_write(hw, port, 23, 0x2011); 507 gm_phy_write(hw, port, 0x17, 0x2011);
476 508
477 /* fix for IEEE A/B Symmetry failure in 1000BASE-T */ 509 /* fix for IEEE A/B Symmetry failure in 1000BASE-T */
478 gm_phy_write(hw, port, 24, 0xa204); 510 gm_phy_write(hw, port, 0x18, 0xa204);
479 gm_phy_write(hw, port, 23, 0x2002); 511 gm_phy_write(hw, port, 0x17, 0x2002);
480 512
481 /* set page register to 0 */ 513 /* set page register to 0 */
482 gm_phy_write(hw, port, 22, 0); 514 gm_phy_write(hw, port, PHY_MARV_EXT_ADR, pg);
483 } else { 515 } else {
484 gm_phy_write(hw, port, PHY_MARV_LED_CTRL, ledctrl); 516 gm_phy_write(hw, port, PHY_MARV_LED_CTRL, ledctrl);
485 517
@@ -553,6 +585,11 @@ static void sky2_mac_init(struct sky2_hw *hw, unsigned port)
553 585
554 if (sky2->duplex == DUPLEX_FULL) 586 if (sky2->duplex == DUPLEX_FULL)
555 reg |= GM_GPCR_DUP_FULL; 587 reg |= GM_GPCR_DUP_FULL;
588
589 /* turn off pause in 10/100mbps half duplex */
590 else if (sky2->speed != SPEED_1000 &&
591 hw->chip_id != CHIP_ID_YUKON_EC_U)
592 sky2->tx_pause = sky2->rx_pause = 0;
556 } else 593 } else
557 reg = GM_GPCR_SPEED_1000 | GM_GPCR_SPEED_100 | GM_GPCR_DUP_FULL; 594 reg = GM_GPCR_SPEED_1000 | GM_GPCR_SPEED_100 | GM_GPCR_DUP_FULL;
558 595
@@ -719,7 +756,7 @@ static inline struct sky2_tx_le *get_tx_le(struct sky2_port *sky2)
719{ 756{
720 struct sky2_tx_le *le = sky2->tx_le + sky2->tx_prod; 757 struct sky2_tx_le *le = sky2->tx_le + sky2->tx_prod;
721 758
722 sky2->tx_prod = (sky2->tx_prod + 1) % TX_RING_SIZE; 759 sky2->tx_prod = RING_NEXT(sky2->tx_prod, TX_RING_SIZE);
723 return le; 760 return le;
724} 761}
725 762
@@ -735,7 +772,7 @@ static inline void sky2_put_idx(struct sky2_hw *hw, unsigned q, u16 idx)
735static inline struct sky2_rx_le *sky2_next_rx(struct sky2_port *sky2) 772static inline struct sky2_rx_le *sky2_next_rx(struct sky2_port *sky2)
736{ 773{
737 struct sky2_rx_le *le = sky2->rx_le + sky2->rx_put; 774 struct sky2_rx_le *le = sky2->rx_le + sky2->rx_put;
738 sky2->rx_put = (sky2->rx_put + 1) % RX_LE_SIZE; 775 sky2->rx_put = RING_NEXT(sky2->rx_put, RX_LE_SIZE);
739 return le; 776 return le;
740} 777}
741 778
@@ -925,8 +962,7 @@ static inline struct sk_buff *sky2_alloc_skb(unsigned int size, gfp_t gfp_mask)
925 skb = alloc_skb(size + RX_SKB_ALIGN, gfp_mask); 962 skb = alloc_skb(size + RX_SKB_ALIGN, gfp_mask);
926 if (likely(skb)) { 963 if (likely(skb)) {
927 unsigned long p = (unsigned long) skb->data; 964 unsigned long p = (unsigned long) skb->data;
928 skb_reserve(skb, 965 skb_reserve(skb, ALIGN(p, RX_SKB_ALIGN) - p);
929 ((p + RX_SKB_ALIGN - 1) & ~(RX_SKB_ALIGN - 1)) - p);
930 } 966 }
931 967
932 return skb; 968 return skb;
@@ -943,6 +979,7 @@ static int sky2_rx_start(struct sky2_port *sky2)
943 struct sky2_hw *hw = sky2->hw; 979 struct sky2_hw *hw = sky2->hw;
944 unsigned rxq = rxqaddr[sky2->port]; 980 unsigned rxq = rxqaddr[sky2->port];
945 int i; 981 int i;
982 unsigned thresh;
946 983
947 sky2->rx_put = sky2->rx_next = 0; 984 sky2->rx_put = sky2->rx_next = 0;
948 sky2_qset(hw, rxq); 985 sky2_qset(hw, rxq);
@@ -967,9 +1004,21 @@ static int sky2_rx_start(struct sky2_port *sky2)
967 sky2_rx_add(sky2, re->mapaddr); 1004 sky2_rx_add(sky2, re->mapaddr);
968 } 1005 }
969 1006
970 /* Truncate oversize frames */ 1007
971 sky2_write16(hw, SK_REG(sky2->port, RX_GMF_TR_THR), sky2->rx_bufsize - 8); 1008 /*
972 sky2_write32(hw, SK_REG(sky2->port, RX_GMF_CTRL_T), RX_TRUNC_ON); 1009 * The receiver hangs if it receives frames larger than the
1010 * packet buffer. As a workaround, truncate oversize frames, but
1011 * the register is limited to 9 bits, so if you do frames > 2052
1012 * you better get the MTU right!
1013 */
1014 thresh = (sky2->rx_bufsize - 8) / sizeof(u32);
1015 if (thresh > 0x1ff)
1016 sky2_write32(hw, SK_REG(sky2->port, RX_GMF_CTRL_T), RX_TRUNC_OFF);
1017 else {
1018 sky2_write16(hw, SK_REG(sky2->port, RX_GMF_TR_THR), thresh);
1019 sky2_write32(hw, SK_REG(sky2->port, RX_GMF_CTRL_T), RX_TRUNC_ON);
1020 }
1021
973 1022
974 /* Tell chip about available buffers */ 1023 /* Tell chip about available buffers */
975 sky2_write16(hw, Y2_QADDR(rxq, PREF_UNIT_PUT_IDX), sky2->rx_put); 1024 sky2_write16(hw, Y2_QADDR(rxq, PREF_UNIT_PUT_IDX), sky2->rx_put);
@@ -986,7 +1035,25 @@ static int sky2_up(struct net_device *dev)
986 struct sky2_hw *hw = sky2->hw; 1035 struct sky2_hw *hw = sky2->hw;
987 unsigned port = sky2->port; 1036 unsigned port = sky2->port;
988 u32 ramsize, rxspace, imask; 1037 u32 ramsize, rxspace, imask;
989 int err = -ENOMEM; 1038 int cap, err = -ENOMEM;
1039 struct net_device *otherdev = hw->dev[sky2->port^1];
1040
1041 /*
1042 * On dual port PCI-X card, there is an problem where status
1043 * can be received out of order due to split transactions
1044 */
1045 if (otherdev && netif_running(otherdev) &&
1046 (cap = pci_find_capability(hw->pdev, PCI_CAP_ID_PCIX))) {
1047 struct sky2_port *osky2 = netdev_priv(otherdev);
1048 u16 cmd;
1049
1050 cmd = sky2_pci_read16(hw, cap + PCI_X_CMD);
1051 cmd &= ~PCI_X_CMD_MAX_SPLIT;
1052 sky2_pci_write16(hw, cap + PCI_X_CMD, cmd);
1053
1054 sky2->rx_csum = 0;
1055 osky2->rx_csum = 0;
1056 }
990 1057
991 if (netif_msg_ifup(sky2)) 1058 if (netif_msg_ifup(sky2))
992 printk(KERN_INFO PFX "%s: enabling interface\n", dev->name); 1059 printk(KERN_INFO PFX "%s: enabling interface\n", dev->name);
@@ -1051,7 +1118,7 @@ static int sky2_up(struct net_device *dev)
1051 1118
1052 /* Enable interrupts from phy/mac for port */ 1119 /* Enable interrupts from phy/mac for port */
1053 imask = sky2_read32(hw, B0_IMSK); 1120 imask = sky2_read32(hw, B0_IMSK);
1054 imask |= (port == 0) ? Y2_IS_PORT_1 : Y2_IS_PORT_2; 1121 imask |= portirq_msk[port];
1055 sky2_write32(hw, B0_IMSK, imask); 1122 sky2_write32(hw, B0_IMSK, imask);
1056 1123
1057 return 0; 1124 return 0;
@@ -1079,7 +1146,7 @@ err_out:
1079/* Modular subtraction in ring */ 1146/* Modular subtraction in ring */
1080static inline int tx_dist(unsigned tail, unsigned head) 1147static inline int tx_dist(unsigned tail, unsigned head)
1081{ 1148{
1082 return (head - tail) % TX_RING_SIZE; 1149 return (head - tail) & (TX_RING_SIZE - 1);
1083} 1150}
1084 1151
1085/* Number of list elements available for next tx */ 1152/* Number of list elements available for next tx */
@@ -1256,7 +1323,7 @@ static int sky2_xmit_frame(struct sk_buff *skb, struct net_device *dev)
1256 le->opcode = OP_BUFFER | HW_OWNER; 1323 le->opcode = OP_BUFFER | HW_OWNER;
1257 1324
1258 fre = sky2->tx_ring 1325 fre = sky2->tx_ring
1259 + ((re - sky2->tx_ring) + i + 1) % TX_RING_SIZE; 1326 + RING_NEXT((re - sky2->tx_ring) + i, TX_RING_SIZE);
1260 pci_unmap_addr_set(fre, mapaddr, mapping); 1327 pci_unmap_addr_set(fre, mapaddr, mapping);
1261 } 1328 }
1262 1329
@@ -1316,7 +1383,7 @@ static void sky2_tx_complete(struct sky2_port *sky2, u16 done)
1316 1383
1317 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { 1384 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
1318 struct tx_ring_info *fre; 1385 struct tx_ring_info *fre;
1319 fre = sky2->tx_ring + (put + i + 1) % TX_RING_SIZE; 1386 fre = sky2->tx_ring + RING_NEXT(put + i, TX_RING_SIZE);
1320 pci_unmap_page(pdev, pci_unmap_addr(fre, mapaddr), 1387 pci_unmap_page(pdev, pci_unmap_addr(fre, mapaddr),
1321 skb_shinfo(skb)->frags[i].size, 1388 skb_shinfo(skb)->frags[i].size,
1322 PCI_DMA_TODEVICE); 1389 PCI_DMA_TODEVICE);
@@ -1402,7 +1469,7 @@ static int sky2_down(struct net_device *dev)
1402 1469
1403 /* Disable port IRQ */ 1470 /* Disable port IRQ */
1404 imask = sky2_read32(hw, B0_IMSK); 1471 imask = sky2_read32(hw, B0_IMSK);
1405 imask &= ~(sky2->port == 0) ? Y2_IS_PORT_1 : Y2_IS_PORT_2; 1472 imask &= ~portirq_msk[port];
1406 sky2_write32(hw, B0_IMSK, imask); 1473 sky2_write32(hw, B0_IMSK, imask);
1407 1474
1408 /* turn off LED's */ 1475 /* turn off LED's */
@@ -1499,17 +1566,26 @@ static void sky2_link_up(struct sky2_port *sky2)
1499 sky2_write8(hw, SK_REG(port, LNK_LED_REG), 1566 sky2_write8(hw, SK_REG(port, LNK_LED_REG),
1500 LINKLED_ON | LINKLED_BLINK_OFF | LINKLED_LINKSYNC_OFF); 1567 LINKLED_ON | LINKLED_BLINK_OFF | LINKLED_LINKSYNC_OFF);
1501 1568
1502 if (hw->chip_id == CHIP_ID_YUKON_XL) { 1569 if (hw->chip_id == CHIP_ID_YUKON_XL || hw->chip_id == CHIP_ID_YUKON_EC_U) {
1503 u16 pg = gm_phy_read(hw, port, PHY_MARV_EXT_ADR); 1570 u16 pg = gm_phy_read(hw, port, PHY_MARV_EXT_ADR);
1571 u16 led = PHY_M_LEDC_LOS_CTRL(1); /* link active */
1572
1573 switch(sky2->speed) {
1574 case SPEED_10:
1575 led |= PHY_M_LEDC_INIT_CTRL(7);
1576 break;
1577
1578 case SPEED_100:
1579 led |= PHY_M_LEDC_STA1_CTRL(7);
1580 break;
1581
1582 case SPEED_1000:
1583 led |= PHY_M_LEDC_STA0_CTRL(7);
1584 break;
1585 }
1504 1586
1505 gm_phy_write(hw, port, PHY_MARV_EXT_ADR, 3); 1587 gm_phy_write(hw, port, PHY_MARV_EXT_ADR, 3);
1506 gm_phy_write(hw, port, PHY_MARV_PHY_CTRL, PHY_M_LEDC_LOS_CTRL(1) | /* LINK/ACT */ 1588 gm_phy_write(hw, port, PHY_MARV_PHY_CTRL, led);
1507 PHY_M_LEDC_INIT_CTRL(sky2->speed ==
1508 SPEED_10 ? 7 : 0) |
1509 PHY_M_LEDC_STA1_CTRL(sky2->speed ==
1510 SPEED_100 ? 7 : 0) |
1511 PHY_M_LEDC_STA0_CTRL(sky2->speed ==
1512 SPEED_1000 ? 7 : 0));
1513 gm_phy_write(hw, port, PHY_MARV_EXT_ADR, pg); 1589 gm_phy_write(hw, port, PHY_MARV_EXT_ADR, pg);
1514 } 1590 }
1515 1591
@@ -1584,7 +1660,7 @@ static int sky2_autoneg_done(struct sky2_port *sky2, u16 aux)
1584 sky2->speed = sky2_phy_speed(hw, aux); 1660 sky2->speed = sky2_phy_speed(hw, aux);
1585 1661
1586 /* Pause bits are offset (9..8) */ 1662 /* Pause bits are offset (9..8) */
1587 if (hw->chip_id == CHIP_ID_YUKON_XL) 1663 if (hw->chip_id == CHIP_ID_YUKON_XL || hw->chip_id == CHIP_ID_YUKON_EC_U)
1588 aux >>= 6; 1664 aux >>= 6;
1589 1665
1590 sky2->rx_pause = (aux & PHY_M_PS_RX_P_EN) != 0; 1666 sky2->rx_pause = (aux & PHY_M_PS_RX_P_EN) != 0;
@@ -1686,13 +1762,12 @@ static void sky2_tx_timeout(struct net_device *dev)
1686} 1762}
1687 1763
1688 1764
1689#define roundup(x, y) ((((x)+((y)-1))/(y))*(y))
1690/* Want receive buffer size to be multiple of 64 bits 1765/* Want receive buffer size to be multiple of 64 bits
1691 * and incl room for vlan and truncation 1766 * and incl room for vlan and truncation
1692 */ 1767 */
1693static inline unsigned sky2_buf_size(int mtu) 1768static inline unsigned sky2_buf_size(int mtu)
1694{ 1769{
1695 return roundup(mtu + ETH_HLEN + VLAN_HLEN, 8) + 8; 1770 return ALIGN(mtu + ETH_HLEN + VLAN_HLEN, 8) + 8;
1696} 1771}
1697 1772
1698static int sky2_change_mtu(struct net_device *dev, int new_mtu) 1773static int sky2_change_mtu(struct net_device *dev, int new_mtu)
@@ -1857,39 +1932,38 @@ static inline void sky2_tx_done(struct net_device *dev, u16 last)
1857 } 1932 }
1858} 1933}
1859 1934
1935/* Is status ring empty or is there more to do? */
1936static inline int sky2_more_work(const struct sky2_hw *hw)
1937{
1938 return (hw->st_idx != sky2_read16(hw, STAT_PUT_IDX));
1939}
1940
1860/* Process status response ring */ 1941/* Process status response ring */
1861static int sky2_status_intr(struct sky2_hw *hw, int to_do) 1942static int sky2_status_intr(struct sky2_hw *hw, int to_do)
1862{ 1943{
1863 int work_done = 0; 1944 int work_done = 0;
1945 u16 hwidx = sky2_read16(hw, STAT_PUT_IDX);
1864 1946
1865 rmb(); 1947 rmb();
1866 1948
1867 for(;;) { 1949 while (hw->st_idx != hwidx) {
1868 struct sky2_status_le *le = hw->st_le + hw->st_idx; 1950 struct sky2_status_le *le = hw->st_le + hw->st_idx;
1869 struct net_device *dev; 1951 struct net_device *dev;
1870 struct sky2_port *sky2; 1952 struct sky2_port *sky2;
1871 struct sk_buff *skb; 1953 struct sk_buff *skb;
1872 u32 status; 1954 u32 status;
1873 u16 length; 1955 u16 length;
1874 u8 link, opcode;
1875 1956
1876 opcode = le->opcode; 1957 hw->st_idx = RING_NEXT(hw->st_idx, STATUS_RING_SIZE);
1877 if (!opcode)
1878 break;
1879 opcode &= ~HW_OWNER;
1880 1958
1881 hw->st_idx = (hw->st_idx + 1) % STATUS_RING_SIZE; 1959 BUG_ON(le->link >= 2);
1882 le->opcode = 0; 1960 dev = hw->dev[le->link];
1883
1884 link = le->link;
1885 BUG_ON(link >= 2);
1886 dev = hw->dev[link];
1887 1961
1888 sky2 = netdev_priv(dev); 1962 sky2 = netdev_priv(dev);
1889 length = le->length; 1963 length = le->length;
1890 status = le->status; 1964 status = le->status;
1891 1965
1892 switch (opcode) { 1966 switch (le->opcode & ~HW_OWNER) {
1893 case OP_RXSTAT: 1967 case OP_RXSTAT:
1894 skb = sky2_receive(sky2, length, status); 1968 skb = sky2_receive(sky2, length, status);
1895 if (!skb) 1969 if (!skb)
@@ -1929,7 +2003,8 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do)
1929 2003
1930 case OP_TXINDEXLE: 2004 case OP_TXINDEXLE:
1931 /* TX index reports status for both ports */ 2005 /* TX index reports status for both ports */
1932 sky2_tx_done(hw->dev[0], status & 0xffff); 2006 BUILD_BUG_ON(TX_RING_SIZE > 0x1000);
2007 sky2_tx_done(hw->dev[0], status & 0xfff);
1933 if (hw->dev[1]) 2008 if (hw->dev[1])
1934 sky2_tx_done(hw->dev[1], 2009 sky2_tx_done(hw->dev[1],
1935 ((status >> 24) & 0xff) 2010 ((status >> 24) & 0xff)
@@ -1939,8 +2014,8 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do)
1939 default: 2014 default:
1940 if (net_ratelimit()) 2015 if (net_ratelimit())
1941 printk(KERN_WARNING PFX 2016 printk(KERN_WARNING PFX
1942 "unknown status opcode 0x%x\n", opcode); 2017 "unknown status opcode 0x%x\n", le->opcode);
1943 break; 2018 goto exit_loop;
1944 } 2019 }
1945 } 2020 }
1946 2021
@@ -2086,6 +2161,21 @@ static void sky2_descriptor_error(struct sky2_hw *hw, unsigned port,
2086 } 2161 }
2087} 2162}
2088 2163
2164/* If idle then force a fake soft NAPI poll once a second
2165 * to work around cases where sharing an edge triggered interrupt.
2166 */
2167static void sky2_idle(unsigned long arg)
2168{
2169 struct sky2_hw *hw = (struct sky2_hw *) arg;
2170 struct net_device *dev = hw->dev[0];
2171
2172 if (__netif_rx_schedule_prep(dev))
2173 __netif_rx_schedule(dev);
2174
2175 mod_timer(&hw->idle_timer, jiffies + msecs_to_jiffies(idle_timeout));
2176}
2177
2178
2089static int sky2_poll(struct net_device *dev0, int *budget) 2179static int sky2_poll(struct net_device *dev0, int *budget)
2090{ 2180{
2091 struct sky2_hw *hw = ((struct sky2_port *) netdev_priv(dev0))->hw; 2181 struct sky2_hw *hw = ((struct sky2_port *) netdev_priv(dev0))->hw;
@@ -2093,49 +2183,46 @@ static int sky2_poll(struct net_device *dev0, int *budget)
2093 int work_done = 0; 2183 int work_done = 0;
2094 u32 status = sky2_read32(hw, B0_Y2_SP_EISR); 2184 u32 status = sky2_read32(hw, B0_Y2_SP_EISR);
2095 2185
2096 if (unlikely(status & ~Y2_IS_STAT_BMU)) { 2186 if (status & Y2_IS_HW_ERR)
2097 if (status & Y2_IS_HW_ERR) 2187 sky2_hw_intr(hw);
2098 sky2_hw_intr(hw);
2099
2100 if (status & Y2_IS_IRQ_PHY1)
2101 sky2_phy_intr(hw, 0);
2102 2188
2103 if (status & Y2_IS_IRQ_PHY2) 2189 if (status & Y2_IS_IRQ_PHY1)
2104 sky2_phy_intr(hw, 1); 2190 sky2_phy_intr(hw, 0);
2105 2191
2106 if (status & Y2_IS_IRQ_MAC1) 2192 if (status & Y2_IS_IRQ_PHY2)
2107 sky2_mac_intr(hw, 0); 2193 sky2_phy_intr(hw, 1);
2108 2194
2109 if (status & Y2_IS_IRQ_MAC2) 2195 if (status & Y2_IS_IRQ_MAC1)
2110 sky2_mac_intr(hw, 1); 2196 sky2_mac_intr(hw, 0);
2111 2197
2112 if (status & Y2_IS_CHK_RX1) 2198 if (status & Y2_IS_IRQ_MAC2)
2113 sky2_descriptor_error(hw, 0, "receive", Y2_IS_CHK_RX1); 2199 sky2_mac_intr(hw, 1);
2114 2200
2115 if (status & Y2_IS_CHK_RX2) 2201 if (status & Y2_IS_CHK_RX1)
2116 sky2_descriptor_error(hw, 1, "receive", Y2_IS_CHK_RX2); 2202 sky2_descriptor_error(hw, 0, "receive", Y2_IS_CHK_RX1);
2117 2203
2118 if (status & Y2_IS_CHK_TXA1) 2204 if (status & Y2_IS_CHK_RX2)
2119 sky2_descriptor_error(hw, 0, "transmit", Y2_IS_CHK_TXA1); 2205 sky2_descriptor_error(hw, 1, "receive", Y2_IS_CHK_RX2);
2120 2206
2121 if (status & Y2_IS_CHK_TXA2) 2207 if (status & Y2_IS_CHK_TXA1)
2122 sky2_descriptor_error(hw, 1, "transmit", Y2_IS_CHK_TXA2); 2208 sky2_descriptor_error(hw, 0, "transmit", Y2_IS_CHK_TXA1);
2123 }
2124 2209
2125 if (status & Y2_IS_STAT_BMU) { 2210 if (status & Y2_IS_CHK_TXA2)
2126 work_done = sky2_status_intr(hw, work_limit); 2211 sky2_descriptor_error(hw, 1, "transmit", Y2_IS_CHK_TXA2);
2127 *budget -= work_done;
2128 dev0->quota -= work_done;
2129 2212
2130 if (work_done >= work_limit) 2213 work_done = sky2_status_intr(hw, work_limit);
2131 return 1; 2214 *budget -= work_done;
2215 dev0->quota -= work_done;
2132 2216
2217 if (status & Y2_IS_STAT_BMU)
2133 sky2_write32(hw, STAT_CTRL, SC_STAT_CLR_IRQ); 2218 sky2_write32(hw, STAT_CTRL, SC_STAT_CLR_IRQ);
2134 } 2219
2220 if (sky2_more_work(hw))
2221 return 1;
2135 2222
2136 netif_rx_complete(dev0); 2223 netif_rx_complete(dev0);
2137 2224
2138 status = sky2_read32(hw, B0_Y2_SP_LISR); 2225 sky2_read32(hw, B0_Y2_SP_LISR);
2139 return 0; 2226 return 0;
2140} 2227}
2141 2228
@@ -2153,8 +2240,6 @@ static irqreturn_t sky2_intr(int irq, void *dev_id, struct pt_regs *regs)
2153 prefetch(&hw->st_le[hw->st_idx]); 2240 prefetch(&hw->st_le[hw->st_idx]);
2154 if (likely(__netif_rx_schedule_prep(dev0))) 2241 if (likely(__netif_rx_schedule_prep(dev0)))
2155 __netif_rx_schedule(dev0); 2242 __netif_rx_schedule(dev0);
2156 else
2157 printk(KERN_DEBUG PFX "irq race detected\n");
2158 2243
2159 return IRQ_HANDLED; 2244 return IRQ_HANDLED;
2160} 2245}
@@ -2193,7 +2278,7 @@ static inline u32 sky2_clk2us(const struct sky2_hw *hw, u32 clk)
2193} 2278}
2194 2279
2195 2280
2196static int sky2_reset(struct sky2_hw *hw) 2281static int __devinit sky2_reset(struct sky2_hw *hw)
2197{ 2282{
2198 u16 status; 2283 u16 status;
2199 u8 t8, pmd_type; 2284 u8 t8, pmd_type;
@@ -2218,13 +2303,6 @@ static int sky2_reset(struct sky2_hw *hw)
2218 return -EOPNOTSUPP; 2303 return -EOPNOTSUPP;
2219 } 2304 }
2220 2305
2221 /* This chip is new and not tested yet */
2222 if (hw->chip_id == CHIP_ID_YUKON_EC_U) {
2223 pr_info(PFX "%s: is a version of Yukon 2 chipset that has not been tested yet.\n",
2224 pci_name(hw->pdev));
2225 pr_info("Please report success/failure to maintainer <shemminger@osdl.org>\n");
2226 }
2227
2228 /* disable ASF */ 2306 /* disable ASF */
2229 if (hw->chip_id <= CHIP_ID_YUKON_EC) { 2307 if (hw->chip_id <= CHIP_ID_YUKON_EC) {
2230 sky2_write8(hw, B28_Y2_ASF_STAT_CMD, Y2_ASF_RESET); 2308 sky2_write8(hw, B28_Y2_ASF_STAT_CMD, Y2_ASF_RESET);
@@ -3028,12 +3106,7 @@ static __devinit struct net_device *sky2_init_netdev(struct sky2_hw *hw,
3028 sky2->duplex = -1; 3106 sky2->duplex = -1;
3029 sky2->speed = -1; 3107 sky2->speed = -1;
3030 sky2->advertising = sky2_supported_modes(hw); 3108 sky2->advertising = sky2_supported_modes(hw);
3031 3109 sky2->rx_csum = 1;
3032 /* Receive checksum disabled for Yukon XL
3033 * because of observed problems with incorrect
3034 * values when multiple packets are received in one interrupt
3035 */
3036 sky2->rx_csum = (hw->chip_id != CHIP_ID_YUKON_XL);
3037 3110
3038 spin_lock_init(&sky2->phy_lock); 3111 spin_lock_init(&sky2->phy_lock);
3039 sky2->tx_pending = TX_DEF_PENDING; 3112 sky2->tx_pending = TX_DEF_PENDING;
@@ -3276,6 +3349,11 @@ static int __devinit sky2_probe(struct pci_dev *pdev,
3276 3349
3277 sky2_write32(hw, B0_IMSK, Y2_IS_BASE); 3350 sky2_write32(hw, B0_IMSK, Y2_IS_BASE);
3278 3351
3352 setup_timer(&hw->idle_timer, sky2_idle, (unsigned long) hw);
3353 if (idle_timeout > 0)
3354 mod_timer(&hw->idle_timer,
3355 jiffies + msecs_to_jiffies(idle_timeout));
3356
3279 pci_set_drvdata(pdev, hw); 3357 pci_set_drvdata(pdev, hw);
3280 3358
3281 return 0; 3359 return 0;
@@ -3311,13 +3389,17 @@ static void __devexit sky2_remove(struct pci_dev *pdev)
3311 if (!hw) 3389 if (!hw)
3312 return; 3390 return;
3313 3391
3392 del_timer_sync(&hw->idle_timer);
3393
3394 sky2_write32(hw, B0_IMSK, 0);
3395 synchronize_irq(hw->pdev->irq);
3396
3314 dev0 = hw->dev[0]; 3397 dev0 = hw->dev[0];
3315 dev1 = hw->dev[1]; 3398 dev1 = hw->dev[1];
3316 if (dev1) 3399 if (dev1)
3317 unregister_netdev(dev1); 3400 unregister_netdev(dev1);
3318 unregister_netdev(dev0); 3401 unregister_netdev(dev0);
3319 3402
3320 sky2_write32(hw, B0_IMSK, 0);
3321 sky2_set_power_state(hw, PCI_D3hot); 3403 sky2_set_power_state(hw, PCI_D3hot);
3322 sky2_write16(hw, B0_Y2LED, LED_STAT_OFF); 3404 sky2_write16(hw, B0_Y2LED, LED_STAT_OFF);
3323 sky2_write8(hw, B0_CTST, CS_RST_SET); 3405 sky2_write8(hw, B0_CTST, CS_RST_SET);
diff --git a/drivers/net/sky2.h b/drivers/net/sky2.h
index 89dd18cd12f0..8a0bc5525f0a 100644
--- a/drivers/net/sky2.h
+++ b/drivers/net/sky2.h
@@ -214,6 +214,8 @@ enum csr_regs {
214enum { 214enum {
215 Y2_VMAIN_AVAIL = 1<<17,/* VMAIN available (YUKON-2 only) */ 215 Y2_VMAIN_AVAIL = 1<<17,/* VMAIN available (YUKON-2 only) */
216 Y2_VAUX_AVAIL = 1<<16,/* VAUX available (YUKON-2 only) */ 216 Y2_VAUX_AVAIL = 1<<16,/* VAUX available (YUKON-2 only) */
217 Y2_HW_WOL_ON = 1<<15,/* HW WOL On (Yukon-EC Ultra A1 only) */
218 Y2_HW_WOL_OFF = 1<<14,/* HW WOL On (Yukon-EC Ultra A1 only) */
217 Y2_ASF_ENABLE = 1<<13,/* ASF Unit Enable (YUKON-2 only) */ 219 Y2_ASF_ENABLE = 1<<13,/* ASF Unit Enable (YUKON-2 only) */
218 Y2_ASF_DISABLE = 1<<12,/* ASF Unit Disable (YUKON-2 only) */ 220 Y2_ASF_DISABLE = 1<<12,/* ASF Unit Disable (YUKON-2 only) */
219 Y2_CLK_RUN_ENA = 1<<11,/* CLK_RUN Enable (YUKON-2 only) */ 221 Y2_CLK_RUN_ENA = 1<<11,/* CLK_RUN Enable (YUKON-2 only) */
@@ -378,6 +380,9 @@ enum {
378 CHIP_REV_YU_EC_A1 = 0, /* Chip Rev. for Yukon-EC A1/A0 */ 380 CHIP_REV_YU_EC_A1 = 0, /* Chip Rev. for Yukon-EC A1/A0 */
379 CHIP_REV_YU_EC_A2 = 1, /* Chip Rev. for Yukon-EC A2 */ 381 CHIP_REV_YU_EC_A2 = 1, /* Chip Rev. for Yukon-EC A2 */
380 CHIP_REV_YU_EC_A3 = 2, /* Chip Rev. for Yukon-EC A3 */ 382 CHIP_REV_YU_EC_A3 = 2, /* Chip Rev. for Yukon-EC A3 */
383
384 CHIP_REV_YU_EC_U_A0 = 0,
385 CHIP_REV_YU_EC_U_A1 = 1,
381}; 386};
382 387
383/* B2_Y2_CLK_GATE 8 bit Clock Gating (Yukon-2 only) */ 388/* B2_Y2_CLK_GATE 8 bit Clock Gating (Yukon-2 only) */
@@ -1880,6 +1885,8 @@ struct sky2_hw {
1880 struct sky2_status_le *st_le; 1885 struct sky2_status_le *st_le;
1881 u32 st_idx; 1886 u32 st_idx;
1882 dma_addr_t st_dma; 1887 dma_addr_t st_dma;
1888
1889 struct timer_list idle_timer;
1883 int msi_detected; 1890 int msi_detected;
1884 wait_queue_head_t msi_wait; 1891 wait_queue_head_t msi_wait;
1885}; 1892};
diff --git a/drivers/net/spider_net.c b/drivers/net/spider_net.c
index 43f5e86fc559..394339d5e87c 100644
--- a/drivers/net/spider_net.c
+++ b/drivers/net/spider_net.c
@@ -1652,6 +1652,8 @@ spider_net_enable_card(struct spider_net_card *card)
1652 { SPIDER_NET_GFTRESTRT, SPIDER_NET_RESTART_VALUE }, 1652 { SPIDER_NET_GFTRESTRT, SPIDER_NET_RESTART_VALUE },
1653 1653
1654 { SPIDER_NET_GMRWOLCTRL, 0 }, 1654 { SPIDER_NET_GMRWOLCTRL, 0 },
1655 { SPIDER_NET_GTESTMD, 0x10000000 },
1656 { SPIDER_NET_GTTQMSK, 0x00400040 },
1655 { SPIDER_NET_GTESTMD, 0 }, 1657 { SPIDER_NET_GTESTMD, 0 },
1656 1658
1657 { SPIDER_NET_GMACINTEN, 0 }, 1659 { SPIDER_NET_GMACINTEN, 0 },
@@ -1792,15 +1794,7 @@ spider_net_setup_phy(struct spider_net_card *card)
1792 if (phy->def->ops->setup_forced) 1794 if (phy->def->ops->setup_forced)
1793 phy->def->ops->setup_forced(phy, SPEED_1000, DUPLEX_FULL); 1795 phy->def->ops->setup_forced(phy, SPEED_1000, DUPLEX_FULL);
1794 1796
1795 /* the following two writes could be moved to sungem_phy.c */ 1797 phy->def->ops->enable_fiber(phy);
1796 /* enable fiber mode */
1797 spider_net_write_phy(card->netdev, 1, MII_NCONFIG, 0x9020);
1798 /* LEDs active in both modes, autosense prio = fiber */
1799 spider_net_write_phy(card->netdev, 1, MII_NCONFIG, 0x945f);
1800
1801 /* switch off fibre autoneg */
1802 spider_net_write_phy(card->netdev, 1, MII_NCONFIG, 0xfc01);
1803 spider_net_write_phy(card->netdev, 1, 0x0b, 0x0004);
1804 1798
1805 phy->def->ops->read_link(phy); 1799 phy->def->ops->read_link(phy);
1806 pr_info("Found %s with %i Mbps, %s-duplex.\n", phy->def->name, 1800 pr_info("Found %s with %i Mbps, %s-duplex.\n", phy->def->name,
diff --git a/drivers/net/spider_net.h b/drivers/net/spider_net.h
index 5922b529a048..3b8d951cf73c 100644
--- a/drivers/net/spider_net.h
+++ b/drivers/net/spider_net.h
@@ -120,6 +120,8 @@ extern char spider_net_driver_name[];
120#define SPIDER_NET_GMRUAFILnR 0x00000500 120#define SPIDER_NET_GMRUAFILnR 0x00000500
121#define SPIDER_NET_GMRUA0FIL15R 0x00000578 121#define SPIDER_NET_GMRUA0FIL15R 0x00000578
122 122
123#define SPIDER_NET_GTTQMSK 0x00000934
124
123/* RX DMA controller registers, all 0x00000a.. are for DMA controller A, 125/* RX DMA controller registers, all 0x00000a.. are for DMA controller A,
124 * 0x00000b.. for DMA controller B, etc. */ 126 * 0x00000b.. for DMA controller B, etc. */
125#define SPIDER_NET_GDADCHA 0x00000a00 127#define SPIDER_NET_GDADCHA 0x00000a00
diff --git a/drivers/net/sungem_phy.c b/drivers/net/sungem_phy.c
index cb0aba95d4e3..b2ddd5e79303 100644
--- a/drivers/net/sungem_phy.c
+++ b/drivers/net/sungem_phy.c
@@ -275,7 +275,7 @@ static int bcm5411_init(struct mii_phy* phy)
275 return 0; 275 return 0;
276} 276}
277 277
278static int bcm5411_suspend(struct mii_phy* phy) 278static int generic_suspend(struct mii_phy* phy)
279{ 279{
280 phy_write(phy, MII_BMCR, BMCR_PDOWN); 280 phy_write(phy, MII_BMCR, BMCR_PDOWN);
281 281
@@ -329,6 +329,30 @@ static int bcm5421_init(struct mii_phy* phy)
329 return 0; 329 return 0;
330} 330}
331 331
332static int bcm5421_enable_fiber(struct mii_phy* phy)
333{
334 /* enable fiber mode */
335 phy_write(phy, MII_NCONFIG, 0x9020);
336 /* LEDs active in both modes, autosense prio = fiber */
337 phy_write(phy, MII_NCONFIG, 0x945f);
338
339 /* switch off fibre autoneg */
340 phy_write(phy, MII_NCONFIG, 0xfc01);
341 phy_write(phy, 0x0b, 0x0004);
342
343 return 0;
344}
345
346static int bcm5461_enable_fiber(struct mii_phy* phy)
347{
348 phy_write(phy, MII_NCONFIG, 0xfc0c);
349 phy_write(phy, MII_BMCR, 0x4140);
350 phy_write(phy, MII_NCONFIG, 0xfc0b);
351 phy_write(phy, MII_BMCR, 0x0140);
352
353 return 0;
354}
355
332static int bcm54xx_setup_aneg(struct mii_phy *phy, u32 advertise) 356static int bcm54xx_setup_aneg(struct mii_phy *phy, u32 advertise)
333{ 357{
334 u16 ctl, adv; 358 u16 ctl, adv;
@@ -738,7 +762,7 @@ static struct mii_phy_def bcm5401_phy_def = {
738/* Broadcom BCM 5411 */ 762/* Broadcom BCM 5411 */
739static struct mii_phy_ops bcm5411_phy_ops = { 763static struct mii_phy_ops bcm5411_phy_ops = {
740 .init = bcm5411_init, 764 .init = bcm5411_init,
741 .suspend = bcm5411_suspend, 765 .suspend = generic_suspend,
742 .setup_aneg = bcm54xx_setup_aneg, 766 .setup_aneg = bcm54xx_setup_aneg,
743 .setup_forced = bcm54xx_setup_forced, 767 .setup_forced = bcm54xx_setup_forced,
744 .poll_link = genmii_poll_link, 768 .poll_link = genmii_poll_link,
@@ -757,11 +781,12 @@ static struct mii_phy_def bcm5411_phy_def = {
757/* Broadcom BCM 5421 */ 781/* Broadcom BCM 5421 */
758static struct mii_phy_ops bcm5421_phy_ops = { 782static struct mii_phy_ops bcm5421_phy_ops = {
759 .init = bcm5421_init, 783 .init = bcm5421_init,
760 .suspend = bcm5411_suspend, 784 .suspend = generic_suspend,
761 .setup_aneg = bcm54xx_setup_aneg, 785 .setup_aneg = bcm54xx_setup_aneg,
762 .setup_forced = bcm54xx_setup_forced, 786 .setup_forced = bcm54xx_setup_forced,
763 .poll_link = genmii_poll_link, 787 .poll_link = genmii_poll_link,
764 .read_link = bcm54xx_read_link, 788 .read_link = bcm54xx_read_link,
789 .enable_fiber = bcm5421_enable_fiber,
765}; 790};
766 791
767static struct mii_phy_def bcm5421_phy_def = { 792static struct mii_phy_def bcm5421_phy_def = {
@@ -776,7 +801,7 @@ static struct mii_phy_def bcm5421_phy_def = {
776/* Broadcom BCM 5421 built-in K2 */ 801/* Broadcom BCM 5421 built-in K2 */
777static struct mii_phy_ops bcm5421k2_phy_ops = { 802static struct mii_phy_ops bcm5421k2_phy_ops = {
778 .init = bcm5421_init, 803 .init = bcm5421_init,
779 .suspend = bcm5411_suspend, 804 .suspend = generic_suspend,
780 .setup_aneg = bcm54xx_setup_aneg, 805 .setup_aneg = bcm54xx_setup_aneg,
781 .setup_forced = bcm54xx_setup_forced, 806 .setup_forced = bcm54xx_setup_forced,
782 .poll_link = genmii_poll_link, 807 .poll_link = genmii_poll_link,
@@ -792,10 +817,29 @@ static struct mii_phy_def bcm5421k2_phy_def = {
792 .ops = &bcm5421k2_phy_ops 817 .ops = &bcm5421k2_phy_ops
793}; 818};
794 819
820static struct mii_phy_ops bcm5461_phy_ops = {
821 .init = bcm5421_init,
822 .suspend = generic_suspend,
823 .setup_aneg = bcm54xx_setup_aneg,
824 .setup_forced = bcm54xx_setup_forced,
825 .poll_link = genmii_poll_link,
826 .read_link = bcm54xx_read_link,
827 .enable_fiber = bcm5461_enable_fiber,
828};
829
830static struct mii_phy_def bcm5461_phy_def = {
831 .phy_id = 0x002060c0,
832 .phy_id_mask = 0xfffffff0,
833 .name = "BCM5461",
834 .features = MII_GBIT_FEATURES,
835 .magic_aneg = 1,
836 .ops = &bcm5461_phy_ops
837};
838
795/* Broadcom BCM 5462 built-in Vesta */ 839/* Broadcom BCM 5462 built-in Vesta */
796static struct mii_phy_ops bcm5462V_phy_ops = { 840static struct mii_phy_ops bcm5462V_phy_ops = {
797 .init = bcm5421_init, 841 .init = bcm5421_init,
798 .suspend = bcm5411_suspend, 842 .suspend = generic_suspend,
799 .setup_aneg = bcm54xx_setup_aneg, 843 .setup_aneg = bcm54xx_setup_aneg,
800 .setup_forced = bcm54xx_setup_forced, 844 .setup_forced = bcm54xx_setup_forced,
801 .poll_link = genmii_poll_link, 845 .poll_link = genmii_poll_link,
@@ -816,6 +860,7 @@ static struct mii_phy_def bcm5462V_phy_def = {
816 * would be useful here) --BenH. 860 * would be useful here) --BenH.
817 */ 861 */
818static struct mii_phy_ops marvell_phy_ops = { 862static struct mii_phy_ops marvell_phy_ops = {
863 .suspend = generic_suspend,
819 .setup_aneg = marvell_setup_aneg, 864 .setup_aneg = marvell_setup_aneg,
820 .setup_forced = marvell_setup_forced, 865 .setup_forced = marvell_setup_forced,
821 .poll_link = genmii_poll_link, 866 .poll_link = genmii_poll_link,
@@ -856,6 +901,7 @@ static struct mii_phy_def* mii_phy_table[] = {
856 &bcm5411_phy_def, 901 &bcm5411_phy_def,
857 &bcm5421_phy_def, 902 &bcm5421_phy_def,
858 &bcm5421k2_phy_def, 903 &bcm5421k2_phy_def,
904 &bcm5461_phy_def,
859 &bcm5462V_phy_def, 905 &bcm5462V_phy_def,
860 &marvell_phy_def, 906 &marvell_phy_def,
861 &genmii_phy_def, 907 &genmii_phy_def,
diff --git a/drivers/net/sungem_phy.h b/drivers/net/sungem_phy.h
index 430544496c52..69e125197fcf 100644
--- a/drivers/net/sungem_phy.h
+++ b/drivers/net/sungem_phy.h
@@ -12,6 +12,7 @@ struct mii_phy_ops
12 int (*setup_forced)(struct mii_phy *phy, int speed, int fd); 12 int (*setup_forced)(struct mii_phy *phy, int speed, int fd);
13 int (*poll_link)(struct mii_phy *phy); 13 int (*poll_link)(struct mii_phy *phy);
14 int (*read_link)(struct mii_phy *phy); 14 int (*read_link)(struct mii_phy *phy);
15 int (*enable_fiber)(struct mii_phy *phy);
15}; 16};
16 17
17/* Structure used to statically define an mii/gii based PHY */ 18/* Structure used to statically define an mii/gii based PHY */
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 73e271e59c6a..49ad60b72657 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -69,8 +69,8 @@
69 69
70#define DRV_MODULE_NAME "tg3" 70#define DRV_MODULE_NAME "tg3"
71#define PFX DRV_MODULE_NAME ": " 71#define PFX DRV_MODULE_NAME ": "
72#define DRV_MODULE_VERSION "3.56" 72#define DRV_MODULE_VERSION "3.58"
73#define DRV_MODULE_RELDATE "Apr 1, 2006" 73#define DRV_MODULE_RELDATE "May 22, 2006"
74 74
75#define TG3_DEF_MAC_MODE 0 75#define TG3_DEF_MAC_MODE 0
76#define TG3_DEF_RX_MODE 0 76#define TG3_DEF_RX_MODE 0
@@ -974,6 +974,8 @@ static int tg3_phy_reset_5703_4_5(struct tg3 *tp)
974 return err; 974 return err;
975} 975}
976 976
977static void tg3_link_report(struct tg3 *);
978
977/* This will reset the tigon3 PHY if there is no valid 979/* This will reset the tigon3 PHY if there is no valid
978 * link unless the FORCE argument is non-zero. 980 * link unless the FORCE argument is non-zero.
979 */ 981 */
@@ -987,6 +989,11 @@ static int tg3_phy_reset(struct tg3 *tp)
987 if (err != 0) 989 if (err != 0)
988 return -EBUSY; 990 return -EBUSY;
989 991
992 if (netif_running(tp->dev) && netif_carrier_ok(tp->dev)) {
993 netif_carrier_off(tp->dev);
994 tg3_link_report(tp);
995 }
996
990 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5703 || 997 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5703 ||
991 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704 || 998 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704 ||
992 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705) { 999 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705) {
@@ -1023,6 +1030,12 @@ out:
1023 tg3_writephy(tp, MII_TG3_DSP_RW_PORT, 0x14e2); 1030 tg3_writephy(tp, MII_TG3_DSP_RW_PORT, 0x14e2);
1024 tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x0400); 1031 tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x0400);
1025 } 1032 }
1033 else if (tp->tg3_flags2 & TG3_FLG2_PHY_JITTER_BUG) {
1034 tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x0c00);
1035 tg3_writephy(tp, MII_TG3_DSP_ADDRESS, 0x000a);
1036 tg3_writephy(tp, MII_TG3_DSP_RW_PORT, 0x010b);
1037 tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x0400);
1038 }
1026 /* Set Extended packet length bit (bit 14) on all chips that */ 1039 /* Set Extended packet length bit (bit 14) on all chips that */
1027 /* support jumbo frames */ 1040 /* support jumbo frames */
1028 if ((tp->phy_id & PHY_ID_MASK) == PHY_ID_BCM5401) { 1041 if ((tp->phy_id & PHY_ID_MASK) == PHY_ID_BCM5401) {
@@ -3531,7 +3544,7 @@ static irqreturn_t tg3_test_isr(int irq, void *dev_id,
3531 return IRQ_RETVAL(0); 3544 return IRQ_RETVAL(0);
3532} 3545}
3533 3546
3534static int tg3_init_hw(struct tg3 *); 3547static int tg3_init_hw(struct tg3 *, int);
3535static int tg3_halt(struct tg3 *, int, int); 3548static int tg3_halt(struct tg3 *, int, int);
3536 3549
3537#ifdef CONFIG_NET_POLL_CONTROLLER 3550#ifdef CONFIG_NET_POLL_CONTROLLER
@@ -3567,7 +3580,7 @@ static void tg3_reset_task(void *_data)
3567 tp->tg3_flags2 &= ~TG3_FLG2_RESTART_TIMER; 3580 tp->tg3_flags2 &= ~TG3_FLG2_RESTART_TIMER;
3568 3581
3569 tg3_halt(tp, RESET_KIND_SHUTDOWN, 0); 3582 tg3_halt(tp, RESET_KIND_SHUTDOWN, 0);
3570 tg3_init_hw(tp); 3583 tg3_init_hw(tp, 1);
3571 3584
3572 tg3_netif_start(tp); 3585 tg3_netif_start(tp);
3573 3586
@@ -4042,7 +4055,7 @@ static int tg3_change_mtu(struct net_device *dev, int new_mtu)
4042 4055
4043 tg3_set_mtu(dev, tp, new_mtu); 4056 tg3_set_mtu(dev, tp, new_mtu);
4044 4057
4045 tg3_init_hw(tp); 4058 tg3_init_hw(tp, 0);
4046 4059
4047 tg3_netif_start(tp); 4060 tg3_netif_start(tp);
4048 4061
@@ -5719,9 +5732,23 @@ static int tg3_set_mac_addr(struct net_device *dev, void *p)
5719 if (!netif_running(dev)) 5732 if (!netif_running(dev))
5720 return 0; 5733 return 0;
5721 5734
5722 spin_lock_bh(&tp->lock); 5735 if (tp->tg3_flags & TG3_FLAG_ENABLE_ASF) {
5723 __tg3_set_mac_addr(tp); 5736 /* Reset chip so that ASF can re-init any MAC addresses it
5724 spin_unlock_bh(&tp->lock); 5737 * needs.
5738 */
5739 tg3_netif_stop(tp);
5740 tg3_full_lock(tp, 1);
5741
5742 tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
5743 tg3_init_hw(tp, 0);
5744
5745 tg3_netif_start(tp);
5746 tg3_full_unlock(tp);
5747 } else {
5748 spin_lock_bh(&tp->lock);
5749 __tg3_set_mac_addr(tp);
5750 spin_unlock_bh(&tp->lock);
5751 }
5725 5752
5726 return 0; 5753 return 0;
5727} 5754}
@@ -5771,7 +5798,7 @@ static void __tg3_set_coalesce(struct tg3 *tp, struct ethtool_coalesce *ec)
5771} 5798}
5772 5799
5773/* tp->lock is held. */ 5800/* tp->lock is held. */
5774static int tg3_reset_hw(struct tg3 *tp) 5801static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
5775{ 5802{
5776 u32 val, rdmac_mode; 5803 u32 val, rdmac_mode;
5777 int i, err, limit; 5804 int i, err, limit;
@@ -5786,7 +5813,7 @@ static int tg3_reset_hw(struct tg3 *tp)
5786 tg3_abort_hw(tp, 1); 5813 tg3_abort_hw(tp, 1);
5787 } 5814 }
5788 5815
5789 if (tp->tg3_flags2 & TG3_FLG2_MII_SERDES) 5816 if ((tp->tg3_flags2 & TG3_FLG2_MII_SERDES) && reset_phy)
5790 tg3_phy_reset(tp); 5817 tg3_phy_reset(tp);
5791 5818
5792 err = tg3_chip_reset(tp); 5819 err = tg3_chip_reset(tp);
@@ -6327,7 +6354,7 @@ static int tg3_reset_hw(struct tg3 *tp)
6327 tw32(GRC_LOCAL_CTRL, tp->grc_local_ctrl); 6354 tw32(GRC_LOCAL_CTRL, tp->grc_local_ctrl);
6328 } 6355 }
6329 6356
6330 err = tg3_setup_phy(tp, 1); 6357 err = tg3_setup_phy(tp, reset_phy);
6331 if (err) 6358 if (err)
6332 return err; 6359 return err;
6333 6360
@@ -6400,7 +6427,7 @@ static int tg3_reset_hw(struct tg3 *tp)
6400/* Called at device open time to get the chip ready for 6427/* Called at device open time to get the chip ready for
6401 * packet processing. Invoked with tp->lock held. 6428 * packet processing. Invoked with tp->lock held.
6402 */ 6429 */
6403static int tg3_init_hw(struct tg3 *tp) 6430static int tg3_init_hw(struct tg3 *tp, int reset_phy)
6404{ 6431{
6405 int err; 6432 int err;
6406 6433
@@ -6413,7 +6440,7 @@ static int tg3_init_hw(struct tg3 *tp)
6413 6440
6414 tw32(TG3PCI_MEM_WIN_BASE_ADDR, 0); 6441 tw32(TG3PCI_MEM_WIN_BASE_ADDR, 0);
6415 6442
6416 err = tg3_reset_hw(tp); 6443 err = tg3_reset_hw(tp, reset_phy);
6417 6444
6418out: 6445out:
6419 return err; 6446 return err;
@@ -6461,6 +6488,10 @@ static void tg3_periodic_fetch_stats(struct tg3 *tp)
6461 TG3_STAT_ADD32(&sp->rx_frame_too_long_errors, MAC_RX_STATS_FRAME_TOO_LONG); 6488 TG3_STAT_ADD32(&sp->rx_frame_too_long_errors, MAC_RX_STATS_FRAME_TOO_LONG);
6462 TG3_STAT_ADD32(&sp->rx_jabbers, MAC_RX_STATS_JABBERS); 6489 TG3_STAT_ADD32(&sp->rx_jabbers, MAC_RX_STATS_JABBERS);
6463 TG3_STAT_ADD32(&sp->rx_undersize_packets, MAC_RX_STATS_UNDERSIZE); 6490 TG3_STAT_ADD32(&sp->rx_undersize_packets, MAC_RX_STATS_UNDERSIZE);
6491
6492 TG3_STAT_ADD32(&sp->rxbds_empty, RCVLPC_NO_RCV_BD_CNT);
6493 TG3_STAT_ADD32(&sp->rx_discards, RCVLPC_IN_DISCARDS_CNT);
6494 TG3_STAT_ADD32(&sp->rx_errors, RCVLPC_IN_ERRORS_CNT);
6464} 6495}
6465 6496
6466static void tg3_timer(unsigned long __opaque) 6497static void tg3_timer(unsigned long __opaque)
@@ -6683,7 +6714,7 @@ static int tg3_test_msi(struct tg3 *tp)
6683 tg3_full_lock(tp, 1); 6714 tg3_full_lock(tp, 1);
6684 6715
6685 tg3_halt(tp, RESET_KIND_SHUTDOWN, 1); 6716 tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
6686 err = tg3_init_hw(tp); 6717 err = tg3_init_hw(tp, 1);
6687 6718
6688 tg3_full_unlock(tp); 6719 tg3_full_unlock(tp);
6689 6720
@@ -6748,7 +6779,7 @@ static int tg3_open(struct net_device *dev)
6748 6779
6749 tg3_full_lock(tp, 0); 6780 tg3_full_lock(tp, 0);
6750 6781
6751 err = tg3_init_hw(tp); 6782 err = tg3_init_hw(tp, 1);
6752 if (err) { 6783 if (err) {
6753 tg3_halt(tp, RESET_KIND_SHUTDOWN, 1); 6784 tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
6754 tg3_free_rings(tp); 6785 tg3_free_rings(tp);
@@ -7626,21 +7657,23 @@ static int tg3_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
7626 cmd->supported |= (SUPPORTED_1000baseT_Half | 7657 cmd->supported |= (SUPPORTED_1000baseT_Half |
7627 SUPPORTED_1000baseT_Full); 7658 SUPPORTED_1000baseT_Full);
7628 7659
7629 if (!(tp->tg3_flags2 & TG3_FLG2_ANY_SERDES)) 7660 if (!(tp->tg3_flags2 & TG3_FLG2_ANY_SERDES)) {
7630 cmd->supported |= (SUPPORTED_100baseT_Half | 7661 cmd->supported |= (SUPPORTED_100baseT_Half |
7631 SUPPORTED_100baseT_Full | 7662 SUPPORTED_100baseT_Full |
7632 SUPPORTED_10baseT_Half | 7663 SUPPORTED_10baseT_Half |
7633 SUPPORTED_10baseT_Full | 7664 SUPPORTED_10baseT_Full |
7634 SUPPORTED_MII); 7665 SUPPORTED_MII);
7635 else 7666 cmd->port = PORT_TP;
7667 } else {
7636 cmd->supported |= SUPPORTED_FIBRE; 7668 cmd->supported |= SUPPORTED_FIBRE;
7669 cmd->port = PORT_FIBRE;
7670 }
7637 7671
7638 cmd->advertising = tp->link_config.advertising; 7672 cmd->advertising = tp->link_config.advertising;
7639 if (netif_running(dev)) { 7673 if (netif_running(dev)) {
7640 cmd->speed = tp->link_config.active_speed; 7674 cmd->speed = tp->link_config.active_speed;
7641 cmd->duplex = tp->link_config.active_duplex; 7675 cmd->duplex = tp->link_config.active_duplex;
7642 } 7676 }
7643 cmd->port = 0;
7644 cmd->phy_address = PHY_ADDR; 7677 cmd->phy_address = PHY_ADDR;
7645 cmd->transceiver = 0; 7678 cmd->transceiver = 0;
7646 cmd->autoneg = tp->link_config.autoneg; 7679 cmd->autoneg = tp->link_config.autoneg;
@@ -7839,7 +7872,7 @@ static int tg3_set_ringparam(struct net_device *dev, struct ethtool_ringparam *e
7839 7872
7840 if (netif_running(dev)) { 7873 if (netif_running(dev)) {
7841 tg3_halt(tp, RESET_KIND_SHUTDOWN, 1); 7874 tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
7842 tg3_init_hw(tp); 7875 tg3_init_hw(tp, 1);
7843 tg3_netif_start(tp); 7876 tg3_netif_start(tp);
7844 } 7877 }
7845 7878
@@ -7884,7 +7917,7 @@ static int tg3_set_pauseparam(struct net_device *dev, struct ethtool_pauseparam
7884 7917
7885 if (netif_running(dev)) { 7918 if (netif_running(dev)) {
7886 tg3_halt(tp, RESET_KIND_SHUTDOWN, 1); 7919 tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
7887 tg3_init_hw(tp); 7920 tg3_init_hw(tp, 1);
7888 tg3_netif_start(tp); 7921 tg3_netif_start(tp);
7889 } 7922 }
7890 7923
@@ -8427,6 +8460,9 @@ static int tg3_run_loopback(struct tg3 *tp, int loopback_mode)
8427 8460
8428 tx_len = 1514; 8461 tx_len = 1514;
8429 skb = dev_alloc_skb(tx_len); 8462 skb = dev_alloc_skb(tx_len);
8463 if (!skb)
8464 return -ENOMEM;
8465
8430 tx_data = skb_put(skb, tx_len); 8466 tx_data = skb_put(skb, tx_len);
8431 memcpy(tx_data, tp->dev->dev_addr, 6); 8467 memcpy(tx_data, tp->dev->dev_addr, 6);
8432 memset(tx_data + 6, 0x0, 8); 8468 memset(tx_data + 6, 0x0, 8);
@@ -8522,7 +8558,7 @@ static int tg3_test_loopback(struct tg3 *tp)
8522 if (!netif_running(tp->dev)) 8558 if (!netif_running(tp->dev))
8523 return TG3_LOOPBACK_FAILED; 8559 return TG3_LOOPBACK_FAILED;
8524 8560
8525 tg3_reset_hw(tp); 8561 tg3_reset_hw(tp, 1);
8526 8562
8527 if (tg3_run_loopback(tp, TG3_MAC_LOOPBACK)) 8563 if (tg3_run_loopback(tp, TG3_MAC_LOOPBACK))
8528 err |= TG3_MAC_LOOPBACK_FAILED; 8564 err |= TG3_MAC_LOOPBACK_FAILED;
@@ -8596,7 +8632,7 @@ static void tg3_self_test(struct net_device *dev, struct ethtool_test *etest,
8596 tg3_halt(tp, RESET_KIND_SHUTDOWN, 1); 8632 tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
8597 if (netif_running(dev)) { 8633 if (netif_running(dev)) {
8598 tp->tg3_flags |= TG3_FLAG_INIT_COMPLETE; 8634 tp->tg3_flags |= TG3_FLAG_INIT_COMPLETE;
8599 tg3_init_hw(tp); 8635 tg3_init_hw(tp, 1);
8600 tg3_netif_start(tp); 8636 tg3_netif_start(tp);
8601 } 8637 }
8602 8638
@@ -9377,7 +9413,7 @@ static int tg3_nvram_write_block_buffered(struct tg3 *tp, u32 offset, u32 len,
9377 9413
9378 if ((page_off == 0) || (i == 0)) 9414 if ((page_off == 0) || (i == 0))
9379 nvram_cmd |= NVRAM_CMD_FIRST; 9415 nvram_cmd |= NVRAM_CMD_FIRST;
9380 else if (page_off == (tp->nvram_pagesize - 4)) 9416 if (page_off == (tp->nvram_pagesize - 4))
9381 nvram_cmd |= NVRAM_CMD_LAST; 9417 nvram_cmd |= NVRAM_CMD_LAST;
9382 9418
9383 if (i == (len - 4)) 9419 if (i == (len - 4))
@@ -10353,10 +10389,13 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
10353 if (tp->pci_chip_rev_id == CHIPREV_ID_5704_A0) 10389 if (tp->pci_chip_rev_id == CHIPREV_ID_5704_A0)
10354 tp->tg3_flags2 |= TG3_FLG2_PHY_5704_A0_BUG; 10390 tp->tg3_flags2 |= TG3_FLG2_PHY_5704_A0_BUG;
10355 10391
10356 if ((tp->tg3_flags2 & TG3_FLG2_5705_PLUS) && 10392 if (tp->tg3_flags2 & TG3_FLG2_5705_PLUS) {
10357 (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5755) && 10393 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 ||
10358 (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5787)) 10394 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787)
10359 tp->tg3_flags2 |= TG3_FLG2_PHY_BER_BUG; 10395 tp->tg3_flags2 |= TG3_FLG2_PHY_JITTER_BUG;
10396 else
10397 tp->tg3_flags2 |= TG3_FLG2_PHY_BER_BUG;
10398 }
10360 10399
10361 tp->coalesce_mode = 0; 10400 tp->coalesce_mode = 0;
10362 if (GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5700_AX && 10401 if (GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5700_AX &&
@@ -11569,7 +11608,7 @@ static int tg3_suspend(struct pci_dev *pdev, pm_message_t state)
11569 tg3_full_lock(tp, 0); 11608 tg3_full_lock(tp, 0);
11570 11609
11571 tp->tg3_flags |= TG3_FLAG_INIT_COMPLETE; 11610 tp->tg3_flags |= TG3_FLAG_INIT_COMPLETE;
11572 tg3_init_hw(tp); 11611 tg3_init_hw(tp, 1);
11573 11612
11574 tp->timer.expires = jiffies + tp->timer_offset; 11613 tp->timer.expires = jiffies + tp->timer_offset;
11575 add_timer(&tp->timer); 11614 add_timer(&tp->timer);
@@ -11603,7 +11642,7 @@ static int tg3_resume(struct pci_dev *pdev)
11603 tg3_full_lock(tp, 0); 11642 tg3_full_lock(tp, 0);
11604 11643
11605 tp->tg3_flags |= TG3_FLAG_INIT_COMPLETE; 11644 tp->tg3_flags |= TG3_FLAG_INIT_COMPLETE;
11606 tg3_init_hw(tp); 11645 tg3_init_hw(tp, 1);
11607 11646
11608 tp->timer.expires = jiffies + tp->timer_offset; 11647 tp->timer.expires = jiffies + tp->timer_offset;
11609 add_timer(&tp->timer); 11648 add_timer(&tp->timer);
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index 8c8b987d1250..0e29b885d449 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -2215,6 +2215,7 @@ struct tg3 {
2215#define TG3_FLG2_HW_TSO_2 0x08000000 2215#define TG3_FLG2_HW_TSO_2 0x08000000
2216#define TG3_FLG2_HW_TSO (TG3_FLG2_HW_TSO_1 | TG3_FLG2_HW_TSO_2) 2216#define TG3_FLG2_HW_TSO (TG3_FLG2_HW_TSO_1 | TG3_FLG2_HW_TSO_2)
2217#define TG3_FLG2_1SHOT_MSI 0x10000000 2217#define TG3_FLG2_1SHOT_MSI 0x10000000
2218#define TG3_FLG2_PHY_JITTER_BUG 0x20000000
2218 2219
2219 u32 split_mode_max_reqs; 2220 u32 split_mode_max_reqs;
2220#define SPLIT_MODE_5704_MAX_REQ 3 2221#define SPLIT_MODE_5704_MAX_REQ 3
diff --git a/drivers/net/tulip/winbond-840.c b/drivers/net/tulip/winbond-840.c
index ba05dedf29d3..136a70c4d5e4 100644
--- a/drivers/net/tulip/winbond-840.c
+++ b/drivers/net/tulip/winbond-840.c
@@ -850,7 +850,7 @@ static void init_rxtx_rings(struct net_device *dev)
850 break; 850 break;
851 skb->dev = dev; /* Mark as being used by this device. */ 851 skb->dev = dev; /* Mark as being used by this device. */
852 np->rx_addr[i] = pci_map_single(np->pci_dev,skb->data, 852 np->rx_addr[i] = pci_map_single(np->pci_dev,skb->data,
853 skb->len,PCI_DMA_FROMDEVICE); 853 np->rx_buf_sz,PCI_DMA_FROMDEVICE);
854 854
855 np->rx_ring[i].buffer1 = np->rx_addr[i]; 855 np->rx_ring[i].buffer1 = np->rx_addr[i];
856 np->rx_ring[i].status = DescOwn; 856 np->rx_ring[i].status = DescOwn;
@@ -1316,7 +1316,7 @@ static int netdev_rx(struct net_device *dev)
1316 skb->dev = dev; /* Mark as being used by this device. */ 1316 skb->dev = dev; /* Mark as being used by this device. */
1317 np->rx_addr[entry] = pci_map_single(np->pci_dev, 1317 np->rx_addr[entry] = pci_map_single(np->pci_dev,
1318 skb->data, 1318 skb->data,
1319 skb->len, PCI_DMA_FROMDEVICE); 1319 np->rx_buf_sz, PCI_DMA_FROMDEVICE);
1320 np->rx_ring[entry].buffer1 = np->rx_addr[entry]; 1320 np->rx_ring[entry].buffer1 = np->rx_addr[entry];
1321 } 1321 }
1322 wmb(); 1322 wmb();
diff --git a/drivers/net/via-rhine.c b/drivers/net/via-rhine.c
index 6a23964c1317..fdc21037f6dc 100644
--- a/drivers/net/via-rhine.c
+++ b/drivers/net/via-rhine.c
@@ -129,6 +129,7 @@
129 - Massive clean-up 129 - Massive clean-up
130 - Rewrite PHY, media handling (remove options, full_duplex, backoff) 130 - Rewrite PHY, media handling (remove options, full_duplex, backoff)
131 - Fix Tx engine race for good 131 - Fix Tx engine race for good
132 - Craig Brind: Zero padded aligned buffers for short packets.
132 133
133*/ 134*/
134 135
@@ -490,8 +491,6 @@ struct rhine_private {
490 u8 tx_thresh, rx_thresh; 491 u8 tx_thresh, rx_thresh;
491 492
492 struct mii_if_info mii_if; 493 struct mii_if_info mii_if;
493 struct work_struct tx_timeout_task;
494 struct work_struct check_media_task;
495 void __iomem *base; 494 void __iomem *base;
496}; 495};
497 496
@@ -499,8 +498,6 @@ static int mdio_read(struct net_device *dev, int phy_id, int location);
499static void mdio_write(struct net_device *dev, int phy_id, int location, int value); 498static void mdio_write(struct net_device *dev, int phy_id, int location, int value);
500static int rhine_open(struct net_device *dev); 499static int rhine_open(struct net_device *dev);
501static void rhine_tx_timeout(struct net_device *dev); 500static void rhine_tx_timeout(struct net_device *dev);
502static void rhine_tx_timeout_task(struct net_device *dev);
503static void rhine_check_media_task(struct net_device *dev);
504static int rhine_start_tx(struct sk_buff *skb, struct net_device *dev); 501static int rhine_start_tx(struct sk_buff *skb, struct net_device *dev);
505static irqreturn_t rhine_interrupt(int irq, void *dev_instance, struct pt_regs *regs); 502static irqreturn_t rhine_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
506static void rhine_tx(struct net_device *dev); 503static void rhine_tx(struct net_device *dev);
@@ -855,12 +852,6 @@ static int __devinit rhine_init_one(struct pci_dev *pdev,
855 if (rp->quirks & rqRhineI) 852 if (rp->quirks & rqRhineI)
856 dev->features |= NETIF_F_SG|NETIF_F_HW_CSUM; 853 dev->features |= NETIF_F_SG|NETIF_F_HW_CSUM;
857 854
858 INIT_WORK(&rp->tx_timeout_task,
859 (void (*)(void *))rhine_tx_timeout_task, dev);
860
861 INIT_WORK(&rp->check_media_task,
862 (void (*)(void *))rhine_check_media_task, dev);
863
864 /* dev->name not defined before register_netdev()! */ 855 /* dev->name not defined before register_netdev()! */
865 rc = register_netdev(dev); 856 rc = register_netdev(dev);
866 if (rc) 857 if (rc)
@@ -1107,11 +1098,6 @@ static void rhine_set_carrier(struct mii_if_info *mii)
1107 netif_carrier_ok(mii->dev)); 1098 netif_carrier_ok(mii->dev));
1108} 1099}
1109 1100
1110static void rhine_check_media_task(struct net_device *dev)
1111{
1112 rhine_check_media(dev, 0);
1113}
1114
1115static void init_registers(struct net_device *dev) 1101static void init_registers(struct net_device *dev)
1116{ 1102{
1117 struct rhine_private *rp = netdev_priv(dev); 1103 struct rhine_private *rp = netdev_priv(dev);
@@ -1165,8 +1151,8 @@ static void rhine_disable_linkmon(void __iomem *ioaddr, u32 quirks)
1165 if (quirks & rqRhineI) { 1151 if (quirks & rqRhineI) {
1166 iowrite8(0x01, ioaddr + MIIRegAddr); // MII_BMSR 1152 iowrite8(0x01, ioaddr + MIIRegAddr); // MII_BMSR
1167 1153
1168 /* Do not call from ISR! */ 1154 /* Can be called from ISR. Evil. */
1169 msleep(1); 1155 mdelay(1);
1170 1156
1171 /* 0x80 must be set immediately before turning it off */ 1157 /* 0x80 must be set immediately before turning it off */
1172 iowrite8(0x80, ioaddr + MIICmd); 1158 iowrite8(0x80, ioaddr + MIICmd);
@@ -1256,16 +1242,6 @@ static int rhine_open(struct net_device *dev)
1256static void rhine_tx_timeout(struct net_device *dev) 1242static void rhine_tx_timeout(struct net_device *dev)
1257{ 1243{
1258 struct rhine_private *rp = netdev_priv(dev); 1244 struct rhine_private *rp = netdev_priv(dev);
1259
1260 /*
1261 * Move bulk of work outside of interrupt context
1262 */
1263 schedule_work(&rp->tx_timeout_task);
1264}
1265
1266static void rhine_tx_timeout_task(struct net_device *dev)
1267{
1268 struct rhine_private *rp = netdev_priv(dev);
1269 void __iomem *ioaddr = rp->base; 1245 void __iomem *ioaddr = rp->base;
1270 1246
1271 printk(KERN_WARNING "%s: Transmit timed out, status %4.4x, PHY status " 1247 printk(KERN_WARNING "%s: Transmit timed out, status %4.4x, PHY status "
@@ -1326,7 +1302,12 @@ static int rhine_start_tx(struct sk_buff *skb, struct net_device *dev)
1326 rp->stats.tx_dropped++; 1302 rp->stats.tx_dropped++;
1327 return 0; 1303 return 0;
1328 } 1304 }
1305
1306 /* Padding is not copied and so must be redone. */
1329 skb_copy_and_csum_dev(skb, rp->tx_buf[entry]); 1307 skb_copy_and_csum_dev(skb, rp->tx_buf[entry]);
1308 if (skb->len < ETH_ZLEN)
1309 memset(rp->tx_buf[entry] + skb->len, 0,
1310 ETH_ZLEN - skb->len);
1330 rp->tx_skbuff_dma[entry] = 0; 1311 rp->tx_skbuff_dma[entry] = 0;
1331 rp->tx_ring[entry].addr = cpu_to_le32(rp->tx_bufs_dma + 1312 rp->tx_ring[entry].addr = cpu_to_le32(rp->tx_bufs_dma +
1332 (rp->tx_buf[entry] - 1313 (rp->tx_buf[entry] -
@@ -1671,7 +1652,7 @@ static void rhine_error(struct net_device *dev, int intr_status)
1671 spin_lock(&rp->lock); 1652 spin_lock(&rp->lock);
1672 1653
1673 if (intr_status & IntrLinkChange) 1654 if (intr_status & IntrLinkChange)
1674 schedule_work(&rp->check_media_task); 1655 rhine_check_media(dev, 0);
1675 if (intr_status & IntrStatsMax) { 1656 if (intr_status & IntrStatsMax) {
1676 rp->stats.rx_crc_errors += ioread16(ioaddr + RxCRCErrs); 1657 rp->stats.rx_crc_errors += ioread16(ioaddr + RxCRCErrs);
1677 rp->stats.rx_missed_errors += ioread16(ioaddr + RxMissed); 1658 rp->stats.rx_missed_errors += ioread16(ioaddr + RxMissed);
@@ -1921,9 +1902,6 @@ static int rhine_close(struct net_device *dev)
1921 spin_unlock_irq(&rp->lock); 1902 spin_unlock_irq(&rp->lock);
1922 1903
1923 free_irq(rp->pdev->irq, dev); 1904 free_irq(rp->pdev->irq, dev);
1924
1925 flush_scheduled_work();
1926
1927 free_rbufs(dev); 1905 free_rbufs(dev);
1928 free_tbufs(dev); 1906 free_tbufs(dev);
1929 free_ring(dev); 1907 free_ring(dev);
diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig
index bad09ebdb50b..e0874cbfefea 100644
--- a/drivers/net/wireless/Kconfig
+++ b/drivers/net/wireless/Kconfig
@@ -6,7 +6,7 @@ menu "Wireless LAN (non-hamradio)"
6 depends on NETDEVICES 6 depends on NETDEVICES
7 7
8config NET_RADIO 8config NET_RADIO
9 bool "Wireless LAN drivers (non-hamradio)" 9 bool "Wireless LAN drivers (non-hamradio) & Wireless Extensions"
10 select WIRELESS_EXT 10 select WIRELESS_EXT
11 ---help--- 11 ---help---
12 Support for wireless LANs and everything having to do with radio, 12 Support for wireless LANs and everything having to do with radio,
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index 108d9fed8f07..00764ddd74d8 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -3139,6 +3139,7 @@ static irqreturn_t airo_interrupt ( int irq, void* dev_id, struct pt_regs *regs)
3139 } 3139 }
3140 if ( status & EV_LINK ) { 3140 if ( status & EV_LINK ) {
3141 union iwreq_data wrqu; 3141 union iwreq_data wrqu;
3142 int scan_forceloss = 0;
3142 /* The link status has changed, if you want to put a 3143 /* The link status has changed, if you want to put a
3143 monitor hook in, do it here. (Remember that 3144 monitor hook in, do it here. (Remember that
3144 interrupts are still disabled!) 3145 interrupts are still disabled!)
@@ -3157,7 +3158,8 @@ static irqreturn_t airo_interrupt ( int irq, void* dev_id, struct pt_regs *regs)
3157 code) */ 3158 code) */
3158#define AUTHFAIL 0x0300 /* Authentication failure (low byte is reason 3159#define AUTHFAIL 0x0300 /* Authentication failure (low byte is reason
3159 code) */ 3160 code) */
3160#define ASSOCIATED 0x0400 /* Assocatied */ 3161#define ASSOCIATED 0x0400 /* Associated */
3162#define REASSOCIATED 0x0600 /* Reassociated? Only on firmware >= 5.30.17 */
3161#define RC_RESERVED 0 /* Reserved return code */ 3163#define RC_RESERVED 0 /* Reserved return code */
3162#define RC_NOREASON 1 /* Unspecified reason */ 3164#define RC_NOREASON 1 /* Unspecified reason */
3163#define RC_AUTHINV 2 /* Previous authentication invalid */ 3165#define RC_AUTHINV 2 /* Previous authentication invalid */
@@ -3174,44 +3176,30 @@ static irqreturn_t airo_interrupt ( int irq, void* dev_id, struct pt_regs *regs)
3174 leaving BSS */ 3176 leaving BSS */
3175#define RC_NOAUTH 9 /* Station requesting (Re)Association is not 3177#define RC_NOAUTH 9 /* Station requesting (Re)Association is not
3176 Authenticated with the responding station */ 3178 Authenticated with the responding station */
3177 if (newStatus != ASSOCIATED) { 3179 if (newStatus == FORCELOSS && apriv->scan_timeout > 0)
3178 if (auto_wep && !apriv->expires) { 3180 scan_forceloss = 1;
3179 apriv->expires = RUN_AT(3*HZ); 3181 if(newStatus == ASSOCIATED || newStatus == REASSOCIATED) {
3180 wake_up_interruptible(&apriv->thr_wait);
3181 }
3182 } else {
3183 struct task_struct *task = apriv->task;
3184 if (auto_wep) 3182 if (auto_wep)
3185 apriv->expires = 0; 3183 apriv->expires = 0;
3186 if (task) 3184 if (apriv->task)
3187 wake_up_process (task); 3185 wake_up_process (apriv->task);
3188 set_bit(FLAG_UPDATE_UNI, &apriv->flags); 3186 set_bit(FLAG_UPDATE_UNI, &apriv->flags);
3189 set_bit(FLAG_UPDATE_MULTI, &apriv->flags); 3187 set_bit(FLAG_UPDATE_MULTI, &apriv->flags);
3190 } 3188
3191 /* Question : is ASSOCIATED the only status
3192 * that is valid ? We want to catch handover
3193 * and reassociations as valid status
3194 * Jean II */
3195 if(newStatus == ASSOCIATED) {
3196#if 0
3197 /* FIXME: Grabbing scan results here
3198 * seems to be too early??? Just wait for
3199 * timeout instead. */
3200 if (apriv->scan_timeout > 0) {
3201 set_bit(JOB_SCAN_RESULTS, &apriv->flags);
3202 wake_up_interruptible(&apriv->thr_wait);
3203 }
3204#endif
3205 if (down_trylock(&apriv->sem) != 0) { 3189 if (down_trylock(&apriv->sem) != 0) {
3206 set_bit(JOB_EVENT, &apriv->flags); 3190 set_bit(JOB_EVENT, &apriv->flags);
3207 wake_up_interruptible(&apriv->thr_wait); 3191 wake_up_interruptible(&apriv->thr_wait);
3208 } else 3192 } else
3209 airo_send_event(dev); 3193 airo_send_event(dev);
3210 } else { 3194 } else if (!scan_forceloss) {
3211 memset(wrqu.ap_addr.sa_data, '\0', ETH_ALEN); 3195 if (auto_wep && !apriv->expires) {
3212 wrqu.ap_addr.sa_family = ARPHRD_ETHER; 3196 apriv->expires = RUN_AT(3*HZ);
3197 wake_up_interruptible(&apriv->thr_wait);
3198 }
3213 3199
3214 /* Send event to user space */ 3200 /* Send event to user space */
3201 memset(wrqu.ap_addr.sa_data, '\0', ETH_ALEN);
3202 wrqu.ap_addr.sa_family = ARPHRD_ETHER;
3215 wireless_send_event(dev, SIOCGIWAP, &wrqu,NULL); 3203 wireless_send_event(dev, SIOCGIWAP, &wrqu,NULL);
3216 } 3204 }
3217 } 3205 }
@@ -7136,10 +7124,10 @@ static int airo_set_scan(struct net_device *dev,
7136 goto out; 7124 goto out;
7137 7125
7138 /* Initiate a scan command */ 7126 /* Initiate a scan command */
7127 ai->scan_timeout = RUN_AT(3*HZ);
7139 memset(&cmd, 0, sizeof(cmd)); 7128 memset(&cmd, 0, sizeof(cmd));
7140 cmd.cmd=CMD_LISTBSS; 7129 cmd.cmd=CMD_LISTBSS;
7141 issuecommand(ai, &cmd, &rsp); 7130 issuecommand(ai, &cmd, &rsp);
7142 ai->scan_timeout = RUN_AT(3*HZ);
7143 wake = 1; 7131 wake = 1;
7144 7132
7145out: 7133out:
diff --git a/drivers/net/wireless/arlan-main.c b/drivers/net/wireless/arlan-main.c
index 0e1ac338cac1..bed6823d9809 100644
--- a/drivers/net/wireless/arlan-main.c
+++ b/drivers/net/wireless/arlan-main.c
@@ -1838,7 +1838,7 @@ struct net_device * __init arlan_probe(int unit)
1838} 1838}
1839 1839
1840#ifdef MODULE 1840#ifdef MODULE
1841int init_module(void) 1841int __init init_module(void)
1842{ 1842{
1843 int i = 0; 1843 int i = 0;
1844 1844
@@ -1860,7 +1860,7 @@ int init_module(void)
1860} 1860}
1861 1861
1862 1862
1863void cleanup_module(void) 1863void __exit cleanup_module(void)
1864{ 1864{
1865 int i = 0; 1865 int i = 0;
1866 struct net_device *dev; 1866 struct net_device *dev;
diff --git a/drivers/net/wireless/atmel.c b/drivers/net/wireless/atmel.c
index 87afa6878f26..8606c88886fc 100644
--- a/drivers/net/wireless/atmel.c
+++ b/drivers/net/wireless/atmel.c
@@ -3463,6 +3463,7 @@ static void atmel_command_irq(struct atmel_private *priv)
3463 u8 status = atmel_rmem8(priv, atmel_co(priv, CMD_BLOCK_STATUS_OFFSET)); 3463 u8 status = atmel_rmem8(priv, atmel_co(priv, CMD_BLOCK_STATUS_OFFSET));
3464 u8 command = atmel_rmem8(priv, atmel_co(priv, CMD_BLOCK_COMMAND_OFFSET)); 3464 u8 command = atmel_rmem8(priv, atmel_co(priv, CMD_BLOCK_COMMAND_OFFSET));
3465 int fast_scan; 3465 int fast_scan;
3466 union iwreq_data wrqu;
3466 3467
3467 if (status == CMD_STATUS_IDLE || 3468 if (status == CMD_STATUS_IDLE ||
3468 status == CMD_STATUS_IN_PROGRESS) 3469 status == CMD_STATUS_IN_PROGRESS)
@@ -3487,6 +3488,7 @@ static void atmel_command_irq(struct atmel_private *priv)
3487 atmel_scan(priv, 1); 3488 atmel_scan(priv, 1);
3488 } else { 3489 } else {
3489 int bss_index = retrieve_bss(priv); 3490 int bss_index = retrieve_bss(priv);
3491 int notify_scan_complete = 1;
3490 if (bss_index != -1) { 3492 if (bss_index != -1) {
3491 atmel_join_bss(priv, bss_index); 3493 atmel_join_bss(priv, bss_index);
3492 } else if (priv->operating_mode == IW_MODE_ADHOC && 3494 } else if (priv->operating_mode == IW_MODE_ADHOC &&
@@ -3495,8 +3497,14 @@ static void atmel_command_irq(struct atmel_private *priv)
3495 } else { 3497 } else {
3496 priv->fast_scan = !fast_scan; 3498 priv->fast_scan = !fast_scan;
3497 atmel_scan(priv, 1); 3499 atmel_scan(priv, 1);
3500 notify_scan_complete = 0;
3498 } 3501 }
3499 priv->site_survey_state = SITE_SURVEY_COMPLETED; 3502 priv->site_survey_state = SITE_SURVEY_COMPLETED;
3503 if (notify_scan_complete) {
3504 wrqu.data.length = 0;
3505 wrqu.data.flags = 0;
3506 wireless_send_event(priv->dev, SIOCGIWSCAN, &wrqu, NULL);
3507 }
3500 } 3508 }
3501 break; 3509 break;
3502 3510
@@ -3509,6 +3517,9 @@ static void atmel_command_irq(struct atmel_private *priv)
3509 priv->site_survey_state = SITE_SURVEY_COMPLETED; 3517 priv->site_survey_state = SITE_SURVEY_COMPLETED;
3510 if (priv->station_is_associated) { 3518 if (priv->station_is_associated) {
3511 atmel_enter_state(priv, STATION_STATE_READY); 3519 atmel_enter_state(priv, STATION_STATE_READY);
3520 wrqu.data.length = 0;
3521 wrqu.data.flags = 0;
3522 wireless_send_event(priv->dev, SIOCGIWSCAN, &wrqu, NULL);
3512 } else { 3523 } else {
3513 atmel_scan(priv, 1); 3524 atmel_scan(priv, 1);
3514 } 3525 }
diff --git a/drivers/net/wireless/bcm43xx/Kconfig b/drivers/net/wireless/bcm43xx/Kconfig
index 418465600a77..25ea4748f0b9 100644
--- a/drivers/net/wireless/bcm43xx/Kconfig
+++ b/drivers/net/wireless/bcm43xx/Kconfig
@@ -17,8 +17,11 @@ config BCM43XX_DEBUG
17 17
18config BCM43XX_DMA 18config BCM43XX_DMA
19 bool 19 bool
20 depends on BCM43XX
21
20config BCM43XX_PIO 22config BCM43XX_PIO
21 bool 23 bool
24 depends on BCM43XX
22 25
23choice 26choice
24 prompt "BCM43xx data transfer mode" 27 prompt "BCM43xx data transfer mode"
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx.h b/drivers/net/wireless/bcm43xx/bcm43xx.h
index dcadd295de4f..2e83083935e1 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx.h
+++ b/drivers/net/wireless/bcm43xx/bcm43xx.h
@@ -15,7 +15,6 @@
15 15
16#include "bcm43xx_debugfs.h" 16#include "bcm43xx_debugfs.h"
17#include "bcm43xx_leds.h" 17#include "bcm43xx_leds.h"
18#include "bcm43xx_sysfs.h"
19 18
20 19
21#define PFX KBUILD_MODNAME ": " 20#define PFX KBUILD_MODNAME ": "
@@ -638,8 +637,6 @@ struct bcm43xx_key {
638}; 637};
639 638
640struct bcm43xx_private { 639struct bcm43xx_private {
641 struct bcm43xx_sysfs sysfs;
642
643 struct ieee80211_device *ieee; 640 struct ieee80211_device *ieee;
644 struct ieee80211softmac_device *softmac; 641 struct ieee80211softmac_device *softmac;
645 642
@@ -772,6 +769,20 @@ struct bcm43xx_private * bcm43xx_priv(struct net_device *dev)
772 return ieee80211softmac_priv(dev); 769 return ieee80211softmac_priv(dev);
773} 770}
774 771
772struct device;
773
774static inline
775struct bcm43xx_private * dev_to_bcm(struct device *dev)
776{
777 struct net_device *net_dev;
778 struct bcm43xx_private *bcm;
779
780 net_dev = dev_get_drvdata(dev);
781 bcm = bcm43xx_priv(net_dev);
782
783 return bcm;
784}
785
775 786
776/* Helper function, which returns a boolean. 787/* Helper function, which returns a boolean.
777 * TRUE, if PIO is used; FALSE, if DMA is used. 788 * TRUE, if PIO is used; FALSE, if DMA is used.
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_debugfs.c b/drivers/net/wireless/bcm43xx/bcm43xx_debugfs.c
index d2c3401e9b70..35a4fcb6d923 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_debugfs.c
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_debugfs.c
@@ -452,12 +452,12 @@ void bcm43xx_printk_dump(const char *data,
452 size_t i; 452 size_t i;
453 char c; 453 char c;
454 454
455 printk(KERN_INFO PFX "Data dump (%s, %u bytes):", 455 printk(KERN_INFO PFX "Data dump (%s, %zd bytes):",
456 description, size); 456 description, size);
457 for (i = 0; i < size; i++) { 457 for (i = 0; i < size; i++) {
458 c = data[i]; 458 c = data[i];
459 if (i % 8 == 0) 459 if (i % 8 == 0)
460 printk("\n" KERN_INFO PFX "0x%08x: 0x%02x, ", i, c & 0xff); 460 printk("\n" KERN_INFO PFX "0x%08zx: 0x%02x, ", i, c & 0xff);
461 else 461 else
462 printk("0x%02x, ", c & 0xff); 462 printk("0x%02x, ", c & 0xff);
463 } 463 }
@@ -472,12 +472,12 @@ void bcm43xx_printk_bitdump(const unsigned char *data,
472 int j; 472 int j;
473 const unsigned char *d; 473 const unsigned char *d;
474 474
475 printk(KERN_INFO PFX "*** Bitdump (%s, %u bytes, %s) ***", 475 printk(KERN_INFO PFX "*** Bitdump (%s, %zd bytes, %s) ***",
476 description, bytes, msb_to_lsb ? "MSB to LSB" : "LSB to MSB"); 476 description, bytes, msb_to_lsb ? "MSB to LSB" : "LSB to MSB");
477 for (i = 0; i < bytes; i++) { 477 for (i = 0; i < bytes; i++) {
478 d = data + i; 478 d = data + i;
479 if (i % 8 == 0) 479 if (i % 8 == 0)
480 printk("\n" KERN_INFO PFX "0x%08x: ", i); 480 printk("\n" KERN_INFO PFX "0x%08zx: ", i);
481 if (msb_to_lsb) { 481 if (msb_to_lsb) {
482 for (j = 7; j >= 0; j--) { 482 for (j = 7; j >= 0; j--) {
483 if (*d & (1 << j)) 483 if (*d & (1 << j))
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_dma.c b/drivers/net/wireless/bcm43xx/bcm43xx_dma.c
index c3681b8f09b4..d0318e525ba7 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_dma.c
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_dma.c
@@ -196,8 +196,9 @@ static int alloc_ringmemory(struct bcm43xx_dmaring *ring)
196 } 196 }
197 if (ring->dmabase + BCM43xx_DMA_RINGMEMSIZE > BCM43xx_DMA_BUSADDRMAX) { 197 if (ring->dmabase + BCM43xx_DMA_RINGMEMSIZE > BCM43xx_DMA_BUSADDRMAX) {
198 printk(KERN_ERR PFX ">>>FATAL ERROR<<< DMA RINGMEMORY >1G " 198 printk(KERN_ERR PFX ">>>FATAL ERROR<<< DMA RINGMEMORY >1G "
199 "(0x%08x, len: %lu)\n", 199 "(0x%llx, len: %lu)\n",
200 ring->dmabase, BCM43xx_DMA_RINGMEMSIZE); 200 (unsigned long long)ring->dmabase,
201 BCM43xx_DMA_RINGMEMSIZE);
201 dma_free_coherent(dev, BCM43xx_DMA_RINGMEMSIZE, 202 dma_free_coherent(dev, BCM43xx_DMA_RINGMEMSIZE,
202 ring->vbase, ring->dmabase); 203 ring->vbase, ring->dmabase);
203 return -ENOMEM; 204 return -ENOMEM;
@@ -307,8 +308,8 @@ static int setup_rx_descbuffer(struct bcm43xx_dmaring *ring,
307 unmap_descbuffer(ring, dmaaddr, ring->rx_buffersize, 0); 308 unmap_descbuffer(ring, dmaaddr, ring->rx_buffersize, 0);
308 dev_kfree_skb_any(skb); 309 dev_kfree_skb_any(skb);
309 printk(KERN_ERR PFX ">>>FATAL ERROR<<< DMA RX SKB >1G " 310 printk(KERN_ERR PFX ">>>FATAL ERROR<<< DMA RX SKB >1G "
310 "(0x%08x, len: %u)\n", 311 "(0x%llx, len: %u)\n",
311 dmaaddr, ring->rx_buffersize); 312 (unsigned long long)dmaaddr, ring->rx_buffersize);
312 return -ENOMEM; 313 return -ENOMEM;
313 } 314 }
314 meta->skb = skb; 315 meta->skb = skb;
@@ -623,25 +624,28 @@ err_destroy_tx0:
623static u16 generate_cookie(struct bcm43xx_dmaring *ring, 624static u16 generate_cookie(struct bcm43xx_dmaring *ring,
624 int slot) 625 int slot)
625{ 626{
626 u16 cookie = 0x0000; 627 u16 cookie = 0xF000;
627 628
628 /* Use the upper 4 bits of the cookie as 629 /* Use the upper 4 bits of the cookie as
629 * DMA controller ID and store the slot number 630 * DMA controller ID and store the slot number
630 * in the lower 12 bits 631 * in the lower 12 bits.
632 * Note that the cookie must never be 0, as this
633 * is a special value used in RX path.
631 */ 634 */
632 switch (ring->mmio_base) { 635 switch (ring->mmio_base) {
633 default: 636 default:
634 assert(0); 637 assert(0);
635 case BCM43xx_MMIO_DMA1_BASE: 638 case BCM43xx_MMIO_DMA1_BASE:
639 cookie = 0xA000;
636 break; 640 break;
637 case BCM43xx_MMIO_DMA2_BASE: 641 case BCM43xx_MMIO_DMA2_BASE:
638 cookie = 0x1000; 642 cookie = 0xB000;
639 break; 643 break;
640 case BCM43xx_MMIO_DMA3_BASE: 644 case BCM43xx_MMIO_DMA3_BASE:
641 cookie = 0x2000; 645 cookie = 0xC000;
642 break; 646 break;
643 case BCM43xx_MMIO_DMA4_BASE: 647 case BCM43xx_MMIO_DMA4_BASE:
644 cookie = 0x3000; 648 cookie = 0xD000;
645 break; 649 break;
646 } 650 }
647 assert(((u16)slot & 0xF000) == 0x0000); 651 assert(((u16)slot & 0xF000) == 0x0000);
@@ -659,16 +663,16 @@ struct bcm43xx_dmaring * parse_cookie(struct bcm43xx_private *bcm,
659 struct bcm43xx_dmaring *ring = NULL; 663 struct bcm43xx_dmaring *ring = NULL;
660 664
661 switch (cookie & 0xF000) { 665 switch (cookie & 0xF000) {
662 case 0x0000: 666 case 0xA000:
663 ring = dma->tx_ring0; 667 ring = dma->tx_ring0;
664 break; 668 break;
665 case 0x1000: 669 case 0xB000:
666 ring = dma->tx_ring1; 670 ring = dma->tx_ring1;
667 break; 671 break;
668 case 0x2000: 672 case 0xC000:
669 ring = dma->tx_ring2; 673 ring = dma->tx_ring2;
670 break; 674 break;
671 case 0x3000: 675 case 0xD000:
672 ring = dma->tx_ring3; 676 ring = dma->tx_ring3;
673 break; 677 break;
674 default: 678 default:
@@ -729,8 +733,8 @@ static int dma_tx_fragment(struct bcm43xx_dmaring *ring,
729 if (unlikely(meta->dmaaddr + skb->len > BCM43xx_DMA_BUSADDRMAX)) { 733 if (unlikely(meta->dmaaddr + skb->len > BCM43xx_DMA_BUSADDRMAX)) {
730 return_slot(ring, slot); 734 return_slot(ring, slot);
731 printk(KERN_ERR PFX ">>>FATAL ERROR<<< DMA TX SKB >1G " 735 printk(KERN_ERR PFX ">>>FATAL ERROR<<< DMA TX SKB >1G "
732 "(0x%08x, len: %u)\n", 736 "(0x%llx, len: %u)\n",
733 meta->dmaaddr, skb->len); 737 (unsigned long long)meta->dmaaddr, skb->len);
734 return -ENOMEM; 738 return -ENOMEM;
735 } 739 }
736 740
@@ -838,8 +842,18 @@ static void dma_rx(struct bcm43xx_dmaring *ring,
838 /* We received an xmit status. */ 842 /* We received an xmit status. */
839 struct bcm43xx_hwxmitstatus *hw = (struct bcm43xx_hwxmitstatus *)skb->data; 843 struct bcm43xx_hwxmitstatus *hw = (struct bcm43xx_hwxmitstatus *)skb->data;
840 struct bcm43xx_xmitstatus stat; 844 struct bcm43xx_xmitstatus stat;
845 int i = 0;
841 846
842 stat.cookie = le16_to_cpu(hw->cookie); 847 stat.cookie = le16_to_cpu(hw->cookie);
848 while (stat.cookie == 0) {
849 if (unlikely(++i >= 10000)) {
850 assert(0);
851 break;
852 }
853 udelay(2);
854 barrier();
855 stat.cookie = le16_to_cpu(hw->cookie);
856 }
843 stat.flags = hw->flags; 857 stat.flags = hw->flags;
844 stat.cnt1 = hw->cnt1; 858 stat.cnt1 = hw->cnt1;
845 stat.cnt2 = hw->cnt2; 859 stat.cnt2 = hw->cnt2;
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_dma.h b/drivers/net/wireless/bcm43xx/bcm43xx_dma.h
index 2d520e4b0276..b7d77638ba8c 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_dma.h
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_dma.h
@@ -213,6 +213,14 @@ static inline
213void bcm43xx_dma_rx(struct bcm43xx_dmaring *ring) 213void bcm43xx_dma_rx(struct bcm43xx_dmaring *ring)
214{ 214{
215} 215}
216static inline
217void bcm43xx_dma_tx_suspend(struct bcm43xx_dmaring *ring)
218{
219}
220static inline
221void bcm43xx_dma_tx_resume(struct bcm43xx_dmaring *ring)
222{
223}
216 224
217#endif /* CONFIG_BCM43XX_DMA */ 225#endif /* CONFIG_BCM43XX_DMA */
218#endif /* BCM43xx_DMA_H_ */ 226#endif /* BCM43xx_DMA_H_ */
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_main.c b/drivers/net/wireless/bcm43xx/bcm43xx_main.c
index c37371fc9e01..7ed18cad29f7 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_main.c
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_main.c
@@ -52,6 +52,7 @@
52#include "bcm43xx_wx.h" 52#include "bcm43xx_wx.h"
53#include "bcm43xx_ethtool.h" 53#include "bcm43xx_ethtool.h"
54#include "bcm43xx_xmit.h" 54#include "bcm43xx_xmit.h"
55#include "bcm43xx_sysfs.h"
55 56
56 57
57MODULE_DESCRIPTION("Broadcom BCM43xx wireless driver"); 58MODULE_DESCRIPTION("Broadcom BCM43xx wireless driver");
@@ -938,9 +939,9 @@ static int bcm43xx_sprom_extract(struct bcm43xx_private *bcm)
938 return 0; 939 return 0;
939} 940}
940 941
941static void bcm43xx_geo_init(struct bcm43xx_private *bcm) 942static int bcm43xx_geo_init(struct bcm43xx_private *bcm)
942{ 943{
943 struct ieee80211_geo geo; 944 struct ieee80211_geo *geo;
944 struct ieee80211_channel *chan; 945 struct ieee80211_channel *chan;
945 int have_a = 0, have_bg = 0; 946 int have_a = 0, have_bg = 0;
946 int i; 947 int i;
@@ -948,7 +949,10 @@ static void bcm43xx_geo_init(struct bcm43xx_private *bcm)
948 struct bcm43xx_phyinfo *phy; 949 struct bcm43xx_phyinfo *phy;
949 const char *iso_country; 950 const char *iso_country;
950 951
951 memset(&geo, 0, sizeof(geo)); 952 geo = kzalloc(sizeof(*geo), GFP_KERNEL);
953 if (!geo)
954 return -ENOMEM;
955
952 for (i = 0; i < bcm->nr_80211_available; i++) { 956 for (i = 0; i < bcm->nr_80211_available; i++) {
953 phy = &(bcm->core_80211_ext[i].phy); 957 phy = &(bcm->core_80211_ext[i].phy);
954 switch (phy->type) { 958 switch (phy->type) {
@@ -966,31 +970,36 @@ static void bcm43xx_geo_init(struct bcm43xx_private *bcm)
966 iso_country = bcm43xx_locale_iso(bcm->sprom.locale); 970 iso_country = bcm43xx_locale_iso(bcm->sprom.locale);
967 971
968 if (have_a) { 972 if (have_a) {
969 for (i = 0, channel = 0; channel < 201; channel++) { 973 for (i = 0, channel = IEEE80211_52GHZ_MIN_CHANNEL;
970 chan = &geo.a[i++]; 974 channel <= IEEE80211_52GHZ_MAX_CHANNEL; channel++) {
975 chan = &geo->a[i++];
971 chan->freq = bcm43xx_channel_to_freq_a(channel); 976 chan->freq = bcm43xx_channel_to_freq_a(channel);
972 chan->channel = channel; 977 chan->channel = channel;
973 } 978 }
974 geo.a_channels = i; 979 geo->a_channels = i;
975 } 980 }
976 if (have_bg) { 981 if (have_bg) {
977 for (i = 0, channel = 1; channel < 15; channel++) { 982 for (i = 0, channel = IEEE80211_24GHZ_MIN_CHANNEL;
978 chan = &geo.bg[i++]; 983 channel <= IEEE80211_24GHZ_MAX_CHANNEL; channel++) {
984 chan = &geo->bg[i++];
979 chan->freq = bcm43xx_channel_to_freq_bg(channel); 985 chan->freq = bcm43xx_channel_to_freq_bg(channel);
980 chan->channel = channel; 986 chan->channel = channel;
981 } 987 }
982 geo.bg_channels = i; 988 geo->bg_channels = i;
983 } 989 }
984 memcpy(geo.name, iso_country, 2); 990 memcpy(geo->name, iso_country, 2);
985 if (0 /*TODO: Outdoor use only */) 991 if (0 /*TODO: Outdoor use only */)
986 geo.name[2] = 'O'; 992 geo->name[2] = 'O';
987 else if (0 /*TODO: Indoor use only */) 993 else if (0 /*TODO: Indoor use only */)
988 geo.name[2] = 'I'; 994 geo->name[2] = 'I';
989 else 995 else
990 geo.name[2] = ' '; 996 geo->name[2] = ' ';
991 geo.name[3] = '\0'; 997 geo->name[3] = '\0';
998
999 ieee80211_set_geo(bcm->ieee, geo);
1000 kfree(geo);
992 1001
993 ieee80211_set_geo(bcm->ieee, &geo); 1002 return 0;
994} 1003}
995 1004
996/* DummyTransmission function, as documented on 1005/* DummyTransmission function, as documented on
@@ -3262,6 +3271,9 @@ static int bcm43xx_init_board(struct bcm43xx_private *bcm)
3262 bcm43xx_sysfs_register(bcm); 3271 bcm43xx_sysfs_register(bcm);
3263 //FIXME: check for bcm43xx_sysfs_register failure. This function is a bit messy regarding unwinding, though... 3272 //FIXME: check for bcm43xx_sysfs_register failure. This function is a bit messy regarding unwinding, though...
3264 3273
3274 /*FIXME: This should be handled by softmac instead. */
3275 schedule_work(&bcm->softmac->associnfo.work);
3276
3265 assert(err == 0); 3277 assert(err == 0);
3266out: 3278out:
3267 return err; 3279 return err;
@@ -3478,16 +3490,17 @@ static int bcm43xx_attach_board(struct bcm43xx_private *bcm)
3478 goto err_80211_unwind; 3490 goto err_80211_unwind;
3479 bcm43xx_wireless_core_disable(bcm); 3491 bcm43xx_wireless_core_disable(bcm);
3480 } 3492 }
3493 err = bcm43xx_geo_init(bcm);
3494 if (err)
3495 goto err_80211_unwind;
3481 bcm43xx_pctl_set_crystal(bcm, 0); 3496 bcm43xx_pctl_set_crystal(bcm, 0);
3482 3497
3483 /* Set the MAC address in the networking subsystem */ 3498 /* Set the MAC address in the networking subsystem */
3484 if (bcm43xx_current_phy(bcm)->type == BCM43xx_PHYTYPE_A) 3499 if (is_valid_ether_addr(bcm->sprom.et1macaddr))
3485 memcpy(bcm->net_dev->dev_addr, bcm->sprom.et1macaddr, 6); 3500 memcpy(bcm->net_dev->dev_addr, bcm->sprom.et1macaddr, 6);
3486 else 3501 else
3487 memcpy(bcm->net_dev->dev_addr, bcm->sprom.il0macaddr, 6); 3502 memcpy(bcm->net_dev->dev_addr, bcm->sprom.il0macaddr, 6);
3488 3503
3489 bcm43xx_geo_init(bcm);
3490
3491 snprintf(bcm->nick, IW_ESSID_MAX_SIZE, 3504 snprintf(bcm->nick, IW_ESSID_MAX_SIZE,
3492 "Broadcom %04X", bcm->chip_id); 3505 "Broadcom %04X", bcm->chip_id);
3493 3506
@@ -3522,6 +3535,7 @@ static inline int bcm43xx_tx(struct bcm43xx_private *bcm,
3522 err = bcm43xx_pio_tx(bcm, txb); 3535 err = bcm43xx_pio_tx(bcm, txb);
3523 else 3536 else
3524 err = bcm43xx_dma_tx(bcm, txb); 3537 err = bcm43xx_dma_tx(bcm, txb);
3538 bcm->net_dev->trans_start = jiffies;
3525 3539
3526 return err; 3540 return err;
3527} 3541}
@@ -3935,9 +3949,6 @@ static int bcm43xx_resume(struct pci_dev *pdev)
3935 3949
3936 netif_device_attach(net_dev); 3950 netif_device_attach(net_dev);
3937 3951
3938 /*FIXME: This should be handled by softmac instead. */
3939 schedule_work(&bcm->softmac->associnfo.work);
3940
3941 dprintk(KERN_INFO PFX "Device resumed.\n"); 3952 dprintk(KERN_INFO PFX "Device resumed.\n");
3942 3953
3943 return 0; 3954 return 0;
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_main.h b/drivers/net/wireless/bcm43xx/bcm43xx_main.h
index eca79a38594a..30a202b258b5 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_main.h
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_main.h
@@ -118,12 +118,14 @@ int bcm43xx_channel_to_freq(struct bcm43xx_private *bcm,
118static inline 118static inline
119int bcm43xx_is_valid_channel_a(u8 channel) 119int bcm43xx_is_valid_channel_a(u8 channel)
120{ 120{
121 return (channel <= 200); 121 return (channel >= IEEE80211_52GHZ_MIN_CHANNEL
122 && channel <= IEEE80211_52GHZ_MAX_CHANNEL);
122} 123}
123static inline 124static inline
124int bcm43xx_is_valid_channel_bg(u8 channel) 125int bcm43xx_is_valid_channel_bg(u8 channel)
125{ 126{
126 return (channel >= 1 && channel <= 14); 127 return (channel >= IEEE80211_24GHZ_MIN_CHANNEL
128 && channel <= IEEE80211_24GHZ_MAX_CHANNEL);
127} 129}
128static inline 130static inline
129int bcm43xx_is_valid_channel(struct bcm43xx_private *bcm, 131int bcm43xx_is_valid_channel(struct bcm43xx_private *bcm,
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_phy.c b/drivers/net/wireless/bcm43xx/bcm43xx_phy.c
index 0a66f43ca0c0..b0abac515530 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_phy.c
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_phy.c
@@ -1287,7 +1287,7 @@ static void bcm43xx_phy_initg(struct bcm43xx_private *bcm)
1287 if (radio->revision == 8) 1287 if (radio->revision == 8)
1288 bcm43xx_phy_write(bcm, 0x0805, 0x3230); 1288 bcm43xx_phy_write(bcm, 0x0805, 0x3230);
1289 bcm43xx_phy_init_pctl(bcm); 1289 bcm43xx_phy_init_pctl(bcm);
1290 if (bcm->chip_id == 0x4306 && bcm->chip_package != 2) { 1290 if (bcm->chip_id == 0x4306 && bcm->chip_package == 2) {
1291 bcm43xx_phy_write(bcm, 0x0429, 1291 bcm43xx_phy_write(bcm, 0x0429,
1292 bcm43xx_phy_read(bcm, 0x0429) & 0xBFFF); 1292 bcm43xx_phy_read(bcm, 0x0429) & 0xBFFF);
1293 bcm43xx_phy_write(bcm, 0x04C3, 1293 bcm43xx_phy_write(bcm, 0x04C3,
@@ -2151,6 +2151,7 @@ int bcm43xx_phy_init_tssi2dbm_table(struct bcm43xx_private *bcm)
2151 phy->tssi2dbm = NULL; 2151 phy->tssi2dbm = NULL;
2152 printk(KERN_ERR PFX "Could not generate " 2152 printk(KERN_ERR PFX "Could not generate "
2153 "tssi2dBm table\n"); 2153 "tssi2dBm table\n");
2154 kfree(dyn_tssi2dbm);
2154 return -ENODEV; 2155 return -ENODEV;
2155 } 2156 }
2156 phy->tssi2dbm = dyn_tssi2dbm; 2157 phy->tssi2dbm = dyn_tssi2dbm;
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_pio.c b/drivers/net/wireless/bcm43xx/bcm43xx_pio.c
index c59ddd40680d..0aa1bd269a25 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_pio.c
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_pio.c
@@ -27,6 +27,7 @@
27#include "bcm43xx_pio.h" 27#include "bcm43xx_pio.h"
28#include "bcm43xx_main.h" 28#include "bcm43xx_main.h"
29#include "bcm43xx_xmit.h" 29#include "bcm43xx_xmit.h"
30#include "bcm43xx_power.h"
30 31
31#include <linux/delay.h> 32#include <linux/delay.h>
32 33
@@ -44,10 +45,10 @@ static void tx_octet(struct bcm43xx_pioqueue *queue,
44 bcm43xx_pio_write(queue, BCM43xx_PIO_TXDATA, 45 bcm43xx_pio_write(queue, BCM43xx_PIO_TXDATA,
45 octet); 46 octet);
46 bcm43xx_pio_write(queue, BCM43xx_PIO_TXCTL, 47 bcm43xx_pio_write(queue, BCM43xx_PIO_TXCTL,
47 BCM43xx_PIO_TXCTL_WRITEHI); 48 BCM43xx_PIO_TXCTL_WRITELO);
48 } else { 49 } else {
49 bcm43xx_pio_write(queue, BCM43xx_PIO_TXCTL, 50 bcm43xx_pio_write(queue, BCM43xx_PIO_TXCTL,
50 BCM43xx_PIO_TXCTL_WRITEHI); 51 BCM43xx_PIO_TXCTL_WRITELO);
51 bcm43xx_pio_write(queue, BCM43xx_PIO_TXDATA, 52 bcm43xx_pio_write(queue, BCM43xx_PIO_TXDATA,
52 octet); 53 octet);
53 } 54 }
@@ -103,7 +104,7 @@ static void tx_complete(struct bcm43xx_pioqueue *queue,
103 bcm43xx_pio_write(queue, BCM43xx_PIO_TXDATA, 104 bcm43xx_pio_write(queue, BCM43xx_PIO_TXDATA,
104 skb->data[skb->len - 1]); 105 skb->data[skb->len - 1]);
105 bcm43xx_pio_write(queue, BCM43xx_PIO_TXCTL, 106 bcm43xx_pio_write(queue, BCM43xx_PIO_TXCTL,
106 BCM43xx_PIO_TXCTL_WRITEHI | 107 BCM43xx_PIO_TXCTL_WRITELO |
107 BCM43xx_PIO_TXCTL_COMPLETE); 108 BCM43xx_PIO_TXCTL_COMPLETE);
108 } else { 109 } else {
109 bcm43xx_pio_write(queue, BCM43xx_PIO_TXCTL, 110 bcm43xx_pio_write(queue, BCM43xx_PIO_TXCTL,
@@ -112,9 +113,10 @@ static void tx_complete(struct bcm43xx_pioqueue *queue,
112} 113}
113 114
114static u16 generate_cookie(struct bcm43xx_pioqueue *queue, 115static u16 generate_cookie(struct bcm43xx_pioqueue *queue,
115 int packetindex) 116 struct bcm43xx_pio_txpacket *packet)
116{ 117{
117 u16 cookie = 0x0000; 118 u16 cookie = 0x0000;
119 int packetindex;
118 120
119 /* We use the upper 4 bits for the PIO 121 /* We use the upper 4 bits for the PIO
120 * controller ID and the lower 12 bits 122 * controller ID and the lower 12 bits
@@ -135,6 +137,7 @@ static u16 generate_cookie(struct bcm43xx_pioqueue *queue,
135 default: 137 default:
136 assert(0); 138 assert(0);
137 } 139 }
140 packetindex = pio_txpacket_getindex(packet);
138 assert(((u16)packetindex & 0xF000) == 0x0000); 141 assert(((u16)packetindex & 0xF000) == 0x0000);
139 cookie |= (u16)packetindex; 142 cookie |= (u16)packetindex;
140 143
@@ -184,7 +187,7 @@ static void pio_tx_write_fragment(struct bcm43xx_pioqueue *queue,
184 bcm43xx_generate_txhdr(queue->bcm, 187 bcm43xx_generate_txhdr(queue->bcm,
185 &txhdr, skb->data, skb->len, 188 &txhdr, skb->data, skb->len,
186 (packet->xmitted_frags == 0), 189 (packet->xmitted_frags == 0),
187 generate_cookie(queue, pio_txpacket_getindex(packet))); 190 generate_cookie(queue, packet));
188 191
189 tx_start(queue); 192 tx_start(queue);
190 octets = skb->len + sizeof(txhdr); 193 octets = skb->len + sizeof(txhdr);
@@ -241,7 +244,7 @@ static int pio_tx_packet(struct bcm43xx_pio_txpacket *packet)
241 queue->tx_devq_packets++; 244 queue->tx_devq_packets++;
242 queue->tx_devq_used += octets; 245 queue->tx_devq_used += octets;
243 246
244 assert(packet->xmitted_frags <= packet->txb->nr_frags); 247 assert(packet->xmitted_frags < packet->txb->nr_frags);
245 packet->xmitted_frags++; 248 packet->xmitted_frags++;
246 packet->xmitted_octets += octets; 249 packet->xmitted_octets += octets;
247 } 250 }
@@ -257,8 +260,14 @@ static void tx_tasklet(unsigned long d)
257 unsigned long flags; 260 unsigned long flags;
258 struct bcm43xx_pio_txpacket *packet, *tmp_packet; 261 struct bcm43xx_pio_txpacket *packet, *tmp_packet;
259 int err; 262 int err;
263 u16 txctl;
260 264
261 bcm43xx_lock_mmio(bcm, flags); 265 bcm43xx_lock_mmio(bcm, flags);
266
267 txctl = bcm43xx_pio_read(queue, BCM43xx_PIO_TXCTL);
268 if (txctl & BCM43xx_PIO_TXCTL_SUSPEND)
269 goto out_unlock;
270
262 list_for_each_entry_safe(packet, tmp_packet, &queue->txqueue, list) { 271 list_for_each_entry_safe(packet, tmp_packet, &queue->txqueue, list) {
263 assert(packet->xmitted_frags < packet->txb->nr_frags); 272 assert(packet->xmitted_frags < packet->txb->nr_frags);
264 if (packet->xmitted_frags == 0) { 273 if (packet->xmitted_frags == 0) {
@@ -288,6 +297,7 @@ static void tx_tasklet(unsigned long d)
288 next_packet: 297 next_packet:
289 continue; 298 continue;
290 } 299 }
300out_unlock:
291 bcm43xx_unlock_mmio(bcm, flags); 301 bcm43xx_unlock_mmio(bcm, flags);
292} 302}
293 303
@@ -330,12 +340,19 @@ struct bcm43xx_pioqueue * bcm43xx_setup_pioqueue(struct bcm43xx_private *bcm,
330 (unsigned long)queue); 340 (unsigned long)queue);
331 341
332 value = bcm43xx_read32(bcm, BCM43xx_MMIO_STATUS_BITFIELD); 342 value = bcm43xx_read32(bcm, BCM43xx_MMIO_STATUS_BITFIELD);
333 value |= BCM43xx_SBF_XFER_REG_BYTESWAP; 343 value &= ~BCM43xx_SBF_XFER_REG_BYTESWAP;
334 bcm43xx_write32(bcm, BCM43xx_MMIO_STATUS_BITFIELD, value); 344 bcm43xx_write32(bcm, BCM43xx_MMIO_STATUS_BITFIELD, value);
335 345
336 qsize = bcm43xx_read16(bcm, queue->mmio_base + BCM43xx_PIO_TXQBUFSIZE); 346 qsize = bcm43xx_read16(bcm, queue->mmio_base + BCM43xx_PIO_TXQBUFSIZE);
347 if (qsize == 0) {
348 printk(KERN_ERR PFX "ERROR: This card does not support PIO "
349 "operation mode. Please use DMA mode "
350 "(module parameter pio=0).\n");
351 goto err_freequeue;
352 }
337 if (qsize <= BCM43xx_PIO_TXQADJUST) { 353 if (qsize <= BCM43xx_PIO_TXQADJUST) {
338 printk(KERN_ERR PFX "PIO tx device-queue too small (%u)\n", qsize); 354 printk(KERN_ERR PFX "PIO tx device-queue too small (%u)\n",
355 qsize);
339 goto err_freequeue; 356 goto err_freequeue;
340 } 357 }
341 qsize -= BCM43xx_PIO_TXQADJUST; 358 qsize -= BCM43xx_PIO_TXQADJUST;
@@ -444,15 +461,10 @@ int bcm43xx_pio_tx(struct bcm43xx_private *bcm,
444{ 461{
445 struct bcm43xx_pioqueue *queue = bcm43xx_current_pio(bcm)->queue1; 462 struct bcm43xx_pioqueue *queue = bcm43xx_current_pio(bcm)->queue1;
446 struct bcm43xx_pio_txpacket *packet; 463 struct bcm43xx_pio_txpacket *packet;
447 u16 tmp;
448 464
449 assert(!queue->tx_suspended); 465 assert(!queue->tx_suspended);
450 assert(!list_empty(&queue->txfree)); 466 assert(!list_empty(&queue->txfree));
451 467
452 tmp = bcm43xx_pio_read(queue, BCM43xx_PIO_TXCTL);
453 if (tmp & BCM43xx_PIO_TXCTL_SUSPEND)
454 return -EBUSY;
455
456 packet = list_entry(queue->txfree.next, struct bcm43xx_pio_txpacket, list); 468 packet = list_entry(queue->txfree.next, struct bcm43xx_pio_txpacket, list);
457 packet->txb = txb; 469 packet->txb = txb;
458 packet->xmitted_frags = 0; 470 packet->xmitted_frags = 0;
@@ -462,7 +474,7 @@ int bcm43xx_pio_tx(struct bcm43xx_private *bcm,
462 assert(queue->nr_txfree < BCM43xx_PIO_MAXTXPACKETS); 474 assert(queue->nr_txfree < BCM43xx_PIO_MAXTXPACKETS);
463 475
464 /* Suspend TX, if we are out of packets in the "free" queue. */ 476 /* Suspend TX, if we are out of packets in the "free" queue. */
465 if (unlikely(list_empty(&queue->txfree))) { 477 if (list_empty(&queue->txfree)) {
466 netif_stop_queue(queue->bcm->net_dev); 478 netif_stop_queue(queue->bcm->net_dev);
467 queue->tx_suspended = 1; 479 queue->tx_suspended = 1;
468 } 480 }
@@ -480,15 +492,15 @@ void bcm43xx_pio_handle_xmitstatus(struct bcm43xx_private *bcm,
480 492
481 queue = parse_cookie(bcm, status->cookie, &packet); 493 queue = parse_cookie(bcm, status->cookie, &packet);
482 assert(queue); 494 assert(queue);
483//TODO 495
484if (!queue)
485return;
486 free_txpacket(packet, 1); 496 free_txpacket(packet, 1);
487 if (unlikely(queue->tx_suspended)) { 497 if (queue->tx_suspended) {
488 queue->tx_suspended = 0; 498 queue->tx_suspended = 0;
489 netif_wake_queue(queue->bcm->net_dev); 499 netif_wake_queue(queue->bcm->net_dev);
490 } 500 }
491 /* If there are packets on the txqueue, poke the tasklet. */ 501 /* If there are packets on the txqueue, poke the tasklet
502 * to transmit them.
503 */
492 if (!list_empty(&queue->txqueue)) 504 if (!list_empty(&queue->txqueue))
493 tasklet_schedule(&queue->txtask); 505 tasklet_schedule(&queue->txtask);
494} 506}
@@ -519,12 +531,9 @@ void bcm43xx_pio_rx(struct bcm43xx_pioqueue *queue)
519 int i, preamble_readwords; 531 int i, preamble_readwords;
520 struct sk_buff *skb; 532 struct sk_buff *skb;
521 533
522return;
523 tmp = bcm43xx_pio_read(queue, BCM43xx_PIO_RXCTL); 534 tmp = bcm43xx_pio_read(queue, BCM43xx_PIO_RXCTL);
524 if (!(tmp & BCM43xx_PIO_RXCTL_DATAAVAILABLE)) { 535 if (!(tmp & BCM43xx_PIO_RXCTL_DATAAVAILABLE))
525 dprintkl(KERN_ERR PFX "PIO RX: No data available\n");//TODO: remove this printk.
526 return; 536 return;
527 }
528 bcm43xx_pio_write(queue, BCM43xx_PIO_RXCTL, 537 bcm43xx_pio_write(queue, BCM43xx_PIO_RXCTL,
529 BCM43xx_PIO_RXCTL_DATAAVAILABLE); 538 BCM43xx_PIO_RXCTL_DATAAVAILABLE);
530 539
@@ -538,8 +547,7 @@ return;
538 return; 547 return;
539data_ready: 548data_ready:
540 549
541//FIXME: endianess in this function. 550 len = bcm43xx_pio_read(queue, BCM43xx_PIO_RXDATA);
542 len = le16_to_cpu(bcm43xx_pio_read(queue, BCM43xx_PIO_RXDATA));
543 if (unlikely(len > 0x700)) { 551 if (unlikely(len > 0x700)) {
544 pio_rx_error(queue, 0, "len > 0x700"); 552 pio_rx_error(queue, 0, "len > 0x700");
545 return; 553 return;
@@ -555,7 +563,7 @@ data_ready:
555 preamble_readwords = 18 / sizeof(u16); 563 preamble_readwords = 18 / sizeof(u16);
556 for (i = 0; i < preamble_readwords; i++) { 564 for (i = 0; i < preamble_readwords; i++) {
557 tmp = bcm43xx_pio_read(queue, BCM43xx_PIO_RXDATA); 565 tmp = bcm43xx_pio_read(queue, BCM43xx_PIO_RXDATA);
558 preamble[i + 1] = cpu_to_be16(tmp);//FIXME? 566 preamble[i + 1] = cpu_to_le16(tmp);
559 } 567 }
560 rxhdr = (struct bcm43xx_rxhdr *)preamble; 568 rxhdr = (struct bcm43xx_rxhdr *)preamble;
561 rxflags2 = le16_to_cpu(rxhdr->flags2); 569 rxflags2 = le16_to_cpu(rxhdr->flags2);
@@ -591,16 +599,40 @@ data_ready:
591 } 599 }
592 skb_put(skb, len); 600 skb_put(skb, len);
593 for (i = 0; i < len - 1; i += 2) { 601 for (i = 0; i < len - 1; i += 2) {
594 tmp = cpu_to_be16(bcm43xx_pio_read(queue, BCM43xx_PIO_RXDATA)); 602 tmp = bcm43xx_pio_read(queue, BCM43xx_PIO_RXDATA);
595 *((u16 *)(skb->data + i)) = tmp; 603 *((u16 *)(skb->data + i)) = cpu_to_le16(tmp);
596 } 604 }
597 if (len % 2) { 605 if (len % 2) {
598 tmp = bcm43xx_pio_read(queue, BCM43xx_PIO_RXDATA); 606 tmp = bcm43xx_pio_read(queue, BCM43xx_PIO_RXDATA);
599 skb->data[len - 1] = (tmp & 0x00FF); 607 skb->data[len - 1] = (tmp & 0x00FF);
608/* The specs say the following is required, but
609 * it is wrong and corrupts the PLCP. If we don't do
610 * this, the PLCP seems to be correct. So ifdef it out for now.
611 */
612#if 0
600 if (rxflags2 & BCM43xx_RXHDR_FLAGS2_TYPE2FRAME) 613 if (rxflags2 & BCM43xx_RXHDR_FLAGS2_TYPE2FRAME)
601 skb->data[0x20] = (tmp & 0xFF00) >> 8; 614 skb->data[2] = (tmp & 0xFF00) >> 8;
602 else 615 else
603 skb->data[0x1E] = (tmp & 0xFF00) >> 8; 616 skb->data[0] = (tmp & 0xFF00) >> 8;
617#endif
604 } 618 }
619 skb_trim(skb, len - IEEE80211_FCS_LEN);
605 bcm43xx_rx(queue->bcm, skb, rxhdr); 620 bcm43xx_rx(queue->bcm, skb, rxhdr);
606} 621}
622
623void bcm43xx_pio_tx_suspend(struct bcm43xx_pioqueue *queue)
624{
625 bcm43xx_power_saving_ctl_bits(queue->bcm, -1, 1);
626 bcm43xx_pio_write(queue, BCM43xx_PIO_TXCTL,
627 bcm43xx_pio_read(queue, BCM43xx_PIO_TXCTL)
628 | BCM43xx_PIO_TXCTL_SUSPEND);
629}
630
631void bcm43xx_pio_tx_resume(struct bcm43xx_pioqueue *queue)
632{
633 bcm43xx_pio_write(queue, BCM43xx_PIO_TXCTL,
634 bcm43xx_pio_read(queue, BCM43xx_PIO_TXCTL)
635 & ~BCM43xx_PIO_TXCTL_SUSPEND);
636 bcm43xx_power_saving_ctl_bits(queue->bcm, -1, -1);
637 tasklet_schedule(&queue->txtask);
638}
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_pio.h b/drivers/net/wireless/bcm43xx/bcm43xx_pio.h
index 970627bc1769..dfc78209e3a3 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_pio.h
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_pio.h
@@ -14,8 +14,8 @@
14#define BCM43xx_PIO_RXCTL 0x08 14#define BCM43xx_PIO_RXCTL 0x08
15#define BCM43xx_PIO_RXDATA 0x0A 15#define BCM43xx_PIO_RXDATA 0x0A
16 16
17#define BCM43xx_PIO_TXCTL_WRITEHI (1 << 0) 17#define BCM43xx_PIO_TXCTL_WRITELO (1 << 0)
18#define BCM43xx_PIO_TXCTL_WRITELO (1 << 1) 18#define BCM43xx_PIO_TXCTL_WRITEHI (1 << 1)
19#define BCM43xx_PIO_TXCTL_COMPLETE (1 << 2) 19#define BCM43xx_PIO_TXCTL_COMPLETE (1 << 2)
20#define BCM43xx_PIO_TXCTL_INIT (1 << 3) 20#define BCM43xx_PIO_TXCTL_INIT (1 << 3)
21#define BCM43xx_PIO_TXCTL_SUSPEND (1 << 7) 21#define BCM43xx_PIO_TXCTL_SUSPEND (1 << 7)
@@ -95,6 +95,7 @@ void bcm43xx_pio_write(struct bcm43xx_pioqueue *queue,
95 u16 offset, u16 value) 95 u16 offset, u16 value)
96{ 96{
97 bcm43xx_write16(queue->bcm, queue->mmio_base + offset, value); 97 bcm43xx_write16(queue->bcm, queue->mmio_base + offset, value);
98 mmiowb();
98} 99}
99 100
100 101
@@ -107,6 +108,9 @@ void bcm43xx_pio_handle_xmitstatus(struct bcm43xx_private *bcm,
107 struct bcm43xx_xmitstatus *status); 108 struct bcm43xx_xmitstatus *status);
108void bcm43xx_pio_rx(struct bcm43xx_pioqueue *queue); 109void bcm43xx_pio_rx(struct bcm43xx_pioqueue *queue);
109 110
111void bcm43xx_pio_tx_suspend(struct bcm43xx_pioqueue *queue);
112void bcm43xx_pio_tx_resume(struct bcm43xx_pioqueue *queue);
113
110#else /* CONFIG_BCM43XX_PIO */ 114#else /* CONFIG_BCM43XX_PIO */
111 115
112static inline 116static inline
@@ -133,6 +137,14 @@ static inline
133void bcm43xx_pio_rx(struct bcm43xx_pioqueue *queue) 137void bcm43xx_pio_rx(struct bcm43xx_pioqueue *queue)
134{ 138{
135} 139}
140static inline
141void bcm43xx_pio_tx_suspend(struct bcm43xx_pioqueue *queue)
142{
143}
144static inline
145void bcm43xx_pio_tx_resume(struct bcm43xx_pioqueue *queue)
146{
147}
136 148
137#endif /* CONFIG_BCM43XX_PIO */ 149#endif /* CONFIG_BCM43XX_PIO */
138#endif /* BCM43xx_PIO_H_ */ 150#endif /* BCM43xx_PIO_H_ */
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_power.c b/drivers/net/wireless/bcm43xx/bcm43xx_power.c
index 3c92b62807c5..6569da3a7a39 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_power.c
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_power.c
@@ -35,77 +35,101 @@
35#include "bcm43xx_main.h" 35#include "bcm43xx_main.h"
36 36
37 37
38/* Get the Slow Clock Source */
39static int bcm43xx_pctl_get_slowclksrc(struct bcm43xx_private *bcm)
40{
41 u32 tmp;
42 int err;
43
44 assert(bcm->current_core == &bcm->core_chipcommon);
45 if (bcm->current_core->rev < 6) {
46 if (bcm->bustype == BCM43xx_BUSTYPE_PCMCIA ||
47 bcm->bustype == BCM43xx_BUSTYPE_SB)
48 return BCM43xx_PCTL_CLKSRC_XTALOS;
49 if (bcm->bustype == BCM43xx_BUSTYPE_PCI) {
50 err = bcm43xx_pci_read_config32(bcm, BCM43xx_PCTL_OUT, &tmp);
51 assert(!err);
52 if (tmp & 0x10)
53 return BCM43xx_PCTL_CLKSRC_PCI;
54 return BCM43xx_PCTL_CLKSRC_XTALOS;
55 }
56 }
57 if (bcm->current_core->rev < 10) {
58 tmp = bcm43xx_read32(bcm, BCM43xx_CHIPCOMMON_SLOWCLKCTL);
59 tmp &= 0x7;
60 if (tmp == 0)
61 return BCM43xx_PCTL_CLKSRC_LOPWROS;
62 if (tmp == 1)
63 return BCM43xx_PCTL_CLKSRC_XTALOS;
64 if (tmp == 2)
65 return BCM43xx_PCTL_CLKSRC_PCI;
66 }
67
68 return BCM43xx_PCTL_CLKSRC_XTALOS;
69}
70
38/* Get max/min slowclock frequency 71/* Get max/min slowclock frequency
39 * as described in http://bcm-specs.sipsolutions.net/PowerControl 72 * as described in http://bcm-specs.sipsolutions.net/PowerControl
40 */ 73 */
41static int bcm43xx_pctl_clockfreqlimit(struct bcm43xx_private *bcm, 74static int bcm43xx_pctl_clockfreqlimit(struct bcm43xx_private *bcm,
42 int get_max) 75 int get_max)
43{ 76{
44 int limit = 0; 77 int limit;
78 int clocksrc;
45 int divisor; 79 int divisor;
46 int selection;
47 int err;
48 u32 tmp; 80 u32 tmp;
49 struct bcm43xx_coreinfo *old_core;
50 81
51 if (!(bcm->chipcommon_capabilities & BCM43xx_CAPABILITIES_PCTL)) 82 assert(bcm->chipcommon_capabilities & BCM43xx_CAPABILITIES_PCTL);
52 goto out; 83 assert(bcm->current_core == &bcm->core_chipcommon);
53 old_core = bcm->current_core;
54 err = bcm43xx_switch_core(bcm, &bcm->core_chipcommon);
55 if (err)
56 goto out;
57 84
85 clocksrc = bcm43xx_pctl_get_slowclksrc(bcm);
58 if (bcm->current_core->rev < 6) { 86 if (bcm->current_core->rev < 6) {
59 if ((bcm->bustype == BCM43xx_BUSTYPE_PCMCIA) || 87 switch (clocksrc) {
60 (bcm->bustype == BCM43xx_BUSTYPE_SB)) { 88 case BCM43xx_PCTL_CLKSRC_PCI:
61 selection = 1; 89 divisor = 64;
90 break;
91 case BCM43xx_PCTL_CLKSRC_XTALOS:
62 divisor = 32; 92 divisor = 32;
63 } else { 93 break;
64 err = bcm43xx_pci_read_config32(bcm, BCM43xx_PCTL_OUT, &tmp); 94 default:
65 if (err) { 95 assert(0);
66 printk(KERN_ERR PFX "clockfreqlimit pcicfg read failure\n"); 96 divisor = 1;
67 goto out_switchback;
68 }
69 if (tmp & 0x10) {
70 /* PCI */
71 selection = 2;
72 divisor = 64;
73 } else {
74 /* XTAL */
75 selection = 1;
76 divisor = 32;
77 }
78 } 97 }
79 } else if (bcm->current_core->rev < 10) { 98 } else if (bcm->current_core->rev < 10) {
80 selection = (tmp & 0x07); 99 switch (clocksrc) {
81 if (selection) { 100 case BCM43xx_PCTL_CLKSRC_LOPWROS:
101 divisor = 1;
102 break;
103 case BCM43xx_PCTL_CLKSRC_XTALOS:
104 case BCM43xx_PCTL_CLKSRC_PCI:
82 tmp = bcm43xx_read32(bcm, BCM43xx_CHIPCOMMON_SLOWCLKCTL); 105 tmp = bcm43xx_read32(bcm, BCM43xx_CHIPCOMMON_SLOWCLKCTL);
83 divisor = 4 * (1 + ((tmp & 0xFFFF0000) >> 16)); 106 divisor = ((tmp & 0xFFFF0000) >> 16) + 1;
84 } else 107 divisor *= 4;
108 break;
109 default:
110 assert(0);
85 divisor = 1; 111 divisor = 1;
112 }
86 } else { 113 } else {
87 tmp = bcm43xx_read32(bcm, BCM43xx_CHIPCOMMON_SYSCLKCTL); 114 tmp = bcm43xx_read32(bcm, BCM43xx_CHIPCOMMON_SYSCLKCTL);
88 divisor = 4 * (1 + ((tmp & 0xFFFF0000) >> 16)); 115 divisor = ((tmp & 0xFFFF0000) >> 16) + 1;
89 selection = 1; 116 divisor *= 4;
90 } 117 }
91 118
92 switch (selection) { 119 switch (clocksrc) {
93 case 0: 120 case BCM43xx_PCTL_CLKSRC_LOPWROS:
94 /* LPO */
95 if (get_max) 121 if (get_max)
96 limit = 43000; 122 limit = 43000;
97 else 123 else
98 limit = 25000; 124 limit = 25000;
99 break; 125 break;
100 case 1: 126 case BCM43xx_PCTL_CLKSRC_XTALOS:
101 /* XTAL */
102 if (get_max) 127 if (get_max)
103 limit = 20200000; 128 limit = 20200000;
104 else 129 else
105 limit = 19800000; 130 limit = 19800000;
106 break; 131 break;
107 case 2: 132 case BCM43xx_PCTL_CLKSRC_PCI:
108 /* PCI */
109 if (get_max) 133 if (get_max)
110 limit = 34000000; 134 limit = 34000000;
111 else 135 else
@@ -113,17 +137,14 @@ static int bcm43xx_pctl_clockfreqlimit(struct bcm43xx_private *bcm,
113 break; 137 break;
114 default: 138 default:
115 assert(0); 139 assert(0);
140 limit = 0;
116 } 141 }
117 limit /= divisor; 142 limit /= divisor;
118 143
119out_switchback:
120 err = bcm43xx_switch_core(bcm, old_core);
121 assert(err == 0);
122
123out:
124 return limit; 144 return limit;
125} 145}
126 146
147
127/* init power control 148/* init power control
128 * as described in http://bcm-specs.sipsolutions.net/PowerControl 149 * as described in http://bcm-specs.sipsolutions.net/PowerControl
129 */ 150 */
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_power.h b/drivers/net/wireless/bcm43xx/bcm43xx_power.h
index 5f63640810bd..c966ab3a5a8c 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_power.h
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_power.h
@@ -33,6 +33,15 @@
33 33
34#include <linux/types.h> 34#include <linux/types.h>
35 35
36/* Clock sources */
37enum {
38 /* PCI clock */
39 BCM43xx_PCTL_CLKSRC_PCI,
40 /* Crystal slow clock oscillator */
41 BCM43xx_PCTL_CLKSRC_XTALOS,
42 /* Low power oscillator */
43 BCM43xx_PCTL_CLKSRC_LOPWROS,
44};
36 45
37struct bcm43xx_private; 46struct bcm43xx_private;
38 47
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_sysfs.c b/drivers/net/wireless/bcm43xx/bcm43xx_sysfs.c
index c44d890b949b..b438f48e891d 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_sysfs.c
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_sysfs.c
@@ -71,14 +71,46 @@ static int get_boolean(const char *buf, size_t count)
71 return -EINVAL; 71 return -EINVAL;
72} 72}
73 73
74static int sprom2hex(const u16 *sprom, char *buf, size_t buf_len)
75{
76 int i, pos = 0;
77
78 for (i = 0; i < BCM43xx_SPROM_SIZE; i++) {
79 pos += snprintf(buf + pos, buf_len - pos - 1,
80 "%04X", swab16(sprom[i]) & 0xFFFF);
81 }
82 pos += snprintf(buf + pos, buf_len - pos - 1, "\n");
83
84 return pos + 1;
85}
86
87static int hex2sprom(u16 *sprom, const char *dump, size_t len)
88{
89 char tmp[5] = { 0 };
90 int cnt = 0;
91 unsigned long parsed;
92
93 if (len < BCM43xx_SPROM_SIZE * sizeof(u16) * 2)
94 return -EINVAL;
95
96 while (cnt < BCM43xx_SPROM_SIZE) {
97 memcpy(tmp, dump, 4);
98 dump += 4;
99 parsed = simple_strtoul(tmp, NULL, 16);
100 sprom[cnt++] = swab16((u16)parsed);
101 }
102
103 return 0;
104}
105
74static ssize_t bcm43xx_attr_sprom_show(struct device *dev, 106static ssize_t bcm43xx_attr_sprom_show(struct device *dev,
75 struct device_attribute *attr, 107 struct device_attribute *attr,
76 char *buf) 108 char *buf)
77{ 109{
78 struct bcm43xx_private *bcm = devattr_to_bcm(attr, attr_sprom); 110 struct bcm43xx_private *bcm = dev_to_bcm(dev);
79 u16 *sprom; 111 u16 *sprom;
80 unsigned long flags; 112 unsigned long flags;
81 int i, err; 113 int err;
82 114
83 if (!capable(CAP_NET_ADMIN)) 115 if (!capable(CAP_NET_ADMIN))
84 return -EPERM; 116 return -EPERM;
@@ -91,55 +123,53 @@ static ssize_t bcm43xx_attr_sprom_show(struct device *dev,
91 bcm43xx_lock_mmio(bcm, flags); 123 bcm43xx_lock_mmio(bcm, flags);
92 assert(bcm->initialized); 124 assert(bcm->initialized);
93 err = bcm43xx_sprom_read(bcm, sprom); 125 err = bcm43xx_sprom_read(bcm, sprom);
94 if (!err) { 126 if (!err)
95 for (i = 0; i < BCM43xx_SPROM_SIZE; i++) { 127 err = sprom2hex(sprom, buf, PAGE_SIZE);
96 buf[i * 2] = sprom[i] & 0x00FF;
97 buf[i * 2 + 1] = (sprom[i] & 0xFF00) >> 8;
98 }
99 }
100 bcm43xx_unlock_mmio(bcm, flags); 128 bcm43xx_unlock_mmio(bcm, flags);
101 kfree(sprom); 129 kfree(sprom);
102 130
103 return err ? err : BCM43xx_SPROM_SIZE * sizeof(u16); 131 return err;
104} 132}
105 133
106static ssize_t bcm43xx_attr_sprom_store(struct device *dev, 134static ssize_t bcm43xx_attr_sprom_store(struct device *dev,
107 struct device_attribute *attr, 135 struct device_attribute *attr,
108 const char *buf, size_t count) 136 const char *buf, size_t count)
109{ 137{
110 struct bcm43xx_private *bcm = devattr_to_bcm(attr, attr_sprom); 138 struct bcm43xx_private *bcm = dev_to_bcm(dev);
111 u16 *sprom; 139 u16 *sprom;
112 unsigned long flags; 140 unsigned long flags;
113 int i, err; 141 int err;
114 142
115 if (!capable(CAP_NET_ADMIN)) 143 if (!capable(CAP_NET_ADMIN))
116 return -EPERM; 144 return -EPERM;
117 145
118 if (count != BCM43xx_SPROM_SIZE * sizeof(u16))
119 return -EINVAL;
120 sprom = kmalloc(BCM43xx_SPROM_SIZE * sizeof(*sprom), 146 sprom = kmalloc(BCM43xx_SPROM_SIZE * sizeof(*sprom),
121 GFP_KERNEL); 147 GFP_KERNEL);
122 if (!sprom) 148 if (!sprom)
123 return -ENOMEM; 149 return -ENOMEM;
124 for (i = 0; i < BCM43xx_SPROM_SIZE; i++) { 150 err = hex2sprom(sprom, buf, count);
125 sprom[i] = buf[i * 2] & 0xFF; 151 if (err)
126 sprom[i] |= ((u16)(buf[i * 2 + 1] & 0xFF)) << 8; 152 goto out_kfree;
127 }
128 bcm43xx_lock_mmio(bcm, flags); 153 bcm43xx_lock_mmio(bcm, flags);
129 assert(bcm->initialized); 154 assert(bcm->initialized);
130 err = bcm43xx_sprom_write(bcm, sprom); 155 err = bcm43xx_sprom_write(bcm, sprom);
131 bcm43xx_unlock_mmio(bcm, flags); 156 bcm43xx_unlock_mmio(bcm, flags);
157out_kfree:
132 kfree(sprom); 158 kfree(sprom);
133 159
134 return err ? err : count; 160 return err ? err : count;
135 161
136} 162}
137 163
164static DEVICE_ATTR(sprom, 0600,
165 bcm43xx_attr_sprom_show,
166 bcm43xx_attr_sprom_store);
167
138static ssize_t bcm43xx_attr_interfmode_show(struct device *dev, 168static ssize_t bcm43xx_attr_interfmode_show(struct device *dev,
139 struct device_attribute *attr, 169 struct device_attribute *attr,
140 char *buf) 170 char *buf)
141{ 171{
142 struct bcm43xx_private *bcm = devattr_to_bcm(attr, attr_interfmode); 172 struct bcm43xx_private *bcm = dev_to_bcm(dev);
143 unsigned long flags; 173 unsigned long flags;
144 int err; 174 int err;
145 ssize_t count = 0; 175 ssize_t count = 0;
@@ -175,7 +205,7 @@ static ssize_t bcm43xx_attr_interfmode_store(struct device *dev,
175 struct device_attribute *attr, 205 struct device_attribute *attr,
176 const char *buf, size_t count) 206 const char *buf, size_t count)
177{ 207{
178 struct bcm43xx_private *bcm = devattr_to_bcm(attr, attr_interfmode); 208 struct bcm43xx_private *bcm = dev_to_bcm(dev);
179 unsigned long flags; 209 unsigned long flags;
180 int err; 210 int err;
181 int mode; 211 int mode;
@@ -215,11 +245,15 @@ static ssize_t bcm43xx_attr_interfmode_store(struct device *dev,
215 return err ? err : count; 245 return err ? err : count;
216} 246}
217 247
248static DEVICE_ATTR(interference, 0644,
249 bcm43xx_attr_interfmode_show,
250 bcm43xx_attr_interfmode_store);
251
218static ssize_t bcm43xx_attr_preamble_show(struct device *dev, 252static ssize_t bcm43xx_attr_preamble_show(struct device *dev,
219 struct device_attribute *attr, 253 struct device_attribute *attr,
220 char *buf) 254 char *buf)
221{ 255{
222 struct bcm43xx_private *bcm = devattr_to_bcm(attr, attr_preamble); 256 struct bcm43xx_private *bcm = dev_to_bcm(dev);
223 unsigned long flags; 257 unsigned long flags;
224 int err; 258 int err;
225 ssize_t count; 259 ssize_t count;
@@ -245,7 +279,7 @@ static ssize_t bcm43xx_attr_preamble_store(struct device *dev,
245 struct device_attribute *attr, 279 struct device_attribute *attr,
246 const char *buf, size_t count) 280 const char *buf, size_t count)
247{ 281{
248 struct bcm43xx_private *bcm = devattr_to_bcm(attr, attr_preamble); 282 struct bcm43xx_private *bcm = dev_to_bcm(dev);
249 unsigned long flags; 283 unsigned long flags;
250 int err; 284 int err;
251 int value; 285 int value;
@@ -267,56 +301,41 @@ static ssize_t bcm43xx_attr_preamble_store(struct device *dev,
267 return err ? err : count; 301 return err ? err : count;
268} 302}
269 303
304static DEVICE_ATTR(shortpreamble, 0644,
305 bcm43xx_attr_preamble_show,
306 bcm43xx_attr_preamble_store);
307
270int bcm43xx_sysfs_register(struct bcm43xx_private *bcm) 308int bcm43xx_sysfs_register(struct bcm43xx_private *bcm)
271{ 309{
272 struct device *dev = &bcm->pci_dev->dev; 310 struct device *dev = &bcm->pci_dev->dev;
273 struct bcm43xx_sysfs *sysfs = &bcm->sysfs;
274 int err; 311 int err;
275 312
276 assert(bcm->initialized); 313 assert(bcm->initialized);
277 314
278 sysfs->attr_sprom.attr.name = "sprom"; 315 err = device_create_file(dev, &dev_attr_sprom);
279 sysfs->attr_sprom.attr.owner = THIS_MODULE;
280 sysfs->attr_sprom.attr.mode = 0600;
281 sysfs->attr_sprom.show = bcm43xx_attr_sprom_show;
282 sysfs->attr_sprom.store = bcm43xx_attr_sprom_store;
283 err = device_create_file(dev, &sysfs->attr_sprom);
284 if (err) 316 if (err)
285 goto out; 317 goto out;
286 318 err = device_create_file(dev, &dev_attr_interference);
287 sysfs->attr_interfmode.attr.name = "interference";
288 sysfs->attr_interfmode.attr.owner = THIS_MODULE;
289 sysfs->attr_interfmode.attr.mode = 0600;
290 sysfs->attr_interfmode.show = bcm43xx_attr_interfmode_show;
291 sysfs->attr_interfmode.store = bcm43xx_attr_interfmode_store;
292 err = device_create_file(dev, &sysfs->attr_interfmode);
293 if (err) 319 if (err)
294 goto err_remove_sprom; 320 goto err_remove_sprom;
295 321 err = device_create_file(dev, &dev_attr_shortpreamble);
296 sysfs->attr_preamble.attr.name = "shortpreamble";
297 sysfs->attr_preamble.attr.owner = THIS_MODULE;
298 sysfs->attr_preamble.attr.mode = 0600;
299 sysfs->attr_preamble.show = bcm43xx_attr_preamble_show;
300 sysfs->attr_preamble.store = bcm43xx_attr_preamble_store;
301 err = device_create_file(dev, &sysfs->attr_preamble);
302 if (err) 322 if (err)
303 goto err_remove_interfmode; 323 goto err_remove_interfmode;
304 324
305out: 325out:
306 return err; 326 return err;
307err_remove_interfmode: 327err_remove_interfmode:
308 device_remove_file(dev, &sysfs->attr_interfmode); 328 device_remove_file(dev, &dev_attr_interference);
309err_remove_sprom: 329err_remove_sprom:
310 device_remove_file(dev, &sysfs->attr_sprom); 330 device_remove_file(dev, &dev_attr_sprom);
311 goto out; 331 goto out;
312} 332}
313 333
314void bcm43xx_sysfs_unregister(struct bcm43xx_private *bcm) 334void bcm43xx_sysfs_unregister(struct bcm43xx_private *bcm)
315{ 335{
316 struct device *dev = &bcm->pci_dev->dev; 336 struct device *dev = &bcm->pci_dev->dev;
317 struct bcm43xx_sysfs *sysfs = &bcm->sysfs;
318 337
319 device_remove_file(dev, &sysfs->attr_preamble); 338 device_remove_file(dev, &dev_attr_shortpreamble);
320 device_remove_file(dev, &sysfs->attr_interfmode); 339 device_remove_file(dev, &dev_attr_interference);
321 device_remove_file(dev, &sysfs->attr_sprom); 340 device_remove_file(dev, &dev_attr_sprom);
322} 341}
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_sysfs.h b/drivers/net/wireless/bcm43xx/bcm43xx_sysfs.h
index 57f14514e3e0..cc701df71e2a 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_sysfs.h
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_sysfs.h
@@ -1,22 +1,6 @@
1#ifndef BCM43xx_SYSFS_H_ 1#ifndef BCM43xx_SYSFS_H_
2#define BCM43xx_SYSFS_H_ 2#define BCM43xx_SYSFS_H_
3 3
4#include <linux/device.h>
5
6
7struct bcm43xx_sysfs {
8 struct device_attribute attr_sprom;
9 struct device_attribute attr_interfmode;
10 struct device_attribute attr_preamble;
11};
12
13#define devattr_to_bcm(attr, attr_name) ({ \
14 struct bcm43xx_sysfs *__s; struct bcm43xx_private *__p; \
15 __s = container_of((attr), struct bcm43xx_sysfs, attr_name); \
16 __p = container_of(__s, struct bcm43xx_private, sysfs); \
17 __p; \
18 })
19
20struct bcm43xx_private; 4struct bcm43xx_private;
21 5
22int bcm43xx_sysfs_register(struct bcm43xx_private *bcm); 6int bcm43xx_sysfs_register(struct bcm43xx_private *bcm);
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_wx.c b/drivers/net/wireless/bcm43xx/bcm43xx_wx.c
index 3daee828ef4b..b45063974ae9 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_wx.c
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_wx.c
@@ -182,8 +182,11 @@ static int bcm43xx_wx_set_mode(struct net_device *net_dev,
182 mode = BCM43xx_INITIAL_IWMODE; 182 mode = BCM43xx_INITIAL_IWMODE;
183 183
184 bcm43xx_lock_mmio(bcm, flags); 184 bcm43xx_lock_mmio(bcm, flags);
185 if (bcm->ieee->iw_mode != mode) 185 if (bcm->initialized) {
186 bcm43xx_set_iwmode(bcm, mode); 186 if (bcm->ieee->iw_mode != mode)
187 bcm43xx_set_iwmode(bcm, mode);
188 } else
189 bcm->ieee->iw_mode = mode;
187 bcm43xx_unlock_mmio(bcm, flags); 190 bcm43xx_unlock_mmio(bcm, flags);
188 191
189 return 0; 192 return 0;
@@ -962,22 +965,22 @@ static const struct iw_priv_args bcm43xx_priv_wx_args[] = {
962 { 965 {
963 .cmd = PRIV_WX_SET_SHORTPREAMBLE, 966 .cmd = PRIV_WX_SET_SHORTPREAMBLE,
964 .set_args = IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 967 .set_args = IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
965 .name = "set_shortpreambl", 968 .name = "set_shortpreamb",
966 }, 969 },
967 { 970 {
968 .cmd = PRIV_WX_GET_SHORTPREAMBLE, 971 .cmd = PRIV_WX_GET_SHORTPREAMBLE,
969 .get_args = IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_FIXED | MAX_WX_STRING, 972 .get_args = IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_FIXED | MAX_WX_STRING,
970 .name = "get_shortpreambl", 973 .name = "get_shortpreamb",
971 }, 974 },
972 { 975 {
973 .cmd = PRIV_WX_SET_SWENCRYPTION, 976 .cmd = PRIV_WX_SET_SWENCRYPTION,
974 .set_args = IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 977 .set_args = IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
975 .name = "set_swencryption", 978 .name = "set_swencrypt",
976 }, 979 },
977 { 980 {
978 .cmd = PRIV_WX_GET_SWENCRYPTION, 981 .cmd = PRIV_WX_GET_SWENCRYPTION,
979 .get_args = IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_FIXED | MAX_WX_STRING, 982 .get_args = IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_FIXED | MAX_WX_STRING,
980 .name = "get_swencryption", 983 .name = "get_swencrypt",
981 }, 984 },
982 { 985 {
983 .cmd = PRIV_WX_SPROM_WRITE, 986 .cmd = PRIV_WX_SPROM_WRITE,
diff --git a/drivers/net/wireless/hostap/hostap_ioctl.c b/drivers/net/wireless/hostap/hostap_ioctl.c
index 8b37e824dfcb..8399de581893 100644
--- a/drivers/net/wireless/hostap/hostap_ioctl.c
+++ b/drivers/net/wireless/hostap/hostap_ioctl.c
@@ -1860,7 +1860,7 @@ static char * __prism2_translate_scan(local_info_t *local,
1860 memset(&iwe, 0, sizeof(iwe)); 1860 memset(&iwe, 0, sizeof(iwe));
1861 iwe.cmd = SIOCGIWFREQ; 1861 iwe.cmd = SIOCGIWFREQ;
1862 if (scan) { 1862 if (scan) {
1863 chan = scan->chid; 1863 chan = le16_to_cpu(scan->chid);
1864 } else if (bss) { 1864 } else if (bss) {
1865 chan = bss->chan; 1865 chan = bss->chan;
1866 } else { 1866 } else {
@@ -1868,7 +1868,7 @@ static char * __prism2_translate_scan(local_info_t *local,
1868 } 1868 }
1869 1869
1870 if (chan > 0) { 1870 if (chan > 0) {
1871 iwe.u.freq.m = freq_list[le16_to_cpu(chan - 1)] * 100000; 1871 iwe.u.freq.m = freq_list[chan - 1] * 100000;
1872 iwe.u.freq.e = 1; 1872 iwe.u.freq.e = 1;
1873 current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, 1873 current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe,
1874 IW_EV_FREQ_LEN); 1874 IW_EV_FREQ_LEN);
diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c
index 8dfdfbd5966c..c2d0b09e0418 100644
--- a/drivers/net/wireless/orinoco.c
+++ b/drivers/net/wireless/orinoco.c
@@ -390,7 +390,7 @@ static struct iw_statistics *orinoco_get_wireless_stats(struct net_device *dev)
390 } 390 }
391 } else { 391 } else {
392 struct { 392 struct {
393 __le16 qual, signal, noise; 393 __le16 qual, signal, noise, unused;
394 } __attribute__ ((packed)) cq; 394 } __attribute__ ((packed)) cq;
395 395
396 err = HERMES_READ_RECORD(hw, USER_BAP, 396 err = HERMES_READ_RECORD(hw, USER_BAP,
@@ -812,7 +812,6 @@ static void orinoco_rx_monitor(struct net_device *dev, u16 rxfid,
812 if (datalen > IEEE80211_DATA_LEN + 12) { 812 if (datalen > IEEE80211_DATA_LEN + 12) {
813 printk(KERN_DEBUG "%s: oversized monitor frame, " 813 printk(KERN_DEBUG "%s: oversized monitor frame, "
814 "data length = %d\n", dev->name, datalen); 814 "data length = %d\n", dev->name, datalen);
815 err = -EIO;
816 stats->rx_length_errors++; 815 stats->rx_length_errors++;
817 goto update_stats; 816 goto update_stats;
818 } 817 }
@@ -821,8 +820,7 @@ static void orinoco_rx_monitor(struct net_device *dev, u16 rxfid,
821 if (!skb) { 820 if (!skb) {
822 printk(KERN_WARNING "%s: Cannot allocate skb for monitor frame\n", 821 printk(KERN_WARNING "%s: Cannot allocate skb for monitor frame\n",
823 dev->name); 822 dev->name);
824 err = -ENOMEM; 823 goto update_stats;
825 goto drop;
826 } 824 }
827 825
828 /* Copy the 802.11 header to the skb */ 826 /* Copy the 802.11 header to the skb */
diff --git a/drivers/net/wireless/wavelan.c b/drivers/net/wireless/wavelan.c
index ff192e96268a..dade4b903579 100644
--- a/drivers/net/wireless/wavelan.c
+++ b/drivers/net/wireless/wavelan.c
@@ -4306,7 +4306,7 @@ out:
4306 * Insertion of the module 4306 * Insertion of the module
4307 * I'm now quite proud of the multi-device support. 4307 * I'm now quite proud of the multi-device support.
4308 */ 4308 */
4309int init_module(void) 4309int __init init_module(void)
4310{ 4310{
4311 int ret = -EIO; /* Return error if no cards found */ 4311 int ret = -EIO; /* Return error if no cards found */
4312 int i; 4312 int i;
diff --git a/drivers/parisc/pdc_stable.c b/drivers/parisc/pdc_stable.c
index 4e53be9c03ab..bbeabe3fc4c6 100644
--- a/drivers/parisc/pdc_stable.c
+++ b/drivers/parisc/pdc_stable.c
@@ -535,7 +535,7 @@ pdcs_auto_read(struct subsystem *entry, char *buf, int knob)
535{ 535{
536 char *out = buf; 536 char *out = buf;
537 struct pdcspath_entry *pathentry; 537 struct pdcspath_entry *pathentry;
538 538
539 if (!entry || !buf) 539 if (!entry || !buf)
540 return -EINVAL; 540 return -EINVAL;
541 541
diff --git a/drivers/parisc/sba_iommu.c b/drivers/parisc/sba_iommu.c
index 42b32ff2fca6..278f325021ee 100644
--- a/drivers/parisc/sba_iommu.c
+++ b/drivers/parisc/sba_iommu.c
@@ -178,6 +178,11 @@ extern struct proc_dir_entry * proc_mckinley_root;
178#define ROPE6_CTL 0x230 178#define ROPE6_CTL 0x230
179#define ROPE7_CTL 0x238 179#define ROPE7_CTL 0x238
180 180
181#define IOC_ROPE0_CFG 0x500 /* pluto only */
182#define IOC_ROPE_AO 0x10 /* Allow "Relaxed Ordering" */
183
184
185
181#define HF_ENABLE 0x40 186#define HF_ENABLE 0x40
182 187
183 188
@@ -1759,19 +1764,33 @@ printk("sba_hw_init(): mem_boot 0x%x 0x%x 0x%x 0x%x\n", PAGE0->mem_boot.hpa,
1759 1764
1760 sba_dev->num_ioc = num_ioc; 1765 sba_dev->num_ioc = num_ioc;
1761 for (i = 0; i < num_ioc; i++) { 1766 for (i = 0; i < num_ioc; i++) {
1762 /* 1767 unsigned long ioc_hpa = sba_dev->ioc[i].ioc_hpa;
1763 ** Make sure the box crashes if we get any errors on a rope. 1768 unsigned int j;
1764 */ 1769
1765 WRITE_REG(HF_ENABLE, sba_dev->ioc[i].ioc_hpa + ROPE0_CTL); 1770 for (j=0; j < sizeof(u64) * ROPES_PER_IOC; j+=sizeof(u64)) {
1766 WRITE_REG(HF_ENABLE, sba_dev->ioc[i].ioc_hpa + ROPE1_CTL); 1771
1767 WRITE_REG(HF_ENABLE, sba_dev->ioc[i].ioc_hpa + ROPE2_CTL); 1772 /*
1768 WRITE_REG(HF_ENABLE, sba_dev->ioc[i].ioc_hpa + ROPE3_CTL); 1773 * Clear ROPE(N)_CONFIG AO bit.
1769 WRITE_REG(HF_ENABLE, sba_dev->ioc[i].ioc_hpa + ROPE4_CTL); 1774 * Disables "NT Ordering" (~= !"Relaxed Ordering")
1770 WRITE_REG(HF_ENABLE, sba_dev->ioc[i].ioc_hpa + ROPE5_CTL); 1775 * Overrides bit 1 in DMA Hint Sets.
1771 WRITE_REG(HF_ENABLE, sba_dev->ioc[i].ioc_hpa + ROPE6_CTL); 1776 * Improves netperf UDP_STREAM by ~10% for bcm5701.
1772 WRITE_REG(HF_ENABLE, sba_dev->ioc[i].ioc_hpa + ROPE7_CTL); 1777 */
1773 1778 if (IS_PLUTO(sba_dev->iodc)) {
1774 /* flush out the writes */ 1779 unsigned long rope_cfg, cfg_val;
1780
1781 rope_cfg = ioc_hpa + IOC_ROPE0_CFG + j;
1782 cfg_val = READ_REG(rope_cfg);
1783 cfg_val &= ~IOC_ROPE_AO;
1784 WRITE_REG(cfg_val, rope_cfg);
1785 }
1786
1787 /*
1788 ** Make sure the box crashes on rope errors.
1789 */
1790 WRITE_REG(HF_ENABLE, ioc_hpa + ROPE0_CTL + j);
1791 }
1792
1793 /* flush out the last writes */
1775 READ_REG(sba_dev->ioc[i].ioc_hpa + ROPE7_CTL); 1794 READ_REG(sba_dev->ioc[i].ioc_hpa + ROPE7_CTL);
1776 1795
1777 DBG_INIT(" ioc[%d] ROPE_CFG 0x%Lx ROPE_DBG 0x%Lx\n", 1796 DBG_INIT(" ioc[%d] ROPE_CFG 0x%Lx ROPE_DBG 0x%Lx\n",
diff --git a/drivers/parisc/superio.c b/drivers/parisc/superio.c
index 719b863bc20e..828eb45062de 100644
--- a/drivers/parisc/superio.c
+++ b/drivers/parisc/superio.c
@@ -155,7 +155,7 @@ superio_init(struct pci_dev *pcidev)
155 struct pci_dev *pdev = sio->lio_pdev; 155 struct pci_dev *pdev = sio->lio_pdev;
156 u16 word; 156 u16 word;
157 157
158 if (sio->suckyio_irq_enabled) 158 if (sio->suckyio_irq_enabled)
159 return; 159 return;
160 160
161 BUG_ON(!pdev); 161 BUG_ON(!pdev);
@@ -194,7 +194,7 @@ superio_init(struct pci_dev *pcidev)
194 request_region (sio->acpi_base, 0x1f, "acpi"); 194 request_region (sio->acpi_base, 0x1f, "acpi");
195 195
196 /* Enable the legacy I/O function */ 196 /* Enable the legacy I/O function */
197 pci_read_config_word (pdev, PCI_COMMAND, &word); 197 pci_read_config_word (pdev, PCI_COMMAND, &word);
198 word |= PCI_COMMAND_SERR | PCI_COMMAND_PARITY | PCI_COMMAND_IO; 198 word |= PCI_COMMAND_SERR | PCI_COMMAND_PARITY | PCI_COMMAND_IO;
199 pci_write_config_word (pdev, PCI_COMMAND, word); 199 pci_write_config_word (pdev, PCI_COMMAND, word);
200 200
diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c
index d5890027f8af..48bbf32fd980 100644
--- a/drivers/parport/parport_pc.c
+++ b/drivers/parport/parport_pc.c
@@ -97,7 +97,7 @@ static struct superio_struct { /* For Super-IO chips autodetection */
97 int io; 97 int io;
98 int irq; 98 int irq;
99 int dma; 99 int dma;
100} superios[NR_SUPERIOS] __devinitdata = { {0,},}; 100} superios[NR_SUPERIOS] = { {0,},};
101 101
102static int user_specified; 102static int user_specified;
103#if defined(CONFIG_PARPORT_PC_SUPERIO) || \ 103#if defined(CONFIG_PARPORT_PC_SUPERIO) || \
@@ -1557,7 +1557,7 @@ static int __devinit get_superio_dma (struct parport *p)
1557 return PARPORT_DMA_NONE; 1557 return PARPORT_DMA_NONE;
1558} 1558}
1559 1559
1560static int __devinit get_superio_irq (struct parport *p) 1560static int get_superio_irq (struct parport *p)
1561{ 1561{
1562 int i=0; 1562 int i=0;
1563 while( (superios[i].io != p->base) && (i<NR_SUPERIOS)) 1563 while( (superios[i].io != p->base) && (i<NR_SUPERIOS))
@@ -1579,7 +1579,7 @@ static int __devinit get_superio_irq (struct parport *p)
1579 * this shall always be the case!) 1579 * this shall always be the case!)
1580 * 1580 *
1581 */ 1581 */
1582static int __devinit parport_SPP_supported(struct parport *pb) 1582static int parport_SPP_supported(struct parport *pb)
1583{ 1583{
1584 unsigned char r, w; 1584 unsigned char r, w;
1585 1585
@@ -1660,7 +1660,7 @@ static int __devinit parport_SPP_supported(struct parport *pb)
1660 * two bits of ECR aren't writable, so we check by writing ECR and 1660 * two bits of ECR aren't writable, so we check by writing ECR and
1661 * reading it back to see if it's what we expect. 1661 * reading it back to see if it's what we expect.
1662 */ 1662 */
1663static int __devinit parport_ECR_present(struct parport *pb) 1663static int parport_ECR_present(struct parport *pb)
1664{ 1664{
1665 struct parport_pc_private *priv = pb->private_data; 1665 struct parport_pc_private *priv = pb->private_data;
1666 unsigned char r = 0xc; 1666 unsigned char r = 0xc;
@@ -1712,7 +1712,7 @@ static int __devinit parport_ECR_present(struct parport *pb)
1712 * be misdetected here is rather academic. 1712 * be misdetected here is rather academic.
1713 */ 1713 */
1714 1714
1715static int __devinit parport_PS2_supported(struct parport *pb) 1715static int parport_PS2_supported(struct parport *pb)
1716{ 1716{
1717 int ok = 0; 1717 int ok = 0;
1718 1718
@@ -1868,7 +1868,7 @@ static int __devinit parport_ECP_supported(struct parport *pb)
1868} 1868}
1869#endif 1869#endif
1870 1870
1871static int __devinit parport_ECPPS2_supported(struct parport *pb) 1871static int parport_ECPPS2_supported(struct parport *pb)
1872{ 1872{
1873 const struct parport_pc_private *priv = pb->private_data; 1873 const struct parport_pc_private *priv = pb->private_data;
1874 int result; 1874 int result;
@@ -1886,7 +1886,7 @@ static int __devinit parport_ECPPS2_supported(struct parport *pb)
1886 1886
1887/* EPP mode detection */ 1887/* EPP mode detection */
1888 1888
1889static int __devinit parport_EPP_supported(struct parport *pb) 1889static int parport_EPP_supported(struct parport *pb)
1890{ 1890{
1891 const struct parport_pc_private *priv = pb->private_data; 1891 const struct parport_pc_private *priv = pb->private_data;
1892 1892
@@ -1931,7 +1931,7 @@ static int __devinit parport_EPP_supported(struct parport *pb)
1931 return 1; 1931 return 1;
1932} 1932}
1933 1933
1934static int __devinit parport_ECPEPP_supported(struct parport *pb) 1934static int parport_ECPEPP_supported(struct parport *pb)
1935{ 1935{
1936 struct parport_pc_private *priv = pb->private_data; 1936 struct parport_pc_private *priv = pb->private_data;
1937 int result; 1937 int result;
@@ -2073,7 +2073,7 @@ static int __devinit irq_probe_SPP(struct parport *pb)
2073 * When ECP is available we can autoprobe for IRQs. 2073 * When ECP is available we can autoprobe for IRQs.
2074 * NOTE: If we can autoprobe it, we can register the IRQ. 2074 * NOTE: If we can autoprobe it, we can register the IRQ.
2075 */ 2075 */
2076static int __devinit parport_irq_probe(struct parport *pb) 2076static int parport_irq_probe(struct parport *pb)
2077{ 2077{
2078 struct parport_pc_private *priv = pb->private_data; 2078 struct parport_pc_private *priv = pb->private_data;
2079 2079
@@ -2779,7 +2779,7 @@ static struct parport_pc_pci {
2779 /* If set, this is called after probing for ports. If 'failed' 2779 /* If set, this is called after probing for ports. If 'failed'
2780 * is non-zero we couldn't use any of the ports. */ 2780 * is non-zero we couldn't use any of the ports. */
2781 void (*postinit_hook) (struct pci_dev *pdev, int failed); 2781 void (*postinit_hook) (struct pci_dev *pdev, int failed);
2782} cards[] __devinitdata = { 2782} cards[] = {
2783 /* siig_1p_10x */ { 1, { { 2, 3 }, } }, 2783 /* siig_1p_10x */ { 1, { { 2, 3 }, } },
2784 /* siig_2p_10x */ { 2, { { 2, 3 }, { 4, 5 }, } }, 2784 /* siig_2p_10x */ { 2, { { 2, 3 }, { 4, 5 }, } },
2785 /* siig_1p_20x */ { 1, { { 0, 1 }, } }, 2785 /* siig_1p_20x */ { 1, { { 0, 1 }, } },
diff --git a/drivers/pci/hotplug/rpaphp_core.c b/drivers/pci/hotplug/rpaphp_core.c
index 6e79f5675b0d..638004546700 100644
--- a/drivers/pci/hotplug/rpaphp_core.c
+++ b/drivers/pci/hotplug/rpaphp_core.c
@@ -360,9 +360,6 @@ static int __init rpaphp_init(void)
360 while ((dn = of_find_node_by_type(dn, "pci"))) 360 while ((dn = of_find_node_by_type(dn, "pci")))
361 rpaphp_add_slot(dn); 361 rpaphp_add_slot(dn);
362 362
363 if (!num_slots)
364 return -ENODEV;
365
366 return 0; 363 return 0;
367} 364}
368 365
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index a77e79c8c82e..9855c4c920b8 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -504,6 +504,201 @@ void pci_scan_msi_device(struct pci_dev *dev)
504 nr_reserved_vectors++; 504 nr_reserved_vectors++;
505} 505}
506 506
507#ifdef CONFIG_PM
508int pci_save_msi_state(struct pci_dev *dev)
509{
510 int pos, i = 0;
511 u16 control;
512 struct pci_cap_saved_state *save_state;
513 u32 *cap;
514
515 pos = pci_find_capability(dev, PCI_CAP_ID_MSI);
516 if (pos <= 0 || dev->no_msi)
517 return 0;
518
519 pci_read_config_word(dev, msi_control_reg(pos), &control);
520 if (!(control & PCI_MSI_FLAGS_ENABLE))
521 return 0;
522
523 save_state = kzalloc(sizeof(struct pci_cap_saved_state) + sizeof(u32) * 5,
524 GFP_KERNEL);
525 if (!save_state) {
526 printk(KERN_ERR "Out of memory in pci_save_msi_state\n");
527 return -ENOMEM;
528 }
529 cap = &save_state->data[0];
530
531 pci_read_config_dword(dev, pos, &cap[i++]);
532 control = cap[0] >> 16;
533 pci_read_config_dword(dev, pos + PCI_MSI_ADDRESS_LO, &cap[i++]);
534 if (control & PCI_MSI_FLAGS_64BIT) {
535 pci_read_config_dword(dev, pos + PCI_MSI_ADDRESS_HI, &cap[i++]);
536 pci_read_config_dword(dev, pos + PCI_MSI_DATA_64, &cap[i++]);
537 } else
538 pci_read_config_dword(dev, pos + PCI_MSI_DATA_32, &cap[i++]);
539 if (control & PCI_MSI_FLAGS_MASKBIT)
540 pci_read_config_dword(dev, pos + PCI_MSI_MASK_BIT, &cap[i++]);
541 disable_msi_mode(dev, pos, PCI_CAP_ID_MSI);
542 save_state->cap_nr = PCI_CAP_ID_MSI;
543 pci_add_saved_cap(dev, save_state);
544 return 0;
545}
546
547void pci_restore_msi_state(struct pci_dev *dev)
548{
549 int i = 0, pos;
550 u16 control;
551 struct pci_cap_saved_state *save_state;
552 u32 *cap;
553
554 save_state = pci_find_saved_cap(dev, PCI_CAP_ID_MSI);
555 pos = pci_find_capability(dev, PCI_CAP_ID_MSI);
556 if (!save_state || pos <= 0)
557 return;
558 cap = &save_state->data[0];
559
560 control = cap[i++] >> 16;
561 pci_write_config_dword(dev, pos + PCI_MSI_ADDRESS_LO, cap[i++]);
562 if (control & PCI_MSI_FLAGS_64BIT) {
563 pci_write_config_dword(dev, pos + PCI_MSI_ADDRESS_HI, cap[i++]);
564 pci_write_config_dword(dev, pos + PCI_MSI_DATA_64, cap[i++]);
565 } else
566 pci_write_config_dword(dev, pos + PCI_MSI_DATA_32, cap[i++]);
567 if (control & PCI_MSI_FLAGS_MASKBIT)
568 pci_write_config_dword(dev, pos + PCI_MSI_MASK_BIT, cap[i++]);
569 pci_write_config_word(dev, pos + PCI_MSI_FLAGS, control);
570 enable_msi_mode(dev, pos, PCI_CAP_ID_MSI);
571 pci_remove_saved_cap(save_state);
572 kfree(save_state);
573}
574
575int pci_save_msix_state(struct pci_dev *dev)
576{
577 int pos;
578 u16 control;
579 struct pci_cap_saved_state *save_state;
580
581 pos = pci_find_capability(dev, PCI_CAP_ID_MSIX);
582 if (pos <= 0 || dev->no_msi)
583 return 0;
584
585 pci_read_config_word(dev, msi_control_reg(pos), &control);
586 if (!(control & PCI_MSIX_FLAGS_ENABLE))
587 return 0;
588 save_state = kzalloc(sizeof(struct pci_cap_saved_state) + sizeof(u16),
589 GFP_KERNEL);
590 if (!save_state) {
591 printk(KERN_ERR "Out of memory in pci_save_msix_state\n");
592 return -ENOMEM;
593 }
594 *((u16 *)&save_state->data[0]) = control;
595
596 disable_msi_mode(dev, pos, PCI_CAP_ID_MSIX);
597 save_state->cap_nr = PCI_CAP_ID_MSIX;
598 pci_add_saved_cap(dev, save_state);
599 return 0;
600}
601
602void pci_restore_msix_state(struct pci_dev *dev)
603{
604 u16 save;
605 int pos;
606 int vector, head, tail = 0;
607 void __iomem *base;
608 int j;
609 struct msg_address address;
610 struct msg_data data;
611 struct msi_desc *entry;
612 int temp;
613 struct pci_cap_saved_state *save_state;
614
615 save_state = pci_find_saved_cap(dev, PCI_CAP_ID_MSIX);
616 if (!save_state)
617 return;
618 save = *((u16 *)&save_state->data[0]);
619 pci_remove_saved_cap(save_state);
620 kfree(save_state);
621
622 pos = pci_find_capability(dev, PCI_CAP_ID_MSIX);
623 if (pos <= 0)
624 return;
625
626 /* route the table */
627 temp = dev->irq;
628 if (msi_lookup_vector(dev, PCI_CAP_ID_MSIX))
629 return;
630 vector = head = dev->irq;
631 while (head != tail) {
632 entry = msi_desc[vector];
633 base = entry->mask_base;
634 j = entry->msi_attrib.entry_nr;
635
636 msi_address_init(&address);
637 msi_data_init(&data, vector);
638
639 address.lo_address.value &= MSI_ADDRESS_DEST_ID_MASK;
640 address.lo_address.value |= entry->msi_attrib.current_cpu <<
641 MSI_TARGET_CPU_SHIFT;
642
643 writel(address.lo_address.value,
644 base + j * PCI_MSIX_ENTRY_SIZE +
645 PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET);
646 writel(address.hi_address,
647 base + j * PCI_MSIX_ENTRY_SIZE +
648 PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET);
649 writel(*(u32*)&data,
650 base + j * PCI_MSIX_ENTRY_SIZE +
651 PCI_MSIX_ENTRY_DATA_OFFSET);
652
653 tail = msi_desc[vector]->link.tail;
654 vector = tail;
655 }
656 dev->irq = temp;
657
658 pci_write_config_word(dev, msi_control_reg(pos), save);
659 enable_msi_mode(dev, pos, PCI_CAP_ID_MSIX);
660}
661#endif
662
663static void msi_register_init(struct pci_dev *dev, struct msi_desc *entry)
664{
665 struct msg_address address;
666 struct msg_data data;
667 int pos, vector = dev->irq;
668 u16 control;
669
670 pos = pci_find_capability(dev, PCI_CAP_ID_MSI);
671 pci_read_config_word(dev, msi_control_reg(pos), &control);
672 /* Configure MSI capability structure */
673 msi_address_init(&address);
674 msi_data_init(&data, vector);
675 entry->msi_attrib.current_cpu = ((address.lo_address.u.dest_id >>
676 MSI_TARGET_CPU_SHIFT) & MSI_TARGET_CPU_MASK);
677 pci_write_config_dword(dev, msi_lower_address_reg(pos),
678 address.lo_address.value);
679 if (is_64bit_address(control)) {
680 pci_write_config_dword(dev,
681 msi_upper_address_reg(pos), address.hi_address);
682 pci_write_config_word(dev,
683 msi_data_reg(pos, 1), *((u32*)&data));
684 } else
685 pci_write_config_word(dev,
686 msi_data_reg(pos, 0), *((u32*)&data));
687 if (entry->msi_attrib.maskbit) {
688 unsigned int maskbits, temp;
689 /* All MSIs are unmasked by default, Mask them all */
690 pci_read_config_dword(dev,
691 msi_mask_bits_reg(pos, is_64bit_address(control)),
692 &maskbits);
693 temp = (1 << multi_msi_capable(control));
694 temp = ((temp - 1) & ~temp);
695 maskbits |= temp;
696 pci_write_config_dword(dev,
697 msi_mask_bits_reg(pos, is_64bit_address(control)),
698 maskbits);
699 }
700}
701
507/** 702/**
508 * msi_capability_init - configure device's MSI capability structure 703 * msi_capability_init - configure device's MSI capability structure
509 * @dev: pointer to the pci_dev data structure of MSI device function 704 * @dev: pointer to the pci_dev data structure of MSI device function
@@ -516,8 +711,6 @@ void pci_scan_msi_device(struct pci_dev *dev)
516static int msi_capability_init(struct pci_dev *dev) 711static int msi_capability_init(struct pci_dev *dev)
517{ 712{
518 struct msi_desc *entry; 713 struct msi_desc *entry;
519 struct msg_address address;
520 struct msg_data data;
521 int pos, vector; 714 int pos, vector;
522 u16 control; 715 u16 control;
523 716
@@ -549,33 +742,8 @@ static int msi_capability_init(struct pci_dev *dev)
549 /* Replace with MSI handler */ 742 /* Replace with MSI handler */
550 irq_handler_init(PCI_CAP_ID_MSI, vector, entry->msi_attrib.maskbit); 743 irq_handler_init(PCI_CAP_ID_MSI, vector, entry->msi_attrib.maskbit);
551 /* Configure MSI capability structure */ 744 /* Configure MSI capability structure */
552 msi_address_init(&address); 745 msi_register_init(dev, entry);
553 msi_data_init(&data, vector); 746
554 entry->msi_attrib.current_cpu = ((address.lo_address.u.dest_id >>
555 MSI_TARGET_CPU_SHIFT) & MSI_TARGET_CPU_MASK);
556 pci_write_config_dword(dev, msi_lower_address_reg(pos),
557 address.lo_address.value);
558 if (is_64bit_address(control)) {
559 pci_write_config_dword(dev,
560 msi_upper_address_reg(pos), address.hi_address);
561 pci_write_config_word(dev,
562 msi_data_reg(pos, 1), *((u32*)&data));
563 } else
564 pci_write_config_word(dev,
565 msi_data_reg(pos, 0), *((u32*)&data));
566 if (entry->msi_attrib.maskbit) {
567 unsigned int maskbits, temp;
568 /* All MSIs are unmasked by default, Mask them all */
569 pci_read_config_dword(dev,
570 msi_mask_bits_reg(pos, is_64bit_address(control)),
571 &maskbits);
572 temp = (1 << multi_msi_capable(control));
573 temp = ((temp - 1) & ~temp);
574 maskbits |= temp;
575 pci_write_config_dword(dev,
576 msi_mask_bits_reg(pos, is_64bit_address(control)),
577 maskbits);
578 }
579 attach_msi_entry(entry, vector); 747 attach_msi_entry(entry, vector);
580 /* Set MSI enabled bits */ 748 /* Set MSI enabled bits */
581 enable_msi_mode(dev, pos, PCI_CAP_ID_MSI); 749 enable_msi_mode(dev, pos, PCI_CAP_ID_MSI);
@@ -625,8 +793,10 @@ static int msix_capability_init(struct pci_dev *dev,
625 if (!entry) 793 if (!entry)
626 break; 794 break;
627 vector = get_msi_vector(dev); 795 vector = get_msi_vector(dev);
628 if (vector < 0) 796 if (vector < 0) {
797 kmem_cache_free(msi_cachep, entry);
629 break; 798 break;
799 }
630 800
631 j = entries[i].entry; 801 j = entries[i].entry;
632 entries[i].vector = vector; 802 entries[i].vector = vector;
@@ -731,6 +901,7 @@ int pci_enable_msi(struct pci_dev* dev)
731 vector_irq[dev->irq] = -1; 901 vector_irq[dev->irq] = -1;
732 nr_released_vectors--; 902 nr_released_vectors--;
733 spin_unlock_irqrestore(&msi_lock, flags); 903 spin_unlock_irqrestore(&msi_lock, flags);
904 msi_register_init(dev, msi_desc[dev->irq]);
734 enable_msi_mode(dev, pos, PCI_CAP_ID_MSI); 905 enable_msi_mode(dev, pos, PCI_CAP_ID_MSI);
735 return 0; 906 return 0;
736 } 907 }
diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
index 6917c6cb0912..c2ecae5ff0c1 100644
--- a/drivers/pci/pci-acpi.c
+++ b/drivers/pci/pci-acpi.c
@@ -33,13 +33,10 @@ acpi_query_osc (
33 acpi_status status; 33 acpi_status status;
34 struct acpi_object_list input; 34 struct acpi_object_list input;
35 union acpi_object in_params[4]; 35 union acpi_object in_params[4];
36 struct acpi_buffer output; 36 struct acpi_buffer output = {ACPI_ALLOCATE_BUFFER, NULL};
37 union acpi_object out_obj; 37 union acpi_object *out_obj;
38 u32 osc_dw0; 38 u32 osc_dw0;
39 39
40 /* Setting up output buffer */
41 output.length = sizeof(out_obj) + 3*sizeof(u32);
42 output.pointer = &out_obj;
43 40
44 /* Setting up input parameters */ 41 /* Setting up input parameters */
45 input.count = 4; 42 input.count = 4;
@@ -61,12 +58,15 @@ acpi_query_osc (
61 "Evaluate _OSC Set fails. Status = 0x%04x\n", status); 58 "Evaluate _OSC Set fails. Status = 0x%04x\n", status);
62 return status; 59 return status;
63 } 60 }
64 if (out_obj.type != ACPI_TYPE_BUFFER) { 61 out_obj = output.pointer;
62
63 if (out_obj->type != ACPI_TYPE_BUFFER) {
65 printk(KERN_DEBUG 64 printk(KERN_DEBUG
66 "Evaluate _OSC returns wrong type\n"); 65 "Evaluate _OSC returns wrong type\n");
67 return AE_TYPE; 66 status = AE_TYPE;
67 goto query_osc_out;
68 } 68 }
69 osc_dw0 = *((u32 *) out_obj.buffer.pointer); 69 osc_dw0 = *((u32 *) out_obj->buffer.pointer);
70 if (osc_dw0) { 70 if (osc_dw0) {
71 if (osc_dw0 & OSC_REQUEST_ERROR) 71 if (osc_dw0 & OSC_REQUEST_ERROR)
72 printk(KERN_DEBUG "_OSC request fails\n"); 72 printk(KERN_DEBUG "_OSC request fails\n");
@@ -76,15 +76,21 @@ acpi_query_osc (
76 printk(KERN_DEBUG "_OSC invalid revision\n"); 76 printk(KERN_DEBUG "_OSC invalid revision\n");
77 if (osc_dw0 & OSC_CAPABILITIES_MASK_ERROR) { 77 if (osc_dw0 & OSC_CAPABILITIES_MASK_ERROR) {
78 /* Update Global Control Set */ 78 /* Update Global Control Set */
79 global_ctrlsets = *((u32 *)(out_obj.buffer.pointer+8)); 79 global_ctrlsets = *((u32 *)(out_obj->buffer.pointer+8));
80 return AE_OK; 80 status = AE_OK;
81 goto query_osc_out;
81 } 82 }
82 return AE_ERROR; 83 status = AE_ERROR;
84 goto query_osc_out;
83 } 85 }
84 86
85 /* Update Global Control Set */ 87 /* Update Global Control Set */
86 global_ctrlsets = *((u32 *)(out_obj.buffer.pointer + 8)); 88 global_ctrlsets = *((u32 *)(out_obj->buffer.pointer + 8));
87 return AE_OK; 89 status = AE_OK;
90
91query_osc_out:
92 kfree(output.pointer);
93 return status;
88} 94}
89 95
90 96
@@ -96,14 +102,10 @@ acpi_run_osc (
96 acpi_status status; 102 acpi_status status;
97 struct acpi_object_list input; 103 struct acpi_object_list input;
98 union acpi_object in_params[4]; 104 union acpi_object in_params[4];
99 struct acpi_buffer output; 105 struct acpi_buffer output = {ACPI_ALLOCATE_BUFFER, NULL};
100 union acpi_object out_obj; 106 union acpi_object *out_obj;
101 u32 osc_dw0; 107 u32 osc_dw0;
102 108
103 /* Setting up output buffer */
104 output.length = sizeof(out_obj) + 3*sizeof(u32);
105 output.pointer = &out_obj;
106
107 /* Setting up input parameters */ 109 /* Setting up input parameters */
108 input.count = 4; 110 input.count = 4;
109 input.pointer = in_params; 111 input.pointer = in_params;
@@ -124,12 +126,14 @@ acpi_run_osc (
124 "Evaluate _OSC Set fails. Status = 0x%04x\n", status); 126 "Evaluate _OSC Set fails. Status = 0x%04x\n", status);
125 return status; 127 return status;
126 } 128 }
127 if (out_obj.type != ACPI_TYPE_BUFFER) { 129 out_obj = output.pointer;
130 if (out_obj->type != ACPI_TYPE_BUFFER) {
128 printk(KERN_DEBUG 131 printk(KERN_DEBUG
129 "Evaluate _OSC returns wrong type\n"); 132 "Evaluate _OSC returns wrong type\n");
130 return AE_TYPE; 133 status = AE_TYPE;
134 goto run_osc_out;
131 } 135 }
132 osc_dw0 = *((u32 *) out_obj.buffer.pointer); 136 osc_dw0 = *((u32 *) out_obj->buffer.pointer);
133 if (osc_dw0) { 137 if (osc_dw0) {
134 if (osc_dw0 & OSC_REQUEST_ERROR) 138 if (osc_dw0 & OSC_REQUEST_ERROR)
135 printk(KERN_DEBUG "_OSC request fails\n"); 139 printk(KERN_DEBUG "_OSC request fails\n");
@@ -139,11 +143,17 @@ acpi_run_osc (
139 printk(KERN_DEBUG "_OSC invalid revision\n"); 143 printk(KERN_DEBUG "_OSC invalid revision\n");
140 if (osc_dw0 & OSC_CAPABILITIES_MASK_ERROR) { 144 if (osc_dw0 & OSC_CAPABILITIES_MASK_ERROR) {
141 printk(KERN_DEBUG "_OSC FW not grant req. control\n"); 145 printk(KERN_DEBUG "_OSC FW not grant req. control\n");
142 return AE_SUPPORT; 146 status = AE_SUPPORT;
147 goto run_osc_out;
143 } 148 }
144 return AE_ERROR; 149 status = AE_ERROR;
150 goto run_osc_out;
145 } 151 }
146 return AE_OK; 152 status = AE_OK;
153
154run_osc_out:
155 kfree(output.pointer);
156 return status;
147} 157}
148 158
149/** 159/**
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index f22f69ac6445..1456759936c5 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -271,10 +271,12 @@ static int pci_device_suspend(struct device * dev, pm_message_t state)
271 struct pci_driver * drv = pci_dev->driver; 271 struct pci_driver * drv = pci_dev->driver;
272 int i = 0; 272 int i = 0;
273 273
274 if (drv && drv->suspend) 274 if (drv && drv->suspend) {
275 i = drv->suspend(pci_dev, state); 275 i = drv->suspend(pci_dev, state);
276 else 276 suspend_report_result(drv->suspend, i);
277 } else {
277 pci_save_state(pci_dev); 278 pci_save_state(pci_dev);
279 }
278 return i; 280 return i;
279} 281}
280 282
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index bea1ad1ad5ba..2329f941a0dc 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -307,9 +307,11 @@ pci_set_power_state(struct pci_dev *dev, pci_power_t state)
307 * Can enter D0 from any state, but if we can only go deeper 307 * Can enter D0 from any state, but if we can only go deeper
308 * to sleep if we're already in a low power state 308 * to sleep if we're already in a low power state
309 */ 309 */
310 if (state != PCI_D0 && dev->current_state > state) 310 if (state != PCI_D0 && dev->current_state > state) {
311 printk(KERN_ERR "%s(): %s: state=%d, current state=%d\n",
312 __FUNCTION__, pci_name(dev), state, dev->current_state);
311 return -EINVAL; 313 return -EINVAL;
312 else if (dev->current_state == state) 314 } else if (dev->current_state == state)
313 return 0; /* we're already there */ 315 return 0; /* we're already there */
314 316
315 /* find PCI PM capability in list */ 317 /* find PCI PM capability in list */
@@ -444,6 +446,10 @@ pci_save_state(struct pci_dev *dev)
444 /* XXX: 100% dword access ok here? */ 446 /* XXX: 100% dword access ok here? */
445 for (i = 0; i < 16; i++) 447 for (i = 0; i < 16; i++)
446 pci_read_config_dword(dev, i * 4,&dev->saved_config_space[i]); 448 pci_read_config_dword(dev, i * 4,&dev->saved_config_space[i]);
449 if ((i = pci_save_msi_state(dev)) != 0)
450 return i;
451 if ((i = pci_save_msix_state(dev)) != 0)
452 return i;
447 return 0; 453 return 0;
448} 454}
449 455
@@ -458,6 +464,8 @@ pci_restore_state(struct pci_dev *dev)
458 464
459 for (i = 0; i < 16; i++) 465 for (i = 0; i < 16; i++)
460 pci_write_config_dword(dev,i * 4, dev->saved_config_space[i]); 466 pci_write_config_dword(dev,i * 4, dev->saved_config_space[i]);
467 pci_restore_msi_state(dev);
468 pci_restore_msix_state(dev);
461 return 0; 469 return 0;
462} 470}
463 471
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index 8f3fb47ea671..30630cbe2fe3 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -55,6 +55,17 @@ void pci_no_msi(void);
55static inline void disable_msi_mode(struct pci_dev *dev, int pos, int type) { } 55static inline void disable_msi_mode(struct pci_dev *dev, int pos, int type) { }
56static inline void pci_no_msi(void) { } 56static inline void pci_no_msi(void) { }
57#endif 57#endif
58#if defined(CONFIG_PCI_MSI) && defined(CONFIG_PM)
59int pci_save_msi_state(struct pci_dev *dev);
60int pci_save_msix_state(struct pci_dev *dev);
61void pci_restore_msi_state(struct pci_dev *dev);
62void pci_restore_msix_state(struct pci_dev *dev);
63#else
64static inline int pci_save_msi_state(struct pci_dev *dev) { return 0; }
65static inline int pci_save_msix_state(struct pci_dev *dev) { return 0; }
66static inline void pci_restore_msi_state(struct pci_dev *dev) {}
67static inline void pci_restore_msix_state(struct pci_dev *dev) {}
68#endif
58 69
59extern int pcie_mch_quirk; 70extern int pcie_mch_quirk;
60extern struct device_attribute pci_dev_attrs[]; 71extern struct device_attribute pci_dev_attrs[];
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 4970f47be72c..d378478612fb 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -592,7 +592,7 @@ static void __init quirk_amd_8131_ioapic(struct pci_dev *dev)
592 pci_write_config_byte( dev, AMD8131_MISC, tmp); 592 pci_write_config_byte( dev, AMD8131_MISC, tmp);
593 } 593 }
594} 594}
595DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8131_APIC, quirk_amd_8131_ioapic ); 595DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8131_BRIDGE, quirk_amd_8131_ioapic);
596 596
597static void __init quirk_svw_msi(struct pci_dev *dev) 597static void __init quirk_svw_msi(struct pci_dev *dev)
598{ 598{
@@ -634,6 +634,9 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_4, quirk_vi
634 * non-x86 architectures (yes Via exists on PPC among other places), 634 * non-x86 architectures (yes Via exists on PPC among other places),
635 * we must mask the PCI_INTERRUPT_LINE value versus 0xf to get 635 * we must mask the PCI_INTERRUPT_LINE value versus 0xf to get
636 * interrupts delivered properly. 636 * interrupts delivered properly.
637 *
638 * Some of the on-chip devices are actually '586 devices' so they are
639 * listed here.
637 */ 640 */
638static void quirk_via_irq(struct pci_dev *dev) 641static void quirk_via_irq(struct pci_dev *dev)
639{ 642{
@@ -642,13 +645,19 @@ static void quirk_via_irq(struct pci_dev *dev)
642 new_irq = dev->irq & 0xf; 645 new_irq = dev->irq & 0xf;
643 pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &irq); 646 pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &irq);
644 if (new_irq != irq) { 647 if (new_irq != irq) {
645 printk(KERN_INFO "PCI: Via IRQ fixup for %s, from %d to %d\n", 648 printk(KERN_INFO "PCI: VIA IRQ fixup for %s, from %d to %d\n",
646 pci_name(dev), irq, new_irq); 649 pci_name(dev), irq, new_irq);
647 udelay(15); /* unknown if delay really needed */ 650 udelay(15); /* unknown if delay really needed */
648 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, new_irq); 651 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, new_irq);
649 } 652 }
650} 653}
651DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_ANY_ID, quirk_via_irq); 654DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_0, quirk_via_irq);
655DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_1, quirk_via_irq);
656DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_2, quirk_via_irq);
657DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_3, quirk_via_irq);
658DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686, quirk_via_irq);
659DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_4, quirk_via_irq);
660DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_5, quirk_via_irq);
652 661
653/* 662/*
654 * VIA VT82C598 has its device ID settable and many BIOSes 663 * VIA VT82C598 has its device ID settable and many BIOSes
@@ -865,6 +874,36 @@ static void __init quirk_eisa_bridge(struct pci_dev *dev)
865DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82375, quirk_eisa_bridge ); 874DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82375, quirk_eisa_bridge );
866 875
867/* 876/*
877 * On the MSI-K8T-Neo2Fir Board, the internal Soundcard is disabled
878 * when a PCI-Soundcard is added. The BIOS only gives Options
879 * "Disabled" and "AUTO". This Quirk Sets the corresponding
880 * Register-Value to enable the Soundcard.
881 */
882static void __init k8t_sound_hostbridge(struct pci_dev *dev)
883{
884 unsigned char val;
885
886 printk(KERN_INFO "PCI: Quirk-MSI-K8T Soundcard On\n");
887 pci_read_config_byte(dev, 0x50, &val);
888 if (val == 0x88 || val == 0xc8) {
889 pci_write_config_byte(dev, 0x50, val & (~0x40));
890
891 /* Verify the Change for Status output */
892 pci_read_config_byte(dev, 0x50, &val);
893 if (val & 0x40)
894 printk(KERN_INFO "PCI: MSI-K8T soundcard still off\n");
895 else
896 printk(KERN_INFO "PCI: MSI-K8T soundcard on\n");
897 } else {
898 printk(KERN_INFO "PCI: Unexpected Value in PCI-Register: "
899 "no Change!\n");
900 }
901
902}
903DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237, k8t_sound_hostbridge);
904
905#ifndef CONFIG_ACPI_SLEEP
906/*
868 * On ASUS P4B boards, the SMBus PCI Device within the ICH2/4 southbridge 907 * On ASUS P4B boards, the SMBus PCI Device within the ICH2/4 southbridge
869 * is not activated. The myth is that Asus said that they do not want the 908 * is not activated. The myth is that Asus said that they do not want the
870 * users to be irritated by just another PCI Device in the Win98 device 909 * users to be irritated by just another PCI Device in the Win98 device
@@ -875,8 +914,12 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82375, quirk_e
875 * bridge. Unfortunately, this device has no subvendor/subdevice ID. So it 914 * bridge. Unfortunately, this device has no subvendor/subdevice ID. So it
876 * becomes necessary to do this tweak in two steps -- I've chosen the Host 915 * becomes necessary to do this tweak in two steps -- I've chosen the Host
877 * bridge as trigger. 916 * bridge as trigger.
917 *
918 * Actually, leaving it unhidden and not redoing the quirk over suspend2ram
919 * will cause thermal management to break down, and causing machine to
920 * overheat.
878 */ 921 */
879static int __initdata asus_hides_smbus = 0; 922static int __initdata asus_hides_smbus;
880 923
881static void __init asus_hides_smbus_hostbridge(struct pci_dev *dev) 924static void __init asus_hides_smbus_hostbridge(struct pci_dev *dev)
882{ 925{
@@ -921,6 +964,7 @@ static void __init asus_hides_smbus_hostbridge(struct pci_dev *dev)
921 if (dev->device == PCI_DEVICE_ID_INTEL_82915GM_HB) { 964 if (dev->device == PCI_DEVICE_ID_INTEL_82915GM_HB) {
922 switch (dev->subsystem_device) { 965 switch (dev->subsystem_device) {
923 case 0x1882: /* M6V notebook */ 966 case 0x1882: /* M6V notebook */
967 case 0x1977: /* A6VA notebook */
924 asus_hides_smbus = 1; 968 asus_hides_smbus = 1;
925 } 969 }
926 } 970 }
@@ -999,6 +1043,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_0, asu
999DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_12, asus_hides_smbus_lpc ); 1043DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_12, asus_hides_smbus_lpc );
1000DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_12, asus_hides_smbus_lpc ); 1044DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_12, asus_hides_smbus_lpc );
1001DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_0, asus_hides_smbus_lpc ); 1045DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_0, asus_hides_smbus_lpc );
1046DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_1, asus_hides_smbus_lpc );
1002 1047
1003static void __init asus_hides_smbus_lpc_ich6(struct pci_dev *dev) 1048static void __init asus_hides_smbus_lpc_ich6(struct pci_dev *dev)
1004{ 1049{
@@ -1017,6 +1062,8 @@ static void __init asus_hides_smbus_lpc_ich6(struct pci_dev *dev)
1017} 1062}
1018DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_1, asus_hides_smbus_lpc_ich6 ); 1063DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_1, asus_hides_smbus_lpc_ich6 );
1019 1064
1065#endif
1066
1020/* 1067/*
1021 * SiS 96x south bridge: BIOS typically hides SMBus device... 1068 * SiS 96x south bridge: BIOS typically hides SMBus device...
1022 */ 1069 */
diff --git a/drivers/pcmcia/Kconfig b/drivers/pcmcia/Kconfig
index cba6c9eef28e..61cb4b29f55c 100644
--- a/drivers/pcmcia/Kconfig
+++ b/drivers/pcmcia/Kconfig
@@ -250,7 +250,7 @@ config M32R_CFC_NUM
250 250
251config PCMCIA_VRC4171 251config PCMCIA_VRC4171
252 tristate "NEC VRC4171 Card Controllers support" 252 tristate "NEC VRC4171 Card Controllers support"
253 depends on VRC4171 && PCMCIA 253 depends on CPU_VR41XX && ISA && PCMCIA
254 254
255config PCMCIA_VRC4173 255config PCMCIA_VRC4173
256 tristate "NEC VRC4173 CARDU support" 256 tristate "NEC VRC4173 CARDU support"
diff --git a/drivers/pcmcia/at91_cf.c b/drivers/pcmcia/at91_cf.c
index 67cc5f7d0c90..a4d50940ebeb 100644
--- a/drivers/pcmcia/at91_cf.c
+++ b/drivers/pcmcia/at91_cf.c
@@ -28,8 +28,6 @@
28#include <asm/arch/gpio.h> 28#include <asm/arch/gpio.h>
29 29
30 30
31#define CF_SIZE 0x30000000 /* CS5+CS6: unavailable */
32
33/* 31/*
34 * A0..A10 work in each range; A23 indicates I/O space; A25 is CFRNW; 32 * A0..A10 work in each range; A23 indicates I/O space; A25 is CFRNW;
35 * some other bit in {A24,A22..A11} is nREG to flag memory access 33 * some other bit in {A24,A22..A11} is nREG to flag memory access
@@ -76,7 +74,8 @@ static irqreturn_t at91_cf_irq(int irq, void *_cf, struct pt_regs *r)
76 /* kick pccard as needed */ 74 /* kick pccard as needed */
77 if (present != cf->present) { 75 if (present != cf->present) {
78 cf->present = present; 76 cf->present = present;
79 pr_debug("%s: card %s\n", driver_name, present ? "present" : "gone"); 77 pr_debug("%s: card %s\n", driver_name,
78 present ? "present" : "gone");
80 pcmcia_parse_events(&cf->socket, SS_DETECT); 79 pcmcia_parse_events(&cf->socket, SS_DETECT);
81 } 80 }
82 } 81 }
@@ -93,7 +92,7 @@ static int at91_cf_get_status(struct pcmcia_socket *s, u_int *sp)
93 92
94 cf = container_of(s, struct at91_cf_socket, socket); 93 cf = container_of(s, struct at91_cf_socket, socket);
95 94
96 /* NOTE: we assume 3VCARD, not XVCARD... */ 95 /* NOTE: CF is always 3VCARD */
97 if (at91_cf_present(cf)) { 96 if (at91_cf_present(cf)) {
98 int rdy = cf->board->irq_pin; /* RDY/nIRQ */ 97 int rdy = cf->board->irq_pin; /* RDY/nIRQ */
99 int vcc = cf->board->vcc_pin; 98 int vcc = cf->board->vcc_pin;
@@ -109,7 +108,8 @@ static int at91_cf_get_status(struct pcmcia_socket *s, u_int *sp)
109 return 0; 108 return 0;
110} 109}
111 110
112static int at91_cf_set_socket(struct pcmcia_socket *sock, struct socket_state_t *s) 111static int
112at91_cf_set_socket(struct pcmcia_socket *sock, struct socket_state_t *s)
113{ 113{
114 struct at91_cf_socket *cf; 114 struct at91_cf_socket *cf;
115 115
@@ -184,7 +184,8 @@ static int at91_cf_set_io_map(struct pcmcia_socket *s, struct pccard_io_map *io)
184} 184}
185 185
186/* pcmcia layer maps/unmaps mem regions */ 186/* pcmcia layer maps/unmaps mem regions */
187static int at91_cf_set_mem_map(struct pcmcia_socket *s, struct pccard_mem_map *map) 187static int
188at91_cf_set_mem_map(struct pcmcia_socket *s, struct pccard_mem_map *map)
188{ 189{
189 struct at91_cf_socket *cf; 190 struct at91_cf_socket *cf;
190 191
@@ -218,12 +219,17 @@ static int __init at91_cf_probe(struct device *dev)
218 struct at91_cf_socket *cf; 219 struct at91_cf_socket *cf;
219 struct at91_cf_data *board = dev->platform_data; 220 struct at91_cf_data *board = dev->platform_data;
220 struct platform_device *pdev = to_platform_device(dev); 221 struct platform_device *pdev = to_platform_device(dev);
222 struct resource *io;
221 unsigned int csa; 223 unsigned int csa;
222 int status; 224 int status;
223 225
224 if (!board || !board->det_pin || !board->rst_pin) 226 if (!board || !board->det_pin || !board->rst_pin)
225 return -ENODEV; 227 return -ENODEV;
226 228
229 io = platform_get_resource(pdev, IORESOURCE_MEM, 0);
230 if (!io)
231 return -ENODEV;
232
227 cf = kcalloc(1, sizeof *cf, GFP_KERNEL); 233 cf = kcalloc(1, sizeof *cf, GFP_KERNEL);
228 if (!cf) 234 if (!cf)
229 return -ENOMEM; 235 return -ENOMEM;
@@ -250,10 +256,14 @@ static int __init at91_cf_probe(struct device *dev)
250 * REVISIT: these timings are in terms of MCK cycles, so 256 * REVISIT: these timings are in terms of MCK cycles, so
251 * when MCK changes (cpufreq etc) so must these values... 257 * when MCK changes (cpufreq etc) so must these values...
252 */ 258 */
253 at91_sys_write(AT91_SMC_CSR(4), AT91_SMC_ACSS_STD | AT91_SMC_DBW_16 | AT91_SMC_BAT | AT91_SMC_WSEN 259 at91_sys_write(AT91_SMC_CSR(4),
254 | AT91_SMC_NWS_(32) /* wait states */ 260 AT91_SMC_ACSS_STD
255 | AT91_SMC_RWSETUP_(6) /* setup time */ 261 | AT91_SMC_DBW_16
256 | AT91_SMC_RWHOLD_(4) /* hold time */ 262 | AT91_SMC_BAT
263 | AT91_SMC_WSEN
264 | AT91_SMC_NWS_(32) /* wait states */
265 | AT91_SMC_RWSETUP_(6) /* setup time */
266 | AT91_SMC_RWHOLD_(4) /* hold time */
257 ); 267 );
258 268
259 /* must be a GPIO; ergo must trigger on both edges */ 269 /* must be a GPIO; ergo must trigger on both edges */
@@ -274,8 +284,7 @@ static int __init at91_cf_probe(struct device *dev)
274 if (status < 0) 284 if (status < 0)
275 goto fail0a; 285 goto fail0a;
276 cf->socket.pci_irq = board->irq_pin; 286 cf->socket.pci_irq = board->irq_pin;
277 } 287 } else
278 else
279 cf->socket.pci_irq = NR_IRQS + 1; 288 cf->socket.pci_irq = NR_IRQS + 1;
280 289
281 /* pcmcia layer only remaps "real" memory not iospace */ 290 /* pcmcia layer only remaps "real" memory not iospace */
@@ -284,7 +293,8 @@ static int __init at91_cf_probe(struct device *dev)
284 goto fail1; 293 goto fail1;
285 294
286 /* reserve CS4, CS5, and CS6 regions; but use just CS4 */ 295 /* reserve CS4, CS5, and CS6 regions; but use just CS4 */
287 if (!request_mem_region(AT91_CF_BASE, CF_SIZE, driver_name)) 296 if (!request_mem_region(io->start, io->end + 1 - io->start,
297 driver_name))
288 goto fail1; 298 goto fail1;
289 299
290 pr_info("%s: irqs det #%d, io #%d\n", driver_name, 300 pr_info("%s: irqs det #%d, io #%d\n", driver_name,
@@ -297,7 +307,7 @@ static int __init at91_cf_probe(struct device *dev)
297 cf->socket.features = SS_CAP_PCCARD | SS_CAP_STATIC_MAP 307 cf->socket.features = SS_CAP_PCCARD | SS_CAP_STATIC_MAP
298 | SS_CAP_MEM_ALIGN; 308 | SS_CAP_MEM_ALIGN;
299 cf->socket.map_size = SZ_2K; 309 cf->socket.map_size = SZ_2K;
300 cf->socket.io[0].NumPorts = SZ_2K; 310 cf->socket.io[0].res = io;
301 311
302 status = pcmcia_register_socket(&cf->socket); 312 status = pcmcia_register_socket(&cf->socket);
303 if (status < 0) 313 if (status < 0)
@@ -307,7 +317,7 @@ static int __init at91_cf_probe(struct device *dev)
307 317
308fail2: 318fail2:
309 iounmap((void __iomem *) cf->socket.io_offset); 319 iounmap((void __iomem *) cf->socket.io_offset);
310 release_mem_region(AT91_CF_BASE, CF_SIZE); 320 release_mem_region(io->start, io->end + 1 - io->start);
311fail1: 321fail1:
312 if (board->irq_pin) 322 if (board->irq_pin)
313 free_irq(board->irq_pin, cf); 323 free_irq(board->irq_pin, cf);
@@ -321,14 +331,15 @@ fail0:
321 331
322static int __exit at91_cf_remove(struct device *dev) 332static int __exit at91_cf_remove(struct device *dev)
323{ 333{
324 struct at91_cf_socket *cf = dev_get_drvdata(dev); 334 struct at91_cf_socket *cf = dev_get_drvdata(dev);
325 unsigned int csa; 335 struct resource *io = cf->socket.io[0].res;
336 unsigned int csa;
326 337
327 pcmcia_unregister_socket(&cf->socket); 338 pcmcia_unregister_socket(&cf->socket);
328 free_irq(cf->board->irq_pin, cf); 339 free_irq(cf->board->irq_pin, cf);
329 free_irq(cf->board->det_pin, cf); 340 free_irq(cf->board->det_pin, cf);
330 iounmap((void __iomem *) cf->socket.io_offset); 341 iounmap((void __iomem *) cf->socket.io_offset);
331 release_mem_region(AT91_CF_BASE, CF_SIZE); 342 release_mem_region(io->start, io->end + 1 - io->start);
332 343
333 csa = at91_sys_read(AT91_EBI_CSA); 344 csa = at91_sys_read(AT91_EBI_CSA);
334 at91_sys_write(AT91_EBI_CSA, csa & ~AT91_EBI_CS4A); 345 at91_sys_write(AT91_EBI_CSA, csa & ~AT91_EBI_CS4A);
@@ -342,8 +353,8 @@ static struct device_driver at91_cf_driver = {
342 .bus = &platform_bus_type, 353 .bus = &platform_bus_type,
343 .probe = at91_cf_probe, 354 .probe = at91_cf_probe,
344 .remove = __exit_p(at91_cf_remove), 355 .remove = __exit_p(at91_cf_remove),
345 .suspend = pcmcia_socket_dev_suspend, 356 .suspend = pcmcia_socket_dev_suspend,
346 .resume = pcmcia_socket_dev_resume, 357 .resume = pcmcia_socket_dev_resume,
347}; 358};
348 359
349/*--------------------------------------------------------------------------*/ 360/*--------------------------------------------------------------------------*/
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index ae10d1eed65e..74b3124e8247 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -236,11 +236,11 @@ static void pcmcia_check_driver(struct pcmcia_driver *p_drv)
236/** 236/**
237 * pcmcia_load_firmware - load CIS from userspace if device-provided is broken 237 * pcmcia_load_firmware - load CIS from userspace if device-provided is broken
238 * @dev - the pcmcia device which needs a CIS override 238 * @dev - the pcmcia device which needs a CIS override
239 * @filename - requested filename in /lib/firmware/cis/ 239 * @filename - requested filename in /lib/firmware/
240 * 240 *
241 * This uses the in-kernel firmware loading mechanism to use a "fake CIS" if 241 * This uses the in-kernel firmware loading mechanism to use a "fake CIS" if
242 * the one provided by the card is broken. The firmware files reside in 242 * the one provided by the card is broken. The firmware files reside in
243 * /lib/firmware/cis/ in userspace. 243 * /lib/firmware/ in userspace.
244 */ 244 */
245static int pcmcia_load_firmware(struct pcmcia_device *dev, char * filename) 245static int pcmcia_load_firmware(struct pcmcia_device *dev, char * filename)
246{ 246{
@@ -298,9 +298,6 @@ static inline int pcmcia_load_firmware(struct pcmcia_device *dev, char * filenam
298 * 298 *
299 * Registers a PCMCIA driver with the PCMCIA bus core. 299 * Registers a PCMCIA driver with the PCMCIA bus core.
300 */ 300 */
301static int pcmcia_device_probe(struct device *dev);
302static int pcmcia_device_remove(struct device * dev);
303
304int pcmcia_register_driver(struct pcmcia_driver *driver) 301int pcmcia_register_driver(struct pcmcia_driver *driver)
305{ 302{
306 if (!driver) 303 if (!driver)
@@ -400,7 +397,7 @@ static int pcmcia_device_probe(struct device * dev)
400 * call which will then check whether there are two 397 * call which will then check whether there are two
401 * pseudo devices, and if not, add the second one. 398 * pseudo devices, and if not, add the second one.
402 */ 399 */
403 did = (struct pcmcia_device_id *) p_dev->dev.driver_data; 400 did = p_dev->dev.driver_data;
404 if (did && (did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) && 401 if (did && (did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) &&
405 (p_dev->socket->device_count == 1) && (p_dev->device_no == 0)) 402 (p_dev->socket->device_count == 1) && (p_dev->device_no == 0))
406 pcmcia_add_pseudo_device(p_dev->socket); 403 pcmcia_add_pseudo_device(p_dev->socket);
@@ -448,7 +445,6 @@ static void pcmcia_card_remove(struct pcmcia_socket *s, struct pcmcia_device *le
448 return; 445 return;
449} 446}
450 447
451
452static int pcmcia_device_remove(struct device * dev) 448static int pcmcia_device_remove(struct device * dev)
453{ 449{
454 struct pcmcia_device *p_dev; 450 struct pcmcia_device *p_dev;
@@ -463,7 +459,7 @@ static int pcmcia_device_remove(struct device * dev)
463 * pseudo multi-function card, we need to unbind 459 * pseudo multi-function card, we need to unbind
464 * all devices 460 * all devices
465 */ 461 */
466 did = (struct pcmcia_device_id *) p_dev->dev.driver_data; 462 did = p_dev->dev.driver_data;
467 if (did && (did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) && 463 if (did && (did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) &&
468 (p_dev->socket->device_count != 0) && 464 (p_dev->socket->device_count != 0) &&
469 (p_dev->device_no == 0)) 465 (p_dev->device_no == 0))
@@ -476,6 +472,8 @@ static int pcmcia_device_remove(struct device * dev)
476 if (p_drv->remove) 472 if (p_drv->remove)
477 p_drv->remove(p_dev); 473 p_drv->remove(p_dev);
478 474
475 p_dev->dev_node = NULL;
476
479 /* check for proper unloading */ 477 /* check for proper unloading */
480 if (p_dev->_irq || p_dev->_io || p_dev->_locked) 478 if (p_dev->_irq || p_dev->_io || p_dev->_locked)
481 printk(KERN_INFO "pcmcia: driver %s did not release config properly\n", 479 printk(KERN_INFO "pcmcia: driver %s did not release config properly\n",
@@ -628,7 +626,7 @@ struct pcmcia_device * pcmcia_device_add(struct pcmcia_socket *s, unsigned int f
628 } 626 }
629 627
630 /* Add to the list in pcmcia_bus_socket */ 628 /* Add to the list in pcmcia_bus_socket */
631 list_add_tail(&p_dev->socket_device_list, &s->devices_list); 629 list_add(&p_dev->socket_device_list, &s->devices_list);
632 630
633 spin_unlock_irqrestore(&pcmcia_dev_list_lock, flags); 631 spin_unlock_irqrestore(&pcmcia_dev_list_lock, flags);
634 632
@@ -1145,6 +1143,12 @@ static int ds_event(struct pcmcia_socket *skt, event_t event, int priority)
1145{ 1143{
1146 struct pcmcia_socket *s = pcmcia_get_socket(skt); 1144 struct pcmcia_socket *s = pcmcia_get_socket(skt);
1147 1145
1146 if (!s) {
1147 printk(KERN_ERR "PCMCIA obtaining reference to socket %p " \
1148 "failed, event 0x%x lost!\n", skt, event);
1149 return -ENODEV;
1150 }
1151
1148 ds_dbg(1, "ds_event(0x%06x, %d, 0x%p)\n", 1152 ds_dbg(1, "ds_event(0x%06x, %d, 0x%p)\n",
1149 event, priority, skt); 1153 event, priority, skt);
1150 1154
diff --git a/drivers/pcmcia/i82365.c b/drivers/pcmcia/i82365.c
index bd0308e89815..a2f05f485156 100644
--- a/drivers/pcmcia/i82365.c
+++ b/drivers/pcmcia/i82365.c
@@ -509,7 +509,8 @@ static irqreturn_t i365_count_irq(int irq, void *dev, struct pt_regs *regs)
509static u_int __init test_irq(u_short sock, int irq) 509static u_int __init test_irq(u_short sock, int irq)
510{ 510{
511 debug(2, " testing ISA irq %d\n", irq); 511 debug(2, " testing ISA irq %d\n", irq);
512 if (request_irq(irq, i365_count_irq, 0, "scan", i365_count_irq) != 0) 512 if (request_irq(irq, i365_count_irq, SA_PROBEIRQ, "scan",
513 i365_count_irq) != 0)
513 return 1; 514 return 1;
514 irq_hits = 0; irq_sock = sock; 515 irq_hits = 0; irq_sock = sock;
515 msleep(10); 516 msleep(10);
@@ -561,7 +562,7 @@ static u_int __init isa_scan(u_short sock, u_int mask0)
561 } else { 562 } else {
562 /* Fallback: just find interrupts that aren't in use */ 563 /* Fallback: just find interrupts that aren't in use */
563 for (i = 0; i < 16; i++) 564 for (i = 0; i < 16; i++)
564 if ((mask0 & (1 << i)) && (_check_irq(i, 0) == 0)) 565 if ((mask0 & (1 << i)) && (_check_irq(i, SA_PROBEIRQ) == 0))
565 mask1 |= (1 << i); 566 mask1 |= (1 << i);
566 printk("default"); 567 printk("default");
567 /* If scan failed, default to polled status */ 568 /* If scan failed, default to polled status */
@@ -725,7 +726,7 @@ static void __init add_pcic(int ns, int type)
725 u_int cs_mask = mask & ((cs_irq) ? (1<<cs_irq) : ~(1<<12)); 726 u_int cs_mask = mask & ((cs_irq) ? (1<<cs_irq) : ~(1<<12));
726 for (cs_irq = 15; cs_irq > 0; cs_irq--) 727 for (cs_irq = 15; cs_irq > 0; cs_irq--)
727 if ((cs_mask & (1 << cs_irq)) && 728 if ((cs_mask & (1 << cs_irq)) &&
728 (_check_irq(cs_irq, 0) == 0)) 729 (_check_irq(cs_irq, SA_PROBEIRQ) == 0))
729 break; 730 break;
730 if (cs_irq) { 731 if (cs_irq) {
731 grab_irq = 1; 732 grab_irq = 1;
diff --git a/drivers/pcmcia/pcmcia_ioctl.c b/drivers/pcmcia/pcmcia_ioctl.c
index c53db7ceda5e..738b1ef595a3 100644
--- a/drivers/pcmcia/pcmcia_ioctl.c
+++ b/drivers/pcmcia/pcmcia_ioctl.c
@@ -426,7 +426,7 @@ static int ds_open(struct inode *inode, struct file *file)
426 426
427 if (!warning_printed) { 427 if (!warning_printed) {
428 printk(KERN_INFO "pcmcia: Detected deprecated PCMCIA ioctl " 428 printk(KERN_INFO "pcmcia: Detected deprecated PCMCIA ioctl "
429 "usage.\n"); 429 "usage from process: %s.\n", current->comm);
430 printk(KERN_INFO "pcmcia: This interface will soon be removed from " 430 printk(KERN_INFO "pcmcia: This interface will soon be removed from "
431 "the kernel; please expect breakage unless you upgrade " 431 "the kernel; please expect breakage unless you upgrade "
432 "to new tools.\n"); 432 "to new tools.\n");
@@ -601,8 +601,12 @@ static int ds_ioctl(struct inode * inode, struct file * file,
601 ret = CS_BAD_ARGS; 601 ret = CS_BAD_ARGS;
602 else { 602 else {
603 struct pcmcia_device *p_dev = get_pcmcia_device(s, buf->config.Function); 603 struct pcmcia_device *p_dev = get_pcmcia_device(s, buf->config.Function);
604 ret = pccard_get_configuration_info(s, p_dev, &buf->config); 604 if (p_dev == NULL)
605 pcmcia_put_dev(p_dev); 605 ret = CS_BAD_ARGS;
606 else {
607 ret = pccard_get_configuration_info(s, p_dev, &buf->config);
608 pcmcia_put_dev(p_dev);
609 }
606 } 610 }
607 break; 611 break;
608 case DS_GET_FIRST_TUPLE: 612 case DS_GET_FIRST_TUPLE:
@@ -632,8 +636,12 @@ static int ds_ioctl(struct inode * inode, struct file * file,
632 ret = CS_BAD_ARGS; 636 ret = CS_BAD_ARGS;
633 else { 637 else {
634 struct pcmcia_device *p_dev = get_pcmcia_device(s, buf->status.Function); 638 struct pcmcia_device *p_dev = get_pcmcia_device(s, buf->status.Function);
635 ret = pccard_get_status(s, p_dev, &buf->status); 639 if (p_dev == NULL)
636 pcmcia_put_dev(p_dev); 640 ret = CS_BAD_ARGS;
641 else {
642 ret = pccard_get_status(s, p_dev, &buf->status);
643 pcmcia_put_dev(p_dev);
644 }
637 } 645 }
638 break; 646 break;
639 case DS_VALIDATE_CIS: 647 case DS_VALIDATE_CIS:
@@ -665,9 +673,10 @@ static int ds_ioctl(struct inode * inode, struct file * file,
665 if (!(buf->conf_reg.Function && 673 if (!(buf->conf_reg.Function &&
666 (buf->conf_reg.Function >= s->functions))) { 674 (buf->conf_reg.Function >= s->functions))) {
667 struct pcmcia_device *p_dev = get_pcmcia_device(s, buf->conf_reg.Function); 675 struct pcmcia_device *p_dev = get_pcmcia_device(s, buf->conf_reg.Function);
668 if (p_dev) 676 if (p_dev) {
669 ret = pcmcia_access_configuration_register(p_dev, &buf->conf_reg); 677 ret = pcmcia_access_configuration_register(p_dev, &buf->conf_reg);
670 pcmcia_put_dev(p_dev); 678 pcmcia_put_dev(p_dev);
679 }
671 } 680 }
672 break; 681 break;
673 case DS_GET_FIRST_REGION: 682 case DS_GET_FIRST_REGION:
diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c
index 45063b4e5b78..3131bb0a0095 100644
--- a/drivers/pcmcia/pcmcia_resource.c
+++ b/drivers/pcmcia/pcmcia_resource.c
@@ -88,7 +88,6 @@ static int alloc_io_space(struct pcmcia_socket *s, u_int attr, ioaddr_t *base,
88 } 88 }
89 if ((s->features & SS_CAP_STATIC_MAP) && s->io_offset) { 89 if ((s->features & SS_CAP_STATIC_MAP) && s->io_offset) {
90 *base = s->io_offset | (*base & 0x0fff); 90 *base = s->io_offset | (*base & 0x0fff);
91 s->io[0].res->flags = (s->io[0].res->flags & ~IORESOURCE_BITS) | (attr & IORESOURCE_BITS);
92 return 0; 91 return 0;
93 } 92 }
94 /* Check for an already-allocated window that must conflict with 93 /* Check for an already-allocated window that must conflict with
@@ -209,7 +208,6 @@ int pccard_get_configuration_info(struct pcmcia_socket *s,
209 if (!(s->state & SOCKET_PRESENT)) 208 if (!(s->state & SOCKET_PRESENT))
210 return CS_NO_CARD; 209 return CS_NO_CARD;
211 210
212 config->Function = p_dev->func;
213 211
214#ifdef CONFIG_CARDBUS 212#ifdef CONFIG_CARDBUS
215 if (s->state & SOCKET_CARDBUS) { 213 if (s->state & SOCKET_CARDBUS) {
@@ -223,14 +221,22 @@ int pccard_get_configuration_info(struct pcmcia_socket *s,
223 config->AssignedIRQ = s->irq.AssignedIRQ; 221 config->AssignedIRQ = s->irq.AssignedIRQ;
224 if (config->AssignedIRQ) 222 if (config->AssignedIRQ)
225 config->Attributes |= CONF_ENABLE_IRQ; 223 config->Attributes |= CONF_ENABLE_IRQ;
226 config->BasePort1 = s->io[0].res->start; 224 if (s->io[0].res) {
227 config->NumPorts1 = s->io[0].res->end - config->BasePort1 + 1; 225 config->BasePort1 = s->io[0].res->start;
226 config->NumPorts1 = s->io[0].res->end - config->BasePort1 + 1;
227 }
228 } 228 }
229 return CS_SUCCESS; 229 return CS_SUCCESS;
230 } 230 }
231#endif 231#endif
232 232
233 c = (p_dev) ? p_dev->function_config : NULL; 233 if (p_dev) {
234 c = p_dev->function_config;
235 config->Function = p_dev->func;
236 } else {
237 c = NULL;
238 config->Function = 0;
239 }
234 240
235 if ((c == NULL) || !(c->state & CONFIG_LOCKED)) { 241 if ((c == NULL) || !(c->state & CONFIG_LOCKED)) {
236 config->Attributes = 0; 242 config->Attributes = 0;
@@ -947,7 +953,5 @@ void pcmcia_disable_device(struct pcmcia_device *p_dev) {
947 pcmcia_release_irq(p_dev, &p_dev->irq); 953 pcmcia_release_irq(p_dev, &p_dev->irq);
948 if (&p_dev->win) 954 if (&p_dev->win)
949 pcmcia_release_window(p_dev->win); 955 pcmcia_release_window(p_dev->win);
950
951 p_dev->dev_node = NULL;
952} 956}
953EXPORT_SYMBOL(pcmcia_disable_device); 957EXPORT_SYMBOL(pcmcia_disable_device);
diff --git a/drivers/pcmcia/pd6729.c b/drivers/pcmcia/pd6729.c
index 16d1ea7b0a18..247ab837f841 100644
--- a/drivers/pcmcia/pd6729.c
+++ b/drivers/pcmcia/pd6729.c
@@ -589,7 +589,7 @@ static int pd6729_check_irq(int irq, int flags)
589 return 0; 589 return 0;
590} 590}
591 591
592static u_int __init pd6729_isa_scan(void) 592static u_int __devinit pd6729_isa_scan(void)
593{ 593{
594 u_int mask0, mask = 0; 594 u_int mask0, mask = 0;
595 int i; 595 int i;
diff --git a/drivers/pcmcia/pxa2xx_sharpsl.c b/drivers/pcmcia/pxa2xx_sharpsl.c
index fd3647368955..b7b9e149c5b9 100644
--- a/drivers/pcmcia/pxa2xx_sharpsl.c
+++ b/drivers/pcmcia/pxa2xx_sharpsl.c
@@ -26,14 +26,6 @@
26#include "soc_common.h" 26#include "soc_common.h"
27 27
28#define NO_KEEP_VS 0x0001 28#define NO_KEEP_VS 0x0001
29
30/* PCMCIA to Scoop linkage
31
32 There is no easy way to link multiple scoop devices into one
33 single entity for the pxa2xx_pcmcia device so this structure
34 is used which is setup by the platform code
35*/
36struct scoop_pcmcia_config *platform_scoop_config;
37#define SCOOP_DEV platform_scoop_config->devs 29#define SCOOP_DEV platform_scoop_config->devs
38 30
39static void sharpsl_pcmcia_init_reset(struct soc_pcmcia_socket *skt) 31static void sharpsl_pcmcia_init_reset(struct soc_pcmcia_socket *skt)
diff --git a/drivers/pnp/manager.c b/drivers/pnp/manager.c
index c4256aa32bcb..6fff109bdab6 100644
--- a/drivers/pnp/manager.c
+++ b/drivers/pnp/manager.c
@@ -479,7 +479,7 @@ int pnp_auto_config_dev(struct pnp_dev *dev)
479int pnp_start_dev(struct pnp_dev *dev) 479int pnp_start_dev(struct pnp_dev *dev)
480{ 480{
481 if (!pnp_can_write(dev)) { 481 if (!pnp_can_write(dev)) {
482 pnp_info("Device %s does not supported activation.", dev->dev.bus_id); 482 pnp_info("Device %s does not support activation.", dev->dev.bus_id);
483 return -EINVAL; 483 return -EINVAL;
484 } 484 }
485 485
@@ -503,7 +503,7 @@ int pnp_start_dev(struct pnp_dev *dev)
503int pnp_stop_dev(struct pnp_dev *dev) 503int pnp_stop_dev(struct pnp_dev *dev)
504{ 504{
505 if (!pnp_can_disable(dev)) { 505 if (!pnp_can_disable(dev)) {
506 pnp_info("Device %s does not supported disabling.", dev->dev.bus_id); 506 pnp_info("Device %s does not support disabling.", dev->dev.bus_id);
507 return -EINVAL; 507 return -EINVAL;
508 } 508 }
509 if (dev->protocol->disable(dev)<0) { 509 if (dev->protocol->disable(dev)<0) {
diff --git a/drivers/rtc/rtc-dev.c b/drivers/rtc/rtc-dev.c
index b1e3e6179e56..2011567005f9 100644
--- a/drivers/rtc/rtc-dev.c
+++ b/drivers/rtc/rtc-dev.c
@@ -58,7 +58,7 @@ rtc_dev_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
58 unsigned long data; 58 unsigned long data;
59 ssize_t ret; 59 ssize_t ret;
60 60
61 if (count < sizeof(unsigned long)) 61 if (count != sizeof(unsigned int) && count < sizeof(unsigned long))
62 return -EINVAL; 62 return -EINVAL;
63 63
64 add_wait_queue(&rtc->irq_queue, &wait); 64 add_wait_queue(&rtc->irq_queue, &wait);
@@ -90,11 +90,16 @@ rtc_dev_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
90 if (ret == 0) { 90 if (ret == 0) {
91 /* Check for any data updates */ 91 /* Check for any data updates */
92 if (rtc->ops->read_callback) 92 if (rtc->ops->read_callback)
93 data = rtc->ops->read_callback(rtc->class_dev.dev, data); 93 data = rtc->ops->read_callback(rtc->class_dev.dev,
94 94 data);
95 ret = put_user(data, (unsigned long __user *)buf); 95
96 if (ret == 0) 96 if (sizeof(int) != sizeof(long) &&
97 ret = sizeof(unsigned long); 97 count == sizeof(unsigned int))
98 ret = put_user(data, (unsigned int __user *)buf) ?:
99 sizeof(unsigned int);
100 else
101 ret = put_user(data, (unsigned long __user *)buf) ?:
102 sizeof(unsigned long);
98 } 103 }
99 return ret; 104 return ret;
100} 105}
@@ -136,13 +141,13 @@ static int rtc_dev_ioctl(struct inode *inode, struct file *file,
136 /* try the driver's ioctl interface */ 141 /* try the driver's ioctl interface */
137 if (ops->ioctl) { 142 if (ops->ioctl) {
138 err = ops->ioctl(class_dev->dev, cmd, arg); 143 err = ops->ioctl(class_dev->dev, cmd, arg);
139 if (err != -EINVAL) 144 if (err != -ENOIOCTLCMD)
140 return err; 145 return err;
141 } 146 }
142 147
143 /* if the driver does not provide the ioctl interface 148 /* if the driver does not provide the ioctl interface
144 * or if that particular ioctl was not implemented 149 * or if that particular ioctl was not implemented
145 * (-EINVAL), we will try to emulate here. 150 * (-ENOIOCTLCMD), we will try to emulate here.
146 */ 151 */
147 152
148 switch (cmd) { 153 switch (cmd) {
@@ -228,7 +233,7 @@ static int rtc_dev_ioctl(struct inode *inode, struct file *file,
228 break; 233 break;
229 234
230 default: 235 default:
231 err = -EINVAL; 236 err = -ENOTTY;
232 break; 237 break;
233 } 238 }
234 239
diff --git a/drivers/rtc/rtc-m48t86.c b/drivers/rtc/rtc-m48t86.c
index f6e7ee04f3dc..8c0d1a6739ad 100644
--- a/drivers/rtc/rtc-m48t86.c
+++ b/drivers/rtc/rtc-m48t86.c
@@ -48,33 +48,33 @@ static int m48t86_rtc_read_time(struct device *dev, struct rtc_time *tm)
48 struct platform_device *pdev = to_platform_device(dev); 48 struct platform_device *pdev = to_platform_device(dev);
49 struct m48t86_ops *ops = pdev->dev.platform_data; 49 struct m48t86_ops *ops = pdev->dev.platform_data;
50 50
51 reg = ops->readb(M48T86_REG_B); 51 reg = ops->readbyte(M48T86_REG_B);
52 52
53 if (reg & M48T86_REG_B_DM) { 53 if (reg & M48T86_REG_B_DM) {
54 /* data (binary) mode */ 54 /* data (binary) mode */
55 tm->tm_sec = ops->readb(M48T86_REG_SEC); 55 tm->tm_sec = ops->readbyte(M48T86_REG_SEC);
56 tm->tm_min = ops->readb(M48T86_REG_MIN); 56 tm->tm_min = ops->readbyte(M48T86_REG_MIN);
57 tm->tm_hour = ops->readb(M48T86_REG_HOUR) & 0x3F; 57 tm->tm_hour = ops->readbyte(M48T86_REG_HOUR) & 0x3F;
58 tm->tm_mday = ops->readb(M48T86_REG_DOM); 58 tm->tm_mday = ops->readbyte(M48T86_REG_DOM);
59 /* tm_mon is 0-11 */ 59 /* tm_mon is 0-11 */
60 tm->tm_mon = ops->readb(M48T86_REG_MONTH) - 1; 60 tm->tm_mon = ops->readbyte(M48T86_REG_MONTH) - 1;
61 tm->tm_year = ops->readb(M48T86_REG_YEAR) + 100; 61 tm->tm_year = ops->readbyte(M48T86_REG_YEAR) + 100;
62 tm->tm_wday = ops->readb(M48T86_REG_DOW); 62 tm->tm_wday = ops->readbyte(M48T86_REG_DOW);
63 } else { 63 } else {
64 /* bcd mode */ 64 /* bcd mode */
65 tm->tm_sec = BCD2BIN(ops->readb(M48T86_REG_SEC)); 65 tm->tm_sec = BCD2BIN(ops->readbyte(M48T86_REG_SEC));
66 tm->tm_min = BCD2BIN(ops->readb(M48T86_REG_MIN)); 66 tm->tm_min = BCD2BIN(ops->readbyte(M48T86_REG_MIN));
67 tm->tm_hour = BCD2BIN(ops->readb(M48T86_REG_HOUR) & 0x3F); 67 tm->tm_hour = BCD2BIN(ops->readbyte(M48T86_REG_HOUR) & 0x3F);
68 tm->tm_mday = BCD2BIN(ops->readb(M48T86_REG_DOM)); 68 tm->tm_mday = BCD2BIN(ops->readbyte(M48T86_REG_DOM));
69 /* tm_mon is 0-11 */ 69 /* tm_mon is 0-11 */
70 tm->tm_mon = BCD2BIN(ops->readb(M48T86_REG_MONTH)) - 1; 70 tm->tm_mon = BCD2BIN(ops->readbyte(M48T86_REG_MONTH)) - 1;
71 tm->tm_year = BCD2BIN(ops->readb(M48T86_REG_YEAR)) + 100; 71 tm->tm_year = BCD2BIN(ops->readbyte(M48T86_REG_YEAR)) + 100;
72 tm->tm_wday = BCD2BIN(ops->readb(M48T86_REG_DOW)); 72 tm->tm_wday = BCD2BIN(ops->readbyte(M48T86_REG_DOW));
73 } 73 }
74 74
75 /* correct the hour if the clock is in 12h mode */ 75 /* correct the hour if the clock is in 12h mode */
76 if (!(reg & M48T86_REG_B_H24)) 76 if (!(reg & M48T86_REG_B_H24))
77 if (ops->readb(M48T86_REG_HOUR) & 0x80) 77 if (ops->readbyte(M48T86_REG_HOUR) & 0x80)
78 tm->tm_hour += 12; 78 tm->tm_hour += 12;
79 79
80 return 0; 80 return 0;
@@ -86,35 +86,35 @@ static int m48t86_rtc_set_time(struct device *dev, struct rtc_time *tm)
86 struct platform_device *pdev = to_platform_device(dev); 86 struct platform_device *pdev = to_platform_device(dev);
87 struct m48t86_ops *ops = pdev->dev.platform_data; 87 struct m48t86_ops *ops = pdev->dev.platform_data;
88 88
89 reg = ops->readb(M48T86_REG_B); 89 reg = ops->readbyte(M48T86_REG_B);
90 90
91 /* update flag and 24h mode */ 91 /* update flag and 24h mode */
92 reg |= M48T86_REG_B_SET | M48T86_REG_B_H24; 92 reg |= M48T86_REG_B_SET | M48T86_REG_B_H24;
93 ops->writeb(reg, M48T86_REG_B); 93 ops->writebyte(reg, M48T86_REG_B);
94 94
95 if (reg & M48T86_REG_B_DM) { 95 if (reg & M48T86_REG_B_DM) {
96 /* data (binary) mode */ 96 /* data (binary) mode */
97 ops->writeb(tm->tm_sec, M48T86_REG_SEC); 97 ops->writebyte(tm->tm_sec, M48T86_REG_SEC);
98 ops->writeb(tm->tm_min, M48T86_REG_MIN); 98 ops->writebyte(tm->tm_min, M48T86_REG_MIN);
99 ops->writeb(tm->tm_hour, M48T86_REG_HOUR); 99 ops->writebyte(tm->tm_hour, M48T86_REG_HOUR);
100 ops->writeb(tm->tm_mday, M48T86_REG_DOM); 100 ops->writebyte(tm->tm_mday, M48T86_REG_DOM);
101 ops->writeb(tm->tm_mon + 1, M48T86_REG_MONTH); 101 ops->writebyte(tm->tm_mon + 1, M48T86_REG_MONTH);
102 ops->writeb(tm->tm_year % 100, M48T86_REG_YEAR); 102 ops->writebyte(tm->tm_year % 100, M48T86_REG_YEAR);
103 ops->writeb(tm->tm_wday, M48T86_REG_DOW); 103 ops->writebyte(tm->tm_wday, M48T86_REG_DOW);
104 } else { 104 } else {
105 /* bcd mode */ 105 /* bcd mode */
106 ops->writeb(BIN2BCD(tm->tm_sec), M48T86_REG_SEC); 106 ops->writebyte(BIN2BCD(tm->tm_sec), M48T86_REG_SEC);
107 ops->writeb(BIN2BCD(tm->tm_min), M48T86_REG_MIN); 107 ops->writebyte(BIN2BCD(tm->tm_min), M48T86_REG_MIN);
108 ops->writeb(BIN2BCD(tm->tm_hour), M48T86_REG_HOUR); 108 ops->writebyte(BIN2BCD(tm->tm_hour), M48T86_REG_HOUR);
109 ops->writeb(BIN2BCD(tm->tm_mday), M48T86_REG_DOM); 109 ops->writebyte(BIN2BCD(tm->tm_mday), M48T86_REG_DOM);
110 ops->writeb(BIN2BCD(tm->tm_mon + 1), M48T86_REG_MONTH); 110 ops->writebyte(BIN2BCD(tm->tm_mon + 1), M48T86_REG_MONTH);
111 ops->writeb(BIN2BCD(tm->tm_year % 100), M48T86_REG_YEAR); 111 ops->writebyte(BIN2BCD(tm->tm_year % 100), M48T86_REG_YEAR);
112 ops->writeb(BIN2BCD(tm->tm_wday), M48T86_REG_DOW); 112 ops->writebyte(BIN2BCD(tm->tm_wday), M48T86_REG_DOW);
113 } 113 }
114 114
115 /* update ended */ 115 /* update ended */
116 reg &= ~M48T86_REG_B_SET; 116 reg &= ~M48T86_REG_B_SET;
117 ops->writeb(reg, M48T86_REG_B); 117 ops->writebyte(reg, M48T86_REG_B);
118 118
119 return 0; 119 return 0;
120} 120}
@@ -125,12 +125,12 @@ static int m48t86_rtc_proc(struct device *dev, struct seq_file *seq)
125 struct platform_device *pdev = to_platform_device(dev); 125 struct platform_device *pdev = to_platform_device(dev);
126 struct m48t86_ops *ops = pdev->dev.platform_data; 126 struct m48t86_ops *ops = pdev->dev.platform_data;
127 127
128 reg = ops->readb(M48T86_REG_B); 128 reg = ops->readbyte(M48T86_REG_B);
129 129
130 seq_printf(seq, "mode\t\t: %s\n", 130 seq_printf(seq, "mode\t\t: %s\n",
131 (reg & M48T86_REG_B_DM) ? "binary" : "bcd"); 131 (reg & M48T86_REG_B_DM) ? "binary" : "bcd");
132 132
133 reg = ops->readb(M48T86_REG_D); 133 reg = ops->readbyte(M48T86_REG_D);
134 134
135 seq_printf(seq, "battery\t\t: %s\n", 135 seq_printf(seq, "battery\t\t: %s\n",
136 (reg & M48T86_REG_D_VRT) ? "ok" : "exhausted"); 136 (reg & M48T86_REG_D_VRT) ? "ok" : "exhausted");
@@ -157,7 +157,7 @@ static int __devinit m48t86_rtc_probe(struct platform_device *dev)
157 platform_set_drvdata(dev, rtc); 157 platform_set_drvdata(dev, rtc);
158 158
159 /* read battery status */ 159 /* read battery status */
160 reg = ops->readb(M48T86_REG_D); 160 reg = ops->readbyte(M48T86_REG_D);
161 dev_info(&dev->dev, "battery %s\n", 161 dev_info(&dev->dev, "battery %s\n",
162 (reg & M48T86_REG_D_VRT) ? "ok" : "exhausted"); 162 (reg & M48T86_REG_D_VRT) ? "ok" : "exhausted");
163 163
diff --git a/drivers/rtc/rtc-sa1100.c b/drivers/rtc/rtc-sa1100.c
index a23ec54989f6..a997529f8926 100644
--- a/drivers/rtc/rtc-sa1100.c
+++ b/drivers/rtc/rtc-sa1100.c
@@ -178,9 +178,9 @@ static int sa1100_rtc_open(struct device *dev)
178 return 0; 178 return 0;
179 179
180 fail_pi: 180 fail_pi:
181 free_irq(IRQ_RTCAlrm, NULL); 181 free_irq(IRQ_RTCAlrm, dev);
182 fail_ai: 182 fail_ai:
183 free_irq(IRQ_RTC1Hz, NULL); 183 free_irq(IRQ_RTC1Hz, dev);
184 fail_ui: 184 fail_ui:
185 return ret; 185 return ret;
186} 186}
@@ -247,7 +247,7 @@ static int sa1100_rtc_ioctl(struct device *dev, unsigned int cmd,
247 rtc_freq = arg; 247 rtc_freq = arg;
248 return 0; 248 return 0;
249 } 249 }
250 return -EINVAL; 250 return -ENOIOCTLCMD;
251} 251}
252 252
253static int sa1100_rtc_read_time(struct device *dev, struct rtc_time *tm) 253static int sa1100_rtc_read_time(struct device *dev, struct rtc_time *tm)
@@ -295,7 +295,7 @@ static int sa1100_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
295 295
296static int sa1100_rtc_proc(struct device *dev, struct seq_file *seq) 296static int sa1100_rtc_proc(struct device *dev, struct seq_file *seq)
297{ 297{
298 seq_printf(seq, "trim/divider\t: 0x%08x\n", RTTR); 298 seq_printf(seq, "trim/divider\t: 0x%08lx\n", RTTR);
299 seq_printf(seq, "alarm_IRQ\t: %s\n", 299 seq_printf(seq, "alarm_IRQ\t: %s\n",
300 (RTSR & RTSR_ALE) ? "yes" : "no" ); 300 (RTSR & RTSR_ALE) ? "yes" : "no" );
301 seq_printf(seq, "update_IRQ\t: %s\n", 301 seq_printf(seq, "update_IRQ\t: %s\n",
diff --git a/drivers/rtc/rtc-test.c b/drivers/rtc/rtc-test.c
index e1f7e8e86daf..e1fa5fe7901f 100644
--- a/drivers/rtc/rtc-test.c
+++ b/drivers/rtc/rtc-test.c
@@ -71,7 +71,7 @@ static int test_rtc_ioctl(struct device *dev, unsigned int cmd,
71 return 0; 71 return 0;
72 72
73 default: 73 default:
74 return -EINVAL; 74 return -ENOIOCTLCMD;
75 } 75 }
76} 76}
77 77
diff --git a/drivers/rtc/rtc-vr41xx.c b/drivers/rtc/rtc-vr41xx.c
index 4d49fd501198..277596c302e3 100644
--- a/drivers/rtc/rtc-vr41xx.c
+++ b/drivers/rtc/rtc-vr41xx.c
@@ -270,7 +270,7 @@ static int vr41xx_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long
270 epoch = arg; 270 epoch = arg;
271 break; 271 break;
272 default: 272 default:
273 return -EINVAL; 273 return -ENOIOCTLCMD;
274 } 274 }
275 275
276 return 0; 276 return 0;
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
index a3bfebcf31ef..cfb1fff3787c 100644
--- a/drivers/s390/block/dasd.c
+++ b/drivers/s390/block/dasd.c
@@ -315,6 +315,11 @@ dasd_increase_state(struct dasd_device *device)
315 rc = dasd_state_basic_to_ready(device); 315 rc = dasd_state_basic_to_ready(device);
316 316
317 if (!rc && 317 if (!rc &&
318 device->state == DASD_STATE_UNFMT &&
319 device->target > DASD_STATE_UNFMT)
320 rc = -EPERM;
321
322 if (!rc &&
318 device->state == DASD_STATE_READY && 323 device->state == DASD_STATE_READY &&
319 device->target >= DASD_STATE_ONLINE) 324 device->target >= DASD_STATE_ONLINE)
320 rc = dasd_state_ready_to_online(device); 325 rc = dasd_state_ready_to_online(device);
diff --git a/drivers/s390/block/dasd_devmap.c b/drivers/s390/block/dasd_devmap.c
index c1c6f1381150..216bc4fba199 100644
--- a/drivers/s390/block/dasd_devmap.c
+++ b/drivers/s390/block/dasd_devmap.c
@@ -45,6 +45,7 @@ struct dasd_devmap {
45 unsigned int devindex; 45 unsigned int devindex;
46 unsigned short features; 46 unsigned short features;
47 struct dasd_device *device; 47 struct dasd_device *device;
48 struct dasd_uid uid;
48}; 49};
49 50
50/* 51/*
@@ -716,6 +717,68 @@ dasd_discipline_show(struct device *dev, struct device_attribute *attr, char *bu
716 717
717static DEVICE_ATTR(discipline, 0444, dasd_discipline_show, NULL); 718static DEVICE_ATTR(discipline, 0444, dasd_discipline_show, NULL);
718 719
720static ssize_t
721dasd_alias_show(struct device *dev, struct device_attribute *attr, char *buf)
722{
723 struct dasd_devmap *devmap;
724 int alias;
725
726 devmap = dasd_find_busid(dev->bus_id);
727 spin_lock(&dasd_devmap_lock);
728 if (!IS_ERR(devmap))
729 alias = devmap->uid.alias;
730 else
731 alias = 0;
732 spin_unlock(&dasd_devmap_lock);
733
734 return sprintf(buf, alias ? "1\n" : "0\n");
735}
736
737static DEVICE_ATTR(alias, 0444, dasd_alias_show, NULL);
738
739static ssize_t
740dasd_vendor_show(struct device *dev, struct device_attribute *attr, char *buf)
741{
742 struct dasd_devmap *devmap;
743 char *vendor;
744
745 devmap = dasd_find_busid(dev->bus_id);
746 spin_lock(&dasd_devmap_lock);
747 if (!IS_ERR(devmap) && strlen(devmap->uid.vendor) > 0)
748 vendor = devmap->uid.vendor;
749 else
750 vendor = "";
751 spin_unlock(&dasd_devmap_lock);
752
753 return snprintf(buf, PAGE_SIZE, "%s\n", vendor);
754}
755
756static DEVICE_ATTR(vendor, 0444, dasd_vendor_show, NULL);
757
758#define UID_STRLEN ( /* vendor */ 3 + 1 + /* serial */ 14 + 1 +\
759 /* SSID */ 4 + 1 + /* unit addr */ 2 + 1)
760
761static ssize_t
762dasd_uid_show(struct device *dev, struct device_attribute *attr, char *buf)
763{
764 struct dasd_devmap *devmap;
765 char uid[UID_STRLEN];
766
767 devmap = dasd_find_busid(dev->bus_id);
768 spin_lock(&dasd_devmap_lock);
769 if (!IS_ERR(devmap) && strlen(devmap->uid.vendor) > 0)
770 snprintf(uid, sizeof(uid), "%s.%s.%04x.%02x",
771 devmap->uid.vendor, devmap->uid.serial,
772 devmap->uid.ssid, devmap->uid.unit_addr);
773 else
774 uid[0] = 0;
775 spin_unlock(&dasd_devmap_lock);
776
777 return snprintf(buf, PAGE_SIZE, "%s\n", uid);
778}
779
780static DEVICE_ATTR(uid, 0444, dasd_uid_show, NULL);
781
719/* 782/*
720 * extended error-reporting 783 * extended error-reporting
721 */ 784 */
@@ -759,6 +822,9 @@ static DEVICE_ATTR(eer_enabled, 0644, dasd_eer_show, dasd_eer_store);
759static struct attribute * dasd_attrs[] = { 822static struct attribute * dasd_attrs[] = {
760 &dev_attr_readonly.attr, 823 &dev_attr_readonly.attr,
761 &dev_attr_discipline.attr, 824 &dev_attr_discipline.attr,
825 &dev_attr_alias.attr,
826 &dev_attr_vendor.attr,
827 &dev_attr_uid.attr,
762 &dev_attr_use_diag.attr, 828 &dev_attr_use_diag.attr,
763 &dev_attr_eer_enabled.attr, 829 &dev_attr_eer_enabled.attr,
764 NULL, 830 NULL,
@@ -768,6 +834,42 @@ static struct attribute_group dasd_attr_group = {
768 .attrs = dasd_attrs, 834 .attrs = dasd_attrs,
769}; 835};
770 836
837
838/*
839 * Return copy of the device unique identifier.
840 */
841int
842dasd_get_uid(struct ccw_device *cdev, struct dasd_uid *uid)
843{
844 struct dasd_devmap *devmap;
845
846 devmap = dasd_find_busid(cdev->dev.bus_id);
847 if (IS_ERR(devmap))
848 return PTR_ERR(devmap);
849 spin_lock(&dasd_devmap_lock);
850 *uid = devmap->uid;
851 spin_unlock(&dasd_devmap_lock);
852 return 0;
853}
854
855/*
856 * Register the given device unique identifier into devmap struct.
857 */
858int
859dasd_set_uid(struct ccw_device *cdev, struct dasd_uid *uid)
860{
861 struct dasd_devmap *devmap;
862
863 devmap = dasd_find_busid(cdev->dev.bus_id);
864 if (IS_ERR(devmap))
865 return PTR_ERR(devmap);
866 spin_lock(&dasd_devmap_lock);
867 devmap->uid = *uid;
868 spin_unlock(&dasd_devmap_lock);
869 return 0;
870}
871EXPORT_SYMBOL(dasd_set_uid);
872
771/* 873/*
772 * Return value of the specified feature. 874 * Return value of the specified feature.
773 */ 875 */
diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c
index ee09ef33d08d..7d5a6cee4bd8 100644
--- a/drivers/s390/block/dasd_eckd.c
+++ b/drivers/s390/block/dasd_eckd.c
@@ -446,6 +446,39 @@ dasd_eckd_cdl_reclen(int recid)
446 return LABEL_SIZE; 446 return LABEL_SIZE;
447} 447}
448 448
449/*
450 * Generate device unique id that specifies the physical device.
451 */
452static int
453dasd_eckd_generate_uid(struct dasd_device *device, struct dasd_uid *uid)
454{
455 struct dasd_eckd_private *private;
456 struct dasd_eckd_confdata *confdata;
457
458 private = (struct dasd_eckd_private *) device->private;
459 if (!private)
460 return -ENODEV;
461 confdata = &private->conf_data;
462 if (!confdata)
463 return -ENODEV;
464
465 memset(uid, 0, sizeof(struct dasd_uid));
466 strncpy(uid->vendor, confdata->ned1.HDA_manufacturer,
467 sizeof(uid->vendor) - 1);
468 EBCASC(uid->vendor, sizeof(uid->vendor) - 1);
469 strncpy(uid->serial, confdata->ned1.HDA_location,
470 sizeof(uid->serial) - 1);
471 EBCASC(uid->serial, sizeof(uid->serial) - 1);
472 uid->ssid = confdata->neq.subsystemID;
473 if (confdata->ned2.sneq.flags == 0x40) {
474 uid->alias = 1;
475 uid->unit_addr = confdata->ned2.sneq.base_unit_addr;
476 } else
477 uid->unit_addr = confdata->ned1.unit_addr;
478
479 return 0;
480}
481
449static int 482static int
450dasd_eckd_read_conf(struct dasd_device *device) 483dasd_eckd_read_conf(struct dasd_device *device)
451{ 484{
@@ -507,11 +540,15 @@ dasd_eckd_read_conf(struct dasd_device *device)
507 return 0; 540 return 0;
508} 541}
509 542
510 543/*
544 * Check device characteristics.
545 * If the device is accessible using ECKD discipline, the device is enabled.
546 */
511static int 547static int
512dasd_eckd_check_characteristics(struct dasd_device *device) 548dasd_eckd_check_characteristics(struct dasd_device *device)
513{ 549{
514 struct dasd_eckd_private *private; 550 struct dasd_eckd_private *private;
551 struct dasd_uid uid;
515 void *rdc_data; 552 void *rdc_data;
516 int rc; 553 int rc;
517 554
@@ -536,6 +573,7 @@ dasd_eckd_check_characteristics(struct dasd_device *device)
536 573
537 /* Read Device Characteristics */ 574 /* Read Device Characteristics */
538 rdc_data = (void *) &(private->rdc_data); 575 rdc_data = (void *) &(private->rdc_data);
576 memset(rdc_data, 0, sizeof(rdc_data));
539 rc = read_dev_chars(device->cdev, &rdc_data, 64); 577 rc = read_dev_chars(device->cdev, &rdc_data, 64);
540 if (rc) { 578 if (rc) {
541 DEV_MESSAGE(KERN_WARNING, device, 579 DEV_MESSAGE(KERN_WARNING, device,
@@ -556,8 +594,17 @@ dasd_eckd_check_characteristics(struct dasd_device *device)
556 594
557 /* Read Configuration Data */ 595 /* Read Configuration Data */
558 rc = dasd_eckd_read_conf (device); 596 rc = dasd_eckd_read_conf (device);
559 return rc; 597 if (rc)
598 return rc;
599
600 /* Generate device unique id and register in devmap */
601 rc = dasd_eckd_generate_uid(device, &uid);
602 if (rc)
603 return rc;
560 604
605 rc = dasd_set_uid(device->cdev, &uid);
606
607 return rc;
561} 608}
562 609
563static struct dasd_ccw_req * 610static struct dasd_ccw_req *
diff --git a/drivers/s390/block/dasd_eckd.h b/drivers/s390/block/dasd_eckd.h
index ad8524bb7bb3..d5734e976e1c 100644
--- a/drivers/s390/block/dasd_eckd.h
+++ b/drivers/s390/block/dasd_eckd.h
@@ -228,26 +228,36 @@ struct dasd_eckd_confdata {
228 unsigned char HDA_manufacturer[3]; 228 unsigned char HDA_manufacturer[3];
229 unsigned char HDA_location[2]; 229 unsigned char HDA_location[2];
230 unsigned char HDA_seqno[12]; 230 unsigned char HDA_seqno[12];
231 __u16 ID; 231 __u8 ID;
232 __u8 unit_addr;
232 } __attribute__ ((packed)) ned1; 233 } __attribute__ ((packed)) ned1;
233 struct { 234 union {
234 struct { 235 struct {
235 unsigned char identifier:2; 236 struct {
236 unsigned char token_id:1; 237 unsigned char identifier:2;
237 unsigned char sno_valid:1; 238 unsigned char token_id:1;
238 unsigned char subst_sno:1; 239 unsigned char sno_valid:1;
239 unsigned char recNED:1; 240 unsigned char subst_sno:1;
240 unsigned char emuNED:1; 241 unsigned char recNED:1;
241 unsigned char reserved:1; 242 unsigned char emuNED:1;
242 } __attribute__ ((packed)) flags; 243 unsigned char reserved:1;
243 __u8 descriptor; 244 } __attribute__ ((packed)) flags;
244 __u8 reserved[2]; 245 __u8 descriptor;
245 unsigned char dev_type[6]; 246 __u8 reserved[2];
246 unsigned char dev_model[3]; 247 unsigned char dev_type[6];
247 unsigned char DASD_manufacturer[3]; 248 unsigned char dev_model[3];
248 unsigned char DASD_location[2]; 249 unsigned char DASD_manufacturer[3];
249 unsigned char DASD_seqno[12]; 250 unsigned char DASD_location[2];
250 __u16 ID; 251 unsigned char DASD_seqno[12];
252 __u16 ID;
253 } __attribute__ ((packed)) ned;
254 struct {
255 unsigned char flags; /* byte 0 */
256 unsigned char res2[7]; /* byte 1- 7 */
257 unsigned char sua_flags; /* byte 8 */
258 __u8 base_unit_addr; /* byte 9 */
259 unsigned char res3[22]; /* byte 10-31 */
260 } __attribute__ ((packed)) sneq;
251 } __attribute__ ((packed)) ned2; 261 } __attribute__ ((packed)) ned2;
252 struct { 262 struct {
253 struct { 263 struct {
diff --git a/drivers/s390/block/dasd_int.h b/drivers/s390/block/dasd_int.h
index 4293ba827523..d4b13e300a76 100644
--- a/drivers/s390/block/dasd_int.h
+++ b/drivers/s390/block/dasd_int.h
@@ -268,6 +268,16 @@ struct dasd_discipline {
268 268
269extern struct dasd_discipline *dasd_diag_discipline_pointer; 269extern struct dasd_discipline *dasd_diag_discipline_pointer;
270 270
271/*
272 * Unique identifier for dasd device.
273 */
274struct dasd_uid {
275 __u8 alias;
276 char vendor[4];
277 char serial[15];
278 __u16 ssid;
279 __u8 unit_addr;
280};
271 281
272/* 282/*
273 * Notification numbers for extended error reporting notifications: 283 * Notification numbers for extended error reporting notifications:
@@ -516,6 +526,8 @@ void dasd_devmap_exit(void);
516struct dasd_device *dasd_create_device(struct ccw_device *); 526struct dasd_device *dasd_create_device(struct ccw_device *);
517void dasd_delete_device(struct dasd_device *); 527void dasd_delete_device(struct dasd_device *);
518 528
529int dasd_get_uid(struct ccw_device *, struct dasd_uid *);
530int dasd_set_uid(struct ccw_device *, struct dasd_uid *);
519int dasd_get_feature(struct ccw_device *, int); 531int dasd_get_feature(struct ccw_device *, int);
520int dasd_set_feature(struct ccw_device *, int, int); 532int dasd_set_feature(struct ccw_device *, int, int);
521 533
diff --git a/drivers/s390/char/tape_3590.c b/drivers/s390/char/tape_3590.c
index c3915f60a3aa..d71ef1adea59 100644
--- a/drivers/s390/char/tape_3590.c
+++ b/drivers/s390/char/tape_3590.c
@@ -230,14 +230,16 @@ tape_3590_read_attmsg(struct tape_device *device)
230 * These functions are used to schedule follow-up actions from within an 230 * These functions are used to schedule follow-up actions from within an
231 * interrupt context (like unsolicited interrupts). 231 * interrupt context (like unsolicited interrupts).
232 */ 232 */
233struct work_handler_data {
234 struct tape_device *device;
235 enum tape_op op;
236 struct work_struct work;
237};
238
233static void 239static void
234tape_3590_work_handler(void *data) 240tape_3590_work_handler(void *data)
235{ 241{
236 struct { 242 struct work_handler_data *p = data;
237 struct tape_device *device;
238 enum tape_op op;
239 struct work_struct work;
240 } *p = data;
241 243
242 switch (p->op) { 244 switch (p->op) {
243 case TO_MSEN: 245 case TO_MSEN:
@@ -257,11 +259,7 @@ tape_3590_work_handler(void *data)
257static int 259static int
258tape_3590_schedule_work(struct tape_device *device, enum tape_op op) 260tape_3590_schedule_work(struct tape_device *device, enum tape_op op)
259{ 261{
260 struct { 262 struct work_handler_data *p;
261 struct tape_device *device;
262 enum tape_op op;
263 struct work_struct work;
264 } *p;
265 263
266 if ((p = kzalloc(sizeof(*p), GFP_ATOMIC)) == NULL) 264 if ((p = kzalloc(sizeof(*p), GFP_ATOMIC)) == NULL)
267 return -ENOMEM; 265 return -ENOMEM;
@@ -316,7 +314,7 @@ tape_3590_bread(struct tape_device *device, struct request *req)
316 314
317 rq_for_each_bio(bio, req) { 315 rq_for_each_bio(bio, req) {
318 bio_for_each_segment(bv, bio, i) { 316 bio_for_each_segment(bv, bio, i) {
319 dst = kmap(bv->bv_page) + bv->bv_offset; 317 dst = page_address(bv->bv_page) + bv->bv_offset;
320 for (off = 0; off < bv->bv_len; 318 for (off = 0; off < bv->bv_len;
321 off += TAPEBLOCK_HSEC_SIZE) { 319 off += TAPEBLOCK_HSEC_SIZE) {
322 ccw->flags = CCW_FLAG_CC; 320 ccw->flags = CCW_FLAG_CC;
@@ -1168,6 +1166,7 @@ tape_3590_setup_device(struct tape_device *device)
1168static void 1166static void
1169tape_3590_cleanup_device(struct tape_device *device) 1167tape_3590_cleanup_device(struct tape_device *device)
1170{ 1168{
1169 flush_scheduled_work();
1171 tape_std_unassign(device); 1170 tape_std_unassign(device);
1172 1171
1173 kfree(device->discdata); 1172 kfree(device->discdata);
@@ -1234,6 +1233,7 @@ static struct tape_discipline tape_discipline_3590 = {
1234 1233
1235static struct ccw_device_id tape_3590_ids[] = { 1234static struct ccw_device_id tape_3590_ids[] = {
1236 {CCW_DEVICE_DEVTYPE(0x3590, 0, 0x3590, 0), .driver_info = tape_3590}, 1235 {CCW_DEVICE_DEVTYPE(0x3590, 0, 0x3590, 0), .driver_info = tape_3590},
1236 {CCW_DEVICE_DEVTYPE(0x3592, 0, 0x3592, 0), .driver_info = tape_3592},
1237 { /* end of list */ } 1237 { /* end of list */ }
1238}; 1238};
1239 1239
diff --git a/drivers/s390/char/tape_std.h b/drivers/s390/char/tape_std.h
index 2d311798edf4..1fc952359341 100644
--- a/drivers/s390/char/tape_std.h
+++ b/drivers/s390/char/tape_std.h
@@ -153,6 +153,7 @@ enum s390_tape_type {
153 tape_3480, 153 tape_3480,
154 tape_3490, 154 tape_3490,
155 tape_3590, 155 tape_3590,
156 tape_3592,
156}; 157};
157 158
158#endif // _TAPE_STD_H 159#endif // _TAPE_STD_H
diff --git a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c
index 6412b2c3edd3..72187e54dcac 100644
--- a/drivers/s390/cio/chsc.c
+++ b/drivers/s390/cio/chsc.c
@@ -242,28 +242,10 @@ s390_subchannel_remove_chpid(struct device *dev, void *data)
242 if (sch->vpm == mask) 242 if (sch->vpm == mask)
243 goto out_unreg; 243 goto out_unreg;
244 244
245 if ((sch->schib.scsw.actl & (SCSW_ACTL_CLEAR_PEND | 245 if ((sch->schib.scsw.actl & SCSW_ACTL_DEVACT) &&
246 SCSW_ACTL_HALT_PEND | 246 (sch->schib.scsw.actl & SCSW_ACTL_SCHACT) &&
247 SCSW_ACTL_START_PEND | 247 (sch->schib.pmcw.lpum == mask) &&
248 SCSW_ACTL_RESUME_PEND)) && 248 (sch->vpm == 0)) {
249 (sch->schib.pmcw.lpum == mask)) {
250 int cc = cio_cancel(sch);
251
252 if (cc == -ENODEV)
253 goto out_unreg;
254
255 if (cc == -EINVAL) {
256 cc = cio_clear(sch);
257 if (cc == -ENODEV)
258 goto out_unreg;
259 /* Call handler. */
260 if (sch->driver && sch->driver->termination)
261 sch->driver->termination(&sch->dev);
262 goto out_unlock;
263 }
264 } else if ((sch->schib.scsw.actl & SCSW_ACTL_DEVACT) &&
265 (sch->schib.scsw.actl & SCSW_ACTL_SCHACT) &&
266 (sch->schib.pmcw.lpum == mask)) {
267 int cc; 249 int cc;
268 250
269 cc = cio_clear(sch); 251 cc = cio_clear(sch);
@@ -653,13 +635,13 @@ __chp_add(struct subchannel_id schid, void *data)
653 if (sch->schib.pmcw.chpid[i] == chp->id) { 635 if (sch->schib.pmcw.chpid[i] == chp->id) {
654 if (stsch(sch->schid, &sch->schib) != 0) { 636 if (stsch(sch->schid, &sch->schib) != 0) {
655 /* Endgame. */ 637 /* Endgame. */
656 spin_unlock(&sch->lock); 638 spin_unlock_irq(&sch->lock);
657 return -ENXIO; 639 return -ENXIO;
658 } 640 }
659 break; 641 break;
660 } 642 }
661 if (i==8) { 643 if (i==8) {
662 spin_unlock(&sch->lock); 644 spin_unlock_irq(&sch->lock);
663 return 0; 645 return 0;
664 } 646 }
665 sch->lpm = ((sch->schib.pmcw.pim & 647 sch->lpm = ((sch->schib.pmcw.pim &
diff --git a/drivers/s390/cio/css.h b/drivers/s390/cio/css.h
index 74a257b23383..e210f89a2449 100644
--- a/drivers/s390/cio/css.h
+++ b/drivers/s390/cio/css.h
@@ -45,11 +45,11 @@ struct pgid {
45 union { 45 union {
46 __u8 fc; /* SPID function code */ 46 __u8 fc; /* SPID function code */
47 struct path_state ps; /* SNID path state */ 47 struct path_state ps; /* SNID path state */
48 } inf; 48 } __attribute__ ((packed)) inf;
49 union { 49 union {
50 __u32 cpu_addr : 16; /* CPU address */ 50 __u32 cpu_addr : 16; /* CPU address */
51 struct extended_cssid ext_cssid; 51 struct extended_cssid ext_cssid;
52 } pgid_high; 52 } __attribute__ ((packed)) pgid_high;
53 __u32 cpu_id : 24; /* CPU identification */ 53 __u32 cpu_id : 24; /* CPU identification */
54 __u32 cpu_model : 16; /* CPU model */ 54 __u32 cpu_model : 16; /* CPU model */
55 __u32 tod_high; /* high word TOD clock */ 55 __u32 tod_high; /* high word TOD clock */
diff --git a/drivers/s390/cio/device_fsm.c b/drivers/s390/cio/device_fsm.c
index 180b3bf8b90d..49ec562d7f60 100644
--- a/drivers/s390/cio/device_fsm.c
+++ b/drivers/s390/cio/device_fsm.c
@@ -749,7 +749,7 @@ ccw_device_irq(struct ccw_device *cdev, enum dev_event dev_event)
749 /* Unit check but no sense data. Need basic sense. */ 749 /* Unit check but no sense data. Need basic sense. */
750 if (ccw_device_do_sense(cdev, irb) != 0) 750 if (ccw_device_do_sense(cdev, irb) != 0)
751 goto call_handler_unsol; 751 goto call_handler_unsol;
752 memcpy(irb, &cdev->private->irb, sizeof(struct irb)); 752 memcpy(&cdev->private->irb, irb, sizeof(struct irb));
753 cdev->private->state = DEV_STATE_W4SENSE; 753 cdev->private->state = DEV_STATE_W4SENSE;
754 cdev->private->intparm = 0; 754 cdev->private->intparm = 0;
755 return; 755 return;
diff --git a/drivers/s390/cio/qdio.c b/drivers/s390/cio/qdio.c
index 814f9258ce00..96f519281d92 100644
--- a/drivers/s390/cio/qdio.c
+++ b/drivers/s390/cio/qdio.c
@@ -38,6 +38,7 @@
38#include <linux/kernel.h> 38#include <linux/kernel.h>
39#include <linux/proc_fs.h> 39#include <linux/proc_fs.h>
40#include <linux/timer.h> 40#include <linux/timer.h>
41#include <linux/mempool.h>
41 42
42#include <asm/ccwdev.h> 43#include <asm/ccwdev.h>
43#include <asm/io.h> 44#include <asm/io.h>
@@ -80,6 +81,8 @@ static int indicator_used[INDICATORS_PER_CACHELINE];
80static __u32 * volatile indicators; 81static __u32 * volatile indicators;
81static __u32 volatile spare_indicator; 82static __u32 volatile spare_indicator;
82static atomic_t spare_indicator_usecount; 83static atomic_t spare_indicator_usecount;
84#define QDIO_MEMPOOL_SCSSC_ELEMENTS 2
85static mempool_t *qdio_mempool_scssc;
83 86
84static debug_info_t *qdio_dbf_setup; 87static debug_info_t *qdio_dbf_setup;
85static debug_info_t *qdio_dbf_sbal; 88static debug_info_t *qdio_dbf_sbal;
@@ -1637,7 +1640,7 @@ next:
1637 1640
1638 } 1641 }
1639 kfree(irq_ptr->qdr); 1642 kfree(irq_ptr->qdr);
1640 kfree(irq_ptr); 1643 free_page((unsigned long) irq_ptr);
1641} 1644}
1642 1645
1643static void 1646static void
@@ -2304,7 +2307,7 @@ qdio_get_ssqd_information(struct qdio_irq *irq_ptr)
2304 2307
2305 QDIO_DBF_TEXT0(0,setup,"getssqd"); 2308 QDIO_DBF_TEXT0(0,setup,"getssqd");
2306 qdioac = 0; 2309 qdioac = 0;
2307 ssqd_area = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA); 2310 ssqd_area = mempool_alloc(qdio_mempool_scssc, GFP_ATOMIC);
2308 if (!ssqd_area) { 2311 if (!ssqd_area) {
2309 QDIO_PRINT_WARN("Could not get memory for chsc. Using all " \ 2312 QDIO_PRINT_WARN("Could not get memory for chsc. Using all " \
2310 "SIGAs for sch x%x.\n", irq_ptr->schid.sch_no); 2313 "SIGAs for sch x%x.\n", irq_ptr->schid.sch_no);
@@ -2364,7 +2367,7 @@ qdio_get_ssqd_information(struct qdio_irq *irq_ptr)
2364out: 2367out:
2365 qdio_check_subchannel_qebsm(irq_ptr, qdioac, 2368 qdio_check_subchannel_qebsm(irq_ptr, qdioac,
2366 ssqd_area->sch_token); 2369 ssqd_area->sch_token);
2367 free_page ((unsigned long) ssqd_area); 2370 mempool_free(ssqd_area, qdio_mempool_scssc);
2368 irq_ptr->qdioac = qdioac; 2371 irq_ptr->qdioac = qdioac;
2369} 2372}
2370 2373
@@ -2458,7 +2461,7 @@ tiqdio_set_subchannel_ind(struct qdio_irq *irq_ptr, int reset_to_zero)
2458 virt_to_phys((volatile void *)irq_ptr->dev_st_chg_ind); 2461 virt_to_phys((volatile void *)irq_ptr->dev_st_chg_ind);
2459 } 2462 }
2460 2463
2461 scssc_area = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA); 2464 scssc_area = mempool_alloc(qdio_mempool_scssc, GFP_ATOMIC);
2462 if (!scssc_area) { 2465 if (!scssc_area) {
2463 QDIO_PRINT_WARN("No memory for setting indicators on " \ 2466 QDIO_PRINT_WARN("No memory for setting indicators on " \
2464 "subchannel 0.%x.%x.\n", 2467 "subchannel 0.%x.%x.\n",
@@ -2514,7 +2517,7 @@ tiqdio_set_subchannel_ind(struct qdio_irq *irq_ptr, int reset_to_zero)
2514 QDIO_DBF_HEX2(0,setup,&real_addr_dev_st_chg_ind,sizeof(unsigned long)); 2517 QDIO_DBF_HEX2(0,setup,&real_addr_dev_st_chg_ind,sizeof(unsigned long));
2515 result = 0; 2518 result = 0;
2516out: 2519out:
2517 free_page ((unsigned long) scssc_area); 2520 mempool_free(scssc_area, qdio_mempool_scssc);
2518 return result; 2521 return result;
2519 2522
2520} 2523}
@@ -2543,7 +2546,7 @@ tiqdio_set_delay_target(struct qdio_irq *irq_ptr, unsigned long delay_target)
2543 if (!irq_ptr->is_thinint_irq) 2546 if (!irq_ptr->is_thinint_irq)
2544 return -ENODEV; 2547 return -ENODEV;
2545 2548
2546 scsscf_area = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA); 2549 scsscf_area = mempool_alloc(qdio_mempool_scssc, GFP_ATOMIC);
2547 if (!scsscf_area) { 2550 if (!scsscf_area) {
2548 QDIO_PRINT_WARN("No memory for setting delay target on " \ 2551 QDIO_PRINT_WARN("No memory for setting delay target on " \
2549 "subchannel 0.%x.%x.\n", 2552 "subchannel 0.%x.%x.\n",
@@ -2581,7 +2584,7 @@ tiqdio_set_delay_target(struct qdio_irq *irq_ptr, unsigned long delay_target)
2581 QDIO_DBF_HEX2(0,trace,&delay_target,sizeof(unsigned long)); 2584 QDIO_DBF_HEX2(0,trace,&delay_target,sizeof(unsigned long));
2582 result = 0; /* not critical */ 2585 result = 0; /* not critical */
2583out: 2586out:
2584 free_page ((unsigned long) scsscf_area); 2587 mempool_free(scsscf_area, qdio_mempool_scssc);
2585 return result; 2588 return result;
2586} 2589}
2587 2590
@@ -2980,7 +2983,7 @@ qdio_allocate(struct qdio_initialize *init_data)
2980 qdio_allocate_do_dbf(init_data); 2983 qdio_allocate_do_dbf(init_data);
2981 2984
2982 /* create irq */ 2985 /* create irq */
2983 irq_ptr = kzalloc(sizeof(struct qdio_irq), GFP_KERNEL | GFP_DMA); 2986 irq_ptr = (void *) get_zeroed_page(GFP_KERNEL | GFP_DMA);
2984 2987
2985 QDIO_DBF_TEXT0(0,setup,"irq_ptr:"); 2988 QDIO_DBF_TEXT0(0,setup,"irq_ptr:");
2986 QDIO_DBF_HEX0(0,setup,&irq_ptr,sizeof(void*)); 2989 QDIO_DBF_HEX0(0,setup,&irq_ptr,sizeof(void*));
@@ -2995,7 +2998,7 @@ qdio_allocate(struct qdio_initialize *init_data)
2995 /* QDR must be in DMA area since CCW data address is only 32 bit */ 2998 /* QDR must be in DMA area since CCW data address is only 32 bit */
2996 irq_ptr->qdr=kmalloc(sizeof(struct qdr), GFP_KERNEL | GFP_DMA); 2999 irq_ptr->qdr=kmalloc(sizeof(struct qdr), GFP_KERNEL | GFP_DMA);
2997 if (!(irq_ptr->qdr)) { 3000 if (!(irq_ptr->qdr)) {
2998 kfree(irq_ptr); 3001 free_page((unsigned long) irq_ptr);
2999 QDIO_PRINT_ERR("kmalloc of irq_ptr->qdr failed!\n"); 3002 QDIO_PRINT_ERR("kmalloc of irq_ptr->qdr failed!\n");
3000 return -ENOMEM; 3003 return -ENOMEM;
3001 } 3004 }
@@ -3780,6 +3783,16 @@ oom:
3780 return -ENOMEM; 3783 return -ENOMEM;
3781} 3784}
3782 3785
3786static void *qdio_mempool_alloc(gfp_t gfp_mask, void *size)
3787{
3788 return (void *) get_zeroed_page(gfp_mask|GFP_DMA);
3789}
3790
3791static void qdio_mempool_free(void *element, void *size)
3792{
3793 free_page((unsigned long) element);
3794}
3795
3783static int __init 3796static int __init
3784init_QDIO(void) 3797init_QDIO(void)
3785{ 3798{
@@ -3809,6 +3822,10 @@ init_QDIO(void)
3809 3822
3810 qdio_add_procfs_entry(); 3823 qdio_add_procfs_entry();
3811 3824
3825 qdio_mempool_scssc = mempool_create(QDIO_MEMPOOL_SCSSC_ELEMENTS,
3826 qdio_mempool_alloc,
3827 qdio_mempool_free, NULL);
3828
3812 if (tiqdio_check_chsc_availability()) 3829 if (tiqdio_check_chsc_availability())
3813 QDIO_PRINT_ERR("Not all CHSCs supported. Continuing.\n"); 3830 QDIO_PRINT_ERR("Not all CHSCs supported. Continuing.\n");
3814 3831
@@ -3824,6 +3841,7 @@ cleanup_QDIO(void)
3824 qdio_remove_procfs_entry(); 3841 qdio_remove_procfs_entry();
3825 qdio_release_qdio_memory(); 3842 qdio_release_qdio_memory();
3826 qdio_unregister_dbf_views(); 3843 qdio_unregister_dbf_views();
3844 mempool_destroy(qdio_mempool_scssc);
3827 3845
3828 printk("qdio: %s: module removed\n",version); 3846 printk("qdio: %s: module removed\n",version);
3829} 3847}
diff --git a/drivers/s390/net/ctcmain.c b/drivers/s390/net/ctcmain.c
index af9f212314b3..fe986af884f8 100644
--- a/drivers/s390/net/ctcmain.c
+++ b/drivers/s390/net/ctcmain.c
@@ -1486,13 +1486,13 @@ ch_action_iofatal(fsm_instance * fi, int event, void *arg)
1486 } 1486 }
1487} 1487}
1488 1488
1489static void 1489static void
1490ch_action_reinit(fsm_instance *fi, int event, void *arg) 1490ch_action_reinit(fsm_instance *fi, int event, void *arg)
1491{ 1491{
1492 struct channel *ch = (struct channel *)arg; 1492 struct channel *ch = (struct channel *)arg;
1493 struct net_device *dev = ch->netdev; 1493 struct net_device *dev = ch->netdev;
1494 struct ctc_priv *privptr = dev->priv; 1494 struct ctc_priv *privptr = dev->priv;
1495 1495
1496 DBF_TEXT(trace, 4, __FUNCTION__); 1496 DBF_TEXT(trace, 4, __FUNCTION__);
1497 ch_action_iofatal(fi, event, arg); 1497 ch_action_iofatal(fi, event, arg);
1498 fsm_addtimer(&privptr->restart_timer, 1000, DEV_EVENT_RESTART, dev); 1498 fsm_addtimer(&privptr->restart_timer, 1000, DEV_EVENT_RESTART, dev);
@@ -1624,7 +1624,7 @@ less_than(char *id1, char *id2)
1624 } 1624 }
1625 dev1 = simple_strtoul(id1, &id1, 16); 1625 dev1 = simple_strtoul(id1, &id1, 16);
1626 dev2 = simple_strtoul(id2, &id2, 16); 1626 dev2 = simple_strtoul(id2, &id2, 16);
1627 1627
1628 return (dev1 < dev2); 1628 return (dev1 < dev2);
1629} 1629}
1630 1630
@@ -1895,7 +1895,7 @@ ctc_irq_handler(struct ccw_device *cdev, unsigned long intparm, struct irb *irb)
1895 irb->scsw.dstat); 1895 irb->scsw.dstat);
1896 return; 1896 return;
1897 } 1897 }
1898 1898
1899 priv = ((struct ccwgroup_device *)cdev->dev.driver_data) 1899 priv = ((struct ccwgroup_device *)cdev->dev.driver_data)
1900 ->dev.driver_data; 1900 ->dev.driver_data;
1901 1901
@@ -1909,7 +1909,7 @@ ctc_irq_handler(struct ccw_device *cdev, unsigned long intparm, struct irb *irb)
1909 "device %s\n", cdev->dev.bus_id); 1909 "device %s\n", cdev->dev.bus_id);
1910 return; 1910 return;
1911 } 1911 }
1912 1912
1913 dev = (struct net_device *) (ch->netdev); 1913 dev = (struct net_device *) (ch->netdev);
1914 if (dev == NULL) { 1914 if (dev == NULL) {
1915 ctc_pr_crit("ctc: ctc_irq_handler dev=NULL bus_id=%s, ch=0x%p\n", 1915 ctc_pr_crit("ctc: ctc_irq_handler dev=NULL bus_id=%s, ch=0x%p\n",
@@ -2008,12 +2008,12 @@ dev_action_stop(fsm_instance * fi, int event, void *arg)
2008 fsm_event(ch->fsm, CH_EVENT_STOP, ch); 2008 fsm_event(ch->fsm, CH_EVENT_STOP, ch);
2009 } 2009 }
2010} 2010}
2011static void 2011static void
2012dev_action_restart(fsm_instance *fi, int event, void *arg) 2012dev_action_restart(fsm_instance *fi, int event, void *arg)
2013{ 2013{
2014 struct net_device *dev = (struct net_device *)arg; 2014 struct net_device *dev = (struct net_device *)arg;
2015 struct ctc_priv *privptr = dev->priv; 2015 struct ctc_priv *privptr = dev->priv;
2016 2016
2017 DBF_TEXT(trace, 3, __FUNCTION__); 2017 DBF_TEXT(trace, 3, __FUNCTION__);
2018 ctc_pr_debug("%s: Restarting\n", dev->name); 2018 ctc_pr_debug("%s: Restarting\n", dev->name);
2019 dev_action_stop(fi, event, arg); 2019 dev_action_stop(fi, event, arg);
@@ -2193,7 +2193,7 @@ transmit_skb(struct channel *ch, struct sk_buff *skb)
2193 2193
2194 DBF_TEXT(trace, 5, __FUNCTION__); 2194 DBF_TEXT(trace, 5, __FUNCTION__);
2195 /* we need to acquire the lock for testing the state 2195 /* we need to acquire the lock for testing the state
2196 * otherwise we can have an IRQ changing the state to 2196 * otherwise we can have an IRQ changing the state to
2197 * TXIDLE after the test but before acquiring the lock. 2197 * TXIDLE after the test but before acquiring the lock.
2198 */ 2198 */
2199 spin_lock_irqsave(&ch->collect_lock, saveflags); 2199 spin_lock_irqsave(&ch->collect_lock, saveflags);
@@ -2393,7 +2393,7 @@ ctc_tx(struct sk_buff *skb, struct net_device * dev)
2393 2393
2394 /** 2394 /**
2395 * If channels are not running, try to restart them 2395 * If channels are not running, try to restart them
2396 * and throw away packet. 2396 * and throw away packet.
2397 */ 2397 */
2398 if (fsm_getstate(privptr->fsm) != DEV_STATE_RUNNING) { 2398 if (fsm_getstate(privptr->fsm) != DEV_STATE_RUNNING) {
2399 fsm_event(privptr->fsm, DEV_EVENT_START, dev); 2399 fsm_event(privptr->fsm, DEV_EVENT_START, dev);
@@ -2738,7 +2738,7 @@ ctc_remove_files(struct device *dev)
2738/** 2738/**
2739 * Add ctc specific attributes. 2739 * Add ctc specific attributes.
2740 * Add ctc private data. 2740 * Add ctc private data.
2741 * 2741 *
2742 * @param cgdev pointer to ccwgroup_device just added 2742 * @param cgdev pointer to ccwgroup_device just added
2743 * 2743 *
2744 * @returns 0 on success, !0 on failure. 2744 * @returns 0 on success, !0 on failure.
@@ -2869,7 +2869,7 @@ ctc_new_device(struct ccwgroup_device *cgdev)
2869 DBF_TEXT(setup, 3, buffer); 2869 DBF_TEXT(setup, 3, buffer);
2870 2870
2871 type = get_channel_type(&cgdev->cdev[0]->id); 2871 type = get_channel_type(&cgdev->cdev[0]->id);
2872 2872
2873 snprintf(read_id, CTC_ID_SIZE, "ch-%s", cgdev->cdev[0]->dev.bus_id); 2873 snprintf(read_id, CTC_ID_SIZE, "ch-%s", cgdev->cdev[0]->dev.bus_id);
2874 snprintf(write_id, CTC_ID_SIZE, "ch-%s", cgdev->cdev[1]->dev.bus_id); 2874 snprintf(write_id, CTC_ID_SIZE, "ch-%s", cgdev->cdev[1]->dev.bus_id);
2875 2875
@@ -2907,7 +2907,7 @@ ctc_new_device(struct ccwgroup_device *cgdev)
2907 channel_get(type, direction == READ ? read_id : write_id, 2907 channel_get(type, direction == READ ? read_id : write_id,
2908 direction); 2908 direction);
2909 if (privptr->channel[direction] == NULL) { 2909 if (privptr->channel[direction] == NULL) {
2910 if (direction == WRITE) 2910 if (direction == WRITE)
2911 channel_free(privptr->channel[READ]); 2911 channel_free(privptr->channel[READ]);
2912 2912
2913 ctc_free_netdevice(dev, 1); 2913 ctc_free_netdevice(dev, 1);
@@ -2955,7 +2955,7 @@ ctc_shutdown_device(struct ccwgroup_device *cgdev)
2955{ 2955{
2956 struct ctc_priv *priv; 2956 struct ctc_priv *priv;
2957 struct net_device *ndev; 2957 struct net_device *ndev;
2958 2958
2959 DBF_TEXT(setup, 3, __FUNCTION__); 2959 DBF_TEXT(setup, 3, __FUNCTION__);
2960 pr_debug("%s() called\n", __FUNCTION__); 2960 pr_debug("%s() called\n", __FUNCTION__);
2961 2961
diff --git a/drivers/s390/net/ctctty.c b/drivers/s390/net/ctctty.c
index 5cdcdbf92962..af54d1de07bf 100644
--- a/drivers/s390/net/ctctty.c
+++ b/drivers/s390/net/ctctty.c
@@ -130,7 +130,7 @@ ctc_tty_readmodem(ctc_tty_info *info)
130 if ((tty = info->tty)) { 130 if ((tty = info->tty)) {
131 if (info->mcr & UART_MCR_RTS) { 131 if (info->mcr & UART_MCR_RTS) {
132 struct sk_buff *skb; 132 struct sk_buff *skb;
133 133
134 if ((skb = skb_dequeue(&info->rx_queue))) { 134 if ((skb = skb_dequeue(&info->rx_queue))) {
135 int len = skb->len; 135 int len = skb->len;
136 tty_insert_flip_string(tty, skb->data, len); 136 tty_insert_flip_string(tty, skb->data, len);
@@ -328,7 +328,7 @@ ctc_tty_inject(ctc_tty_info *info, char c)
328{ 328{
329 int skb_res; 329 int skb_res;
330 struct sk_buff *skb; 330 struct sk_buff *skb;
331 331
332 DBF_TEXT(trace, 4, __FUNCTION__); 332 DBF_TEXT(trace, 4, __FUNCTION__);
333 if (ctc_tty_shuttingdown) 333 if (ctc_tty_shuttingdown)
334 return; 334 return;
@@ -497,7 +497,7 @@ ctc_tty_write(struct tty_struct *tty, const u_char * buf, int count)
497 c = (count < CTC_TTY_XMIT_SIZE) ? count : CTC_TTY_XMIT_SIZE; 497 c = (count < CTC_TTY_XMIT_SIZE) ? count : CTC_TTY_XMIT_SIZE;
498 if (c <= 0) 498 if (c <= 0)
499 break; 499 break;
500 500
501 skb_res = info->netdev->hard_header_len + sizeof(info->mcr) + 501 skb_res = info->netdev->hard_header_len + sizeof(info->mcr) +
502 + sizeof(__u32); 502 + sizeof(__u32);
503 skb = dev_alloc_skb(skb_res + c); 503 skb = dev_alloc_skb(skb_res + c);
@@ -828,7 +828,7 @@ ctc_tty_block_til_ready(struct tty_struct *tty, struct file *filp, ctc_tty_info
828 if (tty_hung_up_p(filp) || 828 if (tty_hung_up_p(filp) ||
829 (info->flags & CTC_ASYNC_CLOSING)) { 829 (info->flags & CTC_ASYNC_CLOSING)) {
830 if (info->flags & CTC_ASYNC_CLOSING) 830 if (info->flags & CTC_ASYNC_CLOSING)
831 wait_event(info->close_wait, 831 wait_event(info->close_wait,
832 !(info->flags & CTC_ASYNC_CLOSING)); 832 !(info->flags & CTC_ASYNC_CLOSING));
833#ifdef MODEM_DO_RESTART 833#ifdef MODEM_DO_RESTART
834 if (info->flags & CTC_ASYNC_HUP_NOTIFY) 834 if (info->flags & CTC_ASYNC_HUP_NOTIFY)
@@ -1247,7 +1247,7 @@ ctc_tty_unregister_netdev(struct net_device *dev) {
1247void 1247void
1248ctc_tty_cleanup(void) { 1248ctc_tty_cleanup(void) {
1249 unsigned long saveflags; 1249 unsigned long saveflags;
1250 1250
1251 DBF_TEXT(trace, 2, __FUNCTION__); 1251 DBF_TEXT(trace, 2, __FUNCTION__);
1252 spin_lock_irqsave(&ctc_tty_lock, saveflags); 1252 spin_lock_irqsave(&ctc_tty_lock, saveflags);
1253 ctc_tty_shuttingdown = 1; 1253 ctc_tty_shuttingdown = 1;
diff --git a/drivers/s390/net/cu3088.c b/drivers/s390/net/cu3088.c
index b12533104c1f..e965f03a7291 100644
--- a/drivers/s390/net/cu3088.c
+++ b/drivers/s390/net/cu3088.c
@@ -20,7 +20,7 @@
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 * 21 *
22 */ 22 */
23 23
24#include <linux/init.h> 24#include <linux/init.h>
25#include <linux/module.h> 25#include <linux/module.h>
26#include <linux/err.h> 26#include <linux/err.h>
@@ -77,7 +77,7 @@ group_write(struct device_driver *drv, const char *buf, size_t count)
77 int len; 77 int len;
78 78
79 if (!(end = strchr(start, delim[i]))) 79 if (!(end = strchr(start, delim[i])))
80 return count; 80 return -EINVAL;
81 len = min_t(ptrdiff_t, BUS_ID_SIZE, end - start + 1); 81 len = min_t(ptrdiff_t, BUS_ID_SIZE, end - start + 1);
82 strlcpy (bus_ids[i], start, len); 82 strlcpy (bus_ids[i], start, len);
83 argv[i] = bus_ids[i]; 83 argv[i] = bus_ids[i];
@@ -94,7 +94,7 @@ static DRIVER_ATTR(group, 0200, NULL, group_write);
94 94
95/* Register-unregister for ctc&lcs */ 95/* Register-unregister for ctc&lcs */
96int 96int
97register_cu3088_discipline(struct ccwgroup_driver *dcp) 97register_cu3088_discipline(struct ccwgroup_driver *dcp)
98{ 98{
99 int rc; 99 int rc;
100 100
@@ -109,7 +109,7 @@ register_cu3088_discipline(struct ccwgroup_driver *dcp)
109 rc = driver_create_file(&dcp->driver, &driver_attr_group); 109 rc = driver_create_file(&dcp->driver, &driver_attr_group);
110 if (rc) 110 if (rc)
111 ccwgroup_driver_unregister(dcp); 111 ccwgroup_driver_unregister(dcp);
112 112
113 return rc; 113 return rc;
114 114
115} 115}
@@ -137,7 +137,7 @@ static int __init
137cu3088_init (void) 137cu3088_init (void)
138{ 138{
139 int rc; 139 int rc;
140 140
141 cu3088_root_dev = s390_root_dev_register("cu3088"); 141 cu3088_root_dev = s390_root_dev_register("cu3088");
142 if (IS_ERR(cu3088_root_dev)) 142 if (IS_ERR(cu3088_root_dev))
143 return PTR_ERR(cu3088_root_dev); 143 return PTR_ERR(cu3088_root_dev);
diff --git a/drivers/s390/net/iucv.c b/drivers/s390/net/iucv.c
index 6190be9dca99..e0c7deb98831 100644
--- a/drivers/s390/net/iucv.c
+++ b/drivers/s390/net/iucv.c
@@ -1,4 +1,4 @@
1/* 1/*
2 * IUCV network driver 2 * IUCV network driver
3 * 3 *
4 * Copyright (C) 2001 IBM Deutschland Entwicklung GmbH, IBM Corporation 4 * Copyright (C) 2001 IBM Deutschland Entwicklung GmbH, IBM Corporation
@@ -28,7 +28,7 @@
28 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 28 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
29 * 29 *
30 */ 30 */
31 31
32/* #define DEBUG */ 32/* #define DEBUG */
33 33
34#include <linux/module.h> 34#include <linux/module.h>
@@ -81,7 +81,7 @@ iucv_bus_match (struct device *dev, struct device_driver *drv)
81struct bus_type iucv_bus = { 81struct bus_type iucv_bus = {
82 .name = "iucv", 82 .name = "iucv",
83 .match = iucv_bus_match, 83 .match = iucv_bus_match,
84}; 84};
85 85
86struct device *iucv_root; 86struct device *iucv_root;
87 87
@@ -297,7 +297,7 @@ MODULE_LICENSE("GPL");
297/* 297/*
298 * Debugging stuff 298 * Debugging stuff
299 *******************************************************************************/ 299 *******************************************************************************/
300 300
301 301
302#ifdef DEBUG 302#ifdef DEBUG
303static int debuglevel = 0; 303static int debuglevel = 0;
@@ -344,7 +344,7 @@ do { \
344/* 344/*
345 * Internal functions 345 * Internal functions
346 *******************************************************************************/ 346 *******************************************************************************/
347 347
348/** 348/**
349 * print start banner 349 * print start banner
350 */ 350 */
@@ -810,7 +810,7 @@ iucv_register_program (__u8 pgmname[16],
810 sizeof (new_handler->id.userid)); 810 sizeof (new_handler->id.userid));
811 EBC_TOUPPER (new_handler->id.userid, 811 EBC_TOUPPER (new_handler->id.userid,
812 sizeof (new_handler->id.userid)); 812 sizeof (new_handler->id.userid));
813 813
814 if (pgmmask) { 814 if (pgmmask) {
815 memcpy (new_handler->id.mask, pgmmask, 815 memcpy (new_handler->id.mask, pgmmask,
816 sizeof (new_handler->id.mask)); 816 sizeof (new_handler->id.mask));
@@ -1229,7 +1229,7 @@ iucv_purge (__u16 pathid, __u32 msgid, __u32 srccls, __u32 *audit)
1229 /* parm->ipaudit has only 3 bytes */ 1229 /* parm->ipaudit has only 3 bytes */
1230 *audit >>= 8; 1230 *audit >>= 8;
1231 } 1231 }
1232 1232
1233 release_param(parm); 1233 release_param(parm);
1234 1234
1235 iucv_debug(1, "b2f0_result = %ld", b2f0_result); 1235 iucv_debug(1, "b2f0_result = %ld", b2f0_result);
@@ -2330,14 +2330,14 @@ iucv_do_int(iucv_GeneralInterrupt * int_buf)
2330 temp_buff1[j] &= (h->id.mask)[j]; 2330 temp_buff1[j] &= (h->id.mask)[j];
2331 temp_buff2[j] &= (h->id.mask)[j]; 2331 temp_buff2[j] &= (h->id.mask)[j];
2332 } 2332 }
2333 2333
2334 iucv_dumpit("temp_buff1:", 2334 iucv_dumpit("temp_buff1:",
2335 temp_buff1, sizeof(temp_buff1)); 2335 temp_buff1, sizeof(temp_buff1));
2336 iucv_dumpit("temp_buff2", 2336 iucv_dumpit("temp_buff2",
2337 temp_buff2, sizeof(temp_buff2)); 2337 temp_buff2, sizeof(temp_buff2));
2338 2338
2339 if (!memcmp (temp_buff1, temp_buff2, 24)) { 2339 if (!memcmp (temp_buff1, temp_buff2, 24)) {
2340 2340
2341 iucv_debug(2, 2341 iucv_debug(2,
2342 "found a matching handler"); 2342 "found a matching handler");
2343 break; 2343 break;
@@ -2368,7 +2368,7 @@ iucv_do_int(iucv_GeneralInterrupt * int_buf)
2368 } else 2368 } else
2369 iucv_sever(int_buf->ippathid, no_listener); 2369 iucv_sever(int_buf->ippathid, no_listener);
2370 break; 2370 break;
2371 2371
2372 case 0x02: /*connection complete */ 2372 case 0x02: /*connection complete */
2373 if (messagesDisabled) { 2373 if (messagesDisabled) {
2374 iucv_setmask(~0); 2374 iucv_setmask(~0);
@@ -2387,7 +2387,7 @@ iucv_do_int(iucv_GeneralInterrupt * int_buf)
2387 } else 2387 } else
2388 iucv_sever(int_buf->ippathid, no_listener); 2388 iucv_sever(int_buf->ippathid, no_listener);
2389 break; 2389 break;
2390 2390
2391 case 0x03: /* connection severed */ 2391 case 0x03: /* connection severed */
2392 if (messagesDisabled) { 2392 if (messagesDisabled) {
2393 iucv_setmask(~0); 2393 iucv_setmask(~0);
@@ -2398,13 +2398,13 @@ iucv_do_int(iucv_GeneralInterrupt * int_buf)
2398 interrupt->ConnectionSevered( 2398 interrupt->ConnectionSevered(
2399 (iucv_ConnectionSevered *)int_buf, 2399 (iucv_ConnectionSevered *)int_buf,
2400 h->pgm_data); 2400 h->pgm_data);
2401 2401
2402 else 2402 else
2403 iucv_sever (int_buf->ippathid, no_listener); 2403 iucv_sever (int_buf->ippathid, no_listener);
2404 } else 2404 } else
2405 iucv_sever(int_buf->ippathid, no_listener); 2405 iucv_sever(int_buf->ippathid, no_listener);
2406 break; 2406 break;
2407 2407
2408 case 0x04: /* connection quiesced */ 2408 case 0x04: /* connection quiesced */
2409 if (messagesDisabled) { 2409 if (messagesDisabled) {
2410 iucv_setmask(~0); 2410 iucv_setmask(~0);
@@ -2420,7 +2420,7 @@ iucv_do_int(iucv_GeneralInterrupt * int_buf)
2420 "ConnectionQuiesced not called"); 2420 "ConnectionQuiesced not called");
2421 } 2421 }
2422 break; 2422 break;
2423 2423
2424 case 0x05: /* connection resumed */ 2424 case 0x05: /* connection resumed */
2425 if (messagesDisabled) { 2425 if (messagesDisabled) {
2426 iucv_setmask(~0); 2426 iucv_setmask(~0);
@@ -2436,7 +2436,7 @@ iucv_do_int(iucv_GeneralInterrupt * int_buf)
2436 "ConnectionResumed not called"); 2436 "ConnectionResumed not called");
2437 } 2437 }
2438 break; 2438 break;
2439 2439
2440 case 0x06: /* priority message complete */ 2440 case 0x06: /* priority message complete */
2441 case 0x07: /* nonpriority message complete */ 2441 case 0x07: /* nonpriority message complete */
2442 if (h) { 2442 if (h) {
@@ -2449,7 +2449,7 @@ iucv_do_int(iucv_GeneralInterrupt * int_buf)
2449 "MessageComplete not called"); 2449 "MessageComplete not called");
2450 } 2450 }
2451 break; 2451 break;
2452 2452
2453 case 0x08: /* priority message pending */ 2453 case 0x08: /* priority message pending */
2454 case 0x09: /* nonpriority message pending */ 2454 case 0x09: /* nonpriority message pending */
2455 if (h) { 2455 if (h) {
@@ -2467,7 +2467,7 @@ iucv_do_int(iucv_GeneralInterrupt * int_buf)
2467 __FUNCTION__); 2467 __FUNCTION__);
2468 break; 2468 break;
2469 } /* end switch */ 2469 } /* end switch */
2470 2470
2471 iucv_debug(2, "exiting pathid %d, type %02X", 2471 iucv_debug(2, "exiting pathid %d, type %02X",
2472 int_buf->ippathid, int_buf->iptype); 2472 int_buf->ippathid, int_buf->iptype);
2473 2473
diff --git a/drivers/s390/net/iucv.h b/drivers/s390/net/iucv.h
index 0c4644d3d2f3..5b6b1b7241c9 100644
--- a/drivers/s390/net/iucv.h
+++ b/drivers/s390/net/iucv.h
@@ -4,7 +4,7 @@
4 * 4 *
5 * S390 version 5 * S390 version
6 * Copyright (C) 2000 IBM Corporation 6 * Copyright (C) 2000 IBM Corporation
7 * Author(s):Alan Altmark (Alan_Altmark@us.ibm.com) 7 * Author(s):Alan Altmark (Alan_Altmark@us.ibm.com)
8 * Xenia Tkatschow (xenia@us.ibm.com) 8 * Xenia Tkatschow (xenia@us.ibm.com)
9 * 9 *
10 * 10 *
@@ -16,17 +16,17 @@
16 * CP Programming Services book, also available on the web 16 * CP Programming Services book, also available on the web
17 * thru www.ibm.com/s390/vm/pubs, manual # SC24-5760 17 * thru www.ibm.com/s390/vm/pubs, manual # SC24-5760
18 * 18 *
19 * Definition of Return Codes 19 * Definition of Return Codes
20 * -All positive return codes including zero are reflected back 20 * -All positive return codes including zero are reflected back
21 * from CP except for iucv_register_program. The definition of each 21 * from CP except for iucv_register_program. The definition of each
22 * return code can be found in CP Programming Services book. 22 * return code can be found in CP Programming Services book.
23 * Also available on the web thru www.ibm.com/s390/vm/pubs, manual # SC24-5760 23 * Also available on the web thru www.ibm.com/s390/vm/pubs, manual # SC24-5760
24 * - Return Code of: 24 * - Return Code of:
25 * (-EINVAL) Invalid value 25 * (-EINVAL) Invalid value
26 * (-ENOMEM) storage allocation failed 26 * (-ENOMEM) storage allocation failed
27 * pgmask defined in iucv_register_program will be set depending on input 27 * pgmask defined in iucv_register_program will be set depending on input
28 * paramters. 28 * paramters.
29 * 29 *
30 */ 30 */
31 31
32#include <linux/types.h> 32#include <linux/types.h>
@@ -124,13 +124,13 @@ iucv_hex_dump(unsigned char *buf, size_t len)
124#define iucv_handle_t void * 124#define iucv_handle_t void *
125 125
126/* flags1: 126/* flags1:
127 * All flags are defined in the field IPFLAGS1 of each function 127 * All flags are defined in the field IPFLAGS1 of each function
128 * and can be found in CP Programming Services. 128 * and can be found in CP Programming Services.
129 * IPLOCAL - Indicates the connect can only be satisfied on the 129 * IPLOCAL - Indicates the connect can only be satisfied on the
130 * local system 130 * local system
131 * IPPRTY - Indicates a priority message 131 * IPPRTY - Indicates a priority message
132 * IPQUSCE - Indicates you do not want to receive messages on a 132 * IPQUSCE - Indicates you do not want to receive messages on a
133 * path until an iucv_resume is issued 133 * path until an iucv_resume is issued
134 * IPRMDATA - Indicates that the message is in the parameter list 134 * IPRMDATA - Indicates that the message is in the parameter list
135 */ 135 */
136#define IPLOCAL 0x01 136#define IPLOCAL 0x01
@@ -154,14 +154,14 @@ iucv_hex_dump(unsigned char *buf, size_t len)
154#define AllInterrupts 0xf8 154#define AllInterrupts 0xf8
155/* 155/*
156 * Mapping of external interrupt buffers should be used with the corresponding 156 * Mapping of external interrupt buffers should be used with the corresponding
157 * interrupt types. 157 * interrupt types.
158 * Names: iucv_ConnectionPending -> connection pending 158 * Names: iucv_ConnectionPending -> connection pending
159 * iucv_ConnectionComplete -> connection complete 159 * iucv_ConnectionComplete -> connection complete
160 * iucv_ConnectionSevered -> connection severed 160 * iucv_ConnectionSevered -> connection severed
161 * iucv_ConnectionQuiesced -> connection quiesced 161 * iucv_ConnectionQuiesced -> connection quiesced
162 * iucv_ConnectionResumed -> connection resumed 162 * iucv_ConnectionResumed -> connection resumed
163 * iucv_MessagePending -> message pending 163 * iucv_MessagePending -> message pending
164 * iucv_MessageComplete -> message complete 164 * iucv_MessageComplete -> message complete
165 */ 165 */
166typedef struct { 166typedef struct {
167 u16 ippathid; 167 u16 ippathid;
@@ -260,16 +260,16 @@ typedef struct {
260 uchar res2[3]; 260 uchar res2[3];
261} iucv_MessageComplete; 261} iucv_MessageComplete;
262 262
263/* 263/*
264 * iucv_interrupt_ops_t: Is a vector of functions that handle 264 * iucv_interrupt_ops_t: Is a vector of functions that handle
265 * IUCV interrupts. 265 * IUCV interrupts.
266 * Parameter list: 266 * Parameter list:
267 * eib - is a pointer to a 40-byte area described 267 * eib - is a pointer to a 40-byte area described
268 * with one of the structures above. 268 * with one of the structures above.
269 * pgm_data - this data is strictly for the 269 * pgm_data - this data is strictly for the
270 * interrupt handler that is passed by 270 * interrupt handler that is passed by
271 * the application. This may be an address 271 * the application. This may be an address
272 * or token. 272 * or token.
273*/ 273*/
274typedef struct { 274typedef struct {
275 void (*ConnectionPending) (iucv_ConnectionPending * eib, 275 void (*ConnectionPending) (iucv_ConnectionPending * eib,
@@ -287,8 +287,8 @@ typedef struct {
287} iucv_interrupt_ops_t; 287} iucv_interrupt_ops_t;
288 288
289/* 289/*
290 *iucv_array_t : Defines buffer array. 290 *iucv_array_t : Defines buffer array.
291 * Inside the array may be 31- bit addresses and 31-bit lengths. 291 * Inside the array may be 31- bit addresses and 31-bit lengths.
292*/ 292*/
293typedef struct { 293typedef struct {
294 u32 address; 294 u32 address;
@@ -299,19 +299,19 @@ extern struct bus_type iucv_bus;
299extern struct device *iucv_root; 299extern struct device *iucv_root;
300 300
301/* -prototypes- */ 301/* -prototypes- */
302/* 302/*
303 * Name: iucv_register_program 303 * Name: iucv_register_program
304 * Purpose: Registers an application with IUCV 304 * Purpose: Registers an application with IUCV
305 * Input: prmname - user identification 305 * Input: prmname - user identification
306 * userid - machine identification 306 * userid - machine identification
307 * pgmmask - indicates which bits in the prmname and userid combined will be 307 * pgmmask - indicates which bits in the prmname and userid combined will be
308 * used to determine who is given control 308 * used to determine who is given control
309 * ops - address of vector of interrupt handlers 309 * ops - address of vector of interrupt handlers
310 * pgm_data- application data passed to interrupt handlers 310 * pgm_data- application data passed to interrupt handlers
311 * Output: NA 311 * Output: NA
312 * Return: address of handler 312 * Return: address of handler
313 * (0) - Error occurred, registration not completed. 313 * (0) - Error occurred, registration not completed.
314 * NOTE: Exact cause of failure will be recorded in syslog. 314 * NOTE: Exact cause of failure will be recorded in syslog.
315*/ 315*/
316iucv_handle_t iucv_register_program (uchar pgmname[16], 316iucv_handle_t iucv_register_program (uchar pgmname[16],
317 uchar userid[8], 317 uchar userid[8],
@@ -319,13 +319,13 @@ iucv_handle_t iucv_register_program (uchar pgmname[16],
319 iucv_interrupt_ops_t * ops, 319 iucv_interrupt_ops_t * ops,
320 void *pgm_data); 320 void *pgm_data);
321 321
322/* 322/*
323 * Name: iucv_unregister_program 323 * Name: iucv_unregister_program
324 * Purpose: Unregister application with IUCV 324 * Purpose: Unregister application with IUCV
325 * Input: address of handler 325 * Input: address of handler
326 * Output: NA 326 * Output: NA
327 * Return: (0) - Normal return 327 * Return: (0) - Normal return
328 * (-EINVAL) - Internal error, wild pointer 328 * (-EINVAL) - Internal error, wild pointer
329*/ 329*/
330int iucv_unregister_program (iucv_handle_t handle); 330int iucv_unregister_program (iucv_handle_t handle);
331 331
@@ -333,7 +333,7 @@ int iucv_unregister_program (iucv_handle_t handle);
333 * Name: iucv_accept 333 * Name: iucv_accept
334 * Purpose: This function is issued after the user receives a Connection Pending external 334 * Purpose: This function is issued after the user receives a Connection Pending external
335 * interrupt and now wishes to complete the IUCV communication path. 335 * interrupt and now wishes to complete the IUCV communication path.
336 * Input: pathid - u16 , Path identification number 336 * Input: pathid - u16 , Path identification number
337 * msglim_reqstd - u16, The number of outstanding messages requested. 337 * msglim_reqstd - u16, The number of outstanding messages requested.
338 * user_data - uchar[16], Data specified by the iucv_connect function. 338 * user_data - uchar[16], Data specified by the iucv_connect function.
339 * flags1 - int, Contains options for this path. 339 * flags1 - int, Contains options for this path.
@@ -358,34 +358,34 @@ int iucv_accept (u16 pathid,
358 void *pgm_data, int *flags1_out, u16 * msglim); 358 void *pgm_data, int *flags1_out, u16 * msglim);
359 359
360/* 360/*
361 * Name: iucv_connect 361 * Name: iucv_connect
362 * Purpose: This function establishes an IUCV path. Although the connect may complete 362 * Purpose: This function establishes an IUCV path. Although the connect may complete
363 * successfully, you are not able to use the path until you receive an IUCV 363 * successfully, you are not able to use the path until you receive an IUCV
364 * Connection Complete external interrupt. 364 * Connection Complete external interrupt.
365 * Input: pathid - u16 *, Path identification number 365 * Input: pathid - u16 *, Path identification number
366 * msglim_reqstd - u16, Number of outstanding messages requested 366 * msglim_reqstd - u16, Number of outstanding messages requested
367 * user_data - uchar[16], 16-byte user data 367 * user_data - uchar[16], 16-byte user data
368 * userid - uchar[8], User identification 368 * userid - uchar[8], User identification
369 * system_name - uchar[8], 8-byte identifying the system name 369 * system_name - uchar[8], 8-byte identifying the system name
370 * flags1 - int, Contains options for this path. 370 * flags1 - int, Contains options for this path.
371 * -IPPRTY - 0x20, Specifies if you want to send priority message. 371 * -IPPRTY - 0x20, Specifies if you want to send priority message.
372 * -IPRMDATA - 0x80, Specifies whether your program can handle a message 372 * -IPRMDATA - 0x80, Specifies whether your program can handle a message
373 * in the parameter list. 373 * in the parameter list.
374 * -IPQUSCE - 0x40, Specifies whether you want to quiesce the path being 374 * -IPQUSCE - 0x40, Specifies whether you want to quiesce the path being
375 * established. 375 * established.
376 * -IPLOCAL - 0X01, Allows an application to force the partner to be on 376 * -IPLOCAL - 0X01, Allows an application to force the partner to be on
377 * the local system. If local is specified then target class cannot be 377 * the local system. If local is specified then target class cannot be
378 * specified. 378 * specified.
379 * flags1_out - int * Contains information about the path 379 * flags1_out - int * Contains information about the path
380 * - IPPRTY - 0x20, Indicates you may send priority messages. 380 * - IPPRTY - 0x20, Indicates you may send priority messages.
381 * msglim - * u16, Number of outstanding messages 381 * msglim - * u16, Number of outstanding messages
382 * handle - iucv_handle_t, Address of handler 382 * handle - iucv_handle_t, Address of handler
383 * pgm_data - void *, Application data passed to interrupt handlers 383 * pgm_data - void *, Application data passed to interrupt handlers
384 * Output: return code from CP IUCV call 384 * Output: return code from CP IUCV call
385 * rc - return code from iucv_declare_buffer 385 * rc - return code from iucv_declare_buffer
386 * -EINVAL - Invalid handle passed by application 386 * -EINVAL - Invalid handle passed by application
387 * -EINVAL - Pathid address is NULL 387 * -EINVAL - Pathid address is NULL
388 * add_pathid_result - Return code from internal function add_pathid 388 * add_pathid_result - Return code from internal function add_pathid
389*/ 389*/
390int 390int
391 iucv_connect (u16 * pathid, 391 iucv_connect (u16 * pathid,
@@ -397,16 +397,16 @@ int
397 int *flags1_out, 397 int *flags1_out,
398 u16 * msglim, iucv_handle_t handle, void *pgm_data); 398 u16 * msglim, iucv_handle_t handle, void *pgm_data);
399 399
400/* 400/*
401 * Name: iucv_purge 401 * Name: iucv_purge
402 * Purpose: This function cancels a message that you have sent. 402 * Purpose: This function cancels a message that you have sent.
403 * Input: pathid - Path identification number. 403 * Input: pathid - Path identification number.
404 * msgid - Specifies the message ID of the message to be purged. 404 * msgid - Specifies the message ID of the message to be purged.
405 * srccls - Specifies the source message class. 405 * srccls - Specifies the source message class.
406 * Output: audit - Contains information about asynchronous error 406 * Output: audit - Contains information about asynchronous error
407 * that may have affected the normal completion 407 * that may have affected the normal completion
408 * of this message. 408 * of this message.
409 * Return: Return code from CP IUCV call. 409 * Return: Return code from CP IUCV call.
410*/ 410*/
411int iucv_purge (u16 pathid, u32 msgid, u32 srccls, __u32 *audit); 411int iucv_purge (u16 pathid, u32 msgid, u32 srccls, __u32 *audit);
412/* 412/*
@@ -426,38 +426,38 @@ ulong iucv_query_maxconn (void);
426 */ 426 */
427ulong iucv_query_bufsize (void); 427ulong iucv_query_bufsize (void);
428 428
429/* 429/*
430 * Name: iucv_quiesce 430 * Name: iucv_quiesce
431 * Purpose: This function temporarily suspends incoming messages on an 431 * Purpose: This function temporarily suspends incoming messages on an
432 * IUCV path. You can later reactivate the path by invoking 432 * IUCV path. You can later reactivate the path by invoking
433 * the iucv_resume function. 433 * the iucv_resume function.
434 * Input: pathid - Path identification number 434 * Input: pathid - Path identification number
435 * user_data - 16-bytes of user data 435 * user_data - 16-bytes of user data
436 * Output: NA 436 * Output: NA
437 * Return: Return code from CP IUCV call. 437 * Return: Return code from CP IUCV call.
438*/ 438*/
439int iucv_quiesce (u16 pathid, uchar user_data[16]); 439int iucv_quiesce (u16 pathid, uchar user_data[16]);
440 440
441/* 441/*
442 * Name: iucv_receive 442 * Name: iucv_receive
443 * Purpose: This function receives messages that are being sent to you 443 * Purpose: This function receives messages that are being sent to you
444 * over established paths. Data will be returned in buffer for length of 444 * over established paths. Data will be returned in buffer for length of
445 * buflen. 445 * buflen.
446 * Input: 446 * Input:
447 * pathid - Path identification number. 447 * pathid - Path identification number.
448 * buffer - Address of buffer to receive. 448 * buffer - Address of buffer to receive.
449 * buflen - Length of buffer to receive. 449 * buflen - Length of buffer to receive.
450 * msgid - Specifies the message ID. 450 * msgid - Specifies the message ID.
451 * trgcls - Specifies target class. 451 * trgcls - Specifies target class.
452 * Output: 452 * Output:
453 * flags1_out: int *, Contains information about this path. 453 * flags1_out: int *, Contains information about this path.
454 * IPNORPY - 0x10 Specifies this is a one-way message and no reply is 454 * IPNORPY - 0x10 Specifies this is a one-way message and no reply is
455 * expected. 455 * expected.
456 * IPPRTY - 0x20 Specifies if you want to send priority message. 456 * IPPRTY - 0x20 Specifies if you want to send priority message.
457 * IPRMDATA - 0x80 specifies the data is contained in the parameter list 457 * IPRMDATA - 0x80 specifies the data is contained in the parameter list
458 * residual_buffer - address of buffer updated by the number 458 * residual_buffer - address of buffer updated by the number
459 * of bytes you have received. 459 * of bytes you have received.
460 * residual_length - 460 * residual_length -
461 * Contains one of the following values, if the receive buffer is: 461 * Contains one of the following values, if the receive buffer is:
462 * The same length as the message, this field is zero. 462 * The same length as the message, this field is zero.
463 * Longer than the message, this field contains the number of 463 * Longer than the message, this field contains the number of
@@ -466,8 +466,8 @@ int iucv_quiesce (u16 pathid, uchar user_data[16]);
466 * count (that is, the number of bytes remaining in the 466 * count (that is, the number of bytes remaining in the
467 * message that does not fit into the buffer. In this 467 * message that does not fit into the buffer. In this
468 * case b2f0_result = 5. 468 * case b2f0_result = 5.
469 * Return: Return code from CP IUCV call. 469 * Return: Return code from CP IUCV call.
470 * (-EINVAL) - buffer address is pointing to NULL 470 * (-EINVAL) - buffer address is pointing to NULL
471*/ 471*/
472int iucv_receive (u16 pathid, 472int iucv_receive (u16 pathid,
473 u32 msgid, 473 u32 msgid,
@@ -477,16 +477,16 @@ int iucv_receive (u16 pathid,
477 int *flags1_out, 477 int *flags1_out,
478 ulong * residual_buffer, ulong * residual_length); 478 ulong * residual_buffer, ulong * residual_length);
479 479
480 /* 480 /*
481 * Name: iucv_receive_array 481 * Name: iucv_receive_array
482 * Purpose: This function receives messages that are being sent to you 482 * Purpose: This function receives messages that are being sent to you
483 * over established paths. Data will be returned in first buffer for 483 * over established paths. Data will be returned in first buffer for
484 * length of first buffer. 484 * length of first buffer.
485 * Input: pathid - Path identification number. 485 * Input: pathid - Path identification number.
486 * msgid - specifies the message ID. 486 * msgid - specifies the message ID.
487 * trgcls - Specifies target class. 487 * trgcls - Specifies target class.
488 * buffer - Address of array of buffers. 488 * buffer - Address of array of buffers.
489 * buflen - Total length of buffers. 489 * buflen - Total length of buffers.
490 * Output: 490 * Output:
491 * flags1_out: int *, Contains information about this path. 491 * flags1_out: int *, Contains information about this path.
492 * IPNORPY - 0x10 Specifies this is a one-way message and no reply is 492 * IPNORPY - 0x10 Specifies this is a one-way message and no reply is
@@ -504,8 +504,8 @@ int iucv_receive (u16 pathid,
504 * count (that is, the number of bytes remaining in the 504 * count (that is, the number of bytes remaining in the
505 * message that does not fit into the buffer. In this 505 * message that does not fit into the buffer. In this
506 * case b2f0_result = 5. 506 * case b2f0_result = 5.
507 * Return: Return code from CP IUCV call. 507 * Return: Return code from CP IUCV call.
508 * (-EINVAL) - Buffer address is NULL. 508 * (-EINVAL) - Buffer address is NULL.
509 */ 509 */
510int iucv_receive_array (u16 pathid, 510int iucv_receive_array (u16 pathid,
511 u32 msgid, 511 u32 msgid,
@@ -515,44 +515,44 @@ int iucv_receive_array (u16 pathid,
515 int *flags1_out, 515 int *flags1_out,
516 ulong * residual_buffer, ulong * residual_length); 516 ulong * residual_buffer, ulong * residual_length);
517 517
518/* 518/*
519 * Name: iucv_reject 519 * Name: iucv_reject
520 * Purpose: The reject function refuses a specified message. Between the 520 * Purpose: The reject function refuses a specified message. Between the
521 * time you are notified of a message and the time that you 521 * time you are notified of a message and the time that you
522 * complete the message, the message may be rejected. 522 * complete the message, the message may be rejected.
523 * Input: pathid - Path identification number. 523 * Input: pathid - Path identification number.
524 * msgid - Specifies the message ID. 524 * msgid - Specifies the message ID.
525 * trgcls - Specifies target class. 525 * trgcls - Specifies target class.
526 * Output: NA 526 * Output: NA
527 * Return: Return code from CP IUCV call. 527 * Return: Return code from CP IUCV call.
528*/ 528*/
529int iucv_reject (u16 pathid, u32 msgid, u32 trgcls); 529int iucv_reject (u16 pathid, u32 msgid, u32 trgcls);
530 530
531/* 531/*
532 * Name: iucv_reply 532 * Name: iucv_reply
533 * Purpose: This function responds to the two-way messages that you 533 * Purpose: This function responds to the two-way messages that you
534 * receive. You must identify completely the message to 534 * receive. You must identify completely the message to
535 * which you wish to reply. ie, pathid, msgid, and trgcls. 535 * which you wish to reply. ie, pathid, msgid, and trgcls.
536 * Input: pathid - Path identification number. 536 * Input: pathid - Path identification number.
537 * msgid - Specifies the message ID. 537 * msgid - Specifies the message ID.
538 * trgcls - Specifies target class. 538 * trgcls - Specifies target class.
539 * flags1 - Option for path. 539 * flags1 - Option for path.
540 * IPPRTY- 0x20, Specifies if you want to send priority message. 540 * IPPRTY- 0x20, Specifies if you want to send priority message.
541 * buffer - Address of reply buffer. 541 * buffer - Address of reply buffer.
542 * buflen - Length of reply buffer. 542 * buflen - Length of reply buffer.
543 * Output: residual_buffer - Address of buffer updated by the number 543 * Output: residual_buffer - Address of buffer updated by the number
544 * of bytes you have moved. 544 * of bytes you have moved.
545 * residual_length - Contains one of the following values: 545 * residual_length - Contains one of the following values:
546 * If the answer buffer is the same length as the reply, this field 546 * If the answer buffer is the same length as the reply, this field
547 * contains zero. 547 * contains zero.
548 * If the answer buffer is longer than the reply, this field contains 548 * If the answer buffer is longer than the reply, this field contains
549 * the number of bytes remaining in the buffer. 549 * the number of bytes remaining in the buffer.
550 * If the answer buffer is shorter than the reply, this field contains 550 * If the answer buffer is shorter than the reply, this field contains
551 * a residual count (that is, the number of bytes remianing in the 551 * a residual count (that is, the number of bytes remianing in the
552 * reply that does not fit into the buffer. In this 552 * reply that does not fit into the buffer. In this
553 * case b2f0_result = 5. 553 * case b2f0_result = 5.
554 * Return: Return code from CP IUCV call. 554 * Return: Return code from CP IUCV call.
555 * (-EINVAL) - Buffer address is NULL. 555 * (-EINVAL) - Buffer address is NULL.
556*/ 556*/
557int iucv_reply (u16 pathid, 557int iucv_reply (u16 pathid,
558 u32 msgid, 558 u32 msgid,
@@ -561,20 +561,20 @@ int iucv_reply (u16 pathid,
561 void *buffer, ulong buflen, ulong * residual_buffer, 561 void *buffer, ulong buflen, ulong * residual_buffer,
562 ulong * residual_length); 562 ulong * residual_length);
563 563
564/* 564/*
565 * Name: iucv_reply_array 565 * Name: iucv_reply_array
566 * Purpose: This function responds to the two-way messages that you 566 * Purpose: This function responds to the two-way messages that you
567 * receive. You must identify completely the message to 567 * receive. You must identify completely the message to
568 * which you wish to reply. ie, pathid, msgid, and trgcls. 568 * which you wish to reply. ie, pathid, msgid, and trgcls.
569 * The array identifies a list of addresses and lengths of 569 * The array identifies a list of addresses and lengths of
570 * discontiguous buffers that contains the reply data. 570 * discontiguous buffers that contains the reply data.
571 * Input: pathid - Path identification number 571 * Input: pathid - Path identification number
572 * msgid - Specifies the message ID. 572 * msgid - Specifies the message ID.
573 * trgcls - Specifies target class. 573 * trgcls - Specifies target class.
574 * flags1 - Option for path. 574 * flags1 - Option for path.
575 * IPPRTY- 0x20, Specifies if you want to send priority message. 575 * IPPRTY- 0x20, Specifies if you want to send priority message.
576 * buffer - Address of array of reply buffers. 576 * buffer - Address of array of reply buffers.
577 * buflen - Total length of reply buffers. 577 * buflen - Total length of reply buffers.
578 * Output: residual_buffer - Address of buffer which IUCV is currently working on. 578 * Output: residual_buffer - Address of buffer which IUCV is currently working on.
579 * residual_length - Contains one of the following values: 579 * residual_length - Contains one of the following values:
580 * If the answer buffer is the same length as the reply, this field 580 * If the answer buffer is the same length as the reply, this field
@@ -585,8 +585,8 @@ int iucv_reply (u16 pathid,
585 * a residual count (that is, the number of bytes remianing in the 585 * a residual count (that is, the number of bytes remianing in the
586 * reply that does not fit into the buffer. In this 586 * reply that does not fit into the buffer. In this
587 * case b2f0_result = 5. 587 * case b2f0_result = 5.
588 * Return: Return code from CP IUCV call. 588 * Return: Return code from CP IUCV call.
589 * (-EINVAL) - Buffer address is NULL. 589 * (-EINVAL) - Buffer address is NULL.
590*/ 590*/
591int iucv_reply_array (u16 pathid, 591int iucv_reply_array (u16 pathid,
592 u32 msgid, 592 u32 msgid,
@@ -596,77 +596,77 @@ int iucv_reply_array (u16 pathid,
596 ulong buflen, ulong * residual_address, 596 ulong buflen, ulong * residual_address,
597 ulong * residual_length); 597 ulong * residual_length);
598 598
599/* 599/*
600 * Name: iucv_reply_prmmsg 600 * Name: iucv_reply_prmmsg
601 * Purpose: This function responds to the two-way messages that you 601 * Purpose: This function responds to the two-way messages that you
602 * receive. You must identify completely the message to 602 * receive. You must identify completely the message to
603 * which you wish to reply. ie, pathid, msgid, and trgcls. 603 * which you wish to reply. ie, pathid, msgid, and trgcls.
604 * Prmmsg signifies the data is moved into the 604 * Prmmsg signifies the data is moved into the
605 * parameter list. 605 * parameter list.
606 * Input: pathid - Path identification number. 606 * Input: pathid - Path identification number.
607 * msgid - Specifies the message ID. 607 * msgid - Specifies the message ID.
608 * trgcls - Specifies target class. 608 * trgcls - Specifies target class.
609 * flags1 - Option for path. 609 * flags1 - Option for path.
610 * IPPRTY- 0x20 Specifies if you want to send priority message. 610 * IPPRTY- 0x20 Specifies if you want to send priority message.
611 * prmmsg - 8-bytes of data to be placed into the parameter. 611 * prmmsg - 8-bytes of data to be placed into the parameter.
612 * list. 612 * list.
613 * Output: NA 613 * Output: NA
614 * Return: Return code from CP IUCV call. 614 * Return: Return code from CP IUCV call.
615*/ 615*/
616int iucv_reply_prmmsg (u16 pathid, 616int iucv_reply_prmmsg (u16 pathid,
617 u32 msgid, u32 trgcls, int flags1, uchar prmmsg[8]); 617 u32 msgid, u32 trgcls, int flags1, uchar prmmsg[8]);
618 618
619/* 619/*
620 * Name: iucv_resume 620 * Name: iucv_resume
621 * Purpose: This function restores communications over a quiesced path 621 * Purpose: This function restores communications over a quiesced path
622 * Input: pathid - Path identification number. 622 * Input: pathid - Path identification number.
623 * user_data - 16-bytes of user data. 623 * user_data - 16-bytes of user data.
624 * Output: NA 624 * Output: NA
625 * Return: Return code from CP IUCV call. 625 * Return: Return code from CP IUCV call.
626*/ 626*/
627int iucv_resume (u16 pathid, uchar user_data[16]); 627int iucv_resume (u16 pathid, uchar user_data[16]);
628 628
629/* 629/*
630 * Name: iucv_send 630 * Name: iucv_send
631 * Purpose: This function transmits data to another application. 631 * Purpose: This function transmits data to another application.
632 * Data to be transmitted is in a buffer and this is a 632 * Data to be transmitted is in a buffer and this is a
633 * one-way message and the receiver will not reply to the 633 * one-way message and the receiver will not reply to the
634 * message. 634 * message.
635 * Input: pathid - Path identification number. 635 * Input: pathid - Path identification number.
636 * trgcls - Specifies target class. 636 * trgcls - Specifies target class.
637 * srccls - Specifies the source message class. 637 * srccls - Specifies the source message class.
638 * msgtag - Specifies a tag to be associated with the message. 638 * msgtag - Specifies a tag to be associated with the message.
639 * flags1 - Option for path. 639 * flags1 - Option for path.
640 * IPPRTY- 0x20 Specifies if you want to send priority message. 640 * IPPRTY- 0x20 Specifies if you want to send priority message.
641 * buffer - Address of send buffer. 641 * buffer - Address of send buffer.
642 * buflen - Length of send buffer. 642 * buflen - Length of send buffer.
643 * Output: msgid - Specifies the message ID. 643 * Output: msgid - Specifies the message ID.
644 * Return: Return code from CP IUCV call. 644 * Return: Return code from CP IUCV call.
645 * (-EINVAL) - Buffer address is NULL. 645 * (-EINVAL) - Buffer address is NULL.
646*/ 646*/
647int iucv_send (u16 pathid, 647int iucv_send (u16 pathid,
648 u32 * msgid, 648 u32 * msgid,
649 u32 trgcls, 649 u32 trgcls,
650 u32 srccls, u32 msgtag, int flags1, void *buffer, ulong buflen); 650 u32 srccls, u32 msgtag, int flags1, void *buffer, ulong buflen);
651 651
652/* 652/*
653 * Name: iucv_send_array 653 * Name: iucv_send_array
654 * Purpose: This function transmits data to another application. 654 * Purpose: This function transmits data to another application.
655 * The contents of buffer is the address of the array of 655 * The contents of buffer is the address of the array of
656 * addresses and lengths of discontiguous buffers that hold 656 * addresses and lengths of discontiguous buffers that hold
657 * the message text. This is a one-way message and the 657 * the message text. This is a one-way message and the
658 * receiver will not reply to the message. 658 * receiver will not reply to the message.
659 * Input: pathid - Path identification number. 659 * Input: pathid - Path identification number.
660 * trgcls - Specifies target class. 660 * trgcls - Specifies target class.
661 * srccls - Specifies the source message class. 661 * srccls - Specifies the source message class.
662 * msgtag - Specifies a tag to be associated witht the message. 662 * msgtag - Specifies a tag to be associated witht the message.
663 * flags1 - Option for path. 663 * flags1 - Option for path.
664 * IPPRTY- specifies if you want to send priority message. 664 * IPPRTY- specifies if you want to send priority message.
665 * buffer - Address of array of send buffers. 665 * buffer - Address of array of send buffers.
666 * buflen - Total length of send buffers. 666 * buflen - Total length of send buffers.
667 * Output: msgid - Specifies the message ID. 667 * Output: msgid - Specifies the message ID.
668 * Return: Return code from CP IUCV call. 668 * Return: Return code from CP IUCV call.
669 * (-EINVAL) - Buffer address is NULL. 669 * (-EINVAL) - Buffer address is NULL.
670*/ 670*/
671int iucv_send_array (u16 pathid, 671int iucv_send_array (u16 pathid,
672 u32 * msgid, 672 u32 * msgid,
@@ -675,48 +675,48 @@ int iucv_send_array (u16 pathid,
675 u32 msgtag, 675 u32 msgtag,
676 int flags1, iucv_array_t * buffer, ulong buflen); 676 int flags1, iucv_array_t * buffer, ulong buflen);
677 677
678/* 678/*
679 * Name: iucv_send_prmmsg 679 * Name: iucv_send_prmmsg
680 * Purpose: This function transmits data to another application. 680 * Purpose: This function transmits data to another application.
681 * Prmmsg specifies that the 8-bytes of data are to be moved 681 * Prmmsg specifies that the 8-bytes of data are to be moved
682 * into the parameter list. This is a one-way message and the 682 * into the parameter list. This is a one-way message and the
683 * receiver will not reply to the message. 683 * receiver will not reply to the message.
684 * Input: pathid - Path identification number. 684 * Input: pathid - Path identification number.
685 * trgcls - Specifies target class. 685 * trgcls - Specifies target class.
686 * srccls - Specifies the source message class. 686 * srccls - Specifies the source message class.
687 * msgtag - Specifies a tag to be associated with the message. 687 * msgtag - Specifies a tag to be associated with the message.
688 * flags1 - Option for path. 688 * flags1 - Option for path.
689 * IPPRTY- 0x20 specifies if you want to send priority message. 689 * IPPRTY- 0x20 specifies if you want to send priority message.
690 * prmmsg - 8-bytes of data to be placed into parameter list. 690 * prmmsg - 8-bytes of data to be placed into parameter list.
691 * Output: msgid - Specifies the message ID. 691 * Output: msgid - Specifies the message ID.
692 * Return: Return code from CP IUCV call. 692 * Return: Return code from CP IUCV call.
693*/ 693*/
694int iucv_send_prmmsg (u16 pathid, 694int iucv_send_prmmsg (u16 pathid,
695 u32 * msgid, 695 u32 * msgid,
696 u32 trgcls, 696 u32 trgcls,
697 u32 srccls, u32 msgtag, int flags1, uchar prmmsg[8]); 697 u32 srccls, u32 msgtag, int flags1, uchar prmmsg[8]);
698 698
699/* 699/*
700 * Name: iucv_send2way 700 * Name: iucv_send2way
701 * Purpose: This function transmits data to another application. 701 * Purpose: This function transmits data to another application.
702 * Data to be transmitted is in a buffer. The receiver 702 * Data to be transmitted is in a buffer. The receiver
703 * of the send is expected to reply to the message and 703 * of the send is expected to reply to the message and
704 * a buffer is provided into which IUCV moves the reply 704 * a buffer is provided into which IUCV moves the reply
705 * to this message. 705 * to this message.
706 * Input: pathid - Path identification number. 706 * Input: pathid - Path identification number.
707 * trgcls - Specifies target class. 707 * trgcls - Specifies target class.
708 * srccls - Specifies the source message class. 708 * srccls - Specifies the source message class.
709 * msgtag - Specifies a tag associated with the message. 709 * msgtag - Specifies a tag associated with the message.
710 * flags1 - Option for path. 710 * flags1 - Option for path.
711 * IPPRTY- 0x20 Specifies if you want to send priority message. 711 * IPPRTY- 0x20 Specifies if you want to send priority message.
712 * buffer - Address of send buffer. 712 * buffer - Address of send buffer.
713 * buflen - Length of send buffer. 713 * buflen - Length of send buffer.
714 * ansbuf - Address of buffer into which IUCV moves the reply of 714 * ansbuf - Address of buffer into which IUCV moves the reply of
715 * this message. 715 * this message.
716 * anslen - Address of length of buffer. 716 * anslen - Address of length of buffer.
717 * Output: msgid - Specifies the message ID. 717 * Output: msgid - Specifies the message ID.
718 * Return: Return code from CP IUCV call. 718 * Return: Return code from CP IUCV call.
719 * (-EINVAL) - Buffer or ansbuf address is NULL. 719 * (-EINVAL) - Buffer or ansbuf address is NULL.
720*/ 720*/
721int iucv_send2way (u16 pathid, 721int iucv_send2way (u16 pathid,
722 u32 * msgid, 722 u32 * msgid,
@@ -726,28 +726,28 @@ int iucv_send2way (u16 pathid,
726 int flags1, 726 int flags1,
727 void *buffer, ulong buflen, void *ansbuf, ulong anslen); 727 void *buffer, ulong buflen, void *ansbuf, ulong anslen);
728 728
729/* 729/*
730 * Name: iucv_send2way_array 730 * Name: iucv_send2way_array
731 * Purpose: This function transmits data to another application. 731 * Purpose: This function transmits data to another application.
732 * The contents of buffer is the address of the array of 732 * The contents of buffer is the address of the array of
733 * addresses and lengths of discontiguous buffers that hold 733 * addresses and lengths of discontiguous buffers that hold
734 * the message text. The receiver of the send is expected to 734 * the message text. The receiver of the send is expected to
735 * reply to the message and a buffer is provided into which 735 * reply to the message and a buffer is provided into which
736 * IUCV moves the reply to this message. 736 * IUCV moves the reply to this message.
737 * Input: pathid - Path identification number. 737 * Input: pathid - Path identification number.
738 * trgcls - Specifies target class. 738 * trgcls - Specifies target class.
739 * srccls - Specifies the source message class. 739 * srccls - Specifies the source message class.
740 * msgtag - Specifies a tag to be associated with the message. 740 * msgtag - Specifies a tag to be associated with the message.
741 * flags1 - Option for path. 741 * flags1 - Option for path.
742 * IPPRTY- 0x20 Specifies if you want to send priority message. 742 * IPPRTY- 0x20 Specifies if you want to send priority message.
743 * buffer - Sddress of array of send buffers. 743 * buffer - Sddress of array of send buffers.
744 * buflen - Total length of send buffers. 744 * buflen - Total length of send buffers.
745 * ansbuf - Address of array of buffer into which IUCV moves the reply 745 * ansbuf - Address of array of buffer into which IUCV moves the reply
746 * of this message. 746 * of this message.
747 * anslen - Address of length reply buffers. 747 * anslen - Address of length reply buffers.
748 * Output: msgid - Specifies the message ID. 748 * Output: msgid - Specifies the message ID.
749 * Return: Return code from CP IUCV call. 749 * Return: Return code from CP IUCV call.
750 * (-EINVAL) - Buffer address is NULL. 750 * (-EINVAL) - Buffer address is NULL.
751*/ 751*/
752int iucv_send2way_array (u16 pathid, 752int iucv_send2way_array (u16 pathid,
753 u32 * msgid, 753 u32 * msgid,
@@ -758,27 +758,27 @@ int iucv_send2way_array (u16 pathid,
758 iucv_array_t * buffer, 758 iucv_array_t * buffer,
759 ulong buflen, iucv_array_t * ansbuf, ulong anslen); 759 ulong buflen, iucv_array_t * ansbuf, ulong anslen);
760 760
761/* 761/*
762 * Name: iucv_send2way_prmmsg 762 * Name: iucv_send2way_prmmsg
763 * Purpose: This function transmits data to another application. 763 * Purpose: This function transmits data to another application.
764 * Prmmsg specifies that the 8-bytes of data are to be moved 764 * Prmmsg specifies that the 8-bytes of data are to be moved
765 * into the parameter list. This is a two-way message and the 765 * into the parameter list. This is a two-way message and the
766 * receiver of the message is expected to reply. A buffer 766 * receiver of the message is expected to reply. A buffer
767 * is provided into which IUCV moves the reply to this 767 * is provided into which IUCV moves the reply to this
768 * message. 768 * message.
769 * Input: pathid - Rath identification number. 769 * Input: pathid - Rath identification number.
770 * trgcls - Specifies target class. 770 * trgcls - Specifies target class.
771 * srccls - Specifies the source message class. 771 * srccls - Specifies the source message class.
772 * msgtag - Specifies a tag to be associated with the message. 772 * msgtag - Specifies a tag to be associated with the message.
773 * flags1 - Option for path. 773 * flags1 - Option for path.
774 * IPPRTY- 0x20 Specifies if you want to send priority message. 774 * IPPRTY- 0x20 Specifies if you want to send priority message.
775 * prmmsg - 8-bytes of data to be placed in parameter list. 775 * prmmsg - 8-bytes of data to be placed in parameter list.
776 * ansbuf - Address of buffer into which IUCV moves the reply of 776 * ansbuf - Address of buffer into which IUCV moves the reply of
777 * this message. 777 * this message.
778 * anslen - Address of length of buffer. 778 * anslen - Address of length of buffer.
779 * Output: msgid - Specifies the message ID. 779 * Output: msgid - Specifies the message ID.
780 * Return: Return code from CP IUCV call. 780 * Return: Return code from CP IUCV call.
781 * (-EINVAL) - Buffer address is NULL. 781 * (-EINVAL) - Buffer address is NULL.
782*/ 782*/
783int iucv_send2way_prmmsg (u16 pathid, 783int iucv_send2way_prmmsg (u16 pathid,
784 u32 * msgid, 784 u32 * msgid,
@@ -788,29 +788,29 @@ int iucv_send2way_prmmsg (u16 pathid,
788 ulong flags1, 788 ulong flags1,
789 uchar prmmsg[8], void *ansbuf, ulong anslen); 789 uchar prmmsg[8], void *ansbuf, ulong anslen);
790 790
791/* 791/*
792 * Name: iucv_send2way_prmmsg_array 792 * Name: iucv_send2way_prmmsg_array
793 * Purpose: This function transmits data to another application. 793 * Purpose: This function transmits data to another application.
794 * Prmmsg specifies that the 8-bytes of data are to be moved 794 * Prmmsg specifies that the 8-bytes of data are to be moved
795 * into the parameter list. This is a two-way message and the 795 * into the parameter list. This is a two-way message and the
796 * receiver of the message is expected to reply. A buffer 796 * receiver of the message is expected to reply. A buffer
797 * is provided into which IUCV moves the reply to this 797 * is provided into which IUCV moves the reply to this
798 * message. The contents of ansbuf is the address of the 798 * message. The contents of ansbuf is the address of the
799 * array of addresses and lengths of discontiguous buffers 799 * array of addresses and lengths of discontiguous buffers
800 * that contain the reply. 800 * that contain the reply.
801 * Input: pathid - Path identification number. 801 * Input: pathid - Path identification number.
802 * trgcls - Specifies target class. 802 * trgcls - Specifies target class.
803 * srccls - Specifies the source message class. 803 * srccls - Specifies the source message class.
804 * msgtag - Specifies a tag to be associated with the message. 804 * msgtag - Specifies a tag to be associated with the message.
805 * flags1 - Option for path. 805 * flags1 - Option for path.
806 * IPPRTY- 0x20 specifies if you want to send priority message. 806 * IPPRTY- 0x20 specifies if you want to send priority message.
807 * prmmsg - 8-bytes of data to be placed into the parameter list. 807 * prmmsg - 8-bytes of data to be placed into the parameter list.
808 * ansbuf - Address of array of buffer into which IUCV moves the reply 808 * ansbuf - Address of array of buffer into which IUCV moves the reply
809 * of this message. 809 * of this message.
810 * anslen - Address of length of reply buffers. 810 * anslen - Address of length of reply buffers.
811 * Output: msgid - Specifies the message ID. 811 * Output: msgid - Specifies the message ID.
812 * Return: Return code from CP IUCV call. 812 * Return: Return code from CP IUCV call.
813 * (-EINVAL) - Ansbuf address is NULL. 813 * (-EINVAL) - Ansbuf address is NULL.
814*/ 814*/
815int iucv_send2way_prmmsg_array (u16 pathid, 815int iucv_send2way_prmmsg_array (u16 pathid,
816 u32 * msgid, 816 u32 * msgid,
@@ -821,29 +821,29 @@ int iucv_send2way_prmmsg_array (u16 pathid,
821 uchar prmmsg[8], 821 uchar prmmsg[8],
822 iucv_array_t * ansbuf, ulong anslen); 822 iucv_array_t * ansbuf, ulong anslen);
823 823
824/* 824/*
825 * Name: iucv_setmask 825 * Name: iucv_setmask
826 * Purpose: This function enables or disables the following IUCV 826 * Purpose: This function enables or disables the following IUCV
827 * external interruptions: Nonpriority and priority message 827 * external interruptions: Nonpriority and priority message
828 * interrupts, nonpriority and priority reply interrupts. 828 * interrupts, nonpriority and priority reply interrupts.
829 * Input: SetMaskFlag - options for interrupts 829 * Input: SetMaskFlag - options for interrupts
830 * 0x80 - Nonpriority_MessagePendingInterruptsFlag 830 * 0x80 - Nonpriority_MessagePendingInterruptsFlag
831 * 0x40 - Priority_MessagePendingInterruptsFlag 831 * 0x40 - Priority_MessagePendingInterruptsFlag
832 * 0x20 - Nonpriority_MessageCompletionInterruptsFlag 832 * 0x20 - Nonpriority_MessageCompletionInterruptsFlag
833 * 0x10 - Priority_MessageCompletionInterruptsFlag 833 * 0x10 - Priority_MessageCompletionInterruptsFlag
834 * 0x08 - IUCVControlInterruptsFlag 834 * 0x08 - IUCVControlInterruptsFlag
835 * Output: NA 835 * Output: NA
836 * Return: Return code from CP IUCV call. 836 * Return: Return code from CP IUCV call.
837*/ 837*/
838int iucv_setmask (int SetMaskFlag); 838int iucv_setmask (int SetMaskFlag);
839 839
840/* 840/*
841 * Name: iucv_sever 841 * Name: iucv_sever
842 * Purpose: This function terminates an IUCV path. 842 * Purpose: This function terminates an IUCV path.
843 * Input: pathid - Path identification number. 843 * Input: pathid - Path identification number.
844 * user_data - 16-bytes of user data. 844 * user_data - 16-bytes of user data.
845 * Output: NA 845 * Output: NA
846 * Return: Return code from CP IUCV call. 846 * Return: Return code from CP IUCV call.
847 * (-EINVAL) - Interal error, wild pointer. 847 * (-EINVAL) - Interal error, wild pointer.
848*/ 848*/
849int iucv_sever (u16 pathid, uchar user_data[16]); 849int iucv_sever (u16 pathid, uchar user_data[16]);
diff --git a/drivers/s390/net/lcs.c b/drivers/s390/net/lcs.c
index 5d6b7a57b02f..f94419b334f7 100644
--- a/drivers/s390/net/lcs.c
+++ b/drivers/s390/net/lcs.c
@@ -68,6 +68,7 @@ static void lcs_tasklet(unsigned long);
68static void lcs_start_kernel_thread(struct lcs_card *card); 68static void lcs_start_kernel_thread(struct lcs_card *card);
69static void lcs_get_frames_cb(struct lcs_channel *, struct lcs_buffer *); 69static void lcs_get_frames_cb(struct lcs_channel *, struct lcs_buffer *);
70static int lcs_send_delipm(struct lcs_card *, struct lcs_ipm_list *); 70static int lcs_send_delipm(struct lcs_card *, struct lcs_ipm_list *);
71static int lcs_recovery(void *ptr);
71 72
72/** 73/**
73 * Debug Facility Stuff 74 * Debug Facility Stuff
@@ -429,12 +430,6 @@ lcs_setup_card(struct lcs_card *card)
429 card->tx_buffer = NULL; 430 card->tx_buffer = NULL;
430 card->tx_emitted = 0; 431 card->tx_emitted = 0;
431 432
432 /* Initialize kernel thread task used for LGW commands. */
433 INIT_WORK(&card->kernel_thread_starter,
434 (void *)lcs_start_kernel_thread,card);
435 card->thread_start_mask = 0;
436 card->thread_allowed_mask = 0;
437 card->thread_running_mask = 0;
438 init_waitqueue_head(&card->wait_q); 433 init_waitqueue_head(&card->wait_q);
439 spin_lock_init(&card->lock); 434 spin_lock_init(&card->lock);
440 spin_lock_init(&card->ipm_lock); 435 spin_lock_init(&card->ipm_lock);
@@ -675,8 +670,9 @@ lcs_ready_buffer(struct lcs_channel *channel, struct lcs_buffer *buffer)
675 int index, rc; 670 int index, rc;
676 671
677 LCS_DBF_TEXT(5, trace, "rdybuff"); 672 LCS_DBF_TEXT(5, trace, "rdybuff");
678 BUG_ON(buffer->state != BUF_STATE_LOCKED && 673 if (buffer->state != BUF_STATE_LOCKED &&
679 buffer->state != BUF_STATE_PROCESSED); 674 buffer->state != BUF_STATE_PROCESSED)
675 BUG();
680 spin_lock_irqsave(get_ccwdev_lock(channel->ccwdev), flags); 676 spin_lock_irqsave(get_ccwdev_lock(channel->ccwdev), flags);
681 buffer->state = BUF_STATE_READY; 677 buffer->state = BUF_STATE_READY;
682 index = buffer - channel->iob; 678 index = buffer - channel->iob;
@@ -700,7 +696,8 @@ __lcs_processed_buffer(struct lcs_channel *channel, struct lcs_buffer *buffer)
700 int index, prev, next; 696 int index, prev, next;
701 697
702 LCS_DBF_TEXT(5, trace, "prcsbuff"); 698 LCS_DBF_TEXT(5, trace, "prcsbuff");
703 BUG_ON(buffer->state != BUF_STATE_READY); 699 if (buffer->state != BUF_STATE_READY)
700 BUG();
704 buffer->state = BUF_STATE_PROCESSED; 701 buffer->state = BUF_STATE_PROCESSED;
705 index = buffer - channel->iob; 702 index = buffer - channel->iob;
706 prev = (index - 1) & (LCS_NUM_BUFFS - 1); 703 prev = (index - 1) & (LCS_NUM_BUFFS - 1);
@@ -732,8 +729,9 @@ lcs_release_buffer(struct lcs_channel *channel, struct lcs_buffer *buffer)
732 unsigned long flags; 729 unsigned long flags;
733 730
734 LCS_DBF_TEXT(5, trace, "relbuff"); 731 LCS_DBF_TEXT(5, trace, "relbuff");
735 BUG_ON(buffer->state != BUF_STATE_LOCKED && 732 if (buffer->state != BUF_STATE_LOCKED &&
736 buffer->state != BUF_STATE_PROCESSED); 733 buffer->state != BUF_STATE_PROCESSED)
734 BUG();
737 spin_lock_irqsave(get_ccwdev_lock(channel->ccwdev), flags); 735 spin_lock_irqsave(get_ccwdev_lock(channel->ccwdev), flags);
738 buffer->state = BUF_STATE_EMPTY; 736 buffer->state = BUF_STATE_EMPTY;
739 spin_unlock_irqrestore(get_ccwdev_lock(channel->ccwdev), flags); 737 spin_unlock_irqrestore(get_ccwdev_lock(channel->ccwdev), flags);
@@ -1147,8 +1145,6 @@ list_modified:
1147 list_add_tail(&ipm->list, &card->ipm_list); 1145 list_add_tail(&ipm->list, &card->ipm_list);
1148 } 1146 }
1149 spin_unlock_irqrestore(&card->ipm_lock, flags); 1147 spin_unlock_irqrestore(&card->ipm_lock, flags);
1150 if (card->state == DEV_STATE_UP)
1151 netif_wake_queue(card->dev);
1152} 1148}
1153 1149
1154/** 1150/**
@@ -1231,17 +1227,17 @@ lcs_set_mc_addresses(struct lcs_card *card, struct in_device *in4_dev)
1231 if (ipm != NULL) 1227 if (ipm != NULL)
1232 continue; /* Address already in list. */ 1228 continue; /* Address already in list. */
1233 ipm = (struct lcs_ipm_list *) 1229 ipm = (struct lcs_ipm_list *)
1234 kmalloc(sizeof(struct lcs_ipm_list), GFP_ATOMIC); 1230 kzalloc(sizeof(struct lcs_ipm_list), GFP_ATOMIC);
1235 if (ipm == NULL) { 1231 if (ipm == NULL) {
1236 PRINT_INFO("Not enough memory to add " 1232 PRINT_INFO("Not enough memory to add "
1237 "new multicast entry!\n"); 1233 "new multicast entry!\n");
1238 break; 1234 break;
1239 } 1235 }
1240 memset(ipm, 0, sizeof(struct lcs_ipm_list));
1241 memcpy(&ipm->ipm.mac_addr, buf, LCS_MAC_LENGTH); 1236 memcpy(&ipm->ipm.mac_addr, buf, LCS_MAC_LENGTH);
1242 ipm->ipm.ip_addr = im4->multiaddr; 1237 ipm->ipm.ip_addr = im4->multiaddr;
1243 ipm->ipm_state = LCS_IPM_STATE_SET_REQUIRED; 1238 ipm->ipm_state = LCS_IPM_STATE_SET_REQUIRED;
1244 spin_lock_irqsave(&card->ipm_lock, flags); 1239 spin_lock_irqsave(&card->ipm_lock, flags);
1240 LCS_DBF_HEX(2,trace,&ipm->ipm.ip_addr,4);
1245 list_add(&ipm->list, &card->ipm_list); 1241 list_add(&ipm->list, &card->ipm_list);
1246 spin_unlock_irqrestore(&card->ipm_lock, flags); 1242 spin_unlock_irqrestore(&card->ipm_lock, flags);
1247 } 1243 }
@@ -1269,7 +1265,15 @@ lcs_register_mc_addresses(void *data)
1269 read_unlock(&in4_dev->mc_list_lock); 1265 read_unlock(&in4_dev->mc_list_lock);
1270 in_dev_put(in4_dev); 1266 in_dev_put(in4_dev);
1271 1267
1268 netif_carrier_off(card->dev);
1269 netif_tx_disable(card->dev);
1270 wait_event(card->write.wait_q,
1271 (card->write.state != CH_STATE_RUNNING));
1272 lcs_fix_multicast_list(card); 1272 lcs_fix_multicast_list(card);
1273 if (card->state == DEV_STATE_UP) {
1274 netif_carrier_on(card->dev);
1275 netif_wake_queue(card->dev);
1276 }
1273out: 1277out:
1274 lcs_clear_thread_running_bit(card, LCS_SET_MC_THREAD); 1278 lcs_clear_thread_running_bit(card, LCS_SET_MC_THREAD);
1275 return 0; 1279 return 0;
@@ -1286,7 +1290,7 @@ lcs_set_multicast_list(struct net_device *dev)
1286 LCS_DBF_TEXT(4, trace, "setmulti"); 1290 LCS_DBF_TEXT(4, trace, "setmulti");
1287 card = (struct lcs_card *) dev->priv; 1291 card = (struct lcs_card *) dev->priv;
1288 1292
1289 if (!lcs_set_thread_start_bit(card, LCS_SET_MC_THREAD)) 1293 if (!lcs_set_thread_start_bit(card, LCS_SET_MC_THREAD))
1290 schedule_work(&card->kernel_thread_starter); 1294 schedule_work(&card->kernel_thread_starter);
1291} 1295}
1292 1296
@@ -1318,6 +1322,53 @@ lcs_check_irb_error(struct ccw_device *cdev, struct irb *irb)
1318 return PTR_ERR(irb); 1322 return PTR_ERR(irb);
1319} 1323}
1320 1324
1325static int
1326lcs_get_problem(struct ccw_device *cdev, struct irb *irb)
1327{
1328 int dstat, cstat;
1329 char *sense;
1330
1331 sense = (char *) irb->ecw;
1332 cstat = irb->scsw.cstat;
1333 dstat = irb->scsw.dstat;
1334
1335 if (cstat & (SCHN_STAT_CHN_CTRL_CHK | SCHN_STAT_INTF_CTRL_CHK |
1336 SCHN_STAT_CHN_DATA_CHK | SCHN_STAT_CHAIN_CHECK |
1337 SCHN_STAT_PROT_CHECK | SCHN_STAT_PROG_CHECK)) {
1338 LCS_DBF_TEXT(2, trace, "CGENCHK");
1339 return 1;
1340 }
1341 if (dstat & DEV_STAT_UNIT_CHECK) {
1342 if (sense[LCS_SENSE_BYTE_1] &
1343 LCS_SENSE_RESETTING_EVENT) {
1344 LCS_DBF_TEXT(2, trace, "REVIND");
1345 return 1;
1346 }
1347 if (sense[LCS_SENSE_BYTE_0] &
1348 LCS_SENSE_CMD_REJECT) {
1349 LCS_DBF_TEXT(2, trace, "CMDREJ");
1350 return 0;
1351 }
1352 if ((!sense[LCS_SENSE_BYTE_0]) &&
1353 (!sense[LCS_SENSE_BYTE_1]) &&
1354 (!sense[LCS_SENSE_BYTE_2]) &&
1355 (!sense[LCS_SENSE_BYTE_3])) {
1356 LCS_DBF_TEXT(2, trace, "ZEROSEN");
1357 return 0;
1358 }
1359 LCS_DBF_TEXT(2, trace, "DGENCHK");
1360 return 1;
1361 }
1362 return 0;
1363}
1364
1365void
1366lcs_schedule_recovery(struct lcs_card *card)
1367{
1368 LCS_DBF_TEXT(2, trace, "startrec");
1369 if (!lcs_set_thread_start_bit(card, LCS_RECOVERY_THREAD))
1370 schedule_work(&card->kernel_thread_starter);
1371}
1321 1372
1322/** 1373/**
1323 * IRQ Handler for LCS channels 1374 * IRQ Handler for LCS channels
@@ -1327,7 +1378,8 @@ lcs_irq(struct ccw_device *cdev, unsigned long intparm, struct irb *irb)
1327{ 1378{
1328 struct lcs_card *card; 1379 struct lcs_card *card;
1329 struct lcs_channel *channel; 1380 struct lcs_channel *channel;
1330 int index; 1381 int rc, index;
1382 int cstat, dstat;
1331 1383
1332 if (lcs_check_irb_error(cdev, irb)) 1384 if (lcs_check_irb_error(cdev, irb))
1333 return; 1385 return;
@@ -1338,17 +1390,30 @@ lcs_irq(struct ccw_device *cdev, unsigned long intparm, struct irb *irb)
1338 else 1390 else
1339 channel = &card->write; 1391 channel = &card->write;
1340 1392
1393 cstat = irb->scsw.cstat;
1394 dstat = irb->scsw.dstat;
1341 LCS_DBF_TEXT_(5, trace, "Rint%s",cdev->dev.bus_id); 1395 LCS_DBF_TEXT_(5, trace, "Rint%s",cdev->dev.bus_id);
1342 LCS_DBF_TEXT_(5, trace, "%4x%4x",irb->scsw.cstat, irb->scsw.dstat); 1396 LCS_DBF_TEXT_(5, trace, "%4x%4x",irb->scsw.cstat, irb->scsw.dstat);
1343 LCS_DBF_TEXT_(5, trace, "%4x%4x",irb->scsw.fctl, irb->scsw.actl); 1397 LCS_DBF_TEXT_(5, trace, "%4x%4x",irb->scsw.fctl, irb->scsw.actl);
1344 1398
1399 /* Check for channel and device errors presented */
1400 rc = lcs_get_problem(cdev, irb);
1401 if (rc || (dstat & DEV_STAT_UNIT_EXCEP)) {
1402 PRINT_WARN("check on device %s, dstat=0x%X, cstat=0x%X \n",
1403 cdev->dev.bus_id, dstat, cstat);
1404 if (rc) {
1405 lcs_schedule_recovery(card);
1406 wake_up(&card->wait_q);
1407 return;
1408 }
1409 }
1345 /* How far in the ccw chain have we processed? */ 1410 /* How far in the ccw chain have we processed? */
1346 if ((channel->state != CH_STATE_INIT) && 1411 if ((channel->state != CH_STATE_INIT) &&
1347 (irb->scsw.fctl & SCSW_FCTL_START_FUNC)) { 1412 (irb->scsw.fctl & SCSW_FCTL_START_FUNC)) {
1348 index = (struct ccw1 *) __va((addr_t) irb->scsw.cpa) 1413 index = (struct ccw1 *) __va((addr_t) irb->scsw.cpa)
1349 - channel->ccws; 1414 - channel->ccws;
1350 if ((irb->scsw.actl & SCSW_ACTL_SUSPENDED) || 1415 if ((irb->scsw.actl & SCSW_ACTL_SUSPENDED) ||
1351 (irb->scsw.cstat | SCHN_STAT_PCI)) 1416 (irb->scsw.cstat & SCHN_STAT_PCI))
1352 /* Bloody io subsystem tells us lies about cpa... */ 1417 /* Bloody io subsystem tells us lies about cpa... */
1353 index = (index - 1) & (LCS_NUM_BUFFS - 1); 1418 index = (index - 1) & (LCS_NUM_BUFFS - 1);
1354 while (channel->io_idx != index) { 1419 while (channel->io_idx != index) {
@@ -1367,7 +1432,6 @@ lcs_irq(struct ccw_device *cdev, unsigned long intparm, struct irb *irb)
1367 else if (irb->scsw.actl & SCSW_ACTL_SUSPENDED) 1432 else if (irb->scsw.actl & SCSW_ACTL_SUSPENDED)
1368 /* CCW execution stopped on a suspend bit. */ 1433 /* CCW execution stopped on a suspend bit. */
1369 channel->state = CH_STATE_SUSPENDED; 1434 channel->state = CH_STATE_SUSPENDED;
1370
1371 if (irb->scsw.fctl & SCSW_FCTL_HALT_FUNC) { 1435 if (irb->scsw.fctl & SCSW_FCTL_HALT_FUNC) {
1372 if (irb->scsw.cc != 0) { 1436 if (irb->scsw.cc != 0) {
1373 ccw_device_halt(channel->ccwdev, (addr_t) channel); 1437 ccw_device_halt(channel->ccwdev, (addr_t) channel);
@@ -1376,7 +1440,6 @@ lcs_irq(struct ccw_device *cdev, unsigned long intparm, struct irb *irb)
1376 /* The channel has been stopped by halt_IO. */ 1440 /* The channel has been stopped by halt_IO. */
1377 channel->state = CH_STATE_HALTED; 1441 channel->state = CH_STATE_HALTED;
1378 } 1442 }
1379
1380 if (irb->scsw.fctl & SCSW_FCTL_CLEAR_FUNC) { 1443 if (irb->scsw.fctl & SCSW_FCTL_CLEAR_FUNC) {
1381 channel->state = CH_STATE_CLEARED; 1444 channel->state = CH_STATE_CLEARED;
1382 } 1445 }
@@ -1452,7 +1515,7 @@ lcs_txbuffer_cb(struct lcs_channel *channel, struct lcs_buffer *buffer)
1452 lcs_release_buffer(channel, buffer); 1515 lcs_release_buffer(channel, buffer);
1453 card = (struct lcs_card *) 1516 card = (struct lcs_card *)
1454 ((char *) channel - offsetof(struct lcs_card, write)); 1517 ((char *) channel - offsetof(struct lcs_card, write));
1455 if (netif_queue_stopped(card->dev)) 1518 if (netif_queue_stopped(card->dev) && netif_carrier_ok(card->dev))
1456 netif_wake_queue(card->dev); 1519 netif_wake_queue(card->dev);
1457 spin_lock(&card->lock); 1520 spin_lock(&card->lock);
1458 card->tx_emitted--; 1521 card->tx_emitted--;
@@ -1488,6 +1551,10 @@ __lcs_start_xmit(struct lcs_card *card, struct sk_buff *skb,
1488 card->stats.tx_carrier_errors++; 1551 card->stats.tx_carrier_errors++;
1489 return 0; 1552 return 0;
1490 } 1553 }
1554 if (skb->protocol == htons(ETH_P_IPV6)) {
1555 dev_kfree_skb(skb);
1556 return 0;
1557 }
1491 netif_stop_queue(card->dev); 1558 netif_stop_queue(card->dev);
1492 spin_lock(&card->lock); 1559 spin_lock(&card->lock);
1493 if (card->tx_buffer != NULL && 1560 if (card->tx_buffer != NULL &&
@@ -1633,30 +1700,6 @@ lcs_detect(struct lcs_card *card)
1633} 1700}
1634 1701
1635/** 1702/**
1636 * reset card
1637 */
1638static int
1639lcs_resetcard(struct lcs_card *card)
1640{
1641 int retries;
1642
1643 LCS_DBF_TEXT(2, trace, "rescard");
1644 for (retries = 0; retries < 10; retries++) {
1645 if (lcs_detect(card) == 0) {
1646 netif_wake_queue(card->dev);
1647 card->state = DEV_STATE_UP;
1648 PRINT_INFO("LCS device %s successfully restarted!\n",
1649 card->dev->name);
1650 return 0;
1651 }
1652 msleep(3000);
1653 }
1654 PRINT_ERR("Error in Reseting LCS card!\n");
1655 return -EIO;
1656}
1657
1658
1659/**
1660 * LCS Stop card 1703 * LCS Stop card
1661 */ 1704 */
1662static int 1705static int
@@ -1680,126 +1723,18 @@ lcs_stopcard(struct lcs_card *card)
1680} 1723}
1681 1724
1682/** 1725/**
1683 * LGW initiated commands
1684 */
1685static int
1686lcs_lgw_startlan_thread(void *data)
1687{
1688 struct lcs_card *card;
1689
1690 card = (struct lcs_card *) data;
1691 daemonize("lgwstpln");
1692
1693 if (!lcs_do_run_thread(card, LCS_STARTLAN_THREAD))
1694 return 0;
1695 LCS_DBF_TEXT(4, trace, "lgwstpln");
1696 if (card->dev)
1697 netif_stop_queue(card->dev);
1698 if (lcs_startlan(card) == 0) {
1699 netif_wake_queue(card->dev);
1700 card->state = DEV_STATE_UP;
1701 PRINT_INFO("LCS Startlan for device %s succeeded!\n",
1702 card->dev->name);
1703
1704 } else
1705 PRINT_ERR("LCS Startlan for device %s failed!\n",
1706 card->dev->name);
1707 lcs_clear_thread_running_bit(card, LCS_STARTLAN_THREAD);
1708 return 0;
1709}
1710
1711/**
1712 * Send startup command initiated by Lan Gateway
1713 */
1714static int
1715lcs_lgw_startup_thread(void *data)
1716{
1717 int rc;
1718
1719 struct lcs_card *card;
1720
1721 card = (struct lcs_card *) data;
1722 daemonize("lgwstaln");
1723
1724 if (!lcs_do_run_thread(card, LCS_STARTUP_THREAD))
1725 return 0;
1726 LCS_DBF_TEXT(4, trace, "lgwstaln");
1727 if (card->dev)
1728 netif_stop_queue(card->dev);
1729 rc = lcs_send_startup(card, LCS_INITIATOR_LGW);
1730 if (rc != 0) {
1731 PRINT_ERR("Startup for LCS device %s initiated " \
1732 "by LGW failed!\nReseting card ...\n",
1733 card->dev->name);
1734 /* do a card reset */
1735 rc = lcs_resetcard(card);
1736 if (rc == 0)
1737 goto Done;
1738 }
1739 rc = lcs_startlan(card);
1740 if (rc == 0) {
1741 netif_wake_queue(card->dev);
1742 card->state = DEV_STATE_UP;
1743 }
1744Done:
1745 if (rc == 0)
1746 PRINT_INFO("LCS Startup for device %s succeeded!\n",
1747 card->dev->name);
1748 else
1749 PRINT_ERR("LCS Startup for device %s failed!\n",
1750 card->dev->name);
1751 lcs_clear_thread_running_bit(card, LCS_STARTUP_THREAD);
1752 return 0;
1753}
1754
1755
1756/**
1757 * send stoplan command initiated by Lan Gateway
1758 */
1759static int
1760lcs_lgw_stoplan_thread(void *data)
1761{
1762 struct lcs_card *card;
1763 int rc;
1764
1765 card = (struct lcs_card *) data;
1766 daemonize("lgwstop");
1767
1768 if (!lcs_do_run_thread(card, LCS_STOPLAN_THREAD))
1769 return 0;
1770 LCS_DBF_TEXT(4, trace, "lgwstop");
1771 if (card->dev)
1772 netif_stop_queue(card->dev);
1773 if (lcs_send_stoplan(card, LCS_INITIATOR_LGW) == 0)
1774 PRINT_INFO("Stoplan for %s initiated by LGW succeeded!\n",
1775 card->dev->name);
1776 else
1777 PRINT_ERR("Stoplan %s initiated by LGW failed!\n",
1778 card->dev->name);
1779 /*Try to reset the card, stop it on failure */
1780 rc = lcs_resetcard(card);
1781 if (rc != 0)
1782 rc = lcs_stopcard(card);
1783 lcs_clear_thread_running_bit(card, LCS_STOPLAN_THREAD);
1784 return rc;
1785}
1786
1787/**
1788 * Kernel Thread helper functions for LGW initiated commands 1726 * Kernel Thread helper functions for LGW initiated commands
1789 */ 1727 */
1790static void 1728static void
1791lcs_start_kernel_thread(struct lcs_card *card) 1729lcs_start_kernel_thread(struct lcs_card *card)
1792{ 1730{
1793 LCS_DBF_TEXT(5, trace, "krnthrd"); 1731 LCS_DBF_TEXT(5, trace, "krnthrd");
1794 if (lcs_do_start_thread(card, LCS_STARTUP_THREAD)) 1732 if (lcs_do_start_thread(card, LCS_RECOVERY_THREAD))
1795 kernel_thread(lcs_lgw_startup_thread, (void *) card, SIGCHLD); 1733 kernel_thread(lcs_recovery, (void *) card, SIGCHLD);
1796 if (lcs_do_start_thread(card, LCS_STARTLAN_THREAD))
1797 kernel_thread(lcs_lgw_startlan_thread, (void *) card, SIGCHLD);
1798 if (lcs_do_start_thread(card, LCS_STOPLAN_THREAD))
1799 kernel_thread(lcs_lgw_stoplan_thread, (void *) card, SIGCHLD);
1800#ifdef CONFIG_IP_MULTICAST 1734#ifdef CONFIG_IP_MULTICAST
1801 if (lcs_do_start_thread(card, LCS_SET_MC_THREAD)) 1735 if (lcs_do_start_thread(card, LCS_SET_MC_THREAD))
1802 kernel_thread(lcs_register_mc_addresses, (void *) card, SIGCHLD); 1736 kernel_thread(lcs_register_mc_addresses,
1737 (void *) card, SIGCHLD);
1803#endif 1738#endif
1804} 1739}
1805 1740
@@ -1813,19 +1748,14 @@ lcs_get_control(struct lcs_card *card, struct lcs_cmd *cmd)
1813 if (cmd->initiator == LCS_INITIATOR_LGW) { 1748 if (cmd->initiator == LCS_INITIATOR_LGW) {
1814 switch(cmd->cmd_code) { 1749 switch(cmd->cmd_code) {
1815 case LCS_CMD_STARTUP: 1750 case LCS_CMD_STARTUP:
1816 if (!lcs_set_thread_start_bit(card,
1817 LCS_STARTUP_THREAD))
1818 schedule_work(&card->kernel_thread_starter);
1819 break;
1820 case LCS_CMD_STARTLAN: 1751 case LCS_CMD_STARTLAN:
1821 if (!lcs_set_thread_start_bit(card, 1752 lcs_schedule_recovery(card);
1822 LCS_STARTLAN_THREAD))
1823 schedule_work(&card->kernel_thread_starter);
1824 break; 1753 break;
1825 case LCS_CMD_STOPLAN: 1754 case LCS_CMD_STOPLAN:
1826 if (!lcs_set_thread_start_bit(card, 1755 PRINT_WARN("Stoplan for %s initiated by LGW.\n",
1827 LCS_STOPLAN_THREAD)) 1756 card->dev->name);
1828 schedule_work(&card->kernel_thread_starter); 1757 if (card->dev)
1758 netif_carrier_off(card->dev);
1829 break; 1759 break;
1830 default: 1760 default:
1831 PRINT_INFO("UNRECOGNIZED LGW COMMAND\n"); 1761 PRINT_INFO("UNRECOGNIZED LGW COMMAND\n");
@@ -1941,8 +1871,11 @@ lcs_stop_device(struct net_device *dev)
1941 1871
1942 LCS_DBF_TEXT(2, trace, "stopdev"); 1872 LCS_DBF_TEXT(2, trace, "stopdev");
1943 card = (struct lcs_card *) dev->priv; 1873 card = (struct lcs_card *) dev->priv;
1944 netif_stop_queue(dev); 1874 netif_carrier_off(dev);
1875 netif_tx_disable(dev);
1945 dev->flags &= ~IFF_UP; 1876 dev->flags &= ~IFF_UP;
1877 wait_event(card->write.wait_q,
1878 (card->write.state != CH_STATE_RUNNING));
1946 rc = lcs_stopcard(card); 1879 rc = lcs_stopcard(card);
1947 if (rc) 1880 if (rc)
1948 PRINT_ERR("Try it again!\n "); 1881 PRINT_ERR("Try it again!\n ");
@@ -1968,6 +1901,7 @@ lcs_open_device(struct net_device *dev)
1968 1901
1969 } else { 1902 } else {
1970 dev->flags |= IFF_UP; 1903 dev->flags |= IFF_UP;
1904 netif_carrier_on(dev);
1971 netif_wake_queue(dev); 1905 netif_wake_queue(dev);
1972 card->state = DEV_STATE_UP; 1906 card->state = DEV_STATE_UP;
1973 } 1907 }
@@ -2059,10 +1993,31 @@ lcs_timeout_store (struct device *dev, struct device_attribute *attr, const char
2059 1993
2060DEVICE_ATTR(lancmd_timeout, 0644, lcs_timeout_show, lcs_timeout_store); 1994DEVICE_ATTR(lancmd_timeout, 0644, lcs_timeout_show, lcs_timeout_store);
2061 1995
1996static ssize_t
1997lcs_dev_recover_store(struct device *dev, struct device_attribute *attr,
1998 const char *buf, size_t count)
1999{
2000 struct lcs_card *card = dev->driver_data;
2001 char *tmp;
2002 int i;
2003
2004 if (!card)
2005 return -EINVAL;
2006 if (card->state != DEV_STATE_UP)
2007 return -EPERM;
2008 i = simple_strtoul(buf, &tmp, 16);
2009 if (i == 1)
2010 lcs_schedule_recovery(card);
2011 return count;
2012}
2013
2014static DEVICE_ATTR(recover, 0200, NULL, lcs_dev_recover_store);
2015
2062static struct attribute * lcs_attrs[] = { 2016static struct attribute * lcs_attrs[] = {
2063 &dev_attr_portno.attr, 2017 &dev_attr_portno.attr,
2064 &dev_attr_type.attr, 2018 &dev_attr_type.attr,
2065 &dev_attr_lancmd_timeout.attr, 2019 &dev_attr_lancmd_timeout.attr,
2020 &dev_attr_recover.attr,
2066 NULL, 2021 NULL,
2067}; 2022};
2068 2023
@@ -2099,6 +2054,12 @@ lcs_probe_device(struct ccwgroup_device *ccwgdev)
2099 ccwgdev->dev.driver_data = card; 2054 ccwgdev->dev.driver_data = card;
2100 ccwgdev->cdev[0]->handler = lcs_irq; 2055 ccwgdev->cdev[0]->handler = lcs_irq;
2101 ccwgdev->cdev[1]->handler = lcs_irq; 2056 ccwgdev->cdev[1]->handler = lcs_irq;
2057 card->gdev = ccwgdev;
2058 INIT_WORK(&card->kernel_thread_starter,
2059 (void *) lcs_start_kernel_thread, card);
2060 card->thread_start_mask = 0;
2061 card->thread_allowed_mask = 0;
2062 card->thread_running_mask = 0;
2102 return 0; 2063 return 0;
2103} 2064}
2104 2065
@@ -2200,6 +2161,7 @@ netdev_out:
2200 if (recover_state == DEV_STATE_RECOVER) { 2161 if (recover_state == DEV_STATE_RECOVER) {
2201 lcs_set_multicast_list(card->dev); 2162 lcs_set_multicast_list(card->dev);
2202 card->dev->flags |= IFF_UP; 2163 card->dev->flags |= IFF_UP;
2164 netif_carrier_on(card->dev);
2203 netif_wake_queue(card->dev); 2165 netif_wake_queue(card->dev);
2204 card->state = DEV_STATE_UP; 2166 card->state = DEV_STATE_UP;
2205 } else { 2167 } else {
@@ -2229,7 +2191,7 @@ out:
2229 * lcs_shutdown_device, called when setting the group device offline. 2191 * lcs_shutdown_device, called when setting the group device offline.
2230 */ 2192 */
2231static int 2193static int
2232lcs_shutdown_device(struct ccwgroup_device *ccwgdev) 2194__lcs_shutdown_device(struct ccwgroup_device *ccwgdev, int recovery_mode)
2233{ 2195{
2234 struct lcs_card *card; 2196 struct lcs_card *card;
2235 enum lcs_dev_states recover_state; 2197 enum lcs_dev_states recover_state;
@@ -2239,9 +2201,11 @@ lcs_shutdown_device(struct ccwgroup_device *ccwgdev)
2239 card = (struct lcs_card *)ccwgdev->dev.driver_data; 2201 card = (struct lcs_card *)ccwgdev->dev.driver_data;
2240 if (!card) 2202 if (!card)
2241 return -ENODEV; 2203 return -ENODEV;
2242 lcs_set_allowed_threads(card, 0); 2204 if (recovery_mode == 0) {
2243 if (lcs_wait_for_threads(card, LCS_SET_MC_THREAD)) 2205 lcs_set_allowed_threads(card, 0);
2244 return -ERESTARTSYS; 2206 if (lcs_wait_for_threads(card, LCS_SET_MC_THREAD))
2207 return -ERESTARTSYS;
2208 }
2245 LCS_DBF_HEX(3, setup, &card, sizeof(void*)); 2209 LCS_DBF_HEX(3, setup, &card, sizeof(void*));
2246 recover_state = card->state; 2210 recover_state = card->state;
2247 2211
@@ -2256,6 +2220,43 @@ lcs_shutdown_device(struct ccwgroup_device *ccwgdev)
2256 return 0; 2220 return 0;
2257} 2221}
2258 2222
2223static int
2224lcs_shutdown_device(struct ccwgroup_device *ccwgdev)
2225{
2226 return __lcs_shutdown_device(ccwgdev, 0);
2227}
2228
2229/**
2230 * drive lcs recovery after startup and startlan initiated by Lan Gateway
2231 */
2232static int
2233lcs_recovery(void *ptr)
2234{
2235 struct lcs_card *card;
2236 struct ccwgroup_device *gdev;
2237 int rc;
2238
2239 card = (struct lcs_card *) ptr;
2240 daemonize("lcs_recover");
2241
2242 LCS_DBF_TEXT(4, trace, "recover1");
2243 if (!lcs_do_run_thread(card, LCS_RECOVERY_THREAD))
2244 return 0;
2245 LCS_DBF_TEXT(4, trace, "recover2");
2246 gdev = card->gdev;
2247 PRINT_WARN("Recovery of device %s started...\n", gdev->dev.bus_id);
2248 rc = __lcs_shutdown_device(gdev, 1);
2249 rc = lcs_new_device(gdev);
2250 if (!rc)
2251 PRINT_INFO("Device %s successfully recovered!\n",
2252 card->dev->name);
2253 else
2254 PRINT_INFO("Device %s could not be recovered!\n",
2255 card->dev->name);
2256 lcs_clear_thread_running_bit(card, LCS_RECOVERY_THREAD);
2257 return 0;
2258}
2259
2259/** 2260/**
2260 * lcs_remove_device, free buffers and card 2261 * lcs_remove_device, free buffers and card
2261 */ 2262 */
diff --git a/drivers/s390/net/lcs.h b/drivers/s390/net/lcs.h
index 2fad5e40c2e4..93143932983b 100644
--- a/drivers/s390/net/lcs.h
+++ b/drivers/s390/net/lcs.h
@@ -73,13 +73,17 @@ do { \
73/** 73/**
74 * LCS sense byte definitions 74 * LCS sense byte definitions
75 */ 75 */
76#define LCS_SENSE_BYTE_0 0
77#define LCS_SENSE_BYTE_1 1
78#define LCS_SENSE_BYTE_2 2
79#define LCS_SENSE_BYTE_3 3
76#define LCS_SENSE_INTERFACE_DISCONNECT 0x01 80#define LCS_SENSE_INTERFACE_DISCONNECT 0x01
77#define LCS_SENSE_EQUIPMENT_CHECK 0x10 81#define LCS_SENSE_EQUIPMENT_CHECK 0x10
78#define LCS_SENSE_BUS_OUT_CHECK 0x20 82#define LCS_SENSE_BUS_OUT_CHECK 0x20
79#define LCS_SENSE_INTERVENTION_REQUIRED 0x40 83#define LCS_SENSE_INTERVENTION_REQUIRED 0x40
80#define LCS_SENSE_CMD_REJECT 0x80 84#define LCS_SENSE_CMD_REJECT 0x80
81#define LCS_SENSE_RESETTING_EVENT 0x0080 85#define LCS_SENSE_RESETTING_EVENT 0x80
82#define LCS_SENSE_DEVICE_ONLINE 0x0020 86#define LCS_SENSE_DEVICE_ONLINE 0x20
83 87
84/** 88/**
85 * LCS packet type definitions 89 * LCS packet type definitions
@@ -152,10 +156,9 @@ enum lcs_dev_states {
152 156
153enum lcs_threads { 157enum lcs_threads {
154 LCS_SET_MC_THREAD = 1, 158 LCS_SET_MC_THREAD = 1,
155 LCS_STARTLAN_THREAD = 2, 159 LCS_RECOVERY_THREAD = 2,
156 LCS_STOPLAN_THREAD = 4,
157 LCS_STARTUP_THREAD = 8,
158}; 160};
161
159/** 162/**
160 * LCS struct declarations 163 * LCS struct declarations
161 */ 164 */
@@ -286,6 +289,7 @@ struct lcs_card {
286 struct net_device_stats stats; 289 struct net_device_stats stats;
287 unsigned short (*lan_type_trans)(struct sk_buff *skb, 290 unsigned short (*lan_type_trans)(struct sk_buff *skb,
288 struct net_device *dev); 291 struct net_device *dev);
292 struct ccwgroup_device *gdev;
289 struct lcs_channel read; 293 struct lcs_channel read;
290 struct lcs_channel write; 294 struct lcs_channel write;
291 struct lcs_buffer *tx_buffer; 295 struct lcs_buffer *tx_buffer;
diff --git a/drivers/s390/net/netiucv.c b/drivers/s390/net/netiucv.c
index 260a93c8c442..b452cc1afd55 100644
--- a/drivers/s390/net/netiucv.c
+++ b/drivers/s390/net/netiucv.c
@@ -30,7 +30,7 @@
30 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 30 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
31 * 31 *
32 */ 32 */
33 33
34#undef DEBUG 34#undef DEBUG
35 35
36#include <linux/module.h> 36#include <linux/module.h>
@@ -65,7 +65,7 @@ MODULE_AUTHOR
65 ("(C) 2001 IBM Corporation by Fritz Elfert (felfert@millenux.com)"); 65 ("(C) 2001 IBM Corporation by Fritz Elfert (felfert@millenux.com)");
66MODULE_DESCRIPTION ("Linux for S/390 IUCV network driver"); 66MODULE_DESCRIPTION ("Linux for S/390 IUCV network driver");
67 67
68 68
69#define PRINTK_HEADER " iucv: " /* for debugging */ 69#define PRINTK_HEADER " iucv: " /* for debugging */
70 70
71static struct device_driver netiucv_driver = { 71static struct device_driver netiucv_driver = {
@@ -202,7 +202,7 @@ netiucv_printname(char *name)
202 *p = '\0'; 202 *p = '\0';
203 return tmp; 203 return tmp;
204} 204}
205 205
206/** 206/**
207 * States of the interface statemachine. 207 * States of the interface statemachine.
208 */ 208 */
@@ -244,7 +244,7 @@ static const char *dev_event_names[] = {
244 "Connection up", 244 "Connection up",
245 "Connection down", 245 "Connection down",
246}; 246};
247 247
248/** 248/**
249 * Events of the connection statemachine 249 * Events of the connection statemachine
250 */ 250 */
@@ -364,7 +364,7 @@ static const char *conn_state_names[] = {
364 "Connect error", 364 "Connect error",
365}; 365};
366 366
367 367
368/** 368/**
369 * Debug Facility Stuff 369 * Debug Facility Stuff
370 */ 370 */
@@ -516,7 +516,7 @@ static void
516fsm_action_nop(fsm_instance *fi, int event, void *arg) 516fsm_action_nop(fsm_instance *fi, int event, void *arg)
517{ 517{
518} 518}
519 519
520/** 520/**
521 * Actions of the connection statemachine 521 * Actions of the connection statemachine
522 *****************************************************************************/ 522 *****************************************************************************/
@@ -993,7 +993,7 @@ static const fsm_node conn_fsm[] = {
993 993
994static const int CONN_FSM_LEN = sizeof(conn_fsm) / sizeof(fsm_node); 994static const int CONN_FSM_LEN = sizeof(conn_fsm) / sizeof(fsm_node);
995 995
996 996
997/** 997/**
998 * Actions for interface - statemachine. 998 * Actions for interface - statemachine.
999 *****************************************************************************/ 999 *****************************************************************************/
@@ -1182,7 +1182,7 @@ netiucv_transmit_skb(struct iucv_connection *conn, struct sk_buff *skb) {
1182 1182
1183 fsm_newstate(conn->fsm, CONN_STATE_TX); 1183 fsm_newstate(conn->fsm, CONN_STATE_TX);
1184 conn->prof.send_stamp = xtime; 1184 conn->prof.send_stamp = xtime;
1185 1185
1186 rc = iucv_send(conn->pathid, NULL, 0, 0, 1 /* single_flag */, 1186 rc = iucv_send(conn->pathid, NULL, 0, 0, 1 /* single_flag */,
1187 0, nskb->data, nskb->len); 1187 0, nskb->data, nskb->len);
1188 /* Shut up, gcc! nskb is always below 2G. */ 1188 /* Shut up, gcc! nskb is always below 2G. */
@@ -1220,7 +1220,7 @@ netiucv_transmit_skb(struct iucv_connection *conn, struct sk_buff *skb) {
1220 1220
1221 return rc; 1221 return rc;
1222} 1222}
1223 1223
1224/** 1224/**
1225 * Interface API for upper network layers 1225 * Interface API for upper network layers
1226 *****************************************************************************/ 1226 *****************************************************************************/
@@ -1291,7 +1291,7 @@ static int netiucv_tx(struct sk_buff *skb, struct net_device *dev)
1291 1291
1292 /** 1292 /**
1293 * If connection is not running, try to restart it 1293 * If connection is not running, try to restart it
1294 * and throw away packet. 1294 * and throw away packet.
1295 */ 1295 */
1296 if (fsm_getstate(privptr->fsm) != DEV_STATE_RUNNING) { 1296 if (fsm_getstate(privptr->fsm) != DEV_STATE_RUNNING) {
1297 fsm_event(privptr->fsm, DEV_EVENT_START, dev); 1297 fsm_event(privptr->fsm, DEV_EVENT_START, dev);
@@ -1538,7 +1538,7 @@ static ssize_t
1538maxcq_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) 1538maxcq_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1539{ 1539{
1540 struct netiucv_priv *priv = dev->driver_data; 1540 struct netiucv_priv *priv = dev->driver_data;
1541 1541
1542 IUCV_DBF_TEXT(trace, 4, __FUNCTION__); 1542 IUCV_DBF_TEXT(trace, 4, __FUNCTION__);
1543 priv->conn->prof.maxcqueue = 0; 1543 priv->conn->prof.maxcqueue = 0;
1544 return count; 1544 return count;
@@ -1559,7 +1559,7 @@ static ssize_t
1559sdoio_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) 1559sdoio_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1560{ 1560{
1561 struct netiucv_priv *priv = dev->driver_data; 1561 struct netiucv_priv *priv = dev->driver_data;
1562 1562
1563 IUCV_DBF_TEXT(trace, 4, __FUNCTION__); 1563 IUCV_DBF_TEXT(trace, 4, __FUNCTION__);
1564 priv->conn->prof.doios_single = 0; 1564 priv->conn->prof.doios_single = 0;
1565 return count; 1565 return count;
@@ -1580,7 +1580,7 @@ static ssize_t
1580mdoio_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) 1580mdoio_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1581{ 1581{
1582 struct netiucv_priv *priv = dev->driver_data; 1582 struct netiucv_priv *priv = dev->driver_data;
1583 1583
1584 IUCV_DBF_TEXT(trace, 5, __FUNCTION__); 1584 IUCV_DBF_TEXT(trace, 5, __FUNCTION__);
1585 priv->conn->prof.doios_multi = 0; 1585 priv->conn->prof.doios_multi = 0;
1586 return count; 1586 return count;
@@ -1601,7 +1601,7 @@ static ssize_t
1601txlen_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) 1601txlen_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1602{ 1602{
1603 struct netiucv_priv *priv = dev->driver_data; 1603 struct netiucv_priv *priv = dev->driver_data;
1604 1604
1605 IUCV_DBF_TEXT(trace, 4, __FUNCTION__); 1605 IUCV_DBF_TEXT(trace, 4, __FUNCTION__);
1606 priv->conn->prof.txlen = 0; 1606 priv->conn->prof.txlen = 0;
1607 return count; 1607 return count;
@@ -1622,7 +1622,7 @@ static ssize_t
1622txtime_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) 1622txtime_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1623{ 1623{
1624 struct netiucv_priv *priv = dev->driver_data; 1624 struct netiucv_priv *priv = dev->driver_data;
1625 1625
1626 IUCV_DBF_TEXT(trace, 4, __FUNCTION__); 1626 IUCV_DBF_TEXT(trace, 4, __FUNCTION__);
1627 priv->conn->prof.tx_time = 0; 1627 priv->conn->prof.tx_time = 0;
1628 return count; 1628 return count;
@@ -2000,7 +2000,7 @@ conn_write(struct device_driver *drv, const char *buf, size_t count)
2000 } 2000 }
2001 2001
2002 PRINT_INFO("%s: '%s'\n", dev->name, netiucv_printname(username)); 2002 PRINT_INFO("%s: '%s'\n", dev->name, netiucv_printname(username));
2003 2003
2004 return count; 2004 return count;
2005 2005
2006out_free_ndev: 2006out_free_ndev:
@@ -2099,7 +2099,7 @@ static int __init
2099netiucv_init(void) 2099netiucv_init(void)
2100{ 2100{
2101 int ret; 2101 int ret;
2102 2102
2103 ret = iucv_register_dbf_views(); 2103 ret = iucv_register_dbf_views();
2104 if (ret) { 2104 if (ret) {
2105 PRINT_WARN("netiucv_init failed, " 2105 PRINT_WARN("netiucv_init failed, "
@@ -2128,7 +2128,7 @@ netiucv_init(void)
2128 } 2128 }
2129 return ret; 2129 return ret;
2130} 2130}
2131 2131
2132module_init(netiucv_init); 2132module_init(netiucv_init);
2133module_exit(netiucv_exit); 2133module_exit(netiucv_exit);
2134MODULE_LICENSE("GPL"); 2134MODULE_LICENSE("GPL");
diff --git a/drivers/s390/net/qeth.h b/drivers/s390/net/qeth.h
index 4df0fcd7b10b..619f4a0c7160 100644
--- a/drivers/s390/net/qeth.h
+++ b/drivers/s390/net/qeth.h
@@ -376,7 +376,7 @@ struct qeth_hdr_osn {
376 __u8 reserved3[18]; 376 __u8 reserved3[18];
377 __u32 ccid; 377 __u32 ccid;
378} __attribute__ ((packed)); 378} __attribute__ ((packed));
379 379
380struct qeth_hdr { 380struct qeth_hdr {
381 union { 381 union {
382 struct qeth_hdr_layer2 l2; 382 struct qeth_hdr_layer2 l2;
@@ -825,7 +825,7 @@ struct qeth_card {
825 int use_hard_stop; 825 int use_hard_stop;
826 int (*orig_hard_header)(struct sk_buff *,struct net_device *, 826 int (*orig_hard_header)(struct sk_buff *,struct net_device *,
827 unsigned short,void *,void *,unsigned); 827 unsigned short,void *,void *,unsigned);
828 struct qeth_osn_info osn_info; 828 struct qeth_osn_info osn_info;
829}; 829};
830 830
831struct qeth_card_list_struct { 831struct qeth_card_list_struct {
@@ -944,7 +944,7 @@ qeth_get_netdev_flags(struct qeth_card *card)
944 return 0; 944 return 0;
945 switch (card->info.type) { 945 switch (card->info.type) {
946 case QETH_CARD_TYPE_IQD: 946 case QETH_CARD_TYPE_IQD:
947 case QETH_CARD_TYPE_OSN: 947 case QETH_CARD_TYPE_OSN:
948 return IFF_NOARP; 948 return IFF_NOARP;
949#ifdef CONFIG_QETH_IPV6 949#ifdef CONFIG_QETH_IPV6
950 default: 950 default:
@@ -981,7 +981,7 @@ static inline int
981qeth_get_max_mtu_for_card(int cardtype) 981qeth_get_max_mtu_for_card(int cardtype)
982{ 982{
983 switch (cardtype) { 983 switch (cardtype) {
984 984
985 case QETH_CARD_TYPE_UNKNOWN: 985 case QETH_CARD_TYPE_UNKNOWN:
986 case QETH_CARD_TYPE_OSAE: 986 case QETH_CARD_TYPE_OSAE:
987 case QETH_CARD_TYPE_OSN: 987 case QETH_CARD_TYPE_OSN:
@@ -1097,9 +1097,9 @@ qeth_string_to_ipaddr4(const char *buf, __u8 *addr)
1097 int count = 0, rc = 0; 1097 int count = 0, rc = 0;
1098 int in[4]; 1098 int in[4];
1099 1099
1100 rc = sscanf(buf, "%d.%d.%d.%d%n", 1100 rc = sscanf(buf, "%d.%d.%d.%d%n",
1101 &in[0], &in[1], &in[2], &in[3], &count); 1101 &in[0], &in[1], &in[2], &in[3], &count);
1102 if (rc != 4 || count) 1102 if (rc != 4 || count<=0)
1103 return -EINVAL; 1103 return -EINVAL;
1104 for (count = 0; count < 4; count++) { 1104 for (count = 0; count < 4; count++) {
1105 if (in[count] > 255) 1105 if (in[count] > 255)
@@ -1131,7 +1131,7 @@ qeth_string_to_ipaddr6(const char *buf, __u8 *addr)
1131 1131
1132 cnt = out = found = save_cnt = num2 = 0; 1132 cnt = out = found = save_cnt = num2 = 0;
1133 end = start = (char *) buf; 1133 end = start = (char *) buf;
1134 in = (__u16 *) addr; 1134 in = (__u16 *) addr;
1135 memset(in, 0, 16); 1135 memset(in, 0, 16);
1136 while (end) { 1136 while (end) {
1137 end = strchr(end,':'); 1137 end = strchr(end,':');
@@ -1139,7 +1139,7 @@ qeth_string_to_ipaddr6(const char *buf, __u8 *addr)
1139 end = (char *)buf + (strlen(buf)); 1139 end = (char *)buf + (strlen(buf));
1140 out = 1; 1140 out = 1;
1141 } 1141 }
1142 if ((end - start)) { 1142 if ((end - start)) {
1143 memset(num, 0, 5); 1143 memset(num, 0, 5);
1144 memcpy(num, start, end - start); 1144 memcpy(num, start, end - start);
1145 if (!qeth_isxdigit(num)) 1145 if (!qeth_isxdigit(num))
@@ -1241,5 +1241,5 @@ qeth_osn_register(unsigned char *read_dev_no,
1241 1241
1242extern void 1242extern void
1243qeth_osn_deregister(struct net_device *); 1243qeth_osn_deregister(struct net_device *);
1244 1244
1245#endif /* __QETH_H__ */ 1245#endif /* __QETH_H__ */
diff --git a/drivers/s390/net/qeth_eddp.c b/drivers/s390/net/qeth_eddp.c
index 44e226f211e7..0bab60a20309 100644
--- a/drivers/s390/net/qeth_eddp.c
+++ b/drivers/s390/net/qeth_eddp.c
@@ -81,7 +81,7 @@ void
81qeth_eddp_buf_release_contexts(struct qeth_qdio_out_buffer *buf) 81qeth_eddp_buf_release_contexts(struct qeth_qdio_out_buffer *buf)
82{ 82{
83 struct qeth_eddp_context_reference *ref; 83 struct qeth_eddp_context_reference *ref;
84 84
85 QETH_DBF_TEXT(trace, 6, "eddprctx"); 85 QETH_DBF_TEXT(trace, 6, "eddprctx");
86 while (!list_empty(&buf->ctx_list)){ 86 while (!list_empty(&buf->ctx_list)){
87 ref = list_entry(buf->ctx_list.next, 87 ref = list_entry(buf->ctx_list.next,
@@ -135,7 +135,7 @@ qeth_eddp_fill_buffer(struct qeth_qdio_out_q *queue,
135 "buffer!\n"); 135 "buffer!\n");
136 goto out; 136 goto out;
137 } 137 }
138 } 138 }
139 /* check if the whole next skb fits into current buffer */ 139 /* check if the whole next skb fits into current buffer */
140 if ((QETH_MAX_BUFFER_ELEMENTS(queue->card) - 140 if ((QETH_MAX_BUFFER_ELEMENTS(queue->card) -
141 buf->next_element_to_fill) 141 buf->next_element_to_fill)
@@ -148,7 +148,7 @@ qeth_eddp_fill_buffer(struct qeth_qdio_out_q *queue,
148 * and increment ctx's refcnt */ 148 * and increment ctx's refcnt */
149 must_refcnt = 1; 149 must_refcnt = 1;
150 continue; 150 continue;
151 } 151 }
152 if (must_refcnt){ 152 if (must_refcnt){
153 must_refcnt = 0; 153 must_refcnt = 0;
154 if (qeth_eddp_buf_ref_context(buf, ctx)){ 154 if (qeth_eddp_buf_ref_context(buf, ctx)){
@@ -266,7 +266,7 @@ qeth_eddp_copy_data_tcp(char *dst, struct qeth_eddp_data *eddp, int len,
266 int left_in_frag; 266 int left_in_frag;
267 int copy_len; 267 int copy_len;
268 u8 *src; 268 u8 *src;
269 269
270 QETH_DBF_TEXT(trace, 5, "eddpcdtc"); 270 QETH_DBF_TEXT(trace, 5, "eddpcdtc");
271 if (skb_shinfo(eddp->skb)->nr_frags == 0) { 271 if (skb_shinfo(eddp->skb)->nr_frags == 0) {
272 memcpy(dst, eddp->skb->data + eddp->skb_offset, len); 272 memcpy(dst, eddp->skb->data + eddp->skb_offset, len);
@@ -408,7 +408,7 @@ __qeth_eddp_fill_context_tcp(struct qeth_eddp_context *ctx,
408 struct tcphdr *tcph; 408 struct tcphdr *tcph;
409 int data_len; 409 int data_len;
410 u32 hcsum; 410 u32 hcsum;
411 411
412 QETH_DBF_TEXT(trace, 5, "eddpftcp"); 412 QETH_DBF_TEXT(trace, 5, "eddpftcp");
413 eddp->skb_offset = sizeof(struct qeth_hdr) + eddp->nhl + eddp->thl; 413 eddp->skb_offset = sizeof(struct qeth_hdr) + eddp->nhl + eddp->thl;
414 if (eddp->qh.hdr.l2.id == QETH_HEADER_TYPE_LAYER2) { 414 if (eddp->qh.hdr.l2.id == QETH_HEADER_TYPE_LAYER2) {
@@ -465,13 +465,13 @@ __qeth_eddp_fill_context_tcp(struct qeth_eddp_context *ctx,
465 eddp->th.tcp.h.seq += data_len; 465 eddp->th.tcp.h.seq += data_len;
466 } 466 }
467} 467}
468 468
469static inline int 469static inline int
470qeth_eddp_fill_context_tcp(struct qeth_eddp_context *ctx, 470qeth_eddp_fill_context_tcp(struct qeth_eddp_context *ctx,
471 struct sk_buff *skb, struct qeth_hdr *qhdr) 471 struct sk_buff *skb, struct qeth_hdr *qhdr)
472{ 472{
473 struct qeth_eddp_data *eddp = NULL; 473 struct qeth_eddp_data *eddp = NULL;
474 474
475 QETH_DBF_TEXT(trace, 5, "eddpficx"); 475 QETH_DBF_TEXT(trace, 5, "eddpficx");
476 /* create our segmentation headers and copy original headers */ 476 /* create our segmentation headers and copy original headers */
477 if (skb->protocol == ETH_P_IP) 477 if (skb->protocol == ETH_P_IP)
@@ -512,7 +512,7 @@ qeth_eddp_calc_num_pages(struct qeth_eddp_context *ctx, struct sk_buff *skb,
512 int hdr_len) 512 int hdr_len)
513{ 513{
514 int skbs_per_page; 514 int skbs_per_page;
515 515
516 QETH_DBF_TEXT(trace, 5, "eddpcanp"); 516 QETH_DBF_TEXT(trace, 5, "eddpcanp");
517 /* can we put multiple skbs in one page? */ 517 /* can we put multiple skbs in one page? */
518 skbs_per_page = PAGE_SIZE / (skb_shinfo(skb)->tso_size + hdr_len); 518 skbs_per_page = PAGE_SIZE / (skb_shinfo(skb)->tso_size + hdr_len);
@@ -588,7 +588,7 @@ qeth_eddp_create_context_tcp(struct qeth_card *card, struct sk_buff *skb,
588 struct qeth_hdr *qhdr) 588 struct qeth_hdr *qhdr)
589{ 589{
590 struct qeth_eddp_context *ctx = NULL; 590 struct qeth_eddp_context *ctx = NULL;
591 591
592 QETH_DBF_TEXT(trace, 5, "creddpct"); 592 QETH_DBF_TEXT(trace, 5, "creddpct");
593 if (skb->protocol == ETH_P_IP) 593 if (skb->protocol == ETH_P_IP)
594 ctx = qeth_eddp_create_context_generic(card, skb, 594 ctx = qeth_eddp_create_context_generic(card, skb,
diff --git a/drivers/s390/net/qeth_fs.h b/drivers/s390/net/qeth_fs.h
index e422b41c656e..61faf05517d6 100644
--- a/drivers/s390/net/qeth_fs.h
+++ b/drivers/s390/net/qeth_fs.h
@@ -42,7 +42,7 @@ qeth_create_device_attributes_osn(struct device *dev);
42 42
43extern void 43extern void
44qeth_remove_device_attributes_osn(struct device *dev); 44qeth_remove_device_attributes_osn(struct device *dev);
45 45
46extern int 46extern int
47qeth_create_driver_attributes(void); 47qeth_create_driver_attributes(void);
48 48
diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c
index b3c6e7907790..9e671a48cd2f 100644
--- a/drivers/s390/net/qeth_main.c
+++ b/drivers/s390/net/qeth_main.c
@@ -513,7 +513,7 @@ __qeth_set_offline(struct ccwgroup_device *cgdev, int recovery_mode)
513 513
514 QETH_DBF_TEXT(setup, 3, "setoffl"); 514 QETH_DBF_TEXT(setup, 3, "setoffl");
515 QETH_DBF_HEX(setup, 3, &card, sizeof(void *)); 515 QETH_DBF_HEX(setup, 3, &card, sizeof(void *));
516 516
517 if (card->dev && netif_carrier_ok(card->dev)) 517 if (card->dev && netif_carrier_ok(card->dev))
518 netif_carrier_off(card->dev); 518 netif_carrier_off(card->dev);
519 recover_flag = card->state; 519 recover_flag = card->state;
@@ -604,13 +604,13 @@ __qeth_ref_ip_on_card(struct qeth_card *card, struct qeth_ipaddr *todo,
604 list_for_each_entry(addr, &card->ip_list, entry) { 604 list_for_each_entry(addr, &card->ip_list, entry) {
605 if (card->options.layer2) { 605 if (card->options.layer2) {
606 if ((addr->type == todo->type) && 606 if ((addr->type == todo->type) &&
607 (memcmp(&addr->mac, &todo->mac, 607 (memcmp(&addr->mac, &todo->mac,
608 OSA_ADDR_LEN) == 0)) { 608 OSA_ADDR_LEN) == 0)) {
609 found = 1; 609 found = 1;
610 break; 610 break;
611 } 611 }
612 continue; 612 continue;
613 } 613 }
614 if ((addr->proto == QETH_PROT_IPV4) && 614 if ((addr->proto == QETH_PROT_IPV4) &&
615 (todo->proto == QETH_PROT_IPV4) && 615 (todo->proto == QETH_PROT_IPV4) &&
616 (addr->type == todo->type) && 616 (addr->type == todo->type) &&
@@ -694,13 +694,13 @@ __qeth_insert_ip_todo(struct qeth_card *card, struct qeth_ipaddr *addr, int add)
694 if (card->options.layer2) { 694 if (card->options.layer2) {
695 if ((tmp->type == addr->type) && 695 if ((tmp->type == addr->type) &&
696 (tmp->is_multicast == addr->is_multicast) && 696 (tmp->is_multicast == addr->is_multicast) &&
697 (memcmp(&tmp->mac, &addr->mac, 697 (memcmp(&tmp->mac, &addr->mac,
698 OSA_ADDR_LEN) == 0)) { 698 OSA_ADDR_LEN) == 0)) {
699 found = 1; 699 found = 1;
700 break; 700 break;
701 } 701 }
702 continue; 702 continue;
703 } 703 }
704 if ((tmp->proto == QETH_PROT_IPV4) && 704 if ((tmp->proto == QETH_PROT_IPV4) &&
705 (addr->proto == QETH_PROT_IPV4) && 705 (addr->proto == QETH_PROT_IPV4) &&
706 (tmp->type == addr->type) && 706 (tmp->type == addr->type) &&
@@ -1173,7 +1173,7 @@ qeth_determine_card_type(struct qeth_card *card)
1173 "due to hardware limitations!\n"); 1173 "due to hardware limitations!\n");
1174 card->qdio.no_out_queues = 1; 1174 card->qdio.no_out_queues = 1;
1175 card->qdio.default_out_queue = 0; 1175 card->qdio.default_out_queue = 0;
1176 } 1176 }
1177 return 0; 1177 return 0;
1178 } 1178 }
1179 i++; 1179 i++;
@@ -1198,7 +1198,7 @@ qeth_probe_device(struct ccwgroup_device *gdev)
1198 return -ENODEV; 1198 return -ENODEV;
1199 1199
1200 QETH_DBF_TEXT_(setup, 2, "%s", gdev->dev.bus_id); 1200 QETH_DBF_TEXT_(setup, 2, "%s", gdev->dev.bus_id);
1201 1201
1202 card = qeth_alloc_card(); 1202 card = qeth_alloc_card();
1203 if (!card) { 1203 if (!card) {
1204 put_device(dev); 1204 put_device(dev);
@@ -1220,7 +1220,7 @@ qeth_probe_device(struct ccwgroup_device *gdev)
1220 put_device(dev); 1220 put_device(dev);
1221 qeth_free_card(card); 1221 qeth_free_card(card);
1222 return rc; 1222 return rc;
1223 } 1223 }
1224 if ((rc = qeth_setup_card(card))){ 1224 if ((rc = qeth_setup_card(card))){
1225 QETH_DBF_TEXT_(setup, 2, "2err%d", rc); 1225 QETH_DBF_TEXT_(setup, 2, "2err%d", rc);
1226 put_device(dev); 1226 put_device(dev);
@@ -1843,7 +1843,7 @@ struct qeth_cmd_buffer *iob)
1843 &card->seqno.pdu_hdr_ack, QETH_SEQ_NO_LENGTH); 1843 &card->seqno.pdu_hdr_ack, QETH_SEQ_NO_LENGTH);
1844 QETH_DBF_HEX(control, 2, iob->data, QETH_DBF_CONTROL_LEN); 1844 QETH_DBF_HEX(control, 2, iob->data, QETH_DBF_CONTROL_LEN);
1845} 1845}
1846 1846
1847static int 1847static int
1848qeth_send_control_data(struct qeth_card *card, int len, 1848qeth_send_control_data(struct qeth_card *card, int len,
1849 struct qeth_cmd_buffer *iob, 1849 struct qeth_cmd_buffer *iob,
@@ -1937,7 +1937,7 @@ qeth_osn_send_control_data(struct qeth_card *card, int len,
1937 wake_up(&card->wait_q); 1937 wake_up(&card->wait_q);
1938 } 1938 }
1939 return rc; 1939 return rc;
1940} 1940}
1941 1941
1942static inline void 1942static inline void
1943qeth_prepare_ipa_cmd(struct qeth_card *card, struct qeth_cmd_buffer *iob, 1943qeth_prepare_ipa_cmd(struct qeth_card *card, struct qeth_cmd_buffer *iob,
@@ -1966,7 +1966,7 @@ qeth_osn_send_ipa_cmd(struct qeth_card *card, struct qeth_cmd_buffer *iob,
1966 memcpy(QETH_IPA_PDU_LEN_PDU3(iob->data), &s2, 2); 1966 memcpy(QETH_IPA_PDU_LEN_PDU3(iob->data), &s2, 2);
1967 return qeth_osn_send_control_data(card, s1, iob); 1967 return qeth_osn_send_control_data(card, s1, iob);
1968} 1968}
1969 1969
1970static int 1970static int
1971qeth_send_ipa_cmd(struct qeth_card *card, struct qeth_cmd_buffer *iob, 1971qeth_send_ipa_cmd(struct qeth_card *card, struct qeth_cmd_buffer *iob,
1972 int (*reply_cb) 1972 int (*reply_cb)
@@ -2579,7 +2579,7 @@ qeth_process_inbound_buffer(struct qeth_card *card,
2579 skb->dev = card->dev; 2579 skb->dev = card->dev;
2580 if (hdr->hdr.l2.id == QETH_HEADER_TYPE_LAYER2) 2580 if (hdr->hdr.l2.id == QETH_HEADER_TYPE_LAYER2)
2581 vlan_tag = qeth_layer2_rebuild_skb(card, skb, hdr); 2581 vlan_tag = qeth_layer2_rebuild_skb(card, skb, hdr);
2582 else if (hdr->hdr.l3.id == QETH_HEADER_TYPE_LAYER3) 2582 else if (hdr->hdr.l3.id == QETH_HEADER_TYPE_LAYER3)
2583 qeth_rebuild_skb(card, skb, hdr); 2583 qeth_rebuild_skb(card, skb, hdr);
2584 else { /*in case of OSN*/ 2584 else { /*in case of OSN*/
2585 skb_push(skb, sizeof(struct qeth_hdr)); 2585 skb_push(skb, sizeof(struct qeth_hdr));
@@ -2763,7 +2763,7 @@ qeth_qdio_input_handler(struct ccw_device * ccwdev, unsigned int status,
2763 index = i % QDIO_MAX_BUFFERS_PER_Q; 2763 index = i % QDIO_MAX_BUFFERS_PER_Q;
2764 buffer = &card->qdio.in_q->bufs[index]; 2764 buffer = &card->qdio.in_q->bufs[index];
2765 if (!((status & QDIO_STATUS_LOOK_FOR_ERROR) && 2765 if (!((status & QDIO_STATUS_LOOK_FOR_ERROR) &&
2766 qeth_check_qdio_errors(buffer->buffer, 2766 qeth_check_qdio_errors(buffer->buffer,
2767 qdio_err, siga_err,"qinerr"))) 2767 qdio_err, siga_err,"qinerr")))
2768 qeth_process_inbound_buffer(card, buffer, index); 2768 qeth_process_inbound_buffer(card, buffer, index);
2769 /* clear buffer and give back to hardware */ 2769 /* clear buffer and give back to hardware */
@@ -3187,7 +3187,7 @@ qeth_alloc_qdio_buffers(struct qeth_card *card)
3187 if (card->qdio.state == QETH_QDIO_ALLOCATED) 3187 if (card->qdio.state == QETH_QDIO_ALLOCATED)
3188 return 0; 3188 return 0;
3189 3189
3190 card->qdio.in_q = kmalloc(sizeof(struct qeth_qdio_q), 3190 card->qdio.in_q = kmalloc(sizeof(struct qeth_qdio_q),
3191 GFP_KERNEL|GFP_DMA); 3191 GFP_KERNEL|GFP_DMA);
3192 if (!card->qdio.in_q) 3192 if (!card->qdio.in_q)
3193 return - ENOMEM; 3193 return - ENOMEM;
@@ -3476,7 +3476,7 @@ qeth_halt_channels(struct qeth_card *card)
3476 rc3 = qeth_halt_channel(&card->data); 3476 rc3 = qeth_halt_channel(&card->data);
3477 if (rc1) 3477 if (rc1)
3478 return rc1; 3478 return rc1;
3479 if (rc2) 3479 if (rc2)
3480 return rc2; 3480 return rc2;
3481 return rc3; 3481 return rc3;
3482} 3482}
@@ -3491,7 +3491,7 @@ qeth_clear_channels(struct qeth_card *card)
3491 rc3 = qeth_clear_channel(&card->data); 3491 rc3 = qeth_clear_channel(&card->data);
3492 if (rc1) 3492 if (rc1)
3493 return rc1; 3493 return rc1;
3494 if (rc2) 3494 if (rc2)
3495 return rc2; 3495 return rc2;
3496 return rc3; 3496 return rc3;
3497} 3497}
@@ -3798,10 +3798,10 @@ qeth_open(struct net_device *dev)
3798 QETH_DBF_TEXT(trace,4,"nomacadr"); 3798 QETH_DBF_TEXT(trace,4,"nomacadr");
3799 return -EPERM; 3799 return -EPERM;
3800 } 3800 }
3801 card->dev->flags |= IFF_UP;
3802 netif_start_queue(dev);
3803 card->data.state = CH_STATE_UP; 3801 card->data.state = CH_STATE_UP;
3804 card->state = CARD_STATE_UP; 3802 card->state = CARD_STATE_UP;
3803 card->dev->flags |= IFF_UP;
3804 netif_start_queue(dev);
3805 3805
3806 if (!card->lan_online && netif_carrier_ok(dev)) 3806 if (!card->lan_online && netif_carrier_ok(dev))
3807 netif_carrier_off(dev); 3807 netif_carrier_off(dev);
@@ -3817,7 +3817,7 @@ qeth_stop(struct net_device *dev)
3817 3817
3818 card = (struct qeth_card *) dev->priv; 3818 card = (struct qeth_card *) dev->priv;
3819 3819
3820 netif_stop_queue(dev); 3820 netif_tx_disable(dev);
3821 card->dev->flags &= ~IFF_UP; 3821 card->dev->flags &= ~IFF_UP;
3822 if (card->state == CARD_STATE_UP) 3822 if (card->state == CARD_STATE_UP)
3823 card->state = CARD_STATE_SOFTSETUP; 3823 card->state = CARD_STATE_SOFTSETUP;
@@ -3958,7 +3958,7 @@ qeth_prepare_skb(struct qeth_card *card, struct sk_buff **skb,
3958#endif 3958#endif
3959 *hdr = (struct qeth_hdr *) 3959 *hdr = (struct qeth_hdr *)
3960 qeth_push_skb(card, skb, sizeof(struct qeth_hdr)); 3960 qeth_push_skb(card, skb, sizeof(struct qeth_hdr));
3961 if (hdr == NULL) 3961 if (*hdr == NULL)
3962 return -EINVAL; 3962 return -EINVAL;
3963 return 0; 3963 return 0;
3964} 3964}
@@ -4098,7 +4098,7 @@ qeth_fill_header(struct qeth_card *card, struct qeth_hdr *hdr,
4098 } 4098 }
4099 } else { /* passthrough */ 4099 } else { /* passthrough */
4100 if((skb->dev->type == ARPHRD_IEEE802_TR) && 4100 if((skb->dev->type == ARPHRD_IEEE802_TR) &&
4101 !memcmp(skb->data + sizeof(struct qeth_hdr) + 4101 !memcmp(skb->data + sizeof(struct qeth_hdr) +
4102 sizeof(__u16), skb->dev->broadcast, 6)) { 4102 sizeof(__u16), skb->dev->broadcast, 6)) {
4103 hdr->hdr.l3.flags = QETH_CAST_BROADCAST | 4103 hdr->hdr.l3.flags = QETH_CAST_BROADCAST |
4104 QETH_HDR_PASSTHRU; 4104 QETH_HDR_PASSTHRU;
@@ -4385,7 +4385,7 @@ out:
4385} 4385}
4386 4386
4387static inline int 4387static inline int
4388qeth_get_elements_no(struct qeth_card *card, void *hdr, 4388qeth_get_elements_no(struct qeth_card *card, void *hdr,
4389 struct sk_buff *skb, int elems) 4389 struct sk_buff *skb, int elems)
4390{ 4390{
4391 int elements_needed = 0; 4391 int elements_needed = 0;
@@ -4416,6 +4416,8 @@ qeth_send_packet(struct qeth_card *card, struct sk_buff *skb)
4416 enum qeth_large_send_types large_send = QETH_LARGE_SEND_NO; 4416 enum qeth_large_send_types large_send = QETH_LARGE_SEND_NO;
4417 struct qeth_eddp_context *ctx = NULL; 4417 struct qeth_eddp_context *ctx = NULL;
4418 int tx_bytes = skb->len; 4418 int tx_bytes = skb->len;
4419 unsigned short nr_frags = skb_shinfo(skb)->nr_frags;
4420 unsigned short tso_size = skb_shinfo(skb)->tso_size;
4419 int rc; 4421 int rc;
4420 4422
4421 QETH_DBF_TEXT(trace, 6, "sendpkt"); 4423 QETH_DBF_TEXT(trace, 6, "sendpkt");
@@ -4441,7 +4443,7 @@ qeth_send_packet(struct qeth_card *card, struct sk_buff *skb)
4441 return 0; 4443 return 0;
4442 } 4444 }
4443 cast_type = qeth_get_cast_type(card, skb); 4445 cast_type = qeth_get_cast_type(card, skb);
4444 if ((cast_type == RTN_BROADCAST) && 4446 if ((cast_type == RTN_BROADCAST) &&
4445 (card->info.broadcast_capable == 0)){ 4447 (card->info.broadcast_capable == 0)){
4446 card->stats.tx_dropped++; 4448 card->stats.tx_dropped++;
4447 card->stats.tx_errors++; 4449 card->stats.tx_errors++;
@@ -4463,7 +4465,7 @@ qeth_send_packet(struct qeth_card *card, struct sk_buff *skb)
4463 card->stats.tx_errors++; 4465 card->stats.tx_errors++;
4464 dev_kfree_skb_any(skb); 4466 dev_kfree_skb_any(skb);
4465 return NETDEV_TX_OK; 4467 return NETDEV_TX_OK;
4466 } 4468 }
4467 elements_needed++; 4469 elements_needed++;
4468 } else { 4470 } else {
4469 if ((rc = qeth_prepare_skb(card, &skb, &hdr, ipv))) { 4471 if ((rc = qeth_prepare_skb(card, &skb, &hdr, ipv))) {
@@ -4498,16 +4500,16 @@ qeth_send_packet(struct qeth_card *card, struct sk_buff *skb)
4498 card->stats.tx_packets++; 4500 card->stats.tx_packets++;
4499 card->stats.tx_bytes += tx_bytes; 4501 card->stats.tx_bytes += tx_bytes;
4500#ifdef CONFIG_QETH_PERF_STATS 4502#ifdef CONFIG_QETH_PERF_STATS
4501 if (skb_shinfo(skb)->tso_size && 4503 if (tso_size &&
4502 !(large_send == QETH_LARGE_SEND_NO)) { 4504 !(large_send == QETH_LARGE_SEND_NO)) {
4503 card->perf_stats.large_send_bytes += skb->len; 4505 card->perf_stats.large_send_bytes += tx_bytes;
4504 card->perf_stats.large_send_cnt++; 4506 card->perf_stats.large_send_cnt++;
4505 } 4507 }
4506 if (skb_shinfo(skb)->nr_frags > 0){ 4508 if (nr_frags > 0){
4507 card->perf_stats.sg_skbs_sent++; 4509 card->perf_stats.sg_skbs_sent++;
4508 /* nr_frags + skb->data */ 4510 /* nr_frags + skb->data */
4509 card->perf_stats.sg_frags_sent += 4511 card->perf_stats.sg_frags_sent +=
4510 skb_shinfo(skb)->nr_frags + 1; 4512 nr_frags + 1;
4511 } 4513 }
4512#endif /* CONFIG_QETH_PERF_STATS */ 4514#endif /* CONFIG_QETH_PERF_STATS */
4513 } 4515 }
@@ -5373,7 +5375,7 @@ qeth_layer2_send_setdelvlan_cb(struct qeth_card *card,
5373 cmd = (struct qeth_ipa_cmd *) data; 5375 cmd = (struct qeth_ipa_cmd *) data;
5374 if (cmd->hdr.return_code) { 5376 if (cmd->hdr.return_code) {
5375 PRINT_ERR("Error in processing VLAN %i on %s: 0x%x. " 5377 PRINT_ERR("Error in processing VLAN %i on %s: 0x%x. "
5376 "Continuing\n",cmd->data.setdelvlan.vlan_id, 5378 "Continuing\n",cmd->data.setdelvlan.vlan_id,
5377 QETH_CARD_IFNAME(card), cmd->hdr.return_code); 5379 QETH_CARD_IFNAME(card), cmd->hdr.return_code);
5378 QETH_DBF_TEXT_(trace, 2, "L2VL%4x", cmd->hdr.command); 5380 QETH_DBF_TEXT_(trace, 2, "L2VL%4x", cmd->hdr.command);
5379 QETH_DBF_TEXT_(trace, 2, "L2%s", CARD_BUS_ID(card)); 5381 QETH_DBF_TEXT_(trace, 2, "L2%s", CARD_BUS_ID(card));
@@ -5393,7 +5395,7 @@ qeth_layer2_send_setdelvlan(struct qeth_card *card, __u16 i,
5393 iob = qeth_get_ipacmd_buffer(card, ipacmd, QETH_PROT_IPV4); 5395 iob = qeth_get_ipacmd_buffer(card, ipacmd, QETH_PROT_IPV4);
5394 cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE); 5396 cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE);
5395 cmd->data.setdelvlan.vlan_id = i; 5397 cmd->data.setdelvlan.vlan_id = i;
5396 return qeth_send_ipa_cmd(card, iob, 5398 return qeth_send_ipa_cmd(card, iob,
5397 qeth_layer2_send_setdelvlan_cb, NULL); 5399 qeth_layer2_send_setdelvlan_cb, NULL);
5398} 5400}
5399 5401
@@ -5457,7 +5459,7 @@ qeth_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
5457 * Examine hardware response to SET_PROMISC_MODE 5459 * Examine hardware response to SET_PROMISC_MODE
5458 */ 5460 */
5459static int 5461static int
5460qeth_setadp_promisc_mode_cb(struct qeth_card *card, 5462qeth_setadp_promisc_mode_cb(struct qeth_card *card,
5461 struct qeth_reply *reply, 5463 struct qeth_reply *reply,
5462 unsigned long data) 5464 unsigned long data)
5463{ 5465{
@@ -5468,10 +5470,10 @@ qeth_setadp_promisc_mode_cb(struct qeth_card *card,
5468 5470
5469 cmd = (struct qeth_ipa_cmd *) data; 5471 cmd = (struct qeth_ipa_cmd *) data;
5470 setparms = &(cmd->data.setadapterparms); 5472 setparms = &(cmd->data.setadapterparms);
5471 5473
5472 qeth_default_setadapterparms_cb(card, reply, (unsigned long)cmd); 5474 qeth_default_setadapterparms_cb(card, reply, (unsigned long)cmd);
5473 if (cmd->hdr.return_code) { 5475 if (cmd->hdr.return_code) {
5474 QETH_DBF_TEXT_(trace,4,"prmrc%2.2x",cmd->hdr.return_code); 5476 QETH_DBF_TEXT_(trace,4,"prmrc%2.2x",cmd->hdr.return_code);
5475 setparms->data.mode = SET_PROMISC_MODE_OFF; 5477 setparms->data.mode = SET_PROMISC_MODE_OFF;
5476 } 5478 }
5477 card->info.promisc_mode = setparms->data.mode; 5479 card->info.promisc_mode = setparms->data.mode;
@@ -5517,7 +5519,7 @@ qeth_set_multicast_list(struct net_device *dev)
5517 5519
5518 if (card->info.type == QETH_CARD_TYPE_OSN) 5520 if (card->info.type == QETH_CARD_TYPE_OSN)
5519 return ; 5521 return ;
5520 5522
5521 QETH_DBF_TEXT(trace, 3, "setmulti"); 5523 QETH_DBF_TEXT(trace, 3, "setmulti");
5522 qeth_delete_mc_addresses(card); 5524 qeth_delete_mc_addresses(card);
5523 if (card->options.layer2) { 5525 if (card->options.layer2) {
@@ -5575,7 +5577,7 @@ qeth_osn_assist(struct net_device *dev,
5575 struct qeth_cmd_buffer *iob; 5577 struct qeth_cmd_buffer *iob;
5576 struct qeth_card *card; 5578 struct qeth_card *card;
5577 int rc; 5579 int rc;
5578 5580
5579 QETH_DBF_TEXT(trace, 2, "osnsdmc"); 5581 QETH_DBF_TEXT(trace, 2, "osnsdmc");
5580 if (!dev) 5582 if (!dev)
5581 return -ENODEV; 5583 return -ENODEV;
@@ -5654,7 +5656,7 @@ qeth_osn_deregister(struct net_device * dev)
5654 card->osn_info.data_cb = NULL; 5656 card->osn_info.data_cb = NULL;
5655 return; 5657 return;
5656} 5658}
5657 5659
5658static void 5660static void
5659qeth_delete_mc_addresses(struct qeth_card *card) 5661qeth_delete_mc_addresses(struct qeth_card *card)
5660{ 5662{
@@ -5818,7 +5820,7 @@ qeth_add_multicast_ipv6(struct qeth_card *card)
5818 struct inet6_dev *in6_dev; 5820 struct inet6_dev *in6_dev;
5819 5821
5820 QETH_DBF_TEXT(trace,4,"chkmcv6"); 5822 QETH_DBF_TEXT(trace,4,"chkmcv6");
5821 if (!qeth_is_supported(card, IPA_IPV6)) 5823 if (!qeth_is_supported(card, IPA_IPV6))
5822 return ; 5824 return ;
5823 in6_dev = in6_dev_get(card->dev); 5825 in6_dev = in6_dev_get(card->dev);
5824 if (in6_dev == NULL) 5826 if (in6_dev == NULL)
@@ -6359,12 +6361,9 @@ qeth_netdev_init(struct net_device *dev)
6359 dev->vlan_rx_kill_vid = qeth_vlan_rx_kill_vid; 6361 dev->vlan_rx_kill_vid = qeth_vlan_rx_kill_vid;
6360 dev->vlan_rx_add_vid = qeth_vlan_rx_add_vid; 6362 dev->vlan_rx_add_vid = qeth_vlan_rx_add_vid;
6361#endif 6363#endif
6362 dev->hard_header = card->orig_hard_header;
6363 if (qeth_get_netdev_flags(card) & IFF_NOARP) { 6364 if (qeth_get_netdev_flags(card) & IFF_NOARP) {
6364 dev->rebuild_header = NULL; 6365 dev->rebuild_header = NULL;
6365 dev->hard_header = NULL; 6366 dev->hard_header = NULL;
6366 if (card->options.fake_ll)
6367 dev->hard_header = qeth_fake_header;
6368 dev->header_cache_update = NULL; 6367 dev->header_cache_update = NULL;
6369 dev->hard_header_cache = NULL; 6368 dev->hard_header_cache = NULL;
6370 } 6369 }
@@ -6373,6 +6372,9 @@ qeth_netdev_init(struct net_device *dev)
6373 if (!(card->info.unique_id & UNIQUE_ID_NOT_BY_CARD)) 6372 if (!(card->info.unique_id & UNIQUE_ID_NOT_BY_CARD))
6374 card->dev->dev_id = card->info.unique_id & 0xffff; 6373 card->dev->dev_id = card->info.unique_id & 0xffff;
6375#endif 6374#endif
6375 if (card->options.fake_ll &&
6376 (qeth_get_netdev_flags(card) & IFF_NOARP))
6377 dev->hard_header = qeth_fake_header;
6376 dev->hard_header_parse = NULL; 6378 dev->hard_header_parse = NULL;
6377 dev->set_mac_address = qeth_layer2_set_mac_address; 6379 dev->set_mac_address = qeth_layer2_set_mac_address;
6378 dev->flags |= qeth_get_netdev_flags(card); 6380 dev->flags |= qeth_get_netdev_flags(card);
@@ -6477,6 +6479,9 @@ retry:
6477 /*network device will be recovered*/ 6479 /*network device will be recovered*/
6478 if (card->dev) { 6480 if (card->dev) {
6479 card->dev->hard_header = card->orig_hard_header; 6481 card->dev->hard_header = card->orig_hard_header;
6482 if (card->options.fake_ll &&
6483 (qeth_get_netdev_flags(card) & IFF_NOARP))
6484 card->dev->hard_header = qeth_fake_header;
6480 return 0; 6485 return 0;
6481 } 6486 }
6482 /* at first set_online allocate netdev */ 6487 /* at first set_online allocate netdev */
@@ -6584,7 +6589,7 @@ qeth_setadpparms_change_macaddr_cb(struct qeth_card *card,
6584 6589
6585 cmd = (struct qeth_ipa_cmd *) data; 6590 cmd = (struct qeth_ipa_cmd *) data;
6586 if (!card->options.layer2 || card->info.guestlan || 6591 if (!card->options.layer2 || card->info.guestlan ||
6587 !(card->info.mac_bits & QETH_LAYER2_MAC_READ)) { 6592 !(card->info.mac_bits & QETH_LAYER2_MAC_READ)) {
6588 memcpy(card->dev->dev_addr, 6593 memcpy(card->dev->dev_addr,
6589 &cmd->data.setadapterparms.data.change_addr.addr, 6594 &cmd->data.setadapterparms.data.change_addr.addr,
6590 OSA_ADDR_LEN); 6595 OSA_ADDR_LEN);
@@ -7031,14 +7036,12 @@ qeth_softsetup_ipv6(struct qeth_card *card)
7031 7036
7032 QETH_DBF_TEXT(trace,3,"softipv6"); 7037 QETH_DBF_TEXT(trace,3,"softipv6");
7033 7038
7034 netif_stop_queue(card->dev);
7035 rc = qeth_send_startlan(card, QETH_PROT_IPV6); 7039 rc = qeth_send_startlan(card, QETH_PROT_IPV6);
7036 if (rc) { 7040 if (rc) {
7037 PRINT_ERR("IPv6 startlan failed on %s\n", 7041 PRINT_ERR("IPv6 startlan failed on %s\n",
7038 QETH_CARD_IFNAME(card)); 7042 QETH_CARD_IFNAME(card));
7039 return rc; 7043 return rc;
7040 } 7044 }
7041 netif_wake_queue(card->dev);
7042 rc = qeth_query_ipassists(card,QETH_PROT_IPV6); 7045 rc = qeth_query_ipassists(card,QETH_PROT_IPV6);
7043 if (rc) { 7046 if (rc) {
7044 PRINT_ERR("IPv6 query ipassist failed on %s\n", 7047 PRINT_ERR("IPv6 query ipassist failed on %s\n",
@@ -7352,7 +7355,8 @@ qeth_set_large_send(struct qeth_card *card, enum qeth_large_send_types type)
7352 card->options.large_send = type; 7355 card->options.large_send = type;
7353 return 0; 7356 return 0;
7354 } 7357 }
7355 netif_stop_queue(card->dev); 7358 if (card->state == CARD_STATE_UP)
7359 netif_tx_disable(card->dev);
7356 card->options.large_send = type; 7360 card->options.large_send = type;
7357 switch (card->options.large_send) { 7361 switch (card->options.large_send) {
7358 case QETH_LARGE_SEND_EDDP: 7362 case QETH_LARGE_SEND_EDDP:
@@ -7374,7 +7378,8 @@ qeth_set_large_send(struct qeth_card *card, enum qeth_large_send_types type)
7374 card->dev->features &= ~(NETIF_F_TSO | NETIF_F_SG); 7378 card->dev->features &= ~(NETIF_F_TSO | NETIF_F_SG);
7375 break; 7379 break;
7376 } 7380 }
7377 netif_wake_queue(card->dev); 7381 if (card->state == CARD_STATE_UP)
7382 netif_wake_queue(card->dev);
7378 return rc; 7383 return rc;
7379} 7384}
7380 7385
@@ -7427,7 +7432,7 @@ qeth_softsetup_card(struct qeth_card *card)
7427 if ((rc = qeth_setrouting_v6(card))) 7432 if ((rc = qeth_setrouting_v6(card)))
7428 QETH_DBF_TEXT_(setup, 2, "5err%d", rc); 7433 QETH_DBF_TEXT_(setup, 2, "5err%d", rc);
7429out: 7434out:
7430 netif_stop_queue(card->dev); 7435 netif_tx_disable(card->dev);
7431 return 0; 7436 return 0;
7432} 7437}
7433 7438
@@ -7567,7 +7572,7 @@ qeth_stop_card(struct qeth_card *card, int recovery_mode)
7567 if (card->read.state == CH_STATE_UP && 7572 if (card->read.state == CH_STATE_UP &&
7568 card->write.state == CH_STATE_UP && 7573 card->write.state == CH_STATE_UP &&
7569 (card->state == CARD_STATE_UP)) { 7574 (card->state == CARD_STATE_UP)) {
7570 if (recovery_mode && 7575 if (recovery_mode &&
7571 card->info.type != QETH_CARD_TYPE_OSN) { 7576 card->info.type != QETH_CARD_TYPE_OSN) {
7572 qeth_stop(card->dev); 7577 qeth_stop(card->dev);
7573 } else { 7578 } else {
@@ -7736,10 +7741,8 @@ static int
7736qeth_register_netdev(struct qeth_card *card) 7741qeth_register_netdev(struct qeth_card *card)
7737{ 7742{
7738 QETH_DBF_TEXT(setup, 3, "regnetd"); 7743 QETH_DBF_TEXT(setup, 3, "regnetd");
7739 if (card->dev->reg_state != NETREG_UNINITIALIZED) { 7744 if (card->dev->reg_state != NETREG_UNINITIALIZED)
7740 qeth_netdev_init(card->dev);
7741 return 0; 7745 return 0;
7742 }
7743 /* sysfs magic */ 7746 /* sysfs magic */
7744 SET_NETDEV_DEV(card->dev, &card->gdev->dev); 7747 SET_NETDEV_DEV(card->dev, &card->gdev->dev);
7745 return register_netdev(card->dev); 7748 return register_netdev(card->dev);
@@ -7750,7 +7753,7 @@ qeth_start_again(struct qeth_card *card, int recovery_mode)
7750{ 7753{
7751 QETH_DBF_TEXT(setup ,2, "startag"); 7754 QETH_DBF_TEXT(setup ,2, "startag");
7752 7755
7753 if (recovery_mode && 7756 if (recovery_mode &&
7754 card->info.type != QETH_CARD_TYPE_OSN) { 7757 card->info.type != QETH_CARD_TYPE_OSN) {
7755 qeth_open(card->dev); 7758 qeth_open(card->dev);
7756 } else { 7759 } else {
@@ -8014,7 +8017,6 @@ static int (*qeth_old_arp_constructor) (struct neighbour *);
8014 8017
8015static struct neigh_ops arp_direct_ops_template = { 8018static struct neigh_ops arp_direct_ops_template = {
8016 .family = AF_INET, 8019 .family = AF_INET,
8017 .destructor = NULL,
8018 .solicit = NULL, 8020 .solicit = NULL,
8019 .error_report = NULL, 8021 .error_report = NULL,
8020 .output = dev_queue_xmit, 8022 .output = dev_queue_xmit,
diff --git a/drivers/s390/net/qeth_mpc.h b/drivers/s390/net/qeth_mpc.h
index 011c41041029..0477c47471c5 100644
--- a/drivers/s390/net/qeth_mpc.h
+++ b/drivers/s390/net/qeth_mpc.h
@@ -445,7 +445,7 @@ enum qeth_ipa_arp_return_codes {
445/* Helper functions */ 445/* Helper functions */
446#define IS_IPA_REPLY(cmd) ((cmd->hdr.initiator == IPA_CMD_INITIATOR_HOST) || \ 446#define IS_IPA_REPLY(cmd) ((cmd->hdr.initiator == IPA_CMD_INITIATOR_HOST) || \
447 (cmd->hdr.initiator == IPA_CMD_INITIATOR_OSA_REPLY)) 447 (cmd->hdr.initiator == IPA_CMD_INITIATOR_OSA_REPLY))
448 448
449/*****************************************************************************/ 449/*****************************************************************************/
450/* END OF IP Assist related definitions */ 450/* END OF IP Assist related definitions */
451/*****************************************************************************/ 451/*****************************************************************************/
@@ -490,7 +490,7 @@ extern unsigned char ULP_ENABLE[];
490/* Layer 2 defintions */ 490/* Layer 2 defintions */
491#define QETH_PROT_LAYER2 0x08 491#define QETH_PROT_LAYER2 0x08
492#define QETH_PROT_TCPIP 0x03 492#define QETH_PROT_TCPIP 0x03
493#define QETH_PROT_OSN2 0x0a 493#define QETH_PROT_OSN2 0x0a
494#define QETH_ULP_ENABLE_PROT_TYPE(buffer) (buffer+0x50) 494#define QETH_ULP_ENABLE_PROT_TYPE(buffer) (buffer+0x50)
495#define QETH_IPA_CMD_PROT_TYPE(buffer) (buffer+0x19) 495#define QETH_IPA_CMD_PROT_TYPE(buffer) (buffer+0x19)
496 496
diff --git a/drivers/s390/net/qeth_proc.c b/drivers/s390/net/qeth_proc.c
index 360d782c7ada..66f2da14e6e3 100644
--- a/drivers/s390/net/qeth_proc.c
+++ b/drivers/s390/net/qeth_proc.c
@@ -36,7 +36,7 @@ qeth_procfile_seq_start(struct seq_file *s, loff_t *offset)
36{ 36{
37 struct device *dev = NULL; 37 struct device *dev = NULL;
38 loff_t nr = 0; 38 loff_t nr = 0;
39 39
40 down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); 40 down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem);
41 if (*offset == 0) 41 if (*offset == 0)
42 return SEQ_START_TOKEN; 42 return SEQ_START_TOKEN;
@@ -60,8 +60,8 @@ static void *
60qeth_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset) 60qeth_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset)
61{ 61{
62 struct device *prev, *next; 62 struct device *prev, *next;
63 63
64 if (it == SEQ_START_TOKEN) 64 if (it == SEQ_START_TOKEN)
65 prev = NULL; 65 prev = NULL;
66 else 66 else
67 prev = (struct device *) it; 67 prev = (struct device *) it;
@@ -180,7 +180,7 @@ qeth_perf_procfile_seq_show(struct seq_file *s, void *it)
180 struct device *device; 180 struct device *device;
181 struct qeth_card *card; 181 struct qeth_card *card;
182 182
183 183
184 if (it == SEQ_START_TOKEN) 184 if (it == SEQ_START_TOKEN)
185 return 0; 185 return 0;
186 186
diff --git a/drivers/s390/net/qeth_sys.c b/drivers/s390/net/qeth_sys.c
index 882d419e4160..185a9cfbcbdc 100644
--- a/drivers/s390/net/qeth_sys.c
+++ b/drivers/s390/net/qeth_sys.c
@@ -785,7 +785,7 @@ qeth_dev_large_send_store(struct device *dev, struct device_attribute *attr, con
785 } 785 }
786 if (card->options.large_send == type) 786 if (card->options.large_send == type)
787 return count; 787 return count;
788 if ((rc = qeth_set_large_send(card, type))) 788 if ((rc = qeth_set_large_send(card, type)))
789 return rc; 789 return rc;
790 return count; 790 return count;
791} 791}
@@ -1682,7 +1682,7 @@ qeth_create_device_attributes(struct device *dev)
1682 if (card->info.type == QETH_CARD_TYPE_OSN) 1682 if (card->info.type == QETH_CARD_TYPE_OSN)
1683 return sysfs_create_group(&dev->kobj, 1683 return sysfs_create_group(&dev->kobj,
1684 &qeth_osn_device_attr_group); 1684 &qeth_osn_device_attr_group);
1685 1685
1686 if ((ret = sysfs_create_group(&dev->kobj, &qeth_device_attr_group))) 1686 if ((ret = sysfs_create_group(&dev->kobj, &qeth_device_attr_group)))
1687 return ret; 1687 return ret;
1688 if ((ret = sysfs_create_group(&dev->kobj, &qeth_device_ipato_group))){ 1688 if ((ret = sysfs_create_group(&dev->kobj, &qeth_device_ipato_group))){
@@ -1713,7 +1713,7 @@ qeth_remove_device_attributes(struct device *dev)
1713 if (card->info.type == QETH_CARD_TYPE_OSN) 1713 if (card->info.type == QETH_CARD_TYPE_OSN)
1714 return sysfs_remove_group(&dev->kobj, 1714 return sysfs_remove_group(&dev->kobj,
1715 &qeth_osn_device_attr_group); 1715 &qeth_osn_device_attr_group);
1716 1716
1717 sysfs_remove_group(&dev->kobj, &qeth_device_attr_group); 1717 sysfs_remove_group(&dev->kobj, &qeth_device_attr_group);
1718 sysfs_remove_group(&dev->kobj, &qeth_device_ipato_group); 1718 sysfs_remove_group(&dev->kobj, &qeth_device_ipato_group);
1719 sysfs_remove_group(&dev->kobj, &qeth_device_vipa_group); 1719 sysfs_remove_group(&dev->kobj, &qeth_device_vipa_group);
diff --git a/drivers/s390/net/qeth_tso.h b/drivers/s390/net/qeth_tso.h
index 1286ddea450b..24ef40ca9562 100644
--- a/drivers/s390/net/qeth_tso.h
+++ b/drivers/s390/net/qeth_tso.h
@@ -117,11 +117,11 @@ __qeth_fill_buffer_frag(struct sk_buff *skb, struct qdio_buffer *buffer,
117 int fragno; 117 int fragno;
118 unsigned long addr; 118 unsigned long addr;
119 int element, cnt, dlen; 119 int element, cnt, dlen;
120 120
121 fragno = skb_shinfo(skb)->nr_frags; 121 fragno = skb_shinfo(skb)->nr_frags;
122 element = *next_element_to_fill; 122 element = *next_element_to_fill;
123 dlen = 0; 123 dlen = 0;
124 124
125 if (is_tso) 125 if (is_tso)
126 buffer->element[element].flags = 126 buffer->element[element].flags =
127 SBAL_FLAGS_MIDDLE_FRAG; 127 SBAL_FLAGS_MIDDLE_FRAG;
diff --git a/drivers/s390/s390mach.c b/drivers/s390/s390mach.c
index 3bf466603512..f99e55308b32 100644
--- a/drivers/s390/s390mach.c
+++ b/drivers/s390/s390mach.c
@@ -13,6 +13,7 @@
13#include <linux/sched.h> 13#include <linux/sched.h>
14#include <linux/errno.h> 14#include <linux/errno.h>
15#include <linux/workqueue.h> 15#include <linux/workqueue.h>
16#include <linux/time.h>
16 17
17#include <asm/lowcore.h> 18#include <asm/lowcore.h>
18 19
@@ -362,12 +363,19 @@ s390_revalidate_registers(struct mci *mci)
362 return kill_task; 363 return kill_task;
363} 364}
364 365
366#define MAX_IPD_COUNT 29
367#define MAX_IPD_TIME (5 * 60 * USEC_PER_SEC) /* 5 minutes */
368
365/* 369/*
366 * machine check handler. 370 * machine check handler.
367 */ 371 */
368void 372void
369s390_do_machine_check(struct pt_regs *regs) 373s390_do_machine_check(struct pt_regs *regs)
370{ 374{
375 static DEFINE_SPINLOCK(ipd_lock);
376 static unsigned long long last_ipd;
377 static int ipd_count;
378 unsigned long long tmp;
371 struct mci *mci; 379 struct mci *mci;
372 struct mcck_struct *mcck; 380 struct mcck_struct *mcck;
373 int umode; 381 int umode;
@@ -404,11 +412,27 @@ s390_do_machine_check(struct pt_regs *regs)
404 s390_handle_damage("processing backup machine " 412 s390_handle_damage("processing backup machine "
405 "check with damage."); 413 "check with damage.");
406 } 414 }
407 if (!umode) 415
408 s390_handle_damage("processing backup machine " 416 /*
409 "check in kernel mode."); 417 * Nullifying exigent condition, therefore we might
410 mcck->kill_task = 1; 418 * retry this instruction.
411 mcck->mcck_code = *(unsigned long long *) mci; 419 */
420
421 spin_lock(&ipd_lock);
422
423 tmp = get_clock();
424
425 if (((tmp - last_ipd) >> 12) < MAX_IPD_TIME)
426 ipd_count++;
427 else
428 ipd_count = 1;
429
430 last_ipd = tmp;
431
432 if (ipd_count == MAX_IPD_COUNT)
433 s390_handle_damage("too many ipd retries.");
434
435 spin_unlock(&ipd_lock);
412 } 436 }
413 else { 437 else {
414 /* Processing damage -> stopping machine */ 438 /* Processing damage -> stopping machine */
diff --git a/drivers/sbus/char/openprom.c b/drivers/sbus/char/openprom.c
index 383a95f34a0d..239e108b8ed1 100644
--- a/drivers/sbus/char/openprom.c
+++ b/drivers/sbus/char/openprom.c
@@ -392,13 +392,16 @@ static int openprom_bsd_ioctl(struct inode * inode, struct file * file,
392 return -ENOMEM; 392 return -ENOMEM;
393 } 393 }
394 394
395 prom_getproperty(op.op_nodeid, str, tmp, len); 395 cnt = prom_getproperty(op.op_nodeid, str, tmp, len);
396 396 if (cnt <= 0) {
397 tmp[len] = '\0'; 397 error = -EINVAL;
398 } else {
399 tmp[len] = '\0';
398 400
399 if (__copy_to_user(argp, &op, sizeof(op)) != 0 401 if (__copy_to_user(argp, &op, sizeof(op)) != 0 ||
400 || copy_to_user(op.op_buf, tmp, len) != 0) 402 copy_to_user(op.op_buf, tmp, len) != 0)
401 error = -EFAULT; 403 error = -EFAULT;
404 }
402 405
403 kfree(tmp); 406 kfree(tmp);
404 kfree(str); 407 kfree(str);
diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
index 13ad88a064b7..44728ae3fe77 100644
--- a/drivers/scsi/Kconfig
+++ b/drivers/scsi/Kconfig
@@ -446,7 +446,9 @@ config SCSI_DPT_I2O
446 446
447config SCSI_ADVANSYS 447config SCSI_ADVANSYS
448 tristate "AdvanSys SCSI support" 448 tristate "AdvanSys SCSI support"
449 depends on (ISA || EISA || PCI) && SCSI && BROKEN 449 depends on SCSI
450 depends on ISA || EISA || PCI
451 depends on BROKEN || X86_32
450 help 452 help
451 This is a driver for all SCSI host adapters manufactured by 453 This is a driver for all SCSI host adapters manufactured by
452 AdvanSys. It is documented in the kernel source in 454 AdvanSys. It is documented in the kernel source in
diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c
index 28b93057b607..2a419634b256 100644
--- a/drivers/scsi/advansys.c
+++ b/drivers/scsi/advansys.c
@@ -2051,7 +2051,7 @@ STATIC ASC_DCNT AscGetMaxDmaCount(ushort);
2051#define ADV_VADDR_TO_U32 virt_to_bus 2051#define ADV_VADDR_TO_U32 virt_to_bus
2052#define ADV_U32_TO_VADDR bus_to_virt 2052#define ADV_U32_TO_VADDR bus_to_virt
2053 2053
2054#define AdvPortAddr ulong /* Virtual memory address size */ 2054#define AdvPortAddr void __iomem * /* Virtual memory address size */
2055 2055
2056/* 2056/*
2057 * Define Adv Library required memory access macros. 2057 * Define Adv Library required memory access macros.
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c b/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
index cb30d9c1153d..0c9c2f400bf6 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
@@ -219,6 +219,7 @@ ahc_linux_pci_dev_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
219 ahc->flags |= AHC_39BIT_ADDRESSING; 219 ahc->flags |= AHC_39BIT_ADDRESSING;
220 } else { 220 } else {
221 if (dma_set_mask(dev, DMA_32BIT_MASK)) { 221 if (dma_set_mask(dev, DMA_32BIT_MASK)) {
222 ahc_free(ahc);
222 printk(KERN_WARNING "aic7xxx: No suitable DMA available.\n"); 223 printk(KERN_WARNING "aic7xxx: No suitable DMA available.\n");
223 return (-ENODEV); 224 return (-ENODEV);
224 } 225 }
diff --git a/drivers/scsi/aic7xxx/aic7xxx_pci.c b/drivers/scsi/aic7xxx/aic7xxx_pci.c
index 02fed4a02eb3..63cab2d74552 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_pci.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_pci.c
@@ -2042,12 +2042,12 @@ ahc_pci_resume(struct ahc_softc *ahc)
2042 * that the OS doesn't know about and rely on our chip 2042 * that the OS doesn't know about and rely on our chip
2043 * reset handler to handle the rest. 2043 * reset handler to handle the rest.
2044 */ 2044 */
2045 ahc_pci_write_config(ahc->dev_softc, DEVCONFIG, /*bytes*/4, 2045 ahc_pci_write_config(ahc->dev_softc, DEVCONFIG,
2046 ahc->bus_softc.pci_softc.devconfig); 2046 ahc->bus_softc.pci_softc.devconfig, /*bytes*/4);
2047 ahc_pci_write_config(ahc->dev_softc, PCIR_COMMAND, /*bytes*/1, 2047 ahc_pci_write_config(ahc->dev_softc, PCIR_COMMAND,
2048 ahc->bus_softc.pci_softc.command); 2048 ahc->bus_softc.pci_softc.command, /*bytes*/1);
2049 ahc_pci_write_config(ahc->dev_softc, CSIZE_LATTIME, /*bytes*/1, 2049 ahc_pci_write_config(ahc->dev_softc, CSIZE_LATTIME,
2050 ahc->bus_softc.pci_softc.csize_lattime); 2050 ahc->bus_softc.pci_softc.csize_lattime, /*bytes*/1);
2051 if ((ahc->flags & AHC_HAS_TERM_LOGIC) != 0) { 2051 if ((ahc->flags & AHC_HAS_TERM_LOGIC) != 0) {
2052 struct seeprom_descriptor sd; 2052 struct seeprom_descriptor sd;
2053 u_int sxfrctl1; 2053 u_int sxfrctl1;
diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c
index 12cb743d0ce5..944fc1203ebd 100644
--- a/drivers/scsi/ibmvscsi/ibmvscsi.c
+++ b/drivers/scsi/ibmvscsi/ibmvscsi.c
@@ -738,7 +738,8 @@ static void send_mad_adapter_info(struct ibmvscsi_host_data *hostdata)
738{ 738{
739 struct viosrp_adapter_info *req; 739 struct viosrp_adapter_info *req;
740 struct srp_event_struct *evt_struct; 740 struct srp_event_struct *evt_struct;
741 741 dma_addr_t addr;
742
742 evt_struct = get_event_struct(&hostdata->pool); 743 evt_struct = get_event_struct(&hostdata->pool);
743 if (!evt_struct) { 744 if (!evt_struct) {
744 printk(KERN_ERR "ibmvscsi: couldn't allocate an event " 745 printk(KERN_ERR "ibmvscsi: couldn't allocate an event "
@@ -756,10 +757,10 @@ static void send_mad_adapter_info(struct ibmvscsi_host_data *hostdata)
756 757
757 req->common.type = VIOSRP_ADAPTER_INFO_TYPE; 758 req->common.type = VIOSRP_ADAPTER_INFO_TYPE;
758 req->common.length = sizeof(hostdata->madapter_info); 759 req->common.length = sizeof(hostdata->madapter_info);
759 req->buffer = dma_map_single(hostdata->dev, 760 req->buffer = addr = dma_map_single(hostdata->dev,
760 &hostdata->madapter_info, 761 &hostdata->madapter_info,
761 sizeof(hostdata->madapter_info), 762 sizeof(hostdata->madapter_info),
762 DMA_BIDIRECTIONAL); 763 DMA_BIDIRECTIONAL);
763 764
764 if (dma_mapping_error(req->buffer)) { 765 if (dma_mapping_error(req->buffer)) {
765 printk(KERN_ERR 766 printk(KERN_ERR
@@ -769,8 +770,13 @@ static void send_mad_adapter_info(struct ibmvscsi_host_data *hostdata)
769 return; 770 return;
770 } 771 }
771 772
772 if (ibmvscsi_send_srp_event(evt_struct, hostdata)) 773 if (ibmvscsi_send_srp_event(evt_struct, hostdata)) {
773 printk(KERN_ERR "ibmvscsi: couldn't send ADAPTER_INFO_REQ!\n"); 774 printk(KERN_ERR "ibmvscsi: couldn't send ADAPTER_INFO_REQ!\n");
775 dma_unmap_single(hostdata->dev,
776 addr,
777 sizeof(hostdata->madapter_info),
778 DMA_BIDIRECTIONAL);
779 }
774}; 780};
775 781
776/** 782/**
@@ -1258,6 +1264,7 @@ static int ibmvscsi_do_host_config(struct ibmvscsi_host_data *hostdata,
1258{ 1264{
1259 struct viosrp_host_config *host_config; 1265 struct viosrp_host_config *host_config;
1260 struct srp_event_struct *evt_struct; 1266 struct srp_event_struct *evt_struct;
1267 dma_addr_t addr;
1261 int rc; 1268 int rc;
1262 1269
1263 evt_struct = get_event_struct(&hostdata->pool); 1270 evt_struct = get_event_struct(&hostdata->pool);
@@ -1278,8 +1285,9 @@ static int ibmvscsi_do_host_config(struct ibmvscsi_host_data *hostdata,
1278 memset(host_config, 0x00, sizeof(*host_config)); 1285 memset(host_config, 0x00, sizeof(*host_config));
1279 host_config->common.type = VIOSRP_HOST_CONFIG_TYPE; 1286 host_config->common.type = VIOSRP_HOST_CONFIG_TYPE;
1280 host_config->common.length = length; 1287 host_config->common.length = length;
1281 host_config->buffer = dma_map_single(hostdata->dev, buffer, length, 1288 host_config->buffer = addr = dma_map_single(hostdata->dev, buffer,
1282 DMA_BIDIRECTIONAL); 1289 length,
1290 DMA_BIDIRECTIONAL);
1283 1291
1284 if (dma_mapping_error(host_config->buffer)) { 1292 if (dma_mapping_error(host_config->buffer)) {
1285 printk(KERN_ERR 1293 printk(KERN_ERR
@@ -1290,11 +1298,9 @@ static int ibmvscsi_do_host_config(struct ibmvscsi_host_data *hostdata,
1290 1298
1291 init_completion(&evt_struct->comp); 1299 init_completion(&evt_struct->comp);
1292 rc = ibmvscsi_send_srp_event(evt_struct, hostdata); 1300 rc = ibmvscsi_send_srp_event(evt_struct, hostdata);
1293 if (rc == 0) { 1301 if (rc == 0)
1294 wait_for_completion(&evt_struct->comp); 1302 wait_for_completion(&evt_struct->comp);
1295 dma_unmap_single(hostdata->dev, host_config->buffer, 1303 dma_unmap_single(hostdata->dev, addr, length, DMA_BIDIRECTIONAL);
1296 length, DMA_BIDIRECTIONAL);
1297 }
1298 1304
1299 return rc; 1305 return rc;
1300} 1306}
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index bd147207f25d..b046ffa22101 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -864,6 +864,9 @@ static unsigned int ata_id_xfermask(const u16 *id)
864/** 864/**
865 * ata_port_queue_task - Queue port_task 865 * ata_port_queue_task - Queue port_task
866 * @ap: The ata_port to queue port_task for 866 * @ap: The ata_port to queue port_task for
867 * @fn: workqueue function to be scheduled
868 * @data: data value to pass to workqueue function
869 * @delay: delay time for workqueue function
867 * 870 *
868 * Schedule @fn(@data) for execution after @delay jiffies using 871 * Schedule @fn(@data) for execution after @delay jiffies using
869 * port_task. There is one port_task per port and it's the 872 * port_task. There is one port_task per port and it's the
@@ -2739,6 +2742,8 @@ static unsigned int ata_dev_set_xfermode(struct ata_port *ap,
2739 * ata_dev_init_params - Issue INIT DEV PARAMS command 2742 * ata_dev_init_params - Issue INIT DEV PARAMS command
2740 * @ap: Port associated with device @dev 2743 * @ap: Port associated with device @dev
2741 * @dev: Device to which command will be sent 2744 * @dev: Device to which command will be sent
2745 * @heads: Number of heads (taskfile parameter)
2746 * @sectors: Number of sectors (taskfile parameter)
2742 * 2747 *
2743 * LOCKING: 2748 * LOCKING:
2744 * Kernel thread context (may sleep) 2749 * Kernel thread context (may sleep)
@@ -3638,6 +3643,8 @@ static void ata_pio_block(struct ata_port *ap)
3638 3643
3639 ata_pio_sector(qc); 3644 ata_pio_sector(qc);
3640 } 3645 }
3646
3647 ata_altstatus(ap); /* flush */
3641} 3648}
3642 3649
3643static void ata_pio_error(struct ata_port *ap) 3650static void ata_pio_error(struct ata_port *ap)
@@ -3754,11 +3761,14 @@ static void atapi_packet_task(void *_data)
3754 spin_lock_irqsave(&ap->host_set->lock, flags); 3761 spin_lock_irqsave(&ap->host_set->lock, flags);
3755 ap->flags &= ~ATA_FLAG_NOINTR; 3762 ap->flags &= ~ATA_FLAG_NOINTR;
3756 ata_data_xfer(ap, qc->cdb, qc->dev->cdb_len, 1); 3763 ata_data_xfer(ap, qc->cdb, qc->dev->cdb_len, 1);
3764 ata_altstatus(ap); /* flush */
3765
3757 if (qc->tf.protocol == ATA_PROT_ATAPI_DMA) 3766 if (qc->tf.protocol == ATA_PROT_ATAPI_DMA)
3758 ap->ops->bmdma_start(qc); /* initiate bmdma */ 3767 ap->ops->bmdma_start(qc); /* initiate bmdma */
3759 spin_unlock_irqrestore(&ap->host_set->lock, flags); 3768 spin_unlock_irqrestore(&ap->host_set->lock, flags);
3760 } else { 3769 } else {
3761 ata_data_xfer(ap, qc->cdb, qc->dev->cdb_len, 1); 3770 ata_data_xfer(ap, qc->cdb, qc->dev->cdb_len, 1);
3771 ata_altstatus(ap); /* flush */
3762 3772
3763 /* PIO commands are handled by polling */ 3773 /* PIO commands are handled by polling */
3764 ap->hsm_task_state = HSM_ST; 3774 ap->hsm_task_state = HSM_ST;
@@ -4287,6 +4297,7 @@ static int ata_start_drive(struct ata_port *ap, struct ata_device *dev)
4287int ata_device_resume(struct ata_port *ap, struct ata_device *dev) 4297int ata_device_resume(struct ata_port *ap, struct ata_device *dev)
4288{ 4298{
4289 if (ap->flags & ATA_FLAG_SUSPENDED) { 4299 if (ap->flags & ATA_FLAG_SUSPENDED) {
4300 ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 200000);
4290 ap->flags &= ~ATA_FLAG_SUSPENDED; 4301 ap->flags &= ~ATA_FLAG_SUSPENDED;
4291 ata_set_mode(ap); 4302 ata_set_mode(ap);
4292 } 4303 }
@@ -4302,6 +4313,7 @@ int ata_device_resume(struct ata_port *ap, struct ata_device *dev)
4302 * ata_device_suspend - prepare a device for suspend 4313 * ata_device_suspend - prepare a device for suspend
4303 * @ap: port the device is connected to 4314 * @ap: port the device is connected to
4304 * @dev: the device to suspend 4315 * @dev: the device to suspend
4316 * @state: target power management state
4305 * 4317 *
4306 * Flush the cache on the drive, if appropriate, then issue a 4318 * Flush the cache on the drive, if appropriate, then issue a
4307 * standbynow command. 4319 * standbynow command.
diff --git a/drivers/scsi/lpfc/lpfc_crtn.h b/drivers/scsi/lpfc/lpfc_crtn.h
index fad607b2e6f4..ee22173fce43 100644
--- a/drivers/scsi/lpfc/lpfc_crtn.h
+++ b/drivers/scsi/lpfc/lpfc_crtn.h
@@ -27,7 +27,6 @@ void lpfc_config_link(struct lpfc_hba *, LPFC_MBOXQ_t *);
27int lpfc_read_sparam(struct lpfc_hba *, LPFC_MBOXQ_t *); 27int lpfc_read_sparam(struct lpfc_hba *, LPFC_MBOXQ_t *);
28void lpfc_read_config(struct lpfc_hba *, LPFC_MBOXQ_t *); 28void lpfc_read_config(struct lpfc_hba *, LPFC_MBOXQ_t *);
29void lpfc_read_lnk_stat(struct lpfc_hba *, LPFC_MBOXQ_t *); 29void lpfc_read_lnk_stat(struct lpfc_hba *, LPFC_MBOXQ_t *);
30void lpfc_set_slim(struct lpfc_hba *, LPFC_MBOXQ_t *, uint32_t, uint32_t);
31int lpfc_reg_login(struct lpfc_hba *, uint32_t, uint8_t *, LPFC_MBOXQ_t *, 30int lpfc_reg_login(struct lpfc_hba *, uint32_t, uint8_t *, LPFC_MBOXQ_t *,
32 uint32_t); 31 uint32_t);
33void lpfc_unreg_login(struct lpfc_hba *, uint32_t, LPFC_MBOXQ_t *); 32void lpfc_unreg_login(struct lpfc_hba *, uint32_t, LPFC_MBOXQ_t *);
diff --git a/drivers/scsi/lpfc/lpfc_disc.h b/drivers/scsi/lpfc/lpfc_disc.h
index 8932b1be2b60..41cf5d3ea6ce 100644
--- a/drivers/scsi/lpfc/lpfc_disc.h
+++ b/drivers/scsi/lpfc/lpfc_disc.h
@@ -113,6 +113,7 @@ struct lpfc_nodelist {
113#define NLP_NPR_ADISC 0x2000000 /* Issue ADISC when dq'ed from 113#define NLP_NPR_ADISC 0x2000000 /* Issue ADISC when dq'ed from
114 NPR list */ 114 NPR list */
115#define NLP_DELAY_REMOVE 0x4000000 /* Defer removal till end of DSM */ 115#define NLP_DELAY_REMOVE 0x4000000 /* Defer removal till end of DSM */
116#define NLP_NODEV_REMOVE 0x8000000 /* Defer removal till discovery ends */
116 117
117/* Defines for list searchs */ 118/* Defines for list searchs */
118#define NLP_SEARCH_MAPPED 0x1 /* search mapped */ 119#define NLP_SEARCH_MAPPED 0x1 /* search mapped */
diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c
index 4813beaaca8f..283b7d824c34 100644
--- a/drivers/scsi/lpfc/lpfc_els.c
+++ b/drivers/scsi/lpfc/lpfc_els.c
@@ -302,10 +302,6 @@ lpfc_cmpl_els_flogi_fabric(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp,
302 if (lpfc_reg_login(phba, Fabric_DID, (uint8_t *) sp, mbox, 0)) 302 if (lpfc_reg_login(phba, Fabric_DID, (uint8_t *) sp, mbox, 0))
303 goto fail_free_mbox; 303 goto fail_free_mbox;
304 304
305 /*
306 * set_slim mailbox command needs to execute first,
307 * queue this command to be processed later.
308 */
309 mbox->mbox_cmpl = lpfc_mbx_cmpl_fabric_reg_login; 305 mbox->mbox_cmpl = lpfc_mbx_cmpl_fabric_reg_login;
310 mbox->context2 = ndlp; 306 mbox->context2 = ndlp;
311 307
@@ -781,25 +777,26 @@ lpfc_cmpl_els_plogi(struct lpfc_hba * phba, struct lpfc_iocbq * cmdiocb,
781 if (disc && phba->num_disc_nodes) { 777 if (disc && phba->num_disc_nodes) {
782 /* Check to see if there are more PLOGIs to be sent */ 778 /* Check to see if there are more PLOGIs to be sent */
783 lpfc_more_plogi(phba); 779 lpfc_more_plogi(phba);
784 }
785 780
786 if (phba->num_disc_nodes == 0) { 781 if (phba->num_disc_nodes == 0) {
787 spin_lock_irq(phba->host->host_lock); 782 spin_lock_irq(phba->host->host_lock);
788 phba->fc_flag &= ~FC_NDISC_ACTIVE; 783 phba->fc_flag &= ~FC_NDISC_ACTIVE;
789 spin_unlock_irq(phba->host->host_lock); 784 spin_unlock_irq(phba->host->host_lock);
790 785
791 lpfc_can_disctmo(phba); 786 lpfc_can_disctmo(phba);
792 if (phba->fc_flag & FC_RSCN_MODE) { 787 if (phba->fc_flag & FC_RSCN_MODE) {
793 /* Check to see if more RSCNs came in while we were 788 /*
794 * processing this one. 789 * Check to see if more RSCNs came in while
795 */ 790 * we were processing this one.
796 if ((phba->fc_rscn_id_cnt == 0) && 791 */
797 (!(phba->fc_flag & FC_RSCN_DISCOVERY))) { 792 if ((phba->fc_rscn_id_cnt == 0) &&
798 spin_lock_irq(phba->host->host_lock); 793 (!(phba->fc_flag & FC_RSCN_DISCOVERY))) {
799 phba->fc_flag &= ~FC_RSCN_MODE; 794 spin_lock_irq(phba->host->host_lock);
800 spin_unlock_irq(phba->host->host_lock); 795 phba->fc_flag &= ~FC_RSCN_MODE;
801 } else { 796 spin_unlock_irq(phba->host->host_lock);
802 lpfc_els_handle_rscn(phba); 797 } else {
798 lpfc_els_handle_rscn(phba);
799 }
803 } 800 }
804 } 801 }
805 } 802 }
@@ -1263,7 +1260,7 @@ lpfc_issue_els_logo(struct lpfc_hba * phba, struct lpfc_nodelist * ndlp,
1263 psli = &phba->sli; 1260 psli = &phba->sli;
1264 pring = &psli->ring[LPFC_ELS_RING]; 1261 pring = &psli->ring[LPFC_ELS_RING];
1265 1262
1266 cmdsize = 2 * (sizeof (uint32_t) + sizeof (struct lpfc_name)); 1263 cmdsize = (2 * sizeof (uint32_t)) + sizeof (struct lpfc_name);
1267 elsiocb = lpfc_prep_els_iocb(phba, 1, cmdsize, retry, ndlp, 1264 elsiocb = lpfc_prep_els_iocb(phba, 1, cmdsize, retry, ndlp,
1268 ndlp->nlp_DID, ELS_CMD_LOGO); 1265 ndlp->nlp_DID, ELS_CMD_LOGO);
1269 if (!elsiocb) 1266 if (!elsiocb)
@@ -1451,22 +1448,23 @@ lpfc_cancel_retry_delay_tmo(struct lpfc_hba *phba, struct lpfc_nodelist * nlp)
1451 * PLOGIs to be sent 1448 * PLOGIs to be sent
1452 */ 1449 */
1453 lpfc_more_plogi(phba); 1450 lpfc_more_plogi(phba);
1454 }
1455 1451
1456 if (phba->num_disc_nodes == 0) { 1452 if (phba->num_disc_nodes == 0) {
1457 phba->fc_flag &= ~FC_NDISC_ACTIVE; 1453 phba->fc_flag &= ~FC_NDISC_ACTIVE;
1458 lpfc_can_disctmo(phba); 1454 lpfc_can_disctmo(phba);
1459 if (phba->fc_flag & FC_RSCN_MODE) { 1455 if (phba->fc_flag & FC_RSCN_MODE) {
1460 /* Check to see if more RSCNs 1456 /*
1461 * came in while we were 1457 * Check to see if more RSCNs
1462 * processing this one. 1458 * came in while we were
1463 */ 1459 * processing this one.
1464 if((phba->fc_rscn_id_cnt==0) && 1460 */
1465 (!(phba->fc_flag & FC_RSCN_DISCOVERY))) { 1461 if((phba->fc_rscn_id_cnt==0) &&
1466 phba->fc_flag &= ~FC_RSCN_MODE; 1462 !(phba->fc_flag & FC_RSCN_DISCOVERY)) {
1467 } 1463 phba->fc_flag &= ~FC_RSCN_MODE;
1468 else { 1464 }
1469 lpfc_els_handle_rscn(phba); 1465 else {
1466 lpfc_els_handle_rscn(phba);
1467 }
1470 } 1468 }
1471 } 1469 }
1472 } 1470 }
@@ -1872,9 +1870,6 @@ lpfc_cmpl_els_acc(struct lpfc_hba * phba, struct lpfc_iocbq * cmdiocb,
1872 if (mbox) { 1870 if (mbox) {
1873 if ((rspiocb->iocb.ulpStatus == 0) 1871 if ((rspiocb->iocb.ulpStatus == 0)
1874 && (ndlp->nlp_flag & NLP_ACC_REGLOGIN)) { 1872 && (ndlp->nlp_flag & NLP_ACC_REGLOGIN)) {
1875 /* set_slim mailbox command needs to execute first,
1876 * queue this command to be processed later.
1877 */
1878 lpfc_unreg_rpi(phba, ndlp); 1873 lpfc_unreg_rpi(phba, ndlp);
1879 mbox->mbox_cmpl = lpfc_mbx_cmpl_reg_login; 1874 mbox->mbox_cmpl = lpfc_mbx_cmpl_reg_login;
1880 mbox->context2 = ndlp; 1875 mbox->context2 = ndlp;
@@ -1920,6 +1915,7 @@ lpfc_els_rsp_acc(struct lpfc_hba * phba, uint32_t flag,
1920 uint8_t *pcmd; 1915 uint8_t *pcmd;
1921 uint16_t cmdsize; 1916 uint16_t cmdsize;
1922 int rc; 1917 int rc;
1918 ELS_PKT *els_pkt_ptr;
1923 1919
1924 psli = &phba->sli; 1920 psli = &phba->sli;
1925 pring = &psli->ring[LPFC_ELS_RING]; /* ELS ring */ 1921 pring = &psli->ring[LPFC_ELS_RING]; /* ELS ring */
@@ -1958,6 +1954,23 @@ lpfc_els_rsp_acc(struct lpfc_hba * phba, uint32_t flag,
1958 pcmd += sizeof (uint32_t); 1954 pcmd += sizeof (uint32_t);
1959 memcpy(pcmd, &phba->fc_sparam, sizeof (struct serv_parm)); 1955 memcpy(pcmd, &phba->fc_sparam, sizeof (struct serv_parm));
1960 break; 1956 break;
1957 case ELS_CMD_PRLO:
1958 cmdsize = sizeof (uint32_t) + sizeof (PRLO);
1959 elsiocb = lpfc_prep_els_iocb(phba, 0, cmdsize, oldiocb->retry,
1960 ndlp, ndlp->nlp_DID, ELS_CMD_PRLO);
1961 if (!elsiocb)
1962 return 1;
1963
1964 icmd = &elsiocb->iocb;
1965 icmd->ulpContext = oldcmd->ulpContext; /* Xri */
1966 pcmd = (((struct lpfc_dmabuf *) elsiocb->context2)->virt);
1967
1968 memcpy(pcmd, ((struct lpfc_dmabuf *) oldiocb->context2)->virt,
1969 sizeof (uint32_t) + sizeof (PRLO));
1970 *((uint32_t *) (pcmd)) = ELS_CMD_PRLO_ACC;
1971 els_pkt_ptr = (ELS_PKT *) pcmd;
1972 els_pkt_ptr->un.prlo.acceptRspCode = PRLO_REQ_EXECUTED;
1973 break;
1961 default: 1974 default:
1962 return 1; 1975 return 1;
1963 } 1976 }
@@ -2498,7 +2511,7 @@ lpfc_els_rcv_rscn(struct lpfc_hba * phba,
2498 /* If we are about to begin discovery, just ACC the RSCN. 2511 /* If we are about to begin discovery, just ACC the RSCN.
2499 * Discovery processing will satisfy it. 2512 * Discovery processing will satisfy it.
2500 */ 2513 */
2501 if (phba->hba_state < LPFC_NS_QRY) { 2514 if (phba->hba_state <= LPFC_NS_QRY) {
2502 lpfc_els_rsp_acc(phba, ELS_CMD_ACC, cmdiocb, ndlp, NULL, 2515 lpfc_els_rsp_acc(phba, ELS_CMD_ACC, cmdiocb, ndlp, NULL,
2503 newnode); 2516 newnode);
2504 return 0; 2517 return 0;
diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c
index 6721e679df62..adb086009ae0 100644
--- a/drivers/scsi/lpfc/lpfc_hbadisc.c
+++ b/drivers/scsi/lpfc/lpfc_hbadisc.c
@@ -311,8 +311,8 @@ lpfc_workq_post_event(struct lpfc_hba * phba, void *arg1, void *arg2,
311 evtp->evt_arg2 = arg2; 311 evtp->evt_arg2 = arg2;
312 evtp->evt = evt; 312 evtp->evt = evt;
313 313
314 list_add_tail(&evtp->evt_listp, &phba->work_list);
315 spin_lock_irq(phba->host->host_lock); 314 spin_lock_irq(phba->host->host_lock);
315 list_add_tail(&evtp->evt_listp, &phba->work_list);
316 if (phba->work_wait) 316 if (phba->work_wait)
317 wake_up(phba->work_wait); 317 wake_up(phba->work_wait);
318 spin_unlock_irq(phba->host->host_lock); 318 spin_unlock_irq(phba->host->host_lock);
@@ -1071,10 +1071,6 @@ lpfc_register_remote_port(struct lpfc_hba * phba,
1071 /* initialize static port data */ 1071 /* initialize static port data */
1072 rport->maxframe_size = ndlp->nlp_maxframe; 1072 rport->maxframe_size = ndlp->nlp_maxframe;
1073 rport->supported_classes = ndlp->nlp_class_sup; 1073 rport->supported_classes = ndlp->nlp_class_sup;
1074 if ((rport->scsi_target_id != -1) &&
1075 (rport->scsi_target_id < MAX_FCP_TARGET)) {
1076 ndlp->nlp_sid = rport->scsi_target_id;
1077 }
1078 rdata = rport->dd_data; 1074 rdata = rport->dd_data;
1079 rdata->pnode = ndlp; 1075 rdata->pnode = ndlp;
1080 1076
@@ -1087,6 +1083,10 @@ lpfc_register_remote_port(struct lpfc_hba * phba,
1087 if (rport_ids.roles != FC_RPORT_ROLE_UNKNOWN) 1083 if (rport_ids.roles != FC_RPORT_ROLE_UNKNOWN)
1088 fc_remote_port_rolechg(rport, rport_ids.roles); 1084 fc_remote_port_rolechg(rport, rport_ids.roles);
1089 1085
1086 if ((rport->scsi_target_id != -1) &&
1087 (rport->scsi_target_id < MAX_FCP_TARGET)) {
1088 ndlp->nlp_sid = rport->scsi_target_id;
1089 }
1090 1090
1091 return; 1091 return;
1092} 1092}
@@ -1238,6 +1238,7 @@ lpfc_nlp_list(struct lpfc_hba * phba, struct lpfc_nodelist * nlp, int list)
1238 evt_listp); 1238 evt_listp);
1239 1239
1240 } 1240 }
1241 nlp->nlp_flag &= ~NLP_NODEV_REMOVE;
1241 nlp->nlp_type |= NLP_FC_NODE; 1242 nlp->nlp_type |= NLP_FC_NODE;
1242 break; 1243 break;
1243 case NLP_MAPPED_LIST: 1244 case NLP_MAPPED_LIST:
@@ -1258,6 +1259,7 @@ lpfc_nlp_list(struct lpfc_hba * phba, struct lpfc_nodelist * nlp, int list)
1258 evt_listp); 1259 evt_listp);
1259 1260
1260 } 1261 }
1262 nlp->nlp_flag &= ~NLP_NODEV_REMOVE;
1261 break; 1263 break;
1262 case NLP_NPR_LIST: 1264 case NLP_NPR_LIST:
1263 nlp->nlp_flag |= list; 1265 nlp->nlp_flag |= list;
@@ -1402,6 +1404,8 @@ lpfc_check_sli_ndlp(struct lpfc_hba * phba,
1402 if (icmd->ulpContext == (volatile ushort)ndlp->nlp_rpi) 1404 if (icmd->ulpContext == (volatile ushort)ndlp->nlp_rpi)
1403 return 1; 1405 return 1;
1404 case CMD_ELS_REQUEST64_CR: 1406 case CMD_ELS_REQUEST64_CR:
1407 if (icmd->un.elsreq64.remoteID == ndlp->nlp_DID)
1408 return 1;
1405 case CMD_XMIT_ELS_RSP64_CX: 1409 case CMD_XMIT_ELS_RSP64_CX:
1406 if (iocb->context1 == (uint8_t *) ndlp) 1410 if (iocb->context1 == (uint8_t *) ndlp)
1407 return 1; 1411 return 1;
@@ -1901,10 +1905,8 @@ lpfc_setup_disc_node(struct lpfc_hba * phba, uint32_t did)
1901 */ 1905 */
1902 if (ndlp->nlp_flag & NLP_DELAY_TMO) 1906 if (ndlp->nlp_flag & NLP_DELAY_TMO)
1903 lpfc_cancel_retry_delay_tmo(phba, ndlp); 1907 lpfc_cancel_retry_delay_tmo(phba, ndlp);
1904 } else { 1908 } else
1905 ndlp->nlp_flag &= ~NLP_NPR_2B_DISC;
1906 ndlp = NULL; 1909 ndlp = NULL;
1907 }
1908 } else { 1910 } else {
1909 flg = ndlp->nlp_flag & NLP_LIST_MASK; 1911 flg = ndlp->nlp_flag & NLP_LIST_MASK;
1910 if ((flg == NLP_ADISC_LIST) || (flg == NLP_PLOGI_LIST)) 1912 if ((flg == NLP_ADISC_LIST) || (flg == NLP_PLOGI_LIST))
diff --git a/drivers/scsi/lpfc/lpfc_hw.h b/drivers/scsi/lpfc/lpfc_hw.h
index 54d04188f7cc..eedf98801366 100644
--- a/drivers/scsi/lpfc/lpfc_hw.h
+++ b/drivers/scsi/lpfc/lpfc_hw.h
@@ -449,6 +449,7 @@ struct serv_parm { /* Structure is in Big Endian format */
449#define ELS_CMD_RRQ 0x12000000 449#define ELS_CMD_RRQ 0x12000000
450#define ELS_CMD_PRLI 0x20100014 450#define ELS_CMD_PRLI 0x20100014
451#define ELS_CMD_PRLO 0x21100014 451#define ELS_CMD_PRLO 0x21100014
452#define ELS_CMD_PRLO_ACC 0x02100014
452#define ELS_CMD_PDISC 0x50000000 453#define ELS_CMD_PDISC 0x50000000
453#define ELS_CMD_FDISC 0x51000000 454#define ELS_CMD_FDISC 0x51000000
454#define ELS_CMD_ADISC 0x52000000 455#define ELS_CMD_ADISC 0x52000000
@@ -484,6 +485,7 @@ struct serv_parm { /* Structure is in Big Endian format */
484#define ELS_CMD_RRQ 0x12 485#define ELS_CMD_RRQ 0x12
485#define ELS_CMD_PRLI 0x14001020 486#define ELS_CMD_PRLI 0x14001020
486#define ELS_CMD_PRLO 0x14001021 487#define ELS_CMD_PRLO 0x14001021
488#define ELS_CMD_PRLO_ACC 0x14001002
487#define ELS_CMD_PDISC 0x50 489#define ELS_CMD_PDISC 0x50
488#define ELS_CMD_FDISC 0x51 490#define ELS_CMD_FDISC 0x51
489#define ELS_CMD_ADISC 0x52 491#define ELS_CMD_ADISC 0x52
@@ -1539,6 +1541,7 @@ typedef struct {
1539 1541
1540#define FLAGS_TOPOLOGY_FAILOVER 0x0400 /* Bit 10 */ 1542#define FLAGS_TOPOLOGY_FAILOVER 0x0400 /* Bit 10 */
1541#define FLAGS_LINK_SPEED 0x0800 /* Bit 11 */ 1543#define FLAGS_LINK_SPEED 0x0800 /* Bit 11 */
1544#define FLAGS_IMED_ABORT 0x04000 /* Bit 14 */
1542 1545
1543 uint32_t link_speed; 1546 uint32_t link_speed;
1544#define LINK_SPEED_AUTO 0 /* Auto selection */ 1547#define LINK_SPEED_AUTO 0 /* Auto selection */
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 66d5d003555d..908d0f27706f 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -294,15 +294,6 @@ lpfc_config_port_post(struct lpfc_hba * phba)
294 } 294 }
295 } 295 }
296 296
297 /* This should turn on DELAYED ABTS for ELS timeouts */
298 lpfc_set_slim(phba, pmb, 0x052198, 0x1);
299 if (lpfc_sli_issue_mbox(phba, pmb, MBX_POLL) != MBX_SUCCESS) {
300 phba->hba_state = LPFC_HBA_ERROR;
301 mempool_free( pmb, phba->mbox_mem_pool);
302 return -EIO;
303 }
304
305
306 lpfc_read_config(phba, pmb); 297 lpfc_read_config(phba, pmb);
307 if (lpfc_sli_issue_mbox(phba, pmb, MBX_POLL) != MBX_SUCCESS) { 298 if (lpfc_sli_issue_mbox(phba, pmb, MBX_POLL) != MBX_SUCCESS) {
308 lpfc_printf_log(phba, 299 lpfc_printf_log(phba,
@@ -804,7 +795,7 @@ lpfc_get_hba_model_desc(struct lpfc_hba * phba, uint8_t * mdp, uint8_t * descp)
804 int max_speed; 795 int max_speed;
805 char * ports; 796 char * ports;
806 char * bus; 797 char * bus;
807 } m; 798 } m = {"<Unknown>", 0, "", ""};
808 799
809 pci_read_config_byte(phba->pcidev, PCI_HEADER_TYPE, &hdrtype); 800 pci_read_config_byte(phba->pcidev, PCI_HEADER_TYPE, &hdrtype);
810 ports = (hdrtype == 0x80) ? "2-port " : ""; 801 ports = (hdrtype == 0x80) ? "2-port " : "";
@@ -1627,7 +1618,7 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid)
1627 1618
1628 error = lpfc_alloc_sysfs_attr(phba); 1619 error = lpfc_alloc_sysfs_attr(phba);
1629 if (error) 1620 if (error)
1630 goto out_kthread_stop; 1621 goto out_remove_host;
1631 1622
1632 error = request_irq(phba->pcidev->irq, lpfc_intr_handler, SA_SHIRQ, 1623 error = request_irq(phba->pcidev->irq, lpfc_intr_handler, SA_SHIRQ,
1633 LPFC_DRIVER_NAME, phba); 1624 LPFC_DRIVER_NAME, phba);
@@ -1644,8 +1635,10 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid)
1644 phba->HCregaddr = phba->ctrl_regs_memmap_p + HC_REG_OFFSET; 1635 phba->HCregaddr = phba->ctrl_regs_memmap_p + HC_REG_OFFSET;
1645 1636
1646 error = lpfc_sli_hba_setup(phba); 1637 error = lpfc_sli_hba_setup(phba);
1647 if (error) 1638 if (error) {
1639 error = -ENODEV;
1648 goto out_free_irq; 1640 goto out_free_irq;
1641 }
1649 1642
1650 if (phba->cfg_poll & DISABLE_FCP_RING_INT) { 1643 if (phba->cfg_poll & DISABLE_FCP_RING_INT) {
1651 spin_lock_irq(phba->host->host_lock); 1644 spin_lock_irq(phba->host->host_lock);
@@ -1700,6 +1693,9 @@ out_free_irq:
1700 free_irq(phba->pcidev->irq, phba); 1693 free_irq(phba->pcidev->irq, phba);
1701out_free_sysfs_attr: 1694out_free_sysfs_attr:
1702 lpfc_free_sysfs_attr(phba); 1695 lpfc_free_sysfs_attr(phba);
1696out_remove_host:
1697 fc_remove_host(phba->host);
1698 scsi_remove_host(phba->host);
1703out_kthread_stop: 1699out_kthread_stop:
1704 kthread_stop(phba->worker_thread); 1700 kthread_stop(phba->worker_thread);
1705out_free_iocbq: 1701out_free_iocbq:
@@ -1721,12 +1717,14 @@ out_iounmap_slim:
1721out_idr_remove: 1717out_idr_remove:
1722 idr_remove(&lpfc_hba_index, phba->brd_no); 1718 idr_remove(&lpfc_hba_index, phba->brd_no);
1723out_put_host: 1719out_put_host:
1720 phba->host = NULL;
1724 scsi_host_put(host); 1721 scsi_host_put(host);
1725out_release_regions: 1722out_release_regions:
1726 pci_release_regions(pdev); 1723 pci_release_regions(pdev);
1727out_disable_device: 1724out_disable_device:
1728 pci_disable_device(pdev); 1725 pci_disable_device(pdev);
1729out: 1726out:
1727 pci_set_drvdata(pdev, NULL);
1730 return error; 1728 return error;
1731} 1729}
1732 1730
diff --git a/drivers/scsi/lpfc/lpfc_mbox.c b/drivers/scsi/lpfc/lpfc_mbox.c
index c585e2b2e589..e42f22aaf71b 100644
--- a/drivers/scsi/lpfc/lpfc_mbox.c
+++ b/drivers/scsi/lpfc/lpfc_mbox.c
@@ -200,6 +200,9 @@ lpfc_init_link(struct lpfc_hba * phba,
200 break; 200 break;
201 } 201 }
202 202
203 /* Enable asynchronous ABTS responses from firmware */
204 mb->un.varInitLnk.link_flags |= FLAGS_IMED_ABORT;
205
203 /* NEW_FEATURE 206 /* NEW_FEATURE
204 * Setting up the link speed 207 * Setting up the link speed
205 */ 208 */
@@ -292,36 +295,6 @@ lpfc_unreg_did(struct lpfc_hba * phba, uint32_t did, LPFC_MBOXQ_t * pmb)
292 return; 295 return;
293} 296}
294 297
295/***********************************************/
296
297/* command to write slim */
298/***********************************************/
299void
300lpfc_set_slim(struct lpfc_hba * phba, LPFC_MBOXQ_t * pmb, uint32_t addr,
301 uint32_t value)
302{
303 MAILBOX_t *mb;
304
305 mb = &pmb->mb;
306 memset(pmb, 0, sizeof (LPFC_MBOXQ_t));
307
308 /* addr = 0x090597 is AUTO ABTS disable for ELS commands */
309 /* addr = 0x052198 is DELAYED ABTS enable for ELS commands */
310
311 /*
312 * Always turn on DELAYED ABTS for ELS timeouts
313 */
314 if ((addr == 0x052198) && (value == 0))
315 value = 1;
316
317 mb->un.varWords[0] = addr;
318 mb->un.varWords[1] = value;
319
320 mb->mbxCommand = MBX_SET_SLIM;
321 mb->mbxOwner = OWN_HOST;
322 return;
323}
324
325/**********************************************/ 298/**********************************************/
326/* lpfc_read_nv Issue a READ CONFIG */ 299/* lpfc_read_nv Issue a READ CONFIG */
327/* mailbox command */ 300/* mailbox command */
diff --git a/drivers/scsi/lpfc/lpfc_nportdisc.c b/drivers/scsi/lpfc/lpfc_nportdisc.c
index 3d77bd999b70..27d60ad897cd 100644
--- a/drivers/scsi/lpfc/lpfc_nportdisc.c
+++ b/drivers/scsi/lpfc/lpfc_nportdisc.c
@@ -465,14 +465,18 @@ lpfc_rcv_padisc(struct lpfc_hba * phba,
465static int 465static int
466lpfc_rcv_logo(struct lpfc_hba * phba, 466lpfc_rcv_logo(struct lpfc_hba * phba,
467 struct lpfc_nodelist * ndlp, 467 struct lpfc_nodelist * ndlp,
468 struct lpfc_iocbq *cmdiocb) 468 struct lpfc_iocbq *cmdiocb,
469 uint32_t els_cmd)
469{ 470{
470 /* Put ndlp on NPR list with 1 sec timeout for plogi, ACC logo */ 471 /* Put ndlp on NPR list with 1 sec timeout for plogi, ACC logo */
471 /* Only call LOGO ACC for first LOGO, this avoids sending unnecessary 472 /* Only call LOGO ACC for first LOGO, this avoids sending unnecessary
472 * PLOGIs during LOGO storms from a device. 473 * PLOGIs during LOGO storms from a device.
473 */ 474 */
474 ndlp->nlp_flag |= NLP_LOGO_ACC; 475 ndlp->nlp_flag |= NLP_LOGO_ACC;
475 lpfc_els_rsp_acc(phba, ELS_CMD_ACC, cmdiocb, ndlp, NULL, 0); 476 if (els_cmd == ELS_CMD_PRLO)
477 lpfc_els_rsp_acc(phba, ELS_CMD_PRLO, cmdiocb, ndlp, NULL, 0);
478 else
479 lpfc_els_rsp_acc(phba, ELS_CMD_ACC, cmdiocb, ndlp, NULL, 0);
476 480
477 if (!(ndlp->nlp_type & NLP_FABRIC) || 481 if (!(ndlp->nlp_type & NLP_FABRIC) ||
478 (ndlp->nlp_state == NLP_STE_ADISC_ISSUE)) { 482 (ndlp->nlp_state == NLP_STE_ADISC_ISSUE)) {
@@ -681,7 +685,7 @@ lpfc_rcv_logo_plogi_issue(struct lpfc_hba * phba,
681 /* software abort outstanding PLOGI */ 685 /* software abort outstanding PLOGI */
682 lpfc_els_abort(phba, ndlp, 1); 686 lpfc_els_abort(phba, ndlp, 1);
683 687
684 lpfc_rcv_logo(phba, ndlp, cmdiocb); 688 lpfc_rcv_logo(phba, ndlp, cmdiocb, ELS_CMD_LOGO);
685 return ndlp->nlp_state; 689 return ndlp->nlp_state;
686} 690}
687 691
@@ -788,10 +792,6 @@ lpfc_cmpl_plogi_plogi_issue(struct lpfc_hba * phba,
788 if (lpfc_reg_login 792 if (lpfc_reg_login
789 (phba, irsp->un.elsreq64.remoteID, 793 (phba, irsp->un.elsreq64.remoteID,
790 (uint8_t *) sp, mbox, 0) == 0) { 794 (uint8_t *) sp, mbox, 0) == 0) {
791 /* set_slim mailbox command needs to
792 * execute first, queue this command to
793 * be processed later.
794 */
795 switch (ndlp->nlp_DID) { 795 switch (ndlp->nlp_DID) {
796 case NameServer_DID: 796 case NameServer_DID:
797 mbox->mbox_cmpl = 797 mbox->mbox_cmpl =
@@ -832,11 +832,17 @@ static uint32_t
832lpfc_device_rm_plogi_issue(struct lpfc_hba * phba, 832lpfc_device_rm_plogi_issue(struct lpfc_hba * phba,
833 struct lpfc_nodelist * ndlp, void *arg, uint32_t evt) 833 struct lpfc_nodelist * ndlp, void *arg, uint32_t evt)
834{ 834{
835 /* software abort outstanding PLOGI */ 835 if(ndlp->nlp_flag & NLP_NPR_2B_DISC) {
836 lpfc_els_abort(phba, ndlp, 1); 836 ndlp->nlp_flag |= NLP_NODEV_REMOVE;
837 return ndlp->nlp_state;
838 }
839 else {
840 /* software abort outstanding PLOGI */
841 lpfc_els_abort(phba, ndlp, 1);
837 842
838 lpfc_nlp_list(phba, ndlp, NLP_NO_LIST); 843 lpfc_nlp_list(phba, ndlp, NLP_NO_LIST);
839 return NLP_STE_FREED_NODE; 844 return NLP_STE_FREED_NODE;
845 }
840} 846}
841 847
842static uint32_t 848static uint32_t
@@ -851,7 +857,7 @@ lpfc_device_recov_plogi_issue(struct lpfc_hba * phba,
851 ndlp->nlp_state = NLP_STE_NPR_NODE; 857 ndlp->nlp_state = NLP_STE_NPR_NODE;
852 lpfc_nlp_list(phba, ndlp, NLP_NPR_LIST); 858 lpfc_nlp_list(phba, ndlp, NLP_NPR_LIST);
853 spin_lock_irq(phba->host->host_lock); 859 spin_lock_irq(phba->host->host_lock);
854 ndlp->nlp_flag &= ~NLP_NPR_2B_DISC; 860 ndlp->nlp_flag &= ~(NLP_NODEV_REMOVE | NLP_NPR_2B_DISC);
855 spin_unlock_irq(phba->host->host_lock); 861 spin_unlock_irq(phba->host->host_lock);
856 862
857 return ndlp->nlp_state; 863 return ndlp->nlp_state;
@@ -905,7 +911,7 @@ lpfc_rcv_logo_adisc_issue(struct lpfc_hba * phba,
905 /* software abort outstanding ADISC */ 911 /* software abort outstanding ADISC */
906 lpfc_els_abort(phba, ndlp, 0); 912 lpfc_els_abort(phba, ndlp, 0);
907 913
908 lpfc_rcv_logo(phba, ndlp, cmdiocb); 914 lpfc_rcv_logo(phba, ndlp, cmdiocb, ELS_CMD_LOGO);
909 return ndlp->nlp_state; 915 return ndlp->nlp_state;
910} 916}
911 917
@@ -932,7 +938,7 @@ lpfc_rcv_prlo_adisc_issue(struct lpfc_hba * phba,
932 cmdiocb = (struct lpfc_iocbq *) arg; 938 cmdiocb = (struct lpfc_iocbq *) arg;
933 939
934 /* Treat like rcv logo */ 940 /* Treat like rcv logo */
935 lpfc_rcv_logo(phba, ndlp, cmdiocb); 941 lpfc_rcv_logo(phba, ndlp, cmdiocb, ELS_CMD_PRLO);
936 return ndlp->nlp_state; 942 return ndlp->nlp_state;
937} 943}
938 944
@@ -987,11 +993,17 @@ lpfc_device_rm_adisc_issue(struct lpfc_hba * phba,
987 struct lpfc_nodelist * ndlp, void *arg, 993 struct lpfc_nodelist * ndlp, void *arg,
988 uint32_t evt) 994 uint32_t evt)
989{ 995{
990 /* software abort outstanding ADISC */ 996 if(ndlp->nlp_flag & NLP_NPR_2B_DISC) {
991 lpfc_els_abort(phba, ndlp, 1); 997 ndlp->nlp_flag |= NLP_NODEV_REMOVE;
998 return ndlp->nlp_state;
999 }
1000 else {
1001 /* software abort outstanding ADISC */
1002 lpfc_els_abort(phba, ndlp, 1);
992 1003
993 lpfc_nlp_list(phba, ndlp, NLP_NO_LIST); 1004 lpfc_nlp_list(phba, ndlp, NLP_NO_LIST);
994 return NLP_STE_FREED_NODE; 1005 return NLP_STE_FREED_NODE;
1006 }
995} 1007}
996 1008
997static uint32_t 1009static uint32_t
@@ -1006,7 +1018,7 @@ lpfc_device_recov_adisc_issue(struct lpfc_hba * phba,
1006 ndlp->nlp_state = NLP_STE_NPR_NODE; 1018 ndlp->nlp_state = NLP_STE_NPR_NODE;
1007 lpfc_nlp_list(phba, ndlp, NLP_NPR_LIST); 1019 lpfc_nlp_list(phba, ndlp, NLP_NPR_LIST);
1008 spin_lock_irq(phba->host->host_lock); 1020 spin_lock_irq(phba->host->host_lock);
1009 ndlp->nlp_flag &= ~NLP_NPR_2B_DISC; 1021 ndlp->nlp_flag &= ~(NLP_NODEV_REMOVE | NLP_NPR_2B_DISC);
1010 ndlp->nlp_flag |= NLP_NPR_ADISC; 1022 ndlp->nlp_flag |= NLP_NPR_ADISC;
1011 spin_unlock_irq(phba->host->host_lock); 1023 spin_unlock_irq(phba->host->host_lock);
1012 1024
@@ -1048,7 +1060,7 @@ lpfc_rcv_logo_reglogin_issue(struct lpfc_hba * phba,
1048 1060
1049 cmdiocb = (struct lpfc_iocbq *) arg; 1061 cmdiocb = (struct lpfc_iocbq *) arg;
1050 1062
1051 lpfc_rcv_logo(phba, ndlp, cmdiocb); 1063 lpfc_rcv_logo(phba, ndlp, cmdiocb, ELS_CMD_LOGO);
1052 return ndlp->nlp_state; 1064 return ndlp->nlp_state;
1053} 1065}
1054 1066
@@ -1073,7 +1085,7 @@ lpfc_rcv_prlo_reglogin_issue(struct lpfc_hba * phba,
1073 struct lpfc_iocbq *cmdiocb; 1085 struct lpfc_iocbq *cmdiocb;
1074 1086
1075 cmdiocb = (struct lpfc_iocbq *) arg; 1087 cmdiocb = (struct lpfc_iocbq *) arg;
1076 lpfc_els_rsp_acc(phba, ELS_CMD_ACC, cmdiocb, ndlp, NULL, 0); 1088 lpfc_els_rsp_acc(phba, ELS_CMD_PRLO, cmdiocb, ndlp, NULL, 0);
1077 return ndlp->nlp_state; 1089 return ndlp->nlp_state;
1078} 1090}
1079 1091
@@ -1133,8 +1145,14 @@ lpfc_device_rm_reglogin_issue(struct lpfc_hba * phba,
1133 struct lpfc_nodelist * ndlp, void *arg, 1145 struct lpfc_nodelist * ndlp, void *arg,
1134 uint32_t evt) 1146 uint32_t evt)
1135{ 1147{
1136 lpfc_nlp_list(phba, ndlp, NLP_NO_LIST); 1148 if(ndlp->nlp_flag & NLP_NPR_2B_DISC) {
1137 return NLP_STE_FREED_NODE; 1149 ndlp->nlp_flag |= NLP_NODEV_REMOVE;
1150 return ndlp->nlp_state;
1151 }
1152 else {
1153 lpfc_nlp_list(phba, ndlp, NLP_NO_LIST);
1154 return NLP_STE_FREED_NODE;
1155 }
1138} 1156}
1139 1157
1140static uint32_t 1158static uint32_t
@@ -1146,7 +1164,7 @@ lpfc_device_recov_reglogin_issue(struct lpfc_hba * phba,
1146 ndlp->nlp_state = NLP_STE_NPR_NODE; 1164 ndlp->nlp_state = NLP_STE_NPR_NODE;
1147 lpfc_nlp_list(phba, ndlp, NLP_NPR_LIST); 1165 lpfc_nlp_list(phba, ndlp, NLP_NPR_LIST);
1148 spin_lock_irq(phba->host->host_lock); 1166 spin_lock_irq(phba->host->host_lock);
1149 ndlp->nlp_flag &= ~NLP_NPR_2B_DISC; 1167 ndlp->nlp_flag &= ~(NLP_NODEV_REMOVE | NLP_NPR_2B_DISC);
1150 spin_unlock_irq(phba->host->host_lock); 1168 spin_unlock_irq(phba->host->host_lock);
1151 return ndlp->nlp_state; 1169 return ndlp->nlp_state;
1152} 1170}
@@ -1186,7 +1204,7 @@ lpfc_rcv_logo_prli_issue(struct lpfc_hba * phba,
1186 /* Software abort outstanding PRLI before sending acc */ 1204 /* Software abort outstanding PRLI before sending acc */
1187 lpfc_els_abort(phba, ndlp, 1); 1205 lpfc_els_abort(phba, ndlp, 1);
1188 1206
1189 lpfc_rcv_logo(phba, ndlp, cmdiocb); 1207 lpfc_rcv_logo(phba, ndlp, cmdiocb, ELS_CMD_LOGO);
1190 return ndlp->nlp_state; 1208 return ndlp->nlp_state;
1191} 1209}
1192 1210
@@ -1214,7 +1232,7 @@ lpfc_rcv_prlo_prli_issue(struct lpfc_hba * phba,
1214 struct lpfc_iocbq *cmdiocb; 1232 struct lpfc_iocbq *cmdiocb;
1215 1233
1216 cmdiocb = (struct lpfc_iocbq *) arg; 1234 cmdiocb = (struct lpfc_iocbq *) arg;
1217 lpfc_els_rsp_acc(phba, ELS_CMD_ACC, cmdiocb, ndlp, NULL, 0); 1235 lpfc_els_rsp_acc(phba, ELS_CMD_PRLO, cmdiocb, ndlp, NULL, 0);
1218 return ndlp->nlp_state; 1236 return ndlp->nlp_state;
1219} 1237}
1220 1238
@@ -1278,11 +1296,17 @@ static uint32_t
1278lpfc_device_rm_prli_issue(struct lpfc_hba * phba, 1296lpfc_device_rm_prli_issue(struct lpfc_hba * phba,
1279 struct lpfc_nodelist * ndlp, void *arg, uint32_t evt) 1297 struct lpfc_nodelist * ndlp, void *arg, uint32_t evt)
1280{ 1298{
1281 /* software abort outstanding PRLI */ 1299 if(ndlp->nlp_flag & NLP_NPR_2B_DISC) {
1282 lpfc_els_abort(phba, ndlp, 1); 1300 ndlp->nlp_flag |= NLP_NODEV_REMOVE;
1301 return ndlp->nlp_state;
1302 }
1303 else {
1304 /* software abort outstanding PLOGI */
1305 lpfc_els_abort(phba, ndlp, 1);
1283 1306
1284 lpfc_nlp_list(phba, ndlp, NLP_NO_LIST); 1307 lpfc_nlp_list(phba, ndlp, NLP_NO_LIST);
1285 return NLP_STE_FREED_NODE; 1308 return NLP_STE_FREED_NODE;
1309 }
1286} 1310}
1287 1311
1288 1312
@@ -1313,7 +1337,7 @@ lpfc_device_recov_prli_issue(struct lpfc_hba * phba,
1313 ndlp->nlp_state = NLP_STE_NPR_NODE; 1337 ndlp->nlp_state = NLP_STE_NPR_NODE;
1314 lpfc_nlp_list(phba, ndlp, NLP_NPR_LIST); 1338 lpfc_nlp_list(phba, ndlp, NLP_NPR_LIST);
1315 spin_lock_irq(phba->host->host_lock); 1339 spin_lock_irq(phba->host->host_lock);
1316 ndlp->nlp_flag &= ~NLP_NPR_2B_DISC; 1340 ndlp->nlp_flag &= ~(NLP_NODEV_REMOVE | NLP_NPR_2B_DISC);
1317 spin_unlock_irq(phba->host->host_lock); 1341 spin_unlock_irq(phba->host->host_lock);
1318 return ndlp->nlp_state; 1342 return ndlp->nlp_state;
1319} 1343}
@@ -1351,7 +1375,7 @@ lpfc_rcv_logo_unmap_node(struct lpfc_hba * phba,
1351 1375
1352 cmdiocb = (struct lpfc_iocbq *) arg; 1376 cmdiocb = (struct lpfc_iocbq *) arg;
1353 1377
1354 lpfc_rcv_logo(phba, ndlp, cmdiocb); 1378 lpfc_rcv_logo(phba, ndlp, cmdiocb, ELS_CMD_LOGO);
1355 return ndlp->nlp_state; 1379 return ndlp->nlp_state;
1356} 1380}
1357 1381
@@ -1375,7 +1399,7 @@ lpfc_rcv_prlo_unmap_node(struct lpfc_hba * phba,
1375 1399
1376 cmdiocb = (struct lpfc_iocbq *) arg; 1400 cmdiocb = (struct lpfc_iocbq *) arg;
1377 1401
1378 lpfc_els_rsp_acc(phba, ELS_CMD_ACC, cmdiocb, ndlp, NULL, 0); 1402 lpfc_els_rsp_acc(phba, ELS_CMD_PRLO, cmdiocb, ndlp, NULL, 0);
1379 return ndlp->nlp_state; 1403 return ndlp->nlp_state;
1380} 1404}
1381 1405
@@ -1386,7 +1410,7 @@ lpfc_device_recov_unmap_node(struct lpfc_hba * phba,
1386 ndlp->nlp_prev_state = NLP_STE_UNMAPPED_NODE; 1410 ndlp->nlp_prev_state = NLP_STE_UNMAPPED_NODE;
1387 ndlp->nlp_state = NLP_STE_NPR_NODE; 1411 ndlp->nlp_state = NLP_STE_NPR_NODE;
1388 lpfc_nlp_list(phba, ndlp, NLP_NPR_LIST); 1412 lpfc_nlp_list(phba, ndlp, NLP_NPR_LIST);
1389 ndlp->nlp_flag &= ~NLP_NPR_2B_DISC; 1413 ndlp->nlp_flag &= ~(NLP_NODEV_REMOVE | NLP_NPR_2B_DISC);
1390 lpfc_disc_set_adisc(phba, ndlp); 1414 lpfc_disc_set_adisc(phba, ndlp);
1391 1415
1392 return ndlp->nlp_state; 1416 return ndlp->nlp_state;
@@ -1424,7 +1448,7 @@ lpfc_rcv_logo_mapped_node(struct lpfc_hba * phba,
1424 1448
1425 cmdiocb = (struct lpfc_iocbq *) arg; 1449 cmdiocb = (struct lpfc_iocbq *) arg;
1426 1450
1427 lpfc_rcv_logo(phba, ndlp, cmdiocb); 1451 lpfc_rcv_logo(phba, ndlp, cmdiocb, ELS_CMD_LOGO);
1428 return ndlp->nlp_state; 1452 return ndlp->nlp_state;
1429} 1453}
1430 1454
@@ -1456,7 +1480,7 @@ lpfc_rcv_prlo_mapped_node(struct lpfc_hba * phba,
1456 spin_unlock_irq(phba->host->host_lock); 1480 spin_unlock_irq(phba->host->host_lock);
1457 1481
1458 /* Treat like rcv logo */ 1482 /* Treat like rcv logo */
1459 lpfc_rcv_logo(phba, ndlp, cmdiocb); 1483 lpfc_rcv_logo(phba, ndlp, cmdiocb, ELS_CMD_PRLO);
1460 return ndlp->nlp_state; 1484 return ndlp->nlp_state;
1461} 1485}
1462 1486
@@ -1469,7 +1493,7 @@ lpfc_device_recov_mapped_node(struct lpfc_hba * phba,
1469 ndlp->nlp_state = NLP_STE_NPR_NODE; 1493 ndlp->nlp_state = NLP_STE_NPR_NODE;
1470 lpfc_nlp_list(phba, ndlp, NLP_NPR_LIST); 1494 lpfc_nlp_list(phba, ndlp, NLP_NPR_LIST);
1471 spin_lock_irq(phba->host->host_lock); 1495 spin_lock_irq(phba->host->host_lock);
1472 ndlp->nlp_flag &= ~NLP_NPR_2B_DISC; 1496 ndlp->nlp_flag &= ~(NLP_NODEV_REMOVE | NLP_NPR_2B_DISC);
1473 spin_unlock_irq(phba->host->host_lock); 1497 spin_unlock_irq(phba->host->host_lock);
1474 lpfc_disc_set_adisc(phba, ndlp); 1498 lpfc_disc_set_adisc(phba, ndlp);
1475 return ndlp->nlp_state; 1499 return ndlp->nlp_state;
@@ -1551,7 +1575,7 @@ lpfc_rcv_logo_npr_node(struct lpfc_hba * phba,
1551 1575
1552 cmdiocb = (struct lpfc_iocbq *) arg; 1576 cmdiocb = (struct lpfc_iocbq *) arg;
1553 1577
1554 lpfc_rcv_logo(phba, ndlp, cmdiocb); 1578 lpfc_rcv_logo(phba, ndlp, cmdiocb, ELS_CMD_LOGO);
1555 return ndlp->nlp_state; 1579 return ndlp->nlp_state;
1556} 1580}
1557 1581
@@ -1617,9 +1641,16 @@ lpfc_cmpl_plogi_npr_node(struct lpfc_hba * phba,
1617 struct lpfc_nodelist * ndlp, void *arg, uint32_t evt) 1641 struct lpfc_nodelist * ndlp, void *arg, uint32_t evt)
1618{ 1642{
1619 struct lpfc_iocbq *cmdiocb, *rspiocb; 1643 struct lpfc_iocbq *cmdiocb, *rspiocb;
1644 IOCB_t *irsp;
1620 1645
1621 cmdiocb = (struct lpfc_iocbq *) arg; 1646 cmdiocb = (struct lpfc_iocbq *) arg;
1622 rspiocb = cmdiocb->context_un.rsp_iocb; 1647 rspiocb = cmdiocb->context_un.rsp_iocb;
1648
1649 irsp = &rspiocb->iocb;
1650 if (irsp->ulpStatus) {
1651 lpfc_nlp_list(phba, ndlp, NLP_NO_LIST);
1652 return NLP_STE_FREED_NODE;
1653 }
1623 return ndlp->nlp_state; 1654 return ndlp->nlp_state;
1624} 1655}
1625 1656
@@ -1628,9 +1659,16 @@ lpfc_cmpl_prli_npr_node(struct lpfc_hba * phba,
1628 struct lpfc_nodelist * ndlp, void *arg, uint32_t evt) 1659 struct lpfc_nodelist * ndlp, void *arg, uint32_t evt)
1629{ 1660{
1630 struct lpfc_iocbq *cmdiocb, *rspiocb; 1661 struct lpfc_iocbq *cmdiocb, *rspiocb;
1662 IOCB_t *irsp;
1631 1663
1632 cmdiocb = (struct lpfc_iocbq *) arg; 1664 cmdiocb = (struct lpfc_iocbq *) arg;
1633 rspiocb = cmdiocb->context_un.rsp_iocb; 1665 rspiocb = cmdiocb->context_un.rsp_iocb;
1666
1667 irsp = &rspiocb->iocb;
1668 if (irsp->ulpStatus && (ndlp->nlp_flag & NLP_NODEV_REMOVE)) {
1669 lpfc_nlp_list(phba, ndlp, NLP_NO_LIST);
1670 return NLP_STE_FREED_NODE;
1671 }
1634 return ndlp->nlp_state; 1672 return ndlp->nlp_state;
1635} 1673}
1636 1674
@@ -1649,9 +1687,16 @@ lpfc_cmpl_adisc_npr_node(struct lpfc_hba * phba,
1649 uint32_t evt) 1687 uint32_t evt)
1650{ 1688{
1651 struct lpfc_iocbq *cmdiocb, *rspiocb; 1689 struct lpfc_iocbq *cmdiocb, *rspiocb;
1690 IOCB_t *irsp;
1652 1691
1653 cmdiocb = (struct lpfc_iocbq *) arg; 1692 cmdiocb = (struct lpfc_iocbq *) arg;
1654 rspiocb = cmdiocb->context_un.rsp_iocb; 1693 rspiocb = cmdiocb->context_un.rsp_iocb;
1694
1695 irsp = &rspiocb->iocb;
1696 if (irsp->ulpStatus && (ndlp->nlp_flag & NLP_NODEV_REMOVE)) {
1697 lpfc_nlp_list(phba, ndlp, NLP_NO_LIST);
1698 return NLP_STE_FREED_NODE;
1699 }
1655 return ndlp->nlp_state; 1700 return ndlp->nlp_state;
1656} 1701}
1657 1702
@@ -1668,7 +1713,12 @@ lpfc_cmpl_reglogin_npr_node(struct lpfc_hba * phba,
1668 1713
1669 if (!mb->mbxStatus) 1714 if (!mb->mbxStatus)
1670 ndlp->nlp_rpi = mb->un.varWords[0]; 1715 ndlp->nlp_rpi = mb->un.varWords[0];
1671 1716 else {
1717 if (ndlp->nlp_flag & NLP_NODEV_REMOVE) {
1718 lpfc_nlp_list(phba, ndlp, NLP_NO_LIST);
1719 return NLP_STE_FREED_NODE;
1720 }
1721 }
1672 return ndlp->nlp_state; 1722 return ndlp->nlp_state;
1673} 1723}
1674 1724
@@ -1677,6 +1727,10 @@ lpfc_device_rm_npr_node(struct lpfc_hba * phba,
1677 struct lpfc_nodelist * ndlp, void *arg, 1727 struct lpfc_nodelist * ndlp, void *arg,
1678 uint32_t evt) 1728 uint32_t evt)
1679{ 1729{
1730 if (ndlp->nlp_flag & NLP_NPR_2B_DISC) {
1731 ndlp->nlp_flag |= NLP_NODEV_REMOVE;
1732 return ndlp->nlp_state;
1733 }
1680 lpfc_nlp_list(phba, ndlp, NLP_NO_LIST); 1734 lpfc_nlp_list(phba, ndlp, NLP_NO_LIST);
1681 return NLP_STE_FREED_NODE; 1735 return NLP_STE_FREED_NODE;
1682} 1736}
@@ -1687,7 +1741,7 @@ lpfc_device_recov_npr_node(struct lpfc_hba * phba,
1687 uint32_t evt) 1741 uint32_t evt)
1688{ 1742{
1689 spin_lock_irq(phba->host->host_lock); 1743 spin_lock_irq(phba->host->host_lock);
1690 ndlp->nlp_flag &= ~NLP_NPR_2B_DISC; 1744 ndlp->nlp_flag &= ~(NLP_NODEV_REMOVE | NLP_NPR_2B_DISC);
1691 spin_unlock_irq(phba->host->host_lock); 1745 spin_unlock_irq(phba->host->host_lock);
1692 if (ndlp->nlp_flag & NLP_DELAY_TMO) { 1746 if (ndlp->nlp_flag & NLP_DELAY_TMO) {
1693 lpfc_cancel_retry_delay_tmo(phba, ndlp); 1747 lpfc_cancel_retry_delay_tmo(phba, ndlp);
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
index f93799873721..7dc4c2e6bed2 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -629,8 +629,7 @@ lpfc_scsi_prep_task_mgmt_cmd(struct lpfc_hba *phba,
629 struct lpfc_iocbq *piocbq; 629 struct lpfc_iocbq *piocbq;
630 IOCB_t *piocb; 630 IOCB_t *piocb;
631 struct fcp_cmnd *fcp_cmnd; 631 struct fcp_cmnd *fcp_cmnd;
632 struct scsi_device *scsi_dev = lpfc_cmd->pCmd->device; 632 struct lpfc_rport_data *rdata = lpfc_cmd->rdata;
633 struct lpfc_rport_data *rdata = scsi_dev->hostdata;
634 struct lpfc_nodelist *ndlp = rdata->pnode; 633 struct lpfc_nodelist *ndlp = rdata->pnode;
635 634
636 if ((ndlp == NULL) || (ndlp->nlp_state != NLP_STE_MAPPED_NODE)) { 635 if ((ndlp == NULL) || (ndlp->nlp_state != NLP_STE_MAPPED_NODE)) {
@@ -665,56 +664,18 @@ lpfc_scsi_prep_task_mgmt_cmd(struct lpfc_hba *phba,
665 piocb->ulpTimeout = lpfc_cmd->timeout; 664 piocb->ulpTimeout = lpfc_cmd->timeout;
666 } 665 }
667 666
668 lpfc_cmd->rdata = rdata;
669
670 switch (task_mgmt_cmd) {
671 case FCP_LUN_RESET:
672 /* Issue LUN Reset to TGT <num> LUN <num> */
673 lpfc_printf_log(phba,
674 KERN_INFO,
675 LOG_FCP,
676 "%d:0703 Issue LUN Reset to TGT %d LUN %d "
677 "Data: x%x x%x\n",
678 phba->brd_no,
679 scsi_dev->id, scsi_dev->lun,
680 ndlp->nlp_rpi, ndlp->nlp_flag);
681
682 break;
683 case FCP_ABORT_TASK_SET:
684 /* Issue Abort Task Set to TGT <num> LUN <num> */
685 lpfc_printf_log(phba,
686 KERN_INFO,
687 LOG_FCP,
688 "%d:0701 Issue Abort Task Set to TGT %d LUN %d "
689 "Data: x%x x%x\n",
690 phba->brd_no,
691 scsi_dev->id, scsi_dev->lun,
692 ndlp->nlp_rpi, ndlp->nlp_flag);
693
694 break;
695 case FCP_TARGET_RESET:
696 /* Issue Target Reset to TGT <num> */
697 lpfc_printf_log(phba,
698 KERN_INFO,
699 LOG_FCP,
700 "%d:0702 Issue Target Reset to TGT %d "
701 "Data: x%x x%x\n",
702 phba->brd_no,
703 scsi_dev->id, ndlp->nlp_rpi,
704 ndlp->nlp_flag);
705 break;
706 }
707
708 return (1); 667 return (1);
709} 668}
710 669
711static int 670static int
712lpfc_scsi_tgt_reset(struct lpfc_scsi_buf * lpfc_cmd, struct lpfc_hba * phba) 671lpfc_scsi_tgt_reset(struct lpfc_scsi_buf * lpfc_cmd, struct lpfc_hba * phba,
672 unsigned tgt_id, struct lpfc_rport_data *rdata)
713{ 673{
714 struct lpfc_iocbq *iocbq; 674 struct lpfc_iocbq *iocbq;
715 struct lpfc_iocbq *iocbqrsp; 675 struct lpfc_iocbq *iocbqrsp;
716 int ret; 676 int ret;
717 677
678 lpfc_cmd->rdata = rdata;
718 ret = lpfc_scsi_prep_task_mgmt_cmd(phba, lpfc_cmd, FCP_TARGET_RESET); 679 ret = lpfc_scsi_prep_task_mgmt_cmd(phba, lpfc_cmd, FCP_TARGET_RESET);
719 if (!ret) 680 if (!ret)
720 return FAILED; 681 return FAILED;
@@ -726,6 +687,13 @@ lpfc_scsi_tgt_reset(struct lpfc_scsi_buf * lpfc_cmd, struct lpfc_hba * phba)
726 if (!iocbqrsp) 687 if (!iocbqrsp)
727 return FAILED; 688 return FAILED;
728 689
690 /* Issue Target Reset to TGT <num> */
691 lpfc_printf_log(phba, KERN_INFO, LOG_FCP,
692 "%d:0702 Issue Target Reset to TGT %d "
693 "Data: x%x x%x\n",
694 phba->brd_no, tgt_id, rdata->pnode->nlp_rpi,
695 rdata->pnode->nlp_flag);
696
729 ret = lpfc_sli_issue_iocb_wait(phba, 697 ret = lpfc_sli_issue_iocb_wait(phba,
730 &phba->sli.ring[phba->sli.fcp_ring], 698 &phba->sli.ring[phba->sli.fcp_ring],
731 iocbq, iocbqrsp, lpfc_cmd->timeout); 699 iocbq, iocbqrsp, lpfc_cmd->timeout);
@@ -1021,6 +989,7 @@ lpfc_reset_lun_handler(struct scsi_cmnd *cmnd)
1021 lpfc_cmd->pCmd = cmnd; 989 lpfc_cmd->pCmd = cmnd;
1022 lpfc_cmd->timeout = 60; 990 lpfc_cmd->timeout = 60;
1023 lpfc_cmd->scsi_hba = phba; 991 lpfc_cmd->scsi_hba = phba;
992 lpfc_cmd->rdata = rdata;
1024 993
1025 ret = lpfc_scsi_prep_task_mgmt_cmd(phba, lpfc_cmd, FCP_LUN_RESET); 994 ret = lpfc_scsi_prep_task_mgmt_cmd(phba, lpfc_cmd, FCP_LUN_RESET);
1026 if (!ret) 995 if (!ret)
@@ -1033,6 +1002,11 @@ lpfc_reset_lun_handler(struct scsi_cmnd *cmnd)
1033 if (iocbqrsp == NULL) 1002 if (iocbqrsp == NULL)
1034 goto out_free_scsi_buf; 1003 goto out_free_scsi_buf;
1035 1004
1005 lpfc_printf_log(phba, KERN_INFO, LOG_FCP,
1006 "%d:0703 Issue LUN Reset to TGT %d LUN %d "
1007 "Data: x%x x%x\n", phba->brd_no, cmnd->device->id,
1008 cmnd->device->lun, pnode->nlp_rpi, pnode->nlp_flag);
1009
1036 ret = lpfc_sli_issue_iocb_wait(phba, 1010 ret = lpfc_sli_issue_iocb_wait(phba,
1037 &phba->sli.ring[phba->sli.fcp_ring], 1011 &phba->sli.ring[phba->sli.fcp_ring],
1038 iocbq, iocbqrsp, lpfc_cmd->timeout); 1012 iocbq, iocbqrsp, lpfc_cmd->timeout);
@@ -1104,7 +1078,6 @@ lpfc_reset_bus_handler(struct scsi_cmnd *cmnd)
1104 int match; 1078 int match;
1105 int ret = FAILED, i, err_count = 0; 1079 int ret = FAILED, i, err_count = 0;
1106 int cnt, loopcnt; 1080 int cnt, loopcnt;
1107 unsigned int midlayer_id = 0;
1108 struct lpfc_scsi_buf * lpfc_cmd; 1081 struct lpfc_scsi_buf * lpfc_cmd;
1109 1082
1110 lpfc_block_requests(phba); 1083 lpfc_block_requests(phba);
@@ -1124,7 +1097,6 @@ lpfc_reset_bus_handler(struct scsi_cmnd *cmnd)
1124 * targets known to the driver. Should any target reset 1097 * targets known to the driver. Should any target reset
1125 * fail, this routine returns failure to the midlayer. 1098 * fail, this routine returns failure to the midlayer.
1126 */ 1099 */
1127 midlayer_id = cmnd->device->id;
1128 for (i = 0; i < MAX_FCP_TARGET; i++) { 1100 for (i = 0; i < MAX_FCP_TARGET; i++) {
1129 /* Search the mapped list for this target ID */ 1101 /* Search the mapped list for this target ID */
1130 match = 0; 1102 match = 0;
@@ -1137,9 +1109,8 @@ lpfc_reset_bus_handler(struct scsi_cmnd *cmnd)
1137 if (!match) 1109 if (!match)
1138 continue; 1110 continue;
1139 1111
1140 lpfc_cmd->pCmd->device->id = i; 1112 ret = lpfc_scsi_tgt_reset(lpfc_cmd, phba,
1141 lpfc_cmd->pCmd->device->hostdata = ndlp->rport->dd_data; 1113 i, ndlp->rport->dd_data);
1142 ret = lpfc_scsi_tgt_reset(lpfc_cmd, phba);
1143 if (ret != SUCCESS) { 1114 if (ret != SUCCESS) {
1144 lpfc_printf_log(phba, KERN_ERR, LOG_FCP, 1115 lpfc_printf_log(phba, KERN_ERR, LOG_FCP,
1145 "%d:0713 Bus Reset on target %d failed\n", 1116 "%d:0713 Bus Reset on target %d failed\n",
@@ -1158,7 +1129,6 @@ lpfc_reset_bus_handler(struct scsi_cmnd *cmnd)
1158 * the targets. Unfortunately, some targets do not abide by 1129 * the targets. Unfortunately, some targets do not abide by
1159 * this forcing the driver to double check. 1130 * this forcing the driver to double check.
1160 */ 1131 */
1161 cmnd->device->id = midlayer_id;
1162 cnt = lpfc_sli_sum_iocb(phba, &phba->sli.ring[phba->sli.fcp_ring], 1132 cnt = lpfc_sli_sum_iocb(phba, &phba->sli.ring[phba->sli.fcp_ring],
1163 0, 0, LPFC_CTX_HOST); 1133 0, 0, LPFC_CTX_HOST);
1164 if (cnt) 1134 if (cnt)
diff --git a/drivers/scsi/lpfc/lpfc_version.h b/drivers/scsi/lpfc/lpfc_version.h
index 4cf1366108b7..6b737568b831 100644
--- a/drivers/scsi/lpfc/lpfc_version.h
+++ b/drivers/scsi/lpfc/lpfc_version.h
@@ -18,7 +18,7 @@
18 * included with this package. * 18 * included with this package. *
19 *******************************************************************/ 19 *******************************************************************/
20 20
21#define LPFC_DRIVER_VERSION "8.1.4" 21#define LPFC_DRIVER_VERSION "8.1.6"
22 22
23#define LPFC_DRIVER_NAME "lpfc" 23#define LPFC_DRIVER_NAME "lpfc"
24 24
diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c
index d245717fee65..c33857e7b33b 100644
--- a/drivers/scsi/megaraid.c
+++ b/drivers/scsi/megaraid.c
@@ -4471,7 +4471,6 @@ mega_internal_command(adapter_t *adapter, megacmd_t *mc, mega_passthru *pthru)
4471{ 4471{
4472 Scsi_Cmnd *scmd; 4472 Scsi_Cmnd *scmd;
4473 struct scsi_device *sdev; 4473 struct scsi_device *sdev;
4474 unsigned long flags = 0;
4475 scb_t *scb; 4474 scb_t *scb;
4476 int rval; 4475 int rval;
4477 4476
diff --git a/drivers/scsi/megaraid/megaraid_mbox.c b/drivers/scsi/megaraid/megaraid_mbox.c
index c11e5ce6865e..bec1424eda85 100644
--- a/drivers/scsi/megaraid/megaraid_mbox.c
+++ b/drivers/scsi/megaraid/megaraid_mbox.c
@@ -10,7 +10,7 @@
10 * 2 of the License, or (at your option) any later version. 10 * 2 of the License, or (at your option) any later version.
11 * 11 *
12 * FILE : megaraid_mbox.c 12 * FILE : megaraid_mbox.c
13 * Version : v2.20.4.7 (Nov 14 2005) 13 * Version : v2.20.4.8 (Apr 11 2006)
14 * 14 *
15 * Authors: 15 * Authors:
16 * Atul Mukker <Atul.Mukker@lsil.com> 16 * Atul Mukker <Atul.Mukker@lsil.com>
@@ -2278,6 +2278,7 @@ megaraid_mbox_dpc(unsigned long devp)
2278 unsigned long flags; 2278 unsigned long flags;
2279 uint8_t c; 2279 uint8_t c;
2280 int status; 2280 int status;
2281 uioc_t *kioc;
2281 2282
2282 2283
2283 if (!adapter) return; 2284 if (!adapter) return;
@@ -2320,6 +2321,9 @@ megaraid_mbox_dpc(unsigned long devp)
2320 // remove from local clist 2321 // remove from local clist
2321 list_del_init(&scb->list); 2322 list_del_init(&scb->list);
2322 2323
2324 kioc = (uioc_t *)scb->gp;
2325 kioc->status = 0;
2326
2323 megaraid_mbox_mm_done(adapter, scb); 2327 megaraid_mbox_mm_done(adapter, scb);
2324 2328
2325 continue; 2329 continue;
@@ -2636,6 +2640,7 @@ megaraid_reset_handler(struct scsi_cmnd *scp)
2636 int recovery_window; 2640 int recovery_window;
2637 int recovering; 2641 int recovering;
2638 int i; 2642 int i;
2643 uioc_t *kioc;
2639 2644
2640 adapter = SCP2ADAPTER(scp); 2645 adapter = SCP2ADAPTER(scp);
2641 raid_dev = ADAP2RAIDDEV(adapter); 2646 raid_dev = ADAP2RAIDDEV(adapter);
@@ -2655,32 +2660,51 @@ megaraid_reset_handler(struct scsi_cmnd *scp)
2655 // Also, reset all the commands currently owned by the driver 2660 // Also, reset all the commands currently owned by the driver
2656 spin_lock_irqsave(PENDING_LIST_LOCK(adapter), flags); 2661 spin_lock_irqsave(PENDING_LIST_LOCK(adapter), flags);
2657 list_for_each_entry_safe(scb, tmp, &adapter->pend_list, list) { 2662 list_for_each_entry_safe(scb, tmp, &adapter->pend_list, list) {
2658
2659 list_del_init(&scb->list); // from pending list 2663 list_del_init(&scb->list); // from pending list
2660 2664
2661 con_log(CL_ANN, (KERN_WARNING 2665 if (scb->sno >= MBOX_MAX_SCSI_CMDS) {
2662 "megaraid: %ld:%d[%d:%d], reset from pending list\n", 2666 con_log(CL_ANN, (KERN_WARNING
2663 scp->serial_number, scb->sno, 2667 "megaraid: IOCTL packet with %d[%d:%d] being reset\n",
2664 scb->dev_channel, scb->dev_target)); 2668 scb->sno, scb->dev_channel, scb->dev_target));
2665 2669
2666 scp->result = (DID_RESET << 16); 2670 scb->status = -1;
2667 scp->scsi_done(scp);
2668 2671
2669 megaraid_dealloc_scb(adapter, scb); 2672 kioc = (uioc_t *)scb->gp;
2673 kioc->status = -EFAULT;
2674
2675 megaraid_mbox_mm_done(adapter, scb);
2676 } else {
2677 if (scb->scp == scp) { // Found command
2678 con_log(CL_ANN, (KERN_WARNING
2679 "megaraid: %ld:%d[%d:%d], reset from pending list\n",
2680 scp->serial_number, scb->sno,
2681 scb->dev_channel, scb->dev_target));
2682 } else {
2683 con_log(CL_ANN, (KERN_WARNING
2684 "megaraid: IO packet with %d[%d:%d] being reset\n",
2685 scb->sno, scb->dev_channel, scb->dev_target));
2686 }
2687
2688 scb->scp->result = (DID_RESET << 16);
2689 scb->scp->scsi_done(scb->scp);
2690
2691 megaraid_dealloc_scb(adapter, scb);
2692 }
2670 } 2693 }
2671 spin_unlock_irqrestore(PENDING_LIST_LOCK(adapter), flags); 2694 spin_unlock_irqrestore(PENDING_LIST_LOCK(adapter), flags);
2672 2695
2673 if (adapter->outstanding_cmds) { 2696 if (adapter->outstanding_cmds) {
2674 con_log(CL_ANN, (KERN_NOTICE 2697 con_log(CL_ANN, (KERN_NOTICE
2675 "megaraid: %d outstanding commands. Max wait %d sec\n", 2698 "megaraid: %d outstanding commands. Max wait %d sec\n",
2676 adapter->outstanding_cmds, MBOX_RESET_WAIT)); 2699 adapter->outstanding_cmds,
2700 (MBOX_RESET_WAIT + MBOX_RESET_EXT_WAIT)));
2677 } 2701 }
2678 2702
2679 recovery_window = MBOX_RESET_WAIT + MBOX_RESET_EXT_WAIT; 2703 recovery_window = MBOX_RESET_WAIT + MBOX_RESET_EXT_WAIT;
2680 2704
2681 recovering = adapter->outstanding_cmds; 2705 recovering = adapter->outstanding_cmds;
2682 2706
2683 for (i = 0; i < recovery_window && adapter->outstanding_cmds; i++) { 2707 for (i = 0; i < recovery_window; i++) {
2684 2708
2685 megaraid_ack_sequence(adapter); 2709 megaraid_ack_sequence(adapter);
2686 2710
@@ -2689,12 +2713,11 @@ megaraid_reset_handler(struct scsi_cmnd *scp)
2689 con_log(CL_ANN, ( 2713 con_log(CL_ANN, (
2690 "megaraid mbox: Wait for %d commands to complete:%d\n", 2714 "megaraid mbox: Wait for %d commands to complete:%d\n",
2691 adapter->outstanding_cmds, 2715 adapter->outstanding_cmds,
2692 MBOX_RESET_WAIT - i)); 2716 (MBOX_RESET_WAIT + MBOX_RESET_EXT_WAIT) - i));
2693 } 2717 }
2694 2718
2695 // bailout if no recovery happended in reset time 2719 // bailout if no recovery happended in reset time
2696 if ((i == MBOX_RESET_WAIT) && 2720 if (adapter->outstanding_cmds == 0) {
2697 (recovering == adapter->outstanding_cmds)) {
2698 break; 2721 break;
2699 } 2722 }
2700 2723
@@ -2918,12 +2941,13 @@ mbox_post_sync_cmd_fast(adapter_t *adapter, uint8_t raw_mbox[])
2918 wmb(); 2941 wmb();
2919 WRINDOOR(raid_dev, raid_dev->mbox_dma | 0x1); 2942 WRINDOOR(raid_dev, raid_dev->mbox_dma | 0x1);
2920 2943
2921 for (i = 0; i < 0xFFFFF; i++) { 2944 for (i = 0; i < MBOX_SYNC_WAIT_CNT; i++) {
2922 if (mbox->numstatus != 0xFF) break; 2945 if (mbox->numstatus != 0xFF) break;
2923 rmb(); 2946 rmb();
2947 udelay(MBOX_SYNC_DELAY_200);
2924 } 2948 }
2925 2949
2926 if (i == 0xFFFFF) { 2950 if (i == MBOX_SYNC_WAIT_CNT) {
2927 // We may need to re-calibrate the counter 2951 // We may need to re-calibrate the counter
2928 con_log(CL_ANN, (KERN_CRIT 2952 con_log(CL_ANN, (KERN_CRIT
2929 "megaraid: fast sync command timed out\n")); 2953 "megaraid: fast sync command timed out\n"));
@@ -3475,7 +3499,7 @@ megaraid_cmm_register(adapter_t *adapter)
3475 adp.drvr_data = (unsigned long)adapter; 3499 adp.drvr_data = (unsigned long)adapter;
3476 adp.pdev = adapter->pdev; 3500 adp.pdev = adapter->pdev;
3477 adp.issue_uioc = megaraid_mbox_mm_handler; 3501 adp.issue_uioc = megaraid_mbox_mm_handler;
3478 adp.timeout = 300; 3502 adp.timeout = MBOX_RESET_WAIT + MBOX_RESET_EXT_WAIT;
3479 adp.max_kioc = MBOX_MAX_USER_CMDS; 3503 adp.max_kioc = MBOX_MAX_USER_CMDS;
3480 3504
3481 if ((rval = mraid_mm_register_adp(&adp)) != 0) { 3505 if ((rval = mraid_mm_register_adp(&adp)) != 0) {
@@ -3702,7 +3726,6 @@ megaraid_mbox_mm_done(adapter_t *adapter, scb_t *scb)
3702 unsigned long flags; 3726 unsigned long flags;
3703 3727
3704 kioc = (uioc_t *)scb->gp; 3728 kioc = (uioc_t *)scb->gp;
3705 kioc->status = 0;
3706 mbox64 = (mbox64_t *)(unsigned long)kioc->cmdbuf; 3729 mbox64 = (mbox64_t *)(unsigned long)kioc->cmdbuf;
3707 mbox64->mbox32.status = scb->status; 3730 mbox64->mbox32.status = scb->status;
3708 raw_mbox = (uint8_t *)&mbox64->mbox32; 3731 raw_mbox = (uint8_t *)&mbox64->mbox32;
diff --git a/drivers/scsi/megaraid/megaraid_mbox.h b/drivers/scsi/megaraid/megaraid_mbox.h
index 882fb1a0b575..868fb0ec93e7 100644
--- a/drivers/scsi/megaraid/megaraid_mbox.h
+++ b/drivers/scsi/megaraid/megaraid_mbox.h
@@ -21,8 +21,8 @@
21#include "megaraid_ioctl.h" 21#include "megaraid_ioctl.h"
22 22
23 23
24#define MEGARAID_VERSION "2.20.4.7" 24#define MEGARAID_VERSION "2.20.4.8"
25#define MEGARAID_EXT_VERSION "(Release Date: Mon Nov 14 12:27:22 EST 2005)" 25#define MEGARAID_EXT_VERSION "(Release Date: Mon Apr 11 12:27:22 EST 2006)"
26 26
27 27
28/* 28/*
@@ -100,6 +100,9 @@
100#define MBOX_BUSY_WAIT 10 // max usec to wait for busy mailbox 100#define MBOX_BUSY_WAIT 10 // max usec to wait for busy mailbox
101#define MBOX_RESET_WAIT 180 // wait these many seconds in reset 101#define MBOX_RESET_WAIT 180 // wait these many seconds in reset
102#define MBOX_RESET_EXT_WAIT 120 // extended wait reset 102#define MBOX_RESET_EXT_WAIT 120 // extended wait reset
103#define MBOX_SYNC_WAIT_CNT 0xFFFF // wait loop index for synchronous mode
104
105#define MBOX_SYNC_DELAY_200 200 // 200 micro-seconds
103 106
104/* 107/*
105 * maximum transfer that can happen through the firmware commands issued 108 * maximum transfer that can happen through the firmware commands issued
diff --git a/drivers/scsi/megaraid/megaraid_mm.c b/drivers/scsi/megaraid/megaraid_mm.c
index 8f3ce0432295..e8f534fb336b 100644
--- a/drivers/scsi/megaraid/megaraid_mm.c
+++ b/drivers/scsi/megaraid/megaraid_mm.c
@@ -898,10 +898,8 @@ mraid_mm_register_adp(mraid_mmadp_t *lld_adp)
898 898
899 adapter = kmalloc(sizeof(mraid_mmadp_t), GFP_KERNEL); 899 adapter = kmalloc(sizeof(mraid_mmadp_t), GFP_KERNEL);
900 900
901 if (!adapter) { 901 if (!adapter)
902 rval = -ENOMEM; 902 return -ENOMEM;
903 goto memalloc_error;
904 }
905 903
906 memset(adapter, 0, sizeof(mraid_mmadp_t)); 904 memset(adapter, 0, sizeof(mraid_mmadp_t));
907 905
diff --git a/drivers/scsi/ppa.c b/drivers/scsi/ppa.c
index fee843fab1c7..108910f512e4 100644
--- a/drivers/scsi/ppa.c
+++ b/drivers/scsi/ppa.c
@@ -982,6 +982,12 @@ static int device_check(ppa_struct *dev)
982 return -ENODEV; 982 return -ENODEV;
983} 983}
984 984
985static int ppa_adjust_queue(struct scsi_device *device)
986{
987 blk_queue_bounce_limit(device->request_queue, BLK_BOUNCE_HIGH);
988 return 0;
989}
990
985static struct scsi_host_template ppa_template = { 991static struct scsi_host_template ppa_template = {
986 .module = THIS_MODULE, 992 .module = THIS_MODULE,
987 .proc_name = "ppa", 993 .proc_name = "ppa",
@@ -997,6 +1003,7 @@ static struct scsi_host_template ppa_template = {
997 .cmd_per_lun = 1, 1003 .cmd_per_lun = 1,
998 .use_clustering = ENABLE_CLUSTERING, 1004 .use_clustering = ENABLE_CLUSTERING,
999 .can_queue = 1, 1005 .can_queue = 1,
1006 .slave_alloc = ppa_adjust_queue,
1000}; 1007};
1001 1008
1002/*************************************************************************** 1009/***************************************************************************
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 1052528c3109..ccaad0b08d35 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -589,6 +589,7 @@ qla2x00_wait_for_loop_ready(scsi_qla_host_t *ha)
589* Either SUCCESS or FAILED. 589* Either SUCCESS or FAILED.
590* 590*
591* Note: 591* Note:
592* Only return FAILED if command not returned by firmware.
592**************************************************************************/ 593**************************************************************************/
593int 594int
594qla2xxx_eh_abort(struct scsi_cmnd *cmd) 595qla2xxx_eh_abort(struct scsi_cmnd *cmd)
@@ -599,11 +600,12 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
599 unsigned int id, lun; 600 unsigned int id, lun;
600 unsigned long serial; 601 unsigned long serial;
601 unsigned long flags; 602 unsigned long flags;
603 int wait = 0;
602 604
603 if (!CMD_SP(cmd)) 605 if (!CMD_SP(cmd))
604 return FAILED; 606 return SUCCESS;
605 607
606 ret = FAILED; 608 ret = SUCCESS;
607 609
608 id = cmd->device->id; 610 id = cmd->device->id;
609 lun = cmd->device->lun; 611 lun = cmd->device->lun;
@@ -631,7 +633,7 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
631 } else { 633 } else {
632 DEBUG3(printk("%s(%ld): abort_command " 634 DEBUG3(printk("%s(%ld): abort_command "
633 "mbx success.\n", __func__, ha->host_no)); 635 "mbx success.\n", __func__, ha->host_no));
634 ret = SUCCESS; 636 wait = 1;
635 } 637 }
636 spin_lock_irqsave(&ha->hardware_lock, flags); 638 spin_lock_irqsave(&ha->hardware_lock, flags);
637 639
@@ -640,17 +642,18 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
640 spin_unlock_irqrestore(&ha->hardware_lock, flags); 642 spin_unlock_irqrestore(&ha->hardware_lock, flags);
641 643
642 /* Wait for the command to be returned. */ 644 /* Wait for the command to be returned. */
643 if (ret == SUCCESS) { 645 if (wait) {
644 if (qla2x00_eh_wait_on_command(ha, cmd) != QLA_SUCCESS) { 646 if (qla2x00_eh_wait_on_command(ha, cmd) != QLA_SUCCESS) {
645 qla_printk(KERN_ERR, ha, 647 qla_printk(KERN_ERR, ha,
646 "scsi(%ld:%d:%d): Abort handler timed out -- %lx " 648 "scsi(%ld:%d:%d): Abort handler timed out -- %lx "
647 "%x.\n", ha->host_no, id, lun, serial, ret); 649 "%x.\n", ha->host_no, id, lun, serial, ret);
650 ret = FAILED;
648 } 651 }
649 } 652 }
650 653
651 qla_printk(KERN_INFO, ha, 654 qla_printk(KERN_INFO, ha,
652 "scsi(%ld:%d:%d): Abort command issued -- %lx %x.\n", ha->host_no, 655 "scsi(%ld:%d:%d): Abort command issued -- %d %lx %x.\n",
653 id, lun, serial, ret); 656 ha->host_no, id, lun, wait, serial, ret);
654 657
655 return ret; 658 return ret;
656} 659}
@@ -1687,8 +1690,8 @@ qla2x00_free_device(scsi_qla_host_t *ha)
1687 ha->flags.online = 0; 1690 ha->flags.online = 0;
1688 1691
1689 /* Detach interrupts */ 1692 /* Detach interrupts */
1690 if (ha->pdev->irq) 1693 if (ha->host->irq)
1691 free_irq(ha->pdev->irq, ha); 1694 free_irq(ha->host->irq, ha);
1692 1695
1693 /* release io space registers */ 1696 /* release io space registers */
1694 if (ha->iobase) 1697 if (ha->iobase)
diff --git a/drivers/scsi/sata_mv.c b/drivers/scsi/sata_mv.c
index d5fdcb9a8842..9b8bca1ac1f0 100644
--- a/drivers/scsi/sata_mv.c
+++ b/drivers/scsi/sata_mv.c
@@ -37,7 +37,7 @@
37#include <asm/io.h> 37#include <asm/io.h>
38 38
39#define DRV_NAME "sata_mv" 39#define DRV_NAME "sata_mv"
40#define DRV_VERSION "0.6" 40#define DRV_VERSION "0.7"
41 41
42enum { 42enum {
43 /* BAR's are enumerated in terms of pci_resource_start() terms */ 43 /* BAR's are enumerated in terms of pci_resource_start() terms */
@@ -50,6 +50,12 @@ enum {
50 50
51 MV_PCI_REG_BASE = 0, 51 MV_PCI_REG_BASE = 0,
52 MV_IRQ_COAL_REG_BASE = 0x18000, /* 6xxx part only */ 52 MV_IRQ_COAL_REG_BASE = 0x18000, /* 6xxx part only */
53 MV_IRQ_COAL_CAUSE = (MV_IRQ_COAL_REG_BASE + 0x08),
54 MV_IRQ_COAL_CAUSE_LO = (MV_IRQ_COAL_REG_BASE + 0x88),
55 MV_IRQ_COAL_CAUSE_HI = (MV_IRQ_COAL_REG_BASE + 0x8c),
56 MV_IRQ_COAL_THRESHOLD = (MV_IRQ_COAL_REG_BASE + 0xcc),
57 MV_IRQ_COAL_TIME_THRESHOLD = (MV_IRQ_COAL_REG_BASE + 0xd0),
58
53 MV_SATAHC0_REG_BASE = 0x20000, 59 MV_SATAHC0_REG_BASE = 0x20000,
54 MV_FLASH_CTL = 0x1046c, 60 MV_FLASH_CTL = 0x1046c,
55 MV_GPIO_PORT_CTL = 0x104f0, 61 MV_GPIO_PORT_CTL = 0x104f0,
@@ -302,9 +308,6 @@ struct mv_port_priv {
302 dma_addr_t crpb_dma; 308 dma_addr_t crpb_dma;
303 struct mv_sg *sg_tbl; 309 struct mv_sg *sg_tbl;
304 dma_addr_t sg_tbl_dma; 310 dma_addr_t sg_tbl_dma;
305
306 unsigned req_producer; /* cp of req_in_ptr */
307 unsigned rsp_consumer; /* cp of rsp_out_ptr */
308 u32 pp_flags; 311 u32 pp_flags;
309}; 312};
310 313
@@ -937,8 +940,6 @@ static int mv_port_start(struct ata_port *ap)
937 writelfl(pp->crpb_dma & EDMA_RSP_Q_BASE_LO_MASK, 940 writelfl(pp->crpb_dma & EDMA_RSP_Q_BASE_LO_MASK,
938 port_mmio + EDMA_RSP_Q_OUT_PTR_OFS); 941 port_mmio + EDMA_RSP_Q_OUT_PTR_OFS);
939 942
940 pp->req_producer = pp->rsp_consumer = 0;
941
942 /* Don't turn on EDMA here...do it before DMA commands only. Else 943 /* Don't turn on EDMA here...do it before DMA commands only. Else
943 * we'll be unable to send non-data, PIO, etc due to restricted access 944 * we'll be unable to send non-data, PIO, etc due to restricted access
944 * to shadow regs. 945 * to shadow regs.
@@ -1022,16 +1023,16 @@ static void mv_fill_sg(struct ata_queued_cmd *qc)
1022 } 1023 }
1023} 1024}
1024 1025
1025static inline unsigned mv_inc_q_index(unsigned *index) 1026static inline unsigned mv_inc_q_index(unsigned index)
1026{ 1027{
1027 *index = (*index + 1) & MV_MAX_Q_DEPTH_MASK; 1028 return (index + 1) & MV_MAX_Q_DEPTH_MASK;
1028 return *index;
1029} 1029}
1030 1030
1031static inline void mv_crqb_pack_cmd(u16 *cmdw, u8 data, u8 addr, unsigned last) 1031static inline void mv_crqb_pack_cmd(u16 *cmdw, u8 data, u8 addr, unsigned last)
1032{ 1032{
1033 *cmdw = data | (addr << CRQB_CMD_ADDR_SHIFT) | CRQB_CMD_CS | 1033 u16 tmp = data | (addr << CRQB_CMD_ADDR_SHIFT) | CRQB_CMD_CS |
1034 (last ? CRQB_CMD_LAST : 0); 1034 (last ? CRQB_CMD_LAST : 0);
1035 *cmdw = cpu_to_le16(tmp);
1035} 1036}
1036 1037
1037/** 1038/**
@@ -1053,15 +1054,11 @@ static void mv_qc_prep(struct ata_queued_cmd *qc)
1053 u16 *cw; 1054 u16 *cw;
1054 struct ata_taskfile *tf; 1055 struct ata_taskfile *tf;
1055 u16 flags = 0; 1056 u16 flags = 0;
1057 unsigned in_index;
1056 1058
1057 if (ATA_PROT_DMA != qc->tf.protocol) 1059 if (ATA_PROT_DMA != qc->tf.protocol)
1058 return; 1060 return;
1059 1061
1060 /* the req producer index should be the same as we remember it */
1061 WARN_ON(((readl(mv_ap_base(qc->ap) + EDMA_REQ_Q_IN_PTR_OFS) >>
1062 EDMA_REQ_Q_PTR_SHIFT) & MV_MAX_Q_DEPTH_MASK) !=
1063 pp->req_producer);
1064
1065 /* Fill in command request block 1062 /* Fill in command request block
1066 */ 1063 */
1067 if (!(qc->tf.flags & ATA_TFLAG_WRITE)) 1064 if (!(qc->tf.flags & ATA_TFLAG_WRITE))
@@ -1069,13 +1066,17 @@ static void mv_qc_prep(struct ata_queued_cmd *qc)
1069 WARN_ON(MV_MAX_Q_DEPTH <= qc->tag); 1066 WARN_ON(MV_MAX_Q_DEPTH <= qc->tag);
1070 flags |= qc->tag << CRQB_TAG_SHIFT; 1067 flags |= qc->tag << CRQB_TAG_SHIFT;
1071 1068
1072 pp->crqb[pp->req_producer].sg_addr = 1069 /* get current queue index from hardware */
1070 in_index = (readl(mv_ap_base(ap) + EDMA_REQ_Q_IN_PTR_OFS)
1071 >> EDMA_REQ_Q_PTR_SHIFT) & MV_MAX_Q_DEPTH_MASK;
1072
1073 pp->crqb[in_index].sg_addr =
1073 cpu_to_le32(pp->sg_tbl_dma & 0xffffffff); 1074 cpu_to_le32(pp->sg_tbl_dma & 0xffffffff);
1074 pp->crqb[pp->req_producer].sg_addr_hi = 1075 pp->crqb[in_index].sg_addr_hi =
1075 cpu_to_le32((pp->sg_tbl_dma >> 16) >> 16); 1076 cpu_to_le32((pp->sg_tbl_dma >> 16) >> 16);
1076 pp->crqb[pp->req_producer].ctrl_flags = cpu_to_le16(flags); 1077 pp->crqb[in_index].ctrl_flags = cpu_to_le16(flags);
1077 1078
1078 cw = &pp->crqb[pp->req_producer].ata_cmd[0]; 1079 cw = &pp->crqb[in_index].ata_cmd[0];
1079 tf = &qc->tf; 1080 tf = &qc->tf;
1080 1081
1081 /* Sadly, the CRQB cannot accomodate all registers--there are 1082 /* Sadly, the CRQB cannot accomodate all registers--there are
@@ -1144,16 +1145,12 @@ static void mv_qc_prep_iie(struct ata_queued_cmd *qc)
1144 struct mv_port_priv *pp = ap->private_data; 1145 struct mv_port_priv *pp = ap->private_data;
1145 struct mv_crqb_iie *crqb; 1146 struct mv_crqb_iie *crqb;
1146 struct ata_taskfile *tf; 1147 struct ata_taskfile *tf;
1148 unsigned in_index;
1147 u32 flags = 0; 1149 u32 flags = 0;
1148 1150
1149 if (ATA_PROT_DMA != qc->tf.protocol) 1151 if (ATA_PROT_DMA != qc->tf.protocol)
1150 return; 1152 return;
1151 1153
1152 /* the req producer index should be the same as we remember it */
1153 WARN_ON(((readl(mv_ap_base(qc->ap) + EDMA_REQ_Q_IN_PTR_OFS) >>
1154 EDMA_REQ_Q_PTR_SHIFT) & MV_MAX_Q_DEPTH_MASK) !=
1155 pp->req_producer);
1156
1157 /* Fill in Gen IIE command request block 1154 /* Fill in Gen IIE command request block
1158 */ 1155 */
1159 if (!(qc->tf.flags & ATA_TFLAG_WRITE)) 1156 if (!(qc->tf.flags & ATA_TFLAG_WRITE))
@@ -1162,7 +1159,11 @@ static void mv_qc_prep_iie(struct ata_queued_cmd *qc)
1162 WARN_ON(MV_MAX_Q_DEPTH <= qc->tag); 1159 WARN_ON(MV_MAX_Q_DEPTH <= qc->tag);
1163 flags |= qc->tag << CRQB_TAG_SHIFT; 1160 flags |= qc->tag << CRQB_TAG_SHIFT;
1164 1161
1165 crqb = (struct mv_crqb_iie *) &pp->crqb[pp->req_producer]; 1162 /* get current queue index from hardware */
1163 in_index = (readl(mv_ap_base(ap) + EDMA_REQ_Q_IN_PTR_OFS)
1164 >> EDMA_REQ_Q_PTR_SHIFT) & MV_MAX_Q_DEPTH_MASK;
1165
1166 crqb = (struct mv_crqb_iie *) &pp->crqb[in_index];
1166 crqb->addr = cpu_to_le32(pp->sg_tbl_dma & 0xffffffff); 1167 crqb->addr = cpu_to_le32(pp->sg_tbl_dma & 0xffffffff);
1167 crqb->addr_hi = cpu_to_le32((pp->sg_tbl_dma >> 16) >> 16); 1168 crqb->addr_hi = cpu_to_le32((pp->sg_tbl_dma >> 16) >> 16);
1168 crqb->flags = cpu_to_le32(flags); 1169 crqb->flags = cpu_to_le32(flags);
@@ -1210,6 +1211,7 @@ static unsigned int mv_qc_issue(struct ata_queued_cmd *qc)
1210{ 1211{
1211 void __iomem *port_mmio = mv_ap_base(qc->ap); 1212 void __iomem *port_mmio = mv_ap_base(qc->ap);
1212 struct mv_port_priv *pp = qc->ap->private_data; 1213 struct mv_port_priv *pp = qc->ap->private_data;
1214 unsigned in_index;
1213 u32 in_ptr; 1215 u32 in_ptr;
1214 1216
1215 if (ATA_PROT_DMA != qc->tf.protocol) { 1217 if (ATA_PROT_DMA != qc->tf.protocol) {
@@ -1221,23 +1223,20 @@ static unsigned int mv_qc_issue(struct ata_queued_cmd *qc)
1221 return ata_qc_issue_prot(qc); 1223 return ata_qc_issue_prot(qc);
1222 } 1224 }
1223 1225
1224 in_ptr = readl(port_mmio + EDMA_REQ_Q_IN_PTR_OFS); 1226 in_ptr = readl(port_mmio + EDMA_REQ_Q_IN_PTR_OFS);
1227 in_index = (in_ptr >> EDMA_REQ_Q_PTR_SHIFT) & MV_MAX_Q_DEPTH_MASK;
1225 1228
1226 /* the req producer index should be the same as we remember it */
1227 WARN_ON(((in_ptr >> EDMA_REQ_Q_PTR_SHIFT) & MV_MAX_Q_DEPTH_MASK) !=
1228 pp->req_producer);
1229 /* until we do queuing, the queue should be empty at this point */ 1229 /* until we do queuing, the queue should be empty at this point */
1230 WARN_ON(((in_ptr >> EDMA_REQ_Q_PTR_SHIFT) & MV_MAX_Q_DEPTH_MASK) != 1230 WARN_ON(in_index != ((readl(port_mmio + EDMA_REQ_Q_OUT_PTR_OFS)
1231 ((readl(port_mmio + EDMA_REQ_Q_OUT_PTR_OFS) >> 1231 >> EDMA_REQ_Q_PTR_SHIFT) & MV_MAX_Q_DEPTH_MASK));
1232 EDMA_REQ_Q_PTR_SHIFT) & MV_MAX_Q_DEPTH_MASK));
1233 1232
1234 mv_inc_q_index(&pp->req_producer); /* now incr producer index */ 1233 in_index = mv_inc_q_index(in_index); /* now incr producer index */
1235 1234
1236 mv_start_dma(port_mmio, pp); 1235 mv_start_dma(port_mmio, pp);
1237 1236
1238 /* and write the request in pointer to kick the EDMA to life */ 1237 /* and write the request in pointer to kick the EDMA to life */
1239 in_ptr &= EDMA_REQ_Q_BASE_LO_MASK; 1238 in_ptr &= EDMA_REQ_Q_BASE_LO_MASK;
1240 in_ptr |= pp->req_producer << EDMA_REQ_Q_PTR_SHIFT; 1239 in_ptr |= in_index << EDMA_REQ_Q_PTR_SHIFT;
1241 writelfl(in_ptr, port_mmio + EDMA_REQ_Q_IN_PTR_OFS); 1240 writelfl(in_ptr, port_mmio + EDMA_REQ_Q_IN_PTR_OFS);
1242 1241
1243 return 0; 1242 return 0;
@@ -1260,28 +1259,26 @@ static u8 mv_get_crpb_status(struct ata_port *ap)
1260{ 1259{
1261 void __iomem *port_mmio = mv_ap_base(ap); 1260 void __iomem *port_mmio = mv_ap_base(ap);
1262 struct mv_port_priv *pp = ap->private_data; 1261 struct mv_port_priv *pp = ap->private_data;
1262 unsigned out_index;
1263 u32 out_ptr; 1263 u32 out_ptr;
1264 u8 ata_status; 1264 u8 ata_status;
1265 1265
1266 out_ptr = readl(port_mmio + EDMA_RSP_Q_OUT_PTR_OFS); 1266 out_ptr = readl(port_mmio + EDMA_RSP_Q_OUT_PTR_OFS);
1267 out_index = (out_ptr >> EDMA_RSP_Q_PTR_SHIFT) & MV_MAX_Q_DEPTH_MASK;
1267 1268
1268 /* the response consumer index should be the same as we remember it */ 1269 ata_status = le16_to_cpu(pp->crpb[out_index].flags)
1269 WARN_ON(((out_ptr >> EDMA_RSP_Q_PTR_SHIFT) & MV_MAX_Q_DEPTH_MASK) != 1270 >> CRPB_FLAG_STATUS_SHIFT;
1270 pp->rsp_consumer);
1271
1272 ata_status = pp->crpb[pp->rsp_consumer].flags >> CRPB_FLAG_STATUS_SHIFT;
1273 1271
1274 /* increment our consumer index... */ 1272 /* increment our consumer index... */
1275 pp->rsp_consumer = mv_inc_q_index(&pp->rsp_consumer); 1273 out_index = mv_inc_q_index(out_index);
1276 1274
1277 /* and, until we do NCQ, there should only be 1 CRPB waiting */ 1275 /* and, until we do NCQ, there should only be 1 CRPB waiting */
1278 WARN_ON(((readl(port_mmio + EDMA_RSP_Q_IN_PTR_OFS) >> 1276 WARN_ON(out_index != ((readl(port_mmio + EDMA_RSP_Q_IN_PTR_OFS)
1279 EDMA_RSP_Q_PTR_SHIFT) & MV_MAX_Q_DEPTH_MASK) != 1277 >> EDMA_RSP_Q_PTR_SHIFT) & MV_MAX_Q_DEPTH_MASK));
1280 pp->rsp_consumer);
1281 1278
1282 /* write out our inc'd consumer index so EDMA knows we're caught up */ 1279 /* write out our inc'd consumer index so EDMA knows we're caught up */
1283 out_ptr &= EDMA_RSP_Q_BASE_LO_MASK; 1280 out_ptr &= EDMA_RSP_Q_BASE_LO_MASK;
1284 out_ptr |= pp->rsp_consumer << EDMA_RSP_Q_PTR_SHIFT; 1281 out_ptr |= out_index << EDMA_RSP_Q_PTR_SHIFT;
1285 writelfl(out_ptr, port_mmio + EDMA_RSP_Q_OUT_PTR_OFS); 1282 writelfl(out_ptr, port_mmio + EDMA_RSP_Q_OUT_PTR_OFS);
1286 1283
1287 /* Return ATA status register for completed CRPB */ 1284 /* Return ATA status register for completed CRPB */
@@ -1291,6 +1288,7 @@ static u8 mv_get_crpb_status(struct ata_port *ap)
1291/** 1288/**
1292 * mv_err_intr - Handle error interrupts on the port 1289 * mv_err_intr - Handle error interrupts on the port
1293 * @ap: ATA channel to manipulate 1290 * @ap: ATA channel to manipulate
1291 * @reset_allowed: bool: 0 == don't trigger from reset here
1294 * 1292 *
1295 * In most cases, just clear the interrupt and move on. However, 1293 * In most cases, just clear the interrupt and move on. However,
1296 * some cases require an eDMA reset, which is done right before 1294 * some cases require an eDMA reset, which is done right before
@@ -1301,7 +1299,7 @@ static u8 mv_get_crpb_status(struct ata_port *ap)
1301 * LOCKING: 1299 * LOCKING:
1302 * Inherited from caller. 1300 * Inherited from caller.
1303 */ 1301 */
1304static void mv_err_intr(struct ata_port *ap) 1302static void mv_err_intr(struct ata_port *ap, int reset_allowed)
1305{ 1303{
1306 void __iomem *port_mmio = mv_ap_base(ap); 1304 void __iomem *port_mmio = mv_ap_base(ap);
1307 u32 edma_err_cause, serr = 0; 1305 u32 edma_err_cause, serr = 0;
@@ -1323,9 +1321,8 @@ static void mv_err_intr(struct ata_port *ap)
1323 writelfl(0, port_mmio + EDMA_ERR_IRQ_CAUSE_OFS); 1321 writelfl(0, port_mmio + EDMA_ERR_IRQ_CAUSE_OFS);
1324 1322
1325 /* check for fatal here and recover if needed */ 1323 /* check for fatal here and recover if needed */
1326 if (EDMA_ERR_FATAL & edma_err_cause) { 1324 if (reset_allowed && (EDMA_ERR_FATAL & edma_err_cause))
1327 mv_stop_and_reset(ap); 1325 mv_stop_and_reset(ap);
1328 }
1329} 1326}
1330 1327
1331/** 1328/**
@@ -1374,12 +1371,12 @@ static void mv_host_intr(struct ata_host_set *host_set, u32 relevant,
1374 struct ata_port *ap = host_set->ports[port]; 1371 struct ata_port *ap = host_set->ports[port];
1375 struct mv_port_priv *pp = ap->private_data; 1372 struct mv_port_priv *pp = ap->private_data;
1376 1373
1377 hard_port = port & MV_PORT_MASK; /* range 0-3 */ 1374 hard_port = mv_hardport_from_port(port); /* range 0..3 */
1378 handled = 0; /* ensure ata_status is set if handled++ */ 1375 handled = 0; /* ensure ata_status is set if handled++ */
1379 1376
1380 /* Note that DEV_IRQ might happen spuriously during EDMA, 1377 /* Note that DEV_IRQ might happen spuriously during EDMA,
1381 * and should be ignored in such cases. We could mask it, 1378 * and should be ignored in such cases.
1382 * but it's pretty rare and may not be worth the overhead. 1379 * The cause of this is still under investigation.
1383 */ 1380 */
1384 if (pp->pp_flags & MV_PP_FLAG_EDMA_EN) { 1381 if (pp->pp_flags & MV_PP_FLAG_EDMA_EN) {
1385 /* EDMA: check for response queue interrupt */ 1382 /* EDMA: check for response queue interrupt */
@@ -1393,6 +1390,11 @@ static void mv_host_intr(struct ata_host_set *host_set, u32 relevant,
1393 ata_status = readb((void __iomem *) 1390 ata_status = readb((void __iomem *)
1394 ap->ioaddr.status_addr); 1391 ap->ioaddr.status_addr);
1395 handled = 1; 1392 handled = 1;
1393 /* ignore spurious intr if drive still BUSY */
1394 if (ata_status & ATA_BUSY) {
1395 ata_status = 0;
1396 handled = 0;
1397 }
1396 } 1398 }
1397 } 1399 }
1398 1400
@@ -1406,7 +1408,7 @@ static void mv_host_intr(struct ata_host_set *host_set, u32 relevant,
1406 shift++; /* skip bit 8 in the HC Main IRQ reg */ 1408 shift++; /* skip bit 8 in the HC Main IRQ reg */
1407 } 1409 }
1408 if ((PORT0_ERR << shift) & relevant) { 1410 if ((PORT0_ERR << shift) & relevant) {
1409 mv_err_intr(ap); 1411 mv_err_intr(ap, 1);
1410 err_mask |= AC_ERR_OTHER; 1412 err_mask |= AC_ERR_OTHER;
1411 handled = 1; 1413 handled = 1;
1412 } 1414 }
@@ -1448,6 +1450,7 @@ static irqreturn_t mv_interrupt(int irq, void *dev_instance,
1448 struct ata_host_set *host_set = dev_instance; 1450 struct ata_host_set *host_set = dev_instance;
1449 unsigned int hc, handled = 0, n_hcs; 1451 unsigned int hc, handled = 0, n_hcs;
1450 void __iomem *mmio = host_set->mmio_base; 1452 void __iomem *mmio = host_set->mmio_base;
1453 struct mv_host_priv *hpriv;
1451 u32 irq_stat; 1454 u32 irq_stat;
1452 1455
1453 irq_stat = readl(mmio + HC_MAIN_IRQ_CAUSE_OFS); 1456 irq_stat = readl(mmio + HC_MAIN_IRQ_CAUSE_OFS);
@@ -1469,6 +1472,17 @@ static irqreturn_t mv_interrupt(int irq, void *dev_instance,
1469 handled++; 1472 handled++;
1470 } 1473 }
1471 } 1474 }
1475
1476 hpriv = host_set->private_data;
1477 if (IS_60XX(hpriv)) {
1478 /* deal with the interrupt coalescing bits */
1479 if (irq_stat & (TRAN_LO_DONE | TRAN_HI_DONE | PORTS_0_7_COAL_DONE)) {
1480 writelfl(0, mmio + MV_IRQ_COAL_CAUSE_LO);
1481 writelfl(0, mmio + MV_IRQ_COAL_CAUSE_HI);
1482 writelfl(0, mmio + MV_IRQ_COAL_CAUSE);
1483 }
1484 }
1485
1472 if (PCI_ERR & irq_stat) { 1486 if (PCI_ERR & irq_stat) {
1473 printk(KERN_ERR DRV_NAME ": PCI ERROR; PCI IRQ cause=0x%08x\n", 1487 printk(KERN_ERR DRV_NAME ": PCI ERROR; PCI IRQ cause=0x%08x\n",
1474 readl(mmio + PCI_IRQ_CAUSE_OFS)); 1488 readl(mmio + PCI_IRQ_CAUSE_OFS));
@@ -1867,7 +1881,8 @@ static void mv_channel_reset(struct mv_host_priv *hpriv, void __iomem *mmio,
1867 1881
1868 if (IS_60XX(hpriv)) { 1882 if (IS_60XX(hpriv)) {
1869 u32 ifctl = readl(port_mmio + SATA_INTERFACE_CTL); 1883 u32 ifctl = readl(port_mmio + SATA_INTERFACE_CTL);
1870 ifctl |= (1 << 12) | (1 << 7); 1884 ifctl |= (1 << 7); /* enable gen2i speed */
1885 ifctl = (ifctl & 0xfff) | 0x9b1000; /* from chip spec */
1871 writelfl(ifctl, port_mmio + SATA_INTERFACE_CTL); 1886 writelfl(ifctl, port_mmio + SATA_INTERFACE_CTL);
1872 } 1887 }
1873 1888
@@ -2031,11 +2046,14 @@ static void mv_eng_timeout(struct ata_port *ap)
2031 ap->host_set->mmio_base, ap, qc, qc->scsicmd, 2046 ap->host_set->mmio_base, ap, qc, qc->scsicmd,
2032 &qc->scsicmd->cmnd); 2047 &qc->scsicmd->cmnd);
2033 2048
2034 mv_err_intr(ap); 2049 mv_err_intr(ap, 0);
2035 mv_stop_and_reset(ap); 2050 mv_stop_and_reset(ap);
2036 2051
2037 qc->err_mask |= AC_ERR_TIMEOUT; 2052 WARN_ON(!(qc->flags & ATA_QCFLAG_ACTIVE));
2038 ata_eh_qc_complete(qc); 2053 if (qc->flags & ATA_QCFLAG_ACTIVE) {
2054 qc->err_mask |= AC_ERR_TIMEOUT;
2055 ata_eh_qc_complete(qc);
2056 }
2039} 2057}
2040 2058
2041/** 2059/**
@@ -2229,7 +2247,8 @@ static int mv_init_host(struct pci_dev *pdev, struct ata_probe_ent *probe_ent,
2229 void __iomem *port_mmio = mv_port_base(mmio, port); 2247 void __iomem *port_mmio = mv_port_base(mmio, port);
2230 2248
2231 u32 ifctl = readl(port_mmio + SATA_INTERFACE_CTL); 2249 u32 ifctl = readl(port_mmio + SATA_INTERFACE_CTL);
2232 ifctl |= (1 << 12); 2250 ifctl |= (1 << 7); /* enable gen2i speed */
2251 ifctl = (ifctl & 0xfff) | 0x9b1000; /* from chip spec */
2233 writelfl(ifctl, port_mmio + SATA_INTERFACE_CTL); 2252 writelfl(ifctl, port_mmio + SATA_INTERFACE_CTL);
2234 } 2253 }
2235 2254
@@ -2330,6 +2349,7 @@ static int mv_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
2330 if (rc) { 2349 if (rc) {
2331 return rc; 2350 return rc;
2332 } 2351 }
2352 pci_set_master(pdev);
2333 2353
2334 rc = pci_request_regions(pdev, DRV_NAME); 2354 rc = pci_request_regions(pdev, DRV_NAME);
2335 if (rc) { 2355 if (rc) {
diff --git a/drivers/scsi/sata_sil24.c b/drivers/scsi/sata_sil24.c
index f7264fd611c2..cb9082fd7e2f 100644
--- a/drivers/scsi/sata_sil24.c
+++ b/drivers/scsi/sata_sil24.c
@@ -454,7 +454,7 @@ static int sil24_softreset(struct ata_port *ap, int verbose,
454 */ 454 */
455 msleep(10); 455 msleep(10);
456 456
457 prb->ctrl = PRB_CTRL_SRST; 457 prb->ctrl = cpu_to_le16(PRB_CTRL_SRST);
458 prb->fis[1] = 0; /* no PM yet */ 458 prb->fis[1] = 0; /* no PM yet */
459 459
460 writel((u32)paddr, port + PORT_CMD_ACTIVATE); 460 writel((u32)paddr, port + PORT_CMD_ACTIVATE);
@@ -551,9 +551,9 @@ static void sil24_qc_prep(struct ata_queued_cmd *qc)
551 551
552 if (qc->tf.protocol != ATA_PROT_ATAPI_NODATA) { 552 if (qc->tf.protocol != ATA_PROT_ATAPI_NODATA) {
553 if (qc->tf.flags & ATA_TFLAG_WRITE) 553 if (qc->tf.flags & ATA_TFLAG_WRITE)
554 prb->ctrl = PRB_CTRL_PACKET_WRITE; 554 prb->ctrl = cpu_to_le16(PRB_CTRL_PACKET_WRITE);
555 else 555 else
556 prb->ctrl = PRB_CTRL_PACKET_READ; 556 prb->ctrl = cpu_to_le16(PRB_CTRL_PACKET_READ);
557 } else 557 } else
558 prb->ctrl = 0; 558 prb->ctrl = 0;
559 559
diff --git a/drivers/scsi/scsi_devinfo.c b/drivers/scsi/scsi_devinfo.c
index ae13e4a78d51..fb5cb4c9ac65 100644
--- a/drivers/scsi/scsi_devinfo.c
+++ b/drivers/scsi/scsi_devinfo.c
@@ -56,6 +56,8 @@ static struct {
56 {"DENON", "DRD-25X", "V", BLIST_NOLUN}, /* locks up */ 56 {"DENON", "DRD-25X", "V", BLIST_NOLUN}, /* locks up */
57 {"HITACHI", "DK312C", "CM81", BLIST_NOLUN}, /* responds to all lun */ 57 {"HITACHI", "DK312C", "CM81", BLIST_NOLUN}, /* responds to all lun */
58 {"HITACHI", "DK314C", "CR21", BLIST_NOLUN}, /* responds to all lun */ 58 {"HITACHI", "DK314C", "CR21", BLIST_NOLUN}, /* responds to all lun */
59 {"IBM", "2104-DU3", NULL, BLIST_NOLUN}, /* locks up */
60 {"IBM", "2104-TU3", NULL, BLIST_NOLUN}, /* locks up */
59 {"IMS", "CDD521/10", "2.06", BLIST_NOLUN}, /* locks up */ 61 {"IMS", "CDD521/10", "2.06", BLIST_NOLUN}, /* locks up */
60 {"MAXTOR", "XT-3280", "PR02", BLIST_NOLUN}, /* locks up */ 62 {"MAXTOR", "XT-3280", "PR02", BLIST_NOLUN}, /* locks up */
61 {"MAXTOR", "XT-4380S", "B3C", BLIST_NOLUN}, /* locks up */ 63 {"MAXTOR", "XT-4380S", "B3C", BLIST_NOLUN}, /* locks up */
@@ -165,6 +167,7 @@ static struct {
165 {"HP", "HSV100", NULL, BLIST_REPORTLUN2 | BLIST_NOSTARTONADD}, 167 {"HP", "HSV100", NULL, BLIST_REPORTLUN2 | BLIST_NOSTARTONADD},
166 {"HP", "C1557A", NULL, BLIST_FORCELUN}, 168 {"HP", "C1557A", NULL, BLIST_FORCELUN},
167 {"HP", "C3323-300", "4269", BLIST_NOTQ}, 169 {"HP", "C3323-300", "4269", BLIST_NOTQ},
170 {"HP", "C5713A", NULL, BLIST_NOREPORTLUN},
168 {"IBM", "AuSaV1S2", NULL, BLIST_FORCELUN}, 171 {"IBM", "AuSaV1S2", NULL, BLIST_FORCELUN},
169 {"IBM", "ProFibre 4000R", "*", BLIST_SPARSELUN | BLIST_LARGELUN}, 172 {"IBM", "ProFibre 4000R", "*", BLIST_SPARSELUN | BLIST_LARGELUN},
170 {"IBM", "2105", NULL, BLIST_RETRY_HWERROR}, 173 {"IBM", "2105", NULL, BLIST_RETRY_HWERROR},
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 3ca7b9d3086c..bdce9d1f5b71 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -367,7 +367,7 @@ static int scsi_req_map_sg(struct request *rq, struct scatterlist *sgl,
367 int nsegs, unsigned bufflen, gfp_t gfp) 367 int nsegs, unsigned bufflen, gfp_t gfp)
368{ 368{
369 struct request_queue *q = rq->q; 369 struct request_queue *q = rq->q;
370 int nr_pages = (bufflen + PAGE_SIZE - 1) >> PAGE_SHIFT; 370 int nr_pages = (bufflen + sgl[0].offset + PAGE_SIZE - 1) >> PAGE_SHIFT;
371 unsigned int data_len = 0, len, bytes, off; 371 unsigned int data_len = 0, len, bytes, off;
372 struct page *page; 372 struct page *page;
373 struct bio *bio = NULL; 373 struct bio *bio = NULL;
@@ -1067,16 +1067,29 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes,
1067 break; 1067 break;
1068 case NOT_READY: 1068 case NOT_READY:
1069 /* 1069 /*
1070 * If the device is in the process of becoming ready, 1070 * If the device is in the process of becoming
1071 * retry. 1071 * ready, or has a temporary blockage, retry.
1072 */ 1072 */
1073 if (sshdr.asc == 0x04 && sshdr.ascq == 0x01) { 1073 if (sshdr.asc == 0x04) {
1074 scsi_requeue_command(q, cmd); 1074 switch (sshdr.ascq) {
1075 return; 1075 case 0x01: /* becoming ready */
1076 case 0x04: /* format in progress */
1077 case 0x05: /* rebuild in progress */
1078 case 0x06: /* recalculation in progress */
1079 case 0x07: /* operation in progress */
1080 case 0x08: /* Long write in progress */
1081 case 0x09: /* self test in progress */
1082 scsi_requeue_command(q, cmd);
1083 return;
1084 default:
1085 break;
1086 }
1076 } 1087 }
1077 if (!(req->flags & REQ_QUIET)) 1088 if (!(req->flags & REQ_QUIET)) {
1078 scmd_printk(KERN_INFO, cmd, 1089 scmd_printk(KERN_INFO, cmd,
1079 "Device not ready.\n"); 1090 "Device not ready: ");
1091 scsi_print_sense_hdr("", &sshdr);
1092 }
1080 scsi_end_request(cmd, 0, this_count, 1); 1093 scsi_end_request(cmd, 0, this_count, 1);
1081 return; 1094 return;
1082 case VOLUME_OVERFLOW: 1095 case VOLUME_OVERFLOW:
diff --git a/drivers/scsi/scsi_transport_sas.c b/drivers/scsi/scsi_transport_sas.c
index ce4f806bd8ec..6da6721eb0db 100644
--- a/drivers/scsi/scsi_transport_sas.c
+++ b/drivers/scsi/scsi_transport_sas.c
@@ -955,7 +955,8 @@ static int sas_user_scan(struct Scsi_Host *shost, uint channel,
955 list_for_each_entry(rphy, &sas_host->rphy_list, list) { 955 list_for_each_entry(rphy, &sas_host->rphy_list, list) {
956 struct sas_phy *parent = dev_to_phy(rphy->dev.parent); 956 struct sas_phy *parent = dev_to_phy(rphy->dev.parent);
957 957
958 if (rphy->scsi_target_id == -1) 958 if (rphy->identify.device_type != SAS_END_DEVICE ||
959 rphy->scsi_target_id == -1)
959 continue; 960 continue;
960 961
961 if ((channel == SCAN_WILD_CARD || channel == parent->port_identifier) && 962 if ((channel == SCAN_WILD_CARD || channel == parent->port_identifier) &&
@@ -977,7 +978,6 @@ static int sas_user_scan(struct Scsi_Host *shost, uint channel,
977#define SETUP_TEMPLATE(attrb, field, perm, test) \ 978#define SETUP_TEMPLATE(attrb, field, perm, test) \
978 i->private_##attrb[count] = class_device_attr_##field; \ 979 i->private_##attrb[count] = class_device_attr_##field; \
979 i->private_##attrb[count].attr.mode = perm; \ 980 i->private_##attrb[count].attr.mode = perm; \
980 i->private_##attrb[count].store = NULL; \
981 i->attrb[count] = &i->private_##attrb[count]; \ 981 i->attrb[count] = &i->private_##attrb[count]; \
982 if (test) \ 982 if (test) \
983 count++ 983 count++
diff --git a/drivers/scsi/sim710.c b/drivers/scsi/sim710.c
index 3274ab76c8d3..255886a9ac55 100644
--- a/drivers/scsi/sim710.c
+++ b/drivers/scsi/sim710.c
@@ -75,7 +75,7 @@ param_setup(char *str)
75 else if(!strncmp(pos, "id:", 3)) { 75 else if(!strncmp(pos, "id:", 3)) {
76 if(slot == -1) { 76 if(slot == -1) {
77 printk(KERN_WARNING "sim710: Must specify slot for id parameter\n"); 77 printk(KERN_WARNING "sim710: Must specify slot for id parameter\n");
78 } else if(slot > MAX_SLOTS) { 78 } else if(slot >= MAX_SLOTS) {
79 printk(KERN_WARNING "sim710: Illegal slot %d for id %d\n", slot, val); 79 printk(KERN_WARNING "sim710: Illegal slot %d for id %d\n", slot, val);
80 } else { 80 } else {
81 id_array[slot] = val; 81 id_array[slot] = val;
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
index 2691248b2cbd..ad87d73f88ee 100644
--- a/drivers/scsi/st.c
+++ b/drivers/scsi/st.c
@@ -4054,7 +4054,7 @@ static int st_probe(struct device *dev)
4054 } 4054 }
4055 4055
4056 sdev_printk(KERN_WARNING, SDp, 4056 sdev_printk(KERN_WARNING, SDp,
4057 "Attached scsi tape %s", tape_name(tpnt)); 4057 "Attached scsi tape %s\n", tape_name(tpnt));
4058 printk(KERN_WARNING "%s: try direct i/o: %s (alignment %d B)\n", 4058 printk(KERN_WARNING "%s: try direct i/o: %s (alignment %d B)\n",
4059 tape_name(tpnt), tpnt->try_dio ? "yes" : "no", 4059 tape_name(tpnt), tpnt->try_dio ? "yes" : "no",
4060 queue_dma_alignment(SDp->request_queue) + 1); 4060 queue_dma_alignment(SDp->request_queue) + 1);
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index 674b15c78f68..bbf78aaf9e01 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -362,6 +362,40 @@ serial_out(struct uart_8250_port *up, int offset, int value)
362#define serial_inp(up, offset) serial_in(up, offset) 362#define serial_inp(up, offset) serial_in(up, offset)
363#define serial_outp(up, offset, value) serial_out(up, offset, value) 363#define serial_outp(up, offset, value) serial_out(up, offset, value)
364 364
365/* Uart divisor latch read */
366static inline int _serial_dl_read(struct uart_8250_port *up)
367{
368 return serial_inp(up, UART_DLL) | serial_inp(up, UART_DLM) << 8;
369}
370
371/* Uart divisor latch write */
372static inline void _serial_dl_write(struct uart_8250_port *up, int value)
373{
374 serial_outp(up, UART_DLL, value & 0xff);
375 serial_outp(up, UART_DLM, value >> 8 & 0xff);
376}
377
378#ifdef CONFIG_SERIAL_8250_AU1X00
379/* Au1x00 haven't got a standard divisor latch */
380static int serial_dl_read(struct uart_8250_port *up)
381{
382 if (up->port.iotype == UPIO_AU)
383 return __raw_readl(up->port.membase + 0x28);
384 else
385 return _serial_dl_read(up);
386}
387
388static void serial_dl_write(struct uart_8250_port *up, int value)
389{
390 if (up->port.iotype == UPIO_AU)
391 __raw_writel(value, up->port.membase + 0x28);
392 else
393 _serial_dl_write(up, value);
394}
395#else
396#define serial_dl_read(up) _serial_dl_read(up)
397#define serial_dl_write(up, value) _serial_dl_write(up, value)
398#endif
365 399
366/* 400/*
367 * For the 16C950 401 * For the 16C950
@@ -494,7 +528,8 @@ static void disable_rsa(struct uart_8250_port *up)
494 */ 528 */
495static int size_fifo(struct uart_8250_port *up) 529static int size_fifo(struct uart_8250_port *up)
496{ 530{
497 unsigned char old_fcr, old_mcr, old_dll, old_dlm, old_lcr; 531 unsigned char old_fcr, old_mcr, old_lcr;
532 unsigned short old_dl;
498 int count; 533 int count;
499 534
500 old_lcr = serial_inp(up, UART_LCR); 535 old_lcr = serial_inp(up, UART_LCR);
@@ -505,10 +540,8 @@ static int size_fifo(struct uart_8250_port *up)
505 UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT); 540 UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT);
506 serial_outp(up, UART_MCR, UART_MCR_LOOP); 541 serial_outp(up, UART_MCR, UART_MCR_LOOP);
507 serial_outp(up, UART_LCR, UART_LCR_DLAB); 542 serial_outp(up, UART_LCR, UART_LCR_DLAB);
508 old_dll = serial_inp(up, UART_DLL); 543 old_dl = serial_dl_read(up);
509 old_dlm = serial_inp(up, UART_DLM); 544 serial_dl_write(up, 0x0001);
510 serial_outp(up, UART_DLL, 0x01);
511 serial_outp(up, UART_DLM, 0x00);
512 serial_outp(up, UART_LCR, 0x03); 545 serial_outp(up, UART_LCR, 0x03);
513 for (count = 0; count < 256; count++) 546 for (count = 0; count < 256; count++)
514 serial_outp(up, UART_TX, count); 547 serial_outp(up, UART_TX, count);
@@ -519,8 +552,7 @@ static int size_fifo(struct uart_8250_port *up)
519 serial_outp(up, UART_FCR, old_fcr); 552 serial_outp(up, UART_FCR, old_fcr);
520 serial_outp(up, UART_MCR, old_mcr); 553 serial_outp(up, UART_MCR, old_mcr);
521 serial_outp(up, UART_LCR, UART_LCR_DLAB); 554 serial_outp(up, UART_LCR, UART_LCR_DLAB);
522 serial_outp(up, UART_DLL, old_dll); 555 serial_dl_write(up, old_dl);
523 serial_outp(up, UART_DLM, old_dlm);
524 serial_outp(up, UART_LCR, old_lcr); 556 serial_outp(up, UART_LCR, old_lcr);
525 557
526 return count; 558 return count;
@@ -750,8 +782,7 @@ static void autoconfig_16550a(struct uart_8250_port *up)
750 782
751 serial_outp(up, UART_LCR, 0xE0); 783 serial_outp(up, UART_LCR, 0xE0);
752 784
753 quot = serial_inp(up, UART_DLM) << 8; 785 quot = serial_dl_read(up);
754 quot += serial_inp(up, UART_DLL);
755 quot <<= 3; 786 quot <<= 3;
756 787
757 status1 = serial_in(up, 0x04); /* EXCR1 */ 788 status1 = serial_in(up, 0x04); /* EXCR1 */
@@ -759,8 +790,7 @@ static void autoconfig_16550a(struct uart_8250_port *up)
759 status1 |= 0x10; /* 1.625 divisor for baud_base --> 921600 */ 790 status1 |= 0x10; /* 1.625 divisor for baud_base --> 921600 */
760 serial_outp(up, 0x04, status1); 791 serial_outp(up, 0x04, status1);
761 792
762 serial_outp(up, UART_DLL, quot & 0xff); 793 serial_dl_write(up, quot);
763 serial_outp(up, UART_DLM, quot >> 8);
764 794
765 serial_outp(up, UART_LCR, 0); 795 serial_outp(up, UART_LCR, 0);
766 796
@@ -1862,8 +1892,7 @@ serial8250_set_termios(struct uart_port *port, struct termios *termios,
1862 serial_outp(up, UART_LCR, cval | UART_LCR_DLAB);/* set DLAB */ 1892 serial_outp(up, UART_LCR, cval | UART_LCR_DLAB);/* set DLAB */
1863 } 1893 }
1864 1894
1865 serial_outp(up, UART_DLL, quot & 0xff); /* LS of divisor */ 1895 serial_dl_write(up, quot);
1866 serial_outp(up, UART_DLM, quot >> 8); /* MS of divisor */
1867 1896
1868 /* 1897 /*
1869 * LCR DLAB must be set to enable 64-byte FIFO mode. If the FCR 1898 * LCR DLAB must be set to enable 64-byte FIFO mode. If the FCR
@@ -1906,6 +1935,9 @@ static int serial8250_request_std_resource(struct uart_8250_port *up)
1906 int ret = 0; 1935 int ret = 0;
1907 1936
1908 switch (up->port.iotype) { 1937 switch (up->port.iotype) {
1938 case UPIO_AU:
1939 size = 0x100000;
1940 /* fall thru */
1909 case UPIO_MEM: 1941 case UPIO_MEM:
1910 if (!up->port.mapbase) 1942 if (!up->port.mapbase)
1911 break; 1943 break;
@@ -1938,6 +1970,9 @@ static void serial8250_release_std_resource(struct uart_8250_port *up)
1938 unsigned int size = 8 << up->port.regshift; 1970 unsigned int size = 8 << up->port.regshift;
1939 1971
1940 switch (up->port.iotype) { 1972 switch (up->port.iotype) {
1973 case UPIO_AU:
1974 size = 0x100000;
1975 /* fall thru */
1941 case UPIO_MEM: 1976 case UPIO_MEM:
1942 if (!up->port.mapbase) 1977 if (!up->port.mapbase)
1943 break; 1978 break;
@@ -2200,10 +2235,17 @@ static void
2200serial8250_console_write(struct console *co, const char *s, unsigned int count) 2235serial8250_console_write(struct console *co, const char *s, unsigned int count)
2201{ 2236{
2202 struct uart_8250_port *up = &serial8250_ports[co->index]; 2237 struct uart_8250_port *up = &serial8250_ports[co->index];
2238 unsigned long flags;
2203 unsigned int ier; 2239 unsigned int ier;
2240 int locked = 1;
2204 2241
2205 touch_nmi_watchdog(); 2242 touch_nmi_watchdog();
2206 2243
2244 if (oops_in_progress) {
2245 locked = spin_trylock_irqsave(&up->port.lock, flags);
2246 } else
2247 spin_lock_irqsave(&up->port.lock, flags);
2248
2207 /* 2249 /*
2208 * First save the IER then disable the interrupts 2250 * First save the IER then disable the interrupts
2209 */ 2251 */
@@ -2221,8 +2263,10 @@ serial8250_console_write(struct console *co, const char *s, unsigned int count)
2221 * and restore the IER 2263 * and restore the IER
2222 */ 2264 */
2223 wait_for_xmitr(up, BOTH_EMPTY); 2265 wait_for_xmitr(up, BOTH_EMPTY);
2224 up->ier |= UART_IER_THRI; 2266 serial_out(up, UART_IER, ier);
2225 serial_out(up, UART_IER, ier | UART_IER_THRI); 2267
2268 if (locked)
2269 spin_unlock_irqrestore(&up->port.lock, flags);
2226} 2270}
2227 2271
2228static int serial8250_console_setup(struct console *co, char *options) 2272static int serial8250_console_setup(struct console *co, char *options)
diff --git a/drivers/serial/8250_au1x00.c b/drivers/serial/8250_au1x00.c
index 3d1bfd07208d..58015fd14be9 100644
--- a/drivers/serial/8250_au1x00.c
+++ b/drivers/serial/8250_au1x00.c
@@ -30,13 +30,12 @@
30 { \ 30 { \
31 .iobase = _base, \ 31 .iobase = _base, \
32 .membase = (void __iomem *)_base,\ 32 .membase = (void __iomem *)_base,\
33 .mapbase = _base, \ 33 .mapbase = CPHYSADDR(_base), \
34 .irq = _irq, \ 34 .irq = _irq, \
35 .uartclk = 0, /* filled */ \ 35 .uartclk = 0, /* filled */ \
36 .regshift = 2, \ 36 .regshift = 2, \
37 .iotype = UPIO_AU, \ 37 .iotype = UPIO_AU, \
38 .flags = UPF_SKIP_TEST | \ 38 .flags = UPF_SKIP_TEST \
39 UPF_IOREMAP, \
40 } 39 }
41 40
42static struct plat_serial8250_port au1x00_data[] = { 41static struct plat_serial8250_port au1x00_data[] = {
diff --git a/drivers/serial/cpm_uart/cpm_uart.h b/drivers/serial/cpm_uart/cpm_uart.h
index 73c8a088c160..3b35cb779539 100644
--- a/drivers/serial/cpm_uart/cpm_uart.h
+++ b/drivers/serial/cpm_uart/cpm_uart.h
@@ -5,11 +5,20 @@
5 * 5 *
6 * Copyright (C) 2004 Freescale Semiconductor, Inc. 6 * Copyright (C) 2004 Freescale Semiconductor, Inc.
7 * 7 *
8 * 2006 (c) MontaVista Software, Inc.
9 * Vitaly Bordug <vbordug@ru.mvista.com>
10 *
11 * This file is licensed under the terms of the GNU General Public License
12 * version 2. This program is licensed "as is" without any warranty of any
13 * kind, whether express or implied.
14 *
8 */ 15 */
9#ifndef CPM_UART_H 16#ifndef CPM_UART_H
10#define CPM_UART_H 17#define CPM_UART_H
11 18
12#include <linux/config.h> 19#include <linux/config.h>
20#include <linux/platform_device.h>
21#include <linux/fs_uart_pd.h>
13 22
14#if defined(CONFIG_CPM2) 23#if defined(CONFIG_CPM2)
15#include "cpm_uart_cpm2.h" 24#include "cpm_uart_cpm2.h"
@@ -26,14 +35,14 @@
26#define FLAG_SMC 0x00000002 35#define FLAG_SMC 0x00000002
27#define FLAG_CONSOLE 0x00000001 36#define FLAG_CONSOLE 0x00000001
28 37
29#define UART_SMC1 0 38#define UART_SMC1 fsid_smc1_uart
30#define UART_SMC2 1 39#define UART_SMC2 fsid_smc2_uart
31#define UART_SCC1 2 40#define UART_SCC1 fsid_scc1_uart
32#define UART_SCC2 3 41#define UART_SCC2 fsid_scc2_uart
33#define UART_SCC3 4 42#define UART_SCC3 fsid_scc3_uart
34#define UART_SCC4 5 43#define UART_SCC4 fsid_scc4_uart
35 44
36#define UART_NR 6 45#define UART_NR fs_uart_nr
37 46
38#define RX_NUM_FIFO 4 47#define RX_NUM_FIFO 4
39#define RX_BUF_SIZE 32 48#define RX_BUF_SIZE 32
@@ -64,6 +73,7 @@ struct uart_cpm_port {
64 uint dp_addr; 73 uint dp_addr;
65 void *mem_addr; 74 void *mem_addr;
66 dma_addr_t dma_addr; 75 dma_addr_t dma_addr;
76 u32 mem_size;
67 /* helpers */ 77 /* helpers */
68 int baud; 78 int baud;
69 int bits; 79 int bits;
@@ -90,4 +100,38 @@ void scc2_lineif(struct uart_cpm_port *pinfo);
90void scc3_lineif(struct uart_cpm_port *pinfo); 100void scc3_lineif(struct uart_cpm_port *pinfo);
91void scc4_lineif(struct uart_cpm_port *pinfo); 101void scc4_lineif(struct uart_cpm_port *pinfo);
92 102
103/*
104 virtual to phys transtalion
105*/
106static inline unsigned long cpu2cpm_addr(void* addr, struct uart_cpm_port *pinfo)
107{
108 int offset;
109 u32 val = (u32)addr;
110 /* sane check */
111 if (likely((val >= (u32)pinfo->mem_addr)) &&
112 (val<((u32)pinfo->mem_addr + pinfo->mem_size))) {
113 offset = val - (u32)pinfo->mem_addr;
114 return pinfo->dma_addr+offset;
115 }
116 /* something nasty happened */
117 BUG();
118 return 0;
119}
120
121static inline void *cpm2cpu_addr(unsigned long addr, struct uart_cpm_port *pinfo)
122{
123 int offset;
124 u32 val = addr;
125 /* sane check */
126 if (likely((val >= pinfo->dma_addr) &&
127 (val<(pinfo->dma_addr + pinfo->mem_size)))) {
128 offset = val - (u32)pinfo->dma_addr;
129 return (void*)(pinfo->mem_addr+offset);
130 }
131 /* something nasty happened */
132 BUG();
133 return 0;
134}
135
136
93#endif /* CPM_UART_H */ 137#endif /* CPM_UART_H */
diff --git a/drivers/serial/cpm_uart/cpm_uart_core.c b/drivers/serial/cpm_uart/cpm_uart_core.c
index b7bf4c698a47..5cba59ad7dc5 100644
--- a/drivers/serial/cpm_uart/cpm_uart_core.c
+++ b/drivers/serial/cpm_uart/cpm_uart_core.c
@@ -12,7 +12,8 @@
12 * 12 *
13 * Copyright (C) 2004 Freescale Semiconductor, Inc. 13 * Copyright (C) 2004 Freescale Semiconductor, Inc.
14 * (C) 2004 Intracom, S.A. 14 * (C) 2004 Intracom, S.A.
15 * (C) 2005 MontaVista Software, Inc. by Vitaly Bordug <vbordug@ru.mvista.com> 15 * (C) 2005-2006 MontaVista Software, Inc.
16 * Vitaly Bordug <vbordug@ru.mvista.com>
16 * 17 *
17 * This program is free software; you can redistribute it and/or modify 18 * This program is free software; you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License as published by 19 * it under the terms of the GNU General Public License as published by
@@ -41,6 +42,7 @@
41#include <linux/device.h> 42#include <linux/device.h>
42#include <linux/bootmem.h> 43#include <linux/bootmem.h>
43#include <linux/dma-mapping.h> 44#include <linux/dma-mapping.h>
45#include <linux/fs_uart_pd.h>
44 46
45#include <asm/io.h> 47#include <asm/io.h>
46#include <asm/irq.h> 48#include <asm/irq.h>
@@ -60,7 +62,7 @@
60/* Track which ports are configured as uarts */ 62/* Track which ports are configured as uarts */
61int cpm_uart_port_map[UART_NR]; 63int cpm_uart_port_map[UART_NR];
62/* How many ports did we config as uarts */ 64/* How many ports did we config as uarts */
63int cpm_uart_nr; 65int cpm_uart_nr = 0;
64 66
65/**************************************************************/ 67/**************************************************************/
66 68
@@ -71,18 +73,51 @@ static void cpm_uart_initbd(struct uart_cpm_port *pinfo);
71 73
72/**************************************************************/ 74/**************************************************************/
73 75
74static inline unsigned long cpu2cpm_addr(void *addr) 76
77/* Place-holder for board-specific stuff */
78struct platform_device* __attribute__ ((weak)) __init
79early_uart_get_pdev(int index)
80{
81 return NULL;
82}
83
84
85static void cpm_uart_count(void)
75{ 86{
76 if ((unsigned long)addr >= CPM_ADDR) 87 cpm_uart_nr = 0;
77 return (unsigned long)addr; 88#ifdef CONFIG_SERIAL_CPM_SMC1
78 return virt_to_bus(addr); 89 cpm_uart_port_map[cpm_uart_nr++] = UART_SMC1;
90#endif
91#ifdef CONFIG_SERIAL_CPM_SMC2
92 cpm_uart_port_map[cpm_uart_nr++] = UART_SMC2;
93#endif
94#ifdef CONFIG_SERIAL_CPM_SCC1
95 cpm_uart_port_map[cpm_uart_nr++] = UART_SCC1;
96#endif
97#ifdef CONFIG_SERIAL_CPM_SCC2
98 cpm_uart_port_map[cpm_uart_nr++] = UART_SCC2;
99#endif
100#ifdef CONFIG_SERIAL_CPM_SCC3
101 cpm_uart_port_map[cpm_uart_nr++] = UART_SCC3;
102#endif
103#ifdef CONFIG_SERIAL_CPM_SCC4
104 cpm_uart_port_map[cpm_uart_nr++] = UART_SCC4;
105#endif
79} 106}
80 107
81static inline void *cpm2cpu_addr(unsigned long addr) 108/* Get UART number by its id */
109static int cpm_uart_id2nr(int id)
82{ 110{
83 if (addr >= CPM_ADDR) 111 int i;
84 return (void *)addr; 112 if (id < UART_NR) {
85 return bus_to_virt(addr); 113 for (i=0; i<UART_NR; i++) {
114 if (cpm_uart_port_map[i] == id)
115 return i;
116 }
117 }
118
119 /* not found or invalid argument */
120 return -1;
86} 121}
87 122
88/* 123/*
@@ -258,7 +293,7 @@ static void cpm_uart_int_rx(struct uart_port *port, struct pt_regs *regs)
258 } 293 }
259 294
260 /* get pointer */ 295 /* get pointer */
261 cp = cpm2cpu_addr(bdp->cbd_bufaddr); 296 cp = cpm2cpu_addr(bdp->cbd_bufaddr, pinfo);
262 297
263 /* loop through the buffer */ 298 /* loop through the buffer */
264 while (i-- > 0) { 299 while (i-- > 0) {
@@ -438,7 +473,11 @@ static void cpm_uart_shutdown(struct uart_port *port)
438 } 473 }
439 474
440 /* Shut them really down and reinit buffer descriptors */ 475 /* Shut them really down and reinit buffer descriptors */
441 cpm_line_cr_cmd(line, CPM_CR_STOP_TX); 476 if (IS_SMC(pinfo))
477 cpm_line_cr_cmd(line, CPM_CR_STOP_TX);
478 else
479 cpm_line_cr_cmd(line, CPM_CR_GRA_STOP_TX);
480
442 cpm_uart_initbd(pinfo); 481 cpm_uart_initbd(pinfo);
443 } 482 }
444} 483}
@@ -601,7 +640,7 @@ static int cpm_uart_tx_pump(struct uart_port *port)
601 /* Pick next descriptor and fill from buffer */ 640 /* Pick next descriptor and fill from buffer */
602 bdp = pinfo->tx_cur; 641 bdp = pinfo->tx_cur;
603 642
604 p = cpm2cpu_addr(bdp->cbd_bufaddr); 643 p = cpm2cpu_addr(bdp->cbd_bufaddr, pinfo);
605 644
606 *p++ = port->x_char; 645 *p++ = port->x_char;
607 bdp->cbd_datlen = 1; 646 bdp->cbd_datlen = 1;
@@ -628,7 +667,7 @@ static int cpm_uart_tx_pump(struct uart_port *port)
628 667
629 while (!(bdp->cbd_sc & BD_SC_READY) && (xmit->tail != xmit->head)) { 668 while (!(bdp->cbd_sc & BD_SC_READY) && (xmit->tail != xmit->head)) {
630 count = 0; 669 count = 0;
631 p = cpm2cpu_addr(bdp->cbd_bufaddr); 670 p = cpm2cpu_addr(bdp->cbd_bufaddr, pinfo);
632 while (count < pinfo->tx_fifosize) { 671 while (count < pinfo->tx_fifosize) {
633 *p++ = xmit->buf[xmit->tail]; 672 *p++ = xmit->buf[xmit->tail];
634 xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); 673 xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
@@ -677,12 +716,12 @@ static void cpm_uart_initbd(struct uart_cpm_port *pinfo)
677 mem_addr = pinfo->mem_addr; 716 mem_addr = pinfo->mem_addr;
678 bdp = pinfo->rx_cur = pinfo->rx_bd_base; 717 bdp = pinfo->rx_cur = pinfo->rx_bd_base;
679 for (i = 0; i < (pinfo->rx_nrfifos - 1); i++, bdp++) { 718 for (i = 0; i < (pinfo->rx_nrfifos - 1); i++, bdp++) {
680 bdp->cbd_bufaddr = cpu2cpm_addr(mem_addr); 719 bdp->cbd_bufaddr = cpu2cpm_addr(mem_addr, pinfo);
681 bdp->cbd_sc = BD_SC_EMPTY | BD_SC_INTRPT; 720 bdp->cbd_sc = BD_SC_EMPTY | BD_SC_INTRPT;
682 mem_addr += pinfo->rx_fifosize; 721 mem_addr += pinfo->rx_fifosize;
683 } 722 }
684 723
685 bdp->cbd_bufaddr = cpu2cpm_addr(mem_addr); 724 bdp->cbd_bufaddr = cpu2cpm_addr(mem_addr, pinfo);
686 bdp->cbd_sc = BD_SC_WRAP | BD_SC_EMPTY | BD_SC_INTRPT; 725 bdp->cbd_sc = BD_SC_WRAP | BD_SC_EMPTY | BD_SC_INTRPT;
687 726
688 /* Set the physical address of the host memory 727 /* Set the physical address of the host memory
@@ -692,12 +731,12 @@ static void cpm_uart_initbd(struct uart_cpm_port *pinfo)
692 mem_addr = pinfo->mem_addr + L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize); 731 mem_addr = pinfo->mem_addr + L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize);
693 bdp = pinfo->tx_cur = pinfo->tx_bd_base; 732 bdp = pinfo->tx_cur = pinfo->tx_bd_base;
694 for (i = 0; i < (pinfo->tx_nrfifos - 1); i++, bdp++) { 733 for (i = 0; i < (pinfo->tx_nrfifos - 1); i++, bdp++) {
695 bdp->cbd_bufaddr = cpu2cpm_addr(mem_addr); 734 bdp->cbd_bufaddr = cpu2cpm_addr(mem_addr, pinfo);
696 bdp->cbd_sc = BD_SC_INTRPT; 735 bdp->cbd_sc = BD_SC_INTRPT;
697 mem_addr += pinfo->tx_fifosize; 736 mem_addr += pinfo->tx_fifosize;
698 } 737 }
699 738
700 bdp->cbd_bufaddr = cpu2cpm_addr(mem_addr); 739 bdp->cbd_bufaddr = cpu2cpm_addr(mem_addr, pinfo);
701 bdp->cbd_sc = BD_SC_WRAP | BD_SC_INTRPT; 740 bdp->cbd_sc = BD_SC_WRAP | BD_SC_INTRPT;
702} 741}
703 742
@@ -829,14 +868,6 @@ static int cpm_uart_request_port(struct uart_port *port)
829 if (pinfo->flags & FLAG_CONSOLE) 868 if (pinfo->flags & FLAG_CONSOLE)
830 return 0; 869 return 0;
831 870
832 /*
833 * Setup any port IO, connect any baud rate generators,
834 * etc. This is expected to be handled by board
835 * dependant code
836 */
837 if (pinfo->set_lineif)
838 pinfo->set_lineif(pinfo);
839
840 if (IS_SMC(pinfo)) { 871 if (IS_SMC(pinfo)) {
841 pinfo->smcp->smc_smcm &= ~(SMCM_RX | SMCM_TX); 872 pinfo->smcp->smc_smcm &= ~(SMCM_RX | SMCM_TX);
842 pinfo->smcp->smc_smcmr &= ~(SMCMR_REN | SMCMR_TEN); 873 pinfo->smcp->smc_smcmr &= ~(SMCMR_REN | SMCMR_TEN);
@@ -988,6 +1019,58 @@ struct uart_cpm_port cpm_uart_ports[UART_NR] = {
988 }, 1019 },
989}; 1020};
990 1021
1022int cpm_uart_drv_get_platform_data(struct platform_device *pdev, int is_con)
1023{
1024 struct resource *r;
1025 struct fs_uart_platform_info *pdata = pdev->dev.platform_data;
1026 int idx = pdata->fs_no; /* It is UART_SMCx or UART_SCCx index */
1027 struct uart_cpm_port *pinfo;
1028 int line;
1029 u32 mem, pram;
1030
1031 line = cpm_uart_id2nr(idx);
1032 if(line < 0) {
1033 printk(KERN_ERR"%s(): port %d is not registered", __FUNCTION__, idx);
1034 return -1;
1035 }
1036
1037 pinfo = (struct uart_cpm_port *) &cpm_uart_ports[idx];
1038
1039 pinfo->brg = pdata->brg;
1040
1041 if (!is_con) {
1042 pinfo->port.line = line;
1043 pinfo->port.flags = UPF_BOOT_AUTOCONF;
1044 }
1045
1046 if (!(r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs")))
1047 return -EINVAL;
1048 mem = r->start;
1049
1050 if (!(r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pram")))
1051 return -EINVAL;
1052 pram = r->start;
1053
1054 if(idx > fsid_smc2_uart) {
1055 pinfo->sccp = (scc_t *)mem;
1056 pinfo->sccup = (scc_uart_t *)pram;
1057 } else {
1058 pinfo->smcp = (smc_t *)mem;
1059 pinfo->smcup = (smc_uart_t *)pram;
1060 }
1061 pinfo->tx_nrfifos = pdata->tx_num_fifo;
1062 pinfo->tx_fifosize = pdata->tx_buf_size;
1063
1064 pinfo->rx_nrfifos = pdata->rx_num_fifo;
1065 pinfo->rx_fifosize = pdata->rx_buf_size;
1066
1067 pinfo->port.uartclk = pdata->uart_clk;
1068 pinfo->port.mapbase = (unsigned long)mem;
1069 pinfo->port.irq = platform_get_irq(pdev, 0);
1070
1071 return 0;
1072}
1073
991#ifdef CONFIG_SERIAL_CPM_CONSOLE 1074#ifdef CONFIG_SERIAL_CPM_CONSOLE
992/* 1075/*
993 * Print a string to the serial port trying not to disturb 1076 * Print a string to the serial port trying not to disturb
@@ -1027,7 +1110,7 @@ static void cpm_uart_console_write(struct console *co, const char *s,
1027 * If the buffer address is in the CPM DPRAM, don't 1110 * If the buffer address is in the CPM DPRAM, don't
1028 * convert it. 1111 * convert it.
1029 */ 1112 */
1030 cp = cpm2cpu_addr(bdp->cbd_bufaddr); 1113 cp = cpm2cpu_addr(bdp->cbd_bufaddr, pinfo);
1031 1114
1032 *cp = *s; 1115 *cp = *s;
1033 1116
@@ -1044,7 +1127,7 @@ static void cpm_uart_console_write(struct console *co, const char *s,
1044 while ((bdp->cbd_sc & BD_SC_READY) != 0) 1127 while ((bdp->cbd_sc & BD_SC_READY) != 0)
1045 ; 1128 ;
1046 1129
1047 cp = cpm2cpu_addr(bdp->cbd_bufaddr); 1130 cp = cpm2cpu_addr(bdp->cbd_bufaddr, pinfo);
1048 1131
1049 *cp = 13; 1132 *cp = 13;
1050 bdp->cbd_datlen = 1; 1133 bdp->cbd_datlen = 1;
@@ -1067,9 +1150,7 @@ static void cpm_uart_console_write(struct console *co, const char *s,
1067 pinfo->tx_cur = (volatile cbd_t *) bdp; 1150 pinfo->tx_cur = (volatile cbd_t *) bdp;
1068} 1151}
1069 1152
1070/* 1153
1071 * Setup console. Be careful is called early !
1072 */
1073static int __init cpm_uart_console_setup(struct console *co, char *options) 1154static int __init cpm_uart_console_setup(struct console *co, char *options)
1074{ 1155{
1075 struct uart_port *port; 1156 struct uart_port *port;
@@ -1080,9 +1161,29 @@ static int __init cpm_uart_console_setup(struct console *co, char *options)
1080 int flow = 'n'; 1161 int flow = 'n';
1081 int ret; 1162 int ret;
1082 1163
1164 struct fs_uart_platform_info *pdata;
1165 struct platform_device* pdev = early_uart_get_pdev(co->index);
1166
1167 if (!pdev) {
1168 pr_info("cpm_uart: console: compat mode\n");
1169 /* compatibility - will be cleaned up */
1170 cpm_uart_init_portdesc();
1171 }
1172
1083 port = 1173 port =
1084 (struct uart_port *)&cpm_uart_ports[cpm_uart_port_map[co->index]]; 1174 (struct uart_port *)&cpm_uart_ports[cpm_uart_port_map[co->index]];
1085 pinfo = (struct uart_cpm_port *)port; 1175 pinfo = (struct uart_cpm_port *)port;
1176 if (!pdev) {
1177 if (pinfo->set_lineif)
1178 pinfo->set_lineif(pinfo);
1179 } else {
1180 pdata = pdev->dev.platform_data;
1181 if (pdata)
1182 if (pdata->init_ioports)
1183 pdata->init_ioports();
1184
1185 cpm_uart_drv_get_platform_data(pdev, 1);
1186 }
1086 1187
1087 pinfo->flags |= FLAG_CONSOLE; 1188 pinfo->flags |= FLAG_CONSOLE;
1088 1189
@@ -1097,14 +1198,6 @@ static int __init cpm_uart_console_setup(struct console *co, char *options)
1097 baud = 9600; 1198 baud = 9600;
1098 } 1199 }
1099 1200
1100 /*
1101 * Setup any port IO, connect any baud rate generators,
1102 * etc. This is expected to be handled by board
1103 * dependant code
1104 */
1105 if (pinfo->set_lineif)
1106 pinfo->set_lineif(pinfo);
1107
1108 if (IS_SMC(pinfo)) { 1201 if (IS_SMC(pinfo)) {
1109 pinfo->smcp->smc_smcm &= ~(SMCM_RX | SMCM_TX); 1202 pinfo->smcp->smc_smcm &= ~(SMCM_RX | SMCM_TX);
1110 pinfo->smcp->smc_smcmr &= ~(SMCMR_REN | SMCMR_TEN); 1203 pinfo->smcp->smc_smcmr &= ~(SMCMR_REN | SMCMR_TEN);
@@ -1143,11 +1236,8 @@ static struct console cpm_scc_uart_console = {
1143 1236
1144int __init cpm_uart_console_init(void) 1237int __init cpm_uart_console_init(void)
1145{ 1238{
1146 int ret = cpm_uart_init_portdesc(); 1239 register_console(&cpm_scc_uart_console);
1147 1240 return 0;
1148 if (!ret)
1149 register_console(&cpm_scc_uart_console);
1150 return ret;
1151} 1241}
1152 1242
1153console_initcall(cpm_uart_console_init); 1243console_initcall(cpm_uart_console_init);
@@ -1165,44 +1255,129 @@ static struct uart_driver cpm_reg = {
1165 .minor = SERIAL_CPM_MINOR, 1255 .minor = SERIAL_CPM_MINOR,
1166 .cons = CPM_UART_CONSOLE, 1256 .cons = CPM_UART_CONSOLE,
1167}; 1257};
1168 1258static int cpm_uart_drv_probe(struct device *dev)
1169static int __init cpm_uart_init(void)
1170{ 1259{
1171 int ret, i; 1260 struct platform_device *pdev = to_platform_device(dev);
1172 1261 struct fs_uart_platform_info *pdata;
1173 printk(KERN_INFO "Serial: CPM driver $Revision: 0.01 $\n"); 1262 int ret = -ENODEV;
1174 1263
1175#ifndef CONFIG_SERIAL_CPM_CONSOLE 1264 if(!pdev) {
1176 ret = cpm_uart_init_portdesc(); 1265 printk(KERN_ERR"CPM UART: platform data missing!\n");
1177 if (ret)
1178 return ret; 1266 return ret;
1179#endif 1267 }
1180 1268
1181 cpm_reg.nr = cpm_uart_nr; 1269 pdata = pdev->dev.platform_data;
1182 ret = uart_register_driver(&cpm_reg); 1270 pr_debug("cpm_uart_drv_probe: Adding CPM UART %d\n", cpm_uart_id2nr(pdata->fs_no));
1183 1271
1184 if (ret) 1272 if ((ret = cpm_uart_drv_get_platform_data(pdev, 0)))
1185 return ret; 1273 return ret;
1186 1274
1187 for (i = 0; i < cpm_uart_nr; i++) { 1275 if (pdata->init_ioports)
1188 int con = cpm_uart_port_map[i]; 1276 pdata->init_ioports();
1189 cpm_uart_ports[con].port.line = i;
1190 cpm_uart_ports[con].port.flags = UPF_BOOT_AUTOCONF;
1191 uart_add_one_port(&cpm_reg, &cpm_uart_ports[con].port);
1192 }
1193 1277
1194 return ret; 1278 ret = uart_add_one_port(&cpm_reg, &cpm_uart_ports[pdata->fs_no].port);
1279
1280 return ret;
1195} 1281}
1196 1282
1197static void __exit cpm_uart_exit(void) 1283static int cpm_uart_drv_remove(struct device *dev)
1284{
1285 struct platform_device *pdev = to_platform_device(dev);
1286 struct fs_uart_platform_info *pdata = pdev->dev.platform_data;
1287
1288 pr_debug("cpm_uart_drv_remove: Removing CPM UART %d\n",
1289 cpm_uart_id2nr(pdata->fs_no));
1290
1291 uart_remove_one_port(&cpm_reg, &cpm_uart_ports[pdata->fs_no].port);
1292 return 0;
1293}
1294
1295static struct device_driver cpm_smc_uart_driver = {
1296 .name = "fsl-cpm-smc:uart",
1297 .bus = &platform_bus_type,
1298 .probe = cpm_uart_drv_probe,
1299 .remove = cpm_uart_drv_remove,
1300};
1301
1302static struct device_driver cpm_scc_uart_driver = {
1303 .name = "fsl-cpm-scc:uart",
1304 .bus = &platform_bus_type,
1305 .probe = cpm_uart_drv_probe,
1306 .remove = cpm_uart_drv_remove,
1307};
1308
1309/*
1310 This is supposed to match uart devices on platform bus,
1311 */
1312static int match_is_uart (struct device* dev, void* data)
1198{ 1313{
1314 struct platform_device* pdev = container_of(dev, struct platform_device, dev);
1315 int ret = 0;
1316 /* this was setfunc as uart */
1317 if(strstr(pdev->name,":uart")) {
1318 ret = 1;
1319 }
1320 return ret;
1321}
1322
1323
1324static int cpm_uart_init(void) {
1325
1326 int ret;
1199 int i; 1327 int i;
1328 struct device *dev;
1329 printk(KERN_INFO "Serial: CPM driver $Revision: 0.02 $\n");
1330
1331 /* lookup the bus for uart devices */
1332 dev = bus_find_device(&platform_bus_type, NULL, 0, match_is_uart);
1333
1334 /* There are devices on the bus - all should be OK */
1335 if (dev) {
1336 cpm_uart_count();
1337 cpm_reg.nr = cpm_uart_nr;
1338
1339 if (!(ret = uart_register_driver(&cpm_reg))) {
1340 if ((ret = driver_register(&cpm_smc_uart_driver))) {
1341 uart_unregister_driver(&cpm_reg);
1342 return ret;
1343 }
1344 if ((ret = driver_register(&cpm_scc_uart_driver))) {
1345 driver_unregister(&cpm_scc_uart_driver);
1346 uart_unregister_driver(&cpm_reg);
1347 }
1348 }
1349 } else {
1350 /* No capable platform devices found - falling back to legacy mode */
1351 pr_info("cpm_uart: WARNING: no UART devices found on platform bus!\n");
1352 pr_info(
1353 "cpm_uart: the driver will guess configuration, but this mode is no longer supported.\n");
1354#ifndef CONFIG_SERIAL_CPM_CONSOLE
1355 ret = cpm_uart_init_portdesc();
1356 if (ret)
1357 return ret;
1358#endif
1359
1360 cpm_reg.nr = cpm_uart_nr;
1361 ret = uart_register_driver(&cpm_reg);
1362
1363 if (ret)
1364 return ret;
1365
1366 for (i = 0; i < cpm_uart_nr; i++) {
1367 int con = cpm_uart_port_map[i];
1368 cpm_uart_ports[con].port.line = i;
1369 cpm_uart_ports[con].port.flags = UPF_BOOT_AUTOCONF;
1370 uart_add_one_port(&cpm_reg, &cpm_uart_ports[con].port);
1371 }
1200 1372
1201 for (i = 0; i < cpm_uart_nr; i++) {
1202 int con = cpm_uart_port_map[i];
1203 uart_remove_one_port(&cpm_reg, &cpm_uart_ports[con].port);
1204 } 1373 }
1374 return ret;
1375}
1205 1376
1377static void __exit cpm_uart_exit(void)
1378{
1379 driver_unregister(&cpm_scc_uart_driver);
1380 driver_unregister(&cpm_smc_uart_driver);
1206 uart_unregister_driver(&cpm_reg); 1381 uart_unregister_driver(&cpm_reg);
1207} 1382}
1208 1383
diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm1.c b/drivers/serial/cpm_uart/cpm_uart_cpm1.c
index d789ee55cbb7..17406a05ce1f 100644
--- a/drivers/serial/cpm_uart/cpm_uart_cpm1.c
+++ b/drivers/serial/cpm_uart/cpm_uart_cpm1.c
@@ -8,6 +8,8 @@
8 * 8 *
9 * Copyright (C) 2004 Freescale Semiconductor, Inc. 9 * Copyright (C) 2004 Freescale Semiconductor, Inc.
10 * (C) 2004 Intracom, S.A. 10 * (C) 2004 Intracom, S.A.
11 * (C) 2006 MontaVista Software, Inc.
12 * Vitaly Bordug <vbordug@ru.mvista.com>
11 * 13 *
12 * This program is free software; you can redistribute it and/or modify 14 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by 15 * it under the terms of the GNU General Public License as published by
@@ -81,58 +83,11 @@ void cpm_line_cr_cmd(int line, int cmd)
81 83
82void smc1_lineif(struct uart_cpm_port *pinfo) 84void smc1_lineif(struct uart_cpm_port *pinfo)
83{ 85{
84 volatile cpm8xx_t *cp = cpmp;
85
86 (void)cp; /* fix warning */
87#if defined (CONFIG_MPC885ADS)
88 /* Enable SMC1 transceivers */
89 {
90 cp->cp_pepar |= 0x000000c0;
91 cp->cp_pedir &= ~0x000000c0;
92 cp->cp_peso &= ~0x00000040;
93 cp->cp_peso |= 0x00000080;
94 }
95#elif defined (CONFIG_MPC86XADS)
96 unsigned int iobits = 0x000000c0;
97
98 if (!pinfo->is_portb) {
99 cp->cp_pbpar |= iobits;
100 cp->cp_pbdir &= ~iobits;
101 cp->cp_pbodr &= ~iobits;
102 } else {
103 ((immap_t *)IMAP_ADDR)->im_ioport.iop_papar |= iobits;
104 ((immap_t *)IMAP_ADDR)->im_ioport.iop_padir &= ~iobits;
105 ((immap_t *)IMAP_ADDR)->im_ioport.iop_paodr &= ~iobits;
106 }
107#endif
108 pinfo->brg = 1; 86 pinfo->brg = 1;
109} 87}
110 88
111void smc2_lineif(struct uart_cpm_port *pinfo) 89void smc2_lineif(struct uart_cpm_port *pinfo)
112{ 90{
113 volatile cpm8xx_t *cp = cpmp;
114
115 (void)cp; /* fix warning */
116#if defined (CONFIG_MPC885ADS)
117 cp->cp_pepar |= 0x00000c00;
118 cp->cp_pedir &= ~0x00000c00;
119 cp->cp_peso &= ~0x00000400;
120 cp->cp_peso |= 0x00000800;
121#elif defined (CONFIG_MPC86XADS)
122 unsigned int iobits = 0x00000c00;
123
124 if (!pinfo->is_portb) {
125 cp->cp_pbpar |= iobits;
126 cp->cp_pbdir &= ~iobits;
127 cp->cp_pbodr &= ~iobits;
128 } else {
129 ((immap_t *)IMAP_ADDR)->im_ioport.iop_papar |= iobits;
130 ((immap_t *)IMAP_ADDR)->im_ioport.iop_padir &= ~iobits;
131 ((immap_t *)IMAP_ADDR)->im_ioport.iop_paodr &= ~iobits;
132 }
133
134#endif
135
136 pinfo->brg = 2; 91 pinfo->brg = 2;
137} 92}
138 93
@@ -191,7 +146,7 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con)
191 /* was hostalloc but changed cause it blows away the */ 146 /* was hostalloc but changed cause it blows away the */
192 /* large tlb mapping when pinning the kernel area */ 147 /* large tlb mapping when pinning the kernel area */
193 mem_addr = (u8 *) cpm_dpram_addr(cpm_dpalloc(memsz, 8)); 148 mem_addr = (u8 *) cpm_dpram_addr(cpm_dpalloc(memsz, 8));
194 dma_addr = 0; 149 dma_addr = (u32)mem_addr;
195 } else 150 } else
196 mem_addr = dma_alloc_coherent(NULL, memsz, &dma_addr, 151 mem_addr = dma_alloc_coherent(NULL, memsz, &dma_addr,
197 GFP_KERNEL); 152 GFP_KERNEL);
@@ -204,8 +159,9 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con)
204 } 159 }
205 160
206 pinfo->dp_addr = dp_offset; 161 pinfo->dp_addr = dp_offset;
207 pinfo->mem_addr = mem_addr; 162 pinfo->mem_addr = mem_addr; /* virtual address*/
208 pinfo->dma_addr = dma_addr; 163 pinfo->dma_addr = dma_addr; /* physical address*/
164 pinfo->mem_size = memsz;
209 165
210 pinfo->rx_buf = mem_addr; 166 pinfo->rx_buf = mem_addr;
211 pinfo->tx_buf = pinfo->rx_buf + L1_CACHE_ALIGN(pinfo->rx_nrfifos 167 pinfo->tx_buf = pinfo->rx_buf + L1_CACHE_ALIGN(pinfo->rx_nrfifos
diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm2.c b/drivers/serial/cpm_uart/cpm_uart_cpm2.c
index fd9e53ed3feb..cdba128250a9 100644
--- a/drivers/serial/cpm_uart/cpm_uart_cpm2.c
+++ b/drivers/serial/cpm_uart/cpm_uart_cpm2.c
@@ -8,6 +8,8 @@
8 * 8 *
9 * Copyright (C) 2004 Freescale Semiconductor, Inc. 9 * Copyright (C) 2004 Freescale Semiconductor, Inc.
10 * (C) 2004 Intracom, S.A. 10 * (C) 2004 Intracom, S.A.
11 * (C) 2006 MontaVista Software, Inc.
12 * Vitaly Bordug <vbordug@ru.mvista.com>
11 * 13 *
12 * This program is free software; you can redistribute it and/or modify 14 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by 15 * it under the terms of the GNU General Public License as published by
@@ -142,14 +144,6 @@ void scc2_lineif(struct uart_cpm_port *pinfo)
142 * be supported in a sane fashion. 144 * be supported in a sane fashion.
143 */ 145 */
144#ifndef CONFIG_STX_GP3 146#ifndef CONFIG_STX_GP3
145#ifdef CONFIG_MPC8560_ADS
146 volatile iop_cpm2_t *io = &cpm2_immr->im_ioport;
147 io->iop_ppard |= 0x00000018;
148 io->iop_psord &= ~0x00000008; /* Rx */
149 io->iop_psord &= ~0x00000010; /* Tx */
150 io->iop_pdird &= ~0x00000008; /* Rx */
151 io->iop_pdird |= 0x00000010; /* Tx */
152#else
153 volatile iop_cpm2_t *io = &cpm2_immr->im_ioport; 147 volatile iop_cpm2_t *io = &cpm2_immr->im_ioport;
154 io->iop_pparb |= 0x008b0000; 148 io->iop_pparb |= 0x008b0000;
155 io->iop_pdirb |= 0x00880000; 149 io->iop_pdirb |= 0x00880000;
@@ -157,7 +151,6 @@ void scc2_lineif(struct uart_cpm_port *pinfo)
157 io->iop_pdirb &= ~0x00030000; 151 io->iop_pdirb &= ~0x00030000;
158 io->iop_psorb &= ~0x00030000; 152 io->iop_psorb &= ~0x00030000;
159#endif 153#endif
160#endif
161 cpm2_immr->im_cpmux.cmx_scr &= 0xff00ffff; 154 cpm2_immr->im_cpmux.cmx_scr &= 0xff00ffff;
162 cpm2_immr->im_cpmux.cmx_scr |= 0x00090000; 155 cpm2_immr->im_cpmux.cmx_scr |= 0x00090000;
163 pinfo->brg = 2; 156 pinfo->brg = 2;
@@ -218,8 +211,10 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con)
218 211
219 memsz = L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize) + 212 memsz = L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize) +
220 L1_CACHE_ALIGN(pinfo->tx_nrfifos * pinfo->tx_fifosize); 213 L1_CACHE_ALIGN(pinfo->tx_nrfifos * pinfo->tx_fifosize);
221 if (is_con) 214 if (is_con) {
222 mem_addr = alloc_bootmem(memsz); 215 mem_addr = alloc_bootmem(memsz);
216 dma_addr = virt_to_bus(mem_addr);
217 }
223 else 218 else
224 mem_addr = dma_alloc_coherent(NULL, memsz, &dma_addr, 219 mem_addr = dma_alloc_coherent(NULL, memsz, &dma_addr,
225 GFP_KERNEL); 220 GFP_KERNEL);
@@ -234,6 +229,7 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con)
234 pinfo->dp_addr = dp_offset; 229 pinfo->dp_addr = dp_offset;
235 pinfo->mem_addr = mem_addr; 230 pinfo->mem_addr = mem_addr;
236 pinfo->dma_addr = dma_addr; 231 pinfo->dma_addr = dma_addr;
232 pinfo->mem_size = memsz;
237 233
238 pinfo->rx_buf = mem_addr; 234 pinfo->rx_buf = mem_addr;
239 pinfo->tx_buf = pinfo->rx_buf + L1_CACHE_ALIGN(pinfo->rx_nrfifos 235 pinfo->tx_buf = pinfo->rx_buf + L1_CACHE_ALIGN(pinfo->rx_nrfifos
diff --git a/drivers/serial/imx.c b/drivers/serial/imx.c
index c3b7a6673e9c..d202eb4f3848 100644
--- a/drivers/serial/imx.c
+++ b/drivers/serial/imx.c
@@ -45,6 +45,7 @@
45#include <asm/io.h> 45#include <asm/io.h>
46#include <asm/irq.h> 46#include <asm/irq.h>
47#include <asm/hardware.h> 47#include <asm/hardware.h>
48#include <asm/arch/imx-uart.h>
48 49
49/* We've been assigned a range on the "Low-density serial ports" major */ 50/* We've been assigned a range on the "Low-density serial ports" major */
50#define SERIAL_IMX_MAJOR 204 51#define SERIAL_IMX_MAJOR 204
@@ -73,7 +74,8 @@ struct imx_port {
73 struct uart_port port; 74 struct uart_port port;
74 struct timer_list timer; 75 struct timer_list timer;
75 unsigned int old_status; 76 unsigned int old_status;
76 int txirq,rxirq,rtsirq; 77 int txirq,rxirq,rtsirq;
78 int have_rtscts:1;
77}; 79};
78 80
79/* 81/*
@@ -491,8 +493,12 @@ imx_set_termios(struct uart_port *port, struct termios *termios,
491 ucr2 = UCR2_SRST | UCR2_IRTS; 493 ucr2 = UCR2_SRST | UCR2_IRTS;
492 494
493 if (termios->c_cflag & CRTSCTS) { 495 if (termios->c_cflag & CRTSCTS) {
494 ucr2 &= ~UCR2_IRTS; 496 if( sport->have_rtscts ) {
495 ucr2 |= UCR2_CTSC; 497 ucr2 &= ~UCR2_IRTS;
498 ucr2 |= UCR2_CTSC;
499 } else {
500 termios->c_cflag &= ~CRTSCTS;
501 }
496 } 502 }
497 503
498 if (termios->c_cflag & CSTOPB) 504 if (termios->c_cflag & CSTOPB)
@@ -719,27 +725,6 @@ static void __init imx_init_ports(void)
719 imx_ports[i].timer.function = imx_timeout; 725 imx_ports[i].timer.function = imx_timeout;
720 imx_ports[i].timer.data = (unsigned long)&imx_ports[i]; 726 imx_ports[i].timer.data = (unsigned long)&imx_ports[i];
721 } 727 }
722
723 imx_gpio_mode(PC9_PF_UART1_CTS);
724 imx_gpio_mode(PC10_PF_UART1_RTS);
725 imx_gpio_mode(PC11_PF_UART1_TXD);
726 imx_gpio_mode(PC12_PF_UART1_RXD);
727 imx_gpio_mode(PB28_PF_UART2_CTS);
728 imx_gpio_mode(PB29_PF_UART2_RTS);
729
730 imx_gpio_mode(PB30_PF_UART2_TXD);
731 imx_gpio_mode(PB31_PF_UART2_RXD);
732
733#if 0 /* We don't need these, on the mx1 the _modem_ side of the uart
734 * is implemented.
735 */
736 imx_gpio_mode(PD7_AF_UART2_DTR);
737 imx_gpio_mode(PD8_AF_UART2_DCD);
738 imx_gpio_mode(PD9_AF_UART2_RI);
739 imx_gpio_mode(PD10_AF_UART2_DSR);
740#endif
741
742
743} 728}
744 729
745#ifdef CONFIG_SERIAL_IMX_CONSOLE 730#ifdef CONFIG_SERIAL_IMX_CONSOLE
@@ -932,7 +917,14 @@ static int serial_imx_resume(struct platform_device *dev)
932 917
933static int serial_imx_probe(struct platform_device *dev) 918static int serial_imx_probe(struct platform_device *dev)
934{ 919{
920 struct imxuart_platform_data *pdata;
921
935 imx_ports[dev->id].port.dev = &dev->dev; 922 imx_ports[dev->id].port.dev = &dev->dev;
923
924 pdata = (struct imxuart_platform_data *)dev->dev.platform_data;
925 if(pdata && (pdata->flags & IMXUART_HAVE_RTSCTS))
926 imx_ports[dev->id].have_rtscts = 1;
927
936 uart_add_one_port(&imx_reg, &imx_ports[dev->id].port); 928 uart_add_one_port(&imx_reg, &imx_ports[dev->id].port);
937 platform_set_drvdata(dev, &imx_ports[dev->id]); 929 platform_set_drvdata(dev, &imx_ports[dev->id]);
938 return 0; 930 return 0;
diff --git a/drivers/serial/m32r_sio.c b/drivers/serial/m32r_sio.c
index e9c10c0a30fc..321a40f33b50 100644
--- a/drivers/serial/m32r_sio.c
+++ b/drivers/serial/m32r_sio.c
@@ -1057,7 +1057,6 @@ static void m32r_sio_console_write(struct console *co, const char *s,
1057{ 1057{
1058 struct uart_sio_port *up = &m32r_sio_ports[co->index]; 1058 struct uart_sio_port *up = &m32r_sio_ports[co->index];
1059 unsigned int ier; 1059 unsigned int ier;
1060 int i;
1061 1060
1062 /* 1061 /*
1063 * First save the UER then disable the interrupts 1062 * First save the UER then disable the interrupts
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c
index fcd7744c4253..17839e753e4c 100644
--- a/drivers/serial/serial_core.c
+++ b/drivers/serial/serial_core.c
@@ -1500,20 +1500,18 @@ uart_block_til_ready(struct file *filp, struct uart_state *state)
1500static struct uart_state *uart_get(struct uart_driver *drv, int line) 1500static struct uart_state *uart_get(struct uart_driver *drv, int line)
1501{ 1501{
1502 struct uart_state *state; 1502 struct uart_state *state;
1503 int ret = 0;
1503 1504
1504 mutex_lock(&port_mutex);
1505 state = drv->state + line; 1505 state = drv->state + line;
1506 if (mutex_lock_interruptible(&state->mutex)) { 1506 if (mutex_lock_interruptible(&state->mutex)) {
1507 state = ERR_PTR(-ERESTARTSYS); 1507 ret = -ERESTARTSYS;
1508 goto out; 1508 goto err;
1509 } 1509 }
1510 1510
1511 state->count++; 1511 state->count++;
1512 if (!state->port) { 1512 if (!state->port || state->port->flags & UPF_DEAD) {
1513 state->count--; 1513 ret = -ENXIO;
1514 mutex_unlock(&state->mutex); 1514 goto err_unlock;
1515 state = ERR_PTR(-ENXIO);
1516 goto out;
1517 } 1515 }
1518 1516
1519 if (!state->info) { 1517 if (!state->info) {
@@ -1531,15 +1529,17 @@ static struct uart_state *uart_get(struct uart_driver *drv, int line)
1531 tasklet_init(&state->info->tlet, uart_tasklet_action, 1529 tasklet_init(&state->info->tlet, uart_tasklet_action,
1532 (unsigned long)state); 1530 (unsigned long)state);
1533 } else { 1531 } else {
1534 state->count--; 1532 ret = -ENOMEM;
1535 mutex_unlock(&state->mutex); 1533 goto err_unlock;
1536 state = ERR_PTR(-ENOMEM);
1537 } 1534 }
1538 } 1535 }
1539
1540 out:
1541 mutex_unlock(&port_mutex);
1542 return state; 1536 return state;
1537
1538 err_unlock:
1539 state->count--;
1540 mutex_unlock(&state->mutex);
1541 err:
1542 return ERR_PTR(ret);
1543} 1543}
1544 1544
1545/* 1545/*
@@ -1907,9 +1907,12 @@ uart_set_options(struct uart_port *port, struct console *co,
1907static void uart_change_pm(struct uart_state *state, int pm_state) 1907static void uart_change_pm(struct uart_state *state, int pm_state)
1908{ 1908{
1909 struct uart_port *port = state->port; 1909 struct uart_port *port = state->port;
1910 if (port->ops->pm) 1910
1911 port->ops->pm(port, pm_state, state->pm_state); 1911 if (state->pm_state != pm_state) {
1912 state->pm_state = pm_state; 1912 if (port->ops->pm)
1913 port->ops->pm(port, pm_state, state->pm_state);
1914 state->pm_state = pm_state;
1915 }
1913} 1916}
1914 1917
1915int uart_suspend_port(struct uart_driver *drv, struct uart_port *port) 1918int uart_suspend_port(struct uart_driver *drv, struct uart_port *port)
@@ -2085,45 +2088,6 @@ uart_configure_port(struct uart_driver *drv, struct uart_state *state,
2085 } 2088 }
2086} 2089}
2087 2090
2088/*
2089 * This reverses the effects of uart_configure_port, hanging up the
2090 * port before removal.
2091 */
2092static void
2093uart_unconfigure_port(struct uart_driver *drv, struct uart_state *state)
2094{
2095 struct uart_port *port = state->port;
2096 struct uart_info *info = state->info;
2097
2098 if (info && info->tty)
2099 tty_vhangup(info->tty);
2100
2101 mutex_lock(&state->mutex);
2102
2103 state->info = NULL;
2104
2105 /*
2106 * Free the port IO and memory resources, if any.
2107 */
2108 if (port->type != PORT_UNKNOWN)
2109 port->ops->release_port(port);
2110
2111 /*
2112 * Indicate that there isn't a port here anymore.
2113 */
2114 port->type = PORT_UNKNOWN;
2115
2116 /*
2117 * Kill the tasklet, and free resources.
2118 */
2119 if (info) {
2120 tasklet_kill(&info->tlet);
2121 kfree(info);
2122 }
2123
2124 mutex_unlock(&state->mutex);
2125}
2126
2127static struct tty_operations uart_ops = { 2091static struct tty_operations uart_ops = {
2128 .open = uart_open, 2092 .open = uart_open,
2129 .close = uart_close, 2093 .close = uart_close,
@@ -2270,6 +2234,7 @@ int uart_add_one_port(struct uart_driver *drv, struct uart_port *port)
2270 state = drv->state + port->line; 2234 state = drv->state + port->line;
2271 2235
2272 mutex_lock(&port_mutex); 2236 mutex_lock(&port_mutex);
2237 mutex_lock(&state->mutex);
2273 if (state->port) { 2238 if (state->port) {
2274 ret = -EINVAL; 2239 ret = -EINVAL;
2275 goto out; 2240 goto out;
@@ -2304,7 +2269,13 @@ int uart_add_one_port(struct uart_driver *drv, struct uart_port *port)
2304 port->cons && !(port->cons->flags & CON_ENABLED)) 2269 port->cons && !(port->cons->flags & CON_ENABLED))
2305 register_console(port->cons); 2270 register_console(port->cons);
2306 2271
2272 /*
2273 * Ensure UPF_DEAD is not set.
2274 */
2275 port->flags &= ~UPF_DEAD;
2276
2307 out: 2277 out:
2278 mutex_unlock(&state->mutex);
2308 mutex_unlock(&port_mutex); 2279 mutex_unlock(&port_mutex);
2309 2280
2310 return ret; 2281 return ret;
@@ -2322,6 +2293,7 @@ int uart_add_one_port(struct uart_driver *drv, struct uart_port *port)
2322int uart_remove_one_port(struct uart_driver *drv, struct uart_port *port) 2293int uart_remove_one_port(struct uart_driver *drv, struct uart_port *port)
2323{ 2294{
2324 struct uart_state *state = drv->state + port->line; 2295 struct uart_state *state = drv->state + port->line;
2296 struct uart_info *info;
2325 2297
2326 BUG_ON(in_interrupt()); 2298 BUG_ON(in_interrupt());
2327 2299
@@ -2332,11 +2304,48 @@ int uart_remove_one_port(struct uart_driver *drv, struct uart_port *port)
2332 mutex_lock(&port_mutex); 2304 mutex_lock(&port_mutex);
2333 2305
2334 /* 2306 /*
2307 * Mark the port "dead" - this prevents any opens from
2308 * succeeding while we shut down the port.
2309 */
2310 mutex_lock(&state->mutex);
2311 port->flags |= UPF_DEAD;
2312 mutex_unlock(&state->mutex);
2313
2314 /*
2335 * Remove the devices from devfs 2315 * Remove the devices from devfs
2336 */ 2316 */
2337 tty_unregister_device(drv->tty_driver, port->line); 2317 tty_unregister_device(drv->tty_driver, port->line);
2338 2318
2339 uart_unconfigure_port(drv, state); 2319 info = state->info;
2320 if (info && info->tty)
2321 tty_vhangup(info->tty);
2322
2323 /*
2324 * All users of this port should now be disconnected from
2325 * this driver, and the port shut down. We should be the
2326 * only thread fiddling with this port from now on.
2327 */
2328 state->info = NULL;
2329
2330 /*
2331 * Free the port IO and memory resources, if any.
2332 */
2333 if (port->type != PORT_UNKNOWN)
2334 port->ops->release_port(port);
2335
2336 /*
2337 * Indicate that there isn't a port here anymore.
2338 */
2339 port->type = PORT_UNKNOWN;
2340
2341 /*
2342 * Kill the tasklet, and free resources.
2343 */
2344 if (info) {
2345 tasklet_kill(&info->tlet);
2346 kfree(info);
2347 }
2348
2340 state->port = NULL; 2349 state->port = NULL;
2341 mutex_unlock(&port_mutex); 2350 mutex_unlock(&port_mutex);
2342 2351
diff --git a/drivers/serial/sunsu.c b/drivers/serial/sunsu.c
index 1c4396c2962d..2b4f96541b8e 100644
--- a/drivers/serial/sunsu.c
+++ b/drivers/serial/sunsu.c
@@ -1730,3 +1730,4 @@ static void __exit sunsu_exit(void)
1730 1730
1731module_init(sunsu_probe); 1731module_init(sunsu_probe);
1732module_exit(sunsu_exit); 1732module_exit(sunsu_exit);
1733MODULE_LICENSE("GPL");
diff --git a/drivers/sn/ioc3.c b/drivers/sn/ioc3.c
index 0b49ff78efc1..501316b198e5 100644
--- a/drivers/sn/ioc3.c
+++ b/drivers/sn/ioc3.c
@@ -678,7 +678,7 @@ static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id)
678 /* Track PCI-device specific data */ 678 /* Track PCI-device specific data */
679 pci_set_drvdata(pdev, idd); 679 pci_set_drvdata(pdev, idd);
680 down_write(&ioc3_devices_rwsem); 680 down_write(&ioc3_devices_rwsem);
681 list_add(&idd->list, &ioc3_devices); 681 list_add_tail(&idd->list, &ioc3_devices);
682 idd->id = ioc3_counter++; 682 idd->id = ioc3_counter++;
683 up_write(&ioc3_devices_rwsem); 683 up_write(&ioc3_devices_rwsem);
684 684
diff --git a/drivers/sn/ioc4.c b/drivers/sn/ioc4.c
index 67140a5804f5..cdeff909403e 100644
--- a/drivers/sn/ioc4.c
+++ b/drivers/sn/ioc4.c
@@ -310,7 +310,7 @@ ioc4_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id)
310 pci_set_drvdata(idd->idd_pdev, idd); 310 pci_set_drvdata(idd->idd_pdev, idd);
311 311
312 mutex_lock(&ioc4_mutex); 312 mutex_lock(&ioc4_mutex);
313 list_add(&idd->idd_list, &ioc4_devices); 313 list_add_tail(&idd->idd_list, &ioc4_devices);
314 314
315 /* Add this IOC4 to all submodules */ 315 /* Add this IOC4 to all submodules */
316 list_for_each_entry(is, &ioc4_submodules, is_list) { 316 list_for_each_entry(is, &ioc4_submodules, is_list) {
diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
index 7a75faeb0526..23334c8bc4c7 100644
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -75,11 +75,45 @@ config SPI_BUTTERFLY
75 inexpensive battery powered microcontroller evaluation board. 75 inexpensive battery powered microcontroller evaluation board.
76 This same cable can be used to flash new firmware. 76 This same cable can be used to flash new firmware.
77 77
78config SPI_MPC83xx
79 tristate "Freescale MPC83xx SPI controller"
80 depends on SPI_MASTER && PPC_83xx && EXPERIMENTAL
81 select SPI_BITBANG
82 help
83 This enables using the Freescale MPC83xx SPI controller in master
84 mode.
85
86 Note, this driver uniquely supports the SPI controller on the MPC83xx
87 family of PowerPC processors. The MPC83xx uses a simple set of shift
88 registers for data (opposed to the CPM based descriptor model).
89
90config SPI_PXA2XX
91 tristate "PXA2xx SSP SPI master"
92 depends on SPI_MASTER && ARCH_PXA && EXPERIMENTAL
93 help
94 This enables using a PXA2xx SSP port as a SPI master controller.
95 The driver can be configured to use any SSP port and additional
96 documentation can be found a Documentation/spi/pxa2xx.
97
98config SPI_S3C24XX_GPIO
99 tristate "Samsung S3C24XX series SPI by GPIO"
100 depends on SPI_MASTER && ARCH_S3C2410 && SPI_BITBANG && EXPERIMENTAL
101 help
102 SPI driver for Samsung S3C24XX series ARM SoCs using
103 GPIO lines to provide the SPI bus. This can be used where
104 the inbuilt hardware cannot provide the transfer mode, or
105 where the board is using non hardware connected pins.
78# 106#
79# Add new SPI master controllers in alphabetical order above this line 107# Add new SPI master controllers in alphabetical order above this line
80# 108#
81 109
82 110
111config SPI_S3C24XX
112 tristate "Samsung S3C24XX series SPI"
113 depends on SPI_MASTER && ARCH_S3C2410 && EXPERIMENTAL
114 help
115 SPI driver for Samsung S3C24XX series ARM SoCs
116
83# 117#
84# There are lots of SPI device types, with sensors and memory 118# There are lots of SPI device types, with sensors and memory
85# being probably the most widely used ones. 119# being probably the most widely used ones.
diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile
index c2c87e845abf..8f4cb67997b3 100644
--- a/drivers/spi/Makefile
+++ b/drivers/spi/Makefile
@@ -13,6 +13,10 @@ obj-$(CONFIG_SPI_MASTER) += spi.o
13# SPI master controller drivers (bus) 13# SPI master controller drivers (bus)
14obj-$(CONFIG_SPI_BITBANG) += spi_bitbang.o 14obj-$(CONFIG_SPI_BITBANG) += spi_bitbang.o
15obj-$(CONFIG_SPI_BUTTERFLY) += spi_butterfly.o 15obj-$(CONFIG_SPI_BUTTERFLY) += spi_butterfly.o
16obj-$(CONFIG_SPI_PXA2XX) += pxa2xx_spi.o
17obj-$(CONFIG_SPI_MPC83xx) += spi_mpc83xx.o
18obj-$(CONFIG_SPI_S3C24XX_GPIO) += spi_s3c24xx_gpio.o
19obj-$(CONFIG_SPI_S3C24XX) += spi_s3c24xx.o
16# ... add above this line ... 20# ... add above this line ...
17 21
18# SPI protocol drivers (device/link on bus) 22# SPI protocol drivers (device/link on bus)
diff --git a/drivers/spi/pxa2xx_spi.c b/drivers/spi/pxa2xx_spi.c
new file mode 100644
index 000000000000..29aec77f98be
--- /dev/null
+++ b/drivers/spi/pxa2xx_spi.c
@@ -0,0 +1,1486 @@
1/*
2 * Copyright (C) 2005 Stephen Street / StreetFire Sound Labs
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 */
18
19#include <linux/init.h>
20#include <linux/module.h>
21#include <linux/device.h>
22#include <linux/ioport.h>
23#include <linux/errno.h>
24#include <linux/interrupt.h>
25#include <linux/platform_device.h>
26#include <linux/dma-mapping.h>
27#include <linux/spi/spi.h>
28#include <linux/workqueue.h>
29#include <linux/errno.h>
30#include <linux/delay.h>
31
32#include <asm/io.h>
33#include <asm/irq.h>
34#include <asm/hardware.h>
35#include <asm/delay.h>
36#include <asm/dma.h>
37
38#include <asm/arch/hardware.h>
39#include <asm/arch/pxa-regs.h>
40#include <asm/arch/pxa2xx_spi.h>
41
42MODULE_AUTHOR("Stephen Street");
43MODULE_DESCRIPTION("PXA2xx SSP SPI Contoller");
44MODULE_LICENSE("GPL");
45
46#define MAX_BUSES 3
47
48#define DMA_INT_MASK (DCSR_ENDINTR | DCSR_STARTINTR | DCSR_BUSERR)
49#define RESET_DMA_CHANNEL (DCSR_NODESC | DMA_INT_MASK)
50#define IS_DMA_ALIGNED(x) (((u32)(x)&0x07)==0)
51
52#define DEFINE_SSP_REG(reg, off) \
53static inline u32 read_##reg(void *p) { return __raw_readl(p + (off)); } \
54static inline void write_##reg(u32 v, void *p) { __raw_writel(v, p + (off)); }
55
56DEFINE_SSP_REG(SSCR0, 0x00)
57DEFINE_SSP_REG(SSCR1, 0x04)
58DEFINE_SSP_REG(SSSR, 0x08)
59DEFINE_SSP_REG(SSITR, 0x0c)
60DEFINE_SSP_REG(SSDR, 0x10)
61DEFINE_SSP_REG(SSTO, 0x28)
62DEFINE_SSP_REG(SSPSP, 0x2c)
63
64#define START_STATE ((void*)0)
65#define RUNNING_STATE ((void*)1)
66#define DONE_STATE ((void*)2)
67#define ERROR_STATE ((void*)-1)
68
69#define QUEUE_RUNNING 0
70#define QUEUE_STOPPED 1
71
72struct driver_data {
73 /* Driver model hookup */
74 struct platform_device *pdev;
75
76 /* SPI framework hookup */
77 enum pxa_ssp_type ssp_type;
78 struct spi_master *master;
79
80 /* PXA hookup */
81 struct pxa2xx_spi_master *master_info;
82
83 /* DMA setup stuff */
84 int rx_channel;
85 int tx_channel;
86 u32 *null_dma_buf;
87
88 /* SSP register addresses */
89 void *ioaddr;
90 u32 ssdr_physical;
91
92 /* SSP masks*/
93 u32 dma_cr1;
94 u32 int_cr1;
95 u32 clear_sr;
96 u32 mask_sr;
97
98 /* Driver message queue */
99 struct workqueue_struct *workqueue;
100 struct work_struct pump_messages;
101 spinlock_t lock;
102 struct list_head queue;
103 int busy;
104 int run;
105
106 /* Message Transfer pump */
107 struct tasklet_struct pump_transfers;
108
109 /* Current message transfer state info */
110 struct spi_message* cur_msg;
111 struct spi_transfer* cur_transfer;
112 struct chip_data *cur_chip;
113 size_t len;
114 void *tx;
115 void *tx_end;
116 void *rx;
117 void *rx_end;
118 int dma_mapped;
119 dma_addr_t rx_dma;
120 dma_addr_t tx_dma;
121 size_t rx_map_len;
122 size_t tx_map_len;
123 u8 n_bytes;
124 u32 dma_width;
125 int cs_change;
126 void (*write)(struct driver_data *drv_data);
127 void (*read)(struct driver_data *drv_data);
128 irqreturn_t (*transfer_handler)(struct driver_data *drv_data);
129 void (*cs_control)(u32 command);
130};
131
132struct chip_data {
133 u32 cr0;
134 u32 cr1;
135 u32 to;
136 u32 psp;
137 u32 timeout;
138 u8 n_bytes;
139 u32 dma_width;
140 u32 dma_burst_size;
141 u32 threshold;
142 u32 dma_threshold;
143 u8 enable_dma;
144 u8 bits_per_word;
145 u32 speed_hz;
146 void (*write)(struct driver_data *drv_data);
147 void (*read)(struct driver_data *drv_data);
148 void (*cs_control)(u32 command);
149};
150
151static void pump_messages(void *data);
152
153static int flush(struct driver_data *drv_data)
154{
155 unsigned long limit = loops_per_jiffy << 1;
156
157 void *reg = drv_data->ioaddr;
158
159 do {
160 while (read_SSSR(reg) & SSSR_RNE) {
161 read_SSDR(reg);
162 }
163 } while ((read_SSSR(reg) & SSSR_BSY) && limit--);
164 write_SSSR(SSSR_ROR, reg);
165
166 return limit;
167}
168
169static void restore_state(struct driver_data *drv_data)
170{
171 void *reg = drv_data->ioaddr;
172
173 /* Clear status and disable clock */
174 write_SSSR(drv_data->clear_sr, reg);
175 write_SSCR0(drv_data->cur_chip->cr0 & ~SSCR0_SSE, reg);
176
177 /* Load the registers */
178 write_SSCR1(drv_data->cur_chip->cr1, reg);
179 write_SSCR0(drv_data->cur_chip->cr0, reg);
180 if (drv_data->ssp_type != PXA25x_SSP) {
181 write_SSTO(0, reg);
182 write_SSPSP(drv_data->cur_chip->psp, reg);
183 }
184}
185
186static void null_cs_control(u32 command)
187{
188}
189
190static void null_writer(struct driver_data *drv_data)
191{
192 void *reg = drv_data->ioaddr;
193 u8 n_bytes = drv_data->n_bytes;
194
195 while ((read_SSSR(reg) & SSSR_TNF)
196 && (drv_data->tx < drv_data->tx_end)) {
197 write_SSDR(0, reg);
198 drv_data->tx += n_bytes;
199 }
200}
201
202static void null_reader(struct driver_data *drv_data)
203{
204 void *reg = drv_data->ioaddr;
205 u8 n_bytes = drv_data->n_bytes;
206
207 while ((read_SSSR(reg) & SSSR_RNE)
208 && (drv_data->rx < drv_data->rx_end)) {
209 read_SSDR(reg);
210 drv_data->rx += n_bytes;
211 }
212}
213
214static void u8_writer(struct driver_data *drv_data)
215{
216 void *reg = drv_data->ioaddr;
217
218 while ((read_SSSR(reg) & SSSR_TNF)
219 && (drv_data->tx < drv_data->tx_end)) {
220 write_SSDR(*(u8 *)(drv_data->tx), reg);
221 ++drv_data->tx;
222 }
223}
224
225static void u8_reader(struct driver_data *drv_data)
226{
227 void *reg = drv_data->ioaddr;
228
229 while ((read_SSSR(reg) & SSSR_RNE)
230 && (drv_data->rx < drv_data->rx_end)) {
231 *(u8 *)(drv_data->rx) = read_SSDR(reg);
232 ++drv_data->rx;
233 }
234}
235
236static void u16_writer(struct driver_data *drv_data)
237{
238 void *reg = drv_data->ioaddr;
239
240 while ((read_SSSR(reg) & SSSR_TNF)
241 && (drv_data->tx < drv_data->tx_end)) {
242 write_SSDR(*(u16 *)(drv_data->tx), reg);
243 drv_data->tx += 2;
244 }
245}
246
247static void u16_reader(struct driver_data *drv_data)
248{
249 void *reg = drv_data->ioaddr;
250
251 while ((read_SSSR(reg) & SSSR_RNE)
252 && (drv_data->rx < drv_data->rx_end)) {
253 *(u16 *)(drv_data->rx) = read_SSDR(reg);
254 drv_data->rx += 2;
255 }
256}
257static void u32_writer(struct driver_data *drv_data)
258{
259 void *reg = drv_data->ioaddr;
260
261 while ((read_SSSR(reg) & SSSR_TNF)
262 && (drv_data->tx < drv_data->tx_end)) {
263 write_SSDR(*(u32 *)(drv_data->tx), reg);
264 drv_data->tx += 4;
265 }
266}
267
268static void u32_reader(struct driver_data *drv_data)
269{
270 void *reg = drv_data->ioaddr;
271
272 while ((read_SSSR(reg) & SSSR_RNE)
273 && (drv_data->rx < drv_data->rx_end)) {
274 *(u32 *)(drv_data->rx) = read_SSDR(reg);
275 drv_data->rx += 4;
276 }
277}
278
279static void *next_transfer(struct driver_data *drv_data)
280{
281 struct spi_message *msg = drv_data->cur_msg;
282 struct spi_transfer *trans = drv_data->cur_transfer;
283
284 /* Move to next transfer */
285 if (trans->transfer_list.next != &msg->transfers) {
286 drv_data->cur_transfer =
287 list_entry(trans->transfer_list.next,
288 struct spi_transfer,
289 transfer_list);
290 return RUNNING_STATE;
291 } else
292 return DONE_STATE;
293}
294
295static int map_dma_buffers(struct driver_data *drv_data)
296{
297 struct spi_message *msg = drv_data->cur_msg;
298 struct device *dev = &msg->spi->dev;
299
300 if (!drv_data->cur_chip->enable_dma)
301 return 0;
302
303 if (msg->is_dma_mapped)
304 return drv_data->rx_dma && drv_data->tx_dma;
305
306 if (!IS_DMA_ALIGNED(drv_data->rx) || !IS_DMA_ALIGNED(drv_data->tx))
307 return 0;
308
309 /* Modify setup if rx buffer is null */
310 if (drv_data->rx == NULL) {
311 *drv_data->null_dma_buf = 0;
312 drv_data->rx = drv_data->null_dma_buf;
313 drv_data->rx_map_len = 4;
314 } else
315 drv_data->rx_map_len = drv_data->len;
316
317
318 /* Modify setup if tx buffer is null */
319 if (drv_data->tx == NULL) {
320 *drv_data->null_dma_buf = 0;
321 drv_data->tx = drv_data->null_dma_buf;
322 drv_data->tx_map_len = 4;
323 } else
324 drv_data->tx_map_len = drv_data->len;
325
326 /* Stream map the rx buffer */
327 drv_data->rx_dma = dma_map_single(dev, drv_data->rx,
328 drv_data->rx_map_len,
329 DMA_FROM_DEVICE);
330 if (dma_mapping_error(drv_data->rx_dma))
331 return 0;
332
333 /* Stream map the tx buffer */
334 drv_data->tx_dma = dma_map_single(dev, drv_data->tx,
335 drv_data->tx_map_len,
336 DMA_TO_DEVICE);
337
338 if (dma_mapping_error(drv_data->tx_dma)) {
339 dma_unmap_single(dev, drv_data->rx_dma,
340 drv_data->rx_map_len, DMA_FROM_DEVICE);
341 return 0;
342 }
343
344 return 1;
345}
346
347static void unmap_dma_buffers(struct driver_data *drv_data)
348{
349 struct device *dev;
350
351 if (!drv_data->dma_mapped)
352 return;
353
354 if (!drv_data->cur_msg->is_dma_mapped) {
355 dev = &drv_data->cur_msg->spi->dev;
356 dma_unmap_single(dev, drv_data->rx_dma,
357 drv_data->rx_map_len, DMA_FROM_DEVICE);
358 dma_unmap_single(dev, drv_data->tx_dma,
359 drv_data->tx_map_len, DMA_TO_DEVICE);
360 }
361
362 drv_data->dma_mapped = 0;
363}
364
365/* caller already set message->status; dma and pio irqs are blocked */
366static void giveback(struct driver_data *drv_data)
367{
368 struct spi_transfer* last_transfer;
369 unsigned long flags;
370 struct spi_message *msg;
371
372 spin_lock_irqsave(&drv_data->lock, flags);
373 msg = drv_data->cur_msg;
374 drv_data->cur_msg = NULL;
375 drv_data->cur_transfer = NULL;
376 drv_data->cur_chip = NULL;
377 queue_work(drv_data->workqueue, &drv_data->pump_messages);
378 spin_unlock_irqrestore(&drv_data->lock, flags);
379
380 last_transfer = list_entry(msg->transfers.prev,
381 struct spi_transfer,
382 transfer_list);
383
384 if (!last_transfer->cs_change)
385 drv_data->cs_control(PXA2XX_CS_DEASSERT);
386
387 msg->state = NULL;
388 if (msg->complete)
389 msg->complete(msg->context);
390}
391
392static int wait_ssp_rx_stall(void *ioaddr)
393{
394 unsigned long limit = loops_per_jiffy << 1;
395
396 while ((read_SSSR(ioaddr) & SSSR_BSY) && limit--)
397 cpu_relax();
398
399 return limit;
400}
401
402static int wait_dma_channel_stop(int channel)
403{
404 unsigned long limit = loops_per_jiffy << 1;
405
406 while (!(DCSR(channel) & DCSR_STOPSTATE) && limit--)
407 cpu_relax();
408
409 return limit;
410}
411
412static void dma_handler(int channel, void *data, struct pt_regs *regs)
413{
414 struct driver_data *drv_data = data;
415 struct spi_message *msg = drv_data->cur_msg;
416 void *reg = drv_data->ioaddr;
417 u32 irq_status = DCSR(channel) & DMA_INT_MASK;
418 u32 trailing_sssr = 0;
419
420 if (irq_status & DCSR_BUSERR) {
421
422 /* Disable interrupts, clear status and reset DMA */
423 write_SSCR0(read_SSCR0(reg) & ~SSCR0_SSE, reg);
424 write_SSCR1(read_SSCR1(reg) & ~drv_data->dma_cr1, reg);
425 if (drv_data->ssp_type != PXA25x_SSP)
426 write_SSTO(0, reg);
427 write_SSSR(drv_data->clear_sr, reg);
428 DCSR(drv_data->rx_channel) = RESET_DMA_CHANNEL;
429 DCSR(drv_data->tx_channel) = RESET_DMA_CHANNEL;
430
431 if (flush(drv_data) == 0)
432 dev_err(&drv_data->pdev->dev,
433 "dma_handler: flush fail\n");
434
435 unmap_dma_buffers(drv_data);
436
437 if (channel == drv_data->tx_channel)
438 dev_err(&drv_data->pdev->dev,
439 "dma_handler: bad bus address on "
440 "tx channel %d, source %x target = %x\n",
441 channel, DSADR(channel), DTADR(channel));
442 else
443 dev_err(&drv_data->pdev->dev,
444 "dma_handler: bad bus address on "
445 "rx channel %d, source %x target = %x\n",
446 channel, DSADR(channel), DTADR(channel));
447
448 msg->state = ERROR_STATE;
449 tasklet_schedule(&drv_data->pump_transfers);
450 }
451
452 /* PXA255x_SSP has no timeout interrupt, wait for tailing bytes */
453 if ((drv_data->ssp_type == PXA25x_SSP)
454 && (channel == drv_data->tx_channel)
455 && (irq_status & DCSR_ENDINTR)) {
456
457 /* Wait for rx to stall */
458 if (wait_ssp_rx_stall(drv_data->ioaddr) == 0)
459 dev_err(&drv_data->pdev->dev,
460 "dma_handler: ssp rx stall failed\n");
461
462 /* Clear and disable interrupts on SSP and DMA channels*/
463 write_SSCR1(read_SSCR1(reg) & ~drv_data->dma_cr1, reg);
464 write_SSSR(drv_data->clear_sr, reg);
465 DCSR(drv_data->tx_channel) = RESET_DMA_CHANNEL;
466 DCSR(drv_data->rx_channel) = RESET_DMA_CHANNEL;
467 if (wait_dma_channel_stop(drv_data->rx_channel) == 0)
468 dev_err(&drv_data->pdev->dev,
469 "dma_handler: dma rx channel stop failed\n");
470
471 unmap_dma_buffers(drv_data);
472
473 /* Read trailing bytes */
474 /* Calculate number of trailing bytes, read them */
475 trailing_sssr = read_SSSR(reg);
476 if ((trailing_sssr & 0xf008) != 0xf000) {
477 drv_data->rx = drv_data->rx_end -
478 (((trailing_sssr >> 12) & 0x0f) + 1);
479 drv_data->read(drv_data);
480 }
481 msg->actual_length += drv_data->len;
482
483 /* Release chip select if requested, transfer delays are
484 * handled in pump_transfers */
485 if (drv_data->cs_change)
486 drv_data->cs_control(PXA2XX_CS_DEASSERT);
487
488 /* Move to next transfer */
489 msg->state = next_transfer(drv_data);
490
491 /* Schedule transfer tasklet */
492 tasklet_schedule(&drv_data->pump_transfers);
493 }
494}
495
496static irqreturn_t dma_transfer(struct driver_data *drv_data)
497{
498 u32 irq_status;
499 u32 trailing_sssr = 0;
500 struct spi_message *msg = drv_data->cur_msg;
501 void *reg = drv_data->ioaddr;
502
503 irq_status = read_SSSR(reg) & drv_data->mask_sr;
504 if (irq_status & SSSR_ROR) {
505 /* Clear and disable interrupts on SSP and DMA channels*/
506 write_SSCR0(read_SSCR0(reg) & ~SSCR0_SSE, reg);
507 write_SSCR1(read_SSCR1(reg) & ~drv_data->dma_cr1, reg);
508 if (drv_data->ssp_type != PXA25x_SSP)
509 write_SSTO(0, reg);
510 write_SSSR(drv_data->clear_sr, reg);
511 DCSR(drv_data->tx_channel) = RESET_DMA_CHANNEL;
512 DCSR(drv_data->rx_channel) = RESET_DMA_CHANNEL;
513 unmap_dma_buffers(drv_data);
514
515 if (flush(drv_data) == 0)
516 dev_err(&drv_data->pdev->dev,
517 "dma_transfer: flush fail\n");
518
519 dev_warn(&drv_data->pdev->dev, "dma_transfer: fifo overun\n");
520
521 drv_data->cur_msg->state = ERROR_STATE;
522 tasklet_schedule(&drv_data->pump_transfers);
523
524 return IRQ_HANDLED;
525 }
526
527 /* Check for false positive timeout */
528 if ((irq_status & SSSR_TINT) && DCSR(drv_data->tx_channel) & DCSR_RUN) {
529 write_SSSR(SSSR_TINT, reg);
530 return IRQ_HANDLED;
531 }
532
533 if (irq_status & SSSR_TINT || drv_data->rx == drv_data->rx_end) {
534
535 /* Clear and disable interrupts on SSP and DMA channels*/
536 write_SSCR1(read_SSCR1(reg) & ~drv_data->dma_cr1, reg);
537 if (drv_data->ssp_type != PXA25x_SSP)
538 write_SSTO(0, reg);
539 write_SSSR(drv_data->clear_sr, reg);
540 DCSR(drv_data->tx_channel) = RESET_DMA_CHANNEL;
541 DCSR(drv_data->rx_channel) = RESET_DMA_CHANNEL;
542
543 if (wait_dma_channel_stop(drv_data->rx_channel) == 0)
544 dev_err(&drv_data->pdev->dev,
545 "dma_transfer: dma rx channel stop failed\n");
546
547 if (wait_ssp_rx_stall(drv_data->ioaddr) == 0)
548 dev_err(&drv_data->pdev->dev,
549 "dma_transfer: ssp rx stall failed\n");
550
551 unmap_dma_buffers(drv_data);
552
553 /* Calculate number of trailing bytes, read them */
554 trailing_sssr = read_SSSR(reg);
555 if ((trailing_sssr & 0xf008) != 0xf000) {
556 drv_data->rx = drv_data->rx_end -
557 (((trailing_sssr >> 12) & 0x0f) + 1);
558 drv_data->read(drv_data);
559 }
560 msg->actual_length += drv_data->len;
561
562 /* Release chip select if requested, transfer delays are
563 * handled in pump_transfers */
564 if (drv_data->cs_change)
565 drv_data->cs_control(PXA2XX_CS_DEASSERT);
566
567 /* Move to next transfer */
568 msg->state = next_transfer(drv_data);
569
570 /* Schedule transfer tasklet */
571 tasklet_schedule(&drv_data->pump_transfers);
572
573 return IRQ_HANDLED;
574 }
575
576 /* Opps problem detected */
577 return IRQ_NONE;
578}
579
580static irqreturn_t interrupt_transfer(struct driver_data *drv_data)
581{
582 struct spi_message *msg = drv_data->cur_msg;
583 void *reg = drv_data->ioaddr;
584 unsigned long limit = loops_per_jiffy << 1;
585 u32 irq_status;
586 u32 irq_mask = (read_SSCR1(reg) & SSCR1_TIE) ?
587 drv_data->mask_sr : drv_data->mask_sr & ~SSSR_TFS;
588
589 while ((irq_status = read_SSSR(reg) & irq_mask)) {
590
591 if (irq_status & SSSR_ROR) {
592
593 /* Clear and disable interrupts */
594 write_SSCR0(read_SSCR0(reg) & ~SSCR0_SSE, reg);
595 write_SSCR1(read_SSCR1(reg) & ~drv_data->int_cr1, reg);
596 if (drv_data->ssp_type != PXA25x_SSP)
597 write_SSTO(0, reg);
598 write_SSSR(drv_data->clear_sr, reg);
599
600 if (flush(drv_data) == 0)
601 dev_err(&drv_data->pdev->dev,
602 "interrupt_transfer: flush fail\n");
603
604 /* Stop the SSP */
605
606 dev_warn(&drv_data->pdev->dev,
607 "interrupt_transfer: fifo overun\n");
608
609 msg->state = ERROR_STATE;
610 tasklet_schedule(&drv_data->pump_transfers);
611
612 return IRQ_HANDLED;
613 }
614
615 /* Look for false positive timeout */
616 if ((irq_status & SSSR_TINT)
617 && (drv_data->rx < drv_data->rx_end))
618 write_SSSR(SSSR_TINT, reg);
619
620 /* Pump data */
621 drv_data->read(drv_data);
622 drv_data->write(drv_data);
623
624 if (drv_data->tx == drv_data->tx_end) {
625 /* Disable tx interrupt */
626 write_SSCR1(read_SSCR1(reg) & ~SSCR1_TIE, reg);
627 irq_mask = drv_data->mask_sr & ~SSSR_TFS;
628
629 /* PXA25x_SSP has no timeout, read trailing bytes */
630 if (drv_data->ssp_type == PXA25x_SSP) {
631 while ((read_SSSR(reg) & SSSR_BSY) && limit--)
632 drv_data->read(drv_data);
633
634 if (limit == 0)
635 dev_err(&drv_data->pdev->dev,
636 "interrupt_transfer: "
637 "trailing byte read failed\n");
638 }
639 }
640
641 if ((irq_status & SSSR_TINT)
642 || (drv_data->rx == drv_data->rx_end)) {
643
644 /* Clear timeout */
645 write_SSCR1(read_SSCR1(reg) & ~drv_data->int_cr1, reg);
646 if (drv_data->ssp_type != PXA25x_SSP)
647 write_SSTO(0, reg);
648 write_SSSR(drv_data->clear_sr, reg);
649
650 /* Update total byte transfered */
651 msg->actual_length += drv_data->len;
652
653 /* Release chip select if requested, transfer delays are
654 * handled in pump_transfers */
655 if (drv_data->cs_change)
656 drv_data->cs_control(PXA2XX_CS_DEASSERT);
657
658 /* Move to next transfer */
659 msg->state = next_transfer(drv_data);
660
661 /* Schedule transfer tasklet */
662 tasklet_schedule(&drv_data->pump_transfers);
663 }
664 }
665
666 /* We did something */
667 return IRQ_HANDLED;
668}
669
670static irqreturn_t ssp_int(int irq, void *dev_id, struct pt_regs *regs)
671{
672 struct driver_data *drv_data = (struct driver_data *)dev_id;
673 void *reg = drv_data->ioaddr;
674
675 if (!drv_data->cur_msg) {
676
677 write_SSCR0(read_SSCR0(reg) & ~SSCR0_SSE, reg);
678 write_SSCR1(read_SSCR1(reg) & ~drv_data->int_cr1, reg);
679 if (drv_data->ssp_type != PXA25x_SSP)
680 write_SSTO(0, reg);
681 write_SSSR(drv_data->clear_sr, reg);
682
683 dev_err(&drv_data->pdev->dev, "bad message state "
684 "in interrupt handler");
685
686 /* Never fail */
687 return IRQ_HANDLED;
688 }
689
690 return drv_data->transfer_handler(drv_data);
691}
692
693static void pump_transfers(unsigned long data)
694{
695 struct driver_data *drv_data = (struct driver_data *)data;
696 struct spi_message *message = NULL;
697 struct spi_transfer *transfer = NULL;
698 struct spi_transfer *previous = NULL;
699 struct chip_data *chip = NULL;
700 void *reg = drv_data->ioaddr;
701 u32 clk_div = 0;
702 u8 bits = 0;
703 u32 speed = 0;
704 u32 cr0;
705
706 /* Get current state information */
707 message = drv_data->cur_msg;
708 transfer = drv_data->cur_transfer;
709 chip = drv_data->cur_chip;
710
711 /* Handle for abort */
712 if (message->state == ERROR_STATE) {
713 message->status = -EIO;
714 giveback(drv_data);
715 return;
716 }
717
718 /* Handle end of message */
719 if (message->state == DONE_STATE) {
720 message->status = 0;
721 giveback(drv_data);
722 return;
723 }
724
725 /* Delay if requested at end of transfer*/
726 if (message->state == RUNNING_STATE) {
727 previous = list_entry(transfer->transfer_list.prev,
728 struct spi_transfer,
729 transfer_list);
730 if (previous->delay_usecs)
731 udelay(previous->delay_usecs);
732 }
733
734 /* Setup the transfer state based on the type of transfer */
735 if (flush(drv_data) == 0) {
736 dev_err(&drv_data->pdev->dev, "pump_transfers: flush failed\n");
737 message->status = -EIO;
738 giveback(drv_data);
739 return;
740 }
741 drv_data->n_bytes = chip->n_bytes;
742 drv_data->dma_width = chip->dma_width;
743 drv_data->cs_control = chip->cs_control;
744 drv_data->tx = (void *)transfer->tx_buf;
745 drv_data->tx_end = drv_data->tx + transfer->len;
746 drv_data->rx = transfer->rx_buf;
747 drv_data->rx_end = drv_data->rx + transfer->len;
748 drv_data->rx_dma = transfer->rx_dma;
749 drv_data->tx_dma = transfer->tx_dma;
750 drv_data->len = transfer->len;
751 drv_data->write = drv_data->tx ? chip->write : null_writer;
752 drv_data->read = drv_data->rx ? chip->read : null_reader;
753 drv_data->cs_change = transfer->cs_change;
754
755 /* Change speed and bit per word on a per transfer */
756 if (transfer->speed_hz || transfer->bits_per_word) {
757
758 /* Disable clock */
759 write_SSCR0(chip->cr0 & ~SSCR0_SSE, reg);
760 cr0 = chip->cr0;
761 bits = chip->bits_per_word;
762 speed = chip->speed_hz;
763
764 if (transfer->speed_hz)
765 speed = transfer->speed_hz;
766
767 if (transfer->bits_per_word)
768 bits = transfer->bits_per_word;
769
770 if (reg == SSP1_VIRT)
771 clk_div = SSP1_SerClkDiv(speed);
772 else if (reg == SSP2_VIRT)
773 clk_div = SSP2_SerClkDiv(speed);
774 else if (reg == SSP3_VIRT)
775 clk_div = SSP3_SerClkDiv(speed);
776
777 if (bits <= 8) {
778 drv_data->n_bytes = 1;
779 drv_data->dma_width = DCMD_WIDTH1;
780 drv_data->read = drv_data->read != null_reader ?
781 u8_reader : null_reader;
782 drv_data->write = drv_data->write != null_writer ?
783 u8_writer : null_writer;
784 } else if (bits <= 16) {
785 drv_data->n_bytes = 2;
786 drv_data->dma_width = DCMD_WIDTH2;
787 drv_data->read = drv_data->read != null_reader ?
788 u16_reader : null_reader;
789 drv_data->write = drv_data->write != null_writer ?
790 u16_writer : null_writer;
791 } else if (bits <= 32) {
792 drv_data->n_bytes = 4;
793 drv_data->dma_width = DCMD_WIDTH4;
794 drv_data->read = drv_data->read != null_reader ?
795 u32_reader : null_reader;
796 drv_data->write = drv_data->write != null_writer ?
797 u32_writer : null_writer;
798 }
799
800 cr0 = clk_div
801 | SSCR0_Motorola
802 | SSCR0_DataSize(bits > 16 ? bits - 16 : bits)
803 | SSCR0_SSE
804 | (bits > 16 ? SSCR0_EDSS : 0);
805
806 /* Start it back up */
807 write_SSCR0(cr0, reg);
808 }
809
810 message->state = RUNNING_STATE;
811
812 /* Try to map dma buffer and do a dma transfer if successful */
813 if ((drv_data->dma_mapped = map_dma_buffers(drv_data))) {
814
815 /* Ensure we have the correct interrupt handler */
816 drv_data->transfer_handler = dma_transfer;
817
818 /* Setup rx DMA Channel */
819 DCSR(drv_data->rx_channel) = RESET_DMA_CHANNEL;
820 DSADR(drv_data->rx_channel) = drv_data->ssdr_physical;
821 DTADR(drv_data->rx_channel) = drv_data->rx_dma;
822 if (drv_data->rx == drv_data->null_dma_buf)
823 /* No target address increment */
824 DCMD(drv_data->rx_channel) = DCMD_FLOWSRC
825 | drv_data->dma_width
826 | chip->dma_burst_size
827 | drv_data->len;
828 else
829 DCMD(drv_data->rx_channel) = DCMD_INCTRGADDR
830 | DCMD_FLOWSRC
831 | drv_data->dma_width
832 | chip->dma_burst_size
833 | drv_data->len;
834
835 /* Setup tx DMA Channel */
836 DCSR(drv_data->tx_channel) = RESET_DMA_CHANNEL;
837 DSADR(drv_data->tx_channel) = drv_data->tx_dma;
838 DTADR(drv_data->tx_channel) = drv_data->ssdr_physical;
839 if (drv_data->tx == drv_data->null_dma_buf)
840 /* No source address increment */
841 DCMD(drv_data->tx_channel) = DCMD_FLOWTRG
842 | drv_data->dma_width
843 | chip->dma_burst_size
844 | drv_data->len;
845 else
846 DCMD(drv_data->tx_channel) = DCMD_INCSRCADDR
847 | DCMD_FLOWTRG
848 | drv_data->dma_width
849 | chip->dma_burst_size
850 | drv_data->len;
851
852 /* Enable dma end irqs on SSP to detect end of transfer */
853 if (drv_data->ssp_type == PXA25x_SSP)
854 DCMD(drv_data->tx_channel) |= DCMD_ENDIRQEN;
855
856 /* Fix me, need to handle cs polarity */
857 drv_data->cs_control(PXA2XX_CS_ASSERT);
858
859 /* Go baby, go */
860 write_SSSR(drv_data->clear_sr, reg);
861 DCSR(drv_data->rx_channel) |= DCSR_RUN;
862 DCSR(drv_data->tx_channel) |= DCSR_RUN;
863 if (drv_data->ssp_type != PXA25x_SSP)
864 write_SSTO(chip->timeout, reg);
865 write_SSCR1(chip->cr1
866 | chip->dma_threshold
867 | drv_data->dma_cr1,
868 reg);
869 } else {
870 /* Ensure we have the correct interrupt handler */
871 drv_data->transfer_handler = interrupt_transfer;
872
873 /* Fix me, need to handle cs polarity */
874 drv_data->cs_control(PXA2XX_CS_ASSERT);
875
876 /* Go baby, go */
877 write_SSSR(drv_data->clear_sr, reg);
878 if (drv_data->ssp_type != PXA25x_SSP)
879 write_SSTO(chip->timeout, reg);
880 write_SSCR1(chip->cr1
881 | chip->threshold
882 | drv_data->int_cr1,
883 reg);
884 }
885}
886
887static void pump_messages(void *data)
888{
889 struct driver_data *drv_data = data;
890 unsigned long flags;
891
892 /* Lock queue and check for queue work */
893 spin_lock_irqsave(&drv_data->lock, flags);
894 if (list_empty(&drv_data->queue) || drv_data->run == QUEUE_STOPPED) {
895 drv_data->busy = 0;
896 spin_unlock_irqrestore(&drv_data->lock, flags);
897 return;
898 }
899
900 /* Make sure we are not already running a message */
901 if (drv_data->cur_msg) {
902 spin_unlock_irqrestore(&drv_data->lock, flags);
903 return;
904 }
905
906 /* Extract head of queue */
907 drv_data->cur_msg = list_entry(drv_data->queue.next,
908 struct spi_message, queue);
909 list_del_init(&drv_data->cur_msg->queue);
910
911 /* Initial message state*/
912 drv_data->cur_msg->state = START_STATE;
913 drv_data->cur_transfer = list_entry(drv_data->cur_msg->transfers.next,
914 struct spi_transfer,
915 transfer_list);
916
917 /* Setup the SSP using the per chip configuration */
918 drv_data->cur_chip = spi_get_ctldata(drv_data->cur_msg->spi);
919 restore_state(drv_data);
920
921 /* Mark as busy and launch transfers */
922 tasklet_schedule(&drv_data->pump_transfers);
923
924 drv_data->busy = 1;
925 spin_unlock_irqrestore(&drv_data->lock, flags);
926}
927
928static int transfer(struct spi_device *spi, struct spi_message *msg)
929{
930 struct driver_data *drv_data = spi_master_get_devdata(spi->master);
931 unsigned long flags;
932
933 spin_lock_irqsave(&drv_data->lock, flags);
934
935 if (drv_data->run == QUEUE_STOPPED) {
936 spin_unlock_irqrestore(&drv_data->lock, flags);
937 return -ESHUTDOWN;
938 }
939
940 msg->actual_length = 0;
941 msg->status = -EINPROGRESS;
942 msg->state = START_STATE;
943
944 list_add_tail(&msg->queue, &drv_data->queue);
945
946 if (drv_data->run == QUEUE_RUNNING && !drv_data->busy)
947 queue_work(drv_data->workqueue, &drv_data->pump_messages);
948
949 spin_unlock_irqrestore(&drv_data->lock, flags);
950
951 return 0;
952}
953
954static int setup(struct spi_device *spi)
955{
956 struct pxa2xx_spi_chip *chip_info = NULL;
957 struct chip_data *chip;
958 struct driver_data *drv_data = spi_master_get_devdata(spi->master);
959 unsigned int clk_div;
960
961 if (!spi->bits_per_word)
962 spi->bits_per_word = 8;
963
964 if (drv_data->ssp_type != PXA25x_SSP
965 && (spi->bits_per_word < 4 || spi->bits_per_word > 32))
966 return -EINVAL;
967 else if (spi->bits_per_word < 4 || spi->bits_per_word > 16)
968 return -EINVAL;
969
970 /* Only alloc (or use chip_info) on first setup */
971 chip = spi_get_ctldata(spi);
972 if (chip == NULL) {
973 chip = kzalloc(sizeof(struct chip_data), GFP_KERNEL);
974 if (!chip)
975 return -ENOMEM;
976
977 chip->cs_control = null_cs_control;
978 chip->enable_dma = 0;
979 chip->timeout = SSP_TIMEOUT(1000);
980 chip->threshold = SSCR1_RxTresh(1) | SSCR1_TxTresh(1);
981 chip->dma_burst_size = drv_data->master_info->enable_dma ?
982 DCMD_BURST8 : 0;
983
984 chip_info = spi->controller_data;
985 }
986
987 /* chip_info isn't always needed */
988 if (chip_info) {
989 if (chip_info->cs_control)
990 chip->cs_control = chip_info->cs_control;
991
992 chip->timeout = SSP_TIMEOUT(chip_info->timeout_microsecs);
993
994 chip->threshold = SSCR1_RxTresh(chip_info->rx_threshold)
995 | SSCR1_TxTresh(chip_info->tx_threshold);
996
997 chip->enable_dma = chip_info->dma_burst_size != 0
998 && drv_data->master_info->enable_dma;
999 chip->dma_threshold = 0;
1000
1001 if (chip->enable_dma) {
1002 if (chip_info->dma_burst_size <= 8) {
1003 chip->dma_threshold = SSCR1_RxTresh(8)
1004 | SSCR1_TxTresh(8);
1005 chip->dma_burst_size = DCMD_BURST8;
1006 } else if (chip_info->dma_burst_size <= 16) {
1007 chip->dma_threshold = SSCR1_RxTresh(16)
1008 | SSCR1_TxTresh(16);
1009 chip->dma_burst_size = DCMD_BURST16;
1010 } else {
1011 chip->dma_threshold = SSCR1_RxTresh(32)
1012 | SSCR1_TxTresh(32);
1013 chip->dma_burst_size = DCMD_BURST32;
1014 }
1015 }
1016
1017
1018 if (chip_info->enable_loopback)
1019 chip->cr1 = SSCR1_LBM;
1020 }
1021
1022 if (drv_data->ioaddr == SSP1_VIRT)
1023 clk_div = SSP1_SerClkDiv(spi->max_speed_hz);
1024 else if (drv_data->ioaddr == SSP2_VIRT)
1025 clk_div = SSP2_SerClkDiv(spi->max_speed_hz);
1026 else if (drv_data->ioaddr == SSP3_VIRT)
1027 clk_div = SSP3_SerClkDiv(spi->max_speed_hz);
1028 else
1029 return -ENODEV;
1030 chip->speed_hz = spi->max_speed_hz;
1031
1032 chip->cr0 = clk_div
1033 | SSCR0_Motorola
1034 | SSCR0_DataSize(spi->bits_per_word > 16 ?
1035 spi->bits_per_word - 16 : spi->bits_per_word)
1036 | SSCR0_SSE
1037 | (spi->bits_per_word > 16 ? SSCR0_EDSS : 0);
1038 chip->cr1 |= (((spi->mode & SPI_CPHA) != 0) << 4)
1039 | (((spi->mode & SPI_CPOL) != 0) << 3);
1040
1041 /* NOTE: PXA25x_SSP _could_ use external clocking ... */
1042 if (drv_data->ssp_type != PXA25x_SSP)
1043 dev_dbg(&spi->dev, "%d bits/word, %d Hz, mode %d\n",
1044 spi->bits_per_word,
1045 (CLOCK_SPEED_HZ)
1046 / (1 + ((chip->cr0 & SSCR0_SCR) >> 8)),
1047 spi->mode & 0x3);
1048 else
1049 dev_dbg(&spi->dev, "%d bits/word, %d Hz, mode %d\n",
1050 spi->bits_per_word,
1051 (CLOCK_SPEED_HZ/2)
1052 / (1 + ((chip->cr0 & SSCR0_SCR) >> 8)),
1053 spi->mode & 0x3);
1054
1055 if (spi->bits_per_word <= 8) {
1056 chip->n_bytes = 1;
1057 chip->dma_width = DCMD_WIDTH1;
1058 chip->read = u8_reader;
1059 chip->write = u8_writer;
1060 } else if (spi->bits_per_word <= 16) {
1061 chip->n_bytes = 2;
1062 chip->dma_width = DCMD_WIDTH2;
1063 chip->read = u16_reader;
1064 chip->write = u16_writer;
1065 } else if (spi->bits_per_word <= 32) {
1066 chip->cr0 |= SSCR0_EDSS;
1067 chip->n_bytes = 4;
1068 chip->dma_width = DCMD_WIDTH4;
1069 chip->read = u32_reader;
1070 chip->write = u32_writer;
1071 } else {
1072 dev_err(&spi->dev, "invalid wordsize\n");
1073 kfree(chip);
1074 return -ENODEV;
1075 }
1076 chip->bits_per_word = spi->bits_per_word;
1077
1078 spi_set_ctldata(spi, chip);
1079
1080 return 0;
1081}
1082
1083static void cleanup(const struct spi_device *spi)
1084{
1085 struct chip_data *chip = spi_get_ctldata((struct spi_device *)spi);
1086
1087 kfree(chip);
1088}
1089
1090static int init_queue(struct driver_data *drv_data)
1091{
1092 INIT_LIST_HEAD(&drv_data->queue);
1093 spin_lock_init(&drv_data->lock);
1094
1095 drv_data->run = QUEUE_STOPPED;
1096 drv_data->busy = 0;
1097
1098 tasklet_init(&drv_data->pump_transfers,
1099 pump_transfers, (unsigned long)drv_data);
1100
1101 INIT_WORK(&drv_data->pump_messages, pump_messages, drv_data);
1102 drv_data->workqueue = create_singlethread_workqueue(
1103 drv_data->master->cdev.dev->bus_id);
1104 if (drv_data->workqueue == NULL)
1105 return -EBUSY;
1106
1107 return 0;
1108}
1109
1110static int start_queue(struct driver_data *drv_data)
1111{
1112 unsigned long flags;
1113
1114 spin_lock_irqsave(&drv_data->lock, flags);
1115
1116 if (drv_data->run == QUEUE_RUNNING || drv_data->busy) {
1117 spin_unlock_irqrestore(&drv_data->lock, flags);
1118 return -EBUSY;
1119 }
1120
1121 drv_data->run = QUEUE_RUNNING;
1122 drv_data->cur_msg = NULL;
1123 drv_data->cur_transfer = NULL;
1124 drv_data->cur_chip = NULL;
1125 spin_unlock_irqrestore(&drv_data->lock, flags);
1126
1127 queue_work(drv_data->workqueue, &drv_data->pump_messages);
1128
1129 return 0;
1130}
1131
1132static int stop_queue(struct driver_data *drv_data)
1133{
1134 unsigned long flags;
1135 unsigned limit = 500;
1136 int status = 0;
1137
1138 spin_lock_irqsave(&drv_data->lock, flags);
1139
1140 /* This is a bit lame, but is optimized for the common execution path.
1141 * A wait_queue on the drv_data->busy could be used, but then the common
1142 * execution path (pump_messages) would be required to call wake_up or
1143 * friends on every SPI message. Do this instead */
1144 drv_data->run = QUEUE_STOPPED;
1145 while (!list_empty(&drv_data->queue) && drv_data->busy && limit--) {
1146 spin_unlock_irqrestore(&drv_data->lock, flags);
1147 msleep(10);
1148 spin_lock_irqsave(&drv_data->lock, flags);
1149 }
1150
1151 if (!list_empty(&drv_data->queue) || drv_data->busy)
1152 status = -EBUSY;
1153
1154 spin_unlock_irqrestore(&drv_data->lock, flags);
1155
1156 return status;
1157}
1158
1159static int destroy_queue(struct driver_data *drv_data)
1160{
1161 int status;
1162
1163 status = stop_queue(drv_data);
1164 if (status != 0)
1165 return status;
1166
1167 destroy_workqueue(drv_data->workqueue);
1168
1169 return 0;
1170}
1171
1172static int pxa2xx_spi_probe(struct platform_device *pdev)
1173{
1174 struct device *dev = &pdev->dev;
1175 struct pxa2xx_spi_master *platform_info;
1176 struct spi_master *master;
1177 struct driver_data *drv_data = 0;
1178 struct resource *memory_resource;
1179 int irq;
1180 int status = 0;
1181
1182 platform_info = dev->platform_data;
1183
1184 if (platform_info->ssp_type == SSP_UNDEFINED) {
1185 dev_err(&pdev->dev, "undefined SSP\n");
1186 return -ENODEV;
1187 }
1188
1189 /* Allocate master with space for drv_data and null dma buffer */
1190 master = spi_alloc_master(dev, sizeof(struct driver_data) + 16);
1191 if (!master) {
1192 dev_err(&pdev->dev, "can not alloc spi_master\n");
1193 return -ENOMEM;
1194 }
1195 drv_data = spi_master_get_devdata(master);
1196 drv_data->master = master;
1197 drv_data->master_info = platform_info;
1198 drv_data->pdev = pdev;
1199
1200 master->bus_num = pdev->id;
1201 master->num_chipselect = platform_info->num_chipselect;
1202 master->cleanup = cleanup;
1203 master->setup = setup;
1204 master->transfer = transfer;
1205
1206 drv_data->ssp_type = platform_info->ssp_type;
1207 drv_data->null_dma_buf = (u32 *)ALIGN((u32)(drv_data +
1208 sizeof(struct driver_data)), 8);
1209
1210 /* Setup register addresses */
1211 memory_resource = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1212 if (!memory_resource) {
1213 dev_err(&pdev->dev, "memory resources not defined\n");
1214 status = -ENODEV;
1215 goto out_error_master_alloc;
1216 }
1217
1218 drv_data->ioaddr = (void *)io_p2v((unsigned long)(memory_resource->start));
1219 drv_data->ssdr_physical = memory_resource->start + 0x00000010;
1220 if (platform_info->ssp_type == PXA25x_SSP) {
1221 drv_data->int_cr1 = SSCR1_TIE | SSCR1_RIE;
1222 drv_data->dma_cr1 = 0;
1223 drv_data->clear_sr = SSSR_ROR;
1224 drv_data->mask_sr = SSSR_RFS | SSSR_TFS | SSSR_ROR;
1225 } else {
1226 drv_data->int_cr1 = SSCR1_TIE | SSCR1_RIE | SSCR1_TINTE;
1227 drv_data->dma_cr1 = SSCR1_TSRE | SSCR1_RSRE | SSCR1_TINTE;
1228 drv_data->clear_sr = SSSR_ROR | SSSR_TINT;
1229 drv_data->mask_sr = SSSR_TINT | SSSR_RFS | SSSR_TFS | SSSR_ROR;
1230 }
1231
1232 /* Attach to IRQ */
1233 irq = platform_get_irq(pdev, 0);
1234 if (irq < 0) {
1235 dev_err(&pdev->dev, "irq resource not defined\n");
1236 status = -ENODEV;
1237 goto out_error_master_alloc;
1238 }
1239
1240 status = request_irq(irq, ssp_int, 0, dev->bus_id, drv_data);
1241 if (status < 0) {
1242 dev_err(&pdev->dev, "can not get IRQ\n");
1243 goto out_error_master_alloc;
1244 }
1245
1246 /* Setup DMA if requested */
1247 drv_data->tx_channel = -1;
1248 drv_data->rx_channel = -1;
1249 if (platform_info->enable_dma) {
1250
1251 /* Get two DMA channels (rx and tx) */
1252 drv_data->rx_channel = pxa_request_dma("pxa2xx_spi_ssp_rx",
1253 DMA_PRIO_HIGH,
1254 dma_handler,
1255 drv_data);
1256 if (drv_data->rx_channel < 0) {
1257 dev_err(dev, "problem (%d) requesting rx channel\n",
1258 drv_data->rx_channel);
1259 status = -ENODEV;
1260 goto out_error_irq_alloc;
1261 }
1262 drv_data->tx_channel = pxa_request_dma("pxa2xx_spi_ssp_tx",
1263 DMA_PRIO_MEDIUM,
1264 dma_handler,
1265 drv_data);
1266 if (drv_data->tx_channel < 0) {
1267 dev_err(dev, "problem (%d) requesting tx channel\n",
1268 drv_data->tx_channel);
1269 status = -ENODEV;
1270 goto out_error_dma_alloc;
1271 }
1272
1273 if (drv_data->ioaddr == SSP1_VIRT) {
1274 DRCMRRXSSDR = DRCMR_MAPVLD
1275 | drv_data->rx_channel;
1276 DRCMRTXSSDR = DRCMR_MAPVLD
1277 | drv_data->tx_channel;
1278 } else if (drv_data->ioaddr == SSP2_VIRT) {
1279 DRCMRRXSS2DR = DRCMR_MAPVLD
1280 | drv_data->rx_channel;
1281 DRCMRTXSS2DR = DRCMR_MAPVLD
1282 | drv_data->tx_channel;
1283 } else if (drv_data->ioaddr == SSP3_VIRT) {
1284 DRCMRRXSS3DR = DRCMR_MAPVLD
1285 | drv_data->rx_channel;
1286 DRCMRTXSS3DR = DRCMR_MAPVLD
1287 | drv_data->tx_channel;
1288 } else {
1289 dev_err(dev, "bad SSP type\n");
1290 goto out_error_dma_alloc;
1291 }
1292 }
1293
1294 /* Enable SOC clock */
1295 pxa_set_cken(platform_info->clock_enable, 1);
1296
1297 /* Load default SSP configuration */
1298 write_SSCR0(0, drv_data->ioaddr);
1299 write_SSCR1(SSCR1_RxTresh(4) | SSCR1_TxTresh(12), drv_data->ioaddr);
1300 write_SSCR0(SSCR0_SerClkDiv(2)
1301 | SSCR0_Motorola
1302 | SSCR0_DataSize(8),
1303 drv_data->ioaddr);
1304 if (drv_data->ssp_type != PXA25x_SSP)
1305 write_SSTO(0, drv_data->ioaddr);
1306 write_SSPSP(0, drv_data->ioaddr);
1307
1308 /* Initial and start queue */
1309 status = init_queue(drv_data);
1310 if (status != 0) {
1311 dev_err(&pdev->dev, "problem initializing queue\n");
1312 goto out_error_clock_enabled;
1313 }
1314 status = start_queue(drv_data);
1315 if (status != 0) {
1316 dev_err(&pdev->dev, "problem starting queue\n");
1317 goto out_error_clock_enabled;
1318 }
1319
1320 /* Register with the SPI framework */
1321 platform_set_drvdata(pdev, drv_data);
1322 status = spi_register_master(master);
1323 if (status != 0) {
1324 dev_err(&pdev->dev, "problem registering spi master\n");
1325 goto out_error_queue_alloc;
1326 }
1327
1328 return status;
1329
1330out_error_queue_alloc:
1331 destroy_queue(drv_data);
1332
1333out_error_clock_enabled:
1334 pxa_set_cken(platform_info->clock_enable, 0);
1335
1336out_error_dma_alloc:
1337 if (drv_data->tx_channel != -1)
1338 pxa_free_dma(drv_data->tx_channel);
1339 if (drv_data->rx_channel != -1)
1340 pxa_free_dma(drv_data->rx_channel);
1341
1342out_error_irq_alloc:
1343 free_irq(irq, drv_data);
1344
1345out_error_master_alloc:
1346 spi_master_put(master);
1347 return status;
1348}
1349
1350static int pxa2xx_spi_remove(struct platform_device *pdev)
1351{
1352 struct driver_data *drv_data = platform_get_drvdata(pdev);
1353 int irq;
1354 int status = 0;
1355
1356 if (!drv_data)
1357 return 0;
1358
1359 /* Remove the queue */
1360 status = destroy_queue(drv_data);
1361 if (status != 0)
1362 return status;
1363
1364 /* Disable the SSP at the peripheral and SOC level */
1365 write_SSCR0(0, drv_data->ioaddr);
1366 pxa_set_cken(drv_data->master_info->clock_enable, 0);
1367
1368 /* Release DMA */
1369 if (drv_data->master_info->enable_dma) {
1370 if (drv_data->ioaddr == SSP1_VIRT) {
1371 DRCMRRXSSDR = 0;
1372 DRCMRTXSSDR = 0;
1373 } else if (drv_data->ioaddr == SSP2_VIRT) {
1374 DRCMRRXSS2DR = 0;
1375 DRCMRTXSS2DR = 0;
1376 } else if (drv_data->ioaddr == SSP3_VIRT) {
1377 DRCMRRXSS3DR = 0;
1378 DRCMRTXSS3DR = 0;
1379 }
1380 pxa_free_dma(drv_data->tx_channel);
1381 pxa_free_dma(drv_data->rx_channel);
1382 }
1383
1384 /* Release IRQ */
1385 irq = platform_get_irq(pdev, 0);
1386 if (irq >= 0)
1387 free_irq(irq, drv_data);
1388
1389 /* Disconnect from the SPI framework */
1390 spi_unregister_master(drv_data->master);
1391
1392 /* Prevent double remove */
1393 platform_set_drvdata(pdev, NULL);
1394
1395 return 0;
1396}
1397
1398static void pxa2xx_spi_shutdown(struct platform_device *pdev)
1399{
1400 int status = 0;
1401
1402 if ((status = pxa2xx_spi_remove(pdev)) != 0)
1403 dev_err(&pdev->dev, "shutdown failed with %d\n", status);
1404}
1405
1406#ifdef CONFIG_PM
1407static int suspend_devices(struct device *dev, void *pm_message)
1408{
1409 pm_message_t *state = pm_message;
1410
1411 if (dev->power.power_state.event != state->event) {
1412 dev_warn(dev, "pm state does not match request\n");
1413 return -1;
1414 }
1415
1416 return 0;
1417}
1418
1419static int pxa2xx_spi_suspend(struct platform_device *pdev, pm_message_t state)
1420{
1421 struct driver_data *drv_data = platform_get_drvdata(pdev);
1422 int status = 0;
1423
1424 /* Check all childern for current power state */
1425 if (device_for_each_child(&pdev->dev, &state, suspend_devices) != 0) {
1426 dev_warn(&pdev->dev, "suspend aborted\n");
1427 return -1;
1428 }
1429
1430 status = stop_queue(drv_data);
1431 if (status != 0)
1432 return status;
1433 write_SSCR0(0, drv_data->ioaddr);
1434 pxa_set_cken(drv_data->master_info->clock_enable, 0);
1435
1436 return 0;
1437}
1438
1439static int pxa2xx_spi_resume(struct platform_device *pdev)
1440{
1441 struct driver_data *drv_data = platform_get_drvdata(pdev);
1442 int status = 0;
1443
1444 /* Enable the SSP clock */
1445 pxa_set_cken(drv_data->master_info->clock_enable, 1);
1446
1447 /* Start the queue running */
1448 status = start_queue(drv_data);
1449 if (status != 0) {
1450 dev_err(&pdev->dev, "problem starting queue (%d)\n", status);
1451 return status;
1452 }
1453
1454 return 0;
1455}
1456#else
1457#define pxa2xx_spi_suspend NULL
1458#define pxa2xx_spi_resume NULL
1459#endif /* CONFIG_PM */
1460
1461static struct platform_driver driver = {
1462 .driver = {
1463 .name = "pxa2xx-spi",
1464 .bus = &platform_bus_type,
1465 .owner = THIS_MODULE,
1466 },
1467 .probe = pxa2xx_spi_probe,
1468 .remove = __devexit_p(pxa2xx_spi_remove),
1469 .shutdown = pxa2xx_spi_shutdown,
1470 .suspend = pxa2xx_spi_suspend,
1471 .resume = pxa2xx_spi_resume,
1472};
1473
1474static int __init pxa2xx_spi_init(void)
1475{
1476 platform_driver_register(&driver);
1477
1478 return 0;
1479}
1480module_init(pxa2xx_spi_init);
1481
1482static void __exit pxa2xx_spi_exit(void)
1483{
1484 platform_driver_unregister(&driver);
1485}
1486module_exit(pxa2xx_spi_exit);
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 94f5e8ed83a7..1cea4a6799fe 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -338,18 +338,18 @@ static struct class spi_master_class = {
338 * spi_alloc_master - allocate SPI master controller 338 * spi_alloc_master - allocate SPI master controller
339 * @dev: the controller, possibly using the platform_bus 339 * @dev: the controller, possibly using the platform_bus
340 * @size: how much driver-private data to preallocate; the pointer to this 340 * @size: how much driver-private data to preallocate; the pointer to this
341 * memory is in the class_data field of the returned class_device, 341 * memory is in the class_data field of the returned class_device,
342 * accessible with spi_master_get_devdata(). 342 * accessible with spi_master_get_devdata().
343 * 343 *
344 * This call is used only by SPI master controller drivers, which are the 344 * This call is used only by SPI master controller drivers, which are the
345 * only ones directly touching chip registers. It's how they allocate 345 * only ones directly touching chip registers. It's how they allocate
346 * an spi_master structure, prior to calling spi_add_master(). 346 * an spi_master structure, prior to calling spi_register_master().
347 * 347 *
348 * This must be called from context that can sleep. It returns the SPI 348 * This must be called from context that can sleep. It returns the SPI
349 * master structure on success, else NULL. 349 * master structure on success, else NULL.
350 * 350 *
351 * The caller is responsible for assigning the bus number and initializing 351 * The caller is responsible for assigning the bus number and initializing
352 * the master's methods before calling spi_add_master(); and (after errors 352 * the master's methods before calling spi_register_master(); and (after errors
353 * adding the device) calling spi_master_put() to prevent a memory leak. 353 * adding the device) calling spi_master_put() to prevent a memory leak.
354 */ 354 */
355struct spi_master * __init_or_module 355struct spi_master * __init_or_module
@@ -395,7 +395,7 @@ EXPORT_SYMBOL_GPL(spi_alloc_master);
395int __init_or_module 395int __init_or_module
396spi_register_master(struct spi_master *master) 396spi_register_master(struct spi_master *master)
397{ 397{
398 static atomic_t dyn_bus_id = ATOMIC_INIT(0); 398 static atomic_t dyn_bus_id = ATOMIC_INIT((1<<16) - 1);
399 struct device *dev = master->cdev.dev; 399 struct device *dev = master->cdev.dev;
400 int status = -ENODEV; 400 int status = -ENODEV;
401 int dynamic = 0; 401 int dynamic = 0;
@@ -404,7 +404,7 @@ spi_register_master(struct spi_master *master)
404 return -ENODEV; 404 return -ENODEV;
405 405
406 /* convention: dynamically assigned bus IDs count down from the max */ 406 /* convention: dynamically assigned bus IDs count down from the max */
407 if (master->bus_num == 0) { 407 if (master->bus_num < 0) {
408 master->bus_num = atomic_dec_return(&dyn_bus_id); 408 master->bus_num = atomic_dec_return(&dyn_bus_id);
409 dynamic = 1; 409 dynamic = 1;
410 } 410 }
@@ -522,7 +522,8 @@ int spi_sync(struct spi_device *spi, struct spi_message *message)
522} 522}
523EXPORT_SYMBOL_GPL(spi_sync); 523EXPORT_SYMBOL_GPL(spi_sync);
524 524
525#define SPI_BUFSIZ (SMP_CACHE_BYTES) 525/* portable code must never pass more than 32 bytes */
526#define SPI_BUFSIZ max(32,SMP_CACHE_BYTES)
526 527
527static u8 *buf; 528static u8 *buf;
528 529
diff --git a/drivers/spi/spi_bitbang.c b/drivers/spi/spi_bitbang.c
index f037e5593269..dd2f950b21a7 100644
--- a/drivers/spi/spi_bitbang.c
+++ b/drivers/spi/spi_bitbang.c
@@ -138,6 +138,45 @@ static unsigned bitbang_txrx_32(
138 return t->len - count; 138 return t->len - count;
139} 139}
140 140
141int spi_bitbang_setup_transfer(struct spi_device *spi, struct spi_transfer *t)
142{
143 struct spi_bitbang_cs *cs = spi->controller_state;
144 u8 bits_per_word;
145 u32 hz;
146
147 if (t) {
148 bits_per_word = t->bits_per_word;
149 hz = t->speed_hz;
150 } else {
151 bits_per_word = 0;
152 hz = 0;
153 }
154
155 /* spi_transfer level calls that work per-word */
156 if (!bits_per_word)
157 bits_per_word = spi->bits_per_word;
158 if (bits_per_word <= 8)
159 cs->txrx_bufs = bitbang_txrx_8;
160 else if (bits_per_word <= 16)
161 cs->txrx_bufs = bitbang_txrx_16;
162 else if (bits_per_word <= 32)
163 cs->txrx_bufs = bitbang_txrx_32;
164 else
165 return -EINVAL;
166
167 /* nsecs = (clock period)/2 */
168 if (!hz)
169 hz = spi->max_speed_hz;
170 if (hz) {
171 cs->nsecs = (1000000000/2) / hz;
172 if (cs->nsecs > (MAX_UDELAY_MS * 1000 * 1000))
173 return -EINVAL;
174 }
175
176 return 0;
177}
178EXPORT_SYMBOL_GPL(spi_bitbang_setup_transfer);
179
141/** 180/**
142 * spi_bitbang_setup - default setup for per-word I/O loops 181 * spi_bitbang_setup - default setup for per-word I/O loops
143 */ 182 */
@@ -145,8 +184,16 @@ int spi_bitbang_setup(struct spi_device *spi)
145{ 184{
146 struct spi_bitbang_cs *cs = spi->controller_state; 185 struct spi_bitbang_cs *cs = spi->controller_state;
147 struct spi_bitbang *bitbang; 186 struct spi_bitbang *bitbang;
187 int retval;
148 188
149 if (!spi->max_speed_hz) 189 bitbang = spi_master_get_devdata(spi->master);
190
191 /* REVISIT: some systems will want to support devices using lsb-first
192 * bit encodings on the wire. In pure software that would be trivial,
193 * just bitbang_txrx_le_cphaX() routines shifting the other way, and
194 * some hardware controllers also have this support.
195 */
196 if ((spi->mode & SPI_LSB_FIRST) != 0)
150 return -EINVAL; 197 return -EINVAL;
151 198
152 if (!cs) { 199 if (!cs) {
@@ -155,32 +202,20 @@ int spi_bitbang_setup(struct spi_device *spi)
155 return -ENOMEM; 202 return -ENOMEM;
156 spi->controller_state = cs; 203 spi->controller_state = cs;
157 } 204 }
158 bitbang = spi_master_get_devdata(spi->master);
159 205
160 if (!spi->bits_per_word) 206 if (!spi->bits_per_word)
161 spi->bits_per_word = 8; 207 spi->bits_per_word = 8;
162 208
163 /* spi_transfer level calls that work per-word */
164 if (spi->bits_per_word <= 8)
165 cs->txrx_bufs = bitbang_txrx_8;
166 else if (spi->bits_per_word <= 16)
167 cs->txrx_bufs = bitbang_txrx_16;
168 else if (spi->bits_per_word <= 32)
169 cs->txrx_bufs = bitbang_txrx_32;
170 else
171 return -EINVAL;
172
173 /* per-word shift register access, in hardware or bitbanging */ 209 /* per-word shift register access, in hardware or bitbanging */
174 cs->txrx_word = bitbang->txrx_word[spi->mode & (SPI_CPOL|SPI_CPHA)]; 210 cs->txrx_word = bitbang->txrx_word[spi->mode & (SPI_CPOL|SPI_CPHA)];
175 if (!cs->txrx_word) 211 if (!cs->txrx_word)
176 return -EINVAL; 212 return -EINVAL;
177 213
178 /* nsecs = (clock period)/2 */ 214 retval = spi_bitbang_setup_transfer(spi, NULL);
179 cs->nsecs = (1000000000/2) / (spi->max_speed_hz); 215 if (retval < 0)
180 if (cs->nsecs > MAX_UDELAY_MS * 1000) 216 return retval;
181 return -EINVAL;
182 217
183 dev_dbg(&spi->dev, "%s, mode %d, %u bits/w, %u nsec\n", 218 dev_dbg(&spi->dev, "%s, mode %d, %u bits/w, %u nsec/bit\n",
184 __FUNCTION__, spi->mode & (SPI_CPOL | SPI_CPHA), 219 __FUNCTION__, spi->mode & (SPI_CPOL | SPI_CPHA),
185 spi->bits_per_word, 2 * cs->nsecs); 220 spi->bits_per_word, 2 * cs->nsecs);
186 221
@@ -246,6 +281,8 @@ static void bitbang_work(void *_bitbang)
246 unsigned tmp; 281 unsigned tmp;
247 unsigned cs_change; 282 unsigned cs_change;
248 int status; 283 int status;
284 int (*setup_transfer)(struct spi_device *,
285 struct spi_transfer *);
249 286
250 m = container_of(bitbang->queue.next, struct spi_message, 287 m = container_of(bitbang->queue.next, struct spi_message,
251 queue); 288 queue);
@@ -262,6 +299,7 @@ static void bitbang_work(void *_bitbang)
262 tmp = 0; 299 tmp = 0;
263 cs_change = 1; 300 cs_change = 1;
264 status = 0; 301 status = 0;
302 setup_transfer = NULL;
265 303
266 list_for_each_entry (t, &m->transfers, transfer_list) { 304 list_for_each_entry (t, &m->transfers, transfer_list) {
267 if (bitbang->shutdown) { 305 if (bitbang->shutdown) {
@@ -269,6 +307,20 @@ static void bitbang_work(void *_bitbang)
269 break; 307 break;
270 } 308 }
271 309
310 /* override or restore speed and wordsize */
311 if (t->speed_hz || t->bits_per_word) {
312 setup_transfer = bitbang->setup_transfer;
313 if (!setup_transfer) {
314 status = -ENOPROTOOPT;
315 break;
316 }
317 }
318 if (setup_transfer) {
319 status = setup_transfer(spi, t);
320 if (status < 0)
321 break;
322 }
323
272 /* set up default clock polarity, and activate chip; 324 /* set up default clock polarity, and activate chip;
273 * this implicitly updates clock and spi modes as 325 * this implicitly updates clock and spi modes as
274 * previously recorded for this device via setup(). 326 * previously recorded for this device via setup().
@@ -325,6 +377,10 @@ static void bitbang_work(void *_bitbang)
325 m->status = status; 377 m->status = status;
326 m->complete(m->context); 378 m->complete(m->context);
327 379
380 /* restore speed and wordsize */
381 if (setup_transfer)
382 setup_transfer(spi, NULL);
383
328 /* normally deactivate chipselect ... unless no error and 384 /* normally deactivate chipselect ... unless no error and
329 * cs_change has hinted that the next message will probably 385 * cs_change has hinted that the next message will probably
330 * be for this chip too. 386 * be for this chip too.
@@ -348,6 +404,7 @@ int spi_bitbang_transfer(struct spi_device *spi, struct spi_message *m)
348{ 404{
349 struct spi_bitbang *bitbang; 405 struct spi_bitbang *bitbang;
350 unsigned long flags; 406 unsigned long flags;
407 int status = 0;
351 408
352 m->actual_length = 0; 409 m->actual_length = 0;
353 m->status = -EINPROGRESS; 410 m->status = -EINPROGRESS;
@@ -357,11 +414,15 @@ int spi_bitbang_transfer(struct spi_device *spi, struct spi_message *m)
357 return -ESHUTDOWN; 414 return -ESHUTDOWN;
358 415
359 spin_lock_irqsave(&bitbang->lock, flags); 416 spin_lock_irqsave(&bitbang->lock, flags);
360 list_add_tail(&m->queue, &bitbang->queue); 417 if (!spi->max_speed_hz)
361 queue_work(bitbang->workqueue, &bitbang->work); 418 status = -ENETDOWN;
419 else {
420 list_add_tail(&m->queue, &bitbang->queue);
421 queue_work(bitbang->workqueue, &bitbang->work);
422 }
362 spin_unlock_irqrestore(&bitbang->lock, flags); 423 spin_unlock_irqrestore(&bitbang->lock, flags);
363 424
364 return 0; 425 return status;
365} 426}
366EXPORT_SYMBOL_GPL(spi_bitbang_transfer); 427EXPORT_SYMBOL_GPL(spi_bitbang_transfer);
367 428
@@ -406,6 +467,9 @@ int spi_bitbang_start(struct spi_bitbang *bitbang)
406 bitbang->use_dma = 0; 467 bitbang->use_dma = 0;
407 bitbang->txrx_bufs = spi_bitbang_bufs; 468 bitbang->txrx_bufs = spi_bitbang_bufs;
408 if (!bitbang->master->setup) { 469 if (!bitbang->master->setup) {
470 if (!bitbang->setup_transfer)
471 bitbang->setup_transfer =
472 spi_bitbang_setup_transfer;
409 bitbang->master->setup = spi_bitbang_setup; 473 bitbang->master->setup = spi_bitbang_setup;
410 bitbang->master->cleanup = spi_bitbang_cleanup; 474 bitbang->master->cleanup = spi_bitbang_cleanup;
411 } 475 }
diff --git a/drivers/spi/spi_butterfly.c b/drivers/spi/spi_butterfly.c
index ff9e5faa4dc9..a006a1ee27ac 100644
--- a/drivers/spi/spi_butterfly.c
+++ b/drivers/spi/spi_butterfly.c
@@ -321,6 +321,7 @@ static void butterfly_attach(struct parport *p)
321 * (firmware resets at45, acts as spi slave) or neither (we ignore 321 * (firmware resets at45, acts as spi slave) or neither (we ignore
322 * both, AVR uses AT45). Here we expect firmware for the first option. 322 * both, AVR uses AT45). Here we expect firmware for the first option.
323 */ 323 */
324
324 pp->info[0].max_speed_hz = 15 * 1000 * 1000; 325 pp->info[0].max_speed_hz = 15 * 1000 * 1000;
325 strcpy(pp->info[0].modalias, "mtd_dataflash"); 326 strcpy(pp->info[0].modalias, "mtd_dataflash");
326 pp->info[0].platform_data = &flash; 327 pp->info[0].platform_data = &flash;
diff --git a/drivers/spi/spi_mpc83xx.c b/drivers/spi/spi_mpc83xx.c
new file mode 100644
index 000000000000..5d92a7e5cb41
--- /dev/null
+++ b/drivers/spi/spi_mpc83xx.c
@@ -0,0 +1,483 @@
1/*
2 * MPC83xx SPI controller driver.
3 *
4 * Maintainer: Kumar Gala
5 *
6 * Copyright (C) 2006 Polycom, Inc.
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 */
13#include <linux/module.h>
14#include <linux/init.h>
15#include <linux/types.h>
16#include <linux/kernel.h>
17#include <linux/completion.h>
18#include <linux/interrupt.h>
19#include <linux/delay.h>
20#include <linux/irq.h>
21#include <linux/device.h>
22#include <linux/spi/spi.h>
23#include <linux/spi/spi_bitbang.h>
24#include <linux/platform_device.h>
25#include <linux/fsl_devices.h>
26
27#include <asm/irq.h>
28#include <asm/io.h>
29
30/* SPI Controller registers */
31struct mpc83xx_spi_reg {
32 u8 res1[0x20];
33 __be32 mode;
34 __be32 event;
35 __be32 mask;
36 __be32 command;
37 __be32 transmit;
38 __be32 receive;
39};
40
41/* SPI Controller mode register definitions */
42#define SPMODE_CI_INACTIVEHIGH (1 << 29)
43#define SPMODE_CP_BEGIN_EDGECLK (1 << 28)
44#define SPMODE_DIV16 (1 << 27)
45#define SPMODE_REV (1 << 26)
46#define SPMODE_MS (1 << 25)
47#define SPMODE_ENABLE (1 << 24)
48#define SPMODE_LEN(x) ((x) << 20)
49#define SPMODE_PM(x) ((x) << 16)
50
51/*
52 * Default for SPI Mode:
53 * SPI MODE 0 (inactive low, phase middle, MSB, 8-bit length, slow clk
54 */
55#define SPMODE_INIT_VAL (SPMODE_CI_INACTIVEHIGH | SPMODE_DIV16 | SPMODE_REV | \
56 SPMODE_MS | SPMODE_LEN(7) | SPMODE_PM(0xf))
57
58/* SPIE register values */
59#define SPIE_NE 0x00000200 /* Not empty */
60#define SPIE_NF 0x00000100 /* Not full */
61
62/* SPIM register values */
63#define SPIM_NE 0x00000200 /* Not empty */
64#define SPIM_NF 0x00000100 /* Not full */
65
66/* SPI Controller driver's private data. */
67struct mpc83xx_spi {
68 /* bitbang has to be first */
69 struct spi_bitbang bitbang;
70 struct completion done;
71
72 struct mpc83xx_spi_reg __iomem *base;
73
74 /* rx & tx bufs from the spi_transfer */
75 const void *tx;
76 void *rx;
77
78 /* functions to deal with different sized buffers */
79 void (*get_rx) (u32 rx_data, struct mpc83xx_spi *);
80 u32(*get_tx) (struct mpc83xx_spi *);
81
82 unsigned int count;
83 u32 irq;
84
85 unsigned nsecs; /* (clock cycle time)/2 */
86
87 u32 sysclk;
88 void (*activate_cs) (u8 cs, u8 polarity);
89 void (*deactivate_cs) (u8 cs, u8 polarity);
90};
91
92static inline void mpc83xx_spi_write_reg(__be32 __iomem * reg, u32 val)
93{
94 out_be32(reg, val);
95}
96
97static inline u32 mpc83xx_spi_read_reg(__be32 __iomem * reg)
98{
99 return in_be32(reg);
100}
101
102#define MPC83XX_SPI_RX_BUF(type) \
103void mpc83xx_spi_rx_buf_##type(u32 data, struct mpc83xx_spi *mpc83xx_spi) \
104{ \
105 type * rx = mpc83xx_spi->rx; \
106 *rx++ = (type)data; \
107 mpc83xx_spi->rx = rx; \
108}
109
110#define MPC83XX_SPI_TX_BUF(type) \
111u32 mpc83xx_spi_tx_buf_##type(struct mpc83xx_spi *mpc83xx_spi) \
112{ \
113 u32 data; \
114 const type * tx = mpc83xx_spi->tx; \
115 data = *tx++; \
116 mpc83xx_spi->tx = tx; \
117 return data; \
118}
119
120MPC83XX_SPI_RX_BUF(u8)
121MPC83XX_SPI_RX_BUF(u16)
122MPC83XX_SPI_RX_BUF(u32)
123MPC83XX_SPI_TX_BUF(u8)
124MPC83XX_SPI_TX_BUF(u16)
125MPC83XX_SPI_TX_BUF(u32)
126
127static void mpc83xx_spi_chipselect(struct spi_device *spi, int value)
128{
129 struct mpc83xx_spi *mpc83xx_spi;
130 u8 pol = spi->mode & SPI_CS_HIGH ? 1 : 0;
131
132 mpc83xx_spi = spi_master_get_devdata(spi->master);
133
134 if (value == BITBANG_CS_INACTIVE) {
135 if (mpc83xx_spi->deactivate_cs)
136 mpc83xx_spi->deactivate_cs(spi->chip_select, pol);
137 }
138
139 if (value == BITBANG_CS_ACTIVE) {
140 u32 regval = mpc83xx_spi_read_reg(&mpc83xx_spi->base->mode);
141 u32 len = spi->bits_per_word;
142 if (len == 32)
143 len = 0;
144 else
145 len = len - 1;
146
147 /* mask out bits we are going to set */
148 regval &= ~0x38ff0000;
149
150 if (spi->mode & SPI_CPHA)
151 regval |= SPMODE_CP_BEGIN_EDGECLK;
152 if (spi->mode & SPI_CPOL)
153 regval |= SPMODE_CI_INACTIVEHIGH;
154
155 regval |= SPMODE_LEN(len);
156
157 if ((mpc83xx_spi->sysclk / spi->max_speed_hz) >= 64) {
158 u8 pm = mpc83xx_spi->sysclk / (spi->max_speed_hz * 64);
159 regval |= SPMODE_PM(pm) | SPMODE_DIV16;
160 } else {
161 u8 pm = mpc83xx_spi->sysclk / (spi->max_speed_hz * 4);
162 regval |= SPMODE_PM(pm);
163 }
164
165 mpc83xx_spi_write_reg(&mpc83xx_spi->base->mode, regval);
166 if (mpc83xx_spi->activate_cs)
167 mpc83xx_spi->activate_cs(spi->chip_select, pol);
168 }
169}
170
171static
172int mpc83xx_spi_setup_transfer(struct spi_device *spi, struct spi_transfer *t)
173{
174 struct mpc83xx_spi *mpc83xx_spi;
175 u32 regval;
176 u8 bits_per_word;
177 u32 hz;
178
179 mpc83xx_spi = spi_master_get_devdata(spi->master);
180
181 if (t) {
182 bits_per_word = t->bits_per_word;
183 hz = t->speed_hz;
184 } else {
185 bits_per_word = 0;
186 hz = 0;
187 }
188
189 /* spi_transfer level calls that work per-word */
190 if (!bits_per_word)
191 bits_per_word = spi->bits_per_word;
192
193 /* Make sure its a bit width we support [4..16, 32] */
194 if ((bits_per_word < 4)
195 || ((bits_per_word > 16) && (bits_per_word != 32)))
196 return -EINVAL;
197
198 if (bits_per_word <= 8) {
199 mpc83xx_spi->get_rx = mpc83xx_spi_rx_buf_u8;
200 mpc83xx_spi->get_tx = mpc83xx_spi_tx_buf_u8;
201 } else if (bits_per_word <= 16) {
202 mpc83xx_spi->get_rx = mpc83xx_spi_rx_buf_u16;
203 mpc83xx_spi->get_tx = mpc83xx_spi_tx_buf_u16;
204 } else if (bits_per_word <= 32) {
205 mpc83xx_spi->get_rx = mpc83xx_spi_rx_buf_u32;
206 mpc83xx_spi->get_tx = mpc83xx_spi_tx_buf_u32;
207 } else
208 return -EINVAL;
209
210 /* nsecs = (clock period)/2 */
211 if (!hz)
212 hz = spi->max_speed_hz;
213 mpc83xx_spi->nsecs = (1000000000 / 2) / hz;
214 if (mpc83xx_spi->nsecs > MAX_UDELAY_MS * 1000)
215 return -EINVAL;
216
217 if (bits_per_word == 32)
218 bits_per_word = 0;
219 else
220 bits_per_word = bits_per_word - 1;
221
222 regval = mpc83xx_spi_read_reg(&mpc83xx_spi->base->mode);
223
224 /* Mask out bits_per_wordgth */
225 regval &= 0xff0fffff;
226 regval |= SPMODE_LEN(bits_per_word);
227
228 mpc83xx_spi_write_reg(&mpc83xx_spi->base->mode, regval);
229
230 return 0;
231}
232
233static int mpc83xx_spi_setup(struct spi_device *spi)
234{
235 struct spi_bitbang *bitbang;
236 struct mpc83xx_spi *mpc83xx_spi;
237 int retval;
238
239 if (!spi->max_speed_hz)
240 return -EINVAL;
241
242 bitbang = spi_master_get_devdata(spi->master);
243 mpc83xx_spi = spi_master_get_devdata(spi->master);
244
245 if (!spi->bits_per_word)
246 spi->bits_per_word = 8;
247
248 retval = mpc83xx_spi_setup_transfer(spi, NULL);
249 if (retval < 0)
250 return retval;
251
252 dev_dbg(&spi->dev, "%s, mode %d, %u bits/w, %u nsec\n",
253 __FUNCTION__, spi->mode & (SPI_CPOL | SPI_CPHA),
254 spi->bits_per_word, 2 * mpc83xx_spi->nsecs);
255
256 /* NOTE we _need_ to call chipselect() early, ideally with adapter
257 * setup, unless the hardware defaults cooperate to avoid confusion
258 * between normal (active low) and inverted chipselects.
259 */
260
261 /* deselect chip (low or high) */
262 spin_lock(&bitbang->lock);
263 if (!bitbang->busy) {
264 bitbang->chipselect(spi, BITBANG_CS_INACTIVE);
265 ndelay(mpc83xx_spi->nsecs);
266 }
267 spin_unlock(&bitbang->lock);
268
269 return 0;
270}
271
272static int mpc83xx_spi_bufs(struct spi_device *spi, struct spi_transfer *t)
273{
274 struct mpc83xx_spi *mpc83xx_spi;
275 u32 word;
276
277 mpc83xx_spi = spi_master_get_devdata(spi->master);
278
279 mpc83xx_spi->tx = t->tx_buf;
280 mpc83xx_spi->rx = t->rx_buf;
281 mpc83xx_spi->count = t->len;
282 INIT_COMPLETION(mpc83xx_spi->done);
283
284 /* enable rx ints */
285 mpc83xx_spi_write_reg(&mpc83xx_spi->base->mask, SPIM_NE);
286
287 /* transmit word */
288 word = mpc83xx_spi->get_tx(mpc83xx_spi);
289 mpc83xx_spi_write_reg(&mpc83xx_spi->base->transmit, word);
290
291 wait_for_completion(&mpc83xx_spi->done);
292
293 /* disable rx ints */
294 mpc83xx_spi_write_reg(&mpc83xx_spi->base->mask, 0);
295
296 return t->len - mpc83xx_spi->count;
297}
298
299irqreturn_t mpc83xx_spi_irq(s32 irq, void *context_data,
300 struct pt_regs * ptregs)
301{
302 struct mpc83xx_spi *mpc83xx_spi = context_data;
303 u32 event;
304 irqreturn_t ret = IRQ_NONE;
305
306 /* Get interrupt events(tx/rx) */
307 event = mpc83xx_spi_read_reg(&mpc83xx_spi->base->event);
308
309 /* We need handle RX first */
310 if (event & SPIE_NE) {
311 u32 rx_data = mpc83xx_spi_read_reg(&mpc83xx_spi->base->receive);
312
313 if (mpc83xx_spi->rx)
314 mpc83xx_spi->get_rx(rx_data, mpc83xx_spi);
315
316 ret = IRQ_HANDLED;
317 }
318
319 if ((event & SPIE_NF) == 0)
320 /* spin until TX is done */
321 while (((event =
322 mpc83xx_spi_read_reg(&mpc83xx_spi->base->event)) &
323 SPIE_NF) == 0)
324 cpu_relax();
325
326 mpc83xx_spi->count -= 1;
327 if (mpc83xx_spi->count) {
328 if (mpc83xx_spi->tx) {
329 u32 word = mpc83xx_spi->get_tx(mpc83xx_spi);
330 mpc83xx_spi_write_reg(&mpc83xx_spi->base->transmit,
331 word);
332 }
333 } else {
334 complete(&mpc83xx_spi->done);
335 }
336
337 /* Clear the events */
338 mpc83xx_spi_write_reg(&mpc83xx_spi->base->event, event);
339
340 return ret;
341}
342
343static int __init mpc83xx_spi_probe(struct platform_device *dev)
344{
345 struct spi_master *master;
346 struct mpc83xx_spi *mpc83xx_spi;
347 struct fsl_spi_platform_data *pdata;
348 struct resource *r;
349 u32 regval;
350 int ret = 0;
351
352 /* Get resources(memory, IRQ) associated with the device */
353 master = spi_alloc_master(&dev->dev, sizeof(struct mpc83xx_spi));
354
355 if (master == NULL) {
356 ret = -ENOMEM;
357 goto err;
358 }
359
360 platform_set_drvdata(dev, master);
361 pdata = dev->dev.platform_data;
362
363 if (pdata == NULL) {
364 ret = -ENODEV;
365 goto free_master;
366 }
367
368 r = platform_get_resource(dev, IORESOURCE_MEM, 0);
369 if (r == NULL) {
370 ret = -ENODEV;
371 goto free_master;
372 }
373
374 mpc83xx_spi = spi_master_get_devdata(master);
375 mpc83xx_spi->bitbang.master = spi_master_get(master);
376 mpc83xx_spi->bitbang.chipselect = mpc83xx_spi_chipselect;
377 mpc83xx_spi->bitbang.setup_transfer = mpc83xx_spi_setup_transfer;
378 mpc83xx_spi->bitbang.txrx_bufs = mpc83xx_spi_bufs;
379 mpc83xx_spi->sysclk = pdata->sysclk;
380 mpc83xx_spi->activate_cs = pdata->activate_cs;
381 mpc83xx_spi->deactivate_cs = pdata->deactivate_cs;
382 mpc83xx_spi->get_rx = mpc83xx_spi_rx_buf_u8;
383 mpc83xx_spi->get_tx = mpc83xx_spi_tx_buf_u8;
384
385 mpc83xx_spi->bitbang.master->setup = mpc83xx_spi_setup;
386 init_completion(&mpc83xx_spi->done);
387
388 mpc83xx_spi->base = ioremap(r->start, r->end - r->start + 1);
389 if (mpc83xx_spi->base == NULL) {
390 ret = -ENOMEM;
391 goto put_master;
392 }
393
394 mpc83xx_spi->irq = platform_get_irq(dev, 0);
395
396 if (mpc83xx_spi->irq < 0) {
397 ret = -ENXIO;
398 goto unmap_io;
399 }
400
401 /* Register for SPI Interrupt */
402 ret = request_irq(mpc83xx_spi->irq, mpc83xx_spi_irq,
403 0, "mpc83xx_spi", mpc83xx_spi);
404
405 if (ret != 0)
406 goto unmap_io;
407
408 master->bus_num = pdata->bus_num;
409 master->num_chipselect = pdata->max_chipselect;
410
411 /* SPI controller initializations */
412 mpc83xx_spi_write_reg(&mpc83xx_spi->base->mode, 0);
413 mpc83xx_spi_write_reg(&mpc83xx_spi->base->mask, 0);
414 mpc83xx_spi_write_reg(&mpc83xx_spi->base->command, 0);
415 mpc83xx_spi_write_reg(&mpc83xx_spi->base->event, 0xffffffff);
416
417 /* Enable SPI interface */
418 regval = pdata->initial_spmode | SPMODE_INIT_VAL | SPMODE_ENABLE;
419 mpc83xx_spi_write_reg(&mpc83xx_spi->base->mode, regval);
420
421 ret = spi_bitbang_start(&mpc83xx_spi->bitbang);
422
423 if (ret != 0)
424 goto free_irq;
425
426 printk(KERN_INFO
427 "%s: MPC83xx SPI Controller driver at 0x%p (irq = %d)\n",
428 dev->dev.bus_id, mpc83xx_spi->base, mpc83xx_spi->irq);
429
430 return ret;
431
432free_irq:
433 free_irq(mpc83xx_spi->irq, mpc83xx_spi);
434unmap_io:
435 iounmap(mpc83xx_spi->base);
436put_master:
437 spi_master_put(master);
438free_master:
439 kfree(master);
440err:
441 return ret;
442}
443
444static int __devexit mpc83xx_spi_remove(struct platform_device *dev)
445{
446 struct mpc83xx_spi *mpc83xx_spi;
447 struct spi_master *master;
448
449 master = platform_get_drvdata(dev);
450 mpc83xx_spi = spi_master_get_devdata(master);
451
452 spi_bitbang_stop(&mpc83xx_spi->bitbang);
453 free_irq(mpc83xx_spi->irq, mpc83xx_spi);
454 iounmap(mpc83xx_spi->base);
455 spi_master_put(mpc83xx_spi->bitbang.master);
456
457 return 0;
458}
459
460static struct platform_driver mpc83xx_spi_driver = {
461 .probe = mpc83xx_spi_probe,
462 .remove = __devexit_p(mpc83xx_spi_remove),
463 .driver = {
464 .name = "mpc83xx_spi",
465 },
466};
467
468static int __init mpc83xx_spi_init(void)
469{
470 return platform_driver_register(&mpc83xx_spi_driver);
471}
472
473static void __exit mpc83xx_spi_exit(void)
474{
475 platform_driver_unregister(&mpc83xx_spi_driver);
476}
477
478module_init(mpc83xx_spi_init);
479module_exit(mpc83xx_spi_exit);
480
481MODULE_AUTHOR("Kumar Gala");
482MODULE_DESCRIPTION("Simple MPC83xx SPI Driver");
483MODULE_LICENSE("GPL");
diff --git a/drivers/spi/spi_s3c24xx.c b/drivers/spi/spi_s3c24xx.c
new file mode 100644
index 000000000000..5fc14563ee3a
--- /dev/null
+++ b/drivers/spi/spi_s3c24xx.c
@@ -0,0 +1,453 @@
1/* linux/drivers/spi/spi_s3c24xx.c
2 *
3 * Copyright (c) 2006 Ben Dooks
4 * Copyright (c) 2006 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11*/
12
13
14//#define DEBUG
15
16#include <linux/config.h>
17#include <linux/init.h>
18#include <linux/spinlock.h>
19#include <linux/workqueue.h>
20#include <linux/interrupt.h>
21#include <linux/delay.h>
22#include <linux/errno.h>
23#include <linux/err.h>
24#include <linux/clk.h>
25#include <linux/platform_device.h>
26
27#include <linux/spi/spi.h>
28#include <linux/spi/spi_bitbang.h>
29
30#include <asm/io.h>
31#include <asm/dma.h>
32#include <asm/hardware.h>
33
34#include <asm/arch/regs-gpio.h>
35#include <asm/arch/regs-spi.h>
36#include <asm/arch/spi.h>
37
38struct s3c24xx_spi {
39 /* bitbang has to be first */
40 struct spi_bitbang bitbang;
41 struct completion done;
42
43 void __iomem *regs;
44 int irq;
45 int len;
46 int count;
47
48 /* data buffers */
49 const unsigned char *tx;
50 unsigned char *rx;
51
52 struct clk *clk;
53 struct resource *ioarea;
54 struct spi_master *master;
55 struct spi_device *curdev;
56 struct device *dev;
57 struct s3c2410_spi_info *pdata;
58};
59
60#define SPCON_DEFAULT (S3C2410_SPCON_MSTR | S3C2410_SPCON_SMOD_INT)
61#define SPPIN_DEFAULT (S3C2410_SPPIN_KEEP)
62
63static inline struct s3c24xx_spi *to_hw(struct spi_device *sdev)
64{
65 return spi_master_get_devdata(sdev->master);
66}
67
68static void s3c24xx_spi_chipsel(struct spi_device *spi, int value)
69{
70 struct s3c24xx_spi *hw = to_hw(spi);
71 unsigned int cspol = spi->mode & SPI_CS_HIGH ? 1 : 0;
72 unsigned int spcon;
73
74 switch (value) {
75 case BITBANG_CS_INACTIVE:
76 if (hw->pdata->set_cs)
77 hw->pdata->set_cs(hw->pdata, value, cspol);
78 else
79 s3c2410_gpio_setpin(hw->pdata->pin_cs, cspol ^ 1);
80 break;
81
82 case BITBANG_CS_ACTIVE:
83 spcon = readb(hw->regs + S3C2410_SPCON);
84
85 if (spi->mode & SPI_CPHA)
86 spcon |= S3C2410_SPCON_CPHA_FMTB;
87 else
88 spcon &= ~S3C2410_SPCON_CPHA_FMTB;
89
90 if (spi->mode & SPI_CPOL)
91 spcon |= S3C2410_SPCON_CPOL_HIGH;
92 else
93 spcon &= ~S3C2410_SPCON_CPOL_HIGH;
94
95 spcon |= S3C2410_SPCON_ENSCK;
96
97 /* write new configration */
98
99 writeb(spcon, hw->regs + S3C2410_SPCON);
100
101 if (hw->pdata->set_cs)
102 hw->pdata->set_cs(hw->pdata, value, cspol);
103 else
104 s3c2410_gpio_setpin(hw->pdata->pin_cs, cspol);
105
106 break;
107
108 }
109}
110
111static int s3c24xx_spi_setupxfer(struct spi_device *spi,
112 struct spi_transfer *t)
113{
114 struct s3c24xx_spi *hw = to_hw(spi);
115 unsigned int bpw;
116 unsigned int hz;
117 unsigned int div;
118
119 bpw = t ? t->bits_per_word : spi->bits_per_word;
120 hz = t ? t->speed_hz : spi->max_speed_hz;
121
122 if (bpw != 8) {
123 dev_err(&spi->dev, "invalid bits-per-word (%d)\n", bpw);
124 return -EINVAL;
125 }
126
127 div = clk_get_rate(hw->clk) / hz;
128
129 /* is clk = pclk / (2 * (pre+1)), or is it
130 * clk = (pclk * 2) / ( pre + 1) */
131
132 div = (div / 2) - 1;
133
134 if (div < 0)
135 div = 1;
136
137 if (div > 255)
138 div = 255;
139
140 dev_dbg(&spi->dev, "setting pre-scaler to %d (hz %d)\n", div, hz);
141 writeb(div, hw->regs + S3C2410_SPPRE);
142
143 spin_lock(&hw->bitbang.lock);
144 if (!hw->bitbang.busy) {
145 hw->bitbang.chipselect(spi, BITBANG_CS_INACTIVE);
146 /* need to ndelay for 0.5 clocktick ? */
147 }
148 spin_unlock(&hw->bitbang.lock);
149
150 return 0;
151}
152
153static int s3c24xx_spi_setup(struct spi_device *spi)
154{
155 int ret;
156
157 if (!spi->bits_per_word)
158 spi->bits_per_word = 8;
159
160 if ((spi->mode & SPI_LSB_FIRST) != 0)
161 return -EINVAL;
162
163 ret = s3c24xx_spi_setupxfer(spi, NULL);
164 if (ret < 0) {
165 dev_err(&spi->dev, "setupxfer returned %d\n", ret);
166 return ret;
167 }
168
169 dev_dbg(&spi->dev, "%s: mode %d, %u bpw, %d hz\n",
170 __FUNCTION__, spi->mode, spi->bits_per_word,
171 spi->max_speed_hz);
172
173 return 0;
174}
175
176static inline unsigned int hw_txbyte(struct s3c24xx_spi *hw, int count)
177{
178 return hw->tx ? hw->tx[count] : 0xff;
179}
180
181static int s3c24xx_spi_txrx(struct spi_device *spi, struct spi_transfer *t)
182{
183 struct s3c24xx_spi *hw = to_hw(spi);
184
185 dev_dbg(&spi->dev, "txrx: tx %p, rx %p, len %d\n",
186 t->tx_buf, t->rx_buf, t->len);
187
188 hw->tx = t->tx_buf;
189 hw->rx = t->rx_buf;
190 hw->len = t->len;
191 hw->count = 0;
192
193 /* send the first byte */
194 writeb(hw_txbyte(hw, 0), hw->regs + S3C2410_SPTDAT);
195 wait_for_completion(&hw->done);
196
197 return hw->count;
198}
199
200static irqreturn_t s3c24xx_spi_irq(int irq, void *dev, struct pt_regs *regs)
201{
202 struct s3c24xx_spi *hw = dev;
203 unsigned int spsta = readb(hw->regs + S3C2410_SPSTA);
204 unsigned int count = hw->count;
205
206 if (spsta & S3C2410_SPSTA_DCOL) {
207 dev_dbg(hw->dev, "data-collision\n");
208 complete(&hw->done);
209 goto irq_done;
210 }
211
212 if (!(spsta & S3C2410_SPSTA_READY)) {
213 dev_dbg(hw->dev, "spi not ready for tx?\n");
214 complete(&hw->done);
215 goto irq_done;
216 }
217
218 hw->count++;
219
220 if (hw->rx)
221 hw->rx[count] = readb(hw->regs + S3C2410_SPRDAT);
222
223 count++;
224
225 if (count < hw->len)
226 writeb(hw_txbyte(hw, count), hw->regs + S3C2410_SPTDAT);
227 else
228 complete(&hw->done);
229
230 irq_done:
231 return IRQ_HANDLED;
232}
233
234static int s3c24xx_spi_probe(struct platform_device *pdev)
235{
236 struct s3c24xx_spi *hw;
237 struct spi_master *master;
238 struct spi_board_info *bi;
239 struct resource *res;
240 int err = 0;
241 int i;
242
243 master = spi_alloc_master(&pdev->dev, sizeof(struct s3c24xx_spi));
244 if (master == NULL) {
245 dev_err(&pdev->dev, "No memory for spi_master\n");
246 err = -ENOMEM;
247 goto err_nomem;
248 }
249
250 hw = spi_master_get_devdata(master);
251 memset(hw, 0, sizeof(struct s3c24xx_spi));
252
253 hw->master = spi_master_get(master);
254 hw->pdata = pdev->dev.platform_data;
255 hw->dev = &pdev->dev;
256
257 if (hw->pdata == NULL) {
258 dev_err(&pdev->dev, "No platform data supplied\n");
259 err = -ENOENT;
260 goto err_no_pdata;
261 }
262
263 platform_set_drvdata(pdev, hw);
264 init_completion(&hw->done);
265
266 /* setup the state for the bitbang driver */
267
268 hw->bitbang.master = hw->master;
269 hw->bitbang.setup_transfer = s3c24xx_spi_setupxfer;
270 hw->bitbang.chipselect = s3c24xx_spi_chipsel;
271 hw->bitbang.txrx_bufs = s3c24xx_spi_txrx;
272 hw->bitbang.master->setup = s3c24xx_spi_setup;
273
274 dev_dbg(hw->dev, "bitbang at %p\n", &hw->bitbang);
275
276 /* find and map our resources */
277
278 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
279 if (res == NULL) {
280 dev_err(&pdev->dev, "Cannot get IORESOURCE_MEM\n");
281 err = -ENOENT;
282 goto err_no_iores;
283 }
284
285 hw->ioarea = request_mem_region(res->start, (res->end - res->start)+1,
286 pdev->name);
287
288 if (hw->ioarea == NULL) {
289 dev_err(&pdev->dev, "Cannot reserve region\n");
290 err = -ENXIO;
291 goto err_no_iores;
292 }
293
294 hw->regs = ioremap(res->start, (res->end - res->start)+1);
295 if (hw->regs == NULL) {
296 dev_err(&pdev->dev, "Cannot map IO\n");
297 err = -ENXIO;
298 goto err_no_iomap;
299 }
300
301 hw->irq = platform_get_irq(pdev, 0);
302 if (hw->irq < 0) {
303 dev_err(&pdev->dev, "No IRQ specified\n");
304 err = -ENOENT;
305 goto err_no_irq;
306 }
307
308 err = request_irq(hw->irq, s3c24xx_spi_irq, 0, pdev->name, hw);
309 if (err) {
310 dev_err(&pdev->dev, "Cannot claim IRQ\n");
311 goto err_no_irq;
312 }
313
314 hw->clk = clk_get(&pdev->dev, "spi");
315 if (IS_ERR(hw->clk)) {
316 dev_err(&pdev->dev, "No clock for device\n");
317 err = PTR_ERR(hw->clk);
318 goto err_no_clk;
319 }
320
321 /* for the moment, permanently enable the clock */
322
323 clk_enable(hw->clk);
324
325 /* program defaults into the registers */
326
327 writeb(0xff, hw->regs + S3C2410_SPPRE);
328 writeb(SPPIN_DEFAULT, hw->regs + S3C2410_SPPIN);
329 writeb(SPCON_DEFAULT, hw->regs + S3C2410_SPCON);
330
331 /* setup any gpio we can */
332
333 if (!hw->pdata->set_cs) {
334 s3c2410_gpio_setpin(hw->pdata->pin_cs, 1);
335 s3c2410_gpio_cfgpin(hw->pdata->pin_cs, S3C2410_GPIO_OUTPUT);
336 }
337
338 /* register our spi controller */
339
340 err = spi_bitbang_start(&hw->bitbang);
341 if (err) {
342 dev_err(&pdev->dev, "Failed to register SPI master\n");
343 goto err_register;
344 }
345
346 dev_dbg(hw->dev, "shutdown=%d\n", hw->bitbang.shutdown);
347
348 /* register all the devices associated */
349
350 bi = &hw->pdata->board_info[0];
351 for (i = 0; i < hw->pdata->board_size; i++, bi++) {
352 dev_info(hw->dev, "registering %s\n", bi->modalias);
353
354 bi->controller_data = hw;
355 spi_new_device(master, bi);
356 }
357
358 return 0;
359
360 err_register:
361 clk_disable(hw->clk);
362 clk_put(hw->clk);
363
364 err_no_clk:
365 free_irq(hw->irq, hw);
366
367 err_no_irq:
368 iounmap(hw->regs);
369
370 err_no_iomap:
371 release_resource(hw->ioarea);
372 kfree(hw->ioarea);
373
374 err_no_iores:
375 err_no_pdata:
376 spi_master_put(hw->master);;
377
378 err_nomem:
379 return err;
380}
381
382static int s3c24xx_spi_remove(struct platform_device *dev)
383{
384 struct s3c24xx_spi *hw = platform_get_drvdata(dev);
385
386 platform_set_drvdata(dev, NULL);
387
388 spi_unregister_master(hw->master);
389
390 clk_disable(hw->clk);
391 clk_put(hw->clk);
392
393 free_irq(hw->irq, hw);
394 iounmap(hw->regs);
395
396 release_resource(hw->ioarea);
397 kfree(hw->ioarea);
398
399 spi_master_put(hw->master);
400 return 0;
401}
402
403
404#ifdef CONFIG_PM
405
406static int s3c24xx_spi_suspend(struct platform_device *pdev, pm_message_t msg)
407{
408 struct s3c24xx_spi *hw = platform_get_drvdata(pdev);
409
410 clk_disable(hw->clk);
411 return 0;
412}
413
414static int s3c24xx_spi_resume(struct platform_device *pdev)
415{
416 struct s3c24xx_spi *hw = platform_get_drvdata(pdev);
417
418 clk_enable(hw->clk);
419 return 0;
420}
421
422#else
423#define s3c24xx_spi_suspend NULL
424#define s3c24xx_spi_resume NULL
425#endif
426
427static struct platform_driver s3c24xx_spidrv = {
428 .probe = s3c24xx_spi_probe,
429 .remove = s3c24xx_spi_remove,
430 .suspend = s3c24xx_spi_suspend,
431 .resume = s3c24xx_spi_resume,
432 .driver = {
433 .name = "s3c2410-spi",
434 .owner = THIS_MODULE,
435 },
436};
437
438static int __init s3c24xx_spi_init(void)
439{
440 return platform_driver_register(&s3c24xx_spidrv);
441}
442
443static void __exit s3c24xx_spi_exit(void)
444{
445 platform_driver_unregister(&s3c24xx_spidrv);
446}
447
448module_init(s3c24xx_spi_init);
449module_exit(s3c24xx_spi_exit);
450
451MODULE_DESCRIPTION("S3C24XX SPI Driver");
452MODULE_AUTHOR("Ben Dooks, <ben@simtec.co.uk>");
453MODULE_LICENSE("GPL");
diff --git a/drivers/spi/spi_s3c24xx_gpio.c b/drivers/spi/spi_s3c24xx_gpio.c
new file mode 100644
index 000000000000..aacdceb8f44b
--- /dev/null
+++ b/drivers/spi/spi_s3c24xx_gpio.c
@@ -0,0 +1,188 @@
1/* linux/drivers/spi/spi_s3c24xx_gpio.c
2 *
3 * Copyright (c) 2006 Ben Dooks
4 * Copyright (c) 2006 Simtec Electronics
5 *
6 * S3C24XX GPIO based SPI driver
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12*/
13
14#include <linux/config.h>
15#include <linux/kernel.h>
16#include <linux/init.h>
17#include <linux/delay.h>
18#include <linux/spinlock.h>
19#include <linux/platform_device.h>
20
21#include <linux/spi/spi.h>
22#include <linux/spi/spi_bitbang.h>
23
24#include <asm/arch/regs-gpio.h>
25#include <asm/arch/spi-gpio.h>
26#include <asm/arch/hardware.h>
27
28struct s3c2410_spigpio {
29 struct spi_bitbang bitbang;
30
31 struct s3c2410_spigpio_info *info;
32 struct platform_device *dev;
33};
34
35static inline struct s3c2410_spigpio *spidev_to_sg(struct spi_device *spi)
36{
37 return spi->controller_data;
38}
39
40static inline void setsck(struct spi_device *dev, int on)
41{
42 struct s3c2410_spigpio *sg = spidev_to_sg(dev);
43 s3c2410_gpio_setpin(sg->info->pin_clk, on ? 1 : 0);
44}
45
46static inline void setmosi(struct spi_device *dev, int on)
47{
48 struct s3c2410_spigpio *sg = spidev_to_sg(dev);
49 s3c2410_gpio_setpin(sg->info->pin_mosi, on ? 1 : 0);
50}
51
52static inline u32 getmiso(struct spi_device *dev)
53{
54 struct s3c2410_spigpio *sg = spidev_to_sg(dev);
55 return s3c2410_gpio_getpin(sg->info->pin_miso) ? 1 : 0;
56}
57
58#define spidelay(x) ndelay(x)
59
60#define EXPAND_BITBANG_TXRX
61#include <linux/spi/spi_bitbang.h>
62
63
64static u32 s3c2410_spigpio_txrx_mode0(struct spi_device *spi,
65 unsigned nsecs, u32 word, u8 bits)
66{
67 return bitbang_txrx_be_cpha0(spi, nsecs, 0, word, bits);
68}
69
70static u32 s3c2410_spigpio_txrx_mode1(struct spi_device *spi,
71 unsigned nsecs, u32 word, u8 bits)
72{
73 return bitbang_txrx_be_cpha1(spi, nsecs, 0, word, bits);
74}
75
76static void s3c2410_spigpio_chipselect(struct spi_device *dev, int value)
77{
78 struct s3c2410_spigpio *sg = spidev_to_sg(dev);
79
80 if (sg->info && sg->info->chip_select)
81 (sg->info->chip_select)(sg->info, value);
82}
83
84static int s3c2410_spigpio_probe(struct platform_device *dev)
85{
86 struct spi_master *master;
87 struct s3c2410_spigpio *sp;
88 int ret;
89 int i;
90
91 master = spi_alloc_master(&dev->dev, sizeof(struct s3c2410_spigpio));
92 if (master == NULL) {
93 dev_err(&dev->dev, "failed to allocate spi master\n");
94 ret = -ENOMEM;
95 goto err;
96 }
97
98 sp = spi_master_get_devdata(master);
99
100 platform_set_drvdata(dev, sp);
101
102 /* copy in the plkatform data */
103 sp->info = dev->dev.platform_data;
104
105 /* setup spi bitbang adaptor */
106 sp->bitbang.master = spi_master_get(master);
107 sp->bitbang.chipselect = s3c2410_spigpio_chipselect;
108
109 sp->bitbang.txrx_word[SPI_MODE_0] = s3c2410_spigpio_txrx_mode0;
110 sp->bitbang.txrx_word[SPI_MODE_1] = s3c2410_spigpio_txrx_mode1;
111
112 /* set state of spi pins */
113 s3c2410_gpio_setpin(sp->info->pin_clk, 0);
114 s3c2410_gpio_setpin(sp->info->pin_mosi, 0);
115
116 s3c2410_gpio_cfgpin(sp->info->pin_clk, S3C2410_GPIO_OUTPUT);
117 s3c2410_gpio_cfgpin(sp->info->pin_mosi, S3C2410_GPIO_OUTPUT);
118 s3c2410_gpio_cfgpin(sp->info->pin_miso, S3C2410_GPIO_INPUT);
119
120 ret = spi_bitbang_start(&sp->bitbang);
121 if (ret)
122 goto err_no_bitbang;
123
124 /* register the chips to go with the board */
125
126 for (i = 0; i < sp->info->board_size; i++) {
127 dev_info(&dev->dev, "registering %p: %s\n",
128 &sp->info->board_info[i],
129 sp->info->board_info[i].modalias);
130
131 sp->info->board_info[i].controller_data = sp;
132 spi_new_device(master, sp->info->board_info + i);
133 }
134
135 return 0;
136
137 err_no_bitbang:
138 spi_master_put(sp->bitbang.master);
139 err:
140 return ret;
141
142}
143
144static int s3c2410_spigpio_remove(struct platform_device *dev)
145{
146 struct s3c2410_spigpio *sp = platform_get_drvdata(dev);
147
148 spi_bitbang_stop(&sp->bitbang);
149 spi_master_put(sp->bitbang.master);
150
151 return 0;
152}
153
154/* all gpio should be held over suspend/resume, so we should
155 * not need to deal with this
156*/
157
158#define s3c2410_spigpio_suspend NULL
159#define s3c2410_spigpio_resume NULL
160
161
162static struct platform_driver s3c2410_spigpio_drv = {
163 .probe = s3c2410_spigpio_probe,
164 .remove = s3c2410_spigpio_remove,
165 .suspend = s3c2410_spigpio_suspend,
166 .resume = s3c2410_spigpio_resume,
167 .driver = {
168 .name = "s3c24xx-spi-gpio",
169 .owner = THIS_MODULE,
170 },
171};
172
173static int __init s3c2410_spigpio_init(void)
174{
175 return platform_driver_register(&s3c2410_spigpio_drv);
176}
177
178static void __exit s3c2410_spigpio_exit(void)
179{
180 platform_driver_unregister(&s3c2410_spigpio_drv);
181}
182
183module_init(s3c2410_spigpio_init);
184module_exit(s3c2410_spigpio_exit);
185
186MODULE_DESCRIPTION("S3C24XX SPI Driver");
187MODULE_AUTHOR("Ben Dooks, <ben@simtec.co.uk>");
188MODULE_LICENSE("GPL");
diff --git a/drivers/usb/atm/speedtch.c b/drivers/usb/atm/speedtch.c
index 7860c8a5800d..956b7a1e8af9 100644
--- a/drivers/usb/atm/speedtch.c
+++ b/drivers/usb/atm/speedtch.c
@@ -69,7 +69,7 @@ static const char speedtch_driver_name[] = "speedtch";
69#define RESUBMIT_DELAY 1000 /* milliseconds */ 69#define RESUBMIT_DELAY 1000 /* milliseconds */
70 70
71#define DEFAULT_BULK_ALTSETTING 1 71#define DEFAULT_BULK_ALTSETTING 1
72#define DEFAULT_ISOC_ALTSETTING 2 72#define DEFAULT_ISOC_ALTSETTING 3
73#define DEFAULT_DL_512_FIRST 0 73#define DEFAULT_DL_512_FIRST 0
74#define DEFAULT_ENABLE_ISOC 0 74#define DEFAULT_ENABLE_ISOC 0
75#define DEFAULT_SW_BUFFERING 0 75#define DEFAULT_SW_BUFFERING 0
diff --git a/drivers/usb/atm/ueagle-atm.c b/drivers/usb/atm/ueagle-atm.c
index 830d2c982670..b38990adf1cd 100644
--- a/drivers/usb/atm/ueagle-atm.c
+++ b/drivers/usb/atm/ueagle-atm.c
@@ -68,7 +68,7 @@
68 68
69#include "usbatm.h" 69#include "usbatm.h"
70 70
71#define EAGLEUSBVERSION "ueagle 1.2" 71#define EAGLEUSBVERSION "ueagle 1.3"
72 72
73 73
74/* 74/*
@@ -243,7 +243,7 @@ enum {
243#define BULK_TIMEOUT 300 243#define BULK_TIMEOUT 300
244#define CTRL_TIMEOUT 1000 244#define CTRL_TIMEOUT 1000
245 245
246#define ACK_TIMEOUT msecs_to_jiffies(1500) 246#define ACK_TIMEOUT msecs_to_jiffies(3000)
247 247
248#define UEA_INTR_IFACE_NO 0 248#define UEA_INTR_IFACE_NO 0
249#define UEA_US_IFACE_NO 1 249#define UEA_US_IFACE_NO 1
@@ -314,6 +314,10 @@ struct cmv {
314 ((d) & 0xff) << 16 | \ 314 ((d) & 0xff) << 16 | \
315 ((a) & 0xff) << 8 | \ 315 ((a) & 0xff) << 8 | \
316 ((b) & 0xff)) 316 ((b) & 0xff))
317#define GETSA1(a) ((a >> 8) & 0xff)
318#define GETSA2(a) (a & 0xff)
319#define GETSA3(a) ((a >> 24) & 0xff)
320#define GETSA4(a) ((a >> 16) & 0xff)
317 321
318#define SA_CNTL MAKESA('C', 'N', 'T', 'L') 322#define SA_CNTL MAKESA('C', 'N', 'T', 'L')
319#define SA_DIAG MAKESA('D', 'I', 'A', 'G') 323#define SA_DIAG MAKESA('D', 'I', 'A', 'G')
@@ -728,11 +732,12 @@ bad2:
728 uea_err(INS_TO_USBDEV(sc), "sending DSP block %u failed\n", i); 732 uea_err(INS_TO_USBDEV(sc), "sending DSP block %u failed\n", i);
729 return; 733 return;
730bad1: 734bad1:
731 uea_err(INS_TO_USBDEV(sc), "invalid DSP page %u requested\n",pageno); 735 uea_err(INS_TO_USBDEV(sc), "invalid DSP page %u requested\n", pageno);
732} 736}
733 737
734static inline void wake_up_cmv_ack(struct uea_softc *sc) 738static inline void wake_up_cmv_ack(struct uea_softc *sc)
735{ 739{
740 BUG_ON(sc->cmv_ack);
736 sc->cmv_ack = 1; 741 sc->cmv_ack = 1;
737 wake_up(&sc->cmv_ack_wait); 742 wake_up(&sc->cmv_ack_wait);
738} 743}
@@ -743,6 +748,9 @@ static inline int wait_cmv_ack(struct uea_softc *sc)
743 sc->cmv_ack, ACK_TIMEOUT); 748 sc->cmv_ack, ACK_TIMEOUT);
744 sc->cmv_ack = 0; 749 sc->cmv_ack = 0;
745 750
751 uea_dbg(INS_TO_USBDEV(sc), "wait_event_timeout : %d ms\n",
752 jiffies_to_msecs(ret));
753
746 if (ret < 0) 754 if (ret < 0)
747 return ret; 755 return ret;
748 756
@@ -791,6 +799,12 @@ static int uea_cmv(struct uea_softc *sc,
791 struct cmv cmv; 799 struct cmv cmv;
792 int ret; 800 int ret;
793 801
802 uea_enters(INS_TO_USBDEV(sc));
803 uea_vdbg(INS_TO_USBDEV(sc), "Function : %d-%d, Address : %c%c%c%c, "
804 "offset : 0x%04x, data : 0x%08x\n",
805 FUNCTION_TYPE(function), FUNCTION_SUBTYPE(function),
806 GETSA1(address), GETSA2(address), GETSA3(address),
807 GETSA4(address), offset, data);
794 /* we send a request, but we expect a reply */ 808 /* we send a request, but we expect a reply */
795 sc->cmv_function = function | 0x2; 809 sc->cmv_function = function | 0x2;
796 sc->cmv_idx++; 810 sc->cmv_idx++;
@@ -808,7 +822,9 @@ static int uea_cmv(struct uea_softc *sc,
808 ret = uea_request(sc, UEA_SET_BLOCK, UEA_MPTX_START, CMV_SIZE, &cmv); 822 ret = uea_request(sc, UEA_SET_BLOCK, UEA_MPTX_START, CMV_SIZE, &cmv);
809 if (ret < 0) 823 if (ret < 0)
810 return ret; 824 return ret;
811 return wait_cmv_ack(sc); 825 ret = wait_cmv_ack(sc);
826 uea_leaves(INS_TO_USBDEV(sc));
827 return ret;
812} 828}
813 829
814static inline int uea_read_cmv(struct uea_softc *sc, 830static inline int uea_read_cmv(struct uea_softc *sc,
@@ -922,7 +938,7 @@ static int uea_stat(struct uea_softc *sc)
922 * we check the status again in order to detect the failure earlier 938 * we check the status again in order to detect the failure earlier
923 */ 939 */
924 if (sc->stats.phy.flags) { 940 if (sc->stats.phy.flags) {
925 uea_dbg(INS_TO_USBDEV(sc), "Stat flag = %d\n", 941 uea_dbg(INS_TO_USBDEV(sc), "Stat flag = 0x%x\n",
926 sc->stats.phy.flags); 942 sc->stats.phy.flags);
927 return 0; 943 return 0;
928 } 944 }
@@ -1063,7 +1079,13 @@ static int uea_start_reset(struct uea_softc *sc)
1063 uea_enters(INS_TO_USBDEV(sc)); 1079 uea_enters(INS_TO_USBDEV(sc));
1064 uea_info(INS_TO_USBDEV(sc), "(re)booting started\n"); 1080 uea_info(INS_TO_USBDEV(sc), "(re)booting started\n");
1065 1081
1082 /* mask interrupt */
1066 sc->booting = 1; 1083 sc->booting = 1;
1084 /* We need to set this here because, a ack timeout could have occured,
1085 * but before we start the reboot, the ack occurs and set this to 1.
1086 * So we will failed to wait Ready CMV.
1087 */
1088 sc->cmv_ack = 0;
1067 UPDATE_ATM_STAT(signal, ATM_PHY_SIG_LOST); 1089 UPDATE_ATM_STAT(signal, ATM_PHY_SIG_LOST);
1068 1090
1069 /* reset statistics */ 1091 /* reset statistics */
@@ -1089,6 +1111,7 @@ static int uea_start_reset(struct uea_softc *sc)
1089 1111
1090 msleep(1000); 1112 msleep(1000);
1091 sc->cmv_function = MAKEFUNCTION(ADSLDIRECTIVE, MODEMREADY); 1113 sc->cmv_function = MAKEFUNCTION(ADSLDIRECTIVE, MODEMREADY);
1114 /* demask interrupt */
1092 sc->booting = 0; 1115 sc->booting = 0;
1093 1116
1094 /* start loading DSP */ 1117 /* start loading DSP */
@@ -1101,6 +1124,8 @@ static int uea_start_reset(struct uea_softc *sc)
1101 if (ret < 0) 1124 if (ret < 0)
1102 return ret; 1125 return ret;
1103 1126
1127 uea_vdbg(INS_TO_USBDEV(sc), "Ready CMV received\n");
1128
1104 /* Enter in R-IDLE (cmv) until instructed otherwise */ 1129 /* Enter in R-IDLE (cmv) until instructed otherwise */
1105 ret = uea_write_cmv(sc, SA_CNTL, 0, 1); 1130 ret = uea_write_cmv(sc, SA_CNTL, 0, 1);
1106 if (ret < 0) 1131 if (ret < 0)
@@ -1121,6 +1146,7 @@ static int uea_start_reset(struct uea_softc *sc)
1121 } 1146 }
1122 /* Enter in R-ACT-REQ */ 1147 /* Enter in R-ACT-REQ */
1123 ret = uea_write_cmv(sc, SA_CNTL, 0, 2); 1148 ret = uea_write_cmv(sc, SA_CNTL, 0, 2);
1149 uea_vdbg(INS_TO_USBDEV(sc), "Entering in R-ACT-REQ state\n");
1124out: 1150out:
1125 release_firmware(cmvs_fw); 1151 release_firmware(cmvs_fw);
1126 sc->reset = 0; 1152 sc->reset = 0;
@@ -1235,6 +1261,7 @@ static void uea_dispatch_cmv(struct uea_softc *sc, struct cmv* cmv)
1235 1261
1236 if (cmv->bFunction == MAKEFUNCTION(ADSLDIRECTIVE, MODEMREADY)) { 1262 if (cmv->bFunction == MAKEFUNCTION(ADSLDIRECTIVE, MODEMREADY)) {
1237 wake_up_cmv_ack(sc); 1263 wake_up_cmv_ack(sc);
1264 uea_leaves(INS_TO_USBDEV(sc));
1238 return; 1265 return;
1239 } 1266 }
1240 1267
@@ -1249,6 +1276,7 @@ static void uea_dispatch_cmv(struct uea_softc *sc, struct cmv* cmv)
1249 sc->data = sc->data << 16 | sc->data >> 16; 1276 sc->data = sc->data << 16 | sc->data >> 16;
1250 1277
1251 wake_up_cmv_ack(sc); 1278 wake_up_cmv_ack(sc);
1279 uea_leaves(INS_TO_USBDEV(sc));
1252 return; 1280 return;
1253 1281
1254bad2: 1282bad2:
@@ -1256,12 +1284,14 @@ bad2:
1256 "Function : %d, Subfunction : %d\n", 1284 "Function : %d, Subfunction : %d\n",
1257 FUNCTION_TYPE(cmv->bFunction), 1285 FUNCTION_TYPE(cmv->bFunction),
1258 FUNCTION_SUBTYPE(cmv->bFunction)); 1286 FUNCTION_SUBTYPE(cmv->bFunction));
1287 uea_leaves(INS_TO_USBDEV(sc));
1259 return; 1288 return;
1260 1289
1261bad1: 1290bad1:
1262 uea_err(INS_TO_USBDEV(sc), "invalid cmv received, " 1291 uea_err(INS_TO_USBDEV(sc), "invalid cmv received, "
1263 "wPreamble %d, bDirection %d\n", 1292 "wPreamble %d, bDirection %d\n",
1264 le16_to_cpu(cmv->wPreamble), cmv->bDirection); 1293 le16_to_cpu(cmv->wPreamble), cmv->bDirection);
1294 uea_leaves(INS_TO_USBDEV(sc));
1265} 1295}
1266 1296
1267/* 1297/*
@@ -1346,7 +1376,7 @@ static int uea_boot(struct uea_softc *sc)
1346 if (ret < 0) { 1376 if (ret < 0) {
1347 uea_err(INS_TO_USBDEV(sc), 1377 uea_err(INS_TO_USBDEV(sc),
1348 "urb submition failed with error %d\n", ret); 1378 "urb submition failed with error %d\n", ret);
1349 goto err1; 1379 goto err;
1350 } 1380 }
1351 1381
1352 sc->kthread = kthread_run(uea_kthread, sc, "ueagle-atm"); 1382 sc->kthread = kthread_run(uea_kthread, sc, "ueagle-atm");
@@ -1360,10 +1390,10 @@ static int uea_boot(struct uea_softc *sc)
1360 1390
1361err2: 1391err2:
1362 usb_kill_urb(sc->urb_int); 1392 usb_kill_urb(sc->urb_int);
1363err1:
1364 kfree(intr);
1365err: 1393err:
1366 usb_free_urb(sc->urb_int); 1394 usb_free_urb(sc->urb_int);
1395 sc->urb_int = NULL;
1396 kfree(intr);
1367 uea_leaves(INS_TO_USBDEV(sc)); 1397 uea_leaves(INS_TO_USBDEV(sc));
1368 return -ENOMEM; 1398 return -ENOMEM;
1369} 1399}
@@ -1508,7 +1538,7 @@ static ssize_t read_##name(struct device *dev, \
1508 int ret = -ENODEV; \ 1538 int ret = -ENODEV; \
1509 struct uea_softc *sc; \ 1539 struct uea_softc *sc; \
1510 \ 1540 \
1511 mutex_lock(&uea_mutex); \ 1541 mutex_lock(&uea_mutex); \
1512 sc = dev_to_uea(dev); \ 1542 sc = dev_to_uea(dev); \
1513 if (!sc) \ 1543 if (!sc) \
1514 goto out; \ 1544 goto out; \
@@ -1516,7 +1546,7 @@ static ssize_t read_##name(struct device *dev, \
1516 if (reset) \ 1546 if (reset) \
1517 sc->stats.phy.name = 0; \ 1547 sc->stats.phy.name = 0; \
1518out: \ 1548out: \
1519 mutex_unlock(&uea_mutex); \ 1549 mutex_unlock(&uea_mutex); \
1520 return ret; \ 1550 return ret; \
1521} \ 1551} \
1522 \ 1552 \
@@ -1643,7 +1673,7 @@ static int uea_bind(struct usbatm_data *usbatm, struct usb_interface *intf,
1643 1673
1644 sc = kzalloc(sizeof(struct uea_softc), GFP_KERNEL); 1674 sc = kzalloc(sizeof(struct uea_softc), GFP_KERNEL);
1645 if (!sc) { 1675 if (!sc) {
1646 uea_err(INS_TO_USBDEV(sc), "uea_init: not enough memory !\n"); 1676 uea_err(usb, "uea_init: not enough memory !\n");
1647 return -ENOMEM; 1677 return -ENOMEM;
1648 } 1678 }
1649 1679
diff --git a/drivers/usb/atm/usbatm.c b/drivers/usb/atm/usbatm.c
index c1211fc037d9..546249843b8e 100644
--- a/drivers/usb/atm/usbatm.c
+++ b/drivers/usb/atm/usbatm.c
@@ -99,11 +99,11 @@ static const char usbatm_driver_name[] = "usbatm";
99 99
100#define UDSL_MAX_RCV_URBS 16 100#define UDSL_MAX_RCV_URBS 16
101#define UDSL_MAX_SND_URBS 16 101#define UDSL_MAX_SND_URBS 16
102#define UDSL_MAX_BUF_SIZE 64 * 1024 /* bytes */ 102#define UDSL_MAX_BUF_SIZE 65536
103#define UDSL_DEFAULT_RCV_URBS 4 103#define UDSL_DEFAULT_RCV_URBS 4
104#define UDSL_DEFAULT_SND_URBS 4 104#define UDSL_DEFAULT_SND_URBS 4
105#define UDSL_DEFAULT_RCV_BUF_SIZE 64 * ATM_CELL_SIZE /* bytes */ 105#define UDSL_DEFAULT_RCV_BUF_SIZE 3392 /* 64 * ATM_CELL_SIZE */
106#define UDSL_DEFAULT_SND_BUF_SIZE 64 * ATM_CELL_SIZE /* bytes */ 106#define UDSL_DEFAULT_SND_BUF_SIZE 3392 /* 64 * ATM_CELL_SIZE */
107 107
108#define ATM_CELL_HEADER (ATM_CELL_SIZE - ATM_CELL_PAYLOAD) 108#define ATM_CELL_HEADER (ATM_CELL_SIZE - ATM_CELL_PAYLOAD)
109 109
@@ -135,7 +135,7 @@ MODULE_PARM_DESC(rcv_buf_bytes,
135module_param(snd_buf_bytes, uint, S_IRUGO); 135module_param(snd_buf_bytes, uint, S_IRUGO);
136MODULE_PARM_DESC(snd_buf_bytes, 136MODULE_PARM_DESC(snd_buf_bytes,
137 "Size of the buffers used for transmission, in bytes (range: 1-" 137 "Size of the buffers used for transmission, in bytes (range: 1-"
138 __MODULE_STRING(UDSL_MAX_SND_BUF_SIZE) ", default: " 138 __MODULE_STRING(UDSL_MAX_BUF_SIZE) ", default: "
139 __MODULE_STRING(UDSL_DEFAULT_SND_BUF_SIZE) ")"); 139 __MODULE_STRING(UDSL_DEFAULT_SND_BUF_SIZE) ")");
140 140
141 141
diff --git a/drivers/usb/core/Kconfig b/drivers/usb/core/Kconfig
index ff03184da403..a08787e253aa 100644
--- a/drivers/usb/core/Kconfig
+++ b/drivers/usb/core/Kconfig
@@ -99,4 +99,11 @@ config USB_OTG_WHITELIST
99 normal Linux-USB hosts do (other than the warning), and is 99 normal Linux-USB hosts do (other than the warning), and is
100 convenient for many stages of product development. 100 convenient for many stages of product development.
101 101
102config USB_OTG_BLACKLIST_HUB
103 bool "Disable external hubs"
104 depends on USB_OTG
105 help
106 If you say Y here, then Linux will refuse to enumerate
107 external hubs. OTG hosts are allowed to reduce hardware
108 and software costs by not supporting external hubs.
102 109
diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c
index 0d2193b69235..66b78404ab34 100644
--- a/drivers/usb/core/hcd-pci.c
+++ b/drivers/usb/core/hcd-pci.c
@@ -213,11 +213,9 @@ int usb_hcd_pci_suspend (struct pci_dev *dev, pm_message_t message)
213 213
214 if (hcd->driver->suspend) { 214 if (hcd->driver->suspend) {
215 retval = hcd->driver->suspend(hcd, message); 215 retval = hcd->driver->suspend(hcd, message);
216 if (retval) { 216 suspend_report_result(hcd->driver->suspend, retval);
217 dev_dbg (&dev->dev, "PCI pre-suspend fail, %d\n", 217 if (retval)
218 retval);
219 goto done; 218 goto done;
220 }
221 } 219 }
222 synchronize_irq(dev->irq); 220 synchronize_irq(dev->irq);
223 221
@@ -263,6 +261,7 @@ int usb_hcd_pci_suspend (struct pci_dev *dev, pm_message_t message)
263 * some device state (e.g. as part of clock reinit). 261 * some device state (e.g. as part of clock reinit).
264 */ 262 */
265 retval = pci_set_power_state (dev, PCI_D3hot); 263 retval = pci_set_power_state (dev, PCI_D3hot);
264 suspend_report_result(pci_set_power_state, retval);
266 if (retval == 0) { 265 if (retval == 0) {
267 int wake = device_can_wakeup(&hcd->self.root_hub->dev); 266 int wake = device_can_wakeup(&hcd->self.root_hub->dev);
268 267
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index fbd938d4ea58..e2e00ba4e1e6 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -1805,6 +1805,12 @@ int usb_add_hcd(struct usb_hcd *hcd,
1805 USB_SPEED_FULL; 1805 USB_SPEED_FULL;
1806 hcd->self.root_hub = rhdev; 1806 hcd->self.root_hub = rhdev;
1807 1807
1808 /* wakeup flag init defaults to "everything works" for root hubs,
1809 * but drivers can override it in reset() if needed, along with
1810 * recording the overall controller's system wakeup capability.
1811 */
1812 device_init_wakeup(&rhdev->dev, 1);
1813
1808 /* "reset" is misnamed; its role is now one-time init. the controller 1814 /* "reset" is misnamed; its role is now one-time init. the controller
1809 * should already have been reset (and boot firmware kicked off etc). 1815 * should already have been reset (and boot firmware kicked off etc).
1810 */ 1816 */
@@ -1813,13 +1819,6 @@ int usb_add_hcd(struct usb_hcd *hcd,
1813 goto err_hcd_driver_setup; 1819 goto err_hcd_driver_setup;
1814 } 1820 }
1815 1821
1816 /* wakeup flag init is in transition; for now we can't rely on PCI to
1817 * initialize these bits properly, so we let reset() override it.
1818 * This init should _precede_ the reset() once PCI behaves.
1819 */
1820 device_init_wakeup(&rhdev->dev,
1821 device_can_wakeup(hcd->self.controller));
1822
1823 /* NOTE: root hub and controller capabilities may not be the same */ 1822 /* NOTE: root hub and controller capabilities may not be the same */
1824 if (device_can_wakeup(hcd->self.controller) 1823 if (device_can_wakeup(hcd->self.controller)
1825 && device_can_wakeup(&hcd->self.root_hub->dev)) 1824 && device_can_wakeup(&hcd->self.root_hub->dev))
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 8e65f7a237e4..90b8d43c6b33 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -836,6 +836,13 @@ static int hub_probe(struct usb_interface *intf, const struct usb_device_id *id)
836 desc = intf->cur_altsetting; 836 desc = intf->cur_altsetting;
837 hdev = interface_to_usbdev(intf); 837 hdev = interface_to_usbdev(intf);
838 838
839#ifdef CONFIG_USB_OTG_BLACKLIST_HUB
840 if (hdev->parent) {
841 dev_warn(&intf->dev, "ignoring external hub\n");
842 return -ENODEV;
843 }
844#endif
845
839 /* Some hubs have a subclass of 1, which AFAICT according to the */ 846 /* Some hubs have a subclass of 1, which AFAICT according to the */
840 /* specs is not defined, but it works */ 847 /* specs is not defined, but it works */
841 if ((desc->desc.bInterfaceSubClass != 0) && 848 if ((desc->desc.bInterfaceSubClass != 0) &&
@@ -1022,7 +1029,6 @@ void usb_set_device_state(struct usb_device *udev,
1022 recursively_mark_NOTATTACHED(udev); 1029 recursively_mark_NOTATTACHED(udev);
1023 spin_unlock_irqrestore(&device_state_lock, flags); 1030 spin_unlock_irqrestore(&device_state_lock, flags);
1024} 1031}
1025EXPORT_SYMBOL(usb_set_device_state);
1026 1032
1027 1033
1028#ifdef CONFIG_PM 1034#ifdef CONFIG_PM
@@ -1162,19 +1168,9 @@ static inline const char *plural(int n)
1162static int choose_configuration(struct usb_device *udev) 1168static int choose_configuration(struct usb_device *udev)
1163{ 1169{
1164 int i; 1170 int i;
1165 u16 devstatus;
1166 int bus_powered;
1167 int num_configs; 1171 int num_configs;
1168 struct usb_host_config *c, *best; 1172 struct usb_host_config *c, *best;
1169 1173
1170 /* If this fails, assume the device is bus-powered */
1171 devstatus = 0;
1172 usb_get_status(udev, USB_RECIP_DEVICE, 0, &devstatus);
1173 le16_to_cpus(&devstatus);
1174 bus_powered = ((devstatus & (1 << USB_DEVICE_SELF_POWERED)) == 0);
1175 dev_dbg(&udev->dev, "device is %s-powered\n",
1176 bus_powered ? "bus" : "self");
1177
1178 best = NULL; 1174 best = NULL;
1179 c = udev->config; 1175 c = udev->config;
1180 num_configs = udev->descriptor.bNumConfigurations; 1176 num_configs = udev->descriptor.bNumConfigurations;
@@ -1191,6 +1187,19 @@ static int choose_configuration(struct usb_device *udev)
1191 * similar errors in their descriptors. If the next test 1187 * similar errors in their descriptors. If the next test
1192 * were allowed to execute, such configurations would always 1188 * were allowed to execute, such configurations would always
1193 * be rejected and the devices would not work as expected. 1189 * be rejected and the devices would not work as expected.
1190 * In the meantime, we run the risk of selecting a config
1191 * that requires external power at a time when that power
1192 * isn't available. It seems to be the lesser of two evils.
1193 *
1194 * Bugzilla #6448 reports a device that appears to crash
1195 * when it receives a GET_DEVICE_STATUS request! We don't
1196 * have any other way to tell whether a device is self-powered,
1197 * but since we don't use that information anywhere but here,
1198 * the call has been removed.
1199 *
1200 * Maybe the GET_DEVICE_STATUS call and the test below can
1201 * be reinstated when device firmwares become more reliable.
1202 * Don't hold your breath.
1194 */ 1203 */
1195#if 0 1204#if 0
1196 /* Rule out self-powered configs for a bus-powered device */ 1205 /* Rule out self-powered configs for a bus-powered device */
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
index d7352aa73b5e..b7fdc1cd134a 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers/usb/core/usb.c
@@ -1194,7 +1194,6 @@ EXPORT_SYMBOL(usb_disabled);
1194EXPORT_SYMBOL_GPL(usb_get_intf); 1194EXPORT_SYMBOL_GPL(usb_get_intf);
1195EXPORT_SYMBOL_GPL(usb_put_intf); 1195EXPORT_SYMBOL_GPL(usb_put_intf);
1196 1196
1197EXPORT_SYMBOL(usb_alloc_dev);
1198EXPORT_SYMBOL(usb_put_dev); 1197EXPORT_SYMBOL(usb_put_dev);
1199EXPORT_SYMBOL(usb_get_dev); 1198EXPORT_SYMBOL(usb_get_dev);
1200EXPORT_SYMBOL(usb_hub_tt_clear_buffer); 1199EXPORT_SYMBOL(usb_hub_tt_clear_buffer);
@@ -1208,7 +1207,6 @@ EXPORT_SYMBOL(usb_ifnum_to_if);
1208EXPORT_SYMBOL(usb_altnum_to_altsetting); 1207EXPORT_SYMBOL(usb_altnum_to_altsetting);
1209 1208
1210EXPORT_SYMBOL(usb_reset_device); 1209EXPORT_SYMBOL(usb_reset_device);
1211EXPORT_SYMBOL(usb_disconnect);
1212 1210
1213EXPORT_SYMBOL(__usb_get_extra_descriptor); 1211EXPORT_SYMBOL(__usb_get_extra_descriptor);
1214 1212
diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
index d80f71877d68..363b2ad74ae6 100644
--- a/drivers/usb/gadget/Kconfig
+++ b/drivers/usb/gadget/Kconfig
@@ -69,11 +69,11 @@ choice
69 often need board-specific hooks. 69 often need board-specific hooks.
70 70
71config USB_GADGET_NET2280 71config USB_GADGET_NET2280
72 boolean "NetChip 2280" 72 boolean "NetChip 228x"
73 depends on PCI 73 depends on PCI
74 select USB_GADGET_DUALSPEED 74 select USB_GADGET_DUALSPEED
75 help 75 help
76 NetChip 2280 is a PCI based USB peripheral controller which 76 NetChip 2280 / 2282 is a PCI based USB peripheral controller which
77 supports both full and high speed USB 2.0 data transfers. 77 supports both full and high speed USB 2.0 data transfers.
78 78
79 It has six configurable endpoints, as well as endpoint zero 79 It has six configurable endpoints, as well as endpoint zero
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
index 865858cfd1c2..b8d0b7825bf3 100644
--- a/drivers/usb/gadget/at91_udc.c
+++ b/drivers/usb/gadget/at91_udc.c
@@ -1709,7 +1709,7 @@ static int __devexit at91udc_remove(struct platform_device *dev)
1709} 1709}
1710 1710
1711#ifdef CONFIG_PM 1711#ifdef CONFIG_PM
1712static int at91udc_suspend(struct platform_device *dev, u32 state, u32 level) 1712static int at91udc_suspend(struct platform_device *dev, pm_message_t mesg)
1713{ 1713{
1714 struct at91_udc *udc = platform_get_drvdata(dev); 1714 struct at91_udc *udc = platform_get_drvdata(dev);
1715 1715
@@ -1731,7 +1731,7 @@ static int at91udc_suspend(struct platform_device *dev, u32 state, u32 level)
1731 return 0; 1731 return 0;
1732} 1732}
1733 1733
1734static int at91udc_resume(struct platform_device *dev, u32 level) 1734static int at91udc_resume(struct platform_device *dev)
1735{ 1735{
1736 struct at91_udc *udc = platform_get_drvdata(dev); 1736 struct at91_udc *udc = platform_get_drvdata(dev);
1737 1737
diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index c3d8e5c5bf28..9c4422ac9de4 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -2338,6 +2338,9 @@ autoconf_fail:
2338 hs_subset_descriptors(); 2338 hs_subset_descriptors();
2339 } 2339 }
2340 2340
2341 device_desc.bMaxPacketSize0 = gadget->ep0->maxpacket;
2342 usb_gadget_set_selfpowered (gadget);
2343
2341 /* For now RNDIS is always a second config */ 2344 /* For now RNDIS is always a second config */
2342 if (rndis) 2345 if (rndis)
2343 device_desc.bNumConfigurations = 2; 2346 device_desc.bNumConfigurations = 2;
@@ -2361,9 +2364,6 @@ autoconf_fail:
2361#endif 2364#endif
2362#endif /* DUALSPEED */ 2365#endif /* DUALSPEED */
2363 2366
2364 device_desc.bMaxPacketSize0 = gadget->ep0->maxpacket;
2365 usb_gadget_set_selfpowered (gadget);
2366
2367 if (gadget->is_otg) { 2367 if (gadget->is_otg) {
2368 otg_descriptor.bmAttributes |= USB_OTG_HNP, 2368 otg_descriptor.bmAttributes |= USB_OTG_HNP,
2369 eth_config.bmAttributes |= USB_CONFIG_ATT_WAKEUP; 2369 eth_config.bmAttributes |= USB_CONFIG_ATT_WAKEUP;
diff --git a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c
index cf3be299e353..6f887478b148 100644
--- a/drivers/usb/gadget/file_storage.c
+++ b/drivers/usb/gadget/file_storage.c
@@ -71,6 +71,12 @@
71 * requirement amounts to two 16K buffers, size configurable by a parameter. 71 * requirement amounts to two 16K buffers, size configurable by a parameter.
72 * Support is included for both full-speed and high-speed operation. 72 * Support is included for both full-speed and high-speed operation.
73 * 73 *
74 * Note that the driver is slightly non-portable in that it assumes a
75 * single memory/DMA buffer will be useable for bulk-in, bulk-out, and
76 * interrupt-in endpoints. With most device controllers this isn't an
77 * issue, but there may be some with hardware restrictions that prevent
78 * a buffer from being used by more than one endpoint.
79 *
74 * Module options: 80 * Module options:
75 * 81 *
76 * file=filename[,filename...] 82 * file=filename[,filename...]
@@ -108,6 +114,14 @@
108 * setting are not allowed when the medium is loaded. 114 * setting are not allowed when the medium is loaded.
109 * 115 *
110 * This gadget driver is heavily based on "Gadget Zero" by David Brownell. 116 * This gadget driver is heavily based on "Gadget Zero" by David Brownell.
117 * The driver's SCSI command interface was based on the "Information
118 * technology - Small Computer System Interface - 2" document from
119 * X3T9.2 Project 375D, Revision 10L, 7-SEP-93, available at
120 * <http://www.t10.org/ftp/t10/drafts/s2/s2-r10l.pdf>. The single exception
121 * is opcode 0x23 (READ FORMAT CAPACITIES), which was based on the
122 * "Universal Serial Bus Mass Storage Class UFI Command Specification"
123 * document, Revision 1.0, December 14, 1998, available at
124 * <http://www.usb.org/developers/devclass_docs/usbmass-ufi10.pdf>.
111 */ 125 */
112 126
113 127
@@ -334,11 +348,9 @@ MODULE_LICENSE("Dual BSD/GPL");
334 348
335#define MAX_LUNS 8 349#define MAX_LUNS 8
336 350
337 /* Arggh! There should be a module_param_array_named macro! */
338static char *file[MAX_LUNS];
339static int ro[MAX_LUNS];
340
341static struct { 351static struct {
352 char *file[MAX_LUNS];
353 int ro[MAX_LUNS];
342 int num_filenames; 354 int num_filenames;
343 int num_ros; 355 int num_ros;
344 unsigned int nluns; 356 unsigned int nluns;
@@ -370,10 +382,11 @@ static struct {
370 }; 382 };
371 383
372 384
373module_param_array(file, charp, &mod_data.num_filenames, S_IRUGO); 385module_param_array_named(file, mod_data.file, charp, &mod_data.num_filenames,
386 S_IRUGO);
374MODULE_PARM_DESC(file, "names of backing files or devices"); 387MODULE_PARM_DESC(file, "names of backing files or devices");
375 388
376module_param_array(ro, bool, &mod_data.num_ros, S_IRUGO); 389module_param_array_named(ro, mod_data.ro, bool, &mod_data.num_ros, S_IRUGO);
377MODULE_PARM_DESC(ro, "true to force read-only"); 390MODULE_PARM_DESC(ro, "true to force read-only");
378 391
379module_param_named(luns, mod_data.nluns, uint, S_IRUGO); 392module_param_named(luns, mod_data.nluns, uint, S_IRUGO);
@@ -1795,6 +1808,7 @@ static int do_write(struct fsg_dev *fsg)
1795 * the bulk-out maxpacket size */ 1808 * the bulk-out maxpacket size */
1796 bh->outreq->length = bh->bulk_out_intended_length = 1809 bh->outreq->length = bh->bulk_out_intended_length =
1797 amount; 1810 amount;
1811 bh->outreq->short_not_ok = 1;
1798 start_transfer(fsg, fsg->bulk_out, bh->outreq, 1812 start_transfer(fsg, fsg->bulk_out, bh->outreq,
1799 &bh->outreq_busy, &bh->state); 1813 &bh->outreq_busy, &bh->state);
1800 fsg->next_buffhd_to_fill = bh->next; 1814 fsg->next_buffhd_to_fill = bh->next;
@@ -2398,6 +2412,7 @@ static int throw_away_data(struct fsg_dev *fsg)
2398 * the bulk-out maxpacket size */ 2412 * the bulk-out maxpacket size */
2399 bh->outreq->length = bh->bulk_out_intended_length = 2413 bh->outreq->length = bh->bulk_out_intended_length =
2400 amount; 2414 amount;
2415 bh->outreq->short_not_ok = 1;
2401 start_transfer(fsg, fsg->bulk_out, bh->outreq, 2416 start_transfer(fsg, fsg->bulk_out, bh->outreq,
2402 &bh->outreq_busy, &bh->state); 2417 &bh->outreq_busy, &bh->state);
2403 fsg->next_buffhd_to_fill = bh->next; 2418 fsg->next_buffhd_to_fill = bh->next;
@@ -3029,6 +3044,7 @@ static int get_next_command(struct fsg_dev *fsg)
3029 3044
3030 /* Queue a request to read a Bulk-only CBW */ 3045 /* Queue a request to read a Bulk-only CBW */
3031 set_bulk_out_req_length(fsg, bh, USB_BULK_CB_WRAP_LEN); 3046 set_bulk_out_req_length(fsg, bh, USB_BULK_CB_WRAP_LEN);
3047 bh->outreq->short_not_ok = 1;
3032 start_transfer(fsg, fsg->bulk_out, bh->outreq, 3048 start_transfer(fsg, fsg->bulk_out, bh->outreq,
3033 &bh->outreq_busy, &bh->state); 3049 &bh->outreq_busy, &bh->state);
3034 3050
@@ -3859,7 +3875,7 @@ static int __init fsg_bind(struct usb_gadget *gadget)
3859 3875
3860 for (i = 0; i < fsg->nluns; ++i) { 3876 for (i = 0; i < fsg->nluns; ++i) {
3861 curlun = &fsg->luns[i]; 3877 curlun = &fsg->luns[i];
3862 curlun->ro = ro[i]; 3878 curlun->ro = mod_data.ro[i];
3863 curlun->dev.parent = &gadget->dev; 3879 curlun->dev.parent = &gadget->dev;
3864 curlun->dev.driver = &fsg_driver.driver; 3880 curlun->dev.driver = &fsg_driver.driver;
3865 dev_set_drvdata(&curlun->dev, fsg); 3881 dev_set_drvdata(&curlun->dev, fsg);
@@ -3876,8 +3892,9 @@ static int __init fsg_bind(struct usb_gadget *gadget)
3876 kref_get(&fsg->ref); 3892 kref_get(&fsg->ref);
3877 } 3893 }
3878 3894
3879 if (file[i] && *file[i]) { 3895 if (mod_data.file[i] && *mod_data.file[i]) {
3880 if ((rc = open_backing_file(curlun, file[i])) != 0) 3896 if ((rc = open_backing_file(curlun,
3897 mod_data.file[i])) != 0)
3881 goto out; 3898 goto out;
3882 } else if (!mod_data.removable) { 3899 } else if (!mod_data.removable) {
3883 ERROR(fsg, "no file given for LUN%d\n", i); 3900 ERROR(fsg, "no file given for LUN%d\n", i);
@@ -3953,6 +3970,9 @@ static int __init fsg_bind(struct usb_gadget *gadget)
3953 for (i = 0; i < NUM_BUFFERS; ++i) { 3970 for (i = 0; i < NUM_BUFFERS; ++i) {
3954 struct fsg_buffhd *bh = &fsg->buffhds[i]; 3971 struct fsg_buffhd *bh = &fsg->buffhds[i];
3955 3972
3973 /* Allocate for the bulk-in endpoint. We assume that
3974 * the buffer will also work with the bulk-out (and
3975 * interrupt-in) endpoint. */
3956 bh->buf = usb_ep_alloc_buffer(fsg->bulk_in, mod_data.buflen, 3976 bh->buf = usb_ep_alloc_buffer(fsg->bulk_in, mod_data.buflen,
3957 &bh->dma, GFP_KERNEL); 3977 &bh->dma, GFP_KERNEL);
3958 if (!bh->buf) 3978 if (!bh->buf)
diff --git a/drivers/usb/gadget/gadget_chips.h b/drivers/usb/gadget/gadget_chips.h
index c4081407171f..aa80f0910720 100644
--- a/drivers/usb/gadget/gadget_chips.h
+++ b/drivers/usb/gadget/gadget_chips.h
@@ -100,9 +100,9 @@
100#define gadget_is_musbhsfc(g) 0 100#define gadget_is_musbhsfc(g) 0
101#endif 101#endif
102 102
103/* Mentor high speed "dual role" controller, peripheral mode */ 103/* Mentor high speed "dual role" controller, in peripheral role */
104#ifdef CONFIG_USB_GADGET_MUSBHDRC 104#ifdef CONFIG_USB_GADGET_MUSB_HDRC
105#define gadget_is_musbhdrc(g) !strcmp("musbhdrc_udc", (g)->name) 105#define gadget_is_musbhdrc(g) !strcmp("musb_hdrc", (g)->name)
106#else 106#else
107#define gadget_is_musbhdrc(g) 0 107#define gadget_is_musbhdrc(g) 0
108#endif 108#endif
diff --git a/drivers/usb/gadget/inode.c b/drivers/usb/gadget/inode.c
index 3f618ce6998d..0eb010a3f5bc 100644
--- a/drivers/usb/gadget/inode.c
+++ b/drivers/usb/gadget/inode.c
@@ -810,7 +810,7 @@ ep_config (struct file *fd, const char __user *buf, size_t len, loff_t *ptr)
810 if (value == 0) 810 if (value == 0)
811 data->state = STATE_EP_ENABLED; 811 data->state = STATE_EP_ENABLED;
812 break; 812 break;
813#ifdef HIGHSPEED 813#ifdef CONFIG_USB_GADGET_DUALSPEED
814 case USB_SPEED_HIGH: 814 case USB_SPEED_HIGH:
815 /* fails if caller didn't provide that descriptor... */ 815 /* fails if caller didn't provide that descriptor... */
816 value = usb_ep_enable (ep, &data->hs_desc); 816 value = usb_ep_enable (ep, &data->hs_desc);
@@ -982,7 +982,7 @@ ep0_read (struct file *fd, char __user *buf, size_t len, loff_t *ptr)
982 /* assume that was SET_CONFIGURATION */ 982 /* assume that was SET_CONFIGURATION */
983 if (dev->current_config) { 983 if (dev->current_config) {
984 unsigned power; 984 unsigned power;
985#ifdef HIGHSPEED 985#ifdef CONFIG_USB_GADGET_DUALSPEED
986 if (dev->gadget->speed == USB_SPEED_HIGH) 986 if (dev->gadget->speed == USB_SPEED_HIGH)
987 power = dev->hs_config->bMaxPower; 987 power = dev->hs_config->bMaxPower;
988 else 988 else
@@ -1262,7 +1262,7 @@ static struct file_operations ep0_io_operations = {
1262 * Unrecognized ep0 requests may be handled in user space. 1262 * Unrecognized ep0 requests may be handled in user space.
1263 */ 1263 */
1264 1264
1265#ifdef HIGHSPEED 1265#ifdef CONFIG_USB_GADGET_DUALSPEED
1266static void make_qualifier (struct dev_data *dev) 1266static void make_qualifier (struct dev_data *dev)
1267{ 1267{
1268 struct usb_qualifier_descriptor qual; 1268 struct usb_qualifier_descriptor qual;
@@ -1291,7 +1291,7 @@ static int
1291config_buf (struct dev_data *dev, u8 type, unsigned index) 1291config_buf (struct dev_data *dev, u8 type, unsigned index)
1292{ 1292{
1293 int len; 1293 int len;
1294#ifdef HIGHSPEED 1294#ifdef CONFIG_USB_GADGET_DUALSPEED
1295 int hs; 1295 int hs;
1296#endif 1296#endif
1297 1297
@@ -1299,7 +1299,7 @@ config_buf (struct dev_data *dev, u8 type, unsigned index)
1299 if (index > 0) 1299 if (index > 0)
1300 return -EINVAL; 1300 return -EINVAL;
1301 1301
1302#ifdef HIGHSPEED 1302#ifdef CONFIG_USB_GADGET_DUALSPEED
1303 hs = (dev->gadget->speed == USB_SPEED_HIGH); 1303 hs = (dev->gadget->speed == USB_SPEED_HIGH);
1304 if (type == USB_DT_OTHER_SPEED_CONFIG) 1304 if (type == USB_DT_OTHER_SPEED_CONFIG)
1305 hs = !hs; 1305 hs = !hs;
@@ -1335,12 +1335,12 @@ gadgetfs_setup (struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
1335 dev->state = STATE_CONNECTED; 1335 dev->state = STATE_CONNECTED;
1336 dev->dev->bMaxPacketSize0 = gadget->ep0->maxpacket; 1336 dev->dev->bMaxPacketSize0 = gadget->ep0->maxpacket;
1337 1337
1338#ifdef HIGHSPEED 1338#ifdef CONFIG_USB_GADGET_DUALSPEED
1339 if (gadget->speed == USB_SPEED_HIGH && dev->hs_config == 0) { 1339 if (gadget->speed == USB_SPEED_HIGH && dev->hs_config == 0) {
1340 ERROR (dev, "no high speed config??\n"); 1340 ERROR (dev, "no high speed config??\n");
1341 return -EINVAL; 1341 return -EINVAL;
1342 } 1342 }
1343#endif /* HIGHSPEED */ 1343#endif /* CONFIG_USB_GADGET_DUALSPEED */
1344 1344
1345 INFO (dev, "connected\n"); 1345 INFO (dev, "connected\n");
1346 event = next_event (dev, GADGETFS_CONNECT); 1346 event = next_event (dev, GADGETFS_CONNECT);
@@ -1352,11 +1352,11 @@ gadgetfs_setup (struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
1352 /* ... down_trylock (&data->lock) ... */ 1352 /* ... down_trylock (&data->lock) ... */
1353 if (data->state != STATE_EP_DEFER_ENABLE) 1353 if (data->state != STATE_EP_DEFER_ENABLE)
1354 continue; 1354 continue;
1355#ifdef HIGHSPEED 1355#ifdef CONFIG_USB_GADGET_DUALSPEED
1356 if (gadget->speed == USB_SPEED_HIGH) 1356 if (gadget->speed == USB_SPEED_HIGH)
1357 value = usb_ep_enable (ep, &data->hs_desc); 1357 value = usb_ep_enable (ep, &data->hs_desc);
1358 else 1358 else
1359#endif /* HIGHSPEED */ 1359#endif /* CONFIG_USB_GADGET_DUALSPEED */
1360 value = usb_ep_enable (ep, &data->desc); 1360 value = usb_ep_enable (ep, &data->desc);
1361 if (value) { 1361 if (value) {
1362 ERROR (dev, "deferred %s enable --> %d\n", 1362 ERROR (dev, "deferred %s enable --> %d\n",
@@ -1391,7 +1391,7 @@ gadgetfs_setup (struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
1391 value = min (w_length, (u16) sizeof *dev->dev); 1391 value = min (w_length, (u16) sizeof *dev->dev);
1392 req->buf = dev->dev; 1392 req->buf = dev->dev;
1393 break; 1393 break;
1394#ifdef HIGHSPEED 1394#ifdef CONFIG_USB_GADGET_DUALSPEED
1395 case USB_DT_DEVICE_QUALIFIER: 1395 case USB_DT_DEVICE_QUALIFIER:
1396 if (!dev->hs_config) 1396 if (!dev->hs_config)
1397 break; 1397 break;
@@ -1428,7 +1428,7 @@ gadgetfs_setup (struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
1428 // user mode expected to disable endpoints 1428 // user mode expected to disable endpoints
1429 } else { 1429 } else {
1430 u8 config, power; 1430 u8 config, power;
1431#ifdef HIGHSPEED 1431#ifdef CONFIG_USB_GADGET_DUALSPEED
1432 if (gadget->speed == USB_SPEED_HIGH) { 1432 if (gadget->speed == USB_SPEED_HIGH) {
1433 config = dev->hs_config->bConfigurationValue; 1433 config = dev->hs_config->bConfigurationValue;
1434 power = dev->hs_config->bMaxPower; 1434 power = dev->hs_config->bMaxPower;
@@ -1614,6 +1614,7 @@ static int activate_ep_files (struct dev_data *dev)
1614 data, &ep_config_operations, 1614 data, &ep_config_operations,
1615 &data->dentry); 1615 &data->dentry);
1616 if (!data->inode) { 1616 if (!data->inode) {
1617 usb_ep_free_request(ep, data->req);
1617 kfree (data); 1618 kfree (data);
1618 goto enomem; 1619 goto enomem;
1619 } 1620 }
@@ -1728,7 +1729,7 @@ gadgetfs_suspend (struct usb_gadget *gadget)
1728} 1729}
1729 1730
1730static struct usb_gadget_driver gadgetfs_driver = { 1731static struct usb_gadget_driver gadgetfs_driver = {
1731#ifdef HIGHSPEED 1732#ifdef CONFIG_USB_GADGET_DUALSPEED
1732 .speed = USB_SPEED_HIGH, 1733 .speed = USB_SPEED_HIGH,
1733#else 1734#else
1734 .speed = USB_SPEED_FULL, 1735 .speed = USB_SPEED_FULL,
diff --git a/drivers/usb/gadget/net2280.c b/drivers/usb/gadget/net2280.c
index fb73dc100535..0b9293493957 100644
--- a/drivers/usb/gadget/net2280.c
+++ b/drivers/usb/gadget/net2280.c
@@ -26,6 +26,8 @@
26 * Copyright (C) 2003 David Brownell 26 * Copyright (C) 2003 David Brownell
27 * Copyright (C) 2003-2005 PLX Technology, Inc. 27 * Copyright (C) 2003-2005 PLX Technology, Inc.
28 * 28 *
29 * Modified Seth Levy 2005 PLX Technology, Inc. to provide compatibility with 2282 chip
30 *
29 * This program is free software; you can redistribute it and/or modify 31 * This program is free software; you can redistribute it and/or modify
30 * it under the terms of the GNU General Public License as published by 32 * it under the terms of the GNU General Public License as published by
31 * the Free Software Foundation; either version 2 of the License, or 33 * the Free Software Foundation; either version 2 of the License, or
@@ -71,8 +73,8 @@
71#include <asm/unaligned.h> 73#include <asm/unaligned.h>
72 74
73 75
74#define DRIVER_DESC "PLX NET2280 USB Peripheral Controller" 76#define DRIVER_DESC "PLX NET228x USB Peripheral Controller"
75#define DRIVER_VERSION "2005 Feb 03" 77#define DRIVER_VERSION "2005 Sept 27"
76 78
77#define DMA_ADDR_INVALID (~(dma_addr_t)0) 79#define DMA_ADDR_INVALID (~(dma_addr_t)0)
78#define EP_DONTUSE 13 /* nonzero */ 80#define EP_DONTUSE 13 /* nonzero */
@@ -118,7 +120,7 @@ module_param (fifo_mode, ushort, 0644);
118/* enable_suspend -- When enabled, the driver will respond to 120/* enable_suspend -- When enabled, the driver will respond to
119 * USB suspend requests by powering down the NET2280. Otherwise, 121 * USB suspend requests by powering down the NET2280. Otherwise,
120 * USB suspend requests will be ignored. This is acceptible for 122 * USB suspend requests will be ignored. This is acceptible for
121 * self-powered devices, and helps avoid some quirks. 123 * self-powered devices
122 */ 124 */
123static int enable_suspend = 0; 125static int enable_suspend = 0;
124 126
@@ -223,6 +225,11 @@ net2280_enable (struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc)
223 ep->is_in = (tmp & USB_DIR_IN) != 0; 225 ep->is_in = (tmp & USB_DIR_IN) != 0;
224 if (!ep->is_in) 226 if (!ep->is_in)
225 writel ((1 << SET_NAK_OUT_PACKETS), &ep->regs->ep_rsp); 227 writel ((1 << SET_NAK_OUT_PACKETS), &ep->regs->ep_rsp);
228 else if (dev->pdev->device != 0x2280) {
229 /* Added for 2282, Don't use nak packets on an in endpoint, this was ignored on 2280 */
230 writel ((1 << CLEAR_NAK_OUT_PACKETS)
231 | (1 << CLEAR_NAK_OUT_PACKETS_MODE), &ep->regs->ep_rsp);
232 }
226 233
227 writel (tmp, &ep->regs->ep_cfg); 234 writel (tmp, &ep->regs->ep_cfg);
228 235
@@ -232,8 +239,9 @@ net2280_enable (struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc)
232 writel (tmp, &dev->regs->pciirqenb0); 239 writel (tmp, &dev->regs->pciirqenb0);
233 240
234 tmp = (1 << DATA_PACKET_RECEIVED_INTERRUPT_ENABLE) 241 tmp = (1 << DATA_PACKET_RECEIVED_INTERRUPT_ENABLE)
235 | (1 << DATA_PACKET_TRANSMITTED_INTERRUPT_ENABLE) 242 | (1 << DATA_PACKET_TRANSMITTED_INTERRUPT_ENABLE);
236 | readl (&ep->regs->ep_irqenb); 243 if (dev->pdev->device == 0x2280)
244 tmp |= readl (&ep->regs->ep_irqenb);
237 writel (tmp, &ep->regs->ep_irqenb); 245 writel (tmp, &ep->regs->ep_irqenb);
238 } else { /* dma, per-request */ 246 } else { /* dma, per-request */
239 tmp = (1 << (8 + ep->num)); /* completion */ 247 tmp = (1 << (8 + ep->num)); /* completion */
@@ -314,10 +322,18 @@ static void ep_reset (struct net2280_regs __iomem *regs, struct net2280_ep *ep)
314 /* init to our chosen defaults, notably so that we NAK OUT 322 /* init to our chosen defaults, notably so that we NAK OUT
315 * packets until the driver queues a read (+note erratum 0112) 323 * packets until the driver queues a read (+note erratum 0112)
316 */ 324 */
317 tmp = (1 << SET_NAK_OUT_PACKETS_MODE) 325 if (!ep->is_in || ep->dev->pdev->device == 0x2280) {
326 tmp = (1 << SET_NAK_OUT_PACKETS_MODE)
318 | (1 << SET_NAK_OUT_PACKETS) 327 | (1 << SET_NAK_OUT_PACKETS)
319 | (1 << CLEAR_EP_HIDE_STATUS_PHASE) 328 | (1 << CLEAR_EP_HIDE_STATUS_PHASE)
320 | (1 << CLEAR_INTERRUPT_MODE); 329 | (1 << CLEAR_INTERRUPT_MODE);
330 } else {
331 /* added for 2282 */
332 tmp = (1 << CLEAR_NAK_OUT_PACKETS_MODE)
333 | (1 << CLEAR_NAK_OUT_PACKETS)
334 | (1 << CLEAR_EP_HIDE_STATUS_PHASE)
335 | (1 << CLEAR_INTERRUPT_MODE);
336 }
321 337
322 if (ep->num != 0) { 338 if (ep->num != 0) {
323 tmp |= (1 << CLEAR_ENDPOINT_TOGGLE) 339 tmp |= (1 << CLEAR_ENDPOINT_TOGGLE)
@@ -326,14 +342,18 @@ static void ep_reset (struct net2280_regs __iomem *regs, struct net2280_ep *ep)
326 writel (tmp, &ep->regs->ep_rsp); 342 writel (tmp, &ep->regs->ep_rsp);
327 343
328 /* scrub most status bits, and flush any fifo state */ 344 /* scrub most status bits, and flush any fifo state */
329 writel ( (1 << TIMEOUT) 345 if (ep->dev->pdev->device == 0x2280)
346 tmp = (1 << FIFO_OVERFLOW)
347 | (1 << FIFO_UNDERFLOW);
348 else
349 tmp = 0;
350
351 writel (tmp | (1 << TIMEOUT)
330 | (1 << USB_STALL_SENT) 352 | (1 << USB_STALL_SENT)
331 | (1 << USB_IN_NAK_SENT) 353 | (1 << USB_IN_NAK_SENT)
332 | (1 << USB_IN_ACK_RCVD) 354 | (1 << USB_IN_ACK_RCVD)
333 | (1 << USB_OUT_PING_NAK_SENT) 355 | (1 << USB_OUT_PING_NAK_SENT)
334 | (1 << USB_OUT_ACK_SENT) 356 | (1 << USB_OUT_ACK_SENT)
335 | (1 << FIFO_OVERFLOW)
336 | (1 << FIFO_UNDERFLOW)
337 | (1 << FIFO_FLUSH) 357 | (1 << FIFO_FLUSH)
338 | (1 << SHORT_PACKET_OUT_DONE_INTERRUPT) 358 | (1 << SHORT_PACKET_OUT_DONE_INTERRUPT)
339 | (1 << SHORT_PACKET_TRANSFERRED_INTERRUPT) 359 | (1 << SHORT_PACKET_TRANSFERRED_INTERRUPT)
@@ -718,7 +738,7 @@ fill_dma_desc (struct net2280_ep *ep, struct net2280_request *req, int valid)
718 */ 738 */
719 if (ep->is_in) 739 if (ep->is_in)
720 dmacount |= (1 << DMA_DIRECTION); 740 dmacount |= (1 << DMA_DIRECTION);
721 else if ((dmacount % ep->ep.maxpacket) != 0) 741 if ((!ep->is_in && (dmacount % ep->ep.maxpacket) != 0) || ep->dev->pdev->device != 0x2280)
722 dmacount |= (1 << END_OF_CHAIN); 742 dmacount |= (1 << END_OF_CHAIN);
723 743
724 req->valid = valid; 744 req->valid = valid;
@@ -760,9 +780,12 @@ static inline void stop_dma (struct net2280_dma_regs __iomem *dma)
760static void start_queue (struct net2280_ep *ep, u32 dmactl, u32 td_dma) 780static void start_queue (struct net2280_ep *ep, u32 dmactl, u32 td_dma)
761{ 781{
762 struct net2280_dma_regs __iomem *dma = ep->dma; 782 struct net2280_dma_regs __iomem *dma = ep->dma;
783 unsigned int tmp = (1 << VALID_BIT) | (ep->is_in << DMA_DIRECTION);
784
785 if (ep->dev->pdev->device != 0x2280)
786 tmp |= (1 << END_OF_CHAIN);
763 787
764 writel ((1 << VALID_BIT) | (ep->is_in << DMA_DIRECTION), 788 writel (tmp, &dma->dmacount);
765 &dma->dmacount);
766 writel (readl (&dma->dmastat), &dma->dmastat); 789 writel (readl (&dma->dmastat), &dma->dmastat);
767 790
768 writel (td_dma, &dma->dmadesc); 791 writel (td_dma, &dma->dmadesc);
@@ -2110,7 +2133,11 @@ static void handle_ep_small (struct net2280_ep *ep)
2110 VDEBUG (ep->dev, "%s ack ep_stat %08x, req %p\n", 2133 VDEBUG (ep->dev, "%s ack ep_stat %08x, req %p\n",
2111 ep->ep.name, t, req ? &req->req : 0); 2134 ep->ep.name, t, req ? &req->req : 0);
2112#endif 2135#endif
2113 writel (t & ~(1 << NAK_OUT_PACKETS), &ep->regs->ep_stat); 2136 if (!ep->is_in || ep->dev->pdev->device == 0x2280)
2137 writel (t & ~(1 << NAK_OUT_PACKETS), &ep->regs->ep_stat);
2138 else
2139 /* Added for 2282 */
2140 writel (t, &ep->regs->ep_stat);
2114 2141
2115 /* for ep0, monitor token irqs to catch data stage length errors 2142 /* for ep0, monitor token irqs to catch data stage length errors
2116 * and to synchronize on status. 2143 * and to synchronize on status.
@@ -2139,7 +2166,7 @@ static void handle_ep_small (struct net2280_ep *ep)
2139 ep->stopped = 1; 2166 ep->stopped = 1;
2140 set_halt (ep); 2167 set_halt (ep);
2141 mode = 2; 2168 mode = 2;
2142 } else if (!req && ep->stopped) 2169 } else if (!req && !ep->stopped)
2143 write_fifo (ep, NULL); 2170 write_fifo (ep, NULL);
2144 } 2171 }
2145 } else { 2172 } else {
@@ -2214,7 +2241,8 @@ static void handle_ep_small (struct net2280_ep *ep)
2214 if (likely (req)) { 2241 if (likely (req)) {
2215 req->td->dmacount = 0; 2242 req->td->dmacount = 0;
2216 t = readl (&ep->regs->ep_avail); 2243 t = readl (&ep->regs->ep_avail);
2217 dma_done (ep, req, count, t); 2244 dma_done (ep, req, count,
2245 (ep->out_overflow || t) ? -EOVERFLOW : 0);
2218 } 2246 }
2219 2247
2220 /* also flush to prevent erratum 0106 trouble */ 2248 /* also flush to prevent erratum 0106 trouble */
@@ -2252,9 +2280,7 @@ static void handle_ep_small (struct net2280_ep *ep)
2252 /* if we wrote it all, we're usually done */ 2280 /* if we wrote it all, we're usually done */
2253 if (req->req.actual == req->req.length) { 2281 if (req->req.actual == req->req.length) {
2254 if (ep->num == 0) { 2282 if (ep->num == 0) {
2255 /* wait for control status */ 2283 /* send zlps until the status stage */
2256 if (mode != 2)
2257 req = NULL;
2258 } else if (!req->req.zero || len != ep->ep.maxpacket) 2284 } else if (!req->req.zero || len != ep->ep.maxpacket)
2259 mode = 2; 2285 mode = 2;
2260 } 2286 }
@@ -2337,7 +2363,7 @@ static void handle_stat0_irqs (struct net2280 *dev, u32 stat)
2337 u32 raw [2]; 2363 u32 raw [2];
2338 struct usb_ctrlrequest r; 2364 struct usb_ctrlrequest r;
2339 } u; 2365 } u;
2340 int tmp = 0; 2366 int tmp;
2341 struct net2280_request *req; 2367 struct net2280_request *req;
2342 2368
2343 if (dev->gadget.speed == USB_SPEED_UNKNOWN) { 2369 if (dev->gadget.speed == USB_SPEED_UNKNOWN) {
@@ -2364,14 +2390,19 @@ static void handle_stat0_irqs (struct net2280 *dev, u32 stat)
2364 } 2390 }
2365 ep->stopped = 0; 2391 ep->stopped = 0;
2366 dev->protocol_stall = 0; 2392 dev->protocol_stall = 0;
2367 writel ( (1 << TIMEOUT) 2393
2394 if (ep->dev->pdev->device == 0x2280)
2395 tmp = (1 << FIFO_OVERFLOW)
2396 | (1 << FIFO_UNDERFLOW);
2397 else
2398 tmp = 0;
2399
2400 writel (tmp | (1 << TIMEOUT)
2368 | (1 << USB_STALL_SENT) 2401 | (1 << USB_STALL_SENT)
2369 | (1 << USB_IN_NAK_SENT) 2402 | (1 << USB_IN_NAK_SENT)
2370 | (1 << USB_IN_ACK_RCVD) 2403 | (1 << USB_IN_ACK_RCVD)
2371 | (1 << USB_OUT_PING_NAK_SENT) 2404 | (1 << USB_OUT_PING_NAK_SENT)
2372 | (1 << USB_OUT_ACK_SENT) 2405 | (1 << USB_OUT_ACK_SENT)
2373 | (1 << FIFO_OVERFLOW)
2374 | (1 << FIFO_UNDERFLOW)
2375 | (1 << SHORT_PACKET_OUT_DONE_INTERRUPT) 2406 | (1 << SHORT_PACKET_OUT_DONE_INTERRUPT)
2376 | (1 << SHORT_PACKET_TRANSFERRED_INTERRUPT) 2407 | (1 << SHORT_PACKET_TRANSFERRED_INTERRUPT)
2377 | (1 << DATA_PACKET_RECEIVED_INTERRUPT) 2408 | (1 << DATA_PACKET_RECEIVED_INTERRUPT)
@@ -2385,6 +2416,8 @@ static void handle_stat0_irqs (struct net2280 *dev, u32 stat)
2385 cpu_to_le32s (&u.raw [0]); 2416 cpu_to_le32s (&u.raw [0]);
2386 cpu_to_le32s (&u.raw [1]); 2417 cpu_to_le32s (&u.raw [1]);
2387 2418
2419 tmp = 0;
2420
2388#define w_value le16_to_cpup (&u.r.wValue) 2421#define w_value le16_to_cpup (&u.r.wValue)
2389#define w_index le16_to_cpup (&u.r.wIndex) 2422#define w_index le16_to_cpup (&u.r.wIndex)
2390#define w_length le16_to_cpup (&u.r.wLength) 2423#define w_length le16_to_cpup (&u.r.wLength)
@@ -2594,10 +2627,17 @@ static void handle_stat1_irqs (struct net2280 *dev, u32 stat)
2594 writel (stat, &dev->regs->irqstat1); 2627 writel (stat, &dev->regs->irqstat1);
2595 2628
2596 /* some status we can just ignore */ 2629 /* some status we can just ignore */
2597 stat &= ~((1 << CONTROL_STATUS_INTERRUPT) 2630 if (dev->pdev->device == 0x2280)
2598 | (1 << SUSPEND_REQUEST_INTERRUPT) 2631 stat &= ~((1 << CONTROL_STATUS_INTERRUPT)
2599 | (1 << RESUME_INTERRUPT) 2632 | (1 << SUSPEND_REQUEST_INTERRUPT)
2600 | (1 << SOF_INTERRUPT)); 2633 | (1 << RESUME_INTERRUPT)
2634 | (1 << SOF_INTERRUPT));
2635 else
2636 stat &= ~((1 << CONTROL_STATUS_INTERRUPT)
2637 | (1 << RESUME_INTERRUPT)
2638 | (1 << SOF_DOWN_INTERRUPT)
2639 | (1 << SOF_INTERRUPT));
2640
2601 if (!stat) 2641 if (!stat)
2602 return; 2642 return;
2603 // DEBUG (dev, "irqstat1 %08x\n", stat); 2643 // DEBUG (dev, "irqstat1 %08x\n", stat);
@@ -2702,6 +2742,10 @@ static irqreturn_t net2280_irq (int irq, void *_dev, struct pt_regs * r)
2702{ 2742{
2703 struct net2280 *dev = _dev; 2743 struct net2280 *dev = _dev;
2704 2744
2745 /* shared interrupt, not ours */
2746 if (!(readl(&dev->regs->irqstat0) & (1 << INTA_ASSERTED)))
2747 return IRQ_NONE;
2748
2705 spin_lock (&dev->lock); 2749 spin_lock (&dev->lock);
2706 2750
2707 /* handle disconnect, dma, and more */ 2751 /* handle disconnect, dma, and more */
@@ -2789,13 +2833,13 @@ static int net2280_probe (struct pci_dev *pdev, const struct pci_device_id *id)
2789 } 2833 }
2790 2834
2791 /* alloc, and start init */ 2835 /* alloc, and start init */
2792 dev = kmalloc (sizeof *dev, SLAB_KERNEL); 2836 dev = kzalloc (sizeof *dev, SLAB_KERNEL);
2793 if (dev == NULL){ 2837 if (dev == NULL){
2794 retval = -ENOMEM; 2838 retval = -ENOMEM;
2795 goto done; 2839 goto done;
2796 } 2840 }
2797 2841
2798 memset (dev, 0, sizeof *dev); 2842 pci_set_drvdata (pdev, dev);
2799 spin_lock_init (&dev->lock); 2843 spin_lock_init (&dev->lock);
2800 dev->pdev = pdev; 2844 dev->pdev = pdev;
2801 dev->gadget.ops = &net2280_ops; 2845 dev->gadget.ops = &net2280_ops;
@@ -2908,7 +2952,6 @@ static int net2280_probe (struct pci_dev *pdev, const struct pci_device_id *id)
2908 dev->chiprev = get_idx_reg (dev->regs, REG_CHIPREV) & 0xffff; 2952 dev->chiprev = get_idx_reg (dev->regs, REG_CHIPREV) & 0xffff;
2909 2953
2910 /* done */ 2954 /* done */
2911 pci_set_drvdata (pdev, dev);
2912 INFO (dev, "%s\n", driver_desc); 2955 INFO (dev, "%s\n", driver_desc);
2913 INFO (dev, "irq %s, pci mem %p, chip rev %04x\n", 2956 INFO (dev, "irq %s, pci mem %p, chip rev %04x\n",
2914 bufp, base, dev->chiprev); 2957 bufp, base, dev->chiprev);
@@ -2939,6 +2982,13 @@ static struct pci_device_id pci_ids [] = { {
2939 .device = 0x2280, 2982 .device = 0x2280,
2940 .subvendor = PCI_ANY_ID, 2983 .subvendor = PCI_ANY_ID,
2941 .subdevice = PCI_ANY_ID, 2984 .subdevice = PCI_ANY_ID,
2985}, {
2986 .class = ((PCI_CLASS_SERIAL_USB << 8) | 0xfe),
2987 .class_mask = ~0,
2988 .vendor = 0x17cc,
2989 .device = 0x2282,
2990 .subvendor = PCI_ANY_ID,
2991 .subdevice = PCI_ANY_ID,
2942 2992
2943}, { /* end: all zeroes */ } 2993}, { /* end: all zeroes */ }
2944}; 2994};
diff --git a/drivers/usb/gadget/net2280.h b/drivers/usb/gadget/net2280.h
index fff4509cf340..957d6df34015 100644
--- a/drivers/usb/gadget/net2280.h
+++ b/drivers/usb/gadget/net2280.h
@@ -22,420 +22,7 @@
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 */ 23 */
24 24
25/*-------------------------------------------------------------------------*/ 25#include <linux/usb/net2280.h>
26
27/* NET2280 MEMORY MAPPED REGISTERS
28 *
29 * The register layout came from the chip documentation, and the bit
30 * number definitions were extracted from chip specification.
31 *
32 * Use the shift operator ('<<') to build bit masks, with readl/writel
33 * to access the registers through PCI.
34 */
35
36/* main registers, BAR0 + 0x0000 */
37struct net2280_regs {
38 // offset 0x0000
39 u32 devinit;
40#define LOCAL_CLOCK_FREQUENCY 8
41#define FORCE_PCI_RESET 7
42#define PCI_ID 6
43#define PCI_ENABLE 5
44#define FIFO_SOFT_RESET 4
45#define CFG_SOFT_RESET 3
46#define PCI_SOFT_RESET 2
47#define USB_SOFT_RESET 1
48#define M8051_RESET 0
49 u32 eectl;
50#define EEPROM_ADDRESS_WIDTH 23
51#define EEPROM_CHIP_SELECT_ACTIVE 22
52#define EEPROM_PRESENT 21
53#define EEPROM_VALID 20
54#define EEPROM_BUSY 19
55#define EEPROM_CHIP_SELECT_ENABLE 18
56#define EEPROM_BYTE_READ_START 17
57#define EEPROM_BYTE_WRITE_START 16
58#define EEPROM_READ_DATA 8
59#define EEPROM_WRITE_DATA 0
60 u32 eeclkfreq;
61 u32 _unused0;
62 // offset 0x0010
63
64 u32 pciirqenb0; /* interrupt PCI master ... */
65#define SETUP_PACKET_INTERRUPT_ENABLE 7
66#define ENDPOINT_F_INTERRUPT_ENABLE 6
67#define ENDPOINT_E_INTERRUPT_ENABLE 5
68#define ENDPOINT_D_INTERRUPT_ENABLE 4
69#define ENDPOINT_C_INTERRUPT_ENABLE 3
70#define ENDPOINT_B_INTERRUPT_ENABLE 2
71#define ENDPOINT_A_INTERRUPT_ENABLE 1
72#define ENDPOINT_0_INTERRUPT_ENABLE 0
73 u32 pciirqenb1;
74#define PCI_INTERRUPT_ENABLE 31
75#define POWER_STATE_CHANGE_INTERRUPT_ENABLE 27
76#define PCI_ARBITER_TIMEOUT_INTERRUPT_ENABLE 26
77#define PCI_PARITY_ERROR_INTERRUPT_ENABLE 25
78#define PCI_MASTER_ABORT_RECEIVED_INTERRUPT_ENABLE 20
79#define PCI_TARGET_ABORT_RECEIVED_INTERRUPT_ENABLE 19
80#define PCI_TARGET_ABORT_ASSERTED_INTERRUPT_ENABLE 18
81#define PCI_RETRY_ABORT_INTERRUPT_ENABLE 17
82#define PCI_MASTER_CYCLE_DONE_INTERRUPT_ENABLE 16
83#define GPIO_INTERRUPT_ENABLE 13
84#define DMA_D_INTERRUPT_ENABLE 12
85#define DMA_C_INTERRUPT_ENABLE 11
86#define DMA_B_INTERRUPT_ENABLE 10
87#define DMA_A_INTERRUPT_ENABLE 9
88#define EEPROM_DONE_INTERRUPT_ENABLE 8
89#define VBUS_INTERRUPT_ENABLE 7
90#define CONTROL_STATUS_INTERRUPT_ENABLE 6
91#define ROOT_PORT_RESET_INTERRUPT_ENABLE 4
92#define SUSPEND_REQUEST_INTERRUPT_ENABLE 3
93#define SUSPEND_REQUEST_CHANGE_INTERRUPT_ENABLE 2
94#define RESUME_INTERRUPT_ENABLE 1
95#define SOF_INTERRUPT_ENABLE 0
96 u32 cpu_irqenb0; /* ... or onboard 8051 */
97#define SETUP_PACKET_INTERRUPT_ENABLE 7
98#define ENDPOINT_F_INTERRUPT_ENABLE 6
99#define ENDPOINT_E_INTERRUPT_ENABLE 5
100#define ENDPOINT_D_INTERRUPT_ENABLE 4
101#define ENDPOINT_C_INTERRUPT_ENABLE 3
102#define ENDPOINT_B_INTERRUPT_ENABLE 2
103#define ENDPOINT_A_INTERRUPT_ENABLE 1
104#define ENDPOINT_0_INTERRUPT_ENABLE 0
105 u32 cpu_irqenb1;
106#define CPU_INTERRUPT_ENABLE 31
107#define POWER_STATE_CHANGE_INTERRUPT_ENABLE 27
108#define PCI_ARBITER_TIMEOUT_INTERRUPT_ENABLE 26
109#define PCI_PARITY_ERROR_INTERRUPT_ENABLE 25
110#define PCI_INTA_INTERRUPT_ENABLE 24
111#define PCI_PME_INTERRUPT_ENABLE 23
112#define PCI_SERR_INTERRUPT_ENABLE 22
113#define PCI_PERR_INTERRUPT_ENABLE 21
114#define PCI_MASTER_ABORT_RECEIVED_INTERRUPT_ENABLE 20
115#define PCI_TARGET_ABORT_RECEIVED_INTERRUPT_ENABLE 19
116#define PCI_RETRY_ABORT_INTERRUPT_ENABLE 17
117#define PCI_MASTER_CYCLE_DONE_INTERRUPT_ENABLE 16
118#define GPIO_INTERRUPT_ENABLE 13
119#define DMA_D_INTERRUPT_ENABLE 12
120#define DMA_C_INTERRUPT_ENABLE 11
121#define DMA_B_INTERRUPT_ENABLE 10
122#define DMA_A_INTERRUPT_ENABLE 9
123#define EEPROM_DONE_INTERRUPT_ENABLE 8
124#define VBUS_INTERRUPT_ENABLE 7
125#define CONTROL_STATUS_INTERRUPT_ENABLE 6
126#define ROOT_PORT_RESET_INTERRUPT_ENABLE 4
127#define SUSPEND_REQUEST_INTERRUPT_ENABLE 3
128#define SUSPEND_REQUEST_CHANGE_INTERRUPT_ENABLE 2
129#define RESUME_INTERRUPT_ENABLE 1
130#define SOF_INTERRUPT_ENABLE 0
131
132 // offset 0x0020
133 u32 _unused1;
134 u32 usbirqenb1;
135#define USB_INTERRUPT_ENABLE 31
136#define POWER_STATE_CHANGE_INTERRUPT_ENABLE 27
137#define PCI_ARBITER_TIMEOUT_INTERRUPT_ENABLE 26
138#define PCI_PARITY_ERROR_INTERRUPT_ENABLE 25
139#define PCI_INTA_INTERRUPT_ENABLE 24
140#define PCI_PME_INTERRUPT_ENABLE 23
141#define PCI_SERR_INTERRUPT_ENABLE 22
142#define PCI_PERR_INTERRUPT_ENABLE 21
143#define PCI_MASTER_ABORT_RECEIVED_INTERRUPT_ENABLE 20
144#define PCI_TARGET_ABORT_RECEIVED_INTERRUPT_ENABLE 19
145#define PCI_RETRY_ABORT_INTERRUPT_ENABLE 17
146#define PCI_MASTER_CYCLE_DONE_INTERRUPT_ENABLE 16
147#define GPIO_INTERRUPT_ENABLE 13
148#define DMA_D_INTERRUPT_ENABLE 12
149#define DMA_C_INTERRUPT_ENABLE 11
150#define DMA_B_INTERRUPT_ENABLE 10
151#define DMA_A_INTERRUPT_ENABLE 9
152#define EEPROM_DONE_INTERRUPT_ENABLE 8
153#define VBUS_INTERRUPT_ENABLE 7
154#define CONTROL_STATUS_INTERRUPT_ENABLE 6
155#define ROOT_PORT_RESET_INTERRUPT_ENABLE 4
156#define SUSPEND_REQUEST_INTERRUPT_ENABLE 3
157#define SUSPEND_REQUEST_CHANGE_INTERRUPT_ENABLE 2
158#define RESUME_INTERRUPT_ENABLE 1
159#define SOF_INTERRUPT_ENABLE 0
160 u32 irqstat0;
161#define INTA_ASSERTED 12
162#define SETUP_PACKET_INTERRUPT 7
163#define ENDPOINT_F_INTERRUPT 6
164#define ENDPOINT_E_INTERRUPT 5
165#define ENDPOINT_D_INTERRUPT 4
166#define ENDPOINT_C_INTERRUPT 3
167#define ENDPOINT_B_INTERRUPT 2
168#define ENDPOINT_A_INTERRUPT 1
169#define ENDPOINT_0_INTERRUPT 0
170 u32 irqstat1;
171#define POWER_STATE_CHANGE_INTERRUPT 27
172#define PCI_ARBITER_TIMEOUT_INTERRUPT 26
173#define PCI_PARITY_ERROR_INTERRUPT 25
174#define PCI_INTA_INTERRUPT 24
175#define PCI_PME_INTERRUPT 23
176#define PCI_SERR_INTERRUPT 22
177#define PCI_PERR_INTERRUPT 21
178#define PCI_MASTER_ABORT_RECEIVED_INTERRUPT 20
179#define PCI_TARGET_ABORT_RECEIVED_INTERRUPT 19
180#define PCI_RETRY_ABORT_INTERRUPT 17
181#define PCI_MASTER_CYCLE_DONE_INTERRUPT 16
182#define GPIO_INTERRUPT 13
183#define DMA_D_INTERRUPT 12
184#define DMA_C_INTERRUPT 11
185#define DMA_B_INTERRUPT 10
186#define DMA_A_INTERRUPT 9
187#define EEPROM_DONE_INTERRUPT 8
188#define VBUS_INTERRUPT 7
189#define CONTROL_STATUS_INTERRUPT 6
190#define ROOT_PORT_RESET_INTERRUPT 4
191#define SUSPEND_REQUEST_INTERRUPT 3
192#define SUSPEND_REQUEST_CHANGE_INTERRUPT 2
193#define RESUME_INTERRUPT 1
194#define SOF_INTERRUPT 0
195 // offset 0x0030
196 u32 idxaddr;
197 u32 idxdata;
198 u32 fifoctl;
199#define PCI_BASE2_RANGE 16
200#define IGNORE_FIFO_AVAILABILITY 3
201#define PCI_BASE2_SELECT 2
202#define FIFO_CONFIGURATION_SELECT 0
203 u32 _unused2;
204 // offset 0x0040
205 u32 memaddr;
206#define START 28
207#define DIRECTION 27
208#define FIFO_DIAGNOSTIC_SELECT 24
209#define MEMORY_ADDRESS 0
210 u32 memdata0;
211 u32 memdata1;
212 u32 _unused3;
213 // offset 0x0050
214 u32 gpioctl;
215#define GPIO3_LED_SELECT 12
216#define GPIO3_INTERRUPT_ENABLE 11
217#define GPIO2_INTERRUPT_ENABLE 10
218#define GPIO1_INTERRUPT_ENABLE 9
219#define GPIO0_INTERRUPT_ENABLE 8
220#define GPIO3_OUTPUT_ENABLE 7
221#define GPIO2_OUTPUT_ENABLE 6
222#define GPIO1_OUTPUT_ENABLE 5
223#define GPIO0_OUTPUT_ENABLE 4
224#define GPIO3_DATA 3
225#define GPIO2_DATA 2
226#define GPIO1_DATA 1
227#define GPIO0_DATA 0
228 u32 gpiostat;
229#define GPIO3_INTERRUPT 3
230#define GPIO2_INTERRUPT 2
231#define GPIO1_INTERRUPT 1
232#define GPIO0_INTERRUPT 0
233} __attribute__ ((packed));
234
235/* usb control, BAR0 + 0x0080 */
236struct net2280_usb_regs {
237 // offset 0x0080
238 u32 stdrsp;
239#define STALL_UNSUPPORTED_REQUESTS 31
240#define SET_TEST_MODE 16
241#define GET_OTHER_SPEED_CONFIGURATION 15
242#define GET_DEVICE_QUALIFIER 14
243#define SET_ADDRESS 13
244#define ENDPOINT_SET_CLEAR_HALT 12
245#define DEVICE_SET_CLEAR_DEVICE_REMOTE_WAKEUP 11
246#define GET_STRING_DESCRIPTOR_2 10
247#define GET_STRING_DESCRIPTOR_1 9
248#define GET_STRING_DESCRIPTOR_0 8
249#define GET_SET_INTERFACE 6
250#define GET_SET_CONFIGURATION 5
251#define GET_CONFIGURATION_DESCRIPTOR 4
252#define GET_DEVICE_DESCRIPTOR 3
253#define GET_ENDPOINT_STATUS 2
254#define GET_INTERFACE_STATUS 1
255#define GET_DEVICE_STATUS 0
256 u32 prodvendid;
257#define PRODUCT_ID 16
258#define VENDOR_ID 0
259 u32 relnum;
260 u32 usbctl;
261#define SERIAL_NUMBER_INDEX 16
262#define PRODUCT_ID_STRING_ENABLE 13
263#define VENDOR_ID_STRING_ENABLE 12
264#define USB_ROOT_PORT_WAKEUP_ENABLE 11
265#define VBUS_PIN 10
266#define TIMED_DISCONNECT 9
267#define SUSPEND_IMMEDIATELY 7
268#define SELF_POWERED_USB_DEVICE 6
269#define REMOTE_WAKEUP_SUPPORT 5
270#define PME_POLARITY 4
271#define USB_DETECT_ENABLE 3
272#define PME_WAKEUP_ENABLE 2
273#define DEVICE_REMOTE_WAKEUP_ENABLE 1
274#define SELF_POWERED_STATUS 0
275 // offset 0x0090
276 u32 usbstat;
277#define HIGH_SPEED 7
278#define FULL_SPEED 6
279#define GENERATE_RESUME 5
280#define GENERATE_DEVICE_REMOTE_WAKEUP 4
281 u32 xcvrdiag;
282#define FORCE_HIGH_SPEED_MODE 31
283#define FORCE_FULL_SPEED_MODE 30
284#define USB_TEST_MODE 24
285#define LINE_STATE 16
286#define TRANSCEIVER_OPERATION_MODE 2
287#define TRANSCEIVER_SELECT 1
288#define TERMINATION_SELECT 0
289 u32 setup0123;
290 u32 setup4567;
291 // offset 0x0090
292 u32 _unused0;
293 u32 ouraddr;
294#define FORCE_IMMEDIATE 7
295#define OUR_USB_ADDRESS 0
296 u32 ourconfig;
297} __attribute__ ((packed));
298
299/* pci control, BAR0 + 0x0100 */
300struct net2280_pci_regs {
301 // offset 0x0100
302 u32 pcimstctl;
303#define PCI_ARBITER_PARK_SELECT 13
304#define PCI_MULTI LEVEL_ARBITER 12
305#define PCI_RETRY_ABORT_ENABLE 11
306#define DMA_MEMORY_WRITE_AND_INVALIDATE_ENABLE 10
307#define DMA_READ_MULTIPLE_ENABLE 9
308#define DMA_READ_LINE_ENABLE 8
309#define PCI_MASTER_COMMAND_SELECT 6
310#define MEM_READ_OR_WRITE 0
311#define IO_READ_OR_WRITE 1
312#define CFG_READ_OR_WRITE 2
313#define PCI_MASTER_START 5
314#define PCI_MASTER_READ_WRITE 4
315#define PCI_MASTER_WRITE 0
316#define PCI_MASTER_READ 1
317#define PCI_MASTER_BYTE_WRITE_ENABLES 0
318 u32 pcimstaddr;
319 u32 pcimstdata;
320 u32 pcimststat;
321#define PCI_ARBITER_CLEAR 2
322#define PCI_EXTERNAL_ARBITER 1
323#define PCI_HOST_MODE 0
324} __attribute__ ((packed));
325
326/* dma control, BAR0 + 0x0180 ... array of four structs like this,
327 * for channels 0..3. see also struct net2280_dma: descriptor
328 * that can be loaded into some of these registers.
329 */
330struct net2280_dma_regs { /* [11.7] */
331 // offset 0x0180, 0x01a0, 0x01c0, 0x01e0,
332 u32 dmactl;
333#define DMA_SCATTER_GATHER_DONE_INTERRUPT_ENABLE 25
334#define DMA_CLEAR_COUNT_ENABLE 21
335#define DESCRIPTOR_POLLING_RATE 19
336#define POLL_CONTINUOUS 0
337#define POLL_1_USEC 1
338#define POLL_100_USEC 2
339#define POLL_1_MSEC 3
340#define DMA_VALID_BIT_POLLING_ENABLE 18
341#define DMA_VALID_BIT_ENABLE 17
342#define DMA_SCATTER_GATHER_ENABLE 16
343#define DMA_OUT_AUTO_START_ENABLE 4
344#define DMA_PREEMPT_ENABLE 3
345#define DMA_FIFO_VALIDATE 2
346#define DMA_ENABLE 1
347#define DMA_ADDRESS_HOLD 0
348 u32 dmastat;
349#define DMA_SCATTER_GATHER_DONE_INTERRUPT 25
350#define DMA_TRANSACTION_DONE_INTERRUPT 24
351#define DMA_ABORT 1
352#define DMA_START 0
353 u32 _unused0 [2];
354 // offset 0x0190, 0x01b0, 0x01d0, 0x01f0,
355 u32 dmacount;
356#define VALID_BIT 31
357#define DMA_DIRECTION 30
358#define DMA_DONE_INTERRUPT_ENABLE 29
359#define END_OF_CHAIN 28
360#define DMA_BYTE_COUNT_MASK ((1<<24)-1)
361#define DMA_BYTE_COUNT 0
362 u32 dmaaddr;
363 u32 dmadesc;
364 u32 _unused1;
365} __attribute__ ((packed));
366
367/* dedicated endpoint registers, BAR0 + 0x0200 */
368
369struct net2280_dep_regs { /* [11.8] */
370 // offset 0x0200, 0x0210, 0x220, 0x230, 0x240
371 u32 dep_cfg;
372 // offset 0x0204, 0x0214, 0x224, 0x234, 0x244
373 u32 dep_rsp;
374 u32 _unused [2];
375} __attribute__ ((packed));
376
377/* configurable endpoint registers, BAR0 + 0x0300 ... array of seven structs
378 * like this, for ep0 then the configurable endpoints A..F
379 * ep0 reserved for control; E and F have only 64 bytes of fifo
380 */
381struct net2280_ep_regs { /* [11.9] */
382 // offset 0x0300, 0x0320, 0x0340, 0x0360, 0x0380, 0x03a0, 0x03c0
383 u32 ep_cfg;
384#define ENDPOINT_BYTE_COUNT 16
385#define ENDPOINT_ENABLE 10
386#define ENDPOINT_TYPE 8
387#define ENDPOINT_DIRECTION 7
388#define ENDPOINT_NUMBER 0
389 u32 ep_rsp;
390#define SET_NAK_OUT_PACKETS 15
391#define SET_EP_HIDE_STATUS_PHASE 14
392#define SET_EP_FORCE_CRC_ERROR 13
393#define SET_INTERRUPT_MODE 12
394#define SET_CONTROL_STATUS_PHASE_HANDSHAKE 11
395#define SET_NAK_OUT_PACKETS_MODE 10
396#define SET_ENDPOINT_TOGGLE 9
397#define SET_ENDPOINT_HALT 8
398#define CLEAR_NAK_OUT_PACKETS 7
399#define CLEAR_EP_HIDE_STATUS_PHASE 6
400#define CLEAR_EP_FORCE_CRC_ERROR 5
401#define CLEAR_INTERRUPT_MODE 4
402#define CLEAR_CONTROL_STATUS_PHASE_HANDSHAKE 3
403#define CLEAR_NAK_OUT_PACKETS_MODE 2
404#define CLEAR_ENDPOINT_TOGGLE 1
405#define CLEAR_ENDPOINT_HALT 0
406 u32 ep_irqenb;
407#define SHORT_PACKET_OUT_DONE_INTERRUPT_ENABLE 6
408#define SHORT_PACKET_TRANSFERRED_INTERRUPT_ENABLE 5
409#define DATA_PACKET_RECEIVED_INTERRUPT_ENABLE 3
410#define DATA_PACKET_TRANSMITTED_INTERRUPT_ENABLE 2
411#define DATA_OUT_PING_TOKEN_INTERRUPT_ENABLE 1
412#define DATA_IN_TOKEN_INTERRUPT_ENABLE 0
413 u32 ep_stat;
414#define FIFO_VALID_COUNT 24
415#define HIGH_BANDWIDTH_OUT_TRANSACTION_PID 22
416#define TIMEOUT 21
417#define USB_STALL_SENT 20
418#define USB_IN_NAK_SENT 19
419#define USB_IN_ACK_RCVD 18
420#define USB_OUT_PING_NAK_SENT 17
421#define USB_OUT_ACK_SENT 16
422#define FIFO_OVERFLOW 13
423#define FIFO_UNDERFLOW 12
424#define FIFO_FULL 11
425#define FIFO_EMPTY 10
426#define FIFO_FLUSH 9
427#define SHORT_PACKET_OUT_DONE_INTERRUPT 6
428#define SHORT_PACKET_TRANSFERRED_INTERRUPT 5
429#define NAK_OUT_PACKETS 4
430#define DATA_PACKET_RECEIVED_INTERRUPT 3
431#define DATA_PACKET_TRANSMITTED_INTERRUPT 2
432#define DATA_OUT_PING_TOKEN_INTERRUPT 1
433#define DATA_IN_TOKEN_INTERRUPT 0
434 // offset 0x0310, 0x0330, 0x0350, 0x0370, 0x0390, 0x03b0, 0x03d0
435 u32 ep_avail;
436 u32 ep_data;
437 u32 _unused0 [2];
438} __attribute__ ((packed));
439 26
440/*-------------------------------------------------------------------------*/ 27/*-------------------------------------------------------------------------*/
441 28
diff --git a/drivers/usb/gadget/zero.c b/drivers/usb/gadget/zero.c
index 51424f66a765..68e3d8f5da89 100644
--- a/drivers/usb/gadget/zero.c
+++ b/drivers/usb/gadget/zero.c
@@ -572,9 +572,10 @@ static void source_sink_complete (struct usb_ep *ep, struct usb_request *req)
572 switch (status) { 572 switch (status) {
573 573
574 case 0: /* normal completion? */ 574 case 0: /* normal completion? */
575 if (ep == dev->out_ep) 575 if (ep == dev->out_ep) {
576 check_read_data (dev, ep, req); 576 check_read_data (dev, ep, req);
577 else 577 memset (req->buf, 0x55, req->length);
578 } else
578 reinit_write_data (dev, ep, req); 579 reinit_write_data (dev, ep, req);
579 break; 580 break;
580 581
@@ -626,6 +627,8 @@ source_sink_start_ep (struct usb_ep *ep, gfp_t gfp_flags)
626 627
627 if (strcmp (ep->name, EP_IN_NAME) == 0) 628 if (strcmp (ep->name, EP_IN_NAME) == 0)
628 reinit_write_data (ep->driver_data, ep, req); 629 reinit_write_data (ep->driver_data, ep, req);
630 else
631 memset (req->buf, 0x55, req->length);
629 632
630 status = usb_ep_queue (ep, req, gfp_flags); 633 status = usb_ep_queue (ep, req, gfp_flags);
631 if (status) { 634 if (status) {
diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c
index 1e03f1a5a5fd..a1bd2bea6deb 100644
--- a/drivers/usb/host/ehci-pci.c
+++ b/drivers/usb/host/ehci-pci.c
@@ -350,7 +350,7 @@ static const struct hc_driver ehci_pci_hc_driver = {
350/* PCI driver selection metadata; PCI hotplugging uses this */ 350/* PCI driver selection metadata; PCI hotplugging uses this */
351static const struct pci_device_id pci_ids [] = { { 351static const struct pci_device_id pci_ids [] = { {
352 /* handle any USB 2.0 EHCI controller */ 352 /* handle any USB 2.0 EHCI controller */
353 PCI_DEVICE_CLASS(((PCI_CLASS_SERIAL_USB << 8) | 0x20), ~0), 353 PCI_DEVICE_CLASS(PCI_CLASS_SERIAL_USB_EHCI, ~0),
354 .driver_data = (unsigned long) &ehci_pci_hc_driver, 354 .driver_data = (unsigned long) &ehci_pci_hc_driver,
355 }, 355 },
356 { /* end: all zeroes */ } 356 { /* end: all zeroes */ }
diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c
index 980030d684d5..6b7350b52419 100644
--- a/drivers/usb/host/ohci-at91.c
+++ b/drivers/usb/host/ohci-at91.c
@@ -20,7 +20,7 @@
20#include <asm/arch/board.h> 20#include <asm/arch/board.h>
21 21
22#ifndef CONFIG_ARCH_AT91RM9200 22#ifndef CONFIG_ARCH_AT91RM9200
23#error "This file is AT91RM9200 bus glue. CONFIG_ARCH_AT91RM9200 must be defined." 23#error "CONFIG_ARCH_AT91RM9200 must be defined."
24#endif 24#endif
25 25
26/* interface and function clocks */ 26/* interface and function clocks */
@@ -84,8 +84,6 @@ static int usb_hcd_at91_remove (struct usb_hcd *, struct platform_device *);
84 * Allocates basic resources for this USB host controller, and 84 * Allocates basic resources for this USB host controller, and
85 * then invokes the start() method for the HCD associated with it 85 * then invokes the start() method for the HCD associated with it
86 * through the hotplug entry's driver_data. 86 * through the hotplug entry's driver_data.
87 *
88 * Store this function in the HCD's struct pci_driver as probe().
89 */ 87 */
90int usb_hcd_at91_probe (const struct hc_driver *driver, struct platform_device *pdev) 88int usb_hcd_at91_probe (const struct hc_driver *driver, struct platform_device *pdev)
91{ 89{
@@ -148,7 +146,6 @@ int usb_hcd_at91_probe (const struct hc_driver *driver, struct platform_device *
148} 146}
149 147
150 148
151/* may be called without controller electrically present */
152/* may be called with controller, bus, and devices active */ 149/* may be called with controller, bus, and devices active */
153 150
154/** 151/**
@@ -166,11 +163,11 @@ static int usb_hcd_at91_remove (struct usb_hcd *hcd, struct platform_device *pde
166 usb_remove_hcd(hcd); 163 usb_remove_hcd(hcd);
167 at91_stop_hc(pdev); 164 at91_stop_hc(pdev);
168 iounmap(hcd->regs); 165 iounmap(hcd->regs);
169 release_mem_region(hcd->rsrc_start, hcd->rsrc_len); 166 release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
170 167
171 clk_put(fclk); 168 clk_put(fclk);
172 clk_put(iclk); 169 clk_put(iclk);
173 fclk = iclk = NULL; 170 fclk = iclk = NULL;
174 171
175 dev_set_drvdata(&pdev->dev, NULL); 172 dev_set_drvdata(&pdev->dev, NULL);
176 return 0; 173 return 0;
@@ -235,8 +232,8 @@ static const struct hc_driver ohci_at91_hc_driver = {
235 .hub_control = ohci_hub_control, 232 .hub_control = ohci_hub_control,
236 233
237#ifdef CONFIG_PM 234#ifdef CONFIG_PM
238 .hub_suspend = ohci_hub_suspend, 235 .bus_suspend = ohci_bus_suspend,
239 .hub_resume = ohci_hub_resume, 236 .bus_resume = ohci_bus_resume,
240#endif 237#endif
241 .start_port_reset = ohci_start_port_reset, 238 .start_port_reset = ohci_start_port_reset,
242}; 239};
@@ -254,21 +251,21 @@ static int ohci_hcd_at91_drv_remove(struct platform_device *dev)
254} 251}
255 252
256#ifdef CONFIG_PM 253#ifdef CONFIG_PM
257static int ohci_hcd_at91_drv_suspend(struct platform_device *dev, u32 state, u32 level)
258{
259 printk("%s(%s:%d): not implemented yet\n",
260 __func__, __FILE__, __LINE__);
261 254
255/* REVISIT suspend/resume look "too" simple here */
256
257static int
258ohci_hcd_at91_drv_suspend(struct platform_device *dev, pm_message_t mesg)
259{
262 clk_disable(fclk); 260 clk_disable(fclk);
261 clk_disable(iclk);
263 262
264 return 0; 263 return 0;
265} 264}
266 265
267static int ohci_hcd_at91_drv_resume(struct platform_device *dev, u32 state) 266static int ohci_hcd_at91_drv_resume(struct platform_device *dev)
268{ 267{
269 printk("%s(%s:%d): not implemented yet\n", 268 clk_enable(iclk);
270 __func__, __FILE__, __LINE__);
271
272 clk_enable(fclk); 269 clk_enable(fclk);
273 270
274 return 0; 271 return 0;
@@ -278,6 +275,8 @@ static int ohci_hcd_at91_drv_resume(struct platform_device *dev, u32 state)
278#define ohci_hcd_at91_drv_resume NULL 275#define ohci_hcd_at91_drv_resume NULL
279#endif 276#endif
280 277
278MODULE_ALIAS("at91rm9200-ohci");
279
281static struct platform_driver ohci_hcd_at91_driver = { 280static struct platform_driver ohci_hcd_at91_driver = {
282 .probe = ohci_hcd_at91_drv_probe, 281 .probe = ohci_hcd_at91_drv_probe,
283 .remove = ohci_hcd_at91_drv_remove, 282 .remove = ohci_hcd_at91_drv_remove,
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index 544f7589912f..73f5a379d9b3 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -863,7 +863,7 @@ static int ohci_restart (struct ohci_hcd *ohci)
863 i = ohci->num_ports; 863 i = ohci->num_ports;
864 while (i--) 864 while (i--)
865 ohci_writel (ohci, RH_PS_PSS, 865 ohci_writel (ohci, RH_PS_PSS,
866 &ohci->regs->roothub.portstatus [temp]); 866 &ohci->regs->roothub.portstatus [i]);
867 ohci_dbg (ohci, "restart complete\n"); 867 ohci_dbg (ohci, "restart complete\n");
868 } 868 }
869 return 0; 869 return 0;
diff --git a/drivers/usb/host/ohci-pci.c b/drivers/usb/host/ohci-pci.c
index 1bfe96f4d045..b268537e389e 100644
--- a/drivers/usb/host/ohci-pci.c
+++ b/drivers/usb/host/ohci-pci.c
@@ -206,7 +206,7 @@ static const struct hc_driver ohci_pci_hc_driver = {
206 206
207static const struct pci_device_id pci_ids [] = { { 207static const struct pci_device_id pci_ids [] = { {
208 /* handle any USB OHCI controller */ 208 /* handle any USB OHCI controller */
209 PCI_DEVICE_CLASS((PCI_CLASS_SERIAL_USB << 8) | 0x10, ~0), 209 PCI_DEVICE_CLASS(PCI_CLASS_SERIAL_USB_OHCI, ~0),
210 .driver_data = (unsigned long) &ohci_pci_hc_driver, 210 .driver_data = (unsigned long) &ohci_pci_hc_driver,
211 }, { /* end: all zeroes */ } 211 }, { /* end: all zeroes */ }
212}; 212};
diff --git a/drivers/usb/host/ohci-s3c2410.c b/drivers/usb/host/ohci-s3c2410.c
index 682bf2215660..1da5de573a6f 100644
--- a/drivers/usb/host/ohci-s3c2410.c
+++ b/drivers/usb/host/ohci-s3c2410.c
@@ -30,6 +30,7 @@
30/* clock device associated with the hcd */ 30/* clock device associated with the hcd */
31 31
32static struct clk *clk; 32static struct clk *clk;
33static struct clk *usb_clk;
33 34
34/* forward definitions */ 35/* forward definitions */
35 36
@@ -37,7 +38,7 @@ static void s3c2410_hcd_oc(struct s3c2410_hcd_info *info, int port_oc);
37 38
38/* conversion functions */ 39/* conversion functions */
39 40
40struct s3c2410_hcd_info *to_s3c2410_info(struct usb_hcd *hcd) 41static struct s3c2410_hcd_info *to_s3c2410_info(struct usb_hcd *hcd)
41{ 42{
42 return hcd->self.controller->platform_data; 43 return hcd->self.controller->platform_data;
43} 44}
@@ -47,6 +48,10 @@ static void s3c2410_start_hc(struct platform_device *dev, struct usb_hcd *hcd)
47 struct s3c2410_hcd_info *info = dev->dev.platform_data; 48 struct s3c2410_hcd_info *info = dev->dev.platform_data;
48 49
49 dev_dbg(&dev->dev, "s3c2410_start_hc:\n"); 50 dev_dbg(&dev->dev, "s3c2410_start_hc:\n");
51
52 clk_enable(usb_clk);
53 mdelay(2); /* let the bus clock stabilise */
54
50 clk_enable(clk); 55 clk_enable(clk);
51 56
52 if (info != NULL) { 57 if (info != NULL) {
@@ -75,6 +80,7 @@ static void s3c2410_stop_hc(struct platform_device *dev)
75 } 80 }
76 81
77 clk_disable(clk); 82 clk_disable(clk);
83 clk_disable(usb_clk);
78} 84}
79 85
80/* ohci_s3c2410_hub_status_data 86/* ohci_s3c2410_hub_status_data
@@ -316,7 +322,8 @@ static void s3c2410_hcd_oc(struct s3c2410_hcd_info *info, int port_oc)
316 * 322 *
317*/ 323*/
318 324
319void usb_hcd_s3c2410_remove (struct usb_hcd *hcd, struct platform_device *dev) 325static void
326usb_hcd_s3c2410_remove (struct usb_hcd *hcd, struct platform_device *dev)
320{ 327{
321 usb_remove_hcd(hcd); 328 usb_remove_hcd(hcd);
322 s3c2410_stop_hc(dev); 329 s3c2410_stop_hc(dev);
@@ -334,8 +341,8 @@ void usb_hcd_s3c2410_remove (struct usb_hcd *hcd, struct platform_device *dev)
334 * through the hotplug entry's driver_data. 341 * through the hotplug entry's driver_data.
335 * 342 *
336 */ 343 */
337int usb_hcd_s3c2410_probe (const struct hc_driver *driver, 344static int usb_hcd_s3c2410_probe (const struct hc_driver *driver,
338 struct platform_device *dev) 345 struct platform_device *dev)
339{ 346{
340 struct usb_hcd *hcd = NULL; 347 struct usb_hcd *hcd = NULL;
341 int retval; 348 int retval;
@@ -353,14 +360,21 @@ int usb_hcd_s3c2410_probe (const struct hc_driver *driver,
353 if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) { 360 if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) {
354 dev_err(&dev->dev, "request_mem_region failed"); 361 dev_err(&dev->dev, "request_mem_region failed");
355 retval = -EBUSY; 362 retval = -EBUSY;
356 goto err0; 363 goto err_put;
357 } 364 }
358 365
359 clk = clk_get(NULL, "usb-host"); 366 clk = clk_get(&dev->dev, "usb-host");
360 if (IS_ERR(clk)) { 367 if (IS_ERR(clk)) {
361 dev_err(&dev->dev, "cannot get usb-host clock\n"); 368 dev_err(&dev->dev, "cannot get usb-host clock\n");
362 retval = -ENOENT; 369 retval = -ENOENT;
363 goto err1; 370 goto err_mem;
371 }
372
373 usb_clk = clk_get(&dev->dev, "upll");
374 if (IS_ERR(usb_clk)) {
375 dev_err(&dev->dev, "cannot get usb-host clock\n");
376 retval = -ENOENT;
377 goto err_clk;
364 } 378 }
365 379
366 s3c2410_start_hc(dev, hcd); 380 s3c2410_start_hc(dev, hcd);
@@ -369,26 +383,29 @@ int usb_hcd_s3c2410_probe (const struct hc_driver *driver,
369 if (!hcd->regs) { 383 if (!hcd->regs) {
370 dev_err(&dev->dev, "ioremap failed\n"); 384 dev_err(&dev->dev, "ioremap failed\n");
371 retval = -ENOMEM; 385 retval = -ENOMEM;
372 goto err2; 386 goto err_ioremap;
373 } 387 }
374 388
375 ohci_hcd_init(hcd_to_ohci(hcd)); 389 ohci_hcd_init(hcd_to_ohci(hcd));
376 390
377 retval = usb_add_hcd(hcd, dev->resource[1].start, SA_INTERRUPT); 391 retval = usb_add_hcd(hcd, dev->resource[1].start, SA_INTERRUPT);
378 if (retval != 0) 392 if (retval != 0)
379 goto err2; 393 goto err_ioremap;
380 394
381 return 0; 395 return 0;
382 396
383 err2: 397 err_ioremap:
384 s3c2410_stop_hc(dev); 398 s3c2410_stop_hc(dev);
385 iounmap(hcd->regs); 399 iounmap(hcd->regs);
400 clk_put(usb_clk);
401
402 err_clk:
386 clk_put(clk); 403 clk_put(clk);
387 404
388 err1: 405 err_mem:
389 release_mem_region(hcd->rsrc_start, hcd->rsrc_len); 406 release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
390 407
391 err0: 408 err_put:
392 usb_put_hcd(hcd); 409 usb_put_hcd(hcd);
393 return retval; 410 return retval;
394} 411}
diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c
index 9e81c26313f9..1045f846fbe2 100644
--- a/drivers/usb/host/pci-quirks.c
+++ b/drivers/usb/host/pci-quirks.c
@@ -15,6 +15,7 @@
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/delay.h> 16#include <linux/delay.h>
17#include <linux/acpi.h> 17#include <linux/acpi.h>
18#include "pci-quirks.h"
18 19
19 20
20#define UHCI_USBLEGSUP 0xc0 /* legacy support */ 21#define UHCI_USBLEGSUP 0xc0 /* legacy support */
diff --git a/drivers/usb/host/pci-quirks.h b/drivers/usb/host/pci-quirks.h
new file mode 100644
index 000000000000..1564edfff6fe
--- /dev/null
+++ b/drivers/usb/host/pci-quirks.h
@@ -0,0 +1,7 @@
1#ifndef __LINUX_USB_PCI_QUIRKS_H
2#define __LINUX_USB_PCI_QUIRKS_H
3
4void uhci_reset_hc(struct pci_dev *pdev, unsigned long base);
5int uhci_check_and_reset_hc(struct pci_dev *pdev, unsigned long base);
6
7#endif /* __LINUX_USB_PCI_QUIRKS_H */
diff --git a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c
index 4edb8330c440..d225e11f4055 100644
--- a/drivers/usb/host/uhci-hcd.c
+++ b/drivers/usb/host/uhci-hcd.c
@@ -50,6 +50,7 @@
50 50
51#include "../core/hcd.h" 51#include "../core/hcd.h"
52#include "uhci-hcd.h" 52#include "uhci-hcd.h"
53#include "pci-quirks.h"
53 54
54/* 55/*
55 * Version Information 56 * Version Information
@@ -100,9 +101,6 @@ static void uhci_get_current_frame_number(struct uhci_hcd *uhci);
100#include "uhci-q.c" 101#include "uhci-q.c"
101#include "uhci-hub.c" 102#include "uhci-hub.c"
102 103
103extern void uhci_reset_hc(struct pci_dev *pdev, unsigned long base);
104extern int uhci_check_and_reset_hc(struct pci_dev *pdev, unsigned long base);
105
106/* 104/*
107 * Finish up a host controller reset and update the recorded state. 105 * Finish up a host controller reset and update the recorded state.
108 */ 106 */
@@ -117,8 +115,7 @@ static void finish_reset(struct uhci_hcd *uhci)
117 for (port = 0; port < uhci->rh_numports; ++port) 115 for (port = 0; port < uhci->rh_numports; ++port)
118 outw(0, uhci->io_addr + USBPORTSC1 + (port * 2)); 116 outw(0, uhci->io_addr + USBPORTSC1 + (port * 2));
119 117
120 uhci->port_c_suspend = uhci->suspended_ports = 118 uhci->port_c_suspend = uhci->resuming_ports = 0;
121 uhci->resuming_ports = 0;
122 uhci->rh_state = UHCI_RH_RESET; 119 uhci->rh_state = UHCI_RH_RESET;
123 uhci->is_stopped = UHCI_IS_STOPPED; 120 uhci->is_stopped = UHCI_IS_STOPPED;
124 uhci_to_hcd(uhci)->state = HC_STATE_HALT; 121 uhci_to_hcd(uhci)->state = HC_STATE_HALT;
@@ -861,7 +858,7 @@ static const struct hc_driver uhci_driver = {
861 858
862static const struct pci_device_id uhci_pci_ids[] = { { 859static const struct pci_device_id uhci_pci_ids[] = { {
863 /* handle any USB UHCI controller */ 860 /* handle any USB UHCI controller */
864 PCI_DEVICE_CLASS(((PCI_CLASS_SERIAL_USB << 8) | 0x00), ~0), 861 PCI_DEVICE_CLASS(PCI_CLASS_SERIAL_USB_UHCI, ~0),
865 .driver_data = (unsigned long) &uhci_driver, 862 .driver_data = (unsigned long) &uhci_driver,
866 }, { /* end: all zeroes */ } 863 }, { /* end: all zeroes */ }
867}; 864};
diff --git a/drivers/usb/host/uhci-hcd.h b/drivers/usb/host/uhci-hcd.h
index 4a69c7eb09bd..d5c8f4d92823 100644
--- a/drivers/usb/host/uhci-hcd.h
+++ b/drivers/usb/host/uhci-hcd.h
@@ -415,7 +415,6 @@ struct uhci_hcd {
415 415
416 /* Support for port suspend/resume/reset */ 416 /* Support for port suspend/resume/reset */
417 unsigned long port_c_suspend; /* Bit-arrays of ports */ 417 unsigned long port_c_suspend; /* Bit-arrays of ports */
418 unsigned long suspended_ports;
419 unsigned long resuming_ports; 418 unsigned long resuming_ports;
420 unsigned long ports_timeout; /* Time to stop signalling */ 419 unsigned long ports_timeout; /* Time to stop signalling */
421 420
diff --git a/drivers/usb/host/uhci-hub.c b/drivers/usb/host/uhci-hub.c
index 152971d16769..c8451d9578f1 100644
--- a/drivers/usb/host/uhci-hub.c
+++ b/drivers/usb/host/uhci-hub.c
@@ -85,11 +85,10 @@ static void uhci_finish_suspend(struct uhci_hcd *uhci, int port,
85{ 85{
86 int status; 86 int status;
87 87
88 if (test_bit(port, &uhci->suspended_ports)) { 88 if (inw(port_addr) & (USBPORTSC_SUSP | USBPORTSC_RD)) {
89 CLR_RH_PORTSTAT(USBPORTSC_SUSP | USBPORTSC_RD); 89 CLR_RH_PORTSTAT(USBPORTSC_SUSP | USBPORTSC_RD);
90 clear_bit(port, &uhci->suspended_ports); 90 if (test_bit(port, &uhci->resuming_ports))
91 clear_bit(port, &uhci->resuming_ports); 91 set_bit(port, &uhci->port_c_suspend);
92 set_bit(port, &uhci->port_c_suspend);
93 92
94 /* The controller won't actually turn off the RD bit until 93 /* The controller won't actually turn off the RD bit until
95 * it has had a chance to send a low-speed EOP sequence, 94 * it has had a chance to send a low-speed EOP sequence,
@@ -97,6 +96,7 @@ static void uhci_finish_suspend(struct uhci_hcd *uhci, int port,
97 * slightly longer for good luck. */ 96 * slightly longer for good luck. */
98 udelay(4); 97 udelay(4);
99 } 98 }
99 clear_bit(port, &uhci->resuming_ports);
100} 100}
101 101
102/* Wait for the UHCI controller in HP's iLO2 server management chip. 102/* Wait for the UHCI controller in HP's iLO2 server management chip.
@@ -265,8 +265,6 @@ static int uhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
265 wPortChange |= USB_PORT_STAT_C_SUSPEND; 265 wPortChange |= USB_PORT_STAT_C_SUSPEND;
266 lstatus |= 1; 266 lstatus |= 1;
267 } 267 }
268 if (test_bit(port, &uhci->suspended_ports))
269 lstatus |= 2;
270 if (test_bit(port, &uhci->resuming_ports)) 268 if (test_bit(port, &uhci->resuming_ports))
271 lstatus |= 4; 269 lstatus |= 4;
272 270
@@ -309,7 +307,6 @@ static int uhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
309 307
310 switch (wValue) { 308 switch (wValue) {
311 case USB_PORT_FEAT_SUSPEND: 309 case USB_PORT_FEAT_SUSPEND:
312 set_bit(port, &uhci->suspended_ports);
313 SET_RH_PORTSTAT(USBPORTSC_SUSP); 310 SET_RH_PORTSTAT(USBPORTSC_SUSP);
314 OK(0); 311 OK(0);
315 case USB_PORT_FEAT_RESET: 312 case USB_PORT_FEAT_RESET:
@@ -343,8 +340,11 @@ static int uhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
343 CLR_RH_PORTSTAT(USBPORTSC_PEC); 340 CLR_RH_PORTSTAT(USBPORTSC_PEC);
344 OK(0); 341 OK(0);
345 case USB_PORT_FEAT_SUSPEND: 342 case USB_PORT_FEAT_SUSPEND:
346 if (test_bit(port, &uhci->suspended_ports) && 343 if (!(inw(port_addr) & USBPORTSC_SUSP)) {
347 !test_and_set_bit(port, 344
345 /* Make certain the port isn't suspended */
346 uhci_finish_suspend(uhci, port, port_addr);
347 } else if (!test_and_set_bit(port,
348 &uhci->resuming_ports)) { 348 &uhci->resuming_ports)) {
349 SET_RH_PORTSTAT(USBPORTSC_RD); 349 SET_RH_PORTSTAT(USBPORTSC_RD);
350 350
diff --git a/drivers/usb/input/Kconfig b/drivers/usb/input/Kconfig
index 5246b35301de..650103bc9618 100644
--- a/drivers/usb/input/Kconfig
+++ b/drivers/usb/input/Kconfig
@@ -200,45 +200,41 @@ config USB_POWERMATE
200 To compile this driver as a module, choose M here: the 200 To compile this driver as a module, choose M here: the
201 module will be called powermate. 201 module will be called powermate.
202 202
203config USB_MTOUCH 203config USB_TOUCHSCREEN
204 tristate "MicroTouch USB Touchscreen Driver" 204 tristate "USB Touchscreen Driver"
205 depends on USB && INPUT 205 depends on USB && INPUT
206 ---help--- 206 ---help---
207 Say Y here if you want to use a MicroTouch (Now 3M) USB 207 USB Touchscreen driver for:
208 Touchscreen controller. 208 - eGalax Touchkit USB
209 - PanJit TouchSet USB
210 - 3M MicroTouch USB
211 - ITM
209 212
210 See <file:Documentation/usb/mtouch.txt> for additional information. 213 Have a look at <http://linux.chapter7.ch/touchkit/> for
211 214 a usage description and the required user-space stuff.
212 To compile this driver as a module, choose M here: the
213 module will be called mtouchusb.
214
215config USB_ITMTOUCH
216 tristate "ITM Touch USB Touchscreen Driver"
217 depends on USB && INPUT
218 ---help---
219 Say Y here if you want to use a ITM Touch USB
220 Touchscreen controller.
221
222 This touchscreen is used in LG 1510SF monitors.
223 215
224 To compile this driver as a module, choose M here: the 216 To compile this driver as a module, choose M here: the
225 module will be called itmtouch. 217 module will be called usbtouchscreen.
226 218
227config USB_EGALAX 219config USB_TOUCHSCREEN_EGALAX
228 tristate "eGalax TouchKit USB Touchscreen Driver" 220 default y
229 depends on USB && INPUT 221 bool "eGalax device support" if EMBEDDED
230 ---help--- 222 depends on USB_TOUCHSCREEN
231 Say Y here if you want to use a eGalax TouchKit USB
232 Touchscreen controller.
233 223
234 The driver has been tested on a Xenarc 700TSV monitor 224config USB_TOUCHSCREEN_PANJIT
235 with eGalax touchscreen. 225 default y
226 bool "PanJit device support" if EMBEDDED
227 depends on USB_TOUCHSCREEN
236 228
237 Have a look at <http://linux.chapter7.ch/touchkit/> for 229config USB_TOUCHSCREEN_3M
238 a usage description and the required user-space stuff. 230 default y
231 bool "3M/Microtouch device support" if EMBEDDED
232 depends on USB_TOUCHSCREEN
239 233
240 To compile this driver as a module, choose M here: the 234config USB_TOUCHSCREEN_ITM
241 module will be called touchkitusb. 235 default y
236 bool "ITM device support" if EMBEDDED
237 depends on USB_TOUCHSCREEN
242 238
243config USB_YEALINK 239config USB_YEALINK
244 tristate "Yealink usb-p1k voip phone" 240 tristate "Yealink usb-p1k voip phone"
diff --git a/drivers/usb/input/Makefile b/drivers/usb/input/Makefile
index d512d9f488fe..764114529c56 100644
--- a/drivers/usb/input/Makefile
+++ b/drivers/usb/input/Makefile
@@ -37,6 +37,7 @@ obj-$(CONFIG_USB_MOUSE) += usbmouse.o
37obj-$(CONFIG_USB_MTOUCH) += mtouchusb.o 37obj-$(CONFIG_USB_MTOUCH) += mtouchusb.o
38obj-$(CONFIG_USB_ITMTOUCH) += itmtouch.o 38obj-$(CONFIG_USB_ITMTOUCH) += itmtouch.o
39obj-$(CONFIG_USB_EGALAX) += touchkitusb.o 39obj-$(CONFIG_USB_EGALAX) += touchkitusb.o
40obj-$(CONFIG_USB_TOUCHSCREEN) += usbtouchscreen.o
40obj-$(CONFIG_USB_POWERMATE) += powermate.o 41obj-$(CONFIG_USB_POWERMATE) += powermate.o
41obj-$(CONFIG_USB_WACOM) += wacom.o 42obj-$(CONFIG_USB_WACOM) += wacom.o
42obj-$(CONFIG_USB_ACECAD) += acecad.o 43obj-$(CONFIG_USB_ACECAD) += acecad.o
diff --git a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c
index d4bf1701046b..435273e7c85c 100644
--- a/drivers/usb/input/hid-core.c
+++ b/drivers/usb/input/hid-core.c
@@ -1372,6 +1372,11 @@ void hid_close(struct hid_device *hid)
1372 usb_kill_urb(hid->urbin); 1372 usb_kill_urb(hid->urbin);
1373} 1373}
1374 1374
1375#define USB_VENDOR_ID_PANJIT 0x134c
1376
1377#define USB_VENDOR_ID_SILVERCREST 0x062a
1378#define USB_DEVICE_ID_SILVERCREST_KB 0x0201
1379
1375/* 1380/*
1376 * Initialize all reports 1381 * Initialize all reports
1377 */ 1382 */
@@ -1552,6 +1557,9 @@ void hid_init_reports(struct hid_device *hid)
1552#define USB_VENDOR_ID_HP 0x03f0 1557#define USB_VENDOR_ID_HP 0x03f0
1553#define USB_DEVICE_ID_HP_USBHUB_KB 0x020c 1558#define USB_DEVICE_ID_HP_USBHUB_KB 0x020c
1554 1559
1560#define USB_VENDOR_ID_IBM 0x04b3
1561#define USB_DEVICE_ID_IBM_USBHUB_KB 0x3005
1562
1555#define USB_VENDOR_ID_CREATIVELABS 0x062a 1563#define USB_VENDOR_ID_CREATIVELABS 0x062a
1556#define USB_DEVICE_ID_CREATIVELABS_SILVERCREST 0x0201 1564#define USB_DEVICE_ID_CREATIVELABS_SILVERCREST 0x0201
1557 1565
@@ -1655,9 +1663,12 @@ static const struct hid_blacklist {
1655 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS3, HID_QUIRK_IGNORE }, 1663 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS3, HID_QUIRK_IGNORE },
1656 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS3 + 1, HID_QUIRK_IGNORE }, 1664 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS3 + 1, HID_QUIRK_IGNORE },
1657 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS3 + 2, HID_QUIRK_IGNORE }, 1665 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS3 + 2, HID_QUIRK_IGNORE },
1666 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS3 + 3, HID_QUIRK_IGNORE },
1667 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS3 + 4, HID_QUIRK_IGNORE },
1658 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS3 + 5, HID_QUIRK_IGNORE }, 1668 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS3 + 5, HID_QUIRK_IGNORE },
1659 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_CINTIQ, HID_QUIRK_IGNORE }, 1669 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_CINTIQ, HID_QUIRK_IGNORE },
1660 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_DTF, HID_QUIRK_IGNORE }, 1670 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_DTF, HID_QUIRK_IGNORE },
1671 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_DTF + 3, HID_QUIRK_IGNORE },
1661 { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_4_PHIDGETSERVO_20, HID_QUIRK_IGNORE }, 1672 { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_4_PHIDGETSERVO_20, HID_QUIRK_IGNORE },
1662 { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_1_PHIDGETSERVO_20, HID_QUIRK_IGNORE }, 1673 { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_1_PHIDGETSERVO_20, HID_QUIRK_IGNORE },
1663 1674
@@ -1673,8 +1684,10 @@ static const struct hid_blacklist {
1673 { USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_USBHUB_KB, HID_QUIRK_NOGET}, 1684 { USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_USBHUB_KB, HID_QUIRK_NOGET},
1674 { USB_VENDOR_ID_CREATIVELABS, USB_DEVICE_ID_CREATIVELABS_SILVERCREST, HID_QUIRK_NOGET }, 1685 { USB_VENDOR_ID_CREATIVELABS, USB_DEVICE_ID_CREATIVELABS_SILVERCREST, HID_QUIRK_NOGET },
1675 { USB_VENDOR_ID_HP, USB_DEVICE_ID_HP_USBHUB_KB, HID_QUIRK_NOGET }, 1686 { USB_VENDOR_ID_HP, USB_DEVICE_ID_HP_USBHUB_KB, HID_QUIRK_NOGET },
1687 { USB_VENDOR_ID_IBM, USB_DEVICE_ID_IBM_USBHUB_KB, HID_QUIRK_NOGET },
1676 { USB_VENDOR_ID_TANGTOP, USB_DEVICE_ID_TANGTOP_USBPS2, HID_QUIRK_NOGET }, 1688 { USB_VENDOR_ID_TANGTOP, USB_DEVICE_ID_TANGTOP_USBPS2, HID_QUIRK_NOGET },
1677 { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_DUAL_USB_JOYPAD, HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT }, 1689 { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_DUAL_USB_JOYPAD, HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT },
1690 { USB_VENDOR_ID_SILVERCREST, USB_DEVICE_ID_SILVERCREST_KB, HID_QUIRK_NOGET },
1678 1691
1679 { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_POWERMOUSE, HID_QUIRK_2WHEEL_POWERMOUSE }, 1692 { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_POWERMOUSE, HID_QUIRK_2WHEEL_POWERMOUSE },
1680 { USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU, HID_QUIRK_2WHEEL_MOUSE_HACK_7 }, 1693 { USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU, HID_QUIRK_2WHEEL_MOUSE_HACK_7 },
@@ -1701,6 +1714,11 @@ static const struct hid_blacklist {
1701 { USB_VENDOR_ID_APPLE, 0x030A, HID_QUIRK_POWERBOOK_HAS_FN }, 1714 { USB_VENDOR_ID_APPLE, 0x030A, HID_QUIRK_POWERBOOK_HAS_FN },
1702 { USB_VENDOR_ID_APPLE, 0x030B, HID_QUIRK_POWERBOOK_HAS_FN }, 1715 { USB_VENDOR_ID_APPLE, 0x030B, HID_QUIRK_POWERBOOK_HAS_FN },
1703 1716
1717 { USB_VENDOR_ID_PANJIT, 0x0001, HID_QUIRK_IGNORE },
1718 { USB_VENDOR_ID_PANJIT, 0x0002, HID_QUIRK_IGNORE },
1719 { USB_VENDOR_ID_PANJIT, 0x0003, HID_QUIRK_IGNORE },
1720 { USB_VENDOR_ID_PANJIT, 0x0004, HID_QUIRK_IGNORE },
1721
1704 { 0, 0 } 1722 { 0, 0 }
1705}; 1723};
1706 1724
diff --git a/drivers/usb/input/hid-ff.c b/drivers/usb/input/hid-ff.c
index 72e698658b53..d5c91ee67991 100644
--- a/drivers/usb/input/hid-ff.c
+++ b/drivers/usb/input/hid-ff.c
@@ -34,12 +34,6 @@
34 34
35#include "hid.h" 35#include "hid.h"
36 36
37/* Drivers' initializing functions */
38extern int hid_lgff_init(struct hid_device* hid);
39extern int hid_lg3d_init(struct hid_device* hid);
40extern int hid_pid_init(struct hid_device* hid);
41extern int hid_tmff_init(struct hid_device* hid);
42
43/* 37/*
44 * This table contains pointers to initializers. To add support for new 38 * This table contains pointers to initializers. To add support for new
45 * devices, you need to add the USB vendor and product ids here. 39 * devices, you need to add the USB vendor and product ids here.
diff --git a/drivers/usb/input/hid.h b/drivers/usb/input/hid.h
index 4e1b784fe527..9c62837b5b89 100644
--- a/drivers/usb/input/hid.h
+++ b/drivers/usb/input/hid.h
@@ -533,3 +533,8 @@ static inline int hid_ff_event(struct hid_device *hid, struct input_dev *input,
533 return hid->ff_event(hid, input, type, code, value); 533 return hid->ff_event(hid, input, type, code, value);
534 return -ENOSYS; 534 return -ENOSYS;
535} 535}
536
537int hid_lgff_init(struct hid_device* hid);
538int hid_tmff_init(struct hid_device* hid);
539int hid_pid_init(struct hid_device* hid);
540
diff --git a/drivers/usb/input/hiddev.c b/drivers/usb/input/hiddev.c
index 6dd666696178..c4670e1d4654 100644
--- a/drivers/usb/input/hiddev.c
+++ b/drivers/usb/input/hiddev.c
@@ -317,6 +317,7 @@ static ssize_t hiddev_read(struct file * file, char __user * buffer, size_t coun
317 } 317 }
318 318
319 schedule(); 319 schedule();
320 set_current_state(TASK_INTERRUPTIBLE);
320 } 321 }
321 322
322 set_current_state(TASK_RUNNING); 323 set_current_state(TASK_RUNNING);
diff --git a/drivers/usb/input/keyspan_remote.c b/drivers/usb/input/keyspan_remote.c
index b4a051b549d1..3d911976f378 100644
--- a/drivers/usb/input/keyspan_remote.c
+++ b/drivers/usb/input/keyspan_remote.c
@@ -297,6 +297,8 @@ static void keyspan_check_data(struct usb_keyspan *remote, struct pt_regs *regs)
297 remote->data.bits_left -= 6; 297 remote->data.bits_left -= 6;
298 } else { 298 } else {
299 err("%s - Error in message, invalid toggle.\n", __FUNCTION__); 299 err("%s - Error in message, invalid toggle.\n", __FUNCTION__);
300 remote->stage = 0;
301 return;
300 } 302 }
301 303
302 keyspan_load_tester(remote, 5); 304 keyspan_load_tester(remote, 5);
diff --git a/drivers/usb/input/usbtouchscreen.c b/drivers/usb/input/usbtouchscreen.c
new file mode 100644
index 000000000000..e9a07c1e905b
--- /dev/null
+++ b/drivers/usb/input/usbtouchscreen.c
@@ -0,0 +1,605 @@
1/******************************************************************************
2 * usbtouchscreen.c
3 * Driver for USB Touchscreens, supporting those devices:
4 * - eGalax Touchkit
5 * - 3M/Microtouch
6 * - ITM
7 * - PanJit TouchSet
8 *
9 * Copyright (C) 2004-2006 by Daniel Ritz <daniel.ritz@gmx.ch>
10 * Copyright (C) by Todd E. Johnson (mtouchusb.c)
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License as
14 * published by the Free Software Foundation; either version 2 of the
15 * License, or (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 *
26 * Driver is based on touchkitusb.c
27 * - ITM parts are from itmtouch.c
28 * - 3M parts are from mtouchusb.c
29 * - PanJit parts are from an unmerged driver by Lanslott Gish
30 *
31 *****************************************************************************/
32
33//#define DEBUG
34
35#include <linux/config.h>
36#include <linux/kernel.h>
37#include <linux/slab.h>
38#include <linux/input.h>
39#include <linux/module.h>
40#include <linux/init.h>
41#include <linux/usb.h>
42#include <linux/usb_input.h>
43
44
45#define DRIVER_VERSION "v0.3"
46#define DRIVER_AUTHOR "Daniel Ritz <daniel.ritz@gmx.ch>"
47#define DRIVER_DESC "USB Touchscreen Driver"
48
49static int swap_xy;
50module_param(swap_xy, bool, 0644);
51MODULE_PARM_DESC(swap_xy, "If set X and Y axes are swapped.");
52
53/* device specifc data/functions */
54struct usbtouch_usb;
55struct usbtouch_device_info {
56 int min_xc, max_xc;
57 int min_yc, max_yc;
58 int min_press, max_press;
59 int rept_size;
60 int flags;
61
62 void (*process_pkt) (struct usbtouch_usb *usbtouch, struct pt_regs *regs, unsigned char *pkt, int len);
63 int (*read_data) (unsigned char *pkt, int *x, int *y, int *touch, int *press);
64 int (*init) (struct usbtouch_usb *usbtouch);
65};
66
67#define USBTOUCH_FLG_BUFFER 0x01
68
69
70/* a usbtouch device */
71struct usbtouch_usb {
72 unsigned char *data;
73 dma_addr_t data_dma;
74 unsigned char *buffer;
75 int buf_len;
76 struct urb *irq;
77 struct usb_device *udev;
78 struct input_dev *input;
79 struct usbtouch_device_info *type;
80 char name[128];
81 char phys[64];
82};
83
84static void usbtouch_process_pkt(struct usbtouch_usb *usbtouch,
85 struct pt_regs *regs, unsigned char *pkt, int len);
86
87/* device types */
88enum {
89 DEVTPYE_DUMMY = -1,
90 DEVTYPE_EGALAX,
91 DEVTYPE_PANJIT,
92 DEVTYPE_3M,
93 DEVTYPE_ITM,
94};
95
96static struct usb_device_id usbtouch_devices[] = {
97#ifdef CONFIG_USB_TOUCHSCREEN_EGALAX
98 {USB_DEVICE(0x3823, 0x0001), .driver_info = DEVTYPE_EGALAX},
99 {USB_DEVICE(0x0123, 0x0001), .driver_info = DEVTYPE_EGALAX},
100 {USB_DEVICE(0x0eef, 0x0001), .driver_info = DEVTYPE_EGALAX},
101 {USB_DEVICE(0x0eef, 0x0002), .driver_info = DEVTYPE_EGALAX},
102#endif
103
104#ifdef CONFIG_USB_TOUCHSCREEN_PANJIT
105 {USB_DEVICE(0x134c, 0x0001), .driver_info = DEVTYPE_PANJIT},
106 {USB_DEVICE(0x134c, 0x0002), .driver_info = DEVTYPE_PANJIT},
107 {USB_DEVICE(0x134c, 0x0003), .driver_info = DEVTYPE_PANJIT},
108 {USB_DEVICE(0x134c, 0x0004), .driver_info = DEVTYPE_PANJIT},
109#endif
110
111#ifdef CONFIG_USB_TOUCHSCREEN_3M
112 {USB_DEVICE(0x0596, 0x0001), .driver_info = DEVTYPE_3M},
113#endif
114
115#ifdef CONFIG_USB_TOUCHSCREEN_ITM
116 {USB_DEVICE(0x0403, 0xf9e9), .driver_info = DEVTYPE_ITM},
117#endif
118
119 {}
120};
121
122
123/*****************************************************************************
124 * eGalax part
125 */
126
127#ifdef CONFIG_USB_TOUCHSCREEN_EGALAX
128
129#define EGALAX_PKT_TYPE_MASK 0xFE
130#define EGALAX_PKT_TYPE_REPT 0x80
131#define EGALAX_PKT_TYPE_DIAG 0x0A
132
133static int egalax_read_data(unsigned char *pkt, int *x, int *y, int *touch, int *press)
134{
135 if ((pkt[0] & EGALAX_PKT_TYPE_MASK) != EGALAX_PKT_TYPE_REPT)
136 return 0;
137
138 *x = ((pkt[3] & 0x0F) << 7) | (pkt[4] & 0x7F);
139 *y = ((pkt[1] & 0x0F) << 7) | (pkt[2] & 0x7F);
140 *touch = pkt[0] & 0x01;
141
142 return 1;
143
144}
145
146static int egalax_get_pkt_len(unsigned char *buf)
147{
148 switch (buf[0] & EGALAX_PKT_TYPE_MASK) {
149 case EGALAX_PKT_TYPE_REPT:
150 return 5;
151
152 case EGALAX_PKT_TYPE_DIAG:
153 return buf[1] + 2;
154 }
155
156 return 0;
157}
158
159static void egalax_process(struct usbtouch_usb *usbtouch, struct pt_regs *regs,
160 unsigned char *pkt, int len)
161{
162 unsigned char *buffer;
163 int pkt_len, buf_len, pos;
164
165 /* if the buffer contains data, append */
166 if (unlikely(usbtouch->buf_len)) {
167 int tmp;
168
169 /* if only 1 byte in buffer, add another one to get length */
170 if (usbtouch->buf_len == 1)
171 usbtouch->buffer[1] = pkt[0];
172
173 pkt_len = egalax_get_pkt_len(usbtouch->buffer);
174
175 /* unknown packet: drop everything */
176 if (!pkt_len)
177 return;
178
179 /* append, process */
180 tmp = pkt_len - usbtouch->buf_len;
181 memcpy(usbtouch->buffer + usbtouch->buf_len, pkt, tmp);
182 usbtouch_process_pkt(usbtouch, regs, usbtouch->buffer, pkt_len);
183
184 buffer = pkt + tmp;
185 buf_len = len - tmp;
186 } else {
187 buffer = pkt;
188 buf_len = len;
189 }
190
191 /* only one byte left in buffer */
192 if (unlikely(buf_len == 1)) {
193 usbtouch->buffer[0] = buffer[0];
194 usbtouch->buf_len = 1;
195 return;
196 }
197
198 /* loop over the buffer */
199 pos = 0;
200 while (pos < buf_len) {
201 /* get packet len */
202 pkt_len = egalax_get_pkt_len(buffer + pos);
203
204 /* unknown packet: drop everything */
205 if (unlikely(!pkt_len))
206 return;
207
208 /* full packet: process */
209 if (likely(pkt_len <= buf_len)) {
210 usbtouch_process_pkt(usbtouch, regs, buffer + pos, pkt_len);
211 } else {
212 /* incomplete packet: save in buffer */
213 memcpy(usbtouch->buffer, buffer + pos, buf_len - pos);
214 usbtouch->buf_len = buf_len - pos;
215 }
216 pos += pkt_len;
217 }
218}
219#endif
220
221
222/*****************************************************************************
223 * PanJit Part
224 */
225#ifdef CONFIG_USB_TOUCHSCREEN_PANJIT
226static int panjit_read_data(unsigned char *pkt, int *x, int *y, int *touch, int *press)
227{
228 *x = ((pkt[2] & 0x0F) << 8) | pkt[1];
229 *y = ((pkt[4] & 0x0F) << 8) | pkt[3];
230 *touch = pkt[0] & 0x01;
231
232 return 1;
233}
234#endif
235
236
237/*****************************************************************************
238 * 3M/Microtouch Part
239 */
240#ifdef CONFIG_USB_TOUCHSCREEN_3M
241
242#define MTOUCHUSB_ASYNC_REPORT 1
243#define MTOUCHUSB_RESET 7
244#define MTOUCHUSB_REQ_CTRLLR_ID 10
245
246static int mtouch_read_data(unsigned char *pkt, int *x, int *y, int *touch, int *press)
247{
248 *x = (pkt[8] << 8) | pkt[7];
249 *y = (pkt[10] << 8) | pkt[9];
250 *touch = (pkt[2] & 0x40) ? 1 : 0;
251
252 return 1;
253}
254
255static int mtouch_init(struct usbtouch_usb *usbtouch)
256{
257 int ret;
258
259 ret = usb_control_msg(usbtouch->udev, usb_rcvctrlpipe(usbtouch->udev, 0),
260 MTOUCHUSB_RESET,
261 USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
262 1, 0, NULL, 0, USB_CTRL_SET_TIMEOUT);
263 dbg("%s - usb_control_msg - MTOUCHUSB_RESET - bytes|err: %d",
264 __FUNCTION__, ret);
265 if (ret < 0)
266 return ret;
267
268 ret = usb_control_msg(usbtouch->udev, usb_rcvctrlpipe(usbtouch->udev, 0),
269 MTOUCHUSB_ASYNC_REPORT,
270 USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
271 1, 1, NULL, 0, USB_CTRL_SET_TIMEOUT);
272 dbg("%s - usb_control_msg - MTOUCHUSB_ASYNC_REPORT - bytes|err: %d",
273 __FUNCTION__, ret);
274 if (ret < 0)
275 return ret;
276
277 return 0;
278}
279#endif
280
281
282/*****************************************************************************
283 * ITM Part
284 */
285#ifdef CONFIG_USB_TOUCHSCREEN_ITM
286static int itm_read_data(unsigned char *pkt, int *x, int *y, int *touch, int *press)
287{
288 *x = ((pkt[0] & 0x1F) << 7) | (pkt[3] & 0x7F);
289 *x = ((pkt[1] & 0x1F) << 7) | (pkt[4] & 0x7F);
290 *press = ((pkt[2] & 0x1F) << 7) | (pkt[5] & 0x7F);
291 *touch = ~pkt[7] & 0x20;
292
293 return 1;
294}
295#endif
296
297
298/*****************************************************************************
299 * the different device descriptors
300 */
301static struct usbtouch_device_info usbtouch_dev_info[] = {
302#ifdef CONFIG_USB_TOUCHSCREEN_EGALAX
303 [DEVTYPE_EGALAX] = {
304 .min_xc = 0x0,
305 .max_xc = 0x07ff,
306 .min_yc = 0x0,
307 .max_yc = 0x07ff,
308 .rept_size = 16,
309 .flags = USBTOUCH_FLG_BUFFER,
310 .process_pkt = egalax_process,
311 .read_data = egalax_read_data,
312 },
313#endif
314
315#ifdef CONFIG_USB_TOUCHSCREEN_PANJIT
316 [DEVTYPE_PANJIT] = {
317 .min_xc = 0x0,
318 .max_xc = 0x0fff,
319 .min_yc = 0x0,
320 .max_yc = 0x0fff,
321 .rept_size = 8,
322 .read_data = panjit_read_data,
323 },
324#endif
325
326#ifdef CONFIG_USB_TOUCHSCREEN_3M
327 [DEVTYPE_3M] = {
328 .min_xc = 0x0,
329 .max_xc = 0x4000,
330 .min_yc = 0x0,
331 .max_yc = 0x4000,
332 .rept_size = 11,
333 .read_data = mtouch_read_data,
334 .init = mtouch_init,
335 },
336#endif
337
338#ifdef CONFIG_USB_TOUCHSCREEN_ITM
339 [DEVTYPE_ITM] = {
340 .min_xc = 0x0,
341 .max_xc = 0x0fff,
342 .min_yc = 0x0,
343 .max_yc = 0x0fff,
344 .max_press = 0xff,
345 .rept_size = 8,
346 .read_data = itm_read_data,
347 },
348#endif
349};
350
351
352/*****************************************************************************
353 * Generic Part
354 */
355static void usbtouch_process_pkt(struct usbtouch_usb *usbtouch,
356 struct pt_regs *regs, unsigned char *pkt, int len)
357{
358 int x, y, touch, press;
359 struct usbtouch_device_info *type = usbtouch->type;
360
361 if (!type->read_data(pkt, &x, &y, &touch, &press))
362 return;
363
364 input_regs(usbtouch->input, regs);
365 input_report_key(usbtouch->input, BTN_TOUCH, touch);
366
367 if (swap_xy) {
368 input_report_abs(usbtouch->input, ABS_X, y);
369 input_report_abs(usbtouch->input, ABS_Y, x);
370 } else {
371 input_report_abs(usbtouch->input, ABS_X, x);
372 input_report_abs(usbtouch->input, ABS_Y, y);
373 }
374 if (type->max_press)
375 input_report_abs(usbtouch->input, ABS_PRESSURE, press);
376 input_sync(usbtouch->input);
377}
378
379
380static void usbtouch_irq(struct urb *urb, struct pt_regs *regs)
381{
382 struct usbtouch_usb *usbtouch = urb->context;
383 int retval;
384
385 switch (urb->status) {
386 case 0:
387 /* success */
388 break;
389 case -ETIMEDOUT:
390 /* this urb is timing out */
391 dbg("%s - urb timed out - was the device unplugged?",
392 __FUNCTION__);
393 return;
394 case -ECONNRESET:
395 case -ENOENT:
396 case -ESHUTDOWN:
397 /* this urb is terminated, clean up */
398 dbg("%s - urb shutting down with status: %d",
399 __FUNCTION__, urb->status);
400 return;
401 default:
402 dbg("%s - nonzero urb status received: %d",
403 __FUNCTION__, urb->status);
404 goto exit;
405 }
406
407 usbtouch->type->process_pkt(usbtouch, regs, usbtouch->data, urb->actual_length);
408
409exit:
410 retval = usb_submit_urb(urb, GFP_ATOMIC);
411 if (retval)
412 err("%s - usb_submit_urb failed with result: %d",
413 __FUNCTION__, retval);
414}
415
416static int usbtouch_open(struct input_dev *input)
417{
418 struct usbtouch_usb *usbtouch = input->private;
419
420 usbtouch->irq->dev = usbtouch->udev;
421
422 if (usb_submit_urb(usbtouch->irq, GFP_KERNEL))
423 return -EIO;
424
425 return 0;
426}
427
428static void usbtouch_close(struct input_dev *input)
429{
430 struct usbtouch_usb *usbtouch = input->private;
431
432 usb_kill_urb(usbtouch->irq);
433}
434
435
436static void usbtouch_free_buffers(struct usb_device *udev,
437 struct usbtouch_usb *usbtouch)
438{
439 if (usbtouch->data)
440 usb_buffer_free(udev, usbtouch->type->rept_size,
441 usbtouch->data, usbtouch->data_dma);
442 kfree(usbtouch->buffer);
443}
444
445
446static int usbtouch_probe(struct usb_interface *intf,
447 const struct usb_device_id *id)
448{
449 struct usbtouch_usb *usbtouch;
450 struct input_dev *input_dev;
451 struct usb_host_interface *interface;
452 struct usb_endpoint_descriptor *endpoint;
453 struct usb_device *udev = interface_to_usbdev(intf);
454 struct usbtouch_device_info *type;
455 int err;
456
457 interface = intf->cur_altsetting;
458 endpoint = &interface->endpoint[0].desc;
459
460 usbtouch = kzalloc(sizeof(struct usbtouch_usb), GFP_KERNEL);
461 input_dev = input_allocate_device();
462 if (!usbtouch || !input_dev)
463 goto out_free;
464
465 type = &usbtouch_dev_info[id->driver_info];
466 usbtouch->type = type;
467 if (!type->process_pkt)
468 type->process_pkt = usbtouch_process_pkt;
469
470 usbtouch->data = usb_buffer_alloc(udev, type->rept_size,
471 SLAB_KERNEL, &usbtouch->data_dma);
472 if (!usbtouch->data)
473 goto out_free;
474
475 if (type->flags & USBTOUCH_FLG_BUFFER) {
476 usbtouch->buffer = kmalloc(type->rept_size, GFP_KERNEL);
477 if (!usbtouch->buffer)
478 goto out_free_buffers;
479 }
480
481 usbtouch->irq = usb_alloc_urb(0, GFP_KERNEL);
482 if (!usbtouch->irq) {
483 dbg("%s - usb_alloc_urb failed: usbtouch->irq", __FUNCTION__);
484 goto out_free_buffers;
485 }
486
487 usbtouch->udev = udev;
488 usbtouch->input = input_dev;
489
490 if (udev->manufacturer)
491 strlcpy(usbtouch->name, udev->manufacturer, sizeof(usbtouch->name));
492
493 if (udev->product) {
494 if (udev->manufacturer)
495 strlcat(usbtouch->name, " ", sizeof(usbtouch->name));
496 strlcat(usbtouch->name, udev->product, sizeof(usbtouch->name));
497 }
498
499 if (!strlen(usbtouch->name))
500 snprintf(usbtouch->name, sizeof(usbtouch->name),
501 "USB Touchscreen %04x:%04x",
502 le16_to_cpu(udev->descriptor.idVendor),
503 le16_to_cpu(udev->descriptor.idProduct));
504
505 usb_make_path(udev, usbtouch->phys, sizeof(usbtouch->phys));
506 strlcpy(usbtouch->phys, "/input0", sizeof(usbtouch->phys));
507
508 input_dev->name = usbtouch->name;
509 input_dev->phys = usbtouch->phys;
510 usb_to_input_id(udev, &input_dev->id);
511 input_dev->cdev.dev = &intf->dev;
512 input_dev->private = usbtouch;
513 input_dev->open = usbtouch_open;
514 input_dev->close = usbtouch_close;
515
516 input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
517 input_dev->keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH);
518 input_set_abs_params(input_dev, ABS_X, type->min_xc, type->max_xc, 0, 0);
519 input_set_abs_params(input_dev, ABS_Y, type->min_yc, type->max_yc, 0, 0);
520 if (type->max_press)
521 input_set_abs_params(input_dev, ABS_PRESSURE, type->min_press,
522 type->max_press, 0, 0);
523
524 usb_fill_int_urb(usbtouch->irq, usbtouch->udev,
525 usb_rcvintpipe(usbtouch->udev, 0x81),
526 usbtouch->data, type->rept_size,
527 usbtouch_irq, usbtouch, endpoint->bInterval);
528
529 usbtouch->irq->transfer_dma = usbtouch->data_dma;
530 usbtouch->irq->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
531
532 /* device specific init */
533 if (type->init) {
534 err = type->init(usbtouch);
535 if (err) {
536 dbg("%s - type->init() failed, err: %d", __FUNCTION__, err);
537 goto out_free_buffers;
538 }
539 }
540
541 err = input_register_device(usbtouch->input);
542 if (err) {
543 dbg("%s - input_register_device failed, err: %d", __FUNCTION__, err);
544 goto out_free_buffers;
545 }
546
547 usb_set_intfdata(intf, usbtouch);
548
549 return 0;
550
551out_free_buffers:
552 usbtouch_free_buffers(udev, usbtouch);
553out_free:
554 input_free_device(input_dev);
555 kfree(usbtouch);
556 return -ENOMEM;
557}
558
559static void usbtouch_disconnect(struct usb_interface *intf)
560{
561 struct usbtouch_usb *usbtouch = usb_get_intfdata(intf);
562
563 dbg("%s - called", __FUNCTION__);
564
565 if (!usbtouch)
566 return;
567
568 dbg("%s - usbtouch is initialized, cleaning up", __FUNCTION__);
569 usb_set_intfdata(intf, NULL);
570 usb_kill_urb(usbtouch->irq);
571 input_unregister_device(usbtouch->input);
572 usb_free_urb(usbtouch->irq);
573 usbtouch_free_buffers(interface_to_usbdev(intf), usbtouch);
574 kfree(usbtouch);
575}
576
577MODULE_DEVICE_TABLE(usb, usbtouch_devices);
578
579static struct usb_driver usbtouch_driver = {
580 .name = "usbtouchscreen",
581 .probe = usbtouch_probe,
582 .disconnect = usbtouch_disconnect,
583 .id_table = usbtouch_devices,
584};
585
586static int __init usbtouch_init(void)
587{
588 return usb_register(&usbtouch_driver);
589}
590
591static void __exit usbtouch_cleanup(void)
592{
593 usb_deregister(&usbtouch_driver);
594}
595
596module_init(usbtouch_init);
597module_exit(usbtouch_cleanup);
598
599MODULE_AUTHOR(DRIVER_AUTHOR);
600MODULE_DESCRIPTION(DRIVER_DESC);
601MODULE_LICENSE("GPL");
602
603MODULE_ALIAS("touchkitusb");
604MODULE_ALIAS("itmtouch");
605MODULE_ALIAS("mtouchusb");
diff --git a/drivers/usb/input/wacom.c b/drivers/usb/input/wacom.c
index d3e15df9e815..cf84c6096f29 100644
--- a/drivers/usb/input/wacom.c
+++ b/drivers/usb/input/wacom.c
@@ -9,7 +9,7 @@
9 * Copyright (c) 2000 Daniel Egger <egger@suse.de> 9 * Copyright (c) 2000 Daniel Egger <egger@suse.de>
10 * Copyright (c) 2001 Frederic Lepied <flepied@mandrakesoft.com> 10 * Copyright (c) 2001 Frederic Lepied <flepied@mandrakesoft.com>
11 * Copyright (c) 2004 Panagiotis Issaris <panagiotis.issaris@mech.kuleuven.ac.be> 11 * Copyright (c) 2004 Panagiotis Issaris <panagiotis.issaris@mech.kuleuven.ac.be>
12 * Copyright (c) 2002-2005 Ping Cheng <pingc@wacom.com> 12 * Copyright (c) 2002-2006 Ping Cheng <pingc@wacom.com>
13 * 13 *
14 * ChangeLog: 14 * ChangeLog:
15 * v0.1 (vp) - Initial release 15 * v0.1 (vp) - Initial release
@@ -56,6 +56,8 @@
56 * - Merged wacom_intuos3_irq into wacom_intuos_irq 56 * - Merged wacom_intuos3_irq into wacom_intuos_irq
57 * v1.44 (pc) - Added support for Graphire4, Cintiq 710, Intuos3 6x11, etc. 57 * v1.44 (pc) - Added support for Graphire4, Cintiq 710, Intuos3 6x11, etc.
58 * - Report Device IDs 58 * - Report Device IDs
59 * v1.45 (pc) - Added support for DTF 521, Intuos3 12x12 and 12x19
60 * - Minor data report fix
59 */ 61 */
60 62
61/* 63/*
@@ -78,7 +80,7 @@
78/* 80/*
79 * Version Information 81 * Version Information
80 */ 82 */
81#define DRIVER_VERSION "v1.44" 83#define DRIVER_VERSION "v1.45"
82#define DRIVER_AUTHOR "Vojtech Pavlik <vojtech@ucw.cz>" 84#define DRIVER_AUTHOR "Vojtech Pavlik <vojtech@ucw.cz>"
83#define DRIVER_DESC "USB Wacom Graphire and Wacom Intuos tablet driver" 85#define DRIVER_DESC "USB Wacom Graphire and Wacom Intuos tablet driver"
84#define DRIVER_LICENSE "GPL" 86#define DRIVER_LICENSE "GPL"
@@ -99,6 +101,8 @@ enum {
99 PL, 101 PL,
100 INTUOS, 102 INTUOS,
101 INTUOS3, 103 INTUOS3,
104 INTUOS312,
105 INTUOS319,
102 CINTIQ, 106 CINTIQ,
103 MAX_TYPE 107 MAX_TYPE
104}; 108};
@@ -127,7 +131,19 @@ struct wacom {
127 char phys[32]; 131 char phys[32];
128}; 132};
129 133
134#define USB_REQ_GET_REPORT 0x01
130#define USB_REQ_SET_REPORT 0x09 135#define USB_REQ_SET_REPORT 0x09
136
137static int usb_get_report(struct usb_interface *intf, unsigned char type,
138 unsigned char id, void *buf, int size)
139{
140 return usb_control_msg(interface_to_usbdev(intf),
141 usb_rcvctrlpipe(interface_to_usbdev(intf), 0),
142 USB_REQ_GET_REPORT, USB_TYPE_CLASS | USB_RECIP_INTERFACE,
143 (type << 8) + id, intf->altsetting[0].desc.bInterfaceNumber,
144 buf, size, 100);
145}
146
131static int usb_set_report(struct usb_interface *intf, unsigned char type, 147static int usb_set_report(struct usb_interface *intf, unsigned char type,
132 unsigned char id, void *buf, int size) 148 unsigned char id, void *buf, int size)
133{ 149{
@@ -206,7 +222,8 @@ static void wacom_pl_irq(struct urb *urb, struct pt_regs *regs)
206 wacom->tool[1] = BTN_TOOL_PEN; 222 wacom->tool[1] = BTN_TOOL_PEN;
207 id = STYLUS_DEVICE_ID; 223 id = STYLUS_DEVICE_ID;
208 } 224 }
209 input_report_key(dev, wacom->tool[1], id); /* report in proximity for tool */ 225 input_report_key(dev, wacom->tool[1], prox); /* report in proximity for tool */
226 input_report_abs(dev, ABS_MISC, id); /* report tool id */
210 input_report_abs(dev, ABS_X, data[3] | (data[2] << 7) | ((data[1] & 0x03) << 14)); 227 input_report_abs(dev, ABS_X, data[3] | (data[2] << 7) | ((data[1] & 0x03) << 14));
211 input_report_abs(dev, ABS_Y, data[6] | (data[5] << 7) | ((data[4] & 0x03) << 14)); 228 input_report_abs(dev, ABS_Y, data[6] | (data[5] << 7) | ((data[4] & 0x03) << 14));
212 input_report_abs(dev, ABS_PRESSURE, pressure); 229 input_report_abs(dev, ABS_PRESSURE, pressure);
@@ -239,7 +256,7 @@ static void wacom_ptu_irq(struct urb *urb, struct pt_regs *regs)
239 struct wacom *wacom = urb->context; 256 struct wacom *wacom = urb->context;
240 unsigned char *data = wacom->data; 257 unsigned char *data = wacom->data;
241 struct input_dev *dev = wacom->dev; 258 struct input_dev *dev = wacom->dev;
242 int retval; 259 int retval, id;
243 260
244 switch (urb->status) { 261 switch (urb->status) {
245 case 0: 262 case 0:
@@ -263,12 +280,15 @@ static void wacom_ptu_irq(struct urb *urb, struct pt_regs *regs)
263 280
264 input_regs(dev, regs); 281 input_regs(dev, regs);
265 if (data[1] & 0x04) { 282 if (data[1] & 0x04) {
266 input_report_key(dev, BTN_TOOL_RUBBER, (data[1] & 0x20) ? ERASER_DEVICE_ID : 0); 283 input_report_key(dev, BTN_TOOL_RUBBER, data[1] & 0x20);
267 input_report_key(dev, BTN_TOUCH, data[1] & 0x08); 284 input_report_key(dev, BTN_TOUCH, data[1] & 0x08);
285 id = ERASER_DEVICE_ID;
268 } else { 286 } else {
269 input_report_key(dev, BTN_TOOL_PEN, (data[1] & 0x20) ? STYLUS_DEVICE_ID : 0); 287 input_report_key(dev, BTN_TOOL_PEN, data[1] & 0x20);
270 input_report_key(dev, BTN_TOUCH, data[1] & 0x01); 288 input_report_key(dev, BTN_TOUCH, data[1] & 0x01);
289 id = STYLUS_DEVICE_ID;
271 } 290 }
291 input_report_abs(dev, ABS_MISC, id); /* report tool id */
272 input_report_abs(dev, ABS_X, le16_to_cpu(*(__le16 *) &data[2])); 292 input_report_abs(dev, ABS_X, le16_to_cpu(*(__le16 *) &data[2]));
273 input_report_abs(dev, ABS_Y, le16_to_cpu(*(__le16 *) &data[4])); 293 input_report_abs(dev, ABS_Y, le16_to_cpu(*(__le16 *) &data[4]));
274 input_report_abs(dev, ABS_PRESSURE, le16_to_cpu(*(__le16 *) &data[6])); 294 input_report_abs(dev, ABS_PRESSURE, le16_to_cpu(*(__le16 *) &data[6]));
@@ -312,7 +332,8 @@ static void wacom_penpartner_irq(struct urb *urb, struct pt_regs *regs)
312 } 332 }
313 333
314 input_regs(dev, regs); 334 input_regs(dev, regs);
315 input_report_key(dev, BTN_TOOL_PEN, STYLUS_DEVICE_ID); 335 input_report_key(dev, BTN_TOOL_PEN, 1);
336 input_report_abs(dev, ABS_MISC, STYLUS_DEVICE_ID); /* report tool id */
316 input_report_abs(dev, ABS_X, le16_to_cpu(*(__le16 *) &data[1])); 337 input_report_abs(dev, ABS_X, le16_to_cpu(*(__le16 *) &data[1]));
317 input_report_abs(dev, ABS_Y, le16_to_cpu(*(__le16 *) &data[3])); 338 input_report_abs(dev, ABS_Y, le16_to_cpu(*(__le16 *) &data[3]));
318 input_report_abs(dev, ABS_PRESSURE, (signed char)data[6] + 127); 339 input_report_abs(dev, ABS_PRESSURE, (signed char)data[6] + 127);
@@ -350,6 +371,8 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs)
350 goto exit; 371 goto exit;
351 } 372 }
352 373
374 if (data[0] == 99) return; /* for Volito tablets */
375
353 if (data[0] != 2) { 376 if (data[0] != 2) {
354 dbg("wacom_graphire_irq: received unknown report #%d", data[0]); 377 dbg("wacom_graphire_irq: received unknown report #%d", data[0]);
355 goto exit; 378 goto exit;
@@ -374,10 +397,10 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs)
374 case 2: /* Mouse with wheel */ 397 case 2: /* Mouse with wheel */
375 input_report_key(dev, BTN_MIDDLE, data[1] & 0x04); 398 input_report_key(dev, BTN_MIDDLE, data[1] & 0x04);
376 if (wacom->features->type == WACOM_G4) { 399 if (wacom->features->type == WACOM_G4) {
377 rw = data[7] & 0x04 ? -(data[7] & 0x03) : (data[7] & 0x03); 400 rw = data[7] & 0x04 ? (data[7] & 0x03)-4 : (data[7] & 0x03);
378 input_report_rel(dev, REL_WHEEL, rw); 401 input_report_rel(dev, REL_WHEEL, -rw);
379 } else 402 } else
380 input_report_rel(dev, REL_WHEEL, (signed char) data[6]); 403 input_report_rel(dev, REL_WHEEL, -(signed char) data[6]);
381 /* fall through */ 404 /* fall through */
382 405
383 case 3: /* Mouse without wheel */ 406 case 3: /* Mouse without wheel */
@@ -406,39 +429,27 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs)
406 } 429 }
407 } 430 }
408 431
409 input_report_key(dev, wacom->tool[0], (data[1] & 0x10) ? id : 0); 432 if (data[1] & 0x10)
433 input_report_abs(dev, ABS_MISC, id); /* report tool id */
434 else
435 input_report_abs(dev, ABS_MISC, 0); /* reset tool id */
436 input_report_key(dev, wacom->tool[0], data[1] & 0x10);
410 input_sync(dev); 437 input_sync(dev);
411 438
412 /* send pad data */ 439 /* send pad data */
413 if (wacom->features->type == WACOM_G4) { 440 if (wacom->features->type == WACOM_G4) {
414 /* fist time sending pad data */ 441 if ((wacom->serial[1] & 0xc0) != (data[7] & 0xf8)) {
415 if (wacom->tool[1] != BTN_TOOL_FINGER) { 442 wacom->id[1] = 1;
416 wacom->id[1] = 0; 443 wacom->serial[1] = (data[7] & 0xf8);
417 wacom->serial[1] = (data[7] & 0x38) >> 2;
418 }
419 if (data[7] & 0xf8) {
420 input_report_key(dev, BTN_0, (data[7] & 0x40)); 444 input_report_key(dev, BTN_0, (data[7] & 0x40));
421 input_report_key(dev, BTN_4, (data[7] & 0x80)); 445 input_report_key(dev, BTN_4, (data[7] & 0x80));
422 if (((data[7] & 0x38) >> 2) == (wacom->serial[1] & 0x0e)) 446 rw = ((data[7] & 0x18) >> 3) - ((data[7] & 0x20) >> 3);
423 /* alter REL_WHEEL value so X apps can get it */
424 wacom->serial[1] += (wacom->serial[1] & 0x01) ? -1 : 1;
425 else
426 wacom->serial[1] = (data[7] & 0x38 ) >> 2;
427
428 /* don't alter the value when there is no wheel event */
429 if (wacom->serial[1] == 1)
430 wacom->serial[1] = 0;
431 rw = wacom->serial[1];
432 rw = (rw & 0x08) ? -(rw & 0x07) : (rw & 0x07);
433 input_report_rel(dev, REL_WHEEL, rw); 447 input_report_rel(dev, REL_WHEEL, rw);
434 wacom->tool[1] = BTN_TOOL_FINGER; 448 input_report_key(dev, BTN_TOOL_FINGER, 0xf0);
435 wacom->id[1] = data[7] & 0xf8;
436 input_report_key(dev, wacom->tool[1], 0xf0);
437 input_event(dev, EV_MSC, MSC_SERIAL, 0xf0); 449 input_event(dev, EV_MSC, MSC_SERIAL, 0xf0);
438 } else if (wacom->id[1]) { 450 } else if (wacom->id[1]) {
439 wacom->id[1] = 0; 451 wacom->id[1] = 0;
440 wacom->serial[1] = 0; 452 input_report_key(dev, BTN_TOOL_FINGER, 0);
441 input_report_key(dev, wacom->tool[1], 0);
442 input_event(dev, EV_MSC, MSC_SERIAL, 0xf0); 453 input_event(dev, EV_MSC, MSC_SERIAL, 0xf0);
443 } 454 }
444 input_sync(dev); 455 input_sync(dev);
@@ -516,21 +527,31 @@ static int wacom_intuos_inout(struct urb *urb)
516 default: /* Unknown tool */ 527 default: /* Unknown tool */
517 wacom->tool[idx] = BTN_TOOL_PEN; 528 wacom->tool[idx] = BTN_TOOL_PEN;
518 } 529 }
519 input_report_key(dev, wacom->tool[idx], wacom->id[idx]); 530 if(!((wacom->tool[idx] == BTN_TOOL_LENS) &&
520 input_event(dev, EV_MSC, MSC_SERIAL, wacom->serial[idx]); 531 ((wacom->features->type == INTUOS312)
521 input_sync(dev); 532 || (wacom->features->type == INTUOS319)))) {
533 input_report_abs(dev, ABS_MISC, wacom->id[idx]); /* report tool id */
534 input_report_key(dev, wacom->tool[idx], 1);
535 input_event(dev, EV_MSC, MSC_SERIAL, wacom->serial[idx]);
536 input_sync(dev);
537 }
522 return 1; 538 return 1;
523 } 539 }
524 540
525 /* Exit report */ 541 /* Exit report */
526 if ((data[1] & 0xfe) == 0x80) { 542 if ((data[1] & 0xfe) == 0x80) {
527 input_report_key(dev, wacom->tool[idx], 0); 543 input_report_key(dev, wacom->tool[idx], 0);
544 input_report_abs(dev, ABS_MISC, 0); /* reset tool id */
528 input_event(dev, EV_MSC, MSC_SERIAL, wacom->serial[idx]); 545 input_event(dev, EV_MSC, MSC_SERIAL, wacom->serial[idx]);
529 input_sync(dev); 546 input_sync(dev);
530 return 1; 547 return 1;
531 } 548 }
532 549
533 return 0; 550 if((wacom->tool[idx] == BTN_TOOL_LENS) && ((wacom->features->type == INTUOS312)
551 || (wacom->features->type == INTUOS319)))
552 return 1;
553 else
554 return 0;
534} 555}
535 556
536static void wacom_intuos_general(struct urb *urb) 557static void wacom_intuos_general(struct urb *urb)
@@ -600,10 +621,9 @@ static void wacom_intuos_irq(struct urb *urb, struct pt_regs *regs)
600 /* pad packets. Works as a second tool and is always in prox */ 621 /* pad packets. Works as a second tool and is always in prox */
601 if (data[0] == 12) { 622 if (data[0] == 12) {
602 /* initiate the pad as a device */ 623 /* initiate the pad as a device */
603 if (wacom->tool[1] != BTN_TOOL_FINGER) { 624 if (wacom->tool[1] != BTN_TOOL_FINGER)
604 wacom->tool[1] = BTN_TOOL_FINGER; 625 wacom->tool[1] = BTN_TOOL_FINGER;
605 input_report_key(dev, wacom->tool[1], 1); 626
606 }
607 input_report_key(dev, BTN_0, (data[5] & 0x01)); 627 input_report_key(dev, BTN_0, (data[5] & 0x01));
608 input_report_key(dev, BTN_1, (data[5] & 0x02)); 628 input_report_key(dev, BTN_1, (data[5] & 0x02));
609 input_report_key(dev, BTN_2, (data[5] & 0x04)); 629 input_report_key(dev, BTN_2, (data[5] & 0x04));
@@ -614,6 +634,11 @@ static void wacom_intuos_irq(struct urb *urb, struct pt_regs *regs)
614 input_report_key(dev, BTN_7, (data[6] & 0x08)); 634 input_report_key(dev, BTN_7, (data[6] & 0x08));
615 input_report_abs(dev, ABS_RX, ((data[1] & 0x1f) << 8) | data[2]); 635 input_report_abs(dev, ABS_RX, ((data[1] & 0x1f) << 8) | data[2]);
616 input_report_abs(dev, ABS_RY, ((data[3] & 0x1f) << 8) | data[4]); 636 input_report_abs(dev, ABS_RY, ((data[3] & 0x1f) << 8) | data[4]);
637
638 if((data[5] & 0x0f) | (data[6] & 0x0f) | (data[1] & 0x1f) | data[2])
639 input_report_key(dev, wacom->tool[1], 1);
640 else
641 input_report_key(dev, wacom->tool[1], 0);
617 input_event(dev, EV_MSC, MSC_SERIAL, 0xffffffff); 642 input_event(dev, EV_MSC, MSC_SERIAL, 0xffffffff);
618 input_sync(dev); 643 input_sync(dev);
619 goto exit; 644 goto exit;
@@ -676,8 +701,8 @@ static void wacom_intuos_irq(struct urb *urb, struct pt_regs *regs)
676 input_report_key(dev, BTN_LEFT, data[8] & 0x04); 701 input_report_key(dev, BTN_LEFT, data[8] & 0x04);
677 input_report_key(dev, BTN_MIDDLE, data[8] & 0x08); 702 input_report_key(dev, BTN_MIDDLE, data[8] & 0x08);
678 input_report_key(dev, BTN_RIGHT, data[8] & 0x10); 703 input_report_key(dev, BTN_RIGHT, data[8] & 0x10);
679 input_report_rel(dev, REL_WHEEL, ((data[8] & 0x02) >> 1) 704 input_report_rel(dev, REL_WHEEL, (data[8] & 0x01)
680 - (data[8] & 0x01)); 705 - ((data[8] & 0x02) >> 1));
681 706
682 /* I3 2D mouse side buttons */ 707 /* I3 2D mouse side buttons */
683 if (wacom->features->type == INTUOS3) { 708 if (wacom->features->type == INTUOS3) {
@@ -695,7 +720,8 @@ static void wacom_intuos_irq(struct urb *urb, struct pt_regs *regs)
695 } 720 }
696 } 721 }
697 722
698 input_report_key(dev, wacom->tool[idx], wacom->id[idx]); 723 input_report_abs(dev, ABS_MISC, wacom->id[idx]); /* report tool id */
724 input_report_key(dev, wacom->tool[idx], 1);
699 input_event(dev, EV_MSC, MSC_SERIAL, wacom->serial[idx]); 725 input_event(dev, EV_MSC, MSC_SERIAL, wacom->serial[idx]);
700 input_sync(dev); 726 input_sync(dev);
701 727
@@ -733,7 +759,8 @@ static struct wacom_features wacom_features[] = {
733 { "Wacom PL800", 8, 7220, 5780, 511, 32, PL, wacom_pl_irq }, 759 { "Wacom PL800", 8, 7220, 5780, 511, 32, PL, wacom_pl_irq },
734 { "Wacom PL700", 8, 6758, 5406, 511, 32, PL, wacom_pl_irq }, 760 { "Wacom PL700", 8, 6758, 5406, 511, 32, PL, wacom_pl_irq },
735 { "Wacom PL510", 8, 6282, 4762, 511, 32, PL, wacom_pl_irq }, 761 { "Wacom PL510", 8, 6282, 4762, 511, 32, PL, wacom_pl_irq },
736 { "Wacom PL710", 8, 34080, 27660, 511, 32, PL, wacom_pl_irq }, 762 { "Wacom DTU710", 8, 34080, 27660, 511, 32, PL, wacom_pl_irq },
763 { "Wacom DTF521", 8, 6282, 4762, 511, 32, PL, wacom_pl_irq },
737 { "Wacom DTF720", 8, 6858, 5506, 511, 32, PL, wacom_pl_irq }, 764 { "Wacom DTF720", 8, 6858, 5506, 511, 32, PL, wacom_pl_irq },
738 { "Wacom Cintiq Partner",8, 20480, 15360, 511, 32, PL, wacom_ptu_irq }, 765 { "Wacom Cintiq Partner",8, 20480, 15360, 511, 32, PL, wacom_ptu_irq },
739 { "Wacom Intuos2 4x5", 10, 12700, 10600, 1023, 15, INTUOS, wacom_intuos_irq }, 766 { "Wacom Intuos2 4x5", 10, 12700, 10600, 1023, 15, INTUOS, wacom_intuos_irq },
@@ -744,6 +771,8 @@ static struct wacom_features wacom_features[] = {
744 { "Wacom Intuos3 4x5", 10, 25400, 20320, 1023, 15, INTUOS3, wacom_intuos_irq }, 771 { "Wacom Intuos3 4x5", 10, 25400, 20320, 1023, 15, INTUOS3, wacom_intuos_irq },
745 { "Wacom Intuos3 6x8", 10, 40640, 30480, 1023, 15, INTUOS3, wacom_intuos_irq }, 772 { "Wacom Intuos3 6x8", 10, 40640, 30480, 1023, 15, INTUOS3, wacom_intuos_irq },
746 { "Wacom Intuos3 9x12", 10, 60960, 45720, 1023, 15, INTUOS3, wacom_intuos_irq }, 773 { "Wacom Intuos3 9x12", 10, 60960, 45720, 1023, 15, INTUOS3, wacom_intuos_irq },
774 { "Wacom Intuos3 12x12", 10, 60960, 60960, 1023, 15, INTUOS312, wacom_intuos_irq },
775 { "Wacom Intuos3 12x19", 10, 97536, 60960, 1023, 15, INTUOS319, wacom_intuos_irq },
747 { "Wacom Intuos3 6x11", 10, 54204, 31750, 1023, 15, INTUOS3, wacom_intuos_irq }, 776 { "Wacom Intuos3 6x11", 10, 54204, 31750, 1023, 15, INTUOS3, wacom_intuos_irq },
748 { "Wacom Cintiq 21UX", 10, 87200, 65600, 1023, 15, CINTIQ, wacom_intuos_irq }, 777 { "Wacom Cintiq 21UX", 10, 87200, 65600, 1023, 15, CINTIQ, wacom_intuos_irq },
749 { "Wacom Intuos2 6x8", 10, 20320, 16240, 1023, 15, INTUOS, wacom_intuos_irq }, 778 { "Wacom Intuos2 6x8", 10, 20320, 16240, 1023, 15, INTUOS, wacom_intuos_irq },
@@ -779,6 +808,7 @@ static struct usb_device_id wacom_ids[] = {
779 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x38) }, 808 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x38) },
780 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x39) }, 809 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x39) },
781 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC0) }, 810 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC0) },
811 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC3) },
782 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x03) }, 812 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x03) },
783 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x41) }, 813 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x41) },
784 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x42) }, 814 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x42) },
@@ -788,6 +818,8 @@ static struct usb_device_id wacom_ids[] = {
788 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB0) }, 818 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB0) },
789 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB1) }, 819 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB1) },
790 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB2) }, 820 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB2) },
821 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB3) },
822 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB4) },
791 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB5) }, 823 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB5) },
792 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x3F) }, 824 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x3F) },
793 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x47) }, 825 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x47) },
@@ -820,7 +852,7 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
820 struct usb_endpoint_descriptor *endpoint; 852 struct usb_endpoint_descriptor *endpoint;
821 struct wacom *wacom; 853 struct wacom *wacom;
822 struct input_dev *input_dev; 854 struct input_dev *input_dev;
823 char rep_data[2] = {0x02, 0x02}; 855 char rep_data[2], limit = 0;
824 856
825 wacom = kzalloc(sizeof(struct wacom), GFP_KERNEL); 857 wacom = kzalloc(sizeof(struct wacom), GFP_KERNEL);
826 input_dev = input_allocate_device(); 858 input_dev = input_allocate_device();
@@ -857,6 +889,7 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
857 input_set_abs_params(input_dev, ABS_X, 0, wacom->features->x_max, 4, 0); 889 input_set_abs_params(input_dev, ABS_X, 0, wacom->features->x_max, 4, 0);
858 input_set_abs_params(input_dev, ABS_Y, 0, wacom->features->y_max, 4, 0); 890 input_set_abs_params(input_dev, ABS_Y, 0, wacom->features->y_max, 4, 0);
859 input_set_abs_params(input_dev, ABS_PRESSURE, 0, wacom->features->pressure_max, 0, 0); 891 input_set_abs_params(input_dev, ABS_PRESSURE, 0, wacom->features->pressure_max, 0, 0);
892 input_dev->absbit[LONG(ABS_MISC)] |= BIT(ABS_MISC);
860 893
861 switch (wacom->features->type) { 894 switch (wacom->features->type) {
862 case WACOM_G4: 895 case WACOM_G4:
@@ -875,6 +908,8 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
875 break; 908 break;
876 909
877 case INTUOS3: 910 case INTUOS3:
911 case INTUOS312:
912 case INTUOS319:
878 case CINTIQ: 913 case CINTIQ:
879 input_dev->keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_FINGER); 914 input_dev->keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_FINGER);
880 input_dev->keybit[LONG(BTN_LEFT)] |= BIT(BTN_0) | BIT(BTN_1) | BIT(BTN_2) | BIT(BTN_3) | BIT(BTN_4) | BIT(BTN_5) | BIT(BTN_6) | BIT(BTN_7); 915 input_dev->keybit[LONG(BTN_LEFT)] |= BIT(BTN_0) | BIT(BTN_1) | BIT(BTN_2) | BIT(BTN_3) | BIT(BTN_4) | BIT(BTN_5) | BIT(BTN_6) | BIT(BTN_7);
@@ -916,10 +951,13 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
916 951
917 input_register_device(wacom->dev); 952 input_register_device(wacom->dev);
918 953
919 /* ask the tablet to report tablet data */ 954 /* Ask the tablet to report tablet data. Repeat until it succeeds */
920 usb_set_report(intf, 3, 2, rep_data, 2); 955 do {
921 /* repeat once (not sure why the first call often fails) */ 956 rep_data[0] = 2;
922 usb_set_report(intf, 3, 2, rep_data, 2); 957 rep_data[1] = 2;
958 usb_set_report(intf, 3, 2, rep_data, 2);
959 usb_get_report(intf, 3, 2, rep_data, 2);
960 } while (rep_data[1] != 2 && limit++ < 5);
923 961
924 usb_set_intfdata(intf, wacom); 962 usb_set_intfdata(intf, wacom);
925 return 0; 963 return 0;
diff --git a/drivers/usb/misc/emi26.c b/drivers/usb/misc/emi26.c
index 3824df33094e..1fd9cb85f4ca 100644
--- a/drivers/usb/misc/emi26.c
+++ b/drivers/usb/misc/emi26.c
@@ -15,6 +15,7 @@
15#include <linux/module.h> 15#include <linux/module.h>
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/usb.h> 17#include <linux/usb.h>
18#include <linux/delay.h>
18 19
19#define MAX_INTEL_HEX_RECORD_LENGTH 16 20#define MAX_INTEL_HEX_RECORD_LENGTH 16
20typedef struct _INTEL_HEX_RECORD 21typedef struct _INTEL_HEX_RECORD
@@ -114,6 +115,7 @@ static int emi26_load_firmware (struct usb_device *dev)
114 115
115 /* De-assert reset (let the CPU run) */ 116 /* De-assert reset (let the CPU run) */
116 err = emi26_set_reset(dev,0); 117 err = emi26_set_reset(dev,0);
118 msleep(250); /* let device settle */
117 119
118 /* 2. We upload the FPGA firmware into the EMI 120 /* 2. We upload the FPGA firmware into the EMI
119 * Note: collect up to 1023 (yes!) bytes and send them with 121 * Note: collect up to 1023 (yes!) bytes and send them with
@@ -150,6 +152,7 @@ static int emi26_load_firmware (struct usb_device *dev)
150 goto wraperr; 152 goto wraperr;
151 } 153 }
152 } 154 }
155 msleep(250); /* let device settle */
153 156
154 /* De-assert reset (let the CPU run) */ 157 /* De-assert reset (let the CPU run) */
155 err = emi26_set_reset(dev,0); 158 err = emi26_set_reset(dev,0);
@@ -192,6 +195,7 @@ static int emi26_load_firmware (struct usb_device *dev)
192 err("%s - error loading firmware: error = %d", __FUNCTION__, err); 195 err("%s - error loading firmware: error = %d", __FUNCTION__, err);
193 goto wraperr; 196 goto wraperr;
194 } 197 }
198 msleep(250); /* let device settle */
195 199
196 /* return 1 to fail the driver inialization 200 /* return 1 to fail the driver inialization
197 * and give real driver change to load */ 201 * and give real driver change to load */
diff --git a/drivers/usb/misc/emi62.c b/drivers/usb/misc/emi62.c
index 52fea2e08db8..fe351371f274 100644
--- a/drivers/usb/misc/emi62.c
+++ b/drivers/usb/misc/emi62.c
@@ -15,6 +15,7 @@
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/module.h> 16#include <linux/module.h>
17#include <linux/usb.h> 17#include <linux/usb.h>
18#include <linux/delay.h>
18 19
19#define MAX_INTEL_HEX_RECORD_LENGTH 16 20#define MAX_INTEL_HEX_RECORD_LENGTH 16
20typedef struct _INTEL_HEX_RECORD 21typedef struct _INTEL_HEX_RECORD
@@ -123,6 +124,7 @@ static int emi62_load_firmware (struct usb_device *dev)
123 124
124 /* De-assert reset (let the CPU run) */ 125 /* De-assert reset (let the CPU run) */
125 err = emi62_set_reset(dev,0); 126 err = emi62_set_reset(dev,0);
127 msleep(250); /* let device settle */
126 128
127 /* 2. We upload the FPGA firmware into the EMI 129 /* 2. We upload the FPGA firmware into the EMI
128 * Note: collect up to 1023 (yes!) bytes and send them with 130 * Note: collect up to 1023 (yes!) bytes and send them with
@@ -166,6 +168,7 @@ static int emi62_load_firmware (struct usb_device *dev)
166 err("%s - error loading firmware: error = %d", __FUNCTION__, err); 168 err("%s - error loading firmware: error = %d", __FUNCTION__, err);
167 goto wraperr; 169 goto wraperr;
168 } 170 }
171 msleep(250); /* let device settle */
169 172
170 /* 4. We put the part of the firmware that lies in the external RAM into the EZ-USB */ 173 /* 4. We put the part of the firmware that lies in the external RAM into the EZ-USB */
171 174
@@ -228,6 +231,7 @@ static int emi62_load_firmware (struct usb_device *dev)
228 err("%s - error loading firmware: error = %d", __FUNCTION__, err); 231 err("%s - error loading firmware: error = %d", __FUNCTION__, err);
229 goto wraperr; 232 goto wraperr;
230 } 233 }
234 msleep(250); /* let device settle */
231 235
232 kfree(buf); 236 kfree(buf);
233 237
diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c
index 9d59b901841c..ccc5e8238bd8 100644
--- a/drivers/usb/misc/usbtest.c
+++ b/drivers/usb/misc/usbtest.c
@@ -381,6 +381,7 @@ alloc_sglist (int nents, int max, int vary)
381 381
382 for (i = 0; i < nents; i++) { 382 for (i = 0; i < nents; i++) {
383 char *buf; 383 char *buf;
384 unsigned j;
384 385
385 buf = kzalloc (size, SLAB_KERNEL); 386 buf = kzalloc (size, SLAB_KERNEL);
386 if (!buf) { 387 if (!buf) {
@@ -391,6 +392,16 @@ alloc_sglist (int nents, int max, int vary)
391 /* kmalloc pages are always physically contiguous! */ 392 /* kmalloc pages are always physically contiguous! */
392 sg_init_one(&sg[i], buf, size); 393 sg_init_one(&sg[i], buf, size);
393 394
395 switch (pattern) {
396 case 0:
397 /* already zeroed */
398 break;
399 case 1:
400 for (j = 0; j < size; j++)
401 *buf++ = (u8) (j % 63);
402 break;
403 }
404
394 if (vary) { 405 if (vary) {
395 size += vary; 406 size += vary;
396 size %= max; 407 size %= max;
@@ -425,6 +436,8 @@ static int perform_sglist (
425 usb_sg_wait (req); 436 usb_sg_wait (req);
426 retval = req->status; 437 retval = req->status;
427 438
439 /* FIXME check resulting data pattern */
440
428 /* FIXME if endpoint halted, clear halt (and log) */ 441 /* FIXME if endpoint halted, clear halt (and log) */
429 } 442 }
430 443
diff --git a/drivers/usb/net/asix.c b/drivers/usb/net/asix.c
index 3094970615cb..12b599a0b539 100644
--- a/drivers/usb/net/asix.c
+++ b/drivers/usb/net/asix.c
@@ -37,7 +37,6 @@
37 37
38#include "usbnet.h" 38#include "usbnet.h"
39 39
40
41/* ASIX AX8817X based USB 2.0 Ethernet Devices */ 40/* ASIX AX8817X based USB 2.0 Ethernet Devices */
42 41
43#define AX_CMD_SET_SW_MII 0x06 42#define AX_CMD_SET_SW_MII 0x06
@@ -109,7 +108,7 @@
109#define AX_EEPROM_MAGIC 0xdeadbeef 108#define AX_EEPROM_MAGIC 0xdeadbeef
110 109
111/* This structure cannot exceed sizeof(unsigned long [5]) AKA 20 bytes */ 110/* This structure cannot exceed sizeof(unsigned long [5]) AKA 20 bytes */
112struct ax8817x_data { 111struct asix_data {
113 u8 multi_filter[AX_MCAST_FILTER_SIZE]; 112 u8 multi_filter[AX_MCAST_FILTER_SIZE];
114}; 113};
115 114
@@ -121,7 +120,7 @@ struct ax88172_int_data {
121 u16 res3; 120 u16 res3;
122} __attribute__ ((packed)); 121} __attribute__ ((packed));
123 122
124static int ax8817x_read_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index, 123static int asix_read_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index,
125 u16 size, void *data) 124 u16 size, void *data)
126{ 125{
127 return usb_control_msg( 126 return usb_control_msg(
@@ -136,7 +135,7 @@ static int ax8817x_read_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index,
136 USB_CTRL_GET_TIMEOUT); 135 USB_CTRL_GET_TIMEOUT);
137} 136}
138 137
139static int ax8817x_write_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index, 138static int asix_write_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index,
140 u16 size, void *data) 139 u16 size, void *data)
141{ 140{
142 return usb_control_msg( 141 return usb_control_msg(
@@ -151,19 +150,80 @@ static int ax8817x_write_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index,
151 USB_CTRL_SET_TIMEOUT); 150 USB_CTRL_SET_TIMEOUT);
152} 151}
153 152
154static void ax8817x_async_cmd_callback(struct urb *urb, struct pt_regs *regs) 153static void asix_async_cmd_callback(struct urb *urb, struct pt_regs *regs)
155{ 154{
156 struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)urb->context; 155 struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)urb->context;
157 156
158 if (urb->status < 0) 157 if (urb->status < 0)
159 printk(KERN_DEBUG "ax8817x_async_cmd_callback() failed with %d", 158 printk(KERN_DEBUG "asix_async_cmd_callback() failed with %d",
160 urb->status); 159 urb->status);
161 160
162 kfree(req); 161 kfree(req);
163 usb_free_urb(urb); 162 usb_free_urb(urb);
164} 163}
165 164
166static void ax8817x_status(struct usbnet *dev, struct urb *urb) 165static inline int asix_set_sw_mii(struct usbnet *dev)
166{
167 int ret;
168 ret = asix_write_cmd(dev, AX_CMD_SET_SW_MII, 0x0000, 0, 0, NULL);
169 if (ret < 0)
170 devdbg(dev, "Failed to enable software MII access");
171 return ret;
172}
173
174static inline int asix_set_hw_mii(struct usbnet *dev)
175{
176 int ret;
177 ret = asix_write_cmd(dev, AX_CMD_SET_HW_MII, 0x0000, 0, 0, NULL);
178 if (ret < 0)
179 devdbg(dev, "Failed to enable hardware MII access");
180 return ret;
181}
182
183static inline int asix_get_phyid(struct usbnet *dev)
184{
185 int ret = 0;
186 void *buf;
187
188 buf = kmalloc(2, GFP_KERNEL);
189 if (!buf)
190 goto out1;
191
192 if ((ret = asix_read_cmd(dev, AX_CMD_READ_PHY_ID,
193 0, 0, 2, buf)) < 2) {
194 devdbg(dev, "Error reading PHYID register: %02x", ret);
195 goto out2;
196 }
197 ret = *((u8 *)buf + 1);
198out2:
199 kfree(buf);
200out1:
201 return ret;
202}
203
204static int asix_sw_reset(struct usbnet *dev, u8 flags)
205{
206 int ret;
207
208 ret = asix_write_cmd(dev, AX_CMD_SW_RESET, flags, 0, 0, NULL);
209 if (ret < 0)
210 devdbg(dev,"Failed to send software reset: %02x", ret);
211
212 return ret;
213}
214
215static int asix_write_rx_ctl(struct usbnet *dev, u16 mode)
216{
217 int ret;
218
219 ret = asix_write_cmd(dev, AX_CMD_WRITE_RX_CTL, mode, 0, 0, NULL);
220 if (ret < 0)
221 devdbg(dev, "Failed to write RX_CTL mode: %02x", ret);
222
223 return ret;
224}
225
226static void asix_status(struct usbnet *dev, struct urb *urb)
167{ 227{
168 struct ax88172_int_data *event; 228 struct ax88172_int_data *event;
169 int link; 229 int link;
@@ -179,12 +239,12 @@ static void ax8817x_status(struct usbnet *dev, struct urb *urb)
179 usbnet_defer_kevent (dev, EVENT_LINK_RESET ); 239 usbnet_defer_kevent (dev, EVENT_LINK_RESET );
180 } else 240 } else
181 netif_carrier_off(dev->net); 241 netif_carrier_off(dev->net);
182 devdbg(dev, "ax8817x - Link Status is: %d", link); 242 devdbg(dev, "Link Status is: %d", link);
183 } 243 }
184} 244}
185 245
186static void 246static void
187ax8817x_write_cmd_async(struct usbnet *dev, u8 cmd, u16 value, u16 index, 247asix_write_cmd_async(struct usbnet *dev, u8 cmd, u16 value, u16 index,
188 u16 size, void *data) 248 u16 size, void *data)
189{ 249{
190 struct usb_ctrlrequest *req; 250 struct usb_ctrlrequest *req;
@@ -211,7 +271,7 @@ ax8817x_write_cmd_async(struct usbnet *dev, u8 cmd, u16 value, u16 index,
211 usb_fill_control_urb(urb, dev->udev, 271 usb_fill_control_urb(urb, dev->udev,
212 usb_sndctrlpipe(dev->udev, 0), 272 usb_sndctrlpipe(dev->udev, 0),
213 (void *)req, data, size, 273 (void *)req, data, size,
214 ax8817x_async_cmd_callback, req); 274 asix_async_cmd_callback, req);
215 275
216 if((status = usb_submit_urb(urb, GFP_ATOMIC)) < 0) { 276 if((status = usb_submit_urb(urb, GFP_ATOMIC)) < 0) {
217 deverr(dev, "Error submitting the control message: status=%d", 277 deverr(dev, "Error submitting the control message: status=%d",
@@ -221,10 +281,10 @@ ax8817x_write_cmd_async(struct usbnet *dev, u8 cmd, u16 value, u16 index,
221 } 281 }
222} 282}
223 283
224static void ax8817x_set_multicast(struct net_device *net) 284static void asix_set_multicast(struct net_device *net)
225{ 285{
226 struct usbnet *dev = netdev_priv(net); 286 struct usbnet *dev = netdev_priv(net);
227 struct ax8817x_data *data = (struct ax8817x_data *)&dev->data; 287 struct asix_data *data = (struct asix_data *)&dev->data;
228 u8 rx_ctl = 0x8c; 288 u8 rx_ctl = 0x8c;
229 289
230 if (net->flags & IFF_PROMISC) { 290 if (net->flags & IFF_PROMISC) {
@@ -255,53 +315,51 @@ static void ax8817x_set_multicast(struct net_device *net)
255 mc_list = mc_list->next; 315 mc_list = mc_list->next;
256 } 316 }
257 317
258 ax8817x_write_cmd_async(dev, AX_CMD_WRITE_MULTI_FILTER, 0, 0, 318 asix_write_cmd_async(dev, AX_CMD_WRITE_MULTI_FILTER, 0, 0,
259 AX_MCAST_FILTER_SIZE, data->multi_filter); 319 AX_MCAST_FILTER_SIZE, data->multi_filter);
260 320
261 rx_ctl |= 0x10; 321 rx_ctl |= 0x10;
262 } 322 }
263 323
264 ax8817x_write_cmd_async(dev, AX_CMD_WRITE_RX_CTL, rx_ctl, 0, 0, NULL); 324 asix_write_cmd_async(dev, AX_CMD_WRITE_RX_CTL, rx_ctl, 0, 0, NULL);
265} 325}
266 326
267static int ax8817x_mdio_read(struct net_device *netdev, int phy_id, int loc) 327static int asix_mdio_read(struct net_device *netdev, int phy_id, int loc)
268{ 328{
269 struct usbnet *dev = netdev_priv(netdev); 329 struct usbnet *dev = netdev_priv(netdev);
270 u16 res; 330 u16 res;
271 u8 buf[1];
272 331
273 ax8817x_write_cmd(dev, AX_CMD_SET_SW_MII, 0, 0, 0, &buf); 332 asix_set_sw_mii(dev);
274 ax8817x_read_cmd(dev, AX_CMD_READ_MII_REG, phy_id, 333 asix_read_cmd(dev, AX_CMD_READ_MII_REG, phy_id,
275 (__u16)loc, 2, (u16 *)&res); 334 (__u16)loc, 2, (u16 *)&res);
276 ax8817x_write_cmd(dev, AX_CMD_SET_HW_MII, 0, 0, 0, &buf); 335 asix_set_hw_mii(dev);
277 336
278 return res & 0xffff; 337 return res & 0xffff;
279} 338}
280 339
281/* same as above, but converts resulting value to cpu byte order */ 340/* same as above, but converts resulting value to cpu byte order */
282static int ax8817x_mdio_read_le(struct net_device *netdev, int phy_id, int loc) 341static int asix_mdio_read_le(struct net_device *netdev, int phy_id, int loc)
283{ 342{
284 return le16_to_cpu(ax8817x_mdio_read(netdev,phy_id, loc)); 343 return le16_to_cpu(asix_mdio_read(netdev,phy_id, loc));
285} 344}
286 345
287static void 346static void
288ax8817x_mdio_write(struct net_device *netdev, int phy_id, int loc, int val) 347asix_mdio_write(struct net_device *netdev, int phy_id, int loc, int val)
289{ 348{
290 struct usbnet *dev = netdev_priv(netdev); 349 struct usbnet *dev = netdev_priv(netdev);
291 u16 res = val; 350 u16 res = val;
292 u8 buf[1];
293 351
294 ax8817x_write_cmd(dev, AX_CMD_SET_SW_MII, 0, 0, 0, &buf); 352 asix_set_sw_mii(dev);
295 ax8817x_write_cmd(dev, AX_CMD_WRITE_MII_REG, phy_id, 353 asix_write_cmd(dev, AX_CMD_WRITE_MII_REG, phy_id,
296 (__u16)loc, 2, (u16 *)&res); 354 (__u16)loc, 2, (u16 *)&res);
297 ax8817x_write_cmd(dev, AX_CMD_SET_HW_MII, 0, 0, 0, &buf); 355 asix_set_hw_mii(dev);
298} 356}
299 357
300/* same as above, but converts new value to le16 byte order before writing */ 358/* same as above, but converts new value to le16 byte order before writing */
301static void 359static void
302ax8817x_mdio_write_le(struct net_device *netdev, int phy_id, int loc, int val) 360asix_mdio_write_le(struct net_device *netdev, int phy_id, int loc, int val)
303{ 361{
304 ax8817x_mdio_write( netdev, phy_id, loc, cpu_to_le16(val) ); 362 asix_mdio_write( netdev, phy_id, loc, cpu_to_le16(val) );
305} 363}
306 364
307static int ax88172_link_reset(struct usbnet *dev) 365static int ax88172_link_reset(struct usbnet *dev)
@@ -312,23 +370,23 @@ static int ax88172_link_reset(struct usbnet *dev)
312 u8 mode; 370 u8 mode;
313 371
314 mode = AX_MEDIUM_TX_ABORT_ALLOW | AX_MEDIUM_FLOW_CONTROL_EN; 372 mode = AX_MEDIUM_TX_ABORT_ALLOW | AX_MEDIUM_FLOW_CONTROL_EN;
315 lpa = ax8817x_mdio_read_le(dev->net, dev->mii.phy_id, MII_LPA); 373 lpa = asix_mdio_read_le(dev->net, dev->mii.phy_id, MII_LPA);
316 adv = ax8817x_mdio_read_le(dev->net, dev->mii.phy_id, MII_ADVERTISE); 374 adv = asix_mdio_read_le(dev->net, dev->mii.phy_id, MII_ADVERTISE);
317 res = mii_nway_result(lpa|adv); 375 res = mii_nway_result(lpa|adv);
318 if (res & LPA_DUPLEX) 376 if (res & LPA_DUPLEX)
319 mode |= AX_MEDIUM_FULL_DUPLEX; 377 mode |= AX_MEDIUM_FULL_DUPLEX;
320 ax8817x_write_cmd(dev, AX_CMD_WRITE_MEDIUM_MODE, mode, 0, 0, NULL); 378 asix_write_cmd(dev, AX_CMD_WRITE_MEDIUM_MODE, mode, 0, 0, NULL);
321 379
322 return 0; 380 return 0;
323} 381}
324 382
325static void 383static void
326ax8817x_get_wol(struct net_device *net, struct ethtool_wolinfo *wolinfo) 384asix_get_wol(struct net_device *net, struct ethtool_wolinfo *wolinfo)
327{ 385{
328 struct usbnet *dev = netdev_priv(net); 386 struct usbnet *dev = netdev_priv(net);
329 u8 opt; 387 u8 opt;
330 388
331 if (ax8817x_read_cmd(dev, AX_CMD_READ_MONITOR_MODE, 0, 0, 1, &opt) < 0) { 389 if (asix_read_cmd(dev, AX_CMD_READ_MONITOR_MODE, 0, 0, 1, &opt) < 0) {
332 wolinfo->supported = 0; 390 wolinfo->supported = 0;
333 wolinfo->wolopts = 0; 391 wolinfo->wolopts = 0;
334 return; 392 return;
@@ -344,7 +402,7 @@ ax8817x_get_wol(struct net_device *net, struct ethtool_wolinfo *wolinfo)
344} 402}
345 403
346static int 404static int
347ax8817x_set_wol(struct net_device *net, struct ethtool_wolinfo *wolinfo) 405asix_set_wol(struct net_device *net, struct ethtool_wolinfo *wolinfo)
348{ 406{
349 struct usbnet *dev = netdev_priv(net); 407 struct usbnet *dev = netdev_priv(net);
350 u8 opt = 0; 408 u8 opt = 0;
@@ -357,19 +415,19 @@ ax8817x_set_wol(struct net_device *net, struct ethtool_wolinfo *wolinfo)
357 if (opt != 0) 415 if (opt != 0)
358 opt |= AX_MONITOR_MODE; 416 opt |= AX_MONITOR_MODE;
359 417
360 if (ax8817x_write_cmd(dev, AX_CMD_WRITE_MONITOR_MODE, 418 if (asix_write_cmd(dev, AX_CMD_WRITE_MONITOR_MODE,
361 opt, 0, 0, &buf) < 0) 419 opt, 0, 0, &buf) < 0)
362 return -EINVAL; 420 return -EINVAL;
363 421
364 return 0; 422 return 0;
365} 423}
366 424
367static int ax8817x_get_eeprom_len(struct net_device *net) 425static int asix_get_eeprom_len(struct net_device *net)
368{ 426{
369 return AX_EEPROM_LEN; 427 return AX_EEPROM_LEN;
370} 428}
371 429
372static int ax8817x_get_eeprom(struct net_device *net, 430static int asix_get_eeprom(struct net_device *net,
373 struct ethtool_eeprom *eeprom, u8 *data) 431 struct ethtool_eeprom *eeprom, u8 *data)
374{ 432{
375 struct usbnet *dev = netdev_priv(net); 433 struct usbnet *dev = netdev_priv(net);
@@ -386,14 +444,14 @@ static int ax8817x_get_eeprom(struct net_device *net,
386 444
387 /* ax8817x returns 2 bytes from eeprom on read */ 445 /* ax8817x returns 2 bytes from eeprom on read */
388 for (i=0; i < eeprom->len / 2; i++) { 446 for (i=0; i < eeprom->len / 2; i++) {
389 if (ax8817x_read_cmd(dev, AX_CMD_READ_EEPROM, 447 if (asix_read_cmd(dev, AX_CMD_READ_EEPROM,
390 eeprom->offset + i, 0, 2, &ebuf[i]) < 0) 448 eeprom->offset + i, 0, 2, &ebuf[i]) < 0)
391 return -EINVAL; 449 return -EINVAL;
392 } 450 }
393 return 0; 451 return 0;
394} 452}
395 453
396static void ax8817x_get_drvinfo (struct net_device *net, 454static void asix_get_drvinfo (struct net_device *net,
397 struct ethtool_drvinfo *info) 455 struct ethtool_drvinfo *info)
398{ 456{
399 /* Inherit standard device info */ 457 /* Inherit standard device info */
@@ -401,14 +459,14 @@ static void ax8817x_get_drvinfo (struct net_device *net,
401 info->eedump_len = 0x3e; 459 info->eedump_len = 0x3e;
402} 460}
403 461
404static int ax8817x_get_settings(struct net_device *net, struct ethtool_cmd *cmd) 462static int asix_get_settings(struct net_device *net, struct ethtool_cmd *cmd)
405{ 463{
406 struct usbnet *dev = netdev_priv(net); 464 struct usbnet *dev = netdev_priv(net);
407 465
408 return mii_ethtool_gset(&dev->mii,cmd); 466 return mii_ethtool_gset(&dev->mii,cmd);
409} 467}
410 468
411static int ax8817x_set_settings(struct net_device *net, struct ethtool_cmd *cmd) 469static int asix_set_settings(struct net_device *net, struct ethtool_cmd *cmd)
412{ 470{
413 struct usbnet *dev = netdev_priv(net); 471 struct usbnet *dev = netdev_priv(net);
414 472
@@ -418,27 +476,27 @@ static int ax8817x_set_settings(struct net_device *net, struct ethtool_cmd *cmd)
418/* We need to override some ethtool_ops so we require our 476/* We need to override some ethtool_ops so we require our
419 own structure so we don't interfere with other usbnet 477 own structure so we don't interfere with other usbnet
420 devices that may be connected at the same time. */ 478 devices that may be connected at the same time. */
421static struct ethtool_ops ax8817x_ethtool_ops = { 479static struct ethtool_ops ax88172_ethtool_ops = {
422 .get_drvinfo = ax8817x_get_drvinfo, 480 .get_drvinfo = asix_get_drvinfo,
423 .get_link = ethtool_op_get_link, 481 .get_link = ethtool_op_get_link,
424 .get_msglevel = usbnet_get_msglevel, 482 .get_msglevel = usbnet_get_msglevel,
425 .set_msglevel = usbnet_set_msglevel, 483 .set_msglevel = usbnet_set_msglevel,
426 .get_wol = ax8817x_get_wol, 484 .get_wol = asix_get_wol,
427 .set_wol = ax8817x_set_wol, 485 .set_wol = asix_set_wol,
428 .get_eeprom_len = ax8817x_get_eeprom_len, 486 .get_eeprom_len = asix_get_eeprom_len,
429 .get_eeprom = ax8817x_get_eeprom, 487 .get_eeprom = asix_get_eeprom,
430 .get_settings = ax8817x_get_settings, 488 .get_settings = asix_get_settings,
431 .set_settings = ax8817x_set_settings, 489 .set_settings = asix_set_settings,
432}; 490};
433 491
434static int ax8817x_ioctl (struct net_device *net, struct ifreq *rq, int cmd) 492static int asix_ioctl (struct net_device *net, struct ifreq *rq, int cmd)
435{ 493{
436 struct usbnet *dev = netdev_priv(net); 494 struct usbnet *dev = netdev_priv(net);
437 495
438 return generic_mii_ioctl(&dev->mii, if_mii(rq), cmd, NULL); 496 return generic_mii_ioctl(&dev->mii, if_mii(rq), cmd, NULL);
439} 497}
440 498
441static int ax8817x_bind(struct usbnet *dev, struct usb_interface *intf) 499static int ax88172_bind(struct usbnet *dev, struct usb_interface *intf)
442{ 500{
443 int ret = 0; 501 int ret = 0;
444 void *buf; 502 void *buf;
@@ -455,55 +513,39 @@ static int ax8817x_bind(struct usbnet *dev, struct usb_interface *intf)
455 513
456 /* Toggle the GPIOs in a manufacturer/model specific way */ 514 /* Toggle the GPIOs in a manufacturer/model specific way */
457 for (i = 2; i >= 0; i--) { 515 for (i = 2; i >= 0; i--) {
458 if ((ret = ax8817x_write_cmd(dev, AX_CMD_WRITE_GPIOS, 516 if ((ret = asix_write_cmd(dev, AX_CMD_WRITE_GPIOS,
459 (gpio_bits >> (i * 8)) & 0xff, 0, 0, 517 (gpio_bits >> (i * 8)) & 0xff, 0, 0,
460 buf)) < 0) 518 buf)) < 0)
461 goto out2; 519 goto out2;
462 msleep(5); 520 msleep(5);
463 } 521 }
464 522
465 if ((ret = ax8817x_write_cmd(dev, AX_CMD_WRITE_RX_CTL, 523 if ((ret = asix_write_rx_ctl(dev,0x80)) < 0)
466 0x80, 0, 0, buf)) < 0) {
467 dbg("send AX_CMD_WRITE_RX_CTL failed: %d", ret);
468 goto out2; 524 goto out2;
469 }
470 525
471 /* Get the MAC address */ 526 /* Get the MAC address */
472 memset(buf, 0, ETH_ALEN); 527 memset(buf, 0, ETH_ALEN);
473 if ((ret = ax8817x_read_cmd(dev, AX_CMD_READ_NODE_ID, 528 if ((ret = asix_read_cmd(dev, AX_CMD_READ_NODE_ID,
474 0, 0, 6, buf)) < 0) { 529 0, 0, 6, buf)) < 0) {
475 dbg("read AX_CMD_READ_NODE_ID failed: %d", ret); 530 dbg("read AX_CMD_READ_NODE_ID failed: %d", ret);
476 goto out2; 531 goto out2;
477 } 532 }
478 memcpy(dev->net->dev_addr, buf, ETH_ALEN); 533 memcpy(dev->net->dev_addr, buf, ETH_ALEN);
479 534
480 /* Get the PHY id */
481 if ((ret = ax8817x_read_cmd(dev, AX_CMD_READ_PHY_ID,
482 0, 0, 2, buf)) < 0) {
483 dbg("error on read AX_CMD_READ_PHY_ID: %02x", ret);
484 goto out2;
485 } else if (ret < 2) {
486 /* this should always return 2 bytes */
487 dbg("AX_CMD_READ_PHY_ID returned less than 2 bytes: ret=%02x",
488 ret);
489 ret = -EIO;
490 goto out2;
491 }
492
493 /* Initialize MII structure */ 535 /* Initialize MII structure */
494 dev->mii.dev = dev->net; 536 dev->mii.dev = dev->net;
495 dev->mii.mdio_read = ax8817x_mdio_read; 537 dev->mii.mdio_read = asix_mdio_read;
496 dev->mii.mdio_write = ax8817x_mdio_write; 538 dev->mii.mdio_write = asix_mdio_write;
497 dev->mii.phy_id_mask = 0x3f; 539 dev->mii.phy_id_mask = 0x3f;
498 dev->mii.reg_num_mask = 0x1f; 540 dev->mii.reg_num_mask = 0x1f;
499 dev->mii.phy_id = *((u8 *)buf + 1); 541 dev->mii.phy_id = asix_get_phyid(dev);
500 dev->net->do_ioctl = ax8817x_ioctl; 542 dev->net->do_ioctl = asix_ioctl;
501 543
502 dev->net->set_multicast_list = ax8817x_set_multicast; 544 dev->net->set_multicast_list = asix_set_multicast;
503 dev->net->ethtool_ops = &ax8817x_ethtool_ops; 545 dev->net->ethtool_ops = &ax88172_ethtool_ops;
504 546
505 ax8817x_mdio_write_le(dev->net, dev->mii.phy_id, MII_BMCR, BMCR_RESET); 547 asix_mdio_write_le(dev->net, dev->mii.phy_id, MII_BMCR, BMCR_RESET);
506 ax8817x_mdio_write_le(dev->net, dev->mii.phy_id, MII_ADVERTISE, 548 asix_mdio_write_le(dev->net, dev->mii.phy_id, MII_ADVERTISE,
507 ADVERTISE_ALL | ADVERTISE_CSMA | ADVERTISE_PAUSE_CAP); 549 ADVERTISE_ALL | ADVERTISE_CSMA | ADVERTISE_PAUSE_CAP);
508 mii_nway_restart(&dev->mii); 550 mii_nway_restart(&dev->mii);
509 551
@@ -515,16 +557,16 @@ out1:
515} 557}
516 558
517static struct ethtool_ops ax88772_ethtool_ops = { 559static struct ethtool_ops ax88772_ethtool_ops = {
518 .get_drvinfo = ax8817x_get_drvinfo, 560 .get_drvinfo = asix_get_drvinfo,
519 .get_link = ethtool_op_get_link, 561 .get_link = ethtool_op_get_link,
520 .get_msglevel = usbnet_get_msglevel, 562 .get_msglevel = usbnet_get_msglevel,
521 .set_msglevel = usbnet_set_msglevel, 563 .set_msglevel = usbnet_set_msglevel,
522 .get_wol = ax8817x_get_wol, 564 .get_wol = asix_get_wol,
523 .set_wol = ax8817x_set_wol, 565 .set_wol = asix_set_wol,
524 .get_eeprom_len = ax8817x_get_eeprom_len, 566 .get_eeprom_len = asix_get_eeprom_len,
525 .get_eeprom = ax8817x_get_eeprom, 567 .get_eeprom = asix_get_eeprom,
526 .get_settings = ax8817x_get_settings, 568 .get_settings = asix_get_settings,
527 .set_settings = ax8817x_set_settings, 569 .set_settings = asix_set_settings,
528}; 570};
529 571
530static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf) 572static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf)
@@ -541,62 +583,45 @@ static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf)
541 goto out1; 583 goto out1;
542 } 584 }
543 585
544 if ((ret = ax8817x_write_cmd(dev, AX_CMD_WRITE_GPIOS, 586 if ((ret = asix_write_cmd(dev, AX_CMD_WRITE_GPIOS,
545 0x00B0, 0, 0, buf)) < 0) 587 0x00B0, 0, 0, buf)) < 0)
546 goto out2; 588 goto out2;
547 589
548 msleep(5); 590 msleep(5);
549 if ((ret = ax8817x_write_cmd(dev, AX_CMD_SW_PHY_SELECT, 591 if ((ret = asix_write_cmd(dev, AX_CMD_SW_PHY_SELECT,
550 0x0001, 0, 0, buf)) < 0) { 592 0x0001, 0, 0, buf)) < 0) {
551 dbg("Select PHY #1 failed: %d", ret); 593 dbg("Select PHY #1 failed: %d", ret);
552 goto out2; 594 goto out2;
553 } 595 }
554 596
555 if ((ret = ax8817x_write_cmd(dev, AX_CMD_SW_RESET, AX_SWRESET_IPPD, 597 if ((ret = asix_sw_reset(dev, AX_SWRESET_IPPD)) < 0)
556 0, 0, buf)) < 0) {
557 dbg("Failed to power down internal PHY: %d", ret);
558 goto out2; 598 goto out2;
559 }
560 599
561 msleep(150); 600 msleep(150);
562 if ((ret = ax8817x_write_cmd(dev, AX_CMD_SW_RESET, AX_SWRESET_CLEAR, 601 if ((ret = asix_sw_reset(dev, AX_SWRESET_CLEAR)) < 0)
563 0, 0, buf)) < 0) {
564 dbg("Failed to perform software reset: %d", ret);
565 goto out2; 602 goto out2;
566 }
567 603
568 msleep(150); 604 msleep(150);
569 if ((ret = ax8817x_write_cmd(dev, AX_CMD_SW_RESET, 605 if ((ret = asix_sw_reset(dev, AX_SWRESET_IPRL | AX_SWRESET_PRL)) < 0)
570 AX_SWRESET_IPRL | AX_SWRESET_PRL,
571 0, 0, buf)) < 0) {
572 dbg("Failed to set Internal/External PHY reset control: %d",
573 ret);
574 goto out2; 606 goto out2;
575 }
576 607
577 msleep(150); 608 msleep(150);
578 if ((ret = ax8817x_write_cmd(dev, AX_CMD_WRITE_RX_CTL, 609 if ((ret = asix_write_rx_ctl(dev, 0x00)) < 0)
579 0x0000, 0, 0, buf)) < 0) {
580 dbg("Failed to reset RX_CTL: %d", ret);
581 goto out2; 610 goto out2;
582 }
583 611
584 /* Get the MAC address */ 612 /* Get the MAC address */
585 memset(buf, 0, ETH_ALEN); 613 memset(buf, 0, ETH_ALEN);
586 if ((ret = ax8817x_read_cmd(dev, AX88772_CMD_READ_NODE_ID, 614 if ((ret = asix_read_cmd(dev, AX88772_CMD_READ_NODE_ID,
587 0, 0, ETH_ALEN, buf)) < 0) { 615 0, 0, ETH_ALEN, buf)) < 0) {
588 dbg("Failed to read MAC address: %d", ret); 616 dbg("Failed to read MAC address: %d", ret);
589 goto out2; 617 goto out2;
590 } 618 }
591 memcpy(dev->net->dev_addr, buf, ETH_ALEN); 619 memcpy(dev->net->dev_addr, buf, ETH_ALEN);
592 620
593 if ((ret = ax8817x_write_cmd(dev, AX_CMD_SET_SW_MII, 621 if ((ret = asix_set_sw_mii(dev)) < 0)
594 0, 0, 0, buf)) < 0) {
595 dbg("Enabling software MII failed: %d", ret);
596 goto out2; 622 goto out2;
597 }
598 623
599 if (((ret = ax8817x_read_cmd(dev, AX_CMD_READ_MII_REG, 624 if (((ret = asix_read_cmd(dev, AX_CMD_READ_MII_REG,
600 0x0010, 2, 2, buf)) < 0) 625 0x0010, 2, 2, buf)) < 0)
601 || (*((u16 *)buf) != 0x003b)) { 626 || (*((u16 *)buf) != 0x003b)) {
602 dbg("Read PHY register 2 must be 0x3b00: %d", ret); 627 dbg("Read PHY register 2 must be 0x3b00: %d", ret);
@@ -605,74 +630,49 @@ static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf)
605 630
606 /* Initialize MII structure */ 631 /* Initialize MII structure */
607 dev->mii.dev = dev->net; 632 dev->mii.dev = dev->net;
608 dev->mii.mdio_read = ax8817x_mdio_read; 633 dev->mii.mdio_read = asix_mdio_read;
609 dev->mii.mdio_write = ax8817x_mdio_write; 634 dev->mii.mdio_write = asix_mdio_write;
610 dev->mii.phy_id_mask = 0xff; 635 dev->mii.phy_id_mask = 0xff;
611 dev->mii.reg_num_mask = 0xff; 636 dev->mii.reg_num_mask = 0xff;
612 dev->net->do_ioctl = ax8817x_ioctl; 637 dev->net->do_ioctl = asix_ioctl;
638 dev->mii.phy_id = asix_get_phyid(dev);
613 639
614 /* Get the PHY id */ 640 if ((ret = asix_sw_reset(dev, AX_SWRESET_PRL)) < 0)
615 if ((ret = ax8817x_read_cmd(dev, AX_CMD_READ_PHY_ID,
616 0, 0, 2, buf)) < 0) {
617 dbg("Error reading PHY ID: %02x", ret);
618 goto out2; 641 goto out2;
619 } else if (ret < 2) {
620 /* this should always return 2 bytes */
621 dbg("AX_CMD_READ_PHY_ID returned less than 2 bytes: ret=%02x",
622 ret);
623 ret = -EIO;
624 goto out2;
625 }
626 dev->mii.phy_id = *((u8 *)buf + 1);
627 642
628 if ((ret = ax8817x_write_cmd(dev, AX_CMD_SW_RESET, AX_SWRESET_PRL,
629 0, 0, buf)) < 0) {
630 dbg("Set external PHY reset pin level: %d", ret);
631 goto out2;
632 }
633 msleep(150); 643 msleep(150);
634 if ((ret = ax8817x_write_cmd(dev, AX_CMD_SW_RESET, 644
635 AX_SWRESET_IPRL | AX_SWRESET_PRL, 645 if ((ret = asix_sw_reset(dev, AX_SWRESET_IPRL | AX_SWRESET_PRL)) < 0)
636 0, 0, buf)) < 0) {
637 dbg("Set Internal/External PHY reset control: %d", ret);
638 goto out2; 646 goto out2;
639 }
640 msleep(150);
641 647
648 msleep(150);
642 649
643 dev->net->set_multicast_list = ax8817x_set_multicast; 650 dev->net->set_multicast_list = asix_set_multicast;
644 dev->net->ethtool_ops = &ax88772_ethtool_ops; 651 dev->net->ethtool_ops = &ax88772_ethtool_ops;
645 652
646 ax8817x_mdio_write_le(dev->net, dev->mii.phy_id, MII_BMCR, BMCR_RESET); 653 asix_mdio_write_le(dev->net, dev->mii.phy_id, MII_BMCR, BMCR_RESET);
647 ax8817x_mdio_write_le(dev->net, dev->mii.phy_id, MII_ADVERTISE, 654 asix_mdio_write_le(dev->net, dev->mii.phy_id, MII_ADVERTISE,
648 ADVERTISE_ALL | ADVERTISE_CSMA); 655 ADVERTISE_ALL | ADVERTISE_CSMA);
649 mii_nway_restart(&dev->mii); 656 mii_nway_restart(&dev->mii);
650 657
651 if ((ret = ax8817x_write_cmd(dev, AX_CMD_WRITE_MEDIUM_MODE, 658 if ((ret = asix_write_cmd(dev, AX_CMD_WRITE_MEDIUM_MODE,
652 AX88772_MEDIUM_DEFAULT, 0, 0, buf)) < 0) { 659 AX88772_MEDIUM_DEFAULT, 0, 0, buf)) < 0) {
653 dbg("Write medium mode register: %d", ret); 660 dbg("Write medium mode register: %d", ret);
654 goto out2; 661 goto out2;
655 } 662 }
656 663
657 if ((ret = ax8817x_write_cmd(dev, AX_CMD_WRITE_IPG0, 664 if ((ret = asix_write_cmd(dev, AX_CMD_WRITE_IPG0,
658 AX88772_IPG0_DEFAULT | AX88772_IPG1_DEFAULT, 665 AX88772_IPG0_DEFAULT | AX88772_IPG1_DEFAULT,
659 AX88772_IPG2_DEFAULT, 0, buf)) < 0) { 666 AX88772_IPG2_DEFAULT, 0, buf)) < 0) {
660 dbg("Write IPG,IPG1,IPG2 failed: %d", ret); 667 dbg("Write IPG,IPG1,IPG2 failed: %d", ret);
661 goto out2; 668 goto out2;
662 } 669 }
663 if ((ret = 670 if ((ret = asix_set_hw_mii(dev)) < 0)
664 ax8817x_write_cmd(dev, AX_CMD_SET_HW_MII, 0, 0, 0, &buf)) < 0) {
665 dbg("Failed to set hardware MII: %02x", ret);
666 goto out2; 671 goto out2;
667 }
668 672
669 /* Set RX_CTL to default values with 2k buffer, and enable cactus */ 673 /* Set RX_CTL to default values with 2k buffer, and enable cactus */
670 if ((ret = 674 if ((ret = asix_write_rx_ctl(dev, 0x0088)) < 0)
671 ax8817x_write_cmd(dev, AX_CMD_WRITE_RX_CTL, 0x0088, 0, 0,
672 buf)) < 0) {
673 dbg("Reset RX_CTL failed: %d", ret);
674 goto out2; 675 goto out2;
675 }
676 676
677 kfree(buf); 677 kfree(buf);
678 678
@@ -794,23 +794,23 @@ static int ax88772_link_reset(struct usbnet *dev)
794 u16 mode; 794 u16 mode;
795 795
796 mode = AX88772_MEDIUM_DEFAULT; 796 mode = AX88772_MEDIUM_DEFAULT;
797 lpa = ax8817x_mdio_read_le(dev->net, dev->mii.phy_id, MII_LPA); 797 lpa = asix_mdio_read_le(dev->net, dev->mii.phy_id, MII_LPA);
798 adv = ax8817x_mdio_read_le(dev->net, dev->mii.phy_id, MII_ADVERTISE); 798 adv = asix_mdio_read_le(dev->net, dev->mii.phy_id, MII_ADVERTISE);
799 res = mii_nway_result(lpa|adv); 799 res = mii_nway_result(lpa|adv);
800 800
801 if ((res & LPA_DUPLEX) == 0) 801 if ((res & LPA_DUPLEX) == 0)
802 mode &= ~AX88772_MEDIUM_FULL_DUPLEX; 802 mode &= ~AX88772_MEDIUM_FULL_DUPLEX;
803 if ((res & LPA_100) == 0) 803 if ((res & LPA_100) == 0)
804 mode &= ~AX88772_MEDIUM_100MB; 804 mode &= ~AX88772_MEDIUM_100MB;
805 ax8817x_write_cmd(dev, AX_CMD_WRITE_MEDIUM_MODE, mode, 0, 0, NULL); 805 asix_write_cmd(dev, AX_CMD_WRITE_MEDIUM_MODE, mode, 0, 0, NULL);
806 806
807 return 0; 807 return 0;
808} 808}
809 809
810static const struct driver_info ax8817x_info = { 810static const struct driver_info ax8817x_info = {
811 .description = "ASIX AX8817x USB 2.0 Ethernet", 811 .description = "ASIX AX8817x USB 2.0 Ethernet",
812 .bind = ax8817x_bind, 812 .bind = ax88172_bind,
813 .status = ax8817x_status, 813 .status = asix_status,
814 .link_reset = ax88172_link_reset, 814 .link_reset = ax88172_link_reset,
815 .reset = ax88172_link_reset, 815 .reset = ax88172_link_reset,
816 .flags = FLAG_ETHER, 816 .flags = FLAG_ETHER,
@@ -819,8 +819,8 @@ static const struct driver_info ax8817x_info = {
819 819
820static const struct driver_info dlink_dub_e100_info = { 820static const struct driver_info dlink_dub_e100_info = {
821 .description = "DLink DUB-E100 USB Ethernet", 821 .description = "DLink DUB-E100 USB Ethernet",
822 .bind = ax8817x_bind, 822 .bind = ax88172_bind,
823 .status = ax8817x_status, 823 .status = asix_status,
824 .link_reset = ax88172_link_reset, 824 .link_reset = ax88172_link_reset,
825 .reset = ax88172_link_reset, 825 .reset = ax88172_link_reset,
826 .flags = FLAG_ETHER, 826 .flags = FLAG_ETHER,
@@ -829,8 +829,8 @@ static const struct driver_info dlink_dub_e100_info = {
829 829
830static const struct driver_info netgear_fa120_info = { 830static const struct driver_info netgear_fa120_info = {
831 .description = "Netgear FA-120 USB Ethernet", 831 .description = "Netgear FA-120 USB Ethernet",
832 .bind = ax8817x_bind, 832 .bind = ax88172_bind,
833 .status = ax8817x_status, 833 .status = asix_status,
834 .link_reset = ax88172_link_reset, 834 .link_reset = ax88172_link_reset,
835 .reset = ax88172_link_reset, 835 .reset = ax88172_link_reset,
836 .flags = FLAG_ETHER, 836 .flags = FLAG_ETHER,
@@ -839,8 +839,8 @@ static const struct driver_info netgear_fa120_info = {
839 839
840static const struct driver_info hawking_uf200_info = { 840static const struct driver_info hawking_uf200_info = {
841 .description = "Hawking UF200 USB Ethernet", 841 .description = "Hawking UF200 USB Ethernet",
842 .bind = ax8817x_bind, 842 .bind = ax88172_bind,
843 .status = ax8817x_status, 843 .status = asix_status,
844 .link_reset = ax88172_link_reset, 844 .link_reset = ax88172_link_reset,
845 .reset = ax88172_link_reset, 845 .reset = ax88172_link_reset,
846 .flags = FLAG_ETHER, 846 .flags = FLAG_ETHER,
@@ -850,13 +850,12 @@ static const struct driver_info hawking_uf200_info = {
850static const struct driver_info ax88772_info = { 850static const struct driver_info ax88772_info = {
851 .description = "ASIX AX88772 USB 2.0 Ethernet", 851 .description = "ASIX AX88772 USB 2.0 Ethernet",
852 .bind = ax88772_bind, 852 .bind = ax88772_bind,
853 .status = ax8817x_status, 853 .status = asix_status,
854 .link_reset = ax88772_link_reset, 854 .link_reset = ax88772_link_reset,
855 .reset = ax88772_link_reset, 855 .reset = ax88772_link_reset,
856 .flags = FLAG_ETHER | FLAG_FRAMING_AX, 856 .flags = FLAG_ETHER | FLAG_FRAMING_AX,
857 .rx_fixup = ax88772_rx_fixup, 857 .rx_fixup = ax88772_rx_fixup,
858 .tx_fixup = ax88772_tx_fixup, 858 .tx_fixup = ax88772_tx_fixup,
859 .data = 0x00130103,
860}; 859};
861 860
862static const struct usb_device_id products [] = { 861static const struct usb_device_id products [] = {
diff --git a/drivers/usb/net/pegasus.c b/drivers/usb/net/pegasus.c
index 5b6675684567..7683926a1b6f 100644
--- a/drivers/usb/net/pegasus.c
+++ b/drivers/usb/net/pegasus.c
@@ -262,7 +262,7 @@ static int set_register(pegasus_t * pegasus, __u16 indx, __u8 data)
262 usb_fill_control_urb(pegasus->ctrl_urb, pegasus->usb, 262 usb_fill_control_urb(pegasus->ctrl_urb, pegasus->usb,
263 usb_sndctrlpipe(pegasus->usb, 0), 263 usb_sndctrlpipe(pegasus->usb, 0),
264 (char *) &pegasus->dr, 264 (char *) &pegasus->dr,
265 &tmp, 1, ctrl_callback, pegasus); 265 tmp, 1, ctrl_callback, pegasus);
266 266
267 add_wait_queue(&pegasus->ctrl_wait, &wait); 267 add_wait_queue(&pegasus->ctrl_wait, &wait);
268 set_current_state(TASK_UNINTERRUPTIBLE); 268 set_current_state(TASK_UNINTERRUPTIBLE);
@@ -318,6 +318,8 @@ static int read_mii_word(pegasus_t * pegasus, __u8 phy, __u8 indx, __u16 * regd)
318 set_register(pegasus, PhyCtrl, (indx | PHY_READ)); 318 set_register(pegasus, PhyCtrl, (indx | PHY_READ));
319 for (i = 0; i < REG_TIMEOUT; i++) { 319 for (i = 0; i < REG_TIMEOUT; i++) {
320 ret = get_registers(pegasus, PhyCtrl, 1, data); 320 ret = get_registers(pegasus, PhyCtrl, 1, data);
321 if (ret == -ESHUTDOWN)
322 goto fail;
321 if (data[0] & PHY_DONE) 323 if (data[0] & PHY_DONE)
322 break; 324 break;
323 } 325 }
@@ -326,6 +328,7 @@ static int read_mii_word(pegasus_t * pegasus, __u8 phy, __u8 indx, __u16 * regd)
326 *regd = le16_to_cpu(regdi); 328 *regd = le16_to_cpu(regdi);
327 return ret; 329 return ret;
328 } 330 }
331fail:
329 if (netif_msg_drv(pegasus)) 332 if (netif_msg_drv(pegasus))
330 dev_warn(&pegasus->intf->dev, "fail %s\n", __FUNCTION__); 333 dev_warn(&pegasus->intf->dev, "fail %s\n", __FUNCTION__);
331 334
@@ -354,12 +357,15 @@ static int write_mii_word(pegasus_t * pegasus, __u8 phy, __u8 indx, __u16 regd)
354 set_register(pegasus, PhyCtrl, (indx | PHY_WRITE)); 357 set_register(pegasus, PhyCtrl, (indx | PHY_WRITE));
355 for (i = 0; i < REG_TIMEOUT; i++) { 358 for (i = 0; i < REG_TIMEOUT; i++) {
356 ret = get_registers(pegasus, PhyCtrl, 1, data); 359 ret = get_registers(pegasus, PhyCtrl, 1, data);
360 if (ret == -ESHUTDOWN)
361 goto fail;
357 if (data[0] & PHY_DONE) 362 if (data[0] & PHY_DONE)
358 break; 363 break;
359 } 364 }
360 if (i < REG_TIMEOUT) 365 if (i < REG_TIMEOUT)
361 return ret; 366 return ret;
362 367
368fail:
363 if (netif_msg_drv(pegasus)) 369 if (netif_msg_drv(pegasus))
364 dev_warn(&pegasus->intf->dev, "fail %s\n", __FUNCTION__); 370 dev_warn(&pegasus->intf->dev, "fail %s\n", __FUNCTION__);
365 return -ETIMEDOUT; 371 return -ETIMEDOUT;
@@ -387,6 +393,8 @@ static int read_eprom_word(pegasus_t * pegasus, __u8 index, __u16 * retdata)
387 ret = get_registers(pegasus, EpromCtrl, 1, &tmp); 393 ret = get_registers(pegasus, EpromCtrl, 1, &tmp);
388 if (tmp & EPROM_DONE) 394 if (tmp & EPROM_DONE)
389 break; 395 break;
396 if (ret == -ESHUTDOWN)
397 goto fail;
390 } 398 }
391 if (i < REG_TIMEOUT) { 399 if (i < REG_TIMEOUT) {
392 ret = get_registers(pegasus, EpromData, 2, &retdatai); 400 ret = get_registers(pegasus, EpromData, 2, &retdatai);
@@ -394,6 +402,7 @@ static int read_eprom_word(pegasus_t * pegasus, __u8 index, __u16 * retdata)
394 return ret; 402 return ret;
395 } 403 }
396 404
405fail:
397 if (netif_msg_drv(pegasus)) 406 if (netif_msg_drv(pegasus))
398 dev_warn(&pegasus->intf->dev, "fail %s\n", __FUNCTION__); 407 dev_warn(&pegasus->intf->dev, "fail %s\n", __FUNCTION__);
399 return -ETIMEDOUT; 408 return -ETIMEDOUT;
@@ -433,12 +442,15 @@ static int write_eprom_word(pegasus_t * pegasus, __u8 index, __u16 data)
433 442
434 for (i = 0; i < REG_TIMEOUT; i++) { 443 for (i = 0; i < REG_TIMEOUT; i++) {
435 ret = get_registers(pegasus, EpromCtrl, 1, &tmp); 444 ret = get_registers(pegasus, EpromCtrl, 1, &tmp);
445 if (ret == -ESHUTDOWN)
446 goto fail;
436 if (tmp & EPROM_DONE) 447 if (tmp & EPROM_DONE)
437 break; 448 break;
438 } 449 }
439 disable_eprom_write(pegasus); 450 disable_eprom_write(pegasus);
440 if (i < REG_TIMEOUT) 451 if (i < REG_TIMEOUT)
441 return ret; 452 return ret;
453fail:
442 if (netif_msg_drv(pegasus)) 454 if (netif_msg_drv(pegasus))
443 dev_warn(&pegasus->intf->dev, "fail %s\n", __FUNCTION__); 455 dev_warn(&pegasus->intf->dev, "fail %s\n", __FUNCTION__);
444 return -ETIMEDOUT; 456 return -ETIMEDOUT;
@@ -1378,9 +1390,8 @@ static int pegasus_suspend (struct usb_interface *intf, pm_message_t message)
1378 struct pegasus *pegasus = usb_get_intfdata(intf); 1390 struct pegasus *pegasus = usb_get_intfdata(intf);
1379 1391
1380 netif_device_detach (pegasus->net); 1392 netif_device_detach (pegasus->net);
1393 cancel_delayed_work(&pegasus->carrier_check);
1381 if (netif_running(pegasus->net)) { 1394 if (netif_running(pegasus->net)) {
1382 cancel_delayed_work(&pegasus->carrier_check);
1383
1384 usb_kill_urb(pegasus->rx_urb); 1395 usb_kill_urb(pegasus->rx_urb);
1385 usb_kill_urb(pegasus->intr_urb); 1396 usb_kill_urb(pegasus->intr_urb);
1386 } 1397 }
@@ -1400,10 +1411,9 @@ static int pegasus_resume (struct usb_interface *intf)
1400 pegasus->intr_urb->status = 0; 1411 pegasus->intr_urb->status = 0;
1401 pegasus->intr_urb->actual_length = 0; 1412 pegasus->intr_urb->actual_length = 0;
1402 intr_callback(pegasus->intr_urb, NULL); 1413 intr_callback(pegasus->intr_urb, NULL);
1403
1404 queue_delayed_work(pegasus_workqueue, &pegasus->carrier_check,
1405 CARRIER_CHECK_DELAY);
1406 } 1414 }
1415 queue_delayed_work(pegasus_workqueue, &pegasus->carrier_check,
1416 CARRIER_CHECK_DELAY);
1407 return 0; 1417 return 0;
1408} 1418}
1409 1419
diff --git a/drivers/usb/net/rndis_host.c b/drivers/usb/net/rndis_host.c
index 49991ac1bf3b..94ddfe16fdda 100644
--- a/drivers/usb/net/rndis_host.c
+++ b/drivers/usb/net/rndis_host.c
@@ -39,6 +39,20 @@
39 * RNDIS is NDIS remoted over USB. It's a MSFT variant of CDC ACM ... of 39 * RNDIS is NDIS remoted over USB. It's a MSFT variant of CDC ACM ... of
40 * course ACM was intended for modems, not Ethernet links! USB's standard 40 * course ACM was intended for modems, not Ethernet links! USB's standard
41 * for Ethernet links is "CDC Ethernet", which is significantly simpler. 41 * for Ethernet links is "CDC Ethernet", which is significantly simpler.
42 *
43 * NOTE that Microsoft's "RNDIS 1.0" specification is incomplete. Issues
44 * include:
45 * - Power management in particular relies on information that's scattered
46 * through other documentation, and which is incomplete or incorrect even
47 * there.
48 * - There are various undocumented protocol requirements, such as the
49 * need to send unused garbage in control-OUT messages.
50 * - In some cases, MS-Windows will emit undocumented requests; this
51 * matters more to peripheral implementations than host ones.
52 *
53 * For these reasons and others, ** USE OF RNDIS IS STRONGLY DISCOURAGED ** in
54 * favor of such non-proprietary alternatives as CDC Ethernet or the newer (and
55 * currently rare) "Ethernet Emulation Model" (EEM).
42 */ 56 */
43 57
44/* 58/*
@@ -72,17 +86,17 @@ struct rndis_msg_hdr {
72 */ 86 */
73#define RNDIS_MSG_PACKET ccpu2(0x00000001) /* 1-N packets */ 87#define RNDIS_MSG_PACKET ccpu2(0x00000001) /* 1-N packets */
74#define RNDIS_MSG_INIT ccpu2(0x00000002) 88#define RNDIS_MSG_INIT ccpu2(0x00000002)
75#define RNDIS_MSG_INIT_C (RNDIS_MSG_INIT|RNDIS_MSG_COMPLETION) 89#define RNDIS_MSG_INIT_C (RNDIS_MSG_INIT|RNDIS_MSG_COMPLETION)
76#define RNDIS_MSG_HALT ccpu2(0x00000003) 90#define RNDIS_MSG_HALT ccpu2(0x00000003)
77#define RNDIS_MSG_QUERY ccpu2(0x00000004) 91#define RNDIS_MSG_QUERY ccpu2(0x00000004)
78#define RNDIS_MSG_QUERY_C (RNDIS_MSG_QUERY|RNDIS_MSG_COMPLETION) 92#define RNDIS_MSG_QUERY_C (RNDIS_MSG_QUERY|RNDIS_MSG_COMPLETION)
79#define RNDIS_MSG_SET ccpu2(0x00000005) 93#define RNDIS_MSG_SET ccpu2(0x00000005)
80#define RNDIS_MSG_SET_C (RNDIS_MSG_SET|RNDIS_MSG_COMPLETION) 94#define RNDIS_MSG_SET_C (RNDIS_MSG_SET|RNDIS_MSG_COMPLETION)
81#define RNDIS_MSG_RESET ccpu2(0x00000006) 95#define RNDIS_MSG_RESET ccpu2(0x00000006)
82#define RNDIS_MSG_RESET_C (RNDIS_MSG_RESET|RNDIS_MSG_COMPLETION) 96#define RNDIS_MSG_RESET_C (RNDIS_MSG_RESET|RNDIS_MSG_COMPLETION)
83#define RNDIS_MSG_INDICATE ccpu2(0x00000007) 97#define RNDIS_MSG_INDICATE ccpu2(0x00000007)
84#define RNDIS_MSG_KEEPALIVE ccpu2(0x00000008) 98#define RNDIS_MSG_KEEPALIVE ccpu2(0x00000008)
85#define RNDIS_MSG_KEEPALIVE_C (RNDIS_MSG_KEEPALIVE|RNDIS_MSG_COMPLETION) 99#define RNDIS_MSG_KEEPALIVE_C (RNDIS_MSG_KEEPALIVE|RNDIS_MSG_COMPLETION)
86 100
87/* codes for "status" field of completion messages */ 101/* codes for "status" field of completion messages */
88#define RNDIS_STATUS_SUCCESS ccpu2(0x00000000) 102#define RNDIS_STATUS_SUCCESS ccpu2(0x00000000)
@@ -596,13 +610,13 @@ static struct usb_driver rndis_driver = {
596 610
597static int __init rndis_init(void) 611static int __init rndis_init(void)
598{ 612{
599 return usb_register(&rndis_driver); 613 return usb_register(&rndis_driver);
600} 614}
601module_init(rndis_init); 615module_init(rndis_init);
602 616
603static void __exit rndis_exit(void) 617static void __exit rndis_exit(void)
604{ 618{
605 usb_deregister(&rndis_driver); 619 usb_deregister(&rndis_driver);
606} 620}
607module_exit(rndis_exit); 621module_exit(rndis_exit);
608 622
diff --git a/drivers/usb/serial/Kconfig b/drivers/usb/serial/Kconfig
index 5a8a2c91c2b2..5c60be521561 100644
--- a/drivers/usb/serial/Kconfig
+++ b/drivers/usb/serial/Kconfig
@@ -71,6 +71,16 @@ config USB_SERIAL_ANYDATA
71 To compile this driver as a module, choose M here: the 71 To compile this driver as a module, choose M here: the
72 module will be called anydata. 72 module will be called anydata.
73 73
74config USB_SERIAL_ARK3116
75 tristate "USB ARK Micro 3116 USB Serial Driver (EXPERIMENTAL)"
76 depends on USB_SERIAL && EXPERIMENTAL
77 help
78 Say Y here if you want to use a ARK Micro 3116 USB to Serial
79 device.
80
81 To compile this driver as a module, choose M here: the
82 module will be called ark3116
83
74config USB_SERIAL_BELKIN 84config USB_SERIAL_BELKIN
75 tristate "USB Belkin and Peracom Single Port Serial Driver" 85 tristate "USB Belkin and Peracom Single Port Serial Driver"
76 depends on USB_SERIAL 86 depends on USB_SERIAL
@@ -158,6 +168,15 @@ config USB_SERIAL_FTDI_SIO
158 To compile this driver as a module, choose M here: the 168 To compile this driver as a module, choose M here: the
159 module will be called ftdi_sio. 169 module will be called ftdi_sio.
160 170
171config USB_SERIAL_FUNSOFT
172 tristate "USB Fundamental Software Dongle Driver"
173 depends on USB_SERIAL
174 ---help---
175 Say Y here if you want to use the Fundamental Software dongle.
176
177 To compile this driver as a module, choose M here: the
178 module will be called funsoft.
179
161config USB_SERIAL_VISOR 180config USB_SERIAL_VISOR
162 tristate "USB Handspring Visor / Palm m50x / Sony Clie Driver" 181 tristate "USB Handspring Visor / Palm m50x / Sony Clie Driver"
163 depends on USB_SERIAL 182 depends on USB_SERIAL
diff --git a/drivers/usb/serial/Makefile b/drivers/usb/serial/Makefile
index f7fe4172efed..5a0960fc9d3e 100644
--- a/drivers/usb/serial/Makefile
+++ b/drivers/usb/serial/Makefile
@@ -13,6 +13,7 @@ usbserial-objs := usb-serial.o generic.o bus.o $(usbserial-obj-y)
13 13
14obj-$(CONFIG_USB_SERIAL_AIRPRIME) += airprime.o 14obj-$(CONFIG_USB_SERIAL_AIRPRIME) += airprime.o
15obj-$(CONFIG_USB_SERIAL_ANYDATA) += anydata.o 15obj-$(CONFIG_USB_SERIAL_ANYDATA) += anydata.o
16obj-$(CONFIG_USB_SERIAL_ARK3116) += ark3116.o
16obj-$(CONFIG_USB_SERIAL_BELKIN) += belkin_sa.o 17obj-$(CONFIG_USB_SERIAL_BELKIN) += belkin_sa.o
17obj-$(CONFIG_USB_SERIAL_CP2101) += cp2101.o 18obj-$(CONFIG_USB_SERIAL_CP2101) += cp2101.o
18obj-$(CONFIG_USB_SERIAL_CYBERJACK) += cyberjack.o 19obj-$(CONFIG_USB_SERIAL_CYBERJACK) += cyberjack.o
@@ -22,6 +23,7 @@ obj-$(CONFIG_USB_SERIAL_EDGEPORT) += io_edgeport.o
22obj-$(CONFIG_USB_SERIAL_EDGEPORT_TI) += io_ti.o 23obj-$(CONFIG_USB_SERIAL_EDGEPORT_TI) += io_ti.o
23obj-$(CONFIG_USB_SERIAL_EMPEG) += empeg.o 24obj-$(CONFIG_USB_SERIAL_EMPEG) += empeg.o
24obj-$(CONFIG_USB_SERIAL_FTDI_SIO) += ftdi_sio.o 25obj-$(CONFIG_USB_SERIAL_FTDI_SIO) += ftdi_sio.o
26obj-$(CONFIG_USB_SERIAL_FUNSOFT) += funsoft.o
25obj-$(CONFIG_USB_SERIAL_GARMIN) += garmin_gps.o 27obj-$(CONFIG_USB_SERIAL_GARMIN) += garmin_gps.o
26obj-$(CONFIG_USB_SERIAL_HP4X) += hp4x.o 28obj-$(CONFIG_USB_SERIAL_HP4X) += hp4x.o
27obj-$(CONFIG_USB_SERIAL_IPAQ) += ipaq.o 29obj-$(CONFIG_USB_SERIAL_IPAQ) += ipaq.o
diff --git a/drivers/usb/serial/airprime.c b/drivers/usb/serial/airprime.c
index dbf1f063098c..694b205f9b73 100644
--- a/drivers/usb/serial/airprime.c
+++ b/drivers/usb/serial/airprime.c
@@ -18,6 +18,7 @@
18static struct usb_device_id id_table [] = { 18static struct usb_device_id id_table [] = {
19 { USB_DEVICE(0xf3d, 0x0112) }, /* AirPrime CDMA Wireless PC Card */ 19 { USB_DEVICE(0xf3d, 0x0112) }, /* AirPrime CDMA Wireless PC Card */
20 { USB_DEVICE(0x1410, 0x1110) }, /* Novatel Wireless Merlin CDMA */ 20 { USB_DEVICE(0x1410, 0x1110) }, /* Novatel Wireless Merlin CDMA */
21 { USB_DEVICE(0x1199, 0x0112) }, /* Sierra Wireless Aircard 580 */
21 { }, 22 { },
22}; 23};
23MODULE_DEVICE_TABLE(usb, id_table); 24MODULE_DEVICE_TABLE(usb, id_table);
diff --git a/drivers/usb/serial/ark3116.c b/drivers/usb/serial/ark3116.c
new file mode 100644
index 000000000000..8dec796222a0
--- /dev/null
+++ b/drivers/usb/serial/ark3116.c
@@ -0,0 +1,465 @@
1/*
2 * ark3116
3 * - implements a driver for the arkmicro ark3116 chipset (vendor=0x6547,
4 * productid=0x0232) (used in a datacable called KQ-U8A)
5 *
6 * - based on code by krisfx -> thanks !!
7 * (see http://www.linuxquestions.org/questions/showthread.php?p=2184457#post2184457)
8 *
9 * - based on logs created by usbsnoopy
10 *
11 * Author : Simon Schulz [ark3116_driver<AT>auctionant.de]
12 *
13 * This program is free software; you can redistribute it and/or modify it
14 * under the terms of the GNU General Public License as published by the
15 * Free Software Foundation; either version 2 of the License, or (at your
16 * option) any later version.
17 */
18
19#include <linux/kernel.h>
20#include <linux/init.h>
21#include <linux/tty.h>
22#include <linux/module.h>
23#include <linux/usb.h>
24#include "usb-serial.h"
25
26
27static int debug;
28
29static struct usb_device_id id_table [] = {
30 { USB_DEVICE(0x6547, 0x0232) },
31 { },
32};
33MODULE_DEVICE_TABLE(usb, id_table);
34
35struct ark3116_private {
36 spinlock_t lock;
37 u8 termios_initialized;
38};
39
40static inline void ARK3116_SND(struct usb_serial *serial, int seq,
41 __u8 request, __u8 requesttype,
42 __u16 value, __u16 index)
43{
44 int result;
45 result = usb_control_msg(serial->dev,
46 usb_sndctrlpipe(serial->dev,0),
47 request, requesttype, value, index,
48 NULL,0x00, 1000);
49 dbg("%03d > ok",seq);
50}
51
52static inline void ARK3116_RCV(struct usb_serial *serial, int seq,
53 __u8 request, __u8 requesttype,
54 __u16 value, __u16 index, __u8 expected,
55 char *buf)
56{
57 int result;
58 result = usb_control_msg(serial->dev,
59 usb_rcvctrlpipe(serial->dev,0),
60 request, requesttype, value, index,
61 buf, 0x0000001, 1000);
62 if (result)
63 dbg("%03d < %d bytes [0x%02X]",seq, result, buf[0]);
64 else
65 dbg("%03d < 0 bytes", seq);
66}
67
68
69static inline void ARK3116_RCV_QUIET(struct usb_serial *serial,
70 __u8 request, __u8 requesttype,
71 __u16 value, __u16 index, char *buf)
72{
73 usb_control_msg(serial->dev,
74 usb_rcvctrlpipe(serial->dev,0),
75 request, requesttype, value, index,
76 buf, 0x0000001, 1000);
77}
78
79
80static int ark3116_attach(struct usb_serial *serial)
81{
82 char *buf;
83 struct ark3116_private *priv;
84 int i;
85
86 for (i = 0; i < serial->num_ports; ++i) {
87 priv = kmalloc (sizeof (struct ark3116_private), GFP_KERNEL);
88 if (!priv)
89 goto cleanup;
90 memset (priv, 0x00, sizeof (struct ark3116_private));
91 spin_lock_init(&priv->lock);
92
93 usb_set_serial_port_data(serial->port[i], priv);
94 }
95
96 buf = kmalloc(1, GFP_KERNEL);
97 if (!buf) {
98 dbg("error kmalloc -> out of mem ?");
99 goto cleanup;
100 }
101
102 /* 3 */
103 ARK3116_SND(serial, 3,0xFE,0x40,0x0008,0x0002);
104 ARK3116_SND(serial, 4,0xFE,0x40,0x0008,0x0001);
105 ARK3116_SND(serial, 5,0xFE,0x40,0x0000,0x0008);
106 ARK3116_SND(serial, 6,0xFE,0x40,0x0000,0x000B);
107
108 /* <-- seq7 */
109 ARK3116_RCV(serial, 7,0xFE,0xC0,0x0000,0x0003, 0x00, buf);
110 ARK3116_SND(serial, 8,0xFE,0x40,0x0080,0x0003);
111 ARK3116_SND(serial, 9,0xFE,0x40,0x001A,0x0000);
112 ARK3116_SND(serial,10,0xFE,0x40,0x0000,0x0001);
113 ARK3116_SND(serial,11,0xFE,0x40,0x0000,0x0003);
114
115 /* <-- seq12 */
116 ARK3116_RCV(serial,12,0xFE,0xC0,0x0000,0x0004, 0x00, buf);
117 ARK3116_SND(serial,13,0xFE,0x40,0x0000,0x0004);
118
119 /* 14 */
120 ARK3116_RCV(serial,14,0xFE,0xC0,0x0000,0x0004, 0x00, buf);
121 ARK3116_SND(serial,15,0xFE,0x40,0x0000,0x0004);
122
123 /* 16 */
124 ARK3116_RCV(serial,16,0xFE,0xC0,0x0000,0x0004, 0x00, buf);
125 /* --> seq17 */
126 ARK3116_SND(serial,17,0xFE,0x40,0x0001,0x0004);
127
128 /* <-- seq18 */
129 ARK3116_RCV(serial,18,0xFE,0xC0,0x0000,0x0004, 0x01, buf);
130
131 /* --> seq19 */
132 ARK3116_SND(serial,19,0xFE,0x40,0x0003,0x0004);
133
134
135 /* <-- seq20 */
136 /* seems like serial port status info (RTS, CTS,...) */
137 /* returns modem control line status ?! */
138 ARK3116_RCV(serial,20,0xFE,0xC0,0x0000,0x0006, 0xFF, buf);
139
140 /* set 9600 baud & do some init ?! */
141 ARK3116_SND(serial,147,0xFE,0x40,0x0083,0x0003);
142 ARK3116_SND(serial,148,0xFE,0x40,0x0038,0x0000);
143 ARK3116_SND(serial,149,0xFE,0x40,0x0001,0x0001);
144 ARK3116_SND(serial,150,0xFE,0x40,0x0003,0x0003);
145 ARK3116_RCV(serial,151,0xFE,0xC0,0x0000,0x0004,0x03, buf);
146 ARK3116_SND(serial,152,0xFE,0x40,0x0000,0x0003);
147 ARK3116_RCV(serial,153,0xFE,0xC0,0x0000,0x0003,0x00, buf);
148 ARK3116_SND(serial,154,0xFE,0x40,0x0003,0x0003);
149
150 kfree(buf);
151 return(0);
152
153cleanup:
154 for (--i; i>=0; --i)
155 usb_set_serial_port_data(serial->port[i], NULL);
156 return -ENOMEM;
157}
158
159static void ark3116_set_termios(struct usb_serial_port *port,
160 struct termios *old_termios)
161{
162 struct usb_serial *serial = port->serial;
163 struct ark3116_private *priv = usb_get_serial_port_data(port);
164 unsigned int cflag = port->tty->termios->c_cflag;
165 unsigned long flags;
166 int baud;
167 int ark3116_baud;
168 char *buf;
169 char config;
170
171 config = 0;
172
173 dbg("%s - port %d", __FUNCTION__, port->number);
174
175 if ((!port->tty) || (!port->tty->termios)) {
176 dbg("%s - no tty structures", __FUNCTION__);
177 return;
178 }
179
180 spin_lock_irqsave(&priv->lock, flags);
181 if (!priv->termios_initialized) {
182 *(port->tty->termios) = tty_std_termios;
183 port->tty->termios->c_cflag = B9600 | CS8 | CREAD | HUPCL | CLOCAL;
184 priv->termios_initialized = 1;
185 }
186 spin_unlock_irqrestore(&priv->lock, flags);
187
188 cflag = port->tty->termios->c_cflag;
189
190 /* check that they really want us to change something: */
191 if (old_termios) {
192 if ((cflag == old_termios->c_cflag) &&
193 (RELEVANT_IFLAG(port->tty->termios->c_iflag) ==
194 RELEVANT_IFLAG(old_termios->c_iflag))) {
195 dbg("%s - nothing to change...", __FUNCTION__);
196 return;
197 }
198 }
199
200 buf = kmalloc(1, GFP_KERNEL);
201 if (!buf) {
202 dbg("error kmalloc");
203 return;
204 }
205
206 /* set data bit count (8/7/6/5) */
207 if (cflag & CSIZE){
208 switch (cflag & CSIZE){
209 case CS5:
210 config |= 0x00;
211 dbg("setting CS5");
212 break;
213 case CS6:
214 config |= 0x01;
215 dbg("setting CS6");
216 break;
217 case CS7:
218 config |= 0x02;
219 dbg("setting CS7");
220 break;
221 default:
222 err ("CSIZE was set but not CS5-CS8, using CS8!");
223 case CS8:
224 config |= 0x03;
225 dbg("setting CS8");
226 break;
227 }
228 }
229
230 /* set parity (NONE,EVEN,ODD) */
231 if (cflag & PARENB){
232 if (cflag & PARODD) {
233 config |= 0x08;
234 dbg("setting parity to ODD");
235 } else {
236 config |= 0x18;
237 dbg("setting parity to EVEN");
238 }
239 } else {
240 dbg("setting parity to NONE");
241 }
242
243 /* SET STOPBIT (1/2) */
244 if (cflag & CSTOPB) {
245 config |= 0x04;
246 dbg ("setting 2 stop bits");
247 } else {
248 dbg ("setting 1 stop bit");
249 }
250
251
252 /* set baudrate: */
253 baud = 0;
254 switch (cflag & CBAUD){
255 case B0:
256 err("can't set 0baud, using 9600 instead");
257 break;
258 case B75: baud = 75; break;
259 case B150: baud = 150; break;
260 case B300: baud = 300; break;
261 case B600: baud = 600; break;
262 case B1200: baud = 1200; break;
263 case B1800: baud = 1800; break;
264 case B2400: baud = 2400; break;
265 case B4800: baud = 4800; break;
266 case B9600: baud = 9600; break;
267 case B19200: baud = 19200; break;
268 case B38400: baud = 38400; break;
269 case B57600: baud = 57600; break;
270 case B115200: baud = 115200; break;
271 case B230400: baud = 230400; break;
272 case B460800: baud = 460800; break;
273 default:
274 dbg("does not support the baudrate requested (fix it)");
275 break;
276 }
277
278 /* set 9600 as default (if given baudrate is invalid for example) */
279 if (baud == 0)
280 baud = 9600;
281
282 /*
283 * found by try'n'error, be careful, maybe there are other options
284 * for multiplicator etc!
285 */
286 if (baud == 460800)
287 /* strange, for 460800 the formula is wrong
288 * (dont use round(), then 9600baud is wrong) */
289 ark3116_baud = 7;
290 else
291 ark3116_baud = 3000000 / baud;
292
293 /* ? */
294 ARK3116_RCV(serial,0,0xFE,0xC0,0x0000,0x0003, 0x03, buf);
295 /* offset = buf[0]; */
296 /* offset = 0x03; */
297 /* dbg("using 0x%04X as target for 0x0003:",0x0080+offset); */
298
299
300 /* set baudrate */
301 dbg("setting baudrate to %d (->reg=%d)",baud,ark3116_baud);
302 ARK3116_SND(serial,147,0xFE,0x40,0x0083,0x0003);
303 ARK3116_SND(serial,148,0xFE,0x40,(ark3116_baud & 0x00FF) ,0x0000);
304 ARK3116_SND(serial,149,0xFE,0x40,(ark3116_baud & 0xFF00)>>8,0x0001);
305 ARK3116_SND(serial,150,0xFE,0x40,0x0003,0x0003);
306
307 /* ? */
308 ARK3116_RCV(serial,151,0xFE,0xC0,0x0000,0x0004,0x03, buf);
309 ARK3116_SND(serial,152,0xFE,0x40,0x0000,0x0003);
310
311 /* set data bit count, stop bit count & parity: */
312 dbg("updating bit count, stop bit or parity (cfg=0x%02X)", config);
313 ARK3116_RCV(serial,153,0xFE,0xC0,0x0000,0x0003,0x00, buf);
314 ARK3116_SND(serial,154,0xFE,0x40,config,0x0003);
315
316 if (cflag & CRTSCTS)
317 dbg("CRTSCTS not supported by chipset ?!");
318
319 /* TEST ARK3116_SND(154,0xFE,0x40,0xFFFF, 0x0006); */
320
321 kfree(buf);
322 return;
323}
324
325static int ark3116_open(struct usb_serial_port *port, struct file *filp)
326{
327 struct termios tmp_termios;
328 struct usb_serial *serial = port->serial;
329 char *buf;
330 int result = 0;
331
332 dbg("%s - port %d", __FUNCTION__, port->number);
333
334 buf = kmalloc(1, GFP_KERNEL);
335 if (!buf) {
336 dbg("error kmalloc -> out of mem ?");
337 return -ENOMEM;
338 }
339
340 result = usb_serial_generic_open(port, filp);
341 if (result)
342 return result;
343
344 /* open */
345 ARK3116_RCV(serial,111,0xFE,0xC0,0x0000,0x0003, 0x02, buf);
346
347 ARK3116_SND(serial,112,0xFE,0x40,0x0082,0x0003);
348 ARK3116_SND(serial,113,0xFE,0x40,0x001A,0x0000);
349 ARK3116_SND(serial,114,0xFE,0x40,0x0000,0x0001);
350 ARK3116_SND(serial,115,0xFE,0x40,0x0002,0x0003);
351
352 ARK3116_RCV(serial,116,0xFE,0xC0,0x0000,0x0004, 0x03, buf);
353 ARK3116_SND(serial,117,0xFE,0x40,0x0002,0x0004);
354
355 ARK3116_RCV(serial,118,0xFE,0xC0,0x0000,0x0004, 0x02, buf);
356 ARK3116_SND(serial,119,0xFE,0x40,0x0000,0x0004);
357
358 ARK3116_RCV(serial,120,0xFE,0xC0,0x0000,0x0004, 0x00, buf);
359
360 ARK3116_SND(serial,121,0xFE,0x40,0x0001,0x0004);
361
362 ARK3116_RCV(serial,122,0xFE,0xC0,0x0000,0x0004, 0x01, buf);
363
364 ARK3116_SND(serial,123,0xFE,0x40,0x0003,0x0004);
365
366 /* returns different values (control lines ?!) */
367 ARK3116_RCV(serial,124,0xFE,0xC0,0x0000,0x0006, 0xFF, buf);
368
369 /* initialise termios: */
370 if (port->tty)
371 ark3116_set_termios(port, &tmp_termios);
372
373 kfree(buf);
374
375 return result;
376
377}
378
379static int ark3116_ioctl(struct usb_serial_port *port, struct file *file,
380 unsigned int cmd, unsigned long arg)
381{
382 dbg("ioctl not supported yet...");
383 return -ENOIOCTLCMD;
384}
385
386static int ark3116_tiocmget(struct usb_serial_port *port, struct file *file)
387{
388 struct usb_serial *serial = port->serial;
389 char *buf;
390 char temp;
391
392 /* seems like serial port status info (RTS, CTS,...) is stored
393 * in reg(?) 0x0006
394 * pcb connection point 11 = GND -> sets bit4 of response
395 * pcb connection point 7 = GND -> sets bit6 of response
396 */
397
398 buf = kmalloc(1, GFP_KERNEL);
399 if (!buf) {
400 dbg("error kmalloc");
401 return -ENOMEM;
402 }
403
404 /* read register: */
405 ARK3116_RCV_QUIET(serial,0xFE,0xC0,0x0000,0x0006,buf);
406 temp = buf[0];
407 kfree(buf);
408
409 /* i do not really know if bit4=CTS and bit6=DSR... was just a
410 * quick guess !!
411 */
412 return (temp & (1<<4) ? TIOCM_CTS : 0) |
413 (temp & (1<<6) ? TIOCM_DSR : 0);
414}
415
416static struct usb_driver ark3116_driver = {
417 .name = "ark3116",
418 .probe = usb_serial_probe,
419 .disconnect = usb_serial_disconnect,
420 .id_table = id_table,
421};
422
423static struct usb_serial_driver ark3116_device = {
424 .driver = {
425 .owner = THIS_MODULE,
426 .name = "ark3116",
427 },
428 .id_table = id_table,
429 .num_interrupt_in = 1,
430 .num_bulk_in = 1,
431 .num_bulk_out = 1,
432 .num_ports = 1,
433 .attach = ark3116_attach,
434 .set_termios = ark3116_set_termios,
435 .ioctl = ark3116_ioctl,
436 .tiocmget = ark3116_tiocmget,
437 .open = ark3116_open,
438};
439
440static int __init ark3116_init(void)
441{
442 int retval;
443
444 retval = usb_serial_register(&ark3116_device);
445 if (retval)
446 return retval;
447 retval = usb_register(&ark3116_driver);
448 if (retval)
449 usb_serial_deregister(&ark3116_device);
450 return retval;
451}
452
453static void __exit ark3116_exit(void)
454{
455 usb_deregister(&ark3116_driver);
456 usb_serial_deregister(&ark3116_device);
457}
458
459module_init(ark3116_init);
460module_exit(ark3116_exit);
461MODULE_LICENSE("GPL");
462
463module_param(debug, bool, S_IRUGO | S_IWUSR);
464MODULE_PARM_DESC(debug, "Debug enabled or not");
465
diff --git a/drivers/usb/serial/console.c b/drivers/usb/serial/console.c
index 167f8ec56131..8023bb7279b1 100644
--- a/drivers/usb/serial/console.c
+++ b/drivers/usb/serial/console.c
@@ -54,7 +54,7 @@ static struct console usbcons;
54 * serial.c code, except that the specifier is "ttyUSB" instead 54 * serial.c code, except that the specifier is "ttyUSB" instead
55 * of "ttyS". 55 * of "ttyS".
56 */ 56 */
57static int __init usb_console_setup(struct console *co, char *options) 57static int usb_console_setup(struct console *co, char *options)
58{ 58{
59 struct usbcons_info *info = &usbcons_info; 59 struct usbcons_info *info = &usbcons_info;
60 int baud = 9600; 60 int baud = 9600;
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index f3af81b4dd29..986d7622273d 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -307,7 +307,9 @@ static struct ftdi_sio_quirk ftdi_HE_TIRA1_quirk = {
307 307
308 308
309static struct usb_device_id id_table_combined [] = { 309static struct usb_device_id id_table_combined [] = {
310 { USB_DEVICE(FTDI_VID, FTDI_ACTZWAVE_PID) },
310 { USB_DEVICE(FTDI_VID, FTDI_IRTRANS_PID) }, 311 { USB_DEVICE(FTDI_VID, FTDI_IRTRANS_PID) },
312 { USB_DEVICE(FTDI_VID, FTDI_IPLUS_PID) },
311 { USB_DEVICE(FTDI_VID, FTDI_SIO_PID) }, 313 { USB_DEVICE(FTDI_VID, FTDI_SIO_PID) },
312 { USB_DEVICE(FTDI_VID, FTDI_8U232AM_PID) }, 314 { USB_DEVICE(FTDI_VID, FTDI_8U232AM_PID) },
313 { USB_DEVICE(FTDI_VID, FTDI_8U232AM_ALT_PID) }, 315 { USB_DEVICE(FTDI_VID, FTDI_8U232AM_ALT_PID) },
@@ -489,10 +491,15 @@ static struct usb_device_id id_table_combined [] = {
489 { USB_DEVICE(KOBIL_VID, KOBIL_CONV_KAAN_PID) }, 491 { USB_DEVICE(KOBIL_VID, KOBIL_CONV_KAAN_PID) },
490 { USB_DEVICE(POSIFLEX_VID, POSIFLEX_PP7000_PID) }, 492 { USB_DEVICE(POSIFLEX_VID, POSIFLEX_PP7000_PID) },
491 { USB_DEVICE(FTDI_VID, FTDI_TTUSB_PID) }, 493 { USB_DEVICE(FTDI_VID, FTDI_TTUSB_PID) },
494 { USB_DEVICE(FTDI_VID, FTDI_ECLO_COM_1WIRE_PID) },
492 { USB_DEVICE(FTDI_VID, FTDI_WESTREX_MODEL_777_PID) }, 495 { USB_DEVICE(FTDI_VID, FTDI_WESTREX_MODEL_777_PID) },
493 { USB_DEVICE(FTDI_VID, FTDI_WESTREX_MODEL_8900F_PID) }, 496 { USB_DEVICE(FTDI_VID, FTDI_WESTREX_MODEL_8900F_PID) },
494 { USB_DEVICE(FTDI_VID, FTDI_PCDJ_DAC2_PID) }, 497 { USB_DEVICE(FTDI_VID, FTDI_PCDJ_DAC2_PID) },
498 { USB_DEVICE(FTDI_VID, FTDI_RRCIRKITS_LOCOBUFFER_PID) },
499 { USB_DEVICE(FTDI_VID, FTDI_ASK_RDR400_PID) },
495 { USB_DEVICE(ICOM_ID1_VID, ICOM_ID1_PID) }, 500 { USB_DEVICE(ICOM_ID1_VID, ICOM_ID1_PID) },
501 { USB_DEVICE(PAPOUCH_VID, PAPOUCH_TMU_PID) },
502 { USB_DEVICE(FTDI_VID, FTDI_ACG_HFDUAL_PID) },
496 { }, /* Optional parameter entry */ 503 { }, /* Optional parameter entry */
497 { } /* Terminating entry */ 504 { } /* Terminating entry */
498}; 505};
diff --git a/drivers/usb/serial/ftdi_sio.h b/drivers/usb/serial/ftdi_sio.h
index 8da773c2744d..d69a917e768f 100644
--- a/drivers/usb/serial/ftdi_sio.h
+++ b/drivers/usb/serial/ftdi_sio.h
@@ -32,6 +32,10 @@
32#define FTDI_NF_RIC_PID 0x0001 /* Product Id */ 32#define FTDI_NF_RIC_PID 0x0001 /* Product Id */
33 33
34 34
35/* ACT Solutions HomePro ZWave interface (http://www.act-solutions.com/HomePro.htm) */
36#define FTDI_ACTZWAVE_PID 0xF2D0
37
38
35/* www.irtrans.de device */ 39/* www.irtrans.de device */
36#define FTDI_IRTRANS_PID 0xFC60 /* Product Id */ 40#define FTDI_IRTRANS_PID 0xFC60 /* Product Id */
37 41
@@ -39,6 +43,9 @@
39/* www.thoughttechnology.com/ TT-USB provide with procomp use ftdi_sio */ 43/* www.thoughttechnology.com/ TT-USB provide with procomp use ftdi_sio */
40#define FTDI_TTUSB_PID 0xFF20 /* Product Id */ 44#define FTDI_TTUSB_PID 0xFF20 /* Product Id */
41 45
46/* iPlus device */
47#define FTDI_IPLUS_PID 0xD070 /* Product Id */
48
42/* www.crystalfontz.com devices - thanx for providing free devices for evaluation ! */ 49/* www.crystalfontz.com devices - thanx for providing free devices for evaluation ! */
43/* they use the ftdi chipset for the USB interface and the vendor id is the same */ 50/* they use the ftdi chipset for the USB interface and the vendor id is the same */
44#define FTDI_XF_632_PID 0xFC08 /* 632: 16x2 Character Display */ 51#define FTDI_XF_632_PID 0xFC08 /* 632: 16x2 Character Display */
@@ -153,6 +160,11 @@
153#define ICOM_ID1_PID 0x0004 160#define ICOM_ID1_PID 0x0004
154 161
155/* 162/*
163 * ASK.fr devices
164 */
165#define FTDI_ASK_RDR400_PID 0xC991 /* ASK RDR 400 series card reader */
166
167/*
156 * DSS-20 Sync Station for Sony Ericsson P800 168 * DSS-20 Sync Station for Sony Ericsson P800
157 */ 169 */
158 170
@@ -399,6 +411,31 @@
399#define FTDI_WESTREX_MODEL_777_PID 0xDC00 /* Model 777 */ 411#define FTDI_WESTREX_MODEL_777_PID 0xDC00 /* Model 777 */
400#define FTDI_WESTREX_MODEL_8900F_PID 0xDC01 /* Model 8900F */ 412#define FTDI_WESTREX_MODEL_8900F_PID 0xDC01 /* Model 8900F */
401 413
414/*
415 * RR-CirKits LocoBuffer USB (http://www.rr-cirkits.com)
416 */
417#define FTDI_RRCIRKITS_LOCOBUFFER_PID 0xc7d0 /* LocoBuffer USB */
418
419/*
420 * Eclo (http://www.eclo.pt/) product IDs.
421 * PID 0xEA90 submitted by Martin Grill.
422 */
423#define FTDI_ECLO_COM_1WIRE_PID 0xEA90 /* COM to 1-Wire USB adaptor */
424
425/*
426 * Papouch products (http://www.papouch.com/)
427 * Submitted by Folkert van Heusden
428 */
429
430#define PAPOUCH_VID 0x5050 /* Vendor ID */
431#define PAPOUCH_TMU_PID 0x0400 /* TMU USB Thermometer */
432
433/*
434 * ACG Identification Technologies GmbH products (http://www.acg.de/).
435 * Submitted by anton -at- goto10 -dot- org.
436 */
437#define FTDI_ACG_HFDUAL_PID 0xDD20 /* HF Dual ISO Reader (RFID) */
438
402/* Commands */ 439/* Commands */
403#define FTDI_SIO_RESET 0 /* Reset the port */ 440#define FTDI_SIO_RESET 0 /* Reset the port */
404#define FTDI_SIO_MODEM_CTRL 1 /* Set the modem control register */ 441#define FTDI_SIO_MODEM_CTRL 1 /* Set the modem control register */
diff --git a/drivers/usb/serial/funsoft.c b/drivers/usb/serial/funsoft.c
new file mode 100644
index 000000000000..803721b97e2e
--- /dev/null
+++ b/drivers/usb/serial/funsoft.c
@@ -0,0 +1,65 @@
1/*
2 * Funsoft Serial USB driver
3 *
4 * Copyright (C) 2006 Greg Kroah-Hartman <gregkh@suse.de>
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License version
8 * 2 as published by the Free Software Foundation.
9 */
10
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/tty.h>
14#include <linux/module.h>
15#include <linux/usb.h>
16#include "usb-serial.h"
17
18static struct usb_device_id id_table [] = {
19 { USB_DEVICE(0x1404, 0xcddc) },
20 { },
21};
22MODULE_DEVICE_TABLE(usb, id_table);
23
24static struct usb_driver funsoft_driver = {
25 .name = "funsoft",
26 .probe = usb_serial_probe,
27 .disconnect = usb_serial_disconnect,
28 .id_table = id_table,
29 .no_dynamic_id = 1,
30};
31
32static struct usb_serial_driver funsoft_device = {
33 .driver = {
34 .owner = THIS_MODULE,
35 .name = "funsoft",
36 },
37 .id_table = id_table,
38 .num_interrupt_in = NUM_DONT_CARE,
39 .num_bulk_in = NUM_DONT_CARE,
40 .num_bulk_out = NUM_DONT_CARE,
41 .num_ports = 1,
42};
43
44static int __init funsoft_init(void)
45{
46 int retval;
47
48 retval = usb_serial_register(&funsoft_device);
49 if (retval)
50 return retval;
51 retval = usb_register(&funsoft_driver);
52 if (retval)
53 usb_serial_deregister(&funsoft_device);
54 return retval;
55}
56
57static void __exit funsoft_exit(void)
58{
59 usb_deregister(&funsoft_driver);
60 usb_serial_deregister(&funsoft_device);
61}
62
63module_init(funsoft_init);
64module_exit(funsoft_exit);
65MODULE_LICENSE("GPL");
diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c
index 476cda107f4f..c62cc2876519 100644
--- a/drivers/usb/serial/generic.c
+++ b/drivers/usb/serial/generic.c
@@ -138,6 +138,7 @@ int usb_serial_generic_open (struct usb_serial_port *port, struct file *filp)
138 138
139 return result; 139 return result;
140} 140}
141EXPORT_SYMBOL_GPL(usb_serial_generic_open);
141 142
142static void generic_cleanup (struct usb_serial_port *port) 143static void generic_cleanup (struct usb_serial_port *port)
143{ 144{
diff --git a/drivers/usb/serial/omninet.c b/drivers/usb/serial/omninet.c
index 4d40704dea2c..238033a87092 100644
--- a/drivers/usb/serial/omninet.c
+++ b/drivers/usb/serial/omninet.c
@@ -257,14 +257,14 @@ static int omninet_write (struct usb_serial_port *port, const unsigned char *buf
257 return (0); 257 return (0);
258 } 258 }
259 259
260 spin_lock(&port->lock); 260 spin_lock(&wport->lock);
261 if (port->write_urb_busy) { 261 if (wport->write_urb_busy) {
262 spin_unlock(&port->lock); 262 spin_unlock(&wport->lock);
263 dbg("%s - already writing", __FUNCTION__); 263 dbg("%s - already writing", __FUNCTION__);
264 return 0; 264 return 0;
265 } 265 }
266 port->write_urb_busy = 1; 266 wport->write_urb_busy = 1;
267 spin_unlock(&port->lock); 267 spin_unlock(&wport->lock);
268 268
269 count = (count > OMNINET_BULKOUTSIZE) ? OMNINET_BULKOUTSIZE : count; 269 count = (count > OMNINET_BULKOUTSIZE) ? OMNINET_BULKOUTSIZE : count;
270 270
@@ -283,7 +283,7 @@ static int omninet_write (struct usb_serial_port *port, const unsigned char *buf
283 wport->write_urb->dev = serial->dev; 283 wport->write_urb->dev = serial->dev;
284 result = usb_submit_urb(wport->write_urb, GFP_ATOMIC); 284 result = usb_submit_urb(wport->write_urb, GFP_ATOMIC);
285 if (result) { 285 if (result) {
286 port->write_urb_busy = 0; 286 wport->write_urb_busy = 0;
287 err("%s - failed submitting write urb, error %d", __FUNCTION__, result); 287 err("%s - failed submitting write urb, error %d", __FUNCTION__, result);
288 } else 288 } else
289 result = count; 289 result = count;
diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
index b3014fda645c..c96714bb1cb8 100644
--- a/drivers/usb/serial/pl2303.c
+++ b/drivers/usb/serial/pl2303.c
@@ -61,6 +61,7 @@ static struct usb_device_id id_table [] = {
61 { USB_DEVICE(ELCOM_VENDOR_ID, ELCOM_PRODUCT_ID) }, 61 { USB_DEVICE(ELCOM_VENDOR_ID, ELCOM_PRODUCT_ID) },
62 { USB_DEVICE(ELCOM_VENDOR_ID, ELCOM_PRODUCT_ID_UCSGT) }, 62 { USB_DEVICE(ELCOM_VENDOR_ID, ELCOM_PRODUCT_ID_UCSGT) },
63 { USB_DEVICE(ITEGNO_VENDOR_ID, ITEGNO_PRODUCT_ID) }, 63 { USB_DEVICE(ITEGNO_VENDOR_ID, ITEGNO_PRODUCT_ID) },
64 { USB_DEVICE(ITEGNO_VENDOR_ID, ITEGNO_PRODUCT_ID_2080) },
64 { USB_DEVICE(MA620_VENDOR_ID, MA620_PRODUCT_ID) }, 65 { USB_DEVICE(MA620_VENDOR_ID, MA620_PRODUCT_ID) },
65 { USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID) }, 66 { USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID) },
66 { USB_DEVICE(TRIPP_VENDOR_ID, TRIPP_PRODUCT_ID) }, 67 { USB_DEVICE(TRIPP_VENDOR_ID, TRIPP_PRODUCT_ID) },
@@ -78,6 +79,7 @@ static struct usb_device_id id_table [] = {
78 { USB_DEVICE(SAGEM_VENDOR_ID, SAGEM_PRODUCT_ID) }, 79 { USB_DEVICE(SAGEM_VENDOR_ID, SAGEM_PRODUCT_ID) },
79 { USB_DEVICE(LEADTEK_VENDOR_ID, LEADTEK_9531_PRODUCT_ID) }, 80 { USB_DEVICE(LEADTEK_VENDOR_ID, LEADTEK_9531_PRODUCT_ID) },
80 { USB_DEVICE(SPEEDDRAGON_VENDOR_ID, SPEEDDRAGON_PRODUCT_ID) }, 81 { USB_DEVICE(SPEEDDRAGON_VENDOR_ID, SPEEDDRAGON_PRODUCT_ID) },
82 { USB_DEVICE(OTI_VENDOR_ID, OTI_PRODUCT_ID) },
81 { } /* Terminating entry */ 83 { } /* Terminating entry */
82}; 84};
83 85
diff --git a/drivers/usb/serial/pl2303.h b/drivers/usb/serial/pl2303.h
index 77901d143979..7f29e81d3e35 100644
--- a/drivers/usb/serial/pl2303.h
+++ b/drivers/usb/serial/pl2303.h
@@ -26,6 +26,7 @@
26 26
27#define ITEGNO_VENDOR_ID 0x0eba 27#define ITEGNO_VENDOR_ID 0x0eba
28#define ITEGNO_PRODUCT_ID 0x1080 28#define ITEGNO_PRODUCT_ID 0x1080
29#define ITEGNO_PRODUCT_ID_2080 0x2080
29 30
30#define MA620_VENDOR_ID 0x0df7 31#define MA620_VENDOR_ID 0x0df7
31#define MA620_PRODUCT_ID 0x0620 32#define MA620_PRODUCT_ID 0x0620
@@ -79,3 +80,7 @@
79/* USB GSM cable from Speed Dragon Multimedia, Ltd */ 80/* USB GSM cable from Speed Dragon Multimedia, Ltd */
80#define SPEEDDRAGON_VENDOR_ID 0x0e55 81#define SPEEDDRAGON_VENDOR_ID 0x0e55
81#define SPEEDDRAGON_PRODUCT_ID 0x110b 82#define SPEEDDRAGON_PRODUCT_ID 0x110b
83
84/* Ours Technology Inc DKU-5 clone, chipset: Prolific Technology Inc */
85#define OTI_VENDOR_ID 0x0ea0
86#define OTI_PRODUCT_ID 0x6858
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index 097f4e8488fe..9c36f0ece20f 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -27,10 +27,10 @@
27#include <linux/module.h> 27#include <linux/module.h>
28#include <linux/moduleparam.h> 28#include <linux/moduleparam.h>
29#include <linux/spinlock.h> 29#include <linux/spinlock.h>
30#include <linux/mutex.h>
30#include <linux/list.h> 31#include <linux/list.h>
31#include <linux/smp_lock.h> 32#include <linux/smp_lock.h>
32#include <asm/uaccess.h> 33#include <asm/uaccess.h>
33#include <asm/semaphore.h>
34#include <linux/usb.h> 34#include <linux/usb.h>
35#include "usb-serial.h" 35#include "usb-serial.h"
36#include "pl2303.h" 36#include "pl2303.h"
@@ -189,11 +189,15 @@ static int serial_open (struct tty_struct *tty, struct file * filp)
189 189
190 portNumber = tty->index - serial->minor; 190 portNumber = tty->index - serial->minor;
191 port = serial->port[portNumber]; 191 port = serial->port[portNumber];
192 if (!port) 192 if (!port) {
193 return -ENODEV; 193 retval = -ENODEV;
194 goto bailout_kref_put;
195 }
194 196
195 if (down_interruptible(&port->sem)) 197 if (mutex_lock_interruptible(&port->mutex)) {
196 return -ERESTARTSYS; 198 retval = -ERESTARTSYS;
199 goto bailout_kref_put;
200 }
197 201
198 ++port->open_count; 202 ++port->open_count;
199 203
@@ -209,7 +213,7 @@ static int serial_open (struct tty_struct *tty, struct file * filp)
209 * safe because we are called with BKL held */ 213 * safe because we are called with BKL held */
210 if (!try_module_get(serial->type->driver.owner)) { 214 if (!try_module_get(serial->type->driver.owner)) {
211 retval = -ENODEV; 215 retval = -ENODEV;
212 goto bailout_kref_put; 216 goto bailout_mutex_unlock;
213 } 217 }
214 218
215 /* only call the device specific open if this 219 /* only call the device specific open if this
@@ -219,15 +223,16 @@ static int serial_open (struct tty_struct *tty, struct file * filp)
219 goto bailout_module_put; 223 goto bailout_module_put;
220 } 224 }
221 225
222 up(&port->sem); 226 mutex_unlock(&port->mutex);
223 return 0; 227 return 0;
224 228
225bailout_module_put: 229bailout_module_put:
226 module_put(serial->type->driver.owner); 230 module_put(serial->type->driver.owner);
231bailout_mutex_unlock:
232 port->open_count = 0;
233 mutex_unlock(&port->mutex);
227bailout_kref_put: 234bailout_kref_put:
228 kref_put(&serial->kref, destroy_serial); 235 kref_put(&serial->kref, destroy_serial);
229 port->open_count = 0;
230 up(&port->sem);
231 return retval; 236 return retval;
232} 237}
233 238
@@ -240,10 +245,10 @@ static void serial_close(struct tty_struct *tty, struct file * filp)
240 245
241 dbg("%s - port %d", __FUNCTION__, port->number); 246 dbg("%s - port %d", __FUNCTION__, port->number);
242 247
243 down(&port->sem); 248 mutex_lock(&port->mutex);
244 249
245 if (port->open_count == 0) { 250 if (port->open_count == 0) {
246 up(&port->sem); 251 mutex_unlock(&port->mutex);
247 return; 252 return;
248 } 253 }
249 254
@@ -262,7 +267,7 @@ static void serial_close(struct tty_struct *tty, struct file * filp)
262 module_put(port->serial->type->driver.owner); 267 module_put(port->serial->type->driver.owner);
263 } 268 }
264 269
265 up(&port->sem); 270 mutex_unlock(&port->mutex);
266 kref_put(&port->serial->kref, destroy_serial); 271 kref_put(&port->serial->kref, destroy_serial);
267} 272}
268 273
@@ -783,7 +788,7 @@ int usb_serial_probe(struct usb_interface *interface,
783 port->number = i + serial->minor; 788 port->number = i + serial->minor;
784 port->serial = serial; 789 port->serial = serial;
785 spin_lock_init(&port->lock); 790 spin_lock_init(&port->lock);
786 sema_init(&port->sem, 1); 791 mutex_init(&port->mutex);
787 INIT_WORK(&port->work, usb_serial_port_softint, port); 792 INIT_WORK(&port->work, usb_serial_port_softint, port);
788 serial->port[i] = port; 793 serial->port[i] = port;
789 } 794 }
diff --git a/drivers/usb/serial/usb-serial.h b/drivers/usb/serial/usb-serial.h
index d7d27c3385b3..dc89d8710460 100644
--- a/drivers/usb/serial/usb-serial.h
+++ b/drivers/usb/serial/usb-serial.h
@@ -16,7 +16,7 @@
16 16
17#include <linux/config.h> 17#include <linux/config.h>
18#include <linux/kref.h> 18#include <linux/kref.h>
19#include <asm/semaphore.h> 19#include <linux/mutex.h>
20 20
21#define SERIAL_TTY_MAJOR 188 /* Nice legal number now */ 21#define SERIAL_TTY_MAJOR 188 /* Nice legal number now */
22#define SERIAL_TTY_MINORS 255 /* loads of devices :) */ 22#define SERIAL_TTY_MINORS 255 /* loads of devices :) */
@@ -31,7 +31,7 @@
31 * @serial: pointer back to the struct usb_serial owner of this port. 31 * @serial: pointer back to the struct usb_serial owner of this port.
32 * @tty: pointer to the corresponding tty for this port. 32 * @tty: pointer to the corresponding tty for this port.
33 * @lock: spinlock to grab when updating portions of this structure. 33 * @lock: spinlock to grab when updating portions of this structure.
34 * @sem: semaphore used to synchronize serial_open() and serial_close() 34 * @mutex: mutex used to synchronize serial_open() and serial_close()
35 * access for this port. 35 * access for this port.
36 * @number: the number of the port (the minor number). 36 * @number: the number of the port (the minor number).
37 * @interrupt_in_buffer: pointer to the interrupt in buffer for this port. 37 * @interrupt_in_buffer: pointer to the interrupt in buffer for this port.
@@ -63,7 +63,7 @@ struct usb_serial_port {
63 struct usb_serial * serial; 63 struct usb_serial * serial;
64 struct tty_struct * tty; 64 struct tty_struct * tty;
65 spinlock_t lock; 65 spinlock_t lock;
66 struct semaphore sem; 66 struct mutex mutex;
67 unsigned char number; 67 unsigned char number;
68 68
69 unsigned char * interrupt_in_buffer; 69 unsigned char * interrupt_in_buffer;
diff --git a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c
index 557411c6e7c7..f806553cd9a4 100644
--- a/drivers/usb/serial/whiteheat.c
+++ b/drivers/usb/serial/whiteheat.c
@@ -508,6 +508,7 @@ no_firmware:
508 err("%s: Unable to retrieve firmware version, try replugging\n", serial->type->description); 508 err("%s: Unable to retrieve firmware version, try replugging\n", serial->type->description);
509 err("%s: If the firmware is not running (status led not blinking)\n", serial->type->description); 509 err("%s: If the firmware is not running (status led not blinking)\n", serial->type->description);
510 err("%s: please contact support@connecttech.com\n", serial->type->description); 510 err("%s: please contact support@connecttech.com\n", serial->type->description);
511 kfree(result);
511 return -ENODEV; 512 return -ENODEV;
512 513
513no_command_private: 514no_command_private:
diff --git a/drivers/usb/storage/Kconfig b/drivers/usb/storage/Kconfig
index 92be101feba7..be9eec225743 100644
--- a/drivers/usb/storage/Kconfig
+++ b/drivers/usb/storage/Kconfig
@@ -48,7 +48,8 @@ config USB_STORAGE_FREECOM
48 48
49config USB_STORAGE_ISD200 49config USB_STORAGE_ISD200
50 bool "ISD-200 USB/ATA Bridge support" 50 bool "ISD-200 USB/ATA Bridge support"
51 depends on USB_STORAGE && BLK_DEV_IDE 51 depends on USB_STORAGE
52 depends on BLK_DEV_IDE=y || BLK_DEV_IDE=USB_STORAGE
52 ---help--- 53 ---help---
53 Say Y here if you want to use USB Mass Store devices based 54 Say Y here if you want to use USB Mass Store devices based
54 on the In-Systems Design ISD-200 USB/ATA bridge. 55 on the In-Systems Design ISD-200 USB/ATA bridge.
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
index c4a9dcff5f2b..aec5ea8682d5 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -411,7 +411,7 @@ UNUSUAL_DEV( 0x050d, 0x0115, 0x0133, 0x0133,
411UNUSUAL_DEV( 0x0525, 0xa140, 0x0100, 0x0100, 411UNUSUAL_DEV( 0x0525, 0xa140, 0x0100, 0x0100,
412 "Iomega", 412 "Iomega",
413 "USB Clik! 40", 413 "USB Clik! 40",
414 US_SC_8070, US_PR_BULK, NULL, 414 US_SC_8070, US_PR_DEVICE, NULL,
415 US_FL_FIX_INQUIRY ), 415 US_FL_FIX_INQUIRY ),
416 416
417/* Yakumo Mega Image 37 417/* Yakumo Mega Image 37
@@ -773,6 +773,13 @@ UNUSUAL_DEV( 0x069b, 0x3004, 0x0001, 0x0001,
773 US_SC_DEVICE, US_PR_DEVICE, NULL, 773 US_SC_DEVICE, US_PR_DEVICE, NULL,
774 US_FL_FIX_CAPACITY ), 774 US_FL_FIX_CAPACITY ),
775 775
776/* Reported by Olivier Blondeau <zeitoun@gmail.com> */
777UNUSUAL_DEV( 0x0727, 0x0306, 0x0100, 0x0100,
778 "ATMEL",
779 "SND1 Storage",
780 US_SC_DEVICE, US_PR_DEVICE, NULL,
781 US_FL_IGNORE_RESIDUE),
782
776/* Submitted by Roman Hodek <roman@hodek.net> */ 783/* Submitted by Roman Hodek <roman@hodek.net> */
777UNUSUAL_DEV( 0x0781, 0x0001, 0x0200, 0x0200, 784UNUSUAL_DEV( 0x0781, 0x0001, 0x0200, 0x0200,
778 "Sandisk", 785 "Sandisk",
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 9060e7137441..4587087d777a 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -400,6 +400,8 @@ config FB_ASILIANT
400 select FB_CFB_FILLRECT 400 select FB_CFB_FILLRECT
401 select FB_CFB_COPYAREA 401 select FB_CFB_COPYAREA
402 select FB_CFB_IMAGEBLIT 402 select FB_CFB_IMAGEBLIT
403 help
404 This is the frame buffer device driver for the Asiliant 69030 chipset
403 405
404config FB_IMSTT 406config FB_IMSTT
405 bool "IMS Twin Turbo display support" 407 bool "IMS Twin Turbo display support"
diff --git a/drivers/video/aty/radeon_base.c b/drivers/video/aty/radeon_base.c
index 9a6b5b39b88e..387a18a47ac2 100644
--- a/drivers/video/aty/radeon_base.c
+++ b/drivers/video/aty/radeon_base.c
@@ -2265,7 +2265,7 @@ static struct bin_attribute edid2_attr = {
2265}; 2265};
2266 2266
2267 2267
2268static int radeonfb_pci_register (struct pci_dev *pdev, 2268static int __devinit radeonfb_pci_register (struct pci_dev *pdev,
2269 const struct pci_device_id *ent) 2269 const struct pci_device_id *ent)
2270{ 2270{
2271 struct fb_info *info; 2271 struct fb_info *info;
diff --git a/drivers/video/au1100fb.c b/drivers/video/au1100fb.c
index 3d04b2def0f1..789450bb0bc9 100644
--- a/drivers/video/au1100fb.c
+++ b/drivers/video/au1100fb.c
@@ -214,10 +214,13 @@ int au1100fb_setmode(struct au1100fb_device *fbdev)
214 */ 214 */
215int au1100fb_fb_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned blue, unsigned transp, struct fb_info *fbi) 215int au1100fb_fb_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned blue, unsigned transp, struct fb_info *fbi)
216{ 216{
217 struct au1100fb_device *fbdev = to_au1100fb_device(fbi); 217 struct au1100fb_device *fbdev;
218 u32 *palette = fbdev->regs->lcd_pallettebase; 218 u32 *palette;
219 u32 value; 219 u32 value;
220 220
221 fbdev = to_au1100fb_device(fbi);
222 palette = fbdev->regs->lcd_pallettebase;
223
221 if (regno > (AU1100_LCD_NBR_PALETTE_ENTRIES - 1)) 224 if (regno > (AU1100_LCD_NBR_PALETTE_ENTRIES - 1))
222 return -EINVAL; 225 return -EINVAL;
223 226
@@ -316,9 +319,11 @@ int au1100fb_fb_blank(int blank_mode, struct fb_info *fbi)
316 */ 319 */
317int au1100fb_fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *fbi) 320int au1100fb_fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *fbi)
318{ 321{
319 struct au1100fb_device *fbdev = to_au1100fb_device(fbi); 322 struct au1100fb_device *fbdev;
320 int dy; 323 int dy;
321 324
325 fbdev = to_au1100fb_device(fbi);
326
322 print_dbg("fb_pan_display %p %p", var, fbi); 327 print_dbg("fb_pan_display %p %p", var, fbi);
323 328
324 if (!var || !fbdev) { 329 if (!var || !fbdev) {
@@ -382,10 +387,12 @@ void au1100fb_fb_rotate(struct fb_info *fbi, int angle)
382 */ 387 */
383int au1100fb_fb_mmap(struct fb_info *fbi, struct vm_area_struct *vma) 388int au1100fb_fb_mmap(struct fb_info *fbi, struct vm_area_struct *vma)
384{ 389{
385 struct au1100fb_device *fbdev = to_au1100fb_device(fbi); 390 struct au1100fb_device *fbdev;
386 unsigned int len; 391 unsigned int len;
387 unsigned long start=0, off; 392 unsigned long start=0, off;
388 393
394 fbdev = to_au1100fb_device(fbi);
395
389 if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT)) { 396 if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT)) {
390 return -EINVAL; 397 return -EINVAL;
391 } 398 }
@@ -467,7 +474,7 @@ int au1100fb_drv_probe(struct device *dev)
467 474
468 if (!request_mem_region(au1100fb_fix.mmio_start, au1100fb_fix.mmio_len, 475 if (!request_mem_region(au1100fb_fix.mmio_start, au1100fb_fix.mmio_len,
469 DRIVER_NAME)) { 476 DRIVER_NAME)) {
470 print_err("fail to lock memory region at 0x%08x", 477 print_err("fail to lock memory region at 0x%08lx",
471 au1100fb_fix.mmio_start); 478 au1100fb_fix.mmio_start);
472 return -EBUSY; 479 return -EBUSY;
473 } 480 }
@@ -595,13 +602,13 @@ int au1100fb_drv_remove(struct device *dev)
595 return 0; 602 return 0;
596} 603}
597 604
598int au1100fb_drv_suspend(struct device *dev, u32 state, u32 level) 605int au1100fb_drv_suspend(struct device *dev, pm_message_t state)
599{ 606{
600 /* TODO */ 607 /* TODO */
601 return 0; 608 return 0;
602} 609}
603 610
604int au1100fb_drv_resume(struct device *dev, u32 level) 611int au1100fb_drv_resume(struct device *dev)
605{ 612{
606 /* TODO */ 613 /* TODO */
607 return 0; 614 return 0;
diff --git a/drivers/video/au1200fb.c b/drivers/video/au1200fb.c
index b367de30b98c..600d3e0e08b7 100644
--- a/drivers/video/au1200fb.c
+++ b/drivers/video/au1200fb.c
@@ -1920,1925 +1920,3 @@ module_exit(au1200fb_cleanup);
1920 1920
1921MODULE_DESCRIPTION(DRIVER_DESC); 1921MODULE_DESCRIPTION(DRIVER_DESC);
1922MODULE_LICENSE("GPL"); 1922MODULE_LICENSE("GPL");
1923/*
1924 * BRIEF MODULE DESCRIPTION
1925 * Au1200 LCD Driver.
1926 *
1927 * Copyright 2004-2005 AMD
1928 * Author: AMD
1929 *
1930 * Based on:
1931 * linux/drivers/video/skeletonfb.c -- Skeleton for a frame buffer device
1932 * Created 28 Dec 1997 by Geert Uytterhoeven
1933 *
1934 * This program is free software; you can redistribute it and/or modify it
1935 * under the terms of the GNU General Public License as published by the
1936 * Free Software Foundation; either version 2 of the License, or (at your
1937 * option) any later version.
1938 *
1939 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
1940 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
1941 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
1942 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
1943 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
1944 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
1945 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
1946 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1947 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
1948 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1949 *
1950 * You should have received a copy of the GNU General Public License along
1951 * with this program; if not, write to the Free Software Foundation, Inc.,
1952 * 675 Mass Ave, Cambridge, MA 02139, USA.
1953 */
1954
1955#include <linux/module.h>
1956#include <linux/platform_device.h>
1957#include <linux/kernel.h>
1958#include <linux/errno.h>
1959#include <linux/string.h>
1960#include <linux/mm.h>
1961#include <linux/fb.h>
1962#include <linux/init.h>
1963#include <linux/interrupt.h>
1964#include <linux/ctype.h>
1965#include <linux/dma-mapping.h>
1966
1967#include <asm/mach-au1x00/au1000.h>
1968#include "au1200fb.h"
1969
1970#ifdef CONFIG_PM
1971#include <asm/mach-au1x00/au1xxx_pm.h>
1972#endif
1973
1974#ifndef CONFIG_FB_AU1200_DEVS
1975#define CONFIG_FB_AU1200_DEVS 4
1976#endif
1977
1978#define DRIVER_NAME "au1200fb"
1979#define DRIVER_DESC "LCD controller driver for AU1200 processors"
1980
1981#define DEBUG 1
1982
1983#define print_err(f, arg...) printk(KERN_ERR DRIVER_NAME ": " f "\n", ## arg)
1984#define print_warn(f, arg...) printk(KERN_WARNING DRIVER_NAME ": " f "\n", ## arg)
1985#define print_info(f, arg...) printk(KERN_INFO DRIVER_NAME ": " f "\n", ## arg)
1986
1987#if DEBUG
1988#define print_dbg(f, arg...) printk(KERN_DEBUG __FILE__ ": " f "\n", ## arg)
1989#else
1990#define print_dbg(f, arg...) do {} while (0)
1991#endif
1992
1993
1994#define AU1200_LCD_FB_IOCTL 0x46FF
1995
1996#define AU1200_LCD_SET_SCREEN 1
1997#define AU1200_LCD_GET_SCREEN 2
1998#define AU1200_LCD_SET_WINDOW 3
1999#define AU1200_LCD_GET_WINDOW 4
2000#define AU1200_LCD_SET_PANEL 5
2001#define AU1200_LCD_GET_PANEL 6
2002
2003#define SCREEN_SIZE (1<< 1)
2004#define SCREEN_BACKCOLOR (1<< 2)
2005#define SCREEN_BRIGHTNESS (1<< 3)
2006#define SCREEN_COLORKEY (1<< 4)
2007#define SCREEN_MASK (1<< 5)
2008
2009struct au1200_lcd_global_regs_t {
2010 unsigned int flags;
2011 unsigned int xsize;
2012 unsigned int ysize;
2013 unsigned int backcolor;
2014 unsigned int brightness;
2015 unsigned int colorkey;
2016 unsigned int mask;
2017 unsigned int panel_choice;
2018 char panel_desc[80];
2019
2020};
2021
2022#define WIN_POSITION (1<< 0)
2023#define WIN_ALPHA_COLOR (1<< 1)
2024#define WIN_ALPHA_MODE (1<< 2)
2025#define WIN_PRIORITY (1<< 3)
2026#define WIN_CHANNEL (1<< 4)
2027#define WIN_BUFFER_FORMAT (1<< 5)
2028#define WIN_COLOR_ORDER (1<< 6)
2029#define WIN_PIXEL_ORDER (1<< 7)
2030#define WIN_SIZE (1<< 8)
2031#define WIN_COLORKEY_MODE (1<< 9)
2032#define WIN_DOUBLE_BUFFER_MODE (1<< 10)
2033#define WIN_RAM_ARRAY_MODE (1<< 11)
2034#define WIN_BUFFER_SCALE (1<< 12)
2035#define WIN_ENABLE (1<< 13)
2036
2037struct au1200_lcd_window_regs_t {
2038 unsigned int flags;
2039 unsigned int xpos;
2040 unsigned int ypos;
2041 unsigned int alpha_color;
2042 unsigned int alpha_mode;
2043 unsigned int priority;
2044 unsigned int channel;
2045 unsigned int buffer_format;
2046 unsigned int color_order;
2047 unsigned int pixel_order;
2048 unsigned int xsize;
2049 unsigned int ysize;
2050 unsigned int colorkey_mode;
2051 unsigned int double_buffer_mode;
2052 unsigned int ram_array_mode;
2053 unsigned int xscale;
2054 unsigned int yscale;
2055 unsigned int enable;
2056};
2057
2058
2059struct au1200_lcd_iodata_t {
2060 unsigned int subcmd;
2061 struct au1200_lcd_global_regs_t global;
2062 struct au1200_lcd_window_regs_t window;
2063};
2064
2065#if defined(__BIG_ENDIAN)
2066#define LCD_CONTROL_DEFAULT_PO LCD_CONTROL_PO_11
2067#else
2068#define LCD_CONTROL_DEFAULT_PO LCD_CONTROL_PO_00
2069#endif
2070#define LCD_CONTROL_DEFAULT_SBPPF LCD_CONTROL_SBPPF_565
2071
2072/* Private, per-framebuffer management information (independent of the panel itself) */
2073struct au1200fb_device {
2074 struct fb_info fb_info; /* FB driver info record */
2075
2076 int plane;
2077 unsigned char* fb_mem; /* FrameBuffer memory map */
2078 unsigned int fb_len;
2079 dma_addr_t fb_phys;
2080};
2081
2082static struct au1200fb_device _au1200fb_devices[CONFIG_FB_AU1200_DEVS];
2083/********************************************************************/
2084
2085/* LCD controller restrictions */
2086#define AU1200_LCD_MAX_XRES 1280
2087#define AU1200_LCD_MAX_YRES 1024
2088#define AU1200_LCD_MAX_BPP 32
2089#define AU1200_LCD_MAX_CLK 96000000 /* fixme: this needs to go away ? */
2090#define AU1200_LCD_NBR_PALETTE_ENTRIES 256
2091
2092/* Default number of visible screen buffer to allocate */
2093#define AU1200FB_NBR_VIDEO_BUFFERS 1
2094
2095/********************************************************************/
2096
2097static struct au1200_lcd *lcd = (struct au1200_lcd *) AU1200_LCD_ADDR;
2098static int window_index = 2; /* default is zero */
2099static int panel_index = 2; /* default is zero */
2100static struct window_settings *win;
2101static struct panel_settings *panel;
2102static int noblanking = 1;
2103static int nohwcursor = 0;
2104
2105struct window_settings {
2106 unsigned char name[64];
2107 uint32 mode_backcolor;
2108 uint32 mode_colorkey;
2109 uint32 mode_colorkeymsk;
2110 struct {
2111 int xres;
2112 int yres;
2113 int xpos;
2114 int ypos;
2115 uint32 mode_winctrl1; /* winctrl1[FRM,CCO,PO,PIPE] */
2116 uint32 mode_winenable;
2117 } w[4];
2118};
2119
2120#if defined(__BIG_ENDIAN)
2121#define LCD_WINCTRL1_PO_16BPP LCD_WINCTRL1_PO_00
2122#else
2123#define LCD_WINCTRL1_PO_16BPP LCD_WINCTRL1_PO_01
2124#endif
2125
2126extern int board_au1200fb_panel_init (void);
2127extern int board_au1200fb_panel_shutdown (void);
2128
2129#ifdef CONFIG_PM
2130int au1200fb_pm_callback(au1xxx_power_dev_t *dev,
2131 au1xxx_request_t request, void *data);
2132au1xxx_power_dev_t *LCD_pm_dev;
2133#endif
2134
2135/*
2136 * Default window configurations
2137 */
2138static struct window_settings windows[] = {
2139 { /* Index 0 */
2140 "0-FS gfx, 1-video, 2-ovly gfx, 3-ovly gfx",
2141 /* mode_backcolor */ 0x006600ff,
2142 /* mode_colorkey,msk*/ 0, 0,
2143 {
2144 {
2145 /* xres, yres, xpos, ypos */ 0, 0, 0, 0,
2146 /* mode_winctrl1 */ LCD_WINCTRL1_FRM_16BPP565 |
2147 LCD_WINCTRL1_PO_16BPP,
2148 /* mode_winenable*/ LCD_WINENABLE_WEN0,
2149 },
2150 {
2151 /* xres, yres, xpos, ypos */ 100, 100, 100, 100,
2152 /* mode_winctrl1 */ LCD_WINCTRL1_FRM_16BPP565 |
2153 LCD_WINCTRL1_PO_16BPP |
2154 LCD_WINCTRL1_PIPE,
2155 /* mode_winenable*/ LCD_WINENABLE_WEN1,
2156 },
2157 {
2158 /* xres, yres, xpos, ypos */ 0, 0, 0, 0,
2159 /* mode_winctrl1 */ LCD_WINCTRL1_FRM_16BPP565 |
2160 LCD_WINCTRL1_PO_16BPP,
2161 /* mode_winenable*/ 0,
2162 },
2163 {
2164 /* xres, yres, xpos, ypos */ 0, 0, 0, 0,
2165 /* mode_winctrl1 */ LCD_WINCTRL1_FRM_16BPP565 |
2166 LCD_WINCTRL1_PO_16BPP |
2167 LCD_WINCTRL1_PIPE,
2168 /* mode_winenable*/ 0,
2169 },
2170 },
2171 },
2172
2173 { /* Index 1 */
2174 "0-FS gfx, 1-video, 2-ovly gfx, 3-ovly gfx",
2175 /* mode_backcolor */ 0x006600ff,
2176 /* mode_colorkey,msk*/ 0, 0,
2177 {
2178 {
2179 /* xres, yres, xpos, ypos */ 320, 240, 5, 5,
2180 /* mode_winctrl1 */ LCD_WINCTRL1_FRM_24BPP |
2181 LCD_WINCTRL1_PO_00,
2182 /* mode_winenable*/ LCD_WINENABLE_WEN0,
2183 },
2184 {
2185 /* xres, yres, xpos, ypos */ 0, 0, 0, 0,
2186 /* mode_winctrl1 */ LCD_WINCTRL1_FRM_16BPP565
2187 | LCD_WINCTRL1_PO_16BPP,
2188 /* mode_winenable*/ 0,
2189 },
2190 {
2191 /* xres, yres, xpos, ypos */ 100, 100, 0, 0,
2192 /* mode_winctrl1 */ LCD_WINCTRL1_FRM_16BPP565 |
2193 LCD_WINCTRL1_PO_16BPP |
2194 LCD_WINCTRL1_PIPE,
2195 /* mode_winenable*/ 0/*LCD_WINENABLE_WEN2*/,
2196 },
2197 {
2198 /* xres, yres, xpos, ypos */ 200, 25, 0, 0,
2199 /* mode_winctrl1 */ LCD_WINCTRL1_FRM_16BPP565 |
2200 LCD_WINCTRL1_PO_16BPP |
2201 LCD_WINCTRL1_PIPE,
2202 /* mode_winenable*/ 0,
2203 },
2204 },
2205 },
2206 { /* Index 2 */
2207 "0-FS gfx, 1-video, 2-ovly gfx, 3-ovly gfx",
2208 /* mode_backcolor */ 0x006600ff,
2209 /* mode_colorkey,msk*/ 0, 0,
2210 {
2211 {
2212 /* xres, yres, xpos, ypos */ 0, 0, 0, 0,
2213 /* mode_winctrl1 */ LCD_WINCTRL1_FRM_16BPP565 |
2214 LCD_WINCTRL1_PO_16BPP,
2215 /* mode_winenable*/ LCD_WINENABLE_WEN0,
2216 },
2217 {
2218 /* xres, yres, xpos, ypos */ 0, 0, 0, 0,
2219 /* mode_winctrl1 */ LCD_WINCTRL1_FRM_16BPP565 |
2220 LCD_WINCTRL1_PO_16BPP,
2221 /* mode_winenable*/ 0,
2222 },
2223 {
2224 /* xres, yres, xpos, ypos */ 0, 0, 0, 0,
2225 /* mode_winctrl1 */ LCD_WINCTRL1_FRM_32BPP |
2226 LCD_WINCTRL1_PO_00|LCD_WINCTRL1_PIPE,
2227 /* mode_winenable*/ 0/*LCD_WINENABLE_WEN2*/,
2228 },
2229 {
2230 /* xres, yres, xpos, ypos */ 0, 0, 0, 0,
2231 /* mode_winctrl1 */ LCD_WINCTRL1_FRM_16BPP565 |
2232 LCD_WINCTRL1_PO_16BPP |
2233 LCD_WINCTRL1_PIPE,
2234 /* mode_winenable*/ 0,
2235 },
2236 },
2237 },
2238 /* Need VGA 640 @ 24bpp, @ 32bpp */
2239 /* Need VGA 800 @ 24bpp, @ 32bpp */
2240 /* Need VGA 1024 @ 24bpp, @ 32bpp */
2241};
2242
2243/*
2244 * Controller configurations for various panels.
2245 */
2246
2247struct panel_settings
2248{
2249 const char name[25]; /* Full name <vendor>_<model> */
2250
2251 struct fb_monspecs monspecs; /* FB monitor specs */
2252
2253 /* panel timings */
2254 uint32 mode_screen;
2255 uint32 mode_horztiming;
2256 uint32 mode_verttiming;
2257 uint32 mode_clkcontrol;
2258 uint32 mode_pwmdiv;
2259 uint32 mode_pwmhi;
2260 uint32 mode_outmask;
2261 uint32 mode_fifoctrl;
2262 uint32 mode_toyclksrc;
2263 uint32 mode_backlight;
2264 uint32 mode_auxpll;
2265 int (*device_init)(void);
2266 int (*device_shutdown)(void);
2267#define Xres min_xres
2268#define Yres min_yres
2269 u32 min_xres; /* Minimum horizontal resolution */
2270 u32 max_xres; /* Maximum horizontal resolution */
2271 u32 min_yres; /* Minimum vertical resolution */
2272 u32 max_yres; /* Maximum vertical resolution */
2273};
2274
2275/********************************************************************/
2276/* fixme: Maybe a modedb for the CRT ? otherwise panels should be as-is */
2277
2278/* List of panels known to work with the AU1200 LCD controller.
2279 * To add a new panel, enter the same specifications as the
2280 * Generic_TFT one, and MAKE SURE that it doesn't conflicts
2281 * with the controller restrictions. Restrictions are:
2282 *
2283 * STN color panels: max_bpp <= 12
2284 * STN mono panels: max_bpp <= 4
2285 * TFT panels: max_bpp <= 16
2286 * max_xres <= 800
2287 * max_yres <= 600
2288 */
2289static struct panel_settings known_lcd_panels[] =
2290{
2291 [0] = { /* QVGA 320x240 H:33.3kHz V:110Hz */
2292 .name = "QVGA_320x240",
2293 .monspecs = {
2294 .modedb = NULL,
2295 .modedb_len = 0,
2296 .hfmin = 30000,
2297 .hfmax = 70000,
2298 .vfmin = 60,
2299 .vfmax = 60,
2300 .dclkmin = 6000000,
2301 .dclkmax = 28000000,
2302 .input = FB_DISP_RGB,
2303 },
2304 .mode_screen = LCD_SCREEN_SX_N(320) |
2305 LCD_SCREEN_SY_N(240),
2306 .mode_horztiming = 0x00c4623b,
2307 .mode_verttiming = 0x00502814,
2308 .mode_clkcontrol = 0x00020002, /* /4=24Mhz */
2309 .mode_pwmdiv = 0x00000000,
2310 .mode_pwmhi = 0x00000000,
2311 .mode_outmask = 0x00FFFFFF,
2312 .mode_fifoctrl = 0x2f2f2f2f,
2313 .mode_toyclksrc = 0x00000004, /* AUXPLL directly */
2314 .mode_backlight = 0x00000000,
2315 .mode_auxpll = 8, /* 96MHz AUXPLL */
2316 .device_init = NULL,
2317 .device_shutdown = NULL,
2318 320, 320,
2319 240, 240,
2320 },
2321
2322 [1] = { /* VGA 640x480 H:30.3kHz V:58Hz */
2323 .name = "VGA_640x480",
2324 .monspecs = {
2325 .modedb = NULL,
2326 .modedb_len = 0,
2327 .hfmin = 30000,
2328 .hfmax = 70000,
2329 .vfmin = 60,
2330 .vfmax = 60,
2331 .dclkmin = 6000000,
2332 .dclkmax = 28000000,
2333 .input = FB_DISP_RGB,
2334 },
2335 .mode_screen = 0x13f9df80,
2336 .mode_horztiming = 0x003c5859,
2337 .mode_verttiming = 0x00741201,
2338 .mode_clkcontrol = 0x00020001, /* /4=24Mhz */
2339 .mode_pwmdiv = 0x00000000,
2340 .mode_pwmhi = 0x00000000,
2341 .mode_outmask = 0x00FFFFFF,
2342 .mode_fifoctrl = 0x2f2f2f2f,
2343 .mode_toyclksrc = 0x00000004, /* AUXPLL directly */
2344 .mode_backlight = 0x00000000,
2345 .mode_auxpll = 8, /* 96MHz AUXPLL */
2346 .device_init = NULL,
2347 .device_shutdown = NULL,
2348 640, 480,
2349 640, 480,
2350 },
2351
2352 [2] = { /* SVGA 800x600 H:46.1kHz V:69Hz */
2353 .name = "SVGA_800x600",
2354 .monspecs = {
2355 .modedb = NULL,
2356 .modedb_len = 0,
2357 .hfmin = 30000,
2358 .hfmax = 70000,
2359 .vfmin = 60,
2360 .vfmax = 60,
2361 .dclkmin = 6000000,
2362 .dclkmax = 28000000,
2363 .input = FB_DISP_RGB,
2364 },
2365 .mode_screen = 0x18fa5780,
2366 .mode_horztiming = 0x00dc7e77,
2367 .mode_verttiming = 0x00584805,
2368 .mode_clkcontrol = 0x00020000, /* /2=48Mhz */
2369 .mode_pwmdiv = 0x00000000,
2370 .mode_pwmhi = 0x00000000,
2371 .mode_outmask = 0x00FFFFFF,
2372 .mode_fifoctrl = 0x2f2f2f2f,
2373 .mode_toyclksrc = 0x00000004, /* AUXPLL directly */
2374 .mode_backlight = 0x00000000,
2375 .mode_auxpll = 8, /* 96MHz AUXPLL */
2376 .device_init = NULL,
2377 .device_shutdown = NULL,
2378 800, 800,
2379 600, 600,
2380 },
2381
2382 [3] = { /* XVGA 1024x768 H:56.2kHz V:70Hz */
2383 .name = "XVGA_1024x768",
2384 .monspecs = {
2385 .modedb = NULL,
2386 .modedb_len = 0,
2387 .hfmin = 30000,
2388 .hfmax = 70000,
2389 .vfmin = 60,
2390 .vfmax = 60,
2391 .dclkmin = 6000000,
2392 .dclkmax = 28000000,
2393 .input = FB_DISP_RGB,
2394 },
2395 .mode_screen = 0x1ffaff80,
2396 .mode_horztiming = 0x007d0e57,
2397 .mode_verttiming = 0x00740a01,
2398 .mode_clkcontrol = 0x000A0000, /* /1 */
2399 .mode_pwmdiv = 0x00000000,
2400 .mode_pwmhi = 0x00000000,
2401 .mode_outmask = 0x00FFFFFF,
2402 .mode_fifoctrl = 0x2f2f2f2f,
2403 .mode_toyclksrc = 0x00000004, /* AUXPLL directly */
2404 .mode_backlight = 0x00000000,
2405 .mode_auxpll = 6, /* 72MHz AUXPLL */
2406 .device_init = NULL,
2407 .device_shutdown = NULL,
2408 1024, 1024,
2409 768, 768,
2410 },
2411
2412 [4] = { /* XVGA XVGA 1280x1024 H:68.5kHz V:65Hz */
2413 .name = "XVGA_1280x1024",
2414 .monspecs = {
2415 .modedb = NULL,
2416 .modedb_len = 0,
2417 .hfmin = 30000,
2418 .hfmax = 70000,
2419 .vfmin = 60,
2420 .vfmax = 60,
2421 .dclkmin = 6000000,
2422 .dclkmax = 28000000,
2423 .input = FB_DISP_RGB,
2424 },
2425 .mode_screen = 0x27fbff80,
2426 .mode_horztiming = 0x00cdb2c7,
2427 .mode_verttiming = 0x00600002,
2428 .mode_clkcontrol = 0x000A0000, /* /1 */
2429 .mode_pwmdiv = 0x00000000,
2430 .mode_pwmhi = 0x00000000,
2431 .mode_outmask = 0x00FFFFFF,
2432 .mode_fifoctrl = 0x2f2f2f2f,
2433 .mode_toyclksrc = 0x00000004, /* AUXPLL directly */
2434 .mode_backlight = 0x00000000,
2435 .mode_auxpll = 10, /* 120MHz AUXPLL */
2436 .device_init = NULL,
2437 .device_shutdown = NULL,
2438 1280, 1280,
2439 1024, 1024,
2440 },
2441
2442 [5] = { /* Samsung 1024x768 TFT */
2443 .name = "Samsung_1024x768_TFT",
2444 .monspecs = {
2445 .modedb = NULL,
2446 .modedb_len = 0,
2447 .hfmin = 30000,
2448 .hfmax = 70000,
2449 .vfmin = 60,
2450 .vfmax = 60,
2451 .dclkmin = 6000000,
2452 .dclkmax = 28000000,
2453 .input = FB_DISP_RGB,
2454 },
2455 .mode_screen = 0x1ffaff80,
2456 .mode_horztiming = 0x018cc677,
2457 .mode_verttiming = 0x00241217,
2458 .mode_clkcontrol = 0x00000000, /* SCB 0x1 /4=24Mhz */
2459 .mode_pwmdiv = 0x8000063f, /* SCB 0x0 */
2460 .mode_pwmhi = 0x03400000, /* SCB 0x0 */
2461 .mode_outmask = 0x00FFFFFF,
2462 .mode_fifoctrl = 0x2f2f2f2f,
2463 .mode_toyclksrc = 0x00000004, /* AUXPLL directly */
2464 .mode_backlight = 0x00000000,
2465 .mode_auxpll = 8, /* 96MHz AUXPLL */
2466 .device_init = board_au1200fb_panel_init,
2467 .device_shutdown = board_au1200fb_panel_shutdown,
2468 1024, 1024,
2469 768, 768,
2470 },
2471
2472 [6] = { /* Toshiba 640x480 TFT */
2473 .name = "Toshiba_640x480_TFT",
2474 .monspecs = {
2475 .modedb = NULL,
2476 .modedb_len = 0,
2477 .hfmin = 30000,
2478 .hfmax = 70000,
2479 .vfmin = 60,
2480 .vfmax = 60,
2481 .dclkmin = 6000000,
2482 .dclkmax = 28000000,
2483 .input = FB_DISP_RGB,
2484 },
2485 .mode_screen = LCD_SCREEN_SX_N(640) |
2486 LCD_SCREEN_SY_N(480),
2487 .mode_horztiming = LCD_HORZTIMING_HPW_N(96) |
2488 LCD_HORZTIMING_HND1_N(13) | LCD_HORZTIMING_HND2_N(51),
2489 .mode_verttiming = LCD_VERTTIMING_VPW_N(2) |
2490 LCD_VERTTIMING_VND1_N(11) | LCD_VERTTIMING_VND2_N(32),
2491 .mode_clkcontrol = 0x00000000, /* /4=24Mhz */
2492 .mode_pwmdiv = 0x8000063f,
2493 .mode_pwmhi = 0x03400000,
2494 .mode_outmask = 0x00fcfcfc,
2495 .mode_fifoctrl = 0x2f2f2f2f,
2496 .mode_toyclksrc = 0x00000004, /* AUXPLL directly */
2497 .mode_backlight = 0x00000000,
2498 .mode_auxpll = 8, /* 96MHz AUXPLL */
2499 .device_init = board_au1200fb_panel_init,
2500 .device_shutdown = board_au1200fb_panel_shutdown,
2501 640, 480,
2502 640, 480,
2503 },
2504
2505 [7] = { /* Sharp 320x240 TFT */
2506 .name = "Sharp_320x240_TFT",
2507 .monspecs = {
2508 .modedb = NULL,
2509 .modedb_len = 0,
2510 .hfmin = 12500,
2511 .hfmax = 20000,
2512 .vfmin = 38,
2513 .vfmax = 81,
2514 .dclkmin = 4500000,
2515 .dclkmax = 6800000,
2516 .input = FB_DISP_RGB,
2517 },
2518 .mode_screen = LCD_SCREEN_SX_N(320) |
2519 LCD_SCREEN_SY_N(240),
2520 .mode_horztiming = LCD_HORZTIMING_HPW_N(60) |
2521 LCD_HORZTIMING_HND1_N(13) | LCD_HORZTIMING_HND2_N(2),
2522 .mode_verttiming = LCD_VERTTIMING_VPW_N(2) |
2523 LCD_VERTTIMING_VND1_N(2) | LCD_VERTTIMING_VND2_N(5),
2524 .mode_clkcontrol = LCD_CLKCONTROL_PCD_N(7), /*16=6Mhz*/
2525 .mode_pwmdiv = 0x8000063f,
2526 .mode_pwmhi = 0x03400000,
2527 .mode_outmask = 0x00fcfcfc,
2528 .mode_fifoctrl = 0x2f2f2f2f,
2529 .mode_toyclksrc = 0x00000004, /* AUXPLL directly */
2530 .mode_backlight = 0x00000000,
2531 .mode_auxpll = 8, /* 96MHz AUXPLL */
2532 .device_init = board_au1200fb_panel_init,
2533 .device_shutdown = board_au1200fb_panel_shutdown,
2534 320, 320,
2535 240, 240,
2536 },
2537
2538 [8] = { /* Toppoly TD070WGCB2 7" 856x480 TFT */
2539 .name = "Toppoly_TD070WGCB2",
2540 .monspecs = {
2541 .modedb = NULL,
2542 .modedb_len = 0,
2543 .hfmin = 30000,
2544 .hfmax = 70000,
2545 .vfmin = 60,
2546 .vfmax = 60,
2547 .dclkmin = 6000000,
2548 .dclkmax = 28000000,
2549 .input = FB_DISP_RGB,
2550 },
2551 .mode_screen = LCD_SCREEN_SX_N(856) |
2552 LCD_SCREEN_SY_N(480),
2553 .mode_horztiming = LCD_HORZTIMING_HND2_N(43) |
2554 LCD_HORZTIMING_HND1_N(43) | LCD_HORZTIMING_HPW_N(114),
2555 .mode_verttiming = LCD_VERTTIMING_VND2_N(20) |
2556 LCD_VERTTIMING_VND1_N(21) | LCD_VERTTIMING_VPW_N(4),
2557 .mode_clkcontrol = 0x00020001, /* /4=24Mhz */
2558 .mode_pwmdiv = 0x8000063f,
2559 .mode_pwmhi = 0x03400000,
2560 .mode_outmask = 0x00fcfcfc,
2561 .mode_fifoctrl = 0x2f2f2f2f,
2562 .mode_toyclksrc = 0x00000004, /* AUXPLL directly */
2563 .mode_backlight = 0x00000000,
2564 .mode_auxpll = 8, /* 96MHz AUXPLL */
2565 .device_init = board_au1200fb_panel_init,
2566 .device_shutdown = board_au1200fb_panel_shutdown,
2567 856, 856,
2568 480, 480,
2569 },
2570};
2571
2572#define NUM_PANELS (ARRAY_SIZE(known_lcd_panels))
2573
2574/********************************************************************/
2575
2576#ifdef CONFIG_PM
2577static int set_brightness(unsigned int brightness)
2578{
2579 unsigned int hi1, divider;
2580
2581 /* limit brightness pwm duty to >= 30/1600 */
2582 if (brightness < 30) {
2583 brightness = 30;
2584 }
2585 divider = (lcd->pwmdiv & 0x3FFFF) + 1;
2586 hi1 = (lcd->pwmhi >> 16) + 1;
2587 hi1 = (((brightness & 0xFF) + 1) * divider >> 8);
2588 lcd->pwmhi &= 0xFFFF;
2589 lcd->pwmhi |= (hi1 << 16);
2590
2591 return brightness;
2592}
2593#endif /* CONFIG_PM */
2594
2595static int winbpp (unsigned int winctrl1)
2596{
2597 int bits = 0;
2598
2599 /* how many bits are needed for each pixel format */
2600 switch (winctrl1 & LCD_WINCTRL1_FRM) {
2601 case LCD_WINCTRL1_FRM_1BPP:
2602 bits = 1;
2603 break;
2604 case LCD_WINCTRL1_FRM_2BPP:
2605 bits = 2;
2606 break;
2607 case LCD_WINCTRL1_FRM_4BPP:
2608 bits = 4;
2609 break;
2610 case LCD_WINCTRL1_FRM_8BPP:
2611 bits = 8;
2612 break;
2613 case LCD_WINCTRL1_FRM_12BPP:
2614 case LCD_WINCTRL1_FRM_16BPP655:
2615 case LCD_WINCTRL1_FRM_16BPP565:
2616 case LCD_WINCTRL1_FRM_16BPP556:
2617 case LCD_WINCTRL1_FRM_16BPPI1555:
2618 case LCD_WINCTRL1_FRM_16BPPI5551:
2619 case LCD_WINCTRL1_FRM_16BPPA1555:
2620 case LCD_WINCTRL1_FRM_16BPPA5551:
2621 bits = 16;
2622 break;
2623 case LCD_WINCTRL1_FRM_24BPP:
2624 case LCD_WINCTRL1_FRM_32BPP:
2625 bits = 32;
2626 break;
2627 }
2628
2629 return bits;
2630}
2631
2632static int fbinfo2index (struct fb_info *fb_info)
2633{
2634 int i;
2635
2636 for (i = 0; i < CONFIG_FB_AU1200_DEVS; ++i) {
2637 if (fb_info == (struct fb_info *)(&_au1200fb_devices[i].fb_info))
2638 return i;
2639 }
2640 printk("au1200fb: ERROR: fbinfo2index failed!\n");
2641 return -1;
2642}
2643
2644static int au1200_setlocation (struct au1200fb_device *fbdev, int plane,
2645 int xpos, int ypos)
2646{
2647 uint32 winctrl0, winctrl1, winenable, fb_offset = 0;
2648 int xsz, ysz;
2649
2650 /* FIX!!! NOT CHECKING FOR COMPLETE OFFSCREEN YET */
2651
2652 winctrl0 = lcd->window[plane].winctrl0;
2653 winctrl1 = lcd->window[plane].winctrl1;
2654 winctrl0 &= (LCD_WINCTRL0_A | LCD_WINCTRL0_AEN);
2655 winctrl1 &= ~(LCD_WINCTRL1_SZX | LCD_WINCTRL1_SZY);
2656
2657 /* Check for off-screen adjustments */
2658 xsz = win->w[plane].xres;
2659 ysz = win->w[plane].yres;
2660 if ((xpos + win->w[plane].xres) > panel->Xres) {
2661 /* Off-screen to the right */
2662 xsz = panel->Xres - xpos; /* off by 1 ??? */
2663 /*printk("off screen right\n");*/
2664 }
2665
2666 if ((ypos + win->w[plane].yres) > panel->Yres) {
2667 /* Off-screen to the bottom */
2668 ysz = panel->Yres - ypos; /* off by 1 ??? */
2669 /*printk("off screen bottom\n");*/
2670 }
2671
2672 if (xpos < 0) {
2673 /* Off-screen to the left */
2674 xsz = win->w[plane].xres + xpos;
2675 fb_offset += (((0 - xpos) * winbpp(lcd->window[plane].winctrl1))/8);
2676 xpos = 0;
2677 /*printk("off screen left\n");*/
2678 }
2679
2680 if (ypos < 0) {
2681 /* Off-screen to the top */
2682 ysz = win->w[plane].yres + ypos;
2683 /* fixme: fb_offset += ((0-ypos)*fb_pars[plane].line_length); */
2684 ypos = 0;
2685 /*printk("off screen top\n");*/
2686 }
2687
2688 /* record settings */
2689 win->w[plane].xpos = xpos;
2690 win->w[plane].ypos = ypos;
2691
2692 xsz -= 1;
2693 ysz -= 1;
2694 winctrl0 |= (xpos << 21);
2695 winctrl0 |= (ypos << 10);
2696 winctrl1 |= (xsz << 11);
2697 winctrl1 |= (ysz << 0);
2698
2699 /* Disable the window while making changes, then restore WINEN */
2700 winenable = lcd->winenable & (1 << plane);
2701 au_sync();
2702 lcd->winenable &= ~(1 << plane);
2703 lcd->window[plane].winctrl0 = winctrl0;
2704 lcd->window[plane].winctrl1 = winctrl1;
2705 lcd->window[plane].winbuf0 =
2706 lcd->window[plane].winbuf1 = fbdev->fb_phys;
2707 lcd->window[plane].winbufctrl = 0; /* select winbuf0 */
2708 lcd->winenable |= winenable;
2709 au_sync();
2710
2711 return 0;
2712}
2713
2714static void au1200_setpanel (struct panel_settings *newpanel)
2715{
2716 /*
2717 * Perform global setup/init of LCD controller
2718 */
2719 uint32 winenable;
2720
2721 /* Make sure all windows disabled */
2722 winenable = lcd->winenable;
2723 lcd->winenable = 0;
2724 au_sync();
2725 /*
2726 * Ensure everything is disabled before reconfiguring
2727 */
2728 if (lcd->screen & LCD_SCREEN_SEN) {
2729 /* Wait for vertical sync period */
2730 lcd->intstatus = LCD_INT_SS;
2731 while ((lcd->intstatus & LCD_INT_SS) == 0) {
2732 au_sync();
2733 }
2734
2735 lcd->screen &= ~LCD_SCREEN_SEN; /*disable the controller*/
2736
2737 do {
2738 lcd->intstatus = lcd->intstatus; /*clear interrupts*/
2739 au_sync();
2740 /*wait for controller to shut down*/
2741 } while ((lcd->intstatus & LCD_INT_SD) == 0);
2742
2743 /* Call shutdown of current panel (if up) */
2744 /* this must occur last, because if an external clock is driving
2745 the controller, the clock cannot be turned off before first
2746 shutting down the controller.
2747 */
2748 if (panel->device_shutdown != NULL)
2749 panel->device_shutdown();
2750 }
2751
2752 /* Newpanel == NULL indicates a shutdown operation only */
2753 if (newpanel == NULL)
2754 return;
2755
2756 panel = newpanel;
2757
2758 printk("Panel(%s), %dx%d\n", panel->name, panel->Xres, panel->Yres);
2759
2760 /*
2761 * Setup clocking if internal LCD clock source (assumes sys_auxpll valid)
2762 */
2763 if (!(panel->mode_clkcontrol & LCD_CLKCONTROL_EXT))
2764 {
2765 uint32 sys_clksrc;
2766 au_writel(panel->mode_auxpll, SYS_AUXPLL);
2767 sys_clksrc = au_readl(SYS_CLKSRC) & ~0x0000001f;
2768 sys_clksrc |= panel->mode_toyclksrc;
2769 au_writel(sys_clksrc, SYS_CLKSRC);
2770 }
2771
2772 /*
2773 * Configure panel timings
2774 */
2775 lcd->screen = panel->mode_screen;
2776 lcd->horztiming = panel->mode_horztiming;
2777 lcd->verttiming = panel->mode_verttiming;
2778 lcd->clkcontrol = panel->mode_clkcontrol;
2779 lcd->pwmdiv = panel->mode_pwmdiv;
2780 lcd->pwmhi = panel->mode_pwmhi;
2781 lcd->outmask = panel->mode_outmask;
2782 lcd->fifoctrl = panel->mode_fifoctrl;
2783 au_sync();
2784
2785 /* fixme: Check window settings to make sure still valid
2786 * for new geometry */
2787#if 0
2788 au1200_setlocation(fbdev, 0, win->w[0].xpos, win->w[0].ypos);
2789 au1200_setlocation(fbdev, 1, win->w[1].xpos, win->w[1].ypos);
2790 au1200_setlocation(fbdev, 2, win->w[2].xpos, win->w[2].ypos);
2791 au1200_setlocation(fbdev, 3, win->w[3].xpos, win->w[3].ypos);
2792#endif
2793 lcd->winenable = winenable;
2794
2795 /*
2796 * Re-enable screen now that it is configured
2797 */
2798 lcd->screen |= LCD_SCREEN_SEN;
2799 au_sync();
2800
2801 /* Call init of panel */
2802 if (panel->device_init != NULL) panel->device_init();
2803
2804 /* FIX!!!! not appropriate on panel change!!! Global setup/init */
2805 lcd->intenable = 0;
2806 lcd->intstatus = ~0;
2807 lcd->backcolor = win->mode_backcolor;
2808
2809 /* Setup Color Key - FIX!!! */
2810 lcd->colorkey = win->mode_colorkey;
2811 lcd->colorkeymsk = win->mode_colorkeymsk;
2812
2813 /* Setup HWCursor - FIX!!! Need to support this eventually */
2814 lcd->hwc.cursorctrl = 0;
2815 lcd->hwc.cursorpos = 0;
2816 lcd->hwc.cursorcolor0 = 0;
2817 lcd->hwc.cursorcolor1 = 0;
2818 lcd->hwc.cursorcolor2 = 0;
2819 lcd->hwc.cursorcolor3 = 0;
2820
2821
2822#if 0
2823#define D(X) printk("%25s: %08X\n", #X, X)
2824 D(lcd->screen);
2825 D(lcd->horztiming);
2826 D(lcd->verttiming);
2827 D(lcd->clkcontrol);
2828 D(lcd->pwmdiv);
2829 D(lcd->pwmhi);
2830 D(lcd->outmask);
2831 D(lcd->fifoctrl);
2832 D(lcd->window[0].winctrl0);
2833 D(lcd->window[0].winctrl1);
2834 D(lcd->window[0].winctrl2);
2835 D(lcd->window[0].winbuf0);
2836 D(lcd->window[0].winbuf1);
2837 D(lcd->window[0].winbufctrl);
2838 D(lcd->window[1].winctrl0);
2839 D(lcd->window[1].winctrl1);
2840 D(lcd->window[1].winctrl2);
2841 D(lcd->window[1].winbuf0);
2842 D(lcd->window[1].winbuf1);
2843 D(lcd->window[1].winbufctrl);
2844 D(lcd->window[2].winctrl0);
2845 D(lcd->window[2].winctrl1);
2846 D(lcd->window[2].winctrl2);
2847 D(lcd->window[2].winbuf0);
2848 D(lcd->window[2].winbuf1);
2849 D(lcd->window[2].winbufctrl);
2850 D(lcd->window[3].winctrl0);
2851 D(lcd->window[3].winctrl1);
2852 D(lcd->window[3].winctrl2);
2853 D(lcd->window[3].winbuf0);
2854 D(lcd->window[3].winbuf1);
2855 D(lcd->window[3].winbufctrl);
2856 D(lcd->winenable);
2857 D(lcd->intenable);
2858 D(lcd->intstatus);
2859 D(lcd->backcolor);
2860 D(lcd->winenable);
2861 D(lcd->colorkey);
2862 D(lcd->colorkeymsk);
2863 D(lcd->hwc.cursorctrl);
2864 D(lcd->hwc.cursorpos);
2865 D(lcd->hwc.cursorcolor0);
2866 D(lcd->hwc.cursorcolor1);
2867 D(lcd->hwc.cursorcolor2);
2868 D(lcd->hwc.cursorcolor3);
2869#endif
2870}
2871
2872static void au1200_setmode(struct au1200fb_device *fbdev)
2873{
2874 int plane = fbdev->plane;
2875 /* Window/plane setup */
2876 lcd->window[plane].winctrl1 = ( 0
2877 | LCD_WINCTRL1_PRI_N(plane)
2878 | win->w[plane].mode_winctrl1 /* FRM,CCO,PO,PIPE */
2879 ) ;
2880
2881 au1200_setlocation(fbdev, plane, win->w[plane].xpos, win->w[plane].ypos);
2882
2883 lcd->window[plane].winctrl2 = ( 0
2884 | LCD_WINCTRL2_CKMODE_00
2885 | LCD_WINCTRL2_DBM
2886 | LCD_WINCTRL2_BX_N( fbdev->fb_info.fix.line_length)
2887 | LCD_WINCTRL2_SCX_1
2888 | LCD_WINCTRL2_SCY_1
2889 ) ;
2890 lcd->winenable |= win->w[plane].mode_winenable;
2891 au_sync();
2892}
2893
2894
2895/* Inline helpers */
2896
2897/*#define panel_is_dual(panel) ((panel->mode_screen & LCD_SCREEN_PT) == LCD_SCREEN_PT_010)*/
2898/*#define panel_is_active(panel)((panel->mode_screen & LCD_SCREEN_PT) == LCD_SCREEN_PT_010)*/
2899
2900#define panel_is_color(panel) ((panel->mode_screen & LCD_SCREEN_PT) <= LCD_SCREEN_PT_CDSTN)
2901
2902/* Bitfields format supported by the controller. */
2903static struct fb_bitfield rgb_bitfields[][4] = {
2904 /* Red, Green, Blue, Transp */
2905 [LCD_WINCTRL1_FRM_16BPP655 >> 25] =
2906 { { 10, 6, 0 }, { 5, 5, 0 }, { 0, 5, 0 }, { 0, 0, 0 } },
2907
2908 [LCD_WINCTRL1_FRM_16BPP565 >> 25] =
2909 { { 11, 5, 0 }, { 5, 6, 0 }, { 0, 5, 0 }, { 0, 0, 0 } },
2910
2911 [LCD_WINCTRL1_FRM_16BPP556 >> 25] =
2912 { { 11, 5, 0 }, { 6, 5, 0 }, { 0, 6, 0 }, { 0, 0, 0 } },
2913
2914 [LCD_WINCTRL1_FRM_16BPPI1555 >> 25] =
2915 { { 10, 5, 0 }, { 5, 5, 0 }, { 0, 5, 0 }, { 0, 0, 0 } },
2916
2917 [LCD_WINCTRL1_FRM_16BPPI5551 >> 25] =
2918 { { 11, 5, 0 }, { 6, 5, 0 }, { 1, 5, 0 }, { 0, 0, 0 } },
2919
2920 [LCD_WINCTRL1_FRM_16BPPA1555 >> 25] =
2921 { { 10, 5, 0 }, { 5, 5, 0 }, { 0, 5, 0 }, { 15, 1, 0 } },
2922
2923 [LCD_WINCTRL1_FRM_16BPPA5551 >> 25] =
2924 { { 11, 5, 0 }, { 6, 5, 0 }, { 1, 5, 0 }, { 0, 1, 0 } },
2925
2926 [LCD_WINCTRL1_FRM_24BPP >> 25] =
2927 { { 16, 8, 0 }, { 8, 8, 0 }, { 0, 8, 0 }, { 0, 0, 0 } },
2928
2929 [LCD_WINCTRL1_FRM_32BPP >> 25] =
2930 { { 16, 8, 0 }, { 8, 8, 0 }, { 0, 8, 0 }, { 24, 0, 0 } },
2931};
2932
2933/*-------------------------------------------------------------------------*/
2934
2935/* Helpers */
2936
2937static void au1200fb_update_fbinfo(struct fb_info *fbi)
2938{
2939 /* FIX!!!! This also needs to take the window pixel format into account!!! */
2940
2941 /* Update var-dependent FB info */
2942 if (panel_is_color(panel)) {
2943 if (fbi->var.bits_per_pixel <= 8) {
2944 /* palettized */
2945 fbi->fix.visual = FB_VISUAL_PSEUDOCOLOR;
2946 fbi->fix.line_length = fbi->var.xres_virtual /
2947 (8/fbi->var.bits_per_pixel);
2948 } else {
2949 /* non-palettized */
2950 fbi->fix.visual = FB_VISUAL_TRUECOLOR;
2951 fbi->fix.line_length = fbi->var.xres_virtual * (fbi->var.bits_per_pixel / 8);
2952 }
2953 } else {
2954 /* mono FIX!!! mono 8 and 4 bits */
2955 fbi->fix.visual = FB_VISUAL_MONO10;
2956 fbi->fix.line_length = fbi->var.xres_virtual / 8;
2957 }
2958
2959 fbi->screen_size = fbi->fix.line_length * fbi->var.yres_virtual;
2960 print_dbg("line length: %d\n", fbi->fix.line_length);
2961 print_dbg("bits_per_pixel: %d\n", fbi->var.bits_per_pixel);
2962}
2963
2964/*-------------------------------------------------------------------------*/
2965
2966/* AU1200 framebuffer driver */
2967
2968/* fb_check_var
2969 * Validate var settings with hardware restrictions and modify it if necessary
2970 */
2971static int au1200fb_fb_check_var(struct fb_var_screeninfo *var,
2972 struct fb_info *fbi)
2973{
2974 struct au1200fb_device *fbdev = (struct au1200fb_device *)fbi;
2975 u32 pixclock;
2976 int screen_size, plane;
2977
2978 plane = fbdev->plane;
2979
2980 /* Make sure that the mode respect all LCD controller and
2981 * panel restrictions. */
2982 var->xres = win->w[plane].xres;
2983 var->yres = win->w[plane].yres;
2984
2985 /* No need for virtual resolution support */
2986 var->xres_virtual = var->xres;
2987 var->yres_virtual = var->yres;
2988
2989 var->bits_per_pixel = winbpp(win->w[plane].mode_winctrl1);
2990
2991 screen_size = var->xres_virtual * var->yres_virtual;
2992 if (var->bits_per_pixel > 8) screen_size *= (var->bits_per_pixel / 8);
2993 else screen_size /= (8/var->bits_per_pixel);
2994
2995 if (fbdev->fb_len < screen_size)
2996 return -EINVAL; /* Virtual screen is to big, abort */
2997
2998 /* FIX!!!! what are the implicaitons of ignoring this for windows ??? */
2999 /* The max LCD clock is fixed to 48MHz (value of AUX_CLK). The pixel
3000 * clock can only be obtain by dividing this value by an even integer.
3001 * Fallback to a slower pixel clock if necessary. */
3002 pixclock = max((u32)(PICOS2KHZ(var->pixclock) * 1000), fbi->monspecs.dclkmin);
3003 pixclock = min(pixclock, min(fbi->monspecs.dclkmax, (u32)AU1200_LCD_MAX_CLK/2));
3004
3005 if (AU1200_LCD_MAX_CLK % pixclock) {
3006 int diff = AU1200_LCD_MAX_CLK % pixclock;
3007 pixclock -= diff;
3008 }
3009
3010 var->pixclock = KHZ2PICOS(pixclock/1000);
3011#if 0
3012 if (!panel_is_active(panel)) {
3013 int pcd = AU1200_LCD_MAX_CLK / (pixclock * 2) - 1;
3014
3015 if (!panel_is_color(panel)
3016 && (panel->control_base & LCD_CONTROL_MPI) && (pcd < 3)) {
3017 /* STN 8bit mono panel support is up to 6MHz pixclock */
3018 var->pixclock = KHZ2PICOS(6000);
3019 } else if (!pcd) {
3020 /* Other STN panel support is up to 12MHz */
3021 var->pixclock = KHZ2PICOS(12000);
3022 }
3023 }
3024#endif
3025 /* Set bitfield accordingly */
3026 switch (var->bits_per_pixel) {
3027 case 16:
3028 {
3029 /* 16bpp True color.
3030 * These must be set to MATCH WINCTRL[FORM] */
3031 int idx;
3032 idx = (win->w[0].mode_winctrl1 & LCD_WINCTRL1_FRM) >> 25;
3033 var->red = rgb_bitfields[idx][0];
3034 var->green = rgb_bitfields[idx][1];
3035 var->blue = rgb_bitfields[idx][2];
3036 var->transp = rgb_bitfields[idx][3];
3037 break;
3038 }
3039
3040 case 32:
3041 {
3042 /* 32bpp True color.
3043 * These must be set to MATCH WINCTRL[FORM] */
3044 int idx;
3045 idx = (win->w[0].mode_winctrl1 & LCD_WINCTRL1_FRM) >> 25;
3046 var->red = rgb_bitfields[idx][0];
3047 var->green = rgb_bitfields[idx][1];
3048 var->blue = rgb_bitfields[idx][2];
3049 var->transp = rgb_bitfields[idx][3];
3050 break;
3051 }
3052 default:
3053 print_dbg("Unsupported depth %dbpp", var->bits_per_pixel);
3054 return -EINVAL;
3055 }
3056
3057 return 0;
3058}
3059
3060/* fb_set_par
3061 * Set hardware with var settings. This will enable the controller with a
3062 * specific mode, normally validated with the fb_check_var method
3063 */
3064static int au1200fb_fb_set_par(struct fb_info *fbi)
3065{
3066 struct au1200fb_device *fbdev = (struct au1200fb_device *)fbi;
3067
3068 au1200fb_update_fbinfo(fbi);
3069 au1200_setmode(fbdev);
3070
3071 return 0;
3072}
3073
3074/* fb_setcolreg
3075 * Set color in LCD palette.
3076 */
3077static int au1200fb_fb_setcolreg(unsigned regno, unsigned red, unsigned green,
3078 unsigned blue, unsigned transp, struct fb_info *fbi)
3079{
3080 volatile u32 *palette = lcd->palette;
3081 u32 value;
3082
3083 if (regno > (AU1200_LCD_NBR_PALETTE_ENTRIES - 1))
3084 return -EINVAL;
3085
3086 if (fbi->var.grayscale) {
3087 /* Convert color to grayscale */
3088 red = green = blue =
3089 (19595 * red + 38470 * green + 7471 * blue) >> 16;
3090 }
3091
3092 if (fbi->fix.visual == FB_VISUAL_TRUECOLOR) {
3093 /* Place color in the pseudopalette */
3094 if (regno > 16)
3095 return -EINVAL;
3096
3097 palette = (u32*) fbi->pseudo_palette;
3098
3099 red >>= (16 - fbi->var.red.length);
3100 green >>= (16 - fbi->var.green.length);
3101 blue >>= (16 - fbi->var.blue.length);
3102
3103 value = (red << fbi->var.red.offset) |
3104 (green << fbi->var.green.offset)|
3105 (blue << fbi->var.blue.offset);
3106 value &= 0xFFFF;
3107
3108 } else if (1 /*FIX!!! panel_is_active(fbdev->panel)*/) {
3109 /* COLOR TFT PALLETTIZED (use RGB 565) */
3110 value = (red & 0xF800)|((green >> 5) &
3111 0x07E0)|((blue >> 11) & 0x001F);
3112 value &= 0xFFFF;
3113
3114 } else if (0 /*panel_is_color(fbdev->panel)*/) {
3115 /* COLOR STN MODE */
3116 value = 0x1234;
3117 value &= 0xFFF;
3118 } else {
3119 /* MONOCHROME MODE */
3120 value = (green >> 12) & 0x000F;
3121 value &= 0xF;
3122 }
3123
3124 palette[regno] = value;
3125
3126 return 0;
3127}
3128
3129/* fb_blank
3130 * Blank the screen. Depending on the mode, the screen will be
3131 * activated with the backlight color, or desactivated
3132 */
3133static int au1200fb_fb_blank(int blank_mode, struct fb_info *fbi)
3134{
3135 /* Short-circuit screen blanking */
3136 if (noblanking)
3137 return 0;
3138
3139 switch (blank_mode) {
3140
3141 case FB_BLANK_UNBLANK:
3142 case FB_BLANK_NORMAL:
3143 /* printk("turn on panel\n"); */
3144 au1200_setpanel(panel);
3145 break;
3146 case FB_BLANK_VSYNC_SUSPEND:
3147 case FB_BLANK_HSYNC_SUSPEND:
3148 case FB_BLANK_POWERDOWN:
3149 /* printk("turn off panel\n"); */
3150 au1200_setpanel(NULL);
3151 break;
3152 default:
3153 break;
3154
3155 }
3156
3157 /* FB_BLANK_NORMAL is a soft blank */
3158 return (blank_mode == FB_BLANK_NORMAL) ? -EINVAL : 0;
3159}
3160
3161/* fb_mmap
3162 * Map video memory in user space. We don't use the generic fb_mmap
3163 * method mainly to allow the use of the TLB streaming flag (CCA=6)
3164 */
3165static int au1200fb_fb_mmap(struct fb_info *info, struct vm_area_struct *vma)
3166
3167{
3168 unsigned int len;
3169 unsigned long start=0, off;
3170 struct au1200fb_device *fbdev = (struct au1200fb_device *) info;
3171
3172#ifdef CONFIG_PM
3173 au1xxx_pm_access(LCD_pm_dev);
3174#endif
3175
3176 if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT)) {
3177 return -EINVAL;
3178 }
3179
3180 start = fbdev->fb_phys & PAGE_MASK;
3181 len = PAGE_ALIGN((start & ~PAGE_MASK) + fbdev->fb_len);
3182
3183 off = vma->vm_pgoff << PAGE_SHIFT;
3184
3185 if ((vma->vm_end - vma->vm_start + off) > len) {
3186 return -EINVAL;
3187 }
3188
3189 off += start;
3190 vma->vm_pgoff = off >> PAGE_SHIFT;
3191
3192 vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
3193 pgprot_val(vma->vm_page_prot) |= _CACHE_MASK; /* CCA=7 */
3194
3195 vma->vm_flags |= VM_IO;
3196
3197 return io_remap_pfn_range(vma, vma->vm_start, off >> PAGE_SHIFT,
3198 vma->vm_end - vma->vm_start,
3199 vma->vm_page_prot);
3200
3201 return 0;
3202}
3203
3204static void set_global(u_int cmd, struct au1200_lcd_global_regs_t *pdata)
3205{
3206
3207 unsigned int hi1, divider;
3208
3209 /* SCREEN_SIZE: user cannot reset size, must switch panel choice */
3210
3211 if (pdata->flags & SCREEN_BACKCOLOR)
3212 lcd->backcolor = pdata->backcolor;
3213
3214 if (pdata->flags & SCREEN_BRIGHTNESS) {
3215
3216 // limit brightness pwm duty to >= 30/1600
3217 if (pdata->brightness < 30) {
3218 pdata->brightness = 30;
3219 }
3220 divider = (lcd->pwmdiv & 0x3FFFF) + 1;
3221 hi1 = (lcd->pwmhi >> 16) + 1;
3222 hi1 = (((pdata->brightness & 0xFF)+1) * divider >> 8);
3223 lcd->pwmhi &= 0xFFFF;
3224 lcd->pwmhi |= (hi1 << 16);
3225 }
3226
3227 if (pdata->flags & SCREEN_COLORKEY)
3228 lcd->colorkey = pdata->colorkey;
3229
3230 if (pdata->flags & SCREEN_MASK)
3231 lcd->colorkeymsk = pdata->mask;
3232 au_sync();
3233}
3234
3235static void get_global(u_int cmd, struct au1200_lcd_global_regs_t *pdata)
3236{
3237 unsigned int hi1, divider;
3238
3239 pdata->xsize = ((lcd->screen & LCD_SCREEN_SX) >> 19) + 1;
3240 pdata->ysize = ((lcd->screen & LCD_SCREEN_SY) >> 8) + 1;
3241
3242 pdata->backcolor = lcd->backcolor;
3243 pdata->colorkey = lcd->colorkey;
3244 pdata->mask = lcd->colorkeymsk;
3245
3246 // brightness
3247 hi1 = (lcd->pwmhi >> 16) + 1;
3248 divider = (lcd->pwmdiv & 0x3FFFF) + 1;
3249 pdata->brightness = ((hi1 << 8) / divider) - 1;
3250 au_sync();
3251}
3252
3253static void set_window(unsigned int plane,
3254 struct au1200_lcd_window_regs_t *pdata)
3255{
3256 unsigned int val, bpp;
3257
3258 /* Window control register 0 */
3259 if (pdata->flags & WIN_POSITION) {
3260 val = lcd->window[plane].winctrl0 & ~(LCD_WINCTRL0_OX |
3261 LCD_WINCTRL0_OY);
3262 val |= ((pdata->xpos << 21) & LCD_WINCTRL0_OX);
3263 val |= ((pdata->ypos << 10) & LCD_WINCTRL0_OY);
3264 lcd->window[plane].winctrl0 = val;
3265 }
3266 if (pdata->flags & WIN_ALPHA_COLOR) {
3267 val = lcd->window[plane].winctrl0 & ~(LCD_WINCTRL0_A);
3268 val |= ((pdata->alpha_color << 2) & LCD_WINCTRL0_A);
3269 lcd->window[plane].winctrl0 = val;
3270 }
3271 if (pdata->flags & WIN_ALPHA_MODE) {
3272 val = lcd->window[plane].winctrl0 & ~(LCD_WINCTRL0_AEN);
3273 val |= ((pdata->alpha_mode << 1) & LCD_WINCTRL0_AEN);
3274 lcd->window[plane].winctrl0 = val;
3275 }
3276
3277 /* Window control register 1 */
3278 if (pdata->flags & WIN_PRIORITY) {
3279 val = lcd->window[plane].winctrl1 & ~(LCD_WINCTRL1_PRI);
3280 val |= ((pdata->priority << 30) & LCD_WINCTRL1_PRI);
3281 lcd->window[plane].winctrl1 = val;
3282 }
3283 if (pdata->flags & WIN_CHANNEL) {
3284 val = lcd->window[plane].winctrl1 & ~(LCD_WINCTRL1_PIPE);
3285 val |= ((pdata->channel << 29) & LCD_WINCTRL1_PIPE);
3286 lcd->window[plane].winctrl1 = val;
3287 }
3288 if (pdata->flags & WIN_BUFFER_FORMAT) {
3289 val = lcd->window[plane].winctrl1 & ~(LCD_WINCTRL1_FRM);
3290 val |= ((pdata->buffer_format << 25) & LCD_WINCTRL1_FRM);
3291 lcd->window[plane].winctrl1 = val;
3292 }
3293 if (pdata->flags & WIN_COLOR_ORDER) {
3294 val = lcd->window[plane].winctrl1 & ~(LCD_WINCTRL1_CCO);
3295 val |= ((pdata->color_order << 24) & LCD_WINCTRL1_CCO);
3296 lcd->window[plane].winctrl1 = val;
3297 }
3298 if (pdata->flags & WIN_PIXEL_ORDER) {
3299 val = lcd->window[plane].winctrl1 & ~(LCD_WINCTRL1_PO);
3300 val |= ((pdata->pixel_order << 22) & LCD_WINCTRL1_PO);
3301 lcd->window[plane].winctrl1 = val;
3302 }
3303 if (pdata->flags & WIN_SIZE) {
3304 val = lcd->window[plane].winctrl1 & ~(LCD_WINCTRL1_SZX |
3305 LCD_WINCTRL1_SZY);
3306 val |= (((pdata->xsize << 11) - 1) & LCD_WINCTRL1_SZX);
3307 val |= (((pdata->ysize) - 1) & LCD_WINCTRL1_SZY);
3308 lcd->window[plane].winctrl1 = val;
3309 /* program buffer line width */
3310 bpp = winbpp(val) / 8;
3311 val = lcd->window[plane].winctrl2 & ~(LCD_WINCTRL2_BX);
3312 val |= (((pdata->xsize * bpp) << 8) & LCD_WINCTRL2_BX);
3313 lcd->window[plane].winctrl2 = val;
3314 }
3315
3316 /* Window control register 2 */
3317 if (pdata->flags & WIN_COLORKEY_MODE) {
3318 val = lcd->window[plane].winctrl2 & ~(LCD_WINCTRL2_CKMODE);
3319 val |= ((pdata->colorkey_mode << 24) & LCD_WINCTRL2_CKMODE);
3320 lcd->window[plane].winctrl2 = val;
3321 }
3322 if (pdata->flags & WIN_DOUBLE_BUFFER_MODE) {
3323 val = lcd->window[plane].winctrl2 & ~(LCD_WINCTRL2_DBM);
3324 val |= ((pdata->double_buffer_mode << 23) & LCD_WINCTRL2_DBM);
3325 lcd->window[plane].winctrl2 = val;
3326 }
3327 if (pdata->flags & WIN_RAM_ARRAY_MODE) {
3328 val = lcd->window[plane].winctrl2 & ~(LCD_WINCTRL2_RAM);
3329 val |= ((pdata->ram_array_mode << 21) & LCD_WINCTRL2_RAM);
3330 lcd->window[plane].winctrl2 = val;
3331 }
3332
3333 /* Buffer line width programmed with WIN_SIZE */
3334
3335 if (pdata->flags & WIN_BUFFER_SCALE) {
3336 val = lcd->window[plane].winctrl2 & ~(LCD_WINCTRL2_SCX |
3337 LCD_WINCTRL2_SCY);
3338 val |= ((pdata->xsize << 11) & LCD_WINCTRL2_SCX);
3339 val |= ((pdata->ysize) & LCD_WINCTRL2_SCY);
3340 lcd->window[plane].winctrl2 = val;
3341 }
3342
3343 if (pdata->flags & WIN_ENABLE) {
3344 val = lcd->winenable;
3345 val &= ~(1<<plane);
3346 val |= (pdata->enable & 1) << plane;
3347 lcd->winenable = val;
3348 }
3349 au_sync();
3350}
3351
3352static void get_window(unsigned int plane,
3353 struct au1200_lcd_window_regs_t *pdata)
3354{
3355 /* Window control register 0 */
3356 pdata->xpos = (lcd->window[plane].winctrl0 & LCD_WINCTRL0_OX) >> 21;
3357 pdata->ypos = (lcd->window[plane].winctrl0 & LCD_WINCTRL0_OY) >> 10;
3358 pdata->alpha_color = (lcd->window[plane].winctrl0 & LCD_WINCTRL0_A) >> 2;
3359 pdata->alpha_mode = (lcd->window[plane].winctrl0 & LCD_WINCTRL0_AEN) >> 1;
3360
3361 /* Window control register 1 */
3362 pdata->priority = (lcd->window[plane].winctrl1& LCD_WINCTRL1_PRI) >> 30;
3363 pdata->channel = (lcd->window[plane].winctrl1 & LCD_WINCTRL1_PIPE) >> 29;
3364 pdata->buffer_format = (lcd->window[plane].winctrl1 & LCD_WINCTRL1_FRM) >> 25;
3365 pdata->color_order = (lcd->window[plane].winctrl1 & LCD_WINCTRL1_CCO) >> 24;
3366 pdata->pixel_order = (lcd->window[plane].winctrl1 & LCD_WINCTRL1_PO) >> 22;
3367 pdata->xsize = ((lcd->window[plane].winctrl1 & LCD_WINCTRL1_SZX) >> 11) + 1;
3368 pdata->ysize = (lcd->window[plane].winctrl1 & LCD_WINCTRL1_SZY) + 1;
3369
3370 /* Window control register 2 */
3371 pdata->colorkey_mode = (lcd->window[plane].winctrl2 & LCD_WINCTRL2_CKMODE) >> 24;
3372 pdata->double_buffer_mode = (lcd->window[plane].winctrl2 & LCD_WINCTRL2_DBM) >> 23;
3373 pdata->ram_array_mode = (lcd->window[plane].winctrl2 & LCD_WINCTRL2_RAM) >> 21;
3374
3375 pdata->enable = (lcd->winenable >> plane) & 1;
3376 au_sync();
3377}
3378
3379static int au1200fb_ioctl(struct fb_info *info, unsigned int cmd,
3380 unsigned long arg)
3381{
3382 int plane;
3383 int val;
3384
3385#ifdef CONFIG_PM
3386 au1xxx_pm_access(LCD_pm_dev);
3387#endif
3388
3389 plane = fbinfo2index(info);
3390 print_dbg("au1200fb: ioctl %d on plane %d\n", cmd, plane);
3391
3392 if (cmd == AU1200_LCD_FB_IOCTL) {
3393 struct au1200_lcd_iodata_t iodata;
3394
3395 if (copy_from_user(&iodata, (void __user *) arg, sizeof(iodata)))
3396 return -EFAULT;
3397
3398 print_dbg("FB IOCTL called\n");
3399
3400 switch (iodata.subcmd) {
3401 case AU1200_LCD_SET_SCREEN:
3402 print_dbg("AU1200_LCD_SET_SCREEN\n");
3403 set_global(cmd, &iodata.global);
3404 break;
3405
3406 case AU1200_LCD_GET_SCREEN:
3407 print_dbg("AU1200_LCD_GET_SCREEN\n");
3408 get_global(cmd, &iodata.global);
3409 break;
3410
3411 case AU1200_LCD_SET_WINDOW:
3412 print_dbg("AU1200_LCD_SET_WINDOW\n");
3413 set_window(plane, &iodata.window);
3414 break;
3415
3416 case AU1200_LCD_GET_WINDOW:
3417 print_dbg("AU1200_LCD_GET_WINDOW\n");
3418 get_window(plane, &iodata.window);
3419 break;
3420
3421 case AU1200_LCD_SET_PANEL:
3422 print_dbg("AU1200_LCD_SET_PANEL\n");
3423 if ((iodata.global.panel_choice >= 0) &&
3424 (iodata.global.panel_choice <
3425 NUM_PANELS))
3426 {
3427 struct panel_settings *newpanel;
3428 panel_index = iodata.global.panel_choice;
3429 newpanel = &known_lcd_panels[panel_index];
3430 au1200_setpanel(newpanel);
3431 }
3432 break;
3433
3434 case AU1200_LCD_GET_PANEL:
3435 print_dbg("AU1200_LCD_GET_PANEL\n");
3436 iodata.global.panel_choice = panel_index;
3437 break;
3438
3439 default:
3440 return -EINVAL;
3441 }
3442
3443 val = copy_to_user((void __user *) arg, &iodata, sizeof(iodata));
3444 if (val) {
3445 print_dbg("error: could not copy %d bytes\n", val);
3446 return -EFAULT;
3447 }
3448 }
3449
3450 return 0;
3451}
3452
3453
3454static struct fb_ops au1200fb_fb_ops = {
3455 .owner = THIS_MODULE,
3456 .fb_check_var = au1200fb_fb_check_var,
3457 .fb_set_par = au1200fb_fb_set_par,
3458 .fb_setcolreg = au1200fb_fb_setcolreg,
3459 .fb_blank = au1200fb_fb_blank,
3460 .fb_fillrect = cfb_fillrect,
3461 .fb_copyarea = cfb_copyarea,
3462 .fb_imageblit = cfb_imageblit,
3463 .fb_sync = NULL,
3464 .fb_ioctl = au1200fb_ioctl,
3465 .fb_mmap = au1200fb_fb_mmap,
3466};
3467
3468/*-------------------------------------------------------------------------*/
3469
3470static irqreturn_t au1200fb_handle_irq(int irq, void* dev_id, struct pt_regs *regs)
3471{
3472 /* Nothing to do for now, just clear any pending interrupt */
3473 lcd->intstatus = lcd->intstatus;
3474 au_sync();
3475
3476 return IRQ_HANDLED;
3477}
3478
3479/*-------------------------------------------------------------------------*/
3480
3481/* AU1200 LCD device probe helpers */
3482
3483static int au1200fb_init_fbinfo(struct au1200fb_device *fbdev)
3484{
3485 struct fb_info *fbi = &fbdev->fb_info;
3486 int bpp;
3487
3488 memset(fbi, 0, sizeof(struct fb_info));
3489 fbi->fbops = &au1200fb_fb_ops;
3490
3491 bpp = winbpp(win->w[fbdev->plane].mode_winctrl1);
3492
3493 /* Copy monitor specs from panel data */
3494 /* fixme: we're setting up LCD controller windows, so these dont give a
3495 damn as to what the monitor specs are (the panel itself does, but that
3496 isnt done here...so maybe need a generic catchall monitor setting??? */
3497 memcpy(&fbi->monspecs, &panel->monspecs, sizeof(struct fb_monspecs));
3498
3499 /* We first try the user mode passed in argument. If that failed,
3500 * or if no one has been specified, we default to the first mode of the
3501 * panel list. Note that after this call, var data will be set */
3502 if (!fb_find_mode(&fbi->var,
3503 fbi,
3504 NULL, /* drv_info.opt_mode, */
3505 fbi->monspecs.modedb,
3506 fbi->monspecs.modedb_len,
3507 fbi->monspecs.modedb,
3508 bpp)) {
3509
3510 print_err("Cannot find valid mode for panel %s", panel->name);
3511 return -EFAULT;
3512 }
3513
3514 fbi->pseudo_palette = kmalloc(sizeof(u32) * 16, GFP_KERNEL);
3515 if (!fbi->pseudo_palette) {
3516 return -ENOMEM;
3517 }
3518 memset(fbi->pseudo_palette, 0, sizeof(u32) * 16);
3519
3520 if (fb_alloc_cmap(&fbi->cmap, AU1200_LCD_NBR_PALETTE_ENTRIES, 0) < 0) {
3521 print_err("Fail to allocate colormap (%d entries)",
3522 AU1200_LCD_NBR_PALETTE_ENTRIES);
3523 kfree(fbi->pseudo_palette);
3524 return -EFAULT;
3525 }
3526
3527 strncpy(fbi->fix.id, "AU1200", sizeof(fbi->fix.id));
3528 fbi->fix.smem_start = fbdev->fb_phys;
3529 fbi->fix.smem_len = fbdev->fb_len;
3530 fbi->fix.type = FB_TYPE_PACKED_PIXELS;
3531 fbi->fix.xpanstep = 0;
3532 fbi->fix.ypanstep = 0;
3533 fbi->fix.mmio_start = 0;
3534 fbi->fix.mmio_len = 0;
3535 fbi->fix.accel = FB_ACCEL_NONE;
3536
3537 fbi->screen_base = (char __iomem *) fbdev->fb_mem;
3538
3539 au1200fb_update_fbinfo(fbi);
3540
3541 return 0;
3542}
3543
3544/*-------------------------------------------------------------------------*/
3545
3546/* AU1200 LCD controller device driver */
3547
3548static int au1200fb_drv_probe(struct device *dev)
3549{
3550 struct au1200fb_device *fbdev;
3551 unsigned long page;
3552 int bpp, plane, ret;
3553
3554 if (!dev)
3555 return -EINVAL;
3556
3557 for (plane = 0; plane < CONFIG_FB_AU1200_DEVS; ++plane) {
3558 bpp = winbpp(win->w[plane].mode_winctrl1);
3559 if (win->w[plane].xres == 0)
3560 win->w[plane].xres = panel->Xres;
3561 if (win->w[plane].yres == 0)
3562 win->w[plane].yres = panel->Yres;
3563
3564 fbdev = &_au1200fb_devices[plane];
3565 memset(fbdev, 0, sizeof(struct au1200fb_device));
3566 fbdev->plane = plane;
3567
3568 /* Allocate the framebuffer to the maximum screen size */
3569 fbdev->fb_len = (win->w[plane].xres * win->w[plane].yres * bpp) / 8;
3570
3571 fbdev->fb_mem = dma_alloc_noncoherent(dev,
3572 PAGE_ALIGN(fbdev->fb_len),
3573 &fbdev->fb_phys, GFP_KERNEL);
3574 if (!fbdev->fb_mem) {
3575 print_err("fail to allocate frambuffer (size: %dK))",
3576 fbdev->fb_len / 1024);
3577 return -ENOMEM;
3578 }
3579
3580 /*
3581 * Set page reserved so that mmap will work. This is necessary
3582 * since we'll be remapping normal memory.
3583 */
3584 for (page = (unsigned long)fbdev->fb_phys;
3585 page < PAGE_ALIGN((unsigned long)fbdev->fb_phys +
3586 fbdev->fb_len);
3587 page += PAGE_SIZE) {
3588 SetPageReserved(pfn_to_page(page >> PAGE_SHIFT)); /* LCD DMA is NOT coherent on Au1200 */
3589 }
3590 print_dbg("Framebuffer memory map at %p", fbdev->fb_mem);
3591 print_dbg("phys=0x%08x, size=%dK", fbdev->fb_phys, fbdev->fb_len / 1024);
3592
3593 /* Init FB data */
3594 if ((ret = au1200fb_init_fbinfo(fbdev)) < 0)
3595 goto failed;
3596
3597 /* Register new framebuffer */
3598 if ((ret = register_framebuffer(&fbdev->fb_info)) < 0) {
3599 print_err("cannot register new framebuffer");
3600 goto failed;
3601 }
3602
3603 au1200fb_fb_set_par(&fbdev->fb_info);
3604
3605#if !defined(CONFIG_FRAMEBUFFER_CONSOLE) && defined(CONFIG_LOGO)
3606 if (plane == 0)
3607 if (fb_prepare_logo(&fbdev->fb_info, FB_ROTATE_UR)) {
3608 /* Start display and show logo on boot */
3609 fb_set_cmap(&fbdev->fb_info.cmap,
3610 &fbdev->fb_info);
3611
3612 fb_show_logo(&fbdev->fb_info, FB_ROTATE_UR);
3613 }
3614#endif
3615 }
3616
3617 /* Now hook interrupt too */
3618 if ((ret = request_irq(AU1200_LCD_INT, au1200fb_handle_irq,
3619 SA_INTERRUPT | SA_SHIRQ, "lcd", (void *)dev)) < 0) {
3620 print_err("fail to request interrupt line %d (err: %d)",
3621 AU1200_LCD_INT, ret);
3622 goto failed;
3623 }
3624
3625 return 0;
3626
3627failed:
3628 /* NOTE: This only does the current plane/window that failed; others are still active */
3629 if (fbdev->fb_mem)
3630 dma_free_noncoherent(dev, PAGE_ALIGN(fbdev->fb_len),
3631 fbdev->fb_mem, fbdev->fb_phys);
3632 if (fbdev->fb_info.cmap.len != 0)
3633 fb_dealloc_cmap(&fbdev->fb_info.cmap);
3634 if (fbdev->fb_info.pseudo_palette)
3635 kfree(fbdev->fb_info.pseudo_palette);
3636 if (plane == 0)
3637 free_irq(AU1200_LCD_INT, (void*)dev);
3638 return ret;
3639}
3640
3641static int au1200fb_drv_remove(struct device *dev)
3642{
3643 struct au1200fb_device *fbdev;
3644 int plane;
3645
3646 if (!dev)
3647 return -ENODEV;
3648
3649 /* Turn off the panel */
3650 au1200_setpanel(NULL);
3651
3652 for (plane = 0; plane < CONFIG_FB_AU1200_DEVS; ++plane)
3653 {
3654 fbdev = &_au1200fb_devices[plane];
3655
3656 /* Clean up all probe data */
3657 unregister_framebuffer(&fbdev->fb_info);
3658 if (fbdev->fb_mem)
3659 dma_free_noncoherent(dev, PAGE_ALIGN(fbdev->fb_len),
3660 fbdev->fb_mem, fbdev->fb_phys);
3661 if (fbdev->fb_info.cmap.len != 0)
3662 fb_dealloc_cmap(&fbdev->fb_info.cmap);
3663 if (fbdev->fb_info.pseudo_palette)
3664 kfree(fbdev->fb_info.pseudo_palette);
3665 }
3666
3667 free_irq(AU1200_LCD_INT, (void *)dev);
3668
3669 return 0;
3670}
3671
3672#ifdef CONFIG_PM
3673static int au1200fb_drv_suspend(struct device *dev, u32 state, u32 level)
3674{
3675 /* TODO */
3676 return 0;
3677}
3678
3679static int au1200fb_drv_resume(struct device *dev, u32 level)
3680{
3681 /* TODO */
3682 return 0;
3683}
3684#endif /* CONFIG_PM */
3685
3686static struct device_driver au1200fb_driver = {
3687 .name = "au1200-lcd",
3688 .bus = &platform_bus_type,
3689 .probe = au1200fb_drv_probe,
3690 .remove = au1200fb_drv_remove,
3691#ifdef CONFIG_PM
3692 .suspend = au1200fb_drv_suspend,
3693 .resume = au1200fb_drv_resume,
3694#endif
3695};
3696
3697/*-------------------------------------------------------------------------*/
3698
3699/* Kernel driver */
3700
3701static void au1200fb_setup(void)
3702{
3703 char* options = NULL;
3704 char* this_opt;
3705 int num_panels = ARRAY_SIZE(known_lcd_panels);
3706 int panel_idx = -1;
3707
3708 fb_get_options(DRIVER_NAME, &options);
3709
3710 if (options) {
3711 while ((this_opt = strsep(&options,",")) != NULL) {
3712 /* Panel option - can be panel name,
3713 * "bs" for board-switch, or number/index */
3714 if (!strncmp(this_opt, "panel:", 6)) {
3715 int i;
3716 long int li;
3717 char *endptr;
3718 this_opt += 6;
3719 /* First check for index, which allows
3720 * to short circuit this mess */
3721 li = simple_strtol(this_opt, &endptr, 0);
3722 if (*endptr == '\0') {
3723 panel_idx = (int)li;
3724 }
3725 else if (strcmp(this_opt, "bs") == 0) {
3726 extern int board_au1200fb_panel(void);
3727 panel_idx = board_au1200fb_panel();
3728 }
3729
3730 else
3731 for (i = 0; i < num_panels; i++) {
3732 if (!strcmp(this_opt, known_lcd_panels[i].name)) {
3733 panel_idx = i;
3734 break;
3735 }
3736 }
3737
3738 if ((panel_idx < 0) || (panel_idx >= num_panels)) {
3739 print_warn("Panel %s not supported!", this_opt);
3740 }
3741 else
3742 panel_index = panel_idx;
3743 }
3744
3745 else if (strncmp(this_opt, "nohwcursor", 10) == 0) {
3746 nohwcursor = 1;
3747 }
3748
3749 /* Unsupported option */
3750 else {
3751 print_warn("Unsupported option \"%s\"", this_opt);
3752 }
3753 }
3754 }
3755}
3756
3757#ifdef CONFIG_PM
3758static int au1200fb_pm_callback(au1xxx_power_dev_t *dev,
3759 au1xxx_request_t request, void *data) {
3760 int retval = -1;
3761 unsigned int d = 0;
3762 unsigned int brightness = 0;
3763
3764 if (request == AU1XXX_PM_SLEEP) {
3765 board_au1200fb_panel_shutdown();
3766 }
3767 else if (request == AU1XXX_PM_WAKEUP) {
3768 if(dev->prev_state == SLEEP_STATE)
3769 {
3770 int plane;
3771 au1200_setpanel(panel);
3772 for (plane = 0; plane < CONFIG_FB_AU1200_DEVS; ++plane) {
3773 struct au1200fb_device *fbdev;
3774 fbdev = &_au1200fb_devices[plane];
3775 au1200fb_fb_set_par(&fbdev->fb_info);
3776 }
3777 }
3778
3779 d = *((unsigned int*)data);
3780 if(d <=10) brightness = 26;
3781 else if(d<=20) brightness = 51;
3782 else if(d<=30) brightness = 77;
3783 else if(d<=40) brightness = 102;
3784 else if(d<=50) brightness = 128;
3785 else if(d<=60) brightness = 153;
3786 else if(d<=70) brightness = 179;
3787 else if(d<=80) brightness = 204;
3788 else if(d<=90) brightness = 230;
3789 else brightness = 255;
3790 set_brightness(brightness);
3791 } else if (request == AU1XXX_PM_GETSTATUS) {
3792 return dev->cur_state;
3793 } else if (request == AU1XXX_PM_ACCESS) {
3794 if (dev->cur_state != SLEEP_STATE)
3795 return retval;
3796 else {
3797 au1200_setpanel(panel);
3798 }
3799 } else if (request == AU1XXX_PM_IDLE) {
3800 } else if (request == AU1XXX_PM_CLEANUP) {
3801 }
3802
3803 return retval;
3804}
3805#endif
3806
3807static int __init au1200fb_init(void)
3808{
3809 print_info("" DRIVER_DESC "");
3810
3811 /* Setup driver with options */
3812 au1200fb_setup();
3813
3814 /* Point to the panel selected */
3815 panel = &known_lcd_panels[panel_index];
3816 win = &windows[window_index];
3817
3818 printk(DRIVER_NAME ": Panel %d %s\n", panel_index, panel->name);
3819 printk(DRIVER_NAME ": Win %d %s\n", window_index, win->name);
3820
3821 /* Kickstart the panel, the framebuffers/windows come soon enough */
3822 au1200_setpanel(panel);
3823
3824 #ifdef CONFIG_PM
3825 LCD_pm_dev = new_au1xxx_power_device("LCD", &au1200fb_pm_callback, NULL);
3826 if ( LCD_pm_dev == NULL)
3827 printk(KERN_INFO "Unable to create a power management device entry for the au1200fb.\n");
3828 else
3829 printk(KERN_INFO "Power management device entry for the au1200fb loaded.\n");
3830 #endif
3831
3832 return driver_register(&au1200fb_driver);
3833}
3834
3835static void __exit au1200fb_cleanup(void)
3836{
3837 driver_unregister(&au1200fb_driver);
3838}
3839
3840module_init(au1200fb_init);
3841module_exit(au1200fb_cleanup);
3842
3843MODULE_DESCRIPTION(DRIVER_DESC);
3844MODULE_LICENSE("GPL");
diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c
index 334b1db1bd7c..27597c576eff 100644
--- a/drivers/video/backlight/backlight.c
+++ b/drivers/video/backlight/backlight.c
@@ -29,12 +29,15 @@ static ssize_t backlight_show_power(struct class_device *cdev, char *buf)
29 29
30static ssize_t backlight_store_power(struct class_device *cdev, const char *buf, size_t count) 30static ssize_t backlight_store_power(struct class_device *cdev, const char *buf, size_t count)
31{ 31{
32 int rc = -ENXIO, power; 32 int rc = -ENXIO;
33 char *endp; 33 char *endp;
34 struct backlight_device *bd = to_backlight_device(cdev); 34 struct backlight_device *bd = to_backlight_device(cdev);
35 int power = simple_strtoul(buf, &endp, 0);
36 size_t size = endp - buf;
35 37
36 power = simple_strtoul(buf, &endp, 0); 38 if (*endp && isspace(*endp))
37 if (*endp && !isspace(*endp)) 39 size++;
40 if (size != count)
38 return -EINVAL; 41 return -EINVAL;
39 42
40 down(&bd->sem); 43 down(&bd->sem);
@@ -65,12 +68,15 @@ static ssize_t backlight_show_brightness(struct class_device *cdev, char *buf)
65 68
66static ssize_t backlight_store_brightness(struct class_device *cdev, const char *buf, size_t count) 69static ssize_t backlight_store_brightness(struct class_device *cdev, const char *buf, size_t count)
67{ 70{
68 int rc = -ENXIO, brightness; 71 int rc = -ENXIO;
69 char *endp; 72 char *endp;
70 struct backlight_device *bd = to_backlight_device(cdev); 73 struct backlight_device *bd = to_backlight_device(cdev);
74 int brightness = simple_strtoul(buf, &endp, 0);
75 size_t size = endp - buf;
71 76
72 brightness = simple_strtoul(buf, &endp, 0); 77 if (*endp && isspace(*endp))
73 if (*endp && !isspace(*endp)) 78 size++;
79 if (size != count)
74 return -EINVAL; 80 return -EINVAL;
75 81
76 down(&bd->sem); 82 down(&bd->sem);
diff --git a/drivers/video/backlight/lcd.c b/drivers/video/backlight/lcd.c
index 86908a60c630..bc8ab005a3fb 100644
--- a/drivers/video/backlight/lcd.c
+++ b/drivers/video/backlight/lcd.c
@@ -31,12 +31,15 @@ static ssize_t lcd_show_power(struct class_device *cdev, char *buf)
31 31
32static ssize_t lcd_store_power(struct class_device *cdev, const char *buf, size_t count) 32static ssize_t lcd_store_power(struct class_device *cdev, const char *buf, size_t count)
33{ 33{
34 int rc, power; 34 int rc = -ENXIO;
35 char *endp; 35 char *endp;
36 struct lcd_device *ld = to_lcd_device(cdev); 36 struct lcd_device *ld = to_lcd_device(cdev);
37 int power = simple_strtoul(buf, &endp, 0);
38 size_t size = endp - buf;
37 39
38 power = simple_strtoul(buf, &endp, 0); 40 if (*endp && isspace(*endp))
39 if (*endp && !isspace(*endp)) 41 size++;
42 if (size != count)
40 return -EINVAL; 43 return -EINVAL;
41 44
42 down(&ld->sem); 45 down(&ld->sem);
@@ -44,8 +47,7 @@ static ssize_t lcd_store_power(struct class_device *cdev, const char *buf, size_
44 pr_debug("lcd: set power to %d\n", power); 47 pr_debug("lcd: set power to %d\n", power);
45 ld->props->set_power(ld, power); 48 ld->props->set_power(ld, power);
46 rc = count; 49 rc = count;
47 } else 50 }
48 rc = -ENXIO;
49 up(&ld->sem); 51 up(&ld->sem);
50 52
51 return rc; 53 return rc;
@@ -53,14 +55,12 @@ static ssize_t lcd_store_power(struct class_device *cdev, const char *buf, size_
53 55
54static ssize_t lcd_show_contrast(struct class_device *cdev, char *buf) 56static ssize_t lcd_show_contrast(struct class_device *cdev, char *buf)
55{ 57{
56 int rc; 58 int rc = -ENXIO;
57 struct lcd_device *ld = to_lcd_device(cdev); 59 struct lcd_device *ld = to_lcd_device(cdev);
58 60
59 down(&ld->sem); 61 down(&ld->sem);
60 if (likely(ld->props && ld->props->get_contrast)) 62 if (likely(ld->props && ld->props->get_contrast))
61 rc = sprintf(buf, "%d\n", ld->props->get_contrast(ld)); 63 rc = sprintf(buf, "%d\n", ld->props->get_contrast(ld));
62 else
63 rc = -ENXIO;
64 up(&ld->sem); 64 up(&ld->sem);
65 65
66 return rc; 66 return rc;
@@ -68,12 +68,15 @@ static ssize_t lcd_show_contrast(struct class_device *cdev, char *buf)
68 68
69static ssize_t lcd_store_contrast(struct class_device *cdev, const char *buf, size_t count) 69static ssize_t lcd_store_contrast(struct class_device *cdev, const char *buf, size_t count)
70{ 70{
71 int rc, contrast; 71 int rc = -ENXIO;
72 char *endp; 72 char *endp;
73 struct lcd_device *ld = to_lcd_device(cdev); 73 struct lcd_device *ld = to_lcd_device(cdev);
74 int contrast = simple_strtoul(buf, &endp, 0);
75 size_t size = endp - buf;
74 76
75 contrast = simple_strtoul(buf, &endp, 0); 77 if (*endp && isspace(*endp))
76 if (*endp && !isspace(*endp)) 78 size++;
79 if (size != count)
77 return -EINVAL; 80 return -EINVAL;
78 81
79 down(&ld->sem); 82 down(&ld->sem);
@@ -81,8 +84,7 @@ static ssize_t lcd_store_contrast(struct class_device *cdev, const char *buf, si
81 pr_debug("lcd: set contrast to %d\n", contrast); 84 pr_debug("lcd: set contrast to %d\n", contrast);
82 ld->props->set_contrast(ld, contrast); 85 ld->props->set_contrast(ld, contrast);
83 rc = count; 86 rc = count;
84 } else 87 }
85 rc = -ENXIO;
86 up(&ld->sem); 88 up(&ld->sem);
87 89
88 return rc; 90 return rc;
@@ -90,14 +92,12 @@ static ssize_t lcd_store_contrast(struct class_device *cdev, const char *buf, si
90 92
91static ssize_t lcd_show_max_contrast(struct class_device *cdev, char *buf) 93static ssize_t lcd_show_max_contrast(struct class_device *cdev, char *buf)
92{ 94{
93 int rc; 95 int rc = -ENXIO;
94 struct lcd_device *ld = to_lcd_device(cdev); 96 struct lcd_device *ld = to_lcd_device(cdev);
95 97
96 down(&ld->sem); 98 down(&ld->sem);
97 if (likely(ld->props)) 99 if (likely(ld->props))
98 rc = sprintf(buf, "%d\n", ld->props->max_contrast); 100 rc = sprintf(buf, "%d\n", ld->props->max_contrast);
99 else
100 rc = -ENXIO;
101 up(&ld->sem); 101 up(&ld->sem);
102 102
103 return rc; 103 return rc;
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index ca020719d20b..47ba1a79adcd 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -1745,7 +1745,7 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir,
1745 fbcon_redraw_move(vc, p, 0, t, count); 1745 fbcon_redraw_move(vc, p, 0, t, count);
1746 ypan_up_redraw(vc, t, count); 1746 ypan_up_redraw(vc, t, count);
1747 if (vc->vc_rows - b > 0) 1747 if (vc->vc_rows - b > 0)
1748 fbcon_redraw_move(vc, p, b - count, 1748 fbcon_redraw_move(vc, p, b,
1749 vc->vc_rows - b, b); 1749 vc->vc_rows - b, b);
1750 } else 1750 } else
1751 fbcon_redraw_move(vc, p, t + count, b - t - count, t); 1751 fbcon_redraw_move(vc, p, t + count, b - t - count, t);
@@ -2631,7 +2631,7 @@ static int fbcon_scrolldelta(struct vc_data *vc, int lines)
2631 scr_memcpyw((u16 *) q, (u16 *) p, 2631 scr_memcpyw((u16 *) q, (u16 *) p,
2632 vc->vc_size_row); 2632 vc->vc_size_row);
2633 } 2633 }
2634 softback_in = p; 2634 softback_in = softback_curr = p;
2635 update_region(vc, vc->vc_origin, 2635 update_region(vc, vc->vc_origin,
2636 logo_lines * vc->vc_cols); 2636 logo_lines * vc->vc_cols);
2637 } 2637 }
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index 8d8eadb64853..372aa1776827 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -674,13 +674,19 @@ fb_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
674 total_size = info->fix.smem_len; 674 total_size = info->fix.smem_len;
675 675
676 if (p > total_size) 676 if (p > total_size)
677 return 0; 677 return -EFBIG;
678 678
679 if (count >= total_size) 679 if (count > total_size) {
680 err = -EFBIG;
680 count = total_size; 681 count = total_size;
682 }
683
684 if (count + p > total_size) {
685 if (!err)
686 err = -ENOSPC;
681 687
682 if (count + p > total_size)
683 count = total_size - p; 688 count = total_size - p;
689 }
684 690
685 buffer = kmalloc((count > PAGE_SIZE) ? PAGE_SIZE : count, 691 buffer = kmalloc((count > PAGE_SIZE) ? PAGE_SIZE : count,
686 GFP_KERNEL); 692 GFP_KERNEL);
@@ -722,7 +728,7 @@ fb_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
722 728
723 kfree(buffer); 729 kfree(buffer);
724 730
725 return (err) ? err : cnt; 731 return (cnt) ? cnt : err;
726} 732}
727 733
728#ifdef CONFIG_KMOD 734#ifdef CONFIG_KMOD
diff --git a/drivers/video/fbsysfs.c b/drivers/video/fbsysfs.c
index b72b05250a9d..34e07399756b 100644
--- a/drivers/video/fbsysfs.c
+++ b/drivers/video/fbsysfs.c
@@ -305,94 +305,6 @@ static ssize_t show_stride(struct class_device *class_device, char *buf)
305 return snprintf(buf, PAGE_SIZE, "%d\n", fb_info->fix.line_length); 305 return snprintf(buf, PAGE_SIZE, "%d\n", fb_info->fix.line_length);
306} 306}
307 307
308/* Format for cmap is "%02x%c%4x%4x%4x\n" */
309/* %02x entry %c transp %4x red %4x blue %4x green \n */
310/* 256 rows at 16 chars equals 4096, the normal page size */
311/* the code will automatically adjust for different page sizes */
312static ssize_t store_cmap(struct class_device *class_device, const char *buf,
313 size_t count)
314{
315 struct fb_info *fb_info = class_get_devdata(class_device);
316 int rc, i, start, length, transp = 0;
317
318 if ((count > PAGE_SIZE) || ((count % 16) != 0))
319 return -EINVAL;
320
321 if (!fb_info->fbops->fb_setcolreg && !fb_info->fbops->fb_setcmap)
322 return -EINVAL;
323
324 sscanf(buf, "%02x", &start);
325 length = count / 16;
326
327 for (i = 0; i < length; i++)
328 if (buf[i * 16 + 2] != ' ')
329 transp = 1;
330
331 /* If we can batch, do it */
332 if (fb_info->fbops->fb_setcmap && length > 1) {
333 struct fb_cmap umap;
334
335 memset(&umap, 0, sizeof(umap));
336 if ((rc = fb_alloc_cmap(&umap, length, transp)))
337 return rc;
338
339 umap.start = start;
340 for (i = 0; i < length; i++) {
341 sscanf(&buf[i * 16 + 3], "%4hx", &umap.red[i]);
342 sscanf(&buf[i * 16 + 7], "%4hx", &umap.blue[i]);
343 sscanf(&buf[i * 16 + 11], "%4hx", &umap.green[i]);
344 if (transp)
345 umap.transp[i] = (buf[i * 16 + 2] != ' ');
346 }
347 rc = fb_info->fbops->fb_setcmap(&umap, fb_info);
348 fb_copy_cmap(&umap, &fb_info->cmap);
349 fb_dealloc_cmap(&umap);
350
351 return rc ?: count;
352 }
353 for (i = 0; i < length; i++) {
354 u16 red, blue, green, tsp;
355
356 sscanf(&buf[i * 16 + 3], "%4hx", &red);
357 sscanf(&buf[i * 16 + 7], "%4hx", &blue);
358 sscanf(&buf[i * 16 + 11], "%4hx", &green);
359 tsp = (buf[i * 16 + 2] != ' ');
360 if ((rc = fb_info->fbops->fb_setcolreg(start++,
361 red, green, blue, tsp, fb_info)))
362 return rc;
363
364 fb_info->cmap.red[i] = red;
365 fb_info->cmap.blue[i] = blue;
366 fb_info->cmap.green[i] = green;
367 if (transp)
368 fb_info->cmap.transp[i] = tsp;
369 }
370 return count;
371}
372
373static ssize_t show_cmap(struct class_device *class_device, char *buf)
374{
375 struct fb_info *fb_info = class_get_devdata(class_device);
376 unsigned int i;
377
378 if (!fb_info->cmap.red || !fb_info->cmap.blue ||
379 !fb_info->cmap.green)
380 return -EINVAL;
381
382 if (fb_info->cmap.len > PAGE_SIZE / 16)
383 return -EINVAL;
384
385 /* don't mess with the format, the buffer is PAGE_SIZE */
386 /* 256 entries at 16 chars per line equals 4096 = PAGE_SIZE */
387 for (i = 0; i < fb_info->cmap.len; i++) {
388 snprintf(&buf[ i * 16], PAGE_SIZE - i * 16, "%02x%c%4x%4x%4x\n", i + fb_info->cmap.start,
389 ((fb_info->cmap.transp && fb_info->cmap.transp[i]) ? '*' : ' '),
390 fb_info->cmap.red[i], fb_info->cmap.blue[i],
391 fb_info->cmap.green[i]);
392 }
393 return 16 * fb_info->cmap.len;
394}
395
396static ssize_t store_blank(struct class_device *class_device, const char * buf, 308static ssize_t store_blank(struct class_device *class_device, const char * buf,
397 size_t count) 309 size_t count)
398{ 310{
@@ -502,10 +414,12 @@ static ssize_t show_fbstate(struct class_device *class_device, char *buf)
502 return snprintf(buf, PAGE_SIZE, "%d\n", fb_info->state); 414 return snprintf(buf, PAGE_SIZE, "%d\n", fb_info->state);
503} 415}
504 416
417/* When cmap is added back in it should be a binary attribute
418 * not a text one. Consideration should also be given to converting
419 * fbdev to use configfs instead of sysfs */
505static struct class_device_attribute class_device_attrs[] = { 420static struct class_device_attribute class_device_attrs[] = {
506 __ATTR(bits_per_pixel, S_IRUGO|S_IWUSR, show_bpp, store_bpp), 421 __ATTR(bits_per_pixel, S_IRUGO|S_IWUSR, show_bpp, store_bpp),
507 __ATTR(blank, S_IRUGO|S_IWUSR, show_blank, store_blank), 422 __ATTR(blank, S_IRUGO|S_IWUSR, show_blank, store_blank),
508 __ATTR(color_map, S_IRUGO|S_IWUSR, show_cmap, store_cmap),
509 __ATTR(console, S_IRUGO|S_IWUSR, show_console, store_console), 423 __ATTR(console, S_IRUGO|S_IWUSR, show_console, store_console),
510 __ATTR(cursor, S_IRUGO|S_IWUSR, show_cursor, store_cursor), 424 __ATTR(cursor, S_IRUGO|S_IWUSR, show_cursor, store_cursor),
511 __ATTR(mode, S_IRUGO|S_IWUSR, show_mode, store_mode), 425 __ATTR(mode, S_IRUGO|S_IWUSR, show_mode, store_mode),
diff --git a/drivers/video/i810/i810_main.c b/drivers/video/i810/i810_main.c
index 788297e9d59e..44aa2ffff973 100644
--- a/drivers/video/i810/i810_main.c
+++ b/drivers/video/i810/i810_main.c
@@ -76,8 +76,8 @@
76 * 76 *
77 * Experiment with v_offset to find out which works best for you. 77 * Experiment with v_offset to find out which works best for you.
78 */ 78 */
79static u32 v_offset_default __initdata; /* For 32 MiB Aper size, 8 should be the default */ 79static u32 v_offset_default __devinitdata; /* For 32 MiB Aper size, 8 should be the default */
80static u32 voffset __initdata = 0; 80static u32 voffset __devinitdata;
81 81
82static int i810fb_cursor(struct fb_info *info, struct fb_cursor *cursor); 82static int i810fb_cursor(struct fb_info *info, struct fb_cursor *cursor);
83static int __devinit i810fb_init_pci (struct pci_dev *dev, 83static int __devinit i810fb_init_pci (struct pci_dev *dev,
diff --git a/drivers/video/logo/Makefile b/drivers/video/logo/Makefile
index 4ef5cd19609d..b985dfad6c63 100644
--- a/drivers/video/logo/Makefile
+++ b/drivers/video/logo/Makefile
@@ -34,7 +34,7 @@ extra-y += $(call logo-cfiles,_clut224,ppm)
34extra-y += $(call logo-cfiles,_gray256,pgm) 34extra-y += $(call logo-cfiles,_gray256,pgm)
35 35
36# Create commands like "pnmtologo -t mono -n logo_mac_mono -o ..." 36# Create commands like "pnmtologo -t mono -n logo_mac_mono -o ..."
37quiet_cmd_logo = LOGO $@ 37quiet_cmd_logo = LOGO $@
38 cmd_logo = scripts/pnmtologo \ 38 cmd_logo = scripts/pnmtologo \
39 -t $(patsubst $*_%,%,$(notdir $(basename $<))) \ 39 -t $(patsubst $*_%,%,$(notdir $(basename $<))) \
40 -n $(notdir $(basename $<)) -o $@ $< 40 -n $(notdir $(basename $<)) -o $@ $<
diff --git a/drivers/video/matrox/g450_pll.c b/drivers/video/matrox/g450_pll.c
index 8073a73f6f35..440272ad10e7 100644
--- a/drivers/video/matrox/g450_pll.c
+++ b/drivers/video/matrox/g450_pll.c
@@ -316,14 +316,24 @@ static int __g450_setclk(WPMINFO unsigned int fout, unsigned int pll,
316 case M_PIXEL_PLL_B: 316 case M_PIXEL_PLL_B:
317 case M_PIXEL_PLL_C: 317 case M_PIXEL_PLL_C:
318 { 318 {
319 u_int8_t tmp; 319 u_int8_t tmp, xpwrctrl;
320 unsigned long flags; 320 unsigned long flags;
321 321
322 matroxfb_DAC_lock_irqsave(flags); 322 matroxfb_DAC_lock_irqsave(flags);
323
324 xpwrctrl = matroxfb_DAC_in(PMINFO M1064_XPWRCTRL);
325 matroxfb_DAC_out(PMINFO M1064_XPWRCTRL, xpwrctrl & ~M1064_XPWRCTRL_PANELPDN);
326 mga_outb(M_SEQ_INDEX, M_SEQ1);
327 mga_outb(M_SEQ_DATA, mga_inb(M_SEQ_DATA) | M_SEQ1_SCROFF);
323 tmp = matroxfb_DAC_in(PMINFO M1064_XPIXCLKCTRL); 328 tmp = matroxfb_DAC_in(PMINFO M1064_XPIXCLKCTRL);
329 tmp |= M1064_XPIXCLKCTRL_DIS;
324 if (!(tmp & M1064_XPIXCLKCTRL_PLL_UP)) { 330 if (!(tmp & M1064_XPIXCLKCTRL_PLL_UP)) {
325 matroxfb_DAC_out(PMINFO M1064_XPIXCLKCTRL, tmp | M1064_XPIXCLKCTRL_PLL_UP); 331 tmp |= M1064_XPIXCLKCTRL_PLL_UP;
326 } 332 }
333 matroxfb_DAC_out(PMINFO M1064_XPIXCLKCTRL, tmp);
334 matroxfb_DAC_out(PMINFO M1064_XDVICLKCTRL, 0);
335 matroxfb_DAC_out(PMINFO M1064_XPWRCTRL, xpwrctrl);
336
327 matroxfb_DAC_unlock_irqrestore(flags); 337 matroxfb_DAC_unlock_irqrestore(flags);
328 } 338 }
329 { 339 {
@@ -418,6 +428,15 @@ static int __g450_setclk(WPMINFO unsigned int fout, unsigned int pll,
418 frequency to higher - with <= lowest wins, while 428 frequency to higher - with <= lowest wins, while
419 with < highest one wins */ 429 with < highest one wins */
420 if (delta <= deltaarray[idx-1]) { 430 if (delta <= deltaarray[idx-1]) {
431 /* all else being equal except VCO,
432 * choose VCO not near (within 1/16th or so) VCOmin
433 * (freqs near VCOmin aren't as stable)
434 */
435 if (delta == deltaarray[idx-1]
436 && vco != g450_mnp2vco(PMINFO mnparray[idx-1])
437 && vco < (pi->vcomin * 17 / 16)) {
438 break;
439 }
421 mnparray[idx] = mnparray[idx-1]; 440 mnparray[idx] = mnparray[idx-1];
422 deltaarray[idx] = deltaarray[idx-1]; 441 deltaarray[idx] = deltaarray[idx-1];
423 } else { 442 } else {
diff --git a/drivers/video/matrox/matroxfb_DAC1064.h b/drivers/video/matrox/matroxfb_DAC1064.h
index 2e7238aa2432..56513a5d220b 100644
--- a/drivers/video/matrox/matroxfb_DAC1064.h
+++ b/drivers/video/matrox/matroxfb_DAC1064.h
@@ -40,6 +40,7 @@ void DAC1064_global_restore(WPMINFO2);
40#define M1064_XCURCOL1RED 0x0C 40#define M1064_XCURCOL1RED 0x0C
41#define M1064_XCURCOL1GREEN 0x0D 41#define M1064_XCURCOL1GREEN 0x0D
42#define M1064_XCURCOL1BLUE 0x0E 42#define M1064_XCURCOL1BLUE 0x0E
43#define M1064_XDVICLKCTRL 0x0F
43#define M1064_XCURCOL2RED 0x10 44#define M1064_XCURCOL2RED 0x10
44#define M1064_XCURCOL2GREEN 0x11 45#define M1064_XCURCOL2GREEN 0x11
45#define M1064_XCURCOL2BLUE 0x12 46#define M1064_XCURCOL2BLUE 0x12
@@ -144,6 +145,7 @@ void DAC1064_global_restore(WPMINFO2);
144#define M1064_XVIDPLLN 0x8F 145#define M1064_XVIDPLLN 0x8F
145 146
146#define M1064_XPWRCTRL 0xA0 147#define M1064_XPWRCTRL 0xA0
148#define M1064_XPWRCTRL_PANELPDN 0x04
147 149
148#define M1064_XPANMODE 0xA2 150#define M1064_XPANMODE 0xA2
149 151
diff --git a/drivers/video/matrox/matroxfb_base.h b/drivers/video/matrox/matroxfb_base.h
index 3a3e1804c56a..b71737178d0d 100644
--- a/drivers/video/matrox/matroxfb_base.h
+++ b/drivers/video/matrox/matroxfb_base.h
@@ -672,6 +672,8 @@ void matroxfb_unregister_driver(struct matroxfb_driver* drv);
672 672
673#define M_SEQ_INDEX 0x1FC4 673#define M_SEQ_INDEX 0x1FC4
674#define M_SEQ_DATA 0x1FC5 674#define M_SEQ_DATA 0x1FC5
675#define M_SEQ1 0x01
676#define M_SEQ1_SCROFF 0x20
675 677
676#define M_MISC_REG_READ 0x1FCC 678#define M_MISC_REG_READ 0x1FCC
677 679
diff --git a/drivers/video/maxinefb.c b/drivers/video/maxinefb.c
index 743e7ad26acc..f85421bf7cb5 100644
--- a/drivers/video/maxinefb.c
+++ b/drivers/video/maxinefb.c
@@ -55,7 +55,7 @@ static struct fb_var_screeninfo maxinefb_defined = {
55}; 55};
56 56
57static struct fb_fix_screeninfo maxinefb_fix = { 57static struct fb_fix_screeninfo maxinefb_fix = {
58 .id = "Maxine onboard graphics 1024x768x8", 58 .id = "Maxine",
59 .smem_len = (1024*768), 59 .smem_len = (1024*768),
60 .type = FB_TYPE_PACKED_PIXELS, 60 .type = FB_TYPE_PACKED_PIXELS,
61 .visual = FB_VISUAL_PSEUDOCOLOR, 61 .visual = FB_VISUAL_PSEUDOCOLOR,
@@ -107,8 +107,6 @@ static int maxinefb_setcolreg(unsigned regno, unsigned red, unsigned green,
107 107
108static struct fb_ops maxinefb_ops = { 108static struct fb_ops maxinefb_ops = {
109 .owner = THIS_MODULE, 109 .owner = THIS_MODULE,
110 .fb_get_fix = gen_get_fix,
111 .fb_get_var = gen_get_var,
112 .fb_setcolreg = maxinefb_setcolreg, 110 .fb_setcolreg = maxinefb_setcolreg,
113 .fb_fillrect = cfb_fillrect, 111 .fb_fillrect = cfb_fillrect,
114 .fb_copyarea = cfb_copyarea, 112 .fb_copyarea = cfb_copyarea,
diff --git a/drivers/video/pm2fb.c b/drivers/video/pm2fb.c
index 5fe197943deb..4e963930b50a 100644
--- a/drivers/video/pm2fb.c
+++ b/drivers/video/pm2fb.c
@@ -73,8 +73,8 @@ static char *mode __devinitdata = NULL;
73 * these flags allow the user to specify that requests for +ve sync 73 * these flags allow the user to specify that requests for +ve sync
74 * should be silently turned in -ve sync. 74 * should be silently turned in -ve sync.
75 */ 75 */
76static int lowhsync __devinitdata = 0; 76static int lowhsync;
77static int lowvsync __devinitdata = 0; 77static int lowvsync;
78 78
79/* 79/*
80 * The hardware state of the graphics card that isn't part of the 80 * The hardware state of the graphics card that isn't part of the
diff --git a/drivers/video/savage/savagefb_driver.c b/drivers/video/savage/savagefb_driver.c
index 10e6b3aab9ea..0da624e6524f 100644
--- a/drivers/video/savage/savagefb_driver.c
+++ b/drivers/video/savage/savagefb_driver.c
@@ -73,7 +73,7 @@
73/* --------------------------------------------------------------------- */ 73/* --------------------------------------------------------------------- */
74 74
75 75
76static char *mode_option __initdata = NULL; 76static char *mode_option __devinitdata = NULL;
77 77
78#ifdef MODULE 78#ifdef MODULE
79 79
@@ -1545,7 +1545,7 @@ static int __devinit savage_map_mmio (struct fb_info *info)
1545 return 0; 1545 return 0;
1546} 1546}
1547 1547
1548static void __devinit savage_unmap_mmio (struct fb_info *info) 1548static void savage_unmap_mmio (struct fb_info *info)
1549{ 1549{
1550 struct savagefb_par *par = info->par; 1550 struct savagefb_par *par = info->par;
1551 DBG ("savage_unmap_mmio"); 1551 DBG ("savage_unmap_mmio");
@@ -1597,7 +1597,7 @@ static int __devinit savage_map_video (struct fb_info *info,
1597 return 0; 1597 return 0;
1598} 1598}
1599 1599
1600static void __devinit savage_unmap_video (struct fb_info *info) 1600static void savage_unmap_video (struct fb_info *info)
1601{ 1601{
1602 struct savagefb_par *par = info->par; 1602 struct savagefb_par *par = info->par;
1603 1603
@@ -1614,7 +1614,7 @@ static void __devinit savage_unmap_video (struct fb_info *info)
1614 } 1614 }
1615} 1615}
1616 1616
1617static int __devinit savage_init_hw (struct savagefb_par *par) 1617static int savage_init_hw (struct savagefb_par *par)
1618{ 1618{
1619 unsigned char config1, m, n, n1, n2, sr8, cr3f, cr66 = 0, tmp; 1619 unsigned char config1, m, n, n1, n2, sr8, cr3f, cr66 = 0, tmp;
1620 1620
diff --git a/fs/9p/fcall.c b/fs/9p/fcall.c
index 71742ba150c4..6f2617820a4e 100644
--- a/fs/9p/fcall.c
+++ b/fs/9p/fcall.c
@@ -98,23 +98,20 @@ v9fs_t_attach(struct v9fs_session_info *v9ses, char *uname, char *aname,
98static void v9fs_t_clunk_cb(void *a, struct v9fs_fcall *tc, 98static void v9fs_t_clunk_cb(void *a, struct v9fs_fcall *tc,
99 struct v9fs_fcall *rc, int err) 99 struct v9fs_fcall *rc, int err)
100{ 100{
101 int fid; 101 int fid, id;
102 struct v9fs_session_info *v9ses; 102 struct v9fs_session_info *v9ses;
103 103
104 if (err) 104 id = 0;
105 return;
106
107 fid = tc->params.tclunk.fid; 105 fid = tc->params.tclunk.fid;
108 kfree(tc); 106 if (rc)
109 107 id = rc->id;
110 if (!rc)
111 return;
112
113 v9ses = a;
114 if (rc->id == RCLUNK)
115 v9fs_put_idpool(fid, &v9ses->fidpool);
116 108
109 kfree(tc);
117 kfree(rc); 110 kfree(rc);
111 if (id == RCLUNK) {
112 v9ses = a;
113 v9fs_put_idpool(fid, &v9ses->fidpool);
114 }
118} 115}
119 116
120/** 117/**
diff --git a/fs/9p/mux.c b/fs/9p/mux.c
index 3e5b124a7212..f4407eb276c7 100644
--- a/fs/9p/mux.c
+++ b/fs/9p/mux.c
@@ -50,15 +50,23 @@ enum {
50 Wpending = 8, /* can write */ 50 Wpending = 8, /* can write */
51}; 51};
52 52
53enum {
54 None,
55 Flushing,
56 Flushed,
57};
58
53struct v9fs_mux_poll_task; 59struct v9fs_mux_poll_task;
54 60
55struct v9fs_req { 61struct v9fs_req {
62 spinlock_t lock;
56 int tag; 63 int tag;
57 struct v9fs_fcall *tcall; 64 struct v9fs_fcall *tcall;
58 struct v9fs_fcall *rcall; 65 struct v9fs_fcall *rcall;
59 int err; 66 int err;
60 v9fs_mux_req_callback cb; 67 v9fs_mux_req_callback cb;
61 void *cba; 68 void *cba;
69 int flush;
62 struct list_head req_list; 70 struct list_head req_list;
63}; 71};
64 72
@@ -96,8 +104,8 @@ struct v9fs_mux_poll_task {
96 104
97struct v9fs_mux_rpc { 105struct v9fs_mux_rpc {
98 struct v9fs_mux_data *m; 106 struct v9fs_mux_data *m;
99 struct v9fs_req *req;
100 int err; 107 int err;
108 struct v9fs_fcall *tcall;
101 struct v9fs_fcall *rcall; 109 struct v9fs_fcall *rcall;
102 wait_queue_head_t wqueue; 110 wait_queue_head_t wqueue;
103}; 111};
@@ -524,10 +532,9 @@ again:
524 532
525static void process_request(struct v9fs_mux_data *m, struct v9fs_req *req) 533static void process_request(struct v9fs_mux_data *m, struct v9fs_req *req)
526{ 534{
527 int ecode, tag; 535 int ecode;
528 struct v9fs_str *ename; 536 struct v9fs_str *ename;
529 537
530 tag = req->tag;
531 if (!req->err && req->rcall->id == RERROR) { 538 if (!req->err && req->rcall->id == RERROR) {
532 ecode = req->rcall->params.rerror.errno; 539 ecode = req->rcall->params.rerror.errno;
533 ename = &req->rcall->params.rerror.error; 540 ename = &req->rcall->params.rerror.error;
@@ -553,23 +560,6 @@ static void process_request(struct v9fs_mux_data *m, struct v9fs_req *req)
553 if (!req->err) 560 if (!req->err)
554 req->err = -EIO; 561 req->err = -EIO;
555 } 562 }
556
557 if (req->err == ERREQFLUSH)
558 return;
559
560 if (req->cb) {
561 dprintk(DEBUG_MUX, "calling callback tcall %p rcall %p\n",
562 req->tcall, req->rcall);
563
564 (*req->cb) (req->cba, req->tcall, req->rcall, req->err);
565 req->cb = NULL;
566 } else
567 kfree(req->rcall);
568
569 v9fs_mux_put_tag(m, tag);
570
571 wake_up(&m->equeue);
572 kfree(req);
573} 563}
574 564
575/** 565/**
@@ -669,17 +659,26 @@ static void v9fs_read_work(void *a)
669 list_for_each_entry_safe(rreq, rptr, &m->req_list, req_list) { 659 list_for_each_entry_safe(rreq, rptr, &m->req_list, req_list) {
670 if (rreq->tag == rcall->tag) { 660 if (rreq->tag == rcall->tag) {
671 req = rreq; 661 req = rreq;
672 req->rcall = rcall; 662 if (req->flush != Flushing)
673 list_del(&req->req_list); 663 list_del(&req->req_list);
674 spin_unlock(&m->lock);
675 process_request(m, req);
676 break; 664 break;
677 } 665 }
678
679 } 666 }
667 spin_unlock(&m->lock);
680 668
681 if (!req) { 669 if (req) {
682 spin_unlock(&m->lock); 670 req->rcall = rcall;
671 process_request(m, req);
672
673 if (req->flush != Flushing) {
674 if (req->cb)
675 (*req->cb) (req, req->cba);
676 else
677 kfree(req->rcall);
678
679 wake_up(&m->equeue);
680 }
681 } else {
683 if (err >= 0 && rcall->id != RFLUSH) 682 if (err >= 0 && rcall->id != RFLUSH)
684 dprintk(DEBUG_ERROR, 683 dprintk(DEBUG_ERROR,
685 "unexpected response mux %p id %d tag %d\n", 684 "unexpected response mux %p id %d tag %d\n",
@@ -746,7 +745,6 @@ static struct v9fs_req *v9fs_send_request(struct v9fs_mux_data *m,
746 return ERR_PTR(-ENOMEM); 745 return ERR_PTR(-ENOMEM);
747 746
748 v9fs_set_tag(tc, n); 747 v9fs_set_tag(tc, n);
749
750 if ((v9fs_debug_level&DEBUG_FCALL) == DEBUG_FCALL) { 748 if ((v9fs_debug_level&DEBUG_FCALL) == DEBUG_FCALL) {
751 char buf[150]; 749 char buf[150];
752 750
@@ -754,12 +752,14 @@ static struct v9fs_req *v9fs_send_request(struct v9fs_mux_data *m,
754 printk(KERN_NOTICE "<<< %p %s\n", m, buf); 752 printk(KERN_NOTICE "<<< %p %s\n", m, buf);
755 } 753 }
756 754
755 spin_lock_init(&req->lock);
757 req->tag = n; 756 req->tag = n;
758 req->tcall = tc; 757 req->tcall = tc;
759 req->rcall = NULL; 758 req->rcall = NULL;
760 req->err = 0; 759 req->err = 0;
761 req->cb = cb; 760 req->cb = cb;
762 req->cba = cba; 761 req->cba = cba;
762 req->flush = None;
763 763
764 spin_lock(&m->lock); 764 spin_lock(&m->lock);
765 list_add_tail(&req->req_list, &m->unsent_req_list); 765 list_add_tail(&req->req_list, &m->unsent_req_list);
@@ -776,72 +776,108 @@ static struct v9fs_req *v9fs_send_request(struct v9fs_mux_data *m,
776 return req; 776 return req;
777} 777}
778 778
779static void v9fs_mux_flush_cb(void *a, struct v9fs_fcall *tc, 779static void v9fs_mux_free_request(struct v9fs_mux_data *m, struct v9fs_req *req)
780 struct v9fs_fcall *rc, int err) 780{
781 v9fs_mux_put_tag(m, req->tag);
782 kfree(req);
783}
784
785static void v9fs_mux_flush_cb(struct v9fs_req *freq, void *a)
781{ 786{
782 v9fs_mux_req_callback cb; 787 v9fs_mux_req_callback cb;
783 int tag; 788 int tag;
784 struct v9fs_mux_data *m; 789 struct v9fs_mux_data *m;
785 struct v9fs_req *req, *rptr; 790 struct v9fs_req *req, *rreq, *rptr;
786 791
787 m = a; 792 m = a;
788 dprintk(DEBUG_MUX, "mux %p tc %p rc %p err %d oldtag %d\n", m, tc, 793 dprintk(DEBUG_MUX, "mux %p tc %p rc %p err %d oldtag %d\n", m,
789 rc, err, tc->params.tflush.oldtag); 794 freq->tcall, freq->rcall, freq->err,
795 freq->tcall->params.tflush.oldtag);
790 796
791 spin_lock(&m->lock); 797 spin_lock(&m->lock);
792 cb = NULL; 798 cb = NULL;
793 tag = tc->params.tflush.oldtag; 799 tag = freq->tcall->params.tflush.oldtag;
794 list_for_each_entry_safe(req, rptr, &m->req_list, req_list) { 800 req = NULL;
795 if (req->tag == tag) { 801 list_for_each_entry_safe(rreq, rptr, &m->req_list, req_list) {
802 if (rreq->tag == tag) {
803 req = rreq;
796 list_del(&req->req_list); 804 list_del(&req->req_list);
797 if (req->cb) {
798 cb = req->cb;
799 req->cb = NULL;
800 spin_unlock(&m->lock);
801 (*cb) (req->cba, req->tcall, req->rcall,
802 req->err);
803 }
804 kfree(req);
805 wake_up(&m->equeue);
806 break; 805 break;
807 } 806 }
808 } 807 }
808 spin_unlock(&m->lock);
809 809
810 if (!cb) 810 if (req) {
811 spin_unlock(&m->lock); 811 spin_lock(&req->lock);
812 req->flush = Flushed;
813 spin_unlock(&req->lock);
814
815 if (req->cb)
816 (*req->cb) (req, req->cba);
817 else
818 kfree(req->rcall);
819
820 wake_up(&m->equeue);
821 }
812 822
813 v9fs_mux_put_tag(m, tag); 823 kfree(freq->tcall);
814 kfree(tc); 824 kfree(freq->rcall);
815 kfree(rc); 825 v9fs_mux_free_request(m, freq);
816} 826}
817 827
818static void 828static int
819v9fs_mux_flush_request(struct v9fs_mux_data *m, struct v9fs_req *req) 829v9fs_mux_flush_request(struct v9fs_mux_data *m, struct v9fs_req *req)
820{ 830{
821 struct v9fs_fcall *fc; 831 struct v9fs_fcall *fc;
832 struct v9fs_req *rreq, *rptr;
822 833
823 dprintk(DEBUG_MUX, "mux %p req %p tag %d\n", m, req, req->tag); 834 dprintk(DEBUG_MUX, "mux %p req %p tag %d\n", m, req, req->tag);
824 835
836 /* if a response was received for a request, do nothing */
837 spin_lock(&req->lock);
838 if (req->rcall || req->err) {
839 spin_unlock(&req->lock);
840 dprintk(DEBUG_MUX, "mux %p req %p response already received\n", m, req);
841 return 0;
842 }
843
844 req->flush = Flushing;
845 spin_unlock(&req->lock);
846
847 spin_lock(&m->lock);
848 /* if the request is not sent yet, just remove it from the list */
849 list_for_each_entry_safe(rreq, rptr, &m->unsent_req_list, req_list) {
850 if (rreq->tag == req->tag) {
851 dprintk(DEBUG_MUX, "mux %p req %p request is not sent yet\n", m, req);
852 list_del(&rreq->req_list);
853 req->flush = Flushed;
854 spin_unlock(&m->lock);
855 if (req->cb)
856 (*req->cb) (req, req->cba);
857 return 0;
858 }
859 }
860 spin_unlock(&m->lock);
861
862 clear_thread_flag(TIF_SIGPENDING);
825 fc = v9fs_create_tflush(req->tag); 863 fc = v9fs_create_tflush(req->tag);
826 v9fs_send_request(m, fc, v9fs_mux_flush_cb, m); 864 v9fs_send_request(m, fc, v9fs_mux_flush_cb, m);
865 return 1;
827} 866}
828 867
829static void 868static void
830v9fs_mux_rpc_cb(void *a, struct v9fs_fcall *tc, struct v9fs_fcall *rc, int err) 869v9fs_mux_rpc_cb(struct v9fs_req *req, void *a)
831{ 870{
832 struct v9fs_mux_rpc *r; 871 struct v9fs_mux_rpc *r;
833 872
834 if (err == ERREQFLUSH) { 873 dprintk(DEBUG_MUX, "req %p r %p\n", req, a);
835 kfree(rc);
836 dprintk(DEBUG_MUX, "err req flush\n");
837 return;
838 }
839
840 r = a; 874 r = a;
841 dprintk(DEBUG_MUX, "mux %p req %p tc %p rc %p err %d\n", r->m, r->req, 875 r->rcall = req->rcall;
842 tc, rc, err); 876 r->err = req->err;
843 r->rcall = rc; 877
844 r->err = err; 878 if (req->flush!=None && !req->err)
879 r->err = -ERESTARTSYS;
880
845 wake_up(&r->wqueue); 881 wake_up(&r->wqueue);
846} 882}
847 883
@@ -856,12 +892,13 @@ int
856v9fs_mux_rpc(struct v9fs_mux_data *m, struct v9fs_fcall *tc, 892v9fs_mux_rpc(struct v9fs_mux_data *m, struct v9fs_fcall *tc,
857 struct v9fs_fcall **rc) 893 struct v9fs_fcall **rc)
858{ 894{
859 int err; 895 int err, sigpending;
860 unsigned long flags; 896 unsigned long flags;
861 struct v9fs_req *req; 897 struct v9fs_req *req;
862 struct v9fs_mux_rpc r; 898 struct v9fs_mux_rpc r;
863 899
864 r.err = 0; 900 r.err = 0;
901 r.tcall = tc;
865 r.rcall = NULL; 902 r.rcall = NULL;
866 r.m = m; 903 r.m = m;
867 init_waitqueue_head(&r.wqueue); 904 init_waitqueue_head(&r.wqueue);
@@ -869,48 +906,50 @@ v9fs_mux_rpc(struct v9fs_mux_data *m, struct v9fs_fcall *tc,
869 if (rc) 906 if (rc)
870 *rc = NULL; 907 *rc = NULL;
871 908
909 sigpending = 0;
910 if (signal_pending(current)) {
911 sigpending = 1;
912 clear_thread_flag(TIF_SIGPENDING);
913 }
914
872 req = v9fs_send_request(m, tc, v9fs_mux_rpc_cb, &r); 915 req = v9fs_send_request(m, tc, v9fs_mux_rpc_cb, &r);
873 if (IS_ERR(req)) { 916 if (IS_ERR(req)) {
874 err = PTR_ERR(req); 917 err = PTR_ERR(req);
875 dprintk(DEBUG_MUX, "error %d\n", err); 918 dprintk(DEBUG_MUX, "error %d\n", err);
876 return PTR_ERR(req); 919 return err;
877 } 920 }
878 921
879 r.req = req;
880 dprintk(DEBUG_MUX, "mux %p tc %p tag %d rpc %p req %p\n", m, tc,
881 req->tag, &r, req);
882 err = wait_event_interruptible(r.wqueue, r.rcall != NULL || r.err < 0); 922 err = wait_event_interruptible(r.wqueue, r.rcall != NULL || r.err < 0);
883 if (r.err < 0) 923 if (r.err < 0)
884 err = r.err; 924 err = r.err;
885 925
886 if (err == -ERESTARTSYS && m->trans->status == Connected && m->err == 0) { 926 if (err == -ERESTARTSYS && m->trans->status == Connected && m->err == 0) {
887 spin_lock(&m->lock); 927 if (v9fs_mux_flush_request(m, req)) {
888 req->tcall = NULL; 928 /* wait until we get response of the flush message */
889 req->err = ERREQFLUSH; 929 do {
890 spin_unlock(&m->lock); 930 clear_thread_flag(TIF_SIGPENDING);
931 err = wait_event_interruptible(r.wqueue,
932 r.rcall || r.err);
933 } while (!r.rcall && !r.err && err==-ERESTARTSYS &&
934 m->trans->status==Connected && !m->err);
935 }
936 sigpending = 1;
937 }
891 938
892 clear_thread_flag(TIF_SIGPENDING); 939 if (sigpending) {
893 v9fs_mux_flush_request(m, req);
894 spin_lock_irqsave(&current->sighand->siglock, flags); 940 spin_lock_irqsave(&current->sighand->siglock, flags);
895 recalc_sigpending(); 941 recalc_sigpending();
896 spin_unlock_irqrestore(&current->sighand->siglock, flags); 942 spin_unlock_irqrestore(&current->sighand->siglock, flags);
897 } 943 }
898 944
899 if (!err) { 945 if (rc)
900 if (r.rcall) 946 *rc = r.rcall;
901 dprintk(DEBUG_MUX, "got response id %d tag %d\n", 947 else
902 r.rcall->id, r.rcall->tag);
903
904 if (rc)
905 *rc = r.rcall;
906 else
907 kfree(r.rcall);
908 } else {
909 kfree(r.rcall); 948 kfree(r.rcall);
910 dprintk(DEBUG_MUX, "got error %d\n", err); 949
911 if (err > 0) 950 v9fs_mux_free_request(m, req);
912 err = -EIO; 951 if (err > 0)
913 } 952 err = -EIO;
914 953
915 return err; 954 return err;
916} 955}
@@ -951,12 +990,15 @@ void v9fs_mux_cancel(struct v9fs_mux_data *m, int err)
951 struct v9fs_req *req, *rtmp; 990 struct v9fs_req *req, *rtmp;
952 LIST_HEAD(cancel_list); 991 LIST_HEAD(cancel_list);
953 992
954 dprintk(DEBUG_MUX, "mux %p err %d\n", m, err); 993 dprintk(DEBUG_ERROR, "mux %p err %d\n", m, err);
955 m->err = err; 994 m->err = err;
956 spin_lock(&m->lock); 995 spin_lock(&m->lock);
957 list_for_each_entry_safe(req, rtmp, &m->req_list, req_list) { 996 list_for_each_entry_safe(req, rtmp, &m->req_list, req_list) {
958 list_move(&req->req_list, &cancel_list); 997 list_move(&req->req_list, &cancel_list);
959 } 998 }
999 list_for_each_entry_safe(req, rtmp, &m->unsent_req_list, req_list) {
1000 list_move(&req->req_list, &cancel_list);
1001 }
960 spin_unlock(&m->lock); 1002 spin_unlock(&m->lock);
961 1003
962 list_for_each_entry_safe(req, rtmp, &cancel_list, req_list) { 1004 list_for_each_entry_safe(req, rtmp, &cancel_list, req_list) {
@@ -965,11 +1007,9 @@ void v9fs_mux_cancel(struct v9fs_mux_data *m, int err)
965 req->err = err; 1007 req->err = err;
966 1008
967 if (req->cb) 1009 if (req->cb)
968 (*req->cb) (req->cba, req->tcall, req->rcall, req->err); 1010 (*req->cb) (req, req->cba);
969 else 1011 else
970 kfree(req->rcall); 1012 kfree(req->rcall);
971
972 kfree(req);
973 } 1013 }
974 1014
975 wake_up(&m->equeue); 1015 wake_up(&m->equeue);
diff --git a/fs/9p/mux.h b/fs/9p/mux.h
index e90bfd32ea42..fb10c50186a1 100644
--- a/fs/9p/mux.h
+++ b/fs/9p/mux.h
@@ -24,6 +24,7 @@
24 */ 24 */
25 25
26struct v9fs_mux_data; 26struct v9fs_mux_data;
27struct v9fs_req;
27 28
28/** 29/**
29 * v9fs_mux_req_callback - callback function that is called when the 30 * v9fs_mux_req_callback - callback function that is called when the
@@ -36,8 +37,7 @@ struct v9fs_mux_data;
36 * @rc - response call 37 * @rc - response call
37 * @err - error code (non-zero if error occured) 38 * @err - error code (non-zero if error occured)
38 */ 39 */
39typedef void (*v9fs_mux_req_callback)(void *a, struct v9fs_fcall *tc, 40typedef void (*v9fs_mux_req_callback)(struct v9fs_req *req, void *a);
40 struct v9fs_fcall *rc, int err);
41 41
42int v9fs_mux_global_init(void); 42int v9fs_mux_global_init(void);
43void v9fs_mux_global_exit(void); 43void v9fs_mux_global_exit(void);
diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c
index 083dcfcd158e..1a8e46084f0e 100644
--- a/fs/9p/vfs_file.c
+++ b/fs/9p/vfs_file.c
@@ -72,11 +72,17 @@ int v9fs_file_open(struct inode *inode, struct file *file)
72 return -ENOSPC; 72 return -ENOSPC;
73 } 73 }
74 74
75 err = v9fs_t_walk(v9ses, vfid->fid, fid, NULL, NULL); 75 err = v9fs_t_walk(v9ses, vfid->fid, fid, NULL, &fcall);
76 if (err < 0) { 76 if (err < 0) {
77 dprintk(DEBUG_ERROR, "rewalk didn't work\n"); 77 dprintk(DEBUG_ERROR, "rewalk didn't work\n");
78 goto put_fid; 78 if (fcall && fcall->id == RWALK)
79 goto clunk_fid;
80 else {
81 v9fs_put_idpool(fid, &v9ses->fidpool);
82 goto free_fcall;
83 }
79 } 84 }
85 kfree(fcall);
80 86
81 /* TODO: do special things for O_EXCL, O_NOFOLLOW, O_SYNC */ 87 /* TODO: do special things for O_EXCL, O_NOFOLLOW, O_SYNC */
82 /* translate open mode appropriately */ 88 /* translate open mode appropriately */
@@ -109,8 +115,7 @@ int v9fs_file_open(struct inode *inode, struct file *file)
109clunk_fid: 115clunk_fid:
110 v9fs_t_clunk(v9ses, fid); 116 v9fs_t_clunk(v9ses, fid);
111 117
112put_fid: 118free_fcall:
113 v9fs_put_idpool(fid, &v9ses->fidpool);
114 kfree(fcall); 119 kfree(fcall);
115 120
116 return err; 121 return err;
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index 133db366d306..2cb87ba4b1c1 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -270,7 +270,10 @@ v9fs_create(struct v9fs_session_info *v9ses, u32 pfid, char *name, u32 perm,
270 err = v9fs_t_walk(v9ses, pfid, fid, NULL, &fcall); 270 err = v9fs_t_walk(v9ses, pfid, fid, NULL, &fcall);
271 if (err < 0) { 271 if (err < 0) {
272 PRINT_FCALL_ERROR("clone error", fcall); 272 PRINT_FCALL_ERROR("clone error", fcall);
273 goto put_fid; 273 if (fcall && fcall->id == RWALK)
274 goto clunk_fid;
275 else
276 goto put_fid;
274 } 277 }
275 kfree(fcall); 278 kfree(fcall);
276 279
@@ -322,6 +325,9 @@ v9fs_clone_walk(struct v9fs_session_info *v9ses, u32 fid, struct dentry *dentry)
322 &fcall); 325 &fcall);
323 326
324 if (err < 0) { 327 if (err < 0) {
328 if (fcall && fcall->id == RWALK)
329 goto clunk_fid;
330
325 PRINT_FCALL_ERROR("walk error", fcall); 331 PRINT_FCALL_ERROR("walk error", fcall);
326 v9fs_put_idpool(nfid, &v9ses->fidpool); 332 v9fs_put_idpool(nfid, &v9ses->fidpool);
327 goto error; 333 goto error;
@@ -640,19 +646,26 @@ static struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry,
640 } 646 }
641 647
642 result = v9fs_t_walk(v9ses, dirfidnum, newfid, 648 result = v9fs_t_walk(v9ses, dirfidnum, newfid,
643 (char *)dentry->d_name.name, NULL); 649 (char *)dentry->d_name.name, &fcall);
650
644 if (result < 0) { 651 if (result < 0) {
645 v9fs_put_idpool(newfid, &v9ses->fidpool); 652 if (fcall && fcall->id == RWALK)
653 v9fs_t_clunk(v9ses, newfid);
654 else
655 v9fs_put_idpool(newfid, &v9ses->fidpool);
656
646 if (result == -ENOENT) { 657 if (result == -ENOENT) {
647 d_add(dentry, NULL); 658 d_add(dentry, NULL);
648 dprintk(DEBUG_VFS, 659 dprintk(DEBUG_VFS,
649 "Return negative dentry %p count %d\n", 660 "Return negative dentry %p count %d\n",
650 dentry, atomic_read(&dentry->d_count)); 661 dentry, atomic_read(&dentry->d_count));
662 kfree(fcall);
651 return NULL; 663 return NULL;
652 } 664 }
653 dprintk(DEBUG_ERROR, "walk error:%d\n", result); 665 dprintk(DEBUG_ERROR, "walk error:%d\n", result);
654 goto FreeFcall; 666 goto FreeFcall;
655 } 667 }
668 kfree(fcall);
656 669
657 result = v9fs_t_stat(v9ses, newfid, &fcall); 670 result = v9fs_t_stat(v9ses, newfid, &fcall);
658 if (result < 0) { 671 if (result < 0) {
diff --git a/fs/Kconfig b/fs/Kconfig
index 2524629dc835..f9b5842c8d2d 100644
--- a/fs/Kconfig
+++ b/fs/Kconfig
@@ -842,6 +842,12 @@ config TMPFS
842config HUGETLBFS 842config HUGETLBFS
843 bool "HugeTLB file system support" 843 bool "HugeTLB file system support"
844 depends X86 || IA64 || PPC64 || SPARC64 || SUPERH || BROKEN 844 depends X86 || IA64 || PPC64 || SPARC64 || SUPERH || BROKEN
845 help
846 hugetlbfs is a filesystem backing for HugeTLB pages, based on
847 ramfs. For architectures that support it, say Y here and read
848 <file:Documentation/vm/hugetlbpage.txt> for details.
849
850 If unsure, say N.
845 851
846config HUGETLB_PAGE 852config HUGETLB_PAGE
847 def_bool HUGETLBFS 853 def_bool HUGETLBFS
diff --git a/fs/Makefile b/fs/Makefile
index 83bf478e786b..078d3d1191a5 100644
--- a/fs/Makefile
+++ b/fs/Makefile
@@ -45,6 +45,7 @@ obj-$(CONFIG_DNOTIFY) += dnotify.o
45obj-$(CONFIG_PROC_FS) += proc/ 45obj-$(CONFIG_PROC_FS) += proc/
46obj-y += partitions/ 46obj-y += partitions/
47obj-$(CONFIG_SYSFS) += sysfs/ 47obj-$(CONFIG_SYSFS) += sysfs/
48obj-$(CONFIG_CONFIGFS_FS) += configfs/
48obj-y += devpts/ 49obj-y += devpts/
49 50
50obj-$(CONFIG_PROFILING) += dcookies.o 51obj-$(CONFIG_PROFILING) += dcookies.o
@@ -100,5 +101,4 @@ obj-$(CONFIG_BEFS_FS) += befs/
100obj-$(CONFIG_HOSTFS) += hostfs/ 101obj-$(CONFIG_HOSTFS) += hostfs/
101obj-$(CONFIG_HPPFS) += hppfs/ 102obj-$(CONFIG_HPPFS) += hppfs/
102obj-$(CONFIG_DEBUG_FS) += debugfs/ 103obj-$(CONFIG_DEBUG_FS) += debugfs/
103obj-$(CONFIG_CONFIGFS_FS) += configfs/
104obj-$(CONFIG_OCFS2_FS) += ocfs2/ 104obj-$(CONFIG_OCFS2_FS) += ocfs2/
diff --git a/fs/affs/namei.c b/fs/affs/namei.c
index d4c2d636c479..a42143ca0169 100644
--- a/fs/affs/namei.c
+++ b/fs/affs/namei.c
@@ -416,10 +416,9 @@ affs_rename(struct inode *old_dir, struct dentry *old_dentry,
416 return retval; 416 return retval;
417 } 417 }
418 418
419 retval = -EIO;
420 bh = affs_bread(sb, old_dentry->d_inode->i_ino); 419 bh = affs_bread(sb, old_dentry->d_inode->i_ino);
421 if (!bh) 420 if (!bh)
422 goto done; 421 return -EIO;
423 422
424 /* Remove header from its parent directory. */ 423 /* Remove header from its parent directory. */
425 affs_lock_dir(old_dir); 424 affs_lock_dir(old_dir);
diff --git a/fs/autofs4/autofs_i.h b/fs/autofs4/autofs_i.h
index 57c4903614e5..d6603d02304c 100644
--- a/fs/autofs4/autofs_i.h
+++ b/fs/autofs4/autofs_i.h
@@ -74,8 +74,8 @@ struct autofs_wait_queue {
74 struct autofs_wait_queue *next; 74 struct autofs_wait_queue *next;
75 autofs_wqt_t wait_queue_token; 75 autofs_wqt_t wait_queue_token;
76 /* We use the following to see what we are waiting for */ 76 /* We use the following to see what we are waiting for */
77 int hash; 77 unsigned int hash;
78 int len; 78 unsigned int len;
79 char *name; 79 char *name;
80 u32 dev; 80 u32 dev;
81 u64 ino; 81 u64 ino;
@@ -85,7 +85,6 @@ struct autofs_wait_queue {
85 pid_t tgid; 85 pid_t tgid;
86 /* This is for status reporting upon return */ 86 /* This is for status reporting upon return */
87 int status; 87 int status;
88 atomic_t notify;
89 atomic_t wait_ctr; 88 atomic_t wait_ctr;
90}; 89};
91 90
diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c
index 84e030c8ddd0..5100f984783f 100644
--- a/fs/autofs4/root.c
+++ b/fs/autofs4/root.c
@@ -327,6 +327,7 @@ static int try_to_fill_dentry(struct dentry *dentry, int flags)
327static void *autofs4_follow_link(struct dentry *dentry, struct nameidata *nd) 327static void *autofs4_follow_link(struct dentry *dentry, struct nameidata *nd)
328{ 328{
329 struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb); 329 struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb);
330 struct autofs_info *ino = autofs4_dentry_ino(dentry);
330 int oz_mode = autofs4_oz_mode(sbi); 331 int oz_mode = autofs4_oz_mode(sbi);
331 unsigned int lookup_type; 332 unsigned int lookup_type;
332 int status; 333 int status;
@@ -340,13 +341,8 @@ static void *autofs4_follow_link(struct dentry *dentry, struct nameidata *nd)
340 if (oz_mode || !lookup_type) 341 if (oz_mode || !lookup_type)
341 goto done; 342 goto done;
342 343
343 /* 344 /* If an expire request is pending wait for it. */
344 * If a request is pending wait for it. 345 if (ino && (ino->flags & AUTOFS_INF_EXPIRING)) {
345 * If it's a mount then it won't be expired till at least
346 * a liitle later and if it's an expire then we might need
347 * to mount it again.
348 */
349 if (autofs4_ispending(dentry)) {
350 DPRINTK("waiting for active request %p name=%.*s", 346 DPRINTK("waiting for active request %p name=%.*s",
351 dentry, dentry->d_name.len, dentry->d_name.name); 347 dentry, dentry->d_name.len, dentry->d_name.name);
352 348
diff --git a/fs/autofs4/waitq.c b/fs/autofs4/waitq.c
index 142ab6aa2aa1..ce103e7b0bc3 100644
--- a/fs/autofs4/waitq.c
+++ b/fs/autofs4/waitq.c
@@ -189,14 +189,30 @@ static int autofs4_getpath(struct autofs_sb_info *sbi,
189 return len; 189 return len;
190} 190}
191 191
192static struct autofs_wait_queue *
193autofs4_find_wait(struct autofs_sb_info *sbi,
194 char *name, unsigned int hash, unsigned int len)
195{
196 struct autofs_wait_queue *wq;
197
198 for (wq = sbi->queues; wq; wq = wq->next) {
199 if (wq->hash == hash &&
200 wq->len == len &&
201 wq->name && !memcmp(wq->name, name, len))
202 break;
203 }
204 return wq;
205}
206
192int autofs4_wait(struct autofs_sb_info *sbi, struct dentry *dentry, 207int autofs4_wait(struct autofs_sb_info *sbi, struct dentry *dentry,
193 enum autofs_notify notify) 208 enum autofs_notify notify)
194{ 209{
210 struct autofs_info *ino;
195 struct autofs_wait_queue *wq; 211 struct autofs_wait_queue *wq;
196 char *name; 212 char *name;
197 unsigned int len = 0; 213 unsigned int len = 0;
198 unsigned int hash = 0; 214 unsigned int hash = 0;
199 int status; 215 int status, type;
200 216
201 /* In catatonic mode, we don't wait for nobody */ 217 /* In catatonic mode, we don't wait for nobody */
202 if (sbi->catatonic) 218 if (sbi->catatonic)
@@ -223,21 +239,41 @@ int autofs4_wait(struct autofs_sb_info *sbi, struct dentry *dentry,
223 return -EINTR; 239 return -EINTR;
224 } 240 }
225 241
226 for (wq = sbi->queues ; wq ; wq = wq->next) { 242 wq = autofs4_find_wait(sbi, name, hash, len);
227 if (wq->hash == dentry->d_name.hash && 243 ino = autofs4_dentry_ino(dentry);
228 wq->len == len && 244 if (!wq && ino && notify == NFY_NONE) {
229 wq->name && !memcmp(wq->name, name, len)) 245 /*
230 break; 246 * Either we've betean the pending expire to post it's
231 } 247 * wait or it finished while we waited on the mutex.
248 * So we need to wait till either, the wait appears
249 * or the expire finishes.
250 */
251
252 while (ino->flags & AUTOFS_INF_EXPIRING) {
253 mutex_unlock(&sbi->wq_mutex);
254 schedule_timeout_interruptible(HZ/10);
255 if (mutex_lock_interruptible(&sbi->wq_mutex)) {
256 kfree(name);
257 return -EINTR;
258 }
259 wq = autofs4_find_wait(sbi, name, hash, len);
260 if (wq)
261 break;
262 }
232 263
233 if (!wq) { 264 /*
234 /* Can't wait for an expire if there's no mount */ 265 * Not ideal but the status has already gone. Of the two
235 if (notify == NFY_NONE && !d_mountpoint(dentry)) { 266 * cases where we wait on NFY_NONE neither depend on the
267 * return status of the wait.
268 */
269 if (!wq) {
236 kfree(name); 270 kfree(name);
237 mutex_unlock(&sbi->wq_mutex); 271 mutex_unlock(&sbi->wq_mutex);
238 return -ENOENT; 272 return 0;
239 } 273 }
274 }
240 275
276 if (!wq) {
241 /* Create a new wait queue */ 277 /* Create a new wait queue */
242 wq = kmalloc(sizeof(struct autofs_wait_queue),GFP_KERNEL); 278 wq = kmalloc(sizeof(struct autofs_wait_queue),GFP_KERNEL);
243 if (!wq) { 279 if (!wq) {
@@ -263,20 +299,7 @@ int autofs4_wait(struct autofs_sb_info *sbi, struct dentry *dentry,
263 wq->tgid = current->tgid; 299 wq->tgid = current->tgid;
264 wq->status = -EINTR; /* Status return if interrupted */ 300 wq->status = -EINTR; /* Status return if interrupted */
265 atomic_set(&wq->wait_ctr, 2); 301 atomic_set(&wq->wait_ctr, 2);
266 atomic_set(&wq->notify, 1);
267 mutex_unlock(&sbi->wq_mutex);
268 } else {
269 atomic_inc(&wq->wait_ctr);
270 mutex_unlock(&sbi->wq_mutex); 302 mutex_unlock(&sbi->wq_mutex);
271 kfree(name);
272 DPRINTK("existing wait id = 0x%08lx, name = %.*s, nfy=%d",
273 (unsigned long) wq->wait_queue_token, wq->len, wq->name, notify);
274 }
275
276 if (notify != NFY_NONE && atomic_read(&wq->notify)) {
277 int type;
278
279 atomic_dec(&wq->notify);
280 303
281 if (sbi->version < 5) { 304 if (sbi->version < 5) {
282 if (notify == NFY_MOUNT) 305 if (notify == NFY_MOUNT)
@@ -299,6 +322,12 @@ int autofs4_wait(struct autofs_sb_info *sbi, struct dentry *dentry,
299 322
300 /* autofs4_notify_daemon() may block */ 323 /* autofs4_notify_daemon() may block */
301 autofs4_notify_daemon(sbi, wq, type); 324 autofs4_notify_daemon(sbi, wq, type);
325 } else {
326 atomic_inc(&wq->wait_ctr);
327 mutex_unlock(&sbi->wq_mutex);
328 kfree(name);
329 DPRINTK("existing wait id = 0x%08lx, name = %.*s, nfy=%d",
330 (unsigned long) wq->wait_queue_token, wq->len, wq->name, notify);
302 } 331 }
303 332
304 /* wq->name is NULL if and only if the lock is already released */ 333 /* wq->name is NULL if and only if the lock is already released */
diff --git a/fs/binfmt_flat.c b/fs/binfmt_flat.c
index 69f44dcdb0b4..b1c902e319c1 100644
--- a/fs/binfmt_flat.c
+++ b/fs/binfmt_flat.c
@@ -428,7 +428,6 @@ static int load_flat_file(struct linux_binprm * bprm,
428 loff_t fpos; 428 loff_t fpos;
429 unsigned long start_code, end_code; 429 unsigned long start_code, end_code;
430 int ret; 430 int ret;
431 int exec_fileno;
432 431
433 hdr = ((struct flat_hdr *) bprm->buf); /* exec-header */ 432 hdr = ((struct flat_hdr *) bprm->buf); /* exec-header */
434 inode = bprm->file->f_dentry->d_inode; 433 inode = bprm->file->f_dentry->d_inode;
@@ -502,21 +501,12 @@ static int load_flat_file(struct linux_binprm * bprm,
502 goto err; 501 goto err;
503 } 502 }
504 503
505 /* check file descriptor */
506 exec_fileno = get_unused_fd();
507 if (exec_fileno < 0) {
508 ret = -EMFILE;
509 goto err;
510 }
511 get_file(bprm->file);
512 fd_install(exec_fileno, bprm->file);
513
514 /* Flush all traces of the currently running executable */ 504 /* Flush all traces of the currently running executable */
515 if (id == 0) { 505 if (id == 0) {
516 result = flush_old_exec(bprm); 506 result = flush_old_exec(bprm);
517 if (result) { 507 if (result) {
518 ret = result; 508 ret = result;
519 goto err_close; 509 goto err;
520 } 510 }
521 511
522 /* OK, This is the point of no return */ 512 /* OK, This is the point of no return */
@@ -548,7 +538,7 @@ static int load_flat_file(struct linux_binprm * bprm,
548 textpos = (unsigned long) -ENOMEM; 538 textpos = (unsigned long) -ENOMEM;
549 printk("Unable to mmap process text, errno %d\n", (int)-textpos); 539 printk("Unable to mmap process text, errno %d\n", (int)-textpos);
550 ret = textpos; 540 ret = textpos;
551 goto err_close; 541 goto err;
552 } 542 }
553 543
554 down_write(&current->mm->mmap_sem); 544 down_write(&current->mm->mmap_sem);
@@ -564,7 +554,7 @@ static int load_flat_file(struct linux_binprm * bprm,
564 (int)-datapos); 554 (int)-datapos);
565 do_munmap(current->mm, textpos, text_len); 555 do_munmap(current->mm, textpos, text_len);
566 ret = realdatastart; 556 ret = realdatastart;
567 goto err_close; 557 goto err;
568 } 558 }
569 datapos = realdatastart + MAX_SHARED_LIBS * sizeof(unsigned long); 559 datapos = realdatastart + MAX_SHARED_LIBS * sizeof(unsigned long);
570 560
@@ -587,7 +577,7 @@ static int load_flat_file(struct linux_binprm * bprm,
587 do_munmap(current->mm, textpos, text_len); 577 do_munmap(current->mm, textpos, text_len);
588 do_munmap(current->mm, realdatastart, data_len + extra); 578 do_munmap(current->mm, realdatastart, data_len + extra);
589 ret = result; 579 ret = result;
590 goto err_close; 580 goto err;
591 } 581 }
592 582
593 reloc = (unsigned long *) (datapos+(ntohl(hdr->reloc_start)-text_len)); 583 reloc = (unsigned long *) (datapos+(ntohl(hdr->reloc_start)-text_len));
@@ -606,7 +596,7 @@ static int load_flat_file(struct linux_binprm * bprm,
606 printk("Unable to allocate RAM for process text/data, errno %d\n", 596 printk("Unable to allocate RAM for process text/data, errno %d\n",
607 (int)-textpos); 597 (int)-textpos);
608 ret = textpos; 598 ret = textpos;
609 goto err_close; 599 goto err;
610 } 600 }
611 601
612 realdatastart = textpos + ntohl(hdr->data_start); 602 realdatastart = textpos + ntohl(hdr->data_start);
@@ -652,7 +642,7 @@ static int load_flat_file(struct linux_binprm * bprm,
652 do_munmap(current->mm, textpos, text_len + data_len + extra + 642 do_munmap(current->mm, textpos, text_len + data_len + extra +
653 MAX_SHARED_LIBS * sizeof(unsigned long)); 643 MAX_SHARED_LIBS * sizeof(unsigned long));
654 ret = result; 644 ret = result;
655 goto err_close; 645 goto err;
656 } 646 }
657 } 647 }
658 648
@@ -717,7 +707,7 @@ static int load_flat_file(struct linux_binprm * bprm,
717 addr = calc_reloc(*rp, libinfo, id, 0); 707 addr = calc_reloc(*rp, libinfo, id, 0);
718 if (addr == RELOC_FAILED) { 708 if (addr == RELOC_FAILED) {
719 ret = -ENOEXEC; 709 ret = -ENOEXEC;
720 goto err_close; 710 goto err;
721 } 711 }
722 *rp = addr; 712 *rp = addr;
723 } 713 }
@@ -747,7 +737,7 @@ static int load_flat_file(struct linux_binprm * bprm,
747 rp = (unsigned long *) calc_reloc(addr, libinfo, id, 1); 737 rp = (unsigned long *) calc_reloc(addr, libinfo, id, 1);
748 if (rp == (unsigned long *)RELOC_FAILED) { 738 if (rp == (unsigned long *)RELOC_FAILED) {
749 ret = -ENOEXEC; 739 ret = -ENOEXEC;
750 goto err_close; 740 goto err;
751 } 741 }
752 742
753 /* Get the pointer's value. */ 743 /* Get the pointer's value. */
@@ -762,7 +752,7 @@ static int load_flat_file(struct linux_binprm * bprm,
762 addr = calc_reloc(addr, libinfo, id, 0); 752 addr = calc_reloc(addr, libinfo, id, 0);
763 if (addr == RELOC_FAILED) { 753 if (addr == RELOC_FAILED) {
764 ret = -ENOEXEC; 754 ret = -ENOEXEC;
765 goto err_close; 755 goto err;
766 } 756 }
767 757
768 /* Write back the relocated pointer. */ 758 /* Write back the relocated pointer. */
@@ -783,8 +773,6 @@ static int load_flat_file(struct linux_binprm * bprm,
783 stack_len); 773 stack_len);
784 774
785 return 0; 775 return 0;
786err_close:
787 sys_close(exec_fileno);
788err: 776err:
789 return ret; 777 return ret;
790} 778}
diff --git a/fs/bio.c b/fs/bio.c
index eb8fbc53f2cd..098c12b2d60a 100644
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -1116,6 +1116,9 @@ struct bio_pair *bio_split(struct bio *bi, mempool_t *pool, int first_sectors)
1116 bp->bio1.bi_io_vec = &bp->bv1; 1116 bp->bio1.bi_io_vec = &bp->bv1;
1117 bp->bio2.bi_io_vec = &bp->bv2; 1117 bp->bio2.bi_io_vec = &bp->bv2;
1118 1118
1119 bp->bio1.bi_max_vecs = 1;
1120 bp->bio2.bi_max_vecs = 1;
1121
1119 bp->bio1.bi_end_io = bio_pair_end_1; 1122 bp->bio1.bi_end_io = bio_pair_end_1;
1120 bp->bio2.bi_end_io = bio_pair_end_2; 1123 bp->bio2.bi_end_io = bio_pair_end_2;
1121 1124
diff --git a/fs/block_dev.c b/fs/block_dev.c
index af88c43043d5..f5958f413bd1 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -1104,6 +1104,8 @@ const struct file_operations def_blk_fops = {
1104 .readv = generic_file_readv, 1104 .readv = generic_file_readv,
1105 .writev = generic_file_write_nolock, 1105 .writev = generic_file_write_nolock,
1106 .sendfile = generic_file_sendfile, 1106 .sendfile = generic_file_sendfile,
1107 .splice_read = generic_file_splice_read,
1108 .splice_write = generic_file_splice_write,
1107}; 1109};
1108 1110
1109int ioctl_by_bdev(struct block_device *bdev, unsigned cmd, unsigned long arg) 1111int ioctl_by_bdev(struct block_device *bdev, unsigned cmd, unsigned long arg)
diff --git a/fs/cifs/CHANGES b/fs/cifs/CHANGES
index 8a2de038882e..7271bb0257f6 100644
--- a/fs/cifs/CHANGES
+++ b/fs/cifs/CHANGES
@@ -1,7 +1,18 @@
1Version 1.43
2------------
3POSIX locking to servers which support CIFS POSIX Extensions
4(disabled by default controlled by proc/fs/cifs/Experimental).
5Handle conversion of long share names (especially Asian languages)
6to Unicode during mount.
7
1Version 1.42 8Version 1.42
2------------ 9------------
3Fix slow oplock break when mounted to different servers at the same time and 10Fix slow oplock break when mounted to different servers at the same time and
4the tids match and we try to find matching fid on wrong server. 11the tids match and we try to find matching fid on wrong server. Fix read
12looping when signing required by server (2.6.16 kernel only). Fix readdir
13vs. rename race which could cause each to hang. Return . and .. even
14if server does not. Allow searches to skip first three entries and
15begin at any location. Fix oops in find_writeable_file.
5 16
6Version 1.41 17Version 1.41
7------------ 18------------
diff --git a/fs/cifs/README b/fs/cifs/README
index b2b4d0803761..0355003f4f0a 100644
--- a/fs/cifs/README
+++ b/fs/cifs/README
@@ -511,6 +511,14 @@ LinuxExtensionsEnabled If set to one then the client will attempt to
511 support and want to map the uid and gid fields 511 support and want to map the uid and gid fields
512 to values supplied at mount (rather than the 512 to values supplied at mount (rather than the
513 actual values, then set this to zero. (default 1) 513 actual values, then set this to zero. (default 1)
514Experimental When set to 1 used to enable certain experimental
515 features (currently enables multipage writes
516 when signing is enabled, the multipage write
517 performance enhancement was disabled when
518 signing turned on in case buffer was modified
519 just before it was sent, also this flag will
520 be used to use the new experimental sessionsetup
521 code).
514 522
515These experimental features and tracing can be enabled by changing flags in 523These experimental features and tracing can be enabled by changing flags in
516/proc/fs/cifs (after the cifs module has been installed or built into the 524/proc/fs/cifs (after the cifs module has been installed or built into the
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index d4b713e5affb..c262d8874ce9 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -33,6 +33,7 @@
33#include <linux/vfs.h> 33#include <linux/vfs.h>
34#include <linux/mempool.h> 34#include <linux/mempool.h>
35#include <linux/delay.h> 35#include <linux/delay.h>
36#include <linux/kthread.h>
36#include "cifsfs.h" 37#include "cifsfs.h"
37#include "cifspdu.h" 38#include "cifspdu.h"
38#define DECLARE_GLOBALS_HERE 39#define DECLARE_GLOBALS_HERE
@@ -75,9 +76,6 @@ unsigned int cifs_max_pending = CIFS_MAX_REQ;
75module_param(cifs_max_pending, int, 0); 76module_param(cifs_max_pending, int, 0);
76MODULE_PARM_DESC(cifs_max_pending,"Simultaneous requests to server. Default: 50 Range: 2 to 256"); 77MODULE_PARM_DESC(cifs_max_pending,"Simultaneous requests to server. Default: 50 Range: 2 to 256");
77 78
78static DECLARE_COMPLETION(cifs_oplock_exited);
79static DECLARE_COMPLETION(cifs_dnotify_exited);
80
81extern mempool_t *cifs_sm_req_poolp; 79extern mempool_t *cifs_sm_req_poolp;
82extern mempool_t *cifs_req_poolp; 80extern mempool_t *cifs_req_poolp;
83extern mempool_t *cifs_mid_poolp; 81extern mempool_t *cifs_mid_poolp;
@@ -841,10 +839,6 @@ static int cifs_oplock_thread(void * dummyarg)
841 __u16 netfid; 839 __u16 netfid;
842 int rc; 840 int rc;
843 841
844 daemonize("cifsoplockd");
845 allow_signal(SIGTERM);
846
847 oplockThread = current;
848 do { 842 do {
849 if (try_to_freeze()) 843 if (try_to_freeze())
850 continue; 844 continue;
@@ -900,9 +894,9 @@ static int cifs_oplock_thread(void * dummyarg)
900 set_current_state(TASK_INTERRUPTIBLE); 894 set_current_state(TASK_INTERRUPTIBLE);
901 schedule_timeout(1); /* yield in case q were corrupt */ 895 schedule_timeout(1); /* yield in case q were corrupt */
902 } 896 }
903 } while(!signal_pending(current)); 897 } while (!kthread_should_stop());
904 oplockThread = NULL; 898
905 complete_and_exit (&cifs_oplock_exited, 0); 899 return 0;
906} 900}
907 901
908static int cifs_dnotify_thread(void * dummyarg) 902static int cifs_dnotify_thread(void * dummyarg)
@@ -910,10 +904,6 @@ static int cifs_dnotify_thread(void * dummyarg)
910 struct list_head *tmp; 904 struct list_head *tmp;
911 struct cifsSesInfo *ses; 905 struct cifsSesInfo *ses;
912 906
913 daemonize("cifsdnotifyd");
914 allow_signal(SIGTERM);
915
916 dnotifyThread = current;
917 do { 907 do {
918 if(try_to_freeze()) 908 if(try_to_freeze())
919 continue; 909 continue;
@@ -931,8 +921,9 @@ static int cifs_dnotify_thread(void * dummyarg)
931 wake_up_all(&ses->server->response_q); 921 wake_up_all(&ses->server->response_q);
932 } 922 }
933 read_unlock(&GlobalSMBSeslock); 923 read_unlock(&GlobalSMBSeslock);
934 } while(!signal_pending(current)); 924 } while (!kthread_should_stop());
935 complete_and_exit (&cifs_dnotify_exited, 0); 925
926 return 0;
936} 927}
937 928
938static int __init 929static int __init
@@ -982,32 +973,48 @@ init_cifs(void)
982 } 973 }
983 974
984 rc = cifs_init_inodecache(); 975 rc = cifs_init_inodecache();
985 if (!rc) { 976 if (rc)
986 rc = cifs_init_mids(); 977 goto out_clean_proc;
987 if (!rc) { 978
988 rc = cifs_init_request_bufs(); 979 rc = cifs_init_mids();
989 if (!rc) { 980 if (rc)
990 rc = register_filesystem(&cifs_fs_type); 981 goto out_destroy_inodecache;
991 if (!rc) { 982
992 rc = (int)kernel_thread(cifs_oplock_thread, NULL, 983 rc = cifs_init_request_bufs();
993 CLONE_FS | CLONE_FILES | CLONE_VM); 984 if (rc)
994 if(rc > 0) { 985 goto out_destroy_mids;
995 rc = (int)kernel_thread(cifs_dnotify_thread, NULL, 986
996 CLONE_FS | CLONE_FILES | CLONE_VM); 987 rc = register_filesystem(&cifs_fs_type);
997 if(rc > 0) 988 if (rc)
998 return 0; 989 goto out_destroy_request_bufs;
999 else 990
1000 cERROR(1,("error %d create dnotify thread", rc)); 991 oplockThread = kthread_run(cifs_oplock_thread, NULL, "cifsoplockd");
1001 } else { 992 if (IS_ERR(oplockThread)) {
1002 cERROR(1,("error %d create oplock thread",rc)); 993 rc = PTR_ERR(oplockThread);
1003 } 994 cERROR(1,("error %d create oplock thread", rc));
1004 } 995 goto out_unregister_filesystem;
1005 cifs_destroy_request_bufs();
1006 }
1007 cifs_destroy_mids();
1008 }
1009 cifs_destroy_inodecache();
1010 } 996 }
997
998 dnotifyThread = kthread_run(cifs_dnotify_thread, NULL, "cifsdnotifyd");
999 if (IS_ERR(dnotifyThread)) {
1000 rc = PTR_ERR(dnotifyThread);
1001 cERROR(1,("error %d create dnotify thread", rc));
1002 goto out_stop_oplock_thread;
1003 }
1004
1005 return 0;
1006
1007 out_stop_oplock_thread:
1008 kthread_stop(oplockThread);
1009 out_unregister_filesystem:
1010 unregister_filesystem(&cifs_fs_type);
1011 out_destroy_request_bufs:
1012 cifs_destroy_request_bufs();
1013 out_destroy_mids:
1014 cifs_destroy_mids();
1015 out_destroy_inodecache:
1016 cifs_destroy_inodecache();
1017 out_clean_proc:
1011#ifdef CONFIG_PROC_FS 1018#ifdef CONFIG_PROC_FS
1012 cifs_proc_clean(); 1019 cifs_proc_clean();
1013#endif 1020#endif
@@ -1025,14 +1032,8 @@ exit_cifs(void)
1025 cifs_destroy_inodecache(); 1032 cifs_destroy_inodecache();
1026 cifs_destroy_mids(); 1033 cifs_destroy_mids();
1027 cifs_destroy_request_bufs(); 1034 cifs_destroy_request_bufs();
1028 if(oplockThread) { 1035 kthread_stop(oplockThread);
1029 send_sig(SIGTERM, oplockThread, 1); 1036 kthread_stop(dnotifyThread);
1030 wait_for_completion(&cifs_oplock_exited);
1031 }
1032 if(dnotifyThread) {
1033 send_sig(SIGTERM, dnotifyThread, 1);
1034 wait_for_completion(&cifs_dnotify_exited);
1035 }
1036} 1037}
1037 1038
1038MODULE_AUTHOR("Steve French <sfrench@us.ibm.com>"); 1039MODULE_AUTHOR("Steve French <sfrench@us.ibm.com>");
diff --git a/fs/cifs/cifsfs.h b/fs/cifs/cifsfs.h
index 4e829dc672a6..c98755dca868 100644
--- a/fs/cifs/cifsfs.h
+++ b/fs/cifs/cifsfs.h
@@ -99,5 +99,5 @@ extern ssize_t cifs_getxattr(struct dentry *, const char *, void *, size_t);
99extern ssize_t cifs_listxattr(struct dentry *, char *, size_t); 99extern ssize_t cifs_listxattr(struct dentry *, char *, size_t);
100extern int cifs_ioctl (struct inode * inode, struct file * filep, 100extern int cifs_ioctl (struct inode * inode, struct file * filep,
101 unsigned int command, unsigned long arg); 101 unsigned int command, unsigned long arg);
102#define CIFS_VERSION "1.42" 102#define CIFS_VERSION "1.43"
103#endif /* _CIFSFS_H */ 103#endif /* _CIFSFS_H */
diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h
index 2879ba343ca7..310ea2f0e0bf 100644
--- a/fs/cifs/cifsproto.h
+++ b/fs/cifs/cifsproto.h
@@ -267,7 +267,7 @@ extern int CIFSSMBLock(const int xid, struct cifsTconInfo *tcon,
267 const int waitFlag); 267 const int waitFlag);
268extern int CIFSSMBPosixLock(const int xid, struct cifsTconInfo *tcon, 268extern int CIFSSMBPosixLock(const int xid, struct cifsTconInfo *tcon,
269 const __u16 smb_file_id, const int get_flag, 269 const __u16 smb_file_id, const int get_flag,
270 const __u64 len, const __u64 offset, 270 const __u64 len, struct file_lock *,
271 const __u16 lock_type, const int waitFlag); 271 const __u16 lock_type, const int waitFlag);
272extern int CIFSSMBTDis(const int xid, struct cifsTconInfo *tcon); 272extern int CIFSSMBTDis(const int xid, struct cifsTconInfo *tcon);
273extern int CIFSSMBLogoff(const int xid, struct cifsSesInfo *ses); 273extern int CIFSSMBLogoff(const int xid, struct cifsSesInfo *ses);
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index d705500aa283..925881e00ff2 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -1355,7 +1355,8 @@ CIFSSMBLock(const int xid, struct cifsTconInfo *tcon,
1355int 1355int
1356CIFSSMBPosixLock(const int xid, struct cifsTconInfo *tcon, 1356CIFSSMBPosixLock(const int xid, struct cifsTconInfo *tcon,
1357 const __u16 smb_file_id, const int get_flag, const __u64 len, 1357 const __u16 smb_file_id, const int get_flag, const __u64 len,
1358 const __u64 lkoffset, const __u16 lock_type, const int waitFlag) 1358 struct file_lock *pLockData, const __u16 lock_type,
1359 const int waitFlag)
1359{ 1360{
1360 struct smb_com_transaction2_sfi_req *pSMB = NULL; 1361 struct smb_com_transaction2_sfi_req *pSMB = NULL;
1361 struct smb_com_transaction2_sfi_rsp *pSMBr = NULL; 1362 struct smb_com_transaction2_sfi_rsp *pSMBr = NULL;
@@ -1366,6 +1367,10 @@ CIFSSMBPosixLock(const int xid, struct cifsTconInfo *tcon,
1366 __u16 params, param_offset, offset, byte_count, count; 1367 __u16 params, param_offset, offset, byte_count, count;
1367 1368
1368 cFYI(1, ("Posix Lock")); 1369 cFYI(1, ("Posix Lock"));
1370
1371 if(pLockData == NULL)
1372 return EINVAL;
1373
1369 rc = small_smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB); 1374 rc = small_smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB);
1370 1375
1371 if (rc) 1376 if (rc)
@@ -1404,10 +1409,10 @@ CIFSSMBPosixLock(const int xid, struct cifsTconInfo *tcon,
1404 1409
1405 parm_data->lock_type = cpu_to_le16(lock_type); 1410 parm_data->lock_type = cpu_to_le16(lock_type);
1406 if(waitFlag) 1411 if(waitFlag)
1407 parm_data->lock_flags = 1; 1412 parm_data->lock_flags = cpu_to_le16(1);
1408 parm_data->pid = cpu_to_le32(current->tgid); 1413 parm_data->pid = cpu_to_le32(current->tgid);
1409 parm_data->start = lkoffset; 1414 parm_data->start = cpu_to_le64(pLockData->fl_start);
1410 parm_data->length = len; /* normalize negative numbers */ 1415 parm_data->length = cpu_to_le64(len); /* normalize negative numbers */
1411 1416
1412 pSMB->DataOffset = cpu_to_le16(offset); 1417 pSMB->DataOffset = cpu_to_le16(offset);
1413 pSMB->Fid = smb_file_id; 1418 pSMB->Fid = smb_file_id;
@@ -1419,8 +1424,33 @@ CIFSSMBPosixLock(const int xid, struct cifsTconInfo *tcon,
1419 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 1424 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
1420 if (rc) { 1425 if (rc) {
1421 cFYI(1, ("Send error in Posix Lock = %d", rc)); 1426 cFYI(1, ("Send error in Posix Lock = %d", rc));
1422 } 1427 } else if (get_flag) {
1428 /* lock structure can be returned on get */
1429 __u16 data_offset;
1430 __u16 data_count;
1431 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
1423 1432
1433 if (rc || (pSMBr->ByteCount < sizeof(struct cifs_posix_lock))) {
1434 rc = -EIO; /* bad smb */
1435 goto plk_err_exit;
1436 }
1437 if(pLockData == NULL) {
1438 rc = -EINVAL;
1439 goto plk_err_exit;
1440 }
1441 data_offset = le16_to_cpu(pSMBr->t2.DataOffset);
1442 data_count = le16_to_cpu(pSMBr->t2.DataCount);
1443 if(data_count < sizeof(struct cifs_posix_lock)) {
1444 rc = -EIO;
1445 goto plk_err_exit;
1446 }
1447 parm_data = (struct cifs_posix_lock *)
1448 ((char *)&pSMBr->hdr.Protocol + data_offset);
1449 if(parm_data->lock_type == cpu_to_le16(CIFS_UNLCK))
1450 pLockData->fl_type = F_UNLCK;
1451 }
1452
1453plk_err_exit:
1424 if (pSMB) 1454 if (pSMB)
1425 cifs_small_buf_release(pSMB); 1455 cifs_small_buf_release(pSMB);
1426 1456
@@ -3119,7 +3149,7 @@ findFirstRetry:
3119 psrch_inf->endOfSearch = FALSE; 3149 psrch_inf->endOfSearch = FALSE;
3120 3150
3121 psrch_inf->entries_in_buffer = le16_to_cpu(parms->SearchCount); 3151 psrch_inf->entries_in_buffer = le16_to_cpu(parms->SearchCount);
3122 psrch_inf->index_of_last_entry = 3152 psrch_inf->index_of_last_entry = 2 /* skip . and .. */ +
3123 psrch_inf->entries_in_buffer; 3153 psrch_inf->entries_in_buffer;
3124 *pnetfid = parms->SearchHandle; 3154 *pnetfid = parms->SearchHandle;
3125 } else { 3155 } else {
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 0b86d5ca9014..bae1479318d1 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -2148,6 +2148,8 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses,
2148/* We look for obvious messed up bcc or strings in response so we do not go off 2148/* We look for obvious messed up bcc or strings in response so we do not go off
2149 the end since (at least) WIN2K and Windows XP have a major bug in not null 2149 the end since (at least) WIN2K and Windows XP have a major bug in not null
2150 terminating last Unicode string in response */ 2150 terminating last Unicode string in response */
2151 if(ses->serverOS)
2152 kfree(ses->serverOS);
2151 ses->serverOS = kzalloc(2 * (len + 1), GFP_KERNEL); 2153 ses->serverOS = kzalloc(2 * (len + 1), GFP_KERNEL);
2152 if(ses->serverOS == NULL) 2154 if(ses->serverOS == NULL)
2153 goto sesssetup_nomem; 2155 goto sesssetup_nomem;
@@ -2160,6 +2162,8 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses,
2160 if (remaining_words > 0) { 2162 if (remaining_words > 0) {
2161 len = UniStrnlen((wchar_t *)bcc_ptr, 2163 len = UniStrnlen((wchar_t *)bcc_ptr,
2162 remaining_words-1); 2164 remaining_words-1);
2165 if(ses->serverNOS)
2166 kfree(ses->serverNOS);
2163 ses->serverNOS = kzalloc(2 * (len + 1),GFP_KERNEL); 2167 ses->serverNOS = kzalloc(2 * (len + 1),GFP_KERNEL);
2164 if(ses->serverNOS == NULL) 2168 if(ses->serverNOS == NULL)
2165 goto sesssetup_nomem; 2169 goto sesssetup_nomem;
@@ -2177,6 +2181,8 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses,
2177 if (remaining_words > 0) { 2181 if (remaining_words > 0) {
2178 len = UniStrnlen((wchar_t *) bcc_ptr, remaining_words); 2182 len = UniStrnlen((wchar_t *) bcc_ptr, remaining_words);
2179 /* last string is not always null terminated (for e.g. for Windows XP & 2000) */ 2183 /* last string is not always null terminated (for e.g. for Windows XP & 2000) */
2184 if(ses->serverDomain)
2185 kfree(ses->serverDomain);
2180 ses->serverDomain = 2186 ses->serverDomain =
2181 kzalloc(2*(len+1),GFP_KERNEL); 2187 kzalloc(2*(len+1),GFP_KERNEL);
2182 if(ses->serverDomain == NULL) 2188 if(ses->serverDomain == NULL)
@@ -2187,15 +2193,22 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses,
2187 ses->serverDomain[2*len] = 0; 2193 ses->serverDomain[2*len] = 0;
2188 ses->serverDomain[1+(2*len)] = 0; 2194 ses->serverDomain[1+(2*len)] = 0;
2189 } /* else no more room so create dummy domain string */ 2195 } /* else no more room so create dummy domain string */
2190 else 2196 else {
2197 if(ses->serverDomain)
2198 kfree(ses->serverDomain);
2191 ses->serverDomain = 2199 ses->serverDomain =
2192 kzalloc(2, GFP_KERNEL); 2200 kzalloc(2, GFP_KERNEL);
2201 }
2193 } else { /* no room so create dummy domain and NOS string */ 2202 } else { /* no room so create dummy domain and NOS string */
2194 /* if these kcallocs fail not much we 2203 /* if these kcallocs fail not much we
2195 can do, but better to not fail the 2204 can do, but better to not fail the
2196 sesssetup itself */ 2205 sesssetup itself */
2206 if(ses->serverDomain)
2207 kfree(ses->serverDomain);
2197 ses->serverDomain = 2208 ses->serverDomain =
2198 kzalloc(2, GFP_KERNEL); 2209 kzalloc(2, GFP_KERNEL);
2210 if(ses->serverNOS)
2211 kfree(ses->serverNOS);
2199 ses->serverNOS = 2212 ses->serverNOS =
2200 kzalloc(2, GFP_KERNEL); 2213 kzalloc(2, GFP_KERNEL);
2201 } 2214 }
@@ -2204,6 +2217,8 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses,
2204 if (((long) bcc_ptr + len) - (long) 2217 if (((long) bcc_ptr + len) - (long)
2205 pByteArea(smb_buffer_response) 2218 pByteArea(smb_buffer_response)
2206 <= BCC(smb_buffer_response)) { 2219 <= BCC(smb_buffer_response)) {
2220 if(ses->serverOS)
2221 kfree(ses->serverOS);
2207 ses->serverOS = kzalloc(len + 1,GFP_KERNEL); 2222 ses->serverOS = kzalloc(len + 1,GFP_KERNEL);
2208 if(ses->serverOS == NULL) 2223 if(ses->serverOS == NULL)
2209 goto sesssetup_nomem; 2224 goto sesssetup_nomem;
@@ -2214,6 +2229,8 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses,
2214 bcc_ptr++; 2229 bcc_ptr++;
2215 2230
2216 len = strnlen(bcc_ptr, 1024); 2231 len = strnlen(bcc_ptr, 1024);
2232 if(ses->serverNOS)
2233 kfree(ses->serverNOS);
2217 ses->serverNOS = kzalloc(len + 1,GFP_KERNEL); 2234 ses->serverNOS = kzalloc(len + 1,GFP_KERNEL);
2218 if(ses->serverNOS == NULL) 2235 if(ses->serverNOS == NULL)
2219 goto sesssetup_nomem; 2236 goto sesssetup_nomem;
@@ -2223,6 +2240,8 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses,
2223 bcc_ptr++; 2240 bcc_ptr++;
2224 2241
2225 len = strnlen(bcc_ptr, 1024); 2242 len = strnlen(bcc_ptr, 1024);
2243 if(ses->serverDomain)
2244 kfree(ses->serverDomain);
2226 ses->serverDomain = kzalloc(len + 1,GFP_KERNEL); 2245 ses->serverDomain = kzalloc(len + 1,GFP_KERNEL);
2227 if(ses->serverDomain == NULL) 2246 if(ses->serverDomain == NULL)
2228 goto sesssetup_nomem; 2247 goto sesssetup_nomem;
@@ -2427,6 +2446,8 @@ CIFSSpnegoSessSetup(unsigned int xid, struct cifsSesInfo *ses,
2427/* We look for obvious messed up bcc or strings in response so we do not go off 2446/* We look for obvious messed up bcc or strings in response so we do not go off
2428 the end since (at least) WIN2K and Windows XP have a major bug in not null 2447 the end since (at least) WIN2K and Windows XP have a major bug in not null
2429 terminating last Unicode string in response */ 2448 terminating last Unicode string in response */
2449 if(ses->serverOS)
2450 kfree(ses->serverOS);
2430 ses->serverOS = 2451 ses->serverOS =
2431 kzalloc(2 * (len + 1), GFP_KERNEL); 2452 kzalloc(2 * (len + 1), GFP_KERNEL);
2432 cifs_strfromUCS_le(ses->serverOS, 2453 cifs_strfromUCS_le(ses->serverOS,
@@ -2441,6 +2462,8 @@ CIFSSpnegoSessSetup(unsigned int xid, struct cifsSesInfo *ses,
2441 len = UniStrnlen((wchar_t *)bcc_ptr, 2462 len = UniStrnlen((wchar_t *)bcc_ptr,
2442 remaining_words 2463 remaining_words
2443 - 1); 2464 - 1);
2465 if(ses->serverNOS)
2466 kfree(ses->serverNOS);
2444 ses->serverNOS = 2467 ses->serverNOS =
2445 kzalloc(2 * (len + 1), 2468 kzalloc(2 * (len + 1),
2446 GFP_KERNEL); 2469 GFP_KERNEL);
@@ -2454,7 +2477,9 @@ CIFSSpnegoSessSetup(unsigned int xid, struct cifsSesInfo *ses,
2454 remaining_words -= len + 1; 2477 remaining_words -= len + 1;
2455 if (remaining_words > 0) { 2478 if (remaining_words > 0) {
2456 len = UniStrnlen((wchar_t *) bcc_ptr, remaining_words); 2479 len = UniStrnlen((wchar_t *) bcc_ptr, remaining_words);
2457 /* last string is not always null terminated (for e.g. for Windows XP & 2000) */ 2480 /* last string not null terminated (e.g.Windows XP/2000) */
2481 if(ses->serverDomain)
2482 kfree(ses->serverDomain);
2458 ses->serverDomain = kzalloc(2*(len+1),GFP_KERNEL); 2483 ses->serverDomain = kzalloc(2*(len+1),GFP_KERNEL);
2459 cifs_strfromUCS_le(ses->serverDomain, 2484 cifs_strfromUCS_le(ses->serverDomain,
2460 (__le16 *)bcc_ptr, 2485 (__le16 *)bcc_ptr,
@@ -2463,11 +2488,18 @@ CIFSSpnegoSessSetup(unsigned int xid, struct cifsSesInfo *ses,
2463 ses->serverDomain[2*len] = 0; 2488 ses->serverDomain[2*len] = 0;
2464 ses->serverDomain[1+(2*len)] = 0; 2489 ses->serverDomain[1+(2*len)] = 0;
2465 } /* else no more room so create dummy domain string */ 2490 } /* else no more room so create dummy domain string */
2466 else 2491 else {
2492 if(ses->serverDomain)
2493 kfree(ses->serverDomain);
2467 ses->serverDomain = 2494 ses->serverDomain =
2468 kzalloc(2,GFP_KERNEL); 2495 kzalloc(2,GFP_KERNEL);
2469 } else { /* no room so create dummy domain and NOS string */ 2496 }
2497 } else {/* no room use dummy domain&NOS */
2498 if(ses->serverDomain)
2499 kfree(ses->serverDomain);
2470 ses->serverDomain = kzalloc(2, GFP_KERNEL); 2500 ses->serverDomain = kzalloc(2, GFP_KERNEL);
2501 if(ses->serverNOS)
2502 kfree(ses->serverNOS);
2471 ses->serverNOS = kzalloc(2, GFP_KERNEL); 2503 ses->serverNOS = kzalloc(2, GFP_KERNEL);
2472 } 2504 }
2473 } else { /* ASCII */ 2505 } else { /* ASCII */
@@ -2476,6 +2508,8 @@ CIFSSpnegoSessSetup(unsigned int xid, struct cifsSesInfo *ses,
2476 if (((long) bcc_ptr + len) - (long) 2508 if (((long) bcc_ptr + len) - (long)
2477 pByteArea(smb_buffer_response) 2509 pByteArea(smb_buffer_response)
2478 <= BCC(smb_buffer_response)) { 2510 <= BCC(smb_buffer_response)) {
2511 if(ses->serverOS)
2512 kfree(ses->serverOS);
2479 ses->serverOS = kzalloc(len + 1, GFP_KERNEL); 2513 ses->serverOS = kzalloc(len + 1, GFP_KERNEL);
2480 strncpy(ses->serverOS, bcc_ptr, len); 2514 strncpy(ses->serverOS, bcc_ptr, len);
2481 2515
@@ -2484,6 +2518,8 @@ CIFSSpnegoSessSetup(unsigned int xid, struct cifsSesInfo *ses,
2484 bcc_ptr++; 2518 bcc_ptr++;
2485 2519
2486 len = strnlen(bcc_ptr, 1024); 2520 len = strnlen(bcc_ptr, 1024);
2521 if(ses->serverNOS)
2522 kfree(ses->serverNOS);
2487 ses->serverNOS = kzalloc(len + 1,GFP_KERNEL); 2523 ses->serverNOS = kzalloc(len + 1,GFP_KERNEL);
2488 strncpy(ses->serverNOS, bcc_ptr, len); 2524 strncpy(ses->serverNOS, bcc_ptr, len);
2489 bcc_ptr += len; 2525 bcc_ptr += len;
@@ -2491,6 +2527,8 @@ CIFSSpnegoSessSetup(unsigned int xid, struct cifsSesInfo *ses,
2491 bcc_ptr++; 2527 bcc_ptr++;
2492 2528
2493 len = strnlen(bcc_ptr, 1024); 2529 len = strnlen(bcc_ptr, 1024);
2530 if(ses->serverDomain)
2531 kfree(ses->serverDomain);
2494 ses->serverDomain = kzalloc(len + 1, GFP_KERNEL); 2532 ses->serverDomain = kzalloc(len + 1, GFP_KERNEL);
2495 strncpy(ses->serverDomain, bcc_ptr, len); 2533 strncpy(ses->serverDomain, bcc_ptr, len);
2496 bcc_ptr += len; 2534 bcc_ptr += len;
@@ -2728,6 +2766,8 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid,
2728/* We look for obvious messed up bcc or strings in response so we do not go off 2766/* We look for obvious messed up bcc or strings in response so we do not go off
2729 the end since (at least) WIN2K and Windows XP have a major bug in not null 2767 the end since (at least) WIN2K and Windows XP have a major bug in not null
2730 terminating last Unicode string in response */ 2768 terminating last Unicode string in response */
2769 if(ses->serverOS)
2770 kfree(ses->serverOS);
2731 ses->serverOS = 2771 ses->serverOS =
2732 kzalloc(2 * (len + 1), GFP_KERNEL); 2772 kzalloc(2 * (len + 1), GFP_KERNEL);
2733 cifs_strfromUCS_le(ses->serverOS, 2773 cifs_strfromUCS_le(ses->serverOS,
@@ -2743,6 +2783,8 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid,
2743 bcc_ptr, 2783 bcc_ptr,
2744 remaining_words 2784 remaining_words
2745 - 1); 2785 - 1);
2786 if(ses->serverNOS)
2787 kfree(ses->serverNOS);
2746 ses->serverNOS = 2788 ses->serverNOS =
2747 kzalloc(2 * (len + 1), 2789 kzalloc(2 * (len + 1),
2748 GFP_KERNEL); 2790 GFP_KERNEL);
@@ -2760,6 +2802,8 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid,
2760 if (remaining_words > 0) { 2802 if (remaining_words > 0) {
2761 len = UniStrnlen((wchar_t *) bcc_ptr, remaining_words); 2803 len = UniStrnlen((wchar_t *) bcc_ptr, remaining_words);
2762 /* last string is not always null terminated (for e.g. for Windows XP & 2000) */ 2804 /* last string is not always null terminated (for e.g. for Windows XP & 2000) */
2805 if(ses->serverDomain)
2806 kfree(ses->serverDomain);
2763 ses->serverDomain = 2807 ses->serverDomain =
2764 kzalloc(2 * 2808 kzalloc(2 *
2765 (len + 2809 (len +
@@ -2777,13 +2821,20 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid,
2777 [1 + (2 * len)] 2821 [1 + (2 * len)]
2778 = 0; 2822 = 0;
2779 } /* else no more room so create dummy domain string */ 2823 } /* else no more room so create dummy domain string */
2780 else 2824 else {
2825 if(ses->serverDomain)
2826 kfree(ses->serverDomain);
2781 ses->serverDomain = 2827 ses->serverDomain =
2782 kzalloc(2, 2828 kzalloc(2,
2783 GFP_KERNEL); 2829 GFP_KERNEL);
2830 }
2784 } else { /* no room so create dummy domain and NOS string */ 2831 } else { /* no room so create dummy domain and NOS string */
2832 if(ses->serverDomain);
2833 kfree(ses->serverDomain);
2785 ses->serverDomain = 2834 ses->serverDomain =
2786 kzalloc(2, GFP_KERNEL); 2835 kzalloc(2, GFP_KERNEL);
2836 if(ses->serverNOS)
2837 kfree(ses->serverNOS);
2787 ses->serverNOS = 2838 ses->serverNOS =
2788 kzalloc(2, GFP_KERNEL); 2839 kzalloc(2, GFP_KERNEL);
2789 } 2840 }
@@ -2792,6 +2843,8 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid,
2792 if (((long) bcc_ptr + len) - (long) 2843 if (((long) bcc_ptr + len) - (long)
2793 pByteArea(smb_buffer_response) 2844 pByteArea(smb_buffer_response)
2794 <= BCC(smb_buffer_response)) { 2845 <= BCC(smb_buffer_response)) {
2846 if(ses->serverOS)
2847 kfree(ses->serverOS);
2795 ses->serverOS = 2848 ses->serverOS =
2796 kzalloc(len + 1, 2849 kzalloc(len + 1,
2797 GFP_KERNEL); 2850 GFP_KERNEL);
@@ -2803,6 +2856,8 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid,
2803 bcc_ptr++; 2856 bcc_ptr++;
2804 2857
2805 len = strnlen(bcc_ptr, 1024); 2858 len = strnlen(bcc_ptr, 1024);
2859 if(ses->serverNOS)
2860 kfree(ses->serverNOS);
2806 ses->serverNOS = 2861 ses->serverNOS =
2807 kzalloc(len + 1, 2862 kzalloc(len + 1,
2808 GFP_KERNEL); 2863 GFP_KERNEL);
@@ -2812,6 +2867,8 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid,
2812 bcc_ptr++; 2867 bcc_ptr++;
2813 2868
2814 len = strnlen(bcc_ptr, 1024); 2869 len = strnlen(bcc_ptr, 1024);
2870 if(ses->serverDomain)
2871 kfree(ses->serverDomain);
2815 ses->serverDomain = 2872 ses->serverDomain =
2816 kzalloc(len + 1, 2873 kzalloc(len + 1,
2817 GFP_KERNEL); 2874 GFP_KERNEL);
@@ -3116,6 +3173,8 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses,
3116/* We look for obvious messed up bcc or strings in response so we do not go off 3173/* We look for obvious messed up bcc or strings in response so we do not go off
3117 the end since (at least) WIN2K and Windows XP have a major bug in not null 3174 the end since (at least) WIN2K and Windows XP have a major bug in not null
3118 terminating last Unicode string in response */ 3175 terminating last Unicode string in response */
3176 if(ses->serverOS)
3177 kfree(ses->serverOS);
3119 ses->serverOS = 3178 ses->serverOS =
3120 kzalloc(2 * (len + 1), GFP_KERNEL); 3179 kzalloc(2 * (len + 1), GFP_KERNEL);
3121 cifs_strfromUCS_le(ses->serverOS, 3180 cifs_strfromUCS_le(ses->serverOS,
@@ -3131,6 +3190,8 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses,
3131 bcc_ptr, 3190 bcc_ptr,
3132 remaining_words 3191 remaining_words
3133 - 1); 3192 - 1);
3193 if(ses->serverNOS)
3194 kfree(ses->serverNOS);
3134 ses->serverNOS = 3195 ses->serverNOS =
3135 kzalloc(2 * (len + 1), 3196 kzalloc(2 * (len + 1),
3136 GFP_KERNEL); 3197 GFP_KERNEL);
@@ -3147,6 +3208,8 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses,
3147 if (remaining_words > 0) { 3208 if (remaining_words > 0) {
3148 len = UniStrnlen((wchar_t *) bcc_ptr, remaining_words); 3209 len = UniStrnlen((wchar_t *) bcc_ptr, remaining_words);
3149 /* last string not always null terminated (e.g. for Windows XP & 2000) */ 3210 /* last string not always null terminated (e.g. for Windows XP & 2000) */
3211 if(ses->serverDomain)
3212 kfree(ses->serverDomain);
3150 ses->serverDomain = 3213 ses->serverDomain =
3151 kzalloc(2 * 3214 kzalloc(2 *
3152 (len + 3215 (len +
@@ -3172,10 +3235,17 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses,
3172 len)] 3235 len)]
3173 = 0; 3236 = 0;
3174 } /* else no more room so create dummy domain string */ 3237 } /* else no more room so create dummy domain string */
3175 else 3238 else {
3239 if(ses->serverDomain)
3240 kfree(ses->serverDomain);
3176 ses->serverDomain = kzalloc(2,GFP_KERNEL); 3241 ses->serverDomain = kzalloc(2,GFP_KERNEL);
3242 }
3177 } else { /* no room so create dummy domain and NOS string */ 3243 } else { /* no room so create dummy domain and NOS string */
3244 if(ses->serverDomain)
3245 kfree(ses->serverDomain);
3178 ses->serverDomain = kzalloc(2, GFP_KERNEL); 3246 ses->serverDomain = kzalloc(2, GFP_KERNEL);
3247 if(ses->serverNOS)
3248 kfree(ses->serverNOS);
3179 ses->serverNOS = kzalloc(2, GFP_KERNEL); 3249 ses->serverNOS = kzalloc(2, GFP_KERNEL);
3180 } 3250 }
3181 } else { /* ASCII */ 3251 } else { /* ASCII */
@@ -3183,6 +3253,8 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses,
3183 if (((long) bcc_ptr + len) - 3253 if (((long) bcc_ptr + len) -
3184 (long) pByteArea(smb_buffer_response) 3254 (long) pByteArea(smb_buffer_response)
3185 <= BCC(smb_buffer_response)) { 3255 <= BCC(smb_buffer_response)) {
3256 if(ses->serverOS)
3257 kfree(ses->serverOS);
3186 ses->serverOS = kzalloc(len + 1,GFP_KERNEL); 3258 ses->serverOS = kzalloc(len + 1,GFP_KERNEL);
3187 strncpy(ses->serverOS,bcc_ptr, len); 3259 strncpy(ses->serverOS,bcc_ptr, len);
3188 3260
@@ -3191,6 +3263,8 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses,
3191 bcc_ptr++; 3263 bcc_ptr++;
3192 3264
3193 len = strnlen(bcc_ptr, 1024); 3265 len = strnlen(bcc_ptr, 1024);
3266 if(ses->serverNOS)
3267 kfree(ses->serverNOS);
3194 ses->serverNOS = kzalloc(len+1,GFP_KERNEL); 3268 ses->serverNOS = kzalloc(len+1,GFP_KERNEL);
3195 strncpy(ses->serverNOS, bcc_ptr, len); 3269 strncpy(ses->serverNOS, bcc_ptr, len);
3196 bcc_ptr += len; 3270 bcc_ptr += len;
@@ -3198,6 +3272,8 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses,
3198 bcc_ptr++; 3272 bcc_ptr++;
3199 3273
3200 len = strnlen(bcc_ptr, 1024); 3274 len = strnlen(bcc_ptr, 1024);
3275 if(ses->serverDomain)
3276 kfree(ses->serverDomain);
3201 ses->serverDomain = kzalloc(len+1,GFP_KERNEL); 3277 ses->serverDomain = kzalloc(len+1,GFP_KERNEL);
3202 strncpy(ses->serverDomain, bcc_ptr, len); 3278 strncpy(ses->serverDomain, bcc_ptr, len);
3203 bcc_ptr += len; 3279 bcc_ptr += len;
@@ -3282,7 +3358,8 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses,
3282 bcc_ptr++; /* align */ 3358 bcc_ptr++; /* align */
3283 } 3359 }
3284 3360
3285 if(ses->server->secMode & (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) 3361 if(ses->server->secMode &
3362 (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED))
3286 smb_buffer->Flags2 |= SMBFLG2_SECURITY_SIGNATURE; 3363 smb_buffer->Flags2 |= SMBFLG2_SECURITY_SIGNATURE;
3287 3364
3288 if (ses->capabilities & CAP_STATUS32) { 3365 if (ses->capabilities & CAP_STATUS32) {
@@ -3294,8 +3371,10 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses,
3294 if (ses->capabilities & CAP_UNICODE) { 3371 if (ses->capabilities & CAP_UNICODE) {
3295 smb_buffer->Flags2 |= SMBFLG2_UNICODE; 3372 smb_buffer->Flags2 |= SMBFLG2_UNICODE;
3296 length = 3373 length =
3297 cifs_strtoUCS((__le16 *) bcc_ptr, tree, 100, nls_codepage); 3374 cifs_strtoUCS((__le16 *) bcc_ptr, tree,
3298 bcc_ptr += 2 * length; /* convert num of 16 bit words to bytes */ 3375 6 /* max utf8 char length in bytes */ *
3376 (/* server len*/ + 256 /* share len */), nls_codepage);
3377 bcc_ptr += 2 * length; /* convert num 16 bit words to bytes */
3299 bcc_ptr += 2; /* skip trailing null */ 3378 bcc_ptr += 2; /* skip trailing null */
3300 } else { /* ASCII */ 3379 } else { /* ASCII */
3301 strcpy(bcc_ptr, tree); 3380 strcpy(bcc_ptr, tree);
@@ -3447,6 +3526,12 @@ int cifs_setup_session(unsigned int xid, struct cifsSesInfo *pSesInfo,
3447 pSesInfo->server->secMode, 3526 pSesInfo->server->secMode,
3448 pSesInfo->server->capabilities, 3527 pSesInfo->server->capabilities,
3449 pSesInfo->server->timeZone)); 3528 pSesInfo->server->timeZone));
3529#ifdef CONFIG_CIFS_EXPERIMENTAL
3530 if(experimEnabled > 1)
3531 rc = CIFS_SessSetup(xid, pSesInfo, CIFS_NTLM /* type */,
3532 &ntlmv2_flag, nls_info);
3533 else
3534#endif
3450 if (extended_security 3535 if (extended_security
3451 && (pSesInfo->capabilities & CAP_EXTENDED_SECURITY) 3536 && (pSesInfo->capabilities & CAP_EXTENDED_SECURITY)
3452 && (pSesInfo->server->secType == NTLMSSP)) { 3537 && (pSesInfo->server->secType == NTLMSSP)) {
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index 1d0ca3eaaca5..82315edc77d7 100644
--- a/fs/cifs/dir.c
+++ b/fs/cifs/dir.c
@@ -139,9 +139,7 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
139 cifs_sb = CIFS_SB(inode->i_sb); 139 cifs_sb = CIFS_SB(inode->i_sb);
140 pTcon = cifs_sb->tcon; 140 pTcon = cifs_sb->tcon;
141 141
142 mutex_lock(&direntry->d_sb->s_vfs_rename_mutex);
143 full_path = build_path_from_dentry(direntry); 142 full_path = build_path_from_dentry(direntry);
144 mutex_unlock(&direntry->d_sb->s_vfs_rename_mutex);
145 if(full_path == NULL) { 143 if(full_path == NULL) {
146 FreeXid(xid); 144 FreeXid(xid);
147 return -ENOMEM; 145 return -ENOMEM;
@@ -316,9 +314,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode,
316 cifs_sb = CIFS_SB(inode->i_sb); 314 cifs_sb = CIFS_SB(inode->i_sb);
317 pTcon = cifs_sb->tcon; 315 pTcon = cifs_sb->tcon;
318 316
319 mutex_lock(&direntry->d_sb->s_vfs_rename_mutex);
320 full_path = build_path_from_dentry(direntry); 317 full_path = build_path_from_dentry(direntry);
321 mutex_unlock(&direntry->d_sb->s_vfs_rename_mutex);
322 if(full_path == NULL) 318 if(full_path == NULL)
323 rc = -ENOMEM; 319 rc = -ENOMEM;
324 else if (pTcon->ses->capabilities & CAP_UNIX) { 320 else if (pTcon->ses->capabilities & CAP_UNIX) {
@@ -440,6 +436,20 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, struct name
440 cifs_sb = CIFS_SB(parent_dir_inode->i_sb); 436 cifs_sb = CIFS_SB(parent_dir_inode->i_sb);
441 pTcon = cifs_sb->tcon; 437 pTcon = cifs_sb->tcon;
442 438
439 /*
440 * Don't allow the separator character in a path component.
441 * The VFS will not allow "/", but "\" is allowed by posix.
442 */
443 if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS)) {
444 int i;
445 for (i = 0; i < direntry->d_name.len; i++)
446 if (direntry->d_name.name[i] == '\\') {
447 cFYI(1, ("Invalid file name"));
448 FreeXid(xid);
449 return ERR_PTR(-EINVAL);
450 }
451 }
452
443 /* can not grab the rename sem here since it would 453 /* can not grab the rename sem here since it would
444 deadlock in the cases (beginning of sys_rename itself) 454 deadlock in the cases (beginning of sys_rename itself)
445 in which we already have the sb rename sem */ 455 in which we already have the sb rename sem */
diff --git a/fs/cifs/fcntl.c b/fs/cifs/fcntl.c
index ec4dfe9bf5ef..633a93811328 100644
--- a/fs/cifs/fcntl.c
+++ b/fs/cifs/fcntl.c
@@ -86,9 +86,7 @@ int cifs_dir_notify(struct file * file, unsigned long arg)
86 cifs_sb = CIFS_SB(file->f_dentry->d_sb); 86 cifs_sb = CIFS_SB(file->f_dentry->d_sb);
87 pTcon = cifs_sb->tcon; 87 pTcon = cifs_sb->tcon;
88 88
89 mutex_lock(&file->f_dentry->d_sb->s_vfs_rename_mutex);
90 full_path = build_path_from_dentry(file->f_dentry); 89 full_path = build_path_from_dentry(file->f_dentry);
91 mutex_unlock(&file->f_dentry->d_sb->s_vfs_rename_mutex);
92 90
93 if(full_path == NULL) { 91 if(full_path == NULL) {
94 rc = -ENOMEM; 92 rc = -ENOMEM;
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 5c497c529772..e2b4ce1dad66 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -84,6 +84,8 @@ static inline int cifs_get_disposition(unsigned int flags)
84 return FILE_OVERWRITE_IF; 84 return FILE_OVERWRITE_IF;
85 else if ((flags & O_CREAT) == O_CREAT) 85 else if ((flags & O_CREAT) == O_CREAT)
86 return FILE_OPEN_IF; 86 return FILE_OPEN_IF;
87 else if ((flags & O_TRUNC) == O_TRUNC)
88 return FILE_OVERWRITE;
87 else 89 else
88 return FILE_OPEN; 90 return FILE_OPEN;
89} 91}
@@ -203,9 +205,7 @@ int cifs_open(struct inode *inode, struct file *file)
203 } 205 }
204 } 206 }
205 207
206 mutex_lock(&inode->i_sb->s_vfs_rename_mutex);
207 full_path = build_path_from_dentry(file->f_dentry); 208 full_path = build_path_from_dentry(file->f_dentry);
208 mutex_unlock(&inode->i_sb->s_vfs_rename_mutex);
209 if (full_path == NULL) { 209 if (full_path == NULL) {
210 FreeXid(xid); 210 FreeXid(xid);
211 return -ENOMEM; 211 return -ENOMEM;
@@ -658,7 +658,7 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock)
658 else 658 else
659 posix_lock_type = CIFS_WRLCK; 659 posix_lock_type = CIFS_WRLCK;
660 rc = CIFSSMBPosixLock(xid, pTcon, netfid, 1 /* get */, 660 rc = CIFSSMBPosixLock(xid, pTcon, netfid, 1 /* get */,
661 length, pfLock->fl_start, 661 length, pfLock,
662 posix_lock_type, wait_flag); 662 posix_lock_type, wait_flag);
663 FreeXid(xid); 663 FreeXid(xid);
664 return rc; 664 return rc;
@@ -706,7 +706,7 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock)
706 return -EOPNOTSUPP; 706 return -EOPNOTSUPP;
707 } 707 }
708 rc = CIFSSMBPosixLock(xid, pTcon, netfid, 0 /* set */, 708 rc = CIFSSMBPosixLock(xid, pTcon, netfid, 0 /* set */,
709 length, pfLock->fl_start, 709 length, pfLock,
710 posix_lock_type, wait_flag); 710 posix_lock_type, wait_flag);
711 } else 711 } else
712 rc = CIFSSMBLock(xid, pTcon, netfid, length, pfLock->fl_start, 712 rc = CIFSSMBLock(xid, pTcon, netfid, length, pfLock->fl_start,
@@ -906,9 +906,10 @@ static ssize_t cifs_write(struct file *file, const char *write_data,
906 if (rc != 0) 906 if (rc != 0)
907 break; 907 break;
908 } 908 }
909 /* BB FIXME We can not sign across two buffers yet */ 909 if(experimEnabled || (pTcon->ses->server &&
910 if((pTcon->ses->server->secMode & 910 ((pTcon->ses->server->secMode &
911 (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) == 0) { 911 (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED))
912 == 0))) {
912 struct kvec iov[2]; 913 struct kvec iov[2];
913 unsigned int len; 914 unsigned int len;
914 915
@@ -923,13 +924,13 @@ static ssize_t cifs_write(struct file *file, const char *write_data,
923 *poffset, &bytes_written, 924 *poffset, &bytes_written,
924 iov, 1, long_op); 925 iov, 1, long_op);
925 } else 926 } else
926 /* BB FIXME fixup indentation of line below */ 927 rc = CIFSSMBWrite(xid, pTcon,
927 rc = CIFSSMBWrite(xid, pTcon, 928 open_file->netfid,
928 open_file->netfid, 929 min_t(const int, cifs_sb->wsize,
929 min_t(const int, cifs_sb->wsize, 930 write_size - total_written),
930 write_size - total_written), 931 *poffset, &bytes_written,
931 *poffset, &bytes_written, 932 write_data + total_written,
932 write_data + total_written, NULL, long_op); 933 NULL, long_op);
933 } 934 }
934 if (rc || (bytes_written == 0)) { 935 if (rc || (bytes_written == 0)) {
935 if (total_written) 936 if (total_written)
@@ -968,6 +969,16 @@ struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *cifs_inode)
968 struct cifsFileInfo *open_file; 969 struct cifsFileInfo *open_file;
969 int rc; 970 int rc;
970 971
972 /* Having a null inode here (because mapping->host was set to zero by
973 the VFS or MM) should not happen but we had reports of on oops (due to
974 it being zero) during stress testcases so we need to check for it */
975
976 if(cifs_inode == NULL) {
977 cERROR(1,("Null inode passed to cifs_writeable_file"));
978 dump_stack();
979 return NULL;
980 }
981
971 read_lock(&GlobalSMBSeslock); 982 read_lock(&GlobalSMBSeslock);
972 list_for_each_entry(open_file, &cifs_inode->openFileList, flist) { 983 list_for_each_entry(open_file, &cifs_inode->openFileList, flist) {
973 if (open_file->closePend) 984 if (open_file->closePend)
@@ -1093,12 +1104,11 @@ static int cifs_writepages(struct address_space *mapping,
1093 if (cifs_sb->wsize < PAGE_CACHE_SIZE) 1104 if (cifs_sb->wsize < PAGE_CACHE_SIZE)
1094 return generic_writepages(mapping, wbc); 1105 return generic_writepages(mapping, wbc);
1095 1106
1096 /* BB FIXME we do not have code to sign across multiple buffers yet,
1097 so go to older writepage style write which we can sign if needed */
1098 if((cifs_sb->tcon->ses) && (cifs_sb->tcon->ses->server)) 1107 if((cifs_sb->tcon->ses) && (cifs_sb->tcon->ses->server))
1099 if(cifs_sb->tcon->ses->server->secMode & 1108 if(cifs_sb->tcon->ses->server->secMode &
1100 (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) 1109 (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED))
1101 return generic_writepages(mapping, wbc); 1110 if(!experimEnabled)
1111 return generic_writepages(mapping, wbc);
1102 1112
1103 /* 1113 /*
1104 * BB: Is this meaningful for a non-block-device file system? 1114 * BB: Is this meaningful for a non-block-device file system?
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index 957ddd1571c6..4093764ef461 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -722,9 +722,7 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode)
722 cifs_sb = CIFS_SB(inode->i_sb); 722 cifs_sb = CIFS_SB(inode->i_sb);
723 pTcon = cifs_sb->tcon; 723 pTcon = cifs_sb->tcon;
724 724
725 mutex_lock(&inode->i_sb->s_vfs_rename_mutex);
726 full_path = build_path_from_dentry(direntry); 725 full_path = build_path_from_dentry(direntry);
727 mutex_unlock(&inode->i_sb->s_vfs_rename_mutex);
728 if (full_path == NULL) { 726 if (full_path == NULL) {
729 FreeXid(xid); 727 FreeXid(xid);
730 return -ENOMEM; 728 return -ENOMEM;
@@ -807,9 +805,7 @@ int cifs_rmdir(struct inode *inode, struct dentry *direntry)
807 cifs_sb = CIFS_SB(inode->i_sb); 805 cifs_sb = CIFS_SB(inode->i_sb);
808 pTcon = cifs_sb->tcon; 806 pTcon = cifs_sb->tcon;
809 807
810 mutex_lock(&inode->i_sb->s_vfs_rename_mutex);
811 full_path = build_path_from_dentry(direntry); 808 full_path = build_path_from_dentry(direntry);
812 mutex_unlock(&inode->i_sb->s_vfs_rename_mutex);
813 if (full_path == NULL) { 809 if (full_path == NULL) {
814 FreeXid(xid); 810 FreeXid(xid);
815 return -ENOMEM; 811 return -ENOMEM;
@@ -1141,9 +1137,7 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs)
1141 rc = 0; 1137 rc = 0;
1142 } 1138 }
1143 1139
1144 mutex_lock(&direntry->d_sb->s_vfs_rename_mutex);
1145 full_path = build_path_from_dentry(direntry); 1140 full_path = build_path_from_dentry(direntry);
1146 mutex_unlock(&direntry->d_sb->s_vfs_rename_mutex);
1147 if (full_path == NULL) { 1141 if (full_path == NULL) {
1148 FreeXid(xid); 1142 FreeXid(xid);
1149 return -ENOMEM; 1143 return -ENOMEM;
diff --git a/fs/cifs/link.c b/fs/cifs/link.c
index 9562f5bba65c..2ec99f833142 100644
--- a/fs/cifs/link.c
+++ b/fs/cifs/link.c
@@ -48,10 +48,8 @@ cifs_hardlink(struct dentry *old_file, struct inode *inode,
48/* No need to check for cross device links since server will do that 48/* No need to check for cross device links since server will do that
49 BB note DFS case in future though (when we may have to check) */ 49 BB note DFS case in future though (when we may have to check) */
50 50
51 mutex_lock(&inode->i_sb->s_vfs_rename_mutex);
52 fromName = build_path_from_dentry(old_file); 51 fromName = build_path_from_dentry(old_file);
53 toName = build_path_from_dentry(direntry); 52 toName = build_path_from_dentry(direntry);
54 mutex_unlock(&inode->i_sb->s_vfs_rename_mutex);
55 if((fromName == NULL) || (toName == NULL)) { 53 if((fromName == NULL) || (toName == NULL)) {
56 rc = -ENOMEM; 54 rc = -ENOMEM;
57 goto cifs_hl_exit; 55 goto cifs_hl_exit;
@@ -103,9 +101,7 @@ cifs_follow_link(struct dentry *direntry, struct nameidata *nd)
103 101
104 xid = GetXid(); 102 xid = GetXid();
105 103
106 mutex_lock(&direntry->d_sb->s_vfs_rename_mutex);
107 full_path = build_path_from_dentry(direntry); 104 full_path = build_path_from_dentry(direntry);
108 mutex_unlock(&direntry->d_sb->s_vfs_rename_mutex);
109 105
110 if (!full_path) 106 if (!full_path)
111 goto out_no_free; 107 goto out_no_free;
@@ -164,9 +160,7 @@ cifs_symlink(struct inode *inode, struct dentry *direntry, const char *symname)
164 cifs_sb = CIFS_SB(inode->i_sb); 160 cifs_sb = CIFS_SB(inode->i_sb);
165 pTcon = cifs_sb->tcon; 161 pTcon = cifs_sb->tcon;
166 162
167 mutex_lock(&inode->i_sb->s_vfs_rename_mutex);
168 full_path = build_path_from_dentry(direntry); 163 full_path = build_path_from_dentry(direntry);
169 mutex_unlock(&inode->i_sb->s_vfs_rename_mutex);
170 164
171 if(full_path == NULL) { 165 if(full_path == NULL) {
172 FreeXid(xid); 166 FreeXid(xid);
diff --git a/fs/cifs/ntlmssp.c b/fs/cifs/ntlmssp.c
index 78866f925747..115359cc7a32 100644
--- a/fs/cifs/ntlmssp.c
+++ b/fs/cifs/ntlmssp.c
@@ -121,6 +121,20 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, const int type,
121 } 121 }
122 122
123 123
124 /* copy session key */
125
126 /* if Unicode, align strings to two byte boundary */
127
128 /* copy user name */ /* BB Do we need to special case null user name? */
129
130 /* copy domain name */
131
132 /* copy Linux version */
133
134 /* copy network operating system name */
135
136 /* update bcc and smb buffer length */
137
124/* rc = SendReceive2(xid, ses, iov, num_iovecs, &resp_buf_type, 0); */ 138/* rc = SendReceive2(xid, ses, iov, num_iovecs, &resp_buf_type, 0); */
125 /* SMB request buf freed in SendReceive2 */ 139 /* SMB request buf freed in SendReceive2 */
126 140
diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c
index 2f6e2825571e..b689c5035124 100644
--- a/fs/cifs/readdir.c
+++ b/fs/cifs/readdir.c
@@ -404,9 +404,7 @@ static int initiate_cifs_search(const int xid, struct file *file)
404 if(pTcon == NULL) 404 if(pTcon == NULL)
405 return -EINVAL; 405 return -EINVAL;
406 406
407 mutex_lock(&file->f_dentry->d_sb->s_vfs_rename_mutex);
408 full_path = build_path_from_dentry(file->f_dentry); 407 full_path = build_path_from_dentry(file->f_dentry);
409 mutex_unlock(&file->f_dentry->d_sb->s_vfs_rename_mutex);
410 408
411 if(full_path == NULL) { 409 if(full_path == NULL) {
412 return -ENOMEM; 410 return -ENOMEM;
@@ -592,6 +590,13 @@ static int find_cifs_entry(const int xid, struct cifsTconInfo *pTcon,
592 first_entry_in_buffer = 590 first_entry_in_buffer =
593 cifsFile->srch_inf.index_of_last_entry - 591 cifsFile->srch_inf.index_of_last_entry -
594 cifsFile->srch_inf.entries_in_buffer; 592 cifsFile->srch_inf.entries_in_buffer;
593
594 /* if first entry in buf is zero then is first buffer
595 in search response data which means it is likely . and ..
596 will be in this buffer, although some servers do not return
597 . and .. for the root of a drive and for those we need
598 to start two entries earlier */
599
595/* dump_cifs_file_struct(file, "In fce ");*/ 600/* dump_cifs_file_struct(file, "In fce ");*/
596 if(((index_to_find < cifsFile->srch_inf.index_of_last_entry) && 601 if(((index_to_find < cifsFile->srch_inf.index_of_last_entry) &&
597 is_dir_changed(file)) || 602 is_dir_changed(file)) ||
@@ -634,23 +639,14 @@ static int find_cifs_entry(const int xid, struct cifsTconInfo *pTcon,
634 char * end_of_smb = cifsFile->srch_inf.ntwrk_buf_start + 639 char * end_of_smb = cifsFile->srch_inf.ntwrk_buf_start +
635 smbCalcSize((struct smb_hdr *) 640 smbCalcSize((struct smb_hdr *)
636 cifsFile->srch_inf.ntwrk_buf_start); 641 cifsFile->srch_inf.ntwrk_buf_start);
642
643 current_entry = cifsFile->srch_inf.srch_entries_start;
637 first_entry_in_buffer = cifsFile->srch_inf.index_of_last_entry 644 first_entry_in_buffer = cifsFile->srch_inf.index_of_last_entry
638 - cifsFile->srch_inf.entries_in_buffer; 645 - cifsFile->srch_inf.entries_in_buffer;
639 pos_in_buf = index_to_find - first_entry_in_buffer; 646 pos_in_buf = index_to_find - first_entry_in_buffer;
640 cFYI(1,("found entry - pos_in_buf %d",pos_in_buf)); 647 cFYI(1,("found entry - pos_in_buf %d",pos_in_buf));
641 current_entry = cifsFile->srch_inf.srch_entries_start;
642 for(i=0;(i<(pos_in_buf)) && (current_entry != NULL);i++) { 648 for(i=0;(i<(pos_in_buf)) && (current_entry != NULL);i++) {
643 /* go entry by entry figuring out which is first */ 649 /* go entry by entry figuring out which is first */
644 /* if( . or ..)
645 skip */
646 rc = cifs_entry_is_dot(current_entry,cifsFile);
647 if(rc == 1) /* is . or .. so skip */ {
648 cFYI(1,("Entry is .")); /* BB removeme BB */
649 /* continue; */
650 } else if (rc == 2 ) {
651 cFYI(1,("Entry is ..")); /* BB removeme BB */
652 /* continue; */
653 }
654 current_entry = nxt_dir_entry(current_entry,end_of_smb); 650 current_entry = nxt_dir_entry(current_entry,end_of_smb);
655 } 651 }
656 if((current_entry == NULL) && (i < pos_in_buf)) { 652 if((current_entry == NULL) && (i < pos_in_buf)) {
@@ -770,6 +766,11 @@ static int cifs_filldir(char *pfindEntry, struct file *file,
770 if(file->f_dentry == NULL) 766 if(file->f_dentry == NULL)
771 return -ENOENT; 767 return -ENOENT;
772 768
769 rc = cifs_entry_is_dot(pfindEntry,pCifsF);
770 /* skip . and .. since we added them first */
771 if(rc != 0)
772 return 0;
773
773 cifs_sb = CIFS_SB(file->f_dentry->d_sb); 774 cifs_sb = CIFS_SB(file->f_dentry->d_sb);
774 775
775 qstring.name = scratch_buf; 776 qstring.name = scratch_buf;
@@ -898,22 +899,22 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
898 899
899 switch ((int) file->f_pos) { 900 switch ((int) file->f_pos) {
900 case 0: 901 case 0:
901 /*if (filldir(direntry, ".", 1, file->f_pos, 902 if (filldir(direntry, ".", 1, file->f_pos,
902 file->f_dentry->d_inode->i_ino, DT_DIR) < 0) { 903 file->f_dentry->d_inode->i_ino, DT_DIR) < 0) {
903 cERROR(1, ("Filldir for current dir failed ")); 904 cERROR(1, ("Filldir for current dir failed"));
904 rc = -ENOMEM; 905 rc = -ENOMEM;
905 break; 906 break;
906 } 907 }
907 file->f_pos++; */ 908 file->f_pos++;
908 case 1: 909 case 1:
909 /* if (filldir(direntry, "..", 2, file->f_pos, 910 if (filldir(direntry, "..", 2, file->f_pos,
910 file->f_dentry->d_parent->d_inode->i_ino, DT_DIR) < 0) { 911 file->f_dentry->d_parent->d_inode->i_ino, DT_DIR) < 0) {
911 cERROR(1, ("Filldir for parent dir failed ")); 912 cERROR(1, ("Filldir for parent dir failed "));
912 rc = -ENOMEM; 913 rc = -ENOMEM;
913 break; 914 break;
914 } 915 }
915 file->f_pos++; */ 916 file->f_pos++;
916 case 2: 917 default:
917 /* 1) If search is active, 918 /* 1) If search is active,
918 is in current search buffer? 919 is in current search buffer?
919 if it before then restart search 920 if it before then restart search
@@ -927,7 +928,6 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
927 return rc; 928 return rc;
928 } 929 }
929 } 930 }
930 default:
931 if(file->private_data == NULL) { 931 if(file->private_data == NULL) {
932 rc = -EINVAL; 932 rc = -EINVAL;
933 FreeXid(xid); 933 FreeXid(xid);
@@ -947,8 +947,6 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
947 kfree(cifsFile->search_resume_name); 947 kfree(cifsFile->search_resume_name);
948 cifsFile->search_resume_name = NULL; */ 948 cifsFile->search_resume_name = NULL; */
949 949
950 /* BB account for . and .. in f_pos as special case */
951
952 rc = find_cifs_entry(xid,pTcon, file, 950 rc = find_cifs_entry(xid,pTcon, file,
953 &current_entry,&num_to_fill); 951 &current_entry,&num_to_fill);
954 if(rc) { 952 if(rc) {
@@ -977,7 +975,8 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
977 num_to_fill, i)); 975 num_to_fill, i));
978 break; 976 break;
979 } 977 }
980 978 /* if buggy server returns . and .. late do
979 we want to check for that here? */
981 rc = cifs_filldir(current_entry, file, 980 rc = cifs_filldir(current_entry, file,
982 filldir, direntry,tmp_buf); 981 filldir, direntry,tmp_buf);
983 file->f_pos++; 982 file->f_pos++;
diff --git a/fs/cifs/xattr.c b/fs/cifs/xattr.c
index 3938444d87b2..7754d641775e 100644
--- a/fs/cifs/xattr.c
+++ b/fs/cifs/xattr.c
@@ -62,9 +62,7 @@ int cifs_removexattr(struct dentry * direntry, const char * ea_name)
62 cifs_sb = CIFS_SB(sb); 62 cifs_sb = CIFS_SB(sb);
63 pTcon = cifs_sb->tcon; 63 pTcon = cifs_sb->tcon;
64 64
65 mutex_lock(&sb->s_vfs_rename_mutex);
66 full_path = build_path_from_dentry(direntry); 65 full_path = build_path_from_dentry(direntry);
67 mutex_unlock(&sb->s_vfs_rename_mutex);
68 if(full_path == NULL) { 66 if(full_path == NULL) {
69 FreeXid(xid); 67 FreeXid(xid);
70 return -ENOMEM; 68 return -ENOMEM;
@@ -116,9 +114,7 @@ int cifs_setxattr(struct dentry * direntry, const char * ea_name,
116 cifs_sb = CIFS_SB(sb); 114 cifs_sb = CIFS_SB(sb);
117 pTcon = cifs_sb->tcon; 115 pTcon = cifs_sb->tcon;
118 116
119 mutex_lock(&sb->s_vfs_rename_mutex);
120 full_path = build_path_from_dentry(direntry); 117 full_path = build_path_from_dentry(direntry);
121 mutex_unlock(&sb->s_vfs_rename_mutex);
122 if(full_path == NULL) { 118 if(full_path == NULL) {
123 FreeXid(xid); 119 FreeXid(xid);
124 return -ENOMEM; 120 return -ENOMEM;
@@ -223,9 +219,7 @@ ssize_t cifs_getxattr(struct dentry * direntry, const char * ea_name,
223 cifs_sb = CIFS_SB(sb); 219 cifs_sb = CIFS_SB(sb);
224 pTcon = cifs_sb->tcon; 220 pTcon = cifs_sb->tcon;
225 221
226 mutex_lock(&sb->s_vfs_rename_mutex);
227 full_path = build_path_from_dentry(direntry); 222 full_path = build_path_from_dentry(direntry);
228 mutex_unlock(&sb->s_vfs_rename_mutex);
229 if(full_path == NULL) { 223 if(full_path == NULL) {
230 FreeXid(xid); 224 FreeXid(xid);
231 return -ENOMEM; 225 return -ENOMEM;
@@ -341,9 +335,7 @@ ssize_t cifs_listxattr(struct dentry * direntry, char * data, size_t buf_size)
341 cifs_sb = CIFS_SB(sb); 335 cifs_sb = CIFS_SB(sb);
342 pTcon = cifs_sb->tcon; 336 pTcon = cifs_sb->tcon;
343 337
344 mutex_lock(&sb->s_vfs_rename_mutex);
345 full_path = build_path_from_dentry(direntry); 338 full_path = build_path_from_dentry(direntry);
346 mutex_unlock(&sb->s_vfs_rename_mutex);
347 if(full_path == NULL) { 339 if(full_path == NULL) {
348 FreeXid(xid); 340 FreeXid(xid);
349 return -ENOMEM; 341 return -ENOMEM;
diff --git a/fs/compat.c b/fs/compat.c
index 7f8e26ea427c..b1f64786a613 100644
--- a/fs/compat.c
+++ b/fs/compat.c
@@ -1217,6 +1217,10 @@ static ssize_t compat_do_readv_writev(int type, struct file *file,
1217 if (ret < 0) 1217 if (ret < 0)
1218 goto out; 1218 goto out;
1219 1219
1220 ret = security_file_permission(file, type == READ ? MAY_READ:MAY_WRITE);
1221 if (ret)
1222 goto out;
1223
1220 fnv = NULL; 1224 fnv = NULL;
1221 if (type == READ) { 1225 if (type == READ) {
1222 fn = file->f_op->read; 1226 fn = file->f_op->read;
@@ -1313,6 +1317,26 @@ out:
1313 return ret; 1317 return ret;
1314} 1318}
1315 1319
1320asmlinkage long
1321compat_sys_vmsplice(int fd, const struct compat_iovec __user *iov32,
1322 unsigned int nr_segs, unsigned int flags)
1323{
1324 unsigned i;
1325 struct iovec *iov;
1326 if (nr_segs > UIO_MAXIOV)
1327 return -EINVAL;
1328 iov = compat_alloc_user_space(nr_segs * sizeof(struct iovec));
1329 for (i = 0; i < nr_segs; i++) {
1330 struct compat_iovec v;
1331 if (get_user(v.iov_base, &iov32[i].iov_base) ||
1332 get_user(v.iov_len, &iov32[i].iov_len) ||
1333 put_user(compat_ptr(v.iov_base), &iov[i].iov_base) ||
1334 put_user(v.iov_len, &iov[i].iov_len))
1335 return -EFAULT;
1336 }
1337 return sys_vmsplice(fd, iov, nr_segs, flags);
1338}
1339
1316/* 1340/*
1317 * Exactly like fs/open.c:sys_open(), except that it doesn't set the 1341 * Exactly like fs/open.c:sys_open(), except that it doesn't set the
1318 * O_LARGEFILE flag. 1342 * O_LARGEFILE flag.
@@ -1889,7 +1913,7 @@ asmlinkage long compat_sys_ppoll(struct pollfd __user *ufds,
1889 } 1913 }
1890 1914
1891 if (sigmask) { 1915 if (sigmask) {
1892 if (sigsetsize |= sizeof(compat_sigset_t)) 1916 if (sigsetsize != sizeof(compat_sigset_t))
1893 return -EINVAL; 1917 return -EINVAL;
1894 if (copy_from_user(&ss32, sigmask, sizeof(ss32))) 1918 if (copy_from_user(&ss32, sigmask, sizeof(ss32)))
1895 return -EFAULT; 1919 return -EFAULT;
@@ -2006,109 +2030,115 @@ union compat_nfsctl_res {
2006 struct knfsd_fh cr32_getfs; 2030 struct knfsd_fh cr32_getfs;
2007}; 2031};
2008 2032
2009static int compat_nfs_svc_trans(struct nfsctl_arg *karg, struct compat_nfsctl_arg __user *arg) 2033static int compat_nfs_svc_trans(struct nfsctl_arg *karg,
2034 struct compat_nfsctl_arg __user *arg)
2010{ 2035{
2011 int err; 2036 if (!access_ok(VERIFY_READ, &arg->ca32_svc, sizeof(arg->ca32_svc)) ||
2012 2037 get_user(karg->ca_version, &arg->ca32_version) ||
2013 err = access_ok(VERIFY_READ, &arg->ca32_svc, sizeof(arg->ca32_svc)); 2038 __get_user(karg->ca_svc.svc_port, &arg->ca32_svc.svc32_port) ||
2014 err |= get_user(karg->ca_version, &arg->ca32_version); 2039 __get_user(karg->ca_svc.svc_nthreads,
2015 err |= __get_user(karg->ca_svc.svc_port, &arg->ca32_svc.svc32_port); 2040 &arg->ca32_svc.svc32_nthreads))
2016 err |= __get_user(karg->ca_svc.svc_nthreads, &arg->ca32_svc.svc32_nthreads); 2041 return -EFAULT;
2017 return (err) ? -EFAULT : 0; 2042 return 0;
2018} 2043}
2019 2044
2020static int compat_nfs_clnt_trans(struct nfsctl_arg *karg, struct compat_nfsctl_arg __user *arg) 2045static int compat_nfs_clnt_trans(struct nfsctl_arg *karg,
2046 struct compat_nfsctl_arg __user *arg)
2021{ 2047{
2022 int err; 2048 if (!access_ok(VERIFY_READ, &arg->ca32_client,
2023 2049 sizeof(arg->ca32_client)) ||
2024 err = access_ok(VERIFY_READ, &arg->ca32_client, sizeof(arg->ca32_client)); 2050 get_user(karg->ca_version, &arg->ca32_version) ||
2025 err |= get_user(karg->ca_version, &arg->ca32_version); 2051 __copy_from_user(&karg->ca_client.cl_ident[0],
2026 err |= __copy_from_user(&karg->ca_client.cl_ident[0], 2052 &arg->ca32_client.cl32_ident[0],
2027 &arg->ca32_client.cl32_ident[0], 2053 NFSCLNT_IDMAX) ||
2028 NFSCLNT_IDMAX); 2054 __get_user(karg->ca_client.cl_naddr,
2029 err |= __get_user(karg->ca_client.cl_naddr, &arg->ca32_client.cl32_naddr); 2055 &arg->ca32_client.cl32_naddr) ||
2030 err |= __copy_from_user(&karg->ca_client.cl_addrlist[0], 2056 __copy_from_user(&karg->ca_client.cl_addrlist[0],
2031 &arg->ca32_client.cl32_addrlist[0], 2057 &arg->ca32_client.cl32_addrlist[0],
2032 (sizeof(struct in_addr) * NFSCLNT_ADDRMAX)); 2058 (sizeof(struct in_addr) * NFSCLNT_ADDRMAX)) ||
2033 err |= __get_user(karg->ca_client.cl_fhkeytype, 2059 __get_user(karg->ca_client.cl_fhkeytype,
2034 &arg->ca32_client.cl32_fhkeytype); 2060 &arg->ca32_client.cl32_fhkeytype) ||
2035 err |= __get_user(karg->ca_client.cl_fhkeylen, 2061 __get_user(karg->ca_client.cl_fhkeylen,
2036 &arg->ca32_client.cl32_fhkeylen); 2062 &arg->ca32_client.cl32_fhkeylen) ||
2037 err |= __copy_from_user(&karg->ca_client.cl_fhkey[0], 2063 __copy_from_user(&karg->ca_client.cl_fhkey[0],
2038 &arg->ca32_client.cl32_fhkey[0], 2064 &arg->ca32_client.cl32_fhkey[0],
2039 NFSCLNT_KEYMAX); 2065 NFSCLNT_KEYMAX))
2066 return -EFAULT;
2040 2067
2041 return (err) ? -EFAULT : 0; 2068 return 0;
2042} 2069}
2043 2070
2044static int compat_nfs_exp_trans(struct nfsctl_arg *karg, struct compat_nfsctl_arg __user *arg) 2071static int compat_nfs_exp_trans(struct nfsctl_arg *karg,
2072 struct compat_nfsctl_arg __user *arg)
2045{ 2073{
2046 int err; 2074 if (!access_ok(VERIFY_READ, &arg->ca32_export,
2047 2075 sizeof(arg->ca32_export)) ||
2048 err = access_ok(VERIFY_READ, &arg->ca32_export, sizeof(arg->ca32_export)); 2076 get_user(karg->ca_version, &arg->ca32_version) ||
2049 err |= get_user(karg->ca_version, &arg->ca32_version); 2077 __copy_from_user(&karg->ca_export.ex_client[0],
2050 err |= __copy_from_user(&karg->ca_export.ex_client[0], 2078 &arg->ca32_export.ex32_client[0],
2051 &arg->ca32_export.ex32_client[0], 2079 NFSCLNT_IDMAX) ||
2052 NFSCLNT_IDMAX); 2080 __copy_from_user(&karg->ca_export.ex_path[0],
2053 err |= __copy_from_user(&karg->ca_export.ex_path[0], 2081 &arg->ca32_export.ex32_path[0],
2054 &arg->ca32_export.ex32_path[0], 2082 NFS_MAXPATHLEN) ||
2055 NFS_MAXPATHLEN); 2083 __get_user(karg->ca_export.ex_dev,
2056 err |= __get_user(karg->ca_export.ex_dev, 2084 &arg->ca32_export.ex32_dev) ||
2057 &arg->ca32_export.ex32_dev); 2085 __get_user(karg->ca_export.ex_ino,
2058 err |= __get_user(karg->ca_export.ex_ino, 2086 &arg->ca32_export.ex32_ino) ||
2059 &arg->ca32_export.ex32_ino); 2087 __get_user(karg->ca_export.ex_flags,
2060 err |= __get_user(karg->ca_export.ex_flags, 2088 &arg->ca32_export.ex32_flags) ||
2061 &arg->ca32_export.ex32_flags); 2089 __get_user(karg->ca_export.ex_anon_uid,
2062 err |= __get_user(karg->ca_export.ex_anon_uid, 2090 &arg->ca32_export.ex32_anon_uid) ||
2063 &arg->ca32_export.ex32_anon_uid); 2091 __get_user(karg->ca_export.ex_anon_gid,
2064 err |= __get_user(karg->ca_export.ex_anon_gid, 2092 &arg->ca32_export.ex32_anon_gid))
2065 &arg->ca32_export.ex32_anon_gid); 2093 return -EFAULT;
2066 SET_UID(karg->ca_export.ex_anon_uid, karg->ca_export.ex_anon_uid); 2094 SET_UID(karg->ca_export.ex_anon_uid, karg->ca_export.ex_anon_uid);
2067 SET_GID(karg->ca_export.ex_anon_gid, karg->ca_export.ex_anon_gid); 2095 SET_GID(karg->ca_export.ex_anon_gid, karg->ca_export.ex_anon_gid);
2068 2096
2069 return (err) ? -EFAULT : 0; 2097 return 0;
2070} 2098}
2071 2099
2072static int compat_nfs_getfd_trans(struct nfsctl_arg *karg, struct compat_nfsctl_arg __user *arg) 2100static int compat_nfs_getfd_trans(struct nfsctl_arg *karg,
2101 struct compat_nfsctl_arg __user *arg)
2073{ 2102{
2074 int err; 2103 if (!access_ok(VERIFY_READ, &arg->ca32_getfd,
2075 2104 sizeof(arg->ca32_getfd)) ||
2076 err = access_ok(VERIFY_READ, &arg->ca32_getfd, sizeof(arg->ca32_getfd)); 2105 get_user(karg->ca_version, &arg->ca32_version) ||
2077 err |= get_user(karg->ca_version, &arg->ca32_version); 2106 __copy_from_user(&karg->ca_getfd.gd_addr,
2078 err |= __copy_from_user(&karg->ca_getfd.gd_addr, 2107 &arg->ca32_getfd.gd32_addr,
2079 &arg->ca32_getfd.gd32_addr, 2108 (sizeof(struct sockaddr))) ||
2080 (sizeof(struct sockaddr))); 2109 __copy_from_user(&karg->ca_getfd.gd_path,
2081 err |= __copy_from_user(&karg->ca_getfd.gd_path, 2110 &arg->ca32_getfd.gd32_path,
2082 &arg->ca32_getfd.gd32_path, 2111 (NFS_MAXPATHLEN+1)) ||
2083 (NFS_MAXPATHLEN+1)); 2112 __get_user(karg->ca_getfd.gd_version,
2084 err |= __get_user(karg->ca_getfd.gd_version, 2113 &arg->ca32_getfd.gd32_version))
2085 &arg->ca32_getfd.gd32_version); 2114 return -EFAULT;
2086 2115
2087 return (err) ? -EFAULT : 0; 2116 return 0;
2088} 2117}
2089 2118
2090static int compat_nfs_getfs_trans(struct nfsctl_arg *karg, struct compat_nfsctl_arg __user *arg) 2119static int compat_nfs_getfs_trans(struct nfsctl_arg *karg,
2120 struct compat_nfsctl_arg __user *arg)
2091{ 2121{
2092 int err; 2122 if (!access_ok(VERIFY_READ,&arg->ca32_getfs,sizeof(arg->ca32_getfs)) ||
2093 2123 get_user(karg->ca_version, &arg->ca32_version) ||
2094 err = access_ok(VERIFY_READ, &arg->ca32_getfs, sizeof(arg->ca32_getfs)); 2124 __copy_from_user(&karg->ca_getfs.gd_addr,
2095 err |= get_user(karg->ca_version, &arg->ca32_version); 2125 &arg->ca32_getfs.gd32_addr,
2096 err |= __copy_from_user(&karg->ca_getfs.gd_addr, 2126 (sizeof(struct sockaddr))) ||
2097 &arg->ca32_getfs.gd32_addr, 2127 __copy_from_user(&karg->ca_getfs.gd_path,
2098 (sizeof(struct sockaddr))); 2128 &arg->ca32_getfs.gd32_path,
2099 err |= __copy_from_user(&karg->ca_getfs.gd_path, 2129 (NFS_MAXPATHLEN+1)) ||
2100 &arg->ca32_getfs.gd32_path, 2130 __get_user(karg->ca_getfs.gd_maxlen,
2101 (NFS_MAXPATHLEN+1)); 2131 &arg->ca32_getfs.gd32_maxlen))
2102 err |= __get_user(karg->ca_getfs.gd_maxlen, 2132 return -EFAULT;
2103 &arg->ca32_getfs.gd32_maxlen);
2104 2133
2105 return (err) ? -EFAULT : 0; 2134 return 0;
2106} 2135}
2107 2136
2108/* This really doesn't need translations, we are only passing 2137/* This really doesn't need translations, we are only passing
2109 * back a union which contains opaque nfs file handle data. 2138 * back a union which contains opaque nfs file handle data.
2110 */ 2139 */
2111static int compat_nfs_getfh_res_trans(union nfsctl_res *kres, union compat_nfsctl_res __user *res) 2140static int compat_nfs_getfh_res_trans(union nfsctl_res *kres,
2141 union compat_nfsctl_res __user *res)
2112{ 2142{
2113 int err; 2143 int err;
2114 2144
@@ -2117,8 +2147,9 @@ static int compat_nfs_getfh_res_trans(union nfsctl_res *kres, union compat_nfsct
2117 return (err) ? -EFAULT : 0; 2147 return (err) ? -EFAULT : 0;
2118} 2148}
2119 2149
2120asmlinkage long compat_sys_nfsservctl(int cmd, struct compat_nfsctl_arg __user *arg, 2150asmlinkage long compat_sys_nfsservctl(int cmd,
2121 union compat_nfsctl_res __user *res) 2151 struct compat_nfsctl_arg __user *arg,
2152 union compat_nfsctl_res __user *res)
2122{ 2153{
2123 struct nfsctl_arg *karg; 2154 struct nfsctl_arg *karg;
2124 union nfsctl_res *kres; 2155 union nfsctl_res *kres;
diff --git a/fs/configfs/dir.c b/fs/configfs/dir.c
index 5638c8f9362f..5f952187fc53 100644
--- a/fs/configfs/dir.c
+++ b/fs/configfs/dir.c
@@ -505,13 +505,15 @@ static int populate_groups(struct config_group *group)
505 int i; 505 int i;
506 506
507 if (group->default_groups) { 507 if (group->default_groups) {
508 /* FYI, we're faking mkdir here 508 /*
509 * FYI, we're faking mkdir here
509 * I'm not sure we need this semaphore, as we're called 510 * I'm not sure we need this semaphore, as we're called
510 * from our parent's mkdir. That holds our parent's 511 * from our parent's mkdir. That holds our parent's
511 * i_mutex, so afaik lookup cannot continue through our 512 * i_mutex, so afaik lookup cannot continue through our
512 * parent to find us, let alone mess with our tree. 513 * parent to find us, let alone mess with our tree.
513 * That said, taking our i_mutex is closer to mkdir 514 * That said, taking our i_mutex is closer to mkdir
514 * emulation, and shouldn't hurt. */ 515 * emulation, and shouldn't hurt.
516 */
515 mutex_lock(&dentry->d_inode->i_mutex); 517 mutex_lock(&dentry->d_inode->i_mutex);
516 518
517 for (i = 0; group->default_groups[i]; i++) { 519 for (i = 0; group->default_groups[i]; i++) {
@@ -546,20 +548,34 @@ static void unlink_obj(struct config_item *item)
546 548
547 item->ci_group = NULL; 549 item->ci_group = NULL;
548 item->ci_parent = NULL; 550 item->ci_parent = NULL;
551
552 /* Drop the reference for ci_entry */
549 config_item_put(item); 553 config_item_put(item);
550 554
555 /* Drop the reference for ci_parent */
551 config_group_put(group); 556 config_group_put(group);
552 } 557 }
553} 558}
554 559
555static void link_obj(struct config_item *parent_item, struct config_item *item) 560static void link_obj(struct config_item *parent_item, struct config_item *item)
556{ 561{
557 /* Parent seems redundant with group, but it makes certain 562 /*
558 * traversals much nicer. */ 563 * Parent seems redundant with group, but it makes certain
564 * traversals much nicer.
565 */
559 item->ci_parent = parent_item; 566 item->ci_parent = parent_item;
567
568 /*
569 * We hold a reference on the parent for the child's ci_parent
570 * link.
571 */
560 item->ci_group = config_group_get(to_config_group(parent_item)); 572 item->ci_group = config_group_get(to_config_group(parent_item));
561 list_add_tail(&item->ci_entry, &item->ci_group->cg_children); 573 list_add_tail(&item->ci_entry, &item->ci_group->cg_children);
562 574
575 /*
576 * We hold a reference on the child for ci_entry on the parent's
577 * cg_children
578 */
563 config_item_get(item); 579 config_item_get(item);
564} 580}
565 581
@@ -684,6 +700,10 @@ static void client_drop_item(struct config_item *parent_item,
684 type = parent_item->ci_type; 700 type = parent_item->ci_type;
685 BUG_ON(!type); 701 BUG_ON(!type);
686 702
703 /*
704 * If ->drop_item() exists, it is responsible for the
705 * config_item_put().
706 */
687 if (type->ct_group_ops && type->ct_group_ops->drop_item) 707 if (type->ct_group_ops && type->ct_group_ops->drop_item)
688 type->ct_group_ops->drop_item(to_config_group(parent_item), 708 type->ct_group_ops->drop_item(to_config_group(parent_item),
689 item); 709 item);
@@ -694,23 +714,28 @@ static void client_drop_item(struct config_item *parent_item,
694 714
695static int configfs_mkdir(struct inode *dir, struct dentry *dentry, int mode) 715static int configfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
696{ 716{
697 int ret; 717 int ret, module_got = 0;
698 struct config_group *group; 718 struct config_group *group;
699 struct config_item *item; 719 struct config_item *item;
700 struct config_item *parent_item; 720 struct config_item *parent_item;
701 struct configfs_subsystem *subsys; 721 struct configfs_subsystem *subsys;
702 struct configfs_dirent *sd; 722 struct configfs_dirent *sd;
703 struct config_item_type *type; 723 struct config_item_type *type;
704 struct module *owner; 724 struct module *owner = NULL;
705 char *name; 725 char *name;
706 726
707 if (dentry->d_parent == configfs_sb->s_root) 727 if (dentry->d_parent == configfs_sb->s_root) {
708 return -EPERM; 728 ret = -EPERM;
729 goto out;
730 }
709 731
710 sd = dentry->d_parent->d_fsdata; 732 sd = dentry->d_parent->d_fsdata;
711 if (!(sd->s_type & CONFIGFS_USET_DIR)) 733 if (!(sd->s_type & CONFIGFS_USET_DIR)) {
712 return -EPERM; 734 ret = -EPERM;
735 goto out;
736 }
713 737
738 /* Get a working ref for the duration of this function */
714 parent_item = configfs_get_config_item(dentry->d_parent); 739 parent_item = configfs_get_config_item(dentry->d_parent);
715 type = parent_item->ci_type; 740 type = parent_item->ci_type;
716 subsys = to_config_group(parent_item)->cg_subsys; 741 subsys = to_config_group(parent_item)->cg_subsys;
@@ -719,15 +744,16 @@ static int configfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
719 if (!type || !type->ct_group_ops || 744 if (!type || !type->ct_group_ops ||
720 (!type->ct_group_ops->make_group && 745 (!type->ct_group_ops->make_group &&
721 !type->ct_group_ops->make_item)) { 746 !type->ct_group_ops->make_item)) {
722 config_item_put(parent_item); 747 ret = -EPERM; /* Lack-of-mkdir returns -EPERM */
723 return -EPERM; /* What lack-of-mkdir returns */ 748 goto out_put;
724 } 749 }
725 750
726 name = kmalloc(dentry->d_name.len + 1, GFP_KERNEL); 751 name = kmalloc(dentry->d_name.len + 1, GFP_KERNEL);
727 if (!name) { 752 if (!name) {
728 config_item_put(parent_item); 753 ret = -ENOMEM;
729 return -ENOMEM; 754 goto out_put;
730 } 755 }
756
731 snprintf(name, dentry->d_name.len + 1, "%s", dentry->d_name.name); 757 snprintf(name, dentry->d_name.len + 1, "%s", dentry->d_name.name);
732 758
733 down(&subsys->su_sem); 759 down(&subsys->su_sem);
@@ -748,40 +774,67 @@ static int configfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
748 774
749 kfree(name); 775 kfree(name);
750 if (!item) { 776 if (!item) {
751 config_item_put(parent_item); 777 /*
752 return -ENOMEM; 778 * If item == NULL, then link_obj() was never called.
779 * There are no extra references to clean up.
780 */
781 ret = -ENOMEM;
782 goto out_put;
753 } 783 }
754 784
755 ret = -EINVAL; 785 /*
786 * link_obj() has been called (via link_group() for groups).
787 * From here on out, errors must clean that up.
788 */
789
756 type = item->ci_type; 790 type = item->ci_type;
757 if (type) { 791 if (!type) {
758 owner = type->ct_owner; 792 ret = -EINVAL;
759 if (try_module_get(owner)) { 793 goto out_unlink;
760 if (group) { 794 }
761 ret = configfs_attach_group(parent_item,
762 item,
763 dentry);
764 } else {
765 ret = configfs_attach_item(parent_item,
766 item,
767 dentry);
768 }
769 795
770 if (ret) { 796 owner = type->ct_owner;
771 down(&subsys->su_sem); 797 if (!try_module_get(owner)) {
772 if (group) 798 ret = -EINVAL;
773 unlink_group(group); 799 goto out_unlink;
774 else 800 }
775 unlink_obj(item);
776 client_drop_item(parent_item, item);
777 up(&subsys->su_sem);
778 801
779 config_item_put(parent_item); 802 /*
780 module_put(owner); 803 * I hate doing it this way, but if there is
781 } 804 * an error, module_put() probably should
782 } 805 * happen after any cleanup.
806 */
807 module_got = 1;
808
809 if (group)
810 ret = configfs_attach_group(parent_item, item, dentry);
811 else
812 ret = configfs_attach_item(parent_item, item, dentry);
813
814out_unlink:
815 if (ret) {
816 /* Tear down everything we built up */
817 down(&subsys->su_sem);
818 if (group)
819 unlink_group(group);
820 else
821 unlink_obj(item);
822 client_drop_item(parent_item, item);
823 up(&subsys->su_sem);
824
825 if (module_got)
826 module_put(owner);
783 } 827 }
784 828
829out_put:
830 /*
831 * link_obj()/link_group() took a reference from child->parent,
832 * so the parent is safely pinned. We can drop our working
833 * reference.
834 */
835 config_item_put(parent_item);
836
837out:
785 return ret; 838 return ret;
786} 839}
787 840
@@ -801,6 +854,7 @@ static int configfs_rmdir(struct inode *dir, struct dentry *dentry)
801 if (sd->s_type & CONFIGFS_USET_DEFAULT) 854 if (sd->s_type & CONFIGFS_USET_DEFAULT)
802 return -EPERM; 855 return -EPERM;
803 856
857 /* Get a working ref until we have the child */
804 parent_item = configfs_get_config_item(dentry->d_parent); 858 parent_item = configfs_get_config_item(dentry->d_parent);
805 subsys = to_config_group(parent_item)->cg_subsys; 859 subsys = to_config_group(parent_item)->cg_subsys;
806 BUG_ON(!subsys); 860 BUG_ON(!subsys);
@@ -817,6 +871,7 @@ static int configfs_rmdir(struct inode *dir, struct dentry *dentry)
817 return ret; 871 return ret;
818 } 872 }
819 873
874 /* Get a working ref for the duration of this function */
820 item = configfs_get_config_item(dentry); 875 item = configfs_get_config_item(dentry);
821 876
822 /* Drop reference from above, item already holds one. */ 877 /* Drop reference from above, item already holds one. */
diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c
index 85d166cdcae4..b55b4ea9a676 100644
--- a/fs/debugfs/inode.c
+++ b/fs/debugfs/inode.c
@@ -67,12 +67,13 @@ static struct inode *debugfs_get_inode(struct super_block *sb, int mode, dev_t d
67static int debugfs_mknod(struct inode *dir, struct dentry *dentry, 67static int debugfs_mknod(struct inode *dir, struct dentry *dentry,
68 int mode, dev_t dev) 68 int mode, dev_t dev)
69{ 69{
70 struct inode *inode = debugfs_get_inode(dir->i_sb, mode, dev); 70 struct inode *inode;
71 int error = -EPERM; 71 int error = -EPERM;
72 72
73 if (dentry->d_inode) 73 if (dentry->d_inode)
74 return -EEXIST; 74 return -EEXIST;
75 75
76 inode = debugfs_get_inode(dir->i_sb, mode, dev);
76 if (inode) { 77 if (inode) {
77 d_instantiate(dentry, inode); 78 d_instantiate(dentry, inode);
78 dget(dentry); 79 dget(dentry);
diff --git a/fs/exec.c b/fs/exec.c
index 3234a0c32d54..3a79d97ac234 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -665,9 +665,7 @@ static int de_thread(struct task_struct *tsk)
665 * and to assume its PID: 665 * and to assume its PID:
666 */ 666 */
667 if (!thread_group_leader(current)) { 667 if (!thread_group_leader(current)) {
668 struct task_struct *parent;
669 struct dentry *proc_dentry1, *proc_dentry2; 668 struct dentry *proc_dentry1, *proc_dentry2;
670 unsigned long ptrace;
671 669
672 /* 670 /*
673 * Wait for the thread group leader to be a zombie. 671 * Wait for the thread group leader to be a zombie.
@@ -704,22 +702,6 @@ static int de_thread(struct task_struct *tsk)
704 * two threads with a switched PID, and release 702 * two threads with a switched PID, and release
705 * the former thread group leader: 703 * the former thread group leader:
706 */ 704 */
707 ptrace = leader->ptrace;
708 parent = leader->parent;
709 if (unlikely(ptrace) && unlikely(parent == current)) {
710 /*
711 * Joker was ptracing his own group leader,
712 * and now he wants to be his own parent!
713 * We can't have that.
714 */
715 ptrace = 0;
716 }
717
718 ptrace_unlink(current);
719 ptrace_unlink(leader);
720 remove_parent(current);
721 remove_parent(leader);
722
723 705
724 /* Become a process group leader with the old leader's pid. 706 /* Become a process group leader with the old leader's pid.
725 * Note: The old leader also uses thispid until release_task 707 * Note: The old leader also uses thispid until release_task
@@ -730,10 +712,8 @@ static int de_thread(struct task_struct *tsk)
730 attach_pid(current, PIDTYPE_PID, current->pid); 712 attach_pid(current, PIDTYPE_PID, current->pid);
731 attach_pid(current, PIDTYPE_PGID, current->signal->pgrp); 713 attach_pid(current, PIDTYPE_PGID, current->signal->pgrp);
732 attach_pid(current, PIDTYPE_SID, current->signal->session); 714 attach_pid(current, PIDTYPE_SID, current->signal->session);
733 list_add_tail(&current->tasks, &init_task.tasks); 715 list_add_tail_rcu(&current->tasks, &init_task.tasks);
734 716
735 current->parent = current->real_parent = leader->real_parent;
736 leader->parent = leader->real_parent = child_reaper;
737 current->group_leader = current; 717 current->group_leader = current;
738 leader->group_leader = current; 718 leader->group_leader = current;
739 719
@@ -742,13 +722,6 @@ static int de_thread(struct task_struct *tsk)
742 detach_pid(leader, PIDTYPE_SID); 722 detach_pid(leader, PIDTYPE_SID);
743 list_del_init(&leader->tasks); 723 list_del_init(&leader->tasks);
744 724
745 add_parent(current);
746 add_parent(leader);
747 if (ptrace) {
748 current->ptrace = ptrace;
749 __ptrace_link(current, parent);
750 }
751
752 current->exit_signal = SIGCHLD; 725 current->exit_signal = SIGCHLD;
753 726
754 BUG_ON(leader->exit_state != EXIT_ZOMBIE); 727 BUG_ON(leader->exit_state != EXIT_ZOMBIE);
diff --git a/fs/exportfs/expfs.c b/fs/exportfs/expfs.c
index b06b54f1bbbb..4c39009350f3 100644
--- a/fs/exportfs/expfs.c
+++ b/fs/exportfs/expfs.c
@@ -102,7 +102,7 @@ find_exported_dentry(struct super_block *sb, void *obj, void *parent,
102 if (acceptable(context, result)) 102 if (acceptable(context, result))
103 return result; 103 return result;
104 if (S_ISDIR(result->d_inode->i_mode)) { 104 if (S_ISDIR(result->d_inode->i_mode)) {
105 /* there is no other dentry, so fail */ 105 err = -EACCES;
106 goto err_result; 106 goto err_result;
107 } 107 }
108 108
diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c
index 48ae0339af17..2edd7eec88fd 100644
--- a/fs/ext3/inode.c
+++ b/fs/ext3/inode.c
@@ -711,7 +711,7 @@ static int ext3_splice_branch(handle_t *handle, struct inode *inode,
711 * direct blocks blocks 711 * direct blocks blocks
712 */ 712 */
713 if (num == 0 && blks > 1) { 713 if (num == 0 && blks > 1) {
714 current_block = le32_to_cpu(where->key + 1); 714 current_block = le32_to_cpu(where->key) + 1;
715 for (i = 1; i < blks; i++) 715 for (i = 1; i < blks; i++)
716 *(where->p + i ) = cpu_to_le32(current_block++); 716 *(where->p + i ) = cpu_to_le32(current_block++);
717 } 717 }
@@ -724,7 +724,7 @@ static int ext3_splice_branch(handle_t *handle, struct inode *inode,
724 if (block_i) { 724 if (block_i) {
725 block_i->last_alloc_logical_block = block + blks - 1; 725 block_i->last_alloc_logical_block = block + blks - 1;
726 block_i->last_alloc_physical_block = 726 block_i->last_alloc_physical_block =
727 le32_to_cpu(where[num].key + blks - 1); 727 le32_to_cpu(where[num].key) + blks - 1;
728 } 728 }
729 729
730 /* We are done with atomic stuff, now do the rest of housekeeping */ 730 /* We are done with atomic stuff, now do the rest of housekeeping */
@@ -814,11 +814,13 @@ int ext3_get_blocks_handle(handle_t *handle, struct inode *inode,
814 814
815 /* Simplest case - block found, no allocation needed */ 815 /* Simplest case - block found, no allocation needed */
816 if (!partial) { 816 if (!partial) {
817 first_block = chain[depth - 1].key; 817 first_block = le32_to_cpu(chain[depth - 1].key);
818 clear_buffer_new(bh_result); 818 clear_buffer_new(bh_result);
819 count++; 819 count++;
820 /*map more blocks*/ 820 /*map more blocks*/
821 while (count < maxblocks && count <= blocks_to_boundary) { 821 while (count < maxblocks && count <= blocks_to_boundary) {
822 unsigned long blk;
823
822 if (!verify_chain(chain, partial)) { 824 if (!verify_chain(chain, partial)) {
823 /* 825 /*
824 * Indirect block might be removed by 826 * Indirect block might be removed by
@@ -831,8 +833,9 @@ int ext3_get_blocks_handle(handle_t *handle, struct inode *inode,
831 count = 0; 833 count = 0;
832 break; 834 break;
833 } 835 }
834 if (le32_to_cpu(*(chain[depth-1].p+count) == 836 blk = le32_to_cpu(*(chain[depth-1].p + count));
835 (first_block + count))) 837
838 if (blk == first_block + count)
836 count++; 839 count++;
837 else 840 else
838 break; 841 break;
diff --git a/fs/ext3/ioctl.c b/fs/ext3/ioctl.c
index aaf1da17b6d4..8c22aa9a7fbb 100644
--- a/fs/ext3/ioctl.c
+++ b/fs/ext3/ioctl.c
@@ -48,6 +48,7 @@ int ext3_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
48 if (!S_ISDIR(inode->i_mode)) 48 if (!S_ISDIR(inode->i_mode))
49 flags &= ~EXT3_DIRSYNC_FL; 49 flags &= ~EXT3_DIRSYNC_FL;
50 50
51 mutex_lock(&inode->i_mutex);
51 oldflags = ei->i_flags; 52 oldflags = ei->i_flags;
52 53
53 /* The JOURNAL_DATA flag is modifiable only by root */ 54 /* The JOURNAL_DATA flag is modifiable only by root */
@@ -60,8 +61,10 @@ int ext3_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
60 * This test looks nicer. Thanks to Pauline Middelink 61 * This test looks nicer. Thanks to Pauline Middelink
61 */ 62 */
62 if ((flags ^ oldflags) & (EXT3_APPEND_FL | EXT3_IMMUTABLE_FL)) { 63 if ((flags ^ oldflags) & (EXT3_APPEND_FL | EXT3_IMMUTABLE_FL)) {
63 if (!capable(CAP_LINUX_IMMUTABLE)) 64 if (!capable(CAP_LINUX_IMMUTABLE)) {
65 mutex_unlock(&inode->i_mutex);
64 return -EPERM; 66 return -EPERM;
67 }
65 } 68 }
66 69
67 /* 70 /*
@@ -69,14 +72,18 @@ int ext3_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
69 * the relevant capability. 72 * the relevant capability.
70 */ 73 */
71 if ((jflag ^ oldflags) & (EXT3_JOURNAL_DATA_FL)) { 74 if ((jflag ^ oldflags) & (EXT3_JOURNAL_DATA_FL)) {
72 if (!capable(CAP_SYS_RESOURCE)) 75 if (!capable(CAP_SYS_RESOURCE)) {
76 mutex_unlock(&inode->i_mutex);
73 return -EPERM; 77 return -EPERM;
78 }
74 } 79 }
75 80
76 81
77 handle = ext3_journal_start(inode, 1); 82 handle = ext3_journal_start(inode, 1);
78 if (IS_ERR(handle)) 83 if (IS_ERR(handle)) {
84 mutex_unlock(&inode->i_mutex);
79 return PTR_ERR(handle); 85 return PTR_ERR(handle);
86 }
80 if (IS_SYNC(inode)) 87 if (IS_SYNC(inode))
81 handle->h_sync = 1; 88 handle->h_sync = 1;
82 err = ext3_reserve_inode_write(handle, inode, &iloc); 89 err = ext3_reserve_inode_write(handle, inode, &iloc);
@@ -93,11 +100,14 @@ int ext3_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
93 err = ext3_mark_iloc_dirty(handle, inode, &iloc); 100 err = ext3_mark_iloc_dirty(handle, inode, &iloc);
94flags_err: 101flags_err:
95 ext3_journal_stop(handle); 102 ext3_journal_stop(handle);
96 if (err) 103 if (err) {
104 mutex_unlock(&inode->i_mutex);
97 return err; 105 return err;
106 }
98 107
99 if ((jflag ^ oldflags) & (EXT3_JOURNAL_DATA_FL)) 108 if ((jflag ^ oldflags) & (EXT3_JOURNAL_DATA_FL))
100 err = ext3_change_inode_journal_flag(inode, jflag); 109 err = ext3_change_inode_journal_flag(inode, jflag);
110 mutex_unlock(&inode->i_mutex);
101 return err; 111 return err;
102 } 112 }
103 case EXT3_IOC_GETVERSION: 113 case EXT3_IOC_GETVERSION:
diff --git a/fs/ext3/resize.c b/fs/ext3/resize.c
index 14f5f6ea3e72..34b39e9a1e5a 100644
--- a/fs/ext3/resize.c
+++ b/fs/ext3/resize.c
@@ -213,7 +213,7 @@ static int setup_new_group_blocks(struct super_block *sb,
213 goto exit_bh; 213 goto exit_bh;
214 } 214 }
215 lock_buffer(bh); 215 lock_buffer(bh);
216 memcpy(gdb->b_data, sbi->s_group_desc[i], bh->b_size); 216 memcpy(gdb->b_data, sbi->s_group_desc[i]->b_data, bh->b_size);
217 set_buffer_uptodate(gdb); 217 set_buffer_uptodate(gdb);
218 unlock_buffer(bh); 218 unlock_buffer(bh);
219 ext3_journal_dirty_metadata(handle, gdb); 219 ext3_journal_dirty_metadata(handle, gdb);
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index 6c740f860665..104a62dadb94 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -92,40 +92,52 @@ struct fuse_req *fuse_get_req(struct fuse_conn *fc)
92{ 92{
93 struct fuse_req *req; 93 struct fuse_req *req;
94 sigset_t oldset; 94 sigset_t oldset;
95 int intr;
95 int err; 96 int err;
96 97
98 atomic_inc(&fc->num_waiting);
97 block_sigs(&oldset); 99 block_sigs(&oldset);
98 err = wait_event_interruptible(fc->blocked_waitq, !fc->blocked); 100 intr = wait_event_interruptible(fc->blocked_waitq, !fc->blocked);
99 restore_sigs(&oldset); 101 restore_sigs(&oldset);
100 if (err) 102 err = -EINTR;
101 return ERR_PTR(-EINTR); 103 if (intr)
104 goto out;
102 105
103 req = fuse_request_alloc(); 106 req = fuse_request_alloc();
107 err = -ENOMEM;
104 if (!req) 108 if (!req)
105 return ERR_PTR(-ENOMEM); 109 goto out;
106 110
107 atomic_inc(&fc->num_waiting);
108 fuse_request_init(req);
109 req->in.h.uid = current->fsuid; 111 req->in.h.uid = current->fsuid;
110 req->in.h.gid = current->fsgid; 112 req->in.h.gid = current->fsgid;
111 req->in.h.pid = current->pid; 113 req->in.h.pid = current->pid;
114 req->waiting = 1;
112 return req; 115 return req;
116
117 out:
118 atomic_dec(&fc->num_waiting);
119 return ERR_PTR(err);
113} 120}
114 121
115void fuse_put_request(struct fuse_conn *fc, struct fuse_req *req) 122void fuse_put_request(struct fuse_conn *fc, struct fuse_req *req)
116{ 123{
117 if (atomic_dec_and_test(&req->count)) { 124 if (atomic_dec_and_test(&req->count)) {
118 atomic_dec(&fc->num_waiting); 125 if (req->waiting)
126 atomic_dec(&fc->num_waiting);
119 fuse_request_free(req); 127 fuse_request_free(req);
120 } 128 }
121} 129}
122 130
131/*
132 * Called with sbput_sem held for read (request_end) or write
133 * (fuse_put_super). By the time fuse_put_super() is finished, all
134 * inodes belonging to background requests must be released, so the
135 * iputs have to be done within the locked region.
136 */
123void fuse_release_background(struct fuse_conn *fc, struct fuse_req *req) 137void fuse_release_background(struct fuse_conn *fc, struct fuse_req *req)
124{ 138{
125 iput(req->inode); 139 iput(req->inode);
126 iput(req->inode2); 140 iput(req->inode2);
127 if (req->file)
128 fput(req->file);
129 spin_lock(&fc->lock); 141 spin_lock(&fc->lock);
130 list_del(&req->bg_entry); 142 list_del(&req->bg_entry);
131 if (fc->num_background == FUSE_MAX_BACKGROUND) { 143 if (fc->num_background == FUSE_MAX_BACKGROUND) {
@@ -170,6 +182,11 @@ static void request_end(struct fuse_conn *fc, struct fuse_req *req)
170 if (fc->mounted) 182 if (fc->mounted)
171 fuse_release_background(fc, req); 183 fuse_release_background(fc, req);
172 up_read(&fc->sbput_sem); 184 up_read(&fc->sbput_sem);
185
186 /* fput must go outside sbput_sem, otherwise it can deadlock */
187 if (req->file)
188 fput(req->file);
189
173 if (end) 190 if (end)
174 end(fc, req); 191 end(fc, req);
175 else 192 else
@@ -277,6 +294,10 @@ static void queue_request(struct fuse_conn *fc, struct fuse_req *req)
277 len_args(req->in.numargs, (struct fuse_arg *) req->in.args); 294 len_args(req->in.numargs, (struct fuse_arg *) req->in.args);
278 list_add_tail(&req->list, &fc->pending); 295 list_add_tail(&req->list, &fc->pending);
279 req->state = FUSE_REQ_PENDING; 296 req->state = FUSE_REQ_PENDING;
297 if (!req->waiting) {
298 req->waiting = 1;
299 atomic_inc(&fc->num_waiting);
300 }
280 wake_up(&fc->waitq); 301 wake_up(&fc->waitq);
281 kill_fasync(&fc->fasync, SIGIO, POLL_IN); 302 kill_fasync(&fc->fasync, SIGIO, POLL_IN);
282} 303}
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index e4f041a11bb5..fc342cf7c2cc 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -1,6 +1,6 @@
1/* 1/*
2 FUSE: Filesystem in Userspace 2 FUSE: Filesystem in Userspace
3 Copyright (C) 2001-2005 Miklos Szeredi <miklos@szeredi.hu> 3 Copyright (C) 2001-2006 Miklos Szeredi <miklos@szeredi.hu>
4 4
5 This program can be distributed under the terms of the GNU GPL. 5 This program can be distributed under the terms of the GNU GPL.
6 See the file COPYING. 6 See the file COPYING.
@@ -565,8 +565,12 @@ static ssize_t fuse_direct_io(struct file *file, const char __user *buf,
565 buf += nres; 565 buf += nres;
566 if (nres != nbytes) 566 if (nres != nbytes)
567 break; 567 break;
568 if (count) 568 if (count) {
569 fuse_reset_request(req); 569 fuse_put_request(fc, req);
570 req = fuse_get_req(fc);
571 if (IS_ERR(req))
572 break;
573 }
570 } 574 }
571 fuse_put_request(fc, req); 575 fuse_put_request(fc, req);
572 if (res > 0) { 576 if (res > 0) {
diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h
index 19c7185a7546..0474202cb5dc 100644
--- a/fs/fuse/fuse_i.h
+++ b/fs/fuse/fuse_i.h
@@ -159,6 +159,9 @@ struct fuse_req {
159 /** Data is being copied to/from the request */ 159 /** Data is being copied to/from the request */
160 unsigned locked:1; 160 unsigned locked:1;
161 161
162 /** Request is counted as "waiting" */
163 unsigned waiting:1;
164
162 /** State of the request */ 165 /** State of the request */
163 enum fuse_req_state state; 166 enum fuse_req_state state;
164 167
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index fd34037b0588..7627022446b2 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -500,11 +500,6 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent)
500 if (file->f_op != &fuse_dev_operations) 500 if (file->f_op != &fuse_dev_operations)
501 return -EINVAL; 501 return -EINVAL;
502 502
503 /* Setting file->private_data can't race with other mount()
504 instances, since BKL is held for ->get_sb() */
505 if (file->private_data)
506 return -EINVAL;
507
508 fc = new_conn(); 503 fc = new_conn();
509 if (!fc) 504 if (!fc)
510 return -ENOMEM; 505 return -ENOMEM;
@@ -540,6 +535,12 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent)
540 if (err) 535 if (err)
541 goto err_free_req; 536 goto err_free_req;
542 537
538 /* Setting file->private_data can't race with other mount()
539 instances, since BKL is held for ->get_sb() */
540 err = -EINVAL;
541 if (file->private_data)
542 goto err_kobject_del;
543
543 sb->s_root = root_dentry; 544 sb->s_root = root_dentry;
544 fc->mounted = 1; 545 fc->mounted = 1;
545 fc->connected = 1; 546 fc->connected = 1;
@@ -556,6 +557,8 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent)
556 557
557 return 0; 558 return 0;
558 559
560 err_kobject_del:
561 kobject_del(&fc->kobj);
559 err_free_req: 562 err_free_req:
560 fuse_request_free(init_req); 563 fuse_request_free(init_req);
561 err_put_root: 564 err_put_root:
diff --git a/fs/inotify.c b/fs/inotify.c
index 1f50302849c5..732ec4bd5774 100644
--- a/fs/inotify.c
+++ b/fs/inotify.c
@@ -848,7 +848,11 @@ static int inotify_release(struct inode *ignored, struct file *file)
848 inode = watch->inode; 848 inode = watch->inode;
849 mutex_lock(&inode->inotify_mutex); 849 mutex_lock(&inode->inotify_mutex);
850 mutex_lock(&dev->mutex); 850 mutex_lock(&dev->mutex);
851 remove_watch_no_event(watch, dev); 851
852 /* make sure we didn't race with another list removal */
853 if (likely(idr_find(&dev->idr, watch->wd)))
854 remove_watch_no_event(watch, dev);
855
852 mutex_unlock(&dev->mutex); 856 mutex_unlock(&dev->mutex);
853 mutex_unlock(&inode->inotify_mutex); 857 mutex_unlock(&inode->inotify_mutex);
854 put_inotify_watch(watch); 858 put_inotify_watch(watch);
@@ -890,8 +894,7 @@ static int inotify_ignore(struct inotify_device *dev, s32 wd)
890 mutex_lock(&dev->mutex); 894 mutex_lock(&dev->mutex);
891 895
892 /* make sure that we did not race */ 896 /* make sure that we did not race */
893 watch = idr_find(&dev->idr, wd); 897 if (likely(idr_find(&dev->idr, wd) == watch))
894 if (likely(watch))
895 remove_watch(watch, dev); 898 remove_watch(watch, dev);
896 899
897 mutex_unlock(&dev->mutex); 900 mutex_unlock(&dev->mutex);
diff --git a/fs/jffs2/nodelist.c b/fs/jffs2/nodelist.c
index d4d0c41490cd..1d46677afd17 100644
--- a/fs/jffs2/nodelist.c
+++ b/fs/jffs2/nodelist.c
@@ -438,7 +438,8 @@ static int check_node_data(struct jffs2_sb_info *c, struct jffs2_tmp_dnode_info
438 if (c->mtd->point) { 438 if (c->mtd->point) {
439 err = c->mtd->point(c->mtd, ofs, len, &retlen, &buffer); 439 err = c->mtd->point(c->mtd, ofs, len, &retlen, &buffer);
440 if (!err && retlen < tn->csize) { 440 if (!err && retlen < tn->csize) {
441 JFFS2_WARNING("MTD point returned len too short: %u instead of %u.\n", retlen, tn->csize); 441 JFFS2_WARNING("MTD point returned len too short: %zu "
442 "instead of %u.\n", retlen, tn->csize);
442 c->mtd->unpoint(c->mtd, buffer, ofs, len); 443 c->mtd->unpoint(c->mtd, buffer, ofs, len);
443 } else if (err) 444 } else if (err)
444 JFFS2_WARNING("MTD point failed: error code %d.\n", err); 445 JFFS2_WARNING("MTD point failed: error code %d.\n", err);
@@ -461,7 +462,8 @@ static int check_node_data(struct jffs2_sb_info *c, struct jffs2_tmp_dnode_info
461 } 462 }
462 463
463 if (retlen != len) { 464 if (retlen != len) {
464 JFFS2_ERROR("short read at %#08x: %d instead of %d.\n", ofs, retlen, len); 465 JFFS2_ERROR("short read at %#08x: %zd instead of %d.\n",
466 ofs, retlen, len);
465 err = -EIO; 467 err = -EIO;
466 goto free_out; 468 goto free_out;
467 } 469 }
diff --git a/fs/jfs/jfs_metapage.c b/fs/jfs/jfs_metapage.c
index f28696f235c4..2b220dd6b4e7 100644
--- a/fs/jfs/jfs_metapage.c
+++ b/fs/jfs/jfs_metapage.c
@@ -542,7 +542,7 @@ add_failed:
542static int metapage_releasepage(struct page *page, gfp_t gfp_mask) 542static int metapage_releasepage(struct page *page, gfp_t gfp_mask)
543{ 543{
544 struct metapage *mp; 544 struct metapage *mp;
545 int busy = 0; 545 int ret = 1;
546 unsigned int offset; 546 unsigned int offset;
547 547
548 for (offset = 0; offset < PAGE_CACHE_SIZE; offset += PSIZE) { 548 for (offset = 0; offset < PAGE_CACHE_SIZE; offset += PSIZE) {
@@ -552,30 +552,20 @@ static int metapage_releasepage(struct page *page, gfp_t gfp_mask)
552 continue; 552 continue;
553 553
554 jfs_info("metapage_releasepage: mp = 0x%p", mp); 554 jfs_info("metapage_releasepage: mp = 0x%p", mp);
555 if (mp->count || mp->nohomeok) { 555 if (mp->count || mp->nohomeok ||
556 test_bit(META_dirty, &mp->flag)) {
556 jfs_info("count = %ld, nohomeok = %d", mp->count, 557 jfs_info("count = %ld, nohomeok = %d", mp->count,
557 mp->nohomeok); 558 mp->nohomeok);
558 busy = 1; 559 ret = 0;
559 continue; 560 continue;
560 } 561 }
561 wait_on_page_writeback(page);
562 //WARN_ON(test_bit(META_dirty, &mp->flag));
563 if (test_bit(META_dirty, &mp->flag)) {
564 dump_mem("dirty mp in metapage_releasepage", mp,
565 sizeof(struct metapage));
566 dump_mem("page", page, sizeof(struct page));
567 dump_stack();
568 }
569 if (mp->lsn) 562 if (mp->lsn)
570 remove_from_logsync(mp); 563 remove_from_logsync(mp);
571 remove_metapage(page, mp); 564 remove_metapage(page, mp);
572 INCREMENT(mpStat.pagefree); 565 INCREMENT(mpStat.pagefree);
573 free_metapage(mp); 566 free_metapage(mp);
574 } 567 }
575 if (busy) 568 return ret;
576 return -1;
577
578 return 0;
579} 569}
580 570
581static void metapage_invalidatepage(struct page *page, unsigned long offset) 571static void metapage_invalidatepage(struct page *page, unsigned long offset)
diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c
index d2b66bad7d50..3ef739120dff 100644
--- a/fs/lockd/svclock.c
+++ b/fs/lockd/svclock.c
@@ -650,7 +650,7 @@ static void nlmsvc_grant_callback(struct rpc_task *task, void *data)
650 svc_wake_up(block->b_daemon); 650 svc_wake_up(block->b_daemon);
651} 651}
652 652
653void nlmsvc_grant_release(void *data) 653static void nlmsvc_grant_release(void *data)
654{ 654{
655 struct nlm_rqst *call = data; 655 struct nlm_rqst *call = data;
656 656
diff --git a/fs/locks.c b/fs/locks.c
index dda83d6cd48b..6f99c0a6f836 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -446,15 +446,14 @@ static struct lock_manager_operations lease_manager_ops = {
446 */ 446 */
447static int lease_init(struct file *filp, int type, struct file_lock *fl) 447static int lease_init(struct file *filp, int type, struct file_lock *fl)
448 { 448 {
449 if (assign_type(fl, type) != 0)
450 return -EINVAL;
451
449 fl->fl_owner = current->files; 452 fl->fl_owner = current->files;
450 fl->fl_pid = current->tgid; 453 fl->fl_pid = current->tgid;
451 454
452 fl->fl_file = filp; 455 fl->fl_file = filp;
453 fl->fl_flags = FL_LEASE; 456 fl->fl_flags = FL_LEASE;
454 if (assign_type(fl, type) != 0) {
455 locks_free_lock(fl);
456 return -EINVAL;
457 }
458 fl->fl_start = 0; 457 fl->fl_start = 0;
459 fl->fl_end = OFFSET_MAX; 458 fl->fl_end = OFFSET_MAX;
460 fl->fl_ops = NULL; 459 fl->fl_ops = NULL;
@@ -466,16 +465,19 @@ static int lease_init(struct file *filp, int type, struct file_lock *fl)
466static int lease_alloc(struct file *filp, int type, struct file_lock **flp) 465static int lease_alloc(struct file *filp, int type, struct file_lock **flp)
467{ 466{
468 struct file_lock *fl = locks_alloc_lock(); 467 struct file_lock *fl = locks_alloc_lock();
469 int error; 468 int error = -ENOMEM;
470 469
471 if (fl == NULL) 470 if (fl == NULL)
472 return -ENOMEM; 471 goto out;
473 472
474 error = lease_init(filp, type, fl); 473 error = lease_init(filp, type, fl);
475 if (error) 474 if (error) {
476 return error; 475 locks_free_lock(fl);
476 fl = NULL;
477 }
478out:
477 *flp = fl; 479 *flp = fl;
478 return 0; 480 return error;
479} 481}
480 482
481/* Check if two locks overlap each other. 483/* Check if two locks overlap each other.
@@ -1372,6 +1374,7 @@ static int __setlease(struct file *filp, long arg, struct file_lock **flp)
1372 goto out; 1374 goto out;
1373 1375
1374 if (my_before != NULL) { 1376 if (my_before != NULL) {
1377 *flp = *my_before;
1375 error = lease->fl_lmops->fl_change(my_before, arg); 1378 error = lease->fl_lmops->fl_change(my_before, arg);
1376 goto out; 1379 goto out;
1377 } 1380 }
@@ -2230,7 +2233,12 @@ void steal_locks(fl_owner_t from)
2230 2233
2231 lock_kernel(); 2234 lock_kernel();
2232 j = 0; 2235 j = 0;
2233 rcu_read_lock(); 2236
2237 /*
2238 * We are not taking a ref to the file structures, so
2239 * we need to acquire ->file_lock.
2240 */
2241 spin_lock(&files->file_lock);
2234 fdt = files_fdtable(files); 2242 fdt = files_fdtable(files);
2235 for (;;) { 2243 for (;;) {
2236 unsigned long set; 2244 unsigned long set;
@@ -2248,7 +2256,7 @@ void steal_locks(fl_owner_t from)
2248 set >>= 1; 2256 set >>= 1;
2249 } 2257 }
2250 } 2258 }
2251 rcu_read_unlock(); 2259 spin_unlock(&files->file_lock);
2252 unlock_kernel(); 2260 unlock_kernel();
2253} 2261}
2254EXPORT_SYMBOL(steal_locks); 2262EXPORT_SYMBOL(steal_locks);
diff --git a/fs/namei.c b/fs/namei.c
index 96723ae83c89..d6e2ee251736 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1080,8 +1080,8 @@ static int fastcall do_path_lookup(int dfd, const char *name,
1080 nd->flags = flags; 1080 nd->flags = flags;
1081 nd->depth = 0; 1081 nd->depth = 0;
1082 1082
1083 read_lock(&current->fs->lock);
1084 if (*name=='/') { 1083 if (*name=='/') {
1084 read_lock(&current->fs->lock);
1085 if (current->fs->altroot && !(nd->flags & LOOKUP_NOALT)) { 1085 if (current->fs->altroot && !(nd->flags & LOOKUP_NOALT)) {
1086 nd->mnt = mntget(current->fs->altrootmnt); 1086 nd->mnt = mntget(current->fs->altrootmnt);
1087 nd->dentry = dget(current->fs->altroot); 1087 nd->dentry = dget(current->fs->altroot);
@@ -1092,33 +1092,35 @@ static int fastcall do_path_lookup(int dfd, const char *name,
1092 } 1092 }
1093 nd->mnt = mntget(current->fs->rootmnt); 1093 nd->mnt = mntget(current->fs->rootmnt);
1094 nd->dentry = dget(current->fs->root); 1094 nd->dentry = dget(current->fs->root);
1095 read_unlock(&current->fs->lock);
1095 } else if (dfd == AT_FDCWD) { 1096 } else if (dfd == AT_FDCWD) {
1097 read_lock(&current->fs->lock);
1096 nd->mnt = mntget(current->fs->pwdmnt); 1098 nd->mnt = mntget(current->fs->pwdmnt);
1097 nd->dentry = dget(current->fs->pwd); 1099 nd->dentry = dget(current->fs->pwd);
1100 read_unlock(&current->fs->lock);
1098 } else { 1101 } else {
1099 struct dentry *dentry; 1102 struct dentry *dentry;
1100 1103
1101 file = fget_light(dfd, &fput_needed); 1104 file = fget_light(dfd, &fput_needed);
1102 retval = -EBADF; 1105 retval = -EBADF;
1103 if (!file) 1106 if (!file)
1104 goto unlock_fail; 1107 goto out_fail;
1105 1108
1106 dentry = file->f_dentry; 1109 dentry = file->f_dentry;
1107 1110
1108 retval = -ENOTDIR; 1111 retval = -ENOTDIR;
1109 if (!S_ISDIR(dentry->d_inode->i_mode)) 1112 if (!S_ISDIR(dentry->d_inode->i_mode))
1110 goto fput_unlock_fail; 1113 goto fput_fail;
1111 1114
1112 retval = file_permission(file, MAY_EXEC); 1115 retval = file_permission(file, MAY_EXEC);
1113 if (retval) 1116 if (retval)
1114 goto fput_unlock_fail; 1117 goto fput_fail;
1115 1118
1116 nd->mnt = mntget(file->f_vfsmnt); 1119 nd->mnt = mntget(file->f_vfsmnt);
1117 nd->dentry = dget(dentry); 1120 nd->dentry = dget(dentry);
1118 1121
1119 fput_light(file, fput_needed); 1122 fput_light(file, fput_needed);
1120 } 1123 }
1121 read_unlock(&current->fs->lock);
1122 current->total_link_count = 0; 1124 current->total_link_count = 0;
1123 retval = link_path_walk(name, nd); 1125 retval = link_path_walk(name, nd);
1124out: 1126out:
@@ -1127,13 +1129,12 @@ out:
1127 nd->dentry->d_inode)) 1129 nd->dentry->d_inode))
1128 audit_inode(name, nd->dentry->d_inode, flags); 1130 audit_inode(name, nd->dentry->d_inode, flags);
1129 } 1131 }
1132out_fail:
1130 return retval; 1133 return retval;
1131 1134
1132fput_unlock_fail: 1135fput_fail:
1133 fput_light(file, fput_needed); 1136 fput_light(file, fput_needed);
1134unlock_fail: 1137 goto out_fail;
1135 read_unlock(&current->fs->lock);
1136 return retval;
1137} 1138}
1138 1139
1139int fastcall path_lookup(const char *name, unsigned int flags, 1140int fastcall path_lookup(const char *name, unsigned int flags,
diff --git a/fs/namespace.c b/fs/namespace.c
index 2c5f1f80bdc2..bf478addb852 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -899,13 +899,11 @@ static int do_change_type(struct nameidata *nd, int flag)
899/* 899/*
900 * do loopback mount. 900 * do loopback mount.
901 */ 901 */
902static int do_loopback(struct nameidata *nd, char *old_name, unsigned long flags, int mnt_flags) 902static int do_loopback(struct nameidata *nd, char *old_name, int recurse)
903{ 903{
904 struct nameidata old_nd; 904 struct nameidata old_nd;
905 struct vfsmount *mnt = NULL; 905 struct vfsmount *mnt = NULL;
906 int recurse = flags & MS_REC;
907 int err = mount_is_safe(nd); 906 int err = mount_is_safe(nd);
908
909 if (err) 907 if (err)
910 return err; 908 return err;
911 if (!old_name || !*old_name) 909 if (!old_name || !*old_name)
@@ -939,7 +937,6 @@ static int do_loopback(struct nameidata *nd, char *old_name, unsigned long flags
939 spin_unlock(&vfsmount_lock); 937 spin_unlock(&vfsmount_lock);
940 release_mounts(&umount_list); 938 release_mounts(&umount_list);
941 } 939 }
942 mnt->mnt_flags = mnt_flags;
943 940
944out: 941out:
945 up_write(&namespace_sem); 942 up_write(&namespace_sem);
@@ -1353,7 +1350,7 @@ long do_mount(char *dev_name, char *dir_name, char *type_page,
1353 retval = do_remount(&nd, flags & ~MS_REMOUNT, mnt_flags, 1350 retval = do_remount(&nd, flags & ~MS_REMOUNT, mnt_flags,
1354 data_page); 1351 data_page);
1355 else if (flags & MS_BIND) 1352 else if (flags & MS_BIND)
1356 retval = do_loopback(&nd, dev_name, flags, mnt_flags); 1353 retval = do_loopback(&nd, dev_name, flags & MS_REC);
1357 else if (flags & (MS_SHARED | MS_PRIVATE | MS_SLAVE | MS_UNBINDABLE)) 1354 else if (flags & (MS_SHARED | MS_PRIVATE | MS_SLAVE | MS_UNBINDABLE))
1358 retval = do_change_type(&nd, flags); 1355 retval = do_change_type(&nd, flags);
1359 else if (flags & MS_MOVE) 1356 else if (flags & MS_MOVE)
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index a23f34894167..cae74dd4c7f5 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -128,15 +128,14 @@ struct inode_operations nfs4_dir_inode_operations = {
128static int 128static int
129nfs_opendir(struct inode *inode, struct file *filp) 129nfs_opendir(struct inode *inode, struct file *filp)
130{ 130{
131 int res = 0; 131 int res;
132 132
133 dfprintk(VFS, "NFS: opendir(%s/%ld)\n", 133 dfprintk(VFS, "NFS: opendir(%s/%ld)\n",
134 inode->i_sb->s_id, inode->i_ino); 134 inode->i_sb->s_id, inode->i_ino);
135 135
136 lock_kernel(); 136 lock_kernel();
137 /* Call generic open code in order to cache credentials */ 137 /* Call generic open code in order to cache credentials */
138 if (!res) 138 res = nfs_open(inode, filp);
139 res = nfs_open(inode, filp);
140 unlock_kernel(); 139 unlock_kernel();
141 return res; 140 return res;
142} 141}
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
index 0f583cb16ddb..3c72b0c07283 100644
--- a/fs/nfs/direct.c
+++ b/fs/nfs/direct.c
@@ -112,10 +112,9 @@ static void nfs_direct_write_complete(struct nfs_direct_req *dreq, struct inode
112 */ 112 */
113ssize_t nfs_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov, loff_t pos, unsigned long nr_segs) 113ssize_t nfs_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov, loff_t pos, unsigned long nr_segs)
114{ 114{
115 struct dentry *dentry = iocb->ki_filp->f_dentry;
116
117 dprintk("NFS: nfs_direct_IO (%s) off/no(%Ld/%lu) EINVAL\n", 115 dprintk("NFS: nfs_direct_IO (%s) off/no(%Ld/%lu) EINVAL\n",
118 dentry->d_name.name, (long long) pos, nr_segs); 116 iocb->ki_filp->f_dentry->d_name.name,
117 (long long) pos, nr_segs);
119 118
120 return -EINVAL; 119 return -EINVAL;
121} 120}
@@ -468,7 +467,6 @@ static const struct rpc_call_ops nfs_commit_direct_ops = {
468static void nfs_direct_commit_schedule(struct nfs_direct_req *dreq) 467static void nfs_direct_commit_schedule(struct nfs_direct_req *dreq)
469{ 468{
470 struct nfs_write_data *data = dreq->commit_data; 469 struct nfs_write_data *data = dreq->commit_data;
471 struct rpc_task *task = &data->task;
472 470
473 data->inode = dreq->inode; 471 data->inode = dreq->inode;
474 data->cred = dreq->ctx->cred; 472 data->cred = dreq->ctx->cred;
@@ -489,7 +487,7 @@ static void nfs_direct_commit_schedule(struct nfs_direct_req *dreq)
489 /* Note: task.tk_ops->rpc_release will free dreq->commit_data */ 487 /* Note: task.tk_ops->rpc_release will free dreq->commit_data */
490 dreq->commit_data = NULL; 488 dreq->commit_data = NULL;
491 489
492 dprintk("NFS: %5u initiated commit call\n", task->tk_pid); 490 dprintk("NFS: %5u initiated commit call\n", data->task.tk_pid);
493 491
494 lock_kernel(); 492 lock_kernel();
495 rpc_execute(&data->task); 493 rpc_execute(&data->task);
diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index f1df2c8d9259..fade02c15e6e 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -534,10 +534,9 @@ static int nfs_lock(struct file *filp, int cmd, struct file_lock *fl)
534 */ 534 */
535static int nfs_flock(struct file *filp, int cmd, struct file_lock *fl) 535static int nfs_flock(struct file *filp, int cmd, struct file_lock *fl)
536{ 536{
537 struct inode * inode = filp->f_mapping->host;
538
539 dprintk("NFS: nfs_flock(f=%s/%ld, t=%x, fl=%x)\n", 537 dprintk("NFS: nfs_flock(f=%s/%ld, t=%x, fl=%x)\n",
540 inode->i_sb->s_id, inode->i_ino, 538 filp->f_dentry->d_inode->i_sb->s_id,
539 filp->f_dentry->d_inode->i_ino,
541 fl->fl_type, fl->fl_flags); 540 fl->fl_type, fl->fl_flags);
542 541
543 /* 542 /*
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index 2f7656b911b6..d0b991a92327 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -700,12 +700,9 @@ static int nfs_show_stats(struct seq_file *m, struct vfsmount *mnt)
700 /* 700 /*
701 * Display superblock I/O counters 701 * Display superblock I/O counters
702 */ 702 */
703 for (cpu = 0; cpu < NR_CPUS; cpu++) { 703 for_each_possible_cpu(cpu) {
704 struct nfs_iostats *stats; 704 struct nfs_iostats *stats;
705 705
706 if (!cpu_possible(cpu))
707 continue;
708
709 preempt_disable(); 706 preempt_disable();
710 stats = per_cpu_ptr(nfss->io_stats, cpu); 707 stats = per_cpu_ptr(nfss->io_stats, cpu);
711 708
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 47ece1dd3c67..d86c0db7b1e8 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -1218,7 +1218,7 @@ out:
1218 return status; 1218 return status;
1219} 1219}
1220 1220
1221static void nfs4_intent_set_file(struct nameidata *nd, struct dentry *dentry, struct nfs4_state *state) 1221static int nfs4_intent_set_file(struct nameidata *nd, struct dentry *dentry, struct nfs4_state *state)
1222{ 1222{
1223 struct file *filp; 1223 struct file *filp;
1224 1224
@@ -1227,8 +1227,10 @@ static void nfs4_intent_set_file(struct nameidata *nd, struct dentry *dentry, st
1227 struct nfs_open_context *ctx; 1227 struct nfs_open_context *ctx;
1228 ctx = (struct nfs_open_context *)filp->private_data; 1228 ctx = (struct nfs_open_context *)filp->private_data;
1229 ctx->state = state; 1229 ctx->state = state;
1230 } else 1230 return 0;
1231 nfs4_close_state(state, nd->intent.open.flags); 1231 }
1232 nfs4_close_state(state, nd->intent.open.flags);
1233 return PTR_ERR(filp);
1232} 1234}
1233 1235
1234struct dentry * 1236struct dentry *
@@ -1835,7 +1837,7 @@ nfs4_proc_create(struct inode *dir, struct dentry *dentry, struct iattr *sattr,
1835 nfs_setattr_update_inode(state->inode, sattr); 1837 nfs_setattr_update_inode(state->inode, sattr);
1836 } 1838 }
1837 if (status == 0 && nd != NULL && (nd->flags & LOOKUP_OPEN)) 1839 if (status == 0 && nd != NULL && (nd->flags & LOOKUP_OPEN))
1838 nfs4_intent_set_file(nd, dentry, state); 1840 status = nfs4_intent_set_file(nd, dentry, state);
1839 else 1841 else
1840 nfs4_close_state(state, flags); 1842 nfs4_close_state(state, flags);
1841out: 1843out:
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
index 4e0578121d9a..3eec30000f3f 100644
--- a/fs/nfsd/export.c
+++ b/fs/nfsd/export.c
@@ -1066,9 +1066,11 @@ exp_pseudoroot(struct auth_domain *clp, struct svc_fh *fhp,
1066 rv = nfserr_perm; 1066 rv = nfserr_perm;
1067 else if (IS_ERR(exp)) 1067 else if (IS_ERR(exp))
1068 rv = nfserrno(PTR_ERR(exp)); 1068 rv = nfserrno(PTR_ERR(exp));
1069 else 1069 else {
1070 rv = fh_compose(fhp, exp, 1070 rv = fh_compose(fhp, exp,
1071 fsid_key->ek_dentry, NULL); 1071 fsid_key->ek_dentry, NULL);
1072 exp_put(exp);
1073 }
1072 cache_put(&fsid_key->h, &svc_expkey_cache); 1074 cache_put(&fsid_key->h, &svc_expkey_cache);
1073 return rv; 1075 return rv;
1074} 1076}
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index 6aa92d0e6876..1d65f13f458c 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -1922,11 +1922,10 @@ nfsd_set_posix_acl(struct svc_fh *fhp, int type, struct posix_acl *acl)
1922 value = kmalloc(size, GFP_KERNEL); 1922 value = kmalloc(size, GFP_KERNEL);
1923 if (!value) 1923 if (!value)
1924 return -ENOMEM; 1924 return -ENOMEM;
1925 size = posix_acl_to_xattr(acl, value, size); 1925 error = posix_acl_to_xattr(acl, value, size);
1926 if (size < 0) { 1926 if (error < 0)
1927 error = size;
1928 goto getout; 1927 goto getout;
1929 } 1928 size = error;
1930 } else 1929 } else
1931 size = 0; 1930 size = 0;
1932 1931
diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c
index 0d858d0b25be..47152bf9a7f2 100644
--- a/fs/ocfs2/aops.c
+++ b/fs/ocfs2/aops.c
@@ -276,13 +276,29 @@ static int ocfs2_writepage(struct page *page, struct writeback_control *wbc)
276 return ret; 276 return ret;
277} 277}
278 278
279/* This can also be called from ocfs2_write_zero_page() which has done
280 * it's own cluster locking. */
281int ocfs2_prepare_write_nolock(struct inode *inode, struct page *page,
282 unsigned from, unsigned to)
283{
284 int ret;
285
286 down_read(&OCFS2_I(inode)->ip_alloc_sem);
287
288 ret = block_prepare_write(page, from, to, ocfs2_get_block);
289
290 up_read(&OCFS2_I(inode)->ip_alloc_sem);
291
292 return ret;
293}
294
279/* 295/*
280 * ocfs2_prepare_write() can be an outer-most ocfs2 call when it is called 296 * ocfs2_prepare_write() can be an outer-most ocfs2 call when it is called
281 * from loopback. It must be able to perform its own locking around 297 * from loopback. It must be able to perform its own locking around
282 * ocfs2_get_block(). 298 * ocfs2_get_block().
283 */ 299 */
284int ocfs2_prepare_write(struct file *file, struct page *page, 300static int ocfs2_prepare_write(struct file *file, struct page *page,
285 unsigned from, unsigned to) 301 unsigned from, unsigned to)
286{ 302{
287 struct inode *inode = page->mapping->host; 303 struct inode *inode = page->mapping->host;
288 int ret; 304 int ret;
@@ -295,11 +311,7 @@ int ocfs2_prepare_write(struct file *file, struct page *page,
295 goto out; 311 goto out;
296 } 312 }
297 313
298 down_read(&OCFS2_I(inode)->ip_alloc_sem); 314 ret = ocfs2_prepare_write_nolock(inode, page, from, to);
299
300 ret = block_prepare_write(page, from, to, ocfs2_get_block);
301
302 up_read(&OCFS2_I(inode)->ip_alloc_sem);
303 315
304 ocfs2_meta_unlock(inode, 0); 316 ocfs2_meta_unlock(inode, 0);
305out: 317out:
@@ -625,11 +637,31 @@ static ssize_t ocfs2_direct_IO(int rw,
625 int ret; 637 int ret;
626 638
627 mlog_entry_void(); 639 mlog_entry_void();
640
641 /*
642 * We get PR data locks even for O_DIRECT. This allows
643 * concurrent O_DIRECT I/O but doesn't let O_DIRECT with
644 * extending and buffered zeroing writes race. If they did
645 * race then the buffered zeroing could be written back after
646 * the O_DIRECT I/O. It's one thing to tell people not to mix
647 * buffered and O_DIRECT writes, but expecting them to
648 * understand that file extension is also an implicit buffered
649 * write is too much. By getting the PR we force writeback of
650 * the buffered zeroing before proceeding.
651 */
652 ret = ocfs2_data_lock(inode, 0);
653 if (ret < 0) {
654 mlog_errno(ret);
655 goto out;
656 }
657 ocfs2_data_unlock(inode, 0);
658
628 ret = blockdev_direct_IO_no_locking(rw, iocb, inode, 659 ret = blockdev_direct_IO_no_locking(rw, iocb, inode,
629 inode->i_sb->s_bdev, iov, offset, 660 inode->i_sb->s_bdev, iov, offset,
630 nr_segs, 661 nr_segs,
631 ocfs2_direct_IO_get_blocks, 662 ocfs2_direct_IO_get_blocks,
632 ocfs2_dio_end_io); 663 ocfs2_dio_end_io);
664out:
633 mlog_exit(ret); 665 mlog_exit(ret);
634 return ret; 666 return ret;
635} 667}
diff --git a/fs/ocfs2/aops.h b/fs/ocfs2/aops.h
index d40456d509a0..e88c3f0b8fa9 100644
--- a/fs/ocfs2/aops.h
+++ b/fs/ocfs2/aops.h
@@ -22,8 +22,8 @@
22#ifndef OCFS2_AOPS_H 22#ifndef OCFS2_AOPS_H
23#define OCFS2_AOPS_H 23#define OCFS2_AOPS_H
24 24
25int ocfs2_prepare_write(struct file *file, struct page *page, 25int ocfs2_prepare_write_nolock(struct inode *inode, struct page *page,
26 unsigned from, unsigned to); 26 unsigned from, unsigned to);
27 27
28struct ocfs2_journal_handle *ocfs2_start_walk_page_trans(struct inode *inode, 28struct ocfs2_journal_handle *ocfs2_start_walk_page_trans(struct inode *inode,
29 struct page *page, 29 struct page *page,
diff --git a/fs/ocfs2/extent_map.c b/fs/ocfs2/extent_map.c
index 4601fc256f11..1a5c69071df6 100644
--- a/fs/ocfs2/extent_map.c
+++ b/fs/ocfs2/extent_map.c
@@ -569,7 +569,7 @@ static int ocfs2_extent_map_insert(struct inode *inode,
569 569
570 ret = -ENOMEM; 570 ret = -ENOMEM;
571 ctxt.new_ent = kmem_cache_alloc(ocfs2_em_ent_cachep, 571 ctxt.new_ent = kmem_cache_alloc(ocfs2_em_ent_cachep,
572 GFP_KERNEL); 572 GFP_NOFS);
573 if (!ctxt.new_ent) { 573 if (!ctxt.new_ent) {
574 mlog_errno(ret); 574 mlog_errno(ret);
575 return ret; 575 return ret;
@@ -583,14 +583,14 @@ static int ocfs2_extent_map_insert(struct inode *inode,
583 if (ctxt.need_left && !ctxt.left_ent) { 583 if (ctxt.need_left && !ctxt.left_ent) {
584 ctxt.left_ent = 584 ctxt.left_ent =
585 kmem_cache_alloc(ocfs2_em_ent_cachep, 585 kmem_cache_alloc(ocfs2_em_ent_cachep,
586 GFP_KERNEL); 586 GFP_NOFS);
587 if (!ctxt.left_ent) 587 if (!ctxt.left_ent)
588 break; 588 break;
589 } 589 }
590 if (ctxt.need_right && !ctxt.right_ent) { 590 if (ctxt.need_right && !ctxt.right_ent) {
591 ctxt.right_ent = 591 ctxt.right_ent =
592 kmem_cache_alloc(ocfs2_em_ent_cachep, 592 kmem_cache_alloc(ocfs2_em_ent_cachep,
593 GFP_KERNEL); 593 GFP_NOFS);
594 if (!ctxt.right_ent) 594 if (!ctxt.right_ent)
595 break; 595 break;
596 } 596 }
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index 581eb451a41a..a9559c874530 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -613,7 +613,8 @@ leave:
613 613
614/* Some parts of this taken from generic_cont_expand, which turned out 614/* Some parts of this taken from generic_cont_expand, which turned out
615 * to be too fragile to do exactly what we need without us having to 615 * to be too fragile to do exactly what we need without us having to
616 * worry about recursive locking in ->commit_write(). */ 616 * worry about recursive locking in ->prepare_write() and
617 * ->commit_write(). */
617static int ocfs2_write_zero_page(struct inode *inode, 618static int ocfs2_write_zero_page(struct inode *inode,
618 u64 size) 619 u64 size)
619{ 620{
@@ -641,7 +642,7 @@ static int ocfs2_write_zero_page(struct inode *inode,
641 goto out; 642 goto out;
642 } 643 }
643 644
644 ret = ocfs2_prepare_write(NULL, page, offset, offset); 645 ret = ocfs2_prepare_write_nolock(inode, page, offset, offset);
645 if (ret < 0) { 646 if (ret < 0) {
646 mlog_errno(ret); 647 mlog_errno(ret);
647 goto out_unlock; 648 goto out_unlock;
@@ -695,13 +696,26 @@ out:
695 return ret; 696 return ret;
696} 697}
697 698
699/*
700 * A tail_to_skip value > 0 indicates that we're being called from
701 * ocfs2_file_aio_write(). This has the following implications:
702 *
703 * - we don't want to update i_size
704 * - di_bh will be NULL, which is fine because it's only used in the
705 * case where we want to update i_size.
706 * - ocfs2_zero_extend() will then only be filling the hole created
707 * between i_size and the start of the write.
708 */
698static int ocfs2_extend_file(struct inode *inode, 709static int ocfs2_extend_file(struct inode *inode,
699 struct buffer_head *di_bh, 710 struct buffer_head *di_bh,
700 u64 new_i_size) 711 u64 new_i_size,
712 size_t tail_to_skip)
701{ 713{
702 int ret = 0; 714 int ret = 0;
703 u32 clusters_to_add; 715 u32 clusters_to_add;
704 716
717 BUG_ON(!tail_to_skip && !di_bh);
718
705 /* setattr sometimes calls us like this. */ 719 /* setattr sometimes calls us like this. */
706 if (new_i_size == 0) 720 if (new_i_size == 0)
707 goto out; 721 goto out;
@@ -714,27 +728,44 @@ static int ocfs2_extend_file(struct inode *inode,
714 OCFS2_I(inode)->ip_clusters; 728 OCFS2_I(inode)->ip_clusters;
715 729
716 if (clusters_to_add) { 730 if (clusters_to_add) {
717 ret = ocfs2_extend_allocation(inode, clusters_to_add); 731 /*
732 * protect the pages that ocfs2_zero_extend is going to
733 * be pulling into the page cache.. we do this before the
734 * metadata extend so that we don't get into the situation
735 * where we've extended the metadata but can't get the data
736 * lock to zero.
737 */
738 ret = ocfs2_data_lock(inode, 1);
718 if (ret < 0) { 739 if (ret < 0) {
719 mlog_errno(ret); 740 mlog_errno(ret);
720 goto out; 741 goto out;
721 } 742 }
722 743
723 ret = ocfs2_zero_extend(inode, new_i_size); 744 ret = ocfs2_extend_allocation(inode, clusters_to_add);
724 if (ret < 0) { 745 if (ret < 0) {
725 mlog_errno(ret); 746 mlog_errno(ret);
726 goto out; 747 goto out_unlock;
727 } 748 }
728 }
729 749
730 /* No allocation required, we just use this helper to 750 ret = ocfs2_zero_extend(inode, (u64)new_i_size - tail_to_skip);
731 * do a trivial update of i_size. */ 751 if (ret < 0) {
732 ret = ocfs2_simple_size_update(inode, di_bh, new_i_size); 752 mlog_errno(ret);
733 if (ret < 0) { 753 goto out_unlock;
734 mlog_errno(ret); 754 }
735 goto out; 755 }
756
757 if (!tail_to_skip) {
758 /* We're being called from ocfs2_setattr() which wants
759 * us to update i_size */
760 ret = ocfs2_simple_size_update(inode, di_bh, new_i_size);
761 if (ret < 0)
762 mlog_errno(ret);
736 } 763 }
737 764
765out_unlock:
766 if (clusters_to_add) /* this is the only case in which we lock */
767 ocfs2_data_unlock(inode, 1);
768
738out: 769out:
739 return ret; 770 return ret;
740} 771}
@@ -793,7 +824,7 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr)
793 if (i_size_read(inode) > attr->ia_size) 824 if (i_size_read(inode) > attr->ia_size)
794 status = ocfs2_truncate_file(inode, bh, attr->ia_size); 825 status = ocfs2_truncate_file(inode, bh, attr->ia_size);
795 else 826 else
796 status = ocfs2_extend_file(inode, bh, attr->ia_size); 827 status = ocfs2_extend_file(inode, bh, attr->ia_size, 0);
797 if (status < 0) { 828 if (status < 0) {
798 if (status != -ENOSPC) 829 if (status != -ENOSPC)
799 mlog_errno(status); 830 mlog_errno(status);
@@ -1049,21 +1080,12 @@ static ssize_t ocfs2_file_aio_write(struct kiocb *iocb,
1049 if (!clusters) 1080 if (!clusters)
1050 break; 1081 break;
1051 1082
1052 ret = ocfs2_extend_allocation(inode, clusters); 1083 ret = ocfs2_extend_file(inode, NULL, newsize, count);
1053 if (ret < 0) { 1084 if (ret < 0) {
1054 if (ret != -ENOSPC) 1085 if (ret != -ENOSPC)
1055 mlog_errno(ret); 1086 mlog_errno(ret);
1056 goto out; 1087 goto out;
1057 } 1088 }
1058
1059 /* Fill any holes which would've been created by this
1060 * write. If we're O_APPEND, this will wind up
1061 * (correctly) being a noop. */
1062 ret = ocfs2_zero_extend(inode, (u64) newsize - count);
1063 if (ret < 0) {
1064 mlog_errno(ret);
1065 goto out;
1066 }
1067 break; 1089 break;
1068 } 1090 }
1069 1091
@@ -1146,6 +1168,22 @@ static ssize_t ocfs2_file_aio_read(struct kiocb *iocb,
1146 ocfs2_iocb_set_rw_locked(iocb); 1168 ocfs2_iocb_set_rw_locked(iocb);
1147 } 1169 }
1148 1170
1171 /*
1172 * We're fine letting folks race truncates and extending
1173 * writes with read across the cluster, just like they can
1174 * locally. Hence no rw_lock during read.
1175 *
1176 * Take and drop the meta data lock to update inode fields
1177 * like i_size. This allows the checks down below
1178 * generic_file_aio_read() a chance of actually working.
1179 */
1180 ret = ocfs2_meta_lock(inode, NULL, NULL, 0);
1181 if (ret < 0) {
1182 mlog_errno(ret);
1183 goto bail;
1184 }
1185 ocfs2_meta_unlock(inode, 0);
1186
1149 ret = generic_file_aio_read(iocb, buf, count, iocb->ki_pos); 1187 ret = generic_file_aio_read(iocb, buf, count, iocb->ki_pos);
1150 if (ret == -EINVAL) 1188 if (ret == -EINVAL)
1151 mlog(ML_ERROR, "generic_file_aio_read returned -EINVAL\n"); 1189 mlog(ML_ERROR, "generic_file_aio_read returned -EINVAL\n");
diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c
index 6a610ae53583..eebc3cfa6be8 100644
--- a/fs/ocfs2/journal.c
+++ b/fs/ocfs2/journal.c
@@ -117,7 +117,7 @@ struct ocfs2_journal_handle *ocfs2_alloc_handle(struct ocfs2_super *osb)
117{ 117{
118 struct ocfs2_journal_handle *retval = NULL; 118 struct ocfs2_journal_handle *retval = NULL;
119 119
120 retval = kcalloc(1, sizeof(*retval), GFP_KERNEL); 120 retval = kcalloc(1, sizeof(*retval), GFP_NOFS);
121 if (!retval) { 121 if (!retval) {
122 mlog(ML_ERROR, "Failed to allocate memory for journal " 122 mlog(ML_ERROR, "Failed to allocate memory for journal "
123 "handle!\n"); 123 "handle!\n");
@@ -870,9 +870,11 @@ static int ocfs2_force_read_journal(struct inode *inode)
870 if (p_blocks > CONCURRENT_JOURNAL_FILL) 870 if (p_blocks > CONCURRENT_JOURNAL_FILL)
871 p_blocks = CONCURRENT_JOURNAL_FILL; 871 p_blocks = CONCURRENT_JOURNAL_FILL;
872 872
873 /* We are reading journal data which should not
874 * be put in the uptodate cache */
873 status = ocfs2_read_blocks(OCFS2_SB(inode->i_sb), 875 status = ocfs2_read_blocks(OCFS2_SB(inode->i_sb),
874 p_blkno, p_blocks, bhs, 0, 876 p_blkno, p_blocks, bhs, 0,
875 inode); 877 NULL);
876 if (status < 0) { 878 if (status < 0) {
877 mlog_errno(status); 879 mlog_errno(status);
878 goto bail; 880 goto bail;
@@ -982,7 +984,7 @@ static void ocfs2_queue_recovery_completion(struct ocfs2_journal *journal,
982{ 984{
983 struct ocfs2_la_recovery_item *item; 985 struct ocfs2_la_recovery_item *item;
984 986
985 item = kmalloc(sizeof(struct ocfs2_la_recovery_item), GFP_KERNEL); 987 item = kmalloc(sizeof(struct ocfs2_la_recovery_item), GFP_NOFS);
986 if (!item) { 988 if (!item) {
987 /* Though we wish to avoid it, we are in fact safe in 989 /* Though we wish to avoid it, we are in fact safe in
988 * skipping local alloc cleanup as fsck.ocfs2 is more 990 * skipping local alloc cleanup as fsck.ocfs2 is more
diff --git a/fs/ocfs2/uptodate.c b/fs/ocfs2/uptodate.c
index 04a684dfdd96..b8a00a793326 100644
--- a/fs/ocfs2/uptodate.c
+++ b/fs/ocfs2/uptodate.c
@@ -337,7 +337,7 @@ static void __ocfs2_set_buffer_uptodate(struct ocfs2_inode_info *oi,
337 (unsigned long long)oi->ip_blkno, 337 (unsigned long long)oi->ip_blkno,
338 (unsigned long long)block, expand_tree); 338 (unsigned long long)block, expand_tree);
339 339
340 new = kmem_cache_alloc(ocfs2_uptodate_cachep, GFP_KERNEL); 340 new = kmem_cache_alloc(ocfs2_uptodate_cachep, GFP_NOFS);
341 if (!new) { 341 if (!new) {
342 mlog_errno(-ENOMEM); 342 mlog_errno(-ENOMEM);
343 return; 343 return;
@@ -349,7 +349,7 @@ static void __ocfs2_set_buffer_uptodate(struct ocfs2_inode_info *oi,
349 * has no way of tracking that. */ 349 * has no way of tracking that. */
350 for(i = 0; i < OCFS2_INODE_MAX_CACHE_ARRAY; i++) { 350 for(i = 0; i < OCFS2_INODE_MAX_CACHE_ARRAY; i++) {
351 tree[i] = kmem_cache_alloc(ocfs2_uptodate_cachep, 351 tree[i] = kmem_cache_alloc(ocfs2_uptodate_cachep,
352 GFP_KERNEL); 352 GFP_NOFS);
353 if (!tree[i]) { 353 if (!tree[i]) {
354 mlog_errno(-ENOMEM); 354 mlog_errno(-ENOMEM);
355 goto out_free; 355 goto out_free;
diff --git a/fs/ocfs2/vote.c b/fs/ocfs2/vote.c
index 53049a204197..ee42765a8553 100644
--- a/fs/ocfs2/vote.c
+++ b/fs/ocfs2/vote.c
@@ -586,7 +586,7 @@ static struct ocfs2_net_wait_ctxt *ocfs2_new_net_wait_ctxt(unsigned int response
586{ 586{
587 struct ocfs2_net_wait_ctxt *w; 587 struct ocfs2_net_wait_ctxt *w;
588 588
589 w = kcalloc(1, sizeof(*w), GFP_KERNEL); 589 w = kcalloc(1, sizeof(*w), GFP_NOFS);
590 if (!w) { 590 if (!w) {
591 mlog_errno(-ENOMEM); 591 mlog_errno(-ENOMEM);
592 goto bail; 592 goto bail;
@@ -749,7 +749,7 @@ static struct ocfs2_vote_msg * ocfs2_new_vote_request(struct ocfs2_super *osb,
749 749
750 BUG_ON(!ocfs2_is_valid_vote_request(type)); 750 BUG_ON(!ocfs2_is_valid_vote_request(type));
751 751
752 request = kcalloc(1, sizeof(*request), GFP_KERNEL); 752 request = kcalloc(1, sizeof(*request), GFP_NOFS);
753 if (!request) { 753 if (!request) {
754 mlog_errno(-ENOMEM); 754 mlog_errno(-ENOMEM);
755 } else { 755 } else {
@@ -1129,7 +1129,7 @@ static int ocfs2_handle_vote_message(struct o2net_msg *msg,
1129 struct ocfs2_super *osb = data; 1129 struct ocfs2_super *osb = data;
1130 struct ocfs2_vote_work *work; 1130 struct ocfs2_vote_work *work;
1131 1131
1132 work = kmalloc(sizeof(struct ocfs2_vote_work), GFP_KERNEL); 1132 work = kmalloc(sizeof(struct ocfs2_vote_work), GFP_NOFS);
1133 if (!work) { 1133 if (!work) {
1134 status = -ENOMEM; 1134 status = -ENOMEM;
1135 mlog_errno(status); 1135 mlog_errno(status);
diff --git a/fs/open.c b/fs/open.c
index c32c89d6d8db..317b7c7f38a7 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -331,7 +331,10 @@ out:
331 331
332asmlinkage long sys_ftruncate(unsigned int fd, unsigned long length) 332asmlinkage long sys_ftruncate(unsigned int fd, unsigned long length)
333{ 333{
334 return do_sys_ftruncate(fd, length, 1); 334 long ret = do_sys_ftruncate(fd, length, 1);
335 /* avoid REGPARM breakage on x86: */
336 prevent_tail_call(ret);
337 return ret;
335} 338}
336 339
337/* LFS versions of truncate are only needed on 32 bit machines */ 340/* LFS versions of truncate are only needed on 32 bit machines */
@@ -343,7 +346,10 @@ asmlinkage long sys_truncate64(const char __user * path, loff_t length)
343 346
344asmlinkage long sys_ftruncate64(unsigned int fd, loff_t length) 347asmlinkage long sys_ftruncate64(unsigned int fd, loff_t length)
345{ 348{
346 return do_sys_ftruncate(fd, length, 0); 349 long ret = do_sys_ftruncate(fd, length, 0);
350 /* avoid REGPARM breakage on x86: */
351 prevent_tail_call(ret);
352 return ret;
347} 353}
348#endif 354#endif
349 355
@@ -1093,22 +1099,31 @@ long do_sys_open(int dfd, const char __user *filename, int flags, int mode)
1093 1099
1094asmlinkage long sys_open(const char __user *filename, int flags, int mode) 1100asmlinkage long sys_open(const char __user *filename, int flags, int mode)
1095{ 1101{
1102 long ret;
1103
1096 if (force_o_largefile()) 1104 if (force_o_largefile())
1097 flags |= O_LARGEFILE; 1105 flags |= O_LARGEFILE;
1098 1106
1099 return do_sys_open(AT_FDCWD, filename, flags, mode); 1107 ret = do_sys_open(AT_FDCWD, filename, flags, mode);
1108 /* avoid REGPARM breakage on x86: */
1109 prevent_tail_call(ret);
1110 return ret;
1100} 1111}
1101EXPORT_SYMBOL_GPL(sys_open); 1112EXPORT_SYMBOL_GPL(sys_open);
1102 1113
1103asmlinkage long sys_openat(int dfd, const char __user *filename, int flags, 1114asmlinkage long sys_openat(int dfd, const char __user *filename, int flags,
1104 int mode) 1115 int mode)
1105{ 1116{
1117 long ret;
1118
1106 if (force_o_largefile()) 1119 if (force_o_largefile())
1107 flags |= O_LARGEFILE; 1120 flags |= O_LARGEFILE;
1108 1121
1109 return do_sys_open(dfd, filename, flags, mode); 1122 ret = do_sys_open(dfd, filename, flags, mode);
1123 /* avoid REGPARM breakage on x86: */
1124 prevent_tail_call(ret);
1125 return ret;
1110} 1126}
1111EXPORT_SYMBOL_GPL(sys_openat);
1112 1127
1113#ifndef __alpha__ 1128#ifndef __alpha__
1114 1129
diff --git a/fs/partitions/check.c b/fs/partitions/check.c
index af0cb4b9e784..7ef1f094de91 100644
--- a/fs/partitions/check.c
+++ b/fs/partitions/check.c
@@ -331,7 +331,9 @@ void delete_partition(struct gendisk *disk, int part)
331 devfs_remove("%s/part%d", disk->devfs_name, part); 331 devfs_remove("%s/part%d", disk->devfs_name, part);
332 if (p->holder_dir) 332 if (p->holder_dir)
333 kobject_unregister(p->holder_dir); 333 kobject_unregister(p->holder_dir);
334 kobject_unregister(&p->kobj); 334 kobject_uevent(&p->kobj, KOBJ_REMOVE);
335 kobject_del(&p->kobj);
336 kobject_put(&p->kobj);
335} 337}
336 338
337void add_partition(struct gendisk *disk, int part, sector_t start, sector_t len) 339void add_partition(struct gendisk *disk, int part, sector_t start, sector_t len)
@@ -357,7 +359,10 @@ void add_partition(struct gendisk *disk, int part, sector_t start, sector_t len)
357 snprintf(p->kobj.name,KOBJ_NAME_LEN,"%s%d",disk->kobj.name,part); 359 snprintf(p->kobj.name,KOBJ_NAME_LEN,"%s%d",disk->kobj.name,part);
358 p->kobj.parent = &disk->kobj; 360 p->kobj.parent = &disk->kobj;
359 p->kobj.ktype = &ktype_part; 361 p->kobj.ktype = &ktype_part;
360 kobject_register(&p->kobj); 362 kobject_init(&p->kobj);
363 kobject_add(&p->kobj);
364 if (!disk->part_uevent_suppress)
365 kobject_uevent(&p->kobj, KOBJ_ADD);
361 partition_sysfs_add_subdir(p); 366 partition_sysfs_add_subdir(p);
362 disk->part[part-1] = p; 367 disk->part[part-1] = p;
363} 368}
@@ -367,6 +372,7 @@ static char *make_block_name(struct gendisk *disk)
367 char *name; 372 char *name;
368 static char *block_str = "block:"; 373 static char *block_str = "block:";
369 int size; 374 int size;
375 char *s;
370 376
371 size = strlen(block_str) + strlen(disk->disk_name) + 1; 377 size = strlen(block_str) + strlen(disk->disk_name) + 1;
372 name = kmalloc(size, GFP_KERNEL); 378 name = kmalloc(size, GFP_KERNEL);
@@ -374,6 +380,10 @@ static char *make_block_name(struct gendisk *disk)
374 return NULL; 380 return NULL;
375 strcpy(name, block_str); 381 strcpy(name, block_str);
376 strcat(name, disk->disk_name); 382 strcat(name, disk->disk_name);
383 /* ewww... some of these buggers have / in name... */
384 s = strchr(name, '/');
385 if (s)
386 *s = '!';
377 return name; 387 return name;
378} 388}
379 389
@@ -395,6 +405,8 @@ void register_disk(struct gendisk *disk)
395{ 405{
396 struct block_device *bdev; 406 struct block_device *bdev;
397 char *s; 407 char *s;
408 int i;
409 struct hd_struct *p;
398 int err; 410 int err;
399 411
400 strlcpy(disk->kobj.name,disk->disk_name,KOBJ_NAME_LEN); 412 strlcpy(disk->kobj.name,disk->disk_name,KOBJ_NAME_LEN);
@@ -406,13 +418,12 @@ void register_disk(struct gendisk *disk)
406 return; 418 return;
407 disk_sysfs_symlinks(disk); 419 disk_sysfs_symlinks(disk);
408 disk_sysfs_add_subdirs(disk); 420 disk_sysfs_add_subdirs(disk);
409 kobject_uevent(&disk->kobj, KOBJ_ADD);
410 421
411 /* No minors to use for partitions */ 422 /* No minors to use for partitions */
412 if (disk->minors == 1) { 423 if (disk->minors == 1) {
413 if (disk->devfs_name[0] != '\0') 424 if (disk->devfs_name[0] != '\0')
414 devfs_add_disk(disk); 425 devfs_add_disk(disk);
415 return; 426 goto exit;
416 } 427 }
417 428
418 /* always add handle for the whole disk */ 429 /* always add handle for the whole disk */
@@ -420,16 +431,32 @@ void register_disk(struct gendisk *disk)
420 431
421 /* No such device (e.g., media were just removed) */ 432 /* No such device (e.g., media were just removed) */
422 if (!get_capacity(disk)) 433 if (!get_capacity(disk))
423 return; 434 goto exit;
424 435
425 bdev = bdget_disk(disk, 0); 436 bdev = bdget_disk(disk, 0);
426 if (!bdev) 437 if (!bdev)
427 return; 438 goto exit;
428 439
440 /* scan partition table, but suppress uevents */
429 bdev->bd_invalidated = 1; 441 bdev->bd_invalidated = 1;
430 if (blkdev_get(bdev, FMODE_READ, 0) < 0) 442 disk->part_uevent_suppress = 1;
431 return; 443 err = blkdev_get(bdev, FMODE_READ, 0);
444 disk->part_uevent_suppress = 0;
445 if (err < 0)
446 goto exit;
432 blkdev_put(bdev); 447 blkdev_put(bdev);
448
449exit:
450 /* announce disk after possible partitions are already created */
451 kobject_uevent(&disk->kobj, KOBJ_ADD);
452
453 /* announce possible partitions */
454 for (i = 1; i < disk->minors; i++) {
455 p = disk->part[i-1];
456 if (!p || !p->nr_sects)
457 continue;
458 kobject_uevent(&p->kobj, KOBJ_ADD);
459 }
433} 460}
434 461
435int rescan_partitions(struct gendisk *disk, struct block_device *bdev) 462int rescan_partitions(struct gendisk *disk, struct block_device *bdev)
@@ -506,6 +533,7 @@ void del_gendisk(struct gendisk *disk)
506 533
507 devfs_remove_disk(disk); 534 devfs_remove_disk(disk);
508 535
536 kobject_uevent(&disk->kobj, KOBJ_REMOVE);
509 if (disk->holder_dir) 537 if (disk->holder_dir)
510 kobject_unregister(disk->holder_dir); 538 kobject_unregister(disk->holder_dir);
511 if (disk->slave_dir) 539 if (disk->slave_dir)
@@ -518,7 +546,7 @@ void del_gendisk(struct gendisk *disk)
518 kfree(disk_name); 546 kfree(disk_name);
519 } 547 }
520 put_device(disk->driverfs_dev); 548 put_device(disk->driverfs_dev);
549 disk->driverfs_dev = NULL;
521 } 550 }
522 kobject_uevent(&disk->kobj, KOBJ_REMOVE);
523 kobject_del(&disk->kobj); 551 kobject_del(&disk->kobj);
524} 552}
diff --git a/fs/pipe.c b/fs/pipe.c
index e984beb93a0e..5acd8954aaa0 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -55,7 +55,8 @@ void pipe_wait(struct pipe_inode_info *pipe)
55} 55}
56 56
57static int 57static int
58pipe_iov_copy_from_user(void *to, struct iovec *iov, unsigned long len) 58pipe_iov_copy_from_user(void *to, struct iovec *iov, unsigned long len,
59 int atomic)
59{ 60{
60 unsigned long copy; 61 unsigned long copy;
61 62
@@ -64,8 +65,13 @@ pipe_iov_copy_from_user(void *to, struct iovec *iov, unsigned long len)
64 iov++; 65 iov++;
65 copy = min_t(unsigned long, len, iov->iov_len); 66 copy = min_t(unsigned long, len, iov->iov_len);
66 67
67 if (copy_from_user(to, iov->iov_base, copy)) 68 if (atomic) {
68 return -EFAULT; 69 if (__copy_from_user_inatomic(to, iov->iov_base, copy))
70 return -EFAULT;
71 } else {
72 if (copy_from_user(to, iov->iov_base, copy))
73 return -EFAULT;
74 }
69 to += copy; 75 to += copy;
70 len -= copy; 76 len -= copy;
71 iov->iov_base += copy; 77 iov->iov_base += copy;
@@ -75,7 +81,8 @@ pipe_iov_copy_from_user(void *to, struct iovec *iov, unsigned long len)
75} 81}
76 82
77static int 83static int
78pipe_iov_copy_to_user(struct iovec *iov, const void *from, unsigned long len) 84pipe_iov_copy_to_user(struct iovec *iov, const void *from, unsigned long len,
85 int atomic)
79{ 86{
80 unsigned long copy; 87 unsigned long copy;
81 88
@@ -84,8 +91,13 @@ pipe_iov_copy_to_user(struct iovec *iov, const void *from, unsigned long len)
84 iov++; 91 iov++;
85 copy = min_t(unsigned long, len, iov->iov_len); 92 copy = min_t(unsigned long, len, iov->iov_len);
86 93
87 if (copy_to_user(iov->iov_base, from, copy)) 94 if (atomic) {
88 return -EFAULT; 95 if (__copy_to_user_inatomic(iov->iov_base, from, copy))
96 return -EFAULT;
97 } else {
98 if (copy_to_user(iov->iov_base, from, copy))
99 return -EFAULT;
100 }
89 from += copy; 101 from += copy;
90 len -= copy; 102 len -= copy;
91 iov->iov_base += copy; 103 iov->iov_base += copy;
@@ -94,13 +106,52 @@ pipe_iov_copy_to_user(struct iovec *iov, const void *from, unsigned long len)
94 return 0; 106 return 0;
95} 107}
96 108
109/*
110 * Attempt to pre-fault in the user memory, so we can use atomic copies.
111 * Returns the number of bytes not faulted in.
112 */
113static int iov_fault_in_pages_write(struct iovec *iov, unsigned long len)
114{
115 while (!iov->iov_len)
116 iov++;
117
118 while (len > 0) {
119 unsigned long this_len;
120
121 this_len = min_t(unsigned long, len, iov->iov_len);
122 if (fault_in_pages_writeable(iov->iov_base, this_len))
123 break;
124
125 len -= this_len;
126 iov++;
127 }
128
129 return len;
130}
131
132/*
133 * Pre-fault in the user memory, so we can use atomic copies.
134 */
135static void iov_fault_in_pages_read(struct iovec *iov, unsigned long len)
136{
137 while (!iov->iov_len)
138 iov++;
139
140 while (len > 0) {
141 unsigned long this_len;
142
143 this_len = min_t(unsigned long, len, iov->iov_len);
144 fault_in_pages_readable(iov->iov_base, this_len);
145 len -= this_len;
146 iov++;
147 }
148}
149
97static void anon_pipe_buf_release(struct pipe_inode_info *pipe, 150static void anon_pipe_buf_release(struct pipe_inode_info *pipe,
98 struct pipe_buffer *buf) 151 struct pipe_buffer *buf)
99{ 152{
100 struct page *page = buf->page; 153 struct page *page = buf->page;
101 154
102 buf->flags &= ~PIPE_BUF_FLAG_STOLEN;
103
104 /* 155 /*
105 * If nobody else uses this page, and we don't already have a 156 * If nobody else uses this page, and we don't already have a
106 * temporary page, let's keep track of it as a one-deep 157 * temporary page, let's keep track of it as a one-deep
@@ -112,31 +163,58 @@ static void anon_pipe_buf_release(struct pipe_inode_info *pipe,
112 page_cache_release(page); 163 page_cache_release(page);
113} 164}
114 165
115static void * anon_pipe_buf_map(struct file *file, struct pipe_inode_info *pipe, 166void *generic_pipe_buf_map(struct pipe_inode_info *pipe,
116 struct pipe_buffer *buf) 167 struct pipe_buffer *buf, int atomic)
117{ 168{
169 if (atomic) {
170 buf->flags |= PIPE_BUF_FLAG_ATOMIC;
171 return kmap_atomic(buf->page, KM_USER0);
172 }
173
118 return kmap(buf->page); 174 return kmap(buf->page);
119} 175}
120 176
121static void anon_pipe_buf_unmap(struct pipe_inode_info *pipe, 177void generic_pipe_buf_unmap(struct pipe_inode_info *pipe,
122 struct pipe_buffer *buf) 178 struct pipe_buffer *buf, void *map_data)
179{
180 if (buf->flags & PIPE_BUF_FLAG_ATOMIC) {
181 buf->flags &= ~PIPE_BUF_FLAG_ATOMIC;
182 kunmap_atomic(map_data, KM_USER0);
183 } else
184 kunmap(buf->page);
185}
186
187int generic_pipe_buf_steal(struct pipe_inode_info *pipe,
188 struct pipe_buffer *buf)
189{
190 struct page *page = buf->page;
191
192 if (page_count(page) == 1) {
193 lock_page(page);
194 return 0;
195 }
196
197 return 1;
198}
199
200void generic_pipe_buf_get(struct pipe_inode_info *info, struct pipe_buffer *buf)
123{ 201{
124 kunmap(buf->page); 202 page_cache_get(buf->page);
125} 203}
126 204
127static int anon_pipe_buf_steal(struct pipe_inode_info *pipe, 205int generic_pipe_buf_pin(struct pipe_inode_info *info, struct pipe_buffer *buf)
128 struct pipe_buffer *buf)
129{ 206{
130 buf->flags |= PIPE_BUF_FLAG_STOLEN;
131 return 0; 207 return 0;
132} 208}
133 209
134static struct pipe_buf_operations anon_pipe_buf_ops = { 210static struct pipe_buf_operations anon_pipe_buf_ops = {
135 .can_merge = 1, 211 .can_merge = 1,
136 .map = anon_pipe_buf_map, 212 .map = generic_pipe_buf_map,
137 .unmap = anon_pipe_buf_unmap, 213 .unmap = generic_pipe_buf_unmap,
214 .pin = generic_pipe_buf_pin,
138 .release = anon_pipe_buf_release, 215 .release = anon_pipe_buf_release,
139 .steal = anon_pipe_buf_steal, 216 .steal = generic_pipe_buf_steal,
217 .get = generic_pipe_buf_get,
140}; 218};
141 219
142static ssize_t 220static ssize_t
@@ -167,22 +245,33 @@ pipe_readv(struct file *filp, const struct iovec *_iov,
167 struct pipe_buf_operations *ops = buf->ops; 245 struct pipe_buf_operations *ops = buf->ops;
168 void *addr; 246 void *addr;
169 size_t chars = buf->len; 247 size_t chars = buf->len;
170 int error; 248 int error, atomic;
171 249
172 if (chars > total_len) 250 if (chars > total_len)
173 chars = total_len; 251 chars = total_len;
174 252
175 addr = ops->map(filp, pipe, buf); 253 error = ops->pin(pipe, buf);
176 if (IS_ERR(addr)) { 254 if (error) {
177 if (!ret) 255 if (!ret)
178 ret = PTR_ERR(addr); 256 error = ret;
179 break; 257 break;
180 } 258 }
181 error = pipe_iov_copy_to_user(iov, addr + buf->offset, chars); 259
182 ops->unmap(pipe, buf); 260 atomic = !iov_fault_in_pages_write(iov, chars);
261redo:
262 addr = ops->map(pipe, buf, atomic);
263 error = pipe_iov_copy_to_user(iov, addr + buf->offset, chars, atomic);
264 ops->unmap(pipe, buf, addr);
183 if (unlikely(error)) { 265 if (unlikely(error)) {
266 /*
267 * Just retry with the slow path if we failed.
268 */
269 if (atomic) {
270 atomic = 0;
271 goto redo;
272 }
184 if (!ret) 273 if (!ret)
185 ret = -EFAULT; 274 ret = error;
186 break; 275 break;
187 } 276 }
188 ret += chars; 277 ret += chars;
@@ -286,21 +375,28 @@ pipe_writev(struct file *filp, const struct iovec *_iov,
286 int offset = buf->offset + buf->len; 375 int offset = buf->offset + buf->len;
287 376
288 if (ops->can_merge && offset + chars <= PAGE_SIZE) { 377 if (ops->can_merge && offset + chars <= PAGE_SIZE) {
378 int error, atomic = 1;
289 void *addr; 379 void *addr;
290 int error;
291 380
292 addr = ops->map(filp, pipe, buf); 381 error = ops->pin(pipe, buf);
293 if (IS_ERR(addr)) { 382 if (error)
294 error = PTR_ERR(addr);
295 goto out; 383 goto out;
296 } 384
385 iov_fault_in_pages_read(iov, chars);
386redo1:
387 addr = ops->map(pipe, buf, atomic);
297 error = pipe_iov_copy_from_user(offset + addr, iov, 388 error = pipe_iov_copy_from_user(offset + addr, iov,
298 chars); 389 chars, atomic);
299 ops->unmap(pipe, buf); 390 ops->unmap(pipe, buf, addr);
300 ret = error; 391 ret = error;
301 do_wakeup = 1; 392 do_wakeup = 1;
302 if (error) 393 if (error) {
394 if (atomic) {
395 atomic = 0;
396 goto redo1;
397 }
303 goto out; 398 goto out;
399 }
304 buf->len += chars; 400 buf->len += chars;
305 total_len -= chars; 401 total_len -= chars;
306 ret = chars; 402 ret = chars;
@@ -323,7 +419,8 @@ pipe_writev(struct file *filp, const struct iovec *_iov,
323 int newbuf = (pipe->curbuf + bufs) & (PIPE_BUFFERS-1); 419 int newbuf = (pipe->curbuf + bufs) & (PIPE_BUFFERS-1);
324 struct pipe_buffer *buf = pipe->bufs + newbuf; 420 struct pipe_buffer *buf = pipe->bufs + newbuf;
325 struct page *page = pipe->tmp_page; 421 struct page *page = pipe->tmp_page;
326 int error; 422 char *src;
423 int error, atomic = 1;
327 424
328 if (!page) { 425 if (!page) {
329 page = alloc_page(GFP_HIGHUSER); 426 page = alloc_page(GFP_HIGHUSER);
@@ -343,11 +440,27 @@ pipe_writev(struct file *filp, const struct iovec *_iov,
343 if (chars > total_len) 440 if (chars > total_len)
344 chars = total_len; 441 chars = total_len;
345 442
346 error = pipe_iov_copy_from_user(kmap(page), iov, chars); 443 iov_fault_in_pages_read(iov, chars);
347 kunmap(page); 444redo2:
445 if (atomic)
446 src = kmap_atomic(page, KM_USER0);
447 else
448 src = kmap(page);
449
450 error = pipe_iov_copy_from_user(src, iov, chars,
451 atomic);
452 if (atomic)
453 kunmap_atomic(src, KM_USER0);
454 else
455 kunmap(page);
456
348 if (unlikely(error)) { 457 if (unlikely(error)) {
458 if (atomic) {
459 atomic = 0;
460 goto redo2;
461 }
349 if (!ret) 462 if (!ret)
350 ret = -EFAULT; 463 ret = error;
351 break; 464 break;
352 } 465 }
353 ret += chars; 466 ret += chars;
diff --git a/fs/proc/base.c b/fs/proc/base.c
index a3a3eecef689..6cc77dc3f3ff 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -297,16 +297,20 @@ static int proc_fd_link(struct inode *inode, struct dentry **dentry, struct vfsm
297 297
298 files = get_files_struct(task); 298 files = get_files_struct(task);
299 if (files) { 299 if (files) {
300 rcu_read_lock(); 300 /*
301 * We are not taking a ref to the file structure, so we must
302 * hold ->file_lock.
303 */
304 spin_lock(&files->file_lock);
301 file = fcheck_files(files, fd); 305 file = fcheck_files(files, fd);
302 if (file) { 306 if (file) {
303 *mnt = mntget(file->f_vfsmnt); 307 *mnt = mntget(file->f_vfsmnt);
304 *dentry = dget(file->f_dentry); 308 *dentry = dget(file->f_dentry);
305 rcu_read_unlock(); 309 spin_unlock(&files->file_lock);
306 put_files_struct(files); 310 put_files_struct(files);
307 return 0; 311 return 0;
308 } 312 }
309 rcu_read_unlock(); 313 spin_unlock(&files->file_lock);
310 put_files_struct(files); 314 put_files_struct(files);
311 } 315 }
312 return -ENOENT; 316 return -ENOENT;
@@ -1523,7 +1527,12 @@ static struct dentry *proc_lookupfd(struct inode * dir, struct dentry * dentry,
1523 if (!files) 1527 if (!files)
1524 goto out_unlock; 1528 goto out_unlock;
1525 inode->i_mode = S_IFLNK; 1529 inode->i_mode = S_IFLNK;
1526 rcu_read_lock(); 1530
1531 /*
1532 * We are not taking a ref to the file structure, so we must
1533 * hold ->file_lock.
1534 */
1535 spin_lock(&files->file_lock);
1527 file = fcheck_files(files, fd); 1536 file = fcheck_files(files, fd);
1528 if (!file) 1537 if (!file)
1529 goto out_unlock2; 1538 goto out_unlock2;
@@ -1531,7 +1540,7 @@ static struct dentry *proc_lookupfd(struct inode * dir, struct dentry * dentry,
1531 inode->i_mode |= S_IRUSR | S_IXUSR; 1540 inode->i_mode |= S_IRUSR | S_IXUSR;
1532 if (file->f_mode & 2) 1541 if (file->f_mode & 2)
1533 inode->i_mode |= S_IWUSR | S_IXUSR; 1542 inode->i_mode |= S_IWUSR | S_IXUSR;
1534 rcu_read_unlock(); 1543 spin_unlock(&files->file_lock);
1535 put_files_struct(files); 1544 put_files_struct(files);
1536 inode->i_op = &proc_pid_link_inode_operations; 1545 inode->i_op = &proc_pid_link_inode_operations;
1537 inode->i_size = 64; 1546 inode->i_size = 64;
@@ -1541,7 +1550,7 @@ static struct dentry *proc_lookupfd(struct inode * dir, struct dentry * dentry,
1541 return NULL; 1550 return NULL;
1542 1551
1543out_unlock2: 1552out_unlock2:
1544 rcu_read_unlock(); 1553 spin_unlock(&files->file_lock);
1545 put_files_struct(files); 1554 put_files_struct(files);
1546out_unlock: 1555out_unlock:
1547 iput(inode); 1556 iput(inode);
diff --git a/fs/reiserfs/xattr_acl.c b/fs/reiserfs/xattr_acl.c
index 58c418fbca2c..97ae1b92bc47 100644
--- a/fs/reiserfs/xattr_acl.c
+++ b/fs/reiserfs/xattr_acl.c
@@ -408,8 +408,9 @@ int reiserfs_cache_default_acl(struct inode *inode)
408 acl = reiserfs_get_acl(inode, ACL_TYPE_DEFAULT); 408 acl = reiserfs_get_acl(inode, ACL_TYPE_DEFAULT);
409 reiserfs_read_unlock_xattrs(inode->i_sb); 409 reiserfs_read_unlock_xattrs(inode->i_sb);
410 reiserfs_read_unlock_xattr_i(inode); 410 reiserfs_read_unlock_xattr_i(inode);
411 ret = acl ? 1 : 0; 411 ret = (acl && !IS_ERR(acl));
412 posix_acl_release(acl); 412 if (ret)
413 posix_acl_release(acl);
413 } 414 }
414 415
415 return ret; 416 return ret;
diff --git a/fs/smbfs/dir.c b/fs/smbfs/dir.c
index 34c7a11d91f0..70d9c5a37f5a 100644
--- a/fs/smbfs/dir.c
+++ b/fs/smbfs/dir.c
@@ -434,6 +434,11 @@ smb_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
434 if (dentry->d_name.len > SMB_MAXNAMELEN) 434 if (dentry->d_name.len > SMB_MAXNAMELEN)
435 goto out; 435 goto out;
436 436
437 /* Do not allow lookup of names with backslashes in */
438 error = -EINVAL;
439 if (memchr(dentry->d_name.name, '\\', dentry->d_name.len))
440 goto out;
441
437 lock_kernel(); 442 lock_kernel();
438 error = smb_proc_getattr(dentry, &finfo); 443 error = smb_proc_getattr(dentry, &finfo);
439#ifdef SMBFS_PARANOIA 444#ifdef SMBFS_PARANOIA
diff --git a/fs/smbfs/request.c b/fs/smbfs/request.c
index c71c375863cc..c71dd2760d32 100644
--- a/fs/smbfs/request.c
+++ b/fs/smbfs/request.c
@@ -339,9 +339,11 @@ int smb_add_request(struct smb_request *req)
339 /* 339 /*
340 * On timeout or on interrupt we want to try and remove the 340 * On timeout or on interrupt we want to try and remove the
341 * request from the recvq/xmitq. 341 * request from the recvq/xmitq.
342 * First check if the request is still part of a queue. (May
343 * have been removed by some error condition)
342 */ 344 */
343 smb_lock_server(server); 345 smb_lock_server(server);
344 if (!(req->rq_flags & SMB_REQ_RECEIVED)) { 346 if (!list_empty(&req->rq_queue)) {
345 list_del_init(&req->rq_queue); 347 list_del_init(&req->rq_queue);
346 smb_rput(req); 348 smb_rput(req);
347 } 349 }
diff --git a/fs/splice.c b/fs/splice.c
index e50a460239dd..a285fd746dc0 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -27,15 +27,22 @@
27#include <linux/buffer_head.h> 27#include <linux/buffer_head.h>
28#include <linux/module.h> 28#include <linux/module.h>
29#include <linux/syscalls.h> 29#include <linux/syscalls.h>
30#include <linux/uio.h>
31
32struct partial_page {
33 unsigned int offset;
34 unsigned int len;
35};
30 36
31/* 37/*
32 * Passed to the actors 38 * Passed to splice_to_pipe
33 */ 39 */
34struct splice_desc { 40struct splice_pipe_desc {
35 unsigned int len, total_len; /* current and remaining length */ 41 struct page **pages; /* page map */
42 struct partial_page *partial; /* pages[] may not be contig */
43 int nr_pages; /* number of pages in map */
36 unsigned int flags; /* splice flags */ 44 unsigned int flags; /* splice flags */
37 struct file *file; /* file to read/write */ 45 struct pipe_buf_operations *ops;/* ops associated with output pipe */
38 loff_t pos; /* file position */
39}; 46};
40 47
41/* 48/*
@@ -44,13 +51,14 @@ struct splice_desc {
44 * addition of remove_mapping(). If success is returned, the caller may 51 * addition of remove_mapping(). If success is returned, the caller may
45 * attempt to reuse this page for another destination. 52 * attempt to reuse this page for another destination.
46 */ 53 */
47static int page_cache_pipe_buf_steal(struct pipe_inode_info *info, 54static int page_cache_pipe_buf_steal(struct pipe_inode_info *pipe,
48 struct pipe_buffer *buf) 55 struct pipe_buffer *buf)
49{ 56{
50 struct page *page = buf->page; 57 struct page *page = buf->page;
51 struct address_space *mapping = page_mapping(page); 58 struct address_space *mapping = page_mapping(page);
52 59
53 WARN_ON(!PageLocked(page)); 60 lock_page(page);
61
54 WARN_ON(!PageUptodate(page)); 62 WARN_ON(!PageUptodate(page));
55 63
56 /* 64 /*
@@ -65,24 +73,24 @@ static int page_cache_pipe_buf_steal(struct pipe_inode_info *info,
65 if (PagePrivate(page)) 73 if (PagePrivate(page))
66 try_to_release_page(page, mapping_gfp_mask(mapping)); 74 try_to_release_page(page, mapping_gfp_mask(mapping));
67 75
68 if (!remove_mapping(mapping, page)) 76 if (!remove_mapping(mapping, page)) {
77 unlock_page(page);
69 return 1; 78 return 1;
79 }
70 80
71 buf->flags |= PIPE_BUF_FLAG_STOLEN | PIPE_BUF_FLAG_LRU; 81 buf->flags |= PIPE_BUF_FLAG_LRU;
72 return 0; 82 return 0;
73} 83}
74 84
75static void page_cache_pipe_buf_release(struct pipe_inode_info *info, 85static void page_cache_pipe_buf_release(struct pipe_inode_info *pipe,
76 struct pipe_buffer *buf) 86 struct pipe_buffer *buf)
77{ 87{
78 page_cache_release(buf->page); 88 page_cache_release(buf->page);
79 buf->page = NULL; 89 buf->flags &= ~PIPE_BUF_FLAG_LRU;
80 buf->flags &= ~(PIPE_BUF_FLAG_STOLEN | PIPE_BUF_FLAG_LRU);
81} 90}
82 91
83static void *page_cache_pipe_buf_map(struct file *file, 92static int page_cache_pipe_buf_pin(struct pipe_inode_info *pipe,
84 struct pipe_inode_info *info, 93 struct pipe_buffer *buf)
85 struct pipe_buffer *buf)
86{ 94{
87 struct page *page = buf->page; 95 struct page *page = buf->page;
88 int err; 96 int err;
@@ -108,44 +116,59 @@ static void *page_cache_pipe_buf_map(struct file *file,
108 } 116 }
109 117
110 /* 118 /*
111 * Page is ok afterall, fall through to mapping. 119 * Page is ok afterall, we are done.
112 */ 120 */
113 unlock_page(page); 121 unlock_page(page);
114 } 122 }
115 123
116 return kmap(page); 124 return 0;
117error: 125error:
118 unlock_page(page); 126 unlock_page(page);
119 return ERR_PTR(err); 127 return err;
120} 128}
121 129
122static void page_cache_pipe_buf_unmap(struct pipe_inode_info *info, 130static struct pipe_buf_operations page_cache_pipe_buf_ops = {
123 struct pipe_buffer *buf) 131 .can_merge = 0,
132 .map = generic_pipe_buf_map,
133 .unmap = generic_pipe_buf_unmap,
134 .pin = page_cache_pipe_buf_pin,
135 .release = page_cache_pipe_buf_release,
136 .steal = page_cache_pipe_buf_steal,
137 .get = generic_pipe_buf_get,
138};
139
140static int user_page_pipe_buf_steal(struct pipe_inode_info *pipe,
141 struct pipe_buffer *buf)
124{ 142{
125 kunmap(buf->page); 143 if (!(buf->flags & PIPE_BUF_FLAG_GIFT))
144 return 1;
145
146 buf->flags |= PIPE_BUF_FLAG_LRU;
147 return generic_pipe_buf_steal(pipe, buf);
126} 148}
127 149
128static struct pipe_buf_operations page_cache_pipe_buf_ops = { 150static struct pipe_buf_operations user_page_pipe_buf_ops = {
129 .can_merge = 0, 151 .can_merge = 0,
130 .map = page_cache_pipe_buf_map, 152 .map = generic_pipe_buf_map,
131 .unmap = page_cache_pipe_buf_unmap, 153 .unmap = generic_pipe_buf_unmap,
154 .pin = generic_pipe_buf_pin,
132 .release = page_cache_pipe_buf_release, 155 .release = page_cache_pipe_buf_release,
133 .steal = page_cache_pipe_buf_steal, 156 .steal = user_page_pipe_buf_steal,
157 .get = generic_pipe_buf_get,
134}; 158};
135 159
136/* 160/*
137 * Pipe output worker. This sets up our pipe format with the page cache 161 * Pipe output worker. This sets up our pipe format with the page cache
138 * pipe buffer operations. Otherwise very similar to the regular pipe_writev(). 162 * pipe buffer operations. Otherwise very similar to the regular pipe_writev().
139 */ 163 */
140static ssize_t move_to_pipe(struct pipe_inode_info *pipe, struct page **pages, 164static ssize_t splice_to_pipe(struct pipe_inode_info *pipe,
141 int nr_pages, unsigned long offset, 165 struct splice_pipe_desc *spd)
142 unsigned long len, unsigned int flags)
143{ 166{
144 int ret, do_wakeup, i; 167 int ret, do_wakeup, page_nr;
145 168
146 ret = 0; 169 ret = 0;
147 do_wakeup = 0; 170 do_wakeup = 0;
148 i = 0; 171 page_nr = 0;
149 172
150 if (pipe->inode) 173 if (pipe->inode)
151 mutex_lock(&pipe->inode->i_mutex); 174 mutex_lock(&pipe->inode->i_mutex);
@@ -161,27 +184,22 @@ static ssize_t move_to_pipe(struct pipe_inode_info *pipe, struct page **pages,
161 if (pipe->nrbufs < PIPE_BUFFERS) { 184 if (pipe->nrbufs < PIPE_BUFFERS) {
162 int newbuf = (pipe->curbuf + pipe->nrbufs) & (PIPE_BUFFERS - 1); 185 int newbuf = (pipe->curbuf + pipe->nrbufs) & (PIPE_BUFFERS - 1);
163 struct pipe_buffer *buf = pipe->bufs + newbuf; 186 struct pipe_buffer *buf = pipe->bufs + newbuf;
164 struct page *page = pages[i++];
165 unsigned long this_len;
166 187
167 this_len = PAGE_CACHE_SIZE - offset; 188 buf->page = spd->pages[page_nr];
168 if (this_len > len) 189 buf->offset = spd->partial[page_nr].offset;
169 this_len = len; 190 buf->len = spd->partial[page_nr].len;
191 buf->ops = spd->ops;
192 if (spd->flags & SPLICE_F_GIFT)
193 buf->flags |= PIPE_BUF_FLAG_GIFT;
170 194
171 buf->page = page;
172 buf->offset = offset;
173 buf->len = this_len;
174 buf->ops = &page_cache_pipe_buf_ops;
175 pipe->nrbufs++; 195 pipe->nrbufs++;
196 page_nr++;
197 ret += buf->len;
198
176 if (pipe->inode) 199 if (pipe->inode)
177 do_wakeup = 1; 200 do_wakeup = 1;
178 201
179 ret += this_len; 202 if (!--spd->nr_pages)
180 len -= this_len;
181 offset = 0;
182 if (!--nr_pages)
183 break;
184 if (!len)
185 break; 203 break;
186 if (pipe->nrbufs < PIPE_BUFFERS) 204 if (pipe->nrbufs < PIPE_BUFFERS)
187 continue; 205 continue;
@@ -189,7 +207,7 @@ static ssize_t move_to_pipe(struct pipe_inode_info *pipe, struct page **pages,
189 break; 207 break;
190 } 208 }
191 209
192 if (flags & SPLICE_F_NONBLOCK) { 210 if (spd->flags & SPLICE_F_NONBLOCK) {
193 if (!ret) 211 if (!ret)
194 ret = -EAGAIN; 212 ret = -EAGAIN;
195 break; 213 break;
@@ -224,26 +242,36 @@ static ssize_t move_to_pipe(struct pipe_inode_info *pipe, struct page **pages,
224 kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN); 242 kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN);
225 } 243 }
226 244
227 while (i < nr_pages) 245 while (page_nr < spd->nr_pages)
228 page_cache_release(pages[i++]); 246 page_cache_release(spd->pages[page_nr++]);
229 247
230 return ret; 248 return ret;
231} 249}
232 250
233static int 251static int
234__generic_file_splice_read(struct file *in, struct pipe_inode_info *pipe, 252__generic_file_splice_read(struct file *in, loff_t *ppos,
235 size_t len, unsigned int flags) 253 struct pipe_inode_info *pipe, size_t len,
254 unsigned int flags)
236{ 255{
237 struct address_space *mapping = in->f_mapping; 256 struct address_space *mapping = in->f_mapping;
238 unsigned int offset, nr_pages; 257 unsigned int loff, nr_pages;
239 struct page *pages[PIPE_BUFFERS]; 258 struct page *pages[PIPE_BUFFERS];
259 struct partial_page partial[PIPE_BUFFERS];
240 struct page *page; 260 struct page *page;
241 pgoff_t index; 261 pgoff_t index, end_index;
242 int i, error; 262 loff_t isize;
243 263 size_t total_len;
244 index = in->f_pos >> PAGE_CACHE_SHIFT; 264 int error, page_nr;
245 offset = in->f_pos & ~PAGE_CACHE_MASK; 265 struct splice_pipe_desc spd = {
246 nr_pages = (len + offset + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; 266 .pages = pages,
267 .partial = partial,
268 .flags = flags,
269 .ops = &page_cache_pipe_buf_ops,
270 };
271
272 index = *ppos >> PAGE_CACHE_SHIFT;
273 loff = *ppos & ~PAGE_CACHE_MASK;
274 nr_pages = (len + loff + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
247 275
248 if (nr_pages > PIPE_BUFFERS) 276 if (nr_pages > PIPE_BUFFERS)
249 nr_pages = PIPE_BUFFERS; 277 nr_pages = PIPE_BUFFERS;
@@ -253,49 +281,94 @@ __generic_file_splice_read(struct file *in, struct pipe_inode_info *pipe,
253 * read-ahead if this is a non-zero offset (we are likely doing small 281 * read-ahead if this is a non-zero offset (we are likely doing small
254 * chunk splice and the page is already there) for a single page. 282 * chunk splice and the page is already there) for a single page.
255 */ 283 */
256 if (!offset || nr_pages > 1) 284 if (!loff || nr_pages > 1)
257 do_page_cache_readahead(mapping, in, index, nr_pages); 285 page_cache_readahead(mapping, &in->f_ra, in, index, nr_pages);
258 286
259 /* 287 /*
260 * Now fill in the holes: 288 * Now fill in the holes:
261 */ 289 */
262 error = 0; 290 error = 0;
263 for (i = 0; i < nr_pages; i++, index++) { 291 total_len = 0;
264find_page: 292
293 /*
294 * Lookup the (hopefully) full range of pages we need.
295 */
296 spd.nr_pages = find_get_pages_contig(mapping, index, nr_pages, pages);
297
298 /*
299 * If find_get_pages_contig() returned fewer pages than we needed,
300 * allocate the rest.
301 */
302 index += spd.nr_pages;
303 while (spd.nr_pages < nr_pages) {
265 /* 304 /*
266 * lookup the page for this index 305 * Page could be there, find_get_pages_contig() breaks on
306 * the first hole.
267 */ 307 */
268 page = find_get_page(mapping, index); 308 page = find_get_page(mapping, index);
269 if (!page) { 309 if (!page) {
270 /* 310 /*
271 * If in nonblock mode then dont block on 311 * Make sure the read-ahead engine is notified
272 * readpage (we've kicked readahead so there 312 * about this failure.
273 * will be asynchronous progress):
274 */ 313 */
275 if (flags & SPLICE_F_NONBLOCK) 314 handle_ra_miss(mapping, &in->f_ra, index);
276 break;
277 315
278 /* 316 /*
279 * page didn't exist, allocate one 317 * page didn't exist, allocate one.
280 */ 318 */
281 page = page_cache_alloc_cold(mapping); 319 page = page_cache_alloc_cold(mapping);
282 if (!page) 320 if (!page)
283 break; 321 break;
284 322
285 error = add_to_page_cache_lru(page, mapping, index, 323 error = add_to_page_cache_lru(page, mapping, index,
286 mapping_gfp_mask(mapping)); 324 mapping_gfp_mask(mapping));
287 if (unlikely(error)) { 325 if (unlikely(error)) {
288 page_cache_release(page); 326 page_cache_release(page);
327 if (error == -EEXIST)
328 continue;
289 break; 329 break;
290 } 330 }
291 331 /*
292 goto readpage; 332 * add_to_page_cache() locks the page, unlock it
333 * to avoid convoluting the logic below even more.
334 */
335 unlock_page(page);
293 } 336 }
294 337
338 pages[spd.nr_pages++] = page;
339 index++;
340 }
341
342 /*
343 * Now loop over the map and see if we need to start IO on any
344 * pages, fill in the partial map, etc.
345 */
346 index = *ppos >> PAGE_CACHE_SHIFT;
347 nr_pages = spd.nr_pages;
348 spd.nr_pages = 0;
349 for (page_nr = 0; page_nr < nr_pages; page_nr++) {
350 unsigned int this_len;
351
352 if (!len)
353 break;
354
355 /*
356 * this_len is the max we'll use from this page
357 */
358 this_len = min_t(unsigned long, len, PAGE_CACHE_SIZE - loff);
359 page = pages[page_nr];
360
295 /* 361 /*
296 * If the page isn't uptodate, we may need to start io on it 362 * If the page isn't uptodate, we may need to start io on it
297 */ 363 */
298 if (!PageUptodate(page)) { 364 if (!PageUptodate(page)) {
365 /*
366 * If in nonblock mode then dont block on waiting
367 * for an in-flight io page
368 */
369 if (flags & SPLICE_F_NONBLOCK)
370 break;
371
299 lock_page(page); 372 lock_page(page);
300 373
301 /* 374 /*
@@ -305,7 +378,6 @@ find_page:
305 */ 378 */
306 if (!page->mapping) { 379 if (!page->mapping) {
307 unlock_page(page); 380 unlock_page(page);
308 page_cache_release(page);
309 break; 381 break;
310 } 382 }
311 /* 383 /*
@@ -316,25 +388,66 @@ find_page:
316 goto fill_it; 388 goto fill_it;
317 } 389 }
318 390
319readpage:
320 /* 391 /*
321 * need to read in the page 392 * need to read in the page
322 */ 393 */
323 error = mapping->a_ops->readpage(in, page); 394 error = mapping->a_ops->readpage(in, page);
324
325 if (unlikely(error)) { 395 if (unlikely(error)) {
326 page_cache_release(page); 396 /*
397 * We really should re-lookup the page here,
398 * but it complicates things a lot. Instead
399 * lets just do what we already stored, and
400 * we'll get it the next time we are called.
401 */
327 if (error == AOP_TRUNCATED_PAGE) 402 if (error == AOP_TRUNCATED_PAGE)
328 goto find_page; 403 error = 0;
404
329 break; 405 break;
330 } 406 }
407
408 /*
409 * i_size must be checked after ->readpage().
410 */
411 isize = i_size_read(mapping->host);
412 end_index = (isize - 1) >> PAGE_CACHE_SHIFT;
413 if (unlikely(!isize || index > end_index))
414 break;
415
416 /*
417 * if this is the last page, see if we need to shrink
418 * the length and stop
419 */
420 if (end_index == index) {
421 loff = PAGE_CACHE_SIZE - (isize & ~PAGE_CACHE_MASK);
422 if (total_len + loff > isize)
423 break;
424 /*
425 * force quit after adding this page
426 */
427 len = this_len;
428 this_len = min(this_len, loff);
429 loff = 0;
430 }
331 } 431 }
332fill_it: 432fill_it:
333 pages[i] = page; 433 partial[page_nr].offset = loff;
434 partial[page_nr].len = this_len;
435 len -= this_len;
436 total_len += this_len;
437 loff = 0;
438 spd.nr_pages++;
439 index++;
334 } 440 }
335 441
336 if (i) 442 /*
337 return move_to_pipe(pipe, pages, i, offset, len, flags); 443 * Release any pages at the end, if we quit early. 'i' is how far
444 * we got, 'nr_pages' is how many pages are in the map.
445 */
446 while (page_nr < nr_pages)
447 page_cache_release(pages[page_nr++]);
448
449 if (spd.nr_pages)
450 return splice_to_pipe(pipe, &spd);
338 451
339 return error; 452 return error;
340} 453}
@@ -348,8 +461,9 @@ fill_it:
348 * 461 *
349 * Will read pages from given file and fill them into a pipe. 462 * Will read pages from given file and fill them into a pipe.
350 */ 463 */
351ssize_t generic_file_splice_read(struct file *in, struct pipe_inode_info *pipe, 464ssize_t generic_file_splice_read(struct file *in, loff_t *ppos,
352 size_t len, unsigned int flags) 465 struct pipe_inode_info *pipe, size_t len,
466 unsigned int flags)
353{ 467{
354 ssize_t spliced; 468 ssize_t spliced;
355 int ret; 469 int ret;
@@ -358,19 +472,22 @@ ssize_t generic_file_splice_read(struct file *in, struct pipe_inode_info *pipe,
358 spliced = 0; 472 spliced = 0;
359 473
360 while (len) { 474 while (len) {
361 ret = __generic_file_splice_read(in, pipe, len, flags); 475 ret = __generic_file_splice_read(in, ppos, pipe, len, flags);
362 476
363 if (ret <= 0) 477 if (ret < 0)
364 break; 478 break;
479 else if (!ret) {
480 if (spliced)
481 break;
482 if (flags & SPLICE_F_NONBLOCK) {
483 ret = -EAGAIN;
484 break;
485 }
486 }
365 487
366 in->f_pos += ret; 488 *ppos += ret;
367 len -= ret; 489 len -= ret;
368 spliced += ret; 490 spliced += ret;
369
370 if (!(flags & SPLICE_F_NONBLOCK))
371 continue;
372 ret = -EAGAIN;
373 break;
374 } 491 }
375 492
376 if (spliced) 493 if (spliced)
@@ -383,38 +500,24 @@ EXPORT_SYMBOL(generic_file_splice_read);
383 500
384/* 501/*
385 * Send 'sd->len' bytes to socket from 'sd->file' at position 'sd->pos' 502 * Send 'sd->len' bytes to socket from 'sd->file' at position 'sd->pos'
386 * using sendpage(). 503 * using sendpage(). Return the number of bytes sent.
387 */ 504 */
388static int pipe_to_sendpage(struct pipe_inode_info *info, 505static int pipe_to_sendpage(struct pipe_inode_info *pipe,
389 struct pipe_buffer *buf, struct splice_desc *sd) 506 struct pipe_buffer *buf, struct splice_desc *sd)
390{ 507{
391 struct file *file = sd->file; 508 struct file *file = sd->file;
392 loff_t pos = sd->pos; 509 loff_t pos = sd->pos;
393 unsigned int offset; 510 int ret, more;
394 ssize_t ret;
395 void *ptr;
396 int more;
397
398 /*
399 * Sub-optimal, but we are limited by the pipe ->map. We don't
400 * need a kmap'ed buffer here, we just want to make sure we
401 * have the page pinned if the pipe page originates from the
402 * page cache.
403 */
404 ptr = buf->ops->map(file, info, buf);
405 if (IS_ERR(ptr))
406 return PTR_ERR(ptr);
407 511
408 offset = pos & ~PAGE_CACHE_MASK; 512 ret = buf->ops->pin(pipe, buf);
409 more = (sd->flags & SPLICE_F_MORE) || sd->len < sd->total_len; 513 if (!ret) {
514 more = (sd->flags & SPLICE_F_MORE) || sd->len < sd->total_len;
410 515
411 ret = file->f_op->sendpage(file, buf->page, offset, sd->len, &pos,more); 516 ret = file->f_op->sendpage(file, buf->page, buf->offset,
412 517 sd->len, &pos, more);
413 buf->ops->unmap(info, buf); 518 }
414 if (ret == sd->len)
415 return 0;
416 519
417 return -EIO; 520 return ret;
418} 521}
419 522
420/* 523/*
@@ -437,62 +540,80 @@ static int pipe_to_sendpage(struct pipe_inode_info *info,
437 * SPLICE_F_MOVE isn't set, or we cannot move the page, we simply create 540 * SPLICE_F_MOVE isn't set, or we cannot move the page, we simply create
438 * a new page in the output file page cache and fill/dirty that. 541 * a new page in the output file page cache and fill/dirty that.
439 */ 542 */
440static int pipe_to_file(struct pipe_inode_info *info, struct pipe_buffer *buf, 543static int pipe_to_file(struct pipe_inode_info *pipe, struct pipe_buffer *buf,
441 struct splice_desc *sd) 544 struct splice_desc *sd)
442{ 545{
443 struct file *file = sd->file; 546 struct file *file = sd->file;
444 struct address_space *mapping = file->f_mapping; 547 struct address_space *mapping = file->f_mapping;
445 gfp_t gfp_mask = mapping_gfp_mask(mapping); 548 gfp_t gfp_mask = mapping_gfp_mask(mapping);
446 unsigned int offset; 549 unsigned int offset, this_len;
447 struct page *page; 550 struct page *page;
448 pgoff_t index; 551 pgoff_t index;
449 char *src;
450 int ret; 552 int ret;
451 553
452 /* 554 /*
453 * make sure the data in this buffer is uptodate 555 * make sure the data in this buffer is uptodate
454 */ 556 */
455 src = buf->ops->map(file, info, buf); 557 ret = buf->ops->pin(pipe, buf);
456 if (IS_ERR(src)) 558 if (unlikely(ret))
457 return PTR_ERR(src); 559 return ret;
458 560
459 index = sd->pos >> PAGE_CACHE_SHIFT; 561 index = sd->pos >> PAGE_CACHE_SHIFT;
460 offset = sd->pos & ~PAGE_CACHE_MASK; 562 offset = sd->pos & ~PAGE_CACHE_MASK;
461 563
564 this_len = sd->len;
565 if (this_len + offset > PAGE_CACHE_SIZE)
566 this_len = PAGE_CACHE_SIZE - offset;
567
462 /* 568 /*
463 * Reuse buf page, if SPLICE_F_MOVE is set. 569 * Reuse buf page, if SPLICE_F_MOVE is set and we are doing a full
570 * page.
464 */ 571 */
465 if (sd->flags & SPLICE_F_MOVE) { 572 if ((sd->flags & SPLICE_F_MOVE) && this_len == PAGE_CACHE_SIZE) {
466 /* 573 /*
467 * If steal succeeds, buf->page is now pruned from the vm 574 * If steal succeeds, buf->page is now pruned from the
468 * side (LRU and page cache) and we can reuse it. 575 * pagecache and we can reuse it. The page will also be
576 * locked on successful return.
469 */ 577 */
470 if (buf->ops->steal(info, buf)) 578 if (buf->ops->steal(pipe, buf))
471 goto find_page; 579 goto find_page;
472 580
473 /*
474 * this will also set the page locked
475 */
476 page = buf->page; 581 page = buf->page;
477 if (add_to_page_cache(page, mapping, index, gfp_mask)) 582 if (add_to_page_cache(page, mapping, index, gfp_mask)) {
583 unlock_page(page);
478 goto find_page; 584 goto find_page;
585 }
586
587 page_cache_get(page);
479 588
480 if (!(buf->flags & PIPE_BUF_FLAG_LRU)) 589 if (!(buf->flags & PIPE_BUF_FLAG_LRU))
481 lru_cache_add(page); 590 lru_cache_add(page);
482 } else { 591 } else {
483find_page: 592find_page:
484 ret = -ENOMEM; 593 page = find_lock_page(mapping, index);
485 page = find_or_create_page(mapping, index, gfp_mask); 594 if (!page) {
486 if (!page) 595 ret = -ENOMEM;
487 goto out_nomem; 596 page = page_cache_alloc_cold(mapping);
597 if (unlikely(!page))
598 goto out_nomem;
599
600 /*
601 * This will also lock the page
602 */
603 ret = add_to_page_cache_lru(page, mapping, index,
604 gfp_mask);
605 if (unlikely(ret))
606 goto out;
607 }
488 608
489 /* 609 /*
490 * If the page is uptodate, it is also locked. If it isn't 610 * We get here with the page locked. If the page is also
491 * uptodate, we can mark it uptodate if we are filling the 611 * uptodate, we don't need to do more. If it isn't, we
492 * full page. Otherwise we need to read it in first... 612 * may need to bring it in if we are not going to overwrite
613 * the full page.
493 */ 614 */
494 if (!PageUptodate(page)) { 615 if (!PageUptodate(page)) {
495 if (sd->len < PAGE_CACHE_SIZE) { 616 if (this_len < PAGE_CACHE_SIZE) {
496 ret = mapping->a_ops->readpage(file, page); 617 ret = mapping->a_ops->readpage(file, page);
497 if (unlikely(ret)) 618 if (unlikely(ret))
498 goto out; 619 goto out;
@@ -511,58 +632,72 @@ find_page:
511 ret = -EIO; 632 ret = -EIO;
512 goto out; 633 goto out;
513 } 634 }
514 } else { 635 } else
515 WARN_ON(!PageLocked(page));
516 SetPageUptodate(page); 636 SetPageUptodate(page);
517 }
518 } 637 }
519 } 638 }
520 639
521 ret = mapping->a_ops->prepare_write(file, page, 0, sd->len); 640 ret = mapping->a_ops->prepare_write(file, page, offset, offset+this_len);
522 if (ret == AOP_TRUNCATED_PAGE) { 641 if (unlikely(ret)) {
642 loff_t isize = i_size_read(mapping->host);
643
644 if (ret != AOP_TRUNCATED_PAGE)
645 unlock_page(page);
523 page_cache_release(page); 646 page_cache_release(page);
524 goto find_page; 647 if (ret == AOP_TRUNCATED_PAGE)
525 } else if (ret) 648 goto find_page;
649
650 /*
651 * prepare_write() may have instantiated a few blocks
652 * outside i_size. Trim these off again.
653 */
654 if (sd->pos + this_len > isize)
655 vmtruncate(mapping->host, isize);
656
526 goto out; 657 goto out;
658 }
527 659
528 if (!(buf->flags & PIPE_BUF_FLAG_STOLEN)) { 660 if (buf->page != page) {
529 char *dst = kmap_atomic(page, KM_USER0); 661 /*
662 * Careful, ->map() uses KM_USER0!
663 */
664 char *src = buf->ops->map(pipe, buf, 1);
665 char *dst = kmap_atomic(page, KM_USER1);
530 666
531 memcpy(dst + offset, src + buf->offset, sd->len); 667 memcpy(dst + offset, src + buf->offset, this_len);
532 flush_dcache_page(page); 668 flush_dcache_page(page);
533 kunmap_atomic(dst, KM_USER0); 669 kunmap_atomic(dst, KM_USER1);
670 buf->ops->unmap(pipe, buf, src);
534 } 671 }
535 672
536 ret = mapping->a_ops->commit_write(file, page, 0, sd->len); 673 ret = mapping->a_ops->commit_write(file, page, offset, offset+this_len);
537 if (ret == AOP_TRUNCATED_PAGE) { 674 if (!ret) {
675 /*
676 * Return the number of bytes written and mark page as
677 * accessed, we are now done!
678 */
679 ret = this_len;
680 mark_page_accessed(page);
681 balance_dirty_pages_ratelimited(mapping);
682 } else if (ret == AOP_TRUNCATED_PAGE) {
538 page_cache_release(page); 683 page_cache_release(page);
539 goto find_page; 684 goto find_page;
540 } else if (ret)
541 goto out;
542
543 mark_page_accessed(page);
544 balance_dirty_pages_ratelimited(mapping);
545out:
546 if (!(buf->flags & PIPE_BUF_FLAG_STOLEN)) {
547 page_cache_release(page);
548 unlock_page(page);
549 } 685 }
686out:
687 page_cache_release(page);
688 unlock_page(page);
550out_nomem: 689out_nomem:
551 buf->ops->unmap(info, buf);
552 return ret; 690 return ret;
553} 691}
554 692
555typedef int (splice_actor)(struct pipe_inode_info *, struct pipe_buffer *,
556 struct splice_desc *);
557
558/* 693/*
559 * Pipe input worker. Most of this logic works like a regular pipe, the 694 * Pipe input worker. Most of this logic works like a regular pipe, the
560 * key here is the 'actor' worker passed in that actually moves the data 695 * key here is the 'actor' worker passed in that actually moves the data
561 * to the wanted destination. See pipe_to_file/pipe_to_sendpage above. 696 * to the wanted destination. See pipe_to_file/pipe_to_sendpage above.
562 */ 697 */
563static ssize_t move_from_pipe(struct pipe_inode_info *pipe, struct file *out, 698ssize_t splice_from_pipe(struct pipe_inode_info *pipe, struct file *out,
564 size_t len, unsigned int flags, 699 loff_t *ppos, size_t len, unsigned int flags,
565 splice_actor *actor) 700 splice_actor *actor)
566{ 701{
567 int ret, do_wakeup, err; 702 int ret, do_wakeup, err;
568 struct splice_desc sd; 703 struct splice_desc sd;
@@ -573,7 +708,7 @@ static ssize_t move_from_pipe(struct pipe_inode_info *pipe, struct file *out,
573 sd.total_len = len; 708 sd.total_len = len;
574 sd.flags = flags; 709 sd.flags = flags;
575 sd.file = out; 710 sd.file = out;
576 sd.pos = out->f_pos; 711 sd.pos = *ppos;
577 712
578 if (pipe->inode) 713 if (pipe->inode)
579 mutex_lock(&pipe->inode->i_mutex); 714 mutex_lock(&pipe->inode->i_mutex);
@@ -588,16 +723,22 @@ static ssize_t move_from_pipe(struct pipe_inode_info *pipe, struct file *out,
588 sd.len = sd.total_len; 723 sd.len = sd.total_len;
589 724
590 err = actor(pipe, buf, &sd); 725 err = actor(pipe, buf, &sd);
591 if (err) { 726 if (err <= 0) {
592 if (!ret && err != -ENODATA) 727 if (!ret && err != -ENODATA)
593 ret = err; 728 ret = err;
594 729
595 break; 730 break;
596 } 731 }
597 732
598 ret += sd.len; 733 ret += err;
599 buf->offset += sd.len; 734 buf->offset += err;
600 buf->len -= sd.len; 735 buf->len -= err;
736
737 sd.len -= err;
738 sd.pos += err;
739 sd.total_len -= err;
740 if (sd.len)
741 continue;
601 742
602 if (!buf->len) { 743 if (!buf->len) {
603 buf->ops = NULL; 744 buf->ops = NULL;
@@ -608,8 +749,6 @@ static ssize_t move_from_pipe(struct pipe_inode_info *pipe, struct file *out,
608 do_wakeup = 1; 749 do_wakeup = 1;
609 } 750 }
610 751
611 sd.pos += sd.len;
612 sd.total_len -= sd.len;
613 if (!sd.total_len) 752 if (!sd.total_len)
614 break; 753 break;
615 } 754 }
@@ -656,9 +795,7 @@ static ssize_t move_from_pipe(struct pipe_inode_info *pipe, struct file *out,
656 kill_fasync(&pipe->fasync_writers, SIGIO, POLL_OUT); 795 kill_fasync(&pipe->fasync_writers, SIGIO, POLL_OUT);
657 } 796 }
658 797
659 out->f_pos = sd.pos;
660 return ret; 798 return ret;
661
662} 799}
663 800
664/** 801/**
@@ -674,28 +811,32 @@ static ssize_t move_from_pipe(struct pipe_inode_info *pipe, struct file *out,
674 */ 811 */
675ssize_t 812ssize_t
676generic_file_splice_write(struct pipe_inode_info *pipe, struct file *out, 813generic_file_splice_write(struct pipe_inode_info *pipe, struct file *out,
677 size_t len, unsigned int flags) 814 loff_t *ppos, size_t len, unsigned int flags)
678{ 815{
679 struct address_space *mapping = out->f_mapping; 816 struct address_space *mapping = out->f_mapping;
680 ssize_t ret; 817 ssize_t ret;
681 818
682 ret = move_from_pipe(pipe, out, len, flags, pipe_to_file); 819 ret = splice_from_pipe(pipe, out, ppos, len, flags, pipe_to_file);
683 820 if (ret > 0) {
684 /*
685 * If file or inode is SYNC and we actually wrote some data, sync it.
686 */
687 if (unlikely((out->f_flags & O_SYNC) || IS_SYNC(mapping->host))
688 && ret > 0) {
689 struct inode *inode = mapping->host; 821 struct inode *inode = mapping->host;
690 int err;
691 822
692 mutex_lock(&inode->i_mutex); 823 *ppos += ret;
693 err = generic_osync_inode(mapping->host, mapping,
694 OSYNC_METADATA|OSYNC_DATA);
695 mutex_unlock(&inode->i_mutex);
696 824
697 if (err) 825 /*
698 ret = err; 826 * If file or inode is SYNC and we actually wrote some data,
827 * sync it.
828 */
829 if (unlikely((out->f_flags & O_SYNC) || IS_SYNC(inode))) {
830 int err;
831
832 mutex_lock(&inode->i_mutex);
833 err = generic_osync_inode(inode, mapping,
834 OSYNC_METADATA|OSYNC_DATA);
835 mutex_unlock(&inode->i_mutex);
836
837 if (err)
838 ret = err;
839 }
699 } 840 }
700 841
701 return ret; 842 return ret;
@@ -715,9 +856,9 @@ EXPORT_SYMBOL(generic_file_splice_write);
715 * 856 *
716 */ 857 */
717ssize_t generic_splice_sendpage(struct pipe_inode_info *pipe, struct file *out, 858ssize_t generic_splice_sendpage(struct pipe_inode_info *pipe, struct file *out,
718 size_t len, unsigned int flags) 859 loff_t *ppos, size_t len, unsigned int flags)
719{ 860{
720 return move_from_pipe(pipe, out, len, flags, pipe_to_sendpage); 861 return splice_from_pipe(pipe, out, ppos, len, flags, pipe_to_sendpage);
721} 862}
722 863
723EXPORT_SYMBOL(generic_splice_sendpage); 864EXPORT_SYMBOL(generic_splice_sendpage);
@@ -726,9 +867,8 @@ EXPORT_SYMBOL(generic_splice_sendpage);
726 * Attempt to initiate a splice from pipe to file. 867 * Attempt to initiate a splice from pipe to file.
727 */ 868 */
728static long do_splice_from(struct pipe_inode_info *pipe, struct file *out, 869static long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
729 size_t len, unsigned int flags) 870 loff_t *ppos, size_t len, unsigned int flags)
730{ 871{
731 loff_t pos;
732 int ret; 872 int ret;
733 873
734 if (unlikely(!out->f_op || !out->f_op->splice_write)) 874 if (unlikely(!out->f_op || !out->f_op->splice_write))
@@ -737,22 +877,21 @@ static long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
737 if (unlikely(!(out->f_mode & FMODE_WRITE))) 877 if (unlikely(!(out->f_mode & FMODE_WRITE)))
738 return -EBADF; 878 return -EBADF;
739 879
740 pos = out->f_pos; 880 ret = rw_verify_area(WRITE, out, ppos, len);
741
742 ret = rw_verify_area(WRITE, out, &pos, len);
743 if (unlikely(ret < 0)) 881 if (unlikely(ret < 0))
744 return ret; 882 return ret;
745 883
746 return out->f_op->splice_write(pipe, out, len, flags); 884 return out->f_op->splice_write(pipe, out, ppos, len, flags);
747} 885}
748 886
749/* 887/*
750 * Attempt to initiate a splice from a file to a pipe. 888 * Attempt to initiate a splice from a file to a pipe.
751 */ 889 */
752static long do_splice_to(struct file *in, struct pipe_inode_info *pipe, 890static long do_splice_to(struct file *in, loff_t *ppos,
753 size_t len, unsigned int flags) 891 struct pipe_inode_info *pipe, size_t len,
892 unsigned int flags)
754{ 893{
755 loff_t pos, isize, left; 894 loff_t isize, left;
756 int ret; 895 int ret;
757 896
758 if (unlikely(!in->f_op || !in->f_op->splice_read)) 897 if (unlikely(!in->f_op || !in->f_op->splice_read))
@@ -761,28 +900,27 @@ static long do_splice_to(struct file *in, struct pipe_inode_info *pipe,
761 if (unlikely(!(in->f_mode & FMODE_READ))) 900 if (unlikely(!(in->f_mode & FMODE_READ)))
762 return -EBADF; 901 return -EBADF;
763 902
764 pos = in->f_pos; 903 ret = rw_verify_area(READ, in, ppos, len);
765
766 ret = rw_verify_area(READ, in, &pos, len);
767 if (unlikely(ret < 0)) 904 if (unlikely(ret < 0))
768 return ret; 905 return ret;
769 906
770 isize = i_size_read(in->f_mapping->host); 907 isize = i_size_read(in->f_mapping->host);
771 if (unlikely(in->f_pos >= isize)) 908 if (unlikely(*ppos >= isize))
772 return 0; 909 return 0;
773 910
774 left = isize - in->f_pos; 911 left = isize - *ppos;
775 if (unlikely(left < len)) 912 if (unlikely(left < len))
776 len = left; 913 len = left;
777 914
778 return in->f_op->splice_read(in, pipe, len, flags); 915 return in->f_op->splice_read(in, ppos, pipe, len, flags);
779} 916}
780 917
781long do_splice_direct(struct file *in, struct file *out, size_t len, 918long do_splice_direct(struct file *in, loff_t *ppos, struct file *out,
782 unsigned int flags) 919 size_t len, unsigned int flags)
783{ 920{
784 struct pipe_inode_info *pipe; 921 struct pipe_inode_info *pipe;
785 long ret, bytes; 922 long ret, bytes;
923 loff_t out_off;
786 umode_t i_mode; 924 umode_t i_mode;
787 int i; 925 int i;
788 926
@@ -807,7 +945,7 @@ long do_splice_direct(struct file *in, struct file *out, size_t len,
807 945
808 /* 946 /*
809 * We don't have an immediate reader, but we'll read the stuff 947 * We don't have an immediate reader, but we'll read the stuff
810 * out of the pipe right after the move_to_pipe(). So set 948 * out of the pipe right after the splice_to_pipe(). So set
811 * PIPE_READERS appropriately. 949 * PIPE_READERS appropriately.
812 */ 950 */
813 pipe->readers = 1; 951 pipe->readers = 1;
@@ -820,6 +958,7 @@ long do_splice_direct(struct file *in, struct file *out, size_t len,
820 */ 958 */
821 ret = 0; 959 ret = 0;
822 bytes = 0; 960 bytes = 0;
961 out_off = 0;
823 962
824 while (len) { 963 while (len) {
825 size_t read_len, max_read_len; 964 size_t read_len, max_read_len;
@@ -829,7 +968,7 @@ long do_splice_direct(struct file *in, struct file *out, size_t len,
829 */ 968 */
830 max_read_len = min(len, (size_t)(PIPE_BUFFERS*PAGE_SIZE)); 969 max_read_len = min(len, (size_t)(PIPE_BUFFERS*PAGE_SIZE));
831 970
832 ret = do_splice_to(in, pipe, max_read_len, flags); 971 ret = do_splice_to(in, ppos, pipe, max_read_len, flags);
833 if (unlikely(ret < 0)) 972 if (unlikely(ret < 0))
834 goto out_release; 973 goto out_release;
835 974
@@ -840,7 +979,7 @@ long do_splice_direct(struct file *in, struct file *out, size_t len,
840 * must not do the output in nonblocking mode as then we 979 * must not do the output in nonblocking mode as then we
841 * could get stuck data in the internal pipe: 980 * could get stuck data in the internal pipe:
842 */ 981 */
843 ret = do_splice_from(pipe, out, read_len, 982 ret = do_splice_from(pipe, out, &out_off, read_len,
844 flags & ~SPLICE_F_NONBLOCK); 983 flags & ~SPLICE_F_NONBLOCK);
845 if (unlikely(ret < 0)) 984 if (unlikely(ret < 0))
846 goto out_release; 985 goto out_release;
@@ -898,6 +1037,8 @@ static long do_splice(struct file *in, loff_t __user *off_in,
898 size_t len, unsigned int flags) 1037 size_t len, unsigned int flags)
899{ 1038{
900 struct pipe_inode_info *pipe; 1039 struct pipe_inode_info *pipe;
1040 loff_t offset, *off;
1041 long ret;
901 1042
902 pipe = in->f_dentry->d_inode->i_pipe; 1043 pipe = in->f_dentry->d_inode->i_pipe;
903 if (pipe) { 1044 if (pipe) {
@@ -906,12 +1047,18 @@ static long do_splice(struct file *in, loff_t __user *off_in,
906 if (off_out) { 1047 if (off_out) {
907 if (out->f_op->llseek == no_llseek) 1048 if (out->f_op->llseek == no_llseek)
908 return -EINVAL; 1049 return -EINVAL;
909 if (copy_from_user(&out->f_pos, off_out, 1050 if (copy_from_user(&offset, off_out, sizeof(loff_t)))
910 sizeof(loff_t)))
911 return -EFAULT; 1051 return -EFAULT;
912 } 1052 off = &offset;
1053 } else
1054 off = &out->f_pos;
913 1055
914 return do_splice_from(pipe, out, len, flags); 1056 ret = do_splice_from(pipe, out, off, len, flags);
1057
1058 if (off_out && copy_to_user(off_out, off, sizeof(loff_t)))
1059 ret = -EFAULT;
1060
1061 return ret;
915 } 1062 }
916 1063
917 pipe = out->f_dentry->d_inode->i_pipe; 1064 pipe = out->f_dentry->d_inode->i_pipe;
@@ -921,16 +1068,201 @@ static long do_splice(struct file *in, loff_t __user *off_in,
921 if (off_in) { 1068 if (off_in) {
922 if (in->f_op->llseek == no_llseek) 1069 if (in->f_op->llseek == no_llseek)
923 return -EINVAL; 1070 return -EINVAL;
924 if (copy_from_user(&in->f_pos, off_in, sizeof(loff_t))) 1071 if (copy_from_user(&offset, off_in, sizeof(loff_t)))
925 return -EFAULT; 1072 return -EFAULT;
926 } 1073 off = &offset;
1074 } else
1075 off = &in->f_pos;
927 1076
928 return do_splice_to(in, pipe, len, flags); 1077 ret = do_splice_to(in, off, pipe, len, flags);
1078
1079 if (off_in && copy_to_user(off_in, off, sizeof(loff_t)))
1080 ret = -EFAULT;
1081
1082 return ret;
929 } 1083 }
930 1084
931 return -EINVAL; 1085 return -EINVAL;
932} 1086}
933 1087
1088/*
1089 * Map an iov into an array of pages and offset/length tupples. With the
1090 * partial_page structure, we can map several non-contiguous ranges into
1091 * our ones pages[] map instead of splitting that operation into pieces.
1092 * Could easily be exported as a generic helper for other users, in which
1093 * case one would probably want to add a 'max_nr_pages' parameter as well.
1094 */
1095static int get_iovec_page_array(const struct iovec __user *iov,
1096 unsigned int nr_vecs, struct page **pages,
1097 struct partial_page *partial, int aligned)
1098{
1099 int buffers = 0, error = 0;
1100
1101 /*
1102 * It's ok to take the mmap_sem for reading, even
1103 * across a "get_user()".
1104 */
1105 down_read(&current->mm->mmap_sem);
1106
1107 while (nr_vecs) {
1108 unsigned long off, npages;
1109 void __user *base;
1110 size_t len;
1111 int i;
1112
1113 /*
1114 * Get user address base and length for this iovec.
1115 */
1116 error = get_user(base, &iov->iov_base);
1117 if (unlikely(error))
1118 break;
1119 error = get_user(len, &iov->iov_len);
1120 if (unlikely(error))
1121 break;
1122
1123 /*
1124 * Sanity check this iovec. 0 read succeeds.
1125 */
1126 if (unlikely(!len))
1127 break;
1128 error = -EFAULT;
1129 if (unlikely(!base))
1130 break;
1131
1132 /*
1133 * Get this base offset and number of pages, then map
1134 * in the user pages.
1135 */
1136 off = (unsigned long) base & ~PAGE_MASK;
1137
1138 /*
1139 * If asked for alignment, the offset must be zero and the
1140 * length a multiple of the PAGE_SIZE.
1141 */
1142 error = -EINVAL;
1143 if (aligned && (off || len & ~PAGE_MASK))
1144 break;
1145
1146 npages = (off + len + PAGE_SIZE - 1) >> PAGE_SHIFT;
1147 if (npages > PIPE_BUFFERS - buffers)
1148 npages = PIPE_BUFFERS - buffers;
1149
1150 error = get_user_pages(current, current->mm,
1151 (unsigned long) base, npages, 0, 0,
1152 &pages[buffers], NULL);
1153
1154 if (unlikely(error <= 0))
1155 break;
1156
1157 /*
1158 * Fill this contiguous range into the partial page map.
1159 */
1160 for (i = 0; i < error; i++) {
1161 const int plen = min_t(size_t, len, PAGE_SIZE - off);
1162
1163 partial[buffers].offset = off;
1164 partial[buffers].len = plen;
1165
1166 off = 0;
1167 len -= plen;
1168 buffers++;
1169 }
1170
1171 /*
1172 * We didn't complete this iov, stop here since it probably
1173 * means we have to move some of this into a pipe to
1174 * be able to continue.
1175 */
1176 if (len)
1177 break;
1178
1179 /*
1180 * Don't continue if we mapped fewer pages than we asked for,
1181 * or if we mapped the max number of pages that we have
1182 * room for.
1183 */
1184 if (error < npages || buffers == PIPE_BUFFERS)
1185 break;
1186
1187 nr_vecs--;
1188 iov++;
1189 }
1190
1191 up_read(&current->mm->mmap_sem);
1192
1193 if (buffers)
1194 return buffers;
1195
1196 return error;
1197}
1198
1199/*
1200 * vmsplice splices a user address range into a pipe. It can be thought of
1201 * as splice-from-memory, where the regular splice is splice-from-file (or
1202 * to file). In both cases the output is a pipe, naturally.
1203 *
1204 * Note that vmsplice only supports splicing _from_ user memory to a pipe,
1205 * not the other way around. Splicing from user memory is a simple operation
1206 * that can be supported without any funky alignment restrictions or nasty
1207 * vm tricks. We simply map in the user memory and fill them into a pipe.
1208 * The reverse isn't quite as easy, though. There are two possible solutions
1209 * for that:
1210 *
1211 * - memcpy() the data internally, at which point we might as well just
1212 * do a regular read() on the buffer anyway.
1213 * - Lots of nasty vm tricks, that are neither fast nor flexible (it
1214 * has restriction limitations on both ends of the pipe).
1215 *
1216 * Alas, it isn't here.
1217 *
1218 */
1219static long do_vmsplice(struct file *file, const struct iovec __user *iov,
1220 unsigned long nr_segs, unsigned int flags)
1221{
1222 struct pipe_inode_info *pipe = file->f_dentry->d_inode->i_pipe;
1223 struct page *pages[PIPE_BUFFERS];
1224 struct partial_page partial[PIPE_BUFFERS];
1225 struct splice_pipe_desc spd = {
1226 .pages = pages,
1227 .partial = partial,
1228 .flags = flags,
1229 .ops = &user_page_pipe_buf_ops,
1230 };
1231
1232 if (unlikely(!pipe))
1233 return -EBADF;
1234 if (unlikely(nr_segs > UIO_MAXIOV))
1235 return -EINVAL;
1236 else if (unlikely(!nr_segs))
1237 return 0;
1238
1239 spd.nr_pages = get_iovec_page_array(iov, nr_segs, pages, partial,
1240 flags & SPLICE_F_GIFT);
1241 if (spd.nr_pages <= 0)
1242 return spd.nr_pages;
1243
1244 return splice_to_pipe(pipe, &spd);
1245}
1246
1247asmlinkage long sys_vmsplice(int fd, const struct iovec __user *iov,
1248 unsigned long nr_segs, unsigned int flags)
1249{
1250 struct file *file;
1251 long error;
1252 int fput;
1253
1254 error = -EBADF;
1255 file = fget_light(fd, &fput);
1256 if (file) {
1257 if (file->f_mode & FMODE_WRITE)
1258 error = do_vmsplice(file, iov, nr_segs, flags);
1259
1260 fput_light(file, fput);
1261 }
1262
1263 return error;
1264}
1265
934asmlinkage long sys_splice(int fd_in, loff_t __user *off_in, 1266asmlinkage long sys_splice(int fd_in, loff_t __user *off_in,
935 int fd_out, loff_t __user *off_out, 1267 int fd_out, loff_t __user *off_out,
936 size_t len, unsigned int flags) 1268 size_t len, unsigned int flags)
@@ -961,3 +1293,198 @@ asmlinkage long sys_splice(int fd_in, loff_t __user *off_in,
961 1293
962 return error; 1294 return error;
963} 1295}
1296
1297/*
1298 * Link contents of ipipe to opipe.
1299 */
1300static int link_pipe(struct pipe_inode_info *ipipe,
1301 struct pipe_inode_info *opipe,
1302 size_t len, unsigned int flags)
1303{
1304 struct pipe_buffer *ibuf, *obuf;
1305 int ret, do_wakeup, i, ipipe_first;
1306
1307 ret = do_wakeup = ipipe_first = 0;
1308
1309 /*
1310 * Potential ABBA deadlock, work around it by ordering lock
1311 * grabbing by inode address. Otherwise two different processes
1312 * could deadlock (one doing tee from A -> B, the other from B -> A).
1313 */
1314 if (ipipe->inode < opipe->inode) {
1315 ipipe_first = 1;
1316 mutex_lock(&ipipe->inode->i_mutex);
1317 mutex_lock(&opipe->inode->i_mutex);
1318 } else {
1319 mutex_lock(&opipe->inode->i_mutex);
1320 mutex_lock(&ipipe->inode->i_mutex);
1321 }
1322
1323 for (i = 0;; i++) {
1324 if (!opipe->readers) {
1325 send_sig(SIGPIPE, current, 0);
1326 if (!ret)
1327 ret = -EPIPE;
1328 break;
1329 }
1330 if (ipipe->nrbufs - i) {
1331 ibuf = ipipe->bufs + ((ipipe->curbuf + i) & (PIPE_BUFFERS - 1));
1332
1333 /*
1334 * If we have room, fill this buffer
1335 */
1336 if (opipe->nrbufs < PIPE_BUFFERS) {
1337 int nbuf = (opipe->curbuf + opipe->nrbufs) & (PIPE_BUFFERS - 1);
1338
1339 /*
1340 * Get a reference to this pipe buffer,
1341 * so we can copy the contents over.
1342 */
1343 ibuf->ops->get(ipipe, ibuf);
1344
1345 obuf = opipe->bufs + nbuf;
1346 *obuf = *ibuf;
1347
1348 /*
1349 * Don't inherit the gift flag, we need to
1350 * prevent multiple steals of this page.
1351 */
1352 obuf->flags &= ~PIPE_BUF_FLAG_GIFT;
1353
1354 if (obuf->len > len)
1355 obuf->len = len;
1356
1357 opipe->nrbufs++;
1358 do_wakeup = 1;
1359 ret += obuf->len;
1360 len -= obuf->len;
1361
1362 if (!len)
1363 break;
1364 if (opipe->nrbufs < PIPE_BUFFERS)
1365 continue;
1366 }
1367
1368 /*
1369 * We have input available, but no output room.
1370 * If we already copied data, return that. If we
1371 * need to drop the opipe lock, it must be ordered
1372 * last to avoid deadlocks.
1373 */
1374 if ((flags & SPLICE_F_NONBLOCK) || !ipipe_first) {
1375 if (!ret)
1376 ret = -EAGAIN;
1377 break;
1378 }
1379 if (signal_pending(current)) {
1380 if (!ret)
1381 ret = -ERESTARTSYS;
1382 break;
1383 }
1384 if (do_wakeup) {
1385 smp_mb();
1386 if (waitqueue_active(&opipe->wait))
1387 wake_up_interruptible(&opipe->wait);
1388 kill_fasync(&opipe->fasync_readers, SIGIO, POLL_IN);
1389 do_wakeup = 0;
1390 }
1391
1392 opipe->waiting_writers++;
1393 pipe_wait(opipe);
1394 opipe->waiting_writers--;
1395 continue;
1396 }
1397
1398 /*
1399 * No input buffers, do the usual checks for available
1400 * writers and blocking and wait if necessary
1401 */
1402 if (!ipipe->writers)
1403 break;
1404 if (!ipipe->waiting_writers) {
1405 if (ret)
1406 break;
1407 }
1408 /*
1409 * pipe_wait() drops the ipipe mutex. To avoid deadlocks
1410 * with another process, we can only safely do that if
1411 * the ipipe lock is ordered last.
1412 */
1413 if ((flags & SPLICE_F_NONBLOCK) || ipipe_first) {
1414 if (!ret)
1415 ret = -EAGAIN;
1416 break;
1417 }
1418 if (signal_pending(current)) {
1419 if (!ret)
1420 ret = -ERESTARTSYS;
1421 break;
1422 }
1423
1424 if (waitqueue_active(&ipipe->wait))
1425 wake_up_interruptible_sync(&ipipe->wait);
1426 kill_fasync(&ipipe->fasync_writers, SIGIO, POLL_OUT);
1427
1428 pipe_wait(ipipe);
1429 }
1430
1431 mutex_unlock(&ipipe->inode->i_mutex);
1432 mutex_unlock(&opipe->inode->i_mutex);
1433
1434 if (do_wakeup) {
1435 smp_mb();
1436 if (waitqueue_active(&opipe->wait))
1437 wake_up_interruptible(&opipe->wait);
1438 kill_fasync(&opipe->fasync_readers, SIGIO, POLL_IN);
1439 }
1440
1441 return ret;
1442}
1443
1444/*
1445 * This is a tee(1) implementation that works on pipes. It doesn't copy
1446 * any data, it simply references the 'in' pages on the 'out' pipe.
1447 * The 'flags' used are the SPLICE_F_* variants, currently the only
1448 * applicable one is SPLICE_F_NONBLOCK.
1449 */
1450static long do_tee(struct file *in, struct file *out, size_t len,
1451 unsigned int flags)
1452{
1453 struct pipe_inode_info *ipipe = in->f_dentry->d_inode->i_pipe;
1454 struct pipe_inode_info *opipe = out->f_dentry->d_inode->i_pipe;
1455
1456 /*
1457 * Link ipipe to the two output pipes, consuming as we go along.
1458 */
1459 if (ipipe && opipe)
1460 return link_pipe(ipipe, opipe, len, flags);
1461
1462 return -EINVAL;
1463}
1464
1465asmlinkage long sys_tee(int fdin, int fdout, size_t len, unsigned int flags)
1466{
1467 struct file *in;
1468 int error, fput_in;
1469
1470 if (unlikely(!len))
1471 return 0;
1472
1473 error = -EBADF;
1474 in = fget_light(fdin, &fput_in);
1475 if (in) {
1476 if (in->f_mode & FMODE_READ) {
1477 int fput_out;
1478 struct file *out = fget_light(fdout, &fput_out);
1479
1480 if (out) {
1481 if (out->f_mode & FMODE_WRITE)
1482 error = do_tee(in, out, len, flags);
1483 fput_light(out, fput_out);
1484 }
1485 }
1486 fput_light(in, fput_in);
1487 }
1488
1489 return error;
1490}
diff --git a/fs/stat.c b/fs/stat.c
index 9948cc1685a4..0f282face322 100644
--- a/fs/stat.c
+++ b/fs/stat.c
@@ -261,7 +261,7 @@ asmlinkage long sys_newlstat(char __user *filename, struct stat __user *statbuf)
261 return error; 261 return error;
262} 262}
263 263
264#ifndef __ARCH_WANT_STAT64 264#if !defined(__ARCH_WANT_STAT64) || defined(__ARCH_WANT_SYS_NEWFSTATAT)
265asmlinkage long sys_newfstatat(int dfd, char __user *filename, 265asmlinkage long sys_newfstatat(int dfd, char __user *filename,
266 struct stat __user *statbuf, int flag) 266 struct stat __user *statbuf, int flag)
267{ 267{
diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index 6cfdc9a87772..610b5bdbe75b 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -43,6 +43,7 @@ static struct sysfs_dirent * sysfs_new_dirent(struct sysfs_dirent * parent_sd,
43 43
44 memset(sd, 0, sizeof(*sd)); 44 memset(sd, 0, sizeof(*sd));
45 atomic_set(&sd->s_count, 1); 45 atomic_set(&sd->s_count, 1);
46 atomic_set(&sd->s_event, 0);
46 INIT_LIST_HEAD(&sd->s_children); 47 INIT_LIST_HEAD(&sd->s_children);
47 list_add(&sd->s_sibling, &parent_sd->s_children); 48 list_add(&sd->s_sibling, &parent_sd->s_children);
48 sd->s_element = element; 49 sd->s_element = element;
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
index f1cb1ddde511..cf3786625bfa 100644
--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -6,6 +6,7 @@
6#include <linux/fsnotify.h> 6#include <linux/fsnotify.h>
7#include <linux/kobject.h> 7#include <linux/kobject.h>
8#include <linux/namei.h> 8#include <linux/namei.h>
9#include <linux/poll.h>
9#include <asm/uaccess.h> 10#include <asm/uaccess.h>
10#include <asm/semaphore.h> 11#include <asm/semaphore.h>
11 12
@@ -57,6 +58,7 @@ struct sysfs_buffer {
57 struct sysfs_ops * ops; 58 struct sysfs_ops * ops;
58 struct semaphore sem; 59 struct semaphore sem;
59 int needs_read_fill; 60 int needs_read_fill;
61 int event;
60}; 62};
61 63
62 64
@@ -72,6 +74,7 @@ struct sysfs_buffer {
72 */ 74 */
73static int fill_read_buffer(struct dentry * dentry, struct sysfs_buffer * buffer) 75static int fill_read_buffer(struct dentry * dentry, struct sysfs_buffer * buffer)
74{ 76{
77 struct sysfs_dirent * sd = dentry->d_fsdata;
75 struct attribute * attr = to_attr(dentry); 78 struct attribute * attr = to_attr(dentry);
76 struct kobject * kobj = to_kobj(dentry->d_parent); 79 struct kobject * kobj = to_kobj(dentry->d_parent);
77 struct sysfs_ops * ops = buffer->ops; 80 struct sysfs_ops * ops = buffer->ops;
@@ -83,6 +86,7 @@ static int fill_read_buffer(struct dentry * dentry, struct sysfs_buffer * buffer
83 if (!buffer->page) 86 if (!buffer->page)
84 return -ENOMEM; 87 return -ENOMEM;
85 88
89 buffer->event = atomic_read(&sd->s_event);
86 count = ops->show(kobj,attr,buffer->page); 90 count = ops->show(kobj,attr,buffer->page);
87 buffer->needs_read_fill = 0; 91 buffer->needs_read_fill = 0;
88 BUG_ON(count > (ssize_t)PAGE_SIZE); 92 BUG_ON(count > (ssize_t)PAGE_SIZE);
@@ -348,12 +352,84 @@ static int sysfs_release(struct inode * inode, struct file * filp)
348 return 0; 352 return 0;
349} 353}
350 354
355/* Sysfs attribute files are pollable. The idea is that you read
356 * the content and then you use 'poll' or 'select' to wait for
357 * the content to change. When the content changes (assuming the
358 * manager for the kobject supports notification), poll will
359 * return POLLERR|POLLPRI, and select will return the fd whether
360 * it is waiting for read, write, or exceptions.
361 * Once poll/select indicates that the value has changed, you
362 * need to close and re-open the file, as simply seeking and reading
363 * again will not get new data, or reset the state of 'poll'.
364 * Reminder: this only works for attributes which actively support
365 * it, and it is not possible to test an attribute from userspace
366 * to see if it supports poll (Nether 'poll' or 'select' return
367 * an appropriate error code). When in doubt, set a suitable timeout value.
368 */
369static unsigned int sysfs_poll(struct file *filp, poll_table *wait)
370{
371 struct sysfs_buffer * buffer = filp->private_data;
372 struct kobject * kobj = to_kobj(filp->f_dentry->d_parent);
373 struct sysfs_dirent * sd = filp->f_dentry->d_fsdata;
374 int res = 0;
375
376 poll_wait(filp, &kobj->poll, wait);
377
378 if (buffer->event != atomic_read(&sd->s_event)) {
379 res = POLLERR|POLLPRI;
380 buffer->needs_read_fill = 1;
381 }
382
383 return res;
384}
385
386
387static struct dentry *step_down(struct dentry *dir, const char * name)
388{
389 struct dentry * de;
390
391 if (dir == NULL || dir->d_inode == NULL)
392 return NULL;
393
394 mutex_lock(&dir->d_inode->i_mutex);
395 de = lookup_one_len(name, dir, strlen(name));
396 mutex_unlock(&dir->d_inode->i_mutex);
397 dput(dir);
398 if (IS_ERR(de))
399 return NULL;
400 if (de->d_inode == NULL) {
401 dput(de);
402 return NULL;
403 }
404 return de;
405}
406
407void sysfs_notify(struct kobject * k, char *dir, char *attr)
408{
409 struct dentry *de = k->dentry;
410 if (de)
411 dget(de);
412 if (de && dir)
413 de = step_down(de, dir);
414 if (de && attr)
415 de = step_down(de, attr);
416 if (de) {
417 struct sysfs_dirent * sd = de->d_fsdata;
418 if (sd)
419 atomic_inc(&sd->s_event);
420 wake_up_interruptible(&k->poll);
421 dput(de);
422 }
423}
424EXPORT_SYMBOL_GPL(sysfs_notify);
425
351const struct file_operations sysfs_file_operations = { 426const struct file_operations sysfs_file_operations = {
352 .read = sysfs_read_file, 427 .read = sysfs_read_file,
353 .write = sysfs_write_file, 428 .write = sysfs_write_file,
354 .llseek = generic_file_llseek, 429 .llseek = generic_file_llseek,
355 .open = sysfs_open_file, 430 .open = sysfs_open_file,
356 .release = sysfs_release, 431 .release = sysfs_release,
432 .poll = sysfs_poll,
357}; 433};
358 434
359 435
diff --git a/fs/sysfs/sysfs.h b/fs/sysfs/sysfs.h
index 32958a7c50e9..3651ffb5ec09 100644
--- a/fs/sysfs/sysfs.h
+++ b/fs/sysfs/sysfs.h
@@ -11,6 +11,7 @@ extern int sysfs_make_dirent(struct sysfs_dirent *, struct dentry *, void *,
11 11
12extern int sysfs_add_file(struct dentry *, const struct attribute *, int); 12extern int sysfs_add_file(struct dentry *, const struct attribute *, int);
13extern void sysfs_hash_and_remove(struct dentry * dir, const char * name); 13extern void sysfs_hash_and_remove(struct dentry * dir, const char * name);
14extern struct sysfs_dirent *sysfs_find(struct sysfs_dirent *dir, const char * name);
14 15
15extern int sysfs_create_subdir(struct kobject *, const char *, struct dentry **); 16extern int sysfs_create_subdir(struct kobject *, const char *, struct dentry **);
16extern void sysfs_remove_subdir(struct dentry *); 17extern void sysfs_remove_subdir(struct dentry *);
diff --git a/fs/xfs/linux-2.6/xfs_file.c b/fs/xfs/linux-2.6/xfs_file.c
index 269721af02f3..c847416f6d10 100644
--- a/fs/xfs/linux-2.6/xfs_file.c
+++ b/fs/xfs/linux-2.6/xfs_file.c
@@ -252,6 +252,7 @@ xfs_file_sendfile_invis(
252STATIC ssize_t 252STATIC ssize_t
253xfs_file_splice_read( 253xfs_file_splice_read(
254 struct file *infilp, 254 struct file *infilp,
255 loff_t *ppos,
255 struct pipe_inode_info *pipe, 256 struct pipe_inode_info *pipe,
256 size_t len, 257 size_t len,
257 unsigned int flags) 258 unsigned int flags)
@@ -259,13 +260,14 @@ xfs_file_splice_read(
259 vnode_t *vp = vn_from_inode(infilp->f_dentry->d_inode); 260 vnode_t *vp = vn_from_inode(infilp->f_dentry->d_inode);
260 ssize_t rval; 261 ssize_t rval;
261 262
262 VOP_SPLICE_READ(vp, infilp, pipe, len, flags, 0, NULL, rval); 263 VOP_SPLICE_READ(vp, infilp, ppos, pipe, len, flags, 0, NULL, rval);
263 return rval; 264 return rval;
264} 265}
265 266
266STATIC ssize_t 267STATIC ssize_t
267xfs_file_splice_read_invis( 268xfs_file_splice_read_invis(
268 struct file *infilp, 269 struct file *infilp,
270 loff_t *ppos,
269 struct pipe_inode_info *pipe, 271 struct pipe_inode_info *pipe,
270 size_t len, 272 size_t len,
271 unsigned int flags) 273 unsigned int flags)
@@ -273,7 +275,7 @@ xfs_file_splice_read_invis(
273 vnode_t *vp = vn_from_inode(infilp->f_dentry->d_inode); 275 vnode_t *vp = vn_from_inode(infilp->f_dentry->d_inode);
274 ssize_t rval; 276 ssize_t rval;
275 277
276 VOP_SPLICE_READ(vp, infilp, pipe, len, flags, IO_INVIS, NULL, rval); 278 VOP_SPLICE_READ(vp, infilp, ppos, pipe, len, flags, IO_INVIS, NULL, rval);
277 return rval; 279 return rval;
278} 280}
279 281
@@ -281,13 +283,14 @@ STATIC ssize_t
281xfs_file_splice_write( 283xfs_file_splice_write(
282 struct pipe_inode_info *pipe, 284 struct pipe_inode_info *pipe,
283 struct file *outfilp, 285 struct file *outfilp,
286 loff_t *ppos,
284 size_t len, 287 size_t len,
285 unsigned int flags) 288 unsigned int flags)
286{ 289{
287 vnode_t *vp = vn_from_inode(outfilp->f_dentry->d_inode); 290 vnode_t *vp = vn_from_inode(outfilp->f_dentry->d_inode);
288 ssize_t rval; 291 ssize_t rval;
289 292
290 VOP_SPLICE_WRITE(vp, pipe, outfilp, len, flags, 0, NULL, rval); 293 VOP_SPLICE_WRITE(vp, pipe, outfilp, ppos, len, flags, 0, NULL, rval);
291 return rval; 294 return rval;
292} 295}
293 296
@@ -295,13 +298,14 @@ STATIC ssize_t
295xfs_file_splice_write_invis( 298xfs_file_splice_write_invis(
296 struct pipe_inode_info *pipe, 299 struct pipe_inode_info *pipe,
297 struct file *outfilp, 300 struct file *outfilp,
301 loff_t *ppos,
298 size_t len, 302 size_t len,
299 unsigned int flags) 303 unsigned int flags)
300{ 304{
301 vnode_t *vp = vn_from_inode(outfilp->f_dentry->d_inode); 305 vnode_t *vp = vn_from_inode(outfilp->f_dentry->d_inode);
302 ssize_t rval; 306 ssize_t rval;
303 307
304 VOP_SPLICE_WRITE(vp, pipe, outfilp, len, flags, IO_INVIS, NULL, rval); 308 VOP_SPLICE_WRITE(vp, pipe, outfilp, ppos, len, flags, IO_INVIS, NULL, rval);
305 return rval; 309 return rval;
306} 310}
307 311
diff --git a/fs/xfs/linux-2.6/xfs_lrw.c b/fs/xfs/linux-2.6/xfs_lrw.c
index 74a52937f208..67efe3308980 100644
--- a/fs/xfs/linux-2.6/xfs_lrw.c
+++ b/fs/xfs/linux-2.6/xfs_lrw.c
@@ -338,6 +338,7 @@ ssize_t
338xfs_splice_read( 338xfs_splice_read(
339 bhv_desc_t *bdp, 339 bhv_desc_t *bdp,
340 struct file *infilp, 340 struct file *infilp,
341 loff_t *ppos,
341 struct pipe_inode_info *pipe, 342 struct pipe_inode_info *pipe,
342 size_t count, 343 size_t count,
343 int flags, 344 int flags,
@@ -360,7 +361,7 @@ xfs_splice_read(
360 int error; 361 int error;
361 362
362 error = XFS_SEND_DATA(mp, DM_EVENT_READ, BHV_TO_VNODE(bdp), 363 error = XFS_SEND_DATA(mp, DM_EVENT_READ, BHV_TO_VNODE(bdp),
363 infilp->f_pos, count, 364 *ppos, count,
364 FILP_DELAY_FLAG(infilp), &locktype); 365 FILP_DELAY_FLAG(infilp), &locktype);
365 if (error) { 366 if (error) {
366 xfs_iunlock(ip, XFS_IOLOCK_SHARED); 367 xfs_iunlock(ip, XFS_IOLOCK_SHARED);
@@ -368,8 +369,8 @@ xfs_splice_read(
368 } 369 }
369 } 370 }
370 xfs_rw_enter_trace(XFS_SPLICE_READ_ENTER, &ip->i_iocore, 371 xfs_rw_enter_trace(XFS_SPLICE_READ_ENTER, &ip->i_iocore,
371 pipe, count, infilp->f_pos, ioflags); 372 pipe, count, *ppos, ioflags);
372 ret = generic_file_splice_read(infilp, pipe, count, flags); 373 ret = generic_file_splice_read(infilp, ppos, pipe, count, flags);
373 if (ret > 0) 374 if (ret > 0)
374 XFS_STATS_ADD(xs_read_bytes, ret); 375 XFS_STATS_ADD(xs_read_bytes, ret);
375 376
@@ -382,6 +383,7 @@ xfs_splice_write(
382 bhv_desc_t *bdp, 383 bhv_desc_t *bdp,
383 struct pipe_inode_info *pipe, 384 struct pipe_inode_info *pipe,
384 struct file *outfilp, 385 struct file *outfilp,
386 loff_t *ppos,
385 size_t count, 387 size_t count,
386 int flags, 388 int flags,
387 int ioflags, 389 int ioflags,
@@ -403,7 +405,7 @@ xfs_splice_write(
403 int error; 405 int error;
404 406
405 error = XFS_SEND_DATA(mp, DM_EVENT_WRITE, BHV_TO_VNODE(bdp), 407 error = XFS_SEND_DATA(mp, DM_EVENT_WRITE, BHV_TO_VNODE(bdp),
406 outfilp->f_pos, count, 408 *ppos, count,
407 FILP_DELAY_FLAG(outfilp), &locktype); 409 FILP_DELAY_FLAG(outfilp), &locktype);
408 if (error) { 410 if (error) {
409 xfs_iunlock(ip, XFS_IOLOCK_EXCL); 411 xfs_iunlock(ip, XFS_IOLOCK_EXCL);
@@ -411,8 +413,8 @@ xfs_splice_write(
411 } 413 }
412 } 414 }
413 xfs_rw_enter_trace(XFS_SPLICE_WRITE_ENTER, &ip->i_iocore, 415 xfs_rw_enter_trace(XFS_SPLICE_WRITE_ENTER, &ip->i_iocore,
414 pipe, count, outfilp->f_pos, ioflags); 416 pipe, count, *ppos, ioflags);
415 ret = generic_file_splice_write(pipe, outfilp, count, flags); 417 ret = generic_file_splice_write(pipe, outfilp, ppos, count, flags);
416 if (ret > 0) 418 if (ret > 0)
417 XFS_STATS_ADD(xs_write_bytes, ret); 419 XFS_STATS_ADD(xs_write_bytes, ret);
418 420
diff --git a/fs/xfs/linux-2.6/xfs_lrw.h b/fs/xfs/linux-2.6/xfs_lrw.h
index 55c689a86ad2..8f4539952350 100644
--- a/fs/xfs/linux-2.6/xfs_lrw.h
+++ b/fs/xfs/linux-2.6/xfs_lrw.h
@@ -93,11 +93,11 @@ extern ssize_t xfs_write(struct bhv_desc *, struct kiocb *,
93extern ssize_t xfs_sendfile(struct bhv_desc *, struct file *, 93extern ssize_t xfs_sendfile(struct bhv_desc *, struct file *,
94 loff_t *, int, size_t, read_actor_t, 94 loff_t *, int, size_t, read_actor_t,
95 void *, struct cred *); 95 void *, struct cred *);
96extern ssize_t xfs_splice_read(struct bhv_desc *, struct file *, 96extern ssize_t xfs_splice_read(struct bhv_desc *, struct file *, loff_t *,
97 struct pipe_inode_info *, size_t, int, int, 97 struct pipe_inode_info *, size_t, int, int,
98 struct cred *); 98 struct cred *);
99extern ssize_t xfs_splice_write(struct bhv_desc *, struct pipe_inode_info *, 99extern ssize_t xfs_splice_write(struct bhv_desc *, struct pipe_inode_info *,
100 struct file *, size_t, int, int, 100 struct file *, loff_t *, size_t, int, int,
101 struct cred *); 101 struct cred *);
102 102
103#endif /* __XFS_LRW_H__ */ 103#endif /* __XFS_LRW_H__ */
diff --git a/fs/xfs/linux-2.6/xfs_vnode.h b/fs/xfs/linux-2.6/xfs_vnode.h
index 88b09f186289..2a8e16c22353 100644
--- a/fs/xfs/linux-2.6/xfs_vnode.h
+++ b/fs/xfs/linux-2.6/xfs_vnode.h
@@ -173,11 +173,11 @@ typedef ssize_t (*vop_write_t)(bhv_desc_t *, struct kiocb *,
173typedef ssize_t (*vop_sendfile_t)(bhv_desc_t *, struct file *, 173typedef ssize_t (*vop_sendfile_t)(bhv_desc_t *, struct file *,
174 loff_t *, int, size_t, read_actor_t, 174 loff_t *, int, size_t, read_actor_t,
175 void *, struct cred *); 175 void *, struct cred *);
176typedef ssize_t (*vop_splice_read_t)(bhv_desc_t *, struct file *, 176typedef ssize_t (*vop_splice_read_t)(bhv_desc_t *, struct file *, loff_t *,
177 struct pipe_inode_info *, size_t, int, int, 177 struct pipe_inode_info *, size_t, int, int,
178 struct cred *); 178 struct cred *);
179typedef ssize_t (*vop_splice_write_t)(bhv_desc_t *, struct pipe_inode_info *, 179typedef ssize_t (*vop_splice_write_t)(bhv_desc_t *, struct pipe_inode_info *,
180 struct file *, size_t, int, int, 180 struct file *, loff_t *, size_t, int, int,
181 struct cred *); 181 struct cred *);
182typedef int (*vop_ioctl_t)(bhv_desc_t *, struct inode *, struct file *, 182typedef int (*vop_ioctl_t)(bhv_desc_t *, struct inode *, struct file *,
183 int, unsigned int, void __user *); 183 int, unsigned int, void __user *);
@@ -284,10 +284,10 @@ typedef struct vnodeops {
284 rv = _VOP_(vop_write, vp)((vp)->v_fbhv,file,iov,segs,offset,ioflags,cr) 284 rv = _VOP_(vop_write, vp)((vp)->v_fbhv,file,iov,segs,offset,ioflags,cr)
285#define VOP_SENDFILE(vp,f,off,ioflags,cnt,act,targ,cr,rv) \ 285#define VOP_SENDFILE(vp,f,off,ioflags,cnt,act,targ,cr,rv) \
286 rv = _VOP_(vop_sendfile, vp)((vp)->v_fbhv,f,off,ioflags,cnt,act,targ,cr) 286 rv = _VOP_(vop_sendfile, vp)((vp)->v_fbhv,f,off,ioflags,cnt,act,targ,cr)
287#define VOP_SPLICE_READ(vp,f,pipe,cnt,fl,iofl,cr,rv) \ 287#define VOP_SPLICE_READ(vp,f,o,pipe,cnt,fl,iofl,cr,rv) \
288 rv = _VOP_(vop_splice_read, vp)((vp)->v_fbhv,f,pipe,cnt,fl,iofl,cr) 288 rv = _VOP_(vop_splice_read, vp)((vp)->v_fbhv,f,o,pipe,cnt,fl,iofl,cr)
289#define VOP_SPLICE_WRITE(vp,f,pipe,cnt,fl,iofl,cr,rv) \ 289#define VOP_SPLICE_WRITE(vp,f,o,pipe,cnt,fl,iofl,cr,rv) \
290 rv = _VOP_(vop_splice_write, vp)((vp)->v_fbhv,f,pipe,cnt,fl,iofl,cr) 290 rv = _VOP_(vop_splice_write, vp)((vp)->v_fbhv,f,o,pipe,cnt,fl,iofl,cr)
291#define VOP_BMAP(vp,of,sz,rw,b,n,rv) \ 291#define VOP_BMAP(vp,of,sz,rw,b,n,rv) \
292 rv = _VOP_(vop_bmap, vp)((vp)->v_fbhv,of,sz,rw,b,n) 292 rv = _VOP_(vop_bmap, vp)((vp)->v_fbhv,of,sz,rw,b,n)
293#define VOP_OPEN(vp, cr, rv) \ 293#define VOP_OPEN(vp, cr, rv) \
diff --git a/fs/xfs/xfs_alloc.c b/fs/xfs/xfs_alloc.c
index 64ee07db0d5e..8558226281c4 100644
--- a/fs/xfs/xfs_alloc.c
+++ b/fs/xfs/xfs_alloc.c
@@ -1942,8 +1942,10 @@ xfs_alloc_fix_freelist(
1942 /* 1942 /*
1943 * Allocate as many blocks as possible at once. 1943 * Allocate as many blocks as possible at once.
1944 */ 1944 */
1945 if ((error = xfs_alloc_ag_vextent(&targs))) 1945 if ((error = xfs_alloc_ag_vextent(&targs))) {
1946 xfs_trans_brelse(tp, agflbp);
1946 return error; 1947 return error;
1948 }
1947 /* 1949 /*
1948 * Stop if we run out. Won't happen if callers are obeying 1950 * Stop if we run out. Won't happen if callers are obeying
1949 * the restrictions correctly. Can happen for free calls 1951 * the restrictions correctly. Can happen for free calls
@@ -1960,6 +1962,7 @@ xfs_alloc_fix_freelist(
1960 return error; 1962 return error;
1961 } 1963 }
1962 } 1964 }
1965 xfs_trans_brelse(tp, agflbp);
1963 args->agbp = agbp; 1966 args->agbp = agbp;
1964 return 0; 1967 return 0;
1965} 1968}
diff --git a/fs/xfs/xfs_rename.c b/fs/xfs/xfs_rename.c
index 81a05cfd77d2..1f148762eb28 100644
--- a/fs/xfs/xfs_rename.c
+++ b/fs/xfs/xfs_rename.c
@@ -316,6 +316,18 @@ xfs_rename(
316 } 316 }
317 } 317 }
318 318
319 /*
320 * If we are using project inheritance, we only allow renames
321 * into our tree when the project IDs are the same; else the
322 * tree quota mechanism would be circumvented.
323 */
324 if (unlikely((target_dp->i_d.di_flags & XFS_DIFLAG_PROJINHERIT) &&
325 (target_dp->i_d.di_projid != src_ip->i_d.di_projid))) {
326 error = XFS_ERROR(EXDEV);
327 xfs_rename_unlock4(inodes, XFS_ILOCK_SHARED);
328 goto rele_return;
329 }
330
319 new_parent = (src_dp != target_dp); 331 new_parent = (src_dp != target_dp);
320 src_is_directory = ((src_ip->i_d.di_mode & S_IFMT) == S_IFDIR); 332 src_is_directory = ((src_ip->i_d.di_mode & S_IFMT) == S_IFDIR);
321 333
diff --git a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c
index f0e09ca14139..36ea1b2094f2 100644
--- a/fs/xfs/xfs_vfsops.c
+++ b/fs/xfs/xfs_vfsops.c
@@ -669,31 +669,22 @@ xfs_mntupdate(
669 xfs_mount_t *mp = XFS_BHVTOM(bdp); 669 xfs_mount_t *mp = XFS_BHVTOM(bdp);
670 int error; 670 int error;
671 671
672 if (args->flags & XFSMNT_BARRIER) 672 if (!(*flags & MS_RDONLY)) { /* rw/ro -> rw */
673 mp->m_flags |= XFS_MOUNT_BARRIER; 673 if (vfsp->vfs_flag & VFS_RDONLY)
674 else 674 vfsp->vfs_flag &= ~VFS_RDONLY;
675 mp->m_flags &= ~XFS_MOUNT_BARRIER; 675 if (args->flags & XFSMNT_BARRIER) {
676 676 mp->m_flags |= XFS_MOUNT_BARRIER;
677 if ((vfsp->vfs_flag & VFS_RDONLY) &&
678 !(*flags & MS_RDONLY)) {
679 vfsp->vfs_flag &= ~VFS_RDONLY;
680
681 if (args->flags & XFSMNT_BARRIER)
682 xfs_mountfs_check_barriers(mp); 677 xfs_mountfs_check_barriers(mp);
683 } 678 } else {
684 679 mp->m_flags &= ~XFS_MOUNT_BARRIER;
685 if (!(vfsp->vfs_flag & VFS_RDONLY) && 680 }
686 (*flags & MS_RDONLY)) { 681 } else if (!(vfsp->vfs_flag & VFS_RDONLY)) { /* rw -> ro */
687 VFS_SYNC(vfsp, SYNC_FSDATA|SYNC_BDFLUSH|SYNC_ATTR, NULL, error); 682 VFS_SYNC(vfsp, SYNC_FSDATA|SYNC_BDFLUSH|SYNC_ATTR, NULL, error);
688
689 xfs_quiesce_fs(mp); 683 xfs_quiesce_fs(mp);
690
691 /* Ok now write out an unmount record */
692 xfs_log_unmount_write(mp); 684 xfs_log_unmount_write(mp);
693 xfs_unmountfs_writesb(mp); 685 xfs_unmountfs_writesb(mp);
694 vfsp->vfs_flag |= VFS_RDONLY; 686 vfsp->vfs_flag |= VFS_RDONLY;
695 } 687 }
696
697 return 0; 688 return 0;
698} 689}
699 690
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
index fa71b305ba5c..7027ae68ee38 100644
--- a/fs/xfs/xfs_vnodeops.c
+++ b/fs/xfs/xfs_vnodeops.c
@@ -2663,7 +2663,7 @@ xfs_link(
2663 */ 2663 */
2664 if (unlikely((tdp->i_d.di_flags & XFS_DIFLAG_PROJINHERIT) && 2664 if (unlikely((tdp->i_d.di_flags & XFS_DIFLAG_PROJINHERIT) &&
2665 (tdp->i_d.di_projid != sip->i_d.di_projid))) { 2665 (tdp->i_d.di_projid != sip->i_d.di_projid))) {
2666 error = XFS_ERROR(EPERM); 2666 error = XFS_ERROR(EXDEV);
2667 goto error_return; 2667 goto error_return;
2668 } 2668 }
2669 2669
diff --git a/include/asm-alpha/smp.h b/include/asm-alpha/smp.h
index 9950706abdf8..e1432102be05 100644
--- a/include/asm-alpha/smp.h
+++ b/include/asm-alpha/smp.h
@@ -45,10 +45,8 @@ extern struct cpuinfo_alpha cpu_data[NR_CPUS];
45#define hard_smp_processor_id() __hard_smp_processor_id() 45#define hard_smp_processor_id() __hard_smp_processor_id()
46#define raw_smp_processor_id() (current_thread_info()->cpu) 46#define raw_smp_processor_id() (current_thread_info()->cpu)
47 47
48extern cpumask_t cpu_present_mask;
49extern cpumask_t cpu_online_map;
50extern int smp_num_cpus; 48extern int smp_num_cpus;
51#define cpu_possible_map cpu_present_mask 49#define cpu_possible_map cpu_present_map
52 50
53int smp_call_function_on_cpu(void (*func) (void *info), void *info,int retry, int wait, cpumask_t cpu); 51int smp_call_function_on_cpu(void (*func) (void *info), void *info,int retry, int wait, cpumask_t cpu);
54 52
diff --git a/include/asm-alpha/termbits.h b/include/asm-alpha/termbits.h
index f4837fa29420..5541101b58ae 100644
--- a/include/asm-alpha/termbits.h
+++ b/include/asm-alpha/termbits.h
@@ -148,6 +148,7 @@ struct termios {
148#define HUPCL 00040000 148#define HUPCL 00040000
149 149
150#define CLOCAL 00100000 150#define CLOCAL 00100000
151#define CMSPAR 010000000000 /* mark or space (stick) parity */
151#define CRTSCTS 020000000000 /* flow control */ 152#define CRTSCTS 020000000000 /* flow control */
152 153
153/* c_lflag bits */ 154/* c_lflag bits */
diff --git a/include/asm-arm/arch-aaec2000/debug-macro.S b/include/asm-arm/arch-aaec2000/debug-macro.S
index e4f1fa539a74..7b1fce021d8a 100644
--- a/include/asm-arm/arch-aaec2000/debug-macro.S
+++ b/include/asm-arm/arch-aaec2000/debug-macro.S
@@ -9,6 +9,7 @@
9 * published by the Free Software Foundation. 9 * published by the Free Software Foundation.
10 */ 10 */
11 11
12#include "hardware.h"
12 .macro addruart,rx 13 .macro addruart,rx
13 mrc p15, 0, \rx, c1, c0 14 mrc p15, 0, \rx, c1, c0
14 tst \rx, #1 @ MMU enabled? 15 tst \rx, #1 @ MMU enabled?
diff --git a/include/asm-arm/arch-aaec2000/entry-macro.S b/include/asm-arm/arch-aaec2000/entry-macro.S
index df31313ab07e..1eb3503bd16e 100644
--- a/include/asm-arm/arch-aaec2000/entry-macro.S
+++ b/include/asm-arm/arch-aaec2000/entry-macro.S
@@ -10,6 +10,7 @@
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
11 * 11 *
12 */ 12 */
13#include <asm/arch/irqs.h>
13 14
14 .macro disable_fiq 15 .macro disable_fiq
15 .endm 16 .endm
diff --git a/include/asm-arm/arch-imx/debug-macro.S b/include/asm-arm/arch-imx/debug-macro.S
index 83f552f7bcc1..c611871643a2 100644
--- a/include/asm-arm/arch-imx/debug-macro.S
+++ b/include/asm-arm/arch-imx/debug-macro.S
@@ -16,7 +16,7 @@
16 tst \rx, #1 @ MMU enabled? 16 tst \rx, #1 @ MMU enabled?
17 moveq \rx, #0x00000000 @ physical 17 moveq \rx, #0x00000000 @ physical
18 movne \rx, #0xe0000000 @ virtual 18 movne \rx, #0xe0000000 @ virtual
19 orr \rx, \rx, #0x00200000 19 orreq \rx, \rx, #0x00200000 @ physical
20 orr \rx, \rx, #0x00006000 @ UART1 offset 20 orr \rx, \rx, #0x00006000 @ UART1 offset
21 .endm 21 .endm
22 22
diff --git a/include/asm-arm/arch-imx/imx-uart.h b/include/asm-arm/arch-imx/imx-uart.h
new file mode 100644
index 000000000000..3a685e1780ea
--- /dev/null
+++ b/include/asm-arm/arch-imx/imx-uart.h
@@ -0,0 +1,10 @@
1#ifndef ASMARM_ARCH_UART_H
2#define ASMARM_ARCH_UART_H
3
4#define IMXUART_HAVE_RTSCTS (1<<0)
5
6struct imxuart_platform_data {
7 unsigned int flags;
8};
9
10#endif
diff --git a/include/asm-arm/arch-ixp23xx/memory.h b/include/asm-arm/arch-ixp23xx/memory.h
index 6e19f46d54d1..c85fc06a043c 100644
--- a/include/asm-arm/arch-ixp23xx/memory.h
+++ b/include/asm-arm/arch-ixp23xx/memory.h
@@ -49,7 +49,7 @@ static inline int __ixp23xx_arch_is_coherent(void)
49{ 49{
50 extern unsigned int processor_id; 50 extern unsigned int processor_id;
51 51
52 if (((processor_id & 15) >= 2) || machine_is_roadrunner()) 52 if (((processor_id & 15) >= 4) || machine_is_roadrunner())
53 return 1; 53 return 1;
54 54
55 return 0; 55 return 0;
diff --git a/include/asm-arm/arch-ixp4xx/io.h b/include/asm-arm/arch-ixp4xx/io.h
index 942b622455bc..b59520e56fc7 100644
--- a/include/asm-arm/arch-ixp4xx/io.h
+++ b/include/asm-arm/arch-ixp4xx/io.h
@@ -260,6 +260,12 @@ out:
260 260
261#endif 261#endif
262 262
263#ifndef CONFIG_PCI
264
265#define __io(v) v
266
267#else
268
263/* 269/*
264 * IXP4xx does not have a transparent cpu -> PCI I/O translation 270 * IXP4xx does not have a transparent cpu -> PCI I/O translation
265 * window. Instead, it has a set of registers that must be tweaked 271 * window. Instead, it has a set of registers that must be tweaked
@@ -578,6 +584,7 @@ __ixp4xx_iowrite32_rep(void __iomem *addr, const void *vaddr, u32 count)
578 584
579#define ioport_map(port, nr) ((void __iomem*)(port + PIO_OFFSET)) 585#define ioport_map(port, nr) ((void __iomem*)(port + PIO_OFFSET))
580#define ioport_unmap(addr) 586#define ioport_unmap(addr)
587#endif // !CONFIG_PCI
581 588
582#endif // __ASM_ARM_ARCH_IO_H 589#endif // __ASM_ARM_ARCH_IO_H
583 590
diff --git a/include/asm-arm/arch-ixp4xx/memory.h b/include/asm-arm/arch-ixp4xx/memory.h
index ee211d28a3ef..af9667b57ab3 100644
--- a/include/asm-arm/arch-ixp4xx/memory.h
+++ b/include/asm-arm/arch-ixp4xx/memory.h
@@ -14,7 +14,7 @@
14 */ 14 */
15#define PHYS_OFFSET UL(0x00000000) 15#define PHYS_OFFSET UL(0x00000000)
16 16
17#ifndef __ASSEMBLY__ 17#if !defined(__ASSEMBLY__) && defined(CONFIG_PCI)
18 18
19void ixp4xx_adjust_zones(int node, unsigned long *size, unsigned long *holes); 19void ixp4xx_adjust_zones(int node, unsigned long *size, unsigned long *holes);
20 20
diff --git a/include/asm-arm/arch-l7200/serial_l7200.h b/include/asm-arm/arch-l7200/serial_l7200.h
index 238c595d97ea..b1008a9d23e5 100644
--- a/include/asm-arm/arch-l7200/serial_l7200.h
+++ b/include/asm-arm/arch-l7200/serial_l7200.h
@@ -28,7 +28,7 @@
28#define UARTDR 0x00 /* Tx/Rx data */ 28#define UARTDR 0x00 /* Tx/Rx data */
29#define RXSTAT 0x04 /* Rx status */ 29#define RXSTAT 0x04 /* Rx status */
30#define H_UBRLCR 0x08 /* mode register high */ 30#define H_UBRLCR 0x08 /* mode register high */
31#define M_UBRLCR 0x0C /* mode reg mid (MSB of buad)*/ 31#define M_UBRLCR 0x0C /* mode reg mid (MSB of baud)*/
32#define L_UBRLCR 0x10 /* mode reg low (LSB of baud)*/ 32#define L_UBRLCR 0x10 /* mode reg low (LSB of baud)*/
33#define UARTCON 0x14 /* control register */ 33#define UARTCON 0x14 /* control register */
34#define UARTFLG 0x18 /* flag register */ 34#define UARTFLG 0x18 /* flag register */
diff --git a/include/asm-arm/arch-l7200/uncompress.h b/include/asm-arm/arch-l7200/uncompress.h
index 9fcd40aee3e3..04be2a088639 100644
--- a/include/asm-arm/arch-l7200/uncompress.h
+++ b/include/asm-arm/arch-l7200/uncompress.h
@@ -6,7 +6,7 @@
6 * Changelog: 6 * Changelog:
7 * 05-01-2000 SJH Created 7 * 05-01-2000 SJH Created
8 * 05-13-2000 SJH Filled in function bodies 8 * 05-13-2000 SJH Filled in function bodies
9 * 07-26-2000 SJH Removed hard coded buad rate 9 * 07-26-2000 SJH Removed hard coded baud rate
10 */ 10 */
11 11
12#include <asm/hardware.h> 12#include <asm/hardware.h>
diff --git a/include/asm-arm/arch-pxa/dma.h b/include/asm-arm/arch-pxa/dma.h
index 3e88a2a02a0f..a008150abc59 100644
--- a/include/asm-arm/arch-pxa/dma.h
+++ b/include/asm-arm/arch-pxa/dma.h
@@ -24,27 +24,29 @@ typedef struct pxa_dma_desc {
24 volatile u32 dcmd; /* DCMD value for the current transfer */ 24 volatile u32 dcmd; /* DCMD value for the current transfer */
25} pxa_dma_desc; 25} pxa_dma_desc;
26 26
27typedef enum {
28 DMA_PRIO_HIGH = 0,
29 DMA_PRIO_MEDIUM = 1,
30 DMA_PRIO_LOW = 2
31} pxa_dma_prio;
32
27#if defined(CONFIG_PXA27x) 33#if defined(CONFIG_PXA27x)
28 34
29#define PXA_DMA_CHANNELS 32 35#define PXA_DMA_CHANNELS 32
30#define PXA_DMA_NBCH(prio) ((prio == DMA_PRIO_LOW) ? 16 : 8)
31 36
32typedef enum { 37#define pxa_for_each_dma_prio(ch, prio) \
33 DMA_PRIO_HIGH = 0, 38for ( \
34 DMA_PRIO_MEDIUM = 8, 39 ch = prio * 4; \
35 DMA_PRIO_LOW = 16 40 ch != (4 << prio) + 16; \
36} pxa_dma_prio; 41 ch = (ch + 1 == (4 << prio)) ? (prio * 4 + 16) : (ch + 1) \
42)
37 43
38#elif defined(CONFIG_PXA25x) 44#elif defined(CONFIG_PXA25x)
39 45
40#define PXA_DMA_CHANNELS 16 46#define PXA_DMA_CHANNELS 16
41#define PXA_DMA_NBCH(prio) ((prio == DMA_PRIO_LOW) ? 8 : 4)
42 47
43typedef enum { 48#define pxa_for_each_dma_prio(ch, prio) \
44 DMA_PRIO_HIGH = 0, 49 for (ch = prio * 4; ch != (4 << prio); ch++)
45 DMA_PRIO_MEDIUM = 4,
46 DMA_PRIO_LOW = 8
47} pxa_dma_prio;
48 50
49#endif 51#endif
50 52
diff --git a/include/asm-arm/arch-pxa/pxa2xx_spi.h b/include/asm-arm/arch-pxa/pxa2xx_spi.h
new file mode 100644
index 000000000000..915590c391c8
--- /dev/null
+++ b/include/asm-arm/arch-pxa/pxa2xx_spi.h
@@ -0,0 +1,71 @@
1/*
2 * Copyright (C) 2005 Stephen Street / StreetFire Sound Labs
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 */
18
19#ifndef PXA2XX_SPI_H_
20#define PXA2XX_SPI_H_
21
22#define PXA2XX_CS_ASSERT (0x01)
23#define PXA2XX_CS_DEASSERT (0x02)
24
25#if defined(CONFIG_PXA25x)
26#define CLOCK_SPEED_HZ 3686400
27#define SSP1_SerClkDiv(x) (((CLOCK_SPEED_HZ/2/(x+1))<<8)&0x0000ff00)
28#define SSP2_SerClkDiv(x) (((CLOCK_SPEED_HZ/(x+1))<<8)&0x000fff00)
29#define SSP3_SerClkDiv(x) (((CLOCK_SPEED_HZ/(x+1))<<8)&0x000fff00)
30#define SSP_TIMEOUT_SCALE (2712)
31#elif defined(CONFIG_PXA27x)
32#define CLOCK_SPEED_HZ 13000000
33#define SSP1_SerClkDiv(x) (((CLOCK_SPEED_HZ/(x+1))<<8)&0x000fff00)
34#define SSP2_SerClkDiv(x) (((CLOCK_SPEED_HZ/(x+1))<<8)&0x000fff00)
35#define SSP3_SerClkDiv(x) (((CLOCK_SPEED_HZ/(x+1))<<8)&0x000fff00)
36#define SSP_TIMEOUT_SCALE (769)
37#endif
38
39#define SSP_TIMEOUT(x) ((x*10000)/SSP_TIMEOUT_SCALE)
40#define SSP1_VIRT ((void *)(io_p2v(__PREG(SSCR0_P(1)))))
41#define SSP2_VIRT ((void *)(io_p2v(__PREG(SSCR0_P(2)))))
42#define SSP3_VIRT ((void *)(io_p2v(__PREG(SSCR0_P(3)))))
43
44enum pxa_ssp_type {
45 SSP_UNDEFINED = 0,
46 PXA25x_SSP, /* pxa 210, 250, 255, 26x */
47 PXA25x_NSSP, /* pxa 255, 26x (including ASSP) */
48 PXA27x_SSP,
49};
50
51/* device.platform_data for SSP controller devices */
52struct pxa2xx_spi_master {
53 enum pxa_ssp_type ssp_type;
54 u32 clock_enable;
55 u16 num_chipselect;
56 u8 enable_dma;
57};
58
59/* spi_board_info.controller_data for SPI slave devices,
60 * copied to spi_device.platform_data ... mostly for dma tuning
61 */
62struct pxa2xx_spi_chip {
63 u8 tx_threshold;
64 u8 rx_threshold;
65 u8 dma_burst_size;
66 u32 timeout_microsecs;
67 u8 enable_loopback;
68 void (*cs_control)(u32 command);
69};
70
71#endif /*PXA2XX_SPI_H_*/
diff --git a/include/asm-arm/arch-s3c2410/spi-gpio.h b/include/asm-arm/arch-s3c2410/spi-gpio.h
new file mode 100644
index 000000000000..258c00bca270
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/spi-gpio.h
@@ -0,0 +1,31 @@
1/* linux/include/asm-arm/arch-s3c2410/spi.h
2 *
3 * Copyright (c) 2006 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * S3C2410 - SPI Controller platfrom_device info
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_ARCH_SPIGPIO_H
14#define __ASM_ARCH_SPIGPIO_H __FILE__
15
16struct s3c2410_spigpio_info;
17struct spi_board_info;
18
19struct s3c2410_spigpio_info {
20 unsigned long pin_clk;
21 unsigned long pin_mosi;
22 unsigned long pin_miso;
23
24 unsigned long board_size;
25 struct spi_board_info *board_info;
26
27 void (*chip_select)(struct s3c2410_spigpio_info *spi, int cs);
28};
29
30
31#endif /* __ASM_ARCH_SPIGPIO_H */
diff --git a/include/asm-arm/arch-s3c2410/spi.h b/include/asm-arm/arch-s3c2410/spi.h
new file mode 100644
index 000000000000..4029a1a1ab40
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/spi.h
@@ -0,0 +1,29 @@
1/* linux/include/asm-arm/arch-s3c2410/spi.h
2 *
3 * Copyright (c) 2006 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * S3C2410 - SPI Controller platform_device info
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_ARCH_SPI_H
14#define __ASM_ARCH_SPI_H __FILE__
15
16struct s3c2410_spi_info;
17struct spi_board_info;
18
19struct s3c2410_spi_info {
20 unsigned long pin_cs; /* simple gpio cs */
21
22 unsigned long board_size;
23 struct spi_board_info *board_info;
24
25 void (*set_cs)(struct s3c2410_spi_info *spi, int cs, int pol);
26};
27
28
29#endif /* __ASM_ARCH_SPI_H */
diff --git a/include/asm-arm/bug.h b/include/asm-arm/bug.h
index 7fb02138f585..5ab8216f5204 100644
--- a/include/asm-arm/bug.h
+++ b/include/asm-arm/bug.h
@@ -2,6 +2,7 @@
2#define _ASMARM_BUG_H 2#define _ASMARM_BUG_H
3 3
4#include <linux/config.h> 4#include <linux/config.h>
5#include <linux/stddef.h>
5 6
6#ifdef CONFIG_BUG 7#ifdef CONFIG_BUG
7#ifdef CONFIG_DEBUG_BUGVERBOSE 8#ifdef CONFIG_DEBUG_BUGVERBOSE
diff --git a/include/asm-arm/procinfo.h b/include/asm-arm/procinfo.h
index a9c75b2c314f..842526055225 100644
--- a/include/asm-arm/procinfo.h
+++ b/include/asm-arm/procinfo.h
@@ -45,8 +45,6 @@ extern unsigned int elf_hwcap;
45 45
46#endif /* __ASSEMBLY__ */ 46#endif /* __ASSEMBLY__ */
47 47
48#define PROC_INFO_SZ 48
49
50#define HWCAP_SWP 1 48#define HWCAP_SWP 1
51#define HWCAP_HALF 2 49#define HWCAP_HALF 2
52#define HWCAP_THUMB 4 50#define HWCAP_THUMB 4
diff --git a/include/asm-arm/spinlock.h b/include/asm-arm/spinlock.h
index 43ad4e55878c..406ca97a8ab2 100644
--- a/include/asm-arm/spinlock.h
+++ b/include/asm-arm/spinlock.h
@@ -142,6 +142,9 @@ static inline void __raw_write_unlock(raw_rwlock_t *rw)
142 : "cc"); 142 : "cc");
143} 143}
144 144
145/* write_can_lock - would write_trylock() succeed? */
146#define __raw_write_can_lock(x) ((x)->lock == 0x80000000)
147
145/* 148/*
146 * Read locks are a bit more hairy: 149 * Read locks are a bit more hairy:
147 * - Exclusively load the lock value. 150 * - Exclusively load the lock value.
@@ -198,4 +201,7 @@ static inline void __raw_read_unlock(raw_rwlock_t *rw)
198 201
199#define __raw_read_trylock(lock) generic__raw_read_trylock(lock) 202#define __raw_read_trylock(lock) generic__raw_read_trylock(lock)
200 203
204/* read_can_lock - would read_trylock() succeed? */
205#define __raw_read_can_lock(x) ((x)->lock < 0x80000000)
206
201#endif /* __ASM_SPINLOCK_H */ 207#endif /* __ASM_SPINLOCK_H */
diff --git a/include/asm-arm/system.h b/include/asm-arm/system.h
index 95b3abf4851b..7c9568d30307 100644
--- a/include/asm-arm/system.h
+++ b/include/asm-arm/system.h
@@ -127,6 +127,12 @@ static inline int cpu_is_xsc3(void)
127} 127}
128#endif 128#endif
129 129
130#if !defined(CONFIG_CPU_XSCALE) && !defined(CONFIG_CPU_XSC3)
131#define cpu_is_xscale() 0
132#else
133#define cpu_is_xscale() 1
134#endif
135
130#define set_cr(x) \ 136#define set_cr(x) \
131 __asm__ __volatile__( \ 137 __asm__ __volatile__( \
132 "mcr p15, 0, %0, c1, c0, 0 @ set CR" \ 138 "mcr p15, 0, %0, c1, c0, 0 @ set CR" \
diff --git a/include/asm-arm/unistd.h b/include/asm-arm/unistd.h
index 65ac305c2d45..cbf39a56dbe7 100644
--- a/include/asm-arm/unistd.h
+++ b/include/asm-arm/unistd.h
@@ -360,6 +360,24 @@
360#define __ARM_NR_usr32 (__ARM_NR_BASE+4) 360#define __ARM_NR_usr32 (__ARM_NR_BASE+4)
361#define __ARM_NR_set_tls (__ARM_NR_BASE+5) 361#define __ARM_NR_set_tls (__ARM_NR_BASE+5)
362 362
363/*
364 * The following syscalls are obsolete and no longer available for EABI.
365 */
366#if defined(__ARM_EABI__) && !defined(__KERNEL__)
367#undef __NR_time
368#undef __NR_umount
369#undef __NR_stime
370#undef __NR_alarm
371#undef __NR_utime
372#undef __NR_getrlimit
373#undef __NR_select
374#undef __NR_readdir
375#undef __NR_mmap
376#undef __NR_socketcall
377#undef __NR_syscall
378#undef __NR_ipc
379#endif
380
363#define __sys2(x) #x 381#define __sys2(x) #x
364#define __sys1(x) __sys2(x) 382#define __sys1(x) __sys2(x)
365 383
@@ -392,7 +410,8 @@ type name(void) { \
392 __asm__ __volatile__ ( \ 410 __asm__ __volatile__ ( \
393 __syscall(name) \ 411 __syscall(name) \
394 : "=r" (__res_r0) \ 412 : "=r" (__res_r0) \
395 : __SYS_REG_LIST() ); \ 413 : __SYS_REG_LIST() \
414 : "memory" ); \
396 __res = __res_r0; \ 415 __res = __res_r0; \
397 __syscall_return(type,__res); \ 416 __syscall_return(type,__res); \
398} 417}
@@ -406,7 +425,8 @@ type name(type1 arg1) { \
406 __asm__ __volatile__ ( \ 425 __asm__ __volatile__ ( \
407 __syscall(name) \ 426 __syscall(name) \
408 : "=r" (__res_r0) \ 427 : "=r" (__res_r0) \
409 : __SYS_REG_LIST( "0" (__r0) ) ); \ 428 : __SYS_REG_LIST( "0" (__r0) ) \
429 : "memory" ); \
410 __res = __res_r0; \ 430 __res = __res_r0; \
411 __syscall_return(type,__res); \ 431 __syscall_return(type,__res); \
412} 432}
@@ -421,7 +441,8 @@ type name(type1 arg1,type2 arg2) { \
421 __asm__ __volatile__ ( \ 441 __asm__ __volatile__ ( \
422 __syscall(name) \ 442 __syscall(name) \
423 : "=r" (__res_r0) \ 443 : "=r" (__res_r0) \
424 : __SYS_REG_LIST( "0" (__r0), "r" (__r1) ) ); \ 444 : __SYS_REG_LIST( "0" (__r0), "r" (__r1) ) \
445 : "memory" ); \
425 __res = __res_r0; \ 446 __res = __res_r0; \
426 __syscall_return(type,__res); \ 447 __syscall_return(type,__res); \
427} 448}
@@ -438,7 +459,8 @@ type name(type1 arg1,type2 arg2,type3 arg3) { \
438 __asm__ __volatile__ ( \ 459 __asm__ __volatile__ ( \
439 __syscall(name) \ 460 __syscall(name) \
440 : "=r" (__res_r0) \ 461 : "=r" (__res_r0) \
441 : __SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2) ) ); \ 462 : __SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2) ) \
463 : "memory" ); \
442 __res = __res_r0; \ 464 __res = __res_r0; \
443 __syscall_return(type,__res); \ 465 __syscall_return(type,__res); \
444} 466}
@@ -456,7 +478,8 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4) { \
456 __asm__ __volatile__ ( \ 478 __asm__ __volatile__ ( \
457 __syscall(name) \ 479 __syscall(name) \
458 : "=r" (__res_r0) \ 480 : "=r" (__res_r0) \
459 : __SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2), "r" (__r3) ) ); \ 481 : __SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2), "r" (__r3) ) \
482 : "memory" ); \
460 __res = __res_r0; \ 483 __res = __res_r0; \
461 __syscall_return(type,__res); \ 484 __syscall_return(type,__res); \
462} 485}
@@ -476,7 +499,8 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) { \
476 __syscall(name) \ 499 __syscall(name) \
477 : "=r" (__res_r0) \ 500 : "=r" (__res_r0) \
478 : __SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2), \ 501 : __SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2), \
479 "r" (__r3), "r" (__r4) ) ); \ 502 "r" (__r3), "r" (__r4) ) \
503 : "memory" ); \
480 __res = __res_r0; \ 504 __res = __res_r0; \
481 __syscall_return(type,__res); \ 505 __syscall_return(type,__res); \
482} 506}
@@ -496,7 +520,8 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6
496 __syscall(name) \ 520 __syscall(name) \
497 : "=r" (__res_r0) \ 521 : "=r" (__res_r0) \
498 : __SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2), \ 522 : __SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2), \
499 "r" (__r3), "r" (__r4), "r" (__r5) ) ); \ 523 "r" (__r3), "r" (__r4), "r" (__r5) ) \
524 : "memory" ); \
500 __res = __res_r0; \ 525 __res = __res_r0; \
501 __syscall_return(type,__res); \ 526 __syscall_return(type,__res); \
502} 527}
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h
index 358e4d309ceb..c2059a3a0621 100644
--- a/include/asm-generic/pgtable.h
+++ b/include/asm-generic/pgtable.h
@@ -159,17 +159,8 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addres
159#define lazy_mmu_prot_update(pte) do { } while (0) 159#define lazy_mmu_prot_update(pte) do { } while (0)
160#endif 160#endif
161 161
162#ifndef __HAVE_ARCH_MULTIPLE_ZERO_PAGE 162#ifndef __HAVE_ARCH_MOVE_PTE
163#define move_pte(pte, prot, old_addr, new_addr) (pte) 163#define move_pte(pte, prot, old_addr, new_addr) (pte)
164#else
165#define move_pte(pte, prot, old_addr, new_addr) \
166({ \
167 pte_t newpte = (pte); \
168 if (pte_present(pte) && pfn_valid(pte_pfn(pte)) && \
169 pte_page(pte) == ZERO_PAGE(old_addr)) \
170 newpte = mk_pte(ZERO_PAGE(new_addr), (prot)); \
171 newpte; \
172})
173#endif 164#endif
174 165
175/* 166/*
diff --git a/include/asm-i386/atomic.h b/include/asm-i386/atomic.h
index 22d80ece95cb..4ddce5296a78 100644
--- a/include/asm-i386/atomic.h
+++ b/include/asm-i386/atomic.h
@@ -183,6 +183,7 @@ static __inline__ int atomic_add_return(int i, atomic_t *v)
183{ 183{
184 int __i; 184 int __i;
185#ifdef CONFIG_M386 185#ifdef CONFIG_M386
186 unsigned long flags;
186 if(unlikely(boot_cpu_data.x86==3)) 187 if(unlikely(boot_cpu_data.x86==3))
187 goto no_xadd; 188 goto no_xadd;
188#endif 189#endif
@@ -196,10 +197,10 @@ static __inline__ int atomic_add_return(int i, atomic_t *v)
196 197
197#ifdef CONFIG_M386 198#ifdef CONFIG_M386
198no_xadd: /* Legacy 386 processor */ 199no_xadd: /* Legacy 386 processor */
199 local_irq_disable(); 200 local_irq_save(flags);
200 __i = atomic_read(v); 201 __i = atomic_read(v);
201 atomic_set(v, i + __i); 202 atomic_set(v, i + __i);
202 local_irq_enable(); 203 local_irq_restore(flags);
203 return i + __i; 204 return i + __i;
204#endif 205#endif
205} 206}
diff --git a/include/asm-i386/cpufeature.h b/include/asm-i386/cpufeature.h
index 5c0b5876b931..b44bfc6239cb 100644
--- a/include/asm-i386/cpufeature.h
+++ b/include/asm-i386/cpufeature.h
@@ -71,6 +71,7 @@
71#define X86_FEATURE_P4 (3*32+ 7) /* P4 */ 71#define X86_FEATURE_P4 (3*32+ 7) /* P4 */
72#define X86_FEATURE_CONSTANT_TSC (3*32+ 8) /* TSC ticks at a constant rate */ 72#define X86_FEATURE_CONSTANT_TSC (3*32+ 8) /* TSC ticks at a constant rate */
73#define X86_FEATURE_UP (3*32+ 9) /* smp kernel running on up */ 73#define X86_FEATURE_UP (3*32+ 9) /* smp kernel running on up */
74#define X86_FEATURE_FXSAVE_LEAK (3*32+10) /* FXSAVE leaks FOP/FIP/FOP */
74 75
75/* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */ 76/* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */
76#define X86_FEATURE_XMM3 (4*32+ 0) /* Streaming SIMD Extensions-3 */ 77#define X86_FEATURE_XMM3 (4*32+ 0) /* Streaming SIMD Extensions-3 */
diff --git a/include/asm-i386/i387.h b/include/asm-i386/i387.h
index 152d0baa576a..bc1d6edae1ed 100644
--- a/include/asm-i386/i387.h
+++ b/include/asm-i386/i387.h
@@ -13,6 +13,7 @@
13 13
14#include <linux/sched.h> 14#include <linux/sched.h>
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/kernel_stat.h>
16#include <asm/processor.h> 17#include <asm/processor.h>
17#include <asm/sigcontext.h> 18#include <asm/sigcontext.h>
18#include <asm/user.h> 19#include <asm/user.h>
@@ -38,17 +39,38 @@ extern void init_fpu(struct task_struct *);
38extern void kernel_fpu_begin(void); 39extern void kernel_fpu_begin(void);
39#define kernel_fpu_end() do { stts(); preempt_enable(); } while(0) 40#define kernel_fpu_end() do { stts(); preempt_enable(); } while(0)
40 41
42/* We need a safe address that is cheap to find and that is already
43 in L1 during context switch. The best choices are unfortunately
44 different for UP and SMP */
45#ifdef CONFIG_SMP
46#define safe_address (__per_cpu_offset[0])
47#else
48#define safe_address (kstat_cpu(0).cpustat.user)
49#endif
50
41/* 51/*
42 * These must be called with preempt disabled 52 * These must be called with preempt disabled
43 */ 53 */
44static inline void __save_init_fpu( struct task_struct *tsk ) 54static inline void __save_init_fpu( struct task_struct *tsk )
45{ 55{
56 /* Use more nops than strictly needed in case the compiler
57 varies code */
46 alternative_input( 58 alternative_input(
47 "fnsave %1 ; fwait ;" GENERIC_NOP2, 59 "fnsave %[fx] ;fwait;" GENERIC_NOP8 GENERIC_NOP4,
48 "fxsave %1 ; fnclex", 60 "fxsave %[fx]\n"
61 "bt $7,%[fsw] ; jnc 1f ; fnclex\n1:",
49 X86_FEATURE_FXSR, 62 X86_FEATURE_FXSR,
50 "m" (tsk->thread.i387.fxsave) 63 [fx] "m" (tsk->thread.i387.fxsave),
51 :"memory"); 64 [fsw] "m" (tsk->thread.i387.fxsave.swd) : "memory");
65 /* AMD K7/K8 CPUs don't save/restore FDP/FIP/FOP unless an exception
66 is pending. Clear the x87 state here by setting it to fixed
67 values. safe_address is a random variable that should be in L1 */
68 alternative_input(
69 GENERIC_NOP8 GENERIC_NOP2,
70 "emms\n\t" /* clear stack tags */
71 "fildl %[addr]", /* set F?P to defined value */
72 X86_FEATURE_FXSAVE_LEAK,
73 [addr] "m" (safe_address));
52 task_thread_info(tsk)->status &= ~TS_USEDFPU; 74 task_thread_info(tsk)->status &= ~TS_USEDFPU;
53} 75}
54 76
diff --git a/include/asm-i386/io_apic.h b/include/asm-i386/io_apic.h
index 51c4e5fe6062..d92e253f7f6f 100644
--- a/include/asm-i386/io_apic.h
+++ b/include/asm-i386/io_apic.h
@@ -200,6 +200,7 @@ extern int io_apic_get_unique_id (int ioapic, int apic_id);
200extern int io_apic_get_version (int ioapic); 200extern int io_apic_get_version (int ioapic);
201extern int io_apic_get_redir_entries (int ioapic); 201extern int io_apic_get_redir_entries (int ioapic);
202extern int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int active_high_low); 202extern int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int active_high_low);
203extern int timer_uses_ioapic_pin_0;
203#endif /* CONFIG_ACPI */ 204#endif /* CONFIG_ACPI */
204 205
205extern int (*ioapic_renumber_irq)(int ioapic, int irq); 206extern int (*ioapic_renumber_irq)(int ioapic, int irq);
diff --git a/include/asm-i386/pgtable-2level.h b/include/asm-i386/pgtable-2level.h
index 27bde973abc7..2756d4b04c27 100644
--- a/include/asm-i386/pgtable-2level.h
+++ b/include/asm-i386/pgtable-2level.h
@@ -18,6 +18,9 @@
18#define set_pte_atomic(pteptr, pteval) set_pte(pteptr,pteval) 18#define set_pte_atomic(pteptr, pteval) set_pte(pteptr,pteval)
19#define set_pmd(pmdptr, pmdval) (*(pmdptr) = (pmdval)) 19#define set_pmd(pmdptr, pmdval) (*(pmdptr) = (pmdval))
20 20
21#define pte_clear(mm,addr,xp) do { set_pte_at(mm, addr, xp, __pte(0)); } while (0)
22#define pmd_clear(xp) do { set_pmd(xp, __pmd(0)); } while (0)
23
21#define ptep_get_and_clear(mm,addr,xp) __pte(xchg(&(xp)->pte_low, 0)) 24#define ptep_get_and_clear(mm,addr,xp) __pte(xchg(&(xp)->pte_low, 0))
22#define pte_same(a, b) ((a).pte_low == (b).pte_low) 25#define pte_same(a, b) ((a).pte_low == (b).pte_low)
23#define pte_page(x) pfn_to_page(pte_pfn(x)) 26#define pte_page(x) pfn_to_page(pte_pfn(x))
diff --git a/include/asm-i386/pgtable-3level.h b/include/asm-i386/pgtable-3level.h
index 36a5aa63cbbf..dccb1b3337ad 100644
--- a/include/asm-i386/pgtable-3level.h
+++ b/include/asm-i386/pgtable-3level.h
@@ -85,6 +85,26 @@ static inline void pud_clear (pud_t * pud) { }
85#define pmd_offset(pud, address) ((pmd_t *) pud_page(*(pud)) + \ 85#define pmd_offset(pud, address) ((pmd_t *) pud_page(*(pud)) + \
86 pmd_index(address)) 86 pmd_index(address))
87 87
88/*
89 * For PTEs and PDEs, we must clear the P-bit first when clearing a page table
90 * entry, so clear the bottom half first and enforce ordering with a compiler
91 * barrier.
92 */
93static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
94{
95 ptep->pte_low = 0;
96 smp_wmb();
97 ptep->pte_high = 0;
98}
99
100static inline void pmd_clear(pmd_t *pmd)
101{
102 u32 *tmp = (u32 *)pmd;
103 *tmp = 0;
104 smp_wmb();
105 *(tmp + 1) = 0;
106}
107
88static inline pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) 108static inline pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
89{ 109{
90 pte_t res; 110 pte_t res;
diff --git a/include/asm-i386/pgtable.h b/include/asm-i386/pgtable.h
index ee056c41a9fb..672c3f76b9df 100644
--- a/include/asm-i386/pgtable.h
+++ b/include/asm-i386/pgtable.h
@@ -204,12 +204,10 @@ extern unsigned long long __PAGE_KERNEL, __PAGE_KERNEL_EXEC;
204extern unsigned long pg0[]; 204extern unsigned long pg0[];
205 205
206#define pte_present(x) ((x).pte_low & (_PAGE_PRESENT | _PAGE_PROTNONE)) 206#define pte_present(x) ((x).pte_low & (_PAGE_PRESENT | _PAGE_PROTNONE))
207#define pte_clear(mm,addr,xp) do { set_pte_at(mm, addr, xp, __pte(0)); } while (0)
208 207
209/* To avoid harmful races, pmd_none(x) should check only the lower when PAE */ 208/* To avoid harmful races, pmd_none(x) should check only the lower when PAE */
210#define pmd_none(x) (!(unsigned long)pmd_val(x)) 209#define pmd_none(x) (!(unsigned long)pmd_val(x))
211#define pmd_present(x) (pmd_val(x) & _PAGE_PRESENT) 210#define pmd_present(x) (pmd_val(x) & _PAGE_PRESENT)
212#define pmd_clear(xp) do { set_pmd(xp, __pmd(0)); } while (0)
213#define pmd_bad(x) ((pmd_val(x) & (~PAGE_MASK & ~_PAGE_USER)) != _KERNPG_TABLE) 211#define pmd_bad(x) ((pmd_val(x) & (~PAGE_MASK & ~_PAGE_USER)) != _KERNPG_TABLE)
214 212
215 213
@@ -268,7 +266,7 @@ static inline pte_t ptep_get_and_clear_full(struct mm_struct *mm, unsigned long
268 pte_t pte; 266 pte_t pte;
269 if (full) { 267 if (full) {
270 pte = *ptep; 268 pte = *ptep;
271 *ptep = __pte(0); 269 pte_clear(mm, addr, ptep);
272 } else { 270 } else {
273 pte = ptep_get_and_clear(mm, addr, ptep); 271 pte = ptep_get_and_clear(mm, addr, ptep);
274 } 272 }
diff --git a/include/asm-i386/unistd.h b/include/asm-i386/unistd.h
index 6a8dd83c350f..eb4b152c82fc 100644
--- a/include/asm-i386/unistd.h
+++ b/include/asm-i386/unistd.h
@@ -320,8 +320,10 @@
320#define __NR_get_robust_list 312 320#define __NR_get_robust_list 312
321#define __NR_splice 313 321#define __NR_splice 313
322#define __NR_sync_file_range 314 322#define __NR_sync_file_range 314
323#define __NR_tee 315
324#define __NR_vmsplice 316
323 325
324#define NR_syscalls 315 326#define NR_syscalls 317
325 327
326/* 328/*
327 * user-visible error numbers are in the range -1 - -128: see 329 * user-visible error numbers are in the range -1 - -128: see
diff --git a/include/asm-ia64/acpi.h b/include/asm-ia64/acpi.h
index d734585a23cf..09a5dd0e44a8 100644
--- a/include/asm-ia64/acpi.h
+++ b/include/asm-ia64/acpi.h
@@ -110,9 +110,8 @@ extern void prefill_possible_map(void);
110extern int additional_cpus; 110extern int additional_cpus;
111 111
112#ifdef CONFIG_ACPI_NUMA 112#ifdef CONFIG_ACPI_NUMA
113/* Proximity bitmap length; _PXM is at most 255 (8 bit)*/ 113#if MAX_NUMNODES > 256
114#ifdef CONFIG_IA64_NR_NODES 114#define MAX_PXM_DOMAINS MAX_NUMNODES
115#define MAX_PXM_DOMAINS CONFIG_IA64_NR_NODES
116#else 115#else
117#define MAX_PXM_DOMAINS (256) 116#define MAX_PXM_DOMAINS (256)
118#endif 117#endif
diff --git a/include/asm-ia64/bitops.h b/include/asm-ia64/bitops.h
index 90921e162793..6cc517e212a9 100644
--- a/include/asm-ia64/bitops.h
+++ b/include/asm-ia64/bitops.h
@@ -11,7 +11,6 @@
11 11
12#include <linux/compiler.h> 12#include <linux/compiler.h>
13#include <linux/types.h> 13#include <linux/types.h>
14#include <asm/bitops.h>
15#include <asm/intrinsics.h> 14#include <asm/intrinsics.h>
16 15
17/** 16/**
diff --git a/include/asm-ia64/machvec.h b/include/asm-ia64/machvec.h
index c3e4ed8a3e17..a9c995a86c21 100644
--- a/include/asm-ia64/machvec.h
+++ b/include/asm-ia64/machvec.h
@@ -347,9 +347,11 @@ extern ia64_mv_dma_supported swiotlb_dma_supported;
347#endif 347#endif
348#ifndef platform_pci_legacy_read 348#ifndef platform_pci_legacy_read
349# define platform_pci_legacy_read ia64_pci_legacy_read 349# define platform_pci_legacy_read ia64_pci_legacy_read
350extern int ia64_pci_legacy_read(struct pci_bus *bus, u16 port, u32 *val, u8 size);
350#endif 351#endif
351#ifndef platform_pci_legacy_write 352#ifndef platform_pci_legacy_write
352# define platform_pci_legacy_write ia64_pci_legacy_write 353# define platform_pci_legacy_write ia64_pci_legacy_write
354extern int ia64_pci_legacy_write(struct pci_bus *bus, u16 port, u32 val, u8 size);
353#endif 355#endif
354#ifndef platform_inb 356#ifndef platform_inb
355# define platform_inb __ia64_inb 357# define platform_inb __ia64_inb
diff --git a/include/asm-ia64/sn/sn2/sn_hwperf.h b/include/asm-ia64/sn/sn2/sn_hwperf.h
index 291ef3d69da2..e61ebac38cdd 100644
--- a/include/asm-ia64/sn/sn2/sn_hwperf.h
+++ b/include/asm-ia64/sn/sn2/sn_hwperf.h
@@ -45,8 +45,12 @@ struct sn_hwperf_object_info {
45#define SN_HWPERF_IS_NODE(x) ((x) && strstr((x)->name, "SHub")) 45#define SN_HWPERF_IS_NODE(x) ((x) && strstr((x)->name, "SHub"))
46#define SN_HWPERF_IS_NODE_SHUB2(x) ((x) && strstr((x)->name, "SHub 2.")) 46#define SN_HWPERF_IS_NODE_SHUB2(x) ((x) && strstr((x)->name, "SHub 2."))
47#define SN_HWPERF_IS_IONODE(x) ((x) && strstr((x)->name, "TIO")) 47#define SN_HWPERF_IS_IONODE(x) ((x) && strstr((x)->name, "TIO"))
48#define SN_HWPERF_IS_ROUTER(x) ((x) && strstr((x)->name, "Router"))
49#define SN_HWPERF_IS_NL3ROUTER(x) ((x) && strstr((x)->name, "NL3Router")) 48#define SN_HWPERF_IS_NL3ROUTER(x) ((x) && strstr((x)->name, "NL3Router"))
49#define SN_HWPERF_IS_NL4ROUTER(x) ((x) && strstr((x)->name, "NL4Router"))
50#define SN_HWPERF_IS_OLDROUTER(x) ((x) && strstr((x)->name, "Router"))
51#define SN_HWPERF_IS_ROUTER(x) (SN_HWPERF_IS_NL3ROUTER(x) || \
52 SN_HWPERF_IS_NL4ROUTER(x) || \
53 SN_HWPERF_IS_OLDROUTER(x))
50#define SN_HWPERF_FOREIGN(x) ((x) && !(x)->sn_hwp_this_part && !(x)->sn_hwp_is_shared) 54#define SN_HWPERF_FOREIGN(x) ((x) && !(x)->sn_hwp_this_part && !(x)->sn_hwp_is_shared)
51#define SN_HWPERF_SAME_OBJTYPE(x,y) ((SN_HWPERF_IS_NODE(x) && SN_HWPERF_IS_NODE(y)) ||\ 55#define SN_HWPERF_SAME_OBJTYPE(x,y) ((SN_HWPERF_IS_NODE(x) && SN_HWPERF_IS_NODE(y)) ||\
52 (SN_HWPERF_IS_IONODE(x) && SN_HWPERF_IS_IONODE(y)) ||\ 56 (SN_HWPERF_IS_IONODE(x) && SN_HWPERF_IS_IONODE(y)) ||\
diff --git a/include/asm-ia64/sn/sn_sal.h b/include/asm-ia64/sn/sn_sal.h
index bf4cc867a698..51aca022cf39 100644
--- a/include/asm-ia64/sn/sn_sal.h
+++ b/include/asm-ia64/sn/sn_sal.h
@@ -8,7 +8,7 @@
8 * License. See the file "COPYING" in the main directory of this archive 8 * License. See the file "COPYING" in the main directory of this archive
9 * for more details. 9 * for more details.
10 * 10 *
11 * Copyright (c) 2000-2005 Silicon Graphics, Inc. All rights reserved. 11 * Copyright (c) 2000-2006 Silicon Graphics, Inc. All rights reserved.
12 */ 12 */
13 13
14 14
@@ -85,6 +85,7 @@
85 85
86#define SN_SAL_GET_PROM_FEATURE_SET 0x02000065 86#define SN_SAL_GET_PROM_FEATURE_SET 0x02000065
87#define SN_SAL_SET_OS_FEATURE_SET 0x02000066 87#define SN_SAL_SET_OS_FEATURE_SET 0x02000066
88#define SN_SAL_INJECT_ERROR 0x02000067
88 89
89/* 90/*
90 * Service-specific constants 91 * Service-specific constants
@@ -705,10 +706,8 @@ static inline int
705sn_change_memprotect(u64 paddr, u64 len, u64 perms, u64 *nasid_array) 706sn_change_memprotect(u64 paddr, u64 len, u64 perms, u64 *nasid_array)
706{ 707{
707 struct ia64_sal_retval ret_stuff; 708 struct ia64_sal_retval ret_stuff;
708 int cnodeid;
709 unsigned long irq_flags; 709 unsigned long irq_flags;
710 710
711 cnodeid = nasid_to_cnodeid(get_node_number(paddr));
712 local_irq_save(irq_flags); 711 local_irq_save(irq_flags);
713 ia64_sal_oemcall_nolock(&ret_stuff, SN_SAL_MEMPROTECT, paddr, len, 712 ia64_sal_oemcall_nolock(&ret_stuff, SN_SAL_MEMPROTECT, paddr, len,
714 (u64)nasid_array, perms, 0, 0, 0); 713 (u64)nasid_array, perms, 0, 0, 0);
@@ -1140,4 +1139,16 @@ ia64_sn_set_os_feature(int feature)
1140 return rv.status; 1139 return rv.status;
1141} 1140}
1142 1141
1142static inline int
1143sn_inject_error(u64 paddr, u64 *data, u64 *ecc)
1144{
1145 struct ia64_sal_retval ret_stuff;
1146 unsigned long irq_flags;
1147
1148 local_irq_save(irq_flags);
1149 ia64_sal_oemcall_nolock(&ret_stuff, SN_SAL_INJECT_ERROR, paddr, (u64)data,
1150 (u64)ecc, 0, 0, 0, 0);
1151 local_irq_restore(irq_flags);
1152 return ret_stuff.status;
1153}
1143#endif /* _ASM_IA64_SN_SN_SAL_H */ 1154#endif /* _ASM_IA64_SN_SN_SAL_H */
diff --git a/include/asm-ia64/thread_info.h b/include/asm-ia64/thread_info.h
index 56394a2c7055..e5392c4d30c6 100644
--- a/include/asm-ia64/thread_info.h
+++ b/include/asm-ia64/thread_info.h
@@ -67,7 +67,7 @@ struct thread_info {
67#define end_of_stack(p) (unsigned long *)((void *)(p) + IA64_RBS_OFFSET) 67#define end_of_stack(p) (unsigned long *)((void *)(p) + IA64_RBS_OFFSET)
68 68
69#define __HAVE_ARCH_TASK_STRUCT_ALLOCATOR 69#define __HAVE_ARCH_TASK_STRUCT_ALLOCATOR
70#define alloc_task_struct() ((task_t *)__get_free_pages(GFP_KERNEL, KERNEL_STACK_SIZE_ORDER)) 70#define alloc_task_struct() ((task_t *)__get_free_pages(GFP_KERNEL | __GFP_COMP, KERNEL_STACK_SIZE_ORDER))
71#define free_task_struct(tsk) free_pages((unsigned long) (tsk), KERNEL_STACK_SIZE_ORDER) 71#define free_task_struct(tsk) free_pages((unsigned long) (tsk), KERNEL_STACK_SIZE_ORDER)
72 72
73#endif /* !__ASSEMBLY */ 73#endif /* !__ASSEMBLY */
diff --git a/include/asm-ia64/topology.h b/include/asm-ia64/topology.h
index 3ee19dfa46df..616b5ed2aa72 100644
--- a/include/asm-ia64/topology.h
+++ b/include/asm-ia64/topology.h
@@ -23,6 +23,11 @@
23#define PENALTY_FOR_NODE_WITH_CPUS 255 23#define PENALTY_FOR_NODE_WITH_CPUS 255
24 24
25/* 25/*
26 * Distance above which we begin to use zone reclaim
27 */
28#define RECLAIM_DISTANCE 15
29
30/*
26 * Returns the number of the node containing CPU 'cpu' 31 * Returns the number of the node containing CPU 'cpu'
27 */ 32 */
28#define cpu_to_node(cpu) (int)(cpu_to_node_map[cpu]) 33#define cpu_to_node(cpu) (int)(cpu_to_node_map[cpu])
diff --git a/include/asm-ia64/unistd.h b/include/asm-ia64/unistd.h
index 1c749acca021..7107763168bf 100644
--- a/include/asm-ia64/unistd.h
+++ b/include/asm-ia64/unistd.h
@@ -289,12 +289,14 @@
289#define __NR_set_robust_list 1298 289#define __NR_set_robust_list 1298
290#define __NR_get_robust_list 1299 290#define __NR_get_robust_list 1299
291#define __NR_sync_file_range 1300 291#define __NR_sync_file_range 1300
292#define __NR_tee 1301
293#define __NR_vmsplice 1302
292 294
293#ifdef __KERNEL__ 295#ifdef __KERNEL__
294 296
295#include <linux/config.h> 297#include <linux/config.h>
296 298
297#define NR_syscalls 277 /* length of syscall table */ 299#define NR_syscalls 279 /* length of syscall table */
298 300
299#define __ARCH_WANT_SYS_RT_SIGACTION 301#define __ARCH_WANT_SYS_RT_SIGACTION
300 302
diff --git a/include/asm-m32r/assembler.h b/include/asm-m32r/assembler.h
index b7f4d8aaeb46..1a1aa17edd33 100644
--- a/include/asm-m32r/assembler.h
+++ b/include/asm-m32r/assembler.h
@@ -109,6 +109,9 @@
109 push r13 109 push r13
110 mvfachi r13 110 mvfachi r13
111 push r13 111 push r13
112 ldi r13, #0
113 push r13 ; dummy push acc1h
114 push r13 ; dummy push acc1l
112#else 115#else
113#error unknown isa configuration 116#error unknown isa configuration
114#endif 117#endif
@@ -156,6 +159,8 @@
156 pop r13 159 pop r13
157 mvtaclo r13, a1 160 mvtaclo r13, a1
158#elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R) 161#elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R)
162 pop r13 ; dummy pop acc1h
163 pop r13 ; dummy pop acc1l
159 pop r13 164 pop r13
160 mvtachi r13 165 mvtachi r13
161 pop r13 166 pop r13
diff --git a/include/asm-m32r/mappi3/mappi3_pld.h b/include/asm-m32r/mappi3/mappi3_pld.h
index 1d3c25d61bcb..031369a7afc8 100644
--- a/include/asm-m32r/mappi3/mappi3_pld.h
+++ b/include/asm-m32r/mappi3/mappi3_pld.h
@@ -53,16 +53,14 @@
53/* Power Control of MMC and CF */ 53/* Power Control of MMC and CF */
54#define PLD_CPCR __reg16(PLD_BASE + 0x14000) 54#define PLD_CPCR __reg16(PLD_BASE + 0x14000)
55 55
56 56/* ICU */
57/*==== ICU ====*/ 57#define M32R_IRQ_PC104 (5) /* INT4(PC/104) */
58#define M32R_IRQ_PC104 (5) /* INT4(PC/104) */ 58#define M32R_IRQ_I2C (28) /* I2C-BUS */
59#define M32R_IRQ_I2C (28) /* I2C-BUS */ 59#define PLD_IRQ_CFIREQ (6) /* INT5 CFC Card Interrupt */
60#define PLD_IRQ_CFIREQ (6) /* INT5 CFC Card Interrupt */ 60#define PLD_IRQ_CFC_INSERT (7) /* INT6 CFC Card Insert & Eject */
61#define PLD_IRQ_CFC_INSERT (7) /* INT6 CFC Card Insert */ 61#define PLD_IRQ_IDEIREQ (8) /* INT7 IDE Interrupt */
62#define PLD_IRQ_IDEIREQ (8) /* INT7 IDE Interrupt */ 62#define PLD_IRQ_MMCCARD (43) /* MMC Card Insert */
63#define PLD_IRQ_MMCCARD (43) /* MMC Card Insert */ 63#define PLD_IRQ_MMCIRQ (44) /* MMC Transfer Done */
64#define PLD_IRQ_MMCIRQ (44) /* MMC Transfer Done */
65
66 64
67#if 0 65#if 0
68/* LED Control 66/* LED Control
@@ -97,7 +95,6 @@
97#define PLD_CRC16ADATA __reg16(PLD_BASE + 0x18008) 95#define PLD_CRC16ADATA __reg16(PLD_BASE + 0x18008)
98#define PLD_CRC16AINDATA __reg16(PLD_BASE + 0x1800a) 96#define PLD_CRC16AINDATA __reg16(PLD_BASE + 0x1800a)
99 97
100
101#if 0 98#if 0
102/* RTC */ 99/* RTC */
103#define PLD_RTCCR __reg16(PLD_BASE + 0x1c000) 100#define PLD_RTCCR __reg16(PLD_BASE + 0x1c000)
@@ -140,4 +137,7 @@
140 137
141#endif 138#endif
142 139
140/* Reset Control */
141#define PLD_REBOOT __reg16(PLD_BASE + 0x38000)
142
143#endif /* _MAPPI3_PLD.H */ 143#endif /* _MAPPI3_PLD.H */
diff --git a/include/asm-m32r/ptrace.h b/include/asm-m32r/ptrace.h
index 0d058b2d844e..53c792452dfc 100644
--- a/include/asm-m32r/ptrace.h
+++ b/include/asm-m32r/ptrace.h
@@ -43,6 +43,14 @@
43#define PT_ACC1L 18 43#define PT_ACC1L 18
44#define PT_ACCH PT_ACC0H 44#define PT_ACCH PT_ACC0H
45#define PT_ACCL PT_ACC0L 45#define PT_ACCL PT_ACC0L
46#elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R)
47#define PT_ACCH 15
48#define PT_ACCL 16
49#define PT_DUMMY_ACC1H 17
50#define PT_DUMMY_ACC1L 18
51#else
52#error unknown isa conifiguration
53#endif
46#define PT_PSW 19 54#define PT_PSW 19
47#define PT_BPC 20 55#define PT_BPC 20
48#define PT_BBPSW 21 56#define PT_BBPSW 21
@@ -52,21 +60,6 @@
52#define PT_LR 25 60#define PT_LR 25
53#define PT_SPI 26 61#define PT_SPI 26
54#define PT_ORIGR0 27 62#define PT_ORIGR0 27
55#elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R)
56#define PT_ACCH 15
57#define PT_ACCL 16
58#define PT_PSW 17
59#define PT_BPC 18
60#define PT_BBPSW 19
61#define PT_BBPC 20
62#define PT_SPU 21
63#define PT_FP 22
64#define PT_LR 23
65#define PT_SPI 24
66#define PT_ORIGR0 25
67#else
68#error unknown isa conifiguration
69#endif
70 63
71/* virtual pt_reg entry for gdb */ 64/* virtual pt_reg entry for gdb */
72#define PT_PC 30 65#define PT_PC 30
@@ -121,6 +114,8 @@ struct pt_regs {
121#elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R) 114#elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R)
122 unsigned long acch; 115 unsigned long acch;
123 unsigned long accl; 116 unsigned long accl;
117 unsigned long dummy_acc1h;
118 unsigned long dummy_acc1l;
124#else 119#else
125#error unknown isa configuration 120#error unknown isa configuration
126#endif 121#endif
diff --git a/include/asm-m32r/semaphore.h b/include/asm-m32r/semaphore.h
index bf447c52a0a1..81750edc8916 100644
--- a/include/asm-m32r/semaphore.h
+++ b/include/asm-m32r/semaphore.h
@@ -9,7 +9,7 @@
9 * SMP- and interrupt-safe semaphores.. 9 * SMP- and interrupt-safe semaphores..
10 * 10 *
11 * Copyright (C) 1996 Linus Torvalds 11 * Copyright (C) 1996 Linus Torvalds
12 * Copyright (C) 2004 Hirokazu Takata <takata at linux-m32r.org> 12 * Copyright (C) 2004, 2006 Hirokazu Takata <takata at linux-m32r.org>
13 */ 13 */
14 14
15#include <linux/config.h> 15#include <linux/config.h>
@@ -77,27 +77,8 @@ asmlinkage void __up(struct semaphore * sem);
77 */ 77 */
78static inline void down(struct semaphore * sem) 78static inline void down(struct semaphore * sem)
79{ 79{
80 unsigned long flags;
81 long count;
82
83 might_sleep(); 80 might_sleep();
84 local_irq_save(flags); 81 if (unlikely(atomic_dec_return(&sem->count) < 0))
85 __asm__ __volatile__ (
86 "# down \n\t"
87 DCACHE_CLEAR("%0", "r4", "%1")
88 M32R_LOCK" %0, @%1; \n\t"
89 "addi %0, #-1; \n\t"
90 M32R_UNLOCK" %0, @%1; \n\t"
91 : "=&r" (count)
92 : "r" (&sem->count)
93 : "memory"
94#ifdef CONFIG_CHIP_M32700_TS1
95 , "r4"
96#endif /* CONFIG_CHIP_M32700_TS1 */
97 );
98 local_irq_restore(flags);
99
100 if (unlikely(count < 0))
101 __down(sem); 82 __down(sem);
102} 83}
103 84
@@ -107,28 +88,10 @@ static inline void down(struct semaphore * sem)
107 */ 88 */
108static inline int down_interruptible(struct semaphore * sem) 89static inline int down_interruptible(struct semaphore * sem)
109{ 90{
110 unsigned long flags;
111 long count;
112 int result = 0; 91 int result = 0;
113 92
114 might_sleep(); 93 might_sleep();
115 local_irq_save(flags); 94 if (unlikely(atomic_dec_return(&sem->count) < 0))
116 __asm__ __volatile__ (
117 "# down_interruptible \n\t"
118 DCACHE_CLEAR("%0", "r4", "%1")
119 M32R_LOCK" %0, @%1; \n\t"
120 "addi %0, #-1; \n\t"
121 M32R_UNLOCK" %0, @%1; \n\t"
122 : "=&r" (count)
123 : "r" (&sem->count)
124 : "memory"
125#ifdef CONFIG_CHIP_M32700_TS1
126 , "r4"
127#endif /* CONFIG_CHIP_M32700_TS1 */
128 );
129 local_irq_restore(flags);
130
131 if (unlikely(count < 0))
132 result = __down_interruptible(sem); 95 result = __down_interruptible(sem);
133 96
134 return result; 97 return result;
@@ -174,26 +137,7 @@ static inline int down_trylock(struct semaphore * sem)
174 */ 137 */
175static inline void up(struct semaphore * sem) 138static inline void up(struct semaphore * sem)
176{ 139{
177 unsigned long flags; 140 if (unlikely(atomic_inc_return(&sem->count) <= 0))
178 long count;
179
180 local_irq_save(flags);
181 __asm__ __volatile__ (
182 "# up \n\t"
183 DCACHE_CLEAR("%0", "r4", "%1")
184 M32R_LOCK" %0, @%1; \n\t"
185 "addi %0, #1; \n\t"
186 M32R_UNLOCK" %0, @%1; \n\t"
187 : "=&r" (count)
188 : "r" (&sem->count)
189 : "memory"
190#ifdef CONFIG_CHIP_M32700_TS1
191 , "r4"
192#endif /* CONFIG_CHIP_M32700_TS1 */
193 );
194 local_irq_restore(flags);
195
196 if (unlikely(count <= 0))
197 __up(sem); 141 __up(sem);
198} 142}
199 143
diff --git a/include/asm-m32r/sigcontext.h b/include/asm-m32r/sigcontext.h
index c233e2def2a3..942b8a30937d 100644
--- a/include/asm-m32r/sigcontext.h
+++ b/include/asm-m32r/sigcontext.h
@@ -32,6 +32,8 @@ struct sigcontext {
32#elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R) 32#elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R)
33 unsigned long sc_acch; 33 unsigned long sc_acch;
34 unsigned long sc_accl; 34 unsigned long sc_accl;
35 unsigned long sc_dummy_acc1h;
36 unsigned long sc_dummy_acc1l;
35#else 37#else
36#error unknown isa configuration 38#error unknown isa configuration
37#endif 39#endif
diff --git a/include/asm-m32r/system.h b/include/asm-m32r/system.h
index c5ab5da56d21..e55013f378e5 100644
--- a/include/asm-m32r/system.h
+++ b/include/asm-m32r/system.h
@@ -6,8 +6,8 @@
6 * License. See the file "COPYING" in the main directory of this archive 6 * License. See the file "COPYING" in the main directory of this archive
7 * for more details. 7 * for more details.
8 * 8 *
9 * Copyright (C) 2001 by Hiroyuki Kondo, Hirokazu Takata, and Hitoshi Yamamoto 9 * Copyright (C) 2001 Hiroyuki Kondo, Hirokazu Takata, and Hitoshi Yamamoto
10 * Copyright (C) 2004 Hirokazu Takata <takata at linux-m32r.org> 10 * Copyright (C) 2004, 2006 Hirokazu Takata <takata at linux-m32r.org>
11 */ 11 */
12 12
13#include <linux/config.h> 13#include <linux/config.h>
@@ -19,49 +19,28 @@
19 * switch_to(prev, next) should switch from task `prev' to `next' 19 * switch_to(prev, next) should switch from task `prev' to `next'
20 * `prev' will never be the same as `next'. 20 * `prev' will never be the same as `next'.
21 * 21 *
22 * `next' and `prev' should be struct task_struct, but it isn't always defined 22 * `next' and `prev' should be task_t, but it isn't always defined
23 */ 23 */
24 24
25#define switch_to(prev, next, last) do { \ 25#define switch_to(prev, next, last) do { \
26 register unsigned long arg0 __asm__ ("r0") = (unsigned long)prev; \
27 register unsigned long arg1 __asm__ ("r1") = (unsigned long)next; \
28 register unsigned long *oldsp __asm__ ("r2") = &(prev->thread.sp); \
29 register unsigned long *newsp __asm__ ("r3") = &(next->thread.sp); \
30 register unsigned long *oldlr __asm__ ("r4") = &(prev->thread.lr); \
31 register unsigned long *newlr __asm__ ("r5") = &(next->thread.lr); \
32 register struct task_struct *__last __asm__ ("r6"); \
33 __asm__ __volatile__ ( \ 26 __asm__ __volatile__ ( \
34 "st r8, @-r15 \n\t" \ 27 " seth lr, #high(1f) \n" \
35 "st r9, @-r15 \n\t" \ 28 " or3 lr, lr, #low(1f) \n" \
36 "st r10, @-r15 \n\t" \ 29 " st lr, @%4 ; store old LR \n" \
37 "st r11, @-r15 \n\t" \ 30 " ld lr, @%5 ; load new LR \n" \
38 "st r12, @-r15 \n\t" \ 31 " st sp, @%2 ; store old SP \n" \
39 "st r13, @-r15 \n\t" \ 32 " ld sp, @%3 ; load new SP \n" \
40 "st r14, @-r15 \n\t" \ 33 " push %1 ; store `prev' on new stack \n" \
41 "seth r14, #high(1f) \n\t" \ 34 " jmp lr \n" \
42 "or3 r14, r14, #low(1f) \n\t" \ 35 " .fillinsn \n" \
43 "st r14, @r4 ; store old LR \n\t" \ 36 "1: \n" \
44 "st r15, @r2 ; store old SP \n\t" \ 37 " pop %0 ; restore `__last' from new stack \n" \
45 "ld r15, @r3 ; load new SP \n\t" \ 38 : "=r" (last) \
46 "st r0, @-r15 ; store 'prev' onto new stack \n\t" \ 39 : "0" (prev), \
47 "ld r14, @r5 ; load new LR \n\t" \ 40 "r" (&(prev->thread.sp)), "r" (&(next->thread.sp)), \
48 "jmp r14 \n\t" \ 41 "r" (&(prev->thread.lr)), "r" (&(next->thread.lr)) \
49 ".fillinsn \n " \ 42 : "memory", "lr" \
50 "1: \n\t" \
51 "ld r6, @r15+ ; load 'prev' from new stack \n\t" \
52 "ld r14, @r15+ \n\t" \
53 "ld r13, @r15+ \n\t" \
54 "ld r12, @r15+ \n\t" \
55 "ld r11, @r15+ \n\t" \
56 "ld r10, @r15+ \n\t" \
57 "ld r9, @r15+ \n\t" \
58 "ld r8, @r15+ \n\t" \
59 : "=&r" (__last) \
60 : "r" (arg0), "r" (arg1), "r" (oldsp), "r" (newsp), \
61 "r" (oldlr), "r" (newlr) \
62 : "memory" \
63 ); \ 43 ); \
64 last = __last; \
65} while(0) 44} while(0)
66 45
67/* 46/*
@@ -167,8 +146,8 @@ extern void __xchg_called_with_bad_pointer(void);
167#define DCACHE_CLEAR(reg0, reg1, addr) 146#define DCACHE_CLEAR(reg0, reg1, addr)
168#endif /* CONFIG_CHIP_M32700_TS1 */ 147#endif /* CONFIG_CHIP_M32700_TS1 */
169 148
170static __inline__ unsigned long __xchg(unsigned long x, volatile void * ptr, 149static inline unsigned long
171 int size) 150__xchg(unsigned long x, volatile void * ptr, int size)
172{ 151{
173 unsigned long flags; 152 unsigned long flags;
174 unsigned long tmp = 0; 153 unsigned long tmp = 0;
@@ -220,7 +199,7 @@ static __inline__ unsigned long __xchg(unsigned long x, volatile void * ptr,
220 199
221#define __HAVE_ARCH_CMPXCHG 1 200#define __HAVE_ARCH_CMPXCHG 1
222 201
223static __inline__ unsigned long 202static inline unsigned long
224__cmpxchg_u32(volatile unsigned int *p, unsigned int old, unsigned int new) 203__cmpxchg_u32(volatile unsigned int *p, unsigned int old, unsigned int new)
225{ 204{
226 unsigned long flags; 205 unsigned long flags;
@@ -254,7 +233,7 @@ __cmpxchg_u32(volatile unsigned int *p, unsigned int old, unsigned int new)
254 if something tries to do an invalid cmpxchg(). */ 233 if something tries to do an invalid cmpxchg(). */
255extern void __cmpxchg_called_with_bad_pointer(void); 234extern void __cmpxchg_called_with_bad_pointer(void);
256 235
257static __inline__ unsigned long 236static inline unsigned long
258__cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) 237__cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
259{ 238{
260 switch (size) { 239 switch (size) {
diff --git a/include/asm-mips/addrspace.h b/include/asm-mips/addrspace.h
index 42520cc84b0f..1386af1cb7d9 100644
--- a/include/asm-mips/addrspace.h
+++ b/include/asm-mips/addrspace.h
@@ -129,6 +129,7 @@
129#if defined (CONFIG_CPU_R4300) \ 129#if defined (CONFIG_CPU_R4300) \
130 || defined (CONFIG_CPU_R4X00) \ 130 || defined (CONFIG_CPU_R4X00) \
131 || defined (CONFIG_CPU_R5000) \ 131 || defined (CONFIG_CPU_R5000) \
132 || defined (CONFIG_CPU_RM7000) \
132 || defined (CONFIG_CPU_NEVADA) \ 133 || defined (CONFIG_CPU_NEVADA) \
133 || defined (CONFIG_CPU_TX49XX) \ 134 || defined (CONFIG_CPU_TX49XX) \
134 || defined (CONFIG_CPU_MIPS64) 135 || defined (CONFIG_CPU_MIPS64)
diff --git a/include/asm-mips/asmmacro.h b/include/asm-mips/asmmacro.h
index 30b18ea6cb11..f54aa147ec19 100644
--- a/include/asm-mips/asmmacro.h
+++ b/include/asm-mips/asmmacro.h
@@ -17,7 +17,26 @@
17#ifdef CONFIG_64BIT 17#ifdef CONFIG_64BIT
18#include <asm/asmmacro-64.h> 18#include <asm/asmmacro-64.h>
19#endif 19#endif
20#ifdef CONFIG_MIPS_MT_SMTC
21#include <asm/mipsmtregs.h>
22#endif
20 23
24#ifdef CONFIG_MIPS_MT_SMTC
25 .macro local_irq_enable reg=t0
26 mfc0 \reg, CP0_TCSTATUS
27 ori \reg, \reg, TCSTATUS_IXMT
28 xori \reg, \reg, TCSTATUS_IXMT
29 mtc0 \reg, CP0_TCSTATUS
30 ehb
31 .endm
32
33 .macro local_irq_disable reg=t0
34 mfc0 \reg, CP0_TCSTATUS
35 ori \reg, \reg, TCSTATUS_IXMT
36 mtc0 \reg, CP0_TCSTATUS
37 ehb
38 .endm
39#else
21 .macro local_irq_enable reg=t0 40 .macro local_irq_enable reg=t0
22 mfc0 \reg, CP0_STATUS 41 mfc0 \reg, CP0_STATUS
23 ori \reg, \reg, 1 42 ori \reg, \reg, 1
@@ -32,6 +51,7 @@
32 mtc0 \reg, CP0_STATUS 51 mtc0 \reg, CP0_STATUS
33 irq_disable_hazard 52 irq_disable_hazard
34 .endm 53 .endm
54#endif /* CONFIG_MIPS_MT_SMTC */
35 55
36#ifdef CONFIG_CPU_SB1 56#ifdef CONFIG_CPU_SB1
37 .macro fpu_enable_hazard 57 .macro fpu_enable_hazard
@@ -48,4 +68,31 @@
48 .endm 68 .endm
49#endif 69#endif
50 70
71/*
72 * Temporary until all gas have MT ASE support
73 */
74 .macro DMT reg=0
75 .word (0x41600bc1 | (\reg << 16))
76 .endm
77
78 .macro EMT reg=0
79 .word (0x41600be1 | (\reg << 16))
80 .endm
81
82 .macro DVPE reg=0
83 .word (0x41600001 | (\reg << 16))
84 .endm
85
86 .macro EVPE reg=0
87 .word (0x41600021 | (\reg << 16))
88 .endm
89
90 .macro MFTR rt=0, rd=0, u=0, sel=0
91 .word (0x41000000 | (\rt << 16) | (\rd << 11) | (\u << 5) | (\sel))
92 .endm
93
94 .macro MTTR rt=0, rd=0, u=0, sel=0
95 .word (0x41800000 | (\rt << 16) | (\rd << 11) | (\u << 5) | (\sel))
96 .endm
97
51#endif /* _ASM_ASMMACRO_H */ 98#endif /* _ASM_ASMMACRO_H */
diff --git a/include/asm-mips/bitops.h b/include/asm-mips/bitops.h
index a1728f8c0705..d2f444537e4b 100644
--- a/include/asm-mips/bitops.h
+++ b/include/asm-mips/bitops.h
@@ -467,64 +467,56 @@ static inline unsigned long __ffs(unsigned long word)
467} 467}
468 468
469/* 469/*
470 * ffs - find first bit set. 470 * fls - find last bit set.
471 * @word: The word to search 471 * @word: The word to search
472 * 472 *
473 * Returns 1..SZLONG 473 * This is defined the same way as ffs.
474 * Returns 0 if no bit exists 474 * Note fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32.
475 */ 475 */
476 476static inline int fls(int word)
477static inline unsigned long ffs(unsigned long word)
478{ 477{
479 if (!word) 478 __asm__ ("clz %0, %1" : "=r" (word) : "r" (word));
480 return 0;
481 479
482 return __ffs(word) + 1; 480 return 32 - word;
483} 481}
484 482
485/* 483#if defined(CONFIG_64BIT) && defined(CONFIG_CPU_MIPS64)
486 * ffz - find first zero in word. 484static inline int fls64(__u64 word)
487 * @word: The word to search
488 *
489 * Undefined if no zero exists, so code should check against ~0UL first.
490 */
491static inline unsigned long ffz(unsigned long word)
492{ 485{
493 return __ffs (~word); 486 __asm__ ("dclz %0, %1" : "=r" (word) : "r" (word));
487
488 return 64 - word;
494} 489}
490#else
491#include <asm-generic/bitops/fls64.h>
492#endif
495 493
496/* 494/*
497 * fls - find last bit set. 495 * ffs - find first bit set.
498 * @word: The word to search 496 * @word: The word to search
499 * 497 *
500 * Returns 1..SZLONG 498 * This is defined the same way as
501 * Returns 0 if no bit exists 499 * the libc and compiler builtin ffs routines, therefore
500 * differs in spirit from the above ffz (man ffs).
502 */ 501 */
503static inline unsigned long fls(unsigned long word) 502static inline int ffs(int word)
504{ 503{
505#ifdef CONFIG_CPU_MIPS32 504 if (!word)
506 __asm__ ("clz %0, %1" : "=r" (word) : "r" (word)); 505 return 0;
507
508 return 32 - word;
509#endif
510
511#ifdef CONFIG_CPU_MIPS64
512 __asm__ ("dclz %0, %1" : "=r" (word) : "r" (word));
513 506
514 return 64 - word; 507 return fls(word & -word);
515#endif
516} 508}
517 509
518#else 510#else
519 511
520#include <asm-generic/bitops/__ffs.h> 512#include <asm-generic/bitops/__ffs.h>
521#include <asm-generic/bitops/ffs.h> 513#include <asm-generic/bitops/ffs.h>
522#include <asm-generic/bitops/ffz.h>
523#include <asm-generic/bitops/fls.h> 514#include <asm-generic/bitops/fls.h>
515#include <asm-generic/bitops/fls64.h>
524 516
525#endif /*defined(CONFIG_CPU_MIPS32) || defined(CONFIG_CPU_MIPS64) */ 517#endif /*defined(CONFIG_CPU_MIPS32) || defined(CONFIG_CPU_MIPS64) */
526 518
527#include <asm-generic/bitops/fls64.h> 519#include <asm-generic/bitops/ffz.h>
528#include <asm-generic/bitops/find.h> 520#include <asm-generic/bitops/find.h>
529 521
530#ifdef __KERNEL__ 522#ifdef __KERNEL__
diff --git a/include/asm-mips/cacheflush.h b/include/asm-mips/cacheflush.h
index aeae9fabf4a9..47bc8f6c20d2 100644
--- a/include/asm-mips/cacheflush.h
+++ b/include/asm-mips/cacheflush.h
@@ -74,6 +74,7 @@ static inline void copy_from_user_page(struct vm_area_struct *vma,
74 74
75extern void (*flush_cache_sigtramp)(unsigned long addr); 75extern void (*flush_cache_sigtramp)(unsigned long addr);
76extern void (*flush_icache_all)(void); 76extern void (*flush_icache_all)(void);
77extern void (*local_flush_data_cache_page)(void * addr);
77extern void (*flush_data_cache_page)(unsigned long addr); 78extern void (*flush_data_cache_page)(unsigned long addr);
78 79
79/* 80/*
diff --git a/include/asm-mips/cpu-features.h b/include/asm-mips/cpu-features.h
index 3f2b6d9ac45e..254e11ed247b 100644
--- a/include/asm-mips/cpu-features.h
+++ b/include/asm-mips/cpu-features.h
@@ -40,7 +40,7 @@
40#define cpu_has_sb1_cache (cpu_data[0].options & MIPS_CPU_SB1_CACHE) 40#define cpu_has_sb1_cache (cpu_data[0].options & MIPS_CPU_SB1_CACHE)
41#endif 41#endif
42#ifndef cpu_has_fpu 42#ifndef cpu_has_fpu
43#define cpu_has_fpu (cpu_data[0].options & MIPS_CPU_FPU) 43#define cpu_has_fpu (current_cpu_data.options & MIPS_CPU_FPU)
44#endif 44#endif
45#ifndef cpu_has_32fpr 45#ifndef cpu_has_32fpr
46#define cpu_has_32fpr (cpu_data[0].options & MIPS_CPU_32FPR) 46#define cpu_has_32fpr (cpu_data[0].options & MIPS_CPU_32FPR)
diff --git a/include/asm-mips/cpu-info.h b/include/asm-mips/cpu-info.h
index 140be1c67da7..6572ac703662 100644
--- a/include/asm-mips/cpu-info.h
+++ b/include/asm-mips/cpu-info.h
@@ -73,6 +73,16 @@ struct cpuinfo_mips {
73 struct cache_desc dcache; /* Primary D or combined I/D cache */ 73 struct cache_desc dcache; /* Primary D or combined I/D cache */
74 struct cache_desc scache; /* Secondary cache */ 74 struct cache_desc scache; /* Secondary cache */
75 struct cache_desc tcache; /* Tertiary/split secondary cache */ 75 struct cache_desc tcache; /* Tertiary/split secondary cache */
76#if defined(CONFIG_MIPS_MT_SMTC)
77 /*
78 * In the MIPS MT "SMTC" model, each TC is considered
79 * to be a "CPU" for the purposes of scheduling, but
80 * exception resources, ASID spaces, etc, are common
81 * to all TCs within the same VPE.
82 */
83 int vpe_id; /* Virtual Processor number */
84 int tc_id; /* Thread Context number */
85#endif /* CONFIG_MIPS_MT */
76 void *data; /* Additional data */ 86 void *data; /* Additional data */
77} __attribute__((aligned(SMP_CACHE_BYTES))); 87} __attribute__((aligned(SMP_CACHE_BYTES)));
78 88
diff --git a/include/asm-mips/cpu.h b/include/asm-mips/cpu.h
index 818b9a97e214..dff2a0a52f8f 100644
--- a/include/asm-mips/cpu.h
+++ b/include/asm-mips/cpu.h
@@ -51,6 +51,7 @@
51#define PRID_IMP_R4300 0x0b00 51#define PRID_IMP_R4300 0x0b00
52#define PRID_IMP_VR41XX 0x0c00 52#define PRID_IMP_VR41XX 0x0c00
53#define PRID_IMP_R12000 0x0e00 53#define PRID_IMP_R12000 0x0e00
54#define PRID_IMP_R14000 0x0f00
54#define PRID_IMP_R8000 0x1000 55#define PRID_IMP_R8000 0x1000
55#define PRID_IMP_PR4450 0x1200 56#define PRID_IMP_PR4450 0x1200
56#define PRID_IMP_R4600 0x2000 57#define PRID_IMP_R4600 0x2000
@@ -87,6 +88,7 @@
87#define PRID_IMP_24K 0x9300 88#define PRID_IMP_24K 0x9300
88#define PRID_IMP_34K 0x9500 89#define PRID_IMP_34K 0x9500
89#define PRID_IMP_24KE 0x9600 90#define PRID_IMP_24KE 0x9600
91#define PRID_IMP_74K 0x9700
90 92
91/* 93/*
92 * These are the PRID's for when 23:16 == PRID_COMP_SIBYTE 94 * These are the PRID's for when 23:16 == PRID_COMP_SIBYTE
@@ -196,7 +198,9 @@
196#define CPU_34K 60 198#define CPU_34K 60
197#define CPU_PR4450 61 199#define CPU_PR4450 61
198#define CPU_SB1A 62 200#define CPU_SB1A 62
199#define CPU_LAST 62 201#define CPU_74K 63
202#define CPU_R14000 64
203#define CPU_LAST 64
200 204
201/* 205/*
202 * ISA Level encodings 206 * ISA Level encodings
diff --git a/include/asm-mips/delay.h b/include/asm-mips/delay.h
index 64dd45150f64..928f30f8c45c 100644
--- a/include/asm-mips/delay.h
+++ b/include/asm-mips/delay.h
@@ -19,20 +19,22 @@ static inline void __delay(unsigned long loops)
19{ 19{
20 if (sizeof(long) == 4) 20 if (sizeof(long) == 4)
21 __asm__ __volatile__ ( 21 __asm__ __volatile__ (
22 ".set\tnoreorder\n" 22 " .set noreorder \n"
23 "1:\tbnez\t%0,1b\n\t" 23 " .align 3 \n"
24 "subu\t%0,1\n\t" 24 "1: bnez %0, 1b \n"
25 ".set\treorder" 25 " subu %0, 1 \n"
26 " .set reorder \n"
26 : "=r" (loops) 27 : "=r" (loops)
27 : "0" (loops)); 28 : "0" (loops));
28 else if (sizeof(long) == 8) 29 else if (sizeof(long) == 8)
29 __asm__ __volatile__ ( 30 __asm__ __volatile__ (
30 ".set\tnoreorder\n" 31 " .set noreorder \n"
31 "1:\tbnez\t%0,1b\n\t" 32 " .align 3 \n"
32 "dsubu\t%0,1\n\t" 33 "1: bnez %0, 1b \n"
33 ".set\treorder" 34 " dsubu %0, 1 \n"
34 :"=r" (loops) 35 " .set reorder \n"
35 :"0" (loops)); 36 : "=r" (loops)
37 : "0" (loops));
36} 38}
37 39
38 40
diff --git a/include/asm-mips/ds1742.h b/include/asm-mips/ds1742.h
new file mode 100644
index 000000000000..c2f2c32da637
--- /dev/null
+++ b/include/asm-mips/ds1742.h
@@ -0,0 +1,13 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2006 by Ralf Baechle (ralf@linux-mips.org)
7 */
8#ifndef _ASM_DS1742_H
9#define _ASM_DS1742_H
10
11#include <ds1742.h>
12
13#endif /* _ASM_DS1742_H */
diff --git a/include/asm-mips/elf.h b/include/asm-mips/elf.h
index 851f013adad3..bdc9de2df1ef 100644
--- a/include/asm-mips/elf.h
+++ b/include/asm-mips/elf.h
@@ -119,8 +119,49 @@
119#define SHT_MIPS_CONFLICT 0x70000002 119#define SHT_MIPS_CONFLICT 0x70000002
120#define SHT_MIPS_GPTAB 0x70000003 120#define SHT_MIPS_GPTAB 0x70000003
121#define SHT_MIPS_UCODE 0x70000004 121#define SHT_MIPS_UCODE 0x70000004
122 122#define SHT_MIPS_DEBUG 0x70000005
123#define SHF_MIPS_GPREL 0x10000000 123#define SHT_MIPS_REGINFO 0x70000006
124#define SHT_MIPS_PACKAGE 0x70000007
125#define SHT_MIPS_PACKSYM 0x70000008
126#define SHT_MIPS_RELD 0x70000009
127#define SHT_MIPS_IFACE 0x7000000b
128#define SHT_MIPS_CONTENT 0x7000000c
129#define SHT_MIPS_OPTIONS 0x7000000d
130#define SHT_MIPS_SHDR 0x70000010
131#define SHT_MIPS_FDESC 0x70000011
132#define SHT_MIPS_EXTSYM 0x70000012
133#define SHT_MIPS_DENSE 0x70000013
134#define SHT_MIPS_PDESC 0x70000014
135#define SHT_MIPS_LOCSYM 0x70000015
136#define SHT_MIPS_AUXSYM 0x70000016
137#define SHT_MIPS_OPTSYM 0x70000017
138#define SHT_MIPS_LOCSTR 0x70000018
139#define SHT_MIPS_LINE 0x70000019
140#define SHT_MIPS_RFDESC 0x7000001a
141#define SHT_MIPS_DELTASYM 0x7000001b
142#define SHT_MIPS_DELTAINST 0x7000001c
143#define SHT_MIPS_DELTACLASS 0x7000001d
144#define SHT_MIPS_DWARF 0x7000001e
145#define SHT_MIPS_DELTADECL 0x7000001f
146#define SHT_MIPS_SYMBOL_LIB 0x70000020
147#define SHT_MIPS_EVENTS 0x70000021
148#define SHT_MIPS_TRANSLATE 0x70000022
149#define SHT_MIPS_PIXIE 0x70000023
150#define SHT_MIPS_XLATE 0x70000024
151#define SHT_MIPS_XLATE_DEBUG 0x70000025
152#define SHT_MIPS_WHIRL 0x70000026
153#define SHT_MIPS_EH_REGION 0x70000027
154#define SHT_MIPS_XLATE_OLD 0x70000028
155#define SHT_MIPS_PDR_EXCEPTION 0x70000029
156
157#define SHF_MIPS_GPREL 0x10000000
158#define SHF_MIPS_MERGE 0x20000000
159#define SHF_MIPS_ADDR 0x40000000
160#define SHF_MIPS_STRING 0x80000000
161#define SHF_MIPS_NOSTRIP 0x08000000
162#define SHF_MIPS_LOCAL 0x04000000
163#define SHF_MIPS_NAMES 0x02000000
164#define SHF_MIPS_NODUPES 0x01000000
124 165
125#ifndef ELF_ARCH 166#ifndef ELF_ARCH
126/* ELF register definitions */ 167/* ELF register definitions */
diff --git a/include/asm-mips/fpu.h b/include/asm-mips/fpu.h
index 9c828b1f8218..b0f50015e252 100644
--- a/include/asm-mips/fpu.h
+++ b/include/asm-mips/fpu.h
@@ -21,6 +21,10 @@
21#include <asm/processor.h> 21#include <asm/processor.h>
22#include <asm/current.h> 22#include <asm/current.h>
23 23
24#ifdef CONFIG_MIPS_MT_FPAFF
25#include <asm/mips_mt.h>
26#endif
27
24struct sigcontext; 28struct sigcontext;
25struct sigcontext32; 29struct sigcontext32;
26 30
diff --git a/include/asm-mips/futex.h b/include/asm-mips/futex.h
index a554089991f2..12d118f1bc9c 100644
--- a/include/asm-mips/futex.h
+++ b/include/asm-mips/futex.h
@@ -7,6 +7,7 @@
7#include <linux/futex.h> 7#include <linux/futex.h>
8#include <asm/errno.h> 8#include <asm/errno.h>
9#include <asm/uaccess.h> 9#include <asm/uaccess.h>
10#include <asm/war.h>
10 11
11#ifdef CONFIG_SMP 12#ifdef CONFIG_SMP
12#define __FUTEX_SMP_SYNC " sync \n" 13#define __FUTEX_SMP_SYNC " sync \n"
@@ -16,30 +17,58 @@
16 17
17#define __futex_atomic_op(insn, ret, oldval, uaddr, oparg) \ 18#define __futex_atomic_op(insn, ret, oldval, uaddr, oparg) \
18{ \ 19{ \
19 __asm__ __volatile__( \ 20 if (cpu_has_llsc && R10000_LLSC_WAR) { \
20 " .set push \n" \ 21 __asm__ __volatile__( \
21 " .set noat \n" \ 22 " .set push \n" \
22 " .set mips3 \n" \ 23 " .set noat \n" \
23 "1: ll %1, (%3) # __futex_atomic_op1 \n" \ 24 " .set mips3 \n" \
24 " .set mips0 \n" \ 25 "1: ll %1, (%3) # __futex_atomic_op \n" \
25 " " insn " \n" \ 26 " .set mips0 \n" \
26 " .set mips3 \n" \ 27 " " insn " \n" \
27 "2: sc $1, (%3) \n" \ 28 " .set mips3 \n" \
28 " beqzl $1, 1b \n" \ 29 "2: sc $1, (%3) \n" \
29 __FUTEX_SMP_SYNC \ 30 " beqzl $1, 1b \n" \
30 "3: \n" \ 31 __FUTEX_SMP_SYNC \
31 " .set pop \n" \ 32 "3: \n" \
32 " .set mips0 \n" \ 33 " .set pop \n" \
33 " .section .fixup,\"ax\" \n" \ 34 " .set mips0 \n" \
34 "4: li %0, %5 \n" \ 35 " .section .fixup,\"ax\" \n" \
35 " j 2b \n" \ 36 "4: li %0, %5 \n" \
36 " .previous \n" \ 37 " j 2b \n" \
37 " .section __ex_table,\"a\" \n" \ 38 " .previous \n" \
38 " "__UA_ADDR "\t1b, 4b \n" \ 39 " .section __ex_table,\"a\" \n" \
39 " "__UA_ADDR "\t2b, 4b \n" \ 40 " "__UA_ADDR "\t1b, 4b \n" \
40 " .previous \n" \ 41 " "__UA_ADDR "\t2b, 4b \n" \
41 : "=r" (ret), "=r" (oldval) \ 42 " .previous \n" \
42 : "0" (0), "r" (uaddr), "Jr" (oparg), "i" (-EFAULT)); \ 43 : "=r" (ret), "=r" (oldval) \
44 : "0" (0), "r" (uaddr), "Jr" (oparg), "i" (-EFAULT)); \
45 } else if (cpu_has_llsc) { \
46 __asm__ __volatile__( \
47 " .set push \n" \
48 " .set noat \n" \
49 " .set mips3 \n" \
50 "1: ll %1, (%3) # __futex_atomic_op \n" \
51 " .set mips0 \n" \
52 " " insn " \n" \
53 " .set mips3 \n" \
54 "2: sc $1, (%3) \n" \
55 " beqz $1, 1b \n" \
56 __FUTEX_SMP_SYNC \
57 "3: \n" \
58 " .set pop \n" \
59 " .set mips0 \n" \
60 " .section .fixup,\"ax\" \n" \
61 "4: li %0, %5 \n" \
62 " j 2b \n" \
63 " .previous \n" \
64 " .section __ex_table,\"a\" \n" \
65 " "__UA_ADDR "\t1b, 4b \n" \
66 " "__UA_ADDR "\t2b, 4b \n" \
67 " .previous \n" \
68 : "=r" (ret), "=r" (oldval) \
69 : "0" (0), "r" (uaddr), "Jr" (oparg), "i" (-EFAULT)); \
70 } else \
71 ret = -ENOSYS; \
43} 72}
44 73
45static inline int 74static inline int
@@ -102,7 +131,69 @@ futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
102static inline int 131static inline int
103futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval) 132futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
104{ 133{
105 return -ENOSYS; 134 int retval;
135
136 if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int)))
137 return -EFAULT;
138
139 if (cpu_has_llsc && R10000_LLSC_WAR) {
140 __asm__ __volatile__(
141 "# futex_atomic_cmpxchg_inatomic \n"
142 " .set push \n"
143 " .set noat \n"
144 " .set mips3 \n"
145 "1: ll %0, %2 \n"
146 " bne %0, %z3, 3f \n"
147 " .set mips0 \n"
148 " move $1, %z4 \n"
149 " .set mips3 \n"
150 "2: sc $1, %1 \n"
151 " beqzl $1, 1b \n"
152 __FUTEX_SMP_SYNC
153 "3: \n"
154 " .set pop \n"
155 " .section .fixup,\"ax\" \n"
156 "4: li %0, %5 \n"
157 " j 3b \n"
158 " .previous \n"
159 " .section __ex_table,\"a\" \n"
160 " "__UA_ADDR "\t1b, 4b \n"
161 " "__UA_ADDR "\t2b, 4b \n"
162 " .previous \n"
163 : "=&r" (retval), "=R" (*uaddr)
164 : "R" (*uaddr), "Jr" (oldval), "Jr" (newval), "i" (-EFAULT)
165 : "memory");
166 } else if (cpu_has_llsc) {
167 __asm__ __volatile__(
168 "# futex_atomic_cmpxchg_inatomic \n"
169 " .set push \n"
170 " .set noat \n"
171 " .set mips3 \n"
172 "1: ll %0, %2 \n"
173 " bne %0, %z3, 3f \n"
174 " .set mips0 \n"
175 " move $1, %z4 \n"
176 " .set mips3 \n"
177 "2: sc $1, %1 \n"
178 " beqz $1, 1b \n"
179 __FUTEX_SMP_SYNC
180 "3: \n"
181 " .set pop \n"
182 " .section .fixup,\"ax\" \n"
183 "4: li %0, %5 \n"
184 " j 3b \n"
185 " .previous \n"
186 " .section __ex_table,\"a\" \n"
187 " "__UA_ADDR "\t1b, 4b \n"
188 " "__UA_ADDR "\t2b, 4b \n"
189 " .previous \n"
190 : "=&r" (retval), "=R" (*uaddr)
191 : "R" (*uaddr), "Jr" (oldval), "Jr" (newval), "i" (-EFAULT)
192 : "memory");
193 } else
194 return -ENOSYS;
195
196 return retval;
106} 197}
107 198
108#endif 199#endif
diff --git a/include/asm-mips/hazards.h b/include/asm-mips/hazards.h
index feb29a793888..dadc05188db7 100644
--- a/include/asm-mips/hazards.h
+++ b/include/asm-mips/hazards.h
@@ -284,6 +284,8 @@ do { \
284#define instruction_hazard() do { } while (0) 284#define instruction_hazard() do { } while (0)
285#endif 285#endif
286 286
287extern void mips_ihb(void);
288
287#endif /* __ASSEMBLY__ */ 289#endif /* __ASSEMBLY__ */
288 290
289#endif /* _ASM_HAZARDS_H */ 291#endif /* _ASM_HAZARDS_H */
diff --git a/include/asm-mips/inst.h b/include/asm-mips/inst.h
index e0745f4ff624..1ed8d0f62577 100644
--- a/include/asm-mips/inst.h
+++ b/include/asm-mips/inst.h
@@ -6,6 +6,7 @@
6 * for more details. 6 * for more details.
7 * 7 *
8 * Copyright (C) 1996, 2000 by Ralf Baechle 8 * Copyright (C) 1996, 2000 by Ralf Baechle
9 * Copyright (C) 2006 by Thiemo Seufer
9 */ 10 */
10#ifndef _ASM_INST_H 11#ifndef _ASM_INST_H
11#define _ASM_INST_H 12#define _ASM_INST_H
@@ -21,14 +22,14 @@ enum major_op {
21 cop0_op, cop1_op, cop2_op, cop1x_op, 22 cop0_op, cop1_op, cop2_op, cop1x_op,
22 beql_op, bnel_op, blezl_op, bgtzl_op, 23 beql_op, bnel_op, blezl_op, bgtzl_op,
23 daddi_op, daddiu_op, ldl_op, ldr_op, 24 daddi_op, daddiu_op, ldl_op, ldr_op,
24 major_1c_op, jalx_op, major_1e_op, major_1f_op, 25 spec2_op, jalx_op, mdmx_op, spec3_op,
25 lb_op, lh_op, lwl_op, lw_op, 26 lb_op, lh_op, lwl_op, lw_op,
26 lbu_op, lhu_op, lwr_op, lwu_op, 27 lbu_op, lhu_op, lwr_op, lwu_op,
27 sb_op, sh_op, swl_op, sw_op, 28 sb_op, sh_op, swl_op, sw_op,
28 sdl_op, sdr_op, swr_op, cache_op, 29 sdl_op, sdr_op, swr_op, cache_op,
29 ll_op, lwc1_op, lwc2_op, pref_op, 30 ll_op, lwc1_op, lwc2_op, pref_op,
30 lld_op, ldc1_op, ldc2_op, ld_op, 31 lld_op, ldc1_op, ldc2_op, ld_op,
31 sc_op, swc1_op, swc2_op, rdhwr_op, 32 sc_op, swc1_op, swc2_op, major_3b_op,
32 scd_op, sdc1_op, sdc2_op, sd_op 33 scd_op, sdc1_op, sdc2_op, sd_op
33}; 34};
34 35
@@ -37,7 +38,7 @@ enum major_op {
37 */ 38 */
38enum spec_op { 39enum spec_op {
39 sll_op, movc_op, srl_op, sra_op, 40 sll_op, movc_op, srl_op, sra_op,
40 sllv_op, srlv_op, srav_op, spec1_unused_op, /* Opcode 0x07 is unused */ 41 sllv_op, pmon_op, srlv_op, srav_op,
41 jr_op, jalr_op, movz_op, movn_op, 42 jr_op, jalr_op, movz_op, movn_op,
42 syscall_op, break_op, spim_op, sync_op, 43 syscall_op, break_op, spim_op, sync_op,
43 mfhi_op, mthi_op, mflo_op, mtlo_op, 44 mfhi_op, mthi_op, mflo_op, mtlo_op,
@@ -55,6 +56,28 @@ enum spec_op {
55}; 56};
56 57
57/* 58/*
59 * func field of spec2 opcode.
60 */
61enum spec2_op {
62 madd_op, maddu_op, mul_op, spec2_3_unused_op,
63 msub_op, msubu_op, /* more unused ops */
64 clz_op = 0x20, clo_op,
65 dclz_op = 0x24, dclo_op,
66 sdbpp_op = 0x3f
67};
68
69/*
70 * func field of spec3 opcode.
71 */
72enum spec3_op {
73 ext_op, dextm_op, dextu_op, dext_op,
74 ins_op, dinsm_op, dinsu_op, dins_op,
75 bshfl_op = 0x20,
76 dbshfl_op = 0x24,
77 rdhwr_op = 0x3f
78};
79
80/*
58 * rt field of bcond opcodes. 81 * rt field of bcond opcodes.
59 */ 82 */
60enum rt_op { 83enum rt_op {
@@ -151,8 +174,8 @@ enum cop1x_func {
151 * func field for mad opcodes (MIPS IV). 174 * func field for mad opcodes (MIPS IV).
152 */ 175 */
153enum mad_func { 176enum mad_func {
154 madd_op = 0x08, msub_op = 0x0a, 177 madd_fp_op = 0x08, msub_fp_op = 0x0a,
155 nmadd_op = 0x0c, nmsub_op = 0x0e 178 nmadd_fp_op = 0x0c, nmsub_fp_op = 0x0e
156}; 179};
157 180
158/* 181/*
diff --git a/include/asm-mips/interrupt.h b/include/asm-mips/interrupt.h
index 774348734fa0..4bb9c06f4410 100644
--- a/include/asm-mips/interrupt.h
+++ b/include/asm-mips/interrupt.h
@@ -19,7 +19,12 @@ __asm__ (
19 " .set push \n" 19 " .set push \n"
20 " .set reorder \n" 20 " .set reorder \n"
21 " .set noat \n" 21 " .set noat \n"
22#ifdef CONFIG_CPU_MIPSR2 22#ifdef CONFIG_MIPS_MT_SMTC
23 " mfc0 $1, $2, 1 # SMTC - clear TCStatus.IXMT \n"
24 " ori $1, 0x400 \n"
25 " xori $1, 0x400 \n"
26 " mtc0 $1, $2, 1 \n"
27#elif defined(CONFIG_CPU_MIPSR2)
23 " ei \n" 28 " ei \n"
24#else 29#else
25 " mfc0 $1,$12 \n" 30 " mfc0 $1,$12 \n"
@@ -62,7 +67,12 @@ __asm__ (
62 " .macro local_irq_disable\n" 67 " .macro local_irq_disable\n"
63 " .set push \n" 68 " .set push \n"
64 " .set noat \n" 69 " .set noat \n"
65#ifdef CONFIG_CPU_MIPSR2 70#ifdef CONFIG_MIPS_MT_SMTC
71 " mfc0 $1, $2, 1 \n"
72 " ori $1, 0x400 \n"
73 " .set noreorder \n"
74 " mtc0 $1, $2, 1 \n"
75#elif defined(CONFIG_CPU_MIPSR2)
66 " di \n" 76 " di \n"
67#else 77#else
68 " mfc0 $1,$12 \n" 78 " mfc0 $1,$12 \n"
@@ -88,7 +98,11 @@ __asm__ (
88 " .macro local_save_flags flags \n" 98 " .macro local_save_flags flags \n"
89 " .set push \n" 99 " .set push \n"
90 " .set reorder \n" 100 " .set reorder \n"
101#ifdef CONFIG_MIPS_MT_SMTC
102 " mfc0 \\flags, $2, 1 \n"
103#else
91 " mfc0 \\flags, $12 \n" 104 " mfc0 \\flags, $12 \n"
105#endif
92 " .set pop \n" 106 " .set pop \n"
93 " .endm \n"); 107 " .endm \n");
94 108
@@ -102,7 +116,13 @@ __asm__ (
102 " .set push \n" 116 " .set push \n"
103 " .set reorder \n" 117 " .set reorder \n"
104 " .set noat \n" 118 " .set noat \n"
105#ifdef CONFIG_CPU_MIPSR2 119#ifdef CONFIG_MIPS_MT_SMTC
120 " mfc0 \\result, $2, 1 \n"
121 " ori $1, \\result, 0x400 \n"
122 " .set noreorder \n"
123 " mtc0 $1, $2, 1 \n"
124 " andi \\result, \\result, 0x400 \n"
125#elif defined(CONFIG_CPU_MIPSR2)
106 " di \\result \n" 126 " di \\result \n"
107 " andi \\result, 1 \n" 127 " andi \\result, 1 \n"
108#else 128#else
@@ -128,7 +148,14 @@ __asm__ (
128 " .set push \n" 148 " .set push \n"
129 " .set noreorder \n" 149 " .set noreorder \n"
130 " .set noat \n" 150 " .set noat \n"
131#if defined(CONFIG_CPU_MIPSR2) && defined(CONFIG_IRQ_CPU) 151#ifdef CONFIG_MIPS_MT_SMTC
152 "mfc0 $1, $2, 1 \n"
153 "andi \\flags, 0x400 \n"
154 "ori $1, 0x400 \n"
155 "xori $1, 0x400 \n"
156 "or \\flags, $1 \n"
157 "mtc0 \\flags, $2, 1 \n"
158#elif defined(CONFIG_CPU_MIPSR2) && defined(CONFIG_IRQ_CPU)
132 /* 159 /*
133 * Slow, but doesn't suffer from a relativly unlikely race 160 * Slow, but doesn't suffer from a relativly unlikely race
134 * condition we're having since days 1. 161 * condition we're having since days 1.
@@ -167,11 +194,29 @@ do { \
167 : "memory"); \ 194 : "memory"); \
168} while(0) 195} while(0)
169 196
170#define irqs_disabled() \ 197static inline int irqs_disabled(void)
171({ \ 198{
172 unsigned long flags; \ 199#ifdef CONFIG_MIPS_MT_SMTC
173 local_save_flags(flags); \ 200 /*
174 !(flags & 1); \ 201 * SMTC model uses TCStatus.IXMT to disable interrupts for a thread/CPU
175}) 202 */
203 unsigned long __result;
204
205 __asm__ __volatile__(
206 " .set noreorder \n"
207 " mfc0 %0, $2, 1 \n"
208 " andi %0, 0x400 \n"
209 " slt %0, $0, %0 \n"
210 " .set reorder \n"
211 : "=r" (__result));
212
213 return __result;
214#else
215 unsigned long flags;
216 local_save_flags(flags);
217
218 return !(flags & 1);
219#endif
220}
176 221
177#endif /* _ASM_INTERRUPT_H */ 222#endif /* _ASM_INTERRUPT_H */
diff --git a/include/asm-mips/irq.h b/include/asm-mips/irq.h
index 8a342ccb34a8..dde677f02bc0 100644
--- a/include/asm-mips/irq.h
+++ b/include/asm-mips/irq.h
@@ -11,6 +11,9 @@
11 11
12#include <linux/config.h> 12#include <linux/config.h>
13#include <linux/linkage.h> 13#include <linux/linkage.h>
14
15#include <asm/mipsmtregs.h>
16
14#include <irq.h> 17#include <irq.h>
15 18
16#ifdef CONFIG_I8259 19#ifdef CONFIG_I8259
@@ -26,6 +29,23 @@ struct pt_regs;
26 29
27extern asmlinkage unsigned int do_IRQ(unsigned int irq, struct pt_regs *regs); 30extern asmlinkage unsigned int do_IRQ(unsigned int irq, struct pt_regs *regs);
28 31
32#ifdef CONFIG_MIPS_MT_SMTC
33/*
34 * Clear interrupt mask handling "backstop" if irq_hwmask
35 * entry so indicates. This implies that the ack() or end()
36 * functions will take over re-enabling the low-level mask.
37 * Otherwise it will be done on return from exception.
38 */
39#define __DO_IRQ_SMTC_HOOK() \
40do { \
41 if (irq_hwmask[irq] & 0x0000ff00) \
42 write_c0_tccontext(read_c0_tccontext() & \
43 ~(irq_hwmask[irq] & 0x0000ff00)); \
44} while (0)
45#else
46#define __DO_IRQ_SMTC_HOOK() do { } while (0)
47#endif
48
29#ifdef CONFIG_PREEMPT 49#ifdef CONFIG_PREEMPT
30 50
31/* 51/*
@@ -39,6 +59,7 @@ extern asmlinkage unsigned int do_IRQ(unsigned int irq, struct pt_regs *regs);
39#define do_IRQ(irq, regs) \ 59#define do_IRQ(irq, regs) \
40do { \ 60do { \
41 irq_enter(); \ 61 irq_enter(); \
62 __DO_IRQ_SMTC_HOOK(); \
42 __do_IRQ((irq), (regs)); \ 63 __do_IRQ((irq), (regs)); \
43 irq_exit(); \ 64 irq_exit(); \
44} while (0) 65} while (0)
@@ -46,5 +67,14 @@ do { \
46#endif 67#endif
47 68
48extern void arch_init_irq(void); 69extern void arch_init_irq(void);
70extern void spurious_interrupt(struct pt_regs *regs);
71
72#ifdef CONFIG_MIPS_MT_SMTC
73struct irqaction;
74
75extern unsigned long irq_hwmask[];
76extern int setup_irq_smtc(unsigned int irq, struct irqaction * new,
77 unsigned long hwmask);
78#endif /* CONFIG_MIPS_MT_SMTC */
49 79
50#endif /* _ASM_IRQ_H */ 80#endif /* _ASM_IRQ_H */
diff --git a/include/asm-mips/kspd.h b/include/asm-mips/kspd.h
new file mode 100644
index 000000000000..4e9e724c8935
--- /dev/null
+++ b/include/asm-mips/kspd.h
@@ -0,0 +1,36 @@
1/*
2 * Copyright (C) 2005 MIPS Technologies, Inc. All rights reserved.
3 *
4 * This program is free software; you can distribute it and/or modify it
5 * under the terms of the GNU General Public License (Version 2) as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11 * for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
16 *
17 */
18
19#ifndef _ASM_KSPD_H
20#define _ASM_KSPD_H
21
22struct kspd_notifications {
23 void (*kspd_sp_exit)(int sp_id);
24
25 struct list_head list;
26};
27
28#ifdef CONFIG_MIPS_APSP_KSPD
29extern void kspd_notify(struct kspd_notifications *notify);
30#else
31static inline void kspd_notify(struct kspd_notifications *notify)
32{
33}
34#endif
35
36#endif
diff --git a/include/asm-mips/mach-generic/ide.h b/include/asm-mips/mach-generic/ide.h
index 550979a9ea9d..e3315359500a 100644
--- a/include/asm-mips/mach-generic/ide.h
+++ b/include/asm-mips/mach-generic/ide.h
@@ -104,65 +104,107 @@ static __inline__ unsigned long ide_default_io_base(int index)
104#endif 104#endif
105 105
106/* MIPS port and memory-mapped I/O string operations. */ 106/* MIPS port and memory-mapped I/O string operations. */
107static inline void __ide_flush_prologue(void)
108{
109#ifdef CONFIG_SMP
110 if (cpu_has_dc_aliases)
111 preempt_disable();
112#endif
113}
114
115static inline void __ide_flush_epilogue(void)
116{
117#ifdef CONFIG_SMP
118 if (cpu_has_dc_aliases)
119 preempt_enable();
120#endif
121}
107 122
108static inline void __ide_flush_dcache_range(unsigned long addr, unsigned long size) 123static inline void __ide_flush_dcache_range(unsigned long addr, unsigned long size)
109{ 124{
110 if (cpu_has_dc_aliases) { 125 if (cpu_has_dc_aliases) {
111 unsigned long end = addr + size; 126 unsigned long end = addr + size;
112 for (; addr < end; addr += PAGE_SIZE) 127
113 flush_dcache_page(virt_to_page(addr)); 128 while (addr < end) {
129 local_flush_data_cache_page((void *)addr);
130 addr += PAGE_SIZE;
131 }
114 } 132 }
115} 133}
116 134
135/*
136 * insw() and gang might be called with interrupts disabled, so we can't
137 * send IPIs for flushing due to the potencial of deadlocks, see the comment
138 * above smp_call_function() in arch/mips/kernel/smp.c. We work around the
139 * problem by disabling preemption so we know we actually perform the flush
140 * on the processor that actually has the lines to be flushed which hopefully
141 * is even better for performance anyway.
142 */
117static inline void __ide_insw(unsigned long port, void *addr, 143static inline void __ide_insw(unsigned long port, void *addr,
118 unsigned int count) 144 unsigned int count)
119{ 145{
146 __ide_flush_prologue();
120 insw(port, addr, count); 147 insw(port, addr, count);
121 __ide_flush_dcache_range((unsigned long)addr, count * 2); 148 __ide_flush_dcache_range((unsigned long)addr, count * 2);
149 __ide_flush_epilogue();
122} 150}
123 151
124static inline void __ide_insl(unsigned long port, void *addr, unsigned int count) 152static inline void __ide_insl(unsigned long port, void *addr, unsigned int count)
125{ 153{
154 __ide_flush_prologue();
126 insl(port, addr, count); 155 insl(port, addr, count);
127 __ide_flush_dcache_range((unsigned long)addr, count * 4); 156 __ide_flush_dcache_range((unsigned long)addr, count * 4);
157 __ide_flush_epilogue();
128} 158}
129 159
130static inline void __ide_outsw(unsigned long port, const void *addr, 160static inline void __ide_outsw(unsigned long port, const void *addr,
131 unsigned long count) 161 unsigned long count)
132{ 162{
163 __ide_flush_prologue();
133 outsw(port, addr, count); 164 outsw(port, addr, count);
134 __ide_flush_dcache_range((unsigned long)addr, count * 2); 165 __ide_flush_dcache_range((unsigned long)addr, count * 2);
166 __ide_flush_epilogue();
135} 167}
136 168
137static inline void __ide_outsl(unsigned long port, const void *addr, 169static inline void __ide_outsl(unsigned long port, const void *addr,
138 unsigned long count) 170 unsigned long count)
139{ 171{
172 __ide_flush_prologue();
140 outsl(port, addr, count); 173 outsl(port, addr, count);
141 __ide_flush_dcache_range((unsigned long)addr, count * 4); 174 __ide_flush_dcache_range((unsigned long)addr, count * 4);
175 __ide_flush_epilogue();
142} 176}
143 177
144static inline void __ide_mm_insw(void __iomem *port, void *addr, u32 count) 178static inline void __ide_mm_insw(void __iomem *port, void *addr, u32 count)
145{ 179{
180 __ide_flush_prologue();
146 readsw(port, addr, count); 181 readsw(port, addr, count);
147 __ide_flush_dcache_range((unsigned long)addr, count * 2); 182 __ide_flush_dcache_range((unsigned long)addr, count * 2);
183 __ide_flush_epilogue();
148} 184}
149 185
150static inline void __ide_mm_insl(void __iomem *port, void *addr, u32 count) 186static inline void __ide_mm_insl(void __iomem *port, void *addr, u32 count)
151{ 187{
188 __ide_flush_prologue();
152 readsl(port, addr, count); 189 readsl(port, addr, count);
153 __ide_flush_dcache_range((unsigned long)addr, count * 4); 190 __ide_flush_dcache_range((unsigned long)addr, count * 4);
191 __ide_flush_epilogue();
154} 192}
155 193
156static inline void __ide_mm_outsw(void __iomem *port, void *addr, u32 count) 194static inline void __ide_mm_outsw(void __iomem *port, void *addr, u32 count)
157{ 195{
196 __ide_flush_prologue();
158 writesw(port, addr, count); 197 writesw(port, addr, count);
159 __ide_flush_dcache_range((unsigned long)addr, count * 2); 198 __ide_flush_dcache_range((unsigned long)addr, count * 2);
199 __ide_flush_epilogue();
160} 200}
161 201
162static inline void __ide_mm_outsl(void __iomem * port, void *addr, u32 count) 202static inline void __ide_mm_outsl(void __iomem * port, void *addr, u32 count)
163{ 203{
204 __ide_flush_prologue();
164 writesl(port, addr, count); 205 writesl(port, addr, count);
165 __ide_flush_dcache_range((unsigned long)addr, count * 4); 206 __ide_flush_dcache_range((unsigned long)addr, count * 4);
207 __ide_flush_epilogue();
166} 208}
167 209
168/* ide_insw calls insw, not __ide_insw. Why? */ 210/* ide_insw calls insw, not __ide_insw. Why? */
diff --git a/include/asm-mips/mach-jmr3927/ds1742.h b/include/asm-mips/mach-jmr3927/ds1742.h
index cff6192d4bdb..8a8fef6d07fa 100644
--- a/include/asm-mips/mach-jmr3927/ds1742.h
+++ b/include/asm-mips/mach-jmr3927/ds1742.h
@@ -3,14 +3,14 @@
3 * License. See the file "COPYING" in the main directory of this archive 3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details. 4 * for more details.
5 * 5 *
6 * Copyright (C) 2003 by Ralf Baechle 6 * Copyright (C) 2003, 06 by Ralf Baechle
7 */ 7 */
8#ifndef __ASM_MACH_JMR3927_DS1742_H 8#ifndef __ASM_MACH_JMR3927_DS1742_H
9#define __ASM_MACH_JMR3927_DS1742_H 9#define __ASM_MACH_JMR3927_DS1742_H
10 10
11#include <asm/jmr3927/jmr3927.h> 11#include <asm/jmr3927/jmr3927.h>
12 12
13#define rtc_read(reg) (jmr3927_nvram_in(addr)) 13#define rtc_read(reg) (jmr3927_nvram_in(reg))
14#define rtc_write(data, reg) (jmr3927_nvram_out((data),(reg))) 14#define rtc_write(data, reg) (jmr3927_nvram_out((data),(reg)))
15 15
16#endif /* __ASM_MACH_JMR3927_DS1742_H */ 16#endif /* __ASM_MACH_JMR3927_DS1742_H */
diff --git a/include/asm-mips/mach-mips/param.h b/include/asm-mips/mach-mips/param.h
new file mode 100644
index 000000000000..805ef6d27d3c
--- /dev/null
+++ b/include/asm-mips/mach-mips/param.h
@@ -0,0 +1,13 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2003 by Ralf Baechle
7 */
8#ifndef __ASM_MACH_MIPS_PARAM_H
9#define __ASM_MACH_MIPS_PARAM_H
10
11#define HZ 100 /* Internal kernel timer frequency */
12
13#endif /* __ASM_MACH_MIPS_PARAM_H */
diff --git a/include/asm-mips/marvell.h b/include/asm-mips/marvell.h
index 9225b3397a4f..6bb2125bb053 100644
--- a/include/asm-mips/marvell.h
+++ b/include/asm-mips/marvell.h
@@ -53,4 +53,6 @@ struct mv_pci_controller {
53 unsigned long config_vreg; 53 unsigned long config_vreg;
54}; 54};
55 55
56extern void ll_mv64340_irq(struct pt_regs *regs);
57
56#endif /* __ASM_MIPS_MARVELL_H */ 58#endif /* __ASM_MIPS_MARVELL_H */
diff --git a/include/asm-mips/mips-boards/atlas.h b/include/asm-mips/mips-boards/atlas.h
index 0998151fb3a1..a8ae12d120ee 100644
--- a/include/asm-mips/mips-boards/atlas.h
+++ b/include/asm-mips/mips-boards/atlas.h
@@ -33,13 +33,29 @@
33#define ATLAS_RTC_ADR_REG 0x1f000800 33#define ATLAS_RTC_ADR_REG 0x1f000800
34#define ATLAS_RTC_DAT_REG 0x1f000808 34#define ATLAS_RTC_DAT_REG 0x1f000808
35 35
36
37/* 36/*
38 * Atlas interrupt controller register base. 37 * Atlas interrupt controller register base.
39 */ 38 */
40#define ATLAS_ICTRL_REGS_BASE 0x1f000000 39#define ATLAS_ICTRL_REGS_BASE 0x1f000000
41 40
42/* 41/*
42 * Atlas registers are memory mapped on 64-bit aligned boundaries and
43 * only word access are allowed.
44 */
45struct atlas_ictrl_regs {
46 volatile unsigned int intraw;
47 int dummy1;
48 volatile unsigned int intseten;
49 int dummy2;
50 volatile unsigned int intrsten;
51 int dummy3;
52 volatile unsigned int intenable;
53 int dummy4;
54 volatile unsigned int intstatus;
55 int dummy5;
56};
57
58/*
43 * Atlas UART register base. 59 * Atlas UART register base.
44 */ 60 */
45#define ATLAS_UART_REGS_BASE 0x1f000900 61#define ATLAS_UART_REGS_BASE 0x1f000900
diff --git a/include/asm-mips/mips-boards/atlasint.h b/include/asm-mips/mips-boards/atlasint.h
index bba35c183d08..fd7ebc54fa90 100644
--- a/include/asm-mips/mips-boards/atlasint.h
+++ b/include/asm-mips/mips-boards/atlasint.h
@@ -62,23 +62,4 @@
62#define ATLASINT_RES31 (ATLASINT_BASE+31) 62#define ATLASINT_RES31 (ATLASINT_BASE+31)
63#define ATLASINT_END (ATLASINT_BASE+31) 63#define ATLASINT_END (ATLASINT_BASE+31)
64 64
65/*
66 * Atlas registers are memory mapped on 64-bit aligned boundaries and
67 * only word access are allowed.
68 */
69struct atlas_ictrl_regs {
70 volatile unsigned int intraw;
71 int dummy1;
72 volatile unsigned int intseten;
73 int dummy2;
74 volatile unsigned int intrsten;
75 int dummy3;
76 volatile unsigned int intenable;
77 int dummy4;
78 volatile unsigned int intstatus;
79 int dummy5;
80};
81
82extern void atlasint_init(void);
83
84#endif /* !(_MIPS_ATLASINT_H) */ 65#endif /* !(_MIPS_ATLASINT_H) */
diff --git a/include/asm-mips/mips-boards/generic.h b/include/asm-mips/mips-boards/generic.h
index 25b6ffc26623..fa8b913cc3e0 100644
--- a/include/asm-mips/mips-boards/generic.h
+++ b/include/asm-mips/mips-boards/generic.h
@@ -67,6 +67,7 @@
67#define MIPS_REVISION_CORID_CORE_FPGA2 7 67#define MIPS_REVISION_CORID_CORE_FPGA2 7
68#define MIPS_REVISION_CORID_CORE_FPGAR2 8 68#define MIPS_REVISION_CORID_CORE_FPGAR2 8
69#define MIPS_REVISION_CORID_CORE_FPGA3 9 69#define MIPS_REVISION_CORID_CORE_FPGA3 9
70#define MIPS_REVISION_CORID_CORE_24K 10
70 71
71/**** Artificial corid defines ****/ 72/**** Artificial corid defines ****/
72/* 73/*
diff --git a/include/asm-mips/mips_mt.h b/include/asm-mips/mips_mt.h
new file mode 100644
index 000000000000..c31a312b9783
--- /dev/null
+++ b/include/asm-mips/mips_mt.h
@@ -0,0 +1,15 @@
1/*
2 * Definitions and decalrations for MIPS MT support
3 * that are common between SMTC, VSMP, and/or AP/SP
4 * kernel models.
5 */
6#ifndef __ASM_MIPS_MT_H
7#define __ASM_MIPS_MT_H
8
9extern cpumask_t mt_fpu_cpumask;
10extern unsigned long mt_fpemul_threshold;
11
12extern void mips_mt_regdump(unsigned long previous_mvpcontrol_value);
13extern void mips_mt_set_cpuoptions(void);
14
15#endif /* __ASM_MIPS_MT_H */
diff --git a/include/asm-mips/mipsmtregs.h b/include/asm-mips/mipsmtregs.h
index a669c0702c66..f637ce70758f 100644
--- a/include/asm-mips/mipsmtregs.h
+++ b/include/asm-mips/mipsmtregs.h
@@ -165,7 +165,7 @@
165 165
166#ifndef __ASSEMBLY__ 166#ifndef __ASSEMBLY__
167 167
168extern void mips_mt_regdump(void); 168extern void mips_mt_regdump(unsigned long previous_mvpcontrol_value);
169 169
170static inline unsigned int dvpe(void) 170static inline unsigned int dvpe(void)
171{ 171{
@@ -234,7 +234,7 @@ static inline void __raw_emt(void)
234 __asm__ __volatile__( 234 __asm__ __volatile__(
235 " .set noreorder \n" 235 " .set noreorder \n"
236 " .set mips32r2 \n" 236 " .set mips32r2 \n"
237 " emt \n" 237 " .word 0x41600be1 # emt \n"
238 " ehb \n" 238 " ehb \n"
239 " .set mips0 \n" 239 " .set mips0 \n"
240 " .set reorder"); 240 " .set reorder");
@@ -282,8 +282,11 @@ static inline void ehb(void)
282 \ 282 \
283 __asm__ __volatile__( \ 283 __asm__ __volatile__( \
284 " .set push \n" \ 284 " .set push \n" \
285 " .set noat \n" \
285 " .set mips32r2 \n" \ 286 " .set mips32r2 \n" \
286 " mftgpr %0," #rt " \n" \ 287 " # mftgpr $1," #rt " \n" \
288 " .word 0x41000820 | (" #rt " << 16) \n" \
289 " move %0, $1 \n" \
287 " .set pop \n" \ 290 " .set pop \n" \
288 : "=r" (__res)); \ 291 : "=r" (__res)); \
289 \ 292 \
@@ -295,9 +298,7 @@ static inline void ehb(void)
295 unsigned long __res; \ 298 unsigned long __res; \
296 \ 299 \
297 __asm__ __volatile__( \ 300 __asm__ __volatile__( \
298 ".set noat\n\t" \ 301 " mftr %0, " #rt ", " #u ", " #sel " \n" \
299 "mftr\t%0, " #rt ", " #u ", " #sel "\n\t" \
300 ".set at\n\t" \
301 : "=r" (__res)); \ 302 : "=r" (__res)); \
302 \ 303 \
303 __res; \ 304 __res; \
@@ -364,6 +365,9 @@ do { \
364#define read_vpe_c0_ebase() mftc0(15,1) 365#define read_vpe_c0_ebase() mftc0(15,1)
365#define write_vpe_c0_ebase(val) mttc0(15, 1, val) 366#define write_vpe_c0_ebase(val) mttc0(15, 1, val)
366#define write_vpe_c0_compare(val) mttc0(11, 0, val) 367#define write_vpe_c0_compare(val) mttc0(11, 0, val)
368#define read_vpe_c0_badvaddr() mftc0(8, 0)
369#define read_vpe_c0_epc() mftc0(14, 0)
370#define write_vpe_c0_epc(val) mttc0(14, 0, val)
367 371
368 372
369/* TC */ 373/* TC */
diff --git a/include/asm-mips/mipsregs.h b/include/asm-mips/mipsregs.h
index 035ba0a9b0df..5af7517fce8a 100644
--- a/include/asm-mips/mipsregs.h
+++ b/include/asm-mips/mipsregs.h
@@ -291,7 +291,7 @@
291#define ST0_DL (_ULCAST_(1) << 24) 291#define ST0_DL (_ULCAST_(1) << 24)
292 292
293/* 293/*
294 * Enable the MIPS DSP ASE 294 * Enable the MIPS MDMX and DSP ASEs
295 */ 295 */
296#define ST0_MX 0x01000000 296#define ST0_MX 0x01000000
297 297
@@ -836,6 +836,9 @@ do { \
836#define read_c0_cache() __read_32bit_c0_register($7, 0) /* TX39xx */ 836#define read_c0_cache() __read_32bit_c0_register($7, 0) /* TX39xx */
837#define write_c0_cache(val) __write_32bit_c0_register($7, 0, val) 837#define write_c0_cache(val) __write_32bit_c0_register($7, 0, val)
838 838
839#define read_c0_badvaddr() __read_ulong_c0_register($8, 0)
840#define write_c0_badvaddr(val) __write_ulong_c0_register($8, 0, val)
841
839#define read_c0_count() __read_32bit_c0_register($9, 0) 842#define read_c0_count() __read_32bit_c0_register($9, 0)
840#define write_c0_count(val) __write_32bit_c0_register($9, 0, val) 843#define write_c0_count(val) __write_32bit_c0_register($9, 0, val)
841 844
@@ -858,7 +861,19 @@ do { \
858#define write_c0_compare3(val) __write_32bit_c0_register($11, 7, val) 861#define write_c0_compare3(val) __write_32bit_c0_register($11, 7, val)
859 862
860#define read_c0_status() __read_32bit_c0_register($12, 0) 863#define read_c0_status() __read_32bit_c0_register($12, 0)
864#ifdef CONFIG_MIPS_MT_SMTC
865#define write_c0_status(val) \
866do { \
867 __write_32bit_c0_register($12, 0, val); \
868 __ehb(); \
869} while (0)
870#else
871/*
872 * Legacy non-SMTC code, which may be hazardous
873 * but which might not support EHB
874 */
861#define write_c0_status(val) __write_32bit_c0_register($12, 0, val) 875#define write_c0_status(val) __write_32bit_c0_register($12, 0, val)
876#endif /* CONFIG_MIPS_MT_SMTC */
862 877
863#define read_c0_cause() __read_32bit_c0_register($13, 0) 878#define read_c0_cause() __read_32bit_c0_register($13, 0)
864#define write_c0_cause(val) __write_32bit_c0_register($13, 0, val) 879#define write_c0_cause(val) __write_32bit_c0_register($13, 0, val)
@@ -1001,6 +1016,9 @@ do { \
1001#define read_c0_taglo() __read_32bit_c0_register($28, 0) 1016#define read_c0_taglo() __read_32bit_c0_register($28, 0)
1002#define write_c0_taglo(val) __write_32bit_c0_register($28, 0, val) 1017#define write_c0_taglo(val) __write_32bit_c0_register($28, 0, val)
1003 1018
1019#define read_c0_dtaglo() __read_32bit_c0_register($28, 2)
1020#define write_c0_dtaglo(val) __write_32bit_c0_register($28, 2, val)
1021
1004#define read_c0_taghi() __read_32bit_c0_register($29, 0) 1022#define read_c0_taghi() __read_32bit_c0_register($29, 0)
1005#define write_c0_taghi(val) __write_32bit_c0_register($29, 0, val) 1023#define write_c0_taghi(val) __write_32bit_c0_register($29, 0, val)
1006 1024
@@ -1354,15 +1372,119 @@ static inline void tlb_write_random(void)
1354/* 1372/*
1355 * Manipulate bits in a c0 register. 1373 * Manipulate bits in a c0 register.
1356 */ 1374 */
1375#ifndef CONFIG_MIPS_MT_SMTC
1376/*
1377 * SMTC Linux requires shutting-down microthread scheduling
1378 * during CP0 register read-modify-write sequences.
1379 */
1380#define __BUILD_SET_C0(name) \
1381static inline unsigned int \
1382set_c0_##name(unsigned int set) \
1383{ \
1384 unsigned int res; \
1385 \
1386 res = read_c0_##name(); \
1387 res |= set; \
1388 write_c0_##name(res); \
1389 \
1390 return res; \
1391} \
1392 \
1393static inline unsigned int \
1394clear_c0_##name(unsigned int clear) \
1395{ \
1396 unsigned int res; \
1397 \
1398 res = read_c0_##name(); \
1399 res &= ~clear; \
1400 write_c0_##name(res); \
1401 \
1402 return res; \
1403} \
1404 \
1405static inline unsigned int \
1406change_c0_##name(unsigned int change, unsigned int new) \
1407{ \
1408 unsigned int res; \
1409 \
1410 res = read_c0_##name(); \
1411 res &= ~change; \
1412 res |= (new & change); \
1413 write_c0_##name(res); \
1414 \
1415 return res; \
1416}
1417
1418#else /* SMTC versions that manage MT scheduling */
1419
1420#include <asm/interrupt.h>
1421
1422/*
1423 * This is a duplicate of dmt() in mipsmtregs.h to avoid problems with
1424 * header file recursion.
1425 */
1426static inline unsigned int __dmt(void)
1427{
1428 int res;
1429
1430 __asm__ __volatile__(
1431 " .set push \n"
1432 " .set mips32r2 \n"
1433 " .set noat \n"
1434 " .word 0x41610BC1 # dmt $1 \n"
1435 " ehb \n"
1436 " move %0, $1 \n"
1437 " .set pop \n"
1438 : "=r" (res));
1439
1440 instruction_hazard();
1441
1442 return res;
1443}
1444
1445#define __VPECONTROL_TE_SHIFT 15
1446#define __VPECONTROL_TE (1UL << __VPECONTROL_TE_SHIFT)
1447
1448#define __EMT_ENABLE __VPECONTROL_TE
1449
1450static inline void __emt(unsigned int previous)
1451{
1452 if ((previous & __EMT_ENABLE))
1453 __asm__ __volatile__(
1454 " .set noreorder \n"
1455 " .set mips32r2 \n"
1456 " .word 0x41600be1 # emt \n"
1457 " ehb \n"
1458 " .set mips0 \n"
1459 " .set reorder \n");
1460}
1461
1462static inline void __ehb(void)
1463{
1464 __asm__ __volatile__(
1465 " ehb \n");
1466}
1467
1468/*
1469 * Note that local_irq_save/restore affect TC-specific IXMT state,
1470 * not Status.IE as in non-SMTC kernel.
1471 */
1472
1357#define __BUILD_SET_C0(name) \ 1473#define __BUILD_SET_C0(name) \
1358static inline unsigned int \ 1474static inline unsigned int \
1359set_c0_##name(unsigned int set) \ 1475set_c0_##name(unsigned int set) \
1360{ \ 1476{ \
1361 unsigned int res; \ 1477 unsigned int res; \
1478 unsigned int omt; \
1479 unsigned int flags; \
1362 \ 1480 \
1481 local_irq_save(flags); \
1482 omt = __dmt(); \
1363 res = read_c0_##name(); \ 1483 res = read_c0_##name(); \
1364 res |= set; \ 1484 res |= set; \
1365 write_c0_##name(res); \ 1485 write_c0_##name(res); \
1486 __emt(omt); \
1487 local_irq_restore(flags); \
1366 \ 1488 \
1367 return res; \ 1489 return res; \
1368} \ 1490} \
@@ -1371,10 +1493,16 @@ static inline unsigned int \
1371clear_c0_##name(unsigned int clear) \ 1493clear_c0_##name(unsigned int clear) \
1372{ \ 1494{ \
1373 unsigned int res; \ 1495 unsigned int res; \
1496 unsigned int omt; \
1497 unsigned int flags; \
1374 \ 1498 \
1499 local_irq_save(flags); \
1500 omt = __dmt(); \
1375 res = read_c0_##name(); \ 1501 res = read_c0_##name(); \
1376 res &= ~clear; \ 1502 res &= ~clear; \
1377 write_c0_##name(res); \ 1503 write_c0_##name(res); \
1504 __emt(omt); \
1505 local_irq_restore(flags); \
1378 \ 1506 \
1379 return res; \ 1507 return res; \
1380} \ 1508} \
@@ -1383,14 +1511,22 @@ static inline unsigned int \
1383change_c0_##name(unsigned int change, unsigned int new) \ 1511change_c0_##name(unsigned int change, unsigned int new) \
1384{ \ 1512{ \
1385 unsigned int res; \ 1513 unsigned int res; \
1514 unsigned int omt; \
1515 unsigned int flags; \
1386 \ 1516 \
1517 local_irq_save(flags); \
1518 \
1519 omt = __dmt(); \
1387 res = read_c0_##name(); \ 1520 res = read_c0_##name(); \
1388 res &= ~change; \ 1521 res &= ~change; \
1389 res |= (new & change); \ 1522 res |= (new & change); \
1390 write_c0_##name(res); \ 1523 write_c0_##name(res); \
1524 __emt(omt); \
1525 local_irq_restore(flags); \
1391 \ 1526 \
1392 return res; \ 1527 return res; \
1393} 1528}
1529#endif
1394 1530
1395__BUILD_SET_C0(status) 1531__BUILD_SET_C0(status)
1396__BUILD_SET_C0(cause) 1532__BUILD_SET_C0(cause)
diff --git a/include/asm-mips/mmu_context.h b/include/asm-mips/mmu_context.h
index 61cf22588137..6e09f4c87211 100644
--- a/include/asm-mips/mmu_context.h
+++ b/include/asm-mips/mmu_context.h
@@ -17,6 +17,10 @@
17#include <linux/slab.h> 17#include <linux/slab.h>
18#include <asm/cacheflush.h> 18#include <asm/cacheflush.h>
19#include <asm/tlbflush.h> 19#include <asm/tlbflush.h>
20#ifdef CONFIG_MIPS_MT_SMTC
21#include <asm/mipsmtregs.h>
22#include <asm/smtc.h>
23#endif /* SMTC */
20 24
21/* 25/*
22 * For the fast tlb miss handlers, we keep a per cpu array of pointers 26 * For the fast tlb miss handlers, we keep a per cpu array of pointers
@@ -54,6 +58,14 @@ extern unsigned long pgd_current[];
54#define ASID_INC 0x1 58#define ASID_INC 0x1
55#define ASID_MASK 0xfff 59#define ASID_MASK 0xfff
56 60
61/* SMTC/34K debug hack - but maybe we'll keep it */
62#elif defined(CONFIG_MIPS_MT_SMTC)
63
64#define ASID_INC 0x1
65extern unsigned long smtc_asid_mask;
66#define ASID_MASK (smtc_asid_mask)
67#define HW_ASID_MASK 0xff
68/* End SMTC/34K debug hack */
57#else /* FIXME: not correct for R6000 */ 69#else /* FIXME: not correct for R6000 */
58 70
59#define ASID_INC 0x1 71#define ASID_INC 0x1
@@ -76,6 +88,8 @@ static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
76#define ASID_VERSION_MASK ((unsigned long)~(ASID_MASK|(ASID_MASK-1))) 88#define ASID_VERSION_MASK ((unsigned long)~(ASID_MASK|(ASID_MASK-1)))
77#define ASID_FIRST_VERSION ((unsigned long)(~ASID_VERSION_MASK) + 1) 89#define ASID_FIRST_VERSION ((unsigned long)(~ASID_VERSION_MASK) + 1)
78 90
91#ifndef CONFIG_MIPS_MT_SMTC
92/* Normal, classic MIPS get_new_mmu_context */
79static inline void 93static inline void
80get_new_mmu_context(struct mm_struct *mm, unsigned long cpu) 94get_new_mmu_context(struct mm_struct *mm, unsigned long cpu)
81{ 95{
@@ -91,6 +105,12 @@ get_new_mmu_context(struct mm_struct *mm, unsigned long cpu)
91 cpu_context(cpu, mm) = asid_cache(cpu) = asid; 105 cpu_context(cpu, mm) = asid_cache(cpu) = asid;
92} 106}
93 107
108#else /* CONFIG_MIPS_MT_SMTC */
109
110#define get_new_mmu_context(mm,cpu) smtc_get_new_mmu_context((mm),(cpu))
111
112#endif /* CONFIG_MIPS_MT_SMTC */
113
94/* 114/*
95 * Initialize the context related info for a new mm_struct 115 * Initialize the context related info for a new mm_struct
96 * instance. 116 * instance.
@@ -111,14 +131,46 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
111{ 131{
112 unsigned int cpu = smp_processor_id(); 132 unsigned int cpu = smp_processor_id();
113 unsigned long flags; 133 unsigned long flags;
114 134#ifdef CONFIG_MIPS_MT_SMTC
135 unsigned long oldasid;
136 unsigned long mtflags;
137 int mytlb = (smtc_status & SMTC_TLB_SHARED) ? 0 : cpu_data[cpu].vpe_id;
115 local_irq_save(flags); 138 local_irq_save(flags);
139 mtflags = dvpe();
140#else /* Not SMTC */
141 local_irq_save(flags);
142#endif /* CONFIG_MIPS_MT_SMTC */
116 143
117 /* Check if our ASID is of an older version and thus invalid */ 144 /* Check if our ASID is of an older version and thus invalid */
118 if ((cpu_context(cpu, next) ^ asid_cache(cpu)) & ASID_VERSION_MASK) 145 if ((cpu_context(cpu, next) ^ asid_cache(cpu)) & ASID_VERSION_MASK)
119 get_new_mmu_context(next, cpu); 146 get_new_mmu_context(next, cpu);
120 147#ifdef CONFIG_MIPS_MT_SMTC
148 /*
149 * If the EntryHi ASID being replaced happens to be
150 * the value flagged at ASID recycling time as having
151 * an extended life, clear the bit showing it being
152 * in use by this "CPU", and if that's the last bit,
153 * free up the ASID value for use and flush any old
154 * instances of it from the TLB.
155 */
156 oldasid = (read_c0_entryhi() & ASID_MASK);
157 if(smtc_live_asid[mytlb][oldasid]) {
158 smtc_live_asid[mytlb][oldasid] &= ~(0x1 << cpu);
159 if(smtc_live_asid[mytlb][oldasid] == 0)
160 smtc_flush_tlb_asid(oldasid);
161 }
162 /*
163 * Tread softly on EntryHi, and so long as we support
164 * having ASID_MASK smaller than the hardware maximum,
165 * make sure no "soft" bits become "hard"...
166 */
167 write_c0_entryhi((read_c0_entryhi() & ~HW_ASID_MASK)
168 | (cpu_context(cpu, next) & ASID_MASK));
169 ehb(); /* Make sure it propagates to TCStatus */
170 evpe(mtflags);
171#else
121 write_c0_entryhi(cpu_context(cpu, next)); 172 write_c0_entryhi(cpu_context(cpu, next));
173#endif /* CONFIG_MIPS_MT_SMTC */
122 TLBMISS_HANDLER_SETUP_PGD(next->pgd); 174 TLBMISS_HANDLER_SETUP_PGD(next->pgd);
123 175
124 /* 176 /*
@@ -151,12 +203,34 @@ activate_mm(struct mm_struct *prev, struct mm_struct *next)
151 unsigned long flags; 203 unsigned long flags;
152 unsigned int cpu = smp_processor_id(); 204 unsigned int cpu = smp_processor_id();
153 205
206#ifdef CONFIG_MIPS_MT_SMTC
207 unsigned long oldasid;
208 unsigned long mtflags;
209 int mytlb = (smtc_status & SMTC_TLB_SHARED) ? 0 : cpu_data[cpu].vpe_id;
210#endif /* CONFIG_MIPS_MT_SMTC */
211
154 local_irq_save(flags); 212 local_irq_save(flags);
155 213
156 /* Unconditionally get a new ASID. */ 214 /* Unconditionally get a new ASID. */
157 get_new_mmu_context(next, cpu); 215 get_new_mmu_context(next, cpu);
158 216
217#ifdef CONFIG_MIPS_MT_SMTC
218 /* See comments for similar code above */
219 mtflags = dvpe();
220 oldasid = read_c0_entryhi() & ASID_MASK;
221 if(smtc_live_asid[mytlb][oldasid]) {
222 smtc_live_asid[mytlb][oldasid] &= ~(0x1 << cpu);
223 if(smtc_live_asid[mytlb][oldasid] == 0)
224 smtc_flush_tlb_asid(oldasid);
225 }
226 /* See comments for similar code above */
227 write_c0_entryhi((read_c0_entryhi() & ~HW_ASID_MASK) |
228 (cpu_context(cpu, next) & ASID_MASK));
229 ehb(); /* Make sure it propagates to TCStatus */
230 evpe(mtflags);
231#else
159 write_c0_entryhi(cpu_context(cpu, next)); 232 write_c0_entryhi(cpu_context(cpu, next));
233#endif /* CONFIG_MIPS_MT_SMTC */
160 TLBMISS_HANDLER_SETUP_PGD(next->pgd); 234 TLBMISS_HANDLER_SETUP_PGD(next->pgd);
161 235
162 /* mark mmu ownership change */ 236 /* mark mmu ownership change */
@@ -174,17 +248,49 @@ static inline void
174drop_mmu_context(struct mm_struct *mm, unsigned cpu) 248drop_mmu_context(struct mm_struct *mm, unsigned cpu)
175{ 249{
176 unsigned long flags; 250 unsigned long flags;
251#ifdef CONFIG_MIPS_MT_SMTC
252 unsigned long oldasid;
253 /* Can't use spinlock because called from TLB flush within DVPE */
254 unsigned int prevvpe;
255 int mytlb = (smtc_status & SMTC_TLB_SHARED) ? 0 : cpu_data[cpu].vpe_id;
256#endif /* CONFIG_MIPS_MT_SMTC */
177 257
178 local_irq_save(flags); 258 local_irq_save(flags);
179 259
180 if (cpu_isset(cpu, mm->cpu_vm_mask)) { 260 if (cpu_isset(cpu, mm->cpu_vm_mask)) {
181 get_new_mmu_context(mm, cpu); 261 get_new_mmu_context(mm, cpu);
262#ifdef CONFIG_MIPS_MT_SMTC
263 /* See comments for similar code above */
264 prevvpe = dvpe();
265 oldasid = (read_c0_entryhi() & ASID_MASK);
266 if(smtc_live_asid[mytlb][oldasid]) {
267 smtc_live_asid[mytlb][oldasid] &= ~(0x1 << cpu);
268 if(smtc_live_asid[mytlb][oldasid] == 0)
269 smtc_flush_tlb_asid(oldasid);
270 }
271 /* See comments for similar code above */
272 write_c0_entryhi((read_c0_entryhi() & ~HW_ASID_MASK)
273 | cpu_asid(cpu, mm));
274 ehb(); /* Make sure it propagates to TCStatus */
275 evpe(prevvpe);
276#else /* not CONFIG_MIPS_MT_SMTC */
182 write_c0_entryhi(cpu_asid(cpu, mm)); 277 write_c0_entryhi(cpu_asid(cpu, mm));
278#endif /* CONFIG_MIPS_MT_SMTC */
183 } else { 279 } else {
184 /* will get a new context next time */ 280 /* will get a new context next time */
281#ifndef CONFIG_MIPS_MT_SMTC
185 cpu_context(cpu, mm) = 0; 282 cpu_context(cpu, mm) = 0;
283#else /* SMTC */
284 int i;
285
286 /* SMTC shares the TLB (and ASIDs) across VPEs */
287 for (i = 0; i < num_online_cpus(); i++) {
288 if((smtc_status & SMTC_TLB_SHARED)
289 || (cpu_data[i].vpe_id == cpu_data[cpu].vpe_id))
290 cpu_context(i, mm) = 0;
291 }
292#endif /* CONFIG_MIPS_MT_SMTC */
186 } 293 }
187
188 local_irq_restore(flags); 294 local_irq_restore(flags);
189} 295}
190 296
diff --git a/include/asm-mips/page.h b/include/asm-mips/page.h
index a1eab136ff6c..4035ec79ecd4 100644
--- a/include/asm-mips/page.h
+++ b/include/asm-mips/page.h
@@ -139,9 +139,11 @@ typedef struct { unsigned long pgprot; } pgprot_t;
139 139
140#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) 140#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT)
141 141
142#ifndef CONFIG_SPARSEMEM
142#ifndef CONFIG_NEED_MULTIPLE_NODES 143#ifndef CONFIG_NEED_MULTIPLE_NODES
143#define pfn_valid(pfn) ((pfn) < max_mapnr) 144#define pfn_valid(pfn) ((pfn) < max_mapnr)
144#endif 145#endif
146#endif
145 147
146#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) 148#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
147#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) 149#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
diff --git a/include/asm-mips/pgtable-32.h b/include/asm-mips/pgtable-32.h
index 4d6bc45df594..087c20769256 100644
--- a/include/asm-mips/pgtable-32.h
+++ b/include/asm-mips/pgtable-32.h
@@ -177,48 +177,67 @@ pfn_pte(unsigned long pfn, pgprot_t prot)
177 ((swp_entry_t) { ((type) << 10) | ((offset) << 15) }) 177 ((swp_entry_t) { ((type) << 10) | ((offset) << 15) })
178 178
179/* 179/*
180 * Bits 0, 1, 2, 9 and 10 are taken, split up the 27 bits of offset 180 * Bits 0, 4, 8, and 9 are taken, split up 28 bits of offset into this range:
181 * into this range:
182 */ 181 */
183#define PTE_FILE_MAX_BITS 27 182#define PTE_FILE_MAX_BITS 28
184 183
185#define pte_to_pgoff(_pte) \ 184#define pte_to_pgoff(_pte) ((((_pte).pte >> 1 ) & 0x07) | \
186 ((((_pte).pte >> 3) & 0x3f ) + (((_pte).pte >> 11) << 8 )) 185 (((_pte).pte >> 2 ) & 0x38) | \
186 (((_pte).pte >> 10) << 6 ))
187 187
188#define pgoff_to_pte(off) \ 188#define pgoff_to_pte(off) ((pte_t) { (((off) & 0x07) << 1 ) | \
189 ((pte_t) { (((off) & 0x3f) << 3) + (((off) >> 8) << 11) + _PAGE_FILE }) 189 (((off) & 0x38) << 2 ) | \
190 (((off) >> 6 ) << 10) | \
191 _PAGE_FILE })
190 192
191#else 193#else
192 194
193/* Swap entries must have VALID and GLOBAL bits cleared. */ 195/* Swap entries must have VALID and GLOBAL bits cleared. */
196#if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32)
197#define __swp_type(x) (((x).val >> 2) & 0x1f)
198#define __swp_offset(x) ((x).val >> 7)
199#define __swp_entry(type,offset) \
200 ((swp_entry_t) { ((type) << 2) | ((offset) << 7) })
201#else
194#define __swp_type(x) (((x).val >> 8) & 0x1f) 202#define __swp_type(x) (((x).val >> 8) & 0x1f)
195#define __swp_offset(x) ((x).val >> 13) 203#define __swp_offset(x) ((x).val >> 13)
196#define __swp_entry(type,offset) \ 204#define __swp_entry(type,offset) \
197 ((swp_entry_t) { ((type) << 8) | ((offset) << 13) }) 205 ((swp_entry_t) { ((type) << 8) | ((offset) << 13) })
206#endif /* defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32) */
198 207
208#if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32)
199/* 209/*
200 * Bits 0, 1, 2, 7 and 8 are taken, split up the 27 bits of offset 210 * Bits 0 and 1 of pte_high are taken, use the rest for the page offset...
201 * into this range:
202 */ 211 */
203#define PTE_FILE_MAX_BITS 27 212#define PTE_FILE_MAX_BITS 30
204 213
205#if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1) 214#define pte_to_pgoff(_pte) ((_pte).pte_high >> 2)
206 /* fixme */ 215#define pgoff_to_pte(off) ((pte_t) { _PAGE_FILE, (off) << 2 })
207#define pte_to_pgoff(_pte) (((_pte).pte_high >> 6) + ((_pte).pte_high & 0x3f))
208#define pgoff_to_pte(off) \
209 ((pte_t){(((off) & 0x3f) + ((off) << 6) + _PAGE_FILE)})
210 216
211#else 217#else
212#define pte_to_pgoff(_pte) \ 218/*
213 ((((_pte).pte >> 3) & 0x1f ) + (((_pte).pte >> 9) << 6 )) 219 * Bits 0, 4, 6, and 7 are taken, split up 28 bits of offset into this range:
220 */
221#define PTE_FILE_MAX_BITS 28
222
223#define pte_to_pgoff(_pte) ((((_pte).pte >> 1) & 0x7) | \
224 (((_pte).pte >> 2) & 0x8) | \
225 (((_pte).pte >> 8) << 4))
214 226
215#define pgoff_to_pte(off) \ 227#define pgoff_to_pte(off) ((pte_t) { (((off) & 0x7) << 1) | \
216 ((pte_t) { (((off) & 0x1f) << 3) + (((off) >> 6) << 9) + _PAGE_FILE }) 228 (((off) & 0x8) << 2) | \
229 (((off) >> 4) << 8) | \
230 _PAGE_FILE })
217#endif 231#endif
218 232
219#endif 233#endif
220 234
235#if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32)
236#define __pte_to_swp_entry(pte) ((swp_entry_t) { (pte).pte_high })
237#define __swp_entry_to_pte(x) ((pte_t) { 0, (x).val })
238#else
221#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) 239#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
222#define __swp_entry_to_pte(x) ((pte_t) { (x).val }) 240#define __swp_entry_to_pte(x) ((pte_t) { (x).val })
241#endif
223 242
224#endif /* _ASM_PGTABLE_32_H */ 243#endif /* _ASM_PGTABLE_32_H */
diff --git a/include/asm-mips/pgtable-64.h b/include/asm-mips/pgtable-64.h
index 82166b254b27..2faf5c9ff127 100644
--- a/include/asm-mips/pgtable-64.h
+++ b/include/asm-mips/pgtable-64.h
@@ -224,15 +224,12 @@ static inline pte_t mk_swap_pte(unsigned long type, unsigned long offset)
224#define __swp_entry_to_pte(x) ((pte_t) { (x).val }) 224#define __swp_entry_to_pte(x) ((pte_t) { (x).val })
225 225
226/* 226/*
227 * Bits 0, 1, 2, 7 and 8 are taken, split up the 32 bits of offset 227 * Bits 0, 4, 6, and 7 are taken. Let's leave bits 1, 2, 3, and 5 alone to
228 * into this range: 228 * make things easier, and only use the upper 56 bits for the page offset...
229 */ 229 */
230#define PTE_FILE_MAX_BITS 32 230#define PTE_FILE_MAX_BITS 56
231 231
232#define pte_to_pgoff(_pte) \ 232#define pte_to_pgoff(_pte) ((_pte).pte >> 8)
233 ((((_pte).pte >> 3) & 0x1f ) + (((_pte).pte >> 9) << 6 )) 233#define pgoff_to_pte(off) ((pte_t) { ((off) << 8) | _PAGE_FILE })
234
235#define pgoff_to_pte(off) \
236 ((pte_t) { (((off) & 0x1f) << 3) + (((off) >> 6) << 9) + _PAGE_FILE })
237 234
238#endif /* _ASM_PGTABLE_64_H */ 235#endif /* _ASM_PGTABLE_64_H */
diff --git a/include/asm-mips/pgtable.h b/include/asm-mips/pgtable.h
index 702a28fa7a34..d0af2a3b0152 100644
--- a/include/asm-mips/pgtable.h
+++ b/include/asm-mips/pgtable.h
@@ -70,7 +70,15 @@ extern unsigned long zero_page_mask;
70#define ZERO_PAGE(vaddr) \ 70#define ZERO_PAGE(vaddr) \
71 (virt_to_page(empty_zero_page + (((unsigned long)(vaddr)) & zero_page_mask))) 71 (virt_to_page(empty_zero_page + (((unsigned long)(vaddr)) & zero_page_mask)))
72 72
73#define __HAVE_ARCH_MULTIPLE_ZERO_PAGE 73#define __HAVE_ARCH_MOVE_PTE
74#define move_pte(pte, prot, old_addr, new_addr) \
75({ \
76 pte_t newpte = (pte); \
77 if (pte_present(pte) && pfn_valid(pte_pfn(pte)) && \
78 pte_page(pte) == ZERO_PAGE(old_addr)) \
79 newpte = mk_pte(ZERO_PAGE(new_addr), (prot)); \
80 newpte; \
81})
74 82
75extern void paging_init(void); 83extern void paging_init(void);
76 84
@@ -82,10 +90,11 @@ extern void paging_init(void);
82#define pmd_page(pmd) (pfn_to_page(pmd_phys(pmd) >> PAGE_SHIFT)) 90#define pmd_page(pmd) (pfn_to_page(pmd_phys(pmd) >> PAGE_SHIFT))
83#define pmd_page_kernel(pmd) pmd_val(pmd) 91#define pmd_page_kernel(pmd) pmd_val(pmd)
84 92
85#define pte_none(pte) (!(pte_val(pte) & ~_PAGE_GLOBAL))
86#define pte_present(pte) (pte_val(pte) & _PAGE_PRESENT)
87
88#if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1) 93#if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1)
94
95#define pte_none(pte) (!(((pte).pte_low | (pte).pte_high) & ~_PAGE_GLOBAL))
96#define pte_present(pte) ((pte).pte_low & _PAGE_PRESENT)
97
89static inline void set_pte(pte_t *ptep, pte_t pte) 98static inline void set_pte(pte_t *ptep, pte_t pte)
90{ 99{
91 ptep->pte_high = pte.pte_high; 100 ptep->pte_high = pte.pte_high;
@@ -93,27 +102,35 @@ static inline void set_pte(pte_t *ptep, pte_t pte)
93 ptep->pte_low = pte.pte_low; 102 ptep->pte_low = pte.pte_low;
94 //printk("pte_high %x pte_low %x\n", ptep->pte_high, ptep->pte_low); 103 //printk("pte_high %x pte_low %x\n", ptep->pte_high, ptep->pte_low);
95 104
96 if (pte_val(pte) & _PAGE_GLOBAL) { 105 if (pte.pte_low & _PAGE_GLOBAL) {
97 pte_t *buddy = ptep_buddy(ptep); 106 pte_t *buddy = ptep_buddy(ptep);
98 /* 107 /*
99 * Make sure the buddy is global too (if it's !none, 108 * Make sure the buddy is global too (if it's !none,
100 * it better already be global) 109 * it better already be global)
101 */ 110 */
102 if (pte_none(*buddy)) 111 if (pte_none(*buddy)) {
103 buddy->pte_low |= _PAGE_GLOBAL; 112 buddy->pte_low |= _PAGE_GLOBAL;
113 buddy->pte_high |= _PAGE_GLOBAL;
114 }
104 } 115 }
105} 116}
106#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval) 117#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
107 118
108static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) 119static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
109{ 120{
121 pte_t null = __pte(0);
122
110 /* Preserve global status for the pair */ 123 /* Preserve global status for the pair */
111 if (pte_val(*ptep_buddy(ptep)) & _PAGE_GLOBAL) 124 if (ptep_buddy(ptep)->pte_low & _PAGE_GLOBAL)
112 set_pte_at(mm, addr, ptep, __pte(_PAGE_GLOBAL)); 125 null.pte_low = null.pte_high = _PAGE_GLOBAL;
113 else 126
114 set_pte_at(mm, addr, ptep, __pte(0)); 127 set_pte_at(mm, addr, ptep, null);
115} 128}
116#else 129#else
130
131#define pte_none(pte) (!(pte_val(pte) & ~_PAGE_GLOBAL))
132#define pte_present(pte) (pte_val(pte) & _PAGE_PRESENT)
133
117/* 134/*
118 * Certain architectures need to do special things when pte's 135 * Certain architectures need to do special things when pte's
119 * within a page table are directly modified. Thus, the following 136 * within a page table are directly modified. Thus, the following
@@ -174,75 +191,76 @@ extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
174 */ 191 */
175static inline int pte_user(pte_t pte) { BUG(); return 0; } 192static inline int pte_user(pte_t pte) { BUG(); return 0; }
176#if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1) 193#if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1)
177static inline int pte_read(pte_t pte) { return (pte).pte_low & _PAGE_READ; } 194static inline int pte_read(pte_t pte) { return pte.pte_low & _PAGE_READ; }
178static inline int pte_write(pte_t pte) { return (pte).pte_low & _PAGE_WRITE; } 195static inline int pte_write(pte_t pte) { return pte.pte_low & _PAGE_WRITE; }
179static inline int pte_dirty(pte_t pte) { return (pte).pte_low & _PAGE_MODIFIED; } 196static inline int pte_dirty(pte_t pte) { return pte.pte_low & _PAGE_MODIFIED; }
180static inline int pte_young(pte_t pte) { return (pte).pte_low & _PAGE_ACCESSED; } 197static inline int pte_young(pte_t pte) { return pte.pte_low & _PAGE_ACCESSED; }
181static inline int pte_file(pte_t pte) { return (pte).pte_low & _PAGE_FILE; } 198static inline int pte_file(pte_t pte) { return pte.pte_low & _PAGE_FILE; }
199
182static inline pte_t pte_wrprotect(pte_t pte) 200static inline pte_t pte_wrprotect(pte_t pte)
183{ 201{
184 (pte).pte_low &= ~(_PAGE_WRITE | _PAGE_SILENT_WRITE); 202 pte.pte_low &= ~(_PAGE_WRITE | _PAGE_SILENT_WRITE);
185 (pte).pte_high &= ~_PAGE_SILENT_WRITE; 203 pte.pte_high &= ~_PAGE_SILENT_WRITE;
186 return pte; 204 return pte;
187} 205}
188 206
189static inline pte_t pte_rdprotect(pte_t pte) 207static inline pte_t pte_rdprotect(pte_t pte)
190{ 208{
191 (pte).pte_low &= ~(_PAGE_READ | _PAGE_SILENT_READ); 209 pte.pte_low &= ~(_PAGE_READ | _PAGE_SILENT_READ);
192 (pte).pte_high &= ~_PAGE_SILENT_READ; 210 pte.pte_high &= ~_PAGE_SILENT_READ;
193 return pte; 211 return pte;
194} 212}
195 213
196static inline pte_t pte_mkclean(pte_t pte) 214static inline pte_t pte_mkclean(pte_t pte)
197{ 215{
198 (pte).pte_low &= ~(_PAGE_MODIFIED|_PAGE_SILENT_WRITE); 216 pte.pte_low &= ~(_PAGE_MODIFIED | _PAGE_SILENT_WRITE);
199 (pte).pte_high &= ~_PAGE_SILENT_WRITE; 217 pte.pte_high &= ~_PAGE_SILENT_WRITE;
200 return pte; 218 return pte;
201} 219}
202 220
203static inline pte_t pte_mkold(pte_t pte) 221static inline pte_t pte_mkold(pte_t pte)
204{ 222{
205 (pte).pte_low &= ~(_PAGE_ACCESSED|_PAGE_SILENT_READ); 223 pte.pte_low &= ~(_PAGE_ACCESSED | _PAGE_SILENT_READ);
206 (pte).pte_high &= ~_PAGE_SILENT_READ; 224 pte.pte_high &= ~_PAGE_SILENT_READ;
207 return pte; 225 return pte;
208} 226}
209 227
210static inline pte_t pte_mkwrite(pte_t pte) 228static inline pte_t pte_mkwrite(pte_t pte)
211{ 229{
212 (pte).pte_low |= _PAGE_WRITE; 230 pte.pte_low |= _PAGE_WRITE;
213 if ((pte).pte_low & _PAGE_MODIFIED) { 231 if (pte.pte_low & _PAGE_MODIFIED) {
214 (pte).pte_low |= _PAGE_SILENT_WRITE; 232 pte.pte_low |= _PAGE_SILENT_WRITE;
215 (pte).pte_high |= _PAGE_SILENT_WRITE; 233 pte.pte_high |= _PAGE_SILENT_WRITE;
216 } 234 }
217 return pte; 235 return pte;
218} 236}
219 237
220static inline pte_t pte_mkread(pte_t pte) 238static inline pte_t pte_mkread(pte_t pte)
221{ 239{
222 (pte).pte_low |= _PAGE_READ; 240 pte.pte_low |= _PAGE_READ;
223 if ((pte).pte_low & _PAGE_ACCESSED) { 241 if (pte.pte_low & _PAGE_ACCESSED) {
224 (pte).pte_low |= _PAGE_SILENT_READ; 242 pte.pte_low |= _PAGE_SILENT_READ;
225 (pte).pte_high |= _PAGE_SILENT_READ; 243 pte.pte_high |= _PAGE_SILENT_READ;
226 } 244 }
227 return pte; 245 return pte;
228} 246}
229 247
230static inline pte_t pte_mkdirty(pte_t pte) 248static inline pte_t pte_mkdirty(pte_t pte)
231{ 249{
232 (pte).pte_low |= _PAGE_MODIFIED; 250 pte.pte_low |= _PAGE_MODIFIED;
233 if ((pte).pte_low & _PAGE_WRITE) { 251 if (pte.pte_low & _PAGE_WRITE) {
234 (pte).pte_low |= _PAGE_SILENT_WRITE; 252 pte.pte_low |= _PAGE_SILENT_WRITE;
235 (pte).pte_high |= _PAGE_SILENT_WRITE; 253 pte.pte_high |= _PAGE_SILENT_WRITE;
236 } 254 }
237 return pte; 255 return pte;
238} 256}
239 257
240static inline pte_t pte_mkyoung(pte_t pte) 258static inline pte_t pte_mkyoung(pte_t pte)
241{ 259{
242 (pte).pte_low |= _PAGE_ACCESSED; 260 pte.pte_low |= _PAGE_ACCESSED;
243 if ((pte).pte_low & _PAGE_READ) 261 if (pte.pte_low & _PAGE_READ)
244 (pte).pte_low |= _PAGE_SILENT_READ; 262 pte.pte_low |= _PAGE_SILENT_READ;
245 (pte).pte_high |= _PAGE_SILENT_READ; 263 pte.pte_high |= _PAGE_SILENT_READ;
246 return pte; 264 return pte;
247} 265}
248#else 266#else
@@ -335,8 +353,9 @@ static inline pgprot_t pgprot_noncached(pgprot_t _prot)
335#if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1) 353#if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1)
336static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) 354static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
337{ 355{
338 pte.pte_low &= _PAGE_CHG_MASK; 356 pte.pte_low &= _PAGE_CHG_MASK;
339 pte.pte_low |= pgprot_val(newprot); 357 pte.pte_high &= ~0x3f;
358 pte.pte_low |= pgprot_val(newprot);
340 pte.pte_high |= pgprot_val(newprot) & 0x3f; 359 pte.pte_high |= pgprot_val(newprot) & 0x3f;
341 return pte; 360 return pte;
342} 361}
diff --git a/include/asm-mips/processor.h b/include/asm-mips/processor.h
index 39d2bd50fece..0fb75f0762e0 100644
--- a/include/asm-mips/processor.h
+++ b/include/asm-mips/processor.h
@@ -12,6 +12,7 @@
12#define _ASM_PROCESSOR_H 12#define _ASM_PROCESSOR_H
13 13
14#include <linux/config.h> 14#include <linux/config.h>
15#include <linux/cpumask.h>
15#include <linux/threads.h> 16#include <linux/threads.h>
16 17
17#include <asm/cachectl.h> 18#include <asm/cachectl.h>
@@ -107,6 +108,10 @@ struct mips_dsp_state {
107 108
108#define INIT_DSP {{0,},} 109#define INIT_DSP {{0,},}
109 110
111#define INIT_CPUMASK { \
112 {0,} \
113}
114
110typedef struct { 115typedef struct {
111 unsigned long seg; 116 unsigned long seg;
112} mm_segment_t; 117} mm_segment_t;
@@ -129,6 +134,12 @@ struct thread_struct {
129 134
130 /* Saved fpu/fpu emulator stuff. */ 135 /* Saved fpu/fpu emulator stuff. */
131 union mips_fpu_union fpu; 136 union mips_fpu_union fpu;
137#ifdef CONFIG_MIPS_MT_FPAFF
138 /* Emulated instruction count */
139 unsigned long emulated_fp;
140 /* Saved per-thread scheduler affinity mask */
141 cpumask_t user_cpus_allowed;
142#endif /* CONFIG_MIPS_MT_FPAFF */
132 143
133 /* Saved state of the DSP ASE, if available. */ 144 /* Saved state of the DSP ASE, if available. */
134 struct mips_dsp_state dsp; 145 struct mips_dsp_state dsp;
@@ -142,6 +153,7 @@ struct thread_struct {
142#define MF_LOGADE 2 /* Log address errors to syslog */ 153#define MF_LOGADE 2 /* Log address errors to syslog */
143#define MF_32BIT_REGS 4 /* also implies 16/32 fprs */ 154#define MF_32BIT_REGS 4 /* also implies 16/32 fprs */
144#define MF_32BIT_ADDR 8 /* 32-bit address space (o32/n32) */ 155#define MF_32BIT_ADDR 8 /* 32-bit address space (o32/n32) */
156#define MF_FPUBOUND 0x10 /* thread bound to FPU-full CPU set */
145 unsigned long mflags; 157 unsigned long mflags;
146 unsigned long irix_trampoline; /* Wheee... */ 158 unsigned long irix_trampoline; /* Wheee... */
147 unsigned long irix_oldctx; 159 unsigned long irix_oldctx;
@@ -153,6 +165,12 @@ struct thread_struct {
153#define MF_N32 MF_32BIT_ADDR 165#define MF_N32 MF_32BIT_ADDR
154#define MF_N64 0 166#define MF_N64 0
155 167
168#ifdef CONFIG_MIPS_MT_FPAFF
169#define FPAFF_INIT 0, INIT_CPUMASK,
170#else
171#define FPAFF_INIT
172#endif /* CONFIG_MIPS_MT_FPAFF */
173
156#define INIT_THREAD { \ 174#define INIT_THREAD { \
157 /* \ 175 /* \
158 * saved main processor registers \ 176 * saved main processor registers \
@@ -168,6 +186,10 @@ struct thread_struct {
168 */ \ 186 */ \
169 INIT_FPU, \ 187 INIT_FPU, \
170 /* \ 188 /* \
189 * fpu affinity state (null if not FPAFF) \
190 */ \
191 FPAFF_INIT \
192 /* \
171 * saved dsp/dsp emulator stuff \ 193 * saved dsp/dsp emulator stuff \
172 */ \ 194 */ \
173 INIT_DSP, \ 195 INIT_DSP, \
diff --git a/include/asm-mips/ptrace.h b/include/asm-mips/ptrace.h
index 95c5839ac465..fa9d8713c12a 100644
--- a/include/asm-mips/ptrace.h
+++ b/include/asm-mips/ptrace.h
@@ -45,6 +45,10 @@ struct pt_regs {
45 unsigned long cp0_badvaddr; 45 unsigned long cp0_badvaddr;
46 unsigned long cp0_cause; 46 unsigned long cp0_cause;
47 unsigned long cp0_epc; 47 unsigned long cp0_epc;
48#ifdef CONFIG_MIPS_MT_SMTC
49 unsigned long cp0_tcstatus;
50 unsigned long smtc_pad;
51#endif /* CONFIG_MIPS_MT_SMTC */
48}; 52};
49 53
50/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */ 54/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
diff --git a/include/asm-mips/r4kcache.h b/include/asm-mips/r4kcache.h
index 90c374700977..3c8e3c8d1a9a 100644
--- a/include/asm-mips/r4kcache.h
+++ b/include/asm-mips/r4kcache.h
@@ -15,6 +15,7 @@
15#include <asm/asm.h> 15#include <asm/asm.h>
16#include <asm/cacheops.h> 16#include <asm/cacheops.h>
17#include <asm/cpu-features.h> 17#include <asm/cpu-features.h>
18#include <asm/mipsmtregs.h>
18 19
19/* 20/*
20 * This macro return a properly sign-extended address suitable as base address 21 * This macro return a properly sign-extended address suitable as base address
@@ -37,16 +38,120 @@
37 " cache %0, %1 \n" \ 38 " cache %0, %1 \n" \
38 " .set pop \n" \ 39 " .set pop \n" \
39 : \ 40 : \
40 : "i" (op), "m" (*(unsigned char *)(addr))) 41 : "i" (op), "R" (*(unsigned char *)(addr)))
42
43#ifdef CONFIG_MIPS_MT
44/*
45 * Temporary hacks for SMTC debug. Optionally force single-threaded
46 * execution during I-cache flushes.
47 */
48
49#define PROTECT_CACHE_FLUSHES 1
50
51#ifdef PROTECT_CACHE_FLUSHES
52
53extern int mt_protiflush;
54extern int mt_protdflush;
55extern void mt_cflush_lockdown(void);
56extern void mt_cflush_release(void);
57
58#define BEGIN_MT_IPROT \
59 unsigned long flags = 0; \
60 unsigned long mtflags = 0; \
61 if(mt_protiflush) { \
62 local_irq_save(flags); \
63 ehb(); \
64 mtflags = dvpe(); \
65 mt_cflush_lockdown(); \
66 }
67
68#define END_MT_IPROT \
69 if(mt_protiflush) { \
70 mt_cflush_release(); \
71 evpe(mtflags); \
72 local_irq_restore(flags); \
73 }
74
75#define BEGIN_MT_DPROT \
76 unsigned long flags = 0; \
77 unsigned long mtflags = 0; \
78 if(mt_protdflush) { \
79 local_irq_save(flags); \
80 ehb(); \
81 mtflags = dvpe(); \
82 mt_cflush_lockdown(); \
83 }
84
85#define END_MT_DPROT \
86 if(mt_protdflush) { \
87 mt_cflush_release(); \
88 evpe(mtflags); \
89 local_irq_restore(flags); \
90 }
91
92#else
93
94#define BEGIN_MT_IPROT
95#define BEGIN_MT_DPROT
96#define END_MT_IPROT
97#define END_MT_DPROT
98
99#endif /* PROTECT_CACHE_FLUSHES */
100
101#define __iflush_prologue \
102 unsigned long redundance; \
103 extern int mt_n_iflushes; \
104 BEGIN_MT_IPROT \
105 for (redundance = 0; redundance < mt_n_iflushes; redundance++) {
106
107#define __iflush_epilogue \
108 END_MT_IPROT \
109 }
110
111#define __dflush_prologue \
112 unsigned long redundance; \
113 extern int mt_n_dflushes; \
114 BEGIN_MT_DPROT \
115 for (redundance = 0; redundance < mt_n_dflushes; redundance++) {
116
117#define __dflush_epilogue \
118 END_MT_DPROT \
119 }
120
121#define __inv_dflush_prologue __dflush_prologue
122#define __inv_dflush_epilogue __dflush_epilogue
123#define __sflush_prologue {
124#define __sflush_epilogue }
125#define __inv_sflush_prologue __sflush_prologue
126#define __inv_sflush_epilogue __sflush_epilogue
127
128#else /* CONFIG_MIPS_MT */
129
130#define __iflush_prologue {
131#define __iflush_epilogue }
132#define __dflush_prologue {
133#define __dflush_epilogue }
134#define __inv_dflush_prologue {
135#define __inv_dflush_epilogue }
136#define __sflush_prologue {
137#define __sflush_epilogue }
138#define __inv_sflush_prologue {
139#define __inv_sflush_epilogue }
140
141#endif /* CONFIG_MIPS_MT */
41 142
42static inline void flush_icache_line_indexed(unsigned long addr) 143static inline void flush_icache_line_indexed(unsigned long addr)
43{ 144{
145 __iflush_prologue
44 cache_op(Index_Invalidate_I, addr); 146 cache_op(Index_Invalidate_I, addr);
147 __iflush_epilogue
45} 148}
46 149
47static inline void flush_dcache_line_indexed(unsigned long addr) 150static inline void flush_dcache_line_indexed(unsigned long addr)
48{ 151{
152 __dflush_prologue
49 cache_op(Index_Writeback_Inv_D, addr); 153 cache_op(Index_Writeback_Inv_D, addr);
154 __dflush_epilogue
50} 155}
51 156
52static inline void flush_scache_line_indexed(unsigned long addr) 157static inline void flush_scache_line_indexed(unsigned long addr)
@@ -56,17 +161,23 @@ static inline void flush_scache_line_indexed(unsigned long addr)
56 161
57static inline void flush_icache_line(unsigned long addr) 162static inline void flush_icache_line(unsigned long addr)
58{ 163{
164 __iflush_prologue
59 cache_op(Hit_Invalidate_I, addr); 165 cache_op(Hit_Invalidate_I, addr);
166 __iflush_epilogue
60} 167}
61 168
62static inline void flush_dcache_line(unsigned long addr) 169static inline void flush_dcache_line(unsigned long addr)
63{ 170{
171 __dflush_prologue
64 cache_op(Hit_Writeback_Inv_D, addr); 172 cache_op(Hit_Writeback_Inv_D, addr);
173 __dflush_epilogue
65} 174}
66 175
67static inline void invalidate_dcache_line(unsigned long addr) 176static inline void invalidate_dcache_line(unsigned long addr)
68{ 177{
178 __dflush_prologue
69 cache_op(Hit_Invalidate_D, addr); 179 cache_op(Hit_Invalidate_D, addr);
180 __dflush_epilogue
70} 181}
71 182
72static inline void invalidate_scache_line(unsigned long addr) 183static inline void invalidate_scache_line(unsigned long addr)
@@ -239,9 +350,13 @@ static inline void blast_##pfx##cache##lsize(void) \
239 current_cpu_data.desc.waybit; \ 350 current_cpu_data.desc.waybit; \
240 unsigned long ws, addr; \ 351 unsigned long ws, addr; \
241 \ 352 \
353 __##pfx##flush_prologue \
354 \
242 for (ws = 0; ws < ws_end; ws += ws_inc) \ 355 for (ws = 0; ws < ws_end; ws += ws_inc) \
243 for (addr = start; addr < end; addr += lsize * 32) \ 356 for (addr = start; addr < end; addr += lsize * 32) \
244 cache##lsize##_unroll32(addr|ws,indexop); \ 357 cache##lsize##_unroll32(addr|ws,indexop); \
358 \
359 __##pfx##flush_epilogue \
245} \ 360} \
246 \ 361 \
247static inline void blast_##pfx##cache##lsize##_page(unsigned long page) \ 362static inline void blast_##pfx##cache##lsize##_page(unsigned long page) \
@@ -249,10 +364,14 @@ static inline void blast_##pfx##cache##lsize##_page(unsigned long page) \
249 unsigned long start = page; \ 364 unsigned long start = page; \
250 unsigned long end = page + PAGE_SIZE; \ 365 unsigned long end = page + PAGE_SIZE; \
251 \ 366 \
367 __##pfx##flush_prologue \
368 \
252 do { \ 369 do { \
253 cache##lsize##_unroll32(start,hitop); \ 370 cache##lsize##_unroll32(start,hitop); \
254 start += lsize * 32; \ 371 start += lsize * 32; \
255 } while (start < end); \ 372 } while (start < end); \
373 \
374 __##pfx##flush_epilogue \
256} \ 375} \
257 \ 376 \
258static inline void blast_##pfx##cache##lsize##_page_indexed(unsigned long page) \ 377static inline void blast_##pfx##cache##lsize##_page_indexed(unsigned long page) \
@@ -265,9 +384,13 @@ static inline void blast_##pfx##cache##lsize##_page_indexed(unsigned long page)
265 current_cpu_data.desc.waybit; \ 384 current_cpu_data.desc.waybit; \
266 unsigned long ws, addr; \ 385 unsigned long ws, addr; \
267 \ 386 \
387 __##pfx##flush_prologue \
388 \
268 for (ws = 0; ws < ws_end; ws += ws_inc) \ 389 for (ws = 0; ws < ws_end; ws += ws_inc) \
269 for (addr = start; addr < end; addr += lsize * 32) \ 390 for (addr = start; addr < end; addr += lsize * 32) \
270 cache##lsize##_unroll32(addr|ws,indexop); \ 391 cache##lsize##_unroll32(addr|ws,indexop); \
392 \
393 __##pfx##flush_epilogue \
271} 394}
272 395
273__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 16) 396__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 16)
@@ -288,12 +411,17 @@ static inline void prot##blast_##pfx##cache##_range(unsigned long start, \
288 unsigned long lsize = cpu_##desc##_line_size(); \ 411 unsigned long lsize = cpu_##desc##_line_size(); \
289 unsigned long addr = start & ~(lsize - 1); \ 412 unsigned long addr = start & ~(lsize - 1); \
290 unsigned long aend = (end - 1) & ~(lsize - 1); \ 413 unsigned long aend = (end - 1) & ~(lsize - 1); \
414 \
415 __##pfx##flush_prologue \
416 \
291 while (1) { \ 417 while (1) { \
292 prot##cache_op(hitop, addr); \ 418 prot##cache_op(hitop, addr); \
293 if (addr == aend) \ 419 if (addr == aend) \
294 break; \ 420 break; \
295 addr += lsize; \ 421 addr += lsize; \
296 } \ 422 } \
423 \
424 __##pfx##flush_epilogue \
297} 425}
298 426
299__BUILD_BLAST_CACHE_RANGE(d, dcache, Hit_Writeback_Inv_D, protected_) 427__BUILD_BLAST_CACHE_RANGE(d, dcache, Hit_Writeback_Inv_D, protected_)
diff --git a/include/asm-mips/rtc.h b/include/asm-mips/rtc.h
index a2abc4572b63..82ad401c7dca 100644
--- a/include/asm-mips/rtc.h
+++ b/include/asm-mips/rtc.h
@@ -32,7 +32,7 @@ static inline unsigned int get_rtc_time(struct rtc_time *time)
32{ 32{
33 unsigned long nowtime; 33 unsigned long nowtime;
34 34
35 nowtime = rtc_get_time(); 35 nowtime = rtc_mips_get_time();
36 to_tm(nowtime, time); 36 to_tm(nowtime, time);
37 time->tm_year -= 1900; 37 time->tm_year -= 1900;
38 38
@@ -47,7 +47,7 @@ static inline int set_rtc_time(struct rtc_time *time)
47 nowtime = mktime(time->tm_year+1900, time->tm_mon+1, 47 nowtime = mktime(time->tm_year+1900, time->tm_mon+1,
48 time->tm_mday, time->tm_hour, time->tm_min, 48 time->tm_mday, time->tm_hour, time->tm_min,
49 time->tm_sec); 49 time->tm_sec);
50 ret = rtc_set_time(nowtime); 50 ret = rtc_mips_set_time(nowtime);
51 51
52 return ret; 52 return ret;
53} 53}
diff --git a/include/asm-mips/rtlx.h b/include/asm-mips/rtlx.h
index 1298c3fdf6c9..76cd51c6be39 100644
--- a/include/asm-mips/rtlx.h
+++ b/include/asm-mips/rtlx.h
@@ -3,32 +3,46 @@
3 * 3 *
4 */ 4 */
5 5
6#ifndef _RTLX_H 6#ifndef __ASM_RTLX_H
7#define _RTLX_H_ 7#define __ASM_RTLX_H_
8 8
9#define LX_NODE_BASE 10 9#define LX_NODE_BASE 10
10 10
11#define MIPSCPU_INT_BASE 16 11#define MIPSCPU_INT_BASE 16
12#define MIPS_CPU_RTLX_IRQ 0 12#define MIPS_CPU_RTLX_IRQ 0
13 13
14#define RTLX_VERSION 1 14#define RTLX_VERSION 2
15#define RTLX_xID 0x12345600 15#define RTLX_xID 0x12345600
16#define RTLX_ID (RTLX_xID | RTLX_VERSION) 16#define RTLX_ID (RTLX_xID | RTLX_VERSION)
17#define RTLX_CHANNELS 8 17#define RTLX_CHANNELS 8
18 18
19#define RTLX_BUFFER_SIZE 1024 19#define RTLX_CHANNEL_STDIO 0
20#define RTLX_CHANNEL_DBG 1
21#define RTLX_CHANNEL_SYSIO 2
20 22
21/* 23extern int rtlx_open(int index, int can_sleep);
22 * lx_state bits 24extern int rtlx_release(int index);
23 */ 25extern ssize_t rtlx_read(int index, void *buff, size_t count, int user);
24#define RTLX_STATE_OPENED 1UL 26extern ssize_t rtlx_write(int index, void *buffer, size_t count, int user);
27extern unsigned int rtlx_read_poll(int index, int can_sleep);
28extern unsigned int rtlx_write_poll(int index);
29
30enum rtlx_state {
31 RTLX_STATE_UNUSED,
32 RTLX_STATE_INITIALISED,
33 RTLX_STATE_REMOTE_READY,
34 RTLX_STATE_OPENED
35};
36
37#define RTLX_BUFFER_SIZE 1024
25 38
26/* each channel supports read and write. 39/* each channel supports read and write.
27 linux (vpe0) reads lx_buffer and writes rt_buffer 40 linux (vpe0) reads lx_buffer and writes rt_buffer
28 SP (vpe1) reads rt_buffer and writes lx_buffer 41 SP (vpe1) reads rt_buffer and writes lx_buffer
29*/ 42*/
30struct rtlx_channel { 43struct rtlx_channel {
31 unsigned long lx_state; 44 enum rtlx_state rt_state;
45 enum rtlx_state lx_state;
32 46
33 int buffer_size; 47 int buffer_size;
34 48
@@ -38,15 +52,13 @@ struct rtlx_channel {
38 52
39 int lx_write, lx_read; 53 int lx_write, lx_read;
40 char *lx_buffer; 54 char *lx_buffer;
41
42 void *queues;
43
44}; 55};
45 56
46struct rtlx_info { 57struct rtlx_info {
47 unsigned long id; 58 unsigned long id;
59 enum rtlx_state state;
48 60
49 struct rtlx_channel channel[RTLX_CHANNELS]; 61 struct rtlx_channel channel[RTLX_CHANNELS];
50}; 62};
51 63
52#endif /* _RTLX_H_ */ 64#endif /* __ASM_RTLX_H_ */
diff --git a/include/asm-mips/serial.h b/include/asm-mips/serial.h
index 7b2366412203..7196ceb0e948 100644
--- a/include/asm-mips/serial.h
+++ b/include/asm-mips/serial.h
@@ -77,15 +77,15 @@
77#include <asm/it8712.h> 77#include <asm/it8712.h>
78#define ITE_SERIAL_PORT_DEFNS \ 78#define ITE_SERIAL_PORT_DEFNS \
79 { .baud_base = BASE_BAUD, .port = (IT8172_PCI_IO_BASE + IT_UART_BASE), \ 79 { .baud_base = BASE_BAUD, .port = (IT8172_PCI_IO_BASE + IT_UART_BASE), \
80 .irq = IT8172_UART_IRQ, .flags = STD_COM_FLAGS, .type = 0x3 }, \ 80 .irq = IT8172_UART_IRQ, .flags = STD_COM_FLAGS, .port = PORT_16550 }, \
81 { .baud_base = (24000000/(16*13)), .port = (IT8172_PCI_IO_BASE + IT8712_UART1_PORT), \ 81 { .baud_base = (24000000/(16*13)), .port = (IT8172_PCI_IO_BASE + IT8712_UART1_PORT), \
82 .irq = IT8172_SERIRQ_4, .flags = STD_COM_FLAGS, .type = 0x3 }, \ 82 .irq = IT8172_SERIRQ_4, .flags = STD_COM_FLAGS, .port = PORT_16550 }, \
83 /* Smart Card Reader 0 */ \ 83 /* Smart Card Reader 0 */ \
84 { .baud_base = BASE_BAUD, .port = (IT8172_PCI_IO_BASE + IT_SCR0_BASE), \ 84 { .baud_base = BASE_BAUD, .port = (IT8172_PCI_IO_BASE + IT_SCR0_BASE), \
85 .irq = IT8172_SCR0_IRQ, .flags = STD_COM_FLAGS, .type = 0x3 }, \ 85 .irq = IT8172_SCR0_IRQ, .flags = STD_COM_FLAGS, .port = PORT_16550 }, \
86 /* Smart Card Reader 1 */ \ 86 /* Smart Card Reader 1 */ \
87 { .baud_base = BASE_BAUD, .port = (IT8172_PCI_IO_BASE + IT_SCR1_BASE), \ 87 { .baud_base = BASE_BAUD, .port = (IT8172_PCI_IO_BASE + IT_SCR1_BASE), \
88 .irq = IT8172_SCR1_IRQ, .flags = STD_COM_FLAGS, .type = 0x3 }, 88 .irq = IT8172_SCR1_IRQ, .flags = STD_COM_FLAGS, .port = PORT_16550 },
89#else 89#else
90#define ITE_SERIAL_PORT_DEFNS 90#define ITE_SERIAL_PORT_DEFNS
91#endif 91#endif
@@ -95,10 +95,10 @@
95#include <asm/it8172/it8172_int.h> 95#include <asm/it8172/it8172_int.h>
96#define IVR_SERIAL_PORT_DEFNS \ 96#define IVR_SERIAL_PORT_DEFNS \
97 { .baud_base = BASE_BAUD, .port = (IT8172_PCI_IO_BASE + IT_UART_BASE), \ 97 { .baud_base = BASE_BAUD, .port = (IT8172_PCI_IO_BASE + IT_UART_BASE), \
98 .irq = IT8172_UART_IRQ, .flags = STD_COM_FLAGS, .type = 0x3 }, \ 98 .irq = IT8172_UART_IRQ, .flags = STD_COM_FLAGS, .port = PORT_16550 }, \
99 /* Smart Card Reader 1 */ \ 99 /* Smart Card Reader 1 */ \
100 { .baud_base = BASE_BAUD, .port = (IT8172_PCI_IO_BASE + IT_SCR1_BASE), \ 100 { .baud_base = BASE_BAUD, .port = (IT8172_PCI_IO_BASE + IT_SCR1_BASE), \
101 .irq = IT8172_SCR1_IRQ, .flags = STD_COM_FLAGS, .type = 0x3 }, 101 .irq = IT8172_SCR1_IRQ, .flags = STD_COM_FLAGS, .port = PORT_16550 },
102#else 102#else
103#define IVR_SERIAL_PORT_DEFNS 103#define IVR_SERIAL_PORT_DEFNS
104#endif 104#endif
diff --git a/include/asm-mips/sigcontext.h b/include/asm-mips/sigcontext.h
index 8edabb0be23f..cefa657dd04a 100644
--- a/include/asm-mips/sigcontext.h
+++ b/include/asm-mips/sigcontext.h
@@ -55,8 +55,14 @@ struct sigcontext {
55struct sigcontext { 55struct sigcontext {
56 unsigned long sc_regs[32]; 56 unsigned long sc_regs[32];
57 unsigned long sc_fpregs[32]; 57 unsigned long sc_fpregs[32];
58 unsigned long sc_hi[4]; 58 unsigned long sc_mdhi;
59 unsigned long sc_lo[4]; 59 unsigned long sc_hi1;
60 unsigned long sc_hi2;
61 unsigned long sc_hi3;
62 unsigned long sc_mdlo;
63 unsigned long sc_lo1;
64 unsigned long sc_lo2;
65 unsigned long sc_lo3;
60 unsigned long sc_pc; 66 unsigned long sc_pc;
61 unsigned int sc_fpc_csr; 67 unsigned int sc_fpc_csr;
62 unsigned int sc_used_math; 68 unsigned int sc_used_math;
diff --git a/include/asm-mips/smp.h b/include/asm-mips/smp.h
index 75c6fe7c2126..e14e4b69de21 100644
--- a/include/asm-mips/smp.h
+++ b/include/asm-mips/smp.h
@@ -48,7 +48,6 @@ extern struct call_data_struct *call_data;
48#define SMP_CALL_FUNCTION 0x2 48#define SMP_CALL_FUNCTION 0x2
49 49
50extern cpumask_t phys_cpu_present_map; 50extern cpumask_t phys_cpu_present_map;
51extern cpumask_t cpu_online_map;
52#define cpu_possible_map phys_cpu_present_map 51#define cpu_possible_map phys_cpu_present_map
53 52
54extern cpumask_t cpu_callout_map; 53extern cpumask_t cpu_callout_map;
@@ -86,9 +85,9 @@ extern void prom_init_secondary(void);
86extern void plat_smp_setup(void); 85extern void plat_smp_setup(void);
87 86
88/* 87/*
89 * Called after init_IRQ but before __cpu_up. 88 * Called in smp_prepare_cpus.
90 */ 89 */
91extern void prom_prepare_cpus(unsigned int max_cpus); 90extern void plat_prepare_cpus(unsigned int max_cpus);
92 91
93/* 92/*
94 * Last chance for the board code to finish SMP initialization before 93 * Last chance for the board code to finish SMP initialization before
diff --git a/include/asm-mips/smtc.h b/include/asm-mips/smtc.h
new file mode 100644
index 000000000000..e1941d1b8726
--- /dev/null
+++ b/include/asm-mips/smtc.h
@@ -0,0 +1,55 @@
1#ifndef _ASM_SMTC_MT_H
2#define _ASM_SMTC_MT_H
3
4/*
5 * Definitions for SMTC multitasking on MIPS MT cores
6 */
7
8#include <asm/mips_mt.h>
9
10/*
11 * System-wide SMTC status information
12 */
13
14extern unsigned int smtc_status;
15
16#define SMTC_TLB_SHARED 0x00000001
17#define SMTC_MTC_ACTIVE 0x00000002
18
19/*
20 * TLB/ASID Management information
21 */
22
23#define MAX_SMTC_TLBS 2
24#define MAX_SMTC_ASIDS 256
25#if NR_CPUS <= 8
26typedef char asiduse;
27#else
28#if NR_CPUS <= 16
29typedef short asiduse;
30#else
31typedef long asiduse;
32#endif
33#endif
34
35extern asiduse smtc_live_asid[MAX_SMTC_TLBS][MAX_SMTC_ASIDS];
36
37void smtc_get_new_mmu_context(struct mm_struct *mm, unsigned long cpu);
38
39void smtc_flush_tlb_asid(unsigned long asid);
40extern int mipsmt_build_cpu_map(int startslot);
41extern void mipsmt_prepare_cpus(void);
42extern void smtc_smp_finish(void);
43extern void smtc_boot_secondary(int cpu, struct task_struct *t);
44
45/*
46 * Sharing the TLB between multiple VPEs means that the
47 * "random" index selection function is not allowed to
48 * select the current value of the Index register. To
49 * avoid additional TLB pressure, the Index registers
50 * are "parked" with an non-Valid value.
51 */
52
53#define PARKED_INDEX ((unsigned int)0x80000000)
54
55#endif /* _ASM_SMTC_MT_H */
diff --git a/include/asm-mips/smtc_ipi.h b/include/asm-mips/smtc_ipi.h
new file mode 100644
index 000000000000..f22c3e2f993a
--- /dev/null
+++ b/include/asm-mips/smtc_ipi.h
@@ -0,0 +1,118 @@
1/*
2 * Definitions used in MIPS MT SMTC "Interprocessor Interrupt" code.
3 */
4#ifndef __ASM_SMTC_IPI_H
5#define __ASM_SMTC_IPI_H
6
7//#define SMTC_IPI_DEBUG
8
9#ifdef SMTC_IPI_DEBUG
10#include <asm/mipsregs.h>
11#include <asm/mipsmtregs.h>
12#endif /* SMTC_IPI_DEBUG */
13
14/*
15 * An IPI "message"
16 */
17
18struct smtc_ipi {
19 struct smtc_ipi *flink;
20 int type;
21 void *arg;
22 int dest;
23#ifdef SMTC_IPI_DEBUG
24 int sender;
25 long stamp;
26#endif /* SMTC_IPI_DEBUG */
27};
28
29/*
30 * Defined IPI Types
31 */
32
33#define LINUX_SMP_IPI 1
34#define SMTC_CLOCK_TICK 2
35
36/*
37 * A queue of IPI messages
38 */
39
40struct smtc_ipi_q {
41 struct smtc_ipi *head;
42 spinlock_t lock;
43 struct smtc_ipi *tail;
44 int depth;
45};
46
47extern struct smtc_ipi_q IPIQ[NR_CPUS];
48extern struct smtc_ipi_q freeIPIq;
49
50static inline void smtc_ipi_nq(struct smtc_ipi_q *q, struct smtc_ipi *p)
51{
52 long flags;
53
54 spin_lock_irqsave(&q->lock, flags);
55 if (q->head == NULL)
56 q->head = q->tail = p;
57 else
58 q->tail->flink = p;
59 p->flink = NULL;
60 q->tail = p;
61 q->depth++;
62#ifdef SMTC_IPI_DEBUG
63 p->sender = read_c0_tcbind();
64 p->stamp = read_c0_count();
65#endif /* SMTC_IPI_DEBUG */
66 spin_unlock_irqrestore(&q->lock, flags);
67}
68
69static inline struct smtc_ipi *smtc_ipi_dq(struct smtc_ipi_q *q)
70{
71 struct smtc_ipi *p;
72 long flags;
73
74 spin_lock_irqsave(&q->lock, flags);
75 if (q->head == NULL)
76 p = NULL;
77 else {
78 p = q->head;
79 q->head = q->head->flink;
80 q->depth--;
81 /* Arguably unnecessary, but leaves queue cleaner */
82 if (q->head == NULL)
83 q->tail = NULL;
84 }
85 spin_unlock_irqrestore(&q->lock, flags);
86 return p;
87}
88
89static inline void smtc_ipi_req(struct smtc_ipi_q *q, struct smtc_ipi *p)
90{
91 long flags;
92
93 spin_lock_irqsave(&q->lock, flags);
94 if (q->head == NULL) {
95 q->head = q->tail = p;
96 p->flink = NULL;
97 } else {
98 p->flink = q->head;
99 q->head = p;
100 }
101 q->depth++;
102 spin_unlock_irqrestore(&q->lock, flags);
103}
104
105static inline int smtc_ipi_qdepth(struct smtc_ipi_q *q)
106{
107 long flags;
108 int retval;
109
110 spin_lock_irqsave(&q->lock, flags);
111 retval = q->depth;
112 spin_unlock_irqrestore(&q->lock, flags);
113 return retval;
114}
115
116extern void smtc_send_ipi(int cpu, int type, unsigned int action);
117
118#endif /* __ASM_SMTC_IPI_H */
diff --git a/include/asm-mips/smtc_proc.h b/include/asm-mips/smtc_proc.h
new file mode 100644
index 000000000000..25da651f1f5f
--- /dev/null
+++ b/include/asm-mips/smtc_proc.h
@@ -0,0 +1,23 @@
1/*
2 * Definitions for SMTC /proc entries
3 * Copyright(C) 2005 MIPS Technologies Inc.
4 */
5#ifndef __ASM_SMTC_PROC_H
6#define __ASM_SMTC_PROC_H
7
8/*
9 * per-"CPU" statistics
10 */
11
12struct smtc_cpu_proc {
13 unsigned long timerints;
14 unsigned long selfipis;
15};
16
17extern struct smtc_cpu_proc smtc_cpu_stats[NR_CPUS];
18
19/* Count of number of recoveries of "stolen" FPU access rights on 34K */
20
21extern atomic_t smtc_fpu_recoveries;
22
23#endif /* __ASM_SMTC_PROC_H */
diff --git a/include/asm-mips/sparsemem.h b/include/asm-mips/sparsemem.h
new file mode 100644
index 000000000000..795ac6c23203
--- /dev/null
+++ b/include/asm-mips/sparsemem.h
@@ -0,0 +1,14 @@
1#ifndef _MIPS_SPARSEMEM_H
2#define _MIPS_SPARSEMEM_H
3#ifdef CONFIG_SPARSEMEM
4
5/*
6 * SECTION_SIZE_BITS 2^N: how big each section will be
7 * MAX_PHYSMEM_BITS 2^N: how much memory we can have in that space
8 */
9#define SECTION_SIZE_BITS 28
10#define MAX_PHYSMEM_BITS 35
11
12#endif /* CONFIG_SPARSEMEM */
13#endif /* _MIPS_SPARSEMEM_H */
14
diff --git a/include/asm-mips/stackframe.h b/include/asm-mips/stackframe.h
index 2acf3e844f00..c4856a874965 100644
--- a/include/asm-mips/stackframe.h
+++ b/include/asm-mips/stackframe.h
@@ -14,9 +14,14 @@
14#include <linux/threads.h> 14#include <linux/threads.h>
15 15
16#include <asm/asm.h> 16#include <asm/asm.h>
17#include <asm/asmmacro.h>
17#include <asm/mipsregs.h> 18#include <asm/mipsregs.h>
18#include <asm/asm-offsets.h> 19#include <asm/asm-offsets.h>
19 20
21#ifdef CONFIG_MIPS_MT_SMTC
22#include <asm/mipsmtregs.h>
23#endif /* CONFIG_MIPS_MT_SMTC */
24
20 .macro SAVE_AT 25 .macro SAVE_AT
21 .set push 26 .set push
22 .set noat 27 .set noat
@@ -57,13 +62,30 @@
57#ifdef CONFIG_SMP 62#ifdef CONFIG_SMP
58 .macro get_saved_sp /* SMP variation */ 63 .macro get_saved_sp /* SMP variation */
59#ifdef CONFIG_32BIT 64#ifdef CONFIG_32BIT
65#ifdef CONFIG_MIPS_MT_SMTC
66 .set mips32
67 mfc0 k0, CP0_TCBIND;
68 .set mips0
69 lui k1, %hi(kernelsp)
70 srl k0, k0, 19
71 /* No need to shift down and up to clear bits 0-1 */
72#else
60 mfc0 k0, CP0_CONTEXT 73 mfc0 k0, CP0_CONTEXT
61 lui k1, %hi(kernelsp) 74 lui k1, %hi(kernelsp)
62 srl k0, k0, 23 75 srl k0, k0, 23
76#endif
63 addu k1, k0 77 addu k1, k0
64 LONG_L k1, %lo(kernelsp)(k1) 78 LONG_L k1, %lo(kernelsp)(k1)
65#endif 79#endif
66#ifdef CONFIG_64BIT 80#ifdef CONFIG_64BIT
81#ifdef CONFIG_MIPS_MT_SMTC
82 .set mips64
83 mfc0 k0, CP0_TCBIND;
84 .set mips0
85 lui k0, %highest(kernelsp)
86 dsrl k1, 19
87 /* No need to shift down and up to clear bits 0-2 */
88#else
67 MFC0 k1, CP0_CONTEXT 89 MFC0 k1, CP0_CONTEXT
68 lui k0, %highest(kernelsp) 90 lui k0, %highest(kernelsp)
69 dsrl k1, 23 91 dsrl k1, 23
@@ -71,20 +93,31 @@
71 dsll k0, k0, 16 93 dsll k0, k0, 16
72 daddiu k0, %hi(kernelsp) 94 daddiu k0, %hi(kernelsp)
73 dsll k0, k0, 16 95 dsll k0, k0, 16
96#endif /* CONFIG_MIPS_MT_SMTC */
74 daddu k1, k1, k0 97 daddu k1, k1, k0
75 LONG_L k1, %lo(kernelsp)(k1) 98 LONG_L k1, %lo(kernelsp)(k1)
76#endif 99#endif /* CONFIG_64BIT */
77 .endm 100 .endm
78 101
79 .macro set_saved_sp stackp temp temp2 102 .macro set_saved_sp stackp temp temp2
80#ifdef CONFIG_32BIT 103#ifdef CONFIG_32BIT
104#ifdef CONFIG_MIPS_MT_SMTC
105 mfc0 \temp, CP0_TCBIND
106 srl \temp, 19
107#else
81 mfc0 \temp, CP0_CONTEXT 108 mfc0 \temp, CP0_CONTEXT
82 srl \temp, 23 109 srl \temp, 23
83#endif 110#endif
111#endif
84#ifdef CONFIG_64BIT 112#ifdef CONFIG_64BIT
113#ifdef CONFIG_MIPS_MT_SMTC
114 mfc0 \temp, CP0_TCBIND
115 dsrl \temp, 19
116#else
85 MFC0 \temp, CP0_CONTEXT 117 MFC0 \temp, CP0_CONTEXT
86 dsrl \temp, 23 118 dsrl \temp, 23
87#endif 119#endif
120#endif
88 LONG_S \stackp, kernelsp(\temp) 121 LONG_S \stackp, kernelsp(\temp)
89 .endm 122 .endm
90#else 123#else
@@ -122,10 +155,25 @@
122 PTR_SUBU sp, k1, PT_SIZE 155 PTR_SUBU sp, k1, PT_SIZE
123 LONG_S k0, PT_R29(sp) 156 LONG_S k0, PT_R29(sp)
124 LONG_S $3, PT_R3(sp) 157 LONG_S $3, PT_R3(sp)
158 /*
159 * You might think that you don't need to save $0,
160 * but the FPU emulator and gdb remote debug stub
161 * need it to operate correctly
162 */
125 LONG_S $0, PT_R0(sp) 163 LONG_S $0, PT_R0(sp)
126 mfc0 v1, CP0_STATUS 164 mfc0 v1, CP0_STATUS
127 LONG_S $2, PT_R2(sp) 165 LONG_S $2, PT_R2(sp)
128 LONG_S v1, PT_STATUS(sp) 166 LONG_S v1, PT_STATUS(sp)
167#ifdef CONFIG_MIPS_MT_SMTC
168 /*
169 * Ideally, these instructions would be shuffled in
170 * to cover the pipeline delay.
171 */
172 .set mips32
173 mfc0 v1, CP0_TCSTATUS
174 .set mips0
175 LONG_S v1, PT_TCSTATUS(sp)
176#endif /* CONFIG_MIPS_MT_SMTC */
129 LONG_S $4, PT_R4(sp) 177 LONG_S $4, PT_R4(sp)
130 mfc0 v1, CP0_CAUSE 178 mfc0 v1, CP0_CAUSE
131 LONG_S $5, PT_R5(sp) 179 LONG_S $5, PT_R5(sp)
@@ -234,14 +282,36 @@
234 .endm 282 .endm
235 283
236#else 284#else
285/*
286 * For SMTC kernel, global IE should be left set, and interrupts
287 * controlled exclusively via IXMT.
288 */
237 289
290#ifdef CONFIG_MIPS_MT_SMTC
291#define STATMASK 0x1e
292#else
293#define STATMASK 0x1f
294#endif
238 .macro RESTORE_SOME 295 .macro RESTORE_SOME
239 .set push 296 .set push
240 .set reorder 297 .set reorder
241 .set noat 298 .set noat
299#ifdef CONFIG_MIPS_MT_SMTC
300 .set mips32r2
301 /*
302 * This may not really be necessary if ints are already
303 * inhibited here.
304 */
305 mfc0 v0, CP0_TCSTATUS
306 ori v0, TCSTATUS_IXMT
307 mtc0 v0, CP0_TCSTATUS
308 ehb
309 DMT 5 # dmt a1
310 jal mips_ihb
311#endif /* CONFIG_MIPS_MT_SMTC */
242 mfc0 a0, CP0_STATUS 312 mfc0 a0, CP0_STATUS
243 ori a0, 0x1f 313 ori a0, STATMASK
244 xori a0, 0x1f 314 xori a0, STATMASK
245 mtc0 a0, CP0_STATUS 315 mtc0 a0, CP0_STATUS
246 li v1, 0xff00 316 li v1, 0xff00
247 and a0, v1 317 and a0, v1
@@ -250,6 +320,26 @@
250 and v0, v1 320 and v0, v1
251 or v0, a0 321 or v0, a0
252 mtc0 v0, CP0_STATUS 322 mtc0 v0, CP0_STATUS
323#ifdef CONFIG_MIPS_MT_SMTC
324/*
325 * Only after EXL/ERL have been restored to status can we
326 * restore TCStatus.IXMT.
327 */
328 LONG_L v1, PT_TCSTATUS(sp)
329 ehb
330 mfc0 v0, CP0_TCSTATUS
331 andi v1, TCSTATUS_IXMT
332 /* We know that TCStatua.IXMT should be set from above */
333 xori v0, v0, TCSTATUS_IXMT
334 or v0, v0, v1
335 mtc0 v0, CP0_TCSTATUS
336 ehb
337 andi a1, a1, VPECONTROL_TE
338 beqz a1, 1f
339 emt
3401:
341 .set mips0
342#endif /* CONFIG_MIPS_MT_SMTC */
253 LONG_L v1, PT_EPC(sp) 343 LONG_L v1, PT_EPC(sp)
254 MTC0 v1, CP0_EPC 344 MTC0 v1, CP0_EPC
255 LONG_L $31, PT_R31(sp) 345 LONG_L $31, PT_R31(sp)
@@ -302,11 +392,33 @@
302 * Set cp0 enable bit as sign that we're running on the kernel stack 392 * Set cp0 enable bit as sign that we're running on the kernel stack
303 */ 393 */
304 .macro CLI 394 .macro CLI
395#if !defined(CONFIG_MIPS_MT_SMTC)
305 mfc0 t0, CP0_STATUS 396 mfc0 t0, CP0_STATUS
306 li t1, ST0_CU0 | 0x1f 397 li t1, ST0_CU0 | 0x1f
307 or t0, t1 398 or t0, t1
308 xori t0, 0x1f 399 xori t0, 0x1f
309 mtc0 t0, CP0_STATUS 400 mtc0 t0, CP0_STATUS
401#else /* CONFIG_MIPS_MT_SMTC */
402 /*
403 * For SMTC, we need to set privilege
404 * and disable interrupts only for the
405 * current TC, using the TCStatus register.
406 */
407 mfc0 t0,CP0_TCSTATUS
408 /* Fortunately CU 0 is in the same place in both registers */
409 /* Set TCU0, TMX, TKSU (for later inversion) and IXMT */
410 li t1, ST0_CU0 | 0x08001c00
411 or t0,t1
412 /* Clear TKSU, leave IXMT */
413 xori t0, 0x00001800
414 mtc0 t0, CP0_TCSTATUS
415 ehb
416 /* We need to leave the global IE bit set, but clear EXL...*/
417 mfc0 t0, CP0_STATUS
418 ori t0, ST0_EXL | ST0_ERL
419 xori t0, ST0_EXL | ST0_ERL
420 mtc0 t0, CP0_STATUS
421#endif /* CONFIG_MIPS_MT_SMTC */
310 irq_disable_hazard 422 irq_disable_hazard
311 .endm 423 .endm
312 424
@@ -315,11 +427,35 @@
315 * Set cp0 enable bit as sign that we're running on the kernel stack 427 * Set cp0 enable bit as sign that we're running on the kernel stack
316 */ 428 */
317 .macro STI 429 .macro STI
430#if !defined(CONFIG_MIPS_MT_SMTC)
318 mfc0 t0, CP0_STATUS 431 mfc0 t0, CP0_STATUS
319 li t1, ST0_CU0 | 0x1f 432 li t1, ST0_CU0 | 0x1f
320 or t0, t1 433 or t0, t1
321 xori t0, 0x1e 434 xori t0, 0x1e
322 mtc0 t0, CP0_STATUS 435 mtc0 t0, CP0_STATUS
436#else /* CONFIG_MIPS_MT_SMTC */
437 /*
438 * For SMTC, we need to set privilege
439 * and enable interrupts only for the
440 * current TC, using the TCStatus register.
441 */
442 ehb
443 mfc0 t0,CP0_TCSTATUS
444 /* Fortunately CU 0 is in the same place in both registers */
445 /* Set TCU0, TKSU (for later inversion) and IXMT */
446 li t1, ST0_CU0 | 0x08001c00
447 or t0,t1
448 /* Clear TKSU *and* IXMT */
449 xori t0, 0x00001c00
450 mtc0 t0, CP0_TCSTATUS
451 ehb
452 /* We need to leave the global IE bit set, but clear EXL...*/
453 mfc0 t0, CP0_STATUS
454 ori t0, ST0_EXL
455 xori t0, ST0_EXL
456 mtc0 t0, CP0_STATUS
457 /* irq_enable_hazard below should expand to EHB for 24K/34K cpus */
458#endif /* CONFIG_MIPS_MT_SMTC */
323 irq_enable_hazard 459 irq_enable_hazard
324 .endm 460 .endm
325 461
@@ -328,11 +464,56 @@
328 * Set cp0 enable bit as sign that we're running on the kernel stack 464 * Set cp0 enable bit as sign that we're running on the kernel stack
329 */ 465 */
330 .macro KMODE 466 .macro KMODE
467#ifdef CONFIG_MIPS_MT_SMTC
468 /*
469 * This gets baroque in SMTC. We want to
470 * protect the non-atomic clearing of EXL
471 * with DMT/EMT, but we don't want to take
472 * an interrupt while DMT is still in effect.
473 */
474
475 /* KMODE gets invoked from both reorder and noreorder code */
476 .set push
477 .set mips32r2
478 .set noreorder
479 mfc0 v0, CP0_TCSTATUS
480 andi v1, v0, TCSTATUS_IXMT
481 ori v0, TCSTATUS_IXMT
482 mtc0 v0, CP0_TCSTATUS
483 ehb
484 DMT 2 # dmt v0
485 /*
486 * We don't know a priori if ra is "live"
487 */
488 move t0, ra
489 jal mips_ihb
490 nop /* delay slot */
491 move ra, t0
492#endif /* CONFIG_MIPS_MT_SMTC */
331 mfc0 t0, CP0_STATUS 493 mfc0 t0, CP0_STATUS
332 li t1, ST0_CU0 | 0x1e 494 li t1, ST0_CU0 | 0x1e
333 or t0, t1 495 or t0, t1
334 xori t0, 0x1e 496 xori t0, 0x1e
335 mtc0 t0, CP0_STATUS 497 mtc0 t0, CP0_STATUS
498#ifdef CONFIG_MIPS_MT_SMTC
499 ehb
500 andi v0, v0, VPECONTROL_TE
501 beqz v0, 2f
502 nop /* delay slot */
503 emt
5042:
505 mfc0 v0, CP0_TCSTATUS
506 /* Clear IXMT, then OR in previous value */
507 ori v0, TCSTATUS_IXMT
508 xori v0, TCSTATUS_IXMT
509 or v0, v1, v0
510 mtc0 v0, CP0_TCSTATUS
511 /*
512 * irq_disable_hazard below should expand to EHB
513 * on 24K/34K CPUS
514 */
515 .set pop
516#endif /* CONFIG_MIPS_MT_SMTC */
336 irq_disable_hazard 517 irq_disable_hazard
337 .endm 518 .endm
338 519
diff --git a/include/asm-mips/system.h b/include/asm-mips/system.h
index 4097fac5ac3c..261f71d16a07 100644
--- a/include/asm-mips/system.h
+++ b/include/asm-mips/system.h
@@ -155,6 +155,37 @@ extern asmlinkage void *resume(void *last, void *next, void *next_ti);
155 155
156struct task_struct; 156struct task_struct;
157 157
158#ifdef CONFIG_MIPS_MT_FPAFF
159
160/*
161 * Handle the scheduler resume end of FPU affinity management. We do this
162 * inline to try to keep the overhead down. If we have been forced to run on
163 * a "CPU" with an FPU because of a previous high level of FP computation,
164 * but did not actually use the FPU during the most recent time-slice (CU1
165 * isn't set), we undo the restriction on cpus_allowed.
166 *
167 * We're not calling set_cpus_allowed() here, because we have no need to
168 * force prompt migration - we're already switching the current CPU to a
169 * different thread.
170 */
171
172#define switch_to(prev,next,last) \
173do { \
174 if (cpu_has_fpu && \
175 (prev->thread.mflags & MF_FPUBOUND) && \
176 (!(KSTK_STATUS(prev) & ST0_CU1))) { \
177 prev->thread.mflags &= ~MF_FPUBOUND; \
178 prev->cpus_allowed = prev->thread.user_cpus_allowed; \
179 } \
180 if (cpu_has_dsp) \
181 __save_dsp(prev); \
182 next->thread.emulated_fp = 0; \
183 (last) = resume(prev, next, next->thread_info); \
184 if (cpu_has_dsp) \
185 __restore_dsp(current); \
186} while(0)
187
188#else
158#define switch_to(prev,next,last) \ 189#define switch_to(prev,next,last) \
159do { \ 190do { \
160 if (cpu_has_dsp) \ 191 if (cpu_has_dsp) \
@@ -163,6 +194,7 @@ do { \
163 if (cpu_has_dsp) \ 194 if (cpu_has_dsp) \
164 __restore_dsp(current); \ 195 __restore_dsp(current); \
165} while(0) 196} while(0)
197#endif
166 198
167/* 199/*
168 * On SMP systems, when the scheduler does migration-cost autodetection, 200 * On SMP systems, when the scheduler does migration-cost autodetection,
@@ -440,8 +472,8 @@ static inline unsigned long __cmpxchg(volatile void * ptr, unsigned long old,
440extern void set_handler (unsigned long offset, void *addr, unsigned long len); 472extern void set_handler (unsigned long offset, void *addr, unsigned long len);
441extern void set_uncached_handler (unsigned long offset, void *addr, unsigned long len); 473extern void set_uncached_handler (unsigned long offset, void *addr, unsigned long len);
442extern void *set_vi_handler (int n, void *addr); 474extern void *set_vi_handler (int n, void *addr);
443extern void *set_vi_srs_handler (int n, void *addr, int regset);
444extern void *set_except_vector(int n, void *addr); 475extern void *set_except_vector(int n, void *addr);
476extern unsigned long ebase;
445extern void per_cpu_trap_init(void); 477extern void per_cpu_trap_init(void);
446 478
447extern NORET_TYPE void die(const char *, struct pt_regs *); 479extern NORET_TYPE void die(const char *, struct pt_regs *);
diff --git a/include/asm-mips/unistd.h b/include/asm-mips/unistd.h
index b5c78a4a0192..1068fe9a0a58 100644
--- a/include/asm-mips/unistd.h
+++ b/include/asm-mips/unistd.h
@@ -324,16 +324,18 @@
324#define __NR_pselect6 (__NR_Linux + 301) 324#define __NR_pselect6 (__NR_Linux + 301)
325#define __NR_ppoll (__NR_Linux + 302) 325#define __NR_ppoll (__NR_Linux + 302)
326#define __NR_unshare (__NR_Linux + 303) 326#define __NR_unshare (__NR_Linux + 303)
327#define __NR_splice (__NR_Linux + 304)
328#define __NR_sync_file_range (__NR_Linux + 305)
327 329
328/* 330/*
329 * Offset of the last Linux o32 flavoured syscall 331 * Offset of the last Linux o32 flavoured syscall
330 */ 332 */
331#define __NR_Linux_syscalls 303 333#define __NR_Linux_syscalls 305
332 334
333#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ 335#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
334 336
335#define __NR_O32_Linux 4000 337#define __NR_O32_Linux 4000
336#define __NR_O32_Linux_syscalls 303 338#define __NR_O32_Linux_syscalls 305
337 339
338#if _MIPS_SIM == _MIPS_SIM_ABI64 340#if _MIPS_SIM == _MIPS_SIM_ABI64
339 341
@@ -604,16 +606,18 @@
604#define __NR_pselect6 (__NR_Linux + 260) 606#define __NR_pselect6 (__NR_Linux + 260)
605#define __NR_ppoll (__NR_Linux + 261) 607#define __NR_ppoll (__NR_Linux + 261)
606#define __NR_unshare (__NR_Linux + 262) 608#define __NR_unshare (__NR_Linux + 262)
609#define __NR_splice (__NR_Linux + 263)
610#define __NR_sync_file_range (__NR_Linux + 264)
607 611
608/* 612/*
609 * Offset of the last Linux 64-bit flavoured syscall 613 * Offset of the last Linux 64-bit flavoured syscall
610 */ 614 */
611#define __NR_Linux_syscalls 262 615#define __NR_Linux_syscalls 264
612 616
613#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ 617#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
614 618
615#define __NR_64_Linux 5000 619#define __NR_64_Linux 5000
616#define __NR_64_Linux_syscalls 262 620#define __NR_64_Linux_syscalls 264
617 621
618#if _MIPS_SIM == _MIPS_SIM_NABI32 622#if _MIPS_SIM == _MIPS_SIM_NABI32
619 623
@@ -888,16 +892,18 @@
888#define __NR_pselect6 (__NR_Linux + 264) 892#define __NR_pselect6 (__NR_Linux + 264)
889#define __NR_ppoll (__NR_Linux + 265) 893#define __NR_ppoll (__NR_Linux + 265)
890#define __NR_unshare (__NR_Linux + 266) 894#define __NR_unshare (__NR_Linux + 266)
895#define __NR_splice (__NR_Linux + 267)
896#define __NR_sync_file_range (__NR_Linux + 268)
891 897
892/* 898/*
893 * Offset of the last N32 flavoured syscall 899 * Offset of the last N32 flavoured syscall
894 */ 900 */
895#define __NR_Linux_syscalls 266 901#define __NR_Linux_syscalls 268
896 902
897#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ 903#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
898 904
899#define __NR_N32_Linux 6000 905#define __NR_N32_Linux 6000
900#define __NR_N32_Linux_syscalls 266 906#define __NR_N32_Linux_syscalls 268
901 907
902#ifndef __ASSEMBLY__ 908#ifndef __ASSEMBLY__
903 909
diff --git a/include/asm-mips/vpe.h b/include/asm-mips/vpe.h
new file mode 100644
index 000000000000..c6e1b961537d
--- /dev/null
+++ b/include/asm-mips/vpe.h
@@ -0,0 +1,37 @@
1/*
2 * Copyright (C) 2005 MIPS Technologies, Inc. All rights reserved.
3 *
4 * This program is free software; you can distribute it and/or modify it
5 * under the terms of the GNU General Public License (Version 2) as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11 * for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
16 *
17 */
18
19#ifndef _ASM_VPE_H
20#define _ASM_VPE_H
21
22struct vpe_notifications {
23 void (*start)(int vpe);
24 void (*stop)(int vpe);
25
26 struct list_head list;
27};
28
29
30extern int vpe_notify(int index, struct vpe_notifications *notify);
31
32extern void *vpe_get_shared(int index);
33extern int vpe_getuid(int index);
34extern int vpe_getgid(int index);
35extern char *vpe_getcwd(int index);
36
37#endif /* _ASM_VPE_H */
diff --git a/include/asm-parisc/io.h b/include/asm-parisc/io.h
index 29da31194b91..244f6b8883f4 100644
--- a/include/asm-parisc/io.h
+++ b/include/asm-parisc/io.h
@@ -126,24 +126,17 @@ static inline void gsc_writeq(unsigned long long val, unsigned long addr)
126 126
127extern void __iomem * __ioremap(unsigned long offset, unsigned long size, unsigned long flags); 127extern void __iomem * __ioremap(unsigned long offset, unsigned long size, unsigned long flags);
128 128
129extern inline void __iomem * ioremap(unsigned long offset, unsigned long size) 129/* Most machines react poorly to I/O-space being cacheable... Instead let's
130{ 130 * define ioremap() in terms of ioremap_nocache().
131 return __ioremap(offset, size, 0);
132}
133
134/*
135 * This one maps high address device memory and turns off caching for that area.
136 * it's useful if some control registers are in such an area and write combining
137 * or read caching is not desirable:
138 */ 131 */
139extern inline void * ioremap_nocache(unsigned long offset, unsigned long size) 132extern inline void __iomem * ioremap(unsigned long offset, unsigned long size)
140{ 133{
141 return __ioremap(offset, size, _PAGE_NO_CACHE /* _PAGE_PCD */); 134 return __ioremap(offset, size, _PAGE_NO_CACHE);
142} 135}
136#define ioremap_nocache(off, sz) ioremap((off), (sz))
143 137
144extern void iounmap(void __iomem *addr); 138extern void iounmap(void __iomem *addr);
145 139
146
147static inline unsigned char __raw_readb(const volatile void __iomem *addr) 140static inline unsigned char __raw_readb(const volatile void __iomem *addr)
148{ 141{
149 return (*(volatile unsigned char __force *) (addr)); 142 return (*(volatile unsigned char __force *) (addr));
diff --git a/include/asm-parisc/page.h b/include/asm-parisc/page.h
index 45e02aa5bf4b..c0dd461fb8f1 100644
--- a/include/asm-parisc/page.h
+++ b/include/asm-parisc/page.h
@@ -1,13 +1,30 @@
1#ifndef _PARISC_PAGE_H 1#ifndef _PARISC_PAGE_H
2#define _PARISC_PAGE_H 2#define _PARISC_PAGE_H
3 3
4/* PAGE_SHIFT determines the page size */ 4#if !defined(__KERNEL__)
5#define PAGE_SHIFT 12 5/* this is for userspace applications (4k page size) */
6#define PAGE_SIZE (1UL << PAGE_SHIFT) 6# define PAGE_SHIFT 12 /* 4k */
7#define PAGE_MASK (~(PAGE_SIZE-1)) 7# define PAGE_SIZE (1UL << PAGE_SHIFT)
8# define PAGE_MASK (~(PAGE_SIZE-1))
9#endif
10
8 11
9#ifdef __KERNEL__ 12#ifdef __KERNEL__
10#include <linux/config.h> 13#include <linux/config.h>
14
15#if defined(CONFIG_PARISC_PAGE_SIZE_4KB)
16# define PAGE_SHIFT 12 /* 4k */
17#elif defined(CONFIG_PARISC_PAGE_SIZE_16KB)
18# define PAGE_SHIFT 14 /* 16k */
19#elif defined(CONFIG_PARISC_PAGE_SIZE_64KB)
20# define PAGE_SHIFT 16 /* 64k */
21#else
22# error "unknown default kernel page size"
23#endif
24#define PAGE_SIZE (1UL << PAGE_SHIFT)
25#define PAGE_MASK (~(PAGE_SIZE-1))
26
27
11#ifndef __ASSEMBLY__ 28#ifndef __ASSEMBLY__
12 29
13#include <asm/types.h> 30#include <asm/types.h>
diff --git a/include/asm-parisc/pgtable.h b/include/asm-parisc/pgtable.h
index 4e34c6b44059..aec089eb8b85 100644
--- a/include/asm-parisc/pgtable.h
+++ b/include/asm-parisc/pgtable.h
@@ -59,16 +59,15 @@
59#define ISTACK_SIZE 32768 /* Interrupt Stack Size */ 59#define ISTACK_SIZE 32768 /* Interrupt Stack Size */
60#define ISTACK_ORDER 3 60#define ISTACK_ORDER 3
61 61
62/* This is the size of the initially mapped kernel memory (i.e. currently 62/* This is the size of the initially mapped kernel memory */
63 * 0 to 1<<23 == 8MB */
64#ifdef CONFIG_64BIT 63#ifdef CONFIG_64BIT
65#define KERNEL_INITIAL_ORDER 24 64#define KERNEL_INITIAL_ORDER 24 /* 0 to 1<<24 = 16MB */
66#else 65#else
67#define KERNEL_INITIAL_ORDER 23 66#define KERNEL_INITIAL_ORDER 23 /* 0 to 1<<23 = 8MB */
68#endif 67#endif
69#define KERNEL_INITIAL_SIZE (1 << KERNEL_INITIAL_ORDER) 68#define KERNEL_INITIAL_SIZE (1 << KERNEL_INITIAL_ORDER)
70 69
71#ifdef CONFIG_64BIT 70#if defined(CONFIG_64BIT) && defined(CONFIG_PARISC_PAGE_SIZE_4KB)
72#define PT_NLEVELS 3 71#define PT_NLEVELS 3
73#define PGD_ORDER 1 /* Number of pages per pgd */ 72#define PGD_ORDER 1 /* Number of pages per pgd */
74#define PMD_ORDER 1 /* Number of pages per pmd */ 73#define PMD_ORDER 1 /* Number of pages per pmd */
@@ -111,11 +110,15 @@
111#define MAX_ADDRBITS (PGDIR_SHIFT + BITS_PER_PGD) 110#define MAX_ADDRBITS (PGDIR_SHIFT + BITS_PER_PGD)
112#define MAX_ADDRESS (1UL << MAX_ADDRBITS) 111#define MAX_ADDRESS (1UL << MAX_ADDRBITS)
113 112
114#define SPACEID_SHIFT (MAX_ADDRBITS - 32) 113#define SPACEID_SHIFT (MAX_ADDRBITS - 32)
115 114
116/* This calculates the number of initial pages we need for the initial 115/* This calculates the number of initial pages we need for the initial
117 * page tables */ 116 * page tables */
118#define PT_INITIAL (1 << (KERNEL_INITIAL_ORDER - PMD_SHIFT)) 117#if (KERNEL_INITIAL_ORDER) >= (PMD_SHIFT)
118# define PT_INITIAL (1 << (KERNEL_INITIAL_ORDER - PMD_SHIFT))
119#else
120# define PT_INITIAL (1) /* all initial PTEs fit into one page */
121#endif
119 122
120/* 123/*
121 * pgd entries used up by user/kernel: 124 * pgd entries used up by user/kernel:
@@ -160,6 +163,10 @@ extern void *vmalloc_start;
160 * to zero */ 163 * to zero */
161#define PTE_SHIFT xlate_pabit(_PAGE_USER_BIT) 164#define PTE_SHIFT xlate_pabit(_PAGE_USER_BIT)
162 165
166/* PFN_PTE_SHIFT defines the shift of a PTE value to access the PFN field */
167#define PFN_PTE_SHIFT 12
168
169
163/* this is how many bits may be used by the file functions */ 170/* this is how many bits may be used by the file functions */
164#define PTE_FILE_MAX_BITS (BITS_PER_LONG - PTE_SHIFT) 171#define PTE_FILE_MAX_BITS (BITS_PER_LONG - PTE_SHIFT)
165 172
@@ -188,7 +195,8 @@ extern void *vmalloc_start;
188/* The pgd/pmd contains a ptr (in phys addr space); since all pgds/pmds 195/* The pgd/pmd contains a ptr (in phys addr space); since all pgds/pmds
189 * are page-aligned, we don't care about the PAGE_OFFSET bits, except 196 * are page-aligned, we don't care about the PAGE_OFFSET bits, except
190 * for a few meta-information bits, so we shift the address to be 197 * for a few meta-information bits, so we shift the address to be
191 * able to effectively address 40-bits of physical address space. */ 198 * able to effectively address 40/42/44-bits of physical address space
199 * depending on 4k/16k/64k PAGE_SIZE */
192#define _PxD_PRESENT_BIT 31 200#define _PxD_PRESENT_BIT 31
193#define _PxD_ATTACHED_BIT 30 201#define _PxD_ATTACHED_BIT 30
194#define _PxD_VALID_BIT 29 202#define _PxD_VALID_BIT 29
@@ -198,7 +206,7 @@ extern void *vmalloc_start;
198#define PxD_FLAG_VALID (1 << xlate_pabit(_PxD_VALID_BIT)) 206#define PxD_FLAG_VALID (1 << xlate_pabit(_PxD_VALID_BIT))
199#define PxD_FLAG_MASK (0xf) 207#define PxD_FLAG_MASK (0xf)
200#define PxD_FLAG_SHIFT (4) 208#define PxD_FLAG_SHIFT (4)
201#define PxD_VALUE_SHIFT (8) 209#define PxD_VALUE_SHIFT (8) /* (PAGE_SHIFT-PxD_FLAG_SHIFT) */
202 210
203#ifndef __ASSEMBLY__ 211#ifndef __ASSEMBLY__
204 212
@@ -246,6 +254,7 @@ extern void *vmalloc_start;
246#define __S110 PAGE_RWX 254#define __S110 PAGE_RWX
247#define __S111 PAGE_RWX 255#define __S111 PAGE_RWX
248 256
257
249extern pgd_t swapper_pg_dir[]; /* declared in init_task.c */ 258extern pgd_t swapper_pg_dir[]; /* declared in init_task.c */
250 259
251/* initial page tables for 0-8MB for kernel */ 260/* initial page tables for 0-8MB for kernel */
@@ -272,7 +281,7 @@ extern unsigned long *empty_zero_page;
272#define pgd_flag(x) (pgd_val(x) & PxD_FLAG_MASK) 281#define pgd_flag(x) (pgd_val(x) & PxD_FLAG_MASK)
273#define pgd_address(x) ((unsigned long)(pgd_val(x) &~ PxD_FLAG_MASK) << PxD_VALUE_SHIFT) 282#define pgd_address(x) ((unsigned long)(pgd_val(x) &~ PxD_FLAG_MASK) << PxD_VALUE_SHIFT)
274 283
275#ifdef CONFIG_64BIT 284#if PT_NLEVELS == 3
276/* The first entry of the permanent pmd is not there if it contains 285/* The first entry of the permanent pmd is not there if it contains
277 * the gateway marker */ 286 * the gateway marker */
278#define pmd_none(x) (!pmd_val(x) || pmd_flag(x) == PxD_FLAG_ATTACHED) 287#define pmd_none(x) (!pmd_val(x) || pmd_flag(x) == PxD_FLAG_ATTACHED)
@@ -282,7 +291,7 @@ extern unsigned long *empty_zero_page;
282#define pmd_bad(x) (!(pmd_flag(x) & PxD_FLAG_VALID)) 291#define pmd_bad(x) (!(pmd_flag(x) & PxD_FLAG_VALID))
283#define pmd_present(x) (pmd_flag(x) & PxD_FLAG_PRESENT) 292#define pmd_present(x) (pmd_flag(x) & PxD_FLAG_PRESENT)
284static inline void pmd_clear(pmd_t *pmd) { 293static inline void pmd_clear(pmd_t *pmd) {
285#ifdef CONFIG_64BIT 294#if PT_NLEVELS == 3
286 if (pmd_flag(*pmd) & PxD_FLAG_ATTACHED) 295 if (pmd_flag(*pmd) & PxD_FLAG_ATTACHED)
287 /* This is the entry pointing to the permanent pmd 296 /* This is the entry pointing to the permanent pmd
288 * attached to the pgd; cannot clear it */ 297 * attached to the pgd; cannot clear it */
@@ -303,7 +312,7 @@ static inline void pmd_clear(pmd_t *pmd) {
303#define pgd_bad(x) (!(pgd_flag(x) & PxD_FLAG_VALID)) 312#define pgd_bad(x) (!(pgd_flag(x) & PxD_FLAG_VALID))
304#define pgd_present(x) (pgd_flag(x) & PxD_FLAG_PRESENT) 313#define pgd_present(x) (pgd_flag(x) & PxD_FLAG_PRESENT)
305static inline void pgd_clear(pgd_t *pgd) { 314static inline void pgd_clear(pgd_t *pgd) {
306#ifdef CONFIG_64BIT 315#if PT_NLEVELS == 3
307 if(pgd_flag(*pgd) & PxD_FLAG_ATTACHED) 316 if(pgd_flag(*pgd) & PxD_FLAG_ATTACHED)
308 /* This is the permanent pmd attached to the pgd; cannot 317 /* This is the permanent pmd attached to the pgd; cannot
309 * free it */ 318 * free it */
@@ -351,7 +360,7 @@ extern inline pte_t pte_mkwrite(pte_t pte) { pte_val(pte) |= _PAGE_WRITE; return
351({ \ 360({ \
352 pte_t __pte; \ 361 pte_t __pte; \
353 \ 362 \
354 pte_val(__pte) = ((addr)+pgprot_val(pgprot)); \ 363 pte_val(__pte) = ((((addr)>>PAGE_SHIFT)<<PFN_PTE_SHIFT) + pgprot_val(pgprot)); \
355 \ 364 \
356 __pte; \ 365 __pte; \
357}) 366})
@@ -361,20 +370,16 @@ extern inline pte_t pte_mkwrite(pte_t pte) { pte_val(pte) |= _PAGE_WRITE; return
361static inline pte_t pfn_pte(unsigned long pfn, pgprot_t pgprot) 370static inline pte_t pfn_pte(unsigned long pfn, pgprot_t pgprot)
362{ 371{
363 pte_t pte; 372 pte_t pte;
364 pte_val(pte) = (pfn << PAGE_SHIFT) | pgprot_val(pgprot); 373 pte_val(pte) = (pfn << PFN_PTE_SHIFT) | pgprot_val(pgprot);
365 return pte; 374 return pte;
366} 375}
367 376
368/* This takes a physical page address that is used by the remapping functions */
369#define mk_pte_phys(physpage, pgprot) \
370({ pte_t __pte; pte_val(__pte) = physpage + pgprot_val(pgprot); __pte; })
371
372extern inline pte_t pte_modify(pte_t pte, pgprot_t newprot) 377extern inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
373{ pte_val(pte) = (pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot); return pte; } 378{ pte_val(pte) = (pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot); return pte; }
374 379
375/* Permanent address of a page. On parisc we don't have highmem. */ 380/* Permanent address of a page. On parisc we don't have highmem. */
376 381
377#define pte_pfn(x) (pte_val(x) >> PAGE_SHIFT) 382#define pte_pfn(x) (pte_val(x) >> PFN_PTE_SHIFT)
378 383
379#define pte_page(pte) (pfn_to_page(pte_pfn(pte))) 384#define pte_page(pte) (pfn_to_page(pte_pfn(pte)))
380 385
@@ -499,6 +504,26 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr,
499 504
500#endif /* !__ASSEMBLY__ */ 505#endif /* !__ASSEMBLY__ */
501 506
507
508/* TLB page size encoding - see table 3-1 in parisc20.pdf */
509#define _PAGE_SIZE_ENCODING_4K 0
510#define _PAGE_SIZE_ENCODING_16K 1
511#define _PAGE_SIZE_ENCODING_64K 2
512#define _PAGE_SIZE_ENCODING_256K 3
513#define _PAGE_SIZE_ENCODING_1M 4
514#define _PAGE_SIZE_ENCODING_4M 5
515#define _PAGE_SIZE_ENCODING_16M 6
516#define _PAGE_SIZE_ENCODING_64M 7
517
518#if defined(CONFIG_PARISC_PAGE_SIZE_4KB)
519# define _PAGE_SIZE_ENCODING_DEFAULT _PAGE_SIZE_ENCODING_4K
520#elif defined(CONFIG_PARISC_PAGE_SIZE_16KB)
521# define _PAGE_SIZE_ENCODING_DEFAULT _PAGE_SIZE_ENCODING_16K
522#elif defined(CONFIG_PARISC_PAGE_SIZE_64KB)
523# define _PAGE_SIZE_ENCODING_DEFAULT _PAGE_SIZE_ENCODING_64K
524#endif
525
526
502#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \ 527#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
503 remap_pfn_range(vma, vaddr, pfn, size, prot) 528 remap_pfn_range(vma, vaddr, pfn, size, prot)
504 529
diff --git a/include/asm-parisc/unistd.h b/include/asm-parisc/unistd.h
index c56fccbf34ad..0e1a30be2e30 100644
--- a/include/asm-parisc/unistd.h
+++ b/include/asm-parisc/unistd.h
@@ -780,8 +780,14 @@
780#define __NR_readlinkat (__NR_Linux + 285) 780#define __NR_readlinkat (__NR_Linux + 285)
781#define __NR_fchmodat (__NR_Linux + 286) 781#define __NR_fchmodat (__NR_Linux + 286)
782#define __NR_faccessat (__NR_Linux + 287) 782#define __NR_faccessat (__NR_Linux + 287)
783#define __NR_unshare (__NR_Linux + 288)
784#define __NR_set_robust_list (__NR_Linux + 289)
785#define __NR_get_robust_list (__NR_Linux + 290)
786#define __NR_splice (__NR_Linux + 291)
787#define __NR_sync_file_range (__NR_Linux + 292)
788#define __NR_tee (__NR_Linux + 293)
783 789
784#define __NR_Linux_syscalls 288 790#define __NR_Linux_syscalls 294
785 791
786#define HPUX_GATEWAY_ADDR 0xC0000004 792#define HPUX_GATEWAY_ADDR 0xC0000004
787#define LINUX_GATEWAY_ADDR 0x100 793#define LINUX_GATEWAY_ADDR 0x100
diff --git a/include/asm-powerpc/cputable.h b/include/asm-powerpc/cputable.h
index 4321483cce51..9fcf0162d859 100644
--- a/include/asm-powerpc/cputable.h
+++ b/include/asm-powerpc/cputable.h
@@ -22,6 +22,7 @@
22#define PPC_FEATURE_BOOKE 0x00008000 22#define PPC_FEATURE_BOOKE 0x00008000
23#define PPC_FEATURE_SMT 0x00004000 23#define PPC_FEATURE_SMT 0x00004000
24#define PPC_FEATURE_ICACHE_SNOOP 0x00002000 24#define PPC_FEATURE_ICACHE_SNOOP 0x00002000
25#define PPC_FEATURE_ARCH_2_05 0x00001000
25 26
26#ifdef __KERNEL__ 27#ifdef __KERNEL__
27#ifndef __ASSEMBLY__ 28#ifndef __ASSEMBLY__
@@ -320,6 +321,11 @@ extern void do_cpu_ftr_fixups(unsigned long offset);
320 CPU_FTR_MMCRA | CPU_FTR_SMT | \ 321 CPU_FTR_MMCRA | CPU_FTR_SMT | \
321 CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \ 322 CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \
322 CPU_FTR_MMCRA_SIHV | CPU_FTR_PURR) 323 CPU_FTR_MMCRA_SIHV | CPU_FTR_PURR)
324#define CPU_FTRS_POWER6 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \
325 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | \
326 CPU_FTR_MMCRA | CPU_FTR_SMT | \
327 CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \
328 CPU_FTR_PURR | CPU_FTR_CI_LARGE_PAGE)
323#define CPU_FTRS_CELL (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ 329#define CPU_FTRS_CELL (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \
324 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | \ 330 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | \
325 CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \ 331 CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \
@@ -331,8 +337,8 @@ extern void do_cpu_ftr_fixups(unsigned long offset);
331#ifdef __powerpc64__ 337#ifdef __powerpc64__
332#define CPU_FTRS_POSSIBLE \ 338#define CPU_FTRS_POSSIBLE \
333 (CPU_FTRS_POWER3 | CPU_FTRS_RS64 | CPU_FTRS_POWER4 | \ 339 (CPU_FTRS_POWER3 | CPU_FTRS_RS64 | CPU_FTRS_POWER4 | \
334 CPU_FTRS_PPC970 | CPU_FTRS_POWER5 | CPU_FTRS_CELL | \ 340 CPU_FTRS_PPC970 | CPU_FTRS_POWER5 | CPU_FTRS_POWER6 | \
335 CPU_FTR_CI_LARGE_PAGE) 341 CPU_FTRS_CELL | CPU_FTR_CI_LARGE_PAGE)
336#else 342#else
337enum { 343enum {
338 CPU_FTRS_POSSIBLE = 344 CPU_FTRS_POSSIBLE =
@@ -376,8 +382,8 @@ enum {
376#ifdef __powerpc64__ 382#ifdef __powerpc64__
377#define CPU_FTRS_ALWAYS \ 383#define CPU_FTRS_ALWAYS \
378 (CPU_FTRS_POWER3 & CPU_FTRS_RS64 & CPU_FTRS_POWER4 & \ 384 (CPU_FTRS_POWER3 & CPU_FTRS_RS64 & CPU_FTRS_POWER4 & \
379 CPU_FTRS_PPC970 & CPU_FTRS_POWER5 & CPU_FTRS_CELL & \ 385 CPU_FTRS_PPC970 & CPU_FTRS_POWER5 & CPU_FTRS_POWER6 & \
380 CPU_FTRS_POSSIBLE) 386 CPU_FTRS_CELL & CPU_FTRS_POSSIBLE)
381#else 387#else
382enum { 388enum {
383 CPU_FTRS_ALWAYS = 389 CPU_FTRS_ALWAYS =
diff --git a/include/asm-powerpc/io.h b/include/asm-powerpc/io.h
index 68efbea379c9..f1c2469b8844 100644
--- a/include/asm-powerpc/io.h
+++ b/include/asm-powerpc/io.h
@@ -9,6 +9,9 @@
9 * 2 of the License, or (at your option) any later version. 9 * 2 of the License, or (at your option) any later version.
10 */ 10 */
11 11
12/* Check of existence of legacy devices */
13extern int check_legacy_ioport(unsigned long base_port);
14
12#ifndef CONFIG_PPC64 15#ifndef CONFIG_PPC64
13#include <asm-ppc/io.h> 16#include <asm-ppc/io.h>
14#else 17#else
@@ -437,9 +440,6 @@ out:
437#define dma_cache_wback(_start,_size) do { } while (0) 440#define dma_cache_wback(_start,_size) do { } while (0)
438#define dma_cache_wback_inv(_start,_size) do { } while (0) 441#define dma_cache_wback_inv(_start,_size) do { } while (0)
439 442
440/* Check of existence of legacy devices */
441extern int check_legacy_ioport(unsigned long base_port);
442
443 443
444/* 444/*
445 * Convert a physical pointer to a virtual kernel pointer for /dev/mem 445 * Convert a physical pointer to a virtual kernel pointer for /dev/mem
diff --git a/include/asm-powerpc/iommu.h b/include/asm-powerpc/iommu.h
index d5677cbec200..18ca29e9105a 100644
--- a/include/asm-powerpc/iommu.h
+++ b/include/asm-powerpc/iommu.h
@@ -70,17 +70,18 @@ extern void iommu_free_table(struct device_node *dn);
70extern struct iommu_table *iommu_init_table(struct iommu_table * tbl); 70extern struct iommu_table *iommu_init_table(struct iommu_table * tbl);
71 71
72extern int iommu_map_sg(struct device *dev, struct iommu_table *tbl, 72extern int iommu_map_sg(struct device *dev, struct iommu_table *tbl,
73 struct scatterlist *sglist, int nelems, 73 struct scatterlist *sglist, int nelems, unsigned long mask,
74 enum dma_data_direction direction); 74 enum dma_data_direction direction);
75extern void iommu_unmap_sg(struct iommu_table *tbl, struct scatterlist *sglist, 75extern void iommu_unmap_sg(struct iommu_table *tbl, struct scatterlist *sglist,
76 int nelems, enum dma_data_direction direction); 76 int nelems, enum dma_data_direction direction);
77 77
78extern void *iommu_alloc_coherent(struct iommu_table *tbl, size_t size, 78extern void *iommu_alloc_coherent(struct iommu_table *tbl, size_t size,
79 dma_addr_t *dma_handle, gfp_t flag); 79 dma_addr_t *dma_handle, unsigned long mask, gfp_t flag);
80extern void iommu_free_coherent(struct iommu_table *tbl, size_t size, 80extern void iommu_free_coherent(struct iommu_table *tbl, size_t size,
81 void *vaddr, dma_addr_t dma_handle); 81 void *vaddr, dma_addr_t dma_handle);
82extern dma_addr_t iommu_map_single(struct iommu_table *tbl, void *vaddr, 82extern dma_addr_t iommu_map_single(struct iommu_table *tbl, void *vaddr,
83 size_t size, enum dma_data_direction direction); 83 size_t size, unsigned long mask,
84 enum dma_data_direction direction);
84extern void iommu_unmap_single(struct iommu_table *tbl, dma_addr_t dma_handle, 85extern void iommu_unmap_single(struct iommu_table *tbl, dma_addr_t dma_handle,
85 size_t size, enum dma_data_direction direction); 86 size_t size, enum dma_data_direction direction);
86 87
diff --git a/include/asm-powerpc/irq.h b/include/asm-powerpc/irq.h
index 51f87d9993b6..7bc6d73b2823 100644
--- a/include/asm-powerpc/irq.h
+++ b/include/asm-powerpc/irq.h
@@ -54,6 +54,13 @@
54 */ 54 */
55extern unsigned int virt_irq_to_real_map[NR_IRQS]; 55extern unsigned int virt_irq_to_real_map[NR_IRQS];
56 56
57/* The maximum virtual IRQ number that we support. This
58 * can be set by the platform and will be reduced by the
59 * value of __irq_offset_value. It defaults to and is
60 * capped by (NR_IRQS - 1).
61 */
62extern unsigned int virt_irq_max;
63
57/* Create a mapping for a real_irq if it doesn't already exist. 64/* Create a mapping for a real_irq if it doesn't already exist.
58 * Return the virtual irq as a convenience. 65 * Return the virtual irq as a convenience.
59 */ 66 */
diff --git a/include/asm-powerpc/machdep.h b/include/asm-powerpc/machdep.h
index 5ed847680754..0f9254c18914 100644
--- a/include/asm-powerpc/machdep.h
+++ b/include/asm-powerpc/machdep.h
@@ -253,7 +253,11 @@ extern struct machdep_calls *machine_id;
253 253
254#define __machine_desc __attribute__ ((__section__ (".machine.desc"))) 254#define __machine_desc __attribute__ ((__section__ (".machine.desc")))
255 255
256#define define_machine(name) struct machdep_calls mach_##name __machine_desc = 256#define define_machine(name) \
257 extern struct machdep_calls mach_##name; \
258 EXPORT_SYMBOL(mach_##name); \
259 struct machdep_calls mach_##name __machine_desc =
260
257#define machine_is(name) \ 261#define machine_is(name) \
258 ({ \ 262 ({ \
259 extern struct machdep_calls mach_##name \ 263 extern struct machdep_calls mach_##name \
diff --git a/include/asm-powerpc/page_64.h b/include/asm-powerpc/page_64.h
index 3fb061bab9ec..eab779c21995 100644
--- a/include/asm-powerpc/page_64.h
+++ b/include/asm-powerpc/page_64.h
@@ -101,6 +101,7 @@ extern unsigned int HPAGE_SHIFT;
101 - (1U << GET_HTLB_AREA(addr))) & 0xffff) 101 - (1U << GET_HTLB_AREA(addr))) & 0xffff)
102 102
103#define ARCH_HAS_HUGEPAGE_ONLY_RANGE 103#define ARCH_HAS_HUGEPAGE_ONLY_RANGE
104#define ARCH_HAS_HUGETLB_FREE_PGD_RANGE
104#define ARCH_HAS_PREPARE_HUGEPAGE_RANGE 105#define ARCH_HAS_PREPARE_HUGEPAGE_RANGE
105#define ARCH_HAS_SETCLEAR_HUGE_PTE 106#define ARCH_HAS_SETCLEAR_HUGE_PTE
106 107
diff --git a/include/asm-powerpc/pgalloc.h b/include/asm-powerpc/pgalloc.h
index a00ee002cd11..9f0917c68659 100644
--- a/include/asm-powerpc/pgalloc.h
+++ b/include/asm-powerpc/pgalloc.h
@@ -17,11 +17,13 @@ extern kmem_cache_t *pgtable_cache[];
17#define PTE_CACHE_NUM 0 17#define PTE_CACHE_NUM 0
18#define PMD_CACHE_NUM 1 18#define PMD_CACHE_NUM 1
19#define PGD_CACHE_NUM 2 19#define PGD_CACHE_NUM 2
20#define HUGEPTE_CACHE_NUM 3
20#else 21#else
21#define PTE_CACHE_NUM 0 22#define PTE_CACHE_NUM 0
22#define PMD_CACHE_NUM 1 23#define PMD_CACHE_NUM 1
23#define PUD_CACHE_NUM 1 24#define PUD_CACHE_NUM 1
24#define PGD_CACHE_NUM 0 25#define PGD_CACHE_NUM 0
26#define HUGEPTE_CACHE_NUM 2
25#endif 27#endif
26 28
27/* 29/*
diff --git a/include/asm-powerpc/spu.h b/include/asm-powerpc/spu.h
index f431d8b0b651..7cfcff3ef027 100644
--- a/include/asm-powerpc/spu.h
+++ b/include/asm-powerpc/spu.h
@@ -117,6 +117,7 @@ struct spu {
117 struct list_head list; 117 struct list_head list;
118 struct list_head sched_list; 118 struct list_head sched_list;
119 int number; 119 int number;
120 int nid;
120 u32 isrc; 121 u32 isrc;
121 u32 node; 122 u32 node;
122 u64 flags; 123 u64 flags;
diff --git a/include/asm-powerpc/termbits.h b/include/asm-powerpc/termbits.h
index ebf6055481dc..6d533b07aaf5 100644
--- a/include/asm-powerpc/termbits.h
+++ b/include/asm-powerpc/termbits.h
@@ -153,6 +153,7 @@ struct termios {
153#define HUPCL 00040000 153#define HUPCL 00040000
154 154
155#define CLOCAL 00100000 155#define CLOCAL 00100000
156#define CMSPAR 010000000000 /* mark or space (stick) parity */
156#define CRTSCTS 020000000000 /* flow control */ 157#define CRTSCTS 020000000000 /* flow control */
157 158
158/* c_lflag bits */ 159/* c_lflag bits */
diff --git a/include/asm-powerpc/thread_info.h b/include/asm-powerpc/thread_info.h
index ffc7462d77ba..88b553c6b26c 100644
--- a/include/asm-powerpc/thread_info.h
+++ b/include/asm-powerpc/thread_info.h
@@ -37,6 +37,8 @@ struct thread_info {
37 int preempt_count; /* 0 => preemptable, 37 int preempt_count; /* 0 => preemptable,
38 <0 => BUG */ 38 <0 => BUG */
39 struct restart_block restart_block; 39 struct restart_block restart_block;
40 unsigned long local_flags; /* private flags for thread */
41
40 /* low level flags - has atomic operations done on it */ 42 /* low level flags - has atomic operations done on it */
41 unsigned long flags ____cacheline_aligned_in_smp; 43 unsigned long flags ____cacheline_aligned_in_smp;
42}; 44};
@@ -143,6 +145,12 @@ static inline struct thread_info *current_thread_info(void)
143 _TIF_NEED_RESCHED | _TIF_RESTORE_SIGMASK) 145 _TIF_NEED_RESCHED | _TIF_RESTORE_SIGMASK)
144#define _TIF_PERSYSCALL_MASK (_TIF_RESTOREALL|_TIF_NOERROR) 146#define _TIF_PERSYSCALL_MASK (_TIF_RESTOREALL|_TIF_NOERROR)
145 147
148/* Bits in local_flags */
149/* Don't move TLF_NAPPING without adjusting the code in entry_32.S */
150#define TLF_NAPPING 0 /* idle thread enabled NAP mode */
151
152#define _TLF_NAPPING (1 << TLF_NAPPING)
153
146#endif /* __KERNEL__ */ 154#endif /* __KERNEL__ */
147 155
148#endif /* _ASM_POWERPC_THREAD_INFO_H */ 156#endif /* _ASM_POWERPC_THREAD_INFO_H */
diff --git a/include/asm-powerpc/topology.h b/include/asm-powerpc/topology.h
index 1e19cd00af25..87362a05542b 100644
--- a/include/asm-powerpc/topology.h
+++ b/include/asm-powerpc/topology.h
@@ -4,6 +4,9 @@
4 4
5#include <linux/config.h> 5#include <linux/config.h>
6 6
7struct sys_device;
8struct device_node;
9
7#ifdef CONFIG_NUMA 10#ifdef CONFIG_NUMA
8 11
9#include <asm/mmzone.h> 12#include <asm/mmzone.h>
@@ -27,6 +30,8 @@ static inline int node_to_first_cpu(int node)
27 return first_cpu(tmp); 30 return first_cpu(tmp);
28} 31}
29 32
33int of_node_to_nid(struct device_node *device);
34
30#define pcibus_to_node(node) (-1) 35#define pcibus_to_node(node) (-1)
31#define pcibus_to_cpumask(bus) (cpu_online_map) 36#define pcibus_to_cpumask(bus) (cpu_online_map)
32 37
@@ -57,10 +62,29 @@ static inline int node_to_first_cpu(int node)
57 62
58extern void __init dump_numa_cpu_topology(void); 63extern void __init dump_numa_cpu_topology(void);
59 64
65extern int sysfs_add_device_to_node(struct sys_device *dev, int nid);
66extern void sysfs_remove_device_from_node(struct sys_device *dev, int nid);
67
60#else 68#else
61 69
70static inline int of_node_to_nid(struct device_node *device)
71{
72 return 0;
73}
74
62static inline void dump_numa_cpu_topology(void) {} 75static inline void dump_numa_cpu_topology(void) {}
63 76
77static inline int sysfs_add_device_to_node(struct sys_device *dev, int nid)
78{
79 return 0;
80}
81
82static inline void sysfs_remove_device_from_node(struct sys_device *dev,
83 int nid)
84{
85}
86
87
64#include <asm-generic/topology.h> 88#include <asm-generic/topology.h>
65 89
66#endif /* CONFIG_NUMA */ 90#endif /* CONFIG_NUMA */
diff --git a/include/asm-powerpc/uaccess.h b/include/asm-powerpc/uaccess.h
index 3872e924cdd6..d83fc29c2bbf 100644
--- a/include/asm-powerpc/uaccess.h
+++ b/include/asm-powerpc/uaccess.h
@@ -7,6 +7,7 @@
7#include <linux/sched.h> 7#include <linux/sched.h>
8#include <linux/errno.h> 8#include <linux/errno.h>
9#include <asm/processor.h> 9#include <asm/processor.h>
10#include <asm/page.h>
10 11
11#define VERIFY_READ 0 12#define VERIFY_READ 0
12#define VERIFY_WRITE 1 13#define VERIFY_WRITE 1
@@ -179,9 +180,11 @@ do { \
179#define __put_user_nocheck(x, ptr, size) \ 180#define __put_user_nocheck(x, ptr, size) \
180({ \ 181({ \
181 long __pu_err; \ 182 long __pu_err; \
182 might_sleep(); \ 183 __typeof__(*(ptr)) __user *__pu_addr = (ptr); \
184 if (!is_kernel_addr((unsigned long)__pu_addr)) \
185 might_sleep(); \
183 __chk_user_ptr(ptr); \ 186 __chk_user_ptr(ptr); \
184 __put_user_size((x), (ptr), (size), __pu_err); \ 187 __put_user_size((x), __pu_addr, (size), __pu_err); \
185 __pu_err; \ 188 __pu_err; \
186}) 189})
187 190
@@ -258,9 +261,11 @@ do { \
258({ \ 261({ \
259 long __gu_err; \ 262 long __gu_err; \
260 unsigned long __gu_val; \ 263 unsigned long __gu_val; \
264 const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \
261 __chk_user_ptr(ptr); \ 265 __chk_user_ptr(ptr); \
262 might_sleep(); \ 266 if (!is_kernel_addr((unsigned long)__gu_addr)) \
263 __get_user_size(__gu_val, (ptr), (size), __gu_err); \ 267 might_sleep(); \
268 __get_user_size(__gu_val, __gu_addr, (size), __gu_err); \
264 (x) = (__typeof__(*(ptr)))__gu_val; \ 269 (x) = (__typeof__(*(ptr)))__gu_val; \
265 __gu_err; \ 270 __gu_err; \
266}) 271})
@@ -270,9 +275,11 @@ do { \
270({ \ 275({ \
271 long __gu_err; \ 276 long __gu_err; \
272 long long __gu_val; \ 277 long long __gu_val; \
278 const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \
273 __chk_user_ptr(ptr); \ 279 __chk_user_ptr(ptr); \
274 might_sleep(); \ 280 if (!is_kernel_addr((unsigned long)__gu_addr)) \
275 __get_user_size(__gu_val, (ptr), (size), __gu_err); \ 281 might_sleep(); \
282 __get_user_size(__gu_val, __gu_addr, (size), __gu_err); \
276 (x) = (__typeof__(*(ptr)))__gu_val; \ 283 (x) = (__typeof__(*(ptr)))__gu_val; \
277 __gu_err; \ 284 __gu_err; \
278}) 285})
diff --git a/include/asm-powerpc/unistd.h b/include/asm-powerpc/unistd.h
index 536ba0873052..edde2462bf52 100644
--- a/include/asm-powerpc/unistd.h
+++ b/include/asm-powerpc/unistd.h
@@ -302,8 +302,29 @@
302#define __NR_ppoll 281 302#define __NR_ppoll 281
303#define __NR_unshare 282 303#define __NR_unshare 282
304#define __NR_splice 283 304#define __NR_splice 283
305#define __NR_tee 284
306#define __NR_vmsplice 285
307#define __NR_openat 286
308#define __NR_mkdirat 287
309#define __NR_mknodat 288
310#define __NR_fchownat 289
311#define __NR_futimesat 290
312#ifdef __powerpc64__
313#define __NR_newfstatat 291
314#else
315#define __NR_fstatat64 291
316#endif
317#define __NR_unlinkat 292
318#define __NR_renameat 293
319#define __NR_linkat 294
320#define __NR_symlinkat 295
321#define __NR_readlinkat 296
322#define __NR_fchmodat 297
323#define __NR_faccessat 298
324#define __NR_get_robust_list 299
325#define __NR_set_robust_list 300
305 326
306#define __NR_syscalls 284 327#define __NR_syscalls 301
307 328
308#ifdef __KERNEL__ 329#ifdef __KERNEL__
309#define __NR__exit __NR_exit 330#define __NR__exit __NR_exit
@@ -456,6 +477,7 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6
456#ifdef CONFIG_PPC64 477#ifdef CONFIG_PPC64
457#define __ARCH_WANT_COMPAT_SYS_TIME 478#define __ARCH_WANT_COMPAT_SYS_TIME
458#define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND 479#define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND
480#define __ARCH_WANT_SYS_NEWFSTATAT
459#endif 481#endif
460 482
461/* 483/*
diff --git a/include/asm-ppc/commproc.h b/include/asm-ppc/commproc.h
index 973e60908234..31f362966a58 100644
--- a/include/asm-ppc/commproc.h
+++ b/include/asm-ppc/commproc.h
@@ -35,6 +35,7 @@
35#define CPM_CR_INIT_TX ((ushort)0x0002) 35#define CPM_CR_INIT_TX ((ushort)0x0002)
36#define CPM_CR_HUNT_MODE ((ushort)0x0003) 36#define CPM_CR_HUNT_MODE ((ushort)0x0003)
37#define CPM_CR_STOP_TX ((ushort)0x0004) 37#define CPM_CR_STOP_TX ((ushort)0x0004)
38#define CPM_CR_GRA_STOP_TX ((ushort)0x0005)
38#define CPM_CR_RESTART_TX ((ushort)0x0006) 39#define CPM_CR_RESTART_TX ((ushort)0x0006)
39#define CPM_CR_CLOSE_RX_BD ((ushort)0x0007) 40#define CPM_CR_CLOSE_RX_BD ((ushort)0x0007)
40#define CPM_CR_SET_GADDR ((ushort)0x0008) 41#define CPM_CR_SET_GADDR ((ushort)0x0008)
diff --git a/include/asm-ppc/cpm2.h b/include/asm-ppc/cpm2.h
index b638b87cebe3..c70344b91049 100644
--- a/include/asm-ppc/cpm2.h
+++ b/include/asm-ppc/cpm2.h
@@ -69,7 +69,7 @@
69#define CPM_CR_INIT_TX ((ushort)0x0002) 69#define CPM_CR_INIT_TX ((ushort)0x0002)
70#define CPM_CR_HUNT_MODE ((ushort)0x0003) 70#define CPM_CR_HUNT_MODE ((ushort)0x0003)
71#define CPM_CR_STOP_TX ((ushort)0x0004) 71#define CPM_CR_STOP_TX ((ushort)0x0004)
72#define CPM_CR_GRA_STOP_TX ((ushort)0x0005) 72#define CPM_CR_GRA_STOP_TX ((ushort)0x0005)
73#define CPM_CR_RESTART_TX ((ushort)0x0006) 73#define CPM_CR_RESTART_TX ((ushort)0x0006)
74#define CPM_CR_SET_GADDR ((ushort)0x0008) 74#define CPM_CR_SET_GADDR ((ushort)0x0008)
75#define CPM_CR_START_IDMA ((ushort)0x0009) 75#define CPM_CR_START_IDMA ((ushort)0x0009)
diff --git a/include/asm-ppc/page.h b/include/asm-ppc/page.h
index a70ba2ee552d..0fb68a0b0181 100644
--- a/include/asm-ppc/page.h
+++ b/include/asm-ppc/page.h
@@ -20,6 +20,7 @@
20/* This must match what is in arch/ppc/Makefile */ 20/* This must match what is in arch/ppc/Makefile */
21#define PAGE_OFFSET CONFIG_KERNEL_START 21#define PAGE_OFFSET CONFIG_KERNEL_START
22#define KERNELBASE PAGE_OFFSET 22#define KERNELBASE PAGE_OFFSET
23#define is_kernel_addr(x) ((x) >= PAGE_OFFSET)
23 24
24#ifndef __ASSEMBLY__ 25#ifndef __ASSEMBLY__
25 26
diff --git a/include/asm-ppc/ppc_sys.h b/include/asm-ppc/ppc_sys.h
index 4b94f7059ebe..40f197af6508 100644
--- a/include/asm-ppc/ppc_sys.h
+++ b/include/asm-ppc/ppc_sys.h
@@ -39,6 +39,8 @@
39#error "need definition of ppc_sys_devices" 39#error "need definition of ppc_sys_devices"
40#endif 40#endif
41 41
42#define PPC_SYS_IORESOURCE_FIXUPPED 0x00000001
43
42struct ppc_sys_spec { 44struct ppc_sys_spec {
43 /* PPC sys is matched via (ID & mask) == value, id could be 45 /* PPC sys is matched via (ID & mask) == value, id could be
44 * PVR, SVR, IMMR, * etc. */ 46 * PVR, SVR, IMMR, * etc. */
diff --git a/include/asm-ppc/reg_booke.h b/include/asm-ppc/reg_booke.h
index 00ad9c754c78..4944c0fb8bea 100644
--- a/include/asm-ppc/reg_booke.h
+++ b/include/asm-ppc/reg_booke.h
@@ -237,6 +237,7 @@ do { \
237#endif 237#endif
238 238
239/* Bit definitions for CCR1. */ 239/* Bit definitions for CCR1. */
240#define CCR1_DPC 0x00000100 /* Disable L1 I-Cache/D-Cache parity checking */
240#define CCR1_TCS 0x00000080 /* Timer Clock Select */ 241#define CCR1_TCS 0x00000080 /* Timer Clock Select */
241 242
242/* Bit definitions for the MCSR. */ 243/* Bit definitions for the MCSR. */
diff --git a/include/asm-s390/cache.h b/include/asm-s390/cache.h
index e20cdd9074db..cdf431b061bb 100644
--- a/include/asm-s390/cache.h
+++ b/include/asm-s390/cache.h
@@ -16,4 +16,6 @@
16 16
17#define ARCH_KMALLOC_MINALIGN 8 17#define ARCH_KMALLOC_MINALIGN 8
18 18
19#define __read_mostly __attribute__((__section__(".data.read_mostly")))
20
19#endif 21#endif
diff --git a/include/asm-s390/futex.h b/include/asm-s390/futex.h
index 6a332a9f099c..1802775568b9 100644
--- a/include/asm-s390/futex.h
+++ b/include/asm-s390/futex.h
@@ -1,6 +1,122 @@
1#ifndef _ASM_FUTEX_H 1#ifndef _ASM_S390_FUTEX_H
2#define _ASM_FUTEX_H 2#define _ASM_S390_FUTEX_H
3 3
4#include <asm-generic/futex.h> 4#ifdef __KERNEL__
5 5
6#endif 6#include <linux/futex.h>
7#include <asm/errno.h>
8#include <asm/uaccess.h>
9
10#ifndef __s390x__
11#define __futex_atomic_fixup \
12 ".section __ex_table,\"a\"\n" \
13 " .align 4\n" \
14 " .long 0b,4b,2b,4b,3b,4b\n" \
15 ".previous"
16#else /* __s390x__ */
17#define __futex_atomic_fixup \
18 ".section __ex_table,\"a\"\n" \
19 " .align 8\n" \
20 " .quad 0b,4b,2b,4b,3b,4b\n" \
21 ".previous"
22#endif /* __s390x__ */
23
24#define __futex_atomic_op(insn, ret, oldval, newval, uaddr, oparg) \
25 asm volatile(" sacf 256\n" \
26 "0: l %1,0(%6)\n" \
27 "1: " insn \
28 "2: cs %1,%2,0(%6)\n" \
29 "3: jl 1b\n" \
30 " lhi %0,0\n" \
31 "4: sacf 0\n" \
32 __futex_atomic_fixup \
33 : "=d" (ret), "=&d" (oldval), "=&d" (newval), \
34 "=m" (*uaddr) \
35 : "0" (-EFAULT), "d" (oparg), "a" (uaddr), \
36 "m" (*uaddr) : "cc" );
37
38static inline int futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
39{
40 int op = (encoded_op >> 28) & 7;
41 int cmp = (encoded_op >> 24) & 15;
42 int oparg = (encoded_op << 8) >> 20;
43 int cmparg = (encoded_op << 20) >> 20;
44 int oldval = 0, newval, ret;
45 if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28))
46 oparg = 1 << oparg;
47
48 if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int)))
49 return -EFAULT;
50
51 inc_preempt_count();
52
53 switch (op) {
54 case FUTEX_OP_SET:
55 __futex_atomic_op("lr %2,%5\n",
56 ret, oldval, newval, uaddr, oparg);
57 break;
58 case FUTEX_OP_ADD:
59 __futex_atomic_op("lr %2,%1\nar %2,%5\n",
60 ret, oldval, newval, uaddr, oparg);
61 break;
62 case FUTEX_OP_OR:
63 __futex_atomic_op("lr %2,%1\nor %2,%5\n",
64 ret, oldval, newval, uaddr, oparg);
65 break;
66 case FUTEX_OP_ANDN:
67 __futex_atomic_op("lr %2,%1\nnr %2,%5\n",
68 ret, oldval, newval, uaddr, oparg);
69 break;
70 case FUTEX_OP_XOR:
71 __futex_atomic_op("lr %2,%1\nxr %2,%5\n",
72 ret, oldval, newval, uaddr, oparg);
73 break;
74 default:
75 ret = -ENOSYS;
76 }
77
78 dec_preempt_count();
79
80 if (!ret) {
81 switch (cmp) {
82 case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break;
83 case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break;
84 case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break;
85 case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break;
86 case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break;
87 case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break;
88 default: ret = -ENOSYS;
89 }
90 }
91 return ret;
92}
93
94static inline int
95futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
96{
97 int ret;
98
99 if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int)))
100 return -EFAULT;
101 asm volatile(" cs %1,%4,0(%5)\n"
102 "0: lr %0,%1\n"
103 "1:\n"
104#ifndef __s390x__
105 ".section __ex_table,\"a\"\n"
106 " .align 4\n"
107 " .long 0b,1b\n"
108 ".previous"
109#else /* __s390x__ */
110 ".section __ex_table,\"a\"\n"
111 " .align 8\n"
112 " .quad 0b,1b\n"
113 ".previous"
114#endif /* __s390x__ */
115 : "=d" (ret), "+d" (oldval), "=m" (*uaddr)
116 : "0" (-EFAULT), "d" (newval), "a" (uaddr), "m" (*uaddr)
117 : "cc", "memory" );
118 return oldval;
119}
120
121#endif /* __KERNEL__ */
122#endif /* _ASM_S390_FUTEX_H */
diff --git a/include/asm-s390/lowcore.h b/include/asm-s390/lowcore.h
index db0606c1abd4..bea727904287 100644
--- a/include/asm-s390/lowcore.h
+++ b/include/asm-s390/lowcore.h
@@ -98,8 +98,8 @@
98#define __LC_KERNEL_ASCE 0xD58 98#define __LC_KERNEL_ASCE 0xD58
99#define __LC_USER_ASCE 0xD60 99#define __LC_USER_ASCE 0xD60
100#define __LC_PANIC_STACK 0xD68 100#define __LC_PANIC_STACK 0xD68
101#define __LC_CPUID 0xD90 101#define __LC_CPUID 0xD80
102#define __LC_CPUADDR 0xD98 102#define __LC_CPUADDR 0xD88
103#define __LC_IPLDEV 0xDB8 103#define __LC_IPLDEV 0xDB8
104#define __LC_JIFFY_TIMER 0xDC0 104#define __LC_JIFFY_TIMER 0xDC0
105#define __LC_CURRENT 0xDD8 105#define __LC_CURRENT 0xDD8
diff --git a/include/asm-s390/unistd.h b/include/asm-s390/unistd.h
index 657d582e8149..41c2792ff6b0 100644
--- a/include/asm-s390/unistd.h
+++ b/include/asm-s390/unistd.h
@@ -296,8 +296,14 @@
296#define __NR_pselect6 301 296#define __NR_pselect6 301
297#define __NR_ppoll 302 297#define __NR_ppoll 302
298#define __NR_unshare 303 298#define __NR_unshare 303
299#define __NR_set_robust_list 304
300#define __NR_get_robust_list 305
301#define __NR_splice 306
302#define __NR_sync_file_range 307
303#define __NR_tee 308
304#define __NR_vmsplice 309
299 305
300#define NR_syscalls 304 306#define NR_syscalls 310
301 307
302/* 308/*
303 * There are some system calls that are not present on 64 bit, some 309 * There are some system calls that are not present on 64 bit, some
diff --git a/include/asm-sparc/unistd.h b/include/asm-sparc/unistd.h
index 264f0ebeaedc..45a576507785 100644
--- a/include/asm-sparc/unistd.h
+++ b/include/asm-sparc/unistd.h
@@ -41,7 +41,7 @@
41#define __NR_capset 22 /* Linux Specific */ 41#define __NR_capset 22 /* Linux Specific */
42#define __NR_setuid 23 /* Implemented via setreuid in SunOS */ 42#define __NR_setuid 23 /* Implemented via setreuid in SunOS */
43#define __NR_getuid 24 /* Common */ 43#define __NR_getuid 24 /* Common */
44/* #define __NR_time alias 25 ENOSYS under SunOS */ 44#define __NR_vmsplice 25 /* ENOSYS under SunOS */
45#define __NR_ptrace 26 /* Common */ 45#define __NR_ptrace 26 /* Common */
46#define __NR_alarm 27 /* Implemented via setitimer in SunOS */ 46#define __NR_alarm 27 /* Implemented via setitimer in SunOS */
47#define __NR_sigaltstack 28 /* Common */ 47#define __NR_sigaltstack 28 /* Common */
@@ -248,7 +248,7 @@
248#define __NR_setfsgid 229 /* Linux Specific */ 248#define __NR_setfsgid 229 /* Linux Specific */
249#define __NR__newselect 230 /* Linux Specific */ 249#define __NR__newselect 230 /* Linux Specific */
250#define __NR_time 231 /* Linux Specific */ 250#define __NR_time 231 /* Linux Specific */
251#define __NR_sys_splice 232 /* Linux Specific */ 251#define __NR_splice 232 /* Linux Specific */
252#define __NR_stime 233 /* Linux Specific */ 252#define __NR_stime 233 /* Linux Specific */
253#define __NR_statfs64 234 /* Linux Specific */ 253#define __NR_statfs64 234 /* Linux Specific */
254#define __NR_fstatfs64 235 /* Linux Specific */ 254#define __NR_fstatfs64 235 /* Linux Specific */
@@ -271,7 +271,7 @@
271#define __NR_getsid 252 271#define __NR_getsid 252
272#define __NR_fdatasync 253 272#define __NR_fdatasync 253
273#define __NR_nfsservctl 254 273#define __NR_nfsservctl 254
274#define __NR_sys_sync_file_range 255 274#define __NR_sync_file_range 255
275#define __NR_clock_settime 256 275#define __NR_clock_settime 256
276#define __NR_clock_gettime 257 276#define __NR_clock_gettime 257
277#define __NR_clock_getres 258 277#define __NR_clock_getres 258
@@ -296,7 +296,7 @@
296#define __NR_mq_notify 277 296#define __NR_mq_notify 277
297#define __NR_mq_getsetattr 278 297#define __NR_mq_getsetattr 278
298#define __NR_waitid 279 298#define __NR_waitid 279
299#define __NR_sys_setaltroot 280 299#define __NR_tee 280
300#define __NR_add_key 281 300#define __NR_add_key 281
301#define __NR_request_key 282 301#define __NR_request_key 282
302#define __NR_keyctl 283 302#define __NR_keyctl 283
@@ -316,11 +316,13 @@
316#define __NR_pselect6 297 316#define __NR_pselect6 297
317#define __NR_ppoll 298 317#define __NR_ppoll 298
318#define __NR_unshare 299 318#define __NR_unshare 299
319#define __NR_set_robust_list 300
320#define __NR_get_robust_list 301
319 321
320/* WARNING: You MAY NOT add syscall numbers larger than 299, since 322/* WARNING: You MAY NOT add syscall numbers larger than 301, since
321 * all of the syscall tables in the Sparc kernel are 323 * all of the syscall tables in the Sparc kernel are
322 * sized to have 299 entries (starting at zero). Therefore 324 * sized to have 301 entries (starting at zero). Therefore
323 * find a free slot in the 0-299 range. 325 * find a free slot in the 0-301 range.
324 */ 326 */
325 327
326#define _syscall0(type,name) \ 328#define _syscall0(type,name) \
diff --git a/include/asm-sparc64/dma-mapping.h b/include/asm-sparc64/dma-mapping.h
index c7d5804ba76d..a8d39f23d43b 100644
--- a/include/asm-sparc64/dma-mapping.h
+++ b/include/asm-sparc64/dma-mapping.h
@@ -4,7 +4,146 @@
4#include <linux/config.h> 4#include <linux/config.h>
5 5
6#ifdef CONFIG_PCI 6#ifdef CONFIG_PCI
7#include <asm-generic/dma-mapping.h> 7
8/* we implement the API below in terms of the existing PCI one,
9 * so include it */
10#include <linux/pci.h>
11/* need struct page definitions */
12#include <linux/mm.h>
13
14static inline int
15dma_supported(struct device *dev, u64 mask)
16{
17 BUG_ON(dev->bus != &pci_bus_type);
18
19 return pci_dma_supported(to_pci_dev(dev), mask);
20}
21
22static inline int
23dma_set_mask(struct device *dev, u64 dma_mask)
24{
25 BUG_ON(dev->bus != &pci_bus_type);
26
27 return pci_set_dma_mask(to_pci_dev(dev), dma_mask);
28}
29
30static inline void *
31dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
32 gfp_t flag)
33{
34 BUG_ON(dev->bus != &pci_bus_type);
35
36 return pci_iommu_ops->alloc_consistent(to_pci_dev(dev), size, dma_handle, flag);
37}
38
39static inline void
40dma_free_coherent(struct device *dev, size_t size, void *cpu_addr,
41 dma_addr_t dma_handle)
42{
43 BUG_ON(dev->bus != &pci_bus_type);
44
45 pci_free_consistent(to_pci_dev(dev), size, cpu_addr, dma_handle);
46}
47
48static inline dma_addr_t
49dma_map_single(struct device *dev, void *cpu_addr, size_t size,
50 enum dma_data_direction direction)
51{
52 BUG_ON(dev->bus != &pci_bus_type);
53
54 return pci_map_single(to_pci_dev(dev), cpu_addr, size, (int)direction);
55}
56
57static inline void
58dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
59 enum dma_data_direction direction)
60{
61 BUG_ON(dev->bus != &pci_bus_type);
62
63 pci_unmap_single(to_pci_dev(dev), dma_addr, size, (int)direction);
64}
65
66static inline dma_addr_t
67dma_map_page(struct device *dev, struct page *page,
68 unsigned long offset, size_t size,
69 enum dma_data_direction direction)
70{
71 BUG_ON(dev->bus != &pci_bus_type);
72
73 return pci_map_page(to_pci_dev(dev), page, offset, size, (int)direction);
74}
75
76static inline void
77dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size,
78 enum dma_data_direction direction)
79{
80 BUG_ON(dev->bus != &pci_bus_type);
81
82 pci_unmap_page(to_pci_dev(dev), dma_address, size, (int)direction);
83}
84
85static inline int
86dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
87 enum dma_data_direction direction)
88{
89 BUG_ON(dev->bus != &pci_bus_type);
90
91 return pci_map_sg(to_pci_dev(dev), sg, nents, (int)direction);
92}
93
94static inline void
95dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries,
96 enum dma_data_direction direction)
97{
98 BUG_ON(dev->bus != &pci_bus_type);
99
100 pci_unmap_sg(to_pci_dev(dev), sg, nhwentries, (int)direction);
101}
102
103static inline void
104dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size,
105 enum dma_data_direction direction)
106{
107 BUG_ON(dev->bus != &pci_bus_type);
108
109 pci_dma_sync_single_for_cpu(to_pci_dev(dev), dma_handle,
110 size, (int)direction);
111}
112
113static inline void
114dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t size,
115 enum dma_data_direction direction)
116{
117 BUG_ON(dev->bus != &pci_bus_type);
118
119 pci_dma_sync_single_for_device(to_pci_dev(dev), dma_handle,
120 size, (int)direction);
121}
122
123static inline void
124dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems,
125 enum dma_data_direction direction)
126{
127 BUG_ON(dev->bus != &pci_bus_type);
128
129 pci_dma_sync_sg_for_cpu(to_pci_dev(dev), sg, nelems, (int)direction);
130}
131
132static inline void
133dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nelems,
134 enum dma_data_direction direction)
135{
136 BUG_ON(dev->bus != &pci_bus_type);
137
138 pci_dma_sync_sg_for_device(to_pci_dev(dev), sg, nelems, (int)direction);
139}
140
141static inline int
142dma_mapping_error(dma_addr_t dma_addr)
143{
144 return pci_dma_mapping_error(dma_addr);
145}
146
8#else 147#else
9 148
10struct device; 149struct device;
diff --git a/include/asm-sparc64/pci.h b/include/asm-sparc64/pci.h
index 7c5a589ea437..e1ea67bc32f2 100644
--- a/include/asm-sparc64/pci.h
+++ b/include/asm-sparc64/pci.h
@@ -42,7 +42,7 @@ static inline void pcibios_penalize_isa_irq(int irq, int active)
42struct pci_dev; 42struct pci_dev;
43 43
44struct pci_iommu_ops { 44struct pci_iommu_ops {
45 void *(*alloc_consistent)(struct pci_dev *, size_t, dma_addr_t *); 45 void *(*alloc_consistent)(struct pci_dev *, size_t, dma_addr_t *, gfp_t);
46 void (*free_consistent)(struct pci_dev *, size_t, void *, dma_addr_t); 46 void (*free_consistent)(struct pci_dev *, size_t, void *, dma_addr_t);
47 dma_addr_t (*map_single)(struct pci_dev *, void *, size_t, int); 47 dma_addr_t (*map_single)(struct pci_dev *, void *, size_t, int);
48 void (*unmap_single)(struct pci_dev *, dma_addr_t, size_t, int); 48 void (*unmap_single)(struct pci_dev *, dma_addr_t, size_t, int);
@@ -59,7 +59,7 @@ extern struct pci_iommu_ops *pci_iommu_ops;
59 */ 59 */
60static inline void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size, dma_addr_t *dma_handle) 60static inline void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size, dma_addr_t *dma_handle)
61{ 61{
62 return pci_iommu_ops->alloc_consistent(hwdev, size, dma_handle); 62 return pci_iommu_ops->alloc_consistent(hwdev, size, dma_handle, GFP_ATOMIC);
63} 63}
64 64
65/* Free and unmap a consistent DMA buffer. 65/* Free and unmap a consistent DMA buffer.
diff --git a/include/asm-sparc64/pgtable.h b/include/asm-sparc64/pgtable.h
index c44e7466534e..cd464f469a2c 100644
--- a/include/asm-sparc64/pgtable.h
+++ b/include/asm-sparc64/pgtable.h
@@ -689,6 +689,23 @@ static inline void set_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *p
689#define pte_clear(mm,addr,ptep) \ 689#define pte_clear(mm,addr,ptep) \
690 set_pte_at((mm), (addr), (ptep), __pte(0UL)) 690 set_pte_at((mm), (addr), (ptep), __pte(0UL))
691 691
692#ifdef DCACHE_ALIASING_POSSIBLE
693#define __HAVE_ARCH_MOVE_PTE
694#define move_pte(pte, prot, old_addr, new_addr) \
695({ \
696 pte_t newpte = (pte); \
697 if (tlb_type != hypervisor && pte_present(pte)) { \
698 unsigned long this_pfn = pte_pfn(pte); \
699 \
700 if (pfn_valid(this_pfn) && \
701 (((old_addr) ^ (new_addr)) & (1 << 13))) \
702 flush_dcache_page_all(current->mm, \
703 pfn_to_page(this_pfn)); \
704 } \
705 newpte; \
706})
707#endif
708
692extern pgd_t swapper_pg_dir[2048]; 709extern pgd_t swapper_pg_dir[2048];
693extern pmd_t swapper_low_pmd_dir[2048]; 710extern pmd_t swapper_low_pmd_dir[2048];
694 711
diff --git a/include/asm-sparc64/tlbflush.h b/include/asm-sparc64/tlbflush.h
index 9ad5d9c51d42..e3a7c453b500 100644
--- a/include/asm-sparc64/tlbflush.h
+++ b/include/asm-sparc64/tlbflush.h
@@ -22,8 +22,6 @@ extern void flush_tlb_pending(void);
22/* Local cpu only. */ 22/* Local cpu only. */
23extern void __flush_tlb_all(void); 23extern void __flush_tlb_all(void);
24 24
25extern void __flush_tlb_page(unsigned long context, unsigned long page, unsigned long r);
26
27extern void __flush_tlb_kernel_range(unsigned long start, unsigned long end); 25extern void __flush_tlb_kernel_range(unsigned long start, unsigned long end);
28 26
29#ifndef CONFIG_SMP 27#ifndef CONFIG_SMP
diff --git a/include/asm-sparc64/unistd.h b/include/asm-sparc64/unistd.h
index d0544b4f47b7..998ef4ab0e06 100644
--- a/include/asm-sparc64/unistd.h
+++ b/include/asm-sparc64/unistd.h
@@ -41,7 +41,7 @@
41#define __NR_capset 22 /* Linux Specific */ 41#define __NR_capset 22 /* Linux Specific */
42#define __NR_setuid 23 /* Implemented via setreuid in SunOS */ 42#define __NR_setuid 23 /* Implemented via setreuid in SunOS */
43#define __NR_getuid 24 /* Common */ 43#define __NR_getuid 24 /* Common */
44/* #define __NR_time alias 25 ENOSYS under SunOS */ 44#define __NR_vmsplice 25 /* ENOSYS under SunOS */
45#define __NR_ptrace 26 /* Common */ 45#define __NR_ptrace 26 /* Common */
46#define __NR_alarm 27 /* Implemented via setitimer in SunOS */ 46#define __NR_alarm 27 /* Implemented via setitimer in SunOS */
47#define __NR_sigaltstack 28 /* Common */ 47#define __NR_sigaltstack 28 /* Common */
@@ -250,7 +250,7 @@
250#ifdef __KERNEL__ 250#ifdef __KERNEL__
251#define __NR_time 231 /* Linux sparc32 */ 251#define __NR_time 231 /* Linux sparc32 */
252#endif 252#endif
253#define __NR_sys_splice 232 /* Linux Specific */ 253#define __NR_splice 232 /* Linux Specific */
254#define __NR_stime 233 /* Linux Specific */ 254#define __NR_stime 233 /* Linux Specific */
255#define __NR_statfs64 234 /* Linux Specific */ 255#define __NR_statfs64 234 /* Linux Specific */
256#define __NR_fstatfs64 235 /* Linux Specific */ 256#define __NR_fstatfs64 235 /* Linux Specific */
@@ -273,7 +273,7 @@
273#define __NR_getsid 252 273#define __NR_getsid 252
274#define __NR_fdatasync 253 274#define __NR_fdatasync 253
275#define __NR_nfsservctl 254 275#define __NR_nfsservctl 254
276#define __NR_sys_sync_file_range 255 276#define __NR_sync_file_range 255
277#define __NR_clock_settime 256 277#define __NR_clock_settime 256
278#define __NR_clock_gettime 257 278#define __NR_clock_gettime 257
279#define __NR_clock_getres 258 279#define __NR_clock_getres 258
@@ -298,7 +298,7 @@
298#define __NR_mq_notify 277 298#define __NR_mq_notify 277
299#define __NR_mq_getsetattr 278 299#define __NR_mq_getsetattr 278
300#define __NR_waitid 279 300#define __NR_waitid 279
301/*#define __NR_sys_setaltroot 280 available (was setaltroot) */ 301#define __NR_tee 280
302#define __NR_add_key 281 302#define __NR_add_key 281
303#define __NR_request_key 282 303#define __NR_request_key 282
304#define __NR_keyctl 283 304#define __NR_keyctl 283
@@ -318,11 +318,13 @@
318#define __NR_pselect6 297 318#define __NR_pselect6 297
319#define __NR_ppoll 298 319#define __NR_ppoll 298
320#define __NR_unshare 299 320#define __NR_unshare 299
321#define __NR_set_robust_list 300
322#define __NR_get_robust_list 301
321 323
322/* WARNING: You MAY NOT add syscall numbers larger than 299, since 324/* WARNING: You MAY NOT add syscall numbers larger than 301, since
323 * all of the syscall tables in the Sparc kernel are 325 * all of the syscall tables in the Sparc kernel are
324 * sized to have 299 entries (starting at zero). Therefore 326 * sized to have 301 entries (starting at zero). Therefore
325 * find a free slot in the 0-299 range. 327 * find a free slot in the 0-301 range.
326 */ 328 */
327 329
328#define _syscall0(type,name) \ 330#define _syscall0(type,name) \
diff --git a/include/asm-um/irqflags.h b/include/asm-um/irqflags.h
new file mode 100644
index 000000000000..659b9abdfdba
--- /dev/null
+++ b/include/asm-um/irqflags.h
@@ -0,0 +1,6 @@
1#ifndef __UM_IRQFLAGS_H
2#define __UM_IRQFLAGS_H
3
4/* Empty for now */
5
6#endif
diff --git a/include/asm-um/uaccess.h b/include/asm-um/uaccess.h
index bea5a015f667..16c734af9193 100644
--- a/include/asm-um/uaccess.h
+++ b/include/asm-um/uaccess.h
@@ -41,11 +41,11 @@
41 41
42#define __get_user(x, ptr) \ 42#define __get_user(x, ptr) \
43({ \ 43({ \
44 const __typeof__(ptr) __private_ptr = ptr; \ 44 const __typeof__(*(ptr)) __user *__private_ptr = (ptr); \
45 __typeof__(x) __private_val; \ 45 __typeof__(x) __private_val; \
46 int __private_ret = -EFAULT; \ 46 int __private_ret = -EFAULT; \
47 (x) = (__typeof__(*(__private_ptr)))0; \ 47 (x) = (__typeof__(*(__private_ptr)))0; \
48 if (__copy_from_user((void *) &__private_val, (__private_ptr), \ 48 if (__copy_from_user((__force void *)&__private_val, (__private_ptr),\
49 sizeof(*(__private_ptr))) == 0) { \ 49 sizeof(*(__private_ptr))) == 0) { \
50 (x) = (__typeof__(*(__private_ptr))) __private_val; \ 50 (x) = (__typeof__(*(__private_ptr))) __private_val; \
51 __private_ret = 0; \ 51 __private_ret = 0; \
@@ -62,7 +62,7 @@
62 62
63#define __put_user(x, ptr) \ 63#define __put_user(x, ptr) \
64({ \ 64({ \
65 __typeof__(ptr) __private_ptr = ptr; \ 65 __typeof__(*(ptr)) __user *__private_ptr = ptr; \
66 __typeof__(*(__private_ptr)) __private_val; \ 66 __typeof__(*(__private_ptr)) __private_val; \
67 int __private_ret = -EFAULT; \ 67 int __private_ret = -EFAULT; \
68 __private_val = (__typeof__(*(__private_ptr))) (x); \ 68 __private_val = (__typeof__(*(__private_ptr))) (x); \
diff --git a/include/asm-x86_64/cache.h b/include/asm-x86_64/cache.h
index c8043a16152e..f8dff1c67538 100644
--- a/include/asm-x86_64/cache.h
+++ b/include/asm-x86_64/cache.h
@@ -20,8 +20,8 @@
20 __attribute__((__section__(".data.page_aligned"))) 20 __attribute__((__section__(".data.page_aligned")))
21#endif 21#endif
22 22
23#define __read_mostly __attribute__((__section__(".data.read_mostly")))
24
25#endif 23#endif
26 24
25#define __read_mostly __attribute__((__section__(".data.read_mostly")))
26
27#endif 27#endif
diff --git a/include/asm-x86_64/cpufeature.h b/include/asm-x86_64/cpufeature.h
index 76bb6193ae91..662964b74e34 100644
--- a/include/asm-x86_64/cpufeature.h
+++ b/include/asm-x86_64/cpufeature.h
@@ -64,6 +64,7 @@
64#define X86_FEATURE_REP_GOOD (3*32+ 4) /* rep microcode works well on this CPU */ 64#define X86_FEATURE_REP_GOOD (3*32+ 4) /* rep microcode works well on this CPU */
65#define X86_FEATURE_CONSTANT_TSC (3*32+5) /* TSC runs at constant rate */ 65#define X86_FEATURE_CONSTANT_TSC (3*32+5) /* TSC runs at constant rate */
66#define X86_FEATURE_SYNC_RDTSC (3*32+6) /* RDTSC syncs CPU core */ 66#define X86_FEATURE_SYNC_RDTSC (3*32+6) /* RDTSC syncs CPU core */
67#define X86_FEATURE_FXSAVE_LEAK (3*32+7) /* FIP/FOP/FDP leaks through FXSAVE */
67 68
68/* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */ 69/* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */
69#define X86_FEATURE_XMM3 (4*32+ 0) /* Streaming SIMD Extensions-3 */ 70#define X86_FEATURE_XMM3 (4*32+ 0) /* Streaming SIMD Extensions-3 */
diff --git a/include/asm-x86_64/e820.h b/include/asm-x86_64/e820.h
index 93b51df51687..670a3388e70a 100644
--- a/include/asm-x86_64/e820.h
+++ b/include/asm-x86_64/e820.h
@@ -59,6 +59,8 @@ extern void __init parse_memopt(char *p, char **end);
59extern void __init parse_memmapopt(char *p, char **end); 59extern void __init parse_memmapopt(char *p, char **end);
60 60
61extern struct e820map e820; 61extern struct e820map e820;
62
63extern unsigned ebda_addr, ebda_size;
62#endif/*!__ASSEMBLY__*/ 64#endif/*!__ASSEMBLY__*/
63 65
64#endif/*__E820_HEADER*/ 66#endif/*__E820_HEADER*/
diff --git a/include/asm-x86_64/elf.h b/include/asm-x86_64/elf.h
index c98633af07d2..b4f8f4a41a6e 100644
--- a/include/asm-x86_64/elf.h
+++ b/include/asm-x86_64/elf.h
@@ -159,7 +159,7 @@ extern int dump_task_fpu (struct task_struct *, elf_fpregset_t *);
159#define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk, elf_fpregs) 159#define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk, elf_fpregs)
160 160
161/* 1GB for 64bit, 8MB for 32bit */ 161/* 1GB for 64bit, 8MB for 32bit */
162#define STACK_RND_MASK (is_compat_task() ? 0x7ff : 0x3fffff) 162#define STACK_RND_MASK (test_thread_flag(TIF_IA32) ? 0x7ff : 0x3fffff)
163 163
164#endif 164#endif
165 165
diff --git a/include/asm-x86_64/i387.h b/include/asm-x86_64/i387.h
index 876eb9a2fe78..cba8a3b0cded 100644
--- a/include/asm-x86_64/i387.h
+++ b/include/asm-x86_64/i387.h
@@ -72,6 +72,23 @@ extern int set_fpregs(struct task_struct *tsk,
72#define set_fpu_swd(t,val) ((t)->thread.i387.fxsave.swd = (val)) 72#define set_fpu_swd(t,val) ((t)->thread.i387.fxsave.swd = (val))
73#define set_fpu_fxsr_twd(t,val) ((t)->thread.i387.fxsave.twd = (val)) 73#define set_fpu_fxsr_twd(t,val) ((t)->thread.i387.fxsave.twd = (val))
74 74
75#define X87_FSW_ES (1 << 7) /* Exception Summary */
76
77/* AMD CPUs don't save/restore FDP/FIP/FOP unless an exception
78 is pending. Clear the x87 state here by setting it to fixed
79 values. The kernel data segment can be sometimes 0 and sometimes
80 new user value. Both should be ok.
81 Use the PDA as safe address because it should be already in L1. */
82static inline void clear_fpu_state(struct i387_fxsave_struct *fx)
83{
84 if (unlikely(fx->swd & X87_FSW_ES))
85 asm volatile("fnclex");
86 alternative_input(ASM_NOP8 ASM_NOP2,
87 " emms\n" /* clear stack tags */
88 " fildl %%gs:0", /* load to clear state */
89 X86_FEATURE_FXSAVE_LEAK);
90}
91
75static inline int restore_fpu_checking(struct i387_fxsave_struct *fx) 92static inline int restore_fpu_checking(struct i387_fxsave_struct *fx)
76{ 93{
77 int err; 94 int err;
@@ -119,6 +136,7 @@ static inline int save_i387_checking(struct i387_fxsave_struct __user *fx)
119#endif 136#endif
120 if (unlikely(err)) 137 if (unlikely(err))
121 __clear_user(fx, sizeof(struct i387_fxsave_struct)); 138 __clear_user(fx, sizeof(struct i387_fxsave_struct));
139 /* No need to clear here because the caller clears USED_MATH */
122 return err; 140 return err;
123} 141}
124 142
@@ -149,7 +167,7 @@ static inline void __fxsave_clear(struct task_struct *tsk)
149 "i" (offsetof(__typeof__(*tsk), 167 "i" (offsetof(__typeof__(*tsk),
150 thread.i387.fxsave))); 168 thread.i387.fxsave)));
151#endif 169#endif
152 __asm__ __volatile__("fnclex"); 170 clear_fpu_state(&tsk->thread.i387.fxsave);
153} 171}
154 172
155static inline void kernel_fpu_begin(void) 173static inline void kernel_fpu_begin(void)
diff --git a/include/asm-x86_64/io_apic.h b/include/asm-x86_64/io_apic.h
index ee1bc69aec9c..52484e82c641 100644
--- a/include/asm-x86_64/io_apic.h
+++ b/include/asm-x86_64/io_apic.h
@@ -205,6 +205,7 @@ extern int skip_ioapic_setup;
205extern int io_apic_get_version (int ioapic); 205extern int io_apic_get_version (int ioapic);
206extern int io_apic_get_redir_entries (int ioapic); 206extern int io_apic_get_redir_entries (int ioapic);
207extern int io_apic_set_pci_routing (int ioapic, int pin, int irq, int, int); 207extern int io_apic_set_pci_routing (int ioapic, int pin, int irq, int, int);
208extern int timer_uses_ioapic_pin_0;
208#endif 209#endif
209 210
210extern int sis_apic_bug; /* dummy */ 211extern int sis_apic_bug; /* dummy */
diff --git a/include/asm-x86_64/mmzone.h b/include/asm-x86_64/mmzone.h
index 6b18cd8f293d..6944e7122df5 100644
--- a/include/asm-x86_64/mmzone.h
+++ b/include/asm-x86_64/mmzone.h
@@ -12,7 +12,8 @@
12 12
13#include <asm/smp.h> 13#include <asm/smp.h>
14 14
15#define NODEMAPSIZE 0xfff 15/* Should really switch to dynamic allocation at some point */
16#define NODEMAPSIZE 0x4fff
16 17
17/* Simple perfect hash to map physical addresses to node numbers */ 18/* Simple perfect hash to map physical addresses to node numbers */
18struct memnode { 19struct memnode {
diff --git a/include/asm-x86_64/percpu.h b/include/asm-x86_64/percpu.h
index 4405b4adeaba..7f33aaf9f7b1 100644
--- a/include/asm-x86_64/percpu.h
+++ b/include/asm-x86_64/percpu.h
@@ -26,7 +26,7 @@
26#define percpu_modcopy(pcpudst, src, size) \ 26#define percpu_modcopy(pcpudst, src, size) \
27do { \ 27do { \
28 unsigned int __i; \ 28 unsigned int __i; \
29 for_each_cpu(__i) \ 29 for_each_possible_cpu(__i) \
30 memcpy((pcpudst)+__per_cpu_offset(__i), \ 30 memcpy((pcpudst)+__per_cpu_offset(__i), \
31 (src), (size)); \ 31 (src), (size)); \
32} while (0) 32} while (0)
diff --git a/include/asm-x86_64/unistd.h b/include/asm-x86_64/unistd.h
index f21ff2c1e960..feb77cb8c044 100644
--- a/include/asm-x86_64/unistd.h
+++ b/include/asm-x86_64/unistd.h
@@ -611,8 +611,14 @@ __SYSCALL(__NR_set_robust_list, sys_set_robust_list)
611__SYSCALL(__NR_get_robust_list, sys_get_robust_list) 611__SYSCALL(__NR_get_robust_list, sys_get_robust_list)
612#define __NR_splice 275 612#define __NR_splice 275
613__SYSCALL(__NR_splice, sys_splice) 613__SYSCALL(__NR_splice, sys_splice)
614 614#define __NR_tee 276
615#define __NR_syscall_max __NR_splice 615__SYSCALL(__NR_tee, sys_tee)
616#define __NR_sync_file_range 277
617__SYSCALL(__NR_sync_file_range, sys_sync_file_range)
618#define __NR_vmsplice 278
619__SYSCALL(__NR_vmsplice, sys_vmsplice)
620
621#define __NR_syscall_max __NR_vmsplice
616 622
617#ifndef __NO_STUBS 623#ifndef __NO_STUBS
618 624
diff --git a/include/asm-xtensa/ioctls.h b/include/asm-xtensa/ioctls.h
index 10c443435c11..3b89a772d0a0 100644
--- a/include/asm-xtensa/ioctls.h
+++ b/include/asm-xtensa/ioctls.h
@@ -107,6 +107,6 @@
107#define TIOCSERSETMULTI _IOW('T', 91, struct serial_multiport_struct) /* Set multiport config */ 107#define TIOCSERSETMULTI _IOW('T', 91, struct serial_multiport_struct) /* Set multiport config */
108 108
109#define TIOCMIWAIT _IO('T', 92) /* wait for a change on serial input line(s) */ 109#define TIOCMIWAIT _IO('T', 92) /* wait for a change on serial input line(s) */
110#define TIOCGICOUNT _IOR('T', 93, struct async_icount) /* read serial port inline interrupt counts */ 110#define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */
111 111
112#endif /* _XTENSA_IOCTLS_H */ 112#endif /* _XTENSA_IOCTLS_H */
diff --git a/include/asm-xtensa/signal.h b/include/asm-xtensa/signal.h
index 5d6fc9cdf58d..a99c9aec64ec 100644
--- a/include/asm-xtensa/signal.h
+++ b/include/asm-xtensa/signal.h
@@ -118,9 +118,9 @@ typedef struct {
118 * SA_INTERRUPT is also used by the irq handling routines. 118 * SA_INTERRUPT is also used by the irq handling routines.
119 * SA_SHIRQ is for shared interrupt support on PCI and EISA. 119 * SA_SHIRQ is for shared interrupt support on PCI and EISA.
120 */ 120 */
121#define SA_PROBE SA_ONESHOT
122#define SA_SAMPLE_RANDOM SA_RESTART 121#define SA_SAMPLE_RANDOM SA_RESTART
123#define SA_SHIRQ 0x04000000 122#define SA_SHIRQ 0x04000000
123#define SA_PROBEIRQ 0x08000000
124#endif 124#endif
125 125
126#define SIG_BLOCK 0 /* for blocking signals */ 126#define SIG_BLOCK 0 /* for blocking signals */
diff --git a/include/linux/audit.h b/include/linux/audit.h
index 1c47c59058c1..b74c148f14e3 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -83,6 +83,7 @@
83#define AUDIT_CONFIG_CHANGE 1305 /* Audit system configuration change */ 83#define AUDIT_CONFIG_CHANGE 1305 /* Audit system configuration change */
84#define AUDIT_SOCKADDR 1306 /* sockaddr copied as syscall arg */ 84#define AUDIT_SOCKADDR 1306 /* sockaddr copied as syscall arg */
85#define AUDIT_CWD 1307 /* Current working directory */ 85#define AUDIT_CWD 1307 /* Current working directory */
86#define AUDIT_IPC_SET_PERM 1311 /* IPC new permissions record type */
86 87
87#define AUDIT_AVC 1400 /* SE Linux avc denial or grant */ 88#define AUDIT_AVC 1400 /* SE Linux avc denial or grant */
88#define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */ 89#define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */
@@ -145,6 +146,11 @@
145#define AUDIT_PERS 10 146#define AUDIT_PERS 10
146#define AUDIT_ARCH 11 147#define AUDIT_ARCH 11
147#define AUDIT_MSGTYPE 12 148#define AUDIT_MSGTYPE 12
149#define AUDIT_SE_USER 13 /* security label user */
150#define AUDIT_SE_ROLE 14 /* security label role */
151#define AUDIT_SE_TYPE 15 /* security label type */
152#define AUDIT_SE_SEN 16 /* security label sensitivity label */
153#define AUDIT_SE_CLR 17 /* security label clearance label */
148 154
149 /* These are ONLY useful when checking 155 /* These are ONLY useful when checking
150 * at syscall exit time (AUDIT_AT_EXIT). */ 156 * at syscall exit time (AUDIT_AT_EXIT). */
@@ -287,10 +293,10 @@ struct netlink_skb_parms;
287 /* Public API */ 293 /* Public API */
288extern int audit_alloc(struct task_struct *task); 294extern int audit_alloc(struct task_struct *task);
289extern void audit_free(struct task_struct *task); 295extern void audit_free(struct task_struct *task);
290extern void audit_syscall_entry(struct task_struct *task, int arch, 296extern void audit_syscall_entry(int arch,
291 int major, unsigned long a0, unsigned long a1, 297 int major, unsigned long a0, unsigned long a1,
292 unsigned long a2, unsigned long a3); 298 unsigned long a2, unsigned long a3);
293extern void audit_syscall_exit(struct task_struct *task, int failed, long return_code); 299extern void audit_syscall_exit(int failed, long return_code);
294extern void audit_getname(const char *name); 300extern void audit_getname(const char *name);
295extern void audit_putname(const char *name); 301extern void audit_putname(const char *name);
296extern void __audit_inode(const char *name, const struct inode *inode, unsigned flags); 302extern void __audit_inode(const char *name, const struct inode *inode, unsigned flags);
@@ -314,7 +320,8 @@ extern void auditsc_get_stamp(struct audit_context *ctx,
314 struct timespec *t, unsigned int *serial); 320 struct timespec *t, unsigned int *serial);
315extern int audit_set_loginuid(struct task_struct *task, uid_t loginuid); 321extern int audit_set_loginuid(struct task_struct *task, uid_t loginuid);
316extern uid_t audit_get_loginuid(struct audit_context *ctx); 322extern uid_t audit_get_loginuid(struct audit_context *ctx);
317extern int audit_ipc_perms(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode, struct kern_ipc_perm *ipcp); 323extern int audit_ipc_obj(struct kern_ipc_perm *ipcp);
324extern int audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode, struct kern_ipc_perm *ipcp);
318extern int audit_socketcall(int nargs, unsigned long *args); 325extern int audit_socketcall(int nargs, unsigned long *args);
319extern int audit_sockaddr(int len, void *addr); 326extern int audit_sockaddr(int len, void *addr);
320extern int audit_avc_path(struct dentry *dentry, struct vfsmount *mnt); 327extern int audit_avc_path(struct dentry *dentry, struct vfsmount *mnt);
@@ -323,8 +330,8 @@ extern int audit_set_macxattr(const char *name);
323#else 330#else
324#define audit_alloc(t) ({ 0; }) 331#define audit_alloc(t) ({ 0; })
325#define audit_free(t) do { ; } while (0) 332#define audit_free(t) do { ; } while (0)
326#define audit_syscall_entry(t,ta,a,b,c,d,e) do { ; } while (0) 333#define audit_syscall_entry(ta,a,b,c,d,e) do { ; } while (0)
327#define audit_syscall_exit(t,f,r) do { ; } while (0) 334#define audit_syscall_exit(f,r) do { ; } while (0)
328#define audit_getname(n) do { ; } while (0) 335#define audit_getname(n) do { ; } while (0)
329#define audit_putname(n) do { ; } while (0) 336#define audit_putname(n) do { ; } while (0)
330#define __audit_inode(n,i,f) do { ; } while (0) 337#define __audit_inode(n,i,f) do { ; } while (0)
@@ -333,7 +340,8 @@ extern int audit_set_macxattr(const char *name);
333#define audit_inode_child(d,i,p) do { ; } while (0) 340#define audit_inode_child(d,i,p) do { ; } while (0)
334#define auditsc_get_stamp(c,t,s) do { BUG(); } while (0) 341#define auditsc_get_stamp(c,t,s) do { BUG(); } while (0)
335#define audit_get_loginuid(c) ({ -1; }) 342#define audit_get_loginuid(c) ({ -1; })
336#define audit_ipc_perms(q,u,g,m,i) ({ 0; }) 343#define audit_ipc_obj(i) ({ 0; })
344#define audit_ipc_set_perm(q,u,g,m,i) ({ 0; })
337#define audit_socketcall(n,a) ({ 0; }) 345#define audit_socketcall(n,a) ({ 0; })
338#define audit_sockaddr(len, addr) ({ 0; }) 346#define audit_sockaddr(len, addr) ({ 0; })
339#define audit_avc_path(dentry, mnt) ({ 0; }) 347#define audit_avc_path(dentry, mnt) ({ 0; })
@@ -366,7 +374,7 @@ extern void audit_log_d_path(struct audit_buffer *ab,
366extern int audit_filter_user(struct netlink_skb_parms *cb, int type); 374extern int audit_filter_user(struct netlink_skb_parms *cb, int type);
367extern int audit_filter_type(int type); 375extern int audit_filter_type(int type);
368extern int audit_receive_filter(int type, int pid, int uid, int seq, 376extern int audit_receive_filter(int type, int pid, int uid, int seq,
369 void *data, size_t datasz, uid_t loginuid); 377 void *data, size_t datasz, uid_t loginuid, u32 sid);
370#else 378#else
371#define audit_log(c,g,t,f,...) do { ; } while (0) 379#define audit_log(c,g,t,f,...) do { ; } while (0)
372#define audit_log_start(c,g,t) ({ NULL; }) 380#define audit_log_start(c,g,t) ({ NULL; })
diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h
index 176e2d371577..047567d34ca7 100644
--- a/include/linux/debugfs.h
+++ b/include/linux/debugfs.h
@@ -58,9 +58,8 @@ struct dentry *debugfs_create_blob(const char *name, mode_t mode,
58 */ 58 */
59 59
60static inline struct dentry *debugfs_create_file(const char *name, mode_t mode, 60static inline struct dentry *debugfs_create_file(const char *name, mode_t mode,
61 struct dentry *parent, 61 struct dentry *parent, void *data,
62 void *data, 62 const struct file_operations *fops)
63 struct file_operations *fops)
64{ 63{
65 return ERR_PTR(-ENODEV); 64 return ERR_PTR(-ENODEV);
66} 65}
diff --git a/include/linux/device.h b/include/linux/device.h
index f6e72a65a3f2..e8e53b9accc6 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -200,6 +200,7 @@ extern int class_device_create_file(struct class_device *,
200 * @node: for internal use by the driver core only. 200 * @node: for internal use by the driver core only.
201 * @kobj: for internal use by the driver core only. 201 * @kobj: for internal use by the driver core only.
202 * @devt_attr: for internal use by the driver core only. 202 * @devt_attr: for internal use by the driver core only.
203 * @groups: optional additional groups to be created
203 * @dev: if set, a symlink to the struct device is created in the sysfs 204 * @dev: if set, a symlink to the struct device is created in the sysfs
204 * directory for this struct class device. 205 * directory for this struct class device.
205 * @class_data: pointer to whatever you want to store here for this struct 206 * @class_data: pointer to whatever you want to store here for this struct
@@ -228,6 +229,7 @@ struct class_device {
228 struct device * dev; /* not necessary, but nice to have */ 229 struct device * dev; /* not necessary, but nice to have */
229 void * class_data; /* class-specific data */ 230 void * class_data; /* class-specific data */
230 struct class_device *parent; /* parent of this child device, if there is one */ 231 struct class_device *parent; /* parent of this child device, if there is one */
232 struct attribute_group ** groups; /* optional groups */
231 233
232 void (*release)(struct class_device *dev); 234 void (*release)(struct class_device *dev);
233 int (*uevent)(struct class_device *dev, char **envp, 235 int (*uevent)(struct class_device *dev, char **envp,
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index ff61817082fa..635690cf3e3d 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -14,6 +14,7 @@ enum dma_data_direction {
14}; 14};
15 15
16#define DMA_64BIT_MASK 0xffffffffffffffffULL 16#define DMA_64BIT_MASK 0xffffffffffffffffULL
17#define DMA_48BIT_MASK 0x0000ffffffffffffULL
17#define DMA_40BIT_MASK 0x000000ffffffffffULL 18#define DMA_40BIT_MASK 0x000000ffffffffffULL
18#define DMA_39BIT_MASK 0x0000007fffffffffULL 19#define DMA_39BIT_MASK 0x0000007fffffffffULL
19#define DMA_32BIT_MASK 0x00000000ffffffffULL 20#define DMA_32BIT_MASK 0x00000000ffffffffULL
diff --git a/include/linux/elevator.h b/include/linux/elevator.h
index ad133fcfb239..1713ace808bf 100644
--- a/include/linux/elevator.h
+++ b/include/linux/elevator.h
@@ -21,7 +21,7 @@ typedef void (elevator_put_req_fn) (request_queue_t *, struct request *);
21typedef void (elevator_activate_req_fn) (request_queue_t *, struct request *); 21typedef void (elevator_activate_req_fn) (request_queue_t *, struct request *);
22typedef void (elevator_deactivate_req_fn) (request_queue_t *, struct request *); 22typedef void (elevator_deactivate_req_fn) (request_queue_t *, struct request *);
23 23
24typedef int (elevator_init_fn) (request_queue_t *, elevator_t *); 24typedef void *(elevator_init_fn) (request_queue_t *, elevator_t *);
25typedef void (elevator_exit_fn) (elevator_t *); 25typedef void (elevator_exit_fn) (elevator_t *);
26 26
27struct elevator_ops 27struct elevator_ops
diff --git a/include/linux/firmware.h b/include/linux/firmware.h
index 2d716080be4a..33d8f2087b6e 100644
--- a/include/linux/firmware.h
+++ b/include/linux/firmware.h
@@ -19,5 +19,4 @@ int request_firmware_nowait(
19 void (*cont)(const struct firmware *fw, void *context)); 19 void (*cont)(const struct firmware *fw, void *context));
20 20
21void release_firmware(const struct firmware *fw); 21void release_firmware(const struct firmware *fw);
22void register_firmware(const char *name, const u8 *data, size_t size);
23#endif 22#endif
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 162c6e57307a..f813bc8266aa 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -213,6 +213,10 @@ extern int dir_notify_enable;
213#define FIBMAP _IO(0x00,1) /* bmap access */ 213#define FIBMAP _IO(0x00,1) /* bmap access */
214#define FIGETBSZ _IO(0x00,2) /* get the block size used for bmap */ 214#define FIGETBSZ _IO(0x00,2) /* get the block size used for bmap */
215 215
216#define SYNC_FILE_RANGE_WAIT_BEFORE 1
217#define SYNC_FILE_RANGE_WRITE 2
218#define SYNC_FILE_RANGE_WAIT_AFTER 4
219
216#ifdef __KERNEL__ 220#ifdef __KERNEL__
217 221
218#include <linux/linkage.h> 222#include <linux/linkage.h>
@@ -758,9 +762,6 @@ extern int fcntl_setlease(unsigned int fd, struct file *filp, long arg);
758extern int fcntl_getlease(struct file *filp); 762extern int fcntl_getlease(struct file *filp);
759 763
760/* fs/sync.c */ 764/* fs/sync.c */
761#define SYNC_FILE_RANGE_WAIT_BEFORE 1
762#define SYNC_FILE_RANGE_WRITE 2
763#define SYNC_FILE_RANGE_WAIT_AFTER 4
764extern int do_sync_file_range(struct file *file, loff_t offset, loff_t endbyte, 765extern int do_sync_file_range(struct file *file, loff_t offset, loff_t endbyte,
765 unsigned int flags); 766 unsigned int flags);
766 767
@@ -1039,8 +1040,8 @@ struct file_operations {
1039 int (*check_flags)(int); 1040 int (*check_flags)(int);
1040 int (*dir_notify)(struct file *filp, unsigned long arg); 1041 int (*dir_notify)(struct file *filp, unsigned long arg);
1041 int (*flock) (struct file *, int, struct file_lock *); 1042 int (*flock) (struct file *, int, struct file_lock *);
1042 ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, size_t, unsigned int); 1043 ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int);
1043 ssize_t (*splice_read)(struct file *, struct pipe_inode_info *, size_t, unsigned int); 1044 ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int);
1044}; 1045};
1045 1046
1046struct inode_operations { 1047struct inode_operations {
@@ -1613,13 +1614,13 @@ extern void do_generic_mapping_read(struct address_space *mapping,
1613 loff_t *, read_descriptor_t *, read_actor_t); 1614 loff_t *, read_descriptor_t *, read_actor_t);
1614 1615
1615/* fs/splice.c */ 1616/* fs/splice.c */
1616extern ssize_t generic_file_splice_read(struct file *, 1617extern ssize_t generic_file_splice_read(struct file *, loff_t *,
1617 struct pipe_inode_info *, size_t, unsigned int); 1618 struct pipe_inode_info *, size_t, unsigned int);
1618extern ssize_t generic_file_splice_write(struct pipe_inode_info *, 1619extern ssize_t generic_file_splice_write(struct pipe_inode_info *,
1619 struct file *, size_t, unsigned int); 1620 struct file *, loff_t *, size_t, unsigned int);
1620extern ssize_t generic_splice_sendpage(struct pipe_inode_info *pipe, 1621extern ssize_t generic_splice_sendpage(struct pipe_inode_info *pipe,
1621 struct file *out, size_t len, unsigned int flags); 1622 struct file *out, loff_t *, size_t len, unsigned int flags);
1622extern long do_splice_direct(struct file *in, struct file *out, 1623extern long do_splice_direct(struct file *in, loff_t *ppos, struct file *out,
1623 size_t len, unsigned int flags); 1624 size_t len, unsigned int flags);
1624 1625
1625extern void 1626extern void
diff --git a/include/linux/fs_uart_pd.h b/include/linux/fs_uart_pd.h
new file mode 100644
index 000000000000..f5975126b712
--- /dev/null
+++ b/include/linux/fs_uart_pd.h
@@ -0,0 +1,60 @@
1/*
2 * Platform information definitions for the CPM Uart driver.
3 *
4 * 2006 (c) MontaVista Software, Inc.
5 * Vitaly Bordug <vbordug@ru.mvista.com>
6 *
7 * This file is licensed under the terms of the GNU General Public License
8 * version 2. This program is licensed "as is" without any warranty of any
9 * kind, whether express or implied.
10 */
11
12#ifndef FS_UART_PD_H
13#define FS_UART_PD_H
14
15#include <linux/version.h>
16#include <asm/types.h>
17
18enum fs_uart_id {
19 fsid_smc1_uart,
20 fsid_smc2_uart,
21 fsid_scc1_uart,
22 fsid_scc2_uart,
23 fsid_scc3_uart,
24 fsid_scc4_uart,
25 fs_uart_nr,
26};
27
28static inline int fs_uart_id_scc2fsid(int id)
29{
30 return fsid_scc1_uart + id - 1;
31}
32
33static inline int fs_uart_id_fsid2scc(int id)
34{
35 return id - fsid_scc1_uart + 1;
36}
37
38static inline int fs_uart_id_smc2fsid(int id)
39{
40 return fsid_smc1_uart + id - 1;
41}
42
43static inline int fs_uart_id_fsid2smc(int id)
44{
45 return id - fsid_smc1_uart + 1;
46}
47
48struct fs_uart_platform_info {
49 void(*init_ioports)(void);
50 /* device specific information */
51 int fs_no; /* controller index */
52 u32 uart_clk;
53 u8 tx_num_fifo;
54 u8 tx_buf_size;
55 u8 rx_num_fifo;
56 u8 rx_buf_size;
57 u8 brg;
58};
59
60#endif
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h
index a3a0e078f79d..16fbe59edeb1 100644
--- a/include/linux/fsl_devices.h
+++ b/include/linux/fsl_devices.h
@@ -110,5 +110,16 @@ struct fsl_usb2_platform_data {
110#define FSL_USB2_PORT0_ENABLED 0x00000001 110#define FSL_USB2_PORT0_ENABLED 0x00000001
111#define FSL_USB2_PORT1_ENABLED 0x00000002 111#define FSL_USB2_PORT1_ENABLED 0x00000002
112 112
113struct fsl_spi_platform_data {
114 u32 initial_spmode; /* initial SPMODE value */
115 u16 bus_num;
116
117 /* board specific information */
118 u16 max_chipselect;
119 void (*activate_cs)(u8 cs, u8 polarity);
120 void (*deactivate_cs)(u8 cs, u8 polarity);
121 u32 sysclk;
122};
123
113#endif /* _FSL_DEVICE_H_ */ 124#endif /* _FSL_DEVICE_H_ */
114#endif /* __KERNEL__ */ 125#endif /* __KERNEL__ */
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 10a27f29d692..2ef845b35175 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -105,6 +105,7 @@ struct gendisk {
105 * disks that can't be partitioned. */ 105 * disks that can't be partitioned. */
106 char disk_name[32]; /* name of major driver */ 106 char disk_name[32]; /* name of major driver */
107 struct hd_struct **part; /* [indexed by minor] */ 107 struct hd_struct **part; /* [indexed by minor] */
108 int part_uevent_suppress;
108 struct block_device_operations *fops; 109 struct block_device_operations *fops;
109 struct request_queue *queue; 110 struct request_queue *queue;
110 void *private_data; 111 void *private_data;
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 8d2db412ba9c..a8bef1d1371c 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -1220,7 +1220,6 @@ typedef struct ide_pci_enablebit_s {
1220enum { 1220enum {
1221 /* Uses ISA control ports not PCI ones. */ 1221 /* Uses ISA control ports not PCI ones. */
1222 IDEPCI_FLAG_ISA_PORTS = (1 << 0), 1222 IDEPCI_FLAG_ISA_PORTS = (1 << 0),
1223 IDEPCI_FLAG_FORCE_PDC = (1 << 1),
1224}; 1223};
1225 1224
1226typedef struct ide_pci_device_s { 1225typedef struct ide_pci_device_s {
diff --git a/include/linux/input.h b/include/linux/input.h
index b0e612dda0cf..ce1a756c4c30 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -12,8 +12,6 @@
12#ifdef __KERNEL__ 12#ifdef __KERNEL__
13#include <linux/time.h> 13#include <linux/time.h>
14#include <linux/list.h> 14#include <linux/list.h>
15#include <linux/device.h>
16#include <linux/mod_devicetable.h>
17#else 15#else
18#include <sys/time.h> 16#include <sys/time.h>
19#include <sys/ioctl.h> 17#include <sys/ioctl.h>
@@ -58,6 +56,8 @@ struct input_absinfo {
58 56
59#define EVIOCGVERSION _IOR('E', 0x01, int) /* get driver version */ 57#define EVIOCGVERSION _IOR('E', 0x01, int) /* get driver version */
60#define EVIOCGID _IOR('E', 0x02, struct input_id) /* get device ID */ 58#define EVIOCGID _IOR('E', 0x02, struct input_id) /* get device ID */
59#define EVIOCGREP _IOR('E', 0x03, int[2]) /* get repeat settings */
60#define EVIOCSREP _IOW('E', 0x03, int[2]) /* set repeat settings */
61#define EVIOCGKEYCODE _IOR('E', 0x04, int[2]) /* get keycode */ 61#define EVIOCGKEYCODE _IOR('E', 0x04, int[2]) /* get keycode */
62#define EVIOCSKEYCODE _IOW('E', 0x04, int[2]) /* set keycode */ 62#define EVIOCSKEYCODE _IOW('E', 0x04, int[2]) /* set keycode */
63 63
@@ -345,6 +345,8 @@ struct input_absinfo {
345#define KEY_SAVE 234 345#define KEY_SAVE 234
346#define KEY_DOCUMENTS 235 346#define KEY_DOCUMENTS 235
347 347
348#define KEY_BATTERY 236
349
348#define KEY_UNKNOWN 240 350#define KEY_UNKNOWN 240
349 351
350#define BTN_MISC 0x100 352#define BTN_MISC 0x100
@@ -577,15 +579,10 @@ struct input_absinfo {
577 * Switch events 579 * Switch events
578 */ 580 */
579 581
580#define SW_0 0x00 582#define SW_LID 0x00 /* set = lid shut */
581#define SW_1 0x01 583#define SW_TABLET_MODE 0x01 /* set = tablet mode */
582#define SW_2 0x02 584#define SW_HEADPHONE_INSERT 0x02 /* set = inserted */
583#define SW_3 0x03 585#define SW_MAX 0x0f
584#define SW_4 0x04
585#define SW_5 0x05
586#define SW_6 0x06
587#define SW_7 0x07
588#define SW_MAX 0x0f
589 586
590/* 587/*
591 * Misc events 588 * Misc events
@@ -805,52 +802,16 @@ struct ff_effect {
805 802
806#define FF_MAX 0x7f 803#define FF_MAX 0x7f
807 804
808struct input_device_id {
809
810 kernel_ulong_t flags;
811
812 struct input_id id;
813
814 kernel_ulong_t evbit[EV_MAX/BITS_PER_LONG+1];
815 kernel_ulong_t keybit[KEY_MAX/BITS_PER_LONG+1];
816 kernel_ulong_t relbit[REL_MAX/BITS_PER_LONG+1];
817 kernel_ulong_t absbit[ABS_MAX/BITS_PER_LONG+1];
818 kernel_ulong_t mscbit[MSC_MAX/BITS_PER_LONG+1];
819 kernel_ulong_t ledbit[LED_MAX/BITS_PER_LONG+1];
820 kernel_ulong_t sndbit[SND_MAX/BITS_PER_LONG+1];
821 kernel_ulong_t ffbit[FF_MAX/BITS_PER_LONG+1];
822 kernel_ulong_t swbit[SW_MAX/BITS_PER_LONG+1];
823
824 kernel_ulong_t driver_info;
825};
826
827/*
828 * Structure for hotplug & device<->driver matching.
829 */
830
831#define INPUT_DEVICE_ID_MATCH_BUS 1
832#define INPUT_DEVICE_ID_MATCH_VENDOR 2
833#define INPUT_DEVICE_ID_MATCH_PRODUCT 4
834#define INPUT_DEVICE_ID_MATCH_VERSION 8
835
836#define INPUT_DEVICE_ID_MATCH_EVBIT 0x010
837#define INPUT_DEVICE_ID_MATCH_KEYBIT 0x020
838#define INPUT_DEVICE_ID_MATCH_RELBIT 0x040
839#define INPUT_DEVICE_ID_MATCH_ABSBIT 0x080
840#define INPUT_DEVICE_ID_MATCH_MSCIT 0x100
841#define INPUT_DEVICE_ID_MATCH_LEDBIT 0x200
842#define INPUT_DEVICE_ID_MATCH_SNDBIT 0x400
843#define INPUT_DEVICE_ID_MATCH_FFBIT 0x800
844#define INPUT_DEVICE_ID_MATCH_SWBIT 0x1000
845
846#ifdef __KERNEL__ 805#ifdef __KERNEL__
847 806
848/* 807/*
849 * In-kernel definitions. 808 * In-kernel definitions.
850 */ 809 */
851 810
811#include <linux/device.h>
852#include <linux/fs.h> 812#include <linux/fs.h>
853#include <linux/timer.h> 813#include <linux/timer.h>
814#include <linux/mod_devicetable.h>
854 815
855#define NBITS(x) (((x)/BITS_PER_LONG)+1) 816#define NBITS(x) (((x)/BITS_PER_LONG)+1)
856#define BIT(x) (1UL<<((x)%BITS_PER_LONG)) 817#define BIT(x) (1UL<<((x)%BITS_PER_LONG))
@@ -951,9 +912,49 @@ struct input_dev {
951}; 912};
952#define to_input_dev(d) container_of(d, struct input_dev, cdev) 913#define to_input_dev(d) container_of(d, struct input_dev, cdev)
953 914
954#define INPUT_DEVICE_ID_MATCH_DEVICE\ 915/*
916 * Verify that we are in sync with input_device_id mod_devicetable.h #defines
917 */
918
919#if EV_MAX != INPUT_DEVICE_ID_EV_MAX
920#error "EV_MAX and INPUT_DEVICE_ID_EV_MAX do not match"
921#endif
922
923#if KEY_MAX != INPUT_DEVICE_ID_KEY_MAX
924#error "KEY_MAX and INPUT_DEVICE_ID_KEY_MAX do not match"
925#endif
926
927#if REL_MAX != INPUT_DEVICE_ID_REL_MAX
928#error "REL_MAX and INPUT_DEVICE_ID_REL_MAX do not match"
929#endif
930
931#if ABS_MAX != INPUT_DEVICE_ID_ABS_MAX
932#error "ABS_MAX and INPUT_DEVICE_ID_ABS_MAX do not match"
933#endif
934
935#if MSC_MAX != INPUT_DEVICE_ID_MSC_MAX
936#error "MSC_MAX and INPUT_DEVICE_ID_MSC_MAX do not match"
937#endif
938
939#if LED_MAX != INPUT_DEVICE_ID_LED_MAX
940#error "LED_MAX and INPUT_DEVICE_ID_LED_MAX do not match"
941#endif
942
943#if SND_MAX != INPUT_DEVICE_ID_SND_MAX
944#error "SND_MAX and INPUT_DEVICE_ID_SND_MAX do not match"
945#endif
946
947#if FF_MAX != INPUT_DEVICE_ID_FF_MAX
948#error "FF_MAX and INPUT_DEVICE_ID_FF_MAX do not match"
949#endif
950
951#if SW_MAX != INPUT_DEVICE_ID_SW_MAX
952#error "SW_MAX and INPUT_DEVICE_ID_SW_MAX do not match"
953#endif
954
955#define INPUT_DEVICE_ID_MATCH_DEVICE \
955 (INPUT_DEVICE_ID_MATCH_BUS | INPUT_DEVICE_ID_MATCH_VENDOR | INPUT_DEVICE_ID_MATCH_PRODUCT) 956 (INPUT_DEVICE_ID_MATCH_BUS | INPUT_DEVICE_ID_MATCH_VENDOR | INPUT_DEVICE_ID_MATCH_PRODUCT)
956#define INPUT_DEVICE_ID_MATCH_DEVICE_AND_VERSION\ 957#define INPUT_DEVICE_ID_MATCH_DEVICE_AND_VERSION \
957 (INPUT_DEVICE_ID_MATCH_DEVICE | INPUT_DEVICE_ID_MATCH_VERSION) 958 (INPUT_DEVICE_ID_MATCH_DEVICE | INPUT_DEVICE_ID_MATCH_VERSION)
958 959
959struct input_handle; 960struct input_handle;
@@ -1016,7 +1017,8 @@ static inline void input_put_device(struct input_dev *dev)
1016 1017
1017static inline void input_free_device(struct input_dev *dev) 1018static inline void input_free_device(struct input_dev *dev)
1018{ 1019{
1019 input_put_device(dev); 1020 if (dev)
1021 input_put_device(dev);
1020} 1022}
1021 1023
1022int input_register_device(struct input_dev *); 1024int input_register_device(struct input_dev *);
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index e1bd0842f6a1..f4fc576ed4c4 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -124,6 +124,7 @@ extern int get_option(char **str, int *pint);
124extern char *get_options(const char *str, int nints, int *ints); 124extern char *get_options(const char *str, int nints, int *ints);
125extern unsigned long long memparse(char *ptr, char **retptr); 125extern unsigned long long memparse(char *ptr, char **retptr);
126 126
127extern int core_kernel_text(unsigned long addr);
127extern int __kernel_text_address(unsigned long addr); 128extern int __kernel_text_address(unsigned long addr);
128extern int kernel_text_address(unsigned long addr); 129extern int kernel_text_address(unsigned long addr);
129extern int session_of_pgrp(int pgrp); 130extern int session_of_pgrp(int pgrp);
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index 4cb1214ec290..c187c53cecd0 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -24,6 +24,7 @@
24#include <linux/rwsem.h> 24#include <linux/rwsem.h>
25#include <linux/kref.h> 25#include <linux/kref.h>
26#include <linux/kernel.h> 26#include <linux/kernel.h>
27#include <linux/wait.h>
27#include <asm/atomic.h> 28#include <asm/atomic.h>
28 29
29#define KOBJ_NAME_LEN 20 30#define KOBJ_NAME_LEN 20
@@ -56,6 +57,7 @@ struct kobject {
56 struct kset * kset; 57 struct kset * kset;
57 struct kobj_type * ktype; 58 struct kobj_type * ktype;
58 struct dentry * dentry; 59 struct dentry * dentry;
60 wait_queue_head_t poll;
59}; 61};
60 62
61extern int kobject_set_name(struct kobject *, const char *, ...) 63extern int kobject_set_name(struct kobject *, const char *, ...)
@@ -255,9 +257,8 @@ struct subsys_attribute {
255}; 257};
256 258
257extern int subsys_create_file(struct subsystem * , struct subsys_attribute *); 259extern int subsys_create_file(struct subsystem * , struct subsys_attribute *);
258extern void subsys_remove_file(struct subsystem * , struct subsys_attribute *);
259 260
260#if defined(CONFIG_HOTPLUG) && defined(CONFIG_NET) 261#if defined(CONFIG_HOTPLUG)
261void kobject_uevent(struct kobject *kobj, enum kobject_action action); 262void kobject_uevent(struct kobject *kobj, enum kobject_action action);
262 263
263int add_uevent_var(char **envp, int num_envp, int *cur_index, 264int add_uevent_var(char **envp, int num_envp, int *cur_index,
diff --git a/include/linux/list.h b/include/linux/list.h
index 67258b47e9ca..76f05718342c 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -619,7 +619,7 @@ static inline void hlist_del_rcu(struct hlist_node *n)
619 619
620static inline void hlist_del_init(struct hlist_node *n) 620static inline void hlist_del_init(struct hlist_node *n)
621{ 621{
622 if (n->pprev) { 622 if (!hlist_unhashed(n)) {
623 __hlist_del(n); 623 __hlist_del(n);
624 INIT_HLIST_NODE(n); 624 INIT_HLIST_NODE(n);
625 } 625 }
diff --git a/include/linux/m48t86.h b/include/linux/m48t86.h
index 9065199319d0..915d6b4f0f89 100644
--- a/include/linux/m48t86.h
+++ b/include/linux/m48t86.h
@@ -11,6 +11,6 @@
11 11
12struct m48t86_ops 12struct m48t86_ops
13{ 13{
14 void (*writeb)(unsigned char value, unsigned long addr); 14 void (*writebyte)(unsigned char value, unsigned long addr);
15 unsigned char (*readb)(unsigned long addr); 15 unsigned char (*readbyte)(unsigned long addr);
16}; 16};
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h
index 4ca3e6ad03ec..911206386171 100644
--- a/include/linux/memory_hotplug.h
+++ b/include/linux/memory_hotplug.h
@@ -99,10 +99,7 @@ static inline int __remove_pages(struct zone *zone, unsigned long start_pfn,
99 return -ENOSYS; 99 return -ENOSYS;
100} 100}
101 101
102#if defined(CONFIG_MEMORY_HOTPLUG) || defined(CONFIG_ACPI_HOTPLUG_MEMORY) \
103 || defined(CONFIG_ACPI_HOTPLUG_MEMORY_MODULE)
104extern int add_memory(u64 start, u64 size); 102extern int add_memory(u64 start, u64 size);
105extern int remove_memory(u64 start, u64 size); 103extern int remove_memory(u64 start, u64 size);
106#endif
107 104
108#endif /* __LINUX_MEMORY_HOTPLUG_H */ 105#endif /* __LINUX_MEMORY_HOTPLUG_H */
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h
index 6a7621b2b12b..f5fdca1d67e6 100644
--- a/include/linux/mempolicy.h
+++ b/include/linux/mempolicy.h
@@ -36,6 +36,7 @@
36#include <linux/nodemask.h> 36#include <linux/nodemask.h>
37 37
38struct vm_area_struct; 38struct vm_area_struct;
39struct mm_struct;
39 40
40#ifdef CONFIG_NUMA 41#ifdef CONFIG_NUMA
41 42
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
index 30dd978c1ec8..991a37382a22 100644
--- a/include/linux/mmc/card.h
+++ b/include/linux/mmc/card.h
@@ -28,6 +28,7 @@ struct mmc_csd {
28 unsigned short cmdclass; 28 unsigned short cmdclass;
29 unsigned short tacc_clks; 29 unsigned short tacc_clks;
30 unsigned int tacc_ns; 30 unsigned int tacc_ns;
31 unsigned int r2w_factor;
31 unsigned int max_dtr; 32 unsigned int max_dtr;
32 unsigned int read_blkbits; 33 unsigned int read_blkbits;
33 unsigned int write_blkbits; 34 unsigned int write_blkbits;
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h
index bdc556d88498..03a14a30c46a 100644
--- a/include/linux/mmc/mmc.h
+++ b/include/linux/mmc/mmc.h
@@ -69,6 +69,7 @@ struct mmc_data {
69 unsigned int timeout_ns; /* data timeout (in ns, max 80ms) */ 69 unsigned int timeout_ns; /* data timeout (in ns, max 80ms) */
70 unsigned int timeout_clks; /* data timeout (in clocks) */ 70 unsigned int timeout_clks; /* data timeout (in clocks) */
71 unsigned int blksz_bits; /* data block size */ 71 unsigned int blksz_bits; /* data block size */
72 unsigned int blksz; /* data block size */
72 unsigned int blocks; /* number of blocks */ 73 unsigned int blocks; /* number of blocks */
73 unsigned int error; /* data error */ 74 unsigned int error; /* data error */
74 unsigned int flags; 75 unsigned int flags;
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index b5c21122c299..2d8337150493 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -15,6 +15,7 @@
15#include <linux/seqlock.h> 15#include <linux/seqlock.h>
16#include <linux/nodemask.h> 16#include <linux/nodemask.h>
17#include <asm/atomic.h> 17#include <asm/atomic.h>
18#include <asm/page.h>
18 19
19/* Free memory management - zoned buddy allocator. */ 20/* Free memory management - zoned buddy allocator. */
20#ifndef CONFIG_FORCE_MAX_ZONEORDER 21#ifndef CONFIG_FORCE_MAX_ZONEORDER
@@ -22,6 +23,7 @@
22#else 23#else
23#define MAX_ORDER CONFIG_FORCE_MAX_ZONEORDER 24#define MAX_ORDER CONFIG_FORCE_MAX_ZONEORDER
24#endif 25#endif
26#define MAX_ORDER_NR_PAGES (1 << (MAX_ORDER - 1))
25 27
26struct free_area { 28struct free_area {
27 struct list_head free_list; 29 struct list_head free_list;
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 7b08c11ec4cc..f6977708585c 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -249,4 +249,52 @@ struct i2c_device_id {
249 __u16 id; 249 __u16 id;
250}; 250};
251 251
252/* Input */
253#define INPUT_DEVICE_ID_EV_MAX 0x1f
254#define INPUT_DEVICE_ID_KEY_MAX 0x1ff
255#define INPUT_DEVICE_ID_REL_MAX 0x0f
256#define INPUT_DEVICE_ID_ABS_MAX 0x3f
257#define INPUT_DEVICE_ID_MSC_MAX 0x07
258#define INPUT_DEVICE_ID_LED_MAX 0x0f
259#define INPUT_DEVICE_ID_SND_MAX 0x07
260#define INPUT_DEVICE_ID_FF_MAX 0x7f
261#define INPUT_DEVICE_ID_SW_MAX 0x0f
262
263#define INPUT_DEVICE_ID_MATCH_BUS 1
264#define INPUT_DEVICE_ID_MATCH_VENDOR 2
265#define INPUT_DEVICE_ID_MATCH_PRODUCT 4
266#define INPUT_DEVICE_ID_MATCH_VERSION 8
267
268#define INPUT_DEVICE_ID_MATCH_EVBIT 0x0010
269#define INPUT_DEVICE_ID_MATCH_KEYBIT 0x0020
270#define INPUT_DEVICE_ID_MATCH_RELBIT 0x0040
271#define INPUT_DEVICE_ID_MATCH_ABSBIT 0x0080
272#define INPUT_DEVICE_ID_MATCH_MSCIT 0x0100
273#define INPUT_DEVICE_ID_MATCH_LEDBIT 0x0200
274#define INPUT_DEVICE_ID_MATCH_SNDBIT 0x0400
275#define INPUT_DEVICE_ID_MATCH_FFBIT 0x0800
276#define INPUT_DEVICE_ID_MATCH_SWBIT 0x1000
277
278struct input_device_id {
279
280 kernel_ulong_t flags;
281
282 __u16 bustype;
283 __u16 vendor;
284 __u16 product;
285 __u16 version;
286
287 kernel_ulong_t evbit[INPUT_DEVICE_ID_EV_MAX / BITS_PER_LONG + 1];
288 kernel_ulong_t keybit[INPUT_DEVICE_ID_KEY_MAX / BITS_PER_LONG + 1];
289 kernel_ulong_t relbit[INPUT_DEVICE_ID_REL_MAX / BITS_PER_LONG + 1];
290 kernel_ulong_t absbit[INPUT_DEVICE_ID_ABS_MAX / BITS_PER_LONG + 1];
291 kernel_ulong_t mscbit[INPUT_DEVICE_ID_MSC_MAX / BITS_PER_LONG + 1];
292 kernel_ulong_t ledbit[INPUT_DEVICE_ID_LED_MAX / BITS_PER_LONG + 1];
293 kernel_ulong_t sndbit[INPUT_DEVICE_ID_SND_MAX / BITS_PER_LONG + 1];
294 kernel_ulong_t ffbit[INPUT_DEVICE_ID_FF_MAX / BITS_PER_LONG + 1];
295 kernel_ulong_t swbit[INPUT_DEVICE_ID_SW_MAX / BITS_PER_LONG + 1];
296
297 kernel_ulong_t driver_info;
298};
299
252#endif /* LINUX_MOD_DEVICETABLE_H */ 300#endif /* LINUX_MOD_DEVICETABLE_H */
diff --git a/include/linux/mv643xx.h b/include/linux/mv643xx.h
index 955d3069d727..edfa012fad3a 100644
--- a/include/linux/mv643xx.h
+++ b/include/linux/mv643xx.h
@@ -13,7 +13,7 @@
13#ifndef __ASM_MV643XX_H 13#ifndef __ASM_MV643XX_H
14#define __ASM_MV643XX_H 14#define __ASM_MV643XX_H
15 15
16#ifdef __MIPS__ 16#ifdef __mips__
17#include <asm/addrspace.h> 17#include <asm/addrspace.h>
18#include <asm/marvell.h> 18#include <asm/marvell.h>
19#endif 19#endif
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 40ccf8cc4239..f4169bbb60eb 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -433,8 +433,7 @@ struct net_device
433 433
434 /* register/unregister state machine */ 434 /* register/unregister state machine */
435 enum { NETREG_UNINITIALIZED=0, 435 enum { NETREG_UNINITIALIZED=0,
436 NETREG_REGISTERING, /* called register_netdevice */ 436 NETREG_REGISTERED, /* completed register_netdevice */
437 NETREG_REGISTERED, /* completed register todo */
438 NETREG_UNREGISTERING, /* called unregister_netdevice */ 437 NETREG_UNREGISTERING, /* called unregister_netdevice */
439 NETREG_UNREGISTERED, /* completed unregister todo */ 438 NETREG_UNREGISTERED, /* completed unregister todo */
440 NETREG_RELEASED, /* called free_netdev */ 439 NETREG_RELEASED, /* called free_netdev */
@@ -506,6 +505,8 @@ struct net_device
506 505
507 /* class/net/name entry */ 506 /* class/net/name entry */
508 struct class_device class_dev; 507 struct class_device class_dev;
508 /* space for optional statistics and wireless sysfs groups */
509 struct attribute_group *sysfs_groups[3];
509}; 510};
510 511
511#define NETDEV_ALIGN 32 512#define NETDEV_ALIGN 32
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h
index f6bdef82a322..48cc32d83f77 100644
--- a/include/linux/netfilter/x_tables.h
+++ b/include/linux/netfilter/x_tables.h
@@ -337,6 +337,10 @@ struct compat_xt_entry_match
337 char name[XT_FUNCTION_MAXNAMELEN - 1]; 337 char name[XT_FUNCTION_MAXNAMELEN - 1];
338 u_int8_t revision; 338 u_int8_t revision;
339 } user; 339 } user;
340 struct {
341 u_int16_t match_size;
342 compat_uptr_t match;
343 } kernel;
340 u_int16_t match_size; 344 u_int16_t match_size;
341 } u; 345 } u;
342 unsigned char data[0]; 346 unsigned char data[0];
@@ -350,6 +354,10 @@ struct compat_xt_entry_target
350 char name[XT_FUNCTION_MAXNAMELEN - 1]; 354 char name[XT_FUNCTION_MAXNAMELEN - 1];
351 u_int8_t revision; 355 u_int8_t revision;
352 } user; 356 } user;
357 struct {
358 u_int16_t target_size;
359 compat_uptr_t target;
360 } kernel;
353 u_int16_t target_size; 361 u_int16_t target_size;
354 } u; 362 } u;
355 unsigned char data[0]; 363 unsigned char data[0];
@@ -361,7 +369,11 @@ struct compat_xt_entry_target
361 369
362struct compat_xt_counters 370struct compat_xt_counters
363{ 371{
372#if defined(CONFIG_X86_64) || defined(CONFIG_IA64)
364 u_int32_t cnt[4]; 373 u_int32_t cnt[4];
374#else
375 u_int64_t cnt[2];
376#endif
365}; 377};
366 378
367struct compat_xt_counters_info 379struct compat_xt_counters_info
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_asn1.h b/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_asn1.h
index 0bd828081c0c..c6e9a0b6d30b 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_asn1.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_asn1.h
@@ -2,7 +2,7 @@
2 * ip_conntrack_helper_h323_asn1.h - BER and PER decoding library for H.323 2 * ip_conntrack_helper_h323_asn1.h - BER and PER decoding library for H.323
3 * conntrack/NAT module. 3 * conntrack/NAT module.
4 * 4 *
5 * Copyright (c) 2006 by Jing Min Zhao <zhaojingmin@hotmail.com> 5 * Copyright (c) 2006 by Jing Min Zhao <zhaojingmin@users.sourceforge.net>
6 * 6 *
7 * This source code is licensed under General Public License version 2. 7 * This source code is licensed under General Public License version 2.
8 * 8 *
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index f8f3d1c927f8..87b8a5703ebc 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -143,6 +143,7 @@ struct netlink_skb_parms
143 __u32 dst_group; 143 __u32 dst_group;
144 kernel_cap_t eff_cap; 144 kernel_cap_t eff_cap;
145 __u32 loginuid; /* Login (audit) uid */ 145 __u32 loginuid; /* Login (audit) uid */
146 __u32 sid; /* SELinux security id */
146}; 147};
147 148
148#define NETLINK_CB(skb) (*(struct netlink_skb_parms*)&((skb)->cb)) 149#define NETLINK_CB(skb) (*(struct netlink_skb_parms*)&((skb)->cb))
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index 9539efd4f7e6..7a1af574dedf 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -78,6 +78,8 @@ extern struct page * find_or_create_page(struct address_space *mapping,
78 unsigned long index, gfp_t gfp_mask); 78 unsigned long index, gfp_t gfp_mask);
79unsigned find_get_pages(struct address_space *mapping, pgoff_t start, 79unsigned find_get_pages(struct address_space *mapping, pgoff_t start,
80 unsigned int nr_pages, struct page **pages); 80 unsigned int nr_pages, struct page **pages);
81unsigned find_get_pages_contig(struct address_space *mapping, pgoff_t start,
82 unsigned int nr_pages, struct page **pages);
81unsigned find_get_pages_tag(struct address_space *mapping, pgoff_t *index, 83unsigned find_get_pages_tag(struct address_space *mapping, pgoff_t *index,
82 int tag, unsigned int nr_pages, struct page **pages); 84 int tag, unsigned int nr_pages, struct page **pages);
83 85
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 0aad5a378e95..3a6a4e37a482 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -97,7 +97,13 @@ enum pci_channel_state {
97 97
98typedef unsigned short __bitwise pci_bus_flags_t; 98typedef unsigned short __bitwise pci_bus_flags_t;
99enum pci_bus_flags { 99enum pci_bus_flags {
100 PCI_BUS_FLAGS_NO_MSI = (pci_bus_flags_t) 1, 100 PCI_BUS_FLAGS_NO_MSI = (__force pci_bus_flags_t) 1,
101};
102
103struct pci_cap_saved_state {
104 struct hlist_node next;
105 char cap_nr;
106 u32 data[0];
101}; 107};
102 108
103/* 109/*
@@ -159,6 +165,7 @@ struct pci_dev {
159 unsigned int block_ucfg_access:1; /* userspace config space access is blocked */ 165 unsigned int block_ucfg_access:1; /* userspace config space access is blocked */
160 166
161 u32 saved_config_space[16]; /* config space saved at suspend time */ 167 u32 saved_config_space[16]; /* config space saved at suspend time */
168 struct hlist_head saved_cap_space;
162 struct bin_attribute *rom_attr; /* attribute descriptor for sysfs ROM entry */ 169 struct bin_attribute *rom_attr; /* attribute descriptor for sysfs ROM entry */
163 int rom_attr_enabled; /* has display of the rom attribute been enabled? */ 170 int rom_attr_enabled; /* has display of the rom attribute been enabled? */
164 struct bin_attribute *res_attr[DEVICE_COUNT_RESOURCE]; /* sysfs file for resources */ 171 struct bin_attribute *res_attr[DEVICE_COUNT_RESOURCE]; /* sysfs file for resources */
@@ -169,6 +176,30 @@ struct pci_dev {
169#define to_pci_dev(n) container_of(n, struct pci_dev, dev) 176#define to_pci_dev(n) container_of(n, struct pci_dev, dev)
170#define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL) 177#define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL)
171 178
179static inline struct pci_cap_saved_state *pci_find_saved_cap(
180 struct pci_dev *pci_dev,char cap)
181{
182 struct pci_cap_saved_state *tmp;
183 struct hlist_node *pos;
184
185 hlist_for_each_entry(tmp, pos, &pci_dev->saved_cap_space, next) {
186 if (tmp->cap_nr == cap)
187 return tmp;
188 }
189 return NULL;
190}
191
192static inline void pci_add_saved_cap(struct pci_dev *pci_dev,
193 struct pci_cap_saved_state *new_cap)
194{
195 hlist_add_head(&new_cap->next, &pci_dev->saved_cap_space);
196}
197
198static inline void pci_remove_saved_cap(struct pci_cap_saved_state *cap)
199{
200 hlist_del(&cap->next);
201}
202
172/* 203/*
173 * For PCI devices, the region numbers are assigned this way: 204 * For PCI devices, the region numbers are assigned this way:
174 * 205 *
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 870fe38378b1..590dc6dca315 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -356,6 +356,10 @@
356#define PCI_DEVICE_ID_ATI_IXP300_SATA 0x436e 356#define PCI_DEVICE_ID_ATI_IXP300_SATA 0x436e
357#define PCI_DEVICE_ID_ATI_IXP400_IDE 0x4376 357#define PCI_DEVICE_ID_ATI_IXP400_IDE 0x4376
358#define PCI_DEVICE_ID_ATI_IXP400_SATA 0x4379 358#define PCI_DEVICE_ID_ATI_IXP400_SATA 0x4379
359#define PCI_DEVICE_ID_ATI_IXP400_SATA2 0x437a
360#define PCI_DEVICE_ID_ATI_IXP600_SATA 0x4380
361#define PCI_DEVICE_ID_ATI_IXP600_SRAID 0x4381
362#define PCI_DEVICE_ID_ATI_IXP600_IDE 0x438c
359 363
360#define PCI_VENDOR_ID_VLSI 0x1004 364#define PCI_VENDOR_ID_VLSI 0x1004
361#define PCI_DEVICE_ID_VLSI_82C592 0x0005 365#define PCI_DEVICE_ID_VLSI_82C592 0x0005
@@ -497,7 +501,8 @@
497#define PCI_DEVICE_ID_AMD_8111_SMBUS 0x746b 501#define PCI_DEVICE_ID_AMD_8111_SMBUS 0x746b
498#define PCI_DEVICE_ID_AMD_8111_AUDIO 0x746d 502#define PCI_DEVICE_ID_AMD_8111_AUDIO 0x746d
499#define PCI_DEVICE_ID_AMD_8151_0 0x7454 503#define PCI_DEVICE_ID_AMD_8151_0 0x7454
500#define PCI_DEVICE_ID_AMD_8131_APIC 0x7450 504#define PCI_DEVICE_ID_AMD_8131_BRIDGE 0x7450
505#define PCI_DEVICE_ID_AMD_8131_APIC 0x7451
501#define PCI_DEVICE_ID_AMD_CS5536_ISA 0x2090 506#define PCI_DEVICE_ID_AMD_CS5536_ISA 0x2090
502#define PCI_DEVICE_ID_AMD_CS5536_FLASH 0x2091 507#define PCI_DEVICE_ID_AMD_CS5536_FLASH 0x2091
503#define PCI_DEVICE_ID_AMD_CS5536_AUDIO 0x2093 508#define PCI_DEVICE_ID_AMD_CS5536_AUDIO 0x2093
@@ -1226,6 +1231,7 @@
1226#define PCI_DEVICE_ID_VIA_8380_0 0x0204 1231#define PCI_DEVICE_ID_VIA_8380_0 0x0204
1227#define PCI_DEVICE_ID_VIA_3238_0 0x0238 1232#define PCI_DEVICE_ID_VIA_3238_0 0x0238
1228#define PCI_DEVICE_ID_VIA_PT880 0x0258 1233#define PCI_DEVICE_ID_VIA_PT880 0x0258
1234#define PCI_DEVICE_ID_VIA_PT880ULTRA 0x0308
1229#define PCI_DEVICE_ID_VIA_PX8X0_0 0x0259 1235#define PCI_DEVICE_ID_VIA_PX8X0_0 0x0259
1230#define PCI_DEVICE_ID_VIA_3269_0 0x0269 1236#define PCI_DEVICE_ID_VIA_3269_0 0x0269
1231#define PCI_DEVICE_ID_VIA_K8T800PRO_0 0x0282 1237#define PCI_DEVICE_ID_VIA_K8T800PRO_0 0x0282
diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h
index 123a7c24bc72..ea4f7cd7bfd8 100644
--- a/include/linux/pipe_fs_i.h
+++ b/include/linux/pipe_fs_i.h
@@ -5,8 +5,9 @@
5 5
6#define PIPE_BUFFERS (16) 6#define PIPE_BUFFERS (16)
7 7
8#define PIPE_BUF_FLAG_STOLEN 0x01 8#define PIPE_BUF_FLAG_LRU 0x01 /* page is on the LRU */
9#define PIPE_BUF_FLAG_LRU 0x02 9#define PIPE_BUF_FLAG_ATOMIC 0x02 /* was atomically mapped */
10#define PIPE_BUF_FLAG_GIFT 0x04 /* page is a gift */
10 11
11struct pipe_buffer { 12struct pipe_buffer {
12 struct page *page; 13 struct page *page;
@@ -15,12 +16,26 @@ struct pipe_buffer {
15 unsigned int flags; 16 unsigned int flags;
16}; 17};
17 18
19/*
20 * Note on the nesting of these functions:
21 *
22 * ->pin()
23 * ->steal()
24 * ...
25 * ->map()
26 * ...
27 * ->unmap()
28 *
29 * That is, ->map() must be called on a pinned buffer, same goes for ->steal().
30 */
18struct pipe_buf_operations { 31struct pipe_buf_operations {
19 int can_merge; 32 int can_merge;
20 void * (*map)(struct file *, struct pipe_inode_info *, struct pipe_buffer *); 33 void * (*map)(struct pipe_inode_info *, struct pipe_buffer *, int);
21 void (*unmap)(struct pipe_inode_info *, struct pipe_buffer *); 34 void (*unmap)(struct pipe_inode_info *, struct pipe_buffer *, void *);
35 int (*pin)(struct pipe_inode_info *, struct pipe_buffer *);
22 void (*release)(struct pipe_inode_info *, struct pipe_buffer *); 36 void (*release)(struct pipe_inode_info *, struct pipe_buffer *);
23 int (*steal)(struct pipe_inode_info *, struct pipe_buffer *); 37 int (*steal)(struct pipe_inode_info *, struct pipe_buffer *);
38 void (*get)(struct pipe_inode_info *, struct pipe_buffer *);
24}; 39};
25 40
26struct pipe_inode_info { 41struct pipe_inode_info {
@@ -50,6 +65,13 @@ struct pipe_inode_info * alloc_pipe_info(struct inode * inode);
50void free_pipe_info(struct inode * inode); 65void free_pipe_info(struct inode * inode);
51void __free_pipe_info(struct pipe_inode_info *); 66void __free_pipe_info(struct pipe_inode_info *);
52 67
68/* Generic pipe buffer ops functions */
69void *generic_pipe_buf_map(struct pipe_inode_info *, struct pipe_buffer *, int);
70void generic_pipe_buf_unmap(struct pipe_inode_info *, struct pipe_buffer *, void *);
71void generic_pipe_buf_get(struct pipe_inode_info *, struct pipe_buffer *);
72int generic_pipe_buf_pin(struct pipe_inode_info *, struct pipe_buffer *);
73int generic_pipe_buf_steal(struct pipe_inode_info *, struct pipe_buffer *);
74
53/* 75/*
54 * splice is tied to pipes as a transport (at least for now), so we'll just 76 * splice is tied to pipes as a transport (at least for now), so we'll just
55 * add the splice flags here. 77 * add the splice flags here.
@@ -59,5 +81,23 @@ void __free_pipe_info(struct pipe_inode_info *);
59 /* we may still block on the fd we splice */ 81 /* we may still block on the fd we splice */
60 /* from/to, of course */ 82 /* from/to, of course */
61#define SPLICE_F_MORE (0x04) /* expect more data */ 83#define SPLICE_F_MORE (0x04) /* expect more data */
84#define SPLICE_F_GIFT (0x08) /* pages passed in are a gift */
85
86/*
87 * Passed to the actors
88 */
89struct splice_desc {
90 unsigned int len, total_len; /* current and remaining length */
91 unsigned int flags; /* splice flags */
92 struct file *file; /* file to read/write */
93 loff_t pos; /* file position */
94};
95
96typedef int (splice_actor)(struct pipe_inode_info *, struct pipe_buffer *,
97 struct splice_desc *);
98
99extern ssize_t splice_from_pipe(struct pipe_inode_info *, struct file *,
100 loff_t *, size_t, unsigned int,
101 splice_actor *);
62 102
63#endif 103#endif
diff --git a/include/linux/pm.h b/include/linux/pm.h
index 6df2585c0169..66be58902b17 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -199,6 +199,12 @@ extern int device_suspend(pm_message_t state);
199 199
200extern int dpm_runtime_suspend(struct device *, pm_message_t); 200extern int dpm_runtime_suspend(struct device *, pm_message_t);
201extern void dpm_runtime_resume(struct device *); 201extern void dpm_runtime_resume(struct device *);
202extern void __suspend_report_result(const char *function, void *fn, int ret);
203
204#define suspend_report_result(fn, ret) \
205 do { \
206 __suspend_report_result(__FUNCTION__, fn, ret); \
207 } while (0)
202 208
203#else /* !CONFIG_PM */ 209#else /* !CONFIG_PM */
204 210
@@ -219,6 +225,8 @@ static inline void dpm_runtime_resume(struct device * dev)
219{ 225{
220} 226}
221 227
228#define suspend_report_result(fn, ret) do { } while (0)
229
222#endif 230#endif
223 231
224/* changes to device_may_wakeup take effect on the next pm state change. 232/* changes to device_may_wakeup take effect on the next pm state change.
diff --git a/include/linux/pm_legacy.h b/include/linux/pm_legacy.h
index 1252b45face1..008932d73c35 100644
--- a/include/linux/pm_legacy.h
+++ b/include/linux/pm_legacy.h
@@ -16,11 +16,6 @@ struct pm_dev __deprecated *
16pm_register(pm_dev_t type, unsigned long id, pm_callback callback); 16pm_register(pm_dev_t type, unsigned long id, pm_callback callback);
17 17
18/* 18/*
19 * Unregister a device with power management
20 */
21void __deprecated pm_unregister(struct pm_dev *dev);
22
23/*
24 * Unregister all devices with matching callback 19 * Unregister all devices with matching callback
25 */ 20 */
26void __deprecated pm_unregister_all(pm_callback callback); 21void __deprecated pm_unregister_all(pm_callback callback);
@@ -41,8 +36,6 @@ static inline struct pm_dev *pm_register(pm_dev_t type,
41 return NULL; 36 return NULL;
42} 37}
43 38
44static inline void pm_unregister(struct pm_dev *dev) {}
45
46static inline void pm_unregister_all(pm_callback callback) {} 39static inline void pm_unregister_all(pm_callback callback) {}
47 40
48static inline int pm_send_all(pm_request_t rqst, void *data) 41static inline int pm_send_all(pm_request_t rqst, void *data)
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 5673008b61e1..970284f571a6 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -132,6 +132,7 @@ static inline void rcu_bh_qsctr_inc(int cpu)
132} 132}
133 133
134extern int rcu_pending(int cpu); 134extern int rcu_pending(int cpu);
135extern int rcu_needs_cpu(int cpu);
135 136
136/** 137/**
137 * rcu_read_lock - mark the beginning of an RCU read-side critical section. 138 * rcu_read_lock - mark the beginning of an RCU read-side critical section.
diff --git a/include/linux/sched.h b/include/linux/sched.h
index e3539c14e47e..29b7d4f87d20 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -911,7 +911,6 @@ static inline int pid_alive(struct task_struct *p)
911extern void free_task(struct task_struct *tsk); 911extern void free_task(struct task_struct *tsk);
912#define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0) 912#define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0)
913 913
914extern void __put_task_struct_cb(struct rcu_head *rhp);
915extern void __put_task_struct(struct task_struct *t); 914extern void __put_task_struct(struct task_struct *t);
916 915
917static inline void put_task_struct(struct task_struct *t) 916static inline void put_task_struct(struct task_struct *t)
@@ -1193,8 +1192,7 @@ extern void wait_task_inactive(task_t * p);
1193#define remove_parent(p) list_del_init(&(p)->sibling) 1192#define remove_parent(p) list_del_init(&(p)->sibling)
1194#define add_parent(p) list_add_tail(&(p)->sibling,&(p)->parent->children) 1193#define add_parent(p) list_add_tail(&(p)->sibling,&(p)->parent->children)
1195 1194
1196#define next_task(p) list_entry((p)->tasks.next, struct task_struct, tasks) 1195#define next_task(p) list_entry(rcu_dereference((p)->tasks.next), struct task_struct, tasks)
1197#define prev_task(p) list_entry((p)->tasks.prev, struct task_struct, tasks)
1198 1196
1199#define for_each_process(p) \ 1197#define for_each_process(p) \
1200 for (p = &init_task ; (p = next_task(p)) != &init_task ; ) 1198 for (p = &init_task ; (p = next_task(p)) != &init_task ; )
diff --git a/include/linux/security.h b/include/linux/security.h
index aaa0a5cdbf75..1bab48f6aeac 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -869,11 +869,6 @@ struct swap_info_struct;
869 * @ipcp contains the kernel IPC permission structure 869 * @ipcp contains the kernel IPC permission structure
870 * @flag contains the desired (requested) permission set 870 * @flag contains the desired (requested) permission set
871 * Return 0 if permission is granted. 871 * Return 0 if permission is granted.
872 * @ipc_getsecurity:
873 * Copy the security label associated with the ipc object into
874 * @buffer. @buffer may be NULL to request the size of the buffer
875 * required. @size indicates the size of @buffer in bytes. Return
876 * number of bytes used/required on success.
877 * 872 *
878 * Security hooks for individual messages held in System V IPC message queues 873 * Security hooks for individual messages held in System V IPC message queues
879 * @msg_msg_alloc_security: 874 * @msg_msg_alloc_security:
@@ -1223,7 +1218,6 @@ struct security_operations {
1223 void (*task_to_inode)(struct task_struct *p, struct inode *inode); 1218 void (*task_to_inode)(struct task_struct *p, struct inode *inode);
1224 1219
1225 int (*ipc_permission) (struct kern_ipc_perm * ipcp, short flag); 1220 int (*ipc_permission) (struct kern_ipc_perm * ipcp, short flag);
1226 int (*ipc_getsecurity)(struct kern_ipc_perm *ipcp, void *buffer, size_t size);
1227 1221
1228 int (*msg_msg_alloc_security) (struct msg_msg * msg); 1222 int (*msg_msg_alloc_security) (struct msg_msg * msg);
1229 void (*msg_msg_free_security) (struct msg_msg * msg); 1223 void (*msg_msg_free_security) (struct msg_msg * msg);
@@ -1887,11 +1881,6 @@ static inline int security_ipc_permission (struct kern_ipc_perm *ipcp,
1887 return security_ops->ipc_permission (ipcp, flag); 1881 return security_ops->ipc_permission (ipcp, flag);
1888} 1882}
1889 1883
1890static inline int security_ipc_getsecurity(struct kern_ipc_perm *ipcp, void *buffer, size_t size)
1891{
1892 return security_ops->ipc_getsecurity(ipcp, buffer, size);
1893}
1894
1895static inline int security_msg_msg_alloc (struct msg_msg * msg) 1884static inline int security_msg_msg_alloc (struct msg_msg * msg)
1896{ 1885{
1897 return security_ops->msg_msg_alloc_security (msg); 1886 return security_ops->msg_msg_alloc_security (msg);
@@ -2532,11 +2521,6 @@ static inline int security_ipc_permission (struct kern_ipc_perm *ipcp,
2532 return 0; 2521 return 0;
2533} 2522}
2534 2523
2535static inline int security_ipc_getsecurity(struct kern_ipc_perm *ipcp, void *buffer, size_t size)
2536{
2537 return -EOPNOTSUPP;
2538}
2539
2540static inline int security_msg_msg_alloc (struct msg_msg * msg) 2524static inline int security_msg_msg_alloc (struct msg_msg * msg)
2541{ 2525{
2542 return 0; 2526 return 0;
diff --git a/include/linux/selinux.h b/include/linux/selinux.h
new file mode 100644
index 000000000000..4047bcde4484
--- /dev/null
+++ b/include/linux/selinux.h
@@ -0,0 +1,177 @@
1/*
2 * SELinux services exported to the rest of the kernel.
3 *
4 * Author: James Morris <jmorris@redhat.com>
5 *
6 * Copyright (C) 2005 Red Hat, Inc., James Morris <jmorris@redhat.com>
7 * Copyright (C) 2006 Trusted Computer Solutions, Inc. <dgoeddel@trustedcs.com>
8 * Copyright (C) 2006 IBM Corporation, Timothy R. Chavez <tinytim@us.ibm.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2,
12 * as published by the Free Software Foundation.
13 */
14#ifndef _LINUX_SELINUX_H
15#define _LINUX_SELINUX_H
16
17struct selinux_audit_rule;
18struct audit_context;
19struct inode;
20struct kern_ipc_perm;
21
22#ifdef CONFIG_SECURITY_SELINUX
23
24/**
25 * selinux_audit_rule_init - alloc/init an selinux audit rule structure.
26 * @field: the field this rule refers to
27 * @op: the operater the rule uses
28 * @rulestr: the text "target" of the rule
29 * @rule: pointer to the new rule structure returned via this
30 *
31 * Returns 0 if successful, -errno if not. On success, the rule structure
32 * will be allocated internally. The caller must free this structure with
33 * selinux_audit_rule_free() after use.
34 */
35int selinux_audit_rule_init(u32 field, u32 op, char *rulestr,
36 struct selinux_audit_rule **rule);
37
38/**
39 * selinux_audit_rule_free - free an selinux audit rule structure.
40 * @rule: pointer to the audit rule to be freed
41 *
42 * This will free all memory associated with the given rule.
43 * If @rule is NULL, no operation is performed.
44 */
45void selinux_audit_rule_free(struct selinux_audit_rule *rule);
46
47/**
48 * selinux_audit_rule_match - determine if a context ID matches a rule.
49 * @ctxid: the context ID to check
50 * @field: the field this rule refers to
51 * @op: the operater the rule uses
52 * @rule: pointer to the audit rule to check against
53 * @actx: the audit context (can be NULL) associated with the check
54 *
55 * Returns 1 if the context id matches the rule, 0 if it does not, and
56 * -errno on failure.
57 */
58int selinux_audit_rule_match(u32 ctxid, u32 field, u32 op,
59 struct selinux_audit_rule *rule,
60 struct audit_context *actx);
61
62/**
63 * selinux_audit_set_callback - set the callback for policy reloads.
64 * @callback: the function to call when the policy is reloaded
65 *
66 * This sets the function callback function that will update the rules
67 * upon policy reloads. This callback should rebuild all existing rules
68 * using selinux_audit_rule_init().
69 */
70void selinux_audit_set_callback(int (*callback)(void));
71
72/**
73 * selinux_task_ctxid - determine a context ID for a process.
74 * @tsk: the task object
75 * @ctxid: ID value returned via this
76 *
77 * On return, ctxid will contain an ID for the context. This value
78 * should only be used opaquely.
79 */
80void selinux_task_ctxid(struct task_struct *tsk, u32 *ctxid);
81
82/**
83 * selinux_ctxid_to_string - map a security context ID to a string
84 * @ctxid: security context ID to be converted.
85 * @ctx: address of context string to be returned
86 * @ctxlen: length of returned context string.
87 *
88 * Returns 0 if successful, -errno if not. On success, the context
89 * string will be allocated internally, and the caller must call
90 * kfree() on it after use.
91 */
92int selinux_ctxid_to_string(u32 ctxid, char **ctx, u32 *ctxlen);
93
94/**
95 * selinux_get_inode_sid - get the inode's security context ID
96 * @inode: inode structure to get the sid from.
97 * @sid: pointer to security context ID to be filled in.
98 *
99 * Returns nothing
100 */
101void selinux_get_inode_sid(const struct inode *inode, u32 *sid);
102
103/**
104 * selinux_get_ipc_sid - get the ipc security context ID
105 * @ipcp: ipc structure to get the sid from.
106 * @sid: pointer to security context ID to be filled in.
107 *
108 * Returns nothing
109 */
110void selinux_get_ipc_sid(const struct kern_ipc_perm *ipcp, u32 *sid);
111
112/**
113 * selinux_get_task_sid - return the SID of task
114 * @tsk: the task whose SID will be returned
115 * @sid: pointer to security context ID to be filled in.
116 *
117 * Returns nothing
118 */
119void selinux_get_task_sid(struct task_struct *tsk, u32 *sid);
120
121
122#else
123
124static inline int selinux_audit_rule_init(u32 field, u32 op,
125 char *rulestr,
126 struct selinux_audit_rule **rule)
127{
128 return -ENOTSUPP;
129}
130
131static inline void selinux_audit_rule_free(struct selinux_audit_rule *rule)
132{
133 return;
134}
135
136static inline int selinux_audit_rule_match(u32 ctxid, u32 field, u32 op,
137 struct selinux_audit_rule *rule,
138 struct audit_context *actx)
139{
140 return 0;
141}
142
143static inline void selinux_audit_set_callback(int (*callback)(void))
144{
145 return;
146}
147
148static inline void selinux_task_ctxid(struct task_struct *tsk, u32 *ctxid)
149{
150 *ctxid = 0;
151}
152
153static inline int selinux_ctxid_to_string(u32 ctxid, char **ctx, u32 *ctxlen)
154{
155 *ctx = NULL;
156 *ctxlen = 0;
157 return 0;
158}
159
160static inline void selinux_get_inode_sid(const struct inode *inode, u32 *sid)
161{
162 *sid = 0;
163}
164
165static inline void selinux_get_ipc_sid(const struct kern_ipc_perm *ipcp, u32 *sid)
166{
167 *sid = 0;
168}
169
170static inline void selinux_get_task_sid(struct task_struct *tsk, u32 *sid)
171{
172 *sid = 0;
173}
174
175#endif /* CONFIG_SECURITY_SELINUX */
176
177#endif /* _LINUX_SELINUX_H */
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index c32e60e79dea..bd14858121ea 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -254,6 +254,7 @@ struct uart_port {
254#define UPF_CONS_FLOW ((__force upf_t) (1 << 23)) 254#define UPF_CONS_FLOW ((__force upf_t) (1 << 23))
255#define UPF_SHARE_IRQ ((__force upf_t) (1 << 24)) 255#define UPF_SHARE_IRQ ((__force upf_t) (1 << 24))
256#define UPF_BOOT_AUTOCONF ((__force upf_t) (1 << 28)) 256#define UPF_BOOT_AUTOCONF ((__force upf_t) (1 << 28))
257#define UPF_DEAD ((__force upf_t) (1 << 30))
257#define UPF_IOREMAP ((__force upf_t) (1 << 31)) 258#define UPF_IOREMAP ((__force upf_t) (1 << 31))
258 259
259#define UPF_CHANGE_MASK ((__force upf_t) (0x17fff)) 260#define UPF_CHANGE_MASK ((__force upf_t) (0x17fff))
diff --git a/include/linux/signal.h b/include/linux/signal.h
index 162a8fd10b29..70739f51a09f 100644
--- a/include/linux/signal.h
+++ b/include/linux/signal.h
@@ -14,10 +14,12 @@
14 * 14 *
15 * SA_INTERRUPT is also used by the irq handling routines. 15 * SA_INTERRUPT is also used by the irq handling routines.
16 * SA_SHIRQ is for shared interrupt support on PCI and EISA. 16 * SA_SHIRQ is for shared interrupt support on PCI and EISA.
17 * SA_PROBEIRQ is set by callers when they expect sharing mismatches to occur
17 */ 18 */
18#define SA_PROBE SA_ONESHOT
19#define SA_SAMPLE_RANDOM SA_RESTART 19#define SA_SAMPLE_RANDOM SA_RESTART
20#define SA_SHIRQ 0x04000000 20#define SA_SHIRQ 0x04000000
21#define SA_PROBEIRQ 0x08000000
22
21/* 23/*
22 * As above, these correspond to the IORESOURCE_IRQ_* defines in 24 * As above, these correspond to the IORESOURCE_IRQ_* defines in
23 * linux/ioport.h to select the interrupt line behaviour. When 25 * linux/ioport.h to select the interrupt line behaviour. When
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index c4619a428d9b..f8f234708b98 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -344,6 +344,13 @@ extern void skb_over_panic(struct sk_buff *skb, int len,
344 void *here); 344 void *here);
345extern void skb_under_panic(struct sk_buff *skb, int len, 345extern void skb_under_panic(struct sk_buff *skb, int len,
346 void *here); 346 void *here);
347extern void skb_truesize_bug(struct sk_buff *skb);
348
349static inline void skb_truesize_check(struct sk_buff *skb)
350{
351 if (unlikely((int)skb->truesize < sizeof(struct sk_buff) + skb->len))
352 skb_truesize_bug(skb);
353}
347 354
348extern int skb_append_datato_frags(struct sock *sk, struct sk_buff *skb, 355extern int skb_append_datato_frags(struct sock *sk, struct sk_buff *skb,
349 int getfrag(void *from, char *to, int offset, 356 int getfrag(void *from, char *to, int offset,
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 3af03b19c983..2d985d59c7b8 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -150,6 +150,7 @@ static inline void *kcalloc(size_t n, size_t size, gfp_t flags)
150 150
151extern void kfree(const void *); 151extern void kfree(const void *);
152extern unsigned int ksize(const void *); 152extern unsigned int ksize(const void *);
153extern int slab_is_available(void);
153 154
154#ifdef CONFIG_NUMA 155#ifdef CONFIG_NUMA
155extern void *kmem_cache_alloc_node(kmem_cache_t *, gfp_t flags, int node); 156extern void *kmem_cache_alloc_node(kmem_cache_t *, gfp_t flags, int node);
diff --git a/include/linux/spi/ads7846.h b/include/linux/spi/ads7846.h
index 72261e0f2ac1..adb3dafd33e9 100644
--- a/include/linux/spi/ads7846.h
+++ b/include/linux/spi/ads7846.h
@@ -14,5 +14,12 @@ struct ads7846_platform_data {
14 u16 x_min, x_max; 14 u16 x_min, x_max;
15 u16 y_min, y_max; 15 u16 y_min, y_max;
16 u16 pressure_min, pressure_max; 16 u16 pressure_min, pressure_max;
17
18 u16 debounce_max; /* max number of additional readings
19 * per sample */
20 u16 debounce_tol; /* tolerance used for filtering */
21 u16 debounce_rep; /* additional consecutive good readings
22 * required after the first two */
23 int (*get_pendown_state)(void);
17}; 24};
18 25
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
index b05f1463a267..e928c0dcc297 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -31,18 +31,23 @@ extern struct bus_type spi_bus_type;
31 * @master: SPI controller used with the device. 31 * @master: SPI controller used with the device.
32 * @max_speed_hz: Maximum clock rate to be used with this chip 32 * @max_speed_hz: Maximum clock rate to be used with this chip
33 * (on this board); may be changed by the device's driver. 33 * (on this board); may be changed by the device's driver.
34 * The spi_transfer.speed_hz can override this for each transfer.
34 * @chip-select: Chipselect, distinguishing chips handled by "master". 35 * @chip-select: Chipselect, distinguishing chips handled by "master".
35 * @mode: The spi mode defines how data is clocked out and in. 36 * @mode: The spi mode defines how data is clocked out and in.
36 * This may be changed by the device's driver. 37 * This may be changed by the device's driver.
38 * The "active low" default for chipselect mode can be overridden,
39 * as can the "MSB first" default for each word in a transfer.
37 * @bits_per_word: Data transfers involve one or more words; word sizes 40 * @bits_per_word: Data transfers involve one or more words; word sizes
38 * like eight or 12 bits are common. In-memory wordsizes are 41 * like eight or 12 bits are common. In-memory wordsizes are
39 * powers of two bytes (e.g. 20 bit samples use 32 bits). 42 * powers of two bytes (e.g. 20 bit samples use 32 bits).
40 * This may be changed by the device's driver. 43 * This may be changed by the device's driver, or left at the
44 * default (0) indicating protocol words are eight bit bytes.
45 * The spi_transfer.bits_per_word can override this for each transfer.
41 * @irq: Negative, or the number passed to request_irq() to receive 46 * @irq: Negative, or the number passed to request_irq() to receive
42 * interrupts from this device. 47 * interrupts from this device.
43 * @controller_state: Controller's runtime state 48 * @controller_state: Controller's runtime state
44 * @controller_data: Board-specific definitions for controller, such as 49 * @controller_data: Board-specific definitions for controller, such as
45 * FIFO initialization parameters; from board_info.controller_data 50 * FIFO initialization parameters; from board_info.controller_data
46 * 51 *
47 * An spi_device is used to interchange data between an SPI slave 52 * An spi_device is used to interchange data between an SPI slave
48 * (usually a discrete chip) and CPU memory. 53 * (usually a discrete chip) and CPU memory.
@@ -65,6 +70,7 @@ struct spi_device {
65#define SPI_MODE_2 (SPI_CPOL|0) 70#define SPI_MODE_2 (SPI_CPOL|0)
66#define SPI_MODE_3 (SPI_CPOL|SPI_CPHA) 71#define SPI_MODE_3 (SPI_CPOL|SPI_CPHA)
67#define SPI_CS_HIGH 0x04 /* chipselect active high? */ 72#define SPI_CS_HIGH 0x04 /* chipselect active high? */
73#define SPI_LSB_FIRST 0x08 /* per-word bits-on-wire */
68 u8 bits_per_word; 74 u8 bits_per_word;
69 int irq; 75 int irq;
70 void *controller_state; 76 void *controller_state;
@@ -73,7 +79,6 @@ struct spi_device {
73 79
74 // likely need more hooks for more protocol options affecting how 80 // likely need more hooks for more protocol options affecting how
75 // the controller talks to each chip, like: 81 // the controller talks to each chip, like:
76 // - bit order (default is wordwise msb-first)
77 // - memory packing (12 bit samples into low bits, others zeroed) 82 // - memory packing (12 bit samples into low bits, others zeroed)
78 // - priority 83 // - priority
79 // - drop chipselect after each word 84 // - drop chipselect after each word
@@ -143,13 +148,13 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv)
143 * struct spi_master - interface to SPI master controller 148 * struct spi_master - interface to SPI master controller
144 * @cdev: class interface to this driver 149 * @cdev: class interface to this driver
145 * @bus_num: board-specific (and often SOC-specific) identifier for a 150 * @bus_num: board-specific (and often SOC-specific) identifier for a
146 * given SPI controller. 151 * given SPI controller.
147 * @num_chipselect: chipselects are used to distinguish individual 152 * @num_chipselect: chipselects are used to distinguish individual
148 * SPI slaves, and are numbered from zero to num_chipselects. 153 * SPI slaves, and are numbered from zero to num_chipselects.
149 * each slave has a chipselect signal, but it's common that not 154 * each slave has a chipselect signal, but it's common that not
150 * every chipselect is connected to a slave. 155 * every chipselect is connected to a slave.
151 * @setup: updates the device mode and clocking records used by a 156 * @setup: updates the device mode and clocking records used by a
152 * device's SPI controller; protocol code may call this. 157 * device's SPI controller; protocol code may call this.
153 * @transfer: adds a message to the controller's transfer queue. 158 * @transfer: adds a message to the controller's transfer queue.
154 * @cleanup: frees controller-specific state 159 * @cleanup: frees controller-specific state
155 * 160 *
@@ -167,13 +172,13 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv)
167struct spi_master { 172struct spi_master {
168 struct class_device cdev; 173 struct class_device cdev;
169 174
170 /* other than zero (== assign one dynamically), bus_num is fully 175 /* other than negative (== assign one dynamically), bus_num is fully
171 * board-specific. usually that simplifies to being SOC-specific. 176 * board-specific. usually that simplifies to being SOC-specific.
172 * example: one SOC has three SPI controllers, numbered 1..3, 177 * example: one SOC has three SPI controllers, numbered 0..2,
173 * and one board's schematics might show it using SPI-2. software 178 * and one board's schematics might show it using SPI-2. software
174 * would normally use bus_num=2 for that controller. 179 * would normally use bus_num=2 for that controller.
175 */ 180 */
176 u16 bus_num; 181 s16 bus_num;
177 182
178 /* chipselects will be integral to many controllers; some others 183 /* chipselects will be integral to many controllers; some others
179 * might use board-specific GPIOs. 184 * might use board-specific GPIOs.
@@ -268,10 +273,14 @@ extern struct spi_master *spi_busnum_to_master(u16 busnum);
268 * @tx_dma: DMA address of tx_buf, if spi_message.is_dma_mapped 273 * @tx_dma: DMA address of tx_buf, if spi_message.is_dma_mapped
269 * @rx_dma: DMA address of rx_buf, if spi_message.is_dma_mapped 274 * @rx_dma: DMA address of rx_buf, if spi_message.is_dma_mapped
270 * @len: size of rx and tx buffers (in bytes) 275 * @len: size of rx and tx buffers (in bytes)
276 * @speed_hz: Select a speed other then the device default for this
277 * transfer. If 0 the default (from spi_device) is used.
278 * @bits_per_word: select a bits_per_word other then the device default
279 * for this transfer. If 0 the default (from spi_device) is used.
271 * @cs_change: affects chipselect after this transfer completes 280 * @cs_change: affects chipselect after this transfer completes
272 * @delay_usecs: microseconds to delay after this transfer before 281 * @delay_usecs: microseconds to delay after this transfer before
273 * (optionally) changing the chipselect status, then starting 282 * (optionally) changing the chipselect status, then starting
274 * the next transfer or completing this spi_message. 283 * the next transfer or completing this spi_message.
275 * @transfer_list: transfers are sequenced through spi_message.transfers 284 * @transfer_list: transfers are sequenced through spi_message.transfers
276 * 285 *
277 * SPI transfers always write the same number of bytes as they read. 286 * SPI transfers always write the same number of bytes as they read.
@@ -322,7 +331,9 @@ struct spi_transfer {
322 dma_addr_t rx_dma; 331 dma_addr_t rx_dma;
323 332
324 unsigned cs_change:1; 333 unsigned cs_change:1;
334 u8 bits_per_word;
325 u16 delay_usecs; 335 u16 delay_usecs;
336 u32 speed_hz;
326 337
327 struct list_head transfer_list; 338 struct list_head transfer_list;
328}; 339};
@@ -356,7 +367,7 @@ struct spi_transfer {
356 * and its transfers, ignore them until its completion callback. 367 * and its transfers, ignore them until its completion callback.
357 */ 368 */
358struct spi_message { 369struct spi_message {
359 struct list_head transfers; 370 struct list_head transfers;
360 371
361 struct spi_device *spi; 372 struct spi_device *spi;
362 373
@@ -374,7 +385,7 @@ struct spi_message {
374 */ 385 */
375 386
376 /* completion is reported through a callback */ 387 /* completion is reported through a callback */
377 void (*complete)(void *context); 388 void (*complete)(void *context);
378 void *context; 389 void *context;
379 unsigned actual_length; 390 unsigned actual_length;
380 int status; 391 int status;
diff --git a/include/linux/spi/spi_bitbang.h b/include/linux/spi/spi_bitbang.h
index c961fe9bf3eb..16ce178f54d7 100644
--- a/include/linux/spi/spi_bitbang.h
+++ b/include/linux/spi/spi_bitbang.h
@@ -30,6 +30,12 @@ struct spi_bitbang {
30 30
31 struct spi_master *master; 31 struct spi_master *master;
32 32
33 /* setup_transfer() changes clock and/or wordsize to match settings
34 * for this transfer; zeroes restore defaults from spi_device.
35 */
36 int (*setup_transfer)(struct spi_device *spi,
37 struct spi_transfer *t);
38
33 void (*chipselect)(struct spi_device *spi, int is_on); 39 void (*chipselect)(struct spi_device *spi, int is_on);
34#define BITBANG_CS_ACTIVE 1 /* normally nCS, active low */ 40#define BITBANG_CS_ACTIVE 1 /* normally nCS, active low */
35#define BITBANG_CS_INACTIVE 0 41#define BITBANG_CS_INACTIVE 0
@@ -51,6 +57,8 @@ struct spi_bitbang {
51extern int spi_bitbang_setup(struct spi_device *spi); 57extern int spi_bitbang_setup(struct spi_device *spi);
52extern void spi_bitbang_cleanup(const struct spi_device *spi); 58extern void spi_bitbang_cleanup(const struct spi_device *spi);
53extern int spi_bitbang_transfer(struct spi_device *spi, struct spi_message *m); 59extern int spi_bitbang_transfer(struct spi_device *spi, struct spi_message *m);
60extern int spi_bitbang_setup_transfer(struct spi_device *spi,
61 struct spi_transfer *t);
54 62
55/* start or stop queue processing */ 63/* start or stop queue processing */
56extern int spi_bitbang_start(struct spi_bitbang *spi); 64extern int spi_bitbang_start(struct spi_bitbang *spi);
diff --git a/include/linux/sunrpc/metrics.h b/include/linux/sunrpc/metrics.h
index 8f96e9dc369a..77f78e56c481 100644
--- a/include/linux/sunrpc/metrics.h
+++ b/include/linux/sunrpc/metrics.h
@@ -69,9 +69,21 @@ struct rpc_clnt;
69/* 69/*
70 * EXPORTed functions for managing rpc_iostats structures 70 * EXPORTed functions for managing rpc_iostats structures
71 */ 71 */
72
73#ifdef CONFIG_PROC_FS
74
72struct rpc_iostats * rpc_alloc_iostats(struct rpc_clnt *); 75struct rpc_iostats * rpc_alloc_iostats(struct rpc_clnt *);
73void rpc_count_iostats(struct rpc_task *); 76void rpc_count_iostats(struct rpc_task *);
74void rpc_print_iostats(struct seq_file *, struct rpc_clnt *); 77void rpc_print_iostats(struct seq_file *, struct rpc_clnt *);
75void rpc_free_iostats(struct rpc_iostats *); 78void rpc_free_iostats(struct rpc_iostats *);
76 79
80#else /* CONFIG_PROC_FS */
81
82static inline struct rpc_iostats *rpc_alloc_iostats(struct rpc_clnt *clnt) { return NULL; }
83static inline void rpc_count_iostats(struct rpc_task *task) {}
84static inline void rpc_print_iostats(struct seq_file *seq, struct rpc_clnt *clnt) {}
85static inline void rpc_free_iostats(struct rpc_iostats *stats) {}
86
87#endif /* CONFIG_PROC_FS */
88
77#endif /* _LINUX_SUNRPC_METRICS_H */ 89#endif /* _LINUX_SUNRPC_METRICS_H */
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
index 7eebbab7160b..e8bbe8118de8 100644
--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -53,6 +53,7 @@ struct rpc_timeout {
53 53
54struct rpc_task; 54struct rpc_task;
55struct rpc_xprt; 55struct rpc_xprt;
56struct seq_file;
56 57
57/* 58/*
58 * This describes a complete RPC request 59 * This describes a complete RPC request
diff --git a/include/linux/swap.h b/include/linux/swap.h
index 5b1fdf1cff4f..f03c24719302 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -296,7 +296,7 @@ static inline void disable_swap_token(void)
296#define read_swap_cache_async(swp,vma,addr) NULL 296#define read_swap_cache_async(swp,vma,addr) NULL
297#define lookup_swap_cache(swp) NULL 297#define lookup_swap_cache(swp) NULL
298#define valid_swaphandles(swp, off) 0 298#define valid_swaphandles(swp, off) 0
299#define can_share_swap_page(p) 0 299#define can_share_swap_page(p) (page_mapcount(p) == 1)
300#define move_to_swap_cache(p, swp) 1 300#define move_to_swap_cache(p, swp) 1
301#define move_from_swap_cache(p, i, m) 1 301#define move_from_swap_cache(p, i, m) 1
302#define __delete_from_swap_cache(p) /*NOTHING*/ 302#define __delete_from_swap_cache(p) /*NOTHING*/
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index f001bad28d9a..60d49e5456e7 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -52,6 +52,7 @@ struct utimbuf;
52struct mq_attr; 52struct mq_attr;
53struct compat_stat; 53struct compat_stat;
54struct compat_timeval; 54struct compat_timeval;
55struct robust_list_head;
55 56
56#include <linux/config.h> 57#include <linux/config.h>
57#include <linux/types.h> 58#include <linux/types.h>
@@ -574,7 +575,17 @@ asmlinkage long sys_splice(int fd_in, loff_t __user *off_in,
574 int fd_out, loff_t __user *off_out, 575 int fd_out, loff_t __user *off_out,
575 size_t len, unsigned int flags); 576 size_t len, unsigned int flags);
576 577
578asmlinkage long sys_vmsplice(int fd, const struct iovec __user *iov,
579 unsigned long nr_segs, unsigned int flags);
580
581asmlinkage long sys_tee(int fdin, int fdout, size_t len, unsigned int flags);
582
577asmlinkage long sys_sync_file_range(int fd, loff_t offset, loff_t nbytes, 583asmlinkage long sys_sync_file_range(int fd, loff_t offset, loff_t nbytes,
578 unsigned int flags); 584 unsigned int flags);
585asmlinkage long sys_get_robust_list(int pid,
586 struct robust_list_head __user **head_ptr,
587 size_t __user *len_ptr);
588asmlinkage long sys_set_robust_list(struct robust_list_head __user *head,
589 size_t len);
579 590
580#endif 591#endif
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index 392da5a6dacb..1ea5d3cda6ae 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -74,6 +74,7 @@ struct sysfs_dirent {
74 umode_t s_mode; 74 umode_t s_mode;
75 struct dentry * s_dentry; 75 struct dentry * s_dentry;
76 struct iattr * s_iattr; 76 struct iattr * s_iattr;
77 atomic_t s_event;
77}; 78};
78 79
79#define SYSFS_ROOT 0x0001 80#define SYSFS_ROOT 0x0001
@@ -117,6 +118,7 @@ int sysfs_remove_bin_file(struct kobject * kobj, struct bin_attribute * attr);
117 118
118int sysfs_create_group(struct kobject *, const struct attribute_group *); 119int sysfs_create_group(struct kobject *, const struct attribute_group *);
119void sysfs_remove_group(struct kobject *, const struct attribute_group *); 120void sysfs_remove_group(struct kobject *, const struct attribute_group *);
121void sysfs_notify(struct kobject * k, char *dir, char *attr);
120 122
121#else /* CONFIG_SYSFS */ 123#else /* CONFIG_SYSFS */
122 124
@@ -185,6 +187,10 @@ static inline void sysfs_remove_group(struct kobject * k, const struct attribute
185 ; 187 ;
186} 188}
187 189
190static inline void sysfs_notify(struct kobject * k, char *dir, char *attr)
191{
192}
193
188#endif /* CONFIG_SYSFS */ 194#endif /* CONFIG_SYSFS */
189 195
190#endif /* _SYSFS_H_ */ 196#endif /* _SYSFS_H_ */
diff --git a/include/linux/usb/net2280.h b/include/linux/usb/net2280.h
new file mode 100644
index 000000000000..c602f884f182
--- /dev/null
+++ b/include/linux/usb/net2280.h
@@ -0,0 +1,444 @@
1/*
2 * NetChip 2280 high/full speed USB device controller.
3 * Unlike many such controllers, this one talks PCI.
4 */
5#ifndef __LINUX_USB_NET2280_H
6#define __LINUX_USB_NET2280_H
7
8/*
9 * Copyright (C) 2002 NetChip Technology, Inc. (http://www.netchip.com)
10 * Copyright (C) 2003 David Brownell
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 */
26
27/*-------------------------------------------------------------------------*/
28
29/* NET2280 MEMORY MAPPED REGISTERS
30 *
31 * The register layout came from the chip documentation, and the bit
32 * number definitions were extracted from chip specification.
33 *
34 * Use the shift operator ('<<') to build bit masks, with readl/writel
35 * to access the registers through PCI.
36 */
37
38/* main registers, BAR0 + 0x0000 */
39struct net2280_regs {
40 // offset 0x0000
41 u32 devinit;
42#define LOCAL_CLOCK_FREQUENCY 8
43#define FORCE_PCI_RESET 7
44#define PCI_ID 6
45#define PCI_ENABLE 5
46#define FIFO_SOFT_RESET 4
47#define CFG_SOFT_RESET 3
48#define PCI_SOFT_RESET 2
49#define USB_SOFT_RESET 1
50#define M8051_RESET 0
51 u32 eectl;
52#define EEPROM_ADDRESS_WIDTH 23
53#define EEPROM_CHIP_SELECT_ACTIVE 22
54#define EEPROM_PRESENT 21
55#define EEPROM_VALID 20
56#define EEPROM_BUSY 19
57#define EEPROM_CHIP_SELECT_ENABLE 18
58#define EEPROM_BYTE_READ_START 17
59#define EEPROM_BYTE_WRITE_START 16
60#define EEPROM_READ_DATA 8
61#define EEPROM_WRITE_DATA 0
62 u32 eeclkfreq;
63 u32 _unused0;
64 // offset 0x0010
65
66 u32 pciirqenb0; /* interrupt PCI master ... */
67#define SETUP_PACKET_INTERRUPT_ENABLE 7
68#define ENDPOINT_F_INTERRUPT_ENABLE 6
69#define ENDPOINT_E_INTERRUPT_ENABLE 5
70#define ENDPOINT_D_INTERRUPT_ENABLE 4
71#define ENDPOINT_C_INTERRUPT_ENABLE 3
72#define ENDPOINT_B_INTERRUPT_ENABLE 2
73#define ENDPOINT_A_INTERRUPT_ENABLE 1
74#define ENDPOINT_0_INTERRUPT_ENABLE 0
75 u32 pciirqenb1;
76#define PCI_INTERRUPT_ENABLE 31
77#define POWER_STATE_CHANGE_INTERRUPT_ENABLE 27
78#define PCI_ARBITER_TIMEOUT_INTERRUPT_ENABLE 26
79#define PCI_PARITY_ERROR_INTERRUPT_ENABLE 25
80#define PCI_MASTER_ABORT_RECEIVED_INTERRUPT_ENABLE 20
81#define PCI_TARGET_ABORT_RECEIVED_INTERRUPT_ENABLE 19
82#define PCI_TARGET_ABORT_ASSERTED_INTERRUPT_ENABLE 18
83#define PCI_RETRY_ABORT_INTERRUPT_ENABLE 17
84#define PCI_MASTER_CYCLE_DONE_INTERRUPT_ENABLE 16
85#define GPIO_INTERRUPT_ENABLE 13
86#define DMA_D_INTERRUPT_ENABLE 12
87#define DMA_C_INTERRUPT_ENABLE 11
88#define DMA_B_INTERRUPT_ENABLE 10
89#define DMA_A_INTERRUPT_ENABLE 9
90#define EEPROM_DONE_INTERRUPT_ENABLE 8
91#define VBUS_INTERRUPT_ENABLE 7
92#define CONTROL_STATUS_INTERRUPT_ENABLE 6
93#define ROOT_PORT_RESET_INTERRUPT_ENABLE 4
94#define SUSPEND_REQUEST_INTERRUPT_ENABLE 3
95#define SUSPEND_REQUEST_CHANGE_INTERRUPT_ENABLE 2
96#define RESUME_INTERRUPT_ENABLE 1
97#define SOF_INTERRUPT_ENABLE 0
98 u32 cpu_irqenb0; /* ... or onboard 8051 */
99#define SETUP_PACKET_INTERRUPT_ENABLE 7
100#define ENDPOINT_F_INTERRUPT_ENABLE 6
101#define ENDPOINT_E_INTERRUPT_ENABLE 5
102#define ENDPOINT_D_INTERRUPT_ENABLE 4
103#define ENDPOINT_C_INTERRUPT_ENABLE 3
104#define ENDPOINT_B_INTERRUPT_ENABLE 2
105#define ENDPOINT_A_INTERRUPT_ENABLE 1
106#define ENDPOINT_0_INTERRUPT_ENABLE 0
107 u32 cpu_irqenb1;
108#define CPU_INTERRUPT_ENABLE 31
109#define POWER_STATE_CHANGE_INTERRUPT_ENABLE 27
110#define PCI_ARBITER_TIMEOUT_INTERRUPT_ENABLE 26
111#define PCI_PARITY_ERROR_INTERRUPT_ENABLE 25
112#define PCI_INTA_INTERRUPT_ENABLE 24
113#define PCI_PME_INTERRUPT_ENABLE 23
114#define PCI_SERR_INTERRUPT_ENABLE 22
115#define PCI_PERR_INTERRUPT_ENABLE 21
116#define PCI_MASTER_ABORT_RECEIVED_INTERRUPT_ENABLE 20
117#define PCI_TARGET_ABORT_RECEIVED_INTERRUPT_ENABLE 19
118#define PCI_RETRY_ABORT_INTERRUPT_ENABLE 17
119#define PCI_MASTER_CYCLE_DONE_INTERRUPT_ENABLE 16
120#define GPIO_INTERRUPT_ENABLE 13
121#define DMA_D_INTERRUPT_ENABLE 12
122#define DMA_C_INTERRUPT_ENABLE 11
123#define DMA_B_INTERRUPT_ENABLE 10
124#define DMA_A_INTERRUPT_ENABLE 9
125#define EEPROM_DONE_INTERRUPT_ENABLE 8
126#define VBUS_INTERRUPT_ENABLE 7
127#define CONTROL_STATUS_INTERRUPT_ENABLE 6
128#define ROOT_PORT_RESET_INTERRUPT_ENABLE 4
129#define SUSPEND_REQUEST_INTERRUPT_ENABLE 3
130#define SUSPEND_REQUEST_CHANGE_INTERRUPT_ENABLE 2
131#define RESUME_INTERRUPT_ENABLE 1
132#define SOF_INTERRUPT_ENABLE 0
133
134 // offset 0x0020
135 u32 _unused1;
136 u32 usbirqenb1;
137#define USB_INTERRUPT_ENABLE 31
138#define POWER_STATE_CHANGE_INTERRUPT_ENABLE 27
139#define PCI_ARBITER_TIMEOUT_INTERRUPT_ENABLE 26
140#define PCI_PARITY_ERROR_INTERRUPT_ENABLE 25
141#define PCI_INTA_INTERRUPT_ENABLE 24
142#define PCI_PME_INTERRUPT_ENABLE 23
143#define PCI_SERR_INTERRUPT_ENABLE 22
144#define PCI_PERR_INTERRUPT_ENABLE 21
145#define PCI_MASTER_ABORT_RECEIVED_INTERRUPT_ENABLE 20
146#define PCI_TARGET_ABORT_RECEIVED_INTERRUPT_ENABLE 19
147#define PCI_RETRY_ABORT_INTERRUPT_ENABLE 17
148#define PCI_MASTER_CYCLE_DONE_INTERRUPT_ENABLE 16
149#define GPIO_INTERRUPT_ENABLE 13
150#define DMA_D_INTERRUPT_ENABLE 12
151#define DMA_C_INTERRUPT_ENABLE 11
152#define DMA_B_INTERRUPT_ENABLE 10
153#define DMA_A_INTERRUPT_ENABLE 9
154#define EEPROM_DONE_INTERRUPT_ENABLE 8
155#define VBUS_INTERRUPT_ENABLE 7
156#define CONTROL_STATUS_INTERRUPT_ENABLE 6
157#define ROOT_PORT_RESET_INTERRUPT_ENABLE 4
158#define SUSPEND_REQUEST_INTERRUPT_ENABLE 3
159#define SUSPEND_REQUEST_CHANGE_INTERRUPT_ENABLE 2
160#define RESUME_INTERRUPT_ENABLE 1
161#define SOF_INTERRUPT_ENABLE 0
162 u32 irqstat0;
163#define INTA_ASSERTED 12
164#define SETUP_PACKET_INTERRUPT 7
165#define ENDPOINT_F_INTERRUPT 6
166#define ENDPOINT_E_INTERRUPT 5
167#define ENDPOINT_D_INTERRUPT 4
168#define ENDPOINT_C_INTERRUPT 3
169#define ENDPOINT_B_INTERRUPT 2
170#define ENDPOINT_A_INTERRUPT 1
171#define ENDPOINT_0_INTERRUPT 0
172 u32 irqstat1;
173#define POWER_STATE_CHANGE_INTERRUPT 27
174#define PCI_ARBITER_TIMEOUT_INTERRUPT 26
175#define PCI_PARITY_ERROR_INTERRUPT 25
176#define PCI_INTA_INTERRUPT 24
177#define PCI_PME_INTERRUPT 23
178#define PCI_SERR_INTERRUPT 22
179#define PCI_PERR_INTERRUPT 21
180#define PCI_MASTER_ABORT_RECEIVED_INTERRUPT 20
181#define PCI_TARGET_ABORT_RECEIVED_INTERRUPT 19
182#define PCI_RETRY_ABORT_INTERRUPT 17
183#define PCI_MASTER_CYCLE_DONE_INTERRUPT 16
184#define SOF_DOWN_INTERRUPT 14
185#define GPIO_INTERRUPT 13
186#define DMA_D_INTERRUPT 12
187#define DMA_C_INTERRUPT 11
188#define DMA_B_INTERRUPT 10
189#define DMA_A_INTERRUPT 9
190#define EEPROM_DONE_INTERRUPT 8
191#define VBUS_INTERRUPT 7
192#define CONTROL_STATUS_INTERRUPT 6
193#define ROOT_PORT_RESET_INTERRUPT 4
194#define SUSPEND_REQUEST_INTERRUPT 3
195#define SUSPEND_REQUEST_CHANGE_INTERRUPT 2
196#define RESUME_INTERRUPT 1
197#define SOF_INTERRUPT 0
198 // offset 0x0030
199 u32 idxaddr;
200 u32 idxdata;
201 u32 fifoctl;
202#define PCI_BASE2_RANGE 16
203#define IGNORE_FIFO_AVAILABILITY 3
204#define PCI_BASE2_SELECT 2
205#define FIFO_CONFIGURATION_SELECT 0
206 u32 _unused2;
207 // offset 0x0040
208 u32 memaddr;
209#define START 28
210#define DIRECTION 27
211#define FIFO_DIAGNOSTIC_SELECT 24
212#define MEMORY_ADDRESS 0
213 u32 memdata0;
214 u32 memdata1;
215 u32 _unused3;
216 // offset 0x0050
217 u32 gpioctl;
218#define GPIO3_LED_SELECT 12
219#define GPIO3_INTERRUPT_ENABLE 11
220#define GPIO2_INTERRUPT_ENABLE 10
221#define GPIO1_INTERRUPT_ENABLE 9
222#define GPIO0_INTERRUPT_ENABLE 8
223#define GPIO3_OUTPUT_ENABLE 7
224#define GPIO2_OUTPUT_ENABLE 6
225#define GPIO1_OUTPUT_ENABLE 5
226#define GPIO0_OUTPUT_ENABLE 4
227#define GPIO3_DATA 3
228#define GPIO2_DATA 2
229#define GPIO1_DATA 1
230#define GPIO0_DATA 0
231 u32 gpiostat;
232#define GPIO3_INTERRUPT 3
233#define GPIO2_INTERRUPT 2
234#define GPIO1_INTERRUPT 1
235#define GPIO0_INTERRUPT 0
236} __attribute__ ((packed));
237
238/* usb control, BAR0 + 0x0080 */
239struct net2280_usb_regs {
240 // offset 0x0080
241 u32 stdrsp;
242#define STALL_UNSUPPORTED_REQUESTS 31
243#define SET_TEST_MODE 16
244#define GET_OTHER_SPEED_CONFIGURATION 15
245#define GET_DEVICE_QUALIFIER 14
246#define SET_ADDRESS 13
247#define ENDPOINT_SET_CLEAR_HALT 12
248#define DEVICE_SET_CLEAR_DEVICE_REMOTE_WAKEUP 11
249#define GET_STRING_DESCRIPTOR_2 10
250#define GET_STRING_DESCRIPTOR_1 9
251#define GET_STRING_DESCRIPTOR_0 8
252#define GET_SET_INTERFACE 6
253#define GET_SET_CONFIGURATION 5
254#define GET_CONFIGURATION_DESCRIPTOR 4
255#define GET_DEVICE_DESCRIPTOR 3
256#define GET_ENDPOINT_STATUS 2
257#define GET_INTERFACE_STATUS 1
258#define GET_DEVICE_STATUS 0
259 u32 prodvendid;
260#define PRODUCT_ID 16
261#define VENDOR_ID 0
262 u32 relnum;
263 u32 usbctl;
264#define SERIAL_NUMBER_INDEX 16
265#define PRODUCT_ID_STRING_ENABLE 13
266#define VENDOR_ID_STRING_ENABLE 12
267#define USB_ROOT_PORT_WAKEUP_ENABLE 11
268#define VBUS_PIN 10
269#define TIMED_DISCONNECT 9
270#define SUSPEND_IMMEDIATELY 7
271#define SELF_POWERED_USB_DEVICE 6
272#define REMOTE_WAKEUP_SUPPORT 5
273#define PME_POLARITY 4
274#define USB_DETECT_ENABLE 3
275#define PME_WAKEUP_ENABLE 2
276#define DEVICE_REMOTE_WAKEUP_ENABLE 1
277#define SELF_POWERED_STATUS 0
278 // offset 0x0090
279 u32 usbstat;
280#define HIGH_SPEED 7
281#define FULL_SPEED 6
282#define GENERATE_RESUME 5
283#define GENERATE_DEVICE_REMOTE_WAKEUP 4
284 u32 xcvrdiag;
285#define FORCE_HIGH_SPEED_MODE 31
286#define FORCE_FULL_SPEED_MODE 30
287#define USB_TEST_MODE 24
288#define LINE_STATE 16
289#define TRANSCEIVER_OPERATION_MODE 2
290#define TRANSCEIVER_SELECT 1
291#define TERMINATION_SELECT 0
292 u32 setup0123;
293 u32 setup4567;
294 // offset 0x0090
295 u32 _unused0;
296 u32 ouraddr;
297#define FORCE_IMMEDIATE 7
298#define OUR_USB_ADDRESS 0
299 u32 ourconfig;
300} __attribute__ ((packed));
301
302/* pci control, BAR0 + 0x0100 */
303struct net2280_pci_regs {
304 // offset 0x0100
305 u32 pcimstctl;
306#define PCI_ARBITER_PARK_SELECT 13
307#define PCI_MULTI LEVEL_ARBITER 12
308#define PCI_RETRY_ABORT_ENABLE 11
309#define DMA_MEMORY_WRITE_AND_INVALIDATE_ENABLE 10
310#define DMA_READ_MULTIPLE_ENABLE 9
311#define DMA_READ_LINE_ENABLE 8
312#define PCI_MASTER_COMMAND_SELECT 6
313#define MEM_READ_OR_WRITE 0
314#define IO_READ_OR_WRITE 1
315#define CFG_READ_OR_WRITE 2
316#define PCI_MASTER_START 5
317#define PCI_MASTER_READ_WRITE 4
318#define PCI_MASTER_WRITE 0
319#define PCI_MASTER_READ 1
320#define PCI_MASTER_BYTE_WRITE_ENABLES 0
321 u32 pcimstaddr;
322 u32 pcimstdata;
323 u32 pcimststat;
324#define PCI_ARBITER_CLEAR 2
325#define PCI_EXTERNAL_ARBITER 1
326#define PCI_HOST_MODE 0
327} __attribute__ ((packed));
328
329/* dma control, BAR0 + 0x0180 ... array of four structs like this,
330 * for channels 0..3. see also struct net2280_dma: descriptor
331 * that can be loaded into some of these registers.
332 */
333struct net2280_dma_regs { /* [11.7] */
334 // offset 0x0180, 0x01a0, 0x01c0, 0x01e0,
335 u32 dmactl;
336#define DMA_SCATTER_GATHER_DONE_INTERRUPT_ENABLE 25
337#define DMA_CLEAR_COUNT_ENABLE 21
338#define DESCRIPTOR_POLLING_RATE 19
339#define POLL_CONTINUOUS 0
340#define POLL_1_USEC 1
341#define POLL_100_USEC 2
342#define POLL_1_MSEC 3
343#define DMA_VALID_BIT_POLLING_ENABLE 18
344#define DMA_VALID_BIT_ENABLE 17
345#define DMA_SCATTER_GATHER_ENABLE 16
346#define DMA_OUT_AUTO_START_ENABLE 4
347#define DMA_PREEMPT_ENABLE 3
348#define DMA_FIFO_VALIDATE 2
349#define DMA_ENABLE 1
350#define DMA_ADDRESS_HOLD 0
351 u32 dmastat;
352#define DMA_ABORT_DONE_INTERRUPT 27
353#define DMA_SCATTER_GATHER_DONE_INTERRUPT 25
354#define DMA_TRANSACTION_DONE_INTERRUPT 24
355#define DMA_ABORT 1
356#define DMA_START 0
357 u32 _unused0 [2];
358 // offset 0x0190, 0x01b0, 0x01d0, 0x01f0,
359 u32 dmacount;
360#define VALID_BIT 31
361#define DMA_DIRECTION 30
362#define DMA_DONE_INTERRUPT_ENABLE 29
363#define END_OF_CHAIN 28
364#define DMA_BYTE_COUNT_MASK ((1<<24)-1)
365#define DMA_BYTE_COUNT 0
366 u32 dmaaddr;
367 u32 dmadesc;
368 u32 _unused1;
369} __attribute__ ((packed));
370
371/* dedicated endpoint registers, BAR0 + 0x0200 */
372
373struct net2280_dep_regs { /* [11.8] */
374 // offset 0x0200, 0x0210, 0x220, 0x230, 0x240
375 u32 dep_cfg;
376 // offset 0x0204, 0x0214, 0x224, 0x234, 0x244
377 u32 dep_rsp;
378 u32 _unused [2];
379} __attribute__ ((packed));
380
381/* configurable endpoint registers, BAR0 + 0x0300 ... array of seven structs
382 * like this, for ep0 then the configurable endpoints A..F
383 * ep0 reserved for control; E and F have only 64 bytes of fifo
384 */
385struct net2280_ep_regs { /* [11.9] */
386 // offset 0x0300, 0x0320, 0x0340, 0x0360, 0x0380, 0x03a0, 0x03c0
387 u32 ep_cfg;
388#define ENDPOINT_BYTE_COUNT 16
389#define ENDPOINT_ENABLE 10
390#define ENDPOINT_TYPE 8
391#define ENDPOINT_DIRECTION 7
392#define ENDPOINT_NUMBER 0
393 u32 ep_rsp;
394#define SET_NAK_OUT_PACKETS 15
395#define SET_EP_HIDE_STATUS_PHASE 14
396#define SET_EP_FORCE_CRC_ERROR 13
397#define SET_INTERRUPT_MODE 12
398#define SET_CONTROL_STATUS_PHASE_HANDSHAKE 11
399#define SET_NAK_OUT_PACKETS_MODE 10
400#define SET_ENDPOINT_TOGGLE 9
401#define SET_ENDPOINT_HALT 8
402#define CLEAR_NAK_OUT_PACKETS 7
403#define CLEAR_EP_HIDE_STATUS_PHASE 6
404#define CLEAR_EP_FORCE_CRC_ERROR 5
405#define CLEAR_INTERRUPT_MODE 4
406#define CLEAR_CONTROL_STATUS_PHASE_HANDSHAKE 3
407#define CLEAR_NAK_OUT_PACKETS_MODE 2
408#define CLEAR_ENDPOINT_TOGGLE 1
409#define CLEAR_ENDPOINT_HALT 0
410 u32 ep_irqenb;
411#define SHORT_PACKET_OUT_DONE_INTERRUPT_ENABLE 6
412#define SHORT_PACKET_TRANSFERRED_INTERRUPT_ENABLE 5
413#define DATA_PACKET_RECEIVED_INTERRUPT_ENABLE 3
414#define DATA_PACKET_TRANSMITTED_INTERRUPT_ENABLE 2
415#define DATA_OUT_PING_TOKEN_INTERRUPT_ENABLE 1
416#define DATA_IN_TOKEN_INTERRUPT_ENABLE 0
417 u32 ep_stat;
418#define FIFO_VALID_COUNT 24
419#define HIGH_BANDWIDTH_OUT_TRANSACTION_PID 22
420#define TIMEOUT 21
421#define USB_STALL_SENT 20
422#define USB_IN_NAK_SENT 19
423#define USB_IN_ACK_RCVD 18
424#define USB_OUT_PING_NAK_SENT 17
425#define USB_OUT_ACK_SENT 16
426#define FIFO_OVERFLOW 13
427#define FIFO_UNDERFLOW 12
428#define FIFO_FULL 11
429#define FIFO_EMPTY 10
430#define FIFO_FLUSH 9
431#define SHORT_PACKET_OUT_DONE_INTERRUPT 6
432#define SHORT_PACKET_TRANSFERRED_INTERRUPT 5
433#define NAK_OUT_PACKETS 4
434#define DATA_PACKET_RECEIVED_INTERRUPT 3
435#define DATA_PACKET_TRANSMITTED_INTERRUPT 2
436#define DATA_OUT_PING_TOKEN_INTERRUPT 1
437#define DATA_IN_TOKEN_INTERRUPT 0
438 // offset 0x0310, 0x0330, 0x0350, 0x0370, 0x0390, 0x03b0, 0x03d0
439 u32 ep_avail;
440 u32 ep_data;
441 u32 _unused0 [2];
442} __attribute__ ((packed));
443
444#endif /* __LINUX_USB_NET2280_H */
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index d7670ec1ec1e..ad7fa9c86c10 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -1141,8 +1141,13 @@ extern char *v4l2_type_names[];
1141/* Compatibility layer interface -- v4l1-compat module */ 1141/* Compatibility layer interface -- v4l1-compat module */
1142typedef int (*v4l2_kioctl)(struct inode *inode, struct file *file, 1142typedef int (*v4l2_kioctl)(struct inode *inode, struct file *file,
1143 unsigned int cmd, void *arg); 1143 unsigned int cmd, void *arg);
1144
1145#ifdef CONFIG_VIDEO_V4L1_COMPAT
1144int v4l_compat_translate_ioctl(struct inode *inode, struct file *file, 1146int v4l_compat_translate_ioctl(struct inode *inode, struct file *file,
1145 int cmd, void *arg, v4l2_kioctl driver_ioctl); 1147 int cmd, void *arg, v4l2_kioctl driver_ioctl);
1148#else
1149#define v4l_compat_translate_ioctl(inode,file,cmd,arg,ioctl) -EINVAL
1150#endif
1146 1151
1147/* 32 Bits compatibility layer for 64 bits processors */ 1152/* 32 Bits compatibility layer for 64 bits processors */
1148extern long v4l_compat_ioctl32(struct file *file, unsigned int cmd, 1153extern long v4l_compat_ioctl32(struct file *file, unsigned int cmd,
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h
index 530ae3f4248c..fab5aed8ca31 100644
--- a/include/linux/vt_kern.h
+++ b/include/linux/vt_kern.h
@@ -73,11 +73,6 @@ int con_copy_unimap(struct vc_data *dst_vc, struct vc_data *src_vc);
73int vt_waitactive(int vt); 73int vt_waitactive(int vt);
74void change_console(struct vc_data *new_vc); 74void change_console(struct vc_data *new_vc);
75void reset_vc(struct vc_data *vc); 75void reset_vc(struct vc_data *vc);
76#ifdef CONFIG_VT
77int is_console_suspend_safe(void);
78#else
79static inline int is_console_suspend_safe(void) { return 1; }
80#endif
81 76
82/* 77/*
83 * vc_screen.c shares this temporary buffer with the console write code so that 78 * vc_screen.c shares this temporary buffer with the console write code so that
diff --git a/include/net/arp.h b/include/net/arp.h
index a13e30c35f42..643bded9f557 100644
--- a/include/net/arp.h
+++ b/include/net/arp.h
@@ -10,8 +10,6 @@
10extern struct neigh_table arp_tbl; 10extern struct neigh_table arp_tbl;
11 11
12extern void arp_init(void); 12extern void arp_init(void);
13extern int arp_rcv(struct sk_buff *skb, struct net_device *dev,
14 struct packet_type *pt, struct net_device *orig_dev);
15extern int arp_find(unsigned char *haddr, struct sk_buff *skb); 13extern int arp_find(unsigned char *haddr, struct sk_buff *skb);
16extern int arp_ioctl(unsigned int cmd, void __user *arg); 14extern int arp_ioctl(unsigned int cmd, void __user *arg);
17extern void arp_send(int type, int ptype, u32 dest_ip, 15extern void arp_send(int type, int ptype, u32 dest_ip,
diff --git a/include/net/ax25.h b/include/net/ax25.h
index d052b221dbcd..5bd997487054 100644
--- a/include/net/ax25.h
+++ b/include/net/ax25.h
@@ -145,14 +145,14 @@ enum {
145#define AX25_DEF_CONMODE 2 /* Connected mode allowed */ 145#define AX25_DEF_CONMODE 2 /* Connected mode allowed */
146#define AX25_DEF_WINDOW 2 /* Window=2 */ 146#define AX25_DEF_WINDOW 2 /* Window=2 */
147#define AX25_DEF_EWINDOW 32 /* Module-128 Window=32 */ 147#define AX25_DEF_EWINDOW 32 /* Module-128 Window=32 */
148#define AX25_DEF_T1 (10 * HZ) /* T1=10s */ 148#define AX25_DEF_T1 10000 /* T1=10s */
149#define AX25_DEF_T2 (3 * HZ) /* T2=3s */ 149#define AX25_DEF_T2 3000 /* T2=3s */
150#define AX25_DEF_T3 (300 * HZ) /* T3=300s */ 150#define AX25_DEF_T3 300000 /* T3=300s */
151#define AX25_DEF_N2 10 /* N2=10 */ 151#define AX25_DEF_N2 10 /* N2=10 */
152#define AX25_DEF_IDLE (0 * 60 * HZ) /* Idle=None */ 152#define AX25_DEF_IDLE 0 /* Idle=None */
153#define AX25_DEF_PACLEN 256 /* Paclen=256 */ 153#define AX25_DEF_PACLEN 256 /* Paclen=256 */
154#define AX25_DEF_PROTOCOL AX25_PROTO_STD_SIMPLEX /* Standard AX.25 */ 154#define AX25_DEF_PROTOCOL AX25_PROTO_STD_SIMPLEX /* Standard AX.25 */
155#define AX25_DEF_DS_TIMEOUT (3 * 60 * HZ) /* DAMA timeout 3 minutes */ 155#define AX25_DEF_DS_TIMEOUT 180000 /* DAMA timeout 3 minutes */
156 156
157typedef struct ax25_uid_assoc { 157typedef struct ax25_uid_assoc {
158 struct hlist_node uid_node; 158 struct hlist_node uid_node;
diff --git a/include/net/compat.h b/include/net/compat.h
index 8662b8f43df5..e65cbedb6abc 100644
--- a/include/net/compat.h
+++ b/include/net/compat.h
@@ -3,6 +3,8 @@
3 3
4#include <linux/config.h> 4#include <linux/config.h>
5 5
6struct sock;
7
6#if defined(CONFIG_COMPAT) 8#if defined(CONFIG_COMPAT)
7 9
8#include <linux/compat.h> 10#include <linux/compat.h>
@@ -23,7 +25,6 @@ struct compat_cmsghdr {
23 compat_int_t cmsg_type; 25 compat_int_t cmsg_type;
24}; 26};
25 27
26struct sock;
27extern int compat_sock_get_timestamp(struct sock *, struct timeval __user *); 28extern int compat_sock_get_timestamp(struct sock *, struct timeval __user *);
28 29
29#else /* defined(CONFIG_COMPAT) */ 30#else /* defined(CONFIG_COMPAT) */
diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h
index 4725ff861c57..d5926bfb1fc9 100644
--- a/include/net/ieee80211.h
+++ b/include/net/ieee80211.h
@@ -955,11 +955,13 @@ enum ieee80211_state {
955 955
956#define IEEE80211_24GHZ_MIN_CHANNEL 1 956#define IEEE80211_24GHZ_MIN_CHANNEL 1
957#define IEEE80211_24GHZ_MAX_CHANNEL 14 957#define IEEE80211_24GHZ_MAX_CHANNEL 14
958#define IEEE80211_24GHZ_CHANNELS 14 958#define IEEE80211_24GHZ_CHANNELS (IEEE80211_24GHZ_MAX_CHANNEL - \
959 IEEE80211_24GHZ_MIN_CHANNEL + 1)
959 960
960#define IEEE80211_52GHZ_MIN_CHANNEL 34 961#define IEEE80211_52GHZ_MIN_CHANNEL 34
961#define IEEE80211_52GHZ_MAX_CHANNEL 165 962#define IEEE80211_52GHZ_MAX_CHANNEL 165
962#define IEEE80211_52GHZ_CHANNELS 131 963#define IEEE80211_52GHZ_CHANNELS (IEEE80211_52GHZ_MAX_CHANNEL - \
964 IEEE80211_52GHZ_MIN_CHANNEL + 1)
963 965
964enum { 966enum {
965 IEEE80211_CH_PASSIVE_ONLY = (1 << 0), 967 IEEE80211_CH_PASSIVE_ONLY = (1 << 0),
diff --git a/include/net/ieee80211softmac.h b/include/net/ieee80211softmac.h
index b971d8c82bdd..052ed596a4e4 100644
--- a/include/net/ieee80211softmac.h
+++ b/include/net/ieee80211softmac.h
@@ -96,10 +96,13 @@ struct ieee80211softmac_assoc_info {
96 * 96 *
97 * bssvalid is true if we found a matching network 97 * bssvalid is true if we found a matching network
98 * and saved it's BSSID into the bssid above. 98 * and saved it's BSSID into the bssid above.
99 *
100 * bssfixed is used for SIOCSIWAP.
99 */ 101 */
100 u8 static_essid:1, 102 u8 static_essid:1,
101 associating:1, 103 associating:1,
102 bssvalid:1; 104 bssvalid:1,
105 bssfixed:1;
103 106
104 /* Scan retries remaining */ 107 /* Scan retries remaining */
105 int scan_retry; 108 int scan_retry;
@@ -201,7 +204,8 @@ struct ieee80211softmac_device {
201 204
202 /* couple of flags */ 205 /* couple of flags */
203 u8 scanning:1, /* protects scanning from being done multiple times at once */ 206 u8 scanning:1, /* protects scanning from being done multiple times at once */
204 associated:1; 207 associated:1,
208 running:1;
205 209
206 struct ieee80211softmac_scaninfo *scaninfo; 210 struct ieee80211softmac_scaninfo *scaninfo;
207 struct ieee80211softmac_assoc_info associnfo; 211 struct ieee80211softmac_assoc_info associnfo;
@@ -267,8 +271,9 @@ extern void ieee80211softmac_stop(struct net_device *dev);
267#define IEEE80211SOFTMAC_EVENT_AUTH_FAILED 5 271#define IEEE80211SOFTMAC_EVENT_AUTH_FAILED 5
268#define IEEE80211SOFTMAC_EVENT_AUTH_TIMEOUT 6 272#define IEEE80211SOFTMAC_EVENT_AUTH_TIMEOUT 6
269#define IEEE80211SOFTMAC_EVENT_ASSOCIATE_NET_NOT_FOUND 7 273#define IEEE80211SOFTMAC_EVENT_ASSOCIATE_NET_NOT_FOUND 7
274#define IEEE80211SOFTMAC_EVENT_DISASSOCIATED 8
270/* keep this updated! */ 275/* keep this updated! */
271#define IEEE80211SOFTMAC_EVENT_LAST 7 276#define IEEE80211SOFTMAC_EVENT_LAST 8
272/* 277/*
273 * If you want to be notified of certain events, you can call 278 * If you want to be notified of certain events, you can call
274 * ieee80211softmac_notify[_atomic] with 279 * ieee80211softmac_notify[_atomic] with
diff --git a/include/net/inet_timewait_sock.h b/include/net/inet_timewait_sock.h
index 1da294c47522..e837f98fdb50 100644
--- a/include/net/inet_timewait_sock.h
+++ b/include/net/inet_timewait_sock.h
@@ -150,7 +150,7 @@ static inline void inet_twsk_add_bind_node(struct inet_timewait_sock *tw,
150 150
151static inline int inet_twsk_dead_hashed(const struct inet_timewait_sock *tw) 151static inline int inet_twsk_dead_hashed(const struct inet_timewait_sock *tw)
152{ 152{
153 return tw->tw_death_node.pprev != NULL; 153 return !hlist_unhashed(&tw->tw_death_node);
154} 154}
155 155
156static inline void inet_twsk_dead_node_init(struct inet_timewait_sock *tw) 156static inline void inet_twsk_dead_node_init(struct inet_timewait_sock *tw)
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 6d6f0634ae41..4abedb8eaece 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -230,7 +230,7 @@ extern int ip6_ra_control(struct sock *sk, int sel,
230 void (*destructor)(struct sock *)); 230 void (*destructor)(struct sock *));
231 231
232 232
233extern int ipv6_parse_hopopts(struct sk_buff *skb, int); 233extern int ipv6_parse_hopopts(struct sk_buff *skb);
234 234
235extern struct ipv6_txoptions * ipv6_dup_options(struct sock *sk, struct ipv6_txoptions *opt); 235extern struct ipv6_txoptions * ipv6_dup_options(struct sock *sk, struct ipv6_txoptions *opt);
236extern struct ipv6_txoptions * ipv6_renew_options(struct sock *sk, struct ipv6_txoptions *opt, 236extern struct ipv6_txoptions * ipv6_renew_options(struct sock *sk, struct ipv6_txoptions *opt,
diff --git a/include/net/irda/irlmp.h b/include/net/irda/irlmp.h
index 86aefb1fda5e..c0c895d379ba 100644
--- a/include/net/irda/irlmp.h
+++ b/include/net/irda/irlmp.h
@@ -112,7 +112,7 @@ struct lsap_cb {
112 112
113 struct timer_list watchdog_timer; 113 struct timer_list watchdog_timer;
114 114
115 IRLMP_STATE lsap_state; /* Connection state */ 115 LSAP_STATE lsap_state; /* Connection state */
116 notify_t notify; /* Indication/Confirm entry points */ 116 notify_t notify; /* Indication/Confirm entry points */
117 struct qos_info qos; /* QoS for this connection */ 117 struct qos_info qos; /* QoS for this connection */
118 118
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index b0666d66293f..4901ee446879 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -211,6 +211,7 @@ struct neigh_table
211#define NEIGH_UPDATE_F_ADMIN 0x80000000 211#define NEIGH_UPDATE_F_ADMIN 0x80000000
212 212
213extern void neigh_table_init(struct neigh_table *tbl); 213extern void neigh_table_init(struct neigh_table *tbl);
214extern void neigh_table_init_no_netlink(struct neigh_table *tbl);
214extern int neigh_table_clear(struct neigh_table *tbl); 215extern int neigh_table_clear(struct neigh_table *tbl);
215extern struct neighbour * neigh_lookup(struct neigh_table *tbl, 216extern struct neighbour * neigh_lookup(struct neigh_table *tbl,
216 const void *pkey, 217 const void *pkey,
diff --git a/include/net/netrom.h b/include/net/netrom.h
index a5ee53bce62f..e0ca112024a3 100644
--- a/include/net/netrom.h
+++ b/include/net/netrom.h
@@ -42,11 +42,11 @@ enum {
42#define NR_COND_PEER_RX_BUSY 0x04 42#define NR_COND_PEER_RX_BUSY 0x04
43#define NR_COND_OWN_RX_BUSY 0x08 43#define NR_COND_OWN_RX_BUSY 0x08
44 44
45#define NR_DEFAULT_T1 (120 * HZ) /* Outstanding frames - 120 seconds */ 45#define NR_DEFAULT_T1 120000 /* Outstanding frames - 120 seconds */
46#define NR_DEFAULT_T2 (5 * HZ) /* Response delay - 5 seconds */ 46#define NR_DEFAULT_T2 5000 /* Response delay - 5 seconds */
47#define NR_DEFAULT_N2 3 /* Number of Retries - 3 */ 47#define NR_DEFAULT_N2 3 /* Number of Retries - 3 */
48#define NR_DEFAULT_T4 (180 * HZ) /* Busy Delay - 180 seconds */ 48#define NR_DEFAULT_T4 180000 /* Busy Delay - 180 seconds */
49#define NR_DEFAULT_IDLE (0 * 60 * HZ) /* No Activity Timeout - none */ 49#define NR_DEFAULT_IDLE 0 /* No Activity Timeout - none */
50#define NR_DEFAULT_WINDOW 4 /* Default Window Size - 4 */ 50#define NR_DEFAULT_WINDOW 4 /* Default Window Size - 4 */
51#define NR_DEFAULT_OBS 6 /* Default Obsolescence Count - 6 */ 51#define NR_DEFAULT_OBS 6 /* Default Obsolescence Count - 6 */
52#define NR_DEFAULT_QUAL 10 /* Default Neighbour Quality - 10 */ 52#define NR_DEFAULT_QUAL 10 /* Default Neighbour Quality - 10 */
diff --git a/include/net/rose.h b/include/net/rose.h
index 3249b979605a..012b09ed2401 100644
--- a/include/net/rose.h
+++ b/include/net/rose.h
@@ -49,14 +49,14 @@ enum {
49 ROSE_STATE_5 /* Deferred Call Acceptance */ 49 ROSE_STATE_5 /* Deferred Call Acceptance */
50}; 50};
51 51
52#define ROSE_DEFAULT_T0 (180 * HZ) /* Default T10 T20 value */ 52#define ROSE_DEFAULT_T0 180000 /* Default T10 T20 value */
53#define ROSE_DEFAULT_T1 (200 * HZ) /* Default T11 T21 value */ 53#define ROSE_DEFAULT_T1 200000 /* Default T11 T21 value */
54#define ROSE_DEFAULT_T2 (180 * HZ) /* Default T12 T22 value */ 54#define ROSE_DEFAULT_T2 180000 /* Default T12 T22 value */
55#define ROSE_DEFAULT_T3 (180 * HZ) /* Default T13 T23 value */ 55#define ROSE_DEFAULT_T3 180000 /* Default T13 T23 value */
56#define ROSE_DEFAULT_HB (5 * HZ) /* Default Holdback value */ 56#define ROSE_DEFAULT_HB 5000 /* Default Holdback value */
57#define ROSE_DEFAULT_IDLE (0 * 60 * HZ) /* No Activity Timeout - none */ 57#define ROSE_DEFAULT_IDLE 0 /* No Activity Timeout - none */
58#define ROSE_DEFAULT_ROUTING 1 /* Default routing flag */ 58#define ROSE_DEFAULT_ROUTING 1 /* Default routing flag */
59#define ROSE_DEFAULT_FAIL_TIMEOUT (120 * HZ) /* Time until link considered usable */ 59#define ROSE_DEFAULT_FAIL_TIMEOUT 120000 /* Time until link considered usable */
60#define ROSE_DEFAULT_MAXVC 50 /* Maximum number of VCs per neighbour */ 60#define ROSE_DEFAULT_MAXVC 50 /* Maximum number of VCs per neighbour */
61#define ROSE_DEFAULT_WINDOW_SIZE 7 /* Default window size */ 61#define ROSE_DEFAULT_WINDOW_SIZE 7 /* Default window size */
62 62
diff --git a/include/net/sctp/command.h b/include/net/sctp/command.h
index 34a1a09e5aef..807d6f1ef4b5 100644
--- a/include/net/sctp/command.h
+++ b/include/net/sctp/command.h
@@ -99,6 +99,7 @@ typedef enum {
99 SCTP_CMD_DEL_NON_PRIMARY, /* Removes non-primary peer transports. */ 99 SCTP_CMD_DEL_NON_PRIMARY, /* Removes non-primary peer transports. */
100 SCTP_CMD_T3_RTX_TIMERS_STOP, /* Stops T3-rtx pending timers */ 100 SCTP_CMD_T3_RTX_TIMERS_STOP, /* Stops T3-rtx pending timers */
101 SCTP_CMD_FORCE_PRIM_RETRAN, /* Forces retrans. over primary path. */ 101 SCTP_CMD_FORCE_PRIM_RETRAN, /* Forces retrans. over primary path. */
102 SCTP_CMD_SET_SK_ERR, /* Set sk_err */
102 SCTP_CMD_LAST 103 SCTP_CMD_LAST
103} sctp_verb_t; 104} sctp_verb_t;
104 105
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index e673b2c984e9..aa6033ca7cd8 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -461,12 +461,12 @@ static inline int sctp_frag_point(const struct sctp_sock *sp, int pmtu)
461 * there is room for a param header too. 461 * there is room for a param header too.
462 */ 462 */
463#define sctp_walk_params(pos, chunk, member)\ 463#define sctp_walk_params(pos, chunk, member)\
464_sctp_walk_params((pos), (chunk), WORD_ROUND(ntohs((chunk)->chunk_hdr.length)), member) 464_sctp_walk_params((pos), (chunk), ntohs((chunk)->chunk_hdr.length), member)
465 465
466#define _sctp_walk_params(pos, chunk, end, member)\ 466#define _sctp_walk_params(pos, chunk, end, member)\
467for (pos.v = chunk->member;\ 467for (pos.v = chunk->member;\
468 pos.v <= (void *)chunk + end - sizeof(sctp_paramhdr_t) &&\ 468 pos.v <= (void *)chunk + end - sizeof(sctp_paramhdr_t) &&\
469 pos.v <= (void *)chunk + end - WORD_ROUND(ntohs(pos.p->length)) &&\ 469 pos.v <= (void *)chunk + end - ntohs(pos.p->length) &&\
470 ntohs(pos.p->length) >= sizeof(sctp_paramhdr_t);\ 470 ntohs(pos.p->length) >= sizeof(sctp_paramhdr_t);\
471 pos.v += WORD_ROUND(ntohs(pos.p->length))) 471 pos.v += WORD_ROUND(ntohs(pos.p->length)))
472 472
@@ -477,7 +477,7 @@ _sctp_walk_errors((err), (chunk_hdr), ntohs((chunk_hdr)->length))
477for (err = (sctp_errhdr_t *)((void *)chunk_hdr + \ 477for (err = (sctp_errhdr_t *)((void *)chunk_hdr + \
478 sizeof(sctp_chunkhdr_t));\ 478 sizeof(sctp_chunkhdr_t));\
479 (void *)err <= (void *)chunk_hdr + end - sizeof(sctp_errhdr_t) &&\ 479 (void *)err <= (void *)chunk_hdr + end - sizeof(sctp_errhdr_t) &&\
480 (void *)err <= (void *)chunk_hdr + end - WORD_ROUND(ntohs(err->length)) &&\ 480 (void *)err <= (void *)chunk_hdr + end - ntohs(err->length) &&\
481 ntohs(err->length) >= sizeof(sctp_errhdr_t); \ 481 ntohs(err->length) >= sizeof(sctp_errhdr_t); \
482 err = (sctp_errhdr_t *)((void *)err + WORD_ROUND(ntohs(err->length)))) 482 err = (sctp_errhdr_t *)((void *)err + WORD_ROUND(ntohs(err->length))))
483 483
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index eba99f375517..7f4fea173fb1 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -712,6 +712,7 @@ struct sctp_chunk {
712 __u8 tsn_gap_acked; /* Is this chunk acked by a GAP ACK? */ 712 __u8 tsn_gap_acked; /* Is this chunk acked by a GAP ACK? */
713 __s8 fast_retransmit; /* Is this chunk fast retransmitted? */ 713 __s8 fast_retransmit; /* Is this chunk fast retransmitted? */
714 __u8 tsn_missing_report; /* Data chunk missing counter. */ 714 __u8 tsn_missing_report; /* Data chunk missing counter. */
715 __u8 data_accepted; /* At least 1 chunk in this packet accepted */
715}; 716};
716 717
717void sctp_chunk_hold(struct sctp_chunk *); 718void sctp_chunk_hold(struct sctp_chunk *);
diff --git a/include/net/sock.h b/include/net/sock.h
index af2b0544586e..c9fad6fb629b 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -279,7 +279,7 @@ static inline int sk_unhashed(const struct sock *sk)
279 279
280static inline int sk_hashed(const struct sock *sk) 280static inline int sk_hashed(const struct sock *sk)
281{ 281{
282 return sk->sk_node.pprev != NULL; 282 return !sk_unhashed(sk);
283} 283}
284 284
285static __inline__ void sk_node_init(struct hlist_node *node) 285static __inline__ void sk_node_init(struct hlist_node *node)
@@ -454,6 +454,7 @@ static inline void sk_stream_set_owner_r(struct sk_buff *skb, struct sock *sk)
454 454
455static inline void sk_stream_free_skb(struct sock *sk, struct sk_buff *skb) 455static inline void sk_stream_free_skb(struct sock *sk, struct sk_buff *skb)
456{ 456{
457 skb_truesize_check(skb);
457 sock_set_flag(sk, SOCK_QUEUE_SHRUNK); 458 sock_set_flag(sk, SOCK_QUEUE_SHRUNK);
458 sk->sk_wmem_queued -= skb->truesize; 459 sk->sk_wmem_queued -= skb->truesize;
459 sk->sk_forward_alloc += skb->truesize; 460 sk->sk_forward_alloc += skb->truesize;
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 0d5529c382e8..afa508d92c93 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -143,6 +143,11 @@ struct xfrm_state
143 /* Replay detection state at the time we sent the last notification */ 143 /* Replay detection state at the time we sent the last notification */
144 struct xfrm_replay_state preplay; 144 struct xfrm_replay_state preplay;
145 145
146 /* internal flag that only holds state for delayed aevent at the
147 * moment
148 */
149 u32 xflags;
150
146 /* Replay detection notification settings */ 151 /* Replay detection notification settings */
147 u32 replay_maxage; 152 u32 replay_maxage;
148 u32 replay_maxdiff; 153 u32 replay_maxdiff;
@@ -168,6 +173,9 @@ struct xfrm_state
168 void *data; 173 void *data;
169}; 174};
170 175
176/* xflags - make enum if more show up */
177#define XFRM_TIME_DEFER 1
178
171enum { 179enum {
172 XFRM_STATE_VOID, 180 XFRM_STATE_VOID,
173 XFRM_STATE_ACQ, 181 XFRM_STATE_ACQ,
diff --git a/include/scsi/srp.h b/include/scsi/srp.h
index 6c2681dc5b46..637f77eccf0c 100644
--- a/include/scsi/srp.h
+++ b/include/scsi/srp.h
@@ -95,14 +95,15 @@ struct srp_direct_buf {
95 95
96/* 96/*
97 * We need the packed attribute because the SRP spec puts the list of 97 * We need the packed attribute because the SRP spec puts the list of
98 * descriptors at an offset of 20, which is not aligned to the size 98 * descriptors at an offset of 20, which is not aligned to the size of
99 * of struct srp_direct_buf. 99 * struct srp_direct_buf. The whole structure must be packed to avoid
100 * having the 20-byte structure padded to 24 bytes on 64-bit architectures.
100 */ 101 */
101struct srp_indirect_buf { 102struct srp_indirect_buf {
102 struct srp_direct_buf table_desc; 103 struct srp_direct_buf table_desc;
103 __be32 len; 104 __be32 len;
104 struct srp_direct_buf desc_list[0] __attribute__((packed)); 105 struct srp_direct_buf desc_list[0];
105}; 106} __attribute__((packed));
106 107
107enum { 108enum {
108 SRP_MULTICHAN_SINGLE = 0, 109 SRP_MULTICHAN_SINGLE = 0,
@@ -122,6 +123,11 @@ struct srp_login_req {
122 u8 target_port_id[16]; 123 u8 target_port_id[16];
123}; 124};
124 125
126/*
127 * The SRP spec defines the size of the LOGIN_RSP structure to be 52
128 * bytes, so it needs to be packed to avoid having it padded to 56
129 * bytes on 64-bit architectures.
130 */
125struct srp_login_rsp { 131struct srp_login_rsp {
126 u8 opcode; 132 u8 opcode;
127 u8 reserved1[3]; 133 u8 reserved1[3];
@@ -132,7 +138,7 @@ struct srp_login_rsp {
132 __be16 buf_fmt; 138 __be16 buf_fmt;
133 u8 rsp_flags; 139 u8 rsp_flags;
134 u8 reserved2[25]; 140 u8 reserved2[25];
135}; 141} __attribute__((packed));
136 142
137struct srp_login_rej { 143struct srp_login_rej {
138 u8 opcode; 144 u8 opcode;
@@ -207,6 +213,11 @@ enum {
207 SRP_RSP_FLAG_DIUNDER = 1 << 5 213 SRP_RSP_FLAG_DIUNDER = 1 << 5
208}; 214};
209 215
216/*
217 * The SRP spec defines the size of the RSP structure to be 36 bytes,
218 * so it needs to be packed to avoid having it padded to 40 bytes on
219 * 64-bit architectures.
220 */
210struct srp_rsp { 221struct srp_rsp {
211 u8 opcode; 222 u8 opcode;
212 u8 sol_not; 223 u8 sol_not;
@@ -221,6 +232,6 @@ struct srp_rsp {
221 __be32 sense_data_len; 232 __be32 sense_data_len;
222 __be32 resp_data_len; 233 __be32 resp_data_len;
223 u8 data[0]; 234 u8 data[0];
224}; 235} __attribute__((packed));
225 236
226#endif /* SCSI_SRP_H */ 237#endif /* SCSI_SRP_H */
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index df70e7592ab5..373425895faa 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -374,12 +374,14 @@ struct snd_pcm_substream {
374 /* -- OSS things -- */ 374 /* -- OSS things -- */
375 struct snd_pcm_oss_substream oss; 375 struct snd_pcm_oss_substream oss;
376#endif 376#endif
377#ifdef CONFIG_SND_VERBOSE_PROCFS
377 struct snd_info_entry *proc_root; 378 struct snd_info_entry *proc_root;
378 struct snd_info_entry *proc_info_entry; 379 struct snd_info_entry *proc_info_entry;
379 struct snd_info_entry *proc_hw_params_entry; 380 struct snd_info_entry *proc_hw_params_entry;
380 struct snd_info_entry *proc_sw_params_entry; 381 struct snd_info_entry *proc_sw_params_entry;
381 struct snd_info_entry *proc_status_entry; 382 struct snd_info_entry *proc_status_entry;
382 struct snd_info_entry *proc_prealloc_entry; 383 struct snd_info_entry *proc_prealloc_entry;
384#endif
383 /* misc flags */ 385 /* misc flags */
384 unsigned int no_mmap_ctrl: 1; 386 unsigned int no_mmap_ctrl: 1;
385 unsigned int hw_opened: 1; 387 unsigned int hw_opened: 1;
@@ -400,12 +402,14 @@ struct snd_pcm_str {
400 struct snd_pcm_oss_stream oss; 402 struct snd_pcm_oss_stream oss;
401#endif 403#endif
402 struct snd_pcm_file *files; 404 struct snd_pcm_file *files;
405#ifdef CONFIG_SND_VERBOSE_PROCFS
403 struct snd_info_entry *proc_root; 406 struct snd_info_entry *proc_root;
404 struct snd_info_entry *proc_info_entry; 407 struct snd_info_entry *proc_info_entry;
405#ifdef CONFIG_SND_DEBUG 408#ifdef CONFIG_SND_PCM_XRUN_DEBUG
406 unsigned int xrun_debug; /* 0 = disabled, 1 = verbose, 2 = stacktrace */ 409 unsigned int xrun_debug; /* 0 = disabled, 1 = verbose, 2 = stacktrace */
407 struct snd_info_entry *proc_xrun_debug_entry; 410 struct snd_info_entry *proc_xrun_debug_entry;
408#endif 411#endif
412#endif
409}; 413};
410 414
411struct snd_pcm { 415struct snd_pcm {
diff --git a/include/sound/pcm_oss.h b/include/sound/pcm_oss.h
index 39df2baca18a..c854647b6f3c 100644
--- a/include/sound/pcm_oss.h
+++ b/include/sound/pcm_oss.h
@@ -75,7 +75,9 @@ struct snd_pcm_oss_substream {
75struct snd_pcm_oss_stream { 75struct snd_pcm_oss_stream {
76 struct snd_pcm_oss_setup *setup_list; /* setup list */ 76 struct snd_pcm_oss_setup *setup_list; /* setup list */
77 struct mutex setup_mutex; 77 struct mutex setup_mutex;
78#ifdef CONFIG_SND_VERBOSE_PROCFS
78 struct snd_info_entry *proc_entry; 79 struct snd_info_entry *proc_entry;
80#endif
79}; 81};
80 82
81struct snd_pcm_oss { 83struct snd_pcm_oss {
diff --git a/init/Kconfig b/init/Kconfig
index f1bc2f0e94e5..3b36a1d53656 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -374,15 +374,6 @@ config SLAB
374 SLOB is more space efficient but does not scale well and is 374 SLOB is more space efficient but does not scale well and is
375 more susceptible to fragmentation. 375 more susceptible to fragmentation.
376 376
377config DOUBLEFAULT
378 default y
379 bool "Enable doublefault exception handler" if EMBEDDED && X86_32
380 help
381 This option allows trapping of rare doublefault exceptions that
382 would otherwise cause a system to silently reboot. Disabling this
383 option saves about 4k and might cause you much additional grey
384 hair.
385
386endmenu # General setup 377endmenu # General setup
387 378
388config TINY_SHMEM 379config TINY_SHMEM
diff --git a/init/do_mounts.c b/init/do_mounts.c
index adb7cad3e6ee..f4b7b9d278cd 100644
--- a/init/do_mounts.c
+++ b/init/do_mounts.c
@@ -310,6 +310,11 @@ retry:
310 310
311 panic("VFS: Unable to mount root fs on %s", b); 311 panic("VFS: Unable to mount root fs on %s", b);
312 } 312 }
313
314 printk("No filesystem could mount root, tried: ");
315 for (p = fs_names; *p; p += strlen(p)+1)
316 printk(" %s", p);
317 printk("\n");
313 panic("VFS: Unable to mount root fs on %s", __bdevname(ROOT_DEV, b)); 318 panic("VFS: Unable to mount root fs on %s", __bdevname(ROOT_DEV, b));
314out: 319out:
315 putname(fs_names); 320 putname(fs_names);
diff --git a/init/initramfs.c b/init/initramfs.c
index 679d870d991b..f81cfa40a719 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -26,10 +26,12 @@ static void __init free(void *where)
26 26
27/* link hash */ 27/* link hash */
28 28
29#define N_ALIGN(len) ((((len) + 1) & ~3) + 2)
30
29static __initdata struct hash { 31static __initdata struct hash {
30 int ino, minor, major; 32 int ino, minor, major;
31 struct hash *next; 33 struct hash *next;
32 char *name; 34 char name[N_ALIGN(PATH_MAX)];
33} *head[32]; 35} *head[32];
34 36
35static inline int hash(int major, int minor, int ino) 37static inline int hash(int major, int minor, int ino)
@@ -57,7 +59,7 @@ static char __init *find_link(int major, int minor, int ino, char *name)
57 q->ino = ino; 59 q->ino = ino;
58 q->minor = minor; 60 q->minor = minor;
59 q->major = major; 61 q->major = major;
60 q->name = name; 62 strcpy(q->name, name);
61 q->next = NULL; 63 q->next = NULL;
62 *p = q; 64 *p = q;
63 return NULL; 65 return NULL;
@@ -133,8 +135,6 @@ static inline void eat(unsigned n)
133 count -= n; 135 count -= n;
134} 136}
135 137
136#define N_ALIGN(len) ((((len) + 1) & ~3) + 2)
137
138static __initdata char *collected; 138static __initdata char *collected;
139static __initdata int remains; 139static __initdata int remains;
140static __initdata char *collect; 140static __initdata char *collect;
diff --git a/init/main.c b/init/main.c
index 4a2f0898dda1..f715b9b89753 100644
--- a/init/main.c
+++ b/init/main.c
@@ -582,7 +582,7 @@ static void __init do_initcalls(void)
582 582
583 result = (*call)(); 583 result = (*call)();
584 584
585 if (result && (result != -ENODEV || initcall_debug)) { 585 if (result && result != -ENODEV && initcall_debug) {
586 sprintf(msgbuf, "error code %d", result); 586 sprintf(msgbuf, "error code %d", result);
587 msg = msgbuf; 587 msg = msgbuf;
588 } 588 }
diff --git a/ipc/msg.c b/ipc/msg.c
index 48a7f17a7236..7d1340ccb16b 100644
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -13,6 +13,9 @@
13 * mostly rewritten, threaded and wake-one semantics added 13 * mostly rewritten, threaded and wake-one semantics added
14 * MSGMAX limit removed, sysctl's added 14 * MSGMAX limit removed, sysctl's added
15 * (c) 1999 Manfred Spraul <manfred@colorfullife.com> 15 * (c) 1999 Manfred Spraul <manfred@colorfullife.com>
16 *
17 * support for audit of ipc object properties and permission changes
18 * Dustin Kirkland <dustin.kirkland@us.ibm.com>
16 */ 19 */
17 20
18#include <linux/capability.h> 21#include <linux/capability.h>
@@ -447,6 +450,11 @@ asmlinkage long sys_msgctl (int msqid, int cmd, struct msqid_ds __user *buf)
447 if (msg_checkid(msq,msqid)) 450 if (msg_checkid(msq,msqid))
448 goto out_unlock_up; 451 goto out_unlock_up;
449 ipcp = &msq->q_perm; 452 ipcp = &msq->q_perm;
453
454 err = audit_ipc_obj(ipcp);
455 if (err)
456 goto out_unlock_up;
457
450 err = -EPERM; 458 err = -EPERM;
451 if (current->euid != ipcp->cuid && 459 if (current->euid != ipcp->cuid &&
452 current->euid != ipcp->uid && !capable(CAP_SYS_ADMIN)) 460 current->euid != ipcp->uid && !capable(CAP_SYS_ADMIN))
@@ -460,7 +468,8 @@ asmlinkage long sys_msgctl (int msqid, int cmd, struct msqid_ds __user *buf)
460 switch (cmd) { 468 switch (cmd) {
461 case IPC_SET: 469 case IPC_SET:
462 { 470 {
463 if ((err = audit_ipc_perms(setbuf.qbytes, setbuf.uid, setbuf.gid, setbuf.mode, ipcp))) 471 err = audit_ipc_set_perm(setbuf.qbytes, setbuf.uid, setbuf.gid, setbuf.mode, ipcp);
472 if (err)
464 goto out_unlock_up; 473 goto out_unlock_up;
465 474
466 err = -EPERM; 475 err = -EPERM;
diff --git a/ipc/sem.c b/ipc/sem.c
index 642659cd596b..7919f8ece6ba 100644
--- a/ipc/sem.c
+++ b/ipc/sem.c
@@ -61,6 +61,9 @@
61 * (c) 2001 Red Hat Inc <alan@redhat.com> 61 * (c) 2001 Red Hat Inc <alan@redhat.com>
62 * Lockless wakeup 62 * Lockless wakeup
63 * (c) 2003 Manfred Spraul <manfred@colorfullife.com> 63 * (c) 2003 Manfred Spraul <manfred@colorfullife.com>
64 *
65 * support for audit of ipc object properties and permission changes
66 * Dustin Kirkland <dustin.kirkland@us.ibm.com>
64 */ 67 */
65 68
66#include <linux/config.h> 69#include <linux/config.h>
@@ -820,6 +823,11 @@ static int semctl_down(int semid, int semnum, int cmd, int version, union semun
820 goto out_unlock; 823 goto out_unlock;
821 } 824 }
822 ipcp = &sma->sem_perm; 825 ipcp = &sma->sem_perm;
826
827 err = audit_ipc_obj(ipcp);
828 if (err)
829 goto out_unlock;
830
823 if (current->euid != ipcp->cuid && 831 if (current->euid != ipcp->cuid &&
824 current->euid != ipcp->uid && !capable(CAP_SYS_ADMIN)) { 832 current->euid != ipcp->uid && !capable(CAP_SYS_ADMIN)) {
825 err=-EPERM; 833 err=-EPERM;
@@ -836,7 +844,8 @@ static int semctl_down(int semid, int semnum, int cmd, int version, union semun
836 err = 0; 844 err = 0;
837 break; 845 break;
838 case IPC_SET: 846 case IPC_SET:
839 if ((err = audit_ipc_perms(0, setbuf.uid, setbuf.gid, setbuf.mode, ipcp))) 847 err = audit_ipc_set_perm(0, setbuf.uid, setbuf.gid, setbuf.mode, ipcp);
848 if (err)
840 goto out_unlock; 849 goto out_unlock;
841 ipcp->uid = setbuf.uid; 850 ipcp->uid = setbuf.uid;
842 ipcp->gid = setbuf.gid; 851 ipcp->gid = setbuf.gid;
diff --git a/ipc/shm.c b/ipc/shm.c
index 6b0c9af5bbf7..809896851902 100644
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -13,6 +13,8 @@
13 * Shared /dev/zero support, Kanoj Sarcar <kanoj@sgi.com> 13 * Shared /dev/zero support, Kanoj Sarcar <kanoj@sgi.com>
14 * Move the mm functionality over to mm/shmem.c, Christoph Rohland <cr@sap.com> 14 * Move the mm functionality over to mm/shmem.c, Christoph Rohland <cr@sap.com>
15 * 15 *
16 * support for audit of ipc object properties and permission changes
17 * Dustin Kirkland <dustin.kirkland@us.ibm.com>
16 */ 18 */
17 19
18#include <linux/config.h> 20#include <linux/config.h>
@@ -162,6 +164,8 @@ static int shm_mmap(struct file * file, struct vm_area_struct * vma)
162 ret = shmem_mmap(file, vma); 164 ret = shmem_mmap(file, vma);
163 if (ret == 0) { 165 if (ret == 0) {
164 vma->vm_ops = &shm_vm_ops; 166 vma->vm_ops = &shm_vm_ops;
167 if (!(vma->vm_flags & VM_WRITE))
168 vma->vm_flags &= ~VM_MAYWRITE;
165 shm_inc(file->f_dentry->d_inode->i_ino); 169 shm_inc(file->f_dentry->d_inode->i_ino);
166 } 170 }
167 171
@@ -540,6 +544,10 @@ asmlinkage long sys_shmctl (int shmid, int cmd, struct shmid_ds __user *buf)
540 if(err) 544 if(err)
541 goto out_unlock; 545 goto out_unlock;
542 546
547 err = audit_ipc_obj(&(shp->shm_perm));
548 if (err)
549 goto out_unlock;
550
543 if (!capable(CAP_IPC_LOCK)) { 551 if (!capable(CAP_IPC_LOCK)) {
544 err = -EPERM; 552 err = -EPERM;
545 if (current->euid != shp->shm_perm.uid && 553 if (current->euid != shp->shm_perm.uid &&
@@ -592,6 +600,10 @@ asmlinkage long sys_shmctl (int shmid, int cmd, struct shmid_ds __user *buf)
592 if(err) 600 if(err)
593 goto out_unlock_up; 601 goto out_unlock_up;
594 602
603 err = audit_ipc_obj(&(shp->shm_perm));
604 if (err)
605 goto out_unlock_up;
606
595 if (current->euid != shp->shm_perm.uid && 607 if (current->euid != shp->shm_perm.uid &&
596 current->euid != shp->shm_perm.cuid && 608 current->euid != shp->shm_perm.cuid &&
597 !capable(CAP_SYS_ADMIN)) { 609 !capable(CAP_SYS_ADMIN)) {
@@ -625,12 +637,15 @@ asmlinkage long sys_shmctl (int shmid, int cmd, struct shmid_ds __user *buf)
625 err=-EINVAL; 637 err=-EINVAL;
626 if(shp==NULL) 638 if(shp==NULL)
627 goto out_up; 639 goto out_up;
628 if ((err = audit_ipc_perms(0, setbuf.uid, setbuf.gid,
629 setbuf.mode, &(shp->shm_perm))))
630 goto out_unlock_up;
631 err = shm_checkid(shp,shmid); 640 err = shm_checkid(shp,shmid);
632 if(err) 641 if(err)
633 goto out_unlock_up; 642 goto out_unlock_up;
643 err = audit_ipc_obj(&(shp->shm_perm));
644 if (err)
645 goto out_unlock_up;
646 err = audit_ipc_set_perm(0, setbuf.uid, setbuf.gid, setbuf.mode, &(shp->shm_perm));
647 if (err)
648 goto out_unlock_up;
634 err=-EPERM; 649 err=-EPERM;
635 if (current->euid != shp->shm_perm.uid && 650 if (current->euid != shp->shm_perm.uid &&
636 current->euid != shp->shm_perm.cuid && 651 current->euid != shp->shm_perm.cuid &&
diff --git a/ipc/util.c b/ipc/util.c
index 5e785a29e1e6..8193299f45f6 100644
--- a/ipc/util.c
+++ b/ipc/util.c
@@ -10,6 +10,8 @@
10 * Manfred Spraul <manfred@colorfullife.com> 10 * Manfred Spraul <manfred@colorfullife.com>
11 * Oct 2002 - One lock per IPC id. RCU ipc_free for lock-free grow_ary(). 11 * Oct 2002 - One lock per IPC id. RCU ipc_free for lock-free grow_ary().
12 * Mingming Cao <cmm@us.ibm.com> 12 * Mingming Cao <cmm@us.ibm.com>
13 * Mar 2006 - support for audit of ipc object properties
14 * Dustin Kirkland <dustin.kirkland@us.ibm.com>
13 */ 15 */
14 16
15#include <linux/config.h> 17#include <linux/config.h>
@@ -27,6 +29,7 @@
27#include <linux/workqueue.h> 29#include <linux/workqueue.h>
28#include <linux/seq_file.h> 30#include <linux/seq_file.h>
29#include <linux/proc_fs.h> 31#include <linux/proc_fs.h>
32#include <linux/audit.h>
30 33
31#include <asm/unistd.h> 34#include <asm/unistd.h>
32 35
@@ -183,8 +186,7 @@ static int grow_ary(struct ipc_ids* ids, int newsize)
183 if(new == NULL) 186 if(new == NULL)
184 return size; 187 return size;
185 new->size = newsize; 188 new->size = newsize;
186 memcpy(new->p, ids->entries->p, sizeof(struct kern_ipc_perm *)*size + 189 memcpy(new->p, ids->entries->p, sizeof(struct kern_ipc_perm *)*size);
187 sizeof(struct ipc_id_ary));
188 for(i=size;i<newsize;i++) { 190 for(i=size;i<newsize;i++) {
189 new->p[i] = NULL; 191 new->p[i] = NULL;
190 } 192 }
@@ -465,8 +467,10 @@ void ipc_rcu_putref(void *ptr)
465 467
466int ipcperms (struct kern_ipc_perm *ipcp, short flag) 468int ipcperms (struct kern_ipc_perm *ipcp, short flag)
467{ /* flag will most probably be 0 or S_...UGO from <linux/stat.h> */ 469{ /* flag will most probably be 0 or S_...UGO from <linux/stat.h> */
468 int requested_mode, granted_mode; 470 int requested_mode, granted_mode, err;
469 471
472 if (unlikely((err = audit_ipc_obj(ipcp))))
473 return err;
470 requested_mode = (flag >> 6) | (flag >> 3) | flag; 474 requested_mode = (flag >> 6) | (flag >> 3) | flag;
471 granted_mode = ipcp->mode; 475 granted_mode = ipcp->mode;
472 if (current->euid == ipcp->cuid || current->euid == ipcp->uid) 476 if (current->euid == ipcp->cuid || current->euid == ipcp->uid)
diff --git a/kernel/audit.c b/kernel/audit.c
index c8ccbd09048f..df57b493e1cb 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -55,6 +55,9 @@
55#include <net/netlink.h> 55#include <net/netlink.h>
56#include <linux/skbuff.h> 56#include <linux/skbuff.h>
57#include <linux/netlink.h> 57#include <linux/netlink.h>
58#include <linux/selinux.h>
59
60#include "audit.h"
58 61
59/* No auditing will take place until audit_initialized != 0. 62/* No auditing will take place until audit_initialized != 0.
60 * (Initialization happens after skb_init is called.) */ 63 * (Initialization happens after skb_init is called.) */
@@ -227,49 +230,103 @@ void audit_log_lost(const char *message)
227 } 230 }
228} 231}
229 232
230static int audit_set_rate_limit(int limit, uid_t loginuid) 233static int audit_set_rate_limit(int limit, uid_t loginuid, u32 sid)
231{ 234{
232 int old = audit_rate_limit; 235 int old = audit_rate_limit;
233 audit_rate_limit = limit; 236
234 audit_log(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE, 237 if (sid) {
238 char *ctx = NULL;
239 u32 len;
240 int rc;
241 if ((rc = selinux_ctxid_to_string(sid, &ctx, &len)))
242 return rc;
243 else
244 audit_log(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE,
245 "audit_rate_limit=%d old=%d by auid=%u subj=%s",
246 limit, old, loginuid, ctx);
247 kfree(ctx);
248 } else
249 audit_log(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE,
235 "audit_rate_limit=%d old=%d by auid=%u", 250 "audit_rate_limit=%d old=%d by auid=%u",
236 audit_rate_limit, old, loginuid); 251 limit, old, loginuid);
252 audit_rate_limit = limit;
237 return old; 253 return old;
238} 254}
239 255
240static int audit_set_backlog_limit(int limit, uid_t loginuid) 256static int audit_set_backlog_limit(int limit, uid_t loginuid, u32 sid)
241{ 257{
242 int old = audit_backlog_limit; 258 int old = audit_backlog_limit;
243 audit_backlog_limit = limit; 259
244 audit_log(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE, 260 if (sid) {
261 char *ctx = NULL;
262 u32 len;
263 int rc;
264 if ((rc = selinux_ctxid_to_string(sid, &ctx, &len)))
265 return rc;
266 else
267 audit_log(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE,
268 "audit_backlog_limit=%d old=%d by auid=%u subj=%s",
269 limit, old, loginuid, ctx);
270 kfree(ctx);
271 } else
272 audit_log(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE,
245 "audit_backlog_limit=%d old=%d by auid=%u", 273 "audit_backlog_limit=%d old=%d by auid=%u",
246 audit_backlog_limit, old, loginuid); 274 limit, old, loginuid);
275 audit_backlog_limit = limit;
247 return old; 276 return old;
248} 277}
249 278
250static int audit_set_enabled(int state, uid_t loginuid) 279static int audit_set_enabled(int state, uid_t loginuid, u32 sid)
251{ 280{
252 int old = audit_enabled; 281 int old = audit_enabled;
282
253 if (state != 0 && state != 1) 283 if (state != 0 && state != 1)
254 return -EINVAL; 284 return -EINVAL;
255 audit_enabled = state; 285
256 audit_log(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE, 286 if (sid) {
287 char *ctx = NULL;
288 u32 len;
289 int rc;
290 if ((rc = selinux_ctxid_to_string(sid, &ctx, &len)))
291 return rc;
292 else
293 audit_log(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE,
294 "audit_enabled=%d old=%d by auid=%u subj=%s",
295 state, old, loginuid, ctx);
296 kfree(ctx);
297 } else
298 audit_log(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE,
257 "audit_enabled=%d old=%d by auid=%u", 299 "audit_enabled=%d old=%d by auid=%u",
258 audit_enabled, old, loginuid); 300 state, old, loginuid);
301 audit_enabled = state;
259 return old; 302 return old;
260} 303}
261 304
262static int audit_set_failure(int state, uid_t loginuid) 305static int audit_set_failure(int state, uid_t loginuid, u32 sid)
263{ 306{
264 int old = audit_failure; 307 int old = audit_failure;
308
265 if (state != AUDIT_FAIL_SILENT 309 if (state != AUDIT_FAIL_SILENT
266 && state != AUDIT_FAIL_PRINTK 310 && state != AUDIT_FAIL_PRINTK
267 && state != AUDIT_FAIL_PANIC) 311 && state != AUDIT_FAIL_PANIC)
268 return -EINVAL; 312 return -EINVAL;
269 audit_failure = state; 313
270 audit_log(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE, 314 if (sid) {
315 char *ctx = NULL;
316 u32 len;
317 int rc;
318 if ((rc = selinux_ctxid_to_string(sid, &ctx, &len)))
319 return rc;
320 else
321 audit_log(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE,
322 "audit_failure=%d old=%d by auid=%u subj=%s",
323 state, old, loginuid, ctx);
324 kfree(ctx);
325 } else
326 audit_log(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE,
271 "audit_failure=%d old=%d by auid=%u", 327 "audit_failure=%d old=%d by auid=%u",
272 audit_failure, old, loginuid); 328 state, old, loginuid);
329 audit_failure = state;
273 return old; 330 return old;
274} 331}
275 332
@@ -387,7 +444,7 @@ static int audit_netlink_ok(kernel_cap_t eff_cap, u16 msg_type)
387 444
388static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh) 445static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
389{ 446{
390 u32 uid, pid, seq; 447 u32 uid, pid, seq, sid;
391 void *data; 448 void *data;
392 struct audit_status *status_get, status_set; 449 struct audit_status *status_get, status_set;
393 int err; 450 int err;
@@ -413,6 +470,7 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
413 pid = NETLINK_CREDS(skb)->pid; 470 pid = NETLINK_CREDS(skb)->pid;
414 uid = NETLINK_CREDS(skb)->uid; 471 uid = NETLINK_CREDS(skb)->uid;
415 loginuid = NETLINK_CB(skb).loginuid; 472 loginuid = NETLINK_CB(skb).loginuid;
473 sid = NETLINK_CB(skb).sid;
416 seq = nlh->nlmsg_seq; 474 seq = nlh->nlmsg_seq;
417 data = NLMSG_DATA(nlh); 475 data = NLMSG_DATA(nlh);
418 476
@@ -433,25 +491,43 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
433 return -EINVAL; 491 return -EINVAL;
434 status_get = (struct audit_status *)data; 492 status_get = (struct audit_status *)data;
435 if (status_get->mask & AUDIT_STATUS_ENABLED) { 493 if (status_get->mask & AUDIT_STATUS_ENABLED) {
436 err = audit_set_enabled(status_get->enabled, loginuid); 494 err = audit_set_enabled(status_get->enabled,
495 loginuid, sid);
437 if (err < 0) return err; 496 if (err < 0) return err;
438 } 497 }
439 if (status_get->mask & AUDIT_STATUS_FAILURE) { 498 if (status_get->mask & AUDIT_STATUS_FAILURE) {
440 err = audit_set_failure(status_get->failure, loginuid); 499 err = audit_set_failure(status_get->failure,
500 loginuid, sid);
441 if (err < 0) return err; 501 if (err < 0) return err;
442 } 502 }
443 if (status_get->mask & AUDIT_STATUS_PID) { 503 if (status_get->mask & AUDIT_STATUS_PID) {
444 int old = audit_pid; 504 int old = audit_pid;
505 if (sid) {
506 char *ctx = NULL;
507 u32 len;
508 int rc;
509 if ((rc = selinux_ctxid_to_string(
510 sid, &ctx, &len)))
511 return rc;
512 else
513 audit_log(NULL, GFP_KERNEL,
514 AUDIT_CONFIG_CHANGE,
515 "audit_pid=%d old=%d by auid=%u subj=%s",
516 status_get->pid, old,
517 loginuid, ctx);
518 kfree(ctx);
519 } else
520 audit_log(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE,
521 "audit_pid=%d old=%d by auid=%u",
522 status_get->pid, old, loginuid);
445 audit_pid = status_get->pid; 523 audit_pid = status_get->pid;
446 audit_log(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE,
447 "audit_pid=%d old=%d by auid=%u",
448 audit_pid, old, loginuid);
449 } 524 }
450 if (status_get->mask & AUDIT_STATUS_RATE_LIMIT) 525 if (status_get->mask & AUDIT_STATUS_RATE_LIMIT)
451 audit_set_rate_limit(status_get->rate_limit, loginuid); 526 audit_set_rate_limit(status_get->rate_limit,
527 loginuid, sid);
452 if (status_get->mask & AUDIT_STATUS_BACKLOG_LIMIT) 528 if (status_get->mask & AUDIT_STATUS_BACKLOG_LIMIT)
453 audit_set_backlog_limit(status_get->backlog_limit, 529 audit_set_backlog_limit(status_get->backlog_limit,
454 loginuid); 530 loginuid, sid);
455 break; 531 break;
456 case AUDIT_USER: 532 case AUDIT_USER:
457 case AUDIT_FIRST_USER_MSG...AUDIT_LAST_USER_MSG: 533 case AUDIT_FIRST_USER_MSG...AUDIT_LAST_USER_MSG:
@@ -465,8 +541,23 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
465 ab = audit_log_start(NULL, GFP_KERNEL, msg_type); 541 ab = audit_log_start(NULL, GFP_KERNEL, msg_type);
466 if (ab) { 542 if (ab) {
467 audit_log_format(ab, 543 audit_log_format(ab,
468 "user pid=%d uid=%u auid=%u msg='%.1024s'", 544 "user pid=%d uid=%u auid=%u",
469 pid, uid, loginuid, (char *)data); 545 pid, uid, loginuid);
546 if (sid) {
547 char *ctx = NULL;
548 u32 len;
549 if (selinux_ctxid_to_string(
550 sid, &ctx, &len)) {
551 audit_log_format(ab,
552 " ssid=%u", sid);
553 /* Maybe call audit_panic? */
554 } else
555 audit_log_format(ab,
556 " subj=%s", ctx);
557 kfree(ctx);
558 }
559 audit_log_format(ab, " msg='%.1024s'",
560 (char *)data);
470 audit_set_pid(ab, pid); 561 audit_set_pid(ab, pid);
471 audit_log_end(ab); 562 audit_log_end(ab);
472 } 563 }
@@ -480,7 +571,7 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
480 case AUDIT_LIST: 571 case AUDIT_LIST:
481 err = audit_receive_filter(nlh->nlmsg_type, NETLINK_CB(skb).pid, 572 err = audit_receive_filter(nlh->nlmsg_type, NETLINK_CB(skb).pid,
482 uid, seq, data, nlmsg_len(nlh), 573 uid, seq, data, nlmsg_len(nlh),
483 loginuid); 574 loginuid, sid);
484 break; 575 break;
485 case AUDIT_ADD_RULE: 576 case AUDIT_ADD_RULE:
486 case AUDIT_DEL_RULE: 577 case AUDIT_DEL_RULE:
@@ -490,7 +581,7 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
490 case AUDIT_LIST_RULES: 581 case AUDIT_LIST_RULES:
491 err = audit_receive_filter(nlh->nlmsg_type, NETLINK_CB(skb).pid, 582 err = audit_receive_filter(nlh->nlmsg_type, NETLINK_CB(skb).pid,
492 uid, seq, data, nlmsg_len(nlh), 583 uid, seq, data, nlmsg_len(nlh),
493 loginuid); 584 loginuid, sid);
494 break; 585 break;
495 case AUDIT_SIGNAL_INFO: 586 case AUDIT_SIGNAL_INFO:
496 sig_data.uid = audit_sig_uid; 587 sig_data.uid = audit_sig_uid;
@@ -564,6 +655,11 @@ static int __init audit_init(void)
564 skb_queue_head_init(&audit_skb_queue); 655 skb_queue_head_init(&audit_skb_queue);
565 audit_initialized = 1; 656 audit_initialized = 1;
566 audit_enabled = audit_default; 657 audit_enabled = audit_default;
658
659 /* Register the callback with selinux. This callback will be invoked
660 * when a new policy is loaded. */
661 selinux_audit_set_callback(&selinux_audit_rule_update);
662
567 audit_log(NULL, GFP_KERNEL, AUDIT_KERNEL, "initialized"); 663 audit_log(NULL, GFP_KERNEL, AUDIT_KERNEL, "initialized");
568 return 0; 664 return 0;
569} 665}
diff --git a/kernel/audit.h b/kernel/audit.h
index bc5392076e2b..6f733920fd32 100644
--- a/kernel/audit.h
+++ b/kernel/audit.h
@@ -54,9 +54,11 @@ enum audit_state {
54 54
55/* Rule lists */ 55/* Rule lists */
56struct audit_field { 56struct audit_field {
57 u32 type; 57 u32 type;
58 u32 val; 58 u32 val;
59 u32 op; 59 u32 op;
60 char *se_str;
61 struct selinux_audit_rule *se_rule;
60}; 62};
61 63
62struct audit_krule { 64struct audit_krule {
@@ -86,3 +88,5 @@ extern void audit_send_reply(int pid, int seq, int type,
86extern void audit_log_lost(const char *message); 88extern void audit_log_lost(const char *message);
87extern void audit_panic(const char *message); 89extern void audit_panic(const char *message);
88extern struct mutex audit_netlink_mutex; 90extern struct mutex audit_netlink_mutex;
91
92extern int selinux_audit_rule_update(void);
diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c
index d3a8539f3a83..7c134906d689 100644
--- a/kernel/auditfilter.c
+++ b/kernel/auditfilter.c
@@ -23,6 +23,7 @@
23#include <linux/audit.h> 23#include <linux/audit.h>
24#include <linux/kthread.h> 24#include <linux/kthread.h>
25#include <linux/netlink.h> 25#include <linux/netlink.h>
26#include <linux/selinux.h>
26#include "audit.h" 27#include "audit.h"
27 28
28/* There are three lists of rules -- one to search at task creation 29/* There are three lists of rules -- one to search at task creation
@@ -42,6 +43,13 @@ struct list_head audit_filter_list[AUDIT_NR_FILTERS] = {
42 43
43static inline void audit_free_rule(struct audit_entry *e) 44static inline void audit_free_rule(struct audit_entry *e)
44{ 45{
46 int i;
47 if (e->rule.fields)
48 for (i = 0; i < e->rule.field_count; i++) {
49 struct audit_field *f = &e->rule.fields[i];
50 kfree(f->se_str);
51 selinux_audit_rule_free(f->se_rule);
52 }
45 kfree(e->rule.fields); 53 kfree(e->rule.fields);
46 kfree(e); 54 kfree(e);
47} 55}
@@ -52,9 +60,29 @@ static inline void audit_free_rule_rcu(struct rcu_head *head)
52 audit_free_rule(e); 60 audit_free_rule(e);
53} 61}
54 62
63/* Initialize an audit filterlist entry. */
64static inline struct audit_entry *audit_init_entry(u32 field_count)
65{
66 struct audit_entry *entry;
67 struct audit_field *fields;
68
69 entry = kzalloc(sizeof(*entry), GFP_KERNEL);
70 if (unlikely(!entry))
71 return NULL;
72
73 fields = kzalloc(sizeof(*fields) * field_count, GFP_KERNEL);
74 if (unlikely(!fields)) {
75 kfree(entry);
76 return NULL;
77 }
78 entry->rule.fields = fields;
79
80 return entry;
81}
82
55/* Unpack a filter field's string representation from user-space 83/* Unpack a filter field's string representation from user-space
56 * buffer. */ 84 * buffer. */
57static __attribute__((unused)) char *audit_unpack_string(void **bufp, size_t *remain, size_t len) 85static char *audit_unpack_string(void **bufp, size_t *remain, size_t len)
58{ 86{
59 char *str; 87 char *str;
60 88
@@ -84,7 +112,6 @@ static inline struct audit_entry *audit_to_entry_common(struct audit_rule *rule)
84{ 112{
85 unsigned listnr; 113 unsigned listnr;
86 struct audit_entry *entry; 114 struct audit_entry *entry;
87 struct audit_field *fields;
88 int i, err; 115 int i, err;
89 116
90 err = -EINVAL; 117 err = -EINVAL;
@@ -108,23 +135,14 @@ static inline struct audit_entry *audit_to_entry_common(struct audit_rule *rule)
108 goto exit_err; 135 goto exit_err;
109 136
110 err = -ENOMEM; 137 err = -ENOMEM;
111 entry = kmalloc(sizeof(*entry), GFP_KERNEL); 138 entry = audit_init_entry(rule->field_count);
112 if (unlikely(!entry)) 139 if (!entry)
113 goto exit_err;
114 fields = kmalloc(sizeof(*fields) * rule->field_count, GFP_KERNEL);
115 if (unlikely(!fields)) {
116 kfree(entry);
117 goto exit_err; 140 goto exit_err;
118 }
119
120 memset(&entry->rule, 0, sizeof(struct audit_krule));
121 memset(fields, 0, sizeof(struct audit_field));
122 141
123 entry->rule.flags = rule->flags & AUDIT_FILTER_PREPEND; 142 entry->rule.flags = rule->flags & AUDIT_FILTER_PREPEND;
124 entry->rule.listnr = listnr; 143 entry->rule.listnr = listnr;
125 entry->rule.action = rule->action; 144 entry->rule.action = rule->action;
126 entry->rule.field_count = rule->field_count; 145 entry->rule.field_count = rule->field_count;
127 entry->rule.fields = fields;
128 146
129 for (i = 0; i < AUDIT_BITMASK_SIZE; i++) 147 for (i = 0; i < AUDIT_BITMASK_SIZE; i++)
130 entry->rule.mask[i] = rule->mask[i]; 148 entry->rule.mask[i] = rule->mask[i];
@@ -150,15 +168,20 @@ static struct audit_entry *audit_rule_to_entry(struct audit_rule *rule)
150 for (i = 0; i < rule->field_count; i++) { 168 for (i = 0; i < rule->field_count; i++) {
151 struct audit_field *f = &entry->rule.fields[i]; 169 struct audit_field *f = &entry->rule.fields[i];
152 170
153 if (rule->fields[i] & AUDIT_UNUSED_BITS) {
154 err = -EINVAL;
155 goto exit_free;
156 }
157
158 f->op = rule->fields[i] & (AUDIT_NEGATE|AUDIT_OPERATORS); 171 f->op = rule->fields[i] & (AUDIT_NEGATE|AUDIT_OPERATORS);
159 f->type = rule->fields[i] & ~(AUDIT_NEGATE|AUDIT_OPERATORS); 172 f->type = rule->fields[i] & ~(AUDIT_NEGATE|AUDIT_OPERATORS);
160 f->val = rule->values[i]; 173 f->val = rule->values[i];
161 174
175 if (f->type & AUDIT_UNUSED_BITS ||
176 f->type == AUDIT_SE_USER ||
177 f->type == AUDIT_SE_ROLE ||
178 f->type == AUDIT_SE_TYPE ||
179 f->type == AUDIT_SE_SEN ||
180 f->type == AUDIT_SE_CLR) {
181 err = -EINVAL;
182 goto exit_free;
183 }
184
162 entry->rule.vers_ops = (f->op & AUDIT_OPERATORS) ? 2 : 1; 185 entry->rule.vers_ops = (f->op & AUDIT_OPERATORS) ? 2 : 1;
163 186
164 /* Support for legacy operators where 187 /* Support for legacy operators where
@@ -188,8 +211,9 @@ static struct audit_entry *audit_data_to_entry(struct audit_rule_data *data,
188 int err = 0; 211 int err = 0;
189 struct audit_entry *entry; 212 struct audit_entry *entry;
190 void *bufp; 213 void *bufp;
191 /* size_t remain = datasz - sizeof(struct audit_rule_data); */ 214 size_t remain = datasz - sizeof(struct audit_rule_data);
192 int i; 215 int i;
216 char *str;
193 217
194 entry = audit_to_entry_common((struct audit_rule *)data); 218 entry = audit_to_entry_common((struct audit_rule *)data);
195 if (IS_ERR(entry)) 219 if (IS_ERR(entry))
@@ -207,10 +231,35 @@ static struct audit_entry *audit_data_to_entry(struct audit_rule_data *data,
207 231
208 f->op = data->fieldflags[i] & AUDIT_OPERATORS; 232 f->op = data->fieldflags[i] & AUDIT_OPERATORS;
209 f->type = data->fields[i]; 233 f->type = data->fields[i];
234 f->val = data->values[i];
235 f->se_str = NULL;
236 f->se_rule = NULL;
210 switch(f->type) { 237 switch(f->type) {
211 /* call type-specific conversion routines here */ 238 case AUDIT_SE_USER:
212 default: 239 case AUDIT_SE_ROLE:
213 f->val = data->values[i]; 240 case AUDIT_SE_TYPE:
241 case AUDIT_SE_SEN:
242 case AUDIT_SE_CLR:
243 str = audit_unpack_string(&bufp, &remain, f->val);
244 if (IS_ERR(str))
245 goto exit_free;
246 entry->rule.buflen += f->val;
247
248 err = selinux_audit_rule_init(f->type, f->op, str,
249 &f->se_rule);
250 /* Keep currently invalid fields around in case they
251 * become valid after a policy reload. */
252 if (err == -EINVAL) {
253 printk(KERN_WARNING "audit rule for selinux "
254 "\'%s\' is invalid\n", str);
255 err = 0;
256 }
257 if (err) {
258 kfree(str);
259 goto exit_free;
260 } else
261 f->se_str = str;
262 break;
214 } 263 }
215 } 264 }
216 265
@@ -286,7 +335,14 @@ static struct audit_rule_data *audit_krule_to_data(struct audit_krule *krule)
286 data->fields[i] = f->type; 335 data->fields[i] = f->type;
287 data->fieldflags[i] = f->op; 336 data->fieldflags[i] = f->op;
288 switch(f->type) { 337 switch(f->type) {
289 /* call type-specific conversion routines here */ 338 case AUDIT_SE_USER:
339 case AUDIT_SE_ROLE:
340 case AUDIT_SE_TYPE:
341 case AUDIT_SE_SEN:
342 case AUDIT_SE_CLR:
343 data->buflen += data->values[i] =
344 audit_pack_string(&bufp, f->se_str);
345 break;
290 default: 346 default:
291 data->values[i] = f->val; 347 data->values[i] = f->val;
292 } 348 }
@@ -314,7 +370,14 @@ static int audit_compare_rule(struct audit_krule *a, struct audit_krule *b)
314 return 1; 370 return 1;
315 371
316 switch(a->fields[i].type) { 372 switch(a->fields[i].type) {
317 /* call type-specific comparison routines here */ 373 case AUDIT_SE_USER:
374 case AUDIT_SE_ROLE:
375 case AUDIT_SE_TYPE:
376 case AUDIT_SE_SEN:
377 case AUDIT_SE_CLR:
378 if (strcmp(a->fields[i].se_str, b->fields[i].se_str))
379 return 1;
380 break;
318 default: 381 default:
319 if (a->fields[i].val != b->fields[i].val) 382 if (a->fields[i].val != b->fields[i].val)
320 return 1; 383 return 1;
@@ -328,6 +391,81 @@ static int audit_compare_rule(struct audit_krule *a, struct audit_krule *b)
328 return 0; 391 return 0;
329} 392}
330 393
394/* Duplicate selinux field information. The se_rule is opaque, so must be
395 * re-initialized. */
396static inline int audit_dupe_selinux_field(struct audit_field *df,
397 struct audit_field *sf)
398{
399 int ret = 0;
400 char *se_str;
401
402 /* our own copy of se_str */
403 se_str = kstrdup(sf->se_str, GFP_KERNEL);
404 if (unlikely(IS_ERR(se_str)))
405 return -ENOMEM;
406 df->se_str = se_str;
407
408 /* our own (refreshed) copy of se_rule */
409 ret = selinux_audit_rule_init(df->type, df->op, df->se_str,
410 &df->se_rule);
411 /* Keep currently invalid fields around in case they
412 * become valid after a policy reload. */
413 if (ret == -EINVAL) {
414 printk(KERN_WARNING "audit rule for selinux \'%s\' is "
415 "invalid\n", df->se_str);
416 ret = 0;
417 }
418
419 return ret;
420}
421
422/* Duplicate an audit rule. This will be a deep copy with the exception
423 * of the watch - that pointer is carried over. The selinux specific fields
424 * will be updated in the copy. The point is to be able to replace the old
425 * rule with the new rule in the filterlist, then free the old rule. */
426static struct audit_entry *audit_dupe_rule(struct audit_krule *old)
427{
428 u32 fcount = old->field_count;
429 struct audit_entry *entry;
430 struct audit_krule *new;
431 int i, err = 0;
432
433 entry = audit_init_entry(fcount);
434 if (unlikely(!entry))
435 return ERR_PTR(-ENOMEM);
436
437 new = &entry->rule;
438 new->vers_ops = old->vers_ops;
439 new->flags = old->flags;
440 new->listnr = old->listnr;
441 new->action = old->action;
442 for (i = 0; i < AUDIT_BITMASK_SIZE; i++)
443 new->mask[i] = old->mask[i];
444 new->buflen = old->buflen;
445 new->field_count = old->field_count;
446 memcpy(new->fields, old->fields, sizeof(struct audit_field) * fcount);
447
448 /* deep copy this information, updating the se_rule fields, because
449 * the originals will all be freed when the old rule is freed. */
450 for (i = 0; i < fcount; i++) {
451 switch (new->fields[i].type) {
452 case AUDIT_SE_USER:
453 case AUDIT_SE_ROLE:
454 case AUDIT_SE_TYPE:
455 case AUDIT_SE_SEN:
456 case AUDIT_SE_CLR:
457 err = audit_dupe_selinux_field(&new->fields[i],
458 &old->fields[i]);
459 }
460 if (err) {
461 audit_free_rule(entry);
462 return ERR_PTR(err);
463 }
464 }
465
466 return entry;
467}
468
331/* Add rule to given filterlist if not a duplicate. Protected by 469/* Add rule to given filterlist if not a duplicate. Protected by
332 * audit_netlink_mutex. */ 470 * audit_netlink_mutex. */
333static inline int audit_add_rule(struct audit_entry *entry, 471static inline int audit_add_rule(struct audit_entry *entry,
@@ -448,9 +586,10 @@ static int audit_list_rules(void *_dest)
448 * @data: payload data 586 * @data: payload data
449 * @datasz: size of payload data 587 * @datasz: size of payload data
450 * @loginuid: loginuid of sender 588 * @loginuid: loginuid of sender
589 * @sid: SE Linux Security ID of sender
451 */ 590 */
452int audit_receive_filter(int type, int pid, int uid, int seq, void *data, 591int audit_receive_filter(int type, int pid, int uid, int seq, void *data,
453 size_t datasz, uid_t loginuid) 592 size_t datasz, uid_t loginuid, u32 sid)
454{ 593{
455 struct task_struct *tsk; 594 struct task_struct *tsk;
456 int *dest; 595 int *dest;
@@ -493,9 +632,23 @@ int audit_receive_filter(int type, int pid, int uid, int seq, void *data,
493 632
494 err = audit_add_rule(entry, 633 err = audit_add_rule(entry,
495 &audit_filter_list[entry->rule.listnr]); 634 &audit_filter_list[entry->rule.listnr]);
496 audit_log(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE, 635 if (sid) {
497 "auid=%u add rule to list=%d res=%d\n", 636 char *ctx = NULL;
498 loginuid, entry->rule.listnr, !err); 637 u32 len;
638 if (selinux_ctxid_to_string(sid, &ctx, &len)) {
639 /* Maybe call audit_panic? */
640 audit_log(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE,
641 "auid=%u ssid=%u add rule to list=%d res=%d",
642 loginuid, sid, entry->rule.listnr, !err);
643 } else
644 audit_log(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE,
645 "auid=%u subj=%s add rule to list=%d res=%d",
646 loginuid, ctx, entry->rule.listnr, !err);
647 kfree(ctx);
648 } else
649 audit_log(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE,
650 "auid=%u add rule to list=%d res=%d",
651 loginuid, entry->rule.listnr, !err);
499 652
500 if (err) 653 if (err)
501 audit_free_rule(entry); 654 audit_free_rule(entry);
@@ -511,9 +664,24 @@ int audit_receive_filter(int type, int pid, int uid, int seq, void *data,
511 664
512 err = audit_del_rule(entry, 665 err = audit_del_rule(entry,
513 &audit_filter_list[entry->rule.listnr]); 666 &audit_filter_list[entry->rule.listnr]);
514 audit_log(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE, 667
515 "auid=%u remove rule from list=%d res=%d\n", 668 if (sid) {
516 loginuid, entry->rule.listnr, !err); 669 char *ctx = NULL;
670 u32 len;
671 if (selinux_ctxid_to_string(sid, &ctx, &len)) {
672 /* Maybe call audit_panic? */
673 audit_log(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE,
674 "auid=%u ssid=%u remove rule from list=%d res=%d",
675 loginuid, sid, entry->rule.listnr, !err);
676 } else
677 audit_log(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE,
678 "auid=%u subj=%s remove rule from list=%d res=%d",
679 loginuid, ctx, entry->rule.listnr, !err);
680 kfree(ctx);
681 } else
682 audit_log(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE,
683 "auid=%u remove rule from list=%d res=%d",
684 loginuid, entry->rule.listnr, !err);
517 685
518 audit_free_rule(entry); 686 audit_free_rule(entry);
519 break; 687 break;
@@ -628,3 +796,62 @@ unlock_and_return:
628 rcu_read_unlock(); 796 rcu_read_unlock();
629 return result; 797 return result;
630} 798}
799
800/* Check to see if the rule contains any selinux fields. Returns 1 if there
801 are selinux fields specified in the rule, 0 otherwise. */
802static inline int audit_rule_has_selinux(struct audit_krule *rule)
803{
804 int i;
805
806 for (i = 0; i < rule->field_count; i++) {
807 struct audit_field *f = &rule->fields[i];
808 switch (f->type) {
809 case AUDIT_SE_USER:
810 case AUDIT_SE_ROLE:
811 case AUDIT_SE_TYPE:
812 case AUDIT_SE_SEN:
813 case AUDIT_SE_CLR:
814 return 1;
815 }
816 }
817
818 return 0;
819}
820
821/* This function will re-initialize the se_rule field of all applicable rules.
822 * It will traverse the filter lists serarching for rules that contain selinux
823 * specific filter fields. When such a rule is found, it is copied, the
824 * selinux field is re-initialized, and the old rule is replaced with the
825 * updated rule. */
826int selinux_audit_rule_update(void)
827{
828 struct audit_entry *entry, *n, *nentry;
829 int i, err = 0;
830
831 /* audit_netlink_mutex synchronizes the writers */
832 mutex_lock(&audit_netlink_mutex);
833
834 for (i = 0; i < AUDIT_NR_FILTERS; i++) {
835 list_for_each_entry_safe(entry, n, &audit_filter_list[i], list) {
836 if (!audit_rule_has_selinux(&entry->rule))
837 continue;
838
839 nentry = audit_dupe_rule(&entry->rule);
840 if (unlikely(IS_ERR(nentry))) {
841 /* save the first error encountered for the
842 * return value */
843 if (!err)
844 err = PTR_ERR(nentry);
845 audit_panic("error updating selinux filters");
846 list_del_rcu(&entry->list);
847 } else {
848 list_replace_rcu(&entry->list, &nentry->list);
849 }
850 call_rcu(&entry->rcu, audit_free_rule_rcu);
851 }
852 }
853
854 mutex_unlock(&audit_netlink_mutex);
855
856 return err;
857}
diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index 7f160df21a23..1c03a4ed1b27 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -58,6 +58,7 @@
58#include <linux/security.h> 58#include <linux/security.h>
59#include <linux/list.h> 59#include <linux/list.h>
60#include <linux/tty.h> 60#include <linux/tty.h>
61#include <linux/selinux.h>
61 62
62#include "audit.h" 63#include "audit.h"
63 64
@@ -89,7 +90,7 @@ struct audit_names {
89 uid_t uid; 90 uid_t uid;
90 gid_t gid; 91 gid_t gid;
91 dev_t rdev; 92 dev_t rdev;
92 char *ctx; 93 u32 osid;
93}; 94};
94 95
95struct audit_aux_data { 96struct audit_aux_data {
@@ -106,7 +107,7 @@ struct audit_aux_data_ipcctl {
106 uid_t uid; 107 uid_t uid;
107 gid_t gid; 108 gid_t gid;
108 mode_t mode; 109 mode_t mode;
109 char *ctx; 110 u32 osid;
110}; 111};
111 112
112struct audit_aux_data_socketcall { 113struct audit_aux_data_socketcall {
@@ -167,7 +168,8 @@ static int audit_filter_rules(struct task_struct *tsk,
167 struct audit_context *ctx, 168 struct audit_context *ctx,
168 enum audit_state *state) 169 enum audit_state *state)
169{ 170{
170 int i, j; 171 int i, j, need_sid = 1;
172 u32 sid;
171 173
172 for (i = 0; i < rule->field_count; i++) { 174 for (i = 0; i < rule->field_count; i++) {
173 struct audit_field *f = &rule->fields[i]; 175 struct audit_field *f = &rule->fields[i];
@@ -257,6 +259,27 @@ static int audit_filter_rules(struct task_struct *tsk,
257 if (ctx) 259 if (ctx)
258 result = audit_comparator(ctx->loginuid, f->op, f->val); 260 result = audit_comparator(ctx->loginuid, f->op, f->val);
259 break; 261 break;
262 case AUDIT_SE_USER:
263 case AUDIT_SE_ROLE:
264 case AUDIT_SE_TYPE:
265 case AUDIT_SE_SEN:
266 case AUDIT_SE_CLR:
267 /* NOTE: this may return negative values indicating
268 a temporary error. We simply treat this as a
269 match for now to avoid losing information that
270 may be wanted. An error message will also be
271 logged upon error */
272 if (f->se_rule) {
273 if (need_sid) {
274 selinux_task_ctxid(tsk, &sid);
275 need_sid = 0;
276 }
277 result = selinux_audit_rule_match(sid, f->type,
278 f->op,
279 f->se_rule,
280 ctx);
281 }
282 break;
260 case AUDIT_ARG0: 283 case AUDIT_ARG0:
261 case AUDIT_ARG1: 284 case AUDIT_ARG1:
262 case AUDIT_ARG2: 285 case AUDIT_ARG2:
@@ -329,7 +352,6 @@ static enum audit_state audit_filter_syscall(struct task_struct *tsk,
329 return AUDIT_BUILD_CONTEXT; 352 return AUDIT_BUILD_CONTEXT;
330} 353}
331 354
332/* This should be called with task_lock() held. */
333static inline struct audit_context *audit_get_context(struct task_struct *tsk, 355static inline struct audit_context *audit_get_context(struct task_struct *tsk,
334 int return_valid, 356 int return_valid,
335 int return_code) 357 int return_code)
@@ -391,9 +413,6 @@ static inline void audit_free_names(struct audit_context *context)
391#endif 413#endif
392 414
393 for (i = 0; i < context->name_count; i++) { 415 for (i = 0; i < context->name_count; i++) {
394 char *p = context->names[i].ctx;
395 context->names[i].ctx = NULL;
396 kfree(p);
397 if (context->names[i].name) 416 if (context->names[i].name)
398 __putname(context->names[i].name); 417 __putname(context->names[i].name);
399 } 418 }
@@ -416,11 +435,6 @@ static inline void audit_free_aux(struct audit_context *context)
416 dput(axi->dentry); 435 dput(axi->dentry);
417 mntput(axi->mnt); 436 mntput(axi->mnt);
418 } 437 }
419 if ( aux->type == AUDIT_IPC ) {
420 struct audit_aux_data_ipcctl *axi = (void *)aux;
421 if (axi->ctx)
422 kfree(axi->ctx);
423 }
424 438
425 context->aux = aux->next; 439 context->aux = aux->next;
426 kfree(aux); 440 kfree(aux);
@@ -506,7 +520,7 @@ static inline void audit_free_context(struct audit_context *context)
506 printk(KERN_ERR "audit: freed %d contexts\n", count); 520 printk(KERN_ERR "audit: freed %d contexts\n", count);
507} 521}
508 522
509static void audit_log_task_context(struct audit_buffer *ab, gfp_t gfp_mask) 523static void audit_log_task_context(struct audit_buffer *ab)
510{ 524{
511 char *ctx = NULL; 525 char *ctx = NULL;
512 ssize_t len = 0; 526 ssize_t len = 0;
@@ -518,7 +532,7 @@ static void audit_log_task_context(struct audit_buffer *ab, gfp_t gfp_mask)
518 return; 532 return;
519 } 533 }
520 534
521 ctx = kmalloc(len, gfp_mask); 535 ctx = kmalloc(len, GFP_KERNEL);
522 if (!ctx) 536 if (!ctx)
523 goto error_path; 537 goto error_path;
524 538
@@ -536,47 +550,46 @@ error_path:
536 return; 550 return;
537} 551}
538 552
539static void audit_log_task_info(struct audit_buffer *ab, gfp_t gfp_mask) 553static void audit_log_task_info(struct audit_buffer *ab, struct task_struct *tsk)
540{ 554{
541 char name[sizeof(current->comm)]; 555 char name[sizeof(tsk->comm)];
542 struct mm_struct *mm = current->mm; 556 struct mm_struct *mm = tsk->mm;
543 struct vm_area_struct *vma; 557 struct vm_area_struct *vma;
544 558
545 get_task_comm(name, current); 559 /* tsk == current */
560
561 get_task_comm(name, tsk);
546 audit_log_format(ab, " comm="); 562 audit_log_format(ab, " comm=");
547 audit_log_untrustedstring(ab, name); 563 audit_log_untrustedstring(ab, name);
548 564
549 if (!mm) 565 if (mm) {
550 return; 566 down_read(&mm->mmap_sem);
551 567 vma = mm->mmap;
552 /* 568 while (vma) {
553 * this is brittle; all callers that pass GFP_ATOMIC will have 569 if ((vma->vm_flags & VM_EXECUTABLE) &&
554 * NULL current->mm and we won't get here. 570 vma->vm_file) {
555 */ 571 audit_log_d_path(ab, "exe=",
556 down_read(&mm->mmap_sem); 572 vma->vm_file->f_dentry,
557 vma = mm->mmap; 573 vma->vm_file->f_vfsmnt);
558 while (vma) { 574 break;
559 if ((vma->vm_flags & VM_EXECUTABLE) && 575 }
560 vma->vm_file) { 576 vma = vma->vm_next;
561 audit_log_d_path(ab, "exe=",
562 vma->vm_file->f_dentry,
563 vma->vm_file->f_vfsmnt);
564 break;
565 } 577 }
566 vma = vma->vm_next; 578 up_read(&mm->mmap_sem);
567 } 579 }
568 up_read(&mm->mmap_sem); 580 audit_log_task_context(ab);
569 audit_log_task_context(ab, gfp_mask);
570} 581}
571 582
572static void audit_log_exit(struct audit_context *context, gfp_t gfp_mask) 583static void audit_log_exit(struct audit_context *context, struct task_struct *tsk)
573{ 584{
574 int i; 585 int i, call_panic = 0;
575 struct audit_buffer *ab; 586 struct audit_buffer *ab;
576 struct audit_aux_data *aux; 587 struct audit_aux_data *aux;
577 const char *tty; 588 const char *tty;
578 589
579 ab = audit_log_start(context, gfp_mask, AUDIT_SYSCALL); 590 /* tsk == current */
591
592 ab = audit_log_start(context, GFP_KERNEL, AUDIT_SYSCALL);
580 if (!ab) 593 if (!ab)
581 return; /* audit_panic has been called */ 594 return; /* audit_panic has been called */
582 audit_log_format(ab, "arch=%x syscall=%d", 595 audit_log_format(ab, "arch=%x syscall=%d",
@@ -587,8 +600,8 @@ static void audit_log_exit(struct audit_context *context, gfp_t gfp_mask)
587 audit_log_format(ab, " success=%s exit=%ld", 600 audit_log_format(ab, " success=%s exit=%ld",
588 (context->return_valid==AUDITSC_SUCCESS)?"yes":"no", 601 (context->return_valid==AUDITSC_SUCCESS)?"yes":"no",
589 context->return_code); 602 context->return_code);
590 if (current->signal->tty && current->signal->tty->name) 603 if (tsk->signal && tsk->signal->tty && tsk->signal->tty->name)
591 tty = current->signal->tty->name; 604 tty = tsk->signal->tty->name;
592 else 605 else
593 tty = "(none)"; 606 tty = "(none)";
594 audit_log_format(ab, 607 audit_log_format(ab,
@@ -607,12 +620,12 @@ static void audit_log_exit(struct audit_context *context, gfp_t gfp_mask)
607 context->gid, 620 context->gid,
608 context->euid, context->suid, context->fsuid, 621 context->euid, context->suid, context->fsuid,
609 context->egid, context->sgid, context->fsgid, tty); 622 context->egid, context->sgid, context->fsgid, tty);
610 audit_log_task_info(ab, gfp_mask); 623 audit_log_task_info(ab, tsk);
611 audit_log_end(ab); 624 audit_log_end(ab);
612 625
613 for (aux = context->aux; aux; aux = aux->next) { 626 for (aux = context->aux; aux; aux = aux->next) {
614 627
615 ab = audit_log_start(context, gfp_mask, aux->type); 628 ab = audit_log_start(context, GFP_KERNEL, aux->type);
616 if (!ab) 629 if (!ab)
617 continue; /* audit_panic has been called */ 630 continue; /* audit_panic has been called */
618 631
@@ -620,8 +633,39 @@ static void audit_log_exit(struct audit_context *context, gfp_t gfp_mask)
620 case AUDIT_IPC: { 633 case AUDIT_IPC: {
621 struct audit_aux_data_ipcctl *axi = (void *)aux; 634 struct audit_aux_data_ipcctl *axi = (void *)aux;
622 audit_log_format(ab, 635 audit_log_format(ab,
623 " qbytes=%lx iuid=%u igid=%u mode=%x obj=%s", 636 " qbytes=%lx iuid=%u igid=%u mode=%x",
624 axi->qbytes, axi->uid, axi->gid, axi->mode, axi->ctx); 637 axi->qbytes, axi->uid, axi->gid, axi->mode);
638 if (axi->osid != 0) {
639 char *ctx = NULL;
640 u32 len;
641 if (selinux_ctxid_to_string(
642 axi->osid, &ctx, &len)) {
643 audit_log_format(ab, " osid=%u",
644 axi->osid);
645 call_panic = 1;
646 } else
647 audit_log_format(ab, " obj=%s", ctx);
648 kfree(ctx);
649 }
650 break; }
651
652 case AUDIT_IPC_SET_PERM: {
653 struct audit_aux_data_ipcctl *axi = (void *)aux;
654 audit_log_format(ab,
655 " new qbytes=%lx new iuid=%u new igid=%u new mode=%x",
656 axi->qbytes, axi->uid, axi->gid, axi->mode);
657 if (axi->osid != 0) {
658 char *ctx = NULL;
659 u32 len;
660 if (selinux_ctxid_to_string(
661 axi->osid, &ctx, &len)) {
662 audit_log_format(ab, " osid=%u",
663 axi->osid);
664 call_panic = 1;
665 } else
666 audit_log_format(ab, " obj=%s", ctx);
667 kfree(ctx);
668 }
625 break; } 669 break; }
626 670
627 case AUDIT_SOCKETCALL: { 671 case AUDIT_SOCKETCALL: {
@@ -649,7 +693,7 @@ static void audit_log_exit(struct audit_context *context, gfp_t gfp_mask)
649 } 693 }
650 694
651 if (context->pwd && context->pwdmnt) { 695 if (context->pwd && context->pwdmnt) {
652 ab = audit_log_start(context, gfp_mask, AUDIT_CWD); 696 ab = audit_log_start(context, GFP_KERNEL, AUDIT_CWD);
653 if (ab) { 697 if (ab) {
654 audit_log_d_path(ab, "cwd=", context->pwd, context->pwdmnt); 698 audit_log_d_path(ab, "cwd=", context->pwd, context->pwdmnt);
655 audit_log_end(ab); 699 audit_log_end(ab);
@@ -659,7 +703,7 @@ static void audit_log_exit(struct audit_context *context, gfp_t gfp_mask)
659 unsigned long ino = context->names[i].ino; 703 unsigned long ino = context->names[i].ino;
660 unsigned long pino = context->names[i].pino; 704 unsigned long pino = context->names[i].pino;
661 705
662 ab = audit_log_start(context, gfp_mask, AUDIT_PATH); 706 ab = audit_log_start(context, GFP_KERNEL, AUDIT_PATH);
663 if (!ab) 707 if (!ab)
664 continue; /* audit_panic has been called */ 708 continue; /* audit_panic has been called */
665 709
@@ -685,32 +729,35 @@ static void audit_log_exit(struct audit_context *context, gfp_t gfp_mask)
685 context->names[i].gid, 729 context->names[i].gid,
686 MAJOR(context->names[i].rdev), 730 MAJOR(context->names[i].rdev),
687 MINOR(context->names[i].rdev)); 731 MINOR(context->names[i].rdev));
688 if (context->names[i].ctx) { 732 if (context->names[i].osid != 0) {
689 audit_log_format(ab, " obj=%s", 733 char *ctx = NULL;
690 context->names[i].ctx); 734 u32 len;
735 if (selinux_ctxid_to_string(
736 context->names[i].osid, &ctx, &len)) {
737 audit_log_format(ab, " osid=%u",
738 context->names[i].osid);
739 call_panic = 2;
740 } else
741 audit_log_format(ab, " obj=%s", ctx);
742 kfree(ctx);
691 } 743 }
692 744
693 audit_log_end(ab); 745 audit_log_end(ab);
694 } 746 }
747 if (call_panic)
748 audit_panic("error converting sid to string");
695} 749}
696 750
697/** 751/**
698 * audit_free - free a per-task audit context 752 * audit_free - free a per-task audit context
699 * @tsk: task whose audit context block to free 753 * @tsk: task whose audit context block to free
700 * 754 *
701 * Called from copy_process and __put_task_struct. 755 * Called from copy_process and do_exit
702 */ 756 */
703void audit_free(struct task_struct *tsk) 757void audit_free(struct task_struct *tsk)
704{ 758{
705 struct audit_context *context; 759 struct audit_context *context;
706 760
707 /*
708 * No need to lock the task - when we execute audit_free()
709 * then the task has no external references anymore, and
710 * we are tearing it down. (The locking also confuses
711 * DEBUG_LOCKDEP - this freeing may occur in softirq
712 * contexts as well, via RCU.)
713 */
714 context = audit_get_context(tsk, 0, 0); 761 context = audit_get_context(tsk, 0, 0);
715 if (likely(!context)) 762 if (likely(!context))
716 return; 763 return;
@@ -719,8 +766,9 @@ void audit_free(struct task_struct *tsk)
719 * function (e.g., exit_group), then free context block. 766 * function (e.g., exit_group), then free context block.
720 * We use GFP_ATOMIC here because we might be doing this 767 * We use GFP_ATOMIC here because we might be doing this
721 * in the context of the idle thread */ 768 * in the context of the idle thread */
769 /* that can happen only if we are called from do_exit() */
722 if (context->in_syscall && context->auditable) 770 if (context->in_syscall && context->auditable)
723 audit_log_exit(context, GFP_ATOMIC); 771 audit_log_exit(context, tsk);
724 772
725 audit_free_context(context); 773 audit_free_context(context);
726} 774}
@@ -743,10 +791,11 @@ void audit_free(struct task_struct *tsk)
743 * will only be written if another part of the kernel requests that it 791 * will only be written if another part of the kernel requests that it
744 * be written). 792 * be written).
745 */ 793 */
746void audit_syscall_entry(struct task_struct *tsk, int arch, int major, 794void audit_syscall_entry(int arch, int major,
747 unsigned long a1, unsigned long a2, 795 unsigned long a1, unsigned long a2,
748 unsigned long a3, unsigned long a4) 796 unsigned long a3, unsigned long a4)
749{ 797{
798 struct task_struct *tsk = current;
750 struct audit_context *context = tsk->audit_context; 799 struct audit_context *context = tsk->audit_context;
751 enum audit_state state; 800 enum audit_state state;
752 801
@@ -824,22 +873,18 @@ void audit_syscall_entry(struct task_struct *tsk, int arch, int major,
824 * message), then write out the syscall information. In call cases, 873 * message), then write out the syscall information. In call cases,
825 * free the names stored from getname(). 874 * free the names stored from getname().
826 */ 875 */
827void audit_syscall_exit(struct task_struct *tsk, int valid, long return_code) 876void audit_syscall_exit(int valid, long return_code)
828{ 877{
878 struct task_struct *tsk = current;
829 struct audit_context *context; 879 struct audit_context *context;
830 880
831 get_task_struct(tsk);
832 task_lock(tsk);
833 context = audit_get_context(tsk, valid, return_code); 881 context = audit_get_context(tsk, valid, return_code);
834 task_unlock(tsk);
835 882
836 /* Not having a context here is ok, since the parent may have
837 * called __put_task_struct. */
838 if (likely(!context)) 883 if (likely(!context))
839 goto out; 884 return;
840 885
841 if (context->in_syscall && context->auditable) 886 if (context->in_syscall && context->auditable)
842 audit_log_exit(context, GFP_KERNEL); 887 audit_log_exit(context, tsk);
843 888
844 context->in_syscall = 0; 889 context->in_syscall = 0;
845 context->auditable = 0; 890 context->auditable = 0;
@@ -854,8 +899,6 @@ void audit_syscall_exit(struct task_struct *tsk, int valid, long return_code)
854 audit_free_aux(context); 899 audit_free_aux(context);
855 tsk->audit_context = context; 900 tsk->audit_context = context;
856 } 901 }
857 out:
858 put_task_struct(tsk);
859} 902}
860 903
861/** 904/**
@@ -936,40 +979,11 @@ void audit_putname(const char *name)
936#endif 979#endif
937} 980}
938 981
939void audit_inode_context(int idx, const struct inode *inode) 982static void audit_inode_context(int idx, const struct inode *inode)
940{ 983{
941 struct audit_context *context = current->audit_context; 984 struct audit_context *context = current->audit_context;
942 const char *suffix = security_inode_xattr_getsuffix();
943 char *ctx = NULL;
944 int len = 0;
945
946 if (!suffix)
947 goto ret;
948
949 len = security_inode_getsecurity(inode, suffix, NULL, 0, 0);
950 if (len == -EOPNOTSUPP)
951 goto ret;
952 if (len < 0)
953 goto error_path;
954
955 ctx = kmalloc(len, GFP_KERNEL);
956 if (!ctx)
957 goto error_path;
958 985
959 len = security_inode_getsecurity(inode, suffix, ctx, len, 0); 986 selinux_get_inode_sid(inode, &context->names[idx].osid);
960 if (len < 0)
961 goto error_path;
962
963 kfree(context->names[idx].ctx);
964 context->names[idx].ctx = ctx;
965 goto ret;
966
967error_path:
968 if (ctx)
969 kfree(ctx);
970 audit_panic("error in audit_inode_context");
971ret:
972 return;
973} 987}
974 988
975 989
@@ -1155,40 +1169,37 @@ uid_t audit_get_loginuid(struct audit_context *ctx)
1155 return ctx ? ctx->loginuid : -1; 1169 return ctx ? ctx->loginuid : -1;
1156} 1170}
1157 1171
1158static char *audit_ipc_context(struct kern_ipc_perm *ipcp) 1172/**
1173 * audit_ipc_obj - record audit data for ipc object
1174 * @ipcp: ipc permissions
1175 *
1176 * Returns 0 for success or NULL context or < 0 on error.
1177 */
1178int audit_ipc_obj(struct kern_ipc_perm *ipcp)
1159{ 1179{
1180 struct audit_aux_data_ipcctl *ax;
1160 struct audit_context *context = current->audit_context; 1181 struct audit_context *context = current->audit_context;
1161 char *ctx = NULL;
1162 int len = 0;
1163 1182
1164 if (likely(!context)) 1183 if (likely(!context))
1165 return NULL; 1184 return 0;
1166
1167 len = security_ipc_getsecurity(ipcp, NULL, 0);
1168 if (len == -EOPNOTSUPP)
1169 goto ret;
1170 if (len < 0)
1171 goto error_path;
1172
1173 ctx = kmalloc(len, GFP_ATOMIC);
1174 if (!ctx)
1175 goto error_path;
1176 1185
1177 len = security_ipc_getsecurity(ipcp, ctx, len); 1186 ax = kmalloc(sizeof(*ax), GFP_ATOMIC);
1178 if (len < 0) 1187 if (!ax)
1179 goto error_path; 1188 return -ENOMEM;
1180 1189
1181 return ctx; 1190 ax->uid = ipcp->uid;
1191 ax->gid = ipcp->gid;
1192 ax->mode = ipcp->mode;
1193 selinux_get_ipc_sid(ipcp, &ax->osid);
1182 1194
1183error_path: 1195 ax->d.type = AUDIT_IPC;
1184 kfree(ctx); 1196 ax->d.next = context->aux;
1185 audit_panic("error in audit_ipc_context"); 1197 context->aux = (void *)ax;
1186ret: 1198 return 0;
1187 return NULL;
1188} 1199}
1189 1200
1190/** 1201/**
1191 * audit_ipc_perms - record audit data for ipc 1202 * audit_ipc_set_perm - record audit data for new ipc permissions
1192 * @qbytes: msgq bytes 1203 * @qbytes: msgq bytes
1193 * @uid: msgq user id 1204 * @uid: msgq user id
1194 * @gid: msgq group id 1205 * @gid: msgq group id
@@ -1196,7 +1207,7 @@ ret:
1196 * 1207 *
1197 * Returns 0 for success or NULL context or < 0 on error. 1208 * Returns 0 for success or NULL context or < 0 on error.
1198 */ 1209 */
1199int audit_ipc_perms(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode, struct kern_ipc_perm *ipcp) 1210int audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode, struct kern_ipc_perm *ipcp)
1200{ 1211{
1201 struct audit_aux_data_ipcctl *ax; 1212 struct audit_aux_data_ipcctl *ax;
1202 struct audit_context *context = current->audit_context; 1213 struct audit_context *context = current->audit_context;
@@ -1212,9 +1223,9 @@ int audit_ipc_perms(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode, str
1212 ax->uid = uid; 1223 ax->uid = uid;
1213 ax->gid = gid; 1224 ax->gid = gid;
1214 ax->mode = mode; 1225 ax->mode = mode;
1215 ax->ctx = audit_ipc_context(ipcp); 1226 selinux_get_ipc_sid(ipcp, &ax->osid);
1216 1227
1217 ax->d.type = AUDIT_IPC; 1228 ax->d.type = AUDIT_IPC_SET_PERM;
1218 ax->d.next = context->aux; 1229 ax->d.next = context->aux;
1219 context->aux = (void *)ax; 1230 context->aux = (void *)ax;
1220 return 0; 1231 return 0;
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index 72248d1b9e3f..ab81fdd4572b 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -2231,19 +2231,25 @@ static const struct cpuset *nearest_exclusive_ancestor(const struct cpuset *cs)
2231 * So only GFP_KERNEL allocations, if all nodes in the cpuset are 2231 * So only GFP_KERNEL allocations, if all nodes in the cpuset are
2232 * short of memory, might require taking the callback_mutex mutex. 2232 * short of memory, might require taking the callback_mutex mutex.
2233 * 2233 *
2234 * The first loop over the zonelist in mm/page_alloc.c:__alloc_pages() 2234 * The first call here from mm/page_alloc:get_page_from_freelist()
2235 * calls here with __GFP_HARDWALL always set in gfp_mask, enforcing 2235 * has __GFP_HARDWALL set in gfp_mask, enforcing hardwall cpusets, so
2236 * hardwall cpusets - no allocation on a node outside the cpuset is 2236 * no allocation on a node outside the cpuset is allowed (unless in
2237 * allowed (unless in interrupt, of course). 2237 * interrupt, of course).
2238 * 2238 *
2239 * The second loop doesn't even call here for GFP_ATOMIC requests 2239 * The second pass through get_page_from_freelist() doesn't even call
2240 * (if the __alloc_pages() local variable 'wait' is set). That check 2240 * here for GFP_ATOMIC calls. For those calls, the __alloc_pages()
2241 * and the checks below have the combined affect in the second loop of 2241 * variable 'wait' is not set, and the bit ALLOC_CPUSET is not set
2242 * the __alloc_pages() routine that: 2242 * in alloc_flags. That logic and the checks below have the combined
2243 * affect that:
2243 * in_interrupt - any node ok (current task context irrelevant) 2244 * in_interrupt - any node ok (current task context irrelevant)
2244 * GFP_ATOMIC - any node ok 2245 * GFP_ATOMIC - any node ok
2245 * GFP_KERNEL - any node in enclosing mem_exclusive cpuset ok 2246 * GFP_KERNEL - any node in enclosing mem_exclusive cpuset ok
2246 * GFP_USER - only nodes in current tasks mems allowed ok. 2247 * GFP_USER - only nodes in current tasks mems allowed ok.
2248 *
2249 * Rule:
2250 * Don't call cpuset_zone_allowed() if you can't sleep, unless you
2251 * pass in the __GFP_HARDWALL flag set in gfp_flag, which disables
2252 * the code that might scan up ancestor cpusets and sleep.
2247 **/ 2253 **/
2248 2254
2249int __cpuset_zone_allowed(struct zone *z, gfp_t gfp_mask) 2255int __cpuset_zone_allowed(struct zone *z, gfp_t gfp_mask)
@@ -2255,6 +2261,7 @@ int __cpuset_zone_allowed(struct zone *z, gfp_t gfp_mask)
2255 if (in_interrupt()) 2261 if (in_interrupt())
2256 return 1; 2262 return 1;
2257 node = z->zone_pgdat->node_id; 2263 node = z->zone_pgdat->node_id;
2264 might_sleep_if(!(gfp_mask & __GFP_HARDWALL));
2258 if (node_isset(node, current->mems_allowed)) 2265 if (node_isset(node, current->mems_allowed))
2259 return 1; 2266 return 1;
2260 if (gfp_mask & __GFP_HARDWALL) /* If hardwall request, stop here */ 2267 if (gfp_mask & __GFP_HARDWALL) /* If hardwall request, stop here */
diff --git a/kernel/exit.c b/kernel/exit.c
index 1a9787ac6173..e95b93282210 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -35,6 +35,7 @@
35#include <linux/futex.h> 35#include <linux/futex.h>
36#include <linux/compat.h> 36#include <linux/compat.h>
37#include <linux/pipe_fs_i.h> 37#include <linux/pipe_fs_i.h>
38#include <linux/audit.h> /* for audit_free() */
38 39
39#include <asm/uaccess.h> 40#include <asm/uaccess.h>
40#include <asm/unistd.h> 41#include <asm/unistd.h>
@@ -56,7 +57,7 @@ static void __unhash_process(struct task_struct *p)
56 detach_pid(p, PIDTYPE_PGID); 57 detach_pid(p, PIDTYPE_PGID);
57 detach_pid(p, PIDTYPE_SID); 58 detach_pid(p, PIDTYPE_SID);
58 59
59 list_del_init(&p->tasks); 60 list_del_rcu(&p->tasks);
60 __get_cpu_var(process_counts)--; 61 __get_cpu_var(process_counts)--;
61 } 62 }
62 list_del_rcu(&p->thread_group); 63 list_del_rcu(&p->thread_group);
@@ -910,6 +911,8 @@ fastcall NORET_TYPE void do_exit(long code)
910 if (unlikely(tsk->compat_robust_list)) 911 if (unlikely(tsk->compat_robust_list))
911 compat_exit_robust_list(tsk); 912 compat_exit_robust_list(tsk);
912#endif 913#endif
914 if (unlikely(tsk->audit_context))
915 audit_free(tsk);
913 exit_mm(tsk); 916 exit_mm(tsk);
914 917
915 exit_sem(tsk); 918 exit_sem(tsk);
diff --git a/kernel/extable.c b/kernel/extable.c
index 7501b531ceed..7fe262855317 100644
--- a/kernel/extable.c
+++ b/kernel/extable.c
@@ -40,7 +40,7 @@ const struct exception_table_entry *search_exception_tables(unsigned long addr)
40 return e; 40 return e;
41} 41}
42 42
43static int core_kernel_text(unsigned long addr) 43int core_kernel_text(unsigned long addr)
44{ 44{
45 if (addr >= (unsigned long)_stext && 45 if (addr >= (unsigned long)_stext &&
46 addr <= (unsigned long)_etext) 46 addr <= (unsigned long)_etext)
diff --git a/kernel/fork.c b/kernel/fork.c
index 3384eb89cb1c..ac8100e3088a 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -114,8 +114,6 @@ void __put_task_struct(struct task_struct *tsk)
114 WARN_ON(atomic_read(&tsk->usage)); 114 WARN_ON(atomic_read(&tsk->usage));
115 WARN_ON(tsk == current); 115 WARN_ON(tsk == current);
116 116
117 if (unlikely(tsk->audit_context))
118 audit_free(tsk);
119 security_task_free(tsk); 117 security_task_free(tsk);
120 free_uid(tsk->user); 118 free_uid(tsk->user);
121 put_group_info(tsk->group_info); 119 put_group_info(tsk->group_info);
@@ -124,12 +122,6 @@ void __put_task_struct(struct task_struct *tsk)
124 free_task(tsk); 122 free_task(tsk);
125} 123}
126 124
127void __put_task_struct_cb(struct rcu_head *rhp)
128{
129 struct task_struct *tsk = container_of(rhp, struct task_struct, rcu);
130 __put_task_struct(tsk);
131}
132
133void __init fork_init(unsigned long mempages) 125void __init fork_init(unsigned long mempages)
134{ 126{
135#ifndef __HAVE_ARCH_TASK_STRUCT_ALLOCATOR 127#ifndef __HAVE_ARCH_TASK_STRUCT_ALLOCATOR
@@ -186,6 +178,7 @@ static struct task_struct *dup_task_struct(struct task_struct *orig)
186 atomic_set(&tsk->usage,2); 178 atomic_set(&tsk->usage,2);
187 atomic_set(&tsk->fs_excl, 0); 179 atomic_set(&tsk->fs_excl, 0);
188 tsk->btrace_seq = 0; 180 tsk->btrace_seq = 0;
181 tsk->splice_pipe = NULL;
189 return tsk; 182 return tsk;
190} 183}
191 184
@@ -1210,7 +1203,7 @@ static task_t *copy_process(unsigned long clone_flags,
1210 attach_pid(p, PIDTYPE_PGID, process_group(p)); 1203 attach_pid(p, PIDTYPE_PGID, process_group(p));
1211 attach_pid(p, PIDTYPE_SID, p->signal->session); 1204 attach_pid(p, PIDTYPE_SID, p->signal->session);
1212 1205
1213 list_add_tail(&p->tasks, &init_task.tasks); 1206 list_add_tail_rcu(&p->tasks, &init_task.tasks);
1214 __get_cpu_var(process_counts)++; 1207 __get_cpu_var(process_counts)++;
1215 } 1208 }
1216 attach_pid(p, PIDTYPE_PID, p->pid); 1209 attach_pid(p, PIDTYPE_PID, p->pid);
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index d2a7296c8251..01fa2ae98a85 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -456,6 +456,7 @@ hrtimer_start(struct hrtimer *timer, ktime_t tim, const enum hrtimer_mode mode)
456 456
457 return ret; 457 return ret;
458} 458}
459EXPORT_SYMBOL_GPL(hrtimer_start);
459 460
460/** 461/**
461 * hrtimer_try_to_cancel - try to deactivate a timer 462 * hrtimer_try_to_cancel - try to deactivate a timer
@@ -484,6 +485,7 @@ int hrtimer_try_to_cancel(struct hrtimer *timer)
484 return ret; 485 return ret;
485 486
486} 487}
488EXPORT_SYMBOL_GPL(hrtimer_try_to_cancel);
487 489
488/** 490/**
489 * hrtimer_cancel - cancel a timer and wait for the handler to finish. 491 * hrtimer_cancel - cancel a timer and wait for the handler to finish.
@@ -504,6 +506,7 @@ int hrtimer_cancel(struct hrtimer *timer)
504 cpu_relax(); 506 cpu_relax();
505 } 507 }
506} 508}
509EXPORT_SYMBOL_GPL(hrtimer_cancel);
507 510
508/** 511/**
509 * hrtimer_get_remaining - get remaining time for the timer 512 * hrtimer_get_remaining - get remaining time for the timer
@@ -522,6 +525,7 @@ ktime_t hrtimer_get_remaining(const struct hrtimer *timer)
522 525
523 return rem; 526 return rem;
524} 527}
528EXPORT_SYMBOL_GPL(hrtimer_get_remaining);
525 529
526#ifdef CONFIG_NO_IDLE_HZ 530#ifdef CONFIG_NO_IDLE_HZ
527/** 531/**
@@ -580,6 +584,7 @@ void hrtimer_init(struct hrtimer *timer, clockid_t clock_id,
580 timer->base = &bases[clock_id]; 584 timer->base = &bases[clock_id];
581 timer->node.rb_parent = HRTIMER_INACTIVE; 585 timer->node.rb_parent = HRTIMER_INACTIVE;
582} 586}
587EXPORT_SYMBOL_GPL(hrtimer_init);
583 588
584/** 589/**
585 * hrtimer_get_res - get the timer resolution for a clock 590 * hrtimer_get_res - get the timer resolution for a clock
@@ -599,6 +604,7 @@ int hrtimer_get_res(const clockid_t which_clock, struct timespec *tp)
599 604
600 return 0; 605 return 0;
601} 606}
607EXPORT_SYMBOL_GPL(hrtimer_get_res);
602 608
603/* 609/*
604 * Expire the per base hrtimer-queue: 610 * Expire the per base hrtimer-queue:
@@ -836,7 +842,7 @@ static void migrate_hrtimers(int cpu)
836} 842}
837#endif /* CONFIG_HOTPLUG_CPU */ 843#endif /* CONFIG_HOTPLUG_CPU */
838 844
839static int __devinit hrtimer_cpu_notify(struct notifier_block *self, 845static int hrtimer_cpu_notify(struct notifier_block *self,
840 unsigned long action, void *hcpu) 846 unsigned long action, void *hcpu)
841{ 847{
842 long cpu = (long)hcpu; 848 long cpu = (long)hcpu;
@@ -860,7 +866,7 @@ static int __devinit hrtimer_cpu_notify(struct notifier_block *self,
860 return NOTIFY_OK; 866 return NOTIFY_OK;
861} 867}
862 868
863static struct notifier_block __devinitdata hrtimers_nb = { 869static struct notifier_block hrtimers_nb = {
864 .notifier_call = hrtimer_cpu_notify, 870 .notifier_call = hrtimer_cpu_notify,
865}; 871};
866 872
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index ac766ad573e8..1279e3499534 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -246,8 +246,10 @@ int setup_irq(unsigned int irq, struct irqaction * new)
246 246
247mismatch: 247mismatch:
248 spin_unlock_irqrestore(&desc->lock, flags); 248 spin_unlock_irqrestore(&desc->lock, flags);
249 printk(KERN_ERR "%s: irq handler mismatch\n", __FUNCTION__); 249 if (!(new->flags & SA_PROBEIRQ)) {
250 dump_stack(); 250 printk(KERN_ERR "%s: irq handler mismatch\n", __FUNCTION__);
251 dump_stack();
252 }
251 return -EBUSY; 253 return -EBUSY;
252} 254}
253 255
diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index 1156eb0977d0..1fbf466a29aa 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -585,6 +585,9 @@ int __kprobes register_kretprobe(struct kretprobe *rp)
585 int i; 585 int i;
586 586
587 rp->kp.pre_handler = pre_handler_kretprobe; 587 rp->kp.pre_handler = pre_handler_kretprobe;
588 rp->kp.post_handler = NULL;
589 rp->kp.fault_handler = NULL;
590 rp->kp.break_handler = NULL;
588 591
589 /* Pre-allocate memory for max kretprobe instances */ 592 /* Pre-allocate memory for max kretprobe instances */
590 if (rp->maxactive <= 0) { 593 if (rp->maxactive <= 0) {
diff --git a/kernel/module.c b/kernel/module.c
index d24deb0dbbc9..bbe04862e1b0 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -705,14 +705,14 @@ EXPORT_SYMBOL(__symbol_put);
705 705
706void symbol_put_addr(void *addr) 706void symbol_put_addr(void *addr)
707{ 707{
708 unsigned long flags; 708 struct module *modaddr;
709 709
710 spin_lock_irqsave(&modlist_lock, flags); 710 if (core_kernel_text((unsigned long)addr))
711 if (!kernel_text_address((unsigned long)addr)) 711 return;
712 BUG();
713 712
714 module_put(module_text_address((unsigned long)addr)); 713 if (!(modaddr = module_text_address((unsigned long)addr)))
715 spin_unlock_irqrestore(&modlist_lock, flags); 714 BUG();
715 module_put(modaddr);
716} 716}
717EXPORT_SYMBOL_GPL(symbol_put_addr); 717EXPORT_SYMBOL_GPL(symbol_put_addr);
718 718
diff --git a/kernel/power/main.c b/kernel/power/main.c
index ee371f50ccaa..a6d9ef46009e 100644
--- a/kernel/power/main.c
+++ b/kernel/power/main.c
@@ -272,7 +272,7 @@ static ssize_t state_store(struct subsystem * subsys, const char * buf, size_t n
272 if (*s && !strncmp(buf, *s, len)) 272 if (*s && !strncmp(buf, *s, len))
273 break; 273 break;
274 } 274 }
275 if (*s) 275 if (state < PM_SUSPEND_MAX && *s)
276 error = enter_state(state); 276 error = enter_state(state);
277 else 277 else
278 error = -EINVAL; 278 error = -EINVAL;
diff --git a/kernel/power/pm.c b/kernel/power/pm.c
index 0f6908cce1dd..84063ac8fcfc 100644
--- a/kernel/power/pm.c
+++ b/kernel/power/pm.c
@@ -75,25 +75,6 @@ struct pm_dev *pm_register(pm_dev_t type,
75 return dev; 75 return dev;
76} 76}
77 77
78/**
79 * pm_unregister - unregister a device with power management
80 * @dev: device to unregister
81 *
82 * Remove a device from the power management notification lists. The
83 * dev passed must be a handle previously returned by pm_register.
84 */
85
86void pm_unregister(struct pm_dev *dev)
87{
88 if (dev) {
89 mutex_lock(&pm_devs_lock);
90 list_del(&dev->entry);
91 mutex_unlock(&pm_devs_lock);
92
93 kfree(dev);
94 }
95}
96
97static void __pm_unregister(struct pm_dev *dev) 78static void __pm_unregister(struct pm_dev *dev)
98{ 79{
99 if (dev) { 80 if (dev) {
@@ -258,7 +239,6 @@ int pm_send_all(pm_request_t rqst, void *data)
258} 239}
259 240
260EXPORT_SYMBOL(pm_register); 241EXPORT_SYMBOL(pm_register);
261EXPORT_SYMBOL(pm_unregister);
262EXPORT_SYMBOL(pm_unregister_all); 242EXPORT_SYMBOL(pm_unregister_all);
263EXPORT_SYMBOL(pm_send_all); 243EXPORT_SYMBOL(pm_send_all);
264EXPORT_SYMBOL(pm_active); 244EXPORT_SYMBOL(pm_active);
diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c
index c5863d02c89e..3eeedbb13b78 100644
--- a/kernel/power/snapshot.c
+++ b/kernel/power/snapshot.c
@@ -240,14 +240,15 @@ static void copy_data_pages(struct pbe *pblist)
240 * free_pagedir - free pages allocated with alloc_pagedir() 240 * free_pagedir - free pages allocated with alloc_pagedir()
241 */ 241 */
242 242
243static void free_pagedir(struct pbe *pblist) 243static void free_pagedir(struct pbe *pblist, int clear_nosave_free)
244{ 244{
245 struct pbe *pbe; 245 struct pbe *pbe;
246 246
247 while (pblist) { 247 while (pblist) {
248 pbe = (pblist + PB_PAGE_SKIP)->next; 248 pbe = (pblist + PB_PAGE_SKIP)->next;
249 ClearPageNosave(virt_to_page(pblist)); 249 ClearPageNosave(virt_to_page(pblist));
250 ClearPageNosaveFree(virt_to_page(pblist)); 250 if (clear_nosave_free)
251 ClearPageNosaveFree(virt_to_page(pblist));
251 free_page((unsigned long)pblist); 252 free_page((unsigned long)pblist);
252 pblist = pbe; 253 pblist = pbe;
253 } 254 }
@@ -389,7 +390,7 @@ struct pbe *alloc_pagedir(unsigned int nr_pages, gfp_t gfp_mask, int safe_needed
389 pbe->next = alloc_image_page(gfp_mask, safe_needed); 390 pbe->next = alloc_image_page(gfp_mask, safe_needed);
390 } 391 }
391 if (!pbe) { /* get_zeroed_page() failed */ 392 if (!pbe) { /* get_zeroed_page() failed */
392 free_pagedir(pblist); 393 free_pagedir(pblist, 1);
393 pblist = NULL; 394 pblist = NULL;
394 } else 395 } else
395 create_pbe_list(pblist, nr_pages); 396 create_pbe_list(pblist, nr_pages);
@@ -736,7 +737,7 @@ static int create_image(struct snapshot_handle *handle)
736 pblist = alloc_pagedir(nr_copy_pages, GFP_ATOMIC, 1); 737 pblist = alloc_pagedir(nr_copy_pages, GFP_ATOMIC, 1);
737 if (pblist) 738 if (pblist)
738 copy_page_backup_list(pblist, p); 739 copy_page_backup_list(pblist, p);
739 free_pagedir(p); 740 free_pagedir(p, 0);
740 if (!pblist) 741 if (!pblist)
741 error = -ENOMEM; 742 error = -ENOMEM;
742 } 743 }
diff --git a/kernel/profile.c b/kernel/profile.c
index 5a730fdb1a2c..68afe121e507 100644
--- a/kernel/profile.c
+++ b/kernel/profile.c
@@ -299,7 +299,7 @@ out:
299} 299}
300 300
301#ifdef CONFIG_HOTPLUG_CPU 301#ifdef CONFIG_HOTPLUG_CPU
302static int __devinit profile_cpu_callback(struct notifier_block *info, 302static int profile_cpu_callback(struct notifier_block *info,
303 unsigned long action, void *__cpu) 303 unsigned long action, void *__cpu)
304{ 304{
305 int node, cpu = (unsigned long)__cpu; 305 int node, cpu = (unsigned long)__cpu;
diff --git a/kernel/ptrace.c b/kernel/ptrace.c
index 0eeb7e66722c..921c22ad16e4 100644
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
@@ -56,10 +56,6 @@ void ptrace_untrace(task_t *child)
56 signal_wake_up(child, 1); 56 signal_wake_up(child, 1);
57 } 57 }
58 } 58 }
59 if (child->signal->flags & SIGNAL_GROUP_EXIT) {
60 sigaddset(&child->pending.signal, SIGKILL);
61 signal_wake_up(child, 1);
62 }
63 spin_unlock(&child->sighand->siglock); 59 spin_unlock(&child->sighand->siglock);
64} 60}
65 61
@@ -81,7 +77,8 @@ void __ptrace_unlink(task_t *child)
81 add_parent(child); 77 add_parent(child);
82 } 78 }
83 79
84 ptrace_untrace(child); 80 if (child->state == TASK_TRACED)
81 ptrace_untrace(child);
85} 82}
86 83
87/* 84/*
@@ -151,12 +148,34 @@ int ptrace_may_attach(struct task_struct *task)
151int ptrace_attach(struct task_struct *task) 148int ptrace_attach(struct task_struct *task)
152{ 149{
153 int retval; 150 int retval;
154 task_lock(task); 151
155 retval = -EPERM; 152 retval = -EPERM;
156 if (task->pid <= 1) 153 if (task->pid <= 1)
157 goto bad; 154 goto out;
158 if (task->tgid == current->tgid) 155 if (task->tgid == current->tgid)
159 goto bad; 156 goto out;
157
158repeat:
159 /*
160 * Nasty, nasty.
161 *
162 * We want to hold both the task-lock and the
163 * tasklist_lock for writing at the same time.
164 * But that's against the rules (tasklist_lock
165 * is taken for reading by interrupts on other
166 * cpu's that may have task_lock).
167 */
168 task_lock(task);
169 local_irq_disable();
170 if (!write_trylock(&tasklist_lock)) {
171 local_irq_enable();
172 task_unlock(task);
173 do {
174 cpu_relax();
175 } while (!write_can_lock(&tasklist_lock));
176 goto repeat;
177 }
178
160 /* the same process cannot be attached many times */ 179 /* the same process cannot be attached many times */
161 if (task->ptrace & PT_PTRACED) 180 if (task->ptrace & PT_PTRACED)
162 goto bad; 181 goto bad;
@@ -169,17 +188,15 @@ int ptrace_attach(struct task_struct *task)
169 ? PT_ATTACHED : 0); 188 ? PT_ATTACHED : 0);
170 if (capable(CAP_SYS_PTRACE)) 189 if (capable(CAP_SYS_PTRACE))
171 task->ptrace |= PT_PTRACE_CAP; 190 task->ptrace |= PT_PTRACE_CAP;
172 task_unlock(task);
173 191
174 write_lock_irq(&tasklist_lock);
175 __ptrace_link(task, current); 192 __ptrace_link(task, current);
176 write_unlock_irq(&tasklist_lock);
177 193
178 force_sig_specific(SIGSTOP, task); 194 force_sig_specific(SIGSTOP, task);
179 return 0;
180 195
181bad: 196bad:
197 write_unlock_irq(&tasklist_lock);
182 task_unlock(task); 198 task_unlock(task);
199out:
183 return retval; 200 return retval;
184} 201}
185 202
@@ -420,21 +437,22 @@ int ptrace_request(struct task_struct *child, long request,
420 */ 437 */
421int ptrace_traceme(void) 438int ptrace_traceme(void)
422{ 439{
423 int ret; 440 int ret = -EPERM;
424 441
425 /* 442 /*
426 * Are we already being traced? 443 * Are we already being traced?
427 */ 444 */
428 if (current->ptrace & PT_PTRACED) 445 task_lock(current);
429 return -EPERM; 446 if (!(current->ptrace & PT_PTRACED)) {
430 ret = security_ptrace(current->parent, current); 447 ret = security_ptrace(current->parent, current);
431 if (ret) 448 /*
432 return -EPERM; 449 * Set the ptrace bit in the process ptrace flags.
433 /* 450 */
434 * Set the ptrace bit in the process ptrace flags. 451 if (!ret)
435 */ 452 current->ptrace |= PT_PTRACED;
436 current->ptrace |= PT_PTRACED; 453 }
437 return 0; 454 task_unlock(current);
455 return ret;
438} 456}
439 457
440/** 458/**
diff --git a/kernel/rcupdate.c b/kernel/rcupdate.c
index 13458bbaa1be..2058f88c7bbb 100644
--- a/kernel/rcupdate.c
+++ b/kernel/rcupdate.c
@@ -479,12 +479,31 @@ static int __rcu_pending(struct rcu_ctrlblk *rcp, struct rcu_data *rdp)
479 return 0; 479 return 0;
480} 480}
481 481
482/*
483 * Check to see if there is any immediate RCU-related work to be done
484 * by the current CPU, returning 1 if so. This function is part of the
485 * RCU implementation; it is -not- an exported member of the RCU API.
486 */
482int rcu_pending(int cpu) 487int rcu_pending(int cpu)
483{ 488{
484 return __rcu_pending(&rcu_ctrlblk, &per_cpu(rcu_data, cpu)) || 489 return __rcu_pending(&rcu_ctrlblk, &per_cpu(rcu_data, cpu)) ||
485 __rcu_pending(&rcu_bh_ctrlblk, &per_cpu(rcu_bh_data, cpu)); 490 __rcu_pending(&rcu_bh_ctrlblk, &per_cpu(rcu_bh_data, cpu));
486} 491}
487 492
493/*
494 * Check to see if any future RCU-related work will need to be done
495 * by the current CPU, even if none need be done immediately, returning
496 * 1 if so. This function is part of the RCU implementation; it is -not-
497 * an exported member of the RCU API.
498 */
499int rcu_needs_cpu(int cpu)
500{
501 struct rcu_data *rdp = &per_cpu(rcu_data, cpu);
502 struct rcu_data *rdp_bh = &per_cpu(rcu_bh_data, cpu);
503
504 return (!!rdp->curlist || !!rdp_bh->curlist || rcu_pending(cpu));
505}
506
488void rcu_check_callbacks(int cpu, int user) 507void rcu_check_callbacks(int cpu, int user)
489{ 508{
490 if (user || 509 if (user ||
@@ -520,7 +539,7 @@ static void __devinit rcu_online_cpu(int cpu)
520 tasklet_init(&per_cpu(rcu_tasklet, cpu), rcu_process_callbacks, 0UL); 539 tasklet_init(&per_cpu(rcu_tasklet, cpu), rcu_process_callbacks, 0UL);
521} 540}
522 541
523static int __devinit rcu_cpu_notify(struct notifier_block *self, 542static int rcu_cpu_notify(struct notifier_block *self,
524 unsigned long action, void *hcpu) 543 unsigned long action, void *hcpu)
525{ 544{
526 long cpu = (long)hcpu; 545 long cpu = (long)hcpu;
@@ -537,7 +556,7 @@ static int __devinit rcu_cpu_notify(struct notifier_block *self,
537 return NOTIFY_OK; 556 return NOTIFY_OK;
538} 557}
539 558
540static struct notifier_block __devinitdata rcu_nb = { 559static struct notifier_block rcu_nb = {
541 .notifier_call = rcu_cpu_notify, 560 .notifier_call = rcu_cpu_notify,
542}; 561};
543 562
diff --git a/kernel/sched.c b/kernel/sched.c
index 365f0b90b4de..c13f1bd2df7d 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -665,55 +665,13 @@ static int effective_prio(task_t *p)
665} 665}
666 666
667/* 667/*
668 * We place interactive tasks back into the active array, if possible.
669 *
670 * To guarantee that this does not starve expired tasks we ignore the
671 * interactivity of a task if the first expired task had to wait more
672 * than a 'reasonable' amount of time. This deadline timeout is
673 * load-dependent, as the frequency of array switched decreases with
674 * increasing number of running tasks. We also ignore the interactivity
675 * if a better static_prio task has expired, and switch periodically
676 * regardless, to ensure that highly interactive tasks do not starve
677 * the less fortunate for unreasonably long periods.
678 */
679static inline int expired_starving(runqueue_t *rq)
680{
681 int limit;
682
683 /*
684 * Arrays were recently switched, all is well
685 */
686 if (!rq->expired_timestamp)
687 return 0;
688
689 limit = STARVATION_LIMIT * rq->nr_running;
690
691 /*
692 * It's time to switch arrays
693 */
694 if (jiffies - rq->expired_timestamp >= limit)
695 return 1;
696
697 /*
698 * There's a better selection in the expired array
699 */
700 if (rq->curr->static_prio > rq->best_expired_prio)
701 return 1;
702
703 /*
704 * All is well
705 */
706 return 0;
707}
708
709/*
710 * __activate_task - move a task to the runqueue. 668 * __activate_task - move a task to the runqueue.
711 */ 669 */
712static void __activate_task(task_t *p, runqueue_t *rq) 670static void __activate_task(task_t *p, runqueue_t *rq)
713{ 671{
714 prio_array_t *target = rq->active; 672 prio_array_t *target = rq->active;
715 673
716 if (unlikely(batch_task(p) || (expired_starving(rq) && !rt_task(p)))) 674 if (batch_task(p))
717 target = rq->expired; 675 target = rq->expired;
718 enqueue_task(p, target); 676 enqueue_task(p, target);
719 rq->nr_running++; 677 rq->nr_running++;
@@ -2532,6 +2490,22 @@ unsigned long long current_sched_time(const task_t *tsk)
2532} 2490}
2533 2491
2534/* 2492/*
2493 * We place interactive tasks back into the active array, if possible.
2494 *
2495 * To guarantee that this does not starve expired tasks we ignore the
2496 * interactivity of a task if the first expired task had to wait more
2497 * than a 'reasonable' amount of time. This deadline timeout is
2498 * load-dependent, as the frequency of array switched decreases with
2499 * increasing number of running tasks. We also ignore the interactivity
2500 * if a better static_prio task has expired:
2501 */
2502#define EXPIRED_STARVING(rq) \
2503 ((STARVATION_LIMIT && ((rq)->expired_timestamp && \
2504 (jiffies - (rq)->expired_timestamp >= \
2505 STARVATION_LIMIT * ((rq)->nr_running) + 1))) || \
2506 ((rq)->curr->static_prio > (rq)->best_expired_prio))
2507
2508/*
2535 * Account user cpu time to a process. 2509 * Account user cpu time to a process.
2536 * @p: the process that the cpu time gets accounted to 2510 * @p: the process that the cpu time gets accounted to
2537 * @hardirq_offset: the offset to subtract from hardirq_count() 2511 * @hardirq_offset: the offset to subtract from hardirq_count()
@@ -2666,7 +2640,7 @@ void scheduler_tick(void)
2666 2640
2667 if (!rq->expired_timestamp) 2641 if (!rq->expired_timestamp)
2668 rq->expired_timestamp = jiffies; 2642 rq->expired_timestamp = jiffies;
2669 if (!TASK_INTERACTIVE(p) || expired_starving(rq)) { 2643 if (!TASK_INTERACTIVE(p) || EXPIRED_STARVING(rq)) {
2670 enqueue_task(p, rq->expired); 2644 enqueue_task(p, rq->expired);
2671 if (p->static_prio < rq->best_expired_prio) 2645 if (p->static_prio < rq->best_expired_prio)
2672 rq->best_expired_prio = p->static_prio; 2646 rq->best_expired_prio = p->static_prio;
@@ -4814,7 +4788,7 @@ static int migration_call(struct notifier_block *nfb, unsigned long action,
4814/* Register at highest priority so that task migration (migrate_all_tasks) 4788/* Register at highest priority so that task migration (migrate_all_tasks)
4815 * happens before everything else. 4789 * happens before everything else.
4816 */ 4790 */
4817static struct notifier_block __devinitdata migration_notifier = { 4791static struct notifier_block migration_notifier = {
4818 .notifier_call = migration_call, 4792 .notifier_call = migration_call,
4819 .priority = 10 4793 .priority = 10
4820}; 4794};
diff --git a/kernel/signal.c b/kernel/signal.c
index b14f895027c3..e5f8aea78ffe 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -1754,9 +1754,9 @@ relock:
1754 /* Let the debugger run. */ 1754 /* Let the debugger run. */
1755 ptrace_stop(signr, signr, info); 1755 ptrace_stop(signr, signr, info);
1756 1756
1757 /* We're back. Did the debugger cancel the sig or group_exit? */ 1757 /* We're back. Did the debugger cancel the sig? */
1758 signr = current->exit_code; 1758 signr = current->exit_code;
1759 if (signr == 0 || current->signal->flags & SIGNAL_GROUP_EXIT) 1759 if (signr == 0)
1760 continue; 1760 continue;
1761 1761
1762 current->exit_code = 0; 1762 current->exit_code = 0;
diff --git a/kernel/softirq.c b/kernel/softirq.c
index ec8fed42a86f..336f92d64e2e 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -446,7 +446,7 @@ static void takeover_tasklets(unsigned int cpu)
446} 446}
447#endif /* CONFIG_HOTPLUG_CPU */ 447#endif /* CONFIG_HOTPLUG_CPU */
448 448
449static int __devinit cpu_callback(struct notifier_block *nfb, 449static int cpu_callback(struct notifier_block *nfb,
450 unsigned long action, 450 unsigned long action,
451 void *hcpu) 451 void *hcpu)
452{ 452{
@@ -484,7 +484,7 @@ static int __devinit cpu_callback(struct notifier_block *nfb,
484 return NOTIFY_OK; 484 return NOTIFY_OK;
485} 485}
486 486
487static struct notifier_block __devinitdata cpu_nfb = { 487static struct notifier_block cpu_nfb = {
488 .notifier_call = cpu_callback 488 .notifier_call = cpu_callback
489}; 489};
490 490
diff --git a/kernel/softlockup.c b/kernel/softlockup.c
index ced91e1ff564..14c7faf02909 100644
--- a/kernel/softlockup.c
+++ b/kernel/softlockup.c
@@ -104,7 +104,7 @@ static int watchdog(void * __bind_cpu)
104/* 104/*
105 * Create/destroy watchdog threads as CPUs come and go: 105 * Create/destroy watchdog threads as CPUs come and go:
106 */ 106 */
107static int __devinit 107static int
108cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) 108cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
109{ 109{
110 int hotcpu = (unsigned long)hcpu; 110 int hotcpu = (unsigned long)hcpu;
@@ -140,7 +140,7 @@ cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
140 return NOTIFY_OK; 140 return NOTIFY_OK;
141} 141}
142 142
143static struct notifier_block __devinitdata cpu_nfb = { 143static struct notifier_block cpu_nfb = {
144 .notifier_call = cpu_callback 144 .notifier_call = cpu_callback
145}; 145};
146 146
diff --git a/kernel/timer.c b/kernel/timer.c
index 883773788836..9e49deed468c 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -541,6 +541,22 @@ found:
541 } 541 }
542 spin_unlock(&base->lock); 542 spin_unlock(&base->lock);
543 543
544 /*
545 * It can happen that other CPUs service timer IRQs and increment
546 * jiffies, but we have not yet got a local timer tick to process
547 * the timer wheels. In that case, the expiry time can be before
548 * jiffies, but since the high-resolution timer here is relative to
549 * jiffies, the default expression when high-resolution timers are
550 * not active,
551 *
552 * time_before(MAX_JIFFY_OFFSET + jiffies, expires)
553 *
554 * would falsely evaluate to true. If that is the case, just
555 * return jiffies so that we can immediately fire the local timer
556 */
557 if (time_before(expires, jiffies))
558 return jiffies;
559
544 if (time_before(hr_expires, expires)) 560 if (time_before(hr_expires, expires))
545 return hr_expires; 561 return hr_expires;
546 562
@@ -1314,7 +1330,7 @@ static void __devinit migrate_timers(int cpu)
1314} 1330}
1315#endif /* CONFIG_HOTPLUG_CPU */ 1331#endif /* CONFIG_HOTPLUG_CPU */
1316 1332
1317static int __devinit timer_cpu_notify(struct notifier_block *self, 1333static int timer_cpu_notify(struct notifier_block *self,
1318 unsigned long action, void *hcpu) 1334 unsigned long action, void *hcpu)
1319{ 1335{
1320 long cpu = (long)hcpu; 1336 long cpu = (long)hcpu;
@@ -1334,7 +1350,7 @@ static int __devinit timer_cpu_notify(struct notifier_block *self,
1334 return NOTIFY_OK; 1350 return NOTIFY_OK;
1335} 1351}
1336 1352
1337static struct notifier_block __devinitdata timers_nb = { 1353static struct notifier_block timers_nb = {
1338 .notifier_call = timer_cpu_notify, 1354 .notifier_call = timer_cpu_notify,
1339}; 1355};
1340 1356
diff --git a/kernel/uid16.c b/kernel/uid16.c
index aa25605027c8..187e2a423878 100644
--- a/kernel/uid16.c
+++ b/kernel/uid16.c
@@ -20,43 +20,67 @@
20 20
21asmlinkage long sys_chown16(const char __user * filename, old_uid_t user, old_gid_t group) 21asmlinkage long sys_chown16(const char __user * filename, old_uid_t user, old_gid_t group)
22{ 22{
23 return sys_chown(filename, low2highuid(user), low2highgid(group)); 23 long ret = sys_chown(filename, low2highuid(user), low2highgid(group));
24 /* avoid REGPARM breakage on x86: */
25 prevent_tail_call(ret);
26 return ret;
24} 27}
25 28
26asmlinkage long sys_lchown16(const char __user * filename, old_uid_t user, old_gid_t group) 29asmlinkage long sys_lchown16(const char __user * filename, old_uid_t user, old_gid_t group)
27{ 30{
28 return sys_lchown(filename, low2highuid(user), low2highgid(group)); 31 long ret = sys_lchown(filename, low2highuid(user), low2highgid(group));
32 /* avoid REGPARM breakage on x86: */
33 prevent_tail_call(ret);
34 return ret;
29} 35}
30 36
31asmlinkage long sys_fchown16(unsigned int fd, old_uid_t user, old_gid_t group) 37asmlinkage long sys_fchown16(unsigned int fd, old_uid_t user, old_gid_t group)
32{ 38{
33 return sys_fchown(fd, low2highuid(user), low2highgid(group)); 39 long ret = sys_fchown(fd, low2highuid(user), low2highgid(group));
40 /* avoid REGPARM breakage on x86: */
41 prevent_tail_call(ret);
42 return ret;
34} 43}
35 44
36asmlinkage long sys_setregid16(old_gid_t rgid, old_gid_t egid) 45asmlinkage long sys_setregid16(old_gid_t rgid, old_gid_t egid)
37{ 46{
38 return sys_setregid(low2highgid(rgid), low2highgid(egid)); 47 long ret = sys_setregid(low2highgid(rgid), low2highgid(egid));
48 /* avoid REGPARM breakage on x86: */
49 prevent_tail_call(ret);
50 return ret;
39} 51}
40 52
41asmlinkage long sys_setgid16(old_gid_t gid) 53asmlinkage long sys_setgid16(old_gid_t gid)
42{ 54{
43 return sys_setgid(low2highgid(gid)); 55 long ret = sys_setgid(low2highgid(gid));
56 /* avoid REGPARM breakage on x86: */
57 prevent_tail_call(ret);
58 return ret;
44} 59}
45 60
46asmlinkage long sys_setreuid16(old_uid_t ruid, old_uid_t euid) 61asmlinkage long sys_setreuid16(old_uid_t ruid, old_uid_t euid)
47{ 62{
48 return sys_setreuid(low2highuid(ruid), low2highuid(euid)); 63 long ret = sys_setreuid(low2highuid(ruid), low2highuid(euid));
64 /* avoid REGPARM breakage on x86: */
65 prevent_tail_call(ret);
66 return ret;
49} 67}
50 68
51asmlinkage long sys_setuid16(old_uid_t uid) 69asmlinkage long sys_setuid16(old_uid_t uid)
52{ 70{
53 return sys_setuid(low2highuid(uid)); 71 long ret = sys_setuid(low2highuid(uid));
72 /* avoid REGPARM breakage on x86: */
73 prevent_tail_call(ret);
74 return ret;
54} 75}
55 76
56asmlinkage long sys_setresuid16(old_uid_t ruid, old_uid_t euid, old_uid_t suid) 77asmlinkage long sys_setresuid16(old_uid_t ruid, old_uid_t euid, old_uid_t suid)
57{ 78{
58 return sys_setresuid(low2highuid(ruid), low2highuid(euid), 79 long ret = sys_setresuid(low2highuid(ruid), low2highuid(euid),
59 low2highuid(suid)); 80 low2highuid(suid));
81 /* avoid REGPARM breakage on x86: */
82 prevent_tail_call(ret);
83 return ret;
60} 84}
61 85
62asmlinkage long sys_getresuid16(old_uid_t __user *ruid, old_uid_t __user *euid, old_uid_t __user *suid) 86asmlinkage long sys_getresuid16(old_uid_t __user *ruid, old_uid_t __user *euid, old_uid_t __user *suid)
@@ -72,8 +96,11 @@ asmlinkage long sys_getresuid16(old_uid_t __user *ruid, old_uid_t __user *euid,
72 96
73asmlinkage long sys_setresgid16(old_gid_t rgid, old_gid_t egid, old_gid_t sgid) 97asmlinkage long sys_setresgid16(old_gid_t rgid, old_gid_t egid, old_gid_t sgid)
74{ 98{
75 return sys_setresgid(low2highgid(rgid), low2highgid(egid), 99 long ret = sys_setresgid(low2highgid(rgid), low2highgid(egid),
76 low2highgid(sgid)); 100 low2highgid(sgid));
101 /* avoid REGPARM breakage on x86: */
102 prevent_tail_call(ret);
103 return ret;
77} 104}
78 105
79asmlinkage long sys_getresgid16(old_gid_t __user *rgid, old_gid_t __user *egid, old_gid_t __user *sgid) 106asmlinkage long sys_getresgid16(old_gid_t __user *rgid, old_gid_t __user *egid, old_gid_t __user *sgid)
@@ -89,12 +116,18 @@ asmlinkage long sys_getresgid16(old_gid_t __user *rgid, old_gid_t __user *egid,
89 116
90asmlinkage long sys_setfsuid16(old_uid_t uid) 117asmlinkage long sys_setfsuid16(old_uid_t uid)
91{ 118{
92 return sys_setfsuid(low2highuid(uid)); 119 long ret = sys_setfsuid(low2highuid(uid));
120 /* avoid REGPARM breakage on x86: */
121 prevent_tail_call(ret);
122 return ret;
93} 123}
94 124
95asmlinkage long sys_setfsgid16(old_gid_t gid) 125asmlinkage long sys_setfsgid16(old_gid_t gid)
96{ 126{
97 return sys_setfsgid(low2highgid(gid)); 127 long ret = sys_setfsgid(low2highgid(gid));
128 /* avoid REGPARM breakage on x86: */
129 prevent_tail_call(ret);
130 return ret;
98} 131}
99 132
100static int groups16_to_user(old_gid_t __user *grouplist, 133static int groups16_to_user(old_gid_t __user *grouplist,
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index e9e464a90376..880fb415a8f6 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -547,7 +547,7 @@ static void take_over_work(struct workqueue_struct *wq, unsigned int cpu)
547} 547}
548 548
549/* We're holding the cpucontrol mutex here */ 549/* We're holding the cpucontrol mutex here */
550static int __devinit workqueue_cpu_callback(struct notifier_block *nfb, 550static int workqueue_cpu_callback(struct notifier_block *nfb,
551 unsigned long action, 551 unsigned long action,
552 void *hcpu) 552 void *hcpu)
553{ 553{
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index d57fd9181b18..ccb0c1fdf1b5 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -101,7 +101,7 @@ config DEBUG_PREEMPT
101 101
102config DEBUG_MUTEXES 102config DEBUG_MUTEXES
103 bool "Mutex debugging, deadlock detection" 103 bool "Mutex debugging, deadlock detection"
104 default y 104 default n
105 depends on DEBUG_KERNEL 105 depends on DEBUG_KERNEL
106 help 106 help
107 This allows mutex semantics violations and mutex related deadlocks 107 This allows mutex semantics violations and mutex related deadlocks
@@ -189,7 +189,7 @@ config FRAME_POINTER
189config UNWIND_INFO 189config UNWIND_INFO
190 bool "Compile the kernel with frame unwind information" 190 bool "Compile the kernel with frame unwind information"
191 depends on !IA64 191 depends on !IA64
192 depends on !MODULES || !(MIPS || PARISC || PPC || SUPERH || SPARC64 || V850) 192 depends on !MODULES || !(MIPS || PARISC || PPC || SUPERH || V850)
193 help 193 help
194 If you say Y here the resulting kernel image will be slightly larger 194 If you say Y here the resulting kernel image will be slightly larger
195 but not slower, and it will give very useful debugging information. 195 but not slower, and it will give very useful debugging information.
diff --git a/lib/kobject.c b/lib/kobject.c
index 25204a41a9b0..687ab418d292 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -128,6 +128,7 @@ void kobject_init(struct kobject * kobj)
128{ 128{
129 kref_init(&kobj->kref); 129 kref_init(&kobj->kref);
130 INIT_LIST_HEAD(&kobj->entry); 130 INIT_LIST_HEAD(&kobj->entry);
131 init_waitqueue_head(&kobj->poll);
131 kobj->kset = kset_get(kobj->kset); 132 kobj->kset = kset_get(kobj->kset);
132} 133}
133 134
@@ -197,14 +198,14 @@ int kobject_add(struct kobject * kobj)
197 198
198 /* be noisy on error issues */ 199 /* be noisy on error issues */
199 if (error == -EEXIST) 200 if (error == -EEXIST)
200 printk("kobject_add failed for %s with -EEXIST, " 201 pr_debug("kobject_add failed for %s with -EEXIST, "
201 "don't try to register things with the " 202 "don't try to register things with the "
202 "same name in the same directory.\n", 203 "same name in the same directory.\n",
203 kobject_name(kobj)); 204 kobject_name(kobj));
204 else 205 else
205 printk("kobject_add failed for %s (%d)\n", 206 pr_debug("kobject_add failed for %s (%d)\n",
206 kobject_name(kobj), error); 207 kobject_name(kobj), error);
207 dump_stack(); 208 /* dump_stack(); */
208 } 209 }
209 210
210 return error; 211 return error;
@@ -421,7 +422,6 @@ struct kobject *kobject_add_dir(struct kobject *parent, const char *name)
421 422
422 return k; 423 return k;
423} 424}
424EXPORT_SYMBOL_GPL(kobject_add_dir);
425 425
426/** 426/**
427 * kset_init - initialize a kset for use 427 * kset_init - initialize a kset for use
@@ -568,7 +568,7 @@ int subsys_create_file(struct subsystem * s, struct subsys_attribute * a)
568 * @s: subsystem. 568 * @s: subsystem.
569 * @a: attribute desciptor. 569 * @a: attribute desciptor.
570 */ 570 */
571 571#if 0
572void subsys_remove_file(struct subsystem * s, struct subsys_attribute * a) 572void subsys_remove_file(struct subsystem * s, struct subsys_attribute * a)
573{ 573{
574 if (subsys_get(s)) { 574 if (subsys_get(s)) {
@@ -576,6 +576,7 @@ void subsys_remove_file(struct subsystem * s, struct subsys_attribute * a)
576 subsys_put(s); 576 subsys_put(s);
577 } 577 }
578} 578}
579#endif /* 0 */
579 580
580EXPORT_SYMBOL(kobject_init); 581EXPORT_SYMBOL(kobject_init);
581EXPORT_SYMBOL(kobject_register); 582EXPORT_SYMBOL(kobject_register);
@@ -587,10 +588,7 @@ EXPORT_SYMBOL(kobject_del);
587 588
588EXPORT_SYMBOL(kset_register); 589EXPORT_SYMBOL(kset_register);
589EXPORT_SYMBOL(kset_unregister); 590EXPORT_SYMBOL(kset_unregister);
590EXPORT_SYMBOL(kset_find_obj);
591 591
592EXPORT_SYMBOL(subsystem_init);
593EXPORT_SYMBOL(subsystem_register); 592EXPORT_SYMBOL(subsystem_register);
594EXPORT_SYMBOL(subsystem_unregister); 593EXPORT_SYMBOL(subsystem_unregister);
595EXPORT_SYMBOL(subsys_create_file); 594EXPORT_SYMBOL(subsys_create_file);
596EXPORT_SYMBOL(subsys_remove_file);
diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c
index 982226daf939..7f20e7b857cb 100644
--- a/lib/kobject_uevent.c
+++ b/lib/kobject_uevent.c
@@ -25,11 +25,13 @@
25#define BUFFER_SIZE 2048 /* buffer for the variables */ 25#define BUFFER_SIZE 2048 /* buffer for the variables */
26#define NUM_ENVP 32 /* number of env pointers */ 26#define NUM_ENVP 32 /* number of env pointers */
27 27
28#if defined(CONFIG_HOTPLUG) && defined(CONFIG_NET) 28#if defined(CONFIG_HOTPLUG)
29u64 uevent_seqnum; 29u64 uevent_seqnum;
30char uevent_helper[UEVENT_HELPER_PATH_LEN] = "/sbin/hotplug"; 30char uevent_helper[UEVENT_HELPER_PATH_LEN] = "/sbin/hotplug";
31static DEFINE_SPINLOCK(sequence_lock); 31static DEFINE_SPINLOCK(sequence_lock);
32#if defined(CONFIG_NET)
32static struct sock *uevent_sock; 33static struct sock *uevent_sock;
34#endif
33 35
34static char *action_to_string(enum kobject_action action) 36static char *action_to_string(enum kobject_action action)
35{ 37{
@@ -155,6 +157,7 @@ void kobject_uevent(struct kobject *kobj, enum kobject_action action)
155 spin_unlock(&sequence_lock); 157 spin_unlock(&sequence_lock);
156 sprintf(seq_buff, "SEQNUM=%llu", (unsigned long long)seq); 158 sprintf(seq_buff, "SEQNUM=%llu", (unsigned long long)seq);
157 159
160#if defined(CONFIG_NET)
158 /* send netlink message */ 161 /* send netlink message */
159 if (uevent_sock) { 162 if (uevent_sock) {
160 struct sk_buff *skb; 163 struct sk_buff *skb;
@@ -179,6 +182,7 @@ void kobject_uevent(struct kobject *kobj, enum kobject_action action)
179 netlink_broadcast(uevent_sock, skb, 0, 1, GFP_KERNEL); 182 netlink_broadcast(uevent_sock, skb, 0, 1, GFP_KERNEL);
180 } 183 }
181 } 184 }
185#endif
182 186
183 /* call uevent_helper, usually only enabled during early boot */ 187 /* call uevent_helper, usually only enabled during early boot */
184 if (uevent_helper[0]) { 188 if (uevent_helper[0]) {
@@ -249,6 +253,7 @@ int add_uevent_var(char **envp, int num_envp, int *cur_index,
249} 253}
250EXPORT_SYMBOL_GPL(add_uevent_var); 254EXPORT_SYMBOL_GPL(add_uevent_var);
251 255
256#if defined(CONFIG_NET)
252static int __init kobject_uevent_init(void) 257static int __init kobject_uevent_init(void)
253{ 258{
254 uevent_sock = netlink_kernel_create(NETLINK_KOBJECT_UEVENT, 1, NULL, 259 uevent_sock = netlink_kernel_create(NETLINK_KOBJECT_UEVENT, 1, NULL,
@@ -264,5 +269,6 @@ static int __init kobject_uevent_init(void)
264} 269}
265 270
266postcore_initcall(kobject_uevent_init); 271postcore_initcall(kobject_uevent_init);
272#endif
267 273
268#endif /* CONFIG_HOTPLUG */ 274#endif /* CONFIG_HOTPLUG */
diff --git a/mm/filemap.c b/mm/filemap.c
index 3ef20739e725..fd57442186cb 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -697,6 +697,38 @@ unsigned find_get_pages(struct address_space *mapping, pgoff_t start,
697 return ret; 697 return ret;
698} 698}
699 699
700/**
701 * find_get_pages_contig - gang contiguous pagecache lookup
702 * @mapping: The address_space to search
703 * @index: The starting page index
704 * @nr_pages: The maximum number of pages
705 * @pages: Where the resulting pages are placed
706 *
707 * find_get_pages_contig() works exactly like find_get_pages(), except
708 * that the returned number of pages are guaranteed to be contiguous.
709 *
710 * find_get_pages_contig() returns the number of pages which were found.
711 */
712unsigned find_get_pages_contig(struct address_space *mapping, pgoff_t index,
713 unsigned int nr_pages, struct page **pages)
714{
715 unsigned int i;
716 unsigned int ret;
717
718 read_lock_irq(&mapping->tree_lock);
719 ret = radix_tree_gang_lookup(&mapping->page_tree,
720 (void **)pages, index, nr_pages);
721 for (i = 0; i < ret; i++) {
722 if (pages[i]->mapping == NULL || pages[i]->index != index)
723 break;
724
725 page_cache_get(pages[i]);
726 index++;
727 }
728 read_unlock_irq(&mapping->tree_lock);
729 return i;
730}
731
700/* 732/*
701 * Like find_get_pages, except we only return pages which are tagged with 733 * Like find_get_pages, except we only return pages which are tagged with
702 * `tag'. We update *index to index the next page for the traversal. 734 * `tag'. We update *index to index the next page for the traversal.
diff --git a/mm/madvise.c b/mm/madvise.c
index af3d573b0141..4e196155a0c3 100644
--- a/mm/madvise.c
+++ b/mm/madvise.c
@@ -168,6 +168,9 @@ static long madvise_remove(struct vm_area_struct *vma,
168 return -EINVAL; 168 return -EINVAL;
169 } 169 }
170 170
171 if ((vma->vm_flags & (VM_SHARED|VM_WRITE)) != (VM_SHARED|VM_WRITE))
172 return -EACCES;
173
171 mapping = vma->vm_file->f_mapping; 174 mapping = vma->vm_file->f_mapping;
172 175
173 offset = (loff_t)(start - vma->vm_start) 176 offset = (loff_t)(start - vma->vm_start)
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 1fe76d963ac2..70df5c0d957e 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -69,12 +69,16 @@ int __add_pages(struct zone *zone, unsigned long phys_start_pfn,
69 for (i = 0; i < nr_pages; i += PAGES_PER_SECTION) { 69 for (i = 0; i < nr_pages; i += PAGES_PER_SECTION) {
70 err = __add_section(zone, phys_start_pfn + i); 70 err = __add_section(zone, phys_start_pfn + i);
71 71
72 if (err) 72 /* We want to keep adding the rest of the
73 * sections if the first ones already exist
74 */
75 if (err && (err != -EEXIST))
73 break; 76 break;
74 } 77 }
75 78
76 return err; 79 return err;
77} 80}
81EXPORT_SYMBOL_GPL(__add_pages);
78 82
79static void grow_zone_span(struct zone *zone, 83static void grow_zone_span(struct zone *zone,
80 unsigned long start_pfn, unsigned long end_pfn) 84 unsigned long start_pfn, unsigned long end_pfn)
@@ -87,8 +91,8 @@ static void grow_zone_span(struct zone *zone,
87 if (start_pfn < zone->zone_start_pfn) 91 if (start_pfn < zone->zone_start_pfn)
88 zone->zone_start_pfn = start_pfn; 92 zone->zone_start_pfn = start_pfn;
89 93
90 if (end_pfn > old_zone_end_pfn) 94 zone->spanned_pages = max(old_zone_end_pfn, end_pfn) -
91 zone->spanned_pages = end_pfn - zone->zone_start_pfn; 95 zone->zone_start_pfn;
92 96
93 zone_span_writeunlock(zone); 97 zone_span_writeunlock(zone);
94} 98}
@@ -102,8 +106,8 @@ static void grow_pgdat_span(struct pglist_data *pgdat,
102 if (start_pfn < pgdat->node_start_pfn) 106 if (start_pfn < pgdat->node_start_pfn)
103 pgdat->node_start_pfn = start_pfn; 107 pgdat->node_start_pfn = start_pfn;
104 108
105 if (end_pfn > old_pgdat_end_pfn) 109 pgdat->node_spanned_pages = max(old_pgdat_end_pfn, end_pfn) -
106 pgdat->node_spanned_pages = end_pfn - pgdat->node_start_pfn; 110 pgdat->node_start_pfn;
107} 111}
108 112
109int online_pages(unsigned long pfn, unsigned long nr_pages) 113int online_pages(unsigned long pfn, unsigned long nr_pages)
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index dec8249e972d..8778f58880c4 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -1761,7 +1761,6 @@ static void gather_stats(struct page *page, void *private, int pte_dirty)
1761 md->mapcount_max = count; 1761 md->mapcount_max = count;
1762 1762
1763 md->node[page_to_nid(page)]++; 1763 md->node[page_to_nid(page)]++;
1764 cond_resched();
1765} 1764}
1766 1765
1767#ifdef CONFIG_HUGETLB_PAGE 1766#ifdef CONFIG_HUGETLB_PAGE
diff --git a/mm/migrate.c b/mm/migrate.c
index d444229f2599..1c25040693d2 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -439,6 +439,17 @@ redo:
439 goto unlock_both; 439 goto unlock_both;
440 } 440 }
441 441
442 /* Make sure the dirty bit is up to date */
443 if (try_to_unmap(page, 1) == SWAP_FAIL) {
444 rc = -EPERM;
445 goto unlock_both;
446 }
447
448 if (page_mapcount(page)) {
449 rc = -EAGAIN;
450 goto unlock_both;
451 }
452
442 /* 453 /*
443 * Default handling if a filesystem does not provide 454 * Default handling if a filesystem does not provide
444 * a migration function. We can only migrate clean 455 * a migration function. We can only migrate clean
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index 78747afad6b0..042e6436c3ee 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -46,15 +46,25 @@
46unsigned long badness(struct task_struct *p, unsigned long uptime) 46unsigned long badness(struct task_struct *p, unsigned long uptime)
47{ 47{
48 unsigned long points, cpu_time, run_time, s; 48 unsigned long points, cpu_time, run_time, s;
49 struct list_head *tsk; 49 struct mm_struct *mm;
50 struct task_struct *child;
50 51
51 if (!p->mm) 52 task_lock(p);
53 mm = p->mm;
54 if (!mm) {
55 task_unlock(p);
52 return 0; 56 return 0;
57 }
53 58
54 /* 59 /*
55 * The memory size of the process is the basis for the badness. 60 * The memory size of the process is the basis for the badness.
56 */ 61 */
57 points = p->mm->total_vm; 62 points = mm->total_vm;
63
64 /*
65 * After this unlock we can no longer dereference local variable `mm'
66 */
67 task_unlock(p);
58 68
59 /* 69 /*
60 * Processes which fork a lot of child processes are likely 70 * Processes which fork a lot of child processes are likely
@@ -64,11 +74,11 @@ unsigned long badness(struct task_struct *p, unsigned long uptime)
64 * child is eating the vast majority of memory, adding only half 74 * child is eating the vast majority of memory, adding only half
65 * to the parents will make the child our kill candidate of choice. 75 * to the parents will make the child our kill candidate of choice.
66 */ 76 */
67 list_for_each(tsk, &p->children) { 77 list_for_each_entry(child, &p->children, sibling) {
68 struct task_struct *chld; 78 task_lock(child);
69 chld = list_entry(tsk, struct task_struct, sibling); 79 if (child->mm != mm && child->mm)
70 if (chld->mm != p->mm && chld->mm) 80 points += child->mm->total_vm/2 + 1;
71 points += chld->mm->total_vm/2 + 1; 81 task_unlock(child);
72 } 82 }
73 83
74 /* 84 /*
@@ -244,17 +254,24 @@ static void __oom_kill_task(task_t *p, const char *message)
244 force_sig(SIGKILL, p); 254 force_sig(SIGKILL, p);
245} 255}
246 256
247static struct mm_struct *oom_kill_task(task_t *p, const char *message) 257static int oom_kill_task(task_t *p, const char *message)
248{ 258{
249 struct mm_struct *mm = get_task_mm(p); 259 struct mm_struct *mm;
250 task_t * g, * q; 260 task_t * g, * q;
251 261
252 if (!mm) 262 mm = p->mm;
253 return NULL; 263
254 if (mm == &init_mm) { 264 /* WARNING: mm may not be dereferenced since we did not obtain its
255 mmput(mm); 265 * value from get_task_mm(p). This is OK since all we need to do is
256 return NULL; 266 * compare mm to q->mm below.
257 } 267 *
268 * Furthermore, even if mm contains a non-NULL value, p->mm may
269 * change to NULL at any time since we do not hold task_lock(p).
270 * However, this is of no concern to us.
271 */
272
273 if (mm == NULL || mm == &init_mm)
274 return 1;
258 275
259 __oom_kill_task(p, message); 276 __oom_kill_task(p, message);
260 /* 277 /*
@@ -266,13 +283,12 @@ static struct mm_struct *oom_kill_task(task_t *p, const char *message)
266 __oom_kill_task(q, message); 283 __oom_kill_task(q, message);
267 while_each_thread(g, q); 284 while_each_thread(g, q);
268 285
269 return mm; 286 return 0;
270} 287}
271 288
272static struct mm_struct *oom_kill_process(struct task_struct *p, 289static int oom_kill_process(struct task_struct *p, unsigned long points,
273 unsigned long points, const char *message) 290 const char *message)
274{ 291{
275 struct mm_struct *mm;
276 struct task_struct *c; 292 struct task_struct *c;
277 struct list_head *tsk; 293 struct list_head *tsk;
278 294
@@ -283,9 +299,8 @@ static struct mm_struct *oom_kill_process(struct task_struct *p,
283 c = list_entry(tsk, struct task_struct, sibling); 299 c = list_entry(tsk, struct task_struct, sibling);
284 if (c->mm == p->mm) 300 if (c->mm == p->mm)
285 continue; 301 continue;
286 mm = oom_kill_task(c, message); 302 if (!oom_kill_task(c, message))
287 if (mm) 303 return 0;
288 return mm;
289 } 304 }
290 return oom_kill_task(p, message); 305 return oom_kill_task(p, message);
291} 306}
@@ -300,7 +315,6 @@ static struct mm_struct *oom_kill_process(struct task_struct *p,
300 */ 315 */
301void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, int order) 316void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, int order)
302{ 317{
303 struct mm_struct *mm = NULL;
304 task_t *p; 318 task_t *p;
305 unsigned long points = 0; 319 unsigned long points = 0;
306 320
@@ -320,12 +334,12 @@ void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, int order)
320 */ 334 */
321 switch (constrained_alloc(zonelist, gfp_mask)) { 335 switch (constrained_alloc(zonelist, gfp_mask)) {
322 case CONSTRAINT_MEMORY_POLICY: 336 case CONSTRAINT_MEMORY_POLICY:
323 mm = oom_kill_process(current, points, 337 oom_kill_process(current, points,
324 "No available memory (MPOL_BIND)"); 338 "No available memory (MPOL_BIND)");
325 break; 339 break;
326 340
327 case CONSTRAINT_CPUSET: 341 case CONSTRAINT_CPUSET:
328 mm = oom_kill_process(current, points, 342 oom_kill_process(current, points,
329 "No available memory in cpuset"); 343 "No available memory in cpuset");
330 break; 344 break;
331 345
@@ -347,8 +361,7 @@ retry:
347 panic("Out of memory and no killable processes...\n"); 361 panic("Out of memory and no killable processes...\n");
348 } 362 }
349 363
350 mm = oom_kill_process(p, points, "Out of memory"); 364 if (oom_kill_process(p, points, "Out of memory"))
351 if (!mm)
352 goto retry; 365 goto retry;
353 366
354 break; 367 break;
@@ -357,8 +370,6 @@ retry:
357out: 370out:
358 read_unlock(&tasklist_lock); 371 read_unlock(&tasklist_lock);
359 cpuset_unlock(); 372 cpuset_unlock();
360 if (mm)
361 mmput(mm);
362 373
363 /* 374 /*
364 * Give "p" a good chance of killing itself before we 375 * Give "p" a good chance of killing itself before we
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 97d6827c7d66..253a450c400d 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -39,6 +39,7 @@
39#include <linux/mempolicy.h> 39#include <linux/mempolicy.h>
40 40
41#include <asm/tlbflush.h> 41#include <asm/tlbflush.h>
42#include <asm/div64.h>
42#include "internal.h" 43#include "internal.h"
43 44
44/* 45/*
@@ -232,11 +233,13 @@ static inline void prep_zero_page(struct page *page, int order, gfp_t gfp_flags)
232 * zone->lock is already acquired when we use these. 233 * zone->lock is already acquired when we use these.
233 * So, we don't need atomic page->flags operations here. 234 * So, we don't need atomic page->flags operations here.
234 */ 235 */
235static inline unsigned long page_order(struct page *page) { 236static inline unsigned long page_order(struct page *page)
237{
236 return page_private(page); 238 return page_private(page);
237} 239}
238 240
239static inline void set_page_order(struct page *page, int order) { 241static inline void set_page_order(struct page *page, int order)
242{
240 set_page_private(page, order); 243 set_page_private(page, order);
241 __SetPageBuddy(page); 244 __SetPageBuddy(page);
242} 245}
@@ -299,9 +302,9 @@ static inline int page_is_buddy(struct page *page, int order)
299 302
300 if (PageBuddy(page) && page_order(page) == order) { 303 if (PageBuddy(page) && page_order(page) == order) {
301 BUG_ON(page_count(page) != 0); 304 BUG_ON(page_count(page) != 0);
302 return 1; 305 return 1;
303 } 306 }
304 return 0; 307 return 0;
305} 308}
306 309
307/* 310/*
@@ -948,7 +951,7 @@ restart:
948 goto got_pg; 951 goto got_pg;
949 952
950 do { 953 do {
951 if (cpuset_zone_allowed(*z, gfp_mask)) 954 if (cpuset_zone_allowed(*z, gfp_mask|__GFP_HARDWALL))
952 wakeup_kswapd(*z, order); 955 wakeup_kswapd(*z, order);
953 } while (*(++z)); 956 } while (*(++z));
954 957
@@ -967,7 +970,8 @@ restart:
967 alloc_flags |= ALLOC_HARDER; 970 alloc_flags |= ALLOC_HARDER;
968 if (gfp_mask & __GFP_HIGH) 971 if (gfp_mask & __GFP_HIGH)
969 alloc_flags |= ALLOC_HIGH; 972 alloc_flags |= ALLOC_HIGH;
970 alloc_flags |= ALLOC_CPUSET; 973 if (wait)
974 alloc_flags |= ALLOC_CPUSET;
971 975
972 /* 976 /*
973 * Go through the zonelist again. Let __GFP_HIGH and allocations 977 * Go through the zonelist again. Let __GFP_HIGH and allocations
@@ -1960,7 +1964,7 @@ static inline void free_zone_pagesets(int cpu)
1960 } 1964 }
1961} 1965}
1962 1966
1963static int __cpuinit pageset_cpuup_callback(struct notifier_block *nfb, 1967static int pageset_cpuup_callback(struct notifier_block *nfb,
1964 unsigned long action, 1968 unsigned long action,
1965 void *hcpu) 1969 void *hcpu)
1966{ 1970{
@@ -2121,14 +2125,22 @@ static void __init alloc_node_mem_map(struct pglist_data *pgdat)
2121#ifdef CONFIG_FLAT_NODE_MEM_MAP 2125#ifdef CONFIG_FLAT_NODE_MEM_MAP
2122 /* ia64 gets its own node_mem_map, before this, without bootmem */ 2126 /* ia64 gets its own node_mem_map, before this, without bootmem */
2123 if (!pgdat->node_mem_map) { 2127 if (!pgdat->node_mem_map) {
2124 unsigned long size; 2128 unsigned long size, start, end;
2125 struct page *map; 2129 struct page *map;
2126 2130
2127 size = (pgdat->node_spanned_pages + 1) * sizeof(struct page); 2131 /*
2132 * The zone's endpoints aren't required to be MAX_ORDER
2133 * aligned but the node_mem_map endpoints must be in order
2134 * for the buddy allocator to function correctly.
2135 */
2136 start = pgdat->node_start_pfn & ~(MAX_ORDER_NR_PAGES - 1);
2137 end = pgdat->node_start_pfn + pgdat->node_spanned_pages;
2138 end = ALIGN(end, MAX_ORDER_NR_PAGES);
2139 size = (end - start) * sizeof(struct page);
2128 map = alloc_remap(pgdat->node_id, size); 2140 map = alloc_remap(pgdat->node_id, size);
2129 if (!map) 2141 if (!map)
2130 map = alloc_bootmem_node(pgdat, size); 2142 map = alloc_bootmem_node(pgdat, size);
2131 pgdat->node_mem_map = map; 2143 pgdat->node_mem_map = map + (pgdat->node_start_pfn - start);
2132 } 2144 }
2133#ifdef CONFIG_FLATMEM 2145#ifdef CONFIG_FLATMEM
2134 /* 2146 /*
@@ -2564,9 +2576,11 @@ void setup_per_zone_pages_min(void)
2564 } 2576 }
2565 2577
2566 for_each_zone(zone) { 2578 for_each_zone(zone) {
2567 unsigned long tmp; 2579 u64 tmp;
2580
2568 spin_lock_irqsave(&zone->lru_lock, flags); 2581 spin_lock_irqsave(&zone->lru_lock, flags);
2569 tmp = (pages_min * zone->present_pages) / lowmem_pages; 2582 tmp = (u64)pages_min * zone->present_pages;
2583 do_div(tmp, lowmem_pages);
2570 if (is_highmem(zone)) { 2584 if (is_highmem(zone)) {
2571 /* 2585 /*
2572 * __GFP_HIGH and PF_MEMALLOC allocations usually don't 2586 * __GFP_HIGH and PF_MEMALLOC allocations usually don't
@@ -2593,8 +2607,8 @@ void setup_per_zone_pages_min(void)
2593 zone->pages_min = tmp; 2607 zone->pages_min = tmp;
2594 } 2608 }
2595 2609
2596 zone->pages_low = zone->pages_min + tmp / 4; 2610 zone->pages_low = zone->pages_min + (tmp >> 2);
2597 zone->pages_high = zone->pages_min + tmp / 2; 2611 zone->pages_high = zone->pages_min + (tmp >> 1);
2598 spin_unlock_irqrestore(&zone->lru_lock, flags); 2612 spin_unlock_irqrestore(&zone->lru_lock, flags);
2599 } 2613 }
2600 2614
diff --git a/mm/shmem.c b/mm/shmem.c
index 37eaf42ed2c6..4c5e68e4e9ae 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -46,6 +46,8 @@
46#include <linux/mempolicy.h> 46#include <linux/mempolicy.h>
47#include <linux/namei.h> 47#include <linux/namei.h>
48#include <linux/ctype.h> 48#include <linux/ctype.h>
49#include <linux/migrate.h>
50
49#include <asm/uaccess.h> 51#include <asm/uaccess.h>
50#include <asm/div64.h> 52#include <asm/div64.h>
51#include <asm/pgtable.h> 53#include <asm/pgtable.h>
@@ -2173,6 +2175,7 @@ static struct address_space_operations shmem_aops = {
2173 .prepare_write = shmem_prepare_write, 2175 .prepare_write = shmem_prepare_write,
2174 .commit_write = simple_commit_write, 2176 .commit_write = simple_commit_write,
2175#endif 2177#endif
2178 .migratepage = migrate_page,
2176}; 2179};
2177 2180
2178static struct file_operations shmem_file_operations = { 2181static struct file_operations shmem_file_operations = {
diff --git a/mm/slab.c b/mm/slab.c
index e6ef9bd52335..f1b644eb39d8 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -207,11 +207,6 @@ typedef unsigned int kmem_bufctl_t;
207#define BUFCTL_ACTIVE (((kmem_bufctl_t)(~0U))-2) 207#define BUFCTL_ACTIVE (((kmem_bufctl_t)(~0U))-2)
208#define SLAB_LIMIT (((kmem_bufctl_t)(~0U))-3) 208#define SLAB_LIMIT (((kmem_bufctl_t)(~0U))-3)
209 209
210/* Max number of objs-per-slab for caches which use off-slab slabs.
211 * Needed to avoid a possible looping condition in cache_grow().
212 */
213static unsigned long offslab_limit;
214
215/* 210/*
216 * struct slab 211 * struct slab
217 * 212 *
@@ -700,6 +695,14 @@ static enum {
700 FULL 695 FULL
701} g_cpucache_up; 696} g_cpucache_up;
702 697
698/*
699 * used by boot code to determine if it can use slab based allocator
700 */
701int slab_is_available(void)
702{
703 return g_cpucache_up == FULL;
704}
705
703static DEFINE_PER_CPU(struct work_struct, reap_work); 706static DEFINE_PER_CPU(struct work_struct, reap_work);
704 707
705static void free_block(struct kmem_cache *cachep, void **objpp, int len, 708static void free_block(struct kmem_cache *cachep, void **objpp, int len,
@@ -979,7 +982,8 @@ static void __drain_alien_cache(struct kmem_cache *cachep,
979 * That way we could avoid the overhead of putting the objects 982 * That way we could avoid the overhead of putting the objects
980 * into the free lists and getting them back later. 983 * into the free lists and getting them back later.
981 */ 984 */
982 transfer_objects(rl3->shared, ac, ac->limit); 985 if (rl3->shared)
986 transfer_objects(rl3->shared, ac, ac->limit);
983 987
984 free_block(cachep, ac->entry, ac->avail, node); 988 free_block(cachep, ac->entry, ac->avail, node);
985 ac->avail = 0; 989 ac->avail = 0;
@@ -1036,7 +1040,7 @@ static inline void free_alien_cache(struct array_cache **ac_ptr)
1036 1040
1037#endif 1041#endif
1038 1042
1039static int __devinit cpuup_callback(struct notifier_block *nfb, 1043static int cpuup_callback(struct notifier_block *nfb,
1040 unsigned long action, void *hcpu) 1044 unsigned long action, void *hcpu)
1041{ 1045{
1042 long cpu = (long)hcpu; 1046 long cpu = (long)hcpu;
@@ -1347,12 +1351,6 @@ void __init kmem_cache_init(void)
1347 NULL, NULL); 1351 NULL, NULL);
1348 } 1352 }
1349 1353
1350 /* Inc off-slab bufctl limit until the ceiling is hit. */
1351 if (!(OFF_SLAB(sizes->cs_cachep))) {
1352 offslab_limit = sizes->cs_size - sizeof(struct slab);
1353 offslab_limit /= sizeof(kmem_bufctl_t);
1354 }
1355
1356 sizes->cs_dmacachep = kmem_cache_create(names->name_dma, 1354 sizes->cs_dmacachep = kmem_cache_create(names->name_dma,
1357 sizes->cs_size, 1355 sizes->cs_size,
1358 ARCH_KMALLOC_MINALIGN, 1356 ARCH_KMALLOC_MINALIGN,
@@ -1771,6 +1769,7 @@ static void set_up_list3s(struct kmem_cache *cachep, int index)
1771static size_t calculate_slab_order(struct kmem_cache *cachep, 1769static size_t calculate_slab_order(struct kmem_cache *cachep,
1772 size_t size, size_t align, unsigned long flags) 1770 size_t size, size_t align, unsigned long flags)
1773{ 1771{
1772 unsigned long offslab_limit;
1774 size_t left_over = 0; 1773 size_t left_over = 0;
1775 int gfporder; 1774 int gfporder;
1776 1775
@@ -1782,9 +1781,18 @@ static size_t calculate_slab_order(struct kmem_cache *cachep,
1782 if (!num) 1781 if (!num)
1783 continue; 1782 continue;
1784 1783
1785 /* More than offslab_limit objects will cause problems */ 1784 if (flags & CFLGS_OFF_SLAB) {
1786 if ((flags & CFLGS_OFF_SLAB) && num > offslab_limit) 1785 /*
1787 break; 1786 * Max number of objs-per-slab for caches which
1787 * use off-slab slabs. Needed to avoid a possible
1788 * looping condition in cache_grow().
1789 */
1790 offslab_limit = size - sizeof(struct slab);
1791 offslab_limit /= sizeof(kmem_bufctl_t);
1792
1793 if (num > offslab_limit)
1794 break;
1795 }
1788 1796
1789 /* Found something acceptable - save it away */ 1797 /* Found something acceptable - save it away */
1790 cachep->num = num; 1798 cachep->num = num;
@@ -2191,11 +2199,14 @@ static void drain_cpu_caches(struct kmem_cache *cachep)
2191 check_irq_on(); 2199 check_irq_on();
2192 for_each_online_node(node) { 2200 for_each_online_node(node) {
2193 l3 = cachep->nodelists[node]; 2201 l3 = cachep->nodelists[node];
2194 if (l3) { 2202 if (l3 && l3->alien)
2203 drain_alien_cache(cachep, l3->alien);
2204 }
2205
2206 for_each_online_node(node) {
2207 l3 = cachep->nodelists[node];
2208 if (l3)
2195 drain_array(cachep, l3, l3->shared, 1, node); 2209 drain_array(cachep, l3, l3->shared, 1, node);
2196 if (l3->alien)
2197 drain_alien_cache(cachep, l3->alien);
2198 }
2199 } 2210 }
2200} 2211}
2201 2212
diff --git a/mm/slob.c b/mm/slob.c
index 9bcc7e2cabfd..a68255ba4553 100644
--- a/mm/slob.c
+++ b/mm/slob.c
@@ -354,9 +354,7 @@ void *__alloc_percpu(size_t size)
354 if (!pdata) 354 if (!pdata)
355 return NULL; 355 return NULL;
356 356
357 for (i = 0; i < NR_CPUS; i++) { 357 for_each_possible_cpu(i) {
358 if (!cpu_possible(i))
359 continue;
360 pdata->ptrs[i] = kmalloc(size, GFP_KERNEL); 358 pdata->ptrs[i] = kmalloc(size, GFP_KERNEL);
361 if (!pdata->ptrs[i]) 359 if (!pdata->ptrs[i])
362 goto unwind_oom; 360 goto unwind_oom;
@@ -383,11 +381,9 @@ free_percpu(const void *objp)
383 int i; 381 int i;
384 struct percpu_data *p = (struct percpu_data *) (~(unsigned long) objp); 382 struct percpu_data *p = (struct percpu_data *) (~(unsigned long) objp);
385 383
386 for (i = 0; i < NR_CPUS; i++) { 384 for_each_possible_cpu(i)
387 if (!cpu_possible(i))
388 continue;
389 kfree(p->ptrs[i]); 385 kfree(p->ptrs[i]);
390 } 386
391 kfree(p); 387 kfree(p);
392} 388}
393EXPORT_SYMBOL(free_percpu); 389EXPORT_SYMBOL(free_percpu);
diff --git a/mm/sparse.c b/mm/sparse.c
index 0a51f36ba3a1..100040c0dfb6 100644
--- a/mm/sparse.c
+++ b/mm/sparse.c
@@ -32,7 +32,10 @@ static struct mem_section *sparse_index_alloc(int nid)
32 unsigned long array_size = SECTIONS_PER_ROOT * 32 unsigned long array_size = SECTIONS_PER_ROOT *
33 sizeof(struct mem_section); 33 sizeof(struct mem_section);
34 34
35 section = alloc_bootmem_node(NODE_DATA(nid), array_size); 35 if (slab_is_available())
36 section = kmalloc_node(array_size, GFP_KERNEL, nid);
37 else
38 section = alloc_bootmem_node(NODE_DATA(nid), array_size);
36 39
37 if (section) 40 if (section)
38 memset(section, 0, array_size); 41 memset(section, 0, array_size);
@@ -84,11 +87,8 @@ int __section_nr(struct mem_section* ms)
84 unsigned long root_nr; 87 unsigned long root_nr;
85 struct mem_section* root; 88 struct mem_section* root;
86 89
87 for (root_nr = 0; 90 for (root_nr = 0; root_nr < NR_SECTION_ROOTS; root_nr++) {
88 root_nr < NR_MEM_SECTIONS; 91 root = __nr_to_section(root_nr * SECTIONS_PER_ROOT);
89 root_nr += SECTIONS_PER_ROOT) {
90 root = __nr_to_section(root_nr);
91
92 if (!root) 92 if (!root)
93 continue; 93 continue;
94 94
@@ -281,9 +281,9 @@ int sparse_add_one_section(struct zone *zone, unsigned long start_pfn,
281 281
282 ret = sparse_init_one_section(ms, section_nr, memmap); 282 ret = sparse_init_one_section(ms, section_nr, memmap);
283 283
284 if (ret <= 0)
285 __kfree_section_memmap(memmap, nr_pages);
286out: 284out:
287 pgdat_resize_unlock(pgdat, &flags); 285 pgdat_resize_unlock(pgdat, &flags);
286 if (ret <= 0)
287 __kfree_section_memmap(memmap, nr_pages);
288 return ret; 288 return ret;
289} 289}
diff --git a/mm/vmscan.c b/mm/vmscan.c
index acdf001d6941..4649a63a8cb6 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1328,7 +1328,7 @@ repeat:
1328 not required for correctness. So if the last cpu in a node goes 1328 not required for correctness. So if the last cpu in a node goes
1329 away, we get changed to run anywhere: as the first one comes back, 1329 away, we get changed to run anywhere: as the first one comes back,
1330 restore their cpu bindings. */ 1330 restore their cpu bindings. */
1331static int __devinit cpu_callback(struct notifier_block *nfb, 1331static int cpu_callback(struct notifier_block *nfb,
1332 unsigned long action, void *hcpu) 1332 unsigned long action, void *hcpu)
1333{ 1333{
1334 pg_data_t *pgdat; 1334 pg_data_t *pgdat;
diff --git a/net/802/tr.c b/net/802/tr.c
index afd8385c0c9c..e9dc803f2fe0 100644
--- a/net/802/tr.c
+++ b/net/802/tr.c
@@ -643,6 +643,5 @@ static int __init rif_init(void)
643 643
644module_init(rif_init); 644module_init(rif_init);
645 645
646EXPORT_SYMBOL(tr_source_route);
647EXPORT_SYMBOL(tr_type_trans); 646EXPORT_SYMBOL(tr_type_trans);
648EXPORT_SYMBOL(alloc_trdev); 647EXPORT_SYMBOL(alloc_trdev);
diff --git a/net/atm/clip.c b/net/atm/clip.c
index 3ab4e7947bab..72d852982664 100644
--- a/net/atm/clip.c
+++ b/net/atm/clip.c
@@ -2,7 +2,6 @@
2 2
3/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */ 3/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
4 4
5
6#include <linux/config.h> 5#include <linux/config.h>
7#include <linux/string.h> 6#include <linux/string.h>
8#include <linux/errno.h> 7#include <linux/errno.h>
@@ -54,24 +53,24 @@ static struct net_device *clip_devs;
54static struct atm_vcc *atmarpd; 53static struct atm_vcc *atmarpd;
55static struct neigh_table clip_tbl; 54static struct neigh_table clip_tbl;
56static struct timer_list idle_timer; 55static struct timer_list idle_timer;
57static int start_timer = 1;
58
59 56
60static int to_atmarpd(enum atmarp_ctrl_type type,int itf,unsigned long ip) 57static int to_atmarpd(enum atmarp_ctrl_type type, int itf, unsigned long ip)
61{ 58{
62 struct sock *sk; 59 struct sock *sk;
63 struct atmarp_ctrl *ctrl; 60 struct atmarp_ctrl *ctrl;
64 struct sk_buff *skb; 61 struct sk_buff *skb;
65 62
66 DPRINTK("to_atmarpd(%d)\n",type); 63 DPRINTK("to_atmarpd(%d)\n", type);
67 if (!atmarpd) return -EUNATCH; 64 if (!atmarpd)
65 return -EUNATCH;
68 skb = alloc_skb(sizeof(struct atmarp_ctrl),GFP_ATOMIC); 66 skb = alloc_skb(sizeof(struct atmarp_ctrl),GFP_ATOMIC);
69 if (!skb) return -ENOMEM; 67 if (!skb)
68 return -ENOMEM;
70 ctrl = (struct atmarp_ctrl *) skb_put(skb,sizeof(struct atmarp_ctrl)); 69 ctrl = (struct atmarp_ctrl *) skb_put(skb,sizeof(struct atmarp_ctrl));
71 ctrl->type = type; 70 ctrl->type = type;
72 ctrl->itf_num = itf; 71 ctrl->itf_num = itf;
73 ctrl->ip = ip; 72 ctrl->ip = ip;
74 atm_force_charge(atmarpd,skb->truesize); 73 atm_force_charge(atmarpd, skb->truesize);
75 74
76 sk = sk_atm(atmarpd); 75 sk = sk_atm(atmarpd);
77 skb_queue_tail(&sk->sk_receive_queue, skb); 76 skb_queue_tail(&sk->sk_receive_queue, skb);
@@ -79,26 +78,24 @@ static int to_atmarpd(enum atmarp_ctrl_type type,int itf,unsigned long ip)
79 return 0; 78 return 0;
80} 79}
81 80
82 81static void link_vcc(struct clip_vcc *clip_vcc, struct atmarp_entry *entry)
83static void link_vcc(struct clip_vcc *clip_vcc,struct atmarp_entry *entry)
84{ 82{
85 DPRINTK("link_vcc %p to entry %p (neigh %p)\n",clip_vcc,entry, 83 DPRINTK("link_vcc %p to entry %p (neigh %p)\n", clip_vcc, entry,
86 entry->neigh); 84 entry->neigh);
87 clip_vcc->entry = entry; 85 clip_vcc->entry = entry;
88 clip_vcc->xoff = 0; /* @@@ may overrun buffer by one packet */ 86 clip_vcc->xoff = 0; /* @@@ may overrun buffer by one packet */
89 clip_vcc->next = entry->vccs; 87 clip_vcc->next = entry->vccs;
90 entry->vccs = clip_vcc; 88 entry->vccs = clip_vcc;
91 entry->neigh->used = jiffies; 89 entry->neigh->used = jiffies;
92} 90}
93 91
94
95static void unlink_clip_vcc(struct clip_vcc *clip_vcc) 92static void unlink_clip_vcc(struct clip_vcc *clip_vcc)
96{ 93{
97 struct atmarp_entry *entry = clip_vcc->entry; 94 struct atmarp_entry *entry = clip_vcc->entry;
98 struct clip_vcc **walk; 95 struct clip_vcc **walk;
99 96
100 if (!entry) { 97 if (!entry) {
101 printk(KERN_CRIT "!clip_vcc->entry (clip_vcc %p)\n",clip_vcc); 98 printk(KERN_CRIT "!clip_vcc->entry (clip_vcc %p)\n", clip_vcc);
102 return; 99 return;
103 } 100 }
104 spin_lock_bh(&entry->neigh->dev->xmit_lock); /* block clip_start_xmit() */ 101 spin_lock_bh(&entry->neigh->dev->xmit_lock); /* block clip_start_xmit() */
@@ -107,24 +104,24 @@ static void unlink_clip_vcc(struct clip_vcc *clip_vcc)
107 if (*walk == clip_vcc) { 104 if (*walk == clip_vcc) {
108 int error; 105 int error;
109 106
110 *walk = clip_vcc->next; /* atomic */ 107 *walk = clip_vcc->next; /* atomic */
111 clip_vcc->entry = NULL; 108 clip_vcc->entry = NULL;
112 if (clip_vcc->xoff) 109 if (clip_vcc->xoff)
113 netif_wake_queue(entry->neigh->dev); 110 netif_wake_queue(entry->neigh->dev);
114 if (entry->vccs) 111 if (entry->vccs)
115 goto out; 112 goto out;
116 entry->expires = jiffies-1; 113 entry->expires = jiffies - 1;
117 /* force resolution or expiration */ 114 /* force resolution or expiration */
118 error = neigh_update(entry->neigh, NULL, NUD_NONE, 115 error = neigh_update(entry->neigh, NULL, NUD_NONE,
119 NEIGH_UPDATE_F_ADMIN); 116 NEIGH_UPDATE_F_ADMIN);
120 if (error) 117 if (error)
121 printk(KERN_CRIT "unlink_clip_vcc: " 118 printk(KERN_CRIT "unlink_clip_vcc: "
122 "neigh_update failed with %d\n",error); 119 "neigh_update failed with %d\n", error);
123 goto out; 120 goto out;
124 } 121 }
125 printk(KERN_CRIT "ATMARP: unlink_clip_vcc failed (entry %p, vcc " 122 printk(KERN_CRIT "ATMARP: unlink_clip_vcc failed (entry %p, vcc "
126 "0x%p)\n",entry,clip_vcc); 123 "0x%p)\n", entry, clip_vcc);
127out: 124 out:
128 spin_unlock_bh(&entry->neigh->dev->xmit_lock); 125 spin_unlock_bh(&entry->neigh->dev->xmit_lock);
129} 126}
130 127
@@ -153,13 +150,13 @@ static int neigh_check_cb(struct neighbour *n)
153 DPRINTK("destruction postponed with ref %d\n", 150 DPRINTK("destruction postponed with ref %d\n",
154 atomic_read(&n->refcnt)); 151 atomic_read(&n->refcnt));
155 152
156 while ((skb = skb_dequeue(&n->arp_queue)) != NULL) 153 while ((skb = skb_dequeue(&n->arp_queue)) != NULL)
157 dev_kfree_skb(skb); 154 dev_kfree_skb(skb);
158 155
159 return 0; 156 return 0;
160 } 157 }
161 158
162 DPRINTK("expired neigh %p\n",n); 159 DPRINTK("expired neigh %p\n", n);
163 return 1; 160 return 1;
164} 161}
165 162
@@ -167,7 +164,7 @@ static void idle_timer_check(unsigned long dummy)
167{ 164{
168 write_lock(&clip_tbl.lock); 165 write_lock(&clip_tbl.lock);
169 __neigh_for_each_release(&clip_tbl, neigh_check_cb); 166 __neigh_for_each_release(&clip_tbl, neigh_check_cb);
170 mod_timer(&idle_timer, jiffies+CLIP_CHECK_INTERVAL*HZ); 167 mod_timer(&idle_timer, jiffies + CLIP_CHECK_INTERVAL * HZ);
171 write_unlock(&clip_tbl.lock); 168 write_unlock(&clip_tbl.lock);
172} 169}
173 170
@@ -177,13 +174,13 @@ static int clip_arp_rcv(struct sk_buff *skb)
177 174
178 DPRINTK("clip_arp_rcv\n"); 175 DPRINTK("clip_arp_rcv\n");
179 vcc = ATM_SKB(skb)->vcc; 176 vcc = ATM_SKB(skb)->vcc;
180 if (!vcc || !atm_charge(vcc,skb->truesize)) { 177 if (!vcc || !atm_charge(vcc, skb->truesize)) {
181 dev_kfree_skb_any(skb); 178 dev_kfree_skb_any(skb);
182 return 0; 179 return 0;
183 } 180 }
184 DPRINTK("pushing to %p\n",vcc); 181 DPRINTK("pushing to %p\n", vcc);
185 DPRINTK("using %p\n",CLIP_VCC(vcc)->old_push); 182 DPRINTK("using %p\n", CLIP_VCC(vcc)->old_push);
186 CLIP_VCC(vcc)->old_push(vcc,skb); 183 CLIP_VCC(vcc)->old_push(vcc, skb);
187 return 0; 184 return 0;
188} 185}
189 186
@@ -193,34 +190,38 @@ static const unsigned char llc_oui[] = {
193 0x03, /* Ctrl: Unnumbered Information Command PDU */ 190 0x03, /* Ctrl: Unnumbered Information Command PDU */
194 0x00, /* OUI: EtherType */ 191 0x00, /* OUI: EtherType */
195 0x00, 192 0x00,
196 0x00 }; 193 0x00
194};
197 195
198static void clip_push(struct atm_vcc *vcc,struct sk_buff *skb) 196static void clip_push(struct atm_vcc *vcc, struct sk_buff *skb)
199{ 197{
200 struct clip_vcc *clip_vcc = CLIP_VCC(vcc); 198 struct clip_vcc *clip_vcc = CLIP_VCC(vcc);
201 199
202 DPRINTK("clip push\n"); 200 DPRINTK("clip push\n");
203 if (!skb) { 201 if (!skb) {
204 DPRINTK("removing VCC %p\n",clip_vcc); 202 DPRINTK("removing VCC %p\n", clip_vcc);
205 if (clip_vcc->entry) unlink_clip_vcc(clip_vcc); 203 if (clip_vcc->entry)
206 clip_vcc->old_push(vcc,NULL); /* pass on the bad news */ 204 unlink_clip_vcc(clip_vcc);
205 clip_vcc->old_push(vcc, NULL); /* pass on the bad news */
207 kfree(clip_vcc); 206 kfree(clip_vcc);
208 return; 207 return;
209 } 208 }
210 atm_return(vcc,skb->truesize); 209 atm_return(vcc, skb->truesize);
211 skb->dev = clip_vcc->entry ? clip_vcc->entry->neigh->dev : clip_devs; 210 skb->dev = clip_vcc->entry ? clip_vcc->entry->neigh->dev : clip_devs;
212 /* clip_vcc->entry == NULL if we don't have an IP address yet */ 211 /* clip_vcc->entry == NULL if we don't have an IP address yet */
213 if (!skb->dev) { 212 if (!skb->dev) {
214 dev_kfree_skb_any(skb); 213 dev_kfree_skb_any(skb);
215 return; 214 return;
216 } 215 }
217 ATM_SKB(skb)->vcc = vcc; 216 ATM_SKB(skb)->vcc = vcc;
218 skb->mac.raw = skb->data; 217 skb->mac.raw = skb->data;
219 if (!clip_vcc->encap || skb->len < RFC1483LLC_LEN || memcmp(skb->data, 218 if (!clip_vcc->encap
220 llc_oui,sizeof(llc_oui))) skb->protocol = htons(ETH_P_IP); 219 || skb->len < RFC1483LLC_LEN
220 || memcmp(skb->data, llc_oui, sizeof (llc_oui)))
221 skb->protocol = htons(ETH_P_IP);
221 else { 222 else {
222 skb->protocol = ((u16 *) skb->data)[3]; 223 skb->protocol = ((u16 *) skb->data)[3];
223 skb_pull(skb,RFC1483LLC_LEN); 224 skb_pull(skb, RFC1483LLC_LEN);
224 if (skb->protocol == htons(ETH_P_ARP)) { 225 if (skb->protocol == htons(ETH_P_ARP)) {
225 PRIV(skb->dev)->stats.rx_packets++; 226 PRIV(skb->dev)->stats.rx_packets++;
226 PRIV(skb->dev)->stats.rx_bytes += skb->len; 227 PRIV(skb->dev)->stats.rx_bytes += skb->len;
@@ -235,58 +236,54 @@ static void clip_push(struct atm_vcc *vcc,struct sk_buff *skb)
235 netif_rx(skb); 236 netif_rx(skb);
236} 237}
237 238
238
239/* 239/*
240 * Note: these spinlocks _must_not_ block on non-SMP. The only goal is that 240 * Note: these spinlocks _must_not_ block on non-SMP. The only goal is that
241 * clip_pop is atomic with respect to the critical section in clip_start_xmit. 241 * clip_pop is atomic with respect to the critical section in clip_start_xmit.
242 */ 242 */
243 243
244 244static void clip_pop(struct atm_vcc *vcc, struct sk_buff *skb)
245static void clip_pop(struct atm_vcc *vcc,struct sk_buff *skb)
246{ 245{
247 struct clip_vcc *clip_vcc = CLIP_VCC(vcc); 246 struct clip_vcc *clip_vcc = CLIP_VCC(vcc);
248 struct net_device *dev = skb->dev; 247 struct net_device *dev = skb->dev;
249 int old; 248 int old;
250 unsigned long flags; 249 unsigned long flags;
251 250
252 DPRINTK("clip_pop(vcc %p)\n",vcc); 251 DPRINTK("clip_pop(vcc %p)\n", vcc);
253 clip_vcc->old_pop(vcc,skb); 252 clip_vcc->old_pop(vcc, skb);
254 /* skb->dev == NULL in outbound ARP packets */ 253 /* skb->dev == NULL in outbound ARP packets */
255 if (!dev) return; 254 if (!dev)
256 spin_lock_irqsave(&PRIV(dev)->xoff_lock,flags); 255 return;
257 if (atm_may_send(vcc,0)) { 256 spin_lock_irqsave(&PRIV(dev)->xoff_lock, flags);
258 old = xchg(&clip_vcc->xoff,0); 257 if (atm_may_send(vcc, 0)) {
259 if (old) netif_wake_queue(dev); 258 old = xchg(&clip_vcc->xoff, 0);
259 if (old)
260 netif_wake_queue(dev);
260 } 261 }
261 spin_unlock_irqrestore(&PRIV(dev)->xoff_lock,flags); 262 spin_unlock_irqrestore(&PRIV(dev)->xoff_lock, flags);
262} 263}
263 264
264
265static void clip_neigh_destroy(struct neighbour *neigh) 265static void clip_neigh_destroy(struct neighbour *neigh)
266{ 266{
267 DPRINTK("clip_neigh_destroy (neigh %p)\n",neigh); 267 DPRINTK("clip_neigh_destroy (neigh %p)\n", neigh);
268 if (NEIGH2ENTRY(neigh)->vccs) 268 if (NEIGH2ENTRY(neigh)->vccs)
269 printk(KERN_CRIT "clip_neigh_destroy: vccs != NULL !!!\n"); 269 printk(KERN_CRIT "clip_neigh_destroy: vccs != NULL !!!\n");
270 NEIGH2ENTRY(neigh)->vccs = (void *) 0xdeadbeef; 270 NEIGH2ENTRY(neigh)->vccs = (void *) 0xdeadbeef;
271} 271}
272 272
273 273static void clip_neigh_solicit(struct neighbour *neigh, struct sk_buff *skb)
274static void clip_neigh_solicit(struct neighbour *neigh,struct sk_buff *skb)
275{ 274{
276 DPRINTK("clip_neigh_solicit (neigh %p, skb %p)\n",neigh,skb); 275 DPRINTK("clip_neigh_solicit (neigh %p, skb %p)\n", neigh, skb);
277 to_atmarpd(act_need,PRIV(neigh->dev)->number,NEIGH2ENTRY(neigh)->ip); 276 to_atmarpd(act_need, PRIV(neigh->dev)->number, NEIGH2ENTRY(neigh)->ip);
278} 277}
279 278
280 279static void clip_neigh_error(struct neighbour *neigh, struct sk_buff *skb)
281static void clip_neigh_error(struct neighbour *neigh,struct sk_buff *skb)
282{ 280{
283#ifndef CONFIG_ATM_CLIP_NO_ICMP 281#ifndef CONFIG_ATM_CLIP_NO_ICMP
284 icmp_send(skb,ICMP_DEST_UNREACH,ICMP_HOST_UNREACH,0); 282 icmp_send(skb, ICMP_DEST_UNREACH, ICMP_HOST_UNREACH, 0);
285#endif 283#endif
286 kfree_skb(skb); 284 kfree_skb(skb);
287} 285}
288 286
289
290static struct neigh_ops clip_neigh_ops = { 287static struct neigh_ops clip_neigh_ops = {
291 .family = AF_INET, 288 .family = AF_INET,
292 .solicit = clip_neigh_solicit, 289 .solicit = clip_neigh_solicit,
@@ -297,7 +294,6 @@ static struct neigh_ops clip_neigh_ops = {
297 .queue_xmit = dev_queue_xmit, 294 .queue_xmit = dev_queue_xmit,
298}; 295};
299 296
300
301static int clip_constructor(struct neighbour *neigh) 297static int clip_constructor(struct neighbour *neigh)
302{ 298{
303 struct atmarp_entry *entry = NEIGH2ENTRY(neigh); 299 struct atmarp_entry *entry = NEIGH2ENTRY(neigh);
@@ -305,9 +301,10 @@ static int clip_constructor(struct neighbour *neigh)
305 struct in_device *in_dev; 301 struct in_device *in_dev;
306 struct neigh_parms *parms; 302 struct neigh_parms *parms;
307 303
308 DPRINTK("clip_constructor (neigh %p, entry %p)\n",neigh,entry); 304 DPRINTK("clip_constructor (neigh %p, entry %p)\n", neigh, entry);
309 neigh->type = inet_addr_type(entry->ip); 305 neigh->type = inet_addr_type(entry->ip);
310 if (neigh->type != RTN_UNICAST) return -EINVAL; 306 if (neigh->type != RTN_UNICAST)
307 return -EINVAL;
311 308
312 rcu_read_lock(); 309 rcu_read_lock();
313 in_dev = __in_dev_get_rcu(dev); 310 in_dev = __in_dev_get_rcu(dev);
@@ -326,13 +323,13 @@ static int clip_constructor(struct neighbour *neigh)
326 neigh->ops->connected_output : neigh->ops->output; 323 neigh->ops->connected_output : neigh->ops->output;
327 entry->neigh = neigh; 324 entry->neigh = neigh;
328 entry->vccs = NULL; 325 entry->vccs = NULL;
329 entry->expires = jiffies-1; 326 entry->expires = jiffies - 1;
330 return 0; 327 return 0;
331} 328}
332 329
333static u32 clip_hash(const void *pkey, const struct net_device *dev) 330static u32 clip_hash(const void *pkey, const struct net_device *dev)
334{ 331{
335 return jhash_2words(*(u32 *)pkey, dev->ifindex, clip_tbl.hash_rnd); 332 return jhash_2words(*(u32 *) pkey, dev->ifindex, clip_tbl.hash_rnd);
336} 333}
337 334
338static struct neigh_table clip_tbl = { 335static struct neigh_table clip_tbl = {
@@ -366,7 +363,6 @@ static struct neigh_table clip_tbl = {
366 .gc_thresh3 = 1024, 363 .gc_thresh3 = 1024,
367}; 364};
368 365
369
370/* @@@ copy bh locking from arp.c -- need to bh-enable atm code before */ 366/* @@@ copy bh locking from arp.c -- need to bh-enable atm code before */
371 367
372/* 368/*
@@ -376,15 +372,13 @@ static struct neigh_table clip_tbl = {
376 * clip_setentry. 372 * clip_setentry.
377 */ 373 */
378 374
379 375static int clip_encap(struct atm_vcc *vcc, int mode)
380static int clip_encap(struct atm_vcc *vcc,int mode)
381{ 376{
382 CLIP_VCC(vcc)->encap = mode; 377 CLIP_VCC(vcc)->encap = mode;
383 return 0; 378 return 0;
384} 379}
385 380
386 381static int clip_start_xmit(struct sk_buff *skb, struct net_device *dev)
387static int clip_start_xmit(struct sk_buff *skb,struct net_device *dev)
388{ 382{
389 struct clip_priv *clip_priv = PRIV(dev); 383 struct clip_priv *clip_priv = PRIV(dev);
390 struct atmarp_entry *entry; 384 struct atmarp_entry *entry;
@@ -392,7 +386,7 @@ static int clip_start_xmit(struct sk_buff *skb,struct net_device *dev)
392 int old; 386 int old;
393 unsigned long flags; 387 unsigned long flags;
394 388
395 DPRINTK("clip_start_xmit (skb %p)\n",skb); 389 DPRINTK("clip_start_xmit (skb %p)\n", skb);
396 if (!skb->dst) { 390 if (!skb->dst) {
397 printk(KERN_ERR "clip_start_xmit: skb->dst == NULL\n"); 391 printk(KERN_ERR "clip_start_xmit: skb->dst == NULL\n");
398 dev_kfree_skb(skb); 392 dev_kfree_skb(skb);
@@ -401,9 +395,9 @@ static int clip_start_xmit(struct sk_buff *skb,struct net_device *dev)
401 } 395 }
402 if (!skb->dst->neighbour) { 396 if (!skb->dst->neighbour) {
403#if 0 397#if 0
404 skb->dst->neighbour = clip_find_neighbour(skb->dst,1); 398 skb->dst->neighbour = clip_find_neighbour(skb->dst, 1);
405 if (!skb->dst->neighbour) { 399 if (!skb->dst->neighbour) {
406 dev_kfree_skb(skb); /* lost that one */ 400 dev_kfree_skb(skb); /* lost that one */
407 clip_priv->stats.tx_dropped++; 401 clip_priv->stats.tx_dropped++;
408 return 0; 402 return 0;
409 } 403 }
@@ -417,73 +411,73 @@ static int clip_start_xmit(struct sk_buff *skb,struct net_device *dev)
417 if (!entry->vccs) { 411 if (!entry->vccs) {
418 if (time_after(jiffies, entry->expires)) { 412 if (time_after(jiffies, entry->expires)) {
419 /* should be resolved */ 413 /* should be resolved */
420 entry->expires = jiffies+ATMARP_RETRY_DELAY*HZ; 414 entry->expires = jiffies + ATMARP_RETRY_DELAY * HZ;
421 to_atmarpd(act_need,PRIV(dev)->number,entry->ip); 415 to_atmarpd(act_need, PRIV(dev)->number, entry->ip);
422 } 416 }
423 if (entry->neigh->arp_queue.qlen < ATMARP_MAX_UNRES_PACKETS) 417 if (entry->neigh->arp_queue.qlen < ATMARP_MAX_UNRES_PACKETS)
424 skb_queue_tail(&entry->neigh->arp_queue,skb); 418 skb_queue_tail(&entry->neigh->arp_queue, skb);
425 else { 419 else {
426 dev_kfree_skb(skb); 420 dev_kfree_skb(skb);
427 clip_priv->stats.tx_dropped++; 421 clip_priv->stats.tx_dropped++;
428 } 422 }
429 return 0; 423 return 0;
430 } 424 }
431 DPRINTK("neigh %p, vccs %p\n",entry,entry->vccs); 425 DPRINTK("neigh %p, vccs %p\n", entry, entry->vccs);
432 ATM_SKB(skb)->vcc = vcc = entry->vccs->vcc; 426 ATM_SKB(skb)->vcc = vcc = entry->vccs->vcc;
433 DPRINTK("using neighbour %p, vcc %p\n",skb->dst->neighbour,vcc); 427 DPRINTK("using neighbour %p, vcc %p\n", skb->dst->neighbour, vcc);
434 if (entry->vccs->encap) { 428 if (entry->vccs->encap) {
435 void *here; 429 void *here;
436 430
437 here = skb_push(skb,RFC1483LLC_LEN); 431 here = skb_push(skb, RFC1483LLC_LEN);
438 memcpy(here,llc_oui,sizeof(llc_oui)); 432 memcpy(here, llc_oui, sizeof(llc_oui));
439 ((u16 *) here)[3] = skb->protocol; 433 ((u16 *) here)[3] = skb->protocol;
440 } 434 }
441 atomic_add(skb->truesize, &sk_atm(vcc)->sk_wmem_alloc); 435 atomic_add(skb->truesize, &sk_atm(vcc)->sk_wmem_alloc);
442 ATM_SKB(skb)->atm_options = vcc->atm_options; 436 ATM_SKB(skb)->atm_options = vcc->atm_options;
443 entry->vccs->last_use = jiffies; 437 entry->vccs->last_use = jiffies;
444 DPRINTK("atm_skb(%p)->vcc(%p)->dev(%p)\n",skb,vcc,vcc->dev); 438 DPRINTK("atm_skb(%p)->vcc(%p)->dev(%p)\n", skb, vcc, vcc->dev);
445 old = xchg(&entry->vccs->xoff,1); /* assume XOFF ... */ 439 old = xchg(&entry->vccs->xoff, 1); /* assume XOFF ... */
446 if (old) { 440 if (old) {
447 printk(KERN_WARNING "clip_start_xmit: XOFF->XOFF transition\n"); 441 printk(KERN_WARNING "clip_start_xmit: XOFF->XOFF transition\n");
448 return 0; 442 return 0;
449 } 443 }
450 clip_priv->stats.tx_packets++; 444 clip_priv->stats.tx_packets++;
451 clip_priv->stats.tx_bytes += skb->len; 445 clip_priv->stats.tx_bytes += skb->len;
452 (void) vcc->send(vcc,skb); 446 vcc->send(vcc, skb);
453 if (atm_may_send(vcc,0)) { 447 if (atm_may_send(vcc, 0)) {
454 entry->vccs->xoff = 0; 448 entry->vccs->xoff = 0;
455 return 0; 449 return 0;
456 } 450 }
457 spin_lock_irqsave(&clip_priv->xoff_lock,flags); 451 spin_lock_irqsave(&clip_priv->xoff_lock, flags);
458 netif_stop_queue(dev); /* XOFF -> throttle immediately */ 452 netif_stop_queue(dev); /* XOFF -> throttle immediately */
459 barrier(); 453 barrier();
460 if (!entry->vccs->xoff) 454 if (!entry->vccs->xoff)
461 netif_start_queue(dev); 455 netif_start_queue(dev);
462 /* Oh, we just raced with clip_pop. netif_start_queue should be 456 /* Oh, we just raced with clip_pop. netif_start_queue should be
463 good enough, because nothing should really be asleep because 457 good enough, because nothing should really be asleep because
464 of the brief netif_stop_queue. If this isn't true or if it 458 of the brief netif_stop_queue. If this isn't true or if it
465 changes, use netif_wake_queue instead. */ 459 changes, use netif_wake_queue instead. */
466 spin_unlock_irqrestore(&clip_priv->xoff_lock,flags); 460 spin_unlock_irqrestore(&clip_priv->xoff_lock, flags);
467 return 0; 461 return 0;
468} 462}
469 463
470
471static struct net_device_stats *clip_get_stats(struct net_device *dev) 464static struct net_device_stats *clip_get_stats(struct net_device *dev)
472{ 465{
473 return &PRIV(dev)->stats; 466 return &PRIV(dev)->stats;
474} 467}
475 468
476 469static int clip_mkip(struct atm_vcc *vcc, int timeout)
477static int clip_mkip(struct atm_vcc *vcc,int timeout)
478{ 470{
479 struct clip_vcc *clip_vcc; 471 struct clip_vcc *clip_vcc;
480 struct sk_buff_head copy; 472 struct sk_buff_head copy;
481 struct sk_buff *skb; 473 struct sk_buff *skb;
482 474
483 if (!vcc->push) return -EBADFD; 475 if (!vcc->push)
484 clip_vcc = kmalloc(sizeof(struct clip_vcc),GFP_KERNEL); 476 return -EBADFD;
485 if (!clip_vcc) return -ENOMEM; 477 clip_vcc = kmalloc(sizeof(struct clip_vcc), GFP_KERNEL);
486 DPRINTK("mkip clip_vcc %p vcc %p\n",clip_vcc,vcc); 478 if (!clip_vcc)
479 return -ENOMEM;
480 DPRINTK("mkip clip_vcc %p vcc %p\n", clip_vcc, vcc);
487 clip_vcc->vcc = vcc; 481 clip_vcc->vcc = vcc;
488 vcc->user_back = clip_vcc; 482 vcc->user_back = clip_vcc;
489 set_bit(ATM_VF_IS_CLIP, &vcc->flags); 483 set_bit(ATM_VF_IS_CLIP, &vcc->flags);
@@ -491,7 +485,7 @@ static int clip_mkip(struct atm_vcc *vcc,int timeout)
491 clip_vcc->xoff = 0; 485 clip_vcc->xoff = 0;
492 clip_vcc->encap = 1; 486 clip_vcc->encap = 1;
493 clip_vcc->last_use = jiffies; 487 clip_vcc->last_use = jiffies;
494 clip_vcc->idle_timeout = timeout*HZ; 488 clip_vcc->idle_timeout = timeout * HZ;
495 clip_vcc->old_push = vcc->push; 489 clip_vcc->old_push = vcc->push;
496 clip_vcc->old_pop = vcc->pop; 490 clip_vcc->old_pop = vcc->pop;
497 vcc->push = clip_push; 491 vcc->push = clip_push;
@@ -501,27 +495,25 @@ static int clip_mkip(struct atm_vcc *vcc,int timeout)
501 /* re-process everything received between connection setup and MKIP */ 495 /* re-process everything received between connection setup and MKIP */
502 while ((skb = skb_dequeue(&copy)) != NULL) 496 while ((skb = skb_dequeue(&copy)) != NULL)
503 if (!clip_devs) { 497 if (!clip_devs) {
504 atm_return(vcc,skb->truesize); 498 atm_return(vcc, skb->truesize);
505 kfree_skb(skb); 499 kfree_skb(skb);
506 } 500 } else {
507 else {
508 unsigned int len = skb->len; 501 unsigned int len = skb->len;
509 502
510 clip_push(vcc,skb); 503 clip_push(vcc, skb);
511 PRIV(skb->dev)->stats.rx_packets--; 504 PRIV(skb->dev)->stats.rx_packets--;
512 PRIV(skb->dev)->stats.rx_bytes -= len; 505 PRIV(skb->dev)->stats.rx_bytes -= len;
513 } 506 }
514 return 0; 507 return 0;
515} 508}
516 509
517 510static int clip_setentry(struct atm_vcc *vcc, u32 ip)
518static int clip_setentry(struct atm_vcc *vcc,u32 ip)
519{ 511{
520 struct neighbour *neigh; 512 struct neighbour *neigh;
521 struct atmarp_entry *entry; 513 struct atmarp_entry *entry;
522 int error; 514 int error;
523 struct clip_vcc *clip_vcc; 515 struct clip_vcc *clip_vcc;
524 struct flowi fl = { .nl_u = { .ip4_u = { .daddr = ip, .tos = 1 } } }; 516 struct flowi fl = { .nl_u = { .ip4_u = { .daddr = ip, .tos = 1}} };
525 struct rtable *rt; 517 struct rtable *rt;
526 518
527 if (vcc->push != clip_push) { 519 if (vcc->push != clip_push) {
@@ -538,28 +530,29 @@ static int clip_setentry(struct atm_vcc *vcc,u32 ip)
538 unlink_clip_vcc(clip_vcc); 530 unlink_clip_vcc(clip_vcc);
539 return 0; 531 return 0;
540 } 532 }
541 error = ip_route_output_key(&rt,&fl); 533 error = ip_route_output_key(&rt, &fl);
542 if (error) return error; 534 if (error)
543 neigh = __neigh_lookup(&clip_tbl,&ip,rt->u.dst.dev,1); 535 return error;
536 neigh = __neigh_lookup(&clip_tbl, &ip, rt->u.dst.dev, 1);
544 ip_rt_put(rt); 537 ip_rt_put(rt);
545 if (!neigh) 538 if (!neigh)
546 return -ENOMEM; 539 return -ENOMEM;
547 entry = NEIGH2ENTRY(neigh); 540 entry = NEIGH2ENTRY(neigh);
548 if (entry != clip_vcc->entry) { 541 if (entry != clip_vcc->entry) {
549 if (!clip_vcc->entry) DPRINTK("setentry: add\n"); 542 if (!clip_vcc->entry)
543 DPRINTK("setentry: add\n");
550 else { 544 else {
551 DPRINTK("setentry: update\n"); 545 DPRINTK("setentry: update\n");
552 unlink_clip_vcc(clip_vcc); 546 unlink_clip_vcc(clip_vcc);
553 } 547 }
554 link_vcc(clip_vcc,entry); 548 link_vcc(clip_vcc, entry);
555 } 549 }
556 error = neigh_update(neigh, llc_oui, NUD_PERMANENT, 550 error = neigh_update(neigh, llc_oui, NUD_PERMANENT,
557 NEIGH_UPDATE_F_OVERRIDE|NEIGH_UPDATE_F_ADMIN); 551 NEIGH_UPDATE_F_OVERRIDE | NEIGH_UPDATE_F_ADMIN);
558 neigh_release(neigh); 552 neigh_release(neigh);
559 return error; 553 return error;
560} 554}
561 555
562
563static void clip_setup(struct net_device *dev) 556static void clip_setup(struct net_device *dev)
564{ 557{
565 dev->hard_start_xmit = clip_start_xmit; 558 dev->hard_start_xmit = clip_start_xmit;
@@ -568,15 +561,14 @@ static void clip_setup(struct net_device *dev)
568 dev->type = ARPHRD_ATM; 561 dev->type = ARPHRD_ATM;
569 dev->hard_header_len = RFC1483LLC_LEN; 562 dev->hard_header_len = RFC1483LLC_LEN;
570 dev->mtu = RFC1626_MTU; 563 dev->mtu = RFC1626_MTU;
571 dev->tx_queue_len = 100; /* "normal" queue (packets) */ 564 dev->tx_queue_len = 100; /* "normal" queue (packets) */
572 /* When using a "real" qdisc, the qdisc determines the queue */ 565 /* When using a "real" qdisc, the qdisc determines the queue */
573 /* length. tx_queue_len is only used for the default case, */ 566 /* length. tx_queue_len is only used for the default case, */
574 /* without any more elaborate queuing. 100 is a reasonable */ 567 /* without any more elaborate queuing. 100 is a reasonable */
575 /* compromise between decent burst-tolerance and protection */ 568 /* compromise between decent burst-tolerance and protection */
576 /* against memory hogs. */ 569 /* against memory hogs. */
577} 570}
578 571
579
580static int clip_create(int number) 572static int clip_create(int number)
581{ 573{
582 struct net_device *dev; 574 struct net_device *dev;
@@ -585,19 +577,19 @@ static int clip_create(int number)
585 577
586 if (number != -1) { 578 if (number != -1) {
587 for (dev = clip_devs; dev; dev = PRIV(dev)->next) 579 for (dev = clip_devs; dev; dev = PRIV(dev)->next)
588 if (PRIV(dev)->number == number) return -EEXIST; 580 if (PRIV(dev)->number == number)
589 } 581 return -EEXIST;
590 else { 582 } else {
591 number = 0; 583 number = 0;
592 for (dev = clip_devs; dev; dev = PRIV(dev)->next) 584 for (dev = clip_devs; dev; dev = PRIV(dev)->next)
593 if (PRIV(dev)->number >= number) 585 if (PRIV(dev)->number >= number)
594 number = PRIV(dev)->number+1; 586 number = PRIV(dev)->number + 1;
595 } 587 }
596 dev = alloc_netdev(sizeof(struct clip_priv), "", clip_setup); 588 dev = alloc_netdev(sizeof(struct clip_priv), "", clip_setup);
597 if (!dev) 589 if (!dev)
598 return -ENOMEM; 590 return -ENOMEM;
599 clip_priv = PRIV(dev); 591 clip_priv = PRIV(dev);
600 sprintf(dev->name,"atm%d",number); 592 sprintf(dev->name, "atm%d", number);
601 spin_lock_init(&clip_priv->xoff_lock); 593 spin_lock_init(&clip_priv->xoff_lock);
602 clip_priv->number = number; 594 clip_priv->number = number;
603 error = register_netdev(dev); 595 error = register_netdev(dev);
@@ -607,53 +599,48 @@ static int clip_create(int number)
607 } 599 }
608 clip_priv->next = clip_devs; 600 clip_priv->next = clip_devs;
609 clip_devs = dev; 601 clip_devs = dev;
610 DPRINTK("registered (net:%s)\n",dev->name); 602 DPRINTK("registered (net:%s)\n", dev->name);
611 return number; 603 return number;
612} 604}
613 605
614 606static int clip_device_event(struct notifier_block *this, unsigned long event,
615static int clip_device_event(struct notifier_block *this,unsigned long event, 607 void *arg)
616 void *dev)
617{ 608{
609 struct net_device *dev = arg;
610
611 if (event == NETDEV_UNREGISTER) {
612 neigh_ifdown(&clip_tbl, dev);
613 return NOTIFY_DONE;
614 }
615
618 /* ignore non-CLIP devices */ 616 /* ignore non-CLIP devices */
619 if (((struct net_device *) dev)->type != ARPHRD_ATM || 617 if (dev->type != ARPHRD_ATM || dev->hard_start_xmit != clip_start_xmit)
620 ((struct net_device *) dev)->hard_start_xmit != clip_start_xmit)
621 return NOTIFY_DONE; 618 return NOTIFY_DONE;
619
622 switch (event) { 620 switch (event) {
623 case NETDEV_UP: 621 case NETDEV_UP:
624 DPRINTK("clip_device_event NETDEV_UP\n"); 622 DPRINTK("clip_device_event NETDEV_UP\n");
625 (void) to_atmarpd(act_up,PRIV(dev)->number,0); 623 to_atmarpd(act_up, PRIV(dev)->number, 0);
626 break; 624 break;
627 case NETDEV_GOING_DOWN: 625 case NETDEV_GOING_DOWN:
628 DPRINTK("clip_device_event NETDEV_DOWN\n"); 626 DPRINTK("clip_device_event NETDEV_DOWN\n");
629 (void) to_atmarpd(act_down,PRIV(dev)->number,0); 627 to_atmarpd(act_down, PRIV(dev)->number, 0);
630 break; 628 break;
631 case NETDEV_CHANGE: 629 case NETDEV_CHANGE:
632 case NETDEV_CHANGEMTU: 630 case NETDEV_CHANGEMTU:
633 DPRINTK("clip_device_event NETDEV_CHANGE*\n"); 631 DPRINTK("clip_device_event NETDEV_CHANGE*\n");
634 (void) to_atmarpd(act_change,PRIV(dev)->number,0); 632 to_atmarpd(act_change, PRIV(dev)->number, 0);
635 break; 633 break;
636 case NETDEV_REBOOT:
637 case NETDEV_REGISTER:
638 case NETDEV_DOWN:
639 DPRINTK("clip_device_event %ld\n",event);
640 /* ignore */
641 break;
642 default:
643 printk(KERN_WARNING "clip_device_event: unknown event "
644 "%ld\n",event);
645 break;
646 } 634 }
647 return NOTIFY_DONE; 635 return NOTIFY_DONE;
648} 636}
649 637
650 638static int clip_inet_event(struct notifier_block *this, unsigned long event,
651static int clip_inet_event(struct notifier_block *this,unsigned long event, 639 void *ifa)
652 void *ifa)
653{ 640{
654 struct in_device *in_dev; 641 struct in_device *in_dev;
655 642
656 in_dev = ((struct in_ifaddr *) ifa)->ifa_dev; 643 in_dev = ((struct in_ifaddr *)ifa)->ifa_dev;
657 if (!in_dev || !in_dev->dev) { 644 if (!in_dev || !in_dev->dev) {
658 printk(KERN_WARNING "clip_inet_event: no device\n"); 645 printk(KERN_WARNING "clip_inet_event: no device\n");
659 return NOTIFY_DONE; 646 return NOTIFY_DONE;
@@ -662,23 +649,20 @@ static int clip_inet_event(struct notifier_block *this,unsigned long event,
662 * Transitions are of the down-change-up type, so it's sufficient to 649 * Transitions are of the down-change-up type, so it's sufficient to
663 * handle the change on up. 650 * handle the change on up.
664 */ 651 */
665 if (event != NETDEV_UP) return NOTIFY_DONE; 652 if (event != NETDEV_UP)
666 return clip_device_event(this,NETDEV_CHANGE,in_dev->dev); 653 return NOTIFY_DONE;
654 return clip_device_event(this, NETDEV_CHANGE, in_dev->dev);
667} 655}
668 656
669 657
670static struct notifier_block clip_dev_notifier = { 658static struct notifier_block clip_dev_notifier = {
671 clip_device_event, 659 .notifier_call = clip_device_event,
672 NULL,
673 0
674}; 660};
675 661
676 662
677 663
678static struct notifier_block clip_inet_notifier = { 664static struct notifier_block clip_inet_notifier = {
679 clip_inet_event, 665 .notifier_call = clip_inet_event,
680 NULL,
681 0
682}; 666};
683 667
684 668
@@ -686,14 +670,12 @@ static struct notifier_block clip_inet_notifier = {
686static void atmarpd_close(struct atm_vcc *vcc) 670static void atmarpd_close(struct atm_vcc *vcc)
687{ 671{
688 DPRINTK("atmarpd_close\n"); 672 DPRINTK("atmarpd_close\n");
689 atmarpd = NULL; /* assumed to be atomic */ 673
690 barrier(); 674 rtnl_lock();
691 unregister_inetaddr_notifier(&clip_inet_notifier); 675 atmarpd = NULL;
692 unregister_netdevice_notifier(&clip_dev_notifier);
693 if (skb_peek(&sk_atm(vcc)->sk_receive_queue))
694 printk(KERN_ERR "atmarpd_close: closing with requests "
695 "pending\n");
696 skb_queue_purge(&sk_atm(vcc)->sk_receive_queue); 676 skb_queue_purge(&sk_atm(vcc)->sk_receive_queue);
677 rtnl_unlock();
678
697 DPRINTK("(done)\n"); 679 DPRINTK("(done)\n");
698 module_put(THIS_MODULE); 680 module_put(THIS_MODULE);
699} 681}
@@ -714,14 +696,14 @@ static struct atm_dev atmarpd_dev = {
714 696
715static int atm_init_atmarp(struct atm_vcc *vcc) 697static int atm_init_atmarp(struct atm_vcc *vcc)
716{ 698{
717 if (atmarpd) return -EADDRINUSE; 699 rtnl_lock();
718 if (start_timer) { 700 if (atmarpd) {
719 start_timer = 0; 701 rtnl_unlock();
720 init_timer(&idle_timer); 702 return -EADDRINUSE;
721 idle_timer.expires = jiffies+CLIP_CHECK_INTERVAL*HZ;
722 idle_timer.function = idle_timer_check;
723 add_timer(&idle_timer);
724 } 703 }
704
705 mod_timer(&idle_timer, jiffies+CLIP_CHECK_INTERVAL*HZ);
706
725 atmarpd = vcc; 707 atmarpd = vcc;
726 set_bit(ATM_VF_META,&vcc->flags); 708 set_bit(ATM_VF_META,&vcc->flags);
727 set_bit(ATM_VF_READY,&vcc->flags); 709 set_bit(ATM_VF_READY,&vcc->flags);
@@ -731,10 +713,7 @@ static int atm_init_atmarp(struct atm_vcc *vcc)
731 vcc->push = NULL; 713 vcc->push = NULL;
732 vcc->pop = NULL; /* crash */ 714 vcc->pop = NULL; /* crash */
733 vcc->push_oam = NULL; /* crash */ 715 vcc->push_oam = NULL; /* crash */
734 if (register_netdevice_notifier(&clip_dev_notifier)) 716 rtnl_unlock();
735 printk(KERN_ERR "register_netdevice_notifier failed\n");
736 if (register_inetaddr_notifier(&clip_inet_notifier))
737 printk(KERN_ERR "register_inetaddr_notifier failed\n");
738 return 0; 717 return 0;
739} 718}
740 719
@@ -744,53 +723,53 @@ static int clip_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
744 int err = 0; 723 int err = 0;
745 724
746 switch (cmd) { 725 switch (cmd) {
747 case SIOCMKCLIP: 726 case SIOCMKCLIP:
748 case ATMARPD_CTRL: 727 case ATMARPD_CTRL:
749 case ATMARP_MKIP: 728 case ATMARP_MKIP:
750 case ATMARP_SETENTRY: 729 case ATMARP_SETENTRY:
751 case ATMARP_ENCAP: 730 case ATMARP_ENCAP:
752 if (!capable(CAP_NET_ADMIN)) 731 if (!capable(CAP_NET_ADMIN))
753 return -EPERM; 732 return -EPERM;
754 break; 733 break;
755 default: 734 default:
756 return -ENOIOCTLCMD; 735 return -ENOIOCTLCMD;
757 } 736 }
758 737
759 switch (cmd) { 738 switch (cmd) {
760 case SIOCMKCLIP: 739 case SIOCMKCLIP:
761 err = clip_create(arg); 740 err = clip_create(arg);
762 break; 741 break;
763 case ATMARPD_CTRL: 742 case ATMARPD_CTRL:
764 err = atm_init_atmarp(vcc); 743 err = atm_init_atmarp(vcc);
765 if (!err) { 744 if (!err) {
766 sock->state = SS_CONNECTED; 745 sock->state = SS_CONNECTED;
767 __module_get(THIS_MODULE); 746 __module_get(THIS_MODULE);
768 } 747 }
769 break; 748 break;
770 case ATMARP_MKIP: 749 case ATMARP_MKIP:
771 err = clip_mkip(vcc ,arg); 750 err = clip_mkip(vcc, arg);
772 break; 751 break;
773 case ATMARP_SETENTRY: 752 case ATMARP_SETENTRY:
774 err = clip_setentry(vcc, arg); 753 err = clip_setentry(vcc, arg);
775 break; 754 break;
776 case ATMARP_ENCAP: 755 case ATMARP_ENCAP:
777 err = clip_encap(vcc, arg); 756 err = clip_encap(vcc, arg);
778 break; 757 break;
779 } 758 }
780 return err; 759 return err;
781} 760}
782 761
783static struct atm_ioctl clip_ioctl_ops = { 762static struct atm_ioctl clip_ioctl_ops = {
784 .owner = THIS_MODULE, 763 .owner = THIS_MODULE,
785 .ioctl = clip_ioctl, 764 .ioctl = clip_ioctl,
786}; 765};
787 766
788#ifdef CONFIG_PROC_FS 767#ifdef CONFIG_PROC_FS
789 768
790static void svc_addr(struct seq_file *seq, struct sockaddr_atmsvc *addr) 769static void svc_addr(struct seq_file *seq, struct sockaddr_atmsvc *addr)
791{ 770{
792 static int code[] = { 1,2,10,6,1,0 }; 771 static int code[] = { 1, 2, 10, 6, 1, 0 };
793 static int e164[] = { 1,8,4,6,1,0 }; 772 static int e164[] = { 1, 8, 4, 6, 1, 0 };
794 773
795 if (*addr->sas_addr.pub) { 774 if (*addr->sas_addr.pub) {
796 seq_printf(seq, "%s", addr->sas_addr.pub); 775 seq_printf(seq, "%s", addr->sas_addr.pub);
@@ -809,7 +788,7 @@ static void svc_addr(struct seq_file *seq, struct sockaddr_atmsvc *addr)
809 for (i = 0; fields[i]; i++) { 788 for (i = 0; fields[i]; i++) {
810 for (j = fields[i]; j; j--) 789 for (j = fields[i]; j; j--)
811 seq_printf(seq, "%02X", *prv++); 790 seq_printf(seq, "%02X", *prv++);
812 if (fields[i+1]) 791 if (fields[i + 1])
813 seq_putc(seq, '.'); 792 seq_putc(seq, '.');
814 } 793 }
815 } 794 }
@@ -828,8 +807,7 @@ static void atmarp_info(struct seq_file *seq, struct net_device *dev,
828 svc = ((clip_vcc == SEQ_NO_VCC_TOKEN) || 807 svc = ((clip_vcc == SEQ_NO_VCC_TOKEN) ||
829 (sk_atm(clip_vcc->vcc)->sk_family == AF_ATMSVC)); 808 (sk_atm(clip_vcc->vcc)->sk_family == AF_ATMSVC));
830 809
831 llc = ((clip_vcc == SEQ_NO_VCC_TOKEN) || 810 llc = ((clip_vcc == SEQ_NO_VCC_TOKEN) || clip_vcc->encap);
832 clip_vcc->encap);
833 811
834 if (clip_vcc == SEQ_NO_VCC_TOKEN) 812 if (clip_vcc == SEQ_NO_VCC_TOKEN)
835 exp = entry->neigh->used; 813 exp = entry->neigh->used;
@@ -839,10 +817,7 @@ static void atmarp_info(struct seq_file *seq, struct net_device *dev,
839 exp = (jiffies - exp) / HZ; 817 exp = (jiffies - exp) / HZ;
840 818
841 seq_printf(seq, "%-6s%-4s%-4s%5ld ", 819 seq_printf(seq, "%-6s%-4s%-4s%5ld ",
842 dev->name, 820 dev->name, svc ? "SVC" : "PVC", llc ? "LLC" : "NULL", exp);
843 svc ? "SVC" : "PVC",
844 llc ? "LLC" : "NULL",
845 exp);
846 821
847 off = scnprintf(buf, sizeof(buf) - 1, "%d.%d.%d.%d", 822 off = scnprintf(buf, sizeof(buf) - 1, "%d.%d.%d.%d",
848 NIPQUAD(entry->ip)); 823 NIPQUAD(entry->ip));
@@ -860,8 +835,7 @@ static void atmarp_info(struct seq_file *seq, struct net_device *dev,
860 } else if (!svc) { 835 } else if (!svc) {
861 seq_printf(seq, "%d.%d.%d\n", 836 seq_printf(seq, "%d.%d.%d\n",
862 clip_vcc->vcc->dev->number, 837 clip_vcc->vcc->dev->number,
863 clip_vcc->vcc->vpi, 838 clip_vcc->vcc->vpi, clip_vcc->vcc->vci);
864 clip_vcc->vcc->vci);
865 } else { 839 } else {
866 svc_addr(seq, &clip_vcc->vcc->remote); 840 svc_addr(seq, &clip_vcc->vcc->remote);
867 seq_putc(seq, '\n'); 841 seq_putc(seq, '\n');
@@ -894,7 +868,7 @@ static struct clip_vcc *clip_seq_next_vcc(struct atmarp_entry *e,
894} 868}
895 869
896static void *clip_seq_vcc_walk(struct clip_seq_state *state, 870static void *clip_seq_vcc_walk(struct clip_seq_state *state,
897 struct atmarp_entry *e, loff_t *pos) 871 struct atmarp_entry *e, loff_t * pos)
898{ 872{
899 struct clip_vcc *vcc = state->vcc; 873 struct clip_vcc *vcc = state->vcc;
900 874
@@ -911,24 +885,24 @@ static void *clip_seq_vcc_walk(struct clip_seq_state *state,
911 885
912 return vcc; 886 return vcc;
913} 887}
914 888
915static void *clip_seq_sub_iter(struct neigh_seq_state *_state, 889static void *clip_seq_sub_iter(struct neigh_seq_state *_state,
916 struct neighbour *n, loff_t *pos) 890 struct neighbour *n, loff_t * pos)
917{ 891{
918 struct clip_seq_state *state = (struct clip_seq_state *) _state; 892 struct clip_seq_state *state = (struct clip_seq_state *)_state;
919 893
920 return clip_seq_vcc_walk(state, NEIGH2ENTRY(n), pos); 894 return clip_seq_vcc_walk(state, NEIGH2ENTRY(n), pos);
921} 895}
922 896
923static void *clip_seq_start(struct seq_file *seq, loff_t *pos) 897static void *clip_seq_start(struct seq_file *seq, loff_t * pos)
924{ 898{
925 return neigh_seq_start(seq, pos, &clip_tbl, NEIGH_SEQ_NEIGH_ONLY); 899 return neigh_seq_start(seq, pos, &clip_tbl, NEIGH_SEQ_NEIGH_ONLY);
926} 900}
927 901
928static int clip_seq_show(struct seq_file *seq, void *v) 902static int clip_seq_show(struct seq_file *seq, void *v)
929{ 903{
930 static char atm_arp_banner[] = 904 static char atm_arp_banner[] =
931 "IPitf TypeEncp Idle IP address ATM address\n"; 905 "IPitf TypeEncp Idle IP address ATM address\n";
932 906
933 if (v == SEQ_START_TOKEN) { 907 if (v == SEQ_START_TOKEN) {
934 seq_puts(seq, atm_arp_banner); 908 seq_puts(seq, atm_arp_banner);
@@ -939,7 +913,7 @@ static int clip_seq_show(struct seq_file *seq, void *v)
939 913
940 atmarp_info(seq, n->dev, NEIGH2ENTRY(n), vcc); 914 atmarp_info(seq, n->dev, NEIGH2ENTRY(n), vcc);
941 } 915 }
942 return 0; 916 return 0;
943} 917}
944 918
945static struct seq_operations arp_seq_ops = { 919static struct seq_operations arp_seq_ops = {
@@ -988,20 +962,19 @@ static struct file_operations arp_seq_fops = {
988 962
989static int __init atm_clip_init(void) 963static int __init atm_clip_init(void)
990{ 964{
991 neigh_table_init(&clip_tbl); 965 struct proc_dir_entry *p;
966 neigh_table_init_no_netlink(&clip_tbl);
992 967
993 clip_tbl_hook = &clip_tbl; 968 clip_tbl_hook = &clip_tbl;
994 register_atm_ioctl(&clip_ioctl_ops); 969 register_atm_ioctl(&clip_ioctl_ops);
970 register_netdevice_notifier(&clip_dev_notifier);
971 register_inetaddr_notifier(&clip_inet_notifier);
995 972
996#ifdef CONFIG_PROC_FS 973 setup_timer(&idle_timer, idle_timer_check, 0);
997{
998 struct proc_dir_entry *p;
999 974
1000 p = create_proc_entry("arp", S_IRUGO, atm_proc_root); 975 p = create_proc_entry("arp", S_IRUGO, atm_proc_root);
1001 if (p) 976 if (p)
1002 p->proc_fops = &arp_seq_fops; 977 p->proc_fops = &arp_seq_fops;
1003}
1004#endif
1005 978
1006 return 0; 979 return 0;
1007} 980}
@@ -1012,13 +985,15 @@ static void __exit atm_clip_exit(void)
1012 985
1013 remove_proc_entry("arp", atm_proc_root); 986 remove_proc_entry("arp", atm_proc_root);
1014 987
988 unregister_inetaddr_notifier(&clip_inet_notifier);
989 unregister_netdevice_notifier(&clip_dev_notifier);
990
1015 deregister_atm_ioctl(&clip_ioctl_ops); 991 deregister_atm_ioctl(&clip_ioctl_ops);
1016 992
1017 /* First, stop the idle timer, so it stops banging 993 /* First, stop the idle timer, so it stops banging
1018 * on the table. 994 * on the table.
1019 */ 995 */
1020 if (start_timer == 0) 996 del_timer_sync(&idle_timer);
1021 del_timer(&idle_timer);
1022 997
1023 /* Next, purge the table, so that the device 998 /* Next, purge the table, so that the device
1024 * unregister loop below does not hang due to 999 * unregister loop below does not hang due to
@@ -1042,5 +1017,6 @@ static void __exit atm_clip_exit(void)
1042 1017
1043module_init(atm_clip_init); 1018module_init(atm_clip_init);
1044module_exit(atm_clip_exit); 1019module_exit(atm_clip_exit);
1045 1020MODULE_AUTHOR("Werner Almesberger");
1021MODULE_DESCRIPTION("Classical/IP over ATM interface");
1046MODULE_LICENSE("GPL"); 1022MODULE_LICENSE("GPL");
diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c
index dbf9b47681f7..a2e0dd047e9f 100644
--- a/net/ax25/af_ax25.c
+++ b/net/ax25/af_ax25.c
@@ -228,6 +228,8 @@ ax25_cb *ax25_find_cb(ax25_address *src_addr, ax25_address *dest_addr,
228 return NULL; 228 return NULL;
229} 229}
230 230
231EXPORT_SYMBOL(ax25_find_cb);
232
231void ax25_send_to_raw(ax25_address *addr, struct sk_buff *skb, int proto) 233void ax25_send_to_raw(ax25_address *addr, struct sk_buff *skb, int proto)
232{ 234{
233 ax25_cb *s; 235 ax25_cb *s;
@@ -424,6 +426,26 @@ static int ax25_ctl_ioctl(const unsigned int cmd, void __user *arg)
424 return 0; 426 return 0;
425} 427}
426 428
429static void ax25_fillin_cb_from_dev(ax25_cb *ax25, ax25_dev *ax25_dev)
430{
431 ax25->rtt = msecs_to_jiffies(ax25_dev->values[AX25_VALUES_T1]) / 2;
432 ax25->t1 = msecs_to_jiffies(ax25_dev->values[AX25_VALUES_T1]);
433 ax25->t2 = msecs_to_jiffies(ax25_dev->values[AX25_VALUES_T2]);
434 ax25->t3 = msecs_to_jiffies(ax25_dev->values[AX25_VALUES_T3]);
435 ax25->n2 = ax25_dev->values[AX25_VALUES_N2];
436 ax25->paclen = ax25_dev->values[AX25_VALUES_PACLEN];
437 ax25->idle = msecs_to_jiffies(ax25_dev->values[AX25_VALUES_IDLE]);
438 ax25->backoff = ax25_dev->values[AX25_VALUES_BACKOFF];
439
440 if (ax25_dev->values[AX25_VALUES_AXDEFMODE]) {
441 ax25->modulus = AX25_EMODULUS;
442 ax25->window = ax25_dev->values[AX25_VALUES_EWINDOW];
443 } else {
444 ax25->modulus = AX25_MODULUS;
445 ax25->window = ax25_dev->values[AX25_VALUES_WINDOW];
446 }
447}
448
427/* 449/*
428 * Fill in a created AX.25 created control block with the default 450 * Fill in a created AX.25 created control block with the default
429 * values for a particular device. 451 * values for a particular device.
@@ -433,39 +455,28 @@ void ax25_fillin_cb(ax25_cb *ax25, ax25_dev *ax25_dev)
433 ax25->ax25_dev = ax25_dev; 455 ax25->ax25_dev = ax25_dev;
434 456
435 if (ax25->ax25_dev != NULL) { 457 if (ax25->ax25_dev != NULL) {
436 ax25->rtt = ax25_dev->values[AX25_VALUES_T1] / 2; 458 ax25_fillin_cb_from_dev(ax25, ax25_dev);
437 ax25->t1 = ax25_dev->values[AX25_VALUES_T1]; 459 return;
438 ax25->t2 = ax25_dev->values[AX25_VALUES_T2]; 460 }
439 ax25->t3 = ax25_dev->values[AX25_VALUES_T3]; 461
440 ax25->n2 = ax25_dev->values[AX25_VALUES_N2]; 462 /*
441 ax25->paclen = ax25_dev->values[AX25_VALUES_PACLEN]; 463 * No device, use kernel / AX.25 spec default values
442 ax25->idle = ax25_dev->values[AX25_VALUES_IDLE]; 464 */
443 ax25->backoff = ax25_dev->values[AX25_VALUES_BACKOFF]; 465 ax25->rtt = msecs_to_jiffies(AX25_DEF_T1) / 2;
444 466 ax25->t1 = msecs_to_jiffies(AX25_DEF_T1);
445 if (ax25_dev->values[AX25_VALUES_AXDEFMODE]) { 467 ax25->t2 = msecs_to_jiffies(AX25_DEF_T2);
446 ax25->modulus = AX25_EMODULUS; 468 ax25->t3 = msecs_to_jiffies(AX25_DEF_T3);
447 ax25->window = ax25_dev->values[AX25_VALUES_EWINDOW]; 469 ax25->n2 = AX25_DEF_N2;
448 } else { 470 ax25->paclen = AX25_DEF_PACLEN;
449 ax25->modulus = AX25_MODULUS; 471 ax25->idle = msecs_to_jiffies(AX25_DEF_IDLE);
450 ax25->window = ax25_dev->values[AX25_VALUES_WINDOW]; 472 ax25->backoff = AX25_DEF_BACKOFF;
451 } 473
474 if (AX25_DEF_AXDEFMODE) {
475 ax25->modulus = AX25_EMODULUS;
476 ax25->window = AX25_DEF_EWINDOW;
452 } else { 477 } else {
453 ax25->rtt = AX25_DEF_T1 / 2; 478 ax25->modulus = AX25_MODULUS;
454 ax25->t1 = AX25_DEF_T1; 479 ax25->window = AX25_DEF_WINDOW;
455 ax25->t2 = AX25_DEF_T2;
456 ax25->t3 = AX25_DEF_T3;
457 ax25->n2 = AX25_DEF_N2;
458 ax25->paclen = AX25_DEF_PACLEN;
459 ax25->idle = AX25_DEF_IDLE;
460 ax25->backoff = AX25_DEF_BACKOFF;
461
462 if (AX25_DEF_AXDEFMODE) {
463 ax25->modulus = AX25_EMODULUS;
464 ax25->window = AX25_DEF_EWINDOW;
465 } else {
466 ax25->modulus = AX25_MODULUS;
467 ax25->window = AX25_DEF_WINDOW;
468 }
469 } 480 }
470} 481}
471 482
@@ -1979,24 +1990,6 @@ static struct notifier_block ax25_dev_notifier = {
1979 .notifier_call =ax25_device_event, 1990 .notifier_call =ax25_device_event,
1980}; 1991};
1981 1992
1982EXPORT_SYMBOL(ax25_hard_header);
1983EXPORT_SYMBOL(ax25_rebuild_header);
1984EXPORT_SYMBOL(ax25_findbyuid);
1985EXPORT_SYMBOL(ax25_find_cb);
1986EXPORT_SYMBOL(ax25_linkfail_register);
1987EXPORT_SYMBOL(ax25_linkfail_release);
1988EXPORT_SYMBOL(ax25_listen_register);
1989EXPORT_SYMBOL(ax25_listen_release);
1990EXPORT_SYMBOL(ax25_protocol_register);
1991EXPORT_SYMBOL(ax25_protocol_release);
1992EXPORT_SYMBOL(ax25_send_frame);
1993EXPORT_SYMBOL(ax25_uid_policy);
1994EXPORT_SYMBOL(ax25cmp);
1995EXPORT_SYMBOL(ax2asc);
1996EXPORT_SYMBOL(asc2ax);
1997EXPORT_SYMBOL(null_ax25_address);
1998EXPORT_SYMBOL(ax25_display_timer);
1999
2000static int __init ax25_init(void) 1993static int __init ax25_init(void)
2001{ 1994{
2002 int rc = proto_register(&ax25_proto, 0); 1995 int rc = proto_register(&ax25_proto, 0);
diff --git a/net/ax25/ax25_addr.c b/net/ax25/ax25_addr.c
index 0164a155b8c4..5f0896ad0042 100644
--- a/net/ax25/ax25_addr.c
+++ b/net/ax25/ax25_addr.c
@@ -11,6 +11,7 @@
11#include <linux/socket.h> 11#include <linux/socket.h>
12#include <linux/in.h> 12#include <linux/in.h>
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/module.h>
14#include <linux/sched.h> 15#include <linux/sched.h>
15#include <linux/timer.h> 16#include <linux/timer.h>
16#include <linux/string.h> 17#include <linux/string.h>
@@ -33,6 +34,8 @@
33 */ 34 */
34ax25_address null_ax25_address = {{0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00}}; 35ax25_address null_ax25_address = {{0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00}};
35 36
37EXPORT_SYMBOL(null_ax25_address);
38
36/* 39/*
37 * ax25 -> ascii conversion 40 * ax25 -> ascii conversion
38 */ 41 */
@@ -64,6 +67,8 @@ char *ax2asc(char *buf, ax25_address *a)
64 67
65} 68}
66 69
70EXPORT_SYMBOL(ax2asc);
71
67/* 72/*
68 * ascii -> ax25 conversion 73 * ascii -> ax25 conversion
69 */ 74 */
@@ -97,6 +102,8 @@ void asc2ax(ax25_address *addr, char *callsign)
97 addr->ax25_call[6] &= 0x1E; 102 addr->ax25_call[6] &= 0x1E;
98} 103}
99 104
105EXPORT_SYMBOL(asc2ax);
106
100/* 107/*
101 * Compare two ax.25 addresses 108 * Compare two ax.25 addresses
102 */ 109 */
@@ -116,6 +123,8 @@ int ax25cmp(ax25_address *a, ax25_address *b)
116 return 2; /* Partial match */ 123 return 2; /* Partial match */
117} 124}
118 125
126EXPORT_SYMBOL(ax25cmp);
127
119/* 128/*
120 * Compare two AX.25 digipeater paths. 129 * Compare two AX.25 digipeater paths.
121 */ 130 */
diff --git a/net/ax25/ax25_ds_timer.c b/net/ax25/ax25_ds_timer.c
index 061083efc1dc..5961459935eb 100644
--- a/net/ax25/ax25_ds_timer.c
+++ b/net/ax25/ax25_ds_timer.c
@@ -61,7 +61,8 @@ void ax25_ds_set_timer(ax25_dev *ax25_dev)
61 return; 61 return;
62 62
63 del_timer(&ax25_dev->dama.slave_timer); 63 del_timer(&ax25_dev->dama.slave_timer);
64 ax25_dev->dama.slave_timeout = ax25_dev->values[AX25_VALUES_DS_TIMEOUT] / 10; 64 ax25_dev->dama.slave_timeout =
65 msecs_to_jiffies(ax25_dev->values[AX25_VALUES_DS_TIMEOUT]) / 10;
65 ax25_ds_add_timer(ax25_dev); 66 ax25_ds_add_timer(ax25_dev);
66} 67}
67 68
diff --git a/net/ax25/ax25_iface.c b/net/ax25/ax25_iface.c
index d68aff100729..3bb152710b77 100644
--- a/net/ax25/ax25_iface.c
+++ b/net/ax25/ax25_iface.c
@@ -12,6 +12,7 @@
12#include <linux/socket.h> 12#include <linux/socket.h>
13#include <linux/in.h> 13#include <linux/in.h>
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/module.h>
15#include <linux/sched.h> 16#include <linux/sched.h>
16#include <linux/spinlock.h> 17#include <linux/spinlock.h>
17#include <linux/timer.h> 18#include <linux/timer.h>
@@ -74,6 +75,8 @@ int ax25_protocol_register(unsigned int pid,
74 return 1; 75 return 1;
75} 76}
76 77
78EXPORT_SYMBOL(ax25_protocol_register);
79
77void ax25_protocol_release(unsigned int pid) 80void ax25_protocol_release(unsigned int pid)
78{ 81{
79 struct protocol_struct *s, *protocol; 82 struct protocol_struct *s, *protocol;
@@ -106,6 +109,8 @@ void ax25_protocol_release(unsigned int pid)
106 write_unlock(&protocol_list_lock); 109 write_unlock(&protocol_list_lock);
107} 110}
108 111
112EXPORT_SYMBOL(ax25_protocol_release);
113
109int ax25_linkfail_register(void (*func)(ax25_cb *, int)) 114int ax25_linkfail_register(void (*func)(ax25_cb *, int))
110{ 115{
111 struct linkfail_struct *linkfail; 116 struct linkfail_struct *linkfail;
@@ -123,6 +128,8 @@ int ax25_linkfail_register(void (*func)(ax25_cb *, int))
123 return 1; 128 return 1;
124} 129}
125 130
131EXPORT_SYMBOL(ax25_linkfail_register);
132
126void ax25_linkfail_release(void (*func)(ax25_cb *, int)) 133void ax25_linkfail_release(void (*func)(ax25_cb *, int))
127{ 134{
128 struct linkfail_struct *s, *linkfail; 135 struct linkfail_struct *s, *linkfail;
@@ -155,6 +162,8 @@ void ax25_linkfail_release(void (*func)(ax25_cb *, int))
155 spin_unlock_bh(&linkfail_lock); 162 spin_unlock_bh(&linkfail_lock);
156} 163}
157 164
165EXPORT_SYMBOL(ax25_linkfail_release);
166
158int ax25_listen_register(ax25_address *callsign, struct net_device *dev) 167int ax25_listen_register(ax25_address *callsign, struct net_device *dev)
159{ 168{
160 struct listen_struct *listen; 169 struct listen_struct *listen;
@@ -176,6 +185,8 @@ int ax25_listen_register(ax25_address *callsign, struct net_device *dev)
176 return 1; 185 return 1;
177} 186}
178 187
188EXPORT_SYMBOL(ax25_listen_register);
189
179void ax25_listen_release(ax25_address *callsign, struct net_device *dev) 190void ax25_listen_release(ax25_address *callsign, struct net_device *dev)
180{ 191{
181 struct listen_struct *s, *listen; 192 struct listen_struct *s, *listen;
@@ -208,6 +219,8 @@ void ax25_listen_release(ax25_address *callsign, struct net_device *dev)
208 spin_unlock_bh(&listen_lock); 219 spin_unlock_bh(&listen_lock);
209} 220}
210 221
222EXPORT_SYMBOL(ax25_listen_release);
223
211int (*ax25_protocol_function(unsigned int pid))(struct sk_buff *, ax25_cb *) 224int (*ax25_protocol_function(unsigned int pid))(struct sk_buff *, ax25_cb *)
212{ 225{
213 int (*res)(struct sk_buff *, ax25_cb *) = NULL; 226 int (*res)(struct sk_buff *, ax25_cb *) = NULL;
diff --git a/net/ax25/ax25_ip.c b/net/ax25/ax25_ip.c
index d643dac3eccc..a0b534f80f17 100644
--- a/net/ax25/ax25_ip.c
+++ b/net/ax25/ax25_ip.c
@@ -12,6 +12,7 @@
12#include <linux/socket.h> 12#include <linux/socket.h>
13#include <linux/in.h> 13#include <linux/in.h>
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/module.h>
15#include <linux/sched.h> 16#include <linux/sched.h>
16#include <linux/timer.h> 17#include <linux/timer.h>
17#include <linux/string.h> 18#include <linux/string.h>
@@ -221,3 +222,5 @@ int ax25_rebuild_header(struct sk_buff *skb)
221 222
222#endif 223#endif
223 224
225EXPORT_SYMBOL(ax25_hard_header);
226EXPORT_SYMBOL(ax25_rebuild_header);
diff --git a/net/ax25/ax25_out.c b/net/ax25/ax25_out.c
index 5fc048dcd39a..5d99852b239c 100644
--- a/net/ax25/ax25_out.c
+++ b/net/ax25/ax25_out.c
@@ -14,6 +14,7 @@
14#include <linux/socket.h> 14#include <linux/socket.h>
15#include <linux/in.h> 15#include <linux/in.h>
16#include <linux/kernel.h> 16#include <linux/kernel.h>
17#include <linux/module.h>
17#include <linux/sched.h> 18#include <linux/sched.h>
18#include <linux/timer.h> 19#include <linux/timer.h>
19#include <linux/string.h> 20#include <linux/string.h>
@@ -104,6 +105,8 @@ ax25_cb *ax25_send_frame(struct sk_buff *skb, int paclen, ax25_address *src, ax2
104 return ax25; /* We had to create it */ 105 return ax25; /* We had to create it */
105} 106}
106 107
108EXPORT_SYMBOL(ax25_send_frame);
109
107/* 110/*
108 * All outgoing AX.25 I frames pass via this routine. Therefore this is 111 * All outgoing AX.25 I frames pass via this routine. Therefore this is
109 * where the fragmentation of frames takes place. If fragment is set to 112 * where the fragmentation of frames takes place. If fragment is set to
diff --git a/net/ax25/ax25_route.c b/net/ax25/ax25_route.c
index f04f8630fd28..5ac98250797b 100644
--- a/net/ax25/ax25_route.c
+++ b/net/ax25/ax25_route.c
@@ -360,7 +360,7 @@ struct file_operations ax25_route_fops = {
360/* 360/*
361 * Find AX.25 route 361 * Find AX.25 route
362 * 362 *
363 * Only routes with a refernce rout of zero can be destroyed. 363 * Only routes with a reference count of zero can be destroyed.
364 */ 364 */
365static ax25_route *ax25_get_route(ax25_address *addr, struct net_device *dev) 365static ax25_route *ax25_get_route(ax25_address *addr, struct net_device *dev)
366{ 366{
diff --git a/net/ax25/ax25_timer.c b/net/ax25/ax25_timer.c
index 7a6b50a14554..ec254057f212 100644
--- a/net/ax25/ax25_timer.c
+++ b/net/ax25/ax25_timer.c
@@ -18,6 +18,7 @@
18#include <linux/socket.h> 18#include <linux/socket.h>
19#include <linux/in.h> 19#include <linux/in.h>
20#include <linux/kernel.h> 20#include <linux/kernel.h>
21#include <linux/module.h>
21#include <linux/jiffies.h> 22#include <linux/jiffies.h>
22#include <linux/timer.h> 23#include <linux/timer.h>
23#include <linux/string.h> 24#include <linux/string.h>
@@ -137,6 +138,8 @@ unsigned long ax25_display_timer(struct timer_list *timer)
137 return timer->expires - jiffies; 138 return timer->expires - jiffies;
138} 139}
139 140
141EXPORT_SYMBOL(ax25_display_timer);
142
140static void ax25_heartbeat_expiry(unsigned long param) 143static void ax25_heartbeat_expiry(unsigned long param)
141{ 144{
142 int proto = AX25_PROTO_STD_SIMPLEX; 145 int proto = AX25_PROTO_STD_SIMPLEX;
diff --git a/net/ax25/ax25_uid.c b/net/ax25/ax25_uid.c
index b8b5854bce9a..5e9a81e8b214 100644
--- a/net/ax25/ax25_uid.c
+++ b/net/ax25/ax25_uid.c
@@ -49,6 +49,8 @@ static DEFINE_RWLOCK(ax25_uid_lock);
49 49
50int ax25_uid_policy = 0; 50int ax25_uid_policy = 0;
51 51
52EXPORT_SYMBOL(ax25_uid_policy);
53
52ax25_uid_assoc *ax25_findbyuid(uid_t uid) 54ax25_uid_assoc *ax25_findbyuid(uid_t uid)
53{ 55{
54 ax25_uid_assoc *ax25_uid, *res = NULL; 56 ax25_uid_assoc *ax25_uid, *res = NULL;
@@ -67,6 +69,8 @@ ax25_uid_assoc *ax25_findbyuid(uid_t uid)
67 return res; 69 return res;
68} 70}
69 71
72EXPORT_SYMBOL(ax25_findbyuid);
73
70int ax25_uid_ioctl(int cmd, struct sockaddr_ax25 *sax) 74int ax25_uid_ioctl(int cmd, struct sockaddr_ax25 *sax)
71{ 75{
72 ax25_uid_assoc *ax25_uid; 76 ax25_uid_assoc *ax25_uid;
diff --git a/net/ax25/sysctl_net_ax25.c b/net/ax25/sysctl_net_ax25.c
index 894a22558d9d..bdb64c36df12 100644
--- a/net/ax25/sysctl_net_ax25.c
+++ b/net/ax25/sysctl_net_ax25.c
@@ -18,14 +18,14 @@ static int min_backoff[1], max_backoff[] = {2};
18static int min_conmode[1], max_conmode[] = {2}; 18static int min_conmode[1], max_conmode[] = {2};
19static int min_window[] = {1}, max_window[] = {7}; 19static int min_window[] = {1}, max_window[] = {7};
20static int min_ewindow[] = {1}, max_ewindow[] = {63}; 20static int min_ewindow[] = {1}, max_ewindow[] = {63};
21static int min_t1[] = {1}, max_t1[] = {30 * HZ}; 21static int min_t1[] = {1}, max_t1[] = {30000};
22static int min_t2[] = {1}, max_t2[] = {20 * HZ}; 22static int min_t2[] = {1}, max_t2[] = {20000};
23static int min_t3[1], max_t3[] = {3600 * HZ}; 23static int min_t3[1], max_t3[] = {3600000};
24static int min_idle[1], max_idle[] = {65535 * HZ}; 24static int min_idle[1], max_idle[] = {65535000};
25static int min_n2[] = {1}, max_n2[] = {31}; 25static int min_n2[] = {1}, max_n2[] = {31};
26static int min_paclen[] = {1}, max_paclen[] = {512}; 26static int min_paclen[] = {1}, max_paclen[] = {512};
27static int min_proto[1], max_proto[] = { AX25_PROTO_MAX }; 27static int min_proto[1], max_proto[] = { AX25_PROTO_MAX };
28static int min_ds_timeout[1], max_ds_timeout[] = {65535 * HZ}; 28static int min_ds_timeout[1], max_ds_timeout[] = {65535000};
29 29
30static struct ctl_table_header *ax25_table_header; 30static struct ctl_table_header *ax25_table_header;
31 31
diff --git a/net/bridge/br.c b/net/bridge/br.c
index 22d806cf40ca..12da21afb9ca 100644
--- a/net/bridge/br.c
+++ b/net/bridge/br.c
@@ -55,7 +55,7 @@ static int __init br_init(void)
55 55
56static void __exit br_deinit(void) 56static void __exit br_deinit(void)
57{ 57{
58 llc_sap_close(br_stp_sap); 58 rcu_assign_pointer(br_stp_sap->rcv_func, NULL);
59 59
60#ifdef CONFIG_BRIDGE_NETFILTER 60#ifdef CONFIG_BRIDGE_NETFILTER
61 br_netfilter_fini(); 61 br_netfilter_fini();
@@ -67,6 +67,7 @@ static void __exit br_deinit(void)
67 67
68 synchronize_net(); 68 synchronize_net();
69 69
70 llc_sap_put(br_stp_sap);
70 br_fdb_get_hook = NULL; 71 br_fdb_get_hook = NULL;
71 br_fdb_put_hook = NULL; 72 br_fdb_put_hook = NULL;
72 73
diff --git a/net/bridge/br_forward.c b/net/bridge/br_forward.c
index 2d24fb400e0c..56f3aa47e758 100644
--- a/net/bridge/br_forward.c
+++ b/net/bridge/br_forward.c
@@ -16,6 +16,7 @@
16#include <linux/kernel.h> 16#include <linux/kernel.h>
17#include <linux/netdevice.h> 17#include <linux/netdevice.h>
18#include <linux/skbuff.h> 18#include <linux/skbuff.h>
19#include <linux/if_vlan.h>
19#include <linux/netfilter_bridge.h> 20#include <linux/netfilter_bridge.h>
20#include "br_private.h" 21#include "br_private.h"
21 22
@@ -29,10 +30,15 @@ static inline int should_deliver(const struct net_bridge_port *p,
29 return 1; 30 return 1;
30} 31}
31 32
33static inline unsigned packet_length(const struct sk_buff *skb)
34{
35 return skb->len - (skb->protocol == htons(ETH_P_8021Q) ? VLAN_HLEN : 0);
36}
37
32int br_dev_queue_push_xmit(struct sk_buff *skb) 38int br_dev_queue_push_xmit(struct sk_buff *skb)
33{ 39{
34 /* drop mtu oversized packets except tso */ 40 /* drop mtu oversized packets except tso */
35 if (skb->len > skb->dev->mtu && !skb_shinfo(skb)->tso_size) 41 if (packet_length(skb) > skb->dev->mtu && !skb_shinfo(skb)->tso_size)
36 kfree_skb(skb); 42 kfree_skb(skb);
37 else { 43 else {
38#ifdef CONFIG_BRIDGE_NETFILTER 44#ifdef CONFIG_BRIDGE_NETFILTER
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index 59eef42d4a42..f5d47bf4f967 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -300,34 +300,22 @@ int br_add_bridge(const char *name)
300 rtnl_lock(); 300 rtnl_lock();
301 if (strchr(dev->name, '%')) { 301 if (strchr(dev->name, '%')) {
302 ret = dev_alloc_name(dev, dev->name); 302 ret = dev_alloc_name(dev, dev->name);
303 if (ret < 0) 303 if (ret < 0) {
304 goto err1; 304 free_netdev(dev);
305 goto out;
306 }
305 } 307 }
306 308
307 ret = register_netdevice(dev); 309 ret = register_netdevice(dev);
308 if (ret) 310 if (ret)
309 goto err2; 311 goto out;
310
311 /* network device kobject is not setup until
312 * after rtnl_unlock does it's hotplug magic.
313 * so hold reference to avoid race.
314 */
315 dev_hold(dev);
316 rtnl_unlock();
317 312
318 ret = br_sysfs_addbr(dev); 313 ret = br_sysfs_addbr(dev);
319 dev_put(dev); 314 if (ret)
320 315 unregister_netdevice(dev);
321 if (ret)
322 unregister_netdev(dev);
323 out: 316 out:
324 return ret;
325
326 err2:
327 free_netdev(dev);
328 err1:
329 rtnl_unlock(); 317 rtnl_unlock();
330 goto out; 318 return ret;
331} 319}
332 320
333int br_del_bridge(const char *name) 321int br_del_bridge(const char *name)
diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c
index b0b7f55c1edd..bfa4d8c333f7 100644
--- a/net/bridge/br_input.c
+++ b/net/bridge/br_input.c
@@ -66,6 +66,7 @@ int br_handle_frame_finish(struct sk_buff *skb)
66 } 66 }
67 67
68 if (is_multicast_ether_addr(dest)) { 68 if (is_multicast_ether_addr(dest)) {
69 br->statistics.multicast++;
69 br_flood_forward(br, skb, !passedup); 70 br_flood_forward(br, skb, !passedup);
70 if (!passedup) 71 if (!passedup)
71 br_pass_frame_up(br, skb); 72 br_pass_frame_up(br, skb);
diff --git a/net/bridge/netfilter/ebt_log.c b/net/bridge/netfilter/ebt_log.c
index d159c92cca84..466ed3440b74 100644
--- a/net/bridge/netfilter/ebt_log.c
+++ b/net/bridge/netfilter/ebt_log.c
@@ -168,7 +168,7 @@ static void ebt_log(const struct sk_buff *skb, unsigned int hooknr,
168 168
169 if (info->bitmask & EBT_LOG_NFLOG) 169 if (info->bitmask & EBT_LOG_NFLOG)
170 nf_log_packet(PF_BRIDGE, hooknr, skb, in, out, &li, 170 nf_log_packet(PF_BRIDGE, hooknr, skb, in, out, &li,
171 info->prefix); 171 "%s", info->prefix);
172 else 172 else
173 ebt_log_packet(PF_BRIDGE, hooknr, skb, in, out, &li, 173 ebt_log_packet(PF_BRIDGE, hooknr, skb, in, out, &li,
174 info->prefix); 174 info->prefix);
diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c
index 84b9af76f0a2..3a13ed643459 100644
--- a/net/bridge/netfilter/ebtables.c
+++ b/net/bridge/netfilter/ebtables.c
@@ -831,7 +831,7 @@ static int translate_table(struct ebt_replace *repl,
831 return -ENOMEM; 831 return -ENOMEM;
832 for_each_possible_cpu(i) { 832 for_each_possible_cpu(i) {
833 newinfo->chainstack[i] = 833 newinfo->chainstack[i] =
834 vmalloc(udc_cnt * sizeof(struct ebt_chainstack)); 834 vmalloc(udc_cnt * sizeof(*(newinfo->chainstack[0])));
835 if (!newinfo->chainstack[i]) { 835 if (!newinfo->chainstack[i]) {
836 while (i) 836 while (i)
837 vfree(newinfo->chainstack[--i]); 837 vfree(newinfo->chainstack[--i]);
@@ -841,8 +841,7 @@ static int translate_table(struct ebt_replace *repl,
841 } 841 }
842 } 842 }
843 843
844 cl_s = (struct ebt_cl_stack *) 844 cl_s = vmalloc(udc_cnt * sizeof(*cl_s));
845 vmalloc(udc_cnt * sizeof(struct ebt_cl_stack));
846 if (!cl_s) 845 if (!cl_s)
847 return -ENOMEM; 846 return -ENOMEM;
848 i = 0; /* the i'th udc */ 847 i = 0; /* the i'th udc */
@@ -944,8 +943,7 @@ static int do_replace(void __user *user, unsigned int len)
944 943
945 countersize = COUNTER_OFFSET(tmp.nentries) * 944 countersize = COUNTER_OFFSET(tmp.nentries) *
946 (highest_possible_processor_id()+1); 945 (highest_possible_processor_id()+1);
947 newinfo = (struct ebt_table_info *) 946 newinfo = vmalloc(sizeof(*newinfo) + countersize);
948 vmalloc(sizeof(struct ebt_table_info) + countersize);
949 if (!newinfo) 947 if (!newinfo)
950 return -ENOMEM; 948 return -ENOMEM;
951 949
@@ -967,8 +965,7 @@ static int do_replace(void __user *user, unsigned int len)
967 /* the user wants counters back 965 /* the user wants counters back
968 the check on the size is done later, when we have the lock */ 966 the check on the size is done later, when we have the lock */
969 if (tmp.num_counters) { 967 if (tmp.num_counters) {
970 counterstmp = (struct ebt_counter *) 968 counterstmp = vmalloc(tmp.num_counters * sizeof(*counterstmp));
971 vmalloc(tmp.num_counters * sizeof(struct ebt_counter));
972 if (!counterstmp) { 969 if (!counterstmp) {
973 ret = -ENOMEM; 970 ret = -ENOMEM;
974 goto free_entries; 971 goto free_entries;
@@ -1148,8 +1145,7 @@ int ebt_register_table(struct ebt_table *table)
1148 1145
1149 countersize = COUNTER_OFFSET(table->table->nentries) * 1146 countersize = COUNTER_OFFSET(table->table->nentries) *
1150 (highest_possible_processor_id()+1); 1147 (highest_possible_processor_id()+1);
1151 newinfo = (struct ebt_table_info *) 1148 newinfo = vmalloc(sizeof(*newinfo) + countersize);
1152 vmalloc(sizeof(struct ebt_table_info) + countersize);
1153 ret = -ENOMEM; 1149 ret = -ENOMEM;
1154 if (!newinfo) 1150 if (!newinfo)
1155 return -ENOMEM; 1151 return -ENOMEM;
@@ -1247,8 +1243,7 @@ static int update_counters(void __user *user, unsigned int len)
1247 if (hlp.num_counters == 0) 1243 if (hlp.num_counters == 0)
1248 return -EINVAL; 1244 return -EINVAL;
1249 1245
1250 if ( !(tmp = (struct ebt_counter *) 1246 if (!(tmp = vmalloc(hlp.num_counters * sizeof(*tmp)))) {
1251 vmalloc(hlp.num_counters * sizeof(struct ebt_counter))) ){
1252 MEMPRINT("Update_counters && nomemory\n"); 1247 MEMPRINT("Update_counters && nomemory\n");
1253 return -ENOMEM; 1248 return -ENOMEM;
1254 } 1249 }
@@ -1377,8 +1372,7 @@ static int copy_everything_to_user(struct ebt_table *t, void __user *user,
1377 BUGPRINT("Num_counters wrong\n"); 1372 BUGPRINT("Num_counters wrong\n");
1378 return -EINVAL; 1373 return -EINVAL;
1379 } 1374 }
1380 counterstmp = (struct ebt_counter *) 1375 counterstmp = vmalloc(nentries * sizeof(*counterstmp));
1381 vmalloc(nentries * sizeof(struct ebt_counter));
1382 if (!counterstmp) { 1376 if (!counterstmp) {
1383 MEMPRINT("Couldn't copy counters, out of memory\n"); 1377 MEMPRINT("Couldn't copy counters, out of memory\n");
1384 return -ENOMEM; 1378 return -ENOMEM;
diff --git a/net/core/dev.c b/net/core/dev.c
index 83231a27ae02..4fba549caf29 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -127,7 +127,7 @@
127 * sure which should go first, but I bet it won't make much 127 * sure which should go first, but I bet it won't make much
128 * difference if we are running VLANs. The good news is that 128 * difference if we are running VLANs. The good news is that
129 * this protocol won't be in the list unless compiled in, so 129 * this protocol won't be in the list unless compiled in, so
130 * the average user (w/out VLANs) will not be adversly affected. 130 * the average user (w/out VLANs) will not be adversely affected.
131 * --BLG 131 * --BLG
132 * 132 *
133 * 0800 IP 133 * 0800 IP
@@ -149,7 +149,7 @@ static struct list_head ptype_base[16]; /* 16 way hashed list */
149static struct list_head ptype_all; /* Taps */ 149static struct list_head ptype_all; /* Taps */
150 150
151/* 151/*
152 * The @dev_base list is protected by @dev_base_lock and the rtln 152 * The @dev_base list is protected by @dev_base_lock and the rtnl
153 * semaphore. 153 * semaphore.
154 * 154 *
155 * Pure readers hold dev_base_lock for reading. 155 * Pure readers hold dev_base_lock for reading.
@@ -193,7 +193,7 @@ static inline struct hlist_head *dev_index_hash(int ifindex)
193 * Our notifier list 193 * Our notifier list
194 */ 194 */
195 195
196static BLOCKING_NOTIFIER_HEAD(netdev_chain); 196static RAW_NOTIFIER_HEAD(netdev_chain);
197 197
198/* 198/*
199 * Device drivers call our routines to queue packets here. We empty the 199 * Device drivers call our routines to queue packets here. We empty the
@@ -641,10 +641,12 @@ int dev_valid_name(const char *name)
641 * @name: name format string 641 * @name: name format string
642 * 642 *
643 * Passed a format string - eg "lt%d" it will try and find a suitable 643 * Passed a format string - eg "lt%d" it will try and find a suitable
644 * id. Not efficient for many devices, not called a lot. The caller 644 * id. It scans list of devices to build up a free map, then chooses
645 * must hold the dev_base or rtnl lock while allocating the name and 645 * the first empty slot. The caller must hold the dev_base or rtnl lock
646 * adding the device in order to avoid duplicates. Returns the number 646 * while allocating the name and adding the device in order to avoid
647 * of the unit assigned or a negative errno code. 647 * duplicates.
648 * Limited to bits_per_byte * page size devices (ie 32K on most platforms).
649 * Returns the number of the unit assigned or a negative errno code.
648 */ 650 */
649 651
650int dev_alloc_name(struct net_device *dev, const char *name) 652int dev_alloc_name(struct net_device *dev, const char *name)
@@ -736,7 +738,7 @@ int dev_change_name(struct net_device *dev, char *newname)
736 if (!err) { 738 if (!err) {
737 hlist_del(&dev->name_hlist); 739 hlist_del(&dev->name_hlist);
738 hlist_add_head(&dev->name_hlist, dev_name_hash(dev->name)); 740 hlist_add_head(&dev->name_hlist, dev_name_hash(dev->name));
739 blocking_notifier_call_chain(&netdev_chain, 741 raw_notifier_call_chain(&netdev_chain,
740 NETDEV_CHANGENAME, dev); 742 NETDEV_CHANGENAME, dev);
741 } 743 }
742 744
@@ -744,14 +746,14 @@ int dev_change_name(struct net_device *dev, char *newname)
744} 746}
745 747
746/** 748/**
747 * netdev_features_change - device changes fatures 749 * netdev_features_change - device changes features
748 * @dev: device to cause notification 750 * @dev: device to cause notification
749 * 751 *
750 * Called to indicate a device has changed features. 752 * Called to indicate a device has changed features.
751 */ 753 */
752void netdev_features_change(struct net_device *dev) 754void netdev_features_change(struct net_device *dev)
753{ 755{
754 blocking_notifier_call_chain(&netdev_chain, NETDEV_FEAT_CHANGE, dev); 756 raw_notifier_call_chain(&netdev_chain, NETDEV_FEAT_CHANGE, dev);
755} 757}
756EXPORT_SYMBOL(netdev_features_change); 758EXPORT_SYMBOL(netdev_features_change);
757 759
@@ -766,7 +768,7 @@ EXPORT_SYMBOL(netdev_features_change);
766void netdev_state_change(struct net_device *dev) 768void netdev_state_change(struct net_device *dev)
767{ 769{
768 if (dev->flags & IFF_UP) { 770 if (dev->flags & IFF_UP) {
769 blocking_notifier_call_chain(&netdev_chain, 771 raw_notifier_call_chain(&netdev_chain,
770 NETDEV_CHANGE, dev); 772 NETDEV_CHANGE, dev);
771 rtmsg_ifinfo(RTM_NEWLINK, dev, 0); 773 rtmsg_ifinfo(RTM_NEWLINK, dev, 0);
772 } 774 }
@@ -864,7 +866,7 @@ int dev_open(struct net_device *dev)
864 /* 866 /*
865 * ... and announce new interface. 867 * ... and announce new interface.
866 */ 868 */
867 blocking_notifier_call_chain(&netdev_chain, NETDEV_UP, dev); 869 raw_notifier_call_chain(&netdev_chain, NETDEV_UP, dev);
868 } 870 }
869 return ret; 871 return ret;
870} 872}
@@ -887,7 +889,7 @@ int dev_close(struct net_device *dev)
887 * Tell people we are going down, so that they can 889 * Tell people we are going down, so that they can
888 * prepare to death, when device is still operating. 890 * prepare to death, when device is still operating.
889 */ 891 */
890 blocking_notifier_call_chain(&netdev_chain, NETDEV_GOING_DOWN, dev); 892 raw_notifier_call_chain(&netdev_chain, NETDEV_GOING_DOWN, dev);
891 893
892 dev_deactivate(dev); 894 dev_deactivate(dev);
893 895
@@ -924,7 +926,7 @@ int dev_close(struct net_device *dev)
924 /* 926 /*
925 * Tell people we are down 927 * Tell people we are down
926 */ 928 */
927 blocking_notifier_call_chain(&netdev_chain, NETDEV_DOWN, dev); 929 raw_notifier_call_chain(&netdev_chain, NETDEV_DOWN, dev);
928 930
929 return 0; 931 return 0;
930} 932}
@@ -955,7 +957,7 @@ int register_netdevice_notifier(struct notifier_block *nb)
955 int err; 957 int err;
956 958
957 rtnl_lock(); 959 rtnl_lock();
958 err = blocking_notifier_chain_register(&netdev_chain, nb); 960 err = raw_notifier_chain_register(&netdev_chain, nb);
959 if (!err) { 961 if (!err) {
960 for (dev = dev_base; dev; dev = dev->next) { 962 for (dev = dev_base; dev; dev = dev->next) {
961 nb->notifier_call(nb, NETDEV_REGISTER, dev); 963 nb->notifier_call(nb, NETDEV_REGISTER, dev);
@@ -983,7 +985,7 @@ int unregister_netdevice_notifier(struct notifier_block *nb)
983 int err; 985 int err;
984 986
985 rtnl_lock(); 987 rtnl_lock();
986 err = blocking_notifier_chain_unregister(&netdev_chain, nb); 988 err = raw_notifier_chain_unregister(&netdev_chain, nb);
987 rtnl_unlock(); 989 rtnl_unlock();
988 return err; 990 return err;
989} 991}
@@ -994,12 +996,12 @@ int unregister_netdevice_notifier(struct notifier_block *nb)
994 * @v: pointer passed unmodified to notifier function 996 * @v: pointer passed unmodified to notifier function
995 * 997 *
996 * Call all network notifier blocks. Parameters and return value 998 * Call all network notifier blocks. Parameters and return value
997 * are as for blocking_notifier_call_chain(). 999 * are as for raw_notifier_call_chain().
998 */ 1000 */
999 1001
1000int call_netdevice_notifiers(unsigned long val, void *v) 1002int call_netdevice_notifiers(unsigned long val, void *v)
1001{ 1003{
1002 return blocking_notifier_call_chain(&netdev_chain, val, v); 1004 return raw_notifier_call_chain(&netdev_chain, val, v);
1003} 1005}
1004 1006
1005/* When > 0 there are consumers of rx skb time stamps */ 1007/* When > 0 there are consumers of rx skb time stamps */
@@ -2196,7 +2198,7 @@ int netdev_set_master(struct net_device *slave, struct net_device *master)
2196 * @dev: device 2198 * @dev: device
2197 * @inc: modifier 2199 * @inc: modifier
2198 * 2200 *
2199 * Add or remove promsicuity from a device. While the count in the device 2201 * Add or remove promiscuity from a device. While the count in the device
2200 * remains above zero the interface remains promiscuous. Once it hits zero 2202 * remains above zero the interface remains promiscuous. Once it hits zero
2201 * the device reverts back to normal filtering operation. A negative inc 2203 * the device reverts back to normal filtering operation. A negative inc
2202 * value is used to drop promiscuity on the device. 2204 * value is used to drop promiscuity on the device.
@@ -2308,7 +2310,7 @@ int dev_change_flags(struct net_device *dev, unsigned flags)
2308 if (dev->flags & IFF_UP && 2310 if (dev->flags & IFF_UP &&
2309 ((old_flags ^ dev->flags) &~ (IFF_UP | IFF_PROMISC | IFF_ALLMULTI | 2311 ((old_flags ^ dev->flags) &~ (IFF_UP | IFF_PROMISC | IFF_ALLMULTI |
2310 IFF_VOLATILE))) 2312 IFF_VOLATILE)))
2311 blocking_notifier_call_chain(&netdev_chain, 2313 raw_notifier_call_chain(&netdev_chain,
2312 NETDEV_CHANGE, dev); 2314 NETDEV_CHANGE, dev);
2313 2315
2314 if ((flags ^ dev->gflags) & IFF_PROMISC) { 2316 if ((flags ^ dev->gflags) & IFF_PROMISC) {
@@ -2353,7 +2355,7 @@ int dev_set_mtu(struct net_device *dev, int new_mtu)
2353 else 2355 else
2354 dev->mtu = new_mtu; 2356 dev->mtu = new_mtu;
2355 if (!err && dev->flags & IFF_UP) 2357 if (!err && dev->flags & IFF_UP)
2356 blocking_notifier_call_chain(&netdev_chain, 2358 raw_notifier_call_chain(&netdev_chain,
2357 NETDEV_CHANGEMTU, dev); 2359 NETDEV_CHANGEMTU, dev);
2358 return err; 2360 return err;
2359} 2361}
@@ -2370,7 +2372,7 @@ int dev_set_mac_address(struct net_device *dev, struct sockaddr *sa)
2370 return -ENODEV; 2372 return -ENODEV;
2371 err = dev->set_mac_address(dev, sa); 2373 err = dev->set_mac_address(dev, sa);
2372 if (!err) 2374 if (!err)
2373 blocking_notifier_call_chain(&netdev_chain, 2375 raw_notifier_call_chain(&netdev_chain,
2374 NETDEV_CHANGEADDR, dev); 2376 NETDEV_CHANGEADDR, dev);
2375 return err; 2377 return err;
2376} 2378}
@@ -2427,7 +2429,7 @@ static int dev_ifsioc(struct ifreq *ifr, unsigned int cmd)
2427 return -EINVAL; 2429 return -EINVAL;
2428 memcpy(dev->broadcast, ifr->ifr_hwaddr.sa_data, 2430 memcpy(dev->broadcast, ifr->ifr_hwaddr.sa_data,
2429 min(sizeof ifr->ifr_hwaddr.sa_data, (size_t) dev->addr_len)); 2431 min(sizeof ifr->ifr_hwaddr.sa_data, (size_t) dev->addr_len));
2430 blocking_notifier_call_chain(&netdev_chain, 2432 raw_notifier_call_chain(&netdev_chain,
2431 NETDEV_CHANGEADDR, dev); 2433 NETDEV_CHANGEADDR, dev);
2432 return 0; 2434 return 0;
2433 2435
@@ -2698,7 +2700,8 @@ int dev_ioctl(unsigned int cmd, void __user *arg)
2698 /* If command is `set a parameter', or 2700 /* If command is `set a parameter', or
2699 * `get the encoding parameters', check if 2701 * `get the encoding parameters', check if
2700 * the user has the right to do it */ 2702 * the user has the right to do it */
2701 if (IW_IS_SET(cmd) || cmd == SIOCGIWENCODE) { 2703 if (IW_IS_SET(cmd) || cmd == SIOCGIWENCODE
2704 || cmd == SIOCGIWENCODEEXT) {
2702 if (!capable(CAP_NET_ADMIN)) 2705 if (!capable(CAP_NET_ADMIN))
2703 return -EPERM; 2706 return -EPERM;
2704 } 2707 }
@@ -2776,6 +2779,8 @@ int register_netdevice(struct net_device *dev)
2776 BUG_ON(dev_boot_phase); 2779 BUG_ON(dev_boot_phase);
2777 ASSERT_RTNL(); 2780 ASSERT_RTNL();
2778 2781
2782 might_sleep();
2783
2779 /* When net_device's are persistent, this will be fatal. */ 2784 /* When net_device's are persistent, this will be fatal. */
2780 BUG_ON(dev->reg_state != NETREG_UNINITIALIZED); 2785 BUG_ON(dev->reg_state != NETREG_UNINITIALIZED);
2781 2786
@@ -2862,6 +2867,11 @@ int register_netdevice(struct net_device *dev)
2862 if (!dev->rebuild_header) 2867 if (!dev->rebuild_header)
2863 dev->rebuild_header = default_rebuild_header; 2868 dev->rebuild_header = default_rebuild_header;
2864 2869
2870 ret = netdev_register_sysfs(dev);
2871 if (ret)
2872 goto out_err;
2873 dev->reg_state = NETREG_REGISTERED;
2874
2865 /* 2875 /*
2866 * Default initial state at registry is that the 2876 * Default initial state at registry is that the
2867 * device is present. 2877 * device is present.
@@ -2877,14 +2887,11 @@ int register_netdevice(struct net_device *dev)
2877 hlist_add_head(&dev->name_hlist, head); 2887 hlist_add_head(&dev->name_hlist, head);
2878 hlist_add_head(&dev->index_hlist, dev_index_hash(dev->ifindex)); 2888 hlist_add_head(&dev->index_hlist, dev_index_hash(dev->ifindex));
2879 dev_hold(dev); 2889 dev_hold(dev);
2880 dev->reg_state = NETREG_REGISTERING;
2881 write_unlock_bh(&dev_base_lock); 2890 write_unlock_bh(&dev_base_lock);
2882 2891
2883 /* Notify protocols, that a new device appeared. */ 2892 /* Notify protocols, that a new device appeared. */
2884 blocking_notifier_call_chain(&netdev_chain, NETDEV_REGISTER, dev); 2893 raw_notifier_call_chain(&netdev_chain, NETDEV_REGISTER, dev);
2885 2894
2886 /* Finish registration after unlock */
2887 net_set_todo(dev);
2888 ret = 0; 2895 ret = 0;
2889 2896
2890out: 2897out:
@@ -2960,7 +2967,7 @@ static void netdev_wait_allrefs(struct net_device *dev)
2960 rtnl_lock(); 2967 rtnl_lock();
2961 2968
2962 /* Rebroadcast unregister notification */ 2969 /* Rebroadcast unregister notification */
2963 blocking_notifier_call_chain(&netdev_chain, 2970 raw_notifier_call_chain(&netdev_chain,
2964 NETDEV_UNREGISTER, dev); 2971 NETDEV_UNREGISTER, dev);
2965 2972
2966 if (test_bit(__LINK_STATE_LINKWATCH_PENDING, 2973 if (test_bit(__LINK_STATE_LINKWATCH_PENDING,
@@ -3007,7 +3014,7 @@ static void netdev_wait_allrefs(struct net_device *dev)
3007 * 3014 *
3008 * We are invoked by rtnl_unlock() after it drops the semaphore. 3015 * We are invoked by rtnl_unlock() after it drops the semaphore.
3009 * This allows us to deal with problems: 3016 * This allows us to deal with problems:
3010 * 1) We can create/delete sysfs objects which invoke hotplug 3017 * 1) We can delete sysfs objects which invoke hotplug
3011 * without deadlocking with linkwatch via keventd. 3018 * without deadlocking with linkwatch via keventd.
3012 * 2) Since we run with the RTNL semaphore not held, we can sleep 3019 * 2) Since we run with the RTNL semaphore not held, we can sleep
3013 * safely in order to wait for the netdev refcnt to drop to zero. 3020 * safely in order to wait for the netdev refcnt to drop to zero.
@@ -3016,8 +3023,6 @@ static DEFINE_MUTEX(net_todo_run_mutex);
3016void netdev_run_todo(void) 3023void netdev_run_todo(void)
3017{ 3024{
3018 struct list_head list = LIST_HEAD_INIT(list); 3025 struct list_head list = LIST_HEAD_INIT(list);
3019 int err;
3020
3021 3026
3022 /* Need to guard against multiple cpu's getting out of order. */ 3027 /* Need to guard against multiple cpu's getting out of order. */
3023 mutex_lock(&net_todo_run_mutex); 3028 mutex_lock(&net_todo_run_mutex);
@@ -3040,40 +3045,29 @@ void netdev_run_todo(void)
3040 = list_entry(list.next, struct net_device, todo_list); 3045 = list_entry(list.next, struct net_device, todo_list);
3041 list_del(&dev->todo_list); 3046 list_del(&dev->todo_list);
3042 3047
3043 switch(dev->reg_state) { 3048 if (unlikely(dev->reg_state != NETREG_UNREGISTERING)) {
3044 case NETREG_REGISTERING: 3049 printk(KERN_ERR "network todo '%s' but state %d\n",
3045 dev->reg_state = NETREG_REGISTERED; 3050 dev->name, dev->reg_state);
3046 err = netdev_register_sysfs(dev); 3051 dump_stack();
3047 if (err) 3052 continue;
3048 printk(KERN_ERR "%s: failed sysfs registration (%d)\n", 3053 }
3049 dev->name, err);
3050 break;
3051
3052 case NETREG_UNREGISTERING:
3053 netdev_unregister_sysfs(dev);
3054 dev->reg_state = NETREG_UNREGISTERED;
3055
3056 netdev_wait_allrefs(dev);
3057 3054
3058 /* paranoia */ 3055 netdev_unregister_sysfs(dev);
3059 BUG_ON(atomic_read(&dev->refcnt)); 3056 dev->reg_state = NETREG_UNREGISTERED;
3060 BUG_TRAP(!dev->ip_ptr);
3061 BUG_TRAP(!dev->ip6_ptr);
3062 BUG_TRAP(!dev->dn_ptr);
3063 3057
3058 netdev_wait_allrefs(dev);
3064 3059
3065 /* It must be the very last action, 3060 /* paranoia */
3066 * after this 'dev' may point to freed up memory. 3061 BUG_ON(atomic_read(&dev->refcnt));
3067 */ 3062 BUG_TRAP(!dev->ip_ptr);
3068 if (dev->destructor) 3063 BUG_TRAP(!dev->ip6_ptr);
3069 dev->destructor(dev); 3064 BUG_TRAP(!dev->dn_ptr);
3070 break;
3071 3065
3072 default: 3066 /* It must be the very last action,
3073 printk(KERN_ERR "network todo '%s' but state %d\n", 3067 * after this 'dev' may point to freed up memory.
3074 dev->name, dev->reg_state); 3068 */
3075 break; 3069 if (dev->destructor)
3076 } 3070 dev->destructor(dev);
3077 } 3071 }
3078 3072
3079out: 3073out:
@@ -3130,7 +3124,7 @@ EXPORT_SYMBOL(alloc_netdev);
3130void free_netdev(struct net_device *dev) 3124void free_netdev(struct net_device *dev)
3131{ 3125{
3132#ifdef CONFIG_SYSFS 3126#ifdef CONFIG_SYSFS
3133 /* Compatiablity with error handling in drivers */ 3127 /* Compatibility with error handling in drivers */
3134 if (dev->reg_state == NETREG_UNINITIALIZED) { 3128 if (dev->reg_state == NETREG_UNINITIALIZED) {
3135 kfree((char *)dev - dev->padded); 3129 kfree((char *)dev - dev->padded);
3136 return; 3130 return;
@@ -3215,7 +3209,7 @@ int unregister_netdevice(struct net_device *dev)
3215 /* Notify protocols, that we are about to destroy 3209 /* Notify protocols, that we are about to destroy
3216 this device. They should clean all the things. 3210 this device. They should clean all the things.
3217 */ 3211 */
3218 blocking_notifier_call_chain(&netdev_chain, NETDEV_UNREGISTER, dev); 3212 raw_notifier_call_chain(&netdev_chain, NETDEV_UNREGISTER, dev);
3219 3213
3220 /* 3214 /*
3221 * Flush the multicast chain 3215 * Flush the multicast chain
diff --git a/net/core/filter.c b/net/core/filter.c
index 93fbd01d2259..5b4486a60cf6 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -34,6 +34,7 @@
34#include <linux/timer.h> 34#include <linux/timer.h>
35#include <asm/system.h> 35#include <asm/system.h>
36#include <asm/uaccess.h> 36#include <asm/uaccess.h>
37#include <asm/unaligned.h>
37#include <linux/filter.h> 38#include <linux/filter.h>
38 39
39/* No hurry in this branch */ 40/* No hurry in this branch */
@@ -177,7 +178,7 @@ unsigned int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int
177load_w: 178load_w:
178 ptr = load_pointer(skb, k, 4, &tmp); 179 ptr = load_pointer(skb, k, 4, &tmp);
179 if (ptr != NULL) { 180 if (ptr != NULL) {
180 A = ntohl(*(u32 *)ptr); 181 A = ntohl(get_unaligned((u32 *)ptr));
181 continue; 182 continue;
182 } 183 }
183 break; 184 break;
@@ -186,7 +187,7 @@ load_w:
186load_h: 187load_h:
187 ptr = load_pointer(skb, k, 2, &tmp); 188 ptr = load_pointer(skb, k, 2, &tmp);
188 if (ptr != NULL) { 189 if (ptr != NULL) {
189 A = ntohs(*(u16 *)ptr); 190 A = ntohs(get_unaligned((u16 *)ptr));
190 continue; 191 continue;
191 } 192 }
192 break; 193 break;
diff --git a/net/core/link_watch.c b/net/core/link_watch.c
index 341de44c7ed1..646937cc2d84 100644
--- a/net/core/link_watch.c
+++ b/net/core/link_watch.c
@@ -170,13 +170,13 @@ void linkwatch_fire_event(struct net_device *dev)
170 spin_unlock_irqrestore(&lweventlist_lock, flags); 170 spin_unlock_irqrestore(&lweventlist_lock, flags);
171 171
172 if (!test_and_set_bit(LW_RUNNING, &linkwatch_flags)) { 172 if (!test_and_set_bit(LW_RUNNING, &linkwatch_flags)) {
173 unsigned long thisevent = jiffies; 173 unsigned long delay = linkwatch_nextevent - jiffies;
174 174
175 if (thisevent >= linkwatch_nextevent) { 175 /* If we wrap around we'll delay it by at most HZ. */
176 if (!delay || delay > HZ)
176 schedule_work(&linkwatch_work); 177 schedule_work(&linkwatch_work);
177 } else { 178 else
178 schedule_delayed_work(&linkwatch_work, linkwatch_nextevent - thisevent); 179 schedule_delayed_work(&linkwatch_work, delay);
179 }
180 } 180 }
181 } 181 }
182} 182}
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 4cf878efdb49..50a8c73caf97 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -1326,8 +1326,7 @@ void neigh_parms_destroy(struct neigh_parms *parms)
1326 kfree(parms); 1326 kfree(parms);
1327} 1327}
1328 1328
1329 1329void neigh_table_init_no_netlink(struct neigh_table *tbl)
1330void neigh_table_init(struct neigh_table *tbl)
1331{ 1330{
1332 unsigned long now = jiffies; 1331 unsigned long now = jiffies;
1333 unsigned long phsize; 1332 unsigned long phsize;
@@ -1383,10 +1382,27 @@ void neigh_table_init(struct neigh_table *tbl)
1383 1382
1384 tbl->last_flush = now; 1383 tbl->last_flush = now;
1385 tbl->last_rand = now + tbl->parms.reachable_time * 20; 1384 tbl->last_rand = now + tbl->parms.reachable_time * 20;
1385}
1386
1387void neigh_table_init(struct neigh_table *tbl)
1388{
1389 struct neigh_table *tmp;
1390
1391 neigh_table_init_no_netlink(tbl);
1386 write_lock(&neigh_tbl_lock); 1392 write_lock(&neigh_tbl_lock);
1393 for (tmp = neigh_tables; tmp; tmp = tmp->next) {
1394 if (tmp->family == tbl->family)
1395 break;
1396 }
1387 tbl->next = neigh_tables; 1397 tbl->next = neigh_tables;
1388 neigh_tables = tbl; 1398 neigh_tables = tbl;
1389 write_unlock(&neigh_tbl_lock); 1399 write_unlock(&neigh_tbl_lock);
1400
1401 if (unlikely(tmp)) {
1402 printk(KERN_ERR "NEIGH: Registering multiple tables for "
1403 "family %d\n", tbl->family);
1404 dump_stack();
1405 }
1390} 1406}
1391 1407
1392int neigh_table_clear(struct neigh_table *tbl) 1408int neigh_table_clear(struct neigh_table *tbl)
@@ -2657,6 +2673,7 @@ EXPORT_SYMBOL(neigh_rand_reach_time);
2657EXPORT_SYMBOL(neigh_resolve_output); 2673EXPORT_SYMBOL(neigh_resolve_output);
2658EXPORT_SYMBOL(neigh_table_clear); 2674EXPORT_SYMBOL(neigh_table_clear);
2659EXPORT_SYMBOL(neigh_table_init); 2675EXPORT_SYMBOL(neigh_table_init);
2676EXPORT_SYMBOL(neigh_table_init_no_netlink);
2660EXPORT_SYMBOL(neigh_update); 2677EXPORT_SYMBOL(neigh_update);
2661EXPORT_SYMBOL(neigh_update_hhs); 2678EXPORT_SYMBOL(neigh_update_hhs);
2662EXPORT_SYMBOL(pneigh_enqueue); 2679EXPORT_SYMBOL(pneigh_enqueue);
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index c12990c9c603..47a6fceb6771 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -29,7 +29,7 @@ static const char fmt_ulong[] = "%lu\n";
29 29
30static inline int dev_isalive(const struct net_device *dev) 30static inline int dev_isalive(const struct net_device *dev)
31{ 31{
32 return dev->reg_state == NETREG_REGISTERED; 32 return dev->reg_state <= NETREG_REGISTERED;
33} 33}
34 34
35/* use same locking rules as GIF* ioctl's */ 35/* use same locking rules as GIF* ioctl's */
@@ -445,58 +445,33 @@ static struct class net_class = {
445 445
446void netdev_unregister_sysfs(struct net_device * net) 446void netdev_unregister_sysfs(struct net_device * net)
447{ 447{
448 struct class_device * class_dev = &(net->class_dev); 448 class_device_del(&(net->class_dev));
449
450 if (net->get_stats)
451 sysfs_remove_group(&class_dev->kobj, &netstat_group);
452
453#ifdef WIRELESS_EXT
454 if (net->get_wireless_stats || (net->wireless_handlers &&
455 net->wireless_handlers->get_wireless_stats))
456 sysfs_remove_group(&class_dev->kobj, &wireless_group);
457#endif
458 class_device_del(class_dev);
459
460} 449}
461 450
462/* Create sysfs entries for network device. */ 451/* Create sysfs entries for network device. */
463int netdev_register_sysfs(struct net_device *net) 452int netdev_register_sysfs(struct net_device *net)
464{ 453{
465 struct class_device *class_dev = &(net->class_dev); 454 struct class_device *class_dev = &(net->class_dev);
466 int ret; 455 struct attribute_group **groups = net->sysfs_groups;
467 456
457 class_device_initialize(class_dev);
468 class_dev->class = &net_class; 458 class_dev->class = &net_class;
469 class_dev->class_data = net; 459 class_dev->class_data = net;
460 class_dev->groups = groups;
470 461
462 BUILD_BUG_ON(BUS_ID_SIZE < IFNAMSIZ);
471 strlcpy(class_dev->class_id, net->name, BUS_ID_SIZE); 463 strlcpy(class_dev->class_id, net->name, BUS_ID_SIZE);
472 if ((ret = class_device_register(class_dev)))
473 goto out;
474 464
475 if (net->get_stats && 465 if (net->get_stats)
476 (ret = sysfs_create_group(&class_dev->kobj, &netstat_group))) 466 *groups++ = &netstat_group;
477 goto out_unreg;
478 467
479#ifdef WIRELESS_EXT 468#ifdef WIRELESS_EXT
480 if (net->get_wireless_stats || (net->wireless_handlers && 469 if (net->get_wireless_stats
481 net->wireless_handlers->get_wireless_stats)) { 470 || (net->wireless_handlers && net->wireless_handlers->get_wireless_stats))
482 ret = sysfs_create_group(&class_dev->kobj, &wireless_group); 471 *groups++ = &wireless_group;
483 if (ret)
484 goto out_cleanup;
485 }
486 return 0;
487out_cleanup:
488 if (net->get_stats)
489 sysfs_remove_group(&class_dev->kobj, &netstat_group);
490#else
491 return 0;
492#endif 472#endif
493 473
494out_unreg: 474 return class_device_add(class_dev);
495 printk(KERN_WARNING "%s: sysfs attribute registration failed %d\n",
496 net->name, ret);
497 class_device_unregister(class_dev);
498out:
499 return ret;
500} 475}
501 476
502int netdev_sysfs_init(void) 477int netdev_sysfs_init(void)
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 09464fa8d72f..fb3770f9c094 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -112,6 +112,14 @@ void skb_under_panic(struct sk_buff *skb, int sz, void *here)
112 BUG(); 112 BUG();
113} 113}
114 114
115void skb_truesize_bug(struct sk_buff *skb)
116{
117 printk(KERN_ERR "SKB BUG: Invalid truesize (%u) "
118 "len=%u, sizeof(sk_buff)=%Zd\n",
119 skb->truesize, skb->len, sizeof(struct sk_buff));
120}
121EXPORT_SYMBOL(skb_truesize_bug);
122
115/* Allocate a new skbuff. We do this ourselves so we can fill in a few 123/* Allocate a new skbuff. We do this ourselves so we can fill in a few
116 * 'private' fields and also do memory statistics to find all the 124 * 'private' fields and also do memory statistics to find all the
117 * [BEEP] leaks. 125 * [BEEP] leaks.
diff --git a/net/core/stream.c b/net/core/stream.c
index 35e25259fd95..e9489696f694 100644
--- a/net/core/stream.c
+++ b/net/core/stream.c
@@ -176,6 +176,7 @@ void sk_stream_rfree(struct sk_buff *skb)
176{ 176{
177 struct sock *sk = skb->sk; 177 struct sock *sk = skb->sk;
178 178
179 skb_truesize_check(skb);
179 atomic_sub(skb->truesize, &sk->sk_rmem_alloc); 180 atomic_sub(skb->truesize, &sk->sk_rmem_alloc);
180 sk->sk_forward_alloc += skb->truesize; 181 sk->sk_forward_alloc += skb->truesize;
181} 182}
diff --git a/net/core/wireless.c b/net/core/wireless.c
index 81d6995fcfdb..d2bc72d318f7 100644
--- a/net/core/wireless.c
+++ b/net/core/wireless.c
@@ -1726,6 +1726,14 @@ int wireless_rtnetlink_get(struct net_device * dev,
1726 if(!IW_IS_GET(request->cmd)) 1726 if(!IW_IS_GET(request->cmd))
1727 return -EOPNOTSUPP; 1727 return -EOPNOTSUPP;
1728 1728
1729 /* If command is `get the encoding parameters', check if
1730 * the user has the right to do it */
1731 if (request->cmd == SIOCGIWENCODE ||
1732 request->cmd == SIOCGIWENCODEEXT) {
1733 if (!capable(CAP_NET_ADMIN))
1734 return -EPERM;
1735 }
1736
1729 /* Special cases */ 1737 /* Special cases */
1730 if(request->cmd == SIOCGIWSTATS) 1738 if(request->cmd == SIOCGIWSTATS)
1731 /* Get Wireless Stats */ 1739 /* Get Wireless Stats */
diff --git a/net/dccp/proto.c b/net/dccp/proto.c
index 1ff7328b0e17..2e0ee8355c41 100644
--- a/net/dccp/proto.c
+++ b/net/dccp/proto.c
@@ -848,6 +848,7 @@ static int dccp_close_state(struct sock *sk)
848void dccp_close(struct sock *sk, long timeout) 848void dccp_close(struct sock *sk, long timeout)
849{ 849{
850 struct sk_buff *skb; 850 struct sk_buff *skb;
851 int state;
851 852
852 lock_sock(sk); 853 lock_sock(sk);
853 854
@@ -882,6 +883,11 @@ void dccp_close(struct sock *sk, long timeout)
882 sk_stream_wait_close(sk, timeout); 883 sk_stream_wait_close(sk, timeout);
883 884
884adjudge_to_death: 885adjudge_to_death:
886 state = sk->sk_state;
887 sock_hold(sk);
888 sock_orphan(sk);
889 atomic_inc(sk->sk_prot->orphan_count);
890
885 /* 891 /*
886 * It is the last release_sock in its life. It will remove backlog. 892 * It is the last release_sock in its life. It will remove backlog.
887 */ 893 */
@@ -894,8 +900,9 @@ adjudge_to_death:
894 bh_lock_sock(sk); 900 bh_lock_sock(sk);
895 BUG_TRAP(!sock_owned_by_user(sk)); 901 BUG_TRAP(!sock_owned_by_user(sk));
896 902
897 sock_hold(sk); 903 /* Have we already been destroyed by a softirq or backlog? */
898 sock_orphan(sk); 904 if (state != DCCP_CLOSED && sk->sk_state == DCCP_CLOSED)
905 goto out;
899 906
900 /* 907 /*
901 * The last release_sock may have processed the CLOSE or RESET 908 * The last release_sock may have processed the CLOSE or RESET
@@ -915,12 +922,12 @@ adjudge_to_death:
915#endif 922#endif
916 } 923 }
917 924
918 atomic_inc(sk->sk_prot->orphan_count);
919 if (sk->sk_state == DCCP_CLOSED) 925 if (sk->sk_state == DCCP_CLOSED)
920 inet_csk_destroy_sock(sk); 926 inet_csk_destroy_sock(sk);
921 927
922 /* Otherwise, socket is reprieved until protocol close. */ 928 /* Otherwise, socket is reprieved until protocol close. */
923 929
930out:
924 bh_unlock_sock(sk); 931 bh_unlock_sock(sk);
925 local_bh_enable(); 932 local_bh_enable();
926 sock_put(sk); 933 sock_put(sk);
diff --git a/net/decnet/dn_neigh.c b/net/decnet/dn_neigh.c
index 7c8692c26bfe..66e230c3b328 100644
--- a/net/decnet/dn_neigh.c
+++ b/net/decnet/dn_neigh.c
@@ -493,7 +493,6 @@ struct elist_cb_state {
493static void neigh_elist_cb(struct neighbour *neigh, void *_info) 493static void neigh_elist_cb(struct neighbour *neigh, void *_info)
494{ 494{
495 struct elist_cb_state *s = _info; 495 struct elist_cb_state *s = _info;
496 struct dn_dev *dn_db;
497 struct dn_neigh *dn; 496 struct dn_neigh *dn;
498 497
499 if (neigh->dev != s->dev) 498 if (neigh->dev != s->dev)
@@ -503,10 +502,6 @@ static void neigh_elist_cb(struct neighbour *neigh, void *_info)
503 if (!(dn->flags & (DN_NDFLAG_R1|DN_NDFLAG_R2))) 502 if (!(dn->flags & (DN_NDFLAG_R1|DN_NDFLAG_R2)))
504 return; 503 return;
505 504
506 dn_db = (struct dn_dev *) s->dev->dn_ptr;
507 if (dn_db->parms.forwarding == 1 && (dn->flags & DN_NDFLAG_R2))
508 return;
509
510 if (s->t == s->n) 505 if (s->t == s->n)
511 s->rs = dn_find_slot(s->ptr, s->n, dn->priority); 506 s->rs = dn_find_slot(s->ptr, s->n, dn->priority);
512 else 507 else
diff --git a/net/ethernet/Makefile b/net/ethernet/Makefile
index 69b74a9a0fc3..7cef1d8ace27 100644
--- a/net/ethernet/Makefile
+++ b/net/ethernet/Makefile
@@ -3,6 +3,5 @@
3# 3#
4 4
5obj-y += eth.o 5obj-y += eth.o
6obj-$(CONFIG_SYSCTL) += sysctl_net_ether.o
7obj-$(subst m,y,$(CONFIG_IPX)) += pe2.o 6obj-$(subst m,y,$(CONFIG_IPX)) += pe2.o
8obj-$(subst m,y,$(CONFIG_ATALK)) += pe2.o 7obj-$(subst m,y,$(CONFIG_ATALK)) += pe2.o
diff --git a/net/ethernet/sysctl_net_ether.c b/net/ethernet/sysctl_net_ether.c
deleted file mode 100644
index 66b39fc342d2..000000000000
--- a/net/ethernet/sysctl_net_ether.c
+++ /dev/null
@@ -1,14 +0,0 @@
1/* -*- linux-c -*-
2 * sysctl_net_ether.c: sysctl interface to net Ethernet subsystem.
3 *
4 * Begun April 1, 1996, Mike Shaver.
5 * Added /proc/sys/net/ether directory entry (empty =) ). [MS]
6 */
7
8#include <linux/mm.h>
9#include <linux/sysctl.h>
10#include <linux/if_ether.h>
11
12ctl_table ether_table[] = {
13 {0}
14};
diff --git a/net/ieee80211/softmac/Kconfig b/net/ieee80211/softmac/Kconfig
index 6cd9f3427be6..f2a27cc6ecb1 100644
--- a/net/ieee80211/softmac/Kconfig
+++ b/net/ieee80211/softmac/Kconfig
@@ -1,6 +1,7 @@
1config IEEE80211_SOFTMAC 1config IEEE80211_SOFTMAC
2 tristate "Software MAC add-on to the IEEE 802.11 networking stack" 2 tristate "Software MAC add-on to the IEEE 802.11 networking stack"
3 depends on IEEE80211 && EXPERIMENTAL 3 depends on IEEE80211 && EXPERIMENTAL
4 select WIRELESS_EXT
4 ---help--- 5 ---help---
5 This option enables the hardware independent software MAC addon 6 This option enables the hardware independent software MAC addon
6 for the IEEE 802.11 networking stack. 7 for the IEEE 802.11 networking stack.
diff --git a/net/ieee80211/softmac/ieee80211softmac_assoc.c b/net/ieee80211/softmac/ieee80211softmac_assoc.c
index be61de78dfa4..57ea9f6f465c 100644
--- a/net/ieee80211/softmac/ieee80211softmac_assoc.c
+++ b/net/ieee80211/softmac/ieee80211softmac_assoc.c
@@ -51,11 +51,12 @@ ieee80211softmac_assoc(struct ieee80211softmac_device *mac, struct ieee80211soft
51 spin_lock_irqsave(&mac->lock, flags); 51 spin_lock_irqsave(&mac->lock, flags);
52 mac->associnfo.associating = 1; 52 mac->associnfo.associating = 1;
53 mac->associated = 0; /* just to make sure */ 53 mac->associated = 0; /* just to make sure */
54 spin_unlock_irqrestore(&mac->lock, flags);
55 54
56 /* Set a timer for timeout */ 55 /* Set a timer for timeout */
57 /* FIXME: make timeout configurable */ 56 /* FIXME: make timeout configurable */
58 schedule_delayed_work(&mac->associnfo.timeout, 5 * HZ); 57 if (likely(mac->running))
58 schedule_delayed_work(&mac->associnfo.timeout, 5 * HZ);
59 spin_unlock_irqrestore(&mac->lock, flags);
59} 60}
60 61
61void 62void
@@ -101,6 +102,7 @@ ieee80211softmac_disassoc(struct ieee80211softmac_device *mac, u16 reason)
101 /* Do NOT clear bssvalid as that will break ieee80211softmac_assoc_work! */ 102 /* Do NOT clear bssvalid as that will break ieee80211softmac_assoc_work! */
102 mac->associated = 0; 103 mac->associated = 0;
103 mac->associnfo.associating = 0; 104 mac->associnfo.associating = 0;
105 ieee80211softmac_call_events_locked(mac, IEEE80211SOFTMAC_EVENT_DISASSOCIATED, NULL);
104 spin_unlock_irqrestore(&mac->lock, flags); 106 spin_unlock_irqrestore(&mac->lock, flags);
105} 107}
106 108
@@ -143,6 +145,12 @@ network_matches_request(struct ieee80211softmac_device *mac, struct ieee80211_ne
143 if (!we_support_all_basic_rates(mac, net->rates_ex, net->rates_ex_len)) 145 if (!we_support_all_basic_rates(mac, net->rates_ex, net->rates_ex_len))
144 return 0; 146 return 0;
145 147
148 /* assume that users know what they're doing ...
149 * (note we don't let them select a net we're incompatible with) */
150 if (mac->associnfo.bssfixed) {
151 return !memcmp(mac->associnfo.bssid, net->bssid, ETH_ALEN);
152 }
153
146 /* if 'ANY' network requested, take any that doesn't have privacy enabled */ 154 /* if 'ANY' network requested, take any that doesn't have privacy enabled */
147 if (mac->associnfo.req_essid.len == 0 155 if (mac->associnfo.req_essid.len == 0
148 && !(net->capability & WLAN_CAPABILITY_PRIVACY)) 156 && !(net->capability & WLAN_CAPABILITY_PRIVACY))
@@ -175,7 +183,7 @@ ieee80211softmac_assoc_work(void *d)
175 ieee80211softmac_disassoc(mac, WLAN_REASON_DISASSOC_STA_HAS_LEFT); 183 ieee80211softmac_disassoc(mac, WLAN_REASON_DISASSOC_STA_HAS_LEFT);
176 184
177 /* try to find the requested network in our list, if we found one already */ 185 /* try to find the requested network in our list, if we found one already */
178 if (mac->associnfo.bssvalid) 186 if (mac->associnfo.bssvalid || mac->associnfo.bssfixed)
179 found = ieee80211softmac_get_network_by_bssid(mac, mac->associnfo.bssid); 187 found = ieee80211softmac_get_network_by_bssid(mac, mac->associnfo.bssid);
180 188
181 /* Search the ieee80211 networks for this network if we didn't find it by bssid, 189 /* Search the ieee80211 networks for this network if we didn't find it by bssid,
@@ -240,19 +248,25 @@ ieee80211softmac_assoc_work(void *d)
240 if (ieee80211softmac_start_scan(mac)) 248 if (ieee80211softmac_start_scan(mac))
241 dprintk(KERN_INFO PFX "Associate: failed to initiate scan. Is device up?\n"); 249 dprintk(KERN_INFO PFX "Associate: failed to initiate scan. Is device up?\n");
242 return; 250 return;
243 } 251 } else {
244 else {
245 spin_lock_irqsave(&mac->lock, flags); 252 spin_lock_irqsave(&mac->lock, flags);
246 mac->associnfo.associating = 0; 253 mac->associnfo.associating = 0;
247 mac->associated = 0; 254 mac->associated = 0;
248 spin_unlock_irqrestore(&mac->lock, flags); 255 spin_unlock_irqrestore(&mac->lock, flags);
249 256
250 dprintk(KERN_INFO PFX "Unable to find matching network after scan!\n"); 257 dprintk(KERN_INFO PFX "Unable to find matching network after scan!\n");
258 /* reset the retry counter for the next user request since we
259 * break out and don't reschedule ourselves after this point. */
260 mac->associnfo.scan_retry = IEEE80211SOFTMAC_ASSOC_SCAN_RETRY_LIMIT;
251 ieee80211softmac_call_events(mac, IEEE80211SOFTMAC_EVENT_ASSOCIATE_NET_NOT_FOUND, NULL); 261 ieee80211softmac_call_events(mac, IEEE80211SOFTMAC_EVENT_ASSOCIATE_NET_NOT_FOUND, NULL);
252 return; 262 return;
253 } 263 }
254 } 264 }
255 265
266 /* reset the retry counter for the next user request since we
267 * now found a net and will try to associate to it, but not
268 * schedule this function again. */
269 mac->associnfo.scan_retry = IEEE80211SOFTMAC_ASSOC_SCAN_RETRY_LIMIT;
256 mac->associnfo.bssvalid = 1; 270 mac->associnfo.bssvalid = 1;
257 memcpy(mac->associnfo.bssid, found->bssid, ETH_ALEN); 271 memcpy(mac->associnfo.bssid, found->bssid, ETH_ALEN);
258 /* copy the ESSID for displaying it */ 272 /* copy the ESSID for displaying it */
@@ -306,6 +320,9 @@ ieee80211softmac_handle_assoc_response(struct net_device * dev,
306 u16 status = le16_to_cpup(&resp->status); 320 u16 status = le16_to_cpup(&resp->status);
307 struct ieee80211softmac_network *network = NULL; 321 struct ieee80211softmac_network *network = NULL;
308 unsigned long flags; 322 unsigned long flags;
323
324 if (unlikely(!mac->running))
325 return -ENODEV;
309 326
310 spin_lock_irqsave(&mac->lock, flags); 327 spin_lock_irqsave(&mac->lock, flags);
311 328
@@ -364,15 +381,22 @@ ieee80211softmac_handle_disassoc(struct net_device * dev,
364{ 381{
365 struct ieee80211softmac_device *mac = ieee80211_priv(dev); 382 struct ieee80211softmac_device *mac = ieee80211_priv(dev);
366 unsigned long flags; 383 unsigned long flags;
384
385 if (unlikely(!mac->running))
386 return -ENODEV;
387
367 if (memcmp(disassoc->header.addr2, mac->associnfo.bssid, ETH_ALEN)) 388 if (memcmp(disassoc->header.addr2, mac->associnfo.bssid, ETH_ALEN))
368 return 0; 389 return 0;
390
369 if (memcmp(disassoc->header.addr1, mac->dev->dev_addr, ETH_ALEN)) 391 if (memcmp(disassoc->header.addr1, mac->dev->dev_addr, ETH_ALEN))
370 return 0; 392 return 0;
393
371 dprintk(KERN_INFO PFX "got disassoc frame\n"); 394 dprintk(KERN_INFO PFX "got disassoc frame\n");
372 netif_carrier_off(dev); 395 netif_carrier_off(dev);
373 spin_lock_irqsave(&mac->lock, flags); 396 spin_lock_irqsave(&mac->lock, flags);
374 mac->associnfo.bssvalid = 0; 397 mac->associnfo.bssvalid = 0;
375 mac->associated = 0; 398 mac->associated = 0;
399 ieee80211softmac_call_events_locked(mac, IEEE80211SOFTMAC_EVENT_DISASSOCIATED, NULL);
376 schedule_work(&mac->associnfo.work); 400 schedule_work(&mac->associnfo.work);
377 spin_unlock_irqrestore(&mac->lock, flags); 401 spin_unlock_irqrestore(&mac->lock, flags);
378 402
@@ -386,11 +410,15 @@ ieee80211softmac_handle_reassoc_req(struct net_device * dev,
386 struct ieee80211softmac_device *mac = ieee80211_priv(dev); 410 struct ieee80211softmac_device *mac = ieee80211_priv(dev);
387 struct ieee80211softmac_network *network; 411 struct ieee80211softmac_network *network;
388 412
413 if (unlikely(!mac->running))
414 return -ENODEV;
415
389 network = ieee80211softmac_get_network_by_bssid(mac, resp->header.addr3); 416 network = ieee80211softmac_get_network_by_bssid(mac, resp->header.addr3);
390 if (!network) { 417 if (!network) {
391 dprintkl(KERN_INFO PFX "reassoc request from unknown network\n"); 418 dprintkl(KERN_INFO PFX "reassoc request from unknown network\n");
392 return 0; 419 return 0;
393 } 420 }
394 ieee80211softmac_assoc(mac, network); 421 schedule_work(&mac->associnfo.work);
422
395 return 0; 423 return 0;
396} 424}
diff --git a/net/ieee80211/softmac/ieee80211softmac_auth.c b/net/ieee80211/softmac/ieee80211softmac_auth.c
index 9a0eac6c61eb..06e332624665 100644
--- a/net/ieee80211/softmac/ieee80211softmac_auth.c
+++ b/net/ieee80211/softmac/ieee80211softmac_auth.c
@@ -86,6 +86,11 @@ ieee80211softmac_auth_queue(void *data)
86 86
87 /* Lock and set flags */ 87 /* Lock and set flags */
88 spin_lock_irqsave(&mac->lock, flags); 88 spin_lock_irqsave(&mac->lock, flags);
89 if (unlikely(!mac->running)) {
90 /* Prevent reschedule on workqueue flush */
91 spin_unlock_irqrestore(&mac->lock, flags);
92 return;
93 }
89 net->authenticated = 0; 94 net->authenticated = 0;
90 net->authenticating = 1; 95 net->authenticating = 1;
91 /* add a timeout call so we eventually give up waiting for an auth reply */ 96 /* add a timeout call so we eventually give up waiting for an auth reply */
@@ -124,6 +129,9 @@ ieee80211softmac_auth_resp(struct net_device *dev, struct ieee80211_auth *auth)
124 unsigned long flags; 129 unsigned long flags;
125 u8 * data; 130 u8 * data;
126 131
132 if (unlikely(!mac->running))
133 return -ENODEV;
134
127 /* Find correct auth queue item */ 135 /* Find correct auth queue item */
128 spin_lock_irqsave(&mac->lock, flags); 136 spin_lock_irqsave(&mac->lock, flags);
129 list_for_each(list_ptr, &mac->auth_queue) { 137 list_for_each(list_ptr, &mac->auth_queue) {
@@ -298,8 +306,6 @@ ieee80211softmac_deauth_from_net(struct ieee80211softmac_device *mac,
298 306
299 /* can't transmit data right now... */ 307 /* can't transmit data right now... */
300 netif_carrier_off(mac->dev); 308 netif_carrier_off(mac->dev);
301 /* let's try to re-associate */
302 schedule_work(&mac->associnfo.work);
303 spin_unlock_irqrestore(&mac->lock, flags); 309 spin_unlock_irqrestore(&mac->lock, flags);
304} 310}
305 311
@@ -338,6 +344,9 @@ ieee80211softmac_deauth_resp(struct net_device *dev, struct ieee80211_deauth *de
338 struct ieee80211softmac_network *net = NULL; 344 struct ieee80211softmac_network *net = NULL;
339 struct ieee80211softmac_device *mac = ieee80211_priv(dev); 345 struct ieee80211softmac_device *mac = ieee80211_priv(dev);
340 346
347 if (unlikely(!mac->running))
348 return -ENODEV;
349
341 if (!deauth) { 350 if (!deauth) {
342 dprintk("deauth without deauth packet. eek!\n"); 351 dprintk("deauth without deauth packet. eek!\n");
343 return 0; 352 return 0;
@@ -360,5 +369,8 @@ ieee80211softmac_deauth_resp(struct net_device *dev, struct ieee80211_deauth *de
360 } 369 }
361 370
362 ieee80211softmac_deauth_from_net(mac, net); 371 ieee80211softmac_deauth_from_net(mac, net);
372
373 /* let's try to re-associate */
374 schedule_work(&mac->associnfo.work);
363 return 0; 375 return 0;
364} 376}
diff --git a/net/ieee80211/softmac/ieee80211softmac_event.c b/net/ieee80211/softmac/ieee80211softmac_event.c
index 0a52bbda1e4c..8cc8f3f0f8e7 100644
--- a/net/ieee80211/softmac/ieee80211softmac_event.c
+++ b/net/ieee80211/softmac/ieee80211softmac_event.c
@@ -67,6 +67,7 @@ static char *event_descriptions[IEEE80211SOFTMAC_EVENT_LAST+1] = {
67 "authenticating failed", 67 "authenticating failed",
68 "authenticating timed out", 68 "authenticating timed out",
69 "associating failed because no suitable network was found", 69 "associating failed because no suitable network was found",
70 "disassociated",
70}; 71};
71 72
72 73
@@ -128,13 +129,42 @@ void
128ieee80211softmac_call_events_locked(struct ieee80211softmac_device *mac, int event, void *event_ctx) 129ieee80211softmac_call_events_locked(struct ieee80211softmac_device *mac, int event, void *event_ctx)
129{ 130{
130 struct ieee80211softmac_event *eventptr, *tmp; 131 struct ieee80211softmac_event *eventptr, *tmp;
131 union iwreq_data wrqu; 132 struct ieee80211softmac_network *network;
132 char *msg;
133 133
134 if (event >= 0) { 134 if (event >= 0) {
135 msg = event_descriptions[event]; 135 union iwreq_data wrqu;
136 wrqu.data.length = strlen(msg); 136 int we_event;
137 wireless_send_event(mac->dev, IWEVCUSTOM, &wrqu, msg); 137 char *msg = NULL;
138
139 switch(event) {
140 case IEEE80211SOFTMAC_EVENT_ASSOCIATED:
141 network = (struct ieee80211softmac_network *)event_ctx;
142 wrqu.data.length = 0;
143 wrqu.data.flags = 0;
144 memcpy(wrqu.ap_addr.sa_data, &network->bssid[0], ETH_ALEN);
145 wrqu.ap_addr.sa_family = ARPHRD_ETHER;
146 we_event = SIOCGIWAP;
147 break;
148 case IEEE80211SOFTMAC_EVENT_DISASSOCIATED:
149 wrqu.data.length = 0;
150 wrqu.data.flags = 0;
151 memset(&wrqu, '\0', sizeof (union iwreq_data));
152 wrqu.ap_addr.sa_family = ARPHRD_ETHER;
153 we_event = SIOCGIWAP;
154 break;
155 case IEEE80211SOFTMAC_EVENT_SCAN_FINISHED:
156 wrqu.data.length = 0;
157 wrqu.data.flags = 0;
158 memset(&wrqu, '\0', sizeof (union iwreq_data));
159 we_event = SIOCGIWSCAN;
160 break;
161 default:
162 msg = event_descriptions[event];
163 wrqu.data.length = strlen(msg);
164 we_event = IWEVCUSTOM;
165 break;
166 }
167 wireless_send_event(mac->dev, we_event, &wrqu, msg);
138 } 168 }
139 169
140 if (!list_empty(&mac->events)) 170 if (!list_empty(&mac->events))
diff --git a/net/ieee80211/softmac/ieee80211softmac_io.c b/net/ieee80211/softmac/ieee80211softmac_io.c
index febc51dbb412..cc6cd56c85b1 100644
--- a/net/ieee80211/softmac/ieee80211softmac_io.c
+++ b/net/ieee80211/softmac/ieee80211softmac_io.c
@@ -180,9 +180,21 @@ ieee80211softmac_assoc_req(struct ieee80211_assoc_request **pkt,
180 ieee80211softmac_hdr_3addr(mac, &((*pkt)->header), IEEE80211_STYPE_ASSOC_REQ, net->bssid, net->bssid); 180 ieee80211softmac_hdr_3addr(mac, &((*pkt)->header), IEEE80211_STYPE_ASSOC_REQ, net->bssid, net->bssid);
181 181
182 /* Fill in capability Info */ 182 /* Fill in capability Info */
183 (*pkt)->capability = (mac->ieee->iw_mode == IW_MODE_MASTER) || (mac->ieee->iw_mode == IW_MODE_INFRA) ? 183 switch (mac->ieee->iw_mode) {
184 cpu_to_le16(WLAN_CAPABILITY_ESS) : 184 case IW_MODE_INFRA:
185 cpu_to_le16(WLAN_CAPABILITY_IBSS); 185 (*pkt)->capability = cpu_to_le16(WLAN_CAPABILITY_ESS);
186 break;
187 case IW_MODE_ADHOC:
188 (*pkt)->capability = cpu_to_le16(WLAN_CAPABILITY_IBSS);
189 break;
190 case IW_MODE_AUTO:
191 (*pkt)->capability = net->capabilities & (WLAN_CAPABILITY_ESS|WLAN_CAPABILITY_IBSS);
192 break;
193 default:
194 /* bleh. we don't ever go to these modes */
195 printk(KERN_ERR PFX "invalid iw_mode!\n");
196 break;
197 }
186 /* Need to add this 198 /* Need to add this
187 (*pkt)->capability |= mac->ieee->short_slot ? 199 (*pkt)->capability |= mac->ieee->short_slot ?
188 cpu_to_le16(WLAN_CAPABILITY_SHORT_SLOT_TIME) : 0; 200 cpu_to_le16(WLAN_CAPABILITY_SHORT_SLOT_TIME) : 0;
diff --git a/net/ieee80211/softmac/ieee80211softmac_module.c b/net/ieee80211/softmac/ieee80211softmac_module.c
index 60f06a31f0d1..6252be2c0db9 100644
--- a/net/ieee80211/softmac/ieee80211softmac_module.c
+++ b/net/ieee80211/softmac/ieee80211softmac_module.c
@@ -45,6 +45,8 @@ struct net_device *alloc_ieee80211softmac(int sizeof_priv)
45 softmac->ieee->handle_disassoc = ieee80211softmac_handle_disassoc; 45 softmac->ieee->handle_disassoc = ieee80211softmac_handle_disassoc;
46 softmac->scaninfo = NULL; 46 softmac->scaninfo = NULL;
47 47
48 softmac->associnfo.scan_retry = IEEE80211SOFTMAC_ASSOC_SCAN_RETRY_LIMIT;
49
48 /* TODO: initialise all the other callbacks in the ieee struct 50 /* TODO: initialise all the other callbacks in the ieee struct
49 * (once they're written) 51 * (once they're written)
50 */ 52 */
@@ -87,6 +89,8 @@ ieee80211softmac_clear_pending_work(struct ieee80211softmac_device *sm)
87 ieee80211softmac_wait_for_scan(sm); 89 ieee80211softmac_wait_for_scan(sm);
88 90
89 spin_lock_irqsave(&sm->lock, flags); 91 spin_lock_irqsave(&sm->lock, flags);
92 sm->running = 0;
93
90 /* Free all pending assoc work items */ 94 /* Free all pending assoc work items */
91 cancel_delayed_work(&sm->associnfo.work); 95 cancel_delayed_work(&sm->associnfo.work);
92 96
@@ -202,6 +206,8 @@ void ieee80211softmac_start(struct net_device *dev)
202 assert(0); 206 assert(0);
203 if (mac->txrates_change) 207 if (mac->txrates_change)
204 mac->txrates_change(dev, change, &oldrates); 208 mac->txrates_change(dev, change, &oldrates);
209
210 mac->running = 1;
205} 211}
206EXPORT_SYMBOL_GPL(ieee80211softmac_start); 212EXPORT_SYMBOL_GPL(ieee80211softmac_start);
207 213
diff --git a/net/ieee80211/softmac/ieee80211softmac_scan.c b/net/ieee80211/softmac/ieee80211softmac_scan.c
index bb9ab8b45d09..d31cf77498c4 100644
--- a/net/ieee80211/softmac/ieee80211softmac_scan.c
+++ b/net/ieee80211/softmac/ieee80211softmac_scan.c
@@ -47,6 +47,7 @@ ieee80211softmac_start_scan(struct ieee80211softmac_device *sm)
47 sm->scanning = 1; 47 sm->scanning = 1;
48 spin_unlock_irqrestore(&sm->lock, flags); 48 spin_unlock_irqrestore(&sm->lock, flags);
49 49
50 netif_tx_disable(sm->ieee->dev);
50 ret = sm->start_scan(sm->dev); 51 ret = sm->start_scan(sm->dev);
51 if (ret) { 52 if (ret) {
52 spin_lock_irqsave(&sm->lock, flags); 53 spin_lock_irqsave(&sm->lock, flags);
@@ -114,7 +115,15 @@ void ieee80211softmac_scan(void *d)
114 // TODO: is this if correct, or should we do this only if scanning from assoc request? 115 // TODO: is this if correct, or should we do this only if scanning from assoc request?
115 if (sm->associnfo.req_essid.len) 116 if (sm->associnfo.req_essid.len)
116 ieee80211softmac_send_mgt_frame(sm, &sm->associnfo.req_essid, IEEE80211_STYPE_PROBE_REQ, 0); 117 ieee80211softmac_send_mgt_frame(sm, &sm->associnfo.req_essid, IEEE80211_STYPE_PROBE_REQ, 0);
118
119 spin_lock_irqsave(&sm->lock, flags);
120 if (unlikely(!sm->running)) {
121 /* Prevent reschedule on workqueue flush */
122 spin_unlock_irqrestore(&sm->lock, flags);
123 break;
124 }
117 schedule_delayed_work(&si->softmac_scan, IEEE80211SOFTMAC_PROBE_DELAY); 125 schedule_delayed_work(&si->softmac_scan, IEEE80211SOFTMAC_PROBE_DELAY);
126 spin_unlock_irqrestore(&sm->lock, flags);
118 return; 127 return;
119 } else { 128 } else {
120 dprintk(PFX "Not probing Channel %d (not allowed here)\n", si->channels[current_channel_idx].channel); 129 dprintk(PFX "Not probing Channel %d (not allowed here)\n", si->channels[current_channel_idx].channel);
@@ -239,6 +248,7 @@ void ieee80211softmac_scan_finished(struct ieee80211softmac_device *sm)
239 if (net) 248 if (net)
240 sm->set_channel(sm->dev, net->channel); 249 sm->set_channel(sm->dev, net->channel);
241 } 250 }
251 netif_wake_queue(sm->ieee->dev);
242 ieee80211softmac_call_events(sm, IEEE80211SOFTMAC_EVENT_SCAN_FINISHED, NULL); 252 ieee80211softmac_call_events(sm, IEEE80211SOFTMAC_EVENT_SCAN_FINISHED, NULL);
243} 253}
244EXPORT_SYMBOL_GPL(ieee80211softmac_scan_finished); 254EXPORT_SYMBOL_GPL(ieee80211softmac_scan_finished);
diff --git a/net/ieee80211/softmac/ieee80211softmac_wx.c b/net/ieee80211/softmac/ieee80211softmac_wx.c
index b559aa9b5507..27edb2b5581a 100644
--- a/net/ieee80211/softmac/ieee80211softmac_wx.c
+++ b/net/ieee80211/softmac/ieee80211softmac_wx.c
@@ -27,7 +27,8 @@
27#include "ieee80211softmac_priv.h" 27#include "ieee80211softmac_priv.h"
28 28
29#include <net/iw_handler.h> 29#include <net/iw_handler.h>
30 30/* for is_broadcast_ether_addr and is_zero_ether_addr */
31#include <linux/etherdevice.h>
31 32
32int 33int
33ieee80211softmac_wx_trigger_scan(struct net_device *net_dev, 34ieee80211softmac_wx_trigger_scan(struct net_device *net_dev,
@@ -41,13 +42,23 @@ ieee80211softmac_wx_trigger_scan(struct net_device *net_dev,
41EXPORT_SYMBOL_GPL(ieee80211softmac_wx_trigger_scan); 42EXPORT_SYMBOL_GPL(ieee80211softmac_wx_trigger_scan);
42 43
43 44
45/* if we're still scanning, return -EAGAIN so that userspace tools
46 * can get the complete scan results, otherwise return 0. */
44int 47int
45ieee80211softmac_wx_get_scan_results(struct net_device *net_dev, 48ieee80211softmac_wx_get_scan_results(struct net_device *net_dev,
46 struct iw_request_info *info, 49 struct iw_request_info *info,
47 union iwreq_data *data, 50 union iwreq_data *data,
48 char *extra) 51 char *extra)
49{ 52{
53 unsigned long flags;
50 struct ieee80211softmac_device *sm = ieee80211_priv(net_dev); 54 struct ieee80211softmac_device *sm = ieee80211_priv(net_dev);
55
56 spin_lock_irqsave(&sm->lock, flags);
57 if (sm->scanning) {
58 spin_unlock_irqrestore(&sm->lock, flags);
59 return -EAGAIN;
60 }
61 spin_unlock_irqrestore(&sm->lock, flags);
51 return ieee80211_wx_get_scan(sm->ieee, info, data, extra); 62 return ieee80211_wx_get_scan(sm->ieee, info, data, extra);
52} 63}
53EXPORT_SYMBOL_GPL(ieee80211softmac_wx_get_scan_results); 64EXPORT_SYMBOL_GPL(ieee80211softmac_wx_get_scan_results);
@@ -73,7 +84,6 @@ ieee80211softmac_wx_set_essid(struct net_device *net_dev,
73 sm->associnfo.static_essid = 1; 84 sm->associnfo.static_essid = 1;
74 } 85 }
75 } 86 }
76 sm->associnfo.scan_retry = IEEE80211SOFTMAC_ASSOC_SCAN_RETRY_LIMIT;
77 87
78 /* set our requested ESSID length. 88 /* set our requested ESSID length.
79 * If applicable, we have already copied the data in */ 89 * If applicable, we have already copied the data in */
@@ -300,8 +310,6 @@ ieee80211softmac_wx_set_wap(struct net_device *net_dev,
300 char *extra) 310 char *extra)
301{ 311{
302 struct ieee80211softmac_device *mac = ieee80211_priv(net_dev); 312 struct ieee80211softmac_device *mac = ieee80211_priv(net_dev);
303 static const unsigned char any[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
304 static const unsigned char off[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
305 unsigned long flags; 313 unsigned long flags;
306 314
307 /* sanity check */ 315 /* sanity check */
@@ -310,10 +318,17 @@ ieee80211softmac_wx_set_wap(struct net_device *net_dev,
310 } 318 }
311 319
312 spin_lock_irqsave(&mac->lock, flags); 320 spin_lock_irqsave(&mac->lock, flags);
313 if (!memcmp(any, data->ap_addr.sa_data, ETH_ALEN) || 321 if (is_broadcast_ether_addr(data->ap_addr.sa_data)) {
314 !memcmp(off, data->ap_addr.sa_data, ETH_ALEN)) { 322 /* the bssid we have is not to be fixed any longer,
315 schedule_work(&mac->associnfo.work); 323 * and we should reassociate to the best AP. */
316 goto out; 324 mac->associnfo.bssfixed = 0;
325 /* force reassociation */
326 mac->associnfo.bssvalid = 0;
327 if (mac->associated)
328 schedule_work(&mac->associnfo.work);
329 } else if (is_zero_ether_addr(data->ap_addr.sa_data)) {
330 /* the bssid we have is no longer fixed */
331 mac->associnfo.bssfixed = 0;
317 } else { 332 } else {
318 if (!memcmp(mac->associnfo.bssid, data->ap_addr.sa_data, ETH_ALEN)) { 333 if (!memcmp(mac->associnfo.bssid, data->ap_addr.sa_data, ETH_ALEN)) {
319 if (mac->associnfo.associating || mac->associated) { 334 if (mac->associnfo.associating || mac->associated) {
@@ -323,12 +338,14 @@ ieee80211softmac_wx_set_wap(struct net_device *net_dev,
323 } else { 338 } else {
324 /* copy new value in data->ap_addr.sa_data to bssid */ 339 /* copy new value in data->ap_addr.sa_data to bssid */
325 memcpy(mac->associnfo.bssid, data->ap_addr.sa_data, ETH_ALEN); 340 memcpy(mac->associnfo.bssid, data->ap_addr.sa_data, ETH_ALEN);
326 } 341 }
342 /* tell the other code that this bssid should be used no matter what */
343 mac->associnfo.bssfixed = 1;
327 /* queue associate if new bssid or (old one again and not associated) */ 344 /* queue associate if new bssid or (old one again and not associated) */
328 schedule_work(&mac->associnfo.work); 345 schedule_work(&mac->associnfo.work);
329 } 346 }
330 347
331out: 348 out:
332 spin_unlock_irqrestore(&mac->lock, flags); 349 spin_unlock_irqrestore(&mac->lock, flags);
333 return 0; 350 return 0;
334} 351}
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index dc206f1f914f..0a277453526b 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -1257,7 +1257,7 @@ out_unregister_udp_proto:
1257 goto out; 1257 goto out;
1258} 1258}
1259 1259
1260module_init(inet_init); 1260fs_initcall(inet_init);
1261 1261
1262/* ------------------------------------------------------------------------ */ 1262/* ------------------------------------------------------------------------ */
1263 1263
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index 041dadde31af..4749d504c629 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -928,7 +928,8 @@ static void parp_redo(struct sk_buff *skb)
928 * Receive an arp request from the device layer. 928 * Receive an arp request from the device layer.
929 */ 929 */
930 930
931int arp_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev) 931static int arp_rcv(struct sk_buff *skb, struct net_device *dev,
932 struct packet_type *pt, struct net_device *orig_dev)
932{ 933{
933 struct arphdr *arp; 934 struct arphdr *arp;
934 935
@@ -1417,7 +1418,6 @@ static int __init arp_proc_init(void)
1417 1418
1418EXPORT_SYMBOL(arp_broken_ops); 1419EXPORT_SYMBOL(arp_broken_ops);
1419EXPORT_SYMBOL(arp_find); 1420EXPORT_SYMBOL(arp_find);
1420EXPORT_SYMBOL(arp_rcv);
1421EXPORT_SYMBOL(arp_create); 1421EXPORT_SYMBOL(arp_create);
1422EXPORT_SYMBOL(arp_xmit); 1422EXPORT_SYMBOL(arp_xmit);
1423EXPORT_SYMBOL(arp_send); 1423EXPORT_SYMBOL(arp_send);
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index 81c2f7885292..54419b27686f 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -1556,7 +1556,6 @@ void __init devinet_init(void)
1556#endif 1556#endif
1557} 1557}
1558 1558
1559EXPORT_SYMBOL(devinet_ioctl);
1560EXPORT_SYMBOL(in_dev_finish_destroy); 1559EXPORT_SYMBOL(in_dev_finish_destroy);
1561EXPORT_SYMBOL(inet_select_addr); 1560EXPORT_SYMBOL(inet_select_addr);
1562EXPORT_SYMBOL(inetdev_by_index); 1561EXPORT_SYMBOL(inetdev_by_index);
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index 4e3d3811dea2..cdde96390960 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -666,4 +666,3 @@ void __init ip_fib_init(void)
666} 666}
667 667
668EXPORT_SYMBOL(inet_addr_type); 668EXPORT_SYMBOL(inet_addr_type);
669EXPORT_SYMBOL(ip_rt_ioctl);
diff --git a/net/ipv4/inet_hashtables.c b/net/ipv4/inet_hashtables.c
index ef7366fc132f..ee9b5515b9ae 100644
--- a/net/ipv4/inet_hashtables.c
+++ b/net/ipv4/inet_hashtables.c
@@ -43,8 +43,6 @@ struct inet_bind_bucket *inet_bind_bucket_create(kmem_cache_t *cachep,
43 return tb; 43 return tb;
44} 44}
45 45
46EXPORT_SYMBOL(inet_bind_bucket_create);
47
48/* 46/*
49 * Caller must hold hashbucket lock for this tb with local BH disabled 47 * Caller must hold hashbucket lock for this tb with local BH disabled
50 */ 48 */
@@ -64,8 +62,6 @@ void inet_bind_hash(struct sock *sk, struct inet_bind_bucket *tb,
64 inet_csk(sk)->icsk_bind_hash = tb; 62 inet_csk(sk)->icsk_bind_hash = tb;
65} 63}
66 64
67EXPORT_SYMBOL(inet_bind_hash);
68
69/* 65/*
70 * Get rid of any references to a local port held by the given sock. 66 * Get rid of any references to a local port held by the given sock.
71 */ 67 */
diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c
index 18d7fad474d7..c9026dbf4c93 100644
--- a/net/ipv4/ip_input.c
+++ b/net/ipv4/ip_input.c
@@ -337,7 +337,7 @@ static inline int ip_rcv_finish(struct sk_buff *skb)
337 * Initialise the virtual path cache for the packet. It describes 337 * Initialise the virtual path cache for the packet. It describes
338 * how the packet travels inside Linux networking. 338 * how the packet travels inside Linux networking.
339 */ 339 */
340 if (likely(skb->dst == NULL)) { 340 if (skb->dst == NULL) {
341 int err = ip_route_input(skb, iph->daddr, iph->saddr, iph->tos, 341 int err = ip_route_input(skb, iph->daddr, iph->saddr, iph->tos,
342 skb->dev); 342 skb->dev);
343 if (unlikely(err)) { 343 if (unlikely(err)) {
diff --git a/net/ipv4/ip_options.c b/net/ipv4/ip_options.c
index 9bebad07bf2e..cbcae6544622 100644
--- a/net/ipv4/ip_options.c
+++ b/net/ipv4/ip_options.c
@@ -209,7 +209,7 @@ int ip_options_echo(struct ip_options * dopt, struct sk_buff * skb)
209 209
210void ip_options_fragment(struct sk_buff * skb) 210void ip_options_fragment(struct sk_buff * skb)
211{ 211{
212 unsigned char * optptr = skb->nh.raw; 212 unsigned char * optptr = skb->nh.raw + sizeof(struct iphdr);
213 struct ip_options * opt = &(IPCB(skb)->opt); 213 struct ip_options * opt = &(IPCB(skb)->opt);
214 int l = opt->optlen; 214 int l = opt->optlen;
215 int optlen; 215 int optlen;
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 8dcba3887f04..cff9c3a72daf 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -904,7 +904,7 @@ alloc_new_skb:
904 * because we have no idea what fragment will be 904 * because we have no idea what fragment will be
905 * the last. 905 * the last.
906 */ 906 */
907 if (datalen == length) 907 if (datalen == length + fraggap)
908 alloclen += rt->u.dst.trailer_len; 908 alloclen += rt->u.dst.trailer_len;
909 909
910 if (transhdrlen) { 910 if (transhdrlen) {
diff --git a/net/ipv4/ipcomp.c b/net/ipv4/ipcomp.c
index 04a429465665..95278b22b669 100644
--- a/net/ipv4/ipcomp.c
+++ b/net/ipv4/ipcomp.c
@@ -210,7 +210,7 @@ static void ipcomp4_err(struct sk_buff *skb, u32 info)
210 skb->h.icmph->code != ICMP_FRAG_NEEDED) 210 skb->h.icmph->code != ICMP_FRAG_NEEDED)
211 return; 211 return;
212 212
213 spi = ntohl(ntohs(ipch->cpi)); 213 spi = htonl(ntohs(ipch->cpi));
214 x = xfrm_state_lookup((xfrm_address_t *)&iph->daddr, 214 x = xfrm_state_lookup((xfrm_address_t *)&iph->daddr,
215 spi, IPPROTO_COMP, AF_INET); 215 spi, IPPROTO_COMP, AF_INET);
216 if (!x) 216 if (!x)
@@ -290,11 +290,8 @@ static void ipcomp_free_scratches(void)
290 if (!scratches) 290 if (!scratches)
291 return; 291 return;
292 292
293 for_each_possible_cpu(i) { 293 for_each_possible_cpu(i)
294 void *scratch = *per_cpu_ptr(scratches, i); 294 vfree(*per_cpu_ptr(scratches, i));
295 if (scratch)
296 vfree(scratch);
297 }
298 295
299 free_percpu(scratches); 296 free_percpu(scratches);
300} 297}
diff --git a/net/ipv4/netfilter/Kconfig b/net/ipv4/netfilter/Kconfig
index c60fd5c4ea1e..d4072533da21 100644
--- a/net/ipv4/netfilter/Kconfig
+++ b/net/ipv4/netfilter/Kconfig
@@ -170,8 +170,8 @@ config IP_NF_PPTP
170 Documentation/modules.txt. If unsure, say `N'. 170 Documentation/modules.txt. If unsure, say `N'.
171 171
172config IP_NF_H323 172config IP_NF_H323
173 tristate 'H.323 protocol support' 173 tristate 'H.323 protocol support (EXPERIMENTAL)'
174 depends on IP_NF_CONNTRACK 174 depends on IP_NF_CONNTRACK && EXPERIMENTAL
175 help 175 help
176 H.323 is a VoIP signalling protocol from ITU-T. As one of the most 176 H.323 is a VoIP signalling protocol from ITU-T. As one of the most
177 important VoIP protocols, it is widely used by voice hardware and 177 important VoIP protocols, it is widely used by voice hardware and
@@ -345,7 +345,7 @@ config IP_NF_TARGET_LOG
345 To compile it as a module, choose M here. If unsure, say N. 345 To compile it as a module, choose M here. If unsure, say N.
346 346
347config IP_NF_TARGET_ULOG 347config IP_NF_TARGET_ULOG
348 tristate "ULOG target support (OBSOLETE)" 348 tristate "ULOG target support"
349 depends on IP_NF_IPTABLES 349 depends on IP_NF_IPTABLES
350 ---help--- 350 ---help---
351 351
diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c
index c2d92f99a2b8..d0d19192026d 100644
--- a/net/ipv4/netfilter/arp_tables.c
+++ b/net/ipv4/netfilter/arp_tables.c
@@ -948,7 +948,7 @@ static int do_add_counters(void __user *user, unsigned int len)
948 948
949 write_lock_bh(&t->lock); 949 write_lock_bh(&t->lock);
950 private = t->private; 950 private = t->private;
951 if (private->number != paddc->num_counters) { 951 if (private->number != tmp.num_counters) {
952 ret = -EINVAL; 952 ret = -EINVAL;
953 goto unlock_up_free; 953 goto unlock_up_free;
954 } 954 }
diff --git a/net/ipv4/netfilter/ip_conntrack_core.c b/net/ipv4/netfilter/ip_conntrack_core.c
index 979a2eac6f00..a297da7bbef5 100644
--- a/net/ipv4/netfilter/ip_conntrack_core.c
+++ b/net/ipv4/netfilter/ip_conntrack_core.c
@@ -1318,6 +1318,7 @@ getorigdst(struct sock *sk, int optval, void __user *user, int *len)
1318 .tuple.dst.u.tcp.port; 1318 .tuple.dst.u.tcp.port;
1319 sin.sin_addr.s_addr = ct->tuplehash[IP_CT_DIR_ORIGINAL] 1319 sin.sin_addr.s_addr = ct->tuplehash[IP_CT_DIR_ORIGINAL]
1320 .tuple.dst.ip; 1320 .tuple.dst.ip;
1321 memset(sin.sin_zero, 0, sizeof(sin.sin_zero));
1321 1322
1322 DEBUGP("SO_ORIGINAL_DST: %u.%u.%u.%u %u\n", 1323 DEBUGP("SO_ORIGINAL_DST: %u.%u.%u.%u %u\n",
1323 NIPQUAD(sin.sin_addr.s_addr), ntohs(sin.sin_port)); 1324 NIPQUAD(sin.sin_addr.s_addr), ntohs(sin.sin_port));
diff --git a/net/ipv4/netfilter/ip_conntrack_helper_h323.c b/net/ipv4/netfilter/ip_conntrack_helper_h323.c
index 2c2fb700d835..518f581d39ec 100644
--- a/net/ipv4/netfilter/ip_conntrack_helper_h323.c
+++ b/net/ipv4/netfilter/ip_conntrack_helper_h323.c
@@ -162,6 +162,8 @@ static int get_tpkt_data(struct sk_buff **pskb, struct ip_conntrack *ct,
162 162
163 /* Validate TPKT length */ 163 /* Validate TPKT length */
164 tpktlen = tpkt[2] * 256 + tpkt[3]; 164 tpktlen = tpkt[2] * 256 + tpkt[3];
165 if (tpktlen < 4)
166 goto clear_out;
165 if (tpktlen > tcpdatalen) { 167 if (tpktlen > tcpdatalen) {
166 if (tcpdatalen == 4) { /* Separate TPKT header */ 168 if (tcpdatalen == 4) { /* Separate TPKT header */
167 /* Netmeeting sends TPKT header and data separately */ 169 /* Netmeeting sends TPKT header and data separately */
diff --git a/net/ipv4/netfilter/ip_conntrack_helper_h323_asn1.c b/net/ipv4/netfilter/ip_conntrack_helper_h323_asn1.c
index 48078002e450..26dfecadb335 100644
--- a/net/ipv4/netfilter/ip_conntrack_helper_h323_asn1.c
+++ b/net/ipv4/netfilter/ip_conntrack_helper_h323_asn1.c
@@ -2,7 +2,7 @@
2 * ip_conntrack_helper_h323_asn1.c - BER and PER decoding library for H.323 2 * ip_conntrack_helper_h323_asn1.c - BER and PER decoding library for H.323
3 * conntrack/NAT module. 3 * conntrack/NAT module.
4 * 4 *
5 * Copyright (c) 2006 by Jing Min Zhao <zhaojingmin@hotmail.com> 5 * Copyright (c) 2006 by Jing Min Zhao <zhaojingmin@users.sourceforge.net>
6 * 6 *
7 * This source code is licensed under General Public License version 2. 7 * This source code is licensed under General Public License version 2.
8 * 8 *
@@ -528,14 +528,15 @@ int decode_seq(bitstr_t * bs, field_t * f, char *base, int level)
528 528
529 /* Decode */ 529 /* Decode */
530 if ((err = (Decoders[son->type]) (bs, son, base, 530 if ((err = (Decoders[son->type]) (bs, son, base,
531 level + 1)) > 531 level + 1)) <
532 H323_ERROR_STOP) 532 H323_ERROR_NONE)
533 return err; 533 return err;
534 534
535 bs->cur = beg + len; 535 bs->cur = beg + len;
536 bs->bit = 0; 536 bs->bit = 0;
537 } else if ((err = (Decoders[son->type]) (bs, son, base, 537 } else if ((err = (Decoders[son->type]) (bs, son, base,
538 level + 1))) 538 level + 1)) <
539 H323_ERROR_NONE)
539 return err; 540 return err;
540 } 541 }
541 542
@@ -554,7 +555,7 @@ int decode_seq(bitstr_t * bs, field_t * f, char *base, int level)
554 555
555 /* Decode the extension components */ 556 /* Decode the extension components */
556 for (opt = 0; opt < bmp2_len; opt++, i++, son++) { 557 for (opt = 0; opt < bmp2_len; opt++, i++, son++) {
557 if (son->attr & STOP) { 558 if (i < f->ub && son->attr & STOP) {
558 PRINT("%*.s%s\n", (level + 1) * TAB_SIZE, " ", 559 PRINT("%*.s%s\n", (level + 1) * TAB_SIZE, " ",
559 son->name); 560 son->name);
560 return H323_ERROR_STOP; 561 return H323_ERROR_STOP;
@@ -584,8 +585,8 @@ int decode_seq(bitstr_t * bs, field_t * f, char *base, int level)
584 beg = bs->cur; 585 beg = bs->cur;
585 586
586 if ((err = (Decoders[son->type]) (bs, son, base, 587 if ((err = (Decoders[son->type]) (bs, son, base,
587 level + 1)) > 588 level + 1)) <
588 H323_ERROR_STOP) 589 H323_ERROR_NONE)
589 return err; 590 return err;
590 591
591 bs->cur = beg + len; 592 bs->cur = beg + len;
@@ -660,18 +661,20 @@ int decode_seqof(bitstr_t * bs, field_t * f, char *base, int level)
660 i < 661 i <
661 effective_count ? 662 effective_count ?
662 base : NULL, 663 base : NULL,
663 level + 1)) > 664 level + 1)) <
664 H323_ERROR_STOP) 665 H323_ERROR_NONE)
665 return err; 666 return err;
666 667
667 bs->cur = beg + len; 668 bs->cur = beg + len;
668 bs->bit = 0; 669 bs->bit = 0;
669 } else 670 } else
670 if ((err = (Decoders[son->type]) (bs, son, 671 if ((err = (Decoders[son->type]) (bs, son,
671 i < effective_count ? 672 i <
672 base : NULL, 673 effective_count ?
673 level + 1))) 674 base : NULL,
674 return err; 675 level + 1)) <
676 H323_ERROR_NONE)
677 return err;
675 678
676 if (base) 679 if (base)
677 base += son->offset; 680 base += son->offset;
@@ -703,6 +706,10 @@ int decode_choice(bitstr_t * bs, field_t * f, char *base, int level)
703 type = get_bits(bs, f->sz); 706 type = get_bits(bs, f->sz);
704 } 707 }
705 708
709 /* Write Type */
710 if (base)
711 *(unsigned *) base = type;
712
706 /* Check Range */ 713 /* Check Range */
707 if (type >= f->ub) { /* Newer version? */ 714 if (type >= f->ub) { /* Newer version? */
708 BYTE_ALIGN(bs); 715 BYTE_ALIGN(bs);
@@ -712,10 +719,6 @@ int decode_choice(bitstr_t * bs, field_t * f, char *base, int level)
712 return H323_ERROR_NONE; 719 return H323_ERROR_NONE;
713 } 720 }
714 721
715 /* Write Type */
716 if (base)
717 *(unsigned *) base = type;
718
719 /* Transfer to son level */ 722 /* Transfer to son level */
720 son = &f->fields[type]; 723 son = &f->fields[type];
721 if (son->attr & STOP) { 724 if (son->attr & STOP) {
@@ -735,13 +738,14 @@ int decode_choice(bitstr_t * bs, field_t * f, char *base, int level)
735 } 738 }
736 beg = bs->cur; 739 beg = bs->cur;
737 740
738 if ((err = (Decoders[son->type]) (bs, son, base, level + 1)) > 741 if ((err = (Decoders[son->type]) (bs, son, base, level + 1)) <
739 H323_ERROR_STOP) 742 H323_ERROR_NONE)
740 return err; 743 return err;
741 744
742 bs->cur = beg + len; 745 bs->cur = beg + len;
743 bs->bit = 0; 746 bs->bit = 0;
744 } else if ((err = (Decoders[son->type]) (bs, son, base, level + 1))) 747 } else if ((err = (Decoders[son->type]) (bs, son, base, level + 1)) <
748 H323_ERROR_NONE)
745 return err; 749 return err;
746 750
747 return H323_ERROR_NONE; 751 return H323_ERROR_NONE;
diff --git a/net/ipv4/netfilter/ip_conntrack_helper_pptp.c b/net/ipv4/netfilter/ip_conntrack_helper_pptp.c
index 7d3ba4302e9e..8ccfe17bb253 100644
--- a/net/ipv4/netfilter/ip_conntrack_helper_pptp.c
+++ b/net/ipv4/netfilter/ip_conntrack_helper_pptp.c
@@ -469,8 +469,8 @@ pptp_inbound_pkt(struct sk_buff **pskb,
469 DEBUGP("%s but no session\n", pptp_msg_name[msg]); 469 DEBUGP("%s but no session\n", pptp_msg_name[msg]);
470 break; 470 break;
471 } 471 }
472 if (info->sstate != PPTP_CALL_IN_REP 472 if (info->cstate != PPTP_CALL_IN_REP
473 && info->sstate != PPTP_CALL_IN_CONF) { 473 && info->cstate != PPTP_CALL_IN_CONF) {
474 DEBUGP("%s but never sent IN_CALL_REPLY\n", 474 DEBUGP("%s but never sent IN_CALL_REPLY\n",
475 pptp_msg_name[msg]); 475 pptp_msg_name[msg]);
476 break; 476 break;
diff --git a/net/ipv4/netfilter/ip_conntrack_proto_sctp.c b/net/ipv4/netfilter/ip_conntrack_proto_sctp.c
index 5259abd0fb42..0416073c5600 100644
--- a/net/ipv4/netfilter/ip_conntrack_proto_sctp.c
+++ b/net/ipv4/netfilter/ip_conntrack_proto_sctp.c
@@ -235,12 +235,15 @@ static int do_basic_checks(struct ip_conntrack *conntrack,
235 flag = 1; 235 flag = 1;
236 } 236 }
237 237
238 /* Cookie Ack/Echo chunks not the first OR 238 /*
239 Init / Init Ack / Shutdown compl chunks not the only chunks */ 239 * Cookie Ack/Echo chunks not the first OR
240 if ((sch->type == SCTP_CID_COOKIE_ACK 240 * Init / Init Ack / Shutdown compl chunks not the only chunks
241 * OR zero-length.
242 */
243 if (((sch->type == SCTP_CID_COOKIE_ACK
241 || sch->type == SCTP_CID_COOKIE_ECHO 244 || sch->type == SCTP_CID_COOKIE_ECHO
242 || flag) 245 || flag)
243 && count !=0 ) { 246 && count !=0) || !sch->length) {
244 DEBUGP("Basic checks failed\n"); 247 DEBUGP("Basic checks failed\n");
245 return 1; 248 return 1;
246 } 249 }
diff --git a/net/ipv4/netfilter/ip_nat_proto_gre.c b/net/ipv4/netfilter/ip_nat_proto_gre.c
index 6c4899d8046a..96ceabaec402 100644
--- a/net/ipv4/netfilter/ip_nat_proto_gre.c
+++ b/net/ipv4/netfilter/ip_nat_proto_gre.c
@@ -49,15 +49,15 @@ gre_in_range(const struct ip_conntrack_tuple *tuple,
49 const union ip_conntrack_manip_proto *min, 49 const union ip_conntrack_manip_proto *min,
50 const union ip_conntrack_manip_proto *max) 50 const union ip_conntrack_manip_proto *max)
51{ 51{
52 u_int32_t key; 52 __be16 key;
53 53
54 if (maniptype == IP_NAT_MANIP_SRC) 54 if (maniptype == IP_NAT_MANIP_SRC)
55 key = tuple->src.u.gre.key; 55 key = tuple->src.u.gre.key;
56 else 56 else
57 key = tuple->dst.u.gre.key; 57 key = tuple->dst.u.gre.key;
58 58
59 return ntohl(key) >= ntohl(min->gre.key) 59 return ntohs(key) >= ntohs(min->gre.key)
60 && ntohl(key) <= ntohl(max->gre.key); 60 && ntohs(key) <= ntohs(max->gre.key);
61} 61}
62 62
63/* generate unique tuple ... */ 63/* generate unique tuple ... */
@@ -81,14 +81,14 @@ gre_unique_tuple(struct ip_conntrack_tuple *tuple,
81 min = 1; 81 min = 1;
82 range_size = 0xffff; 82 range_size = 0xffff;
83 } else { 83 } else {
84 min = ntohl(range->min.gre.key); 84 min = ntohs(range->min.gre.key);
85 range_size = ntohl(range->max.gre.key) - min + 1; 85 range_size = ntohs(range->max.gre.key) - min + 1;
86 } 86 }
87 87
88 DEBUGP("min = %u, range_size = %u\n", min, range_size); 88 DEBUGP("min = %u, range_size = %u\n", min, range_size);
89 89
90 for (i = 0; i < range_size; i++, key++) { 90 for (i = 0; i < range_size; i++, key++) {
91 *keyptr = htonl(min + key % range_size); 91 *keyptr = htons(min + key % range_size);
92 if (!ip_nat_used_tuple(tuple, conntrack)) 92 if (!ip_nat_used_tuple(tuple, conntrack))
93 return 1; 93 return 1;
94 } 94 }
diff --git a/net/ipv4/netfilter/ip_nat_snmp_basic.c b/net/ipv4/netfilter/ip_nat_snmp_basic.c
index c62253845538..c33244263b90 100644
--- a/net/ipv4/netfilter/ip_nat_snmp_basic.c
+++ b/net/ipv4/netfilter/ip_nat_snmp_basic.c
@@ -768,6 +768,7 @@ static unsigned char snmp_object_decode(struct asn1_ctx *ctx,
768 len *= sizeof(unsigned long); 768 len *= sizeof(unsigned long);
769 *obj = kmalloc(sizeof(struct snmp_object) + len, GFP_ATOMIC); 769 *obj = kmalloc(sizeof(struct snmp_object) + len, GFP_ATOMIC);
770 if (*obj == NULL) { 770 if (*obj == NULL) {
771 kfree(lp);
771 kfree(id); 772 kfree(id);
772 if (net_ratelimit()) 773 if (net_ratelimit())
773 printk("OOM in bsalg (%d)\n", __LINE__); 774 printk("OOM in bsalg (%d)\n", __LINE__);
@@ -1003,12 +1004,12 @@ static unsigned char snmp_trap_decode(struct asn1_ctx *ctx,
1003 1004
1004 return 1; 1005 return 1;
1005 1006
1007err_addr_free:
1008 kfree((unsigned long *)trap->ip_address);
1009
1006err_id_free: 1010err_id_free:
1007 kfree(trap->id); 1011 kfree(trap->id);
1008 1012
1009err_addr_free:
1010 kfree((unsigned long *)trap->ip_address);
1011
1012 return 0; 1013 return 0;
1013} 1014}
1014 1015
@@ -1126,11 +1127,10 @@ static int snmp_parse_mangle(unsigned char *msg,
1126 struct snmp_v1_trap trap; 1127 struct snmp_v1_trap trap;
1127 unsigned char ret = snmp_trap_decode(&ctx, &trap, map, check); 1128 unsigned char ret = snmp_trap_decode(&ctx, &trap, map, check);
1128 1129
1129 /* Discard trap allocations regardless */ 1130 if (ret) {
1130 kfree(trap.id); 1131 kfree(trap.id);
1131 kfree((unsigned long *)trap.ip_address); 1132 kfree((unsigned long *)trap.ip_address);
1132 1133 } else
1133 if (!ret)
1134 return ret; 1134 return ret;
1135 1135
1136 } else { 1136 } else {
diff --git a/net/ipv4/netfilter/ip_nat_standalone.c b/net/ipv4/netfilter/ip_nat_standalone.c
index 8f760b28617e..67e676783da9 100644
--- a/net/ipv4/netfilter/ip_nat_standalone.c
+++ b/net/ipv4/netfilter/ip_nat_standalone.c
@@ -219,8 +219,10 @@ ip_nat_out(unsigned int hooknum,
219 const struct net_device *out, 219 const struct net_device *out,
220 int (*okfn)(struct sk_buff *)) 220 int (*okfn)(struct sk_buff *))
221{ 221{
222#ifdef CONFIG_XFRM
222 struct ip_conntrack *ct; 223 struct ip_conntrack *ct;
223 enum ip_conntrack_info ctinfo; 224 enum ip_conntrack_info ctinfo;
225#endif
224 unsigned int ret; 226 unsigned int ret;
225 227
226 /* root is playing with raw sockets. */ 228 /* root is playing with raw sockets. */
diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c
index d25ac8ba6eba..cee3397ec277 100644
--- a/net/ipv4/netfilter/ip_tables.c
+++ b/net/ipv4/netfilter/ip_tables.c
@@ -956,15 +956,16 @@ struct compat_ipt_standard_target
956 compat_int_t verdict; 956 compat_int_t verdict;
957}; 957};
958 958
959#define IPT_ST_OFFSET (sizeof(struct ipt_standard_target) - \
960 sizeof(struct compat_ipt_standard_target))
961
962struct compat_ipt_standard 959struct compat_ipt_standard
963{ 960{
964 struct compat_ipt_entry entry; 961 struct compat_ipt_entry entry;
965 struct compat_ipt_standard_target target; 962 struct compat_ipt_standard_target target;
966}; 963};
967 964
965#define IPT_ST_LEN XT_ALIGN(sizeof(struct ipt_standard_target))
966#define IPT_ST_COMPAT_LEN COMPAT_XT_ALIGN(sizeof(struct compat_ipt_standard_target))
967#define IPT_ST_OFFSET (IPT_ST_LEN - IPT_ST_COMPAT_LEN)
968
968static int compat_ipt_standard_fn(void *target, 969static int compat_ipt_standard_fn(void *target,
969 void **dstptr, int *size, int convert) 970 void **dstptr, int *size, int convert)
970{ 971{
@@ -975,35 +976,29 @@ static int compat_ipt_standard_fn(void *target,
975 ret = 0; 976 ret = 0;
976 switch (convert) { 977 switch (convert) {
977 case COMPAT_TO_USER: 978 case COMPAT_TO_USER:
978 pst = (struct ipt_standard_target *)target; 979 pst = target;
979 memcpy(&compat_st.target, &pst->target, 980 memcpy(&compat_st.target, &pst->target,
980 sizeof(struct ipt_entry_target)); 981 sizeof(compat_st.target));
981 compat_st.verdict = pst->verdict; 982 compat_st.verdict = pst->verdict;
982 if (compat_st.verdict > 0) 983 if (compat_st.verdict > 0)
983 compat_st.verdict -= 984 compat_st.verdict -=
984 compat_calc_jump(compat_st.verdict); 985 compat_calc_jump(compat_st.verdict);
985 compat_st.target.u.user.target_size = 986 compat_st.target.u.user.target_size = IPT_ST_COMPAT_LEN;
986 sizeof(struct compat_ipt_standard_target); 987 if (copy_to_user(*dstptr, &compat_st, IPT_ST_COMPAT_LEN))
987 if (__copy_to_user(*dstptr, &compat_st,
988 sizeof(struct compat_ipt_standard_target)))
989 ret = -EFAULT; 988 ret = -EFAULT;
990 *size -= IPT_ST_OFFSET; 989 *size -= IPT_ST_OFFSET;
991 *dstptr += sizeof(struct compat_ipt_standard_target); 990 *dstptr += IPT_ST_COMPAT_LEN;
992 break; 991 break;
993 case COMPAT_FROM_USER: 992 case COMPAT_FROM_USER:
994 pcompat_st = 993 pcompat_st = target;
995 (struct compat_ipt_standard_target *)target; 994 memcpy(&st.target, &pcompat_st->target, IPT_ST_COMPAT_LEN);
996 memcpy(&st.target, &pcompat_st->target,
997 sizeof(struct ipt_entry_target));
998 st.verdict = pcompat_st->verdict; 995 st.verdict = pcompat_st->verdict;
999 if (st.verdict > 0) 996 if (st.verdict > 0)
1000 st.verdict += compat_calc_jump(st.verdict); 997 st.verdict += compat_calc_jump(st.verdict);
1001 st.target.u.user.target_size = 998 st.target.u.user.target_size = IPT_ST_LEN;
1002 sizeof(struct ipt_standard_target); 999 memcpy(*dstptr, &st, IPT_ST_LEN);
1003 memcpy(*dstptr, &st,
1004 sizeof(struct ipt_standard_target));
1005 *size += IPT_ST_OFFSET; 1000 *size += IPT_ST_OFFSET;
1006 *dstptr += sizeof(struct ipt_standard_target); 1001 *dstptr += IPT_ST_LEN;
1007 break; 1002 break;
1008 case COMPAT_CALC_SIZE: 1003 case COMPAT_CALC_SIZE:
1009 *size += IPT_ST_OFFSET; 1004 *size += IPT_ST_OFFSET;
@@ -1446,7 +1441,7 @@ static int compat_copy_entry_to_user(struct ipt_entry *e,
1446 ret = -EFAULT; 1441 ret = -EFAULT;
1447 origsize = *size; 1442 origsize = *size;
1448 ce = (struct compat_ipt_entry __user *)*dstptr; 1443 ce = (struct compat_ipt_entry __user *)*dstptr;
1449 if (__copy_to_user(ce, e, sizeof(struct ipt_entry))) 1444 if (copy_to_user(ce, e, sizeof(struct ipt_entry)))
1450 goto out; 1445 goto out;
1451 1446
1452 *dstptr += sizeof(struct compat_ipt_entry); 1447 *dstptr += sizeof(struct compat_ipt_entry);
@@ -1464,9 +1459,9 @@ static int compat_copy_entry_to_user(struct ipt_entry *e,
1464 goto out; 1459 goto out;
1465 ret = -EFAULT; 1460 ret = -EFAULT;
1466 next_offset = e->next_offset - (origsize - *size); 1461 next_offset = e->next_offset - (origsize - *size);
1467 if (__put_user(target_offset, &ce->target_offset)) 1462 if (put_user(target_offset, &ce->target_offset))
1468 goto out; 1463 goto out;
1469 if (__put_user(next_offset, &ce->next_offset)) 1464 if (put_user(next_offset, &ce->next_offset))
1470 goto out; 1465 goto out;
1471 return 0; 1466 return 0;
1472out: 1467out:
diff --git a/net/ipv4/netfilter/ipt_LOG.c b/net/ipv4/netfilter/ipt_LOG.c
index 39fd4c2a2386..b98f7b08b084 100644
--- a/net/ipv4/netfilter/ipt_LOG.c
+++ b/net/ipv4/netfilter/ipt_LOG.c
@@ -428,7 +428,7 @@ ipt_log_target(struct sk_buff **pskb,
428 428
429 if (loginfo->logflags & IPT_LOG_NFLOG) 429 if (loginfo->logflags & IPT_LOG_NFLOG)
430 nf_log_packet(PF_INET, hooknum, *pskb, in, out, &li, 430 nf_log_packet(PF_INET, hooknum, *pskb, in, out, &li,
431 loginfo->prefix); 431 "%s", loginfo->prefix);
432 else 432 else
433 ipt_log_packet(PF_INET, hooknum, *pskb, in, out, &li, 433 ipt_log_packet(PF_INET, hooknum, *pskb, in, out, &li,
434 loginfo->prefix); 434 loginfo->prefix);
diff --git a/net/ipv4/netfilter/ipt_recent.c b/net/ipv4/netfilter/ipt_recent.c
index 143843285702..b847ee409efb 100644
--- a/net/ipv4/netfilter/ipt_recent.c
+++ b/net/ipv4/netfilter/ipt_recent.c
@@ -821,6 +821,7 @@ checkentry(const char *tablename,
821 /* Create our proc 'status' entry. */ 821 /* Create our proc 'status' entry. */
822 curr_table->status_proc = create_proc_entry(curr_table->name, ip_list_perms, proc_net_ipt_recent); 822 curr_table->status_proc = create_proc_entry(curr_table->name, ip_list_perms, proc_net_ipt_recent);
823 if (!curr_table->status_proc) { 823 if (!curr_table->status_proc) {
824 vfree(hold);
824 printk(KERN_INFO RECENT_NAME ": checkentry: unable to allocate for /proc entry.\n"); 825 printk(KERN_INFO RECENT_NAME ": checkentry: unable to allocate for /proc entry.\n");
825 /* Destroy the created table */ 826 /* Destroy the created table */
826 spin_lock_bh(&recent_lock); 827 spin_lock_bh(&recent_lock);
@@ -845,7 +846,6 @@ checkentry(const char *tablename,
845 spin_unlock_bh(&recent_lock); 846 spin_unlock_bh(&recent_lock);
846 vfree(curr_table->time_info); 847 vfree(curr_table->time_info);
847 vfree(curr_table->hash_table); 848 vfree(curr_table->hash_table);
848 vfree(hold);
849 vfree(curr_table->table); 849 vfree(curr_table->table);
850 vfree(curr_table); 850 vfree(curr_table);
851 return 0; 851 return 0;
diff --git a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
index 5bc9f64d7b5b..77d974443c7b 100644
--- a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
+++ b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
@@ -348,6 +348,7 @@ getorigdst(struct sock *sk, int optval, void __user *user, int *len)
348 .tuple.dst.u.tcp.port; 348 .tuple.dst.u.tcp.port;
349 sin.sin_addr.s_addr = ct->tuplehash[IP_CT_DIR_ORIGINAL] 349 sin.sin_addr.s_addr = ct->tuplehash[IP_CT_DIR_ORIGINAL]
350 .tuple.dst.u3.ip; 350 .tuple.dst.u3.ip;
351 memset(sin.sin_zero, 0, sizeof(sin.sin_zero));
351 352
352 DEBUGP("SO_ORIGINAL_DST: %u.%u.%u.%u %u\n", 353 DEBUGP("SO_ORIGINAL_DST: %u.%u.%u.%u %u\n",
353 NIPQUAD(sin.sin_addr.s_addr), ntohs(sin.sin_port)); 354 NIPQUAD(sin.sin_addr.s_addr), ntohs(sin.sin_port));
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index ff434821909f..cc9423de7311 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2741,7 +2741,10 @@ int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void *arg)
2741 /* Reserve room for dummy headers, this skb can pass 2741 /* Reserve room for dummy headers, this skb can pass
2742 through good chunk of routing engine. 2742 through good chunk of routing engine.
2743 */ 2743 */
2744 skb->mac.raw = skb->data; 2744 skb->mac.raw = skb->nh.raw = skb->data;
2745
2746 /* Bugfix: need to give ip_route_input enough of an IP header to not gag. */
2747 skb->nh.iph->protocol = IPPROTO_ICMP;
2745 skb_reserve(skb, MAX_HEADER + sizeof(struct iphdr)); 2748 skb_reserve(skb, MAX_HEADER + sizeof(struct iphdr));
2746 2749
2747 if (rta[RTA_SRC - 1]) 2750 if (rta[RTA_SRC - 1])
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 87f68e787d0c..e2b7b8055037 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -1468,6 +1468,7 @@ void tcp_close(struct sock *sk, long timeout)
1468{ 1468{
1469 struct sk_buff *skb; 1469 struct sk_buff *skb;
1470 int data_was_unread = 0; 1470 int data_was_unread = 0;
1471 int state;
1471 1472
1472 lock_sock(sk); 1473 lock_sock(sk);
1473 sk->sk_shutdown = SHUTDOWN_MASK; 1474 sk->sk_shutdown = SHUTDOWN_MASK;
@@ -1544,6 +1545,11 @@ void tcp_close(struct sock *sk, long timeout)
1544 sk_stream_wait_close(sk, timeout); 1545 sk_stream_wait_close(sk, timeout);
1545 1546
1546adjudge_to_death: 1547adjudge_to_death:
1548 state = sk->sk_state;
1549 sock_hold(sk);
1550 sock_orphan(sk);
1551 atomic_inc(sk->sk_prot->orphan_count);
1552
1547 /* It is the last release_sock in its life. It will remove backlog. */ 1553 /* It is the last release_sock in its life. It will remove backlog. */
1548 release_sock(sk); 1554 release_sock(sk);
1549 1555
@@ -1555,8 +1561,9 @@ adjudge_to_death:
1555 bh_lock_sock(sk); 1561 bh_lock_sock(sk);
1556 BUG_TRAP(!sock_owned_by_user(sk)); 1562 BUG_TRAP(!sock_owned_by_user(sk));
1557 1563
1558 sock_hold(sk); 1564 /* Have we already been destroyed by a softirq or backlog? */
1559 sock_orphan(sk); 1565 if (state != TCP_CLOSE && sk->sk_state == TCP_CLOSE)
1566 goto out;
1560 1567
1561 /* This is a (useful) BSD violating of the RFC. There is a 1568 /* This is a (useful) BSD violating of the RFC. There is a
1562 * problem with TCP as specified in that the other end could 1569 * problem with TCP as specified in that the other end could
@@ -1584,7 +1591,6 @@ adjudge_to_death:
1584 if (tmo > TCP_TIMEWAIT_LEN) { 1591 if (tmo > TCP_TIMEWAIT_LEN) {
1585 inet_csk_reset_keepalive_timer(sk, tcp_fin_time(sk)); 1592 inet_csk_reset_keepalive_timer(sk, tcp_fin_time(sk));
1586 } else { 1593 } else {
1587 atomic_inc(sk->sk_prot->orphan_count);
1588 tcp_time_wait(sk, TCP_FIN_WAIT2, tmo); 1594 tcp_time_wait(sk, TCP_FIN_WAIT2, tmo);
1589 goto out; 1595 goto out;
1590 } 1596 }
@@ -1603,7 +1609,6 @@ adjudge_to_death:
1603 NET_INC_STATS_BH(LINUX_MIB_TCPABORTONMEMORY); 1609 NET_INC_STATS_BH(LINUX_MIB_TCPABORTONMEMORY);
1604 } 1610 }
1605 } 1611 }
1606 atomic_inc(sk->sk_prot->orphan_count);
1607 1612
1608 if (sk->sk_state == TCP_CLOSE) 1613 if (sk->sk_state == TCP_CLOSE)
1609 inet_csk_destroy_sock(sk); 1614 inet_csk_destroy_sock(sk);
diff --git a/net/ipv4/tcp_highspeed.c b/net/ipv4/tcp_highspeed.c
index e0e9d1383c7c..ba7c63ca5bb1 100644
--- a/net/ipv4/tcp_highspeed.c
+++ b/net/ipv4/tcp_highspeed.c
@@ -135,10 +135,11 @@ static void hstcp_cong_avoid(struct sock *sk, u32 adk, u32 rtt,
135 135
136 /* Do additive increase */ 136 /* Do additive increase */
137 if (tp->snd_cwnd < tp->snd_cwnd_clamp) { 137 if (tp->snd_cwnd < tp->snd_cwnd_clamp) {
138 tp->snd_cwnd_cnt += ca->ai; 138 /* cwnd = cwnd + a(w) / cwnd */
139 tp->snd_cwnd_cnt += ca->ai + 1;
139 if (tp->snd_cwnd_cnt >= tp->snd_cwnd) { 140 if (tp->snd_cwnd_cnt >= tp->snd_cwnd) {
140 tp->snd_cwnd++;
141 tp->snd_cwnd_cnt -= tp->snd_cwnd; 141 tp->snd_cwnd_cnt -= tp->snd_cwnd;
142 tp->snd_cwnd++;
142 } 143 }
143 } 144 }
144 } 145 }
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 195d83584558..4a538bc1683d 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1662,6 +1662,8 @@ static void tcp_update_scoreboard(struct sock *sk, struct tcp_sock *tp)
1662 if (!(TCP_SKB_CB(skb)->sacked&TCPCB_TAGBITS)) { 1662 if (!(TCP_SKB_CB(skb)->sacked&TCPCB_TAGBITS)) {
1663 TCP_SKB_CB(skb)->sacked |= TCPCB_LOST; 1663 TCP_SKB_CB(skb)->sacked |= TCPCB_LOST;
1664 tp->lost_out += tcp_skb_pcount(skb); 1664 tp->lost_out += tcp_skb_pcount(skb);
1665 if (IsReno(tp))
1666 tcp_remove_reno_sacks(sk, tp, tcp_skb_pcount(skb) + 1);
1665 1667
1666 /* clear xmit_retrans hint */ 1668 /* clear xmit_retrans hint */
1667 if (tp->retransmit_skb_hint && 1669 if (tp->retransmit_skb_hint &&
@@ -4559,7 +4561,6 @@ discard:
4559 4561
4560EXPORT_SYMBOL(sysctl_tcp_ecn); 4562EXPORT_SYMBOL(sysctl_tcp_ecn);
4561EXPORT_SYMBOL(sysctl_tcp_reordering); 4563EXPORT_SYMBOL(sysctl_tcp_reordering);
4562EXPORT_SYMBOL(sysctl_tcp_abc);
4563EXPORT_SYMBOL(tcp_parse_options); 4564EXPORT_SYMBOL(tcp_parse_options);
4564EXPORT_SYMBOL(tcp_rcv_established); 4565EXPORT_SYMBOL(tcp_rcv_established);
4565EXPORT_SYMBOL(tcp_rcv_state_process); 4566EXPORT_SYMBOL(tcp_rcv_state_process);
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 9e85c0416109..672950e54c49 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -1859,5 +1859,4 @@ EXPORT_SYMBOL(tcp_proc_unregister);
1859#endif 1859#endif
1860EXPORT_SYMBOL(sysctl_local_port_range); 1860EXPORT_SYMBOL(sysctl_local_port_range);
1861EXPORT_SYMBOL(sysctl_tcp_low_latency); 1861EXPORT_SYMBOL(sysctl_tcp_low_latency);
1862EXPORT_SYMBOL(sysctl_tcp_tw_reuse);
1863 1862
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 9d79546d384e..f33c9dddaa12 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -59,9 +59,6 @@ int sysctl_tcp_tso_win_divisor = 3;
59int sysctl_tcp_mtu_probing = 0; 59int sysctl_tcp_mtu_probing = 0;
60int sysctl_tcp_base_mss = 512; 60int sysctl_tcp_base_mss = 512;
61 61
62EXPORT_SYMBOL(sysctl_tcp_mtu_probing);
63EXPORT_SYMBOL(sysctl_tcp_base_mss);
64
65static void update_send_head(struct sock *sk, struct tcp_sock *tp, 62static void update_send_head(struct sock *sk, struct tcp_sock *tp,
66 struct sk_buff *skb) 63 struct sk_buff *skb)
67{ 64{
@@ -468,7 +465,7 @@ static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, int clone_it,
468 TCP_INC_STATS(TCP_MIB_OUTSEGS); 465 TCP_INC_STATS(TCP_MIB_OUTSEGS);
469 466
470 err = icsk->icsk_af_ops->queue_xmit(skb, 0); 467 err = icsk->icsk_af_ops->queue_xmit(skb, 0);
471 if (unlikely(err <= 0)) 468 if (likely(err <= 0))
472 return err; 469 return err;
473 470
474 tcp_enter_cwr(sk); 471 tcp_enter_cwr(sk);
@@ -536,6 +533,7 @@ int tcp_fragment(struct sock *sk, struct sk_buff *skb, u32 len, unsigned int mss
536 struct tcp_sock *tp = tcp_sk(sk); 533 struct tcp_sock *tp = tcp_sk(sk);
537 struct sk_buff *buff; 534 struct sk_buff *buff;
538 int nsize, old_factor; 535 int nsize, old_factor;
536 int nlen;
539 u16 flags; 537 u16 flags;
540 538
541 BUG_ON(len > skb->len); 539 BUG_ON(len > skb->len);
@@ -554,7 +552,11 @@ int tcp_fragment(struct sock *sk, struct sk_buff *skb, u32 len, unsigned int mss
554 buff = sk_stream_alloc_skb(sk, nsize, GFP_ATOMIC); 552 buff = sk_stream_alloc_skb(sk, nsize, GFP_ATOMIC);
555 if (buff == NULL) 553 if (buff == NULL)
556 return -ENOMEM; /* We'll just try again later. */ 554 return -ENOMEM; /* We'll just try again later. */
555
557 sk_charge_skb(sk, buff); 556 sk_charge_skb(sk, buff);
557 nlen = skb->len - len - nsize;
558 buff->truesize += nlen;
559 skb->truesize -= nlen;
558 560
559 /* Correct the sequence numbers. */ 561 /* Correct the sequence numbers. */
560 TCP_SKB_CB(buff)->seq = TCP_SKB_CB(skb)->seq + len; 562 TCP_SKB_CB(buff)->seq = TCP_SKB_CB(skb)->seq + len;
@@ -640,7 +642,7 @@ int tcp_fragment(struct sock *sk, struct sk_buff *skb, u32 len, unsigned int mss
640 * eventually). The difference is that pulled data not copied, but 642 * eventually). The difference is that pulled data not copied, but
641 * immediately discarded. 643 * immediately discarded.
642 */ 644 */
643static unsigned char *__pskb_trim_head(struct sk_buff *skb, int len) 645static void __pskb_trim_head(struct sk_buff *skb, int len)
644{ 646{
645 int i, k, eat; 647 int i, k, eat;
646 648
@@ -665,7 +667,6 @@ static unsigned char *__pskb_trim_head(struct sk_buff *skb, int len)
665 skb->tail = skb->data; 667 skb->tail = skb->data;
666 skb->data_len -= len; 668 skb->data_len -= len;
667 skb->len = skb->data_len; 669 skb->len = skb->data_len;
668 return skb->tail;
669} 670}
670 671
671int tcp_trim_head(struct sock *sk, struct sk_buff *skb, u32 len) 672int tcp_trim_head(struct sock *sk, struct sk_buff *skb, u32 len)
@@ -674,12 +675,11 @@ int tcp_trim_head(struct sock *sk, struct sk_buff *skb, u32 len)
674 pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) 675 pskb_expand_head(skb, 0, 0, GFP_ATOMIC))
675 return -ENOMEM; 676 return -ENOMEM;
676 677
677 if (len <= skb_headlen(skb)) { 678 /* If len == headlen, we avoid __skb_pull to preserve alignment. */
679 if (unlikely(len < skb_headlen(skb)))
678 __skb_pull(skb, len); 680 __skb_pull(skb, len);
679 } else { 681 else
680 if (__pskb_trim_head(skb, len-skb_headlen(skb)) == NULL) 682 __pskb_trim_head(skb, len - skb_headlen(skb));
681 return -ENOMEM;
682 }
683 683
684 TCP_SKB_CB(skb)->seq += len; 684 TCP_SKB_CB(skb)->seq += len;
685 skb->ip_summed = CHECKSUM_HW; 685 skb->ip_summed = CHECKSUM_HW;
@@ -1040,7 +1040,8 @@ static int tso_fragment(struct sock *sk, struct sk_buff *skb, unsigned int len,
1040 if (unlikely(buff == NULL)) 1040 if (unlikely(buff == NULL))
1041 return -ENOMEM; 1041 return -ENOMEM;
1042 1042
1043 buff->truesize = nlen; 1043 sk_charge_skb(sk, buff);
1044 buff->truesize += nlen;
1044 skb->truesize -= nlen; 1045 skb->truesize -= nlen;
1045 1046
1046 /* Correct the sequence numbers. */ 1047 /* Correct the sequence numbers. */
diff --git a/net/ipv4/xfrm4_output.c b/net/ipv4/xfrm4_output.c
index 32ad229b4fed..4ef8efaf6a67 100644
--- a/net/ipv4/xfrm4_output.c
+++ b/net/ipv4/xfrm4_output.c
@@ -62,7 +62,7 @@ static void xfrm4_encap(struct sk_buff *skb)
62 top_iph->frag_off = (flags & XFRM_STATE_NOPMTUDISC) ? 62 top_iph->frag_off = (flags & XFRM_STATE_NOPMTUDISC) ?
63 0 : (iph->frag_off & htons(IP_DF)); 63 0 : (iph->frag_off & htons(IP_DF));
64 if (!top_iph->frag_off) 64 if (!top_iph->frag_off)
65 __ip_select_ident(top_iph, dst, 0); 65 __ip_select_ident(top_iph, dst->child, 0);
66 66
67 top_iph->ttl = dst_metric(dst->child, RTAX_HOPLIMIT); 67 top_iph->ttl = dst_metric(dst->child, RTAX_HOPLIMIT);
68 68
diff --git a/net/ipv4/xfrm4_policy.c b/net/ipv4/xfrm4_policy.c
index f285bbf296e2..8604c747bca5 100644
--- a/net/ipv4/xfrm4_policy.c
+++ b/net/ipv4/xfrm4_policy.c
@@ -221,7 +221,7 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl)
221 if (pskb_may_pull(skb, xprth + 4 - skb->data)) { 221 if (pskb_may_pull(skb, xprth + 4 - skb->data)) {
222 u16 *ipcomp_hdr = (u16 *)xprth; 222 u16 *ipcomp_hdr = (u16 *)xprth;
223 223
224 fl->fl_ipsec_spi = ntohl(ntohs(ipcomp_hdr[1])); 224 fl->fl_ipsec_spi = htonl(ntohs(ipcomp_hdr[1]));
225 } 225 }
226 break; 226 break;
227 default: 227 default:
diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c
index 2a1e7e45b890..a18d4256372c 100644
--- a/net/ipv6/exthdrs.c
+++ b/net/ipv6/exthdrs.c
@@ -485,15 +485,27 @@ static struct tlvtype_proc tlvprochopopt_lst[] = {
485 { -1, } 485 { -1, }
486}; 486};
487 487
488int ipv6_parse_hopopts(struct sk_buff *skb, int nhoff) 488int ipv6_parse_hopopts(struct sk_buff *skb)
489{ 489{
490 struct inet6_skb_parm *opt = IP6CB(skb); 490 struct inet6_skb_parm *opt = IP6CB(skb);
491 491
492 /*
493 * skb->nh.raw is equal to skb->data, and
494 * skb->h.raw - skb->nh.raw is always equal to
495 * sizeof(struct ipv6hdr) by definition of
496 * hop-by-hop options.
497 */
498 if (!pskb_may_pull(skb, sizeof(struct ipv6hdr) + 8) ||
499 !pskb_may_pull(skb, sizeof(struct ipv6hdr) + ((skb->h.raw[1] + 1) << 3))) {
500 kfree_skb(skb);
501 return -1;
502 }
503
492 opt->hop = sizeof(struct ipv6hdr); 504 opt->hop = sizeof(struct ipv6hdr);
493 if (ip6_parse_tlv(tlvprochopopt_lst, skb)) { 505 if (ip6_parse_tlv(tlvprochopopt_lst, skb)) {
494 skb->h.raw += (skb->h.raw[1]+1)<<3; 506 skb->h.raw += (skb->h.raw[1]+1)<<3;
495 opt->nhoff = sizeof(struct ipv6hdr); 507 opt->nhoff = sizeof(struct ipv6hdr);
496 return sizeof(struct ipv6hdr); 508 return 1;
497 } 509 }
498 return -1; 510 return -1;
499} 511}
diff --git a/net/ipv6/inet6_connection_sock.c b/net/ipv6/inet6_connection_sock.c
index f8f3a37a1494..eb2865d5ae28 100644
--- a/net/ipv6/inet6_connection_sock.c
+++ b/net/ipv6/inet6_connection_sock.c
@@ -173,6 +173,7 @@ int inet6_csk_xmit(struct sk_buff *skb, int ipfragok)
173 173
174 if (err) { 174 if (err) {
175 sk->sk_err_soft = -err; 175 sk->sk_err_soft = -err;
176 kfree_skb(skb);
176 return err; 177 return err;
177 } 178 }
178 179
@@ -181,6 +182,7 @@ int inet6_csk_xmit(struct sk_buff *skb, int ipfragok)
181 182
182 if ((err = xfrm_lookup(&dst, &fl, sk, 0)) < 0) { 183 if ((err = xfrm_lookup(&dst, &fl, sk, 0)) < 0) {
183 sk->sk_route_caps = 0; 184 sk->sk_route_caps = 0;
185 kfree_skb(skb);
184 return err; 186 return err;
185 } 187 }
186 188
diff --git a/net/ipv6/ip6_input.c b/net/ipv6/ip6_input.c
index 29f73592e68e..aceee252503d 100644
--- a/net/ipv6/ip6_input.c
+++ b/net/ipv6/ip6_input.c
@@ -114,11 +114,10 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
114 } 114 }
115 115
116 if (hdr->nexthdr == NEXTHDR_HOP) { 116 if (hdr->nexthdr == NEXTHDR_HOP) {
117 if (ipv6_parse_hopopts(skb, IP6CB(skb)->nhoff) < 0) { 117 if (ipv6_parse_hopopts(skb) < 0) {
118 IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS); 118 IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
119 return 0; 119 return 0;
120 } 120 }
121 hdr = skb->nh.ipv6h;
122 } 121 }
123 122
124 return NF_HOOK(PF_INET6,NF_IP6_PRE_ROUTING, skb, dev, NULL, ip6_rcv_finish); 123 return NF_HOOK(PF_INET6,NF_IP6_PRE_ROUTING, skb, dev, NULL, ip6_rcv_finish);
diff --git a/net/ipv6/ipcomp6.c b/net/ipv6/ipcomp6.c
index 05eb67def39f..48636436028a 100644
--- a/net/ipv6/ipcomp6.c
+++ b/net/ipv6/ipcomp6.c
@@ -208,7 +208,7 @@ static void ipcomp6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
208 if (type != ICMPV6_DEST_UNREACH && type != ICMPV6_PKT_TOOBIG) 208 if (type != ICMPV6_DEST_UNREACH && type != ICMPV6_PKT_TOOBIG)
209 return; 209 return;
210 210
211 spi = ntohl(ntohs(ipcomph->cpi)); 211 spi = htonl(ntohs(ipcomph->cpi));
212 x = xfrm_state_lookup((xfrm_address_t *)&iph->daddr, spi, IPPROTO_COMP, AF_INET6); 212 x = xfrm_state_lookup((xfrm_address_t *)&iph->daddr, spi, IPPROTO_COMP, AF_INET6);
213 if (!x) 213 if (!x)
214 return; 214 return;
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c
index 642b4b11464f..2e72f89a7019 100644
--- a/net/ipv6/netfilter/ip6_tables.c
+++ b/net/ipv6/netfilter/ip6_tables.c
@@ -288,19 +288,6 @@ ip6t_do_table(struct sk_buff **pskb,
288 table_base = (void *)private->entries[smp_processor_id()]; 288 table_base = (void *)private->entries[smp_processor_id()];
289 e = get_entry(table_base, private->hook_entry[hook]); 289 e = get_entry(table_base, private->hook_entry[hook]);
290 290
291#ifdef CONFIG_NETFILTER_DEBUG
292 /* Check noone else using our table */
293 if (((struct ip6t_entry *)table_base)->comefrom != 0xdead57ac
294 && ((struct ip6t_entry *)table_base)->comefrom != 0xeeeeeeec) {
295 printk("ASSERT: CPU #%u, %s comefrom(%p) = %X\n",
296 smp_processor_id(),
297 table->name,
298 &((struct ip6t_entry *)table_base)->comefrom,
299 ((struct ip6t_entry *)table_base)->comefrom);
300 }
301 ((struct ip6t_entry *)table_base)->comefrom = 0x57acc001;
302#endif
303
304 /* For return from builtin chain */ 291 /* For return from builtin chain */
305 back = get_entry(table_base, private->underflow[hook]); 292 back = get_entry(table_base, private->underflow[hook]);
306 293
@@ -1116,7 +1103,7 @@ do_add_counters(void __user *user, unsigned int len)
1116 1103
1117 write_lock_bh(&t->lock); 1104 write_lock_bh(&t->lock);
1118 private = t->private; 1105 private = t->private;
1119 if (private->number != paddc->num_counters) { 1106 if (private->number != tmp.num_counters) {
1120 ret = -EINVAL; 1107 ret = -EINVAL;
1121 goto unlock_up_free; 1108 goto unlock_up_free;
1122 } 1109 }
diff --git a/net/ipv6/netfilter/ip6t_LOG.c b/net/ipv6/netfilter/ip6t_LOG.c
index a96c0de14b00..73c6300109d6 100644
--- a/net/ipv6/netfilter/ip6t_LOG.c
+++ b/net/ipv6/netfilter/ip6t_LOG.c
@@ -439,7 +439,7 @@ ip6t_log_target(struct sk_buff **pskb,
439 439
440 if (loginfo->logflags & IP6T_LOG_NFLOG) 440 if (loginfo->logflags & IP6T_LOG_NFLOG)
441 nf_log_packet(PF_INET6, hooknum, *pskb, in, out, &li, 441 nf_log_packet(PF_INET6, hooknum, *pskb, in, out, &li,
442 loginfo->prefix); 442 "%s", loginfo->prefix);
443 else 443 else
444 ip6t_log_packet(PF_INET6, hooknum, *pskb, in, out, &li, 444 ip6t_log_packet(PF_INET6, hooknum, *pskb, in, out, &li,
445 loginfo->prefix); 445 loginfo->prefix);
diff --git a/net/ipv6/netfilter/ip6t_eui64.c b/net/ipv6/netfilter/ip6t_eui64.c
index 94dbdb8b458d..4f6b84c8f4ab 100644
--- a/net/ipv6/netfilter/ip6t_eui64.c
+++ b/net/ipv6/netfilter/ip6t_eui64.c
@@ -40,7 +40,7 @@ match(const struct sk_buff *skb,
40 40
41 memset(eui64, 0, sizeof(eui64)); 41 memset(eui64, 0, sizeof(eui64));
42 42
43 if (eth_hdr(skb)->h_proto == ntohs(ETH_P_IPV6)) { 43 if (eth_hdr(skb)->h_proto == htons(ETH_P_IPV6)) {
44 if (skb->nh.ipv6h->version == 0x6) { 44 if (skb->nh.ipv6h->version == 0x6) {
45 memcpy(eui64, eth_hdr(skb)->h_source, 3); 45 memcpy(eui64, eth_hdr(skb)->h_source, 3);
46 memcpy(eui64 + 5, eth_hdr(skb)->h_source + 3, 3); 46 memcpy(eui64 + 5, eth_hdr(skb)->h_source + 3, 3);
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 79078747a646..8a777932786d 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -280,10 +280,13 @@ static int inline rt6_check_neigh(struct rt6_info *rt)
280{ 280{
281 struct neighbour *neigh = rt->rt6i_nexthop; 281 struct neighbour *neigh = rt->rt6i_nexthop;
282 int m = 0; 282 int m = 0;
283 if (neigh) { 283 if (rt->rt6i_flags & RTF_NONEXTHOP ||
284 !(rt->rt6i_flags & RTF_GATEWAY))
285 m = 1;
286 else if (neigh) {
284 read_lock_bh(&neigh->lock); 287 read_lock_bh(&neigh->lock);
285 if (neigh->nud_state & NUD_VALID) 288 if (neigh->nud_state & NUD_VALID)
286 m = 1; 289 m = 2;
287 read_unlock_bh(&neigh->lock); 290 read_unlock_bh(&neigh->lock);
288 } 291 }
289 return m; 292 return m;
@@ -292,15 +295,18 @@ static int inline rt6_check_neigh(struct rt6_info *rt)
292static int rt6_score_route(struct rt6_info *rt, int oif, 295static int rt6_score_route(struct rt6_info *rt, int oif,
293 int strict) 296 int strict)
294{ 297{
295 int m = rt6_check_dev(rt, oif); 298 int m, n;
299
300 m = rt6_check_dev(rt, oif);
296 if (!m && (strict & RT6_SELECT_F_IFACE)) 301 if (!m && (strict & RT6_SELECT_F_IFACE))
297 return -1; 302 return -1;
298#ifdef CONFIG_IPV6_ROUTER_PREF 303#ifdef CONFIG_IPV6_ROUTER_PREF
299 m |= IPV6_DECODE_PREF(IPV6_EXTRACT_PREF(rt->rt6i_flags)) << 2; 304 m |= IPV6_DECODE_PREF(IPV6_EXTRACT_PREF(rt->rt6i_flags)) << 2;
300#endif 305#endif
301 if (rt6_check_neigh(rt)) 306 n = rt6_check_neigh(rt);
307 if (n > 1)
302 m |= 16; 308 m |= 16;
303 else if (strict & RT6_SELECT_F_REACHABLE) 309 else if (!n && strict & RT6_SELECT_F_REACHABLE)
304 return -1; 310 return -1;
305 return m; 311 return m;
306} 312}
@@ -317,7 +323,7 @@ static struct rt6_info *rt6_select(struct rt6_info **head, int oif,
317 __FUNCTION__, head, head ? *head : NULL, oif); 323 __FUNCTION__, head, head ? *head : NULL, oif);
318 324
319 for (rt = rt0, metric = rt0->rt6i_metric; 325 for (rt = rt0, metric = rt0->rt6i_metric;
320 rt && rt->rt6i_metric == metric; 326 rt && rt->rt6i_metric == metric && (!last || rt != rt0);
321 rt = rt->u.next) { 327 rt = rt->u.next) {
322 int m; 328 int m;
323 329
@@ -343,9 +349,12 @@ static struct rt6_info *rt6_select(struct rt6_info **head, int oif,
343 (strict & RT6_SELECT_F_REACHABLE) && 349 (strict & RT6_SELECT_F_REACHABLE) &&
344 last && last != rt0) { 350 last && last != rt0) {
345 /* no entries matched; do round-robin */ 351 /* no entries matched; do round-robin */
352 static spinlock_t lock = SPIN_LOCK_UNLOCKED;
353 spin_lock(&lock);
346 *head = rt0->u.next; 354 *head = rt0->u.next;
347 rt0->u.next = last->u.next; 355 rt0->u.next = last->u.next;
348 last->u.next = rt0; 356 last->u.next = rt0;
357 spin_unlock(&lock);
349 } 358 }
350 359
351 RT6_TRACE("%s() => %p, score=%d\n", 360 RT6_TRACE("%s() => %p, score=%d\n",
diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c
index 91cce8b2d7a5..88c840f1beb6 100644
--- a/net/ipv6/xfrm6_policy.c
+++ b/net/ipv6/xfrm6_policy.c
@@ -191,16 +191,18 @@ error:
191static inline void 191static inline void
192_decode_session6(struct sk_buff *skb, struct flowi *fl) 192_decode_session6(struct sk_buff *skb, struct flowi *fl)
193{ 193{
194 u16 offset = sizeof(struct ipv6hdr); 194 u16 offset = skb->h.raw - skb->nh.raw;
195 struct ipv6hdr *hdr = skb->nh.ipv6h; 195 struct ipv6hdr *hdr = skb->nh.ipv6h;
196 struct ipv6_opt_hdr *exthdr = (struct ipv6_opt_hdr*)(skb->nh.raw + offset); 196 struct ipv6_opt_hdr *exthdr;
197 u8 nexthdr = skb->nh.ipv6h->nexthdr; 197 u8 nexthdr = skb->nh.raw[IP6CB(skb)->nhoff];
198 198
199 memset(fl, 0, sizeof(struct flowi)); 199 memset(fl, 0, sizeof(struct flowi));
200 ipv6_addr_copy(&fl->fl6_dst, &hdr->daddr); 200 ipv6_addr_copy(&fl->fl6_dst, &hdr->daddr);
201 ipv6_addr_copy(&fl->fl6_src, &hdr->saddr); 201 ipv6_addr_copy(&fl->fl6_src, &hdr->saddr);
202 202
203 while (pskb_may_pull(skb, skb->nh.raw + offset + 1 - skb->data)) { 203 while (pskb_may_pull(skb, skb->nh.raw + offset + 1 - skb->data)) {
204 exthdr = (struct ipv6_opt_hdr*)(skb->nh.raw + offset);
205
204 switch (nexthdr) { 206 switch (nexthdr) {
205 case NEXTHDR_ROUTING: 207 case NEXTHDR_ROUTING:
206 case NEXTHDR_HOP: 208 case NEXTHDR_HOP:
diff --git a/net/ipx/af_ipx.c b/net/ipx/af_ipx.c
index 2dbf134d5266..811d998725bc 100644
--- a/net/ipx/af_ipx.c
+++ b/net/ipx/af_ipx.c
@@ -944,9 +944,9 @@ out:
944 return rc; 944 return rc;
945} 945}
946 946
947static int ipx_map_frame_type(unsigned char type) 947static __be16 ipx_map_frame_type(unsigned char type)
948{ 948{
949 int rc = 0; 949 __be16 rc = 0;
950 950
951 switch (type) { 951 switch (type) {
952 case IPX_FRAME_ETHERII: rc = htons(ETH_P_IPX); break; 952 case IPX_FRAME_ETHERII: rc = htons(ETH_P_IPX); break;
diff --git a/net/ipx/ipx_route.c b/net/ipx/ipx_route.c
index 67774448efd9..a394c6fe19a2 100644
--- a/net/ipx/ipx_route.c
+++ b/net/ipx/ipx_route.c
@@ -119,7 +119,7 @@ out:
119 return rc; 119 return rc;
120} 120}
121 121
122static int ipxrtr_delete(long net) 122static int ipxrtr_delete(__u32 net)
123{ 123{
124 struct ipx_route *r, *tmp; 124 struct ipx_route *r, *tmp;
125 int rc; 125 int rc;
diff --git a/net/irda/iriap.c b/net/irda/iriap.c
index 254f90746900..2d2e2b1919f4 100644
--- a/net/irda/iriap.c
+++ b/net/irda/iriap.c
@@ -544,7 +544,8 @@ static void iriap_getvaluebyclass_response(struct iriap_cb *self,
544{ 544{
545 struct sk_buff *tx_skb; 545 struct sk_buff *tx_skb;
546 int n; 546 int n;
547 __u32 tmp_be32, tmp_be16; 547 __u32 tmp_be32;
548 __be16 tmp_be16;
548 __u8 *fp; 549 __u8 *fp;
549 550
550 IRDA_DEBUG(4, "%s()\n", __FUNCTION__); 551 IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
diff --git a/net/irda/irias_object.c b/net/irda/irias_object.c
index c6d169fbdceb..82e665c79991 100644
--- a/net/irda/irias_object.c
+++ b/net/irda/irias_object.c
@@ -257,7 +257,6 @@ struct ias_attrib *irias_find_attrib(struct ias_object *obj, char *name)
257 /* Unsafe (locking), attrib might change */ 257 /* Unsafe (locking), attrib might change */
258 return attrib; 258 return attrib;
259} 259}
260EXPORT_SYMBOL(irias_find_attrib);
261 260
262/* 261/*
263 * Function irias_add_attribute (obj, attrib) 262 * Function irias_add_attribute (obj, attrib)
@@ -484,7 +483,6 @@ struct ias_value *irias_new_string_value(char *string)
484 483
485 return value; 484 return value;
486} 485}
487EXPORT_SYMBOL(irias_new_string_value);
488 486
489/* 487/*
490 * Function irias_new_octseq_value (octets, len) 488 * Function irias_new_octseq_value (octets, len)
@@ -519,7 +517,6 @@ struct ias_value *irias_new_octseq_value(__u8 *octseq , int len)
519 memcpy(value->t.oct_seq, octseq , len); 517 memcpy(value->t.oct_seq, octseq , len);
520 return value; 518 return value;
521} 519}
522EXPORT_SYMBOL(irias_new_octseq_value);
523 520
524struct ias_value *irias_new_missing_value(void) 521struct ias_value *irias_new_missing_value(void)
525{ 522{
diff --git a/net/irda/irlap.c b/net/irda/irlap.c
index 7029618f5719..a16528657b4c 100644
--- a/net/irda/irlap.c
+++ b/net/irda/irlap.c
@@ -884,7 +884,8 @@ static void irlap_change_speed(struct irlap_cb *self, __u32 speed, int now)
884 if (now) { 884 if (now) {
885 /* Send down empty frame to trigger speed change */ 885 /* Send down empty frame to trigger speed change */
886 skb = dev_alloc_skb(0); 886 skb = dev_alloc_skb(0);
887 irlap_queue_xmit(self, skb); 887 if (skb)
888 irlap_queue_xmit(self, skb);
888 } 889 }
889} 890}
890 891
diff --git a/net/llc/llc_input.c b/net/llc/llc_input.c
index 8f3addf0724c..d62e0f9b9da3 100644
--- a/net/llc/llc_input.c
+++ b/net/llc/llc_input.c
@@ -118,7 +118,8 @@ static inline int llc_fixup_skb(struct sk_buff *skb)
118 u16 pdulen = eth_hdr(skb)->h_proto, 118 u16 pdulen = eth_hdr(skb)->h_proto,
119 data_size = ntohs(pdulen) - llc_len; 119 data_size = ntohs(pdulen) - llc_len;
120 120
121 skb_trim(skb, data_size); 121 if (unlikely(pskb_trim_rcsum(skb, data_size)))
122 return 0;
122 } 123 }
123 return 1; 124 return 1;
124} 125}
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
index e581190fb6c3..f9b83f91371a 100644
--- a/net/netfilter/nf_conntrack_core.c
+++ b/net/netfilter/nf_conntrack_core.c
@@ -178,9 +178,6 @@ static struct {
178 /* allocated slab cache + modules which uses this slab cache */ 178 /* allocated slab cache + modules which uses this slab cache */
179 int use; 179 int use;
180 180
181 /* Initialization */
182 int (*init_conntrack)(struct nf_conn *, u_int32_t);
183
184} nf_ct_cache[NF_CT_F_NUM]; 181} nf_ct_cache[NF_CT_F_NUM];
185 182
186/* protect members of nf_ct_cache except of "use" */ 183/* protect members of nf_ct_cache except of "use" */
@@ -208,10 +205,8 @@ nf_ct_proto_find_get(u_int16_t l3proto, u_int8_t protocol)
208 205
209 preempt_disable(); 206 preempt_disable();
210 p = __nf_ct_proto_find(l3proto, protocol); 207 p = __nf_ct_proto_find(l3proto, protocol);
211 if (p) { 208 if (!try_module_get(p->me))
212 if (!try_module_get(p->me)) 209 p = &nf_conntrack_generic_protocol;
213 p = &nf_conntrack_generic_protocol;
214 }
215 preempt_enable(); 210 preempt_enable();
216 211
217 return p; 212 return p;
@@ -229,10 +224,8 @@ nf_ct_l3proto_find_get(u_int16_t l3proto)
229 224
230 preempt_disable(); 225 preempt_disable();
231 p = __nf_ct_l3proto_find(l3proto); 226 p = __nf_ct_l3proto_find(l3proto);
232 if (p) { 227 if (!try_module_get(p->me))
233 if (!try_module_get(p->me)) 228 p = &nf_conntrack_generic_l3proto;
234 p = &nf_conntrack_generic_l3proto;
235 }
236 preempt_enable(); 229 preempt_enable();
237 230
238 return p; 231 return p;
diff --git a/net/netfilter/nf_conntrack_l3proto_generic.c b/net/netfilter/nf_conntrack_l3proto_generic.c
index 7de4f06c63c5..3fc58e454d4e 100644
--- a/net/netfilter/nf_conntrack_l3proto_generic.c
+++ b/net/netfilter/nf_conntrack_l3proto_generic.c
@@ -94,5 +94,4 @@ struct nf_conntrack_l3proto nf_conntrack_generic_l3proto = {
94 .print_conntrack = generic_print_conntrack, 94 .print_conntrack = generic_print_conntrack,
95 .prepare = generic_prepare, 95 .prepare = generic_prepare,
96 .get_features = generic_get_features, 96 .get_features = generic_get_features,
97 .me = THIS_MODULE,
98}; 97};
diff --git a/net/netfilter/nf_conntrack_proto_sctp.c b/net/netfilter/nf_conntrack_proto_sctp.c
index 9cccc325b687..0c6da496cfa9 100644
--- a/net/netfilter/nf_conntrack_proto_sctp.c
+++ b/net/netfilter/nf_conntrack_proto_sctp.c
@@ -240,12 +240,15 @@ static int do_basic_checks(struct nf_conn *conntrack,
240 flag = 1; 240 flag = 1;
241 } 241 }
242 242
243 /* Cookie Ack/Echo chunks not the first OR 243 /*
244 Init / Init Ack / Shutdown compl chunks not the only chunks */ 244 * Cookie Ack/Echo chunks not the first OR
245 if ((sch->type == SCTP_CID_COOKIE_ACK 245 * Init / Init Ack / Shutdown compl chunks not the only chunks
246 * OR zero-length.
247 */
248 if (((sch->type == SCTP_CID_COOKIE_ACK
246 || sch->type == SCTP_CID_COOKIE_ECHO 249 || sch->type == SCTP_CID_COOKIE_ECHO
247 || flag) 250 || flag)
248 && count !=0 ) { 251 && count !=0) || !sch->length) {
249 DEBUGP("Basic checks failed\n"); 252 DEBUGP("Basic checks failed\n");
250 return 1; 253 return 1;
251 } 254 }
diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c
index c60273cad778..61cdda4e5d3b 100644
--- a/net/netfilter/nfnetlink_log.c
+++ b/net/netfilter/nfnetlink_log.c
@@ -321,7 +321,7 @@ static int
321nfulnl_set_flags(struct nfulnl_instance *inst, u_int16_t flags) 321nfulnl_set_flags(struct nfulnl_instance *inst, u_int16_t flags)
322{ 322{
323 spin_lock_bh(&inst->lock); 323 spin_lock_bh(&inst->lock);
324 inst->flags = ntohs(flags); 324 inst->flags = flags;
325 spin_unlock_bh(&inst->lock); 325 spin_unlock_bh(&inst->lock);
326 326
327 return 0; 327 return 0;
@@ -902,7 +902,7 @@ nfulnl_recv_config(struct sock *ctnl, struct sk_buff *skb,
902 if (nfula[NFULA_CFG_FLAGS-1]) { 902 if (nfula[NFULA_CFG_FLAGS-1]) {
903 u_int16_t flags = 903 u_int16_t flags =
904 *(u_int16_t *)NFA_DATA(nfula[NFULA_CFG_FLAGS-1]); 904 *(u_int16_t *)NFA_DATA(nfula[NFULA_CFG_FLAGS-1]);
905 nfulnl_set_flags(inst, ntohl(flags)); 905 nfulnl_set_flags(inst, ntohs(flags));
906 } 906 }
907 907
908out_put: 908out_put:
diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c
index 00cf0a4f4d92..99293c63ff73 100644
--- a/net/netfilter/x_tables.c
+++ b/net/netfilter/x_tables.c
@@ -289,7 +289,7 @@ int xt_compat_match(void *match, void **dstptr, int *size, int convert)
289 case COMPAT_TO_USER: 289 case COMPAT_TO_USER:
290 pm = (struct xt_entry_match *)match; 290 pm = (struct xt_entry_match *)match;
291 msize = pm->u.user.match_size; 291 msize = pm->u.user.match_size;
292 if (__copy_to_user(*dstptr, pm, msize)) { 292 if (copy_to_user(*dstptr, pm, msize)) {
293 ret = -EFAULT; 293 ret = -EFAULT;
294 break; 294 break;
295 } 295 }
@@ -366,7 +366,7 @@ int xt_compat_target(void *target, void **dstptr, int *size, int convert)
366 case COMPAT_TO_USER: 366 case COMPAT_TO_USER:
367 pt = (struct xt_entry_target *)target; 367 pt = (struct xt_entry_target *)target;
368 tsize = pt->u.user.target_size; 368 tsize = pt->u.user.target_size;
369 if (__copy_to_user(*dstptr, pt, tsize)) { 369 if (copy_to_user(*dstptr, pt, tsize)) {
370 ret = -EFAULT; 370 ret = -EFAULT;
371 break; 371 break;
372 } 372 }
@@ -529,6 +529,7 @@ int xt_register_table(struct xt_table *table,
529 529
530 /* Simplifies replace_table code. */ 530 /* Simplifies replace_table code. */
531 table->private = bootstrap; 531 table->private = bootstrap;
532 rwlock_init(&table->lock);
532 if (!xt_replace_table(table, 0, newinfo, &ret)) 533 if (!xt_replace_table(table, 0, newinfo, &ret))
533 goto unlock; 534 goto unlock;
534 535
@@ -538,7 +539,6 @@ int xt_register_table(struct xt_table *table,
538 /* save number of initial entries */ 539 /* save number of initial entries */
539 private->initial_entries = private->number; 540 private->initial_entries = private->number;
540 541
541 rwlock_init(&table->lock);
542 list_prepend(&xt[table->af].tables, table); 542 list_prepend(&xt[table->af].tables, table);
543 543
544 ret = 0; 544 ret = 0;
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index 2a233ffcf618..3862e73d14d7 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -56,12 +56,12 @@
56#include <linux/mm.h> 56#include <linux/mm.h>
57#include <linux/types.h> 57#include <linux/types.h>
58#include <linux/audit.h> 58#include <linux/audit.h>
59#include <linux/selinux.h>
59 60
60#include <net/sock.h> 61#include <net/sock.h>
61#include <net/scm.h> 62#include <net/scm.h>
62#include <net/netlink.h> 63#include <net/netlink.h>
63 64
64#define Nprintk(a...)
65#define NLGRPSZ(x) (ALIGN(x, sizeof(unsigned long) * 8) / 8) 65#define NLGRPSZ(x) (ALIGN(x, sizeof(unsigned long) * 8) / 8)
66 66
67struct netlink_sock { 67struct netlink_sock {
@@ -1157,6 +1157,7 @@ static int netlink_sendmsg(struct kiocb *kiocb, struct socket *sock,
1157 NETLINK_CB(skb).dst_pid = dst_pid; 1157 NETLINK_CB(skb).dst_pid = dst_pid;
1158 NETLINK_CB(skb).dst_group = dst_group; 1158 NETLINK_CB(skb).dst_group = dst_group;
1159 NETLINK_CB(skb).loginuid = audit_get_loginuid(current->audit_context); 1159 NETLINK_CB(skb).loginuid = audit_get_loginuid(current->audit_context);
1160 selinux_get_task_sid(current, &(NETLINK_CB(skb).sid));
1160 memcpy(NETLINK_CREDS(skb), &siocb->scm->creds, sizeof(struct ucred)); 1161 memcpy(NETLINK_CREDS(skb), &siocb->scm->creds, sizeof(struct ucred));
1161 1162
1162 /* What can I do? Netlink is asynchronous, so that 1163 /* What can I do? Netlink is asynchronous, so that
diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c
index d44981f5a619..3669cb953e6e 100644
--- a/net/netrom/af_netrom.c
+++ b/net/netrom/af_netrom.c
@@ -425,11 +425,16 @@ static int nr_create(struct socket *sock, int protocol)
425 425
426 nr_init_timers(sk); 426 nr_init_timers(sk);
427 427
428 nr->t1 = sysctl_netrom_transport_timeout; 428 nr->t1 =
429 nr->t2 = sysctl_netrom_transport_acknowledge_delay; 429 msecs_to_jiffies(sysctl_netrom_transport_timeout);
430 nr->n2 = sysctl_netrom_transport_maximum_tries; 430 nr->t2 =
431 nr->t4 = sysctl_netrom_transport_busy_delay; 431 msecs_to_jiffies(sysctl_netrom_transport_acknowledge_delay);
432 nr->idle = sysctl_netrom_transport_no_activity_timeout; 432 nr->n2 =
433 msecs_to_jiffies(sysctl_netrom_transport_maximum_tries);
434 nr->t4 =
435 msecs_to_jiffies(sysctl_netrom_transport_busy_delay);
436 nr->idle =
437 msecs_to_jiffies(sysctl_netrom_transport_no_activity_timeout);
433 nr->window = sysctl_netrom_transport_requested_window_size; 438 nr->window = sysctl_netrom_transport_requested_window_size;
434 439
435 nr->bpqext = 1; 440 nr->bpqext = 1;
@@ -1365,8 +1370,6 @@ static struct notifier_block nr_dev_notifier = {
1365 1370
1366static struct net_device **dev_nr; 1371static struct net_device **dev_nr;
1367 1372
1368static char banner[] __initdata = KERN_INFO "G4KLX NET/ROM for Linux. Version 0.7 for AX25.037 Linux 2.4\n";
1369
1370static int __init nr_proto_init(void) 1373static int __init nr_proto_init(void)
1371{ 1374{
1372 int i; 1375 int i;
@@ -1414,7 +1417,6 @@ static int __init nr_proto_init(void)
1414 } 1417 }
1415 1418
1416 register_netdevice_notifier(&nr_dev_notifier); 1419 register_netdevice_notifier(&nr_dev_notifier);
1417 printk(banner);
1418 1420
1419 ax25_protocol_register(AX25_P_NETROM, nr_route_frame); 1421 ax25_protocol_register(AX25_P_NETROM, nr_route_frame);
1420 ax25_linkfail_register(nr_link_failed); 1422 ax25_linkfail_register(nr_link_failed);
diff --git a/net/netrom/nr_dev.c b/net/netrom/nr_dev.c
index 509afddae569..621e5586ab03 100644
--- a/net/netrom/nr_dev.c
+++ b/net/netrom/nr_dev.c
@@ -185,7 +185,6 @@ static struct net_device_stats *nr_get_stats(struct net_device *dev)
185 185
186void nr_setup(struct net_device *dev) 186void nr_setup(struct net_device *dev)
187{ 187{
188 SET_MODULE_OWNER(dev);
189 dev->mtu = NR_MAX_PACKET_SIZE; 188 dev->mtu = NR_MAX_PACKET_SIZE;
190 dev->hard_start_xmit = nr_xmit; 189 dev->hard_start_xmit = nr_xmit;
191 dev->open = nr_open; 190 dev->open = nr_open;
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c
index ea65396d1619..55564efccf11 100644
--- a/net/rose/af_rose.c
+++ b/net/rose/af_rose.c
@@ -518,11 +518,11 @@ static int rose_create(struct socket *sock, int protocol)
518 init_timer(&rose->timer); 518 init_timer(&rose->timer);
519 init_timer(&rose->idletimer); 519 init_timer(&rose->idletimer);
520 520
521 rose->t1 = sysctl_rose_call_request_timeout; 521 rose->t1 = msecs_to_jiffies(sysctl_rose_call_request_timeout);
522 rose->t2 = sysctl_rose_reset_request_timeout; 522 rose->t2 = msecs_to_jiffies(sysctl_rose_reset_request_timeout);
523 rose->t3 = sysctl_rose_clear_request_timeout; 523 rose->t3 = msecs_to_jiffies(sysctl_rose_clear_request_timeout);
524 rose->hb = sysctl_rose_ack_hold_back_timeout; 524 rose->hb = msecs_to_jiffies(sysctl_rose_ack_hold_back_timeout);
525 rose->idle = sysctl_rose_no_activity_timeout; 525 rose->idle = msecs_to_jiffies(sysctl_rose_no_activity_timeout);
526 526
527 rose->state = ROSE_STATE_0; 527 rose->state = ROSE_STATE_0;
528 528
@@ -1469,8 +1469,6 @@ static struct notifier_block rose_dev_notifier = {
1469 1469
1470static struct net_device **dev_rose; 1470static struct net_device **dev_rose;
1471 1471
1472static const char banner[] = KERN_INFO "F6FBB/G4KLX ROSE for Linux. Version 0.62 for AX25.037 Linux 2.4\n";
1473
1474static int __init rose_proto_init(void) 1472static int __init rose_proto_init(void)
1475{ 1473{
1476 int i; 1474 int i;
@@ -1519,7 +1517,6 @@ static int __init rose_proto_init(void)
1519 1517
1520 sock_register(&rose_family_ops); 1518 sock_register(&rose_family_ops);
1521 register_netdevice_notifier(&rose_dev_notifier); 1519 register_netdevice_notifier(&rose_dev_notifier);
1522 printk(banner);
1523 1520
1524 ax25_protocol_register(AX25_P_ROSE, rose_route_frame); 1521 ax25_protocol_register(AX25_P_ROSE, rose_route_frame);
1525 ax25_linkfail_register(rose_link_failed); 1522 ax25_linkfail_register(rose_link_failed);
diff --git a/net/rose/rose_dev.c b/net/rose/rose_dev.c
index d297af737d10..2a1bf8e119e5 100644
--- a/net/rose/rose_dev.c
+++ b/net/rose/rose_dev.c
@@ -135,7 +135,6 @@ static struct net_device_stats *rose_get_stats(struct net_device *dev)
135 135
136void rose_setup(struct net_device *dev) 136void rose_setup(struct net_device *dev)
137{ 137{
138 SET_MODULE_OWNER(dev);
139 dev->mtu = ROSE_MAX_PACKET_SIZE - 2; 138 dev->mtu = ROSE_MAX_PACKET_SIZE - 2;
140 dev->hard_start_xmit = rose_xmit; 139 dev->hard_start_xmit = rose_xmit;
141 dev->open = rose_open; 140 dev->open = rose_open;
diff --git a/net/rose/rose_link.c b/net/rose/rose_link.c
index 09e9e9d04d92..bd86a63960ce 100644
--- a/net/rose/rose_link.c
+++ b/net/rose/rose_link.c
@@ -40,7 +40,8 @@ void rose_start_ftimer(struct rose_neigh *neigh)
40 40
41 neigh->ftimer.data = (unsigned long)neigh; 41 neigh->ftimer.data = (unsigned long)neigh;
42 neigh->ftimer.function = &rose_ftimer_expiry; 42 neigh->ftimer.function = &rose_ftimer_expiry;
43 neigh->ftimer.expires = jiffies + sysctl_rose_link_fail_timeout; 43 neigh->ftimer.expires =
44 jiffies + msecs_to_jiffies(sysctl_rose_link_fail_timeout);
44 45
45 add_timer(&neigh->ftimer); 46 add_timer(&neigh->ftimer);
46} 47}
@@ -51,7 +52,8 @@ static void rose_start_t0timer(struct rose_neigh *neigh)
51 52
52 neigh->t0timer.data = (unsigned long)neigh; 53 neigh->t0timer.data = (unsigned long)neigh;
53 neigh->t0timer.function = &rose_t0timer_expiry; 54 neigh->t0timer.function = &rose_t0timer_expiry;
54 neigh->t0timer.expires = jiffies + sysctl_rose_restart_request_timeout; 55 neigh->t0timer.expires =
56 jiffies + msecs_to_jiffies(sysctl_rose_restart_request_timeout);
55 57
56 add_timer(&neigh->t0timer); 58 add_timer(&neigh->t0timer);
57} 59}
diff --git a/net/rose/rose_route.c b/net/rose/rose_route.c
index 8631b65a7312..a22542fa1bc8 100644
--- a/net/rose/rose_route.c
+++ b/net/rose/rose_route.c
@@ -48,8 +48,6 @@ static DEFINE_SPINLOCK(rose_route_list_lock);
48 48
49struct rose_neigh *rose_loopback_neigh; 49struct rose_neigh *rose_loopback_neigh;
50 50
51static void rose_remove_neigh(struct rose_neigh *);
52
53/* 51/*
54 * Add a new route to a node, and in the process add the node and the 52 * Add a new route to a node, and in the process add the node and the
55 * neighbour if it is new. 53 * neighbour if it is new.
@@ -235,11 +233,8 @@ static void rose_remove_neigh(struct rose_neigh *rose_neigh)
235 233
236 skb_queue_purge(&rose_neigh->queue); 234 skb_queue_purge(&rose_neigh->queue);
237 235
238 spin_lock_bh(&rose_neigh_list_lock);
239
240 if ((s = rose_neigh_list) == rose_neigh) { 236 if ((s = rose_neigh_list) == rose_neigh) {
241 rose_neigh_list = rose_neigh->next; 237 rose_neigh_list = rose_neigh->next;
242 spin_unlock_bh(&rose_neigh_list_lock);
243 kfree(rose_neigh->digipeat); 238 kfree(rose_neigh->digipeat);
244 kfree(rose_neigh); 239 kfree(rose_neigh);
245 return; 240 return;
@@ -248,7 +243,6 @@ static void rose_remove_neigh(struct rose_neigh *rose_neigh)
248 while (s != NULL && s->next != NULL) { 243 while (s != NULL && s->next != NULL) {
249 if (s->next == rose_neigh) { 244 if (s->next == rose_neigh) {
250 s->next = rose_neigh->next; 245 s->next = rose_neigh->next;
251 spin_unlock_bh(&rose_neigh_list_lock);
252 kfree(rose_neigh->digipeat); 246 kfree(rose_neigh->digipeat);
253 kfree(rose_neigh); 247 kfree(rose_neigh);
254 return; 248 return;
@@ -256,7 +250,6 @@ static void rose_remove_neigh(struct rose_neigh *rose_neigh)
256 250
257 s = s->next; 251 s = s->next;
258 } 252 }
259 spin_unlock_bh(&rose_neigh_list_lock);
260} 253}
261 254
262/* 255/*
diff --git a/net/sched/act_ipt.c b/net/sched/act_ipt.c
index 6056d20ef429..37640c6fc014 100644
--- a/net/sched/act_ipt.c
+++ b/net/sched/act_ipt.c
@@ -69,6 +69,11 @@ ipt_init_target(struct ipt_entry_target *t, char *table, unsigned int hook)
69 DPRINTK("ipt_init_target: found %s\n", target->name); 69 DPRINTK("ipt_init_target: found %s\n", target->name);
70 t->u.kernel.target = target; 70 t->u.kernel.target = target;
71 71
72 ret = xt_check_target(target, AF_INET, t->u.target_size - sizeof(*t),
73 table, hook, 0, 0);
74 if (ret)
75 return ret;
76
72 if (t->u.kernel.target->checkentry 77 if (t->u.kernel.target->checkentry
73 && !t->u.kernel.target->checkentry(table, NULL, 78 && !t->u.kernel.target->checkentry(table, NULL,
74 t->u.kernel.target, t->data, 79 t->u.kernel.target, t->data,
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index 31eb83717c26..138ea92ed268 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -193,8 +193,10 @@ static void dev_watchdog(unsigned long arg)
193 netif_running(dev) && 193 netif_running(dev) &&
194 netif_carrier_ok(dev)) { 194 netif_carrier_ok(dev)) {
195 if (netif_queue_stopped(dev) && 195 if (netif_queue_stopped(dev) &&
196 (jiffies - dev->trans_start) > dev->watchdog_timeo) { 196 time_after(jiffies, dev->trans_start + dev->watchdog_timeo)) {
197 printk(KERN_INFO "NETDEV WATCHDOG: %s: transmit timed out\n", dev->name); 197
198 printk(KERN_INFO "NETDEV WATCHDOG: %s: transmit timed out\n",
199 dev->name);
198 dev->tx_timeout(dev); 200 dev->tx_timeout(dev);
199 } 201 }
200 if (!mod_timer(&dev->watchdog_timer, jiffies + dev->watchdog_timeo)) 202 if (!mod_timer(&dev->watchdog_timer, jiffies + dev->watchdog_timeo))
diff --git a/net/sched/sch_hfsc.c b/net/sched/sch_hfsc.c
index 91132f6871d7..f1c7bd29f2cd 100644
--- a/net/sched/sch_hfsc.c
+++ b/net/sched/sch_hfsc.c
@@ -974,10 +974,10 @@ hfsc_adjust_levels(struct hfsc_class *cl)
974 do { 974 do {
975 level = 0; 975 level = 0;
976 list_for_each_entry(p, &cl->children, siblings) { 976 list_for_each_entry(p, &cl->children, siblings) {
977 if (p->level > level) 977 if (p->level >= level)
978 level = p->level; 978 level = p->level + 1;
979 } 979 }
980 cl->level = level + 1; 980 cl->level = level;
981 } while ((cl = cl->cl_parent) != NULL); 981 } while ((cl = cl->cl_parent) != NULL);
982} 982}
983 983
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c
index 7228d30512c7..5a4a4d0ae502 100644
--- a/net/sched/sch_netem.c
+++ b/net/sched/sch_netem.c
@@ -167,7 +167,7 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch)
167 if (count == 0) { 167 if (count == 0) {
168 sch->qstats.drops++; 168 sch->qstats.drops++;
169 kfree_skb(skb); 169 kfree_skb(skb);
170 return NET_XMIT_DROP; 170 return NET_XMIT_BYPASS;
171 } 171 }
172 172
173 /* 173 /*
diff --git a/net/sctp/input.c b/net/sctp/input.c
index d117ebc75cf8..1662f9cc869e 100644
--- a/net/sctp/input.c
+++ b/net/sctp/input.c
@@ -73,6 +73,8 @@ static struct sctp_association *__sctp_lookup_association(
73 const union sctp_addr *peer, 73 const union sctp_addr *peer,
74 struct sctp_transport **pt); 74 struct sctp_transport **pt);
75 75
76static void sctp_add_backlog(struct sock *sk, struct sk_buff *skb);
77
76 78
77/* Calculate the SCTP checksum of an SCTP packet. */ 79/* Calculate the SCTP checksum of an SCTP packet. */
78static inline int sctp_rcv_checksum(struct sk_buff *skb) 80static inline int sctp_rcv_checksum(struct sk_buff *skb)
@@ -186,7 +188,6 @@ int sctp_rcv(struct sk_buff *skb)
186 */ 188 */
187 if (sk->sk_bound_dev_if && (sk->sk_bound_dev_if != af->skb_iif(skb))) 189 if (sk->sk_bound_dev_if && (sk->sk_bound_dev_if != af->skb_iif(skb)))
188 { 190 {
189 sock_put(sk);
190 if (asoc) { 191 if (asoc) {
191 sctp_association_put(asoc); 192 sctp_association_put(asoc);
192 asoc = NULL; 193 asoc = NULL;
@@ -197,7 +198,6 @@ int sctp_rcv(struct sk_buff *skb)
197 sk = sctp_get_ctl_sock(); 198 sk = sctp_get_ctl_sock();
198 ep = sctp_sk(sk)->ep; 199 ep = sctp_sk(sk)->ep;
199 sctp_endpoint_hold(ep); 200 sctp_endpoint_hold(ep);
200 sock_hold(sk);
201 rcvr = &ep->base; 201 rcvr = &ep->base;
202 } 202 }
203 203
@@ -253,25 +253,18 @@ int sctp_rcv(struct sk_buff *skb)
253 */ 253 */
254 sctp_bh_lock_sock(sk); 254 sctp_bh_lock_sock(sk);
255 255
256 /* It is possible that the association could have moved to a different
257 * socket if it is peeled off. If so, update the sk.
258 */
259 if (sk != rcvr->sk) {
260 sctp_bh_lock_sock(rcvr->sk);
261 sctp_bh_unlock_sock(sk);
262 sk = rcvr->sk;
263 }
264
265 if (sock_owned_by_user(sk)) 256 if (sock_owned_by_user(sk))
266 sk_add_backlog(sk, skb); 257 sctp_add_backlog(sk, skb);
267 else 258 else
268 sctp_backlog_rcv(sk, skb); 259 sctp_inq_push(&chunk->rcvr->inqueue, chunk);
269 260
270 /* Release the sock and the sock ref we took in the lookup calls.
271 * The asoc/ep ref will be released in sctp_backlog_rcv.
272 */
273 sctp_bh_unlock_sock(sk); 261 sctp_bh_unlock_sock(sk);
274 sock_put(sk); 262
263 /* Release the asoc/ep ref we took in the lookup calls. */
264 if (asoc)
265 sctp_association_put(asoc);
266 else
267 sctp_endpoint_put(ep);
275 268
276 return 0; 269 return 0;
277 270
@@ -280,8 +273,7 @@ discard_it:
280 return 0; 273 return 0;
281 274
282discard_release: 275discard_release:
283 /* Release any structures we may be holding. */ 276 /* Release the asoc/ep ref we took in the lookup calls. */
284 sock_put(sk);
285 if (asoc) 277 if (asoc)
286 sctp_association_put(asoc); 278 sctp_association_put(asoc);
287 else 279 else
@@ -290,56 +282,87 @@ discard_release:
290 goto discard_it; 282 goto discard_it;
291} 283}
292 284
293/* Handle second half of inbound skb processing. If the sock was busy, 285/* Process the backlog queue of the socket. Every skb on
294 * we may have need to delay processing until later when the sock is 286 * the backlog holds a ref on an association or endpoint.
295 * released (on the backlog). If not busy, we call this routine 287 * We hold this ref throughout the state machine to make
296 * directly from the bottom half. 288 * sure that the structure we need is still around.
297 */ 289 */
298int sctp_backlog_rcv(struct sock *sk, struct sk_buff *skb) 290int sctp_backlog_rcv(struct sock *sk, struct sk_buff *skb)
299{ 291{
300 struct sctp_chunk *chunk = SCTP_INPUT_CB(skb)->chunk; 292 struct sctp_chunk *chunk = SCTP_INPUT_CB(skb)->chunk;
301 struct sctp_inq *inqueue = NULL; 293 struct sctp_inq *inqueue = &chunk->rcvr->inqueue;
302 struct sctp_ep_common *rcvr = NULL; 294 struct sctp_ep_common *rcvr = NULL;
295 int backloged = 0;
303 296
304 rcvr = chunk->rcvr; 297 rcvr = chunk->rcvr;
305 298
306 BUG_TRAP(rcvr->sk == sk); 299 /* If the rcvr is dead then the association or endpoint
307 300 * has been deleted and we can safely drop the chunk
308 if (rcvr->dead) { 301 * and refs that we are holding.
309 sctp_chunk_free(chunk); 302 */
310 } else { 303 if (rcvr->dead) {
311 inqueue = &chunk->rcvr->inqueue; 304 sctp_chunk_free(chunk);
312 sctp_inq_push(inqueue, chunk); 305 goto done;
313 } 306 }
314 307
315 /* Release the asoc/ep ref we took in the lookup calls in sctp_rcv. */ 308 if (unlikely(rcvr->sk != sk)) {
316 if (SCTP_EP_TYPE_ASSOCIATION == rcvr->type) 309 /* In this case, the association moved from one socket to
317 sctp_association_put(sctp_assoc(rcvr)); 310 * another. We are currently sitting on the backlog of the
318 else 311 * old socket, so we need to move.
319 sctp_endpoint_put(sctp_ep(rcvr)); 312 * However, since we are here in the process context we
320 313 * need to take make sure that the user doesn't own
314 * the new socket when we process the packet.
315 * If the new socket is user-owned, queue the chunk to the
316 * backlog of the new socket without dropping any refs.
317 * Otherwise, we can safely push the chunk on the inqueue.
318 */
319
320 sk = rcvr->sk;
321 sctp_bh_lock_sock(sk);
322
323 if (sock_owned_by_user(sk)) {
324 sk_add_backlog(sk, skb);
325 backloged = 1;
326 } else
327 sctp_inq_push(inqueue, chunk);
328
329 sctp_bh_unlock_sock(sk);
330
331 /* If the chunk was backloged again, don't drop refs */
332 if (backloged)
333 return 0;
334 } else {
335 sctp_inq_push(inqueue, chunk);
336 }
337
338done:
339 /* Release the refs we took in sctp_add_backlog */
340 if (SCTP_EP_TYPE_ASSOCIATION == rcvr->type)
341 sctp_association_put(sctp_assoc(rcvr));
342 else if (SCTP_EP_TYPE_SOCKET == rcvr->type)
343 sctp_endpoint_put(sctp_ep(rcvr));
344 else
345 BUG();
346
321 return 0; 347 return 0;
322} 348}
323 349
324void sctp_backlog_migrate(struct sctp_association *assoc, 350static void sctp_add_backlog(struct sock *sk, struct sk_buff *skb)
325 struct sock *oldsk, struct sock *newsk)
326{ 351{
327 struct sk_buff *skb; 352 struct sctp_chunk *chunk = SCTP_INPUT_CB(skb)->chunk;
328 struct sctp_chunk *chunk; 353 struct sctp_ep_common *rcvr = chunk->rcvr;
329 354
330 skb = oldsk->sk_backlog.head; 355 /* Hold the assoc/ep while hanging on the backlog queue.
331 oldsk->sk_backlog.head = oldsk->sk_backlog.tail = NULL; 356 * This way, we know structures we need will not disappear from us
332 while (skb != NULL) { 357 */
333 struct sk_buff *next = skb->next; 358 if (SCTP_EP_TYPE_ASSOCIATION == rcvr->type)
334 359 sctp_association_hold(sctp_assoc(rcvr));
335 chunk = SCTP_INPUT_CB(skb)->chunk; 360 else if (SCTP_EP_TYPE_SOCKET == rcvr->type)
336 skb->next = NULL; 361 sctp_endpoint_hold(sctp_ep(rcvr));
337 if (&assoc->base == chunk->rcvr) 362 else
338 sk_add_backlog(newsk, skb); 363 BUG();
339 else 364
340 sk_add_backlog(oldsk, skb); 365 sk_add_backlog(sk, skb);
341 skb = next;
342 }
343} 366}
344 367
345/* Handle icmp frag needed error. */ 368/* Handle icmp frag needed error. */
@@ -412,7 +435,7 @@ struct sock *sctp_err_lookup(int family, struct sk_buff *skb,
412 union sctp_addr daddr; 435 union sctp_addr daddr;
413 struct sctp_af *af; 436 struct sctp_af *af;
414 struct sock *sk = NULL; 437 struct sock *sk = NULL;
415 struct sctp_association *asoc = NULL; 438 struct sctp_association *asoc;
416 struct sctp_transport *transport = NULL; 439 struct sctp_transport *transport = NULL;
417 440
418 *app = NULL; *tpp = NULL; 441 *app = NULL; *tpp = NULL;
@@ -453,7 +476,6 @@ struct sock *sctp_err_lookup(int family, struct sk_buff *skb,
453 return sk; 476 return sk;
454 477
455out: 478out:
456 sock_put(sk);
457 if (asoc) 479 if (asoc)
458 sctp_association_put(asoc); 480 sctp_association_put(asoc);
459 return NULL; 481 return NULL;
@@ -463,7 +485,6 @@ out:
463void sctp_err_finish(struct sock *sk, struct sctp_association *asoc) 485void sctp_err_finish(struct sock *sk, struct sctp_association *asoc)
464{ 486{
465 sctp_bh_unlock_sock(sk); 487 sctp_bh_unlock_sock(sk);
466 sock_put(sk);
467 if (asoc) 488 if (asoc)
468 sctp_association_put(asoc); 489 sctp_association_put(asoc);
469} 490}
@@ -490,7 +511,7 @@ void sctp_v4_err(struct sk_buff *skb, __u32 info)
490 int type = skb->h.icmph->type; 511 int type = skb->h.icmph->type;
491 int code = skb->h.icmph->code; 512 int code = skb->h.icmph->code;
492 struct sock *sk; 513 struct sock *sk;
493 struct sctp_association *asoc; 514 struct sctp_association *asoc = NULL;
494 struct sctp_transport *transport; 515 struct sctp_transport *transport;
495 struct inet_sock *inet; 516 struct inet_sock *inet;
496 char *saveip, *savesctp; 517 char *saveip, *savesctp;
@@ -716,7 +737,6 @@ static struct sctp_endpoint *__sctp_rcv_lookup_endpoint(const union sctp_addr *l
716 737
717hit: 738hit:
718 sctp_endpoint_hold(ep); 739 sctp_endpoint_hold(ep);
719 sock_hold(epb->sk);
720 read_unlock(&head->lock); 740 read_unlock(&head->lock);
721 return ep; 741 return ep;
722} 742}
@@ -818,7 +838,6 @@ static struct sctp_association *__sctp_lookup_association(
818hit: 838hit:
819 *pt = transport; 839 *pt = transport;
820 sctp_association_hold(asoc); 840 sctp_association_hold(asoc);
821 sock_hold(epb->sk);
822 read_unlock(&head->lock); 841 read_unlock(&head->lock);
823 return asoc; 842 return asoc;
824} 843}
@@ -846,7 +865,6 @@ int sctp_has_association(const union sctp_addr *laddr,
846 struct sctp_transport *transport; 865 struct sctp_transport *transport;
847 866
848 if ((asoc = sctp_lookup_association(laddr, paddr, &transport))) { 867 if ((asoc = sctp_lookup_association(laddr, paddr, &transport))) {
849 sock_put(asoc->base.sk);
850 sctp_association_put(asoc); 868 sctp_association_put(asoc);
851 return 1; 869 return 1;
852 } 870 }
diff --git a/net/sctp/inqueue.c b/net/sctp/inqueue.c
index 297b8951463e..cf0c767d43ae 100644
--- a/net/sctp/inqueue.c
+++ b/net/sctp/inqueue.c
@@ -149,6 +149,7 @@ struct sctp_chunk *sctp_inq_pop(struct sctp_inq *queue)
149 /* This is the first chunk in the packet. */ 149 /* This is the first chunk in the packet. */
150 chunk->singleton = 1; 150 chunk->singleton = 1;
151 ch = (sctp_chunkhdr_t *) chunk->skb->data; 151 ch = (sctp_chunkhdr_t *) chunk->skb->data;
152 chunk->data_accepted = 0;
152 } 153 }
153 154
154 chunk->chunk_hdr = ch; 155 chunk->chunk_hdr = ch;
diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c
index 8d1dc24bab4c..c5beb2ad7ef7 100644
--- a/net/sctp/sm_sideeffect.c
+++ b/net/sctp/sm_sideeffect.c
@@ -498,10 +498,6 @@ static void sctp_cmd_assoc_failed(sctp_cmd_seq_t *commands,
498 sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE, 498 sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE,
499 SCTP_STATE(SCTP_STATE_CLOSED)); 499 SCTP_STATE(SCTP_STATE_CLOSED));
500 500
501 /* Set sk_err to ECONNRESET on a 1-1 style socket. */
502 if (!sctp_style(asoc->base.sk, UDP))
503 asoc->base.sk->sk_err = ECONNRESET;
504
505 /* SEND_FAILED sent later when cleaning up the association. */ 501 /* SEND_FAILED sent later when cleaning up the association. */
506 asoc->outqueue.error = error; 502 asoc->outqueue.error = error;
507 sctp_add_cmd_sf(commands, SCTP_CMD_DELETE_TCB, SCTP_NULL()); 503 sctp_add_cmd_sf(commands, SCTP_CMD_DELETE_TCB, SCTP_NULL());
@@ -838,6 +834,15 @@ static void sctp_cmd_del_non_primary(struct sctp_association *asoc)
838 return; 834 return;
839} 835}
840 836
837/* Helper function to set sk_err on a 1-1 style socket. */
838static void sctp_cmd_set_sk_err(struct sctp_association *asoc, int error)
839{
840 struct sock *sk = asoc->base.sk;
841
842 if (!sctp_style(sk, UDP))
843 sk->sk_err = error;
844}
845
841/* These three macros allow us to pull the debugging code out of the 846/* These three macros allow us to pull the debugging code out of the
842 * main flow of sctp_do_sm() to keep attention focused on the real 847 * main flow of sctp_do_sm() to keep attention focused on the real
843 * functionality there. 848 * functionality there.
@@ -1458,6 +1463,9 @@ static int sctp_cmd_interpreter(sctp_event_t event_type,
1458 local_cork = 0; 1463 local_cork = 0;
1459 asoc->peer.retran_path = t; 1464 asoc->peer.retran_path = t;
1460 break; 1465 break;
1466 case SCTP_CMD_SET_SK_ERR:
1467 sctp_cmd_set_sk_err(asoc, cmd->obj.error);
1468 break;
1461 default: 1469 default:
1462 printk(KERN_WARNING "Impossible command: %u, %p\n", 1470 printk(KERN_WARNING "Impossible command: %u, %p\n",
1463 cmd->verb, cmd->obj.ptr); 1471 cmd->verb, cmd->obj.ptr);
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index 2b9a832b29a7..8bc279219a72 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -93,7 +93,7 @@ static sctp_disposition_t sctp_sf_shut_8_4_5(const struct sctp_endpoint *ep,
93static struct sctp_sackhdr *sctp_sm_pull_sack(struct sctp_chunk *chunk); 93static struct sctp_sackhdr *sctp_sm_pull_sack(struct sctp_chunk *chunk);
94 94
95static sctp_disposition_t sctp_stop_t1_and_abort(sctp_cmd_seq_t *commands, 95static sctp_disposition_t sctp_stop_t1_and_abort(sctp_cmd_seq_t *commands,
96 __u16 error, 96 __u16 error, int sk_err,
97 const struct sctp_association *asoc, 97 const struct sctp_association *asoc,
98 struct sctp_transport *transport); 98 struct sctp_transport *transport);
99 99
@@ -448,7 +448,7 @@ sctp_disposition_t sctp_sf_do_5_1C_ack(const struct sctp_endpoint *ep,
448 __u32 init_tag; 448 __u32 init_tag;
449 struct sctp_chunk *err_chunk; 449 struct sctp_chunk *err_chunk;
450 struct sctp_packet *packet; 450 struct sctp_packet *packet;
451 sctp_disposition_t ret; 451 __u16 error;
452 452
453 if (!sctp_vtag_verify(chunk, asoc)) 453 if (!sctp_vtag_verify(chunk, asoc))
454 return sctp_sf_pdiscard(ep, asoc, type, arg, commands); 454 return sctp_sf_pdiscard(ep, asoc, type, arg, commands);
@@ -480,11 +480,9 @@ sctp_disposition_t sctp_sf_do_5_1C_ack(const struct sctp_endpoint *ep,
480 goto nomem; 480 goto nomem;
481 481
482 sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(reply)); 482 sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(reply));
483 sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE, 483 return sctp_stop_t1_and_abort(commands, SCTP_ERROR_INV_PARAM,
484 SCTP_STATE(SCTP_STATE_CLOSED)); 484 ECONNREFUSED, asoc,
485 SCTP_INC_STATS(SCTP_MIB_ABORTEDS); 485 chunk->transport);
486 sctp_add_cmd_sf(commands, SCTP_CMD_DELETE_TCB, SCTP_NULL());
487 return SCTP_DISPOSITION_DELETE_TCB;
488 } 486 }
489 487
490 /* Verify the INIT chunk before processing it. */ 488 /* Verify the INIT chunk before processing it. */
@@ -511,27 +509,16 @@ sctp_disposition_t sctp_sf_do_5_1C_ack(const struct sctp_endpoint *ep,
511 sctp_add_cmd_sf(commands, SCTP_CMD_SEND_PKT, 509 sctp_add_cmd_sf(commands, SCTP_CMD_SEND_PKT,
512 SCTP_PACKET(packet)); 510 SCTP_PACKET(packet));
513 SCTP_INC_STATS(SCTP_MIB_OUTCTRLCHUNKS); 511 SCTP_INC_STATS(SCTP_MIB_OUTCTRLCHUNKS);
514 sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE, 512 error = SCTP_ERROR_INV_PARAM;
515 SCTP_STATE(SCTP_STATE_CLOSED));
516 sctp_add_cmd_sf(commands, SCTP_CMD_DELETE_TCB,
517 SCTP_NULL());
518 return SCTP_DISPOSITION_CONSUME;
519 } else { 513 } else {
520 sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE, 514 error = SCTP_ERROR_NO_RESOURCE;
521 SCTP_STATE(SCTP_STATE_CLOSED));
522 sctp_add_cmd_sf(commands, SCTP_CMD_DELETE_TCB,
523 SCTP_NULL());
524 return SCTP_DISPOSITION_NOMEM;
525 } 515 }
526 } else { 516 } else {
527 ret = sctp_sf_tabort_8_4_8(ep, asoc, type, arg, 517 sctp_sf_tabort_8_4_8(ep, asoc, type, arg, commands);
528 commands); 518 error = SCTP_ERROR_INV_PARAM;
529 sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE,
530 SCTP_STATE(SCTP_STATE_CLOSED));
531 sctp_add_cmd_sf(commands, SCTP_CMD_DELETE_TCB,
532 SCTP_NULL());
533 return ret;
534 } 519 }
520 return sctp_stop_t1_and_abort(commands, error, ECONNREFUSED,
521 asoc, chunk->transport);
535 } 522 }
536 523
537 /* Tag the variable length parameters. Note that we never 524 /* Tag the variable length parameters. Note that we never
@@ -636,8 +623,9 @@ sctp_disposition_t sctp_sf_do_5_1D_ce(const struct sctp_endpoint *ep,
636 */ 623 */
637 chunk->subh.cookie_hdr = 624 chunk->subh.cookie_hdr =
638 (struct sctp_signed_cookie *)chunk->skb->data; 625 (struct sctp_signed_cookie *)chunk->skb->data;
639 skb_pull(chunk->skb, 626 if (!pskb_pull(chunk->skb, ntohs(chunk->chunk_hdr->length) -
640 ntohs(chunk->chunk_hdr->length) - sizeof(sctp_chunkhdr_t)); 627 sizeof(sctp_chunkhdr_t)))
628 goto nomem;
641 629
642 /* 5.1 D) Upon reception of the COOKIE ECHO chunk, Endpoint 630 /* 5.1 D) Upon reception of the COOKIE ECHO chunk, Endpoint
643 * "Z" will reply with a COOKIE ACK chunk after building a TCB 631 * "Z" will reply with a COOKIE ACK chunk after building a TCB
@@ -885,6 +873,8 @@ sctp_disposition_t sctp_sf_sendbeat_8_3(const struct sctp_endpoint *ep,
885 struct sctp_transport *transport = (struct sctp_transport *) arg; 873 struct sctp_transport *transport = (struct sctp_transport *) arg;
886 874
887 if (asoc->overall_error_count >= asoc->max_retrans) { 875 if (asoc->overall_error_count >= asoc->max_retrans) {
876 sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR,
877 SCTP_ERROR(ETIMEDOUT));
888 /* CMD_ASSOC_FAILED calls CMD_DELETE_TCB. */ 878 /* CMD_ASSOC_FAILED calls CMD_DELETE_TCB. */
889 sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, 879 sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
890 SCTP_U32(SCTP_ERROR_NO_ERROR)); 880 SCTP_U32(SCTP_ERROR_NO_ERROR));
@@ -965,7 +955,8 @@ sctp_disposition_t sctp_sf_beat_8_3(const struct sctp_endpoint *ep,
965 */ 955 */
966 chunk->subh.hb_hdr = (sctp_heartbeathdr_t *) chunk->skb->data; 956 chunk->subh.hb_hdr = (sctp_heartbeathdr_t *) chunk->skb->data;
967 paylen = ntohs(chunk->chunk_hdr->length) - sizeof(sctp_chunkhdr_t); 957 paylen = ntohs(chunk->chunk_hdr->length) - sizeof(sctp_chunkhdr_t);
968 skb_pull(chunk->skb, paylen); 958 if (!pskb_pull(chunk->skb, paylen))
959 goto nomem;
969 960
970 reply = sctp_make_heartbeat_ack(asoc, chunk, 961 reply = sctp_make_heartbeat_ack(asoc, chunk,
971 chunk->subh.hb_hdr, paylen); 962 chunk->subh.hb_hdr, paylen);
@@ -1028,6 +1019,12 @@ sctp_disposition_t sctp_sf_backbeat_8_3(const struct sctp_endpoint *ep,
1028 commands); 1019 commands);
1029 1020
1030 hbinfo = (sctp_sender_hb_info_t *) chunk->skb->data; 1021 hbinfo = (sctp_sender_hb_info_t *) chunk->skb->data;
1022 /* Make sure that the length of the parameter is what we expect */
1023 if (ntohs(hbinfo->param_hdr.length) !=
1024 sizeof(sctp_sender_hb_info_t)) {
1025 return SCTP_DISPOSITION_DISCARD;
1026 }
1027
1031 from_addr = hbinfo->daddr; 1028 from_addr = hbinfo->daddr;
1032 link = sctp_assoc_lookup_paddr(asoc, &from_addr); 1029 link = sctp_assoc_lookup_paddr(asoc, &from_addr);
1033 1030
@@ -1860,8 +1857,9 @@ sctp_disposition_t sctp_sf_do_5_2_4_dupcook(const struct sctp_endpoint *ep,
1860 * are in good shape. 1857 * are in good shape.
1861 */ 1858 */
1862 chunk->subh.cookie_hdr = (struct sctp_signed_cookie *)chunk->skb->data; 1859 chunk->subh.cookie_hdr = (struct sctp_signed_cookie *)chunk->skb->data;
1863 skb_pull(chunk->skb, ntohs(chunk->chunk_hdr->length) - 1860 if (!pskb_pull(chunk->skb, ntohs(chunk->chunk_hdr->length) -
1864 sizeof(sctp_chunkhdr_t)); 1861 sizeof(sctp_chunkhdr_t)))
1862 goto nomem;
1865 1863
1866 /* In RFC 2960 5.2.4 3, if both Verification Tags in the State Cookie 1864 /* In RFC 2960 5.2.4 3, if both Verification Tags in the State Cookie
1867 * of a duplicate COOKIE ECHO match the Verification Tags of the 1865 * of a duplicate COOKIE ECHO match the Verification Tags of the
@@ -2123,6 +2121,8 @@ static sctp_disposition_t sctp_sf_do_5_2_6_stale(const struct sctp_endpoint *ep,
2123 int attempts = asoc->init_err_counter + 1; 2121 int attempts = asoc->init_err_counter + 1;
2124 2122
2125 if (attempts > asoc->max_init_attempts) { 2123 if (attempts > asoc->max_init_attempts) {
2124 sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR,
2125 SCTP_ERROR(ETIMEDOUT));
2126 sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED, 2126 sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED,
2127 SCTP_U32(SCTP_ERROR_STALE_COOKIE)); 2127 SCTP_U32(SCTP_ERROR_STALE_COOKIE));
2128 return SCTP_DISPOSITION_DELETE_TCB; 2128 return SCTP_DISPOSITION_DELETE_TCB;
@@ -2259,6 +2259,7 @@ sctp_disposition_t sctp_sf_do_9_1_abort(const struct sctp_endpoint *ep,
2259 if (len >= sizeof(struct sctp_chunkhdr) + sizeof(struct sctp_errhdr)) 2259 if (len >= sizeof(struct sctp_chunkhdr) + sizeof(struct sctp_errhdr))
2260 error = ((sctp_errhdr_t *)chunk->skb->data)->cause; 2260 error = ((sctp_errhdr_t *)chunk->skb->data)->cause;
2261 2261
2262 sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, SCTP_ERROR(ECONNRESET));
2262 /* ASSOC_FAILED will DELETE_TCB. */ 2263 /* ASSOC_FAILED will DELETE_TCB. */
2263 sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, SCTP_U32(error)); 2264 sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, SCTP_U32(error));
2264 SCTP_INC_STATS(SCTP_MIB_ABORTEDS); 2265 SCTP_INC_STATS(SCTP_MIB_ABORTEDS);
@@ -2303,7 +2304,8 @@ sctp_disposition_t sctp_sf_cookie_wait_abort(const struct sctp_endpoint *ep,
2303 if (len >= sizeof(struct sctp_chunkhdr) + sizeof(struct sctp_errhdr)) 2304 if (len >= sizeof(struct sctp_chunkhdr) + sizeof(struct sctp_errhdr))
2304 error = ((sctp_errhdr_t *)chunk->skb->data)->cause; 2305 error = ((sctp_errhdr_t *)chunk->skb->data)->cause;
2305 2306
2306 return sctp_stop_t1_and_abort(commands, error, asoc, chunk->transport); 2307 return sctp_stop_t1_and_abort(commands, error, ECONNREFUSED, asoc,
2308 chunk->transport);
2307} 2309}
2308 2310
2309/* 2311/*
@@ -2315,7 +2317,8 @@ sctp_disposition_t sctp_sf_cookie_wait_icmp_abort(const struct sctp_endpoint *ep
2315 void *arg, 2317 void *arg,
2316 sctp_cmd_seq_t *commands) 2318 sctp_cmd_seq_t *commands)
2317{ 2319{
2318 return sctp_stop_t1_and_abort(commands, SCTP_ERROR_NO_ERROR, asoc, 2320 return sctp_stop_t1_and_abort(commands, SCTP_ERROR_NO_ERROR,
2321 ENOPROTOOPT, asoc,
2319 (struct sctp_transport *)arg); 2322 (struct sctp_transport *)arg);
2320} 2323}
2321 2324
@@ -2340,7 +2343,7 @@ sctp_disposition_t sctp_sf_cookie_echoed_abort(const struct sctp_endpoint *ep,
2340 * This is common code called by several sctp_sf_*_abort() functions above. 2343 * This is common code called by several sctp_sf_*_abort() functions above.
2341 */ 2344 */
2342static sctp_disposition_t sctp_stop_t1_and_abort(sctp_cmd_seq_t *commands, 2345static sctp_disposition_t sctp_stop_t1_and_abort(sctp_cmd_seq_t *commands,
2343 __u16 error, 2346 __u16 error, int sk_err,
2344 const struct sctp_association *asoc, 2347 const struct sctp_association *asoc,
2345 struct sctp_transport *transport) 2348 struct sctp_transport *transport)
2346{ 2349{
@@ -2350,6 +2353,7 @@ static sctp_disposition_t sctp_stop_t1_and_abort(sctp_cmd_seq_t *commands,
2350 SCTP_INC_STATS(SCTP_MIB_ABORTEDS); 2353 SCTP_INC_STATS(SCTP_MIB_ABORTEDS);
2351 sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP, 2354 sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP,
2352 SCTP_TO(SCTP_EVENT_TIMEOUT_T1_INIT)); 2355 SCTP_TO(SCTP_EVENT_TIMEOUT_T1_INIT));
2356 sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, SCTP_ERROR(sk_err));
2353 /* CMD_INIT_FAILED will DELETE_TCB. */ 2357 /* CMD_INIT_FAILED will DELETE_TCB. */
2354 sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED, 2358 sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED,
2355 SCTP_U32(error)); 2359 SCTP_U32(error));
@@ -3333,6 +3337,8 @@ sctp_disposition_t sctp_sf_do_asconf_ack(const struct sctp_endpoint *ep,
3333 sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP, 3337 sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP,
3334 SCTP_TO(SCTP_EVENT_TIMEOUT_T4_RTO)); 3338 SCTP_TO(SCTP_EVENT_TIMEOUT_T4_RTO));
3335 sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET,SCTP_NULL()); 3339 sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET,SCTP_NULL());
3340 sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR,
3341 SCTP_ERROR(ECONNABORTED));
3336 sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, 3342 sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
3337 SCTP_U32(SCTP_ERROR_ASCONF_ACK)); 3343 SCTP_U32(SCTP_ERROR_ASCONF_ACK));
3338 SCTP_INC_STATS(SCTP_MIB_ABORTEDS); 3344 SCTP_INC_STATS(SCTP_MIB_ABORTEDS);
@@ -3359,6 +3365,8 @@ sctp_disposition_t sctp_sf_do_asconf_ack(const struct sctp_endpoint *ep,
3359 * processing the rest of the chunks in the packet. 3365 * processing the rest of the chunks in the packet.
3360 */ 3366 */
3361 sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET,SCTP_NULL()); 3367 sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET,SCTP_NULL());
3368 sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR,
3369 SCTP_ERROR(ECONNABORTED));
3362 sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, 3370 sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
3363 SCTP_U32(SCTP_ERROR_ASCONF_ACK)); 3371 SCTP_U32(SCTP_ERROR_ASCONF_ACK));
3364 SCTP_INC_STATS(SCTP_MIB_ABORTEDS); 3372 SCTP_INC_STATS(SCTP_MIB_ABORTEDS);
@@ -3711,9 +3719,13 @@ static sctp_disposition_t sctp_sf_violation_chunklen(
3711 if (asoc->state <= SCTP_STATE_COOKIE_ECHOED) { 3719 if (asoc->state <= SCTP_STATE_COOKIE_ECHOED) {
3712 sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP, 3720 sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP,
3713 SCTP_TO(SCTP_EVENT_TIMEOUT_T1_INIT)); 3721 SCTP_TO(SCTP_EVENT_TIMEOUT_T1_INIT));
3722 sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR,
3723 SCTP_ERROR(ECONNREFUSED));
3714 sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED, 3724 sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED,
3715 SCTP_U32(SCTP_ERROR_PROTO_VIOLATION)); 3725 SCTP_U32(SCTP_ERROR_PROTO_VIOLATION));
3716 } else { 3726 } else {
3727 sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR,
3728 SCTP_ERROR(ECONNABORTED));
3717 sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, 3729 sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
3718 SCTP_U32(SCTP_ERROR_PROTO_VIOLATION)); 3730 SCTP_U32(SCTP_ERROR_PROTO_VIOLATION));
3719 SCTP_DEC_STATS(SCTP_MIB_CURRESTAB); 3731 SCTP_DEC_STATS(SCTP_MIB_CURRESTAB);
@@ -4031,6 +4043,8 @@ sctp_disposition_t sctp_sf_do_9_1_prm_abort(
4031 * TCB. This is a departure from our typical NOMEM handling. 4043 * TCB. This is a departure from our typical NOMEM handling.
4032 */ 4044 */
4033 4045
4046 sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR,
4047 SCTP_ERROR(ECONNABORTED));
4034 /* Delete the established association. */ 4048 /* Delete the established association. */
4035 sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, 4049 sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
4036 SCTP_U32(SCTP_ERROR_USER_ABORT)); 4050 SCTP_U32(SCTP_ERROR_USER_ABORT));
@@ -4172,6 +4186,8 @@ sctp_disposition_t sctp_sf_cookie_wait_prm_abort(
4172 * TCB. This is a departure from our typical NOMEM handling. 4186 * TCB. This is a departure from our typical NOMEM handling.
4173 */ 4187 */
4174 4188
4189 sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR,
4190 SCTP_ERROR(ECONNREFUSED));
4175 /* Delete the established association. */ 4191 /* Delete the established association. */
4176 sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED, 4192 sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED,
4177 SCTP_U32(SCTP_ERROR_USER_ABORT)); 4193 SCTP_U32(SCTP_ERROR_USER_ABORT));
@@ -4540,6 +4556,8 @@ sctp_disposition_t sctp_sf_do_6_3_3_rtx(const struct sctp_endpoint *ep,
4540 struct sctp_transport *transport = arg; 4556 struct sctp_transport *transport = arg;
4541 4557
4542 if (asoc->overall_error_count >= asoc->max_retrans) { 4558 if (asoc->overall_error_count >= asoc->max_retrans) {
4559 sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR,
4560 SCTP_ERROR(ETIMEDOUT));
4543 /* CMD_ASSOC_FAILED calls CMD_DELETE_TCB. */ 4561 /* CMD_ASSOC_FAILED calls CMD_DELETE_TCB. */
4544 sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, 4562 sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
4545 SCTP_U32(SCTP_ERROR_NO_ERROR)); 4563 SCTP_U32(SCTP_ERROR_NO_ERROR));
@@ -4659,6 +4677,8 @@ sctp_disposition_t sctp_sf_t1_init_timer_expire(const struct sctp_endpoint *ep,
4659 SCTP_DEBUG_PRINTK("Giving up on INIT, attempts: %d" 4677 SCTP_DEBUG_PRINTK("Giving up on INIT, attempts: %d"
4660 " max_init_attempts: %d\n", 4678 " max_init_attempts: %d\n",
4661 attempts, asoc->max_init_attempts); 4679 attempts, asoc->max_init_attempts);
4680 sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR,
4681 SCTP_ERROR(ETIMEDOUT));
4662 sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED, 4682 sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED,
4663 SCTP_U32(SCTP_ERROR_NO_ERROR)); 4683 SCTP_U32(SCTP_ERROR_NO_ERROR));
4664 return SCTP_DISPOSITION_DELETE_TCB; 4684 return SCTP_DISPOSITION_DELETE_TCB;
@@ -4708,6 +4728,8 @@ sctp_disposition_t sctp_sf_t1_cookie_timer_expire(const struct sctp_endpoint *ep
4708 4728
4709 sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(repl)); 4729 sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(repl));
4710 } else { 4730 } else {
4731 sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR,
4732 SCTP_ERROR(ETIMEDOUT));
4711 sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED, 4733 sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED,
4712 SCTP_U32(SCTP_ERROR_NO_ERROR)); 4734 SCTP_U32(SCTP_ERROR_NO_ERROR));
4713 return SCTP_DISPOSITION_DELETE_TCB; 4735 return SCTP_DISPOSITION_DELETE_TCB;
@@ -4739,6 +4761,8 @@ sctp_disposition_t sctp_sf_t2_timer_expire(const struct sctp_endpoint *ep,
4739 4761
4740 SCTP_DEBUG_PRINTK("Timer T2 expired.\n"); 4762 SCTP_DEBUG_PRINTK("Timer T2 expired.\n");
4741 if (asoc->overall_error_count >= asoc->max_retrans) { 4763 if (asoc->overall_error_count >= asoc->max_retrans) {
4764 sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR,
4765 SCTP_ERROR(ETIMEDOUT));
4742 /* Note: CMD_ASSOC_FAILED calls CMD_DELETE_TCB. */ 4766 /* Note: CMD_ASSOC_FAILED calls CMD_DELETE_TCB. */
4743 sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, 4767 sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
4744 SCTP_U32(SCTP_ERROR_NO_ERROR)); 4768 SCTP_U32(SCTP_ERROR_NO_ERROR));
@@ -4814,6 +4838,8 @@ sctp_disposition_t sctp_sf_t4_timer_expire(
4814 if (asoc->overall_error_count >= asoc->max_retrans) { 4838 if (asoc->overall_error_count >= asoc->max_retrans) {
4815 sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP, 4839 sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP,
4816 SCTP_TO(SCTP_EVENT_TIMEOUT_T4_RTO)); 4840 SCTP_TO(SCTP_EVENT_TIMEOUT_T4_RTO));
4841 sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR,
4842 SCTP_ERROR(ETIMEDOUT));
4817 sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, 4843 sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
4818 SCTP_U32(SCTP_ERROR_NO_ERROR)); 4844 SCTP_U32(SCTP_ERROR_NO_ERROR));
4819 SCTP_INC_STATS(SCTP_MIB_ABORTEDS); 4845 SCTP_INC_STATS(SCTP_MIB_ABORTEDS);
@@ -4867,6 +4893,8 @@ sctp_disposition_t sctp_sf_t5_timer_expire(const struct sctp_endpoint *ep,
4867 goto nomem; 4893 goto nomem;
4868 4894
4869 sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(reply)); 4895 sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(reply));
4896 sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR,
4897 SCTP_ERROR(ETIMEDOUT));
4870 sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, 4898 sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
4871 SCTP_U32(SCTP_ERROR_NO_ERROR)); 4899 SCTP_U32(SCTP_ERROR_NO_ERROR));
4872 4900
@@ -5151,7 +5179,9 @@ static int sctp_eat_data(const struct sctp_association *asoc,
5151 int tmp; 5179 int tmp;
5152 __u32 tsn; 5180 __u32 tsn;
5153 int account_value; 5181 int account_value;
5182 struct sctp_tsnmap *map = (struct sctp_tsnmap *)&asoc->peer.tsn_map;
5154 struct sock *sk = asoc->base.sk; 5183 struct sock *sk = asoc->base.sk;
5184 int rcvbuf_over = 0;
5155 5185
5156 data_hdr = chunk->subh.data_hdr = (sctp_datahdr_t *)chunk->skb->data; 5186 data_hdr = chunk->subh.data_hdr = (sctp_datahdr_t *)chunk->skb->data;
5157 skb_pull(chunk->skb, sizeof(sctp_datahdr_t)); 5187 skb_pull(chunk->skb, sizeof(sctp_datahdr_t));
@@ -5162,10 +5192,16 @@ static int sctp_eat_data(const struct sctp_association *asoc,
5162 /* ASSERT: Now skb->data is really the user data. */ 5192 /* ASSERT: Now skb->data is really the user data. */
5163 5193
5164 /* 5194 /*
5165 * if we are established, and we have used up our receive 5195 * If we are established, and we have used up our receive buffer
5166 * buffer memory, drop the frame 5196 * memory, think about droping the frame.
5167 */ 5197 * Note that we have an opportunity to improve performance here.
5168 if (asoc->state == SCTP_STATE_ESTABLISHED) { 5198 * If we accept one chunk from an skbuff, we have to keep all the
5199 * memory of that skbuff around until the chunk is read into user
5200 * space. Therefore, once we accept 1 chunk we may as well accept all
5201 * remaining chunks in the skbuff. The data_accepted flag helps us do
5202 * that.
5203 */
5204 if ((asoc->state == SCTP_STATE_ESTABLISHED) && (!chunk->data_accepted)) {
5169 /* 5205 /*
5170 * If the receive buffer policy is 1, then each 5206 * If the receive buffer policy is 1, then each
5171 * association can allocate up to sk_rcvbuf bytes 5207 * association can allocate up to sk_rcvbuf bytes
@@ -5176,9 +5212,25 @@ static int sctp_eat_data(const struct sctp_association *asoc,
5176 account_value = atomic_read(&asoc->rmem_alloc); 5212 account_value = atomic_read(&asoc->rmem_alloc);
5177 else 5213 else
5178 account_value = atomic_read(&sk->sk_rmem_alloc); 5214 account_value = atomic_read(&sk->sk_rmem_alloc);
5179 5215 if (account_value > sk->sk_rcvbuf) {
5180 if (account_value > sk->sk_rcvbuf) 5216 /*
5181 return SCTP_IERROR_IGNORE_TSN; 5217 * We need to make forward progress, even when we are
5218 * under memory pressure, so we always allow the
5219 * next tsn after the ctsn ack point to be accepted.
5220 * This lets us avoid deadlocks in which we have to
5221 * drop frames that would otherwise let us drain the
5222 * receive queue.
5223 */
5224 if ((sctp_tsnmap_get_ctsn(map) + 1) != tsn)
5225 return SCTP_IERROR_IGNORE_TSN;
5226
5227 /*
5228 * We're going to accept the frame but we should renege
5229 * to make space for it. This will send us down that
5230 * path later in this function.
5231 */
5232 rcvbuf_over = 1;
5233 }
5182 } 5234 }
5183 5235
5184 /* Process ECN based congestion. 5236 /* Process ECN based congestion.
@@ -5226,6 +5278,7 @@ static int sctp_eat_data(const struct sctp_association *asoc,
5226 datalen -= sizeof(sctp_data_chunk_t); 5278 datalen -= sizeof(sctp_data_chunk_t);
5227 5279
5228 deliver = SCTP_CMD_CHUNK_ULP; 5280 deliver = SCTP_CMD_CHUNK_ULP;
5281 chunk->data_accepted = 1;
5229 5282
5230 /* Think about partial delivery. */ 5283 /* Think about partial delivery. */
5231 if ((datalen >= asoc->rwnd) && (!asoc->ulpq.pd_mode)) { 5284 if ((datalen >= asoc->rwnd) && (!asoc->ulpq.pd_mode)) {
@@ -5242,7 +5295,8 @@ static int sctp_eat_data(const struct sctp_association *asoc,
5242 * large spill over. 5295 * large spill over.
5243 */ 5296 */
5244 if (!asoc->rwnd || asoc->rwnd_over || 5297 if (!asoc->rwnd || asoc->rwnd_over ||
5245 (datalen > asoc->rwnd + asoc->frag_point)) { 5298 (datalen > asoc->rwnd + asoc->frag_point) ||
5299 rcvbuf_over) {
5246 5300
5247 /* If this is the next TSN, consider reneging to make 5301 /* If this is the next TSN, consider reneging to make
5248 * room. Note: Playing nice with a confused sender. A 5302 * room. Note: Playing nice with a confused sender. A
@@ -5250,8 +5304,8 @@ static int sctp_eat_data(const struct sctp_association *asoc,
5250 * space and in the future we may want to detect and 5304 * space and in the future we may want to detect and
5251 * do more drastic reneging. 5305 * do more drastic reneging.
5252 */ 5306 */
5253 if (sctp_tsnmap_has_gap(&asoc->peer.tsn_map) && 5307 if (sctp_tsnmap_has_gap(map) &&
5254 (sctp_tsnmap_get_ctsn(&asoc->peer.tsn_map) + 1) == tsn) { 5308 (sctp_tsnmap_get_ctsn(map) + 1) == tsn) {
5255 SCTP_DEBUG_PRINTK("Reneging for tsn:%u\n", tsn); 5309 SCTP_DEBUG_PRINTK("Reneging for tsn:%u\n", tsn);
5256 deliver = SCTP_CMD_RENEGE; 5310 deliver = SCTP_CMD_RENEGE;
5257 } else { 5311 } else {
@@ -5280,6 +5334,8 @@ static int sctp_eat_data(const struct sctp_association *asoc,
5280 * processing the rest of the chunks in the packet. 5334 * processing the rest of the chunks in the packet.
5281 */ 5335 */
5282 sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET,SCTP_NULL()); 5336 sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET,SCTP_NULL());
5337 sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR,
5338 SCTP_ERROR(ECONNABORTED));
5283 sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, 5339 sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
5284 SCTP_U32(SCTP_ERROR_NO_DATA)); 5340 SCTP_U32(SCTP_ERROR_NO_DATA));
5285 SCTP_INC_STATS(SCTP_MIB_ABORTEDS); 5341 SCTP_INC_STATS(SCTP_MIB_ABORTEDS);
diff --git a/net/sctp/sm_statetable.c b/net/sctp/sm_statetable.c
index 75ef10408764..8bcca5676151 100644
--- a/net/sctp/sm_statetable.c
+++ b/net/sctp/sm_statetable.c
@@ -366,9 +366,9 @@ const sctp_sm_table_entry_t *sctp_sm_lookup_event(sctp_event_t event_type,
366 /* SCTP_STATE_EMPTY */ \ 366 /* SCTP_STATE_EMPTY */ \
367 {.fn = sctp_sf_ootb, .name = "sctp_sf_ootb"}, \ 367 {.fn = sctp_sf_ootb, .name = "sctp_sf_ootb"}, \
368 /* SCTP_STATE_CLOSED */ \ 368 /* SCTP_STATE_CLOSED */ \
369 {.fn = sctp_sf_bug, .name = "sctp_sf_bug"}, \ 369 {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \
370 /* SCTP_STATE_COOKIE_WAIT */ \ 370 /* SCTP_STATE_COOKIE_WAIT */ \
371 {.fn = sctp_sf_bug, .name = "sctp_sf_bug"}, \ 371 {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \
372 /* SCTP_STATE_COOKIE_ECHOED */ \ 372 /* SCTP_STATE_COOKIE_ECHOED */ \
373 {.fn = sctp_sf_do_ecne, .name = "sctp_sf_do_ecne"}, \ 373 {.fn = sctp_sf_do_ecne, .name = "sctp_sf_do_ecne"}, \
374 /* SCTP_STATE_ESTABLISHED */ \ 374 /* SCTP_STATE_ESTABLISHED */ \
@@ -380,7 +380,7 @@ const sctp_sm_table_entry_t *sctp_sm_lookup_event(sctp_event_t event_type,
380 /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ 380 /* SCTP_STATE_SHUTDOWN_RECEIVED */ \
381 {.fn = sctp_sf_do_ecne, .name = "sctp_sf_do_ecne"}, \ 381 {.fn = sctp_sf_do_ecne, .name = "sctp_sf_do_ecne"}, \
382 /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ 382 /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \
383 {.fn = sctp_sf_bug, .name = "sctp_sf_bug"}, \ 383 {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \
384} /* TYPE_SCTP_ECN_ECNE */ 384} /* TYPE_SCTP_ECN_ECNE */
385 385
386#define TYPE_SCTP_ECN_CWR { \ 386#define TYPE_SCTP_ECN_CWR { \
@@ -401,7 +401,7 @@ const sctp_sm_table_entry_t *sctp_sm_lookup_event(sctp_event_t event_type,
401 /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ 401 /* SCTP_STATE_SHUTDOWN_RECEIVED */ \
402 {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \ 402 {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \
403 /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ 403 /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \
404 {.fn = sctp_sf_bug, .name = "sctp_sf_bug"}, \ 404 {.fn = sctp_sf_discard_chunk, .name = "sctp_sf_discard_chunk"}, \
405} /* TYPE_SCTP_ECN_CWR */ 405} /* TYPE_SCTP_ECN_CWR */
406 406
407#define TYPE_SCTP_SHUTDOWN_COMPLETE { \ 407#define TYPE_SCTP_SHUTDOWN_COMPLETE { \
@@ -647,7 +647,7 @@ chunk_event_table_unknown[SCTP_STATE_NUM_STATES] = {
647 /* SCTP_STATE_EMPTY */ \ 647 /* SCTP_STATE_EMPTY */ \
648 {.fn = sctp_sf_bug, .name = "sctp_sf_bug"}, \ 648 {.fn = sctp_sf_bug, .name = "sctp_sf_bug"}, \
649 /* SCTP_STATE_CLOSED */ \ 649 /* SCTP_STATE_CLOSED */ \
650 {.fn = sctp_sf_bug, .name = "sctp_sf_bug"}, \ 650 {.fn = sctp_sf_error_closed, .name = "sctp_sf_error_closed"}, \
651 /* SCTP_STATE_COOKIE_WAIT */ \ 651 /* SCTP_STATE_COOKIE_WAIT */ \
652 {.fn = sctp_sf_do_prm_requestheartbeat, \ 652 {.fn = sctp_sf_do_prm_requestheartbeat, \
653 .name = "sctp_sf_do_prm_requestheartbeat"}, \ 653 .name = "sctp_sf_do_prm_requestheartbeat"}, \
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index b6e4b89539b3..174d4d35e951 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -1057,6 +1057,7 @@ static int __sctp_connect(struct sock* sk,
1057 inet_sk(sk)->dport = htons(asoc->peer.port); 1057 inet_sk(sk)->dport = htons(asoc->peer.port);
1058 af = sctp_get_af_specific(to.sa.sa_family); 1058 af = sctp_get_af_specific(to.sa.sa_family);
1059 af->to_sk_daddr(&to, sk); 1059 af->to_sk_daddr(&to, sk);
1060 sk->sk_err = 0;
1060 1061
1061 timeo = sock_sndtimeo(sk, sk->sk_socket->file->f_flags & O_NONBLOCK); 1062 timeo = sock_sndtimeo(sk, sk->sk_socket->file->f_flags & O_NONBLOCK);
1062 err = sctp_wait_for_connect(asoc, &timeo); 1063 err = sctp_wait_for_connect(asoc, &timeo);
@@ -1228,7 +1229,7 @@ SCTP_STATIC void sctp_close(struct sock *sk, long timeout)
1228 1229
1229 ep = sctp_sk(sk)->ep; 1230 ep = sctp_sk(sk)->ep;
1230 1231
1231 /* Walk all associations on a socket, not on an endpoint. */ 1232 /* Walk all associations on an endpoint. */
1232 list_for_each_safe(pos, temp, &ep->asocs) { 1233 list_for_each_safe(pos, temp, &ep->asocs) {
1233 asoc = list_entry(pos, struct sctp_association, asocs); 1234 asoc = list_entry(pos, struct sctp_association, asocs);
1234 1235
@@ -1241,13 +1242,13 @@ SCTP_STATIC void sctp_close(struct sock *sk, long timeout)
1241 if (sctp_state(asoc, CLOSED)) { 1242 if (sctp_state(asoc, CLOSED)) {
1242 sctp_unhash_established(asoc); 1243 sctp_unhash_established(asoc);
1243 sctp_association_free(asoc); 1244 sctp_association_free(asoc);
1245 continue;
1246 }
1247 }
1244 1248
1245 } else if (sock_flag(sk, SOCK_LINGER) && 1249 if (sock_flag(sk, SOCK_LINGER) && !sk->sk_lingertime)
1246 !sk->sk_lingertime) 1250 sctp_primitive_ABORT(asoc, NULL);
1247 sctp_primitive_ABORT(asoc, NULL); 1251 else
1248 else
1249 sctp_primitive_SHUTDOWN(asoc, NULL);
1250 } else
1251 sctp_primitive_SHUTDOWN(asoc, NULL); 1252 sctp_primitive_SHUTDOWN(asoc, NULL);
1252 } 1253 }
1253 1254
@@ -5317,6 +5318,7 @@ static int sctp_wait_for_sndbuf(struct sctp_association *asoc, long *timeo_p,
5317 */ 5318 */
5318 sctp_release_sock(sk); 5319 sctp_release_sock(sk);
5319 current_timeo = schedule_timeout(current_timeo); 5320 current_timeo = schedule_timeout(current_timeo);
5321 BUG_ON(sk != asoc->base.sk);
5320 sctp_lock_sock(sk); 5322 sctp_lock_sock(sk);
5321 5323
5322 *timeo_p = current_timeo; 5324 *timeo_p = current_timeo;
@@ -5604,12 +5606,14 @@ static void sctp_sock_migrate(struct sock *oldsk, struct sock *newsk,
5604 */ 5606 */
5605 newsp->type = type; 5607 newsp->type = type;
5606 5608
5607 spin_lock_bh(&oldsk->sk_lock.slock); 5609 /* Mark the new socket "in-use" by the user so that any packets
5608 /* Migrate the backlog from oldsk to newsk. */ 5610 * that may arrive on the association after we've moved it are
5609 sctp_backlog_migrate(assoc, oldsk, newsk); 5611 * queued to the backlog. This prevents a potential race between
5610 /* Migrate the association to the new socket. */ 5612 * backlog processing on the old socket and new-packet processing
5613 * on the new socket.
5614 */
5615 sctp_lock_sock(newsk);
5611 sctp_assoc_migrate(assoc, newsk); 5616 sctp_assoc_migrate(assoc, newsk);
5612 spin_unlock_bh(&oldsk->sk_lock.slock);
5613 5617
5614 /* If the association on the newsk is already closed before accept() 5618 /* If the association on the newsk is already closed before accept()
5615 * is called, set RCV_SHUTDOWN flag. 5619 * is called, set RCV_SHUTDOWN flag.
@@ -5618,6 +5622,7 @@ static void sctp_sock_migrate(struct sock *oldsk, struct sock *newsk,
5618 newsk->sk_shutdown |= RCV_SHUTDOWN; 5622 newsk->sk_shutdown |= RCV_SHUTDOWN;
5619 5623
5620 newsk->sk_state = SCTP_SS_ESTABLISHED; 5624 newsk->sk_state = SCTP_SS_ESTABLISHED;
5625 sctp_release_sock(newsk);
5621} 5626}
5622 5627
5623/* This proto struct describes the ULP interface for SCTP. */ 5628/* This proto struct describes the ULP interface for SCTP. */
diff --git a/net/sctp/ulpqueue.c b/net/sctp/ulpqueue.c
index 2080b2d28c98..575e556aeb3e 100644
--- a/net/sctp/ulpqueue.c
+++ b/net/sctp/ulpqueue.c
@@ -279,6 +279,7 @@ static inline void sctp_ulpq_store_reasm(struct sctp_ulpq *ulpq,
279static struct sctp_ulpevent *sctp_make_reassembled_event(struct sk_buff_head *queue, struct sk_buff *f_frag, struct sk_buff *l_frag) 279static struct sctp_ulpevent *sctp_make_reassembled_event(struct sk_buff_head *queue, struct sk_buff *f_frag, struct sk_buff *l_frag)
280{ 280{
281 struct sk_buff *pos; 281 struct sk_buff *pos;
282 struct sk_buff *new = NULL;
282 struct sctp_ulpevent *event; 283 struct sctp_ulpevent *event;
283 struct sk_buff *pnext, *last; 284 struct sk_buff *pnext, *last;
284 struct sk_buff *list = skb_shinfo(f_frag)->frag_list; 285 struct sk_buff *list = skb_shinfo(f_frag)->frag_list;
@@ -297,11 +298,33 @@ static struct sctp_ulpevent *sctp_make_reassembled_event(struct sk_buff_head *qu
297 */ 298 */
298 if (last) 299 if (last)
299 last->next = pos; 300 last->next = pos;
300 else 301 else {
301 skb_shinfo(f_frag)->frag_list = pos; 302 if (skb_cloned(f_frag)) {
303 /* This is a cloned skb, we can't just modify
304 * the frag_list. We need a new skb to do that.
305 * Instead of calling skb_unshare(), we'll do it
306 * ourselves since we need to delay the free.
307 */
308 new = skb_copy(f_frag, GFP_ATOMIC);
309 if (!new)
310 return NULL; /* try again later */
311
312 new->sk = f_frag->sk;
313
314 skb_shinfo(new)->frag_list = pos;
315 } else
316 skb_shinfo(f_frag)->frag_list = pos;
317 }
302 318
303 /* Remove the first fragment from the reassembly queue. */ 319 /* Remove the first fragment from the reassembly queue. */
304 __skb_unlink(f_frag, queue); 320 __skb_unlink(f_frag, queue);
321
322 /* if we did unshare, then free the old skb and re-assign */
323 if (new) {
324 kfree_skb(f_frag);
325 f_frag = new;
326 }
327
305 while (pos) { 328 while (pos) {
306 329
307 pnext = pos->next; 330 pnext = pos->next;
diff --git a/net/socket.c b/net/socket.c
index 23898f45f713..02948b622bd2 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -267,6 +267,8 @@ int move_addr_to_user(void *kaddr, int klen, void __user *uaddr, int __user *ule
267 return -EINVAL; 267 return -EINVAL;
268 if(len) 268 if(len)
269 { 269 {
270 if (audit_sockaddr(klen, kaddr))
271 return -ENOMEM;
270 if(copy_to_user(uaddr,kaddr,len)) 272 if(copy_to_user(uaddr,kaddr,len))
271 return -EFAULT; 273 return -EFAULT;
272 } 274 }
@@ -490,6 +492,7 @@ static struct socket *sockfd_lookup_light(int fd, int *err, int *fput_needed)
490 struct file *file; 492 struct file *file;
491 struct socket *sock; 493 struct socket *sock;
492 494
495 *err = -EBADF;
493 file = fget_light(fd, fput_needed); 496 file = fget_light(fd, fput_needed);
494 if (file) { 497 if (file) {
495 sock = sock_from_file(file, err); 498 sock = sock_from_file(file, err);
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
index 900ef31f5a0e..519ebc17c028 100644
--- a/net/sunrpc/auth_gss/auth_gss.c
+++ b/net/sunrpc/auth_gss/auth_gss.c
@@ -794,7 +794,6 @@ gss_create_cred(struct rpc_auth *auth, struct auth_cred *acred, int flags)
794 794
795out_err: 795out_err:
796 dprintk("RPC: gss_create_cred failed with error %d\n", err); 796 dprintk("RPC: gss_create_cred failed with error %d\n", err);
797 if (cred) gss_destroy_cred(&cred->gc_base);
798 return ERR_PTR(err); 797 return ERR_PTR(err);
799} 798}
800 799
diff --git a/net/sunrpc/auth_gss/gss_krb5_crypto.c b/net/sunrpc/auth_gss/gss_krb5_crypto.c
index 97c981fa6b8e..76b969e6904f 100644
--- a/net/sunrpc/auth_gss/gss_krb5_crypto.c
+++ b/net/sunrpc/auth_gss/gss_krb5_crypto.c
@@ -212,7 +212,6 @@ make_checksum(s32 cksumtype, char *header, int hdrlen, struct xdr_buf *body,
212 char *cksumname; 212 char *cksumname;
213 struct crypto_tfm *tfm = NULL; /* XXX add to ctx? */ 213 struct crypto_tfm *tfm = NULL; /* XXX add to ctx? */
214 struct scatterlist sg[1]; 214 struct scatterlist sg[1];
215 u32 code = GSS_S_FAILURE;
216 215
217 switch (cksumtype) { 216 switch (cksumtype) {
218 case CKSUMTYPE_RSA_MD5: 217 case CKSUMTYPE_RSA_MD5:
@@ -221,13 +220,11 @@ make_checksum(s32 cksumtype, char *header, int hdrlen, struct xdr_buf *body,
221 default: 220 default:
222 dprintk("RPC: krb5_make_checksum:" 221 dprintk("RPC: krb5_make_checksum:"
223 " unsupported checksum %d", cksumtype); 222 " unsupported checksum %d", cksumtype);
224 goto out; 223 return GSS_S_FAILURE;
225 } 224 }
226 if (!(tfm = crypto_alloc_tfm(cksumname, CRYPTO_TFM_REQ_MAY_SLEEP))) 225 if (!(tfm = crypto_alloc_tfm(cksumname, CRYPTO_TFM_REQ_MAY_SLEEP)))
227 goto out; 226 return GSS_S_FAILURE;
228 cksum->len = crypto_tfm_alg_digestsize(tfm); 227 cksum->len = crypto_tfm_alg_digestsize(tfm);
229 if ((cksum->data = kmalloc(cksum->len, GFP_KERNEL)) == NULL)
230 goto out;
231 228
232 crypto_digest_init(tfm); 229 crypto_digest_init(tfm);
233 sg_set_buf(sg, header, hdrlen); 230 sg_set_buf(sg, header, hdrlen);
@@ -235,10 +232,8 @@ make_checksum(s32 cksumtype, char *header, int hdrlen, struct xdr_buf *body,
235 process_xdr_buf(body, body_offset, body->len - body_offset, 232 process_xdr_buf(body, body_offset, body->len - body_offset,
236 checksummer, tfm); 233 checksummer, tfm);
237 crypto_digest_final(tfm, cksum->data); 234 crypto_digest_final(tfm, cksum->data);
238 code = 0;
239out:
240 crypto_free_tfm(tfm); 235 crypto_free_tfm(tfm);
241 return code; 236 return 0;
242} 237}
243 238
244EXPORT_SYMBOL(make_checksum); 239EXPORT_SYMBOL(make_checksum);
diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c
index 3ac4193a78ed..7026b0866b7b 100644
--- a/net/sunrpc/cache.c
+++ b/net/sunrpc/cache.c
@@ -159,6 +159,7 @@ struct cache_head *sunrpc_cache_update(struct cache_detail *detail,
159 detail->update(tmp, new); 159 detail->update(tmp, new);
160 tmp->next = *head; 160 tmp->next = *head;
161 *head = tmp; 161 *head = tmp;
162 detail->entries++;
162 cache_get(tmp); 163 cache_get(tmp);
163 is_new = cache_fresh_locked(tmp, new->expiry_time); 164 is_new = cache_fresh_locked(tmp, new->expiry_time);
164 cache_fresh_locked(old, 0); 165 cache_fresh_locked(old, 0);
diff --git a/net/sunrpc/stats.c b/net/sunrpc/stats.c
index dea529666d69..15c2db26767b 100644
--- a/net/sunrpc/stats.c
+++ b/net/sunrpc/stats.c
@@ -176,7 +176,8 @@ void rpc_count_iostats(struct rpc_task *task)
176 op_metrics->om_execute += execute; 176 op_metrics->om_execute += execute;
177} 177}
178 178
179void _print_name(struct seq_file *seq, unsigned int op, struct rpc_procinfo *procs) 179static void _print_name(struct seq_file *seq, unsigned int op,
180 struct rpc_procinfo *procs)
180{ 181{
181 if (procs[op].p_name) 182 if (procs[op].p_name)
182 seq_printf(seq, "\t%12s: ", procs[op].p_name); 183 seq_printf(seq, "\t%12s: ", procs[op].p_name);
diff --git a/net/sysctl_net.c b/net/sysctl_net.c
index 55538f6b60ff..58a1b6b42ddd 100644
--- a/net/sysctl_net.c
+++ b/net/sysctl_net.c
@@ -37,14 +37,6 @@ struct ctl_table net_table[] = {
37 .mode = 0555, 37 .mode = 0555,
38 .child = core_table, 38 .child = core_table,
39 }, 39 },
40#ifdef CONFIG_NET
41 {
42 .ctl_name = NET_ETHER,
43 .procname = "ethernet",
44 .mode = 0555,
45 .child = ether_table,
46 },
47#endif
48#ifdef CONFIG_INET 40#ifdef CONFIG_INET
49 { 41 {
50 .ctl_name = NET_IPV4, 42 .ctl_name = NET_IPV4,
diff --git a/net/tipc/name_distr.c b/net/tipc/name_distr.c
index 953307a9df1d..a3bbc891f959 100644
--- a/net/tipc/name_distr.c
+++ b/net/tipc/name_distr.c
@@ -229,8 +229,7 @@ static void node_is_down(struct publication *publ)
229 publ->node, publ->ref, publ->key); 229 publ->node, publ->ref, publ->key);
230 assert(p == publ); 230 assert(p == publ);
231 write_unlock_bh(&tipc_nametbl_lock); 231 write_unlock_bh(&tipc_nametbl_lock);
232 if (publ) 232 kfree(publ);
233 kfree(publ);
234} 233}
235 234
236/** 235/**
diff --git a/net/x25/x25_timer.c b/net/x25/x25_timer.c
index 0a92e1da3922..71ff3088f6fe 100644
--- a/net/x25/x25_timer.c
+++ b/net/x25/x25_timer.c
@@ -114,8 +114,9 @@ static void x25_heartbeat_expiry(unsigned long param)
114 if (sock_flag(sk, SOCK_DESTROY) || 114 if (sock_flag(sk, SOCK_DESTROY) ||
115 (sk->sk_state == TCP_LISTEN && 115 (sk->sk_state == TCP_LISTEN &&
116 sock_flag(sk, SOCK_DEAD))) { 116 sock_flag(sk, SOCK_DEAD))) {
117 bh_unlock_sock(sk);
117 x25_destroy_socket(sk); 118 x25_destroy_socket(sk);
118 goto unlock; 119 return;
119 } 120 }
120 break; 121 break;
121 122
@@ -128,7 +129,6 @@ static void x25_heartbeat_expiry(unsigned long param)
128 } 129 }
129restart_heartbeat: 130restart_heartbeat:
130 x25_start_heartbeat(sk); 131 x25_start_heartbeat(sk);
131unlock:
132 bh_unlock_sock(sk); 132 bh_unlock_sock(sk);
133} 133}
134 134
diff --git a/net/xfrm/xfrm_input.c b/net/xfrm/xfrm_input.c
index b54971059f16..891a6090cc09 100644
--- a/net/xfrm/xfrm_input.c
+++ b/net/xfrm/xfrm_input.c
@@ -62,7 +62,7 @@ int xfrm_parse_spi(struct sk_buff *skb, u8 nexthdr, u32 *spi, u32 *seq)
62 case IPPROTO_COMP: 62 case IPPROTO_COMP:
63 if (!pskb_may_pull(skb, sizeof(struct ip_comp_hdr))) 63 if (!pskb_may_pull(skb, sizeof(struct ip_comp_hdr)))
64 return -EINVAL; 64 return -EINVAL;
65 *spi = ntohl(ntohs(*(u16*)(skb->h.raw + 2))); 65 *spi = htonl(ntohs(*(u16*)(skb->h.raw + 2)));
66 *seq = 0; 66 *seq = 0;
67 return 0; 67 return 0;
68 default: 68 default:
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index c3725fe2a8fb..b469c8b54613 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -57,12 +57,12 @@ int xfrm_register_type(struct xfrm_type *type, unsigned short family)
57 return -EAFNOSUPPORT; 57 return -EAFNOSUPPORT;
58 typemap = afinfo->type_map; 58 typemap = afinfo->type_map;
59 59
60 write_lock(&typemap->lock); 60 write_lock_bh(&typemap->lock);
61 if (likely(typemap->map[type->proto] == NULL)) 61 if (likely(typemap->map[type->proto] == NULL))
62 typemap->map[type->proto] = type; 62 typemap->map[type->proto] = type;
63 else 63 else
64 err = -EEXIST; 64 err = -EEXIST;
65 write_unlock(&typemap->lock); 65 write_unlock_bh(&typemap->lock);
66 xfrm_policy_put_afinfo(afinfo); 66 xfrm_policy_put_afinfo(afinfo);
67 return err; 67 return err;
68} 68}
@@ -78,12 +78,12 @@ int xfrm_unregister_type(struct xfrm_type *type, unsigned short family)
78 return -EAFNOSUPPORT; 78 return -EAFNOSUPPORT;
79 typemap = afinfo->type_map; 79 typemap = afinfo->type_map;
80 80
81 write_lock(&typemap->lock); 81 write_lock_bh(&typemap->lock);
82 if (unlikely(typemap->map[type->proto] != type)) 82 if (unlikely(typemap->map[type->proto] != type))
83 err = -ENOENT; 83 err = -ENOENT;
84 else 84 else
85 typemap->map[type->proto] = NULL; 85 typemap->map[type->proto] = NULL;
86 write_unlock(&typemap->lock); 86 write_unlock_bh(&typemap->lock);
87 xfrm_policy_put_afinfo(afinfo); 87 xfrm_policy_put_afinfo(afinfo);
88 return err; 88 return err;
89} 89}
@@ -1251,7 +1251,7 @@ int xfrm_policy_register_afinfo(struct xfrm_policy_afinfo *afinfo)
1251 return -EINVAL; 1251 return -EINVAL;
1252 if (unlikely(afinfo->family >= NPROTO)) 1252 if (unlikely(afinfo->family >= NPROTO))
1253 return -EAFNOSUPPORT; 1253 return -EAFNOSUPPORT;
1254 write_lock(&xfrm_policy_afinfo_lock); 1254 write_lock_bh(&xfrm_policy_afinfo_lock);
1255 if (unlikely(xfrm_policy_afinfo[afinfo->family] != NULL)) 1255 if (unlikely(xfrm_policy_afinfo[afinfo->family] != NULL))
1256 err = -ENOBUFS; 1256 err = -ENOBUFS;
1257 else { 1257 else {
@@ -1268,7 +1268,7 @@ int xfrm_policy_register_afinfo(struct xfrm_policy_afinfo *afinfo)
1268 afinfo->garbage_collect = __xfrm_garbage_collect; 1268 afinfo->garbage_collect = __xfrm_garbage_collect;
1269 xfrm_policy_afinfo[afinfo->family] = afinfo; 1269 xfrm_policy_afinfo[afinfo->family] = afinfo;
1270 } 1270 }
1271 write_unlock(&xfrm_policy_afinfo_lock); 1271 write_unlock_bh(&xfrm_policy_afinfo_lock);
1272 return err; 1272 return err;
1273} 1273}
1274EXPORT_SYMBOL(xfrm_policy_register_afinfo); 1274EXPORT_SYMBOL(xfrm_policy_register_afinfo);
@@ -1280,7 +1280,7 @@ int xfrm_policy_unregister_afinfo(struct xfrm_policy_afinfo *afinfo)
1280 return -EINVAL; 1280 return -EINVAL;
1281 if (unlikely(afinfo->family >= NPROTO)) 1281 if (unlikely(afinfo->family >= NPROTO))
1282 return -EAFNOSUPPORT; 1282 return -EAFNOSUPPORT;
1283 write_lock(&xfrm_policy_afinfo_lock); 1283 write_lock_bh(&xfrm_policy_afinfo_lock);
1284 if (likely(xfrm_policy_afinfo[afinfo->family] != NULL)) { 1284 if (likely(xfrm_policy_afinfo[afinfo->family] != NULL)) {
1285 if (unlikely(xfrm_policy_afinfo[afinfo->family] != afinfo)) 1285 if (unlikely(xfrm_policy_afinfo[afinfo->family] != afinfo))
1286 err = -EINVAL; 1286 err = -EINVAL;
@@ -1294,7 +1294,7 @@ int xfrm_policy_unregister_afinfo(struct xfrm_policy_afinfo *afinfo)
1294 afinfo->garbage_collect = NULL; 1294 afinfo->garbage_collect = NULL;
1295 } 1295 }
1296 } 1296 }
1297 write_unlock(&xfrm_policy_afinfo_lock); 1297 write_unlock_bh(&xfrm_policy_afinfo_lock);
1298 return err; 1298 return err;
1299} 1299}
1300EXPORT_SYMBOL(xfrm_policy_unregister_afinfo); 1300EXPORT_SYMBOL(xfrm_policy_unregister_afinfo);
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index a8e14dc1b04e..93a2f36ad3db 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -805,16 +805,22 @@ void xfrm_replay_notify(struct xfrm_state *x, int event)
805 case XFRM_REPLAY_UPDATE: 805 case XFRM_REPLAY_UPDATE:
806 if (x->replay_maxdiff && 806 if (x->replay_maxdiff &&
807 (x->replay.seq - x->preplay.seq < x->replay_maxdiff) && 807 (x->replay.seq - x->preplay.seq < x->replay_maxdiff) &&
808 (x->replay.oseq - x->preplay.oseq < x->replay_maxdiff)) 808 (x->replay.oseq - x->preplay.oseq < x->replay_maxdiff)) {
809 return; 809 if (x->xflags & XFRM_TIME_DEFER)
810 event = XFRM_REPLAY_TIMEOUT;
811 else
812 return;
813 }
810 814
811 break; 815 break;
812 816
813 case XFRM_REPLAY_TIMEOUT: 817 case XFRM_REPLAY_TIMEOUT:
814 if ((x->replay.seq == x->preplay.seq) && 818 if ((x->replay.seq == x->preplay.seq) &&
815 (x->replay.bitmap == x->preplay.bitmap) && 819 (x->replay.bitmap == x->preplay.bitmap) &&
816 (x->replay.oseq == x->preplay.oseq)) 820 (x->replay.oseq == x->preplay.oseq)) {
821 x->xflags |= XFRM_TIME_DEFER;
817 return; 822 return;
823 }
818 824
819 break; 825 break;
820 } 826 }
@@ -825,8 +831,10 @@ void xfrm_replay_notify(struct xfrm_state *x, int event)
825 km_state_notify(x, &c); 831 km_state_notify(x, &c);
826 832
827 if (x->replay_maxage && 833 if (x->replay_maxage &&
828 !mod_timer(&x->rtimer, jiffies + x->replay_maxage)) 834 !mod_timer(&x->rtimer, jiffies + x->replay_maxage)) {
829 xfrm_state_hold(x); 835 xfrm_state_hold(x);
836 x->xflags &= ~XFRM_TIME_DEFER;
837 }
830} 838}
831EXPORT_SYMBOL(xfrm_replay_notify); 839EXPORT_SYMBOL(xfrm_replay_notify);
832 840
@@ -836,10 +844,15 @@ static void xfrm_replay_timer_handler(unsigned long data)
836 844
837 spin_lock(&x->lock); 845 spin_lock(&x->lock);
838 846
839 if (xfrm_aevent_is_on() && x->km.state == XFRM_STATE_VALID) 847 if (x->km.state == XFRM_STATE_VALID) {
840 xfrm_replay_notify(x, XFRM_REPLAY_TIMEOUT); 848 if (xfrm_aevent_is_on())
849 xfrm_replay_notify(x, XFRM_REPLAY_TIMEOUT);
850 else
851 x->xflags |= XFRM_TIME_DEFER;
852 }
841 853
842 spin_unlock(&x->lock); 854 spin_unlock(&x->lock);
855 xfrm_state_put(x);
843} 856}
844 857
845int xfrm_replay_check(struct xfrm_state *x, u32 seq) 858int xfrm_replay_check(struct xfrm_state *x, u32 seq)
@@ -1048,7 +1061,7 @@ int xfrm_state_register_afinfo(struct xfrm_state_afinfo *afinfo)
1048 return -EINVAL; 1061 return -EINVAL;
1049 if (unlikely(afinfo->family >= NPROTO)) 1062 if (unlikely(afinfo->family >= NPROTO))
1050 return -EAFNOSUPPORT; 1063 return -EAFNOSUPPORT;
1051 write_lock(&xfrm_state_afinfo_lock); 1064 write_lock_bh(&xfrm_state_afinfo_lock);
1052 if (unlikely(xfrm_state_afinfo[afinfo->family] != NULL)) 1065 if (unlikely(xfrm_state_afinfo[afinfo->family] != NULL))
1053 err = -ENOBUFS; 1066 err = -ENOBUFS;
1054 else { 1067 else {
@@ -1056,7 +1069,7 @@ int xfrm_state_register_afinfo(struct xfrm_state_afinfo *afinfo)
1056 afinfo->state_byspi = xfrm_state_byspi; 1069 afinfo->state_byspi = xfrm_state_byspi;
1057 xfrm_state_afinfo[afinfo->family] = afinfo; 1070 xfrm_state_afinfo[afinfo->family] = afinfo;
1058 } 1071 }
1059 write_unlock(&xfrm_state_afinfo_lock); 1072 write_unlock_bh(&xfrm_state_afinfo_lock);
1060 return err; 1073 return err;
1061} 1074}
1062EXPORT_SYMBOL(xfrm_state_register_afinfo); 1075EXPORT_SYMBOL(xfrm_state_register_afinfo);
@@ -1068,7 +1081,7 @@ int xfrm_state_unregister_afinfo(struct xfrm_state_afinfo *afinfo)
1068 return -EINVAL; 1081 return -EINVAL;
1069 if (unlikely(afinfo->family >= NPROTO)) 1082 if (unlikely(afinfo->family >= NPROTO))
1070 return -EAFNOSUPPORT; 1083 return -EAFNOSUPPORT;
1071 write_lock(&xfrm_state_afinfo_lock); 1084 write_lock_bh(&xfrm_state_afinfo_lock);
1072 if (likely(xfrm_state_afinfo[afinfo->family] != NULL)) { 1085 if (likely(xfrm_state_afinfo[afinfo->family] != NULL)) {
1073 if (unlikely(xfrm_state_afinfo[afinfo->family] != afinfo)) 1086 if (unlikely(xfrm_state_afinfo[afinfo->family] != afinfo))
1074 err = -EINVAL; 1087 err = -EINVAL;
@@ -1078,7 +1091,7 @@ int xfrm_state_unregister_afinfo(struct xfrm_state_afinfo *afinfo)
1078 afinfo->state_bydst = NULL; 1091 afinfo->state_bydst = NULL;
1079 } 1092 }
1080 } 1093 }
1081 write_unlock(&xfrm_state_afinfo_lock); 1094 write_unlock_bh(&xfrm_state_afinfo_lock);
1082 return err; 1095 return err;
1083} 1096}
1084EXPORT_SYMBOL(xfrm_state_unregister_afinfo); 1097EXPORT_SYMBOL(xfrm_state_unregister_afinfo);
diff --git a/scripts/gen_initramfs_list.sh b/scripts/gen_initramfs_list.sh
index 56b3bed1108f..331c079f029b 100644
--- a/scripts/gen_initramfs_list.sh
+++ b/scripts/gen_initramfs_list.sh
@@ -200,7 +200,11 @@ input_file() {
200 print_mtime "$1" >> ${output} 200 print_mtime "$1" >> ${output}
201 cat "$1" >> ${output} 201 cat "$1" >> ${output}
202 else 202 else
203 grep ^file "$1" | cut -d ' ' -f 3 203 cat "$1" | while read type dir file perm ; do
204 if [ "$type" == "file" ]; then
205 echo "$file \\";
206 fi
207 done
204 fi 208 fi
205 elif [ -d "$1" ]; then 209 elif [ -d "$1" ]; then
206 dir_filelist "$1" 210 dir_filelist "$1"
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index ae5ab981bb1d..8012d1076876 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -5,6 +5,7 @@
5 5
6#include <ctype.h> 6#include <ctype.h>
7#include <stdlib.h> 7#include <stdlib.h>
8#include <stdio.h>
8#include <string.h> 9#include <string.h>
9#include <unistd.h> 10#include <unistd.h>
10#include <time.h> 11#include <time.h>
@@ -531,7 +532,7 @@ int main(int ac, char **av)
531 break; 532 break;
532 case 'h': 533 case 'h':
533 case '?': 534 case '?':
534 printf("%s [-o|-s] config\n", av[0]); 535 fprintf(stderr, "See README for usage info\n");
535 exit(0); 536 exit(0);
536 } 537 }
537 } 538 }
diff --git a/scripts/kconfig/lxdialog/checklist.c b/scripts/kconfig/lxdialog/checklist.c
index db07ae73e051..be0200e9cdaf 100644
--- a/scripts/kconfig/lxdialog/checklist.c
+++ b/scripts/kconfig/lxdialog/checklist.c
@@ -196,8 +196,8 @@ int dialog_checklist(const char *title, const char *prompt, int height,
196 196
197 print_buttons(dialog, height, width, 0); 197 print_buttons(dialog, height, width, 0);
198 198
199 wnoutrefresh(list);
200 wnoutrefresh(dialog); 199 wnoutrefresh(dialog);
200 wnoutrefresh(list);
201 doupdate(); 201 doupdate();
202 202
203 while (key != ESC) { 203 while (key != ESC) {
@@ -225,12 +225,11 @@ int dialog_checklist(const char *title, const char *prompt, int height,
225 } 225 }
226 scroll--; 226 scroll--;
227 print_item(list, items[scroll * 3 + 1], status[scroll], 0, TRUE); 227 print_item(list, items[scroll * 3 + 1], status[scroll], 0, TRUE);
228 wnoutrefresh(list);
229
230 print_arrows(dialog, choice, item_no, 228 print_arrows(dialog, choice, item_no,
231 scroll, box_y, box_x + check_x + 5, list_height); 229 scroll, box_y, box_x + check_x + 5, list_height);
232 230
233 wrefresh(dialog); 231 wnoutrefresh(dialog);
232 wrefresh(list);
234 233
235 continue; /* wait for another key press */ 234 continue; /* wait for another key press */
236 } else 235 } else
@@ -252,12 +251,12 @@ int dialog_checklist(const char *title, const char *prompt, int height,
252 scroll++; 251 scroll++;
253 print_item(list, items[(scroll + max_choice - 1) * 3 + 1], 252 print_item(list, items[(scroll + max_choice - 1) * 3 + 1],
254 status[scroll + max_choice - 1], max_choice - 1, TRUE); 253 status[scroll + max_choice - 1], max_choice - 1, TRUE);
255 wnoutrefresh(list);
256 254
257 print_arrows(dialog, choice, item_no, 255 print_arrows(dialog, choice, item_no,
258 scroll, box_y, box_x + check_x + 5, list_height); 256 scroll, box_y, box_x + check_x + 5, list_height);
259 257
260 wrefresh(dialog); 258 wnoutrefresh(dialog);
259 wrefresh(list);
261 260
262 continue; /* wait for another key press */ 261 continue; /* wait for another key press */
263 } else 262 } else
@@ -271,8 +270,8 @@ int dialog_checklist(const char *title, const char *prompt, int height,
271 choice = i; 270 choice = i;
272 print_item(list, items[(scroll + choice) * 3 + 1], 271 print_item(list, items[(scroll + choice) * 3 + 1],
273 status[scroll + choice], choice, TRUE); 272 status[scroll + choice], choice, TRUE);
274 wnoutrefresh(list); 273 wnoutrefresh(dialog);
275 wrefresh(dialog); 274 wrefresh(list);
276 } 275 }
277 continue; /* wait for another key press */ 276 continue; /* wait for another key press */
278 } 277 }
@@ -306,8 +305,8 @@ int dialog_checklist(const char *title, const char *prompt, int height,
306 print_item(list, items[(scroll + i) * 3 + 1], 305 print_item(list, items[(scroll + i) * 3 + 1],
307 status[scroll + i], i, i == choice); 306 status[scroll + i], i, i == choice);
308 } 307 }
309 wnoutrefresh(list); 308 wnoutrefresh(dialog);
310 wrefresh(dialog); 309 wrefresh(list);
311 310
312 for (i = 0; i < item_no; i++) 311 for (i = 0; i < item_no; i++)
313 if (status[i]) 312 if (status[i])
diff --git a/scripts/mkmakefile b/scripts/mkmakefile
index a22cbedd3b3e..7f9d544f9b6c 100644
--- a/scripts/mkmakefile
+++ b/scripts/mkmakefile
@@ -10,7 +10,10 @@
10# $4 - patchlevel 10# $4 - patchlevel
11 11
12 12
13cat << EOF 13test ! -r $2/Makefile -o -O $2/Makefile || exit 0
14echo " GEN $2/Makefile"
15
16cat << EOF > $2/Makefile
14# Automatically generated by $0: don't edit 17# Automatically generated by $0: don't edit
15 18
16VERSION = $3 19VERSION = $3
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 84e21201f3c0..37f67c23e11b 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -374,10 +374,10 @@ static void do_input(char *alias,
374 kernel_ulong_t *arr, unsigned int min, unsigned int max) 374 kernel_ulong_t *arr, unsigned int min, unsigned int max)
375{ 375{
376 unsigned int i; 376 unsigned int i;
377 for (i = min; i < max; i++) { 377
378 if (arr[i/BITS_PER_LONG] & (1 << (i%BITS_PER_LONG))) 378 for (i = min; i < max; i++)
379 sprintf(alias+strlen(alias), "%X,*", i); 379 if (arr[i / BITS_PER_LONG] & (1 << (i%BITS_PER_LONG)))
380 } 380 sprintf(alias + strlen(alias), "%X,*", i);
381} 381}
382 382
383/* input:b0v0p0e0-eXkXrXaXmXlXsXfXwX where X is comma-separated %02X. */ 383/* input:b0v0p0e0-eXkXrXaXmXlXsXfXwX where X is comma-separated %02X. */
@@ -386,39 +386,37 @@ static int do_input_entry(const char *filename, struct input_device_id *id,
386{ 386{
387 sprintf(alias, "input:"); 387 sprintf(alias, "input:");
388 388
389 ADD(alias, "b", id->flags&INPUT_DEVICE_ID_MATCH_BUS, id->id.bustype); 389 ADD(alias, "b", id->flags & INPUT_DEVICE_ID_MATCH_BUS, id->bustype);
390 ADD(alias, "v", id->flags&INPUT_DEVICE_ID_MATCH_VENDOR, id->id.vendor); 390 ADD(alias, "v", id->flags & INPUT_DEVICE_ID_MATCH_VENDOR, id->vendor);
391 ADD(alias, "p", id->flags&INPUT_DEVICE_ID_MATCH_PRODUCT, 391 ADD(alias, "p", id->flags & INPUT_DEVICE_ID_MATCH_PRODUCT, id->product);
392 id->id.product); 392 ADD(alias, "e", id->flags & INPUT_DEVICE_ID_MATCH_VERSION, id->version);
393 ADD(alias, "e", id->flags&INPUT_DEVICE_ID_MATCH_VERSION,
394 id->id.version);
395 393
396 sprintf(alias + strlen(alias), "-e*"); 394 sprintf(alias + strlen(alias), "-e*");
397 if (id->flags&INPUT_DEVICE_ID_MATCH_EVBIT) 395 if (id->flags & INPUT_DEVICE_ID_MATCH_EVBIT)
398 do_input(alias, id->evbit, 0, EV_MAX); 396 do_input(alias, id->evbit, 0, EV_MAX);
399 sprintf(alias + strlen(alias), "k*"); 397 sprintf(alias + strlen(alias), "k*");
400 if (id->flags&INPUT_DEVICE_ID_MATCH_KEYBIT) 398 if (id->flags & INPUT_DEVICE_ID_MATCH_KEYBIT)
401 do_input(alias, id->keybit, KEY_MIN_INTERESTING, KEY_MAX); 399 do_input(alias, id->keybit, KEY_MIN_INTERESTING, KEY_MAX);
402 sprintf(alias + strlen(alias), "r*"); 400 sprintf(alias + strlen(alias), "r*");
403 if (id->flags&INPUT_DEVICE_ID_MATCH_RELBIT) 401 if (id->flags & INPUT_DEVICE_ID_MATCH_RELBIT)
404 do_input(alias, id->relbit, 0, REL_MAX); 402 do_input(alias, id->relbit, 0, REL_MAX);
405 sprintf(alias + strlen(alias), "a*"); 403 sprintf(alias + strlen(alias), "a*");
406 if (id->flags&INPUT_DEVICE_ID_MATCH_ABSBIT) 404 if (id->flags & INPUT_DEVICE_ID_MATCH_ABSBIT)
407 do_input(alias, id->absbit, 0, ABS_MAX); 405 do_input(alias, id->absbit, 0, ABS_MAX);
408 sprintf(alias + strlen(alias), "m*"); 406 sprintf(alias + strlen(alias), "m*");
409 if (id->flags&INPUT_DEVICE_ID_MATCH_MSCIT) 407 if (id->flags & INPUT_DEVICE_ID_MATCH_MSCIT)
410 do_input(alias, id->mscbit, 0, MSC_MAX); 408 do_input(alias, id->mscbit, 0, MSC_MAX);
411 sprintf(alias + strlen(alias), "l*"); 409 sprintf(alias + strlen(alias), "l*");
412 if (id->flags&INPUT_DEVICE_ID_MATCH_LEDBIT) 410 if (id->flags & INPUT_DEVICE_ID_MATCH_LEDBIT)
413 do_input(alias, id->ledbit, 0, LED_MAX); 411 do_input(alias, id->ledbit, 0, LED_MAX);
414 sprintf(alias + strlen(alias), "s*"); 412 sprintf(alias + strlen(alias), "s*");
415 if (id->flags&INPUT_DEVICE_ID_MATCH_SNDBIT) 413 if (id->flags & INPUT_DEVICE_ID_MATCH_SNDBIT)
416 do_input(alias, id->sndbit, 0, SND_MAX); 414 do_input(alias, id->sndbit, 0, SND_MAX);
417 sprintf(alias + strlen(alias), "f*"); 415 sprintf(alias + strlen(alias), "f*");
418 if (id->flags&INPUT_DEVICE_ID_MATCH_FFBIT) 416 if (id->flags & INPUT_DEVICE_ID_MATCH_FFBIT)
419 do_input(alias, id->ffbit, 0, FF_MAX); 417 do_input(alias, id->ffbit, 0, FF_MAX);
420 sprintf(alias + strlen(alias), "w*"); 418 sprintf(alias + strlen(alias), "w*");
421 if (id->flags&INPUT_DEVICE_ID_MATCH_SWBIT) 419 if (id->flags & INPUT_DEVICE_ID_MATCH_SWBIT)
422 do_input(alias, id->swbit, 0, SW_MAX); 420 do_input(alias, id->swbit, 0, SW_MAX);
423 return 1; 421 return 1;
424} 422}
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 7e8079a34adf..d0f86ed43f7a 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -487,22 +487,24 @@ static int strrcmp(const char *s, const char *sub)
487 * atsym =__param* 487 * atsym =__param*
488 * 488 *
489 * Pattern 2: 489 * Pattern 2:
490 * Many drivers utilise a *_driver container with references to 490 * Many drivers utilise a *driver container with references to
491 * add, remove, probe functions etc. 491 * add, remove, probe functions etc.
492 * These functions may often be marked __init and we do not want to 492 * These functions may often be marked __init and we do not want to
493 * warn here. 493 * warn here.
494 * the pattern is identified by: 494 * the pattern is identified by:
495 * tosec = .init.text | .exit.text 495 * tosec = .init.text | .exit.text | .init.data
496 * fromsec = .data 496 * fromsec = .data
497 * atsym = *_driver, *_ops, *_probe, *probe_one 497 * atsym = *driver, *_template, *_sht, *_ops, *_probe, *probe_one
498 **/ 498 **/
499static int secref_whitelist(const char *tosec, const char *fromsec, 499static int secref_whitelist(const char *tosec, const char *fromsec,
500 const char *atsym) 500 const char *atsym)
501{ 501{
502 int f1 = 1, f2 = 1; 502 int f1 = 1, f2 = 1;
503 const char **s; 503 const char **s;
504 const char *pat2sym[] = { 504 const char *pat2sym[] = {
505 "_driver", 505 "driver",
506 "_template", /* scsi uses *_template a lot */
507 "_sht", /* scsi also used *_sht to some extent */
506 "_ops", 508 "_ops",
507 "_probe", 509 "_probe",
508 "_probe_one", 510 "_probe_one",
@@ -522,7 +524,8 @@ static int secref_whitelist(const char *tosec, const char *fromsec,
522 524
523 /* Check for pattern 2 */ 525 /* Check for pattern 2 */
524 if ((strcmp(tosec, ".init.text") != 0) && 526 if ((strcmp(tosec, ".init.text") != 0) &&
525 (strcmp(tosec, ".exit.text") != 0)) 527 (strcmp(tosec, ".exit.text") != 0) &&
528 (strcmp(tosec, ".init.data") != 0))
526 f2 = 0; 529 f2 = 0;
527 if (strcmp(fromsec, ".data") != 0) 530 if (strcmp(fromsec, ".data") != 0)
528 f2 = 0; 531 f2 = 0;
@@ -694,29 +697,79 @@ static void check_sec_ref(struct module *mod, const char *modname,
694 697
695 /* Walk through all sections */ 698 /* Walk through all sections */
696 for (i = 0; i < hdr->e_shnum; i++) { 699 for (i = 0; i < hdr->e_shnum; i++) {
697 Elf_Rela *rela; 700 const char *name = secstrings + sechdrs[i].sh_name;
698 Elf_Rela *start = (void *)hdr + sechdrs[i].sh_offset; 701 const char *secname;
699 Elf_Rela *stop = (void*)start + sechdrs[i].sh_size; 702 Elf_Rela r;
700 const char *name = secstrings + sechdrs[i].sh_name + 703 unsigned int r_sym;
701 strlen(".rela");
702 /* We want to process only relocation sections and not .init */ 704 /* We want to process only relocation sections and not .init */
703 if (section_ref_ok(name) || (sechdrs[i].sh_type != SHT_RELA)) 705 if (sechdrs[i].sh_type == SHT_RELA) {
704 continue; 706 Elf_Rela *rela;
707 Elf_Rela *start = (void *)hdr + sechdrs[i].sh_offset;
708 Elf_Rela *stop = (void*)start + sechdrs[i].sh_size;
709 name += strlen(".rela");
710 if (section_ref_ok(name))
711 continue;
705 712
706 for (rela = start; rela < stop; rela++) { 713 for (rela = start; rela < stop; rela++) {
707 Elf_Rela r; 714 r.r_offset = TO_NATIVE(rela->r_offset);
708 const char *secname; 715#if KERNEL_ELFCLASS == ELFCLASS64
709 r.r_offset = TO_NATIVE(rela->r_offset); 716 if (hdr->e_machine == EM_MIPS) {
710 r.r_info = TO_NATIVE(rela->r_info); 717 r_sym = ELF64_MIPS_R_SYM(rela->r_info);
711 r.r_addend = TO_NATIVE(rela->r_addend); 718 r_sym = TO_NATIVE(r_sym);
712 sym = elf->symtab_start + ELF_R_SYM(r.r_info); 719 } else {
713 /* Skip special sections */ 720 r.r_info = TO_NATIVE(rela->r_info);
714 if (sym->st_shndx >= SHN_LORESERVE) 721 r_sym = ELF_R_SYM(r.r_info);
722 }
723#else
724 r.r_info = TO_NATIVE(rela->r_info);
725 r_sym = ELF_R_SYM(r.r_info);
726#endif
727 r.r_addend = TO_NATIVE(rela->r_addend);
728 sym = elf->symtab_start + r_sym;
729 /* Skip special sections */
730 if (sym->st_shndx >= SHN_LORESERVE)
731 continue;
732
733 secname = secstrings +
734 sechdrs[sym->st_shndx].sh_name;
735 if (section(secname))
736 warn_sec_mismatch(modname, name,
737 elf, sym, r);
738 }
739 } else if (sechdrs[i].sh_type == SHT_REL) {
740 Elf_Rel *rel;
741 Elf_Rel *start = (void *)hdr + sechdrs[i].sh_offset;
742 Elf_Rel *stop = (void*)start + sechdrs[i].sh_size;
743 name += strlen(".rel");
744 if (section_ref_ok(name))
715 continue; 745 continue;
716 746
717 secname = secstrings + sechdrs[sym->st_shndx].sh_name; 747 for (rel = start; rel < stop; rel++) {
718 if (section(secname)) 748 r.r_offset = TO_NATIVE(rel->r_offset);
719 warn_sec_mismatch(modname, name, elf, sym, r); 749#if KERNEL_ELFCLASS == ELFCLASS64
750 if (hdr->e_machine == EM_MIPS) {
751 r_sym = ELF64_MIPS_R_SYM(rel->r_info);
752 r_sym = TO_NATIVE(r_sym);
753 } else {
754 r.r_info = TO_NATIVE(rel->r_info);
755 r_sym = ELF_R_SYM(r.r_info);
756 }
757#else
758 r.r_info = TO_NATIVE(rel->r_info);
759 r_sym = ELF_R_SYM(r.r_info);
760#endif
761 r.r_addend = 0;
762 sym = elf->symtab_start + r_sym;
763 /* Skip special sections */
764 if (sym->st_shndx >= SHN_LORESERVE)
765 continue;
766
767 secname = secstrings +
768 sechdrs[sym->st_shndx].sh_name;
769 if (section(secname))
770 warn_sec_mismatch(modname, name,
771 elf, sym, r);
772 }
720 } 773 }
721 } 774 }
722} 775}
@@ -820,6 +873,7 @@ static int exit_section(const char *name)
820 * For our future {in}sanity, add a comment that this is the ppc .opd 873 * For our future {in}sanity, add a comment that this is the ppc .opd
821 * section, not the ia64 .opd section. 874 * section, not the ia64 .opd section.
822 * ia64 .opd should not point to discarded sections. 875 * ia64 .opd should not point to discarded sections.
876 * [.rodata] like for .init.text we ignore .rodata references -same reason
823 **/ 877 **/
824static int exit_section_ref_ok(const char *name) 878static int exit_section_ref_ok(const char *name)
825{ 879{
@@ -829,6 +883,7 @@ static int exit_section_ref_ok(const char *name)
829 ".exit.text", 883 ".exit.text",
830 ".exit.data", 884 ".exit.data",
831 ".init.text", 885 ".init.text",
886 ".rodata",
832 ".opd", /* See comment [OPD] */ 887 ".opd", /* See comment [OPD] */
833 ".toc1", /* used by ppc64 */ 888 ".toc1", /* used by ppc64 */
834 ".altinstructions", 889 ".altinstructions",
diff --git a/scripts/mod/modpost.h b/scripts/mod/modpost.h
index b14255c72a37..861d866fcd83 100644
--- a/scripts/mod/modpost.h
+++ b/scripts/mod/modpost.h
@@ -21,6 +21,7 @@
21#define ELF_ST_BIND ELF32_ST_BIND 21#define ELF_ST_BIND ELF32_ST_BIND
22#define ELF_ST_TYPE ELF32_ST_TYPE 22#define ELF_ST_TYPE ELF32_ST_TYPE
23 23
24#define Elf_Rel Elf32_Rel
24#define Elf_Rela Elf32_Rela 25#define Elf_Rela Elf32_Rela
25#define ELF_R_SYM ELF32_R_SYM 26#define ELF_R_SYM ELF32_R_SYM
26#define ELF_R_TYPE ELF32_R_TYPE 27#define ELF_R_TYPE ELF32_R_TYPE
@@ -34,11 +35,31 @@
34#define ELF_ST_BIND ELF64_ST_BIND 35#define ELF_ST_BIND ELF64_ST_BIND
35#define ELF_ST_TYPE ELF64_ST_TYPE 36#define ELF_ST_TYPE ELF64_ST_TYPE
36 37
38#define Elf_Rel Elf64_Rel
37#define Elf_Rela Elf64_Rela 39#define Elf_Rela Elf64_Rela
38#define ELF_R_SYM ELF64_R_SYM 40#define ELF_R_SYM ELF64_R_SYM
39#define ELF_R_TYPE ELF64_R_TYPE 41#define ELF_R_TYPE ELF64_R_TYPE
40#endif 42#endif
41 43
44/* The 64-bit MIPS ELF ABI uses an unusual reloc format. */
45typedef struct
46{
47 Elf32_Word r_sym; /* Symbol index */
48 unsigned char r_ssym; /* Special symbol for 2nd relocation */
49 unsigned char r_type3; /* 3rd relocation type */
50 unsigned char r_type2; /* 2nd relocation type */
51 unsigned char r_type1; /* 1st relocation type */
52} _Elf64_Mips_R_Info;
53
54typedef union
55{
56 Elf64_Xword r_info_number;
57 _Elf64_Mips_R_Info r_info_fields;
58} _Elf64_Mips_R_Info_union;
59
60#define ELF64_MIPS_R_SYM(i) \
61 ((__extension__ (_Elf64_Mips_R_Info_union)(i)).r_info_fields.r_sym)
62
42#if KERNEL_ELFDATA != HOST_ELFDATA 63#if KERNEL_ELFDATA != HOST_ELFDATA
43 64
44static inline void __endian(const void *src, void *dest, unsigned int size) 65static inline void __endian(const void *src, void *dest, unsigned int size)
@@ -48,8 +69,6 @@ static inline void __endian(const void *src, void *dest, unsigned int size)
48 ((unsigned char*)dest)[i] = ((unsigned char*)src)[size - i-1]; 69 ((unsigned char*)dest)[i] = ((unsigned char*)src)[size - i-1];
49} 70}
50 71
51
52
53#define TO_NATIVE(x) \ 72#define TO_NATIVE(x) \
54({ \ 73({ \
55 typeof(x) __x; \ 74 typeof(x) __x; \
diff --git a/security/dummy.c b/security/dummy.c
index fd99429278e9..8ccccccc12ac 100644
--- a/security/dummy.c
+++ b/security/dummy.c
@@ -563,11 +563,6 @@ static int dummy_ipc_permission (struct kern_ipc_perm *ipcp, short flag)
563 return 0; 563 return 0;
564} 564}
565 565
566static int dummy_ipc_getsecurity(struct kern_ipc_perm *ipcp, void *buffer, size_t size)
567{
568 return -EOPNOTSUPP;
569}
570
571static int dummy_msg_msg_alloc_security (struct msg_msg *msg) 566static int dummy_msg_msg_alloc_security (struct msg_msg *msg)
572{ 567{
573 return 0; 568 return 0;
@@ -976,7 +971,6 @@ void security_fixup_ops (struct security_operations *ops)
976 set_to_dummy_if_null(ops, task_reparent_to_init); 971 set_to_dummy_if_null(ops, task_reparent_to_init);
977 set_to_dummy_if_null(ops, task_to_inode); 972 set_to_dummy_if_null(ops, task_to_inode);
978 set_to_dummy_if_null(ops, ipc_permission); 973 set_to_dummy_if_null(ops, ipc_permission);
979 set_to_dummy_if_null(ops, ipc_getsecurity);
980 set_to_dummy_if_null(ops, msg_msg_alloc_security); 974 set_to_dummy_if_null(ops, msg_msg_alloc_security);
981 set_to_dummy_if_null(ops, msg_msg_free_security); 975 set_to_dummy_if_null(ops, msg_msg_free_security);
982 set_to_dummy_if_null(ops, msg_queue_alloc_security); 976 set_to_dummy_if_null(ops, msg_queue_alloc_security);
diff --git a/security/selinux/Makefile b/security/selinux/Makefile
index 688c0a267b62..faf2e02e4410 100644
--- a/security/selinux/Makefile
+++ b/security/selinux/Makefile
@@ -4,7 +4,7 @@
4 4
5obj-$(CONFIG_SECURITY_SELINUX) := selinux.o ss/ 5obj-$(CONFIG_SECURITY_SELINUX) := selinux.o ss/
6 6
7selinux-y := avc.o hooks.o selinuxfs.o netlink.o nlmsgtab.o netif.o 7selinux-y := avc.o hooks.o selinuxfs.o netlink.o nlmsgtab.o netif.o exports.o
8 8
9selinux-$(CONFIG_SECURITY_NETWORK_XFRM) += xfrm.o 9selinux-$(CONFIG_SECURITY_NETWORK_XFRM) += xfrm.o
10 10
diff --git a/security/selinux/avc.c b/security/selinux/avc.c
index ac5d69bb3377..a300702da527 100644
--- a/security/selinux/avc.c
+++ b/security/selinux/avc.c
@@ -800,7 +800,7 @@ out:
800int avc_ss_reset(u32 seqno) 800int avc_ss_reset(u32 seqno)
801{ 801{
802 struct avc_callback_node *c; 802 struct avc_callback_node *c;
803 int i, rc = 0; 803 int i, rc = 0, tmprc;
804 unsigned long flag; 804 unsigned long flag;
805 struct avc_node *node; 805 struct avc_node *node;
806 806
@@ -813,15 +813,16 @@ int avc_ss_reset(u32 seqno)
813 813
814 for (c = avc_callbacks; c; c = c->next) { 814 for (c = avc_callbacks; c; c = c->next) {
815 if (c->events & AVC_CALLBACK_RESET) { 815 if (c->events & AVC_CALLBACK_RESET) {
816 rc = c->callback(AVC_CALLBACK_RESET, 816 tmprc = c->callback(AVC_CALLBACK_RESET,
817 0, 0, 0, 0, NULL); 817 0, 0, 0, 0, NULL);
818 if (rc) 818 /* save the first error encountered for the return
819 goto out; 819 value and continue processing the callbacks */
820 if (!rc)
821 rc = tmprc;
820 } 822 }
821 } 823 }
822 824
823 avc_latest_notif_update(seqno, 0); 825 avc_latest_notif_update(seqno, 0);
824out:
825 return rc; 826 return rc;
826} 827}
827 828
diff --git a/security/selinux/exports.c b/security/selinux/exports.c
new file mode 100644
index 000000000000..ae4c73eb3085
--- /dev/null
+++ b/security/selinux/exports.c
@@ -0,0 +1,74 @@
1/*
2 * SELinux services exported to the rest of the kernel.
3 *
4 * Author: James Morris <jmorris@redhat.com>
5 *
6 * Copyright (C) 2005 Red Hat, Inc., James Morris <jmorris@redhat.com>
7 * Copyright (C) 2006 Trusted Computer Solutions, Inc. <dgoeddel@trustedcs.com>
8 * Copyright (C) 2006 IBM Corporation, Timothy R. Chavez <tinytim@us.ibm.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2,
12 * as published by the Free Software Foundation.
13 */
14#include <linux/types.h>
15#include <linux/kernel.h>
16#include <linux/module.h>
17#include <linux/selinux.h>
18#include <linux/fs.h>
19#include <linux/ipc.h>
20
21#include "security.h"
22#include "objsec.h"
23
24void selinux_task_ctxid(struct task_struct *tsk, u32 *ctxid)
25{
26 struct task_security_struct *tsec = tsk->security;
27 if (selinux_enabled)
28 *ctxid = tsec->sid;
29 else
30 *ctxid = 0;
31}
32
33int selinux_ctxid_to_string(u32 ctxid, char **ctx, u32 *ctxlen)
34{
35 if (selinux_enabled)
36 return security_sid_to_context(ctxid, ctx, ctxlen);
37 else {
38 *ctx = NULL;
39 *ctxlen = 0;
40 }
41
42 return 0;
43}
44
45void selinux_get_inode_sid(const struct inode *inode, u32 *sid)
46{
47 if (selinux_enabled) {
48 struct inode_security_struct *isec = inode->i_security;
49 *sid = isec->sid;
50 return;
51 }
52 *sid = 0;
53}
54
55void selinux_get_ipc_sid(const struct kern_ipc_perm *ipcp, u32 *sid)
56{
57 if (selinux_enabled) {
58 struct ipc_security_struct *isec = ipcp->security;
59 *sid = isec->sid;
60 return;
61 }
62 *sid = 0;
63}
64
65void selinux_get_task_sid(struct task_struct *tsk, u32 *sid)
66{
67 if (selinux_enabled) {
68 struct task_security_struct *tsec = tsk->security;
69 *sid = tsec->sid;
70 return;
71 }
72 *sid = 0;
73}
74
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index b61b9554bc27..90b4cdc0c948 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -101,6 +101,8 @@ static int __init selinux_enabled_setup(char *str)
101 return 1; 101 return 1;
102} 102}
103__setup("selinux=", selinux_enabled_setup); 103__setup("selinux=", selinux_enabled_setup);
104#else
105int selinux_enabled = 1;
104#endif 106#endif
105 107
106/* Original (dummy) security module. */ 108/* Original (dummy) security module. */
@@ -3229,7 +3231,7 @@ static int selinux_socket_sock_rcv_skb(struct sock *sk, struct sk_buff *skb)
3229 goto out; 3231 goto out;
3230 3232
3231 /* Handle mapped IPv4 packets arriving via IPv6 sockets */ 3233 /* Handle mapped IPv4 packets arriving via IPv6 sockets */
3232 if (family == PF_INET6 && skb->protocol == ntohs(ETH_P_IP)) 3234 if (family == PF_INET6 && skb->protocol == htons(ETH_P_IP))
3233 family = PF_INET; 3235 family = PF_INET;
3234 3236
3235 read_lock_bh(&sk->sk_callback_lock); 3237 read_lock_bh(&sk->sk_callback_lock);
@@ -4052,13 +4054,6 @@ static int selinux_ipc_permission(struct kern_ipc_perm *ipcp, short flag)
4052 return ipc_has_perm(ipcp, av); 4054 return ipc_has_perm(ipcp, av);
4053} 4055}
4054 4056
4055static int selinux_ipc_getsecurity(struct kern_ipc_perm *ipcp, void *buffer, size_t size)
4056{
4057 struct ipc_security_struct *isec = ipcp->security;
4058
4059 return selinux_getsecurity(isec->sid, buffer, size);
4060}
4061
4062/* module stacking operations */ 4057/* module stacking operations */
4063static int selinux_register_security (const char *name, struct security_operations *ops) 4058static int selinux_register_security (const char *name, struct security_operations *ops)
4064{ 4059{
@@ -4321,7 +4316,6 @@ static struct security_operations selinux_ops = {
4321 .task_to_inode = selinux_task_to_inode, 4316 .task_to_inode = selinux_task_to_inode,
4322 4317
4323 .ipc_permission = selinux_ipc_permission, 4318 .ipc_permission = selinux_ipc_permission,
4324 .ipc_getsecurity = selinux_ipc_getsecurity,
4325 4319
4326 .msg_msg_alloc_security = selinux_msg_msg_alloc_security, 4320 .msg_msg_alloc_security = selinux_msg_msg_alloc_security,
4327 .msg_msg_free_security = selinux_msg_msg_free_security, 4321 .msg_msg_free_security = selinux_msg_msg_free_security,
@@ -4428,6 +4422,7 @@ void selinux_complete_init(void)
4428 4422
4429 /* Set up any superblocks initialized prior to the policy load. */ 4423 /* Set up any superblocks initialized prior to the policy load. */
4430 printk(KERN_INFO "SELinux: Setting up existing superblocks.\n"); 4424 printk(KERN_INFO "SELinux: Setting up existing superblocks.\n");
4425 spin_lock(&sb_lock);
4431 spin_lock(&sb_security_lock); 4426 spin_lock(&sb_security_lock);
4432next_sb: 4427next_sb:
4433 if (!list_empty(&superblock_security_head)) { 4428 if (!list_empty(&superblock_security_head)) {
@@ -4436,19 +4431,20 @@ next_sb:
4436 struct superblock_security_struct, 4431 struct superblock_security_struct,
4437 list); 4432 list);
4438 struct super_block *sb = sbsec->sb; 4433 struct super_block *sb = sbsec->sb;
4439 spin_lock(&sb_lock);
4440 sb->s_count++; 4434 sb->s_count++;
4441 spin_unlock(&sb_lock);
4442 spin_unlock(&sb_security_lock); 4435 spin_unlock(&sb_security_lock);
4436 spin_unlock(&sb_lock);
4443 down_read(&sb->s_umount); 4437 down_read(&sb->s_umount);
4444 if (sb->s_root) 4438 if (sb->s_root)
4445 superblock_doinit(sb, NULL); 4439 superblock_doinit(sb, NULL);
4446 drop_super(sb); 4440 drop_super(sb);
4441 spin_lock(&sb_lock);
4447 spin_lock(&sb_security_lock); 4442 spin_lock(&sb_security_lock);
4448 list_del_init(&sbsec->list); 4443 list_del_init(&sbsec->list);
4449 goto next_sb; 4444 goto next_sb;
4450 } 4445 }
4451 spin_unlock(&sb_security_lock); 4446 spin_unlock(&sb_security_lock);
4447 spin_unlock(&sb_lock);
4452} 4448}
4453 4449
4454/* SELinux requires early initialization in order to label 4450/* SELinux requires early initialization in order to label
@@ -4543,6 +4539,7 @@ int selinux_disable(void)
4543 printk(KERN_INFO "SELinux: Disabled at runtime.\n"); 4539 printk(KERN_INFO "SELinux: Disabled at runtime.\n");
4544 4540
4545 selinux_disabled = 1; 4541 selinux_disabled = 1;
4542 selinux_enabled = 0;
4546 4543
4547 /* Reset security_ops to the secondary module, dummy or capability. */ 4544 /* Reset security_ops to the secondary module, dummy or capability. */
4548 security_ops = secondary_ops; 4545 security_ops = secondary_ops;
diff --git a/security/selinux/include/security.h b/security/selinux/include/security.h
index 5f016c98056f..063af47bb231 100644
--- a/security/selinux/include/security.h
+++ b/security/selinux/include/security.h
@@ -29,12 +29,7 @@
29#define POLICYDB_VERSION_MIN POLICYDB_VERSION_BASE 29#define POLICYDB_VERSION_MIN POLICYDB_VERSION_BASE
30#define POLICYDB_VERSION_MAX POLICYDB_VERSION_AVTAB 30#define POLICYDB_VERSION_MAX POLICYDB_VERSION_AVTAB
31 31
32#ifdef CONFIG_SECURITY_SELINUX_BOOTPARAM
33extern int selinux_enabled; 32extern int selinux_enabled;
34#else
35#define selinux_enabled 1
36#endif
37
38extern int selinux_mls_enabled; 33extern int selinux_mls_enabled;
39 34
40int security_load_policy(void * data, size_t len); 35int security_load_policy(void * data, size_t len);
diff --git a/security/selinux/ss/mls.c b/security/selinux/ss/mls.c
index 640d0bfdbc68..7bc5b6440f70 100644
--- a/security/selinux/ss/mls.c
+++ b/security/selinux/ss/mls.c
@@ -8,7 +8,7 @@
8 * 8 *
9 * Support for enhanced MLS infrastructure. 9 * Support for enhanced MLS infrastructure.
10 * 10 *
11 * Copyright (C) 2004-2005 Trusted Computer Solutions, Inc. 11 * Copyright (C) 2004-2006 Trusted Computer Solutions, Inc.
12 */ 12 */
13 13
14#include <linux/kernel.h> 14#include <linux/kernel.h>
@@ -264,7 +264,7 @@ int mls_context_to_sid(char oldc,
264 264
265 if (!selinux_mls_enabled) { 265 if (!selinux_mls_enabled) {
266 if (def_sid != SECSID_NULL && oldc) 266 if (def_sid != SECSID_NULL && oldc)
267 *scontext += strlen(*scontext); 267 *scontext += strlen(*scontext)+1;
268 return 0; 268 return 0;
269 } 269 }
270 270
@@ -385,6 +385,34 @@ out:
385} 385}
386 386
387/* 387/*
388 * Set the MLS fields in the security context structure
389 * `context' based on the string representation in
390 * the string `str'. This function will allocate temporary memory with the
391 * given constraints of gfp_mask.
392 */
393int mls_from_string(char *str, struct context *context, gfp_t gfp_mask)
394{
395 char *tmpstr, *freestr;
396 int rc;
397
398 if (!selinux_mls_enabled)
399 return -EINVAL;
400
401 /* we need freestr because mls_context_to_sid will change
402 the value of tmpstr */
403 tmpstr = freestr = kstrdup(str, gfp_mask);
404 if (!tmpstr) {
405 rc = -ENOMEM;
406 } else {
407 rc = mls_context_to_sid(':', &tmpstr, context,
408 NULL, SECSID_NULL);
409 kfree(freestr);
410 }
411
412 return rc;
413}
414
415/*
388 * Copies the effective MLS range from `src' into `dst'. 416 * Copies the effective MLS range from `src' into `dst'.
389 */ 417 */
390static inline int mls_scopy_context(struct context *dst, 418static inline int mls_scopy_context(struct context *dst,
diff --git a/security/selinux/ss/mls.h b/security/selinux/ss/mls.h
index 03de697c8058..fbb42f07dd7c 100644
--- a/security/selinux/ss/mls.h
+++ b/security/selinux/ss/mls.h
@@ -8,7 +8,7 @@
8 * 8 *
9 * Support for enhanced MLS infrastructure. 9 * Support for enhanced MLS infrastructure.
10 * 10 *
11 * Copyright (C) 2004-2005 Trusted Computer Solutions, Inc. 11 * Copyright (C) 2004-2006 Trusted Computer Solutions, Inc.
12 */ 12 */
13 13
14#ifndef _SS_MLS_H_ 14#ifndef _SS_MLS_H_
@@ -27,6 +27,8 @@ int mls_context_to_sid(char oldc,
27 struct sidtab *s, 27 struct sidtab *s,
28 u32 def_sid); 28 u32 def_sid);
29 29
30int mls_from_string(char *str, struct context *context, gfp_t gfp_mask);
31
30int mls_convert_context(struct policydb *oldp, 32int mls_convert_context(struct policydb *oldp,
31 struct policydb *newp, 33 struct policydb *newp,
32 struct context *context); 34 struct context *context);
diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c
index 61492485de84..c284dbb8b8c0 100644
--- a/security/selinux/ss/services.c
+++ b/security/selinux/ss/services.c
@@ -7,12 +7,13 @@
7 * Updated: Trusted Computer Solutions, Inc. <dgoeddel@trustedcs.com> 7 * Updated: Trusted Computer Solutions, Inc. <dgoeddel@trustedcs.com>
8 * 8 *
9 * Support for enhanced MLS infrastructure. 9 * Support for enhanced MLS infrastructure.
10 * Support for context based audit filters.
10 * 11 *
11 * Updated: Frank Mayer <mayerf@tresys.com> and Karl MacMillan <kmacmillan@tresys.com> 12 * Updated: Frank Mayer <mayerf@tresys.com> and Karl MacMillan <kmacmillan@tresys.com>
12 * 13 *
13 * Added conditional policy language extensions 14 * Added conditional policy language extensions
14 * 15 *
15 * Copyright (C) 2004-2005 Trusted Computer Solutions, Inc. 16 * Copyright (C) 2004-2006 Trusted Computer Solutions, Inc.
16 * Copyright (C) 2003 - 2004 Tresys Technology, LLC 17 * Copyright (C) 2003 - 2004 Tresys Technology, LLC
17 * Copyright (C) 2003 Red Hat, Inc., James Morris <jmorris@redhat.com> 18 * Copyright (C) 2003 Red Hat, Inc., James Morris <jmorris@redhat.com>
18 * This program is free software; you can redistribute it and/or modify 19 * This program is free software; you can redistribute it and/or modify
@@ -593,6 +594,10 @@ int security_sid_to_context(u32 sid, char **scontext, u32 *scontext_len)
593 594
594 *scontext_len = strlen(initial_sid_to_string[sid]) + 1; 595 *scontext_len = strlen(initial_sid_to_string[sid]) + 1;
595 scontextp = kmalloc(*scontext_len,GFP_ATOMIC); 596 scontextp = kmalloc(*scontext_len,GFP_ATOMIC);
597 if (!scontextp) {
598 rc = -ENOMEM;
599 goto out;
600 }
596 strcpy(scontextp, initial_sid_to_string[sid]); 601 strcpy(scontextp, initial_sid_to_string[sid]);
597 *scontext = scontextp; 602 *scontext = scontextp;
598 goto out; 603 goto out;
@@ -1811,3 +1816,235 @@ out:
1811 POLICY_RDUNLOCK; 1816 POLICY_RDUNLOCK;
1812 return rc; 1817 return rc;
1813} 1818}
1819
1820struct selinux_audit_rule {
1821 u32 au_seqno;
1822 struct context au_ctxt;
1823};
1824
1825void selinux_audit_rule_free(struct selinux_audit_rule *rule)
1826{
1827 if (rule) {
1828 context_destroy(&rule->au_ctxt);
1829 kfree(rule);
1830 }
1831}
1832
1833int selinux_audit_rule_init(u32 field, u32 op, char *rulestr,
1834 struct selinux_audit_rule **rule)
1835{
1836 struct selinux_audit_rule *tmprule;
1837 struct role_datum *roledatum;
1838 struct type_datum *typedatum;
1839 struct user_datum *userdatum;
1840 int rc = 0;
1841
1842 *rule = NULL;
1843
1844 if (!ss_initialized)
1845 return -ENOTSUPP;
1846
1847 switch (field) {
1848 case AUDIT_SE_USER:
1849 case AUDIT_SE_ROLE:
1850 case AUDIT_SE_TYPE:
1851 /* only 'equals' and 'not equals' fit user, role, and type */
1852 if (op != AUDIT_EQUAL && op != AUDIT_NOT_EQUAL)
1853 return -EINVAL;
1854 break;
1855 case AUDIT_SE_SEN:
1856 case AUDIT_SE_CLR:
1857 /* we do not allow a range, indicated by the presense of '-' */
1858 if (strchr(rulestr, '-'))
1859 return -EINVAL;
1860 break;
1861 default:
1862 /* only the above fields are valid */
1863 return -EINVAL;
1864 }
1865
1866 tmprule = kzalloc(sizeof(struct selinux_audit_rule), GFP_KERNEL);
1867 if (!tmprule)
1868 return -ENOMEM;
1869
1870 context_init(&tmprule->au_ctxt);
1871
1872 POLICY_RDLOCK;
1873
1874 tmprule->au_seqno = latest_granting;
1875
1876 switch (field) {
1877 case AUDIT_SE_USER:
1878 userdatum = hashtab_search(policydb.p_users.table, rulestr);
1879 if (!userdatum)
1880 rc = -EINVAL;
1881 else
1882 tmprule->au_ctxt.user = userdatum->value;
1883 break;
1884 case AUDIT_SE_ROLE:
1885 roledatum = hashtab_search(policydb.p_roles.table, rulestr);
1886 if (!roledatum)
1887 rc = -EINVAL;
1888 else
1889 tmprule->au_ctxt.role = roledatum->value;
1890 break;
1891 case AUDIT_SE_TYPE:
1892 typedatum = hashtab_search(policydb.p_types.table, rulestr);
1893 if (!typedatum)
1894 rc = -EINVAL;
1895 else
1896 tmprule->au_ctxt.type = typedatum->value;
1897 break;
1898 case AUDIT_SE_SEN:
1899 case AUDIT_SE_CLR:
1900 rc = mls_from_string(rulestr, &tmprule->au_ctxt, GFP_ATOMIC);
1901 break;
1902 }
1903
1904 POLICY_RDUNLOCK;
1905
1906 if (rc) {
1907 selinux_audit_rule_free(tmprule);
1908 tmprule = NULL;
1909 }
1910
1911 *rule = tmprule;
1912
1913 return rc;
1914}
1915
1916int selinux_audit_rule_match(u32 ctxid, u32 field, u32 op,
1917 struct selinux_audit_rule *rule,
1918 struct audit_context *actx)
1919{
1920 struct context *ctxt;
1921 struct mls_level *level;
1922 int match = 0;
1923
1924 if (!rule) {
1925 audit_log(actx, GFP_ATOMIC, AUDIT_SELINUX_ERR,
1926 "selinux_audit_rule_match: missing rule\n");
1927 return -ENOENT;
1928 }
1929
1930 POLICY_RDLOCK;
1931
1932 if (rule->au_seqno < latest_granting) {
1933 audit_log(actx, GFP_ATOMIC, AUDIT_SELINUX_ERR,
1934 "selinux_audit_rule_match: stale rule\n");
1935 match = -ESTALE;
1936 goto out;
1937 }
1938
1939 ctxt = sidtab_search(&sidtab, ctxid);
1940 if (!ctxt) {
1941 audit_log(actx, GFP_ATOMIC, AUDIT_SELINUX_ERR,
1942 "selinux_audit_rule_match: unrecognized SID %d\n",
1943 ctxid);
1944 match = -ENOENT;
1945 goto out;
1946 }
1947
1948 /* a field/op pair that is not caught here will simply fall through
1949 without a match */
1950 switch (field) {
1951 case AUDIT_SE_USER:
1952 switch (op) {
1953 case AUDIT_EQUAL:
1954 match = (ctxt->user == rule->au_ctxt.user);
1955 break;
1956 case AUDIT_NOT_EQUAL:
1957 match = (ctxt->user != rule->au_ctxt.user);
1958 break;
1959 }
1960 break;
1961 case AUDIT_SE_ROLE:
1962 switch (op) {
1963 case AUDIT_EQUAL:
1964 match = (ctxt->role == rule->au_ctxt.role);
1965 break;
1966 case AUDIT_NOT_EQUAL:
1967 match = (ctxt->role != rule->au_ctxt.role);
1968 break;
1969 }
1970 break;
1971 case AUDIT_SE_TYPE:
1972 switch (op) {
1973 case AUDIT_EQUAL:
1974 match = (ctxt->type == rule->au_ctxt.type);
1975 break;
1976 case AUDIT_NOT_EQUAL:
1977 match = (ctxt->type != rule->au_ctxt.type);
1978 break;
1979 }
1980 break;
1981 case AUDIT_SE_SEN:
1982 case AUDIT_SE_CLR:
1983 level = (op == AUDIT_SE_SEN ?
1984 &ctxt->range.level[0] : &ctxt->range.level[1]);
1985 switch (op) {
1986 case AUDIT_EQUAL:
1987 match = mls_level_eq(&rule->au_ctxt.range.level[0],
1988 level);
1989 break;
1990 case AUDIT_NOT_EQUAL:
1991 match = !mls_level_eq(&rule->au_ctxt.range.level[0],
1992 level);
1993 break;
1994 case AUDIT_LESS_THAN:
1995 match = (mls_level_dom(&rule->au_ctxt.range.level[0],
1996 level) &&
1997 !mls_level_eq(&rule->au_ctxt.range.level[0],
1998 level));
1999 break;
2000 case AUDIT_LESS_THAN_OR_EQUAL:
2001 match = mls_level_dom(&rule->au_ctxt.range.level[0],
2002 level);
2003 break;
2004 case AUDIT_GREATER_THAN:
2005 match = (mls_level_dom(level,
2006 &rule->au_ctxt.range.level[0]) &&
2007 !mls_level_eq(level,
2008 &rule->au_ctxt.range.level[0]));
2009 break;
2010 case AUDIT_GREATER_THAN_OR_EQUAL:
2011 match = mls_level_dom(level,
2012 &rule->au_ctxt.range.level[0]);
2013 break;
2014 }
2015 }
2016
2017out:
2018 POLICY_RDUNLOCK;
2019 return match;
2020}
2021
2022static int (*aurule_callback)(void) = NULL;
2023
2024static int aurule_avc_callback(u32 event, u32 ssid, u32 tsid,
2025 u16 class, u32 perms, u32 *retained)
2026{
2027 int err = 0;
2028
2029 if (event == AVC_CALLBACK_RESET && aurule_callback)
2030 err = aurule_callback();
2031 return err;
2032}
2033
2034static int __init aurule_init(void)
2035{
2036 int err;
2037
2038 err = avc_add_callback(aurule_avc_callback, AVC_CALLBACK_RESET,
2039 SECSID_NULL, SECSID_NULL, SECCLASS_NULL, 0);
2040 if (err)
2041 panic("avc_add_callback() failed, error %d\n", err);
2042
2043 return err;
2044}
2045__initcall(aurule_init);
2046
2047void selinux_audit_set_callback(int (*callback)(void))
2048{
2049 aurule_callback = callback;
2050}
diff --git a/sound/core/Kconfig b/sound/core/Kconfig
index 8efc1b12f3a8..4262a1c87731 100644
--- a/sound/core/Kconfig
+++ b/sound/core/Kconfig
@@ -142,7 +142,7 @@ config SND_SUPPORT_OLD_API
142 142
143config SND_VERBOSE_PROCFS 143config SND_VERBOSE_PROCFS
144 bool "Verbose procfs contents" 144 bool "Verbose procfs contents"
145 depends on SND 145 depends on SND && PROC_FS
146 default y 146 default y
147 help 147 help
148 Say Y here to include code for verbose procfs contents (provides 148 Say Y here to include code for verbose procfs contents (provides
@@ -171,3 +171,13 @@ config SND_DEBUG_DETECT
171 help 171 help
172 Say Y here to enable extra-verbose log messages printed when 172 Say Y here to enable extra-verbose log messages printed when
173 detecting devices. 173 detecting devices.
174
175config SND_PCM_XRUN_DEBUG
176 bool "Enable PCM ring buffer overrun/underrun debugging"
177 default n
178 depends on SND_DEBUG && SND_VERBOSE_PROCFS
179 help
180 Say Y to enable the PCM ring buffer overrun/underrun debugging.
181 It is usually not required, but if you have trouble with
182 sound clicking when system is loaded, it may help to determine
183 the process or driver which causes the scheduling gaps.
diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c
index c5978d6c6080..ac990bf0b48f 100644
--- a/sound/core/oss/pcm_oss.c
+++ b/sound/core/oss/pcm_oss.c
@@ -1242,6 +1242,8 @@ static int snd_pcm_oss_set_format(struct snd_pcm_oss_file *pcm_oss_file, int for
1242 1242
1243 if (format != AFMT_QUERY) { 1243 if (format != AFMT_QUERY) {
1244 formats = snd_pcm_oss_get_formats(pcm_oss_file); 1244 formats = snd_pcm_oss_get_formats(pcm_oss_file);
1245 if (formats < 0)
1246 return formats;
1245 if (!(formats & format)) 1247 if (!(formats & format))
1246 format = AFMT_U8; 1248 format = AFMT_U8;
1247 for (idx = 1; idx >= 0; --idx) { 1249 for (idx = 1; idx >= 0; --idx) {
@@ -2212,7 +2214,7 @@ static int snd_pcm_oss_mmap(struct file *file, struct vm_area_struct *area)
2212 return 0; 2214 return 0;
2213} 2215}
2214 2216
2215#ifdef CONFIG_PROC_FS 2217#ifdef CONFIG_SND_VERBOSE_PROCFS
2216/* 2218/*
2217 * /proc interface 2219 * /proc interface
2218 */ 2220 */
@@ -2366,10 +2368,10 @@ static void snd_pcm_oss_proc_done(struct snd_pcm *pcm)
2366 } 2368 }
2367 } 2369 }
2368} 2370}
2369#else /* !CONFIG_PROC_FS */ 2371#else /* !CONFIG_SND_VERBOSE_PROCFS */
2370#define snd_pcm_oss_proc_init(pcm) 2372#define snd_pcm_oss_proc_init(pcm)
2371#define snd_pcm_oss_proc_done(pcm) 2373#define snd_pcm_oss_proc_done(pcm)
2372#endif /* CONFIG_PROC_FS */ 2374#endif /* CONFIG_SND_VERBOSE_PROCFS */
2373 2375
2374/* 2376/*
2375 * ENTRY functions 2377 * ENTRY functions
diff --git a/sound/core/pcm.c b/sound/core/pcm.c
index 122e10a61ab9..84b00038236d 100644
--- a/sound/core/pcm.c
+++ b/sound/core/pcm.c
@@ -142,7 +142,7 @@ static int snd_pcm_control_ioctl(struct snd_card *card,
142 return -ENOIOCTLCMD; 142 return -ENOIOCTLCMD;
143} 143}
144 144
145#if defined(CONFIG_PROC_FS) && defined(CONFIG_SND_VERBOSE_PROCFS) 145#ifdef CONFIG_SND_VERBOSE_PROCFS
146 146
147#define STATE(v) [SNDRV_PCM_STATE_##v] = #v 147#define STATE(v) [SNDRV_PCM_STATE_##v] = #v
148#define STREAM(v) [SNDRV_PCM_STREAM_##v] = #v 148#define STREAM(v) [SNDRV_PCM_STREAM_##v] = #v
@@ -436,7 +436,7 @@ static void snd_pcm_substream_proc_status_read(struct snd_info_entry *entry,
436 snd_iprintf(buffer, "appl_ptr : %ld\n", runtime->control->appl_ptr); 436 snd_iprintf(buffer, "appl_ptr : %ld\n", runtime->control->appl_ptr);
437} 437}
438 438
439#ifdef CONFIG_SND_DEBUG 439#ifdef CONFIG_SND_PCM_XRUN_DEBUG
440static void snd_pcm_xrun_debug_read(struct snd_info_entry *entry, 440static void snd_pcm_xrun_debug_read(struct snd_info_entry *entry,
441 struct snd_info_buffer *buffer) 441 struct snd_info_buffer *buffer)
442{ 442{
@@ -480,7 +480,7 @@ static int snd_pcm_stream_proc_init(struct snd_pcm_str *pstr)
480 } 480 }
481 pstr->proc_info_entry = entry; 481 pstr->proc_info_entry = entry;
482 482
483#ifdef CONFIG_SND_DEBUG 483#ifdef CONFIG_SND_PCM_XRUN_DEBUG
484 if ((entry = snd_info_create_card_entry(pcm->card, "xrun_debug", 484 if ((entry = snd_info_create_card_entry(pcm->card, "xrun_debug",
485 pstr->proc_root)) != NULL) { 485 pstr->proc_root)) != NULL) {
486 entry->c.text.read_size = 64; 486 entry->c.text.read_size = 64;
@@ -501,7 +501,7 @@ static int snd_pcm_stream_proc_init(struct snd_pcm_str *pstr)
501 501
502static int snd_pcm_stream_proc_done(struct snd_pcm_str *pstr) 502static int snd_pcm_stream_proc_done(struct snd_pcm_str *pstr)
503{ 503{
504#ifdef CONFIG_SND_DEBUG 504#ifdef CONFIG_SND_PCM_XRUN_DEBUG
505 if (pstr->proc_xrun_debug_entry) { 505 if (pstr->proc_xrun_debug_entry) {
506 snd_info_unregister(pstr->proc_xrun_debug_entry); 506 snd_info_unregister(pstr->proc_xrun_debug_entry);
507 pstr->proc_xrun_debug_entry = NULL; 507 pstr->proc_xrun_debug_entry = NULL;
@@ -599,12 +599,12 @@ static int snd_pcm_substream_proc_done(struct snd_pcm_substream *substream)
599 } 599 }
600 return 0; 600 return 0;
601} 601}
602#else /* !CONFIG_PROC_FS */ 602#else /* !CONFIG_SND_VERBOSE_PROCFS */
603static inline int snd_pcm_stream_proc_init(struct snd_pcm_str *pstr) { return 0; } 603static inline int snd_pcm_stream_proc_init(struct snd_pcm_str *pstr) { return 0; }
604static inline int snd_pcm_stream_proc_done(struct snd_pcm_str *pstr) { return 0; } 604static inline int snd_pcm_stream_proc_done(struct snd_pcm_str *pstr) { return 0; }
605static inline int snd_pcm_substream_proc_init(struct snd_pcm_substream *substream) { return 0; } 605static inline int snd_pcm_substream_proc_init(struct snd_pcm_substream *substream) { return 0; }
606static inline int snd_pcm_substream_proc_done(struct snd_pcm_substream *substream) { return 0; } 606static inline int snd_pcm_substream_proc_done(struct snd_pcm_substream *substream) { return 0; }
607#endif /* CONFIG_PROC_FS */ 607#endif /* CONFIG_SND_VERBOSE_PROCFS */
608 608
609/** 609/**
610 * snd_pcm_new_stream - create a new PCM stream 610 * snd_pcm_new_stream - create a new PCM stream
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
index 230a940d00bd..eedc6cb038bb 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -130,7 +130,7 @@ void snd_pcm_playback_silence(struct snd_pcm_substream *substream, snd_pcm_ufram
130static void xrun(struct snd_pcm_substream *substream) 130static void xrun(struct snd_pcm_substream *substream)
131{ 131{
132 snd_pcm_stop(substream, SNDRV_PCM_STATE_XRUN); 132 snd_pcm_stop(substream, SNDRV_PCM_STATE_XRUN);
133#ifdef CONFIG_SND_DEBUG 133#ifdef CONFIG_SND_PCM_XRUN_DEBUG
134 if (substream->pstr->xrun_debug) { 134 if (substream->pstr->xrun_debug) {
135 snd_printd(KERN_DEBUG "XRUN: pcmC%dD%d%c\n", 135 snd_printd(KERN_DEBUG "XRUN: pcmC%dD%d%c\n",
136 substream->pcm->card->number, 136 substream->pcm->card->number,
@@ -204,7 +204,7 @@ static inline int snd_pcm_update_hw_ptr_interrupt(struct snd_pcm_substream *subs
204 delta = hw_ptr_interrupt - new_hw_ptr; 204 delta = hw_ptr_interrupt - new_hw_ptr;
205 if (delta > 0) { 205 if (delta > 0) {
206 if ((snd_pcm_uframes_t)delta < runtime->buffer_size / 2) { 206 if ((snd_pcm_uframes_t)delta < runtime->buffer_size / 2) {
207#ifdef CONFIG_SND_DEBUG 207#ifdef CONFIG_SND_PCM_XRUN_DEBUG
208 if (runtime->periods > 1 && substream->pstr->xrun_debug) { 208 if (runtime->periods > 1 && substream->pstr->xrun_debug) {
209 snd_printd(KERN_ERR "Unexpected hw_pointer value [1] (stream = %i, delta: -%ld, max jitter = %ld): wrong interrupt acknowledge?\n", substream->stream, (long) delta, runtime->buffer_size / 2); 209 snd_printd(KERN_ERR "Unexpected hw_pointer value [1] (stream = %i, delta: -%ld, max jitter = %ld): wrong interrupt acknowledge?\n", substream->stream, (long) delta, runtime->buffer_size / 2);
210 if (substream->pstr->xrun_debug > 1) 210 if (substream->pstr->xrun_debug > 1)
@@ -249,7 +249,7 @@ int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream)
249 delta = old_hw_ptr - new_hw_ptr; 249 delta = old_hw_ptr - new_hw_ptr;
250 if (delta > 0) { 250 if (delta > 0) {
251 if ((snd_pcm_uframes_t)delta < runtime->buffer_size / 2) { 251 if ((snd_pcm_uframes_t)delta < runtime->buffer_size / 2) {
252#ifdef CONFIG_SND_DEBUG 252#ifdef CONFIG_SND_PCM_XRUN_DEBUG
253 if (runtime->periods > 2 && substream->pstr->xrun_debug) { 253 if (runtime->periods > 2 && substream->pstr->xrun_debug) {
254 snd_printd(KERN_ERR "Unexpected hw_pointer value [2] (stream = %i, delta: -%ld, max jitter = %ld): wrong interrupt acknowledge?\n", substream->stream, (long) delta, runtime->buffer_size / 2); 254 snd_printd(KERN_ERR "Unexpected hw_pointer value [2] (stream = %i, delta: -%ld, max jitter = %ld): wrong interrupt acknowledge?\n", substream->stream, (long) delta, runtime->buffer_size / 2);
255 if (substream->pstr->xrun_debug > 1) 255 if (substream->pstr->xrun_debug > 1)
diff --git a/sound/core/pcm_memory.c b/sound/core/pcm_memory.c
index a0119ae67dcd..428f8c169ee1 100644
--- a/sound/core/pcm_memory.c
+++ b/sound/core/pcm_memory.c
@@ -100,8 +100,10 @@ static void snd_pcm_lib_preallocate_dma_free(struct snd_pcm_substream *substream
100int snd_pcm_lib_preallocate_free(struct snd_pcm_substream *substream) 100int snd_pcm_lib_preallocate_free(struct snd_pcm_substream *substream)
101{ 101{
102 snd_pcm_lib_preallocate_dma_free(substream); 102 snd_pcm_lib_preallocate_dma_free(substream);
103#ifdef CONFIG_SND_VERBOSE_PROCFS
103 snd_info_unregister(substream->proc_prealloc_entry); 104 snd_info_unregister(substream->proc_prealloc_entry);
104 substream->proc_prealloc_entry = NULL; 105 substream->proc_prealloc_entry = NULL;
106#endif
105 return 0; 107 return 0;
106} 108}
107 109
@@ -124,7 +126,7 @@ int snd_pcm_lib_preallocate_free_for_all(struct snd_pcm *pcm)
124 return 0; 126 return 0;
125} 127}
126 128
127#ifdef CONFIG_PROC_FS 129#ifdef CONFIG_SND_VERBOSE_PROCFS
128/* 130/*
129 * read callback for prealloc proc file 131 * read callback for prealloc proc file
130 * 132 *
@@ -203,9 +205,9 @@ static inline void preallocate_info_init(struct snd_pcm_substream *substream)
203 substream->proc_prealloc_entry = entry; 205 substream->proc_prealloc_entry = entry;
204} 206}
205 207
206#else /* !CONFIG_PROC_FS */ 208#else /* !CONFIG_SND_VERBOSE_PROCFS */
207#define preallocate_info_init(s) 209#define preallocate_info_init(s)
208#endif 210#endif /* CONFIG_SND_VERBOSE_PROCFS */
209 211
210/* 212/*
211 * pre-allocate the buffer and create a proc file for the substream 213 * pre-allocate the buffer and create a proc file for the substream
diff --git a/sound/drivers/dummy.c b/sound/drivers/dummy.c
index e35fd5779a9d..ae0df549fac7 100644
--- a/sound/drivers/dummy.c
+++ b/sound/drivers/dummy.c
@@ -675,10 +675,8 @@ static int __init alsa_card_dummy_init(void)
675 continue; 675 continue;
676 device = platform_device_register_simple(SND_DUMMY_DRIVER, 676 device = platform_device_register_simple(SND_DUMMY_DRIVER,
677 i, NULL, 0); 677 i, NULL, 0);
678 if (IS_ERR(device)) { 678 if (IS_ERR(device))
679 err = PTR_ERR(device); 679 continue;
680 goto errout;
681 }
682 devices[i] = device; 680 devices[i] = device;
683 cards++; 681 cards++;
684 } 682 }
@@ -686,14 +684,10 @@ static int __init alsa_card_dummy_init(void)
686#ifdef MODULE 684#ifdef MODULE
687 printk(KERN_ERR "Dummy soundcard not found or device busy\n"); 685 printk(KERN_ERR "Dummy soundcard not found or device busy\n");
688#endif 686#endif
689 err = -ENODEV; 687 snd_dummy_unregister_all();
690 goto errout; 688 return -ENODEV;
691 } 689 }
692 return 0; 690 return 0;
693
694 errout:
695 snd_dummy_unregister_all();
696 return err;
697} 691}
698 692
699static void __exit alsa_card_dummy_exit(void) 693static void __exit alsa_card_dummy_exit(void)
diff --git a/sound/drivers/mpu401/mpu401.c b/sound/drivers/mpu401/mpu401.c
index 9ea3059a7064..77b06009735d 100644
--- a/sound/drivers/mpu401/mpu401.c
+++ b/sound/drivers/mpu401/mpu401.c
@@ -151,7 +151,7 @@ static struct pnp_device_id snd_mpu401_pnpids[] = {
151 151
152MODULE_DEVICE_TABLE(pnp, snd_mpu401_pnpids); 152MODULE_DEVICE_TABLE(pnp, snd_mpu401_pnpids);
153 153
154static int __init snd_mpu401_pnp(int dev, struct pnp_dev *device, 154static int __devinit snd_mpu401_pnp(int dev, struct pnp_dev *device,
155 const struct pnp_device_id *id) 155 const struct pnp_device_id *id)
156{ 156{
157 if (!pnp_port_valid(device, 0) || 157 if (!pnp_port_valid(device, 0) ||
@@ -251,10 +251,8 @@ static int __init alsa_card_mpu401_init(void)
251#endif 251#endif
252 device = platform_device_register_simple(SND_MPU401_DRIVER, 252 device = platform_device_register_simple(SND_MPU401_DRIVER,
253 i, NULL, 0); 253 i, NULL, 0);
254 if (IS_ERR(device)) { 254 if (IS_ERR(device))
255 err = PTR_ERR(device); 255 continue;
256 goto errout;
257 }
258 platform_devices[i] = device; 256 platform_devices[i] = device;
259 snd_mpu401_devices++; 257 snd_mpu401_devices++;
260 } 258 }
@@ -266,14 +264,10 @@ static int __init alsa_card_mpu401_init(void)
266#ifdef MODULE 264#ifdef MODULE
267 printk(KERN_ERR "MPU-401 device not found or device busy\n"); 265 printk(KERN_ERR "MPU-401 device not found or device busy\n");
268#endif 266#endif
269 err = -ENODEV; 267 snd_mpu401_unregister_all();
270 goto errout; 268 return -ENODEV;
271 } 269 }
272 return 0; 270 return 0;
273
274 errout:
275 snd_mpu401_unregister_all();
276 return err;
277} 271}
278 272
279static void __exit alsa_card_mpu401_exit(void) 273static void __exit alsa_card_mpu401_exit(void)
diff --git a/sound/drivers/mpu401/mpu401_uart.c b/sound/drivers/mpu401/mpu401_uart.c
index 8687ae3c66b8..b49a45cbf67a 100644
--- a/sound/drivers/mpu401/mpu401_uart.c
+++ b/sound/drivers/mpu401/mpu401_uart.c
@@ -183,7 +183,8 @@ static void snd_mpu401_uart_remove_timer (struct snd_mpu401 *mpu, int input)
183 183
184 */ 184 */
185 185
186static void snd_mpu401_uart_cmd(struct snd_mpu401 * mpu, unsigned char cmd, int ack) 186static int snd_mpu401_uart_cmd(struct snd_mpu401 * mpu, unsigned char cmd,
187 int ack)
187{ 188{
188 unsigned long flags; 189 unsigned long flags;
189 int timeout, ok; 190 int timeout, ok;
@@ -218,9 +219,11 @@ static void snd_mpu401_uart_cmd(struct snd_mpu401 * mpu, unsigned char cmd, int
218 ok = 1; 219 ok = 1;
219 } 220 }
220 spin_unlock_irqrestore(&mpu->input_lock, flags); 221 spin_unlock_irqrestore(&mpu->input_lock, flags);
221 if (! ok) 222 if (!ok) {
222 snd_printk("cmd: 0x%x failed at 0x%lx (status = 0x%x, data = 0x%x)\n", cmd, mpu->port, mpu->read(mpu, MPU401C(mpu)), mpu->read(mpu, MPU401D(mpu))); 223 snd_printk("cmd: 0x%x failed at 0x%lx (status = 0x%x, data = 0x%x)\n", cmd, mpu->port, mpu->read(mpu, MPU401C(mpu)), mpu->read(mpu, MPU401D(mpu)));
223 // snd_printk("cmd: 0x%x at 0x%lx (status = 0x%x, data = 0x%x)\n", cmd, mpu->port, mpu->read(mpu, MPU401C(mpu)), mpu->read(mpu, MPU401D(mpu))); 224 return 1;
225 }
226 return 0;
224} 227}
225 228
226/* 229/*
@@ -235,12 +238,19 @@ static int snd_mpu401_uart_input_open(struct snd_rawmidi_substream *substream)
235 if (mpu->open_input && (err = mpu->open_input(mpu)) < 0) 238 if (mpu->open_input && (err = mpu->open_input(mpu)) < 0)
236 return err; 239 return err;
237 if (! test_bit(MPU401_MODE_BIT_OUTPUT, &mpu->mode)) { 240 if (! test_bit(MPU401_MODE_BIT_OUTPUT, &mpu->mode)) {
238 snd_mpu401_uart_cmd(mpu, MPU401_RESET, 1); 241 if (snd_mpu401_uart_cmd(mpu, MPU401_RESET, 1))
239 snd_mpu401_uart_cmd(mpu, MPU401_ENTER_UART, 1); 242 goto error_out;
243 if (snd_mpu401_uart_cmd(mpu, MPU401_ENTER_UART, 1))
244 goto error_out;
240 } 245 }
241 mpu->substream_input = substream; 246 mpu->substream_input = substream;
242 set_bit(MPU401_MODE_BIT_INPUT, &mpu->mode); 247 set_bit(MPU401_MODE_BIT_INPUT, &mpu->mode);
243 return 0; 248 return 0;
249
250error_out:
251 if (mpu->open_input && mpu->close_input)
252 mpu->close_input(mpu);
253 return -EIO;
244} 254}
245 255
246static int snd_mpu401_uart_output_open(struct snd_rawmidi_substream *substream) 256static int snd_mpu401_uart_output_open(struct snd_rawmidi_substream *substream)
@@ -252,39 +262,52 @@ static int snd_mpu401_uart_output_open(struct snd_rawmidi_substream *substream)
252 if (mpu->open_output && (err = mpu->open_output(mpu)) < 0) 262 if (mpu->open_output && (err = mpu->open_output(mpu)) < 0)
253 return err; 263 return err;
254 if (! test_bit(MPU401_MODE_BIT_INPUT, &mpu->mode)) { 264 if (! test_bit(MPU401_MODE_BIT_INPUT, &mpu->mode)) {
255 snd_mpu401_uart_cmd(mpu, MPU401_RESET, 1); 265 if (snd_mpu401_uart_cmd(mpu, MPU401_RESET, 1))
256 snd_mpu401_uart_cmd(mpu, MPU401_ENTER_UART, 1); 266 goto error_out;
267 if (snd_mpu401_uart_cmd(mpu, MPU401_ENTER_UART, 1))
268 goto error_out;
257 } 269 }
258 mpu->substream_output = substream; 270 mpu->substream_output = substream;
259 set_bit(MPU401_MODE_BIT_OUTPUT, &mpu->mode); 271 set_bit(MPU401_MODE_BIT_OUTPUT, &mpu->mode);
260 return 0; 272 return 0;
273
274error_out:
275 if (mpu->open_output && mpu->close_output)
276 mpu->close_output(mpu);
277 return -EIO;
261} 278}
262 279
263static int snd_mpu401_uart_input_close(struct snd_rawmidi_substream *substream) 280static int snd_mpu401_uart_input_close(struct snd_rawmidi_substream *substream)
264{ 281{
265 struct snd_mpu401 *mpu; 282 struct snd_mpu401 *mpu;
283 int err = 0;
266 284
267 mpu = substream->rmidi->private_data; 285 mpu = substream->rmidi->private_data;
268 clear_bit(MPU401_MODE_BIT_INPUT, &mpu->mode); 286 clear_bit(MPU401_MODE_BIT_INPUT, &mpu->mode);
269 mpu->substream_input = NULL; 287 mpu->substream_input = NULL;
270 if (! test_bit(MPU401_MODE_BIT_OUTPUT, &mpu->mode)) 288 if (! test_bit(MPU401_MODE_BIT_OUTPUT, &mpu->mode))
271 snd_mpu401_uart_cmd(mpu, MPU401_RESET, 0); 289 err = snd_mpu401_uart_cmd(mpu, MPU401_RESET, 0);
272 if (mpu->close_input) 290 if (mpu->close_input)
273 mpu->close_input(mpu); 291 mpu->close_input(mpu);
292 if (err)
293 return -EIO;
274 return 0; 294 return 0;
275} 295}
276 296
277static int snd_mpu401_uart_output_close(struct snd_rawmidi_substream *substream) 297static int snd_mpu401_uart_output_close(struct snd_rawmidi_substream *substream)
278{ 298{
279 struct snd_mpu401 *mpu; 299 struct snd_mpu401 *mpu;
300 int err = 0;
280 301
281 mpu = substream->rmidi->private_data; 302 mpu = substream->rmidi->private_data;
282 clear_bit(MPU401_MODE_BIT_OUTPUT, &mpu->mode); 303 clear_bit(MPU401_MODE_BIT_OUTPUT, &mpu->mode);
283 mpu->substream_output = NULL; 304 mpu->substream_output = NULL;
284 if (! test_bit(MPU401_MODE_BIT_INPUT, &mpu->mode)) 305 if (! test_bit(MPU401_MODE_BIT_INPUT, &mpu->mode))
285 snd_mpu401_uart_cmd(mpu, MPU401_RESET, 0); 306 err = snd_mpu401_uart_cmd(mpu, MPU401_RESET, 0);
286 if (mpu->close_output) 307 if (mpu->close_output)
287 mpu->close_output(mpu); 308 mpu->close_output(mpu);
309 if (err)
310 return -EIO;
288 return 0; 311 return 0;
289} 312}
290 313
@@ -316,6 +339,7 @@ static void snd_mpu401_uart_input_trigger(struct snd_rawmidi_substream *substrea
316 snd_mpu401_uart_remove_timer(mpu, 1); 339 snd_mpu401_uart_remove_timer(mpu, 1);
317 clear_bit(MPU401_MODE_BIT_INPUT_TRIGGER, &mpu->mode); 340 clear_bit(MPU401_MODE_BIT_INPUT_TRIGGER, &mpu->mode);
318 } 341 }
342
319} 343}
320 344
321/* 345/*
diff --git a/sound/drivers/serial-u16550.c b/sound/drivers/serial-u16550.c
index 1a7fbefe4740..c01b4c5118b9 100644
--- a/sound/drivers/serial-u16550.c
+++ b/sound/drivers/serial-u16550.c
@@ -996,10 +996,8 @@ static int __init alsa_card_serial_init(void)
996 continue; 996 continue;
997 device = platform_device_register_simple(SND_SERIAL_DRIVER, 997 device = platform_device_register_simple(SND_SERIAL_DRIVER,
998 i, NULL, 0); 998 i, NULL, 0);
999 if (IS_ERR(device)) { 999 if (IS_ERR(device))
1000 err = PTR_ERR(device); 1000 continue;
1001 goto errout;
1002 }
1003 devices[i] = device; 1001 devices[i] = device;
1004 cards++; 1002 cards++;
1005 } 1003 }
@@ -1007,14 +1005,10 @@ static int __init alsa_card_serial_init(void)
1007#ifdef MODULE 1005#ifdef MODULE
1008 printk(KERN_ERR "serial midi soundcard not found or device busy\n"); 1006 printk(KERN_ERR "serial midi soundcard not found or device busy\n");
1009#endif 1007#endif
1010 err = -ENODEV; 1008 snd_serial_unregister_all();
1011 goto errout; 1009 return -ENODEV;
1012 } 1010 }
1013 return 0; 1011 return 0;
1014
1015 errout:
1016 snd_serial_unregister_all();
1017 return err;
1018} 1012}
1019 1013
1020static void __exit alsa_card_serial_exit(void) 1014static void __exit alsa_card_serial_exit(void)
diff --git a/sound/drivers/virmidi.c b/sound/drivers/virmidi.c
index a3ee306239c9..26eb2499d442 100644
--- a/sound/drivers/virmidi.c
+++ b/sound/drivers/virmidi.c
@@ -169,10 +169,8 @@ static int __init alsa_card_virmidi_init(void)
169 continue; 169 continue;
170 device = platform_device_register_simple(SND_VIRMIDI_DRIVER, 170 device = platform_device_register_simple(SND_VIRMIDI_DRIVER,
171 i, NULL, 0); 171 i, NULL, 0);
172 if (IS_ERR(device)) { 172 if (IS_ERR(device))
173 err = PTR_ERR(device); 173 continue;
174 goto errout;
175 }
176 devices[i] = device; 174 devices[i] = device;
177 cards++; 175 cards++;
178 } 176 }
@@ -180,14 +178,10 @@ static int __init alsa_card_virmidi_init(void)
180#ifdef MODULE 178#ifdef MODULE
181 printk(KERN_ERR "Card-VirMIDI soundcard not found or device busy\n"); 179 printk(KERN_ERR "Card-VirMIDI soundcard not found or device busy\n");
182#endif 180#endif
183 err = -ENODEV; 181 snd_virmidi_unregister_all();
184 goto errout; 182 return -ENODEV;
185 } 183 }
186 return 0; 184 return 0;
187
188 errout:
189 snd_virmidi_unregister_all();
190 return err;
191} 185}
192 186
193static void __exit alsa_card_virmidi_exit(void) 187static void __exit alsa_card_virmidi_exit(void)
diff --git a/sound/isa/es18xx.c b/sound/isa/es18xx.c
index a36ec1daa5cb..e6945db8ed1b 100644
--- a/sound/isa/es18xx.c
+++ b/sound/isa/es18xx.c
@@ -85,6 +85,8 @@
85#include <linux/pnp.h> 85#include <linux/pnp.h>
86#include <linux/isapnp.h> 86#include <linux/isapnp.h>
87#include <linux/moduleparam.h> 87#include <linux/moduleparam.h>
88#include <linux/delay.h>
89
88#include <asm/io.h> 90#include <asm/io.h>
89#include <asm/dma.h> 91#include <asm/dma.h>
90#include <sound/core.h> 92#include <sound/core.h>
diff --git a/sound/isa/opti9xx/miro.c b/sound/isa/opti9xx/miro.c
index 83d64bc07ff0..e6bfcf74c1c1 100644
--- a/sound/isa/opti9xx/miro.c
+++ b/sound/isa/opti9xx/miro.c
@@ -1179,20 +1179,17 @@ static int __init snd_card_miro_aci_detect(struct snd_card *card, struct snd_mir
1179 /* force ACI into a known state */ 1179 /* force ACI into a known state */
1180 for (i = 0; i < 3; i++) 1180 for (i = 0; i < 3; i++)
1181 if (aci_cmd(miro, ACI_ERROR_OP, -1, -1) < 0) { 1181 if (aci_cmd(miro, ACI_ERROR_OP, -1, -1) < 0) {
1182 snd_card_free(card);
1183 snd_printk(KERN_ERR "can't force aci into known state.\n"); 1182 snd_printk(KERN_ERR "can't force aci into known state.\n");
1184 return -ENXIO; 1183 return -ENXIO;
1185 } 1184 }
1186 1185
1187 if ((miro->aci_vendor=aci_cmd(miro, ACI_READ_IDCODE, -1, -1)) < 0 || 1186 if ((miro->aci_vendor=aci_cmd(miro, ACI_READ_IDCODE, -1, -1)) < 0 ||
1188 (miro->aci_product=aci_cmd(miro, ACI_READ_IDCODE, -1, -1)) < 0) { 1187 (miro->aci_product=aci_cmd(miro, ACI_READ_IDCODE, -1, -1)) < 0) {
1189 snd_card_free(card);
1190 snd_printk(KERN_ERR "can't read aci id on 0x%lx.\n", miro->aci_port); 1188 snd_printk(KERN_ERR "can't read aci id on 0x%lx.\n", miro->aci_port);
1191 return -ENXIO; 1189 return -ENXIO;
1192 } 1190 }
1193 1191
1194 if ((miro->aci_version=aci_cmd(miro, ACI_READ_VERSION, -1, -1)) < 0) { 1192 if ((miro->aci_version=aci_cmd(miro, ACI_READ_VERSION, -1, -1)) < 0) {
1195 snd_card_free(card);
1196 snd_printk(KERN_ERR "can't read aci version on 0x%lx.\n", 1193 snd_printk(KERN_ERR "can't read aci version on 0x%lx.\n",
1197 miro->aci_port); 1194 miro->aci_port);
1198 return -ENXIO; 1195 return -ENXIO;
diff --git a/sound/oss/Kconfig b/sound/oss/Kconfig
index 88e52dc84c09..558c6ed443be 100644
--- a/sound/oss/Kconfig
+++ b/sound/oss/Kconfig
@@ -5,23 +5,9 @@
5# 5#
6# Prompt user for primary drivers. 6# Prompt user for primary drivers.
7 7
8config OBSOLETE_OSS_DRIVER
9 bool "Obsolete OSS drivers"
10 depends on SOUND_PRIME
11 help
12 This option enables support for obsolete OSS drivers that
13 are scheduled for removal in the near future since there
14 are ALSA drivers for the same hardware.
15
16 Please contact Adrian Bunk <bunk@stusta.de> if you had to
17 say Y here because your soundcard is not properly supported
18 by ALSA.
19
20 If unsure, say N.
21
22config SOUND_BT878 8config SOUND_BT878
23 tristate "BT878 audio dma" 9 tristate "BT878 audio dma"
24 depends on SOUND_PRIME && PCI && OBSOLETE_OSS_DRIVER 10 depends on SOUND_PRIME && PCI
25 ---help--- 11 ---help---
26 Audio DMA support for bt878 based grabber boards. As you might have 12 Audio DMA support for bt878 based grabber boards. As you might have
27 already noticed, bt878 is listed with two functions in /proc/pci. 13 already noticed, bt878 is listed with two functions in /proc/pci.
@@ -35,48 +21,9 @@ config SOUND_BT878
35 To compile this driver as a module, choose M here: the module will 21 To compile this driver as a module, choose M here: the module will
36 be called btaudio. 22 be called btaudio.
37 23
38config SOUND_CMPCI
39 tristate "C-Media PCI (CMI8338/8738)"
40 depends on SOUND_PRIME && PCI && OBSOLETE_OSS_DRIVER
41 help
42 Say Y or M if you have a PCI sound card using the CMI8338
43 or the CMI8738 chipset. Data on these chips are available at
44 <http://www.cmedia.com.tw/>.
45
46 A userspace utility to control some internal registers of these
47 chips is available at
48 <http://member.nifty.ne.jp/Breeze/softwares/unix/cmictl-e.html>.
49
50config SOUND_CMPCI_FM
51 bool "Enable legacy FM"
52 depends on SOUND_CMPCI && X86
53 help
54 Say Y here to enable the legacy FM (frequency-modulation) synthesizer
55 support on a card using the CMI8338 or CMI8378 chipset. Even it is
56 enabled, you need to set fmio as proper value to enable it.
57 Say N here if you don't need this.
58
59config SOUND_CMPCI_MIDI
60 bool "Enable legacy MPU-401"
61 depends on SOUND_CMPCI && X86
62 help
63 Say Y here to enable the legacy MPU401 MIDI synthesizer support on a
64 card using the CMI8338 or CMI8378 chipset. Even it is enabled,
65 you need to set mpuio as proper value to enable it.
66 Say N here if you don't need this.
67
68config SOUND_CMPCI_JOYSTICK
69 bool "Enable joystick"
70 depends on SOUND_CMPCI && X86 && (GAMEPORT=y || SOUND_CMPCI=GAMEPORT)
71 help
72 Say Y here in order to enable the joystick port on a sound card using
73 the CMI8338 or the CMI8738 chipset. You need to config the
74 gameport support and set joystick parameter as 1 to use it.
75 Say N here if you don't need this.
76
77config SOUND_EMU10K1 24config SOUND_EMU10K1
78 tristate "Creative SBLive! (EMU10K1)" 25 tristate "Creative SBLive! (EMU10K1)"
79 depends on SOUND_PRIME && PCI && OBSOLETE_OSS_DRIVER 26 depends on SOUND_PRIME && PCI
80 ---help--- 27 ---help---
81 Say Y or M if you have a PCI sound card using the EMU10K1 chipset, 28 Say Y or M if you have a PCI sound card using the EMU10K1 chipset,
82 such as the Creative SBLive!, SB PCI512 or Emu-APS. 29 such as the Creative SBLive!, SB PCI512 or Emu-APS.
@@ -108,13 +55,6 @@ config SOUND_FUSION
108 series) when wired as native sound drivers with AC97 codecs. If 55 series) when wired as native sound drivers with AC97 codecs. If
109 this driver does not work try the CS4232 driver. 56 this driver does not work try the CS4232 driver.
110 57
111config SOUND_CS4281
112 tristate "Crystal Sound CS4281"
113 depends on SOUND_PRIME && PCI && OBSOLETE_OSS_DRIVER
114 help
115 Picture and feature list at
116 <http://www.pcbroker.com/crystal4281.html>.
117
118config SOUND_BCM_CS4297A 58config SOUND_BCM_CS4297A
119 tristate "Crystal Sound CS4297a (for Swarm)" 59 tristate "Crystal Sound CS4297a (for Swarm)"
120 depends on SOUND_PRIME && SIBYTE_SWARM 60 depends on SOUND_PRIME && SIBYTE_SWARM
@@ -125,22 +65,9 @@ config SOUND_BCM_CS4297A
125 note that CONFIG_KGDB should not be enabled at the same 65 note that CONFIG_KGDB should not be enabled at the same
126 time, since it also attempts to use this UART port. 66 time, since it also attempts to use this UART port.
127 67
128config SOUND_ES1370
129 tristate "Ensoniq AudioPCI (ES1370)"
130 depends on SOUND_PRIME && PCI && OBSOLETE_OSS_DRIVER
131 help
132 Say Y or M if you have a PCI sound card utilizing the Ensoniq
133 ES1370 chipset, such as Ensoniq's AudioPCI (non-97). To find
134 out if your sound card uses an ES1370 without removing your
135 computer's cover, use lspci -n and look for the PCI ID
136 1274:5000. Since Ensoniq was bought by Creative Labs,
137 Sound Blaster 64/PCI models are either ES1370 or ES1371 based.
138 This driver differs slightly from OSS/Free, so PLEASE READ
139 <file:Documentation/sound/oss/es1370>.
140
141config SOUND_ES1371 68config SOUND_ES1371
142 tristate "Creative Ensoniq AudioPCI 97 (ES1371)" 69 tristate "Creative Ensoniq AudioPCI 97 (ES1371)"
143 depends on SOUND_PRIME && PCI && OBSOLETE_OSS_DRIVER 70 depends on SOUND_PRIME && PCI
144 help 71 help
145 Say Y or M if you have a PCI sound card utilizing the Ensoniq 72 Say Y or M if you have a PCI sound card utilizing the Ensoniq
146 ES1371 chipset, such as Ensoniq's AudioPCI97. To find out if 73 ES1371 chipset, such as Ensoniq's AudioPCI97. To find out if
@@ -151,33 +78,6 @@ config SOUND_ES1371
151 slightly from OSS/Free, so PLEASE READ 78 slightly from OSS/Free, so PLEASE READ
152 <file:Documentation/sound/oss/es1371>. 79 <file:Documentation/sound/oss/es1371>.
153 80
154config SOUND_ESSSOLO1
155 tristate "ESS Technology Solo1"
156 depends on SOUND_PRIME && PCI && OBSOLETE_OSS_DRIVER
157 help
158 Say Y or M if you have a PCI sound card utilizing the ESS Technology
159 Solo1 chip. To find out if your sound card uses a
160 Solo1 chip without removing your computer's cover, use
161 lspci -n and look for the PCI ID 125D:1969. This driver
162 differs slightly from OSS/Free, so PLEASE READ
163 <file:Documentation/sound/oss/solo1>.
164
165config SOUND_MAESTRO
166 tristate "ESS Maestro, Maestro2, Maestro2E driver"
167 depends on SOUND_PRIME && PCI && OBSOLETE_OSS_DRIVER
168 help
169 Say Y or M if you have a sound system driven by ESS's Maestro line
170 of PCI sound chips. These include the Maestro 1, Maestro 2, and
171 Maestro 2E. See <file:Documentation/sound/oss/Maestro> for more
172 details.
173
174config SOUND_MAESTRO3
175 tristate "ESS Maestro3/Allegro driver (EXPERIMENTAL)"
176 depends on SOUND_PRIME && PCI && EXPERIMENTAL && OBSOLETE_OSS_DRIVER
177 help
178 Say Y or M if you have a sound system driven by ESS's Maestro 3
179 PCI sound chip.
180
181config SOUND_ICH 81config SOUND_ICH
182 tristate "Intel ICH (i8xx) audio support" 82 tristate "Intel ICH (i8xx) audio support"
183 depends on SOUND_PRIME && PCI 83 depends on SOUND_PRIME && PCI
@@ -185,24 +85,6 @@ config SOUND_ICH
185 Support for integral audio in Intel's I/O Controller Hub (ICH) 85 Support for integral audio in Intel's I/O Controller Hub (ICH)
186 chipset, as used on the 810/820/840 motherboards. 86 chipset, as used on the 810/820/840 motherboards.
187 87
188config SOUND_HARMONY
189 tristate "PA Harmony audio driver"
190 depends on GSC_LASI && SOUND_PRIME && OBSOLETE_OSS_DRIVER
191 help
192 Say 'Y' or 'M' to include support for Harmony soundchip
193 on HP 712, 715/new and many other GSC based machines.
194
195config SOUND_SONICVIBES
196 tristate "S3 SonicVibes"
197 depends on SOUND_PRIME && PCI && OBSOLETE_OSS_DRIVER
198 help
199 Say Y or M if you have a PCI sound card utilizing the S3
200 SonicVibes chipset. To find out if your sound card uses a
201 SonicVibes chip without removing your computer's cover, use
202 lspci -n and look for the PCI ID 5333:CA00. This driver
203 differs slightly from OSS/Free, so PLEASE READ
204 <file:Documentation/sound/oss/sonicvibes>.
205
206config SOUND_VWSND 88config SOUND_VWSND
207 tristate "SGI Visual Workstation Sound" 89 tristate "SGI Visual Workstation Sound"
208 depends on SOUND_PRIME && X86_VISWS 90 depends on SOUND_PRIME && X86_VISWS
@@ -231,10 +113,6 @@ config SOUND_VRC5477
231 integrated, multi-function controller chip for MIPS CPUs. Works 113 integrated, multi-function controller chip for MIPS CPUs. Works
232 with the AC97 codec. 114 with the AC97 codec.
233 115
234config SOUND_AU1000
235 tristate "Au1000 Sound"
236 depends on SOUND_PRIME && (SOC_AU1000 || SOC_AU1100 || SOC_AU1500) && OBSOLETE_OSS_DRIVER
237
238config SOUND_AU1550_AC97 116config SOUND_AU1550_AC97
239 tristate "Au1550 AC97 Sound" 117 tristate "Au1550 AC97 Sound"
240 depends on SOUND_PRIME && SOC_AU1550 118 depends on SOUND_PRIME && SOC_AU1550
@@ -507,7 +385,7 @@ config MSND_FIFOSIZE
507 385
508config SOUND_VIA82CXXX 386config SOUND_VIA82CXXX
509 tristate "VIA 82C686 Audio Codec" 387 tristate "VIA 82C686 Audio Codec"
510 depends on SOUND_PRIME && PCI && OBSOLETE_OSS_DRIVER 388 depends on SOUND_PRIME && PCI
511 help 389 help
512 Say Y here to include support for the audio codec found on VIA 390 Say Y here to include support for the audio codec found on VIA
513 82Cxxx-based chips. Typically these are built into a motherboard. 391 82Cxxx-based chips. Typically these are built into a motherboard.
@@ -576,18 +454,6 @@ config SOUND_AD1889
576 Say M here if you have a sound card based on the Analog Devices 454 Say M here if you have a sound card based on the Analog Devices
577 AD1889 chip. 455 AD1889 chip.
578 456
579config SOUND_SGALAXY
580 tristate "Aztech Sound Galaxy (non-PnP) cards"
581 depends on SOUND_OSS && OBSOLETE_OSS_DRIVER
582 help
583 This module initializes the older non Plug and Play sound galaxy
584 cards from Aztech. It supports the Waverider Pro 32 - 3D and the
585 Galaxy Washington 16.
586
587 If you compile the driver into the kernel, you have to add
588 "sgalaxy=<io>,<irq>,<dma>,<dma2>,<sgbase>" to the kernel command
589 line.
590
591config SOUND_ADLIB 457config SOUND_ADLIB
592 tristate "Adlib Cards" 458 tristate "Adlib Cards"
593 depends on SOUND_OSS 459 depends on SOUND_OSS
@@ -614,7 +480,7 @@ config SOUND_ACI_MIXER
614 480
615config SOUND_CS4232 481config SOUND_CS4232
616 tristate "Crystal CS4232 based (PnP) cards" 482 tristate "Crystal CS4232 based (PnP) cards"
617 depends on SOUND_OSS && OBSOLETE_OSS_DRIVER 483 depends on SOUND_OSS
618 help 484 help
619 Say Y here if you have a card based on the Crystal CS4232 chip set, 485 Say Y here if you have a card based on the Crystal CS4232 chip set,
620 which uses its own Plug and Play protocol. 486 which uses its own Plug and Play protocol.
@@ -626,42 +492,6 @@ config SOUND_CS4232
626 See <file:Documentation/sound/oss/CS4232> for more information on 492 See <file:Documentation/sound/oss/CS4232> for more information on
627 configuring this card. 493 configuring this card.
628 494
629config SOUND_SSCAPE
630 tristate "Ensoniq SoundScape support"
631 depends on SOUND_OSS && OBSOLETE_OSS_DRIVER
632 help
633 Answer Y if you have a sound card based on the Ensoniq SoundScape
634 chipset. Such cards are being manufactured at least by Ensoniq, Spea
635 and Reveal (Reveal makes also other cards).
636
637 If you compile the driver into the kernel, you have to add
638 "sscape=<io>,<irq>,<dma>,<mpuio>,<mpuirq>" to the kernel command
639 line.
640
641config SOUND_GUS
642 tristate "Gravis Ultrasound support"
643 depends on SOUND_OSS && OBSOLETE_OSS_DRIVER
644 help
645 Say Y here for any type of Gravis Ultrasound card, including the GUS
646 or GUS MAX. See also <file:Documentation/sound/oss/ultrasound> for more
647 information on configuring this card with modules.
648
649 If you compile the driver into the kernel, you have to add
650 "gus=<io>,<irq>,<dma>,<dma2>" to the kernel command line.
651
652config SOUND_GUS16
653 bool "16 bit sampling option of GUS (_NOT_ GUS MAX)"
654 depends on SOUND_GUS
655 help
656 Support for Gravis Ulstrasound (GUS) cards (other than the GUS),
657 sampling at 16-bit width.
658
659config SOUND_GUSMAX
660 bool "GUS MAX support"
661 depends on SOUND_GUS
662 help
663 Support for Gravis Ulstrasound MAX.
664
665config SOUND_VMIDI 495config SOUND_VMIDI
666 tristate "Loopback MIDI device support" 496 tristate "Loopback MIDI device support"
667 depends on SOUND_OSS 497 depends on SOUND_OSS
@@ -742,7 +572,7 @@ config SOUND_MPU401
742 572
743config SOUND_NM256 573config SOUND_NM256
744 tristate "NM256AV/NM256ZX audio support" 574 tristate "NM256AV/NM256ZX audio support"
745 depends on SOUND_OSS && OBSOLETE_OSS_DRIVER 575 depends on SOUND_OSS
746 help 576 help
747 Say M here to include audio support for the NeoMagic 256AV/256ZX 577 Say M here to include audio support for the NeoMagic 256AV/256ZX
748 chipsets. These are the audio chipsets found in the Sony 578 chipsets. These are the audio chipsets found in the Sony
@@ -752,35 +582,6 @@ config SOUND_NM256
752 582
753 See <file:Documentation/sound/oss/NM256> for further information. 583 See <file:Documentation/sound/oss/NM256> for further information.
754 584
755config SOUND_MAD16
756 tristate "OPTi MAD16 and/or Mozart based cards"
757 depends on SOUND_OSS && OBSOLETE_OSS_DRIVER
758 ---help---
759 Answer Y if your card has a Mozart (OAK OTI-601) or MAD16 (OPTi
760 82C928 or 82C929 or 82C931) audio interface chip. These chips are
761 quite common so it's possible that many no-name cards have one of
762 them. In addition the MAD16 chip is used in some cards made by known
763 manufacturers such as Turtle Beach (Tropez), Reveal (some models)
764 and Diamond (latest ones). Note however that the Tropez sound cards
765 have their own driver; if you have one of those, say N here and Y or
766 M to "Full support for Turtle Beach WaveFront", below.
767
768 If you compile the driver into the kernel, you have to add
769 "mad16=<io>,<irq>,<dma>,<dma2>,<mpuio>,<mpuirq>" to the
770 kernel command line.
771
772 See also <file:Documentation/sound/oss/Opti> and
773 <file:Documentation/sound/oss/MAD16> for more information on setting
774 these cards up as modules.
775
776config MAD16_OLDCARD
777 bool "Support MIDI in older MAD16 based cards (requires SB)"
778 depends on SOUND_MAD16
779 help
780 Answer Y (or M) if you have an older card based on the C928 or
781 Mozart chipset and you want to have MIDI support. If you enable this
782 option you also need to enable support for Sound Blaster.
783
784config SOUND_PAS 585config SOUND_PAS
785 tristate "ProAudioSpectrum 16 support" 586 tristate "ProAudioSpectrum 16 support"
786 depends on SOUND_OSS 587 depends on SOUND_OSS
@@ -873,53 +674,9 @@ config SOUND_SB
873 You can say M here to compile this driver as a module; the module is 674 You can say M here to compile this driver as a module; the module is
874 called sb. 675 called sb.
875 676
876config SOUND_AWE32_SYNTH
877 tristate "AWE32 synth"
878 depends on SOUND_OSS && OBSOLETE_OSS_DRIVER
879 help
880 Say Y here if you have a Sound Blaster SB32, AWE32-PnP, SB AWE64 or
881 similar sound card. See <file:Documentation/sound/oss/README.awe>,
882 <file:Documentation/sound/oss/AWE32> and the Soundblaster-AWE
883 mini-HOWTO, available from <http://www.tldp.org/docs.html#howto>
884 for more info.
885
886config SOUND_WAVEFRONT
887 tristate "Full support for Turtle Beach WaveFront (Tropez Plus, Tropez, Maui) synth/soundcards"
888 depends on SOUND_OSS && m && OBSOLETE_OSS_DRIVER
889 help
890 Answer Y or M if you have a Tropez Plus, Tropez or Maui sound card
891 and read the files <file:Documentation/sound/oss/Wavefront> and
892 <file:Documentation/sound/oss/Tropez+>.
893
894config SOUND_MAUI
895 tristate "Limited support for Turtle Beach Wave Front (Maui, Tropez) synthesizers"
896 depends on SOUND_OSS && OBSOLETE_OSS_DRIVER
897 help
898 Say Y here if you have a Turtle Beach Wave Front, Maui, or Tropez
899 sound card.
900
901 If you compile the driver into the kernel, you have to add
902 "maui=<io>,<irq>" to the kernel command line.
903
904config MAUI_HAVE_BOOT
905 bool "Have OSWF.MOT firmware file"
906 depends on SOUND_MAUI=y && !STANDALONE
907 help
908 Turtle Beach Maui and Tropez sound cards have a microcontroller
909 which needs to be initialized prior to use. OSWF.MOT is a file
910 distributed with the card's DOS/Windows drivers. Answer Y if you
911 have this file.
912
913config MAUI_BOOT_FILE
914 string "Full pathname of OSWF.MOT firmware file"
915 depends on MAUI_HAVE_BOOT
916 default "/etc/sound/oswf.mot"
917 help
918 Enter the full pathname of your OSWF.MOT file, starting from /.
919
920config SOUND_YM3812 677config SOUND_YM3812
921 tristate "Yamaha FM synthesizer (YM3812/OPL-3) support" 678 tristate "Yamaha FM synthesizer (YM3812/OPL-3) support"
922 depends on SOUND_OSS && OBSOLETE_OSS_DRIVER 679 depends on SOUND_OSS
923 ---help--- 680 ---help---
924 Answer Y if your card has a FM chip made by Yamaha (OPL2/OPL3/OPL4). 681 Answer Y if your card has a FM chip made by Yamaha (OPL2/OPL3/OPL4).
925 Answering Y is usually a safe and recommended choice, however some 682 Answering Y is usually a safe and recommended choice, however some
@@ -933,18 +690,6 @@ config SOUND_YM3812
933 690
934 If unsure, say Y. 691 If unsure, say Y.
935 692
936config SOUND_OPL3SA1
937 tristate "Yamaha OPL3-SA1 audio controller"
938 depends on SOUND_OSS && OBSOLETE_OSS_DRIVER
939 help
940 Say Y or M if you have a Yamaha OPL3-SA1 sound chip, which is
941 usually built into motherboards. Read
942 <file:Documentation/sound/oss/OPL3-SA> for details.
943
944 If you compile the driver into the kernel, you have to add
945 "opl3sa=<io>,<irq>,<dma>,<dma2>,<mpuio>,<mpuirq>" to the kernel
946 command line.
947
948config SOUND_OPL3SA2 693config SOUND_OPL3SA2
949 tristate "Yamaha OPL3-SA2 and SA3 based PnP cards" 694 tristate "Yamaha OPL3-SA2 and SA3 based PnP cards"
950 depends on SOUND_OSS 695 depends on SOUND_OSS
@@ -959,19 +704,6 @@ config SOUND_OPL3SA2
959 "opl3sa2=<io>,<irq>,<dma>,<dma2>,<mssio>,<mpuio>" to the kernel 704 "opl3sa2=<io>,<irq>,<dma>,<dma2>,<mssio>,<mpuio>" to the kernel
960 command line. 705 command line.
961 706
962config SOUND_YMFPCI
963 tristate "Yamaha YMF7xx PCI audio (native mode)"
964 depends on SOUND_OSS && PCI && OBSOLETE_OSS_DRIVER
965 help
966 Support for Yamaha cards including the YMF711, YMF715, YMF718,
967 YMF719, YMF724, Waveforce 192XG, and Waveforce 192 Digital.
968
969config SOUND_YMFPCI_LEGACY
970 bool "Yamaha PCI legacy ports support"
971 depends on SOUND_YMFPCI
972 help
973 Support for YMF7xx PCI cards emulating an MP401.
974
975config SOUND_UART6850 707config SOUND_UART6850
976 tristate "6850 UART support" 708 tristate "6850 UART support"
977 depends on SOUND_OSS 709 depends on SOUND_OSS
@@ -1101,30 +833,6 @@ config SOUND_KAHLUA
1101 tristate "XpressAudio Sound Blaster emulation" 833 tristate "XpressAudio Sound Blaster emulation"
1102 depends on SOUND_SB 834 depends on SOUND_SB
1103 835
1104config SOUND_ALI5455
1105 tristate "ALi5455 audio support"
1106 depends on SOUND_PRIME && PCI && OBSOLETE_OSS_DRIVER
1107
1108config SOUND_FORTE
1109 tristate "ForteMedia FM801 driver"
1110 depends on SOUND_PRIME && PCI && OBSOLETE_OSS_DRIVER
1111 help
1112 Say Y or M if you want driver support for the ForteMedia FM801 PCI
1113 audio controller (Abit AU10, Genius Sound Maker, HP Workstation
1114 zx2000, and others).
1115
1116config SOUND_RME96XX
1117 tristate "RME Hammerfall (RME96XX) support"
1118 depends on SOUND_PRIME && PCI && OBSOLETE_OSS_DRIVER
1119 help
1120 Say Y or M if you have a Hammerfall or Hammerfall light
1121 multichannel card from RME. If you want to access advanced
1122 features of the card, read <file:Documentation/sound/oss/rme96xx>.
1123
1124config SOUND_AD1980
1125 tristate "AD1980 front/back switch plugin"
1126 depends on SOUND_PRIME && OBSOLETE_OSS_DRIVER
1127
1128config SOUND_SH_DAC_AUDIO 836config SOUND_SH_DAC_AUDIO
1129 tristate "SuperH DAC audio support" 837 tristate "SuperH DAC audio support"
1130 depends on SOUND_PRIME && CPU_SH3 838 depends on SOUND_PRIME && CPU_SH3
diff --git a/sound/oss/ad1848.c b/sound/oss/ad1848.c
index 49796be955f3..e04fa49b0dc8 100644
--- a/sound/oss/ad1848.c
+++ b/sound/oss/ad1848.c
@@ -2026,7 +2026,8 @@ int ad1848_init (char *name, struct resource *ports, int irq, int dma_playback,
2026 if (irq > 0) 2026 if (irq > 0)
2027 { 2027 {
2028 devc->dev_no = my_dev; 2028 devc->dev_no = my_dev;
2029 if (request_irq(devc->irq, adintr, 0, devc->name, (void *)my_dev) < 0) 2029 if (request_irq(devc->irq, adintr, 0, devc->name,
2030 (void *)(long)my_dev) < 0)
2030 { 2031 {
2031 printk(KERN_WARNING "ad1848: Unable to allocate IRQ\n"); 2032 printk(KERN_WARNING "ad1848: Unable to allocate IRQ\n");
2032 /* Don't free it either then.. */ 2033 /* Don't free it either then.. */
@@ -2175,7 +2176,7 @@ void ad1848_unload(int io_base, int irq, int dma_playback, int dma_capture, int
2175 if (!share_dma) 2176 if (!share_dma)
2176 { 2177 {
2177 if (devc->irq > 0) /* There is no point in freeing irq, if it wasn't allocated */ 2178 if (devc->irq > 0) /* There is no point in freeing irq, if it wasn't allocated */
2178 free_irq(devc->irq, (void *)devc->dev_no); 2179 free_irq(devc->irq, (void *)(long)devc->dev_no);
2179 2180
2180 sound_free_dma(dma_playback); 2181 sound_free_dma(dma_playback);
2181 2182
@@ -2204,7 +2205,7 @@ irqreturn_t adintr(int irq, void *dev_id, struct pt_regs *dummy)
2204 unsigned char c930_stat = 0; 2205 unsigned char c930_stat = 0;
2205 int cnt = 0; 2206 int cnt = 0;
2206 2207
2207 dev = (int)dev_id; 2208 dev = (long)dev_id;
2208 devc = (ad1848_info *) audio_devs[dev]->devc; 2209 devc = (ad1848_info *) audio_devs[dev]->devc;
2209 2210
2210interrupt_again: /* Jump back here if int status doesn't reset */ 2211interrupt_again: /* Jump back here if int status doesn't reset */
@@ -2900,7 +2901,8 @@ static struct pnp_dev *activate_dev(char *devname, char *resname, struct pnp_dev
2900 return(dev); 2901 return(dev);
2901} 2902}
2902 2903
2903static struct pnp_dev *ad1848_init_generic(struct pnp_card *bus, struct address_info *hw_config, int slot) 2904static struct pnp_dev __init *ad1848_init_generic(struct pnp_card *bus,
2905 struct address_info *hw_config, int slot)
2904{ 2906{
2905 2907
2906 /* Configure Audio device */ 2908 /* Configure Audio device */
diff --git a/sound/oss/ad1889.c b/sound/oss/ad1889.c
index 54dabf862802..a4ca7569e700 100644
--- a/sound/oss/ad1889.c
+++ b/sound/oss/ad1889.c
@@ -75,7 +75,7 @@ static inline void ad1889_set_wav_rate(ad1889_dev_t *dev, int rate)
75 75
76 DBG("Setting WAV rate to %d\n", rate); 76 DBG("Setting WAV rate to %d\n", rate);
77 dev->state[AD_WAV_STATE].dmabuf.rate = rate; 77 dev->state[AD_WAV_STATE].dmabuf.rate = rate;
78 AD1889_WRITEW(dev, AD_DSWAS, rate); 78 AD1889_WRITEW(dev, AD_DS_WAS, rate);
79 79
80 /* Cycle the DAC to enable the new rate */ 80 /* Cycle the DAC to enable the new rate */
81 ac97_codec->codec_write(dev->ac97_codec, AC97_POWER_CONTROL, 0x0200); 81 ac97_codec->codec_write(dev->ac97_codec, AC97_POWER_CONTROL, 0x0200);
@@ -89,14 +89,14 @@ static inline void ad1889_set_wav_fmt(ad1889_dev_t *dev, int fmt)
89 89
90 DBG("Setting WAV format to 0x%x\n", fmt); 90 DBG("Setting WAV format to 0x%x\n", fmt);
91 91
92 tmp = AD1889_READW(ad1889_dev, AD_DSWSMC); 92 tmp = AD1889_READW(ad1889_dev, AD_DS_WSMC);
93 if (fmt & AFMT_S16_LE) { 93 if (fmt & AFMT_S16_LE) {
94 //tmp |= 0x0100; /* set WA16 */ 94 //tmp |= 0x0100; /* set WA16 */
95 tmp |= 0x0300; /* set WA16 stereo */ 95 tmp |= 0x0300; /* set WA16 stereo */
96 } else if (fmt & AFMT_U8) { 96 } else if (fmt & AFMT_U8) {
97 tmp &= ~0x0100; /* clear WA16 */ 97 tmp &= ~0x0100; /* clear WA16 */
98 } 98 }
99 AD1889_WRITEW(ad1889_dev, AD_DSWSMC, tmp); 99 AD1889_WRITEW(ad1889_dev, AD_DS_WSMC, tmp);
100} 100}
101 101
102static inline void ad1889_set_adc_fmt(ad1889_dev_t *dev, int fmt) 102static inline void ad1889_set_adc_fmt(ad1889_dev_t *dev, int fmt)
@@ -105,13 +105,13 @@ static inline void ad1889_set_adc_fmt(ad1889_dev_t *dev, int fmt)
105 105
106 DBG("Setting ADC format to 0x%x\n", fmt); 106 DBG("Setting ADC format to 0x%x\n", fmt);
107 107
108 tmp = AD1889_READW(ad1889_dev, AD_DSRAMC); 108 tmp = AD1889_READW(ad1889_dev, AD_DS_RAMC);
109 if (fmt & AFMT_S16_LE) { 109 if (fmt & AFMT_S16_LE) {
110 tmp |= 0x0100; /* set WA16 */ 110 tmp |= 0x0100; /* set WA16 */
111 } else if (fmt & AFMT_U8) { 111 } else if (fmt & AFMT_U8) {
112 tmp &= ~0x0100; /* clear WA16 */ 112 tmp &= ~0x0100; /* clear WA16 */
113 } 113 }
114 AD1889_WRITEW(ad1889_dev, AD_DSRAMC, tmp); 114 AD1889_WRITEW(ad1889_dev, AD_DS_RAMC, tmp);
115} 115}
116 116
117static void ad1889_start_wav(ad1889_state_t *state) 117static void ad1889_start_wav(ad1889_state_t *state)
@@ -145,21 +145,21 @@ static void ad1889_start_wav(ad1889_state_t *state)
145 dmabuf->rd_ptr, dmabuf->dma_len); 145 dmabuf->rd_ptr, dmabuf->dma_len);
146 146
147 /* load up the current register set */ 147 /* load up the current register set */
148 AD1889_WRITEL(ad1889_dev, AD_DMAWAVCC, cnt); 148 AD1889_WRITEL(ad1889_dev, AD_DMA_WAVCC, cnt);
149 AD1889_WRITEL(ad1889_dev, AD_DMAWAVICC, cnt); 149 AD1889_WRITEL(ad1889_dev, AD_DMA_WAVICC, cnt);
150 AD1889_WRITEL(ad1889_dev, AD_DMAWAVCA, dmabuf->dma_handle); 150 AD1889_WRITEL(ad1889_dev, AD_DMA_WAVCA, dmabuf->dma_handle);
151 151
152 /* TODO: for now we load the base registers with the same thing */ 152 /* TODO: for now we load the base registers with the same thing */
153 AD1889_WRITEL(ad1889_dev, AD_DMAWAVBC, cnt); 153 AD1889_WRITEL(ad1889_dev, AD_DMA_WAVBC, cnt);
154 AD1889_WRITEL(ad1889_dev, AD_DMAWAVIBC, cnt); 154 AD1889_WRITEL(ad1889_dev, AD_DMA_WAVIBC, cnt);
155 AD1889_WRITEL(ad1889_dev, AD_DMAWAVBA, dmabuf->dma_handle); 155 AD1889_WRITEL(ad1889_dev, AD_DMA_WAVBA, dmabuf->dma_handle);
156 156
157 /* and we're off to the races... */ 157 /* and we're off to the races... */
158 AD1889_WRITEL(ad1889_dev, AD_DMACHSS, 0x8); 158 AD1889_WRITEL(ad1889_dev, AD_DMA_CHSS, 0x8);
159 tmp = AD1889_READW(ad1889_dev, AD_DSWSMC); 159 tmp = AD1889_READW(ad1889_dev, AD_DS_WSMC);
160 tmp |= 0x0400; /* set WAEN */ 160 tmp |= 0x0400; /* set WAEN */
161 AD1889_WRITEW(ad1889_dev, AD_DSWSMC, tmp); 161 AD1889_WRITEW(ad1889_dev, AD_DS_WSMC, tmp);
162 (void) AD1889_READW(ad1889_dev, AD_DSWSMC); /* flush posted PCI write */ 162 (void) AD1889_READW(ad1889_dev, AD_DS_WSMC); /* flush posted PCI write */
163 163
164 dmabuf->enable |= DAC_RUNNING; 164 dmabuf->enable |= DAC_RUNNING;
165 165
@@ -179,10 +179,10 @@ static void ad1889_stop_wav(ad1889_state_t *state)
179 u16 tmp; 179 u16 tmp;
180 unsigned long cnt = dmabuf->dma_len; 180 unsigned long cnt = dmabuf->dma_len;
181 181
182 tmp = AD1889_READW(ad1889_dev, AD_DSWSMC); 182 tmp = AD1889_READW(ad1889_dev, AD_DS_WSMC);
183 tmp &= ~0x0400; /* clear WAEN */ 183 tmp &= ~0x0400; /* clear WAEN */
184 AD1889_WRITEW(ad1889_dev, AD_DSWSMC, tmp); 184 AD1889_WRITEW(ad1889_dev, AD_DS_WSMC, tmp);
185 (void) AD1889_READW(ad1889_dev, AD_DSWSMC); /* flush posted PCI write */ 185 (void) AD1889_READW(ad1889_dev, AD_DS_WSMC); /* flush posted PCI write */
186 pci_unmap_single(ad1889_dev->pci, dmabuf->dma_handle, 186 pci_unmap_single(ad1889_dev->pci, dmabuf->dma_handle,
187 cnt, PCI_DMA_TODEVICE); 187 cnt, PCI_DMA_TODEVICE);
188 188
@@ -211,7 +211,7 @@ static void ad1889_startstop_adc(ad1889_state_t *state, int start)
211 211
212 spin_lock_irqsave(&state->card->lock, flags); 212 spin_lock_irqsave(&state->card->lock, flags);
213 213
214 tmp = AD1889_READW(ad1889_dev, AD_DSRAMC); 214 tmp = AD1889_READW(ad1889_dev, AD_DS_RAMC);
215 if (start) { 215 if (start) {
216 state->dmabuf.enable |= ADC_RUNNING; 216 state->dmabuf.enable |= ADC_RUNNING;
217 tmp |= 0x0004; /* set ADEN */ 217 tmp |= 0x0004; /* set ADEN */
@@ -219,7 +219,7 @@ static void ad1889_startstop_adc(ad1889_state_t *state, int start)
219 state->dmabuf.enable &= ~ADC_RUNNING; 219 state->dmabuf.enable &= ~ADC_RUNNING;
220 tmp &= ~0x0004; /* clear ADEN */ 220 tmp &= ~0x0004; /* clear ADEN */
221 } 221 }
222 AD1889_WRITEW(ad1889_dev, AD_DSRAMC, tmp); 222 AD1889_WRITEW(ad1889_dev, AD_DS_RAMC, tmp);
223 223
224 spin_unlock_irqrestore(&state->card->lock, flags); 224 spin_unlock_irqrestore(&state->card->lock, flags);
225} 225}
@@ -301,53 +301,53 @@ static int ad1889_read_proc (char *page, char **start, off_t off,
301 int len, i; 301 int len, i;
302 ad1889_dev_t *dev = data; 302 ad1889_dev_t *dev = data;
303 ad1889_reg_t regs[] = { 303 ad1889_reg_t regs[] = {
304 { "WSMC", AD_DSWSMC, 16 }, 304 { "WSMC", AD_DS_WSMC, 16 },
305 { "RAMC", AD_DSRAMC, 16 }, 305 { "RAMC", AD_DS_RAMC, 16 },
306 { "WADA", AD_DSWADA, 16 }, 306 { "WADA", AD_DS_WADA, 16 },
307 { "SYDA", AD_DSSYDA, 16 }, 307 { "SYDA", AD_DS_SYDA, 16 },
308 { "WAS", AD_DSWAS, 16 }, 308 { "WAS", AD_DS_WAS, 16 },
309 { "RES", AD_DSRES, 16 }, 309 { "RES", AD_DS_RES, 16 },
310 { "CCS", AD_DSCCS, 16 }, 310 { "CCS", AD_DS_CCS, 16 },
311 { "ADCBA", AD_DMAADCBA, 32 }, 311 { "ADCBA", AD_DMA_ADCBA, 32 },
312 { "ADCCA", AD_DMAADCCA, 32 }, 312 { "ADCCA", AD_DMA_ADCCA, 32 },
313 { "ADCBC", AD_DMAADCBC, 32 }, 313 { "ADCBC", AD_DMA_ADCBC, 32 },
314 { "ADCCC", AD_DMAADCCC, 32 }, 314 { "ADCCC", AD_DMA_ADCCC, 32 },
315 { "ADCIBC", AD_DMAADCIBC, 32 }, 315 { "ADCIBC", AD_DMA_ADCIBC, 32 },
316 { "ADCICC", AD_DMAADCICC, 32 }, 316 { "ADCICC", AD_DMA_ADCICC, 32 },
317 { "ADCCTRL", AD_DMAADCCTRL, 16 }, 317 { "ADCCTRL", AD_DMA_ADCCTRL, 16 },
318 { "WAVBA", AD_DMAWAVBA, 32 }, 318 { "WAVBA", AD_DMA_WAVBA, 32 },
319 { "WAVCA", AD_DMAWAVCA, 32 }, 319 { "WAVCA", AD_DMA_WAVCA, 32 },
320 { "WAVBC", AD_DMAWAVBC, 32 }, 320 { "WAVBC", AD_DMA_WAVBC, 32 },
321 { "WAVCC", AD_DMAWAVCC, 32 }, 321 { "WAVCC", AD_DMA_WAVCC, 32 },
322 { "WAVIBC", AD_DMAWAVIBC, 32 }, 322 { "WAVIBC", AD_DMA_WAVIBC, 32 },
323 { "WAVICC", AD_DMAWAVICC, 32 }, 323 { "WAVICC", AD_DMA_WAVICC, 32 },
324 { "WAVCTRL", AD_DMAWAVCTRL, 16 }, 324 { "WAVCTRL", AD_DMA_WAVCTRL, 16 },
325 { "DISR", AD_DMADISR, 32 }, 325 { "DISR", AD_DMA_DISR, 32 },
326 { "CHSS", AD_DMACHSS, 32 }, 326 { "CHSS", AD_DMA_CHSS, 32 },
327 { "IPC", AD_GPIOIPC, 16 }, 327 { "IPC", AD_GPIO_IPC, 16 },
328 { "OP", AD_GPIOOP, 16 }, 328 { "OP", AD_GPIO_OP, 16 },
329 { "IP", AD_GPIOIP, 16 }, 329 { "IP", AD_GPIO_IP, 16 },
330 { "ACIC", AD_ACIC, 16 }, 330 { "ACIC", AD_AC97_ACIC, 16 },
331 { "AC97_RESET", 0x100 + AC97_RESET, 16 }, 331 { "AC97_RESET", AD_AC97_BASE + AC97_RESET, 16 },
332 { "AC97_MASTER_VOL_STEREO", 0x100 + AC97_MASTER_VOL_STEREO, 16 }, 332 { "AC97_MASTER_VOL_STEREO", AD_AC97_BASE + AC97_MASTER_VOL_STEREO, 16 },
333 { "AC97_HEADPHONE_VOL", 0x100 + AC97_HEADPHONE_VOL, 16 }, 333 { "AC97_HEADPHONE_VOL", AD_AC97_BASE + AC97_HEADPHONE_VOL, 16 },
334 { "AC97_MASTER_VOL_MONO", 0x100 + AC97_MASTER_VOL_MONO, 16 }, 334 { "AC97_MASTER_VOL_MONO", AD_AC97_BASE + AC97_MASTER_VOL_MONO, 16 },
335 { "AC97_MASTER_TONE", 0x100 + AC97_MASTER_TONE, 16 }, 335 { "AC97_MASTER_TONE", AD_AC97_BASE + AC97_MASTER_TONE, 16 },
336 { "AC97_PCBEEP_VOL", 0x100 + AC97_PCBEEP_VOL, 16 }, 336 { "AC97_PCBEEP_VOL", AD_AC97_BASE + AC97_PCBEEP_VOL, 16 },
337 { "AC97_PHONE_VOL", 0x100 + AC97_PHONE_VOL, 16 }, 337 { "AC97_PHONE_VOL", AD_AC97_BASE + AC97_PHONE_VOL, 16 },
338 { "AC97_MIC_VOL", 0x100 + AC97_MIC_VOL, 16 }, 338 { "AC97_MIC_VOL", AD_AC97_BASE + AC97_MIC_VOL, 16 },
339 { "AC97_LINEIN_VOL", 0x100 + AC97_LINEIN_VOL, 16 }, 339 { "AC97_LINEIN_VOL", AD_AC97_BASE + AC97_LINEIN_VOL, 16 },
340 { "AC97_CD_VOL", 0x100 + AC97_CD_VOL, 16 }, 340 { "AC97_CD_VOL", AD_AC97_BASE + AC97_CD_VOL, 16 },
341 { "AC97_VIDEO_VOL", 0x100 + AC97_VIDEO_VOL, 16 }, 341 { "AC97_VIDEO_VOL", AD_AC97_BASE + AC97_VIDEO_VOL, 16 },
342 { "AC97_AUX_VOL", 0x100 + AC97_AUX_VOL, 16 }, 342 { "AC97_AUX_VOL", AD_AC97_BASE + AC97_AUX_VOL, 16 },
343 { "AC97_PCMOUT_VOL", 0x100 + AC97_PCMOUT_VOL, 16 }, 343 { "AC97_PCMOUT_VOL", AD_AC97_BASE + AC97_PCMOUT_VOL, 16 },
344 { "AC97_RECORD_SELECT", 0x100 + AC97_RECORD_SELECT, 16 }, 344 { "AC97_RECORD_SELECT", AD_AC97_BASE + AC97_RECORD_SELECT, 16 },
345 { "AC97_RECORD_GAIN", 0x100 + AC97_RECORD_GAIN, 16 }, 345 { "AC97_RECORD_GAIN", AD_AC97_BASE + AC97_RECORD_GAIN, 16 },
346 { "AC97_RECORD_GAIN_MIC", 0x100 + AC97_RECORD_GAIN_MIC, 16 }, 346 { "AC97_RECORD_GAIN_MIC", AD_AC97_BASE + AC97_RECORD_GAIN_MIC, 16 },
347 { "AC97_GENERAL_PURPOSE", 0x100 + AC97_GENERAL_PURPOSE, 16 }, 347 { "AC97_GENERAL_PURPOSE", AD_AC97_BASE + AC97_GENERAL_PURPOSE, 16 },
348 { "AC97_3D_CONTROL", 0x100 + AC97_3D_CONTROL, 16 }, 348 { "AC97_3D_CONTROL", AD_AC97_BASE + AC97_3D_CONTROL, 16 },
349 { "AC97_MODEM_RATE", 0x100 + AC97_MODEM_RATE, 16 }, 349 { "AC97_MODEM_RATE", AD_AC97_BASE + AC97_MODEM_RATE, 16 },
350 { "AC97_POWER_CONTROL", 0x100 + AC97_POWER_CONTROL, 16 }, 350 { "AC97_POWER_CONTROL", AD_AC97_BASE + AC97_POWER_CONTROL, 16 },
351 { NULL } 351 { NULL }
352 }; 352 };
353 353
@@ -400,9 +400,9 @@ static inline unsigned long ad1889_get_dma_addr(ad1889_state_t *state)
400 } 400 }
401 401
402 if (dmabuf->enable & DAC_RUNNING) 402 if (dmabuf->enable & DAC_RUNNING)
403 offset = le32_to_cpu(AD1889_READL(state->card, AD_DMAWAVBA)); 403 offset = le32_to_cpu(AD1889_READL(state->card, AD_DMA_WAVBA));
404 else 404 else
405 offset = le32_to_cpu(AD1889_READL(state->card, AD_DMAADCBA)); 405 offset = le32_to_cpu(AD1889_READL(state->card, AD_DMA_ADCBA));
406 406
407 return (unsigned long)bus_to_virt((unsigned long)offset) - (unsigned long)dmabuf->rawbuf; 407 return (unsigned long)bus_to_virt((unsigned long)offset) - (unsigned long)dmabuf->rawbuf;
408} 408}
@@ -639,9 +639,9 @@ static int ad1889_ioctl(struct inode *inode, struct file *file, unsigned int cmd
639 if (val > 5400 && val < 48000) 639 if (val > 5400 && val < 48000)
640 { 640 {
641 if (file->f_mode & FMODE_WRITE) 641 if (file->f_mode & FMODE_WRITE)
642 AD1889_WRITEW(ad1889_dev, AD_DSWAS, val); 642 AD1889_WRITEW(ad1889_dev, AD_DS_WAS, val);
643 if (file->f_mode & FMODE_READ) 643 if (file->f_mode & FMODE_READ)
644 AD1889_WRITEW(ad1889_dev, AD_DSRES, val); 644 AD1889_WRITEW(ad1889_dev, AD_DS_RES, val);
645 } 645 }
646 return 0; 646 return 0;
647 647
@@ -649,22 +649,22 @@ static int ad1889_ioctl(struct inode *inode, struct file *file, unsigned int cmd
649 if (get_user(val, p)) 649 if (get_user(val, p))
650 return -EFAULT; 650 return -EFAULT;
651 if (file->f_mode & FMODE_READ) { 651 if (file->f_mode & FMODE_READ) {
652 val = AD1889_READW(ad1889_dev, AD_DSWSMC); 652 val = AD1889_READW(ad1889_dev, AD_DS_WSMC);
653 if (val) { 653 if (val) {
654 val |= 0x0200; /* set WAST */ 654 val |= 0x0200; /* set WAST */
655 } else { 655 } else {
656 val &= ~0x0200; /* clear WAST */ 656 val &= ~0x0200; /* clear WAST */
657 } 657 }
658 AD1889_WRITEW(ad1889_dev, AD_DSWSMC, val); 658 AD1889_WRITEW(ad1889_dev, AD_DS_WSMC, val);
659 } 659 }
660 if (file->f_mode & FMODE_WRITE) { 660 if (file->f_mode & FMODE_WRITE) {
661 val = AD1889_READW(ad1889_dev, AD_DSRAMC); 661 val = AD1889_READW(ad1889_dev, AD_DS_RAMC);
662 if (val) { 662 if (val) {
663 val |= 0x0002; /* set ADST */ 663 val |= 0x0002; /* set ADST */
664 } else { 664 } else {
665 val &= ~0x0002; /* clear ADST */ 665 val &= ~0x0002; /* clear ADST */
666 } 666 }
667 AD1889_WRITEW(ad1889_dev, AD_DSRAMC, val); 667 AD1889_WRITEW(ad1889_dev, AD_DS_RAMC, val);
668 } 668 }
669 669
670 return 0; 670 return 0;
@@ -739,7 +739,7 @@ static int ad1889_ioctl(struct inode *inode, struct file *file, unsigned int cmd
739 break; 739 break;
740 740
741 case SOUND_PCM_READ_RATE: 741 case SOUND_PCM_READ_RATE:
742 return put_user(AD1889_READW(ad1889_dev, AD_DSWAS), p); 742 return put_user(AD1889_READW(ad1889_dev, AD_DS_WAS), p);
743 743
744 case SOUND_PCM_READ_CHANNELS: 744 case SOUND_PCM_READ_CHANNELS:
745 case SOUND_PCM_READ_BITS: 745 case SOUND_PCM_READ_BITS:
@@ -769,7 +769,7 @@ static int ad1889_open(struct inode *inode, struct file *file)
769 769
770 ad1889_set_wav_rate(ad1889_dev, 48000); 770 ad1889_set_wav_rate(ad1889_dev, 48000);
771 ad1889_set_wav_fmt(ad1889_dev, AFMT_S16_LE); 771 ad1889_set_wav_fmt(ad1889_dev, AFMT_S16_LE);
772 AD1889_WRITEW(ad1889_dev, AD_DSWADA, 0x0404); /* attenuation */ 772 AD1889_WRITEW(ad1889_dev, AD_DS_WADA, 0x0404); /* attenuation */
773 return nonseekable_open(inode, file); 773 return nonseekable_open(inode, file);
774} 774}
775 775
@@ -826,15 +826,15 @@ static void ad1889_codec_write(struct ac97_codec *ac97, u8 reg, u16 val)
826{ 826{
827 ad1889_dev_t *dev = ac97->private_data; 827 ad1889_dev_t *dev = ac97->private_data;
828 828
829 //DBG("Writing 0x%x to 0x%lx\n", val, dev->regbase + 0x100 + reg); 829 //DBG("Writing 0x%x to 0x%lx\n", val, dev->regbase + AD_AC97_BASE + reg);
830 AD1889_WRITEW(dev, 0x100 + reg, val); 830 AD1889_WRITEW(dev, AD_AC97_BASE + reg, val);
831} 831}
832 832
833static u16 ad1889_codec_read(struct ac97_codec *ac97, u8 reg) 833static u16 ad1889_codec_read(struct ac97_codec *ac97, u8 reg)
834{ 834{
835 ad1889_dev_t *dev = ac97->private_data; 835 ad1889_dev_t *dev = ac97->private_data;
836 //DBG("Reading from 0x%lx\n", dev->regbase + 0x100 + reg); 836 //DBG("Reading from 0x%lx\n", dev->regbase + AD_AC97_BASE + reg);
837 return AD1889_READW(dev, 0x100 + reg); 837 return AD1889_READW(dev, AD_AC97_BASE + reg);
838} 838}
839 839
840static int ad1889_ac97_init(ad1889_dev_t *dev, int id) 840static int ad1889_ac97_init(ad1889_dev_t *dev, int id)
@@ -883,24 +883,24 @@ static int ad1889_aclink_reset(struct pci_dev * pcidev)
883 int retry = 200; 883 int retry = 200;
884 ad1889_dev_t *dev = pci_get_drvdata(pcidev); 884 ad1889_dev_t *dev = pci_get_drvdata(pcidev);
885 885
886 AD1889_WRITEW(dev, AD_DSCCS, 0x8000); /* turn on clock */ 886 AD1889_WRITEW(dev, AD_DS_CCS, 0x8000); /* turn on clock */
887 AD1889_READW(dev, AD_DSCCS); 887 AD1889_READW(dev, AD_DS_CCS);
888 888
889 WAIT_10MS(); 889 WAIT_10MS();
890 890
891 stat = AD1889_READW(dev, AD_ACIC); 891 stat = AD1889_READW(dev, AD_AC97_ACIC);
892 stat |= 0x0002; /* Reset Disable */ 892 stat |= 0x0002; /* Reset Disable */
893 AD1889_WRITEW(dev, AD_ACIC, stat); 893 AD1889_WRITEW(dev, AD_AC97_ACIC, stat);
894 (void) AD1889_READW(dev, AD_ACIC); /* flush posted write */ 894 (void) AD1889_READW(dev, AD_AC97_ACIC); /* flush posted write */
895 895
896 udelay(10); 896 udelay(10);
897 897
898 stat = AD1889_READW(dev, AD_ACIC); 898 stat = AD1889_READW(dev, AD_AC97_ACIC);
899 stat |= 0x0001; /* Interface Enable */ 899 stat |= 0x0001; /* Interface Enable */
900 AD1889_WRITEW(dev, AD_ACIC, stat); 900 AD1889_WRITEW(dev, AD_AC97_ACIC, stat);
901 901
902 do { 902 do {
903 if (AD1889_READW(dev, AD_ACIC) & 0x8000) /* Ready */ 903 if (AD1889_READW(dev, AD_AC97_ACIC) & 0x8000) /* Ready */
904 break; 904 break;
905 WAIT_10MS(); 905 WAIT_10MS();
906 retry--; 906 retry--;
@@ -908,16 +908,16 @@ static int ad1889_aclink_reset(struct pci_dev * pcidev)
908 908
909 if (!retry) { 909 if (!retry) {
910 printk(KERN_ERR "ad1889_aclink_reset: codec is not ready [0x%x]\n", 910 printk(KERN_ERR "ad1889_aclink_reset: codec is not ready [0x%x]\n",
911 AD1889_READW(dev, AD_ACIC)); 911 AD1889_READW(dev, AD_AC97_ACIC));
912 return -EBUSY; 912 return -EBUSY;
913 } 913 }
914 914
915 /* TODO reset AC97 codec */ 915 /* TODO reset AC97 codec */
916 /* TODO set wave/adc pci ctrl status */ 916 /* TODO set wave/adc pci ctrl status */
917 917
918 stat = AD1889_READW(dev, AD_ACIC); 918 stat = AD1889_READW(dev, AD_AC97_ACIC);
919 stat |= 0x0004; /* Audio Stream Output Enable */ 919 stat |= 0x0004; /* Audio Stream Output Enable */
920 AD1889_WRITEW(dev, AD_ACIC, stat); 920 AD1889_WRITEW(dev, AD_AC97_ACIC, stat);
921 return 0; 921 return 0;
922} 922}
923 923
@@ -935,10 +935,10 @@ static irqreturn_t ad1889_interrupt(int irq, void *dev_id, struct pt_regs *regs)
935 u32 stat; 935 u32 stat;
936 ad1889_dev_t *dev = (ad1889_dev_t *)dev_id; 936 ad1889_dev_t *dev = (ad1889_dev_t *)dev_id;
937 937
938 stat = AD1889_READL(dev, AD_DMADISR); 938 stat = AD1889_READL(dev, AD_DMA_DISR);
939 939
940 /* clear ISR */ 940 /* clear ISR */
941 AD1889_WRITEL(dev, AD_DMADISR, stat); 941 AD1889_WRITEL(dev, AD_DMA_DISR, stat);
942 942
943 if (stat & 0x8) { /* WAVI */ 943 if (stat & 0x8) { /* WAVI */
944 DBG("WAV interrupt\n"); 944 DBG("WAV interrupt\n");
@@ -964,15 +964,15 @@ static void ad1889_initcfg(ad1889_dev_t *dev)
964 u32 tmp32; 964 u32 tmp32;
965 965
966 /* make sure the interrupt bits are setup the way we want */ 966 /* make sure the interrupt bits are setup the way we want */
967 tmp32 = AD1889_READL(dev, AD_DMAWAVCTRL); 967 tmp32 = AD1889_READL(dev, AD_DMA_WAVCTRL);
968 tmp32 &= ~0xff; /* flat dma, no sg, mask out the intr bits */ 968 tmp32 &= ~0xff; /* flat dma, no sg, mask out the intr bits */
969 tmp32 |= 0x6; /* intr on count, loop */ 969 tmp32 |= 0x6; /* intr on count, loop */
970 AD1889_WRITEL(dev, AD_DMAWAVCTRL, tmp32); 970 AD1889_WRITEL(dev, AD_DMA_WAVCTRL, tmp32);
971 971
972 /* unmute... */ 972 /* unmute... */
973 tmp16 = AD1889_READW(dev, AD_DSWADA); 973 tmp16 = AD1889_READW(dev, AD_DS_WADA);
974 tmp16 &= ~0x8080; 974 tmp16 &= ~0x8080;
975 AD1889_WRITEW(dev, AD_DSWADA, tmp16); 975 AD1889_WRITEW(dev, AD_DS_WADA, tmp16);
976} 976}
977 977
978static int __devinit ad1889_probe(struct pci_dev *pcidev, const struct pci_device_id *ent) 978static int __devinit ad1889_probe(struct pci_dev *pcidev, const struct pci_device_id *ent)
@@ -1005,7 +1005,7 @@ static int __devinit ad1889_probe(struct pci_dev *pcidev, const struct pci_devic
1005 goto out1; 1005 goto out1;
1006 } 1006 }
1007 1007
1008 dev->regbase = ioremap_nocache(bar, AD_DSIOMEMSIZE); 1008 dev->regbase = ioremap_nocache(bar, AD_DS_IOMEMSIZE);
1009 if (!dev->regbase) { 1009 if (!dev->regbase) {
1010 printk(KERN_ERR DEVNAME ": unable to remap iomem\n"); 1010 printk(KERN_ERR DEVNAME ": unable to remap iomem\n");
1011 goto out2; 1011 goto out2;
diff --git a/sound/oss/ad1889.h b/sound/oss/ad1889.h
index 861b3213f30b..09913765967a 100644
--- a/sound/oss/ad1889.h
+++ b/sound/oss/ad1889.h
@@ -1,57 +1,58 @@
1#ifndef _AD1889_H_ 1#ifndef _AD1889_H_
2#define _AD1889_H_ 2#define _AD1889_H_
3 3
4#define AD_DSWSMC 0x00 /* DMA input wave/syn mixer control */ 4#define AD_DS_WSMC 0x00 /* DMA input wave/syn mixer control */
5#define AD_DSRAMC 0x02 /* DMA output resamp/ADC mixer control */ 5#define AD_DS_RAMC 0x02 /* DMA output resamp/ADC mixer control */
6#define AD_DSWADA 0x04 /* DMA input wave attenuation */ 6#define AD_DS_WADA 0x04 /* DMA input wave attenuation */
7#define AD_DSSYDA 0x06 /* DMA input syn attentuation */ 7#define AD_DS_SYDA 0x06 /* DMA input syn attentuation */
8#define AD_DSWAS 0x08 /* wave input sample rate */ 8#define AD_DS_WAS 0x08 /* wave input sample rate */
9#define AD_DSRES 0x0a /* resampler output sample rate */ 9#define AD_DS_RES 0x0a /* resampler output sample rate */
10#define AD_DSCCS 0x0c /* chip control/status */ 10#define AD_DS_CCS 0x0c /* chip control/status */
11 11
12#define AD_DMARESBA 0x40 /* RES base addr */ 12#define AD_DMA_RESBA 0x40 /* RES base addr */
13#define AD_DMARESCA 0x44 /* RES current addr */ 13#define AD_DMA_RESCA 0x44 /* RES current addr */
14#define AD_DMARESBC 0x48 /* RES base cnt */ 14#define AD_DMA_RESBC 0x48 /* RES base cnt */
15#define AD_DMARESCC 0x4c /* RES current count */ 15#define AD_DMA_RESCC 0x4c /* RES current count */
16#define AD_DMAADCBA 0x50 /* ADC */ 16#define AD_DMA_ADCBA 0x50 /* ADC */
17#define AD_DMAADCCA 0x54 17#define AD_DMA_ADCCA 0x54
18#define AD_DMAADCBC 0x58 18#define AD_DMA_ADCBC 0x58
19#define AD_DMAADCCC 0x5c 19#define AD_DMA_ADCCC 0x5c
20#define AD_DMASYNBA 0x60 /* SYN */ 20#define AD_DMA_SYNBA 0x60 /* SYN */
21#define AD_DMASYNCA 0x64 21#define AD_DMA_SYNCA 0x64
22#define AD_DMASYNBC 0x68 22#define AD_DMA_SYNBC 0x68
23#define AD_DMASYNCC 0x6c 23#define AD_DMA_SYNCC 0x6c
24#define AD_DMAWAVBA 0x70 /* WAV */ 24#define AD_DMA_WAVBA 0x70 /* WAV */
25#define AD_DMAWAVCA 0x74 25#define AD_DMA_WAVCA 0x74
26#define AD_DMAWAVBC 0x78 26#define AD_DMA_WAVBC 0x78
27#define AD_DMAWAVCC 0x7c 27#define AD_DMA_WAVCC 0x7c
28#define AD_DMARESICC 0x80 /* RES interrupt current count */ 28#define AD_DMA_RESICC 0x80 /* RES interrupt current count */
29#define AD_DMARESIBC 0x84 /* RES interrupt base count */ 29#define AD_DMA_RESIBC 0x84 /* RES interrupt base count */
30#define AD_DMAADCICC 0x88 /* ADC interrupt current count */ 30#define AD_DMA_ADCICC 0x88 /* ADC interrupt current count */
31#define AD_DMAADCIBC 0x8c /* ADC interrupt base count */ 31#define AD_DMA_ADCIBC 0x8c /* ADC interrupt base count */
32#define AD_DMASYNICC 0x90 /* SYN interrupt current count */ 32#define AD_DMA_SYNICC 0x90 /* SYN interrupt current count */
33#define AD_DMASYNIBC 0x94 /* SYN interrupt base count */ 33#define AD_DMA_SYNIBC 0x94 /* SYN interrupt base count */
34#define AD_DMAWAVICC 0x98 /* WAV interrupt current count */ 34#define AD_DMA_WAVICC 0x98 /* WAV interrupt current count */
35#define AD_DMAWAVIBC 0x9c /* WAV interrupt base count */ 35#define AD_DMA_WAVIBC 0x9c /* WAV interrupt base count */
36#define AD_DMARESCTRL 0xa0 /* RES PCI control/status */ 36#define AD_DMA_RESCTRL 0xa0 /* RES PCI control/status */
37#define AD_DMAADCCTRL 0xa8 /* ADC PCI control/status */ 37#define AD_DMA_ADCCTRL 0xa8 /* ADC PCI control/status */
38#define AD_DMASYNCTRL 0xb0 /* SYN PCI control/status */ 38#define AD_DMA_SYNCTRL 0xb0 /* SYN PCI control/status */
39#define AD_DMAWAVCTRL 0xb8 /* WAV PCI control/status */ 39#define AD_DMA_WAVCTRL 0xb8 /* WAV PCI control/status */
40#define AD_DMADISR 0xc0 /* PCI DMA intr status */ 40#define AD_DMA_DISR 0xc0 /* PCI DMA intr status */
41#define AD_DMACHSS 0xc4 /* PCI DMA channel stop status */ 41#define AD_DMA_CHSS 0xc4 /* PCI DMA channel stop status */
42 42
43#define AD_GPIOIPC 0xc8 /* IO port ctrl */ 43#define AD_GPIO_IPC 0xc8 /* IO port ctrl */
44#define AD_GPIOOP 0xca /* IO output status */ 44#define AD_GPIO_OP 0xca /* IO output status */
45#define AD_GPIOIP 0xcc /* IO input status */ 45#define AD_GPIO_IP 0xcc /* IO input status */
46 46
47/* AC97 registers, 0x100 - 0x17f; see ac97.h */ 47/* AC97 registers, 0x100 - 0x17f; see ac97.h */
48#define AD_ACIC 0x180 /* AC Link interface ctrl */ 48#define AD_AC97_BASE 0x100 /* ac97 base register */
49#define AD_AC97_ACIC 0x180 /* AC Link interface ctrl */
49 50
50/* OPL3; BAR1 */ 51/* OPL3; BAR1 */
51#define AD_OPLM0AS 0x00 /* Music0 address/status */ 52#define AD_OPL_M0AS 0x00 /* Music0 address/status */
52#define AD_OPLM0DATA 0x01 /* Music0 data */ 53#define AD_OPL_M0DATA 0x01 /* Music0 data */
53#define AD_OPLM1A 0x02 /* Music1 address */ 54#define AD_OPL_M1A 0x02 /* Music1 address */
54#define AD_OPLM1DATA 0x03 /* Music1 data */ 55#define AD_OPL_M1DATA 0x03 /* Music1 data */
55/* 0x04-0x0f reserved */ 56/* 0x04-0x0f reserved */
56 57
57/* MIDI; BAR2 */ 58/* MIDI; BAR2 */
@@ -59,9 +60,9 @@
59#define AD_MISC 0x01 /* MIDI status/cmd */ 60#define AD_MISC 0x01 /* MIDI status/cmd */
60/* 0x02-0xff reserved */ 61/* 0x02-0xff reserved */
61 62
62#define AD_DSIOMEMSIZE 512 63#define AD_DS_IOMEMSIZE 512
63#define AD_OPLMEMSIZE 16 64#define AD_OPL_MEMSIZE 16
64#define AD_MIDIMEMSIZE 16 65#define AD_MIDI_MEMSIZE 16
65 66
66#define AD_WAV_STATE 0 67#define AD_WAV_STATE 0
67#define AD_ADC_STATE 1 68#define AD_ADC_STATE 1
diff --git a/sound/oss/dmasound/tas_common.c b/sound/oss/dmasound/tas_common.c
index 81315996c0f1..882ae98a41b1 100644
--- a/sound/oss/dmasound/tas_common.c
+++ b/sound/oss/dmasound/tas_common.c
@@ -195,8 +195,8 @@ tas_init(int driver_id, const char *driver_name)
195 195
196 printk(KERN_INFO "tas driver [%s])\n", driver_name); 196 printk(KERN_INFO "tas driver [%s])\n", driver_name);
197 197
198#ifndef CONFIG_I2C_KEYWEST 198#ifndef CONFIG_I2C_POWERMAC
199 request_module("i2c-keywest"); 199 request_module("i2c-powermac");
200#endif 200#endif
201 tas_node = find_devices("deq"); 201 tas_node = find_devices("deq");
202 if (tas_node == NULL) 202 if (tas_node == NULL)
diff --git a/sound/oss/nm256_audio.c b/sound/oss/nm256_audio.c
index 7de079b202f2..6e662ac009ae 100644
--- a/sound/oss/nm256_audio.c
+++ b/sound/oss/nm256_audio.c
@@ -960,7 +960,7 @@ static struct ac97_mixer_value_list mixer_defaults[] = {
960 960
961 961
962/* Installs the AC97 mixer into CARD. */ 962/* Installs the AC97 mixer into CARD. */
963static int __init 963static int __devinit
964nm256_install_mixer (struct nm256_info *card) 964nm256_install_mixer (struct nm256_info *card)
965{ 965{
966 int mixer; 966 int mixer;
@@ -995,7 +995,7 @@ nm256_install_mixer (struct nm256_info *card)
995 * RAM. 995 * RAM.
996 */ 996 */
997 997
998static void __init 998static void __devinit
999nm256_peek_for_sig (struct nm256_info *card) 999nm256_peek_for_sig (struct nm256_info *card)
1000{ 1000{
1001 u32 port1offset 1001 u32 port1offset
@@ -1056,7 +1056,7 @@ nm256_install(struct pci_dev *pcidev, enum nm256rev rev, char *verstr)
1056 card->playing = 0; 1056 card->playing = 0;
1057 card->recording = 0; 1057 card->recording = 0;
1058 card->rev = rev; 1058 card->rev = rev;
1059 spin_lock_init(&card->lock); 1059 spin_lock_init(&card->lock);
1060 1060
1061 /* Init the memory port info. */ 1061 /* Init the memory port info. */
1062 for (x = 0; x < 2; x++) { 1062 for (x = 0; x < 2; x++) {
diff --git a/sound/pci/ad1889.c b/sound/pci/ad1889.c
index c6c8333acc62..eece1c7e55a0 100644
--- a/sound/pci/ad1889.c
+++ b/sound/pci/ad1889.c
@@ -39,7 +39,6 @@
39#include <linux/interrupt.h> 39#include <linux/interrupt.h>
40#include <linux/compiler.h> 40#include <linux/compiler.h>
41#include <linux/delay.h> 41#include <linux/delay.h>
42#include <linux/dma-mapping.h>
43 42
44#include <sound/driver.h> 43#include <sound/driver.h>
45#include <sound/core.h> 44#include <sound/core.h>
@@ -1052,7 +1051,7 @@ snd_ad1889_remove(struct pci_dev *pci)
1052 pci_set_drvdata(pci, NULL); 1051 pci_set_drvdata(pci, NULL);
1053} 1052}
1054 1053
1055static struct pci_device_id snd_ad1889_ids[] = { 1054static struct pci_device_id snd_ad1889_ids[] __devinitdata = {
1056 { PCI_DEVICE(PCI_VENDOR_ID_ANALOG_DEVICES, PCI_DEVICE_ID_AD1889JS) }, 1055 { PCI_DEVICE(PCI_VENDOR_ID_ANALOG_DEVICES, PCI_DEVICE_ID_AD1889JS) },
1057 { 0, }, 1056 { 0, },
1058}; 1057};
diff --git a/sound/pci/ali5451/ali5451.c b/sound/pci/ali5451/ali5451.c
index fc92b6896c24..e2dbc2118902 100644
--- a/sound/pci/ali5451/ali5451.c
+++ b/sound/pci/ali5451/ali5451.c
@@ -279,7 +279,7 @@ struct snd_ali {
279#endif 279#endif
280}; 280};
281 281
282static struct pci_device_id snd_ali_ids[] = { 282static struct pci_device_id snd_ali_ids[] __devinitdata = {
283 {PCI_DEVICE(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M5451), 0, 0, 0}, 283 {PCI_DEVICE(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M5451), 0, 0, 0},
284 {0, } 284 {0, }
285}; 285};
diff --git a/sound/pci/als300.c b/sound/pci/als300.c
index 91899f87f037..901b08ae9174 100644
--- a/sound/pci/als300.c
+++ b/sound/pci/als300.c
@@ -146,7 +146,7 @@ struct snd_als300_substream_data {
146 int block_counter_register; 146 int block_counter_register;
147}; 147};
148 148
149static struct pci_device_id snd_als300_ids[] = { 149static struct pci_device_id snd_als300_ids[] __devinitdata = {
150 { 0x4005, 0x0300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_ALS300 }, 150 { 0x4005, 0x0300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_ALS300 },
151 { 0x4005, 0x0308, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_ALS300_PLUS }, 151 { 0x4005, 0x0308, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_ALS300_PLUS },
152 { 0, } 152 { 0, }
diff --git a/sound/pci/als4000.c b/sound/pci/als4000.c
index 100d8127a411..60423b1c678b 100644
--- a/sound/pci/als4000.c
+++ b/sound/pci/als4000.c
@@ -116,7 +116,7 @@ struct snd_card_als4000 {
116#endif 116#endif
117}; 117};
118 118
119static struct pci_device_id snd_als4000_ids[] = { 119static struct pci_device_id snd_als4000_ids[] __devinitdata = {
120 { 0x4005, 0x4000, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* ALS4000 */ 120 { 0x4005, 0x4000, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* ALS4000 */
121 { 0, } 121 { 0, }
122}; 122};
diff --git a/sound/pci/atiixp.c b/sound/pci/atiixp.c
index 12e618851262..d0f759d86d3d 100644
--- a/sound/pci/atiixp.c
+++ b/sound/pci/atiixp.c
@@ -284,7 +284,7 @@ struct atiixp {
284 284
285/* 285/*
286 */ 286 */
287static struct pci_device_id snd_atiixp_ids[] = { 287static struct pci_device_id snd_atiixp_ids[] __devinitdata = {
288 { 0x1002, 0x4341, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB200 */ 288 { 0x1002, 0x4341, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB200 */
289 { 0x1002, 0x4361, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB300 */ 289 { 0x1002, 0x4361, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB300 */
290 { 0x1002, 0x4370, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB400 */ 290 { 0x1002, 0x4370, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB400 */
diff --git a/sound/pci/atiixp_modem.c b/sound/pci/atiixp_modem.c
index 1d3766044643..12a34c39caa7 100644
--- a/sound/pci/atiixp_modem.c
+++ b/sound/pci/atiixp_modem.c
@@ -262,7 +262,7 @@ struct atiixp_modem {
262 262
263/* 263/*
264 */ 264 */
265static struct pci_device_id snd_atiixp_ids[] = { 265static struct pci_device_id snd_atiixp_ids[] __devinitdata = {
266 { 0x1002, 0x434d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB200 */ 266 { 0x1002, 0x434d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB200 */
267 { 0x1002, 0x4378, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB400 */ 267 { 0x1002, 0x4378, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB400 */
268 { 0, } 268 { 0, }
diff --git a/sound/pci/au88x0/au8810.c b/sound/pci/au88x0/au8810.c
index fce22c7af0ea..bd3352998ad0 100644
--- a/sound/pci/au88x0/au8810.c
+++ b/sound/pci/au88x0/au8810.c
@@ -1,6 +1,6 @@
1#include "au8810.h" 1#include "au8810.h"
2#include "au88x0.h" 2#include "au88x0.h"
3static struct pci_device_id snd_vortex_ids[] = { 3static struct pci_device_id snd_vortex_ids[] __devinitdata = {
4 {PCI_VENDOR_ID_AUREAL, PCI_DEVICE_ID_AUREAL_ADVANTAGE, 4 {PCI_VENDOR_ID_AUREAL, PCI_DEVICE_ID_AUREAL_ADVANTAGE,
5 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1,}, 5 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1,},
6 {0,} 6 {0,}
diff --git a/sound/pci/au88x0/au8820.c b/sound/pci/au88x0/au8820.c
index d1fbcce07257..7e3fd8372d8d 100644
--- a/sound/pci/au88x0/au8820.c
+++ b/sound/pci/au88x0/au8820.c
@@ -1,6 +1,6 @@
1#include "au8820.h" 1#include "au8820.h"
2#include "au88x0.h" 2#include "au88x0.h"
3static struct pci_device_id snd_vortex_ids[] = { 3static struct pci_device_id snd_vortex_ids[] __devinitdata = {
4 {PCI_VENDOR_ID_AUREAL, PCI_DEVICE_ID_AUREAL_VORTEX_1, 4 {PCI_VENDOR_ID_AUREAL, PCI_DEVICE_ID_AUREAL_VORTEX_1,
5 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0,}, 5 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0,},
6 {0,} 6 {0,}
diff --git a/sound/pci/au88x0/au8830.c b/sound/pci/au88x0/au8830.c
index d4f2717c14fb..b840f6608a61 100644
--- a/sound/pci/au88x0/au8830.c
+++ b/sound/pci/au88x0/au8830.c
@@ -1,6 +1,6 @@
1#include "au8830.h" 1#include "au8830.h"
2#include "au88x0.h" 2#include "au88x0.h"
3static struct pci_device_id snd_vortex_ids[] = { 3static struct pci_device_id snd_vortex_ids[] __devinitdata = {
4 {PCI_VENDOR_ID_AUREAL, PCI_DEVICE_ID_AUREAL_VORTEX_2, 4 {PCI_VENDOR_ID_AUREAL, PCI_DEVICE_ID_AUREAL_VORTEX_2,
5 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0,}, 5 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0,},
6 {0,} 6 {0,}
diff --git a/sound/pci/azt3328.c b/sound/pci/azt3328.c
index 680077e1e057..52a364524262 100644
--- a/sound/pci/azt3328.c
+++ b/sound/pci/azt3328.c
@@ -216,7 +216,7 @@ struct snd_azf3328 {
216 int irq; 216 int irq;
217}; 217};
218 218
219static const struct pci_device_id snd_azf3328_ids[] = { 219static const struct pci_device_id snd_azf3328_ids[] __devinitdata = {
220 { 0x122D, 0x50DC, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* PCI168/3328 */ 220 { 0x122D, 0x50DC, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* PCI168/3328 */
221 { 0x122D, 0x80DA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* 3328 */ 221 { 0x122D, 0x80DA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* 3328 */
222 { 0, } 222 { 0, }
diff --git a/sound/pci/bt87x.c b/sound/pci/bt87x.c
index 7b44a8db033d..9ee07d4aac1e 100644
--- a/sound/pci/bt87x.c
+++ b/sound/pci/bt87x.c
@@ -774,7 +774,7 @@ static int __devinit snd_bt87x_create(struct snd_card *card,
774 .driver_data = rate } 774 .driver_data = rate }
775 775
776/* driver_data is the default digital_rate value for that device */ 776/* driver_data is the default digital_rate value for that device */
777static struct pci_device_id snd_bt87x_ids[] = { 777static struct pci_device_id snd_bt87x_ids[] __devinitdata = {
778 /* Hauppauge WinTV series */ 778 /* Hauppauge WinTV series */
779 BT_DEVICE(PCI_DEVICE_ID_BROOKTREE_878, 0x0070, 0x13eb, 32000), 779 BT_DEVICE(PCI_DEVICE_ID_BROOKTREE_878, 0x0070, 0x13eb, 32000),
780 /* Hauppauge WinTV series */ 780 /* Hauppauge WinTV series */
@@ -911,7 +911,7 @@ static void __devexit snd_bt87x_remove(struct pci_dev *pci)
911 911
912/* default entries for all Bt87x cards - it's not exported */ 912/* default entries for all Bt87x cards - it's not exported */
913/* driver_data is set to 0 to call detection */ 913/* driver_data is set to 0 to call detection */
914static struct pci_device_id snd_bt87x_default_ids[] = { 914static struct pci_device_id snd_bt87x_default_ids[] __devinitdata = {
915 BT_DEVICE(PCI_DEVICE_ID_BROOKTREE_878, PCI_ANY_ID, PCI_ANY_ID, 0), 915 BT_DEVICE(PCI_DEVICE_ID_BROOKTREE_878, PCI_ANY_ID, PCI_ANY_ID, 0),
916 BT_DEVICE(PCI_DEVICE_ID_BROOKTREE_879, PCI_ANY_ID, PCI_ANY_ID, 0), 916 BT_DEVICE(PCI_DEVICE_ID_BROOKTREE_879, PCI_ANY_ID, PCI_ANY_ID, 0),
917 { } 917 { }
diff --git a/sound/pci/ca0106/ca0106_main.c b/sound/pci/ca0106/ca0106_main.c
index 9477838a9c88..fd8bfebfbd54 100644
--- a/sound/pci/ca0106/ca0106_main.c
+++ b/sound/pci/ca0106/ca0106_main.c
@@ -1561,7 +1561,7 @@ static void __devexit snd_ca0106_remove(struct pci_dev *pci)
1561} 1561}
1562 1562
1563// PCI IDs 1563// PCI IDs
1564static struct pci_device_id snd_ca0106_ids[] = { 1564static struct pci_device_id snd_ca0106_ids[] __devinitdata = {
1565 { 0x1102, 0x0007, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* Audigy LS or Live 24bit */ 1565 { 0x1102, 0x0007, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* Audigy LS or Live 24bit */
1566 { 0, } 1566 { 0, }
1567}; 1567};
diff --git a/sound/pci/cmipci.c b/sound/pci/cmipci.c
index 2ecbddbbdcf0..e5ce2dabd081 100644
--- a/sound/pci/cmipci.c
+++ b/sound/pci/cmipci.c
@@ -2609,7 +2609,7 @@ static inline void snd_cmipci_proc_init(struct cmipci *cm) {}
2609#endif 2609#endif
2610 2610
2611 2611
2612static struct pci_device_id snd_cmipci_ids[] = { 2612static struct pci_device_id snd_cmipci_ids[] __devinitdata = {
2613 {PCI_VENDOR_ID_CMEDIA, PCI_DEVICE_ID_CMEDIA_CM8338A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 2613 {PCI_VENDOR_ID_CMEDIA, PCI_DEVICE_ID_CMEDIA_CM8338A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
2614 {PCI_VENDOR_ID_CMEDIA, PCI_DEVICE_ID_CMEDIA_CM8338B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 2614 {PCI_VENDOR_ID_CMEDIA, PCI_DEVICE_ID_CMEDIA_CM8338B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
2615 {PCI_VENDOR_ID_CMEDIA, PCI_DEVICE_ID_CMEDIA_CM8738, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 2615 {PCI_VENDOR_ID_CMEDIA, PCI_DEVICE_ID_CMEDIA_CM8738, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
diff --git a/sound/pci/cs4281.c b/sound/pci/cs4281.c
index ac4e73f69c1d..b3c94d83450a 100644
--- a/sound/pci/cs4281.c
+++ b/sound/pci/cs4281.c
@@ -494,7 +494,7 @@ struct cs4281 {
494 494
495static irqreturn_t snd_cs4281_interrupt(int irq, void *dev_id, struct pt_regs *regs); 495static irqreturn_t snd_cs4281_interrupt(int irq, void *dev_id, struct pt_regs *regs);
496 496
497static struct pci_device_id snd_cs4281_ids[] = { 497static struct pci_device_id snd_cs4281_ids[] __devinitdata = {
498 { 0x1013, 0x6005, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* CS4281 */ 498 { 0x1013, 0x6005, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* CS4281 */
499 { 0, } 499 { 0, }
500}; 500};
diff --git a/sound/pci/cs46xx/cs46xx.c b/sound/pci/cs46xx/cs46xx.c
index c590602e20cd..848d772ae3c6 100644
--- a/sound/pci/cs46xx/cs46xx.c
+++ b/sound/pci/cs46xx/cs46xx.c
@@ -65,7 +65,7 @@ MODULE_PARM_DESC(thinkpad, "Force to enable Thinkpad's CLKRUN control.");
65module_param_array(mmap_valid, bool, NULL, 0444); 65module_param_array(mmap_valid, bool, NULL, 0444);
66MODULE_PARM_DESC(mmap_valid, "Support OSS mmap."); 66MODULE_PARM_DESC(mmap_valid, "Support OSS mmap.");
67 67
68static struct pci_device_id snd_cs46xx_ids[] = { 68static struct pci_device_id snd_cs46xx_ids[] __devinitdata = {
69 { 0x1013, 0x6001, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* CS4280 */ 69 { 0x1013, 0x6001, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* CS4280 */
70 { 0x1013, 0x6003, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* CS4612 */ 70 { 0x1013, 0x6003, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* CS4612 */
71 { 0x1013, 0x6004, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* CS4615 */ 71 { 0x1013, 0x6004, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* CS4615 */
diff --git a/sound/pci/cs5535audio/cs5535audio.c b/sound/pci/cs5535audio/cs5535audio.c
index 9fc7f3827461..2c1213a35dcc 100644
--- a/sound/pci/cs5535audio/cs5535audio.c
+++ b/sound/pci/cs5535audio/cs5535audio.c
@@ -45,7 +45,7 @@ static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
45static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; 45static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;
46static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; 46static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;
47 47
48static struct pci_device_id snd_cs5535audio_ids[] = { 48static struct pci_device_id snd_cs5535audio_ids[] __devinitdata = {
49 { PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_CS5535_AUDIO, 49 { PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_CS5535_AUDIO,
50 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, 50 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, },
51 { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CS5536_AUDIO, 51 { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CS5536_AUDIO,
diff --git a/sound/pci/emu10k1/emu10k1.c b/sound/pci/emu10k1/emu10k1.c
index 2dfa932f7825..42b11ba1d210 100644
--- a/sound/pci/emu10k1/emu10k1.c
+++ b/sound/pci/emu10k1/emu10k1.c
@@ -77,7 +77,7 @@ MODULE_PARM_DESC(subsystem, "Force card subsystem model.");
77/* 77/*
78 * Class 0401: 1102:0008 (rev 00) Subsystem: 1102:1001 -> Audigy2 Value Model:SB0400 78 * Class 0401: 1102:0008 (rev 00) Subsystem: 1102:1001 -> Audigy2 Value Model:SB0400
79 */ 79 */
80static struct pci_device_id snd_emu10k1_ids[] = { 80static struct pci_device_id snd_emu10k1_ids[] __devinitdata = {
81 { 0x1102, 0x0002, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* EMU10K1 */ 81 { 0x1102, 0x0002, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* EMU10K1 */
82 { 0x1102, 0x0004, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 }, /* Audigy */ 82 { 0x1102, 0x0004, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 }, /* Audigy */
83 { 0x1102, 0x0008, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 }, /* Audigy 2 Value SB0400 */ 83 { 0x1102, 0x0008, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 }, /* Audigy 2 Value SB0400 */
diff --git a/sound/pci/emu10k1/emu10k1x.c b/sound/pci/emu10k1/emu10k1x.c
index 3e332f398162..d51290c18167 100644
--- a/sound/pci/emu10k1/emu10k1x.c
+++ b/sound/pci/emu10k1/emu10k1x.c
@@ -36,7 +36,6 @@
36#include <linux/dma-mapping.h> 36#include <linux/dma-mapping.h>
37#include <linux/slab.h> 37#include <linux/slab.h>
38#include <linux/moduleparam.h> 38#include <linux/moduleparam.h>
39#include <linux/dma-mapping.h>
40#include <sound/core.h> 39#include <sound/core.h>
41#include <sound/initval.h> 40#include <sound/initval.h>
42#include <sound/pcm.h> 41#include <sound/pcm.h>
@@ -1596,7 +1595,7 @@ static void __devexit snd_emu10k1x_remove(struct pci_dev *pci)
1596} 1595}
1597 1596
1598// PCI IDs 1597// PCI IDs
1599static struct pci_device_id snd_emu10k1x_ids[] = { 1598static struct pci_device_id snd_emu10k1x_ids[] __devinitdata = {
1600 { 0x1102, 0x0006, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* Dell OEM version (EMU10K1) */ 1599 { 0x1102, 0x0006, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* Dell OEM version (EMU10K1) */
1601 { 0, } 1600 { 0, }
1602}; 1601};
diff --git a/sound/pci/ens1370.c b/sound/pci/ens1370.c
index a5533c86b0b6..ca9e34e88f62 100644
--- a/sound/pci/ens1370.c
+++ b/sound/pci/ens1370.c
@@ -446,7 +446,7 @@ struct ensoniq {
446 446
447static irqreturn_t snd_audiopci_interrupt(int irq, void *dev_id, struct pt_regs *regs); 447static irqreturn_t snd_audiopci_interrupt(int irq, void *dev_id, struct pt_regs *regs);
448 448
449static struct pci_device_id snd_audiopci_ids[] = { 449static struct pci_device_id snd_audiopci_ids[] __devinitdata = {
450#ifdef CHIP1370 450#ifdef CHIP1370
451 { 0x1274, 0x5000, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* ES1370 */ 451 { 0x1274, 0x5000, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* ES1370 */
452#endif 452#endif
diff --git a/sound/pci/es1938.c b/sound/pci/es1938.c
index 4d62fe439177..6f9094ca4fb4 100644
--- a/sound/pci/es1938.c
+++ b/sound/pci/es1938.c
@@ -242,7 +242,7 @@ struct es1938 {
242 242
243static irqreturn_t snd_es1938_interrupt(int irq, void *dev_id, struct pt_regs *regs); 243static irqreturn_t snd_es1938_interrupt(int irq, void *dev_id, struct pt_regs *regs);
244 244
245static struct pci_device_id snd_es1938_ids[] = { 245static struct pci_device_id snd_es1938_ids[] __devinitdata = {
246 { 0x125d, 0x1969, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* Solo-1 */ 246 { 0x125d, 0x1969, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* Solo-1 */
247 { 0, } 247 { 0, }
248}; 248};
diff --git a/sound/pci/es1968.c b/sound/pci/es1968.c
index e3ad17f53c29..5ff4175c7b6d 100644
--- a/sound/pci/es1968.c
+++ b/sound/pci/es1968.c
@@ -104,7 +104,6 @@
104#include <linux/slab.h> 104#include <linux/slab.h>
105#include <linux/gameport.h> 105#include <linux/gameport.h>
106#include <linux/moduleparam.h> 106#include <linux/moduleparam.h>
107#include <linux/dma-mapping.h>
108#include <linux/mutex.h> 107#include <linux/mutex.h>
109 108
110#include <sound/core.h> 109#include <sound/core.h>
@@ -593,7 +592,7 @@ struct es1968 {
593 592
594static irqreturn_t snd_es1968_interrupt(int irq, void *dev_id, struct pt_regs *regs); 593static irqreturn_t snd_es1968_interrupt(int irq, void *dev_id, struct pt_regs *regs);
595 594
596static struct pci_device_id snd_es1968_ids[] = { 595static struct pci_device_id snd_es1968_ids[] __devinitdata = {
597 /* Maestro 1 */ 596 /* Maestro 1 */
598 { 0x1285, 0x0100, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, TYPE_MAESTRO }, 597 { 0x1285, 0x0100, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, TYPE_MAESTRO },
599 /* Maestro 2 */ 598 /* Maestro 2 */
diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c
index 6ab4aefbccf8..d72fc28c580e 100644
--- a/sound/pci/fm801.c
+++ b/sound/pci/fm801.c
@@ -199,7 +199,7 @@ struct fm801 {
199#endif 199#endif
200}; 200};
201 201
202static struct pci_device_id snd_fm801_ids[] = { 202static struct pci_device_id snd_fm801_ids[] __devinitdata = {
203 { 0x1319, 0x0801, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, 0, }, /* FM801 */ 203 { 0x1319, 0x0801, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, 0, }, /* FM801 */
204 { 0x5213, 0x0510, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, 0, }, /* Gallant Odyssey Sound 4 */ 204 { 0x5213, 0x0510, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, 0, }, /* Gallant Odyssey Sound 4 */
205 { 0, } 205 { 0, }
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 0ad60ae29011..e821d65afa11 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -1614,7 +1614,7 @@ static void __devexit azx_remove(struct pci_dev *pci)
1614} 1614}
1615 1615
1616/* PCI IDs */ 1616/* PCI IDs */
1617static struct pci_device_id azx_ids[] = { 1617static struct pci_device_id azx_ids[] __devinitdata = {
1618 { 0x8086, 0x2668, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ICH }, /* ICH6 */ 1618 { 0x8086, 0x2668, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ICH }, /* ICH6 */
1619 { 0x8086, 0x27d8, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ICH }, /* ICH7 */ 1619 { 0x8086, 0x27d8, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ICH }, /* ICH7 */
1620 { 0x8086, 0x269a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ICH }, /* ESB2 */ 1620 { 0x8086, 0x269a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ICH }, /* ESB2 */
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
index bcfca159c6a2..40f000ba1362 100644
--- a/sound/pci/hda/patch_analog.c
+++ b/sound/pci/hda/patch_analog.c
@@ -799,10 +799,14 @@ static struct hda_board_config ad1986a_cfg_tbl[] = {
799 { .modelname = "laptop-eapd", .config = AD1986A_LAPTOP_EAPD }, 799 { .modelname = "laptop-eapd", .config = AD1986A_LAPTOP_EAPD },
800 { .pci_subvendor = 0x144d, .pci_subdevice = 0xc024, 800 { .pci_subvendor = 0x144d, .pci_subdevice = 0xc024,
801 .config = AD1986A_LAPTOP_EAPD }, /* Samsung R65-T2300 Charis */ 801 .config = AD1986A_LAPTOP_EAPD }, /* Samsung R65-T2300 Charis */
802 { .pci_subvendor = 0x1043, .pci_subdevice = 0x1153,
803 .config = AD1986A_LAPTOP_EAPD }, /* ASUS M9 */
802 { .pci_subvendor = 0x1043, .pci_subdevice = 0x1213, 804 { .pci_subvendor = 0x1043, .pci_subdevice = 0x1213,
803 .config = AD1986A_LAPTOP_EAPD }, /* ASUS A6J */ 805 .config = AD1986A_LAPTOP_EAPD }, /* ASUS A6J */
804 { .pci_subvendor = 0x1043, .pci_subdevice = 0x11f7, 806 { .pci_subvendor = 0x1043, .pci_subdevice = 0x11f7,
805 .config = AD1986A_LAPTOP_EAPD }, /* ASUS U5A */ 807 .config = AD1986A_LAPTOP_EAPD }, /* ASUS U5A */
808 { .pci_subvendor = 0x1043, .pci_subdevice = 0x1297,
809 .config = AD1986A_LAPTOP_EAPD }, /* ASUS Z62F */
806 { .pci_subvendor = 0x103c, .pci_subdevice = 0x30af, 810 { .pci_subvendor = 0x103c, .pci_subdevice = 0x30af,
807 .config = AD1986A_LAPTOP_EAPD }, /* HP Compaq Presario B2800 */ 811 .config = AD1986A_LAPTOP_EAPD }, /* HP Compaq Presario B2800 */
808 {} 812 {}
@@ -1330,12 +1334,8 @@ enum { AD1981_BASIC, AD1981_HP };
1330 1334
1331static struct hda_board_config ad1981_cfg_tbl[] = { 1335static struct hda_board_config ad1981_cfg_tbl[] = {
1332 { .modelname = "hp", .config = AD1981_HP }, 1336 { .modelname = "hp", .config = AD1981_HP },
1333 { .pci_subvendor = 0x103c, .pci_subdevice = 0x30aa, 1337 /* All HP models */
1334 .config = AD1981_HP }, /* HP nx6320 */ 1338 { .pci_subvendor = 0x103c, .config = AD1981_HP },
1335 { .pci_subvendor = 0x103c, .pci_subdevice = 0x309f,
1336 .config = AD1981_HP }, /* HP nx9420 AngelFire */
1337 { .pci_subvendor = 0x103c, .pci_subdevice = 0x30a2,
1338 .config = AD1981_HP }, /* HP nx9420 AngelFire */
1339 { .modelname = "basic", .config = AD1981_BASIC }, 1339 { .modelname = "basic", .config = AD1981_BASIC },
1340 {} 1340 {}
1341}; 1341};
@@ -2623,5 +2623,6 @@ struct hda_codec_preset snd_hda_preset_analog[] = {
2623 { .id = 0x11d41983, .name = "AD1983", .patch = patch_ad1983 }, 2623 { .id = 0x11d41983, .name = "AD1983", .patch = patch_ad1983 },
2624 { .id = 0x11d41986, .name = "AD1986A", .patch = patch_ad1986a }, 2624 { .id = 0x11d41986, .name = "AD1986A", .patch = patch_ad1986a },
2625 { .id = 0x11d41988, .name = "AD1988", .patch = patch_ad1988 }, 2625 { .id = 0x11d41988, .name = "AD1988", .patch = patch_ad1988 },
2626 { .id = 0x11d4198b, .name = "AD1988B", .patch = patch_ad1988 },
2626 {} /* terminator */ 2627 {} /* terminator */
2627}; 2628};
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 66bbdb60f50b..f0e9a9c90780 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -2148,6 +2148,7 @@ static struct hda_board_config alc880_cfg_tbl[] = {
2148 { .pci_subvendor = 0x1025, .pci_subdevice = 0x0087, .config = ALC880_6ST_DIG }, 2148 { .pci_subvendor = 0x1025, .pci_subdevice = 0x0087, .config = ALC880_6ST_DIG },
2149 { .pci_subvendor = 0x1297, .pci_subdevice = 0xc790, .config = ALC880_6ST_DIG }, /* Shuttle ST20G5 */ 2149 { .pci_subvendor = 0x1297, .pci_subdevice = 0xc790, .config = ALC880_6ST_DIG }, /* Shuttle ST20G5 */
2150 { .pci_subvendor = 0x1509, .pci_subdevice = 0x925d, .config = ALC880_6ST_DIG }, /* FIC P4M-915GD1 */ 2150 { .pci_subvendor = 0x1509, .pci_subdevice = 0x925d, .config = ALC880_6ST_DIG }, /* FIC P4M-915GD1 */
2151 { .pci_subvendor = 0x1695, .pci_subdevice = 0x4012, .config = ALC880_5ST_DIG }, /* Epox EP-5LDA+ GLi */
2151 2152
2152 { .modelname = "asus", .config = ALC880_ASUS }, 2153 { .modelname = "asus", .config = ALC880_ASUS },
2153 { .pci_subvendor = 0x1043, .pci_subdevice = 0x1964, .config = ALC880_ASUS_DIG }, 2154 { .pci_subvendor = 0x1043, .pci_subdevice = 0x1964, .config = ALC880_ASUS_DIG },
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 715260787953..8c440fb98603 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -1212,8 +1212,8 @@ static hda_nid_t vaio_mux_nids[] = { 0x15 };
1212static struct hda_input_mux vaio_mux = { 1212static struct hda_input_mux vaio_mux = {
1213 .num_items = 2, 1213 .num_items = 2,
1214 .items = { 1214 .items = {
1215 /* { "HP", 0x0 }, 1215 /* { "HP", 0x0 }, */
1216 { "Unknown", 0x1 }, */ 1216 { "Line", 0x1 },
1217 { "Mic", 0x2 }, 1217 { "Mic", 0x2 },
1218 { "PCM", 0x3 }, 1218 { "PCM", 0x3 },
1219 } 1219 }
diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c
index 32f8415558a5..c56793b381e2 100644
--- a/sound/pci/ice1712/ice1712.c
+++ b/sound/pci/ice1712/ice1712.c
@@ -56,7 +56,6 @@
56#include <linux/dma-mapping.h> 56#include <linux/dma-mapping.h>
57#include <linux/slab.h> 57#include <linux/slab.h>
58#include <linux/moduleparam.h> 58#include <linux/moduleparam.h>
59#include <linux/dma-mapping.h>
60#include <linux/mutex.h> 59#include <linux/mutex.h>
61 60
62#include <sound/core.h> 61#include <sound/core.h>
@@ -108,7 +107,7 @@ module_param_array(dxr_enable, int, NULL, 0444);
108MODULE_PARM_DESC(dxr_enable, "Enable DXR support for Terratec DMX6FIRE."); 107MODULE_PARM_DESC(dxr_enable, "Enable DXR support for Terratec DMX6FIRE.");
109 108
110 109
111static struct pci_device_id snd_ice1712_ids[] = { 110static struct pci_device_id snd_ice1712_ids[] __devinitdata = {
112 { PCI_VENDOR_ID_ICE, PCI_DEVICE_ID_ICE_1712, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* ICE1712 */ 111 { PCI_VENDOR_ID_ICE, PCI_DEVICE_ID_ICE_1712, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* ICE1712 */
113 { 0, } 112 { 0, }
114}; 113};
diff --git a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c
index fce616c2761f..b1c007e022d2 100644
--- a/sound/pci/ice1712/ice1724.c
+++ b/sound/pci/ice1712/ice1724.c
@@ -86,7 +86,7 @@ MODULE_PARM_DESC(model, "Use the given board model.");
86 86
87 87
88/* Both VT1720 and VT1724 have the same PCI IDs */ 88/* Both VT1720 and VT1724 have the same PCI IDs */
89static struct pci_device_id snd_vt1724_ids[] = { 89static struct pci_device_id snd_vt1724_ids[] __devinitdata = {
90 { PCI_VENDOR_ID_ICE, PCI_DEVICE_ID_VT1724, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, 90 { PCI_VENDOR_ID_ICE, PCI_DEVICE_ID_VT1724, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
91 { 0, } 91 { 0, }
92}; 92};
diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c
index ebbf2cf4ca0f..0df7602568e2 100644
--- a/sound/pci/intel8x0.c
+++ b/sound/pci/intel8x0.c
@@ -413,7 +413,7 @@ struct intel8x0 {
413 u32 int_sta_mask; /* interrupt status mask */ 413 u32 int_sta_mask; /* interrupt status mask */
414}; 414};
415 415
416static struct pci_device_id snd_intel8x0_ids[] = { 416static struct pci_device_id snd_intel8x0_ids[] __devinitdata = {
417 { 0x8086, 0x2415, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82801AA */ 417 { 0x8086, 0x2415, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82801AA */
418 { 0x8086, 0x2425, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82901AB */ 418 { 0x8086, 0x2425, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82901AB */
419 { 0x8086, 0x2445, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82801BA */ 419 { 0x8086, 0x2445, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82801BA */
@@ -1293,6 +1293,7 @@ static int snd_intel8x0_ali_ac97spdifout_close(struct snd_pcm_substream *substre
1293 return 0; 1293 return 0;
1294} 1294}
1295 1295
1296#if 0 // NYI
1296static int snd_intel8x0_ali_spdifin_open(struct snd_pcm_substream *substream) 1297static int snd_intel8x0_ali_spdifin_open(struct snd_pcm_substream *substream)
1297{ 1298{
1298 struct intel8x0 *chip = snd_pcm_substream_chip(substream); 1299 struct intel8x0 *chip = snd_pcm_substream_chip(substream);
@@ -1308,7 +1309,6 @@ static int snd_intel8x0_ali_spdifin_close(struct snd_pcm_substream *substream)
1308 return 0; 1309 return 0;
1309} 1310}
1310 1311
1311#if 0 // NYI
1312static int snd_intel8x0_ali_spdifout_open(struct snd_pcm_substream *substream) 1312static int snd_intel8x0_ali_spdifout_open(struct snd_pcm_substream *substream)
1313{ 1313{
1314 struct intel8x0 *chip = snd_pcm_substream_chip(substream); 1314 struct intel8x0 *chip = snd_pcm_substream_chip(substream);
@@ -1435,6 +1435,7 @@ static struct snd_pcm_ops snd_intel8x0_ali_ac97spdifout_ops = {
1435 .pointer = snd_intel8x0_pcm_pointer, 1435 .pointer = snd_intel8x0_pcm_pointer,
1436}; 1436};
1437 1437
1438#if 0 // NYI
1438static struct snd_pcm_ops snd_intel8x0_ali_spdifin_ops = { 1439static struct snd_pcm_ops snd_intel8x0_ali_spdifin_ops = {
1439 .open = snd_intel8x0_ali_spdifin_open, 1440 .open = snd_intel8x0_ali_spdifin_open,
1440 .close = snd_intel8x0_ali_spdifin_close, 1441 .close = snd_intel8x0_ali_spdifin_close,
@@ -1446,7 +1447,6 @@ static struct snd_pcm_ops snd_intel8x0_ali_spdifin_ops = {
1446 .pointer = snd_intel8x0_pcm_pointer, 1447 .pointer = snd_intel8x0_pcm_pointer,
1447}; 1448};
1448 1449
1449#if 0 // NYI
1450static struct snd_pcm_ops snd_intel8x0_ali_spdifout_ops = { 1450static struct snd_pcm_ops snd_intel8x0_ali_spdifout_ops = {
1451 .open = snd_intel8x0_ali_spdifout_open, 1451 .open = snd_intel8x0_ali_spdifout_open,
1452 .close = snd_intel8x0_ali_spdifout_close, 1452 .close = snd_intel8x0_ali_spdifout_close,
@@ -1582,7 +1582,7 @@ static struct ich_pcm_table ali_pcms[] __devinitdata = {
1582 { 1582 {
1583 .suffix = "IEC958", 1583 .suffix = "IEC958",
1584 .playback_ops = &snd_intel8x0_ali_ac97spdifout_ops, 1584 .playback_ops = &snd_intel8x0_ali_ac97spdifout_ops,
1585 .capture_ops = &snd_intel8x0_ali_spdifin_ops, 1585 /* .capture_ops = &snd_intel8x0_ali_spdifin_ops, */
1586 .prealloc_size = 64 * 1024, 1586 .prealloc_size = 64 * 1024,
1587 .prealloc_max_size = 128 * 1024, 1587 .prealloc_max_size = 128 * 1024,
1588 .ac97_idx = ALID_AC97SPDIFOUT, 1588 .ac97_idx = ALID_AC97SPDIFOUT,
diff --git a/sound/pci/intel8x0m.c b/sound/pci/intel8x0m.c
index 47e26aaa9ad7..720635f0cb81 100644
--- a/sound/pci/intel8x0m.c
+++ b/sound/pci/intel8x0m.c
@@ -224,7 +224,7 @@ struct intel8x0m {
224 unsigned int pcm_pos_shift; 224 unsigned int pcm_pos_shift;
225}; 225};
226 226
227static struct pci_device_id snd_intel8x0m_ids[] = { 227static struct pci_device_id snd_intel8x0m_ids[] __devinitdata = {
228 { 0x8086, 0x2416, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82801AA */ 228 { 0x8086, 0x2416, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82801AA */
229 { 0x8086, 0x2426, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82901AB */ 229 { 0x8086, 0x2426, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82901AB */
230 { 0x8086, 0x2446, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82801BA */ 230 { 0x8086, 0x2446, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82801BA */
diff --git a/sound/pci/korg1212/korg1212.c b/sound/pci/korg1212/korg1212.c
index 4721c096335e..e39fad1a4200 100644
--- a/sound/pci/korg1212/korg1212.c
+++ b/sound/pci/korg1212/korg1212.c
@@ -424,7 +424,7 @@ module_param_array(enable, bool, NULL, 0444);
424MODULE_PARM_DESC(enable, "Enable Korg 1212 soundcard."); 424MODULE_PARM_DESC(enable, "Enable Korg 1212 soundcard.");
425MODULE_AUTHOR("Haroldo Gamal <gamal@alternex.com.br>"); 425MODULE_AUTHOR("Haroldo Gamal <gamal@alternex.com.br>");
426 426
427static struct pci_device_id snd_korg1212_ids[] = { 427static struct pci_device_id snd_korg1212_ids[] __devinitdata = {
428 { 428 {
429 .vendor = 0x10b5, 429 .vendor = 0x10b5,
430 .device = 0x906d, 430 .device = 0x906d,
diff --git a/sound/pci/maestro3.c b/sound/pci/maestro3.c
index 9c90d901e6b9..1928e06b6d82 100644
--- a/sound/pci/maestro3.c
+++ b/sound/pci/maestro3.c
@@ -41,7 +41,6 @@
41#include <linux/slab.h> 41#include <linux/slab.h>
42#include <linux/vmalloc.h> 42#include <linux/vmalloc.h>
43#include <linux/moduleparam.h> 43#include <linux/moduleparam.h>
44#include <linux/dma-mapping.h>
45#include <sound/core.h> 44#include <sound/core.h>
46#include <sound/info.h> 45#include <sound/info.h>
47#include <sound/control.h> 46#include <sound/control.h>
@@ -870,7 +869,7 @@ struct snd_m3 {
870/* 869/*
871 * pci ids 870 * pci ids
872 */ 871 */
873static struct pci_device_id snd_m3_ids[] = { 872static struct pci_device_id snd_m3_ids[] __devinitdata = {
874 {PCI_VENDOR_ID_ESS, PCI_DEVICE_ID_ESS_ALLEGRO_1, PCI_ANY_ID, PCI_ANY_ID, 873 {PCI_VENDOR_ID_ESS, PCI_DEVICE_ID_ESS_ALLEGRO_1, PCI_ANY_ID, PCI_ANY_ID,
875 PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, 0}, 874 PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, 0},
876 {PCI_VENDOR_ID_ESS, PCI_DEVICE_ID_ESS_ALLEGRO, PCI_ANY_ID, PCI_ANY_ID, 875 {PCI_VENDOR_ID_ESS, PCI_DEVICE_ID_ESS_ALLEGRO, PCI_ANY_ID, PCI_ANY_ID,
diff --git a/sound/pci/mixart/mixart.c b/sound/pci/mixart/mixart.c
index b5a095052d4c..09cc0786495a 100644
--- a/sound/pci/mixart/mixart.c
+++ b/sound/pci/mixart/mixart.c
@@ -28,7 +28,6 @@
28#include <linux/dma-mapping.h> 28#include <linux/dma-mapping.h>
29#include <linux/moduleparam.h> 29#include <linux/moduleparam.h>
30#include <linux/mutex.h> 30#include <linux/mutex.h>
31#include <linux/dma-mapping.h>
32 31
33#include <sound/core.h> 32#include <sound/core.h>
34#include <sound/initval.h> 33#include <sound/initval.h>
@@ -62,7 +61,7 @@ MODULE_PARM_DESC(enable, "Enable Digigram " CARD_NAME " soundcard.");
62/* 61/*
63 */ 62 */
64 63
65static struct pci_device_id snd_mixart_ids[] = { 64static struct pci_device_id snd_mixart_ids[] __devinitdata = {
66 { 0x1057, 0x0003, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* MC8240 */ 65 { 0x1057, 0x0003, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* MC8240 */
67 { 0, } 66 { 0, }
68}; 67};
diff --git a/sound/pci/nm256/nm256.c b/sound/pci/nm256/nm256.c
index cc297abc9d11..b92d6600deb9 100644
--- a/sound/pci/nm256/nm256.c
+++ b/sound/pci/nm256/nm256.c
@@ -263,7 +263,7 @@ struct nm256 {
263/* 263/*
264 * PCI ids 264 * PCI ids
265 */ 265 */
266static struct pci_device_id snd_nm256_ids[] = { 266static struct pci_device_id snd_nm256_ids[] __devinitdata = {
267 {PCI_VENDOR_ID_NEOMAGIC, PCI_DEVICE_ID_NEOMAGIC_NM256AV_AUDIO, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 267 {PCI_VENDOR_ID_NEOMAGIC, PCI_DEVICE_ID_NEOMAGIC_NM256AV_AUDIO, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
268 {PCI_VENDOR_ID_NEOMAGIC, PCI_DEVICE_ID_NEOMAGIC_NM256ZX_AUDIO, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 268 {PCI_VENDOR_ID_NEOMAGIC, PCI_DEVICE_ID_NEOMAGIC_NM256ZX_AUDIO, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
269 {PCI_VENDOR_ID_NEOMAGIC, PCI_DEVICE_ID_NEOMAGIC_NM256XL_PLUS_AUDIO, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 269 {PCI_VENDOR_ID_NEOMAGIC, PCI_DEVICE_ID_NEOMAGIC_NM256XL_PLUS_AUDIO, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
diff --git a/sound/pci/pcxhr/pcxhr.c b/sound/pci/pcxhr/pcxhr.c
index 35875c8aa299..dafa2235abaa 100644
--- a/sound/pci/pcxhr/pcxhr.c
+++ b/sound/pci/pcxhr/pcxhr.c
@@ -30,7 +30,6 @@
30#include <linux/delay.h> 30#include <linux/delay.h>
31#include <linux/moduleparam.h> 31#include <linux/moduleparam.h>
32#include <linux/mutex.h> 32#include <linux/mutex.h>
33#include <linux/dma-mapping.h>
34 33
35#include <sound/core.h> 34#include <sound/core.h>
36#include <sound/initval.h> 35#include <sound/initval.h>
@@ -74,7 +73,7 @@ enum {
74 PCI_ID_LAST 73 PCI_ID_LAST
75}; 74};
76 75
77static struct pci_device_id pcxhr_ids[] = { 76static struct pci_device_id pcxhr_ids[] __devinitdata = {
78 { 0x10b5, 0x9656, 0x1369, 0xb001, 0, 0, PCI_ID_VX882HR, }, /* VX882HR */ 77 { 0x10b5, 0x9656, 0x1369, 0xb001, 0, 0, PCI_ID_VX882HR, }, /* VX882HR */
79 { 0x10b5, 0x9656, 0x1369, 0xb101, 0, 0, PCI_ID_PCX882HR, }, /* PCX882HR */ 78 { 0x10b5, 0x9656, 0x1369, 0xb101, 0, 0, PCI_ID_PCX882HR, }, /* PCX882HR */
80 { 0x10b5, 0x9656, 0x1369, 0xb201, 0, 0, PCI_ID_VX881HR, }, /* VX881HR */ 79 { 0x10b5, 0x9656, 0x1369, 0xb201, 0, 0, PCI_ID_VX881HR, }, /* VX881HR */
diff --git a/sound/pci/pcxhr/pcxhr_hwdep.c b/sound/pci/pcxhr/pcxhr_hwdep.c
index 03517c10e99c..369c19fea985 100644
--- a/sound/pci/pcxhr/pcxhr_hwdep.c
+++ b/sound/pci/pcxhr/pcxhr_hwdep.c
@@ -385,8 +385,8 @@ static int pcxhr_hwdep_dsp_load(struct snd_hwdep *hw,
385 fw.size = dsp->length; 385 fw.size = dsp->length;
386 fw.data = vmalloc(fw.size); 386 fw.data = vmalloc(fw.size);
387 if (! fw.data) { 387 if (! fw.data) {
388 snd_printk(KERN_ERR "pcxhr: cannot allocate dsp image (%d bytes)\n", 388 snd_printk(KERN_ERR "pcxhr: cannot allocate dsp image (%lu bytes)\n",
389 fw.size); 389 (unsigned long)fw.size);
390 return -ENOMEM; 390 return -ENOMEM;
391 } 391 }
392 if (copy_from_user(fw.data, dsp->image, dsp->length)) { 392 if (copy_from_user(fw.data, dsp->image, dsp->length)) {
diff --git a/sound/pci/riptide/riptide.c b/sound/pci/riptide/riptide.c
index f148ee434a6b..d8cc985d7241 100644
--- a/sound/pci/riptide/riptide.c
+++ b/sound/pci/riptide/riptide.c
@@ -506,7 +506,7 @@ static int riptide_reset(struct cmdif *cif, struct snd_riptide *chip);
506/* 506/*
507 */ 507 */
508 508
509static struct pci_device_id snd_riptide_ids[] = { 509static struct pci_device_id snd_riptide_ids[] __devinitdata = {
510 { 510 {
511 .vendor = 0x127a,.device = 0x4310, 511 .vendor = 0x127a,.device = 0x4310,
512 .subvendor = PCI_ANY_ID,.subdevice = PCI_ANY_ID, 512 .subvendor = PCI_ANY_ID,.subdevice = PCI_ANY_ID,
@@ -527,7 +527,7 @@ static struct pci_device_id snd_riptide_ids[] = {
527}; 527};
528 528
529#ifdef SUPPORT_JOYSTICK 529#ifdef SUPPORT_JOYSTICK
530static struct pci_device_id snd_riptide_joystick_ids[] = { 530static struct pci_device_id snd_riptide_joystick_ids[] __devinitdata = {
531 { 531 {
532 .vendor = 0x127a,.device = 0x4312, 532 .vendor = 0x127a,.device = 0x4312,
533 .subvendor = PCI_ANY_ID,.subdevice = PCI_ANY_ID, 533 .subvendor = PCI_ANY_ID,.subdevice = PCI_ANY_ID,
diff --git a/sound/pci/rme32.c b/sound/pci/rme32.c
index ab78544bf042..55b1d4838d97 100644
--- a/sound/pci/rme32.c
+++ b/sound/pci/rme32.c
@@ -227,7 +227,7 @@ struct rme32 {
227 struct snd_kcontrol *spdif_ctl; 227 struct snd_kcontrol *spdif_ctl;
228}; 228};
229 229
230static struct pci_device_id snd_rme32_ids[] = { 230static struct pci_device_id snd_rme32_ids[] __devinitdata = {
231 {PCI_VENDOR_ID_XILINX_RME, PCI_DEVICE_ID_RME_DIGI32, 231 {PCI_VENDOR_ID_XILINX_RME, PCI_DEVICE_ID_RME_DIGI32,
232 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0,}, 232 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0,},
233 {PCI_VENDOR_ID_XILINX_RME, PCI_DEVICE_ID_RME_DIGI32_8, 233 {PCI_VENDOR_ID_XILINX_RME, PCI_DEVICE_ID_RME_DIGI32_8,
diff --git a/sound/pci/rme96.c b/sound/pci/rme96.c
index 6c2a9f4a7659..3c1bc533d511 100644
--- a/sound/pci/rme96.c
+++ b/sound/pci/rme96.c
@@ -232,7 +232,7 @@ struct rme96 {
232 struct snd_kcontrol *spdif_ctl; 232 struct snd_kcontrol *spdif_ctl;
233}; 233};
234 234
235static struct pci_device_id snd_rme96_ids[] = { 235static struct pci_device_id snd_rme96_ids[] __devinitdata = {
236 { PCI_VENDOR_ID_XILINX, PCI_DEVICE_ID_RME_DIGI96, 236 { PCI_VENDOR_ID_XILINX, PCI_DEVICE_ID_RME_DIGI96,
237 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, 237 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, },
238 { PCI_VENDOR_ID_XILINX, PCI_DEVICE_ID_RME_DIGI96_8, 238 { PCI_VENDOR_ID_XILINX, PCI_DEVICE_ID_RME_DIGI96_8,
diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c
index ebf7a2b86c23..61f82f0d5cc6 100644
--- a/sound/pci/rme9652/hdsp.c
+++ b/sound/pci/rme9652/hdsp.c
@@ -568,7 +568,7 @@ static void snd_hammerfall_free_buffer(struct snd_dma_buffer *dmab, struct pci_d
568} 568}
569 569
570 570
571static struct pci_device_id snd_hdsp_ids[] = { 571static struct pci_device_id snd_hdsp_ids[] __devinitdata = {
572 { 572 {
573 .vendor = PCI_VENDOR_ID_XILINX, 573 .vendor = PCI_VENDOR_ID_XILINX,
574 .device = PCI_DEVICE_ID_XILINX_HAMMERFALL_DSP, 574 .device = PCI_DEVICE_ID_XILINX_HAMMERFALL_DSP,
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c
index b5538efd146b..722b9e6ce54a 100644
--- a/sound/pci/rme9652/hdspm.c
+++ b/sound/pci/rme9652/hdspm.c
@@ -426,7 +426,7 @@ static char channel_map_madi_qs[HDSPM_MAX_CHANNELS] = {
426}; 426};
427 427
428 428
429static struct pci_device_id snd_hdspm_ids[] = { 429static struct pci_device_id snd_hdspm_ids[] __devinitdata = {
430 { 430 {
431 .vendor = PCI_VENDOR_ID_XILINX, 431 .vendor = PCI_VENDOR_ID_XILINX,
432 .device = PCI_DEVICE_ID_XILINX_HAMMERFALL_DSP_MADI, 432 .device = PCI_DEVICE_ID_XILINX_HAMMERFALL_DSP_MADI,
diff --git a/sound/pci/rme9652/rme9652.c b/sound/pci/rme9652/rme9652.c
index a687eb63236f..75d6406303d3 100644
--- a/sound/pci/rme9652/rme9652.c
+++ b/sound/pci/rme9652/rme9652.c
@@ -315,7 +315,7 @@ static void snd_hammerfall_free_buffer(struct snd_dma_buffer *dmab, struct pci_d
315} 315}
316 316
317 317
318static struct pci_device_id snd_rme9652_ids[] = { 318static struct pci_device_id snd_rme9652_ids[] __devinitdata = {
319 { 319 {
320 .vendor = 0x10ee, 320 .vendor = 0x10ee,
321 .device = 0x3fc4, 321 .device = 0x3fc4,
diff --git a/sound/pci/sonicvibes.c b/sound/pci/sonicvibes.c
index 2d66a09fe5ee..91f8bf3ae9fa 100644
--- a/sound/pci/sonicvibes.c
+++ b/sound/pci/sonicvibes.c
@@ -243,7 +243,7 @@ struct sonicvibes {
243#endif 243#endif
244}; 244};
245 245
246static struct pci_device_id snd_sonic_ids[] = { 246static struct pci_device_id snd_sonic_ids[] __devinitdata = {
247 { 0x5333, 0xca00, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, 247 { 0x5333, 0xca00, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, },
248 { 0, } 248 { 0, }
249}; 249};
diff --git a/sound/pci/trident/trident.c b/sound/pci/trident/trident.c
index b4538045049f..9624a5f2b875 100644
--- a/sound/pci/trident/trident.c
+++ b/sound/pci/trident/trident.c
@@ -63,7 +63,7 @@ MODULE_PARM_DESC(pcm_channels, "Number of hardware channels assigned for PCM.");
63module_param_array(wavetable_size, int, NULL, 0444); 63module_param_array(wavetable_size, int, NULL, 0444);
64MODULE_PARM_DESC(wavetable_size, "Maximum memory size in kB for wavetable synth."); 64MODULE_PARM_DESC(wavetable_size, "Maximum memory size in kB for wavetable synth.");
65 65
66static struct pci_device_id snd_trident_ids[] = { 66static struct pci_device_id snd_trident_ids[] __devinitdata = {
67 {PCI_DEVICE(PCI_VENDOR_ID_TRIDENT, PCI_DEVICE_ID_TRIDENT_4DWAVE_DX), 67 {PCI_DEVICE(PCI_VENDOR_ID_TRIDENT, PCI_DEVICE_ID_TRIDENT_4DWAVE_DX),
68 PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, 0}, 68 PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, 0},
69 {PCI_DEVICE(PCI_VENDOR_ID_TRIDENT, PCI_DEVICE_ID_TRIDENT_4DWAVE_NX), 69 {PCI_DEVICE(PCI_VENDOR_ID_TRIDENT, PCI_DEVICE_ID_TRIDENT_4DWAVE_NX),
diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c
index 0f171dd1377b..39daf62d2bad 100644
--- a/sound/pci/via82xx.c
+++ b/sound/pci/via82xx.c
@@ -123,6 +123,7 @@ module_param(enable, bool, 0444);
123#define VIA_REV_8233A 0x40 /* 1 rec, 1 multi-pb, spdf */ 123#define VIA_REV_8233A 0x40 /* 1 rec, 1 multi-pb, spdf */
124#define VIA_REV_8235 0x50 /* 2 rec, 4 pb, 1 multi-pb, spdif */ 124#define VIA_REV_8235 0x50 /* 2 rec, 4 pb, 1 multi-pb, spdif */
125#define VIA_REV_8237 0x60 125#define VIA_REV_8237 0x60
126#define VIA_REV_8251 0x70
126 127
127/* 128/*
128 * Direct registers 129 * Direct registers
@@ -395,7 +396,7 @@ struct via82xx {
395#endif 396#endif
396}; 397};
397 398
398static struct pci_device_id snd_via82xx_ids[] = { 399static struct pci_device_id snd_via82xx_ids[] __devinitdata = {
399 /* 0x1106, 0x3058 */ 400 /* 0x1106, 0x3058 */
400 { PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_5, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TYPE_CARD_VIA686, }, /* 686A */ 401 { PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_5, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TYPE_CARD_VIA686, }, /* 686A */
401 /* 0x1106, 0x3059 */ 402 /* 0x1106, 0x3059 */
@@ -862,6 +863,11 @@ static snd_pcm_uframes_t snd_via8233_pcm_pointer(struct snd_pcm_substream *subst
862 if (!status) 863 if (!status)
863 status = inb(VIADEV_REG(viadev, OFFSET_STATUS)); 864 status = inb(VIADEV_REG(viadev, OFFSET_STATUS));
864 865
866 /* An apparent bug in the 8251 is worked around by sending a
867 * REG_CTRL_START. */
868 if (chip->revision == VIA_REV_8251 && (status & VIA_REG_STAT_EOL))
869 snd_via82xx_pcm_trigger(substream, SNDRV_PCM_TRIGGER_START);
870
865 if (!(status & VIA_REG_STAT_ACTIVE)) { 871 if (!(status & VIA_REG_STAT_ACTIVE)) {
866 res = 0; 872 res = 0;
867 goto unlock; 873 goto unlock;
@@ -2313,6 +2319,7 @@ static struct via823x_info via823x_cards[] __devinitdata = {
2313 { VIA_REV_8233A, "VIA 8233A", TYPE_VIA8233A }, 2319 { VIA_REV_8233A, "VIA 8233A", TYPE_VIA8233A },
2314 { VIA_REV_8235, "VIA 8235", TYPE_VIA8233 }, 2320 { VIA_REV_8235, "VIA 8235", TYPE_VIA8233 },
2315 { VIA_REV_8237, "VIA 8237", TYPE_VIA8233 }, 2321 { VIA_REV_8237, "VIA 8237", TYPE_VIA8233 },
2322 { VIA_REV_8251, "VIA 8251", TYPE_VIA8233 },
2316}; 2323};
2317 2324
2318/* 2325/*
@@ -2325,7 +2332,7 @@ struct dxs_whitelist {
2325 short action; /* new dxs_support value */ 2332 short action; /* new dxs_support value */
2326}; 2333};
2327 2334
2328static int __devinit check_dxs_list(struct pci_dev *pci) 2335static int __devinit check_dxs_list(struct pci_dev *pci, int revision)
2329{ 2336{
2330 static struct dxs_whitelist whitelist[] = { 2337 static struct dxs_whitelist whitelist[] = {
2331 { .subvendor = 0x1005, .subdevice = 0x4710, .action = VIA_DXS_ENABLE }, /* Avance Logic Mobo */ 2338 { .subvendor = 0x1005, .subdevice = 0x4710, .action = VIA_DXS_ENABLE }, /* Avance Logic Mobo */
@@ -2342,6 +2349,7 @@ static int __devinit check_dxs_list(struct pci_dev *pci)
2342 { .subvendor = 0x1043, .subdevice = 0x810d, .action = VIA_DXS_SRC }, /* ASUS */ 2349 { .subvendor = 0x1043, .subdevice = 0x810d, .action = VIA_DXS_SRC }, /* ASUS */
2343 { .subvendor = 0x1043, .subdevice = 0x812a, .action = VIA_DXS_SRC }, /* ASUS A8V Deluxe */ 2350 { .subvendor = 0x1043, .subdevice = 0x812a, .action = VIA_DXS_SRC }, /* ASUS A8V Deluxe */
2344 { .subvendor = 0x1043, .subdevice = 0x8174, .action = VIA_DXS_SRC }, /* ASUS */ 2351 { .subvendor = 0x1043, .subdevice = 0x8174, .action = VIA_DXS_SRC }, /* ASUS */
2352 { .subvendor = 0x1043, .subdevice = 0x81b9, .action = VIA_DXS_SRC }, /* ASUS A8V-MX */
2345 { .subvendor = 0x1071, .subdevice = 0x8375, .action = VIA_DXS_NO_VRA }, /* Vobis/Yakumo/Mitac notebook */ 2353 { .subvendor = 0x1071, .subdevice = 0x8375, .action = VIA_DXS_NO_VRA }, /* Vobis/Yakumo/Mitac notebook */
2346 { .subvendor = 0x1071, .subdevice = 0x8399, .action = VIA_DXS_NO_VRA }, /* Umax AB 595T (VIA K8N800A - VT8237) */ 2354 { .subvendor = 0x1071, .subdevice = 0x8399, .action = VIA_DXS_NO_VRA }, /* Umax AB 595T (VIA K8N800A - VT8237) */
2347 { .subvendor = 0x10cf, .subdevice = 0x118e, .action = VIA_DXS_ENABLE }, /* FSC laptop */ 2355 { .subvendor = 0x10cf, .subdevice = 0x118e, .action = VIA_DXS_ENABLE }, /* FSC laptop */
@@ -2405,6 +2413,10 @@ static int __devinit check_dxs_list(struct pci_dev *pci)
2405 } 2413 }
2406 } 2414 }
2407 2415
2416 /* for newer revision, default to DXS_SRC */
2417 if (revision >= VIA_REV_8235)
2418 return VIA_DXS_SRC;
2419
2408 /* 2420 /*
2409 * not detected, try 48k rate only to be sure. 2421 * not detected, try 48k rate only to be sure.
2410 */ 2422 */
@@ -2449,7 +2461,7 @@ static int __devinit snd_via82xx_probe(struct pci_dev *pci,
2449 } 2461 }
2450 if (chip_type != TYPE_VIA8233A) { 2462 if (chip_type != TYPE_VIA8233A) {
2451 if (dxs_support == VIA_DXS_AUTO) 2463 if (dxs_support == VIA_DXS_AUTO)
2452 dxs_support = check_dxs_list(pci); 2464 dxs_support = check_dxs_list(pci, revision);
2453 /* force to use VIA8233 or 8233A model according to 2465 /* force to use VIA8233 or 8233A model according to
2454 * dxs_support module option 2466 * dxs_support module option
2455 */ 2467 */
diff --git a/sound/pci/via82xx_modem.c b/sound/pci/via82xx_modem.c
index 22ce4d309929..ef97e50cd6c2 100644
--- a/sound/pci/via82xx_modem.c
+++ b/sound/pci/via82xx_modem.c
@@ -261,7 +261,7 @@ struct via82xx_modem {
261 struct snd_info_entry *proc_entry; 261 struct snd_info_entry *proc_entry;
262}; 262};
263 263
264static struct pci_device_id snd_via82xx_modem_ids[] = { 264static struct pci_device_id snd_via82xx_modem_ids[] __devinitdata = {
265 { 0x1106, 0x3068, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TYPE_CARD_VIA82XX_MODEM, }, 265 { 0x1106, 0x3068, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TYPE_CARD_VIA82XX_MODEM, },
266 { 0, } 266 { 0, }
267}; 267};
diff --git a/sound/pci/vx222/vx222.c b/sound/pci/vx222/vx222.c
index c816ddf1b215..0f1ebb010a5e 100644
--- a/sound/pci/vx222/vx222.c
+++ b/sound/pci/vx222/vx222.c
@@ -60,7 +60,7 @@ enum {
60 VX_PCI_VX222_NEW 60 VX_PCI_VX222_NEW
61}; 61};
62 62
63static struct pci_device_id snd_vx222_ids[] = { 63static struct pci_device_id snd_vx222_ids[] __devinitdata = {
64 { 0x10b5, 0x9050, 0x1369, PCI_ANY_ID, 0, 0, VX_PCI_VX222_OLD, }, /* PLX */ 64 { 0x10b5, 0x9050, 0x1369, PCI_ANY_ID, 0, 0, VX_PCI_VX222_OLD, }, /* PLX */
65 { 0x10b5, 0x9030, 0x1369, PCI_ANY_ID, 0, 0, VX_PCI_VX222_NEW, }, /* PLX */ 65 { 0x10b5, 0x9030, 0x1369, PCI_ANY_ID, 0, 0, VX_PCI_VX222_NEW, }, /* PLX */
66 { 0, } 66 { 0, }
diff --git a/sound/pci/ymfpci/ymfpci.c b/sound/pci/ymfpci/ymfpci.c
index db57ce939fa8..65ebf5f1933a 100644
--- a/sound/pci/ymfpci/ymfpci.c
+++ b/sound/pci/ymfpci/ymfpci.c
@@ -70,7 +70,7 @@ MODULE_PARM_DESC(rear_switch, "Enable shared rear/line-in switch");
70module_param_array(rear_swap, bool, NULL, 0444); 70module_param_array(rear_swap, bool, NULL, 0444);
71MODULE_PARM_DESC(rear_swap, "Swap rear channels (must be enabled for correct IEC958 (S/PDIF)) output"); 71MODULE_PARM_DESC(rear_swap, "Swap rear channels (must be enabled for correct IEC958 (S/PDIF)) output");
72 72
73static struct pci_device_id snd_ymfpci_ids[] = { 73static struct pci_device_id snd_ymfpci_ids[] __devinitdata = {
74 { 0x1073, 0x0004, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* YMF724 */ 74 { 0x1073, 0x0004, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* YMF724 */
75 { 0x1073, 0x000d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* YMF724F */ 75 { 0x1073, 0x000d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* YMF724F */
76 { 0x1073, 0x000a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* YMF740 */ 76 { 0x1073, 0x000a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* YMF740 */
diff --git a/sound/pcmcia/Kconfig b/sound/pcmcia/Kconfig
index 5d1b0b762efa..c9fa1a2bc58b 100644
--- a/sound/pcmcia/Kconfig
+++ b/sound/pcmcia/Kconfig
@@ -5,7 +5,7 @@ menu "PCMCIA devices"
5 5
6config SND_VXPOCKET 6config SND_VXPOCKET
7 tristate "Digigram VXpocket" 7 tristate "Digigram VXpocket"
8 depends on SND && PCMCIA && ISA 8 depends on SND && PCMCIA
9 select SND_VX_LIB 9 select SND_VX_LIB
10 help 10 help
11 Say Y here to include support for Digigram VXpocket and 11 Say Y here to include support for Digigram VXpocket and
@@ -16,7 +16,7 @@ config SND_VXPOCKET
16 16
17config SND_PDAUDIOCF 17config SND_PDAUDIOCF
18 tristate "Sound Core PDAudioCF" 18 tristate "Sound Core PDAudioCF"
19 depends on SND && PCMCIA && ISA 19 depends on SND && PCMCIA
20 select SND_PCM 20 select SND_PCM
21 help 21 help
22 Say Y here to include support for Sound Core PDAudioCF 22 Say Y here to include support for Sound Core PDAudioCF
diff --git a/sound/ppc/daca.c b/sound/ppc/daca.c
index aa09ebd9ffb8..46eebf5610e3 100644
--- a/sound/ppc/daca.c
+++ b/sound/ppc/daca.c
@@ -255,7 +255,7 @@ int __init snd_pmac_daca_init(struct snd_pmac *chip)
255 255
256#ifdef CONFIG_KMOD 256#ifdef CONFIG_KMOD
257 if (current->fs->root) 257 if (current->fs->root)
258 request_module("i2c-keywest"); 258 request_module("i2c-powermac");
259#endif /* CONFIG_KMOD */ 259#endif /* CONFIG_KMOD */
260 260
261 mix = kmalloc(sizeof(*mix), GFP_KERNEL); 261 mix = kmalloc(sizeof(*mix), GFP_KERNEL);
diff --git a/sound/ppc/toonie.c b/sound/ppc/toonie.c
index 4e595172e423..1ac7c8552f50 100644
--- a/sound/ppc/toonie.c
+++ b/sound/ppc/toonie.c
@@ -335,7 +335,7 @@ static void toonie_cleanup(struct snd_pmac *chip)
335 chip->mixer_data = NULL; 335 chip->mixer_data = NULL;
336} 336}
337 337
338int snd_pmac_toonie_init(struct snd_pmac *chip) 338int __init snd_pmac_toonie_init(struct snd_pmac *chip)
339{ 339{
340 struct pmac_toonie *mix; 340 struct pmac_toonie *mix;
341 341
diff --git a/sound/ppc/tumbler.c b/sound/ppc/tumbler.c
index 1146dd882bb1..70e4ebc70260 100644
--- a/sound/ppc/tumbler.c
+++ b/sound/ppc/tumbler.c
@@ -1313,7 +1313,7 @@ int __init snd_pmac_tumbler_init(struct snd_pmac *chip)
1313 1313
1314#ifdef CONFIG_KMOD 1314#ifdef CONFIG_KMOD
1315 if (current->fs->root) 1315 if (current->fs->root)
1316 request_module("i2c-keywest"); 1316 request_module("i2c-powermac");
1317#endif /* CONFIG_KMOD */ 1317#endif /* CONFIG_KMOD */
1318 1318
1319 mix = kmalloc(sizeof(*mix), GFP_KERNEL); 1319 mix = kmalloc(sizeof(*mix), GFP_KERNEL);
diff --git a/sound/usb/usbquirks.h b/sound/usb/usbquirks.h
index 0992a0923f1a..9351846d7a9d 100644
--- a/sound/usb/usbquirks.h
+++ b/sound/usb/usbquirks.h
@@ -1531,6 +1531,15 @@ YAMAHA_DEVICE(0x7010, "UB99"),
1531 } 1531 }
1532}, 1532},
1533{ 1533{
1534 USB_DEVICE_VENDOR_SPEC(0x0ccd, 0x0014),
1535 .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
1536 .vendor_name = "TerraTec",
1537 .product_name = "PHASE 26",
1538 .ifnum = 3,
1539 .type = QUIRK_MIDI_STANDARD_INTERFACE
1540 }
1541},
1542{
1534 USB_DEVICE(0x0ccd, 0x0035), 1543 USB_DEVICE(0x0ccd, 0x0035),
1535 .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { 1544 .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
1536 .vendor_name = "Miditech", 1545 .vendor_name = "Miditech",
diff --git a/usr/gen_init_cpio.c b/usr/gen_init_cpio.c
index 33dbcbf77c5b..83acd6cc0b3c 100644
--- a/usr/gen_init_cpio.c
+++ b/usr/gen_init_cpio.c
@@ -471,6 +471,7 @@ int main (int argc, char *argv[])
471 "ERROR: incorrect format, could not locate file type line %d: '%s'\n", 471 "ERROR: incorrect format, could not locate file type line %d: '%s'\n",
472 line_nr, line); 472 line_nr, line);
473 ec = -1; 473 ec = -1;
474 break;
474 } 475 }
475 476
476 if ('\n' == *type) { 477 if ('\n' == *type) {
@@ -506,7 +507,8 @@ int main (int argc, char *argv[])
506 line_nr, line); 507 line_nr, line);
507 } 508 }
508 } 509 }
509 cpio_trailer(); 510 if (ec == 0)
511 cpio_trailer();
510 512
511 exit(ec); 513 exit(ec);
512} 514}